History log of /linux-master/arch/powerpc/boot/devtree.c
Revision Date Author Comments
# c93f8084 17-Jun-2021 Benjamin Herrenschmidt <benh@kernel.crashing.org>

powerpc/boot: Fixup device-tree on little endian

This fixes the core devtree.c functions and the ns16550 UART backend.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
Reviewed-by: Segher Boessenkool <segher@kernel.crashing.org>
Acked-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/YMwXrPT8nc4YUdJ9@thinks.paulus.ozlabs.org


# 2874c5fd 27-May-2019 Thomas Gleixner <tglx@linutronix.de>

treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152

Based on 1 normalized pattern(s):

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license as published by
the free software foundation either version 2 of the license or at
your option any later version

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-or-later

has been chosen to replace the boilerplate/reference in 3029 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Allison Randal <allison@lohutok.net>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190527070032.746973796@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 49e6e3f1 19-Dec-2008 Scott Wood <scottwood@freescale.com>

powerpc/bootwrapper: Use the child-bus #address-cells to decide which range entry to use

The correct #address-cells was still used for the actual translation,
so the impact is only a possibility of choosing the wrong range entry
or failing to find any match. Most common cases were not affected.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# da0a5f0c 10-Apr-2008 Laurent Pinchart <laurentp@cse-semaphore.com>

[POWERPC] Add bootwrapper function to get virtual reg from the device tree.

This patch adds a new generic device tree processing function that retrieves
virtual reg addresses from the device tree to the bootwrapper code. It also
updates the bootwrapper code to use the new function.

dt_get_virtual_reg() retrieves the virtual reg addresses from the
"virtual-reg" property. If the property can't be found, it uses the "reg"
property and walks the tree to translate it to absolute addresses.

Signed-off-by: Laurent Pinchart <laurentp@cse-semaphore.com>
Acked-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>


# ad160681 15-Jan-2008 Kumar Gala <galak@kernel.crashing.org>

[POWERPC] bootwrapper: Add find_node_by_alias and dt_fixup_mac_address_by_alias

Add the ability to set the mac address given the alias for the device.
Removes the need for having a linux,network-index property.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>


# 27ff35d9 24-Sep-2007 Scott Wood <scottwood@freescale.com>

[POWERPC] bootwrapper: Factor out dt_set_mac_address()

This allows callers to set addresses one at a time when that would be more
convenient.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# 96ebc3bf 05-Sep-2007 Scott Wood <scottwood@freescale.com>

[POWERPC] bootwrapper: Only print MAC addresses when the node is actually present

Some firmwares (such as PlanetCore) only provide a base MAC address, and
expect the kernel to set certain bits to generate the addresses for the
other ports. As such, MAC addresses are generated that may not correspond
to actual hardware.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# e5d8d54d 20-Aug-2007 Scott Wood <scottwood@freescale.com>

[POWERPC] bootwrapper: Add PowerQUICC II (82xx with CPM) cuboot support

This allows booting on legacy, non-device-tree aware versions of U-boot.

It also fixes up the hardware to match the PCI and chipselect information
in the device tree, as u-boot is inconsistent in setting these up
correctly (or at all).

Signed-off-by: Scott Wood <scottwood@freescale.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# a73ac50c 20-Aug-2007 Scott Wood <scottwood@freescale.com>

[POWERPC] bootwrapper: Add dt_is_compatible()

This can be used rather than doing a simple strcmp, which will fail to
handle multiple compatible entries.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# 0602801c 20-Aug-2007 Scott Wood <scottwood@freescale.com>

[POWERPC] bootwrapper: dt_xlate_range() bugfixes

1. The check whether ranges fits in the buffer was using elements rather
than bytes.
2. Empty ranges were not properly treated as transparent, and missing
ranges were treated as transparent.
3. The loop terminated when translating from the root rather than to. Once
bug #2 was fixed, it failed due to a missing ranges in the root node.
4. In decoding the ranges property, the #size-cells used was that of
the parent, not the child.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# 643d3c13 20-Aug-2007 Scott Wood <scottwood@freescale.com>

[POWERPC] bootwrapper: Set timebase_period_ns from dt_fixup_cpu_clocks

This lets udelay() work properly on platforms which use dt_fixup_cpu_clocks.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# 8895ea48 27-Apr-2007 Mark A. Greer <mgreer@mvista.com>

[POWERPC] Add dt_xlate_addr() to bootwrapper

dt_xlate_reg() looks up the 'reg' property in the specified node
to get the address and size to translate. Add dt_xlate_addr()
which is passed in the address and size to translate.

Signed-off-by: Mark A. Greer <mgreer@mvista.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# e4bb688d 26-Apr-2007 Scott Wood <scottwood@freescale.com>

[POWERPC] bootwrapper: Fix array handling in dt_xlate_reg().

This fixes a few bugs in how dt_xlate_reg() handles address arrays:

1. copy_val() was copying into the wrong end of the array, resulting
in random stack garbage at the other end.
2. dt_xlate_reg() was getting the result from the wrong end of the array.
3. add_reg() and sub_reg() were treating the arrays as
little-endian rather than big-endian.
4. add_reg() only returned an error on a carry out of the entire
array, rather than out of the naddr portion.
5. The requested reg resource was checked to see if it exceeded
the size of the reg property, but not to see if it exceeded the
size of the buffer.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# 6e1af384 26-Mar-2007 Scott Wood <scottwood@freescale.com>

[POWERPC] bootwrapper: Add dt_xlate_reg(), and use it to find serial registers.

dt_xlate_reg() uses the ranges properties of a node's parentage to find
the absolute physical address of the node's registers.

The ns16550 driver uses this when no virtual-reg property is found.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# 27fbaa97 22-Mar-2007 David Gibson <david@gibson.dropbear.id.au>

[POWERPC] Add device tree utility functions to zImage

This patch adds a library of useful device tree manipulation functions
to the zImage library, for use by platform code. These functions are
based on the hooks already in dt_ops, so they're not dependent on a
particular device tree implementation. This patch also slightly
streamlines the code in main.c using these new functions.

This is a consolidation of my work in this area with Scott Wood's
patches to a very similar end.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>