Commit Graph

49919 Commits

Author SHA1 Message Date
Joseph Chen 15f6b6d065 common: android: correct 32-bit non-compressed kernel address
The page size should be reserved before kernel load address.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Iaa13fbc9a7a2872c5fb32a388ce96dd94654fc3d
2020-03-13 17:35:40 +08:00
Joseph Chen 591f14a84b common: android: correct address setting api
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ic9026d00abc0855aae18cc1a8018ed3549a9482b
2020-03-13 17:35:40 +08:00
Joseph Chen a8f564c371 lib: rsa: workaround fdt64_to_cpu() align issue
It seems fdt64_to_cpu() input param address must be 8-bytes
align, otherwise it brings a data-abort.

No root cause was found, let's workaround it.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ic9f47d657b89b458bbd9ee52f0f931a689aec321
2020-03-13 11:23:53 +08:00
Joseph Chen 3fbeaf462e lib: Makefile: compile rsa/ depends on $(SPL_TPL_)
Fix compile error.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ib6a159cd4fe5fe8387c9abb8369326a4411245b2
2020-03-13 11:23:53 +08:00
Sandy Huang 4ec7b4d48d video/drm: rgb: use prepare to instead enable
the RGB output io state should set correctly before panel prepare,
otherwise will lead to mcu init command send failed.

Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I92e94c97d72045113a06c78e5f88095aaaa4ec98
2020-03-12 14:58:47 +08:00
Elaine Zhang 904b267d4b clk: rockchip: rk3036: add nandc clk init
Change-Id: I8aefe310a366e346310135f684f3b5db43b0b734
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-03-11 17:05:17 +08:00
Elaine Zhang ddf875ab3d clk: rockchip: rk3288: Reduce the hevc clock init frequency
Solve the video clock high frequency reset problem.

Change-Id: I2db4021d8c20d572bda045256360f4e9bed9f85c
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2020-03-11 14:39:41 +08:00
Joseph Chen b92c7cf400 spl: fit: add images information print
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I25e0b72b7f71158a2dbbc7c13e76a5d321e88acf
2020-03-06 18:22:00 +08:00
Ben Whitten f3219d9510 UPSTREAM: spl: fit: verify images prior to post processing
Verification of hashes needs to take place before any image post
processing, thus matching full FIT image processing.
This allows mechanisms such as encryption be applied to images
prior to fit generation at the spl level.

Signed-off-by: Ben Whitten <ben.whitten@lairdtech.com>
(cherry picked from commit d154ca60036f060375ff3d80b2f1fbd2cd7de115)
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I1b923bbd8caaf411c502e7c9a1da0ed27bd50057

Change-Id: I93e96c8d5585fa30b841805e8f470669fa3c03e5
2020-03-06 18:18:20 +08:00
Michal Simek c04fe8bf81 UPSTREAM: image: fit: Show firmware configuration property if present
SPL ATF support requires to have firmware property which should be also
listed by mkimage -l when images is created.

The patch is also using this macro in spl_fit to match keyword.

When image is created:
 Default Configuration: 'config'
 Configuration 0 (config)
  Description:  ATF with full u-boot
  Kernel:       unavailable
  Firmware:     atf
  FDT:          dtb

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jun Nie <jun.nie@linaro.org>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
(cherry picked from commit 1f8e4bf55eb58bda715c1f8c8777081580f3246b)
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I6ddc0d39005e4d30fd03ff7d45d57b152377f2ba

Change-Id: I9ea4500329fc1f835860f204472ab8fb76f3e1bb
2020-03-06 18:18:20 +08:00
Jun Nie 0833bf5e4e UPSTREAM: SPL: Add signature verification when loading image
U-boot proper signature is not verified by SPL on most platforms
even config SPL_FIT_SIGNATURE is enabled. Only fsl-layerscape
platform support secure boot in platform specific code. So
verified boot cannot be achieved if u-boot proper is loaded by
SPL.

This patch add signature verification to u-boot proper images
when loading FIT image in SPL. It is tested on Allwinner bananapi
zero board with H2+ SoC.

Signed-off-by: Jun Nie <jun.nie@linaro.org>
(cherry picked from commit 5c643db4cc95c6ac6457731cb5bb75d6896e415b)
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I8de83a4fd31ccdb2429e1eadec31b60642687149

Change-Id: Ie1933cbbea0f5f9a68512ad3d43244e55a387d55
2020-03-06 18:18:20 +08:00
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