diff options
author | Magnus Damm <damm@opensource.se> | 2011-08-18 01:44:07 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2011-08-29 03:50:08 -0400 |
commit | 28626632d83696ab3c8f2b9d5d8a658a1787551f (patch) | |
tree | 1d6a7d5423036b6a0f116bb11f673e5306963dd9 /arch/arm/mach-shmobile/board-kota2.c | |
parent | c6a389f123b9f68d605bb7e0f9b32ec1e3e14132 (diff) |
ARM: mach-shmobile: Kota2 SCIFA2 and SMSC911X support
Kota2 base board support including the on-chip SCIFA2
serial console and the on-board SMSC911X ethernet port.
The s73a0 SMP bits are also updated to include Kota2.
Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/arm/mach-shmobile/board-kota2.c')
-rw-r--r-- | arch/arm/mach-shmobile/board-kota2.c | 168 |
1 files changed, 168 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/board-kota2.c b/arch/arm/mach-shmobile/board-kota2.c new file mode 100644 index 000000000000..4ab05e855077 --- /dev/null +++ b/arch/arm/mach-shmobile/board-kota2.c | |||
@@ -0,0 +1,168 @@ | |||
1 | /* | ||
2 | * kota2 board support | ||
3 | * | ||
4 | * Copyright (C) 2011 Renesas Solutions Corp. | ||
5 | * Copyright (C) 2011 Magnus Damm | ||
6 | * Copyright (C) 2010 Takashi Yoshii <yoshii.takashi.zj@renesas.com> | ||
7 | * Copyright (C) 2009 Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License as published by | ||
11 | * the Free Software Foundation; version 2 of the License. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
21 | */ | ||
22 | |||
23 | #include <linux/kernel.h> | ||
24 | #include <linux/init.h> | ||
25 | #include <linux/interrupt.h> | ||
26 | #include <linux/irq.h> | ||
27 | #include <linux/platform_device.h> | ||
28 | #include <linux/delay.h> | ||
29 | #include <linux/io.h> | ||
30 | #include <linux/smsc911x.h> | ||
31 | #include <linux/gpio.h> | ||
32 | #include <mach/hardware.h> | ||
33 | #include <mach/sh73a0.h> | ||
34 | #include <mach/common.h> | ||
35 | #include <asm/mach-types.h> | ||
36 | #include <asm/mach/arch.h> | ||
37 | #include <asm/mach/map.h> | ||
38 | #include <asm/mach/time.h> | ||
39 | #include <asm/hardware/gic.h> | ||
40 | #include <asm/hardware/cache-l2x0.h> | ||
41 | #include <asm/traps.h> | ||
42 | |||
43 | static struct resource smsc9220_resources[] = { | ||
44 | [0] = { | ||
45 | .start = 0x14000000, /* CS5A */ | ||
46 | .end = 0x140000ff, /* A1->A7 */ | ||
47 | .flags = IORESOURCE_MEM, | ||
48 | }, | ||
49 | [1] = { | ||
50 | .start = gic_spi(33), /* PINTA2 @ PORT144 */ | ||
51 | .flags = IORESOURCE_IRQ, | ||
52 | }, | ||
53 | }; | ||
54 | |||
55 | static struct smsc911x_platform_config smsc9220_platdata = { | ||
56 | .flags = SMSC911X_USE_32BIT, /* 32-bit SW on 16-bit HW bus */ | ||
57 | .phy_interface = PHY_INTERFACE_MODE_MII, | ||
58 | .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, | ||
59 | .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL, | ||
60 | }; | ||
61 | |||
62 | static struct platform_device eth_device = { | ||
63 | .name = "smsc911x", | ||
64 | .id = 0, | ||
65 | .dev = { | ||
66 | .platform_data = &smsc9220_platdata, | ||
67 | }, | ||
68 | .resource = smsc9220_resources, | ||
69 | .num_resources = ARRAY_SIZE(smsc9220_resources), | ||
70 | }; | ||
71 | |||
72 | static struct platform_device *kota2_devices[] __initdata = { | ||
73 | ð_device, | ||
74 | }; | ||
75 | |||
76 | static struct map_desc kota2_io_desc[] __initdata = { | ||
77 | /* create a 1:1 entity map for 0xe6xxxxxx | ||
78 | * used by CPGA, INTC and PFC. | ||
79 | */ | ||
80 | { | ||
81 | .virtual = 0xe6000000, | ||
82 | .pfn = __phys_to_pfn(0xe6000000), | ||
83 | .length = 256 << 20, | ||
84 | .type = MT_DEVICE_NONSHARED | ||
85 | }, | ||
86 | }; | ||
87 | |||
88 | static void __init kota2_map_io(void) | ||
89 | { | ||
90 | iotable_init(kota2_io_desc, ARRAY_SIZE(kota2_io_desc)); | ||
91 | |||
92 | /* setup early devices and console here as well */ | ||
93 | sh73a0_add_early_devices(); | ||
94 | shmobile_setup_console(); | ||
95 | } | ||
96 | |||
97 | #define PINTER0A 0xe69000a0 | ||
98 | #define PINTCR0A 0xe69000b0 | ||
99 | |||
100 | void __init kota2_init_irq(void) | ||
101 | { | ||
102 | sh73a0_init_irq(); | ||
103 | |||
104 | /* setup PINT: enable PINTA2 as active low */ | ||
105 | __raw_writel(1 << 29, PINTER0A); | ||
106 | __raw_writew(2 << 10, PINTCR0A); | ||
107 | } | ||
108 | |||
109 | static void __init kota2_init(void) | ||
110 | { | ||
111 | sh73a0_pinmux_init(); | ||
112 | |||
113 | /* SCIFA2 (UART2) */ | ||
114 | gpio_request(GPIO_FN_SCIFA2_TXD1, NULL); | ||
115 | gpio_request(GPIO_FN_SCIFA2_RXD1, NULL); | ||
116 | gpio_request(GPIO_FN_SCIFA2_RTS1_, NULL); | ||
117 | gpio_request(GPIO_FN_SCIFA2_CTS1_, NULL); | ||
118 | |||
119 | /* SMSC911X */ | ||
120 | gpio_request(GPIO_FN_D0_NAF0, NULL); | ||
121 | gpio_request(GPIO_FN_D1_NAF1, NULL); | ||
122 | gpio_request(GPIO_FN_D2_NAF2, NULL); | ||
123 | gpio_request(GPIO_FN_D3_NAF3, NULL); | ||
124 | gpio_request(GPIO_FN_D4_NAF4, NULL); | ||
125 | gpio_request(GPIO_FN_D5_NAF5, NULL); | ||
126 | gpio_request(GPIO_FN_D6_NAF6, NULL); | ||
127 | gpio_request(GPIO_FN_D7_NAF7, NULL); | ||
128 | gpio_request(GPIO_FN_D8_NAF8, NULL); | ||
129 | gpio_request(GPIO_FN_D9_NAF9, NULL); | ||
130 | gpio_request(GPIO_FN_D10_NAF10, NULL); | ||
131 | gpio_request(GPIO_FN_D11_NAF11, NULL); | ||
132 | gpio_request(GPIO_FN_D12_NAF12, NULL); | ||
133 | gpio_request(GPIO_FN_D13_NAF13, NULL); | ||
134 | gpio_request(GPIO_FN_D14_NAF14, NULL); | ||
135 | gpio_request(GPIO_FN_D15_NAF15, NULL); | ||
136 | gpio_request(GPIO_FN_CS5A_, NULL); | ||
137 | gpio_request(GPIO_FN_WE0__FWE, NULL); | ||
138 | gpio_request(GPIO_PORT144, NULL); /* PINTA2 */ | ||
139 | gpio_direction_input(GPIO_PORT144); | ||
140 | gpio_request(GPIO_PORT145, NULL); /* RESET */ | ||
141 | gpio_direction_output(GPIO_PORT145, 1); | ||
142 | |||
143 | #ifdef CONFIG_CACHE_L2X0 | ||
144 | /* Early BRESP enable, Shared attribute override enable, 64K*8way */ | ||
145 | l2x0_init(__io(0xf0100000), 0x40460000, 0x82000fff); | ||
146 | #endif | ||
147 | sh73a0_add_standard_devices(); | ||
148 | platform_add_devices(kota2_devices, ARRAY_SIZE(kota2_devices)); | ||
149 | } | ||
150 | |||
151 | static void __init kota2_timer_init(void) | ||
152 | { | ||
153 | sh73a0_clock_init(); | ||
154 | shmobile_timer.init(); | ||
155 | return; | ||
156 | } | ||
157 | |||
158 | struct sys_timer kota2_timer = { | ||
159 | .init = kota2_timer_init, | ||
160 | }; | ||
161 | |||
162 | MACHINE_START(KOTA2, "kota2") | ||
163 | .map_io = kota2_map_io, | ||
164 | .init_irq = kota2_init_irq, | ||
165 | .handle_irq = shmobile_handle_irq_gic, | ||
166 | .init_machine = kota2_init, | ||
167 | .timer = &kota2_timer, | ||
168 | MACHINE_END | ||