aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms
diff options
context:
space:
mode:
authorDale Farnsworth <dale@farnsworth.org>2007-05-11 20:58:43 -0400
committerPaul Mackerras <paulus@samba.org>2007-05-11 21:32:50 -0400
commitfd4ba7e2b7ce9a48b8c60d5fcd65feda5746812e (patch)
treec6a32e72c977ab54a264e6e4782e5b76e7f79c8a /arch/powerpc/platforms
parentc368d921daed3c7cfba9752a45b2a8804cd54128 (diff)
[POWERPC] Add arch/powerpc support for the Motorola PrPMC2800
This finally adds the PPC_PRPMC2800 Kconfig option, the board setup code (the setup and reset functions) and the defconfig, to support the Motorola PrPMC2800 platform. Signed-off-by: Dale Farnsworth <dale@farnsworth.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/platforms')
-rw-r--r--arch/powerpc/platforms/embedded6xx/Kconfig8
-rw-r--r--arch/powerpc/platforms/embedded6xx/Makefile1
-rw-r--r--arch/powerpc/platforms/embedded6xx/prpmc2800.c171
3 files changed, 180 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/embedded6xx/Kconfig b/arch/powerpc/platforms/embedded6xx/Kconfig
index 15a1e9a77872..f2d26268ca6f 100644
--- a/arch/powerpc/platforms/embedded6xx/Kconfig
+++ b/arch/powerpc/platforms/embedded6xx/Kconfig
@@ -31,6 +31,14 @@ config PPC_HOLLY
31 help 31 help
32 Select PPC_HOLLY if configuring for an IBM 750GX/CL Eval 32 Select PPC_HOLLY if configuring for an IBM 750GX/CL Eval
33 Board with TSI108/9 bridge (Hickory/Holly) 33 Board with TSI108/9 bridge (Hickory/Holly)
34
35config PPC_PRPMC2800
36 bool "Motorola-PrPMC2800"
37 select MV64X60
38 select NOT_COHERENT_CACHE
39 select WANT_DEVICE_TREE
40 help
41 This option enables support for the Motorola PrPMC2800 board
34endchoice 42endchoice
35 43
36config TSI108_BRIDGE 44config TSI108_BRIDGE
diff --git a/arch/powerpc/platforms/embedded6xx/Makefile b/arch/powerpc/platforms/embedded6xx/Makefile
index b39fe4f470d5..844947cfc5db 100644
--- a/arch/powerpc/platforms/embedded6xx/Makefile
+++ b/arch/powerpc/platforms/embedded6xx/Makefile
@@ -4,3 +4,4 @@
4obj-$(CONFIG_MPC7448HPC2) += mpc7448_hpc2.o 4obj-$(CONFIG_MPC7448HPC2) += mpc7448_hpc2.o
5obj-$(CONFIG_LINKSTATION) += linkstation.o ls_uart.o 5obj-$(CONFIG_LINKSTATION) += linkstation.o ls_uart.o
6obj-$(CONFIG_PPC_HOLLY) += holly.o 6obj-$(CONFIG_PPC_HOLLY) += holly.o
7obj-$(CONFIG_PPC_PRPMC2800) += prpmc2800.o
diff --git a/arch/powerpc/platforms/embedded6xx/prpmc2800.c b/arch/powerpc/platforms/embedded6xx/prpmc2800.c
new file mode 100644
index 000000000000..53420951dc53
--- /dev/null
+++ b/arch/powerpc/platforms/embedded6xx/prpmc2800.c
@@ -0,0 +1,171 @@
1/*
2 * Board setup routines for the Motorola PrPMC2800
3 *
4 * Author: Dale Farnsworth <dale@farnsworth.org>
5 *
6 * 2007 (c) MontaVista, Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
11
12#include <linux/stddef.h>
13#include <linux/kernel.h>
14#include <linux/delay.h>
15#include <linux/interrupt.h>
16#include <linux/seq_file.h>
17
18#include <asm/machdep.h>
19#include <asm/prom.h>
20#include <asm/system.h>
21#include <asm/time.h>
22#include <asm/kexec.h>
23
24#include <mm/mmu_decl.h>
25
26#include <sysdev/mv64x60.h>
27
28#define MV64x60_MPP_CNTL_0 0x0000
29#define MV64x60_MPP_CNTL_2 0x0008
30
31#define MV64x60_GPP_IO_CNTL 0x0000
32#define MV64x60_GPP_LEVEL_CNTL 0x0010
33#define MV64x60_GPP_VALUE_SET 0x0018
34
35#define PLATFORM_NAME_MAX 32
36
37static char prpmc2800_platform_name[PLATFORM_NAME_MAX];
38
39static void __iomem *mv64x60_mpp_reg_base;
40static void __iomem *mv64x60_gpp_reg_base;
41
42static void __init prpmc2800_setup_arch(void)
43{
44 struct device_node *np;
45 phys_addr_t paddr;
46 const unsigned int *reg;
47 const unsigned int *prop;
48
49 /*
50 * ioremap mpp and gpp registers in case they are later
51 * needed by prpmc2800_reset_board().
52 */
53 np = of_find_compatible_node(NULL, NULL, "marvell,mv64x60-mpp");
54 reg = of_get_property(np, "reg", NULL);
55 paddr = of_translate_address(np, reg);
56 of_node_put(np);
57 mv64x60_mpp_reg_base = ioremap(paddr, reg[1]);
58
59 np = of_find_compatible_node(NULL, NULL, "marvell,mv64x60-gpp");
60 reg = of_get_property(np, "reg", NULL);
61 paddr = of_translate_address(np, reg);
62 of_node_put(np);
63 mv64x60_gpp_reg_base = ioremap(paddr, reg[1]);
64
65 np = of_find_node_by_type(NULL, "cpu");
66 prop = of_get_property(np, "clock-frequency", NULL);
67 if (prop)
68 loops_per_jiffy = *prop / HZ;
69 of_node_put(np);
70
71#ifdef CONFIG_PCI
72 mv64x60_pci_init();
73#endif
74
75 printk("Motorola %s\n", prpmc2800_platform_name);
76}
77
78static void prpmc2800_reset_board(void)
79{
80 u32 temp;
81
82 local_irq_disable();
83
84 temp = in_le32(mv64x60_mpp_reg_base + MV64x60_MPP_CNTL_0);
85 temp &= 0xFFFF0FFF;
86 out_le32(mv64x60_mpp_reg_base + MV64x60_MPP_CNTL_0, temp);
87
88 temp = in_le32(mv64x60_gpp_reg_base + MV64x60_GPP_LEVEL_CNTL);
89 temp |= 0x00000004;
90 out_le32(mv64x60_gpp_reg_base + MV64x60_GPP_LEVEL_CNTL, temp);
91
92 temp = in_le32(mv64x60_gpp_reg_base + MV64x60_GPP_IO_CNTL);
93 temp |= 0x00000004;
94 out_le32(mv64x60_gpp_reg_base + MV64x60_GPP_IO_CNTL, temp);
95
96 temp = in_le32(mv64x60_mpp_reg_base + MV64x60_MPP_CNTL_2);
97 temp &= 0xFFFF0FFF;
98 out_le32(mv64x60_mpp_reg_base + MV64x60_MPP_CNTL_2, temp);
99
100 temp = in_le32(mv64x60_gpp_reg_base + MV64x60_GPP_LEVEL_CNTL);
101 temp |= 0x00080000;
102 out_le32(mv64x60_gpp_reg_base + MV64x60_GPP_LEVEL_CNTL, temp);
103
104 temp = in_le32(mv64x60_gpp_reg_base + MV64x60_GPP_IO_CNTL);
105 temp |= 0x00080000;
106 out_le32(mv64x60_gpp_reg_base + MV64x60_GPP_IO_CNTL, temp);
107
108 out_le32(mv64x60_gpp_reg_base + MV64x60_GPP_VALUE_SET, 0x00080004);
109}
110
111static void prpmc2800_restart(char *cmd)
112{
113 volatile ulong i = 10000000;
114
115 prpmc2800_reset_board();
116
117 while (i-- > 0);
118 panic("restart failed\n");
119}
120
121#ifdef CONFIG_NOT_COHERENT_CACHE
122#define PPRPM2800_COHERENCY_SETTING "off"
123#else
124#define PPRPM2800_COHERENCY_SETTING "on"
125#endif
126
127void prpmc2800_show_cpuinfo(struct seq_file *m)
128{
129 uint memsize = total_memory;
130
131 seq_printf(m, "Vendor\t\t: Motorola\n");
132 seq_printf(m, "Memory\t\t: %d MB\n", memsize / (1024 * 1024));
133 seq_printf(m, "coherency\t: %s\n", PPRPM2800_COHERENCY_SETTING);
134}
135
136/*
137 * Called very early, device-tree isn't unflattened
138 */
139static int __init prpmc2800_probe(void)
140{
141 unsigned long root = of_get_flat_dt_root();
142 unsigned long len = PLATFORM_NAME_MAX;
143 void *m;
144
145 if (!of_flat_dt_is_compatible(root, "motorola,PrPMC2800"))
146 return 0;
147
148 /* Update ppc_md.name with name from dt */
149 m = of_get_flat_dt_prop(root, "model", &len);
150 if (m)
151 strncpy(prpmc2800_platform_name, m,
152 min((int)len, PLATFORM_NAME_MAX - 1));
153
154 return 1;
155}
156
157define_machine(prpmc2800){
158 .name = prpmc2800_platform_name,
159 .probe = prpmc2800_probe,
160 .setup_arch = prpmc2800_setup_arch,
161 .show_cpuinfo = prpmc2800_show_cpuinfo,
162 .init_IRQ = mv64x60_init_irq,
163 .get_irq = mv64x60_get_irq,
164 .restart = prpmc2800_restart,
165 .calibrate_decr = generic_calibrate_decr,
166#ifdef CONFIG_KEXEC
167 .machine_kexec = default_machine_kexec,
168 .machine_kexec_prepare = default_machine_kexec_prepare,
169 .machine_crash_shutdown = default_machine_crash_shutdown,
170#endif
171};