diff options
author | Heiko Schocher <hs@denx.de> | 2008-06-14 15:02:04 -0400 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2008-09-16 11:01:30 -0400 |
commit | e14d4af0c87af0be7f2d0e204e1922cf4fa3c19e (patch) | |
tree | 5110ff3c34f3be586171aec2be6f4cd34e641b36 /arch/powerpc/platforms/8xx | |
parent | a501d8f30e4fcca563e4ee462be00f96e51181d5 (diff) |
powerpc: Add support for the MPC852 based mgsuvd board from keymile.
Supported SMC1 (serial console), SCC3 Ethernet (10Mbps hdx).
Signed-off-by: Heiko Schocher <hs@denx.de>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms/8xx')
-rw-r--r-- | arch/powerpc/platforms/8xx/Kconfig | 6 | ||||
-rw-r--r-- | arch/powerpc/platforms/8xx/Makefile | 1 | ||||
-rw-r--r-- | arch/powerpc/platforms/8xx/mgsuvd.c | 92 |
3 files changed, 99 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/8xx/Kconfig b/arch/powerpc/platforms/8xx/Kconfig index 71d7562e190b..48a920a98e7b 100644 --- a/arch/powerpc/platforms/8xx/Kconfig +++ b/arch/powerpc/platforms/8xx/Kconfig | |||
@@ -49,6 +49,12 @@ config PPC_ADDER875 | |||
49 | This enables support for the Analogue & Micro Adder 875 | 49 | This enables support for the Analogue & Micro Adder 875 |
50 | board. | 50 | board. |
51 | 51 | ||
52 | config PPC_MGSUVD | ||
53 | bool "MGSUVD" | ||
54 | select CPM1 | ||
55 | help | ||
56 | This enables support for the Keymile MGSUVD board. | ||
57 | |||
52 | endchoice | 58 | endchoice |
53 | 59 | ||
54 | menu "Freescale Ethernet driver platform-specific options" | 60 | menu "Freescale Ethernet driver platform-specific options" |
diff --git a/arch/powerpc/platforms/8xx/Makefile b/arch/powerpc/platforms/8xx/Makefile index 7b71d9c8fb45..bdbfd7496018 100644 --- a/arch/powerpc/platforms/8xx/Makefile +++ b/arch/powerpc/platforms/8xx/Makefile | |||
@@ -6,3 +6,4 @@ obj-$(CONFIG_MPC885ADS) += mpc885ads_setup.o | |||
6 | obj-$(CONFIG_MPC86XADS) += mpc86xads_setup.o | 6 | obj-$(CONFIG_MPC86XADS) += mpc86xads_setup.o |
7 | obj-$(CONFIG_PPC_EP88XC) += ep88xc.o | 7 | obj-$(CONFIG_PPC_EP88XC) += ep88xc.o |
8 | obj-$(CONFIG_PPC_ADDER875) += adder875.o | 8 | obj-$(CONFIG_PPC_ADDER875) += adder875.o |
9 | obj-$(CONFIG_PPC_MGSUVD) += mgsuvd.o | ||
diff --git a/arch/powerpc/platforms/8xx/mgsuvd.c b/arch/powerpc/platforms/8xx/mgsuvd.c new file mode 100644 index 000000000000..ca3cb071772c --- /dev/null +++ b/arch/powerpc/platforms/8xx/mgsuvd.c | |||
@@ -0,0 +1,92 @@ | |||
1 | /* | ||
2 | * | ||
3 | * Platform setup for the Keymile mgsuvd board | ||
4 | * | ||
5 | * Heiko Schocher <hs@denx.de> | ||
6 | * | ||
7 | * Copyright 2008 DENX Software Engineering GmbH | ||
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 any | ||
11 | * kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #include <linux/ioport.h> | ||
15 | #include <linux/of_platform.h> | ||
16 | |||
17 | #include <asm/io.h> | ||
18 | #include <asm/machdep.h> | ||
19 | #include <asm/processor.h> | ||
20 | #include <asm/cpm1.h> | ||
21 | #include <asm/prom.h> | ||
22 | #include <asm/fs_pd.h> | ||
23 | |||
24 | #include "mpc8xx.h" | ||
25 | |||
26 | struct cpm_pin { | ||
27 | int port, pin, flags; | ||
28 | }; | ||
29 | |||
30 | static __initdata struct cpm_pin mgsuvd_pins[] = { | ||
31 | /* SMC1 */ | ||
32 | {CPM_PORTB, 24, CPM_PIN_INPUT}, /* RX */ | ||
33 | {CPM_PORTB, 25, CPM_PIN_INPUT | CPM_PIN_SECONDARY}, /* TX */ | ||
34 | |||
35 | /* SCC3 */ | ||
36 | {CPM_PORTA, 10, CPM_PIN_INPUT}, | ||
37 | {CPM_PORTA, 11, CPM_PIN_INPUT}, | ||
38 | {CPM_PORTA, 3, CPM_PIN_INPUT}, | ||
39 | {CPM_PORTA, 2, CPM_PIN_INPUT}, | ||
40 | {CPM_PORTC, 13, CPM_PIN_INPUT}, | ||
41 | }; | ||
42 | |||
43 | static void __init init_ioports(void) | ||
44 | { | ||
45 | int i; | ||
46 | |||
47 | for (i = 0; i < ARRAY_SIZE(mgsuvd_pins); i++) { | ||
48 | struct cpm_pin *pin = &mgsuvd_pins[i]; | ||
49 | cpm1_set_pin(pin->port, pin->pin, pin->flags); | ||
50 | } | ||
51 | |||
52 | setbits16(&mpc8xx_immr->im_ioport.iop_pcso, 0x300); | ||
53 | cpm1_clk_setup(CPM_CLK_SCC3, CPM_CLK5, CPM_CLK_RX); | ||
54 | cpm1_clk_setup(CPM_CLK_SCC3, CPM_CLK6, CPM_CLK_TX); | ||
55 | cpm1_clk_setup(CPM_CLK_SMC1, CPM_BRG1, CPM_CLK_RTX); | ||
56 | } | ||
57 | |||
58 | static void __init mgsuvd_setup_arch(void) | ||
59 | { | ||
60 | cpm_reset(); | ||
61 | init_ioports(); | ||
62 | } | ||
63 | |||
64 | static __initdata struct of_device_id of_bus_ids[] = { | ||
65 | { .compatible = "simple-bus" }, | ||
66 | {}, | ||
67 | }; | ||
68 | |||
69 | static int __init declare_of_platform_devices(void) | ||
70 | { | ||
71 | of_platform_bus_probe(NULL, of_bus_ids, NULL); | ||
72 | return 0; | ||
73 | } | ||
74 | machine_device_initcall(mgsuvd, declare_of_platform_devices); | ||
75 | |||
76 | static int __init mgsuvd_probe(void) | ||
77 | { | ||
78 | unsigned long root = of_get_flat_dt_root(); | ||
79 | return of_flat_dt_is_compatible(root, "keymile,mgsuvd"); | ||
80 | } | ||
81 | |||
82 | define_machine(mgsuvd) { | ||
83 | .name = "MGSUVD", | ||
84 | .probe = mgsuvd_probe, | ||
85 | .setup_arch = mgsuvd_setup_arch, | ||
86 | .init_IRQ = mpc8xx_pics_init, | ||
87 | .get_irq = mpc8xx_get_irq, | ||
88 | .restart = mpc8xx_restart, | ||
89 | .calibrate_decr = mpc8xx_calibrate_decr, | ||
90 | .set_rtc_time = mpc8xx_set_rtc_time, | ||
91 | .get_rtc_time = mpc8xx_get_rtc_time, | ||
92 | }; | ||