mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
[PATCH] powerpc: Remove device_node addrs/n_addr
The pre-parsed addrs/n_addrs fields in struct device_node are finally gone. Remove the dodgy heuristics that did that parsing at boot and remove the fields themselves since we now have a good replacement with the new OF parsing code. This patch also fixes a bunch of drivers to use the new code instead, so that at least pmac32, pseries, iseries and g5 defconfigs build. Signed-off-by: Benjamin Herrenschmidt <[email protected]> Signed-off-by: Paul Mackerras <[email protected]>
This commit is contained in:
parent
9cf84d7c97
commit
cc5d0189b9
31 changed files with 793 additions and 1106 deletions
|
|
@ -256,42 +256,42 @@ static int macio_resource_quirks(struct device_node *np, struct resource *res,
|
|||
{
|
||||
if (res->flags & IORESOURCE_MEM) {
|
||||
/* Grand Central has too large resource 0 on some machines */
|
||||
if (index == 0 && !strcmp(np->name, "gc")) {
|
||||
np->addrs[0].size = 0x20000;
|
||||
if (index == 0 && !strcmp(np->name, "gc"))
|
||||
res->end = res->start + 0x1ffff;
|
||||
}
|
||||
|
||||
/* Airport has bogus resource 2 */
|
||||
if (index >= 2 && !strcmp(np->name, "radio"))
|
||||
return 1;
|
||||
|
||||
#ifndef CONFIG_PPC64
|
||||
/* DBDMAs may have bogus sizes */
|
||||
if ((res->start & 0x0001f000) == 0x00008000) {
|
||||
np->addrs[index].size = 0x100;
|
||||
if ((res->start & 0x0001f000) == 0x00008000)
|
||||
res->end = res->start + 0xff;
|
||||
}
|
||||
#endif /* CONFIG_PPC64 */
|
||||
|
||||
/* ESCC parent eats child resources. We could have added a
|
||||
* level of hierarchy, but I don't really feel the need
|
||||
* for it
|
||||
*/
|
||||
if (!strcmp(np->name, "escc"))
|
||||
return 1;
|
||||
|
||||
/* ESCC has bogus resources >= 3 */
|
||||
if (index >= 3 && !(strcmp(np->name, "ch-a") &&
|
||||
strcmp(np->name, "ch-b")))
|
||||
return 1;
|
||||
|
||||
/* Media bay has too many resources, keep only first one */
|
||||
if (index > 0 && !strcmp(np->name, "media-bay"))
|
||||
return 1;
|
||||
|
||||
/* Some older IDE resources have bogus sizes */
|
||||
if (!(strcmp(np->name, "IDE") && strcmp(np->name, "ATA") &&
|
||||
strcmp(np->type, "ide") && strcmp(np->type, "ata"))) {
|
||||
if (index == 0 && np->addrs[0].size > 0x1000) {
|
||||
np->addrs[0].size = 0x1000;
|
||||
if (index == 0 && (res->end - res->start) > 0xfff)
|
||||
res->end = res->start + 0xfff;
|
||||
}
|
||||
if (index == 1 && np->addrs[1].size > 0x100) {
|
||||
np->addrs[1].size = 0x100;
|
||||
if (index == 1 && (res->end - res->start) > 0xff)
|
||||
res->end = res->start + 0xff;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -349,7 +349,7 @@ static void macio_setup_resources(struct macio_dev *dev,
|
|||
/* Currently, we consider failure as harmless, this may
|
||||
* change in the future, once I've found all the device
|
||||
* tree bugs in older machines & worked around them
|
||||
l */
|
||||
*/
|
||||
if (insert_resource(parent_res, res)) {
|
||||
printk(KERN_WARNING "Can't request resource "
|
||||
"%d for MacIO device %s\n",
|
||||
|
|
|
|||
|
|
@ -647,6 +647,7 @@ static int __devinit media_bay_attach(struct macio_dev *mdev, const struct of_de
|
|||
struct media_bay_info* bay;
|
||||
u32 __iomem *regbase;
|
||||
struct device_node *ofnode;
|
||||
unsigned long base;
|
||||
int i;
|
||||
|
||||
ofnode = mdev->ofdev.node;
|
||||
|
|
@ -656,10 +657,11 @@ static int __devinit media_bay_attach(struct macio_dev *mdev, const struct of_de
|
|||
if (macio_request_resources(mdev, "media-bay"))
|
||||
return -EBUSY;
|
||||
/* Media bay registers are located at the beginning of the
|
||||
* mac-io chip, we get the parent address for now (hrm...)
|
||||
* mac-io chip, for now, we trick and align down the first
|
||||
* resource passed in
|
||||
*/
|
||||
regbase = (u32 __iomem *)
|
||||
ioremap(ofnode->parent->addrs[0].address, 0x100);
|
||||
base = macio_resource_start(mdev, 0) & 0xffff0000u;
|
||||
regbase = (u32 __iomem *)ioremap(base, 0x100);
|
||||
if (regbase == NULL) {
|
||||
macio_release_resources(mdev);
|
||||
return -ENOMEM;
|
||||
|
|
|
|||
|
|
@ -193,10 +193,6 @@ static int __init via_cuda_start(void)
|
|||
if (via == NULL)
|
||||
return -ENODEV;
|
||||
|
||||
#ifdef CONFIG_PPC
|
||||
request_OF_resource(vias, 0, NULL);
|
||||
#endif
|
||||
|
||||
if (request_irq(CUDA_IRQ, cuda_interrupt, 0, "ADB", cuda_interrupt)) {
|
||||
printk(KERN_ERR "cuda_init: can't get irq %d\n", CUDA_IRQ);
|
||||
return -EAGAIN;
|
||||
|
|
|
|||
|
|
@ -298,7 +298,7 @@ static struct backlight_controller pmu_backlight_controller = {
|
|||
|
||||
int __init find_via_pmu(void)
|
||||
{
|
||||
phys_addr_t taddr;
|
||||
u64 taddr;
|
||||
u32 *reg;
|
||||
|
||||
if (via != 0)
|
||||
|
|
@ -337,7 +337,7 @@ int __init find_via_pmu(void)
|
|||
else if (device_is_compatible(vias->parent, "Keylargo")
|
||||
|| device_is_compatible(vias->parent, "K2-Keylargo")) {
|
||||
struct device_node *gpiop;
|
||||
phys_addr_t gaddr = 0;
|
||||
u64 gaddr = OF_BAD_ADDR;
|
||||
|
||||
pmu_kind = PMU_KEYLARGO_BASED;
|
||||
pmu_has_adb = (find_type_devices("adb") != NULL);
|
||||
|
|
@ -352,7 +352,7 @@ int __init find_via_pmu(void)
|
|||
reg = (u32 *)get_property(gpiop, "reg", NULL);
|
||||
if (reg)
|
||||
gaddr = of_translate_address(gpiop, reg);
|
||||
if (gaddr != 0)
|
||||
if (gaddr != OF_BAD_ADDR)
|
||||
gpio_reg = ioremap(gaddr, 0x10);
|
||||
}
|
||||
if (gpio_reg == NULL)
|
||||
|
|
@ -479,9 +479,6 @@ static int __init via_pmu_dev_init(void)
|
|||
if (vias == NULL)
|
||||
return -ENODEV;
|
||||
|
||||
#ifndef CONFIG_PPC64
|
||||
request_OF_resource(vias, 0, NULL);
|
||||
#endif
|
||||
#ifdef CONFIG_PMAC_BACKLIGHT
|
||||
/* Enable backlight */
|
||||
register_backlight_controller(&pmu_backlight_controller, NULL, "pmu");
|
||||
|
|
|
|||
Loading…
Reference in a new issue