git.openpandora.org
/
pandora-kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
[pandora-kernel.git]
/
arch
/
sparc64
/
kernel
/
of_device.c
diff --git
a/arch/sparc64/kernel/of_device.c
b/arch/sparc64/kernel/of_device.c
index
4fd48ab
..
100ebd5
100644
(file)
--- a/
arch/sparc64/kernel/of_device.c
+++ b/
arch/sparc64/kernel/of_device.c
@@
-56,9
+56,6
@@
struct of_device *of_find_device_by_node(struct device_node *dp)
EXPORT_SYMBOL(of_find_device_by_node);
#ifdef CONFIG_PCI
EXPORT_SYMBOL(of_find_device_by_node);
#ifdef CONFIG_PCI
-struct bus_type isa_bus_type;
-EXPORT_SYMBOL(isa_bus_type);
-
struct bus_type ebus_bus_type;
EXPORT_SYMBOL(ebus_bus_type);
#endif
struct bus_type ebus_bus_type;
EXPORT_SYMBOL(ebus_bus_type);
#endif
@@
-99,7
+96,7
@@
struct of_bus {
int *addrc, int *sizec);
int (*map)(u32 *addr, const u32 *range,
int na, int ns, int pna);
int *addrc, int *sizec);
int (*map)(u32 *addr, const u32 *range,
int na, int ns, int pna);
- unsigned
int (*get_flags)(const u32 *addr
);
+ unsigned
long (*get_flags)(const u32 *addr, unsigned long
);
};
/*
};
/*
@@
-159,8
+156,10
@@
static int of_bus_default_map(u32 *addr, const u32 *range,
return 0;
}
return 0;
}
-static unsigned
int of_bus_default_get_flags(const u32 *addr
)
+static unsigned
long of_bus_default_get_flags(const u32 *addr, unsigned long flags
)
{
{
+ if (flags)
+ return flags;
return IORESOURCE_MEM;
}
return IORESOURCE_MEM;
}
@@
-170,7
+169,7
@@
static unsigned int of_bus_default_get_flags(const u32 *addr)
static int of_bus_pci_match(struct device_node *np)
{
static int of_bus_pci_match(struct device_node *np)
{
- if (!strcmp(np->
type, "pci") || !strcmp(np->type, "pciex
")) {
+ if (!strcmp(np->
name, "pci
")) {
const char *model = of_get_property(np, "model", NULL);
if (model && !strcmp(model, "SUNW,simba"))
const char *model = of_get_property(np, "model", NULL);
if (model && !strcmp(model, "SUNW,simba"))
@@
-201,7
+200,7
@@
static int of_bus_simba_match(struct device_node *np)
/* Treat PCI busses lacking ranges property just like
* simba.
*/
/* Treat PCI busses lacking ranges property just like
* simba.
*/
- if (!strcmp(np->
type, "pci") || !strcmp(np->type, "pciex
")) {
+ if (!strcmp(np->
name, "pci
")) {
if (!of_find_property(np, "ranges", NULL))
return 1;
}
if (!of_find_property(np, "ranges", NULL))
return 1;
}
@@
-252,17
+251,21
@@
static int of_bus_pci_map(u32 *addr, const u32 *range,
return 0;
}
return 0;
}
-static unsigned
int of_bus_pci_get_flags(const u32 *addr
)
+static unsigned
long of_bus_pci_get_flags(const u32 *addr, unsigned long flags
)
{
{
- unsigned int flags = 0;
u32 w = addr[0];
u32 w = addr[0];
+ /* For PCI, we override whatever child busses may have used. */
+ flags = 0;
switch((w >> 24) & 0x03) {
case 0x01:
flags |= IORESOURCE_IO;
switch((w >> 24) & 0x03) {
case 0x01:
flags |= IORESOURCE_IO;
+ break;
+
case 0x02: /* 32 bits */
case 0x03: /* 64 bits */
flags |= IORESOURCE_MEM;
case 0x02: /* 32 bits */
case 0x03: /* 64 bits */
flags |= IORESOURCE_MEM;
+ break;
}
if (w & 0x40000000)
flags |= IORESOURCE_PREFETCH;
}
if (w & 0x40000000)
flags |= IORESOURCE_PREFETCH;
@@
-426,7
+429,7
@@
static int __init use_1to1_mapping(struct device_node *pp)
* it lacks a ranges property, and this will include
* cases like Simba.
*/
* it lacks a ranges property, and this will include
* cases like Simba.
*/
- if (!strcmp(pp->
type, "pci") || !strcmp(pp->type, "pciex
"))
+ if (!strcmp(pp->
name, "pci
"))
return 0;
return 1;
return 0;
return 1;
@@
-481,10
+484,10
@@
static void __init build_device_resources(struct of_device *op,
int pna, pns;
size = of_read_addr(reg + na, ns);
int pna, pns;
size = of_read_addr(reg + na, ns);
- flags = bus->get_flags(reg);
-
memcpy(addr, reg, na * 4);
memcpy(addr, reg, na * 4);
+ flags = bus->get_flags(addr, 0);
+
if (use_1to1_mapping(pp)) {
result = of_read_addr(addr, na);
goto build_res;
if (use_1to1_mapping(pp)) {
result = of_read_addr(addr, na);
goto build_res;
@@
-509,6
+512,8
@@
static void __init build_device_resources(struct of_device *op,
dna, dns, pna))
break;
dna, dns, pna))
break;
+ flags = pbus->get_flags(addr, flags);
+
dna = pna;
dns = pns;
dbus = pbus;
dna = pna;
dns = pns;
dbus = pbus;
@@
-709,8
+714,7
@@
static unsigned int __init build_one_device_irq(struct of_device *op,
break;
}
} else {
break;
}
} else {
- if (!strcmp(pp->type, "pci") ||
- !strcmp(pp->type, "pciex")) {
+ if (!strcmp(pp->name, "pci")) {
unsigned int this_orig_irq = irq;
irq = pci_irq_swizzle(dp, pp, irq);
unsigned int this_orig_irq = irq;
irq = pci_irq_swizzle(dp, pp, irq);
@@
-841,8
+845,6
@@
static int __init of_bus_driver_init(void)
err = of_bus_type_init(&of_platform_bus_type, "of");
#ifdef CONFIG_PCI
err = of_bus_type_init(&of_platform_bus_type, "of");
#ifdef CONFIG_PCI
- if (!err)
- err = of_bus_type_init(&isa_bus_type, "isa");
if (!err)
err = of_bus_type_init(&ebus_bus_type, "ebus");
#endif
if (!err)
err = of_bus_type_init(&ebus_bus_type, "ebus");
#endif