Commit Graph

46474 Commits

Author SHA1 Message Date
Andy Yan f6f2870aa8 UPSTREAM: rockchip: rk3368: add ENV_MEM_LAYOUT to extra env settings
Add the ENV_MEM_LAYOUT_SETTINGS to CONFIG_EXTRA_ENV_SETTINGS

Change-Id: I4ccc38abe53379d429b2060e5b60d62fe4fef9e4
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit ffaefb885ee113d12c3ff78109beb43ba1884945)
2018-01-16 18:16:48 +08:00
Jagan Teki c19af67fed UPSTREAM: rk3288: Add Vyasa initial board support
This patch adds support for Vyasa RK3288 initial board
from Amarula Solutions.

Change-Id: I50cc01993c16caa97a6b0f9019a5433bd30adc80
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit d55af074e5a8dc85fc78f468d1f8bc96ae8b6855)
2018-01-16 18:16:48 +08:00
Philipp Tomsich cd1142b38c UPSTREAM: rockchip: rk3399: spl: remove hard-coded addresses for GRF and SGRF
On the RK3399, we will have either OF_PLATDATA or full OF_CONTROL
enabled: this allows the use of syscon to retrieve the addresses of
GRF and SGRF (except for the early debug UART setup, which runs so
early that the device-model is not initialised).

This removes the hard-coded addresses and goes through syscon to
retrieve the base-addresses of GRF and SGRF. After that, we use
the structure definitions to locate the respective registers.

In addition to this, the inclusion of header files is also cleaned up:
- all headers are included at the beginning (there was a spurious
  inclusion of the grf header from within a function)
- all #include statements for unused headers are removed
- the remaining #include statements are sorted (while keeping common.h
  included in front)

Change-Id: I0ba923da4a178c9109a292e7196f6c4c35e1c24a
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit ba1657338b05337cea516dcfea6614c06f771613)
2018-01-16 18:16:48 +08:00
Philipp Tomsich 4b4cac54f4 UPSTREAM: rockchip: lion-rk3368: defconfig: resync w/ OF_LIVE and BOOTSTAGE enabled
This adds OF_LIVE and BOOTSTAGE support for the RK3368-uQ7 and
regenerates the defconfig (picking up a few changes/reorderings) from
upstream Kconfig changes.

Change-Id: I80644ed20576f6c82edb84b5376807d4c2d4efb4
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit c254b29fef79a92948136855db41436392e2d28b)
2018-01-16 18:16:48 +08:00
Philipp Tomsich aac09c6b8c UPSTREAM: rockchip: dts: rk3368-lion: add /chosen/tick-timer
To support bootstage recording, we want to mark our DM timer as the
tick-timer; this triggers the support for 'trying harder' to read the
timer in the Rockchip DM timer driver, even if the device model isn't
ready yet.

Change-Id: If09ee9ad6834bd8be99bc827471363383bce7c43
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit f041176c4672f2885ff0843f5f7a27c892fcc42c)
2018-01-16 18:16:48 +08:00
Philipp Tomsich a0c87cee8c UPSTREAM: rockchip: gpio: remove outdated/misleading comment
Remove a comment claiming that this driver only supports the RK3288,
as we also use it on the RK3368, RK3399 and (most likely) on other
variants.

Change-Id: I265882dcdd0f702be6699c5f9293355dbd1cb81d
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit c23ce9ab85604c4b6b627e522c1dbf2a618063e6)
2018-01-16 18:16:48 +08:00
Philipp Tomsich 55efd69c9e UPSTREAM: rockchip: gpio: convert to livetree
Update the Rockchip GPIO-bank driver to support a live tree.

Change-Id: Ic6aae620739fade81d512a070562f7978b648d6d
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit a1d3480bc63103f6215925b9447512e933cc4f1a)
2018-01-16 18:16:48 +08:00
Philipp Tomsich e2186db8e7 UPSTREAM: rockchip: i2c: Convert to livetree
Update the Rockchip I2C driver to support livetree.

Change-Id: Iea1e1e9570bbe49da63f3c9b74ec40c3dfbbac48
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Acked-by: Heiko Schocher <hs@denx.de>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit cc91bdf8d4da6e66703a1bc99577f49ec3c7bf4a)
2018-01-16 18:16:48 +08:00
Philipp Tomsich cd7449a3c4 UPSTREAM: rockchip: rk8xx: remove unused header includes
Remove header file includes that have been left over after the
conversion to livetree-support.

Change-Id: Iac1e65de175fa5dd747e161e426fc10309748e42
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit a904a16bc172ee1d7bcbcae1afcec21efe305e47)
2018-01-16 18:16:48 +08:00
Philipp Tomsich 4ae650e51d UPSTREAM: rockchip: sdhci: Convert to livetree
Update the Rockchip SDHCI wrapper to support a live device tree.

Change-Id: I6b093c4dcb7f9286b156fe8d2cef54d030969840
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 327b2b35c527d2ec6c8de4fdebb71322c0f085fb)
2018-01-16 18:16:48 +08:00
Philipp Tomsich a9db6e69fc UPSTREAM: rockchip: spi: Convert to livetree
Update the Rockchip SPI driver to support a live device tree.

Change-Id: Ib54a4e52ed7177f342aafdca1c6bc1ddc0b76eaa
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jagan Teki <jagan@openedev.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit d27c273908c3ca534093e93d7730fc55973a02bc)
2018-01-16 18:16:48 +08:00
Philipp Tomsich c6c4278784 UPSTREAM: rockchip: pinctrl: rk3368: Convert to livetree
Update the pinctrl driver for the RK3368 to support a live device tree.

Change-Id: Iba0c742549755a1a9d9edb7697faeb10b4edb247
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit d2edb968c4dbd116aaddf994ec540eb4ef4d9cee)
2018-01-16 18:16:48 +08:00
Philipp Tomsich 060bd5117a UPSTREAM: rockchip: clk: rk3368: Convert to livetree
Update the clock driver for the RK3368 to support a live device tree.

Change-Id: Ic74f6208fd0705c11d9a09a37c0136824fe64842
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 9a342f48a6c4debb1a43132c4b8ddc61c9f5d01d)
2018-01-16 18:16:48 +08:00
Philipp Tomsich 428eb1cf97 UPSTREAM: rockchip: timer: Convert to livetree
Update the Rockchip timer driver to support a live device tree.

Change-Id: Ia7d704245e17907954428bd2bc1c5d895114797f
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 6675c952f20b7b3cfedd57c9c49305289a89403c)
2018-01-16 18:16:48 +08:00
Philipp Tomsich fdb357172f UPSTREAM: rockchip: timer: implement timer_get_boot_us
To make the Rockchip DM timer driver useful for the timing of
bootstages, we need a few enhancements:
 - This implements timer_get_boot_us.
 - This avoids reinitialising the timer, if it has already been
   set up (e.g. by our TPL and SPL stages). Now, we have a single
   timebase ticking from TPL through the full U-Boot.
 - This adds support for reading the timer even before the
   device-model is ready: we find the timer via /chosen/tick-timer,
   then read its address and clock-frequency, and finally read the
   timeval directly).

Change-Id: I5f7d06f77c143482b28db7471600fdc5f39b824c
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit cc7ce94e02799c5caa6d9c89350152f00ba3eb90)
2018-01-16 18:16:48 +08:00
Philipp Tomsich 1c23e4e1eb UPSTREAM: rockchip: mmc: convert to livetree
Update the Rockchip-specific wrapper for the Designware driver to
support a live device tree.

Change-Id: I114c6c49907f0c40de0e3d4a6249684a2986329a
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit be5f04e850e89639ffe7ec4d2dccd327eb354cde)
2018-01-16 18:16:48 +08:00
Philipp Tomsich 8fb9fe4d88 UPSTREAM: net: phy: micrel: Convert to livetree
Update the Micrel KSZ90x1 driver for a live tree.

Change-Id: Ibcb54f6305bea779bf3ab975b2b692cd9eb05c42
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit b343837e90bf7eb1b7b7b5117cd6e101b72bda10)
2018-01-16 18:16:48 +08:00
Philipp Tomsich acb29c0a17 UPSTREAM: net: designware: Convert to livetree
Update the Designware Ethernet MAC driver to support a live device
tree.

Change-Id: I7c342900eb8a0386f9b1ccf963d02e76abee6a5f
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 15050f1cb023052a5ab03d39e55119e9c6ce3eaf)
2018-01-16 18:16:48 +08:00
Philipp Tomsich 18a0c4a65b UPSTREAM: dm: core: add dev_read_addr_ptr()
The dev_read_addr_ptr() mimics the behaviour of the devfdt_get_addr_ptr(),
retrieving the first address of the node's reg-property and returning
it as a pointer (or NULL on failure).

Change-Id: Iaac920b89296fd53504b071e7617f24ac6dd2fc8
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit c131c8bca86b428daef7a25c26a96af42658be21)
2018-01-16 18:16:48 +08:00
Philipp Tomsich 5867875cb7 UPSTREAM: dm: timer: handle being called before dm_root is ready
When used with bootstage recording, dm_timer_init may be called
surprisingly early: i.e. before dm_root is ready. To deal with
this case, we explicitly check for this condition and return
-EAGAIN to the caller (refer to drivers/timer/rockchip_timer.c
for a case where this is needed/used).

Change-Id: Ia35fea65924a73b6cc4b182ba28823b207be8e6f
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit af823151641b1a9a8eae8c3b111f5fa27e6873ac)
2018-01-16 18:16:48 +08:00
Philipp Tomsich e842c8b738 UPSTREAM: dm: timer: Convert to livetree
This updates dm_timer_init to support a live tree and deals with
some fallout (i.e. the need to restructure the code such, that we
don't need multiple discontinuous #if CONFIG_IS_ENABLED blocks).

Change-Id: Ic6e4f8cb98e1af64d1a1bb28d8f8e9a59db22c7a
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit b61e8b0c9e76dacf0b670c3948c3cd738b2379a3)
2018-01-16 18:16:48 +08:00
Philipp Tomsich 286803a6b4 UPSTREAM: bootstage: adjust Makefile to allow including bootstage in SPL, but not in TPL
For timing our bootstages on the RK3368, which has a minimal TPL
(and where we consequently don't want to time the bootstages) and a
full-featured SPL (where we can bootstage recording), we need to
adjust the Makefile.

Use the $(SPL_TPL_) macro in the Makefile for bootstage.o

Change-Id: Ib3cd45000bfbfb37377c96c9f41a467a760650aa
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 148a139d65b7fdb93326d7870b40c618d4601a8a)
2018-01-16 18:16:48 +08:00
Klaus Goger 5d3f9f0b85 UPSTREAM: rockchip: board: puma_rk3399: update README flash instructions
Puma supports other boot sources then SD-Card. Update README to include
the required steps.

 * how to package a SPI-NOR SPL
 * how to flash eMMC with rkdeveloptool

Change-Id: I52274ca551217209007d3ac9074351b7467404c8
Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com>
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit c91403409079e4747f60b79be5816773f6a4c8b3)
2018-01-16 18:16:48 +08:00
Klaus Goger d0b0568be9 UPSTREAM: rockchip: board: lion_rk3368: update README flash instructions
Add a section to the README on how to flash the on-board eMMC
with the rkdeveloptool.

Change-Id: Ic069b5bbaf64c6834f048167b21ac79071c399ee
Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com>
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit cc8fb2f79304963597248ad7cdab6cf2f9b336ef)
2018-01-16 18:16:48 +08:00
Rob Clark fed831fc6c UPSTREAM: fs/fat: introduce new director iterators
Untangle directory traversal into a simple iterator, to replace the
existing multi-purpose do_fat_read_at() + get_dentfromdir().

Change-Id: Iacf404e2ac7796adfa489d6e098c4d310635975a
Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Łukasz Majewski <lukma@denx.de>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit c6e3baa565bc3b5828cf0d67ca6429dbe5f8687c)
2018-01-16 18:16:48 +08:00
Rob Clark f3068e758f UPSTREAM: fs/fat: split out helper to init fsdata
Want to re-use this in fat dirent iterator in next patch.

Change-Id: I61d7586e50d13106c516235d46c47410b22496bb
Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Łukasz Majewski <lukma@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 45449980f80169214633f2649a27c791d0104e9d)
2018-01-16 18:16:48 +08:00
Heinrich Schuchardt 70478c701f UPSTREAM: test/py: u_boot_console_base.py: fix typo
run_command does not have a parameter wait_for_each.

Change-Id: I5b6bb3ed1b732c3ebc307f0618282caea9190b83
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit cd3e8a72a6fb1fe758c5f73b394527609afe26cc)
2018-01-16 18:16:48 +08:00
Heinrich Schuchardt dd10e6c7ae UPSTREAM: checkpatch.pl: Add warning for new __packed additions
While there are valid reasons to use __packed, often the answer is that
you should be doing something else here instead.

This reintroduces the changes of
f503cc49a5 (Add warning for new __packed additions)

Change-Id: I83bacea893370139a6e980a946d93db25a73baf5
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 5c761ce58666b3a1695697498598f8bf3484a0c7)
2018-01-16 18:16:48 +08:00
Bin Meng ec5e502c14 UPSTREAM: cmd: blk: Use LBAFU in the common block command
There is already a macro LBAFU to aid formatted print with lbaint_t
variables. Let's use it in the common block command codes.

Change-Id: I93256536d5af97877ecf9c4edc36d268b498dd1b
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit e2888a7fa7f8d23396c4b25ea763fe1f38851b3d)
2018-01-16 18:16:48 +08:00
Bin Meng 010034028f UPSTREAM: blk: Remove various places that do flush cache after read
All these places seem to inherit the codes from the MMC driver where
a FIXME was put in the comment. However the correct operation after
read should be cache invalidate, not flush.

The underlying drivers should be responsible for the cache operation.
Remove these codes completely.

Change-Id: I8f04c721432753b34e85b19616a0b42d83a633eb
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: York Sun <york.sun@nxp.com>
Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: York Sun <york.sun@nxp.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 723b43daec7ee2ddb600cfcb9b0253d4a71c3915)
2018-01-16 18:16:48 +08:00
Pantelis Antoniou 6d7abe7419 UPSTREAM: test: overlay: Add unit test for stacked overlay
Verify that stacked overlays work.

Change-Id: Id5c578db630bb34e952ca5176bb5ca9815bb0c0f
Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit ea28e488f743520f7f83b341f28818c32dae1ee3)
2018-01-16 18:16:48 +08:00
Pantelis Antoniou ea99241c37 UPSTREAM: ut: fix fdt_getprop_u32() change
fdt_getprop_u32 is not exported and it's different than what the
unit test uses. Rename u32 prop access methods to something that's
unit test specific.

Change-Id: I0256118c7ae7b6709c4ef0791c53093e3117f23e
Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 706708d3b2e7ade443836e7a14802a5a63b59713)
2018-01-16 18:16:48 +08:00
Pantelis Antoniou 0608812d5b UPSTREAM: config: sandbox: Add unit tests
Add unit tests for sandbox default config.

Change-Id: Icf7b645fd561eca1f702a42f2b0b72dd1bb38722
Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 1e9c4393fd0bc70b53d8159591043732acfb2bf3)
2018-01-16 18:16:48 +08:00
Franklin S Cooper Jr 6a53d8fa9f UPSTREAM: doc: overlays: Tweak documentation regarding overlays
Pull some information regarding overlays from commit messages and
put them directly within the documentation. Also add some information
regarding required dtc version to properly use overlays.

Change-Id: Idccfd1db39dd27a19415f05738e65ca43413cb25
Signed-off-by: Franklin S Cooper Jr <fcooper@ti.com>
Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 56fc7032e1771882a086e8283586fc7c733ba6bd)
2018-01-16 18:16:48 +08:00
Pantelis Antoniou b8631b11ec UPSTREAM: dtbo: make dtbos special
Special rule for dtbo generation

Change-Id: Iac5a5054f43bd732b4278c14ed2fbf3044bf2c28
Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit da0b3a946f1a5135297b92e5a18ff97ab10145d6)
2018-01-16 18:16:48 +08:00
Pantelis Antoniou 994d9d06da UPSTREAM: doc: Document how to apply fdt overlays
We have the capability to apply overlays on the command line but
we didn't have a document explaining how.

Change-Id: Idec1c3eac1ef3b52f4329d2ce9bffdd8b9aac32b
Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Reviewed-by: Łukasz Majewski
Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit d80162cfc559491dee3009b120e7268e9388302f)
2018-01-16 18:16:48 +08:00
Pantelis Antoniou a116ed4929 UPSTREAM: fit: fdt overlays doc
Change-Id: I69e26ac5683578d8a3333e33e94b65556af479bb
Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Reviewed-by: Łukasz Majewski
Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 6b54e50b5a5889efe179cb06aa6aa25583ef25d5)
2018-01-16 18:16:48 +08:00
Pantelis Antoniou 988a4042e6 UPSTREAM: fit: Introduce methods for applying overlays on fit-load
Introduce an overlay based method for constructing a base DT blob
to pass to the kernel.

It is based on a specific method now to get the FDT from a FIT image
named boot_get_fdt_fit().

Change-Id: I98e0526edd594e63b1c29bdd916e4c66774f4337
Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 169043d826e6b0db3c67a60acbedfc72c43aae5d)
2018-01-16 18:16:48 +08:00
Pantelis Antoniou 06686a7b4c UPSTREAM: fit: Do not throw away extra configuration on fit_image_load()
fit_image_load() threw away the extra configuration parts when
loading. We need them around for applying extra overlays for
building the boot fdt.

Change-Id: Icad7d35f5efb4ebb16a2dba969a9228674d7fb39
Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 7c3dc776b91a683b2f7dd40ed91361124a3a91c0)
2018-01-16 18:16:48 +08:00
Pantelis Antoniou 75488a387b UPSTREAM: fit: Allow multiple images per property
As part of the fdt overlay support which need it, allow
a list of configurations per property.

Change-Id: I3068dcdd2bd823fd2ee5cfa0d337c4589e2a9588
Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit ad026adbcf0d719e736eb58a9059cbbebb2d2423)
2018-01-16 18:16:48 +08:00
Pantelis Antoniou d80212386f UPSTREAM: fdt: Allow stacked overlays phandle references
This patch enables an overlay to refer to a previous overlay's
labels by performing a merge of symbol information at application
time.

In a nutshell it allows an overlay to refer to a symbol that a previous
overlay has defined. It requires both the base and all the overlays
to be compiled with the -@ command line switch so that symbol
information is included.

base.dts
--------

	/dts-v1/;
	/ {
		foo: foonode {
			foo-property;
		};
	};

	$ dtc -@ -I dts -O dtb -o base.dtb base.dts

bar.dts
-------

	/dts-v1/;
	/plugin/;
	/ {
		fragment@1 {
			target = <&foo>;
			__overlay__ {
				overlay-1-property;
				bar: barnode {
					bar-property;
				};
			};
		};
	};

	$ dtc -@ -I dts -O dtb -o bar.dtb bar.dts

baz.dts
-------

	/dts-v1/;
	/plugin/;
	/ {
		fragment@1 {
			target = <&bar>;
			__overlay__ {
				overlay-2-property;
				baz: baznode {
					baz-property;
				};
			};
		};
	};

	$ dtc -@ -I dts -O dtb -o baz.dtb baz.dts

Applying the overlays:

	$ fdtoverlay -i base.dtb -o target.dtb bar.dtb baz.dtb

Dumping:

	$ fdtdump target.dtb
	/ {
            foonode {
                overlay-1-property;
                foo-property;
                linux,phandle = <0x00000001>;
                phandle = <0x00000001>;
                barnode {
                    overlay-2-property;
                    phandle = <0x00000002>;
                    linux,phandle = <0x00000002>;
                    bar-property;
                    baznode {
                        phandle = <0x00000003>;
                        linux,phandle = <0x00000003>;
                        baz-property;
                    };
                };
            };
            __symbols__ {
                baz = "/foonode/barnode/baznode";
                bar = "/foonode/barnode";
                foo = "/foonode";
            };
	};

Change-Id: If72870ec3e9260ccd4fbcbaff27ba035d001bd00
Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit f00c36a01e774dea1ed2a1171da9e372610ee8eb)
2018-01-16 18:16:48 +08:00
Pantelis Antoniou 7c95a4956f UPSTREAM: fdt: Switch to using the verbose overlay application method
The verbose overlay application method prints out more helpful
messages, so switch to it.

Change-Id: Ie8bd31e939e3c12fe547028d0fa3ddc8b254d33d
Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 81ecc5d92badfcf1415a6052b5896a62271a94dc)
2018-01-16 18:16:48 +08:00
Pantelis Antoniou 0939009dd9 UPSTREAM: fdt: Introduce helper method fdt_overlay_apply_verbose()
Introduce fdt_overlay_apply_verbose, a method that applies an
overlay but in the case of an error produces a helpful message.

In addition if a base tree is found to be missing the __symbols__
node the message will point out that the probable reason is that
the base tree was miscompiled without the -@ option.

Change-Id: I22cc210c6a7bb0aaa9655197c859f54677532099
Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit fc7c31891c40dd1aac2e71e9d1546727ca2b3556)
2018-01-16 18:14:14 +08:00
Tien Fong Chee 174235d4a2 UPSTREAM: libfdt: Initialize the stack variable
Report Coverity log:
The code uses a variable that has not
been initialized, leading to unpredictable
or unintended results.

Change-Id: I488a9d183590a2dc1ef049351d0c71a4eded2299
Reported-by: Coverity (CID: 60519)
Signed-off-by: Tien Fong Chee <tien.fong.chee@intel.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 18c991ca2bd72c30b7fb578cee8b5c7c835d383d)
2018-01-16 18:14:14 +08:00
Heinrich Schuchardt 7551eb4f05 UPSTREAM: checkpatch: update from Linux v4.13-rc6
Checkpatch produces the following warning:

Unescaped left brace in regex is deprecated here
(and will be fatal in Perl 5.30), passed through in regex;
marked by <-- HERE in m/^(\+.*(?:do|\))){ <-- HERE /
at scripts/checkpatch.pl line 3348.

The curent checkpatch of the Linux kernel corrects this
bug and many others.

It provides improved colored output.

So replace checkpatch by the current Linux version.

Add an empty file scripts/const_structs.checkpatch.
We can later fill it according to our needs.

Change-Id: I307d182d41de6288798e002b9d8990e23d027e63
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 6305db960447ff2d32c335de8bbd9b44cb7d6554)
2018-01-16 18:14:09 +08:00
Rob Clark 48d1b0a57c UPSTREAM: lib: strto: fix incorrect handling of specified base
The strto functions should honor the specified base (if non-zero) rather
than permitting a hex or octal string when the user wanted (for example)
base 10.

This has been fixed somewhere along the way in the upstream linux kernel
src tree, at some point after these was copied in to u-boot.  And also
in a way that duplicates less code.  So port _parse_integer_fixup_radix()
to u-boot.

Change-Id: I4e2383c6d8ac4666e7e4e40b15f7577522bc9700
Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 2e794614838292499910060509d3c4a7aaed986a)
2018-01-16 18:14:09 +08:00
Alison Chaiken 135b53be98 UPSTREAM: add pytests for 'gpt rename' and 'gpt swap'
Add unit tests for the 'gpt rename' and 'gpt swap' commands that
rely on the block device created by test/py/make_test_disk.py.
Add CONFIG_CMD_GPT_RENAME to the sandbox_defconfig.  Remove the
testdisk.raw test device at the end of the tests.

Change-Id: I1c5b963a1f84168d4979ad1591f68a5f2a259935
Signed-off-by: Alison Chaiken <alison@peloton-tech.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit c5772188ede914b0e67c2a58ae179039a582afe0)
2018-01-16 18:14:09 +08:00
Alison Chaiken e2c5d1e4e7 UPSTREAM: add pytests for 'gpt guid' command in sandbox
Run unit tests for the 'gpt guid' command, making use of the block
device created by test/py/make_test_disk.py.  Remove this device at
the end of the tests.

Change-Id: I315989b993388fdce6f0b263376463a3532d154b
Signed-off-by: Alison Chaiken <alison@peloton-tech.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit a2f422555fc80144aea418c0d8e95341acfe6868)
2018-01-16 18:14:09 +08:00
Alison Chaiken 4d11a85763 UPSTREAM: GPT: create block device for sandbox testing
Provide a Python function that creates a small block device for the
purpose of testing the cmd/gpt.c or cmd/part.c functions in the u-boot
sandbox.

Change-Id: I620c2f97c7b6533d8cb607e365e719246cdb7acd
Signed-off-by: Alison Chaiken <alison@peloton-tech.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit bf6d76b84ae13b463c0dca556118047e2d046f33)
2018-01-16 18:14:09 +08:00
Wenyou Yang 451f416416 UPSTREAM: clk: Kconfig: Add dependences of SPL_CLK
The SPL_CLK config should depend on SPL && SPL_DM.

Change-Id: I86d4b934bebde3d4661143902b71e198608ff688
Signed-off-by: Wenyou Yang <wenyou.yang@microchip.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 0712b672d2a1f9a156c489b4dd7ce8354c2b3e1f)
2018-01-16 18:14:09 +08:00