Commit Graph

50136 Commits

Author SHA1 Message Date
Joseph Chen aedeb70ba0 ram: Kconfig: RAMDISK_RO requires rkparam partition
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I166450ab0d406d2a452afb137c57511def54760c
2020-04-26 15:13:44 +08:00
Jason Zhu a5373663e8 rockchip: spl: implement fit_board_verify_required_sigs()
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I5dbebf21a8c3ae76550fec7262bee66c256b5682
2020-04-24 16:04:50 +08:00
zain wang 5033bc62fe tools: trust_merger: copy ImageSize from Component to ComponentData
rk3399_miniloader_v1.25 read ImageSize from ComponentData first now.
So copy ImageSize to ComponentData (named LoadSize).

For other chips, ComponentDate->LoadSize is reserved area, it no
inflence on other chips.

Signed-off-by: zain wang <wzz@rock-chips.com>
Change-Id: I51468aa3fad90d8999c1943ab9c720f7c90cefc1
2020-04-24 14:54:31 +08:00
Jon Lin d629023889 mtd: mtd_blk: skip bad block if mtd map isn't initiated
Change-Id: I3a2b5d311b43cc82135ecd84956e7a365c5910db
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-04-24 14:34:59 +08:00
Joseph Chen a46b05016b scripts: add uimage pack script
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Id1570789d84f8aba3a6b857e92cc2941e640aaa4
2020-04-24 10:23:26 +08:00
Joseph Chen 0fb435fa05 scripts: fit-unpack: add hash verify
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I11982ee2e6fb09f5c0007334832d7decb6025756
2020-04-24 10:23:25 +08:00
Jon Lin 1f21bf610b mtd: mtd_blk: add flash map block management
1.SPI Nand MTD partition bad block will not be detected if the address
isn't begin with the partition first block.
2.To avoid this problem, we should use map partition block address to
get right data.
3.It's compatible if the map table isn't initialed.

Change-Id: I11858b9b30a8fffecdbad804b1bad7b247b51d23
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-04-24 10:23:25 +08:00
Jason Zhu 94b85d035d misc: otp: use buffer to store capability
ioctl() should return error code but not data.

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Ica1242619ed59728acbeda7db493e5710f410a17
2020-04-24 10:23:25 +08:00
Jason Zhu 5c8c82be5c arm: shield executing arm_init_before_mmu in spl
The device do not initialize the cache and mmu in bootrom and ddr,
so the spl do not need to clear the cache and disable mmu in function
arm_init_before_mmu.

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: If7b19fa762c4803dcfc58c7b16fd8236a2262729
2020-04-23 16:39:07 +08:00
Joseph Chen dc33c23192 misc: rockchip_decompress: use buffer to store capability
ioctl() should return error code but not data.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I66eaefc64a20303400b730cc46f3814a9f050cf0
2020-04-23 16:17:06 +08:00
Joseph Chen 40f8ee7a99 misc: rockchip-efuse: implement IOCTL_REQ_CAPABILITY of ioctl()
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I8ae7b1bad8a892173bee442e1163cb5872b169e5
2020-04-23 16:17:06 +08:00
Joseph Chen 374c241cf9 misc: add a common api to get device by capability
fix: ioctl() should return error code but not capability.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I8030a1842692697f32f87e765ce3d68d1adb1c11
2020-04-23 16:17:06 +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
Jason Zhu 14be0258b5 rockchip: spl-boot-order: adjust nand flash dectecting strategy
Now the nand device is attached to mtd block, so change its dectecting
strategy.

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I7b5063ad1d1ba2d8305c84e4d67e09932b30574b
2020-04-23 12:56:18 +08:00
Lei Chen f21c060e4b driver: input: update RK remote control driver
This patch updates the RC driver to accommodate the new framework

Signed-off-by: Lei Chen <lei.chen@rock-chips.com>
Change-Id: I3ff2b5844ce5f1776ac2f94b3cbd42eb5d73cc41
2020-04-23 10:23:19 +08:00
Jon Lin f3a2c32e2d rkflash: enable reinit SNOR from snor flash packet
Change-Id: I21fa94d1ded675323a02c8a8d7073b31290bc7c7
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-04-23 10:19:50 +08:00
Jon Lin 9371a438f4 rkflash: support SNOR reinit from snor flash packet
That snor_info_packet is SPI Nor information placed in IDB header
area, each progress can parse it to get flash information.

Change-Id: I63621a5b92c2fb85b588365d9415fbb40eece8a3
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-04-23 10:19:50 +08:00
Yifeng Zhao e65bf00a8c spl: drivers: mtd: nand: raw: switch to the device model
Switch to the device model and support mtd.

Signed-off-by: Yifeng Zhao <yifeng.zhao@rock-chips.com>
Change-Id: Idfb60cec7a375254a423677b1c3f1da4be954eb5
2020-04-22 18:10:49 +08:00
Jason Zhu 6a8fa29e04 misc: otp: realize otp interface layer function
Realize otp read & write functions for application layer calling.

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Ic8f698b36fce4c1c6cd7a2848afd370567b43448
2020-04-22 18:08:19 +08:00
Jason Zhu f9519410b1 misc: otp: support rockchip secure otp version 2 driver
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I10a8cc92f2130c1f1957fd36fb924d9846707e65
2020-04-22 18:08:19 +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 2ca0cbb64a dm: sysreset: disable psci sysreset for SPL and TPL
SPL is the stage early than atf/op-tee that psci sysreset
is not supported.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I46b988b3776638265bf8f374a10f9027d1ebc90f
2020-04-22 18:07:21 +08:00
Jason Zhu cead3ab891 rockchip: spl: support spl_hang_reset
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I2be2671c7b1848d8d1af654319c4e7a518b484eb
2020-04-21 20:20:53 +08:00
Jason Zhu e663d2b596 lib: hang: reset the device if hang in spl
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Ica9426db31809dc316ef0cad3e4b2c0ff7985632
2020-04-21 20:04:22 +08:00
Joseph Chen 346c39b341 rockchip: board: implement fit_board_verify_required_sigs()
Get otp/efuse key status by optee client.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I820d387558fb50221d4025cab9c10168024558f7
2020-04-21 16:19:58 +08:00
Joseph Chen 90b678f6a0 cmd: charge: clean code
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ief810522d1bd55eccce6d096d3a945fac61fa00a
2020-04-21 16:19:25 +08:00
Joseph Chen 52387546ad rockchip: spl: read key without depending on CONFIG_DM_KEY
Key read can be access with key uclass or a tiny key read interface,
such as CONFIG_SPL_ADC_KEY.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ic1abdee3f778fd1d0d57ab270d5cead81a580fa9
2020-04-21 16:15:22 +08:00
Joseph Chen abedddcfae input: add spl adc key driver
Providing a mininum adc key driver for SPL, which does not
depend on key uclass, but ADC uclass is still required.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I80f861780acd9c47d345b95762a4dd39d19ea6fc
2020-04-21 16:15:22 +08:00
Joseph Chen 3509e794f3 input: Makefile: clean for SPL build
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I8ea0bd45ef86802e2992a44793a91eb8bb7b08fc
2020-04-21 16:15:22 +08:00
Joseph Chen 35ef9ac329 dm: adc: decoupling regulator from adc uclass
Regulator should be a option but not mandory for dm adc.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I5fdda2d76dd8ce75673732cc0563d7a18be211e2
2020-04-21 16:15:22 +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
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
Simon Xue 1540ca3755 misc: decompress: reset decompress before starting decompress
Change-Id: Id1031a204bb1ae4ebe5e1ea7c86b10e0d49dfd4b
Signed-off-by: Simon Xue <xxm@rock-chips.com>
2020-04-21 09:57:34 +08:00
Cody Xie e65ea10ce4 .gitignore: Ignore more generated files
Signed-off-by: Cody Xie <cody.xie@rock-chips.com>
Change-Id: Id0536ad67acfb48c34f1be5bd564a1096c9a43af
2020-04-21 09:30:23 +08:00
Jon Lin ae52cbcb84 spi: rokchip_sfc: set sfc clock
Change-Id: I1f2ae108b7557cfe9b55e21d1ecaec5492efea87
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-04-21 09:28:24 +08:00
Joseph Chen 4e45d60523 make.sh: remove file before build
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ic87dc270a8e090c21eaae643cd9edb9e22cac767
2020-04-20 20:15:09 +08:00
Yifeng Zhao 2d1531fa31 drivers: rknand: zftl: strengthen the parameter judgment for write loader API
The write loader function may call by mistake if the system
is unstable, which will cause flash reading and writing errors
and data loss.

bug log:
MT RR 15 row=dae38,count 15,status=-1
MT RR 15 row=dae38,count 15,status=-1
flash_read_page_en 0 dae38 error_ecc -1 1
load_l2p_region = 0,2,ffffffff, dae1e

Change-Id: Iac55e7807d739f08146ea2d81265857e6136e5d0
Signed-off-by: Yifeng Zhao <zyf@rock-chips.com>
2020-04-20 20:04:59 +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 a11e2c8225 make.sh: simplify remove file
rm -rf can always return 0.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I1f7e14ec860bb0da7b72132a8945a959b20cd440
2020-04-20 19:41:55 +08:00
Joseph Chen f9afd3dc76 make.sh: support fit secure image build with args
Such as:
    ./make.sh rk3399 --rollback-index-uboot 12 --rollback-index-boot 22
    ./make.sh --rollback-index-uboot 12 --rollback-index-boot 22

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ifd3d564bc860af215860471a327f752305501123
2020-04-20 18:29:25 +08:00
Joseph Chen 4b4c68413a make.sh: build secure or non-secure image auto by CONFIG_FIT_SIGNATURE
Providing sub command "fit-ns" to force building a non-secure image,
mainly for debugging.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I0212dcb1c8387b16a4b0589d74cbc2ddeb282b3d
2020-04-20 18:29:14 +08:00
Joseph Chen 6084ba494f make.sh: fix finish message "make nopack_defconfig"
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I387c6337d8d5ea8a2e68a289aff695f38ebfcd47
2020-04-20 18:29:14 +08:00
Joseph Chen ec4fe46226 fit: add comment for success return
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I58f1c1a159af2da675bd47b632022c2a0cdb9d40
2020-04-20 18:29:14 +08:00
Joseph Chen 5de879f9d8 common: board_f: reserve noncache memory region
board_r.c supports noncache memory region right below malloc
area, but board_f.c seems does not reserve it.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I7da218b6d994227a04a91cea02b64b6c91a0cc54
2020-04-20 18:29:14 +08:00
Joseph Chen 77deab993a rockchip: fit: make some error messge quiet
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I4de9914c349093a54e35080ca9d84c0ee95d9893
2020-04-20 18:29:14 +08:00
Jason Zhu 767409c5a6 misc: Kconfig: change the SPL_ROCKCHIP_HW_DECOMPRESS dependent's attribute
Change "depends on MISC" to "depends on SPL_MISC".

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I1b6c2296d5e88e4e2c0cbafb9bb31790d6f25e66
2020-04-20 14:52:32 +08:00
Joseph Chen 2fc776b68f Kconfig: default 2 copies of u-boot.itb for uboot.img
Backup is required for OTA, we proivde at least 2 copies.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I31303dbeac5fb458f343976290296396c24f988f
2020-04-20 11:27:29 +08:00
Jason Zhu 413b349a06 drivers: Makefile: build block drivers if enable CONFIG_SPL_MTD_SUPPORT
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Ida49ab768f6fd5e94736b850d06f6af04267c384
2020-04-17 14:39:39 +08:00
Frank Wang 5c6a522a4d configs: rk3328/rk3399: enable usb3.0 host support
Update RK3328 and RK3399 default config to support USB3.0 host.

Change-Id: I2a208478de9711138a85f2cc5fe3bbe69551883b
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2020-04-16 15:51:35 +08:00
Joseph Chen 851015326d make.sh: support pack mcu by parameters
Parameters: mcu address offset and enable status.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Id388bf0d94182a55781248a51d26de32ee03e7be
2020-04-16 15:41:28 +08:00