History log of /linux-master/arch/sparc/kernel/prom_common.c
Revision Date Author Comments
# 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>


# d25d8694 11-Jun-2013 Benjamin Herrenschmidt <benh@kernel.crashing.org>

of: Fix locking vs. interrupts

The OF code uses irqsafe locks everywhere except in a handful of functions
for no obvious reasons. Since the conversion from the old rwlocks, this
now triggers lockdep warnings when used at interrupt time. At least one
driver (ibmvscsi) seems to be doing that from softirq context.

This converts the few non-irqsafe locks into irqsafe ones, making them
consistent with the rest of the code.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Grant Likely <grant.likely@linaro.org>


# d6d3c4e6 06-Feb-2013 Thomas Gleixner <tglx@linutronix.de>

OF: convert devtree lock from rw_lock to raw spinlock

With the locking cleanup in place (from "OF: Fixup resursive
locking code paths"), we can now do the conversion from the
rw_lock to a raw spinlock as required for preempt-rt.

The previous cleanup and this conversion were originally
separate since they predated when mainline got raw spinlock (in
commit c2f21ce2e31286a "locking: Implement new raw_spinlock").

So, at that point in time, the cleanup was considered plausible
for mainline, but not this conversion. In any case, we've kept
them separate as it makes for easier review and better bisection.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
[PG: taken from preempt-rt, update subject & add a commit log]
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Rob Herring <rob.herring@calxeda.com>


# e49e6ff5 29-May-2012 Sam Ravnborg <sam@ravnborg.org>

sparc: fix sparc64 build due to leon.h inclusion

Stephen Rothwell <sfr@canb.auug.org.au> reported following error:
In file included from arch/sparc/kernel/prom_common.c:26:0:
arch/sparc/include/asm/leon.h:221:9: error: unknown type name 'irq_flow_handler_t'
arch/sparc/include/asm/leon.h:224:10: error: unknown type name 'irq_flow_handler_t'

Fix this by:
1) Avoid including leon.h in prom_commen.h (not needed)
2) Include irq.h in leon.h to avoid the missing symbol error

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>


# f0a4cf31 16-Nov-2011 Thomas Meyer <thomas@m3y3r.de>

sparc: Use kmemdup rather than duplicating its implementation

The semantic patch that makes this change is available
in scripts/coccinelle/api/memdup.cocci.

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 066bcaca 22-Jul-2011 Paul Gortmaker <paul.gortmaker@windriver.com>

sparc: move symbol exporters to use export.h not module.h

Many of the core sparc kernel files are not modules, but just
including module.h for exporting symbols. Now these files can
use the lighter footprint export.h for this role.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>


# f90c34bd 10-Oct-2010 Andres Salomon <dilinger@queued.net>

of/promtree: no longer call prom_ functions directly; use an ops structure

Rather than assuming an architecture defines prom_getchild and friends,
define an ops struct with hooks for the various prom functions that
pdt.c needs. This ops struct is filled in by the
arch-(and sometimes firmware-)specific code, and passed to
of_pdt_build_devicetree.

Update sparc code to define the ops struct as well.

Signed-off-by: Andres Salomon <dilinger@queued.net>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>


# 3cfc535c 10-Oct-2010 Andres Salomon <dilinger@queued.net>

of/promtree: make drivers/of/pdt.c no longer sparc-only

Clean up pdt.c:
- make build dependent upon config OF_PROMTREE
- #ifdef out the sparc-specific stuff
- create pdt-specific header

Signed-off-by: Andres Salomon <dilinger@queued.net>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>


# 9bdf6bab 29-Aug-2010 Andres Salomon <dilinger@queued.net>

sparc: break out some PROM device-tree building code out into drivers/of

Transitioning into making this useful for architectures other than sparc.
This is a verbatim copy of all functions/variables that've been moved.

Signed-off-by: Andres Salomon <dilinger@queued.net>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>


# 035ebefc 13-Jul-2010 Andres Salomon <dilinger@queued.net>

of/sparc: move is_root_node() to of.h

Rename is_root_node() to of_node_is_root() and make it available for
all archs to use, as it's not PROM-specific.

Signed-off-by: Andres Salomon <dilinger@queued.net>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>


# 89751a7c 01-Feb-2010 Jeremy Kerr <jeremy.kerr@canonical.com>

of: merge of_find_node_by_phandle

Merge common function between powerpc, sparc and microblaze. Code is
identical for powerpc and microblaze, but adds a lock (and release) of
the devtree_lock on sparc.

Signed-off-by: Jeremy Kerr <jeremy.kerr@canonical.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>


# 6016a363 28-Jan-2010 Grant Likely <grant.likely@secretlab.ca>

of: unify phandle name in struct device_node

In struct device_node, the phandle is named 'linux_phandle' for PowerPC
and MicroBlaze, and 'node' for SPARC. There is no good reason for the
difference, it is just an artifact of the code diverging over a couple
of years. This patch renames both to simply .phandle.

Note: the .node also existed in PowerPC/MicroBlaze, but the only user
seems to be arch/powerpc/platforms/powermac/pfunc_core.c. It doesn't
look like the assignment between .linux_phandle and .node is
significantly different enough to warrant the separate code paths
unless ibm,phandle properties actually appear in Apple device trees.

I think it is safe to eliminate the old .node property and use
phandle everywhere.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: David S. Miller <davem@davemloft.net>
Tested-by: Wolfram Sang <w.sang@pengutronix.de>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>


# 1c9d80dd 08-Nov-2009 David S. Miller <davem@davemloft.net>

sparc: Move of_set_property_mutex acquisition outside of devtree_lock grab.

Otherwise we try to sleep with preemption disabled, etc.

Noticed by Thomas Gleixner.

Signed-off-by: David S. Miller <davem@davemloft.net>


# e63829de 16-Aug-2009 Konrad Eisele <konrad@gaisler.com>

sparc,leon: Added support for AMBAPP bus.

The device is a AMBA bus if it is a child of prom node "ambapp" (AMBA
plug and play). Two functions
leon_trans_init() and leon_node_init() (defined in
sparc/kernel/leon_kernel.c) are called in the
prom_build_tree() path if CONFIG_SPARC_LEON is
defined. leon_node_init() will build up the device
tree using AMBA plug and play. Also: a extra check was addes to
prom_common.c:build_one_prop()
in case a rom-node is undefined which can happen for SPARC-LEON
because it creates only a minimum
nodes to emulate sparc behaviour.

Signed-off-by: Konrad Eisele <konrad@gaisler.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 890db403 01-Apr-2009 David S. Miller <davem@davemloft.net>

sparc: Call OF and MD cpu scanning explicitly from paging_init()

We need to split up the cpu present mask setup from the cpu_data
initialization, and this is a first step towards that.

Signed-off-by: David S. Miller <davem@davemloft.net>


# 47cd5265 05-Jan-2009 Julian Calaby <julian.calaby@gmail.com>

sparc: Clean arch-specific code in prom_common.c

prom_nextprop() and prom_firstprop() have slightly different calling
conventions in 32 and 64 bit SPARC.

prom_common.c uses a ifdef guard to ensure that these functions are
called correctly.

Adjust code to eliminate this ifdef by using a calling convention that
is compatible with both 32 and 64 bit SPARC.

Signed-off-by: Julian Calaby <julian.calaby@gmail.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>


# bf944c37 07-Dec-2008 David S. Miller <davem@davemloft.net>

sparc: Restore irq_trans_init() call in prom_create_node().

This broke sparc64 in various ways.

Add an empty dummy hook in sparc32's prom_32.c so that we
can potentially handle things on that side similarly, and
in particular avoid a prom_common.c ifdef :-)

Signed-off-by: David S. Miller <davem@davemloft.net>


# ad07aed8 05-Dec-2008 David S. Miller <davem@davemloft.net>

sparc: Move of_console_{device,path,options} info prom_common.c

Signed-off-by: David S. Miller <davem@davemloft.net>


# 23dc758e 05-Dec-2008 David S. Miller <davem@davemloft.net>

sparc: Move prom_build_devicetree() into prom_common.c

To make this work we provide a dummy nop implementation
of of_fill_in_cpu_data() for sparc32.

Signed-off-by: David S. Miller <davem@davemloft.net>


# 6524036a 05-Dec-2008 David S. Miller <davem@davemloft.net>

sparc: Move core of OF device tree building code into prom_common.c

Signed-off-by: David S. Miller <davem@davemloft.net>


# 7d9439d5 05-Dec-2008 David S. Miller <davem@davemloft.net>

sparc: Move create_node() and friends into prom_common.c

Signed-off-by: David S. Miller <davem@davemloft.net>


# b9e5567c 05-Dec-2008 David S. Miller <davem@davemloft.net>

sparc: Move property building code into prom_common.c

Unfortunately there is some sparc32/sparc64 ifdef'ery in
here due to the difference in how the prom_firstprop()
and prom_nextprop() routines work.

This will be eliminated eventually.

Signed-off-by: David S. Miller <davem@davemloft.net>


# e5ff0fe3 05-Dec-2008 David S. Miller <davem@davemloft.net>

sparc: Move 'unique_id' into prom_common.c and rename to 'prom_unique_id'

This will be used in a subsequent changeset.

Signed-off-by: David S. Miller <davem@davemloft.net>


# dfa76060 04-Dec-2008 David S. Miller <davem@davemloft.net>

sparc: Create common area for OF device layer code.

This is where common code implementations will go as we unify
32-bit and 64-bit OF device tree code.

Signed-off-by: David S. Miller <davem@davemloft.net>