In android A/B system, there is no recovery partition, but in the linux
system, we need the recovery to update system.
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Idac88720b260791b1ad4c51a5ebc7aae9c66ca67
Android Header v3 and vendor boot partition are introduced
from Android-11(R).
Header populate:
Header v3 is no longer compatible with v0/1/2 header, we
add populate_andr_img_hdr() to merge boot and vendor_boot
partition header into struct andr_img_hdr in order to
compatible with v0/1/2 header.
resource.img:
The second_addr and second_size fields are removed in v3,
so we require resource partition to restore resource.img.
A/B system:
If not A/B system, the boot.img header version is 3 and
recovery header is version 2.
AVB load image:
- If allow verification error: the image is loaded by
ops->get_preloaded_partition() which auto populates
boot_img_hdr_v3.
- If not allow verification error: the image is full loaded
by ops->read_from_partition() which doesn't populate
boot_img_hdr_v3, we need to fix it.
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I2afce53c43d782fc57baa01acf9c05518b580840
- clean init_resource_list();
- support create resource list and read file from memory
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: If308c1dc6f43d0250d81cfa6fb0898d59efe8975
rockchip_read_dtb_file() is top level api which reads dtb from
resource/fit/uImage/distro image, etc.
only leave code about resource image in resource_img.c.
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I2157ffc204ebd564aa9171de2b8167fbd6c94bcf
Rockchip platforms defines BCB message at the 16KB offset of
misc partition while the Google defines it at 0x0 offset.
From Android-Q, the 0x0 offset is mandary on Google VTS, so this
patch is a compatibility according to android image 'os_version'.
Android os version >= 10 is at 0x0 offset, otherwise at 16KB offset.
Change-Id: I54a7674e2dc2e0c29fc624f17b4453663c9ea462
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
This is important and necessary for U-disk firmware upgrade to
avoid loading the bad kernel dtb to init USB driver.
Also helpful for normal boot.
Change-Id: I81629991547ccb2930312278295e9737f4827945
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
At this moment, we just load file entries but not really load file.
Change-Id: I550e6bd90bcdf81f866c0d5f5c6b71faa0ecde19
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Only a few developers need this feature, disable it by default.
Change-Id: I074594c8e47c34a05324e363d11613383f3528a7
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
The partition disk layer takes over the responsibility of
slot suffix appending.
Change-Id: Ia02f5b8635676d49ec60eec7d3930740f2ba5ee4
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
- alloc sysmem after load kernel dtb successfully;
- allow distro kernel dtb to be loaded later than other
resource file, that is not controlled by code condition
"if (list_empty(&entrys_head))".
Change-Id: If1657289a4f8980ad7d7a5df7da0e061aab21504
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
dtb addr should add the size of recovery_dtbo when
recover_dtbo is included.
Change-Id: I97f7bd6e248f61413b530972abe46c3236bd0b01
Signed-off-by: Bian Jin chen <kenjc.bian@rock-chips.com>
- the dtb position was added in boot_img_hdr_v2;
- required for Android Q or later.
Change-Id: Ia0536f0fd68a4cdfc55356c6371d1b781f655a9a
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
If the seconds position is not a resource file, maybe it's a
dtb file.
Change-Id: I819cb0ff9c702c306000bf30fb47891009e4ff32
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
It prints like: "Android 8.1, Build 2019.7", maybe helpful
for debugging.
Change-Id: I10acbb6e8d864ae2daa2621bf9cfdf4b902a49b4
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
We provide a "logo" partition for user to store logo.bmp
and update from kernel user space dynamically.
This patch follows the rkdevelop usage:
- Only support store one picture named "logo.bmp";
- Use "dd" command to generate partition image with logo.img
eg: "dd if=logo.bmp of=logo.img count=1 bs=19456"
Change-Id: Iffde4d123e303c010d99cd446c241a535bce1dcf
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
We should parse node name to identify the gpio port before
reading base address, it avoids to use miss match address.
Move out gpio_parse_base_address() from sub string parse is
better.
Set gpio as input mode before reading.
Change-Id: Iffd4ef7f3ceb1bb56a65680265af74ca50b14712
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
It is optional to use dtb from distro images to initialize
periph drivers when kernel dtb function is enabled.
Change-Id: I7119962ba61d84c5ccdf2e515e21bb347e50b91b
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
- import memblk id to manage memory blocks;
- change "sysmem_property" to generic "memblock";
- use alloc instead of reserve for all memory blocks;
- clean up and fix some logic;
- add U-Boot cmd for sysmem;
Change-Id: I614223ce3bf97a7b3566412a9d1864fb30b68fd8
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Sometimes, framework or user would call fdt_increase_size() to update
fdt size, it's better reserve more space to avoid sysmem gives the fdt
region overflow report.
The CONFIG_SYS_FDT_PAD default value is sync with bootm framework
in: common/image-fdt.c
Change-Id: I363e9a4182e13b1628a76666acd8272d25db659d
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
It fixes the dead loop issue of "bootrkp" command:
......
=Booting Rockchip format image=
boot: invalid image tag(0x0)
boot_rockchip_image ramdisk part boot read error
bad resource image magic:
DTB: rk-kernel.dtb
invalid entry tag
invalid entry tag
invalid entry tag
invalid entry tag
......
Change-Id: Ia15f315eee94dce06800139ff547ebeee3847cae
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
sysmem avoids memory block overlap with each other.
Change-Id: I0013c3d05c69e19286cf1c76f936a17eaab1db49
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
clean up code and add comment for other interfaces.
Change-Id: Ibc64978d8db595c4fe76432faca77cdad9c949e6
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
We may have special operations for fdt(optional):
- apply fdt overlay;
- select fdt by adc or gpio;
We can't read default rk-kernel.dtb and pass it to kernel,
call rockchip_read_dtb_file() to get dtb.
Change-Id: I3aba002b0cfe324cc7c3852bf8b9561575590fd4
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
In AB system, build recovery as boot, there is no recovery partition
any more.
Change-Id: I434102d589b369a48ed71c6be3635a9a84f788e0
Signed-off-by: Dayao Ji <jdy@rock-chips.com>
- every bank is 8 pins, i.e. A0~A7, B0~B7, ...;
- add more quote for "cached_v[]";
Change-Id: I0e6a3ec5e66b95074894c893acd767ce83d34fec
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
It should not try to find dtb from resource partition depends
on boot mode, otherwiser in boot normal mode, it try to load
dtb from resource partition when we use boot.img(AOSP).
Change-Id: Ic27bb76ecbf80794e8c7298d209f139176ccef78
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
1. support adc value recognize;
2. support gpio value recognize;
Change-Id: I8bcbdd914405184d46029c4995c09b09e36c7ea3
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
In some project, eg.Linux OS, RKIMG do not have a ramdisk, we don't
need boot.img and boot partition in this case, so we need to get
the resource from resource.img instead of error return.
Change-Id: I88a1f8d7c532e9021f7dfa6c320049ed99f8f764
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
If apply the a/b system, open the macro CONFIG_ANDROID_AB.
Then get the dtb from the boot '_a' or '_b' image.
Change-Id: I21ad9d5a5e6e63e26bc16b1aeeb2e690c669a535
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>