diff options
author | Kim Phillips <kim.phillips@freescale.com> | 2006-08-25 12:59:22 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-08-29 20:34:33 -0400 |
commit | f1f17716d13bfb709809a3f5c84bda105b646b9e (patch) | |
tree | 1d8c9f4905ccb21b4cc91386fd3dca3e9697e25d /arch/powerpc/platforms/83xx | |
parent | b9f0f1bb2bcaae96dd3267f6bd3ad1ca44a1f5ad (diff) |
[POWERPC] modify mpc83xx platforms to use new IRQ layer
This fixes MPC834x MDS (formerly SYS) and ITX platform code to get IRQ data (including PCI) from the device tree, and to use the new IPIC code.
renamed defconfig (sys -> mds), left one redundant NULL assignment in mpc83xx_pcibios_fixup to keep the compiler happy.
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Li Yang <leoli@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/platforms/83xx')
-rw-r--r-- | arch/powerpc/platforms/83xx/mpc834x_itx.c | 49 | ||||
-rw-r--r-- | arch/powerpc/platforms/83xx/mpc834x_sys.c | 56 | ||||
-rw-r--r-- | arch/powerpc/platforms/83xx/mpc83xx.h | 1 | ||||
-rw-r--r-- | arch/powerpc/platforms/83xx/pci.c | 9 |
4 files changed, 28 insertions, 87 deletions
diff --git a/arch/powerpc/platforms/83xx/mpc834x_itx.c b/arch/powerpc/platforms/83xx/mpc834x_itx.c index b46305645d38..cf3967a66fb5 100644 --- a/arch/powerpc/platforms/83xx/mpc834x_itx.c +++ b/arch/powerpc/platforms/83xx/mpc834x_itx.c | |||
@@ -46,26 +46,6 @@ unsigned long isa_io_base = 0; | |||
46 | unsigned long isa_mem_base = 0; | 46 | unsigned long isa_mem_base = 0; |
47 | #endif | 47 | #endif |
48 | 48 | ||
49 | #ifdef CONFIG_PCI | ||
50 | static int | ||
51 | mpc83xx_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin) | ||
52 | { | ||
53 | static char pci_irq_table[][4] = | ||
54 | /* | ||
55 | * PCI IDSEL/INTPIN->INTLINE | ||
56 | * A B C D | ||
57 | */ | ||
58 | { | ||
59 | {PIRQB, PIRQC, PIRQD, PIRQA}, /* idsel 0x0e */ | ||
60 | {PIRQA, PIRQB, PIRQC, PIRQD}, /* idsel 0x0f */ | ||
61 | {PIRQC, PIRQD, PIRQA, PIRQB}, /* idsel 0x10 */ | ||
62 | }; | ||
63 | |||
64 | const long min_idsel = 0x0e, max_idsel = 0x10, irqs_per_slot = 4; | ||
65 | return PCI_IRQ_TABLE_LOOKUP; | ||
66 | } | ||
67 | #endif /* CONFIG_PCI */ | ||
68 | |||
69 | /* ************************************************************************ | 49 | /* ************************************************************************ |
70 | * | 50 | * |
71 | * Setup the architecture | 51 | * Setup the architecture |
@@ -92,8 +72,6 @@ static void __init mpc834x_itx_setup_arch(void) | |||
92 | for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;) | 72 | for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;) |
93 | add_bridge(np); | 73 | add_bridge(np); |
94 | 74 | ||
95 | ppc_md.pci_swizzle = common_swizzle; | ||
96 | ppc_md.pci_map_irq = mpc83xx_map_irq; | ||
97 | ppc_md.pci_exclude_device = mpc83xx_exclude_device; | 75 | ppc_md.pci_exclude_device = mpc83xx_exclude_device; |
98 | #endif | 76 | #endif |
99 | 77 | ||
@@ -106,25 +84,13 @@ static void __init mpc834x_itx_setup_arch(void) | |||
106 | 84 | ||
107 | void __init mpc834x_itx_init_IRQ(void) | 85 | void __init mpc834x_itx_init_IRQ(void) |
108 | { | 86 | { |
109 | u8 senses[8] = { | 87 | struct device_node *np; |
110 | 0, /* EXT 0 */ | 88 | |
111 | IRQ_SENSE_LEVEL, /* EXT 1 */ | 89 | np = of_find_node_by_type(NULL, "ipic"); |
112 | IRQ_SENSE_LEVEL, /* EXT 2 */ | 90 | if (!np) |
113 | 0, /* EXT 3 */ | 91 | return; |
114 | #ifdef CONFIG_PCI | ||
115 | IRQ_SENSE_LEVEL, /* EXT 4 */ | ||
116 | IRQ_SENSE_LEVEL, /* EXT 5 */ | ||
117 | IRQ_SENSE_LEVEL, /* EXT 6 */ | ||
118 | IRQ_SENSE_LEVEL, /* EXT 7 */ | ||
119 | #else | ||
120 | 0, /* EXT 4 */ | ||
121 | 0, /* EXT 5 */ | ||
122 | 0, /* EXT 6 */ | ||
123 | 0, /* EXT 7 */ | ||
124 | #endif | ||
125 | }; | ||
126 | 92 | ||
127 | ipic_init(get_immrbase() + 0x00700, 0, 0, senses, 8); | 93 | ipic_init(np, 0); |
128 | 94 | ||
129 | /* Initialize the default interrupt mapping priorities, | 95 | /* Initialize the default interrupt mapping priorities, |
130 | * in case the boot rom changed something on us. | 96 | * in case the boot rom changed something on us. |
@@ -153,4 +119,7 @@ define_machine(mpc834x_itx) { | |||
153 | .time_init = mpc83xx_time_init, | 119 | .time_init = mpc83xx_time_init, |
154 | .calibrate_decr = generic_calibrate_decr, | 120 | .calibrate_decr = generic_calibrate_decr, |
155 | .progress = udbg_progress, | 121 | .progress = udbg_progress, |
122 | #ifdef CONFIG_PCI | ||
123 | .pcibios_fixup = mpc83xx_pcibios_fixup, | ||
124 | #endif | ||
156 | }; | 125 | }; |
diff --git a/arch/powerpc/platforms/83xx/mpc834x_sys.c b/arch/powerpc/platforms/83xx/mpc834x_sys.c index 3e1c16eb4a63..32df239d1c48 100644 --- a/arch/powerpc/platforms/83xx/mpc834x_sys.c +++ b/arch/powerpc/platforms/83xx/mpc834x_sys.c | |||
@@ -43,33 +43,6 @@ unsigned long isa_io_base = 0; | |||
43 | unsigned long isa_mem_base = 0; | 43 | unsigned long isa_mem_base = 0; |
44 | #endif | 44 | #endif |
45 | 45 | ||
46 | #ifdef CONFIG_PCI | ||
47 | static int | ||
48 | mpc83xx_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin) | ||
49 | { | ||
50 | static char pci_irq_table[][4] = | ||
51 | /* | ||
52 | * PCI IDSEL/INTPIN->INTLINE | ||
53 | * A B C D | ||
54 | */ | ||
55 | { | ||
56 | {PIRQA, PIRQB, PIRQC, PIRQD}, /* idsel 0x11 */ | ||
57 | {PIRQC, PIRQD, PIRQA, PIRQB}, /* idsel 0x12 */ | ||
58 | {PIRQD, PIRQA, PIRQB, PIRQC}, /* idsel 0x13 */ | ||
59 | {0, 0, 0, 0}, | ||
60 | {PIRQA, PIRQB, PIRQC, PIRQD}, /* idsel 0x15 */ | ||
61 | {PIRQD, PIRQA, PIRQB, PIRQC}, /* idsel 0x16 */ | ||
62 | {PIRQC, PIRQD, PIRQA, PIRQB}, /* idsel 0x17 */ | ||
63 | {PIRQB, PIRQC, PIRQD, PIRQA}, /* idsel 0x18 */ | ||
64 | {0, 0, 0, 0}, /* idsel 0x19 */ | ||
65 | {0, 0, 0, 0}, /* idsel 0x20 */ | ||
66 | }; | ||
67 | |||
68 | const long min_idsel = 0x11, max_idsel = 0x20, irqs_per_slot = 4; | ||
69 | return PCI_IRQ_TABLE_LOOKUP; | ||
70 | } | ||
71 | #endif /* CONFIG_PCI */ | ||
72 | |||
73 | /* ************************************************************************ | 46 | /* ************************************************************************ |
74 | * | 47 | * |
75 | * Setup the architecture | 48 | * Setup the architecture |
@@ -96,8 +69,6 @@ static void __init mpc834x_sys_setup_arch(void) | |||
96 | for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;) | 69 | for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;) |
97 | add_bridge(np); | 70 | add_bridge(np); |
98 | 71 | ||
99 | ppc_md.pci_swizzle = common_swizzle; | ||
100 | ppc_md.pci_map_irq = mpc83xx_map_irq; | ||
101 | ppc_md.pci_exclude_device = mpc83xx_exclude_device; | 72 | ppc_md.pci_exclude_device = mpc83xx_exclude_device; |
102 | #endif | 73 | #endif |
103 | 74 | ||
@@ -110,25 +81,13 @@ static void __init mpc834x_sys_setup_arch(void) | |||
110 | 81 | ||
111 | void __init mpc834x_sys_init_IRQ(void) | 82 | void __init mpc834x_sys_init_IRQ(void) |
112 | { | 83 | { |
113 | u8 senses[8] = { | 84 | struct device_node *np; |
114 | 0, /* EXT 0 */ | 85 | |
115 | IRQ_SENSE_LEVEL, /* EXT 1 */ | 86 | np = of_find_node_by_type(NULL, "ipic"); |
116 | IRQ_SENSE_LEVEL, /* EXT 2 */ | 87 | if (!np) |
117 | 0, /* EXT 3 */ | 88 | return; |
118 | #ifdef CONFIG_PCI | ||
119 | IRQ_SENSE_LEVEL, /* EXT 4 */ | ||
120 | IRQ_SENSE_LEVEL, /* EXT 5 */ | ||
121 | IRQ_SENSE_LEVEL, /* EXT 6 */ | ||
122 | IRQ_SENSE_LEVEL, /* EXT 7 */ | ||
123 | #else | ||
124 | 0, /* EXT 4 */ | ||
125 | 0, /* EXT 5 */ | ||
126 | 0, /* EXT 6 */ | ||
127 | 0, /* EXT 7 */ | ||
128 | #endif | ||
129 | }; | ||
130 | 89 | ||
131 | ipic_init(get_immrbase() + 0x00700, 0, 0, senses, 8); | 90 | ipic_init(np, 0); |
132 | 91 | ||
133 | /* Initialize the default interrupt mapping priorities, | 92 | /* Initialize the default interrupt mapping priorities, |
134 | * in case the boot rom changed something on us. | 93 | * in case the boot rom changed something on us. |
@@ -178,4 +137,7 @@ define_machine(mpc834x_sys) { | |||
178 | .time_init = mpc83xx_time_init, | 137 | .time_init = mpc83xx_time_init, |
179 | .calibrate_decr = generic_calibrate_decr, | 138 | .calibrate_decr = generic_calibrate_decr, |
180 | .progress = udbg_progress, | 139 | .progress = udbg_progress, |
140 | #ifdef CONFIG_PCI | ||
141 | .pcibios_fixup = mpc83xx_pcibios_fixup, | ||
142 | #endif | ||
181 | }; | 143 | }; |
diff --git a/arch/powerpc/platforms/83xx/mpc83xx.h b/arch/powerpc/platforms/83xx/mpc83xx.h index 01cae106912b..2c82bca9bfbb 100644 --- a/arch/powerpc/platforms/83xx/mpc83xx.h +++ b/arch/powerpc/platforms/83xx/mpc83xx.h | |||
@@ -11,6 +11,7 @@ | |||
11 | 11 | ||
12 | extern int add_bridge(struct device_node *dev); | 12 | extern int add_bridge(struct device_node *dev); |
13 | extern int mpc83xx_exclude_device(u_char bus, u_char devfn); | 13 | extern int mpc83xx_exclude_device(u_char bus, u_char devfn); |
14 | extern void mpc83xx_pcibios_fixup(void); | ||
14 | extern void mpc83xx_restart(char *cmd); | 15 | extern void mpc83xx_restart(char *cmd); |
15 | extern long mpc83xx_time_init(void); | 16 | extern long mpc83xx_time_init(void); |
16 | 17 | ||
diff --git a/arch/powerpc/platforms/83xx/pci.c b/arch/powerpc/platforms/83xx/pci.c index 3b5e563c279f..5d84a9ccd103 100644 --- a/arch/powerpc/platforms/83xx/pci.c +++ b/arch/powerpc/platforms/83xx/pci.c | |||
@@ -45,6 +45,15 @@ int mpc83xx_exclude_device(u_char bus, u_char devfn) | |||
45 | return PCIBIOS_SUCCESSFUL; | 45 | return PCIBIOS_SUCCESSFUL; |
46 | } | 46 | } |
47 | 47 | ||
48 | void __init mpc83xx_pcibios_fixup(void) | ||
49 | { | ||
50 | struct pci_dev *dev = NULL; | ||
51 | |||
52 | /* map all the PCI irqs */ | ||
53 | for_each_pci_dev(dev) | ||
54 | pci_read_irq_line(dev); | ||
55 | } | ||
56 | |||
48 | int __init add_bridge(struct device_node *dev) | 57 | int __init add_bridge(struct device_node *dev) |
49 | { | 58 | { |
50 | int len; | 59 | int len; |