Commit Graph

49891 Commits

Author SHA1 Message Date
Joseph Chen c01d448924 sysmem: simplify the memblk name
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Icfe908ade21d1d8f568db796298f67ba9f013da6
2020-02-28 11:22:04 +08:00
Joseph Chen 98de7945ac common: bootm: improve decompess image message
Make it more meaningful.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ie26745d6c007cc1bae91ebf2fad88feb1742e8bb
2020-02-28 11:20:58 +08:00
Joseph Chen 622ccf343f make.sh: support assign U-Boot dtb with external one
Usage: ./make.sh EXT_DTB=rk-kernel.dtb

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I83218f5bb2f8e05d895d57fd344f54a01b6ad789
2020-02-28 11:20:23 +08:00
Joseph Chen ea8a3d10b6 common: board_f: save U-Boot fdt blob
Saving it for late use, eg: fit verified boot process.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I6643fb643f2fd88795d80fc5bd21025b62dc6943
2020-02-28 11:17:03 +08:00
Joseph Chen 23b55d3d0f drm/rockchip: fix compile error
Error when CONFIG_ROCKCHIP_RESOURCE_IMAGE is disabled

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I3e6dd7c5528409c37ad8fbdcf1cc7f5178253bb2
2020-02-28 11:14:28 +08:00
Frank Wang 73d7b075b0 usb: dwc3: amend UTMI/UTMIW phy interface setup
Let move 8/16-bit UTMI+ interface initialization into DWC3 core init
that is convenient for both DM_USB and u-boot traditional process.

Change-Id: I7fe45af396098749b2acf4a885dff875dcbc6f63
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2020-02-27 17:51:21 +08:00
Frank Wang efc9f55618 usb: dwc3: add dis_u2_freeclk_exists_quirk
Add a quirk to clear the GUSB2PHYCFG.U2_FREECLK_EXISTS bit,
which specifies whether the USB2.0 PHY provides a free-running
PHY clock, which is active when the clock control input is active.

Refer to commit 27f83eeb6b42("usb: dwc3: add dis_u2_freeclk_exists_quirk")
in Linux Rockchip Kernel.

Change-Id: Id90ac25a7e82bbf7918cc9658797c23008871852
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2020-02-27 17:51:21 +08:00
Frank Wang f4acaed3e7 usb: dwc3: add dis_enblslpm_quirk
Add a quirk to clear the GUSB2PHYCFG.ENBLSLPM bit, which controls
whether the PHY receives the suspend signal from the controller.

Refer to commit ec791d149bca("usb: dwc3: Add dis_enblslpm_quirk")
in Linux Kernel.

Change-Id: If8bffb5a8dc1b02e4b3100dc722d14a3d9b74992
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2020-02-27 17:51:21 +08:00
Neil Armstrong 989a41fcc4 UPSTREAM: reset: fix reset_get_bulk when phandle error
This fixes the Coverity Defect CID 175348 when dev_count_phandle_with_args()
returns a negative value.

Change-Id: I3572567e0dce19548a970ecf4e446ff9b23b895f
Fixes: 0c28233903b5 ("reset: Add get/assert/deassert/release for bulk of reset signals")
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 895a82ce90278130828b26c230da99331a33e729)
2020-02-27 17:51:21 +08:00
Jean-Jacques Hiblot 94fbbf0f6d UPSTREAM: dm: Add a No-op uclass
This uclass is intended for devices that do not need any features from the
uclass, including binding children.
This will typically be used by devices that are used to bind child devices
but do not use dm_scan_fdt_dev() to do it. That is for example the case of
several USB wrappers that have 2 child devices (1 for device and 1 for
host) but bind only one at a any given time.

Change-Id: Iad9ba5f368bd2de9940cf069baf9bec9d668920c
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 07e33711fec4f1106f36805b5dc830da07c783c5)
2020-02-27 17:51:21 +08:00
Elaine Zhang 9bc02da530 clk: rockchip: px30: Restore sfc frequency after PLL frequency setting
Change-Id: I261885b027c4c5ba6d94fb228fb04563cb4e0b0e
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2020-02-25 16:56:09 +08:00
Joseph Chen fc722856eb common: board_r: add minimum nowhere env for board init.
Storage env or kernel dtb load depends on bootdev, while bootdev
depends on env varname: devtype, devnum and rkimg_bootdev, etc.
So we have to use nowhere env firstly and cover the storage env
after it is loaded.

Providing a minimum and necessary nowhere env for board init to
avoid covering the other varnames in storage env.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I8362c24376e7530f15335f26197a7cddbcae579c
2020-02-25 14:18:15 +08:00
Joseph Chen 14569d2673 env: add board env set api
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ib8f2b18349cf4f99b182dbdb409c6a2f7820a028
2020-02-25 14:18:15 +08:00
Joseph Chen c6f0e81965 rockchip: board: add env fixup
It was called from set_env_default() which only handles
nowhere env, let's move it to board late to handle all
env types.

Fix fdt address earlier before init kernel dtb.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I1e60355eef7897b7e92c7652c60a3c72350e46b0
2020-02-25 14:18:15 +08:00
Lin Huang f116e38908 configs: rk1808/rk1806: add SPL relate config
with these config, rk1808/rk1806 support SPL boot kernel.

Change-Id: I8efcb93d03d12adbefbe7b16dd1f25ee8d4fb0ee
Signed-off-by: Lin Huang <hl@rock-chips.com>
2020-02-24 18:22:38 +08:00
Jason Zhu 3a07c42d83 rockchip: dts: rk1808: support eMMC hs200
Change-Id: I759d5c711887966e732216719c557da804105c15
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2020-02-24 18:21:03 +08:00
Jason Zhu 1a0c3c4ddd mmc: dw_mmc: implement the function board_mmc_dm_reinit
Change-Id: I18409bd6857d3bc8f4268a78593b23b3e19e744f
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2020-02-24 18:20:52 +08:00
Elaine Zhang c2fb06de29 clk: rockchip: rk1808: Restore mmc/sfc frequency after PLL frequency setting
Change-Id: I14d0f9c41c45253de3a71b7c3d3fdae89ddf9952
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2020-02-24 18:09:37 +08:00
Jason Zhu 36e8ecdb69 rockchip: rk1808: set dram area unsecure in spl
So that the mmc controller can read data to dram since the mmc
controller is unsecure.

Change-Id: Iaf8f5cebeacbc034eb129c6b52a702abdbd7fed3
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2020-02-24 17:27:50 +08:00
Jason Zhu 2241fc0f8b common: spl: rkfw: support resource file in spl
Change-Id: I14d0afd6131cd523cd0218bb727b9a3b48397943
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2020-02-24 17:27:50 +08:00
Jason Zhu ddd4dd8141 rockchip: dts: rk1808: change necessary nodes's u-boot attribute
Change necessary nodes's "u-boot,dm-pre-reloc" to "u-boot,dm-spl",
so that we generate dtb with the nodes which include "u-boot,dm-spl".

The reducing dtb size fuction is supported by the commit:
1. dts: Makefile: simplify the logic of kernel dtb feature
2. dts: Makefile: support provide a minimum SPL DTB

Change-Id: Ibe43a20b435315349bdc1c45a14cf91cd90ecd89
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2020-02-24 16:35:36 +08:00
Jason Zhu e531136ec7 mmc: avoid reading ext_csd several times
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Iaf952a4721ea74a1fa55da9f1a3eece5cdcd2c0c
2020-02-24 16:35:30 +08:00
Jason Zhu 1f250d0a05 mmc: support hs200 in spl
Change-Id: I9c25265a2a1e2b10a4e6815c918b6bba750c5df8
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2020-02-24 16:35:26 +08:00
Jason Zhu 189f3a8c31 spl: atf: pass kernel parameters through bl33_ep_info->args
Pass when enable CONFIG_SPL_KERNEL_BOOT.

Change-Id: Iee442466df59eeaa0f477f264f523b026e516168
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2020-02-24 16:35:12 +08:00
Joseph Chen 67a616b84e make.sh: generate individual loader file for subcommand "spl-s"
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I2b2d58b1b753928113317b64fb34d65dec92fdaa
2020-02-24 15:05:35 +08:00
Jason Zhu 8956822660 arch: rockchip: support resource file in spl
Change-Id: I00a1d9731554cf401b0a82e6d4f07440af1f554d
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2020-02-24 14:03:43 +08:00
Jason Zhu fec9980f93 rockchip: dts: rk1808: add u-boot,spl-boot-order
Change-Id: I783c14843d7aa28bb65100ca0a2903b40c88e9d0
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2020-02-24 14:03:43 +08:00
Jason Zhu 28e9e98a51 clk: rockchip: rk1808: set gpll to 594000000
The eMMC clk is depended on gpll, and the eMMC is needed to run 150MHz
in HS200 mode. So set gpll to 594000000.

Change-Id: Id356c87b1db158a0638e4560e886868f133dfaf9
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2020-02-24 14:03:43 +08:00
Jason Zhu a4933f72a5 rockchip: rk1808: support mmc_gpio_init_direct()
Change-Id: Ib6f5818f3a38c88a38b9a4a9bba0aedd49f0247e
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2020-02-24 14:03:43 +08:00
Jason Zhu ace0ade619 mmc: add func mmc_gpio_init_direct in spl
Sometimes we need to reconfigure the eMMC gpio state in spl without
pinctrl driver. So add func mmc_gpio_init_direct to initialize the
eMMC gpio in different platform.

Change-Id: I22500f8865a9e29e59be6ff224001bad899cec48
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2020-02-24 14:03:43 +08:00
Jason Zhu e3460df72d common: spl: rkfw: support boot kernel in spl
Load kernel through android format, then jump to kernel through ATF.

Change-Id: Idc77461bae0e4300c146c68f6a7e4e157c29db7f
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2020-02-24 14:03:43 +08:00
Jason Zhu dd04b7cb10 spl: add SPL_KERNEL_BOOT
Change-Id: I6460bf6fa4535c60d956bba6c3c2f00b6b61bf45
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2020-02-24 14:03:43 +08:00
Jason Zhu 49f617a949 spl: support SPL_KERNEL_ADDR & SPL_FDT_ADDR & SPL_RAMDISK_ADDR
Change-Id: I9c8d4ba9118c7c22504753a3c9de33706bea04fd
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2020-02-24 14:03:43 +08:00
Joseph Chen 2aca71f9d9 rockchip: board: add mmc_dm_reinit() for mmc devices
There maybe something for the mmc devices to do after kernel dtb
dm setup, eg: regain the clock device binding from kernel dtb.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ie52edd6a0b4e7f7d54bf5b00d7e97de1f1346230
2020-02-24 11:23:34 +08:00
Joseph Chen a794014552 rockchip: board: rename early_download_init to early_download
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ia20430765fe55309650237dc2085d59d9ec41411
2020-02-21 16:55:56 +08:00
Joseph Chen 46f6140176 rockchip: board: move hotkey getc earlier
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I5bdf84563f2aae957c707cb12633c4840e58afc0
2020-02-21 16:55:56 +08:00
Joseph Chen b173f38e43 rockchip: hotkey: add fdt dump
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I9bb158f13b723decae01069f4324289c599e0e5f
2020-02-21 16:48:48 +08:00
Joseph Chen 9beff1069b rockchip: hotkey: disable interactive events
Allow other debug message hotkey.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: If5c82922e1ce66283a00f7e675451b6104a503bc
2020-02-21 16:48:36 +08:00
Joseph Chen 30a8590450 core: device: add and update some comment
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I7e58aab5eeb77913c8438ed066a7a73c7d6f0bb6
2020-02-21 16:20:07 +08:00
Joseph Chen 1481bafe9d common: spl: enable D-cache by default to improve performance
Set CONFIG_SPL_SYS_MALLOC_F_LEN enough to promise the tlb buffer
can be malloc, actually this is a way to compatible all the current
boards without adding a new configure option.

I-cache has been setup at early assembly code by default.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I7e973299eddc358cd4c15846c5de154050bf9547
2020-02-20 17:14:04 +08:00
Joseph Chen 4447bf1624 dts: Makefile: support provide a minimum SPL DTB
Some boards need a SPL DTB as smaller as possible to save dm scan
time and space. It provides a SPL DTB only include the node with
property "u-boot,dm-spl". The property "u-boot,pre-reloc" doesn't
work any more.

This feature is disabled by default to compatible current boards,
only the board really cares about boot time needs it.

Fix "/chosen" is deleted for TPL DTB.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I743d7b734daff6e0508e01f534078663d809952f
2020-02-20 17:13:25 +08:00
Joseph Chen fcdd83d445 dts: Makefile: simplify the logic of kernel dtb feature
Our purpose is replacing the u-boot.dtb with u-boot-spl.dtb
when kernel dtb feature is enabled. The current logic is too
complicated and not easy to extend new features.

The best way is to generate but not replace a u-boot.dtb the
same as u-boot-spl.dtb during DTB compile process.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I678ec7c60c91ecc6f6f0a935e50a691c52c94162
2020-02-20 17:13:25 +08:00
Joseph Chen da5d85a3ee configs: add rk3128_defconfig
Enable kernel dtb feature.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I525ebc89dd6b72e06848e501e5a1db1cc13cdcbc
2020-02-20 14:27:10 +08:00
Joseph Chen 43e3c846b3 pmic: rk8xx: set rk818 2000mA input current if no battery node
Assume that no battery node means the board is always supplied with
adapter, so set 2000mA input curren to make board have enough power.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I9d66c02682cc3ff66a2d8e365837fc66bf991933
2020-02-19 16:57:32 +08:00
Joseph Chen aa1eec08bb rockchip: make boot_rkimg.c as basic mandory code
boot_rkimg.c is the basic code for rockchip platforms, such as
get boot devtype, setup download mode and get kernel dtb, etc.

CONFIG_RKIMG_BOOTLOADER actually makes no sense for rockchip
features any more, but we still leave it to compatile code
compilation since there is a lot of code depends on it. but it
maybe dropped in the future.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Iab922cbf3a70e7eb1444678d6e902b9d8e106dd1
2020-02-19 13:21:10 +08:00
Jeffy Chen 85f87933fd configs: rk3399: enable CONFIG_EFI_LOADER and CONFIG_BOOTEFI
These configs are needed for EFI booting.

Change-Id: I36d074525fdf3df5e068f5aecd35c1b43145ccd6
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
2020-02-14 15:23:34 +08:00
Jason Zhu 708c86adb9 make.sh: support make.sh spl-s
make.sh spl-s : pack loader only replace miniloader with u-boot-spl.bin

Change-Id: I68df1961051d1f970bcb460ea362df3c15f403ce
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2020-02-14 11:40:52 +08:00
Joseph Chen 0f0484481c common: image-fdt: skip image_check_type() for fdt
default image mkimage conflicts with fit mkimage on param: -T "flat_dt"
and failed to build fdt uImage.

error message:
"./tools/mkimage: Can't set header for FIT Image support: Success"

It's fine to drop that since the fdt_check_header() follows it.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I50554765bac7cc75df7ab5920e94cafe78d14bdc
2020-01-16 11:50:49 +08:00
Joseph Chen 5b8e7bf473 common: image-fit: support "data-offset" and "data-size"
It seems the U-Boot proper fit code misses this.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I1e5255e20f4f309c083e601e6c2d0e37869bac20
2020-01-16 11:50:49 +08:00
Joseph Chen 5ae165da66 include: rkimg: add resource partition macro
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I9de7e165f61ad18591add0ffe4092e99845c2938
2020-01-16 11:14:13 +08:00