Commit 9b6553cd01ce3ea7a6a532f7b7e62e3535d6b102

Authored by Tony Lindgren
Committed by Russell King
1 parent 120db2cba8

[ARM] 3433/1: ARM: OMAP: 8/8 Update board files

Patch from Tony Lindgren

This patch syncs OMAP board support with linux-omap tree.
The highlights of the patch are:
- Add support for Nokia 770 by Juha Yrjola
- Add support for Samsung Apollon by Kyungmin Park
- Add support for Amstrad E3 videophone by Jonathan McDowell
- Remove board-netstar.c board support as requested by Ladislav Michl
- Do platform_device registration in board files by Komal Shah et al.

Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

Showing 28 changed files with 1968 additions and 297 deletions Side-by-side Diff

arch/arm/mach-omap1/Kconfig
... ... @@ -69,12 +69,6 @@
69 69 Support for Voiceblue GSM/VoIP gateway. Say Y here if you have
70 70 such a board.
71 71  
72   -config MACH_NETSTAR
73   - bool "NetStar"
74   - depends on ARCH_OMAP1 && ARCH_OMAP15XX
75   - help
76   - Support for NetStar PBX. Say Y here if you have such a board.
77   -
78 72 config MACH_OMAP_PALMTE
79 73 bool "Palm Tungsten E"
80 74 depends on ARCH_OMAP1 && ARCH_OMAP15XX
... ... @@ -84,6 +78,20 @@
84 78 bootloader; check out http://palmtelinux.sourceforge.net for more
85 79 informations.
86 80 Say Y here if you have such a PDA, say NO otherwise.
  81 +
  82 +config MACH_NOKIA770
  83 + bool "Nokia 770"
  84 + depends on ARCH_OMAP1 && ARCH_OMAP16XX
  85 + help
  86 + Support for the Nokia 770 Internet Tablet. Say Y here if you
  87 + have such a device.
  88 +
  89 +config MACH_AMS_DELTA
  90 + bool "Amstrad E3 (Delta)"
  91 + depends on ARCH_OMAP1 && ARCH_OMAP15XX
  92 + help
  93 + Support for the Amstrad E3 (codename Delta) videophone. Say Y here
  94 + if you have such a device.
87 95  
88 96 config MACH_OMAP_GENERIC
89 97 bool "Generic OMAP board"
arch/arm/mach-omap1/board-ams-delta.c
  1 +/*
  2 + * linux/arch/arm/mach-omap1/board-ams-delta.c
  3 + *
  4 + * Modified from board-generic.c
  5 + *
  6 + * Board specific inits for the Amstrad E3 (codename Delta) videophone
  7 + *
  8 + * Copyright (C) 2006 Jonathan McDowell <noodles@earth.li>
  9 + *
  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.
  13 + */
  14 +
  15 +#include <linux/kernel.h>
  16 +#include <linux/init.h>
  17 +#include <linux/platform_device.h>
  18 +
  19 +#include <asm/hardware.h>
  20 +#include <asm/mach-types.h>
  21 +#include <asm/mach/arch.h>
  22 +#include <asm/mach/map.h>
  23 +
  24 +#include <asm/arch/board-ams-delta.h>
  25 +#include <asm/arch/gpio.h>
  26 +#include <asm/arch/mux.h>
  27 +#include <asm/arch/usb.h>
  28 +#include <asm/arch/board.h>
  29 +#include <asm/arch/common.h>
  30 +
  31 +static u8 ams_delta_latch1_reg;
  32 +static u16 ams_delta_latch2_reg;
  33 +
  34 +void ams_delta_latch1_write(u8 mask, u8 value)
  35 +{
  36 + ams_delta_latch1_reg &= ~mask;
  37 + ams_delta_latch1_reg |= value;
  38 + *(volatile __u8 *) AMS_DELTA_LATCH1_VIRT = ams_delta_latch1_reg;
  39 +}
  40 +
  41 +void ams_delta_latch2_write(u16 mask, u16 value)
  42 +{
  43 + ams_delta_latch2_reg &= ~mask;
  44 + ams_delta_latch2_reg |= value;
  45 + *(volatile __u16 *) AMS_DELTA_LATCH2_VIRT = ams_delta_latch2_reg;
  46 +}
  47 +
  48 +static void __init ams_delta_init_irq(void)
  49 +{
  50 + omap1_init_common_hw();
  51 + omap_init_irq();
  52 + omap_gpio_init();
  53 +}
  54 +
  55 +static struct map_desc ams_delta_io_desc[] __initdata = {
  56 + // AMS_DELTA_LATCH1
  57 + {
  58 + .virtual = AMS_DELTA_LATCH1_VIRT,
  59 + .pfn = __phys_to_pfn(AMS_DELTA_LATCH1_PHYS),
  60 + .length = 0x01000000,
  61 + .type = MT_DEVICE
  62 + },
  63 + // AMS_DELTA_LATCH2
  64 + {
  65 + .virtual = AMS_DELTA_LATCH2_VIRT,
  66 + .pfn = __phys_to_pfn(AMS_DELTA_LATCH2_PHYS),
  67 + .length = 0x01000000,
  68 + .type = MT_DEVICE
  69 + },
  70 + // AMS_DELTA_MODEM
  71 + {
  72 + .virtual = AMS_DELTA_MODEM_VIRT,
  73 + .pfn = __phys_to_pfn(AMS_DELTA_MODEM_PHYS),
  74 + .length = 0x01000000,
  75 + .type = MT_DEVICE
  76 + }
  77 +};
  78 +
  79 +static struct omap_uart_config ams_delta_uart_config __initdata = {
  80 + .enabled_uarts = 1,
  81 +};
  82 +
  83 +static struct omap_board_config_kernel ams_delta_config[] = {
  84 + { OMAP_TAG_UART, &ams_delta_uart_config },
  85 +};
  86 +
  87 +static void __init ams_delta_init(void)
  88 +{
  89 + iotable_init(ams_delta_io_desc, ARRAY_SIZE(ams_delta_io_desc));
  90 +
  91 + omap_board_config = ams_delta_config;
  92 + omap_board_config_size = ARRAY_SIZE(ams_delta_config);
  93 + omap_serial_init();
  94 +
  95 + /* Clear latch2 (NAND, LCD, modem enable) */
  96 + ams_delta_latch2_write(~0, 0);
  97 +}
  98 +
  99 +static void __init ams_delta_map_io(void)
  100 +{
  101 + omap1_map_common_io();
  102 +}
  103 +
  104 +MACHINE_START(AMS_DELTA, "Amstrad E3 (Delta)")
  105 + /* Maintainer: Jonathan McDowell <noodles@earth.li> */
  106 + .phys_io = 0xfff00000,
  107 + .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc,
  108 + .boot_params = 0x10000100,
  109 + .map_io = ams_delta_map_io,
  110 + .init_irq = ams_delta_init_irq,
  111 + .init_machine = ams_delta_init,
  112 + .timer = &omap_timer,
  113 +MACHINE_END
  114 +
  115 +EXPORT_SYMBOL(ams_delta_latch1_write);
  116 +EXPORT_SYMBOL(ams_delta_latch2_write);
arch/arm/mach-omap1/board-generic.c
... ... @@ -88,7 +88,7 @@
88 88 static void __init omap_generic_init(void)
89 89 {
90 90 #ifdef CONFIG_ARCH_OMAP15XX
91   - if (cpu_is_omap1510()) {
  91 + if (cpu_is_omap15xx()) {
92 92 generic_config[0].data = &generic1510_usb_config;
93 93 }
94 94 #endif
arch/arm/mach-omap1/board-h2.c
... ... @@ -24,7 +24,9 @@
24 24 #include <linux/platform_device.h>
25 25 #include <linux/delay.h>
26 26 #include <linux/mtd/mtd.h>
  27 +#include <linux/mtd/nand.h>
27 28 #include <linux/mtd/partitions.h>
  29 +#include <linux/input.h>
28 30  
29 31 #include <asm/hardware.h>
30 32 #include <asm/mach-types.h>
31 33  
32 34  
33 35  
... ... @@ -35,12 +37,55 @@
35 37 #include <asm/arch/gpio.h>
36 38 #include <asm/arch/mux.h>
37 39 #include <asm/arch/tc.h>
  40 +#include <asm/arch/irda.h>
38 41 #include <asm/arch/usb.h>
  42 +#include <asm/arch/keypad.h>
39 43 #include <asm/arch/common.h>
  44 +#include <asm/arch/mcbsp.h>
  45 +#include <asm/arch/omap-alsa.h>
40 46  
41 47 extern int omap_gpio_init(void);
42 48  
43   -static struct mtd_partition h2_partitions[] = {
  49 +static int h2_keymap[] = {
  50 + KEY(0, 0, KEY_LEFT),
  51 + KEY(0, 1, KEY_RIGHT),
  52 + KEY(0, 2, KEY_3),
  53 + KEY(0, 3, KEY_F10),
  54 + KEY(0, 4, KEY_F5),
  55 + KEY(0, 5, KEY_9),
  56 + KEY(1, 0, KEY_DOWN),
  57 + KEY(1, 1, KEY_UP),
  58 + KEY(1, 2, KEY_2),
  59 + KEY(1, 3, KEY_F9),
  60 + KEY(1, 4, KEY_F7),
  61 + KEY(1, 5, KEY_0),
  62 + KEY(2, 0, KEY_ENTER),
  63 + KEY(2, 1, KEY_6),
  64 + KEY(2, 2, KEY_1),
  65 + KEY(2, 3, KEY_F2),
  66 + KEY(2, 4, KEY_F6),
  67 + KEY(2, 5, KEY_HOME),
  68 + KEY(3, 0, KEY_8),
  69 + KEY(3, 1, KEY_5),
  70 + KEY(3, 2, KEY_F12),
  71 + KEY(3, 3, KEY_F3),
  72 + KEY(3, 4, KEY_F8),
  73 + KEY(3, 5, KEY_END),
  74 + KEY(4, 0, KEY_7),
  75 + KEY(4, 1, KEY_4),
  76 + KEY(4, 2, KEY_F11),
  77 + KEY(4, 3, KEY_F1),
  78 + KEY(4, 4, KEY_F4),
  79 + KEY(4, 5, KEY_ESC),
  80 + KEY(5, 0, KEY_F13),
  81 + KEY(5, 1, KEY_F14),
  82 + KEY(5, 2, KEY_F15),
  83 + KEY(5, 3, KEY_F16),
  84 + KEY(5, 4, KEY_SLEEP),
  85 + 0
  86 +};
  87 +
  88 +static struct mtd_partition h2_nor_partitions[] = {
44 89 /* bootloader (U-Boot, etc) in first sector */
45 90 {
46 91 .name = "bootloader",
47 92  
48 93  
49 94  
50 95  
51 96  
... ... @@ -71,26 +116,26 @@
71 116 }
72 117 };
73 118  
74   -static struct flash_platform_data h2_flash_data = {
  119 +static struct flash_platform_data h2_nor_data = {
75 120 .map_name = "cfi_probe",
76 121 .width = 2,
77   - .parts = h2_partitions,
78   - .nr_parts = ARRAY_SIZE(h2_partitions),
  122 + .parts = h2_nor_partitions,
  123 + .nr_parts = ARRAY_SIZE(h2_nor_partitions),
79 124 };
80 125  
81   -static struct resource h2_flash_resource = {
  126 +static struct resource h2_nor_resource = {
82 127 /* This is on CS3, wherever it's mapped */
83 128 .flags = IORESOURCE_MEM,
84 129 };
85 130  
86   -static struct platform_device h2_flash_device = {
  131 +static struct platform_device h2_nor_device = {
87 132 .name = "omapflash",
88 133 .id = 0,
89 134 .dev = {
90   - .platform_data = &h2_flash_data,
  135 + .platform_data = &h2_nor_data,
91 136 },
92 137 .num_resources = 1,
93   - .resource = &h2_flash_resource,
  138 + .resource = &h2_nor_resource,
94 139 };
95 140  
96 141 static struct resource h2_smc91x_resources[] = {
97 142  
98 143  
... ... @@ -113,9 +158,119 @@
113 158 .resource = h2_smc91x_resources,
114 159 };
115 160  
  161 +static struct resource h2_kp_resources[] = {
  162 + [0] = {
  163 + .start = INT_KEYBOARD,
  164 + .end = INT_KEYBOARD,
  165 + .flags = IORESOURCE_IRQ,
  166 + },
  167 +};
  168 +
  169 +static struct omap_kp_platform_data h2_kp_data = {
  170 + .rows = 8,
  171 + .cols = 8,
  172 + .keymap = h2_keymap,
  173 + .rep = 1,
  174 +};
  175 +
  176 +static struct platform_device h2_kp_device = {
  177 + .name = "omap-keypad",
  178 + .id = -1,
  179 + .dev = {
  180 + .platform_data = &h2_kp_data,
  181 + },
  182 + .num_resources = ARRAY_SIZE(h2_kp_resources),
  183 + .resource = h2_kp_resources,
  184 +};
  185 +
  186 +#define H2_IRDA_FIRSEL_GPIO_PIN 17
  187 +
  188 +#if defined(CONFIG_OMAP_IR) || defined(CONFIG_OMAP_IR_MODULE)
  189 +static int h2_transceiver_mode(struct device *dev, int state)
  190 +{
  191 + if (state & IR_SIRMODE)
  192 + omap_set_gpio_dataout(H2_IRDA_FIRSEL_GPIO_PIN, 0);
  193 + else /* MIR/FIR */
  194 + omap_set_gpio_dataout(H2_IRDA_FIRSEL_GPIO_PIN, 1);
  195 +
  196 + return 0;
  197 +}
  198 +#endif
  199 +
  200 +static struct omap_irda_config h2_irda_data = {
  201 + .transceiver_cap = IR_SIRMODE | IR_MIRMODE | IR_FIRMODE,
  202 + .rx_channel = OMAP_DMA_UART3_RX,
  203 + .tx_channel = OMAP_DMA_UART3_TX,
  204 + .dest_start = UART3_THR,
  205 + .src_start = UART3_RHR,
  206 + .tx_trigger = 0,
  207 + .rx_trigger = 0,
  208 +};
  209 +
  210 +static struct resource h2_irda_resources[] = {
  211 + [0] = {
  212 + .start = INT_UART3,
  213 + .end = INT_UART3,
  214 + .flags = IORESOURCE_IRQ,
  215 + },
  216 +};
  217 +static struct platform_device h2_irda_device = {
  218 + .name = "omapirda",
  219 + .id = 0,
  220 + .dev = {
  221 + .platform_data = &h2_irda_data,
  222 + },
  223 + .num_resources = ARRAY_SIZE(h2_irda_resources),
  224 + .resource = h2_irda_resources,
  225 +};
  226 +
  227 +static struct platform_device h2_lcd_device = {
  228 + .name = "lcd_h2",
  229 + .id = -1,
  230 +};
  231 +
  232 +static struct omap_mcbsp_reg_cfg mcbsp_regs = {
  233 + .spcr2 = FREE | FRST | GRST | XRST | XINTM(3),
  234 + .spcr1 = RINTM(3) | RRST,
  235 + .rcr2 = RPHASE | RFRLEN2(OMAP_MCBSP_WORD_8) |
  236 + RWDLEN2(OMAP_MCBSP_WORD_16) | RDATDLY(1),
  237 + .rcr1 = RFRLEN1(OMAP_MCBSP_WORD_8) | RWDLEN1(OMAP_MCBSP_WORD_16),
  238 + .xcr2 = XPHASE | XFRLEN2(OMAP_MCBSP_WORD_8) |
  239 + XWDLEN2(OMAP_MCBSP_WORD_16) | XDATDLY(1) | XFIG,
  240 + .xcr1 = XFRLEN1(OMAP_MCBSP_WORD_8) | XWDLEN1(OMAP_MCBSP_WORD_16),
  241 + .srgr1 = FWID(15),
  242 + .srgr2 = GSYNC | CLKSP | FSGM | FPER(31),
  243 +
  244 + .pcr0 = CLKXM | CLKRM | FSXP | FSRP | CLKXP | CLKRP,
  245 + //.pcr0 = CLKXP | CLKRP, /* mcbsp: slave */
  246 +};
  247 +
  248 +static struct omap_alsa_codec_config alsa_config = {
  249 + .name = "H2 TSC2101",
  250 + .mcbsp_regs_alsa = &mcbsp_regs,
  251 + .codec_configure_dev = NULL, // tsc2101_configure,
  252 + .codec_set_samplerate = NULL, // tsc2101_set_samplerate,
  253 + .codec_clock_setup = NULL, // tsc2101_clock_setup,
  254 + .codec_clock_on = NULL, // tsc2101_clock_on,
  255 + .codec_clock_off = NULL, // tsc2101_clock_off,
  256 + .get_default_samplerate = NULL, // tsc2101_get_default_samplerate,
  257 +};
  258 +
  259 +static struct platform_device h2_mcbsp1_device = {
  260 + .name = "omap_alsa_mcbsp",
  261 + .id = 1,
  262 + .dev = {
  263 + .platform_data = &alsa_config,
  264 + },
  265 +};
  266 +
116 267 static struct platform_device *h2_devices[] __initdata = {
117   - &h2_flash_device,
  268 + &h2_nor_device,
118 269 &h2_smc91x_device,
  270 + &h2_irda_device,
  271 + &h2_kp_device,
  272 + &h2_lcd_device,
  273 + &h2_mcbsp1_device,
119 274 };
120 275  
121 276 static void __init h2_init_smc91x(void)
... ... @@ -164,7 +319,6 @@
164 319 };
165 320  
166 321 static struct omap_lcd_config h2_lcd_config __initdata = {
167   - .panel_name = "h2",
168 322 .ctrl_name = "internal",
169 323 };
170 324  
171 325  
172 326  
173 327  
... ... @@ -177,15 +331,33 @@
177 331  
178 332 static void __init h2_init(void)
179 333 {
180   - /* NOTE: revC boards support NAND-boot, which can put NOR on CS2B
181   - * and NAND (either 16bit or 8bit) on CS3.
  334 + /* Here we assume the NOR boot config: NOR on CS3 (possibly swapped
  335 + * to address 0 by a dip switch), NAND on CS2B. The NAND driver will
  336 + * notice whether a NAND chip is enabled at probe time.
  337 + *
  338 + * FIXME revC boards (and H3) support NAND-boot, with a dip switch to
  339 + * put NOR on CS2B and NAND (which on H2 may be 16bit) on CS3. Try
  340 + * detecting that in code here, to avoid probing every possible flash
  341 + * configuration...
182 342 */
183   - h2_flash_resource.end = h2_flash_resource.start = omap_cs3_phys();
184   - h2_flash_resource.end += SZ_32M - 1;
  343 + h2_nor_resource.end = h2_nor_resource.start = omap_cs3_phys();
  344 + h2_nor_resource.end += SZ_32M - 1;
185 345  
  346 + omap_cfg_reg(L3_1610_FLASH_CS2B_OE);
  347 + omap_cfg_reg(M8_1610_FLASH_CS2B_WE);
  348 +
186 349 /* MMC: card detect and WP */
187 350 // omap_cfg_reg(U19_ARMIO1); /* CD */
188 351 omap_cfg_reg(BALLOUT_V8_ARMIO3); /* WP */
  352 +
  353 + /* Irda */
  354 +#if defined(CONFIG_OMAP_IR) || defined(CONFIG_OMAP_IR_MODULE)
  355 + omap_writel(omap_readl(FUNC_MUX_CTRL_A) | 7, FUNC_MUX_CTRL_A);
  356 + if (!(omap_request_gpio(H2_IRDA_FIRSEL_GPIO_PIN))) {
  357 + omap_set_gpio_direction(H2_IRDA_FIRSEL_GPIO_PIN, 0);
  358 + h2_irda_data.transceiver_mode = h2_transceiver_mode;
  359 + }
  360 +#endif
189 361  
190 362 platform_add_devices(h2_devices, ARRAY_SIZE(h2_devices));
191 363 omap_board_config = h2_config;
arch/arm/mach-omap1/board-h3.c
... ... @@ -21,8 +21,11 @@
21 21 #include <linux/kernel.h>
22 22 #include <linux/platform_device.h>
23 23 #include <linux/errno.h>
  24 +#include <linux/workqueue.h>
24 25 #include <linux/mtd/mtd.h>
  26 +#include <linux/mtd/nand.h>
25 27 #include <linux/mtd/partitions.h>
  28 +#include <linux/input.h>
26 29  
27 30 #include <asm/setup.h>
28 31 #include <asm/page.h>
29 32  
30 33  
31 34  
... ... @@ -33,15 +36,59 @@
33 36 #include <asm/mach/map.h>
34 37  
35 38 #include <asm/arch/gpio.h>
  39 +#include <asm/arch/gpioexpander.h>
36 40 #include <asm/arch/irqs.h>
37 41 #include <asm/arch/mux.h>
38 42 #include <asm/arch/tc.h>
  43 +#include <asm/arch/irda.h>
39 44 #include <asm/arch/usb.h>
  45 +#include <asm/arch/keypad.h>
  46 +#include <asm/arch/dma.h>
40 47 #include <asm/arch/common.h>
41 48  
42 49 extern int omap_gpio_init(void);
43 50  
44   -static struct mtd_partition h3_partitions[] = {
  51 +static int h3_keymap[] = {
  52 + KEY(0, 0, KEY_LEFT),
  53 + KEY(0, 1, KEY_RIGHT),
  54 + KEY(0, 2, KEY_3),
  55 + KEY(0, 3, KEY_F10),
  56 + KEY(0, 4, KEY_F5),
  57 + KEY(0, 5, KEY_9),
  58 + KEY(1, 0, KEY_DOWN),
  59 + KEY(1, 1, KEY_UP),
  60 + KEY(1, 2, KEY_2),
  61 + KEY(1, 3, KEY_F9),
  62 + KEY(1, 4, KEY_F7),
  63 + KEY(1, 5, KEY_0),
  64 + KEY(2, 0, KEY_ENTER),
  65 + KEY(2, 1, KEY_6),
  66 + KEY(2, 2, KEY_1),
  67 + KEY(2, 3, KEY_F2),
  68 + KEY(2, 4, KEY_F6),
  69 + KEY(2, 5, KEY_HOME),
  70 + KEY(3, 0, KEY_8),
  71 + KEY(3, 1, KEY_5),
  72 + KEY(3, 2, KEY_F12),
  73 + KEY(3, 3, KEY_F3),
  74 + KEY(3, 4, KEY_F8),
  75 + KEY(3, 5, KEY_END),
  76 + KEY(4, 0, KEY_7),
  77 + KEY(4, 1, KEY_4),
  78 + KEY(4, 2, KEY_F11),
  79 + KEY(4, 3, KEY_F1),
  80 + KEY(4, 4, KEY_F4),
  81 + KEY(4, 5, KEY_ESC),
  82 + KEY(5, 0, KEY_F13),
  83 + KEY(5, 1, KEY_F14),
  84 + KEY(5, 2, KEY_F15),
  85 + KEY(5, 3, KEY_F16),
  86 + KEY(5, 4, KEY_SLEEP),
  87 + 0
  88 +};
  89 +
  90 +
  91 +static struct mtd_partition nor_partitions[] = {
45 92 /* bootloader (U-Boot, etc) in first sector */
46 93 {
47 94 .name = "bootloader",
48 95  
49 96  
50 97  
51 98  
52 99  
53 100  
... ... @@ -72,28 +119,82 @@
72 119 }
73 120 };
74 121  
75   -static struct flash_platform_data h3_flash_data = {
  122 +static struct flash_platform_data nor_data = {
76 123 .map_name = "cfi_probe",
77 124 .width = 2,
78   - .parts = h3_partitions,
79   - .nr_parts = ARRAY_SIZE(h3_partitions),
  125 + .parts = nor_partitions,
  126 + .nr_parts = ARRAY_SIZE(nor_partitions),
80 127 };
81 128  
82   -static struct resource h3_flash_resource = {
  129 +static struct resource nor_resource = {
83 130 /* This is on CS3, wherever it's mapped */
84 131 .flags = IORESOURCE_MEM,
85 132 };
86 133  
87   -static struct platform_device flash_device = {
  134 +static struct platform_device nor_device = {
88 135 .name = "omapflash",
89 136 .id = 0,
90 137 .dev = {
91   - .platform_data = &h3_flash_data,
  138 + .platform_data = &nor_data,
92 139 },
93 140 .num_resources = 1,
94   - .resource = &h3_flash_resource,
  141 + .resource = &nor_resource,
95 142 };
96 143  
  144 +static struct mtd_partition nand_partitions[] = {
  145 +#if 0
  146 + /* REVISIT: enable these partitions if you make NAND BOOT work */
  147 + {
  148 + .name = "xloader",
  149 + .offset = 0,
  150 + .size = 64 * 1024,
  151 + .mask_flags = MTD_WRITEABLE, /* force read-only */
  152 + },
  153 + {
  154 + .name = "bootloader",
  155 + .offset = MTDPART_OFS_APPEND,
  156 + .size = 256 * 1024,
  157 + .mask_flags = MTD_WRITEABLE, /* force read-only */
  158 + },
  159 + {
  160 + .name = "params",
  161 + .offset = MTDPART_OFS_APPEND,
  162 + .size = 192 * 1024,
  163 + },
  164 + {
  165 + .name = "kernel",
  166 + .offset = MTDPART_OFS_APPEND,
  167 + .size = 2 * SZ_1M,
  168 + },
  169 +#endif
  170 + {
  171 + .name = "filesystem",
  172 + .size = MTDPART_SIZ_FULL,
  173 + .offset = MTDPART_OFS_APPEND,
  174 + },
  175 +};
  176 +
  177 +/* dip switches control NAND chip access: 8 bit, 16 bit, or neither */
  178 +static struct nand_platform_data nand_data = {
  179 + .options = NAND_SAMSUNG_LP_OPTIONS,
  180 + .parts = nand_partitions,
  181 + .nr_parts = ARRAY_SIZE(nand_partitions),
  182 +};
  183 +
  184 +static struct resource nand_resource = {
  185 + .flags = IORESOURCE_MEM,
  186 +};
  187 +
  188 +static struct platform_device nand_device = {
  189 + .name = "omapnand",
  190 + .id = 0,
  191 + .dev = {
  192 + .platform_data = &nand_data,
  193 + },
  194 + .num_resources = 1,
  195 + .resource = &nand_resource,
  196 +};
  197 +
97 198 static struct resource smc91x_resources[] = {
98 199 [0] = {
99 200 .start = OMAP1710_ETHR_START, /* Physical */
100 201  
101 202  
... ... @@ -138,10 +239,136 @@
138 239 .resource = intlat_resources,
139 240 };
140 241  
  242 +static struct resource h3_kp_resources[] = {
  243 + [0] = {
  244 + .start = INT_KEYBOARD,
  245 + .end = INT_KEYBOARD,
  246 + .flags = IORESOURCE_IRQ,
  247 + },
  248 +};
  249 +
  250 +static struct omap_kp_platform_data h3_kp_data = {
  251 + .rows = 8,
  252 + .cols = 8,
  253 + .keymap = h3_keymap,
  254 + .rep = 1,
  255 +};
  256 +
  257 +static struct platform_device h3_kp_device = {
  258 + .name = "omap-keypad",
  259 + .id = -1,
  260 + .dev = {
  261 + .platform_data = &h3_kp_data,
  262 + },
  263 + .num_resources = ARRAY_SIZE(h3_kp_resources),
  264 + .resource = h3_kp_resources,
  265 +};
  266 +
  267 +
  268 +/* Select between the IrDA and aGPS module
  269 + */
  270 +static int h3_select_irda(struct device *dev, int state)
  271 +{
  272 + unsigned char expa;
  273 + int err = 0;
  274 +
  275 + if ((err = read_gpio_expa(&expa, 0x26))) {
  276 + printk(KERN_ERR "Error reading from I/O EXPANDER \n");
  277 + return err;
  278 + }
  279 +
  280 + /* 'P6' enable/disable IRDA_TX and IRDA_RX */
  281 + if (state & IR_SEL) { /* IrDA */
  282 + if ((err = write_gpio_expa(expa | 0x40, 0x26))) {
  283 + printk(KERN_ERR "Error writing to I/O EXPANDER \n");
  284 + return err;
  285 + }
  286 + } else {
  287 + if ((err = write_gpio_expa(expa & ~0x40, 0x26))) {
  288 + printk(KERN_ERR "Error writing to I/O EXPANDER \n");
  289 + return err;
  290 + }
  291 + }
  292 + return err;
  293 +}
  294 +
  295 +static void set_trans_mode(void *data)
  296 +{
  297 + int *mode = data;
  298 + unsigned char expa;
  299 + int err = 0;
  300 +
  301 + if ((err = read_gpio_expa(&expa, 0x27)) != 0) {
  302 + printk(KERN_ERR "Error reading from I/O expander\n");
  303 + }
  304 +
  305 + expa &= ~0x03;
  306 +
  307 + if (*mode & IR_SIRMODE) {
  308 + expa |= 0x01;
  309 + } else { /* MIR/FIR */
  310 + expa |= 0x03;
  311 + }
  312 +
  313 + if ((err = write_gpio_expa(expa, 0x27)) != 0) {
  314 + printk(KERN_ERR "Error writing to I/O expander\n");
  315 + }
  316 +}
  317 +
  318 +static int h3_transceiver_mode(struct device *dev, int mode)
  319 +{
  320 + struct omap_irda_config *irda_config = dev->platform_data;
  321 +
  322 + cancel_delayed_work(&irda_config->gpio_expa);
  323 + PREPARE_WORK(&irda_config->gpio_expa, set_trans_mode, &mode);
  324 + schedule_work(&irda_config->gpio_expa);
  325 +
  326 + return 0;
  327 +}
  328 +
  329 +static struct omap_irda_config h3_irda_data = {
  330 + .transceiver_cap = IR_SIRMODE | IR_MIRMODE | IR_FIRMODE,
  331 + .transceiver_mode = h3_transceiver_mode,
  332 + .select_irda = h3_select_irda,
  333 + .rx_channel = OMAP_DMA_UART3_RX,
  334 + .tx_channel = OMAP_DMA_UART3_TX,
  335 + .dest_start = UART3_THR,
  336 + .src_start = UART3_RHR,
  337 + .tx_trigger = 0,
  338 + .rx_trigger = 0,
  339 +};
  340 +
  341 +static struct resource h3_irda_resources[] = {
  342 + [0] = {
  343 + .start = INT_UART3,
  344 + .end = INT_UART3,
  345 + .flags = IORESOURCE_IRQ,
  346 + },
  347 +};
  348 +
  349 +static struct platform_device h3_irda_device = {
  350 + .name = "omapirda",
  351 + .id = 0,
  352 + .dev = {
  353 + .platform_data = &h3_irda_data,
  354 + },
  355 + .num_resources = ARRAY_SIZE(h3_irda_resources),
  356 + .resource = h3_irda_resources,
  357 +};
  358 +
  359 +static struct platform_device h3_lcd_device = {
  360 + .name = "lcd_h3",
  361 + .id = -1,
  362 +};
  363 +
141 364 static struct platform_device *devices[] __initdata = {
142   - &flash_device,
  365 + &nor_device,
  366 + &nand_device,
143 367 &smc91x_device,
144 368 &intlat_device,
  369 + &h3_irda_device,
  370 + &h3_kp_device,
  371 + &h3_lcd_device,
145 372 };
146 373  
147 374 static struct omap_usb_config h3_usb_config __initdata = {
... ... @@ -171,7 +398,6 @@
171 398 };
172 399  
173 400 static struct omap_lcd_config h3_lcd_config __initdata = {
174   - .panel_name = "h3",
175 401 .ctrl_name = "internal",
176 402 };
177 403  
178 404  
... ... @@ -182,11 +408,36 @@
182 408 { OMAP_TAG_LCD, &h3_lcd_config },
183 409 };
184 410  
  411 +#define H3_NAND_RB_GPIO_PIN 10
  412 +
  413 +static int nand_dev_ready(struct nand_platform_data *data)
  414 +{
  415 + return omap_get_gpio_datain(H3_NAND_RB_GPIO_PIN);
  416 +}
  417 +
185 418 static void __init h3_init(void)
186 419 {
187   - h3_flash_resource.end = h3_flash_resource.start = omap_cs3_phys();
188   - h3_flash_resource.end += OMAP_CS3_SIZE - 1;
189   - (void) platform_add_devices(devices, ARRAY_SIZE(devices));
  420 + /* Here we assume the NOR boot config: NOR on CS3 (possibly swapped
  421 + * to address 0 by a dip switch), NAND on CS2B. The NAND driver will
  422 + * notice whether a NAND chip is enabled at probe time.
  423 + *
  424 + * H3 support NAND-boot, with a dip switch to put NOR on CS2B and NAND
  425 + * (which on H2 may be 16bit) on CS3. Try detecting that in code here,
  426 + * to avoid probing every possible flash configuration...
  427 + */
  428 + nor_resource.end = nor_resource.start = omap_cs3_phys();
  429 + nor_resource.end += SZ_32M - 1;
  430 +
  431 + nand_resource.end = nand_resource.start = OMAP_CS2B_PHYS;
  432 + nand_resource.end += SZ_4K - 1;
  433 + if (!(omap_request_gpio(H3_NAND_RB_GPIO_PIN)))
  434 + nand_data.dev_ready = nand_dev_ready;
  435 +
  436 + /* GPIO10 Func_MUX_CTRL reg bit 29:27, Configure V2 to mode1 as GPIO */
  437 + /* GPIO10 pullup/down register, Enable pullup on GPIO10 */
  438 + omap_cfg_reg(V2_1710_GPIO10);
  439 +
  440 + platform_add_devices(devices, ARRAY_SIZE(devices));
190 441 omap_board_config = h3_config;
191 442 omap_board_config_size = ARRAY_SIZE(h3_config);
192 443 omap_serial_init();
arch/arm/mach-omap1/board-innovator.c
... ... @@ -22,6 +22,7 @@
22 22 #include <linux/delay.h>
23 23 #include <linux/mtd/mtd.h>
24 24 #include <linux/mtd/partitions.h>
  25 +#include <linux/input.h>
25 26  
26 27 #include <asm/hardware.h>
27 28 #include <asm/mach-types.h>
28 29  
... ... @@ -34,8 +35,22 @@
34 35 #include <asm/arch/gpio.h>
35 36 #include <asm/arch/tc.h>
36 37 #include <asm/arch/usb.h>
  38 +#include <asm/arch/keypad.h>
37 39 #include <asm/arch/common.h>
38 40  
  41 +static int innovator_keymap[] = {
  42 + KEY(0, 0, KEY_F1),
  43 + KEY(0, 3, KEY_DOWN),
  44 + KEY(1, 1, KEY_F2),
  45 + KEY(1, 2, KEY_RIGHT),
  46 + KEY(2, 0, KEY_F3),
  47 + KEY(2, 1, KEY_F4),
  48 + KEY(2, 2, KEY_UP),
  49 + KEY(3, 2, KEY_ENTER),
  50 + KEY(3, 3, KEY_LEFT),
  51 + 0
  52 +};
  53 +
39 54 static struct mtd_partition innovator_partitions[] = {
40 55 /* bootloader (U-Boot, etc) in first sector */
41 56 {
... ... @@ -97,6 +112,31 @@
97 112 .resource = &innovator_flash_resource,
98 113 };
99 114  
  115 +static struct resource innovator_kp_resources[] = {
  116 + [0] = {
  117 + .start = INT_KEYBOARD,
  118 + .end = INT_KEYBOARD,
  119 + .flags = IORESOURCE_IRQ,
  120 + },
  121 +};
  122 +
  123 +static struct omap_kp_platform_data innovator_kp_data = {
  124 + .rows = 8,
  125 + .cols = 8,
  126 + .keymap = innovator_keymap,
  127 +};
  128 +
  129 +static struct platform_device innovator_kp_device = {
  130 + .name = "omap-keypad",
  131 + .id = -1,
  132 + .dev = {
  133 + .platform_data = &innovator_kp_data,
  134 + },
  135 + .num_resources = ARRAY_SIZE(innovator_kp_resources),
  136 + .resource = innovator_kp_resources,
  137 +};
  138 +
  139 +
100 140 #ifdef CONFIG_ARCH_OMAP15XX
101 141  
102 142 /* Only FPGA needs to be mapped here. All others are done with ioremap */
103 143  
... ... @@ -129,9 +169,16 @@
129 169 .resource = innovator1510_smc91x_resources,
130 170 };
131 171  
  172 +static struct platform_device innovator1510_lcd_device = {
  173 + .name = "lcd_inn1510",
  174 + .id = -1,
  175 +};
  176 +
132 177 static struct platform_device *innovator1510_devices[] __initdata = {
133 178 &innovator_flash_device,
134 179 &innovator1510_smc91x_device,
  180 + &innovator_kp_device,
  181 + &innovator1510_lcd_device,
135 182 };
136 183  
137 184 #endif /* CONFIG_ARCH_OMAP15XX */
138 185  
... ... @@ -158,9 +205,16 @@
158 205 .resource = innovator1610_smc91x_resources,
159 206 };
160 207  
  208 +static struct platform_device innovator1610_lcd_device = {
  209 + .name = "inn1610_lcd",
  210 + .id = -1,
  211 +};
  212 +
161 213 static struct platform_device *innovator1610_devices[] __initdata = {
162 214 &innovator_flash_device,
163 215 &innovator1610_smc91x_device,
  216 + &innovator_kp_device,
  217 + &innovator1610_lcd_device,
164 218 };
165 219  
166 220 #endif /* CONFIG_ARCH_OMAP16XX */
... ... @@ -206,7 +260,6 @@
206 260 };
207 261  
208 262 static struct omap_lcd_config innovator1510_lcd_config __initdata = {
209   - .panel_name = "inn1510",
210 263 .ctrl_name = "internal",
211 264 };
212 265 #endif
... ... @@ -228,7 +281,6 @@
228 281 };
229 282  
230 283 static struct omap_lcd_config innovator1610_lcd_config __initdata = {
231   - .panel_name = "inn1610",
232 284 .ctrl_name = "internal",
233 285 };
234 286 #endif
arch/arm/mach-omap1/board-netstar.c
1   -/*
2   - * Modified from board-generic.c
3   - *
4   - * Copyright (C) 2004 2N Telekomunikace, Ladislav Michl <michl@2n.cz>
5   - *
6   - * Code for Netstar OMAP board.
7   - *
8   - * This program is free software; you can redistribute it and/or modify
9   - * it under the terms of the GNU General Public License version 2 as
10   - * published by the Free Software Foundation.
11   - */
12   -
13   -#include <linux/delay.h>
14   -#include <linux/platform_device.h>
15   -#include <linux/interrupt.h>
16   -#include <linux/init.h>
17   -#include <linux/kernel.h>
18   -#include <linux/notifier.h>
19   -#include <linux/reboot.h>
20   -
21   -#include <asm/hardware.h>
22   -#include <asm/mach-types.h>
23   -#include <asm/mach/arch.h>
24   -#include <asm/mach/map.h>
25   -
26   -#include <asm/arch/gpio.h>
27   -#include <asm/arch/mux.h>
28   -#include <asm/arch/usb.h>
29   -#include <asm/arch/common.h>
30   -
31   -extern void __init omap_init_time(void);
32   -extern int omap_gpio_init(void);
33   -
34   -static struct resource netstar_smc91x_resources[] = {
35   - [0] = {
36   - .start = OMAP_CS1_PHYS + 0x300,
37   - .end = OMAP_CS1_PHYS + 0x300 + 16,
38   - .flags = IORESOURCE_MEM,
39   - },
40   - [1] = {
41   - .start = OMAP_GPIO_IRQ(8),
42   - .end = OMAP_GPIO_IRQ(8),
43   - .flags = IORESOURCE_IRQ,
44   - },
45   -};
46   -
47   -static struct platform_device netstar_smc91x_device = {
48   - .name = "smc91x",
49   - .id = 0,
50   - .num_resources = ARRAY_SIZE(netstar_smc91x_resources),
51   - .resource = netstar_smc91x_resources,
52   -};
53   -
54   -static struct platform_device *netstar_devices[] __initdata = {
55   - &netstar_smc91x_device,
56   -};
57   -
58   -static struct omap_uart_config netstar_uart_config __initdata = {
59   - .enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)),
60   -};
61   -
62   -static struct omap_board_config_kernel netstar_config[] = {
63   - { OMAP_TAG_UART, &netstar_uart_config },
64   -};
65   -
66   -static void __init netstar_init_irq(void)
67   -{
68   - omap1_init_common_hw();
69   - omap_init_irq();
70   - omap_gpio_init();
71   -}
72   -
73   -static void __init netstar_init(void)
74   -{
75   - /* green LED */
76   - omap_request_gpio(4);
77   - omap_set_gpio_direction(4, 0);
78   - /* smc91x reset */
79   - omap_request_gpio(7);
80   - omap_set_gpio_direction(7, 0);
81   - omap_set_gpio_dataout(7, 1);
82   - udelay(2); /* wait at least 100ns */
83   - omap_set_gpio_dataout(7, 0);
84   - mdelay(50); /* 50ms until PHY ready */
85   - /* smc91x interrupt pin */
86   - omap_request_gpio(8);
87   -
88   - omap_request_gpio(12);
89   - omap_request_gpio(13);
90   - omap_request_gpio(14);
91   - omap_request_gpio(15);
92   - set_irq_type(OMAP_GPIO_IRQ(12), IRQT_FALLING);
93   - set_irq_type(OMAP_GPIO_IRQ(13), IRQT_FALLING);
94   - set_irq_type(OMAP_GPIO_IRQ(14), IRQT_FALLING);
95   - set_irq_type(OMAP_GPIO_IRQ(15), IRQT_FALLING);
96   -
97   - platform_add_devices(netstar_devices, ARRAY_SIZE(netstar_devices));
98   -
99   - /* Switch on green LED */
100   - omap_set_gpio_dataout(4, 0);
101   - /* Switch off red LED */
102   - omap_writeb(0x00, OMAP_LPG1_PMR); /* Disable clock */
103   - omap_writeb(0x80, OMAP_LPG1_LCR);
104   -
105   - omap_board_config = netstar_config;
106   - omap_board_config_size = ARRAY_SIZE(netstar_config);
107   - omap_serial_init();
108   -}
109   -
110   -static void __init netstar_map_io(void)
111   -{
112   - omap1_map_common_io();
113   -}
114   -
115   -#define MACHINE_PANICED 1
116   -#define MACHINE_REBOOTING 2
117   -#define MACHINE_REBOOT 4
118   -static unsigned long machine_state;
119   -
120   -static int panic_event(struct notifier_block *this, unsigned long event,
121   - void *ptr)
122   -{
123   - if (test_and_set_bit(MACHINE_PANICED, &machine_state))
124   - return NOTIFY_DONE;
125   -
126   - /* Switch off green LED */
127   - omap_set_gpio_dataout(4, 1);
128   - /* Flash red LED */
129   - omap_writeb(0x78, OMAP_LPG1_LCR);
130   - omap_writeb(0x01, OMAP_LPG1_PMR); /* Enable clock */
131   -
132   - return NOTIFY_DONE;
133   -}
134   -
135   -static struct notifier_block panic_block = {
136   - .notifier_call = panic_event,
137   -};
138   -
139   -static int __init netstar_late_init(void)
140   -{
141   - /* TODO: Setup front panel switch here */
142   -
143   - /* Setup panic notifier */
144   - atomic_notifier_chain_register(&panic_notifier_list, &panic_block);
145   -
146   - return 0;
147   -}
148   -
149   -postcore_initcall(netstar_late_init);
150   -
151   -MACHINE_START(NETSTAR, "NetStar OMAP5910")
152   - /* Maintainer: Ladislav Michl <michl@2n.cz> */
153   - .phys_io = 0xfff00000,
154   - .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc,
155   - .boot_params = 0x10000100,
156   - .map_io = netstar_map_io,
157   - .init_irq = netstar_init_irq,
158   - .init_machine = netstar_init,
159   - .timer = &omap_timer,
160   -MACHINE_END
arch/arm/mach-omap1/board-nokia770.c
  1 +/*
  2 + * linux/arch/arm/mach-omap1/board-nokia770.c
  3 + *
  4 + * Modified from board-generic.c
  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 +
  11 +#include <linux/kernel.h>
  12 +#include <linux/init.h>
  13 +#include <linux/platform_device.h>
  14 +#include <linux/input.h>
  15 +#include <linux/clk.h>
  16 +
  17 +#include <linux/spi/spi.h>
  18 +#include <linux/spi/ads7846.h>
  19 +
  20 +#include <asm/hardware.h>
  21 +#include <asm/mach-types.h>
  22 +#include <asm/mach/arch.h>
  23 +#include <asm/mach/map.h>
  24 +
  25 +#include <asm/arch/gpio.h>
  26 +#include <asm/arch/mux.h>
  27 +#include <asm/arch/usb.h>
  28 +#include <asm/arch/board.h>
  29 +#include <asm/arch/keypad.h>
  30 +#include <asm/arch/common.h>
  31 +#include <asm/arch/dsp_common.h>
  32 +#include <asm/arch/aic23.h>
  33 +#include <asm/arch/gpio.h>
  34 +
  35 +static void __init omap_nokia770_init_irq(void)
  36 +{
  37 + /* On Nokia 770, the SleepX signal is masked with an
  38 + * MPUIO line by default. It has to be unmasked for it
  39 + * to become functional */
  40 +
  41 + /* SleepX mask direction */
  42 + omap_writew((omap_readw(0xfffb5008) & ~2), 0xfffb5008);
  43 + /* Unmask SleepX signal */
  44 + omap_writew((omap_readw(0xfffb5004) & ~2), 0xfffb5004);
  45 +
  46 + omap1_init_common_hw();
  47 + omap_init_irq();
  48 +}
  49 +
  50 +static int nokia770_keymap[] = {
  51 + KEY(0, 1, GROUP_0 | KEY_UP),
  52 + KEY(0, 2, GROUP_1 | KEY_F5),
  53 + KEY(1, 0, GROUP_0 | KEY_LEFT),
  54 + KEY(1, 1, GROUP_0 | KEY_ENTER),
  55 + KEY(1, 2, GROUP_0 | KEY_RIGHT),
  56 + KEY(2, 0, GROUP_1 | KEY_ESC),
  57 + KEY(2, 1, GROUP_0 | KEY_DOWN),
  58 + KEY(2, 2, GROUP_1 | KEY_F4),
  59 + KEY(3, 0, GROUP_2 | KEY_F7),
  60 + KEY(3, 1, GROUP_2 | KEY_F8),
  61 + KEY(3, 2, GROUP_2 | KEY_F6),
  62 + 0
  63 +};
  64 +
  65 +static struct resource nokia770_kp_resources[] = {
  66 + [0] = {
  67 + .start = INT_KEYBOARD,
  68 + .end = INT_KEYBOARD,
  69 + .flags = IORESOURCE_IRQ,
  70 + },
  71 +};
  72 +
  73 +static struct omap_kp_platform_data nokia770_kp_data = {
  74 + .rows = 8,
  75 + .cols = 8,
  76 + .keymap = nokia770_keymap
  77 +};
  78 +
  79 +static struct platform_device nokia770_kp_device = {
  80 + .name = "omap-keypad",
  81 + .id = -1,
  82 + .dev = {
  83 + .platform_data = &nokia770_kp_data,
  84 + },
  85 + .num_resources = ARRAY_SIZE(nokia770_kp_resources),
  86 + .resource = nokia770_kp_resources,
  87 +};
  88 +
  89 +static struct platform_device *nokia770_devices[] __initdata = {
  90 + &nokia770_kp_device,
  91 +};
  92 +
  93 +static struct ads7846_platform_data nokia770_ads7846_platform_data __initdata = {
  94 + .x_max = 0x0fff,
  95 + .y_max = 0x0fff,
  96 + .x_plate_ohms = 180,
  97 + .pressure_max = 255,
  98 + .debounce_max = 10,
  99 + .debounce_tol = 3,
  100 +};
  101 +
  102 +static struct spi_board_info nokia770_spi_board_info[] __initdata = {
  103 + [0] = {
  104 + .modalias = "lcd_lph8923",
  105 + .bus_num = 2,
  106 + .chip_select = 3,
  107 + .max_speed_hz = 12000000,
  108 + },
  109 + [1] = {
  110 + .modalias = "ads7846",
  111 + .bus_num = 2,
  112 + .chip_select = 0,
  113 + .max_speed_hz = 2500000,
  114 + .irq = OMAP_GPIO_IRQ(15),
  115 + .platform_data = &nokia770_ads7846_platform_data,
  116 + },
  117 +};
  118 +
  119 +
  120 +/* assume no Mini-AB port */
  121 +
  122 +static struct omap_usb_config nokia770_usb_config __initdata = {
  123 + .otg = 1,
  124 + .register_host = 1,
  125 + .register_dev = 1,
  126 + .hmc_mode = 16,
  127 + .pins[0] = 6,
  128 +};
  129 +
  130 +static struct omap_mmc_config nokia770_mmc_config __initdata = {
  131 + .mmc[0] = {
  132 + .enabled = 0,
  133 + .wire4 = 0,
  134 + .wp_pin = -1,
  135 + .power_pin = -1,
  136 + .switch_pin = -1,
  137 + },
  138 + .mmc[1] = {
  139 + .enabled = 0,
  140 + .wire4 = 0,
  141 + .wp_pin = -1,
  142 + .power_pin = -1,
  143 + .switch_pin = -1,
  144 + },
  145 +};
  146 +
  147 +static struct omap_board_config_kernel nokia770_config[] = {
  148 + { OMAP_TAG_USB, NULL },
  149 + { OMAP_TAG_MMC, &nokia770_mmc_config },
  150 +};
  151 +
  152 +/*
  153 + * audio power control
  154 + */
  155 +#define HEADPHONE_GPIO 14
  156 +#define AMPLIFIER_CTRL_GPIO 58
  157 +
  158 +static struct clk *dspxor_ck;
  159 +static DECLARE_MUTEX(audio_pwr_sem);
  160 +/*
  161 + * audio_pwr_state
  162 + * +--+-------------------------+---------------------------------------+
  163 + * |-1|down |power-up request -> 0 |
  164 + * +--+-------------------------+---------------------------------------+
  165 + * | 0|up |power-down(1) request -> 1 |
  166 + * | | |power-down(2) request -> (ignore) |
  167 + * +--+-------------------------+---------------------------------------+
  168 + * | 1|up, |power-up request -> 0 |
  169 + * | |received down(1) request |power-down(2) request -> -1 |
  170 + * +--+-------------------------+---------------------------------------+
  171 + */
  172 +static int audio_pwr_state = -1;
  173 +
  174 +/*
  175 + * audio_pwr_up / down should be called under audio_pwr_sem
  176 + */
  177 +static void nokia770_audio_pwr_up(void)
  178 +{
  179 + clk_enable(dspxor_ck);
  180 +
  181 + /* Turn on codec */
  182 + tlv320aic23_power_up();
  183 +
  184 + if (omap_get_gpio_datain(HEADPHONE_GPIO))
  185 + /* HP not connected, turn on amplifier */
  186 + omap_set_gpio_dataout(AMPLIFIER_CTRL_GPIO, 1);
  187 + else
  188 + /* HP connected, do not turn on amplifier */
  189 + printk("HP connected\n");
  190 +}
  191 +
  192 +static void codec_delayed_power_down(void *arg)
  193 +{
  194 + down(&audio_pwr_sem);
  195 + if (audio_pwr_state == -1)
  196 + tlv320aic23_power_down();
  197 + clk_disable(dspxor_ck);
  198 + up(&audio_pwr_sem);
  199 +}
  200 +
  201 +static DECLARE_WORK(codec_power_down_work, codec_delayed_power_down, NULL);
  202 +
  203 +static void nokia770_audio_pwr_down(void)
  204 +{
  205 + /* Turn off amplifier */
  206 + omap_set_gpio_dataout(AMPLIFIER_CTRL_GPIO, 0);
  207 +
  208 + /* Turn off codec: schedule delayed work */
  209 + schedule_delayed_work(&codec_power_down_work, HZ / 20); /* 50ms */
  210 +}
  211 +
  212 +void nokia770_audio_pwr_up_request(int stage)
  213 +{
  214 + down(&audio_pwr_sem);
  215 + if (audio_pwr_state == -1)
  216 + nokia770_audio_pwr_up();
  217 + /* force audio_pwr_state = 0, even if it was 1. */
  218 + audio_pwr_state = 0;
  219 + up(&audio_pwr_sem);
  220 +}
  221 +
  222 +void nokia770_audio_pwr_down_request(int stage)
  223 +{
  224 + down(&audio_pwr_sem);
  225 + switch (stage) {
  226 + case 1:
  227 + if (audio_pwr_state == 0)
  228 + audio_pwr_state = 1;
  229 + break;
  230 + case 2:
  231 + if (audio_pwr_state == 1) {
  232 + nokia770_audio_pwr_down();
  233 + audio_pwr_state = -1;
  234 + }
  235 + break;
  236 + }
  237 + up(&audio_pwr_sem);
  238 +}
  239 +
  240 +static void __init omap_nokia770_init(void)
  241 +{
  242 + nokia770_config[0].data = &nokia770_usb_config;
  243 +
  244 + platform_add_devices(nokia770_devices, ARRAY_SIZE(nokia770_devices));
  245 + spi_register_board_info(nokia770_spi_board_info,
  246 + ARRAY_SIZE(nokia770_spi_board_info));
  247 + omap_board_config = nokia770_config;
  248 + omap_board_config_size = ARRAY_SIZE(nokia770_config);
  249 + omap_serial_init();
  250 + omap_dsp_audio_pwr_up_request = nokia770_audio_pwr_up_request;
  251 + omap_dsp_audio_pwr_down_request = nokia770_audio_pwr_down_request;
  252 + dspxor_ck = clk_get(0, "dspxor_ck");
  253 +}
  254 +
  255 +static void __init omap_nokia770_map_io(void)
  256 +{
  257 + omap1_map_common_io();
  258 +}
  259 +
  260 +MACHINE_START(NOKIA770, "Nokia 770")
  261 + .phys_io = 0xfff00000,
  262 + .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc,
  263 + .boot_params = 0x10000100,
  264 + .map_io = omap_nokia770_map_io,
  265 + .init_irq = omap_nokia770_init_irq,
  266 + .init_machine = omap_nokia770_init,
  267 + .timer = &omap_timer,
  268 +MACHINE_END
arch/arm/mach-omap1/board-osk.c
... ... @@ -33,6 +33,7 @@
33 33  
34 34 #include <linux/mtd/mtd.h>
35 35 #include <linux/mtd/partitions.h>
  36 +#include <linux/input.h>
36 37  
37 38 #include <asm/hardware.h>
38 39 #include <asm/mach-types.h>
39 40  
40 41  
... ... @@ -44,8 +45,25 @@
44 45 #include <asm/arch/usb.h>
45 46 #include <asm/arch/mux.h>
46 47 #include <asm/arch/tc.h>
  48 +#include <asm/arch/keypad.h>
47 49 #include <asm/arch/common.h>
  50 +#include <asm/arch/mcbsp.h>
  51 +#include <asm/arch/omap-alsa.h>
48 52  
  53 +static int osk_keymap[] = {
  54 + KEY(0, 0, KEY_F1),
  55 + KEY(0, 3, KEY_UP),
  56 + KEY(1, 1, KEY_LEFTCTRL),
  57 + KEY(1, 2, KEY_LEFT),
  58 + KEY(2, 0, KEY_SPACE),
  59 + KEY(2, 1, KEY_ESC),
  60 + KEY(2, 2, KEY_DOWN),
  61 + KEY(3, 2, KEY_ENTER),
  62 + KEY(3, 3, KEY_RIGHT),
  63 + 0
  64 +};
  65 +
  66 +
49 67 static struct mtd_partition osk_partitions[] = {
50 68 /* bootloader (U-Boot, etc) in first sector */
51 69 {
52 70  
53 71  
54 72  
... ... @@ -133,16 +151,78 @@
133 151 .resource = osk5912_cf_resources,
134 152 };
135 153  
  154 +#define DEFAULT_BITPERSAMPLE 16
  155 +
  156 +static struct omap_mcbsp_reg_cfg mcbsp_regs = {
  157 + .spcr2 = FREE | FRST | GRST | XRST | XINTM(3),
  158 + .spcr1 = RINTM(3) | RRST,
  159 + .rcr2 = RPHASE | RFRLEN2(OMAP_MCBSP_WORD_8) |
  160 + RWDLEN2(OMAP_MCBSP_WORD_16) | RDATDLY(0),
  161 + .rcr1 = RFRLEN1(OMAP_MCBSP_WORD_8) | RWDLEN1(OMAP_MCBSP_WORD_16),
  162 + .xcr2 = XPHASE | XFRLEN2(OMAP_MCBSP_WORD_8) |
  163 + XWDLEN2(OMAP_MCBSP_WORD_16) | XDATDLY(0) | XFIG,
  164 + .xcr1 = XFRLEN1(OMAP_MCBSP_WORD_8) | XWDLEN1(OMAP_MCBSP_WORD_16),
  165 + .srgr1 = FWID(DEFAULT_BITPERSAMPLE - 1),
  166 + .srgr2 = GSYNC | CLKSP | FSGM | FPER(DEFAULT_BITPERSAMPLE * 2 - 1),
  167 + /*.pcr0 = FSXM | FSRM | CLKXM | CLKRM | CLKXP | CLKRP,*/ /* mcbsp: master */
  168 + .pcr0 = CLKXP | CLKRP, /* mcbsp: slave */
  169 +};
  170 +
  171 +static struct omap_alsa_codec_config alsa_config = {
  172 + .name = "OSK AIC23",
  173 + .mcbsp_regs_alsa = &mcbsp_regs,
  174 + .codec_configure_dev = NULL, // aic23_configure,
  175 + .codec_set_samplerate = NULL, // aic23_set_samplerate,
  176 + .codec_clock_setup = NULL, // aic23_clock_setup,
  177 + .codec_clock_on = NULL, // aic23_clock_on,
  178 + .codec_clock_off = NULL, // aic23_clock_off,
  179 + .get_default_samplerate = NULL, // aic23_get_default_samplerate,
  180 +};
  181 +
136 182 static struct platform_device osk5912_mcbsp1_device = {
137   - .name = "omap_mcbsp",
138   - .id = 1,
  183 + .name = "omap_alsa_mcbsp",
  184 + .id = 1,
  185 + .dev = {
  186 + .platform_data = &alsa_config,
  187 + },
139 188 };
140 189  
  190 +static struct resource osk5912_kp_resources[] = {
  191 + [0] = {
  192 + .start = INT_KEYBOARD,
  193 + .end = INT_KEYBOARD,
  194 + .flags = IORESOURCE_IRQ,
  195 + },
  196 +};
  197 +
  198 +static struct omap_kp_platform_data osk_kp_data = {
  199 + .rows = 8,
  200 + .cols = 8,
  201 + .keymap = osk_keymap,
  202 +};
  203 +
  204 +static struct platform_device osk5912_kp_device = {
  205 + .name = "omap-keypad",
  206 + .id = -1,
  207 + .dev = {
  208 + .platform_data = &osk_kp_data,
  209 + },
  210 + .num_resources = ARRAY_SIZE(osk5912_kp_resources),
  211 + .resource = osk5912_kp_resources,
  212 +};
  213 +
  214 +static struct platform_device osk5912_lcd_device = {
  215 + .name = "lcd_osk",
  216 + .id = -1,
  217 +};
  218 +
141 219 static struct platform_device *osk5912_devices[] __initdata = {
142 220 &osk5912_flash_device,
143 221 &osk5912_smc91x_device,
144 222 &osk5912_cf_device,
145 223 &osk5912_mcbsp1_device,
  224 + &osk5912_kp_device,
  225 + &osk5912_lcd_device,
146 226 };
147 227  
148 228 static void __init osk_init_smc91x(void)
... ... @@ -197,7 +277,6 @@
197 277 };
198 278  
199 279 static struct omap_lcd_config osk_lcd_config __initdata = {
200   - .panel_name = "osk",
201 280 .ctrl_name = "internal",
202 281 };
203 282  
204 283  
... ... @@ -255,8 +334,18 @@
255 334 static void __init osk_mistral_init(void) { }
256 335 #endif
257 336  
  337 +#define EMIFS_CS3_VAL (0x88013141)
  338 +
258 339 static void __init osk_init(void)
259 340 {
  341 + /* Workaround for wrong CS3 (NOR flash) timing
  342 + * There are some U-Boot versions out there which configure
  343 + * wrong CS3 memory timings. This mainly leads to CRC
  344 + * or similiar errors if you use NOR flash (e.g. with JFFS2)
  345 + */
  346 + if (EMIFS_CCS(3) != EMIFS_CS3_VAL)
  347 + EMIFS_CCS(3) = EMIFS_CS3_VAL;
  348 +
260 349 osk_flash_resource.end = osk_flash_resource.start = omap_cs3_phys();
261 350 osk_flash_resource.end += SZ_32M - 1;
262 351 platform_add_devices(osk5912_devices, ARRAY_SIZE(osk5912_devices));
arch/arm/mach-omap1/board-palmte.c
... ... @@ -38,6 +38,15 @@
38 38 omap_init_irq();
39 39 }
40 40  
  41 +static struct platform_device palmte_lcd_device = {
  42 + .name = "lcd_palmte",
  43 + .id = -1,
  44 +};
  45 +
  46 +static struct platform_device *devices[] __initdata = {
  47 + &palmte_lcd_device,
  48 +};
  49 +
41 50 static struct omap_usb_config palmte_usb_config __initdata = {
42 51 .register_dev = 1,
43 52 .hmc_mode = 0,
... ... @@ -55,7 +64,6 @@
55 64 };
56 65  
57 66 static struct omap_lcd_config palmte_lcd_config __initdata = {
58   - .panel_name = "palmte",
59 67 .ctrl_name = "internal",
60 68 };
61 69  
... ... @@ -69,6 +77,8 @@
69 77 {
70 78 omap_board_config = palmte_config;
71 79 omap_board_config_size = ARRAY_SIZE(palmte_config);
  80 +
  81 + platform_add_devices(devices, ARRAY_SIZE(devices));
72 82 }
73 83  
74 84 static void __init omap_generic_map_io(void)
arch/arm/mach-omap1/board-perseus2.c
... ... @@ -16,7 +16,9 @@
16 16 #include <linux/platform_device.h>
17 17 #include <linux/delay.h>
18 18 #include <linux/mtd/mtd.h>
  19 +#include <linux/mtd/nand.h>
19 20 #include <linux/mtd/partitions.h>
  21 +#include <linux/input.h>
20 22  
21 23 #include <asm/hardware.h>
22 24 #include <asm/mach-types.h>
23 25  
... ... @@ -28,9 +30,44 @@
28 30 #include <asm/arch/gpio.h>
29 31 #include <asm/arch/mux.h>
30 32 #include <asm/arch/fpga.h>
  33 +#include <asm/arch/keypad.h>
31 34 #include <asm/arch/common.h>
32 35 #include <asm/arch/board.h>
33 36  
  37 +static int p2_keymap[] = {
  38 + KEY(0,0,KEY_UP),
  39 + KEY(0,1,KEY_RIGHT),
  40 + KEY(0,2,KEY_LEFT),
  41 + KEY(0,3,KEY_DOWN),
  42 + KEY(0,4,KEY_CENTER),
  43 + KEY(0,5,KEY_0_5),
  44 + KEY(1,0,KEY_SOFT2),
  45 + KEY(1,1,KEY_SEND),
  46 + KEY(1,2,KEY_END),
  47 + KEY(1,3,KEY_VOLUMEDOWN),
  48 + KEY(1,4,KEY_VOLUMEUP),
  49 + KEY(1,5,KEY_RECORD),
  50 + KEY(2,0,KEY_SOFT1),
  51 + KEY(2,1,KEY_3),
  52 + KEY(2,2,KEY_6),
  53 + KEY(2,3,KEY_9),
  54 + KEY(2,4,KEY_SHARP),
  55 + KEY(2,5,KEY_2_5),
  56 + KEY(3,0,KEY_BACK),
  57 + KEY(3,1,KEY_2),
  58 + KEY(3,2,KEY_5),
  59 + KEY(3,3,KEY_8),
  60 + KEY(3,4,KEY_0),
  61 + KEY(3,5,KEY_HEADSETHOOK),
  62 + KEY(4,0,KEY_HOME),
  63 + KEY(4,1,KEY_1),
  64 + KEY(4,2,KEY_4),
  65 + KEY(4,3,KEY_7),
  66 + KEY(4,4,KEY_STAR),
  67 + KEY(4,5,KEY_POWER),
  68 + 0
  69 +};
  70 +
34 71 static struct resource smc91x_resources[] = {
35 72 [0] = {
36 73 .start = H2P2_DBG_FPGA_ETHR_START, /* Physical */
... ... @@ -44,7 +81,7 @@
44 81 },
45 82 };
46 83  
47   -static struct mtd_partition p2_partitions[] = {
  84 +static struct mtd_partition nor_partitions[] = {
48 85 /* bootloader (U-Boot, etc) in first sector */
49 86 {
50 87 .name = "bootloader",
51 88  
52 89  
53 90  
54 91  
55 92  
56 93  
... ... @@ -75,29 +112,49 @@
75 112 },
76 113 };
77 114  
78   -static struct flash_platform_data p2_flash_data = {
  115 +static struct flash_platform_data nor_data = {
79 116 .map_name = "cfi_probe",
80 117 .width = 2,
81   - .parts = p2_partitions,
82   - .nr_parts = ARRAY_SIZE(p2_partitions),
  118 + .parts = nor_partitions,
  119 + .nr_parts = ARRAY_SIZE(nor_partitions),
83 120 };
84 121  
85   -static struct resource p2_flash_resource = {
  122 +static struct resource nor_resource = {
86 123 .start = OMAP_CS0_PHYS,
87 124 .end = OMAP_CS0_PHYS + SZ_32M - 1,
88 125 .flags = IORESOURCE_MEM,
89 126 };
90 127  
91   -static struct platform_device p2_flash_device = {
  128 +static struct platform_device nor_device = {
92 129 .name = "omapflash",
93 130 .id = 0,
94 131 .dev = {
95   - .platform_data = &p2_flash_data,
  132 + .platform_data = &nor_data,
96 133 },
97 134 .num_resources = 1,
98   - .resource = &p2_flash_resource,
  135 + .resource = &nor_resource,
99 136 };
100 137  
  138 +static struct nand_platform_data nand_data = {
  139 + .options = NAND_SAMSUNG_LP_OPTIONS,
  140 +};
  141 +
  142 +static struct resource nand_resource = {
  143 + .start = OMAP_CS3_PHYS,
  144 + .end = OMAP_CS3_PHYS + SZ_4K - 1,
  145 + .flags = IORESOURCE_MEM,
  146 +};
  147 +
  148 +static struct platform_device nand_device = {
  149 + .name = "omapnand",
  150 + .id = 0,
  151 + .dev = {
  152 + .platform_data = &nand_data,
  153 + },
  154 + .num_resources = 1,
  155 + .resource = &nand_resource,
  156 +};
  157 +
101 158 static struct platform_device smc91x_device = {
102 159 .name = "smc91x",
103 160 .id = 0,
104 161  
105 162  
106 163  
107 164  
... ... @@ -105,17 +162,55 @@
105 162 .resource = smc91x_resources,
106 163 };
107 164  
  165 +static struct resource kp_resources[] = {
  166 + [0] = {
  167 + .start = INT_730_MPUIO_KEYPAD,
  168 + .end = INT_730_MPUIO_KEYPAD,
  169 + .flags = IORESOURCE_IRQ,
  170 + },
  171 +};
  172 +
  173 +static struct omap_kp_platform_data kp_data = {
  174 + .rows = 8,
  175 + .cols = 8,
  176 + .keymap = p2_keymap,
  177 +};
  178 +
  179 +static struct platform_device kp_device = {
  180 + .name = "omap-keypad",
  181 + .id = -1,
  182 + .dev = {
  183 + .platform_data = &kp_data,
  184 + },
  185 + .num_resources = ARRAY_SIZE(kp_resources),
  186 + .resource = kp_resources,
  187 +};
  188 +
  189 +static struct platform_device lcd_device = {
  190 + .name = "lcd_p2",
  191 + .id = -1,
  192 +};
  193 +
108 194 static struct platform_device *devices[] __initdata = {
109   - &p2_flash_device,
  195 + &nor_device,
  196 + &nand_device,
110 197 &smc91x_device,
  198 + &kp_device,
  199 + &lcd_device,
111 200 };
112 201  
  202 +#define P2_NAND_RB_GPIO_PIN 62
  203 +
  204 +static int nand_dev_ready(struct nand_platform_data *data)
  205 +{
  206 + return omap_get_gpio_datain(P2_NAND_RB_GPIO_PIN);
  207 +}
  208 +
113 209 static struct omap_uart_config perseus2_uart_config __initdata = {
114 210 .enabled_uarts = ((1 << 0) | (1 << 1)),
115 211 };
116 212  
117 213 static struct omap_lcd_config perseus2_lcd_config __initdata = {
118   - .panel_name = "p2",
119 214 .ctrl_name = "internal",
120 215 };
121 216  
... ... @@ -126,7 +221,13 @@
126 221  
127 222 static void __init omap_perseus2_init(void)
128 223 {
129   - (void) platform_add_devices(devices, ARRAY_SIZE(devices));
  224 + if (!(omap_request_gpio(P2_NAND_RB_GPIO_PIN)))
  225 + nand_data.dev_ready = nand_dev_ready;
  226 +
  227 + omap_cfg_reg(L3_1610_FLASH_CS2B_OE);
  228 + omap_cfg_reg(M8_1610_FLASH_CS2B_WE);
  229 +
  230 + platform_add_devices(devices, ARRAY_SIZE(devices));
130 231  
131 232 omap_board_config = perseus2_config;
132 233 omap_board_config_size = ARRAY_SIZE(perseus2_config);
arch/arm/mach-omap1/board-voiceblue.c
... ... @@ -155,9 +155,9 @@
155 155 };
156 156  
157 157 static struct omap_board_config_kernel voiceblue_config[] = {
158   - { OMAP_TAG_USB, &voiceblue_usb_config },
159   - { OMAP_TAG_MMC, &voiceblue_mmc_config },
160   - { OMAP_TAG_UART, &voiceblue_uart_config },
  158 + { OMAP_TAG_USB, &voiceblue_usb_config },
  159 + { OMAP_TAG_MMC, &voiceblue_mmc_config },
  160 + { OMAP_TAG_UART, &voiceblue_uart_config },
161 161 };
162 162  
163 163 static void __init voiceblue_init_irq(void)
... ... @@ -235,7 +235,7 @@
235 235 static int __init voiceblue_setup(void)
236 236 {
237 237 /* Setup panic notifier */
238   - atomic_notifier_chain_register(&panic_notifier_list, &panic_block);
  238 + notifier_chain_register(&panic_notifier_list, &panic_block);
239 239  
240 240 return 0;
241 241 }
arch/arm/mach-omap1/devices.c
... ... @@ -99,7 +99,46 @@
99 99 static inline void omap_init_rtc(void) {}
100 100 #endif
101 101  
  102 +#if defined(CONFIG_OMAP_STI)
102 103  
  104 +#define OMAP1_STI_BASE IO_ADDRESS(0xfffea000)
  105 +#define OMAP1_STI_CHANNEL_BASE (OMAP1_STI_BASE + 0x400)
  106 +
  107 +static struct resource sti_resources[] = {
  108 + {
  109 + .start = OMAP1_STI_BASE,
  110 + .end = OMAP1_STI_BASE + SZ_1K - 1,
  111 + .flags = IORESOURCE_MEM,
  112 + },
  113 + {
  114 + .start = OMAP1_STI_CHANNEL_BASE,
  115 + .end = OMAP1_STI_CHANNEL_BASE + SZ_1K - 1,
  116 + .flags = IORESOURCE_MEM,
  117 + },
  118 + {
  119 + .start = INT_1610_STI,
  120 + .flags = IORESOURCE_IRQ,
  121 + }
  122 +};
  123 +
  124 +static struct platform_device sti_device = {
  125 + .name = "sti",
  126 + .id = -1,
  127 + .dev = {
  128 + .release = omap_nop_release,
  129 + },
  130 + .num_resources = ARRAY_SIZE(sti_resources),
  131 + .resource = sti_resources,
  132 +};
  133 +
  134 +static inline void omap_init_sti(void)
  135 +{
  136 + platform_device_register(&sti_device);
  137 +}
  138 +#else
  139 +static inline void omap_init_sti(void) {}
  140 +#endif
  141 +
103 142 /*-------------------------------------------------------------------------*/
104 143  
105 144 /*
... ... @@ -129,6 +168,7 @@
129 168 */
130 169 omap_init_irda();
131 170 omap_init_rtc();
  171 + omap_init_sti();
132 172  
133 173 return 0;
134 174 }
arch/arm/mach-omap2/Kconfig
... ... @@ -19,4 +19,8 @@
19 19 config MACH_OMAP_H4
20 20 bool "OMAP 2420 H4 board"
21 21 depends on ARCH_OMAP2 && ARCH_OMAP24XX
  22 +
  23 +config MACH_OMAP_APOLLON
  24 + bool "OMAP 2420 Apollon board"
  25 + depends on ARCH_OMAP2 && ARCH_OMAP24XX
arch/arm/mach-omap2/board-apollon.c
  1 +/*
  2 + * linux/arch/arm/mach-omap/omap2/board-apollon.c
  3 + *
  4 + * Copyright (C) 2005,2006 Samsung Electronics
  5 + * Author: Kyungmin Park <kyungmin.park@samsung.com>
  6 + *
  7 + * Modified from mach-omap/omap2/board-h4.c
  8 + *
  9 + * Code for apollon OMAP2 board. Should work on many OMAP2 systems where
  10 + * the bootloader passes the board-specific data to the kernel.
  11 + * Do not put any board specific code to this file; create a new machine
  12 + * type if you need custom low-level initializations.
  13 + *
  14 + * This program is free software; you can redistribute it and/or modify
  15 + * it under the terms of the GNU General Public License version 2 as
  16 + * published by the Free Software Foundation.
  17 + */
  18 +
  19 +#include <linux/kernel.h>
  20 +#include <linux/init.h>
  21 +#include <linux/platform_device.h>
  22 +#include <linux/mtd/mtd.h>
  23 +#include <linux/mtd/partitions.h>
  24 +#include <linux/mtd/onenand.h>
  25 +#include <linux/interrupt.h>
  26 +#include <linux/delay.h>
  27 +
  28 +#include <asm/hardware.h>
  29 +#include <asm/mach-types.h>
  30 +#include <asm/mach/arch.h>
  31 +#include <asm/mach/flash.h>
  32 +
  33 +#include <asm/arch/gpio.h>
  34 +#include <asm/arch/mux.h>
  35 +#include <asm/arch/usb.h>
  36 +#include <asm/arch/board.h>
  37 +#include <asm/arch/common.h>
  38 +#include "prcm-regs.h"
  39 +
  40 +/* LED & Switch macros */
  41 +#define LED0_GPIO13 13
  42 +#define LED1_GPIO14 14
  43 +#define LED2_GPIO15 15
  44 +#define SW_ENTER_GPIO16 16
  45 +#define SW_UP_GPIO17 17
  46 +#define SW_DOWN_GPIO58 58
  47 +
  48 +static struct mtd_partition apollon_partitions[] = {
  49 + {
  50 + .name = "X-Loader + U-Boot",
  51 + .offset = 0,
  52 + .size = SZ_128K,
  53 + .mask_flags = MTD_WRITEABLE,
  54 + },
  55 + {
  56 + .name = "params",
  57 + .offset = MTDPART_OFS_APPEND,
  58 + .size = SZ_128K,
  59 + },
  60 + {
  61 + .name = "kernel",
  62 + .offset = MTDPART_OFS_APPEND,
  63 + .size = SZ_2M,
  64 + },
  65 + {
  66 + .name = "rootfs",
  67 + .offset = MTDPART_OFS_APPEND,
  68 + .size = SZ_16M,
  69 + },
  70 + {
  71 + .name = "filesystem00",
  72 + .offset = MTDPART_OFS_APPEND,
  73 + .size = SZ_32M,
  74 + },
  75 + {
  76 + .name = "filesystem01",
  77 + .offset = MTDPART_OFS_APPEND,
  78 + .size = MTDPART_SIZ_FULL,
  79 + },
  80 +};
  81 +
  82 +static struct flash_platform_data apollon_flash_data = {
  83 + .parts = apollon_partitions,
  84 + .nr_parts = ARRAY_SIZE(apollon_partitions),
  85 +};
  86 +
  87 +static struct resource apollon_flash_resource = {
  88 + .start = APOLLON_CS0_BASE,
  89 + .end = APOLLON_CS0_BASE + SZ_128K,
  90 + .flags = IORESOURCE_MEM,
  91 +};
  92 +
  93 +static struct platform_device apollon_onenand_device = {
  94 + .name = "onenand",
  95 + .id = -1,
  96 + .dev = {
  97 + .platform_data = &apollon_flash_data,
  98 + },
  99 + .num_resources = ARRAY_SIZE(&apollon_flash_resource),
  100 + .resource = &apollon_flash_resource,
  101 +};
  102 +
  103 +static struct resource apollon_smc91x_resources[] = {
  104 + [0] = {
  105 + .start = APOLLON_ETHR_START, /* Physical */
  106 + .end = APOLLON_ETHR_START + 0xf,
  107 + .flags = IORESOURCE_MEM,
  108 + },
  109 + [1] = {
  110 + .start = OMAP_GPIO_IRQ(APOLLON_ETHR_GPIO_IRQ),
  111 + .end = OMAP_GPIO_IRQ(APOLLON_ETHR_GPIO_IRQ),
  112 + .flags = IORESOURCE_IRQ,
  113 + },
  114 +};
  115 +
  116 +static struct platform_device apollon_smc91x_device = {
  117 + .name = "smc91x",
  118 + .id = -1,
  119 + .num_resources = ARRAY_SIZE(apollon_smc91x_resources),
  120 + .resource = apollon_smc91x_resources,
  121 +};
  122 +
  123 +static struct platform_device apollon_lcd_device = {
  124 + .name = "apollon_lcd",
  125 + .id = -1,
  126 +};
  127 +
  128 +static struct platform_device *apollon_devices[] __initdata = {
  129 + &apollon_onenand_device,
  130 + &apollon_smc91x_device,
  131 + &apollon_lcd_device,
  132 +};
  133 +
  134 +static inline void __init apollon_init_smc91x(void)
  135 +{
  136 + /* Make sure CS1 timings are correct */
  137 + GPMC_CONFIG1_1 = 0x00011203;
  138 + GPMC_CONFIG2_1 = 0x001f1f01;
  139 + GPMC_CONFIG3_1 = 0x00080803;
  140 + GPMC_CONFIG4_1 = 0x1c091c09;
  141 + GPMC_CONFIG5_1 = 0x041f1f1f;
  142 + GPMC_CONFIG6_1 = 0x000004c4;
  143 + GPMC_CONFIG7_1 = 0x00000f40 | (APOLLON_CS1_BASE >> 24);
  144 + udelay(100);
  145 +
  146 + omap_cfg_reg(W4__24XX_GPIO74);
  147 + if (omap_request_gpio(APOLLON_ETHR_GPIO_IRQ) < 0) {
  148 + printk(KERN_ERR "Failed to request GPIO%d for smc91x IRQ\n",
  149 + APOLLON_ETHR_GPIO_IRQ);
  150 + return;
  151 + }
  152 + omap_set_gpio_direction(APOLLON_ETHR_GPIO_IRQ, 1);
  153 +}
  154 +
  155 +static void __init omap_apollon_init_irq(void)
  156 +{
  157 + omap2_init_common_hw();
  158 + omap_init_irq();
  159 + omap_gpio_init();
  160 + apollon_init_smc91x();
  161 +}
  162 +
  163 +static struct omap_uart_config apollon_uart_config __initdata = {
  164 + .enabled_uarts = (1 << 0) | (0 << 1) | (0 << 2),
  165 +};
  166 +
  167 +static struct omap_mmc_config apollon_mmc_config __initdata = {
  168 + .mmc [0] = {
  169 + .enabled = 0,
  170 + .wire4 = 0,
  171 + .wp_pin = -1,
  172 + .power_pin = -1,
  173 + .switch_pin = -1,
  174 + },
  175 +};
  176 +
  177 +static struct omap_lcd_config apollon_lcd_config __initdata = {
  178 + .ctrl_name = "internal",
  179 +};
  180 +
  181 +static struct omap_board_config_kernel apollon_config[] = {
  182 + { OMAP_TAG_UART, &apollon_uart_config },
  183 + { OMAP_TAG_MMC, &apollon_mmc_config },
  184 + { OMAP_TAG_LCD, &apollon_lcd_config },
  185 +};
  186 +
  187 +static void __init apollon_led_init(void)
  188 +{
  189 + /* LED0 - AA10 */
  190 + omap_cfg_reg(AA10_242X_GPIO13);
  191 + omap_request_gpio(LED0_GPIO13);
  192 + omap_set_gpio_direction(LED0_GPIO13, 0);
  193 + omap_set_gpio_dataout(LED0_GPIO13, 0);
  194 + /* LED1 - AA6 */
  195 + omap_cfg_reg(AA6_242X_GPIO14);
  196 + omap_request_gpio(LED1_GPIO14);
  197 + omap_set_gpio_direction(LED1_GPIO14, 0);
  198 + omap_set_gpio_dataout(LED1_GPIO14, 0);
  199 + /* LED2 - AA4 */
  200 + omap_cfg_reg(AA4_242X_GPIO15);
  201 + omap_request_gpio(LED2_GPIO15);
  202 + omap_set_gpio_direction(LED2_GPIO15, 0);
  203 + omap_set_gpio_dataout(LED2_GPIO15, 0);
  204 +}
  205 +
  206 +static irqreturn_t apollon_sw_interrupt(int irq, void *ignored, struct pt_regs *regs)
  207 +{
  208 + static unsigned int led0, led1, led2;
  209 +
  210 + if (irq == OMAP_GPIO_IRQ(SW_ENTER_GPIO16))
  211 + omap_set_gpio_dataout(LED0_GPIO13, led0 ^= 1);
  212 + else if (irq == OMAP_GPIO_IRQ(SW_UP_GPIO17))
  213 + omap_set_gpio_dataout(LED1_GPIO14, led1 ^= 1);
  214 + else if (irq == OMAP_GPIO_IRQ(SW_DOWN_GPIO58))
  215 + omap_set_gpio_dataout(LED2_GPIO15, led2 ^= 1);
  216 +
  217 + return IRQ_HANDLED;
  218 +}
  219 +
  220 +static void __init apollon_sw_init(void)
  221 +{
  222 + /* Enter SW - Y11 */
  223 + omap_cfg_reg(Y11_242X_GPIO16);
  224 + omap_request_gpio(SW_ENTER_GPIO16);
  225 + omap_set_gpio_direction(SW_ENTER_GPIO16, 1);
  226 + /* Up SW - AA12 */
  227 + omap_cfg_reg(AA12_242X_GPIO17);
  228 + omap_request_gpio(SW_UP_GPIO17);
  229 + omap_set_gpio_direction(SW_UP_GPIO17, 1);
  230 + /* Down SW - AA8 */
  231 + omap_cfg_reg(AA8_242X_GPIO58);
  232 + omap_request_gpio(SW_DOWN_GPIO58);
  233 + omap_set_gpio_direction(SW_DOWN_GPIO58, 1);
  234 +
  235 + set_irq_type(OMAP_GPIO_IRQ(SW_ENTER_GPIO16), IRQT_RISING);
  236 + if (request_irq(OMAP_GPIO_IRQ(SW_ENTER_GPIO16), &apollon_sw_interrupt,
  237 + SA_SHIRQ, "enter sw",
  238 + &apollon_sw_interrupt))
  239 + return;
  240 + set_irq_type(OMAP_GPIO_IRQ(SW_UP_GPIO17), IRQT_RISING);
  241 + if (request_irq(OMAP_GPIO_IRQ(SW_UP_GPIO17), &apollon_sw_interrupt,
  242 + SA_SHIRQ, "up sw",
  243 + &apollon_sw_interrupt))
  244 + return;
  245 + set_irq_type(OMAP_GPIO_IRQ(SW_DOWN_GPIO58), IRQT_RISING);
  246 + if (request_irq(OMAP_GPIO_IRQ(SW_DOWN_GPIO58), &apollon_sw_interrupt,
  247 + SA_SHIRQ, "down sw",
  248 + &apollon_sw_interrupt))
  249 + return;
  250 +}
  251 +
  252 +static void __init omap_apollon_init(void)
  253 +{
  254 + apollon_led_init();
  255 + apollon_sw_init();
  256 +
  257 + /* REVISIT: where's the correct place */
  258 + omap_cfg_reg(W19_24XX_SYS_NIRQ);
  259 +
  260 + /*
  261 + * Make sure the serial ports are muxed on at this point.
  262 + * You have to mux them off in device drivers later on
  263 + * if not needed.
  264 + */
  265 + platform_add_devices(apollon_devices, ARRAY_SIZE(apollon_devices));
  266 + omap_board_config = apollon_config;
  267 + omap_board_config_size = ARRAY_SIZE(apollon_config);
  268 + omap_serial_init();
  269 +}
  270 +
  271 +static void __init omap_apollon_map_io(void)
  272 +{
  273 + omap2_map_common_io();
  274 +}
  275 +
  276 +MACHINE_START(OMAP_APOLLON, "OMAP24xx Apollon")
  277 + /* Maintainer: Kyungmin Park <kyungmin.park@samsung.com> */
  278 + .phys_io = 0x48000000,
  279 + .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc,
  280 + .boot_params = 0x80000100,
  281 + .map_io = omap_apollon_map_io,
  282 + .init_irq = omap_apollon_init_irq,
  283 + .init_machine = omap_apollon_init,
  284 + .timer = &omap_timer,
  285 +MACHINE_END
arch/arm/mach-omap2/board-h4.c
... ... @@ -17,6 +17,8 @@
17 17 #include <linux/mtd/mtd.h>
18 18 #include <linux/mtd/partitions.h>
19 19 #include <linux/delay.h>
  20 +#include <linux/workqueue.h>
  21 +#include <linux/input.h>
20 22  
21 23 #include <asm/hardware.h>
22 24 #include <asm/mach-types.h>
23 25  
24 26  
25 27  
... ... @@ -25,15 +27,57 @@
25 27 #include <asm/mach/flash.h>
26 28  
27 29 #include <asm/arch/gpio.h>
  30 +#include <asm/arch/gpioexpander.h>
28 31 #include <asm/arch/mux.h>
29 32 #include <asm/arch/usb.h>
  33 +#include <asm/arch/irda.h>
30 34 #include <asm/arch/board.h>
31 35 #include <asm/arch/common.h>
32   -#include <asm/arch/prcm.h>
  36 +#include <asm/arch/keypad.h>
  37 +#include <asm/arch/menelaus.h>
  38 +#include <asm/arch/dma.h>
  39 +#include "prcm-regs.h"
33 40  
34 41 #include <asm/io.h>
35 42 #include <asm/delay.h>
36 43  
  44 +static unsigned int row_gpios[6] = { 88, 89, 124, 11, 6, 96 };
  45 +static unsigned int col_gpios[7] = { 90, 91, 100, 36, 12, 97, 98 };
  46 +
  47 +static int h4_keymap[] = {
  48 + KEY(0, 0, KEY_LEFT),
  49 + KEY(0, 1, KEY_RIGHT),
  50 + KEY(0, 2, KEY_A),
  51 + KEY(0, 3, KEY_B),
  52 + KEY(0, 4, KEY_C),
  53 + KEY(1, 0, KEY_DOWN),
  54 + KEY(1, 1, KEY_UP),
  55 + KEY(1, 2, KEY_E),
  56 + KEY(1, 3, KEY_F),
  57 + KEY(1, 4, KEY_G),
  58 + KEY(2, 0, KEY_ENTER),
  59 + KEY(2, 1, KEY_I),
  60 + KEY(2, 2, KEY_J),
  61 + KEY(2, 3, KEY_K),
  62 + KEY(2, 4, KEY_3),
  63 + KEY(3, 0, KEY_M),
  64 + KEY(3, 1, KEY_N),
  65 + KEY(3, 2, KEY_O),
  66 + KEY(3, 3, KEY_P),
  67 + KEY(3, 4, KEY_Q),
  68 + KEY(4, 0, KEY_R),
  69 + KEY(4, 1, KEY_4),
  70 + KEY(4, 2, KEY_T),
  71 + KEY(4, 3, KEY_U),
  72 + KEY(4, 4, KEY_ENTER),
  73 + KEY(5, 0, KEY_V),
  74 + KEY(5, 1, KEY_W),
  75 + KEY(5, 2, KEY_L),
  76 + KEY(5, 3, KEY_S),
  77 + KEY(5, 4, KEY_ENTER),
  78 + 0
  79 +};
  80 +
37 81 static struct mtd_partition h4_partitions[] = {
38 82 /* bootloader (U-Boot, etc) in first sector */
39 83 {
40 84  
... ... @@ -108,9 +152,123 @@
108 152 .resource = h4_smc91x_resources,
109 153 };
110 154  
  155 +/* Select between the IrDA and aGPS module
  156 + */
  157 +static int h4_select_irda(struct device *dev, int state)
  158 +{
  159 + unsigned char expa;
  160 + int err = 0;
  161 +
  162 + if ((err = read_gpio_expa(&expa, 0x21))) {
  163 + printk(KERN_ERR "Error reading from I/O expander\n");
  164 + return err;
  165 + }
  166 +
  167 + /* 'P6' enable/disable IRDA_TX and IRDA_RX */
  168 + if (state & IR_SEL) { /* IrDa */
  169 + if ((err = write_gpio_expa(expa | 0x01, 0x21))) {
  170 + printk(KERN_ERR "Error writing to I/O expander\n");
  171 + return err;
  172 + }
  173 + } else {
  174 + if ((err = write_gpio_expa(expa & ~0x01, 0x21))) {
  175 + printk(KERN_ERR "Error writing to I/O expander\n");
  176 + return err;
  177 + }
  178 + }
  179 + return err;
  180 +}
  181 +
  182 +static void set_trans_mode(void *data)
  183 +{
  184 + int *mode = data;
  185 + unsigned char expa;
  186 + int err = 0;
  187 +
  188 + if ((err = read_gpio_expa(&expa, 0x20)) != 0) {
  189 + printk(KERN_ERR "Error reading from I/O expander\n");
  190 + }
  191 +
  192 + expa &= ~0x01;
  193 +
  194 + if (!(*mode & IR_SIRMODE)) { /* MIR/FIR */
  195 + expa |= 0x01;
  196 + }
  197 +
  198 + if ((err = write_gpio_expa(expa, 0x20)) != 0) {
  199 + printk(KERN_ERR "Error writing to I/O expander\n");
  200 + }
  201 +}
  202 +
  203 +static int h4_transceiver_mode(struct device *dev, int mode)
  204 +{
  205 + struct omap_irda_config *irda_config = dev->platform_data;
  206 +
  207 + cancel_delayed_work(&irda_config->gpio_expa);
  208 + PREPARE_WORK(&irda_config->gpio_expa, set_trans_mode, &mode);
  209 + schedule_work(&irda_config->gpio_expa);
  210 +
  211 + return 0;
  212 +}
  213 +
  214 +static struct omap_irda_config h4_irda_data = {
  215 + .transceiver_cap = IR_SIRMODE | IR_MIRMODE | IR_FIRMODE,
  216 + .transceiver_mode = h4_transceiver_mode,
  217 + .select_irda = h4_select_irda,
  218 + .rx_channel = OMAP24XX_DMA_UART3_RX,
  219 + .tx_channel = OMAP24XX_DMA_UART3_TX,
  220 + .dest_start = OMAP_UART3_BASE,
  221 + .src_start = OMAP_UART3_BASE,
  222 + .tx_trigger = OMAP24XX_DMA_UART3_TX,
  223 + .rx_trigger = OMAP24XX_DMA_UART3_RX,
  224 +};
  225 +
  226 +static struct resource h4_irda_resources[] = {
  227 + [0] = {
  228 + .start = INT_24XX_UART3_IRQ,
  229 + .end = INT_24XX_UART3_IRQ,
  230 + .flags = IORESOURCE_IRQ,
  231 + },
  232 +};
  233 +
  234 +static struct platform_device h4_irda_device = {
  235 + .name = "omapirda",
  236 + .id = -1,
  237 + .dev = {
  238 + .platform_data = &h4_irda_data,
  239 + },
  240 + .num_resources = 1,
  241 + .resource = h4_irda_resources,
  242 +};
  243 +
  244 +static struct omap_kp_platform_data h4_kp_data = {
  245 + .rows = 6,
  246 + .cols = 7,
  247 + .keymap = h4_keymap,
  248 + .rep = 1,
  249 + .row_gpios = row_gpios,
  250 + .col_gpios = col_gpios,
  251 +};
  252 +
  253 +static struct platform_device h4_kp_device = {
  254 + .name = "omap-keypad",
  255 + .id = -1,
  256 + .dev = {
  257 + .platform_data = &h4_kp_data,
  258 + },
  259 +};
  260 +
  261 +static struct platform_device h4_lcd_device = {
  262 + .name = "lcd_h4",
  263 + .id = -1,
  264 +};
  265 +
111 266 static struct platform_device *h4_devices[] __initdata = {
112 267 &h4_smc91x_device,
113 268 &h4_flash_device,
  269 + &h4_irda_device,
  270 + &h4_kp_device,
  271 + &h4_lcd_device,
114 272 };
115 273  
116 274 static inline void __init h4_init_smc91x(void)
... ... @@ -157,7 +315,6 @@
157 315 };
158 316  
159 317 static struct omap_lcd_config h4_lcd_config __initdata = {
160   - .panel_name = "h4",
161 318 .ctrl_name = "internal",
162 319 };
163 320  
... ... @@ -174,6 +331,19 @@
174 331 * You have to mux them off in device drivers later on
175 332 * if not needed.
176 333 */
  334 +#if defined(CONFIG_OMAP_IR) || defined(CONFIG_OMAP_IR_MODULE)
  335 + omap_cfg_reg(K15_24XX_UART3_TX);
  336 + omap_cfg_reg(K14_24XX_UART3_RX);
  337 +#endif
  338 +
  339 +#if defined(CONFIG_KEYBOARD_OMAP) || defined(CONFIG_KEYBOARD_OMAP_MODULE)
  340 + if (omap_has_menelaus()) {
  341 + row_gpios[5] = 0;
  342 + col_gpios[2] = 15;
  343 + col_gpios[6] = 18;
  344 + }
  345 +#endif
  346 +
177 347 platform_add_devices(h4_devices, ARRAY_SIZE(h4_devices));
178 348 omap_board_config = h4_config;
179 349 omap_board_config_size = ARRAY_SIZE(h4_config);
arch/arm/mach-omap2/devices.c
... ... @@ -74,6 +74,47 @@
74 74  
75 75 #endif
76 76  
  77 +#if defined(CONFIG_OMAP_STI)
  78 +
  79 +#define OMAP2_STI_BASE IO_ADDRESS(0x48068000)
  80 +#define OMAP2_STI_CHANNEL_BASE 0x54000000
  81 +#define OMAP2_STI_IRQ 4
  82 +
  83 +static struct resource sti_resources[] = {
  84 + {
  85 + .start = OMAP2_STI_BASE,
  86 + .end = OMAP2_STI_BASE + 0x7ff,
  87 + .flags = IORESOURCE_MEM,
  88 + },
  89 + {
  90 + .start = OMAP2_STI_CHANNEL_BASE,
  91 + .end = OMAP2_STI_CHANNEL_BASE + SZ_64K - 1,
  92 + .flags = IORESOURCE_MEM,
  93 + },
  94 + {
  95 + .start = OMAP2_STI_IRQ,
  96 + .flags = IORESOURCE_IRQ,
  97 + }
  98 +};
  99 +
  100 +static struct platform_device sti_device = {
  101 + .name = "sti",
  102 + .id = -1,
  103 + .dev = {
  104 + .release = omap_nop_release,
  105 + },
  106 + .num_resources = ARRAY_SIZE(sti_resources),
  107 + .resource = sti_resources,
  108 +};
  109 +
  110 +static inline void omap_init_sti(void)
  111 +{
  112 + platform_device_register(&sti_device);
  113 +}
  114 +#else
  115 +static inline void omap_init_sti(void) {}
  116 +#endif
  117 +
77 118 /*-------------------------------------------------------------------------*/
78 119  
79 120 static int __init omap2_init_devices(void)
... ... @@ -82,6 +123,7 @@
82 123 * in alphabetical order so they're easier to sort through.
83 124 */
84 125 omap_init_i2c();
  126 + omap_init_sti();
85 127  
86 128 return 0;
87 129 }
arch/arm/plat-omap/devices.c
... ... @@ -24,6 +24,7 @@
24 24 #include <asm/arch/board.h>
25 25 #include <asm/arch/mux.h>
26 26 #include <asm/arch/gpio.h>
  27 +#include <asm/arch/menelaus.h>
27 28  
28 29  
29 30 void omap_nop_release(struct device *dev)
30 31  
... ... @@ -98,7 +99,63 @@
98 99 #endif
99 100  
100 101 /*-------------------------------------------------------------------------*/
  102 +#if defined(CONFIG_KEYBOARD_OMAP) || defined(CONFIG_KEYBOARD_OMAP_MODULE)
101 103  
  104 +static void omap_init_kp(void)
  105 +{
  106 + if (machine_is_omap_h2() || machine_is_omap_h3()) {
  107 + omap_cfg_reg(F18_1610_KBC0);
  108 + omap_cfg_reg(D20_1610_KBC1);
  109 + omap_cfg_reg(D19_1610_KBC2);
  110 + omap_cfg_reg(E18_1610_KBC3);
  111 + omap_cfg_reg(C21_1610_KBC4);
  112 +
  113 + omap_cfg_reg(G18_1610_KBR0);
  114 + omap_cfg_reg(F19_1610_KBR1);
  115 + omap_cfg_reg(H14_1610_KBR2);
  116 + omap_cfg_reg(E20_1610_KBR3);
  117 + omap_cfg_reg(E19_1610_KBR4);
  118 + omap_cfg_reg(N19_1610_KBR5);
  119 + } else if (machine_is_omap_perseus2()) {
  120 + omap_cfg_reg(E2_730_KBR0);
  121 + omap_cfg_reg(J7_730_KBR1);
  122 + omap_cfg_reg(E1_730_KBR2);
  123 + omap_cfg_reg(F3_730_KBR3);
  124 + omap_cfg_reg(D2_730_KBR4);
  125 +
  126 + omap_cfg_reg(C2_730_KBC0);
  127 + omap_cfg_reg(D3_730_KBC1);
  128 + omap_cfg_reg(E4_730_KBC2);
  129 + omap_cfg_reg(F4_730_KBC3);
  130 + omap_cfg_reg(E3_730_KBC4);
  131 + } else if (machine_is_omap_h4()) {
  132 + omap_cfg_reg(T19_24XX_KBR0);
  133 + omap_cfg_reg(R19_24XX_KBR1);
  134 + omap_cfg_reg(V18_24XX_KBR2);
  135 + omap_cfg_reg(M21_24XX_KBR3);
  136 + omap_cfg_reg(E5__24XX_KBR4);
  137 + if (omap_has_menelaus()) {
  138 + omap_cfg_reg(B3__24XX_KBR5);
  139 + omap_cfg_reg(AA4_24XX_KBC2);
  140 + omap_cfg_reg(B13_24XX_KBC6);
  141 + } else {
  142 + omap_cfg_reg(M18_24XX_KBR5);
  143 + omap_cfg_reg(H19_24XX_KBC2);
  144 + omap_cfg_reg(N19_24XX_KBC6);
  145 + }
  146 + omap_cfg_reg(R20_24XX_KBC0);
  147 + omap_cfg_reg(M14_24XX_KBC1);
  148 + omap_cfg_reg(V17_24XX_KBC3);
  149 + omap_cfg_reg(P21_24XX_KBC4);
  150 + omap_cfg_reg(L14_24XX_KBC5);
  151 + }
  152 +}
  153 +#else
  154 +static inline void omap_init_kp(void) {}
  155 +#endif
  156 +
  157 +/*-------------------------------------------------------------------------*/
  158 +
102 159 #if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE)
103 160  
104 161 #ifdef CONFIG_ARCH_OMAP24XX
... ... @@ -240,6 +297,55 @@
240 297 static inline void omap_init_mmc(void) {}
241 298 #endif
242 299  
  300 +/*-------------------------------------------------------------------------*/
  301 +
  302 +/* Numbering for the SPI-capable controllers when used for SPI:
  303 + * spi = 1
  304 + * uwire = 2
  305 + * mmc1..2 = 3..4
  306 + * mcbsp1..3 = 5..7
  307 + */
  308 +
  309 +#if defined(CONFIG_SPI_OMAP_UWIRE) || defined(CONFIG_SPI_OMAP_UWIRE_MODULE)
  310 +
  311 +#define OMAP_UWIRE_BASE 0xfffb3000
  312 +
  313 +static struct resource uwire_resources[] = {
  314 + {
  315 + .start = OMAP_UWIRE_BASE,
  316 + .end = OMAP_UWIRE_BASE + 0x20,
  317 + .flags = IORESOURCE_MEM,
  318 + },
  319 +};
  320 +
  321 +static struct platform_device omap_uwire_device = {
  322 + .name = "omap_uwire",
  323 + .id = -1,
  324 + .dev = {
  325 + .release = omap_nop_release,
  326 + },
  327 + .num_resources = ARRAY_SIZE(uwire_resources),
  328 + .resource = uwire_resources,
  329 +};
  330 +
  331 +static void omap_init_uwire(void)
  332 +{
  333 + /* FIXME define and use a boot tag; not all boards will be hooking
  334 + * up devices to the microwire controller, and multi-board configs
  335 + * mean that CONFIG_SPI_OMAP_UWIRE may be configured anyway...
  336 + */
  337 +
  338 + /* board-specific code must configure chipselects (only a few
  339 + * are normally used) and SCLK/SDI/SDO (each has two choices).
  340 + */
  341 + (void) platform_device_register(&omap_uwire_device);
  342 +}
  343 +#else
  344 +static inline void omap_init_uwire(void) {}
  345 +#endif
  346 +
  347 +/*-------------------------------------------------------------------------*/
  348 +
243 349 #if defined(CONFIG_OMAP_WATCHDOG) || defined(CONFIG_OMAP_WATCHDOG_MODULE)
244 350  
245 351 #ifdef CONFIG_ARCH_OMAP24XX
... ... @@ -310,40 +416,6 @@
310 416 static inline void omap_init_rng(void) {}
311 417 #endif
312 418  
313   -#if defined(CONFIG_FB_OMAP) || defined(CONFIG_FB_OMAP_MODULE)
314   -
315   -static struct omap_lcd_config omap_fb_conf;
316   -
317   -static u64 omap_fb_dma_mask = ~(u32)0;
318   -
319   -static struct platform_device omap_fb_device = {
320   - .name = "omapfb",
321   - .id = -1,
322   - .dev = {
323   - .release = omap_nop_release,
324   - .dma_mask = &omap_fb_dma_mask,
325   - .coherent_dma_mask = ~(u32)0,
326   - .platform_data = &omap_fb_conf,
327   - },
328   - .num_resources = 0,
329   -};
330   -
331   -static inline void omap_init_fb(void)
332   -{
333   - const struct omap_lcd_config *conf;
334   -
335   - conf = omap_get_config(OMAP_TAG_LCD, struct omap_lcd_config);
336   - if (conf != NULL)
337   - omap_fb_conf = *conf;
338   - platform_device_register(&omap_fb_device);
339   -}
340   -
341   -#else
342   -
343   -static inline void omap_init_fb(void) {}
344   -
345   -#endif
346   -
347 419 /*
348 420 * This gets called after board-specific INIT_MACHINE, and initializes most
349 421 * on-chip peripherals accessible on this board (except for few like USB):
350 422  
351 423  
... ... @@ -369,9 +441,10 @@
369 441 /* please keep these calls, and their implementations above,
370 442 * in alphabetical order so they're easier to sort through.
371 443 */
372   - omap_init_fb();
373 444 omap_init_i2c();
  445 + omap_init_kp();
374 446 omap_init_mmc();
  447 + omap_init_uwire();
375 448 omap_init_wdt();
376 449 omap_init_rng();
377 450  
include/asm-arm/arch-omap/board-ams-delta.h
  1 +/*
  2 + * linux/include/asm-arm/arch-omap/board-ams-delta.h
  3 + *
  4 + * Copyright (C) 2006 Jonathan McDowell <noodles@earth.li>
  5 + *
  6 + * This program is free software; you can redistribute it and/or modify it
  7 + * under the terms of the GNU General Public License as published by the
  8 + * Free Software Foundation; either version 2 of the License, or (at your
  9 + * option) any later version.
  10 + *
  11 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  12 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  13 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
  14 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  15 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  16 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  17 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  18 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  19 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  20 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  21 + *
  22 + * You should have received a copy of the GNU General Public License along
  23 + * with this program; if not, write to the Free Software Foundation, Inc.,
  24 + * 675 Mass Ave, Cambridge, MA 02139, USA.
  25 + */
  26 +#ifndef __ASM_ARCH_OMAP_AMS_DELTA_H
  27 +#define __ASM_ARCH_OMAP_AMS_DELTA_H
  28 +
  29 +#if defined (CONFIG_MACH_AMS_DELTA)
  30 +
  31 +#define AMS_DELTA_LATCH1_PHYS 0x01000000
  32 +#define AMS_DELTA_LATCH1_VIRT 0xEA000000
  33 +#define AMS_DELTA_MODEM_PHYS 0x04000000
  34 +#define AMS_DELTA_MODEM_VIRT 0xEB000000
  35 +#define AMS_DELTA_LATCH2_PHYS 0x08000000
  36 +#define AMS_DELTA_LATCH2_VIRT 0xEC000000
  37 +
  38 +#define AMS_DELTA_LATCH1_LED_CAMERA 0x01
  39 +#define AMS_DELTA_LATCH1_LED_ADVERT 0x02
  40 +#define AMS_DELTA_LATCH1_LED_EMAIL 0x04
  41 +#define AMS_DELTA_LATCH1_LED_HANDSFREE 0x08
  42 +#define AMS_DELTA_LATCH1_LED_VOICEMAIL 0x10
  43 +#define AMS_DELTA_LATCH1_LED_VOICE 0x20
  44 +
  45 +#define AMS_DELTA_LATCH2_LCD_VBLEN 0x0001
  46 +#define AMS_DELTA_LATCH2_LCD_NDISP 0x0002
  47 +#define AMS_DELTA_LATCH2_NAND_NCE 0x0004
  48 +#define AMS_DELTA_LATCH2_NAND_NRE 0x0008
  49 +#define AMS_DELTA_LATCH2_NAND_NWP 0x0010
  50 +#define AMS_DELTA_LATCH2_NAND_NWE 0x0020
  51 +#define AMS_DELTA_LATCH2_NAND_ALE 0x0040
  52 +#define AMS_DELTA_LATCH2_NAND_CLE 0x0080
  53 +#define AMS_DELTA_LATCH2_MODEM_NRESET 0x1000
  54 +#define AMS_DELTA_LATCH2_MODEM_CODEC 0x2000
  55 +
  56 +#define AMS_DELTA_GPIO_PIN_NAND_RB 12
  57 +
  58 +#ifndef __ASSEMBLY__
  59 +void ams_delta_latch1_write(u8 mask, u8 value);
  60 +void ams_delta_latch2_write(u16 mask, u16 value);
  61 +#endif
  62 +
  63 +#endif /* CONFIG_MACH_AMS_DELTA */
  64 +
  65 +#endif /* __ASM_ARCH_OMAP_AMS_DELTA_H */
include/asm-arm/arch-omap/board-apollon.h
  1 +/*
  2 + * linux/include/asm-arm/arch-omap/board-apollon.h
  3 + *
  4 + * Hardware definitions for Samsung OMAP24XX Apollon board.
  5 + *
  6 + * Initial creation by Kyungmin Park <kyungmin.park@samsung.com>
  7 + *
  8 + * This program is free software; you can redistribute it and/or modify it
  9 + * under the terms of the GNU General Public License as published by the
  10 + * Free Software Foundation; either version 2 of the License, or (at your
  11 + * option) any later version.
  12 + *
  13 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  14 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  15 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
  16 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  17 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  18 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  19 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  20 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  21 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  22 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  23 + *
  24 + * You should have received a copy of the GNU General Public License along
  25 + * with this program; if not, write to the Free Software Foundation, Inc.,
  26 + * 675 Mass Ave, Cambridge, MA 02139, USA.
  27 + */
  28 +
  29 +#ifndef __ASM_ARCH_OMAP_APOLLON_H
  30 +#define __ASM_ARCH_OMAP_APOLLON_H
  31 +
  32 +/* Placeholder for APOLLON specific defines */
  33 +/* GPMC CS0 */
  34 +#define APOLLON_CS0_BASE 0x00000000
  35 +/* GPMC CS1 */
  36 +#define APOLLON_CS1_BASE 0x08000000
  37 +#define APOLLON_ETHR_START (APOLLON_CS1_BASE + 0x300)
  38 +#define APOLLON_ETHR_GPIO_IRQ 74
  39 +/* GPMC CS2 - reserved for OneNAND */
  40 +#define APOLLON_CS2_BASE 0x10000000
  41 +/* GPMC CS3 - reserved for NOR or NAND */
  42 +#define APOLLON_CS3_BASE 0x18000000
  43 +
  44 +#endif /* __ASM_ARCH_OMAP_APOLLON_H */
include/asm-arm/arch-omap/board-h2.h
... ... @@ -34,9 +34,5 @@
34 34 /* At OMAP1610 Innovator the Ethernet is directly connected to CS1 */
35 35 #define OMAP1610_ETHR_START 0x04000300
36 36  
37   -/* Samsung NAND flash at CS2B or CS3(NAND Boot) */
38   -#define OMAP_NAND_FLASH_START1 0x0A000000 /* CS2B */
39   -#define OMAP_NAND_FLASH_START2 0x0C000000 /* CS3 */
40   -
41 37 #endif /* __ASM_ARCH_OMAP_H2_H */
include/asm-arm/arch-omap/board-h3.h
... ... @@ -30,10 +30,6 @@
30 30 /* In OMAP1710 H3 the Ethernet is directly connected to CS1 */
31 31 #define OMAP1710_ETHR_START 0x04000300
32 32  
33   -/* Samsung NAND flash at CS2B or CS3(NAND Boot) */
34   -#define OMAP_NAND_FLASH_START1 0x0A000000 /* CS2B */
35   -#define OMAP_NAND_FLASH_START2 0x0C000000 /* CS3 */
36   -
37 33 #define MAXIRQNUM (IH_BOARD_BASE)
38 34 #define MAXFIQNUM MAXIRQNUM
39 35 #define MAXSWINUM MAXIRQNUM
include/asm-arm/arch-omap/board-h4.h
... ... @@ -33,12 +33,6 @@
33 33 /* GPMC CS1 */
34 34 #define OMAP24XX_ETHR_START 0x08000300
35 35 #define OMAP24XX_ETHR_GPIO_IRQ 92
36   -
37   -#define H4_CS0_BASE 0x04000000
38   -
39   -#define H4_CS0_BASE 0x04000000
40   -
41   -#define H4_CS0_BASE 0x04000000
42   -
  36 +#define H4_CS0_BASE 0x04000000
43 37 #endif /* __ASM_ARCH_OMAP_H4_H */
include/asm-arm/arch-omap/board-netstar.h
1   -/*
2   - * Copyright (C) 2004 2N Telekomunikace, Ladislav Michl <michl@2n.cz>
3   - *
4   - * Hardware definitions for OMAP5910 based NetStar board.
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   -
11   -#ifndef __ASM_ARCH_NETSTAR_H
12   -#define __ASM_ARCH_NETSTAR_H
13   -
14   -#include <asm/arch/tc.h>
15   -
16   -#define OMAP_NAND_FLASH_START1 OMAP_CS1_PHYS + (1 << 23)
17   -#define OMAP_NAND_FLASH_START2 OMAP_CS1_PHYS + (2 << 23)
18   -
19   -#endif /* __ASM_ARCH_NETSTAR_H */
include/asm-arm/arch-omap/board-nokia.h
  1 +/*
  2 + * linux/include/asm-arm/arch-omap/board-nokia.h
  3 + *
  4 + * Information structures for Nokia-specific board config data
  5 + *
  6 + * Copyright (C) 2005 Nokia Corporation
  7 + */
  8 +
  9 +#ifndef _OMAP_BOARD_NOKIA_H
  10 +#define _OMAP_BOARD_NOKIA_H
  11 +
  12 +#include <linux/types.h>
  13 +
  14 +#define OMAP_TAG_NOKIA_BT 0x4e01
  15 +#define OMAP_TAG_WLAN_CX3110X 0x4e02
  16 +#define OMAP_TAG_CBUS 0x4e03
  17 +#define OMAP_TAG_EM_ASIC_BB5 0x4e04
  18 +
  19 +
  20 +#define BT_CHIP_CSR 1
  21 +#define BT_CHIP_TI 2
  22 +
  23 +#define BT_SYSCLK_12 1
  24 +#define BT_SYSCLK_38_4 2
  25 +
  26 +struct omap_bluetooth_config {
  27 + u8 chip_type;
  28 + u8 bt_wakeup_gpio;
  29 + u8 host_wakeup_gpio;
  30 + u8 reset_gpio;
  31 + u8 bt_uart;
  32 + u8 bd_addr[6];
  33 + u8 bt_sysclk;
  34 +};
  35 +
  36 +struct omap_wlan_cx3110x_config {
  37 + u8 chip_type;
  38 + s16 power_gpio;
  39 + s16 irq_gpio;
  40 + s16 spi_cs_gpio;
  41 +};
  42 +
  43 +struct omap_cbus_config {
  44 + s16 clk_gpio;
  45 + s16 dat_gpio;
  46 + s16 sel_gpio;
  47 +};
  48 +
  49 +struct omap_em_asic_bb5_config {
  50 + s16 retu_irq_gpio;
  51 + s16 tahvo_irq_gpio;
  52 +};
  53 +
  54 +#endif
include/asm-arm/arch-omap/board-perseus2.h
... ... @@ -42,9 +42,5 @@
42 42  
43 43 #define NR_IRQS (MAXIRQNUM + 1)
44 44  
45   -/* Samsung NAND flash at CS2B or CS3(NAND Boot) */
46   -#define OMAP_NAND_FLASH_START1 0x0A000000 /* CS2B */
47   -#define OMAP_NAND_FLASH_START2 0x0C000000 /* CS3 */
48   -
49 45 #endif
include/asm-arm/arch-omap/board.h
... ... @@ -21,9 +21,12 @@
21 21 #define OMAP_TAG_LCD 0x4f05
22 22 #define OMAP_TAG_GPIO_SWITCH 0x4f06
23 23 #define OMAP_TAG_UART 0x4f07
  24 +#define OMAP_TAG_FBMEM 0x4f08
  25 +#define OMAP_TAG_STI_CONSOLE 0x4f09
24 26  
25 27 #define OMAP_TAG_BOOT_REASON 0x4f80
26 28 #define OMAP_TAG_FLASH_PART 0x4f81
  29 +#define OMAP_TAG_VERSION_STR 0x4f82
27 30  
28 31 struct omap_clock_config {
29 32 /* 0 for 12 MHz, 1 for 13 MHz and 2 for 19.2 MHz */
... ... @@ -54,6 +57,11 @@
54 57 u32 console_speed;
55 58 };
56 59  
  60 +struct omap_sti_console_config {
  61 + unsigned enable:1;
  62 + u8 channel;
  63 +};
  64 +
57 65 struct omap_usb_config {
58 66 /* Configure drivers according to the connectors on your board:
59 67 * - "A" connector (rectagular)
... ... @@ -87,6 +95,13 @@
87 95 char ctrl_name[16];
88 96 };
89 97  
  98 +struct omap_fbmem_config {
  99 + u32 fb_sram_start;
  100 + u32 fb_sram_size;
  101 + u32 fb_sdram_start;
  102 + u32 fb_sdram_size;
  103 +};
  104 +
90 105 /* Cover:
91 106 * high -> closed
92 107 * low -> open
... ... @@ -106,6 +121,12 @@
106 121 int key_code:24; /* Linux key code */
107 122 };
108 123  
  124 +struct omap_uart_config {
  125 + /* Bit field of UARTs present; bit 0 --> UART1 */
  126 + unsigned int enabled_uarts;
  127 +};
  128 +
  129 +
109 130 struct omap_flash_part_config {
110 131 char part_table[0];
111 132 };
112 133  
... ... @@ -114,10 +135,13 @@
114 135 char reason_str[12];
115 136 };
116 137  
117   -struct omap_uart_config {
118   - /* Bit field of UARTs present; bit 0 --> UART1 */
119   - unsigned int enabled_uarts;
  138 +struct omap_version_config {
  139 + char component[12];
  140 + char version[12];
120 141 };
  142 +
  143 +
  144 +#include <asm-arm/arch-omap/board-nokia.h>
121 145  
122 146 struct omap_board_config_entry {
123 147 u16 tag;
include/asm-arm/arch-omap/hardware.h
... ... @@ -306,16 +306,16 @@
306 306 #include "board-h4.h"
307 307 #endif
308 308  
  309 +#ifdef CONFIG_MACH_OMAP_APOLLON
  310 +#include "board-apollon.h"
  311 +#endif
  312 +
309 313 #ifdef CONFIG_MACH_OMAP_OSK
310 314 #include "board-osk.h"
311 315 #endif
312 316  
313 317 #ifdef CONFIG_MACH_VOICEBLUE
314 318 #include "board-voiceblue.h"
315   -#endif
316   -
317   -#ifdef CONFIG_MACH_NETSTAR
318   -#include "board-netstar.h"
319 319 #endif
320 320  
321 321 #endif /* !__ASSEMBLER__ */