Commit Graph

5014 Commits

Author SHA1 Message Date
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
Philippe Reynes 85289e9d5d UPSTREAM: rsa: add support of padding pss
We add the support of the padding pss for rsa signature.
This new padding is often recommended instead of pkcs-1.5.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
(cherry picked from commit 061daa0b61f0fbeb214c566f3adb23da05545320)

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I28e5722504bfd0428cd119b2aaae60682a720648
2020-07-15 10:33:36 +08:00
Philippe Reynes 219050bf6a UPSTREAM: rsa: add a structure for the padding
The rsa signature use a padding algorithm. By default, we use the
padding pkcs-1.5. In order to add some new padding algorithm, we
add a padding framework to manage several padding algorithm.
The choice of the padding is done in the file .its.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
(cherry picked from commit 20031567e12bb312bff95b70767f6275e20f0346)

Conflicts:
	common/image-fit.c
	lib/rsa/rsa-sign.c
	lib/rsa/rsa-verify.c

Change-Id: Ie522fec1ea69e6b86ebde0f7dad91a45670da66b
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2020-07-15 10:33:36 +08:00
Joseph Chen a7560f55a3 spl: fit: not allow default configure node miss
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I07af21fdc371dcfdc55115febfc3e99ff41ee8d4
2020-07-13 20:41:52 +08:00
Joseph Chen ad07c38f68 tools: mkimage: support set FIT image version
Command: "./mkimage ... -v [version]".

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I84dd5c3d7380150f428cdd0c2055929343bf2138
2020-07-09 09:23:37 +08:00
Joseph Chen fe941802b2 common: image-fit: check hash calculation result
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I11ee44465512de5ca58e22b6b61d5be8f7d0842e
2020-07-08 17:20:32 +08:00
Joseph Chen e49e7bf9b1 spl: remove unused variable "rollback_index"
We prefer use "gd->rollback_index".

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I45bc64e38224064797d8d8bd89d9d3881f8793b5
2020-07-07 16:11:07 +08:00
Joseph Chen dec078707b common: image-fit: clean up hash calculate
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: If8b96eeab57232f790c8a83fd092cba1ce6ebd75
2020-07-07 14:36:20 +08:00
Algea Cao 00997ff116 edid: Move functions of sorting modes to edid.c
Not only does dw-hdmi use these functions, but others
need to use them, such as inno-hdmi.

Change-Id: I1ced6e30b7634511fecbbfb39c24ede78894dd1d
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2020-07-06 19:40:40 +08:00
Algea Cao d34efd258b edid: Complete hdmi infoframe
Complete hdmi infoframe interfaces.

Change-Id: I4a5408c83d08fb13dc1123a87d9037d4d9dc96da
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2020-07-06 19:40:40 +08:00
Joseph Chen 7f6bf349e1 common: image-fit: print bad hash value
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I948ff79b68be626797bcc41e8c1cb4dd1bc330bf
2020-07-06 18:40:50 +08:00
Joseph Chen 4fe117be42 common: image-fit: add API to get "/totalsize"
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Icca5200040ab14ad76515888cdaa4cd16f554af0
2020-07-06 16:10:46 +08:00
Joseph Chen 9db5ffeb00 common: image: add weak fit_read_otp_rollback_index()
Board should implement it.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I95023ce489c4335fdd9034d9577ce242eac0f1ea
2020-06-30 12:30:23 +08:00
Joseph Chen e5ca21e884 common: fit: add more info for otp index
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I9360d3d4bc16c1c1f5e4a2310e79858d38413eb8
2020-06-30 12:24:31 +08:00
Jason Zhu 9a65720b98 spl: fit: release and run mcu address depended on entry_point
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Ibbd28c604c6f6bf558f74c4b5a8064d894492015
2020-06-29 17:19:42 +08:00