| Brian Swetland | 495f71d | 2006-06-26 16:16:03 -0700 | [diff] [blame] | 1 | /* | 
|  | 2 | * linux/arch/arm/mach-omap1/board-fsample.c | 
|  | 3 | * | 
|  | 4 | * Modified from board-perseus2.c | 
|  | 5 | * | 
|  | 6 | * Original OMAP730 support by Jean Pihet <j-pihet@ti.com> | 
|  | 7 | * Updated for 2.6 by Kevin Hilman <kjh@hilman.org> | 
|  | 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 version 2 as | 
|  | 11 | * published by the Free Software Foundation. | 
|  | 12 | */ | 
|  | 13 |  | 
|  | 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/nand.h> | 
|  | 20 | #include <linux/mtd/partitions.h> | 
| Ladislav Michl | 561b036 | 2010-02-15 10:03:32 -0800 | [diff] [blame] | 21 | #include <linux/mtd/physmap.h> | 
| Brian Swetland | 495f71d | 2006-06-26 16:16:03 -0700 | [diff] [blame] | 22 | #include <linux/input.h> | 
| Ladislav Michl | 3bc4801 | 2009-12-11 16:16:33 -0800 | [diff] [blame] | 23 | #include <linux/smc91x.h> | 
| Brian Swetland | 495f71d | 2006-06-26 16:16:03 -0700 | [diff] [blame] | 24 |  | 
| Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 25 | #include <mach/hardware.h> | 
| Brian Swetland | 495f71d | 2006-06-26 16:16:03 -0700 | [diff] [blame] | 26 | #include <asm/mach-types.h> | 
|  | 27 | #include <asm/mach/arch.h> | 
| Brian Swetland | 495f71d | 2006-06-26 16:16:03 -0700 | [diff] [blame] | 28 | #include <asm/mach/map.h> | 
|  | 29 |  | 
| Tony Lindgren | ce491cf | 2009-10-20 09:40:47 -0700 | [diff] [blame] | 30 | #include <plat/tc.h> | 
| Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 31 | #include <mach/gpio.h> | 
| Tony Lindgren | ce491cf | 2009-10-20 09:40:47 -0700 | [diff] [blame] | 32 | #include <plat/mux.h> | 
| Ladislav Michl | 561b036 | 2010-02-15 10:03:32 -0800 | [diff] [blame] | 33 | #include <plat/flash.h> | 
| Tony Lindgren | ce491cf | 2009-10-20 09:40:47 -0700 | [diff] [blame] | 34 | #include <plat/fpga.h> | 
| Tony Lindgren | ce491cf | 2009-10-20 09:40:47 -0700 | [diff] [blame] | 35 | #include <plat/keypad.h> | 
|  | 36 | #include <plat/common.h> | 
|  | 37 | #include <plat/board.h> | 
| Tony Lindgren | d9558b1 | 2009-03-23 18:07:32 -0700 | [diff] [blame] | 38 |  | 
|  | 39 | /* fsample is pretty close to p2-sample */ | 
|  | 40 |  | 
|  | 41 | #define fsample_cpld_read(reg) __raw_readb(reg) | 
|  | 42 | #define fsample_cpld_write(val, reg) __raw_writeb(val, reg) | 
|  | 43 |  | 
|  | 44 | #define FSAMPLE_CPLD_BASE    0xE8100000 | 
|  | 45 | #define FSAMPLE_CPLD_SIZE    SZ_4K | 
|  | 46 | #define FSAMPLE_CPLD_START   0x05080000 | 
|  | 47 |  | 
|  | 48 | #define FSAMPLE_CPLD_REG_A   (FSAMPLE_CPLD_BASE + 0x00) | 
|  | 49 | #define FSAMPLE_CPLD_SWITCH  (FSAMPLE_CPLD_BASE + 0x02) | 
|  | 50 | #define FSAMPLE_CPLD_UART    (FSAMPLE_CPLD_BASE + 0x02) | 
|  | 51 | #define FSAMPLE_CPLD_REG_B   (FSAMPLE_CPLD_BASE + 0x04) | 
|  | 52 | #define FSAMPLE_CPLD_VERSION (FSAMPLE_CPLD_BASE + 0x06) | 
|  | 53 | #define FSAMPLE_CPLD_SET_CLR (FSAMPLE_CPLD_BASE + 0x06) | 
|  | 54 |  | 
|  | 55 | #define FSAMPLE_CPLD_BIT_BT_RESET         0 | 
|  | 56 | #define FSAMPLE_CPLD_BIT_LCD_RESET        1 | 
|  | 57 | #define FSAMPLE_CPLD_BIT_CAM_PWDN         2 | 
|  | 58 | #define FSAMPLE_CPLD_BIT_CHARGER_ENABLE   3 | 
|  | 59 | #define FSAMPLE_CPLD_BIT_SD_MMC_EN        4 | 
|  | 60 | #define FSAMPLE_CPLD_BIT_aGPS_PWREN       5 | 
|  | 61 | #define FSAMPLE_CPLD_BIT_BACKLIGHT        6 | 
|  | 62 | #define FSAMPLE_CPLD_BIT_aGPS_EN_RESET    7 | 
|  | 63 | #define FSAMPLE_CPLD_BIT_aGPS_SLEEPx_N    8 | 
|  | 64 | #define FSAMPLE_CPLD_BIT_OTG_RESET        9 | 
|  | 65 |  | 
|  | 66 | #define fsample_cpld_set(bit) \ | 
|  | 67 | fsample_cpld_write((((bit) & 15) << 4) | 0x0f, FSAMPLE_CPLD_SET_CLR) | 
|  | 68 |  | 
|  | 69 | #define fsample_cpld_clear(bit) \ | 
|  | 70 | fsample_cpld_write(0xf0 | ((bit) & 15), FSAMPLE_CPLD_SET_CLR) | 
| Brian Swetland | 495f71d | 2006-06-26 16:16:03 -0700 | [diff] [blame] | 71 |  | 
|  | 72 | static int fsample_keymap[] = { | 
|  | 73 | KEY(0,0,KEY_UP), | 
|  | 74 | KEY(0,1,KEY_RIGHT), | 
|  | 75 | KEY(0,2,KEY_LEFT), | 
|  | 76 | KEY(0,3,KEY_DOWN), | 
| Vivek Kutal | 496bcb8 | 2008-01-07 12:04:00 -0200 | [diff] [blame] | 77 | KEY(0,4,KEY_ENTER), | 
|  | 78 | KEY(1,0,KEY_F10), | 
| Brian Swetland | 495f71d | 2006-06-26 16:16:03 -0700 | [diff] [blame] | 79 | KEY(1,1,KEY_SEND), | 
|  | 80 | KEY(1,2,KEY_END), | 
|  | 81 | KEY(1,3,KEY_VOLUMEDOWN), | 
|  | 82 | KEY(1,4,KEY_VOLUMEUP), | 
|  | 83 | KEY(1,5,KEY_RECORD), | 
| Vivek Kutal | 496bcb8 | 2008-01-07 12:04:00 -0200 | [diff] [blame] | 84 | KEY(2,0,KEY_F9), | 
| Brian Swetland | 495f71d | 2006-06-26 16:16:03 -0700 | [diff] [blame] | 85 | KEY(2,1,KEY_3), | 
|  | 86 | KEY(2,2,KEY_6), | 
|  | 87 | KEY(2,3,KEY_9), | 
| Vivek Kutal | 496bcb8 | 2008-01-07 12:04:00 -0200 | [diff] [blame] | 88 | KEY(2,4,KEY_KPDOT), | 
| Brian Swetland | 495f71d | 2006-06-26 16:16:03 -0700 | [diff] [blame] | 89 | KEY(3,0,KEY_BACK), | 
|  | 90 | KEY(3,1,KEY_2), | 
|  | 91 | KEY(3,2,KEY_5), | 
|  | 92 | KEY(3,3,KEY_8), | 
|  | 93 | KEY(3,4,KEY_0), | 
| Vivek Kutal | 496bcb8 | 2008-01-07 12:04:00 -0200 | [diff] [blame] | 94 | KEY(3,5,KEY_KPSLASH), | 
| Brian Swetland | 495f71d | 2006-06-26 16:16:03 -0700 | [diff] [blame] | 95 | KEY(4,0,KEY_HOME), | 
|  | 96 | KEY(4,1,KEY_1), | 
|  | 97 | KEY(4,2,KEY_4), | 
|  | 98 | KEY(4,3,KEY_7), | 
| Vivek Kutal | 496bcb8 | 2008-01-07 12:04:00 -0200 | [diff] [blame] | 99 | KEY(4,4,KEY_KPASTERISK), | 
| Brian Swetland | 495f71d | 2006-06-26 16:16:03 -0700 | [diff] [blame] | 100 | KEY(4,5,KEY_POWER), | 
|  | 101 | 0 | 
|  | 102 | }; | 
|  | 103 |  | 
| Ladislav Michl | 3bc4801 | 2009-12-11 16:16:33 -0800 | [diff] [blame] | 104 | static struct smc91x_platdata smc91x_info = { | 
|  | 105 | .flags	= SMC91X_USE_16BIT | SMC91X_NOWAIT, | 
|  | 106 | .leda	= RPC_LED_100_10, | 
|  | 107 | .ledb	= RPC_LED_TX_RX, | 
|  | 108 | }; | 
|  | 109 |  | 
| Brian Swetland | 495f71d | 2006-06-26 16:16:03 -0700 | [diff] [blame] | 110 | static struct resource smc91x_resources[] = { | 
|  | 111 | [0] = { | 
|  | 112 | .start	= H2P2_DBG_FPGA_ETHR_START,	/* Physical */ | 
|  | 113 | .end	= H2P2_DBG_FPGA_ETHR_START + 0xf, | 
|  | 114 | .flags	= IORESOURCE_MEM, | 
|  | 115 | }, | 
|  | 116 | [1] = { | 
| Alistair Buxton | 372b1c3 | 2009-09-18 04:09:39 +0100 | [diff] [blame] | 117 | .start	= INT_7XX_MPU_EXT_NIRQ, | 
| Brian Swetland | 495f71d | 2006-06-26 16:16:03 -0700 | [diff] [blame] | 118 | .end	= 0, | 
| Russell King | e7b3dc7 | 2008-01-14 22:30:10 +0000 | [diff] [blame] | 119 | .flags	= IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE, | 
| Brian Swetland | 495f71d | 2006-06-26 16:16:03 -0700 | [diff] [blame] | 120 | }, | 
|  | 121 | }; | 
|  | 122 |  | 
|  | 123 | static struct mtd_partition nor_partitions[] = { | 
|  | 124 | /* bootloader (U-Boot, etc) in first sector */ | 
|  | 125 | { | 
|  | 126 | .name		= "bootloader", | 
|  | 127 | .offset		= 0, | 
|  | 128 | .size		= SZ_128K, | 
|  | 129 | .mask_flags	= MTD_WRITEABLE, /* force read-only */ | 
|  | 130 | }, | 
|  | 131 | /* bootloader params in the next sector */ | 
|  | 132 | { | 
|  | 133 | .name		= "params", | 
|  | 134 | .offset		= MTDPART_OFS_APPEND, | 
|  | 135 | .size		= SZ_128K, | 
|  | 136 | .mask_flags	= 0, | 
|  | 137 | }, | 
|  | 138 | /* kernel */ | 
|  | 139 | { | 
|  | 140 | .name		= "kernel", | 
|  | 141 | .offset		= MTDPART_OFS_APPEND, | 
|  | 142 | .size		= SZ_2M, | 
|  | 143 | .mask_flags	= 0 | 
|  | 144 | }, | 
|  | 145 | /* rest of flash is a file system */ | 
|  | 146 | { | 
|  | 147 | .name		= "rootfs", | 
|  | 148 | .offset		= MTDPART_OFS_APPEND, | 
|  | 149 | .size		= MTDPART_SIZ_FULL, | 
|  | 150 | .mask_flags	= 0 | 
|  | 151 | }, | 
|  | 152 | }; | 
|  | 153 |  | 
| Ladislav Michl | 561b036 | 2010-02-15 10:03:32 -0800 | [diff] [blame] | 154 | static struct physmap_flash_data nor_data = { | 
| Brian Swetland | 495f71d | 2006-06-26 16:16:03 -0700 | [diff] [blame] | 155 | .width		= 2, | 
| Ladislav Michl | 561b036 | 2010-02-15 10:03:32 -0800 | [diff] [blame] | 156 | .set_vpp	= omap1_set_vpp, | 
| Brian Swetland | 495f71d | 2006-06-26 16:16:03 -0700 | [diff] [blame] | 157 | .parts		= nor_partitions, | 
|  | 158 | .nr_parts	= ARRAY_SIZE(nor_partitions), | 
|  | 159 | }; | 
|  | 160 |  | 
|  | 161 | static struct resource nor_resource = { | 
|  | 162 | .start		= OMAP_CS0_PHYS, | 
|  | 163 | .end		= OMAP_CS0_PHYS + SZ_32M - 1, | 
|  | 164 | .flags		= IORESOURCE_MEM, | 
|  | 165 | }; | 
|  | 166 |  | 
|  | 167 | static struct platform_device nor_device = { | 
| Ladislav Michl | 561b036 | 2010-02-15 10:03:32 -0800 | [diff] [blame] | 168 | .name		= "physmap-flash", | 
| Brian Swetland | 495f71d | 2006-06-26 16:16:03 -0700 | [diff] [blame] | 169 | .id		= 0, | 
|  | 170 | .dev		= { | 
|  | 171 | .platform_data	= &nor_data, | 
|  | 172 | }, | 
|  | 173 | .num_resources	= 1, | 
|  | 174 | .resource	= &nor_resource, | 
|  | 175 | }; | 
|  | 176 |  | 
| Ladislav Michl | 414f552 | 2009-12-11 16:16:33 -0800 | [diff] [blame] | 177 | static void nand_cmd_ctl(struct mtd_info *mtd, int cmd,	unsigned int ctrl) | 
|  | 178 | { | 
|  | 179 | struct nand_chip *this = mtd->priv; | 
|  | 180 | unsigned long mask; | 
|  | 181 |  | 
|  | 182 | if (cmd == NAND_CMD_NONE) | 
|  | 183 | return; | 
|  | 184 |  | 
|  | 185 | mask = (ctrl & NAND_CLE) ? 0x02 : 0; | 
|  | 186 | if (ctrl & NAND_ALE) | 
|  | 187 | mask |= 0x04; | 
|  | 188 | writeb(cmd, (unsigned long)this->IO_ADDR_W | mask); | 
|  | 189 | } | 
|  | 190 |  | 
|  | 191 | #define FSAMPLE_NAND_RB_GPIO_PIN	62 | 
|  | 192 |  | 
|  | 193 | static int nand_dev_ready(struct mtd_info *mtd) | 
|  | 194 | { | 
|  | 195 | return gpio_get_value(FSAMPLE_NAND_RB_GPIO_PIN); | 
|  | 196 | } | 
|  | 197 |  | 
|  | 198 | static const char *part_probes[] = { "cmdlinepart", NULL }; | 
|  | 199 |  | 
|  | 200 | static struct platform_nand_data nand_data = { | 
|  | 201 | .chip	= { | 
|  | 202 | .nr_chips		= 1, | 
|  | 203 | .chip_offset		= 0, | 
|  | 204 | .options		= NAND_SAMSUNG_LP_OPTIONS, | 
|  | 205 | .part_probe_types	= part_probes, | 
|  | 206 | }, | 
|  | 207 | .ctrl	= { | 
|  | 208 | .cmd_ctrl	= nand_cmd_ctl, | 
|  | 209 | .dev_ready	= nand_dev_ready, | 
|  | 210 | }, | 
| Brian Swetland | 495f71d | 2006-06-26 16:16:03 -0700 | [diff] [blame] | 211 | }; | 
|  | 212 |  | 
|  | 213 | static struct resource nand_resource = { | 
|  | 214 | .start		= OMAP_CS3_PHYS, | 
|  | 215 | .end		= OMAP_CS3_PHYS + SZ_4K - 1, | 
|  | 216 | .flags		= IORESOURCE_MEM, | 
|  | 217 | }; | 
|  | 218 |  | 
|  | 219 | static struct platform_device nand_device = { | 
| Ladislav Michl | 414f552 | 2009-12-11 16:16:33 -0800 | [diff] [blame] | 220 | .name		= "gen_nand", | 
| Brian Swetland | 495f71d | 2006-06-26 16:16:03 -0700 | [diff] [blame] | 221 | .id		= 0, | 
|  | 222 | .dev		= { | 
|  | 223 | .platform_data	= &nand_data, | 
|  | 224 | }, | 
|  | 225 | .num_resources	= 1, | 
|  | 226 | .resource	= &nand_resource, | 
|  | 227 | }; | 
|  | 228 |  | 
|  | 229 | static struct platform_device smc91x_device = { | 
|  | 230 | .name		= "smc91x", | 
|  | 231 | .id		= 0, | 
| Ladislav Michl | 3bc4801 | 2009-12-11 16:16:33 -0800 | [diff] [blame] | 232 | .dev	= { | 
|  | 233 | .platform_data	= &smc91x_info, | 
|  | 234 | }, | 
| Brian Swetland | 495f71d | 2006-06-26 16:16:03 -0700 | [diff] [blame] | 235 | .num_resources	= ARRAY_SIZE(smc91x_resources), | 
|  | 236 | .resource	= smc91x_resources, | 
|  | 237 | }; | 
|  | 238 |  | 
|  | 239 | static struct resource kp_resources[] = { | 
|  | 240 | [0] = { | 
| Alistair Buxton | 372b1c3 | 2009-09-18 04:09:39 +0100 | [diff] [blame] | 241 | .start	= INT_7XX_MPUIO_KEYPAD, | 
|  | 242 | .end	= INT_7XX_MPUIO_KEYPAD, | 
| Brian Swetland | 495f71d | 2006-06-26 16:16:03 -0700 | [diff] [blame] | 243 | .flags	= IORESOURCE_IRQ, | 
|  | 244 | }, | 
|  | 245 | }; | 
|  | 246 |  | 
|  | 247 | static struct omap_kp_platform_data kp_data = { | 
| Komal Shah | 4d24607 | 2006-09-29 01:59:20 -0700 | [diff] [blame] | 248 | .rows		= 8, | 
|  | 249 | .cols		= 8, | 
|  | 250 | .keymap		= fsample_keymap, | 
|  | 251 | .keymapsize	= ARRAY_SIZE(fsample_keymap), | 
|  | 252 | .delay		= 4, | 
| Brian Swetland | 495f71d | 2006-06-26 16:16:03 -0700 | [diff] [blame] | 253 | }; | 
|  | 254 |  | 
|  | 255 | static struct platform_device kp_device = { | 
|  | 256 | .name		= "omap-keypad", | 
|  | 257 | .id		= -1, | 
|  | 258 | .dev		= { | 
|  | 259 | .platform_data = &kp_data, | 
|  | 260 | }, | 
|  | 261 | .num_resources	= ARRAY_SIZE(kp_resources), | 
|  | 262 | .resource	= kp_resources, | 
|  | 263 | }; | 
|  | 264 |  | 
|  | 265 | static struct platform_device lcd_device = { | 
|  | 266 | .name		= "lcd_p2", | 
|  | 267 | .id		= -1, | 
|  | 268 | }; | 
|  | 269 |  | 
|  | 270 | static struct platform_device *devices[] __initdata = { | 
|  | 271 | &nor_device, | 
|  | 272 | &nand_device, | 
|  | 273 | &smc91x_device, | 
|  | 274 | &kp_device, | 
|  | 275 | &lcd_device, | 
|  | 276 | }; | 
|  | 277 |  | 
| Brian Swetland | 495f71d | 2006-06-26 16:16:03 -0700 | [diff] [blame] | 278 | static struct omap_lcd_config fsample_lcd_config __initdata = { | 
|  | 279 | .ctrl_name	= "internal", | 
|  | 280 | }; | 
|  | 281 |  | 
|  | 282 | static struct omap_board_config_kernel fsample_config[] = { | 
| Brian Swetland | 495f71d | 2006-06-26 16:16:03 -0700 | [diff] [blame] | 283 | { OMAP_TAG_LCD,		&fsample_lcd_config }, | 
|  | 284 | }; | 
|  | 285 |  | 
|  | 286 | static void __init omap_fsample_init(void) | 
|  | 287 | { | 
| Ladislav Michl | 414f552 | 2009-12-11 16:16:33 -0800 | [diff] [blame] | 288 | if (gpio_request(FSAMPLE_NAND_RB_GPIO_PIN, "NAND ready") < 0) | 
| Jarkko Nikula | f2d18fe | 2008-12-10 17:35:30 -0800 | [diff] [blame] | 289 | BUG(); | 
| Ladislav Michl | 414f552 | 2009-12-11 16:16:33 -0800 | [diff] [blame] | 290 | gpio_direction_input(FSAMPLE_NAND_RB_GPIO_PIN); | 
| Brian Swetland | 495f71d | 2006-06-26 16:16:03 -0700 | [diff] [blame] | 291 |  | 
|  | 292 | omap_cfg_reg(L3_1610_FLASH_CS2B_OE); | 
|  | 293 | omap_cfg_reg(M8_1610_FLASH_CS2B_WE); | 
|  | 294 |  | 
|  | 295 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 
|  | 296 |  | 
|  | 297 | omap_board_config = fsample_config; | 
|  | 298 | omap_board_config_size = ARRAY_SIZE(fsample_config); | 
|  | 299 | omap_serial_init(); | 
| Jarkko Nikula | 1ed16a8 | 2007-11-07 06:54:32 +0200 | [diff] [blame] | 300 | omap_register_i2c_bus(1, 100, NULL, 0); | 
| Brian Swetland | 495f71d | 2006-06-26 16:16:03 -0700 | [diff] [blame] | 301 | } | 
|  | 302 |  | 
|  | 303 | static void __init fsample_init_smc91x(void) | 
|  | 304 | { | 
|  | 305 | fpga_write(1, H2P2_DBG_FPGA_LAN_RESET); | 
|  | 306 | mdelay(50); | 
|  | 307 | fpga_write(fpga_read(H2P2_DBG_FPGA_LAN_RESET) & ~1, | 
|  | 308 | H2P2_DBG_FPGA_LAN_RESET); | 
|  | 309 | mdelay(50); | 
|  | 310 | } | 
|  | 311 |  | 
| David Brownell | 277d58e | 2006-12-06 17:13:59 -0800 | [diff] [blame] | 312 | static void __init omap_fsample_init_irq(void) | 
| Brian Swetland | 495f71d | 2006-06-26 16:16:03 -0700 | [diff] [blame] | 313 | { | 
|  | 314 | omap1_init_common_hw(); | 
|  | 315 | omap_init_irq(); | 
|  | 316 | omap_gpio_init(); | 
|  | 317 | fsample_init_smc91x(); | 
|  | 318 | } | 
|  | 319 |  | 
|  | 320 | /* Only FPGA needs to be mapped here. All others are done with ioremap */ | 
|  | 321 | static struct map_desc omap_fsample_io_desc[] __initdata = { | 
|  | 322 | { | 
|  | 323 | .virtual	= H2P2_DBG_FPGA_BASE, | 
|  | 324 | .pfn		= __phys_to_pfn(H2P2_DBG_FPGA_START), | 
|  | 325 | .length		= H2P2_DBG_FPGA_SIZE, | 
|  | 326 | .type		= MT_DEVICE | 
|  | 327 | }, | 
|  | 328 | { | 
|  | 329 | .virtual	= FSAMPLE_CPLD_BASE, | 
|  | 330 | .pfn		= __phys_to_pfn(FSAMPLE_CPLD_START), | 
|  | 331 | .length		= FSAMPLE_CPLD_SIZE, | 
|  | 332 | .type		= MT_DEVICE | 
|  | 333 | } | 
|  | 334 | }; | 
|  | 335 |  | 
|  | 336 | static void __init omap_fsample_map_io(void) | 
|  | 337 | { | 
|  | 338 | omap1_map_common_io(); | 
|  | 339 | iotable_init(omap_fsample_io_desc, | 
|  | 340 | ARRAY_SIZE(omap_fsample_io_desc)); | 
|  | 341 |  | 
|  | 342 | /* Early, board-dependent init */ | 
|  | 343 |  | 
|  | 344 | /* | 
|  | 345 | * Hold GSM Reset until needed | 
|  | 346 | */ | 
| Alistair Buxton | b51988d | 2009-09-22 07:34:13 +0100 | [diff] [blame] | 347 | omap_writew(omap_readw(OMAP7XX_DSP_M_CTL) & ~1, OMAP7XX_DSP_M_CTL); | 
| Brian Swetland | 495f71d | 2006-06-26 16:16:03 -0700 | [diff] [blame] | 348 |  | 
|  | 349 | /* | 
|  | 350 | * UARTs -> done automagically by 8250 driver | 
|  | 351 | */ | 
|  | 352 |  | 
|  | 353 | /* | 
|  | 354 | * CSx timings, GPIO Mux ... setup | 
|  | 355 | */ | 
|  | 356 |  | 
|  | 357 | /* Flash: CS0 timings setup */ | 
| Alistair Buxton | b51988d | 2009-09-22 07:34:13 +0100 | [diff] [blame] | 358 | omap_writel(0x0000fff3, OMAP7XX_FLASH_CFG_0); | 
|  | 359 | omap_writel(0x00000088, OMAP7XX_FLASH_ACFG_0); | 
| Brian Swetland | 495f71d | 2006-06-26 16:16:03 -0700 | [diff] [blame] | 360 |  | 
|  | 361 | /* | 
|  | 362 | * Ethernet support through the debug board | 
|  | 363 | * CS1 timings setup | 
|  | 364 | */ | 
| Alistair Buxton | b51988d | 2009-09-22 07:34:13 +0100 | [diff] [blame] | 365 | omap_writel(0x0000fff3, OMAP7XX_FLASH_CFG_1); | 
|  | 366 | omap_writel(0x00000000, OMAP7XX_FLASH_ACFG_1); | 
| Brian Swetland | 495f71d | 2006-06-26 16:16:03 -0700 | [diff] [blame] | 367 |  | 
|  | 368 | /* | 
|  | 369 | * Configure MPU_EXT_NIRQ IO in IO_CONF9 register, | 
|  | 370 | * It is used as the Ethernet controller interrupt | 
|  | 371 | */ | 
| Alistair Buxton | b51988d | 2009-09-22 07:34:13 +0100 | [diff] [blame] | 372 | omap_writel(omap_readl(OMAP7XX_IO_CONF_9) & 0x1FFFFFFF, OMAP7XX_IO_CONF_9); | 
| Brian Swetland | 495f71d | 2006-06-26 16:16:03 -0700 | [diff] [blame] | 373 | } | 
|  | 374 |  | 
|  | 375 | MACHINE_START(OMAP_FSAMPLE, "OMAP730 F-Sample") | 
|  | 376 | /* Maintainer: Brian Swetland <swetland@google.com> */ | 
|  | 377 | .phys_io	= 0xfff00000, | 
|  | 378 | .io_pg_offst	= ((0xfef00000) >> 18) & 0xfffc, | 
|  | 379 | .boot_params	= 0x10000100, | 
|  | 380 | .map_io		= omap_fsample_map_io, | 
| Russell King | 71ee7da | 2010-05-23 10:18:16 +0100 | [diff] [blame] | 381 | .reserve	= omap_reserve, | 
| Brian Swetland | 495f71d | 2006-06-26 16:16:03 -0700 | [diff] [blame] | 382 | .init_irq	= omap_fsample_init_irq, | 
|  | 383 | .init_machine	= omap_fsample_init, | 
|  | 384 | .timer		= &omap_timer, | 
|  | 385 | MACHINE_END |