aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-sparc64
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2006-06-22 22:12:03 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-06-24 02:15:28 -0400
commit690c8fd31f1e35985d0f35772fde514da59ec9d1 (patch)
tree8a5a0036b3780a9eb315ea2201a2562570de1ebe /include/asm-sparc64
parentde8d28b16f5614aeb12bb69c8f9a38578b8d3ada (diff)
[SPARC64]: Use in-kernel PROM tree for EBUS and ISA.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/asm-sparc64')
-rw-r--r--include/asm-sparc64/ebus.h10
-rw-r--r--include/asm-sparc64/floppy.h27
-rw-r--r--include/asm-sparc64/isa.h8
-rw-r--r--include/asm-sparc64/parport.h25
4 files changed, 32 insertions, 38 deletions
diff --git a/include/asm-sparc64/ebus.h b/include/asm-sparc64/ebus.h
index 7a408a030f52..876912f4d83b 100644
--- a/include/asm-sparc64/ebus.h
+++ b/include/asm-sparc64/ebus.h
@@ -10,13 +10,13 @@
10 10
11#include <asm/pbm.h> 11#include <asm/pbm.h>
12#include <asm/oplib.h> 12#include <asm/oplib.h>
13#include <asm/prom.h>
13 14
14struct linux_ebus_child { 15struct linux_ebus_child {
15 struct linux_ebus_child *next; 16 struct linux_ebus_child *next;
16 struct linux_ebus_device *parent; 17 struct linux_ebus_device *parent;
17 struct linux_ebus *bus; 18 struct linux_ebus *bus;
18 int prom_node; 19 struct device_node *prom_node;
19 char prom_name[64];
20 struct resource resource[PROMREG_MAX]; 20 struct resource resource[PROMREG_MAX];
21 int num_addrs; 21 int num_addrs;
22 unsigned int irqs[PROMINTR_MAX]; 22 unsigned int irqs[PROMINTR_MAX];
@@ -27,8 +27,7 @@ struct linux_ebus_device {
27 struct linux_ebus_device *next; 27 struct linux_ebus_device *next;
28 struct linux_ebus_child *children; 28 struct linux_ebus_child *children;
29 struct linux_ebus *bus; 29 struct linux_ebus *bus;
30 int prom_node; 30 struct device_node *prom_node;
31 char prom_name[64];
32 struct resource resource[PROMREG_MAX]; 31 struct resource resource[PROMREG_MAX];
33 int num_addrs; 32 int num_addrs;
34 unsigned int irqs[PROMINTR_MAX]; 33 unsigned int irqs[PROMINTR_MAX];
@@ -42,8 +41,7 @@ struct linux_ebus {
42 struct pci_dev *self; 41 struct pci_dev *self;
43 int index; 42 int index;
44 int is_rio; 43 int is_rio;
45 int prom_node; 44 struct device_node *prom_node;
46 char prom_name[64];
47 struct linux_prom_ebus_ranges ebus_ranges[PROMREG_MAX]; 45 struct linux_prom_ebus_ranges ebus_ranges[PROMREG_MAX];
48 int num_ebus_ranges; 46 int num_ebus_ranges;
49 struct linux_prom_ebus_intmap ebus_intmap[PROMREG_MAX]; 47 struct linux_prom_ebus_intmap ebus_intmap[PROMREG_MAX];
diff --git a/include/asm-sparc64/floppy.h b/include/asm-sparc64/floppy.h
index 07ccd6f04b52..f8d57bb5570c 100644
--- a/include/asm-sparc64/floppy.h
+++ b/include/asm-sparc64/floppy.h
@@ -498,15 +498,14 @@ static int sun_pci_fd_test_drive(unsigned long port, int drive)
498#ifdef CONFIG_PCI 498#ifdef CONFIG_PCI
499static int __init ebus_fdthree_p(struct linux_ebus_device *edev) 499static int __init ebus_fdthree_p(struct linux_ebus_device *edev)
500{ 500{
501 if (!strcmp(edev->prom_name, "fdthree")) 501 if (!strcmp(edev->prom_node->name, "fdthree"))
502 return 1; 502 return 1;
503 if (!strcmp(edev->prom_name, "floppy")) { 503 if (!strcmp(edev->prom_node->name, "floppy")) {
504 char compat[16]; 504 char *compat;
505 prom_getstring(edev->prom_node, 505
506 "compatible", 506 compat = of_get_property(edev->prom_node,
507 compat, sizeof(compat)); 507 "compatible", NULL);
508 compat[15] = '\0'; 508 if (compat && !strcmp(compat, "fdthree"))
509 if (!strcmp(compat, "fdthree"))
510 return 1; 509 return 1;
511 } 510 }
512 return 0; 511 return 0;
@@ -524,12 +523,12 @@ static unsigned long __init isa_floppy_init(void)
524 523
525 for_each_isa(isa_br) { 524 for_each_isa(isa_br) {
526 for_each_isadev(isa_dev, isa_br) { 525 for_each_isadev(isa_dev, isa_br) {
527 if (!strcmp(isa_dev->prom_name, "dma")) { 526 if (!strcmp(isa_dev->prom_node->name, "dma")) {
528 struct sparc_isa_device *child = 527 struct sparc_isa_device *child =
529 isa_dev->child; 528 isa_dev->child;
530 529
531 while (child) { 530 while (child) {
532 if (!strcmp(child->prom_name, 531 if (!strcmp(child->prom_node->name,
533 "floppy")) { 532 "floppy")) {
534 isa_dev = child; 533 isa_dev = child;
535 goto isa_done; 534 goto isa_done;
@@ -614,6 +613,7 @@ static unsigned long __init sun_floppy_init(void)
614 struct linux_ebus_device *edev = NULL; 613 struct linux_ebus_device *edev = NULL;
615 unsigned long config = 0; 614 unsigned long config = 0;
616 void __iomem *auxio_reg; 615 void __iomem *auxio_reg;
616 char *state_prop;
617 617
618 for_each_ebus(ebus) { 618 for_each_ebus(ebus) {
619 for_each_ebusdev(edev, ebus) { 619 for_each_ebusdev(edev, ebus) {
@@ -630,9 +630,8 @@ static unsigned long __init sun_floppy_init(void)
630#endif 630#endif
631 } 631 }
632 632
633 prom_getproperty(edev->prom_node, "status", 633 state_prop = of_get_property(edev->prom_node, "status", NULL);
634 state, sizeof(state)); 634 if (state_prop && !strncmp(state_prop, "disabled", 8))
635 if (!strncmp(state, "disabled", 8))
636 return 0; 635 return 0;
637 636
638 FLOPPY_IRQ = edev->irqs[0]; 637 FLOPPY_IRQ = edev->irqs[0];
@@ -703,7 +702,7 @@ static unsigned long __init sun_floppy_init(void)
703 */ 702 */
704 for_each_ebus(ebus) { 703 for_each_ebus(ebus) {
705 for_each_ebusdev(edev, ebus) { 704 for_each_ebusdev(edev, ebus) {
706 if (!strcmp(edev->prom_name, "ecpp")) { 705 if (!strcmp(edev->prom_node->name, "ecpp")) {
707 config = edev->resource[1].start; 706 config = edev->resource[1].start;
708 goto config_done; 707 goto config_done;
709 } 708 }
diff --git a/include/asm-sparc64/isa.h b/include/asm-sparc64/isa.h
index 4601bbfc3e7b..e110435b14ef 100644
--- a/include/asm-sparc64/isa.h
+++ b/include/asm-sparc64/isa.h
@@ -9,6 +9,7 @@
9 9
10#include <asm/pbm.h> 10#include <asm/pbm.h>
11#include <asm/oplib.h> 11#include <asm/oplib.h>
12#include <asm/prom.h>
12 13
13struct sparc_isa_bridge; 14struct sparc_isa_bridge;
14 15
@@ -16,9 +17,7 @@ struct sparc_isa_device {
16 struct sparc_isa_device *next; 17 struct sparc_isa_device *next;
17 struct sparc_isa_device *child; 18 struct sparc_isa_device *child;
18 struct sparc_isa_bridge *bus; 19 struct sparc_isa_bridge *bus;
19 int prom_node; 20 struct device_node *prom_node;
20 char prom_name[64];
21 char compatible[64];
22 struct resource resource; 21 struct resource resource;
23 unsigned int irq; 22 unsigned int irq;
24}; 23};
@@ -29,8 +28,7 @@ struct sparc_isa_bridge {
29 struct pci_pbm_info *parent; 28 struct pci_pbm_info *parent;
30 struct pci_dev *self; 29 struct pci_dev *self;
31 int index; 30 int index;
32 int prom_node; 31 struct device_node *prom_node;
33 char prom_name[64];
34#define linux_prom_isa_ranges linux_prom_ebus_ranges 32#define linux_prom_isa_ranges linux_prom_ebus_ranges
35 struct linux_prom_isa_ranges isa_ranges[PROMREG_MAX]; 33 struct linux_prom_isa_ranges isa_ranges[PROMREG_MAX];
36 int num_isa_ranges; 34 int num_isa_ranges;
diff --git a/include/asm-sparc64/parport.h b/include/asm-sparc64/parport.h
index 56b5197d7898..d3895873e4c7 100644
--- a/include/asm-sparc64/parport.h
+++ b/include/asm-sparc64/parport.h
@@ -67,18 +67,17 @@ static __inline__ unsigned int get_dma_residue(unsigned int dmanr)
67 67
68static int ebus_ecpp_p(struct linux_ebus_device *edev) 68static int ebus_ecpp_p(struct linux_ebus_device *edev)
69{ 69{
70 if (!strcmp(edev->prom_name, "ecpp")) 70 if (!strcmp(edev->prom_node->name, "ecpp"))
71 return 1; 71 return 1;
72 if (!strcmp(edev->prom_name, "parallel")) { 72 if (!strcmp(edev->prom_node->name, "parallel")) {
73 char compat[19]; 73 char *compat;
74 prom_getstring(edev->prom_node, 74
75 "compatible", 75 compat = of_get_property(edev->prom_node,
76 compat, sizeof(compat)); 76 "compatible", NULL);
77 compat[18] = '\0'; 77 if (compat &&
78 if (!strcmp(compat, "ecpp")) 78 (!strcmp(compat, "ecpp") ||
79 return 1; 79 !strcmp(compat, "ns87317-ecpp") ||
80 if (!strcmp(compat, "ns87317-ecpp") && 80 !strcmp(compat + 13, "ecpp")))
81 !strcmp(compat + 13, "ecpp"))
82 return 1; 81 return 1;
83 } 82 }
84 return 0; 83 return 0;
@@ -94,12 +93,12 @@ static int parport_isa_probe(int count)
94 struct sparc_isa_device *child; 93 struct sparc_isa_device *child;
95 unsigned long base; 94 unsigned long base;
96 95
97 if (strcmp(isa_dev->prom_name, "dma")) 96 if (strcmp(isa_dev->prom_node->name, "dma"))
98 continue; 97 continue;
99 98
100 child = isa_dev->child; 99 child = isa_dev->child;
101 while (child) { 100 while (child) {
102 if (!strcmp(child->prom_name, "parallel")) 101 if (!strcmp(child->prom_node->name, "parallel"))
103 break; 102 break;
104 child = child->next; 103 child = child->next;
105 } 104 }