Commit f1f17716 authored by Kim Phillips's avatar Kim Phillips Committed by Paul Mackerras

[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: default avatarKim Phillips <kim.phillips@freescale.com>
Signed-off-by: default avatarLi Yang <leoli@freescale.com>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent b9f0f1bb
...@@ -46,26 +46,6 @@ unsigned long isa_io_base = 0; ...@@ -46,26 +46,6 @@ unsigned long isa_io_base = 0;
unsigned long isa_mem_base = 0; unsigned long isa_mem_base = 0;
#endif #endif
#ifdef CONFIG_PCI
static int
mpc83xx_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
{
static char pci_irq_table[][4] =
/*
* PCI IDSEL/INTPIN->INTLINE
* A B C D
*/
{
{PIRQB, PIRQC, PIRQD, PIRQA}, /* idsel 0x0e */
{PIRQA, PIRQB, PIRQC, PIRQD}, /* idsel 0x0f */
{PIRQC, PIRQD, PIRQA, PIRQB}, /* idsel 0x10 */
};
const long min_idsel = 0x0e, max_idsel = 0x10, irqs_per_slot = 4;
return PCI_IRQ_TABLE_LOOKUP;
}
#endif /* CONFIG_PCI */
/* ************************************************************************ /* ************************************************************************
* *
* Setup the architecture * Setup the architecture
...@@ -92,8 +72,6 @@ static void __init mpc834x_itx_setup_arch(void) ...@@ -92,8 +72,6 @@ static void __init mpc834x_itx_setup_arch(void)
for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;) for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
add_bridge(np); add_bridge(np);
ppc_md.pci_swizzle = common_swizzle;
ppc_md.pci_map_irq = mpc83xx_map_irq;
ppc_md.pci_exclude_device = mpc83xx_exclude_device; ppc_md.pci_exclude_device = mpc83xx_exclude_device;
#endif #endif
...@@ -106,25 +84,13 @@ static void __init mpc834x_itx_setup_arch(void) ...@@ -106,25 +84,13 @@ static void __init mpc834x_itx_setup_arch(void)
void __init mpc834x_itx_init_IRQ(void) void __init mpc834x_itx_init_IRQ(void)
{ {
u8 senses[8] = { struct device_node *np;
0, /* EXT 0 */
IRQ_SENSE_LEVEL, /* EXT 1 */ np = of_find_node_by_type(NULL, "ipic");
IRQ_SENSE_LEVEL, /* EXT 2 */ if (!np)
0, /* EXT 3 */ return;
#ifdef CONFIG_PCI
IRQ_SENSE_LEVEL, /* EXT 4 */
IRQ_SENSE_LEVEL, /* EXT 5 */
IRQ_SENSE_LEVEL, /* EXT 6 */
IRQ_SENSE_LEVEL, /* EXT 7 */
#else
0, /* EXT 4 */
0, /* EXT 5 */
0, /* EXT 6 */
0, /* EXT 7 */
#endif
};
ipic_init(get_immrbase() + 0x00700, 0, 0, senses, 8); ipic_init(np, 0);
/* Initialize the default interrupt mapping priorities, /* Initialize the default interrupt mapping priorities,
* in case the boot rom changed something on us. * in case the boot rom changed something on us.
...@@ -153,4 +119,7 @@ define_machine(mpc834x_itx) { ...@@ -153,4 +119,7 @@ define_machine(mpc834x_itx) {
.time_init = mpc83xx_time_init, .time_init = mpc83xx_time_init,
.calibrate_decr = generic_calibrate_decr, .calibrate_decr = generic_calibrate_decr,
.progress = udbg_progress, .progress = udbg_progress,
#ifdef CONFIG_PCI
.pcibios_fixup = mpc83xx_pcibios_fixup,
#endif
}; };
...@@ -43,33 +43,6 @@ unsigned long isa_io_base = 0; ...@@ -43,33 +43,6 @@ unsigned long isa_io_base = 0;
unsigned long isa_mem_base = 0; unsigned long isa_mem_base = 0;
#endif #endif
#ifdef CONFIG_PCI
static int
mpc83xx_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
{
static char pci_irq_table[][4] =
/*
* PCI IDSEL/INTPIN->INTLINE
* A B C D
*/
{
{PIRQA, PIRQB, PIRQC, PIRQD}, /* idsel 0x11 */
{PIRQC, PIRQD, PIRQA, PIRQB}, /* idsel 0x12 */
{PIRQD, PIRQA, PIRQB, PIRQC}, /* idsel 0x13 */
{0, 0, 0, 0},
{PIRQA, PIRQB, PIRQC, PIRQD}, /* idsel 0x15 */
{PIRQD, PIRQA, PIRQB, PIRQC}, /* idsel 0x16 */
{PIRQC, PIRQD, PIRQA, PIRQB}, /* idsel 0x17 */
{PIRQB, PIRQC, PIRQD, PIRQA}, /* idsel 0x18 */
{0, 0, 0, 0}, /* idsel 0x19 */
{0, 0, 0, 0}, /* idsel 0x20 */
};
const long min_idsel = 0x11, max_idsel = 0x20, irqs_per_slot = 4;
return PCI_IRQ_TABLE_LOOKUP;
}
#endif /* CONFIG_PCI */
/* ************************************************************************ /* ************************************************************************
* *
* Setup the architecture * Setup the architecture
...@@ -96,8 +69,6 @@ static void __init mpc834x_sys_setup_arch(void) ...@@ -96,8 +69,6 @@ static void __init mpc834x_sys_setup_arch(void)
for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;) for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
add_bridge(np); add_bridge(np);
ppc_md.pci_swizzle = common_swizzle;
ppc_md.pci_map_irq = mpc83xx_map_irq;
ppc_md.pci_exclude_device = mpc83xx_exclude_device; ppc_md.pci_exclude_device = mpc83xx_exclude_device;
#endif #endif
...@@ -110,25 +81,13 @@ static void __init mpc834x_sys_setup_arch(void) ...@@ -110,25 +81,13 @@ static void __init mpc834x_sys_setup_arch(void)
void __init mpc834x_sys_init_IRQ(void) void __init mpc834x_sys_init_IRQ(void)
{ {
u8 senses[8] = { struct device_node *np;
0, /* EXT 0 */
IRQ_SENSE_LEVEL, /* EXT 1 */ np = of_find_node_by_type(NULL, "ipic");
IRQ_SENSE_LEVEL, /* EXT 2 */ if (!np)
0, /* EXT 3 */ return;
#ifdef CONFIG_PCI
IRQ_SENSE_LEVEL, /* EXT 4 */
IRQ_SENSE_LEVEL, /* EXT 5 */
IRQ_SENSE_LEVEL, /* EXT 6 */
IRQ_SENSE_LEVEL, /* EXT 7 */
#else
0, /* EXT 4 */
0, /* EXT 5 */
0, /* EXT 6 */
0, /* EXT 7 */
#endif
};
ipic_init(get_immrbase() + 0x00700, 0, 0, senses, 8); ipic_init(np, 0);
/* Initialize the default interrupt mapping priorities, /* Initialize the default interrupt mapping priorities,
* in case the boot rom changed something on us. * in case the boot rom changed something on us.
...@@ -178,4 +137,7 @@ define_machine(mpc834x_sys) { ...@@ -178,4 +137,7 @@ define_machine(mpc834x_sys) {
.time_init = mpc83xx_time_init, .time_init = mpc83xx_time_init,
.calibrate_decr = generic_calibrate_decr, .calibrate_decr = generic_calibrate_decr,
.progress = udbg_progress, .progress = udbg_progress,
#ifdef CONFIG_PCI
.pcibios_fixup = mpc83xx_pcibios_fixup,
#endif
}; };
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
extern int add_bridge(struct device_node *dev); extern int add_bridge(struct device_node *dev);
extern int mpc83xx_exclude_device(u_char bus, u_char devfn); extern int mpc83xx_exclude_device(u_char bus, u_char devfn);
extern void mpc83xx_pcibios_fixup(void);
extern void mpc83xx_restart(char *cmd); extern void mpc83xx_restart(char *cmd);
extern long mpc83xx_time_init(void); extern long mpc83xx_time_init(void);
......
...@@ -45,6 +45,15 @@ int mpc83xx_exclude_device(u_char bus, u_char devfn) ...@@ -45,6 +45,15 @@ int mpc83xx_exclude_device(u_char bus, u_char devfn)
return PCIBIOS_SUCCESSFUL; return PCIBIOS_SUCCESSFUL;
} }
void __init mpc83xx_pcibios_fixup(void)
{
struct pci_dev *dev = NULL;
/* map all the PCI irqs */
for_each_pci_dev(dev)
pci_read_irq_line(dev);
}
int __init add_bridge(struct device_node *dev) int __init add_bridge(struct device_node *dev)
{ {
int len; int len;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment