diff options
Diffstat (limited to 'arch/arm/mach-omap1')
23 files changed, 531 insertions, 476 deletions
diff --git a/arch/arm/mach-omap1/Makefile b/arch/arm/mach-omap1/Makefile index 391b6f4827f6..015a66b3ca8e 100644 --- a/arch/arm/mach-omap1/Makefile +++ b/arch/arm/mach-omap1/Makefile | |||
@@ -13,20 +13,20 @@ obj-$(CONFIG_PM) += pm.o sleep.o | |||
13 | led-y := leds.o | 13 | led-y := leds.o |
14 | 14 | ||
15 | # Specific board support | 15 | # Specific board support |
16 | obj-$(CONFIG_MACH_OMAP_H2) += board-h2.o | 16 | obj-$(CONFIG_MACH_OMAP_H2) += board-h2.o board-h2-mmc.o |
17 | obj-$(CONFIG_MACH_OMAP_INNOVATOR) += board-innovator.o | 17 | obj-$(CONFIG_MACH_OMAP_INNOVATOR) += board-innovator.o |
18 | obj-$(CONFIG_MACH_OMAP_GENERIC) += board-generic.o | 18 | obj-$(CONFIG_MACH_OMAP_GENERIC) += board-generic.o |
19 | obj-$(CONFIG_MACH_OMAP_PERSEUS2) += board-perseus2.o | 19 | obj-$(CONFIG_MACH_OMAP_PERSEUS2) += board-perseus2.o |
20 | obj-$(CONFIG_MACH_OMAP_FSAMPLE) += board-fsample.o | 20 | obj-$(CONFIG_MACH_OMAP_FSAMPLE) += board-fsample.o |
21 | obj-$(CONFIG_MACH_OMAP_OSK) += board-osk.o | 21 | obj-$(CONFIG_MACH_OMAP_OSK) += board-osk.o |
22 | obj-$(CONFIG_MACH_OMAP_H3) += board-h3.o | 22 | obj-$(CONFIG_MACH_OMAP_H3) += board-h3.o board-h3-mmc.o |
23 | obj-$(CONFIG_MACH_VOICEBLUE) += board-voiceblue.o | 23 | obj-$(CONFIG_MACH_VOICEBLUE) += board-voiceblue.o |
24 | obj-$(CONFIG_MACH_OMAP_PALMTE) += board-palmte.o | 24 | obj-$(CONFIG_MACH_OMAP_PALMTE) += board-palmte.o |
25 | obj-$(CONFIG_MACH_OMAP_PALMZ71) += board-palmz71.o | 25 | obj-$(CONFIG_MACH_OMAP_PALMZ71) += board-palmz71.o |
26 | obj-$(CONFIG_MACH_OMAP_PALMTT) += board-palmtt.o | 26 | obj-$(CONFIG_MACH_OMAP_PALMTT) += board-palmtt.o |
27 | obj-$(CONFIG_MACH_NOKIA770) += board-nokia770.o | 27 | obj-$(CONFIG_MACH_NOKIA770) += board-nokia770.o |
28 | obj-$(CONFIG_MACH_AMS_DELTA) += board-ams-delta.o | 28 | obj-$(CONFIG_MACH_AMS_DELTA) += board-ams-delta.o |
29 | obj-$(CONFIG_MACH_SX1) += board-sx1.o | 29 | obj-$(CONFIG_MACH_SX1) += board-sx1.o board-sx1-mmc.o |
30 | 30 | ||
31 | ifeq ($(CONFIG_ARCH_OMAP15XX),y) | 31 | ifeq ($(CONFIG_ARCH_OMAP15XX),y) |
32 | # Innovator-1510 FPGA | 32 | # Innovator-1510 FPGA |
diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c index c73ca61e585e..8b102ad59c14 100644 --- a/arch/arm/mach-omap1/board-ams-delta.c +++ b/arch/arm/mach-omap1/board-ams-delta.c | |||
@@ -135,21 +135,21 @@ static void __init ams_delta_init_irq(void) | |||
135 | } | 135 | } |
136 | 136 | ||
137 | static struct map_desc ams_delta_io_desc[] __initdata = { | 137 | static struct map_desc ams_delta_io_desc[] __initdata = { |
138 | // AMS_DELTA_LATCH1 | 138 | /* AMS_DELTA_LATCH1 */ |
139 | { | 139 | { |
140 | .virtual = AMS_DELTA_LATCH1_VIRT, | 140 | .virtual = AMS_DELTA_LATCH1_VIRT, |
141 | .pfn = __phys_to_pfn(AMS_DELTA_LATCH1_PHYS), | 141 | .pfn = __phys_to_pfn(AMS_DELTA_LATCH1_PHYS), |
142 | .length = 0x01000000, | 142 | .length = 0x01000000, |
143 | .type = MT_DEVICE | 143 | .type = MT_DEVICE |
144 | }, | 144 | }, |
145 | // AMS_DELTA_LATCH2 | 145 | /* AMS_DELTA_LATCH2 */ |
146 | { | 146 | { |
147 | .virtual = AMS_DELTA_LATCH2_VIRT, | 147 | .virtual = AMS_DELTA_LATCH2_VIRT, |
148 | .pfn = __phys_to_pfn(AMS_DELTA_LATCH2_PHYS), | 148 | .pfn = __phys_to_pfn(AMS_DELTA_LATCH2_PHYS), |
149 | .length = 0x01000000, | 149 | .length = 0x01000000, |
150 | .type = MT_DEVICE | 150 | .type = MT_DEVICE |
151 | }, | 151 | }, |
152 | // AMS_DELTA_MODEM | 152 | /* AMS_DELTA_MODEM */ |
153 | { | 153 | { |
154 | .virtual = AMS_DELTA_MODEM_VIRT, | 154 | .virtual = AMS_DELTA_MODEM_VIRT, |
155 | .pfn = __phys_to_pfn(AMS_DELTA_MODEM_PHYS), | 155 | .pfn = __phys_to_pfn(AMS_DELTA_MODEM_PHYS), |
@@ -227,6 +227,7 @@ static void __init ams_delta_init(void) | |||
227 | omap_board_config = ams_delta_config; | 227 | omap_board_config = ams_delta_config; |
228 | omap_board_config_size = ARRAY_SIZE(ams_delta_config); | 228 | omap_board_config_size = ARRAY_SIZE(ams_delta_config); |
229 | omap_serial_init(); | 229 | omap_serial_init(); |
230 | omap_register_i2c_bus(1, 100, NULL, 0); | ||
230 | 231 | ||
231 | /* Clear latch2 (NAND, LCD, modem enable) */ | 232 | /* Clear latch2 (NAND, LCD, modem enable) */ |
232 | ams_delta_latch2_write(~0, 0); | 233 | ams_delta_latch2_write(~0, 0); |
diff --git a/arch/arm/mach-omap1/board-fsample.c b/arch/arm/mach-omap1/board-fsample.c index f550b19e1ecd..1bdb66638e29 100644 --- a/arch/arm/mach-omap1/board-fsample.c +++ b/arch/arm/mach-omap1/board-fsample.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <asm/arch/gpio.h> | 30 | #include <asm/arch/gpio.h> |
31 | #include <asm/arch/mux.h> | 31 | #include <asm/arch/mux.h> |
32 | #include <asm/arch/fpga.h> | 32 | #include <asm/arch/fpga.h> |
33 | #include <asm/arch/nand.h> | ||
33 | #include <asm/arch/keypad.h> | 34 | #include <asm/arch/keypad.h> |
34 | #include <asm/arch/common.h> | 35 | #include <asm/arch/common.h> |
35 | #include <asm/arch/board.h> | 36 | #include <asm/arch/board.h> |
@@ -134,7 +135,7 @@ static struct platform_device nor_device = { | |||
134 | .resource = &nor_resource, | 135 | .resource = &nor_resource, |
135 | }; | 136 | }; |
136 | 137 | ||
137 | static struct nand_platform_data nand_data = { | 138 | static struct omap_nand_platform_data nand_data = { |
138 | .options = NAND_SAMSUNG_LP_OPTIONS, | 139 | .options = NAND_SAMSUNG_LP_OPTIONS, |
139 | }; | 140 | }; |
140 | 141 | ||
@@ -202,7 +203,7 @@ static struct platform_device *devices[] __initdata = { | |||
202 | 203 | ||
203 | #define P2_NAND_RB_GPIO_PIN 62 | 204 | #define P2_NAND_RB_GPIO_PIN 62 |
204 | 205 | ||
205 | static int nand_dev_ready(struct nand_platform_data *data) | 206 | static int nand_dev_ready(struct omap_nand_platform_data *data) |
206 | { | 207 | { |
207 | return omap_get_gpio_datain(P2_NAND_RB_GPIO_PIN); | 208 | return omap_get_gpio_datain(P2_NAND_RB_GPIO_PIN); |
208 | } | 209 | } |
@@ -233,6 +234,7 @@ static void __init omap_fsample_init(void) | |||
233 | omap_board_config = fsample_config; | 234 | omap_board_config = fsample_config; |
234 | omap_board_config_size = ARRAY_SIZE(fsample_config); | 235 | omap_board_config_size = ARRAY_SIZE(fsample_config); |
235 | omap_serial_init(); | 236 | omap_serial_init(); |
237 | omap_register_i2c_bus(1, 100, NULL, 0); | ||
236 | } | 238 | } |
237 | 239 | ||
238 | static void __init fsample_init_smc91x(void) | 240 | static void __init fsample_init_smc91x(void) |
diff --git a/arch/arm/mach-omap1/board-generic.c b/arch/arm/mach-omap1/board-generic.c index 33d01adab1ed..c711bf23f7b4 100644 --- a/arch/arm/mach-omap1/board-generic.c +++ b/arch/arm/mach-omap1/board-generic.c | |||
@@ -55,33 +55,14 @@ static struct omap_usb_config generic1610_usb_config __initdata = { | |||
55 | .hmc_mode = 16, | 55 | .hmc_mode = 16, |
56 | .pins[0] = 6, | 56 | .pins[0] = 6, |
57 | }; | 57 | }; |
58 | |||
59 | static struct omap_mmc_config generic_mmc_config __initdata = { | ||
60 | .mmc [0] = { | ||
61 | .enabled = 0, | ||
62 | .wire4 = 0, | ||
63 | .wp_pin = -1, | ||
64 | .power_pin = -1, | ||
65 | .switch_pin = -1, | ||
66 | }, | ||
67 | .mmc [1] = { | ||
68 | .enabled = 0, | ||
69 | .wire4 = 0, | ||
70 | .wp_pin = -1, | ||
71 | .power_pin = -1, | ||
72 | .switch_pin = -1, | ||
73 | }, | ||
74 | }; | ||
75 | |||
76 | #endif | 58 | #endif |
77 | 59 | ||
78 | static struct omap_uart_config generic_uart_config __initdata = { | 60 | static struct omap_uart_config generic_uart_config __initdata = { |
79 | .enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)), | 61 | .enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)), |
80 | }; | 62 | }; |
81 | 63 | ||
82 | static struct omap_board_config_kernel generic_config[] = { | 64 | static struct omap_board_config_kernel generic_config[] __initdata = { |
83 | { OMAP_TAG_USB, NULL }, | 65 | { OMAP_TAG_USB, NULL }, |
84 | { OMAP_TAG_MMC, &generic_mmc_config }, | ||
85 | { OMAP_TAG_UART, &generic_uart_config }, | 66 | { OMAP_TAG_UART, &generic_uart_config }, |
86 | }; | 67 | }; |
87 | 68 | ||
@@ -101,6 +82,7 @@ static void __init omap_generic_init(void) | |||
101 | omap_board_config = generic_config; | 82 | omap_board_config = generic_config; |
102 | omap_board_config_size = ARRAY_SIZE(generic_config); | 83 | omap_board_config_size = ARRAY_SIZE(generic_config); |
103 | omap_serial_init(); | 84 | omap_serial_init(); |
85 | omap_register_i2c_bus(1, 100, NULL, 0); | ||
104 | } | 86 | } |
105 | 87 | ||
106 | static void __init omap_generic_map_io(void) | 88 | static void __init omap_generic_map_io(void) |
diff --git a/arch/arm/mach-omap1/board-h2-mmc.c b/arch/arm/mach-omap1/board-h2-mmc.c new file mode 100644 index 000000000000..6fdc78406b21 --- /dev/null +++ b/arch/arm/mach-omap1/board-h2-mmc.c | |||
@@ -0,0 +1,110 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-omap1/board-h2-mmc.c | ||
3 | * | ||
4 | * Copyright (C) 2007 Instituto Nokia de Tecnologia - INdT | ||
5 | * Author: Felipe Balbi <felipe.lima@indt.org.br> | ||
6 | * | ||
7 | * This code is based on linux/arch/arm/mach-omap2/board-n800-mmc.c, which is: | ||
8 | * Copyright (C) 2006 Nokia Corporation | ||
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 <asm/arch/mmc.h> | ||
16 | #include <asm/arch/gpio.h> | ||
17 | |||
18 | #ifdef CONFIG_MMC_OMAP | ||
19 | static int slot_cover_open; | ||
20 | static struct device *mmc_device; | ||
21 | |||
22 | static int h2_mmc_set_power(struct device *dev, int slot, int power_on, | ||
23 | int vdd) | ||
24 | { | ||
25 | #ifdef CONFIG_MMC_DEBUG | ||
26 | dev_dbg(dev, "Set slot %d power: %s (vdd %d)\n", slot + 1, | ||
27 | power_on ? "on" : "off", vdd); | ||
28 | #endif | ||
29 | if (slot != 0) { | ||
30 | dev_err(dev, "No such slot %d\n", slot + 1); | ||
31 | return -ENODEV; | ||
32 | } | ||
33 | |||
34 | return 0; | ||
35 | } | ||
36 | |||
37 | static int h2_mmc_set_bus_mode(struct device *dev, int slot, int bus_mode) | ||
38 | { | ||
39 | #ifdef CONFIG_MMC_DEBUG | ||
40 | dev_dbg(dev, "Set slot %d bus_mode %s\n", slot + 1, | ||
41 | bus_mode == MMC_BUSMODE_OPENDRAIN ? "open-drain" : "push-pull"); | ||
42 | #endif | ||
43 | if (slot != 0) { | ||
44 | dev_err(dev, "No such slot %d\n", slot + 1); | ||
45 | return -ENODEV; | ||
46 | } | ||
47 | |||
48 | return 0; | ||
49 | } | ||
50 | |||
51 | static int h2_mmc_get_cover_state(struct device *dev, int slot) | ||
52 | { | ||
53 | BUG_ON(slot != 0); | ||
54 | |||
55 | return slot_cover_open; | ||
56 | } | ||
57 | |||
58 | void h2_mmc_slot_cover_handler(void *arg, int state) | ||
59 | { | ||
60 | if (mmc_device == NULL) | ||
61 | return; | ||
62 | |||
63 | slot_cover_open = state; | ||
64 | omap_mmc_notify_cover_event(mmc_device, 0, state); | ||
65 | } | ||
66 | |||
67 | static int h2_mmc_late_init(struct device *dev) | ||
68 | { | ||
69 | int ret = 0; | ||
70 | |||
71 | mmc_device = dev; | ||
72 | |||
73 | return ret; | ||
74 | } | ||
75 | |||
76 | static void h2_mmc_cleanup(struct device *dev) | ||
77 | { | ||
78 | } | ||
79 | |||
80 | static struct omap_mmc_platform_data h2_mmc_data = { | ||
81 | .nr_slots = 1, | ||
82 | .switch_slot = NULL, | ||
83 | .init = h2_mmc_late_init, | ||
84 | .cleanup = h2_mmc_cleanup, | ||
85 | .slots[0] = { | ||
86 | .set_power = h2_mmc_set_power, | ||
87 | .set_bus_mode = h2_mmc_set_bus_mode, | ||
88 | .get_ro = NULL, | ||
89 | .get_cover_state = h2_mmc_get_cover_state, | ||
90 | .ocr_mask = MMC_VDD_28_29 | MMC_VDD_30_31 | | ||
91 | MMC_VDD_32_33 | MMC_VDD_33_34, | ||
92 | .name = "mmcblk", | ||
93 | }, | ||
94 | }; | ||
95 | |||
96 | void __init h2_mmc_init(void) | ||
97 | { | ||
98 | omap_set_mmc_info(1, &h2_mmc_data); | ||
99 | } | ||
100 | |||
101 | #else | ||
102 | |||
103 | void __init h2_mmc_init(void) | ||
104 | { | ||
105 | } | ||
106 | |||
107 | void h2_mmc_slot_cover_handler(void *arg, int state) | ||
108 | { | ||
109 | } | ||
110 | #endif | ||
diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c index bfa04fa25524..070345ee39a5 100644 --- a/arch/arm/mach-omap1/board-h2.c +++ b/arch/arm/mach-omap1/board-h2.c | |||
@@ -37,8 +37,10 @@ | |||
37 | #include <asm/mach/flash.h> | 37 | #include <asm/mach/flash.h> |
38 | #include <asm/mach/map.h> | 38 | #include <asm/mach/map.h> |
39 | 39 | ||
40 | #include <asm/arch/gpio-switch.h> | ||
40 | #include <asm/arch/mux.h> | 41 | #include <asm/arch/mux.h> |
41 | #include <asm/arch/tc.h> | 42 | #include <asm/arch/tc.h> |
43 | #include <asm/arch/nand.h> | ||
42 | #include <asm/arch/irda.h> | 44 | #include <asm/arch/irda.h> |
43 | #include <asm/arch/usb.h> | 45 | #include <asm/arch/usb.h> |
44 | #include <asm/arch/keypad.h> | 46 | #include <asm/arch/keypad.h> |
@@ -46,8 +48,6 @@ | |||
46 | #include <asm/arch/mcbsp.h> | 48 | #include <asm/arch/mcbsp.h> |
47 | #include <asm/arch/omap-alsa.h> | 49 | #include <asm/arch/omap-alsa.h> |
48 | 50 | ||
49 | extern int omap_gpio_init(void); | ||
50 | |||
51 | static int h2_keymap[] = { | 51 | static int h2_keymap[] = { |
52 | KEY(0, 0, KEY_LEFT), | 52 | KEY(0, 0, KEY_LEFT), |
53 | KEY(0, 1, KEY_RIGHT), | 53 | KEY(0, 1, KEY_RIGHT), |
@@ -140,8 +140,6 @@ static struct platform_device h2_nor_device = { | |||
140 | .resource = &h2_nor_resource, | 140 | .resource = &h2_nor_resource, |
141 | }; | 141 | }; |
142 | 142 | ||
143 | #if 0 /* REVISIT: Enable when nand_platform_data is applied */ | ||
144 | |||
145 | static struct mtd_partition h2_nand_partitions[] = { | 143 | static struct mtd_partition h2_nand_partitions[] = { |
146 | #if 0 | 144 | #if 0 |
147 | /* REVISIT: enable these partitions if you make NAND BOOT | 145 | /* REVISIT: enable these partitions if you make NAND BOOT |
@@ -179,7 +177,7 @@ static struct mtd_partition h2_nand_partitions[] = { | |||
179 | }; | 177 | }; |
180 | 178 | ||
181 | /* dip switches control NAND chip access: 8 bit, 16 bit, or neither */ | 179 | /* dip switches control NAND chip access: 8 bit, 16 bit, or neither */ |
182 | static struct nand_platform_data h2_nand_data = { | 180 | static struct omap_nand_platform_data h2_nand_data = { |
183 | .options = NAND_SAMSUNG_LP_OPTIONS, | 181 | .options = NAND_SAMSUNG_LP_OPTIONS, |
184 | .parts = h2_nand_partitions, | 182 | .parts = h2_nand_partitions, |
185 | .nr_parts = ARRAY_SIZE(h2_nand_partitions), | 183 | .nr_parts = ARRAY_SIZE(h2_nand_partitions), |
@@ -198,7 +196,6 @@ static struct platform_device h2_nand_device = { | |||
198 | .num_resources = 1, | 196 | .num_resources = 1, |
199 | .resource = &h2_nand_resource, | 197 | .resource = &h2_nand_resource, |
200 | }; | 198 | }; |
201 | #endif | ||
202 | 199 | ||
203 | static struct resource h2_smc91x_resources[] = { | 200 | static struct resource h2_smc91x_resources[] = { |
204 | [0] = { | 201 | [0] = { |
@@ -311,18 +308,18 @@ static struct omap_mcbsp_reg_cfg mcbsp_regs = { | |||
311 | .srgr2 = GSYNC | CLKSP | FSGM | FPER(31), | 308 | .srgr2 = GSYNC | CLKSP | FSGM | FPER(31), |
312 | 309 | ||
313 | .pcr0 = CLKXM | CLKRM | FSXP | FSRP | CLKXP | CLKRP, | 310 | .pcr0 = CLKXM | CLKRM | FSXP | FSRP | CLKXP | CLKRP, |
314 | //.pcr0 = CLKXP | CLKRP, /* mcbsp: slave */ | 311 | /*.pcr0 = CLKXP | CLKRP,*/ /* mcbsp: slave */ |
315 | }; | 312 | }; |
316 | 313 | ||
317 | static struct omap_alsa_codec_config alsa_config = { | 314 | static struct omap_alsa_codec_config alsa_config = { |
318 | .name = "H2 TSC2101", | 315 | .name = "H2 TSC2101", |
319 | .mcbsp_regs_alsa = &mcbsp_regs, | 316 | .mcbsp_regs_alsa = &mcbsp_regs, |
320 | .codec_configure_dev = NULL, // tsc2101_configure, | 317 | .codec_configure_dev = NULL, /* tsc2101_configure, */ |
321 | .codec_set_samplerate = NULL, // tsc2101_set_samplerate, | 318 | .codec_set_samplerate = NULL, /* tsc2101_set_samplerate, */ |
322 | .codec_clock_setup = NULL, // tsc2101_clock_setup, | 319 | .codec_clock_setup = NULL, /* tsc2101_clock_setup, */ |
323 | .codec_clock_on = NULL, // tsc2101_clock_on, | 320 | .codec_clock_on = NULL, /* tsc2101_clock_on, */ |
324 | .codec_clock_off = NULL, // tsc2101_clock_off, | 321 | .codec_clock_off = NULL, /* tsc2101_clock_off, */ |
325 | .get_default_samplerate = NULL, // tsc2101_get_default_samplerate, | 322 | .get_default_samplerate = NULL, /* tsc2101_get_default_samplerate, */ |
326 | }; | 323 | }; |
327 | 324 | ||
328 | static struct platform_device h2_mcbsp1_device = { | 325 | static struct platform_device h2_mcbsp1_device = { |
@@ -335,7 +332,7 @@ static struct platform_device h2_mcbsp1_device = { | |||
335 | 332 | ||
336 | static struct platform_device *h2_devices[] __initdata = { | 333 | static struct platform_device *h2_devices[] __initdata = { |
337 | &h2_nor_device, | 334 | &h2_nor_device, |
338 | //&h2_nand_device, | 335 | &h2_nand_device, |
339 | &h2_smc91x_device, | 336 | &h2_smc91x_device, |
340 | &h2_irda_device, | 337 | &h2_irda_device, |
341 | &h2_kp_device, | 338 | &h2_kp_device, |
@@ -343,22 +340,6 @@ static struct platform_device *h2_devices[] __initdata = { | |||
343 | &h2_mcbsp1_device, | 340 | &h2_mcbsp1_device, |
344 | }; | 341 | }; |
345 | 342 | ||
346 | #ifdef CONFIG_I2C_BOARDINFO | ||
347 | static struct i2c_board_info __initdata h2_i2c_board_info[] = { | ||
348 | { | ||
349 | I2C_BOARD_INFO("tps65010", 0x48), | ||
350 | .type = "tps65010", | ||
351 | .irq = OMAP_GPIO_IRQ(58), | ||
352 | }, | ||
353 | /* TODO when driver support is ready: | ||
354 | * - isp1301 OTG transceiver | ||
355 | * - optional ov9640 camera sensor at 0x30 | ||
356 | * - pcf9754 for aGPS control | ||
357 | * - ... etc | ||
358 | */ | ||
359 | }; | ||
360 | #endif | ||
361 | |||
362 | static void __init h2_init_smc91x(void) | 343 | static void __init h2_init_smc91x(void) |
363 | { | 344 | { |
364 | if ((omap_request_gpio(0)) < 0) { | 345 | if ((omap_request_gpio(0)) < 0) { |
@@ -367,6 +348,14 @@ static void __init h2_init_smc91x(void) | |||
367 | } | 348 | } |
368 | } | 349 | } |
369 | 350 | ||
351 | static struct i2c_board_info __initdata h2_i2c_board_info[] = { | ||
352 | { | ||
353 | I2C_BOARD_INFO("isp1301_omap", 0x2d), | ||
354 | .type = "isp1301_omap", | ||
355 | .irq = OMAP_GPIO_IRQ(2), | ||
356 | }, | ||
357 | }; | ||
358 | |||
370 | static void __init h2_init_irq(void) | 359 | static void __init h2_init_irq(void) |
371 | { | 360 | { |
372 | omap1_init_common_hw(); | 361 | omap1_init_common_hw(); |
@@ -380,26 +369,25 @@ static struct omap_usb_config h2_usb_config __initdata = { | |||
380 | .otg = 2, | 369 | .otg = 2, |
381 | 370 | ||
382 | #ifdef CONFIG_USB_GADGET_OMAP | 371 | #ifdef CONFIG_USB_GADGET_OMAP |
383 | .hmc_mode = 19, // 0:host(off) 1:dev|otg 2:disabled | 372 | .hmc_mode = 19, /* 0:host(off) 1:dev|otg 2:disabled */ |
384 | // .hmc_mode = 21, // 0:host(off) 1:dev(loopback) 2:host(loopback) | 373 | /* .hmc_mode = 21,*/ /* 0:host(off) 1:dev(loopback) 2:host(loopback) */ |
385 | #elif defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) | 374 | #elif defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) |
386 | /* needs OTG cable, or NONSTANDARD (B-to-MiniB) */ | 375 | /* needs OTG cable, or NONSTANDARD (B-to-MiniB) */ |
387 | .hmc_mode = 20, // 1:dev|otg(off) 1:host 2:disabled | 376 | .hmc_mode = 20, /* 1:dev|otg(off) 1:host 2:disabled */ |
388 | #endif | 377 | #endif |
389 | 378 | ||
390 | .pins[1] = 3, | 379 | .pins[1] = 3, |
391 | }; | 380 | }; |
392 | 381 | ||
393 | static struct omap_mmc_config h2_mmc_config __initdata = { | 382 | static struct omap_mmc_config h2_mmc_config __initdata = { |
394 | .mmc [0] = { | 383 | .mmc[0] = { |
395 | .enabled = 1, | 384 | .enabled = 1, |
396 | .wire4 = 1, | 385 | .wire4 = 1, |
397 | .wp_pin = OMAP_MPUIO(3), | ||
398 | .power_pin = -1, /* tps65010 gpio3 */ | ||
399 | .switch_pin = OMAP_MPUIO(1), | ||
400 | }, | 386 | }, |
401 | }; | 387 | }; |
402 | 388 | ||
389 | extern struct omap_mmc_platform_data h2_mmc_data; | ||
390 | |||
403 | static struct omap_uart_config h2_uart_config __initdata = { | 391 | static struct omap_uart_config h2_uart_config __initdata = { |
404 | .enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)), | 392 | .enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)), |
405 | }; | 393 | }; |
@@ -409,15 +397,15 @@ static struct omap_lcd_config h2_lcd_config __initdata = { | |||
409 | }; | 397 | }; |
410 | 398 | ||
411 | static struct omap_board_config_kernel h2_config[] __initdata = { | 399 | static struct omap_board_config_kernel h2_config[] __initdata = { |
412 | { OMAP_TAG_USB, &h2_usb_config }, | 400 | { OMAP_TAG_USB, &h2_usb_config }, |
413 | { OMAP_TAG_MMC, &h2_mmc_config }, | 401 | { OMAP_TAG_MMC, &h2_mmc_config }, |
414 | { OMAP_TAG_UART, &h2_uart_config }, | 402 | { OMAP_TAG_UART, &h2_uart_config }, |
415 | { OMAP_TAG_LCD, &h2_lcd_config }, | 403 | { OMAP_TAG_LCD, &h2_lcd_config }, |
416 | }; | 404 | }; |
417 | 405 | ||
418 | #define H2_NAND_RB_GPIO_PIN 62 | 406 | #define H2_NAND_RB_GPIO_PIN 62 |
419 | 407 | ||
420 | static int h2_nand_dev_ready(struct nand_platform_data *data) | 408 | static int h2_nand_dev_ready(struct omap_nand_platform_data *data) |
421 | { | 409 | { |
422 | return omap_get_gpio_datain(H2_NAND_RB_GPIO_PIN); | 410 | return omap_get_gpio_datain(H2_NAND_RB_GPIO_PIN); |
423 | } | 411 | } |
@@ -436,18 +424,16 @@ static void __init h2_init(void) | |||
436 | h2_nor_resource.end = h2_nor_resource.start = omap_cs3_phys(); | 424 | h2_nor_resource.end = h2_nor_resource.start = omap_cs3_phys(); |
437 | h2_nor_resource.end += SZ_32M - 1; | 425 | h2_nor_resource.end += SZ_32M - 1; |
438 | 426 | ||
439 | #if 0 /* REVISIT: Enable when nand_platform_data is applied */ | ||
440 | h2_nand_resource.end = h2_nand_resource.start = OMAP_CS2B_PHYS; | 427 | h2_nand_resource.end = h2_nand_resource.start = OMAP_CS2B_PHYS; |
441 | h2_nand_resource.end += SZ_4K - 1; | 428 | h2_nand_resource.end += SZ_4K - 1; |
442 | if (!(omap_request_gpio(H2_NAND_RB_GPIO_PIN))) | 429 | if (!(omap_request_gpio(H2_NAND_RB_GPIO_PIN))) |
443 | h2_nand_data.dev_ready = h2_nand_dev_ready; | 430 | h2_nand_data.dev_ready = h2_nand_dev_ready; |
444 | #endif | ||
445 | 431 | ||
446 | omap_cfg_reg(L3_1610_FLASH_CS2B_OE); | 432 | omap_cfg_reg(L3_1610_FLASH_CS2B_OE); |
447 | omap_cfg_reg(M8_1610_FLASH_CS2B_WE); | 433 | omap_cfg_reg(M8_1610_FLASH_CS2B_WE); |
448 | 434 | ||
449 | /* MMC: card detect and WP */ | 435 | /* MMC: card detect and WP */ |
450 | // omap_cfg_reg(U19_ARMIO1); /* CD */ | 436 | /* omap_cfg_reg(U19_ARMIO1); */ /* CD */ |
451 | omap_cfg_reg(BALLOUT_V8_ARMIO3); /* WP */ | 437 | omap_cfg_reg(BALLOUT_V8_ARMIO3); /* WP */ |
452 | 438 | ||
453 | /* Irda */ | 439 | /* Irda */ |
@@ -463,16 +449,9 @@ static void __init h2_init(void) | |||
463 | omap_board_config = h2_config; | 449 | omap_board_config = h2_config; |
464 | omap_board_config_size = ARRAY_SIZE(h2_config); | 450 | omap_board_config_size = ARRAY_SIZE(h2_config); |
465 | omap_serial_init(); | 451 | omap_serial_init(); |
466 | 452 | omap_register_i2c_bus(1, 100, h2_i2c_board_info, | |
467 | /* irq for tps65010 chip */ | 453 | ARRAY_SIZE(h2_i2c_board_info)); |
468 | omap_cfg_reg(W4_GPIO58); | 454 | h2_mmc_init(); |
469 | if (gpio_request(58, "tps65010") == 0) | ||
470 | gpio_direction_input(58); | ||
471 | |||
472 | #ifdef CONFIG_I2C_BOARDINFO | ||
473 | i2c_register_board_info(1, h2_i2c_board_info, | ||
474 | ARRAY_SIZE(h2_i2c_board_info)); | ||
475 | #endif | ||
476 | } | 455 | } |
477 | 456 | ||
478 | static void __init h2_map_io(void) | 457 | static void __init h2_map_io(void) |
@@ -480,22 +459,6 @@ static void __init h2_map_io(void) | |||
480 | omap1_map_common_io(); | 459 | omap1_map_common_io(); |
481 | } | 460 | } |
482 | 461 | ||
483 | #ifdef CONFIG_TPS65010 | ||
484 | static int __init h2_tps_init(void) | ||
485 | { | ||
486 | if (!machine_is_omap_h2()) | ||
487 | return 0; | ||
488 | |||
489 | /* gpio3 for SD, gpio4 for VDD_DSP */ | ||
490 | /* FIXME send power to DSP iff it's configured */ | ||
491 | |||
492 | /* Enable LOW_PWR */ | ||
493 | tps65010_set_low_pwr(ON); | ||
494 | return 0; | ||
495 | } | ||
496 | fs_initcall(h2_tps_init); | ||
497 | #endif | ||
498 | |||
499 | MACHINE_START(OMAP_H2, "TI-H2") | 462 | MACHINE_START(OMAP_H2, "TI-H2") |
500 | /* Maintainer: Imre Deak <imre.deak@nokia.com> */ | 463 | /* Maintainer: Imre Deak <imre.deak@nokia.com> */ |
501 | .phys_io = 0xfff00000, | 464 | .phys_io = 0xfff00000, |
diff --git a/arch/arm/mach-omap1/board-h3-mmc.c b/arch/arm/mach-omap1/board-h3-mmc.c new file mode 100644 index 000000000000..66ecc437928f --- /dev/null +++ b/arch/arm/mach-omap1/board-h3-mmc.c | |||
@@ -0,0 +1,114 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-omap1/board-h3-mmc.c | ||
3 | * | ||
4 | * Copyright (C) 2007 Instituto Nokia de Tecnologia - INdT | ||
5 | * Author: Felipe Balbi <felipe.lima@indt.org.br> | ||
6 | * | ||
7 | * This code is based on linux/arch/arm/mach-omap2/board-n800-mmc.c, which is: | ||
8 | * Copyright (C) 2006 Nokia Corporation | ||
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 <asm/arch/mmc.h> | ||
16 | #include <asm/arch/gpio.h> | ||
17 | |||
18 | #ifdef CONFIG_MMC_OMAP | ||
19 | static int slot_cover_open; | ||
20 | static struct device *mmc_device; | ||
21 | |||
22 | static int h3_mmc_set_power(struct device *dev, int slot, int power_on, | ||
23 | int vdd) | ||
24 | { | ||
25 | #ifdef CONFIG_MMC_DEBUG | ||
26 | dev_dbg(dev, "Set slot %d power: %s (vdd %d)\n", slot + 1, | ||
27 | power_on ? "on" : "off", vdd); | ||
28 | #endif | ||
29 | if (slot != 0) { | ||
30 | dev_err(dev, "No such slot %d\n", slot + 1); | ||
31 | return -ENODEV; | ||
32 | } | ||
33 | |||
34 | return 0; | ||
35 | } | ||
36 | |||
37 | static int h3_mmc_set_bus_mode(struct device *dev, int slot, int bus_mode) | ||
38 | { | ||
39 | int ret = 0; | ||
40 | |||
41 | #ifdef CONFIG_MMC_DEBUG | ||
42 | dev_dbg(dev, "Set slot %d bus_mode %s\n", slot + 1, | ||
43 | bus_mode == MMC_BUSMODE_OPENDRAIN ? "open-drain" : "push-pull"); | ||
44 | #endif | ||
45 | if (slot != 0) { | ||
46 | dev_err(dev, "No such slot %d\n", slot + 1); | ||
47 | return -ENODEV; | ||
48 | } | ||
49 | |||
50 | /* Treated on upper level */ | ||
51 | |||
52 | return bus_mode; | ||
53 | } | ||
54 | |||
55 | static int h3_mmc_get_cover_state(struct device *dev, int slot) | ||
56 | { | ||
57 | BUG_ON(slot != 0); | ||
58 | |||
59 | return slot_cover_open; | ||
60 | } | ||
61 | |||
62 | void h3_mmc_slot_cover_handler(void *arg, int state) | ||
63 | { | ||
64 | if (mmc_device == NULL) | ||
65 | return; | ||
66 | |||
67 | slot_cover_open = state; | ||
68 | omap_mmc_notify_cover_event(mmc_device, 0, state); | ||
69 | } | ||
70 | |||
71 | static int h3_mmc_late_init(struct device *dev) | ||
72 | { | ||
73 | int ret = 0; | ||
74 | |||
75 | mmc_device = dev; | ||
76 | |||
77 | return ret; | ||
78 | } | ||
79 | |||
80 | static void h3_mmc_cleanup(struct device *dev) | ||
81 | { | ||
82 | } | ||
83 | |||
84 | static struct omap_mmc_platform_data h3_mmc_data = { | ||
85 | .nr_slots = 1, | ||
86 | .switch_slot = NULL, | ||
87 | .init = h3_mmc_late_init, | ||
88 | .cleanup = h3_mmc_cleanup, | ||
89 | .slots[0] = { | ||
90 | .set_power = h3_mmc_set_power, | ||
91 | .set_bus_mode = h3_mmc_set_bus_mode, | ||
92 | .get_ro = NULL, | ||
93 | .get_cover_state = h3_mmc_get_cover_state, | ||
94 | .ocr_mask = MMC_VDD_28_29 | MMC_VDD_30_31 | | ||
95 | MMC_VDD_32_33 | MMC_VDD_33_34, | ||
96 | .name = "mmcblk", | ||
97 | }, | ||
98 | }; | ||
99 | |||
100 | void __init h3_mmc_init(void) | ||
101 | { | ||
102 | omap_set_mmc_info(1, &h3_mmc_data); | ||
103 | } | ||
104 | |||
105 | #else | ||
106 | |||
107 | void __init h3_mmc_init(void) | ||
108 | { | ||
109 | } | ||
110 | |||
111 | void h3_mmc_slot_cover_handler(void *arg, int state) | ||
112 | { | ||
113 | } | ||
114 | #endif | ||
diff --git a/arch/arm/mach-omap1/board-h3.c b/arch/arm/mach-omap1/board-h3.c index 056519860565..6fc516855a8c 100644 --- a/arch/arm/mach-omap1/board-h3.c +++ b/arch/arm/mach-omap1/board-h3.c | |||
@@ -42,6 +42,7 @@ | |||
42 | #include <asm/arch/irqs.h> | 42 | #include <asm/arch/irqs.h> |
43 | #include <asm/arch/mux.h> | 43 | #include <asm/arch/mux.h> |
44 | #include <asm/arch/tc.h> | 44 | #include <asm/arch/tc.h> |
45 | #include <asm/arch/nand.h> | ||
45 | #include <asm/arch/irda.h> | 46 | #include <asm/arch/irda.h> |
46 | #include <asm/arch/usb.h> | 47 | #include <asm/arch/usb.h> |
47 | #include <asm/arch/keypad.h> | 48 | #include <asm/arch/keypad.h> |
@@ -50,8 +51,6 @@ | |||
50 | #include <asm/arch/mcbsp.h> | 51 | #include <asm/arch/mcbsp.h> |
51 | #include <asm/arch/omap-alsa.h> | 52 | #include <asm/arch/omap-alsa.h> |
52 | 53 | ||
53 | extern int omap_gpio_init(void); | ||
54 | |||
55 | static int h3_keymap[] = { | 54 | static int h3_keymap[] = { |
56 | KEY(0, 0, KEY_LEFT), | 55 | KEY(0, 0, KEY_LEFT), |
57 | KEY(0, 1, KEY_RIGHT), | 56 | KEY(0, 1, KEY_RIGHT), |
@@ -179,7 +178,7 @@ static struct mtd_partition nand_partitions[] = { | |||
179 | }; | 178 | }; |
180 | 179 | ||
181 | /* dip switches control NAND chip access: 8 bit, 16 bit, or neither */ | 180 | /* dip switches control NAND chip access: 8 bit, 16 bit, or neither */ |
182 | static struct nand_platform_data nand_data = { | 181 | static struct omap_nand_platform_data nand_data = { |
183 | .options = NAND_SAMSUNG_LP_OPTIONS, | 182 | .options = NAND_SAMSUNG_LP_OPTIONS, |
184 | .parts = nand_partitions, | 183 | .parts = nand_partitions, |
185 | .nr_parts = ARRAY_SIZE(nand_partitions), | 184 | .nr_parts = ARRAY_SIZE(nand_partitions), |
@@ -387,18 +386,18 @@ static struct omap_mcbsp_reg_cfg mcbsp_regs = { | |||
387 | .srgr2 = GSYNC | CLKSP | FSGM | FPER(31), | 386 | .srgr2 = GSYNC | CLKSP | FSGM | FPER(31), |
388 | 387 | ||
389 | .pcr0 = CLKRM | SCLKME | FSXP | FSRP | CLKXP | CLKRP, | 388 | .pcr0 = CLKRM | SCLKME | FSXP | FSRP | CLKXP | CLKRP, |
390 | //.pcr0 = CLKXP | CLKRP, /* mcbsp: slave */ | 389 | /*.pcr0 = CLKXP | CLKRP,*/ /* mcbsp: slave */ |
391 | }; | 390 | }; |
392 | 391 | ||
393 | static struct omap_alsa_codec_config alsa_config = { | 392 | static struct omap_alsa_codec_config alsa_config = { |
394 | .name = "H3 TSC2101", | 393 | .name = "H3 TSC2101", |
395 | .mcbsp_regs_alsa = &mcbsp_regs, | 394 | .mcbsp_regs_alsa = &mcbsp_regs, |
396 | .codec_configure_dev = NULL, // tsc2101_configure, | 395 | .codec_configure_dev = NULL, /* tsc2101_configure, */ |
397 | .codec_set_samplerate = NULL, // tsc2101_set_samplerate, | 396 | .codec_set_samplerate = NULL, /* tsc2101_set_samplerate, */ |
398 | .codec_clock_setup = NULL, // tsc2101_clock_setup, | 397 | .codec_clock_setup = NULL, /* tsc2101_clock_setup, */ |
399 | .codec_clock_on = NULL, // tsc2101_clock_on, | 398 | .codec_clock_on = NULL, /* tsc2101_clock_on, */ |
400 | .codec_clock_off = NULL, // tsc2101_clock_off, | 399 | .codec_clock_off = NULL, /* tsc2101_clock_off, */ |
401 | .get_default_samplerate = NULL, // tsc2101_get_default_samplerate, | 400 | .get_default_samplerate = NULL, /* tsc2101_get_default_samplerate, */ |
402 | }; | 401 | }; |
403 | 402 | ||
404 | static struct platform_device h3_mcbsp1_device = { | 403 | static struct platform_device h3_mcbsp1_device = { |
@@ -436,12 +435,13 @@ static struct omap_usb_config h3_usb_config __initdata = { | |||
436 | 435 | ||
437 | static struct omap_mmc_config h3_mmc_config __initdata = { | 436 | static struct omap_mmc_config h3_mmc_config __initdata = { |
438 | .mmc[0] = { | 437 | .mmc[0] = { |
439 | .enabled = 1, | 438 | .enabled = 1, |
440 | .power_pin = -1, /* tps65010 GPIO4 */ | 439 | .wire4 = 1, |
441 | .switch_pin = OMAP_MPUIO(1), | 440 | }, |
442 | }, | ||
443 | }; | 441 | }; |
444 | 442 | ||
443 | extern struct omap_mmc_platform_data h3_mmc_data; | ||
444 | |||
445 | static struct omap_uart_config h3_uart_config __initdata = { | 445 | static struct omap_uart_config h3_uart_config __initdata = { |
446 | .enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)), | 446 | .enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)), |
447 | }; | 447 | }; |
@@ -450,29 +450,28 @@ static struct omap_lcd_config h3_lcd_config __initdata = { | |||
450 | .ctrl_name = "internal", | 450 | .ctrl_name = "internal", |
451 | }; | 451 | }; |
452 | 452 | ||
453 | static struct omap_board_config_kernel h3_config[] = { | 453 | static struct omap_board_config_kernel h3_config[] __initdata = { |
454 | { OMAP_TAG_USB, &h3_usb_config }, | 454 | { OMAP_TAG_USB, &h3_usb_config }, |
455 | { OMAP_TAG_MMC, &h3_mmc_config }, | 455 | { OMAP_TAG_MMC, &h3_mmc_config }, |
456 | { OMAP_TAG_UART, &h3_uart_config }, | 456 | { OMAP_TAG_UART, &h3_uart_config }, |
457 | { OMAP_TAG_LCD, &h3_lcd_config }, | 457 | { OMAP_TAG_LCD, &h3_lcd_config }, |
458 | }; | 458 | }; |
459 | 459 | ||
460 | static struct i2c_board_info __initdata h3_i2c_board_info[] = { | 460 | static struct omap_gpio_switch h3_gpio_switches[] __initdata = { |
461 | { | 461 | { |
462 | I2C_BOARD_INFO("tps65010", 0x48), | 462 | .name = "mmc_slot", |
463 | .type = "tps65013", | 463 | .gpio = OMAP_MPUIO(1), |
464 | /* .irq = OMAP_GPIO_IRQ(??), */ | 464 | .type = OMAP_GPIO_SWITCH_TYPE_COVER, |
465 | .debounce_rising = 100, | ||
466 | .debounce_falling = 0, | ||
467 | .notify = h3_mmc_slot_cover_handler, | ||
468 | .notify_data = NULL, | ||
465 | }, | 469 | }, |
466 | /* TODO when driver support is ready: | ||
467 | * - isp1301 OTG transceiver | ||
468 | * - optional ov9640 camera sensor at 0x30 | ||
469 | * - ... | ||
470 | */ | ||
471 | }; | 470 | }; |
472 | 471 | ||
473 | #define H3_NAND_RB_GPIO_PIN 10 | 472 | #define H3_NAND_RB_GPIO_PIN 10 |
474 | 473 | ||
475 | static int nand_dev_ready(struct nand_platform_data *data) | 474 | static int nand_dev_ready(struct omap_nand_platform_data *data) |
476 | { | 475 | { |
477 | return omap_get_gpio_datain(H3_NAND_RB_GPIO_PIN); | 476 | return omap_get_gpio_datain(H3_NAND_RB_GPIO_PIN); |
478 | } | 477 | } |
@@ -500,13 +499,14 @@ static void __init h3_init(void) | |||
500 | omap_cfg_reg(V2_1710_GPIO10); | 499 | omap_cfg_reg(V2_1710_GPIO10); |
501 | 500 | ||
502 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 501 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
502 | spi_register_board_info(h3_spi_board_info, | ||
503 | ARRAY_SIZE(h3_spi_board_info)); | ||
503 | omap_board_config = h3_config; | 504 | omap_board_config = h3_config; |
504 | omap_board_config_size = ARRAY_SIZE(h3_config); | 505 | omap_board_config_size = ARRAY_SIZE(h3_config); |
505 | omap_serial_init(); | 506 | omap_serial_init(); |
506 | 507 | omap_register_i2c_bus(1, 100, h3_i2c_board_info, | |
507 | /* FIXME setup irq for tps65013 chip */ | 508 | ARRAY_SIZE(h3_i2c_board_info)); |
508 | i2c_register_board_info(1, h3_i2c_board_info, | 509 | h3_mmc_init(); |
509 | ARRAY_SIZE(h3_i2c_board_info)); | ||
510 | } | 510 | } |
511 | 511 | ||
512 | static void __init h3_init_smc91x(void) | 512 | static void __init h3_init_smc91x(void) |
@@ -531,23 +531,6 @@ static void __init h3_map_io(void) | |||
531 | omap1_map_common_io(); | 531 | omap1_map_common_io(); |
532 | } | 532 | } |
533 | 533 | ||
534 | #ifdef CONFIG_TPS65010 | ||
535 | static int __init h3_tps_init(void) | ||
536 | { | ||
537 | if (!machine_is_omap_h3()) | ||
538 | return 0; | ||
539 | |||
540 | /* gpio4 for SD, gpio3 for VDD_DSP */ | ||
541 | /* FIXME send power to DSP iff it's configured */ | ||
542 | |||
543 | /* Enable LOW_PWR */ | ||
544 | tps65013_set_low_pwr(ON); | ||
545 | |||
546 | return 0; | ||
547 | } | ||
548 | fs_initcall(h3_tps_init); | ||
549 | #endif | ||
550 | |||
551 | MACHINE_START(OMAP_H3, "TI OMAP1710 H3 board") | 534 | MACHINE_START(OMAP_H3, "TI OMAP1710 H3 board") |
552 | /* Maintainer: Texas Instruments, Inc. */ | 535 | /* Maintainer: Texas Instruments, Inc. */ |
553 | .phys_io = 0xfff00000, | 536 | .phys_io = 0xfff00000, |
diff --git a/arch/arm/mach-omap1/board-innovator.c b/arch/arm/mach-omap1/board-innovator.c index 7d2d8af155a3..4b8ae3ee0d05 100644 --- a/arch/arm/mach-omap1/board-innovator.c +++ b/arch/arm/mach-omap1/board-innovator.c | |||
@@ -134,12 +134,12 @@ static struct omap_mcbsp_reg_cfg mcbsp_regs = { | |||
134 | static struct omap_alsa_codec_config alsa_config = { | 134 | static struct omap_alsa_codec_config alsa_config = { |
135 | .name = "OMAP Innovator AIC23", | 135 | .name = "OMAP Innovator AIC23", |
136 | .mcbsp_regs_alsa = &mcbsp_regs, | 136 | .mcbsp_regs_alsa = &mcbsp_regs, |
137 | .codec_configure_dev = NULL, // aic23_configure, | 137 | .codec_configure_dev = NULL, /* aic23_configure, */ |
138 | .codec_set_samplerate = NULL, // aic23_set_samplerate, | 138 | .codec_set_samplerate = NULL, /* aic23_set_samplerate, */ |
139 | .codec_clock_setup = NULL, // aic23_clock_setup, | 139 | .codec_clock_setup = NULL, /* aic23_clock_setup, */ |
140 | .codec_clock_on = NULL, // aic23_clock_on, | 140 | .codec_clock_on = NULL, /* aic23_clock_on, */ |
141 | .codec_clock_off = NULL, // aic23_clock_off, | 141 | .codec_clock_off = NULL, /* aic23_clock_off, */ |
142 | .get_default_samplerate = NULL, // aic23_get_default_samplerate, | 142 | .get_default_samplerate = NULL, /* aic23_get_default_samplerate, */ |
143 | }; | 143 | }; |
144 | 144 | ||
145 | static struct platform_device innovator_mcbsp1_device = { | 145 | static struct platform_device innovator_mcbsp1_device = { |
@@ -345,11 +345,11 @@ static struct omap_usb_config h2_usb_config __initdata = { | |||
345 | .otg = 2, | 345 | .otg = 2, |
346 | 346 | ||
347 | #ifdef CONFIG_USB_GADGET_OMAP | 347 | #ifdef CONFIG_USB_GADGET_OMAP |
348 | .hmc_mode = 19, // 0:host(off) 1:dev|otg 2:disabled | 348 | .hmc_mode = 19, /* 0:host(off) 1:dev|otg 2:disabled */ |
349 | // .hmc_mode = 21, // 0:host(off) 1:dev(loopback) 2:host(loopback) | 349 | /* .hmc_mode = 21,*/ /* 0:host(off) 1:dev(loopback) 2:host(loopback) */ |
350 | #elif defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) | 350 | #elif defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) |
351 | /* NONSTANDARD CABLE NEEDED (B-to-Mini-B) */ | 351 | /* NONSTANDARD CABLE NEEDED (B-to-Mini-B) */ |
352 | .hmc_mode = 20, // 1:dev|otg(off) 1:host 2:disabled | 352 | .hmc_mode = 20, /* 1:dev|otg(off) 1:host 2:disabled */ |
353 | #endif | 353 | #endif |
354 | 354 | ||
355 | .pins[1] = 3, | 355 | .pins[1] = 3, |
@@ -411,6 +411,7 @@ static void __init innovator_init(void) | |||
411 | omap_board_config = innovator_config; | 411 | omap_board_config = innovator_config; |
412 | omap_board_config_size = ARRAY_SIZE(innovator_config); | 412 | omap_board_config_size = ARRAY_SIZE(innovator_config); |
413 | omap_serial_init(); | 413 | omap_serial_init(); |
414 | omap_register_i2c_bus(1, 100, NULL, 0); | ||
414 | } | 415 | } |
415 | 416 | ||
416 | static void __init innovator_map_io(void) | 417 | static void __init innovator_map_io(void) |
diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c index e2c8ffd75cff..bcb984f2300f 100644 --- a/arch/arm/mach-omap1/board-nokia770.c +++ b/arch/arm/mach-omap1/board-nokia770.c | |||
@@ -189,7 +189,7 @@ static struct omap_mmc_config nokia770_mmc_config __initdata = { | |||
189 | }, | 189 | }, |
190 | }; | 190 | }; |
191 | 191 | ||
192 | static struct omap_board_config_kernel nokia770_config[] = { | 192 | static struct omap_board_config_kernel nokia770_config[] __initdata = { |
193 | { OMAP_TAG_USB, NULL }, | 193 | { OMAP_TAG_USB, NULL }, |
194 | { OMAP_TAG_MMC, &nokia770_mmc_config }, | 194 | { OMAP_TAG_MMC, &nokia770_mmc_config }, |
195 | }; | 195 | }; |
@@ -330,6 +330,7 @@ static void __init omap_nokia770_init(void) | |||
330 | omap_board_config_size = ARRAY_SIZE(nokia770_config); | 330 | omap_board_config_size = ARRAY_SIZE(nokia770_config); |
331 | omap_gpio_init(); | 331 | omap_gpio_init(); |
332 | omap_serial_init(); | 332 | omap_serial_init(); |
333 | omap_register_i2c_bus(1, 100, NULL, 0); | ||
333 | omap_dsp_init(); | 334 | omap_dsp_init(); |
334 | ads7846_dev_init(); | 335 | ads7846_dev_init(); |
335 | mipid_dev_init(); | 336 | mipid_dev_init(); |
diff --git a/arch/arm/mach-omap1/board-osk.c b/arch/arm/mach-omap1/board-osk.c index 84333440008c..5279e35a8aec 100644 --- a/arch/arm/mach-omap1/board-osk.c +++ b/arch/arm/mach-omap1/board-osk.c | |||
@@ -160,12 +160,12 @@ static struct omap_mcbsp_reg_cfg mcbsp_regs = { | |||
160 | static struct omap_alsa_codec_config alsa_config = { | 160 | static struct omap_alsa_codec_config alsa_config = { |
161 | .name = "OSK AIC23", | 161 | .name = "OSK AIC23", |
162 | .mcbsp_regs_alsa = &mcbsp_regs, | 162 | .mcbsp_regs_alsa = &mcbsp_regs, |
163 | .codec_configure_dev = NULL, // aic23_configure, | 163 | .codec_configure_dev = NULL, /* aic23_configure, */ |
164 | .codec_set_samplerate = NULL, // aic23_set_samplerate, | 164 | .codec_set_samplerate = NULL, /* aic23_set_samplerate, */ |
165 | .codec_clock_setup = NULL, // aic23_clock_setup, | 165 | .codec_clock_setup = NULL, /* aic23_clock_setup, */ |
166 | .codec_clock_on = NULL, // aic23_clock_on, | 166 | .codec_clock_on = NULL, /* aic23_clock_on, */ |
167 | .codec_clock_off = NULL, // aic23_clock_off, | 167 | .codec_clock_off = NULL, /* aic23_clock_off, */ |
168 | .get_default_samplerate = NULL, // aic23_get_default_samplerate, | 168 | .get_default_samplerate = NULL, /* aic23_get_default_samplerate, */ |
169 | }; | 169 | }; |
170 | 170 | ||
171 | static struct platform_device osk5912_mcbsp1_device = { | 171 | static struct platform_device osk5912_mcbsp1_device = { |
@@ -253,7 +253,7 @@ static struct omap_lcd_config osk_lcd_config __initdata = { | |||
253 | }; | 253 | }; |
254 | #endif | 254 | #endif |
255 | 255 | ||
256 | static struct omap_board_config_kernel osk_config[] = { | 256 | static struct omap_board_config_kernel osk_config[] __initdata = { |
257 | { OMAP_TAG_USB, &osk_usb_config }, | 257 | { OMAP_TAG_USB, &osk_usb_config }, |
258 | { OMAP_TAG_UART, &osk_uart_config }, | 258 | { OMAP_TAG_UART, &osk_uart_config }, |
259 | #ifdef CONFIG_OMAP_OSK_MISTRAL | 259 | #ifdef CONFIG_OMAP_OSK_MISTRAL |
@@ -392,7 +392,7 @@ static void __init osk_mistral_init(void) | |||
392 | omap_cfg_reg(W13_1610_CCP_CLKM); | 392 | omap_cfg_reg(W13_1610_CCP_CLKM); |
393 | omap_cfg_reg(Y12_1610_CCP_CLKP); | 393 | omap_cfg_reg(Y12_1610_CCP_CLKP); |
394 | /* CCP_DATAM CONFLICTS WITH UART1.TX (and serial console) */ | 394 | /* CCP_DATAM CONFLICTS WITH UART1.TX (and serial console) */ |
395 | // omap_cfg_reg(Y14_1610_CCP_DATAM); | 395 | /* omap_cfg_reg(Y14_1610_CCP_DATAM); */ |
396 | omap_cfg_reg(W14_1610_CCP_DATAP); | 396 | omap_cfg_reg(W14_1610_CCP_DATAP); |
397 | 397 | ||
398 | /* CAM_PWDN */ | 398 | /* CAM_PWDN */ |
@@ -404,8 +404,8 @@ static void __init osk_mistral_init(void) | |||
404 | pr_debug("OSK+Mistral: CAM_PWDN is awol\n"); | 404 | pr_debug("OSK+Mistral: CAM_PWDN is awol\n"); |
405 | 405 | ||
406 | 406 | ||
407 | // omap_cfg_reg(P19_1610_GPIO6); // BUSY | 407 | /* omap_cfg_reg(P19_1610_GPIO6); */ /* BUSY */ |
408 | omap_cfg_reg(P20_1610_GPIO4); // PENIRQ | 408 | omap_cfg_reg(P20_1610_GPIO4); /* PENIRQ */ |
409 | set_irq_type(OMAP_GPIO_IRQ(4), IRQT_FALLING); | 409 | set_irq_type(OMAP_GPIO_IRQ(4), IRQT_FALLING); |
410 | spi_register_board_info(mistral_boardinfo, | 410 | spi_register_board_info(mistral_boardinfo, |
411 | ARRAY_SIZE(mistral_boardinfo)); | 411 | ARRAY_SIZE(mistral_boardinfo)); |
@@ -473,10 +473,9 @@ static void __init osk_init(void) | |||
473 | if (gpio_request(OMAP_MPUIO(1), "tps65010") == 0) | 473 | if (gpio_request(OMAP_MPUIO(1), "tps65010") == 0) |
474 | gpio_direction_input(OMAP_MPUIO(1)); | 474 | gpio_direction_input(OMAP_MPUIO(1)); |
475 | 475 | ||
476 | i2c_register_board_info(1, osk_i2c_board_info, | ||
477 | ARRAY_SIZE(osk_i2c_board_info)); | ||
478 | |||
479 | omap_serial_init(); | 476 | omap_serial_init(); |
477 | omap_register_i2c_bus(1, 400, osk_i2c_board_info, | ||
478 | ARRAY_SIZE(osk_i2c_board_info)); | ||
480 | osk_mistral_init(); | 479 | osk_mistral_init(); |
481 | } | 480 | } |
482 | 481 | ||
diff --git a/arch/arm/mach-omap1/board-palmte.c b/arch/arm/mach-omap1/board-palmte.c index 2f9d00a00135..ca1a4bf78a10 100644 --- a/arch/arm/mach-omap1/board-palmte.c +++ b/arch/arm/mach-omap1/board-palmte.c | |||
@@ -10,6 +10,8 @@ | |||
10 | * Maintainers : http://palmtelinux.sf.net | 10 | * Maintainers : http://palmtelinux.sf.net |
11 | * palmtelinux-developpers@lists.sf.net | 11 | * palmtelinux-developpers@lists.sf.net |
12 | * | 12 | * |
13 | * Copyright (c) 2006 Andrzej Zaborowski <balrog@zabor.org> | ||
14 | * | ||
13 | * This program is free software; you can redistribute it and/or modify | 15 | * This program is free software; you can redistribute it and/or modify |
14 | * it under the terms of the GNU General Public License version 2 as | 16 | * it under the terms of the GNU General Public License version 2 as |
15 | * published by the Free Software Foundation. | 17 | * published by the Free Software Foundation. |
@@ -24,8 +26,8 @@ | |||
24 | #include <linux/spi/spi.h> | 26 | #include <linux/spi/spi.h> |
25 | #include <linux/spi/tsc2102.h> | 27 | #include <linux/spi/tsc2102.h> |
26 | #include <linux/interrupt.h> | 28 | #include <linux/interrupt.h> |
29 | #include <linux/apm-emulation.h> | ||
27 | 30 | ||
28 | #include <asm/apm.h> | ||
29 | #include <asm/hardware.h> | 31 | #include <asm/hardware.h> |
30 | #include <asm/mach-types.h> | 32 | #include <asm/mach-types.h> |
31 | #include <asm/mach/arch.h> | 33 | #include <asm/mach/arch.h> |
@@ -51,11 +53,11 @@ static void __init omap_palmte_init_irq(void) | |||
51 | omap_gpio_init(); | 53 | omap_gpio_init(); |
52 | } | 54 | } |
53 | 55 | ||
54 | static int palmte_keymap[] = { | 56 | static const int palmte_keymap[] = { |
55 | KEY(0, 0, KEY_F1), | 57 | KEY(0, 0, KEY_F1), /* Calendar */ |
56 | KEY(0, 1, KEY_F2), | 58 | KEY(0, 1, KEY_F2), /* Contacts */ |
57 | KEY(0, 2, KEY_F3), | 59 | KEY(0, 2, KEY_F3), /* Tasks List */ |
58 | KEY(0, 3, KEY_F4), | 60 | KEY(0, 3, KEY_F4), /* Note Pad */ |
59 | KEY(0, 4, KEY_POWER), | 61 | KEY(0, 4, KEY_POWER), |
60 | KEY(1, 0, KEY_LEFT), | 62 | KEY(1, 0, KEY_LEFT), |
61 | KEY(1, 1, KEY_DOWN), | 63 | KEY(1, 1, KEY_DOWN), |
@@ -68,7 +70,7 @@ static int palmte_keymap[] = { | |||
68 | static struct omap_kp_platform_data palmte_kp_data = { | 70 | static struct omap_kp_platform_data palmte_kp_data = { |
69 | .rows = 8, | 71 | .rows = 8, |
70 | .cols = 8, | 72 | .cols = 8, |
71 | .keymap = palmte_keymap, | 73 | .keymap = (int *) palmte_keymap, |
72 | .rep = 1, | 74 | .rep = 1, |
73 | .delay = 12, | 75 | .delay = 12, |
74 | }; | 76 | }; |
@@ -180,7 +182,7 @@ static struct platform_device palmte_irda_device = { | |||
180 | .resource = palmte_irda_resources, | 182 | .resource = palmte_irda_resources, |
181 | }; | 183 | }; |
182 | 184 | ||
183 | static struct platform_device *devices[] __initdata = { | 185 | static struct platform_device *palmte_devices[] __initdata = { |
184 | &palmte_rom_device, | 186 | &palmte_rom_device, |
185 | &palmte_kp_device, | 187 | &palmte_kp_device, |
186 | &palmte_lcd_device, | 188 | &palmte_lcd_device, |
@@ -273,7 +275,7 @@ static void palmte_get_power_status(struct apm_power_info *info, int *battery) | |||
273 | info->time = 0; | 275 | info->time = 0; |
274 | } else { | 276 | } else { |
275 | while (hi > lo + 1) { | 277 | while (hi > lo + 1) { |
276 | mid = (hi + lo) >> 2; | 278 | mid = (hi + lo) >> 1; |
277 | if (batt <= palmte_battery_sample[mid]) | 279 | if (batt <= palmte_battery_sample[mid]) |
278 | lo = mid; | 280 | lo = mid; |
279 | else | 281 | else |
@@ -321,7 +323,7 @@ static struct tsc2102_config palmte_tsc2102_config = { | |||
321 | .alsa_config = &palmte_alsa_config, | 323 | .alsa_config = &palmte_alsa_config, |
322 | }; | 324 | }; |
323 | 325 | ||
324 | static struct omap_board_config_kernel palmte_config[] = { | 326 | static struct omap_board_config_kernel palmte_config[] __initdata = { |
325 | { OMAP_TAG_USB, &palmte_usb_config }, | 327 | { OMAP_TAG_USB, &palmte_usb_config }, |
326 | { OMAP_TAG_MMC, &palmte_mmc_config }, | 328 | { OMAP_TAG_MMC, &palmte_mmc_config }, |
327 | { OMAP_TAG_LCD, &palmte_lcd_config }, | 329 | { OMAP_TAG_LCD, &palmte_lcd_config }, |
@@ -339,74 +341,34 @@ static struct spi_board_info palmte_spi_info[] __initdata = { | |||
339 | }, | 341 | }, |
340 | }; | 342 | }; |
341 | 343 | ||
342 | /* Periodically check for changes on important input pins */ | 344 | static void palmte_headphones_detect(void *data, int state) |
343 | struct timer_list palmte_pin_timer; | 345 | { |
344 | int prev_power, prev_headphones; | 346 | if (state) { |
345 | |||
346 | static void palmte_pin_handler(unsigned long data) { | ||
347 | int power, headphones; | ||
348 | |||
349 | power = !omap_get_gpio_datain(PALMTE_DC_GPIO); | ||
350 | headphones = omap_get_gpio_datain(PALMTE_HEADPHONES_GPIO); | ||
351 | |||
352 | if (power && !prev_power) | ||
353 | printk(KERN_INFO "PM: cable connected\n"); | ||
354 | else if (!power && prev_power) | ||
355 | printk(KERN_INFO "PM: cable disconnected\n"); | ||
356 | |||
357 | if (headphones && !prev_headphones) { | ||
358 | /* Headphones connected, disable speaker */ | 347 | /* Headphones connected, disable speaker */ |
359 | omap_set_gpio_dataout(PALMTE_SPEAKER_GPIO, 0); | 348 | omap_set_gpio_dataout(PALMTE_SPEAKER_GPIO, 0); |
360 | printk(KERN_INFO "PM: speaker off\n"); | 349 | printk(KERN_INFO "PM: speaker off\n"); |
361 | } else if (!headphones && prev_headphones) { | 350 | } else { |
362 | /* Headphones unplugged, re-enable speaker */ | 351 | /* Headphones unplugged, re-enable speaker */ |
363 | omap_set_gpio_dataout(PALMTE_SPEAKER_GPIO, 1); | 352 | omap_set_gpio_dataout(PALMTE_SPEAKER_GPIO, 1); |
364 | printk(KERN_INFO "PM: speaker on\n"); | 353 | printk(KERN_INFO "PM: speaker on\n"); |
365 | } | 354 | } |
366 | |||
367 | prev_power = power; | ||
368 | prev_headphones = headphones; | ||
369 | mod_timer(&palmte_pin_timer, jiffies + msecs_to_jiffies(500)); | ||
370 | } | 355 | } |
371 | 356 | ||
372 | static void __init palmte_gpio_setup(void) | 357 | static void __init palmte_misc_gpio_setup(void) |
373 | { | 358 | { |
374 | /* Set TSC2102 PINTDAV pin as input */ | 359 | /* Set TSC2102 PINTDAV pin as input (used by TSC2102 driver) */ |
375 | if (omap_request_gpio(PALMTE_PINTDAV_GPIO)) { | 360 | if (omap_request_gpio(PALMTE_PINTDAV_GPIO)) { |
376 | printk(KERN_ERR "Could not reserve PINTDAV GPIO!\n"); | 361 | printk(KERN_ERR "Could not reserve PINTDAV GPIO!\n"); |
377 | return; | 362 | return; |
378 | } | 363 | } |
379 | omap_set_gpio_direction(PALMTE_PINTDAV_GPIO, 1); | 364 | omap_set_gpio_direction(PALMTE_PINTDAV_GPIO, 1); |
380 | 365 | ||
381 | /* Monitor cable-connected signals */ | 366 | /* Set USB-or-DC-IN pin as input (unused) */ |
382 | if (omap_request_gpio(PALMTE_DC_GPIO) || | 367 | if (omap_request_gpio(PALMTE_USB_OR_DC_GPIO)) { |
383 | omap_request_gpio(PALMTE_USB_OR_DC_GPIO) || | ||
384 | omap_request_gpio(PALMTE_USBDETECT_GPIO)) { | ||
385 | printk(KERN_ERR "Could not reserve cable signal GPIO!\n"); | 368 | printk(KERN_ERR "Could not reserve cable signal GPIO!\n"); |
386 | return; | 369 | return; |
387 | } | 370 | } |
388 | omap_set_gpio_direction(PALMTE_DC_GPIO, 1); | ||
389 | omap_set_gpio_direction(PALMTE_USB_OR_DC_GPIO, 1); | 371 | omap_set_gpio_direction(PALMTE_USB_OR_DC_GPIO, 1); |
390 | omap_set_gpio_direction(PALMTE_USBDETECT_GPIO, 1); | ||
391 | |||
392 | /* Set speaker-enable pin as output */ | ||
393 | if (omap_request_gpio(PALMTE_SPEAKER_GPIO)) { | ||
394 | printk(KERN_ERR "Could not reserve speaker GPIO!\n"); | ||
395 | return; | ||
396 | } | ||
397 | omap_set_gpio_direction(PALMTE_SPEAKER_GPIO, 0); | ||
398 | |||
399 | /* Monitor the headphones-connected signal */ | ||
400 | if (omap_request_gpio(PALMTE_HEADPHONES_GPIO)) { | ||
401 | printk(KERN_ERR "Could not reserve headphones signal GPIO!\n"); | ||
402 | return; | ||
403 | } | ||
404 | omap_set_gpio_direction(PALMTE_HEADPHONES_GPIO, 1); | ||
405 | |||
406 | prev_power = omap_get_gpio_datain(PALMTE_DC_GPIO); | ||
407 | prev_headphones = !omap_get_gpio_datain(PALMTE_HEADPHONES_GPIO); | ||
408 | setup_timer(&palmte_pin_timer, palmte_pin_handler, 0); | ||
409 | palmte_pin_handler(0); | ||
410 | } | 372 | } |
411 | 373 | ||
412 | static void __init omap_palmte_init(void) | 374 | static void __init omap_palmte_init(void) |
@@ -414,12 +376,12 @@ static void __init omap_palmte_init(void) | |||
414 | omap_board_config = palmte_config; | 376 | omap_board_config = palmte_config; |
415 | omap_board_config_size = ARRAY_SIZE(palmte_config); | 377 | omap_board_config_size = ARRAY_SIZE(palmte_config); |
416 | 378 | ||
417 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 379 | platform_add_devices(palmte_devices, ARRAY_SIZE(palmte_devices)); |
418 | 380 | ||
419 | spi_register_board_info(palmte_spi_info, ARRAY_SIZE(palmte_spi_info)); | 381 | spi_register_board_info(palmte_spi_info, ARRAY_SIZE(palmte_spi_info)); |
420 | 382 | palmte_misc_gpio_setup(); | |
421 | omap_serial_init(); | 383 | omap_serial_init(); |
422 | palmte_gpio_setup(); | 384 | omap_register_i2c_bus(1, 100, NULL, 0); |
423 | } | 385 | } |
424 | 386 | ||
425 | static void __init omap_palmte_map_io(void) | 387 | static void __init omap_palmte_map_io(void) |
diff --git a/arch/arm/mach-omap1/board-palmtt.c b/arch/arm/mach-omap1/board-palmtt.c index ed7094a70064..2a033689f9f4 100644 --- a/arch/arm/mach-omap1/board-palmtt.c +++ b/arch/arm/mach-omap1/board-palmtt.c | |||
@@ -144,12 +144,12 @@ static struct omap_mcbsp_reg_cfg mcbsp_regs = { | |||
144 | static struct omap_alsa_codec_config alsa_config = { | 144 | static struct omap_alsa_codec_config alsa_config = { |
145 | .name = "PalmTT AIC23", | 145 | .name = "PalmTT AIC23", |
146 | .mcbsp_regs_alsa = &mcbsp_regs, | 146 | .mcbsp_regs_alsa = &mcbsp_regs, |
147 | .codec_configure_dev = NULL, // aic23_configure, | 147 | .codec_configure_dev = NULL, /* aic23_configure, */ |
148 | .codec_set_samplerate = NULL, // aic23_set_samplerate, | 148 | .codec_set_samplerate = NULL, /* aic23_set_samplerate, */ |
149 | .codec_clock_setup = NULL, // aic23_clock_setup, | 149 | .codec_clock_setup = NULL, /* aic23_clock_setup, */ |
150 | .codec_clock_on = NULL, // aic23_clock_on, | 150 | .codec_clock_on = NULL, /* aic23_clock_on, */ |
151 | .codec_clock_off = NULL, // aic23_clock_off, | 151 | .codec_clock_off = NULL, /* aic23_clock_off, */ |
152 | .get_default_samplerate = NULL, // aic23_get_default_samplerate, | 152 | .get_default_samplerate = NULL, /* aic23_get_default_samplerate, */ |
153 | }; | 153 | }; |
154 | 154 | ||
155 | static struct platform_device palmtt_mcbsp1_device = { | 155 | static struct platform_device palmtt_mcbsp1_device = { |
@@ -312,7 +312,7 @@ static struct omap_uart_config palmtt_uart_config __initdata = { | |||
312 | .enabled_uarts = (1 << 0) | (1 << 1) | (0 << 2), | 312 | .enabled_uarts = (1 << 0) | (1 << 1) | (0 << 2), |
313 | }; | 313 | }; |
314 | 314 | ||
315 | static struct omap_board_config_kernel palmtt_config[] = { | 315 | static struct omap_board_config_kernel palmtt_config[] __initdata = { |
316 | { OMAP_TAG_USB, &palmtt_usb_config }, | 316 | { OMAP_TAG_USB, &palmtt_usb_config }, |
317 | { OMAP_TAG_LCD, &palmtt_lcd_config }, | 317 | { OMAP_TAG_LCD, &palmtt_lcd_config }, |
318 | { OMAP_TAG_UART, &palmtt_uart_config }, | 318 | { OMAP_TAG_UART, &palmtt_uart_config }, |
@@ -338,6 +338,7 @@ static void __init omap_palmtt_init(void) | |||
338 | 338 | ||
339 | spi_register_board_info(palmtt_boardinfo,ARRAY_SIZE(palmtt_boardinfo)); | 339 | spi_register_board_info(palmtt_boardinfo,ARRAY_SIZE(palmtt_boardinfo)); |
340 | omap_serial_init(); | 340 | omap_serial_init(); |
341 | omap_register_i2c_bus(1, 100, NULL, 0); | ||
341 | } | 342 | } |
342 | 343 | ||
343 | static void __init omap_palmtt_map_io(void) | 344 | static void __init omap_palmtt_map_io(void) |
diff --git a/arch/arm/mach-omap1/board-palmz71.c b/arch/arm/mach-omap1/board-palmz71.c index a9a0f6610c3d..156510777ffe 100644 --- a/arch/arm/mach-omap1/board-palmz71.c +++ b/arch/arm/mach-omap1/board-palmz71.c | |||
@@ -285,7 +285,7 @@ static struct omap_uart_config palmz71_uart_config __initdata = { | |||
285 | .enabled_uarts = (1 << 0) | (1 << 1) | (0 << 2), | 285 | .enabled_uarts = (1 << 0) | (1 << 1) | (0 << 2), |
286 | }; | 286 | }; |
287 | 287 | ||
288 | static struct omap_board_config_kernel palmz71_config[] = { | 288 | static struct omap_board_config_kernel palmz71_config[] __initdata = { |
289 | {OMAP_TAG_USB, &palmz71_usb_config}, | 289 | {OMAP_TAG_USB, &palmz71_usb_config}, |
290 | {OMAP_TAG_MMC, &palmz71_mmc_config}, | 290 | {OMAP_TAG_MMC, &palmz71_mmc_config}, |
291 | {OMAP_TAG_LCD, &palmz71_lcd_config}, | 291 | {OMAP_TAG_LCD, &palmz71_lcd_config}, |
@@ -363,6 +363,7 @@ omap_palmz71_init(void) | |||
363 | spi_register_board_info(palmz71_boardinfo, | 363 | spi_register_board_info(palmz71_boardinfo, |
364 | ARRAY_SIZE(palmz71_boardinfo)); | 364 | ARRAY_SIZE(palmz71_boardinfo)); |
365 | omap_serial_init(); | 365 | omap_serial_init(); |
366 | omap_register_i2c_bus(1, 100, NULL, 0); | ||
366 | palmz71_gpio_setup(0); | 367 | palmz71_gpio_setup(0); |
367 | } | 368 | } |
368 | 369 | ||
diff --git a/arch/arm/mach-omap1/board-perseus2.c b/arch/arm/mach-omap1/board-perseus2.c index 534dcfb9d263..94bc0745ab2c 100644 --- a/arch/arm/mach-omap1/board-perseus2.c +++ b/arch/arm/mach-omap1/board-perseus2.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <asm/arch/gpio.h> | 30 | #include <asm/arch/gpio.h> |
31 | #include <asm/arch/mux.h> | 31 | #include <asm/arch/mux.h> |
32 | #include <asm/arch/fpga.h> | 32 | #include <asm/arch/fpga.h> |
33 | #include <asm/arch/nand.h> | ||
33 | #include <asm/arch/keypad.h> | 34 | #include <asm/arch/keypad.h> |
34 | #include <asm/arch/common.h> | 35 | #include <asm/arch/common.h> |
35 | #include <asm/arch/board.h> | 36 | #include <asm/arch/board.h> |
@@ -133,7 +134,7 @@ static struct platform_device nor_device = { | |||
133 | .resource = &nor_resource, | 134 | .resource = &nor_resource, |
134 | }; | 135 | }; |
135 | 136 | ||
136 | static struct nand_platform_data nand_data = { | 137 | static struct omap_nand_platform_data nand_data = { |
137 | .options = NAND_SAMSUNG_LP_OPTIONS, | 138 | .options = NAND_SAMSUNG_LP_OPTIONS, |
138 | }; | 139 | }; |
139 | 140 | ||
@@ -202,7 +203,7 @@ static struct platform_device *devices[] __initdata = { | |||
202 | 203 | ||
203 | #define P2_NAND_RB_GPIO_PIN 62 | 204 | #define P2_NAND_RB_GPIO_PIN 62 |
204 | 205 | ||
205 | static int nand_dev_ready(struct nand_platform_data *data) | 206 | static int nand_dev_ready(struct omap_nand_platform_data *data) |
206 | { | 207 | { |
207 | return omap_get_gpio_datain(P2_NAND_RB_GPIO_PIN); | 208 | return omap_get_gpio_datain(P2_NAND_RB_GPIO_PIN); |
208 | } | 209 | } |
@@ -215,7 +216,7 @@ static struct omap_lcd_config perseus2_lcd_config __initdata = { | |||
215 | .ctrl_name = "internal", | 216 | .ctrl_name = "internal", |
216 | }; | 217 | }; |
217 | 218 | ||
218 | static struct omap_board_config_kernel perseus2_config[] = { | 219 | static struct omap_board_config_kernel perseus2_config[] __initdata = { |
219 | { OMAP_TAG_UART, &perseus2_uart_config }, | 220 | { OMAP_TAG_UART, &perseus2_uart_config }, |
220 | { OMAP_TAG_LCD, &perseus2_lcd_config }, | 221 | { OMAP_TAG_LCD, &perseus2_lcd_config }, |
221 | }; | 222 | }; |
@@ -233,6 +234,7 @@ static void __init omap_perseus2_init(void) | |||
233 | omap_board_config = perseus2_config; | 234 | omap_board_config = perseus2_config; |
234 | omap_board_config_size = ARRAY_SIZE(perseus2_config); | 235 | omap_board_config_size = ARRAY_SIZE(perseus2_config); |
235 | omap_serial_init(); | 236 | omap_serial_init(); |
237 | omap_register_i2c_bus(1, 100, NULL, 0); | ||
236 | } | 238 | } |
237 | 239 | ||
238 | static void __init perseus2_init_smc91x(void) | 240 | static void __init perseus2_init_smc91x(void) |
diff --git a/arch/arm/mach-omap1/board-sx1-mmc.c b/arch/arm/mach-omap1/board-sx1-mmc.c new file mode 100644 index 000000000000..8c93d47719e8 --- /dev/null +++ b/arch/arm/mach-omap1/board-sx1-mmc.c | |||
@@ -0,0 +1,124 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-omap1/board-sx1-mmc.c | ||
3 | * | ||
4 | * Copyright (C) 2007 Instituto Nokia de Tecnologia - INdT | ||
5 | * Author: Carlos Eduardo Aguiar <carlos.aguiar@indt.org.br> | ||
6 | * | ||
7 | * This code is based on linux/arch/arm/mach-omap1/board-h2-mmc.c, which is: | ||
8 | * Copyright (C) 2007 Instituto Nokia de Tecnologia - INdT | ||
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 <asm/arch/hardware.h> | ||
16 | #include <asm/arch/mmc.h> | ||
17 | #include <asm/arch/gpio.h> | ||
18 | |||
19 | #ifdef CONFIG_MMC_OMAP | ||
20 | static int slot_cover_open; | ||
21 | static struct device *mmc_device; | ||
22 | |||
23 | static int sx1_mmc_set_power(struct device *dev, int slot, int power_on, | ||
24 | int vdd) | ||
25 | { | ||
26 | int err; | ||
27 | u8 dat = 0; | ||
28 | |||
29 | #ifdef CONFIG_MMC_DEBUG | ||
30 | dev_dbg(dev, "Set slot %d power: %s (vdd %d)\n", slot + 1, | ||
31 | power_on ? "on" : "off", vdd); | ||
32 | #endif | ||
33 | |||
34 | if (slot != 0) { | ||
35 | dev_err(dev, "No such slot %d\n", slot + 1); | ||
36 | return -ENODEV; | ||
37 | } | ||
38 | |||
39 | err = sx1_i2c_read_byte(SOFIA_I2C_ADDR, SOFIA_POWER1_REG, &dat); | ||
40 | if (err < 0) | ||
41 | return err; | ||
42 | |||
43 | if (power_on) | ||
44 | dat |= SOFIA_MMC_POWER; | ||
45 | else | ||
46 | dat &= ~SOFIA_MMC_POWER; | ||
47 | |||
48 | return sx1_i2c_write_byte(SOFIA_I2C_ADDR, SOFIA_POWER1_REG, dat); | ||
49 | } | ||
50 | |||
51 | static int sx1_mmc_set_bus_mode(struct device *dev, int slot, int bus_mode) | ||
52 | { | ||
53 | #ifdef CONFIG_MMC_DEBUG | ||
54 | dev_dbg(dev, "Set slot %d bus_mode %s\n", slot + 1, | ||
55 | bus_mode == MMC_BUSMODE_OPENDRAIN ? "open-drain" : "push-pull"); | ||
56 | #endif | ||
57 | if (slot != 0) { | ||
58 | dev_err(dev, "No such slot %d\n", slot + 1); | ||
59 | return -ENODEV; | ||
60 | } | ||
61 | |||
62 | return 0; | ||
63 | } | ||
64 | |||
65 | static int sx1_mmc_get_cover_state(struct device *dev, int slot) | ||
66 | { | ||
67 | BUG_ON(slot != 0); | ||
68 | |||
69 | return slot_cover_open; | ||
70 | } | ||
71 | |||
72 | void sx1_mmc_slot_cover_handler(void *arg, int state) | ||
73 | { | ||
74 | if (mmc_device == NULL) | ||
75 | return; | ||
76 | |||
77 | slot_cover_open = state; | ||
78 | omap_mmc_notify_cover_event(mmc_device, 0, state); | ||
79 | } | ||
80 | |||
81 | static int sx1_mmc_late_init(struct device *dev) | ||
82 | { | ||
83 | int ret = 0; | ||
84 | |||
85 | mmc_device = dev; | ||
86 | |||
87 | return ret; | ||
88 | } | ||
89 | |||
90 | static void sx1_mmc_cleanup(struct device *dev) | ||
91 | { | ||
92 | } | ||
93 | |||
94 | static struct omap_mmc_platform_data sx1_mmc_data = { | ||
95 | .nr_slots = 1, | ||
96 | .switch_slot = NULL, | ||
97 | .init = sx1_mmc_late_init, | ||
98 | .cleanup = sx1_mmc_cleanup, | ||
99 | .slots[0] = { | ||
100 | .set_power = sx1_mmc_set_power, | ||
101 | .set_bus_mode = sx1_mmc_set_bus_mode, | ||
102 | .get_ro = NULL, | ||
103 | .get_cover_state = sx1_mmc_get_cover_state, | ||
104 | .ocr_mask = MMC_VDD_28_29 | MMC_VDD_30_31 | | ||
105 | MMC_VDD_32_33 | MMC_VDD_33_34, | ||
106 | .name = "mmcblk", | ||
107 | }, | ||
108 | }; | ||
109 | |||
110 | void __init sx1_mmc_init(void) | ||
111 | { | ||
112 | omap_set_mmc_info(1, &sx1_mmc_data); | ||
113 | } | ||
114 | |||
115 | #else | ||
116 | |||
117 | void __init sx1_mmc_init(void) | ||
118 | { | ||
119 | } | ||
120 | |||
121 | void sx1_mmc_slot_cover_handler(void *arg, int state) | ||
122 | { | ||
123 | } | ||
124 | #endif | ||
diff --git a/arch/arm/mach-omap1/board-sx1.c b/arch/arm/mach-omap1/board-sx1.c index 2743d639aa05..1c7f09aedf07 100644 --- a/arch/arm/mach-omap1/board-sx1.c +++ b/arch/arm/mach-omap1/board-sx1.c | |||
@@ -44,7 +44,7 @@ | |||
44 | #include <asm/arch/keypad.h> | 44 | #include <asm/arch/keypad.h> |
45 | 45 | ||
46 | /* Write to I2C device */ | 46 | /* Write to I2C device */ |
47 | int i2c_write_byte(u8 devaddr, u8 regoffset, u8 value) | 47 | int sx1_i2c_write_byte(u8 devaddr, u8 regoffset, u8 value) |
48 | { | 48 | { |
49 | struct i2c_adapter *adap; | 49 | struct i2c_adapter *adap; |
50 | int err; | 50 | int err; |
@@ -67,7 +67,7 @@ int i2c_write_byte(u8 devaddr, u8 regoffset, u8 value) | |||
67 | } | 67 | } |
68 | 68 | ||
69 | /* Read from I2C device */ | 69 | /* Read from I2C device */ |
70 | int i2c_read_byte(u8 devaddr, u8 regoffset, u8 * value) | 70 | int sx1_i2c_read_byte(u8 devaddr, u8 regoffset, u8 *value) |
71 | { | 71 | { |
72 | struct i2c_adapter *adap; | 72 | struct i2c_adapter *adap; |
73 | int err; | 73 | int err; |
@@ -101,66 +101,55 @@ int sx1_setkeylight(u8 keylight) | |||
101 | { | 101 | { |
102 | if (keylight > SOFIA_MAX_LIGHT_VAL) | 102 | if (keylight > SOFIA_MAX_LIGHT_VAL) |
103 | keylight = SOFIA_MAX_LIGHT_VAL; | 103 | keylight = SOFIA_MAX_LIGHT_VAL; |
104 | return i2c_write_byte(SOFIA_I2C_ADDR, SOFIA_KEYLIGHT_REG, keylight); | 104 | return sx1_i2c_write_byte(SOFIA_I2C_ADDR, SOFIA_KEYLIGHT_REG, keylight); |
105 | } | 105 | } |
106 | /* get current keylight intensity */ | 106 | /* get current keylight intensity */ |
107 | int sx1_getkeylight(u8 * keylight) | 107 | int sx1_getkeylight(u8 * keylight) |
108 | { | 108 | { |
109 | return i2c_read_byte(SOFIA_I2C_ADDR, SOFIA_KEYLIGHT_REG, keylight); | 109 | return sx1_i2c_read_byte(SOFIA_I2C_ADDR, SOFIA_KEYLIGHT_REG, keylight); |
110 | } | 110 | } |
111 | /* set LCD backlight intensity */ | 111 | /* set LCD backlight intensity */ |
112 | int sx1_setbacklight(u8 backlight) | 112 | int sx1_setbacklight(u8 backlight) |
113 | { | 113 | { |
114 | if (backlight > SOFIA_MAX_LIGHT_VAL) | 114 | if (backlight > SOFIA_MAX_LIGHT_VAL) |
115 | backlight = SOFIA_MAX_LIGHT_VAL; | 115 | backlight = SOFIA_MAX_LIGHT_VAL; |
116 | return i2c_write_byte(SOFIA_I2C_ADDR, SOFIA_BACKLIGHT_REG, backlight); | 116 | return sx1_i2c_write_byte(SOFIA_I2C_ADDR, SOFIA_BACKLIGHT_REG, |
117 | backlight); | ||
117 | } | 118 | } |
118 | /* get current LCD backlight intensity */ | 119 | /* get current LCD backlight intensity */ |
119 | int sx1_getbacklight (u8 * backlight) | 120 | int sx1_getbacklight (u8 * backlight) |
120 | { | 121 | { |
121 | return i2c_read_byte(SOFIA_I2C_ADDR, SOFIA_BACKLIGHT_REG, backlight); | 122 | return sx1_i2c_read_byte(SOFIA_I2C_ADDR, SOFIA_BACKLIGHT_REG, |
123 | backlight); | ||
122 | } | 124 | } |
123 | /* set LCD backlight power on/off */ | 125 | /* set LCD backlight power on/off */ |
124 | int sx1_setmmipower(u8 onoff) | 126 | int sx1_setmmipower(u8 onoff) |
125 | { | 127 | { |
126 | int err; | 128 | int err; |
127 | u8 dat = 0; | 129 | u8 dat = 0; |
128 | err = i2c_read_byte(SOFIA_I2C_ADDR, SOFIA_POWER1_REG, &dat); | 130 | err = sx1_i2c_read_byte(SOFIA_I2C_ADDR, SOFIA_POWER1_REG, &dat); |
129 | if (err < 0) | 131 | if (err < 0) |
130 | return err; | 132 | return err; |
131 | if (onoff) | 133 | if (onoff) |
132 | dat |= SOFIA_MMILIGHT_POWER; | 134 | dat |= SOFIA_MMILIGHT_POWER; |
133 | else | 135 | else |
134 | dat &= ~SOFIA_MMILIGHT_POWER; | 136 | dat &= ~SOFIA_MMILIGHT_POWER; |
135 | return i2c_write_byte(SOFIA_I2C_ADDR, SOFIA_POWER1_REG, dat); | 137 | return sx1_i2c_write_byte(SOFIA_I2C_ADDR, SOFIA_POWER1_REG, dat); |
136 | } | ||
137 | /* set MMC power on/off */ | ||
138 | int sx1_setmmcpower(u8 onoff) | ||
139 | { | ||
140 | int err; | ||
141 | u8 dat = 0; | ||
142 | err = i2c_read_byte(SOFIA_I2C_ADDR, SOFIA_POWER1_REG, &dat); | ||
143 | if (err < 0) | ||
144 | return err; | ||
145 | if (onoff) | ||
146 | dat |= SOFIA_MMC_POWER; | ||
147 | else | ||
148 | dat &= ~SOFIA_MMC_POWER; | ||
149 | return i2c_write_byte(SOFIA_I2C_ADDR, SOFIA_POWER1_REG, dat); | ||
150 | } | 138 | } |
139 | |||
151 | /* set USB power on/off */ | 140 | /* set USB power on/off */ |
152 | int sx1_setusbpower(u8 onoff) | 141 | int sx1_setusbpower(u8 onoff) |
153 | { | 142 | { |
154 | int err; | 143 | int err; |
155 | u8 dat = 0; | 144 | u8 dat = 0; |
156 | err = i2c_read_byte(SOFIA_I2C_ADDR, SOFIA_POWER1_REG, &dat); | 145 | err = sx1_i2c_read_byte(SOFIA_I2C_ADDR, SOFIA_POWER1_REG, &dat); |
157 | if (err < 0) | 146 | if (err < 0) |
158 | return err; | 147 | return err; |
159 | if (onoff) | 148 | if (onoff) |
160 | dat |= SOFIA_USB_POWER; | 149 | dat |= SOFIA_USB_POWER; |
161 | else | 150 | else |
162 | dat &= ~SOFIA_USB_POWER; | 151 | dat &= ~SOFIA_USB_POWER; |
163 | return i2c_write_byte(SOFIA_I2C_ADDR, SOFIA_POWER1_REG, dat); | 152 | return sx1_i2c_write_byte(SOFIA_I2C_ADDR, SOFIA_POWER1_REG, dat); |
164 | } | 153 | } |
165 | 154 | ||
166 | EXPORT_SYMBOL(sx1_setkeylight); | 155 | EXPORT_SYMBOL(sx1_setkeylight); |
@@ -168,7 +157,6 @@ EXPORT_SYMBOL(sx1_getkeylight); | |||
168 | EXPORT_SYMBOL(sx1_setbacklight); | 157 | EXPORT_SYMBOL(sx1_setbacklight); |
169 | EXPORT_SYMBOL(sx1_getbacklight); | 158 | EXPORT_SYMBOL(sx1_getbacklight); |
170 | EXPORT_SYMBOL(sx1_setmmipower); | 159 | EXPORT_SYMBOL(sx1_setmmipower); |
171 | EXPORT_SYMBOL(sx1_setmmcpower); | ||
172 | EXPORT_SYMBOL(sx1_setusbpower); | 160 | EXPORT_SYMBOL(sx1_setusbpower); |
173 | 161 | ||
174 | /*----------- Keypad -------------------------*/ | 162 | /*----------- Keypad -------------------------*/ |
@@ -280,21 +268,6 @@ static struct omap_mcbsp_reg_cfg mcbsp1_regs = { | |||
280 | /* PCR0 =0f0f */ | 268 | /* PCR0 =0f0f */ |
281 | }; | 269 | }; |
282 | 270 | ||
283 | /* TODO: PCM interface - McBSP2 */ | ||
284 | static struct omap_mcbsp_reg_cfg mcbsp2_regs = { | ||
285 | .spcr2 = FRST | GRST | XRST | XINTM(3), /* SPCR2=F1 */ | ||
286 | .spcr1 = RINTM(3) | RRST, /* SPCR1=30 */ | ||
287 | .rcr2 = 0, /* RCR2 =00 */ | ||
288 | .rcr1 = RFRLEN1(1) | RWDLEN1(OMAP_MCBSP_WORD_16), /* RCR1 = 140 */ | ||
289 | .xcr2 = 0, /* XCR2 = 0 */ | ||
290 | .xcr1 = XFRLEN1(1) | XWDLEN1(OMAP_MCBSP_WORD_16), /* XCR1 = 140 */ | ||
291 | .srgr1 = FWID(15) | CLKGDV(12), /* SRGR1=0f0c */ | ||
292 | .srgr2 = FSGM | FPER(31), /* SRGR2=101f */ | ||
293 | .pcr0 = FSXM | FSRM | CLKXM | CLKRM | FSXP | FSRP | CLKXP | CLKRP, | ||
294 | /* PCR0=0f0f */ | ||
295 | /* mcbsp: slave */ | ||
296 | }; | ||
297 | |||
298 | static struct omap_alsa_codec_config sx1_alsa_config = { | 271 | static struct omap_alsa_codec_config sx1_alsa_config = { |
299 | .name = "SX1 EGold", | 272 | .name = "SX1 EGold", |
300 | .mcbsp_regs_alsa = &mcbsp1_regs, | 273 | .mcbsp_regs_alsa = &mcbsp1_regs, |
@@ -407,11 +380,8 @@ static struct omap_usb_config sx1_usb_config __initdata = { | |||
407 | 380 | ||
408 | static struct omap_mmc_config sx1_mmc_config __initdata = { | 381 | static struct omap_mmc_config sx1_mmc_config __initdata = { |
409 | .mmc [0] = { | 382 | .mmc [0] = { |
410 | .enabled = 1, | 383 | .enabled = 1, |
411 | .wire4 = 0, | 384 | .wire4 = 0, |
412 | .wp_pin = -1, | ||
413 | .power_pin = -1, /* power is in Sofia */ | ||
414 | .switch_pin = OMAP_MPUIO(3), | ||
415 | }, | 385 | }, |
416 | }; | 386 | }; |
417 | 387 | ||
@@ -440,13 +410,15 @@ static struct omap_uart_config sx1_uart_config __initdata = { | |||
440 | .enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)), | 410 | .enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)), |
441 | }; | 411 | }; |
442 | 412 | ||
443 | static struct omap_board_config_kernel sx1_config[] = { | 413 | static struct omap_board_config_kernel sx1_config[] __initdata = { |
444 | { OMAP_TAG_USB, &sx1_usb_config }, | 414 | { OMAP_TAG_USB, &sx1_usb_config }, |
445 | { OMAP_TAG_MMC, &sx1_mmc_config }, | 415 | { OMAP_TAG_MMC, &sx1_mmc_config }, |
446 | { OMAP_TAG_LCD, &sx1_lcd_config }, | 416 | { OMAP_TAG_LCD, &sx1_lcd_config }, |
447 | { OMAP_TAG_UART, &sx1_uart_config }, | 417 | { OMAP_TAG_UART, &sx1_uart_config }, |
448 | }; | 418 | }; |
419 | |||
449 | /*-----------------------------------------*/ | 420 | /*-----------------------------------------*/ |
421 | |||
450 | static void __init omap_sx1_init(void) | 422 | static void __init omap_sx1_init(void) |
451 | { | 423 | { |
452 | platform_add_devices(sx1_devices, ARRAY_SIZE(sx1_devices)); | 424 | platform_add_devices(sx1_devices, ARRAY_SIZE(sx1_devices)); |
@@ -454,6 +426,8 @@ static void __init omap_sx1_init(void) | |||
454 | omap_board_config = sx1_config; | 426 | omap_board_config = sx1_config; |
455 | omap_board_config_size = ARRAY_SIZE(sx1_config); | 427 | omap_board_config_size = ARRAY_SIZE(sx1_config); |
456 | omap_serial_init(); | 428 | omap_serial_init(); |
429 | omap_register_i2c_bus(1, 100, NULL, 0); | ||
430 | sx1_mmc_init(); | ||
457 | 431 | ||
458 | /* turn on USB power */ | 432 | /* turn on USB power */ |
459 | /* sx1_setusbpower(1); cant do it here because i2c is not ready */ | 433 | /* sx1_setusbpower(1); cant do it here because i2c is not ready */ |
diff --git a/arch/arm/mach-omap1/board-voiceblue.c b/arch/arm/mach-omap1/board-voiceblue.c index c82a1cd20ad4..5c00b3f39cdd 100644 --- a/arch/arm/mach-omap1/board-voiceblue.c +++ b/arch/arm/mach-omap1/board-voiceblue.c | |||
@@ -34,9 +34,6 @@ | |||
34 | #include <asm/arch/tc.h> | 34 | #include <asm/arch/tc.h> |
35 | #include <asm/arch/usb.h> | 35 | #include <asm/arch/usb.h> |
36 | 36 | ||
37 | extern void omap_init_time(void); | ||
38 | extern int omap_gpio_init(void); | ||
39 | |||
40 | static struct plat_serial8250_port voiceblue_ports[] = { | 37 | static struct plat_serial8250_port voiceblue_ports[] = { |
41 | { | 38 | { |
42 | .mapbase = (unsigned long)(OMAP_CS1_PHYS + 0x40000), | 39 | .mapbase = (unsigned long)(OMAP_CS1_PHYS + 0x40000), |
@@ -198,6 +195,7 @@ static void __init voiceblue_init(void) | |||
198 | omap_board_config = voiceblue_config; | 195 | omap_board_config = voiceblue_config; |
199 | omap_board_config_size = ARRAY_SIZE(voiceblue_config); | 196 | omap_board_config_size = ARRAY_SIZE(voiceblue_config); |
200 | omap_serial_init(); | 197 | omap_serial_init(); |
198 | omap_register_i2c_bus(1, 100, NULL, 0); | ||
201 | 199 | ||
202 | /* There is a good chance board is going up, so enable power LED | 200 | /* There is a good chance board is going up, so enable power LED |
203 | * (it is connected through invertor) */ | 201 | * (it is connected through invertor) */ |
diff --git a/arch/arm/mach-omap1/clock.c b/arch/arm/mach-omap1/clock.c index 5d9faa68d2ec..4ea2933f887d 100644 --- a/arch/arm/mach-omap1/clock.c +++ b/arch/arm/mach-omap1/clock.c | |||
@@ -1,4 +1,3 @@ | |||
1 | //kernel/linux-omap-fsample/arch/arm/mach-omap1/clock.c#2 - edit change 3808 (text) | ||
2 | /* | 1 | /* |
3 | * linux/arch/arm/mach-omap1/clock.c | 2 | * linux/arch/arm/mach-omap1/clock.c |
4 | * | 3 | * |
@@ -650,9 +649,9 @@ static void __init omap1_clk_disable_unused(struct clk *clk) | |||
650 | 649 | ||
651 | /* FIXME: This clock seems to be necessary but no-one | 650 | /* FIXME: This clock seems to be necessary but no-one |
652 | * has asked for its activation. */ | 651 | * has asked for its activation. */ |
653 | if (clk == &tc2_ck // FIX: pm.c (SRAM), CCP, Camera | 652 | if (clk == &tc2_ck /* FIX: pm.c (SRAM), CCP, Camera */ |
654 | || clk == &ck_dpll1out.clk // FIX: SoSSI, SSR | 653 | || clk == &ck_dpll1out.clk /* FIX: SoSSI, SSR */ |
655 | || clk == &arm_gpio_ck // FIX: GPIO code for 1510 | 654 | || clk == &arm_gpio_ck /* FIX: GPIO code for 1510 */ |
656 | ) { | 655 | ) { |
657 | printk(KERN_INFO "FIXME: Clock \"%s\" seems unused\n", | 656 | printk(KERN_INFO "FIXME: Clock \"%s\" seems unused\n", |
658 | clk->name); | 657 | clk->name); |
diff --git a/arch/arm/mach-omap1/leds-osk.c b/arch/arm/mach-omap1/leds-osk.c index 6939d5e7569a..026685ed461a 100644 --- a/arch/arm/mach-omap1/leds-osk.c +++ b/arch/arm/mach-omap1/leds-osk.c | |||
@@ -82,7 +82,7 @@ static void mistral_setled(void) | |||
82 | red = 1; | 82 | red = 1; |
83 | else if (hw_led_state & IDLE_LED) | 83 | else if (hw_led_state & IDLE_LED) |
84 | green = 1; | 84 | green = 1; |
85 | // else both sides are disabled | 85 | /* else both sides are disabled */ |
86 | 86 | ||
87 | omap_set_gpio_dataout(GPIO_LED_GREEN, green); | 87 | omap_set_gpio_dataout(GPIO_LED_GREEN, green); |
88 | omap_set_gpio_dataout(GPIO_LED_RED, red); | 88 | omap_set_gpio_dataout(GPIO_LED_RED, red); |
@@ -112,7 +112,7 @@ void osk_leds_event(led_event_t evt) | |||
112 | case led_stop: | 112 | case led_stop: |
113 | led_state &= ~LED_STATE_ENABLED; | 113 | led_state &= ~LED_STATE_ENABLED; |
114 | hw_led_state = 0; | 114 | hw_led_state = 0; |
115 | // NOTE: work may still be pending!! | 115 | /* NOTE: work may still be pending!! */ |
116 | break; | 116 | break; |
117 | 117 | ||
118 | case led_claim: | 118 | case led_claim: |
diff --git a/arch/arm/mach-omap1/mailbox.c b/arch/arm/mach-omap1/mailbox.c index d3abf5609902..bad1e7152d8e 100644 --- a/arch/arm/mach-omap1/mailbox.c +++ b/arch/arm/mach-omap1/mailbox.c | |||
@@ -51,7 +51,7 @@ static inline void mbox_write_reg(unsigned int val, unsigned int reg) | |||
51 | } | 51 | } |
52 | 52 | ||
53 | /* msg */ | 53 | /* msg */ |
54 | static inline mbox_msg_t omap1_mbox_fifo_read(struct omap_mbox *mbox) | 54 | static mbox_msg_t omap1_mbox_fifo_read(struct omap_mbox *mbox) |
55 | { | 55 | { |
56 | struct omap_mbox1_fifo *fifo = | 56 | struct omap_mbox1_fifo *fifo = |
57 | &((struct omap_mbox1_priv *)mbox->priv)->rx_fifo; | 57 | &((struct omap_mbox1_priv *)mbox->priv)->rx_fifo; |
@@ -63,7 +63,7 @@ static inline mbox_msg_t omap1_mbox_fifo_read(struct omap_mbox *mbox) | |||
63 | return msg; | 63 | return msg; |
64 | } | 64 | } |
65 | 65 | ||
66 | static inline void | 66 | static void |
67 | omap1_mbox_fifo_write(struct omap_mbox *mbox, mbox_msg_t msg) | 67 | omap1_mbox_fifo_write(struct omap_mbox *mbox, mbox_msg_t msg) |
68 | { | 68 | { |
69 | struct omap_mbox1_fifo *fifo = | 69 | struct omap_mbox1_fifo *fifo = |
@@ -73,12 +73,12 @@ omap1_mbox_fifo_write(struct omap_mbox *mbox, mbox_msg_t msg) | |||
73 | mbox_write_reg(msg >> 16, fifo->cmd); | 73 | mbox_write_reg(msg >> 16, fifo->cmd); |
74 | } | 74 | } |
75 | 75 | ||
76 | static inline int omap1_mbox_fifo_empty(struct omap_mbox *mbox) | 76 | static int omap1_mbox_fifo_empty(struct omap_mbox *mbox) |
77 | { | 77 | { |
78 | return 0; | 78 | return 0; |
79 | } | 79 | } |
80 | 80 | ||
81 | static inline int omap1_mbox_fifo_full(struct omap_mbox *mbox) | 81 | static int omap1_mbox_fifo_full(struct omap_mbox *mbox) |
82 | { | 82 | { |
83 | struct omap_mbox1_fifo *fifo = | 83 | struct omap_mbox1_fifo *fifo = |
84 | &((struct omap_mbox1_priv *)mbox->priv)->rx_fifo; | 84 | &((struct omap_mbox1_priv *)mbox->priv)->rx_fifo; |
@@ -87,21 +87,21 @@ static inline int omap1_mbox_fifo_full(struct omap_mbox *mbox) | |||
87 | } | 87 | } |
88 | 88 | ||
89 | /* irq */ | 89 | /* irq */ |
90 | static inline void | 90 | static void |
91 | omap1_mbox_enable_irq(struct omap_mbox *mbox, omap_mbox_type_t irq) | 91 | omap1_mbox_enable_irq(struct omap_mbox *mbox, omap_mbox_type_t irq) |
92 | { | 92 | { |
93 | if (irq == IRQ_RX) | 93 | if (irq == IRQ_RX) |
94 | enable_irq(mbox->irq); | 94 | enable_irq(mbox->irq); |
95 | } | 95 | } |
96 | 96 | ||
97 | static inline void | 97 | static void |
98 | omap1_mbox_disable_irq(struct omap_mbox *mbox, omap_mbox_type_t irq) | 98 | omap1_mbox_disable_irq(struct omap_mbox *mbox, omap_mbox_type_t irq) |
99 | { | 99 | { |
100 | if (irq == IRQ_RX) | 100 | if (irq == IRQ_RX) |
101 | disable_irq(mbox->irq); | 101 | disable_irq(mbox->irq); |
102 | } | 102 | } |
103 | 103 | ||
104 | static inline int | 104 | static int |
105 | omap1_mbox_is_irq(struct omap_mbox *mbox, omap_mbox_type_t irq) | 105 | omap1_mbox_is_irq(struct omap_mbox *mbox, omap_mbox_type_t irq) |
106 | { | 106 | { |
107 | if (irq == IRQ_TX) | 107 | if (irq == IRQ_TX) |
diff --git a/arch/arm/mach-omap1/pm.c b/arch/arm/mach-omap1/pm.c index 06b7e54a0128..8eb5dcdaead2 100644 --- a/arch/arm/mach-omap1/pm.c +++ b/arch/arm/mach-omap1/pm.c | |||
@@ -57,7 +57,6 @@ | |||
57 | #include <asm/arch/pm.h> | 57 | #include <asm/arch/pm.h> |
58 | #include <asm/arch/mux.h> | 58 | #include <asm/arch/mux.h> |
59 | #include <asm/arch/dma.h> | 59 | #include <asm/arch/dma.h> |
60 | #include <asm/arch/dsp_common.h> | ||
61 | #include <asm/arch/dmtimer.h> | 60 | #include <asm/arch/dmtimer.h> |
62 | 61 | ||
63 | static unsigned int arm_sleep_save[ARM_SLEEP_SAVE_SIZE]; | 62 | static unsigned int arm_sleep_save[ARM_SLEEP_SAVE_SIZE]; |
@@ -67,6 +66,8 @@ static unsigned int mpui730_sleep_save[MPUI730_SLEEP_SAVE_SIZE]; | |||
67 | static unsigned int mpui1510_sleep_save[MPUI1510_SLEEP_SAVE_SIZE]; | 66 | static unsigned int mpui1510_sleep_save[MPUI1510_SLEEP_SAVE_SIZE]; |
68 | static unsigned int mpui1610_sleep_save[MPUI1610_SLEEP_SAVE_SIZE]; | 67 | static unsigned int mpui1610_sleep_save[MPUI1610_SLEEP_SAVE_SIZE]; |
69 | 68 | ||
69 | #ifdef CONFIG_OMAP_32K_TIMER | ||
70 | |||
70 | static unsigned short enable_dyn_sleep = 1; | 71 | static unsigned short enable_dyn_sleep = 1; |
71 | 72 | ||
72 | static ssize_t idle_show(struct kobject *kobj, struct kobj_attribute *attr, | 73 | static ssize_t idle_show(struct kobject *kobj, struct kobj_attribute *attr, |
@@ -91,7 +92,8 @@ static ssize_t idle_store(struct kobject *kobj, struct kobj_attribute *attr, | |||
91 | static struct kobj_attribute sleep_while_idle_attr = | 92 | static struct kobj_attribute sleep_while_idle_attr = |
92 | __ATTR(sleep_while_idle, 0644, idle_show, idle_store); | 93 | __ATTR(sleep_while_idle, 0644, idle_show, idle_store); |
93 | 94 | ||
94 | static void (*omap_sram_idle)(void) = NULL; | 95 | #endif |
96 | |||
95 | static void (*omap_sram_suspend)(unsigned long r0, unsigned long r1) = NULL; | 97 | static void (*omap_sram_suspend)(unsigned long r0, unsigned long r1) = NULL; |
96 | 98 | ||
97 | /* | 99 | /* |
@@ -104,9 +106,7 @@ void omap_pm_idle(void) | |||
104 | { | 106 | { |
105 | extern __u32 arm_idlect1_mask; | 107 | extern __u32 arm_idlect1_mask; |
106 | __u32 use_idlect1 = arm_idlect1_mask; | 108 | __u32 use_idlect1 = arm_idlect1_mask; |
107 | #ifndef CONFIG_OMAP_MPU_TIMER | 109 | int do_sleep = 0; |
108 | int do_sleep; | ||
109 | #endif | ||
110 | 110 | ||
111 | local_irq_disable(); | 111 | local_irq_disable(); |
112 | local_fiq_disable(); | 112 | local_fiq_disable(); |
@@ -128,7 +128,6 @@ void omap_pm_idle(void) | |||
128 | use_idlect1 = use_idlect1 & ~(1 << 9); | 128 | use_idlect1 = use_idlect1 & ~(1 << 9); |
129 | #else | 129 | #else |
130 | 130 | ||
131 | do_sleep = 0; | ||
132 | while (enable_dyn_sleep) { | 131 | while (enable_dyn_sleep) { |
133 | 132 | ||
134 | #ifdef CONFIG_CBUS_TAHVO_USB | 133 | #ifdef CONFIG_CBUS_TAHVO_USB |
@@ -141,6 +140,8 @@ void omap_pm_idle(void) | |||
141 | break; | 140 | break; |
142 | } | 141 | } |
143 | 142 | ||
143 | #endif | ||
144 | |||
144 | #ifdef CONFIG_OMAP_DM_TIMER | 145 | #ifdef CONFIG_OMAP_DM_TIMER |
145 | use_idlect1 = omap_dm_timer_modify_idlect_mask(use_idlect1); | 146 | use_idlect1 = omap_dm_timer_modify_idlect_mask(use_idlect1); |
146 | #endif | 147 | #endif |
@@ -168,7 +169,6 @@ void omap_pm_idle(void) | |||
168 | } | 169 | } |
169 | omap_sram_suspend(omap_readl(ARM_IDLECT1), | 170 | omap_sram_suspend(omap_readl(ARM_IDLECT1), |
170 | omap_readl(ARM_IDLECT2)); | 171 | omap_readl(ARM_IDLECT2)); |
171 | #endif | ||
172 | 172 | ||
173 | local_fiq_enable(); | 173 | local_fiq_enable(); |
174 | local_irq_enable(); | 174 | local_irq_enable(); |
@@ -661,7 +661,10 @@ static struct platform_suspend_ops omap_pm_ops ={ | |||
661 | 661 | ||
662 | static int __init omap_pm_init(void) | 662 | static int __init omap_pm_init(void) |
663 | { | 663 | { |
664 | |||
665 | #ifdef CONFIG_OMAP_32K_TIMER | ||
664 | int error; | 666 | int error; |
667 | #endif | ||
665 | 668 | ||
666 | printk("Power Management for TI OMAP.\n"); | 669 | printk("Power Management for TI OMAP.\n"); |
667 | 670 | ||
@@ -671,23 +674,17 @@ static int __init omap_pm_init(void) | |||
671 | * memory the MPU can see when it wakes up. | 674 | * memory the MPU can see when it wakes up. |
672 | */ | 675 | */ |
673 | if (cpu_is_omap730()) { | 676 | if (cpu_is_omap730()) { |
674 | omap_sram_idle = omap_sram_push(omap730_idle_loop_suspend, | ||
675 | omap730_idle_loop_suspend_sz); | ||
676 | omap_sram_suspend = omap_sram_push(omap730_cpu_suspend, | 677 | omap_sram_suspend = omap_sram_push(omap730_cpu_suspend, |
677 | omap730_cpu_suspend_sz); | 678 | omap730_cpu_suspend_sz); |
678 | } else if (cpu_is_omap15xx()) { | 679 | } else if (cpu_is_omap15xx()) { |
679 | omap_sram_idle = omap_sram_push(omap1510_idle_loop_suspend, | ||
680 | omap1510_idle_loop_suspend_sz); | ||
681 | omap_sram_suspend = omap_sram_push(omap1510_cpu_suspend, | 680 | omap_sram_suspend = omap_sram_push(omap1510_cpu_suspend, |
682 | omap1510_cpu_suspend_sz); | 681 | omap1510_cpu_suspend_sz); |
683 | } else if (cpu_is_omap16xx()) { | 682 | } else if (cpu_is_omap16xx()) { |
684 | omap_sram_idle = omap_sram_push(omap1610_idle_loop_suspend, | ||
685 | omap1610_idle_loop_suspend_sz); | ||
686 | omap_sram_suspend = omap_sram_push(omap1610_cpu_suspend, | 683 | omap_sram_suspend = omap_sram_push(omap1610_cpu_suspend, |
687 | omap1610_cpu_suspend_sz); | 684 | omap1610_cpu_suspend_sz); |
688 | } | 685 | } |
689 | 686 | ||
690 | if (omap_sram_idle == NULL || omap_sram_suspend == NULL) { | 687 | if (omap_sram_suspend == NULL) { |
691 | printk(KERN_ERR "PM not initialized: Missing SRAM support\n"); | 688 | printk(KERN_ERR "PM not initialized: Missing SRAM support\n"); |
692 | return -ENODEV; | 689 | return -ENODEV; |
693 | } | 690 | } |
@@ -719,9 +716,11 @@ static int __init omap_pm_init(void) | |||
719 | omap_pm_init_proc(); | 716 | omap_pm_init_proc(); |
720 | #endif | 717 | #endif |
721 | 718 | ||
719 | #ifdef CONFIG_OMAP_32K_TIMER | ||
722 | error = sysfs_create_file(power_kobj, &sleep_while_idle_attr); | 720 | error = sysfs_create_file(power_kobj, &sleep_while_idle_attr); |
723 | if (error) | 721 | if (error) |
724 | printk(KERN_ERR "sysfs_create_file failed: %d\n", error); | 722 | printk(KERN_ERR "sysfs_create_file failed: %d\n", error); |
723 | #endif | ||
725 | 724 | ||
726 | if (cpu_is_omap16xx()) { | 725 | if (cpu_is_omap16xx()) { |
727 | /* configure LOW_PWR pin */ | 726 | /* configure LOW_PWR pin */ |
diff --git a/arch/arm/mach-omap1/sleep.S b/arch/arm/mach-omap1/sleep.S index abef33d10f01..68f5b39030b6 100644 --- a/arch/arm/mach-omap1/sleep.S +++ b/arch/arm/mach-omap1/sleep.S | |||
@@ -39,167 +39,6 @@ | |||
39 | 39 | ||
40 | .text | 40 | .text |
41 | 41 | ||
42 | /* | ||
43 | * Forces OMAP into idle state | ||
44 | * | ||
45 | * omapXXXX_idle_loop_suspend() | ||
46 | * | ||
47 | * Note: This code get's copied to internal SRAM at boot. When the OMAP | ||
48 | * wakes up it continues execution at the point it went to sleep. | ||
49 | * | ||
50 | * Note: Because of slightly different configuration values we have | ||
51 | * processor specific functions here. | ||
52 | */ | ||
53 | |||
54 | #if defined(CONFIG_ARCH_OMAP730) | ||
55 | ENTRY(omap730_idle_loop_suspend) | ||
56 | |||
57 | stmfd sp!, {r0 - r12, lr} @ save registers on stack | ||
58 | |||
59 | @ load base address of ARM_IDLECT1 and ARM_IDLECT2 | ||
60 | mov r4, #CLKGEN_REG_ASM_BASE & 0xff000000 | ||
61 | orr r4, r4, #CLKGEN_REG_ASM_BASE & 0x00ff0000 | ||
62 | orr r4, r4, #CLKGEN_REG_ASM_BASE & 0x0000ff00 | ||
63 | |||
64 | @ turn off clock domains | ||
65 | @ get ARM_IDLECT2 into r2 | ||
66 | ldrh r2, [r4, #ARM_IDLECT2_ASM_OFFSET & 0xff] | ||
67 | mov r5, #OMAP730_IDLECT2_SLEEP_VAL & 0xff | ||
68 | orr r5, r5, #OMAP730_IDLECT2_SLEEP_VAL & 0xff00 | ||
69 | strh r5, [r4, #ARM_IDLECT2_ASM_OFFSET & 0xff] | ||
70 | |||
71 | @ request ARM idle | ||
72 | @ get ARM_IDLECT1 into r1 | ||
73 | ldrh r1, [r4, #ARM_IDLECT1_ASM_OFFSET & 0xff] | ||
74 | orr r3, r1, #OMAP730_IDLE_LOOP_REQUEST & 0xffff | ||
75 | strh r3, [r4, #ARM_IDLECT1_ASM_OFFSET & 0xff] | ||
76 | |||
77 | mov r5, #IDLE_WAIT_CYCLES & 0xff | ||
78 | orr r5, r5, #IDLE_WAIT_CYCLES & 0xff00 | ||
79 | l_730: subs r5, r5, #1 | ||
80 | bne l_730 | ||
81 | /* | ||
82 | * Let's wait for the next clock tick to wake us up. | ||
83 | */ | ||
84 | mov r0, #0 | ||
85 | mcr p15, 0, r0, c7, c0, 4 @ wait for interrupt | ||
86 | /* | ||
87 | * omap730_idle_loop_suspend()'s resume point. | ||
88 | * | ||
89 | * It will just start executing here, so we'll restore stuff from the | ||
90 | * stack, reset the ARM_IDLECT1 and ARM_IDLECT2. | ||
91 | */ | ||
92 | |||
93 | @ restore ARM_IDLECT1 and ARM_IDLECT2 and return | ||
94 | @ r1 has ARM_IDLECT1 and r2 still has ARM_IDLECT2 | ||
95 | strh r2, [r4, #ARM_IDLECT2_ASM_OFFSET & 0xff] | ||
96 | strh r1, [r4, #ARM_IDLECT1_ASM_OFFSET & 0xff] | ||
97 | |||
98 | ldmfd sp!, {r0 - r12, pc} @ restore regs and return | ||
99 | |||
100 | ENTRY(omap730_idle_loop_suspend_sz) | ||
101 | .word . - omap730_idle_loop_suspend | ||
102 | #endif /* CONFIG_ARCH_OMAP730 */ | ||
103 | |||
104 | #ifdef CONFIG_ARCH_OMAP15XX | ||
105 | ENTRY(omap1510_idle_loop_suspend) | ||
106 | |||
107 | stmfd sp!, {r0 - r12, lr} @ save registers on stack | ||
108 | |||
109 | @ load base address of ARM_IDLECT1 and ARM_IDLECT2 | ||
110 | mov r4, #CLKGEN_REG_ASM_BASE & 0xff000000 | ||
111 | orr r4, r4, #CLKGEN_REG_ASM_BASE & 0x00ff0000 | ||
112 | orr r4, r4, #CLKGEN_REG_ASM_BASE & 0x0000ff00 | ||
113 | |||
114 | @ turn off clock domains | ||
115 | @ get ARM_IDLECT2 into r2 | ||
116 | ldrh r2, [r4, #ARM_IDLECT2_ASM_OFFSET & 0xff] | ||
117 | mov r5, #OMAP1510_IDLE_CLOCK_DOMAINS & 0xff | ||
118 | orr r5, r5, #OMAP1510_IDLE_CLOCK_DOMAINS & 0xff00 | ||
119 | strh r5, [r4, #ARM_IDLECT2_ASM_OFFSET & 0xff] | ||
120 | |||
121 | @ request ARM idle | ||
122 | @ get ARM_IDLECT1 into r1 | ||
123 | ldrh r1, [r4, #ARM_IDLECT1_ASM_OFFSET & 0xff] | ||
124 | orr r3, r1, #OMAP1510_IDLE_LOOP_REQUEST & 0xffff | ||
125 | strh r3, [r4, #ARM_IDLECT1_ASM_OFFSET & 0xff] | ||
126 | |||
127 | mov r5, #IDLE_WAIT_CYCLES & 0xff | ||
128 | orr r5, r5, #IDLE_WAIT_CYCLES & 0xff00 | ||
129 | l_1510: subs r5, r5, #1 | ||
130 | bne l_1510 | ||
131 | /* | ||
132 | * Let's wait for the next clock tick to wake us up. | ||
133 | */ | ||
134 | mov r0, #0 | ||
135 | mcr p15, 0, r0, c7, c0, 4 @ wait for interrupt | ||
136 | /* | ||
137 | * omap1510_idle_loop_suspend()'s resume point. | ||
138 | * | ||
139 | * It will just start executing here, so we'll restore stuff from the | ||
140 | * stack, reset the ARM_IDLECT1 and ARM_IDLECT2. | ||
141 | */ | ||
142 | |||
143 | @ restore ARM_IDLECT1 and ARM_IDLECT2 and return | ||
144 | @ r1 has ARM_IDLECT1 and r2 still has ARM_IDLECT2 | ||
145 | strh r2, [r4, #ARM_IDLECT2_ASM_OFFSET & 0xff] | ||
146 | strh r1, [r4, #ARM_IDLECT1_ASM_OFFSET & 0xff] | ||
147 | |||
148 | ldmfd sp!, {r0 - r12, pc} @ restore regs and return | ||
149 | |||
150 | ENTRY(omap1510_idle_loop_suspend_sz) | ||
151 | .word . - omap1510_idle_loop_suspend | ||
152 | #endif /* CONFIG_ARCH_OMAP15XX */ | ||
153 | |||
154 | #if defined(CONFIG_ARCH_OMAP16XX) | ||
155 | ENTRY(omap1610_idle_loop_suspend) | ||
156 | |||
157 | stmfd sp!, {r0 - r12, lr} @ save registers on stack | ||
158 | |||
159 | @ load base address of ARM_IDLECT1 and ARM_IDLECT2 | ||
160 | mov r4, #CLKGEN_REG_ASM_BASE & 0xff000000 | ||
161 | orr r4, r4, #CLKGEN_REG_ASM_BASE & 0x00ff0000 | ||
162 | orr r4, r4, #CLKGEN_REG_ASM_BASE & 0x0000ff00 | ||
163 | |||
164 | @ turn off clock domains | ||
165 | @ get ARM_IDLECT2 into r2 | ||
166 | ldrh r2, [r4, #ARM_IDLECT2_ASM_OFFSET & 0xff] | ||
167 | mov r5, #OMAP1610_IDLECT2_SLEEP_VAL & 0xff | ||
168 | orr r5, r5, #OMAP1610_IDLECT2_SLEEP_VAL & 0xff00 | ||
169 | strh r5, [r4, #ARM_IDLECT2_ASM_OFFSET & 0xff] | ||
170 | |||
171 | @ request ARM idle | ||
172 | @ get ARM_IDLECT1 into r1 | ||
173 | ldrh r1, [r4, #ARM_IDLECT1_ASM_OFFSET & 0xff] | ||
174 | orr r3, r1, #OMAP1610_IDLE_LOOP_REQUEST & 0xffff | ||
175 | strh r3, [r4, #ARM_IDLECT1_ASM_OFFSET & 0xff] | ||
176 | |||
177 | mov r5, #IDLE_WAIT_CYCLES & 0xff | ||
178 | orr r5, r5, #IDLE_WAIT_CYCLES & 0xff00 | ||
179 | l_1610: subs r5, r5, #1 | ||
180 | bne l_1610 | ||
181 | /* | ||
182 | * Let's wait for the next clock tick to wake us up. | ||
183 | */ | ||
184 | mov r0, #0 | ||
185 | mcr p15, 0, r0, c7, c0, 4 @ wait for interrupt | ||
186 | /* | ||
187 | * omap1610_idle_loop_suspend()'s resume point. | ||
188 | * | ||
189 | * It will just start executing here, so we'll restore stuff from the | ||
190 | * stack, reset the ARM_IDLECT1 and ARM_IDLECT2. | ||
191 | */ | ||
192 | |||
193 | @ restore ARM_IDLECT1 and ARM_IDLECT2 and return | ||
194 | @ r1 has ARM_IDLECT1 and r2 still has ARM_IDLECT2 | ||
195 | strh r2, [r4, #ARM_IDLECT2_ASM_OFFSET & 0xff] | ||
196 | strh r1, [r4, #ARM_IDLECT1_ASM_OFFSET & 0xff] | ||
197 | |||
198 | ldmfd sp!, {r0 - r12, pc} @ restore regs and return | ||
199 | |||
200 | ENTRY(omap1610_idle_loop_suspend_sz) | ||
201 | .word . - omap1610_idle_loop_suspend | ||
202 | #endif /* CONFIG_ARCH_OMAP16XX */ | ||
203 | 42 | ||
204 | /* | 43 | /* |
205 | * Forces OMAP into deep sleep state | 44 | * Forces OMAP into deep sleep state |