Commit | Line | Data |
---|---|---|
4d22e564 KM |
1 | /* |
2 | * armadillo 800 eva board support | |
3 | * | |
4 | * Copyright (C) 2012 Renesas Solutions Corp. | |
5 | * Copyright (C) 2012 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | |
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 as published by | |
9 | * the Free Software Foundation; version 2 of the License. | |
10 | * | |
11 | * This program is distributed in the hope that it will be useful, | |
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | * GNU General Public License for more details. | |
15 | * | |
16 | * You should have received a copy of the GNU General Public License | |
17 | * along with this program; if not, write to the Free Software | |
18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
19 | * | |
20 | */ | |
21 | ||
22 | #include <linux/clk.h> | |
23 | #include <linux/err.h> | |
24 | #include <linux/kernel.h> | |
25 | #include <linux/platform_device.h> | |
26 | #include <linux/gpio.h> | |
27 | #include <mach/common.h> | |
28 | #include <mach/irqs.h> | |
29 | #include <asm/page.h> | |
30 | #include <asm/mach-types.h> | |
31 | #include <asm/mach/arch.h> | |
32 | #include <asm/mach/map.h> | |
33 | #include <asm/mach/time.h> | |
34 | #include <asm/hardware/cache-l2x0.h> | |
35 | #include <mach/r8a7740.h> | |
36 | ||
37 | /* | |
38 | * CON1 Camera Module | |
39 | * CON2 Extension Bus | |
40 | * CON3 HDMI Output | |
41 | * CON4 Composite Video Output | |
42 | * CON5 H-UDI JTAG | |
43 | * CON6 ARM JTAG | |
44 | * CON7 SD1 | |
45 | * CON8 SD2 | |
46 | * CON9 RTC BackUp | |
47 | * CON10 Monaural Mic Input | |
48 | * CON11 Stereo Headphone Output | |
49 | * CON12 Audio Line Output(L) | |
50 | * CON13 Audio Line Output(R) | |
51 | * CON14 AWL13 Module | |
52 | * CON15 Extension | |
53 | * CON16 LCD1 | |
54 | * CON17 LCD2 | |
55 | * CON19 Power Input | |
56 | * CON20 USB1 | |
57 | * CON21 USB2 | |
58 | * CON22 Serial | |
59 | * CON23 LAN | |
60 | * CON24 USB3 | |
61 | * LED1 Camera LED(Yellow) | |
62 | * LED2 Power LED (Green) | |
63 | * ED3-LED6 User LED(Yellow) | |
64 | * LED7 LAN link LED(Green) | |
65 | * LED8 LAN activity LED(Yellow) | |
66 | */ | |
67 | ||
68 | /* | |
69 | * DipSwitch | |
70 | * | |
71 | * SW1 | |
72 | * | |
73 | * -12345678-+---------------+---------------------------- | |
74 | * 1 | boot | hermit | |
75 | * 0 | boot | OS auto boot | |
76 | * -12345678-+---------------+---------------------------- | |
77 | * 00 | boot device | eMMC | |
78 | * 10 | boot device | SDHI0 (CON7) | |
79 | * 01 | boot device | - | |
80 | * 11 | boot device | Extension Buss (CS0) | |
81 | * -12345678-+---------------+---------------------------- | |
82 | * 0 | Extension Bus | D8-D15 disable, eMMC enable | |
83 | * 1 | Extension Bus | D8-D15 enable, eMMC disable | |
84 | * -12345678-+---------------+---------------------------- | |
85 | * 0 | SDHI1 | COM8 enable, COM14 disable | |
86 | * 1 | SDHI1 | COM8 enable, COM14 disable | |
87 | * -12345678-+---------------+---------------------------- | |
88 | * 00 | JTAG | SH-X2 | |
89 | * 10 | JTAG | ARM | |
90 | * 01 | JTAG | - | |
91 | * 11 | JTAG | Boundary Scan | |
92 | *-----------+---------------+---------------------------- | |
93 | */ | |
94 | ||
95 | /* | |
96 | * board devices | |
97 | */ | |
98 | static struct platform_device *eva_devices[] __initdata = { | |
99 | }; | |
100 | ||
101 | /* | |
102 | * board init | |
103 | */ | |
104 | static void __init eva_init(void) | |
105 | { | |
106 | r8a7740_pinmux_init(); | |
107 | ||
108 | /* SCIFA1 */ | |
109 | gpio_request(GPIO_FN_SCIFA1_RXD, NULL); | |
110 | gpio_request(GPIO_FN_SCIFA1_TXD, NULL); | |
111 | ||
112 | #ifdef CONFIG_CACHE_L2X0 | |
113 | /* Early BRESP enable, Shared attribute override enable, 32K*8way */ | |
114 | l2x0_init(__io(0xf0002000), 0x40440000, 0x82000fff); | |
115 | #endif | |
116 | ||
117 | r8a7740_add_standard_devices(); | |
118 | ||
119 | platform_add_devices(eva_devices, | |
120 | ARRAY_SIZE(eva_devices)); | |
121 | } | |
122 | ||
123 | static void __init eva_earlytimer_init(void) | |
124 | { | |
125 | struct clk *xtal1; | |
126 | ||
127 | r8a7740_clock_init(MD_CK0 | MD_CK2); | |
128 | ||
129 | xtal1 = clk_get(NULL, "extal1"); | |
130 | if (!IS_ERR(xtal1)) { | |
131 | /* armadillo 800 eva extal1 is 24MHz */ | |
132 | clk_set_rate(xtal1, 24000000); | |
133 | clk_put(xtal1); | |
134 | } | |
135 | ||
136 | shmobile_earlytimer_init(); | |
137 | } | |
138 | ||
139 | static void __init eva_add_early_devices(void) | |
140 | { | |
141 | r8a7740_add_early_devices(); | |
142 | ||
143 | /* override timer setup with board-specific code */ | |
144 | shmobile_timer.init = eva_earlytimer_init; | |
145 | } | |
146 | ||
147 | MACHINE_START(ARMADILLO800EVA, "armadillo800eva") | |
148 | .map_io = r8a7740_map_io, | |
149 | .init_early = eva_add_early_devices, | |
150 | .init_irq = r8a7740_init_irq, | |
151 | .handle_irq = shmobile_handle_irq_intc, | |
152 | .init_machine = eva_init, | |
153 | .timer = &shmobile_timer, | |
154 | MACHINE_END |