[SPARC64]: Kill ebus/isa range and interrupt mapping struct members.

Unused outside of initial bus probe scan.

Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
David S. Miller 2006-06-22 19:31:11 -07:00
parent 690c8fd31f
commit 9c10a58ed6
4 changed files with 41 additions and 105 deletions

View File

@ -283,60 +283,32 @@ static inline void *ebus_alloc(size_t size)
return mem; return mem;
} }
static void __init ebus_ranges_init(struct linux_ebus *ebus)
{
struct linux_prom_ebus_ranges *rngs;
int len;
ebus->num_ebus_ranges = 0;
rngs = of_get_property(ebus->prom_node, "ranges", &len);
if (rngs) {
memcpy(ebus->ebus_ranges, rngs, len);
ebus->num_ebus_ranges =
(len / sizeof(struct linux_prom_ebus_ranges));
}
}
static void __init ebus_intmap_init(struct linux_ebus *ebus)
{
struct linux_prom_ebus_intmap *imap;
struct linux_prom_ebus_intmask *imask;
int len;
ebus->num_ebus_intmap = 0;
imap = of_get_property(ebus->prom_node, "interrupt-map", &len);
if (!imap)
return;
memcpy(ebus->ebus_intmap, imap, len);
ebus->num_ebus_intmap = (len / sizeof(struct linux_prom_ebus_intmap));
imask = of_get_property(ebus->prom_node, "interrupt-map-mask", &len);
if (!imask) {
prom_printf("EBUS: can't get interrupt-map-mask\n");
prom_halt();
}
memcpy(&ebus->ebus_intmask, imask, sizeof(ebus->ebus_intmask));
}
int __init ebus_intmap_match(struct linux_ebus *ebus, int __init ebus_intmap_match(struct linux_ebus *ebus,
struct linux_prom_registers *reg, struct linux_prom_registers *reg,
int *interrupt) int *interrupt)
{ {
struct linux_prom_ebus_intmap *imap;
struct linux_prom_ebus_intmask *imask;
unsigned int hi, lo, irq; unsigned int hi, lo, irq;
int i; int i, len, n_imap;
if (!ebus->num_ebus_intmap) imap = of_get_property(ebus->prom_node, "interrupt-map", &len);
if (!imap)
return 0;
n_imap = len / sizeof(imap[0]);
imask = of_get_property(ebus->prom_node, "interrupt-map-mask", NULL);
if (!imask)
return 0; return 0;
hi = reg->which_io & ebus->ebus_intmask.phys_hi; hi = reg->which_io & imask->phys_hi;
lo = reg->phys_addr & ebus->ebus_intmask.phys_lo; lo = reg->phys_addr & imask->phys_lo;
irq = *interrupt & ebus->ebus_intmask.interrupt; irq = *interrupt & imask->interrupt;
for (i = 0; i < ebus->num_ebus_intmap; i++) { for (i = 0; i < n_imap; i++) {
if ((ebus->ebus_intmap[i].phys_hi == hi) && if ((imap[i].phys_hi == hi) &&
(ebus->ebus_intmap[i].phys_lo == lo) && (imap[i].phys_lo == lo) &&
(ebus->ebus_intmap[i].interrupt == irq)) { (imap[i].interrupt == irq)) {
*interrupt = ebus->ebus_intmap[i].cinterrupt; *interrupt = imap[i].cinterrupt;
return 0; return 0;
} }
} }
@ -598,9 +570,6 @@ void __init ebus_init(void)
ebus->self = pdev; ebus->self = pdev;
ebus->parent = pbm = cookie->pbm; ebus->parent = pbm = cookie->pbm;
ebus_ranges_init(ebus);
ebus_intmap_init(ebus);
child = dp->child; child = dp->child;
if (!child) if (!child)
goto next_ebus; goto next_ebus;

View File

@ -72,19 +72,30 @@ static struct {
static int __init isa_dev_get_irq_using_imap(struct sparc_isa_device *isa_dev, static int __init isa_dev_get_irq_using_imap(struct sparc_isa_device *isa_dev,
struct sparc_isa_bridge *isa_br, struct sparc_isa_bridge *isa_br,
int *interrupt, int *interrupt,
struct linux_prom_registers *pregs) struct linux_prom_registers *reg)
{ {
struct linux_prom_ebus_intmap *imap;
struct linux_prom_ebus_intmap *imask;
unsigned int hi, lo, irq; unsigned int hi, lo, irq;
int i; int i, len, n_imap;
hi = pregs->which_io & isa_br->isa_intmask.phys_hi; imap = of_get_property(isa_br->prom_node, "interrupt-map", &len);
lo = pregs->phys_addr & isa_br->isa_intmask.phys_lo; if (!imap)
irq = *interrupt & isa_br->isa_intmask.interrupt; return 0;
for (i = 0; i < isa_br->num_isa_intmap; i++) { n_imap = len / sizeof(imap[0]);
if ((isa_br->isa_intmap[i].phys_hi == hi) &&
(isa_br->isa_intmap[i].phys_lo == lo) && imask = of_get_property(isa_br->prom_node, "interrupt-map-mask", NULL);
(isa_br->isa_intmap[i].interrupt == irq)) { if (!imask)
*interrupt = isa_br->isa_intmap[i].cinterrupt; return 0;
hi = reg->which_io & imask->phys_hi;
lo = reg->phys_addr & imask->phys_lo;
irq = *interrupt & imask->interrupt;
for (i = 0; i < n_imap; i++) {
if ((imap[i].phys_hi == hi) &&
(imap[i].phys_lo == lo) &&
(imap[i].interrupt == irq)) {
*interrupt = imap[i].cinterrupt;
return 0; return 0;
} }
} }
@ -105,7 +116,8 @@ static void __init isa_dev_get_irq(struct sparc_isa_device *isa_dev,
struct pci_pbm_info *pbm; struct pci_pbm_info *pbm;
int i; int i;
if (isa_dev->bus->num_isa_intmap) { if (of_find_property(isa_dev->bus->prom_node,
"interrupt-map", NULL)) {
if (!isa_dev_get_irq_using_imap(isa_dev, if (!isa_dev_get_irq_using_imap(isa_dev,
isa_dev->bus, isa_dev->bus,
&irq_prop, &irq_prop,
@ -218,36 +230,6 @@ static void __init isa_fill_devices(struct sparc_isa_bridge *isa_br)
} }
} }
static void __init get_bridge_props(struct sparc_isa_bridge *isa_br)
{
struct device_node *dp = isa_br->prom_node;
void *pval;
int len;
pval = of_get_property(dp, "ranges", &len);
if (pval) {
memcpy(isa_br->isa_ranges, pval, len);
isa_br->num_isa_ranges =
len / sizeof(struct linux_prom_isa_ranges);
} else {
isa_br->num_isa_ranges = 0;
}
pval = of_get_property(dp, "interrupt-map", &len);
if (pval) {
memcpy(isa_br->isa_intmap, pval, len);
isa_br->num_isa_intmap =
(len / sizeof(struct linux_prom_isa_intmap));
} else {
isa_br->num_isa_intmap = 0;
}
pval = of_get_property(dp, "interrupt-map-mask", &len);
if (pval)
memcpy(&isa_br->isa_intmask, pval,
sizeof(isa_br->isa_intmask));
}
void __init isa_init(void) void __init isa_init(void)
{ {
struct pci_dev *pdev; struct pci_dev *pdev;
@ -288,8 +270,6 @@ void __init isa_init(void)
isa_br->index = index++; isa_br->index = index++;
isa_br->prom_node = pdev_cookie->prom_node; isa_br->prom_node = pdev_cookie->prom_node;
get_bridge_props(isa_br);
printk("isa%d:", isa_br->index); printk("isa%d:", isa_br->index);
isa_fill_devices(isa_br); isa_fill_devices(isa_br);

View File

@ -42,11 +42,6 @@ struct linux_ebus {
int index; int index;
int is_rio; int is_rio;
struct device_node *prom_node; struct device_node *prom_node;
struct linux_prom_ebus_ranges ebus_ranges[PROMREG_MAX];
int num_ebus_ranges;
struct linux_prom_ebus_intmap ebus_intmap[PROMREG_MAX];
int num_ebus_intmap;
struct linux_prom_ebus_intmask ebus_intmask;
}; };
struct ebus_dma_info { struct ebus_dma_info {

View File

@ -29,14 +29,6 @@ struct sparc_isa_bridge {
struct pci_dev *self; struct pci_dev *self;
int index; int index;
struct device_node *prom_node; struct device_node *prom_node;
#define linux_prom_isa_ranges linux_prom_ebus_ranges
struct linux_prom_isa_ranges isa_ranges[PROMREG_MAX];
int num_isa_ranges;
#define linux_prom_isa_intmap linux_prom_ebus_intmap
struct linux_prom_isa_intmap isa_intmap[PROMREG_MAX];
int num_isa_intmap;
#define linux_prom_isa_intmask linux_prom_ebus_intmask
struct linux_prom_isa_intmap isa_intmask;
}; };
extern struct sparc_isa_bridge *isa_chain; extern struct sparc_isa_bridge *isa_chain;