aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/86xx
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/platforms/86xx')
-rw-r--r--arch/powerpc/platforms/86xx/Kconfig16
-rw-r--r--arch/powerpc/platforms/86xx/Makefile1
-rw-r--r--arch/powerpc/platforms/86xx/mpc8610_hpcd.c25
-rw-r--r--arch/powerpc/platforms/86xx/mpc86xx.h3
-rw-r--r--arch/powerpc/platforms/86xx/mpc86xx_hpcn.c64
-rw-r--r--arch/powerpc/platforms/86xx/mpc86xx_smp.c6
-rw-r--r--arch/powerpc/platforms/86xx/pic.c78
-rw-r--r--arch/powerpc/platforms/86xx/sbc8641d.c25
8 files changed, 100 insertions, 118 deletions
diff --git a/arch/powerpc/platforms/86xx/Kconfig b/arch/powerpc/platforms/86xx/Kconfig
index 053f49a1dcae..80a81e02bb55 100644
--- a/arch/powerpc/platforms/86xx/Kconfig
+++ b/arch/powerpc/platforms/86xx/Kconfig
@@ -1,7 +1,13 @@
1choice 1config PPC_86xx
2 prompt "86xx Board Type" 2menuconfig PPC_86xx
3 depends on PPC_86xx 3 bool "86xx-based boards"
4 default MPC8641_HPCN 4 depends on 6xx && PPC_MULTIPLATFORM
5 select FSL_SOC
6 select ALTIVEC
7 help
8 The Freescale E600 SoCs have 74xx cores.
9
10if PPC_86xx
5 11
6config MPC8641_HPCN 12config MPC8641_HPCN
7 bool "Freescale MPC8641 HPCN" 13 bool "Freescale MPC8641 HPCN"
@@ -24,7 +30,7 @@ config MPC8610_HPCD
24 help 30 help
25 This option enables support for the MPC8610 HPCD board. 31 This option enables support for the MPC8610 HPCD board.
26 32
27endchoice 33endif
28 34
29config MPC8641 35config MPC8641
30 bool 36 bool
diff --git a/arch/powerpc/platforms/86xx/Makefile b/arch/powerpc/platforms/86xx/Makefile
index 1b9b4a9b2525..8fee37dec795 100644
--- a/arch/powerpc/platforms/86xx/Makefile
+++ b/arch/powerpc/platforms/86xx/Makefile
@@ -2,6 +2,7 @@
2# Makefile for the PowerPC 86xx linux kernel. 2# Makefile for the PowerPC 86xx linux kernel.
3# 3#
4 4
5obj-y := pic.o
5obj-$(CONFIG_SMP) += mpc86xx_smp.o 6obj-$(CONFIG_SMP) += mpc86xx_smp.o
6obj-$(CONFIG_MPC8641_HPCN) += mpc86xx_hpcn.o 7obj-$(CONFIG_MPC8641_HPCN) += mpc86xx_hpcn.o
7obj-$(CONFIG_SBC8641D) += sbc8641d.o 8obj-$(CONFIG_SBC8641D) += sbc8641d.o
diff --git a/arch/powerpc/platforms/86xx/mpc8610_hpcd.c b/arch/powerpc/platforms/86xx/mpc8610_hpcd.c
index dea13208bf64..30725302884a 100644
--- a/arch/powerpc/platforms/86xx/mpc8610_hpcd.c
+++ b/arch/powerpc/platforms/86xx/mpc8610_hpcd.c
@@ -39,6 +39,8 @@
39#include <sysdev/fsl_pci.h> 39#include <sysdev/fsl_pci.h>
40#include <sysdev/fsl_soc.h> 40#include <sysdev/fsl_soc.h>
41 41
42#include "mpc86xx.h"
43
42static unsigned char *pixis_bdcfg0, *pixis_arch; 44static unsigned char *pixis_bdcfg0, *pixis_arch;
43 45
44static struct of_device_id __initdata mpc8610_ids[] = { 46static struct of_device_id __initdata mpc8610_ids[] = {
@@ -56,27 +58,6 @@ static int __init mpc8610_declare_of_platform_devices(void)
56} 58}
57machine_device_initcall(mpc86xx_hpcd, mpc8610_declare_of_platform_devices); 59machine_device_initcall(mpc86xx_hpcd, mpc8610_declare_of_platform_devices);
58 60
59static void __init mpc86xx_hpcd_init_irq(void)
60{
61 struct mpic *mpic1;
62 struct device_node *np;
63 struct resource res;
64
65 /* Determine PIC address. */
66 np = of_find_node_by_type(NULL, "open-pic");
67 if (np == NULL)
68 return;
69 of_address_to_resource(np, 0, &res);
70
71 /* Alloc mpic structure and per isu has 16 INT entries. */
72 mpic1 = mpic_alloc(np, res.start,
73 MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
74 0, 256, " MPIC ");
75 BUG_ON(mpic1 == NULL);
76
77 mpic_init(mpic1);
78}
79
80#ifdef CONFIG_PCI 61#ifdef CONFIG_PCI
81static void __devinit quirk_uli1575(struct pci_dev *dev) 62static void __devinit quirk_uli1575(struct pci_dev *dev)
82{ 63{
@@ -404,7 +385,7 @@ define_machine(mpc86xx_hpcd) {
404 .name = "MPC86xx HPCD", 385 .name = "MPC86xx HPCD",
405 .probe = mpc86xx_hpcd_probe, 386 .probe = mpc86xx_hpcd_probe,
406 .setup_arch = mpc86xx_hpcd_setup_arch, 387 .setup_arch = mpc86xx_hpcd_setup_arch,
407 .init_IRQ = mpc86xx_hpcd_init_irq, 388 .init_IRQ = mpc86xx_init_irq,
408 .get_irq = mpic_get_irq, 389 .get_irq = mpic_get_irq,
409 .restart = fsl_rstcr_restart, 390 .restart = fsl_rstcr_restart,
410 .time_init = mpc86xx_time_init, 391 .time_init = mpc86xx_time_init,
diff --git a/arch/powerpc/platforms/86xx/mpc86xx.h b/arch/powerpc/platforms/86xx/mpc86xx.h
index 525ffa1904f9..08efb57559d1 100644
--- a/arch/powerpc/platforms/86xx/mpc86xx.h
+++ b/arch/powerpc/platforms/86xx/mpc86xx.h
@@ -15,6 +15,7 @@
15 * mpc86xx_* files. Mostly for use by mpc86xx_setup(). 15 * mpc86xx_* files. Mostly for use by mpc86xx_setup().
16 */ 16 */
17 17
18extern void __init mpc86xx_smp_init(void); 18extern void mpc86xx_smp_init(void);
19extern void mpc86xx_init_irq(void);
19 20
20#endif /* __MPC86XX_H__ */ 21#endif /* __MPC86XX_H__ */
diff --git a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
index f13704aabbea..7916599c9126 100644
--- a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
+++ b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
@@ -28,7 +28,6 @@
28#include <asm/prom.h> 28#include <asm/prom.h>
29#include <mm/mmu_decl.h> 29#include <mm/mmu_decl.h>
30#include <asm/udbg.h> 30#include <asm/udbg.h>
31#include <asm/i8259.h>
32 31
33#include <asm/mpic.h> 32#include <asm/mpic.h>
34 33
@@ -46,67 +45,6 @@
46#endif 45#endif
47 46
48#ifdef CONFIG_PCI 47#ifdef CONFIG_PCI
49static void mpc86xx_8259_cascade(unsigned int irq, struct irq_desc *desc)
50{
51 unsigned int cascade_irq = i8259_irq();
52 if (cascade_irq != NO_IRQ)
53 generic_handle_irq(cascade_irq);
54 desc->chip->eoi(irq);
55}
56#endif /* CONFIG_PCI */
57
58static void __init
59mpc86xx_hpcn_init_irq(void)
60{
61 struct mpic *mpic1;
62 struct device_node *np;
63 struct resource res;
64#ifdef CONFIG_PCI
65 struct device_node *cascade_node = NULL;
66 int cascade_irq;
67#endif
68
69 /* Determine PIC address. */
70 np = of_find_node_by_type(NULL, "open-pic");
71 if (np == NULL)
72 return;
73 of_address_to_resource(np, 0, &res);
74
75 /* Alloc mpic structure and per isu has 16 INT entries. */
76 mpic1 = mpic_alloc(np, res.start,
77 MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
78 0, 256, " MPIC ");
79 BUG_ON(mpic1 == NULL);
80
81 mpic_init(mpic1);
82
83#ifdef CONFIG_PCI
84 /* Initialize i8259 controller */
85 for_each_node_by_type(np, "interrupt-controller")
86 if (of_device_is_compatible(np, "chrp,iic")) {
87 cascade_node = np;
88 break;
89 }
90 if (cascade_node == NULL) {
91 printk(KERN_DEBUG "mpc86xxhpcn: no ISA interrupt controller\n");
92 return;
93 }
94
95 cascade_irq = irq_of_parse_and_map(cascade_node, 0);
96 if (cascade_irq == NO_IRQ) {
97 printk(KERN_ERR "mpc86xxhpcn: failed to map cascade interrupt");
98 return;
99 }
100 DBG("mpc86xxhpcn: cascade mapped to irq %d\n", cascade_irq);
101
102 i8259_init(cascade_node, 0);
103 of_node_put(cascade_node);
104
105 set_irq_chained_handler(cascade_irq, mpc86xx_8259_cascade);
106#endif
107}
108
109#ifdef CONFIG_PCI
110extern int uses_fsl_uli_m1575; 48extern int uses_fsl_uli_m1575;
111extern int uli_exclude_device(struct pci_controller *hose, 49extern int uli_exclude_device(struct pci_controller *hose,
112 u_char bus, u_char devfn); 50 u_char bus, u_char devfn);
@@ -237,7 +175,7 @@ define_machine(mpc86xx_hpcn) {
237 .name = "MPC86xx HPCN", 175 .name = "MPC86xx HPCN",
238 .probe = mpc86xx_hpcn_probe, 176 .probe = mpc86xx_hpcn_probe,
239 .setup_arch = mpc86xx_hpcn_setup_arch, 177 .setup_arch = mpc86xx_hpcn_setup_arch,
240 .init_IRQ = mpc86xx_hpcn_init_irq, 178 .init_IRQ = mpc86xx_init_irq,
241 .show_cpuinfo = mpc86xx_hpcn_show_cpuinfo, 179 .show_cpuinfo = mpc86xx_hpcn_show_cpuinfo,
242 .get_irq = mpic_get_irq, 180 .get_irq = mpic_get_irq,
243 .restart = fsl_rstcr_restart, 181 .restart = fsl_rstcr_restart,
diff --git a/arch/powerpc/platforms/86xx/mpc86xx_smp.c b/arch/powerpc/platforms/86xx/mpc86xx_smp.c
index ba55b0ff0f74..835f2dc24dc9 100644
--- a/arch/powerpc/platforms/86xx/mpc86xx_smp.c
+++ b/arch/powerpc/platforms/86xx/mpc86xx_smp.c
@@ -15,6 +15,7 @@
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/delay.h> 16#include <linux/delay.h>
17 17
18#include <asm/code-patching.h>
18#include <asm/page.h> 19#include <asm/page.h>
19#include <asm/pgtable.h> 20#include <asm/pgtable.h>
20#include <asm/pci-bridge.h> 21#include <asm/pci-bridge.h>
@@ -56,8 +57,7 @@ smp_86xx_kick_cpu(int nr)
56 unsigned int save_vector; 57 unsigned int save_vector;
57 unsigned long target, flags; 58 unsigned long target, flags;
58 int n = 0; 59 int n = 0;
59 volatile unsigned int *vector 60 unsigned int *vector = (unsigned int *)(KERNELBASE + 0x100);
60 = (volatile unsigned int *)(KERNELBASE + 0x100);
61 61
62 if (nr < 0 || nr >= NR_CPUS) 62 if (nr < 0 || nr >= NR_CPUS)
63 return; 63 return;
@@ -71,7 +71,7 @@ smp_86xx_kick_cpu(int nr)
71 71
72 /* Setup fake reset vector to call __secondary_start_mpc86xx. */ 72 /* Setup fake reset vector to call __secondary_start_mpc86xx. */
73 target = (unsigned long) __secondary_start_mpc86xx; 73 target = (unsigned long) __secondary_start_mpc86xx;
74 create_branch((unsigned long)vector, target, BRANCH_SET_LINK); 74 patch_branch(vector, target, BRANCH_SET_LINK);
75 75
76 /* Kick that CPU */ 76 /* Kick that CPU */
77 smp_86xx_release_core(nr); 77 smp_86xx_release_core(nr);
diff --git a/arch/powerpc/platforms/86xx/pic.c b/arch/powerpc/platforms/86xx/pic.c
new file mode 100644
index 000000000000..8881c5de500d
--- /dev/null
+++ b/arch/powerpc/platforms/86xx/pic.c
@@ -0,0 +1,78 @@
1/*
2 * Copyright 2008 Freescale Semiconductor, Inc.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 */
9
10#include <linux/stddef.h>
11#include <linux/kernel.h>
12#include <linux/interrupt.h>
13#include <linux/of_platform.h>
14
15#include <asm/system.h>
16#include <asm/mpic.h>
17#include <asm/i8259.h>
18
19#ifdef CONFIG_PPC_I8259
20static void mpc86xx_8259_cascade(unsigned int irq, struct irq_desc *desc)
21{
22 unsigned int cascade_irq = i8259_irq();
23 if (cascade_irq != NO_IRQ)
24 generic_handle_irq(cascade_irq);
25 desc->chip->eoi(irq);
26}
27#endif /* CONFIG_PPC_I8259 */
28
29void __init mpc86xx_init_irq(void)
30{
31 struct mpic *mpic;
32 struct device_node *np;
33 struct resource res;
34#ifdef CONFIG_PPC_I8259
35 struct device_node *cascade_node = NULL;
36 int cascade_irq;
37#endif
38
39 /* Determine PIC address. */
40 np = of_find_node_by_type(NULL, "open-pic");
41 if (np == NULL)
42 return;
43 of_address_to_resource(np, 0, &res);
44
45 mpic = mpic_alloc(np, res.start,
46 MPIC_PRIMARY | MPIC_WANTS_RESET |
47 MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS,
48 0, 256, " MPIC ");
49 of_node_put(np);
50 BUG_ON(mpic == NULL);
51
52 mpic_init(mpic);
53
54#ifdef CONFIG_PPC_I8259
55 /* Initialize i8259 controller */
56 for_each_node_by_type(np, "interrupt-controller")
57 if (of_device_is_compatible(np, "chrp,iic")) {
58 cascade_node = np;
59 break;
60 }
61
62 if (cascade_node == NULL) {
63 printk(KERN_DEBUG "Could not find i8259 PIC\n");
64 return;
65 }
66
67 cascade_irq = irq_of_parse_and_map(cascade_node, 0);
68 if (cascade_irq == NO_IRQ) {
69 printk(KERN_ERR "Failed to map cascade interrupt\n");
70 return;
71 }
72
73 i8259_init(cascade_node, 0);
74 of_node_put(cascade_node);
75
76 set_irq_chained_handler(cascade_irq, mpc86xx_8259_cascade);
77#endif
78}
diff --git a/arch/powerpc/platforms/86xx/sbc8641d.c b/arch/powerpc/platforms/86xx/sbc8641d.c
index 510a06ef0b55..00e6fad3b3ca 100644
--- a/arch/powerpc/platforms/86xx/sbc8641d.c
+++ b/arch/powerpc/platforms/86xx/sbc8641d.c
@@ -38,29 +38,6 @@
38#include "mpc86xx.h" 38#include "mpc86xx.h"
39 39
40static void __init 40static void __init
41sbc8641_init_irq(void)
42{
43 struct mpic *mpic1;
44 struct device_node *np;
45 struct resource res;
46
47 /* Determine PIC address. */
48 np = of_find_node_by_type(NULL, "open-pic");
49 if (np == NULL)
50 return;
51 of_address_to_resource(np, 0, &res);
52
53 /* Alloc mpic structure and per isu has 16 INT entries. */
54 mpic1 = mpic_alloc(np, res.start,
55 MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
56 0, 256, " MPIC ");
57 of_node_put(np);
58 BUG_ON(mpic1 == NULL);
59
60 mpic_init(mpic1);
61}
62
63static void __init
64sbc8641_setup_arch(void) 41sbc8641_setup_arch(void)
65{ 42{
66#ifdef CONFIG_PCI 43#ifdef CONFIG_PCI
@@ -151,7 +128,7 @@ define_machine(sbc8641) {
151 .name = "SBC8641D", 128 .name = "SBC8641D",
152 .probe = sbc8641_probe, 129 .probe = sbc8641_probe,
153 .setup_arch = sbc8641_setup_arch, 130 .setup_arch = sbc8641_setup_arch,
154 .init_IRQ = sbc8641_init_irq, 131 .init_IRQ = mpc86xx_init_irq,
155 .show_cpuinfo = sbc8641_show_cpuinfo, 132 .show_cpuinfo = sbc8641_show_cpuinfo,
156 .get_irq = mpic_get_irq, 133 .get_irq = mpic_get_irq,
157 .restart = fsl_rstcr_restart, 134 .restart = fsl_rstcr_restart,