2 * linux/arch/arm/mach-omap2/board-3430sdp.c
4 * Copyright (C) 2007 Texas Instruments
6 * Modified from mach-omap2/board-generic.c
8 * Initial code: Syed Mohammed Khasim
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
15 #include <linux/kernel.h>
16 #include <linux/init.h>
17 #include <linux/platform_device.h>
18 #include <linux/mtd/mtd.h>
19 #include <linux/mtd/partitions.h>
20 #include <linux/delay.h>
21 #include <linux/workqueue.h>
22 #include <linux/err.h>
23 #include <linux/clk.h>
25 #include <asm/hardware.h>
26 #include <asm/mach-types.h>
27 #include <asm/mach/arch.h>
28 #include <asm/mach/map.h>
29 #include <asm/mach/flash.h>
31 #include <asm/arch/gpio.h>
32 #include <asm/arch/mux.h>
33 #include <asm/arch/board.h>
34 #include <asm/arch/common.h>
35 #include <asm/arch/dma.h>
36 #include <asm/arch/gpmc.h>
39 #include <asm/delay.h>
41 #define SDP3430_FLASH_CS 0
42 #define SDP3430_SMC91X_CS 3
44 static struct mtd_partition sdp3430_partitions[] = {
45 /* bootloader (U-Boot, etc) in first sector */
50 .mask_flags = MTD_WRITEABLE, /* force read-only */
52 /* bootloader params in the next sector */
55 .offset = MTDPART_OFS_APPEND,
62 .offset = MTDPART_OFS_APPEND,
69 .offset = MTDPART_OFS_APPEND,
70 .size = MTDPART_SIZ_FULL,
75 static struct flash_platform_data sdp3430_flash_data = {
76 .map_name = "cfi_probe",
78 .parts = sdp3430_partitions,
79 .nr_parts = ARRAY_SIZE(sdp3430_partitions),
82 static struct resource sdp3430_flash_resource = {
84 .end = FLASH_BASE + SZ_64M - 1,
85 .flags = IORESOURCE_MEM,
88 static struct platform_device sdp3430_flash_device = {
92 .platform_data = &sdp3430_flash_data,
95 .resource = &sdp3430_flash_resource,
98 static struct resource sdp3430_smc91x_resources[] = {
100 .start = OMAP34XX_ETHR_START,
101 .end = OMAP34XX_ETHR_START + SZ_4K,
102 .flags = IORESOURCE_MEM,
105 .start = OMAP_GPIO_IRQ(OMAP34XX_ETHR_GPIO_IRQ),
107 .flags = IORESOURCE_IRQ,
111 static struct platform_device sdp3430_smc91x_device = {
114 .num_resources = ARRAY_SIZE(sdp3430_smc91x_resources),
115 .resource = sdp3430_smc91x_resources,
118 static struct platform_device *sdp3430_devices[] __initdata = {
119 &sdp3430_smc91x_device,
120 &sdp3430_flash_device,
123 static inline void __init sdp3430_init_smc91x(void)
126 unsigned long cs_mem_base;
130 eth_cs = SDP3430_SMC91X_CS;
132 l3ck = clk_get(NULL, "core_l3_ck");
136 rate = clk_get_rate(l3ck);
138 if (gpmc_cs_request(eth_cs, SZ_16M, &cs_mem_base) < 0) {
139 printk(KERN_ERR "Failed to request GPMC mem for smc91x\n");
143 sdp3430_smc91x_resources[0].start = cs_mem_base + 0x0;
144 sdp3430_smc91x_resources[0].end = cs_mem_base + 0xf;
147 if (omap_request_gpio(OMAP34XX_ETHR_GPIO_IRQ) < 0) {
148 printk(KERN_ERR "Failed to request GPIO%d for smc91x IRQ\n",
149 OMAP34XX_ETHR_GPIO_IRQ);
152 omap_set_gpio_direction(OMAP34XX_ETHR_GPIO_IRQ, 1);
155 static void __init omap_3430sdp_init_irq(void)
157 omap2_init_common_hw();
160 sdp3430_init_smc91x();
163 static struct omap_uart_config sdp3430_uart_config __initdata = {
164 .enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)),
167 static struct omap_board_config_kernel sdp3430_config[] = {
168 { OMAP_TAG_UART, &sdp3430_uart_config },
171 static void __init omap_3430sdp_init(void)
173 platform_add_devices(sdp3430_devices, ARRAY_SIZE(sdp3430_devices));
174 omap_board_config = sdp3430_config;
175 omap_board_config_size = ARRAY_SIZE(sdp3430_config);
179 static void __init omap_3430sdp_map_io(void)
181 omap2_map_common_io();
184 MACHINE_START(OMAP_3430SDP, "OMAP3430 3430SDP board")
185 /* Maintainer: Syed Khasim - Texas Instruments Inc */
186 .phys_io = 0x48000000,
187 .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc,
188 .boot_params = 0x80000100,
189 .map_io = omap_3430sdp_map_io,
190 .init_irq = omap_3430sdp_init_irq,
191 .init_machine = omap_3430sdp_init,
192 .timer = &omap_timer,