28 Sep, 2016
1 commit
-
We have multiple "earlycon" early_param handlers - merge the DT one into
the main earlycon one. It's a cleanup that also will be useful
to defer setting up DT console until ACPI/DT decision is made.Rename the exported function to avoid clashing with the function from
arch/microblaze/kernel/prom.cSigned-off-by: Leif Lindholm
Signed-off-by: Aleksey Makarov
Acked-by: Rob Herring
Acked-by: Greg Kroah-Hartman
Reviewed-by: Peter Hurley
Tested-by: Kefeng Wang
Tested-by: Christopher Covington
Signed-off-by: Greg Kroah-Hartman
06 Jul, 2016
1 commit
-
Sometimes it needs to check if there is a subnode of given node in FDT
by given name. Introduce this helper to get the subnode if it exists.CC: Rob Herring
Signed-off-by: Shannon Zhao
Acked-by: Stefano Stabellini
Acked-by: Rob Herring
Tested-by: Julien Grall
16 May, 2016
2 commits
-
This returns the allocate memory chunk, storing the unflattened device
tree, from of_fdt_unflatten_tree() so that memory chunk can be released
on demand in PowerNV PCI hotplug driver.Signed-off-by: Gavin Shan
Acked-by: Rob Herring
Signed-off-by: Rob Herring -
This adds one more argument to of_fdt_unflatten_tree() to specify
the parent node of the FDT blob that is going to be unflattened.
In the result, the function can be used to unflatten FDT blob that
represents device sub-tree in PowerNV PCI hotplug driver.Cc: Jyri Sarha
Signed-off-by: Gavin Shan
Acked-by: Rob Herring
Acked-by: Jyri Sarha
Signed-off-by: Rob Herring
07 Feb, 2016
1 commit
-
Cleanup the early DT/earlycon separation; remove the 'addr' parameter
from of_setup_earlycon() and get the uart phys addr directly with a
new wrapper function, of_flat_dt_translate_addr(). Limit
fdt_translate_address() to file scope.Acked-by: Rob Herring
Signed-off-by: Peter Hurley
Signed-off-by: Greg Kroah-Hartman
02 Jul, 2015
1 commit
-
Pull devicetree updates from Grant Likely:
"A whole lot of bug fixes.Nothing stands out here except the ability to enable CONFIG_OF on
every architecture, and an import of a newer version of dtc"* tag 'devicetree-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/glikely/linux: (22 commits)
of/irq: Rename "intc_desc" to "of_intc_desc" to fix OF on sh
of/irq: Fix pSeries boot failure
Documentation: DT: Fix a typo in the filename "lantiq,-pinumx.txt"
of: define of_find_node_by_phandle for !CONFIG_OF
of/address: use atomic allocation in pci_register_io_range()
of: Add vendor prefix for Zodiac Inflight Innovations
dt/fdt: add empty versions of early_init_dt_*_memory_arch
of: clean-up unnecessary libfdt include paths
of: make unittest select OF_EARLY_FLATTREE instead of depend on it
of: make CONFIG_OF user selectable
MIPS: prepare for user enabling of CONFIG_OF
of/fdt: fix argument name and add comments of unflatten_dt_node()
of: return NUMA_NO_NODE from fallback of_node_to_nid()
tps6507x.txt: Remove executable permission
of/overlay: Grammar s/an negative/a negative/
of/fdt: Make fdt blob input parameters of unflatten functions const
of: add helper function to retrive match data
of: Grammar s/property exist/property exists/
of: Move OF flags to be visible even when !CONFIG_OF
scripts/dtc: Update to upstream version 9d3649bd3be245c9
...
02 Jun, 2015
1 commit
-
This splits off the reservation of the memory occupied by the FDT
binary itself from the processing of the memory reservations it
contains. This is necessary because the physical address of the FDT,
which is needed to perform the reservation, may not be known to the
FDT driver core, i.e., it may be mapped outside the linear direct
mapping, in which case __pa() returns a bogus value.Cc: Russell King
Cc: Benjamin Herrenschmidt
Cc: Paul Mackerras
Acked-by: Rob Herring
Acked-by: Mark Rutland
Acked-by: Catalin Marinas
Signed-off-by: Ard Biesheuvel
Signed-off-by: Catalin Marinas
29 May, 2015
1 commit
-
Operations to unflatten fdt blobs never modify the input blobs, hence
make them const. Now we no longer need to cast arbitrary const data to
"void *" when calling of_fdt_unflatten_tree().Signed-off-by: Geert Uytterhoeven
Signed-off-by: Rob Herring
15 Apr, 2015
1 commit
-
Provide a libfdt-based equivalent for of_device_is_big_endian(), suitable
for use in the early_init_* functions.Signed-off-by: Kevin Cernekee
Reviewed-by: Peter Hurley
Acked-by: Greg Kroah-Hartman
Signed-off-by: Rob Herring
30 Jul, 2014
2 commits
-
Buggy bootloaders may pass bogus memory entries in the devicetree.
Add of_fdt_limit_memory to add an upper bound on the number of
entries that can be present in the devicetree.Signed-off-by: Laura Abbott
Tested-by: Andreas Färber
Signed-off-by: Grant Likely -
Currently, early_init_dt_scan validates the header, sets the
boot params, and scans for chosen/memory all in one function.
Split this up into two separate functions (validation/setting
boot params in one, scanning in another) to allow for
additional setup between boot params and scanning the memory.Signed-off-by: Laura Abbott
Tested-by: Andreas Färber
[glikely: s/early_init_dt_scan_all/early_init_dt_scan_nodes/]
Signed-off-by: Grant Likely
21 May, 2014
1 commit
-
Copy u-boot's FDT address translation code from common/fdt_support. This
code was originally based on the kernel's unflattened DT address parsing
code.This commit can be reverted once relicensing of this code to GPLv2/BSD
is done and it is added to libfdt.Signed-off-by: Rob Herring
Acked-by: Grant Likely
30 Apr, 2014
8 commits
-
Now powerpc is the only user of struct boot_param_header and FDT defines,
so they can be moved into the powerpc architecture code.Signed-off-by: Rob Herring
Acked-by: Benjamin Herrenschmidt
Cc: Paul Mackerras
Cc: linuxppc-dev@lists.ozlabs.org
Tested-by: Grant Likely
Tested-by: Stephen Chivers -
Now that all accesses to FDT header data has been converted to accessor
helpers, initial_boot_params can become an opaque pointer.Signed-off-by: Rob Herring
Tested-by: Michal Simek
Tested-by: Grant Likely
Tested-by: Stephen Chivers -
Add a wrapper function to retrieve the FDT size from the FDT header. This
is primarily to avoid libfdt include paths for the whole kernel.Signed-off-by: Rob Herring
Tested-by: Grant Likely
Tested-by: Stephen Chivers -
With libfdt support, we can take advantage of helper accessors in libfdt
for accessing the FDT header data. This makes the code more readable and
makes the FDT blob structure more opaque to the kernel. This also
prepares for removing struct boot_param_header completely.Signed-off-by: Rob Herring
Cc: Max Filippov
Tested-by: Michal Simek
Tested-by: Grant Likely
Tested-by: Stephen Chivers -
The kernel FDT functions predate libfdt and are much more limited in
functionality. Also, the kernel functions and libfdt functions are
not compatible with each other because they have different definitions
of node offsets. To avoid this incompatibility and in preparation to
add more FDT parsing functions which will need libfdt, let's first
convert the existing code to use libfdt.The FDT unflattening, top-level FDT scanning, and property retrieval
functions are converted to use libfdt. The scanning code should be
re-worked to be more efficient and understandable by using libfdt to
find nodes directly by path or compatible strings.Signed-off-by: Rob Herring
Tested-by: Michal Simek
Tested-by: Grant Likely
Tested-by: Stephen Chivers -
Make of_get_flat_dt_prop arguments compatible with libfdt fdt_getprop
call in preparation to convert FDT code to use libfdt. Make the return
value const and the property length ptr type an int.Signed-off-by: Rob Herring
Tested-by: Michal Simek
Tested-by: Grant Likely
Tested-by: Stephen Chivers -
of_scan_flat_dt_by_path is unused anywhere in the kernel, so remove it.
Signed-off-by: Rob Herring
Tested-by: Michal Simek
Tested-by: Grant Likely
Tested-by: Stephen Chivers -
Unify the various architectures __dtb_start and __dtb_end definitions
moving them into of_fdt.h.Signed-off-by: Rob Herring
Acked-by: Vineet Gupta
Acked-by: James Hogan
Tested-by: Michal Simek
Cc: Ralf Baechle
Cc: Jonas Bonn
Cc: Chris Zankel
Cc: Max Filippov
Cc: linux-metag@vger.kernel.org
Cc: linux-mips@linux-mips.org
Cc: linux@lists.openrisc.net
Cc: linux-xtensa@linux-xtensa.org
Tested-by: Grant Likely
Tested-by: Stephen Chivers
12 Mar, 2014
1 commit
-
This patch adds support for static (defined by 'reg' property) reserved
memory regions declared in device tree.Memory blocks can be reliably reserved only during early boot. This must
happen before the whole memory management subsystem is initialized,
because we need to ensure that the given contiguous blocks are not yet
allocated by kernel. Also it must happen before kernel mappings for the
whole low memory are created, to ensure that there will be no mappings
(for reserved blocks). Typically, all this happens before device tree
structures are unflattened, so we need to get reserved memory layout
directly from fdt.Based on previous code provided by Josh Cartwright
Signed-off-by: Marek Szyprowski
Signed-off-by: Grant Likely
10 Jan, 2014
1 commit
-
For a relocatable kernel since it can be loaded at any place, there
is no any relation between the kernel start addr and the memstart_addr.
So we can't calculate the memstart_addr from kernel start addr. And
also we can't wait to do the relocation after we get the real
memstart_addr from device tree because it is so late. So introduce
a new function we can use to get the first memblock address and size
in a very early stage (before machine_init).Signed-off-by: Kevin Hao
Signed-off-by: Scott Wood
10 Oct, 2013
4 commits
-
Introduce common of_flat_dt_match_machine and
of_flat_dt_get_machine_name functions to unify architectures' handling
of machine level model and compatible properties.Several architectures match the root compatible string with an arch
specific list of machine descriptors duplicating the same search
algorithm. Create a common implementation with a simple architecture
specific hook to iterate over each machine's match table.Signed-off-by: Rob Herring
Acked-by: Grant Likely -
All arches do essentially the same thing now for
early_init_dt_setup_initrd_arch, so it can now be removed.Signed-off-by: Rob Herring
Acked-by: Vineet Gupta
Cc: Russell King
Cc: Mark Salter
Cc: Aurelien Jacquiot
Cc: James Hogan
Cc: Michal Simek
Cc: Ralf Baechle
Cc: Jonas Bonn
Cc: Benjamin Herrenschmidt
Cc: Paul Mackerras
Cc: Thomas Gleixner
Cc: Ingo Molnar
Cc: "H. Peter Anvin"
Cc: x86@kernel.org
Cc: Chris Zankel
Cc: Max Filippov
Acked-by: Grant Likely -
Most architectures scan the all the same items early in the FDT and none
are really architecture specific. Create a common early_init_dt_scan to
unify the early scan of root, memory, and chosen nodes in the flattened
DT.Signed-off-by: Rob Herring
Acked-by: Grant Likely -
Several architectures using DT support built-in dtb's in the init
section. These platforms need to copy the dtb from init since the
strings are referenced after unflattening. Every arch has their own
copying routine which do the same thing. Create a common function,
unflatten_and_copy_device_tree, to copy the dtb when unflattening the
dtb.Signed-off-by: Rob Herring
Acked-by: Grant Likely
11 Sep, 2013
1 commit
-
Pull device tree core updates from Grant Likely:
"Generally minor changes. A bunch of bug fixes, particularly for
initialization and some refactoring. Most notable change if feeding
the entire flattened tree into the random pool at boot. May not be
significant, but shouldn't hurt either"Tim Bird questions whether the boot time cost of the random feeding may
be noticeable. And "add_device_randomness()" is definitely not some
speed deamon of a function.* tag 'devicetree-for-linus' of git://git.secretlab.ca/git/linux:
of/platform: add error reporting to of_amba_device_create()
irq/of: Fix comment typo for irq_of_parse_and_map
of: Feed entire flattened device tree into the random pool
of/fdt: Clean up casting in unflattening path
of/fdt: Remove duplicate memory clearing on FDT unflattening
gpio: implement gpio-ranges binding document fix
of: call __of_parse_phandle_with_args from of_parse_phandle
of: introduce of_parse_phandle_with_fixed_args
of: move of_parse_phandle()
of: move documentation of of_parse_phandle_with_args
of: Fix missing memory initialization on FDT unflattening
of: consolidate definition of early_init_dt_alloc_memory_arch()
of: Make of_get_phy_mode() return int i.s.o. const int
include: dt-binding: input: create a DT header defining key codes.
of/platform: Staticize of_platform_device_create_pdata()
of: Specify initrd location using 64-bit
dt: Typo fix
OF: make of_property_for_each_{u32|string}() use parameters if OF is not enabled
27 Aug, 2013
1 commit
-
Add a function to scan the flattened device-tree starting from the
node given by the path. It is used to extract information (like reserved
memory), which is required on early boot before we can unflatten the tree.Signed-off-by: Marek Szyprowski
Acked-by: Michal Nazarewicz
Acked-by: Tomasz Figa
Reviewed-by: Rob Herring
24 Jul, 2013
1 commit
-
On some PAE architectures, the entire range of physical memory could reside
outside the 32-bit limit. These systems need the ability to specify the
initrd location using 64-bit numbers.This patch globally modifies the early_init_dt_setup_initrd_arch() function to
use 64-bit numbers instead of the current unsigned long.There has been quite a bit of debate about whether to use u64 or phys_addr_t.
It was concluded to stick to u64 to be consistent with rest of the device
tree code. As summarized by Geert, "The address to load the initrd is decided
by the bootloader/user and set at that point later in time. The dtb should not
be tied to the kernel you are booting"More details on the discussion can be found here:
https://lkml.org/lkml/2013/6/20/690
https://lkml.org/lkml/2012/9/13/544Signed-off-by: Santosh Shilimkar
Acked-by: Rob Herring
Acked-by: Vineet Gupta
Acked-by: Jean-Christophe PLAGNIOL-VILLARD
Signed-off-by: Grant Likely
28 Dec, 2011
1 commit
-
This allows dt_compat to point to a constant list of compatible strings.
Signed-off-by: Uwe Kleine-König
Signed-off-by: Rob Herring
04 Aug, 2011
1 commit
-
This reverts commit 750f463a749e28464151ad26938d11b07b1c43cb.
of_alias_* still needs work to be generalized for 'promtree' dt
platforms, and to no implicitly create entries for available ids.Signed-off-by: Grant Likely
03 Aug, 2011
1 commit
-
The patch adds function of_alias_scan to populate a global lookup
table with the properties of 'aliases' node and function
of_alias_get_id for drivers to find alias id from the lookup table.Signed-off-by: Shawn Guo
[grant.likely: add locking and rework parse loop]
Signed-off-by: Grant Likely
16 Jan, 2011
1 commit
-
The physical address is never used by the device tree code when
allocating memory for unflattening. Change the architecture's alloc
hook to return the virutal address instead.Signed-off-by: Grant Likely
09 Jan, 2011
1 commit
-
This patch forward declares struct device_node to fix a compile error
when of_fdt.h is included, but of.h is not. Alternately, including
linux/of.h could have been added to of_fdt.h, but that pulls in a lot
of unnecessary declarations when only working with the flattened
form.Signed-off-by: Grant Likely
02 Jan, 2011
1 commit
-
This patch adds of_flat_dt_match() which tests a node for
compatibility with a list of values and converts the relevant powerpc
platform code to use it. This approach simplifies the board support
code a bit.Signed-off-by: Grant Likely
Reviewed-by: Stephen Neuendorffer
30 Dec, 2010
2 commits
-
unflatten_device_tree has two dependencies on things that happen
during boot time. Firstly, it references the initial device tree
directly. Secondly, it allocates memory using the early boot
allocator. This patch factors out these dependencies and uses
the new __unflatten_device_tree function to implement a driver-visible
fdt_unflatten_tree function, which can be used to unflatten a
blob after boot time.V2:
- remove extra __va() call
- make dt_alloc functions return void *. This doesn't fix the general
strangeness in this code that constantly casts back and forth between
unsigned long and __be32 *Signed-off-by: Stephen Neuendorffer
Signed-off-by: Grant Likely -
In preparation for providing run-time handling of device trees, factor
out some of the basic functions so that they take an arbitrary blob,
rather than relying on the single boot-time tree.V2:
- functions have of_fdt_* names
- removed find_flat_dt_string
- blob argument is firstSigned-off-by: Stephen Neuendorffer
Signed-off-by: Grant Likely
22 Oct, 2010
1 commit
-
This patch refactors the early init parsing of the chosen node so that
architectures aren't forced to provide an empty implementation of
early_init_dt_scan_chosen_arch. Instead, if an architecture wants to
do something different, it can either use a wrapper function around
early_init_dt_scan_chosen(), or it can replace it altogether.This patch was written in preparation to adding device tree support to
both x86 ad MIPS.Signed-off-by: Grant Likely
Tested-by: David Daney
29 Apr, 2010
2 commits
-
This patch makes unflatten_device_tree() safe to call from any arch
setup code with the following changes:
- Make sure initial_boot_params actually points to a device tree blob
before unflattening
- Make sure the initial_boot_params->magic field is correct
- If CONFIG_OF_FLATTREE is not set, then make unflatten_device_tree()
an empty static inline function.This patch also adds some additional debug output to the top of
unflatten_device_tree().Signed-off-by: Grant Likely
-
If CONFIG_OF_FLATTREE is not set, then don't process the body of
linux/of_fdt.hSigned-off-by: Grant Likely