Commit Graph

13 Commits

Author SHA1 Message Date
Joseph Chen 6a1649e26d core: node: remove unused API
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I797cb2f594865ab9310651183bf98b8112fe429e
2020-11-02 18:34:21 +08:00
Joseph Chen 05e0f98eb3 driver: core: add dev_del_prop() api
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Id016f2f3e2d4d80a7dbd72d02a038c07b3a0de26
2020-03-17 08:53:09 +08:00
Joseph Chen 028a3c0879 dm: cmd: add "dm aliases" support
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I46d44a31a6fe82627bde5ff655b125e44add7a8a
2019-12-16 21:01:05 +08:00
Joseph Chen 04539b46d5 dm: core: add function dev_write_u32_array() to write u32 array values
Change-Id: I6633395c7704eefff59c2145562fe239e21f3b35
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-06-14 18:22:36 +08:00
Masahiro Yamada 0e00a84cde UPSTREAM: libfdt: move headers to <linux/libfdt.h> and <linux/libfdt_env.h>
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>
2018-12-24 17:20:37 +08:00
Joseph Chen f935b6dc55 core: of_access: delete exist aliases when adding new one
This new one is from kernel dtb if kernel dtb is enabled.

Change-Id: I6fb54812188fe8749271a7aaae565bc7fa4cb3cc
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-12-10 16:28:11 +08:00
Joseph Chen d59cf5aebb dm: of_access: add ofnode_read_u64() support
only support of-live.

Change-Id: I37c10efa30ef46369f4a4ad7f16c4c758d6ad563
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-11-28 14:09:47 +08:00
Joseph Chen 064eb49314 serial: ns16550: support using pre-loader serial
- 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>
2018-10-19 17:40:56 +08:00
Joseph Chen 2e02c4e25b dm: of_access: add of_alias_get_dev() and of_alias_dump()
- 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>
2018-10-18 10:32:18 +08:00
Patrice Chotard 642346ae26 dm: core: add ofnode_count_phandle_with_args()
This function is usefull to get phandle number contained
in a property list.
For example,  this allows to allocate the right amount
of memory to keep clock's reference contained into the
"clocks" property.

To implement it, either of_count_phandle_with_args() or
fdtdec_parse_phandle_with_args() are used respectively
for live tree and flat tree.
By passing index = -1, these 2 functions returns the
number of phandle contained into the property list.

Add also the dev_count_phandle_with_args() based on
ofnode_count_phandle_with_args()

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2017-07-28 23:34:08 +02:00
Simon Glass 878d68c0c3 dm: core: Add functions to obtain node's address/size cells
The of_n_addr_cells() and of_n_size_cells() functions are useful for
getting the size of addresses in a node, but in a few places U-Boot needs
to obtain the actual property value for a node without walking up the
stack. Add functions for this and just the existing code to use it.

Add a comment to the existing ofnode functions which do not do the right
thing with a flat tree.

This fixes a problem reading PCI addresses.

Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Tested-on: Beaver, Jetson-TK1
2017-07-11 10:08:20 -06:00
Simon Glass 73027a853d dm: core: Supress dead-code warning in __of_get_next_child()
Suppress a warning on next = next->sibling.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Coverity (CID: 163245)
Fixes 644ec0a (dm: core: Add livetree access functions)
2017-06-12 08:38:10 -04:00
Simon Glass 644ec0a933 dm: core: Add livetree access functions
Add a basic assortment of functions to access the live device tree. These
come from Linux v4.9 and are modified for U-Boot to the minimum extent
possible. While these functions are now very stable in Linux, it will be
possible to merge in fixes if needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01 07:03:06 -06:00