* [PATCH 0/5] Eliminate of_platform_bus_type
From: Grant Likely @ 2010-07-21 23:39 UTC (permalink / raw)
To: Stephen Rothwell, Michal Simek, Benjamin Herrenschmidt,
Greg Kroah-Hartman, linux-kernel, linuxppc-dev,
microblaze-uclinux, sparclinux, David Miller
This series eliminates the OF platform bus type and moves all users over
to the platform bus. There is still work to be done to remove the
of_platform_driver references the affected drivers and then remove the
transitional code, but with this series those changes can be done piecewise.
These changes have been tested on PowerPC and UltraSparc. Microblaze
has only been compile tested (at least by me, but they've been in my test
branch for a long time now, so Michal may have given them a spin.
This series depends on my next-devicetree[1] branch which is also in
linux-next. I'm pushing them out to my experimental[2] branch for testing
now, and I'll add them to next-devicetree next week unless I hear
otherwise.
David, you'll also want to take a look at patches 4 & 5 to see if you
agree with my decisions on where I move symbols in the header files.
Cheers,
g.
---
Grant Likely (5):
drivercore/of: Add OF style matching to platform bus
of: Merge of_platform_bus_type with platform_bus_type
of/platform: remove all of_bus_type and of_platform_bus_type references
of: remove asm/of_platform.h
of: remove asm/of_device.h
arch/microblaze/include/asm/of_device.h | 13 ------
arch/microblaze/include/asm/of_platform.h | 19 --------
arch/microblaze/kernel/of_platform.c | 14 ------
arch/microblaze/kernel/setup.c | 6 ---
arch/powerpc/include/asm/of_device.h | 3 -
arch/powerpc/include/asm/of_platform.h | 16 -------
arch/powerpc/include/asm/prom.h | 2 +
arch/powerpc/kernel/dma-swiotlb.c | 8 ---
arch/powerpc/kernel/of_platform.c | 15 ------
arch/powerpc/kernel/setup-common.c | 7 ---
arch/powerpc/platforms/cell/beat_iommu.c | 2 -
arch/powerpc/platforms/cell/iommu.c | 2 -
arch/powerpc/sysdev/mv64x60_dev.c | 7 ---
arch/sparc/include/asm/device.h | 2 +
arch/sparc/include/asm/of_device.h | 19 --------
arch/sparc/include/asm/of_platform.h | 18 --------
arch/sparc/include/asm/parport.h | 4 --
arch/sparc/include/asm/prom.h | 4 ++
arch/sparc/kernel/apc.c | 2 -
arch/sparc/kernel/auxio_64.c | 2 -
arch/sparc/kernel/central.c | 4 +-
arch/sparc/kernel/chmc.c | 4 +-
arch/sparc/kernel/of_device_32.c | 21 ++-------
arch/sparc/kernel/of_device_64.c | 21 ++-------
arch/sparc/kernel/of_device_common.c | 5 --
arch/sparc/kernel/pci_fire.c | 2 -
arch/sparc/kernel/pci_psycho.c | 2 -
arch/sparc/kernel/pci_sabre.c | 2 -
arch/sparc/kernel/pci_schizo.c | 2 -
arch/sparc/kernel/pci_sun4v.c | 2 -
arch/sparc/kernel/pmc.c | 2 -
arch/sparc/kernel/power.c | 2 -
arch/sparc/kernel/time_32.c | 2 -
arch/sparc/kernel/time_64.c | 6 +--
drivers/atm/fore200e.c | 6 +--
drivers/base/platform.c | 11 +++++
drivers/char/hw_random/n2-drv.c | 4 +-
drivers/crypto/n2_core.c | 10 ++--
drivers/hwmon/ultra45_env.c | 4 +-
drivers/input/misc/sparcspkr.c | 12 ++---
drivers/input/serio/i8042-sparcio.h | 5 +-
drivers/mtd/maps/sun_uflash.c | 4 +-
drivers/net/ibm_newemac/core.c | 4 +-
drivers/net/myri_sbus.c | 4 +-
drivers/net/niu.c | 6 +--
drivers/net/sunbmac.c | 4 +-
drivers/net/sunhme.c | 4 +-
drivers/net/sunlance.c | 4 +-
drivers/net/sunqe.c | 4 +-
drivers/of/device.c | 5 ++
drivers/of/platform.c | 67 ++++++++++++++++++++++++++++-
drivers/parport/parport_sunbpp.c | 4 +-
drivers/sbus/char/bbc_i2c.c | 4 +-
drivers/sbus/char/display7seg.c | 4 +-
drivers/sbus/char/envctrl.c | 4 +-
drivers/sbus/char/flash.c | 4 +-
drivers/sbus/char/uctrl.c | 4 +-
drivers/scsi/qlogicpti.c | 4 +-
drivers/scsi/sun_esp.c | 4 +-
drivers/serial/sunhv.c | 4 +-
drivers/serial/sunsab.c | 4 +-
drivers/serial/sunsu.c | 2 -
drivers/serial/sunzilog.c | 6 +--
drivers/video/bw2.c | 4 +-
drivers/video/cg14.c | 4 +-
drivers/video/cg3.c | 4 +-
drivers/video/cg6.c | 4 +-
drivers/video/ffb.c | 4 +-
drivers/video/leo.c | 4 +-
drivers/video/p9100.c | 4 +-
drivers/video/sunxvr1000.c | 4 +-
drivers/video/tcx.c | 4 +-
drivers/watchdog/cpwd.c | 4 +-
drivers/watchdog/riowd.c | 4 +-
include/linux/of_device.h | 8 +++
include/linux/of_platform.h | 23 ++--------
sound/sparc/amd7930.c | 4 +-
sound/sparc/cs4231.c | 4 +-
sound/sparc/dbri.c | 4 +-
79 files changed, 222 insertions(+), 313 deletions(-)
delete mode 100644 arch/microblaze/include/asm/of_device.h
delete mode 100644 arch/microblaze/include/asm/of_platform.h
delete mode 100644 arch/powerpc/include/asm/of_device.h
delete mode 100644 arch/powerpc/include/asm/of_platform.h
delete mode 100644 arch/sparc/include/asm/of_device.h
delete mode 100644 arch/sparc/include/asm/of_platform.h
--
Signature
^ permalink raw reply
* [PATCH 1/5] drivercore/of: Add OF style matching to platform bus
From: Grant Likely @ 2010-07-21 23:39 UTC (permalink / raw)
To: Stephen Rothwell, Michal Simek, Benjamin Herrenschmidt,
Greg Kroah-Hartman, linux-kernel, linuxppc-dev,
microblaze-uclinux, sparclinux, David Miller
In-Reply-To: <20100721232817.7782.23410.stgit@angua>
As part of the merge between platform bus and of_platform bus, add the
ability to do of-style matching to the platform bus.
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
CC: Greg Kroah-Hartman <gregkh@suse.de>
CC: Michal Simek <monstr@monstr.eu>
CC: Grant Likely <grant.likely@secretlab.ca>
CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: Stephen Rothwell <sfr@canb.auug.org.au>
CC: linux-kernel@vger.kernel.org
CC: microblaze-uclinux@itee.uq.edu.au
CC: linuxppc-dev@ozlabs.org
CC: devicetree-discuss@lists.ozlabs.org
---
drivers/base/platform.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index 4d99c8b..6a9b3dd 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -12,6 +12,7 @@
#include <linux/string.h>
#include <linux/platform_device.h>
+#include <linux/of_device.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/dma-mapping.h>
@@ -673,6 +674,10 @@ static int platform_match(struct device *dev, struct device_driver *drv)
struct platform_device *pdev = to_platform_device(dev);
struct platform_driver *pdrv = to_platform_driver(drv);
+ /* Attempt an OF style match first */
+ if (of_driver_match_device(dev, drv))
+ return 1;
+
/* match against the id table first */
if (pdrv->id_table)
return platform_match_id(pdrv->id_table, pdev) != NULL;
^ permalink raw reply related
* [PATCH 2/5] of: Merge of_platform_bus_type with platform_bus_type
From: Grant Likely @ 2010-07-21 23:40 UTC (permalink / raw)
To: Stephen Rothwell, Michal Simek, Benjamin Herrenschmidt,
Greg Kroah-Hartman, linux-kernel, linuxppc-dev,
microblaze-uclinux, sparclinux, David Miller
In-Reply-To: <20100721232817.7782.23410.stgit@angua>
of_platform_bus was being used in the same manner as the platform_bus.
The only difference being that of_platform_bus devices are generated
from data in the device tree, and platform_bus devices are usually
statically allocated in platform code. Having them separate causes
the problem of device drivers having to be registered twice if it
was possible for the same device to appear on either bus.
This patch removes of_platform_bus_type and registers all of_platform
bus devices and drivers on the platform bus instead. A previous patch
made the of_device structure an alias for the platform_device structure,
and a shim is used to adapt of_platform_drivers to the platform bus.
After all of of_platform_bus drivers are converted to be normal platform
drivers, the shim code can be removed.
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---
arch/microblaze/kernel/of_platform.c | 11 -----
arch/microblaze/kernel/setup.c | 6 ---
arch/powerpc/kernel/dma-swiotlb.c | 8 ----
arch/powerpc/kernel/of_platform.c | 12 -----
arch/powerpc/kernel/setup-common.c | 7 ---
arch/powerpc/platforms/cell/beat_iommu.c | 2 -
arch/powerpc/platforms/cell/iommu.c | 2 -
arch/powerpc/sysdev/mv64x60_dev.c | 7 ---
arch/sparc/kernel/of_device_32.c | 21 ++-------
arch/sparc/kernel/of_device_64.c | 21 ++-------
arch/sparc/kernel/of_device_common.c | 3 -
drivers/base/platform.c | 6 +++
drivers/of/device.c | 5 ++
drivers/of/platform.c | 67 +++++++++++++++++++++++++++++-
include/linux/of_device.h | 6 +++
include/linux/of_platform.h | 21 ++++-----
16 files changed, 102 insertions(+), 103 deletions(-)
diff --git a/arch/microblaze/kernel/of_platform.c b/arch/microblaze/kernel/of_platform.c
index da79edf..fb28661 100644
--- a/arch/microblaze/kernel/of_platform.c
+++ b/arch/microblaze/kernel/of_platform.c
@@ -26,17 +26,6 @@
#include <linux/topology.h>
#include <asm/atomic.h>
-struct bus_type of_platform_bus_type = {
- .uevent = of_device_uevent,
-};
-EXPORT_SYMBOL(of_platform_bus_type);
-
-static int __init of_bus_driver_init(void)
-{
- return of_bus_type_init(&of_platform_bus_type, "of_platform");
-}
-postcore_initcall(of_bus_driver_init);
-
/*
* The list of OF IDs below is used for matching bus types in the
* system whose devices are to be exposed as of_platform_devices.
diff --git a/arch/microblaze/kernel/setup.c b/arch/microblaze/kernel/setup.c
index 17c98db..f5f7688 100644
--- a/arch/microblaze/kernel/setup.c
+++ b/arch/microblaze/kernel/setup.c
@@ -213,15 +213,9 @@ static struct notifier_block dflt_plat_bus_notifier = {
.priority = INT_MAX,
};
-static struct notifier_block dflt_of_bus_notifier = {
- .notifier_call = dflt_bus_notify,
- .priority = INT_MAX,
-};
-
static int __init setup_bus_notifier(void)
{
bus_register_notifier(&platform_bus_type, &dflt_plat_bus_notifier);
- bus_register_notifier(&of_platform_bus_type, &dflt_of_bus_notifier);
return 0;
}
diff --git a/arch/powerpc/kernel/dma-swiotlb.c b/arch/powerpc/kernel/dma-swiotlb.c
index e7fe218..c9fffd4 100644
--- a/arch/powerpc/kernel/dma-swiotlb.c
+++ b/arch/powerpc/kernel/dma-swiotlb.c
@@ -82,17 +82,9 @@ static struct notifier_block ppc_swiotlb_plat_bus_notifier = {
.priority = 0,
};
-static struct notifier_block ppc_swiotlb_of_bus_notifier = {
- .notifier_call = ppc_swiotlb_bus_notify,
- .priority = 0,
-};
-
int __init swiotlb_setup_bus_notifier(void)
{
bus_register_notifier(&platform_bus_type,
&ppc_swiotlb_plat_bus_notifier);
- bus_register_notifier(&of_platform_bus_type,
- &ppc_swiotlb_of_bus_notifier);
-
return 0;
}
diff --git a/arch/powerpc/kernel/of_platform.c b/arch/powerpc/kernel/of_platform.c
index 4e0a2f7..d3497cd 100644
--- a/arch/powerpc/kernel/of_platform.c
+++ b/arch/powerpc/kernel/of_platform.c
@@ -52,18 +52,6 @@ const struct of_device_id of_default_bus_ids[] = {
{},
};
-struct bus_type of_platform_bus_type = {
- .uevent = of_device_uevent,
-};
-EXPORT_SYMBOL(of_platform_bus_type);
-
-static int __init of_bus_driver_init(void)
-{
- return of_bus_type_init(&of_platform_bus_type, "of_platform");
-}
-
-postcore_initcall(of_bus_driver_init);
-
static int of_dev_node_match(struct device *dev, void *data)
{
return to_of_device(dev)->dev.of_node == data;
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index 5e4d852..ba6fc87 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -701,16 +701,9 @@ static struct notifier_block ppc_dflt_plat_bus_notifier = {
.priority = INT_MAX,
};
-static struct notifier_block ppc_dflt_of_bus_notifier = {
- .notifier_call = ppc_dflt_bus_notify,
- .priority = INT_MAX,
-};
-
static int __init setup_bus_notifier(void)
{
bus_register_notifier(&platform_bus_type, &ppc_dflt_plat_bus_notifier);
- bus_register_notifier(&of_platform_bus_type, &ppc_dflt_of_bus_notifier);
-
return 0;
}
diff --git a/arch/powerpc/platforms/cell/beat_iommu.c b/arch/powerpc/platforms/cell/beat_iommu.c
index 39d361c..beec405 100644
--- a/arch/powerpc/platforms/cell/beat_iommu.c
+++ b/arch/powerpc/platforms/cell/beat_iommu.c
@@ -108,7 +108,7 @@ static int __init celleb_init_iommu(void)
celleb_init_direct_mapping();
set_pci_dma_ops(&dma_direct_ops);
ppc_md.pci_dma_dev_setup = celleb_pci_dma_dev_setup;
- bus_register_notifier(&of_platform_bus_type, &celleb_of_bus_notifier);
+ bus_register_notifier(&platform_bus_type, &celleb_of_bus_notifier);
return 0;
}
diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c
index 4326b73..eb474df 100644
--- a/arch/powerpc/platforms/cell/iommu.c
+++ b/arch/powerpc/platforms/cell/iommu.c
@@ -1204,7 +1204,7 @@ static int __init cell_iommu_init(void)
/* Register callbacks on OF platform device addition/removal
* to handle linking them to the right DMA operations
*/
- bus_register_notifier(&of_platform_bus_type, &cell_of_bus_notifier);
+ bus_register_notifier(&platform_bus_type, &cell_of_bus_notifier);
return 0;
}
diff --git a/arch/powerpc/sysdev/mv64x60_dev.c b/arch/powerpc/sysdev/mv64x60_dev.c
index 31acd3b..1398bc4 100644
--- a/arch/powerpc/sysdev/mv64x60_dev.c
+++ b/arch/powerpc/sysdev/mv64x60_dev.c
@@ -20,12 +20,7 @@
#include <asm/prom.h>
-/*
- * These functions provide the necessary setup for the mv64x60 drivers.
- * These drivers are unusual in that they work on both the MIPS and PowerPC
- * architectures. Because of that, the drivers do not support the normal
- * PowerPC of_platform_bus_type. They support platform_bus_type instead.
- */
+/* These functions provide the necessary setup for the mv64x60 drivers. */
static struct of_device_id __initdata of_mv64x60_devices[] = {
{ .compatible = "marvell,mv64306-devctrl", },
diff --git a/arch/sparc/kernel/of_device_32.c b/arch/sparc/kernel/of_device_32.c
index 331de91..75fc9d5 100644
--- a/arch/sparc/kernel/of_device_32.c
+++ b/arch/sparc/kernel/of_device_32.c
@@ -424,7 +424,7 @@ build_resources:
build_device_resources(op, parent);
op->dev.parent = parent;
- op->dev.bus = &of_platform_bus_type;
+ op->dev.bus = &platform_bus_type;
if (!parent)
dev_set_name(&op->dev, "root");
else
@@ -452,30 +452,19 @@ static void __init scan_tree(struct device_node *dp, struct device *parent)
}
}
-static void __init scan_of_devices(void)
+static int __init scan_of_devices(void)
{
struct device_node *root = of_find_node_by_path("/");
struct of_device *parent;
parent = scan_one_device(root, NULL);
if (!parent)
- return;
+ return 0;
scan_tree(root->child, &parent->dev);
+ return 0;
}
-
-static int __init of_bus_driver_init(void)
-{
- int err;
-
- err = of_bus_type_init(&of_platform_bus_type, "of");
- if (!err)
- scan_of_devices();
-
- return err;
-}
-
-postcore_initcall(of_bus_driver_init);
+postcore_initcall(scan_of_devices);
static int __init of_debug(char *str)
{
diff --git a/arch/sparc/kernel/of_device_64.c b/arch/sparc/kernel/of_device_64.c
index 5e8cbb9..9743d1d 100644
--- a/arch/sparc/kernel/of_device_64.c
+++ b/arch/sparc/kernel/of_device_64.c
@@ -667,7 +667,7 @@ static struct of_device * __init scan_one_device(struct device_node *dp,
op->archdata.irqs[i] = build_one_device_irq(op, parent, op->archdata.irqs[i]);
op->dev.parent = parent;
- op->dev.bus = &of_platform_bus_type;
+ op->dev.bus = &platform_bus_type;
if (!parent)
dev_set_name(&op->dev, "root");
else
@@ -695,30 +695,19 @@ static void __init scan_tree(struct device_node *dp, struct device *parent)
}
}
-static void __init scan_of_devices(void)
+static int __init scan_of_devices(void)
{
struct device_node *root = of_find_node_by_path("/");
struct of_device *parent;
parent = scan_one_device(root, NULL);
if (!parent)
- return;
+ return 0;
scan_tree(root->child, &parent->dev);
+ return 0;
}
-
-static int __init of_bus_driver_init(void)
-{
- int err;
-
- err = of_bus_type_init(&of_platform_bus_type, "of");
- if (!err)
- scan_of_devices();
-
- return err;
-}
-
-postcore_initcall(of_bus_driver_init);
+postcore_initcall(scan_of_devices);
static int __init of_debug(char *str)
{
diff --git a/arch/sparc/kernel/of_device_common.c b/arch/sparc/kernel/of_device_common.c
index 016c947..01f380c 100644
--- a/arch/sparc/kernel/of_device_common.c
+++ b/arch/sparc/kernel/of_device_common.c
@@ -64,9 +64,6 @@ void of_propagate_archdata(struct of_device *bus)
}
}
-struct bus_type of_platform_bus_type;
-EXPORT_SYMBOL(of_platform_bus_type);
-
static void get_cells(struct device_node *dp, int *addrc, int *sizec)
{
if (addrc)
diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index 6a9b3dd..ec22578 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -636,6 +636,12 @@ static struct device_attribute platform_dev_attrs[] = {
static int platform_uevent(struct device *dev, struct kobj_uevent_env *env)
{
struct platform_device *pdev = to_platform_device(dev);
+ int rc;
+
+ /* Some devices have extra OF data and an OF-style MODALIAS */
+ rc = of_device_uevent(dev,env);
+ if (rc != -ENODEV)
+ return rc;
add_uevent_var(env, "MODALIAS=%s%s", PLATFORM_MODULE_PREFIX,
(pdev->id_entry) ? pdev->id_entry->name : pdev->name);
diff --git a/drivers/of/device.c b/drivers/of/device.c
index 5282a20..12a44b4 100644
--- a/drivers/of/device.c
+++ b/drivers/of/device.c
@@ -104,6 +104,11 @@ int of_device_register(struct of_device *ofdev)
device_initialize(&ofdev->dev);
+ /* name and id have to be set so that the platform bus doesn't get
+ * confused on matching */
+ ofdev->name = dev_name(&ofdev->dev);
+ ofdev->id = -1;
+
/* device_add will assume that this device is on the same node as
* the parent. If there is no parent defined, set the node
* explicitly */
diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index 9d3d932..712dfd8 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -20,6 +20,54 @@
#include <linux/of_device.h>
#include <linux/of_irq.h>
#include <linux/of_platform.h>
+#include <linux/platform_device.h>
+
+static int platform_driver_probe_shim(struct platform_device *pdev)
+{
+ struct platform_driver *pdrv;
+ struct of_platform_driver *ofpdrv;
+ const struct of_device_id *match;
+
+ pdrv = container_of(pdev->dev.driver, struct platform_driver, driver);
+ ofpdrv = container_of(pdrv, struct of_platform_driver, platform_driver);
+ match = of_match_device(pdev->dev.driver->of_match_table, &pdev->dev);
+ return ofpdrv->probe(pdev, match);
+}
+
+static void platform_driver_shutdown_shim(struct platform_device *pdev)
+{
+ struct platform_driver *pdrv;
+ struct of_platform_driver *ofpdrv;
+
+ pdrv = container_of(pdev->dev.driver, struct platform_driver, driver);
+ ofpdrv = container_of(pdrv, struct of_platform_driver, platform_driver);
+ ofpdrv->shutdown(pdev);
+}
+
+/**
+ * of_register_platform_driver
+ */
+int of_register_platform_driver(struct of_platform_driver *drv)
+{
+ /* setup of_platform_driver to platform_driver adaptors */
+ drv->platform_driver.driver = drv->driver;
+ if (drv->probe)
+ drv->platform_driver.probe = platform_driver_probe_shim;
+ drv->platform_driver.remove = drv->remove;
+ if (drv->shutdown)
+ drv->platform_driver.shutdown = platform_driver_shutdown_shim;
+ drv->platform_driver.suspend = drv->suspend;
+ drv->platform_driver.resume = drv->resume;
+
+ return platform_driver_register(&drv->platform_driver);
+}
+EXPORT_SYMBOL(of_register_platform_driver);
+
+void of_unregister_platform_driver(struct of_platform_driver *drv)
+{
+ platform_driver_unregister(&drv->platform_driver);
+}
+EXPORT_SYMBOL(of_unregister_platform_driver);
#if defined(CONFIG_PPC_DCR)
#include <asm/dcr.h>
@@ -392,16 +440,29 @@ int of_bus_type_init(struct bus_type *bus, const char *name)
int of_register_driver(struct of_platform_driver *drv, struct bus_type *bus)
{
- drv->driver.bus = bus;
+ /*
+ * Temporary: of_platform_bus used to be distinct from the platform
+ * bus. It isn't anymore, and so drivers on the platform bus need
+ * to be registered in a special way.
+ *
+ * After all of_platform_bus_type drivers are converted to
+ * platform_drivers, this exception can be removed.
+ */
+ if (bus == &platform_bus_type)
+ return of_register_platform_driver(drv);
/* register with core */
+ drv->driver.bus = bus;
return driver_register(&drv->driver);
}
EXPORT_SYMBOL(of_register_driver);
void of_unregister_driver(struct of_platform_driver *drv)
{
- driver_unregister(&drv->driver);
+ if (drv->driver.bus == &platform_bus_type)
+ of_unregister_platform_driver(drv);
+ else
+ driver_unregister(&drv->driver);
}
EXPORT_SYMBOL(of_unregister_driver);
@@ -548,7 +609,7 @@ struct of_device *of_platform_device_create(struct device_node *np,
dev->archdata.dma_mask = 0xffffffffUL;
#endif
dev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
- dev->dev.bus = &of_platform_bus_type;
+ dev->dev.bus = &platform_bus_type;
/* We do not fill the DMA ops for platform devices by default.
* This is currently the responsibility of the platform code
diff --git a/include/linux/of_device.h b/include/linux/of_device.h
index 7d27f5a..8cd1fe7 100644
--- a/include/linux/of_device.h
+++ b/include/linux/of_device.h
@@ -65,6 +65,12 @@ static inline int of_driver_match_device(struct device *dev,
return 0;
}
+static inline int of_device_uevent(struct device *dev,
+ struct kobj_uevent_env *env)
+{
+ return -ENODEV;
+}
+
#endif /* CONFIG_OF_DEVICE */
#endif /* _LINUX_OF_DEVICE_H */
diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h
index a51fd30..133ecf3 100644
--- a/include/linux/of_platform.h
+++ b/include/linux/of_platform.h
@@ -17,19 +17,19 @@
#include <linux/mod_devicetable.h>
#include <linux/pm.h>
#include <linux/of_device.h>
+#include <linux/platform_device.h>
/*
- * The of_platform_bus_type is a bus type used by drivers that do not
- * attach to a macio or similar bus but still use OF probing
- * mechanism
+ * of_platform_bus_type isn't it's own bus anymore. It's now just an alias
+ * for the platform bus.
*/
-extern struct bus_type of_platform_bus_type;
+#define of_platform_bus_type platform_bus_type
extern const struct of_device_id of_default_bus_ids[];
/*
* An of_platform_driver driver is attached to a basic of_device on
- * the "platform bus" (of_platform_bus_type).
+ * the "platform bus" (platform_bus_type).
*/
struct of_platform_driver
{
@@ -42,6 +42,7 @@ struct of_platform_driver
int (*shutdown)(struct of_device* dev);
struct device_driver driver;
+ struct platform_driver platform_driver;
};
#define to_of_platform_driver(drv) \
container_of(drv,struct of_platform_driver, driver)
@@ -51,14 +52,8 @@ extern int of_register_driver(struct of_platform_driver *drv,
extern void of_unregister_driver(struct of_platform_driver *drv);
/* Platform drivers register/unregister */
-static inline int of_register_platform_driver(struct of_platform_driver *drv)
-{
- return of_register_driver(drv, &of_platform_bus_type);
-}
-static inline void of_unregister_platform_driver(struct of_platform_driver *drv)
-{
- of_unregister_driver(drv);
-}
+extern int of_register_platform_driver(struct of_platform_driver *drv);
+extern void of_unregister_platform_driver(struct of_platform_driver *drv);
extern struct of_device *of_device_alloc(struct device_node *np,
const char *bus_id,
^ permalink raw reply related
* [PATCH 3/5] of/platform: remove all of_bus_type and of_platform_bus_type references
From: Grant Likely @ 2010-07-21 23:40 UTC (permalink / raw)
To: Stephen Rothwell, Michal Simek, Benjamin Herrenschmidt,
Greg Kroah-Hartman, linux-kernel, linuxppc-dev,
microblaze-uclinux, sparclinux, David Miller
In-Reply-To: <20100721232817.7782.23410.stgit@angua>
Both of_bus_type and of_platform_bus_type are just #define aliases
for the platform bus. This patch removes all references to them and
switches to the of_register_platform_driver()/of_unregister_platform_driver()
API for registering.
Subsequent patches will convert each user of of_register_platform_driver()
into plain platform_drivers without the of_platform_driver shim. At which
point the of_register_platform_driver()/of_unregister_platform_driver()
functions can be removed.
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---
arch/microblaze/kernel/of_platform.c | 3 +--
arch/powerpc/kernel/of_platform.c | 3 +--
arch/sparc/include/asm/of_platform.h | 2 --
arch/sparc/include/asm/parport.h | 4 +---
arch/sparc/kernel/apc.c | 2 +-
arch/sparc/kernel/auxio_64.c | 2 +-
arch/sparc/kernel/central.c | 4 ++--
arch/sparc/kernel/chmc.c | 4 ++--
arch/sparc/kernel/of_device_common.c | 2 +-
arch/sparc/kernel/pci_fire.c | 2 +-
arch/sparc/kernel/pci_psycho.c | 2 +-
arch/sparc/kernel/pci_sabre.c | 2 +-
arch/sparc/kernel/pci_schizo.c | 2 +-
arch/sparc/kernel/pci_sun4v.c | 2 +-
arch/sparc/kernel/pmc.c | 2 +-
arch/sparc/kernel/power.c | 2 +-
arch/sparc/kernel/time_32.c | 2 +-
arch/sparc/kernel/time_64.c | 6 +++---
drivers/atm/fore200e.c | 6 +++---
drivers/char/hw_random/n2-drv.c | 4 ++--
drivers/crypto/n2_core.c | 10 +++++-----
drivers/hwmon/ultra45_env.c | 4 ++--
drivers/input/misc/sparcspkr.c | 12 +++++-------
drivers/input/serio/i8042-sparcio.h | 5 ++---
drivers/mtd/maps/sun_uflash.c | 4 ++--
drivers/net/ibm_newemac/core.c | 4 ++--
drivers/net/myri_sbus.c | 4 ++--
drivers/net/niu.c | 6 +++---
drivers/net/sunbmac.c | 4 ++--
drivers/net/sunhme.c | 4 ++--
drivers/net/sunlance.c | 4 ++--
drivers/net/sunqe.c | 4 ++--
drivers/parport/parport_sunbpp.c | 4 ++--
drivers/sbus/char/bbc_i2c.c | 4 ++--
drivers/sbus/char/display7seg.c | 4 ++--
drivers/sbus/char/envctrl.c | 4 ++--
drivers/sbus/char/flash.c | 4 ++--
drivers/sbus/char/uctrl.c | 4 ++--
drivers/scsi/qlogicpti.c | 4 ++--
drivers/scsi/sun_esp.c | 4 ++--
drivers/serial/sunhv.c | 4 ++--
drivers/serial/sunsab.c | 4 ++--
drivers/serial/sunsu.c | 2 +-
drivers/serial/sunzilog.c | 6 +++---
drivers/video/bw2.c | 4 ++--
drivers/video/cg14.c | 4 ++--
drivers/video/cg3.c | 4 ++--
drivers/video/cg6.c | 4 ++--
drivers/video/ffb.c | 4 ++--
drivers/video/leo.c | 4 ++--
drivers/video/p9100.c | 4 ++--
drivers/video/sunxvr1000.c | 4 ++--
drivers/video/tcx.c | 4 ++--
drivers/watchdog/cpwd.c | 4 ++--
drivers/watchdog/riowd.c | 4 ++--
include/linux/of_platform.h | 6 ------
sound/sparc/amd7930.c | 4 ++--
sound/sparc/cs4231.c | 4 ++--
sound/sparc/dbri.c | 4 ++--
59 files changed, 109 insertions(+), 124 deletions(-)
diff --git a/arch/microblaze/kernel/of_platform.c b/arch/microblaze/kernel/of_platform.c
index fb28661..80c9c49 100644
--- a/arch/microblaze/kernel/of_platform.c
+++ b/arch/microblaze/kernel/of_platform.c
@@ -57,8 +57,7 @@ struct of_device *of_find_device_by_node(struct device_node *np)
{
struct device *dev;
- dev = bus_find_device(&of_platform_bus_type,
- NULL, np, of_dev_node_match);
+ dev = bus_find_device(&platform_bus_type, NULL, np, of_dev_node_match);
if (dev)
return to_of_device(dev);
return NULL;
diff --git a/arch/powerpc/kernel/of_platform.c b/arch/powerpc/kernel/of_platform.c
index d3497cd..b093d4b 100644
--- a/arch/powerpc/kernel/of_platform.c
+++ b/arch/powerpc/kernel/of_platform.c
@@ -61,8 +61,7 @@ struct of_device *of_find_device_by_node(struct device_node *np)
{
struct device *dev;
- dev = bus_find_device(&of_platform_bus_type,
- NULL, np, of_dev_node_match);
+ dev = bus_find_device(&platform_bus_type, NULL, np, of_dev_node_match);
if (dev)
return to_of_device(dev);
return NULL;
diff --git a/arch/sparc/include/asm/of_platform.h b/arch/sparc/include/asm/of_platform.h
index 90da990..26540dd 100644
--- a/arch/sparc/include/asm/of_platform.h
+++ b/arch/sparc/include/asm/of_platform.h
@@ -13,6 +13,4 @@
*
*/
-#define of_bus_type of_platform_bus_type /* for compatibility */
-
#endif
diff --git a/arch/sparc/include/asm/parport.h b/arch/sparc/include/asm/parport.h
index 0c34a87..4891fbc 100644
--- a/arch/sparc/include/asm/parport.h
+++ b/arch/sparc/include/asm/parport.h
@@ -243,9 +243,7 @@ static struct of_platform_driver ecpp_driver = {
static int parport_pc_find_nonpci_ports(int autoirq, int autodma)
{
- of_register_driver(&ecpp_driver, &of_bus_type);
-
- return 0;
+ return of_register_platform_driver(&ecpp_driver);
}
#endif /* !(_ASM_SPARC64_PARPORT_H */
diff --git a/arch/sparc/kernel/apc.c b/arch/sparc/kernel/apc.c
index b27476c..c471251 100644
--- a/arch/sparc/kernel/apc.c
+++ b/arch/sparc/kernel/apc.c
@@ -184,7 +184,7 @@ static struct of_platform_driver apc_driver = {
static int __init apc_init(void)
{
- return of_register_driver(&apc_driver, &of_bus_type);
+ return of_register_platform_driver(&apc_driver);
}
/* This driver is not critical to the boot process
diff --git a/arch/sparc/kernel/auxio_64.c b/arch/sparc/kernel/auxio_64.c
index ddc8412..46ba58a 100644
--- a/arch/sparc/kernel/auxio_64.c
+++ b/arch/sparc/kernel/auxio_64.c
@@ -142,7 +142,7 @@ static struct of_platform_driver auxio_driver = {
static int __init auxio_init(void)
{
- return of_register_driver(&auxio_driver, &of_platform_bus_type);
+ return of_register_platform_driver(&auxio_driver);
}
/* Must be after subsys_initcall() so that busses are probed. Must
diff --git a/arch/sparc/kernel/central.c b/arch/sparc/kernel/central.c
index 434335f..b6080c3 100644
--- a/arch/sparc/kernel/central.c
+++ b/arch/sparc/kernel/central.c
@@ -265,8 +265,8 @@ static struct of_platform_driver fhc_driver = {
static int __init sunfire_init(void)
{
- (void) of_register_driver(&fhc_driver, &of_platform_bus_type);
- (void) of_register_driver(&clock_board_driver, &of_platform_bus_type);
+ (void) of_register_platform_driver(&fhc_driver);
+ (void) of_register_platform_driver(&clock_board_driver);
return 0;
}
diff --git a/arch/sparc/kernel/chmc.c b/arch/sparc/kernel/chmc.c
index 870cb65..04bb7df 100644
--- a/arch/sparc/kernel/chmc.c
+++ b/arch/sparc/kernel/chmc.c
@@ -848,7 +848,7 @@ static int __init us3mc_init(void)
ret = register_dimm_printer(us3mc_dimm_printer);
if (!ret) {
- ret = of_register_driver(&us3mc_driver, &of_bus_type);
+ ret = of_register_platform_driver(&us3mc_driver);
if (ret)
unregister_dimm_printer(us3mc_dimm_printer);
}
@@ -859,7 +859,7 @@ static void __exit us3mc_cleanup(void)
{
if (us3mc_platform()) {
unregister_dimm_printer(us3mc_dimm_printer);
- of_unregister_driver(&us3mc_driver);
+ of_unregister_platform_driver(&us3mc_driver);
}
}
diff --git a/arch/sparc/kernel/of_device_common.c b/arch/sparc/kernel/of_device_common.c
index 01f380c..2a5c639 100644
--- a/arch/sparc/kernel/of_device_common.c
+++ b/arch/sparc/kernel/of_device_common.c
@@ -21,7 +21,7 @@ static int node_match(struct device *dev, void *data)
struct of_device *of_find_device_by_node(struct device_node *dp)
{
- struct device *dev = bus_find_device(&of_platform_bus_type, NULL,
+ struct device *dev = bus_find_device(&platform_bus_type, NULL,
dp, node_match);
if (dev)
diff --git a/arch/sparc/kernel/pci_fire.c b/arch/sparc/kernel/pci_fire.c
index 51cfa09..885f10b 100644
--- a/arch/sparc/kernel/pci_fire.c
+++ b/arch/sparc/kernel/pci_fire.c
@@ -518,7 +518,7 @@ static struct of_platform_driver fire_driver = {
static int __init fire_init(void)
{
- return of_register_driver(&fire_driver, &of_bus_type);
+ return of_register_platform_driver(&fire_driver);
}
subsys_initcall(fire_init);
diff --git a/arch/sparc/kernel/pci_psycho.c b/arch/sparc/kernel/pci_psycho.c
index 93011e6..71550a7 100644
--- a/arch/sparc/kernel/pci_psycho.c
+++ b/arch/sparc/kernel/pci_psycho.c
@@ -612,7 +612,7 @@ static struct of_platform_driver psycho_driver = {
static int __init psycho_init(void)
{
- return of_register_driver(&psycho_driver, &of_bus_type);
+ return of_register_platform_driver(&psycho_driver);
}
subsys_initcall(psycho_init);
diff --git a/arch/sparc/kernel/pci_sabre.c b/arch/sparc/kernel/pci_sabre.c
index 99c6dba..2d7bf30 100644
--- a/arch/sparc/kernel/pci_sabre.c
+++ b/arch/sparc/kernel/pci_sabre.c
@@ -606,7 +606,7 @@ static struct of_platform_driver sabre_driver = {
static int __init sabre_init(void)
{
- return of_register_driver(&sabre_driver, &of_bus_type);
+ return of_register_platform_driver(&sabre_driver);
}
subsys_initcall(sabre_init);
diff --git a/arch/sparc/kernel/pci_schizo.c b/arch/sparc/kernel/pci_schizo.c
index 9041dae..04f29c4 100644
--- a/arch/sparc/kernel/pci_schizo.c
+++ b/arch/sparc/kernel/pci_schizo.c
@@ -1501,7 +1501,7 @@ static struct of_platform_driver schizo_driver = {
static int __init schizo_init(void)
{
- return of_register_driver(&schizo_driver, &of_bus_type);
+ return of_register_platform_driver(&schizo_driver);
}
subsys_initcall(schizo_init);
diff --git a/arch/sparc/kernel/pci_sun4v.c b/arch/sparc/kernel/pci_sun4v.c
index a24af6f..18ee8b6 100644
--- a/arch/sparc/kernel/pci_sun4v.c
+++ b/arch/sparc/kernel/pci_sun4v.c
@@ -1019,7 +1019,7 @@ static struct of_platform_driver pci_sun4v_driver = {
static int __init pci_sun4v_init(void)
{
- return of_register_driver(&pci_sun4v_driver, &of_bus_type);
+ return of_register_platform_driver(&pci_sun4v_driver);
}
subsys_initcall(pci_sun4v_init);
diff --git a/arch/sparc/kernel/pmc.c b/arch/sparc/kernel/pmc.c
index 9589d8b..a4c73ed 100644
--- a/arch/sparc/kernel/pmc.c
+++ b/arch/sparc/kernel/pmc.c
@@ -89,7 +89,7 @@ static struct of_platform_driver pmc_driver = {
static int __init pmc_init(void)
{
- return of_register_driver(&pmc_driver, &of_bus_type);
+ return of_register_platform_driver(&pmc_driver);
}
/* This driver is not critical to the boot process
diff --git a/arch/sparc/kernel/power.c b/arch/sparc/kernel/power.c
index 1cfee57..abc194e 100644
--- a/arch/sparc/kernel/power.c
+++ b/arch/sparc/kernel/power.c
@@ -70,7 +70,7 @@ static struct of_platform_driver power_driver = {
static int __init power_init(void)
{
- return of_register_driver(&power_driver, &of_platform_bus_type);
+ return of_register_platform_driver(&power_driver);
}
device_initcall(power_init);
diff --git a/arch/sparc/kernel/time_32.c b/arch/sparc/kernel/time_32.c
index e404b06..5dc2021 100644
--- a/arch/sparc/kernel/time_32.c
+++ b/arch/sparc/kernel/time_32.c
@@ -189,7 +189,7 @@ static struct of_platform_driver clock_driver = {
/* Probe for the mostek real time clock chip. */
static int __init clock_init(void)
{
- return of_register_driver(&clock_driver, &of_platform_bus_type);
+ return of_register_platform_driver(&clock_driver);
}
/* Must be after subsys_initcall() so that busses are probed. Must
* be before device_initcall() because things like the RTC driver
diff --git a/arch/sparc/kernel/time_64.c b/arch/sparc/kernel/time_64.c
index 21e9fca..2423b33 100644
--- a/arch/sparc/kernel/time_64.c
+++ b/arch/sparc/kernel/time_64.c
@@ -586,9 +586,9 @@ static int __init clock_init(void)
if (tlb_type == hypervisor)
return platform_device_register(&rtc_sun4v_device);
- (void) of_register_driver(&rtc_driver, &of_platform_bus_type);
- (void) of_register_driver(&mostek_driver, &of_platform_bus_type);
- (void) of_register_driver(&bq4802_driver, &of_platform_bus_type);
+ (void) of_register_platform_driver(&rtc_driver);
+ (void) of_register_platform_driver(&mostek_driver);
+ (void) of_register_platform_driver(&bq4802_driver);
return 0;
}
diff --git a/drivers/atm/fore200e.c b/drivers/atm/fore200e.c
index 38df87b..b7385e0 100644
--- a/drivers/atm/fore200e.c
+++ b/drivers/atm/fore200e.c
@@ -2795,7 +2795,7 @@ static int __init fore200e_module_init(void)
printk(FORE200E "FORE Systems 200E-series ATM driver - version " FORE200E_VERSION "\n");
#ifdef CONFIG_SBUS
- err = of_register_driver(&fore200e_sba_driver, &of_bus_type);
+ err = of_register_platform_driver(&fore200e_sba_driver);
if (err)
return err;
#endif
@@ -2806,7 +2806,7 @@ static int __init fore200e_module_init(void)
#ifdef CONFIG_SBUS
if (err)
- of_unregister_driver(&fore200e_sba_driver);
+ of_unregister_platform_driver(&fore200e_sba_driver);
#endif
return err;
@@ -2818,7 +2818,7 @@ static void __exit fore200e_module_cleanup(void)
pci_unregister_driver(&fore200e_pca_driver);
#endif
#ifdef CONFIG_SBUS
- of_unregister_driver(&fore200e_sba_driver);
+ of_unregister_platform_driver(&fore200e_sba_driver);
#endif
}
diff --git a/drivers/char/hw_random/n2-drv.c b/drivers/char/hw_random/n2-drv.c
index 0f9cbf1..d8a4ca8 100644
--- a/drivers/char/hw_random/n2-drv.c
+++ b/drivers/char/hw_random/n2-drv.c
@@ -762,12 +762,12 @@ static struct of_platform_driver n2rng_driver = {
static int __init n2rng_init(void)
{
- return of_register_driver(&n2rng_driver, &of_bus_type);
+ return of_register_platform_driver(&n2rng_driver);
}
static void __exit n2rng_exit(void)
{
- of_unregister_driver(&n2rng_driver);
+ of_unregister_platform_driver(&n2rng_driver);
}
module_init(n2rng_init);
diff --git a/drivers/crypto/n2_core.c b/drivers/crypto/n2_core.c
index 23163fd..34ac8ac 100644
--- a/drivers/crypto/n2_core.c
+++ b/drivers/crypto/n2_core.c
@@ -2070,20 +2070,20 @@ static struct of_platform_driver n2_mau_driver = {
static int __init n2_init(void)
{
- int err = of_register_driver(&n2_crypto_driver, &of_bus_type);
+ int err = of_register_platform_driver(&n2_crypto_driver);
if (!err) {
- err = of_register_driver(&n2_mau_driver, &of_bus_type);
+ err = of_register_platform_driver(&n2_mau_driver);
if (err)
- of_unregister_driver(&n2_crypto_driver);
+ of_unregister_platform_driver(&n2_crypto_driver);
}
return err;
}
static void __exit n2_exit(void)
{
- of_unregister_driver(&n2_mau_driver);
- of_unregister_driver(&n2_crypto_driver);
+ of_unregister_platform_driver(&n2_mau_driver);
+ of_unregister_platform_driver(&n2_crypto_driver);
}
module_init(n2_init);
diff --git a/drivers/hwmon/ultra45_env.c b/drivers/hwmon/ultra45_env.c
index 5da5942..8964326 100644
--- a/drivers/hwmon/ultra45_env.c
+++ b/drivers/hwmon/ultra45_env.c
@@ -311,12 +311,12 @@ static struct of_platform_driver env_driver = {
static int __init env_init(void)
{
- return of_register_driver(&env_driver, &of_bus_type);
+ return of_register_platform_driver(&env_driver);
}
static void __exit env_exit(void)
{
- of_unregister_driver(&env_driver);
+ of_unregister_platform_driver(&env_driver);
}
module_init(env_init);
diff --git a/drivers/input/misc/sparcspkr.c b/drivers/input/misc/sparcspkr.c
index 1dacae4..f3bb92e 100644
--- a/drivers/input/misc/sparcspkr.c
+++ b/drivers/input/misc/sparcspkr.c
@@ -353,14 +353,12 @@ static struct of_platform_driver grover_beep_driver = {
static int __init sparcspkr_init(void)
{
- int err = of_register_driver(&bbc_beep_driver,
- &of_platform_bus_type);
+ int err = of_register_platform_driver(&bbc_beep_driver);
if (!err) {
- err = of_register_driver(&grover_beep_driver,
- &of_platform_bus_type);
+ err = of_register_platform_driver(&grover_beep_driver);
if (err)
- of_unregister_driver(&bbc_beep_driver);
+ of_unregister_platform_driver(&bbc_beep_driver);
}
return err;
@@ -368,8 +366,8 @@ static int __init sparcspkr_init(void)
static void __exit sparcspkr_exit(void)
{
- of_unregister_driver(&bbc_beep_driver);
- of_unregister_driver(&grover_beep_driver);
+ of_unregister_platform_driver(&bbc_beep_driver);
+ of_unregister_platform_driver(&grover_beep_driver);
}
module_init(sparcspkr_init);
diff --git a/drivers/input/serio/i8042-sparcio.h b/drivers/input/serio/i8042-sparcio.h
index c7d50ff..cb2a24b 100644
--- a/drivers/input/serio/i8042-sparcio.h
+++ b/drivers/input/serio/i8042-sparcio.h
@@ -116,8 +116,7 @@ static int __init i8042_platform_init(void)
if (!kbd_iobase)
return -ENODEV;
} else {
- int err = of_register_driver(&sparc_i8042_driver,
- &of_bus_type);
+ int err = of_register_platform_driver(&sparc_i8042_driver);
if (err)
return err;
@@ -141,7 +140,7 @@ static inline void i8042_platform_exit(void)
struct device_node *root = of_find_node_by_path("/");
if (strcmp(root->name, "SUNW,JavaStation-1"))
- of_unregister_driver(&sparc_i8042_driver);
+ of_unregister_platform_driver(&sparc_i8042_driver);
}
#else /* !CONFIG_PCI */
diff --git a/drivers/mtd/maps/sun_uflash.c b/drivers/mtd/maps/sun_uflash.c
index 0391c25..8984236 100644
--- a/drivers/mtd/maps/sun_uflash.c
+++ b/drivers/mtd/maps/sun_uflash.c
@@ -160,12 +160,12 @@ static struct of_platform_driver uflash_driver = {
static int __init uflash_init(void)
{
- return of_register_driver(&uflash_driver, &of_bus_type);
+ return of_register_platform_driver(&uflash_driver);
}
static void __exit uflash_exit(void)
{
- of_unregister_driver(&uflash_driver);
+ of_unregister_platform_driver(&uflash_driver);
}
module_init(uflash_init);
diff --git a/drivers/net/ibm_newemac/core.c b/drivers/net/ibm_newemac/core.c
index b150c10..f10476f 100644
--- a/drivers/net/ibm_newemac/core.c
+++ b/drivers/net/ibm_newemac/core.c
@@ -2339,11 +2339,11 @@ static int __devinit emac_wait_deps(struct emac_instance *dev)
deps[EMAC_DEP_MDIO_IDX].phandle = dev->mdio_ph;
if (dev->blist && dev->blist > emac_boot_list)
deps[EMAC_DEP_PREV_IDX].phandle = 0xffffffffu;
- bus_register_notifier(&of_platform_bus_type, &emac_of_bus_notifier);
+ bus_register_notifier(&platform_bus_type, &emac_of_bus_notifier);
wait_event_timeout(emac_probe_wait,
emac_check_deps(dev, deps),
EMAC_PROBE_DEP_TIMEOUT);
- bus_unregister_notifier(&of_platform_bus_type, &emac_of_bus_notifier);
+ bus_unregister_notifier(&platform_bus_type, &emac_of_bus_notifier);
err = emac_check_deps(dev, deps) ? 0 : -ENODEV;
for (i = 0; i < EMAC_DEP_COUNT; i++) {
if (deps[i].node)
diff --git a/drivers/net/myri_sbus.c b/drivers/net/myri_sbus.c
index 370d3c1..04e552a 100644
--- a/drivers/net/myri_sbus.c
+++ b/drivers/net/myri_sbus.c
@@ -1172,12 +1172,12 @@ static struct of_platform_driver myri_sbus_driver = {
static int __init myri_sbus_init(void)
{
- return of_register_driver(&myri_sbus_driver, &of_bus_type);
+ return of_register_platform_driver(&myri_sbus_driver);
}
static void __exit myri_sbus_exit(void)
{
- of_unregister_driver(&myri_sbus_driver);
+ of_unregister_platform_driver(&myri_sbus_driver);
}
module_init(myri_sbus_init);
diff --git a/drivers/net/niu.c b/drivers/net/niu.c
index f6ecf61..8cb2b30 100644
--- a/drivers/net/niu.c
+++ b/drivers/net/niu.c
@@ -10251,14 +10251,14 @@ static int __init niu_init(void)
niu_debug = netif_msg_init(debug, NIU_MSG_DEFAULT);
#ifdef CONFIG_SPARC64
- err = of_register_driver(&niu_of_driver, &of_bus_type);
+ err = of_register_platform_driver(&niu_of_driver);
#endif
if (!err) {
err = pci_register_driver(&niu_pci_driver);
#ifdef CONFIG_SPARC64
if (err)
- of_unregister_driver(&niu_of_driver);
+ of_unregister_platform_driver(&niu_of_driver);
#endif
}
@@ -10269,7 +10269,7 @@ static void __exit niu_exit(void)
{
pci_unregister_driver(&niu_pci_driver);
#ifdef CONFIG_SPARC64
- of_unregister_driver(&niu_of_driver);
+ of_unregister_platform_driver(&niu_of_driver);
#endif
}
diff --git a/drivers/net/sunbmac.c b/drivers/net/sunbmac.c
index 0b10d24..09c071b 100644
--- a/drivers/net/sunbmac.c
+++ b/drivers/net/sunbmac.c
@@ -1301,12 +1301,12 @@ static struct of_platform_driver bigmac_sbus_driver = {
static int __init bigmac_init(void)
{
- return of_register_driver(&bigmac_sbus_driver, &of_bus_type);
+ return of_register_platform_driver(&bigmac_sbus_driver);
}
static void __exit bigmac_exit(void)
{
- of_unregister_driver(&bigmac_sbus_driver);
+ of_unregister_platform_driver(&bigmac_sbus_driver);
}
module_init(bigmac_init);
diff --git a/drivers/net/sunhme.c b/drivers/net/sunhme.c
index 0a63ebe..eec443f 100644
--- a/drivers/net/sunhme.c
+++ b/drivers/net/sunhme.c
@@ -3304,7 +3304,7 @@ static int __init happy_meal_sbus_init(void)
{
int err;
- err = of_register_driver(&hme_sbus_driver, &of_bus_type);
+ err = of_register_platform_driver(&hme_sbus_driver);
if (!err)
err = quattro_sbus_register_irqs();
@@ -3313,7 +3313,7 @@ static int __init happy_meal_sbus_init(void)
static void happy_meal_sbus_exit(void)
{
- of_unregister_driver(&hme_sbus_driver);
+ of_unregister_platform_driver(&hme_sbus_driver);
quattro_sbus_free_irqs();
while (qfe_sbus_list) {
diff --git a/drivers/net/sunlance.c b/drivers/net/sunlance.c
index c6bfdad..ee364fa 100644
--- a/drivers/net/sunlance.c
+++ b/drivers/net/sunlance.c
@@ -1558,12 +1558,12 @@ static struct of_platform_driver sunlance_sbus_driver = {
/* Find all the lance cards on the system and initialize them */
static int __init sparc_lance_init(void)
{
- return of_register_driver(&sunlance_sbus_driver, &of_bus_type);
+ return of_register_platform_driver(&sunlance_sbus_driver);
}
static void __exit sparc_lance_exit(void)
{
- of_unregister_driver(&sunlance_sbus_driver);
+ of_unregister_platform_driver(&sunlance_sbus_driver);
}
module_init(sparc_lance_init);
diff --git a/drivers/net/sunqe.c b/drivers/net/sunqe.c
index 4465174..5f84a5d 100644
--- a/drivers/net/sunqe.c
+++ b/drivers/net/sunqe.c
@@ -988,12 +988,12 @@ static struct of_platform_driver qec_sbus_driver = {
static int __init qec_init(void)
{
- return of_register_driver(&qec_sbus_driver, &of_bus_type);
+ return of_register_platform_driver(&qec_sbus_driver);
}
static void __exit qec_exit(void)
{
- of_unregister_driver(&qec_sbus_driver);
+ of_unregister_platform_driver(&qec_sbus_driver);
while (root_qec_dev) {
struct sunqec *next = root_qec_dev->next_module;
diff --git a/drivers/parport/parport_sunbpp.c b/drivers/parport/parport_sunbpp.c
index 3cdfe96..210a644 100644
--- a/drivers/parport/parport_sunbpp.c
+++ b/drivers/parport/parport_sunbpp.c
@@ -393,12 +393,12 @@ static struct of_platform_driver bpp_sbus_driver = {
static int __init parport_sunbpp_init(void)
{
- return of_register_driver(&bpp_sbus_driver, &of_bus_type);
+ return of_register_platform_driver(&bpp_sbus_driver);
}
static void __exit parport_sunbpp_exit(void)
{
- of_unregister_driver(&bpp_sbus_driver);
+ of_unregister_platform_driver(&bpp_sbus_driver);
}
MODULE_AUTHOR("Derrick J Brashear");
diff --git a/drivers/sbus/char/bbc_i2c.c b/drivers/sbus/char/bbc_i2c.c
index 40d7a1f..3e89c31 100644
--- a/drivers/sbus/char/bbc_i2c.c
+++ b/drivers/sbus/char/bbc_i2c.c
@@ -425,12 +425,12 @@ static struct of_platform_driver bbc_i2c_driver = {
static int __init bbc_i2c_init(void)
{
- return of_register_driver(&bbc_i2c_driver, &of_bus_type);
+ return of_register_platform_driver(&bbc_i2c_driver);
}
static void __exit bbc_i2c_exit(void)
{
- of_unregister_driver(&bbc_i2c_driver);
+ of_unregister_platform_driver(&bbc_i2c_driver);
}
module_init(bbc_i2c_init);
diff --git a/drivers/sbus/char/display7seg.c b/drivers/sbus/char/display7seg.c
index 7baf1b6..8fd362e 100644
--- a/drivers/sbus/char/display7seg.c
+++ b/drivers/sbus/char/display7seg.c
@@ -277,12 +277,12 @@ static struct of_platform_driver d7s_driver = {
static int __init d7s_init(void)
{
- return of_register_driver(&d7s_driver, &of_bus_type);
+ return of_register_platform_driver(&d7s_driver);
}
static void __exit d7s_exit(void)
{
- of_unregister_driver(&d7s_driver);
+ of_unregister_platform_driver(&d7s_driver);
}
module_init(d7s_init);
diff --git a/drivers/sbus/char/envctrl.c b/drivers/sbus/char/envctrl.c
index c8166ec..2c76f70 100644
--- a/drivers/sbus/char/envctrl.c
+++ b/drivers/sbus/char/envctrl.c
@@ -1142,12 +1142,12 @@ static struct of_platform_driver envctrl_driver = {
static int __init envctrl_init(void)
{
- return of_register_driver(&envctrl_driver, &of_bus_type);
+ return of_register_platform_driver(&envctrl_driver);
}
static void __exit envctrl_exit(void)
{
- of_unregister_driver(&envctrl_driver);
+ of_unregister_platform_driver(&envctrl_driver);
}
module_init(envctrl_init);
diff --git a/drivers/sbus/char/flash.c b/drivers/sbus/char/flash.c
index 368d662..d79f386 100644
--- a/drivers/sbus/char/flash.c
+++ b/drivers/sbus/char/flash.c
@@ -218,12 +218,12 @@ static struct of_platform_driver flash_driver = {
static int __init flash_init(void)
{
- return of_register_driver(&flash_driver, &of_bus_type);
+ return of_register_platform_driver(&flash_driver);
}
static void __exit flash_cleanup(void)
{
- of_unregister_driver(&flash_driver);
+ of_unregister_platform_driver(&flash_driver);
}
module_init(flash_init);
diff --git a/drivers/sbus/char/uctrl.c b/drivers/sbus/char/uctrl.c
index b8b40e9..57f0612 100644
--- a/drivers/sbus/char/uctrl.c
+++ b/drivers/sbus/char/uctrl.c
@@ -437,12 +437,12 @@ static struct of_platform_driver uctrl_driver = {
static int __init uctrl_init(void)
{
- return of_register_driver(&uctrl_driver, &of_bus_type);
+ return of_register_platform_driver(&uctrl_driver);
}
static void __exit uctrl_exit(void)
{
- of_unregister_driver(&uctrl_driver);
+ of_unregister_platform_driver(&uctrl_driver);
}
module_init(uctrl_init);
diff --git a/drivers/scsi/qlogicpti.c b/drivers/scsi/qlogicpti.c
index 3f5b541..53d7ed0 100644
--- a/drivers/scsi/qlogicpti.c
+++ b/drivers/scsi/qlogicpti.c
@@ -1467,12 +1467,12 @@ static struct of_platform_driver qpti_sbus_driver = {
static int __init qpti_init(void)
{
- return of_register_driver(&qpti_sbus_driver, &of_bus_type);
+ return of_register_platform_driver(&qpti_sbus_driver);
}
static void __exit qpti_exit(void)
{
- of_unregister_driver(&qpti_sbus_driver);
+ of_unregister_platform_driver(&qpti_sbus_driver);
}
MODULE_DESCRIPTION("QlogicISP SBUS driver");
diff --git a/drivers/scsi/sun_esp.c b/drivers/scsi/sun_esp.c
index ddc221a..89ba6fe 100644
--- a/drivers/scsi/sun_esp.c
+++ b/drivers/scsi/sun_esp.c
@@ -644,12 +644,12 @@ static struct of_platform_driver esp_sbus_driver = {
static int __init sunesp_init(void)
{
- return of_register_driver(&esp_sbus_driver, &of_bus_type);
+ return of_register_platform_driver(&esp_sbus_driver);
}
static void __exit sunesp_exit(void)
{
- of_unregister_driver(&esp_sbus_driver);
+ of_unregister_platform_driver(&esp_sbus_driver);
}
MODULE_DESCRIPTION("Sun ESP SCSI driver");
diff --git a/drivers/serial/sunhv.c b/drivers/serial/sunhv.c
index 36e2448..a779e22 100644
--- a/drivers/serial/sunhv.c
+++ b/drivers/serial/sunhv.c
@@ -644,12 +644,12 @@ static int __init sunhv_init(void)
if (tlb_type != hypervisor)
return -ENODEV;
- return of_register_driver(&hv_driver, &of_bus_type);
+ return of_register_platform_driver(&hv_driver);
}
static void __exit sunhv_exit(void)
{
- of_unregister_driver(&hv_driver);
+ of_unregister_platform_driver(&hv_driver);
}
module_init(sunhv_init);
diff --git a/drivers/serial/sunsab.c b/drivers/serial/sunsab.c
index 0a7dd68..9845fb1 100644
--- a/drivers/serial/sunsab.c
+++ b/drivers/serial/sunsab.c
@@ -1130,12 +1130,12 @@ static int __init sunsab_init(void)
}
}
- return of_register_driver(&sab_driver, &of_bus_type);
+ return of_register_platform_driver(&sab_driver);
}
static void __exit sunsab_exit(void)
{
- of_unregister_driver(&sab_driver);
+ of_unregister_platform_driver(&sab_driver);
if (sunsab_reg.nr) {
sunserial_unregister_minors(&sunsab_reg, sunsab_reg.nr);
}
diff --git a/drivers/serial/sunsu.c b/drivers/serial/sunsu.c
index 56d891a..c2bcd15 100644
--- a/drivers/serial/sunsu.c
+++ b/drivers/serial/sunsu.c
@@ -1581,7 +1581,7 @@ static int __init sunsu_init(void)
return err;
}
- err = of_register_driver(&su_driver, &of_bus_type);
+ err = of_register_platform_driver(&su_driver);
if (err && num_uart)
sunserial_unregister_minors(&sunsu_reg, num_uart);
diff --git a/drivers/serial/sunzilog.c b/drivers/serial/sunzilog.c
index fcbe20d..d1e6bcb 100644
--- a/drivers/serial/sunzilog.c
+++ b/drivers/serial/sunzilog.c
@@ -1576,7 +1576,7 @@ static int __init sunzilog_init(void)
goto out_free_tables;
}
- err = of_register_driver(&zs_driver, &of_bus_type);
+ err = of_register_platform_driver(&zs_driver);
if (err)
goto out_unregister_uart;
@@ -1604,7 +1604,7 @@ out:
return err;
out_unregister_driver:
- of_unregister_driver(&zs_driver);
+ of_unregister_platform_driver(&zs_driver);
out_unregister_uart:
if (num_sunzilog) {
@@ -1619,7 +1619,7 @@ out_free_tables:
static void __exit sunzilog_exit(void)
{
- of_unregister_driver(&zs_driver);
+ of_unregister_platform_driver(&zs_driver);
if (zilog_irq != -1) {
struct uart_sunzilog_port *up = sunzilog_irq_chain;
diff --git a/drivers/video/bw2.c b/drivers/video/bw2.c
index 09f1b9b..c779663 100644
--- a/drivers/video/bw2.c
+++ b/drivers/video/bw2.c
@@ -390,12 +390,12 @@ static int __init bw2_init(void)
if (fb_get_options("bw2fb", NULL))
return -ENODEV;
- return of_register_driver(&bw2_driver, &of_bus_type);
+ return of_register_platform_driver(&bw2_driver);
}
static void __exit bw2_exit(void)
{
- of_unregister_driver(&bw2_driver);
+ of_unregister_platform_driver(&bw2_driver);
}
module_init(bw2_init);
diff --git a/drivers/video/cg14.c b/drivers/video/cg14.c
index e5dc224..d09fde8 100644
--- a/drivers/video/cg14.c
+++ b/drivers/video/cg14.c
@@ -610,12 +610,12 @@ static int __init cg14_init(void)
if (fb_get_options("cg14fb", NULL))
return -ENODEV;
- return of_register_driver(&cg14_driver, &of_bus_type);
+ return of_register_platform_driver(&cg14_driver);
}
static void __exit cg14_exit(void)
{
- of_unregister_driver(&cg14_driver);
+ of_unregister_platform_driver(&cg14_driver);
}
module_init(cg14_init);
diff --git a/drivers/video/cg3.c b/drivers/video/cg3.c
index 558d73a..64aa298 100644
--- a/drivers/video/cg3.c
+++ b/drivers/video/cg3.c
@@ -477,12 +477,12 @@ static int __init cg3_init(void)
if (fb_get_options("cg3fb", NULL))
return -ENODEV;
- return of_register_driver(&cg3_driver, &of_bus_type);
+ return of_register_platform_driver(&cg3_driver);
}
static void __exit cg3_exit(void)
{
- of_unregister_driver(&cg3_driver);
+ of_unregister_platform_driver(&cg3_driver);
}
module_init(cg3_init);
diff --git a/drivers/video/cg6.c b/drivers/video/cg6.c
index 480d761..2389a71 100644
--- a/drivers/video/cg6.c
+++ b/drivers/video/cg6.c
@@ -870,12 +870,12 @@ static int __init cg6_init(void)
if (fb_get_options("cg6fb", NULL))
return -ENODEV;
- return of_register_driver(&cg6_driver, &of_bus_type);
+ return of_register_platform_driver(&cg6_driver);
}
static void __exit cg6_exit(void)
{
- of_unregister_driver(&cg6_driver);
+ of_unregister_platform_driver(&cg6_driver);
}
module_init(cg6_init);
diff --git a/drivers/video/ffb.c b/drivers/video/ffb.c
index 95c0227..f6ecfab 100644
--- a/drivers/video/ffb.c
+++ b/drivers/video/ffb.c
@@ -1067,12 +1067,12 @@ static int __init ffb_init(void)
if (fb_get_options("ffb", NULL))
return -ENODEV;
- return of_register_driver(&ffb_driver, &of_bus_type);
+ return of_register_platform_driver(&ffb_driver);
}
static void __exit ffb_exit(void)
{
- of_unregister_driver(&ffb_driver);
+ of_unregister_platform_driver(&ffb_driver);
}
module_init(ffb_init);
diff --git a/drivers/video/leo.c b/drivers/video/leo.c
index 9e8bf7d..ad67763 100644
--- a/drivers/video/leo.c
+++ b/drivers/video/leo.c
@@ -677,12 +677,12 @@ static int __init leo_init(void)
if (fb_get_options("leofb", NULL))
return -ENODEV;
- return of_register_driver(&leo_driver, &of_bus_type);
+ return of_register_platform_driver(&leo_driver);
}
static void __exit leo_exit(void)
{
- of_unregister_driver(&leo_driver);
+ of_unregister_platform_driver(&leo_driver);
}
module_init(leo_init);
diff --git a/drivers/video/p9100.c b/drivers/video/p9100.c
index 6552751..688b055 100644
--- a/drivers/video/p9100.c
+++ b/drivers/video/p9100.c
@@ -367,12 +367,12 @@ static int __init p9100_init(void)
if (fb_get_options("p9100fb", NULL))
return -ENODEV;
- return of_register_driver(&p9100_driver, &of_bus_type);
+ return of_register_platform_driver(&p9100_driver);
}
static void __exit p9100_exit(void)
{
- of_unregister_driver(&p9100_driver);
+ of_unregister_platform_driver(&p9100_driver);
}
module_init(p9100_init);
diff --git a/drivers/video/sunxvr1000.c b/drivers/video/sunxvr1000.c
index 489b44e..7288934 100644
--- a/drivers/video/sunxvr1000.c
+++ b/drivers/video/sunxvr1000.c
@@ -213,12 +213,12 @@ static int __init gfb_init(void)
if (fb_get_options("gfb", NULL))
return -ENODEV;
- return of_register_driver(&gfb_driver, &of_bus_type);
+ return of_register_platform_driver(&gfb_driver);
}
static void __exit gfb_exit(void)
{
- of_unregister_driver(&gfb_driver);
+ of_unregister_platform_driver(&gfb_driver);
}
module_init(gfb_init);
diff --git a/drivers/video/tcx.c b/drivers/video/tcx.c
index cc039b3..f375e0d 100644
--- a/drivers/video/tcx.c
+++ b/drivers/video/tcx.c
@@ -526,12 +526,12 @@ static int __init tcx_init(void)
if (fb_get_options("tcxfb", NULL))
return -ENODEV;
- return of_register_driver(&tcx_driver, &of_bus_type);
+ return of_register_platform_driver(&tcx_driver);
}
static void __exit tcx_exit(void)
{
- of_unregister_driver(&tcx_driver);
+ of_unregister_platform_driver(&tcx_driver);
}
module_init(tcx_init);
diff --git a/drivers/watchdog/cpwd.c b/drivers/watchdog/cpwd.c
index 8c03fd7..30a2512 100644
--- a/drivers/watchdog/cpwd.c
+++ b/drivers/watchdog/cpwd.c
@@ -688,12 +688,12 @@ static struct of_platform_driver cpwd_driver = {
static int __init cpwd_init(void)
{
- return of_register_driver(&cpwd_driver, &of_bus_type);
+ return of_register_platform_driver(&cpwd_driver);
}
static void __exit cpwd_exit(void)
{
- of_unregister_driver(&cpwd_driver);
+ of_unregister_platform_driver(&cpwd_driver);
}
module_init(cpwd_init);
diff --git a/drivers/watchdog/riowd.c b/drivers/watchdog/riowd.c
index 5dceedd..4082b4a 100644
--- a/drivers/watchdog/riowd.c
+++ b/drivers/watchdog/riowd.c
@@ -250,12 +250,12 @@ static struct of_platform_driver riowd_driver = {
static int __init riowd_init(void)
{
- return of_register_driver(&riowd_driver, &of_bus_type);
+ return of_register_platform_driver(&riowd_driver);
}
static void __exit riowd_exit(void)
{
- of_unregister_driver(&riowd_driver);
+ of_unregister_platform_driver(&riowd_driver);
}
module_init(riowd_init);
diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h
index 133ecf3..429513a 100644
--- a/include/linux/of_platform.h
+++ b/include/linux/of_platform.h
@@ -19,12 +19,6 @@
#include <linux/of_device.h>
#include <linux/platform_device.h>
-/*
- * of_platform_bus_type isn't it's own bus anymore. It's now just an alias
- * for the platform bus.
- */
-#define of_platform_bus_type platform_bus_type
-
extern const struct of_device_id of_default_bus_ids[];
/*
diff --git a/sound/sparc/amd7930.c b/sound/sparc/amd7930.c
index 43c63d4..9eb1a4e 100644
--- a/sound/sparc/amd7930.c
+++ b/sound/sparc/amd7930.c
@@ -1075,7 +1075,7 @@ static struct of_platform_driver amd7930_sbus_driver = {
static int __init amd7930_init(void)
{
- return of_register_driver(&amd7930_sbus_driver, &of_bus_type);
+ return of_register_platform_driver(&amd7930_sbus_driver);
}
static void __exit amd7930_exit(void)
@@ -1092,7 +1092,7 @@ static void __exit amd7930_exit(void)
amd7930_list = NULL;
- of_unregister_driver(&amd7930_sbus_driver);
+ of_unregister_platform_driver(&amd7930_sbus_driver);
}
module_init(amd7930_init);
diff --git a/sound/sparc/cs4231.c b/sound/sparc/cs4231.c
index f7f05c2..68570ee 100644
--- a/sound/sparc/cs4231.c
+++ b/sound/sparc/cs4231.c
@@ -2120,12 +2120,12 @@ static struct of_platform_driver cs4231_driver = {
static int __init cs4231_init(void)
{
- return of_register_driver(&cs4231_driver, &of_bus_type);
+ return of_register_platform_driver(&cs4231_driver);
}
static void __exit cs4231_exit(void)
{
- of_unregister_driver(&cs4231_driver);
+ of_unregister_platform_driver(&cs4231_driver);
}
module_init(cs4231_init);
diff --git a/sound/sparc/dbri.c b/sound/sparc/dbri.c
index 491ce71..c421901 100644
--- a/sound/sparc/dbri.c
+++ b/sound/sparc/dbri.c
@@ -2699,12 +2699,12 @@ static struct of_platform_driver dbri_sbus_driver = {
/* Probe for the dbri chip and then attach the driver. */
static int __init dbri_init(void)
{
- return of_register_driver(&dbri_sbus_driver, &of_bus_type);
+ return of_register_platform_driver(&dbri_sbus_driver);
}
static void __exit dbri_exit(void)
{
- of_unregister_driver(&dbri_sbus_driver);
+ of_unregister_platform_driver(&dbri_sbus_driver);
}
module_init(dbri_init);
^ permalink raw reply related
* [PATCH 4/5] of: remove asm/of_platform.h
From: Grant Likely @ 2010-07-21 23:40 UTC (permalink / raw)
To: Stephen Rothwell, Michal Simek, Benjamin Herrenschmidt,
Greg Kroah-Hartman, linux-kernel, linuxppc-dev,
microblaze-uclinux, sparclinux, David Miller
In-Reply-To: <20100721232817.7782.23410.stgit@angua>
Only thing left in it is of_instantiate_rtc() which can be moved to
asm/prom.h on PowerPC and is unused in microblaze.
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---
arch/microblaze/include/asm/of_platform.h | 19 -------------------
arch/powerpc/include/asm/of_platform.h | 16 ----------------
arch/powerpc/include/asm/prom.h | 2 ++
arch/sparc/include/asm/of_platform.h | 16 ----------------
include/linux/of_platform.h | 2 --
5 files changed, 2 insertions(+), 53 deletions(-)
delete mode 100644 arch/microblaze/include/asm/of_platform.h
delete mode 100644 arch/powerpc/include/asm/of_platform.h
delete mode 100644 arch/sparc/include/asm/of_platform.h
diff --git a/arch/microblaze/include/asm/of_platform.h b/arch/microblaze/include/asm/of_platform.h
deleted file mode 100644
index 353d8f6..0000000
--- a/arch/microblaze/include/asm/of_platform.h
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright (C) 2006 Benjamin Herrenschmidt, IBM Corp.
- * <benh@kernel.crashing.org>
- *
- * 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.
- */
-
-#ifndef _ASM_MICROBLAZE_OF_PLATFORM_H
-#define _ASM_MICROBLAZE_OF_PLATFORM_H
-
-/* This is just here during the transition */
-#include <linux/of_platform.h>
-
-extern void of_instantiate_rtc(void);
-
-#endif /* _ASM_MICROBLAZE_OF_PLATFORM_H */
diff --git a/arch/powerpc/include/asm/of_platform.h b/arch/powerpc/include/asm/of_platform.h
deleted file mode 100644
index d506aa6..0000000
--- a/arch/powerpc/include/asm/of_platform.h
+++ /dev/null
@@ -1,16 +0,0 @@
-#ifndef _ASM_POWERPC_OF_PLATFORM_H
-#define _ASM_POWERPC_OF_PLATFORM_H
-/*
- * Copyright (C) 2006 Benjamin Herrenschmidt, IBM Corp.
- * <benh@kernel.crashing.org>
- *
- * 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.
- *
- */
-
-extern void of_instantiate_rtc(void);
-
-#endif /* _ASM_POWERPC_OF_PLATFORM_H */
diff --git a/arch/powerpc/include/asm/prom.h b/arch/powerpc/include/asm/prom.h
index f864722..da7dd63 100644
--- a/arch/powerpc/include/asm/prom.h
+++ b/arch/powerpc/include/asm/prom.h
@@ -117,5 +117,7 @@ extern const void *of_get_mac_address(struct device_node *np);
struct pci_dev;
extern int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq);
+extern void of_instantiate_rtc(void);
+
#endif /* __KERNEL__ */
#endif /* _POWERPC_PROM_H */
diff --git a/arch/sparc/include/asm/of_platform.h b/arch/sparc/include/asm/of_platform.h
deleted file mode 100644
index 26540dd..0000000
--- a/arch/sparc/include/asm/of_platform.h
+++ /dev/null
@@ -1,16 +0,0 @@
-#ifndef ___ASM_SPARC_OF_PLATFORM_H
-#define ___ASM_SPARC_OF_PLATFORM_H
-/*
- * Copyright (C) 2006 Benjamin Herrenschmidt, IBM Corp.
- * <benh@kernel.crashing.org>
- * Modified for Sparc by merging parts of asm/of_device.h
- * by Stephen Rothwell
- *
- * 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.
- *
- */
-
-#endif
diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h
index 429513a..a79f59b 100644
--- a/include/linux/of_platform.h
+++ b/include/linux/of_platform.h
@@ -52,8 +52,6 @@ extern void of_unregister_platform_driver(struct of_platform_driver *drv);
extern struct of_device *of_device_alloc(struct device_node *np,
const char *bus_id,
struct device *parent);
-#include <asm/of_platform.h>
-
extern struct of_device *of_find_device_by_node(struct device_node *np);
extern int of_bus_type_init(struct bus_type *bus, const char *name);
^ permalink raw reply related
* [PATCH 5/5] of: remove asm/of_device.h
From: Grant Likely @ 2010-07-21 23:40 UTC (permalink / raw)
To: Stephen Rothwell, Michal Simek, Benjamin Herrenschmidt,
Greg Kroah-Hartman, linux-kernel, linuxppc-dev,
microblaze-uclinux, sparclinux, David Miller
In-Reply-To: <20100721232817.7782.23410.stgit@angua>
It is mostly unused now. Sparc has a few defines left in it, but they
can be moved to other headers. Removing this header means that new
architectures adding CONFIG_OF support don't need to also add this
header file.
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---
arch/microblaze/include/asm/of_device.h | 13 -------------
arch/powerpc/include/asm/of_device.h | 3 ---
arch/sparc/include/asm/device.h | 2 ++
arch/sparc/include/asm/of_device.h | 19 -------------------
arch/sparc/include/asm/prom.h | 4 ++++
include/linux/of_device.h | 2 +-
6 files changed, 7 insertions(+), 36 deletions(-)
delete mode 100644 arch/microblaze/include/asm/of_device.h
delete mode 100644 arch/powerpc/include/asm/of_device.h
delete mode 100644 arch/sparc/include/asm/of_device.h
diff --git a/arch/microblaze/include/asm/of_device.h b/arch/microblaze/include/asm/of_device.h
deleted file mode 100644
index 47e8d42..0000000
--- a/arch/microblaze/include/asm/of_device.h
+++ /dev/null
@@ -1,13 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Michal Simek <monstr@monstr.eu>
- *
- * based on PowerPC of_device.h
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License. See the file "COPYING" in the main directory of this archive
- * for more details.
- */
-
-#ifndef _ASM_MICROBLAZE_OF_DEVICE_H
-#define _ASM_MICROBLAZE_OF_DEVICE_H
-#endif /* _ASM_MICROBLAZE_OF_DEVICE_H */
diff --git a/arch/powerpc/include/asm/of_device.h b/arch/powerpc/include/asm/of_device.h
deleted file mode 100644
index 04f7671..0000000
--- a/arch/powerpc/include/asm/of_device.h
+++ /dev/null
@@ -1,3 +0,0 @@
-#ifndef _ASM_POWERPC_OF_DEVICE_H
-#define _ASM_POWERPC_OF_DEVICE_H
-#endif /* _ASM_POWERPC_OF_DEVICE_H */
diff --git a/arch/sparc/include/asm/device.h b/arch/sparc/include/asm/device.h
index fb220e4..daa6a8a 100644
--- a/arch/sparc/include/asm/device.h
+++ b/arch/sparc/include/asm/device.h
@@ -19,6 +19,8 @@ struct dev_archdata {
int numa_node;
};
+extern void of_propagate_archdata(struct platform_device *bus);
+
struct pdev_archdata {
struct resource resource[PROMREG_MAX];
unsigned int irqs[PROMINTR_MAX];
diff --git a/arch/sparc/include/asm/of_device.h b/arch/sparc/include/asm/of_device.h
deleted file mode 100644
index 22b9828..0000000
--- a/arch/sparc/include/asm/of_device.h
+++ /dev/null
@@ -1,19 +0,0 @@
-#ifndef _ASM_SPARC_OF_DEVICE_H
-#define _ASM_SPARC_OF_DEVICE_H
-#ifdef __KERNEL__
-
-#include <linux/device.h>
-#include <linux/of.h>
-#include <linux/mod_devicetable.h>
-#include <asm/openprom.h>
-
-extern void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name);
-extern void of_iounmap(struct resource *res, void __iomem *base, unsigned long size);
-
-extern void of_propagate_archdata(struct of_device *bus);
-
-/* This is just here during the transition */
-#include <linux/of_platform.h>
-
-#endif /* __KERNEL__ */
-#endif /* _ASM_SPARC_OF_DEVICE_H */
diff --git a/arch/sparc/include/asm/prom.h b/arch/sparc/include/asm/prom.h
index ac69574..d35df5a 100644
--- a/arch/sparc/include/asm/prom.h
+++ b/arch/sparc/include/asm/prom.h
@@ -51,6 +51,10 @@ extern void prom_build_devicetree(void);
extern void of_populate_present_mask(void);
extern void of_fill_in_cpu_data(void);
+struct resource;
+extern void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name);
+extern void of_iounmap(struct resource *res, void __iomem *base, unsigned long size);
+
/* These routines are here to provide compatibility with how powerpc
* handles IRQ mapping for OF device nodes. We precompute and permanently
* register them in the of_device objects, whereas powerpc computes them
diff --git a/include/linux/of_device.h b/include/linux/of_device.h
index 8cd1fe7..0f19119 100644
--- a/include/linux/of_device.h
+++ b/include/linux/of_device.h
@@ -16,12 +16,12 @@
*/
#define of_device platform_device
#include <linux/platform_device.h>
+#include <linux/of_platform.h> /* temporary until merge */
#ifdef CONFIG_OF_DEVICE
#include <linux/device.h>
#include <linux/of.h>
#include <linux/mod_devicetable.h>
-#include <asm/of_device.h>
#define to_of_device(d) container_of(d, struct of_device, dev)
^ permalink raw reply related
* [PATCH 1/2] MPC85xx: add definitions for PCI error detection soc part
From: Dmitry Eremin-Solenikov @ 2010-07-22 0:03 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Doug Thompson, Dave Jiang, bluesmoke-devel
Add definitions for PCI error detection device to be handled by (already
existing) mpc85xx_edac.c driver.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
arch/powerpc/boot/dts/mpc8536ds.dts | 7 +++++++
arch/powerpc/boot/dts/mpc8536ds_36b.dts | 7 +++++++
arch/powerpc/boot/dts/mpc8540ads.dts | 8 ++++++++
arch/powerpc/boot/dts/mpc8541cds.dts | 14 ++++++++++++++
arch/powerpc/boot/dts/mpc8544ds.dts | 7 +++++++
arch/powerpc/boot/dts/mpc8548cds.dts | 14 ++++++++++++++
arch/powerpc/boot/dts/mpc8555cds.dts | 14 ++++++++++++++
arch/powerpc/boot/dts/mpc8560ads.dts | 7 +++++++
arch/powerpc/boot/dts/mpc8568mds.dts | 7 +++++++
arch/powerpc/boot/dts/sbc8548.dts | 7 +++++++
arch/powerpc/boot/dts/sbc8560.dts | 7 +++++++
arch/powerpc/boot/dts/socrates.dts | 7 +++++++
arch/powerpc/boot/dts/stx_gp3_8560.dts | 7 +++++++
arch/powerpc/boot/dts/tqm8540.dts | 10 ++++++++++
arch/powerpc/boot/dts/tqm8541.dts | 7 +++++++
arch/powerpc/boot/dts/tqm8548-bigflash.dts | 7 +++++++
arch/powerpc/boot/dts/tqm8548.dts | 7 +++++++
arch/powerpc/boot/dts/tqm8555.dts | 7 +++++++
arch/powerpc/boot/dts/tqm8560.dts | 7 +++++++
arch/powerpc/boot/dts/xpedite5200.dts | 7 +++++++
arch/powerpc/boot/dts/xpedite5200_xmon.dts | 7 +++++++
21 files changed, 172 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/boot/dts/mpc8536ds.dts b/arch/powerpc/boot/dts/mpc8536ds.dts
index 815cebb..6c02e5a 100644
--- a/arch/powerpc/boot/dts/mpc8536ds.dts
+++ b/arch/powerpc/boot/dts/mpc8536ds.dts
@@ -278,6 +278,13 @@
interrupt-parent = <&mpic>;
};
+ pci-error@8e00 {
+ compatible = "fsl,mpc8536-pci-error";
+ reg = <0x8e00 0x100>;
+ interrupt-parent = <&mpic>;
+ interrupts = <24 2>;
+ };
+
crypto@30000 {
compatible = "fsl,sec3.0", "fsl,sec2.4", "fsl,sec2.2",
"fsl,sec2.1", "fsl,sec2.0";
diff --git a/arch/powerpc/boot/dts/mpc8536ds_36b.dts b/arch/powerpc/boot/dts/mpc8536ds_36b.dts
index d95b260..89ef5c1 100644
--- a/arch/powerpc/boot/dts/mpc8536ds_36b.dts
+++ b/arch/powerpc/boot/dts/mpc8536ds_36b.dts
@@ -278,6 +278,13 @@
interrupt-parent = <&mpic>;
};
+ pci-error@8e00 {
+ compatible = "fsl,mpc8536-pci-error";
+ reg = <0x8e00 0x100>;
+ interrupt-parent = <&mpic>;
+ interrupts = <24 2>;
+ };
+
crypto@30000 {
compatible = "fsl,sec3.0", "fsl,sec2.4", "fsl,sec2.2",
"fsl,sec2.1", "fsl,sec2.0";
diff --git a/arch/powerpc/boot/dts/mpc8540ads.dts b/arch/powerpc/boot/dts/mpc8540ads.dts
index 9dc2929..d89f470 100644
--- a/arch/powerpc/boot/dts/mpc8540ads.dts
+++ b/arch/powerpc/boot/dts/mpc8540ads.dts
@@ -259,6 +259,14 @@
interrupts = <42 2>;
interrupt-parent = <&mpic>;
};
+
+ pci-error@8e00 {
+ compatible = "fsl,mpc8540-pci-error";
+ reg = <0x8e00 0x100>;
+ interrupt-parent = <&mpic>;
+ interrupts = <24 2>;
+ };
+
mpic: pic@40000 {
interrupt-controller;
#address-cells = <0>;
diff --git a/arch/powerpc/boot/dts/mpc8541cds.dts b/arch/powerpc/boot/dts/mpc8541cds.dts
index 9a3ad31..c2c5732 100644
--- a/arch/powerpc/boot/dts/mpc8541cds.dts
+++ b/arch/powerpc/boot/dts/mpc8541cds.dts
@@ -226,6 +226,20 @@
interrupt-parent = <&mpic>;
};
+ pci-error@8e00 {
+ compatible = "fsl,mpc8541-pci-error";
+ reg = <0x8e00 0x100>;
+ interrupt-parent = <&mpic>;
+ interrupts = <24 2>;
+ };
+
+ pci-error@9e00 {
+ compatible = "fsl,mpc8541-pci-error";
+ reg = <0x9e00 0x100>;
+ interrupt-parent = <&mpic>;
+ interrupts = <25 2>;
+ };
+
crypto@30000 {
compatible = "fsl,sec2.0";
reg = <0x30000 0x10000>;
diff --git a/arch/powerpc/boot/dts/mpc8544ds.dts b/arch/powerpc/boot/dts/mpc8544ds.dts
index 98e94b4..387da1f 100644
--- a/arch/powerpc/boot/dts/mpc8544ds.dts
+++ b/arch/powerpc/boot/dts/mpc8544ds.dts
@@ -242,6 +242,13 @@
interrupt-parent = <&mpic>;
};
+ pci-error@8e00 {
+ compatible = "fsl,mpc8544-pci-error";
+ reg = <0x8e00 0x100>;
+ interrupt-parent = <&mpic>;
+ interrupts = <24 2>;
+ };
+
global-utilities@e0000 { //global utilities block
compatible = "fsl,mpc8548-guts";
reg = <0xe0000 0x1000>;
diff --git a/arch/powerpc/boot/dts/mpc8548cds.dts b/arch/powerpc/boot/dts/mpc8548cds.dts
index 0f52624..973966e 100644
--- a/arch/powerpc/boot/dts/mpc8548cds.dts
+++ b/arch/powerpc/boot/dts/mpc8548cds.dts
@@ -328,6 +328,20 @@
interrupt-parent = <&mpic>;
};
+ pci-error@8e00 {
+ compatible = "fsl,mpc8548-pci-error";
+ reg = <0x8e00 0x100>;
+ interrupt-parent = <&mpic>;
+ interrupts = <24 2>;
+ };
+
+ pci-error@9e00 {
+ compatible = "fsl,mpc8548-pci-error";
+ reg = <0x9e00 0x100>;
+ interrupt-parent = <&mpic>;
+ interrupts = <25 2>;
+ };
+
global-utilities@e0000 { //global utilities reg
compatible = "fsl,mpc8548-guts";
reg = <0xe0000 0x1000>;
diff --git a/arch/powerpc/boot/dts/mpc8555cds.dts b/arch/powerpc/boot/dts/mpc8555cds.dts
index 065b2f0..bcdc344 100644
--- a/arch/powerpc/boot/dts/mpc8555cds.dts
+++ b/arch/powerpc/boot/dts/mpc8555cds.dts
@@ -226,6 +226,20 @@
interrupt-parent = <&mpic>;
};
+ pci-error@8e00 {
+ compatible = "fsl,mpc8555-pci-error";
+ reg = <0x8e00 0x100>;
+ interrupt-parent = <&mpic>;
+ interrupts = <24 2>;
+ };
+
+ pci-error@9e00 {
+ compatible = "fsl,mpc8555-pci-error";
+ reg = <0x9e00 0x100>;
+ interrupt-parent = <&mpic>;
+ interrupts = <25 2>;
+ };
+
crypto@30000 {
compatible = "fsl,sec2.0";
reg = <0x30000 0x10000>;
diff --git a/arch/powerpc/boot/dts/mpc8560ads.dts b/arch/powerpc/boot/dts/mpc8560ads.dts
index a5bb1ec..04bc095 100644
--- a/arch/powerpc/boot/dts/mpc8560ads.dts
+++ b/arch/powerpc/boot/dts/mpc8560ads.dts
@@ -216,6 +216,13 @@
device_type = "open-pic";
};
+ pci-error@8e00 {
+ compatible = "fsl,mpc8560-pci-error";
+ reg = <0x8e00 0x100>;
+ interrupt-parent = <&mpic>;
+ interrupts = <24 2>;
+ };
+
cpm@919c0 {
#address-cells = <1>;
#size-cells = <1>;
diff --git a/arch/powerpc/boot/dts/mpc8568mds.dts b/arch/powerpc/boot/dts/mpc8568mds.dts
index 92fb178..66af3ab 100644
--- a/arch/powerpc/boot/dts/mpc8568mds.dts
+++ b/arch/powerpc/boot/dts/mpc8568mds.dts
@@ -329,6 +329,13 @@
};
};
+ pci-error@8e00 {
+ compatible = "fsl,mpc8568-pci-error";
+ reg = <0x8e00 0x100>;
+ interrupt-parent = <&mpic>;
+ interrupts = <24 2>;
+ };
+
global-utilities@e0000 {
#address-cells = <1>;
#size-cells = <1>;
diff --git a/arch/powerpc/boot/dts/sbc8548.dts b/arch/powerpc/boot/dts/sbc8548.dts
index 94a3322..002428c 100644
--- a/arch/powerpc/boot/dts/sbc8548.dts
+++ b/arch/powerpc/boot/dts/sbc8548.dts
@@ -333,6 +333,13 @@
interrupt-parent = <&mpic>;
};
+ pci-error@8e00 {
+ compatible = "fsl,mpc8548-pci-error";
+ reg = <0x8e00 0x100>;
+ interrupt-parent = <&mpic>;
+ interrupts = <24 2>;
+ };
+
global-utilities@e0000 { //global utilities reg
compatible = "fsl,mpc8548-guts";
reg = <0xe0000 0x1000>;
diff --git a/arch/powerpc/boot/dts/sbc8560.dts b/arch/powerpc/boot/dts/sbc8560.dts
index 9e13ed8..1dc389a 100644
--- a/arch/powerpc/boot/dts/sbc8560.dts
+++ b/arch/powerpc/boot/dts/sbc8560.dts
@@ -239,6 +239,13 @@
device_type = "open-pic";
};
+ pci-error@8e00 {
+ compatible = "fsl,mpc8560-pci-error";
+ reg = <0x8e00 0x100>;
+ interrupt-parent = <&mpic>;
+ interrupts = <24 2>;
+ };
+
cpm@919c0 {
#address-cells = <1>;
#size-cells = <1>;
diff --git a/arch/powerpc/boot/dts/socrates.dts b/arch/powerpc/boot/dts/socrates.dts
index feb4ef6..06b08f5 100644
--- a/arch/powerpc/boot/dts/socrates.dts
+++ b/arch/powerpc/boot/dts/socrates.dts
@@ -216,6 +216,13 @@
interrupt-parent = <&mpic>;
};
+ pci-error@8e00 {
+ compatible = "fsl,mpc8544-pci-error";
+ reg = <0x8e00 0x100>;
+ interrupt-parent = <&mpic>;
+ interrupts = <24 2>;
+ };
+
global-utilities@e0000 { //global utilities block
compatible = "fsl,mpc8548-guts";
reg = <0xe0000 0x1000>;
diff --git a/arch/powerpc/boot/dts/stx_gp3_8560.dts b/arch/powerpc/boot/dts/stx_gp3_8560.dts
index b670d03..78e9e22 100644
--- a/arch/powerpc/boot/dts/stx_gp3_8560.dts
+++ b/arch/powerpc/boot/dts/stx_gp3_8560.dts
@@ -213,6 +213,13 @@
device_type = "open-pic";
};
+ pci-error@8e00 {
+ compatible = "fsl,mpc8560-pci-error";
+ reg = <0x8e00 0x100>;
+ interrupt-parent = <&mpic>;
+ interrupts = <24 2>;
+ };
+
cpm@919c0 {
#address-cells = <1>;
#size-cells = <1>;
diff --git a/arch/powerpc/boot/dts/tqm8540.dts b/arch/powerpc/boot/dts/tqm8540.dts
index b5c0940..3e73e35 100644
--- a/arch/powerpc/boot/dts/tqm8540.dts
+++ b/arch/powerpc/boot/dts/tqm8540.dts
@@ -160,6 +160,7 @@
local-mac-address = [ 00 00 00 00 00 00 ];
interrupts = <29 2 30 2 34 2>;
interrupt-parent = <&mpic>;
+ tbi-handle = <&tbi0>;
phy-handle = <&phy2>;
mdio@520 {
@@ -205,6 +206,7 @@
local-mac-address = [ 00 00 00 00 00 00 ];
interrupts = <35 2 36 2 40 2>;
interrupt-parent = <&mpic>;
+ tbi-handle = <&tbi1>;
phy-handle = <&phy1>;
mdio@520 {
@@ -232,6 +234,7 @@
local-mac-address = [ 00 00 00 00 00 00 ];
interrupts = <41 2>;
interrupt-parent = <&mpic>;
+ tbi-handle = <&tbi2>;
phy-handle = <&phy3>;
mdio@520 {
@@ -276,6 +279,13 @@
device_type = "open-pic";
compatible = "chrp,open-pic";
};
+
+ pci-error@8e00 {
+ compatible = "fsl,mpc8540-pci-error";
+ reg = <0x8e00 0x100>;
+ interrupt-parent = <&mpic>;
+ interrupts = <24 2>;
+ };
};
pci0: pci@e0008000 {
diff --git a/arch/powerpc/boot/dts/tqm8541.dts b/arch/powerpc/boot/dts/tqm8541.dts
index f49d091..92106fc 100644
--- a/arch/powerpc/boot/dts/tqm8541.dts
+++ b/arch/powerpc/boot/dts/tqm8541.dts
@@ -261,6 +261,13 @@
compatible = "chrp,open-pic";
};
+ pci-error@8e00 {
+ compatible = "fsl,mpc8541-pci-error";
+ reg = <0x8e00 0x100>;
+ interrupt-parent = <&mpic>;
+ interrupts = <24 2>;
+ };
+
cpm@919c0 {
#address-cells = <1>;
#size-cells = <1>;
diff --git a/arch/powerpc/boot/dts/tqm8548-bigflash.dts b/arch/powerpc/boot/dts/tqm8548-bigflash.dts
index 5dbb36e..b1944a1 100644
--- a/arch/powerpc/boot/dts/tqm8548-bigflash.dts
+++ b/arch/powerpc/boot/dts/tqm8548-bigflash.dts
@@ -338,6 +338,13 @@
compatible = "chrp,open-pic";
device_type = "open-pic";
};
+
+ pci-error@8e00 {
+ compatible = "fsl,mpc8548-pci-error";
+ reg = <0x8e00 0x100>;
+ interrupt-parent = <&mpic>;
+ interrupts = <24 2>;
+ };
};
localbus@a0005000 {
diff --git a/arch/powerpc/boot/dts/tqm8548.dts b/arch/powerpc/boot/dts/tqm8548.dts
index a050ae4..be2b1de 100644
--- a/arch/powerpc/boot/dts/tqm8548.dts
+++ b/arch/powerpc/boot/dts/tqm8548.dts
@@ -338,6 +338,13 @@
compatible = "chrp,open-pic";
device_type = "open-pic";
};
+
+ pci-error@8e00 {
+ compatible = "fsl,mpc8548-pci-error";
+ reg = <0x8e00 0x100>;
+ interrupt-parent = <&mpic>;
+ interrupts = <24 2>;
+ };
};
localbus@e0005000 {
diff --git a/arch/powerpc/boot/dts/tqm8555.dts b/arch/powerpc/boot/dts/tqm8555.dts
index 81bad8c..7b64c71 100644
--- a/arch/powerpc/boot/dts/tqm8555.dts
+++ b/arch/powerpc/boot/dts/tqm8555.dts
@@ -261,6 +261,13 @@
compatible = "chrp,open-pic";
};
+ pci-error@8e00 {
+ compatible = "fsl,mpc8555-pci-error";
+ reg = <0x8e00 0x100>;
+ interrupt-parent = <&mpic>;
+ interrupts = <24 2>;
+ };
+
cpm@919c0 {
#address-cells = <1>;
#size-cells = <1>;
diff --git a/arch/powerpc/boot/dts/tqm8560.dts b/arch/powerpc/boot/dts/tqm8560.dts
index 22ec39b..82408d5 100644
--- a/arch/powerpc/boot/dts/tqm8560.dts
+++ b/arch/powerpc/boot/dts/tqm8560.dts
@@ -232,6 +232,13 @@
compatible = "chrp,open-pic";
};
+ pci-error@8e00 {
+ compatible = "fsl,mpc8560-pci-error";
+ reg = <0x8e00 0x100>;
+ interrupt-parent = <&mpic>;
+ interrupts = <24 2>;
+ };
+
cpm@919c0 {
#address-cells = <1>;
#size-cells = <1>;
diff --git a/arch/powerpc/boot/dts/xpedite5200.dts b/arch/powerpc/boot/dts/xpedite5200.dts
index a0cf53f..211dbbf 100644
--- a/arch/powerpc/boot/dts/xpedite5200.dts
+++ b/arch/powerpc/boot/dts/xpedite5200.dts
@@ -352,6 +352,13 @@
interrupt-parent = <&mpic>;
};
+ pci-error@8e00 {
+ compatible = "fsl,mpc8548-pci-error";
+ reg = <0x8e00 0x100>;
+ interrupt-parent = <&mpic>;
+ interrupts = <24 2>;
+ };
+
global-utilities@e0000 { // global utilities reg
compatible = "fsl,mpc8548-guts";
reg = <0xe0000 0x1000>;
diff --git a/arch/powerpc/boot/dts/xpedite5200_xmon.dts b/arch/powerpc/boot/dts/xpedite5200_xmon.dts
index c5b2975..ebe9365 100644
--- a/arch/powerpc/boot/dts/xpedite5200_xmon.dts
+++ b/arch/powerpc/boot/dts/xpedite5200_xmon.dts
@@ -356,6 +356,13 @@
interrupt-parent = <&mpic>;
};
+ pci-error@8e00 {
+ compatible = "fsl,mpc8548-pci-error";
+ reg = <0x8e00 0x100>;
+ interrupt-parent = <&mpic>;
+ interrupts = <24 2>;
+ };
+
global-utilities@e0000 { // global utilities reg
compatible = "fsl,mpc8548-guts";
reg = <0xe0000 0x1000>;
--
1.7.1
^ permalink raw reply related
* [PATCH 2/2] mpc85xx_edac: change to use new definitions for PCI EDAC regspace
From: Dmitry Eremin-Solenikov @ 2010-07-22 0:03 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Doug Thompson, Dave Jiang, bluesmoke-devel
In-Reply-To: <1279756992-29543-1-git-send-email-dbaryshkov@gmail.com>
Currently (as mpc8540-pci) devices are not created on of_platform bus,
mpc85xx_edac can't probe to them. Follow the change to dts trees to bind
not to the main mpc8540-pci node but to special mpc85xx-pci-error nodes,
present on soc bus.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
drivers/edac/mpc85xx_edac.c | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/edac/mpc85xx_edac.c b/drivers/edac/mpc85xx_edac.c
index 52ca09b..d5a61b8 100644
--- a/drivers/edac/mpc85xx_edac.c
+++ b/drivers/edac/mpc85xx_edac.c
@@ -236,9 +236,6 @@ static int __devinit mpc85xx_pci_err_probe(struct of_device *op,
goto err;
}
- /* we only need the error registers */
- r.start += 0xe00;
-
if (!devm_request_mem_region(&op->dev, r.start, resource_size(&r),
pdata->name)) {
printk(KERN_ERR "%s: Error while requesting mem region\n",
@@ -328,12 +325,15 @@ static int mpc85xx_pci_err_remove(struct of_device *op)
}
static struct of_device_id mpc85xx_pci_err_of_match[] = {
- {
- .compatible = "fsl,mpc8540-pcix",
- },
- {
- .compatible = "fsl,mpc8540-pci",
- },
+ { .compatible = "fsl,mpc8536-pci-error", },
+ { .compatible = "fsl,mpc8540-pci-error", },
+ { .compatible = "fsl,mpc8541-pci-error", },
+ { .compatible = "fsl,mpc8544-pci-error", },
+ { .compatible = "fsl,mpc8548-pci-error", },
+ { .compatible = "fsl,mpc8555-pci-error", },
+ { .compatible = "fsl,mpc8560-pci-error", },
+ { .compatible = "fsl,mpc8568-pci-error", },
+ { .compatible = "fsl,mpc8572-pci-error", },
{},
};
--
1.7.1
^ permalink raw reply related
* Re: [PATCH 1/5] drivercore/of: Add OF style matching to platform bus
From: Greg KH @ 2010-07-22 0:07 UTC (permalink / raw)
To: Grant Likely
Cc: Stephen Rothwell, Michal Simek, microblaze-uclinux, linux-kernel,
linuxppc-dev, sparclinux, David Miller
In-Reply-To: <20100721233954.7782.81154.stgit@angua>
On Wed, Jul 21, 2010 at 05:39:54PM -0600, Grant Likely wrote:
> As part of the merge between platform bus and of_platform bus, add the
> ability to do of-style matching to the platform bus.
>
> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
> CC: Greg Kroah-Hartman <gregkh@suse.de>
> CC: Michal Simek <monstr@monstr.eu>
> CC: Grant Likely <grant.likely@secretlab.ca>
> CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> CC: Stephen Rothwell <sfr@canb.auug.org.au>
> CC: linux-kernel@vger.kernel.org
> CC: microblaze-uclinux@itee.uq.edu.au
> CC: linuxppc-dev@ozlabs.org
> CC: devicetree-discuss@lists.ozlabs.org
> ---
> drivers/base/platform.c | 5 +++++
> 1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/base/platform.c b/drivers/base/platform.c
> index 4d99c8b..6a9b3dd 100644
> --- a/drivers/base/platform.c
> +++ b/drivers/base/platform.c
> @@ -12,6 +12,7 @@
>
> #include <linux/string.h>
> #include <linux/platform_device.h>
> +#include <linux/of_device.h>
> #include <linux/module.h>
> #include <linux/init.h>
> #include <linux/dma-mapping.h>
> @@ -673,6 +674,10 @@ static int platform_match(struct device *dev, struct device_driver *drv)
> struct platform_device *pdev = to_platform_device(dev);
> struct platform_driver *pdrv = to_platform_driver(drv);
>
> + /* Attempt an OF style match first */
> + if (of_driver_match_device(dev, drv))
> + return 1;
> +
> /* match against the id table first */
I think you need to also change this comment, you can't have two
"firsts" :)
If you do that, feel free to add an:
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
to the patch.
thanks,
greg k-h
^ permalink raw reply
* Re: [alsa-devel] [PATCH] powerpc: rename immap_86xx.h to fsl_guts.h, and add 85xx support
From: Timur Tabi @ 2010-07-22 0:28 UTC (permalink / raw)
To: alsa-devel, linuxppc-dev, lrg, broonie, kumar.gala
In-Reply-To: <1279749902-13459-1-git-send-email-timur@freescale.com>
On Wed, Jul 21, 2010 at 5:05 PM, Timur Tabi <timur@freescale.com> wrote:
> The immap_86xx.h header file only defines one data structure: the "global
> utilities" register set found on Freescale PowerPC SOCs. =A0Rename this f=
ile
> to fsl_guts.h to reflect its true purpose, and extend it to cover the "GU=
TS"
> register set on 85xx chips.
>
> Signed-off-by: Timur Tabi <timur@freescale.com>
Argh, I forgot to add the text to explain e500 vs. e600.
V2 coming.
--=20
Timur Tabi
Linux kernel developer at Freescale
^ permalink raw reply
* [PATCH v4 0/2] powerpc: add support for new hcall H_BEST_ENERGY
From: Vaidyanathan Srinivasan @ 2010-07-22 0:57 UTC (permalink / raw)
To: Benjamin Herrenschmidt, Paul Mackerras, Anton Blanchard
Cc: Michael Neuling, linuxppc-dev
Hi Ben,
The following series adds a kernel module for powerpc pseries
platforms in order to export platform energy management capabilities.
The module exports data from a new hypervisor call H_BEST_ENERGY.
Some of the comments and suggestions made on the previous iteration of the
patch has been incorporated.
Changes in v4:
* Added more documentation
* Added check_for_h_best_energy() to look in ibm,hypertas-functions so
that sysfs entries are not created in an unsupported platform
* Added cleaner error checks and correct of_node_put()
* Rebased and tested on 2.6.35-rc5
Changed in v3:
[3] [PATCH v3 0/2] powerpc: add support for new hcall H_BEST_ENERGY
http://lists.ozlabs.org/pipermail/linuxppc-dev/2010-June/083414.html
* Added more documentation in the cleanup patch
* Removed RFC tag, rebased and tested on 2.6.35-rc3
* Ready for inclusion in powerpc/next tree for further testing
Changes in v2:
[2] [RFC PATCH v2 0/2] powerpc: add support for new hcall H_BEST_ENERGY
http://lists.ozlabs.org/pipermail/linuxppc-dev/2010-May/082246.html
* Cleanup cpu/thread/core APIs
* Export APIs to module instead of threads_per_core
* Use of_find_node_by_path() instead of of_find_node_by_name()
* Error checking and whitespace cleanups
First version:
[1] [RFC] powerpc: add support for new hcall H_BEST_ENERGY
http://lists.ozlabs.org/pipermail/linuxppc-dev/2010-March/080796.html
This patch series will apply on 2.6.35-rc5 as well as powerpc/next
tree. Please review and include in powerpc/next tree for further
testing.
I could incrementally reduce some of the error checks as suggested by
Michael Neuling as next steps.
Thanks,
Vaidy
---
Vaidyanathan Srinivasan (2):
powerpc: cleanup APIs for cpu/thread/core mappings
powerpc: add support for new hcall H_BEST_ENERGY
arch/powerpc/include/asm/cputhreads.h | 15 +
arch/powerpc/include/asm/hvcall.h | 3
arch/powerpc/kernel/smp.c | 19 +
arch/powerpc/mm/mmu_context_nohash.c | 12 -
arch/powerpc/platforms/pseries/Kconfig | 10 +
arch/powerpc/platforms/pseries/Makefile | 1
arch/powerpc/platforms/pseries/pseries_energy.c | 326 +++++++++++++++++++++++
7 files changed, 370 insertions(+), 16 deletions(-)
create mode 100644 arch/powerpc/platforms/pseries/pseries_energy.c
^ permalink raw reply
* [PATCH v4 1/2] powerpc: cleanup APIs for cpu/thread/core mappings
From: Vaidyanathan Srinivasan @ 2010-07-22 0:57 UTC (permalink / raw)
To: Benjamin Herrenschmidt, Paul Mackerras, Anton Blanchard
Cc: Michael Neuling, linuxppc-dev
In-Reply-To: <20100722005219.12905.49197.stgit@drishya.in.ibm.com>
These APIs take logical cpu number as input
Change cpu_first_thread_in_core() to cpu_leftmost_thread_sibling()
Change cpu_last_thread_in_core() to cpu_rightmost_thread_sibling()
These APIs convert core number (index) to logical cpu/thread numbers
Add cpu_first_thread_of_core(int core)
Changed cpu_thread_to_core() to cpu_core_of_thread(int cpu)
The goal is to make 'threads_per_core' accessible to the
pseries_energy module. Instead of making an API to read
threads_per_core, this is a higher level wrapper function to
convert from logical cpu number to core number.
The current APIs cpu_first_thread_in_core() and
cpu_last_thread_in_core() returns logical CPU number while
cpu_thread_to_core() returns core number or index which is
not a logical CPU number. The APIs are now clearly named to
distinguish 'core number' versus first and last 'logical cpu
number' in that core.
The new APIs cpu_{left,right}most_thread_sibling() work on
logical cpu numbers. While cpu_first_thread_of_core() and
cpu_core_of_thread() work on core index.
Example usage: (4 threads per core system)
cpu_leftmost_thread_sibling(5) = 4
cpu_rightmost_thread_sibling(5) = 7
cpu_core_of_thread(5) = 1
cpu_first_thread_of_core(1) = 4
cpu_core_of_thread() is used in cpu_to_drc_index() in the
module and cpu_first_thread_of_core() is used in
drc_index_to_cpu() in the module.
Made API changes to few callers. Exported symbols for use
in modules.
Signed-off-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
---
arch/powerpc/include/asm/cputhreads.h | 15 +++++++++------
arch/powerpc/kernel/smp.c | 19 ++++++++++++++++---
arch/powerpc/mm/mmu_context_nohash.c | 12 ++++++------
3 files changed, 31 insertions(+), 15 deletions(-)
diff --git a/arch/powerpc/include/asm/cputhreads.h b/arch/powerpc/include/asm/cputhreads.h
index a8e1844..26dc6bd 100644
--- a/arch/powerpc/include/asm/cputhreads.h
+++ b/arch/powerpc/include/asm/cputhreads.h
@@ -61,22 +61,25 @@ static inline cpumask_t cpu_online_cores_map(void)
return cpu_thread_mask_to_cores(cpu_online_map);
}
-static inline int cpu_thread_to_core(int cpu)
-{
- return cpu >> threads_shift;
-}
+#ifdef CONFIG_SMP
+int cpu_core_of_thread(int cpu);
+int cpu_first_thread_of_core(int core);
+#else
+static inline int cpu_core_of_thread(int cpu) { return cpu; }
+static inline int cpu_first_thread_of_core(int core) { return core; }
+#endif
static inline int cpu_thread_in_core(int cpu)
{
return cpu & (threads_per_core - 1);
}
-static inline int cpu_first_thread_in_core(int cpu)
+static inline int cpu_leftmost_thread_sibling(int cpu)
{
return cpu & ~(threads_per_core - 1);
}
-static inline int cpu_last_thread_in_core(int cpu)
+static inline int cpu_rightmost_thread_sibling(int cpu)
{
return cpu | (threads_per_core - 1);
}
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 5c196d1..da4c2f8 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -468,7 +468,20 @@ out:
return id;
}
-/* Must be called when no change can occur to cpu_present_mask,
+/* Helper routines for cpu to core mapping */
+int cpu_core_of_thread(int cpu)
+{
+ return cpu >> threads_shift;
+}
+EXPORT_SYMBOL_GPL(cpu_core_of_thread);
+
+int cpu_first_thread_of_core(int core)
+{
+ return core << threads_shift;
+}
+EXPORT_SYMBOL_GPL(cpu_first_thread_of_core);
+
+/* Must be called when no change can occur to cpu_present_map,
* i.e. during cpu online or offline.
*/
static struct device_node *cpu_to_l2cache(int cpu)
@@ -527,7 +540,7 @@ int __devinit start_secondary(void *unused)
notify_cpu_starting(cpu);
set_cpu_online(cpu, true);
/* Update sibling maps */
- base = cpu_first_thread_in_core(cpu);
+ base = cpu_leftmost_thread_sibling(cpu);
for (i = 0; i < threads_per_core; i++) {
if (cpu_is_offline(base + i))
continue;
@@ -606,7 +619,7 @@ int __cpu_disable(void)
return err;
/* Update sibling maps */
- base = cpu_first_thread_in_core(cpu);
+ base = cpu_leftmost_thread_sibling(cpu);
for (i = 0; i < threads_per_core; i++) {
cpumask_clear_cpu(cpu, cpu_sibling_mask(base + i));
cpumask_clear_cpu(base + i, cpu_sibling_mask(cpu));
diff --git a/arch/powerpc/mm/mmu_context_nohash.c b/arch/powerpc/mm/mmu_context_nohash.c
index ddfd7ad..22f3bc5 100644
--- a/arch/powerpc/mm/mmu_context_nohash.c
+++ b/arch/powerpc/mm/mmu_context_nohash.c
@@ -111,8 +111,8 @@ static unsigned int steal_context_smp(unsigned int id)
* a core map instead but this will do for now.
*/
for_each_cpu(cpu, mm_cpumask(mm)) {
- for (i = cpu_first_thread_in_core(cpu);
- i <= cpu_last_thread_in_core(cpu); i++)
+ for (i = cpu_leftmost_thread_sibling(cpu);
+ i <= cpu_rightmost_thread_sibling(cpu); i++)
__set_bit(id, stale_map[i]);
cpu = i - 1;
}
@@ -264,14 +264,14 @@ void switch_mmu_context(struct mm_struct *prev, struct mm_struct *next)
*/
if (test_bit(id, stale_map[cpu])) {
pr_hardcont(" | stale flush %d [%d..%d]",
- id, cpu_first_thread_in_core(cpu),
- cpu_last_thread_in_core(cpu));
+ id, cpu_leftmost_thread_sibling(cpu),
+ cpu_rightmost_thread_sibling(cpu));
local_flush_tlb_mm(next);
/* XXX This clear should ultimately be part of local_flush_tlb_mm */
- for (i = cpu_first_thread_in_core(cpu);
- i <= cpu_last_thread_in_core(cpu); i++) {
+ for (i = cpu_leftmost_thread_sibling(cpu);
+ i <= cpu_rightmost_thread_sibling(cpu); i++) {
__clear_bit(id, stale_map[i]);
}
}
^ permalink raw reply related
* [PATCH v4 2/2] powerpc: add support for new hcall H_BEST_ENERGY
From: Vaidyanathan Srinivasan @ 2010-07-22 0:57 UTC (permalink / raw)
To: Benjamin Herrenschmidt, Paul Mackerras, Anton Blanchard
Cc: Michael Neuling, linuxppc-dev
In-Reply-To: <20100722005219.12905.49197.stgit@drishya.in.ibm.com>
Create sysfs interface to export data from H_BEST_ENERGY hcall
that can be used by administrative tools on supported pseries
platforms for energy management optimizations.
/sys/device/system/cpu/pseries_(de)activate_hint_list and
/sys/device/system/cpu/cpuN/pseries_(de)activate_hint will provide
hints for activation and deactivation of cpus respectively.
These hints are abstract number given by the hypervisor based
on the extended knowledge the hypervisor has regarding the
current system topology and resource mappings.
The activate and the deactivate sysfs entry is for the two
distinct operations that we could do for energy savings. When
we have more capacity than required, we could deactivate few
core to save energy. The choice of the core to deactivate
will be based on /sys/devices/system/cpu/deactivate_hint_list.
The comma separated list of cpus (cores) will be the preferred
choice. If we have to activate some of the deactivated cores,
then /sys/devices/system/cpu/activate_hint_list will be used.
The per-cpu file
/sys/device/system/cpu/cpuN/pseries_(de)activate_hint further
provide more fine grain information by exporting the value of
the hint itself.
Added new driver module
arch/powerpc/platforms/pseries/pseries_energy.c
under new config option CONFIG_PSERIES_ENERGY
Signed-off-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
---
arch/powerpc/include/asm/hvcall.h | 3
arch/powerpc/platforms/pseries/Kconfig | 10 +
arch/powerpc/platforms/pseries/Makefile | 1
arch/powerpc/platforms/pseries/pseries_energy.c | 326 +++++++++++++++++++++++
4 files changed, 339 insertions(+), 1 deletions(-)
create mode 100644 arch/powerpc/platforms/pseries/pseries_energy.c
diff --git a/arch/powerpc/include/asm/hvcall.h b/arch/powerpc/include/asm/hvcall.h
index 5119b7d..34b66e0 100644
--- a/arch/powerpc/include/asm/hvcall.h
+++ b/arch/powerpc/include/asm/hvcall.h
@@ -231,7 +231,8 @@
#define H_GET_EM_PARMS 0x2B8
#define H_SET_MPP 0x2D0
#define H_GET_MPP 0x2D4
-#define MAX_HCALL_OPCODE H_GET_MPP
+#define H_BEST_ENERGY 0x2F4
+#define MAX_HCALL_OPCODE H_BEST_ENERGY
#ifndef __ASSEMBLY__
diff --git a/arch/powerpc/platforms/pseries/Kconfig b/arch/powerpc/platforms/pseries/Kconfig
index c667f0f..8323622 100644
--- a/arch/powerpc/platforms/pseries/Kconfig
+++ b/arch/powerpc/platforms/pseries/Kconfig
@@ -33,6 +33,16 @@ config PSERIES_MSI
depends on PCI_MSI && EEH
default y
+config PSERIES_ENERGY
+ tristate "pSeries energy management capabilities driver"
+ depends on PPC_PSERIES
+ default y
+ help
+ Provides interface to platform energy management capabilities
+ on supported PSERIES platforms.
+ Provides: /sys/devices/system/cpu/pseries_(de)activation_hint_list
+ and /sys/devices/system/cpu/cpuN/pseries_(de)activation_hint
+
config SCANLOG
tristate "Scanlog dump interface"
depends on RTAS_PROC && PPC_PSERIES
diff --git a/arch/powerpc/platforms/pseries/Makefile b/arch/powerpc/platforms/pseries/Makefile
index 3dbef30..32ae72e 100644
--- a/arch/powerpc/platforms/pseries/Makefile
+++ b/arch/powerpc/platforms/pseries/Makefile
@@ -16,6 +16,7 @@ obj-$(CONFIG_EEH) += eeh.o eeh_cache.o eeh_driver.o eeh_event.o eeh_sysfs.o
obj-$(CONFIG_KEXEC) += kexec.o
obj-$(CONFIG_PCI) += pci.o pci_dlpar.o
obj-$(CONFIG_PSERIES_MSI) += msi.o
+obj-$(CONFIG_PSERIES_ENERGY) += pseries_energy.o
obj-$(CONFIG_HOTPLUG_CPU) += hotplug-cpu.o
obj-$(CONFIG_MEMORY_HOTPLUG) += hotplug-memory.o
diff --git a/arch/powerpc/platforms/pseries/pseries_energy.c b/arch/powerpc/platforms/pseries/pseries_energy.c
new file mode 100644
index 0000000..e217ea3
--- /dev/null
+++ b/arch/powerpc/platforms/pseries/pseries_energy.c
@@ -0,0 +1,326 @@
+/*
+ * POWER platform energy management driver
+ * Copyright (C) 2010 IBM Corporation
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This pseries platform device driver provides access to
+ * platform energy management capabilities.
+ */
+
+#include <linux/module.h>
+#include <linux/types.h>
+#include <linux/errno.h>
+#include <linux/init.h>
+#include <linux/seq_file.h>
+#include <linux/sysdev.h>
+#include <linux/cpu.h>
+#include <linux/of.h>
+#include <asm/cputhreads.h>
+#include <asm/page.h>
+#include <asm/hvcall.h>
+
+
+#define MODULE_VERS "1.0"
+#define MODULE_NAME "pseries_energy"
+
+/* Driver flags */
+
+static int sysfs_entries;
+
+/* Helper routines */
+
+/*
+ * Routine to detect firmware support for hcall
+ * return 1 if H_BEST_ENERGY is supported
+ * else return 0
+ */
+
+static int check_for_h_best_energy(void)
+{
+ struct device_node *rtas = NULL;
+ const char *hypertas, *s;
+ int length;
+ int rc = 0;
+
+ rtas = of_find_node_by_path("/rtas");
+ if (!rtas)
+ return 0;
+
+ hypertas = of_get_property(rtas, "ibm,hypertas-functions", &length);
+ if (!hypertas) {
+ of_node_put(rtas);
+ return 0;
+ }
+
+ /* hypertas will have list of strings with hcall names */
+ for (s = hypertas; s < hypertas + length; s += strlen(s) + 1) {
+ if (!strncmp("hcall-best-energy-1", s, 19)) {
+ rc = 1; /* Found the string */
+ break;
+ }
+ }
+ of_node_put(rtas);
+ return rc;
+}
+
+/* Helper Routines to convert between drc_index to cpu numbers */
+
+static u32 cpu_to_drc_index(int cpu)
+{
+ struct device_node *dn = NULL;
+ const int *indexes;
+ int i;
+ int rc = 1;
+ u32 ret = 0;
+
+ dn = of_find_node_by_path("/cpus");
+ if (dn == NULL)
+ goto err;
+ indexes = of_get_property(dn, "ibm,drc-indexes", NULL);
+ if (indexes == NULL)
+ goto err_of_node_put;
+ /* Convert logical cpu number to core number */
+ i = cpu_core_of_thread(cpu);
+ /*
+ * The first element indexes[0] is the number of drc_indexes
+ * returned in the list. Hence i+1 will get the drc_index
+ * corresponding to core number i.
+ */
+ WARN_ON(i > indexes[0]);
+ ret = indexes[i + 1];
+ rc = 0;
+
+err_of_node_put:
+ of_node_put(dn);
+err:
+ if (rc)
+ printk(KERN_WARNING "cpu_to_drc_index(%d) failed", cpu);
+ return ret;
+}
+
+static int drc_index_to_cpu(u32 drc_index)
+{
+ struct device_node *dn = NULL;
+ const int *indexes;
+ int i, cpu = 0;
+ int rc = 1;
+
+ dn = of_find_node_by_path("/cpus");
+ if (dn == NULL)
+ goto err;
+ indexes = of_get_property(dn, "ibm,drc-indexes", NULL);
+ if (indexes == NULL)
+ goto err_of_node_put;
+ /*
+ * First element in the array is the number of drc_indexes
+ * returned. Search through the list to find the matching
+ * drc_index and get the core number
+ */
+ for (i = 0; i < indexes[0]; i++) {
+ if (indexes[i + 1] == drc_index)
+ break;
+ }
+ /* Convert core number to logical cpu number */
+ cpu = cpu_first_thread_of_core(i);
+ rc = 0;
+
+err_of_node_put:
+ of_node_put(dn);
+err:
+ if (rc)
+ printk(KERN_WARNING "drc_index_to_cpu(%d) failed", drc_index);
+ return cpu;
+}
+
+/*
+ * pseries hypervisor call H_BEST_ENERGY provides hints to OS on
+ * preferred logical cpus to activate or deactivate for optimized
+ * energy consumption.
+ */
+
+#define FLAGS_MODE1 0x004E200000080E01
+#define FLAGS_MODE2 0x004E200000080401
+#define FLAGS_ACTIVATE 0x100
+
+static ssize_t get_best_energy_list(char *page, int activate)
+{
+ int rc, cnt, i, cpu;
+ unsigned long retbuf[PLPAR_HCALL9_BUFSIZE];
+ unsigned long flags = 0;
+ u32 *buf_page;
+ char *s = page;
+
+ buf_page = (u32 *) get_zeroed_page(GFP_KERNEL);
+ if (!buf_page)
+ return -ENOMEM;
+
+ flags = FLAGS_MODE1;
+ if (activate)
+ flags |= FLAGS_ACTIVATE;
+
+ rc = plpar_hcall9(H_BEST_ENERGY, retbuf, flags, 0, __pa(buf_page),
+ 0, 0, 0, 0, 0, 0);
+ if (rc != H_SUCCESS) {
+ free_page((unsigned long) buf_page);
+ return -EINVAL;
+ }
+
+ cnt = retbuf[0];
+ for (i = 0; i < cnt; i++) {
+ cpu = drc_index_to_cpu(buf_page[2*i+1]);
+ if ((cpu_online(cpu) && !activate) ||
+ (!cpu_online(cpu) && activate))
+ s += sprintf(s, "%d,", cpu);
+ }
+ if (s > page) { /* Something to show */
+ s--; /* Suppress last comma */
+ s += sprintf(s, "\n");
+ }
+
+ free_page((unsigned long) buf_page);
+ return s-page;
+}
+
+static ssize_t get_best_energy_data(struct sys_device *dev,
+ char *page, int activate)
+{
+ int rc;
+ unsigned long retbuf[PLPAR_HCALL9_BUFSIZE];
+ unsigned long flags = 0;
+
+ flags = FLAGS_MODE2;
+ if (activate)
+ flags |= FLAGS_ACTIVATE;
+
+ rc = plpar_hcall9(H_BEST_ENERGY, retbuf, flags,
+ cpu_to_drc_index(dev->id),
+ 0, 0, 0, 0, 0, 0, 0);
+
+ if (rc != H_SUCCESS)
+ return -EINVAL;
+
+ return sprintf(page, "%lu\n", retbuf[1] >> 32);
+}
+
+/* Wrapper functions */
+
+static ssize_t cpu_activate_hint_list_show(struct sysdev_class *class,
+ struct sysdev_class_attribute *attr, char *page)
+{
+ return get_best_energy_list(page, 1);
+}
+
+static ssize_t cpu_deactivate_hint_list_show(struct sysdev_class *class,
+ struct sysdev_class_attribute *attr, char *page)
+{
+ return get_best_energy_list(page, 0);
+}
+
+static ssize_t percpu_activate_hint_show(struct sys_device *dev,
+ struct sysdev_attribute *attr, char *page)
+{
+ return get_best_energy_data(dev, page, 1);
+}
+
+static ssize_t percpu_deactivate_hint_show(struct sys_device *dev,
+ struct sysdev_attribute *attr, char *page)
+{
+ return get_best_energy_data(dev, page, 0);
+}
+
+/*
+ * Create sysfs interface:
+ * /sys/devices/system/cpu/pseries_activate_hint_list
+ * /sys/devices/system/cpu/pseries_deactivate_hint_list
+ * Comma separated list of cpus to activate or deactivate
+ * /sys/devices/system/cpu/cpuN/pseries_activate_hint
+ * /sys/devices/system/cpu/cpuN/pseries_deactivate_hint
+ * Per-cpu value of the hint
+ */
+
+struct sysdev_class_attribute attr_cpu_activate_hint_list =
+ _SYSDEV_CLASS_ATTR(pseries_activate_hint_list, 0444,
+ cpu_activate_hint_list_show, NULL);
+
+struct sysdev_class_attribute attr_cpu_deactivate_hint_list =
+ _SYSDEV_CLASS_ATTR(pseries_deactivate_hint_list, 0444,
+ cpu_deactivate_hint_list_show, NULL);
+
+struct sysdev_attribute attr_percpu_activate_hint =
+ _SYSDEV_ATTR(pseries_activate_hint, 0444,
+ percpu_activate_hint_show, NULL);
+
+struct sysdev_attribute attr_percpu_deactivate_hint =
+ _SYSDEV_ATTR(pseries_deactivate_hint, 0444,
+ percpu_deactivate_hint_show, NULL);
+
+static int __init pseries_energy_init(void)
+{
+ int cpu, err;
+ struct sys_device *cpu_sys_dev;
+
+ if (!check_for_h_best_energy()) {
+ printk(KERN_INFO "Hypercall H_BEST_ENERGY not supported\n");
+ return 0;
+ }
+ /* Create the sysfs files */
+ err = sysfs_create_file(&cpu_sysdev_class.kset.kobj,
+ &attr_cpu_activate_hint_list.attr);
+ if (!err)
+ err = sysfs_create_file(&cpu_sysdev_class.kset.kobj,
+ &attr_cpu_deactivate_hint_list.attr);
+
+ if (err)
+ return err;
+ for_each_possible_cpu(cpu) {
+ cpu_sys_dev = get_cpu_sysdev(cpu);
+ err = sysfs_create_file(&cpu_sys_dev->kobj,
+ &attr_percpu_activate_hint.attr);
+ if (err)
+ break;
+ err = sysfs_create_file(&cpu_sys_dev->kobj,
+ &attr_percpu_deactivate_hint.attr);
+ if (err)
+ break;
+ }
+
+ if (err)
+ return err;
+
+ sysfs_entries = 1; /* Removed entries on cleanup */
+ return 0;
+
+}
+
+static void __exit pseries_energy_cleanup(void)
+{
+ int cpu;
+ struct sys_device *cpu_sys_dev;
+
+ if (!sysfs_entries)
+ return;
+
+ /* Remove the sysfs files */
+ sysfs_remove_file(&cpu_sysdev_class.kset.kobj,
+ &attr_cpu_activate_hint_list.attr);
+
+ sysfs_remove_file(&cpu_sysdev_class.kset.kobj,
+ &attr_cpu_deactivate_hint_list.attr);
+
+ for_each_possible_cpu(cpu) {
+ cpu_sys_dev = get_cpu_sysdev(cpu);
+ sysfs_remove_file(&cpu_sys_dev->kobj,
+ &attr_percpu_activate_hint.attr);
+ sysfs_remove_file(&cpu_sys_dev->kobj,
+ &attr_percpu_deactivate_hint.attr);
+ }
+}
+
+module_init(pseries_energy_init);
+module_exit(pseries_energy_cleanup);
+MODULE_DESCRIPTION("Driver for pSeries platform energy management");
+MODULE_AUTHOR("Vaidyanathan Srinivasan");
+MODULE_LICENSE("GPL");
^ permalink raw reply related
* Re: [PATCH v3 2/2] powerpc: add support for new hcall H_BEST_ENERGY
From: Vaidyanathan Srinivasan @ 2010-07-22 3:35 UTC (permalink / raw)
To: Michael Neuling; +Cc: Paul Mackerras, Anton Blanchard, linuxppc-dev
In-Reply-To: <2127.1277705466@neuling.org>
* Michael Neuling <mikey@neuling.org> [2010-06-28 16:11:06]:
[snip]
> > These hints are abstract number given by the hypervisor based on
> > the extended knowledge the hypervisor has regarding the current system
> > topology and resource mappings.
> >
> > The activate and the deactivate part is for the two distinct
> > operations that we could do for energy savings. When we have more
> > capacity than required, we could deactivate few core to save energy.
> > The choice of the core to deactivate will be based on
> > /sys/devices/system/cpu/deactivate_hint_list. The comma separated
> > list of cpus (cores) will be the preferred choice.
> >
> > Once the system has few deactivated cores, based on workload demand we
> > may have to activate them to meet the demand. In that case the
> > /sys/devices/system/cpu/activate_hint_list will be used to prefer the
> > core in-order among the deactivated cores.
> >
> > In simple terms, activate_hint_list will be null until we deactivate
> > few cores. Then we could look at the corresponding list for
> > activation or deactivation.
>
> Can you put these details in the code and in the check-in comments.
Hi Mikey,
I have added these in the -v4 post.
> > Regarding your second point, there is a reason for both a list and
> > per-cpu interface. The list gives us a system wide list of cores in
> > one shot for userspace to base their decision. This will be the
> > preferred interface for most cases. On the other hand, per-cpu file
> > /sys/device/system/cpu/cpuN/pseries_(de)activate_hint provide more
> > information since it exports the hint value as such.
> >
> > The idea is that the list interface will be used to get a suggested
> > list of cores to manage, while the per-cpu value can be used to
> > further get fine grain information on a per-core bases from the
> > hypervisor. This allows Linux to have access to all information that
> > the hypervisor has offered through this hcall interface.
>
> OK, I didn't realise that they contained different info. Just more
> reasons that this interface needs better documentation :-)
>
> Overall, I'm mostly happy with the interface. It's pretty light weight.
these too.
> > > Other comments below.
> > >
[snip]
> > > > diff --git a/arch/powerpc/platforms/pseries/Kconfig b/arch/powerpc/platfo
> rms/
> > > pseries/Kconfig
> > > > index c667f0f..b3dd108 100644
> > > > --- a/arch/powerpc/platforms/pseries/Kconfig
> > > > +++ b/arch/powerpc/platforms/pseries/Kconfig
> > > > @@ -33,6 +33,16 @@ config PSERIES_MSI
> > > > depends on PCI_MSI && EEH
> > > > default y
> > > >
> > > > +config PSERIES_ENERGY
> > >
> > > Probably need a less generic name. PSERIES_ENERGY_MANAGEMENT?
> > > PSERIES_ENERGY_HOTPLUG_HINTS?
> >
> > PSERIES_ENERGY_MANAGEMENT may be good but too long for a config
> > option.
> >
> > The idea is to collect all energy management functions in this module
> > as and when new features are introduced in the pseries platform. This
> > hcall interface is the first to be included, but going forward in
> > future I do not propose to have different modules for other energy
> > management related features.
> >
> > The name is specific enough for IBM pseries platform and energy
> > management functions and enablements. Having less generic name below
> > this level will make it difficult to add all varieties of energy
> > management functions in future.
>
> OK, I thought this might be the case but you never said. Please say
> something like "This adds CONFIG_PSERIES_ENERGY which will be used for
> future power saving code" or some such.
I already had this comment in the patch description. Did not want add
a comment in the Kconfig file as the CONFIG_ prefix is assumed in each
of the
> > > > +
> > > > +/* Helper Routines to convert between drc_index to cpu numbers */
> > > > +
> > > > +static u32 cpu_to_drc_index(int cpu)
> > > > +{
> > > > + struct device_node *dn = NULL;
> > > > + const int *indexes;
> > > > + int i;
> > > > + dn = of_find_node_by_path("/cpus");
> > > > + if (dn == NULL)
> > > > + goto err;
> > >
> > > Humm, I not sure this is really needed. If you don't have /cpus you are
> > > probably not going to boot.
> >
> > Good suggestion. I could add all these checks in module_init. I was
> > think if any of the functions being called is allocating memory and in
> > case they fail, we need to abort.
> >
> > I just reviewed and look like of_find_node_by_path() will not sleep or
> > allocate any memory. So if it succeeds once in module_init(), then it
> > will never fail!
> >
> >
> > > > + indexes = of_get_property(dn, "ibm,drc-indexes", NULL);
> > > > + if (indexes == NULL)
> > > > + goto err;
> > >
> > > These checks should probably be moved to module init rather than /sfs
> > > read time. If they fail, don't load the module and print a warning.
> > >
> > > These HCALLS and device-tree entire aren't going to be dynamic.
> >
> > Agreed. Only cause of runtime failure is OOM. If none of these
> > allocate memory, moving these checks once at module_init() will be
> > a good optimization.
>
> Cool, thanks.
Hey, I did not yet remove the failure checks in this iteration. I did
not have these checks earlier and Ben has suggested to check at each
call. I will discuss with him about moving all checks to
module_init() time and then remove these.
--Vaidy
^ permalink raw reply
* [PATCH] powerpc: print cores passed to firmware in decimal
From: Michael Neuling @ 2010-07-22 5:15 UTC (permalink / raw)
To: benh, linuxppc-dev
Currently we look pretty stupid when printing out the number of cores
passed to FW
Max number of cores passed to firmware: 0x0000000000000080
So I've change this to print in decimal:
Max number of cores passed to firmware: 128 (NR_CPUS = 256)
This required adding a prom_print_dec() function.
Signed-off-by: Michael Neuling <mikey@neuling.org>
--
Anton suggested printing it in EBCDIC, but I nixed that.
arch/powerpc/kernel/prom_init.c | 32 +++++++++++++++++++++++++++++---
1 files changed, 29 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index 3b6f8ae..4428d26 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -311,6 +311,27 @@ static void __init prom_print_hex(unsigned long val)
call_prom("write", 3, 1, _prom->stdout, buf, nibbles);
}
+/* max number of decimal digits in an unsigned long */
+#define UL_DIGITS 21
+static void __init prom_print_dec(unsigned long val)
+{
+ int i, size;
+ char buf[UL_DIGITS+1];
+ struct prom_t *_prom = &RELOC(prom);
+
+ for (i = UL_DIGITS-1; i >= 0; i--) {
+ buf[i] = (val % 10) + '0';
+ val = val/10;
+ if (val == 0)
+ break;
+ }
+ /* shift stuff down */
+ size = UL_DIGITS - i;
+ for (i = 0 ; i < size ; i++)
+ buf[i] = buf[i + UL_DIGITS - size];
+ buf[size+1] = '\0';
+ call_prom("write", 3, 1, _prom->stdout, buf, size);
+}
static void __init prom_printf(const char *format, ...)
{
@@ -350,6 +371,11 @@ static void __init prom_printf(const char *format, ...)
v = va_arg(args, unsigned long);
prom_print_hex(v);
break;
+ case 'i':
+ ++q;
+ v = va_arg(args, unsigned long);
+ prom_print_dec(v);
+ break;
}
}
}
@@ -869,12 +895,12 @@ static void __init prom_send_capabilities(void)
cores = (u32 *)PTRRELOC(&ibm_architecture_vec[IBM_ARCH_VEC_NRCORES_OFFSET]);
if (*cores != NR_CPUS) {
prom_printf("WARNING ! "
- "ibm_architecture_vec structure inconsistent: 0x%x !\n",
+ "ibm_architecture_vec structure inconsistent: 0x%i !\n",
*cores);
} else {
*cores = DIV_ROUND_UP(NR_CPUS, prom_count_smt_threads());
- prom_printf("Max number of cores passed to firmware: 0x%x\n",
- (unsigned long)*cores);
+ prom_printf("Max number of cores passed to firmware: %i (NR_CPUS = %i)\n",
+ *cores, NR_CPUS);
}
/* try calling the ibm,client-architecture-support method */
^ permalink raw reply related
* Re: [PATCH 0/5] Eliminate of_platform_bus_type
From: David Miller @ 2010-07-22 5:28 UTC (permalink / raw)
To: grant.likely
Cc: sfr, monstr, gregkh, linux-kernel, linuxppc-dev,
microblaze-uclinux, sparclinux
In-Reply-To: <20100721232817.7782.23410.stgit@angua>
From: Grant Likely <grant.likely@secretlab.ca>
Date: Wed, 21 Jul 2010 17:39:49 -0600
> David, you'll also want to take a look at patches 4 & 5 to see if you
> agree with my decisions on where I move symbols in the header files.
Looks fine to me.
^ permalink raw reply
* Re: [PATCH 2/5] of: Merge of_platform_bus_type with platform_bus_type
From: David Miller @ 2010-07-22 5:28 UTC (permalink / raw)
To: grant.likely
Cc: sfr, monstr, gregkh, linux-kernel, linuxppc-dev,
microblaze-uclinux, sparclinux
In-Reply-To: <20100721233959.7782.17711.stgit@angua>
From: Grant Likely <grant.likely@secretlab.ca>
Date: Wed, 21 Jul 2010 17:40:00 -0600
> of_platform_bus was being used in the same manner as the platform_bus.
> The only difference being that of_platform_bus devices are generated
> from data in the device tree, and platform_bus devices are usually
> statically allocated in platform code. Having them separate causes
> the problem of device drivers having to be registered twice if it
> was possible for the same device to appear on either bus.
>
> This patch removes of_platform_bus_type and registers all of_platform
> bus devices and drivers on the platform bus instead. A previous patch
> made the of_device structure an alias for the platform_device structure,
> and a shim is used to adapt of_platform_drivers to the platform bus.
>
> After all of of_platform_bus drivers are converted to be normal platform
> drivers, the shim code can be removed.
>
> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: David S. Miller <davem@davemloft.net>
^ permalink raw reply
* Re: [PATCH 3/5] of/platform: remove all of_bus_type and of_platform_bus_type references
From: David Miller @ 2010-07-22 5:28 UTC (permalink / raw)
To: grant.likely
Cc: sfr, monstr, gregkh, linux-kernel, linuxppc-dev,
microblaze-uclinux, sparclinux
In-Reply-To: <20100721234005.7782.52867.stgit@angua>
From: Grant Likely <grant.likely@secretlab.ca>
Date: Wed, 21 Jul 2010 17:40:05 -0600
> Both of_bus_type and of_platform_bus_type are just #define aliases
> for the platform bus. This patch removes all references to them and
> switches to the of_register_platform_driver()/of_unregister_platform_driver()
> API for registering.
>
> Subsequent patches will convert each user of of_register_platform_driver()
> into plain platform_drivers without the of_platform_driver shim. At which
> point the of_register_platform_driver()/of_unregister_platform_driver()
> functions can be removed.
>
> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: David S. Miller <davem@davemloft.net>
^ permalink raw reply
* Re: [PATCH 4/5] of: remove asm/of_platform.h
From: David Miller @ 2010-07-22 5:28 UTC (permalink / raw)
To: grant.likely
Cc: sfr, monstr, gregkh, linux-kernel, linuxppc-dev,
microblaze-uclinux, sparclinux
In-Reply-To: <20100721234010.7782.3073.stgit@angua>
From: Grant Likely <grant.likely@secretlab.ca>
Date: Wed, 21 Jul 2010 17:40:10 -0600
> Only thing left in it is of_instantiate_rtc() which can be moved to
> asm/prom.h on PowerPC and is unused in microblaze.
>
> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: David S. Miller <davem@davemloft.net>
^ permalink raw reply
* Re: [PATCH 5/5] of: remove asm/of_device.h
From: David Miller @ 2010-07-22 5:28 UTC (permalink / raw)
To: grant.likely
Cc: sfr, monstr, gregkh, linux-kernel, linuxppc-dev,
microblaze-uclinux, sparclinux
In-Reply-To: <20100721234015.7782.98378.stgit@angua>
From: Grant Likely <grant.likely@secretlab.ca>
Date: Wed, 21 Jul 2010 17:40:15 -0600
> It is mostly unused now. Sparc has a few defines left in it, but they
> can be moved to other headers. Removing this header means that new
> architectures adding CONFIG_OF support don't need to also add this
> header file.
>
> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: David S. Miller <davem@davemloft.net>
^ permalink raw reply
* build failure with kernel 2.6.35-rc5-git6/git7 on power box
From: divya @ 2010-07-22 7:50 UTC (permalink / raw)
To: LKML, linuxppc-dev, David Airlie
Hi,
The kernel versions 2.6.35-rc5-git6(commitid f4b23cc2d5dc78ef) and 2.6.35-rc5-git7(commitid cd5b8f8755a89a5) fails
to build on power6 and power5 machines with the following error
drivers/gpu/drm/ttm/ttm_page_alloc.c: In function 'set_pages_array_wb':
drivers/gpu/drm/ttm/ttm_page_alloc.c:227: error: implicit declaration of function 'unmap_page_from_agp'
drivers/gpu/drm/ttm/ttm_page_alloc.c: In function 'set_pages_array_wc':
drivers/gpu/drm/ttm/ttm_page_alloc.c:238: error: implicit declaration of function 'map_page_into_agp'
drivers/gpu/drm/ttm/ttm_page_alloc.c: In function 'ttm_pool_mm_shrink_init':
drivers/gpu/drm/ttm/ttm_page_alloc.c:419: warning: assignment from incompatible pointer type
make[4]: *** [drivers/gpu/drm/ttm/ttm_page_alloc.o] Error 1
make[3]: *** [drivers/gpu/drm/ttm] Error 2
Thanks
Divya
^ permalink raw reply
* Re: build failure with kernel 2.6.35-rc5-git6/git7 on power box
From: Stephen Rothwell @ 2010-07-22 8:40 UTC (permalink / raw)
To: divya; +Cc: David Airlie, linuxppc-dev, LKML
In-Reply-To: <4C47F861.8080501@linux.vnet.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 1110 bytes --]
Hi,
On Thu, 22 Jul 2010 13:20:57 +0530 divya <dipraksh@linux.vnet.ibm.com> wrote:
>
> The kernel versions 2.6.35-rc5-git6(commitid f4b23cc2d5dc78ef) and 2.6.35-rc5-git7(commitid cd5b8f8755a89a5) fails
> to build on power6 and power5 machines with the following error
>
>
> drivers/gpu/drm/ttm/ttm_page_alloc.c: In function 'set_pages_array_wb':
> drivers/gpu/drm/ttm/ttm_page_alloc.c:227: error: implicit declaration of function 'unmap_page_from_agp'
> drivers/gpu/drm/ttm/ttm_page_alloc.c: In function 'set_pages_array_wc':
> drivers/gpu/drm/ttm/ttm_page_alloc.c:238: error: implicit declaration of function 'map_page_into_agp'
> drivers/gpu/drm/ttm/ttm_page_alloc.c: In function 'ttm_pool_mm_shrink_init':
> drivers/gpu/drm/ttm/ttm_page_alloc.c:419: warning: assignment from incompatible pointer type
> make[4]: *** [drivers/gpu/drm/ttm/ttm_page_alloc.o] Error 1
> make[3]: *** [drivers/gpu/drm/ttm] Error 2
See https://patchwork.kernel.org/patch/113504/
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]
^ permalink raw reply
* [PATCH] RapidIO,powerpc/85xx: remove MCSR_MASK in fsl_rio
From: Alexandre Bounine @ 2010-07-21 16:46 UTC (permalink / raw)
To: akpm, linux-kernel, linuxppc-dev; +Cc: Alexandre Bounine
Fixes compile problem caused by MCSR_MASK removal from book-E definitions.
Signed-off-by: Alexandre Bounine <alexandre.bounine@idt.com>
Cc: Kumar Gala <galak@kernel.crashing.org>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Matt Porter <mporter@kernel.crashing.org>
---
arch/powerpc/sysdev/fsl_rio.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/sysdev/fsl_rio.c b/arch/powerpc/sysdev/fsl_rio.c
index 30e1626..c58df58 100644
--- a/arch/powerpc/sysdev/fsl_rio.c
+++ b/arch/powerpc/sysdev/fsl_rio.c
@@ -245,7 +245,7 @@ static int (*saved_mcheck_exception)(struct pt_regs *regs);
static int fsl_rio_mcheck_exception(struct pt_regs *regs)
{
const struct exception_table_entry *entry = NULL;
- unsigned long reason = (mfspr(SPRN_MCSR) & MCSR_MASK);
+ unsigned long reason = mfspr(SPRN_MCSR);
if (reason & MCSR_BUS_RBERR) {
reason = in_be32((u32 *)(rio_regs_win + RIO_LTLEDCSR));
--
1.7.0.5
^ permalink raw reply related
* Re: [PATCH] powerpc: print cores passed to firmware in decimal
From: Segher Boessenkool @ 2010-07-22 15:11 UTC (permalink / raw)
To: Michael Neuling; +Cc: linuxppc-dev
In-Reply-To: <4553.1279775749@neuling.org>
> + case 'i':
> + ++q;
> + v = va_arg(args, unsigned long);
> + prom_print_dec(v);
> + break;
Unsigned long should be "%lu".
Segher
^ permalink raw reply
* Re: [PATCH] powerpc: rename immap_86xx.h to fsl_guts.h, and add 85xx support
From: Peter Tyser @ 2010-07-22 15:30 UTC (permalink / raw)
To: Timur Tabi; +Cc: linuxppc-dev, alsa-devel, broonie, kumar.gala, lrg
In-Reply-To: <1279749902-13459-1-git-send-email-timur@freescale.com>
Hi Timur,
> +/**
> + * Global Utility Registers.
> + *
> + * Not all registers defined in this structure are available on all chips, so
> + * you are expected to know whether a given register actually exists on your
> + * chip before you access it.
> + *
> + * Also, some registers are similar on different chips but have slightly
> + * different names. In these cases, one name is chosen to avoid extraneous
> + * #ifdefs.
> + */
> +#ifdef CONFIG_PPC_85xx
> +struct ccsr_guts_85xx {
> +#else
> +struct ccsr_guts_86xx {
> +#endif
Is there a good reason to have 2 different names for the same structure
depending on the architecture? I'd think keeping a common "ccsr_guts"
name would get rid of the ifdefs above as well as in code that can be
used on both 85xx and 86xx processors down the road.
Best,
Peter
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox