Merge master.kernel.org:/home/rmk/linux-2.6-arm

* master.kernel.org:/home/rmk/linux-2.6-arm: (27 commits)
[ARM] 3433/1: ARM: OMAP: 8/8 Update board files
[ARM] 3455/1: ARM: OMAP: 7/8 Misc updates, take 2
[ARM] 3454/1: ARM: OMAP: 6/8 Update framebuffer low-level init code, take 2
[ARM] 3430/1: ARM: OMAP: 5/8 Update PM
[ARM] 3429/1: ARM: OMAP: 4/8 Update GPIO
[ARM] 3428/1: ARM: OMAP: 3/8 Update pin multiplexing
[ARM] 3427/1: ARM: OMAP: 2/8 Update timers
[ARM] 3426/1: ARM: OMAP: 1/8 Update clock framework
[ARM] 3396/2: AT91RM9200 Platform devices update
[ARM] 3395/2: AT91RM9200 Dataflash Card vs MMC selection
[ARM] 3393/2: AT91RM9200 LED support
[ARM] 3453/1: Poodle: Correctly set the memory size
[ARM] 3446/1: i.MX: MMC/SD SDHC controller registration for i.MX/MX1 MX1ADS board
[ARM] 3444/1: i.MX: Scatter-gather DMA emulation for i.MX/MX1
[ARM] 3451/1: ep93xx: use the m48t86 rtc driver on the ts72xx platform
[ARM] 3450/1: ep93xx: use the ep93xx rtc driver
[ARM] 3452/1: [S3C2410] RX3715 - add nand information
[ARM] 3449/1: [S3C2410] Anubis - fix NAND timings
[ARM] 3448/1: [S3C2410] Settle delay when _enabling_ USB PLL
[ARM] 3442/1: [S3C2410] SMDK: NAND device setup
...

+6555 -1520
+1 -1
arch/arm/configs/at91rm9200dk_defconfig
··· 379 # CONFIG_MTD_DOC2001 is not set 380 # CONFIG_MTD_DOC2001PLUS is not set 381 CONFIG_MTD_AT91_DATAFLASH=y 382 - CONFIG_MTD_AT91_DATAFLASH_CARD=y 383 384 # 385 # NAND Flash Device Drivers
··· 379 # CONFIG_MTD_DOC2001 is not set 380 # CONFIG_MTD_DOC2001PLUS is not set 381 CONFIG_MTD_AT91_DATAFLASH=y 382 + # CONFIG_MTD_AT91_DATAFLASH_CARD is not set 383 384 # 385 # NAND Flash Device Drivers
+1 -1
arch/arm/configs/at91rm9200ek_defconfig
··· 370 # CONFIG_MTD_DOC2001 is not set 371 # CONFIG_MTD_DOC2001PLUS is not set 372 CONFIG_MTD_AT91_DATAFLASH=y 373 - CONFIG_MTD_AT91_DATAFLASH_CARD=y 374 375 # 376 # NAND Flash Device Drivers
··· 370 # CONFIG_MTD_DOC2001 is not set 371 # CONFIG_MTD_DOC2001PLUS is not set 372 CONFIG_MTD_AT91_DATAFLASH=y 373 + # CONFIG_MTD_AT91_DATAFLASH_CARD is not set 374 375 # 376 # NAND Flash Device Drivers
-13
arch/arm/kernel/armksyms.c
··· 100 #endif 101 102 /* string / mem functions */ 103 - EXPORT_SYMBOL(strcpy); 104 - EXPORT_SYMBOL(strncpy); 105 - EXPORT_SYMBOL(strcat); 106 - EXPORT_SYMBOL(strncat); 107 - EXPORT_SYMBOL(strcmp); 108 - EXPORT_SYMBOL(strncmp); 109 EXPORT_SYMBOL(strchr); 110 - EXPORT_SYMBOL(strlen); 111 - EXPORT_SYMBOL(strnlen); 112 EXPORT_SYMBOL(strpbrk); 113 EXPORT_SYMBOL(strrchr); 114 - EXPORT_SYMBOL(strstr); 115 EXPORT_SYMBOL(memset); 116 EXPORT_SYMBOL(memcpy); 117 EXPORT_SYMBOL(memmove); 118 - EXPORT_SYMBOL(memcmp); 119 - EXPORT_SYMBOL(memscan); 120 EXPORT_SYMBOL(memchr); 121 EXPORT_SYMBOL(__memzero); 122 ··· 179 180 /* syscalls */ 181 EXPORT_SYMBOL(sys_write); 182 - EXPORT_SYMBOL(sys_read); 183 EXPORT_SYMBOL(sys_lseek); 184 - EXPORT_SYMBOL(sys_open); 185 EXPORT_SYMBOL(sys_exit); 186 EXPORT_SYMBOL(sys_wait4);
··· 100 #endif 101 102 /* string / mem functions */ 103 EXPORT_SYMBOL(strchr); 104 EXPORT_SYMBOL(strpbrk); 105 EXPORT_SYMBOL(strrchr); 106 EXPORT_SYMBOL(memset); 107 EXPORT_SYMBOL(memcpy); 108 EXPORT_SYMBOL(memmove); 109 EXPORT_SYMBOL(memchr); 110 EXPORT_SYMBOL(__memzero); 111 ··· 190 191 /* syscalls */ 192 EXPORT_SYMBOL(sys_write); 193 EXPORT_SYMBOL(sys_lseek); 194 EXPORT_SYMBOL(sys_exit); 195 EXPORT_SYMBOL(sys_wait4);
+3
arch/arm/kernel/setup.c
··· 252 dump_cache("cache", cpu, CACHE_ISIZE(info)); 253 } 254 } 255 } 256 257 int cpu_architecture(void)
··· 252 dump_cache("cache", cpu, CACHE_ISIZE(info)); 253 } 254 } 255 + 256 + if (arch_is_coherent()) 257 + printk("Cache coherency enabled\n"); 258 } 259 260 int cpu_architecture(void)
+5 -4
arch/arm/mach-at91rm9200/Makefile
··· 16 #obj-$(CONFIG_MACH_KB9200) += board-kb9202.o 17 18 # LEDs support 19 - #led-$(CONFIG_ARCH_AT91RM9200DK) += leds.o 20 - #led-$(CONFIG_MACH_AT91RM9200EK) += leds.o 21 - #led-$(CONFIG_MACH_CSB337) += leds.o 22 - #led-$(CONFIG_MACH_CSB637) += leds.o 23 #led-$(CONFIG_MACH_KB9200) += leds.o 24 obj-$(CONFIG_LEDS) += $(led-y) 25 26 # VGA support
··· 16 #obj-$(CONFIG_MACH_KB9200) += board-kb9202.o 17 18 # LEDs support 19 + led-$(CONFIG_ARCH_AT91RM9200DK) += leds.o 20 + led-$(CONFIG_MACH_AT91RM9200EK) += leds.o 21 + led-$(CONFIG_MACH_CSB337) += leds.o 22 + led-$(CONFIG_MACH_CSB637) += leds.o 23 #led-$(CONFIG_MACH_KB9200) += leds.o 24 + #led-$(CONFIG_MACH_KAFA) += leds.o 25 obj-$(CONFIG_LEDS) += $(led-y) 26 27 # VGA support
+3
arch/arm/mach-at91rm9200/board-csb337.c
··· 67 /* Initialize clocks: 3.6864 MHz crystal */ 68 at91_clock_init(3686400); 69 70 #ifdef CONFIG_SERIAL_AT91 71 at91_console_port = CSB337_SERIAL_CONSOLE; 72 memcpy(at91_serial_map, serial, sizeof(serial));
··· 67 /* Initialize clocks: 3.6864 MHz crystal */ 68 at91_clock_init(3686400); 69 70 + /* Setup the LEDs */ 71 + at91_init_leds(AT91_PIN_PB2, AT91_PIN_PB2); 72 + 73 #ifdef CONFIG_SERIAL_AT91 74 at91_console_port = CSB337_SERIAL_CONSOLE; 75 memcpy(at91_serial_map, serial, sizeof(serial));
+3
arch/arm/mach-at91rm9200/board-csb637.c
··· 67 /* Initialize clocks: 3.6864 MHz crystal */ 68 at91_clock_init(3686400); 69 70 #ifdef CONFIG_SERIAL_AT91 71 at91_console_port = CSB637_SERIAL_CONSOLE; 72 memcpy(at91_serial_map, serial, sizeof(serial));
··· 67 /* Initialize clocks: 3.6864 MHz crystal */ 68 at91_clock_init(3686400); 69 70 + /* Setup the LEDs */ 71 + at91_init_leds(AT91_PIN_PB2, AT91_PIN_PB2); 72 + 73 #ifdef CONFIG_SERIAL_AT91 74 at91_console_port = CSB637_SERIAL_CONSOLE; 75 memcpy(at91_serial_map, serial, sizeof(serial));
+9 -1
arch/arm/mach-at91rm9200/board-dk.c
··· 70 /* Initialize clocks: 18.432 MHz crystal */ 71 at91_clock_init(18432000); 72 73 #ifdef CONFIG_SERIAL_AT91 74 at91_console_port = DK_SERIAL_CONSOLE; 75 memcpy(at91_serial_map, serial, sizeof(serial)); ··· 121 at91_add_device_udc(&dk_udc_data); 122 /* Compact Flash */ 123 at91_add_device_cf(&dk_cf_data); 124 /* MMC */ 125 - at91_set_gpio_output(AT91_PIN_PB7, 1); /* this MMC card slot can optionally use SPI signaling (CS3). default: MMC */ 126 at91_add_device_mmc(&dk_mmc_data); 127 /* VGA */ 128 // dk_add_device_video(); 129 }
··· 70 /* Initialize clocks: 18.432 MHz crystal */ 71 at91_clock_init(18432000); 72 73 + /* Setup the LEDs */ 74 + at91_init_leds(AT91_PIN_PB2, AT91_PIN_PB2); 75 + 76 #ifdef CONFIG_SERIAL_AT91 77 at91_console_port = DK_SERIAL_CONSOLE; 78 memcpy(at91_serial_map, serial, sizeof(serial)); ··· 118 at91_add_device_udc(&dk_udc_data); 119 /* Compact Flash */ 120 at91_add_device_cf(&dk_cf_data); 121 + #ifdef CONFIG_MTD_AT91_DATAFLASH_CARD 122 + /* DataFlash card */ 123 + at91_set_gpio_output(AT91_PIN_PB7, 0); 124 + #else 125 /* MMC */ 126 + at91_set_gpio_output(AT91_PIN_PB7, 1); /* this MMC card slot can optionally use SPI signaling (CS3). */ 127 at91_add_device_mmc(&dk_mmc_data); 128 + #endif 129 /* VGA */ 130 // dk_add_device_video(); 131 }
+9 -1
arch/arm/mach-at91rm9200/board-ek.c
··· 70 /* Initialize clocks: 18.432 MHz crystal */ 71 at91_clock_init(18432000); 72 73 #ifdef CONFIG_SERIAL_AT91 74 at91_console_port = EK_SERIAL_CONSOLE; 75 memcpy(at91_serial_map, serial, sizeof(serial)); ··· 114 at91_add_device_usbh(&ek_usbh_data); 115 /* USB Device */ 116 at91_add_device_udc(&ek_udc_data); 117 /* MMC */ 118 - at91_set_gpio_output(AT91_PIN_PB22, 1); /* this MMC card slot can optionally use SPI signaling (CS3). default: MMC */ 119 at91_add_device_mmc(&ek_mmc_data); 120 /* VGA */ 121 // ek_add_device_video(); 122 }
··· 70 /* Initialize clocks: 18.432 MHz crystal */ 71 at91_clock_init(18432000); 72 73 + /* Setup the LEDs */ 74 + at91_init_leds(AT91_PIN_PB1, AT91_PIN_PB2); 75 + 76 #ifdef CONFIG_SERIAL_AT91 77 at91_console_port = EK_SERIAL_CONSOLE; 78 memcpy(at91_serial_map, serial, sizeof(serial)); ··· 111 at91_add_device_usbh(&ek_usbh_data); 112 /* USB Device */ 113 at91_add_device_udc(&ek_udc_data); 114 + #ifdef CONFIG_MTD_AT91_DATAFLASH_CARD 115 + /* DataFlash card */ 116 + at91_set_gpio_output(AT91_PIN_PB22, 0); 117 + #else 118 /* MMC */ 119 + at91_set_gpio_output(AT91_PIN_PB22, 1); /* this MMC card slot can optionally use SPI signaling (CS3). */ 120 at91_add_device_mmc(&ek_mmc_data); 121 + #endif 122 /* VGA */ 123 // ek_add_device_video(); 124 }
+146 -8
arch/arm/mach-at91rm9200/devices.c
··· 28 static u64 ohci_dmamask = 0xffffffffUL; 29 static struct at91_usbh_data usbh_data; 30 31 - static struct resource at91rm9200_usbh_resource[] = { 32 [0] = { 33 .start = AT91_UHP_BASE, 34 - .end = AT91_UHP_BASE + SZ_1M -1, 35 .flags = IORESOURCE_MEM, 36 }, 37 [1] = { ··· 49 .coherent_dma_mask = 0xffffffff, 50 .platform_data = &usbh_data, 51 }, 52 - .resource = at91rm9200_usbh_resource, 53 - .num_resources = ARRAY_SIZE(at91rm9200_usbh_resource), 54 }; 55 56 void __init at91_add_device_usbh(struct at91_usbh_data *data) ··· 121 static u64 eth_dmamask = 0xffffffffUL; 122 static struct at91_eth_data eth_data; 123 124 static struct platform_device at91rm9200_eth_device = { 125 .name = "at91_ether", 126 .id = -1, ··· 142 .coherent_dma_mask = 0xffffffff, 143 .platform_data = &eth_data, 144 }, 145 - .num_resources = 0, 146 }; 147 148 void __init at91_add_device_eth(struct at91_eth_data *data) ··· 238 static struct at91_mmc_data mmc_data; 239 240 static struct resource at91_mmc_resources[] = { 241 - { 242 .start = AT91_BASE_MCI, 243 .end = AT91_BASE_MCI + SZ_16K - 1, 244 .flags = IORESOURCE_MEM, 245 - } 246 }; 247 248 static struct platform_device at91rm9200_mmc_device = { 249 - .name = "at91rm9200_mci", 250 .id = -1, 251 .dev = { 252 .dma_mask = &mmc_dmamask, ··· 308 #else 309 void __init at91_add_device_mmc(struct at91_mmc_data *data) {} 310 #endif 311 312 /* -------------------------------------------------------------------- */
··· 28 static u64 ohci_dmamask = 0xffffffffUL; 29 static struct at91_usbh_data usbh_data; 30 31 + static struct resource at91_usbh_resource[] = { 32 [0] = { 33 .start = AT91_UHP_BASE, 34 + .end = AT91_UHP_BASE + SZ_1M - 1, 35 .flags = IORESOURCE_MEM, 36 }, 37 [1] = { ··· 49 .coherent_dma_mask = 0xffffffff, 50 .platform_data = &usbh_data, 51 }, 52 + .resource = at91_usbh_resource, 53 + .num_resources = ARRAY_SIZE(at91_usbh_resource), 54 }; 55 56 void __init at91_add_device_usbh(struct at91_usbh_data *data) ··· 121 static u64 eth_dmamask = 0xffffffffUL; 122 static struct at91_eth_data eth_data; 123 124 + static struct resource at91_eth_resources[] = { 125 + [0] = { 126 + .start = AT91_BASE_EMAC, 127 + .end = AT91_BASE_EMAC + SZ_16K - 1, 128 + .flags = IORESOURCE_MEM, 129 + }, 130 + [1] = { 131 + .start = AT91_ID_EMAC, 132 + .end = AT91_ID_EMAC, 133 + .flags = IORESOURCE_IRQ, 134 + }, 135 + }; 136 + 137 static struct platform_device at91rm9200_eth_device = { 138 .name = "at91_ether", 139 .id = -1, ··· 129 .coherent_dma_mask = 0xffffffff, 130 .platform_data = &eth_data, 131 }, 132 + .resource = at91_eth_resources, 133 + .num_resources = ARRAY_SIZE(at91_eth_resources), 134 }; 135 136 void __init at91_add_device_eth(struct at91_eth_data *data) ··· 224 static struct at91_mmc_data mmc_data; 225 226 static struct resource at91_mmc_resources[] = { 227 + [0] = { 228 .start = AT91_BASE_MCI, 229 .end = AT91_BASE_MCI + SZ_16K - 1, 230 .flags = IORESOURCE_MEM, 231 + }, 232 + [1] = { 233 + .start = AT91_ID_MCI, 234 + .end = AT91_ID_MCI, 235 + .flags = IORESOURCE_IRQ, 236 + }, 237 }; 238 239 static struct platform_device at91rm9200_mmc_device = { 240 + .name = "at91_mci", 241 .id = -1, 242 .dev = { 243 .dma_mask = &mmc_dmamask, ··· 289 #else 290 void __init at91_add_device_mmc(struct at91_mmc_data *data) {} 291 #endif 292 + 293 + /* -------------------------------------------------------------------- 294 + * NAND / SmartMedia 295 + * -------------------------------------------------------------------- */ 296 + 297 + #if defined(CONFIG_MTD_NAND_AT91) || defined(CONFIG_MTD_NAND_AT91_MODULE) 298 + static struct at91_nand_data nand_data; 299 + 300 + static struct resource at91_nand_resources[] = { 301 + { 302 + .start = AT91_SMARTMEDIA_BASE, 303 + .end = AT91_SMARTMEDIA_BASE + SZ_8M - 1, 304 + .flags = IORESOURCE_MEM, 305 + } 306 + }; 307 + 308 + static struct platform_device at91_nand_device = { 309 + .name = "at91_nand", 310 + .id = -1, 311 + .dev = { 312 + .platform_data = &nand_data, 313 + }, 314 + .resource = at91_nand_resources, 315 + .num_resources = ARRAY_SIZE(at91_nand_resources), 316 + }; 317 + 318 + void __init at91_add_device_nand(struct at91_nand_data *data) 319 + { 320 + if (!data) 321 + return; 322 + 323 + /* enable pin */ 324 + if (data->enable_pin) 325 + at91_set_gpio_output(data->enable_pin, 1); 326 + 327 + /* ready/busy pin */ 328 + if (data->rdy_pin) 329 + at91_set_gpio_input(data->rdy_pin, 1); 330 + 331 + /* card detect pin */ 332 + if (data->det_pin) 333 + at91_set_gpio_input(data->det_pin, 1); 334 + 335 + at91_set_A_periph(AT91_PIN_PC1, 0); /* SMOE */ 336 + at91_set_A_periph(AT91_PIN_PC3, 0); /* SMWE */ 337 + 338 + nand_data = *data; 339 + platform_device_register(&at91_nand_device); 340 + } 341 + #else 342 + void __init at91_add_device_nand(struct at91_nand_data *data) {} 343 + #endif 344 + 345 + 346 + /* -------------------------------------------------------------------- 347 + * TWI (i2c) 348 + * -------------------------------------------------------------------- */ 349 + 350 + #if defined(CONFIG_I2C_AT91) || defined(CONFIG_I2C_AT91_MODULE) 351 + static struct platform_device at91rm9200_twi_device = { 352 + .name = "at91_i2c", 353 + .id = -1, 354 + .num_resources = 0, 355 + }; 356 + 357 + void __init at91_add_device_i2c(void) 358 + { 359 + /* pins used for TWI interface */ 360 + at91_set_A_periph(AT91_PIN_PA25, 0); /* TWD */ 361 + at91_set_multi_drive(AT91_PIN_PA25, 1); 362 + 363 + at91_set_A_periph(AT91_PIN_PA26, 0); /* TWCK */ 364 + at91_set_multi_drive(AT91_PIN_PA26, 1); 365 + 366 + platform_device_register(&at91rm9200_twi_device); 367 + } 368 + #else 369 + void __init at91_add_device_i2c(void) {} 370 + #endif 371 + 372 + 373 + /* -------------------------------------------------------------------- 374 + * RTC 375 + * -------------------------------------------------------------------- */ 376 + 377 + #if defined(CONFIG_AT91_RTC) || defined(CONFIG_AT91_RTC_MODULE) 378 + static struct platform_device at91rm9200_rtc_device = { 379 + .name = "at91_rtc", 380 + .id = -1, 381 + .num_resources = 0, 382 + }; 383 + 384 + void __init at91_add_device_rtc(void) 385 + { 386 + platform_device_register(&at91rm9200_rtc_device); 387 + } 388 + #else 389 + void __init at91_add_device_rtc(void) {} 390 + #endif 391 + 392 + 393 + /* -------------------------------------------------------------------- 394 + * LEDs 395 + * -------------------------------------------------------------------- */ 396 + 397 + #if defined(CONFIG_LEDS) 398 + u8 at91_leds_cpu; 399 + u8 at91_leds_timer; 400 + 401 + void __init at91_init_leds(u8 cpu_led, u8 timer_led) 402 + { 403 + at91_leds_cpu = cpu_led; 404 + at91_leds_timer = timer_led; 405 + } 406 + 407 + #else 408 + void __init at91_init_leds(u8 cpu_led, u8 timer_led) {} 409 + #endif 410 + 411 412 /* -------------------------------------------------------------------- */
+100
arch/arm/mach-at91rm9200/leds.c
···
··· 1 + /* 2 + * LED driver for Atmel AT91-based boards. 3 + * 4 + * Copyright (C) SAN People (Pty) Ltd 5 + * 6 + * This program is free software; you can redistribute it and/or 7 + * modify it under the terms of the GNU General Public License 8 + * as published by the Free Software Foundation; either version 9 + * 2 of the License, or (at your option) any later version. 10 + */ 11 + 12 + #include <linux/config.h> 13 + #include <linux/kernel.h> 14 + #include <linux/module.h> 15 + #include <linux/init.h> 16 + 17 + #include <asm/mach-types.h> 18 + #include <asm/leds.h> 19 + #include <asm/arch/board.h> 20 + #include <asm/arch/gpio.h> 21 + 22 + 23 + static inline void at91_led_on(unsigned int led) 24 + { 25 + at91_set_gpio_value(led, 0); 26 + } 27 + 28 + static inline void at91_led_off(unsigned int led) 29 + { 30 + at91_set_gpio_value(led, 1); 31 + } 32 + 33 + static inline void at91_led_toggle(unsigned int led) 34 + { 35 + unsigned long is_off = at91_get_gpio_value(led); 36 + if (is_off) 37 + at91_led_on(led); 38 + else 39 + at91_led_off(led); 40 + } 41 + 42 + 43 + /* 44 + * Handle LED events. 45 + */ 46 + static void at91_leds_event(led_event_t evt) 47 + { 48 + unsigned long flags; 49 + 50 + local_irq_save(flags); 51 + 52 + switch(evt) { 53 + case led_start: /* System startup */ 54 + at91_led_on(at91_leds_cpu); 55 + break; 56 + 57 + case led_stop: /* System stop / suspend */ 58 + at91_led_off(at91_leds_cpu); 59 + break; 60 + 61 + #ifdef CONFIG_LEDS_TIMER 62 + case led_timer: /* Every 50 timer ticks */ 63 + at91_led_toggle(at91_leds_timer); 64 + break; 65 + #endif 66 + 67 + #ifdef CONFIG_LEDS_CPU 68 + case led_idle_start: /* Entering idle state */ 69 + at91_led_off(at91_leds_cpu); 70 + break; 71 + 72 + case led_idle_end: /* Exit idle state */ 73 + at91_led_on(at91_leds_cpu); 74 + break; 75 + #endif 76 + 77 + default: 78 + break; 79 + } 80 + 81 + local_irq_restore(flags); 82 + } 83 + 84 + 85 + static int __init leds_init(void) 86 + { 87 + if (!at91_leds_timer || !at91_leds_cpu) 88 + return -ENODEV; 89 + 90 + /* Enable PIO to access the LEDs */ 91 + at91_set_gpio_output(at91_leds_timer, 1); 92 + at91_set_gpio_output(at91_leds_cpu, 1); 93 + 94 + leds_event = at91_leds_event; 95 + 96 + leds_event(led_start); 97 + return 0; 98 + } 99 + 100 + __initcall(leds_init);
+10
arch/arm/mach-ep93xx/core.c
··· 424 .periphid = 0x00041010, 425 }; 426 427 void __init ep93xx_init_devices(void) 428 { 429 unsigned int v; ··· 447 amba_device_register(&uart1_device, &iomem_resource); 448 amba_device_register(&uart2_device, &iomem_resource); 449 amba_device_register(&uart3_device, &iomem_resource); 450 }
··· 424 .periphid = 0x00041010, 425 }; 426 427 + 428 + static struct platform_device ep93xx_rtc_device = { 429 + .name = "ep93xx-rtc", 430 + .id = -1, 431 + .num_resources = 0, 432 + }; 433 + 434 + 435 void __init ep93xx_init_devices(void) 436 { 437 unsigned int v; ··· 439 amba_device_register(&uart1_device, &iomem_resource); 440 amba_device_register(&uart2_device, &iomem_resource); 441 amba_device_register(&uart3_device, &iomem_resource); 442 + 443 + platform_device_register(&ep93xx_rtc_device); 444 }
+39
arch/arm/mach-ep93xx/ts72xx.c
··· 17 #include <linux/sched.h> 18 #include <linux/interrupt.h> 19 #include <linux/mtd/physmap.h> 20 #include <asm/io.h> 21 #include <asm/hardware.h> 22 #include <asm/mach-types.h> ··· 40 .virtual = TS72XX_OPTIONS2_VIRT_BASE, 41 .pfn = __phys_to_pfn(TS72XX_OPTIONS2_PHYS_BASE), 42 .length = TS72XX_OPTIONS2_SIZE, 43 .type = MT_DEVICE, 44 } 45 }; ··· 111 } 112 } 113 114 static void __init ts72xx_init_machine(void) 115 { 116 ep93xx_init_devices(); 117 if (board_is_ts7200()) 118 physmap_configure(TS72XX_NOR_PHYS_BASE, 0x01000000, 1, NULL); 119 } 120 121 MACHINE_START(TS72XX, "Technologic Systems TS-72xx SBC")
··· 17 #include <linux/sched.h> 18 #include <linux/interrupt.h> 19 #include <linux/mtd/physmap.h> 20 + #include <linux/platform_device.h> 21 + #include <linux/m48t86.h> 22 #include <asm/io.h> 23 #include <asm/hardware.h> 24 #include <asm/mach-types.h> ··· 38 .virtual = TS72XX_OPTIONS2_VIRT_BASE, 39 .pfn = __phys_to_pfn(TS72XX_OPTIONS2_PHYS_BASE), 40 .length = TS72XX_OPTIONS2_SIZE, 41 + .type = MT_DEVICE, 42 + }, { 43 + .virtual = TS72XX_RTC_INDEX_VIRT_BASE, 44 + .pfn = __phys_to_pfn(TS72XX_RTC_INDEX_PHYS_BASE), 45 + .length = TS72XX_RTC_INDEX_SIZE, 46 + .type = MT_DEVICE, 47 + }, { 48 + .virtual = TS72XX_RTC_DATA_VIRT_BASE, 49 + .pfn = __phys_to_pfn(TS72XX_RTC_DATA_PHYS_BASE), 50 + .length = TS72XX_RTC_DATA_SIZE, 51 .type = MT_DEVICE, 52 } 53 }; ··· 99 } 100 } 101 102 + static unsigned char ts72xx_rtc_readb(unsigned long addr) 103 + { 104 + __raw_writeb(addr, TS72XX_RTC_INDEX_VIRT_BASE); 105 + return __raw_readb(TS72XX_RTC_DATA_VIRT_BASE); 106 + } 107 + 108 + static void ts72xx_rtc_writeb(unsigned char value, unsigned long addr) 109 + { 110 + __raw_writeb(addr, TS72XX_RTC_INDEX_VIRT_BASE); 111 + __raw_writeb(value, TS72XX_RTC_DATA_VIRT_BASE); 112 + } 113 + 114 + static struct m48t86_ops ts72xx_rtc_ops = { 115 + .readb = ts72xx_rtc_readb, 116 + .writeb = ts72xx_rtc_writeb, 117 + }; 118 + 119 + static struct platform_device ts72xx_rtc_device = { 120 + .name = "rtc-m48t86", 121 + .id = -1, 122 + .dev = { 123 + .platform_data = &ts72xx_rtc_ops, 124 + }, 125 + .num_resources = 0, 126 + }; 127 + 128 static void __init ts72xx_init_machine(void) 129 { 130 ep93xx_init_devices(); 131 if (board_is_ts7200()) 132 physmap_configure(TS72XX_NOR_PHYS_BASE, 0x01000000, 1, NULL); 133 + platform_device_register(&ts72xx_rtc_device); 134 } 135 136 MACHINE_START(TS72XX, "Technologic Systems TS-72xx SBC")
+453 -68
arch/arm/mach-imx/dma.c
··· 7 * it under the terms of the GNU General Public License version 2 as 8 * published by the Free Software Foundation. 9 * 10 - * 03/03/2004 Sascha Hauer <sascha@saschahauer.de> 11 * initial version heavily inspired by 12 * linux/arch/arm/mach-pxa/dma.c 13 */ 14 15 #include <linux/module.h> 16 #include <linux/init.h> ··· 29 #include <asm/irq.h> 30 #include <asm/hardware.h> 31 #include <asm/dma.h> 32 33 - static struct dma_channel { 34 - char *name; 35 - void (*irq_handler) (int, void *, struct pt_regs *); 36 - void (*err_handler) (int, void *, struct pt_regs *); 37 - void *data; 38 - } dma_channels[11]; 39 40 - /* set err_handler to NULL to have the standard info-only error handler */ 41 - int 42 - imx_request_dma(char *name, imx_dma_prio prio, 43 - void (*irq_handler) (int, void *, struct pt_regs *), 44 - void (*err_handler) (int, void *, struct pt_regs *), void *data) 45 { 46 - unsigned long flags; 47 - int i, found = 0; 48 49 - /* basic sanity checks */ 50 - if (!name || !irq_handler) 51 - return -EINVAL; 52 53 - local_irq_save(flags); 54 55 - /* try grabbing a DMA channel with the requested priority */ 56 - for (i = prio; i < prio + (prio == DMA_PRIO_LOW) ? 8 : 4; i++) { 57 - if (!dma_channels[i].name) { 58 - found = 1; 59 - break; 60 } 61 } 62 63 - if (!found) { 64 - /* requested prio group is full, try hier priorities */ 65 - for (i = prio - 1; i >= 0; i--) { 66 - if (!dma_channels[i].name) { 67 - found = 1; 68 - break; 69 - } 70 - } 71 - } 72 73 - if (found) { 74 - DIMR &= ~(1 << i); 75 - dma_channels[i].name = name; 76 - dma_channels[i].irq_handler = irq_handler; 77 - dma_channels[i].err_handler = err_handler; 78 - dma_channels[i].data = data; 79 - } else { 80 - printk(KERN_WARNING "No more available DMA channels for %s\n", 81 - name); 82 - i = -ENODEV; 83 - } 84 85 - local_irq_restore(flags); 86 - return i; 87 } 88 89 - void 90 - imx_free_dma(int dma_ch) 91 { 92 unsigned long flags; 93 94 - if (!dma_channels[dma_ch].name) { 95 printk(KERN_CRIT 96 "%s: trying to free channel %d which is already freed\n", 97 __FUNCTION__, dma_ch); ··· 398 } 399 400 local_irq_save(flags); 401 - DIMR &= ~(1 << dma_ch); 402 - dma_channels[dma_ch].name = NULL; 403 local_irq_restore(flags); 404 } 405 406 - static irqreturn_t 407 - dma_err_handler(int irq, void *dev_id, struct pt_regs *regs) 408 { 409 int i, disr = DISR; 410 - struct dma_channel *channel; 411 unsigned int err_mask = DBTOSR | DRTOSR | DSESR | DBOSR; 412 413 DISR = disr; 414 - for (i = 0; i < 11; i++) { 415 - channel = &dma_channels[i]; 416 417 - if ( (err_mask & 1<<i) && channel->name && channel->err_handler) { 418 channel->err_handler(i, channel->data, regs); 419 continue; 420 } 421 422 if (DBTOSR & (1 << i)) { 423 printk(KERN_WARNING ··· 504 return IRQ_HANDLED; 505 } 506 507 - static irqreturn_t 508 - dma_irq_handler(int irq, void *dev_id, struct pt_regs *regs) 509 { 510 int i, disr = DISR; 511 512 DISR = disr; 513 - for (i = 0; i < 11; i++) { 514 if (disr & (1 << i)) { 515 - struct dma_channel *channel = &dma_channels[i]; 516 - if (channel->name && channel->irq_handler) { 517 - channel->irq_handler(i, channel->data, regs); 518 } else { 519 /* 520 * IRQ for an unregistered DMA channel: ··· 538 return IRQ_HANDLED; 539 } 540 541 - static int __init 542 - imx_dma_init(void) 543 { 544 int ret; 545 546 /* reset DMA module */ 547 DCR = DCR_DRST; ··· 562 DCR = DCR_DEN; 563 564 /* clear all interrupts */ 565 - DISR = 0x3ff; 566 567 /* enable interrupts */ 568 - DIMR = 0; 569 570 return ret; 571 } 572 573 arch_initcall(imx_dma_init); 574 575 - EXPORT_SYMBOL(imx_request_dma); 576 - EXPORT_SYMBOL(imx_free_dma);
··· 7 * it under the terms of the GNU General Public License version 2 as 8 * published by the Free Software Foundation. 9 * 10 + * 2004-03-03 Sascha Hauer <sascha@saschahauer.de> 11 * initial version heavily inspired by 12 * linux/arch/arm/mach-pxa/dma.c 13 + * 14 + * 2005-04-17 Pavel Pisa <pisa@cmp.felk.cvut.cz> 15 + * Changed to support scatter gather DMA 16 + * by taking Russell's code from RiscPC 17 + * 18 */ 19 + 20 + #undef DEBUG 21 22 #include <linux/module.h> 23 #include <linux/init.h> ··· 22 #include <asm/irq.h> 23 #include <asm/hardware.h> 24 #include <asm/dma.h> 25 + #include <asm/arch/imx-dma.h> 26 27 + struct imx_dma_channel imx_dma_channels[IMX_DMA_CHANNELS]; 28 29 + /* 30 + * imx_dma_sg_next - prepare next chunk for scatter-gather DMA emulation 31 + * @dma_ch: i.MX DMA channel number 32 + * @lastcount: number of bytes transferred during last transfer 33 + * 34 + * Functions prepares DMA controller for next sg data chunk transfer. 35 + * The @lastcount argument informs function about number of bytes transferred 36 + * during last block. Zero value can be used for @lastcount to setup DMA 37 + * for the first chunk. 38 + */ 39 + static inline int imx_dma_sg_next(imx_dmach_t dma_ch, unsigned int lastcount) 40 { 41 + struct imx_dma_channel *imxdma = &imx_dma_channels[dma_ch]; 42 + unsigned int nextcount; 43 + unsigned int nextaddr; 44 45 + if (!imxdma->name) { 46 + printk(KERN_CRIT "%s: called for not allocated channel %d\n", 47 + __FUNCTION__, dma_ch); 48 + return 0; 49 + } 50 51 + imxdma->resbytes -= lastcount; 52 53 + if (!imxdma->sg) { 54 + pr_debug("imxdma%d: no sg data\n", dma_ch); 55 + return 0; 56 + } 57 + 58 + imxdma->sgbc += lastcount; 59 + if ((imxdma->sgbc >= imxdma->sg->length) || !imxdma->resbytes) { 60 + if ((imxdma->sgcount <= 1) || !imxdma->resbytes) { 61 + pr_debug("imxdma%d: sg transfer limit reached\n", 62 + dma_ch); 63 + imxdma->sgcount=0; 64 + imxdma->sg = NULL; 65 + return 0; 66 + } else { 67 + imxdma->sgcount--; 68 + imxdma->sg++; 69 + imxdma->sgbc = 0; 70 } 71 } 72 + nextcount = imxdma->sg->length - imxdma->sgbc; 73 + nextaddr = imxdma->sg->dma_address + imxdma->sgbc; 74 75 + if(imxdma->resbytes < nextcount) 76 + nextcount = imxdma->resbytes; 77 78 + if ((imxdma->dma_mode & DMA_MODE_MASK) == DMA_MODE_READ) 79 + DAR(dma_ch) = nextaddr; 80 + else 81 + SAR(dma_ch) = nextaddr; 82 83 + CNTR(dma_ch) = nextcount; 84 + pr_debug("imxdma%d: next sg chunk dst 0x%08x, src 0x%08x, size 0x%08x\n", 85 + dma_ch, DAR(dma_ch), SAR(dma_ch), CNTR(dma_ch)); 86 + 87 + return nextcount; 88 } 89 90 + /* 91 + * imx_dma_setup_sg_base - scatter-gather DMA emulation 92 + * @dma_ch: i.MX DMA channel number 93 + * @sg: pointer to the scatter-gather list/vector 94 + * @sgcount: scatter-gather list hungs count 95 + * 96 + * Functions sets up i.MX DMA state for emulated scatter-gather transfer 97 + * and sets up channel registers to be ready for the first chunk 98 + */ 99 + static int 100 + imx_dma_setup_sg_base(imx_dmach_t dma_ch, 101 + struct scatterlist *sg, unsigned int sgcount) 102 + { 103 + struct imx_dma_channel *imxdma = &imx_dma_channels[dma_ch]; 104 + 105 + imxdma->sg = sg; 106 + imxdma->sgcount = sgcount; 107 + imxdma->sgbc = 0; 108 + return imx_dma_sg_next(dma_ch, 0); 109 + } 110 + 111 + /** 112 + * imx_dma_setup_single - setup i.MX DMA channel for linear memory to/from device transfer 113 + * @dma_ch: i.MX DMA channel number 114 + * @dma_address: the DMA/physical memory address of the linear data block 115 + * to transfer 116 + * @dma_length: length of the data block in bytes 117 + * @dev_addr: physical device port address 118 + * @dmamode: DMA transfer mode, %DMA_MODE_READ from the device to the memory 119 + * or %DMA_MODE_WRITE from memory to the device 120 + * 121 + * The function setups DMA channel source and destination addresses for transfer 122 + * specified by provided parameters. The scatter-gather emulation is disabled, 123 + * because linear data block 124 + * form the physical address range is transfered. 125 + * Return value: if incorrect parameters are provided -%EINVAL. 126 + * Zero indicates success. 127 + */ 128 + int 129 + imx_dma_setup_single(imx_dmach_t dma_ch, dma_addr_t dma_address, 130 + unsigned int dma_length, unsigned int dev_addr, 131 + dmamode_t dmamode) 132 + { 133 + struct imx_dma_channel *imxdma = &imx_dma_channels[dma_ch]; 134 + 135 + imxdma->sg = NULL; 136 + imxdma->sgcount = 0; 137 + imxdma->dma_mode = dmamode; 138 + imxdma->resbytes = dma_length; 139 + 140 + if (!dma_address) { 141 + printk(KERN_ERR "imxdma%d: imx_dma_setup_single null address\n", 142 + dma_ch); 143 + return -EINVAL; 144 + } 145 + 146 + if (!dma_length) { 147 + printk(KERN_ERR "imxdma%d: imx_dma_setup_single zero length\n", 148 + dma_ch); 149 + return -EINVAL; 150 + } 151 + 152 + if ((dmamode & DMA_MODE_MASK) == DMA_MODE_READ) { 153 + pr_debug("imxdma%d: mx_dma_setup_single2dev dma_addressg=0x%08x dma_length=%d dev_addr=0x%08x for read\n", 154 + dma_ch, (unsigned int)dma_address, dma_length, 155 + dev_addr); 156 + SAR(dma_ch) = dev_addr; 157 + DAR(dma_ch) = (unsigned int)dma_address; 158 + } else if ((dmamode & DMA_MODE_MASK) == DMA_MODE_WRITE) { 159 + pr_debug("imxdma%d: mx_dma_setup_single2dev dma_addressg=0x%08x dma_length=%d dev_addr=0x%08x for write\n", 160 + dma_ch, (unsigned int)dma_address, dma_length, 161 + dev_addr); 162 + SAR(dma_ch) = (unsigned int)dma_address; 163 + DAR(dma_ch) = dev_addr; 164 + } else { 165 + printk(KERN_ERR "imxdma%d: imx_dma_setup_single bad dmamode\n", 166 + dma_ch); 167 + return -EINVAL; 168 + } 169 + 170 + CNTR(dma_ch) = dma_length; 171 + 172 + return 0; 173 + } 174 + 175 + /** 176 + * imx_dma_setup_sg - setup i.MX DMA channel SG list to/from device transfer 177 + * @dma_ch: i.MX DMA channel number 178 + * @sg: pointer to the scatter-gather list/vector 179 + * @sgcount: scatter-gather list hungs count 180 + * @dma_length: total length of the transfer request in bytes 181 + * @dev_addr: physical device port address 182 + * @dmamode: DMA transfer mode, %DMA_MODE_READ from the device to the memory 183 + * or %DMA_MODE_WRITE from memory to the device 184 + * 185 + * The function setups DMA channel state and registers to be ready for transfer 186 + * specified by provided parameters. The scatter-gather emulation is set up 187 + * according to the parameters. 188 + * 189 + * The full preparation of the transfer requires setup of more register 190 + * by the caller before imx_dma_enable() can be called. 191 + * 192 + * %BLR(dma_ch) holds transfer burst length in bytes, 0 means 64 bytes 193 + * 194 + * %RSSR(dma_ch) has to be set to the DMA request line source %DMA_REQ_xxx 195 + * 196 + * %CCR(dma_ch) has to specify transfer parameters, the next settings is typical 197 + * for linear or simple scatter-gather transfers if %DMA_MODE_READ is specified 198 + * 199 + * %CCR_DMOD_LINEAR | %CCR_DSIZ_32 | %CCR_SMOD_FIFO | %CCR_SSIZ_x 200 + * 201 + * The typical setup for %DMA_MODE_WRITE is specified by next options combination 202 + * 203 + * %CCR_SMOD_LINEAR | %CCR_SSIZ_32 | %CCR_DMOD_FIFO | %CCR_DSIZ_x 204 + * 205 + * Be carefull there and do not mistakenly mix source and target device 206 + * port sizes constants, they are really different: 207 + * %CCR_SSIZ_8, %CCR_SSIZ_16, %CCR_SSIZ_32, 208 + * %CCR_DSIZ_8, %CCR_DSIZ_16, %CCR_DSIZ_32 209 + * 210 + * Return value: if incorrect parameters are provided -%EINVAL. 211 + * Zero indicates success. 212 + */ 213 + int 214 + imx_dma_setup_sg(imx_dmach_t dma_ch, 215 + struct scatterlist *sg, unsigned int sgcount, unsigned int dma_length, 216 + unsigned int dev_addr, dmamode_t dmamode) 217 + { 218 + int res; 219 + struct imx_dma_channel *imxdma = &imx_dma_channels[dma_ch]; 220 + 221 + imxdma->sg = NULL; 222 + imxdma->sgcount = 0; 223 + imxdma->dma_mode = dmamode; 224 + imxdma->resbytes = dma_length; 225 + 226 + if (!sg || !sgcount) { 227 + printk(KERN_ERR "imxdma%d: imx_dma_setup_sg epty sg list\n", 228 + dma_ch); 229 + return -EINVAL; 230 + } 231 + 232 + if (!sg->length) { 233 + printk(KERN_ERR "imxdma%d: imx_dma_setup_sg zero length\n", 234 + dma_ch); 235 + return -EINVAL; 236 + } 237 + 238 + if ((dmamode & DMA_MODE_MASK) == DMA_MODE_READ) { 239 + pr_debug("imxdma%d: mx_dma_setup_sg2dev sg=%p sgcount=%d total length=%d dev_addr=0x%08x for read\n", 240 + dma_ch, sg, sgcount, dma_length, dev_addr); 241 + SAR(dma_ch) = dev_addr; 242 + } else if ((dmamode & DMA_MODE_MASK) == DMA_MODE_WRITE) { 243 + pr_debug("imxdma%d: mx_dma_setup_sg2dev sg=%p sgcount=%d total length=%d dev_addr=0x%08x for write\n", 244 + dma_ch, sg, sgcount, dma_length, dev_addr); 245 + DAR(dma_ch) = dev_addr; 246 + } else { 247 + printk(KERN_ERR "imxdma%d: imx_dma_setup_sg bad dmamode\n", 248 + dma_ch); 249 + return -EINVAL; 250 + } 251 + 252 + res = imx_dma_setup_sg_base(dma_ch, sg, sgcount); 253 + if (res <= 0) { 254 + printk(KERN_ERR "imxdma%d: no sg chunk ready\n", dma_ch); 255 + return -EINVAL; 256 + } 257 + 258 + return 0; 259 + } 260 + 261 + /** 262 + * imx_dma_setup_handlers - setup i.MX DMA channel end and error notification handlers 263 + * @dma_ch: i.MX DMA channel number 264 + * @irq_handler: the pointer to the function called if the transfer 265 + * ends successfully 266 + * @err_handler: the pointer to the function called if the premature 267 + * end caused by error occurs 268 + * @data: user specified value to be passed to the handlers 269 + */ 270 + int 271 + imx_dma_setup_handlers(imx_dmach_t dma_ch, 272 + void (*irq_handler) (int, void *, struct pt_regs *), 273 + void (*err_handler) (int, void *, struct pt_regs *), 274 + void *data) 275 + { 276 + struct imx_dma_channel *imxdma = &imx_dma_channels[dma_ch]; 277 + unsigned long flags; 278 + 279 + if (!imxdma->name) { 280 + printk(KERN_CRIT "%s: called for not allocated channel %d\n", 281 + __FUNCTION__, dma_ch); 282 + return -ENODEV; 283 + } 284 + 285 + local_irq_save(flags); 286 + DISR = (1 << dma_ch); 287 + imxdma->irq_handler = irq_handler; 288 + imxdma->err_handler = err_handler; 289 + imxdma->data = data; 290 + local_irq_restore(flags); 291 + return 0; 292 + } 293 + 294 + /** 295 + * imx_dma_enable - function to start i.MX DMA channel operation 296 + * @dma_ch: i.MX DMA channel number 297 + * 298 + * The channel has to be allocated by driver through imx_dma_request() 299 + * or imx_dma_request_by_prio() function. 300 + * The transfer parameters has to be set to the channel registers through 301 + * call of the imx_dma_setup_single() or imx_dma_setup_sg() function 302 + * and registers %BLR(dma_ch), %RSSR(dma_ch) and %CCR(dma_ch) has to 303 + * be set prior this function call by the channel user. 304 + */ 305 + void imx_dma_enable(imx_dmach_t dma_ch) 306 + { 307 + struct imx_dma_channel *imxdma = &imx_dma_channels[dma_ch]; 308 + unsigned long flags; 309 + 310 + pr_debug("imxdma%d: imx_dma_enable\n", dma_ch); 311 + 312 + if (!imxdma->name) { 313 + printk(KERN_CRIT "%s: called for not allocated channel %d\n", 314 + __FUNCTION__, dma_ch); 315 + return; 316 + } 317 + 318 + local_irq_save(flags); 319 + DISR = (1 << dma_ch); 320 + DIMR &= ~(1 << dma_ch); 321 + CCR(dma_ch) |= CCR_CEN; 322 + local_irq_restore(flags); 323 + } 324 + 325 + /** 326 + * imx_dma_disable - stop, finish i.MX DMA channel operatin 327 + * @dma_ch: i.MX DMA channel number 328 + */ 329 + void imx_dma_disable(imx_dmach_t dma_ch) 330 { 331 unsigned long flags; 332 333 + pr_debug("imxdma%d: imx_dma_disable\n", dma_ch); 334 + 335 + local_irq_save(flags); 336 + DIMR |= (1 << dma_ch); 337 + CCR(dma_ch) &= ~CCR_CEN; 338 + DISR = (1 << dma_ch); 339 + local_irq_restore(flags); 340 + } 341 + 342 + /** 343 + * imx_dma_request - request/allocate specified channel number 344 + * @dma_ch: i.MX DMA channel number 345 + * @name: the driver/caller own non-%NULL identification 346 + */ 347 + int imx_dma_request(imx_dmach_t dma_ch, const char *name) 348 + { 349 + struct imx_dma_channel *imxdma = &imx_dma_channels[dma_ch]; 350 + unsigned long flags; 351 + 352 + /* basic sanity checks */ 353 + if (!name) 354 + return -EINVAL; 355 + 356 + if (dma_ch >= IMX_DMA_CHANNELS) { 357 + printk(KERN_CRIT "%s: called for non-existed channel %d\n", 358 + __FUNCTION__, dma_ch); 359 + return -EINVAL; 360 + } 361 + 362 + local_irq_save(flags); 363 + if (imxdma->name) { 364 + local_irq_restore(flags); 365 + return -ENODEV; 366 + } 367 + 368 + imxdma->name = name; 369 + imxdma->irq_handler = NULL; 370 + imxdma->err_handler = NULL; 371 + imxdma->data = NULL; 372 + imxdma->sg = NULL; 373 + local_irq_restore(flags); 374 + return 0; 375 + } 376 + 377 + /** 378 + * imx_dma_free - release previously acquired channel 379 + * @dma_ch: i.MX DMA channel number 380 + */ 381 + void imx_dma_free(imx_dmach_t dma_ch) 382 + { 383 + unsigned long flags; 384 + struct imx_dma_channel *imxdma = &imx_dma_channels[dma_ch]; 385 + 386 + if (!imxdma->name) { 387 printk(KERN_CRIT 388 "%s: trying to free channel %d which is already freed\n", 389 __FUNCTION__, dma_ch); ··· 92 } 93 94 local_irq_save(flags); 95 + /* Disable interrupts */ 96 + DIMR |= (1 << dma_ch); 97 + CCR(dma_ch) &= ~CCR_CEN; 98 + imxdma->name = NULL; 99 local_irq_restore(flags); 100 } 101 102 + /** 103 + * imx_dma_request_by_prio - find and request some of free channels best suiting requested priority 104 + * @dma_ch: i.MX DMA channel number 105 + * @name: the driver/caller own non-%NULL identification 106 + * @prio: one of the hardware distinguished priority level: 107 + * %DMA_PRIO_HIGH, %DMA_PRIO_MEDIUM, %DMA_PRIO_LOW 108 + * 109 + * This function tries to find free channel in the specified priority group 110 + * if the priority cannot be achieved it tries to look for free channel 111 + * in the higher and then even lower priority groups. 112 + * 113 + * Return value: If there is no free channel to allocate, -%ENODEV is returned. 114 + * Zero value indicates successful channel allocation. 115 + */ 116 + int 117 + imx_dma_request_by_prio(imx_dmach_t * pdma_ch, const char *name, 118 + imx_dma_prio prio) 119 + { 120 + int i; 121 + int best; 122 + 123 + switch (prio) { 124 + case (DMA_PRIO_HIGH): 125 + best = 8; 126 + break; 127 + case (DMA_PRIO_MEDIUM): 128 + best = 4; 129 + break; 130 + case (DMA_PRIO_LOW): 131 + default: 132 + best = 0; 133 + break; 134 + } 135 + 136 + for (i = best; i < IMX_DMA_CHANNELS; i++) { 137 + if (!imx_dma_request(i, name)) { 138 + *pdma_ch = i; 139 + return 0; 140 + } 141 + } 142 + 143 + for (i = best - 1; i >= 0; i--) { 144 + if (!imx_dma_request(i, name)) { 145 + *pdma_ch = i; 146 + return 0; 147 + } 148 + } 149 + 150 + printk(KERN_ERR "%s: no free DMA channel found\n", __FUNCTION__); 151 + 152 + return -ENODEV; 153 + } 154 + 155 + static irqreturn_t dma_err_handler(int irq, void *dev_id, struct pt_regs *regs) 156 { 157 int i, disr = DISR; 158 + struct imx_dma_channel *channel; 159 unsigned int err_mask = DBTOSR | DRTOSR | DSESR | DBOSR; 160 161 DISR = disr; 162 + for (i = 0; i < IMX_DMA_CHANNELS; i++) { 163 + channel = &imx_dma_channels[i]; 164 165 + if ((err_mask & 1 << i) && channel->name 166 + && channel->err_handler) { 167 channel->err_handler(i, channel->data, regs); 168 continue; 169 } 170 + 171 + imx_dma_channels[i].sg = NULL; 172 173 if (DBTOSR & (1 << i)) { 174 printk(KERN_WARNING ··· 141 return IRQ_HANDLED; 142 } 143 144 + static irqreturn_t dma_irq_handler(int irq, void *dev_id, struct pt_regs *regs) 145 { 146 int i, disr = DISR; 147 148 + pr_debug("imxdma: dma_irq_handler called, disr=0x%08x\n", 149 + disr); 150 + 151 DISR = disr; 152 + for (i = 0; i < IMX_DMA_CHANNELS; i++) { 153 if (disr & (1 << i)) { 154 + struct imx_dma_channel *channel = &imx_dma_channels[i]; 155 + if (channel->name) { 156 + if (imx_dma_sg_next(i, CNTR(i))) { 157 + CCR(i) &= ~CCR_CEN; 158 + mb(); 159 + CCR(i) |= CCR_CEN; 160 + } else { 161 + if (channel->irq_handler) 162 + channel->irq_handler(i, 163 + channel->data, regs); 164 + } 165 } else { 166 /* 167 * IRQ for an unregistered DMA channel: ··· 165 return IRQ_HANDLED; 166 } 167 168 + static int __init imx_dma_init(void) 169 { 170 int ret; 171 + int i; 172 173 /* reset DMA module */ 174 DCR = DCR_DRST; ··· 189 DCR = DCR_DEN; 190 191 /* clear all interrupts */ 192 + DISR = (1 << IMX_DMA_CHANNELS) - 1; 193 194 /* enable interrupts */ 195 + DIMR = (1 << IMX_DMA_CHANNELS) - 1; 196 + 197 + for (i = 0; i < IMX_DMA_CHANNELS; i++) { 198 + imx_dma_channels[i].sg = NULL; 199 + imx_dma_channels[i].dma_num = i; 200 + } 201 202 return ret; 203 } 204 205 arch_initcall(imx_dma_init); 206 207 + EXPORT_SYMBOL(imx_dma_setup_single); 208 + EXPORT_SYMBOL(imx_dma_setup_sg); 209 + EXPORT_SYMBOL(imx_dma_setup_handlers); 210 + EXPORT_SYMBOL(imx_dma_enable); 211 + EXPORT_SYMBOL(imx_dma_disable); 212 + EXPORT_SYMBOL(imx_dma_request); 213 + EXPORT_SYMBOL(imx_dma_free); 214 + EXPORT_SYMBOL(imx_dma_request_by_prio); 215 + EXPORT_SYMBOL(imx_dma_channels);
+18
arch/arm/mach-imx/mx1ads.c
··· 25 #include <asm/mach-types.h> 26 27 #include <asm/mach/arch.h> 28 #include <linux/interrupt.h> 29 #include "generic.h" 30 ··· 52 &cs89x0_device, 53 }; 54 55 static void __init 56 mx1ads_init(void) 57 { 58 #ifdef CONFIG_LEDS 59 imx_gpio_mode(GPIO_PORTA | GPIO_OUT | 2); 60 #endif 61 platform_add_devices(devices, ARRAY_SIZE(devices)); 62 }
··· 25 #include <asm/mach-types.h> 26 27 #include <asm/mach/arch.h> 28 + #include <asm/arch/mmc.h> 29 #include <linux/interrupt.h> 30 #include "generic.h" 31 ··· 51 &cs89x0_device, 52 }; 53 54 + #ifdef CONFIG_MMC_IMX 55 + static int mx1ads_mmc_card_present(void) 56 + { 57 + /* MMC/SD Card Detect is PB 20 on MX1ADS V1.0.7 */ 58 + return (SSR(1) & (1 << 20) ? 0 : 1); 59 + } 60 + 61 + static struct imxmmc_platform_data mx1ads_mmc_info = { 62 + .card_present = mx1ads_mmc_card_present, 63 + }; 64 + #endif 65 + 66 static void __init 67 mx1ads_init(void) 68 { 69 #ifdef CONFIG_LEDS 70 imx_gpio_mode(GPIO_PORTA | GPIO_OUT | 2); 71 + #endif 72 + #ifdef CONFIG_MMC_IMX 73 + /* SD/MMC card detect */ 74 + imx_gpio_mode(GPIO_PORTB | GPIO_GIUS | GPIO_IN | 20); 75 + imx_set_mmc_info(&mx1ads_mmc_info); 76 #endif 77 platform_add_devices(devices, ARRAY_SIZE(devices)); 78 }
+9
arch/arm/mach-ixp23xx/espresso.c
··· 44 #include <asm/mach/irq.h> 45 #include <asm/mach/pci.h> 46 47 static void __init espresso_init(void) 48 { 49 physmap_configure(0x90000000, 0x02000000, 2, NULL);
··· 44 #include <asm/mach/irq.h> 45 #include <asm/mach/pci.h> 46 47 + static int __init espresso_pci_init(void) 48 + { 49 + if (machine_is_espresso()) 50 + ixp23xx_pci_slave_init(); 51 + 52 + return 0; 53 + }; 54 + subsys_initcall(espresso_pci_init); 55 + 56 static void __init espresso_init(void) 57 { 58 physmap_configure(0x90000000, 0x02000000, 2, NULL);
+17 -1
arch/arm/mach-ixp23xx/pci.c
··· 201 return 0; 202 } 203 204 - void __init ixp23xx_pci_preinit(void) 205 { 206 #ifdef __ARMEB__ 207 *IXP23XX_PCI_CONTROL |= 0x20000; /* set I/O swapping */ ··· 219 *IXP23XX_PCI_CPP_ADDR_BITS &= ~(1 << 1); 220 } else { 221 *IXP23XX_PCI_CPP_ADDR_BITS |= (1 << 1); 222 } 223 224 hook_fault_code(16+6, ixp23xx_pci_abort_handler, SIGBUS, 225 "PCI config cycle to non-existent device"); ··· 283 sys->resource[2] = NULL; 284 285 return 1; 286 }
··· 201 return 0; 202 } 203 204 + static void __init ixp23xx_pci_common_init(void) 205 { 206 #ifdef __ARMEB__ 207 *IXP23XX_PCI_CONTROL |= 0x20000; /* set I/O swapping */ ··· 219 *IXP23XX_PCI_CPP_ADDR_BITS &= ~(1 << 1); 220 } else { 221 *IXP23XX_PCI_CPP_ADDR_BITS |= (1 << 1); 222 + 223 + /* 224 + * Enable coherency on A2 silicon. 225 + */ 226 + if (arch_is_coherent()) 227 + *IXP23XX_CPP2XSI_CURR_XFER_REG3 &= ~IXP23XX_CPP2XSI_COH_OFF; 228 } 229 + } 230 + 231 + void __init ixp23xx_pci_preinit(void) 232 + { 233 + ixp23xx_pci_common_init(); 234 235 hook_fault_code(16+6, ixp23xx_pci_abort_handler, SIGBUS, 236 "PCI config cycle to non-existent device"); ··· 272 sys->resource[2] = NULL; 273 274 return 1; 275 + } 276 + 277 + void ixp23xx_pci_slave_init(void) 278 + { 279 + ixp23xx_pci_common_init(); 280 }
+14 -6
arch/arm/mach-omap1/Kconfig
··· 69 Support for Voiceblue GSM/VoIP gateway. Say Y here if you have 70 such a board. 71 72 - config MACH_NETSTAR 73 - bool "NetStar" 74 - depends on ARCH_OMAP1 && ARCH_OMAP15XX 75 - help 76 - Support for NetStar PBX. Say Y here if you have such a board. 77 - 78 config MACH_OMAP_PALMTE 79 bool "Palm Tungsten E" 80 depends on ARCH_OMAP1 && ARCH_OMAP15XX ··· 78 bootloader; check out http://palmtelinux.sourceforge.net for more 79 informations. 80 Say Y here if you have such a PDA, say NO otherwise. 81 82 config MACH_OMAP_GENERIC 83 bool "Generic OMAP board"
··· 69 Support for Voiceblue GSM/VoIP gateway. Say Y here if you have 70 such a board. 71 72 config MACH_OMAP_PALMTE 73 bool "Palm Tungsten E" 74 depends on ARCH_OMAP1 && ARCH_OMAP15XX ··· 84 bootloader; check out http://palmtelinux.sourceforge.net for more 85 informations. 86 Say Y here if you have such a PDA, say NO otherwise. 87 + 88 + config MACH_NOKIA770 89 + bool "Nokia 770" 90 + depends on ARCH_OMAP1 && ARCH_OMAP16XX 91 + help 92 + Support for the Nokia 770 Internet Tablet. Say Y here if you 93 + have such a device. 94 + 95 + config MACH_AMS_DELTA 96 + bool "Amstrad E3 (Delta)" 97 + depends on ARCH_OMAP1 && ARCH_OMAP15XX 98 + help 99 + Support for the Amstrad E3 (codename Delta) videophone. Say Y here 100 + if you have such a device. 101 102 config MACH_OMAP_GENERIC 103 bool "Generic OMAP board"
+9 -2
arch/arm/mach-omap1/Makefile
··· 3 # 4 5 # Common support 6 - obj-y := io.o id.o clock.o irq.o time.o mux.o serial.o devices.o 7 led-y := leds.o 8 9 # Specific board support ··· 20 obj-$(CONFIG_MACH_OMAP_OSK) += board-osk.o 21 obj-$(CONFIG_MACH_OMAP_H3) += board-h3.o 22 obj-$(CONFIG_MACH_VOICEBLUE) += board-voiceblue.o 23 - obj-$(CONFIG_MACH_NETSTAR) += board-netstar.o 24 obj-$(CONFIG_MACH_OMAP_PALMTE) += board-palmte.o 25 26 ifeq ($(CONFIG_ARCH_OMAP15XX),y) 27 # Innovator-1510 FPGA
··· 3 # 4 5 # Common support 6 + obj-y := io.o id.o clock.o irq.o mux.o serial.o devices.o 7 + 8 + obj-$(CONFIG_OMAP_MPU_TIMER) += time.o 9 + 10 + # Power Management 11 + obj-$(CONFIG_PM) += pm.o sleep.o 12 + 13 led-y := leds.o 14 15 # Specific board support ··· 14 obj-$(CONFIG_MACH_OMAP_OSK) += board-osk.o 15 obj-$(CONFIG_MACH_OMAP_H3) += board-h3.o 16 obj-$(CONFIG_MACH_VOICEBLUE) += board-voiceblue.o 17 obj-$(CONFIG_MACH_OMAP_PALMTE) += board-palmte.o 18 + obj-$(CONFIG_MACH_NOKIA770) += board-nokia770.o 19 + obj-$(CONFIG_MACH_AMS_DELTA) += board-ams-delta.o 20 21 ifeq ($(CONFIG_ARCH_OMAP15XX),y) 22 # Innovator-1510 FPGA
+116
arch/arm/mach-omap1/board-ams-delta.c
···
··· 1 + /* 2 + * linux/arch/arm/mach-omap1/board-ams-delta.c 3 + * 4 + * Modified from board-generic.c 5 + * 6 + * Board specific inits for the Amstrad E3 (codename Delta) videophone 7 + * 8 + * Copyright (C) 2006 Jonathan McDowell <noodles@earth.li> 9 + * 10 + * This program is free software; you can redistribute it and/or modify 11 + * it under the terms of the GNU General Public License version 2 as 12 + * published by the Free Software Foundation. 13 + */ 14 + 15 + #include <linux/kernel.h> 16 + #include <linux/init.h> 17 + #include <linux/platform_device.h> 18 + 19 + #include <asm/hardware.h> 20 + #include <asm/mach-types.h> 21 + #include <asm/mach/arch.h> 22 + #include <asm/mach/map.h> 23 + 24 + #include <asm/arch/board-ams-delta.h> 25 + #include <asm/arch/gpio.h> 26 + #include <asm/arch/mux.h> 27 + #include <asm/arch/usb.h> 28 + #include <asm/arch/board.h> 29 + #include <asm/arch/common.h> 30 + 31 + static u8 ams_delta_latch1_reg; 32 + static u16 ams_delta_latch2_reg; 33 + 34 + void ams_delta_latch1_write(u8 mask, u8 value) 35 + { 36 + ams_delta_latch1_reg &= ~mask; 37 + ams_delta_latch1_reg |= value; 38 + *(volatile __u8 *) AMS_DELTA_LATCH1_VIRT = ams_delta_latch1_reg; 39 + } 40 + 41 + void ams_delta_latch2_write(u16 mask, u16 value) 42 + { 43 + ams_delta_latch2_reg &= ~mask; 44 + ams_delta_latch2_reg |= value; 45 + *(volatile __u16 *) AMS_DELTA_LATCH2_VIRT = ams_delta_latch2_reg; 46 + } 47 + 48 + static void __init ams_delta_init_irq(void) 49 + { 50 + omap1_init_common_hw(); 51 + omap_init_irq(); 52 + omap_gpio_init(); 53 + } 54 + 55 + static struct map_desc ams_delta_io_desc[] __initdata = { 56 + // AMS_DELTA_LATCH1 57 + { 58 + .virtual = AMS_DELTA_LATCH1_VIRT, 59 + .pfn = __phys_to_pfn(AMS_DELTA_LATCH1_PHYS), 60 + .length = 0x01000000, 61 + .type = MT_DEVICE 62 + }, 63 + // AMS_DELTA_LATCH2 64 + { 65 + .virtual = AMS_DELTA_LATCH2_VIRT, 66 + .pfn = __phys_to_pfn(AMS_DELTA_LATCH2_PHYS), 67 + .length = 0x01000000, 68 + .type = MT_DEVICE 69 + }, 70 + // AMS_DELTA_MODEM 71 + { 72 + .virtual = AMS_DELTA_MODEM_VIRT, 73 + .pfn = __phys_to_pfn(AMS_DELTA_MODEM_PHYS), 74 + .length = 0x01000000, 75 + .type = MT_DEVICE 76 + } 77 + }; 78 + 79 + static struct omap_uart_config ams_delta_uart_config __initdata = { 80 + .enabled_uarts = 1, 81 + }; 82 + 83 + static struct omap_board_config_kernel ams_delta_config[] = { 84 + { OMAP_TAG_UART, &ams_delta_uart_config }, 85 + }; 86 + 87 + static void __init ams_delta_init(void) 88 + { 89 + iotable_init(ams_delta_io_desc, ARRAY_SIZE(ams_delta_io_desc)); 90 + 91 + omap_board_config = ams_delta_config; 92 + omap_board_config_size = ARRAY_SIZE(ams_delta_config); 93 + omap_serial_init(); 94 + 95 + /* Clear latch2 (NAND, LCD, modem enable) */ 96 + ams_delta_latch2_write(~0, 0); 97 + } 98 + 99 + static void __init ams_delta_map_io(void) 100 + { 101 + omap1_map_common_io(); 102 + } 103 + 104 + MACHINE_START(AMS_DELTA, "Amstrad E3 (Delta)") 105 + /* Maintainer: Jonathan McDowell <noodles@earth.li> */ 106 + .phys_io = 0xfff00000, 107 + .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc, 108 + .boot_params = 0x10000100, 109 + .map_io = ams_delta_map_io, 110 + .init_irq = ams_delta_init_irq, 111 + .init_machine = ams_delta_init, 112 + .timer = &omap_timer, 113 + MACHINE_END 114 + 115 + EXPORT_SYMBOL(ams_delta_latch1_write); 116 + EXPORT_SYMBOL(ams_delta_latch2_write);
+1 -1
arch/arm/mach-omap1/board-generic.c
··· 88 static void __init omap_generic_init(void) 89 { 90 #ifdef CONFIG_ARCH_OMAP15XX 91 - if (cpu_is_omap1510()) { 92 generic_config[0].data = &generic1510_usb_config; 93 } 94 #endif
··· 88 static void __init omap_generic_init(void) 89 { 90 #ifdef CONFIG_ARCH_OMAP15XX 91 + if (cpu_is_omap15xx()) { 92 generic_config[0].data = &generic1510_usb_config; 93 } 94 #endif
+186 -14
arch/arm/mach-omap1/board-h2.c
··· 24 #include <linux/platform_device.h> 25 #include <linux/delay.h> 26 #include <linux/mtd/mtd.h> 27 #include <linux/mtd/partitions.h> 28 29 #include <asm/hardware.h> 30 #include <asm/mach-types.h> ··· 37 #include <asm/arch/gpio.h> 38 #include <asm/arch/mux.h> 39 #include <asm/arch/tc.h> 40 #include <asm/arch/usb.h> 41 #include <asm/arch/common.h> 42 43 extern int omap_gpio_init(void); 44 45 - static struct mtd_partition h2_partitions[] = { 46 /* bootloader (U-Boot, etc) in first sector */ 47 { 48 .name = "bootloader", ··· 116 } 117 }; 118 119 - static struct flash_platform_data h2_flash_data = { 120 .map_name = "cfi_probe", 121 .width = 2, 122 - .parts = h2_partitions, 123 - .nr_parts = ARRAY_SIZE(h2_partitions), 124 }; 125 126 - static struct resource h2_flash_resource = { 127 /* This is on CS3, wherever it's mapped */ 128 .flags = IORESOURCE_MEM, 129 }; 130 131 - static struct platform_device h2_flash_device = { 132 .name = "omapflash", 133 .id = 0, 134 .dev = { 135 - .platform_data = &h2_flash_data, 136 }, 137 .num_resources = 1, 138 - .resource = &h2_flash_resource, 139 }; 140 141 static struct resource h2_smc91x_resources[] = { ··· 158 .resource = h2_smc91x_resources, 159 }; 160 161 static struct platform_device *h2_devices[] __initdata = { 162 - &h2_flash_device, 163 &h2_smc91x_device, 164 }; 165 166 static void __init h2_init_smc91x(void) ··· 319 }; 320 321 static struct omap_lcd_config h2_lcd_config __initdata = { 322 - .panel_name = "h2", 323 .ctrl_name = "internal", 324 }; 325 ··· 331 332 static void __init h2_init(void) 333 { 334 - /* NOTE: revC boards support NAND-boot, which can put NOR on CS2B 335 - * and NAND (either 16bit or 8bit) on CS3. 336 */ 337 - h2_flash_resource.end = h2_flash_resource.start = omap_cs3_phys(); 338 - h2_flash_resource.end += SZ_32M - 1; 339 340 /* MMC: card detect and WP */ 341 // omap_cfg_reg(U19_ARMIO1); /* CD */ 342 omap_cfg_reg(BALLOUT_V8_ARMIO3); /* WP */ 343 344 platform_add_devices(h2_devices, ARRAY_SIZE(h2_devices)); 345 omap_board_config = h2_config;
··· 24 #include <linux/platform_device.h> 25 #include <linux/delay.h> 26 #include <linux/mtd/mtd.h> 27 + #include <linux/mtd/nand.h> 28 #include <linux/mtd/partitions.h> 29 + #include <linux/input.h> 30 31 #include <asm/hardware.h> 32 #include <asm/mach-types.h> ··· 35 #include <asm/arch/gpio.h> 36 #include <asm/arch/mux.h> 37 #include <asm/arch/tc.h> 38 + #include <asm/arch/irda.h> 39 #include <asm/arch/usb.h> 40 + #include <asm/arch/keypad.h> 41 #include <asm/arch/common.h> 42 + #include <asm/arch/mcbsp.h> 43 + #include <asm/arch/omap-alsa.h> 44 45 extern int omap_gpio_init(void); 46 47 + static int h2_keymap[] = { 48 + KEY(0, 0, KEY_LEFT), 49 + KEY(0, 1, KEY_RIGHT), 50 + KEY(0, 2, KEY_3), 51 + KEY(0, 3, KEY_F10), 52 + KEY(0, 4, KEY_F5), 53 + KEY(0, 5, KEY_9), 54 + KEY(1, 0, KEY_DOWN), 55 + KEY(1, 1, KEY_UP), 56 + KEY(1, 2, KEY_2), 57 + KEY(1, 3, KEY_F9), 58 + KEY(1, 4, KEY_F7), 59 + KEY(1, 5, KEY_0), 60 + KEY(2, 0, KEY_ENTER), 61 + KEY(2, 1, KEY_6), 62 + KEY(2, 2, KEY_1), 63 + KEY(2, 3, KEY_F2), 64 + KEY(2, 4, KEY_F6), 65 + KEY(2, 5, KEY_HOME), 66 + KEY(3, 0, KEY_8), 67 + KEY(3, 1, KEY_5), 68 + KEY(3, 2, KEY_F12), 69 + KEY(3, 3, KEY_F3), 70 + KEY(3, 4, KEY_F8), 71 + KEY(3, 5, KEY_END), 72 + KEY(4, 0, KEY_7), 73 + KEY(4, 1, KEY_4), 74 + KEY(4, 2, KEY_F11), 75 + KEY(4, 3, KEY_F1), 76 + KEY(4, 4, KEY_F4), 77 + KEY(4, 5, KEY_ESC), 78 + KEY(5, 0, KEY_F13), 79 + KEY(5, 1, KEY_F14), 80 + KEY(5, 2, KEY_F15), 81 + KEY(5, 3, KEY_F16), 82 + KEY(5, 4, KEY_SLEEP), 83 + 0 84 + }; 85 + 86 + static struct mtd_partition h2_nor_partitions[] = { 87 /* bootloader (U-Boot, etc) in first sector */ 88 { 89 .name = "bootloader", ··· 71 } 72 }; 73 74 + static struct flash_platform_data h2_nor_data = { 75 .map_name = "cfi_probe", 76 .width = 2, 77 + .parts = h2_nor_partitions, 78 + .nr_parts = ARRAY_SIZE(h2_nor_partitions), 79 }; 80 81 + static struct resource h2_nor_resource = { 82 /* This is on CS3, wherever it's mapped */ 83 .flags = IORESOURCE_MEM, 84 }; 85 86 + static struct platform_device h2_nor_device = { 87 .name = "omapflash", 88 .id = 0, 89 .dev = { 90 + .platform_data = &h2_nor_data, 91 }, 92 .num_resources = 1, 93 + .resource = &h2_nor_resource, 94 }; 95 96 static struct resource h2_smc91x_resources[] = { ··· 113 .resource = h2_smc91x_resources, 114 }; 115 116 + static struct resource h2_kp_resources[] = { 117 + [0] = { 118 + .start = INT_KEYBOARD, 119 + .end = INT_KEYBOARD, 120 + .flags = IORESOURCE_IRQ, 121 + }, 122 + }; 123 + 124 + static struct omap_kp_platform_data h2_kp_data = { 125 + .rows = 8, 126 + .cols = 8, 127 + .keymap = h2_keymap, 128 + .rep = 1, 129 + }; 130 + 131 + static struct platform_device h2_kp_device = { 132 + .name = "omap-keypad", 133 + .id = -1, 134 + .dev = { 135 + .platform_data = &h2_kp_data, 136 + }, 137 + .num_resources = ARRAY_SIZE(h2_kp_resources), 138 + .resource = h2_kp_resources, 139 + }; 140 + 141 + #define H2_IRDA_FIRSEL_GPIO_PIN 17 142 + 143 + #if defined(CONFIG_OMAP_IR) || defined(CONFIG_OMAP_IR_MODULE) 144 + static int h2_transceiver_mode(struct device *dev, int state) 145 + { 146 + if (state & IR_SIRMODE) 147 + omap_set_gpio_dataout(H2_IRDA_FIRSEL_GPIO_PIN, 0); 148 + else /* MIR/FIR */ 149 + omap_set_gpio_dataout(H2_IRDA_FIRSEL_GPIO_PIN, 1); 150 + 151 + return 0; 152 + } 153 + #endif 154 + 155 + static struct omap_irda_config h2_irda_data = { 156 + .transceiver_cap = IR_SIRMODE | IR_MIRMODE | IR_FIRMODE, 157 + .rx_channel = OMAP_DMA_UART3_RX, 158 + .tx_channel = OMAP_DMA_UART3_TX, 159 + .dest_start = UART3_THR, 160 + .src_start = UART3_RHR, 161 + .tx_trigger = 0, 162 + .rx_trigger = 0, 163 + }; 164 + 165 + static struct resource h2_irda_resources[] = { 166 + [0] = { 167 + .start = INT_UART3, 168 + .end = INT_UART3, 169 + .flags = IORESOURCE_IRQ, 170 + }, 171 + }; 172 + static struct platform_device h2_irda_device = { 173 + .name = "omapirda", 174 + .id = 0, 175 + .dev = { 176 + .platform_data = &h2_irda_data, 177 + }, 178 + .num_resources = ARRAY_SIZE(h2_irda_resources), 179 + .resource = h2_irda_resources, 180 + }; 181 + 182 + static struct platform_device h2_lcd_device = { 183 + .name = "lcd_h2", 184 + .id = -1, 185 + }; 186 + 187 + static struct omap_mcbsp_reg_cfg mcbsp_regs = { 188 + .spcr2 = FREE | FRST | GRST | XRST | XINTM(3), 189 + .spcr1 = RINTM(3) | RRST, 190 + .rcr2 = RPHASE | RFRLEN2(OMAP_MCBSP_WORD_8) | 191 + RWDLEN2(OMAP_MCBSP_WORD_16) | RDATDLY(1), 192 + .rcr1 = RFRLEN1(OMAP_MCBSP_WORD_8) | RWDLEN1(OMAP_MCBSP_WORD_16), 193 + .xcr2 = XPHASE | XFRLEN2(OMAP_MCBSP_WORD_8) | 194 + XWDLEN2(OMAP_MCBSP_WORD_16) | XDATDLY(1) | XFIG, 195 + .xcr1 = XFRLEN1(OMAP_MCBSP_WORD_8) | XWDLEN1(OMAP_MCBSP_WORD_16), 196 + .srgr1 = FWID(15), 197 + .srgr2 = GSYNC | CLKSP | FSGM | FPER(31), 198 + 199 + .pcr0 = CLKXM | CLKRM | FSXP | FSRP | CLKXP | CLKRP, 200 + //.pcr0 = CLKXP | CLKRP, /* mcbsp: slave */ 201 + }; 202 + 203 + static struct omap_alsa_codec_config alsa_config = { 204 + .name = "H2 TSC2101", 205 + .mcbsp_regs_alsa = &mcbsp_regs, 206 + .codec_configure_dev = NULL, // tsc2101_configure, 207 + .codec_set_samplerate = NULL, // tsc2101_set_samplerate, 208 + .codec_clock_setup = NULL, // tsc2101_clock_setup, 209 + .codec_clock_on = NULL, // tsc2101_clock_on, 210 + .codec_clock_off = NULL, // tsc2101_clock_off, 211 + .get_default_samplerate = NULL, // tsc2101_get_default_samplerate, 212 + }; 213 + 214 + static struct platform_device h2_mcbsp1_device = { 215 + .name = "omap_alsa_mcbsp", 216 + .id = 1, 217 + .dev = { 218 + .platform_data = &alsa_config, 219 + }, 220 + }; 221 + 222 static struct platform_device *h2_devices[] __initdata = { 223 + &h2_nor_device, 224 &h2_smc91x_device, 225 + &h2_irda_device, 226 + &h2_kp_device, 227 + &h2_lcd_device, 228 + &h2_mcbsp1_device, 229 }; 230 231 static void __init h2_init_smc91x(void) ··· 164 }; 165 166 static struct omap_lcd_config h2_lcd_config __initdata = { 167 .ctrl_name = "internal", 168 }; 169 ··· 177 178 static void __init h2_init(void) 179 { 180 + /* Here we assume the NOR boot config: NOR on CS3 (possibly swapped 181 + * to address 0 by a dip switch), NAND on CS2B. The NAND driver will 182 + * notice whether a NAND chip is enabled at probe time. 183 + * 184 + * FIXME revC boards (and H3) support NAND-boot, with a dip switch to 185 + * put NOR on CS2B and NAND (which on H2 may be 16bit) on CS3. Try 186 + * detecting that in code here, to avoid probing every possible flash 187 + * configuration... 188 */ 189 + h2_nor_resource.end = h2_nor_resource.start = omap_cs3_phys(); 190 + h2_nor_resource.end += SZ_32M - 1; 191 + 192 + omap_cfg_reg(L3_1610_FLASH_CS2B_OE); 193 + omap_cfg_reg(M8_1610_FLASH_CS2B_WE); 194 195 /* MMC: card detect and WP */ 196 // omap_cfg_reg(U19_ARMIO1); /* CD */ 197 omap_cfg_reg(BALLOUT_V8_ARMIO3); /* WP */ 198 + 199 + /* Irda */ 200 + #if defined(CONFIG_OMAP_IR) || defined(CONFIG_OMAP_IR_MODULE) 201 + omap_writel(omap_readl(FUNC_MUX_CTRL_A) | 7, FUNC_MUX_CTRL_A); 202 + if (!(omap_request_gpio(H2_IRDA_FIRSEL_GPIO_PIN))) { 203 + omap_set_gpio_direction(H2_IRDA_FIRSEL_GPIO_PIN, 0); 204 + h2_irda_data.transceiver_mode = h2_transceiver_mode; 205 + } 206 + #endif 207 208 platform_add_devices(h2_devices, ARRAY_SIZE(h2_devices)); 209 omap_board_config = h2_config;
+264 -13
arch/arm/mach-omap1/board-h3.c
··· 21 #include <linux/kernel.h> 22 #include <linux/platform_device.h> 23 #include <linux/errno.h> 24 #include <linux/mtd/mtd.h> 25 #include <linux/mtd/partitions.h> 26 27 #include <asm/setup.h> 28 #include <asm/page.h> ··· 36 #include <asm/mach/map.h> 37 38 #include <asm/arch/gpio.h> 39 #include <asm/arch/irqs.h> 40 #include <asm/arch/mux.h> 41 #include <asm/arch/tc.h> 42 #include <asm/arch/usb.h> 43 #include <asm/arch/common.h> 44 45 extern int omap_gpio_init(void); 46 47 - static struct mtd_partition h3_partitions[] = { 48 /* bootloader (U-Boot, etc) in first sector */ 49 { 50 .name = "bootloader", ··· 119 } 120 }; 121 122 - static struct flash_platform_data h3_flash_data = { 123 .map_name = "cfi_probe", 124 .width = 2, 125 - .parts = h3_partitions, 126 - .nr_parts = ARRAY_SIZE(h3_partitions), 127 }; 128 129 - static struct resource h3_flash_resource = { 130 /* This is on CS3, wherever it's mapped */ 131 .flags = IORESOURCE_MEM, 132 }; 133 134 - static struct platform_device flash_device = { 135 .name = "omapflash", 136 .id = 0, 137 .dev = { 138 - .platform_data = &h3_flash_data, 139 }, 140 .num_resources = 1, 141 - .resource = &h3_flash_resource, 142 }; 143 144 static struct resource smc91x_resources[] = { ··· 239 .resource = intlat_resources, 240 }; 241 242 static struct platform_device *devices[] __initdata = { 243 - &flash_device, 244 &smc91x_device, 245 &intlat_device, 246 }; 247 248 static struct omap_usb_config h3_usb_config __initdata = { ··· 398 }; 399 400 static struct omap_lcd_config h3_lcd_config __initdata = { 401 - .panel_name = "h3", 402 .ctrl_name = "internal", 403 }; 404 ··· 408 { OMAP_TAG_LCD, &h3_lcd_config }, 409 }; 410 411 static void __init h3_init(void) 412 { 413 - h3_flash_resource.end = h3_flash_resource.start = omap_cs3_phys(); 414 - h3_flash_resource.end += OMAP_CS3_SIZE - 1; 415 - (void) platform_add_devices(devices, ARRAY_SIZE(devices)); 416 omap_board_config = h3_config; 417 omap_board_config_size = ARRAY_SIZE(h3_config); 418 omap_serial_init();
··· 21 #include <linux/kernel.h> 22 #include <linux/platform_device.h> 23 #include <linux/errno.h> 24 + #include <linux/workqueue.h> 25 #include <linux/mtd/mtd.h> 26 + #include <linux/mtd/nand.h> 27 #include <linux/mtd/partitions.h> 28 + #include <linux/input.h> 29 30 #include <asm/setup.h> 31 #include <asm/page.h> ··· 33 #include <asm/mach/map.h> 34 35 #include <asm/arch/gpio.h> 36 + #include <asm/arch/gpioexpander.h> 37 #include <asm/arch/irqs.h> 38 #include <asm/arch/mux.h> 39 #include <asm/arch/tc.h> 40 + #include <asm/arch/irda.h> 41 #include <asm/arch/usb.h> 42 + #include <asm/arch/keypad.h> 43 + #include <asm/arch/dma.h> 44 #include <asm/arch/common.h> 45 46 extern int omap_gpio_init(void); 47 48 + static int h3_keymap[] = { 49 + KEY(0, 0, KEY_LEFT), 50 + KEY(0, 1, KEY_RIGHT), 51 + KEY(0, 2, KEY_3), 52 + KEY(0, 3, KEY_F10), 53 + KEY(0, 4, KEY_F5), 54 + KEY(0, 5, KEY_9), 55 + KEY(1, 0, KEY_DOWN), 56 + KEY(1, 1, KEY_UP), 57 + KEY(1, 2, KEY_2), 58 + KEY(1, 3, KEY_F9), 59 + KEY(1, 4, KEY_F7), 60 + KEY(1, 5, KEY_0), 61 + KEY(2, 0, KEY_ENTER), 62 + KEY(2, 1, KEY_6), 63 + KEY(2, 2, KEY_1), 64 + KEY(2, 3, KEY_F2), 65 + KEY(2, 4, KEY_F6), 66 + KEY(2, 5, KEY_HOME), 67 + KEY(3, 0, KEY_8), 68 + KEY(3, 1, KEY_5), 69 + KEY(3, 2, KEY_F12), 70 + KEY(3, 3, KEY_F3), 71 + KEY(3, 4, KEY_F8), 72 + KEY(3, 5, KEY_END), 73 + KEY(4, 0, KEY_7), 74 + KEY(4, 1, KEY_4), 75 + KEY(4, 2, KEY_F11), 76 + KEY(4, 3, KEY_F1), 77 + KEY(4, 4, KEY_F4), 78 + KEY(4, 5, KEY_ESC), 79 + KEY(5, 0, KEY_F13), 80 + KEY(5, 1, KEY_F14), 81 + KEY(5, 2, KEY_F15), 82 + KEY(5, 3, KEY_F16), 83 + KEY(5, 4, KEY_SLEEP), 84 + 0 85 + }; 86 + 87 + 88 + static struct mtd_partition nor_partitions[] = { 89 /* bootloader (U-Boot, etc) in first sector */ 90 { 91 .name = "bootloader", ··· 72 } 73 }; 74 75 + static struct flash_platform_data nor_data = { 76 .map_name = "cfi_probe", 77 .width = 2, 78 + .parts = nor_partitions, 79 + .nr_parts = ARRAY_SIZE(nor_partitions), 80 }; 81 82 + static struct resource nor_resource = { 83 /* This is on CS3, wherever it's mapped */ 84 .flags = IORESOURCE_MEM, 85 }; 86 87 + static struct platform_device nor_device = { 88 .name = "omapflash", 89 .id = 0, 90 .dev = { 91 + .platform_data = &nor_data, 92 }, 93 .num_resources = 1, 94 + .resource = &nor_resource, 95 + }; 96 + 97 + static struct mtd_partition nand_partitions[] = { 98 + #if 0 99 + /* REVISIT: enable these partitions if you make NAND BOOT work */ 100 + { 101 + .name = "xloader", 102 + .offset = 0, 103 + .size = 64 * 1024, 104 + .mask_flags = MTD_WRITEABLE, /* force read-only */ 105 + }, 106 + { 107 + .name = "bootloader", 108 + .offset = MTDPART_OFS_APPEND, 109 + .size = 256 * 1024, 110 + .mask_flags = MTD_WRITEABLE, /* force read-only */ 111 + }, 112 + { 113 + .name = "params", 114 + .offset = MTDPART_OFS_APPEND, 115 + .size = 192 * 1024, 116 + }, 117 + { 118 + .name = "kernel", 119 + .offset = MTDPART_OFS_APPEND, 120 + .size = 2 * SZ_1M, 121 + }, 122 + #endif 123 + { 124 + .name = "filesystem", 125 + .size = MTDPART_SIZ_FULL, 126 + .offset = MTDPART_OFS_APPEND, 127 + }, 128 + }; 129 + 130 + /* dip switches control NAND chip access: 8 bit, 16 bit, or neither */ 131 + static struct nand_platform_data nand_data = { 132 + .options = NAND_SAMSUNG_LP_OPTIONS, 133 + .parts = nand_partitions, 134 + .nr_parts = ARRAY_SIZE(nand_partitions), 135 + }; 136 + 137 + static struct resource nand_resource = { 138 + .flags = IORESOURCE_MEM, 139 + }; 140 + 141 + static struct platform_device nand_device = { 142 + .name = "omapnand", 143 + .id = 0, 144 + .dev = { 145 + .platform_data = &nand_data, 146 + }, 147 + .num_resources = 1, 148 + .resource = &nand_resource, 149 }; 150 151 static struct resource smc91x_resources[] = { ··· 138 .resource = intlat_resources, 139 }; 140 141 + static struct resource h3_kp_resources[] = { 142 + [0] = { 143 + .start = INT_KEYBOARD, 144 + .end = INT_KEYBOARD, 145 + .flags = IORESOURCE_IRQ, 146 + }, 147 + }; 148 + 149 + static struct omap_kp_platform_data h3_kp_data = { 150 + .rows = 8, 151 + .cols = 8, 152 + .keymap = h3_keymap, 153 + .rep = 1, 154 + }; 155 + 156 + static struct platform_device h3_kp_device = { 157 + .name = "omap-keypad", 158 + .id = -1, 159 + .dev = { 160 + .platform_data = &h3_kp_data, 161 + }, 162 + .num_resources = ARRAY_SIZE(h3_kp_resources), 163 + .resource = h3_kp_resources, 164 + }; 165 + 166 + 167 + /* Select between the IrDA and aGPS module 168 + */ 169 + static int h3_select_irda(struct device *dev, int state) 170 + { 171 + unsigned char expa; 172 + int err = 0; 173 + 174 + if ((err = read_gpio_expa(&expa, 0x26))) { 175 + printk(KERN_ERR "Error reading from I/O EXPANDER \n"); 176 + return err; 177 + } 178 + 179 + /* 'P6' enable/disable IRDA_TX and IRDA_RX */ 180 + if (state & IR_SEL) { /* IrDA */ 181 + if ((err = write_gpio_expa(expa | 0x40, 0x26))) { 182 + printk(KERN_ERR "Error writing to I/O EXPANDER \n"); 183 + return err; 184 + } 185 + } else { 186 + if ((err = write_gpio_expa(expa & ~0x40, 0x26))) { 187 + printk(KERN_ERR "Error writing to I/O EXPANDER \n"); 188 + return err; 189 + } 190 + } 191 + return err; 192 + } 193 + 194 + static void set_trans_mode(void *data) 195 + { 196 + int *mode = data; 197 + unsigned char expa; 198 + int err = 0; 199 + 200 + if ((err = read_gpio_expa(&expa, 0x27)) != 0) { 201 + printk(KERN_ERR "Error reading from I/O expander\n"); 202 + } 203 + 204 + expa &= ~0x03; 205 + 206 + if (*mode & IR_SIRMODE) { 207 + expa |= 0x01; 208 + } else { /* MIR/FIR */ 209 + expa |= 0x03; 210 + } 211 + 212 + if ((err = write_gpio_expa(expa, 0x27)) != 0) { 213 + printk(KERN_ERR "Error writing to I/O expander\n"); 214 + } 215 + } 216 + 217 + static int h3_transceiver_mode(struct device *dev, int mode) 218 + { 219 + struct omap_irda_config *irda_config = dev->platform_data; 220 + 221 + cancel_delayed_work(&irda_config->gpio_expa); 222 + PREPARE_WORK(&irda_config->gpio_expa, set_trans_mode, &mode); 223 + schedule_work(&irda_config->gpio_expa); 224 + 225 + return 0; 226 + } 227 + 228 + static struct omap_irda_config h3_irda_data = { 229 + .transceiver_cap = IR_SIRMODE | IR_MIRMODE | IR_FIRMODE, 230 + .transceiver_mode = h3_transceiver_mode, 231 + .select_irda = h3_select_irda, 232 + .rx_channel = OMAP_DMA_UART3_RX, 233 + .tx_channel = OMAP_DMA_UART3_TX, 234 + .dest_start = UART3_THR, 235 + .src_start = UART3_RHR, 236 + .tx_trigger = 0, 237 + .rx_trigger = 0, 238 + }; 239 + 240 + static struct resource h3_irda_resources[] = { 241 + [0] = { 242 + .start = INT_UART3, 243 + .end = INT_UART3, 244 + .flags = IORESOURCE_IRQ, 245 + }, 246 + }; 247 + 248 + static struct platform_device h3_irda_device = { 249 + .name = "omapirda", 250 + .id = 0, 251 + .dev = { 252 + .platform_data = &h3_irda_data, 253 + }, 254 + .num_resources = ARRAY_SIZE(h3_irda_resources), 255 + .resource = h3_irda_resources, 256 + }; 257 + 258 + static struct platform_device h3_lcd_device = { 259 + .name = "lcd_h3", 260 + .id = -1, 261 + }; 262 + 263 static struct platform_device *devices[] __initdata = { 264 + &nor_device, 265 + &nand_device, 266 &smc91x_device, 267 &intlat_device, 268 + &h3_irda_device, 269 + &h3_kp_device, 270 + &h3_lcd_device, 271 }; 272 273 static struct omap_usb_config h3_usb_config __initdata = { ··· 171 }; 172 173 static struct omap_lcd_config h3_lcd_config __initdata = { 174 .ctrl_name = "internal", 175 }; 176 ··· 182 { OMAP_TAG_LCD, &h3_lcd_config }, 183 }; 184 185 + #define H3_NAND_RB_GPIO_PIN 10 186 + 187 + static int nand_dev_ready(struct nand_platform_data *data) 188 + { 189 + return omap_get_gpio_datain(H3_NAND_RB_GPIO_PIN); 190 + } 191 + 192 static void __init h3_init(void) 193 { 194 + /* Here we assume the NOR boot config: NOR on CS3 (possibly swapped 195 + * to address 0 by a dip switch), NAND on CS2B. The NAND driver will 196 + * notice whether a NAND chip is enabled at probe time. 197 + * 198 + * H3 support NAND-boot, with a dip switch to put NOR on CS2B and NAND 199 + * (which on H2 may be 16bit) on CS3. Try detecting that in code here, 200 + * to avoid probing every possible flash configuration... 201 + */ 202 + nor_resource.end = nor_resource.start = omap_cs3_phys(); 203 + nor_resource.end += SZ_32M - 1; 204 + 205 + nand_resource.end = nand_resource.start = OMAP_CS2B_PHYS; 206 + nand_resource.end += SZ_4K - 1; 207 + if (!(omap_request_gpio(H3_NAND_RB_GPIO_PIN))) 208 + nand_data.dev_ready = nand_dev_ready; 209 + 210 + /* GPIO10 Func_MUX_CTRL reg bit 29:27, Configure V2 to mode1 as GPIO */ 211 + /* GPIO10 pullup/down register, Enable pullup on GPIO10 */ 212 + omap_cfg_reg(V2_1710_GPIO10); 213 + 214 + platform_add_devices(devices, ARRAY_SIZE(devices)); 215 omap_board_config = h3_config; 216 omap_board_config_size = ARRAY_SIZE(h3_config); 217 omap_serial_init();
+54 -2
arch/arm/mach-omap1/board-innovator.c
··· 22 #include <linux/delay.h> 23 #include <linux/mtd/mtd.h> 24 #include <linux/mtd/partitions.h> 25 26 #include <asm/hardware.h> 27 #include <asm/mach-types.h> ··· 35 #include <asm/arch/gpio.h> 36 #include <asm/arch/tc.h> 37 #include <asm/arch/usb.h> 38 #include <asm/arch/common.h> 39 40 static struct mtd_partition innovator_partitions[] = { 41 /* bootloader (U-Boot, etc) in first sector */ ··· 112 .resource = &innovator_flash_resource, 113 }; 114 115 #ifdef CONFIG_ARCH_OMAP15XX 116 117 /* Only FPGA needs to be mapped here. All others are done with ioremap */ ··· 169 .resource = innovator1510_smc91x_resources, 170 }; 171 172 static struct platform_device *innovator1510_devices[] __initdata = { 173 &innovator_flash_device, 174 &innovator1510_smc91x_device, 175 }; 176 177 #endif /* CONFIG_ARCH_OMAP15XX */ ··· 205 .resource = innovator1610_smc91x_resources, 206 }; 207 208 static struct platform_device *innovator1610_devices[] __initdata = { 209 &innovator_flash_device, 210 &innovator1610_smc91x_device, 211 }; 212 213 #endif /* CONFIG_ARCH_OMAP16XX */ ··· 260 }; 261 262 static struct omap_lcd_config innovator1510_lcd_config __initdata = { 263 - .panel_name = "inn1510", 264 .ctrl_name = "internal", 265 }; 266 #endif ··· 281 }; 282 283 static struct omap_lcd_config innovator1610_lcd_config __initdata = { 284 - .panel_name = "inn1610", 285 .ctrl_name = "internal", 286 }; 287 #endif
··· 22 #include <linux/delay.h> 23 #include <linux/mtd/mtd.h> 24 #include <linux/mtd/partitions.h> 25 + #include <linux/input.h> 26 27 #include <asm/hardware.h> 28 #include <asm/mach-types.h> ··· 34 #include <asm/arch/gpio.h> 35 #include <asm/arch/tc.h> 36 #include <asm/arch/usb.h> 37 + #include <asm/arch/keypad.h> 38 #include <asm/arch/common.h> 39 + 40 + static int innovator_keymap[] = { 41 + KEY(0, 0, KEY_F1), 42 + KEY(0, 3, KEY_DOWN), 43 + KEY(1, 1, KEY_F2), 44 + KEY(1, 2, KEY_RIGHT), 45 + KEY(2, 0, KEY_F3), 46 + KEY(2, 1, KEY_F4), 47 + KEY(2, 2, KEY_UP), 48 + KEY(3, 2, KEY_ENTER), 49 + KEY(3, 3, KEY_LEFT), 50 + 0 51 + }; 52 53 static struct mtd_partition innovator_partitions[] = { 54 /* bootloader (U-Boot, etc) in first sector */ ··· 97 .resource = &innovator_flash_resource, 98 }; 99 100 + static struct resource innovator_kp_resources[] = { 101 + [0] = { 102 + .start = INT_KEYBOARD, 103 + .end = INT_KEYBOARD, 104 + .flags = IORESOURCE_IRQ, 105 + }, 106 + }; 107 + 108 + static struct omap_kp_platform_data innovator_kp_data = { 109 + .rows = 8, 110 + .cols = 8, 111 + .keymap = innovator_keymap, 112 + }; 113 + 114 + static struct platform_device innovator_kp_device = { 115 + .name = "omap-keypad", 116 + .id = -1, 117 + .dev = { 118 + .platform_data = &innovator_kp_data, 119 + }, 120 + .num_resources = ARRAY_SIZE(innovator_kp_resources), 121 + .resource = innovator_kp_resources, 122 + }; 123 + 124 + 125 #ifdef CONFIG_ARCH_OMAP15XX 126 127 /* Only FPGA needs to be mapped here. All others are done with ioremap */ ··· 129 .resource = innovator1510_smc91x_resources, 130 }; 131 132 + static struct platform_device innovator1510_lcd_device = { 133 + .name = "lcd_inn1510", 134 + .id = -1, 135 + }; 136 + 137 static struct platform_device *innovator1510_devices[] __initdata = { 138 &innovator_flash_device, 139 &innovator1510_smc91x_device, 140 + &innovator_kp_device, 141 + &innovator1510_lcd_device, 142 }; 143 144 #endif /* CONFIG_ARCH_OMAP15XX */ ··· 158 .resource = innovator1610_smc91x_resources, 159 }; 160 161 + static struct platform_device innovator1610_lcd_device = { 162 + .name = "inn1610_lcd", 163 + .id = -1, 164 + }; 165 + 166 static struct platform_device *innovator1610_devices[] __initdata = { 167 &innovator_flash_device, 168 &innovator1610_smc91x_device, 169 + &innovator_kp_device, 170 + &innovator1610_lcd_device, 171 }; 172 173 #endif /* CONFIG_ARCH_OMAP16XX */ ··· 206 }; 207 208 static struct omap_lcd_config innovator1510_lcd_config __initdata = { 209 .ctrl_name = "internal", 210 }; 211 #endif ··· 228 }; 229 230 static struct omap_lcd_config innovator1610_lcd_config __initdata = { 231 .ctrl_name = "internal", 232 }; 233 #endif
-160
arch/arm/mach-omap1/board-netstar.c
··· 1 - /* 2 - * Modified from board-generic.c 3 - * 4 - * Copyright (C) 2004 2N Telekomunikace, Ladislav Michl <michl@2n.cz> 5 - * 6 - * Code for Netstar OMAP board. 7 - * 8 - * This program is free software; you can redistribute it and/or modify 9 - * it under the terms of the GNU General Public License version 2 as 10 - * published by the Free Software Foundation. 11 - */ 12 - 13 - #include <linux/delay.h> 14 - #include <linux/platform_device.h> 15 - #include <linux/interrupt.h> 16 - #include <linux/init.h> 17 - #include <linux/kernel.h> 18 - #include <linux/notifier.h> 19 - #include <linux/reboot.h> 20 - 21 - #include <asm/hardware.h> 22 - #include <asm/mach-types.h> 23 - #include <asm/mach/arch.h> 24 - #include <asm/mach/map.h> 25 - 26 - #include <asm/arch/gpio.h> 27 - #include <asm/arch/mux.h> 28 - #include <asm/arch/usb.h> 29 - #include <asm/arch/common.h> 30 - 31 - extern void __init omap_init_time(void); 32 - extern int omap_gpio_init(void); 33 - 34 - static struct resource netstar_smc91x_resources[] = { 35 - [0] = { 36 - .start = OMAP_CS1_PHYS + 0x300, 37 - .end = OMAP_CS1_PHYS + 0x300 + 16, 38 - .flags = IORESOURCE_MEM, 39 - }, 40 - [1] = { 41 - .start = OMAP_GPIO_IRQ(8), 42 - .end = OMAP_GPIO_IRQ(8), 43 - .flags = IORESOURCE_IRQ, 44 - }, 45 - }; 46 - 47 - static struct platform_device netstar_smc91x_device = { 48 - .name = "smc91x", 49 - .id = 0, 50 - .num_resources = ARRAY_SIZE(netstar_smc91x_resources), 51 - .resource = netstar_smc91x_resources, 52 - }; 53 - 54 - static struct platform_device *netstar_devices[] __initdata = { 55 - &netstar_smc91x_device, 56 - }; 57 - 58 - static struct omap_uart_config netstar_uart_config __initdata = { 59 - .enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)), 60 - }; 61 - 62 - static struct omap_board_config_kernel netstar_config[] = { 63 - { OMAP_TAG_UART, &netstar_uart_config }, 64 - }; 65 - 66 - static void __init netstar_init_irq(void) 67 - { 68 - omap1_init_common_hw(); 69 - omap_init_irq(); 70 - omap_gpio_init(); 71 - } 72 - 73 - static void __init netstar_init(void) 74 - { 75 - /* green LED */ 76 - omap_request_gpio(4); 77 - omap_set_gpio_direction(4, 0); 78 - /* smc91x reset */ 79 - omap_request_gpio(7); 80 - omap_set_gpio_direction(7, 0); 81 - omap_set_gpio_dataout(7, 1); 82 - udelay(2); /* wait at least 100ns */ 83 - omap_set_gpio_dataout(7, 0); 84 - mdelay(50); /* 50ms until PHY ready */ 85 - /* smc91x interrupt pin */ 86 - omap_request_gpio(8); 87 - 88 - omap_request_gpio(12); 89 - omap_request_gpio(13); 90 - omap_request_gpio(14); 91 - omap_request_gpio(15); 92 - set_irq_type(OMAP_GPIO_IRQ(12), IRQT_FALLING); 93 - set_irq_type(OMAP_GPIO_IRQ(13), IRQT_FALLING); 94 - set_irq_type(OMAP_GPIO_IRQ(14), IRQT_FALLING); 95 - set_irq_type(OMAP_GPIO_IRQ(15), IRQT_FALLING); 96 - 97 - platform_add_devices(netstar_devices, ARRAY_SIZE(netstar_devices)); 98 - 99 - /* Switch on green LED */ 100 - omap_set_gpio_dataout(4, 0); 101 - /* Switch off red LED */ 102 - omap_writeb(0x00, OMAP_LPG1_PMR); /* Disable clock */ 103 - omap_writeb(0x80, OMAP_LPG1_LCR); 104 - 105 - omap_board_config = netstar_config; 106 - omap_board_config_size = ARRAY_SIZE(netstar_config); 107 - omap_serial_init(); 108 - } 109 - 110 - static void __init netstar_map_io(void) 111 - { 112 - omap1_map_common_io(); 113 - } 114 - 115 - #define MACHINE_PANICED 1 116 - #define MACHINE_REBOOTING 2 117 - #define MACHINE_REBOOT 4 118 - static unsigned long machine_state; 119 - 120 - static int panic_event(struct notifier_block *this, unsigned long event, 121 - void *ptr) 122 - { 123 - if (test_and_set_bit(MACHINE_PANICED, &machine_state)) 124 - return NOTIFY_DONE; 125 - 126 - /* Switch off green LED */ 127 - omap_set_gpio_dataout(4, 1); 128 - /* Flash red LED */ 129 - omap_writeb(0x78, OMAP_LPG1_LCR); 130 - omap_writeb(0x01, OMAP_LPG1_PMR); /* Enable clock */ 131 - 132 - return NOTIFY_DONE; 133 - } 134 - 135 - static struct notifier_block panic_block = { 136 - .notifier_call = panic_event, 137 - }; 138 - 139 - static int __init netstar_late_init(void) 140 - { 141 - /* TODO: Setup front panel switch here */ 142 - 143 - /* Setup panic notifier */ 144 - atomic_notifier_chain_register(&panic_notifier_list, &panic_block); 145 - 146 - return 0; 147 - } 148 - 149 - postcore_initcall(netstar_late_init); 150 - 151 - MACHINE_START(NETSTAR, "NetStar OMAP5910") 152 - /* Maintainer: Ladislav Michl <michl@2n.cz> */ 153 - .phys_io = 0xfff00000, 154 - .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc, 155 - .boot_params = 0x10000100, 156 - .map_io = netstar_map_io, 157 - .init_irq = netstar_init_irq, 158 - .init_machine = netstar_init, 159 - .timer = &omap_timer, 160 - MACHINE_END
···
+268
arch/arm/mach-omap1/board-nokia770.c
···
··· 1 + /* 2 + * linux/arch/arm/mach-omap1/board-nokia770.c 3 + * 4 + * Modified from board-generic.c 5 + * 6 + * This program is free software; you can redistribute it and/or modify 7 + * it under the terms of the GNU General Public License version 2 as 8 + * published by the Free Software Foundation. 9 + */ 10 + 11 + #include <linux/kernel.h> 12 + #include <linux/init.h> 13 + #include <linux/platform_device.h> 14 + #include <linux/input.h> 15 + #include <linux/clk.h> 16 + 17 + #include <linux/spi/spi.h> 18 + #include <linux/spi/ads7846.h> 19 + 20 + #include <asm/hardware.h> 21 + #include <asm/mach-types.h> 22 + #include <asm/mach/arch.h> 23 + #include <asm/mach/map.h> 24 + 25 + #include <asm/arch/gpio.h> 26 + #include <asm/arch/mux.h> 27 + #include <asm/arch/usb.h> 28 + #include <asm/arch/board.h> 29 + #include <asm/arch/keypad.h> 30 + #include <asm/arch/common.h> 31 + #include <asm/arch/dsp_common.h> 32 + #include <asm/arch/aic23.h> 33 + #include <asm/arch/gpio.h> 34 + 35 + static void __init omap_nokia770_init_irq(void) 36 + { 37 + /* On Nokia 770, the SleepX signal is masked with an 38 + * MPUIO line by default. It has to be unmasked for it 39 + * to become functional */ 40 + 41 + /* SleepX mask direction */ 42 + omap_writew((omap_readw(0xfffb5008) & ~2), 0xfffb5008); 43 + /* Unmask SleepX signal */ 44 + omap_writew((omap_readw(0xfffb5004) & ~2), 0xfffb5004); 45 + 46 + omap1_init_common_hw(); 47 + omap_init_irq(); 48 + } 49 + 50 + static int nokia770_keymap[] = { 51 + KEY(0, 1, GROUP_0 | KEY_UP), 52 + KEY(0, 2, GROUP_1 | KEY_F5), 53 + KEY(1, 0, GROUP_0 | KEY_LEFT), 54 + KEY(1, 1, GROUP_0 | KEY_ENTER), 55 + KEY(1, 2, GROUP_0 | KEY_RIGHT), 56 + KEY(2, 0, GROUP_1 | KEY_ESC), 57 + KEY(2, 1, GROUP_0 | KEY_DOWN), 58 + KEY(2, 2, GROUP_1 | KEY_F4), 59 + KEY(3, 0, GROUP_2 | KEY_F7), 60 + KEY(3, 1, GROUP_2 | KEY_F8), 61 + KEY(3, 2, GROUP_2 | KEY_F6), 62 + 0 63 + }; 64 + 65 + static struct resource nokia770_kp_resources[] = { 66 + [0] = { 67 + .start = INT_KEYBOARD, 68 + .end = INT_KEYBOARD, 69 + .flags = IORESOURCE_IRQ, 70 + }, 71 + }; 72 + 73 + static struct omap_kp_platform_data nokia770_kp_data = { 74 + .rows = 8, 75 + .cols = 8, 76 + .keymap = nokia770_keymap 77 + }; 78 + 79 + static struct platform_device nokia770_kp_device = { 80 + .name = "omap-keypad", 81 + .id = -1, 82 + .dev = { 83 + .platform_data = &nokia770_kp_data, 84 + }, 85 + .num_resources = ARRAY_SIZE(nokia770_kp_resources), 86 + .resource = nokia770_kp_resources, 87 + }; 88 + 89 + static struct platform_device *nokia770_devices[] __initdata = { 90 + &nokia770_kp_device, 91 + }; 92 + 93 + static struct ads7846_platform_data nokia770_ads7846_platform_data __initdata = { 94 + .x_max = 0x0fff, 95 + .y_max = 0x0fff, 96 + .x_plate_ohms = 180, 97 + .pressure_max = 255, 98 + .debounce_max = 10, 99 + .debounce_tol = 3, 100 + }; 101 + 102 + static struct spi_board_info nokia770_spi_board_info[] __initdata = { 103 + [0] = { 104 + .modalias = "lcd_lph8923", 105 + .bus_num = 2, 106 + .chip_select = 3, 107 + .max_speed_hz = 12000000, 108 + }, 109 + [1] = { 110 + .modalias = "ads7846", 111 + .bus_num = 2, 112 + .chip_select = 0, 113 + .max_speed_hz = 2500000, 114 + .irq = OMAP_GPIO_IRQ(15), 115 + .platform_data = &nokia770_ads7846_platform_data, 116 + }, 117 + }; 118 + 119 + 120 + /* assume no Mini-AB port */ 121 + 122 + static struct omap_usb_config nokia770_usb_config __initdata = { 123 + .otg = 1, 124 + .register_host = 1, 125 + .register_dev = 1, 126 + .hmc_mode = 16, 127 + .pins[0] = 6, 128 + }; 129 + 130 + static struct omap_mmc_config nokia770_mmc_config __initdata = { 131 + .mmc[0] = { 132 + .enabled = 0, 133 + .wire4 = 0, 134 + .wp_pin = -1, 135 + .power_pin = -1, 136 + .switch_pin = -1, 137 + }, 138 + .mmc[1] = { 139 + .enabled = 0, 140 + .wire4 = 0, 141 + .wp_pin = -1, 142 + .power_pin = -1, 143 + .switch_pin = -1, 144 + }, 145 + }; 146 + 147 + static struct omap_board_config_kernel nokia770_config[] = { 148 + { OMAP_TAG_USB, NULL }, 149 + { OMAP_TAG_MMC, &nokia770_mmc_config }, 150 + }; 151 + 152 + /* 153 + * audio power control 154 + */ 155 + #define HEADPHONE_GPIO 14 156 + #define AMPLIFIER_CTRL_GPIO 58 157 + 158 + static struct clk *dspxor_ck; 159 + static DECLARE_MUTEX(audio_pwr_sem); 160 + /* 161 + * audio_pwr_state 162 + * +--+-------------------------+---------------------------------------+ 163 + * |-1|down |power-up request -> 0 | 164 + * +--+-------------------------+---------------------------------------+ 165 + * | 0|up |power-down(1) request -> 1 | 166 + * | | |power-down(2) request -> (ignore) | 167 + * +--+-------------------------+---------------------------------------+ 168 + * | 1|up, |power-up request -> 0 | 169 + * | |received down(1) request |power-down(2) request -> -1 | 170 + * +--+-------------------------+---------------------------------------+ 171 + */ 172 + static int audio_pwr_state = -1; 173 + 174 + /* 175 + * audio_pwr_up / down should be called under audio_pwr_sem 176 + */ 177 + static void nokia770_audio_pwr_up(void) 178 + { 179 + clk_enable(dspxor_ck); 180 + 181 + /* Turn on codec */ 182 + tlv320aic23_power_up(); 183 + 184 + if (omap_get_gpio_datain(HEADPHONE_GPIO)) 185 + /* HP not connected, turn on amplifier */ 186 + omap_set_gpio_dataout(AMPLIFIER_CTRL_GPIO, 1); 187 + else 188 + /* HP connected, do not turn on amplifier */ 189 + printk("HP connected\n"); 190 + } 191 + 192 + static void codec_delayed_power_down(void *arg) 193 + { 194 + down(&audio_pwr_sem); 195 + if (audio_pwr_state == -1) 196 + tlv320aic23_power_down(); 197 + clk_disable(dspxor_ck); 198 + up(&audio_pwr_sem); 199 + } 200 + 201 + static DECLARE_WORK(codec_power_down_work, codec_delayed_power_down, NULL); 202 + 203 + static void nokia770_audio_pwr_down(void) 204 + { 205 + /* Turn off amplifier */ 206 + omap_set_gpio_dataout(AMPLIFIER_CTRL_GPIO, 0); 207 + 208 + /* Turn off codec: schedule delayed work */ 209 + schedule_delayed_work(&codec_power_down_work, HZ / 20); /* 50ms */ 210 + } 211 + 212 + void nokia770_audio_pwr_up_request(int stage) 213 + { 214 + down(&audio_pwr_sem); 215 + if (audio_pwr_state == -1) 216 + nokia770_audio_pwr_up(); 217 + /* force audio_pwr_state = 0, even if it was 1. */ 218 + audio_pwr_state = 0; 219 + up(&audio_pwr_sem); 220 + } 221 + 222 + void nokia770_audio_pwr_down_request(int stage) 223 + { 224 + down(&audio_pwr_sem); 225 + switch (stage) { 226 + case 1: 227 + if (audio_pwr_state == 0) 228 + audio_pwr_state = 1; 229 + break; 230 + case 2: 231 + if (audio_pwr_state == 1) { 232 + nokia770_audio_pwr_down(); 233 + audio_pwr_state = -1; 234 + } 235 + break; 236 + } 237 + up(&audio_pwr_sem); 238 + } 239 + 240 + static void __init omap_nokia770_init(void) 241 + { 242 + nokia770_config[0].data = &nokia770_usb_config; 243 + 244 + platform_add_devices(nokia770_devices, ARRAY_SIZE(nokia770_devices)); 245 + spi_register_board_info(nokia770_spi_board_info, 246 + ARRAY_SIZE(nokia770_spi_board_info)); 247 + omap_board_config = nokia770_config; 248 + omap_board_config_size = ARRAY_SIZE(nokia770_config); 249 + omap_serial_init(); 250 + omap_dsp_audio_pwr_up_request = nokia770_audio_pwr_up_request; 251 + omap_dsp_audio_pwr_down_request = nokia770_audio_pwr_down_request; 252 + dspxor_ck = clk_get(0, "dspxor_ck"); 253 + } 254 + 255 + static void __init omap_nokia770_map_io(void) 256 + { 257 + omap1_map_common_io(); 258 + } 259 + 260 + MACHINE_START(NOKIA770, "Nokia 770") 261 + .phys_io = 0xfff00000, 262 + .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc, 263 + .boot_params = 0x10000100, 264 + .map_io = omap_nokia770_map_io, 265 + .init_irq = omap_nokia770_init_irq, 266 + .init_machine = omap_nokia770_init, 267 + .timer = &omap_timer, 268 + MACHINE_END
+92 -3
arch/arm/mach-omap1/board-osk.c
··· 33 34 #include <linux/mtd/mtd.h> 35 #include <linux/mtd/partitions.h> 36 37 #include <asm/hardware.h> 38 #include <asm/mach-types.h> ··· 45 #include <asm/arch/usb.h> 46 #include <asm/arch/mux.h> 47 #include <asm/arch/tc.h> 48 #include <asm/arch/common.h> 49 50 static struct mtd_partition osk_partitions[] = { 51 /* bootloader (U-Boot, etc) in first sector */ ··· 151 .resource = osk5912_cf_resources, 152 }; 153 154 static struct platform_device osk5912_mcbsp1_device = { 155 - .name = "omap_mcbsp", 156 - .id = 1, 157 }; 158 159 static struct platform_device *osk5912_devices[] __initdata = { ··· 221 &osk5912_smc91x_device, 222 &osk5912_cf_device, 223 &osk5912_mcbsp1_device, 224 }; 225 226 static void __init osk_init_smc91x(void) ··· 277 }; 278 279 static struct omap_lcd_config osk_lcd_config __initdata = { 280 - .panel_name = "osk", 281 .ctrl_name = "internal", 282 }; 283 ··· 334 static void __init osk_mistral_init(void) { } 335 #endif 336 337 static void __init osk_init(void) 338 { 339 osk_flash_resource.end = osk_flash_resource.start = omap_cs3_phys(); 340 osk_flash_resource.end += SZ_32M - 1; 341 platform_add_devices(osk5912_devices, ARRAY_SIZE(osk5912_devices));
··· 33 34 #include <linux/mtd/mtd.h> 35 #include <linux/mtd/partitions.h> 36 + #include <linux/input.h> 37 38 #include <asm/hardware.h> 39 #include <asm/mach-types.h> ··· 44 #include <asm/arch/usb.h> 45 #include <asm/arch/mux.h> 46 #include <asm/arch/tc.h> 47 + #include <asm/arch/keypad.h> 48 #include <asm/arch/common.h> 49 + #include <asm/arch/mcbsp.h> 50 + #include <asm/arch/omap-alsa.h> 51 + 52 + static int osk_keymap[] = { 53 + KEY(0, 0, KEY_F1), 54 + KEY(0, 3, KEY_UP), 55 + KEY(1, 1, KEY_LEFTCTRL), 56 + KEY(1, 2, KEY_LEFT), 57 + KEY(2, 0, KEY_SPACE), 58 + KEY(2, 1, KEY_ESC), 59 + KEY(2, 2, KEY_DOWN), 60 + KEY(3, 2, KEY_ENTER), 61 + KEY(3, 3, KEY_RIGHT), 62 + 0 63 + }; 64 + 65 66 static struct mtd_partition osk_partitions[] = { 67 /* bootloader (U-Boot, etc) in first sector */ ··· 133 .resource = osk5912_cf_resources, 134 }; 135 136 + #define DEFAULT_BITPERSAMPLE 16 137 + 138 + static struct omap_mcbsp_reg_cfg mcbsp_regs = { 139 + .spcr2 = FREE | FRST | GRST | XRST | XINTM(3), 140 + .spcr1 = RINTM(3) | RRST, 141 + .rcr2 = RPHASE | RFRLEN2(OMAP_MCBSP_WORD_8) | 142 + RWDLEN2(OMAP_MCBSP_WORD_16) | RDATDLY(0), 143 + .rcr1 = RFRLEN1(OMAP_MCBSP_WORD_8) | RWDLEN1(OMAP_MCBSP_WORD_16), 144 + .xcr2 = XPHASE | XFRLEN2(OMAP_MCBSP_WORD_8) | 145 + XWDLEN2(OMAP_MCBSP_WORD_16) | XDATDLY(0) | XFIG, 146 + .xcr1 = XFRLEN1(OMAP_MCBSP_WORD_8) | XWDLEN1(OMAP_MCBSP_WORD_16), 147 + .srgr1 = FWID(DEFAULT_BITPERSAMPLE - 1), 148 + .srgr2 = GSYNC | CLKSP | FSGM | FPER(DEFAULT_BITPERSAMPLE * 2 - 1), 149 + /*.pcr0 = FSXM | FSRM | CLKXM | CLKRM | CLKXP | CLKRP,*/ /* mcbsp: master */ 150 + .pcr0 = CLKXP | CLKRP, /* mcbsp: slave */ 151 + }; 152 + 153 + static struct omap_alsa_codec_config alsa_config = { 154 + .name = "OSK AIC23", 155 + .mcbsp_regs_alsa = &mcbsp_regs, 156 + .codec_configure_dev = NULL, // aic23_configure, 157 + .codec_set_samplerate = NULL, // aic23_set_samplerate, 158 + .codec_clock_setup = NULL, // aic23_clock_setup, 159 + .codec_clock_on = NULL, // aic23_clock_on, 160 + .codec_clock_off = NULL, // aic23_clock_off, 161 + .get_default_samplerate = NULL, // aic23_get_default_samplerate, 162 + }; 163 + 164 static struct platform_device osk5912_mcbsp1_device = { 165 + .name = "omap_alsa_mcbsp", 166 + .id = 1, 167 + .dev = { 168 + .platform_data = &alsa_config, 169 + }, 170 + }; 171 + 172 + static struct resource osk5912_kp_resources[] = { 173 + [0] = { 174 + .start = INT_KEYBOARD, 175 + .end = INT_KEYBOARD, 176 + .flags = IORESOURCE_IRQ, 177 + }, 178 + }; 179 + 180 + static struct omap_kp_platform_data osk_kp_data = { 181 + .rows = 8, 182 + .cols = 8, 183 + .keymap = osk_keymap, 184 + }; 185 + 186 + static struct platform_device osk5912_kp_device = { 187 + .name = "omap-keypad", 188 + .id = -1, 189 + .dev = { 190 + .platform_data = &osk_kp_data, 191 + }, 192 + .num_resources = ARRAY_SIZE(osk5912_kp_resources), 193 + .resource = osk5912_kp_resources, 194 + }; 195 + 196 + static struct platform_device osk5912_lcd_device = { 197 + .name = "lcd_osk", 198 + .id = -1, 199 }; 200 201 static struct platform_device *osk5912_devices[] __initdata = { ··· 143 &osk5912_smc91x_device, 144 &osk5912_cf_device, 145 &osk5912_mcbsp1_device, 146 + &osk5912_kp_device, 147 + &osk5912_lcd_device, 148 }; 149 150 static void __init osk_init_smc91x(void) ··· 197 }; 198 199 static struct omap_lcd_config osk_lcd_config __initdata = { 200 .ctrl_name = "internal", 201 }; 202 ··· 255 static void __init osk_mistral_init(void) { } 256 #endif 257 258 + #define EMIFS_CS3_VAL (0x88013141) 259 + 260 static void __init osk_init(void) 261 { 262 + /* Workaround for wrong CS3 (NOR flash) timing 263 + * There are some U-Boot versions out there which configure 264 + * wrong CS3 memory timings. This mainly leads to CRC 265 + * or similiar errors if you use NOR flash (e.g. with JFFS2) 266 + */ 267 + if (EMIFS_CCS(3) != EMIFS_CS3_VAL) 268 + EMIFS_CCS(3) = EMIFS_CS3_VAL; 269 + 270 osk_flash_resource.end = osk_flash_resource.start = omap_cs3_phys(); 271 osk_flash_resource.end += SZ_32M - 1; 272 platform_add_devices(osk5912_devices, ARRAY_SIZE(osk5912_devices));
+11 -1
arch/arm/mach-omap1/board-palmte.c
··· 38 omap_init_irq(); 39 } 40 41 static struct omap_usb_config palmte_usb_config __initdata = { 42 .register_dev = 1, 43 .hmc_mode = 0, ··· 64 }; 65 66 static struct omap_lcd_config palmte_lcd_config __initdata = { 67 - .panel_name = "palmte", 68 .ctrl_name = "internal", 69 }; 70 ··· 77 { 78 omap_board_config = palmte_config; 79 omap_board_config_size = ARRAY_SIZE(palmte_config); 80 } 81 82 static void __init omap_generic_map_io(void)
··· 38 omap_init_irq(); 39 } 40 41 + static struct platform_device palmte_lcd_device = { 42 + .name = "lcd_palmte", 43 + .id = -1, 44 + }; 45 + 46 + static struct platform_device *devices[] __initdata = { 47 + &palmte_lcd_device, 48 + }; 49 + 50 static struct omap_usb_config palmte_usb_config __initdata = { 51 .register_dev = 1, 52 .hmc_mode = 0, ··· 55 }; 56 57 static struct omap_lcd_config palmte_lcd_config __initdata = { 58 .ctrl_name = "internal", 59 }; 60 ··· 69 { 70 omap_board_config = palmte_config; 71 omap_board_config_size = ARRAY_SIZE(palmte_config); 72 + 73 + platform_add_devices(devices, ARRAY_SIZE(devices)); 74 } 75 76 static void __init omap_generic_map_io(void)
+114 -13
arch/arm/mach-omap1/board-perseus2.c
··· 16 #include <linux/platform_device.h> 17 #include <linux/delay.h> 18 #include <linux/mtd/mtd.h> 19 #include <linux/mtd/partitions.h> 20 21 #include <asm/hardware.h> 22 #include <asm/mach-types.h> ··· 30 #include <asm/arch/gpio.h> 31 #include <asm/arch/mux.h> 32 #include <asm/arch/fpga.h> 33 #include <asm/arch/common.h> 34 #include <asm/arch/board.h> 35 36 static struct resource smc91x_resources[] = { 37 [0] = { ··· 81 }, 82 }; 83 84 - static struct mtd_partition p2_partitions[] = { 85 /* bootloader (U-Boot, etc) in first sector */ 86 { 87 .name = "bootloader", ··· 112 }, 113 }; 114 115 - static struct flash_platform_data p2_flash_data = { 116 .map_name = "cfi_probe", 117 .width = 2, 118 - .parts = p2_partitions, 119 - .nr_parts = ARRAY_SIZE(p2_partitions), 120 }; 121 122 - static struct resource p2_flash_resource = { 123 .start = OMAP_CS0_PHYS, 124 .end = OMAP_CS0_PHYS + SZ_32M - 1, 125 .flags = IORESOURCE_MEM, 126 }; 127 128 - static struct platform_device p2_flash_device = { 129 .name = "omapflash", 130 .id = 0, 131 .dev = { 132 - .platform_data = &p2_flash_data, 133 }, 134 .num_resources = 1, 135 - .resource = &p2_flash_resource, 136 }; 137 138 static struct platform_device smc91x_device = { ··· 162 .resource = smc91x_resources, 163 }; 164 165 - static struct platform_device *devices[] __initdata = { 166 - &p2_flash_device, 167 - &smc91x_device, 168 }; 169 170 static struct omap_uart_config perseus2_uart_config __initdata = { 171 .enabled_uarts = ((1 << 0) | (1 << 1)), 172 }; 173 174 static struct omap_lcd_config perseus2_lcd_config __initdata = { 175 - .panel_name = "p2", 176 .ctrl_name = "internal", 177 }; 178 ··· 221 222 static void __init omap_perseus2_init(void) 223 { 224 - (void) platform_add_devices(devices, ARRAY_SIZE(devices)); 225 226 omap_board_config = perseus2_config; 227 omap_board_config_size = ARRAY_SIZE(perseus2_config);
··· 16 #include <linux/platform_device.h> 17 #include <linux/delay.h> 18 #include <linux/mtd/mtd.h> 19 + #include <linux/mtd/nand.h> 20 #include <linux/mtd/partitions.h> 21 + #include <linux/input.h> 22 23 #include <asm/hardware.h> 24 #include <asm/mach-types.h> ··· 28 #include <asm/arch/gpio.h> 29 #include <asm/arch/mux.h> 30 #include <asm/arch/fpga.h> 31 + #include <asm/arch/keypad.h> 32 #include <asm/arch/common.h> 33 #include <asm/arch/board.h> 34 + 35 + static int p2_keymap[] = { 36 + KEY(0,0,KEY_UP), 37 + KEY(0,1,KEY_RIGHT), 38 + KEY(0,2,KEY_LEFT), 39 + KEY(0,3,KEY_DOWN), 40 + KEY(0,4,KEY_CENTER), 41 + KEY(0,5,KEY_0_5), 42 + KEY(1,0,KEY_SOFT2), 43 + KEY(1,1,KEY_SEND), 44 + KEY(1,2,KEY_END), 45 + KEY(1,3,KEY_VOLUMEDOWN), 46 + KEY(1,4,KEY_VOLUMEUP), 47 + KEY(1,5,KEY_RECORD), 48 + KEY(2,0,KEY_SOFT1), 49 + KEY(2,1,KEY_3), 50 + KEY(2,2,KEY_6), 51 + KEY(2,3,KEY_9), 52 + KEY(2,4,KEY_SHARP), 53 + KEY(2,5,KEY_2_5), 54 + KEY(3,0,KEY_BACK), 55 + KEY(3,1,KEY_2), 56 + KEY(3,2,KEY_5), 57 + KEY(3,3,KEY_8), 58 + KEY(3,4,KEY_0), 59 + KEY(3,5,KEY_HEADSETHOOK), 60 + KEY(4,0,KEY_HOME), 61 + KEY(4,1,KEY_1), 62 + KEY(4,2,KEY_4), 63 + KEY(4,3,KEY_7), 64 + KEY(4,4,KEY_STAR), 65 + KEY(4,5,KEY_POWER), 66 + 0 67 + }; 68 69 static struct resource smc91x_resources[] = { 70 [0] = { ··· 44 }, 45 }; 46 47 + static struct mtd_partition nor_partitions[] = { 48 /* bootloader (U-Boot, etc) in first sector */ 49 { 50 .name = "bootloader", ··· 75 }, 76 }; 77 78 + static struct flash_platform_data nor_data = { 79 .map_name = "cfi_probe", 80 .width = 2, 81 + .parts = nor_partitions, 82 + .nr_parts = ARRAY_SIZE(nor_partitions), 83 }; 84 85 + static struct resource nor_resource = { 86 .start = OMAP_CS0_PHYS, 87 .end = OMAP_CS0_PHYS + SZ_32M - 1, 88 .flags = IORESOURCE_MEM, 89 }; 90 91 + static struct platform_device nor_device = { 92 .name = "omapflash", 93 .id = 0, 94 .dev = { 95 + .platform_data = &nor_data, 96 }, 97 .num_resources = 1, 98 + .resource = &nor_resource, 99 + }; 100 + 101 + static struct nand_platform_data nand_data = { 102 + .options = NAND_SAMSUNG_LP_OPTIONS, 103 + }; 104 + 105 + static struct resource nand_resource = { 106 + .start = OMAP_CS3_PHYS, 107 + .end = OMAP_CS3_PHYS + SZ_4K - 1, 108 + .flags = IORESOURCE_MEM, 109 + }; 110 + 111 + static struct platform_device nand_device = { 112 + .name = "omapnand", 113 + .id = 0, 114 + .dev = { 115 + .platform_data = &nand_data, 116 + }, 117 + .num_resources = 1, 118 + .resource = &nand_resource, 119 }; 120 121 static struct platform_device smc91x_device = { ··· 105 .resource = smc91x_resources, 106 }; 107 108 + static struct resource kp_resources[] = { 109 + [0] = { 110 + .start = INT_730_MPUIO_KEYPAD, 111 + .end = INT_730_MPUIO_KEYPAD, 112 + .flags = IORESOURCE_IRQ, 113 + }, 114 }; 115 + 116 + static struct omap_kp_platform_data kp_data = { 117 + .rows = 8, 118 + .cols = 8, 119 + .keymap = p2_keymap, 120 + }; 121 + 122 + static struct platform_device kp_device = { 123 + .name = "omap-keypad", 124 + .id = -1, 125 + .dev = { 126 + .platform_data = &kp_data, 127 + }, 128 + .num_resources = ARRAY_SIZE(kp_resources), 129 + .resource = kp_resources, 130 + }; 131 + 132 + static struct platform_device lcd_device = { 133 + .name = "lcd_p2", 134 + .id = -1, 135 + }; 136 + 137 + static struct platform_device *devices[] __initdata = { 138 + &nor_device, 139 + &nand_device, 140 + &smc91x_device, 141 + &kp_device, 142 + &lcd_device, 143 + }; 144 + 145 + #define P2_NAND_RB_GPIO_PIN 62 146 + 147 + static int nand_dev_ready(struct nand_platform_data *data) 148 + { 149 + return omap_get_gpio_datain(P2_NAND_RB_GPIO_PIN); 150 + } 151 152 static struct omap_uart_config perseus2_uart_config __initdata = { 153 .enabled_uarts = ((1 << 0) | (1 << 1)), 154 }; 155 156 static struct omap_lcd_config perseus2_lcd_config __initdata = { 157 .ctrl_name = "internal", 158 }; 159 ··· 126 127 static void __init omap_perseus2_init(void) 128 { 129 + if (!(omap_request_gpio(P2_NAND_RB_GPIO_PIN))) 130 + nand_data.dev_ready = nand_dev_ready; 131 + 132 + omap_cfg_reg(L3_1610_FLASH_CS2B_OE); 133 + omap_cfg_reg(M8_1610_FLASH_CS2B_WE); 134 + 135 + platform_add_devices(devices, ARRAY_SIZE(devices)); 136 137 omap_board_config = perseus2_config; 138 omap_board_config_size = ARRAY_SIZE(perseus2_config);
+4 -4
arch/arm/mach-omap1/board-voiceblue.c
··· 155 }; 156 157 static struct omap_board_config_kernel voiceblue_config[] = { 158 - { OMAP_TAG_USB, &voiceblue_usb_config }, 159 - { OMAP_TAG_MMC, &voiceblue_mmc_config }, 160 - { OMAP_TAG_UART, &voiceblue_uart_config }, 161 }; 162 163 static void __init voiceblue_init_irq(void) ··· 235 static int __init voiceblue_setup(void) 236 { 237 /* Setup panic notifier */ 238 - atomic_notifier_chain_register(&panic_notifier_list, &panic_block); 239 240 return 0; 241 }
··· 155 }; 156 157 static struct omap_board_config_kernel voiceblue_config[] = { 158 + { OMAP_TAG_USB, &voiceblue_usb_config }, 159 + { OMAP_TAG_MMC, &voiceblue_mmc_config }, 160 + { OMAP_TAG_UART, &voiceblue_uart_config }, 161 }; 162 163 static void __init voiceblue_init_irq(void) ··· 235 static int __init voiceblue_setup(void) 236 { 237 /* Setup panic notifier */ 238 + notifier_chain_register(&panic_notifier_list, &panic_block); 239 240 return 0; 241 }
+7 -2
arch/arm/mach-omap1/clock.c
··· 345 */ 346 for (dsor = 2; dsor < 96; ++dsor) { 347 if ((dsor & 1) && dsor > 8) 348 - continue; 349 if (rate >= 96000000 / dsor) 350 break; 351 } ··· 687 clk_register(*clkp); 688 continue; 689 } 690 } 691 692 info = omap_get_config(OMAP_TAG_CLOCK, struct omap_clock_config); ··· 789 clk_enable(&armxor_ck.clk); 790 clk_enable(&armtim_ck.clk); /* This should be done by timer code */ 791 792 - if (cpu_is_omap1510()) 793 clk_enable(&arm_gpio_ck); 794 795 return 0;
··· 345 */ 346 for (dsor = 2; dsor < 96; ++dsor) { 347 if ((dsor & 1) && dsor > 8) 348 + continue; 349 if (rate >= 96000000 / dsor) 350 break; 351 } ··· 687 clk_register(*clkp); 688 continue; 689 } 690 + 691 + if (((*clkp)->flags &CLOCK_IN_OMAP310) && cpu_is_omap310()) { 692 + clk_register(*clkp); 693 + continue; 694 + } 695 } 696 697 info = omap_get_config(OMAP_TAG_CLOCK, struct omap_clock_config); ··· 784 clk_enable(&armxor_ck.clk); 785 clk_enable(&armtim_ck.clk); /* This should be done by timer code */ 786 787 + if (cpu_is_omap15xx()) 788 clk_enable(&arm_gpio_ck); 789 790 return 0;
+59 -32
arch/arm/mach-omap1/clock.h
··· 151 .name = "ck_ref", 152 .rate = 12000000, 153 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 154 - ALWAYS_ENABLED, 155 .enable = &omap1_clk_enable_generic, 156 .disable = &omap1_clk_disable_generic, 157 }; ··· 160 .name = "ck_dpll1", 161 .parent = &ck_ref, 162 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 163 - RATE_PROPAGATES | ALWAYS_ENABLED, 164 .enable = &omap1_clk_enable_generic, 165 .disable = &omap1_clk_disable_generic, 166 }; ··· 183 .name = "arm_ck", 184 .parent = &ck_dpll1, 185 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 186 - RATE_CKCTL | RATE_PROPAGATES | ALWAYS_ENABLED, 187 .rate_offset = CKCTL_ARMDIV_OFFSET, 188 .recalc = &omap1_ckctl_recalc, 189 .enable = &omap1_clk_enable_generic, ··· 196 .name = "armper_ck", 197 .parent = &ck_dpll1, 198 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 199 - RATE_CKCTL | CLOCK_IDLE_CONTROL, 200 .enable_reg = (void __iomem *)ARM_IDLECT2, 201 .enable_bit = EN_PERCK, 202 .rate_offset = CKCTL_PERDIV_OFFSET, ··· 211 static struct clk arm_gpio_ck = { 212 .name = "arm_gpio_ck", 213 .parent = &ck_dpll1, 214 - .flags = CLOCK_IN_OMAP1510, 215 .enable_reg = (void __iomem *)ARM_IDLECT2, 216 .enable_bit = EN_GPIOCK, 217 .recalc = &followparent_recalc, ··· 224 .name = "armxor_ck", 225 .parent = &ck_ref, 226 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 227 - CLOCK_IDLE_CONTROL, 228 .enable_reg = (void __iomem *)ARM_IDLECT2, 229 .enable_bit = EN_XORPCK, 230 .recalc = &followparent_recalc, ··· 239 .name = "armtim_ck", 240 .parent = &ck_ref, 241 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 242 - CLOCK_IDLE_CONTROL, 243 .enable_reg = (void __iomem *)ARM_IDLECT2, 244 .enable_bit = EN_TIMCK, 245 .recalc = &followparent_recalc, ··· 254 .name = "armwdt_ck", 255 .parent = &ck_ref, 256 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 257 - CLOCK_IDLE_CONTROL, 258 .enable_reg = (void __iomem *)ARM_IDLECT2, 259 .enable_bit = EN_WDTCK, 260 .recalc = &omap1_watchdog_recalc, ··· 346 .name = "tc_ck", 347 .parent = &ck_dpll1, 348 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 349 - CLOCK_IN_OMAP730 | RATE_CKCTL | 350 - RATE_PROPAGATES | ALWAYS_ENABLED | 351 - CLOCK_IDLE_CONTROL, 352 .rate_offset = CKCTL_TCDIV_OFFSET, 353 .recalc = &omap1_ckctl_recalc, 354 .enable = &omap1_clk_enable_generic, ··· 360 static struct clk arminth_ck1510 = { 361 .name = "arminth_ck", 362 .parent = &tc_ck.clk, 363 - .flags = CLOCK_IN_OMAP1510 | ALWAYS_ENABLED, 364 .recalc = &followparent_recalc, 365 /* Note: On 1510 the frequency follows TC_CK 366 * ··· 375 /* No-idle controlled by "tc_ck" */ 376 .name = "tibp_ck", 377 .parent = &tc_ck.clk, 378 - .flags = CLOCK_IN_OMAP1510 | ALWAYS_ENABLED, 379 .recalc = &followparent_recalc, 380 .enable = &omap1_clk_enable_generic, 381 .disable = &omap1_clk_disable_generic, ··· 421 .name = "dma_ck", 422 .parent = &tc_ck.clk, 423 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 424 - ALWAYS_ENABLED, 425 .recalc = &followparent_recalc, 426 .enable = &omap1_clk_enable_generic, 427 .disable = &omap1_clk_disable_generic, ··· 441 .name = "api_ck", 442 .parent = &tc_ck.clk, 443 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 444 - CLOCK_IDLE_CONTROL, 445 .enable_reg = (void __iomem *)ARM_IDLECT2, 446 .enable_bit = EN_APICK, 447 .recalc = &followparent_recalc, ··· 455 .clk = { 456 .name = "lb_ck", 457 .parent = &tc_ck.clk, 458 - .flags = CLOCK_IN_OMAP1510 | CLOCK_IDLE_CONTROL, 459 .enable_reg = (void __iomem *)ARM_IDLECT2, 460 .enable_bit = EN_LBCK, 461 .recalc = &followparent_recalc, ··· 500 .clk = { 501 .name = "lcd_ck", 502 .parent = &ck_dpll1, 503 - .flags = CLOCK_IN_OMAP1510 | RATE_CKCTL | 504 - CLOCK_IDLE_CONTROL, 505 .enable_reg = (void __iomem *)ARM_IDLECT2, 506 .enable_bit = EN_LCDCK, 507 .rate_offset = CKCTL_LCDDIV_OFFSET, ··· 517 /* Direct from ULPD, no real parent */ 518 .parent = &armper_ck.clk, 519 .rate = 12000000, 520 - .flags = CLOCK_IN_OMAP1510 | ENABLE_REG_32BIT | 521 - ALWAYS_ENABLED | CLOCK_NO_IDLE_PARENT, 522 .enable_reg = (void __iomem *)MOD_CONF_CTRL_0, 523 .enable_bit = 29, /* Chooses between 12MHz and 48MHz */ 524 .set_rate = &omap1_set_uart_rate, ··· 550 .parent = &armper_ck.clk, 551 .rate = 12000000, 552 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 553 - ENABLE_REG_32BIT | ALWAYS_ENABLED | 554 - CLOCK_NO_IDLE_PARENT, 555 .enable_reg = (void __iomem *)MOD_CONF_CTRL_0, 556 .enable_bit = 30, /* Chooses between 12MHz and 48MHz */ 557 .set_rate = &omap1_set_uart_rate, ··· 565 /* Direct from ULPD, no real parent */ 566 .parent = &armper_ck.clk, 567 .rate = 12000000, 568 - .flags = CLOCK_IN_OMAP1510 | ENABLE_REG_32BIT | 569 - ALWAYS_ENABLED | CLOCK_NO_IDLE_PARENT, 570 .enable_reg = (void __iomem *)MOD_CONF_CTRL_0, 571 .enable_bit = 31, /* Chooses between 12MHz and 48MHz */ 572 .set_rate = &omap1_set_uart_rate, ··· 597 /* Direct from ULPD, no parent */ 598 .rate = 6000000, 599 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 600 - RATE_FIXED | ENABLE_REG_32BIT, 601 .enable_reg = (void __iomem *)ULPD_CLOCK_CTRL, 602 .enable_bit = USB_MCLK_EN_BIT, 603 .enable = &omap1_clk_enable_generic, ··· 608 .name = "usb_hhc_ck", 609 /* Direct from ULPD, no parent */ 610 .rate = 48000000, /* Actually 2 clocks, 12MHz and 48MHz */ 611 - .flags = CLOCK_IN_OMAP1510 | 612 RATE_FIXED | ENABLE_REG_32BIT, 613 .enable_reg = (void __iomem *)MOD_CONF_CTRL_0, 614 .enable_bit = USB_HOST_HHC_UHOST_EN, ··· 644 .name = "mclk", 645 /* Direct from ULPD, no parent. May be enabled by ext hardware. */ 646 .rate = 12000000, 647 - .flags = CLOCK_IN_OMAP1510 | RATE_FIXED, 648 .enable = &omap1_clk_enable_generic, 649 .disable = &omap1_clk_disable_generic, 650 }; ··· 668 .name = "bclk", 669 /* Direct from ULPD, no parent. May be enabled by ext hardware. */ 670 .rate = 12000000, 671 - .flags = CLOCK_IN_OMAP1510 | RATE_FIXED, 672 .enable = &omap1_clk_enable_generic, 673 .disable = &omap1_clk_disable_generic, 674 }; ··· 687 }; 688 689 static struct clk mmc1_ck = { 690 - .name = "mmc1_ck", 691 /* Functional clock is direct from ULPD, interface clock is ARMPER */ 692 .parent = &armper_ck.clk, 693 .rate = 48000000, 694 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 695 - RATE_FIXED | ENABLE_REG_32BIT | CLOCK_NO_IDLE_PARENT, 696 .enable_reg = (void __iomem *)MOD_CONF_CTRL_0, 697 .enable_bit = 23, 698 .enable = &omap1_clk_enable_generic, ··· 702 }; 703 704 static struct clk mmc2_ck = { 705 - .name = "mmc2_ck", 706 /* Functional clock is direct from ULPD, interface clock is ARMPER */ 707 .parent = &armper_ck.clk, 708 .rate = 48000000, ··· 718 static struct clk virtual_ck_mpu = { 719 .name = "mpu", 720 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 721 - VIRTUAL_CLOCK | ALWAYS_ENABLED, 722 .parent = &arm_ck, /* Is smarter alias for */ 723 .recalc = &followparent_recalc, 724 .set_rate = &omap1_select_table_rate, 725 .round_rate = &omap1_round_to_table_rate, 726 .enable = &omap1_clk_enable_generic, 727 .disable = &omap1_clk_disable_generic, 728 }; ··· 789 &mmc2_ck, 790 /* Virtual clocks */ 791 &virtual_ck_mpu, 792 }; 793 794 #endif
··· 151 .name = "ck_ref", 152 .rate = 12000000, 153 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 154 + CLOCK_IN_OMAP310 | ALWAYS_ENABLED, 155 .enable = &omap1_clk_enable_generic, 156 .disable = &omap1_clk_disable_generic, 157 }; ··· 160 .name = "ck_dpll1", 161 .parent = &ck_ref, 162 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 163 + CLOCK_IN_OMAP310 | RATE_PROPAGATES | ALWAYS_ENABLED, 164 .enable = &omap1_clk_enable_generic, 165 .disable = &omap1_clk_disable_generic, 166 }; ··· 183 .name = "arm_ck", 184 .parent = &ck_dpll1, 185 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 186 + CLOCK_IN_OMAP310 | RATE_CKCTL | RATE_PROPAGATES | 187 + ALWAYS_ENABLED, 188 .rate_offset = CKCTL_ARMDIV_OFFSET, 189 .recalc = &omap1_ckctl_recalc, 190 .enable = &omap1_clk_enable_generic, ··· 195 .name = "armper_ck", 196 .parent = &ck_dpll1, 197 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 198 + CLOCK_IN_OMAP310 | RATE_CKCTL | 199 + CLOCK_IDLE_CONTROL, 200 .enable_reg = (void __iomem *)ARM_IDLECT2, 201 .enable_bit = EN_PERCK, 202 .rate_offset = CKCTL_PERDIV_OFFSET, ··· 209 static struct clk arm_gpio_ck = { 210 .name = "arm_gpio_ck", 211 .parent = &ck_dpll1, 212 + .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310, 213 .enable_reg = (void __iomem *)ARM_IDLECT2, 214 .enable_bit = EN_GPIOCK, 215 .recalc = &followparent_recalc, ··· 222 .name = "armxor_ck", 223 .parent = &ck_ref, 224 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 225 + CLOCK_IN_OMAP310 | CLOCK_IDLE_CONTROL, 226 .enable_reg = (void __iomem *)ARM_IDLECT2, 227 .enable_bit = EN_XORPCK, 228 .recalc = &followparent_recalc, ··· 237 .name = "armtim_ck", 238 .parent = &ck_ref, 239 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 240 + CLOCK_IN_OMAP310 | CLOCK_IDLE_CONTROL, 241 .enable_reg = (void __iomem *)ARM_IDLECT2, 242 .enable_bit = EN_TIMCK, 243 .recalc = &followparent_recalc, ··· 252 .name = "armwdt_ck", 253 .parent = &ck_ref, 254 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 255 + CLOCK_IN_OMAP310 | CLOCK_IDLE_CONTROL, 256 .enable_reg = (void __iomem *)ARM_IDLECT2, 257 .enable_bit = EN_WDTCK, 258 .recalc = &omap1_watchdog_recalc, ··· 344 .name = "tc_ck", 345 .parent = &ck_dpll1, 346 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 347 + CLOCK_IN_OMAP730 | CLOCK_IN_OMAP310 | 348 + RATE_CKCTL | RATE_PROPAGATES | 349 + ALWAYS_ENABLED | CLOCK_IDLE_CONTROL, 350 .rate_offset = CKCTL_TCDIV_OFFSET, 351 .recalc = &omap1_ckctl_recalc, 352 .enable = &omap1_clk_enable_generic, ··· 358 static struct clk arminth_ck1510 = { 359 .name = "arminth_ck", 360 .parent = &tc_ck.clk, 361 + .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310 | 362 + ALWAYS_ENABLED, 363 .recalc = &followparent_recalc, 364 /* Note: On 1510 the frequency follows TC_CK 365 * ··· 372 /* No-idle controlled by "tc_ck" */ 373 .name = "tibp_ck", 374 .parent = &tc_ck.clk, 375 + .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310 | 376 + ALWAYS_ENABLED, 377 .recalc = &followparent_recalc, 378 .enable = &omap1_clk_enable_generic, 379 .disable = &omap1_clk_disable_generic, ··· 417 .name = "dma_ck", 418 .parent = &tc_ck.clk, 419 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 420 + CLOCK_IN_OMAP310 | ALWAYS_ENABLED, 421 .recalc = &followparent_recalc, 422 .enable = &omap1_clk_enable_generic, 423 .disable = &omap1_clk_disable_generic, ··· 437 .name = "api_ck", 438 .parent = &tc_ck.clk, 439 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 440 + CLOCK_IN_OMAP310 | CLOCK_IDLE_CONTROL, 441 .enable_reg = (void __iomem *)ARM_IDLECT2, 442 .enable_bit = EN_APICK, 443 .recalc = &followparent_recalc, ··· 451 .clk = { 452 .name = "lb_ck", 453 .parent = &tc_ck.clk, 454 + .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310 | 455 + CLOCK_IDLE_CONTROL, 456 .enable_reg = (void __iomem *)ARM_IDLECT2, 457 .enable_bit = EN_LBCK, 458 .recalc = &followparent_recalc, ··· 495 .clk = { 496 .name = "lcd_ck", 497 .parent = &ck_dpll1, 498 + .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310 | 499 + RATE_CKCTL | CLOCK_IDLE_CONTROL, 500 .enable_reg = (void __iomem *)ARM_IDLECT2, 501 .enable_bit = EN_LCDCK, 502 .rate_offset = CKCTL_LCDDIV_OFFSET, ··· 512 /* Direct from ULPD, no real parent */ 513 .parent = &armper_ck.clk, 514 .rate = 12000000, 515 + .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310 | 516 + ENABLE_REG_32BIT | ALWAYS_ENABLED | 517 + CLOCK_NO_IDLE_PARENT, 518 .enable_reg = (void __iomem *)MOD_CONF_CTRL_0, 519 .enable_bit = 29, /* Chooses between 12MHz and 48MHz */ 520 .set_rate = &omap1_set_uart_rate, ··· 544 .parent = &armper_ck.clk, 545 .rate = 12000000, 546 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 547 + CLOCK_IN_OMAP310 | ENABLE_REG_32BIT | 548 + ALWAYS_ENABLED | CLOCK_NO_IDLE_PARENT, 549 .enable_reg = (void __iomem *)MOD_CONF_CTRL_0, 550 .enable_bit = 30, /* Chooses between 12MHz and 48MHz */ 551 .set_rate = &omap1_set_uart_rate, ··· 559 /* Direct from ULPD, no real parent */ 560 .parent = &armper_ck.clk, 561 .rate = 12000000, 562 + .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310 | 563 + ENABLE_REG_32BIT | ALWAYS_ENABLED | 564 + CLOCK_NO_IDLE_PARENT, 565 .enable_reg = (void __iomem *)MOD_CONF_CTRL_0, 566 .enable_bit = 31, /* Chooses between 12MHz and 48MHz */ 567 .set_rate = &omap1_set_uart_rate, ··· 590 /* Direct from ULPD, no parent */ 591 .rate = 6000000, 592 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 593 + CLOCK_IN_OMAP310 | RATE_FIXED | ENABLE_REG_32BIT, 594 .enable_reg = (void __iomem *)ULPD_CLOCK_CTRL, 595 .enable_bit = USB_MCLK_EN_BIT, 596 .enable = &omap1_clk_enable_generic, ··· 601 .name = "usb_hhc_ck", 602 /* Direct from ULPD, no parent */ 603 .rate = 48000000, /* Actually 2 clocks, 12MHz and 48MHz */ 604 + .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310 | 605 RATE_FIXED | ENABLE_REG_32BIT, 606 .enable_reg = (void __iomem *)MOD_CONF_CTRL_0, 607 .enable_bit = USB_HOST_HHC_UHOST_EN, ··· 637 .name = "mclk", 638 /* Direct from ULPD, no parent. May be enabled by ext hardware. */ 639 .rate = 12000000, 640 + .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310 | RATE_FIXED, 641 + .enable_reg = (void __iomem *)SOFT_REQ_REG, 642 + .enable_bit = 6, 643 .enable = &omap1_clk_enable_generic, 644 .disable = &omap1_clk_disable_generic, 645 }; ··· 659 .name = "bclk", 660 /* Direct from ULPD, no parent. May be enabled by ext hardware. */ 661 .rate = 12000000, 662 + .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310 | RATE_FIXED, 663 .enable = &omap1_clk_enable_generic, 664 .disable = &omap1_clk_disable_generic, 665 }; ··· 678 }; 679 680 static struct clk mmc1_ck = { 681 + .name = "mmc_ck", 682 + .id = 1, 683 /* Functional clock is direct from ULPD, interface clock is ARMPER */ 684 .parent = &armper_ck.clk, 685 .rate = 48000000, 686 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 687 + CLOCK_IN_OMAP310 | RATE_FIXED | ENABLE_REG_32BIT | 688 + CLOCK_NO_IDLE_PARENT, 689 .enable_reg = (void __iomem *)MOD_CONF_CTRL_0, 690 .enable_bit = 23, 691 .enable = &omap1_clk_enable_generic, ··· 691 }; 692 693 static struct clk mmc2_ck = { 694 + .name = "mmc_ck", 695 + .id = 2, 696 /* Functional clock is direct from ULPD, interface clock is ARMPER */ 697 .parent = &armper_ck.clk, 698 .rate = 48000000, ··· 706 static struct clk virtual_ck_mpu = { 707 .name = "mpu", 708 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 709 + CLOCK_IN_OMAP310 | VIRTUAL_CLOCK | ALWAYS_ENABLED, 710 .parent = &arm_ck, /* Is smarter alias for */ 711 .recalc = &followparent_recalc, 712 .set_rate = &omap1_select_table_rate, 713 .round_rate = &omap1_round_to_table_rate, 714 + .enable = &omap1_clk_enable_generic, 715 + .disable = &omap1_clk_disable_generic, 716 + }; 717 + 718 + /* virtual functional clock domain for I2C. Just for making sure that ARMXOR_CK 719 + remains active during MPU idle whenever this is enabled */ 720 + static struct clk i2c_fck = { 721 + .name = "i2c_fck", 722 + .id = 1, 723 + .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 724 + VIRTUAL_CLOCK | CLOCK_NO_IDLE_PARENT | 725 + ALWAYS_ENABLED, 726 + .parent = &armxor_ck.clk, 727 + .recalc = &followparent_recalc, 728 .enable = &omap1_clk_enable_generic, 729 .disable = &omap1_clk_disable_generic, 730 }; ··· 763 &mmc2_ck, 764 /* Virtual clocks */ 765 &virtual_ck_mpu, 766 + &i2c_fck, 767 }; 768 769 #endif
+40
arch/arm/mach-omap1/devices.c
··· 99 static inline void omap_init_rtc(void) {} 100 #endif 101 102 103 /*-------------------------------------------------------------------------*/ 104 ··· 168 */ 169 omap_init_irda(); 170 omap_init_rtc(); 171 172 return 0; 173 }
··· 99 static inline void omap_init_rtc(void) {} 100 #endif 101 102 + #if defined(CONFIG_OMAP_STI) 103 + 104 + #define OMAP1_STI_BASE IO_ADDRESS(0xfffea000) 105 + #define OMAP1_STI_CHANNEL_BASE (OMAP1_STI_BASE + 0x400) 106 + 107 + static struct resource sti_resources[] = { 108 + { 109 + .start = OMAP1_STI_BASE, 110 + .end = OMAP1_STI_BASE + SZ_1K - 1, 111 + .flags = IORESOURCE_MEM, 112 + }, 113 + { 114 + .start = OMAP1_STI_CHANNEL_BASE, 115 + .end = OMAP1_STI_CHANNEL_BASE + SZ_1K - 1, 116 + .flags = IORESOURCE_MEM, 117 + }, 118 + { 119 + .start = INT_1610_STI, 120 + .flags = IORESOURCE_IRQ, 121 + } 122 + }; 123 + 124 + static struct platform_device sti_device = { 125 + .name = "sti", 126 + .id = -1, 127 + .dev = { 128 + .release = omap_nop_release, 129 + }, 130 + .num_resources = ARRAY_SIZE(sti_resources), 131 + .resource = sti_resources, 132 + }; 133 + 134 + static inline void omap_init_sti(void) 135 + { 136 + platform_device_register(&sti_device); 137 + } 138 + #else 139 + static inline void omap_init_sti(void) {} 140 + #endif 141 142 /*-------------------------------------------------------------------------*/ 143 ··· 129 */ 130 omap_init_irda(); 131 omap_init_rtc(); 132 + omap_init_sti(); 133 134 return 0; 135 }
+3 -1
arch/arm/mach-omap1/io.c
··· 18 #include <asm/io.h> 19 #include <asm/arch/mux.h> 20 #include <asm/arch/tc.h> 21 22 extern int omap1_clk_init(void); 23 extern void omap_check_revision(void); ··· 111 } 112 #endif 113 #ifdef CONFIG_ARCH_OMAP15XX 114 - if (cpu_is_omap1510()) { 115 iotable_init(omap1510_io_desc, ARRAY_SIZE(omap1510_io_desc)); 116 } 117 #endif ··· 122 #endif 123 124 omap_sram_init(); 125 } 126 127 /*
··· 18 #include <asm/io.h> 19 #include <asm/arch/mux.h> 20 #include <asm/arch/tc.h> 21 + #include <asm/arch/omapfb.h> 22 23 extern int omap1_clk_init(void); 24 extern void omap_check_revision(void); ··· 110 } 111 #endif 112 #ifdef CONFIG_ARCH_OMAP15XX 113 + if (cpu_is_omap15xx()) { 114 iotable_init(omap1510_io_desc, ARRAY_SIZE(omap1510_io_desc)); 115 } 116 #endif ··· 121 #endif 122 123 omap_sram_init(); 124 + omapfb_reserve_mem(); 125 } 126 127 /*
+9 -9
arch/arm/mach-omap1/irq.c
··· 60 unsigned long wake_enable; 61 }; 62 63 - static unsigned int irq_bank_count = 0; 64 static struct omap_irq_bank *irq_banks; 65 66 static inline unsigned int irq_bank_readl(int bank, int offset) ··· 142 143 #ifdef CONFIG_ARCH_OMAP730 144 static struct omap_irq_bank omap730_irq_banks[] = { 145 - { .base_reg = OMAP_IH1_BASE, .trigger_map = 0xb3f8e22f }, 146 - { .base_reg = OMAP_IH2_BASE, .trigger_map = 0xfdb9c1f2 }, 147 { .base_reg = OMAP_IH2_BASE + 0x100, .trigger_map = 0x800040f3 }, 148 }; 149 #endif 150 151 #ifdef CONFIG_ARCH_OMAP15XX 152 static struct omap_irq_bank omap1510_irq_banks[] = { 153 - { .base_reg = OMAP_IH1_BASE, .trigger_map = 0xb3febfff }, 154 - { .base_reg = OMAP_IH2_BASE, .trigger_map = 0xffbfffed }, 155 }; 156 static struct omap_irq_bank omap310_irq_banks[] = { 157 - { .base_reg = OMAP_IH1_BASE, .trigger_map = 0xb3faefc3 }, 158 - { .base_reg = OMAP_IH2_BASE, .trigger_map = 0x65b3c061 }, 159 }; 160 #endif 161 162 #if defined(CONFIG_ARCH_OMAP16XX) 163 164 static struct omap_irq_bank omap1610_irq_banks[] = { 165 - { .base_reg = OMAP_IH1_BASE, .trigger_map = 0xb3fefe8f }, 166 - { .base_reg = OMAP_IH2_BASE, .trigger_map = 0xfdb7c1fd }, 167 { .base_reg = OMAP_IH2_BASE + 0x100, .trigger_map = 0xffffb7ff }, 168 { .base_reg = OMAP_IH2_BASE + 0x200, .trigger_map = 0xffffffff }, 169 };
··· 60 unsigned long wake_enable; 61 }; 62 63 + static unsigned int irq_bank_count; 64 static struct omap_irq_bank *irq_banks; 65 66 static inline unsigned int irq_bank_readl(int bank, int offset) ··· 142 143 #ifdef CONFIG_ARCH_OMAP730 144 static struct omap_irq_bank omap730_irq_banks[] = { 145 + { .base_reg = OMAP_IH1_BASE, .trigger_map = 0xb3f8e22f }, 146 + { .base_reg = OMAP_IH2_BASE, .trigger_map = 0xfdb9c1f2 }, 147 { .base_reg = OMAP_IH2_BASE + 0x100, .trigger_map = 0x800040f3 }, 148 }; 149 #endif 150 151 #ifdef CONFIG_ARCH_OMAP15XX 152 static struct omap_irq_bank omap1510_irq_banks[] = { 153 + { .base_reg = OMAP_IH1_BASE, .trigger_map = 0xb3febfff }, 154 + { .base_reg = OMAP_IH2_BASE, .trigger_map = 0xffbfffed }, 155 }; 156 static struct omap_irq_bank omap310_irq_banks[] = { 157 + { .base_reg = OMAP_IH1_BASE, .trigger_map = 0xb3faefc3 }, 158 + { .base_reg = OMAP_IH2_BASE, .trigger_map = 0x65b3c061 }, 159 }; 160 #endif 161 162 #if defined(CONFIG_ARCH_OMAP16XX) 163 164 static struct omap_irq_bank omap1610_irq_banks[] = { 165 + { .base_reg = OMAP_IH1_BASE, .trigger_map = 0xb3fefe8f }, 166 + { .base_reg = OMAP_IH2_BASE, .trigger_map = 0xfdb7c1fd }, 167 { .base_reg = OMAP_IH2_BASE + 0x100, .trigger_map = 0xffffb7ff }, 168 { .base_reg = OMAP_IH2_BASE + 0x200, .trigger_map = 0xffffffff }, 169 };
+17 -13
arch/arm/mach-omap1/mux.c
··· 35 36 #ifdef CONFIG_ARCH_OMAP730 37 struct pin_config __initdata_or_module omap730_pins[] = { 38 - MUX_CFG_730("E2_730_KBR0", 12, 21, 0, 0, 20, 1, NA, 0, 0) 39 - MUX_CFG_730("J7_730_KBR1", 12, 25, 0, 0, 24, 1, NA, 0, 0) 40 - MUX_CFG_730("E1_730_KBR2", 12, 29, 0, 0, 28, 1, NA, 0, 0) 41 - MUX_CFG_730("F3_730_KBR3", 13, 1, 0, 0, 0, 1, NA, 0, 0) 42 - MUX_CFG_730("D2_730_KBR4", 13, 5, 0, 0, 4, 1, NA, 0, 0) 43 - MUX_CFG_730("C2_730_KBC0", 13, 9, 0, 0, 8, 1, NA, 0, 0) 44 - MUX_CFG_730("D3_730_KBC1", 13, 13, 0, 0, 12, 1, NA, 0, 0) 45 - MUX_CFG_730("E4_730_KBC2", 13, 17, 0, 0, 16, 1, NA, 0, 0) 46 - MUX_CFG_730("F4_730_KBC3", 13, 21, 0, 0, 20, 1, NA, 0, 0) 47 - MUX_CFG_730("E3_730_KBC4", 13, 25, 0, 0, 24, 1, NA, 0, 0) 48 }; 49 #endif 50 ··· 77 MUX_CFG("Y15_1610_UART3_RTS", A, 0, 1, 2, 6, 0, NA, 0, 0) 78 79 /* PWT & PWL, conflicts with UART3 */ 80 - MUX_CFG("PWT", 6, 0, 2, 0, 30, 0, NA, 0, 0) 81 - MUX_CFG("PWL", 6, 3, 1, 0, 31, 1, NA, 0, 0) 82 83 /* USB internal master generic */ 84 MUX_CFG("R18_USB_VBUS", 7, 9, 2, 1, 11, 0, NA, 0, 1) ··· 155 156 /* Misc ballouts */ 157 MUX_CFG("BALLOUT_V8_ARMIO3", B, 18, 0, 2, 25, 1, NA, 0, 1) 158 - MUX_CFG("N20_HDQ", 6, 18, 1, 1, 4, 0, 1, 4, 0) 159 160 /* OMAP-1610 MMC2 */ 161 MUX_CFG("W8_1610_MMC2_DAT0", B, 21, 6, 2, 23, 1, 2, 1, 1)
··· 35 36 #ifdef CONFIG_ARCH_OMAP730 37 struct pin_config __initdata_or_module omap730_pins[] = { 38 + MUX_CFG_730("E2_730_KBR0", 12, 21, 0, 20, 1, 0) 39 + MUX_CFG_730("J7_730_KBR1", 12, 25, 0, 24, 1, 0) 40 + MUX_CFG_730("E1_730_KBR2", 12, 29, 0, 28, 1, 0) 41 + MUX_CFG_730("F3_730_KBR3", 13, 1, 0, 0, 1, 0) 42 + MUX_CFG_730("D2_730_KBR4", 13, 5, 0, 4, 1, 0) 43 + MUX_CFG_730("C2_730_KBC0", 13, 9, 0, 8, 1, 0) 44 + MUX_CFG_730("D3_730_KBC1", 13, 13, 0, 12, 1, 0) 45 + MUX_CFG_730("E4_730_KBC2", 13, 17, 0, 16, 1, 0) 46 + MUX_CFG_730("F4_730_KBC3", 13, 21, 0, 20, 1, 0) 47 + MUX_CFG_730("E3_730_KBC4", 13, 25, 0, 24, 1, 0) 48 + 49 + MUX_CFG_730("AA17_730_USB_DM", 2, 21, 0, 20, 0, 0) 50 + MUX_CFG_730("W16_730_USB_PU_EN", 2, 25, 0, 24, 0, 0) 51 + MUX_CFG_730("W17_730_USB_VBUSI", 2, 29, 0, 28, 0, 0) 52 }; 53 #endif 54 ··· 73 MUX_CFG("Y15_1610_UART3_RTS", A, 0, 1, 2, 6, 0, NA, 0, 0) 74 75 /* PWT & PWL, conflicts with UART3 */ 76 + MUX_CFG("PWT", 6, 0, 2, 0, 30, 0, NA, 0, 0) 77 + MUX_CFG("PWL", 6, 3, 1, 0, 31, 1, NA, 0, 0) 78 79 /* USB internal master generic */ 80 MUX_CFG("R18_USB_VBUS", 7, 9, 2, 1, 11, 0, NA, 0, 1) ··· 151 152 /* Misc ballouts */ 153 MUX_CFG("BALLOUT_V8_ARMIO3", B, 18, 0, 2, 25, 1, NA, 0, 1) 154 + MUX_CFG("N20_HDQ", 6, 18, 1, 1, 4, 0, 1, 4, 0) 155 156 /* OMAP-1610 MMC2 */ 157 MUX_CFG("W8_1610_MMC2_DAT0", B, 21, 6, 2, 23, 1, 2, 1, 1)
+770
arch/arm/mach-omap1/pm.c
···
··· 1 + /* 2 + * linux/arch/arm/mach-omap1/pm.c 3 + * 4 + * OMAP Power Management Routines 5 + * 6 + * Original code for the SA11x0: 7 + * Copyright (c) 2001 Cliff Brake <cbrake@accelent.com> 8 + * 9 + * Modified for the PXA250 by Nicolas Pitre: 10 + * Copyright (c) 2002 Monta Vista Software, Inc. 11 + * 12 + * Modified for the OMAP1510 by David Singleton: 13 + * Copyright (c) 2002 Monta Vista Software, Inc. 14 + * 15 + * Cleanup 2004 for OMAP1510/1610 by Dirk Behme <dirk.behme@de.bosch.com> 16 + * 17 + * This program is free software; you can redistribute it and/or modify it 18 + * under the terms of the GNU General Public License as published by the 19 + * Free Software Foundation; either version 2 of the License, or (at your 20 + * option) any later version. 21 + * 22 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED 23 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 24 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN 25 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 26 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 27 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 28 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 29 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 31 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 + * 33 + * You should have received a copy of the GNU General Public License along 34 + * with this program; if not, write to the Free Software Foundation, Inc., 35 + * 675 Mass Ave, Cambridge, MA 02139, USA. 36 + */ 37 + 38 + #include <linux/pm.h> 39 + #include <linux/sched.h> 40 + #include <linux/proc_fs.h> 41 + #include <linux/pm.h> 42 + #include <linux/interrupt.h> 43 + #include <linux/sysfs.h> 44 + #include <linux/module.h> 45 + 46 + #include <asm/io.h> 47 + #include <asm/irq.h> 48 + #include <asm/atomic.h> 49 + #include <asm/mach/time.h> 50 + #include <asm/mach/irq.h> 51 + #include <asm/mach-types.h> 52 + 53 + #include <asm/arch/irqs.h> 54 + #include <asm/arch/clock.h> 55 + #include <asm/arch/sram.h> 56 + #include <asm/arch/tc.h> 57 + #include <asm/arch/pm.h> 58 + #include <asm/arch/mux.h> 59 + #include <asm/arch/tps65010.h> 60 + #include <asm/arch/dma.h> 61 + #include <asm/arch/dsp_common.h> 62 + #include <asm/arch/dmtimer.h> 63 + 64 + static unsigned int arm_sleep_save[ARM_SLEEP_SAVE_SIZE]; 65 + static unsigned short dsp_sleep_save[DSP_SLEEP_SAVE_SIZE]; 66 + static unsigned short ulpd_sleep_save[ULPD_SLEEP_SAVE_SIZE]; 67 + static unsigned int mpui730_sleep_save[MPUI730_SLEEP_SAVE_SIZE]; 68 + static unsigned int mpui1510_sleep_save[MPUI1510_SLEEP_SAVE_SIZE]; 69 + static unsigned int mpui1610_sleep_save[MPUI1610_SLEEP_SAVE_SIZE]; 70 + 71 + static unsigned short enable_dyn_sleep = 1; 72 + 73 + static ssize_t omap_pm_sleep_while_idle_show(struct subsystem * subsys, char *buf) 74 + { 75 + return sprintf(buf, "%hu\n", enable_dyn_sleep); 76 + } 77 + 78 + static ssize_t omap_pm_sleep_while_idle_store(struct subsystem * subsys, 79 + const char * buf, 80 + size_t n) 81 + { 82 + unsigned short value; 83 + if (sscanf(buf, "%hu", &value) != 1 || 84 + (value != 0 && value != 1)) { 85 + printk(KERN_ERR "idle_sleep_store: Invalid value\n"); 86 + return -EINVAL; 87 + } 88 + enable_dyn_sleep = value; 89 + return n; 90 + } 91 + 92 + static struct subsys_attribute sleep_while_idle_attr = { 93 + .attr = { 94 + .name = __stringify(sleep_while_idle), 95 + .mode = 0644, 96 + }, 97 + .show = omap_pm_sleep_while_idle_show, 98 + .store = omap_pm_sleep_while_idle_store, 99 + }; 100 + 101 + extern struct subsystem power_subsys; 102 + static void (*omap_sram_idle)(void) = NULL; 103 + static void (*omap_sram_suspend)(unsigned long r0, unsigned long r1) = NULL; 104 + 105 + /* 106 + * Let's power down on idle, but only if we are really 107 + * idle, because once we start down the path of 108 + * going idle we continue to do idle even if we get 109 + * a clock tick interrupt . . 110 + */ 111 + void omap_pm_idle(void) 112 + { 113 + extern __u32 arm_idlect1_mask; 114 + __u32 use_idlect1 = arm_idlect1_mask; 115 + #ifndef CONFIG_OMAP_MPU_TIMER 116 + int do_sleep; 117 + #endif 118 + 119 + local_irq_disable(); 120 + local_fiq_disable(); 121 + if (need_resched()) { 122 + local_fiq_enable(); 123 + local_irq_enable(); 124 + return; 125 + } 126 + 127 + /* 128 + * Since an interrupt may set up a timer, we don't want to 129 + * reprogram the hardware timer with interrupts enabled. 130 + * Re-enable interrupts only after returning from idle. 131 + */ 132 + timer_dyn_reprogram(); 133 + 134 + #ifdef CONFIG_OMAP_MPU_TIMER 135 + #warning Enable 32kHz OS timer in order to allow sleep states in idle 136 + use_idlect1 = use_idlect1 & ~(1 << 9); 137 + #else 138 + 139 + do_sleep = 0; 140 + while (enable_dyn_sleep) { 141 + 142 + #ifdef CONFIG_CBUS_TAHVO_USB 143 + extern int vbus_active; 144 + /* Clock requirements? */ 145 + if (vbus_active) 146 + break; 147 + #endif 148 + do_sleep = 1; 149 + break; 150 + } 151 + 152 + #ifdef CONFIG_OMAP_DM_TIMER 153 + use_idlect1 = omap_dm_timer_modify_idlect_mask(use_idlect1); 154 + #endif 155 + 156 + if (omap_dma_running()) { 157 + use_idlect1 &= ~(1 << 6); 158 + if (omap_lcd_dma_ext_running()) 159 + use_idlect1 &= ~(1 << 12); 160 + } 161 + 162 + /* We should be able to remove the do_sleep variable and multiple 163 + * tests above as soon as drivers, timer and DMA code have been fixed. 164 + * Even the sleep block count should become obsolete. */ 165 + if ((use_idlect1 != ~0) || !do_sleep) { 166 + 167 + __u32 saved_idlect1 = omap_readl(ARM_IDLECT1); 168 + if (cpu_is_omap15xx()) 169 + use_idlect1 &= OMAP1510_BIG_SLEEP_REQUEST; 170 + else 171 + use_idlect1 &= OMAP1610_IDLECT1_SLEEP_VAL; 172 + omap_writel(use_idlect1, ARM_IDLECT1); 173 + __asm__ volatile ("mcr p15, 0, r0, c7, c0, 4"); 174 + omap_writel(saved_idlect1, ARM_IDLECT1); 175 + 176 + local_fiq_enable(); 177 + local_irq_enable(); 178 + return; 179 + } 180 + omap_sram_suspend(omap_readl(ARM_IDLECT1), 181 + omap_readl(ARM_IDLECT2)); 182 + #endif 183 + 184 + local_fiq_enable(); 185 + local_irq_enable(); 186 + } 187 + 188 + /* 189 + * Configuration of the wakeup event is board specific. For the 190 + * moment we put it into this helper function. Later it may move 191 + * to board specific files. 192 + */ 193 + static void omap_pm_wakeup_setup(void) 194 + { 195 + u32 level1_wake = 0; 196 + u32 level2_wake = OMAP_IRQ_BIT(INT_UART2); 197 + 198 + /* 199 + * Turn off all interrupts except GPIO bank 1, L1-2nd level cascade, 200 + * and the L2 wakeup interrupts: keypad and UART2. Note that the 201 + * drivers must still separately call omap_set_gpio_wakeup() to 202 + * wake up to a GPIO interrupt. 203 + */ 204 + if (cpu_is_omap730()) 205 + level1_wake = OMAP_IRQ_BIT(INT_730_GPIO_BANK1) | 206 + OMAP_IRQ_BIT(INT_730_IH2_IRQ); 207 + else if (cpu_is_omap15xx()) 208 + level1_wake = OMAP_IRQ_BIT(INT_GPIO_BANK1) | 209 + OMAP_IRQ_BIT(INT_1510_IH2_IRQ); 210 + else if (cpu_is_omap16xx()) 211 + level1_wake = OMAP_IRQ_BIT(INT_GPIO_BANK1) | 212 + OMAP_IRQ_BIT(INT_1610_IH2_IRQ); 213 + 214 + omap_writel(~level1_wake, OMAP_IH1_MIR); 215 + 216 + if (cpu_is_omap730()) { 217 + omap_writel(~level2_wake, OMAP_IH2_0_MIR); 218 + omap_writel(~(OMAP_IRQ_BIT(INT_730_WAKE_UP_REQ) | 219 + OMAP_IRQ_BIT(INT_730_MPUIO_KEYPAD)), 220 + OMAP_IH2_1_MIR); 221 + } else if (cpu_is_omap15xx()) { 222 + level2_wake |= OMAP_IRQ_BIT(INT_KEYBOARD); 223 + omap_writel(~level2_wake, OMAP_IH2_MIR); 224 + } else if (cpu_is_omap16xx()) { 225 + level2_wake |= OMAP_IRQ_BIT(INT_KEYBOARD); 226 + omap_writel(~level2_wake, OMAP_IH2_0_MIR); 227 + 228 + /* INT_1610_WAKE_UP_REQ is needed for GPIO wakeup... */ 229 + omap_writel(~OMAP_IRQ_BIT(INT_1610_WAKE_UP_REQ), 230 + OMAP_IH2_1_MIR); 231 + omap_writel(~0x0, OMAP_IH2_2_MIR); 232 + omap_writel(~0x0, OMAP_IH2_3_MIR); 233 + } 234 + 235 + /* New IRQ agreement, recalculate in cascade order */ 236 + omap_writel(1, OMAP_IH2_CONTROL); 237 + omap_writel(1, OMAP_IH1_CONTROL); 238 + } 239 + 240 + #define EN_DSPCK 13 /* ARM_CKCTL */ 241 + #define EN_APICK 6 /* ARM_IDLECT2 */ 242 + #define DSP_EN 1 /* ARM_RSTCT1 */ 243 + 244 + void omap_pm_suspend(void) 245 + { 246 + unsigned long arg0 = 0, arg1 = 0; 247 + 248 + printk("PM: OMAP%x is trying to enter deep sleep...\n", system_rev); 249 + 250 + omap_serial_wake_trigger(1); 251 + 252 + if (machine_is_omap_osk()) { 253 + /* Stop LED1 (D9) blink */ 254 + tps65010_set_led(LED1, OFF); 255 + } 256 + 257 + omap_writew(0xffff, ULPD_SOFT_DISABLE_REQ_REG); 258 + 259 + /* 260 + * Step 1: turn off interrupts (FIXME: NOTE: already disabled) 261 + */ 262 + 263 + local_irq_disable(); 264 + local_fiq_disable(); 265 + 266 + /* 267 + * Step 2: save registers 268 + * 269 + * The omap is a strange/beautiful device. The caches, memory 270 + * and register state are preserved across power saves. 271 + * We have to save and restore very little register state to 272 + * idle the omap. 273 + * 274 + * Save interrupt, MPUI, ARM and UPLD control registers. 275 + */ 276 + 277 + if (cpu_is_omap730()) { 278 + MPUI730_SAVE(OMAP_IH1_MIR); 279 + MPUI730_SAVE(OMAP_IH2_0_MIR); 280 + MPUI730_SAVE(OMAP_IH2_1_MIR); 281 + MPUI730_SAVE(MPUI_CTRL); 282 + MPUI730_SAVE(MPUI_DSP_BOOT_CONFIG); 283 + MPUI730_SAVE(MPUI_DSP_API_CONFIG); 284 + MPUI730_SAVE(EMIFS_CONFIG); 285 + MPUI730_SAVE(EMIFF_SDRAM_CONFIG); 286 + 287 + } else if (cpu_is_omap15xx()) { 288 + MPUI1510_SAVE(OMAP_IH1_MIR); 289 + MPUI1510_SAVE(OMAP_IH2_MIR); 290 + MPUI1510_SAVE(MPUI_CTRL); 291 + MPUI1510_SAVE(MPUI_DSP_BOOT_CONFIG); 292 + MPUI1510_SAVE(MPUI_DSP_API_CONFIG); 293 + MPUI1510_SAVE(EMIFS_CONFIG); 294 + MPUI1510_SAVE(EMIFF_SDRAM_CONFIG); 295 + } else if (cpu_is_omap16xx()) { 296 + MPUI1610_SAVE(OMAP_IH1_MIR); 297 + MPUI1610_SAVE(OMAP_IH2_0_MIR); 298 + MPUI1610_SAVE(OMAP_IH2_1_MIR); 299 + MPUI1610_SAVE(OMAP_IH2_2_MIR); 300 + MPUI1610_SAVE(OMAP_IH2_3_MIR); 301 + MPUI1610_SAVE(MPUI_CTRL); 302 + MPUI1610_SAVE(MPUI_DSP_BOOT_CONFIG); 303 + MPUI1610_SAVE(MPUI_DSP_API_CONFIG); 304 + MPUI1610_SAVE(EMIFS_CONFIG); 305 + MPUI1610_SAVE(EMIFF_SDRAM_CONFIG); 306 + } 307 + 308 + ARM_SAVE(ARM_CKCTL); 309 + ARM_SAVE(ARM_IDLECT1); 310 + ARM_SAVE(ARM_IDLECT2); 311 + if (!(cpu_is_omap15xx())) 312 + ARM_SAVE(ARM_IDLECT3); 313 + ARM_SAVE(ARM_EWUPCT); 314 + ARM_SAVE(ARM_RSTCT1); 315 + ARM_SAVE(ARM_RSTCT2); 316 + ARM_SAVE(ARM_SYSST); 317 + ULPD_SAVE(ULPD_CLOCK_CTRL); 318 + ULPD_SAVE(ULPD_STATUS_REQ); 319 + 320 + /* (Step 3 removed - we now allow deep sleep by default) */ 321 + 322 + /* 323 + * Step 4: OMAP DSP Shutdown 324 + */ 325 + 326 + /* stop DSP */ 327 + omap_writew(omap_readw(ARM_RSTCT1) & ~(1 << DSP_EN), ARM_RSTCT1); 328 + 329 + /* shut down dsp_ck */ 330 + omap_writew(omap_readw(ARM_CKCTL) & ~(1 << EN_DSPCK), ARM_CKCTL); 331 + 332 + /* temporarily enabling api_ck to access DSP registers */ 333 + omap_writew(omap_readw(ARM_IDLECT2) | 1 << EN_APICK, ARM_IDLECT2); 334 + 335 + /* save DSP registers */ 336 + DSP_SAVE(DSP_IDLECT2); 337 + 338 + /* Stop all DSP domain clocks */ 339 + __raw_writew(0, DSP_IDLECT2); 340 + 341 + /* 342 + * Step 5: Wakeup Event Setup 343 + */ 344 + 345 + omap_pm_wakeup_setup(); 346 + 347 + /* 348 + * Step 6: ARM and Traffic controller shutdown 349 + */ 350 + 351 + /* disable ARM watchdog */ 352 + omap_writel(0x00F5, OMAP_WDT_TIMER_MODE); 353 + omap_writel(0x00A0, OMAP_WDT_TIMER_MODE); 354 + 355 + /* 356 + * Step 6b: ARM and Traffic controller shutdown 357 + * 358 + * Step 6 continues here. Prepare jump to power management 359 + * assembly code in internal SRAM. 360 + * 361 + * Since the omap_cpu_suspend routine has been copied to 362 + * SRAM, we'll do an indirect procedure call to it and pass the 363 + * contents of arm_idlect1 and arm_idlect2 so it can restore 364 + * them when it wakes up and it will return. 365 + */ 366 + 367 + arg0 = arm_sleep_save[ARM_SLEEP_SAVE_ARM_IDLECT1]; 368 + arg1 = arm_sleep_save[ARM_SLEEP_SAVE_ARM_IDLECT2]; 369 + 370 + /* 371 + * Step 6c: ARM and Traffic controller shutdown 372 + * 373 + * Jump to assembly code. The processor will stay there 374 + * until wake up. 375 + */ 376 + omap_sram_suspend(arg0, arg1); 377 + 378 + /* 379 + * If we are here, processor is woken up! 380 + */ 381 + 382 + /* 383 + * Restore DSP clocks 384 + */ 385 + 386 + /* again temporarily enabling api_ck to access DSP registers */ 387 + omap_writew(omap_readw(ARM_IDLECT2) | 1 << EN_APICK, ARM_IDLECT2); 388 + 389 + /* Restore DSP domain clocks */ 390 + DSP_RESTORE(DSP_IDLECT2); 391 + 392 + /* 393 + * Restore ARM state, except ARM_IDLECT1/2 which omap_cpu_suspend did 394 + */ 395 + 396 + if (!(cpu_is_omap15xx())) 397 + ARM_RESTORE(ARM_IDLECT3); 398 + ARM_RESTORE(ARM_CKCTL); 399 + ARM_RESTORE(ARM_EWUPCT); 400 + ARM_RESTORE(ARM_RSTCT1); 401 + ARM_RESTORE(ARM_RSTCT2); 402 + ARM_RESTORE(ARM_SYSST); 403 + ULPD_RESTORE(ULPD_CLOCK_CTRL); 404 + ULPD_RESTORE(ULPD_STATUS_REQ); 405 + 406 + if (cpu_is_omap730()) { 407 + MPUI730_RESTORE(EMIFS_CONFIG); 408 + MPUI730_RESTORE(EMIFF_SDRAM_CONFIG); 409 + MPUI730_RESTORE(OMAP_IH1_MIR); 410 + MPUI730_RESTORE(OMAP_IH2_0_MIR); 411 + MPUI730_RESTORE(OMAP_IH2_1_MIR); 412 + } else if (cpu_is_omap15xx()) { 413 + MPUI1510_RESTORE(MPUI_CTRL); 414 + MPUI1510_RESTORE(MPUI_DSP_BOOT_CONFIG); 415 + MPUI1510_RESTORE(MPUI_DSP_API_CONFIG); 416 + MPUI1510_RESTORE(EMIFS_CONFIG); 417 + MPUI1510_RESTORE(EMIFF_SDRAM_CONFIG); 418 + MPUI1510_RESTORE(OMAP_IH1_MIR); 419 + MPUI1510_RESTORE(OMAP_IH2_MIR); 420 + } else if (cpu_is_omap16xx()) { 421 + MPUI1610_RESTORE(MPUI_CTRL); 422 + MPUI1610_RESTORE(MPUI_DSP_BOOT_CONFIG); 423 + MPUI1610_RESTORE(MPUI_DSP_API_CONFIG); 424 + MPUI1610_RESTORE(EMIFS_CONFIG); 425 + MPUI1610_RESTORE(EMIFF_SDRAM_CONFIG); 426 + 427 + MPUI1610_RESTORE(OMAP_IH1_MIR); 428 + MPUI1610_RESTORE(OMAP_IH2_0_MIR); 429 + MPUI1610_RESTORE(OMAP_IH2_1_MIR); 430 + MPUI1610_RESTORE(OMAP_IH2_2_MIR); 431 + MPUI1610_RESTORE(OMAP_IH2_3_MIR); 432 + } 433 + 434 + omap_writew(0, ULPD_SOFT_DISABLE_REQ_REG); 435 + 436 + /* 437 + * Reenable interrupts 438 + */ 439 + 440 + local_irq_enable(); 441 + local_fiq_enable(); 442 + 443 + omap_serial_wake_trigger(0); 444 + 445 + printk("PM: OMAP%x is re-starting from deep sleep...\n", system_rev); 446 + 447 + if (machine_is_omap_osk()) { 448 + /* Let LED1 (D9) blink again */ 449 + tps65010_set_led(LED1, BLINK); 450 + } 451 + } 452 + 453 + #if defined(DEBUG) && defined(CONFIG_PROC_FS) 454 + static int g_read_completed; 455 + 456 + /* 457 + * Read system PM registers for debugging 458 + */ 459 + static int omap_pm_read_proc( 460 + char *page_buffer, 461 + char **my_first_byte, 462 + off_t virtual_start, 463 + int length, 464 + int *eof, 465 + void *data) 466 + { 467 + int my_buffer_offset = 0; 468 + char * const my_base = page_buffer; 469 + 470 + ARM_SAVE(ARM_CKCTL); 471 + ARM_SAVE(ARM_IDLECT1); 472 + ARM_SAVE(ARM_IDLECT2); 473 + if (!(cpu_is_omap15xx())) 474 + ARM_SAVE(ARM_IDLECT3); 475 + ARM_SAVE(ARM_EWUPCT); 476 + ARM_SAVE(ARM_RSTCT1); 477 + ARM_SAVE(ARM_RSTCT2); 478 + ARM_SAVE(ARM_SYSST); 479 + 480 + ULPD_SAVE(ULPD_IT_STATUS); 481 + ULPD_SAVE(ULPD_CLOCK_CTRL); 482 + ULPD_SAVE(ULPD_SOFT_REQ); 483 + ULPD_SAVE(ULPD_STATUS_REQ); 484 + ULPD_SAVE(ULPD_DPLL_CTRL); 485 + ULPD_SAVE(ULPD_POWER_CTRL); 486 + 487 + if (cpu_is_omap730()) { 488 + MPUI730_SAVE(MPUI_CTRL); 489 + MPUI730_SAVE(MPUI_DSP_STATUS); 490 + MPUI730_SAVE(MPUI_DSP_BOOT_CONFIG); 491 + MPUI730_SAVE(MPUI_DSP_API_CONFIG); 492 + MPUI730_SAVE(EMIFF_SDRAM_CONFIG); 493 + MPUI730_SAVE(EMIFS_CONFIG); 494 + } else if (cpu_is_omap15xx()) { 495 + MPUI1510_SAVE(MPUI_CTRL); 496 + MPUI1510_SAVE(MPUI_DSP_STATUS); 497 + MPUI1510_SAVE(MPUI_DSP_BOOT_CONFIG); 498 + MPUI1510_SAVE(MPUI_DSP_API_CONFIG); 499 + MPUI1510_SAVE(EMIFF_SDRAM_CONFIG); 500 + MPUI1510_SAVE(EMIFS_CONFIG); 501 + } else if (cpu_is_omap16xx()) { 502 + MPUI1610_SAVE(MPUI_CTRL); 503 + MPUI1610_SAVE(MPUI_DSP_STATUS); 504 + MPUI1610_SAVE(MPUI_DSP_BOOT_CONFIG); 505 + MPUI1610_SAVE(MPUI_DSP_API_CONFIG); 506 + MPUI1610_SAVE(EMIFF_SDRAM_CONFIG); 507 + MPUI1610_SAVE(EMIFS_CONFIG); 508 + } 509 + 510 + if (virtual_start == 0) { 511 + g_read_completed = 0; 512 + 513 + my_buffer_offset += sprintf(my_base + my_buffer_offset, 514 + "ARM_CKCTL_REG: 0x%-8x \n" 515 + "ARM_IDLECT1_REG: 0x%-8x \n" 516 + "ARM_IDLECT2_REG: 0x%-8x \n" 517 + "ARM_IDLECT3_REG: 0x%-8x \n" 518 + "ARM_EWUPCT_REG: 0x%-8x \n" 519 + "ARM_RSTCT1_REG: 0x%-8x \n" 520 + "ARM_RSTCT2_REG: 0x%-8x \n" 521 + "ARM_SYSST_REG: 0x%-8x \n" 522 + "ULPD_IT_STATUS_REG: 0x%-4x \n" 523 + "ULPD_CLOCK_CTRL_REG: 0x%-4x \n" 524 + "ULPD_SOFT_REQ_REG: 0x%-4x \n" 525 + "ULPD_DPLL_CTRL_REG: 0x%-4x \n" 526 + "ULPD_STATUS_REQ_REG: 0x%-4x \n" 527 + "ULPD_POWER_CTRL_REG: 0x%-4x \n", 528 + ARM_SHOW(ARM_CKCTL), 529 + ARM_SHOW(ARM_IDLECT1), 530 + ARM_SHOW(ARM_IDLECT2), 531 + ARM_SHOW(ARM_IDLECT3), 532 + ARM_SHOW(ARM_EWUPCT), 533 + ARM_SHOW(ARM_RSTCT1), 534 + ARM_SHOW(ARM_RSTCT2), 535 + ARM_SHOW(ARM_SYSST), 536 + ULPD_SHOW(ULPD_IT_STATUS), 537 + ULPD_SHOW(ULPD_CLOCK_CTRL), 538 + ULPD_SHOW(ULPD_SOFT_REQ), 539 + ULPD_SHOW(ULPD_DPLL_CTRL), 540 + ULPD_SHOW(ULPD_STATUS_REQ), 541 + ULPD_SHOW(ULPD_POWER_CTRL)); 542 + 543 + if (cpu_is_omap730()) { 544 + my_buffer_offset += sprintf(my_base + my_buffer_offset, 545 + "MPUI730_CTRL_REG 0x%-8x \n" 546 + "MPUI730_DSP_STATUS_REG: 0x%-8x \n" 547 + "MPUI730_DSP_BOOT_CONFIG_REG: 0x%-8x \n" 548 + "MPUI730_DSP_API_CONFIG_REG: 0x%-8x \n" 549 + "MPUI730_SDRAM_CONFIG_REG: 0x%-8x \n" 550 + "MPUI730_EMIFS_CONFIG_REG: 0x%-8x \n", 551 + MPUI730_SHOW(MPUI_CTRL), 552 + MPUI730_SHOW(MPUI_DSP_STATUS), 553 + MPUI730_SHOW(MPUI_DSP_BOOT_CONFIG), 554 + MPUI730_SHOW(MPUI_DSP_API_CONFIG), 555 + MPUI730_SHOW(EMIFF_SDRAM_CONFIG), 556 + MPUI730_SHOW(EMIFS_CONFIG)); 557 + } else if (cpu_is_omap15xx()) { 558 + my_buffer_offset += sprintf(my_base + my_buffer_offset, 559 + "MPUI1510_CTRL_REG 0x%-8x \n" 560 + "MPUI1510_DSP_STATUS_REG: 0x%-8x \n" 561 + "MPUI1510_DSP_BOOT_CONFIG_REG: 0x%-8x \n" 562 + "MPUI1510_DSP_API_CONFIG_REG: 0x%-8x \n" 563 + "MPUI1510_SDRAM_CONFIG_REG: 0x%-8x \n" 564 + "MPUI1510_EMIFS_CONFIG_REG: 0x%-8x \n", 565 + MPUI1510_SHOW(MPUI_CTRL), 566 + MPUI1510_SHOW(MPUI_DSP_STATUS), 567 + MPUI1510_SHOW(MPUI_DSP_BOOT_CONFIG), 568 + MPUI1510_SHOW(MPUI_DSP_API_CONFIG), 569 + MPUI1510_SHOW(EMIFF_SDRAM_CONFIG), 570 + MPUI1510_SHOW(EMIFS_CONFIG)); 571 + } else if (cpu_is_omap16xx()) { 572 + my_buffer_offset += sprintf(my_base + my_buffer_offset, 573 + "MPUI1610_CTRL_REG 0x%-8x \n" 574 + "MPUI1610_DSP_STATUS_REG: 0x%-8x \n" 575 + "MPUI1610_DSP_BOOT_CONFIG_REG: 0x%-8x \n" 576 + "MPUI1610_DSP_API_CONFIG_REG: 0x%-8x \n" 577 + "MPUI1610_SDRAM_CONFIG_REG: 0x%-8x \n" 578 + "MPUI1610_EMIFS_CONFIG_REG: 0x%-8x \n", 579 + MPUI1610_SHOW(MPUI_CTRL), 580 + MPUI1610_SHOW(MPUI_DSP_STATUS), 581 + MPUI1610_SHOW(MPUI_DSP_BOOT_CONFIG), 582 + MPUI1610_SHOW(MPUI_DSP_API_CONFIG), 583 + MPUI1610_SHOW(EMIFF_SDRAM_CONFIG), 584 + MPUI1610_SHOW(EMIFS_CONFIG)); 585 + } 586 + 587 + g_read_completed++; 588 + } else if (g_read_completed >= 1) { 589 + *eof = 1; 590 + return 0; 591 + } 592 + g_read_completed++; 593 + 594 + *my_first_byte = page_buffer; 595 + return my_buffer_offset; 596 + } 597 + 598 + static void omap_pm_init_proc(void) 599 + { 600 + struct proc_dir_entry *entry; 601 + 602 + entry = create_proc_read_entry("driver/omap_pm", 603 + S_IWUSR | S_IRUGO, NULL, 604 + omap_pm_read_proc, NULL); 605 + } 606 + 607 + #endif /* DEBUG && CONFIG_PROC_FS */ 608 + 609 + static void (*saved_idle)(void) = NULL; 610 + 611 + /* 612 + * omap_pm_prepare - Do preliminary suspend work. 613 + * @state: suspend state we're entering. 614 + * 615 + */ 616 + static int omap_pm_prepare(suspend_state_t state) 617 + { 618 + int error = 0; 619 + 620 + /* We cannot sleep in idle until we have resumed */ 621 + saved_idle = pm_idle; 622 + pm_idle = NULL; 623 + 624 + switch (state) 625 + { 626 + case PM_SUSPEND_STANDBY: 627 + case PM_SUSPEND_MEM: 628 + break; 629 + 630 + case PM_SUSPEND_DISK: 631 + return -ENOTSUPP; 632 + 633 + default: 634 + return -EINVAL; 635 + } 636 + 637 + return error; 638 + } 639 + 640 + 641 + /* 642 + * omap_pm_enter - Actually enter a sleep state. 643 + * @state: State we're entering. 644 + * 645 + */ 646 + 647 + static int omap_pm_enter(suspend_state_t state) 648 + { 649 + switch (state) 650 + { 651 + case PM_SUSPEND_STANDBY: 652 + case PM_SUSPEND_MEM: 653 + omap_pm_suspend(); 654 + break; 655 + 656 + case PM_SUSPEND_DISK: 657 + return -ENOTSUPP; 658 + 659 + default: 660 + return -EINVAL; 661 + } 662 + 663 + return 0; 664 + } 665 + 666 + 667 + /** 668 + * omap_pm_finish - Finish up suspend sequence. 669 + * @state: State we're coming out of. 670 + * 671 + * This is called after we wake back up (or if entering the sleep state 672 + * failed). 673 + */ 674 + 675 + static int omap_pm_finish(suspend_state_t state) 676 + { 677 + pm_idle = saved_idle; 678 + return 0; 679 + } 680 + 681 + 682 + static irqreturn_t omap_wakeup_interrupt(int irq, void * dev, 683 + struct pt_regs * regs) 684 + { 685 + return IRQ_HANDLED; 686 + } 687 + 688 + static struct irqaction omap_wakeup_irq = { 689 + .name = "peripheral wakeup", 690 + .flags = SA_INTERRUPT, 691 + .handler = omap_wakeup_interrupt 692 + }; 693 + 694 + 695 + 696 + static struct pm_ops omap_pm_ops ={ 697 + .pm_disk_mode = 0, 698 + .prepare = omap_pm_prepare, 699 + .enter = omap_pm_enter, 700 + .finish = omap_pm_finish, 701 + }; 702 + 703 + static int __init omap_pm_init(void) 704 + { 705 + printk("Power Management for TI OMAP.\n"); 706 + 707 + /* 708 + * We copy the assembler sleep/wakeup routines to SRAM. 709 + * These routines need to be in SRAM as that's the only 710 + * memory the MPU can see when it wakes up. 711 + */ 712 + if (cpu_is_omap730()) { 713 + omap_sram_idle = omap_sram_push(omap730_idle_loop_suspend, 714 + omap730_idle_loop_suspend_sz); 715 + omap_sram_suspend = omap_sram_push(omap730_cpu_suspend, 716 + omap730_cpu_suspend_sz); 717 + } else if (cpu_is_omap15xx()) { 718 + omap_sram_idle = omap_sram_push(omap1510_idle_loop_suspend, 719 + omap1510_idle_loop_suspend_sz); 720 + omap_sram_suspend = omap_sram_push(omap1510_cpu_suspend, 721 + omap1510_cpu_suspend_sz); 722 + } else if (cpu_is_omap16xx()) { 723 + omap_sram_idle = omap_sram_push(omap1610_idle_loop_suspend, 724 + omap1610_idle_loop_suspend_sz); 725 + omap_sram_suspend = omap_sram_push(omap1610_cpu_suspend, 726 + omap1610_cpu_suspend_sz); 727 + } 728 + 729 + if (omap_sram_idle == NULL || omap_sram_suspend == NULL) { 730 + printk(KERN_ERR "PM not initialized: Missing SRAM support\n"); 731 + return -ENODEV; 732 + } 733 + 734 + pm_idle = omap_pm_idle; 735 + 736 + if (cpu_is_omap730()) 737 + setup_irq(INT_730_WAKE_UP_REQ, &omap_wakeup_irq); 738 + else if (cpu_is_omap16xx()) 739 + setup_irq(INT_1610_WAKE_UP_REQ, &omap_wakeup_irq); 740 + 741 + /* Program new power ramp-up time 742 + * (0 for most boards since we don't lower voltage when in deep sleep) 743 + */ 744 + omap_writew(ULPD_SETUP_ANALOG_CELL_3_VAL, ULPD_SETUP_ANALOG_CELL_3); 745 + 746 + /* Setup ULPD POWER_CTRL_REG - enter deep sleep whenever possible */ 747 + omap_writew(ULPD_POWER_CTRL_REG_VAL, ULPD_POWER_CTRL); 748 + 749 + /* Configure IDLECT3 */ 750 + if (cpu_is_omap730()) 751 + omap_writel(OMAP730_IDLECT3_VAL, OMAP730_IDLECT3); 752 + else if (cpu_is_omap16xx()) 753 + omap_writel(OMAP1610_IDLECT3_VAL, OMAP1610_IDLECT3); 754 + 755 + pm_set_ops(&omap_pm_ops); 756 + 757 + #if defined(DEBUG) && defined(CONFIG_PROC_FS) 758 + omap_pm_init_proc(); 759 + #endif 760 + 761 + subsys_create_file(&power_subsys, &sleep_while_idle_attr); 762 + 763 + if (cpu_is_omap16xx()) { 764 + /* configure LOW_PWR pin */ 765 + omap_cfg_reg(T20_1610_LOW_PWR); 766 + } 767 + 768 + return 0; 769 + } 770 + __initcall(omap_pm_init);
+3 -3
arch/arm/mach-omap1/serial.c
··· 30 #include <asm/arch/pm.h> 31 #endif 32 33 - static struct clk * uart1_ck = NULL; 34 - static struct clk * uart2_ck = NULL; 35 - static struct clk * uart3_ck = NULL; 36 37 static inline unsigned int omap_serial_in(struct plat_serial8250_port *up, 38 int offset)
··· 30 #include <asm/arch/pm.h> 31 #endif 32 33 + static struct clk * uart1_ck; 34 + static struct clk * uart2_ck; 35 + static struct clk * uart3_ck; 36 37 static inline unsigned int omap_serial_in(struct plat_serial8250_port *up, 38 int offset)
-197
arch/arm/mach-omap1/time.c
··· 51 52 struct sys_timer omap_timer; 53 54 - #ifdef CONFIG_OMAP_MPU_TIMER 55 - 56 /* 57 * --------------------------------------------------------------------------- 58 * MPU timer ··· 220 221 return cycles_2_ns(ticks64); 222 } 223 - #endif /* CONFIG_OMAP_MPU_TIMER */ 224 - 225 - #ifdef CONFIG_OMAP_32K_TIMER 226 - 227 - #ifdef CONFIG_ARCH_OMAP15XX 228 - #error OMAP 32KHz timer does not currently work on 15XX! 229 - #endif 230 - 231 - /* 232 - * --------------------------------------------------------------------------- 233 - * 32KHz OS timer 234 - * 235 - * This currently works only on 16xx, as 1510 does not have the continuous 236 - * 32KHz synchronous timer. The 32KHz synchronous timer is used to keep track 237 - * of time in addition to the 32KHz OS timer. Using only the 32KHz OS timer 238 - * on 1510 would be possible, but the timer would not be as accurate as 239 - * with the 32KHz synchronized timer. 240 - * --------------------------------------------------------------------------- 241 - */ 242 - #define OMAP_32K_TIMER_BASE 0xfffb9000 243 - #define OMAP_32K_TIMER_CR 0x08 244 - #define OMAP_32K_TIMER_TVR 0x00 245 - #define OMAP_32K_TIMER_TCR 0x04 246 - 247 - #define OMAP_32K_TICKS_PER_HZ (32768 / HZ) 248 - 249 - /* 250 - * TRM says 1 / HZ = ( TVR + 1) / 32768, so TRV = (32768 / HZ) - 1 251 - * so with HZ = 100, TVR = 327.68. 252 - */ 253 - #define OMAP_32K_TIMER_TICK_PERIOD ((32768 / HZ) - 1) 254 - #define TIMER_32K_SYNCHRONIZED 0xfffbc410 255 - 256 - #define JIFFIES_TO_HW_TICKS(nr_jiffies, clock_rate) \ 257 - (((nr_jiffies) * (clock_rate)) / HZ) 258 - 259 - static inline void omap_32k_timer_write(int val, int reg) 260 - { 261 - omap_writew(val, reg + OMAP_32K_TIMER_BASE); 262 - } 263 - 264 - static inline unsigned long omap_32k_timer_read(int reg) 265 - { 266 - return omap_readl(reg + OMAP_32K_TIMER_BASE) & 0xffffff; 267 - } 268 - 269 - /* 270 - * The 32KHz synchronized timer is an additional timer on 16xx. 271 - * It is always running. 272 - */ 273 - static inline unsigned long omap_32k_sync_timer_read(void) 274 - { 275 - return omap_readl(TIMER_32K_SYNCHRONIZED); 276 - } 277 - 278 - static inline void omap_32k_timer_start(unsigned long load_val) 279 - { 280 - omap_32k_timer_write(load_val, OMAP_32K_TIMER_TVR); 281 - omap_32k_timer_write(0x0f, OMAP_32K_TIMER_CR); 282 - } 283 - 284 - static inline void omap_32k_timer_stop(void) 285 - { 286 - omap_32k_timer_write(0x0, OMAP_32K_TIMER_CR); 287 - } 288 - 289 - /* 290 - * Rounds down to nearest usec. Note that this will overflow for larger values. 291 - */ 292 - static inline unsigned long omap_32k_ticks_to_usecs(unsigned long ticks_32k) 293 - { 294 - return (ticks_32k * 5*5*5*5*5*5) >> 9; 295 - } 296 - 297 - /* 298 - * Rounds down to nearest nsec. 299 - */ 300 - static inline unsigned long long 301 - omap_32k_ticks_to_nsecs(unsigned long ticks_32k) 302 - { 303 - return (unsigned long long) ticks_32k * 1000 * 5*5*5*5*5*5 >> 9; 304 - } 305 - 306 - static unsigned long omap_32k_last_tick = 0; 307 - 308 - /* 309 - * Returns elapsed usecs since last 32k timer interrupt 310 - */ 311 - static unsigned long omap_32k_timer_gettimeoffset(void) 312 - { 313 - unsigned long now = omap_32k_sync_timer_read(); 314 - return omap_32k_ticks_to_usecs(now - omap_32k_last_tick); 315 - } 316 - 317 - /* 318 - * Returns current time from boot in nsecs. It's OK for this to wrap 319 - * around for now, as it's just a relative time stamp. 320 - */ 321 - unsigned long long sched_clock(void) 322 - { 323 - return omap_32k_ticks_to_nsecs(omap_32k_sync_timer_read()); 324 - } 325 - 326 - /* 327 - * Timer interrupt for 32KHz timer. When dynamic tick is enabled, this 328 - * function is also called from other interrupts to remove latency 329 - * issues with dynamic tick. In the dynamic tick case, we need to lock 330 - * with irqsave. 331 - */ 332 - static irqreturn_t omap_32k_timer_interrupt(int irq, void *dev_id, 333 - struct pt_regs *regs) 334 - { 335 - unsigned long flags; 336 - unsigned long now; 337 - 338 - write_seqlock_irqsave(&xtime_lock, flags); 339 - now = omap_32k_sync_timer_read(); 340 - 341 - while (now - omap_32k_last_tick >= OMAP_32K_TICKS_PER_HZ) { 342 - omap_32k_last_tick += OMAP_32K_TICKS_PER_HZ; 343 - timer_tick(regs); 344 - } 345 - 346 - /* Restart timer so we don't drift off due to modulo or dynamic tick. 347 - * By default we program the next timer to be continuous to avoid 348 - * latencies during high system load. During dynamic tick operation the 349 - * continuous timer can be overridden from pm_idle to be longer. 350 - */ 351 - omap_32k_timer_start(omap_32k_last_tick + OMAP_32K_TICKS_PER_HZ - now); 352 - write_sequnlock_irqrestore(&xtime_lock, flags); 353 - 354 - return IRQ_HANDLED; 355 - } 356 - 357 - #ifdef CONFIG_NO_IDLE_HZ 358 - /* 359 - * Programs the next timer interrupt needed. Called when dynamic tick is 360 - * enabled, and to reprogram the ticks to skip from pm_idle. Note that 361 - * we can keep the timer continuous, and don't need to set it to run in 362 - * one-shot mode. This is because the timer will get reprogrammed again 363 - * after next interrupt. 364 - */ 365 - void omap_32k_timer_reprogram(unsigned long next_tick) 366 - { 367 - omap_32k_timer_start(JIFFIES_TO_HW_TICKS(next_tick, 32768) + 1); 368 - } 369 - 370 - static struct irqaction omap_32k_timer_irq; 371 - extern struct timer_update_handler timer_update; 372 - 373 - static int omap_32k_timer_enable_dyn_tick(void) 374 - { 375 - /* No need to reprogram timer, just use the next interrupt */ 376 - return 0; 377 - } 378 - 379 - static int omap_32k_timer_disable_dyn_tick(void) 380 - { 381 - omap_32k_timer_start(OMAP_32K_TIMER_TICK_PERIOD); 382 - return 0; 383 - } 384 - 385 - static struct dyn_tick_timer omap_dyn_tick_timer = { 386 - .enable = omap_32k_timer_enable_dyn_tick, 387 - .disable = omap_32k_timer_disable_dyn_tick, 388 - .reprogram = omap_32k_timer_reprogram, 389 - .handler = omap_32k_timer_interrupt, 390 - }; 391 - #endif /* CONFIG_NO_IDLE_HZ */ 392 - 393 - static struct irqaction omap_32k_timer_irq = { 394 - .name = "32KHz timer", 395 - .flags = SA_INTERRUPT | SA_TIMER, 396 - .handler = omap_32k_timer_interrupt, 397 - }; 398 - 399 - static __init void omap_init_32k_timer(void) 400 - { 401 - 402 - #ifdef CONFIG_NO_IDLE_HZ 403 - omap_timer.dyn_tick = &omap_dyn_tick_timer; 404 - #endif 405 - 406 - setup_irq(INT_OS_TIMER, &omap_32k_timer_irq); 407 - omap_timer.offset = omap_32k_timer_gettimeoffset; 408 - omap_32k_last_tick = omap_32k_sync_timer_read(); 409 - omap_32k_timer_start(OMAP_32K_TIMER_TICK_PERIOD); 410 - } 411 - #endif /* CONFIG_OMAP_32K_TIMER */ 412 413 /* 414 * --------------------------------------------------------------------------- ··· 228 */ 229 static void __init omap_timer_init(void) 230 { 231 - #if defined(CONFIG_OMAP_MPU_TIMER) 232 omap_init_mpu_timer(); 233 - #elif defined(CONFIG_OMAP_32K_TIMER) 234 - omap_init_32k_timer(); 235 - #else 236 - #error No system timer selected in Kconfig! 237 - #endif 238 } 239 240 struct sys_timer omap_timer = {
··· 51 52 struct sys_timer omap_timer; 53 54 /* 55 * --------------------------------------------------------------------------- 56 * MPU timer ··· 222 223 return cycles_2_ns(ticks64); 224 } 225 226 /* 227 * --------------------------------------------------------------------------- ··· 419 */ 420 static void __init omap_timer_init(void) 421 { 422 omap_init_mpu_timer(); 423 } 424 425 struct sys_timer omap_timer = {
+3
arch/arm/mach-omap2/Kconfig
··· 20 bool "OMAP 2420 H4 board" 21 depends on ARCH_OMAP2 && ARCH_OMAP24XX 22
··· 20 bool "OMAP 2420 H4 board" 21 depends on ARCH_OMAP2 && ARCH_OMAP24XX 22 23 + config MACH_OMAP_APOLLON 24 + bool "OMAP 2420 Apollon board" 25 + depends on ARCH_OMAP2 && ARCH_OMAP24XX
+5 -1
arch/arm/mach-omap2/Makefile
··· 3 # 4 5 # Common support 6 - obj-y := irq.o id.o io.o sram-fn.o clock.o mux.o devices.o serial.o 7 8 obj-$(CONFIG_OMAP_MPU_TIMER) += timer-gp.o 9 10 # Specific board support 11 obj-$(CONFIG_MACH_OMAP_GENERIC) += board-generic.o 12 obj-$(CONFIG_MACH_OMAP_H4) += board-h4.o 13
··· 3 # 4 5 # Common support 6 + obj-y := irq.o id.o io.o sram-fn.o memory.o prcm.o clock.o mux.o devices.o serial.o 7 8 obj-$(CONFIG_OMAP_MPU_TIMER) += timer-gp.o 9 + 10 + # Power Management 11 + obj-$(CONFIG_PM) += pm.o sleep.o 12 13 # Specific board support 14 obj-$(CONFIG_MACH_OMAP_GENERIC) += board-generic.o 15 obj-$(CONFIG_MACH_OMAP_H4) += board-h4.o 16 + obj-$(CONFIG_MACH_OMAP_APOLLON) += board-apollon.o 17
+285
arch/arm/mach-omap2/board-apollon.c
···
··· 1 + /* 2 + * linux/arch/arm/mach-omap/omap2/board-apollon.c 3 + * 4 + * Copyright (C) 2005,2006 Samsung Electronics 5 + * Author: Kyungmin Park <kyungmin.park@samsung.com> 6 + * 7 + * Modified from mach-omap/omap2/board-h4.c 8 + * 9 + * Code for apollon OMAP2 board. Should work on many OMAP2 systems where 10 + * the bootloader passes the board-specific data to the kernel. 11 + * Do not put any board specific code to this file; create a new machine 12 + * type if you need custom low-level initializations. 13 + * 14 + * This program is free software; you can redistribute it and/or modify 15 + * it under the terms of the GNU General Public License version 2 as 16 + * published by the Free Software Foundation. 17 + */ 18 + 19 + #include <linux/kernel.h> 20 + #include <linux/init.h> 21 + #include <linux/platform_device.h> 22 + #include <linux/mtd/mtd.h> 23 + #include <linux/mtd/partitions.h> 24 + #include <linux/mtd/onenand.h> 25 + #include <linux/interrupt.h> 26 + #include <linux/delay.h> 27 + 28 + #include <asm/hardware.h> 29 + #include <asm/mach-types.h> 30 + #include <asm/mach/arch.h> 31 + #include <asm/mach/flash.h> 32 + 33 + #include <asm/arch/gpio.h> 34 + #include <asm/arch/mux.h> 35 + #include <asm/arch/usb.h> 36 + #include <asm/arch/board.h> 37 + #include <asm/arch/common.h> 38 + #include "prcm-regs.h" 39 + 40 + /* LED & Switch macros */ 41 + #define LED0_GPIO13 13 42 + #define LED1_GPIO14 14 43 + #define LED2_GPIO15 15 44 + #define SW_ENTER_GPIO16 16 45 + #define SW_UP_GPIO17 17 46 + #define SW_DOWN_GPIO58 58 47 + 48 + static struct mtd_partition apollon_partitions[] = { 49 + { 50 + .name = "X-Loader + U-Boot", 51 + .offset = 0, 52 + .size = SZ_128K, 53 + .mask_flags = MTD_WRITEABLE, 54 + }, 55 + { 56 + .name = "params", 57 + .offset = MTDPART_OFS_APPEND, 58 + .size = SZ_128K, 59 + }, 60 + { 61 + .name = "kernel", 62 + .offset = MTDPART_OFS_APPEND, 63 + .size = SZ_2M, 64 + }, 65 + { 66 + .name = "rootfs", 67 + .offset = MTDPART_OFS_APPEND, 68 + .size = SZ_16M, 69 + }, 70 + { 71 + .name = "filesystem00", 72 + .offset = MTDPART_OFS_APPEND, 73 + .size = SZ_32M, 74 + }, 75 + { 76 + .name = "filesystem01", 77 + .offset = MTDPART_OFS_APPEND, 78 + .size = MTDPART_SIZ_FULL, 79 + }, 80 + }; 81 + 82 + static struct flash_platform_data apollon_flash_data = { 83 + .parts = apollon_partitions, 84 + .nr_parts = ARRAY_SIZE(apollon_partitions), 85 + }; 86 + 87 + static struct resource apollon_flash_resource = { 88 + .start = APOLLON_CS0_BASE, 89 + .end = APOLLON_CS0_BASE + SZ_128K, 90 + .flags = IORESOURCE_MEM, 91 + }; 92 + 93 + static struct platform_device apollon_onenand_device = { 94 + .name = "onenand", 95 + .id = -1, 96 + .dev = { 97 + .platform_data = &apollon_flash_data, 98 + }, 99 + .num_resources = ARRAY_SIZE(&apollon_flash_resource), 100 + .resource = &apollon_flash_resource, 101 + }; 102 + 103 + static struct resource apollon_smc91x_resources[] = { 104 + [0] = { 105 + .start = APOLLON_ETHR_START, /* Physical */ 106 + .end = APOLLON_ETHR_START + 0xf, 107 + .flags = IORESOURCE_MEM, 108 + }, 109 + [1] = { 110 + .start = OMAP_GPIO_IRQ(APOLLON_ETHR_GPIO_IRQ), 111 + .end = OMAP_GPIO_IRQ(APOLLON_ETHR_GPIO_IRQ), 112 + .flags = IORESOURCE_IRQ, 113 + }, 114 + }; 115 + 116 + static struct platform_device apollon_smc91x_device = { 117 + .name = "smc91x", 118 + .id = -1, 119 + .num_resources = ARRAY_SIZE(apollon_smc91x_resources), 120 + .resource = apollon_smc91x_resources, 121 + }; 122 + 123 + static struct platform_device apollon_lcd_device = { 124 + .name = "apollon_lcd", 125 + .id = -1, 126 + }; 127 + 128 + static struct platform_device *apollon_devices[] __initdata = { 129 + &apollon_onenand_device, 130 + &apollon_smc91x_device, 131 + &apollon_lcd_device, 132 + }; 133 + 134 + static inline void __init apollon_init_smc91x(void) 135 + { 136 + /* Make sure CS1 timings are correct */ 137 + GPMC_CONFIG1_1 = 0x00011203; 138 + GPMC_CONFIG2_1 = 0x001f1f01; 139 + GPMC_CONFIG3_1 = 0x00080803; 140 + GPMC_CONFIG4_1 = 0x1c091c09; 141 + GPMC_CONFIG5_1 = 0x041f1f1f; 142 + GPMC_CONFIG6_1 = 0x000004c4; 143 + GPMC_CONFIG7_1 = 0x00000f40 | (APOLLON_CS1_BASE >> 24); 144 + udelay(100); 145 + 146 + omap_cfg_reg(W4__24XX_GPIO74); 147 + if (omap_request_gpio(APOLLON_ETHR_GPIO_IRQ) < 0) { 148 + printk(KERN_ERR "Failed to request GPIO%d for smc91x IRQ\n", 149 + APOLLON_ETHR_GPIO_IRQ); 150 + return; 151 + } 152 + omap_set_gpio_direction(APOLLON_ETHR_GPIO_IRQ, 1); 153 + } 154 + 155 + static void __init omap_apollon_init_irq(void) 156 + { 157 + omap2_init_common_hw(); 158 + omap_init_irq(); 159 + omap_gpio_init(); 160 + apollon_init_smc91x(); 161 + } 162 + 163 + static struct omap_uart_config apollon_uart_config __initdata = { 164 + .enabled_uarts = (1 << 0) | (0 << 1) | (0 << 2), 165 + }; 166 + 167 + static struct omap_mmc_config apollon_mmc_config __initdata = { 168 + .mmc [0] = { 169 + .enabled = 0, 170 + .wire4 = 0, 171 + .wp_pin = -1, 172 + .power_pin = -1, 173 + .switch_pin = -1, 174 + }, 175 + }; 176 + 177 + static struct omap_lcd_config apollon_lcd_config __initdata = { 178 + .ctrl_name = "internal", 179 + }; 180 + 181 + static struct omap_board_config_kernel apollon_config[] = { 182 + { OMAP_TAG_UART, &apollon_uart_config }, 183 + { OMAP_TAG_MMC, &apollon_mmc_config }, 184 + { OMAP_TAG_LCD, &apollon_lcd_config }, 185 + }; 186 + 187 + static void __init apollon_led_init(void) 188 + { 189 + /* LED0 - AA10 */ 190 + omap_cfg_reg(AA10_242X_GPIO13); 191 + omap_request_gpio(LED0_GPIO13); 192 + omap_set_gpio_direction(LED0_GPIO13, 0); 193 + omap_set_gpio_dataout(LED0_GPIO13, 0); 194 + /* LED1 - AA6 */ 195 + omap_cfg_reg(AA6_242X_GPIO14); 196 + omap_request_gpio(LED1_GPIO14); 197 + omap_set_gpio_direction(LED1_GPIO14, 0); 198 + omap_set_gpio_dataout(LED1_GPIO14, 0); 199 + /* LED2 - AA4 */ 200 + omap_cfg_reg(AA4_242X_GPIO15); 201 + omap_request_gpio(LED2_GPIO15); 202 + omap_set_gpio_direction(LED2_GPIO15, 0); 203 + omap_set_gpio_dataout(LED2_GPIO15, 0); 204 + } 205 + 206 + static irqreturn_t apollon_sw_interrupt(int irq, void *ignored, struct pt_regs *regs) 207 + { 208 + static unsigned int led0, led1, led2; 209 + 210 + if (irq == OMAP_GPIO_IRQ(SW_ENTER_GPIO16)) 211 + omap_set_gpio_dataout(LED0_GPIO13, led0 ^= 1); 212 + else if (irq == OMAP_GPIO_IRQ(SW_UP_GPIO17)) 213 + omap_set_gpio_dataout(LED1_GPIO14, led1 ^= 1); 214 + else if (irq == OMAP_GPIO_IRQ(SW_DOWN_GPIO58)) 215 + omap_set_gpio_dataout(LED2_GPIO15, led2 ^= 1); 216 + 217 + return IRQ_HANDLED; 218 + } 219 + 220 + static void __init apollon_sw_init(void) 221 + { 222 + /* Enter SW - Y11 */ 223 + omap_cfg_reg(Y11_242X_GPIO16); 224 + omap_request_gpio(SW_ENTER_GPIO16); 225 + omap_set_gpio_direction(SW_ENTER_GPIO16, 1); 226 + /* Up SW - AA12 */ 227 + omap_cfg_reg(AA12_242X_GPIO17); 228 + omap_request_gpio(SW_UP_GPIO17); 229 + omap_set_gpio_direction(SW_UP_GPIO17, 1); 230 + /* Down SW - AA8 */ 231 + omap_cfg_reg(AA8_242X_GPIO58); 232 + omap_request_gpio(SW_DOWN_GPIO58); 233 + omap_set_gpio_direction(SW_DOWN_GPIO58, 1); 234 + 235 + set_irq_type(OMAP_GPIO_IRQ(SW_ENTER_GPIO16), IRQT_RISING); 236 + if (request_irq(OMAP_GPIO_IRQ(SW_ENTER_GPIO16), &apollon_sw_interrupt, 237 + SA_SHIRQ, "enter sw", 238 + &apollon_sw_interrupt)) 239 + return; 240 + set_irq_type(OMAP_GPIO_IRQ(SW_UP_GPIO17), IRQT_RISING); 241 + if (request_irq(OMAP_GPIO_IRQ(SW_UP_GPIO17), &apollon_sw_interrupt, 242 + SA_SHIRQ, "up sw", 243 + &apollon_sw_interrupt)) 244 + return; 245 + set_irq_type(OMAP_GPIO_IRQ(SW_DOWN_GPIO58), IRQT_RISING); 246 + if (request_irq(OMAP_GPIO_IRQ(SW_DOWN_GPIO58), &apollon_sw_interrupt, 247 + SA_SHIRQ, "down sw", 248 + &apollon_sw_interrupt)) 249 + return; 250 + } 251 + 252 + static void __init omap_apollon_init(void) 253 + { 254 + apollon_led_init(); 255 + apollon_sw_init(); 256 + 257 + /* REVISIT: where's the correct place */ 258 + omap_cfg_reg(W19_24XX_SYS_NIRQ); 259 + 260 + /* 261 + * Make sure the serial ports are muxed on at this point. 262 + * You have to mux them off in device drivers later on 263 + * if not needed. 264 + */ 265 + platform_add_devices(apollon_devices, ARRAY_SIZE(apollon_devices)); 266 + omap_board_config = apollon_config; 267 + omap_board_config_size = ARRAY_SIZE(apollon_config); 268 + omap_serial_init(); 269 + } 270 + 271 + static void __init omap_apollon_map_io(void) 272 + { 273 + omap2_map_common_io(); 274 + } 275 + 276 + MACHINE_START(OMAP_APOLLON, "OMAP24xx Apollon") 277 + /* Maintainer: Kyungmin Park <kyungmin.park@samsung.com> */ 278 + .phys_io = 0x48000000, 279 + .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc, 280 + .boot_params = 0x80000100, 281 + .map_io = omap_apollon_map_io, 282 + .init_irq = omap_apollon_init_irq, 283 + .init_machine = omap_apollon_init, 284 + .timer = &omap_timer, 285 + MACHINE_END
+172 -2
arch/arm/mach-omap2/board-h4.c
··· 17 #include <linux/mtd/mtd.h> 18 #include <linux/mtd/partitions.h> 19 #include <linux/delay.h> 20 21 #include <asm/hardware.h> 22 #include <asm/mach-types.h> ··· 27 #include <asm/mach/flash.h> 28 29 #include <asm/arch/gpio.h> 30 #include <asm/arch/mux.h> 31 #include <asm/arch/usb.h> 32 #include <asm/arch/board.h> 33 #include <asm/arch/common.h> 34 - #include <asm/arch/prcm.h> 35 36 #include <asm/io.h> 37 #include <asm/delay.h> 38 39 static struct mtd_partition h4_partitions[] = { 40 /* bootloader (U-Boot, etc) in first sector */ ··· 152 .resource = h4_smc91x_resources, 153 }; 154 155 static struct platform_device *h4_devices[] __initdata = { 156 &h4_smc91x_device, 157 &h4_flash_device, 158 }; 159 160 static inline void __init h4_init_smc91x(void) ··· 315 }; 316 317 static struct omap_lcd_config h4_lcd_config __initdata = { 318 - .panel_name = "h4", 319 .ctrl_name = "internal", 320 }; 321 ··· 331 * You have to mux them off in device drivers later on 332 * if not needed. 333 */ 334 platform_add_devices(h4_devices, ARRAY_SIZE(h4_devices)); 335 omap_board_config = h4_config; 336 omap_board_config_size = ARRAY_SIZE(h4_config);
··· 17 #include <linux/mtd/mtd.h> 18 #include <linux/mtd/partitions.h> 19 #include <linux/delay.h> 20 + #include <linux/workqueue.h> 21 + #include <linux/input.h> 22 23 #include <asm/hardware.h> 24 #include <asm/mach-types.h> ··· 25 #include <asm/mach/flash.h> 26 27 #include <asm/arch/gpio.h> 28 + #include <asm/arch/gpioexpander.h> 29 #include <asm/arch/mux.h> 30 #include <asm/arch/usb.h> 31 + #include <asm/arch/irda.h> 32 #include <asm/arch/board.h> 33 #include <asm/arch/common.h> 34 + #include <asm/arch/keypad.h> 35 + #include <asm/arch/menelaus.h> 36 + #include <asm/arch/dma.h> 37 + #include "prcm-regs.h" 38 39 #include <asm/io.h> 40 #include <asm/delay.h> 41 + 42 + static unsigned int row_gpios[6] = { 88, 89, 124, 11, 6, 96 }; 43 + static unsigned int col_gpios[7] = { 90, 91, 100, 36, 12, 97, 98 }; 44 + 45 + static int h4_keymap[] = { 46 + KEY(0, 0, KEY_LEFT), 47 + KEY(0, 1, KEY_RIGHT), 48 + KEY(0, 2, KEY_A), 49 + KEY(0, 3, KEY_B), 50 + KEY(0, 4, KEY_C), 51 + KEY(1, 0, KEY_DOWN), 52 + KEY(1, 1, KEY_UP), 53 + KEY(1, 2, KEY_E), 54 + KEY(1, 3, KEY_F), 55 + KEY(1, 4, KEY_G), 56 + KEY(2, 0, KEY_ENTER), 57 + KEY(2, 1, KEY_I), 58 + KEY(2, 2, KEY_J), 59 + KEY(2, 3, KEY_K), 60 + KEY(2, 4, KEY_3), 61 + KEY(3, 0, KEY_M), 62 + KEY(3, 1, KEY_N), 63 + KEY(3, 2, KEY_O), 64 + KEY(3, 3, KEY_P), 65 + KEY(3, 4, KEY_Q), 66 + KEY(4, 0, KEY_R), 67 + KEY(4, 1, KEY_4), 68 + KEY(4, 2, KEY_T), 69 + KEY(4, 3, KEY_U), 70 + KEY(4, 4, KEY_ENTER), 71 + KEY(5, 0, KEY_V), 72 + KEY(5, 1, KEY_W), 73 + KEY(5, 2, KEY_L), 74 + KEY(5, 3, KEY_S), 75 + KEY(5, 4, KEY_ENTER), 76 + 0 77 + }; 78 79 static struct mtd_partition h4_partitions[] = { 80 /* bootloader (U-Boot, etc) in first sector */ ··· 108 .resource = h4_smc91x_resources, 109 }; 110 111 + /* Select between the IrDA and aGPS module 112 + */ 113 + static int h4_select_irda(struct device *dev, int state) 114 + { 115 + unsigned char expa; 116 + int err = 0; 117 + 118 + if ((err = read_gpio_expa(&expa, 0x21))) { 119 + printk(KERN_ERR "Error reading from I/O expander\n"); 120 + return err; 121 + } 122 + 123 + /* 'P6' enable/disable IRDA_TX and IRDA_RX */ 124 + if (state & IR_SEL) { /* IrDa */ 125 + if ((err = write_gpio_expa(expa | 0x01, 0x21))) { 126 + printk(KERN_ERR "Error writing to I/O expander\n"); 127 + return err; 128 + } 129 + } else { 130 + if ((err = write_gpio_expa(expa & ~0x01, 0x21))) { 131 + printk(KERN_ERR "Error writing to I/O expander\n"); 132 + return err; 133 + } 134 + } 135 + return err; 136 + } 137 + 138 + static void set_trans_mode(void *data) 139 + { 140 + int *mode = data; 141 + unsigned char expa; 142 + int err = 0; 143 + 144 + if ((err = read_gpio_expa(&expa, 0x20)) != 0) { 145 + printk(KERN_ERR "Error reading from I/O expander\n"); 146 + } 147 + 148 + expa &= ~0x01; 149 + 150 + if (!(*mode & IR_SIRMODE)) { /* MIR/FIR */ 151 + expa |= 0x01; 152 + } 153 + 154 + if ((err = write_gpio_expa(expa, 0x20)) != 0) { 155 + printk(KERN_ERR "Error writing to I/O expander\n"); 156 + } 157 + } 158 + 159 + static int h4_transceiver_mode(struct device *dev, int mode) 160 + { 161 + struct omap_irda_config *irda_config = dev->platform_data; 162 + 163 + cancel_delayed_work(&irda_config->gpio_expa); 164 + PREPARE_WORK(&irda_config->gpio_expa, set_trans_mode, &mode); 165 + schedule_work(&irda_config->gpio_expa); 166 + 167 + return 0; 168 + } 169 + 170 + static struct omap_irda_config h4_irda_data = { 171 + .transceiver_cap = IR_SIRMODE | IR_MIRMODE | IR_FIRMODE, 172 + .transceiver_mode = h4_transceiver_mode, 173 + .select_irda = h4_select_irda, 174 + .rx_channel = OMAP24XX_DMA_UART3_RX, 175 + .tx_channel = OMAP24XX_DMA_UART3_TX, 176 + .dest_start = OMAP_UART3_BASE, 177 + .src_start = OMAP_UART3_BASE, 178 + .tx_trigger = OMAP24XX_DMA_UART3_TX, 179 + .rx_trigger = OMAP24XX_DMA_UART3_RX, 180 + }; 181 + 182 + static struct resource h4_irda_resources[] = { 183 + [0] = { 184 + .start = INT_24XX_UART3_IRQ, 185 + .end = INT_24XX_UART3_IRQ, 186 + .flags = IORESOURCE_IRQ, 187 + }, 188 + }; 189 + 190 + static struct platform_device h4_irda_device = { 191 + .name = "omapirda", 192 + .id = -1, 193 + .dev = { 194 + .platform_data = &h4_irda_data, 195 + }, 196 + .num_resources = 1, 197 + .resource = h4_irda_resources, 198 + }; 199 + 200 + static struct omap_kp_platform_data h4_kp_data = { 201 + .rows = 6, 202 + .cols = 7, 203 + .keymap = h4_keymap, 204 + .rep = 1, 205 + .row_gpios = row_gpios, 206 + .col_gpios = col_gpios, 207 + }; 208 + 209 + static struct platform_device h4_kp_device = { 210 + .name = "omap-keypad", 211 + .id = -1, 212 + .dev = { 213 + .platform_data = &h4_kp_data, 214 + }, 215 + }; 216 + 217 + static struct platform_device h4_lcd_device = { 218 + .name = "lcd_h4", 219 + .id = -1, 220 + }; 221 + 222 static struct platform_device *h4_devices[] __initdata = { 223 &h4_smc91x_device, 224 &h4_flash_device, 225 + &h4_irda_device, 226 + &h4_kp_device, 227 + &h4_lcd_device, 228 }; 229 230 static inline void __init h4_init_smc91x(void) ··· 157 }; 158 159 static struct omap_lcd_config h4_lcd_config __initdata = { 160 .ctrl_name = "internal", 161 }; 162 ··· 174 * You have to mux them off in device drivers later on 175 * if not needed. 176 */ 177 + #if defined(CONFIG_OMAP_IR) || defined(CONFIG_OMAP_IR_MODULE) 178 + omap_cfg_reg(K15_24XX_UART3_TX); 179 + omap_cfg_reg(K14_24XX_UART3_RX); 180 + #endif 181 + 182 + #if defined(CONFIG_KEYBOARD_OMAP) || defined(CONFIG_KEYBOARD_OMAP_MODULE) 183 + if (omap_has_menelaus()) { 184 + row_gpios[5] = 0; 185 + col_gpios[2] = 15; 186 + col_gpios[6] = 18; 187 + } 188 + #endif 189 + 190 platform_add_devices(h4_devices, ARRAY_SIZE(h4_devices)); 191 omap_board_config = h4_config; 192 omap_board_config_size = ARRAY_SIZE(h4_config);
+14 -65
arch/arm/mach-omap2/clock.c
··· 28 29 #include <asm/arch/clock.h> 30 #include <asm/arch/sram.h> 31 - #include <asm/arch/prcm.h> 32 33 #include "clock.h" 34 35 //#define DOWN_VARIABLE_DPLL 1 /* Experimental */ 36 37 static struct prcm_config *curr_prcm_set; 38 - static struct memory_timings mem_timings; 39 static u32 curr_perf_level = PRCM_FULL_SPEED; 40 41 /*------------------------------------------------------------------------- ··· 54 55 static u32 omap2_get_dpll_rate(struct clk * tclk) 56 { 57 - int dpll_clk, dpll_mult, dpll_div, amult; 58 59 dpll_mult = (CM_CLKSEL1_PLL >> 12) & 0x03ff; /* 10 bits */ 60 dpll_div = (CM_CLKSEL1_PLL >> 8) & 0x0f; /* 4 bits */ 61 - dpll_clk = (tclk->parent->rate * dpll_mult) / (dpll_div + 1); 62 amult = CM_CLKSEL2_PLL & 0x3; 63 dpll_clk *= amult; 64 ··· 387 return 0; 388 } 389 390 - static void omap2_init_memory_params(u32 force_lock_to_unlock_mode) 391 - { 392 - unsigned long dll_cnt; 393 - u32 fast_dll = 0; 394 - 395 - mem_timings.m_type = !((SDRC_MR_0 & 0x3) == 0x1); /* DDR = 1, SDR = 0 */ 396 - 397 - /* 2422 es2.05 and beyond has a single SIP DDR instead of 2 like others. 398 - * In the case of 2422, its ok to use CS1 instead of CS0. 399 - */ 400 - 401 - #if 0 /* FIXME: Enable after 24xx cpu detection works */ 402 - ctype = get_cpu_type(); 403 - if (cpu_is_omap2422()) 404 - mem_timings.base_cs = 1; 405 - else 406 - #endif 407 - mem_timings.base_cs = 0; 408 - 409 - if (mem_timings.m_type != M_DDR) 410 - return; 411 - 412 - /* With DDR we need to determine the low frequency DLL value */ 413 - if (((mem_timings.fast_dll_ctrl & (1 << 2)) == M_LOCK_CTRL)) 414 - mem_timings.dll_mode = M_UNLOCK; 415 - else 416 - mem_timings.dll_mode = M_LOCK; 417 - 418 - if (mem_timings.base_cs == 0) { 419 - fast_dll = SDRC_DLLA_CTRL; 420 - dll_cnt = SDRC_DLLA_STATUS & 0xff00; 421 - } else { 422 - fast_dll = SDRC_DLLB_CTRL; 423 - dll_cnt = SDRC_DLLB_STATUS & 0xff00; 424 - } 425 - if (force_lock_to_unlock_mode) { 426 - fast_dll &= ~0xff00; 427 - fast_dll |= dll_cnt; /* Current lock mode */ 428 - } 429 - mem_timings.fast_dll_ctrl = fast_dll; 430 - 431 - /* No disruptions, DDR will be offline & C-ABI not followed */ 432 - omap2_sram_ddr_init(&mem_timings.slow_dll_ctrl, 433 - mem_timings.fast_dll_ctrl, 434 - mem_timings.base_cs, 435 - force_lock_to_unlock_mode); 436 - mem_timings.slow_dll_ctrl &= 0xff00; /* Keep lock value */ 437 - 438 - /* Turn status into unlock ctrl */ 439 - mem_timings.slow_dll_ctrl |= 440 - ((mem_timings.fast_dll_ctrl & 0xF) | (1 << 2)); 441 - 442 - /* 90 degree phase for anything below 133Mhz */ 443 - mem_timings.slow_dll_ctrl |= (1 << 1); 444 - } 445 - 446 static u32 omap2_reprogram_sdrc(u32 level, u32 force) 447 { 448 u32 prev = curr_perf_level, flags; 449 450 if ((curr_perf_level == level) && !force) 451 return prev; 452 453 if (level == PRCM_HALF_SPEED) { 454 local_irq_save(flags); 455 PRCM_VOLTSETUP = 0xffff; 456 omap2_sram_reprogram_sdrc(PRCM_HALF_SPEED, 457 - mem_timings.slow_dll_ctrl, 458 - mem_timings.m_type); 459 curr_perf_level = PRCM_HALF_SPEED; 460 local_irq_restore(flags); 461 } ··· 411 local_irq_save(flags); 412 PRCM_VOLTSETUP = 0xffff; 413 omap2_sram_reprogram_sdrc(PRCM_FULL_SPEED, 414 - mem_timings.fast_dll_ctrl, 415 - mem_timings.m_type); 416 curr_perf_level = PRCM_FULL_SPEED; 417 local_irq_restore(flags); 418 } ··· 599 case 13: /* dss2 */ 600 mask = 0x1; break; 601 case 25: /* usb */ 602 - mask = 0xf; break; 603 } 604 } 605
··· 28 29 #include <asm/arch/clock.h> 30 #include <asm/arch/sram.h> 31 32 + #include "prcm-regs.h" 33 + #include "memory.h" 34 #include "clock.h" 35 36 //#define DOWN_VARIABLE_DPLL 1 /* Experimental */ 37 38 static struct prcm_config *curr_prcm_set; 39 static u32 curr_perf_level = PRCM_FULL_SPEED; 40 41 /*------------------------------------------------------------------------- ··· 54 55 static u32 omap2_get_dpll_rate(struct clk * tclk) 56 { 57 + long long dpll_clk; 58 + int dpll_mult, dpll_div, amult; 59 60 dpll_mult = (CM_CLKSEL1_PLL >> 12) & 0x03ff; /* 10 bits */ 61 dpll_div = (CM_CLKSEL1_PLL >> 8) & 0x0f; /* 4 bits */ 62 + dpll_clk = (long long)tclk->parent->rate * dpll_mult; 63 + do_div(dpll_clk, dpll_div + 1); 64 amult = CM_CLKSEL2_PLL & 0x3; 65 dpll_clk *= amult; 66 ··· 385 return 0; 386 } 387 388 static u32 omap2_reprogram_sdrc(u32 level, u32 force) 389 { 390 + u32 slow_dll_ctrl, fast_dll_ctrl, m_type; 391 u32 prev = curr_perf_level, flags; 392 393 if ((curr_perf_level == level) && !force) 394 return prev; 395 396 + m_type = omap2_memory_get_type(); 397 + slow_dll_ctrl = omap2_memory_get_slow_dll_ctrl(); 398 + fast_dll_ctrl = omap2_memory_get_fast_dll_ctrl(); 399 + 400 if (level == PRCM_HALF_SPEED) { 401 local_irq_save(flags); 402 PRCM_VOLTSETUP = 0xffff; 403 omap2_sram_reprogram_sdrc(PRCM_HALF_SPEED, 404 + slow_dll_ctrl, m_type); 405 curr_perf_level = PRCM_HALF_SPEED; 406 local_irq_restore(flags); 407 } ··· 461 local_irq_save(flags); 462 PRCM_VOLTSETUP = 0xffff; 463 omap2_sram_reprogram_sdrc(PRCM_FULL_SPEED, 464 + fast_dll_ctrl, m_type); 465 curr_perf_level = PRCM_FULL_SPEED; 466 local_irq_restore(flags); 467 } ··· 650 case 13: /* dss2 */ 651 mask = 0x1; break; 652 case 25: /* usb */ 653 + mask = 0x7; break; 654 } 655 } 656
+19 -18
arch/arm/mach-omap2/clock.h
··· 33 #define RATE_IN_242X (1 << 0) 34 #define RATE_IN_243X (1 << 1) 35 36 - /* Memory timings */ 37 - #define M_DDR 1 38 - #define M_LOCK_CTRL (1 << 2) 39 - #define M_UNLOCK 0 40 - #define M_LOCK 1 41 - 42 - struct memory_timings { 43 - u32 m_type; /* ddr = 1, sdr = 0 */ 44 - u32 dll_mode; /* use lock mode = 1, unlock mode = 0 */ 45 - u32 slow_dll_ctrl; /* unlock mode, dll value for slow speed */ 46 - u32 fast_dll_ctrl; /* unlock mode, dll value for fast speed */ 47 - u32 base_cs; /* base chip select to use for calculations */ 48 - }; 49 - 50 /* Key dividers which make up a PRCM set. Ratio's for a PRCM are mandated. 51 * xtal_speed, dpll_speed, mpu_speed, CM_CLKSEL_MPU,CM_CLKSEL_DSP 52 * CM_CLKSEL_GFX, CM_CLKSEL1_CORE, CM_CLKSEL1_PLL CM_CLKSEL2_PLL, CM_CLKSEL_MDM ··· 715 .enable_bit = 15, 716 .rate_offset = 11, 717 .recalc = &omap2_clksel_recalc, 718 }; 719 720 /* ··· 1698 }; 1699 1700 static struct clk i2c2_ick = { 1701 - .name = "i2c2_ick", 1702 .parent = &l4_ck, 1703 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, 1704 .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE, ··· 1708 }; 1709 1710 static struct clk i2c2_fck = { 1711 - .name = "i2c2_fck", 1712 .parent = &func_12m_ck, 1713 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, 1714 .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE, ··· 1727 }; 1728 1729 static struct clk i2c1_ick = { 1730 - .name = "i2c1_ick", 1731 .parent = &l4_ck, 1732 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, 1733 .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE, ··· 1737 }; 1738 1739 static struct clk i2c1_fck = { 1740 - .name = "i2c1_fck", 1741 .parent = &func_12m_ck, 1742 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, 1743 .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE, ··· 1971 &wdt1_osc_ck, 1972 &sys_clkout, 1973 &sys_clkout2, 1974 /* mpu domain clocks */ 1975 &mpu_ck, 1976 /* dsp domain clocks */
··· 33 #define RATE_IN_242X (1 << 0) 34 #define RATE_IN_243X (1 << 1) 35 36 /* Key dividers which make up a PRCM set. Ratio's for a PRCM are mandated. 37 * xtal_speed, dpll_speed, mpu_speed, CM_CLKSEL_MPU,CM_CLKSEL_DSP 38 * CM_CLKSEL_GFX, CM_CLKSEL1_CORE, CM_CLKSEL1_PLL CM_CLKSEL2_PLL, CM_CLKSEL_MDM ··· 729 .enable_bit = 15, 730 .rate_offset = 11, 731 .recalc = &omap2_clksel_recalc, 732 + }; 733 + 734 + static struct clk emul_ck = { 735 + .name = "emul_ck", 736 + .parent = &func_54m_ck, 737 + .flags = CLOCK_IN_OMAP242X, 738 + .enable_reg = (void __iomem *)&PRCM_CLKEMUL_CTRL, 739 + .enable_bit = 0, 740 + .recalc = &omap2_propagate_rate, 741 + 742 }; 743 744 /* ··· 1702 }; 1703 1704 static struct clk i2c2_ick = { 1705 + .name = "i2c_ick", 1706 + .id = 2, 1707 .parent = &l4_ck, 1708 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, 1709 .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE, ··· 1711 }; 1712 1713 static struct clk i2c2_fck = { 1714 + .name = "i2c_fck", 1715 + .id = 2, 1716 .parent = &func_12m_ck, 1717 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, 1718 .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE, ··· 1729 }; 1730 1731 static struct clk i2c1_ick = { 1732 + .name = "i2c_ick", 1733 + .id = 1, 1734 .parent = &l4_ck, 1735 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, 1736 .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE, ··· 1738 }; 1739 1740 static struct clk i2c1_fck = { 1741 + .name = "i2c_fck", 1742 + .id = 1, 1743 .parent = &func_12m_ck, 1744 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, 1745 .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE, ··· 1971 &wdt1_osc_ck, 1972 &sys_clkout, 1973 &sys_clkout2, 1974 + &emul_ck, 1975 /* mpu domain clocks */ 1976 &mpu_ck, 1977 /* dsp domain clocks */
+42
arch/arm/mach-omap2/devices.c
··· 74 75 #endif 76 77 /*-------------------------------------------------------------------------*/ 78 79 static int __init omap2_init_devices(void) ··· 123 * in alphabetical order so they're easier to sort through. 124 */ 125 omap_init_i2c(); 126 127 return 0; 128 }
··· 74 75 #endif 76 77 + #if defined(CONFIG_OMAP_STI) 78 + 79 + #define OMAP2_STI_BASE IO_ADDRESS(0x48068000) 80 + #define OMAP2_STI_CHANNEL_BASE 0x54000000 81 + #define OMAP2_STI_IRQ 4 82 + 83 + static struct resource sti_resources[] = { 84 + { 85 + .start = OMAP2_STI_BASE, 86 + .end = OMAP2_STI_BASE + 0x7ff, 87 + .flags = IORESOURCE_MEM, 88 + }, 89 + { 90 + .start = OMAP2_STI_CHANNEL_BASE, 91 + .end = OMAP2_STI_CHANNEL_BASE + SZ_64K - 1, 92 + .flags = IORESOURCE_MEM, 93 + }, 94 + { 95 + .start = OMAP2_STI_IRQ, 96 + .flags = IORESOURCE_IRQ, 97 + } 98 + }; 99 + 100 + static struct platform_device sti_device = { 101 + .name = "sti", 102 + .id = -1, 103 + .dev = { 104 + .release = omap_nop_release, 105 + }, 106 + .num_resources = ARRAY_SIZE(sti_resources), 107 + .resource = sti_resources, 108 + }; 109 + 110 + static inline void omap_init_sti(void) 111 + { 112 + platform_device_register(&sti_device); 113 + } 114 + #else 115 + static inline void omap_init_sti(void) {} 116 + #endif 117 + 118 /*-------------------------------------------------------------------------*/ 119 120 static int __init omap2_init_devices(void) ··· 82 * in alphabetical order so they're easier to sort through. 83 */ 84 omap_init_i2c(); 85 + omap_init_sti(); 86 87 return 0; 88 }
+19 -2
arch/arm/mach-omap2/io.c
··· 16 #include <linux/kernel.h> 17 #include <linux/init.h> 18 19 - #include <asm/mach/map.h> 20 #include <asm/io.h> 21 #include <asm/arch/mux.h> 22 23 extern void omap_sram_init(void); 24 extern int omap2_clk_init(void); ··· 47 } 48 }; 49 50 - void __init omap_map_common_io(void) 51 { 52 iotable_init(omap2_io_desc, ARRAY_SIZE(omap2_io_desc)); 53 omap2_check_revision(); 54 omap_sram_init(); 55 omap2_mux_init(); 56 omap2_clk_init(); 57 }
··· 16 #include <linux/kernel.h> 17 #include <linux/init.h> 18 19 + #include <asm/tlb.h> 20 #include <asm/io.h> 21 + 22 + #include <asm/mach/map.h> 23 + 24 #include <asm/arch/mux.h> 25 + #include <asm/arch/omapfb.h> 26 27 extern void omap_sram_init(void); 28 extern int omap2_clk_init(void); ··· 43 } 44 }; 45 46 + void __init omap2_map_common_io(void) 47 { 48 iotable_init(omap2_io_desc, ARRAY_SIZE(omap2_io_desc)); 49 + 50 + /* Normally devicemaps_init() would flush caches and tlb after 51 + * mdesc->map_io(), but we must also do it here because of the CPU 52 + * revision check below. 53 + */ 54 + local_flush_tlb_all(); 55 + flush_cache_all(); 56 + 57 omap2_check_revision(); 58 omap_sram_init(); 59 + omapfb_reserve_mem(); 60 + } 61 + 62 + void __init omap2_init_common_hw(void) 63 + { 64 omap2_mux_init(); 65 omap2_clk_init(); 66 }
+102
arch/arm/mach-omap2/memory.c
···
··· 1 + /* 2 + * linux/arch/arm/mach-omap2/memory.c 3 + * 4 + * Memory timing related functions for OMAP24XX 5 + * 6 + * Copyright (C) 2005 Texas Instruments Inc. 7 + * Richard Woodruff <r-woodruff2@ti.com> 8 + * 9 + * Copyright (C) 2005 Nokia Corporation 10 + * Tony Lindgren <tony@atomide.com> 11 + * 12 + * This program is free software; you can redistribute it and/or modify 13 + * it under the terms of the GNU General Public License version 2 as 14 + * published by the Free Software Foundation. 15 + */ 16 + 17 + #include <linux/config.h> 18 + #include <linux/module.h> 19 + #include <linux/kernel.h> 20 + #include <linux/device.h> 21 + #include <linux/list.h> 22 + #include <linux/errno.h> 23 + #include <linux/delay.h> 24 + #include <linux/clk.h> 25 + 26 + #include <asm/io.h> 27 + 28 + #include <asm/arch/clock.h> 29 + #include <asm/arch/sram.h> 30 + 31 + #include "prcm-regs.h" 32 + #include "memory.h" 33 + 34 + static struct memory_timings mem_timings; 35 + 36 + u32 omap2_memory_get_slow_dll_ctrl(void) 37 + { 38 + return mem_timings.slow_dll_ctrl; 39 + } 40 + 41 + u32 omap2_memory_get_fast_dll_ctrl(void) 42 + { 43 + return mem_timings.fast_dll_ctrl; 44 + } 45 + 46 + u32 omap2_memory_get_type(void) 47 + { 48 + return mem_timings.m_type; 49 + } 50 + 51 + void omap2_init_memory_params(u32 force_lock_to_unlock_mode) 52 + { 53 + unsigned long dll_cnt; 54 + u32 fast_dll = 0; 55 + 56 + mem_timings.m_type = !((SDRC_MR_0 & 0x3) == 0x1); /* DDR = 1, SDR = 0 */ 57 + 58 + /* 2422 es2.05 and beyond has a single SIP DDR instead of 2 like others. 59 + * In the case of 2422, its ok to use CS1 instead of CS0. 60 + */ 61 + if (cpu_is_omap2422()) 62 + mem_timings.base_cs = 1; 63 + else 64 + mem_timings.base_cs = 0; 65 + 66 + if (mem_timings.m_type != M_DDR) 67 + return; 68 + 69 + /* With DDR we need to determine the low frequency DLL value */ 70 + if (((mem_timings.fast_dll_ctrl & (1 << 2)) == M_LOCK_CTRL)) 71 + mem_timings.dll_mode = M_UNLOCK; 72 + else 73 + mem_timings.dll_mode = M_LOCK; 74 + 75 + if (mem_timings.base_cs == 0) { 76 + fast_dll = SDRC_DLLA_CTRL; 77 + dll_cnt = SDRC_DLLA_STATUS & 0xff00; 78 + } else { 79 + fast_dll = SDRC_DLLB_CTRL; 80 + dll_cnt = SDRC_DLLB_STATUS & 0xff00; 81 + } 82 + if (force_lock_to_unlock_mode) { 83 + fast_dll &= ~0xff00; 84 + fast_dll |= dll_cnt; /* Current lock mode */ 85 + } 86 + /* set fast timings with DLL filter disabled */ 87 + mem_timings.fast_dll_ctrl = (fast_dll | (3 << 8)); 88 + 89 + /* No disruptions, DDR will be offline & C-ABI not followed */ 90 + omap2_sram_ddr_init(&mem_timings.slow_dll_ctrl, 91 + mem_timings.fast_dll_ctrl, 92 + mem_timings.base_cs, 93 + force_lock_to_unlock_mode); 94 + mem_timings.slow_dll_ctrl &= 0xff00; /* Keep lock value */ 95 + 96 + /* Turn status into unlock ctrl */ 97 + mem_timings.slow_dll_ctrl |= 98 + ((mem_timings.fast_dll_ctrl & 0xF) | (1 << 2)); 99 + 100 + /* 90 degree phase for anything below 133Mhz + disable DLL filter */ 101 + mem_timings.slow_dll_ctrl |= ((1 << 1) | (3 << 8)); 102 + }
+34
arch/arm/mach-omap2/memory.h
···
··· 1 + /* 2 + * linux/arch/arm/mach-omap2/memory.h 3 + * 4 + * Interface for memory timing related functions for OMAP24XX 5 + * 6 + * Copyright (C) 2005 Texas Instruments Inc. 7 + * Richard Woodruff <r-woodruff2@ti.com> 8 + * 9 + * Copyright (C) 2005 Nokia Corporation 10 + * Tony Lindgren <tony@atomide.com> 11 + * 12 + * This program is free software; you can redistribute it and/or modify 13 + * it under the terms of the GNU General Public License version 2 as 14 + * published by the Free Software Foundation. 15 + */ 16 + 17 + /* Memory timings */ 18 + #define M_DDR 1 19 + #define M_LOCK_CTRL (1 << 2) 20 + #define M_UNLOCK 0 21 + #define M_LOCK 1 22 + 23 + struct memory_timings { 24 + u32 m_type; /* ddr = 1, sdr = 0 */ 25 + u32 dll_mode; /* use lock mode = 1, unlock mode = 0 */ 26 + u32 slow_dll_ctrl; /* unlock mode, dll value for slow speed */ 27 + u32 fast_dll_ctrl; /* unlock mode, dll value for fast speed */ 28 + u32 base_cs; /* base chip select to use for calculations */ 29 + }; 30 + 31 + extern void omap2_init_memory_params(u32 force_lock_to_unlock_mode); 32 + extern u32 omap2_memory_get_slow_dll_ctrl(void); 33 + extern u32 omap2_memory_get_fast_dll_ctrl(void); 34 + extern u32 omap2_memory_get_type(void);
+45
arch/arm/mach-omap2/mux.c
··· 50 /* Menelaus interrupt */ 51 MUX_CFG_24XX("W19_24XX_SYS_NIRQ", 0x12c, 0, 1, 1, 1) 52 53 /* 24xx GPIO */ 54 MUX_CFG_24XX("Y20_24XX_GPIO60", 0x12c, 3, 0, 0, 1) 55 MUX_CFG_24XX("M15_24XX_GPIO92", 0x10a, 3, 0, 0, 1) 56 57 }; 58
··· 50 /* Menelaus interrupt */ 51 MUX_CFG_24XX("W19_24XX_SYS_NIRQ", 0x12c, 0, 1, 1, 1) 52 53 + /* 24xx clocks */ 54 + MUX_CFG_24XX("W14_24XX_SYS_CLKOUT", 0x137, 0, 1, 1, 1) 55 + 56 + /* 24xx McBSP */ 57 + MUX_CFG_24XX("Y15_24XX_MCBSP2_CLKX", 0x124, 1, 1, 0, 1) 58 + MUX_CFG_24XX("R14_24XX_MCBSP2_FSX", 0x125, 1, 1, 0, 1) 59 + MUX_CFG_24XX("W15_24XX_MCBSP2_DR", 0x126, 1, 1, 0, 1) 60 + MUX_CFG_24XX("V15_24XX_MCBSP2_DX", 0x127, 1, 1, 0, 1) 61 + 62 /* 24xx GPIO */ 63 + MUX_CFG_24XX("M21_242X_GPIO11", 0x0c9, 3, 1, 1, 1) 64 + MUX_CFG_24XX("AA10_242X_GPIO13", 0x0e5, 3, 0, 0, 1) 65 + MUX_CFG_24XX("AA6_242X_GPIO14", 0x0e6, 3, 0, 0, 1) 66 + MUX_CFG_24XX("AA4_242X_GPIO15", 0x0e7, 3, 0, 0, 1) 67 + MUX_CFG_24XX("Y11_242X_GPIO16", 0x0e8, 3, 0, 0, 1) 68 + MUX_CFG_24XX("AA12_242X_GPIO17", 0x0e9, 3, 0, 0, 1) 69 + MUX_CFG_24XX("AA8_242X_GPIO58", 0x0ea, 3, 0, 0, 1) 70 MUX_CFG_24XX("Y20_24XX_GPIO60", 0x12c, 3, 0, 0, 1) 71 + MUX_CFG_24XX("W4__24XX_GPIO74", 0x0f2, 3, 0, 0, 1) 72 MUX_CFG_24XX("M15_24XX_GPIO92", 0x10a, 3, 0, 0, 1) 73 + MUX_CFG_24XX("V14_24XX_GPIO117", 0x128, 3, 1, 0, 1) 74 + 75 + /* TSC IRQ */ 76 + MUX_CFG_24XX("P20_24XX_TSC_IRQ", 0x108, 0, 0, 0, 1) 77 + 78 + /* UART3 */ 79 + MUX_CFG_24XX("K15_24XX_UART3_TX", 0x118, 0, 0, 0, 1) 80 + MUX_CFG_24XX("K14_24XX_UART3_RX", 0x119, 0, 0, 0, 1) 81 + 82 + /* Keypad GPIO*/ 83 + MUX_CFG_24XX("T19_24XX_KBR0", 0x106, 3, 1, 1, 1) 84 + MUX_CFG_24XX("R19_24XX_KBR1", 0x107, 3, 1, 1, 1) 85 + MUX_CFG_24XX("V18_24XX_KBR2", 0x139, 3, 1, 1, 1) 86 + MUX_CFG_24XX("M21_24XX_KBR3", 0xc9, 3, 1, 1, 1) 87 + MUX_CFG_24XX("E5__24XX_KBR4", 0x138, 3, 1, 1, 1) 88 + MUX_CFG_24XX("M18_24XX_KBR5", 0x10e, 3, 1, 1, 1) 89 + MUX_CFG_24XX("R20_24XX_KBC0", 0x108, 3, 0, 0, 1) 90 + MUX_CFG_24XX("M14_24XX_KBC1", 0x109, 3, 0, 0, 1) 91 + MUX_CFG_24XX("H19_24XX_KBC2", 0x114, 3, 0, 0, 1) 92 + MUX_CFG_24XX("V17_24XX_KBC3", 0x135, 3, 0, 0, 1) 93 + MUX_CFG_24XX("P21_24XX_KBC4", 0xca, 3, 0, 0, 1) 94 + MUX_CFG_24XX("L14_24XX_KBC5", 0x10f, 3, 0, 0, 1) 95 + MUX_CFG_24XX("N19_24XX_KBC6", 0x110, 3, 0, 0, 1) 96 + 97 + /* 24xx Menelaus Keypad GPIO */ 98 + MUX_CFG_24XX("B3__24XX_KBR5", 0x30, 3, 1, 1, 1) 99 + MUX_CFG_24XX("AA4_24XX_KBC2", 0xe7, 3, 0, 0, 1) 100 + MUX_CFG_24XX("B13_24XX_KBC6", 0x110, 3, 0, 0, 1) 101 102 }; 103
+149
arch/arm/mach-omap2/pm.c
···
··· 1 + /* 2 + * linux/arch/arm/mach-omap2/pm.c 3 + * 4 + * OMAP2 Power Management Routines 5 + * 6 + * Copyright (C) 2006 Nokia Corporation 7 + * Tony Lindgren <tony@atomide.com> 8 + * 9 + * Copyright (C) 2005 Texas Instruments, Inc. 10 + * Richard Woodruff <r-woodruff2@ti.com> 11 + * 12 + * Based on pm.c for omap1 13 + * 14 + * This program is free software; you can redistribute it and/or modify 15 + * it under the terms of the GNU General Public License version 2 as 16 + * published by the Free Software Foundation. 17 + */ 18 + 19 + #include <linux/pm.h> 20 + #include <linux/sched.h> 21 + #include <linux/proc_fs.h> 22 + #include <linux/pm.h> 23 + #include <linux/interrupt.h> 24 + #include <linux/sysfs.h> 25 + #include <linux/module.h> 26 + 27 + #include <asm/io.h> 28 + #include <asm/irq.h> 29 + #include <asm/atomic.h> 30 + #include <asm/mach/time.h> 31 + #include <asm/mach/irq.h> 32 + #include <asm/mach-types.h> 33 + 34 + #include <asm/arch/irqs.h> 35 + #include <asm/arch/clock.h> 36 + #include <asm/arch/sram.h> 37 + #include <asm/arch/pm.h> 38 + 39 + static struct clk *vclk; 40 + static void (*omap2_sram_idle)(void); 41 + static void (*omap2_sram_suspend)(int dllctrl, int cpu_rev); 42 + static void (*saved_idle)(void); 43 + 44 + void omap2_pm_idle(void) 45 + { 46 + local_irq_disable(); 47 + local_fiq_disable(); 48 + if (need_resched()) { 49 + local_fiq_enable(); 50 + local_irq_enable(); 51 + return; 52 + } 53 + 54 + /* 55 + * Since an interrupt may set up a timer, we don't want to 56 + * reprogram the hardware timer with interrupts enabled. 57 + * Re-enable interrupts only after returning from idle. 58 + */ 59 + timer_dyn_reprogram(); 60 + 61 + omap2_sram_idle(); 62 + local_fiq_enable(); 63 + local_irq_enable(); 64 + } 65 + 66 + static int omap2_pm_prepare(suspend_state_t state) 67 + { 68 + int error = 0; 69 + 70 + /* We cannot sleep in idle until we have resumed */ 71 + saved_idle = pm_idle; 72 + pm_idle = NULL; 73 + 74 + switch (state) 75 + { 76 + case PM_SUSPEND_STANDBY: 77 + case PM_SUSPEND_MEM: 78 + break; 79 + 80 + case PM_SUSPEND_DISK: 81 + return -ENOTSUPP; 82 + 83 + default: 84 + return -EINVAL; 85 + } 86 + 87 + return error; 88 + } 89 + 90 + static int omap2_pm_enter(suspend_state_t state) 91 + { 92 + switch (state) 93 + { 94 + case PM_SUSPEND_STANDBY: 95 + case PM_SUSPEND_MEM: 96 + /* FIXME: Add suspend */ 97 + break; 98 + 99 + case PM_SUSPEND_DISK: 100 + return -ENOTSUPP; 101 + 102 + default: 103 + return -EINVAL; 104 + } 105 + 106 + return 0; 107 + } 108 + 109 + static int omap2_pm_finish(suspend_state_t state) 110 + { 111 + pm_idle = saved_idle; 112 + return 0; 113 + } 114 + 115 + static struct pm_ops omap_pm_ops = { 116 + .pm_disk_mode = 0, 117 + .prepare = omap2_pm_prepare, 118 + .enter = omap2_pm_enter, 119 + .finish = omap2_pm_finish, 120 + }; 121 + 122 + int __init omap2_pm_init(void) 123 + { 124 + printk("Power Management for TI OMAP.\n"); 125 + 126 + vclk = clk_get(NULL, "virt_prcm_set"); 127 + if (IS_ERR(vclk)) { 128 + printk(KERN_ERR "Could not get PM vclk\n"); 129 + return -ENODEV; 130 + } 131 + 132 + /* 133 + * We copy the assembler sleep/wakeup routines to SRAM. 134 + * These routines need to be in SRAM as that's the only 135 + * memory the MPU can see when it wakes up. 136 + */ 137 + omap2_sram_idle = omap_sram_push(omap24xx_idle_loop_suspend, 138 + omap24xx_idle_loop_suspend_sz); 139 + 140 + omap2_sram_suspend = omap_sram_push(omap24xx_cpu_suspend, 141 + omap24xx_cpu_suspend_sz); 142 + 143 + pm_set_ops(&omap_pm_ops); 144 + pm_idle = omap2_pm_idle; 145 + 146 + return 0; 147 + } 148 + 149 + __initcall(omap2_pm_init);
+40
arch/arm/mach-omap2/prcm.c
···
··· 1 + /* 2 + * linux/arch/arm/mach-omap2/prcm.c 3 + * 4 + * OMAP 24xx Power Reset and Clock Management (PRCM) functions 5 + * 6 + * Copyright (C) 2005 Nokia Corporation 7 + * 8 + * Written by Tony Lindgren <tony.lindgren@nokia.com> 9 + * 10 + * Some pieces of code Copyright (C) 2005 Texas Instruments, Inc. 11 + * 12 + * This program is free software; you can redistribute it and/or modify 13 + * it under the terms of the GNU General Public License version 2 as 14 + * published by the Free Software Foundation. 15 + */ 16 + #include <linux/config.h> 17 + #include <linux/module.h> 18 + #include <linux/init.h> 19 + #include <linux/clk.h> 20 + 21 + #include "prcm-regs.h" 22 + 23 + u32 omap_prcm_get_reset_sources(void) 24 + { 25 + return RM_RSTST_WKUP & 0x7f; 26 + } 27 + EXPORT_SYMBOL(omap_prcm_get_reset_sources); 28 + 29 + /* Resets clock rates and reboots the system. Only called from system.h */ 30 + void omap_prcm_arch_reset(char mode) 31 + { 32 + u32 rate; 33 + struct clk *vclk, *sclk; 34 + 35 + vclk = clk_get(NULL, "virt_prcm_set"); 36 + sclk = clk_get(NULL, "sys_ck"); 37 + rate = clk_get_rate(sclk); 38 + clk_set_rate(vclk, rate); /* go to bypass for OMAP limitation */ 39 + RM_RSTCTRL_WKUP |= 2; 40 + }
+123 -59
arch/arm/mach-omap2/prcm.h arch/arm/mach-omap2/prcm-regs.h
··· 1 /* 2 - * prcm.h - Access definations for use in OMAP24XX clock and power management 3 * 4 * Copyright (C) 2005 Texas Instruments, Inc. 5 * ··· 20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 */ 22 23 - #ifndef __ASM_ARM_ARCH_DPM_PRCM_H 24 - #define __ASM_ARM_ARCH_DPM_PRCM_H 25 26 /* SET_PERFORMANCE_LEVEL PARAMETERS */ 27 #define PRCM_HALF_SPEED 1 ··· 161 #define CM_FCLKEN_MDM PRCM_REG32(0xC00) 162 #define CM_ICLKEN_MDM PRCM_REG32(0xC10) 163 #define CM_IDLEST_MDM PRCM_REG32(0xC20) 164 #define CM_CLKSEL_MDM PRCM_REG32(0xC40) 165 166 - /* FIXME: Move to header for 2430 */ 167 - #define DISP_BASE (OMAP24XX_L4_IO_BASE+0x50000) 168 #define DISP_REG32(offset) __REG32(DISP_BASE + (offset)) 169 170 - #define GPMC_BASE (OMAP24XX_GPMC_BASE) 171 - #define GPMC_REG32(offset) __REG32(GPMC_BASE + (offset)) 172 173 - #define GPT1_BASE (OMAP24XX_GPT1) 174 #define GPT1_REG32(offset) __REG32(GPT1_BASE + (offset)) 175 176 /* Misc sysconfig */ 177 #define DISPC_SYSCONFIG DISP_REG32(0x410) 178 - #define SPI_BASE (OMAP24XX_L4_IO_BASE+0x98000) 179 #define MCSPI1_SYSCONFIG __REG32(SPI_BASE + 0x10) 180 - #define MCSPI2_SYSCONFIG __REG32(SPI_BASE+0x2000 + 0x10) 181 182 - //#define DSP_MMU_SYSCONFIG 0x5A000010 183 - #define CAMERA_MMU_SYSCONFIG __REG32(DISP_BASE+0x2C10) 184 - //#define IVA_MMU_SYSCONFIG 0x5D000010 185 - //#define DSP_DMA_SYSCONFIG 0x00FCC02C 186 - #define CAMERA_DMA_SYSCONFIG __REG32(DISP_BASE+0x282C) 187 - #define SYSTEM_DMA_SYSCONFIG __REG32(DISP_BASE+0x602C) 188 #define GPMC_SYSCONFIG GPMC_REG32(0x010) 189 - #define MAILBOXES_SYSCONFIG __REG32(OMAP24XX_L4_IO_BASE+0x94010) 190 - #define UART1_SYSCONFIG __REG32(OMAP24XX_L4_IO_BASE+0x6A054) 191 - #define UART2_SYSCONFIG __REG32(OMAP24XX_L4_IO_BASE+0x6C054) 192 - #define UART3_SYSCONFIG __REG32(OMAP24XX_L4_IO_BASE+0x6E054) 193 - //#define IVA_SYSCONFIG 0x5C060010 194 - #define SDRC_SYSCONFIG __REG32(OMAP24XX_SDRC_BASE+0x10) 195 - #define SMS_SYSCONFIG __REG32(OMAP24XX_SMS_BASE+0x10) 196 - #define SSI_SYSCONFIG __REG32(DISP_BASE+0x8010) 197 - //#define VLYNQ_SYSCONFIG 0x67FFFE10 198 199 /* rkw - good cannidates for PM_ to start what nm was trying */ 200 - #define OMAP24XX_GPT2 (OMAP24XX_L4_IO_BASE+0x2A000) 201 - #define OMAP24XX_GPT3 (OMAP24XX_L4_IO_BASE+0x78000) 202 - #define OMAP24XX_GPT4 (OMAP24XX_L4_IO_BASE+0x7A000) 203 - #define OMAP24XX_GPT5 (OMAP24XX_L4_IO_BASE+0x7C000) 204 - #define OMAP24XX_GPT6 (OMAP24XX_L4_IO_BASE+0x7E000) 205 - #define OMAP24XX_GPT7 (OMAP24XX_L4_IO_BASE+0x80000) 206 - #define OMAP24XX_GPT8 (OMAP24XX_L4_IO_BASE+0x82000) 207 - #define OMAP24XX_GPT9 (OMAP24XX_L4_IO_BASE+0x84000) 208 - #define OMAP24XX_GPT10 (OMAP24XX_L4_IO_BASE+0x86000) 209 - #define OMAP24XX_GPT11 (OMAP24XX_L4_IO_BASE+0x88000) 210 - #define OMAP24XX_GPT12 (OMAP24XX_L4_IO_BASE+0x8A000) 211 212 #define GPTIMER1_SYSCONFIG GPT1_REG32(0x010) 213 #define GPTIMER2_SYSCONFIG __REG32(OMAP24XX_GPT2 + 0x10) 214 #define GPTIMER3_SYSCONFIG __REG32(OMAP24XX_GPT3 + 0x10) ··· 231 #define GPTIMER11_SYSCONFIG __REG32(OMAP24XX_GPT11 + 0x10) 232 #define GPTIMER12_SYSCONFIG __REG32(OMAP24XX_GPT12 + 0x10) 233 234 - #define GPIOX_BASE(X) (OMAP24XX_GPIO_BASE+(0x2000*((X)-1))) 235 236 - #define GPIO1_SYSCONFIG __REG32((GPIOX_BASE(1)+0x10)) 237 - #define GPIO2_SYSCONFIG __REG32((GPIOX_BASE(2)+0x10)) 238 - #define GPIO3_SYSCONFIG __REG32((GPIOX_BASE(3)+0x10)) 239 - #define GPIO4_SYSCONFIG __REG32((GPIOX_BASE(4)+0x10)) 240 241 /* GP TIMER 1 */ 242 #define GPTIMER1_TISTAT GPT1_REG32(0x014) ··· 260 #define GPTIMER1_TCAR2 GPT1_REG32(0x044) 261 262 /* rkw -- base fix up please... */ 263 - #define GPTIMER3_TISR __REG32(OMAP24XX_L4_IO_BASE+0x78018) 264 265 /* SDRC */ 266 - #define SDRC_DLLA_CTRL __REG32(OMAP24XX_SDRC_BASE+0x060) 267 - #define SDRC_DLLA_STATUS __REG32(OMAP24XX_SDRC_BASE+0x064) 268 - #define SDRC_DLLB_CTRL __REG32(OMAP24XX_SDRC_BASE+0x068) 269 - #define SDRC_DLLB_STATUS __REG32(OMAP24XX_SDRC_BASE+0x06C) 270 - #define SDRC_POWER __REG32(OMAP24XX_SDRC_BASE+0x070) 271 - #define SDRC_MR_0 __REG32(OMAP24XX_SDRC_BASE+0x084) 272 273 /* GPIO 1 */ 274 #define GPIO1_BASE GPIOX_BASE(1) ··· 295 #define GPIO2_DATAIN GPIO2_REG32(0x038) 296 #define GPIO2_OE GPIO2_REG32(0x034) 297 #define GPIO2_DATAOUT GPIO2_REG32(0x03C) 298 299 /* GPIO 3 */ 300 #define GPIO3_BASE GPIOX_BASE(3) ··· 311 #define GPIO3_DATAIN GPIO3_REG32(0x038) 312 #define GPIO3_OE GPIO3_REG32(0x034) 313 #define GPIO3_DATAOUT GPIO3_REG32(0x03C) 314 #define GPIO3_DEBOUNCENABLE GPIO3_REG32(0x050) 315 #define GPIO3_DEBOUNCINGTIME GPIO3_REG32(0x054) 316 ··· 332 #define GPIO4_DEBOUNCENABLE GPIO4_REG32(0x050) 333 #define GPIO4_DEBOUNCINGTIME GPIO4_REG32(0x054) 334 335 336 /* IO CONFIG */ 337 - #define CONTROL_BASE (OMAP24XX_CTRL_BASE) 338 - #define CONTROL_REG32(offset) __REG32(CONTROL_BASE + (offset)) 339 340 #define CONTROL_PADCONF_SPI1_NCS2 CONTROL_REG32(0x104) 341 #define CONTROL_PADCONF_SYS_XTALOUT CONTROL_REG32(0x134) ··· 359 #define CONTROL_PADCONF_MCBSP1_DX CONTROL_REG32(0x10C) 360 #define CONTROL_PADCONF_GPMC_NCS4 CONTROL_REG32(0x090) 361 #define CONTROL_PADCONF_DSS_D5 CONTROL_REG32(0x0B8) 362 - #define CONTROL_PADCONF_DSS_D9 CONTROL_REG32(0x0BC) 363 #define CONTROL_PADCONF_DSS_D13 CONTROL_REG32(0x0C0) 364 #define CONTROL_PADCONF_DSS_VSYNC CONTROL_REG32(0x0CC) 365 366 /* CONTROL */ 367 #define CONTROL_DEVCONF CONTROL_REG32(0x274) 368 369 /* INTERRUPT CONTROLLER */ 370 - #define INTC_BASE (OMAP24XX_L4_IO_BASE+0xfe000) 371 #define INTC_REG32(offset) __REG32(INTC_BASE + (offset)) 372 373 #define INTC1_U_BASE INTC_REG32(0x000) ··· 388 #define INTC_ISR_CLEAR2 INTC_REG32(0x0D4) 389 #define INTC_SIR_IRQ INTC_REG32(0x040) 390 #define INTC_CONTROL INTC_REG32(0x048) 391 - #define INTC_ILR11 INTC_REG32(0x12C) 392 #define INTC_ILR32 INTC_REG32(0x180) 393 - #define INTC_ILR37 INTC_REG32(0x194) 394 - #define INTC_SYSCONFIG INTC_REG32(0x010) 395 396 /* RAM FIREWALL */ 397 #define RAMFW_BASE (0x68005000) ··· 414 #define GPMC_CONFIG5_0 GPMC_REG32(0x070) 415 #define GPMC_CONFIG6_0 GPMC_REG32(0x074) 416 #define GPMC_CONFIG7_0 GPMC_REG32(0x078) 417 418 /* DSS */ 419 #define DSS_CONTROL DISP_REG32(0x040) ··· 465 #define DISPC_DATA_CYCLE2 DISP_REG32(0x5D8) 466 #define DISPC_DATA_CYCLE3 DISP_REG32(0x5DC) 467 468 - /* Wake up define for board */ 469 - #define GPIO97 (1 << 1) 470 - #define GPIO88 (1 << 24) 471 472 - #endif /* __ASSEMBLER__ */ 473 474 #endif 475
··· 1 /* 2 + * linux/arch/arm/mach-omap2/prcm-reg.h 3 + * 4 + * OMAP24XX Power Reset and Clock Management (PRCM) registers 5 * 6 * Copyright (C) 2005 Texas Instruments, Inc. 7 * ··· 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 */ 20 21 + #ifndef __ARCH_ARM_MACH_OMAP2_PRCM_H 22 + #define __ARCH_ARM_MACH_OMAP2_PRCM_H 23 24 /* SET_PERFORMANCE_LEVEL PARAMETERS */ 25 #define PRCM_HALF_SPEED 1 ··· 159 #define CM_FCLKEN_MDM PRCM_REG32(0xC00) 160 #define CM_ICLKEN_MDM PRCM_REG32(0xC10) 161 #define CM_IDLEST_MDM PRCM_REG32(0xC20) 162 + #define CM_AUTOIDLE_MDM PRCM_REG32(0xC30) 163 #define CM_CLKSEL_MDM PRCM_REG32(0xC40) 164 + #define CM_CLKSTCTRL_MDM PRCM_REG32(0xC48) 165 + #define RM_RSTCTRL_MDM PRCM_REG32(0xC50) 166 + #define RM_RSTST_MDM PRCM_REG32(0xC58) 167 + #define PM_WKEN_MDM PRCM_REG32(0xCA0) 168 + #define PM_WKST_MDM PRCM_REG32(0xCB0) 169 + #define PM_WKDEP_MDM PRCM_REG32(0xCC8) 170 + #define PM_PWSTCTRL_MDM PRCM_REG32(0xCE0) 171 + #define PM_PWSTST_MDM PRCM_REG32(0xCE4) 172 173 + #define OMAP24XX_L4_IO_BASE 0x48000000 174 + 175 + #define DISP_BASE (OMAP24XX_L4_IO_BASE + 0x50000) 176 #define DISP_REG32(offset) __REG32(DISP_BASE + (offset)) 177 178 + #define OMAP24XX_GPMC_BASE (L3_24XX_BASE + 0xa000) 179 + #define GPMC_REG32(offset) __REG32(OMAP24XX_GPMC_BASE + (offset)) 180 181 + /* FIXME: Move these to timer code */ 182 + #define GPT1_BASE (0x48028000) 183 #define GPT1_REG32(offset) __REG32(GPT1_BASE + (offset)) 184 185 /* Misc sysconfig */ 186 #define DISPC_SYSCONFIG DISP_REG32(0x410) 187 + #define SPI_BASE (OMAP24XX_L4_IO_BASE + 0x98000) 188 #define MCSPI1_SYSCONFIG __REG32(SPI_BASE + 0x10) 189 + #define MCSPI2_SYSCONFIG __REG32(SPI_BASE + 0x2000 + 0x10) 190 + #define MCSPI3_SYSCONFIG __REG32(OMAP24XX_L4_IO_BASE + 0xb8010) 191 192 + #define CAMERA_MMU_SYSCONFIG __REG32(DISP_BASE + 0x2C10) 193 + #define CAMERA_DMA_SYSCONFIG __REG32(DISP_BASE + 0x282C) 194 + #define SYSTEM_DMA_SYSCONFIG __REG32(DISP_BASE + 0x602C) 195 #define GPMC_SYSCONFIG GPMC_REG32(0x010) 196 + #define MAILBOXES_SYSCONFIG __REG32(OMAP24XX_L4_IO_BASE + 0x94010) 197 + #define UART1_SYSCONFIG __REG32(OMAP24XX_L4_IO_BASE + 0x6A054) 198 + #define UART2_SYSCONFIG __REG32(OMAP24XX_L4_IO_BASE + 0x6C054) 199 + #define UART3_SYSCONFIG __REG32(OMAP24XX_L4_IO_BASE + 0x6E054) 200 + #define SDRC_SYSCONFIG __REG32(OMAP24XX_SDRC_BASE + 0x10) 201 + #define OMAP24XX_SMS_BASE (L3_24XX_BASE + 0x8000) 202 + #define SMS_SYSCONFIG __REG32(OMAP24XX_SMS_BASE + 0x10) 203 + #define SSI_SYSCONFIG __REG32(DISP_BASE + 0x8010) 204 205 /* rkw - good cannidates for PM_ to start what nm was trying */ 206 + #define OMAP24XX_GPT2 (OMAP24XX_L4_IO_BASE + 0x2A000) 207 + #define OMAP24XX_GPT3 (OMAP24XX_L4_IO_BASE + 0x78000) 208 + #define OMAP24XX_GPT4 (OMAP24XX_L4_IO_BASE + 0x7A000) 209 + #define OMAP24XX_GPT5 (OMAP24XX_L4_IO_BASE + 0x7C000) 210 + #define OMAP24XX_GPT6 (OMAP24XX_L4_IO_BASE + 0x7E000) 211 + #define OMAP24XX_GPT7 (OMAP24XX_L4_IO_BASE + 0x80000) 212 + #define OMAP24XX_GPT8 (OMAP24XX_L4_IO_BASE + 0x82000) 213 + #define OMAP24XX_GPT9 (OMAP24XX_L4_IO_BASE + 0x84000) 214 + #define OMAP24XX_GPT10 (OMAP24XX_L4_IO_BASE + 0x86000) 215 + #define OMAP24XX_GPT11 (OMAP24XX_L4_IO_BASE + 0x88000) 216 + #define OMAP24XX_GPT12 (OMAP24XX_L4_IO_BASE + 0x8A000) 217 218 + /* FIXME: Move these to timer code */ 219 #define GPTIMER1_SYSCONFIG GPT1_REG32(0x010) 220 #define GPTIMER2_SYSCONFIG __REG32(OMAP24XX_GPT2 + 0x10) 221 #define GPTIMER3_SYSCONFIG __REG32(OMAP24XX_GPT3 + 0x10) ··· 220 #define GPTIMER11_SYSCONFIG __REG32(OMAP24XX_GPT11 + 0x10) 221 #define GPTIMER12_SYSCONFIG __REG32(OMAP24XX_GPT12 + 0x10) 222 223 + /* FIXME: Move these to gpio code */ 224 + #define OMAP24XX_GPIO_BASE 0x48018000 225 + #define GPIOX_BASE(X) (OMAP24XX_GPIO_BASE + (0x2000 * ((X) - 1))) 226 227 + #define GPIO1_SYSCONFIG __REG32((GPIOX_BASE(1) + 0x10)) 228 + #define GPIO2_SYSCONFIG __REG32((GPIOX_BASE(2) + 0x10)) 229 + #define GPIO3_SYSCONFIG __REG32((GPIOX_BASE(3) + 0x10)) 230 + #define GPIO4_SYSCONFIG __REG32((GPIOX_BASE(4) + 0x10)) 231 + 232 + #if defined(CONFIG_ARCH_OMAP243X) 233 + #define GPIO5_SYSCONFIG __REG32((OMAP24XX_GPIO5_BASE + 0x10)) 234 + #endif 235 236 /* GP TIMER 1 */ 237 #define GPTIMER1_TISTAT GPT1_REG32(0x014) ··· 243 #define GPTIMER1_TCAR2 GPT1_REG32(0x044) 244 245 /* rkw -- base fix up please... */ 246 + #define GPTIMER3_TISR __REG32(OMAP24XX_L4_IO_BASE + 0x78018) 247 248 /* SDRC */ 249 + #define SDRC_DLLA_CTRL __REG32(OMAP24XX_SDRC_BASE + 0x060) 250 + #define SDRC_DLLA_STATUS __REG32(OMAP24XX_SDRC_BASE + 0x064) 251 + #define SDRC_DLLB_CTRL __REG32(OMAP24XX_SDRC_BASE + 0x068) 252 + #define SDRC_DLLB_STATUS __REG32(OMAP24XX_SDRC_BASE + 0x06C) 253 + #define SDRC_POWER __REG32(OMAP24XX_SDRC_BASE + 0x070) 254 + #define SDRC_MR_0 __REG32(OMAP24XX_SDRC_BASE + 0x084) 255 256 /* GPIO 1 */ 257 #define GPIO1_BASE GPIOX_BASE(1) ··· 278 #define GPIO2_DATAIN GPIO2_REG32(0x038) 279 #define GPIO2_OE GPIO2_REG32(0x034) 280 #define GPIO2_DATAOUT GPIO2_REG32(0x03C) 281 + #define GPIO2_DEBOUNCENABLE GPIO2_REG32(0x050) 282 + #define GPIO2_DEBOUNCINGTIME GPIO2_REG32(0x054) 283 284 /* GPIO 3 */ 285 #define GPIO3_BASE GPIOX_BASE(3) ··· 292 #define GPIO3_DATAIN GPIO3_REG32(0x038) 293 #define GPIO3_OE GPIO3_REG32(0x034) 294 #define GPIO3_DATAOUT GPIO3_REG32(0x03C) 295 + #define GPIO3_DEBOUNCENABLE GPIO3_REG32(0x050) 296 + #define GPIO3_DEBOUNCINGTIME GPIO3_REG32(0x054) 297 #define GPIO3_DEBOUNCENABLE GPIO3_REG32(0x050) 298 #define GPIO3_DEBOUNCINGTIME GPIO3_REG32(0x054) 299 ··· 311 #define GPIO4_DEBOUNCENABLE GPIO4_REG32(0x050) 312 #define GPIO4_DEBOUNCINGTIME GPIO4_REG32(0x054) 313 314 + #if defined(CONFIG_ARCH_OMAP243X) 315 + /* GPIO 5 */ 316 + #define GPIO5_REG32(offset) __REG32((OMAP24XX_GPIO5_BASE + (offset))) 317 + #define GPIO5_IRQENABLE1 GPIO5_REG32(0x01C) 318 + #define GPIO5_IRQSTATUS1 GPIO5_REG32(0x018) 319 + #define GPIO5_IRQENABLE2 GPIO5_REG32(0x02C) 320 + #define GPIO5_IRQSTATUS2 GPIO5_REG32(0x028) 321 + #define GPIO5_WAKEUPENABLE GPIO5_REG32(0x020) 322 + #define GPIO5_RISINGDETECT GPIO5_REG32(0x048) 323 + #define GPIO5_FALLINGDETECT GPIO5_REG32(0x04C) 324 + #define GPIO5_DATAIN GPIO5_REG32(0x038) 325 + #define GPIO5_OE GPIO5_REG32(0x034) 326 + #define GPIO5_DATAOUT GPIO5_REG32(0x03C) 327 + #define GPIO5_DEBOUNCENABLE GPIO5_REG32(0x050) 328 + #define GPIO5_DEBOUNCINGTIME GPIO5_REG32(0x054) 329 + #endif 330 331 /* IO CONFIG */ 332 + #define OMAP24XX_CTRL_BASE (L4_24XX_BASE) 333 + #define CONTROL_REG32(offset) __REG32(OMAP24XX_CTRL_BASE + (offset)) 334 335 #define CONTROL_PADCONF_SPI1_NCS2 CONTROL_REG32(0x104) 336 #define CONTROL_PADCONF_SYS_XTALOUT CONTROL_REG32(0x134) ··· 322 #define CONTROL_PADCONF_MCBSP1_DX CONTROL_REG32(0x10C) 323 #define CONTROL_PADCONF_GPMC_NCS4 CONTROL_REG32(0x090) 324 #define CONTROL_PADCONF_DSS_D5 CONTROL_REG32(0x0B8) 325 + #define CONTROL_PADCONF_DSS_D9 CONTROL_REG32(0x0BC) /* 2420 */ 326 #define CONTROL_PADCONF_DSS_D13 CONTROL_REG32(0x0C0) 327 #define CONTROL_PADCONF_DSS_VSYNC CONTROL_REG32(0x0CC) 328 + #define CONTROL_PADCONF_SYS_NIRQW0 CONTROL_REG32(0x0BC) /* 2430 */ 329 + #define CONTROL_PADCONF_SSI1_FLAG_TX CONTROL_REG32(0x108) /* 2430 */ 330 331 /* CONTROL */ 332 #define CONTROL_DEVCONF CONTROL_REG32(0x274) 333 + #define CONTROL_DEVCONF1 CONTROL_REG32(0x2E8) 334 335 /* INTERRUPT CONTROLLER */ 336 + #define INTC_BASE ((L4_24XX_BASE) + 0xfe000) 337 #define INTC_REG32(offset) __REG32(INTC_BASE + (offset)) 338 339 #define INTC1_U_BASE INTC_REG32(0x000) ··· 348 #define INTC_ISR_CLEAR2 INTC_REG32(0x0D4) 349 #define INTC_SIR_IRQ INTC_REG32(0x040) 350 #define INTC_CONTROL INTC_REG32(0x048) 351 + #define INTC_ILR11 INTC_REG32(0x12C) /* PRCM on MPU PIC */ 352 + #define INTC_ILR30 INTC_REG32(0x178) 353 + #define INTC_ILR31 INTC_REG32(0x17C) 354 #define INTC_ILR32 INTC_REG32(0x180) 355 + #define INTC_ILR37 INTC_REG32(0x194) /* GPIO4 on MPU PIC */ 356 + #define INTC_SYSCONFIG INTC_REG32(0x010) /* GPT1 on MPU PIC */ 357 358 /* RAM FIREWALL */ 359 #define RAMFW_BASE (0x68005000) ··· 372 #define GPMC_CONFIG5_0 GPMC_REG32(0x070) 373 #define GPMC_CONFIG6_0 GPMC_REG32(0x074) 374 #define GPMC_CONFIG7_0 GPMC_REG32(0x078) 375 + 376 + /* GPMC CS1 */ 377 + #define GPMC_CONFIG1_1 GPMC_REG32(0x090) 378 + #define GPMC_CONFIG2_1 GPMC_REG32(0x094) 379 + #define GPMC_CONFIG3_1 GPMC_REG32(0x098) 380 + #define GPMC_CONFIG4_1 GPMC_REG32(0x09C) 381 + #define GPMC_CONFIG5_1 GPMC_REG32(0x0a0) 382 + #define GPMC_CONFIG6_1 GPMC_REG32(0x0a4) 383 + #define GPMC_CONFIG7_1 GPMC_REG32(0x0a8) 384 + 385 + /* GPMC CS3 */ 386 + #define GPMC_CONFIG1_3 GPMC_REG32(0x0F0) 387 + #define GPMC_CONFIG2_3 GPMC_REG32(0x0F4) 388 + #define GPMC_CONFIG3_3 GPMC_REG32(0x0F8) 389 + #define GPMC_CONFIG4_3 GPMC_REG32(0x0FC) 390 + #define GPMC_CONFIG5_3 GPMC_REG32(0x100) 391 + #define GPMC_CONFIG6_3 GPMC_REG32(0x104) 392 + #define GPMC_CONFIG7_3 GPMC_REG32(0x108) 393 394 /* DSS */ 395 #define DSS_CONTROL DISP_REG32(0x040) ··· 405 #define DISPC_DATA_CYCLE2 DISP_REG32(0x5D8) 406 #define DISPC_DATA_CYCLE3 DISP_REG32(0x5DC) 407 408 + /* HSUSB Suspend */ 409 + #define HSUSB_CTRL __REG8(0x480AC001) 410 + #define USBOTG_POWER __REG32(0x480AC000) 411 412 + /* HS MMC */ 413 + #define MMCHS1_SYSCONFIG __REG32(0x4809C010) 414 + #define MMCHS2_SYSCONFIG __REG32(0x480b4010) 415 + 416 + #endif /* __ASSEMBLER__ */ 417 418 #endif 419
+144
arch/arm/mach-omap2/sleep.S
···
··· 1 + /* 2 + * linux/arch/arm/mach-omap2/sleep.S 3 + * 4 + * (C) Copyright 2004 5 + * Texas Instruments, <www.ti.com> 6 + * Richard Woodruff <r-woodruff2@ti.com> 7 + * 8 + * This program is free software; you can redistribute it and/or 9 + * modify it under the terms of the GNU General Public License as 10 + * published by the Free Software Foundation; either version 2 of 11 + * the License, or (at your option) any later version. 12 + * 13 + * This program is distributed in the hope that it will be useful, 14 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR /PURPOSE. See the 16 + * GNU General Public License for more details. 17 + * 18 + * You should have received a copy of the GNU General Public License 19 + * along with this program; if not, write to the Free Software 20 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 + * MA 02111-1307 USA 22 + */ 23 + 24 + #include <linux/config.h> 25 + #include <linux/linkage.h> 26 + #include <asm/assembler.h> 27 + #include <asm/arch/io.h> 28 + #include <asm/arch/pm.h> 29 + 30 + #define A_32KSYNC_CR_V IO_ADDRESS(OMAP_TIMER32K_BASE+0x10) 31 + #define A_PRCM_VOLTCTRL_V IO_ADDRESS(OMAP24XX_PRCM_BASE+0x50) 32 + #define A_PRCM_CLKCFG_CTRL_V IO_ADDRESS(OMAP24XX_PRCM_BASE+0x80) 33 + #define A_CM_CLKEN_PLL_V IO_ADDRESS(OMAP24XX_PRCM_BASE+0x500) 34 + #define A_CM_IDLEST_CKGEN_V IO_ADDRESS(OMAP24XX_PRCM_BASE+0x520) 35 + #define A_CM_CLKSEL1_PLL_V IO_ADDRESS(OMAP24XX_PRCM_BASE+0x540) 36 + #define A_CM_CLKSEL2_PLL_V IO_ADDRESS(OMAP24XX_PRCM_BASE+0x544) 37 + 38 + #define A_SDRC_DLLA_CTRL_V IO_ADDRESS(OMAP24XX_SDRC_BASE+0x60) 39 + #define A_SDRC_POWER_V IO_ADDRESS(OMAP24XX_SDRC_BASE+0x70) 40 + #define A_SDRC_RFR_CTRL_V IO_ADDRESS(OMAP24XX_SDRC_BASE+0xA4) 41 + #define A_SDRC0_V (0xC0000000) 42 + #define A_SDRC_MANUAL_V IO_ADDRESS(OMAP24XX_SDRC_BASE+0xA8) 43 + 44 + .text 45 + 46 + /* 47 + * Forces OMAP into idle state 48 + * 49 + * omap24xx_idle_loop_suspend() - This bit of code just executes the WFI 50 + * for normal idles. 51 + * 52 + * Note: This code get's copied to internal SRAM at boot. When the OMAP 53 + * wakes up it continues execution at the point it went to sleep. 54 + */ 55 + ENTRY(omap24xx_idle_loop_suspend) 56 + stmfd sp!, {r0, lr} @ save registers on stack 57 + mov r0, #0 @ clear for mcr setup 58 + mcr p15, 0, r0, c7, c0, 4 @ wait for interrupt 59 + ldmfd sp!, {r0, pc} @ restore regs and return 60 + 61 + ENTRY(omap24xx_idle_loop_suspend_sz) 62 + .word . - omap24xx_idle_loop_suspend 63 + 64 + /* 65 + * omap242x_cpu_suspend() - Forces OMAP into deep sleep state by completing 66 + * SDRC shutdown then ARM shutdown. Upon wake MPU is back on so just restore 67 + * SDRC. 68 + * 69 + * Input: 70 + * R0 : DLL ctrl value pre-Sleep 71 + * R1 : Processor+Revision 72 + * 2420: 0x21 = 242xES1, 0x26 = 242xES2.2 73 + * 2430: 0x31 = 2430ES1, 0x32 = 2430ES2 74 + * 75 + * The if the DPLL is going to AutoIdle. It seems like the DPLL may be back on 76 + * when we get called, but the DLL probably isn't. We will wait a bit more in 77 + * case the DPLL isn't quite there yet. The code will wait on DLL for DDR even 78 + * if in unlocked mode. 79 + * 80 + * For less than 242x-ES2.2 upon wake from a sleep mode where the external 81 + * oscillator was stopped, a timing bug exists where a non-stabilized 12MHz 82 + * clock can pass into the PRCM can cause problems at DSP and IVA. 83 + * To work around this the code will switch to the 32kHz source prior to sleep. 84 + * Post sleep we will shift back to using the DPLL. Apparently, 85 + * CM_IDLEST_CLKGEN does not reflect the full clock change so you need to wait 86 + * 3x12MHz + 3x32kHz clocks for a full switch. 87 + * 88 + * The DLL load value is not kept in RETENTION or OFF. It needs to be restored 89 + * at wake 90 + */ 91 + ENTRY(omap24xx_cpu_suspend) 92 + stmfd sp!, {r0 - r12, lr} @ save registers on stack 93 + mov r3, #0x0 @ clear for mrc call 94 + mcr p15, 0, r3, c7, c10, 4 @ memory barrier, hope SDR/DDR finished 95 + nop 96 + nop 97 + ldr r3, A_SDRC_POWER @ addr of sdrc power 98 + ldr r4, [r3] @ value of sdrc power 99 + orr r4, r4, #0x40 @ enable self refresh on idle req 100 + mov r5, #0x2000 @ set delay (DPLL relock + DLL relock) 101 + str r4, [r3] @ make it so 102 + mov r2, #0 103 + nop 104 + mcr p15, 0, r2, c7, c0, 4 @ wait for interrupt 105 + nop 106 + loop: 107 + subs r5, r5, #0x1 @ awake, wait just a bit 108 + bne loop 109 + 110 + /* The DPLL has on before we take the DDR out of self refresh */ 111 + bic r4, r4, #0x40 @ now clear self refresh bit. 112 + str r4, [r3] @ put vlaue back. 113 + ldr r4, A_SDRC0 @ make a clock happen 114 + ldr r4, [r4] 115 + nop @ start auto refresh only after clk ok 116 + movs r0, r0 @ see if DDR or SDR 117 + ldrne r1, A_SDRC_DLLA_CTRL_S @ get addr of DLL ctrl 118 + strne r0, [r1] @ rewrite DLLA to force DLL reload 119 + addne r1, r1, #0x8 @ move to DLLB 120 + strne r0, [r1] @ rewrite DLLB to force DLL reload 121 + 122 + mov r5, #0x1000 123 + loop2: 124 + subs r5, r5, #0x1 125 + bne loop2 126 + /* resume*/ 127 + ldmfd sp!, {r0 - r12, pc} @ restore regs and return 128 + 129 + A_SDRC_POWER: 130 + .word A_SDRC_POWER_V 131 + A_SDRC0: 132 + .word A_SDRC0_V 133 + A_CM_CLKSEL2_PLL_S: 134 + .word A_CM_CLKSEL2_PLL_V 135 + A_CM_CLKEN_PLL: 136 + .word A_CM_CLKEN_PLL_V 137 + A_SDRC_DLLA_CTRL_S: 138 + .word A_SDRC_DLLA_CTRL_V 139 + A_SDRC_MANUAL_S: 140 + .word A_SDRC_MANUAL_V 141 + 142 + ENTRY(omap24xx_cpu_suspend_sz) 143 + .word . - omap24xx_cpu_suspend 144 +
+2 -2
arch/arm/mach-omap2/sram-fn.S
··· 1 /* 2 - * linux/arch/arm/mach-omap1/sram.S 3 * 4 * Omap2 specific functions that need to be run in internal SRAM 5 * ··· 28 #include <asm/arch/io.h> 29 #include <asm/hardware.h> 30 31 - #include <asm/arch/prcm.h> 32 33 #define TIMER_32KSYNCT_CR_V IO_ADDRESS(OMAP24XX_32KSYNCT_BASE + 0x010) 34
··· 1 /* 2 + * linux/arch/arm/mach-omap2/sram.S 3 * 4 * Omap2 specific functions that need to be run in internal SRAM 5 * ··· 28 #include <asm/arch/io.h> 29 #include <asm/hardware.h> 30 31 + #include "prcm-regs.h" 32 33 #define TIMER_32KSYNCT_CR_V IO_ADDRESS(OMAP24XX_32KSYNCT_BASE + 0x010) 34
+4
arch/arm/mach-pxa/poodle.c
··· 307 struct tag *tags, char **cmdline, struct meminfo *mi) 308 { 309 sharpsl_save_param(); 310 } 311 312 MACHINE_START(POODLE, "SHARP Poodle")
··· 307 struct tag *tags, char **cmdline, struct meminfo *mi) 308 { 309 sharpsl_save_param(); 310 + mi->nr_banks=1; 311 + mi->bank[0].start = 0xa0000000; 312 + mi->bank[0].node = 0; 313 + mi->bank[0].size = (32*1024*1024); 314 } 315 316 MACHINE_START(POODLE, "SHARP Poodle")
+7
arch/arm/mach-s3c2410/Kconfig
··· 50 51 <http://zoo.weinigel.se/n30>. 52 53 config ARCH_SMDK2410 54 bool "SMDK2410/A9M2410" 55 select CPU_S3C2410 56 help 57 Say Y here if you are using the SMDK2410 or the derived module A9M2410 58 <http://www.fsforth.de> ··· 66 config ARCH_S3C2440 67 bool "SMDK2440" 68 select CPU_S3C2440 69 help 70 Say Y here if you are using the SMDK2440. 71
··· 50 51 <http://zoo.weinigel.se/n30>. 52 53 + config MACH_SMDK 54 + bool 55 + help 56 + Common machine code for SMDK2410 and SMDK2440 57 + 58 config ARCH_SMDK2410 59 bool "SMDK2410/A9M2410" 60 select CPU_S3C2410 61 + select MACH_SMDK 62 help 63 Say Y here if you are using the SMDK2410 or the derived module A9M2410 64 <http://www.fsforth.de> ··· 60 config ARCH_S3C2440 61 bool "SMDK2440" 62 select CPU_S3C2440 63 + select MACH_SMDK 64 help 65 Say Y here if you are using the SMDK2440. 66
+2
arch/arm/mach-s3c2410/Makefile
··· 48 obj-$(CONFIG_MACH_RX3715) += mach-rx3715.o 49 obj-$(CONFIG_MACH_OTOM) += mach-otom.o 50 obj-$(CONFIG_MACH_NEXCODER_2440) += mach-nexcoder.o
··· 48 obj-$(CONFIG_MACH_RX3715) += mach-rx3715.o 49 obj-$(CONFIG_MACH_OTOM) += mach-otom.o 50 obj-$(CONFIG_MACH_NEXCODER_2440) += mach-nexcoder.o 51 + 52 + obj-$(CONFIG_MACH_SMDK) += common-smdk.o
+1 -1
arch/arm/mach-s3c2410/clock.c
··· 249 250 /* if we started the UPLL, then allow to settle */ 251 252 - if (enable && !(orig & S3C2410_CLKSLOW_UCLK_OFF)) 253 udelay(200); 254 255 return 0;
··· 249 250 /* if we started the UPLL, then allow to settle */ 251 252 + if (enable && (orig & S3C2410_CLKSLOW_UCLK_OFF)) 253 udelay(200); 254 255 return 0;
+134
arch/arm/mach-s3c2410/common-smdk.c
···
··· 1 + /* linux/arch/arm/mach-s3c2410/common-smdk.c 2 + * 3 + * Copyright (c) 2006 Simtec Electronics 4 + * Ben Dooks <ben@simtec.co.uk> 5 + * 6 + * Common code for SMDK2410 and SMDK2440 boards 7 + * 8 + * http://www.fluff.org/ben/smdk2440/ 9 + * 10 + * This program is free software; you can redistribute it and/or modify 11 + * it under the terms of the GNU General Public License version 2 as 12 + * published by the Free Software Foundation. 13 + */ 14 + 15 + #include <linux/kernel.h> 16 + #include <linux/types.h> 17 + #include <linux/interrupt.h> 18 + #include <linux/list.h> 19 + #include <linux/timer.h> 20 + #include <linux/init.h> 21 + #include <linux/platform_device.h> 22 + 23 + #include <linux/mtd/mtd.h> 24 + #include <linux/mtd/nand.h> 25 + #include <linux/mtd/nand_ecc.h> 26 + #include <linux/mtd/partitions.h> 27 + 28 + #include <asm/mach/arch.h> 29 + #include <asm/mach/map.h> 30 + #include <asm/mach/irq.h> 31 + 32 + #include <asm/hardware.h> 33 + #include <asm/io.h> 34 + #include <asm/irq.h> 35 + 36 + #include <asm/arch/regs-gpio.h> 37 + 38 + #include <asm/arch/nand.h> 39 + 40 + #include "devs.h" 41 + #include "pm.h" 42 + 43 + /* NAND parititon from 2.4.18-swl5 */ 44 + 45 + static struct mtd_partition smdk_default_nand_part[] = { 46 + [0] = { 47 + .name = "Boot Agent", 48 + .size = SZ_16K, 49 + .offset = 0, 50 + }, 51 + [1] = { 52 + .name = "S3C2410 flash parition 1", 53 + .offset = 0, 54 + .size = SZ_2M, 55 + }, 56 + [2] = { 57 + .name = "S3C2410 flash partition 2", 58 + .offset = SZ_4M, 59 + .size = SZ_4M, 60 + }, 61 + [3] = { 62 + .name = "S3C2410 flash partition 3", 63 + .offset = SZ_8M, 64 + .size = SZ_2M, 65 + }, 66 + [4] = { 67 + .name = "S3C2410 flash partition 4", 68 + .offset = SZ_1M * 10, 69 + .size = SZ_4M, 70 + }, 71 + [5] = { 72 + .name = "S3C2410 flash partition 5", 73 + .offset = SZ_1M * 14, 74 + .size = SZ_1M * 10, 75 + }, 76 + [6] = { 77 + .name = "S3C2410 flash partition 6", 78 + .offset = SZ_1M * 24, 79 + .size = SZ_1M * 24, 80 + }, 81 + [7] = { 82 + .name = "S3C2410 flash partition 7", 83 + .offset = SZ_1M * 48, 84 + .size = SZ_16M, 85 + } 86 + }; 87 + 88 + static struct s3c2410_nand_set smdk_nand_sets[] = { 89 + [0] = { 90 + .name = "NAND", 91 + .nr_chips = 1, 92 + .nr_partitions = ARRAY_SIZE(smdk_default_nand_part), 93 + .partitions = smdk_default_nand_part, 94 + }, 95 + }; 96 + 97 + /* choose a set of timings which should suit most 512Mbit 98 + * chips and beyond. 99 + */ 100 + 101 + static struct s3c2410_platform_nand smdk_nand_info = { 102 + .tacls = 20, 103 + .twrph0 = 60, 104 + .twrph1 = 20, 105 + .nr_sets = ARRAY_SIZE(smdk_nand_sets), 106 + .sets = smdk_nand_sets, 107 + }; 108 + 109 + /* devices we initialise */ 110 + 111 + static struct platform_device __initdata *smdk_devs[] = { 112 + &s3c_device_nand, 113 + }; 114 + 115 + void __init smdk_machine_init(void) 116 + { 117 + /* Configure the LEDs (even if we have no LED support)*/ 118 + 119 + s3c2410_gpio_cfgpin(S3C2410_GPF4, S3C2410_GPF4_OUTP); 120 + s3c2410_gpio_cfgpin(S3C2410_GPF5, S3C2410_GPF5_OUTP); 121 + s3c2410_gpio_cfgpin(S3C2410_GPF6, S3C2410_GPF6_OUTP); 122 + s3c2410_gpio_cfgpin(S3C2410_GPF7, S3C2410_GPF7_OUTP); 123 + 124 + s3c2410_gpio_setpin(S3C2410_GPF4, 1); 125 + s3c2410_gpio_setpin(S3C2410_GPF5, 1); 126 + s3c2410_gpio_setpin(S3C2410_GPF6, 1); 127 + s3c2410_gpio_setpin(S3C2410_GPF7, 1); 128 + 129 + s3c_device_nand.dev.platform_data = &smdk_nand_info; 130 + 131 + platform_add_devices(smdk_devs, ARRAY_SIZE(smdk_devs)); 132 + 133 + s3c2410_pm_init(); 134 + }
+15
arch/arm/mach-s3c2410/common-smdk.h
···
··· 1 + /* linux/arch/arm/mach-s3c2410/common-smdk.h 2 + * 3 + * Copyright (c) 2006 Simtec Electronics 4 + * Ben Dooks <ben@simtec.co.uk> 5 + * 6 + * Common code for SMDK2410 and SMDK2440 boards 7 + * 8 + * http://www.fluff.org/ben/smdk2440/ 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 + extern void smdk_machine_init(void);
+2 -2
arch/arm/mach-s3c2410/mach-anubis.c
··· 232 233 static struct s3c2410_platform_nand anubis_nand_info = { 234 .tacls = 25, 235 - .twrph0 = 80, 236 - .twrph1 = 80, 237 .nr_sets = ARRAY_SIZE(anubis_nand_sets), 238 .sets = anubis_nand_sets, 239 .select_chip = anubis_nand_select,
··· 232 233 static struct s3c2410_platform_nand anubis_nand_info = { 234 .tacls = 25, 235 + .twrph0 = 55, 236 + .twrph1 = 40, 237 .nr_sets = ARRAY_SIZE(anubis_nand_sets), 238 .sets = anubis_nand_sets, 239 .select_chip = anubis_nand_select,
+35
arch/arm/mach-s3c2410/mach-rx3715.c
··· 32 #include <linux/serial_core.h> 33 #include <linux/serial.h> 34 35 #include <asm/mach/arch.h> 36 #include <asm/mach/map.h> 37 #include <asm/mach/irq.h> ··· 51 #include <asm/arch/regs-gpio.h> 52 #include <asm/arch/regs-lcd.h> 53 54 #include <asm/arch/fb.h> 55 56 #include "clock.h" ··· 176 }, 177 }; 178 179 static struct platform_device *rx3715_devices[] __initdata = { 180 &s3c_device_usb, 181 &s3c_device_lcd, 182 &s3c_device_wdt, 183 &s3c_device_i2c, 184 &s3c_device_iis, 185 }; 186 187 static struct s3c24xx_board rx3715_board __initdata = { ··· 218 219 static void __init rx3715_map_io(void) 220 { 221 s3c24xx_init_io(rx3715_iodesc, ARRAY_SIZE(rx3715_iodesc)); 222 s3c24xx_init_clocks(16934000); 223 s3c24xx_init_uarts(rx3715_uartcfgs, ARRAY_SIZE(rx3715_uartcfgs));
··· 32 #include <linux/serial_core.h> 33 #include <linux/serial.h> 34 35 + #include <linux/mtd/mtd.h> 36 + #include <linux/mtd/nand.h> 37 + #include <linux/mtd/nand_ecc.h> 38 + #include <linux/mtd/partitions.h> 39 + 40 #include <asm/mach/arch.h> 41 #include <asm/mach/map.h> 42 #include <asm/mach/irq.h> ··· 46 #include <asm/arch/regs-gpio.h> 47 #include <asm/arch/regs-lcd.h> 48 49 + #include <asm/arch/nand.h> 50 #include <asm/arch/fb.h> 51 52 #include "clock.h" ··· 170 }, 171 }; 172 173 + static struct mtd_partition rx3715_nand_part[] = { 174 + [0] = { 175 + .name = "Whole Flash", 176 + .offset = 0, 177 + .size = MTDPART_SIZ_FULL, 178 + .mask_flags = MTD_WRITEABLE, 179 + } 180 + }; 181 + 182 + static struct s3c2410_nand_set rx3715_nand_sets[] = { 183 + [0] = { 184 + .name = "Internal", 185 + .nr_chips = 1, 186 + .nr_partitions = ARRAY_SIZE(rx3715_nand_part), 187 + .partitions = rx3715_nand_part, 188 + }, 189 + }; 190 + 191 + static struct s3c2410_platform_nand rx3715_nand_info = { 192 + .tacls = 25, 193 + .twrph0 = 50, 194 + .twrph1 = 15, 195 + .nr_sets = ARRAY_SIZE(rx3715_nand_sets), 196 + .sets = rx3715_nand_sets, 197 + }; 198 + 199 static struct platform_device *rx3715_devices[] __initdata = { 200 &s3c_device_usb, 201 &s3c_device_lcd, 202 &s3c_device_wdt, 203 &s3c_device_i2c, 204 &s3c_device_iis, 205 + &s3c_device_nand, 206 }; 207 208 static struct s3c24xx_board rx3715_board __initdata = { ··· 185 186 static void __init rx3715_map_io(void) 187 { 188 + s3c_device_nand.dev.platform_data = &rx3715_nand_info; 189 + 190 s3c24xx_init_io(rx3715_iodesc, ARRAY_SIZE(rx3715_iodesc)); 191 s3c24xx_init_clocks(16934000); 192 s3c24xx_init_uarts(rx3715_uartcfgs, ARRAY_SIZE(rx3715_uartcfgs));
+6 -7
arch/arm/mach-s3c2410/mach-smdk2410.c
··· 28 * Ben Dooks <ben@simtec.co.uk> 29 * 30 * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA 31 - * 20-Sep-2005 BJD Added static to non-exported items 32 * 33 ***********************************************************************/ 34 ··· 54 55 #include "devs.h" 56 #include "cpu.h" 57 58 static struct map_desc smdk2410_iodesc[] __initdata = { 59 /* nothing here yet */ ··· 110 s3c24xx_set_board(&smdk2410_board); 111 } 112 113 - static void __init smdk2410_init_irq(void) 114 - { 115 - s3c24xx_init_irq(); 116 - } 117 - 118 MACHINE_START(SMDK2410, "SMDK2410") /* @TODO: request a new identifier and switch 119 * to SMDK2410 */ 120 /* Maintainer: Jonas Dietsche */ ··· 117 .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc, 118 .boot_params = S3C2410_SDRAM_PA + 0x100, 119 .map_io = smdk2410_map_io, 120 - .init_irq = smdk2410_init_irq, 121 .timer = &s3c24xx_timer, 122 MACHINE_END 123
··· 28 * Ben Dooks <ben@simtec.co.uk> 29 * 30 * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA 31 + * 20-Sep-2005 BJD Added static to non-exported items 32 + * 01-Apr-2006 BJD Moved init code to common smdk 33 * 34 ***********************************************************************/ 35 ··· 53 54 #include "devs.h" 55 #include "cpu.h" 56 + 57 + #include "common-smdk.h" 58 59 static struct map_desc smdk2410_iodesc[] __initdata = { 60 /* nothing here yet */ ··· 107 s3c24xx_set_board(&smdk2410_board); 108 } 109 110 MACHINE_START(SMDK2410, "SMDK2410") /* @TODO: request a new identifier and switch 111 * to SMDK2410 */ 112 /* Maintainer: Jonas Dietsche */ ··· 119 .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc, 120 .boot_params = S3C2410_SDRAM_PA + 0x100, 121 .map_io = smdk2410_map_io, 122 + .init_irq = s3c24xx_init_irq, 123 + .init_machine = smdk_machine_init, 124 .timer = &s3c24xx_timer, 125 MACHINE_END 126
+3 -14
arch/arm/mach-s3c2410/mach-smdk2440.c
··· 53 #include "clock.h" 54 #include "devs.h" 55 #include "cpu.h" 56 - #include "pm.h" 57 58 static struct map_desc smdk2440_iodesc[] __initdata = { 59 /* ISA IO Space map (memory space selected by A24) */ ··· 198 199 static void __init smdk2440_machine_init(void) 200 { 201 - /* Configure the LEDs (even if we have no LED support)*/ 202 - 203 - s3c2410_gpio_cfgpin(S3C2410_GPF4, S3C2410_GPF4_OUTP); 204 - s3c2410_gpio_cfgpin(S3C2410_GPF5, S3C2410_GPF5_OUTP); 205 - s3c2410_gpio_cfgpin(S3C2410_GPF6, S3C2410_GPF6_OUTP); 206 - s3c2410_gpio_cfgpin(S3C2410_GPF7, S3C2410_GPF7_OUTP); 207 - 208 - s3c2410_gpio_setpin(S3C2410_GPF4, 0); 209 - s3c2410_gpio_setpin(S3C2410_GPF5, 0); 210 - s3c2410_gpio_setpin(S3C2410_GPF6, 0); 211 - s3c2410_gpio_setpin(S3C2410_GPF7, 0); 212 - 213 s3c24xx_fb_set_platdata(&smdk2440_lcd_cfg); 214 215 - s3c2410_pm_init(); 216 } 217 218 MACHINE_START(S3C2440, "SMDK2440")
··· 53 #include "clock.h" 54 #include "devs.h" 55 #include "cpu.h" 56 + 57 + #include "common-smdk.h" 58 59 static struct map_desc smdk2440_iodesc[] __initdata = { 60 /* ISA IO Space map (memory space selected by A24) */ ··· 197 198 static void __init smdk2440_machine_init(void) 199 { 200 s3c24xx_fb_set_platdata(&smdk2440_lcd_cfg); 201 202 + smdk_machine_init(); 203 } 204 205 MACHINE_START(S3C2440, "SMDK2440")
+71 -1
arch/arm/mach-sa1100/collie.c
··· 11 * published by the Free Software Foundation. 12 * 13 * ChangeLog: 14 - * 03-06-2004 John Lenz <jelenz@wisc.edu> 15 * 06-04-2002 Chris Larson <kergoth@digitalnemesis.net> 16 * 04-16-2001 Lineo Japan,Inc. ... 17 */ ··· 88 .sclk_rate = 11981000, 89 }; 90 91 92 static struct sa1100_port_fns collie_port_fns __initdata = { 93 .set_mctrl = collie_uart_set_mctrl, 94 .get_mctrl = collie_uart_get_mctrl, 95 }; 96 97 98 static struct resource locomo_resources[] = { ··· 282 { 283 sa1100_map_io(); 284 iotable_init(collie_io_desc, ARRAY_SIZE(collie_io_desc)); 285 } 286 287 MACHINE_START(COLLIE, "Sharp-Collie")
··· 11 * published by the Free Software Foundation. 12 * 13 * ChangeLog: 14 + * 2006 Pavel Machek <pavel@suse.cz> 15 + * 03-06-2004 John Lenz <lenz@cs.wisc.edu> 16 * 06-04-2002 Chris Larson <kergoth@digitalnemesis.net> 17 * 04-16-2001 Lineo Japan,Inc. ... 18 */ ··· 87 .sclk_rate = 11981000, 88 }; 89 90 + #ifdef CONFIG_SHARP_LOCOMO 91 + /* 92 + * low-level UART features. 93 + */ 94 + static struct locomo_dev *uart_dev = NULL; 95 + 96 + static void collie_uart_set_mctrl(struct uart_port *port, u_int mctrl) 97 + { 98 + if (!uart_dev) return; 99 + 100 + if (mctrl & TIOCM_RTS) 101 + locomo_gpio_write(uart_dev, LOCOMO_GPIO_RTS, 0); 102 + else 103 + locomo_gpio_write(uart_dev, LOCOMO_GPIO_RTS, 1); 104 + 105 + if (mctrl & TIOCM_DTR) 106 + locomo_gpio_write(uart_dev, LOCOMO_GPIO_DTR, 0); 107 + else 108 + locomo_gpio_write(uart_dev, LOCOMO_GPIO_DTR, 1); 109 + } 110 + 111 + static u_int collie_uart_get_mctrl(struct uart_port *port) 112 + { 113 + int ret = TIOCM_CD; 114 + unsigned int r; 115 + if (!uart_dev) return ret; 116 + 117 + r = locomo_gpio_read_output(uart_dev, LOCOMO_GPIO_CTS & LOCOMO_GPIO_DSR); 118 + if (r & LOCOMO_GPIO_CTS) 119 + ret |= TIOCM_CTS; 120 + if (r & LOCOMO_GPIO_DSR) 121 + ret |= TIOCM_DSR; 122 + 123 + return ret; 124 + } 125 126 static struct sa1100_port_fns collie_port_fns __initdata = { 127 .set_mctrl = collie_uart_set_mctrl, 128 .get_mctrl = collie_uart_get_mctrl, 129 }; 130 + 131 + static int collie_uart_probe(struct locomo_dev *dev) 132 + { 133 + uart_dev = dev; 134 + return 0; 135 + } 136 + 137 + static int collie_uart_remove(struct locomo_dev *dev) 138 + { 139 + uart_dev = NULL; 140 + return 0; 141 + } 142 + 143 + static struct locomo_driver collie_uart_driver = { 144 + .drv = { 145 + .name = "collie_uart", 146 + }, 147 + .devid = LOCOMO_DEVID_UART, 148 + .probe = collie_uart_probe, 149 + .remove = collie_uart_remove, 150 + }; 151 + 152 + static int __init collie_uart_init(void) { 153 + return locomo_driver_register(&collie_uart_driver); 154 + } 155 + device_initcall(collie_uart_init); 156 + 157 + #endif 158 159 160 static struct resource locomo_resources[] = { ··· 218 { 219 sa1100_map_io(); 220 iotable_init(collie_io_desc, ARRAY_SIZE(collie_io_desc)); 221 + 222 + #ifdef CONFIG_SHARP_LOCOMO 223 + sa1100_register_uart_fns(&collie_port_fns); 224 + #endif 225 + sa1100_register_uart(0, 3); 226 + sa1100_register_uart(1, 1); 227 } 228 229 MACHINE_START(COLLIE, "Sharp-Collie")
+17
arch/arm/mm/consistent.c
··· 18 #include <linux/device.h> 19 #include <linux/dma-mapping.h> 20 21 #include <asm/cacheflush.h> 22 #include <asm/tlbflush.h> 23 #include <asm/sizes.h> ··· 273 void * 274 dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp) 275 { 276 return __dma_alloc(dev, size, handle, gfp, 277 pgprot_noncached(pgprot_kernel)); 278 } ··· 361 u32 off; 362 363 WARN_ON(irqs_disabled()); 364 365 size = PAGE_ALIGN(size); 366
··· 18 #include <linux/device.h> 19 #include <linux/dma-mapping.h> 20 21 + #include <asm/memory.h> 22 #include <asm/cacheflush.h> 23 #include <asm/tlbflush.h> 24 #include <asm/sizes.h> ··· 272 void * 273 dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp) 274 { 275 + if (arch_is_coherent()) { 276 + void *virt; 277 + 278 + virt = kmalloc(size, gfp); 279 + if (!virt) 280 + return NULL; 281 + *handle = virt_to_dma(dev, virt); 282 + 283 + return virt; 284 + } 285 + 286 return __dma_alloc(dev, size, handle, gfp, 287 pgprot_noncached(pgprot_kernel)); 288 } ··· 349 u32 off; 350 351 WARN_ON(irqs_disabled()); 352 + 353 + if (arch_is_coherent()) { 354 + kfree(cpu_addr); 355 + return; 356 + } 357 358 size = PAGE_ALIGN(size); 359
+11
arch/arm/mm/mm-armv.c
··· 389 kern_pgprot = user_pgprot = cp->pte; 390 391 /* 392 * ARMv6 and above have extended page tables. 393 */ 394 if (cpu_arch >= CPU_ARCH_ARMv6 && (cr & CR_XP)) {
··· 389 kern_pgprot = user_pgprot = cp->pte; 390 391 /* 392 + * Enable CPU-specific coherency if supported. 393 + * (Only available on XSC3 at the moment.) 394 + */ 395 + if (arch_is_coherent()) { 396 + if (cpu_is_xsc3()) { 397 + mem_types[MT_MEMORY].prot_sect |= PMD_SECT_S; 398 + mem_types[MT_MEMORY].prot_pte |= L_PTE_COHERENT; 399 + } 400 + } 401 + 402 + /* 403 * ARMv6 and above have extended page tables. 404 */ 405 if (cpu_arch >= CPU_ARCH_ARMv6 && (cr & CR_XP)) {
+1 -1
arch/arm/mm/proc-xsc3.S
··· 371 ENTRY(cpu_xsc3_set_pte) 372 str r1, [r0], #-2048 @ linux version 373 374 - bic r2, r1, #0xff0 375 orr r2, r2, #PTE_TYPE_EXT @ extended page 376 377 eor r3, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY
··· 371 ENTRY(cpu_xsc3_set_pte) 372 str r1, [r0], #-2048 @ linux version 373 374 + bic r2, r1, #0xdf0 @ Keep C, B, coherency bits 375 orr r2, r2, #PTE_TYPE_EXT @ extended page 376 377 eor r3, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY
+2 -2
arch/arm/plat-omap/Kconfig
··· 70 71 config OMAP_32K_TIMER 72 bool "Use 32KHz timer" 73 - depends on ARCH_OMAP16XX 74 help 75 Select this option if you want to enable the OMAP 32KHz timer. 76 This timer saves power compared to the OMAP_MPU_TIMER, and has 77 support for no tick during idle. The 32KHz timer provides less 78 intra-tick resolution than OMAP_MPU_TIMER. The 32KHz timer is 79 - currently only available for OMAP-16xx. 80 81 endchoice 82
··· 70 71 config OMAP_32K_TIMER 72 bool "Use 32KHz timer" 73 + depends on ARCH_OMAP16XX || ARCH_OMAP24XX 74 help 75 Select this option if you want to enable the OMAP 32KHz timer. 76 This timer saves power compared to the OMAP_MPU_TIMER, and has 77 support for no tick during idle. The 32KHz timer provides less 78 intra-tick resolution than OMAP_MPU_TIMER. The 32KHz timer is 79 + currently only available for OMAP16XX and 24XX. 80 81 endchoice 82
+3 -3
arch/arm/plat-omap/Makefile
··· 3 # 4 5 # Common support 6 - obj-y := common.o sram.o sram-fn.o clock.o devices.o dma.o mux.o gpio.o mcbsp.o usb.o 7 obj-m := 8 obj-n := 9 obj- := 10 11 # OCPI interconnect support for 1710, 1610 and 5912 12 obj-$(CONFIG_ARCH_OMAP16XX) += ocpi.o 13 14 - # Power Management 15 - obj-$(CONFIG_PM) += pm.o sleep.o 16 17 obj-$(CONFIG_CPU_FREQ) += cpu-omap.o 18 obj-$(CONFIG_OMAP_DM_TIMER) += dmtimer.o
··· 3 # 4 5 # Common support 6 + obj-y := common.o sram.o sram-fn.o clock.o devices.o dma.o mux.o gpio.o mcbsp.o usb.o fb.o 7 obj-m := 8 obj-n := 9 obj- := 10 11 + obj-$(CONFIG_OMAP_32K_TIMER) += timer32k.o 12 + 13 # OCPI interconnect support for 1710, 1610 and 5912 14 obj-$(CONFIG_ARCH_OMAP16XX) += ocpi.o 15 16 17 obj-$(CONFIG_CPU_FREQ) += cpu-omap.o 18 obj-$(CONFIG_OMAP_DM_TIMER) += dmtimer.o
+65 -2
arch/arm/plat-omap/clock.c
··· 21 #include <linux/string.h> 22 #include <linux/clk.h> 23 #include <linux/mutex.h> 24 25 #include <asm/io.h> 26 #include <asm/semaphore.h> ··· 38 * Standard clock functions defined in include/linux/clk.h 39 *-------------------------------------------------------------------------*/ 40 41 struct clk * clk_get(struct device *dev, const char *id) 42 { 43 struct clk *p, *clk = ERR_PTR(-ENOENT); 44 45 mutex_lock(&clocks_mutex); 46 list_for_each_entry(p, &clocks, node) { 47 if (strcmp(id, p->name) == 0 && try_module_get(p->owner)) { 48 clk = p; 49 break; 50 } 51 } 52 mutex_unlock(&clocks_mutex); 53 54 return clk; ··· 79 { 80 unsigned long flags; 81 int ret = 0; 82 83 spin_lock_irqsave(&clockfw_lock, flags); 84 if (arch_clock->clk_enable) ··· 96 { 97 unsigned long flags; 98 99 spin_lock_irqsave(&clockfw_lock, flags); 100 if (arch_clock->clk_disable) 101 arch_clock->clk_disable(clk); ··· 110 { 111 unsigned long flags; 112 int ret = 0; 113 114 spin_lock_irqsave(&clockfw_lock, flags); 115 ret = clk->usecount; ··· 126 { 127 unsigned long flags; 128 unsigned long ret = 0; 129 130 spin_lock_irqsave(&clockfw_lock, flags); 131 ret = clk->rate; ··· 154 unsigned long flags; 155 long ret = 0; 156 157 spin_lock_irqsave(&clockfw_lock, flags); 158 if (arch_clock->clk_round_rate) 159 ret = arch_clock->clk_round_rate(clk, rate); ··· 169 int clk_set_rate(struct clk *clk, unsigned long rate) 170 { 171 unsigned long flags; 172 - int ret = 0; 173 174 spin_lock_irqsave(&clockfw_lock, flags); 175 if (arch_clock->clk_set_rate) ··· 186 int clk_set_parent(struct clk *clk, struct clk *parent) 187 { 188 unsigned long flags; 189 - int ret = 0; 190 191 spin_lock_irqsave(&clockfw_lock, flags); 192 if (arch_clock->clk_set_parent) ··· 204 { 205 unsigned long flags; 206 struct clk * ret = NULL; 207 208 spin_lock_irqsave(&clockfw_lock, flags); 209 if (arch_clock->clk_get_parent) ··· 244 /* Used for clocks that always have same value as the parent clock */ 245 void followparent_recalc(struct clk *clk) 246 { 247 clk->rate = clk->parent->rate; 248 } 249 ··· 254 void propagate_rate(struct clk * tclk) 255 { 256 struct clk *clkp; 257 258 list_for_each_entry(clkp, &clocks, node) { 259 if (likely(clkp->parent != tclk)) ··· 268 269 int clk_register(struct clk *clk) 270 { 271 mutex_lock(&clocks_mutex); 272 list_add(&clk->node, &clocks); 273 if (clk->init) ··· 283 284 void clk_unregister(struct clk *clk) 285 { 286 mutex_lock(&clocks_mutex); 287 list_del(&clk->node); 288 mutex_unlock(&clocks_mutex); ··· 295 void clk_deny_idle(struct clk *clk) 296 { 297 unsigned long flags; 298 299 spin_lock_irqsave(&clockfw_lock, flags); 300 if (arch_clock->clk_deny_idle) ··· 309 void clk_allow_idle(struct clk *clk) 310 { 311 unsigned long flags; 312 313 spin_lock_irqsave(&clockfw_lock, flags); 314 if (arch_clock->clk_allow_idle)
··· 21 #include <linux/string.h> 22 #include <linux/clk.h> 23 #include <linux/mutex.h> 24 + #include <linux/platform_device.h> 25 26 #include <asm/io.h> 27 #include <asm/semaphore.h> ··· 37 * Standard clock functions defined in include/linux/clk.h 38 *-------------------------------------------------------------------------*/ 39 40 + /* 41 + * Returns a clock. Note that we first try to use device id on the bus 42 + * and clock name. If this fails, we try to use clock name only. 43 + */ 44 struct clk * clk_get(struct device *dev, const char *id) 45 { 46 struct clk *p, *clk = ERR_PTR(-ENOENT); 47 + int idno; 48 + 49 + if (dev == NULL || dev->bus != &platform_bus_type) 50 + idno = -1; 51 + else 52 + idno = to_platform_device(dev)->id; 53 54 mutex_lock(&clocks_mutex); 55 + 56 + list_for_each_entry(p, &clocks, node) { 57 + if (p->id == idno && 58 + strcmp(id, p->name) == 0 && try_module_get(p->owner)) { 59 + clk = p; 60 + break; 61 + } 62 + } 63 + 64 list_for_each_entry(p, &clocks, node) { 65 if (strcmp(id, p->name) == 0 && try_module_get(p->owner)) { 66 clk = p; 67 break; 68 } 69 } 70 + 71 mutex_unlock(&clocks_mutex); 72 73 return clk; ··· 58 { 59 unsigned long flags; 60 int ret = 0; 61 + 62 + if (clk == NULL || IS_ERR(clk)) 63 + return -EINVAL; 64 65 spin_lock_irqsave(&clockfw_lock, flags); 66 if (arch_clock->clk_enable) ··· 72 { 73 unsigned long flags; 74 75 + if (clk == NULL || IS_ERR(clk)) 76 + return; 77 + 78 spin_lock_irqsave(&clockfw_lock, flags); 79 if (arch_clock->clk_disable) 80 arch_clock->clk_disable(clk); ··· 83 { 84 unsigned long flags; 85 int ret = 0; 86 + 87 + if (clk == NULL || IS_ERR(clk)) 88 + return 0; 89 90 spin_lock_irqsave(&clockfw_lock, flags); 91 ret = clk->usecount; ··· 96 { 97 unsigned long flags; 98 unsigned long ret = 0; 99 + 100 + if (clk == NULL || IS_ERR(clk)) 101 + return 0; 102 103 spin_lock_irqsave(&clockfw_lock, flags); 104 ret = clk->rate; ··· 121 unsigned long flags; 122 long ret = 0; 123 124 + if (clk == NULL || IS_ERR(clk)) 125 + return ret; 126 + 127 spin_lock_irqsave(&clockfw_lock, flags); 128 if (arch_clock->clk_round_rate) 129 ret = arch_clock->clk_round_rate(clk, rate); ··· 133 int clk_set_rate(struct clk *clk, unsigned long rate) 134 { 135 unsigned long flags; 136 + int ret = -EINVAL; 137 + 138 + if (clk == NULL || IS_ERR(clk)) 139 + return ret; 140 141 spin_lock_irqsave(&clockfw_lock, flags); 142 if (arch_clock->clk_set_rate) ··· 147 int clk_set_parent(struct clk *clk, struct clk *parent) 148 { 149 unsigned long flags; 150 + int ret = -EINVAL; 151 + 152 + if (clk == NULL || IS_ERR(clk) || parent == NULL || IS_ERR(parent)) 153 + return ret; 154 155 spin_lock_irqsave(&clockfw_lock, flags); 156 if (arch_clock->clk_set_parent) ··· 162 { 163 unsigned long flags; 164 struct clk * ret = NULL; 165 + 166 + if (clk == NULL || IS_ERR(clk)) 167 + return ret; 168 169 spin_lock_irqsave(&clockfw_lock, flags); 170 if (arch_clock->clk_get_parent) ··· 199 /* Used for clocks that always have same value as the parent clock */ 200 void followparent_recalc(struct clk *clk) 201 { 202 + if (clk == NULL || IS_ERR(clk)) 203 + return; 204 + 205 clk->rate = clk->parent->rate; 206 } 207 ··· 206 void propagate_rate(struct clk * tclk) 207 { 208 struct clk *clkp; 209 + 210 + if (tclk == NULL || IS_ERR(tclk)) 211 + return; 212 213 list_for_each_entry(clkp, &clocks, node) { 214 if (likely(clkp->parent != tclk)) ··· 217 218 int clk_register(struct clk *clk) 219 { 220 + if (clk == NULL || IS_ERR(clk)) 221 + return -EINVAL; 222 + 223 mutex_lock(&clocks_mutex); 224 list_add(&clk->node, &clocks); 225 if (clk->init) ··· 229 230 void clk_unregister(struct clk *clk) 231 { 232 + if (clk == NULL || IS_ERR(clk)) 233 + return; 234 + 235 mutex_lock(&clocks_mutex); 236 list_del(&clk->node); 237 mutex_unlock(&clocks_mutex); ··· 238 void clk_deny_idle(struct clk *clk) 239 { 240 unsigned long flags; 241 + 242 + if (clk == NULL || IS_ERR(clk)) 243 + return; 244 245 spin_lock_irqsave(&clockfw_lock, flags); 246 if (arch_clock->clk_deny_idle) ··· 249 void clk_allow_idle(struct clk *clk) 250 { 251 unsigned long flags; 252 + 253 + if (clk == NULL || IS_ERR(clk)) 254 + return; 255 256 spin_lock_irqsave(&clockfw_lock, flags); 257 if (arch_clock->clk_allow_idle)
+108 -35
arch/arm/plat-omap/devices.c
··· 24 #include <asm/arch/board.h> 25 #include <asm/arch/mux.h> 26 #include <asm/arch/gpio.h> 27 28 29 void omap_nop_release(struct device *dev) ··· 96 97 #else 98 static inline void omap_init_i2c(void) {} 99 #endif 100 101 /*-------------------------------------------------------------------------*/ ··· 297 static inline void omap_init_mmc(void) {} 298 #endif 299 300 #if defined(CONFIG_OMAP_WATCHDOG) || defined(CONFIG_OMAP_WATCHDOG_MODULE) 301 302 #ifdef CONFIG_ARCH_OMAP24XX ··· 416 static inline void omap_init_rng(void) {} 417 #endif 418 419 - #if defined(CONFIG_FB_OMAP) || defined(CONFIG_FB_OMAP_MODULE) 420 - 421 - static struct omap_lcd_config omap_fb_conf; 422 - 423 - static u64 omap_fb_dma_mask = ~(u32)0; 424 - 425 - static struct platform_device omap_fb_device = { 426 - .name = "omapfb", 427 - .id = -1, 428 - .dev = { 429 - .release = omap_nop_release, 430 - .dma_mask = &omap_fb_dma_mask, 431 - .coherent_dma_mask = ~(u32)0, 432 - .platform_data = &omap_fb_conf, 433 - }, 434 - .num_resources = 0, 435 - }; 436 - 437 - static inline void omap_init_fb(void) 438 - { 439 - const struct omap_lcd_config *conf; 440 - 441 - conf = omap_get_config(OMAP_TAG_LCD, struct omap_lcd_config); 442 - if (conf != NULL) 443 - omap_fb_conf = *conf; 444 - platform_device_register(&omap_fb_device); 445 - } 446 - 447 - #else 448 - 449 - static inline void omap_init_fb(void) {} 450 - 451 - #endif 452 - 453 /* 454 * This gets called after board-specific INIT_MACHINE, and initializes most 455 * on-chip peripherals accessible on this board (except for few like USB): ··· 441 /* please keep these calls, and their implementations above, 442 * in alphabetical order so they're easier to sort through. 443 */ 444 - omap_init_fb(); 445 omap_init_i2c(); 446 omap_init_mmc(); 447 omap_init_wdt(); 448 omap_init_rng(); 449
··· 24 #include <asm/arch/board.h> 25 #include <asm/arch/mux.h> 26 #include <asm/arch/gpio.h> 27 + #include <asm/arch/menelaus.h> 28 29 30 void omap_nop_release(struct device *dev) ··· 95 96 #else 97 static inline void omap_init_i2c(void) {} 98 + #endif 99 + 100 + /*-------------------------------------------------------------------------*/ 101 + #if defined(CONFIG_KEYBOARD_OMAP) || defined(CONFIG_KEYBOARD_OMAP_MODULE) 102 + 103 + static void omap_init_kp(void) 104 + { 105 + if (machine_is_omap_h2() || machine_is_omap_h3()) { 106 + omap_cfg_reg(F18_1610_KBC0); 107 + omap_cfg_reg(D20_1610_KBC1); 108 + omap_cfg_reg(D19_1610_KBC2); 109 + omap_cfg_reg(E18_1610_KBC3); 110 + omap_cfg_reg(C21_1610_KBC4); 111 + 112 + omap_cfg_reg(G18_1610_KBR0); 113 + omap_cfg_reg(F19_1610_KBR1); 114 + omap_cfg_reg(H14_1610_KBR2); 115 + omap_cfg_reg(E20_1610_KBR3); 116 + omap_cfg_reg(E19_1610_KBR4); 117 + omap_cfg_reg(N19_1610_KBR5); 118 + } else if (machine_is_omap_perseus2()) { 119 + omap_cfg_reg(E2_730_KBR0); 120 + omap_cfg_reg(J7_730_KBR1); 121 + omap_cfg_reg(E1_730_KBR2); 122 + omap_cfg_reg(F3_730_KBR3); 123 + omap_cfg_reg(D2_730_KBR4); 124 + 125 + omap_cfg_reg(C2_730_KBC0); 126 + omap_cfg_reg(D3_730_KBC1); 127 + omap_cfg_reg(E4_730_KBC2); 128 + omap_cfg_reg(F4_730_KBC3); 129 + omap_cfg_reg(E3_730_KBC4); 130 + } else if (machine_is_omap_h4()) { 131 + omap_cfg_reg(T19_24XX_KBR0); 132 + omap_cfg_reg(R19_24XX_KBR1); 133 + omap_cfg_reg(V18_24XX_KBR2); 134 + omap_cfg_reg(M21_24XX_KBR3); 135 + omap_cfg_reg(E5__24XX_KBR4); 136 + if (omap_has_menelaus()) { 137 + omap_cfg_reg(B3__24XX_KBR5); 138 + omap_cfg_reg(AA4_24XX_KBC2); 139 + omap_cfg_reg(B13_24XX_KBC6); 140 + } else { 141 + omap_cfg_reg(M18_24XX_KBR5); 142 + omap_cfg_reg(H19_24XX_KBC2); 143 + omap_cfg_reg(N19_24XX_KBC6); 144 + } 145 + omap_cfg_reg(R20_24XX_KBC0); 146 + omap_cfg_reg(M14_24XX_KBC1); 147 + omap_cfg_reg(V17_24XX_KBC3); 148 + omap_cfg_reg(P21_24XX_KBC4); 149 + omap_cfg_reg(L14_24XX_KBC5); 150 + } 151 + } 152 + #else 153 + static inline void omap_init_kp(void) {} 154 #endif 155 156 /*-------------------------------------------------------------------------*/ ··· 240 static inline void omap_init_mmc(void) {} 241 #endif 242 243 + /*-------------------------------------------------------------------------*/ 244 + 245 + /* Numbering for the SPI-capable controllers when used for SPI: 246 + * spi = 1 247 + * uwire = 2 248 + * mmc1..2 = 3..4 249 + * mcbsp1..3 = 5..7 250 + */ 251 + 252 + #if defined(CONFIG_SPI_OMAP_UWIRE) || defined(CONFIG_SPI_OMAP_UWIRE_MODULE) 253 + 254 + #define OMAP_UWIRE_BASE 0xfffb3000 255 + 256 + static struct resource uwire_resources[] = { 257 + { 258 + .start = OMAP_UWIRE_BASE, 259 + .end = OMAP_UWIRE_BASE + 0x20, 260 + .flags = IORESOURCE_MEM, 261 + }, 262 + }; 263 + 264 + static struct platform_device omap_uwire_device = { 265 + .name = "omap_uwire", 266 + .id = -1, 267 + .dev = { 268 + .release = omap_nop_release, 269 + }, 270 + .num_resources = ARRAY_SIZE(uwire_resources), 271 + .resource = uwire_resources, 272 + }; 273 + 274 + static void omap_init_uwire(void) 275 + { 276 + /* FIXME define and use a boot tag; not all boards will be hooking 277 + * up devices to the microwire controller, and multi-board configs 278 + * mean that CONFIG_SPI_OMAP_UWIRE may be configured anyway... 279 + */ 280 + 281 + /* board-specific code must configure chipselects (only a few 282 + * are normally used) and SCLK/SDI/SDO (each has two choices). 283 + */ 284 + (void) platform_device_register(&omap_uwire_device); 285 + } 286 + #else 287 + static inline void omap_init_uwire(void) {} 288 + #endif 289 + 290 + /*-------------------------------------------------------------------------*/ 291 + 292 #if defined(CONFIG_OMAP_WATCHDOG) || defined(CONFIG_OMAP_WATCHDOG_MODULE) 293 294 #ifdef CONFIG_ARCH_OMAP24XX ··· 310 static inline void omap_init_rng(void) {} 311 #endif 312 313 /* 314 * This gets called after board-specific INIT_MACHINE, and initializes most 315 * on-chip peripherals accessible on this board (except for few like USB): ··· 369 /* please keep these calls, and their implementations above, 370 * in alphabetical order so they're easier to sort through. 371 */ 372 omap_init_i2c(); 373 + omap_init_kp(); 374 omap_init_mmc(); 375 + omap_init_uwire(); 376 omap_init_wdt(); 377 omap_init_rng(); 378
+6
arch/arm/plat-omap/dma.c
··· 1258 omap_writew(w, OMAP1610_DMA_LCD_CTRL); 1259 } 1260 1261 /*----------------------------------------------------------------------------*/ 1262 1263 static int __init omap_init_dma(void) ··· 1394 EXPORT_SYMBOL(omap_enable_lcd_dma); 1395 EXPORT_SYMBOL(omap_setup_lcd_dma); 1396 EXPORT_SYMBOL(omap_stop_lcd_dma); 1397 EXPORT_SYMBOL(omap_set_lcd_dma_b1); 1398 EXPORT_SYMBOL(omap_set_lcd_dma_single_transfer); 1399 EXPORT_SYMBOL(omap_set_lcd_dma_ext_controller);
··· 1258 omap_writew(w, OMAP1610_DMA_LCD_CTRL); 1259 } 1260 1261 + int omap_lcd_dma_ext_running(void) 1262 + { 1263 + return lcd_dma.ext_ctrl && lcd_dma.active; 1264 + } 1265 + 1266 /*----------------------------------------------------------------------------*/ 1267 1268 static int __init omap_init_dma(void) ··· 1389 EXPORT_SYMBOL(omap_enable_lcd_dma); 1390 EXPORT_SYMBOL(omap_setup_lcd_dma); 1391 EXPORT_SYMBOL(omap_stop_lcd_dma); 1392 + EXPORT_SYMBOL(omap_lcd_dma_ext_running); 1393 EXPORT_SYMBOL(omap_set_lcd_dma_b1); 1394 EXPORT_SYMBOL(omap_set_lcd_dma_single_transfer); 1395 EXPORT_SYMBOL(omap_set_lcd_dma_ext_controller);
+26
arch/arm/plat-omap/dmtimer.c
··· 97 } 98 99 100 void omap_dm_timer_set_source(struct omap_dm_timer *timer, int source) 101 { 102 int n = (timer - dm_timers) << 1;
··· 97 } 98 99 100 + /** 101 + * omap_dm_timer_modify_idlect_mask - Check if any running timers use ARMXOR 102 + * @inputmask: current value of idlect mask 103 + */ 104 + __u32 omap_dm_timer_modify_idlect_mask(__u32 inputmask) 105 + { 106 + int n; 107 + 108 + /* If ARMXOR cannot be idled this function call is unnecessary */ 109 + if (!(inputmask & (1 << 1))) 110 + return inputmask; 111 + 112 + /* If any active timer is using ARMXOR return modified mask */ 113 + for (n = 0; dm_timers[n].base; ++n) 114 + if (omap_dm_timer_read_reg(&dm_timers[n], OMAP_TIMER_CTRL_REG)& 115 + OMAP_TIMER_CTRL_ST) { 116 + if (((omap_readl(MOD_CONF_CTRL_1)>>(n*2)) & 0x03) == 0) 117 + inputmask &= ~(1 << 1); 118 + else 119 + inputmask &= ~(1 << 2); 120 + } 121 + 122 + return inputmask; 123 + } 124 + 125 + 126 void omap_dm_timer_set_source(struct omap_dm_timer *timer, int source) 127 { 128 int n = (timer - dm_timers) << 1;
+80
arch/arm/plat-omap/fb.c
···
··· 1 + #include <linux/config.h> 2 + #include <linux/module.h> 3 + #include <linux/kernel.h> 4 + #include <linux/init.h> 5 + #include <linux/platform_device.h> 6 + #include <linux/bootmem.h> 7 + 8 + #include <asm/hardware.h> 9 + #include <asm/io.h> 10 + #include <asm/mach-types.h> 11 + #include <asm/mach/map.h> 12 + 13 + #include <asm/arch/board.h> 14 + #include <asm/arch/sram.h> 15 + #include <asm/arch/omapfb.h> 16 + 17 + #if defined(CONFIG_FB_OMAP) || defined(CONFIG_FB_OMAP_MODULE) 18 + 19 + static struct omapfb_platform_data omapfb_config; 20 + 21 + static u64 omap_fb_dma_mask = ~(u32)0; 22 + 23 + static struct platform_device omap_fb_device = { 24 + .name = "omapfb", 25 + .id = -1, 26 + .dev = { 27 + .dma_mask = &omap_fb_dma_mask, 28 + .coherent_dma_mask = ~(u32)0, 29 + .platform_data = &omapfb_config, 30 + }, 31 + .num_resources = 0, 32 + }; 33 + 34 + /* called from map_io */ 35 + void omapfb_reserve_mem(void) 36 + { 37 + const struct omap_fbmem_config *fbmem_conf; 38 + 39 + omapfb_config.fbmem.fb_sram_start = omap_fb_sram_start; 40 + omapfb_config.fbmem.fb_sram_size = omap_fb_sram_size; 41 + 42 + fbmem_conf = omap_get_config(OMAP_TAG_FBMEM, struct omap_fbmem_config); 43 + 44 + if (fbmem_conf != NULL) { 45 + /* indicate that the bootloader already initialized the 46 + * fb device, so we'll skip that part in the fb driver 47 + */ 48 + omapfb_config.fbmem.fb_sdram_start = fbmem_conf->fb_sdram_start; 49 + omapfb_config.fbmem.fb_sdram_size = fbmem_conf->fb_sdram_size; 50 + if (fbmem_conf->fb_sdram_size) { 51 + pr_info("Reserving %u bytes SDRAM for frame buffer\n", 52 + fbmem_conf->fb_sdram_size); 53 + reserve_bootmem(fbmem_conf->fb_sdram_start, 54 + fbmem_conf->fb_sdram_size); 55 + } 56 + } 57 + } 58 + 59 + static inline int omap_init_fb(void) 60 + { 61 + const struct omap_lcd_config *conf; 62 + 63 + conf = omap_get_config(OMAP_TAG_LCD, struct omap_lcd_config); 64 + if (conf == NULL) 65 + return 0; 66 + 67 + omapfb_config.lcd = *conf; 68 + 69 + return platform_device_register(&omap_fb_device); 70 + } 71 + 72 + arch_initcall(omap_init_fb); 73 + 74 + #else 75 + 76 + void omapfb_reserve_mem(void) {} 77 + 78 + #endif 79 + 80 +
+61 -25
arch/arm/plat-omap/gpio.c
··· 174 static inline struct gpio_bank *get_gpio_bank(int gpio) 175 { 176 #ifdef CONFIG_ARCH_OMAP15XX 177 - if (cpu_is_omap1510()) { 178 if (OMAP_GPIO_IS_MPUIO(gpio)) 179 return &gpio_bank[0]; 180 return &gpio_bank[1]; ··· 223 return 0; 224 } 225 #ifdef CONFIG_ARCH_OMAP15XX 226 - if (cpu_is_omap1510() && gpio < 16) 227 return 0; 228 #endif 229 #if defined(CONFIG_ARCH_OMAP16XX) ··· 402 u32 gpio_bit = 1 << gpio; 403 404 MOD_REG_BIT(OMAP24XX_GPIO_LEVELDETECT0, gpio_bit, 405 - trigger & IRQT_LOW); 406 MOD_REG_BIT(OMAP24XX_GPIO_LEVELDETECT1, gpio_bit, 407 - trigger & IRQT_HIGH); 408 MOD_REG_BIT(OMAP24XX_GPIO_RISINGDETECT, gpio_bit, 409 - trigger & IRQT_RISING); 410 MOD_REG_BIT(OMAP24XX_GPIO_FALLINGDETECT, gpio_bit, 411 - trigger & IRQT_FALLING); 412 /* FIXME: Possibly do 'set_irq_handler(j, do_level_IRQ)' if only level 413 * triggering requested. */ 414 } ··· 422 case METHOD_MPUIO: 423 reg += OMAP_MPUIO_GPIO_INT_EDGE; 424 l = __raw_readl(reg); 425 - if (trigger == IRQT_RISING) 426 l |= 1 << gpio; 427 - else if (trigger == IRQT_FALLING) 428 l &= ~(1 << gpio); 429 else 430 goto bad; ··· 432 case METHOD_GPIO_1510: 433 reg += OMAP1510_GPIO_INT_CONTROL; 434 l = __raw_readl(reg); 435 - if (trigger == IRQT_RISING) 436 l |= 1 << gpio; 437 - else if (trigger == IRQT_FALLING) 438 l &= ~(1 << gpio); 439 else 440 goto bad; ··· 446 reg += OMAP1610_GPIO_EDGE_CTRL1; 447 gpio &= 0x07; 448 /* We allow only edge triggering, i.e. two lowest bits */ 449 - if (trigger & ~IRQT_BOTHEDGE) 450 BUG(); 451 - /* NOTE: knows __IRQT_{FAL,RIS}EDGE match OMAP hardware */ 452 - trigger &= 0x03; 453 l = __raw_readl(reg); 454 l &= ~(3 << (gpio << 1)); 455 - l |= trigger << (gpio << 1); 456 break; 457 case METHOD_GPIO_730: 458 reg += OMAP730_GPIO_INT_CONTROL; 459 l = __raw_readl(reg); 460 - if (trigger == IRQT_RISING) 461 l |= 1 << gpio; 462 - else if (trigger == IRQT_FALLING) 463 l &= ~(1 << gpio); 464 else 465 goto bad; ··· 492 if (check_gpio(gpio) < 0) 493 return -EINVAL; 494 495 - if (type & (__IRQT_LOWLVL|__IRQT_HIGHLVL|IRQT_PROBE)) 496 return -EINVAL; 497 498 bank = get_gpio_bank(gpio); ··· 758 if (bank->method == METHOD_GPIO_24XX) 759 isr_reg = bank->base + OMAP24XX_GPIO_IRQSTATUS1; 760 #endif 761 - 762 while(1) { 763 - isr = __raw_readl(isr_reg); 764 - _enable_gpio_irqbank(bank, isr, 0); 765 - _clear_gpio_irqbank(bank, isr); 766 - _enable_gpio_irqbank(bank, isr, 1); 767 - desc->chip->unmask(irq); 768 769 if (!isr) 770 break; ··· 796 d = irq_desc + gpio_irq; 797 desc_handle_irq(gpio_irq, d, regs); 798 } 799 } 800 } 801 ··· 884 885 initialized = 1; 886 887 - if (cpu_is_omap1510()) { 888 gpio_ick = clk_get(NULL, "arm_gpio_ck"); 889 if (IS_ERR(gpio_ick)) 890 printk("Could not get arm_gpio_ck\n"); ··· 905 } 906 907 #ifdef CONFIG_ARCH_OMAP15XX 908 - if (cpu_is_omap1510()) { 909 printk(KERN_INFO "OMAP1510 GPIO hardware\n"); 910 gpio_bank_count = 2; 911 gpio_bank = gpio_bank_1510;
··· 174 static inline struct gpio_bank *get_gpio_bank(int gpio) 175 { 176 #ifdef CONFIG_ARCH_OMAP15XX 177 + if (cpu_is_omap15xx()) { 178 if (OMAP_GPIO_IS_MPUIO(gpio)) 179 return &gpio_bank[0]; 180 return &gpio_bank[1]; ··· 223 return 0; 224 } 225 #ifdef CONFIG_ARCH_OMAP15XX 226 + if (cpu_is_omap15xx() && gpio < 16) 227 return 0; 228 #endif 229 #if defined(CONFIG_ARCH_OMAP16XX) ··· 402 u32 gpio_bit = 1 << gpio; 403 404 MOD_REG_BIT(OMAP24XX_GPIO_LEVELDETECT0, gpio_bit, 405 + trigger & __IRQT_LOWLVL); 406 MOD_REG_BIT(OMAP24XX_GPIO_LEVELDETECT1, gpio_bit, 407 + trigger & __IRQT_HIGHLVL); 408 MOD_REG_BIT(OMAP24XX_GPIO_RISINGDETECT, gpio_bit, 409 + trigger & __IRQT_RISEDGE); 410 MOD_REG_BIT(OMAP24XX_GPIO_FALLINGDETECT, gpio_bit, 411 + trigger & __IRQT_FALEDGE); 412 /* FIXME: Possibly do 'set_irq_handler(j, do_level_IRQ)' if only level 413 * triggering requested. */ 414 } ··· 422 case METHOD_MPUIO: 423 reg += OMAP_MPUIO_GPIO_INT_EDGE; 424 l = __raw_readl(reg); 425 + if (trigger & __IRQT_RISEDGE) 426 l |= 1 << gpio; 427 + else if (trigger & __IRQT_FALEDGE) 428 l &= ~(1 << gpio); 429 else 430 goto bad; ··· 432 case METHOD_GPIO_1510: 433 reg += OMAP1510_GPIO_INT_CONTROL; 434 l = __raw_readl(reg); 435 + if (trigger & __IRQT_RISEDGE) 436 l |= 1 << gpio; 437 + else if (trigger & __IRQT_FALEDGE) 438 l &= ~(1 << gpio); 439 else 440 goto bad; ··· 446 reg += OMAP1610_GPIO_EDGE_CTRL1; 447 gpio &= 0x07; 448 /* We allow only edge triggering, i.e. two lowest bits */ 449 + if (trigger & (__IRQT_LOWLVL | __IRQT_HIGHLVL)) 450 BUG(); 451 l = __raw_readl(reg); 452 l &= ~(3 << (gpio << 1)); 453 + if (trigger & __IRQT_RISEDGE) 454 + l |= 2 << (gpio << 1); 455 + if (trigger & __IRQT_FALEDGE) 456 + l |= 1 << (gpio << 1); 457 break; 458 case METHOD_GPIO_730: 459 reg += OMAP730_GPIO_INT_CONTROL; 460 l = __raw_readl(reg); 461 + if (trigger & __IRQT_RISEDGE) 462 l |= 1 << gpio; 463 + else if (trigger & __IRQT_FALEDGE) 464 l &= ~(1 << gpio); 465 else 466 goto bad; ··· 491 if (check_gpio(gpio) < 0) 492 return -EINVAL; 493 494 + if (type & IRQT_PROBE) 495 + return -EINVAL; 496 + if (!cpu_is_omap24xx() && (type & (__IRQT_LOWLVL|__IRQT_HIGHLVL))) 497 return -EINVAL; 498 499 bank = get_gpio_bank(gpio); ··· 755 if (bank->method == METHOD_GPIO_24XX) 756 isr_reg = bank->base + OMAP24XX_GPIO_IRQSTATUS1; 757 #endif 758 while(1) { 759 + u32 isr_saved, level_mask = 0; 760 + 761 + isr_saved = isr = __raw_readl(isr_reg); 762 + 763 + if (cpu_is_omap15xx() && (bank->method == METHOD_MPUIO)) 764 + isr &= 0x0000ffff; 765 + 766 + if (cpu_is_omap24xx()) 767 + level_mask = 768 + __raw_readl(bank->base + 769 + OMAP24XX_GPIO_LEVELDETECT0) | 770 + __raw_readl(bank->base + 771 + OMAP24XX_GPIO_LEVELDETECT1); 772 + 773 + /* clear edge sensitive interrupts before handler(s) are 774 + called so that we don't miss any interrupt occurred while 775 + executing them */ 776 + _enable_gpio_irqbank(bank, isr_saved & ~level_mask, 0); 777 + _clear_gpio_irqbank(bank, isr_saved & ~level_mask); 778 + _enable_gpio_irqbank(bank, isr_saved & ~level_mask, 1); 779 + 780 + /* if there is only edge sensitive GPIO pin interrupts 781 + configured, we could unmask GPIO bank interrupt immediately */ 782 + if (!level_mask) 783 + desc->chip->unmask(irq); 784 785 if (!isr) 786 break; ··· 774 d = irq_desc + gpio_irq; 775 desc_handle_irq(gpio_irq, d, regs); 776 } 777 + 778 + if (cpu_is_omap24xx()) { 779 + /* clear level sensitive interrupts after handler(s) */ 780 + _enable_gpio_irqbank(bank, isr_saved & level_mask, 0); 781 + _clear_gpio_irqbank(bank, isr_saved & level_mask); 782 + _enable_gpio_irqbank(bank, isr_saved & level_mask, 1); 783 + } 784 + 785 + /* if bank has any level sensitive GPIO pin interrupt 786 + configured, we must unmask the bank interrupt only after 787 + handler(s) are executed in order to avoid spurious bank 788 + interrupt */ 789 + if (level_mask) 790 + desc->chip->unmask(irq); 791 } 792 } 793 ··· 848 849 initialized = 1; 850 851 + if (cpu_is_omap15xx()) { 852 gpio_ick = clk_get(NULL, "arm_gpio_ck"); 853 if (IS_ERR(gpio_ick)) 854 printk("Could not get arm_gpio_ck\n"); ··· 869 } 870 871 #ifdef CONFIG_ARCH_OMAP15XX 872 + if (cpu_is_omap15xx()) { 873 printk(KERN_INFO "OMAP1510 GPIO hardware\n"); 874 gpio_bank_count = 2; 875 gpio_bank = gpio_bank_1510;
+309 -42
arch/arm/plat-omap/mcbsp.c
··· 34 #ifdef CONFIG_MCBSP_DEBUG 35 #define DBG(x...) printk(x) 36 #else 37 - #define DBG(x...) do { } while (0) 38 #endif 39 40 struct omap_mcbsp { ··· 44 omap_mcbsp_word_length rx_word_length; 45 omap_mcbsp_word_length tx_word_length; 46 47 /* IRQ based TX/RX */ 48 int rx_irq; 49 int tx_irq; ··· 65 }; 66 67 static struct omap_mcbsp mcbsp[OMAP_MAX_MCBSP_COUNT]; 68 static struct clk *mcbsp_dsp_ck = 0; 69 static struct clk *mcbsp_api_ck = 0; 70 static struct clk *mcbsp_dspxor_ck = 0; 71 - 72 73 static void omap_mcbsp_dump_reg(u8 id) 74 { ··· 98 DBG("***********************\n"); 99 } 100 101 - 102 static irqreturn_t omap_mcbsp_tx_irq_handler(int irq, void *dev_id, struct pt_regs *regs) 103 { 104 struct omap_mcbsp * mcbsp_tx = (struct omap_mcbsp *)(dev_id); ··· 117 complete(&mcbsp_rx->rx_irq_completion); 118 return IRQ_HANDLED; 119 } 120 - 121 122 static void omap_mcbsp_tx_dma_callback(int lch, u16 ch_status, void *data) 123 { ··· 184 return 0; 185 } 186 187 - if (cpu_is_omap1510() || cpu_is_omap16xx()) { 188 if (id > OMAP_MAX_MCBSP_COUNT) { 189 printk(KERN_ERR "OMAP-McBSP: McBSP%d doesn't exist\n", id + 1); 190 return -1; ··· 195 return -1; 196 } 197 198 static void omap_mcbsp_dsp_request(void) 199 { 200 - if (cpu_is_omap1510() || cpu_is_omap16xx()) { 201 clk_enable(mcbsp_dsp_ck); 202 clk_enable(mcbsp_api_ck); 203 ··· 216 217 static void omap_mcbsp_dsp_free(void) 218 { 219 - if (cpu_is_omap1510() || cpu_is_omap16xx()) { 220 clk_disable(mcbsp_dspxor_ck); 221 clk_disable(mcbsp_dsp_ck); 222 clk_disable(mcbsp_api_ck); 223 } 224 } 225 226 int omap_mcbsp_request(unsigned int id) ··· 267 if (omap_mcbsp_check(id) < 0) 268 return -EINVAL; 269 270 /* 271 * On 1510, 1610 and 1710, McBSP1 and McBSP3 272 * are DSP public peripherals. 273 */ 274 if (id == OMAP_MCBSP1 || id == OMAP_MCBSP3) 275 omap_mcbsp_dsp_request(); 276 277 spin_lock(&mcbsp[id].lock); 278 if (!mcbsp[id].free) { ··· 298 mcbsp[id].free = 0; 299 spin_unlock(&mcbsp[id].lock); 300 301 - /* We need to get IRQs here */ 302 - err = request_irq(mcbsp[id].tx_irq, omap_mcbsp_tx_irq_handler, 0, 303 - "McBSP", 304 - (void *) (&mcbsp[id])); 305 - if (err != 0) { 306 - printk(KERN_ERR "OMAP-McBSP: Unable to request TX IRQ %d for McBSP%d\n", 307 - mcbsp[id].tx_irq, mcbsp[id].id); 308 - return err; 309 } 310 311 - init_completion(&(mcbsp[id].tx_irq_completion)); 312 - 313 - 314 - err = request_irq(mcbsp[id].rx_irq, omap_mcbsp_rx_irq_handler, 0, 315 - "McBSP", 316 - (void *) (&mcbsp[id])); 317 - if (err != 0) { 318 - printk(KERN_ERR "OMAP-McBSP: Unable to request RX IRQ %d for McBSP%d\n", 319 - mcbsp[id].rx_irq, mcbsp[id].id); 320 - free_irq(mcbsp[id].tx_irq, (void *) (&mcbsp[id])); 321 - return err; 322 - } 323 - 324 - init_completion(&(mcbsp[id].rx_irq_completion)); 325 return 0; 326 327 } ··· 334 if (omap_mcbsp_check(id) < 0) 335 return; 336 337 - if (id == OMAP_MCBSP1 || id == OMAP_MCBSP3) 338 - omap_mcbsp_dsp_free(); 339 340 spin_lock(&mcbsp[id].lock); 341 if (mcbsp[id].free) { ··· 363 mcbsp[id].free = 1; 364 spin_unlock(&mcbsp[id].lock); 365 366 - /* Free IRQs */ 367 - free_irq(mcbsp[id].rx_irq, (void *) (&mcbsp[id])); 368 - free_irq(mcbsp[id].tx_irq, (void *) (&mcbsp[id])); 369 } 370 371 /* ··· 542 } 543 544 545 /* 546 * Simple DMA based buffer rx/tx routines. 547 * Nothing fancy, just a single buffer tx/rx through DMA. ··· 661 int omap_mcbsp_xmit_buffer(unsigned int id, dma_addr_t buffer, unsigned int length) 662 { 663 int dma_tx_ch; 664 665 if (omap_mcbsp_check(id) < 0) 666 return -EINVAL; ··· 680 681 init_completion(&(mcbsp[id].tx_dma_completion)); 682 683 omap_set_dma_transfer_params(mcbsp[id].dma_tx_lch, 684 OMAP_DMA_DATA_TYPE_S16, 685 length >> 1, 1, 686 OMAP_DMA_SYNC_ELEMENT, 687 - 0, 0); 688 689 omap_set_dma_dest_params(mcbsp[id].dma_tx_lch, 690 - OMAP_DMA_PORT_TIPB, 691 OMAP_DMA_AMODE_CONSTANT, 692 mcbsp[id].io_base + OMAP_MCBSP_REG_DXR1, 693 0, 0); 694 695 omap_set_dma_src_params(mcbsp[id].dma_tx_lch, 696 - OMAP_DMA_PORT_EMIFF, 697 OMAP_DMA_AMODE_POST_INC, 698 buffer, 699 0, 0); ··· 714 int omap_mcbsp_recv_buffer(unsigned int id, dma_addr_t buffer, unsigned int length) 715 { 716 int dma_rx_ch; 717 718 if (omap_mcbsp_check(id) < 0) 719 return -EINVAL; ··· 733 734 init_completion(&(mcbsp[id].rx_dma_completion)); 735 736 omap_set_dma_transfer_params(mcbsp[id].dma_rx_lch, 737 OMAP_DMA_DATA_TYPE_S16, 738 length >> 1, 1, 739 OMAP_DMA_SYNC_ELEMENT, 740 - 0, 0); 741 742 omap_set_dma_src_params(mcbsp[id].dma_rx_lch, 743 - OMAP_DMA_PORT_TIPB, 744 OMAP_DMA_AMODE_CONSTANT, 745 mcbsp[id].io_base + OMAP_MCBSP_REG_DRR1, 746 0, 0); 747 748 omap_set_dma_dest_params(mcbsp[id].dma_rx_lch, 749 - OMAP_DMA_PORT_EMIFF, 750 OMAP_DMA_AMODE_POST_INC, 751 buffer, 752 0, 0); ··· 898 }; 899 #endif 900 901 static int __init omap_mcbsp_init(void) 902 { 903 int mcbsp_count = 0, i; ··· 922 923 printk("Initializing OMAP McBSP system\n"); 924 925 mcbsp_dsp_ck = clk_get(0, "dsp_ck"); 926 if (IS_ERR(mcbsp_dsp_ck)) { 927 printk(KERN_ERR "mcbsp: could not acquire dsp_ck handle.\n"); ··· 938 printk(KERN_ERR "mcbsp: could not acquire dspxor_ck handle.\n"); 939 return PTR_ERR(mcbsp_dspxor_ck); 940 } 941 942 #ifdef CONFIG_ARCH_OMAP730 943 if (cpu_is_omap730()) { ··· 969 } 970 #endif 971 #ifdef CONFIG_ARCH_OMAP15XX 972 - if (cpu_is_omap1510()) { 973 mcbsp_info = mcbsp_1510; 974 mcbsp_count = ARRAY_SIZE(mcbsp_1510); 975 } ··· 978 if (cpu_is_omap16xx()) { 979 mcbsp_info = mcbsp_1610; 980 mcbsp_count = ARRAY_SIZE(mcbsp_1610); 981 } 982 #endif 983 for (i = 0; i < OMAP_MAX_MCBSP_COUNT ; i++) { ··· 1005 mcbsp[i].dma_rx_lch = -1; 1006 1007 mcbsp[i].io_base = mcbsp_info[i].virt_base; 1008 mcbsp[i].tx_irq = mcbsp_info[i].tx_irq; 1009 mcbsp[i].rx_irq = mcbsp_info[i].rx_irq; 1010 mcbsp[i].dma_rx_sync = mcbsp_info[i].dma_rx_sync; ··· 1016 return 0; 1017 } 1018 1019 - 1020 arch_initcall(omap_mcbsp_init); 1021 1022 EXPORT_SYMBOL(omap_mcbsp_config); 1023 EXPORT_SYMBOL(omap_mcbsp_request); 1024 EXPORT_SYMBOL(omap_mcbsp_free); 1025 EXPORT_SYMBOL(omap_mcbsp_start); 1026 EXPORT_SYMBOL(omap_mcbsp_stop); ··· 1028 EXPORT_SYMBOL(omap_mcbsp_recv_word); 1029 EXPORT_SYMBOL(omap_mcbsp_xmit_buffer); 1030 EXPORT_SYMBOL(omap_mcbsp_recv_buffer); 1031 EXPORT_SYMBOL(omap_mcbsp_set_spi_mode);
··· 34 #ifdef CONFIG_MCBSP_DEBUG 35 #define DBG(x...) printk(x) 36 #else 37 + #define DBG(x...) do { } while (0) 38 #endif 39 40 struct omap_mcbsp { ··· 44 omap_mcbsp_word_length rx_word_length; 45 omap_mcbsp_word_length tx_word_length; 46 47 + omap_mcbsp_io_type_t io_type; /* IRQ or poll */ 48 /* IRQ based TX/RX */ 49 int rx_irq; 50 int tx_irq; ··· 64 }; 65 66 static struct omap_mcbsp mcbsp[OMAP_MAX_MCBSP_COUNT]; 67 + #ifdef CONFIG_ARCH_OMAP1 68 static struct clk *mcbsp_dsp_ck = 0; 69 static struct clk *mcbsp_api_ck = 0; 70 static struct clk *mcbsp_dspxor_ck = 0; 71 + #endif 72 + #ifdef CONFIG_ARCH_OMAP2 73 + static struct clk *mcbsp1_ick = 0; 74 + static struct clk *mcbsp1_fck = 0; 75 + static struct clk *mcbsp2_ick = 0; 76 + static struct clk *mcbsp2_fck = 0; 77 + static struct clk *sys_ck = 0; 78 + static struct clk *sys_clkout = 0; 79 + #endif 80 81 static void omap_mcbsp_dump_reg(u8 id) 82 { ··· 88 DBG("***********************\n"); 89 } 90 91 static irqreturn_t omap_mcbsp_tx_irq_handler(int irq, void *dev_id, struct pt_regs *regs) 92 { 93 struct omap_mcbsp * mcbsp_tx = (struct omap_mcbsp *)(dev_id); ··· 108 complete(&mcbsp_rx->rx_irq_completion); 109 return IRQ_HANDLED; 110 } 111 112 static void omap_mcbsp_tx_dma_callback(int lch, u16 ch_status, void *data) 113 { ··· 176 return 0; 177 } 178 179 + if (cpu_is_omap15xx() || cpu_is_omap16xx() || cpu_is_omap24xx()) { 180 if (id > OMAP_MAX_MCBSP_COUNT) { 181 printk(KERN_ERR "OMAP-McBSP: McBSP%d doesn't exist\n", id + 1); 182 return -1; ··· 187 return -1; 188 } 189 190 + #ifdef CONFIG_ARCH_OMAP1 191 static void omap_mcbsp_dsp_request(void) 192 { 193 + if (cpu_is_omap15xx() || cpu_is_omap16xx()) { 194 clk_enable(mcbsp_dsp_ck); 195 clk_enable(mcbsp_api_ck); 196 ··· 207 208 static void omap_mcbsp_dsp_free(void) 209 { 210 + if (cpu_is_omap15xx() || cpu_is_omap16xx()) { 211 clk_disable(mcbsp_dspxor_ck); 212 clk_disable(mcbsp_dsp_ck); 213 clk_disable(mcbsp_api_ck); 214 } 215 + } 216 + #endif 217 + 218 + #ifdef CONFIG_ARCH_OMAP2 219 + static void omap2_mcbsp2_mux_setup(void) 220 + { 221 + omap_cfg_reg(Y15_24XX_MCBSP2_CLKX); 222 + omap_cfg_reg(R14_24XX_MCBSP2_FSX); 223 + omap_cfg_reg(W15_24XX_MCBSP2_DR); 224 + omap_cfg_reg(V15_24XX_MCBSP2_DX); 225 + omap_cfg_reg(V14_24XX_GPIO117); 226 + omap_cfg_reg(W14_24XX_SYS_CLKOUT); 227 + } 228 + #endif 229 + 230 + /* 231 + * We can choose between IRQ based or polled IO. 232 + * This needs to be called before omap_mcbsp_request(). 233 + */ 234 + int omap_mcbsp_set_io_type(unsigned int id, omap_mcbsp_io_type_t io_type) 235 + { 236 + if (omap_mcbsp_check(id) < 0) 237 + return -EINVAL; 238 + 239 + spin_lock(&mcbsp[id].lock); 240 + 241 + if (!mcbsp[id].free) { 242 + printk (KERN_ERR "OMAP-McBSP: McBSP%d is currently in use\n", id + 1); 243 + spin_unlock(&mcbsp[id].lock); 244 + return -EINVAL; 245 + } 246 + 247 + mcbsp[id].io_type = io_type; 248 + 249 + spin_unlock(&mcbsp[id].lock); 250 + 251 + return 0; 252 } 253 254 int omap_mcbsp_request(unsigned int id) ··· 221 if (omap_mcbsp_check(id) < 0) 222 return -EINVAL; 223 224 + #ifdef CONFIG_ARCH_OMAP1 225 /* 226 * On 1510, 1610 and 1710, McBSP1 and McBSP3 227 * are DSP public peripherals. 228 */ 229 if (id == OMAP_MCBSP1 || id == OMAP_MCBSP3) 230 omap_mcbsp_dsp_request(); 231 + #endif 232 + 233 + #ifdef CONFIG_ARCH_OMAP2 234 + if (cpu_is_omap24xx()) { 235 + if (id == OMAP_MCBSP1) { 236 + clk_enable(mcbsp1_ick); 237 + clk_enable(mcbsp1_fck); 238 + } else { 239 + clk_enable(mcbsp2_ick); 240 + clk_enable(mcbsp2_fck); 241 + } 242 + } 243 + #endif 244 245 spin_lock(&mcbsp[id].lock); 246 if (!mcbsp[id].free) { ··· 238 mcbsp[id].free = 0; 239 spin_unlock(&mcbsp[id].lock); 240 241 + if (mcbsp[id].io_type == OMAP_MCBSP_IRQ_IO) { 242 + /* We need to get IRQs here */ 243 + err = request_irq(mcbsp[id].tx_irq, omap_mcbsp_tx_irq_handler, 0, 244 + "McBSP", 245 + (void *) (&mcbsp[id])); 246 + if (err != 0) { 247 + printk(KERN_ERR "OMAP-McBSP: Unable to request TX IRQ %d for McBSP%d\n", 248 + mcbsp[id].tx_irq, mcbsp[id].id); 249 + return err; 250 + } 251 + 252 + init_completion(&(mcbsp[id].tx_irq_completion)); 253 + 254 + 255 + err = request_irq(mcbsp[id].rx_irq, omap_mcbsp_rx_irq_handler, 0, 256 + "McBSP", 257 + (void *) (&mcbsp[id])); 258 + if (err != 0) { 259 + printk(KERN_ERR "OMAP-McBSP: Unable to request RX IRQ %d for McBSP%d\n", 260 + mcbsp[id].rx_irq, mcbsp[id].id); 261 + free_irq(mcbsp[id].tx_irq, (void *) (&mcbsp[id])); 262 + return err; 263 + } 264 + 265 + init_completion(&(mcbsp[id].rx_irq_completion)); 266 } 267 268 return 0; 269 270 } ··· 271 if (omap_mcbsp_check(id) < 0) 272 return; 273 274 + #ifdef CONFIG_ARCH_OMAP1 275 + if (cpu_class_is_omap1()) { 276 + if (id == OMAP_MCBSP1 || id == OMAP_MCBSP3) 277 + omap_mcbsp_dsp_free(); 278 + } 279 + #endif 280 + 281 + #ifdef CONFIG_ARCH_OMAP2 282 + if (cpu_is_omap24xx()) { 283 + if (id == OMAP_MCBSP1) { 284 + clk_disable(mcbsp1_ick); 285 + clk_disable(mcbsp1_fck); 286 + } else { 287 + clk_disable(mcbsp2_ick); 288 + clk_disable(mcbsp2_fck); 289 + } 290 + } 291 + #endif 292 293 spin_lock(&mcbsp[id].lock); 294 if (mcbsp[id].free) { ··· 284 mcbsp[id].free = 1; 285 spin_unlock(&mcbsp[id].lock); 286 287 + if (mcbsp[id].io_type == OMAP_MCBSP_IRQ_IO) { 288 + /* Free IRQs */ 289 + free_irq(mcbsp[id].rx_irq, (void *) (&mcbsp[id])); 290 + free_irq(mcbsp[id].tx_irq, (void *) (&mcbsp[id])); 291 + } 292 } 293 294 /* ··· 461 } 462 463 464 + int omap_mcbsp_spi_master_xmit_word_poll(unsigned int id, u32 word) 465 + { 466 + u32 io_base = mcbsp[id].io_base; 467 + omap_mcbsp_word_length tx_word_length = mcbsp[id].tx_word_length; 468 + omap_mcbsp_word_length rx_word_length = mcbsp[id].rx_word_length; 469 + u16 spcr2, spcr1, attempts = 0, word_lsb, word_msb = 0; 470 + 471 + if (tx_word_length != rx_word_length) 472 + return -EINVAL; 473 + 474 + /* First we wait for the transmitter to be ready */ 475 + spcr2 = OMAP_MCBSP_READ(io_base, SPCR2); 476 + while (!(spcr2 & XRDY)) { 477 + spcr2 = OMAP_MCBSP_READ(io_base, SPCR2); 478 + if (attempts++ > 1000) { 479 + /* We must reset the transmitter */ 480 + OMAP_MCBSP_WRITE(io_base, SPCR2, spcr2 & (~XRST)); 481 + udelay(10); 482 + OMAP_MCBSP_WRITE(io_base, SPCR2, spcr2 | XRST); 483 + udelay(10); 484 + printk("McBSP transmitter not ready\n"); 485 + return -EAGAIN; 486 + } 487 + } 488 + 489 + /* Now we can push the data */ 490 + if (tx_word_length > OMAP_MCBSP_WORD_16) 491 + OMAP_MCBSP_WRITE(io_base, DXR2, word >> 16); 492 + OMAP_MCBSP_WRITE(io_base, DXR1, word & 0xffff); 493 + 494 + /* We wait for the receiver to be ready */ 495 + spcr1 = OMAP_MCBSP_READ(io_base, SPCR1); 496 + while (!(spcr1 & RRDY)) { 497 + spcr1 = OMAP_MCBSP_READ(io_base, SPCR1); 498 + if (attempts++ > 1000) { 499 + /* We must reset the receiver */ 500 + OMAP_MCBSP_WRITE(io_base, SPCR1, spcr1 & (~RRST)); 501 + udelay(10); 502 + OMAP_MCBSP_WRITE(io_base, SPCR1, spcr1 | RRST); 503 + udelay(10); 504 + printk("McBSP receiver not ready\n"); 505 + return -EAGAIN; 506 + } 507 + } 508 + 509 + /* Receiver is ready, let's read the dummy data */ 510 + if (rx_word_length > OMAP_MCBSP_WORD_16) 511 + word_msb = OMAP_MCBSP_READ(io_base, DRR2); 512 + word_lsb = OMAP_MCBSP_READ(io_base, DRR1); 513 + 514 + return 0; 515 + } 516 + 517 + int omap_mcbsp_spi_master_recv_word_poll(unsigned int id, u32 * word) 518 + { 519 + u32 io_base = mcbsp[id].io_base, clock_word = 0; 520 + omap_mcbsp_word_length tx_word_length = mcbsp[id].tx_word_length; 521 + omap_mcbsp_word_length rx_word_length = mcbsp[id].rx_word_length; 522 + u16 spcr2, spcr1, attempts = 0, word_lsb, word_msb = 0; 523 + 524 + if (tx_word_length != rx_word_length) 525 + return -EINVAL; 526 + 527 + /* First we wait for the transmitter to be ready */ 528 + spcr2 = OMAP_MCBSP_READ(io_base, SPCR2); 529 + while (!(spcr2 & XRDY)) { 530 + spcr2 = OMAP_MCBSP_READ(io_base, SPCR2); 531 + if (attempts++ > 1000) { 532 + /* We must reset the transmitter */ 533 + OMAP_MCBSP_WRITE(io_base, SPCR2, spcr2 & (~XRST)); 534 + udelay(10); 535 + OMAP_MCBSP_WRITE(io_base, SPCR2, spcr2 | XRST); 536 + udelay(10); 537 + printk("McBSP transmitter not ready\n"); 538 + return -EAGAIN; 539 + } 540 + } 541 + 542 + /* We first need to enable the bus clock */ 543 + if (tx_word_length > OMAP_MCBSP_WORD_16) 544 + OMAP_MCBSP_WRITE(io_base, DXR2, clock_word >> 16); 545 + OMAP_MCBSP_WRITE(io_base, DXR1, clock_word & 0xffff); 546 + 547 + /* We wait for the receiver to be ready */ 548 + spcr1 = OMAP_MCBSP_READ(io_base, SPCR1); 549 + while (!(spcr1 & RRDY)) { 550 + spcr1 = OMAP_MCBSP_READ(io_base, SPCR1); 551 + if (attempts++ > 1000) { 552 + /* We must reset the receiver */ 553 + OMAP_MCBSP_WRITE(io_base, SPCR1, spcr1 & (~RRST)); 554 + udelay(10); 555 + OMAP_MCBSP_WRITE(io_base, SPCR1, spcr1 | RRST); 556 + udelay(10); 557 + printk("McBSP receiver not ready\n"); 558 + return -EAGAIN; 559 + } 560 + } 561 + 562 + /* Receiver is ready, there is something for us */ 563 + if (rx_word_length > OMAP_MCBSP_WORD_16) 564 + word_msb = OMAP_MCBSP_READ(io_base, DRR2); 565 + word_lsb = OMAP_MCBSP_READ(io_base, DRR1); 566 + 567 + word[0] = (word_lsb | (word_msb << 16)); 568 + 569 + return 0; 570 + } 571 + 572 + 573 /* 574 * Simple DMA based buffer rx/tx routines. 575 * Nothing fancy, just a single buffer tx/rx through DMA. ··· 471 int omap_mcbsp_xmit_buffer(unsigned int id, dma_addr_t buffer, unsigned int length) 472 { 473 int dma_tx_ch; 474 + int src_port = 0; 475 + int dest_port = 0; 476 + int sync_dev = 0; 477 478 if (omap_mcbsp_check(id) < 0) 479 return -EINVAL; ··· 487 488 init_completion(&(mcbsp[id].tx_dma_completion)); 489 490 + if (cpu_class_is_omap1()) { 491 + src_port = OMAP_DMA_PORT_TIPB; 492 + dest_port = OMAP_DMA_PORT_EMIFF; 493 + } 494 + if (cpu_is_omap24xx()) 495 + sync_dev = mcbsp[id].dma_tx_sync; 496 + 497 omap_set_dma_transfer_params(mcbsp[id].dma_tx_lch, 498 OMAP_DMA_DATA_TYPE_S16, 499 length >> 1, 1, 500 OMAP_DMA_SYNC_ELEMENT, 501 + sync_dev, 0); 502 503 omap_set_dma_dest_params(mcbsp[id].dma_tx_lch, 504 + src_port, 505 OMAP_DMA_AMODE_CONSTANT, 506 mcbsp[id].io_base + OMAP_MCBSP_REG_DXR1, 507 0, 0); 508 509 omap_set_dma_src_params(mcbsp[id].dma_tx_lch, 510 + dest_port, 511 OMAP_DMA_AMODE_POST_INC, 512 buffer, 513 0, 0); ··· 514 int omap_mcbsp_recv_buffer(unsigned int id, dma_addr_t buffer, unsigned int length) 515 { 516 int dma_rx_ch; 517 + int src_port = 0; 518 + int dest_port = 0; 519 + int sync_dev = 0; 520 521 if (omap_mcbsp_check(id) < 0) 522 return -EINVAL; ··· 530 531 init_completion(&(mcbsp[id].rx_dma_completion)); 532 533 + if (cpu_class_is_omap1()) { 534 + src_port = OMAP_DMA_PORT_TIPB; 535 + dest_port = OMAP_DMA_PORT_EMIFF; 536 + } 537 + if (cpu_is_omap24xx()) 538 + sync_dev = mcbsp[id].dma_rx_sync; 539 + 540 omap_set_dma_transfer_params(mcbsp[id].dma_rx_lch, 541 OMAP_DMA_DATA_TYPE_S16, 542 length >> 1, 1, 543 OMAP_DMA_SYNC_ELEMENT, 544 + sync_dev, 0); 545 546 omap_set_dma_src_params(mcbsp[id].dma_rx_lch, 547 + src_port, 548 OMAP_DMA_AMODE_CONSTANT, 549 mcbsp[id].io_base + OMAP_MCBSP_REG_DRR1, 550 0, 0); 551 552 omap_set_dma_dest_params(mcbsp[id].dma_rx_lch, 553 + dest_port, 554 OMAP_DMA_AMODE_POST_INC, 555 buffer, 556 0, 0); ··· 688 }; 689 #endif 690 691 + #if defined(CONFIG_ARCH_OMAP24XX) 692 + static const struct omap_mcbsp_info mcbsp_24xx[] = { 693 + [0] = { .virt_base = IO_ADDRESS(OMAP24XX_MCBSP1_BASE), 694 + .dma_rx_sync = OMAP24XX_DMA_MCBSP1_RX, 695 + .dma_tx_sync = OMAP24XX_DMA_MCBSP1_TX, 696 + .rx_irq = INT_24XX_MCBSP1_IRQ_RX, 697 + .tx_irq = INT_24XX_MCBSP1_IRQ_TX, 698 + }, 699 + [1] = { .virt_base = IO_ADDRESS(OMAP24XX_MCBSP2_BASE), 700 + .dma_rx_sync = OMAP24XX_DMA_MCBSP2_RX, 701 + .dma_tx_sync = OMAP24XX_DMA_MCBSP2_TX, 702 + .rx_irq = INT_24XX_MCBSP2_IRQ_RX, 703 + .tx_irq = INT_24XX_MCBSP2_IRQ_TX, 704 + }, 705 + }; 706 + #endif 707 + 708 static int __init omap_mcbsp_init(void) 709 { 710 int mcbsp_count = 0, i; ··· 695 696 printk("Initializing OMAP McBSP system\n"); 697 698 + #ifdef CONFIG_ARCH_OMAP1 699 mcbsp_dsp_ck = clk_get(0, "dsp_ck"); 700 if (IS_ERR(mcbsp_dsp_ck)) { 701 printk(KERN_ERR "mcbsp: could not acquire dsp_ck handle.\n"); ··· 710 printk(KERN_ERR "mcbsp: could not acquire dspxor_ck handle.\n"); 711 return PTR_ERR(mcbsp_dspxor_ck); 712 } 713 + #endif 714 + #ifdef CONFIG_ARCH_OMAP2 715 + mcbsp1_ick = clk_get(0, "mcbsp1_ick"); 716 + if (IS_ERR(mcbsp1_ick)) { 717 + printk(KERN_ERR "mcbsp: could not acquire mcbsp1_ick handle.\n"); 718 + return PTR_ERR(mcbsp1_ick); 719 + } 720 + mcbsp1_fck = clk_get(0, "mcbsp1_fck"); 721 + if (IS_ERR(mcbsp1_fck)) { 722 + printk(KERN_ERR "mcbsp: could not acquire mcbsp1_fck handle.\n"); 723 + return PTR_ERR(mcbsp1_fck); 724 + } 725 + mcbsp2_ick = clk_get(0, "mcbsp2_ick"); 726 + if (IS_ERR(mcbsp2_ick)) { 727 + printk(KERN_ERR "mcbsp: could not acquire mcbsp2_ick handle.\n"); 728 + return PTR_ERR(mcbsp2_ick); 729 + } 730 + mcbsp2_fck = clk_get(0, "mcbsp2_fck"); 731 + if (IS_ERR(mcbsp2_fck)) { 732 + printk(KERN_ERR "mcbsp: could not acquire mcbsp2_fck handle.\n"); 733 + return PTR_ERR(mcbsp2_fck); 734 + } 735 + #endif 736 737 #ifdef CONFIG_ARCH_OMAP730 738 if (cpu_is_omap730()) { ··· 718 } 719 #endif 720 #ifdef CONFIG_ARCH_OMAP15XX 721 + if (cpu_is_omap15xx()) { 722 mcbsp_info = mcbsp_1510; 723 mcbsp_count = ARRAY_SIZE(mcbsp_1510); 724 } ··· 727 if (cpu_is_omap16xx()) { 728 mcbsp_info = mcbsp_1610; 729 mcbsp_count = ARRAY_SIZE(mcbsp_1610); 730 + } 731 + #endif 732 + #if defined(CONFIG_ARCH_OMAP24XX) 733 + if (cpu_is_omap24xx()) { 734 + mcbsp_info = mcbsp_24xx; 735 + mcbsp_count = ARRAY_SIZE(mcbsp_24xx); 736 + 737 + /* REVISIT: where's the right place? */ 738 + omap2_mcbsp2_mux_setup(); 739 + sys_ck = clk_get(0, "sys_ck"); 740 + sys_clkout = clk_get(0, "sys_clkout"); 741 + clk_set_parent(sys_clkout, sys_ck); 742 + clk_enable(sys_clkout); 743 } 744 #endif 745 for (i = 0; i < OMAP_MAX_MCBSP_COUNT ; i++) { ··· 741 mcbsp[i].dma_rx_lch = -1; 742 743 mcbsp[i].io_base = mcbsp_info[i].virt_base; 744 + mcbsp[i].io_type = OMAP_MCBSP_IRQ_IO; /* Default I/O is IRQ based */ 745 mcbsp[i].tx_irq = mcbsp_info[i].tx_irq; 746 mcbsp[i].rx_irq = mcbsp_info[i].rx_irq; 747 mcbsp[i].dma_rx_sync = mcbsp_info[i].dma_rx_sync; ··· 751 return 0; 752 } 753 754 arch_initcall(omap_mcbsp_init); 755 756 EXPORT_SYMBOL(omap_mcbsp_config); 757 EXPORT_SYMBOL(omap_mcbsp_request); 758 + EXPORT_SYMBOL(omap_mcbsp_set_io_type); 759 EXPORT_SYMBOL(omap_mcbsp_free); 760 EXPORT_SYMBOL(omap_mcbsp_start); 761 EXPORT_SYMBOL(omap_mcbsp_stop); ··· 763 EXPORT_SYMBOL(omap_mcbsp_recv_word); 764 EXPORT_SYMBOL(omap_mcbsp_xmit_buffer); 765 EXPORT_SYMBOL(omap_mcbsp_recv_buffer); 766 + EXPORT_SYMBOL(omap_mcbsp_spi_master_xmit_word_poll); 767 + EXPORT_SYMBOL(omap_mcbsp_spi_master_recv_word_poll); 768 EXPORT_SYMBOL(omap_mcbsp_set_spi_mode);
-3
arch/arm/plat-omap/ocpi.c
··· 62 if (!cpu_is_omap16xx()) 63 return -ENODEV; 64 65 - /* Make sure there's clock for OCPI */ 66 - clk_enable(ocpi_ck); 67 - 68 /* Enable access for OHCI in OCPI */ 69 val = omap_readl(OCPI_PROT); 70 val &= ~0xff;
··· 62 if (!cpu_is_omap16xx()) 63 return -ENODEV; 64 65 /* Enable access for OHCI in OCPI */ 66 val = omap_readl(OCPI_PROT); 67 val &= ~0xff;
+1
arch/arm/plat-omap/pm.c
··· 38 #include <linux/pm.h> 39 #include <linux/sched.h> 40 #include <linux/proc_fs.h> 41 #include <linux/interrupt.h> 42 43 #include <asm/io.h>
··· 38 #include <linux/pm.h> 39 #include <linux/sched.h> 40 #include <linux/proc_fs.h> 41 + #include <linux/pm.h> 42 #include <linux/interrupt.h> 43 44 #include <asm/io.h>
+92 -19
arch/arm/plat-omap/sleep.S arch/arm/mach-omap1/sleep.S
··· 1 /* 2 - * linux/arch/arm/plat-omap/sleep.S 3 * 4 * Low-level OMAP730/1510/1610 sleep/wakeUp support 5 * ··· 383 mcr p15, 0, r0, c7, c10, 4 384 nop 385 386 - @ load base address of Traffic Controller 387 mov r6, #TCMIF_ASM_BASE & 0xff000000 388 orr r6, r6, #TCMIF_ASM_BASE & 0x00ff0000 389 orr r6, r6, #TCMIF_ASM_BASE & 0x0000ff00 390 391 - @ prepare to put SDRAM into self-refresh manually 392 ldr r7, [r6, #EMIFF_SDRAM_CONFIG_ASM_OFFSET & 0xff] 393 orr r9, r7, #SELF_REFRESH_MODE & 0xff000000 394 orr r9, r9, #SELF_REFRESH_MODE & 0x000000ff 395 str r9, [r6, #EMIFF_SDRAM_CONFIG_ASM_OFFSET & 0xff] 396 397 - @ prepare to put EMIFS to Sleep 398 ldr r8, [r6, #EMIFS_CONFIG_ASM_OFFSET & 0xff] 399 orr r9, r8, #IDLE_EMIFS_REQUEST & 0xff 400 str r9, [r6, #EMIFS_CONFIG_ASM_OFFSET & 0xff] 401 402 - @ load base address of ARM_IDLECT1 and ARM_IDLECT2 403 mov r4, #CLKGEN_REG_ASM_BASE & 0xff000000 404 orr r4, r4, #CLKGEN_REG_ASM_BASE & 0x00ff0000 405 orr r4, r4, #CLKGEN_REG_ASM_BASE & 0x0000ff00 406 407 - @ turn off clock domains 408 - @ do not disable PERCK (0x04) 409 mov r5, #OMAP1610_IDLECT2_SLEEP_VAL & 0xff 410 orr r5, r5, #OMAP1610_IDLECT2_SLEEP_VAL & 0xff00 411 strh r5, [r4, #ARM_IDLECT2_ASM_OFFSET & 0xff] 412 413 - @ request ARM idle 414 mov r3, #OMAP1610_IDLECT1_SLEEP_VAL & 0xff 415 orr r3, r3, #OMAP1610_IDLECT1_SLEEP_VAL & 0xff00 416 strh r3, [r4, #ARM_IDLECT1_ASM_OFFSET & 0xff] 417 - 418 - @ disable instruction cache 419 - mrc p15, 0, r9, c1, c0, 0 420 - bic r2, r9, #0x1000 421 - mcr p15, 0, r2, c1, c0, 0 422 - nop 423 424 /* 425 * Let's wait for the next wake up event to wake us up. r0 can't be ··· 421 */ 422 mov r2, #0 423 mcr p15, 0, r2, c7, c0, 4 @ wait for interrupt 424 /* 425 * omap1610_cpu_suspend()'s resume point. 426 * 427 * It will just start executing here, so we'll restore stuff from the 428 * stack. 429 */ 430 - @ re-enable Icache 431 - mcr p15, 0, r9, c1, c0, 0 432 - 433 - @ reset the ARM_IDLECT1 and ARM_IDLECT2. 434 strh r1, [r4, #ARM_IDLECT2_ASM_OFFSET & 0xff] 435 strh r0, [r4, #ARM_IDLECT1_ASM_OFFSET & 0xff] 436 ··· 517 str r7, [r6, #EMIFF_SDRAM_CONFIG_ASM_OFFSET & 0xff] 518 str r8, [r6, #EMIFS_CONFIG_ASM_OFFSET & 0xff] 519 520 - @ restore regs and return 521 ldmfd sp!, {r0 - r12, pc} 522 523 ENTRY(omap1610_cpu_suspend_sz)
··· 1 /* 2 + * linux/arch/arm/mach-omap1/sleep.S 3 * 4 * Low-level OMAP730/1510/1610 sleep/wakeUp support 5 * ··· 383 mcr p15, 0, r0, c7, c10, 4 384 nop 385 386 + @ Load base address of Traffic Controller 387 mov r6, #TCMIF_ASM_BASE & 0xff000000 388 orr r6, r6, #TCMIF_ASM_BASE & 0x00ff0000 389 orr r6, r6, #TCMIF_ASM_BASE & 0x0000ff00 390 391 + @ Prepare to put SDRAM into self-refresh manually 392 ldr r7, [r6, #EMIFF_SDRAM_CONFIG_ASM_OFFSET & 0xff] 393 orr r9, r7, #SELF_REFRESH_MODE & 0xff000000 394 orr r9, r9, #SELF_REFRESH_MODE & 0x000000ff 395 str r9, [r6, #EMIFF_SDRAM_CONFIG_ASM_OFFSET & 0xff] 396 397 + @ Prepare to put EMIFS to Sleep 398 ldr r8, [r6, #EMIFS_CONFIG_ASM_OFFSET & 0xff] 399 orr r9, r8, #IDLE_EMIFS_REQUEST & 0xff 400 str r9, [r6, #EMIFS_CONFIG_ASM_OFFSET & 0xff] 401 402 + @ Load base address of ARM_IDLECT1 and ARM_IDLECT2 403 mov r4, #CLKGEN_REG_ASM_BASE & 0xff000000 404 orr r4, r4, #CLKGEN_REG_ASM_BASE & 0x00ff0000 405 orr r4, r4, #CLKGEN_REG_ASM_BASE & 0x0000ff00 406 407 + @ Turn off clock domains 408 + @ Do not disable PERCK (0x04) 409 mov r5, #OMAP1610_IDLECT2_SLEEP_VAL & 0xff 410 orr r5, r5, #OMAP1610_IDLECT2_SLEEP_VAL & 0xff00 411 strh r5, [r4, #ARM_IDLECT2_ASM_OFFSET & 0xff] 412 413 + @ Request ARM idle 414 mov r3, #OMAP1610_IDLECT1_SLEEP_VAL & 0xff 415 orr r3, r3, #OMAP1610_IDLECT1_SLEEP_VAL & 0xff00 416 strh r3, [r4, #ARM_IDLECT1_ASM_OFFSET & 0xff] 417 418 /* 419 * Let's wait for the next wake up event to wake us up. r0 can't be ··· 427 */ 428 mov r2, #0 429 mcr p15, 0, r2, c7, c0, 4 @ wait for interrupt 430 + 431 + @ Errata (HEL3SU467, section 1.4.4) specifies nop-instructions 432 + @ according to this formula: 433 + @ 2 + (4*DPLL_MULT)/DPLL_DIV/ARMDIV 434 + @ Max DPLL_MULT = 18 435 + @ DPLL_DIV = 1 436 + @ ARMDIV = 1 437 + @ => 74 nop-instructions 438 + nop 439 + nop 440 + nop 441 + nop 442 + nop 443 + nop 444 + nop 445 + nop 446 + nop 447 + nop @10 448 + nop 449 + nop 450 + nop 451 + nop 452 + nop 453 + nop 454 + nop 455 + nop 456 + nop 457 + nop @20 458 + nop 459 + nop 460 + nop 461 + nop 462 + nop 463 + nop 464 + nop 465 + nop 466 + nop 467 + nop @30 468 + nop 469 + nop 470 + nop 471 + nop 472 + nop 473 + nop 474 + nop 475 + nop 476 + nop 477 + nop @40 478 + nop 479 + nop 480 + nop 481 + nop 482 + nop 483 + nop 484 + nop 485 + nop 486 + nop 487 + nop @50 488 + nop 489 + nop 490 + nop 491 + nop 492 + nop 493 + nop 494 + nop 495 + nop 496 + nop 497 + nop @60 498 + nop 499 + nop 500 + nop 501 + nop 502 + nop 503 + nop 504 + nop 505 + nop 506 + nop 507 + nop @70 508 + nop 509 + nop 510 + nop 511 + nop @74 512 /* 513 * omap1610_cpu_suspend()'s resume point. 514 * 515 * It will just start executing here, so we'll restore stuff from the 516 * stack. 517 */ 518 + @ Restore the ARM_IDLECT1 and ARM_IDLECT2. 519 strh r1, [r4, #ARM_IDLECT2_ASM_OFFSET & 0xff] 520 strh r0, [r4, #ARM_IDLECT1_ASM_OFFSET & 0xff] 521 ··· 444 str r7, [r6, #EMIFF_SDRAM_CONFIG_ASM_OFFSET & 0xff] 445 str r8, [r6, #EMIFS_CONFIG_ASM_OFFSET & 0xff] 446 447 + @ Restore regs and return 448 ldmfd sp!, {r0 - r12, pc} 449 450 ENTRY(omap1610_cpu_suspend_sz)
+120 -21
arch/arm/plat-omap/sram.c
··· 16 #include <linux/kernel.h> 17 #include <linux/init.h> 18 19 - #include <asm/mach/map.h> 20 #include <asm/tlb.h> 21 #include <asm/io.h> 22 #include <asm/cacheflush.h> 23 24 #include <asm/arch/sram.h> 25 26 #define OMAP1_SRAM_PA 0x20000000 27 #define OMAP1_SRAM_VA 0xd0000000 28 #define OMAP2_SRAM_PA 0x40200000 29 #define OMAP2_SRAM_VA 0xd0000000 30 31 #define SRAM_BOOTLOADER_SZ 0x80 32 33 static unsigned long omap_sram_base; 34 static unsigned long omap_sram_size; 35 static unsigned long omap_sram_ceil; 36 37 /* 38 * The amount of SRAM depends on the core type. ··· 112 */ 113 void __init omap_detect_sram(void) 114 { 115 - if (!cpu_is_omap24xx()) 116 omap_sram_base = OMAP1_SRAM_VA; 117 - else 118 - omap_sram_base = OMAP2_SRAM_VA; 119 120 - if (cpu_is_omap730()) 121 - omap_sram_size = 0x32000; /* 200K */ 122 - else if (cpu_is_omap15xx()) 123 - omap_sram_size = 0x30000; /* 192K */ 124 - else if (cpu_is_omap1610() || cpu_is_omap1621() || cpu_is_omap1710()) 125 - omap_sram_size = 0x4000; /* 16K */ 126 - else if (cpu_is_omap1611()) 127 - omap_sram_size = 0x3e800; /* 250K */ 128 - else if (cpu_is_omap2420()) 129 - omap_sram_size = 0xa0014; /* 640K */ 130 - else { 131 - printk(KERN_ERR "Could not detect SRAM size\n"); 132 - omap_sram_size = 0x4000; 133 } 134 - 135 omap_sram_ceil = omap_sram_base + omap_sram_size; 136 } 137 ··· 169 */ 170 void __init omap_map_sram(void) 171 { 172 if (omap_sram_size == 0) 173 return; 174 175 if (cpu_is_omap24xx()) { 176 omap_sram_io_desc[0].virtual = OMAP2_SRAM_VA; 177 - omap_sram_io_desc[0].pfn = __phys_to_pfn(OMAP2_SRAM_PA); 178 } 179 180 omap_sram_io_desc[0].length = (omap_sram_size + PAGE_SIZE-1)/PAGE_SIZE; ··· 190 iotable_init(omap_sram_io_desc, ARRAY_SIZE(omap_sram_io_desc)); 191 192 printk(KERN_INFO "SRAM: Mapped pa 0x%08lx to va 0x%08lx size: 0x%lx\n", 193 - omap_sram_io_desc[0].pfn, omap_sram_io_desc[0].virtual, 194 omap_sram_io_desc[0].length); 195 196 /* ··· 216 printk(KERN_ERR "Not enough space in SRAM\n"); 217 return NULL; 218 } 219 omap_sram_ceil -= size; 220 - omap_sram_ceil &= ~0x3; 221 memcpy((void *)omap_sram_ceil, start, size); 222 223 return (void *)omap_sram_ceil;
··· 16 #include <linux/kernel.h> 17 #include <linux/init.h> 18 19 #include <asm/tlb.h> 20 #include <asm/io.h> 21 #include <asm/cacheflush.h> 22 23 + #include <asm/mach/map.h> 24 + 25 #include <asm/arch/sram.h> 26 + #include <asm/arch/board.h> 27 28 #define OMAP1_SRAM_PA 0x20000000 29 #define OMAP1_SRAM_VA 0xd0000000 30 #define OMAP2_SRAM_PA 0x40200000 31 + #define OMAP2_SRAM_PUB_PA 0x4020f800 32 #define OMAP2_SRAM_VA 0xd0000000 33 + #define OMAP2_SRAM_PUB_VA 0xd0000800 34 35 + #if defined(CONFIG_ARCH_OMAP24XX) 36 + #define SRAM_BOOTLOADER_SZ 0x00 37 + #else 38 #define SRAM_BOOTLOADER_SZ 0x80 39 + #endif 40 + 41 + #define VA_REQINFOPERM0 IO_ADDRESS(0x68005048) 42 + #define VA_READPERM0 IO_ADDRESS(0x68005050) 43 + #define VA_WRITEPERM0 IO_ADDRESS(0x68005058) 44 + #define VA_CONTROL_STAT IO_ADDRESS(0x480002F8) 45 + #define GP_DEVICE 0x300 46 + #define TYPE_MASK 0x700 47 + 48 + #define ROUND_DOWN(value,boundary) ((value) & (~((boundary)-1))) 49 50 static unsigned long omap_sram_base; 51 static unsigned long omap_sram_size; 52 static unsigned long omap_sram_ceil; 53 + 54 + unsigned long omap_fb_sram_start; 55 + unsigned long omap_fb_sram_size; 56 + 57 + /* Depending on the target RAMFS firewall setup, the public usable amount of 58 + * SRAM varies. The default accessable size for all device types is 2k. A GP 59 + * device allows ARM11 but not other initators for full size. This 60 + * functionality seems ok until some nice security API happens. 61 + */ 62 + static int is_sram_locked(void) 63 + { 64 + int type = 0; 65 + 66 + if (cpu_is_omap242x()) 67 + type = __raw_readl(VA_CONTROL_STAT) & TYPE_MASK; 68 + 69 + if (type == GP_DEVICE) { 70 + /* RAMFW: R/W access to all initators for all qualifier sets */ 71 + if (cpu_is_omap242x()) { 72 + __raw_writel(0xFF, VA_REQINFOPERM0); /* all q-vects */ 73 + __raw_writel(0xCFDE, VA_READPERM0); /* all i-read */ 74 + __raw_writel(0xCFDE, VA_WRITEPERM0); /* all i-write */ 75 + } 76 + return 0; 77 + } else 78 + return 1; /* assume locked with no PPA or security driver */ 79 + } 80 + 81 + void get_fb_sram_conf(unsigned long start_avail, unsigned size_avail, 82 + unsigned long *start, unsigned long *size) 83 + { 84 + const struct omap_fbmem_config *fbmem_conf; 85 + 86 + fbmem_conf = omap_get_config(OMAP_TAG_FBMEM, struct omap_fbmem_config); 87 + if (fbmem_conf != NULL) { 88 + *start = fbmem_conf->fb_sram_start; 89 + *size = fbmem_conf->fb_sram_size; 90 + } else { 91 + *size = 0; 92 + *start = 0; 93 + } 94 + 95 + if (*size && ( 96 + *start < start_avail || 97 + *start + *size > start_avail + size_avail)) { 98 + printk(KERN_ERR "invalid FB SRAM configuration\n"); 99 + *start = start_avail; 100 + *size = size_avail; 101 + } 102 + 103 + if (*size) 104 + pr_info("Reserving %lu bytes SRAM for frame buffer\n", *size); 105 + } 106 107 /* 108 * The amount of SRAM depends on the core type. ··· 42 */ 43 void __init omap_detect_sram(void) 44 { 45 + unsigned long sram_start; 46 + 47 + if (cpu_is_omap24xx()) { 48 + if (is_sram_locked()) { 49 + omap_sram_base = OMAP2_SRAM_PUB_VA; 50 + sram_start = OMAP2_SRAM_PUB_PA; 51 + omap_sram_size = 0x800; /* 2K */ 52 + } else { 53 + omap_sram_base = OMAP2_SRAM_VA; 54 + sram_start = OMAP2_SRAM_PA; 55 + if (cpu_is_omap242x()) 56 + omap_sram_size = 0xa0000; /* 640K */ 57 + else if (cpu_is_omap243x()) 58 + omap_sram_size = 0x10000; /* 64K */ 59 + } 60 + } else { 61 omap_sram_base = OMAP1_SRAM_VA; 62 + sram_start = OMAP1_SRAM_PA; 63 64 + if (cpu_is_omap730()) 65 + omap_sram_size = 0x32000; /* 200K */ 66 + else if (cpu_is_omap15xx()) 67 + omap_sram_size = 0x30000; /* 192K */ 68 + else if (cpu_is_omap1610() || cpu_is_omap1621() || 69 + cpu_is_omap1710()) 70 + omap_sram_size = 0x4000; /* 16K */ 71 + else if (cpu_is_omap1611()) 72 + omap_sram_size = 0x3e800; /* 250K */ 73 + else { 74 + printk(KERN_ERR "Could not detect SRAM size\n"); 75 + omap_sram_size = 0x4000; 76 + } 77 } 78 + get_fb_sram_conf(sram_start + SRAM_BOOTLOADER_SZ, 79 + omap_sram_size - SRAM_BOOTLOADER_SZ, 80 + &omap_fb_sram_start, &omap_fb_sram_size); 81 + if (omap_fb_sram_size) 82 + omap_sram_size -= sram_start + omap_sram_size - 83 + omap_fb_sram_start; 84 omap_sram_ceil = omap_sram_base + omap_sram_size; 85 } 86 ··· 80 */ 81 void __init omap_map_sram(void) 82 { 83 + unsigned long base; 84 + 85 if (omap_sram_size == 0) 86 return; 87 88 if (cpu_is_omap24xx()) { 89 omap_sram_io_desc[0].virtual = OMAP2_SRAM_VA; 90 + 91 + if (is_sram_locked()) 92 + base = OMAP2_SRAM_PUB_PA; 93 + else 94 + base = OMAP2_SRAM_PA; 95 + base = ROUND_DOWN(base, PAGE_SIZE); 96 + omap_sram_io_desc[0].pfn = __phys_to_pfn(base); 97 } 98 99 omap_sram_io_desc[0].length = (omap_sram_size + PAGE_SIZE-1)/PAGE_SIZE; ··· 93 iotable_init(omap_sram_io_desc, ARRAY_SIZE(omap_sram_io_desc)); 94 95 printk(KERN_INFO "SRAM: Mapped pa 0x%08lx to va 0x%08lx size: 0x%lx\n", 96 + __pfn_to_phys(omap_sram_io_desc[0].pfn), 97 + omap_sram_io_desc[0].virtual, 98 omap_sram_io_desc[0].length); 99 100 /* ··· 118 printk(KERN_ERR "Not enough space in SRAM\n"); 119 return NULL; 120 } 121 + 122 omap_sram_ceil -= size; 123 + omap_sram_ceil = ROUND_DOWN(omap_sram_ceil, sizeof(void *)); 124 memcpy((void *)omap_sram_ceil, start, size); 125 126 return (void *)omap_sram_ceil;
+325
arch/arm/plat-omap/timer32k.c
···
··· 1 + /* 2 + * linux/arch/arm/plat-omap/timer32k.c 3 + * 4 + * OMAP 32K Timer 5 + * 6 + * Copyright (C) 2004 - 2005 Nokia Corporation 7 + * Partial timer rewrite and additional dynamic tick timer support by 8 + * Tony Lindgen <tony@atomide.com> and 9 + * Tuukka Tikkanen <tuukka.tikkanen@elektrobit.com> 10 + * 11 + * MPU timer code based on the older MPU timer code for OMAP 12 + * Copyright (C) 2000 RidgeRun, Inc. 13 + * Author: Greg Lonnon <glonnon@ridgerun.com> 14 + * 15 + * This program is free software; you can redistribute it and/or modify it 16 + * under the terms of the GNU General Public License as published by the 17 + * Free Software Foundation; either version 2 of the License, or (at your 18 + * option) any later version. 19 + * 20 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED 21 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 22 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN 23 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 24 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 25 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 26 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 27 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 29 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 + * 31 + * You should have received a copy of the GNU General Public License along 32 + * with this program; if not, write to the Free Software Foundation, Inc., 33 + * 675 Mass Ave, Cambridge, MA 02139, USA. 34 + */ 35 + 36 + #include <linux/config.h> 37 + #include <linux/kernel.h> 38 + #include <linux/init.h> 39 + #include <linux/delay.h> 40 + #include <linux/interrupt.h> 41 + #include <linux/sched.h> 42 + #include <linux/spinlock.h> 43 + #include <linux/err.h> 44 + #include <linux/clk.h> 45 + 46 + #include <asm/system.h> 47 + #include <asm/hardware.h> 48 + #include <asm/io.h> 49 + #include <asm/leds.h> 50 + #include <asm/irq.h> 51 + #include <asm/mach/irq.h> 52 + #include <asm/mach/time.h> 53 + 54 + struct sys_timer omap_timer; 55 + 56 + /* 57 + * --------------------------------------------------------------------------- 58 + * 32KHz OS timer 59 + * 60 + * This currently works only on 16xx, as 1510 does not have the continuous 61 + * 32KHz synchronous timer. The 32KHz synchronous timer is used to keep track 62 + * of time in addition to the 32KHz OS timer. Using only the 32KHz OS timer 63 + * on 1510 would be possible, but the timer would not be as accurate as 64 + * with the 32KHz synchronized timer. 65 + * --------------------------------------------------------------------------- 66 + */ 67 + 68 + #if defined(CONFIG_ARCH_OMAP16XX) 69 + #define TIMER_32K_SYNCHRONIZED 0xfffbc410 70 + #elif defined(CONFIG_ARCH_OMAP24XX) 71 + #define TIMER_32K_SYNCHRONIZED 0x48004010 72 + #else 73 + #error OMAP 32KHz timer does not currently work on 15XX! 74 + #endif 75 + 76 + /* 16xx specific defines */ 77 + #define OMAP1_32K_TIMER_BASE 0xfffb9000 78 + #define OMAP1_32K_TIMER_CR 0x08 79 + #define OMAP1_32K_TIMER_TVR 0x00 80 + #define OMAP1_32K_TIMER_TCR 0x04 81 + 82 + /* 24xx specific defines */ 83 + #define OMAP2_GP_TIMER_BASE 0x48028000 84 + #define CM_CLKSEL_WKUP 0x48008440 85 + #define GP_TIMER_TIDR 0x00 86 + #define GP_TIMER_TISR 0x18 87 + #define GP_TIMER_TIER 0x1c 88 + #define GP_TIMER_TCLR 0x24 89 + #define GP_TIMER_TCRR 0x28 90 + #define GP_TIMER_TLDR 0x2c 91 + #define GP_TIMER_TTGR 0x30 92 + #define GP_TIMER_TSICR 0x40 93 + 94 + #define OMAP_32K_TICKS_PER_HZ (32768 / HZ) 95 + 96 + /* 97 + * TRM says 1 / HZ = ( TVR + 1) / 32768, so TRV = (32768 / HZ) - 1 98 + * so with HZ = 128, TVR = 255. 99 + */ 100 + #define OMAP_32K_TIMER_TICK_PERIOD ((32768 / HZ) - 1) 101 + 102 + #define JIFFIES_TO_HW_TICKS(nr_jiffies, clock_rate) \ 103 + (((nr_jiffies) * (clock_rate)) / HZ) 104 + 105 + static inline void omap_32k_timer_write(int val, int reg) 106 + { 107 + if (cpu_class_is_omap1()) 108 + omap_writew(val, OMAP1_32K_TIMER_BASE + reg); 109 + 110 + if (cpu_is_omap24xx()) 111 + omap_writel(val, OMAP2_GP_TIMER_BASE + reg); 112 + } 113 + 114 + static inline unsigned long omap_32k_timer_read(int reg) 115 + { 116 + if (cpu_class_is_omap1()) 117 + return omap_readl(OMAP1_32K_TIMER_BASE + reg) & 0xffffff; 118 + 119 + if (cpu_is_omap24xx()) 120 + return omap_readl(OMAP2_GP_TIMER_BASE + reg); 121 + } 122 + 123 + /* 124 + * The 32KHz synchronized timer is an additional timer on 16xx. 125 + * It is always running. 126 + */ 127 + static inline unsigned long omap_32k_sync_timer_read(void) 128 + { 129 + return omap_readl(TIMER_32K_SYNCHRONIZED); 130 + } 131 + 132 + static inline void omap_32k_timer_start(unsigned long load_val) 133 + { 134 + if (cpu_class_is_omap1()) { 135 + omap_32k_timer_write(load_val, OMAP1_32K_TIMER_TVR); 136 + omap_32k_timer_write(0x0f, OMAP1_32K_TIMER_CR); 137 + } 138 + 139 + if (cpu_is_omap24xx()) { 140 + omap_32k_timer_write(0xffffffff - load_val, GP_TIMER_TCRR); 141 + omap_32k_timer_write((1 << 1), GP_TIMER_TIER); 142 + omap_32k_timer_write((1 << 1) | 1, GP_TIMER_TCLR); 143 + } 144 + } 145 + 146 + static inline void omap_32k_timer_stop(void) 147 + { 148 + if (cpu_class_is_omap1()) 149 + omap_32k_timer_write(0x0, OMAP1_32K_TIMER_CR); 150 + 151 + if (cpu_is_omap24xx()) 152 + omap_32k_timer_write(0x0, GP_TIMER_TCLR); 153 + } 154 + 155 + /* 156 + * Rounds down to nearest usec. Note that this will overflow for larger values. 157 + */ 158 + static inline unsigned long omap_32k_ticks_to_usecs(unsigned long ticks_32k) 159 + { 160 + return (ticks_32k * 5*5*5*5*5*5) >> 9; 161 + } 162 + 163 + /* 164 + * Rounds down to nearest nsec. 165 + */ 166 + static inline unsigned long long 167 + omap_32k_ticks_to_nsecs(unsigned long ticks_32k) 168 + { 169 + return (unsigned long long) ticks_32k * 1000 * 5*5*5*5*5*5 >> 9; 170 + } 171 + 172 + static unsigned long omap_32k_last_tick = 0; 173 + 174 + /* 175 + * Returns elapsed usecs since last 32k timer interrupt 176 + */ 177 + static unsigned long omap_32k_timer_gettimeoffset(void) 178 + { 179 + unsigned long now = omap_32k_sync_timer_read(); 180 + return omap_32k_ticks_to_usecs(now - omap_32k_last_tick); 181 + } 182 + 183 + /* 184 + * Returns current time from boot in nsecs. It's OK for this to wrap 185 + * around for now, as it's just a relative time stamp. 186 + */ 187 + unsigned long long sched_clock(void) 188 + { 189 + return omap_32k_ticks_to_nsecs(omap_32k_sync_timer_read()); 190 + } 191 + 192 + /* 193 + * Timer interrupt for 32KHz timer. When dynamic tick is enabled, this 194 + * function is also called from other interrupts to remove latency 195 + * issues with dynamic tick. In the dynamic tick case, we need to lock 196 + * with irqsave. 197 + */ 198 + static irqreturn_t omap_32k_timer_interrupt(int irq, void *dev_id, 199 + struct pt_regs *regs) 200 + { 201 + unsigned long flags; 202 + unsigned long now; 203 + 204 + write_seqlock_irqsave(&xtime_lock, flags); 205 + 206 + if (cpu_is_omap24xx()) { 207 + u32 status = omap_32k_timer_read(GP_TIMER_TISR); 208 + omap_32k_timer_write(status, GP_TIMER_TISR); 209 + } 210 + 211 + now = omap_32k_sync_timer_read(); 212 + 213 + while (now - omap_32k_last_tick >= OMAP_32K_TICKS_PER_HZ) { 214 + omap_32k_last_tick += OMAP_32K_TICKS_PER_HZ; 215 + timer_tick(regs); 216 + } 217 + 218 + /* Restart timer so we don't drift off due to modulo or dynamic tick. 219 + * By default we program the next timer to be continuous to avoid 220 + * latencies during high system load. During dynamic tick operation the 221 + * continuous timer can be overridden from pm_idle to be longer. 222 + */ 223 + omap_32k_timer_start(omap_32k_last_tick + OMAP_32K_TICKS_PER_HZ - now); 224 + write_sequnlock_irqrestore(&xtime_lock, flags); 225 + 226 + return IRQ_HANDLED; 227 + } 228 + 229 + #ifdef CONFIG_NO_IDLE_HZ 230 + /* 231 + * Programs the next timer interrupt needed. Called when dynamic tick is 232 + * enabled, and to reprogram the ticks to skip from pm_idle. Note that 233 + * we can keep the timer continuous, and don't need to set it to run in 234 + * one-shot mode. This is because the timer will get reprogrammed again 235 + * after next interrupt. 236 + */ 237 + void omap_32k_timer_reprogram(unsigned long next_tick) 238 + { 239 + omap_32k_timer_start(JIFFIES_TO_HW_TICKS(next_tick, 32768) + 1); 240 + } 241 + 242 + static struct irqaction omap_32k_timer_irq; 243 + extern struct timer_update_handler timer_update; 244 + 245 + static int omap_32k_timer_enable_dyn_tick(void) 246 + { 247 + /* No need to reprogram timer, just use the next interrupt */ 248 + return 0; 249 + } 250 + 251 + static int omap_32k_timer_disable_dyn_tick(void) 252 + { 253 + omap_32k_timer_start(OMAP_32K_TIMER_TICK_PERIOD); 254 + return 0; 255 + } 256 + 257 + static struct dyn_tick_timer omap_dyn_tick_timer = { 258 + .enable = omap_32k_timer_enable_dyn_tick, 259 + .disable = omap_32k_timer_disable_dyn_tick, 260 + .reprogram = omap_32k_timer_reprogram, 261 + .handler = omap_32k_timer_interrupt, 262 + }; 263 + #endif /* CONFIG_NO_IDLE_HZ */ 264 + 265 + static struct irqaction omap_32k_timer_irq = { 266 + .name = "32KHz timer", 267 + .flags = SA_INTERRUPT | SA_TIMER, 268 + .handler = omap_32k_timer_interrupt, 269 + }; 270 + 271 + static struct clk * gpt1_ick; 272 + static struct clk * gpt1_fck; 273 + 274 + static __init void omap_init_32k_timer(void) 275 + { 276 + #ifdef CONFIG_NO_IDLE_HZ 277 + omap_timer.dyn_tick = &omap_dyn_tick_timer; 278 + #endif 279 + 280 + if (cpu_class_is_omap1()) 281 + setup_irq(INT_OS_TIMER, &omap_32k_timer_irq); 282 + if (cpu_is_omap24xx()) 283 + setup_irq(37, &omap_32k_timer_irq); 284 + omap_timer.offset = omap_32k_timer_gettimeoffset; 285 + omap_32k_last_tick = omap_32k_sync_timer_read(); 286 + 287 + /* REVISIT: Check 24xx TIOCP_CFG settings after idle works */ 288 + if (cpu_is_omap24xx()) { 289 + omap_32k_timer_write(0, GP_TIMER_TCLR); 290 + omap_writel(0, CM_CLKSEL_WKUP); /* 32KHz clock source */ 291 + 292 + gpt1_ick = clk_get(NULL, "gpt1_ick"); 293 + if (IS_ERR(gpt1_ick)) 294 + printk(KERN_ERR "Could not get gpt1_ick\n"); 295 + else 296 + clk_enable(gpt1_ick); 297 + 298 + gpt1_fck = clk_get(NULL, "gpt1_fck"); 299 + if (IS_ERR(gpt1_fck)) 300 + printk(KERN_ERR "Could not get gpt1_fck\n"); 301 + else 302 + clk_enable(gpt1_fck); 303 + 304 + mdelay(100); /* Wait for clocks to stabilize */ 305 + 306 + omap_32k_timer_write(0x7, GP_TIMER_TISR); 307 + } 308 + 309 + omap_32k_timer_start(OMAP_32K_TIMER_TICK_PERIOD); 310 + } 311 + 312 + /* 313 + * --------------------------------------------------------------------------- 314 + * Timer initialization 315 + * --------------------------------------------------------------------------- 316 + */ 317 + static void __init omap_timer_init(void) 318 + { 319 + omap_init_32k_timer(); 320 + } 321 + 322 + struct sys_timer omap_timer = { 323 + .init = omap_timer_init, 324 + .offset = NULL, /* Initialized later */ 325 + };
+24
include/asm-arm/arch-at91rm9200/board.h
··· 38 extern int at91_serial_map[AT91_NR_UART]; 39 extern int at91_console_port; 40 41 /* USB Device */ 42 struct at91_udc_data { 43 u8 vbus_pin; /* high == host powering us */ ··· 78 u8 ports; /* number of ports on root hub */ 79 }; 80 extern void __init at91_add_device_usbh(struct at91_usbh_data *data); 81 82 #endif
··· 38 extern int at91_serial_map[AT91_NR_UART]; 39 extern int at91_console_port; 40 41 + #include <linux/mtd/partitions.h> 42 + 43 /* USB Device */ 44 struct at91_udc_data { 45 u8 vbus_pin; /* high == host powering us */ ··· 76 u8 ports; /* number of ports on root hub */ 77 }; 78 extern void __init at91_add_device_usbh(struct at91_usbh_data *data); 79 + 80 + /* NAND / SmartMedia */ 81 + struct at91_nand_data { 82 + u8 enable_pin; /* chip enable */ 83 + u8 det_pin; /* card detect */ 84 + u8 rdy_pin; /* ready/busy */ 85 + u8 ale; /* address line number connected to ALE */ 86 + u8 cle; /* address line number connected to CLE */ 87 + struct mtd_partition* (*partition_info)(int, int*); 88 + }; 89 + extern void __init at91_add_device_nand(struct at91_nand_data *data); 90 + 91 + /* I2C*/ 92 + void __init at91_add_device_i2c(void); 93 + 94 + /* RTC */ 95 + void __init at91_add_device_rtc(void); 96 + 97 + /* LEDs */ 98 + extern u8 at91_leds_cpu; 99 + extern u8 at91_leds_timer; 100 + extern void __init at91_init_leds(u8 cpu_led, u8 timer_led); 101 102 #endif
+11
include/asm-arm/arch-ep93xx/ts72xx.h
··· 12 * febfc000 [67]0000000 4K NAND data register 13 * febfb000 [67]0400000 4K NAND control register 14 * febfa000 [67]0800000 4K NAND busy register 15 */ 16 17 #define TS72XX_MODEL_PHYS_BASE 0x22000000 ··· 58 #define TS72XX_NAND2_BUSY_PHYS_BASE 0x70800000 59 #define TS72XX_NAND_BUSY_VIRT_BASE 0xfebfa000 60 #define TS72XX_NAND_BUSY_SIZE 0x00001000 61 62 63 #ifndef __ASSEMBLY__
··· 12 * febfc000 [67]0000000 4K NAND data register 13 * febfb000 [67]0400000 4K NAND control register 14 * febfa000 [67]0800000 4K NAND busy register 15 + * febf9000 10800000 4K TS-5620 RTC index register 16 + * febf8000 11700000 4K TS-5620 RTC data register 17 */ 18 19 #define TS72XX_MODEL_PHYS_BASE 0x22000000 ··· 56 #define TS72XX_NAND2_BUSY_PHYS_BASE 0x70800000 57 #define TS72XX_NAND_BUSY_VIRT_BASE 0xfebfa000 58 #define TS72XX_NAND_BUSY_SIZE 0x00001000 59 + 60 + 61 + #define TS72XX_RTC_INDEX_VIRT_BASE 0xfebf9000 62 + #define TS72XX_RTC_INDEX_PHYS_BASE 0x10800000 63 + #define TS72XX_RTC_INDEX_SIZE 0x00001000 64 + 65 + #define TS72XX_RTC_DATA_VIRT_BASE 0xfebf8000 66 + #define TS72XX_RTC_DATA_PHYS_BASE 0x11700000 67 + #define TS72XX_RTC_DATA_SIZE 0x00001000 68 69 70 #ifndef __ASSEMBLY__
+3 -14
include/asm-arm/arch-imx/dma.h
··· 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 */ 20 #ifndef __ASM_ARCH_DMA_H 21 #define __ASM_ARCH_DMA_H 22 23 - /* 24 - * DMA registration 25 - */ 26 - 27 typedef enum { 28 DMA_PRIO_HIGH = 0, 29 - DMA_PRIO_MEDIUM = 3, 30 - DMA_PRIO_LOW = 6 31 } imx_dma_prio; 32 - 33 - int imx_request_dma(char *name, imx_dma_prio prio, 34 - void (*irq_handler) (int, void *, struct pt_regs *), 35 - void (*err_handler) (int, void *, struct pt_regs *), 36 - void *data); 37 - 38 - void imx_free_dma(int dma_ch); 39 - 40 41 #define DMA_REQ_UART3_T 2 42 #define DMA_REQ_UART3_R 3
··· 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 */ 20 + 21 #ifndef __ASM_ARCH_DMA_H 22 #define __ASM_ARCH_DMA_H 23 24 typedef enum { 25 DMA_PRIO_HIGH = 0, 26 + DMA_PRIO_MEDIUM = 1, 27 + DMA_PRIO_LOW = 2 28 } imx_dma_prio; 29 30 #define DMA_REQ_UART3_T 2 31 #define DMA_REQ_UART3_R 3
+90
include/asm-arm/arch-imx/imx-dma.h
···
··· 1 + /* 2 + * linux/include/asm-arm/imxads/dma.h 3 + * 4 + * Copyright (C) 1997,1998 Russell King 5 + * 6 + * This program is free software; you can redistribute it and/or modify 7 + * it under the terms of the GNU General Public License as published by 8 + * the Free Software Foundation; either version 2 of the License, or 9 + * (at your option) any later version. 10 + * 11 + * This program is distributed in the hope that it will be useful, 12 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 + * GNU General Public License for more details. 15 + * 16 + * You should have received a copy of the GNU General Public License 17 + * along with this program; if not, write to the Free Software 18 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 + */ 20 + 21 + #include <asm/dma.h> 22 + 23 + #ifndef __ASM_ARCH_IMX_DMA_H 24 + #define __ASM_ARCH_IMX_DMA_H 25 + 26 + #define IMX_DMA_CHANNELS 11 27 + 28 + /* 29 + * struct imx_dma_channel - i.MX specific DMA extension 30 + * @name: name specified by DMA client 31 + * @irq_handler: client callback for end of transfer 32 + * @err_handler: client callback for error condition 33 + * @data: clients context data for callbacks 34 + * @dma_mode: direction of the transfer %DMA_MODE_READ or %DMA_MODE_WRITE 35 + * @sg: pointer to the actual read/written chunk for scatter-gather emulation 36 + * @sgbc: counter of processed bytes in the actual read/written chunk 37 + * @resbytes: total residual number of bytes to transfer 38 + * (it can be lower or same as sum of SG mapped chunk sizes) 39 + * @sgcount: number of chunks to be read/written 40 + * 41 + * Structure is used for IMX DMA processing. It would be probably good 42 + * @struct dma_struct in the future for external interfacing and use 43 + * @struct imx_dma_channel only as extension to it. 44 + */ 45 + 46 + struct imx_dma_channel { 47 + const char *name; 48 + void (*irq_handler) (int, void *, struct pt_regs *); 49 + void (*err_handler) (int, void *, struct pt_regs *); 50 + void *data; 51 + dmamode_t dma_mode; 52 + struct scatterlist *sg; 53 + unsigned int sgbc; 54 + unsigned int sgcount; 55 + unsigned int resbytes; 56 + int dma_num; 57 + }; 58 + 59 + extern struct imx_dma_channel imx_dma_channels[IMX_DMA_CHANNELS]; 60 + 61 + 62 + /* The type to distinguish channel numbers parameter from ordinal int type */ 63 + typedef int imx_dmach_t; 64 + 65 + int 66 + imx_dma_setup_single(imx_dmach_t dma_ch, dma_addr_t dma_address, 67 + unsigned int dma_length, unsigned int dev_addr, dmamode_t dmamode); 68 + 69 + int 70 + imx_dma_setup_sg(imx_dmach_t dma_ch, 71 + struct scatterlist *sg, unsigned int sgcount, unsigned int dma_length, 72 + unsigned int dev_addr, dmamode_t dmamode); 73 + 74 + int 75 + imx_dma_setup_handlers(imx_dmach_t dma_ch, 76 + void (*irq_handler) (int, void *, struct pt_regs *), 77 + void (*err_handler) (int, void *, struct pt_regs *), void *data); 78 + 79 + void imx_dma_enable(imx_dmach_t dma_ch); 80 + 81 + void imx_dma_disable(imx_dmach_t dma_ch); 82 + 83 + int imx_dma_request(imx_dmach_t dma_ch, const char *name); 84 + 85 + void imx_dma_free(imx_dmach_t dma_ch); 86 + 87 + int imx_dma_request_by_prio(imx_dmach_t *pdma_ch, const char *name, imx_dma_prio prio); 88 + 89 + 90 + #endif /* _ASM_ARCH_IMX_DMA_H */
+17
include/asm-arm/arch-ixp23xx/memory.h
··· 28 * to an address that the kernel can use. 29 */ 30 #ifndef __ASSEMBLY__ 31 32 #define __virt_to_bus(v) \ 33 ({ unsigned int ret; \ ··· 40 ({ unsigned int data; \ 41 data = *((volatile int *)IXP23XX_PCI_SDRAM_BAR); \ 42 __phys_to_virt((((b - (data & 0xfffffff0)) + 0x00000000))); }) 43 44 #endif 45
··· 28 * to an address that the kernel can use. 29 */ 30 #ifndef __ASSEMBLY__ 31 + #include <asm/mach-types.h> 32 33 #define __virt_to_bus(v) \ 34 ({ unsigned int ret; \ ··· 39 ({ unsigned int data; \ 40 data = *((volatile int *)IXP23XX_PCI_SDRAM_BAR); \ 41 __phys_to_virt((((b - (data & 0xfffffff0)) + 0x00000000))); }) 42 + 43 + /* 44 + * Coherency support. Only supported on A2 CPUs or on A1 45 + * systems that have the cache coherency workaround. 46 + */ 47 + static inline int __ixp23xx_arch_is_coherent(void) 48 + { 49 + extern unsigned int processor_id; 50 + 51 + if (((processor_id & 15) >= 2) || machine_is_roadrunner()) 52 + return 1; 53 + 54 + return 0; 55 + } 56 + 57 + #define arch_is_coherent() __ixp23xx_arch_is_coherent() 58 59 #endif 60
+1
include/asm-arm/arch-ixp23xx/platform.h
··· 22 int ixp23xx_pci_setup(int, struct pci_sys_data *); 23 void ixp23xx_pci_preinit(void); 24 struct pci_bus *ixp23xx_pci_scan_bus(int, struct pci_sys_data*); 25 26 extern struct sys_timer ixp23xx_timer; 27
··· 22 int ixp23xx_pci_setup(int, struct pci_sys_data *); 23 void ixp23xx_pci_preinit(void); 24 struct pci_bus *ixp23xx_pci_scan_bus(int, struct pci_sys_data*); 25 + void ixp23xx_pci_slave_init(void); 26 27 extern struct sys_timer ixp23xx_timer; 28
+4
include/asm-arm/arch-omap/aic23.h
··· 57 #define LHV_MIN 0x0000 58 59 // Analog audio path control register 60 #define STE_ENABLED 0x0020 61 #define DAC_SELECTED 0x0010 62 #define BYPASS_ON 0x0008 ··· 109 110 #define TLV320AIC23ID1 (0x1a) // cs low 111 #define TLV320AIC23ID2 (0x1b) // cs high 112 113 #endif /* __ASM_ARCH_AIC23_H */
··· 57 #define LHV_MIN 0x0000 58 59 // Analog audio path control register 60 + #define STA_REG(x) ((x)<<6) 61 #define STE_ENABLED 0x0020 62 #define DAC_SELECTED 0x0010 63 #define BYPASS_ON 0x0008 ··· 108 109 #define TLV320AIC23ID1 (0x1a) // cs low 110 #define TLV320AIC23ID2 (0x1b) // cs high 111 + 112 + void tlv320aic23_power_up(void); 113 + void tlv320aic23_power_down(void); 114 115 #endif /* __ASM_ARCH_AIC23_H */
+65
include/asm-arm/arch-omap/board-ams-delta.h
···
··· 1 + /* 2 + * linux/include/asm-arm/arch-omap/board-ams-delta.h 3 + * 4 + * Copyright (C) 2006 Jonathan McDowell <noodles@earth.li> 5 + * 6 + * This program is free software; you can redistribute it and/or modify it 7 + * under the terms of the GNU General Public License as published by the 8 + * Free Software Foundation; either version 2 of the License, or (at your 9 + * option) any later version. 10 + * 11 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED 12 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 13 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN 14 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 15 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 16 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 17 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 18 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 19 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 20 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 21 + * 22 + * You should have received a copy of the GNU General Public License along 23 + * with this program; if not, write to the Free Software Foundation, Inc., 24 + * 675 Mass Ave, Cambridge, MA 02139, USA. 25 + */ 26 + #ifndef __ASM_ARCH_OMAP_AMS_DELTA_H 27 + #define __ASM_ARCH_OMAP_AMS_DELTA_H 28 + 29 + #if defined (CONFIG_MACH_AMS_DELTA) 30 + 31 + #define AMS_DELTA_LATCH1_PHYS 0x01000000 32 + #define AMS_DELTA_LATCH1_VIRT 0xEA000000 33 + #define AMS_DELTA_MODEM_PHYS 0x04000000 34 + #define AMS_DELTA_MODEM_VIRT 0xEB000000 35 + #define AMS_DELTA_LATCH2_PHYS 0x08000000 36 + #define AMS_DELTA_LATCH2_VIRT 0xEC000000 37 + 38 + #define AMS_DELTA_LATCH1_LED_CAMERA 0x01 39 + #define AMS_DELTA_LATCH1_LED_ADVERT 0x02 40 + #define AMS_DELTA_LATCH1_LED_EMAIL 0x04 41 + #define AMS_DELTA_LATCH1_LED_HANDSFREE 0x08 42 + #define AMS_DELTA_LATCH1_LED_VOICEMAIL 0x10 43 + #define AMS_DELTA_LATCH1_LED_VOICE 0x20 44 + 45 + #define AMS_DELTA_LATCH2_LCD_VBLEN 0x0001 46 + #define AMS_DELTA_LATCH2_LCD_NDISP 0x0002 47 + #define AMS_DELTA_LATCH2_NAND_NCE 0x0004 48 + #define AMS_DELTA_LATCH2_NAND_NRE 0x0008 49 + #define AMS_DELTA_LATCH2_NAND_NWP 0x0010 50 + #define AMS_DELTA_LATCH2_NAND_NWE 0x0020 51 + #define AMS_DELTA_LATCH2_NAND_ALE 0x0040 52 + #define AMS_DELTA_LATCH2_NAND_CLE 0x0080 53 + #define AMS_DELTA_LATCH2_MODEM_NRESET 0x1000 54 + #define AMS_DELTA_LATCH2_MODEM_CODEC 0x2000 55 + 56 + #define AMS_DELTA_GPIO_PIN_NAND_RB 12 57 + 58 + #ifndef __ASSEMBLY__ 59 + void ams_delta_latch1_write(u8 mask, u8 value); 60 + void ams_delta_latch2_write(u16 mask, u16 value); 61 + #endif 62 + 63 + #endif /* CONFIG_MACH_AMS_DELTA */ 64 + 65 + #endif /* __ASM_ARCH_OMAP_AMS_DELTA_H */
+45
include/asm-arm/arch-omap/board-apollon.h
···
··· 1 + /* 2 + * linux/include/asm-arm/arch-omap/board-apollon.h 3 + * 4 + * Hardware definitions for Samsung OMAP24XX Apollon board. 5 + * 6 + * Initial creation by Kyungmin Park <kyungmin.park@samsung.com> 7 + * 8 + * This program is free software; you can redistribute it and/or modify it 9 + * under the terms of the GNU General Public License as published by the 10 + * Free Software Foundation; either version 2 of the License, or (at your 11 + * option) any later version. 12 + * 13 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED 14 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 15 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN 16 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 17 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 18 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 19 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 20 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 + * 24 + * You should have received a copy of the GNU General Public License along 25 + * with this program; if not, write to the Free Software Foundation, Inc., 26 + * 675 Mass Ave, Cambridge, MA 02139, USA. 27 + */ 28 + 29 + #ifndef __ASM_ARCH_OMAP_APOLLON_H 30 + #define __ASM_ARCH_OMAP_APOLLON_H 31 + 32 + /* Placeholder for APOLLON specific defines */ 33 + /* GPMC CS0 */ 34 + #define APOLLON_CS0_BASE 0x00000000 35 + /* GPMC CS1 */ 36 + #define APOLLON_CS1_BASE 0x08000000 37 + #define APOLLON_ETHR_START (APOLLON_CS1_BASE + 0x300) 38 + #define APOLLON_ETHR_GPIO_IRQ 74 39 + /* GPMC CS2 - reserved for OneNAND */ 40 + #define APOLLON_CS2_BASE 0x10000000 41 + /* GPMC CS3 - reserved for NOR or NAND */ 42 + #define APOLLON_CS3_BASE 0x18000000 43 + 44 + #endif /* __ASM_ARCH_OMAP_APOLLON_H */ 45 +
-4
include/asm-arm/arch-omap/board-h2.h
··· 34 /* At OMAP1610 Innovator the Ethernet is directly connected to CS1 */ 35 #define OMAP1610_ETHR_START 0x04000300 36 37 - /* Samsung NAND flash at CS2B or CS3(NAND Boot) */ 38 - #define OMAP_NAND_FLASH_START1 0x0A000000 /* CS2B */ 39 - #define OMAP_NAND_FLASH_START2 0x0C000000 /* CS3 */ 40 - 41 #endif /* __ASM_ARCH_OMAP_H2_H */ 42
··· 34 /* At OMAP1610 Innovator the Ethernet is directly connected to CS1 */ 35 #define OMAP1610_ETHR_START 0x04000300 36 37 #endif /* __ASM_ARCH_OMAP_H2_H */ 38
-4
include/asm-arm/arch-omap/board-h3.h
··· 30 /* In OMAP1710 H3 the Ethernet is directly connected to CS1 */ 31 #define OMAP1710_ETHR_START 0x04000300 32 33 - /* Samsung NAND flash at CS2B or CS3(NAND Boot) */ 34 - #define OMAP_NAND_FLASH_START1 0x0A000000 /* CS2B */ 35 - #define OMAP_NAND_FLASH_START2 0x0C000000 /* CS3 */ 36 - 37 #define MAXIRQNUM (IH_BOARD_BASE) 38 #define MAXFIQNUM MAXIRQNUM 39 #define MAXSWINUM MAXIRQNUM
··· 30 /* In OMAP1710 H3 the Ethernet is directly connected to CS1 */ 31 #define OMAP1710_ETHR_START 0x04000300 32 33 #define MAXIRQNUM (IH_BOARD_BASE) 34 #define MAXFIQNUM MAXIRQNUM 35 #define MAXSWINUM MAXIRQNUM
+1 -7
include/asm-arm/arch-omap/board-h4.h
··· 33 /* GPMC CS1 */ 34 #define OMAP24XX_ETHR_START 0x08000300 35 #define OMAP24XX_ETHR_GPIO_IRQ 92 36 - 37 - #define H4_CS0_BASE 0x04000000 38 - 39 - #define H4_CS0_BASE 0x04000000 40 - 41 - #define H4_CS0_BASE 0x04000000 42 - 43 #endif /* __ASM_ARCH_OMAP_H4_H */ 44
··· 33 /* GPMC CS1 */ 34 #define OMAP24XX_ETHR_START 0x08000300 35 #define OMAP24XX_ETHR_GPIO_IRQ 92 36 + #define H4_CS0_BASE 0x04000000 37 #endif /* __ASM_ARCH_OMAP_H4_H */ 38
-19
include/asm-arm/arch-omap/board-netstar.h
··· 1 - /* 2 - * Copyright (C) 2004 2N Telekomunikace, Ladislav Michl <michl@2n.cz> 3 - * 4 - * Hardware definitions for OMAP5910 based NetStar board. 5 - * 6 - * This program is free software; you can redistribute it and/or modify 7 - * it under the terms of the GNU General Public License version 2 as 8 - * published by the Free Software Foundation. 9 - */ 10 - 11 - #ifndef __ASM_ARCH_NETSTAR_H 12 - #define __ASM_ARCH_NETSTAR_H 13 - 14 - #include <asm/arch/tc.h> 15 - 16 - #define OMAP_NAND_FLASH_START1 OMAP_CS1_PHYS + (1 << 23) 17 - #define OMAP_NAND_FLASH_START2 OMAP_CS1_PHYS + (2 << 23) 18 - 19 - #endif /* __ASM_ARCH_NETSTAR_H */
···
+54
include/asm-arm/arch-omap/board-nokia.h
···
··· 1 + /* 2 + * linux/include/asm-arm/arch-omap/board-nokia.h 3 + * 4 + * Information structures for Nokia-specific board config data 5 + * 6 + * Copyright (C) 2005 Nokia Corporation 7 + */ 8 + 9 + #ifndef _OMAP_BOARD_NOKIA_H 10 + #define _OMAP_BOARD_NOKIA_H 11 + 12 + #include <linux/types.h> 13 + 14 + #define OMAP_TAG_NOKIA_BT 0x4e01 15 + #define OMAP_TAG_WLAN_CX3110X 0x4e02 16 + #define OMAP_TAG_CBUS 0x4e03 17 + #define OMAP_TAG_EM_ASIC_BB5 0x4e04 18 + 19 + 20 + #define BT_CHIP_CSR 1 21 + #define BT_CHIP_TI 2 22 + 23 + #define BT_SYSCLK_12 1 24 + #define BT_SYSCLK_38_4 2 25 + 26 + struct omap_bluetooth_config { 27 + u8 chip_type; 28 + u8 bt_wakeup_gpio; 29 + u8 host_wakeup_gpio; 30 + u8 reset_gpio; 31 + u8 bt_uart; 32 + u8 bd_addr[6]; 33 + u8 bt_sysclk; 34 + }; 35 + 36 + struct omap_wlan_cx3110x_config { 37 + u8 chip_type; 38 + s16 power_gpio; 39 + s16 irq_gpio; 40 + s16 spi_cs_gpio; 41 + }; 42 + 43 + struct omap_cbus_config { 44 + s16 clk_gpio; 45 + s16 dat_gpio; 46 + s16 sel_gpio; 47 + }; 48 + 49 + struct omap_em_asic_bb5_config { 50 + s16 retu_irq_gpio; 51 + s16 tahvo_irq_gpio; 52 + }; 53 + 54 + #endif
-4
include/asm-arm/arch-omap/board-perseus2.h
··· 42 43 #define NR_IRQS (MAXIRQNUM + 1) 44 45 - /* Samsung NAND flash at CS2B or CS3(NAND Boot) */ 46 - #define OMAP_NAND_FLASH_START1 0x0A000000 /* CS2B */ 47 - #define OMAP_NAND_FLASH_START2 0x0C000000 /* CS3 */ 48 - 49 #endif
··· 42 43 #define NR_IRQS (MAXIRQNUM + 1) 44 45 #endif
+27 -3
include/asm-arm/arch-omap/board.h
··· 21 #define OMAP_TAG_LCD 0x4f05 22 #define OMAP_TAG_GPIO_SWITCH 0x4f06 23 #define OMAP_TAG_UART 0x4f07 24 25 #define OMAP_TAG_BOOT_REASON 0x4f80 26 #define OMAP_TAG_FLASH_PART 0x4f81 27 28 struct omap_clock_config { 29 /* 0 for 12 MHz, 1 for 13 MHz and 2 for 19.2 MHz */ ··· 55 struct omap_serial_console_config { 56 u8 console_uart; 57 u32 console_speed; 58 }; 59 60 struct omap_usb_config { ··· 95 char ctrl_name[16]; 96 }; 97 98 /* Cover: 99 * high -> closed 100 * low -> open ··· 121 int key_code:24; /* Linux key code */ 122 }; 123 124 struct omap_flash_part_config { 125 char part_table[0]; 126 }; ··· 135 char reason_str[12]; 136 }; 137 138 - struct omap_uart_config { 139 - /* Bit field of UARTs present; bit 0 --> UART1 */ 140 - unsigned int enabled_uarts; 141 }; 142 143 struct omap_board_config_entry { 144 u16 tag;
··· 21 #define OMAP_TAG_LCD 0x4f05 22 #define OMAP_TAG_GPIO_SWITCH 0x4f06 23 #define OMAP_TAG_UART 0x4f07 24 + #define OMAP_TAG_FBMEM 0x4f08 25 + #define OMAP_TAG_STI_CONSOLE 0x4f09 26 27 #define OMAP_TAG_BOOT_REASON 0x4f80 28 #define OMAP_TAG_FLASH_PART 0x4f81 29 + #define OMAP_TAG_VERSION_STR 0x4f82 30 31 struct omap_clock_config { 32 /* 0 for 12 MHz, 1 for 13 MHz and 2 for 19.2 MHz */ ··· 52 struct omap_serial_console_config { 53 u8 console_uart; 54 u32 console_speed; 55 + }; 56 + 57 + struct omap_sti_console_config { 58 + unsigned enable:1; 59 + u8 channel; 60 }; 61 62 struct omap_usb_config { ··· 87 char ctrl_name[16]; 88 }; 89 90 + struct omap_fbmem_config { 91 + u32 fb_sram_start; 92 + u32 fb_sram_size; 93 + u32 fb_sdram_start; 94 + u32 fb_sdram_size; 95 + }; 96 + 97 /* Cover: 98 * high -> closed 99 * low -> open ··· 106 int key_code:24; /* Linux key code */ 107 }; 108 109 + struct omap_uart_config { 110 + /* Bit field of UARTs present; bit 0 --> UART1 */ 111 + unsigned int enabled_uarts; 112 + }; 113 + 114 + 115 struct omap_flash_part_config { 116 char part_table[0]; 117 }; ··· 114 char reason_str[12]; 115 }; 116 117 + struct omap_version_config { 118 + char component[12]; 119 + char version[12]; 120 }; 121 + 122 + 123 + #include <asm-arm/arch-omap/board-nokia.h> 124 125 struct omap_board_config_entry { 126 u16 tag;
+8 -5
include/asm-arm/arch-omap/clock.h
··· 19 struct list_head node; 20 struct module *owner; 21 const char *name; 22 struct clk *parent; 23 unsigned long rate; 24 __u32 flags; ··· 58 extern void followparent_recalc(struct clk * clk); 59 extern void clk_allow_idle(struct clk *clk); 60 extern void clk_deny_idle(struct clk *clk); 61 62 /* Clock flags */ 63 #define RATE_CKCTL (1 << 0) /* Main fixed ratio clocks */ ··· 82 #define CM_PLL_SEL1 (1 << 18) 83 #define CM_PLL_SEL2 (1 << 19) 84 #define CM_SYSCLKOUT_SEL1 (1 << 20) 85 - #define CLOCK_IN_OMAP730 (1 << 21) 86 - #define CLOCK_IN_OMAP1510 (1 << 22) 87 - #define CLOCK_IN_OMAP16XX (1 << 23) 88 - #define CLOCK_IN_OMAP242X (1 << 24) 89 - #define CLOCK_IN_OMAP243X (1 << 25) 90 91 #endif
··· 19 struct list_head node; 20 struct module *owner; 21 const char *name; 22 + int id; 23 struct clk *parent; 24 unsigned long rate; 25 __u32 flags; ··· 57 extern void followparent_recalc(struct clk * clk); 58 extern void clk_allow_idle(struct clk *clk); 59 extern void clk_deny_idle(struct clk *clk); 60 + extern int clk_get_usecount(struct clk *clk); 61 62 /* Clock flags */ 63 #define RATE_CKCTL (1 << 0) /* Main fixed ratio clocks */ ··· 80 #define CM_PLL_SEL1 (1 << 18) 81 #define CM_PLL_SEL2 (1 << 19) 82 #define CM_SYSCLKOUT_SEL1 (1 << 20) 83 + #define CLOCK_IN_OMAP310 (1 << 21) 84 + #define CLOCK_IN_OMAP730 (1 << 22) 85 + #define CLOCK_IN_OMAP1510 (1 << 23) 86 + #define CLOCK_IN_OMAP16XX (1 << 24) 87 + #define CLOCK_IN_OMAP242X (1 << 25) 88 + #define CLOCK_IN_OMAP243X (1 << 26) 89 90 #endif
+1
include/asm-arm/arch-omap/dma.h
··· 404 extern void omap_setup_lcd_dma(void); 405 extern void omap_enable_lcd_dma(void); 406 extern void omap_stop_lcd_dma(void); 407 extern void omap_set_lcd_dma_ext_controller(int external); 408 extern void omap_set_lcd_dma_single_transfer(int single); 409 extern void omap_set_lcd_dma_b1(unsigned long addr, u16 fb_xres, u16 fb_yres,
··· 404 extern void omap_setup_lcd_dma(void); 405 extern void omap_enable_lcd_dma(void); 406 extern void omap_stop_lcd_dma(void); 407 + extern int omap_lcd_dma_ext_running(void); 408 extern void omap_set_lcd_dma_ext_controller(int external); 409 extern void omap_set_lcd_dma_single_transfer(int single); 410 extern void omap_set_lcd_dma_b1(unsigned long addr, u16 fb_xres, u16 fb_yres,
+1
include/asm-arm/arch-omap/dmtimer.h
··· 88 void omap_dm_timer_reset_counter(struct omap_dm_timer *timer); 89 90 int omap_dm_timers_active(void); 91 92 #endif /* __ASM_ARCH_TIMER_H */
··· 88 void omap_dm_timer_reset_counter(struct omap_dm_timer *timer); 89 90 int omap_dm_timers_active(void); 91 + u32 omap_dm_timer_modify_idlect_mask(u32 inputmask); 92 93 #endif /* __ASM_ARCH_TIMER_H */
+6
include/asm-arm/arch-omap/dsp.h
··· 181 #define OMAP_DSP_MBCMD_PM_ENABLE 0x01 182 183 #define OMAP_DSP_MBCMD_KFUNC_FBCTL 0x00 184 185 #define OMAP_DSP_MBCMD_FBCTL_ENABLE 0x0002 186 #define OMAP_DSP_MBCMD_FBCTL_DISABLE 0x0003 187 188 #define OMAP_DSP_MBCMD_TDEL_SAFE 0x0000 189 #define OMAP_DSP_MBCMD_TDEL_KILL 0x0001
··· 181 #define OMAP_DSP_MBCMD_PM_ENABLE 0x01 182 183 #define OMAP_DSP_MBCMD_KFUNC_FBCTL 0x00 184 + #define OMAP_DSP_MBCMD_KFUNC_AUDIO_PWR 0x01 185 186 + #define OMAP_DSP_MBCMD_FBCTL_UPD 0x0000 187 #define OMAP_DSP_MBCMD_FBCTL_ENABLE 0x0002 188 #define OMAP_DSP_MBCMD_FBCTL_DISABLE 0x0003 189 + 190 + #define OMAP_DSP_MBCMD_AUDIO_PWR_UP 0x0000 191 + #define OMAP_DSP_MBCMD_AUDIO_PWR_DOWN1 0x0001 192 + #define OMAP_DSP_MBCMD_AUDIO_PWR_DOWN2 0x0002 193 194 #define OMAP_DSP_MBCMD_TDEL_SAFE 0x0000 195 #define OMAP_DSP_MBCMD_TDEL_KILL 0x0001
+7 -6
include/asm-arm/arch-omap/dsp_common.h
··· 27 #ifndef ASM_ARCH_DSP_COMMON_H 28 #define ASM_ARCH_DSP_COMMON_H 29 30 - void omap_dsp_pm_suspend(void); 31 - void omap_dsp_pm_resume(void); 32 - void omap_dsp_request_mpui(void); 33 - void omap_dsp_release_mpui(void); 34 - int omap_dsp_request_mem(void); 35 - int omap_dsp_release_mem(void); 36 37 #endif /* ASM_ARCH_DSP_COMMON_H */
··· 27 #ifndef ASM_ARCH_DSP_COMMON_H 28 #define ASM_ARCH_DSP_COMMON_H 29 30 + extern void omap_dsp_request_mpui(void); 31 + extern void omap_dsp_release_mpui(void); 32 + extern int omap_dsp_request_mem(void); 33 + extern int omap_dsp_release_mem(void); 34 + 35 + extern void (*omap_dsp_audio_pwr_up_request)(int stage); 36 + extern void (*omap_dsp_audio_pwr_down_request)(int stage); 37 38 #endif /* ASM_ARCH_DSP_COMMON_H */
+24
include/asm-arm/arch-omap/gpioexpander.h
···
··· 1 + /* 2 + * linux/include/asm-arm/arch-omap/gpioexpander.h 3 + * 4 + * 5 + * Copyright (C) 2004 Texas Instruments, Inc. 6 + * 7 + * This package is free software; you can redistribute it and/or modify 8 + * it under the terms of the GNU General Public License version 2 as 9 + * published by the Free Software Foundation. 10 + * 11 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 12 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 13 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 14 + */ 15 + 16 + #ifndef __ASM_ARCH_OMAP_GPIOEXPANDER_H 17 + #define __ASM_ARCH_OMAP_GPIOEXPANDER_H 18 + 19 + /* Function Prototypes for GPIO Expander functions */ 20 + 21 + int read_gpio_expa(u8 *, int); 22 + int write_gpio_expa(u8 , int); 23 + 24 + #endif /* __ASM_ARCH_OMAP_GPIOEXPANDER_H */
+4 -4
include/asm-arm/arch-omap/hardware.h
··· 306 #include "board-h4.h" 307 #endif 308 309 #ifdef CONFIG_MACH_OMAP_OSK 310 #include "board-osk.h" 311 #endif 312 313 #ifdef CONFIG_MACH_VOICEBLUE 314 #include "board-voiceblue.h" 315 - #endif 316 - 317 - #ifdef CONFIG_MACH_NETSTAR 318 - #include "board-netstar.h" 319 #endif 320 321 #endif /* !__ASSEMBLER__ */
··· 306 #include "board-h4.h" 307 #endif 308 309 + #ifdef CONFIG_MACH_OMAP_APOLLON 310 + #include "board-apollon.h" 311 + #endif 312 + 313 #ifdef CONFIG_MACH_OMAP_OSK 314 #include "board-osk.h" 315 #endif 316 317 #ifdef CONFIG_MACH_VOICEBLUE 318 #include "board-voiceblue.h" 319 #endif 320 321 #endif /* !__ASSEMBLER__ */
+36
include/asm-arm/arch-omap/irda.h
···
··· 1 + /* 2 + * linux/include/asm-arm/arch-omap/irda.h 3 + * 4 + * Copyright (C) 2005-2006 Komal Shah <komal_shah802003@yahoo.com> 5 + * 6 + * This program is free software; you can redistribute it and/or modify 7 + * it under the terms of the GNU General Public License version 2 as 8 + * published by the Free Software Foundation. 9 + */ 10 + #ifndef ASMARM_ARCH_IRDA_H 11 + #define ASMARM_ARCH_IRDA_H 12 + 13 + /* board specific transceiver capabilities */ 14 + 15 + #define IR_SEL 1 /* Selects IrDA */ 16 + #define IR_SIRMODE 2 17 + #define IR_FIRMODE 4 18 + #define IR_MIRMODE 8 19 + 20 + struct omap_irda_config { 21 + int transceiver_cap; 22 + int (*transceiver_mode)(struct device *dev, int mode); 23 + int (*select_irda)(struct device *dev, int state); 24 + /* Very specific to the needs of some platforms (h3,h4) 25 + * having calls which can sleep in irda_set_speed. 26 + */ 27 + struct work_struct gpio_expa; 28 + int rx_channel; 29 + int tx_channel; 30 + unsigned long dest_start; 31 + unsigned long src_start; 32 + int tx_trigger; 33 + int rx_trigger; 34 + }; 35 + 36 + #endif
+5
include/asm-arm/arch-omap/irqs.h
··· 242 #define INT_24XX_GPIO_BANK2 30 243 #define INT_24XX_GPIO_BANK3 31 244 #define INT_24XX_GPIO_BANK4 32 245 246 /* Max. 128 level 2 IRQs (OMAP1610), 192 GPIOs (OMAP730) and 247 * 16 MPUIO lines */
··· 242 #define INT_24XX_GPIO_BANK2 30 243 #define INT_24XX_GPIO_BANK3 31 244 #define INT_24XX_GPIO_BANK4 32 245 + #define INT_24XX_MCBSP1_IRQ_TX 59 246 + #define INT_24XX_MCBSP1_IRQ_RX 60 247 + #define INT_24XX_MCBSP2_IRQ_TX 62 248 + #define INT_24XX_MCBSP2_IRQ_RX 63 249 + #define INT_24XX_UART3_IRQ 74 250 251 /* Max. 128 level 2 IRQs (OMAP1610), 192 GPIOs (OMAP730) and 252 * 16 MPUIO lines */
+36
include/asm-arm/arch-omap/keypad.h
···
··· 1 + /* 2 + * linux/include/asm-arm/arch-omap/keypad.h 3 + * 4 + * Copyright (C) 2006 Komal Shah <komal_shah802003@yahoo.com> 5 + * 6 + * This program is free software; you can redistribute it and/or modify 7 + * it under the terms of the GNU General Public License version 2 as 8 + * published by the Free Software Foundation. 9 + */ 10 + #ifndef ASMARM_ARCH_KEYPAD_H 11 + #define ASMARM_ARCH_KEYPAD_H 12 + 13 + struct omap_kp_platform_data { 14 + int rows; 15 + int cols; 16 + int *keymap; 17 + unsigned int rep:1; 18 + /* specific to OMAP242x*/ 19 + unsigned int *row_gpios; 20 + unsigned int *col_gpios; 21 + }; 22 + 23 + /* Group (0..3) -- when multiple keys are pressed, only the 24 + * keys pressed in the same group are considered as pressed. This is 25 + * in order to workaround certain crappy HW designs that produce ghost 26 + * keypresses. */ 27 + #define GROUP_0 (0 << 16) 28 + #define GROUP_1 (1 << 16) 29 + #define GROUP_2 (2 << 16) 30 + #define GROUP_3 (3 << 16) 31 + #define GROUP_MASK GROUP_3 32 + 33 + #define KEY(col, row, val) (((col) << 28) | ((row) << 24) | (val)) 34 + 35 + #endif 36 +
+14
include/asm-arm/arch-omap/lcd_lph8923.h
···
··· 1 + #ifndef __LCD_LPH8923_H 2 + #define __LCD_LPH8923_H 3 + 4 + enum lcd_lph8923_test_num { 5 + LCD_LPH8923_TEST_RGB_LINES, 6 + }; 7 + 8 + enum lcd_lph8923_test_result { 9 + LCD_LPH8923_TEST_SUCCESS, 10 + LCD_LPH8923_TEST_INVALID, 11 + LCD_LPH8923_TEST_FAILED, 12 + }; 13 + 14 + #endif
+65
include/asm-arm/arch-omap/mcbsp.h
··· 37 #define OMAP1610_MCBSP2_BASE 0xfffb1000 38 #define OMAP1610_MCBSP3_BASE 0xe1017000 39 40 #define OMAP_MCBSP_REG_DRR2 0x00 41 #define OMAP_MCBSP_REG_DRR1 0x02 42 #define OMAP_MCBSP_REG_DXR2 0x04 ··· 76 77 #define OMAP_MAX_MCBSP_COUNT 3 78 79 #define OMAP_MCBSP_READ(base, reg) __raw_readw((base) + OMAP_MCBSP_REG_##reg) 80 #define OMAP_MCBSP_WRITE(base, reg, val) __raw_writew((val), (base) + OMAP_MCBSP_REG_##reg) 81 82 /************************** McBSP SPCR1 bit definitions ***********************/ 83 #define RRST 0x0001 ··· 253 OMAP_MCBSP3, 254 } omap_mcbsp_id; 255 256 typedef enum { 257 OMAP_MCBSP_WORD_8 = 0, 258 OMAP_MCBSP_WORD_12, ··· 308 309 int omap_mcbsp_xmit_buffer(unsigned int id, dma_addr_t buffer, unsigned int length); 310 int omap_mcbsp_recv_buffer(unsigned int id, dma_addr_t buffer, unsigned int length); 311 312 /* SPI specific API */ 313 void omap_mcbsp_set_spi_mode(unsigned int id, const struct omap_mcbsp_spi_cfg * spi_cfg);
··· 37 #define OMAP1610_MCBSP2_BASE 0xfffb1000 38 #define OMAP1610_MCBSP3_BASE 0xe1017000 39 40 + #define OMAP24XX_MCBSP1_BASE 0x48074000 41 + #define OMAP24XX_MCBSP2_BASE 0x48076000 42 + 43 + #if defined(CONFIG_ARCH_OMAP15XX) || defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP730) 44 + 45 #define OMAP_MCBSP_REG_DRR2 0x00 46 #define OMAP_MCBSP_REG_DRR1 0x02 47 #define OMAP_MCBSP_REG_DXR2 0x04 ··· 71 72 #define OMAP_MAX_MCBSP_COUNT 3 73 74 + #define AUDIO_MCBSP_DATAWRITE (OMAP1510_MCBSP1_BASE + OMAP_MCBSP_REG_DXR1) 75 + #define AUDIO_MCBSP_DATAREAD (OMAP1510_MCBSP1_BASE + OMAP_MCBSP_REG_DRR1) 76 + 77 + #define AUDIO_MCBSP OMAP_MCBSP1 78 + #define AUDIO_DMA_TX OMAP_DMA_MCBSP1_TX 79 + #define AUDIO_DMA_RX OMAP_DMA_MCBSP1_RX 80 + 81 + #elif defined(CONFIG_ARCH_OMAP24XX) 82 + 83 + #define OMAP_MCBSP_REG_DRR2 0x00 84 + #define OMAP_MCBSP_REG_DRR1 0x04 85 + #define OMAP_MCBSP_REG_DXR2 0x08 86 + #define OMAP_MCBSP_REG_DXR1 0x0C 87 + #define OMAP_MCBSP_REG_SPCR2 0x10 88 + #define OMAP_MCBSP_REG_SPCR1 0x14 89 + #define OMAP_MCBSP_REG_RCR2 0x18 90 + #define OMAP_MCBSP_REG_RCR1 0x1C 91 + #define OMAP_MCBSP_REG_XCR2 0x20 92 + #define OMAP_MCBSP_REG_XCR1 0x24 93 + #define OMAP_MCBSP_REG_SRGR2 0x28 94 + #define OMAP_MCBSP_REG_SRGR1 0x2C 95 + #define OMAP_MCBSP_REG_MCR2 0x30 96 + #define OMAP_MCBSP_REG_MCR1 0x34 97 + #define OMAP_MCBSP_REG_RCERA 0x38 98 + #define OMAP_MCBSP_REG_RCERB 0x3C 99 + #define OMAP_MCBSP_REG_XCERA 0x40 100 + #define OMAP_MCBSP_REG_XCERB 0x44 101 + #define OMAP_MCBSP_REG_PCR0 0x48 102 + #define OMAP_MCBSP_REG_RCERC 0x4C 103 + #define OMAP_MCBSP_REG_RCERD 0x50 104 + #define OMAP_MCBSP_REG_XCERC 0x54 105 + #define OMAP_MCBSP_REG_XCERD 0x58 106 + #define OMAP_MCBSP_REG_RCERE 0x5C 107 + #define OMAP_MCBSP_REG_RCERF 0x60 108 + #define OMAP_MCBSP_REG_XCERE 0x64 109 + #define OMAP_MCBSP_REG_XCERF 0x68 110 + #define OMAP_MCBSP_REG_RCERG 0x6C 111 + #define OMAP_MCBSP_REG_RCERH 0x70 112 + #define OMAP_MCBSP_REG_XCERG 0x74 113 + #define OMAP_MCBSP_REG_XCERH 0x78 114 + 115 + #define OMAP_MAX_MCBSP_COUNT 2 116 + 117 + #define AUDIO_MCBSP_DATAWRITE (OMAP24XX_MCBSP2_BASE + OMAP_MCBSP_REG_DXR1) 118 + #define AUDIO_MCBSP_DATAREAD (OMAP24XX_MCBSP2_BASE + OMAP_MCBSP_REG_DRR1) 119 + 120 + #define AUDIO_MCBSP OMAP_MCBSP2 121 + #define AUDIO_DMA_TX OMAP24XX_DMA_MCBSP2_TX 122 + #define AUDIO_DMA_RX OMAP24XX_DMA_MCBSP2_RX 123 + 124 + #endif 125 + 126 #define OMAP_MCBSP_READ(base, reg) __raw_readw((base) + OMAP_MCBSP_REG_##reg) 127 #define OMAP_MCBSP_WRITE(base, reg, val) __raw_writew((val), (base) + OMAP_MCBSP_REG_##reg) 128 + 129 130 /************************** McBSP SPCR1 bit definitions ***********************/ 131 #define RRST 0x0001 ··· 195 OMAP_MCBSP3, 196 } omap_mcbsp_id; 197 198 + typedef int __bitwise omap_mcbsp_io_type_t; 199 + #define OMAP_MCBSP_IRQ_IO ((__force omap_mcbsp_io_type_t) 1) 200 + #define OMAP_MCBSP_POLL_IO ((__force omap_mcbsp_io_type_t) 2) 201 + 202 typedef enum { 203 OMAP_MCBSP_WORD_8 = 0, 204 OMAP_MCBSP_WORD_12, ··· 246 247 int omap_mcbsp_xmit_buffer(unsigned int id, dma_addr_t buffer, unsigned int length); 248 int omap_mcbsp_recv_buffer(unsigned int id, dma_addr_t buffer, unsigned int length); 249 + int omap_mcbsp_spi_master_xmit_word_poll(unsigned int id, u32 word); 250 + int omap_mcbsp_spi_master_recv_word_poll(unsigned int id, u32 * word); 251 + 252 253 /* SPI specific API */ 254 void omap_mcbsp_set_spi_mode(unsigned int id, const struct omap_mcbsp_spi_cfg * spi_cfg);
+16
include/asm-arm/arch-omap/mcspi.h
···
··· 1 + #ifndef _OMAP2_MCSPI_H 2 + #define _OMAP2_MCSPI_H 3 + 4 + struct omap2_mcspi_platform_config { 5 + unsigned long base; 6 + unsigned short num_cs; 7 + }; 8 + 9 + struct omap2_mcspi_device_config { 10 + unsigned turbo_mode:1; 11 + 12 + /* Do we want one channel enabled at the same time? */ 13 + unsigned single_channel:1; 14 + }; 15 + 16 + #endif
+1 -1
include/asm-arm/arch-omap/menelaus.h
··· 7 #ifndef __ASM_ARCH_MENELAUS_H 8 #define __ASM_ARCH_MENELAUS_H 9 10 - extern void menelaus_mmc_register(void (*callback)(u8 card_mask), 11 unsigned long data); 12 extern void menelaus_mmc_remove(void); 13 extern void menelaus_mmc_opendrain(int enable);
··· 7 #ifndef __ASM_ARCH_MENELAUS_H 8 #define __ASM_ARCH_MENELAUS_H 9 10 + extern void menelaus_mmc_register(void (*callback)(unsigned long data, u8 card_mask), 11 unsigned long data); 12 extern void menelaus_mmc_remove(void); 13 extern void menelaus_mmc_opendrain(int enable);
+51 -3
include/asm-arm/arch-omap/mux.h
··· 112 * as mux config 113 */ 114 #define MUX_CFG_730(desc, mux_reg, mode_offset, mode, \ 115 - pull_reg, pull_bit, pull_status, \ 116 - pu_pd_reg, pu_pd_status, debug_status)\ 117 { \ 118 .name = desc, \ 119 .debug = debug_status, \ 120 MUX_REG_730(mux_reg, mode_offset, mode) \ 121 PULL_REG_730(mux_reg, pull_bit, pull_status) \ 122 - PU_PD_REG(pu_pd_reg, pu_pd_status) \ 123 }, 124 125 #define MUX_CFG_24XX(desc, reg_offset, mode, \ ··· 171 E4_730_KBC2, 172 F4_730_KBC3, 173 E3_730_KBC4, 174 }; 175 176 enum omap1xxx_index { ··· 407 /* 24xx Menelaus interrupt */ 408 W19_24XX_SYS_NIRQ, 409 410 /* 24xx GPIO */ 411 Y20_24XX_GPIO60, 412 M15_24XX_GPIO92, 413 }; 414 415 #ifdef CONFIG_OMAP_MUX
··· 112 * as mux config 113 */ 114 #define MUX_CFG_730(desc, mux_reg, mode_offset, mode, \ 115 + pull_bit, pull_status, debug_status)\ 116 { \ 117 .name = desc, \ 118 .debug = debug_status, \ 119 MUX_REG_730(mux_reg, mode_offset, mode) \ 120 PULL_REG_730(mux_reg, pull_bit, pull_status) \ 121 + PU_PD_REG(NA, 0) \ 122 }, 123 124 #define MUX_CFG_24XX(desc, reg_offset, mode, \ ··· 172 E4_730_KBC2, 173 F4_730_KBC3, 174 E3_730_KBC4, 175 + 176 + /* USB */ 177 + AA17_730_USB_DM, 178 + W16_730_USB_PU_EN, 179 + W17_730_USB_VBUSI, 180 }; 181 182 enum omap1xxx_index { ··· 403 /* 24xx Menelaus interrupt */ 404 W19_24XX_SYS_NIRQ, 405 406 + /* 24xx clock */ 407 + W14_24XX_SYS_CLKOUT, 408 + 409 + /* 242X McBSP */ 410 + Y15_24XX_MCBSP2_CLKX, 411 + R14_24XX_MCBSP2_FSX, 412 + W15_24XX_MCBSP2_DR, 413 + V15_24XX_MCBSP2_DX, 414 + 415 /* 24xx GPIO */ 416 + M21_242X_GPIO11, 417 + AA10_242X_GPIO13, 418 + AA6_242X_GPIO14, 419 + AA4_242X_GPIO15, 420 + Y11_242X_GPIO16, 421 + AA12_242X_GPIO17, 422 + AA8_242X_GPIO58, 423 Y20_24XX_GPIO60, 424 + W4__24XX_GPIO74, 425 M15_24XX_GPIO92, 426 + V14_24XX_GPIO117, 427 + 428 + P20_24XX_TSC_IRQ, 429 + 430 + /* UART3 */ 431 + K15_24XX_UART3_TX, 432 + K14_24XX_UART3_RX, 433 + 434 + /* Keypad GPIO*/ 435 + T19_24XX_KBR0, 436 + R19_24XX_KBR1, 437 + V18_24XX_KBR2, 438 + M21_24XX_KBR3, 439 + E5__24XX_KBR4, 440 + M18_24XX_KBR5, 441 + R20_24XX_KBC0, 442 + M14_24XX_KBC1, 443 + H19_24XX_KBC2, 444 + V17_24XX_KBC3, 445 + P21_24XX_KBC4, 446 + L14_24XX_KBC5, 447 + N19_24XX_KBC6, 448 + 449 + /* 24xx Menelaus Keypad GPIO */ 450 + B3__24XX_KBR5, 451 + AA4_24XX_KBC2, 452 + B13_24XX_KBC6, 453 }; 454 455 #ifdef CONFIG_OMAP_MUX
+124
include/asm-arm/arch-omap/omap-alsa.h
···
··· 1 + /* 2 + * linux/include/asm-arm/arch-omap/omap-alsa.h 3 + * 4 + * Alsa Driver for AIC23 and TSC2101 codecs on OMAP platform boards. 5 + * 6 + * Copyright (C) 2006 Mika Laitio <lamikr@cc.jyu.fi> 7 + * 8 + * Copyright (C) 2005 Instituto Nokia de Tecnologia - INdT - Manaus Brazil 9 + * Written by Daniel Petrini, David Cohen, Anderson Briglia 10 + * {daniel.petrini, david.cohen, anderson.briglia}@indt.org.br 11 + * 12 + * This program is free software; you can redistribute it and/or modify it 13 + * under the terms of the GNU General Public License as published by the 14 + * Free Software Foundation; either version 2 of the License, or (at your 15 + * option) any later version. 16 + * 17 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED 18 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 19 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN 20 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 23 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 24 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 + * 28 + * You should have received a copy of the GNU General Public License along 29 + * with this program; if not, write to the Free Software Foundation, Inc., 30 + * 675 Mass Ave, Cambridge, MA 02139, USA. 31 + * 32 + * History 33 + * ------- 34 + * 35 + * 2005/07/25 INdT-10LE Kernel Team - Alsa driver for omap osk, 36 + * original version based in sa1100 driver 37 + * and omap oss driver. 38 + */ 39 + 40 + #ifndef __OMAP_ALSA_H 41 + #define __OMAP_ALSA_H 42 + 43 + #include <sound/driver.h> 44 + #include <asm/arch/dma.h> 45 + #include <sound/core.h> 46 + #include <sound/pcm.h> 47 + #include <asm/arch/mcbsp.h> 48 + #include <linux/platform_device.h> 49 + 50 + #define DMA_BUF_SIZE (1024 * 8) 51 + 52 + /* 53 + * Buffer management for alsa and dma 54 + */ 55 + struct audio_stream { 56 + char *id; /* identification string */ 57 + int stream_id; /* numeric identification */ 58 + int dma_dev; /* dma number of that device */ 59 + int *lch; /* Chain of channels this stream is linked to */ 60 + char started; /* to store if the chain was started or not */ 61 + int dma_q_head; /* DMA Channel Q Head */ 62 + int dma_q_tail; /* DMA Channel Q Tail */ 63 + char dma_q_count; /* DMA Channel Q Count */ 64 + int active:1; /* we are using this stream for transfer now */ 65 + int period; /* current transfer period */ 66 + int periods; /* current count of periods registerd in the DMA engine */ 67 + spinlock_t dma_lock; /* for locking in DMA operations */ 68 + snd_pcm_substream_t *stream; /* the pcm stream */ 69 + unsigned linked:1; /* dma channels linked */ 70 + int offset; /* store start position of the last period in the alsa buffer */ 71 + int (*hw_start)(void); /* interface to start HW interface, e.g. McBSP */ 72 + int (*hw_stop)(void); /* interface to stop HW interface, e.g. McBSP */ 73 + }; 74 + 75 + /* 76 + * Alsa card structure for aic23 77 + */ 78 + struct snd_card_omap_codec { 79 + snd_card_t *card; 80 + snd_pcm_t *pcm; 81 + long samplerate; 82 + struct audio_stream s[2]; /* playback & capture */ 83 + }; 84 + 85 + /* Codec specific information and function pointers. 86 + * Codec (omap-alsa-aic23.c and omap-alsa-tsc2101.c) 87 + * are responsible for defining the function pointers. 88 + */ 89 + struct omap_alsa_codec_config { 90 + char *name; 91 + struct omap_mcbsp_reg_cfg *mcbsp_regs_alsa; 92 + snd_pcm_hw_constraint_list_t *hw_constraints_rates; 93 + snd_pcm_hardware_t *snd_omap_alsa_playback; 94 + snd_pcm_hardware_t *snd_omap_alsa_capture; 95 + void (*codec_configure_dev)(void); 96 + void (*codec_set_samplerate)(long); 97 + void (*codec_clock_setup)(void); 98 + int (*codec_clock_on)(void); 99 + int (*codec_clock_off)(void); 100 + int (*get_default_samplerate)(void); 101 + }; 102 + 103 + /*********** Mixer function prototypes *************************/ 104 + int snd_omap_mixer(struct snd_card_omap_codec *); 105 + void snd_omap_init_mixer(void); 106 + 107 + #ifdef CONFIG_PM 108 + void snd_omap_suspend_mixer(void); 109 + void snd_omap_resume_mixer(void); 110 + #endif 111 + 112 + int snd_omap_alsa_post_probe(struct platform_device *pdev, struct omap_alsa_codec_config *config); 113 + int snd_omap_alsa_remove(struct platform_device *pdev); 114 + #ifdef CONFIG_PM 115 + int snd_omap_alsa_suspend(struct platform_device *pdev, pm_message_t state); 116 + int snd_omap_alsa_resume(struct platform_device *pdev); 117 + #else 118 + #define snd_omap_alsa_suspend NULL 119 + #define snd_omap_alsa_resume NULL 120 + #endif 121 + 122 + void callback_omap_alsa_sound_dma(void *); 123 + 124 + #endif
+71 -27
include/asm-arm/arch-omap/omapfb.h
··· 34 #define OMAPFB_MIRROR OMAP_IOW(31, int) 35 #define OMAPFB_SYNC_GFX OMAP_IO(37) 36 #define OMAPFB_VSYNC OMAP_IO(38) 37 - #define OMAPFB_SET_UPDATE_MODE OMAP_IOW(40, enum omapfb_update_mode) 38 #define OMAPFB_GET_CAPS OMAP_IOR(42, unsigned long) 39 - #define OMAPFB_GET_UPDATE_MODE OMAP_IOW(43, enum omapfb_update_mode) 40 #define OMAPFB_LCD_TEST OMAP_IOW(45, int) 41 #define OMAPFB_CTRL_TEST OMAP_IOW(46, int) 42 #define OMAPFB_UPDATE_WINDOW OMAP_IOW(47, struct omapfb_update_window) ··· 67 }; 68 69 struct omapfb_update_window { 70 - u32 x, y; 71 - u32 width, height; 72 - u32 format; 73 }; 74 75 enum omapfb_plane { ··· 89 }; 90 91 struct omapfb_setup_plane { 92 - u8 plane; 93 - u8 channel_out; 94 - u32 offset; 95 - u32 pos_x, pos_y; 96 - u32 width, height; 97 - u32 color_mode; 98 }; 99 100 struct omapfb_enable_plane { 101 - u8 plane; 102 - u8 enable; 103 }; 104 105 enum omapfb_color_key_type { ··· 109 }; 110 111 struct omapfb_color_key { 112 - u8 channel_out; 113 - u32 background; 114 - u32 trans_key; 115 - u8 key_type; 116 }; 117 118 enum omapfb_update_mode { ··· 126 #include <linux/completion.h> 127 #include <linux/interrupt.h> 128 #include <linux/fb.h> 129 130 #define OMAP_LCDC_INV_VSYNC 0x0001 131 #define OMAP_LCDC_INV_HSYNC 0x0002 ··· 193 int re_cycle_time; 194 int cs_pulse_width; 195 int access_time; 196 }; 197 198 struct lcd_ctrl_extif { 199 int (*init) (void); 200 void (*cleanup) (void); 201 void (*set_timings) (const struct extif_timings *timings); 202 - void (*write_command) (u32 cmd); 203 - u32 (*read_data) (void); 204 - void (*write_data) (u32 data); 205 void (*transfer_area) (int width, int height, 206 void (callback)(void * data), void *data); 207 }; 208 209 struct lcd_ctrl { 210 const char *name; ··· 232 int (*init) (struct omapfb_device *fbdev, 233 int ext_mode, int req_vram_size); 234 void (*cleanup) (void); 235 void (*get_vram_layout)(unsigned long *size, 236 void **virt_base, 237 dma_addr_t *phys_base); 238 unsigned long (*get_caps) (void); 239 int (*set_update_mode)(enum omapfb_update_mode mode); 240 enum omapfb_update_mode (*get_update_mode)(void); ··· 270 int state; 271 int ext_lcdc; /* Using external 272 LCD controller */ 273 - struct semaphore rqueue_sema; 274 275 void *vram_virt_base; 276 dma_addr_t vram_phys_base; ··· 291 struct device *dev; 292 }; 293 294 - extern struct lcd_panel h3_panel; 295 - extern struct lcd_panel h2_panel; 296 - extern struct lcd_panel p2_panel; 297 - extern struct lcd_panel osk_panel; 298 - extern struct lcd_panel innovator1610_panel; 299 - extern struct lcd_panel innovator1510_panel; 300 301 #ifdef CONFIG_ARCH_OMAP1 302 extern struct lcd_ctrl omap1_lcd_ctrl; ··· 305 extern struct lcd_ctrl omap2_disp_ctrl; 306 #endif 307 308 extern void omapfb_write_first_pixel(struct omapfb_device *fbdev, u16 pixval); 309 310 #endif /* __KERNEL__ */ 311
··· 34 #define OMAPFB_MIRROR OMAP_IOW(31, int) 35 #define OMAPFB_SYNC_GFX OMAP_IO(37) 36 #define OMAPFB_VSYNC OMAP_IO(38) 37 + #define OMAPFB_SET_UPDATE_MODE OMAP_IOW(40, int) 38 + #define OMAPFB_UPDATE_WINDOW_OLD OMAP_IOW(41, struct omapfb_update_window_old) 39 #define OMAPFB_GET_CAPS OMAP_IOR(42, unsigned long) 40 + #define OMAPFB_GET_UPDATE_MODE OMAP_IOW(43, int) 41 #define OMAPFB_LCD_TEST OMAP_IOW(45, int) 42 #define OMAPFB_CTRL_TEST OMAP_IOW(46, int) 43 #define OMAPFB_UPDATE_WINDOW OMAP_IOW(47, struct omapfb_update_window) ··· 66 }; 67 68 struct omapfb_update_window { 69 + __u32 x, y; 70 + __u32 width, height; 71 + __u32 format; 72 + }; 73 + 74 + struct omapfb_update_window_old { 75 + __u32 x, y; 76 + __u32 width, height; 77 }; 78 79 enum omapfb_plane { ··· 83 }; 84 85 struct omapfb_setup_plane { 86 + __u8 plane; 87 + __u8 channel_out; 88 + __u32 offset; 89 + __u32 pos_x, pos_y; 90 + __u32 width, height; 91 + __u32 color_mode; 92 }; 93 94 struct omapfb_enable_plane { 95 + __u8 plane; 96 + __u8 enable; 97 }; 98 99 enum omapfb_color_key_type { ··· 103 }; 104 105 struct omapfb_color_key { 106 + __u8 channel_out; 107 + __u32 background; 108 + __u32 trans_key; 109 + __u8 key_type; 110 }; 111 112 enum omapfb_update_mode { ··· 120 #include <linux/completion.h> 121 #include <linux/interrupt.h> 122 #include <linux/fb.h> 123 + #include <linux/mutex.h> 124 + 125 + #include <asm/arch/board.h> 126 127 #define OMAP_LCDC_INV_VSYNC 0x0001 128 #define OMAP_LCDC_INV_HSYNC 0x0002 ··· 184 int re_cycle_time; 185 int cs_pulse_width; 186 int access_time; 187 + 188 + int clk_div; 189 + 190 + u32 tim[5]; /* set by extif->convert_timings */ 191 + 192 + int converted; 193 }; 194 195 struct lcd_ctrl_extif { 196 int (*init) (void); 197 void (*cleanup) (void); 198 + void (*get_clk_info) (u32 *clk_period, u32 *max_clk_div); 199 + int (*convert_timings) (struct extif_timings *timings); 200 void (*set_timings) (const struct extif_timings *timings); 201 + void (*set_bits_per_cycle)(int bpc); 202 + void (*write_command) (const void *buf, unsigned int len); 203 + void (*read_data) (void *buf, unsigned int len); 204 + void (*write_data) (const void *buf, unsigned int len); 205 void (*transfer_area) (int width, int height, 206 void (callback)(void * data), void *data); 207 + unsigned long max_transmit_size; 208 }; 209 + 210 + struct omapfb_notifier_block { 211 + struct notifier_block nb; 212 + void *data; 213 + }; 214 + 215 + typedef int (*omapfb_notifier_callback_t)(struct omapfb_notifier_block *, 216 + unsigned long event, 217 + struct omapfb_device *fbdev); 218 219 struct lcd_ctrl { 220 const char *name; ··· 204 int (*init) (struct omapfb_device *fbdev, 205 int ext_mode, int req_vram_size); 206 void (*cleanup) (void); 207 + void (*bind_client) (struct omapfb_notifier_block *nb); 208 void (*get_vram_layout)(unsigned long *size, 209 void **virt_base, 210 dma_addr_t *phys_base); 211 + int (*mmap) (struct vm_area_struct *vma); 212 unsigned long (*get_caps) (void); 213 int (*set_update_mode)(enum omapfb_update_mode mode); 214 enum omapfb_update_mode (*get_update_mode)(void); ··· 240 int state; 241 int ext_lcdc; /* Using external 242 LCD controller */ 243 + struct mutex rqueue_mutex; 244 245 void *vram_virt_base; 246 dma_addr_t vram_phys_base; ··· 261 struct device *dev; 262 }; 263 264 + struct omapfb_platform_data { 265 + struct omap_lcd_config lcd; 266 + struct omap_fbmem_config fbmem; 267 + }; 268 + 269 + #define OMAPFB_EVENT_READY 1 270 + #define OMAPFB_EVENT_DISABLED 2 271 272 #ifdef CONFIG_ARCH_OMAP1 273 extern struct lcd_ctrl omap1_lcd_ctrl; ··· 274 extern struct lcd_ctrl omap2_disp_ctrl; 275 #endif 276 277 + extern void omapfb_register_panel(struct lcd_panel *panel); 278 extern void omapfb_write_first_pixel(struct omapfb_device *fbdev, u16 pixval); 279 + extern void omapfb_notify_clients(struct omapfb_device *fbdev, 280 + unsigned long event); 281 + extern int omapfb_register_client(struct omapfb_notifier_block *nb, 282 + omapfb_notifier_callback_t callback, 283 + void *callback_data); 284 + extern int omapfb_unregister_client(struct omapfb_notifier_block *nb); 285 + extern int omapfb_update_window_async(struct omapfb_update_window *win, 286 + void (*callback)(void *), 287 + void *callback_data); 288 + 289 + /* in arch/arm/plat-omap/devices.c */ 290 + extern void omapfb_reserve_mem(void); 291 292 #endif /* __KERNEL__ */ 293
+8
include/asm-arm/arch-omap/param.h
···
··· 1 + /* 2 + * linux/include/asm-arm/arch-omap/param.h 3 + * 4 + */ 5 + 6 + #ifdef CONFIG_OMAP_32K_TIMER_HZ 7 + #define HZ CONFIG_OMAP_32K_TIMER_HZ 8 + #endif
+73 -8
include/asm-arm/arch-omap/pm.h
··· 49 50 /* 51 * ---------------------------------------------------------------------------- 52 - * Powermanagement bitmasks 53 * ---------------------------------------------------------------------------- 54 */ 55 #define IDLE_WAIT_CYCLES 0x00000fff ··· 112 #endif 113 114 #ifndef __ASSEMBLER__ 115 extern void omap_pm_idle(void); 116 extern void omap_pm_suspend(void); 117 extern void omap730_cpu_suspend(unsigned short, unsigned short); 118 extern void omap1510_cpu_suspend(unsigned short, unsigned short); 119 extern void omap1610_cpu_suspend(unsigned short, unsigned short); 120 extern void omap730_idle_loop_suspend(void); 121 extern void omap1510_idle_loop_suspend(void); 122 extern void omap1610_idle_loop_suspend(void); 123 124 #ifdef CONFIG_OMAP_SERIAL_WAKE 125 extern void omap_serial_wake_trigger(int enable); 126 #else 127 #define omap_serial_wake_trigger(x) {} 128 #endif /* CONFIG_OMAP_SERIAL_WAKE */ 129 - 130 - extern unsigned int omap730_cpu_suspend_sz; 131 - extern unsigned int omap730_idle_loop_suspend_sz; 132 - extern unsigned int omap1510_cpu_suspend_sz; 133 - extern unsigned int omap1510_idle_loop_suspend_sz; 134 - extern unsigned int omap1610_cpu_suspend_sz; 135 - extern unsigned int omap1610_idle_loop_suspend_sz; 136 137 #define ARM_SAVE(x) arm_sleep_save[ARM_SLEEP_SAVE_##x] = omap_readl(x) 138 #define ARM_RESTORE(x) omap_writel((arm_sleep_save[ARM_SLEEP_SAVE_##x]), (x)) 139 #define ARM_SHOW(x) arm_sleep_save[ARM_SLEEP_SAVE_##x] 140 141 #define ULPD_SAVE(x) ulpd_sleep_save[ULPD_SLEEP_SAVE_##x] = omap_readw(x) 142 #define ULPD_RESTORE(x) omap_writew((ulpd_sleep_save[ULPD_SLEEP_SAVE_##x]), (x)) ··· 180 #define MPUI1610_SAVE(x) mpui1610_sleep_save[MPUI1610_SLEEP_SAVE_##x] = omap_readl(x) 181 #define MPUI1610_RESTORE(x) omap_writel((mpui1610_sleep_save[MPUI1610_SLEEP_SAVE_##x]), (x)) 182 #define MPUI1610_SHOW(x) mpui1610_sleep_save[MPUI1610_SLEEP_SAVE_##x] 183 184 /* 185 * List of global OMAP registers to preserve. ··· 205 ARM_SLEEP_SAVE_ARM_RSTCT2, 206 ARM_SLEEP_SAVE_ARM_SYSST, 207 ARM_SLEEP_SAVE_SIZE 208 }; 209 210 enum ulpd_save_state { ··· 292 #else 293 MPUI1610_SLEEP_SAVE_SIZE = 0 294 #endif 295 }; 296 297 #endif /* ASSEMBLER */
··· 49 50 /* 51 * ---------------------------------------------------------------------------- 52 + * Power management bitmasks 53 * ---------------------------------------------------------------------------- 54 */ 55 #define IDLE_WAIT_CYCLES 0x00000fff ··· 112 #endif 113 114 #ifndef __ASSEMBLER__ 115 + 116 + #include <linux/clk.h> 117 + 118 + extern void prevent_idle_sleep(void); 119 + extern void allow_idle_sleep(void); 120 + 121 + /** 122 + * clk_deny_idle - Prevents the clock from being idled during MPU idle 123 + * @clk: clock signal handle 124 + */ 125 + void clk_deny_idle(struct clk *clk); 126 + 127 + /** 128 + * clk_allow_idle - Counters previous clk_deny_idle 129 + * @clk: clock signal handle 130 + */ 131 + void clk_deny_idle(struct clk *clk); 132 + 133 extern void omap_pm_idle(void); 134 extern void omap_pm_suspend(void); 135 extern void omap730_cpu_suspend(unsigned short, unsigned short); 136 extern void omap1510_cpu_suspend(unsigned short, unsigned short); 137 extern void omap1610_cpu_suspend(unsigned short, unsigned short); 138 + extern void omap24xx_cpu_suspend(u32 dll_ctrl, u32 cpu_revision); 139 extern void omap730_idle_loop_suspend(void); 140 extern void omap1510_idle_loop_suspend(void); 141 extern void omap1610_idle_loop_suspend(void); 142 + extern void omap24xx_idle_loop_suspend(void); 143 + 144 + extern unsigned int omap730_cpu_suspend_sz; 145 + extern unsigned int omap1510_cpu_suspend_sz; 146 + extern unsigned int omap1610_cpu_suspend_sz; 147 + extern unsigned int omap24xx_cpu_suspend_sz; 148 + extern unsigned int omap730_idle_loop_suspend_sz; 149 + extern unsigned int omap1510_idle_loop_suspend_sz; 150 + extern unsigned int omap1610_idle_loop_suspend_sz; 151 + extern unsigned int omap24xx_idle_loop_suspend_sz; 152 153 #ifdef CONFIG_OMAP_SERIAL_WAKE 154 extern void omap_serial_wake_trigger(int enable); 155 #else 156 + #define omap_serial_wakeup_init() {} 157 #define omap_serial_wake_trigger(x) {} 158 #endif /* CONFIG_OMAP_SERIAL_WAKE */ 159 160 #define ARM_SAVE(x) arm_sleep_save[ARM_SLEEP_SAVE_##x] = omap_readl(x) 161 #define ARM_RESTORE(x) omap_writel((arm_sleep_save[ARM_SLEEP_SAVE_##x]), (x)) 162 #define ARM_SHOW(x) arm_sleep_save[ARM_SLEEP_SAVE_##x] 163 + 164 + #define DSP_SAVE(x) dsp_sleep_save[DSP_SLEEP_SAVE_##x] = __raw_readw(x) 165 + #define DSP_RESTORE(x) __raw_writew((dsp_sleep_save[DSP_SLEEP_SAVE_##x]), (x)) 166 + #define DSP_SHOW(x) dsp_sleep_save[DSP_SLEEP_SAVE_##x] 167 168 #define ULPD_SAVE(x) ulpd_sleep_save[ULPD_SLEEP_SAVE_##x] = omap_readw(x) 169 #define ULPD_RESTORE(x) omap_writew((ulpd_sleep_save[ULPD_SLEEP_SAVE_##x]), (x)) ··· 153 #define MPUI1610_SAVE(x) mpui1610_sleep_save[MPUI1610_SLEEP_SAVE_##x] = omap_readl(x) 154 #define MPUI1610_RESTORE(x) omap_writel((mpui1610_sleep_save[MPUI1610_SLEEP_SAVE_##x]), (x)) 155 #define MPUI1610_SHOW(x) mpui1610_sleep_save[MPUI1610_SLEEP_SAVE_##x] 156 + 157 + #define OMAP24XX_SAVE(x) omap24xx_sleep_save[OMAP24XX_SLEEP_SAVE_##x] = x 158 + #define OMAP24XX_RESTORE(x) x = omap24xx_sleep_save[OMAP24XX_SLEEP_SAVE_##x] 159 + #define OMAP24XX_SHOW(x) omap24xx_sleep_save[OMAP24XX_SLEEP_SAVE_##x] 160 161 /* 162 * List of global OMAP registers to preserve. ··· 174 ARM_SLEEP_SAVE_ARM_RSTCT2, 175 ARM_SLEEP_SAVE_ARM_SYSST, 176 ARM_SLEEP_SAVE_SIZE 177 + }; 178 + 179 + enum dsp_save_state { 180 + DSP_SLEEP_SAVE_START = 0, 181 + /* 182 + * DSP registers 16 bits 183 + */ 184 + DSP_SLEEP_SAVE_DSP_IDLECT2, 185 + DSP_SLEEP_SAVE_SIZE 186 }; 187 188 enum ulpd_save_state { ··· 252 #else 253 MPUI1610_SLEEP_SAVE_SIZE = 0 254 #endif 255 + }; 256 + 257 + enum omap24xx_save_state { 258 + OMAP24XX_SLEEP_SAVE_START = 0, 259 + OMAP24XX_SLEEP_SAVE_INTC_MIR0, 260 + OMAP24XX_SLEEP_SAVE_INTC_MIR1, 261 + OMAP24XX_SLEEP_SAVE_INTC_MIR2, 262 + OMAP24XX_SLEEP_SAVE_CM_FCLKEN1_CORE, 263 + OMAP24XX_SLEEP_SAVE_CM_FCLKEN2_CORE, 264 + OMAP24XX_SLEEP_SAVE_CM_ICLKEN1_CORE, 265 + OMAP24XX_SLEEP_SAVE_CM_ICLKEN2_CORE, 266 + OMAP24XX_SLEEP_SAVE_CM_ICLKEN4_CORE, 267 + OMAP24XX_SLEEP_SAVE_GPIO1_IRQENABLE1, 268 + OMAP24XX_SLEEP_SAVE_GPIO2_IRQENABLE1, 269 + OMAP24XX_SLEEP_SAVE_GPIO3_IRQENABLE1, 270 + OMAP24XX_SLEEP_SAVE_GPIO4_IRQENABLE1, 271 + OMAP24XX_SLEEP_SAVE_GPIO3_OE, 272 + OMAP24XX_SLEEP_SAVE_GPIO4_OE, 273 + OMAP24XX_SLEEP_SAVE_GPIO3_RISINGDETECT, 274 + OMAP24XX_SLEEP_SAVE_GPIO3_FALLINGDETECT, 275 + OMAP24XX_SLEEP_SAVE_CONTROL_PADCONF_SPI1_NCS2, 276 + OMAP24XX_SLEEP_SAVE_CONTROL_PADCONF_MCBSP1_DX, 277 + OMAP24XX_SLEEP_SAVE_CONTROL_PADCONF_SSI1_FLAG_TX, 278 + OMAP24XX_SLEEP_SAVE_CONTROL_PADCONF_SYS_NIRQW0, 279 + OMAP24XX_SLEEP_SAVE_SIZE 280 }; 281 282 #endif /* ASSEMBLER */
+4 -400
include/asm-arm/arch-omap/prcm.h
··· 1 /* 2 - * prcm.h - Access definations for use in OMAP24XX clock and power management 3 * 4 * Copyright (C) 2005 Texas Instruments, Inc. 5 * ··· 23 #ifndef __ASM_ARM_ARCH_DPM_PRCM_H 24 #define __ASM_ARM_ARCH_DPM_PRCM_H 25 26 - /* SET_PERFORMANCE_LEVEL PARAMETERS */ 27 - #define PRCM_HALF_SPEED 1 28 - #define PRCM_FULL_SPEED 2 29 - 30 - #ifndef __ASSEMBLER__ 31 - 32 - #define PRCM_REG32(offset) __REG32(OMAP24XX_PRCM_BASE + (offset)) 33 - 34 - #define PRCM_REVISION PRCM_REG32(0x000) 35 - #define PRCM_SYSCONFIG PRCM_REG32(0x010) 36 - #define PRCM_IRQSTATUS_MPU PRCM_REG32(0x018) 37 - #define PRCM_IRQENABLE_MPU PRCM_REG32(0x01C) 38 - #define PRCM_VOLTCTRL PRCM_REG32(0x050) 39 - #define PRCM_VOLTST PRCM_REG32(0x054) 40 - #define PRCM_CLKSRC_CTRL PRCM_REG32(0x060) 41 - #define PRCM_CLKOUT_CTRL PRCM_REG32(0x070) 42 - #define PRCM_CLKEMUL_CTRL PRCM_REG32(0x078) 43 - #define PRCM_CLKCFG_CTRL PRCM_REG32(0x080) 44 - #define PRCM_CLKCFG_STATUS PRCM_REG32(0x084) 45 - #define PRCM_VOLTSETUP PRCM_REG32(0x090) 46 - #define PRCM_CLKSSETUP PRCM_REG32(0x094) 47 - #define PRCM_POLCTRL PRCM_REG32(0x098) 48 - 49 - /* GENERAL PURPOSE */ 50 - #define GENERAL_PURPOSE1 PRCM_REG32(0x0B0) 51 - #define GENERAL_PURPOSE2 PRCM_REG32(0x0B4) 52 - #define GENERAL_PURPOSE3 PRCM_REG32(0x0B8) 53 - #define GENERAL_PURPOSE4 PRCM_REG32(0x0BC) 54 - #define GENERAL_PURPOSE5 PRCM_REG32(0x0C0) 55 - #define GENERAL_PURPOSE6 PRCM_REG32(0x0C4) 56 - #define GENERAL_PURPOSE7 PRCM_REG32(0x0C8) 57 - #define GENERAL_PURPOSE8 PRCM_REG32(0x0CC) 58 - #define GENERAL_PURPOSE9 PRCM_REG32(0x0D0) 59 - #define GENERAL_PURPOSE10 PRCM_REG32(0x0D4) 60 - #define GENERAL_PURPOSE11 PRCM_REG32(0x0D8) 61 - #define GENERAL_PURPOSE12 PRCM_REG32(0x0DC) 62 - #define GENERAL_PURPOSE13 PRCM_REG32(0x0E0) 63 - #define GENERAL_PURPOSE14 PRCM_REG32(0x0E4) 64 - #define GENERAL_PURPOSE15 PRCM_REG32(0x0E8) 65 - #define GENERAL_PURPOSE16 PRCM_REG32(0x0EC) 66 - #define GENERAL_PURPOSE17 PRCM_REG32(0x0F0) 67 - #define GENERAL_PURPOSE18 PRCM_REG32(0x0F4) 68 - #define GENERAL_PURPOSE19 PRCM_REG32(0x0F8) 69 - #define GENERAL_PURPOSE20 PRCM_REG32(0x0FC) 70 - 71 - /* MPU */ 72 - #define CM_CLKSEL_MPU PRCM_REG32(0x140) 73 - #define CM_CLKSTCTRL_MPU PRCM_REG32(0x148) 74 - #define RM_RSTST_MPU PRCM_REG32(0x158) 75 - #define PM_WKDEP_MPU PRCM_REG32(0x1C8) 76 - #define PM_EVGENCTRL_MPU PRCM_REG32(0x1D4) 77 - #define PM_EVEGENONTIM_MPU PRCM_REG32(0x1D8) 78 - #define PM_EVEGENOFFTIM_MPU PRCM_REG32(0x1DC) 79 - #define PM_PWSTCTRL_MPU PRCM_REG32(0x1E0) 80 - #define PM_PWSTST_MPU PRCM_REG32(0x1E4) 81 - 82 - /* CORE */ 83 - #define CM_FCLKEN1_CORE PRCM_REG32(0x200) 84 - #define CM_FCLKEN2_CORE PRCM_REG32(0x204) 85 - #define CM_FCLKEN3_CORE PRCM_REG32(0x208) 86 - #define CM_ICLKEN1_CORE PRCM_REG32(0x210) 87 - #define CM_ICLKEN2_CORE PRCM_REG32(0x214) 88 - #define CM_ICLKEN3_CORE PRCM_REG32(0x218) 89 - #define CM_ICLKEN4_CORE PRCM_REG32(0x21C) 90 - #define CM_IDLEST1_CORE PRCM_REG32(0x220) 91 - #define CM_IDLEST2_CORE PRCM_REG32(0x224) 92 - #define CM_IDLEST3_CORE PRCM_REG32(0x228) 93 - #define CM_IDLEST4_CORE PRCM_REG32(0x22C) 94 - #define CM_AUTOIDLE1_CORE PRCM_REG32(0x230) 95 - #define CM_AUTOIDLE2_CORE PRCM_REG32(0x234) 96 - #define CM_AUTOIDLE3_CORE PRCM_REG32(0x238) 97 - #define CM_AUTOIDLE4_CORE PRCM_REG32(0x23C) 98 - #define CM_CLKSEL1_CORE PRCM_REG32(0x240) 99 - #define CM_CLKSEL2_CORE PRCM_REG32(0x244) 100 - #define CM_CLKSTCTRL_CORE PRCM_REG32(0x248) 101 - #define PM_WKEN1_CORE PRCM_REG32(0x2A0) 102 - #define PM_WKEN2_CORE PRCM_REG32(0x2A4) 103 - #define PM_WKST1_CORE PRCM_REG32(0x2B0) 104 - #define PM_WKST2_CORE PRCM_REG32(0x2B4) 105 - #define PM_WKDEP_CORE PRCM_REG32(0x2C8) 106 - #define PM_PWSTCTRL_CORE PRCM_REG32(0x2E0) 107 - #define PM_PWSTST_CORE PRCM_REG32(0x2E4) 108 - 109 - /* GFX */ 110 - #define CM_FCLKEN_GFX PRCM_REG32(0x300) 111 - #define CM_ICLKEN_GFX PRCM_REG32(0x310) 112 - #define CM_IDLEST_GFX PRCM_REG32(0x320) 113 - #define CM_CLKSEL_GFX PRCM_REG32(0x340) 114 - #define CM_CLKSTCTRL_GFX PRCM_REG32(0x348) 115 - #define RM_RSTCTRL_GFX PRCM_REG32(0x350) 116 - #define RM_RSTST_GFX PRCM_REG32(0x358) 117 - #define PM_WKDEP_GFX PRCM_REG32(0x3C8) 118 - #define PM_PWSTCTRL_GFX PRCM_REG32(0x3E0) 119 - #define PM_PWSTST_GFX PRCM_REG32(0x3E4) 120 - 121 - /* WAKE-UP */ 122 - #define CM_FCLKEN_WKUP PRCM_REG32(0x400) 123 - #define CM_ICLKEN_WKUP PRCM_REG32(0x410) 124 - #define CM_IDLEST_WKUP PRCM_REG32(0x420) 125 - #define CM_AUTOIDLE_WKUP PRCM_REG32(0x430) 126 - #define CM_CLKSEL_WKUP PRCM_REG32(0x440) 127 - #define RM_RSTCTRL_WKUP PRCM_REG32(0x450) 128 - #define RM_RSTTIME_WKUP PRCM_REG32(0x454) 129 - #define RM_RSTST_WKUP PRCM_REG32(0x458) 130 - #define PM_WKEN_WKUP PRCM_REG32(0x4A0) 131 - #define PM_WKST_WKUP PRCM_REG32(0x4B0) 132 - 133 - /* CLOCKS */ 134 - #define CM_CLKEN_PLL PRCM_REG32(0x500) 135 - #define CM_IDLEST_CKGEN PRCM_REG32(0x520) 136 - #define CM_AUTOIDLE_PLL PRCM_REG32(0x530) 137 - #define CM_CLKSEL1_PLL PRCM_REG32(0x540) 138 - #define CM_CLKSEL2_PLL PRCM_REG32(0x544) 139 - 140 - /* DSP */ 141 - #define CM_FCLKEN_DSP PRCM_REG32(0x800) 142 - #define CM_ICLKEN_DSP PRCM_REG32(0x810) 143 - #define CM_IDLEST_DSP PRCM_REG32(0x820) 144 - #define CM_AUTOIDLE_DSP PRCM_REG32(0x830) 145 - #define CM_CLKSEL_DSP PRCM_REG32(0x840) 146 - #define CM_CLKSTCTRL_DSP PRCM_REG32(0x848) 147 - #define RM_RSTCTRL_DSP PRCM_REG32(0x850) 148 - #define RM_RSTST_DSP PRCM_REG32(0x858) 149 - #define PM_WKEN_DSP PRCM_REG32(0x8A0) 150 - #define PM_WKDEP_DSP PRCM_REG32(0x8C8) 151 - #define PM_PWSTCTRL_DSP PRCM_REG32(0x8E0) 152 - #define PM_PWSTST_DSP PRCM_REG32(0x8E4) 153 - #define PRCM_IRQSTATUS_DSP PRCM_REG32(0x8F0) 154 - #define PRCM_IRQENABLE_DSP PRCM_REG32(0x8F4) 155 - 156 - /* IVA */ 157 - #define PRCM_IRQSTATUS_IVA PRCM_REG32(0x8F8) 158 - #define PRCM_IRQENABLE_IVA PRCM_REG32(0x8FC) 159 - 160 - /* Modem on 2430 */ 161 - #define CM_FCLKEN_MDM PRCM_REG32(0xC00) 162 - #define CM_ICLKEN_MDM PRCM_REG32(0xC10) 163 - #define CM_IDLEST_MDM PRCM_REG32(0xC20) 164 - #define CM_CLKSEL_MDM PRCM_REG32(0xC40) 165 - 166 - /* FIXME: Move to header for 2430 */ 167 - #define DISP_BASE (OMAP24XX_L4_IO_BASE+0x50000) 168 - #define DISP_REG32(offset) __REG32(DISP_BASE + (offset)) 169 - 170 - #define OMAP24XX_GPMC_BASE (L3_24XX_BASE + 0xa000) 171 - #define GPMC_BASE (OMAP24XX_GPMC_BASE) 172 - #define GPMC_REG32(offset) __REG32(GPMC_BASE + (offset)) 173 - 174 - #define GPT1_BASE (OMAP24XX_GPT1) 175 - #define GPT1_REG32(offset) __REG32(GPT1_BASE + (offset)) 176 - 177 - /* Misc sysconfig */ 178 - #define DISPC_SYSCONFIG DISP_REG32(0x410) 179 - #define SPI_BASE (OMAP24XX_L4_IO_BASE+0x98000) 180 - #define MCSPI1_SYSCONFIG __REG32(SPI_BASE + 0x10) 181 - #define MCSPI2_SYSCONFIG __REG32(SPI_BASE+0x2000 + 0x10) 182 - 183 - //#define DSP_MMU_SYSCONFIG 0x5A000010 184 - #define CAMERA_MMU_SYSCONFIG __REG32(DISP_BASE+0x2C10) 185 - //#define IVA_MMU_SYSCONFIG 0x5D000010 186 - //#define DSP_DMA_SYSCONFIG 0x00FCC02C 187 - #define CAMERA_DMA_SYSCONFIG __REG32(DISP_BASE+0x282C) 188 - #define SYSTEM_DMA_SYSCONFIG __REG32(DISP_BASE+0x602C) 189 - #define GPMC_SYSCONFIG GPMC_REG32(0x010) 190 - #define MAILBOXES_SYSCONFIG __REG32(OMAP24XX_L4_IO_BASE+0x94010) 191 - #define UART1_SYSCONFIG __REG32(OMAP24XX_L4_IO_BASE+0x6A054) 192 - #define UART2_SYSCONFIG __REG32(OMAP24XX_L4_IO_BASE+0x6C054) 193 - #define UART3_SYSCONFIG __REG32(OMAP24XX_L4_IO_BASE+0x6E054) 194 - //#define IVA_SYSCONFIG 0x5C060010 195 - #define SDRC_SYSCONFIG __REG32(OMAP24XX_SDRC_BASE+0x10) 196 - #define SMS_SYSCONFIG __REG32(OMAP24XX_SMS_BASE+0x10) 197 - #define SSI_SYSCONFIG __REG32(DISP_BASE+0x8010) 198 - //#define VLYNQ_SYSCONFIG 0x67FFFE10 199 - 200 - /* rkw - good cannidates for PM_ to start what nm was trying */ 201 - #define OMAP24XX_GPT2 (OMAP24XX_L4_IO_BASE+0x2A000) 202 - #define OMAP24XX_GPT3 (OMAP24XX_L4_IO_BASE+0x78000) 203 - #define OMAP24XX_GPT4 (OMAP24XX_L4_IO_BASE+0x7A000) 204 - #define OMAP24XX_GPT5 (OMAP24XX_L4_IO_BASE+0x7C000) 205 - #define OMAP24XX_GPT6 (OMAP24XX_L4_IO_BASE+0x7E000) 206 - #define OMAP24XX_GPT7 (OMAP24XX_L4_IO_BASE+0x80000) 207 - #define OMAP24XX_GPT8 (OMAP24XX_L4_IO_BASE+0x82000) 208 - #define OMAP24XX_GPT9 (OMAP24XX_L4_IO_BASE+0x84000) 209 - #define OMAP24XX_GPT10 (OMAP24XX_L4_IO_BASE+0x86000) 210 - #define OMAP24XX_GPT11 (OMAP24XX_L4_IO_BASE+0x88000) 211 - #define OMAP24XX_GPT12 (OMAP24XX_L4_IO_BASE+0x8A000) 212 - 213 - #define GPTIMER1_SYSCONFIG GPT1_REG32(0x010) 214 - #define GPTIMER2_SYSCONFIG __REG32(OMAP24XX_GPT2 + 0x10) 215 - #define GPTIMER3_SYSCONFIG __REG32(OMAP24XX_GPT3 + 0x10) 216 - #define GPTIMER4_SYSCONFIG __REG32(OMAP24XX_GPT4 + 0x10) 217 - #define GPTIMER5_SYSCONFIG __REG32(OMAP24XX_GPT5 + 0x10) 218 - #define GPTIMER6_SYSCONFIG __REG32(OMAP24XX_GPT6 + 0x10) 219 - #define GPTIMER7_SYSCONFIG __REG32(OMAP24XX_GPT7 + 0x10) 220 - #define GPTIMER8_SYSCONFIG __REG32(OMAP24XX_GPT8 + 0x10) 221 - #define GPTIMER9_SYSCONFIG __REG32(OMAP24XX_GPT9 + 0x10) 222 - #define GPTIMER10_SYSCONFIG __REG32(OMAP24XX_GPT10 + 0x10) 223 - #define GPTIMER11_SYSCONFIG __REG32(OMAP24XX_GPT11 + 0x10) 224 - #define GPTIMER12_SYSCONFIG __REG32(OMAP24XX_GPT12 + 0x10) 225 - 226 - #define GPIOX_BASE(X) (OMAP24XX_GPIO_BASE+(0x2000*((X)-1))) 227 - 228 - #define GPIO1_SYSCONFIG __REG32((GPIOX_BASE(1)+0x10)) 229 - #define GPIO2_SYSCONFIG __REG32((GPIOX_BASE(2)+0x10)) 230 - #define GPIO3_SYSCONFIG __REG32((GPIOX_BASE(3)+0x10)) 231 - #define GPIO4_SYSCONFIG __REG32((GPIOX_BASE(4)+0x10)) 232 - 233 - /* GP TIMER 1 */ 234 - #define GPTIMER1_TISTAT GPT1_REG32(0x014) 235 - #define GPTIMER1_TISR GPT1_REG32(0x018) 236 - #define GPTIMER1_TIER GPT1_REG32(0x01C) 237 - #define GPTIMER1_TWER GPT1_REG32(0x020) 238 - #define GPTIMER1_TCLR GPT1_REG32(0x024) 239 - #define GPTIMER1_TCRR GPT1_REG32(0x028) 240 - #define GPTIMER1_TLDR GPT1_REG32(0x02C) 241 - #define GPTIMER1_TTGR GPT1_REG32(0x030) 242 - #define GPTIMER1_TWPS GPT1_REG32(0x034) 243 - #define GPTIMER1_TMAR GPT1_REG32(0x038) 244 - #define GPTIMER1_TCAR1 GPT1_REG32(0x03C) 245 - #define GPTIMER1_TSICR GPT1_REG32(0x040) 246 - #define GPTIMER1_TCAR2 GPT1_REG32(0x044) 247 - 248 - /* rkw -- base fix up please... */ 249 - #define GPTIMER3_TISR __REG32(OMAP24XX_L4_IO_BASE+0x78018) 250 - 251 - /* SDRC */ 252 - #define SDRC_DLLA_CTRL __REG32(OMAP24XX_SDRC_BASE+0x060) 253 - #define SDRC_DLLA_STATUS __REG32(OMAP24XX_SDRC_BASE+0x064) 254 - #define SDRC_DLLB_CTRL __REG32(OMAP24XX_SDRC_BASE+0x068) 255 - #define SDRC_DLLB_STATUS __REG32(OMAP24XX_SDRC_BASE+0x06C) 256 - #define SDRC_POWER __REG32(OMAP24XX_SDRC_BASE+0x070) 257 - #define SDRC_MR_0 __REG32(OMAP24XX_SDRC_BASE+0x084) 258 - 259 - /* GPIO 1 */ 260 - #define GPIO1_BASE GPIOX_BASE(1) 261 - #define GPIO1_REG32(offset) __REG32(GPIO1_BASE + (offset)) 262 - #define GPIO1_IRQENABLE1 GPIO1_REG32(0x01C) 263 - #define GPIO1_IRQSTATUS1 GPIO1_REG32(0x018) 264 - #define GPIO1_IRQENABLE2 GPIO1_REG32(0x02C) 265 - #define GPIO1_IRQSTATUS2 GPIO1_REG32(0x028) 266 - #define GPIO1_WAKEUPENABLE GPIO1_REG32(0x020) 267 - #define GPIO1_RISINGDETECT GPIO1_REG32(0x048) 268 - #define GPIO1_DATAIN GPIO1_REG32(0x038) 269 - #define GPIO1_OE GPIO1_REG32(0x034) 270 - #define GPIO1_DATAOUT GPIO1_REG32(0x03C) 271 - 272 - /* GPIO2 */ 273 - #define GPIO2_BASE GPIOX_BASE(2) 274 - #define GPIO2_REG32(offset) __REG32(GPIO2_BASE + (offset)) 275 - #define GPIO2_IRQENABLE1 GPIO2_REG32(0x01C) 276 - #define GPIO2_IRQSTATUS1 GPIO2_REG32(0x018) 277 - #define GPIO2_IRQENABLE2 GPIO2_REG32(0x02C) 278 - #define GPIO2_IRQSTATUS2 GPIO2_REG32(0x028) 279 - #define GPIO2_WAKEUPENABLE GPIO2_REG32(0x020) 280 - #define GPIO2_RISINGDETECT GPIO2_REG32(0x048) 281 - #define GPIO2_DATAIN GPIO2_REG32(0x038) 282 - #define GPIO2_OE GPIO2_REG32(0x034) 283 - #define GPIO2_DATAOUT GPIO2_REG32(0x03C) 284 - 285 - /* GPIO 3 */ 286 - #define GPIO3_BASE GPIOX_BASE(3) 287 - #define GPIO3_REG32(offset) __REG32(GPIO3_BASE + (offset)) 288 - #define GPIO3_IRQENABLE1 GPIO3_REG32(0x01C) 289 - #define GPIO3_IRQSTATUS1 GPIO3_REG32(0x018) 290 - #define GPIO3_IRQENABLE2 GPIO3_REG32(0x02C) 291 - #define GPIO3_IRQSTATUS2 GPIO3_REG32(0x028) 292 - #define GPIO3_WAKEUPENABLE GPIO3_REG32(0x020) 293 - #define GPIO3_RISINGDETECT GPIO3_REG32(0x048) 294 - #define GPIO3_FALLINGDETECT GPIO3_REG32(0x04C) 295 - #define GPIO3_DATAIN GPIO3_REG32(0x038) 296 - #define GPIO3_OE GPIO3_REG32(0x034) 297 - #define GPIO3_DATAOUT GPIO3_REG32(0x03C) 298 - #define GPIO3_DEBOUNCENABLE GPIO3_REG32(0x050) 299 - #define GPIO3_DEBOUNCINGTIME GPIO3_REG32(0x054) 300 - 301 - /* GPIO 4 */ 302 - #define GPIO4_BASE GPIOX_BASE(4) 303 - #define GPIO4_REG32(offset) __REG32(GPIO4_BASE + (offset)) 304 - #define GPIO4_IRQENABLE1 GPIO4_REG32(0x01C) 305 - #define GPIO4_IRQSTATUS1 GPIO4_REG32(0x018) 306 - #define GPIO4_IRQENABLE2 GPIO4_REG32(0x02C) 307 - #define GPIO4_IRQSTATUS2 GPIO4_REG32(0x028) 308 - #define GPIO4_WAKEUPENABLE GPIO4_REG32(0x020) 309 - #define GPIO4_RISINGDETECT GPIO4_REG32(0x048) 310 - #define GPIO4_FALLINGDETECT GPIO4_REG32(0x04C) 311 - #define GPIO4_DATAIN GPIO4_REG32(0x038) 312 - #define GPIO4_OE GPIO4_REG32(0x034) 313 - #define GPIO4_DATAOUT GPIO4_REG32(0x03C) 314 - #define GPIO4_DEBOUNCENABLE GPIO4_REG32(0x050) 315 - #define GPIO4_DEBOUNCINGTIME GPIO4_REG32(0x054) 316 - 317 - 318 - /* IO CONFIG */ 319 - #define CONTROL_BASE (OMAP24XX_CTRL_BASE) 320 - #define CONTROL_REG32(offset) __REG32(CONTROL_BASE + (offset)) 321 - 322 - #define CONTROL_PADCONF_SPI1_NCS2 CONTROL_REG32(0x104) 323 - #define CONTROL_PADCONF_SYS_XTALOUT CONTROL_REG32(0x134) 324 - #define CONTROL_PADCONF_UART1_RX CONTROL_REG32(0x0C8) 325 - #define CONTROL_PADCONF_MCBSP1_DX CONTROL_REG32(0x10C) 326 - #define CONTROL_PADCONF_GPMC_NCS4 CONTROL_REG32(0x090) 327 - #define CONTROL_PADCONF_DSS_D5 CONTROL_REG32(0x0B8) 328 - #define CONTROL_PADCONF_DSS_D9 CONTROL_REG32(0x0BC) 329 - #define CONTROL_PADCONF_DSS_D13 CONTROL_REG32(0x0C0) 330 - #define CONTROL_PADCONF_DSS_VSYNC CONTROL_REG32(0x0CC) 331 - 332 - /* CONTROL */ 333 - #define CONTROL_DEVCONF CONTROL_REG32(0x274) 334 - 335 - /* INTERRUPT CONTROLLER */ 336 - #define INTC_BASE (OMAP24XX_L4_IO_BASE+0xfe000) 337 - #define INTC_REG32(offset) __REG32(INTC_BASE + (offset)) 338 - 339 - #define INTC1_U_BASE INTC_REG32(0x000) 340 - #define INTC_MIR0 INTC_REG32(0x084) 341 - #define INTC_MIR_SET0 INTC_REG32(0x08C) 342 - #define INTC_MIR_CLEAR0 INTC_REG32(0x088) 343 - #define INTC_ISR_CLEAR0 INTC_REG32(0x094) 344 - #define INTC_MIR1 INTC_REG32(0x0A4) 345 - #define INTC_MIR_SET1 INTC_REG32(0x0AC) 346 - #define INTC_MIR_CLEAR1 INTC_REG32(0x0A8) 347 - #define INTC_ISR_CLEAR1 INTC_REG32(0x0B4) 348 - #define INTC_MIR2 INTC_REG32(0x0C4) 349 - #define INTC_MIR_SET2 INTC_REG32(0x0CC) 350 - #define INTC_MIR_CLEAR2 INTC_REG32(0x0C8) 351 - #define INTC_ISR_CLEAR2 INTC_REG32(0x0D4) 352 - #define INTC_SIR_IRQ INTC_REG32(0x040) 353 - #define INTC_CONTROL INTC_REG32(0x048) 354 - #define INTC_ILR11 INTC_REG32(0x12C) 355 - #define INTC_ILR32 INTC_REG32(0x180) 356 - #define INTC_ILR37 INTC_REG32(0x194) 357 - #define INTC_SYSCONFIG INTC_REG32(0x010) 358 - 359 - /* RAM FIREWALL */ 360 - #define RAMFW_BASE (0x68005000) 361 - #define RAMFW_REG32(offset) __REG32(RAMFW_BASE + (offset)) 362 - 363 - #define RAMFW_REQINFOPERM0 RAMFW_REG32(0x048) 364 - #define RAMFW_READPERM0 RAMFW_REG32(0x050) 365 - #define RAMFW_WRITEPERM0 RAMFW_REG32(0x058) 366 - 367 - /* GPMC CS1 FPGA ON USER INTERFACE MODULE */ 368 - //#define DEBUG_BOARD_LED_REGISTER 0x04000014 369 - 370 - /* GPMC CS0 */ 371 - #define GPMC_CONFIG1_0 GPMC_REG32(0x060) 372 - #define GPMC_CONFIG2_0 GPMC_REG32(0x064) 373 - #define GPMC_CONFIG3_0 GPMC_REG32(0x068) 374 - #define GPMC_CONFIG4_0 GPMC_REG32(0x06C) 375 - #define GPMC_CONFIG5_0 GPMC_REG32(0x070) 376 - #define GPMC_CONFIG6_0 GPMC_REG32(0x074) 377 - #define GPMC_CONFIG7_0 GPMC_REG32(0x078) 378 - 379 - /* GPMC CS1 */ 380 - #define GPMC_CONFIG1_1 GPMC_REG32(0x090) 381 - #define GPMC_CONFIG2_1 GPMC_REG32(0x094) 382 - #define GPMC_CONFIG3_1 GPMC_REG32(0x098) 383 - #define GPMC_CONFIG4_1 GPMC_REG32(0x09C) 384 - #define GPMC_CONFIG5_1 GPMC_REG32(0x0a0) 385 - #define GPMC_CONFIG6_1 GPMC_REG32(0x0a4) 386 - #define GPMC_CONFIG7_1 GPMC_REG32(0x0a8) 387 - 388 - /* DSS */ 389 - #define DSS_CONTROL DISP_REG32(0x040) 390 - #define DISPC_CONTROL DISP_REG32(0x440) 391 - #define DISPC_SYSSTATUS DISP_REG32(0x414) 392 - #define DISPC_IRQSTATUS DISP_REG32(0x418) 393 - #define DISPC_IRQENABLE DISP_REG32(0x41C) 394 - #define DISPC_CONFIG DISP_REG32(0x444) 395 - #define DISPC_DEFAULT_COLOR0 DISP_REG32(0x44C) 396 - #define DISPC_DEFAULT_COLOR1 DISP_REG32(0x450) 397 - #define DISPC_TRANS_COLOR0 DISP_REG32(0x454) 398 - #define DISPC_TRANS_COLOR1 DISP_REG32(0x458) 399 - #define DISPC_LINE_NUMBER DISP_REG32(0x460) 400 - #define DISPC_TIMING_H DISP_REG32(0x464) 401 - #define DISPC_TIMING_V DISP_REG32(0x468) 402 - #define DISPC_POL_FREQ DISP_REG32(0x46C) 403 - #define DISPC_DIVISOR DISP_REG32(0x470) 404 - #define DISPC_SIZE_DIG DISP_REG32(0x478) 405 - #define DISPC_SIZE_LCD DISP_REG32(0x47C) 406 - #define DISPC_GFX_BA0 DISP_REG32(0x480) 407 - #define DISPC_GFX_BA1 DISP_REG32(0x484) 408 - #define DISPC_GFX_POSITION DISP_REG32(0x488) 409 - #define DISPC_GFX_SIZE DISP_REG32(0x48C) 410 - #define DISPC_GFX_ATTRIBUTES DISP_REG32(0x4A0) 411 - #define DISPC_GFX_FIFO_THRESHOLD DISP_REG32(0x4A4) 412 - #define DISPC_GFX_ROW_INC DISP_REG32(0x4AC) 413 - #define DISPC_GFX_PIXEL_INC DISP_REG32(0x4B0) 414 - #define DISPC_GFX_WINDOW_SKIP DISP_REG32(0x4B4) 415 - #define DISPC_GFX_TABLE_BA DISP_REG32(0x4B8) 416 - #define DISPC_DATA_CYCLE1 DISP_REG32(0x5D4) 417 - #define DISPC_DATA_CYCLE2 DISP_REG32(0x5D8) 418 - #define DISPC_DATA_CYCLE3 DISP_REG32(0x5DC) 419 - 420 - /* Wake up define for board */ 421 - #define GPIO97 (1 << 1) 422 - #define GPIO88 (1 << 24) 423 - 424 - #endif /* __ASSEMBLER__ */ 425 426 #endif 427
··· 1 /* 2 + * linux/include/asm-arm/arch-omap/prcm.h 3 + * 4 + * Access definations for use in OMAP24XX clock and power management 5 * 6 * Copyright (C) 2005 Texas Instruments, Inc. 7 * ··· 21 #ifndef __ASM_ARM_ARCH_DPM_PRCM_H 22 #define __ASM_ARM_ARCH_DPM_PRCM_H 23 24 + u32 omap_prcm_get_reset_sources(void); 25 26 #endif 27
+2
include/asm-arm/arch-omap/sram.h
··· 20 u32 mem_type); 21 extern u32 omap2_set_prcm(u32 dpll_ctrl_val, u32 sdrc_rfr_val, int bypass); 22 23 24 /* Do not use these */ 25 extern void sram_reprogram_clock(u32 ckctl, u32 dpllctl);
··· 20 u32 mem_type); 21 extern u32 omap2_set_prcm(u32 dpll_ctrl_val, u32 sdrc_rfr_val, int bypass); 22 23 + extern unsigned long omap_fb_sram_start; 24 + extern unsigned long omap_fb_sram_size; 25 26 /* Do not use these */ 27 extern void sram_reprogram_clock(u32 ckctl, u32 dpllctl);
+3 -14
include/asm-arm/arch-omap/system.h
··· 9 10 #include <asm/mach-types.h> 11 #include <asm/hardware.h> 12 - #include <asm/arch/prcm.h> 13 14 #ifndef CONFIG_MACH_VOICEBLUE 15 #define voiceblue_reset() do {} while (0) 16 #endif 17 18 static inline void arch_idle(void) 19 { ··· 39 omap_writew(1, ARM_RSTCT1); 40 } 41 42 - static inline void omap2_arch_reset(char mode) 43 - { 44 - u32 rate; 45 - struct clk *vclk, *sclk; 46 - 47 - vclk = clk_get(NULL, "virt_prcm_set"); 48 - sclk = clk_get(NULL, "sys_ck"); 49 - rate = clk_get_rate(sclk); 50 - clk_set_rate(vclk, rate); /* go to bypass for OMAP limitation */ 51 - RM_RSTCTRL_WKUP |= 2; 52 - } 53 - 54 static inline void arch_reset(char mode) 55 { 56 if (!cpu_is_omap24xx()) 57 omap1_arch_reset(mode); 58 else 59 - omap2_arch_reset(mode); 60 } 61 62 #endif
··· 9 10 #include <asm/mach-types.h> 11 #include <asm/hardware.h> 12 13 #ifndef CONFIG_MACH_VOICEBLUE 14 #define voiceblue_reset() do {} while (0) 15 #endif 16 + 17 + extern void omap_prcm_arch_reset(char mode); 18 19 static inline void arch_idle(void) 20 { ··· 38 omap_writew(1, ARM_RSTCT1); 39 } 40 41 static inline void arch_reset(char mode) 42 { 43 if (!cpu_is_omap24xx()) 44 omap1_arch_reset(mode); 45 else 46 + omap_prcm_arch_reset(mode); 47 } 48 49 #endif
+56 -89
include/asm-arm/arch-s3c2410/entry-macro.S
··· 6 * This file is licensed under the terms of the GNU General Public 7 * License version 2. This program is licensed "as is" without any 8 * warranty of any kind, whether express or implied. 9 10 - * Modifications: 11 - * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA 12 - */ 13 #include <asm/hardware.h> 14 #include <asm/arch/irqs.h> 15 16 - 17 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp 18 19 - mov \tmp, #S3C24XX_VA_IRQ 20 - ldr \irqnr, [ \tmp, #0x14 ] @ get irq no 21 - 30000: 22 - teq \irqnr, #4 23 - teqne \irqnr, #5 24 - beq 1002f @ external irq reg 25 26 - @ debug check to see if interrupt reported is the same 27 - @ as the offset.... 28 29 - teq \irqnr, #0 30 - beq 20002f 31 - ldr \irqstat, [ \tmp, #0x10 ] @ INTPND 32 - mov \irqstat, \irqstat, lsr \irqnr 33 - tst \irqstat, #1 34 - bne 20002f 35 36 - /* debug/warning if we get an invalud response from the 37 - * INTOFFSET register */ 38 - #if 1 39 - stmfd r13!, { r0 - r4 , r8-r12, r14 } 40 - ldr r1, [ \tmp, #0x14 ] @ INTOFFSET 41 - ldr r2, [ \tmp, #0x10 ] @ INTPND 42 - ldr r3, [ \tmp, #0x00 ] @ SRCPND 43 - adr r0, 20003f 44 - bl printk 45 - b 20004f 46 47 - 20003: 48 - .ascii "<7>irq: err - bad offset %d, intpnd=%08x, srcpnd=%08x\n" 49 - .byte 0 50 - .align 4 51 - 20004: 52 - mov r1, #1 53 - mov \tmp, #S3C24XX_VA_IRQ 54 - ldmfd r13!, { r0 - r4 , r8-r12, r14 } 55 - #endif 56 57 - @ try working out interrupt number for ourselves 58 - mov \irqnr, #0 59 - ldr \irqstat, [ \tmp, #0x10 ] @ INTPND 60 - 10021: 61 - movs \irqstat, \irqstat, lsr#1 62 - bcs 30000b @ try and re-start the proccess 63 - add \irqnr, \irqnr, #1 64 - cmp \irqnr, #32 65 - ble 10021b 66 67 - @ found no interrupt, set Z flag and leave 68 - movs \irqnr, #0 69 - b 1001f 70 71 - 20005: 72 - 20002: @ exit 73 - @ we base the s3c2410x interrupts at 16 and above to allow 74 - @ isa peripherals to have their standard interrupts, also 75 - @ ensure that Z flag is un-set on exit 76 77 - @ note, we cannot be sure if we get IRQ_EINT0 (0) that 78 - @ there is simply no interrupt pending, so in all other 79 - @ cases we jump to say we have found something, otherwise 80 - @ we check to see if the interrupt really is assrted 81 - adds \irqnr, \irqnr, #IRQ_EINT0 82 - teq \irqnr, #IRQ_EINT0 83 - bne 1001f @ exit 84 - ldr \irqstat, [ \tmp, #0x10 ] @ INTPND 85 - teq \irqstat, #0 86 - moveq \irqnr, #0 87 - b 1001f 88 89 - @ we get here from no main or external interrupts pending 90 - 1002: 91 - add \tmp, \tmp, #S3C24XX_VA_GPIO - S3C24XX_VA_IRQ 92 - ldr \irqstat, [ \tmp, # 0xa8 ] @ EXTINTPEND 93 - ldr \irqnr, [ \tmp, # 0xa4 ] @ EXTINTMASK 94 95 - bic \irqstat, \irqstat, \irqnr @ clear masked irqs 96 97 - mov \irqnr, #IRQ_EINT4 @ start extint nos 98 - mov \irqstat, \irqstat, lsr#4 @ ignore bottom 4 bits 99 - 10021: 100 - movs \irqstat, \irqstat, lsr#1 101 - bcs 1004f 102 - add \irqnr, \irqnr, #1 103 - cmp \irqnr, #IRQ_EINT23 104 - ble 10021b 105 - 106 - @ found no interrupt, set Z flag and leave 107 - movs \irqnr, #0 108 - 109 - 1004: @ ensure Z flag clear in case our MOVS shifted out the last bit 110 - teq \irqnr, #0 111 1001: 112 - @ exit irq routine 113 - .endm 114 115 116 /* currently don't need an disable_fiq macro */ 117 118 .macro disable_fiq 119 .endm 120 - 121 -
··· 6 * This file is licensed under the terms of the GNU General Public 7 * License version 2. This program is licensed "as is" without any 8 * warranty of any kind, whether express or implied. 9 + */ 10 11 + /* We have a problem that the INTOFFSET register does not always 12 + * show one interrupt. Occasionally we get two interrupts through 13 + * the prioritiser, and this causes the INTOFFSET register to show 14 + * what looks like the logical-or of the two interrupt numbers. 15 + * 16 + * Thanks to Klaus, Shannon, et al for helping to debug this problem 17 + */ 18 + 19 + #define INTPND (0x10) 20 + #define INTOFFSET (0x14) 21 + #define EXTINTPEND (0xa8) 22 + #define EXTINTMASK (0xa4) 23 + 24 #include <asm/hardware.h> 25 #include <asm/arch/irqs.h> 26 27 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp 28 29 + mov \base, #S3C24XX_VA_IRQ 30 31 + ldr \irqstat, [ \base, #INTPND] 32 + bics \irqnr, \irqstat, #3<<4 @@ only an GPIO IRQ 33 + beq 2000f 34 35 + @@ try the interrupt offset register, since it is there 36 37 + ldr \irqnr, [ \base, #INTOFFSET ] 38 + mov \tmp, #1 39 + tst \irqstat, \tmp, lsl \irqnr 40 + addne \irqnr, \irqnr, #IRQ_EINT0 41 + bne 1001f 42 43 + @@ the number specified is not a valid irq, so try 44 + @@ and work it out for ourselves 45 46 + mov \irqnr, #IRQ_EINT0 @@ start here 47 + b 3000f 48 49 + 2000: 50 + @@ load the GPIO interrupt register, and check it 51 52 + add \tmp, \base, #S3C24XX_VA_GPIO - S3C24XX_VA_IRQ 53 + ldr \irqstat, [ \tmp, # EXTINTPEND ] 54 + ldr \irqnr, [ \tmp, # EXTINTMASK ] 55 + bics \irqstat, \irqstat, \irqnr 56 + beq 1001f 57 58 + mov \irqnr, #(IRQ_EINT4 - 4) 59 60 + @@ work out which irq (if any) we got 61 + 3000: 62 + movs \tmp, \irqstat, lsl#16 63 + addeq \irqnr, \irqnr, #16 64 + moveq \irqstat, \irqstat, lsr#16 65 + tst \irqstat, #0xff 66 + addeq \irqnr, \irqnr, #8 67 + moveq \irqstat, \irqstat, lsr#8 68 + tst \irqstat, #0xf 69 + addeq \irqnr, \irqnr, #4 70 + moveq \irqstat, \irqstat, lsr#4 71 + tst \irqstat, #0x3 72 + addeq \irqnr, \irqnr, #2 73 + moveq \irqstat, \irqstat, lsr#2 74 + tst \irqstat, #0x1 75 + addeq \irqnr, \irqnr, #1 76 77 + @@ we have the value 78 + movs \irqnr, \irqnr 79 80 1001: 81 + @@ exit here, Z flag unset if IRQ 82 83 + .endm 84 85 /* currently don't need an disable_fiq macro */ 86 87 .macro disable_fiq 88 .endm
+15 -7
include/asm-arm/dma-mapping.h
··· 47 48 static inline int dma_is_consistent(dma_addr_t handle) 49 { 50 - return 0; 51 } 52 53 /* ··· 145 dma_map_single(struct device *dev, void *cpu_addr, size_t size, 146 enum dma_data_direction dir) 147 { 148 - consistent_sync(cpu_addr, size, dir); 149 return virt_to_dma(dev, (unsigned long)cpu_addr); 150 } 151 #else ··· 257 258 sg->dma_address = page_to_dma(dev, sg->page) + sg->offset; 259 virt = page_address(sg->page) + sg->offset; 260 - consistent_sync(virt, sg->length, dir); 261 } 262 263 return nents; ··· 314 dma_sync_single_for_cpu(struct device *dev, dma_addr_t handle, size_t size, 315 enum dma_data_direction dir) 316 { 317 - consistent_sync((void *)dma_to_virt(dev, handle), size, dir); 318 } 319 320 static inline void 321 dma_sync_single_for_device(struct device *dev, dma_addr_t handle, size_t size, 322 enum dma_data_direction dir) 323 { 324 - consistent_sync((void *)dma_to_virt(dev, handle), size, dir); 325 } 326 #else 327 extern void dma_sync_single_for_cpu(struct device*, dma_addr_t, size_t, enum dma_data_direction); ··· 353 354 for (i = 0; i < nents; i++, sg++) { 355 char *virt = page_address(sg->page) + sg->offset; 356 - consistent_sync(virt, sg->length, dir); 357 } 358 } 359 ··· 366 367 for (i = 0; i < nents; i++, sg++) { 368 char *virt = page_address(sg->page) + sg->offset; 369 - consistent_sync(virt, sg->length, dir); 370 } 371 } 372 #else
··· 47 48 static inline int dma_is_consistent(dma_addr_t handle) 49 { 50 + return !!arch_is_coherent(); 51 } 52 53 /* ··· 145 dma_map_single(struct device *dev, void *cpu_addr, size_t size, 146 enum dma_data_direction dir) 147 { 148 + if (!arch_is_coherent()) 149 + consistent_sync(cpu_addr, size, dir); 150 + 151 return virt_to_dma(dev, (unsigned long)cpu_addr); 152 } 153 #else ··· 255 256 sg->dma_address = page_to_dma(dev, sg->page) + sg->offset; 257 virt = page_address(sg->page) + sg->offset; 258 + 259 + if (!arch_is_coherent()) 260 + consistent_sync(virt, sg->length, dir); 261 } 262 263 return nents; ··· 310 dma_sync_single_for_cpu(struct device *dev, dma_addr_t handle, size_t size, 311 enum dma_data_direction dir) 312 { 313 + if (!arch_is_coherent()) 314 + consistent_sync((void *)dma_to_virt(dev, handle), size, dir); 315 } 316 317 static inline void 318 dma_sync_single_for_device(struct device *dev, dma_addr_t handle, size_t size, 319 enum dma_data_direction dir) 320 { 321 + if (!arch_is_coherent()) 322 + consistent_sync((void *)dma_to_virt(dev, handle), size, dir); 323 } 324 #else 325 extern void dma_sync_single_for_cpu(struct device*, dma_addr_t, size_t, enum dma_data_direction); ··· 347 348 for (i = 0; i < nents; i++, sg++) { 349 char *virt = page_address(sg->page) + sg->offset; 350 + if (!arch_is_coherent()) 351 + consistent_sync(virt, sg->length, dir); 352 } 353 } 354 ··· 359 360 for (i = 0; i < nents; i++, sg++) { 361 char *virt = page_address(sg->page) + sg->offset; 362 + if (!arch_is_coherent()) 363 + consistent_sync(virt, sg->length, dir); 364 } 365 } 366 #else
+8
include/asm-arm/memory.h
··· 234 #define virt_to_dma(dev, addr) (__arch_virt_to_dma(dev, addr)) 235 #endif 236 237 #endif 238 239 #include <asm-generic/memory_model.h>
··· 234 #define virt_to_dma(dev, addr) (__arch_virt_to_dma(dev, addr)) 235 #endif 236 237 + /* 238 + * Optional coherency support. Currently used only by selected 239 + * Intel XSC3-based systems. 240 + */ 241 + #ifndef arch_is_coherent 242 + #define arch_is_coherent() 0 243 + #endif 244 + 245 #endif 246 247 #include <asm-generic/memory_model.h>
+1
include/asm-arm/pgtable-hwdef.h
··· 73 #define PTE_EXT_AP_URW_SRW (PTE_EXT_AP1|PTE_EXT_AP0) 74 #define PTE_EXT_TEX(x) ((x) << 6) /* v5 */ 75 #define PTE_EXT_APX (1 << 9) /* v6 */ 76 #define PTE_EXT_SHARED (1 << 10) /* v6 */ 77 #define PTE_EXT_NG (1 << 11) /* v6 */ 78
··· 73 #define PTE_EXT_AP_URW_SRW (PTE_EXT_AP1|PTE_EXT_AP0) 74 #define PTE_EXT_TEX(x) ((x) << 6) /* v5 */ 75 #define PTE_EXT_APX (1 << 9) /* v6 */ 76 + #define PTE_EXT_COHERENT (1 << 9) /* XScale3 */ 77 #define PTE_EXT_SHARED (1 << 10) /* v6 */ 78 #define PTE_EXT_NG (1 << 11) /* v6 */ 79
+1
include/asm-arm/pgtable.h
··· 156 #define L_PTE_WRITE (1 << 5) 157 #define L_PTE_EXEC (1 << 6) 158 #define L_PTE_DIRTY (1 << 7) 159 #define L_PTE_SHARED (1 << 10) /* shared between CPUs (v6) */ 160 #define L_PTE_ASID (1 << 11) /* non-global (use ASID, v6) */ 161
··· 156 #define L_PTE_WRITE (1 << 5) 157 #define L_PTE_EXEC (1 << 6) 158 #define L_PTE_DIRTY (1 << 7) 159 + #define L_PTE_COHERENT (1 << 9) /* I/O coherent (xsc3) */ 160 #define L_PTE_SHARED (1 << 10) /* shared between CPUs (v6) */ 161 #define L_PTE_ASID (1 << 11) /* non-global (use ASID, v6) */ 162