Commit Graph

46495 Commits

Author SHA1 Message Date
Rob Clark 85681a03ed UPSTREAM: fs/fat: fix fatbuf leak
A new fatbuf was allocated by get_fs_info() (called by fat_itr_root()),
but not freed, resulting in eventually running out of memory.  Spotted
by running 'ls -r' in a large FAT filesystem from Shell.efi.

fatbuf is mainly used to cache FAT entry lookups (get_fatent())..
possibly once fat_write.c it can move into the iterator to simplify
this.

Change-Id: I194a2de30a177e9b377dc50c61a2af6106dd8820
Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Łukasz Majewski <lukma@denx.de>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 725ffdb5cbcc4b8a9726a68cc6ae0713266ba5a9)
2018-01-16 18:16:48 +08:00
Rob Clark 1d8c5dbb6e UPSTREAM: fs/fat: Clean up open-coded sector <-> cluster conversions
Use the clust_to_sect() helper that was introduced earlier, and add an
inverse sect_to_clust(), plus update the various spots that open-coded
this conversion previously.

Change-Id: Ifb6a59cefda1491639dcd6e8ea32fd2490af13b5
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 265edc03d5a19550d92cbd6e10631d5a15bdd1d5)
2018-01-16 18:16:48 +08:00
Rob Clark 271eb20812 UPSTREAM: fs/fat: fix case for FAT shortnames
Noticed when comparing our output to linux.  There are some lcase bits
which control whether filename and/or extension should be downcase'd.

Change-Id: I55dc1f9ef025dc3174158d06ed78d1f8b54e1335
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 21a24c3bf35bac83d66ce4a48eb0c7dd8a7227cb)
2018-01-16 18:16:48 +08:00
Rob Clark d5fb8aea9f UPSTREAM: fat/fs: move ls to generic implementation
Add a generic implementation of 'ls' using opendir/readdir/closedir, and
replace fat's custom implementation.  Other filesystems should move to
the generic implementation after they add opendir/readdir/closedir
support.

Change-Id: I287d3cd6e97c0c1901518c5ae1bb0653c7299f9b
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 89191d626793490b579e1d36e7d7a4464a20f9f6)
2018-01-16 18:16:48 +08:00
Rob Clark 53ee50a1ca UPSTREAM: fat/fs: remove a bunch of dead code
Spotted by chance, when trying to remove file_fat_ls(), I noticed there
were some dead users of the API.

Change-Id: Iab669e5f9fd3840dbf1d7ebf026c6827775186ab
Signed-off-by: Rob Clark <robdclark@gmail.com>
Acked-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 41fa83d1a6cdd8ddfb3fbe332252193ff8fb8b71)
2018-01-16 18:16:48 +08:00
Rob Clark 60352d2210 UPSTREAM: fs/fat: implement opendir/readdir/closedir
Implement the readdir interface using the directory iterators.

Change-Id: I88123b039fa0644033847670027aca9d99bd4d2e
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 1f40366b319eac7eb02f8894fff5c94fbdb47d30)
2018-01-16 18:16:48 +08:00
Rob Clark b3800056b1 UPSTREAM: fs: add fs_readdir()
Needed to support efi file protocol.  The fallback.efi loader wants
to be able to read the contents of the /EFI directory to find an OS
to boot.

Modelled after POSIX opendir()/readdir()/closedir().  Unlike the other
fs APIs, this is stateful (ie. state is held in the FS_DIR "directory
stream"), to avoid re-traversing of the directory structure at each
step.  The directory stream must be released with closedir() when it
is no longer needed.

Change-Id: I5a977a73024ff4646fc3c4f7c49993de0b5b6256
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 4bbcc965f995564870ca02606137e60e873e0a1f)
2018-01-16 18:16:48 +08:00
Rob Clark 759bf728b0 UPSTREAM: fat/fs: convert to directory iterators
And drop a whole lot of ugly code!

Change-Id: Ie4e132aae98f00738ba7cebae70209bf38cd5802
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 8eafae209c35932d9a6560809c55ee4641534236)
2018-01-16 18:16:48 +08:00
Peter Jones e9aba36569 UPSTREAM: part: extract MBR signature from partitions
EFI client programs need the signature information from the partition
table to determine the disk a partition is on, so we need to fill that
in here.

Change-Id: I27b62e383a2003e82e5424859bc9574d3b2190a2
Signed-off-by: Peter Jones <pjones@redhat.com>
[separated from efi_loader part, and fixed build-errors for non-
 CONFIG_EFI_PARTITION case]
Signed-off-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit ff98cb90514d9b787ddc097c203ac8db2941efe1)
2018-01-16 18:16:48 +08:00
Rob Clark e561b4d443 UPSTREAM: part: move efi_guid_t
Prep work for next patch.

Change-Id: Ic5e74b6843749af6cbd2de6141606019c34f716b
Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 0d6ab32e3712fe7bc2e3aaf3d93e0d5910264df3)
2018-01-16 18:16:48 +08:00
Heinrich Schuchardt 10eca96895 UPSTREAM: efi_loader: bootefi hello should use loadaddr
Command 'bootefi hello' currently uses CONFIG_SYS_LOAD_ADDR
as loading address.

qemu machines have by default 128 MiB RAM.
CONFIG_SYS_LOAD_ADDR for x86 is 0x20000000 (512 MiB).
This causes 'bootefi hello' to fail.

We should use the environment variable loadaddr if available.
It defaults to 0x1000000 (16 MiB) on qemu_x86.

Change-Id: Iff6bfbd6c93f115f7f616c42b6e1c2dc4d61e156
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 51c533fdce75fbdec7de28a05a675a553d209bcb)
2018-01-16 18:16:48 +08:00
Klaus Goger 67f537f2b3 UPSTREAM: rockchip: puma_rk3399: increase serialno_str size
Increase serialno_str to 17 bytes so it can hold the 16 bytes long serial
nummer and the terminating null byte added by snprintf.

Change-Id: Ie419f2d41ec8af598601d8726416cbaec1767266
Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 60d7c50945d65185a5c86c4f52d4671fb59292e3)
2018-01-16 18:16:48 +08:00
Philipp Tomsich 9ec2762329 UPSTREAM: rockchip: dts: rk3368: reduce the number of nodes seen in TPL
The RK3368 TPL stage always returns to the BootROM, so it has no need
for the eMMC, SD and SPI nodes.  This marks those nodes (that should
be included in SPL, but not TPL) as 'u-boot,dm-spl'.

Change-Id: I0c3d65554f01de403dd48e446991d2a545cd74fb
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 75ff0578515665a1b712275deb73be29e5ad8773)
2018-01-16 18:16:48 +08:00
Philipp Tomsich 532a7914a4 UPSTREAM: rockchip: rk3368: adjust DMC driver for 32/64bit-aware OF_PLATDATA
With the new 32/64bit-aware dtoc, the type of reg is fdt64_t and the
OF_PLATDATA structure layout changes.  This adjusts the DMC driver for
the RK3368 to track these changes.

For the time being (i.e. until regmap_init_mem_platdata works for the
64bit case), we won't use regmap_init_mem_platdata here and simply
access of_plat.reg[] directly.

Change-Id: I9e4e5b7cb650220902914f6ad724a8a312be93ba
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 1d70f0ac88dcd0ed9c17ec4c5e97db69de961319)
2018-01-16 18:16:48 +08:00
Philipp Tomsich 6c71f0465f UPSTREAM: rockchip: timer: update for 32/64bit-aware OF_PLATDATA
With dtoc emitting fdt64_t for addresses (and region sizes), the array
indices for accessing the reg[] array needs to be adjusted.  This
adjusts the Rockchip DM timer driver to correctly handle OF_PLATDATA
given this new structure layout.

Change-Id: If5a5fec05c00a0d4c71e1b7550c399880d50908d
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 8158a848fa4d506d46a5193daf13367f3839022a)
2018-01-16 18:16:48 +08:00
Philipp Tomsich 6094f89565 UPSTREAM: rockchip: defconfig: puma-rk3399: enable OF_LIVE (live tree)
With the critical drivers ready for switching to a live tree, we can
now enable it in the defconfig for the RK3399-Q7.

Change-Id: I6bc9f0cc8de2f8b40f7dfdb8b69271412914333d
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 7b87e3bfaf1ef1109da0f749040426c9e665c361)
2018-01-16 18:16:48 +08:00
Philipp Tomsich 63a453e638 UPSTREAM: rockchip: efuse: change to use dev_read_addr_ptr
With the dev_read_addr_ptr function available, we can change the
efuse driver to use it (and eliminate the explicit type-cast).

Change-Id: I8183492892b77c8c6260070cee3104060e273c31
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 f6230a00579d5ca5ba01ca158f5c369cf64e87eb)
2018-01-16 18:16:48 +08:00
Philipp Tomsich db4c0dc88d UPSTREAM: rockchip: clk: rk3399: Convert to livetree
Update the clock driver for the RK3399  to support a live device tree.

Change-Id: I2cc96fe00c9a1b2937f53da9b11fa56bd9e058bf
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 75c7859803a334a41c8bdf0a31cd1cd61f579076)
2018-01-16 18:16:48 +08:00
Philipp Tomsich 8edf7c5aaf UPSTREAM: rockchip: dts: rk3399-puma: replace 'rockchip, vbus-gpio' with fixed regulator
On the RK3399-Q7, we need to turn on the on-module USB hub before using the
USB host interfaces (only the OTG interface is directly connected to the edge
connector).  This drops the deprecated 'rockchip,vbus-gpio' property and uses
a fixed regulator to turn on the USB hub.

References: 26a8b80 "usb: host: xhci-rockchip: use fixed regulator to control vbus"
Change-Id: Idd2f6b48976e5ac25f06e40d6cc0cccc0e10c94b
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 46c89c8efa3e56ad8919b3a36663bb12582ed4d0)
2018-01-16 18:16:48 +08:00
Philipp Tomsich cce8d7cd22 UPSTREAM: rockchip: clk: rk3399: add clk_enable function and support USB HOST0/1
The generic ehci-driver (ehci-generic.c) will try to enable the clocks
listed in the DTSI. If this fails (e.g. due to clk_enable not being
implemented in a driver and -ENOSYS being returned by the clk-uclass),
the driver will bail our and print an error message.

This implements a minimal clk_enable for the RK3399 and supports the
clocks mandatory for the EHCI controllers; as these are enabled by
default we simply return success.

Change-Id: Ic38cdb4e599c1fd8534b5e998b970b4610ab7383
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 2f01a2b2149c4c38467eeeddde09ac48d379aed3)
2018-01-16 18:16:48 +08:00
Andy Yan 1dc5824468 UPSTREAM: rockchip: rk3368: add the missing target and pinctrl config for sheep board
Add the missing target and pinctrl config for rk3368 sheep board

Change-Id: Icf677ec8bd0ecc29797b2662ca0ad4369891a0fa
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
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 8ac884974a46ae2f206b4053ea32814303912b08)
2018-01-16 18:16:48 +08:00
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