diff options
author | Jon Loeliger <jdl@jdl.com> | 2008-01-23 13:42:50 -0500 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2008-01-23 20:54:36 -0500 |
commit | 3490cba56f7f8a78ef4c94814c3181f09ce1e2ef (patch) | |
tree | 46569f70028d73afd5fbd7662df030ce909702c8 | |
parent | b164b9032e5210dfc94b564344d61995785c9bd7 (diff) |
[POWERPC] Add initial iomega StorCenter board port.
Use cuImage bootwrapper until U-Boot port is completed.
Derived heavily from Linkstation port.
Signed-off-by: Jon Loeliger <jdl@freescale.com>
Acked-by: Andy Wilcox <andy@protium.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
-rw-r--r-- | arch/powerpc/boot/Makefile | 3 | ||||
-rw-r--r-- | arch/powerpc/boot/cuboot-824x.c | 53 | ||||
-rw-r--r-- | arch/powerpc/platforms/embedded6xx/Kconfig | 23 | ||||
-rw-r--r-- | arch/powerpc/platforms/embedded6xx/Makefile | 1 | ||||
-rw-r--r-- | arch/powerpc/platforms/embedded6xx/storcenter.c | 192 |
5 files changed, 265 insertions, 7 deletions
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile index fcca455a8c02..1e20aca48f45 100644 --- a/arch/powerpc/boot/Makefile +++ b/arch/powerpc/boot/Makefile | |||
@@ -57,7 +57,7 @@ src-wlib := string.S crt0.S stdio.c main.c \ | |||
57 | 4xx.c ebony.c mv64x60.c mpsc.c mv64x60_i2c.c cuboot.c bamboo.c \ | 57 | 4xx.c ebony.c mv64x60.c mpsc.c mv64x60_i2c.c cuboot.c bamboo.c \ |
58 | cpm-serial.c stdlib.c mpc52xx-psc.c planetcore.c uartlite.c \ | 58 | cpm-serial.c stdlib.c mpc52xx-psc.c planetcore.c uartlite.c \ |
59 | fsl-soc.c mpc8xx.c pq2.c | 59 | fsl-soc.c mpc8xx.c pq2.c |
60 | src-plat := of.c cuboot-52xx.c cuboot-83xx.c cuboot-85xx.c holly.c \ | 60 | src-plat := of.c cuboot-52xx.c cuboot-824x.c cuboot-83xx.c cuboot-85xx.c holly.c \ |
61 | cuboot-ebony.c treeboot-ebony.c prpmc2800.c \ | 61 | cuboot-ebony.c treeboot-ebony.c prpmc2800.c \ |
62 | ps3-head.S ps3-hvcall.S ps3.c treeboot-bamboo.c cuboot-8xx.c \ | 62 | ps3-head.S ps3-hvcall.S ps3.c treeboot-bamboo.c cuboot-8xx.c \ |
63 | cuboot-pq2.c cuboot-sequoia.c treeboot-walnut.c cuboot-bamboo.c \ | 63 | cuboot-pq2.c cuboot-sequoia.c treeboot-walnut.c cuboot-bamboo.c \ |
@@ -197,6 +197,7 @@ image-$(CONFIG_EP405) += zImage.ep405 | |||
197 | image-$(CONFIG_8260) += cuImage.pq2 | 197 | image-$(CONFIG_8260) += cuImage.pq2 |
198 | image-$(CONFIG_EP8248E) += zImage.ep8248e | 198 | image-$(CONFIG_EP8248E) += zImage.ep8248e |
199 | image-$(CONFIG_PPC_MPC52xx) += cuImage.52xx | 199 | image-$(CONFIG_PPC_MPC52xx) += cuImage.52xx |
200 | image-$(CONFIG_STORCENTER) += cuImage.824x | ||
200 | image-$(CONFIG_PPC_83xx) += cuImage.83xx | 201 | image-$(CONFIG_PPC_83xx) += cuImage.83xx |
201 | image-$(CONFIG_PPC_85xx) += cuImage.85xx | 202 | image-$(CONFIG_PPC_85xx) += cuImage.85xx |
202 | image-$(CONFIG_MPC7448HPC2) += cuImage.hpc2 | 203 | image-$(CONFIG_MPC7448HPC2) += cuImage.hpc2 |
diff --git a/arch/powerpc/boot/cuboot-824x.c b/arch/powerpc/boot/cuboot-824x.c new file mode 100644 index 000000000000..ced90c53de48 --- /dev/null +++ b/arch/powerpc/boot/cuboot-824x.c | |||
@@ -0,0 +1,53 @@ | |||
1 | /* | ||
2 | * Old U-boot compatibility for 824x | ||
3 | * | ||
4 | * Copyright (c) 2007 Freescale Semiconductor, Inc. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify it | ||
7 | * under the terms of the GNU General Public License version 2 as published | ||
8 | * by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #include "ops.h" | ||
12 | #include "stdio.h" | ||
13 | #include "cuboot.h" | ||
14 | |||
15 | #define TARGET_824x | ||
16 | #include "ppcboot.h" | ||
17 | |||
18 | static bd_t bd; | ||
19 | |||
20 | |||
21 | static void platform_fixups(void) | ||
22 | { | ||
23 | void *soc; | ||
24 | |||
25 | dt_fixup_memory(bd.bi_memstart, bd.bi_memsize); | ||
26 | dt_fixup_mac_addresses(bd.bi_enetaddr); | ||
27 | dt_fixup_cpu_clocks(bd.bi_intfreq, bd.bi_busfreq / 4, bd.bi_busfreq); | ||
28 | |||
29 | soc = find_node_by_devtype(NULL, "soc"); | ||
30 | if (soc) { | ||
31 | void *serial = NULL; | ||
32 | |||
33 | setprop(soc, "bus-frequency", &bd.bi_busfreq, | ||
34 | sizeof(bd.bi_busfreq)); | ||
35 | |||
36 | while ((serial = find_node_by_devtype(serial, "serial"))) { | ||
37 | if (get_parent(serial) != soc) | ||
38 | continue; | ||
39 | |||
40 | setprop(serial, "clock-frequency", &bd.bi_busfreq, | ||
41 | sizeof(bd.bi_busfreq)); | ||
42 | } | ||
43 | } | ||
44 | } | ||
45 | |||
46 | void platform_init(unsigned long r3, unsigned long r4, unsigned long r5, | ||
47 | unsigned long r6, unsigned long r7) | ||
48 | { | ||
49 | CUBOOT_INIT(); | ||
50 | fdt_init(_dtb_start); | ||
51 | serial_console_init(); | ||
52 | platform_ops.fixups = platform_fixups; | ||
53 | } | ||
diff --git a/arch/powerpc/platforms/embedded6xx/Kconfig b/arch/powerpc/platforms/embedded6xx/Kconfig index 8924095a7928..6c8083757938 100644 --- a/arch/powerpc/platforms/embedded6xx/Kconfig +++ b/arch/powerpc/platforms/embedded6xx/Kconfig | |||
@@ -9,6 +9,8 @@ config LINKSTATION | |||
9 | select FSL_SOC | 9 | select FSL_SOC |
10 | select PPC_UDBG_16550 if SERIAL_8250 | 10 | select PPC_UDBG_16550 if SERIAL_8250 |
11 | select DEFAULT_UIMAGE | 11 | select DEFAULT_UIMAGE |
12 | select MPC10X_OPENPIC | ||
13 | select MPC10X_BRIDGE | ||
12 | help | 14 | help |
13 | Select LINKSTATION if configuring for one of PPC- (MPC8241) | 15 | Select LINKSTATION if configuring for one of PPC- (MPC8241) |
14 | based NAS systems from Buffalo Technology. So far only | 16 | based NAS systems from Buffalo Technology. So far only |
@@ -16,6 +18,19 @@ config LINKSTATION | |||
16 | Linkstation-I HD-HLAN and HD-HGLAN versions, and PPC-based | 18 | Linkstation-I HD-HLAN and HD-HGLAN versions, and PPC-based |
17 | Terastation systems should be supported too. | 19 | Terastation systems should be supported too. |
18 | 20 | ||
21 | config STORCENTER | ||
22 | bool "IOMEGA StorCenter" | ||
23 | depends on EMBEDDED6xx | ||
24 | select MPIC | ||
25 | select FSL_SOC | ||
26 | select PPC_UDBG_16550 if SERIAL_8250 | ||
27 | select WANT_DEVICE_TREE | ||
28 | select MPC10X_OPENPIC | ||
29 | select MPC10X_BRIDGE | ||
30 | help | ||
31 | Select STORCENTER if configuring for the iomega StorCenter | ||
32 | with an 8241 CPU in it. | ||
33 | |||
19 | config MPC7448HPC2 | 34 | config MPC7448HPC2 |
20 | bool "Freescale MPC7448HPC2(Taiga)" | 35 | bool "Freescale MPC7448HPC2(Taiga)" |
21 | depends on EMBEDDED6xx | 36 | depends on EMBEDDED6xx |
@@ -23,6 +38,7 @@ config MPC7448HPC2 | |||
23 | select DEFAULT_UIMAGE | 38 | select DEFAULT_UIMAGE |
24 | select PPC_UDBG_16550 | 39 | select PPC_UDBG_16550 |
25 | select WANT_DEVICE_TREE | 40 | select WANT_DEVICE_TREE |
41 | select TSI108_BRIDGE | ||
26 | help | 42 | help |
27 | Select MPC7448HPC2 if configuring for Freescale MPC7448HPC2 (Taiga) | 43 | Select MPC7448HPC2 if configuring for Freescale MPC7448HPC2 (Taiga) |
28 | platform | 44 | platform |
@@ -33,6 +49,7 @@ config PPC_HOLLY | |||
33 | select TSI108_BRIDGE | 49 | select TSI108_BRIDGE |
34 | select PPC_UDBG_16550 | 50 | select PPC_UDBG_16550 |
35 | select WANT_DEVICE_TREE | 51 | select WANT_DEVICE_TREE |
52 | select TSI108_BRIDGE | ||
36 | help | 53 | help |
37 | Select PPC_HOLLY if configuring for an IBM 750GX/CL Eval | 54 | Select PPC_HOLLY if configuring for an IBM 750GX/CL Eval |
38 | Board with TSI108/9 bridge (Hickory/Holly) | 55 | Board with TSI108/9 bridge (Hickory/Holly) |
@@ -48,17 +65,13 @@ config PPC_PRPMC2800 | |||
48 | 65 | ||
49 | config TSI108_BRIDGE | 66 | config TSI108_BRIDGE |
50 | bool | 67 | bool |
51 | depends on MPC7448HPC2 || PPC_HOLLY | ||
52 | select PCI | 68 | select PCI |
53 | select MPIC | 69 | select MPIC |
54 | select MPIC_WEIRD | 70 | select MPIC_WEIRD |
55 | default y | ||
56 | 71 | ||
57 | config MPC10X_BRIDGE | 72 | config MPC10X_BRIDGE |
58 | bool | 73 | bool |
59 | depends on LINKSTATION | ||
60 | select PPC_INDIRECT_PCI | 74 | select PPC_INDIRECT_PCI |
61 | default y | ||
62 | 75 | ||
63 | config MV64X60 | 76 | config MV64X60 |
64 | bool | 77 | bool |
@@ -67,8 +80,6 @@ config MV64X60 | |||
67 | 80 | ||
68 | config MPC10X_OPENPIC | 81 | config MPC10X_OPENPIC |
69 | bool | 82 | bool |
70 | depends on LINKSTATION | ||
71 | default y | ||
72 | 83 | ||
73 | config MPC10X_STORE_GATHERING | 84 | config MPC10X_STORE_GATHERING |
74 | bool "Enable MPC10x store gathering" | 85 | bool "Enable MPC10x store gathering" |
diff --git a/arch/powerpc/platforms/embedded6xx/Makefile b/arch/powerpc/platforms/embedded6xx/Makefile index 844947cfc5db..06524d3ffd2e 100644 --- a/arch/powerpc/platforms/embedded6xx/Makefile +++ b/arch/powerpc/platforms/embedded6xx/Makefile | |||
@@ -3,5 +3,6 @@ | |||
3 | # | 3 | # |
4 | obj-$(CONFIG_MPC7448HPC2) += mpc7448_hpc2.o | 4 | obj-$(CONFIG_MPC7448HPC2) += mpc7448_hpc2.o |
5 | obj-$(CONFIG_LINKSTATION) += linkstation.o ls_uart.o | 5 | obj-$(CONFIG_LINKSTATION) += linkstation.o ls_uart.o |
6 | obj-$(CONFIG_STORCENTER) += storcenter.o | ||
6 | obj-$(CONFIG_PPC_HOLLY) += holly.o | 7 | obj-$(CONFIG_PPC_HOLLY) += holly.o |
7 | obj-$(CONFIG_PPC_PRPMC2800) += prpmc2800.o | 8 | obj-$(CONFIG_PPC_PRPMC2800) += prpmc2800.o |
diff --git a/arch/powerpc/platforms/embedded6xx/storcenter.c b/arch/powerpc/platforms/embedded6xx/storcenter.c new file mode 100644 index 000000000000..e12e9d298716 --- /dev/null +++ b/arch/powerpc/platforms/embedded6xx/storcenter.c | |||
@@ -0,0 +1,192 @@ | |||
1 | /* | ||
2 | * Board setup routines for the storcenter | ||
3 | * | ||
4 | * Copyright 2007 (C) Oyvind Repvik (nail@nslu2-linux.org) | ||
5 | * Copyright 2007 Andy Wilcox, Jon Loeliger | ||
6 | * | ||
7 | * Based on linkstation.c by G. Liakhovetski | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public License | ||
10 | * version 2. This program is licensed "as is" without any warranty of | ||
11 | * any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #include <linux/kernel.h> | ||
15 | #include <linux/pci.h> | ||
16 | #include <linux/initrd.h> | ||
17 | #include <linux/mtd/physmap.h> | ||
18 | #include <linux/of_platform.h> | ||
19 | |||
20 | #include <asm/system.h> | ||
21 | #include <asm/time.h> | ||
22 | #include <asm/prom.h> | ||
23 | #include <asm/mpic.h> | ||
24 | #include <asm/pci-bridge.h> | ||
25 | |||
26 | #include "mpc10x.h" | ||
27 | |||
28 | |||
29 | #ifdef CONFIG_MTD_PHYSMAP | ||
30 | static struct mtd_partition storcenter_physmap_partitions[] = { | ||
31 | { | ||
32 | .name = "kernel", | ||
33 | .offset = 0x000000, | ||
34 | .size = 0x170000, | ||
35 | }, | ||
36 | { | ||
37 | .name = "rootfs", | ||
38 | .offset = 0x170000, | ||
39 | .size = 0x590000, | ||
40 | }, | ||
41 | { | ||
42 | .name = "uboot", | ||
43 | .offset = 0x700000, | ||
44 | .size = 0x040000, | ||
45 | }, | ||
46 | { | ||
47 | .name = "config", | ||
48 | .offset = 0x740000, | ||
49 | .size = 0x0c0000, | ||
50 | }, | ||
51 | }; | ||
52 | #endif | ||
53 | |||
54 | |||
55 | static __initdata struct of_device_id storcenter_of_bus[] = { | ||
56 | { .name = "soc", }, | ||
57 | {}, | ||
58 | }; | ||
59 | |||
60 | static int __init storcenter_device_probe(void) | ||
61 | { | ||
62 | of_platform_bus_probe(NULL, storcenter_of_bus, NULL); | ||
63 | return 0; | ||
64 | } | ||
65 | machine_device_initcall(storcenter, storcenter_device_probe); | ||
66 | |||
67 | |||
68 | static int __init storcenter_add_bridge(struct device_node *dev) | ||
69 | { | ||
70 | #ifdef CONFIG_PCI | ||
71 | int len; | ||
72 | struct pci_controller *hose; | ||
73 | const int *bus_range; | ||
74 | |||
75 | printk("Adding PCI host bridge %s\n", dev->full_name); | ||
76 | |||
77 | hose = pcibios_alloc_controller(dev); | ||
78 | if (hose == NULL) | ||
79 | return -ENOMEM; | ||
80 | |||
81 | bus_range = of_get_property(dev, "bus-range", &len); | ||
82 | hose->first_busno = bus_range ? bus_range[0] : 0; | ||
83 | hose->last_busno = bus_range ? bus_range[1] : 0xff; | ||
84 | |||
85 | setup_indirect_pci(hose, MPC10X_MAPB_CNFG_ADDR, MPC10X_MAPB_CNFG_DATA, 0); | ||
86 | |||
87 | /* Interpret the "ranges" property */ | ||
88 | /* This also maps the I/O region and sets isa_io/mem_base */ | ||
89 | pci_process_bridge_OF_ranges(hose, dev, 1); | ||
90 | #endif | ||
91 | |||
92 | return 0; | ||
93 | } | ||
94 | |||
95 | static void __init storcenter_setup_arch(void) | ||
96 | { | ||
97 | struct device_node *np; | ||
98 | |||
99 | #ifdef CONFIG_MTD_PHYSMAP | ||
100 | physmap_set_partitions(storcenter_physmap_partitions, | ||
101 | ARRAY_SIZE(storcenter_physmap_partitions)); | ||
102 | #endif | ||
103 | |||
104 | /* Lookup PCI host bridges */ | ||
105 | for_each_compatible_node(np, "pci", "mpc10x-pci") | ||
106 | storcenter_add_bridge(np); | ||
107 | |||
108 | printk(KERN_INFO "IOMEGA StorCenter\n"); | ||
109 | } | ||
110 | |||
111 | /* | ||
112 | * Interrupt setup and service. Interrrupts on the turbostation come | ||
113 | * from the four PCI slots plus onboard 8241 devices: I2C, DUART. | ||
114 | */ | ||
115 | static void __init storcenter_init_IRQ(void) | ||
116 | { | ||
117 | struct mpic *mpic; | ||
118 | struct device_node *dnp; | ||
119 | const void *prop; | ||
120 | int size; | ||
121 | phys_addr_t paddr; | ||
122 | |||
123 | dnp = of_find_node_by_type(NULL, "open-pic"); | ||
124 | if (dnp == NULL) | ||
125 | return; | ||
126 | |||
127 | prop = of_get_property(dnp, "reg", &size); | ||
128 | if (prop == NULL) { | ||
129 | of_node_put(dnp); | ||
130 | return; | ||
131 | } | ||
132 | |||
133 | paddr = (phys_addr_t)of_translate_address(dnp, prop); | ||
134 | mpic = mpic_alloc(dnp, paddr, MPIC_PRIMARY | MPIC_WANTS_RESET, | ||
135 | 4, 32, " EPIC "); | ||
136 | |||
137 | of_node_put(dnp); | ||
138 | |||
139 | BUG_ON(mpic == NULL); | ||
140 | |||
141 | /* PCI IRQs */ | ||
142 | /* | ||
143 | * 2.6.12 patch: | ||
144 | * openpic_set_sources(0, 5, OpenPIC_Addr + 0x10200); | ||
145 | * openpic_set_sources(5, 2, OpenPIC_Addr + 0x11120); | ||
146 | * first_irq, num_irqs, __iomem first_ISR | ||
147 | * o_ss: i, src: 0, fdf50200 | ||
148 | * o_ss: i, src: 1, fdf50220 | ||
149 | * o_ss: i, src: 2, fdf50240 | ||
150 | * o_ss: i, src: 3, fdf50260 | ||
151 | * o_ss: i, src: 4, fdf50280 | ||
152 | * o_ss: i, src: 5, fdf51120 | ||
153 | * o_ss: i, src: 6, fdf51140 | ||
154 | */ | ||
155 | mpic_assign_isu(mpic, 0, paddr + 0x10200); | ||
156 | mpic_assign_isu(mpic, 1, paddr + 0x10220); | ||
157 | mpic_assign_isu(mpic, 2, paddr + 0x10240); | ||
158 | mpic_assign_isu(mpic, 3, paddr + 0x10260); | ||
159 | mpic_assign_isu(mpic, 4, paddr + 0x10280); | ||
160 | mpic_assign_isu(mpic, 5, paddr + 0x11120); | ||
161 | mpic_assign_isu(mpic, 6, paddr + 0x11140); | ||
162 | |||
163 | mpic_init(mpic); | ||
164 | } | ||
165 | |||
166 | static void storcenter_restart(char *cmd) | ||
167 | { | ||
168 | local_irq_disable(); | ||
169 | |||
170 | /* Set exception prefix high - to the firmware */ | ||
171 | _nmask_and_or_msr(0, MSR_IP); | ||
172 | |||
173 | /* Wait for reset to happen */ | ||
174 | for (;;) ; | ||
175 | } | ||
176 | |||
177 | static int __init storcenter_probe(void) | ||
178 | { | ||
179 | unsigned long root = of_get_flat_dt_root(); | ||
180 | |||
181 | return of_flat_dt_is_compatible(root, "storcenter"); | ||
182 | } | ||
183 | |||
184 | define_machine(storcenter){ | ||
185 | .name = "IOMEGA StorCenter", | ||
186 | .probe = storcenter_probe, | ||
187 | .setup_arch = storcenter_setup_arch, | ||
188 | .init_IRQ = storcenter_init_IRQ, | ||
189 | .get_irq = mpic_get_irq, | ||
190 | .restart = storcenter_restart, | ||
191 | .calibrate_decr = generic_calibrate_decr, | ||
192 | }; | ||