In order to check this node by list_del_init().
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I723821d8b9fc6d899fbd5c0b830b240486a48c73
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)
Previously we have to use serial node only from U-Boot dtb,
because we can't handle two problems to avoid serial intr fail:
- CRU phandle miss match between kernel and U-Boot dtb
- No "clock-frequency" in kernel serial node
These problems are workarund by current code, but the dm serial
seems to be works normally only for uart debug but not other uart.
Since the problems have been solved, let's allow serial driver-device
bind from kernel dtb.
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: If3453509151e086afc5b7558277bec53842ac8eb
It works when CONFIG_USING_KERNEL_DTB is enabled, because we can
set either 'u-boot,dm-spl' or 'u-boot,dm-pre-reloc' for the node
that we can to leave in the u-boot.dtb.
Change-Id: Id3cec0c64ee55ca9bc1e5871e7ad5a2ebb4b1b6a
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Do not use mtd node from kernel dtb, otherwise the driver will
be initialized twice.
Change-Id: I6f3dca8fd8c3e05475f4359fe6c3c5312c0984cd
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
There is not crypto node in kernel dtb for early platform(such as
rk322x/rk3288/rk3368/rk3399, etc), so we decide to add crypto node
always in U-Boot dtb and ignore crypto node from kernel dtb.
This is a way to compatible with early platforms. Actually, we
need crypto during secure boot sequence, the crypto had better
not depends on kernel dtb.
Change-Id: Ibab4fca0741b45042b8d0868240449fb6b52aa14
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Use "u-boot,dm-pre-reloc" to identify whether the existance
node is from U-Boot or not. This avoids deleting the same name
nodes from kernel dtb.
Change-Id: I6503965c0013053feefad7e93f98b01b5af71f44
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Thomas reported U-Boot failed to build host tools if libfdt-devel
package is installed because tools include libfdt headers from
/usr/include/ instead of using internal ones.
This commit moves the header code:
include/libfdt.h -> include/linux/libfdt.h
include/libfdt_env.h -> include/linux/libfdt_env.h
and replaces include directives:
#include <libfdt.h> -> #include <linux/libfdt.h>
#include <libfdt_env.h> -> #include <linux/libfdt_env.h>
Change-Id: I6c0f7e50e8b571106627f25ddac008a62bd2994e
Reported-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
This new one is from kernel dtb if kernel dtb is enabled.
Change-Id: I6fb54812188fe8749271a7aaae565bc7fa4cb3cc
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
- pass pre-loader serial configure by rk atags;
- it depends on serial aliases to find uart port;
- enabled by CONFIG_ROCKCHIP_USING_PRELOADER_SERIAL;
Change-Id: I6723cccc5e1f3dac77203b4cc19cdac631f5133b
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
- support get device_node by given stem and alias id;
- dump of alias nodes added in aliases_lookup.
Change-Id: I3ed8bd4692dd3fbbeebe9978a797a5a2dcf7eb23
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
The Rockchip video drivers need to walk the ofnode-parrents to find
an enclosing device that has a UCLASS_DISPLAY driver bound. This
adds a ofnode_get_parent()-function that returns the parent-node.
Change-Id: I312236c966348aaa36ffc30e3f7dbc83d706fb36
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Tested-by: Klaus Goger <klaus.goger@theobroma-systems.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
(cherry picked from commit e2d5997ffdf5cbf4f7d53584dab2ffc673f50987)
We do not need to assign-clock for every driver in Rockchip platform,
only below module need this feature, remove it for boot time optimize:
- GMAC (need set parent from dts)
- CRU ARM clock (rockchip board will call set_armclk_rate() instead)
- VOP (need set parent)
Change-Id: Ie8facfb7499323f4649e0e1d908f850de1338e12
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Don't duplicate bind EMMC and NAND device after load kernel dtb.
Always use serial node from u-boot and use all other nodes from kernel.
Change-Id: Iaef9258f66f4f1060f057a9f7b194694e0e1df21
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Do not use nand node from kernel dtb, or the driver will
be initialized twice.
Change-Id: Iae3e76094d074549e6f52c20261ceefa9b98be1b
Signed-off-by: Yifeng Zhao <zyf@rock-chips.com>
With kernel dtb support, there are two dtbs and some devices may have
the same driver and nanme, the api uclass_get_device_by_driver() and
uclass_get_device_by_name() may get wrong value. In order to use cru
node in kernel dtb, remove the same device whose node is in u-boot dtb.
Change-Id: Id19eedb276731fa18b07bca51bbc203636f20c31
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
fdtdec_get_addr_size() hard-codes the number of cells used to represent
an address or size in DT. This is incorrect in many cases depending on
the DT binding for a particular node or property (e.g. it is incorrect
for the "reg" property). In most cases, DT parsing code must use the
properties #address-cells and #size-cells to parse addres properties.
Change-Id: I736cf41f48eaac5d6b82510a037f447ff874a9e4
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
These two op have too much print, convert to pr_debug and not print
by default.
Change-Id: I5b3c738db783419717441e24ee0b04ab6f02d61e
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Assigned clocks are widely used in kernel, but not in U-Boot yet,
many U-Boot clock driver do not have the API while dts port from kernel
have "assigned-clocks" node.
Just give a warning now instead of a device probe fail.
Change-Id: Icc1da8bdd1a21d6d118e37d305bd7909758c40b2
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
The driver for U-Boot and kernel are different, we can not re-use
mmc node from kernel now.
BTW: U-Boot need alias for mmc to make sure emmc at mmc0(not support
in kernel dtb).
Change-Id: I1b8fd3ab8a28e3abb5964dc113d0028abe2beaa2
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Linux uses the properties 'assigned-clocks', 'assigned-clock-parents'
and 'assigned-clock-rates' to configure the clock subsystem for use
with various peripheral nodes.
This implements clk_set_defaults() and hooks it up with the general
device probibin in drivers/core/device.c: when a new device is probed,
clk_set_defaults() will be called for it and will process the
properties mentioned above.
Note that this functionality is designed to fail gracefully (i.e. if a
clock-driver does not implement set_parent(), we simply accept this
and ignore the error) as not to break existing board-support.
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Tested-by: David Wu <david.wu@rock-chips.com>
Series-changes: 2
- Fixed David's email address.
Series-version: 2
Cover-letter:
clk: support assigned-clock, assigned-clock-parents, assigned-clock-rates
For various peripherals on Rockchip SoCs (e.g. for the Ethernet GMAC),
the parent-clock needs to be set via the DTS. This adds the required
plumbing and implements the GMAC case for the RK3399.
END
(cherry picked from commit f4fcba5c5baaaa9d477d753f97124efdb8e45893)
Change-Id: I549891987c5a3e8546b96f1f54ad575950f92b12
Signed-off-by: David Wu <david.wu@rock-chips.com>
Each uclass has a driver name which we can use to look up the uclass. This
is useful for logging, where the uclass ID is used as the category.
Add a function to handle this, as well as a test.
Change-Id: Id221809d6f9f818b52a5bf88f4e12d409a070f05
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 6e43d1b19982b1756b7c607569d1778e556d6577)
Judging from its name and parameters, device_is_compatible looks like it
is compatible with a live device tree, but it actually isn't.
Make it compatible with a live device tree.
Reviewed-by: Simon Glass <sjg@chromium.org>
Change-Id: I892142d611ab5068d4ec6bdb51666a673b679794
Signed-off-by: Mario Six <mario.six@gdsys.cc>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 29d11b8838bb2aa324b8873159cbd7088870a75b)
With kernel dtb support, there have two dtb and some device may the same,
skip it if already in the list, node in u-boot dtb will be used.
Change-Id: Ic9f8b73e3708a03416a9dc4ab6c72fa0184a6fdb
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
We need to get ofnode from a phandle, add interface to support
both live dt and fdt.
Change-Id: I01a5241e2eced37b68ab6556cc1b16001eecbe0f
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Add to api for who can not get phandle from a device property.
Change-Id: I8395f02d1731a4bbb00af1e4fa9d151830fc54b0
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
After reloc and before dm_scan_init again, the dm_root is broken.
Change-Id: Ia5b1f762a396daa78d2498b160f89a951a4ec544
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
In some case with LIVE DT, some node always not valid.
Change-Id: I20ebc530f7addfef167dd5abbab46e8da0627dd8
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
This is a fix to:
642346a dm: core: add ofnode_count_phandle_with_args()
Change-Id: I25befa448e44884440060d43be905744cd4cd319
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
We are going to use a tiny dtb(with 'u-boot,dm-pre-reloc') in pre-relocate,
and then read kernel dtb and use it after relocate.
This feature only works with CONFIG_OF_LIVE enabled now.
Change-Id: I429ccd90ef562a96f2f7916255e7e427ce8f451d
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Some device like syscon, blk do not have of node, return directly.
Change-Id: Icc4629632522f4a3af6532c6a9f2152b0e45de8b
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
This currently causes a warning in sandbox and will not do the right
thing:
drivers/core/read.c: In function ‘dev_read_addr_ptr’:
drivers/core/read.c:64:44: warning: cast to pointer from integer of
different size [-Wint-to-pointer-cast]
return (addr == FDT_ADDR_T_NONE) ? NULL : (void *)addr;
Use map_sysmem() which is the correct way to convert an address to a
pointer.
Fixes: c131c8bca8 (dm: core: add dev_read_addr_ptr())
Change-Id: Ic8ef1cb185d98d84dc6cf35a7001dcdcb4caa849
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 8ccc2db6e84244e5cb57885dc9dfd7e752071b98)
No global pointer is used in this file.
Change-Id: I0c2dcde65300f815348d6f44922577225dd0ddf4
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 3d569a807e17b146731c37db0cf21125134dee23)
The livetree codepath of ofnode_get_addr_size always used the "reg"
property for of_get_property. Use the property parameter of the function
call instead and check the return value if the property exists.
Otherwise return FDT_ADDR_T_NONE.
This was discoverd while using SPI NOR with livetree.
spi_flash_decode_fdt checks for memory-map and will not fail with
livetree even if the property does not exist.
Change-Id: Icc63d2edbccea6a9f17cdcb5818993d317736ede
Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com>
Reviewed-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 68a345294ac74505f17d65b003a7de836b3d9cba)