Commit Graph

5028 Commits

Author SHA1 Message Date
Jason Zhu d06e16f8b1 common: fit: fix calculate data error
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I3bea25d1d4c2d9e846146e33dbd7a5454ceca853
2020-12-11 17:37:33 +08:00
Jason Zhu 78263d89a3 rsa: support write public hash in spl
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I4120d0cad1cb24b45c3b281649e1eba520a11ee2
2020-12-10 15:59:22 +08:00
Yifeng Zhao ffc357038c spl: support boot from rknand device
Signed-off-by: Yifeng Zhao <yifeng.zhao@rock-chips.com>
Change-Id: I168ec42ec1ac4bc1e8b640fba22357cde4a26aac
2020-11-30 09:53:12 +08:00
Joseph Chen 39b9f515bc spl: fit: update U-Boot entry point by image info
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
2020-11-26 15:43:56 +08:00
Joseph Chen 69a04b4fa5 spl: atf: traverse all "/fit-images" sub nodes
Fix find sub nodes failed.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I2cb885028da9711a15f001fdd48e9d273cfd348a
2020-11-26 15:43:56 +08:00
Jason Zhu 5d4ebb14fc spl: modify the spl log
Correct the log when bring up kernel with spl directly.

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Ic3204d8ddab37c3a5aac3488e209b3764e96a977
2020-11-25 22:17:34 +08:00
Weiwen Chen 4623d13df7 spl: Kconfig: update SPL_KERNEL_BOOT_SECTOR depend on
Signed-off-by: Weiwen Chen <cww@rock-chips.com>
Change-Id: I0284e105960dd58690c779903c227c371a4611fc
2020-11-24 16:33:22 +08:00
Jason Zhu a9e6d1e544 spl: mtd_blk: redefine the mtd device name
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
2020-11-24 14:47:34 +08:00
Jason Zhu cd081a9734 spl: rkfw: fix printing error message
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I4cfd0de01b826aaa21c7269e1b814e234670561a
2020-11-20 15:57:44 +08:00
Jason Zhu a741b19cf7 spl: fit: map the bad block table depending on the image's size
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I6a257327fce16c8bf5ce10c8cbae0b60e044eb88
2020-11-18 16:11:15 +08:00
Joseph Chen 9d23fbe3b7 spl: fit: load kernel dtb if need
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
2020-11-14 15:32:03 +08:00
Joseph Chen d6e082ceff common: board_f: print kern.dtb address
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I8f593632676cad3758c37d5a027932bc1302f0d5
2020-11-14 15:32:03 +08:00
Joseph Chen 253ea6c67d common: android: independent on optee client
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I5c124c7bfcdfd3c2972a5310046b633324e3bdf0
2020-11-09 17:20:46 +08:00
Joseph Chen 713cdac3a7 common: android: allow failed to overly dtbo
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
2020-11-09 14:51:56 +08:00
Joseph Chen a5aaa1e14d common: fdt_support: remove earlycon if uart is disabled
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
2020-11-02 18:34:22 +08:00
Joseph Chen 034db99592 dm: serial: support always use uart debug mode
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
2020-11-02 18:34:22 +08:00
Joseph Chen 912fa0754a common: board_f.c: add fpga init call
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I5fb507094207b14ad64cf3dee646aaac177bf43d
2020-11-02 16:39:14 +08:00
Joseph Chen cc0848dfb9 common: android: simplify image verify/un-verify
Support hash verify if header version < 3.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I2ade1a50aa26cd94c4464c25c86836421d973f00
2020-10-30 18:27:07 +08:00
Jason Zhu 651b0d0dfc common: android: move crypto_sha_init() after load IMG_RK_DTB
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
2020-10-30 15:18:37 +08:00
Lin Jinhan 1817f8c289 common: android: crypto v2 hash need length in crypto_sha_init
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>
2020-10-30 09:58:59 +08:00
Jason Zhu beeaf83f44 common: android: support AVB_SLOT_VERIFY_FLAGS_NO_VBMETA_PARTITION
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>
2020-10-26 16:39:25 +08:00
Jason Zhu 516562c2d3 spl: mtd_blk: support get image sector address by part info
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I85d5433ce165a8b027e485c694315c492467c6d9
2020-10-26 09:28:39 +08:00
Jason Zhu cee2fb0e57 common: android_ab: move the ab functions to android_ab.c
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
2020-10-22 19:38:57 +08:00
Jason Zhu cf87ffd351 include: android_image: move some android common definitions to this file
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Ia0da707408bcd43b50b49cef89495af7f9d97cd7
2020-10-22 19:38:57 +08:00
Joseph Chen 295b646621 spl: fit: print ATF and U-Boot load address
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I0b732934c1aa63ed6e849d85bd77fa8ec1f622b3
2020-10-22 16:37:49 +08:00
Joseph Chen e7498cb05b common: android: show ramdisk size of boot and vendor-boot
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ia8eca7010989e64d10b09628a12bcfc5aaeb988c
2020-10-10 16:17:06 +08:00
Dayao Ji 132e9ecacf rockchip: rkimg: Add R/W interfaces for virtual A/B metadata
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
2020-09-23 16:26:32 +08:00
Joseph Chen 745aeb1a7d common: android: add boot_img_hdr_v3 and vendor boot support
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
2020-09-18 14:41:37 +08:00
Joseph Chen 93fd134f77 common: malloc simple: enable space exhausted message
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: If089f38abf5e205a2b9f00fd2d735751fd7d5201
2020-09-17 20:03:01 +08:00
Joseph Chen 69b1ad4693 common: android: clean up code
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I98dfd54edd813f892c5f2717a694b2424b8ecded
2020-09-15 10:55:29 +08:00
Jason Zhu fdb19f3978 spl: fit: add file spl_fit_tb_arm_v7.S
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I59554a339cbad5f03806c6b1007ccf69e03be470
2020-09-07 16:26:04 +08:00
Jason Zhu 2201a451d5 common: fit: add fit_image_is_preload()
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I3c3001a347ae59fcfd186156382c04b4b8a77546
2020-09-07 14:53:06 +08:00
Joseph Chen 3eac03e218 common: spl: ab: allow missing misc partition
Return partition name without any slot suffix in this case.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: If0692e3e2845f152802632994f5da5a9d3fb1731
2020-09-02 17:10:09 +08:00
Joseph Chen b8fa09953a common: console: support enable timestamp in SPL
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Iefe5f9ea6e9abb8c3cc07e75beb68c387f20320f
2020-09-02 16:35:17 +08:00
Joseph Chen 29725e8530 spl: fit: print invalid fit magic
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I89da3797e444bb12e58cf99f902cb758c6fd82f9
2020-08-20 15:09:09 +08:00
Joseph Chen a00b516f44 spl: fit: use CONFIG_SPL_KERNEL_BOOT for thunder-boot
This option was added by RKFW boot flow, let's reuse it.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Id4625a783747ce2e4ebaf69a5fa3812077a79639
2020-08-20 15:04:37 +08:00
Joseph Chen 45d851f407 common: spl: show total time of SPL
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I93de59f4064a2579f8010da2655607f45840f8ed
2020-08-20 15:04:37 +08:00
Jason Zhu 01c0df48f9 common: android: decrease ab tries count after load firmware successfully
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I31842eda26f05b03ea6a0274502a60814e00e6a0
2020-08-19 17:05:30 +08:00
Joseph Chen 50466f5805 spl: fit: update newline position
Adding newline after board_fit_image_post_process() message.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I325f26bfb33638a4dfe8fef473d6c5062e566158
2020-07-27 20:03:53 +08:00
Jason Zhu fb743922bc spl: mtd_blk: use CONFIG_MTD_BLK_U_BOOT_OFFS as uboot location address
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I7a8e75095e30541947503481e214462b3d543fd0
2020-07-24 18:43:48 +08:00
Jason Zhu 3b1ddd14f7 spl: add CONFIG_MTD_BLK_U_BOOT_OFFS
Find the uboot by CONFIG_MTD_BLK_U_BOOT_OFFS address from nand,
spi nand, nor flash with mtd block interface.

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I6032570406a8eda2609ad877785e71c6c8b5df0c
2020-07-24 18:43:48 +08:00
Joseph Chen d3bfb68b0c spl: fit: seperate compress and decompress address
Address definition:
	comp = <0x...>: compress image address;
	load = <0x...>: decompress image address;

We default reserve 1MB size for decompress if there is
no "comp = <0x...>", assuming it's enough for U-Boot,
tee and atf, etc.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ic82f69551301121f08fba88ff433ad5789859b70
2020-07-24 18:02:27 +08:00
Joseph Chen e12dde2d59 spl: fit: support load kernel fit
Support load kernel fit image from boot/recovery partition
and ignore U-Boot proper if we expect to boot kernel in SPL.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I220c70c784e2327feea591756cbbde97ada8335f
2020-07-24 18:02:27 +08:00
Joseph Chen 3d94fb2890 Kconfig: fit: add options for loading kernel in SPL
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ice46bc2e457bb8d421d9002057ee0f00af229da8
2020-07-24 18:02:27 +08:00
Joseph Chen 569a1737e3 spl: fit: add spl_fit_load_blob()
Move code to a function in order to be shared with other code.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I0d54ea7bb28a54a54eb313cda11c33f4d4564a84
2020-07-24 18:02:27 +08:00
Joseph Chen 8b16d676d3 spl: mmc: always load U-Boot partition
On the view of spl_xxx.c, it only cares about loading
U-Boot by spl_load_simple_fit().

Other partitions is better to be loaded in the
spl_load_simple_fit().

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I15625f7ebdb3aaee5491fddabf544951723b00a9
2020-07-24 18:02:27 +08:00
Joseph Chen a2b9279dbb spl: Kconfig: wrap some option by CONFIG_SPL_KERNEL_BOOT
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ia599ec3f94726e490467b5f8bc24199832d62dca
2020-07-24 18:02:27 +08:00
Joseph Chen 9c63328889 common: fit: update board_fit_image_post_process() args
Add more args for the function to parse more fit information.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I9be6607e5f7eb9b9912eb570f765dc6f634f956e
2020-07-24 18:02:27 +08:00
Joseph Chen 7385816b5a common: fit: add fit_image_get_comp_addr()
Add API to get compress address of image.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Id33d96795d5bb5db8d55a537f7d1c7a425b5b3e8
2020-07-24 18:02:27 +08:00
Wyon Bi d8123c4406 common: edid: fix the mode flag for interlaced
Fixes: b9e63a962a ("edid: support decode edid to drm modes")
Change-Id: I97cece70ff053bedd78b9af29be64c3d3d7679eb
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2020-07-16 16:21:18 +08:00