aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Gortmaker <paul.gortmaker@windriver.com>2008-04-15 18:41:30 -0400
committerKumar Gala <galak@kernel.crashing.org>2008-04-17 02:01:40 -0400
commit4e8aae89a35d1d572e9faca44fa9774329fceb80 (patch)
tree4e4d263d5ff932dac15215cc659ef589eef56241
parent1e31de7aae01d85657b5db8c9e4cfc9afe0596f6 (diff)
[POWERPC] 86xx: Add support for Wind River SBC8641D board
This adds support for the Wind River SBC8641D board, based largely on the mpc86xx_hpcn support. The biggest difference is the lack of the Uli and the i8259 cascade, which simplifies things. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
-rw-r--r--arch/powerpc/platforms/86xx/Kconfig8
-rw-r--r--arch/powerpc/platforms/86xx/Makefile1
-rw-r--r--arch/powerpc/platforms/86xx/sbc8641d.c164
3 files changed, 172 insertions, 1 deletions
diff --git a/arch/powerpc/platforms/86xx/Kconfig b/arch/powerpc/platforms/86xx/Kconfig
index 21d113536b86..7442c58d44f5 100644
--- a/arch/powerpc/platforms/86xx/Kconfig
+++ b/arch/powerpc/platforms/86xx/Kconfig
@@ -11,6 +11,12 @@ config MPC8641_HPCN
11 help 11 help
12 This option enables support for the MPC8641 HPCN board. 12 This option enables support for the MPC8641 HPCN board.
13 13
14config SBC8641D
15 bool "Wind River SBC8641D"
16 select DEFAULT_UIMAGE
17 help
18 This option enables support for the WRS SBC8641D board.
19
14config MPC8610_HPCD 20config MPC8610_HPCD
15 bool "Freescale MPC8610 HPCD" 21 bool "Freescale MPC8610 HPCD"
16 select DEFAULT_UIMAGE 22 select DEFAULT_UIMAGE
@@ -24,7 +30,7 @@ config MPC8641
24 select FSL_PCI if PCI 30 select FSL_PCI if PCI
25 select PPC_UDBG_16550 31 select PPC_UDBG_16550
26 select MPIC 32 select MPIC
27 default y if MPC8641_HPCN 33 default y if MPC8641_HPCN || SBC8641D
28 34
29config MPC8610 35config MPC8610
30 bool 36 bool
diff --git a/arch/powerpc/platforms/86xx/Makefile b/arch/powerpc/platforms/86xx/Makefile
index c96706327eaa..1b9b4a9b2525 100644
--- a/arch/powerpc/platforms/86xx/Makefile
+++ b/arch/powerpc/platforms/86xx/Makefile
@@ -4,4 +4,5 @@
4 4
5obj-$(CONFIG_SMP) += mpc86xx_smp.o 5obj-$(CONFIG_SMP) += mpc86xx_smp.o
6obj-$(CONFIG_MPC8641_HPCN) += mpc86xx_hpcn.o 6obj-$(CONFIG_MPC8641_HPCN) += mpc86xx_hpcn.o
7obj-$(CONFIG_SBC8641D) += sbc8641d.o
7obj-$(CONFIG_MPC8610_HPCD) += mpc8610_hpcd.o 8obj-$(CONFIG_MPC8610_HPCD) += mpc8610_hpcd.o
diff --git a/arch/powerpc/platforms/86xx/sbc8641d.c b/arch/powerpc/platforms/86xx/sbc8641d.c
new file mode 100644
index 000000000000..510a06ef0b55
--- /dev/null
+++ b/arch/powerpc/platforms/86xx/sbc8641d.c
@@ -0,0 +1,164 @@
1/*
2 * SBC8641D board specific routines
3 *
4 * Copyright 2008 Wind River Systems Inc.
5 *
6 * By Paul Gortmaker (see MAINTAINERS for contact information)
7 *
8 * Based largely on the 8641 HPCN support by Freescale Semiconductor Inc.
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
14 */
15
16#include <linux/stddef.h>
17#include <linux/kernel.h>
18#include <linux/pci.h>
19#include <linux/kdev_t.h>
20#include <linux/delay.h>
21#include <linux/seq_file.h>
22#include <linux/of_platform.h>
23
24#include <asm/system.h>
25#include <asm/time.h>
26#include <asm/machdep.h>
27#include <asm/pci-bridge.h>
28#include <asm/mpc86xx.h>
29#include <asm/prom.h>
30#include <mm/mmu_decl.h>
31#include <asm/udbg.h>
32
33#include <asm/mpic.h>
34
35#include <sysdev/fsl_pci.h>
36#include <sysdev/fsl_soc.h>
37
38#include "mpc86xx.h"
39
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)
65{
66#ifdef CONFIG_PCI
67 struct device_node *np;
68#endif
69
70 if (ppc_md.progress)
71 ppc_md.progress("sbc8641_setup_arch()", 0);
72
73#ifdef CONFIG_PCI
74 for_each_compatible_node(np, "pci", "fsl,mpc8641-pcie")
75 fsl_add_bridge(np, 0);
76#endif
77
78 printk("SBC8641 board from Wind River\n");
79
80#ifdef CONFIG_SMP
81 mpc86xx_smp_init();
82#endif
83}
84
85
86static void
87sbc8641_show_cpuinfo(struct seq_file *m)
88{
89 struct device_node *root;
90 uint memsize = total_memory;
91 const char *model = "";
92 uint svid = mfspr(SPRN_SVR);
93
94 seq_printf(m, "Vendor\t\t: Wind River Systems\n");
95
96 root = of_find_node_by_path("/");
97 if (root)
98 model = of_get_property(root, "model", NULL);
99 seq_printf(m, "Machine\t\t: %s\n", model);
100 of_node_put(root);
101
102 seq_printf(m, "SVR\t\t: 0x%x\n", svid);
103 seq_printf(m, "Memory\t\t: %d MB\n", memsize / (1024 * 1024));
104}
105
106
107/*
108 * Called very early, device-tree isn't unflattened
109 */
110static int __init sbc8641_probe(void)
111{
112 unsigned long root = of_get_flat_dt_root();
113
114 if (of_flat_dt_is_compatible(root, "wind,sbc8641"))
115 return 1; /* Looks good */
116
117 return 0;
118}
119
120static long __init
121mpc86xx_time_init(void)
122{
123 unsigned int temp;
124
125 /* Set the time base to zero */
126 mtspr(SPRN_TBWL, 0);
127 mtspr(SPRN_TBWU, 0);
128
129 temp = mfspr(SPRN_HID0);
130 temp |= HID0_TBEN;
131 mtspr(SPRN_HID0, temp);
132 asm volatile("isync");
133
134 return 0;
135}
136
137static __initdata struct of_device_id of_bus_ids[] = {
138 { .compatible = "simple-bus", },
139 {},
140};
141
142static int __init declare_of_platform_devices(void)
143{
144 of_platform_bus_probe(NULL, of_bus_ids, NULL);
145
146 return 0;
147}
148machine_device_initcall(sbc8641, declare_of_platform_devices);
149
150define_machine(sbc8641) {
151 .name = "SBC8641D",
152 .probe = sbc8641_probe,
153 .setup_arch = sbc8641_setup_arch,
154 .init_IRQ = sbc8641_init_irq,
155 .show_cpuinfo = sbc8641_show_cpuinfo,
156 .get_irq = mpic_get_irq,
157 .restart = fsl_rstcr_restart,
158 .time_init = mpc86xx_time_init,
159 .calibrate_decr = generic_calibrate_decr,
160 .progress = udbg_progress,
161#ifdef CONFIG_PCI
162 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
163#endif
164};