Commit Graph

48705 Commits

Author SHA1 Message Date
Joseph Chen 6999767bb2 dm: regulator: add "regulator-loader-ignore" property support
The property indicates this regulator should skip init setting
sequence, usually for saving boot time.

Change-Id: I40a81c84b0696c70b16ddba50aeb457412287116
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-06-03 18:25:08 +08:00
Joseph Chen ea4b8016c1 core: device_bind_common: always use crypto node from U-Boot dtb
There is not crypto node in kernel dtb for early platform(such as
rk322x/rk3288/rk3368/rk3399, etc), so we decide to add crypto node
always in U-Boot dtb and ignore crypto node from kernel dtb.

This is a way to compatible with early platforms. Actually, we
need crypto during secure boot sequence, the crypto had better
not depends on kernel dtb.

Change-Id: Ibab4fca0741b45042b8d0868240449fb6b52aa14
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-05-31 17:31:14 +08:00
Joseph Chen 48802b420e env: Kconfig: fix typo
Change-Id: I02f0d7e83ab216e8cecba9d8f3e3a9b223afaed4
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-05-30 14:18:15 +08:00
Jason Zhu ce7f8a1146 arm: rockchip: rk3308: grf: add more register
Change-Id: I008a22e3dccd61b928a0f565791f1abef4d279de
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-05-29 15:00:16 +08:00
Joseph Chen f9ebf7a1de crypto: rockchip: v1: use BITS2WORD() for sha final
Adding error message for missing total data length when sha init.

Change-Id: Ibbd266a36ba1498ab4ab5c85ecbb68c548a89a86
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-05-28 20:31:28 +08:00
Joseph Chen d7a244f923 core: device_bind_common: only delete U-Boot existance node
Use "u-boot,dm-pre-reloc" to identify whether the existance
node is from U-Boot or not. This avoids deleting the same name
nodes from kernel dtb.

Change-Id: I6503965c0013053feefad7e93f98b01b5af71f44
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-05-28 20:31:02 +08:00
Joseph Chen 039bc38d48 make.sh: add rk3326 aarch32 build support
Change-Id: Ibfc6a40b5d0decbffdbf4e797459da189484ce88
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-05-28 20:30:40 +08:00
Joseph Chen 5202fe1fb4 make.sh: improve aarch32 build
Change-Id: I7e39b0cb71a534cf073d38f2bab28069dbad1b26
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-05-28 20:30:40 +08:00
Joseph Chen 9ad51843bf configs: add rk3326-aarch32_defconfig
Enable using kernel dtb.

Change-Id: I2a450300509c81f9cc41af7f57fe40d87d8419be
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-05-28 20:30:40 +08:00
Joseph Chen 6db22b33e7 rockchip: rk3326: add AArch32 execution state support
Support boot ARMv8 based RK3326 on AARCH32 state

Change-Id: Ifb788ba71057f4f72dba9e1071c3609308644a9b
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-05-28 20:30:40 +08:00
Joseph Chen 39c46c24ef common: android: correct kernel memcpy size when load separate
The hdr->page_size should be included.

fixes: 503a892f5a
(common: android: avb support load android image separate)

Change-Id: I2de2c9957fd47c7f95bf863f7b0c679cc64633d9
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-05-28 20:30:36 +08:00
Joseph Chen 459505b334 common: rkimg: fix uncompress region check issue
kernel_addr_r is defined in the function entry, we should not
define it agin, otherwise the behind code is someting wrong.
(images.ep = kernel_addr_r;)

Change-Id: If6a4c01e8ecdf130b800bd3884a5cfbe158d8f9a
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-05-28 20:30:36 +08:00
Joseph Chen 160c99aa45 rockchip: param: add common memory reserve for most AArch32 mode
The ARMv8 platform enabling AArch32 mode should reserve memory the same
as AArch64 mode(because there is no difference about ATF), only some
platform has special request, they are: RK3308.

Change-Id: I0ffbfac7ddaff50ef53128dccd5b7dc2d02b560a
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-05-28 20:30:36 +08:00
Joseph Chen 598774ec05 lib: sysmem: add optimization for input base and M_ATTR_PEEK
- handle the case: the input base is 0;
- ignore the head region which can't visible for M_ATTR_PEEK;

Change-Id: I2c3609b9457a5e2e429e849228301bfee0e4c9b0
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-05-28 20:30:36 +08:00
Joseph Chen 7328d2324e ram: rockchip: fix AArch32 compile issue
error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]

Change-Id: Iadcf7065f02ee779d3eeee1cb70fd3e9905e1b3f
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-05-28 20:30:36 +08:00
Yifeng Zhao a7784f2995 drivers: rknand: add slc nand and some new MLC nand support
Change-Id: I13c9d56c80c6e817f591b55ea31672681565d274
Signed-off-by: Yifeng Zhao <zyf@rock-chips.com>
2019-05-28 20:30:36 +08:00
Joseph Chen 27643361d9 common: android: add/update boot message
Make android bootflow more clear by message.

Change-Id: I6e022ae6fd22ce4b6933b085033c66b7bf79297c
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-05-28 20:30:36 +08:00
Joseph Chen 2e6f3f4c09 tool: rockchip: boot/trust_merger: ignore prepath when it's already exist
Change-Id: I33b1b14ba7b68ab08e1e61bf98e476da3b13b56a
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-05-27 11:15:19 +08:00
Joseph Chen 05b87a4eed make.sh: remove exist image before pack
Change-Id: Iea5083970bbd332ec62250a6d1e35ac09dbed533
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-05-27 10:04:13 +08:00
Shengfei Xu 4874919d22 power: pmic: rk8xx: get the correct on/off source
The on/off_source value has been changed,
so we can't get the correct on/off source.

Change-Id: I7c522574f5e8d3bbc3c5d73980cdccdb4717da52
Signed-off-by: Shengfei Xu <xsf@rock-chips.com>
2019-05-27 08:36:09 +08:00
Jon Lin cd60bf88a7 rkflash: add new spi nor flash
MX25L51245G08G

Change-Id: Ia4a2844d64102a1fead410f592b73892ae4870be
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2019-05-24 20:52:30 +08:00
Wyon Bi 3b47334dd7 rockchip: px30: add support for video phy
Sync the video phy related dts node from kernel.

Change-Id: If9715bff0d129397cd3c3fc2597d34863d6e2dfb
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2019-05-24 11:50:29 +08:00
Wyon Bi e2ce9fefd4 rockchip: rk3128: add support for video phy
Sync the video phy related dts node from kernel.

Change-Id: I93ac2d1540934f2674702255f3f1c7913cc997d2
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2019-05-24 11:50:29 +08:00
Joseph Chen 2ba7147f80 env: add a common env driver for block device
The driver implementation refers to env/mmc.c, the storage media
binding to block layer can use it(Nand/Nor Flash...).

Support configure:
	- CONFIG_ENV_OFFSET
	- CONFIG_ENV_SIZE
	- CONFIG_ENV_OFFSET_REDUND (optional)
	- CONFIG_ENV_SIZE_REDUND (optional)
	- CONFIG_SYS_MMC_ENV_PART (optional)

Change-Id: Ibb16f0dd7af1331f454784968fbdc9002f4b769c
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-05-24 11:35:28 +08:00
Joseph Chen 1712dc5c34 dm: blk: export if_typename_to_iftype()
Change-Id: I436d431f69051861e02699e0366701a27ab5a0da
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-05-24 11:35:28 +08:00
Joseph Chen e311da2458 tools: rockchip: boot/trust_merger: add "--prepath" support
Add prefix path of binary path.

Change-Id: I576b9fa40f88a1ee0701f1ff776d25d4e3ed747b
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-05-23 18:19:46 +08:00
Shunqing Chen ab64d6564f configs: rk3399pro: enable CONFIG_CHARGER_BQ25700
Change-Id: I14a521e391f124809403b9170b5b2055220d43e7
Signed-off-by: Shunqing Chen <csq@rock-chips.com>
2019-05-23 17:16:52 +08:00
Shunqing Chen d19b8cd2ae power: charge: add bq25700 support
Change-Id: I49c2e60ac94cea35e6a1e9ca1f713551a75e6265
Signed-off-by: Shunqing Chen <csq@rock-chips.com>
2019-05-23 11:59:52 +08:00
Joseph Chen 4d083e3f19 power: charge animation: add charger device support
If a fuel gauge device doesn't have both charger and fuel gauge
capabilities, try to find devices group to support that.

Change-Id: I78d929e80e79bea304bb2b29f423c90ca12be16f
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-05-23 10:20:32 +08:00
Joseph Chen b3271e11e6 power: fuel gauge: add capability callback
Return "FG_CAP_FUEL_GAUGE | FG_CAP_CHARGER" as default value
when there's not implementation, which compatibles with all fg drivers.

Change-Id: Ie71e1271e504c63be42af41551e10e8c2c7d89ac
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-05-23 10:20:17 +08:00
Joseph Chen 69cce37bfc make.sh: support "./make trust-all" command
support parse "ADDR" and "OUTPUT" from *TOS.ini

Change-Id: Ie98d858c832eecd7736cf3b4a020dfc91b10241c
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-05-22 15:34:12 +08:00
Joseph Chen cd2acdbee7 rockchip: rk3128: add firmware load address for small ram board
- Since avb use sysmem alloc, we can decrease malloc size;
- The typical request is 128M ram board;

Note: trust.img should be placed in low memory address.

Change-Id: Iba6564710b130d26fdf6b4edfd013b1352216250
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-05-22 15:34:12 +08:00
Joseph Chen 4dfe920a3a rockchip: board: add firmware load address env fixup
Sometimes, we need to adjust fimware load address accroding
to board ram size, so we define another group of load address
to override the orignal group.

Change-Id: Ic23629d05db822111d7a270eec0b316df7865b86
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-05-22 15:34:12 +08:00
Joseph Chen 503a892f5a common: android: avb support load android image separate
Skip fdt and ramdisk relocation to save boot time.

Change-Id: I56fd2fca97fa7795024aa542f0a45d0512be01d4
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-05-22 15:34:12 +08:00
Joseph Chen 89151b4aad lib: avb: use sysmem alloc to load image
Using malloc buffer to load image makes CONFIG_SYS_MALLOC_LEN must be
large enough, sysmem alloc is a better way.

Change-Id: I24e2b86c53b8d3307c0d155fc37cb499c321e1c6
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-05-22 15:30:20 +08:00
Andy Yan 6184121cdc arm: add spl relocation support for armv8
Relocate spl itself to a high memory.

Change-Id: Ia69f05449a0a8e4f07cc6d37a2486c3cd2aa7176
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2019-05-17 17:47:20 +08:00
Andy Yan dced428b74 spl: add relocation support
Some times we want to relocate spl code to dram after dram
initialization or relocate spl code to a high memory to avoid
code overide.

For example on Rockchip armv8 platform, we run with boot flow
TPL->SPL->ATF->U-Boot.

TPL run in sram and is responsible for dram initialization.
SPL run from the start address of dram and is responsible for
loading ATF and U-Boot.

The case here is that the ATF load address is from 64KB of dram,
which overlaps with spl code itself.

So we want to relocate spl itself to high memory to aovid this.

Change-Id: Ifcae4444c04fa1208406b51196cf8737277ace90
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2019-05-17 17:47:10 +08:00
Jason Zhu 01714a2c06 rockchip: rk3308: set several master IP that can be secure access
Include CRYPTO SDMMC EMMC NAND SFC USB.

Change-Id: I1da1423bbefb45af3c2fad1b848bc7df0729512f
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-05-17 15:30:15 +08:00
Jason Zhu 3a10ef3901 arm: rockchip: add RK3308 SGRF registers support
Change-Id: I04340035cf8c372ae9f30424871da3810c70c56b
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-05-17 15:27:48 +08:00
Joseph Chen 164b2a3361 rockchip: smccc: psci_system_suspend() effects by CONFIG_ARM_CPU_SUSPEND
Change-Id: I6ecc1c4db8232782af369e8e29b78a2c0cb13783
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-05-17 12:05:18 +08:00
Joseph Chen 3415d4ebcd power: charge animation: select CONFIG_ARM_CPU_SUSPEND
Change-Id: I0c901e17b9da18d87f8dd7da776254a20c47ee11
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-05-17 12:00:44 +08:00
Joseph Chen ff294bc6d1 arm: armv7/8: add CONFIG_ARM_CPU_SUSPEND definition
Make it as a optional choice.

Change-Id: I87c5d8ce863eb64f3922fb4124e1f4a6aaf79257
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-05-17 11:18:53 +08:00
Joseph Chen a3d0083590 crypto: add rockchip crypto v1 driver
Crypto v1 driver implements algorithm MD5/SHA1/SHA256/RSA512/RSA1024/RSA2048
for the platforms: rk3399/rk3368/rk3328/rk3229/rk3288/rk3128.

Change-Id: Ib3e16c365dd130ad2d5ab9008f8db4252cbd2834
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-05-16 15:27:48 +08:00
Joseph Chen cc6ac5d64f dm: add crypto uclass and cmd support
Change-Id: I2241c90aca9695cd28bb9ca2a220d0e1af8ca932
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-05-16 15:27:48 +08:00
Joseph Chen 272fdf68ed rockchip: dts: rk3399: add and enable crypto node
Change-Id: I63866f6f63e331e7c2722399f9a1621c55a7590a
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-05-16 14:40:34 +08:00
Joseph Chen 5ee9804858 rockchip: clk: rk3399: rename and export rockchip_get_clk()
Change-Id: I454500829fe815f8374b957279949bd0c6c87c52
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-05-16 14:40:33 +08:00
Elaine Zhang 88cae289b5 clk: rockchip: rk3368: support crypto clk get/set rate
Change-Id: I736fdda1d994ebdb59c68f8be209bae0e206be99
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-05-16 14:40:33 +08:00
Elaine Zhang 582fa222b9 clk: rockchip: rk3128: support crypto clk get/set rate
Change-Id: I3a7d71a481aca04c9e6c0547cfc05a8106f79423
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-05-16 14:40:33 +08:00
Joseph Chen 8b9843df21 common: android: fix uncompress kernel region check
Change-Id: Ie8b6f7255eae3c2be86ccc2c33e04c8b21add75d
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-05-15 11:02:14 +08:00
Joseph Chen 76f45eb9e9 common: rkimg: fix uncompress kernel region check
Change-Id: I5e9f51f17dc49dbe4cd36afe6502fdda68a59fe6
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-05-15 11:02:14 +08:00