Commit Graph

50681 Commits

Author SHA1 Message Date
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
Joseph Chen 1b6a23121b configs: rv1126/1109: assign loader and trust ini file
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I90784dca5dfebc96a0336843995a0055ce40242e
2020-07-10 10:39:39 +08:00
Joseph Chen d07fced289 scripts: sync-fragment.sh: support nested
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I37605b2c65c0908aeda20e8a5551c2e630a49732
2020-07-10 10:39:39 +08:00
Joseph Chen 1df865f3f3 make.sh: config fragment support nested
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I200b6aa12684d53e6ddddb333696423a4c351f67
2020-07-10 09:52:11 +08:00
Joseph Chen 496a6e1e02 make.sh: support get loader and trust ini from .config
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ia68f394e19565af5e518387e356f58ac24e4b09e
2020-07-10 09:52:11 +08:00
Joseph Chen 6e24d50bef rockchip: Kconfig: add loader and trust ini options
There are too many product assortments of defconfig
and ini file on some platform, so we have to add
options to bind ini file with defconfig.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I4876489d2af99b43ba3fa214a16b2d65919ed138
2020-07-10 09:52:11 +08:00
Joseph Chen 216f7ce88f Kconfig: move CONFIG_BASE_DEFCONFIG to rockchip Kconfig
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ibae643de69aa59b8da048286fde2d736d570272d
2020-07-10 09:52:11 +08:00
Jianqun Xu e21613fbf5 pinctrl: rockchip: fix rk3308 nr_pins to 160
Change-Id: Ib3d1d9149d222c8fe60bbfe20bdc9f1dadbeabe8
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2020-07-09 20:37:05 +08:00
Joseph Chen bc0a7e781e scripts: add script to support repack fit
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I5e132193c62b1ff85ec5248668a74636c0b13165
2020-07-09 11:47:03 +08:00
Joseph Chen 1de0df4512 scripts: fit: support set image version of uboot.img and boot.img
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I1fafa347e3b3f53d4987b145642bb96726870ee3
2020-07-09 09:24:07 +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 15d854a192 configs: add README.rockchip
Short introduction of all rockchip platform defconfig.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I44b0621741e1b7fa3243a15e7313546bbd368d21
2020-07-08 17:57:49 +08:00
Joseph Chen 89a533b217 configs: rv1109_defconfig => rv1109.config
It overlays rv1126_defconfig.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I4507019b7ebc0942d7c7aa1ca9a8558b935d6660
2020-07-08 17:57:49 +08:00
Joseph Chen cf156b84bd configs: rv1126-spi-nor-tb_defconfig => rv1126-spi-nor-tb.config
It overlays rv1126_defconfig.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I9b6f0eb7d50c39111de2a86cc50ea100d5094d37
2020-07-08 17:57:49 +08:00
Joseph Chen 4fd0470950 configs: rv1126-emmc-tb_defconfig => rv1126-emmc-tb.config
It overlays rv1126_defconfig.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I5fc86cd78f776d4d9aed7858b593c8a085ea32c3
2020-07-08 17:57:49 +08:00
Joseph Chen 22bff7300f configs: rv1126-usbplug_defconfig => rv1126-usbplug.config
It overlays rockchip-usbplug_defconfig.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ib53d4da277a47beb84ce92a732ac30b0325b65fa
2020-07-08 17:57:49 +08:00
Joseph Chen 8d2c0f5ee8 scripts: add a script to sync/add conifg fragment
Example:
	./scripts/sync-fragment.sh configs/rv1109.config

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I04bc6c0f3615edafcbdb57b91de73162a912838f
2020-07-08 17:57:49 +08:00
Joseph Chen b8561139ba scripts: add diffconfig from kernel project
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Iade4d1d7180863f9e110e9ecd60cef63c40e1426
2020-07-08 17:57:49 +08:00
Joseph Chen 124e8c0928 make.sh: support make config fragment
./make.sh rv1109 equal: ./make.sh rv1126_defconfig rv1109.config

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I26c9ea9ae753fc6465b1edb0fb1e7736fd4ede3e
2020-07-08 17:57:49 +08:00
Joseph Chen 6c80fb8be4 Kconfig: add base defconfig
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Iba62fbc17bc9e75c13ec8bc7d1d2bd7a14d08448
2020-07-08 17:57:49 +08:00
Lin Jinhan 086e8fa830 crypto: rockchip: crypto_v2: split the data into 32M chunks when update
fix timeout bug of crypto V2 computing large amounts of data all
at one time.

Change-Id: I6c4a3f8b0a40e95b0832244313d7e378e1e70615
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
2020-07-08 17:27:34 +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 659e640a99 core: dump: add symbol for remained dm device
Symbol:
	"**" : pre-reloc node and the device is remained in dm tree.
	"* " : pre-reloc node but the device is already being removed from dm tree.

=> dm tree
 Class      Probed        Driver               Name

Change-Id: Ie242117d4d323ba24894dd99ab061d187230621d
----------------------------------------------------------
 root       [ + ]   root_driver                root_driver
 rsa_mod_ex [   ]   mod_exp_sw                 |-- mod_exp_sw
 clk        [   ]   fixed_rate_clock           |-- external-gmac-clockm0 *
 clk        [   ]   fixed_rate_clock           |-- external-gmac-clockm1 *
 syscon     [ + ]   rv1126_syscon              |-- syscon@fe000000 *
 syscon     [ + ]   rv1126_syscon              |-- syscon@fe020000 *
 ......
 mtd        [   ]   rk_nandc_v6                |-- nandc@ffc80000 **
 blk        [   ]   mtd_blk                    |   `-- nandc@ffc80000.blk
 spi        [   ]   rockchip_sfc               |-- sfc@ffc90000 *
 mtd        [   ]   spi_nand                   |   |-- flash@0 **
 blk        [   ]   mtd_blk                    |   |   `-- flash@0.blk
 spi_flash  [   ]   spi_flash_std              |   `-- flash@1 **
 blk        [   ]   mtd_blk                    |       `-- flash@1.blk
 ......

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I5bf643b9a2b29a86ac7315462ad9f65f30e18442
2020-07-08 17:20:32 +08:00
Joseph Chen 8f5dfc4a5c core: device: use list_del_init() instead of list_del() to remove node
In order to check this node by list_del_init().

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I723821d8b9fc6d899fbd5c0b830b240486a48c73
2020-07-08 17:20:32 +08:00
Jianqun Xu c134f612d6 configs: rv1126: enable io-domain
Change-Id: I6d6005c49a3b7c49ef0232b1f7e3e98d815fd905
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2020-07-08 16:51:45 +08:00
Jianqun Xu 2e312f93c5 power: rockchip-io-domain: get regmap base from parent device
The io-domain/pmu-io-domain node always under grf/pmugrf, so get the
grf/pmugrf regmap base just from its parent device.

Change-Id: I9f7d950744b48c239a556b7fe685749cdd5f99f2
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2020-07-08 14:21:02 +08:00
Jianqun Xu 13c03cb6ca pinctrl: rockchip: Covert the struct rockchip_pin_ctrl to const type
The rockchip_pin_ctrl struct is BSS data, only memset oncetime, but the
driver maybe probed several times, the nr_pins member of struct won't
to start from 0. that will cause pinctrl driver error.

Change-Id: I3d081da8bb91573126c6ee5af345ed73c85bb7af
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2020-07-08 14:17:51 +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 36aa04d944 rockchip: boot_mode: add maskrom download for "reboot loader"
Fallback to maskrom download mode if rockusb command failed.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Iccfa8745aeac800b1e048e0301147424cd2e9478
2020-07-07 16:11:06 +08:00
Joseph Chen d5989feab2 rockchip: spl: ignore writing rollback index 0
Don't return failure to stop booting.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: If699019b588c400b1d37f1b77d02d5ccae4e68dc
2020-07-07 15:46:34 +08:00
Jason Zhu 31767fe77d misc: otp: support write rollback space several times
Naturally, otp is written by bytes and programed just one time.
Now the rollback space is written by bit and programed several times.

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I964693c5067ffdedfc0990f038f6d013a49a41a8
2020-07-07 15:40:33 +08:00
Nickey Yang 41349aa18e configs: rv1109: Enable display vop and dsi
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
Change-Id: I6169d057a2e0302d1f50e9c49b47a2249a24c3d2
2020-07-07 14:44:49 +08:00
Jon Lin ea437e2ce4 mtd: spinand: Fix the way to detect gigadevice id
Parts of esmt devices are the same MFR id, and it's
reasonable.

Change-Id: I245c66ebd734ebabe89d8a6792446b80b76dd0e3
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-07-07 14:44:25 +08:00
Jon Lin 52b0060178 mtd: spinand: Support esmt devices
Support F50L1G41LB

Change-Id: I094a093fd07b6b2f924a58cf45375e214df796ce
Signed-off-by: Carl <xjxia@grandstream.cn>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-07-07 14:44:25 +08:00