Commit Graph

48623 Commits

Author SHA1 Message Date
Joseph Chen 4e92aae1f9 rockchip: param: remove some function compile for TPL/SPL
Change-Id: I828e14d12c056a7dbc8a5a8863f2f0fab4285d22
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-04-09 10:54:14 +08:00
Joseph Chen 6115fdb3c0 common: android: improve os image information
android_image_parse_kernel_comp() doesn't return valid os
compressed type after android_image_set_kload(), so we add
the env "os_comp" to record compressed type.

Change-Id: Ie175649d348c0578ce78e139bdbbf4b6f9ea1101
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-04-09 10:54:14 +08:00
Joseph Chen 8d681e4412 common: android: only adjust load address for ARM64 compressed kernel
If there is not "kernel_addr_c", using "kernel_addr_r" for Image/zImage
on 32-bit platform.

If there is not "kernel_addr_c", adjust load address to promise compressed
kernel can normal boot on 64-bit platform.

Change-Id: I42cc3c9074eb8f1caaa44d9256d2abdae6cd97b8
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-04-09 10:54:14 +08:00
Joseph Chen 5a54baa793 dm: key: refactor code
- use standard dm framework to implement all key drivers;
- all key node to be children and attach to key bus;
- dm key uclass takes over most work;
- reduce a lot of driver code size;

Change-Id: I9ea4515249d493eb4434890b90350f694c07404f
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-04-09 10:54:14 +08:00
Joseph Chen a0ceee9227 rockchip: support early load dtb from distro images
It is optional to use dtb from distro images to initialize
periph drivers when kernel dtb function is enabled.

Change-Id: I7119962ba61d84c5ccdf2e515e21bb347e50b91b
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-04-08 20:55:08 +08:00
Joseph Chen 4388deca72 dm: add amp uclass and rockchip amp driver support
- add amp uclass;
- add a simple rockchip amp driver.

An example for amps dts node configure:
amps {
	compatible = "uboot,rockchip-amp";
	status = "okay";

	amp@0 {
		description  = "mcu-os1";
		partition    = "mcu1";
		cpu          = <0x1>; // this is mpidr!
		load         = <0x800000>;
		entry        = <0x800000>;
		memory       = <0x800000 0x400000>;
	};

	amp@1 {
		......
	};

	......
};

U-Boot loads "mcu-os1" firmware to "0x800000" address from partiton
"mcu1" for cpu[1], the cpu[1] entry address is 0x800000. And
U-Boot reserve memory from 0x800000 with 0x400000 size in order
to make it invisible for kernel.

Please use rockchip tool "mkkrnlimg" to pack firmware binary, example:
./scripts/mkkrnlimg mcu-os1.bin mcu-os1.img

Change-Id: I127d5d9f460ec0c1812a76fb4c3702e82f21c9a6
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-04-08 20:53:44 +08:00
Joseph Chen 5ae28c899a rockchip: dts: rk3229-evb: support recovery GPIO key
RK3229 hardware design reference is GPIO3_D1.

Change-Id: I49807081212c77a84d38200a87449eb91dc5a7d3
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-04-04 11:05:35 +08:00
Joseph Chen de573281d8 rockchip: dts: rk3399-evb: rename key node
Use different name for the volume up key node, dm framework
can't support the same device node since kernel dtb is enabled.

Change-Id: Ia99c9b8fd46fea63949f9d06072c0ebec0e76a46
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-04-04 11:05:35 +08:00
Joseph Chen 04e429a4cd scripts: add mkkrnlimg tool to pack rockchip format image
sync from kernel develop-4.4:
(3091608 arm64: dts: rockchip: fixup vccio3-supply for ai-va-v10)

Change-Id: I4c67dfc617c99791d2706e2b260a79fd3419b29d
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-04-04 10:15:19 +08:00
Kever Yang 9ac4198103 rockchip: rk3328: add boot order in chosen
Default boot from sdcard may fail in evb without sd.

Change-Id: Ifde49b6b28e7154a14f5e028d9863446f11cb59c
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-04-04 09:15:51 +08:00
Kever Yang 9560dcb992 rockchip: rk3368: fix uart2 iomux
RK3368 uart2 iomux config is not correct, fix it.

Change-Id: I992c4b0ae9d8c0a91c5ee1fb3e7850a1e94db206
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-04-04 09:15:19 +08:00
Joseph Chen 305d8903e0 lib: sysmem: improve kernel reserved-memory alloc
- If the region is out of avaiable dram bank, return success;
- region can override allocated memblk with attr M_ATTR_OVERLAP;

Change-Id: I02171cdb51462e9cec3dd955ae3e0aaaa0ee7afd
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-04-03 10:29:03 +08:00
Shengfei Xu ba76dc003e power: pmic: rk8xx: enable under-voltage protection to rk817/rk809
The under-voltage protection will shutdown the LDO3 and reset the PMIC.

Change-Id: Ic84c7ad1a2eed8c1f983e761988ffb903fc878af
Signed-off-by: Shengfei Xu <xsf@rock-chips.com>
2019-04-02 19:09:07 +08:00
Jason Zhu 204f7c3926 mmc: dw_mmc: fix sd card power enable errror
The sd card power is enabled when PWREN is set low by rockchip hardware design.

Change-Id: I4fb54235bd5235030146f77be1e07dc4e729ae06
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-04-02 17:44:46 +08:00
Yifeng Zhao ca13d12f66 drivers: mtd: nand: add rockchip nandc v9 drivers
Change-Id: I7019f309528d41710c5af6857a4d4f54037dd595
Signed-off-by: Yifeng Zhao <zyf@rock-chips.com>
2019-04-01 13:59:32 +08:00
Joseph Chen 36620717fd arm: stacktrace: imporve guidance message
Change-Id: I186f80f64104b79d35aaae03e99a484bd1191c8f
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-31 11:44:09 +08:00
Joseph Chen 5330794924 scripts: stacktrace.sh: dump PC and LR addr2line information
Change-Id: If5c017eb3440b587153fa6b8624bf4acffe5a4e5
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-31 09:36:09 +08:00
Joseph Chen 2cb995bc2e lib: sysmem: allow alloc subset of an allocated memblk
Change-Id: I171c5978faf6fc1b3e95cc46c55a2adfe6df0176
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-29 18:29:19 +08:00
Joseph Chen 356575c3e2 lib: bidram: handle only-one dram bank available situation
LMB default init lmb->reserved.region[0] as zero.

Change-Id: Ib46d9630581bb3a03c5846288b16ae805e3e6944
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-29 18:29:19 +08:00
Joseph Chen 623d03d621 make.sh: pack ta trust.img as primary choice
This U-Boot is working with kernel-4.4 at least which
requires trust.img with ta.

It also avoids user confused with trust.img and trust_with_ta.img.

Change-Id: I18ec538a1f83cbb660e2fda597bf8120863d744f
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-29 18:26:22 +08:00
Finley Xiao 6be53b633a rockchip: otp: Add support for RK3308
Change-Id: I44391e0f039b1bd347124e90aad67a936ade2f99
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-03-29 18:26:05 +08:00
Finley Xiao 4973d825b8 rockchip: otp: Add (misc) driver for PX30 non-secure OTP block
This adds a simple driver for reading the OTP block of the PX30.

Change-Id: Ic2c0f4b0886808af87c826e8d0045e5d440521f7
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-03-29 18:26:05 +08:00
Finley Xiao b13cc84cd1 rockchip: efuse: support rk1808 non-secure efuse
Change-Id: I2a7cc8306c5ea45c5586b036cbc13eaa153e4227
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-03-29 18:26:05 +08:00
XiaoDong Huang 1380460aee rockchip: rk3368: Use timer0 as timer_irq
Change-Id: I75ee18ee55207ead6a30d588529e7363fe361009
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
2019-03-29 10:39:22 +08:00
Jason Zhu 5743ef647f mmc: dw_mmc: support get_cd in struct dm_mmc_ops
Add function get_cd to detect storage device directly instead of detect
it by mmc command.

Change-Id: I486dee836c62092baabe40fc6de995904849f91d
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-03-28 15:51:05 +08:00
Joseph Chen 0476014ebb ram: ramdisk: rename "readonly" to "ro"
Change-Id: I4f7c052e5750db78969f37125056906cacd222a0
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-28 14:47:12 +08:00
Hisping Lin b86137850e lib: optee_client: change condition for file exist
file not exist if ret < 0, file exist if ret >=0

Change-Id: I1a70b0a41773f03d552c5f6cda82b745d6e81421
Signed-off-by: Hisping Lin <hisping.lin@rock-chips.com>
2019-03-28 14:46:42 +08:00
Shengfei Xu 327c34ef1d fuel gauge: rk817/rk809: only rk809 need pull-up and pull-down resistor
Change-Id: I9c88a0cf11205ba351305eb37bd1e725ed203dca
Signed-off-by: Shengfei Xu <xsf@rock-chips.com>
2019-03-28 14:42:43 +08:00
Kever Yang daa679a7e4 rockchip: make.sh: get CONFIG_SYS_TEXT_BASE from .config
CONFIG_SYS_TEXT_BASE define in header file has be deprecate on
mainline, it has been move to Kconfig.

Change-Id: I40ae0ab84dbc6d74eca3450413fc2d11eb098434
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-03-27 18:10:36 +08:00
Joseph Chen c5449fd30c dm: dvfs: don't print fail message when there is no device
Change-Id: I8ec8920972261e8009dfd9306d8ab898460a71df
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-27 08:59:47 +08:00
Joseph Chen a90f2861de lib: sysmem: fix NULL attr.name
Change-Id: I93744c28668d1533ec2bcdaafc9198d8557284a1
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-27 08:59:47 +08:00
Kever Yang 618713d1f2 arm64: enable async error handler
Enable the exception handler for async error so that we can get the
abort before kernel.

Change-Id: Ie0e7c89a0d03adf3b74b0d9ddf8c9117536dac6b
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-03-26 16:13:09 +08:00
Kever Yang 2d2b0663a1 rockchip: px5: update defconfig for TPL/SPL
Change-Id: I4dcb2b3712fe87eece374c93cdc22d01edbd503a
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-03-26 16:13:09 +08:00
Kever Yang 1d0603dbce rockchip: px5: update SPL size for spl/tpl
Change-Id: I447976f9030a59f18393027e8392a065d4c6c425
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-03-26 16:13:09 +08:00
Kever Yang a739a3a9b7 rockchip: px5 update dts for spl/tpl
TPL need dmc to init ddr sdram, and emmc, boot-order.

Change-Id: Ia783e1a47a7710bf618c556eefaf354b7097eacd
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-03-26 16:13:09 +08:00
Kever Yang d74e8763bb rockchip: spl: always try to init stimer
We always try to init stimer in case it's not init in previous stage,
but don't re-init if it already work.

Change-Id: I2133804560c6e31e51e6b2cb0a6e51b9544970d3
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-03-26 16:13:09 +08:00
Kever Yang 21379abcb5 rockchip: tpl: remove arch_cpu_init()
The arch_cpu_init() should be done in SPL only.

Change-Id: If96bad9694dbcb0d9821433d1f2cbead4517633c
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-03-26 16:12:55 +08:00
Kever Yang ddc9405d5b rockchip: spl: move arch_cpu_init() after spl_init()
arch_cpu_init() may use DM to get cru handler.

Change-Id: I5f2daa4718bcdcc5a4aa5601d26e9f4f31a01b69
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-03-26 16:12:43 +08:00
Kever Yang f67455c958 rockchip: add CONFIG_ROCKCHIP_PX5 soc type variant
Add variant for evb-px5

Change-Id: Id7bfa9719f3283f2dccc674b7e194c16d7ac7f65
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-03-26 11:54:30 +08:00
Kever Yang 33baa40f0f rockchip: rk3368: support UART4 in board_debug_uart_init()
PX5 evb is using UART4

Change-Id: I16ae5c7037123ef1c9d1c793e11d48081214b433
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-03-26 11:54:12 +08:00
Kever Yang 903381d2b2 make.sh: support PX5
Update rule to support PX5

Change-Id: I67660165d78eb388e047fbf2189e493265dd45ad
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-03-26 11:53:52 +08:00
Joseph Chen 892d0a7f9b common: android: remove unnesscessary message
Change-Id: Iaa5da7da492f3fcb8021d175bb9a39a04d7f61d0
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-26 11:04:33 +08:00
Joseph Chen 2a14a50bde common: rkimg: add hotkey for sysmem and bidram dump
Change-Id: I32ded101c764df18f66916dd863145ace81d35be
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-26 11:04:33 +08:00
Joseph Chen 32c868cf11 common: android: add hotkey for sysmem and bidram dump
Change-Id: Ic866dcc2b160ebd92d518e517e0bc8870aec84d0
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-26 11:04:33 +08:00
Joseph Chen da051cc8bb rockchip: add ctrl+f hotkey to enter fastboot mode
Change-Id: I1f0a98793307b5a261958fe8c29da3271f2d8e4e
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-26 11:04:33 +08:00
Joseph Chen 309d75e755 command: board_f/r: add sysmem and bidram
During board_f sequence, it's able to add any count of dram banks
and validate memory layout after reserve_xxx() done, stop bootflow
if there is something wrong.

During board_r sequence, it's able to manage all memory blocks and
add reserve memory blocks for bi_dram[] at late bootflow, it's
nesscessary for AMP boot.

Change-Id: I4443a809792bb04e205bb26d79870c85cb5fe7bd
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-26 11:04:33 +08:00
Joseph Chen 86f870d669 rockchip: board: import bidram for GD board bi_dram[]
Change-Id: I9183f3664aa770bb5139cf635136834a206b75f5
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-26 11:04:33 +08:00
Joseph Chen b9bc76b4e1 rockchip: param: add ddr memory region parse
Change-Id: I7d59ee54a82da57b62970f4bc47faded60ba6ac8
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-26 11:04:33 +08:00
Joseph Chen 483d049321 lib: introduce bidram for GD board bi_dram[] memory management
Some platform provides more than one dram banks and reserved firmware
regions (eg. ATF, OP-TEE, etc) by pre-loader dynamically. It means
there are memory holes in board dram layout. What's more, U-Boot will
reserved regions at the late bootflow(eg. firmware reserved for AMP).

So we introduce bidram mechanism to manage GD board bi_dram[], which
provides a way to easily manage memory holes and update bi_dram[]. It
dpends on LMB which provides a good algorithm to manage memory blocks.

What's different from sysmem?
- bidram manage and pass the avaliable memory blocks to kernel;
- sysmem is only for U-Boot memory management to avoid ram overlap,
  it doesn't matter about kernel avaliable memory.

Change-Id: I697cbb80bdc961e4ad5ab94548e2dc93feefde6f
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-26 11:04:33 +08:00
Joseph Chen e3fbd280ef rockchip: board: implement board_initr_caches_fixup()
Remove dram_initr_banksize().

Change-Id: Ie0da0b8ef43d90c52b3ab2a93d1ad13b4928e70a
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-26 11:04:33 +08:00