Commit Graph

420 Commits

Author SHA1 Message Date
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
Joseph Chen 11a8d4b2e0 Merge branch 'next-dev' into thunder-boot 2020-04-21 11:09:09 +08:00
Jason Zhu d300a21655 spl: mtd_blk: support load fit firmware
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I3a32874977a7aa654b8e3fb432e3637b900525ab
2020-04-21 10:38:15 +08:00
Joseph Chen b0a6db3b4a Merge branch 'next-dev' into thunder-boot 2020-04-20 19:55:03 +08:00
Joseph Chen 30ef03eb67 spl: print entry point for U-Boot and OP-TEE
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ifeb52986851b93cb634f177e3834cbf681f3dfb0
2020-04-20 19:42:03 +08:00
Joseph Chen c637f2321b Merge branch 'next-dev' into thunder-boot
Change-Id: I22ac688008080eac49169d752a94b66668f890fc

Conflicts:
	drivers/phy/Kconfig
	drivers/phy/Makefile
2020-04-16 15:48:00 +08:00
Joseph Chen a515b6d27e fit: spl: verify hashes of images by default
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Iea4eabcd87ea612eeeb7cb5e34ce26adee053557
2020-04-16 14:18:10 +08:00
Jason Zhu 2996edba74 common: spl: mmc: clean up the useless log
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Ibf588d918ce6471aeb540321118e51877ce6fea0
2020-04-15 20:58:18 +08:00
Jason Zhu 6177e32d3d spl: rkfw: support decompress kernel and ramdisk
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I172b75ed0587726f5d465dcbb20bf9aa7e65e1e4
2020-04-15 11:55:40 +08:00
Jason Zhu fcf012f8b3 spl: Kconfig: add config SPL_KERNEL_COMPRESS_ADDR & SPL_RAMDISK_COMPRESS_ADDR
Load compressed kernel and ramdisk firmwares in these addresses.

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Icca49069fcaa08c19f5ef574d9ec4f803dbba6d1
2020-04-15 11:55:40 +08:00
Joseph Chen a873a53297 Merge branch 'next-dev' into thunder-boot 2020-04-14 14:16:56 +08:00
Jason Zhu 342d050ebb spl: fit: support boot standalone firmware
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Ib3e35cfba0bb52141c8948de994f5e6c9661887f
2020-04-14 12:45:33 +08:00
Joseph Chen f8f8bbc62f Merge branch 'next-dev' into thunder-boot 2020-04-10 12:05:09 +08:00
Joseph Chen 22c7c1a827 spl: fit: support load multiple backup of images
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I29bce60f1b958baedbd2b45e86a611b89547c0d8
2020-04-10 10:22:22 +08:00
Joseph Chen 7a1370759d fit: add rollback index protect support
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I3af0049532d7b34adadbbb1faf6c54aad6232f93
2020-04-09 18:26:22 +08:00
Joseph Chen f8ca9d164a spl: do cleanup before jumping to next stage
Cache/mmu/interrupt cleanup is recommand before jumping to
next stage to avoid some uncertain things.

Provide a arch/board-specific callback to do cleanup things.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ic5e4e378ec9080e7af283741370bcd9c2dc897dc
2020-04-09 18:26:22 +08:00
Jason Zhu 4ef4c8bf6e spl: rkfw: goto boot next stage directly if find used uboot
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Ia32663b91e1360bc491f1db364900eb5b27892f9
2020-04-08 19:09:09 +08:00
Joseph Chen 41bb8b737c Merge branch 'next-dev' into thunder-boot
Conflicts:
	common/spl/spl_rkfw.c
	drivers/pinctrl/pinctrl-rockchip.c
	make.sh

Change-Id: I93f4dbe1e067c3b938bf64c4964bd5e7023b1daf
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2020-04-07 21:18:08 +08:00
Joseph Chen aa415ed977 common: spl: fix cherry-pick sync conflict
fixes: (1cb393f common: spl: rkfw: support bing-up arm32 firmware)

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I1b7f1a6269794ea9a4a508933381bbb8e3e7133b
2020-04-07 21:00:48 +08:00
Joseph Chen 568848617e common: spl: set default address for entry_point_os
Could be override in boot_from_devices().

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ifbfac5903ec61e65739732949f9e6b8a2704155d
(cherry picked from commit f8ca32e1ca)
2020-04-07 17:47:16 +08:00
Jason Zhu 605bf846bd common: spl: jump next process depend on entry_point_os
The spl can bring up uboot & kernel, and their entry points are diffirent,
so pass their entry points by entry_point_os.

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I625d135d219cfbfb620ff1e3d0de5278143f4079
(cherry picked from commit 78628ac9a9)
2020-04-07 17:47:16 +08:00
Jason Zhu 1cb393f1c8 common: spl: rkfw: support bing-up arm32 firmware
1. the arm32 trust firmware is diffirent with arm64, support it.
2. add entry_point_os to indicate the uboot or kernel entry point.

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I24d1601323e99f40e81d18f1937f762b2ecc137f
(cherry picked from commit a64fd729d4)

Change-Id: I3b1420989d158c52259365d90011524b047b5750
2020-04-07 17:47:16 +08:00
Jason Zhu fcb65c6194 spl: rkfw: support bring up different next stage
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Idfca034d4d3eb5a4f757678e62efd7765bf89840
2020-04-04 10:55:58 +08:00
Jason Zhu 440eb126fa spl: rkfw: add boot_sector to seperate uboot and boot load-address
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I04e2b00a8615fee24ee7722ab7bb9ad4931f4332
2020-04-04 10:55:58 +08:00