2 * linux/arch/arm/mach-omap1/board-perseus2.c
4 * Modified from board-generic.c
6 * Original OMAP730 support by Jean Pihet <j-pihet@ti.com>
7 * Updated for 2.6 by Kevin Hilman <kjh@hilman.org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
14 #include <linux/kernel.h>
15 #include <linux/init.h>
16 #include <linux/platform_device.h>
17 #include <linux/delay.h>
18 #include <linux/mtd/mtd.h>
19 #include <linux/mtd/partitions.h>
21 #include <asm/hardware.h>
22 #include <asm/mach-types.h>
23 #include <asm/mach/arch.h>
24 #include <asm/mach/flash.h>
25 #include <asm/mach/map.h>
27 #include <asm/arch/tc.h>
28 #include <asm/arch/gpio.h>
29 #include <asm/arch/mux.h>
30 #include <asm/arch/fpga.h>
31 #include <asm/arch/common.h>
32 #include <asm/arch/board.h>
34 static struct resource smc91x_resources
[] = {
36 .start
= H2P2_DBG_FPGA_ETHR_START
, /* Physical */
37 .end
= H2P2_DBG_FPGA_ETHR_START
+ 0xf,
38 .flags
= IORESOURCE_MEM
,
41 .start
= INT_730_MPU_EXT_NIRQ
,
43 .flags
= IORESOURCE_IRQ
,
47 static struct mtd_partition p2_partitions
[] = {
48 /* bootloader (U-Boot, etc) in first sector */
53 .mask_flags
= MTD_WRITEABLE
, /* force read-only */
55 /* bootloader params in the next sector */
58 .offset
= MTDPART_OFS_APPEND
,
65 .offset
= MTDPART_OFS_APPEND
,
69 /* rest of flash is a file system */
72 .offset
= MTDPART_OFS_APPEND
,
73 .size
= MTDPART_SIZ_FULL
,
78 static struct flash_platform_data p2_flash_data
= {
79 .map_name
= "cfi_probe",
81 .parts
= p2_partitions
,
82 .nr_parts
= ARRAY_SIZE(p2_partitions
),
85 static struct resource p2_flash_resource
= {
86 .start
= OMAP_CS0_PHYS
,
87 .end
= OMAP_CS0_PHYS
+ SZ_32M
- 1,
88 .flags
= IORESOURCE_MEM
,
91 static struct platform_device p2_flash_device
= {
95 .platform_data
= &p2_flash_data
,
98 .resource
= &p2_flash_resource
,
101 static struct platform_device smc91x_device
= {
104 .num_resources
= ARRAY_SIZE(smc91x_resources
),
105 .resource
= smc91x_resources
,
108 static struct platform_device
*devices
[] __initdata
= {
113 static struct omap_uart_config perseus2_uart_config __initdata
= {
114 .enabled_uarts
= ((1 << 0) | (1 << 1)),
117 static struct omap_lcd_config perseus2_lcd_config __initdata
= {
119 .ctrl_name
= "internal",
122 static struct omap_board_config_kernel perseus2_config
[] = {
123 { OMAP_TAG_UART
, &perseus2_uart_config
},
124 { OMAP_TAG_LCD
, &perseus2_lcd_config
},
127 static void __init
omap_perseus2_init(void)
129 (void) platform_add_devices(devices
, ARRAY_SIZE(devices
));
131 omap_board_config
= perseus2_config
;
132 omap_board_config_size
= ARRAY_SIZE(perseus2_config
);
136 static void __init
perseus2_init_smc91x(void)
138 fpga_write(1, H2P2_DBG_FPGA_LAN_RESET
);
140 fpga_write(fpga_read(H2P2_DBG_FPGA_LAN_RESET
) & ~1,
141 H2P2_DBG_FPGA_LAN_RESET
);
145 void omap_perseus2_init_irq(void)
149 perseus2_init_smc91x();
151 /* Only FPGA needs to be mapped here. All others are done with ioremap */
152 static struct map_desc omap_perseus2_io_desc
[] __initdata
= {
154 .virtual = H2P2_DBG_FPGA_BASE
,
155 .pfn
= __phys_to_pfn(H2P2_DBG_FPGA_START
),
156 .length
= H2P2_DBG_FPGA_SIZE
,
161 static void __init
omap_perseus2_map_io(void)
163 omap_map_common_io();
164 iotable_init(omap_perseus2_io_desc
,
165 ARRAY_SIZE(omap_perseus2_io_desc
));
167 /* Early, board-dependent init */
170 * Hold GSM Reset until needed
172 omap_writew(omap_readw(OMAP730_DSP_M_CTL
) & ~1, OMAP730_DSP_M_CTL
);
175 * UARTs -> done automagically by 8250 driver
179 * CSx timings, GPIO Mux ... setup
182 /* Flash: CS0 timings setup */
183 omap_writel(0x0000fff3, OMAP730_FLASH_CFG_0
);
184 omap_writel(0x00000088, OMAP730_FLASH_ACFG_0
);
187 * Ethernet support trough the debug board
190 omap_writel(0x0000fff3, OMAP730_FLASH_CFG_1
);
191 omap_writel(0x00000000, OMAP730_FLASH_ACFG_1
);
194 * Configure MPU_EXT_NIRQ IO in IO_CONF9 register,
195 * It is used as the Ethernet controller interrupt
197 omap_writel(omap_readl(OMAP730_IO_CONF_9
) & 0x1FFFFFFF, OMAP730_IO_CONF_9
);
200 MACHINE_START(OMAP_PERSEUS2
, "OMAP730 Perseus2")
201 /* Maintainer: Kevin Hilman <kjh@hilman.org> */
202 .phys_ram
= 0x10000000,
203 .phys_io
= 0xfff00000,
204 .io_pg_offst
= ((0xfef00000) >> 18) & 0xfffc,
205 .boot_params
= 0x10000100,
206 .map_io
= omap_perseus2_map_io
,
207 .init_irq
= omap_perseus2_init_irq
,
208 .init_machine
= omap_perseus2_init
,
209 .timer
= &omap_timer
,