diff options
author | Heiko Schocher <hs@denx.de> | 2008-06-18 04:38:32 -0400 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2008-09-16 11:01:32 -0400 |
commit | 637166337ca29459581bd2943072a9f1268fb982 (patch) | |
tree | dd98fa6a565517eca25d63345f3bb962306f5e01 /arch/powerpc/platforms/82xx | |
parent | e14d4af0c87af0be7f2d0e204e1922cf4fa3c19e (diff) |
powerpc: Add support for mpc8247 based board MGCOGE from keymile.
Signed-off-by: Heiko Schocher <hs@denx.de>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms/82xx')
-rw-r--r-- | arch/powerpc/platforms/82xx/Kconfig | 8 | ||||
-rw-r--r-- | arch/powerpc/platforms/82xx/Makefile | 1 | ||||
-rw-r--r-- | arch/powerpc/platforms/82xx/mgcoge.c | 129 |
3 files changed, 138 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/82xx/Kconfig b/arch/powerpc/platforms/82xx/Kconfig index 75eb1ede5497..30f008b2f92e 100644 --- a/arch/powerpc/platforms/82xx/Kconfig +++ b/arch/powerpc/platforms/82xx/Kconfig | |||
@@ -38,6 +38,14 @@ config EP8248E | |||
38 | This board is also resold by Freescale as the QUICCStart | 38 | This board is also resold by Freescale as the QUICCStart |
39 | MPC8248 Evaluation System and/or the CWH-PPC-8248N-VE. | 39 | MPC8248 Evaluation System and/or the CWH-PPC-8248N-VE. |
40 | 40 | ||
41 | config MGCOGE | ||
42 | bool "Keymile MGCOGE" | ||
43 | select 8272 | ||
44 | select 8260 | ||
45 | select FSL_SOC | ||
46 | help | ||
47 | This enables support for the Keymile MGCOGE board. | ||
48 | |||
41 | endif | 49 | endif |
42 | 50 | ||
43 | config PQ2ADS | 51 | config PQ2ADS |
diff --git a/arch/powerpc/platforms/82xx/Makefile b/arch/powerpc/platforms/82xx/Makefile index 6cd5cd59bf2a..d982793f4dbd 100644 --- a/arch/powerpc/platforms/82xx/Makefile +++ b/arch/powerpc/platforms/82xx/Makefile | |||
@@ -6,3 +6,4 @@ obj-$(CONFIG_CPM2) += pq2.o | |||
6 | obj-$(CONFIG_PQ2_ADS_PCI_PIC) += pq2ads-pci-pic.o | 6 | obj-$(CONFIG_PQ2_ADS_PCI_PIC) += pq2ads-pci-pic.o |
7 | obj-$(CONFIG_PQ2FADS) += pq2fads.o | 7 | obj-$(CONFIG_PQ2FADS) += pq2fads.o |
8 | obj-$(CONFIG_EP8248E) += ep8248e.o | 8 | obj-$(CONFIG_EP8248E) += ep8248e.o |
9 | obj-$(CONFIG_MGCOGE) += mgcoge.o | ||
diff --git a/arch/powerpc/platforms/82xx/mgcoge.c b/arch/powerpc/platforms/82xx/mgcoge.c new file mode 100644 index 000000000000..c2af169c1d1d --- /dev/null +++ b/arch/powerpc/platforms/82xx/mgcoge.c | |||
@@ -0,0 +1,129 @@ | |||
1 | /* | ||
2 | * Keymile mgcoge support | ||
3 | * Copyright 2008 DENX Software Engineering GmbH | ||
4 | * Author: Heiko Schocher <hs@denx.de> | ||
5 | * | ||
6 | * based on code from: | ||
7 | * Copyright 2007 Freescale Semiconductor, Inc. | ||
8 | * Author: Scott Wood <scottwood@freescale.com> | ||
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/init.h> | ||
17 | #include <linux/interrupt.h> | ||
18 | #include <linux/fsl_devices.h> | ||
19 | #include <linux/of_platform.h> | ||
20 | |||
21 | #include <asm/io.h> | ||
22 | #include <asm/cpm2.h> | ||
23 | #include <asm/udbg.h> | ||
24 | #include <asm/machdep.h> | ||
25 | #include <asm/time.h> | ||
26 | #include <asm/mpc8260.h> | ||
27 | #include <asm/prom.h> | ||
28 | |||
29 | #include <sysdev/fsl_soc.h> | ||
30 | #include <sysdev/cpm2_pic.h> | ||
31 | |||
32 | #include "pq2.h" | ||
33 | |||
34 | static void __init mgcoge_pic_init(void) | ||
35 | { | ||
36 | struct device_node *np = of_find_compatible_node(NULL, NULL, "fsl,pq2-pic"); | ||
37 | if (!np) { | ||
38 | printk(KERN_ERR "PIC init: can not find cpm-pic node\n"); | ||
39 | return; | ||
40 | } | ||
41 | |||
42 | cpm2_pic_init(np); | ||
43 | of_node_put(np); | ||
44 | } | ||
45 | |||
46 | struct cpm_pin { | ||
47 | int port, pin, flags; | ||
48 | }; | ||
49 | |||
50 | static __initdata struct cpm_pin mgcoge_pins[] = { | ||
51 | |||
52 | /* SMC2 */ | ||
53 | {1, 8, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, | ||
54 | {1, 9, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY}, | ||
55 | |||
56 | /* SCC4 */ | ||
57 | {3, 25, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, | ||
58 | {3, 24, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, | ||
59 | {3, 9, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, | ||
60 | {3, 8, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, | ||
61 | {4, 22, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, | ||
62 | {4, 21, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY}, | ||
63 | }; | ||
64 | |||
65 | static void __init init_ioports(void) | ||
66 | { | ||
67 | int i; | ||
68 | |||
69 | for (i = 0; i < ARRAY_SIZE(mgcoge_pins); i++) { | ||
70 | const struct cpm_pin *pin = &mgcoge_pins[i]; | ||
71 | cpm2_set_pin(pin->port - 1, pin->pin, pin->flags); | ||
72 | } | ||
73 | |||
74 | cpm2_smc_clk_setup(CPM_CLK_SMC2, CPM_BRG8); | ||
75 | cpm2_clk_setup(CPM_CLK_SCC4, CPM_CLK7, CPM_CLK_RX); | ||
76 | cpm2_clk_setup(CPM_CLK_SCC4, CPM_CLK8, CPM_CLK_TX); | ||
77 | } | ||
78 | |||
79 | static void __init mgcoge_setup_arch(void) | ||
80 | { | ||
81 | if (ppc_md.progress) | ||
82 | ppc_md.progress("mgcoge_setup_arch()", 0); | ||
83 | |||
84 | cpm2_reset(); | ||
85 | |||
86 | /* When this is set, snooping CPM DMA from RAM causes | ||
87 | * machine checks. See erratum SIU18. | ||
88 | */ | ||
89 | clrbits32(&cpm2_immr->im_siu_conf.siu_82xx.sc_bcr, MPC82XX_BCR_PLDP); | ||
90 | |||
91 | init_ioports(); | ||
92 | |||
93 | if (ppc_md.progress) | ||
94 | ppc_md.progress("mgcoge_setup_arch(), finish", 0); | ||
95 | } | ||
96 | |||
97 | static __initdata struct of_device_id of_bus_ids[] = { | ||
98 | { .compatible = "simple-bus", }, | ||
99 | {}, | ||
100 | }; | ||
101 | |||
102 | static int __init declare_of_platform_devices(void) | ||
103 | { | ||
104 | of_platform_bus_probe(NULL, of_bus_ids, NULL); | ||
105 | |||
106 | return 0; | ||
107 | } | ||
108 | machine_device_initcall(mgcoge, declare_of_platform_devices); | ||
109 | |||
110 | /* | ||
111 | * Called very early, device-tree isn't unflattened | ||
112 | */ | ||
113 | static int __init mgcoge_probe(void) | ||
114 | { | ||
115 | unsigned long root = of_get_flat_dt_root(); | ||
116 | return of_flat_dt_is_compatible(root, "keymile,mgcoge"); | ||
117 | } | ||
118 | |||
119 | define_machine(mgcoge) | ||
120 | { | ||
121 | .name = "Keymile MGCOGE", | ||
122 | .probe = mgcoge_probe, | ||
123 | .setup_arch = mgcoge_setup_arch, | ||
124 | .init_IRQ = mgcoge_pic_init, | ||
125 | .get_irq = cpm2_get_irq, | ||
126 | .calibrate_decr = generic_calibrate_decr, | ||
127 | .restart = pq2_restart, | ||
128 | .progress = udbg_progress, | ||
129 | }; | ||