aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2010-08-02 07:23:38 -0400
committerTony Lindgren <tony@atomide.com>2010-08-02 07:23:38 -0400
commit055a1b8c9927bc587f293020a54c6cd8e24dfac0 (patch)
treedb7c8d00931180c4896c9e00d2cb506939592cda /arch/arm/mach-omap2
parent8a6f7e14fc3b3ea911838c3f4ce137cb8a3d134a (diff)
parentf535daed925c2d3c1db06b06a63c4955f2c51988 (diff)
Merge branch 'devel-misc' into omap-for-linus
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r--arch/arm/mach-omap2/board-2430sdp.c6
-rw-r--r--arch/arm/mach-omap2/board-devkit8000.c14
-rw-r--r--arch/arm/mach-omap2/board-overo.c42
-rw-r--r--arch/arm/mach-omap2/board-rx51-peripherals.c17
-rw-r--r--arch/arm/mach-omap2/id.c36
-rw-r--r--arch/arm/mach-omap2/include/mach/id.h22
-rw-r--r--arch/arm/mach-omap2/pm34xx.c7
7 files changed, 118 insertions, 26 deletions
diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c
index 71bf5097e102..ba188cf7d09d 100644
--- a/arch/arm/mach-omap2/board-2430sdp.c
+++ b/arch/arm/mach-omap2/board-2430sdp.c
@@ -122,11 +122,7 @@ static struct omap_smc91x_platform_data board_smc91x_data = {
122 122
123static void __init board_smc91x_init(void) 123static void __init board_smc91x_init(void)
124{ 124{
125 if (omap_rev() > OMAP3430_REV_ES1_0) 125 omap_mux_init_gpio(149, OMAP_PIN_INPUT);
126 board_smc91x_data.gpio_irq = 6;
127 else
128 board_smc91x_data.gpio_irq = 29;
129
130 gpmc_smc91x_init(&board_smc91x_data); 126 gpmc_smc91x_init(&board_smc91x_data);
131} 127}
132 128
diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c
index ca4d521947ac..f8303f7bbe76 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -33,6 +33,7 @@
33#include <linux/i2c/twl.h> 33#include <linux/i2c/twl.h>
34 34
35#include <mach/hardware.h> 35#include <mach/hardware.h>
36#include <mach/id.h>
36#include <asm/mach-types.h> 37#include <asm/mach-types.h>
37#include <asm/mach/arch.h> 38#include <asm/mach/arch.h>
38#include <asm/mach/map.h> 39#include <asm/mach/map.h>
@@ -556,6 +557,9 @@ static struct platform_device omap_dm9000_dev = {
556 557
557static void __init omap_dm9000_init(void) 558static void __init omap_dm9000_init(void)
558{ 559{
560 unsigned char *eth_addr = omap_dm9000_platdata.dev_addr;
561 struct omap_die_id odi;
562
559 if (gpio_request(OMAP_DM9000_GPIO_IRQ, "dm9000 irq") < 0) { 563 if (gpio_request(OMAP_DM9000_GPIO_IRQ, "dm9000 irq") < 0) {
560 printk(KERN_ERR "Failed to request GPIO%d for dm9000 IRQ\n", 564 printk(KERN_ERR "Failed to request GPIO%d for dm9000 IRQ\n",
561 OMAP_DM9000_GPIO_IRQ); 565 OMAP_DM9000_GPIO_IRQ);
@@ -563,6 +567,16 @@ static void __init omap_dm9000_init(void)
563 } 567 }
564 568
565 gpio_direction_input(OMAP_DM9000_GPIO_IRQ); 569 gpio_direction_input(OMAP_DM9000_GPIO_IRQ);
570
571 /* init the mac address using DIE id */
572 omap_get_die_id(&odi);
573
574 eth_addr[0] = 0x02; /* locally administered */
575 eth_addr[1] = odi.id_1 & 0xff;
576 eth_addr[2] = (odi.id_0 & 0xff000000) >> 24;
577 eth_addr[3] = (odi.id_0 & 0x00ff0000) >> 16;
578 eth_addr[4] = (odi.id_0 & 0x0000ff00) >> 8;
579 eth_addr[5] = (odi.id_0 & 0x000000ff);
566} 580}
567 581
568static struct platform_device *devkit8000_devices[] __initdata = { 582static struct platform_device *devkit8000_devices[] __initdata = {
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index 79ac41400c21..4ceeb56c414c 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -166,9 +166,26 @@ static struct platform_device overo_smsc911x_device = {
166 }, 166 },
167}; 167};
168 168
169static struct platform_device overo_smsc911x2_device = {
170 .name = "smsc911x",
171 .id = 1,
172 .num_resources = ARRAY_SIZE(overo_smsc911x2_resources),
173 .resource = overo_smsc911x2_resources,
174 .dev = {
175 .platform_data = &overo_smsc911x_config,
176 },
177};
178
179static struct platform_device *smsc911x_devices[] = {
180 &overo_smsc911x_device,
181 &overo_smsc911x2_device,
182};
183
169static inline void __init overo_init_smsc911x(void) 184static inline void __init overo_init_smsc911x(void)
170{ 185{
171 unsigned long cs_mem_base; 186 unsigned long cs_mem_base, cs_mem_base2;
187
188 /* set up first smsc911x chip */
172 189
173 if (gpmc_cs_request(OVERO_SMSC911X_CS, SZ_16M, &cs_mem_base) < 0) { 190 if (gpmc_cs_request(OVERO_SMSC911X_CS, SZ_16M, &cs_mem_base) < 0) {
174 printk(KERN_ERR "Failed request for GPMC mem for smsc911x\n"); 191 printk(KERN_ERR "Failed request for GPMC mem for smsc911x\n");
@@ -189,7 +206,28 @@ static inline void __init overo_init_smsc911x(void)
189 overo_smsc911x_resources[1].start = OMAP_GPIO_IRQ(OVERO_SMSC911X_GPIO); 206 overo_smsc911x_resources[1].start = OMAP_GPIO_IRQ(OVERO_SMSC911X_GPIO);
190 overo_smsc911x_resources[1].end = 0; 207 overo_smsc911x_resources[1].end = 0;
191 208
192 platform_device_register(&overo_smsc911x_device); 209 /* set up second smsc911x chip */
210
211 if (gpmc_cs_request(OVERO_SMSC911X2_CS, SZ_16M, &cs_mem_base2) < 0) {
212 printk(KERN_ERR "Failed request for GPMC mem for smsc911x2\n");
213 return;
214 }
215
216 overo_smsc911x2_resources[0].start = cs_mem_base2 + 0x0;
217 overo_smsc911x2_resources[0].end = cs_mem_base2 + 0xff;
218
219 if ((gpio_request(OVERO_SMSC911X2_GPIO, "SMSC911X2 IRQ") == 0) &&
220 (gpio_direction_input(OVERO_SMSC911X2_GPIO) == 0)) {
221 gpio_export(OVERO_SMSC911X2_GPIO, 0);
222 } else {
223 printk(KERN_ERR "could not obtain gpio for SMSC911X2 IRQ\n");
224 return;
225 }
226
227 overo_smsc911x2_resources[1].start = OMAP_GPIO_IRQ(OVERO_SMSC911X2_GPIO);
228 overo_smsc911x2_resources[1].end = 0;
229
230 platform_add_devices(smsc911x_devices, ARRAY_SIZE(smsc911x_devices));
193} 231}
194 232
195#else 233#else
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c
index a3a396ca2d32..9a5eb87425fc 100644
--- a/arch/arm/mach-omap2/board-rx51-peripherals.c
+++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
@@ -185,6 +185,10 @@ static void __init rx51_add_gpio_keys(void)
185#endif /* CONFIG_KEYBOARD_GPIO || CONFIG_KEYBOARD_GPIO_MODULE */ 185#endif /* CONFIG_KEYBOARD_GPIO || CONFIG_KEYBOARD_GPIO_MODULE */
186 186
187static int board_keymap[] = { 187static int board_keymap[] = {
188 /*
189 * Note that KEY(x, 8, KEY_XXX) entries represent "entrire row
190 * connected to the ground" matrix state.
191 */
188 KEY(0, 0, KEY_Q), 192 KEY(0, 0, KEY_Q),
189 KEY(0, 1, KEY_O), 193 KEY(0, 1, KEY_O),
190 KEY(0, 2, KEY_P), 194 KEY(0, 2, KEY_P),
@@ -192,6 +196,7 @@ static int board_keymap[] = {
192 KEY(0, 4, KEY_BACKSPACE), 196 KEY(0, 4, KEY_BACKSPACE),
193 KEY(0, 6, KEY_A), 197 KEY(0, 6, KEY_A),
194 KEY(0, 7, KEY_S), 198 KEY(0, 7, KEY_S),
199
195 KEY(1, 0, KEY_W), 200 KEY(1, 0, KEY_W),
196 KEY(1, 1, KEY_D), 201 KEY(1, 1, KEY_D),
197 KEY(1, 2, KEY_F), 202 KEY(1, 2, KEY_F),
@@ -200,6 +205,7 @@ static int board_keymap[] = {
200 KEY(1, 5, KEY_J), 205 KEY(1, 5, KEY_J),
201 KEY(1, 6, KEY_K), 206 KEY(1, 6, KEY_K),
202 KEY(1, 7, KEY_L), 207 KEY(1, 7, KEY_L),
208
203 KEY(2, 0, KEY_E), 209 KEY(2, 0, KEY_E),
204 KEY(2, 1, KEY_DOT), 210 KEY(2, 1, KEY_DOT),
205 KEY(2, 2, KEY_UP), 211 KEY(2, 2, KEY_UP),
@@ -207,6 +213,8 @@ static int board_keymap[] = {
207 KEY(2, 5, KEY_Z), 213 KEY(2, 5, KEY_Z),
208 KEY(2, 6, KEY_X), 214 KEY(2, 6, KEY_X),
209 KEY(2, 7, KEY_C), 215 KEY(2, 7, KEY_C),
216 KEY(2, 8, KEY_F9),
217
210 KEY(3, 0, KEY_R), 218 KEY(3, 0, KEY_R),
211 KEY(3, 1, KEY_V), 219 KEY(3, 1, KEY_V),
212 KEY(3, 2, KEY_B), 220 KEY(3, 2, KEY_B),
@@ -215,20 +223,23 @@ static int board_keymap[] = {
215 KEY(3, 5, KEY_SPACE), 223 KEY(3, 5, KEY_SPACE),
216 KEY(3, 6, KEY_SPACE), 224 KEY(3, 6, KEY_SPACE),
217 KEY(3, 7, KEY_LEFT), 225 KEY(3, 7, KEY_LEFT),
226
218 KEY(4, 0, KEY_T), 227 KEY(4, 0, KEY_T),
219 KEY(4, 1, KEY_DOWN), 228 KEY(4, 1, KEY_DOWN),
220 KEY(4, 2, KEY_RIGHT), 229 KEY(4, 2, KEY_RIGHT),
221 KEY(4, 4, KEY_LEFTCTRL), 230 KEY(4, 4, KEY_LEFTCTRL),
222 KEY(4, 5, KEY_RIGHTALT), 231 KEY(4, 5, KEY_RIGHTALT),
223 KEY(4, 6, KEY_LEFTSHIFT), 232 KEY(4, 6, KEY_LEFTSHIFT),
233 KEY(4, 8, KEY_F10),
234
224 KEY(5, 0, KEY_Y), 235 KEY(5, 0, KEY_Y),
236 KEY(5, 8, KEY_F11),
237
225 KEY(6, 0, KEY_U), 238 KEY(6, 0, KEY_U),
239
226 KEY(7, 0, KEY_I), 240 KEY(7, 0, KEY_I),
227 KEY(7, 1, KEY_F7), 241 KEY(7, 1, KEY_F7),
228 KEY(7, 2, KEY_F8), 242 KEY(7, 2, KEY_F8),
229 KEY(0xff, 2, KEY_F9),
230 KEY(0xff, 4, KEY_F10),
231 KEY(0xff, 5, KEY_F11),
232}; 243};
233 244
234static struct matrix_keymap_data board_map_data = { 245static struct matrix_keymap_data board_map_data = {
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index 37b8a1a4adf8..fd1904b013fa 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -25,6 +25,8 @@
25#include <plat/control.h> 25#include <plat/control.h>
26#include <plat/cpu.h> 26#include <plat/cpu.h>
27 27
28#include <mach/id.h>
29
28static struct omap_chip_id omap_chip; 30static struct omap_chip_id omap_chip;
29static unsigned int omap_revision; 31static unsigned int omap_revision;
30 32
@@ -102,30 +104,36 @@ static struct omap_id omap_ids[] __initdata = {
102static void __iomem *tap_base; 104static void __iomem *tap_base;
103static u16 tap_prod_id; 105static u16 tap_prod_id;
104 106
105void __init omap24xx_check_revision(void) 107void omap_get_die_id(struct omap_die_id *odi)
108{
109 odi->id_0 = read_tap_reg(OMAP_TAP_DIE_ID_0);
110 odi->id_1 = read_tap_reg(OMAP_TAP_DIE_ID_1);
111 odi->id_2 = read_tap_reg(OMAP_TAP_DIE_ID_2);
112 odi->id_3 = read_tap_reg(OMAP_TAP_DIE_ID_3);
113}
114
115static void __init omap24xx_check_revision(void)
106{ 116{
107 int i, j; 117 int i, j;
108 u32 idcode, prod_id; 118 u32 idcode, prod_id;
109 u16 hawkeye; 119 u16 hawkeye;
110 u8 dev_type, rev; 120 u8 dev_type, rev;
121 struct omap_die_id odi;
111 122
112 idcode = read_tap_reg(OMAP_TAP_IDCODE); 123 idcode = read_tap_reg(OMAP_TAP_IDCODE);
113 prod_id = read_tap_reg(tap_prod_id); 124 prod_id = read_tap_reg(tap_prod_id);
114 hawkeye = (idcode >> 12) & 0xffff; 125 hawkeye = (idcode >> 12) & 0xffff;
115 rev = (idcode >> 28) & 0x0f; 126 rev = (idcode >> 28) & 0x0f;
116 dev_type = (prod_id >> 16) & 0x0f; 127 dev_type = (prod_id >> 16) & 0x0f;
128 omap_get_die_id(&odi);
117 129
118 pr_debug("OMAP_TAP_IDCODE 0x%08x REV %i HAWKEYE 0x%04x MANF %03x\n", 130 pr_debug("OMAP_TAP_IDCODE 0x%08x REV %i HAWKEYE 0x%04x MANF %03x\n",
119 idcode, rev, hawkeye, (idcode >> 1) & 0x7ff); 131 idcode, rev, hawkeye, (idcode >> 1) & 0x7ff);
120 pr_debug("OMAP_TAP_DIE_ID_0: 0x%08x\n", 132 pr_debug("OMAP_TAP_DIE_ID_0: 0x%08x\n", odi.id_0);
121 read_tap_reg(OMAP_TAP_DIE_ID_0));
122 pr_debug("OMAP_TAP_DIE_ID_1: 0x%08x DEV_REV: %i\n", 133 pr_debug("OMAP_TAP_DIE_ID_1: 0x%08x DEV_REV: %i\n",
123 read_tap_reg(OMAP_TAP_DIE_ID_1), 134 odi.id_1, (odi.id_1 >> 28) & 0xf);
124 (read_tap_reg(OMAP_TAP_DIE_ID_1) >> 28) & 0xf); 135 pr_debug("OMAP_TAP_DIE_ID_2: 0x%08x\n", odi.id_2);
125 pr_debug("OMAP_TAP_DIE_ID_2: 0x%08x\n", 136 pr_debug("OMAP_TAP_DIE_ID_3: 0x%08x\n", odi.id_3);
126 read_tap_reg(OMAP_TAP_DIE_ID_2));
127 pr_debug("OMAP_TAP_DIE_ID_3: 0x%08x\n",
128 read_tap_reg(OMAP_TAP_DIE_ID_3));
129 pr_debug("OMAP_TAP_PROD_ID_0: 0x%08x DEV_TYPE: %i\n", 137 pr_debug("OMAP_TAP_PROD_ID_0: 0x%08x DEV_TYPE: %i\n",
130 prod_id, dev_type); 138 prod_id, dev_type);
131 139
@@ -164,7 +172,7 @@ void __init omap24xx_check_revision(void)
164 omap3_features |= OMAP3_HAS_ ##feat; \ 172 omap3_features |= OMAP3_HAS_ ##feat; \
165 } 173 }
166 174
167void __init omap3_check_features(void) 175static void __init omap3_check_features(void)
168{ 176{
169 u32 status; 177 u32 status;
170 178
@@ -179,6 +187,8 @@ void __init omap3_check_features(void)
179 OMAP3_CHECK_FEATURE(status, ISP); 187 OMAP3_CHECK_FEATURE(status, ISP);
180 if (cpu_is_omap3630()) 188 if (cpu_is_omap3630())
181 omap3_features |= OMAP3_HAS_192MHZ_CLK; 189 omap3_features |= OMAP3_HAS_192MHZ_CLK;
190 if (!cpu_is_omap3505() && !cpu_is_omap3517())
191 omap3_features |= OMAP3_HAS_IO_WAKEUP;
182 192
183 /* 193 /*
184 * TODO: Get additional info (where applicable) 194 * TODO: Get additional info (where applicable)
@@ -186,7 +196,7 @@ void __init omap3_check_features(void)
186 */ 196 */
187} 197}
188 198
189void __init omap3_check_revision(void) 199static void __init omap3_check_revision(void)
190{ 200{
191 u32 cpuid, idcode; 201 u32 cpuid, idcode;
192 u16 hawkeye; 202 u16 hawkeye;
@@ -267,7 +277,7 @@ void __init omap3_check_revision(void)
267 } 277 }
268} 278}
269 279
270void __init omap4_check_revision(void) 280static void __init omap4_check_revision(void)
271{ 281{
272 u32 idcode; 282 u32 idcode;
273 u16 hawkeye; 283 u16 hawkeye;
@@ -297,7 +307,7 @@ void __init omap4_check_revision(void)
297 if (omap3_has_ ##feat()) \ 307 if (omap3_has_ ##feat()) \
298 printk(#feat" "); 308 printk(#feat" ");
299 309
300void __init omap3_cpuinfo(void) 310static void __init omap3_cpuinfo(void)
301{ 311{
302 u8 rev = GET_OMAP_REVISION(); 312 u8 rev = GET_OMAP_REVISION();
303 char cpu_name[16], cpu_rev[16]; 313 char cpu_name[16], cpu_rev[16];
diff --git a/arch/arm/mach-omap2/include/mach/id.h b/arch/arm/mach-omap2/include/mach/id.h
new file mode 100644
index 000000000000..02ed3aa56f1e
--- /dev/null
+++ b/arch/arm/mach-omap2/include/mach/id.h
@@ -0,0 +1,22 @@
1/*
2 * OMAP2 CPU identification code
3 *
4 * Copyright (C) 2010 Kan-Ru Chen <kanru@0xlab.org>
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#ifndef OMAP2_ARCH_ID_H
11#define OMAP2_ARCH_ID_H
12
13struct omap_die_id {
14 u32 id_0;
15 u32 id_1;
16 u32 id_2;
17 u32 id_3;
18};
19
20void omap_get_die_id(struct omap_die_id *odi);
21
22#endif
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index b88737fd6cfe..fb4994ad622e 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -385,8 +385,9 @@ void omap_sram_idle(void)
385 /* Enable IO-PAD and IO-CHAIN wakeups */ 385 /* Enable IO-PAD and IO-CHAIN wakeups */
386 per_next_state = pwrdm_read_next_pwrst(per_pwrdm); 386 per_next_state = pwrdm_read_next_pwrst(per_pwrdm);
387 core_next_state = pwrdm_read_next_pwrst(core_pwrdm); 387 core_next_state = pwrdm_read_next_pwrst(core_pwrdm);
388 if (per_next_state < PWRDM_POWER_ON || 388 if (omap3_has_io_wakeup() && \
389 core_next_state < PWRDM_POWER_ON) { 389 (per_next_state < PWRDM_POWER_ON ||
390 core_next_state < PWRDM_POWER_ON)) {
390 prm_set_mod_reg_bits(OMAP3430_EN_IO_MASK, WKUP_MOD, PM_WKEN); 391 prm_set_mod_reg_bits(OMAP3430_EN_IO_MASK, WKUP_MOD, PM_WKEN);
391 omap3_enable_io_chain(); 392 omap3_enable_io_chain();
392 } 393 }
@@ -479,7 +480,7 @@ void omap_sram_idle(void)
479 } 480 }
480 481
481 /* Disable IO-PAD and IO-CHAIN wakeup */ 482 /* Disable IO-PAD and IO-CHAIN wakeup */
482 if (core_next_state < PWRDM_POWER_ON) { 483 if (omap3_has_io_wakeup() && core_next_state < PWRDM_POWER_ON) {
483 prm_clear_mod_reg_bits(OMAP3430_EN_IO_MASK, WKUP_MOD, PM_WKEN); 484 prm_clear_mod_reg_bits(OMAP3430_EN_IO_MASK, WKUP_MOD, PM_WKEN);
484 omap3_disable_io_chain(); 485 omap3_disable_io_chain();
485 } 486 }