Commit Graph

50864 Commits

Author SHA1 Message Date
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 77827e2e47 rockchip: boot_mode: short the message
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I471943cc4c1598af5d56e95eea010fc3eaef9578
2020-07-24 18:05:13 +08:00
Joseph Chen 7c3a07ede8 lib: lz4_wrapper: fix data-abort due to odd address access
We don't clearly know why there is odd address, maybe the
compression itself does.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Iabf2c09839485a0b12301ea003f945e1de414d83
2020-07-24 18:02:27 +08:00
Joseph Chen 302043d6cf configs: rv1126: enable fit image post process
It enables decompress for images.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I90b843b81229dc7fd061a993ff3ae44f4e567077
2020-07-24 18:02:27 +08:00
Joseph Chen f7a20b1263 lib: gunzip: add hw gunzip support
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I52b6d090fdc7d535a4b0804826f5669c068464dc
2020-07-24 18:02:27 +08:00
Joseph Chen 0b61b557de rockchip: weak: support decompress gzip fit image
Implement board_fit_image_post_process() to handle it.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Idc89d88894e115d0b627c411248434848714b53d
2020-07-24 18:02:27 +08:00
Joseph Chen a5401a9d61 rockchip: spl/board: cleanup decompress before jumping
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I31a6170e03e2c2faddaf482d0f84dce23a85991e
2020-07-24 18:02:27 +08:00
Joseph Chen 4484e03e2d rockchip: spl: implement spl_kernel_partition()
Get boot or recovery partition according to boot mode.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I5b5806985f166cd37382b1d4df32c9eaf7508c7a
2020-07-24 18:02:27 +08:00
Joseph Chen cdf7e9d0ac rockchip: spl: booting kernel if recovery mode
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I01265310220b6dbdab938c84b743819f799c1502
2020-07-24 18:02:27 +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 1aaaf7ac0f rockchip: dts: rv1126: add "data-cached" property
RV1126 decompress module access data without dcache.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Iee3eb077912e1222fcceab4615f872706cd3d43f
2020-07-24 18:02:27 +08:00
Joseph Chen 8b225c61c2 misc: rockchip_decompress: add dcache flush
If the decompress module doesn't access the data through dcache,
it should add flush behavior to promise getting the real data
from dram. Otherwise it may decompress the wrong data but not
report any failure.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I6570ca7dc3a60c4b5bb9fcf3ae9f1025e2c658ea
2020-07-24 18:02:27 +08:00
Joseph Chen adf6937910 misc: rockchip decompress: remove IRQ support
SPL don't support IRQ and U-Boot proper is not deeply care
about boot time. There is not a mechanism to support IRQ
mode now.

In addition, the decompress irq is design to catch the exceptions
but not to decompress images continuously.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I842bce530aa180d5b0a30c1d2038575e464241b8
2020-07-24 18:02:27 +08:00
Joseph Chen 656bdb598a misc: decompress: add/update API
- Support get gunzip data size from src data;
- Support sync decompress for this round;
- Support return the gunzip data size of compressed image.
- Add misc_decompress_cleanup() for waiting last decompress done.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ie84b2a6174d04592110333d66667da66f98f07f6
2020-07-24 18:02:27 +08:00
Joseph Chen 01b57c0600 misc: decompress: add Kconfig option
It's used for other generic code.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I925c89d77165d781f9eff3c609eb06e2a1895a3e
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
Joseph Chen a91da5984b input: rk8xx: always enable key interrupt
We use it to exit charge animation while system is in runtime.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ia6bc3f7a20310f73e060418f0a0ab01ef8745b11
2020-07-24 11:00:18 +08:00
Zain Wang 8e2ab48b12 rockchip: rkcommon: extend rk3328 spl size
The image signed would grow 2K size than before.

Signed-off-by: Zain Wang <wzz@rock-chips.com>
Change-Id: I1b02a7117a41cc3b599c1fdd12bd69dccdcdca6a
2020-07-23 10:23:13 +08:00
Lin Jinhan cd694b63d4 cmd: crypto: drop RSA test when rsa driver not compiled
Change-Id: Iad42b1f35e3029a97158a1b16e7ca86f3c6e4b5f
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
2020-07-23 10:04:14 +08:00
Lin Jinhan 864e581c22 crypto: rockchip: add ROCKCHIP_RSA and SPL_ROCKCHIP_RSA config
use ROCKCHIP_RSA to enable RSA in uboot.
use SPL_ROCKCHIP_RSA to enable RSA in spl.

Change-Id: I1c3ae3754e9dbdfe39c81b554387fe78451a9fa2
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
2020-07-23 10:04:14 +08:00
Jason Zhu 04a8326ac7 mtd_blk: correct the ubi part info when enable a/b
The default ubi part info must be corrected while the part info will
be changed when enable a/b.

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I84db2e284f732f62014d3d14d99217fb707b85c0
2020-07-22 18:05:32 +08:00
Jason Zhu b693f15681 include: boot_rkimg: define system partition name
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Ifaaf5c5eb6baf777ed32e28ca6e5ef382e782c11
2020-07-22 18:05:32 +08:00
Joseph Chen e0d8614639 dm: crypto: remove TPL crypto kconfig option
They are impossible to be used in TPL.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ia42330ce3f6621020ae492675de320aa75f33da4
2020-07-21 16:14:48 +08:00
YouMin Chen 112c8ab573 drivers: ram: rv1126: modify ddr support frequency
Modify ddr support frequency to match PLL setting.

Change-Id: I1d93b2178933ada04e178bd068a8fec4ef43a4de
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2020-07-16 19:51:04 +08:00
Wyon Bi 34d0c224c5 video/drm: support get panel timing from EDID
Change-Id: I301cc9927504d90452978abe788f1c97261ff319
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2020-07-16 19:38:08 +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
Jianqun Xu 2f6aff5865 pinctrl: rockchip: fix rk3288 nr_pins warning
Change-Id: I4631a88b5706cb8cdc190fb3432936c791e70bda
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2020-07-15 10:33:45 +08:00
Joseph Chen 6af6afb3d8 rockchip: fit: use pss padding for verify boot
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I4feef28eea9c16622bfe5b56f2c75a16bb7e672f
2020-07-15 10:33:36 +08:00
Joseph Chen 95b97bd68f rockchip: rv1126: use pss padding for verify boot
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ia2b29a53332989244be0904280f403cb6c4c9e97
2020-07-15 10:33:36 +08:00
Joseph Chen 46751ae49c tools: image-host: use pkcs-1.5 by default
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I20c37235c22127e78f1ccb46eb3ee56f920068bc
2020-07-15 10:33:36 +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
Philippe Reynes 624f7c0791 UPSTREAM: rsa: use new openssl API to create signature
Previous implementation of the rsa signature was using
the openssl API EVP_Sign*, but the new openssl API
EVP_DigestSign* is more flexible. So we move to this
new API.

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

Conflicts:
	lib/rsa/rsa-sign.c

Change-Id: I6016a13904024a63d6fb8110cef37e57a164eed9
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2020-07-15 10:33:36 +08:00
Joseph Chen 07d90e7755 make.sh: add args to assign uboot and trust image size
syntax:
	--sz-uboot <cell KB> <number of cells>
	--sz-trust <cell KB> <number of cells>

example:
	./make.sh rk3399 --sz-uboot 1024 2
			|
			V
	uboot.img = 1024KB * 2 = 2048KB

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I809ddd762545069b45ab8b0977630ffdd7d8b50c
2020-07-14 10:31:11 +08:00
Joseph Chen 3ed9fa58e7 scripts: fit: move its file to fit/
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: If8b887ebaf63573b3c7c414873e038c1f67e4111
2020-07-13 20:41:52 +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 1ddd141a3e tools: image-host: add "/configurations" into hashed-nodes
Protect "default = ..." property and others.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I9e50c09343a97755b3e22d25f1ea196fd8bfb8be
2020-07-13 20:41:52 +08:00
Joseph Chen 5cf1de5dfd configs: remove rv1126-spi-nor-tb_defconfig
Please use rv1126-spi-nor-tb.config.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ifc0db56782a2b7e385bb3685a1fbb13033086f8c
2020-07-13 20:37:10 +08:00
Jon Lin 02ed3e1202 mtd: spinand: Remove useless write enable op
Change-Id: I5e4c953e1107c52bf4a40d397bd92617107b21f1
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-07-13 15:43:41 +08:00
Jon Lin fc656fc366 mtd: spinand: Support xtx devices
Support XT26G01A, XT26G02A, XT26G04A, XT26G01B, XT26G02B

Change-Id: I447d83e5c5da8f6ba8515aab77a8039fe9cb2cc4
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-07-10 15:58:11 +08:00
Joseph Chen 7d33ddceab scripts: sync-fragment: use "mv" instread of "cp"
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I91365eb455ff4b79253a8666571c42847d96090e
2020-07-10 15:14:41 +08:00
Joseph Chen e76fd377b8 configs: add rv1126-ramboot.config
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Id8bd2c4130181ab99cde514857c652ec6e7ae369
2020-07-10 14:56:42 +08:00
Joseph Chen bbe1b3dd1e configs: add rv1109-emmc-tb.config
It overlays rv1126-emmc-tb.config.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I2818f97908e61cbf249a59e59110d491a498a6d5
2020-07-10 10:42:21 +08:00