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
This allows using CONFIG_IS_ENABLED(SPLMTD_WRITE) to compile out code
needed only if write support is required.
The option is added for u-boot and for SPL.
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Ia48169fcd601ad51d1723923ed71d610901275e1
The key point is to get kernel compression type by:
bootm_parse_comp((void *)(ulong)hdr + hdr->page_size);
Because if hdr->kernel_address is set as decompress
address before this comment, android_image_get_kernel_addr()
would return error kernel offset, result in a wrong
compression type from android_image_parse_comp().
Tested successfully on RK3568 EVB board:
- LZ4 Image + AVB full partition load
- LZ4 Image + AVB separate load
- LZ4 Image + none-AVB separate load
- Image + AVB full partition load
- Image + AVB separate load
- Image + none-AVB separate load
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ic5385843f036b52eb7a286b7194852accfb52225
This allows using CONFIG_IS_ENABLED(MMC_WRITE) to compile out code
needed only if write support is required.
The option is added for u-boot and for SPL
Change-Id: Ibb3836ed8713e491238460783a85ee1808770f66
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
(cherry picked from commit d6400c3f8520bb9a203fe397039279c80f093c27)
Before this patch:
Flattened Device Tree blob at 08300000
Booting using the fdt blob at 0x8300000
With this patch:
Flattened Device Tree blob at 0x08300000
Booting using the fdt blob at 0x08300000
Change-Id: Ibd5f1cfc07791eff829512d1820eb3c8c0caa007
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Otherwise it depends on static value CONFIG_SYS_TEXT_BASE
if the image node can't be found in "/fit-images".
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I103bd3467baaefb816ab34d7a2bf37547113e431
Correct the log when bring up kernel with spl directly.
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Ic3204d8ddab37c3a5aac3488e209b3764e96a977
Redefine the mtd device name according to the defination in
file blk.h:
BLK_MTD_NAND 0
BLK_MTD_SPI_NAND 1
BLK_MTD_SPI_NOR 2
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I75df9f0405d351c61929ff65781bfd4a26f2a1a4
kernel FDT is for U-Boot if there is not valid one from images,
ie: resource.img, boot.img or recovery.img. It is put right
after U-Boot FDT.
This is used for U-disk bing up.
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I348b6ea5736f46c091284c501e7e0f9c64cd2f78
Restore main fdt if it's destroyed by fdt_overlay_apply()
when overlay failed.
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Id26085f2df89d208caadeb3c4ce33f21f896ee22
If uart is required to be disabled during power on, it would be
not initialized by any pre-loader and U-Boot.
If we don't remove earlycon from commandline, kernel hangs while
using earlycon to putc/getc which may dead loop for waiting uart
status. (It seems the root cause is baundrate is not initilalized)
So let's remove earlycon from commandline.
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I2edcf48cb4dd301f2e79d5e94b1477c55198708f
In this mode, uart debug is initialized depends on
configuration from pre-loader or CONFIG_UART_DEBUG_.
The serial is not care about dts "stdout-path" and
not register into console framework any more. It's
nice to use pre-loader serial and make serial easy
to configure.
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: If4c68229d76b6f1710a35e3ef9a2a91cb306fa9c
We call crypto to verify dtb alone, so move the crypto_sha_init()
after load IMG_RK_DTB when begin another hash verification.
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I12f36172a5d03fa8baa0236503be5627fa18adf0
if not set ctx.length, you will get zero length hash value.
Change-Id: I9e653c845a36b4caea986c328c48ea8b2835da75
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
Usually, the recovery is updated alone, so attach the vbmeta to its tail.
Pass AVB_SLOT_VERIFY_FLAGS_NO_VBMETA_PARTITION to verify the recovery.
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Iaea6c8cd06f02ce946a84f8f568a7b91ef6dd40a
Signed-off-by: Yifeng Zhao <yifeng.zhao@rock-chips.com>
Move the ab functions to android_ab.c and add "ab_" prefix to
api function.
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I4527a0c957aa7853a1b75d456ca3fabaf80c1c57
According to the AOSP default definition, the virtual A/B
metadata is located at the offset 32KB of the misc partition.
Signed-off-by: Dayao Ji <jdy@rock-chips.com>
Change-Id: Ib60379f25e4c72be9f5ed03934ab7dc928cdd585
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
Return partition name without any slot suffix in this case.
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: If0692e3e2845f152802632994f5da5a9d3fb1731
This option was added by RKFW boot flow, let's reuse it.
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Id4625a783747ce2e4ebaf69a5fa3812077a79639