Commit Graph

443 Commits

Author SHA1 Message Date
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
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
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
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 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
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 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 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 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
Joseph Chen 35176ccb87 Revert "spl: fit: check image length"
This reverts commit 359ed52cc2.

This early return causes variable "image_info" not initialized.
spl_load_fit_image() should return 0 only at the end.

Change-Id: I7dba24826758763e6e4da56579546cb50b9cb984
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2020-06-29 10:14:11 +08:00
Jason Zhu e6832242e0 spl: rkfw: fix test misc_decompress_is_complete return value
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Ie378336e55d638e94f1d7c0c9dccb2c9b5ac6758
2020-06-18 10:34:16 +08:00
Joseph Chen 359ed52cc2 spl: fit: check image length
Do not go further if it is 0.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I1d4c07303a4998a9c112986ee4efda39c1d55d63
2020-06-15 11:41:08 +08:00
Jason Zhu 602b8060f1 spl: mmc: support load image depend on parameter next_stage
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I215cc0095d875fe8f4d58b27d49e30cb615e8167
2020-06-12 09:22:40 +08:00
Jason Zhu 1258f25b98 spl: rkfw: fix decompress error when boot.img has no ramdisk
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I43066282cd8449b08b37d5ef68d57dd3046b956b
2020-06-10 09:30:47 +08:00
Jason Zhu 44da3fa18e spl: mtd_blk: load rk firmware when load fit failed
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Ic8b0a397e9193e62f7349bbd2230d34b6485b58a
2020-06-09 11:01:59 +08:00
Jason Zhu 2e93c98a37 spl: mmc: fix partition error
The part_get_info_by_name() return number that is greater than
zero when called successfully.

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Ib3127f90368e7c2bfb9573c7d17e1e98dc67d9db
2020-06-09 10:09:06 +08:00
Joseph Chen 85f134f569 spl: mmc: add partition name to load image
Thus, the a/b system can be supported.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I8bceb3d56f50e5bb10de3ec7d4f7768aa7d61fe1
2020-06-08 16:23:31 +08:00
Joseph Chen 54ac22e074 spl: mtd blk: clean rkfw code
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I9afc158744895ac73ad54251ed68b1f959c8e9e6
2020-06-08 16:23:21 +08:00
Joseph Chen 34f805b88f spl: nand: clean rkfw code
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Icc07b4d18f4de3faf5b9e92da117a90b3c48ea4e
2020-06-08 16:23:21 +08:00
Joseph Chen 5458123932 spl: mmc: clean rkfw from mmc_load_image_raw_sector()
Don't mix rkfw in the mmc_load_image_raw_sector(), it's
not flexsible to add more feature for rkfw.

Pass blk desc to load.dev that the same as spl_mtd_blk.c

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I87ff776362a667ea0e558749016ae3ba7049e053
2020-06-08 16:23:21 +08:00
Joseph Chen 8a5f71e473 spl: rkfw: get partition sector independ on outside
- clean and simplify the code.
- support a/b system and spl boot kernel.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I1adb2c1853e51a01e80d7453715ba2aabe0fc973
2020-06-08 16:23:21 +08:00
Jason Zhu a6f23aea12 common: spl: define maximum decompressible size to prevent memory overrun
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Ib0be02bc85cb16ccdd832abf9a56260b2f2e500d
2020-06-05 09:14:02 +08:00
Jason Zhu ddb43797d5 spl: mtd_blk: apply mtd_blk_map_partitions()
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I9ed6ff49d5e366797ae1b4d9128432d1ad0e7728
2020-05-26 22:13:28 +08:00
Jason Zhu 69808149dc spl: rkfw: call misc_decompress_stop() to clear the decompress irq
Otherwise the next stage will respond to the decompress completed interrupt.

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Ie56a7eb939374bd5aac326bb3cd022225bf71dd2
2020-05-26 18:17:17 +08:00
Joseph Chen d41e543aa6 common: spl: initial spl->next_stage
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I5066612be4c90ff674b61034768eeaba9b9c9b85
2020-05-22 16:39:51 +08:00
Joseph Chen ab6f8011c4 Merge branch 'next-dev' into thunder-boot 2020-05-06 18:29:50 +08:00
Jason Zhu 1e33e3cb7c common: spl: ab: update new function to support ab system
Add spl_ab_append_part_slot()
Delete spl_get_partitions_sector()

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I116d6d708604762203974dc66a39be1a0e7b6bbe
2020-05-06 11:59:29 +08:00
Jason Zhu 9561619343 common: spl: mmc: delete ab system support in rkfw process
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I9cafffa266fbbe2c18c4300fdddb89944430cc0c
2020-05-06 11:59:22 +08:00
Joseph Chen 9c00c79ad8 Merge branch 'next-dev' into thunder-boot 2020-04-29 09:52:58 +08:00
Jason Zhu db9b4c53f2 common: spl: change TLB memory base align to SZ_16K
According to armv7 spec, translation table base 0 address is align to
2^(14-n). The n is set by TTBCR and is set to zero in uboot.

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I3d4c3f7165d3ef27bcc51d90471830f5e6dccae5
2020-04-29 09:07:43 +08:00
Joseph Chen e9e0746f31 Merge branch 'next-dev' into thunder-boot 2020-04-27 16:54:06 +08:00
Jason Zhu 4736384cd0 spl: Kconfig: add SPL_AB depends on SPL_EFI_PARTITION
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Id4500ae748f965235aac278baee07f278d88d70a
2020-04-27 14:32:51 +08:00
Joseph Chen 2bc8e1106f Merge branch 'next-dev' into thunder-boot 2020-04-23 16:43:12 +08:00
Joseph Chen 1cef1b20c4 dm: misc: merge generic header file into misc.h
Puting the generic function declaration together that the
caller don't need care too much about different header file.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ib37d1550e5a747d8f18e30c428ea8f613f9cc006
2020-04-23 16:17:06 +08:00
Joseph Chen 710cfa3daa Merge branch 'next-dev' into thunder-boot 2020-04-22 18:15:33 +08:00
Jason Zhu 5b7d32987c drivers: misc: use misc_mode to distinguish different device
The misc attach different device. We use the misc_mode to show
different device's capability.

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Ibce5bb0465e452a7e783c5859f1e8ab2bfd8b0c5
2020-04-22 18:08:19 +08:00
Joseph Chen 98894c7310 Merge branch 'next-dev' into thunder-boot 2020-04-21 16:19:07 +08:00
Joseph Chen 1f452cbf59 fit: support board sig verify require
Not allow non-signature image to boot if board requires
signature verify.

The board signature verify usually depends on otp/efuse
key is enabled or disabled.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I4e4dd201e74712a53cb0f481463b48532e30bb40
2020-04-21 12:02:02 +08:00