diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-21 18:38:49 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-21 18:38:49 -0500 |
commit | a8f3740feb12928be1aad19659bf3527ea8d6d96 (patch) | |
tree | f455479d5b9edd38ed2ca2ab878d2217025960db /arch/arm/mach-nomadik | |
parent | 6c5096e5538b455bc3bea2b02588c380f070d8c6 (diff) | |
parent | 89dfe564b5926297ee29b973fe75e25c83c5e615 (diff) |
Merge tag 'dt' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC device tree conversions from Arnd Bergmann:
"These are device tree conversions for a number of platforms, with the
intention of turning code from board files into device tree
descriptions. Notable changes are:
- davinci bindings for pinctrl, MTD, RTC, watchdog and i2c
- nomadik bindings for all devices, removing the board files
- bcm2835 bindings for mmc and i2c
- tegra bindings for hdmi, keyboard, audio, as well as some updates
- at91 bindings for hardware ecc and for devices on RM9200
- mxs bindings for cfa100xx
- sunxi support for Miniand Hackberry board"
* tag 'dt' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (72 commits)
Revert "sunxi: a10-cubieboard: Add user LEDs to the device tree"
Revert "sunxi: a13-olinuxino: Add user LED to the device tree"
clk: tegra: initialise parent of uart clocks
ARM: tegra: remove clock-frequency properties from serial nodes
clk: tegra: fix driver to match DT binding
clk: tegra: local arrays should be static
clk: tegra: Add missing spinlock for hclk and pclk
clk: tegra: Implement locking for super clock
clk: tegra: fix wrong clock index between se to sata_cold
sunxi: a13-olinuxino: Add user LED to the device tree
ARM: davinci: da850 DT: add support for machine reboot
ARM: davinci: da850: add wdt DT node
ARM: davinci: da850: add DT node for I2C0
ARM: at91: at91sam9n12: add DT parameters to enable PMECC
ARM: at91: at91sam9x5: add DT parameters to enable PMECC
ARM: at91: add EMAC bindings to RM9200 DT
ARM: at91: add SSC bindings to RM9200 DT
ARM: at91: add MMC bindings to RM9200 DT
ARM: at91: Animeo IP: enable watchdog support
ARM: nomadik: fix OF compilation regression
...
Diffstat (limited to 'arch/arm/mach-nomadik')
-rw-r--r-- | arch/arm/mach-nomadik/Kconfig | 10 | ||||
-rw-r--r-- | arch/arm/mach-nomadik/Makefile | 6 | ||||
-rw-r--r-- | arch/arm/mach-nomadik/board-nhk8815.c | 353 | ||||
-rw-r--r-- | arch/arm/mach-nomadik/cpu-8815.c | 358 | ||||
-rw-r--r-- | arch/arm/mach-nomadik/cpu-8815.h | 4 | ||||
-rw-r--r-- | arch/arm/mach-nomadik/i2c-8815nhk.c | 88 | ||||
-rw-r--r-- | arch/arm/mach-nomadik/include/mach/hardware.h | 90 | ||||
-rw-r--r-- | arch/arm/mach-nomadik/include/mach/irqs.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-nomadik/include/mach/uncompress.h | 1 |
9 files changed, 266 insertions, 646 deletions
diff --git a/arch/arm/mach-nomadik/Kconfig b/arch/arm/mach-nomadik/Kconfig index 706dc5727bbe..82226a5d60ef 100644 --- a/arch/arm/mach-nomadik/Kconfig +++ b/arch/arm/mach-nomadik/Kconfig | |||
@@ -4,19 +4,13 @@ menu "Nomadik boards" | |||
4 | 4 | ||
5 | config MACH_NOMADIK_8815NHK | 5 | config MACH_NOMADIK_8815NHK |
6 | bool "ST 8815 Nomadik Hardware Kit (evaluation board)" | 6 | bool "ST 8815 Nomadik Hardware Kit (evaluation board)" |
7 | select CLKSRC_NOMADIK_MTU | ||
8 | select NOMADIK_8815 | 7 | select NOMADIK_8815 |
8 | select I2C | ||
9 | select I2C_ALGOBIT | ||
9 | 10 | ||
10 | endmenu | 11 | endmenu |
11 | 12 | ||
12 | config NOMADIK_8815 | 13 | config NOMADIK_8815 |
13 | bool | 14 | bool |
14 | 15 | ||
15 | config I2C_BITBANG_8815NHK | ||
16 | tristate "Driver for bit-bang busses found on the 8815 NHK" | ||
17 | depends on I2C && MACH_NOMADIK_8815NHK | ||
18 | depends on PINCTRL_NOMADIK | ||
19 | default y | ||
20 | select I2C_ALGOBIT | ||
21 | |||
22 | endif | 16 | endif |
diff --git a/arch/arm/mach-nomadik/Makefile b/arch/arm/mach-nomadik/Makefile index a42c9a33d3bf..1071c3b04d1a 100644 --- a/arch/arm/mach-nomadik/Makefile +++ b/arch/arm/mach-nomadik/Makefile | |||
@@ -9,9 +9,3 @@ | |||
9 | 9 | ||
10 | # Cpu revision | 10 | # Cpu revision |
11 | obj-$(CONFIG_NOMADIK_8815) += cpu-8815.o | 11 | obj-$(CONFIG_NOMADIK_8815) += cpu-8815.o |
12 | |||
13 | # Specific board support | ||
14 | obj-$(CONFIG_MACH_NOMADIK_8815NHK) += board-nhk8815.o | ||
15 | |||
16 | # Nomadik extra devices | ||
17 | obj-$(CONFIG_I2C_BITBANG_8815NHK) += i2c-8815nhk.o | ||
diff --git a/arch/arm/mach-nomadik/board-nhk8815.c b/arch/arm/mach-nomadik/board-nhk8815.c deleted file mode 100644 index aaed48d94374..000000000000 --- a/arch/arm/mach-nomadik/board-nhk8815.c +++ /dev/null | |||
@@ -1,353 +0,0 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-nomadik/board-8815nhk.c | ||
3 | * | ||
4 | * Copyright (C) STMicroelectronics | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2, as | ||
8 | * published by the Free Software Foundation. | ||
9 | * | ||
10 | * NHK15 board specifc driver definition | ||
11 | */ | ||
12 | #include <linux/types.h> | ||
13 | #include <linux/kernel.h> | ||
14 | #include <linux/init.h> | ||
15 | #include <linux/platform_device.h> | ||
16 | #include <linux/amba/bus.h> | ||
17 | #include <linux/amba/mmci.h> | ||
18 | #include <linux/interrupt.h> | ||
19 | #include <linux/gpio.h> | ||
20 | #include <linux/mtd/mtd.h> | ||
21 | #include <linux/mtd/nand.h> | ||
22 | #include <linux/mtd/fsmc.h> | ||
23 | #include <linux/mtd/onenand.h> | ||
24 | #include <linux/mtd/partitions.h> | ||
25 | #include <linux/i2c.h> | ||
26 | #include <linux/io.h> | ||
27 | #include <linux/pinctrl/machine.h> | ||
28 | #include <linux/platform_data/pinctrl-nomadik.h> | ||
29 | #include <linux/platform_data/clocksource-nomadik-mtu.h> | ||
30 | #include <asm/sizes.h> | ||
31 | #include <asm/mach-types.h> | ||
32 | #include <asm/mach/arch.h> | ||
33 | #include <asm/mach/flash.h> | ||
34 | #include <asm/mach/time.h> | ||
35 | #include <mach/irqs.h> | ||
36 | |||
37 | #include "cpu-8815.h" | ||
38 | |||
39 | /* Initial value for SRC control register: all timers use MXTAL/8 source */ | ||
40 | #define SRC_CR_INIT_MASK 0x00007fff | ||
41 | #define SRC_CR_INIT_VAL 0x2aaa8000 | ||
42 | |||
43 | #define ALE_OFF 0x1000000 | ||
44 | #define CLE_OFF 0x800000 | ||
45 | |||
46 | /* These addresses span 16MB, so use three individual pages */ | ||
47 | static struct resource nhk8815_nand_resources[] = { | ||
48 | { | ||
49 | .name = "nand_data", | ||
50 | .start = 0x40000000, | ||
51 | .end = 0x40000000 + SZ_16K - 1, | ||
52 | .flags = IORESOURCE_MEM, | ||
53 | }, { | ||
54 | .name = "nand_addr", | ||
55 | .start = 0x40000000 + ALE_OFF, | ||
56 | .end = 0x40000000 +ALE_OFF + SZ_16K - 1, | ||
57 | .flags = IORESOURCE_MEM, | ||
58 | }, { | ||
59 | .name = "nand_cmd", | ||
60 | .start = 0x40000000 + CLE_OFF, | ||
61 | .end = 0x40000000 + CLE_OFF + SZ_16K - 1, | ||
62 | .flags = IORESOURCE_MEM, | ||
63 | }, { | ||
64 | .name = "fsmc_regs", | ||
65 | .start = NOMADIK_FSMC_BASE, | ||
66 | .end = NOMADIK_FSMC_BASE + SZ_4K - 1, | ||
67 | .flags = IORESOURCE_MEM, | ||
68 | }, | ||
69 | }; | ||
70 | |||
71 | /* | ||
72 | * These partitions are the same as those used in the 2.6.20 release | ||
73 | * shipped by the vendor; the first two partitions are mandated | ||
74 | * by the boot ROM, and the bootloader area is somehow oversized... | ||
75 | */ | ||
76 | static struct mtd_partition nhk8815_partitions[] = { | ||
77 | { | ||
78 | .name = "X-Loader(NAND)", | ||
79 | .offset = 0, | ||
80 | .size = SZ_256K, | ||
81 | }, { | ||
82 | .name = "MemInit(NAND)", | ||
83 | .offset = MTDPART_OFS_APPEND, | ||
84 | .size = SZ_256K, | ||
85 | }, { | ||
86 | .name = "BootLoader(NAND)", | ||
87 | .offset = MTDPART_OFS_APPEND, | ||
88 | .size = SZ_2M, | ||
89 | }, { | ||
90 | .name = "Kernel zImage(NAND)", | ||
91 | .offset = MTDPART_OFS_APPEND, | ||
92 | .size = 3 * SZ_1M, | ||
93 | }, { | ||
94 | .name = "Root Filesystem(NAND)", | ||
95 | .offset = MTDPART_OFS_APPEND, | ||
96 | .size = 22 * SZ_1M, | ||
97 | }, { | ||
98 | .name = "User Filesystem(NAND)", | ||
99 | .offset = MTDPART_OFS_APPEND, | ||
100 | .size = MTDPART_SIZ_FULL, | ||
101 | } | ||
102 | }; | ||
103 | |||
104 | static struct fsmc_nand_timings nhk8815_nand_timings = { | ||
105 | .thiz = 0, | ||
106 | .thold = 0x10, | ||
107 | .twait = 0x0A, | ||
108 | .tset = 0, | ||
109 | }; | ||
110 | |||
111 | static struct fsmc_nand_platform_data nhk8815_nand_platform_data = { | ||
112 | .nand_timings = &nhk8815_nand_timings, | ||
113 | .partitions = nhk8815_partitions, | ||
114 | .nr_partitions = ARRAY_SIZE(nhk8815_partitions), | ||
115 | .width = FSMC_NAND_BW8, | ||
116 | }; | ||
117 | |||
118 | static struct platform_device nhk8815_nand_device = { | ||
119 | .name = "fsmc-nand", | ||
120 | .id = -1, | ||
121 | .resource = nhk8815_nand_resources, | ||
122 | .num_resources = ARRAY_SIZE(nhk8815_nand_resources), | ||
123 | .dev = { | ||
124 | .platform_data = &nhk8815_nand_platform_data, | ||
125 | }, | ||
126 | }; | ||
127 | |||
128 | /* These are the partitions for the OneNand device, different from above */ | ||
129 | static struct mtd_partition nhk8815_onenand_partitions[] = { | ||
130 | { | ||
131 | .name = "X-Loader(OneNAND)", | ||
132 | .offset = 0, | ||
133 | .size = SZ_256K, | ||
134 | }, { | ||
135 | .name = "MemInit(OneNAND)", | ||
136 | .offset = MTDPART_OFS_APPEND, | ||
137 | .size = SZ_256K, | ||
138 | }, { | ||
139 | .name = "BootLoader(OneNAND)", | ||
140 | .offset = MTDPART_OFS_APPEND, | ||
141 | .size = SZ_2M-SZ_256K, | ||
142 | }, { | ||
143 | .name = "SysImage(OneNAND)", | ||
144 | .offset = MTDPART_OFS_APPEND, | ||
145 | .size = 4 * SZ_1M, | ||
146 | }, { | ||
147 | .name = "Root Filesystem(OneNAND)", | ||
148 | .offset = MTDPART_OFS_APPEND, | ||
149 | .size = 22 * SZ_1M, | ||
150 | }, { | ||
151 | .name = "User Filesystem(OneNAND)", | ||
152 | .offset = MTDPART_OFS_APPEND, | ||
153 | .size = MTDPART_SIZ_FULL, | ||
154 | } | ||
155 | }; | ||
156 | |||
157 | static struct onenand_platform_data nhk8815_onenand_data = { | ||
158 | .parts = nhk8815_onenand_partitions, | ||
159 | .nr_parts = ARRAY_SIZE(nhk8815_onenand_partitions), | ||
160 | }; | ||
161 | |||
162 | static struct resource nhk8815_onenand_resource[] = { | ||
163 | { | ||
164 | .start = 0x30000000, | ||
165 | .end = 0x30000000 + SZ_128K - 1, | ||
166 | .flags = IORESOURCE_MEM, | ||
167 | }, | ||
168 | }; | ||
169 | |||
170 | static struct platform_device nhk8815_onenand_device = { | ||
171 | .name = "onenand-flash", | ||
172 | .id = -1, | ||
173 | .dev = { | ||
174 | .platform_data = &nhk8815_onenand_data, | ||
175 | }, | ||
176 | .resource = nhk8815_onenand_resource, | ||
177 | .num_resources = ARRAY_SIZE(nhk8815_onenand_resource), | ||
178 | }; | ||
179 | |||
180 | /* bus control reg. and bus timing reg. for CS0..CS3 */ | ||
181 | #define FSMC_BCR(x) (NOMADIK_FSMC_VA + (x << 3)) | ||
182 | #define FSMC_BTR(x) (NOMADIK_FSMC_VA + (x << 3) + 0x04) | ||
183 | |||
184 | static void __init nhk8815_onenand_init(void) | ||
185 | { | ||
186 | #ifdef CONFIG_MTD_ONENAND | ||
187 | /* Set up SMCS0 for OneNand */ | ||
188 | writel(0x000030db, FSMC_BCR(0)); | ||
189 | writel(0x02100551, FSMC_BTR(0)); | ||
190 | #endif | ||
191 | } | ||
192 | |||
193 | static struct mmci_platform_data mmcsd_plat_data = { | ||
194 | .ocr_mask = MMC_VDD_29_30, | ||
195 | .f_max = 48000000, | ||
196 | .gpio_wp = -1, | ||
197 | .gpio_cd = 111, | ||
198 | .cd_invert = true, | ||
199 | .capabilities = MMC_CAP_MMC_HIGHSPEED | | ||
200 | MMC_CAP_SD_HIGHSPEED | MMC_CAP_4_BIT_DATA, | ||
201 | }; | ||
202 | |||
203 | static int __init nhk8815_mmcsd_init(void) | ||
204 | { | ||
205 | int ret; | ||
206 | |||
207 | ret = gpio_request(112, "card detect bias"); | ||
208 | if (ret) | ||
209 | return ret; | ||
210 | gpio_direction_output(112, 0); | ||
211 | amba_apb_device_add(NULL, "mmci", NOMADIK_SDI_BASE, SZ_4K, IRQ_SDMMC, 0, &mmcsd_plat_data, 0x10180180); | ||
212 | return 0; | ||
213 | } | ||
214 | module_init(nhk8815_mmcsd_init); | ||
215 | |||
216 | static struct resource nhk8815_eth_resources[] = { | ||
217 | { | ||
218 | .name = "smc91x-regs", | ||
219 | .start = 0x34000000 + 0x300, | ||
220 | .end = 0x34000000 + SZ_64K - 1, | ||
221 | .flags = IORESOURCE_MEM, | ||
222 | }, { | ||
223 | .start = NOMADIK_GPIO_TO_IRQ(115), | ||
224 | .end = NOMADIK_GPIO_TO_IRQ(115), | ||
225 | .flags = IORESOURCE_IRQ | IRQF_TRIGGER_RISING, | ||
226 | } | ||
227 | }; | ||
228 | |||
229 | static struct platform_device nhk8815_eth_device = { | ||
230 | .name = "smc91x", | ||
231 | .resource = nhk8815_eth_resources, | ||
232 | .num_resources = ARRAY_SIZE(nhk8815_eth_resources), | ||
233 | }; | ||
234 | |||
235 | static int __init nhk8815_eth_init(void) | ||
236 | { | ||
237 | int gpio_nr = 115; /* hardwired in the board */ | ||
238 | int err; | ||
239 | |||
240 | err = gpio_request(gpio_nr, "eth_irq"); | ||
241 | if (!err) err = nmk_gpio_set_mode(gpio_nr, NMK_GPIO_ALT_GPIO); | ||
242 | if (!err) err = gpio_direction_input(gpio_nr); | ||
243 | if (err) | ||
244 | pr_err("Error %i in %s\n", err, __func__); | ||
245 | return err; | ||
246 | } | ||
247 | device_initcall(nhk8815_eth_init); | ||
248 | |||
249 | static struct platform_device *nhk8815_platform_devices[] __initdata = { | ||
250 | &nhk8815_nand_device, | ||
251 | &nhk8815_onenand_device, | ||
252 | &nhk8815_eth_device, | ||
253 | /* will add more devices */ | ||
254 | }; | ||
255 | |||
256 | static void __init nomadik_timer_init(void) | ||
257 | { | ||
258 | u32 src_cr; | ||
259 | |||
260 | /* Configure timer sources in "system reset controller" ctrl reg */ | ||
261 | src_cr = readl(io_p2v(NOMADIK_SRC_BASE)); | ||
262 | src_cr &= SRC_CR_INIT_MASK; | ||
263 | src_cr |= SRC_CR_INIT_VAL; | ||
264 | writel(src_cr, io_p2v(NOMADIK_SRC_BASE)); | ||
265 | |||
266 | nmdk_timer_init(io_p2v(NOMADIK_MTU0_BASE), IRQ_MTU0); | ||
267 | } | ||
268 | |||
269 | static struct i2c_board_info __initdata nhk8815_i2c0_devices[] = { | ||
270 | { | ||
271 | I2C_BOARD_INFO("stw4811", 0x2d), | ||
272 | }, | ||
273 | }; | ||
274 | |||
275 | static struct i2c_board_info __initdata nhk8815_i2c1_devices[] = { | ||
276 | { | ||
277 | I2C_BOARD_INFO("camera", 0x10), | ||
278 | }, | ||
279 | { | ||
280 | I2C_BOARD_INFO("stw5095", 0x1a), | ||
281 | }, | ||
282 | { | ||
283 | I2C_BOARD_INFO("lis3lv02dl", 0x1d), | ||
284 | }, | ||
285 | }; | ||
286 | |||
287 | static struct i2c_board_info __initdata nhk8815_i2c2_devices[] = { | ||
288 | { | ||
289 | I2C_BOARD_INFO("stw4811-usb", 0x2d), | ||
290 | }, | ||
291 | }; | ||
292 | |||
293 | static unsigned long out_low[] = { PIN_OUTPUT_LOW }; | ||
294 | static unsigned long out_high[] = { PIN_OUTPUT_HIGH }; | ||
295 | static unsigned long in_nopull[] = { PIN_INPUT_NOPULL }; | ||
296 | static unsigned long in_pullup[] = { PIN_INPUT_PULLUP }; | ||
297 | |||
298 | static struct pinctrl_map __initdata nhk8815_pinmap[] = { | ||
299 | PIN_MAP_MUX_GROUP_DEFAULT("uart0", "pinctrl-stn8815", "u0_a_1", "u0"), | ||
300 | PIN_MAP_MUX_GROUP_DEFAULT("uart1", "pinctrl-stn8815", "u1_a_1", "u1"), | ||
301 | /* Hog in MMC/SD card mux */ | ||
302 | PIN_MAP_MUX_GROUP_HOG_DEFAULT("pinctrl-stn8815", "mmcsd_a_1", "mmcsd"), | ||
303 | /* MCCLK */ | ||
304 | PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO8_B10", out_low), | ||
305 | /* MCCMD */ | ||
306 | PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO9_A10", in_pullup), | ||
307 | /* MCCMDDIR */ | ||
308 | PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO10_C11", out_high), | ||
309 | /* MCDAT3-0 */ | ||
310 | PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO11_B11", in_pullup), | ||
311 | PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO12_A11", in_pullup), | ||
312 | PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO13_C12", in_pullup), | ||
313 | PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO14_B12", in_pullup), | ||
314 | /* MCDAT0DIR */ | ||
315 | PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO15_A12", out_high), | ||
316 | /* MCDAT31DIR */ | ||
317 | PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO16_C13", out_high), | ||
318 | /* MCMSFBCLK */ | ||
319 | PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO24_C15", in_pullup), | ||
320 | /* CD input GPIO */ | ||
321 | PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO111_H21", in_nopull), | ||
322 | /* CD bias drive */ | ||
323 | PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO112_J21", out_low), | ||
324 | }; | ||
325 | |||
326 | static void __init nhk8815_platform_init(void) | ||
327 | { | ||
328 | pinctrl_register_mappings(nhk8815_pinmap, ARRAY_SIZE(nhk8815_pinmap)); | ||
329 | cpu8815_platform_init(); | ||
330 | nhk8815_onenand_init(); | ||
331 | platform_add_devices(nhk8815_platform_devices, | ||
332 | ARRAY_SIZE(nhk8815_platform_devices)); | ||
333 | |||
334 | amba_apb_device_add(NULL, "uart0", NOMADIK_UART0_BASE, SZ_4K, IRQ_UART0, 0, NULL, 0); | ||
335 | amba_apb_device_add(NULL, "uart1", NOMADIK_UART1_BASE, SZ_4K, IRQ_UART1, 0, NULL, 0); | ||
336 | |||
337 | i2c_register_board_info(0, nhk8815_i2c0_devices, | ||
338 | ARRAY_SIZE(nhk8815_i2c0_devices)); | ||
339 | i2c_register_board_info(1, nhk8815_i2c1_devices, | ||
340 | ARRAY_SIZE(nhk8815_i2c1_devices)); | ||
341 | i2c_register_board_info(2, nhk8815_i2c2_devices, | ||
342 | ARRAY_SIZE(nhk8815_i2c2_devices)); | ||
343 | } | ||
344 | |||
345 | MACHINE_START(NOMADIK, "NHK8815") | ||
346 | /* Maintainer: ST MicroElectronics */ | ||
347 | .atag_offset = 0x100, | ||
348 | .map_io = cpu8815_map_io, | ||
349 | .init_irq = cpu8815_init_irq, | ||
350 | .init_time = nomadik_timer_init, | ||
351 | .init_machine = nhk8815_platform_init, | ||
352 | .restart = cpu8815_restart, | ||
353 | MACHINE_END | ||
diff --git a/arch/arm/mach-nomadik/cpu-8815.c b/arch/arm/mach-nomadik/cpu-8815.c index 351404673f6c..21c1aa512640 100644 --- a/arch/arm/mach-nomadik/cpu-8815.c +++ b/arch/arm/mach-nomadik/cpu-8815.c | |||
@@ -25,138 +25,308 @@ | |||
25 | #include <linux/slab.h> | 25 | #include <linux/slab.h> |
26 | #include <linux/irq.h> | 26 | #include <linux/irq.h> |
27 | #include <linux/dma-mapping.h> | 27 | #include <linux/dma-mapping.h> |
28 | #include <linux/irqchip/arm-vic.h> | 28 | #include <linux/irqchip.h> |
29 | #include <linux/platform_data/clk-nomadik.h> | 29 | #include <linux/platform_data/clk-nomadik.h> |
30 | #include <linux/platform_data/pinctrl-nomadik.h> | 30 | #include <linux/platform_data/pinctrl-nomadik.h> |
31 | #include <linux/pinctrl/machine.h> | ||
32 | #include <linux/platform_data/clocksource-nomadik-mtu.h> | ||
33 | #include <linux/of_irq.h> | ||
34 | #include <linux/of_gpio.h> | ||
35 | #include <linux/of_address.h> | ||
36 | #include <linux/of_platform.h> | ||
37 | #include <linux/mtd/fsmc.h> | ||
38 | #include <linux/gpio.h> | ||
39 | #include <linux/amba/mmci.h> | ||
31 | 40 | ||
32 | #include <mach/hardware.h> | ||
33 | #include <mach/irqs.h> | 41 | #include <mach/irqs.h> |
42 | #include <asm/mach/arch.h> | ||
34 | #include <asm/mach/map.h> | 43 | #include <asm/mach/map.h> |
44 | #include <asm/mach/time.h> | ||
45 | #include <asm/mach-types.h> | ||
35 | 46 | ||
36 | #include <asm/cacheflush.h> | 47 | #include <asm/cacheflush.h> |
37 | #include <asm/hardware/cache-l2x0.h> | 48 | #include <asm/hardware/cache-l2x0.h> |
38 | 49 | ||
39 | #include "cpu-8815.h" | 50 | /* |
51 | * These are the only hard-coded address offsets we still have to use. | ||
52 | */ | ||
53 | #define NOMADIK_FSMC_BASE 0x10100000 /* FSMC registers */ | ||
54 | #define NOMADIK_SDRAMC_BASE 0x10110000 /* SDRAM Controller */ | ||
55 | #define NOMADIK_CLCDC_BASE 0x10120000 /* CLCD Controller */ | ||
56 | #define NOMADIK_MDIF_BASE 0x10120000 /* MDIF */ | ||
57 | #define NOMADIK_DMA0_BASE 0x10130000 /* DMA0 Controller */ | ||
58 | #define NOMADIK_IC_BASE 0x10140000 /* Vectored Irq Controller */ | ||
59 | #define NOMADIK_DMA1_BASE 0x10150000 /* DMA1 Controller */ | ||
60 | #define NOMADIK_USB_BASE 0x10170000 /* USB-OTG conf reg base */ | ||
61 | #define NOMADIK_CRYP_BASE 0x10180000 /* Crypto processor */ | ||
62 | #define NOMADIK_SHA1_BASE 0x10190000 /* SHA-1 Processor */ | ||
63 | #define NOMADIK_XTI_BASE 0x101A0000 /* XTI */ | ||
64 | #define NOMADIK_RNG_BASE 0x101B0000 /* Random number generator */ | ||
65 | #define NOMADIK_SRC_BASE 0x101E0000 /* SRC base */ | ||
66 | #define NOMADIK_WDOG_BASE 0x101E1000 /* Watchdog */ | ||
67 | #define NOMADIK_MTU0_BASE 0x101E2000 /* Multiple Timer 0 */ | ||
68 | #define NOMADIK_MTU1_BASE 0x101E3000 /* Multiple Timer 1 */ | ||
69 | #define NOMADIK_GPIO0_BASE 0x101E4000 /* GPIO0 */ | ||
70 | #define NOMADIK_GPIO1_BASE 0x101E5000 /* GPIO1 */ | ||
71 | #define NOMADIK_GPIO2_BASE 0x101E6000 /* GPIO2 */ | ||
72 | #define NOMADIK_GPIO3_BASE 0x101E7000 /* GPIO3 */ | ||
73 | #define NOMADIK_RTC_BASE 0x101E8000 /* Real Time Clock base */ | ||
74 | #define NOMADIK_PMU_BASE 0x101E9000 /* Power Management Unit */ | ||
75 | #define NOMADIK_OWM_BASE 0x101EA000 /* One wire master */ | ||
76 | #define NOMADIK_SCR_BASE 0x101EF000 /* Secure Control registers */ | ||
77 | #define NOMADIK_MSP2_BASE 0x101F0000 /* MSP 2 interface */ | ||
78 | #define NOMADIK_MSP1_BASE 0x101F1000 /* MSP 1 interface */ | ||
79 | #define NOMADIK_UART2_BASE 0x101F2000 /* UART 2 interface */ | ||
80 | #define NOMADIK_SSIRx_BASE 0x101F3000 /* SSI 8-ch rx interface */ | ||
81 | #define NOMADIK_SSITx_BASE 0x101F4000 /* SSI 8-ch tx interface */ | ||
82 | #define NOMADIK_MSHC_BASE 0x101F5000 /* Memory Stick(Pro) Host */ | ||
83 | #define NOMADIK_SDI_BASE 0x101F6000 /* SD-card/MM-Card */ | ||
84 | #define NOMADIK_I2C1_BASE 0x101F7000 /* I2C1 interface */ | ||
85 | #define NOMADIK_I2C0_BASE 0x101F8000 /* I2C0 interface */ | ||
86 | #define NOMADIK_MSP0_BASE 0x101F9000 /* MSP 0 interface */ | ||
87 | #define NOMADIK_FIRDA_BASE 0x101FA000 /* FIrDA interface */ | ||
88 | #define NOMADIK_UART1_BASE 0x101FB000 /* UART 1 interface */ | ||
89 | #define NOMADIK_SSP_BASE 0x101FC000 /* SSP interface */ | ||
90 | #define NOMADIK_UART0_BASE 0x101FD000 /* UART 0 interface */ | ||
91 | #define NOMADIK_SGA_BASE 0x101FE000 /* SGA interface */ | ||
92 | #define NOMADIK_L2CC_BASE 0x10210000 /* L2 Cache controller */ | ||
93 | #define NOMADIK_UART1_VBASE 0xF01FB000 | ||
40 | 94 | ||
41 | /* The 8815 has 4 GPIO blocks, let's register them immediately */ | 95 | static unsigned long out_low[] = { PIN_OUTPUT_LOW }; |
42 | static resource_size_t __initdata cpu8815_gpio_base[] = { | 96 | static unsigned long out_high[] = { PIN_OUTPUT_HIGH }; |
43 | NOMADIK_GPIO0_BASE, | 97 | static unsigned long in_nopull[] = { PIN_INPUT_NOPULL }; |
44 | NOMADIK_GPIO1_BASE, | 98 | static unsigned long in_pullup[] = { PIN_INPUT_PULLUP }; |
45 | NOMADIK_GPIO2_BASE, | 99 | |
46 | NOMADIK_GPIO3_BASE, | 100 | static struct pinctrl_map __initdata nhk8815_pinmap[] = { |
101 | PIN_MAP_MUX_GROUP_DEFAULT("uart0", "pinctrl-stn8815", "u0_a_1", "u0"), | ||
102 | PIN_MAP_MUX_GROUP_DEFAULT("uart1", "pinctrl-stn8815", "u1_a_1", "u1"), | ||
103 | /* Hog in MMC/SD card mux */ | ||
104 | PIN_MAP_MUX_GROUP_HOG_DEFAULT("pinctrl-stn8815", "mmcsd_a_1", "mmcsd"), | ||
105 | /* MCCLK */ | ||
106 | PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO8_B10", out_low), | ||
107 | /* MCCMD */ | ||
108 | PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO9_A10", in_pullup), | ||
109 | /* MCCMDDIR */ | ||
110 | PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO10_C11", out_high), | ||
111 | /* MCDAT3-0 */ | ||
112 | PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO11_B11", in_pullup), | ||
113 | PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO12_A11", in_pullup), | ||
114 | PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO13_C12", in_pullup), | ||
115 | PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO14_B12", in_pullup), | ||
116 | /* MCDAT0DIR */ | ||
117 | PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO15_A12", out_high), | ||
118 | /* MCDAT31DIR */ | ||
119 | PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO16_C13", out_high), | ||
120 | /* MCMSFBCLK */ | ||
121 | PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO24_C15", in_pullup), | ||
122 | /* CD input GPIO */ | ||
123 | PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO111_H21", in_nopull), | ||
124 | /* CD bias drive */ | ||
125 | PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO112_J21", out_low), | ||
126 | /* I2C0 */ | ||
127 | PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO62_D3", in_pullup), | ||
128 | PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO63_D2", in_pullup), | ||
129 | /* I2C1 */ | ||
130 | PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO53_L4", in_pullup), | ||
131 | PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO54_L3", in_pullup), | ||
132 | /* I2C2 */ | ||
133 | PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO73_C21", in_pullup), | ||
134 | PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO74_C20", in_pullup), | ||
47 | }; | 135 | }; |
48 | 136 | ||
49 | static struct platform_device * | 137 | /* This is needed for LL-debug/earlyprintk/debug-macro.S */ |
50 | cpu8815_add_gpio(int id, resource_size_t addr, int irq, | 138 | static struct map_desc cpu8815_io_desc[] __initdata = { |
51 | struct nmk_gpio_platform_data *pdata) | 139 | { |
140 | .virtual = NOMADIK_UART1_VBASE, | ||
141 | .pfn = __phys_to_pfn(NOMADIK_UART1_BASE), | ||
142 | .length = SZ_4K, | ||
143 | .type = MT_DEVICE, | ||
144 | }, | ||
145 | }; | ||
146 | |||
147 | static void __init cpu8815_map_io(void) | ||
52 | { | 148 | { |
53 | struct resource resources[] = { | 149 | iotable_init(cpu8815_io_desc, ARRAY_SIZE(cpu8815_io_desc)); |
54 | { | ||
55 | .start = addr, | ||
56 | .end = addr + 127, | ||
57 | .flags = IORESOURCE_MEM, | ||
58 | }, | ||
59 | { | ||
60 | .start = irq, | ||
61 | .end = irq, | ||
62 | .flags = IORESOURCE_IRQ, | ||
63 | } | ||
64 | }; | ||
65 | |||
66 | return platform_device_register_resndata(NULL, "gpio", id, | ||
67 | resources, ARRAY_SIZE(resources), | ||
68 | pdata, sizeof(*pdata)); | ||
69 | } | 150 | } |
70 | 151 | ||
71 | void cpu8815_add_gpios(resource_size_t *base, int num, int irq, | 152 | static void cpu8815_restart(char mode, const char *cmd) |
72 | struct nmk_gpio_platform_data *pdata) | ||
73 | { | 153 | { |
74 | int first = 0; | 154 | void __iomem *srcbase = ioremap(NOMADIK_SRC_BASE, SZ_4K); |
75 | int i; | ||
76 | 155 | ||
77 | for (i = 0; i < num; i++, first += 32, irq++) { | 156 | /* FIXME: use egpio when implemented */ |
78 | pdata->first_gpio = first; | ||
79 | pdata->first_irq = NOMADIK_GPIO_TO_IRQ(first); | ||
80 | pdata->num_gpio = 32; | ||
81 | 157 | ||
82 | cpu8815_add_gpio(i, base[i], irq, pdata); | 158 | /* Write anything to Reset status register */ |
83 | } | 159 | writel(1, srcbase + 0x18); |
84 | } | 160 | } |
85 | 161 | ||
86 | static inline void | 162 | /* Initial value for SRC control register: all timers use MXTAL/8 source */ |
87 | cpu8815_add_pinctrl(struct device *parent, const char *name) | 163 | #define SRC_CR_INIT_MASK 0x00007fff |
164 | #define SRC_CR_INIT_VAL 0x2aaa8000 | ||
165 | |||
166 | static void __init cpu8815_timer_init_of(void) | ||
88 | { | 167 | { |
89 | struct platform_device_info pdevinfo = { | 168 | struct device_node *mtu; |
90 | .parent = parent, | 169 | void __iomem *base; |
91 | .name = name, | 170 | int irq; |
92 | .id = -1, | 171 | u32 src_cr; |
93 | }; | 172 | |
173 | /* We need this to be up now */ | ||
174 | nomadik_clk_init(); | ||
175 | |||
176 | mtu = of_find_node_by_path("/mtu0"); | ||
177 | if (!mtu) | ||
178 | return; | ||
179 | base = of_iomap(mtu, 0); | ||
180 | if (WARN_ON(!base)) | ||
181 | return; | ||
182 | irq = irq_of_parse_and_map(mtu, 0); | ||
94 | 183 | ||
95 | platform_device_register_full(&pdevinfo); | 184 | pr_info("Remapped MTU @ %p, irq: %d\n", base, irq); |
185 | |||
186 | /* Configure timer sources in "system reset controller" ctrl reg */ | ||
187 | src_cr = readl(base); | ||
188 | src_cr &= SRC_CR_INIT_MASK; | ||
189 | src_cr |= SRC_CR_INIT_VAL; | ||
190 | writel(src_cr, base); | ||
191 | |||
192 | nmdk_timer_init(base, irq); | ||
96 | } | 193 | } |
97 | 194 | ||
98 | static int __init cpu8815_init(void) | 195 | static struct fsmc_nand_timings cpu8815_nand_timings = { |
196 | .thiz = 0, | ||
197 | .thold = 0x10, | ||
198 | .twait = 0x0A, | ||
199 | .tset = 0, | ||
200 | }; | ||
201 | |||
202 | static struct fsmc_nand_platform_data cpu8815_nand_data = { | ||
203 | .nand_timings = &cpu8815_nand_timings, | ||
204 | }; | ||
205 | |||
206 | /* | ||
207 | * The SMSC911x IRQ is connected to a GPIO pin, but the driver expects | ||
208 | * to simply request an IRQ passed as a resource. So the GPIO pin needs | ||
209 | * to be requested by this hog and set as input. | ||
210 | */ | ||
211 | static int __init cpu8815_eth_init(void) | ||
99 | { | 212 | { |
100 | struct nmk_gpio_platform_data pdata = { | 213 | struct device_node *eth; |
101 | /* No custom data yet */ | 214 | int gpio, irq, err; |
102 | }; | 215 | |
103 | 216 | eth = of_find_node_by_path("/usb-s8815/ethernet-gpio"); | |
104 | cpu8815_add_gpios(cpu8815_gpio_base, ARRAY_SIZE(cpu8815_gpio_base), | 217 | if (!eth) { |
105 | IRQ_GPIO0, &pdata); | 218 | pr_info("could not find any ethernet GPIO\n"); |
106 | cpu8815_add_pinctrl(NULL, "pinctrl-stn8815"); | 219 | return 0; |
107 | amba_apb_device_add(NULL, "rng", NOMADIK_RNG_BASE, SZ_4K, 0, 0, NULL, 0); | 220 | } |
108 | amba_apb_device_add(NULL, "rtc-pl031", NOMADIK_RTC_BASE, SZ_4K, IRQ_RTC_RTT, 0, NULL, 0); | 221 | gpio = of_get_gpio(eth, 0); |
222 | err = gpio_request(gpio, "eth_irq"); | ||
223 | if (err) { | ||
224 | pr_info("failed to request ethernet GPIO\n"); | ||
225 | return -ENODEV; | ||
226 | } | ||
227 | err = gpio_direction_input(gpio); | ||
228 | if (err) { | ||
229 | pr_info("failed to set ethernet GPIO as input\n"); | ||
230 | return -ENODEV; | ||
231 | } | ||
232 | irq = gpio_to_irq(gpio); | ||
233 | pr_info("enabled USB-S8815 ethernet GPIO %d, IRQ %d\n", gpio, irq); | ||
109 | return 0; | 234 | return 0; |
110 | } | 235 | } |
111 | arch_initcall(cpu8815_init); | 236 | device_initcall(cpu8815_eth_init); |
112 | 237 | ||
113 | /* All SoC devices live in the same area (see hardware.h) */ | 238 | /* |
114 | static struct map_desc nomadik_io_desc[] __initdata = { | 239 | * TODO: |
115 | { | 240 | * cannot be set from device tree, convert to a proper DT |
116 | .virtual = NOMADIK_IO_VIRTUAL, | 241 | * binding. |
117 | .pfn = __phys_to_pfn(NOMADIK_IO_PHYSICAL), | 242 | */ |
118 | .length = NOMADIK_IO_SIZE, | 243 | static struct mmci_platform_data mmcsd_plat_data = { |
119 | .type = MT_DEVICE, | 244 | .ocr_mask = MMC_VDD_29_30, |
120 | } | ||
121 | /* static ram and secured ram may be added later */ | ||
122 | }; | 245 | }; |
123 | 246 | ||
124 | void __init cpu8815_map_io(void) | 247 | /* |
248 | * This GPIO pin turns on a line that is used to detect card insertion | ||
249 | * on this board. | ||
250 | */ | ||
251 | static int __init cpu8815_mmcsd_init(void) | ||
125 | { | 252 | { |
126 | iotable_init(nomadik_io_desc, ARRAY_SIZE(nomadik_io_desc)); | 253 | struct device_node *cdbias; |
127 | } | 254 | int gpio, err; |
128 | 255 | ||
129 | void __init cpu8815_init_irq(void) | 256 | cdbias = of_find_node_by_path("/usb-s8815/mmcsd-gpio"); |
130 | { | 257 | if (!cdbias) { |
131 | /* This modified VIC cell has two register blocks, at 0 and 0x20 */ | 258 | pr_info("could not find MMC/SD card detect bias node\n"); |
132 | vic_init(io_p2v(NOMADIK_IC_BASE + 0x00), IRQ_VIC_START + 0, ~0, 0); | 259 | return 0; |
133 | vic_init(io_p2v(NOMADIK_IC_BASE + 0x20), IRQ_VIC_START + 32, ~0, 0); | 260 | } |
134 | 261 | gpio = of_get_gpio(cdbias, 0); | |
135 | /* | 262 | if (gpio < 0) { |
136 | * Init clocks here so that they are available for system timer | 263 | pr_info("could not obtain MMC/SD card detect bias GPIO\n"); |
137 | * initialization. | 264 | return 0; |
138 | */ | 265 | } |
139 | nomadik_clk_init(); | 266 | err = gpio_request(gpio, "card detect bias"); |
267 | if (err) { | ||
268 | pr_info("failed to request card detect bias GPIO %d\n", gpio); | ||
269 | return -ENODEV; | ||
270 | } | ||
271 | err = gpio_direction_output(gpio, 0); | ||
272 | if (err){ | ||
273 | pr_info("failed to set GPIO %d as output, low\n", gpio); | ||
274 | return err; | ||
275 | } | ||
276 | pr_info("enabled USB-S8815 CD bias GPIO %d, low\n", gpio); | ||
277 | return 0; | ||
140 | } | 278 | } |
279 | device_initcall(cpu8815_mmcsd_init); | ||
141 | 280 | ||
142 | /* | 281 | |
143 | * This function is called from the board init ("init_machine"). | 282 | /* These are mostly to get the right device names for the clock lookups */ |
144 | */ | 283 | static struct of_dev_auxdata cpu8815_auxdata_lookup[] __initdata = { |
145 | void __init cpu8815_platform_init(void) | 284 | OF_DEV_AUXDATA("st,nomadik-gpio", NOMADIK_GPIO0_BASE, |
285 | "gpio.0", NULL), | ||
286 | OF_DEV_AUXDATA("st,nomadik-gpio", NOMADIK_GPIO1_BASE, | ||
287 | "gpio.1", NULL), | ||
288 | OF_DEV_AUXDATA("st,nomadik-gpio", NOMADIK_GPIO2_BASE, | ||
289 | "gpio.2", NULL), | ||
290 | OF_DEV_AUXDATA("st,nomadik-gpio", NOMADIK_GPIO3_BASE, | ||
291 | "gpio.3", NULL), | ||
292 | OF_DEV_AUXDATA("stericsson,nmk-pinctrl-stn8815", 0, | ||
293 | "pinctrl-stn8815", NULL), | ||
294 | OF_DEV_AUXDATA("arm,primecell", NOMADIK_UART0_BASE, | ||
295 | "uart0", NULL), | ||
296 | OF_DEV_AUXDATA("arm,primecell", NOMADIK_UART1_BASE, | ||
297 | "uart1", NULL), | ||
298 | OF_DEV_AUXDATA("arm,primecell", NOMADIK_RNG_BASE, | ||
299 | "rng", NULL), | ||
300 | OF_DEV_AUXDATA("arm,primecell", NOMADIK_RTC_BASE, | ||
301 | "rtc-pl031", NULL), | ||
302 | OF_DEV_AUXDATA("stericsson,fsmc-nand", NOMADIK_FSMC_BASE, | ||
303 | "fsmc-nand", &cpu8815_nand_data), | ||
304 | OF_DEV_AUXDATA("arm,primecell", NOMADIK_SDI_BASE, | ||
305 | "mmci", &mmcsd_plat_data), | ||
306 | { /* sentinel */ }, | ||
307 | }; | ||
308 | |||
309 | static void __init cpu8815_init_of(void) | ||
146 | { | 310 | { |
147 | #ifdef CONFIG_CACHE_L2X0 | 311 | #ifdef CONFIG_CACHE_L2X0 |
148 | /* At full speed latency must be >=2, so 0x249 in low bits */ | 312 | /* At full speed latency must be >=2, so 0x249 in low bits */ |
149 | l2x0_init(io_p2v(NOMADIK_L2CC_BASE), 0x00730249, 0xfe000fff); | 313 | l2x0_of_init(0x00730249, 0xfe000fff); |
150 | #endif | 314 | #endif |
151 | return; | 315 | pinctrl_register_mappings(nhk8815_pinmap, ARRAY_SIZE(nhk8815_pinmap)); |
316 | of_platform_populate(NULL, of_default_bus_match_table, | ||
317 | cpu8815_auxdata_lookup, NULL); | ||
152 | } | 318 | } |
153 | 319 | ||
154 | void cpu8815_restart(char mode, const char *cmd) | 320 | static const char * cpu8815_board_compat[] = { |
155 | { | 321 | "calaosystems,usb-s8815", |
156 | void __iomem *src_rstsr = io_p2v(NOMADIK_SRC_BASE + 0x18); | 322 | NULL, |
157 | 323 | }; | |
158 | /* FIXME: use egpio when implemented */ | ||
159 | 324 | ||
160 | /* Write anything to Reset status register */ | 325 | DT_MACHINE_START(NOMADIK_DT, "Nomadik STn8815") |
161 | writel(1, src_rstsr); | 326 | .map_io = cpu8815_map_io, |
162 | } | 327 | .init_irq = irqchip_init, |
328 | .init_time = cpu8815_timer_init_of, | ||
329 | .init_machine = cpu8815_init_of, | ||
330 | .restart = cpu8815_restart, | ||
331 | .dt_compat = cpu8815_board_compat, | ||
332 | MACHINE_END | ||
diff --git a/arch/arm/mach-nomadik/cpu-8815.h b/arch/arm/mach-nomadik/cpu-8815.h deleted file mode 100644 index 71c21e8a11dc..000000000000 --- a/arch/arm/mach-nomadik/cpu-8815.h +++ /dev/null | |||
@@ -1,4 +0,0 @@ | |||
1 | extern void cpu8815_map_io(void); | ||
2 | extern void cpu8815_platform_init(void); | ||
3 | extern void cpu8815_init_irq(void); | ||
4 | extern void cpu8815_restart(char, const char *); | ||
diff --git a/arch/arm/mach-nomadik/i2c-8815nhk.c b/arch/arm/mach-nomadik/i2c-8815nhk.c deleted file mode 100644 index 0c2f6628299a..000000000000 --- a/arch/arm/mach-nomadik/i2c-8815nhk.c +++ /dev/null | |||
@@ -1,88 +0,0 @@ | |||
1 | #include <linux/module.h> | ||
2 | #include <linux/init.h> | ||
3 | #include <linux/i2c.h> | ||
4 | #include <linux/i2c-algo-bit.h> | ||
5 | #include <linux/i2c-gpio.h> | ||
6 | #include <linux/platform_device.h> | ||
7 | #include <linux/platform_data/pinctrl-nomadik.h> | ||
8 | |||
9 | /* | ||
10 | * There are two busses in the 8815NHK. | ||
11 | * They could, in theory, be driven by the hardware component, but we | ||
12 | * use bit-bang through GPIO by now, to keep things simple | ||
13 | */ | ||
14 | |||
15 | /* I2C0 connected to the STw4811 power management chip */ | ||
16 | static struct i2c_gpio_platform_data nhk8815_i2c_data0 = { | ||
17 | /* keep defaults for timeouts; pins are push-pull bidirectional */ | ||
18 | .scl_pin = 62, | ||
19 | .sda_pin = 63, | ||
20 | }; | ||
21 | |||
22 | /* I2C1 connected to various sensors */ | ||
23 | static struct i2c_gpio_platform_data nhk8815_i2c_data1 = { | ||
24 | /* keep defaults for timeouts; pins are push-pull bidirectional */ | ||
25 | .scl_pin = 53, | ||
26 | .sda_pin = 54, | ||
27 | }; | ||
28 | |||
29 | /* I2C2 connected to the USB portions of the STw4811 only */ | ||
30 | static struct i2c_gpio_platform_data nhk8815_i2c_data2 = { | ||
31 | /* keep defaults for timeouts; pins are push-pull bidirectional */ | ||
32 | .scl_pin = 73, | ||
33 | .sda_pin = 74, | ||
34 | }; | ||
35 | |||
36 | static struct platform_device nhk8815_i2c_dev0 = { | ||
37 | .name = "i2c-gpio", | ||
38 | .id = 0, | ||
39 | .dev = { | ||
40 | .platform_data = &nhk8815_i2c_data0, | ||
41 | }, | ||
42 | }; | ||
43 | |||
44 | static struct platform_device nhk8815_i2c_dev1 = { | ||
45 | .name = "i2c-gpio", | ||
46 | .id = 1, | ||
47 | .dev = { | ||
48 | .platform_data = &nhk8815_i2c_data1, | ||
49 | }, | ||
50 | }; | ||
51 | |||
52 | static struct platform_device nhk8815_i2c_dev2 = { | ||
53 | .name = "i2c-gpio", | ||
54 | .id = 2, | ||
55 | .dev = { | ||
56 | .platform_data = &nhk8815_i2c_data2, | ||
57 | }, | ||
58 | }; | ||
59 | |||
60 | static pin_cfg_t cpu8815_pins_i2c[] = { | ||
61 | PIN_CFG_INPUT(62, GPIO, PULLUP), | ||
62 | PIN_CFG_INPUT(63, GPIO, PULLUP), | ||
63 | PIN_CFG_INPUT(53, GPIO, PULLUP), | ||
64 | PIN_CFG_INPUT(54, GPIO, PULLUP), | ||
65 | PIN_CFG_INPUT(73, GPIO, PULLUP), | ||
66 | PIN_CFG_INPUT(74, GPIO, PULLUP), | ||
67 | }; | ||
68 | |||
69 | static int __init nhk8815_i2c_init(void) | ||
70 | { | ||
71 | nmk_config_pins(cpu8815_pins_i2c, ARRAY_SIZE(cpu8815_pins_i2c)); | ||
72 | platform_device_register(&nhk8815_i2c_dev0); | ||
73 | platform_device_register(&nhk8815_i2c_dev1); | ||
74 | platform_device_register(&nhk8815_i2c_dev2); | ||
75 | |||
76 | return 0; | ||
77 | } | ||
78 | |||
79 | static void __exit nhk8815_i2c_exit(void) | ||
80 | { | ||
81 | platform_device_unregister(&nhk8815_i2c_dev0); | ||
82 | platform_device_unregister(&nhk8815_i2c_dev1); | ||
83 | platform_device_unregister(&nhk8815_i2c_dev2); | ||
84 | return; | ||
85 | } | ||
86 | |||
87 | module_init(nhk8815_i2c_init); | ||
88 | module_exit(nhk8815_i2c_exit); | ||
diff --git a/arch/arm/mach-nomadik/include/mach/hardware.h b/arch/arm/mach-nomadik/include/mach/hardware.h deleted file mode 100644 index 02035e459f50..000000000000 --- a/arch/arm/mach-nomadik/include/mach/hardware.h +++ /dev/null | |||
@@ -1,90 +0,0 @@ | |||
1 | /* | ||
2 | * This file contains the hardware definitions of the Nomadik. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * YOU should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
17 | */ | ||
18 | #ifndef __ASM_ARCH_HARDWARE_H | ||
19 | #define __ASM_ARCH_HARDWARE_H | ||
20 | |||
21 | /* Nomadik registers live from 0x1000.0000 to 0x1023.0000 -- currently */ | ||
22 | #define NOMADIK_IO_VIRTUAL 0xF0000000 /* VA of IO */ | ||
23 | #define NOMADIK_IO_PHYSICAL 0x10000000 /* PA of IO */ | ||
24 | #define NOMADIK_IO_SIZE 0x00300000 /* 3MB for all regs */ | ||
25 | |||
26 | /* used in C code, so cast to proper type */ | ||
27 | #define io_p2v(x) ((void __iomem *)(x) \ | ||
28 | - NOMADIK_IO_PHYSICAL + NOMADIK_IO_VIRTUAL) | ||
29 | #define io_v2p(x) ((unsigned long)(x) \ | ||
30 | - NOMADIK_IO_VIRTUAL + NOMADIK_IO_PHYSICAL) | ||
31 | |||
32 | /* used in asm code, so no casts */ | ||
33 | #define IO_ADDRESS(x) IOMEM((x) - NOMADIK_IO_PHYSICAL + NOMADIK_IO_VIRTUAL) | ||
34 | |||
35 | /* | ||
36 | * Base address defination for Nomadik Onchip Logic Block | ||
37 | */ | ||
38 | #define NOMADIK_FSMC_BASE 0x10100000 /* FSMC registers */ | ||
39 | #define NOMADIK_SDRAMC_BASE 0x10110000 /* SDRAM Controller */ | ||
40 | #define NOMADIK_CLCDC_BASE 0x10120000 /* CLCD Controller */ | ||
41 | #define NOMADIK_MDIF_BASE 0x10120000 /* MDIF */ | ||
42 | #define NOMADIK_DMA0_BASE 0x10130000 /* DMA0 Controller */ | ||
43 | #define NOMADIK_IC_BASE 0x10140000 /* Vectored Irq Controller */ | ||
44 | #define NOMADIK_DMA1_BASE 0x10150000 /* DMA1 Controller */ | ||
45 | #define NOMADIK_USB_BASE 0x10170000 /* USB-OTG conf reg base */ | ||
46 | #define NOMADIK_CRYP_BASE 0x10180000 /* Crypto processor */ | ||
47 | #define NOMADIK_SHA1_BASE 0x10190000 /* SHA-1 Processor */ | ||
48 | #define NOMADIK_XTI_BASE 0x101A0000 /* XTI */ | ||
49 | #define NOMADIK_RNG_BASE 0x101B0000 /* Random number generator */ | ||
50 | #define NOMADIK_SRC_BASE 0x101E0000 /* SRC base */ | ||
51 | #define NOMADIK_WDOG_BASE 0x101E1000 /* Watchdog */ | ||
52 | #define NOMADIK_MTU0_BASE 0x101E2000 /* Multiple Timer 0 */ | ||
53 | #define NOMADIK_MTU1_BASE 0x101E3000 /* Multiple Timer 1 */ | ||
54 | #define NOMADIK_GPIO0_BASE 0x101E4000 /* GPIO0 */ | ||
55 | #define NOMADIK_GPIO1_BASE 0x101E5000 /* GPIO1 */ | ||
56 | #define NOMADIK_GPIO2_BASE 0x101E6000 /* GPIO2 */ | ||
57 | #define NOMADIK_GPIO3_BASE 0x101E7000 /* GPIO3 */ | ||
58 | #define NOMADIK_RTC_BASE 0x101E8000 /* Real Time Clock base */ | ||
59 | #define NOMADIK_PMU_BASE 0x101E9000 /* Power Management Unit */ | ||
60 | #define NOMADIK_OWM_BASE 0x101EA000 /* One wire master */ | ||
61 | #define NOMADIK_SCR_BASE 0x101EF000 /* Secure Control registers */ | ||
62 | #define NOMADIK_MSP2_BASE 0x101F0000 /* MSP 2 interface */ | ||
63 | #define NOMADIK_MSP1_BASE 0x101F1000 /* MSP 1 interface */ | ||
64 | #define NOMADIK_UART2_BASE 0x101F2000 /* UART 2 interface */ | ||
65 | #define NOMADIK_SSIRx_BASE 0x101F3000 /* SSI 8-ch rx interface */ | ||
66 | #define NOMADIK_SSITx_BASE 0x101F4000 /* SSI 8-ch tx interface */ | ||
67 | #define NOMADIK_MSHC_BASE 0x101F5000 /* Memory Stick(Pro) Host */ | ||
68 | #define NOMADIK_SDI_BASE 0x101F6000 /* SD-card/MM-Card */ | ||
69 | #define NOMADIK_I2C1_BASE 0x101F7000 /* I2C1 interface */ | ||
70 | #define NOMADIK_I2C0_BASE 0x101F8000 /* I2C0 interface */ | ||
71 | #define NOMADIK_MSP0_BASE 0x101F9000 /* MSP 0 interface */ | ||
72 | #define NOMADIK_FIRDA_BASE 0x101FA000 /* FIrDA interface */ | ||
73 | #define NOMADIK_UART1_BASE 0x101FB000 /* UART 1 interface */ | ||
74 | #define NOMADIK_SSP_BASE 0x101FC000 /* SSP interface */ | ||
75 | #define NOMADIK_UART0_BASE 0x101FD000 /* UART 0 interface */ | ||
76 | #define NOMADIK_SGA_BASE 0x101FE000 /* SGA interface */ | ||
77 | #define NOMADIK_L2CC_BASE 0x10210000 /* L2 Cache controller */ | ||
78 | |||
79 | /* Other ranges, not for p2v/v2p */ | ||
80 | #define NOMADIK_BACKUP_RAM 0x80010000 | ||
81 | #define NOMADIK_EBROM 0x80000000 /* Embedded boot ROM */ | ||
82 | #define NOMADIK_HAMACV_DMEM_BASE 0xA0100000 /* HAMACV Data Memory Start */ | ||
83 | #define NOMADIK_HAMACV_DMEM_END 0xA01FFFFF /* HAMACV Data Memory End */ | ||
84 | #define NOMADIK_HAMACA_DMEM 0xA0200000 /* HAMACA Data Memory Space */ | ||
85 | |||
86 | #define NOMADIK_FSMC_VA IO_ADDRESS(NOMADIK_FSMC_BASE) | ||
87 | #define NOMADIK_MTU0_VA IO_ADDRESS(NOMADIK_MTU0_BASE) | ||
88 | #define NOMADIK_MTU1_VA IO_ADDRESS(NOMADIK_MTU1_BASE) | ||
89 | |||
90 | #endif /* __ASM_ARCH_HARDWARE_H */ | ||
diff --git a/arch/arm/mach-nomadik/include/mach/irqs.h b/arch/arm/mach-nomadik/include/mach/irqs.h index 215f8cdb4004..90ac965a92fe 100644 --- a/arch/arm/mach-nomadik/include/mach/irqs.h +++ b/arch/arm/mach-nomadik/include/mach/irqs.h | |||
@@ -20,8 +20,6 @@ | |||
20 | #ifndef __ASM_ARCH_IRQS_H | 20 | #ifndef __ASM_ARCH_IRQS_H |
21 | #define __ASM_ARCH_IRQS_H | 21 | #define __ASM_ARCH_IRQS_H |
22 | 22 | ||
23 | #include <mach/hardware.h> | ||
24 | |||
25 | #define IRQ_VIC_START 32 /* first VIC interrupt is 1 */ | 23 | #define IRQ_VIC_START 32 /* first VIC interrupt is 1 */ |
26 | 24 | ||
27 | /* | 25 | /* |
diff --git a/arch/arm/mach-nomadik/include/mach/uncompress.h b/arch/arm/mach-nomadik/include/mach/uncompress.h index f527af6527c8..106fccca2021 100644 --- a/arch/arm/mach-nomadik/include/mach/uncompress.h +++ b/arch/arm/mach-nomadik/include/mach/uncompress.h | |||
@@ -21,7 +21,6 @@ | |||
21 | 21 | ||
22 | #include <asm/setup.h> | 22 | #include <asm/setup.h> |
23 | #include <asm/io.h> | 23 | #include <asm/io.h> |
24 | #include <mach/hardware.h> | ||
25 | 24 | ||
26 | /* we need the constants in amba/serial.h, but it refers to amba_device */ | 25 | /* we need the constants in amba/serial.h, but it refers to amba_device */ |
27 | struct amba_device; | 26 | struct amba_device; |