Commit Graph

49908 Commits

Author SHA1 Message Date
Peng Fan b86dc4195f UPSTREAM: SPL: Add FIT data-position property support
For external data, FIT has a optional property "data-position" which
can set the external data to a fixed offset to FIT beginning.
Add the support for this property in SPL FIT.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tomas Melin <tomas.melin@vaisala.com>
Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Cc: "Andrew F. Davis" <afd@ti.com>
Cc: Igor Grinberg <grinberg@compulab.co.il>
Cc: "tomas.melin@vaisala.com" <tomas.melin@vaisala.com>
Cc: Kever Yang <kever.yang@rock-chips.com>
Cc: Andre Przywara <andre.przywara@arm.com>
Cc: York Sun <york.sun@nxp.com>
Cc: Lokesh Vutla <lokeshvutla@ti.com>
Cc: "Cooper Jr., Franklin" <fcooper@ti.com>
Cc: George McCollister <george.mccollister@gmail.com>
Cc: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
Cc: Jean-Jacques Hiblot <jjhiblot@ti.com>
Cc: Rick Altherr <raltherr@google.com>
Cc: Tom Rini <trini@konsulko.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: York Sun <york.sun@nxp.com>
(cherry picked from commit a1be94b65410c7ebba5e7695478b6623579b410c)
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I1cdcfe0358e5a39fed3dfcf0554a7ba0e16729b8

Change-Id: I44c3454addd85d70e6fba8e26b66a0278c5c1081
2020-03-06 18:18:20 +08:00
Hans Yang c5ef40e370 configs: rk3036: enable CONFIG_RKNAND
Signed-off-by: Hans Yang <yhx@rock-chips.com>
Change-Id: Ic15e6113566ccf07ea9a0572f1c5326a2c784c84
2020-03-02 17:29:48 +08:00
Jon Lin 09ad69fdeb rkflash: support new SPI Nor flash
1.EN25QH64A, EN25QH32B, 25Q256JVEM, BH25Q128AS, BH25Q64BS

Change-Id: I7154ab38ad03766f13621cefd899d842ce0835fc
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-03-02 15:23:12 +08:00
Jon Lin 7196e3306a rockchip: rk3036: enable NANDC
Change-Id: I9ad4dd1497656f41b42907892c17a2bd85eace0c
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-03-02 11:56:08 +08:00
Jon Lin eb45fc5ab7 rockchip: rk3036: add NANDC node
Change-Id: I04c33d238fabeffcf470da71624009313050b904
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-03-02 11:55:37 +08:00
Simon Xue 2bb8d138c1 misc: decompress: add decompress driver
Signed-off-by: Simon Xue <xxm@rock-chips.com>
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I0bffe944c54a933fd8ea48d856e6ac5da06b3b16
2020-03-02 09:19:49 +08:00
Joseph Chen dbfe5ed512 dm: misc: add ioctl request command definition
Available for caller to call misc_ioctl(...).

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Ibac22caf80968ecc7f952d04aa2a1a0f8ad3417a
2020-03-02 09:19:32 +08:00
Joseph Chen 57be1825cb rockchip: clean kernel dtb code to kernel_dtb.c
Since there is a lot of code for kernel dtb feature, let's
move them into a individual file to make board.c clean.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I4e01627c265807b1c0e26b432f0b4fc1db0d889e
2020-02-28 12:38:42 +08:00
Joseph Chen bc4ccd5396 rockchip: clean rockchip_read_dtb_file() api to boot_rkimg.c
rockchip_read_dtb_file() is top level api which reads dtb from
resource/fit/uImage/distro image, etc.

only leave code about resource image in resource_img.c.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I2157ffc204ebd564aa9171de2b8167fbd6c94bcf
2020-02-28 12:38:42 +08:00
Joseph Chen d3a605e34d common: image: support reloc image at the given address
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ia15f4dfa96602554f5c293dbf383f84a83a05950
2020-02-28 12:38:42 +08:00
Joseph Chen 277a68daf9 common: bootm: add bootm_board_start()
There maybe some board routine before bootm common
flow. The board can override this __weak function.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I6660f4ef27f3889d2dbc29594ad164a12ec6c934
2020-02-28 11:37:15 +08:00
Joseph Chen 998aeb5fa7 common: bootm: add board_do_bootm()
There maybe some board routine before do_bootm_states().
The board can override this __weak function.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Iab6a6742a02dae681e4d3221dc7cfffd2c3df98c
2020-02-28 11:37:15 +08:00
Joseph Chen ac459efd10 common: fit: add entry and load address set api
Add FIT_MULTI_PROP definition.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I5e98601799de88843f8110f118640339079905a5
2020-02-28 11:37:14 +08:00
Joseph Chen 01918c3fa9 common: android: update image end get for android v2
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I4b2cddec072657d69b294dbddf300cf4d0471695
2020-02-28 11:37:14 +08:00
Joseph Chen 2fe84ae1c5 bidram: rename "dump_bidram" to "bidram_dump"
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I77601a95daec90b396620ee1f3a3a6e455dcc914
2020-02-28 11:37:13 +08:00
Joseph Chen 68cca28cd2 sysmem: add cmd "sysmem_search" to find available region
If the user can't make sure where the region is available
and safe for use, this command handles it.

Rename commands with prefix: sysmem_xxx.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I37ea76bf33a3fcb8c16baeecae3980d746775ec7
2020-02-28 11:36:49 +08:00
Joseph Chen 90fca8097f sysmem: fix invisiable region boundary
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I1677891796646cf3e1db3aef836921051386a0e0
2020-02-28 11:22:04 +08:00
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