diff options
Diffstat (limited to 'arch/powerpc/platforms/8xx')
-rw-r--r-- | arch/powerpc/platforms/8xx/Kconfig | 9 | ||||
-rw-r--r-- | arch/powerpc/platforms/8xx/Makefile | 1 | ||||
-rw-r--r-- | arch/powerpc/platforms/8xx/adder875.c | 118 |
3 files changed, 128 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/8xx/Kconfig b/arch/powerpc/platforms/8xx/Kconfig index 91fbe4241918..7fd224ca233d 100644 --- a/arch/powerpc/platforms/8xx/Kconfig +++ b/arch/powerpc/platforms/8xx/Kconfig | |||
@@ -44,6 +44,15 @@ config PPC_EP88XC | |||
44 | This board is also resold by Freescale as the QUICCStart | 44 | This board is also resold by Freescale as the QUICCStart |
45 | MPC885 Evaluation System and/or the CWH-PPC-885XN-VE. | 45 | MPC885 Evaluation System and/or the CWH-PPC-885XN-VE. |
46 | 46 | ||
47 | config PPC_ADDER875 | ||
48 | bool "Analogue & Micro Adder 875" | ||
49 | select CPM1 | ||
50 | select PPC_CPM_NEW_BINDING | ||
51 | select REDBOOT | ||
52 | help | ||
53 | This enables support for the Analogue & Micro Adder 875 | ||
54 | board. | ||
55 | |||
47 | endchoice | 56 | endchoice |
48 | 57 | ||
49 | menu "Freescale Ethernet driver platform-specific options" | 58 | menu "Freescale Ethernet driver platform-specific options" |
diff --git a/arch/powerpc/platforms/8xx/Makefile b/arch/powerpc/platforms/8xx/Makefile index 8b7098018b59..7b71d9c8fb45 100644 --- a/arch/powerpc/platforms/8xx/Makefile +++ b/arch/powerpc/platforms/8xx/Makefile | |||
@@ -5,3 +5,4 @@ obj-$(CONFIG_PPC_8xx) += m8xx_setup.o | |||
5 | obj-$(CONFIG_MPC885ADS) += mpc885ads_setup.o | 5 | 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 | ||
diff --git a/arch/powerpc/platforms/8xx/adder875.c b/arch/powerpc/platforms/8xx/adder875.c new file mode 100644 index 000000000000..af040fd2dcc6 --- /dev/null +++ b/arch/powerpc/platforms/8xx/adder875.c | |||
@@ -0,0 +1,118 @@ | |||
1 | /* Analogue & Micro Adder MPC875 board support | ||
2 | * | ||
3 | * Author: Scott Wood <scottwood@freescale.com> | ||
4 | * | ||
5 | * Copyright (c) 2007 Freescale Semiconductor, Inc. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License, version 2, as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #include <linux/init.h> | ||
13 | #include <linux/fs_enet_pd.h> | ||
14 | #include <linux/of_platform.h> | ||
15 | |||
16 | #include <asm/time.h> | ||
17 | #include <asm/machdep.h> | ||
18 | #include <asm/commproc.h> | ||
19 | #include <asm/fs_pd.h> | ||
20 | #include <asm/udbg.h> | ||
21 | #include <asm/prom.h> | ||
22 | |||
23 | #include <sysdev/commproc.h> | ||
24 | |||
25 | struct cpm_pin { | ||
26 | int port, pin, flags; | ||
27 | }; | ||
28 | |||
29 | static __initdata struct cpm_pin adder875_pins[] = { | ||
30 | /* SMC1 */ | ||
31 | {CPM_PORTB, 24, CPM_PIN_INPUT}, /* RX */ | ||
32 | {CPM_PORTB, 25, CPM_PIN_INPUT | CPM_PIN_SECONDARY}, /* TX */ | ||
33 | |||
34 | /* MII1 */ | ||
35 | {CPM_PORTA, 0, CPM_PIN_INPUT}, | ||
36 | {CPM_PORTA, 1, CPM_PIN_INPUT}, | ||
37 | {CPM_PORTA, 2, CPM_PIN_INPUT}, | ||
38 | {CPM_PORTA, 3, CPM_PIN_INPUT}, | ||
39 | {CPM_PORTA, 4, CPM_PIN_OUTPUT}, | ||
40 | {CPM_PORTA, 10, CPM_PIN_OUTPUT}, | ||
41 | {CPM_PORTA, 11, CPM_PIN_OUTPUT}, | ||
42 | {CPM_PORTB, 19, CPM_PIN_INPUT}, | ||
43 | {CPM_PORTB, 31, CPM_PIN_INPUT}, | ||
44 | {CPM_PORTC, 12, CPM_PIN_INPUT}, | ||
45 | {CPM_PORTC, 13, CPM_PIN_INPUT}, | ||
46 | {CPM_PORTE, 30, CPM_PIN_OUTPUT}, | ||
47 | {CPM_PORTE, 31, CPM_PIN_OUTPUT}, | ||
48 | |||
49 | /* MII2 */ | ||
50 | {CPM_PORTE, 14, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY}, | ||
51 | {CPM_PORTE, 15, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY}, | ||
52 | {CPM_PORTE, 16, CPM_PIN_OUTPUT}, | ||
53 | {CPM_PORTE, 17, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY}, | ||
54 | {CPM_PORTE, 18, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY}, | ||
55 | {CPM_PORTE, 19, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY}, | ||
56 | {CPM_PORTE, 20, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY}, | ||
57 | {CPM_PORTE, 21, CPM_PIN_OUTPUT}, | ||
58 | {CPM_PORTE, 22, CPM_PIN_OUTPUT}, | ||
59 | {CPM_PORTE, 23, CPM_PIN_OUTPUT}, | ||
60 | {CPM_PORTE, 24, CPM_PIN_OUTPUT}, | ||
61 | {CPM_PORTE, 25, CPM_PIN_OUTPUT}, | ||
62 | {CPM_PORTE, 26, CPM_PIN_OUTPUT}, | ||
63 | {CPM_PORTE, 27, CPM_PIN_OUTPUT}, | ||
64 | {CPM_PORTE, 28, CPM_PIN_OUTPUT}, | ||
65 | {CPM_PORTE, 29, CPM_PIN_OUTPUT}, | ||
66 | }; | ||
67 | |||
68 | static void __init init_ioports(void) | ||
69 | { | ||
70 | int i; | ||
71 | |||
72 | for (i = 0; i < ARRAY_SIZE(adder875_pins); i++) { | ||
73 | const struct cpm_pin *pin = &adder875_pins[i]; | ||
74 | cpm1_set_pin(pin->port, pin->pin, pin->flags); | ||
75 | } | ||
76 | |||
77 | cpm1_clk_setup(CPM_CLK_SMC1, CPM_BRG1, CPM_CLK_RTX); | ||
78 | |||
79 | /* Set FEC1 and FEC2 to MII mode */ | ||
80 | clrbits32(&mpc8xx_immr->im_cpm.cp_cptr, 0x00000180); | ||
81 | } | ||
82 | |||
83 | static void __init adder875_setup(void) | ||
84 | { | ||
85 | cpm_reset(); | ||
86 | init_ioports(); | ||
87 | } | ||
88 | |||
89 | static int __init adder875_probe(void) | ||
90 | { | ||
91 | unsigned long root = of_get_flat_dt_root(); | ||
92 | return of_flat_dt_is_compatible(root, "analogue-and-micro,adder875"); | ||
93 | } | ||
94 | |||
95 | static __initdata struct of_device_id __initdata of_bus_ids[] = { | ||
96 | { .compatible = "simple-bus", }, | ||
97 | {}, | ||
98 | }; | ||
99 | |||
100 | static int __init declare_of_platform_devices(void) | ||
101 | { | ||
102 | of_platform_bus_probe(NULL, of_bus_ids, NULL); | ||
103 | return 0; | ||
104 | } | ||
105 | machine_device_initcall(adder875, declare_of_platform_devices); | ||
106 | |||
107 | define_machine(adder875) { | ||
108 | .name = "Adder MPC875", | ||
109 | .probe = adder875_probe, | ||
110 | .setup_arch = adder875_setup, | ||
111 | .init_IRQ = m8xx_pic_init, | ||
112 | .get_irq = mpc8xx_get_irq, | ||
113 | .restart = mpc8xx_restart, | ||
114 | .calibrate_decr = generic_calibrate_decr, | ||
115 | .set_rtc_time = mpc8xx_set_rtc_time, | ||
116 | .get_rtc_time = mpc8xx_get_rtc_time, | ||
117 | .progress = udbg_progress, | ||
118 | }; | ||