Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'omap/headers4' into next/cleanup

+6116 -5465
-1
arch/arm/Kconfig
··· 924 924 select CLKSRC_MMIO 925 925 select GENERIC_CLOCKEVENTS 926 926 select HAVE_CLK 927 - select NEED_MACH_GPIO_H 928 927 help 929 928 Support for TI's OMAP platform (OMAP1/2/3/4). 930 929
+2 -1
arch/arm/mach-omap1/Makefile
··· 3 3 # 4 4 5 5 # Common support 6 - obj-y := io.o id.o sram.o time.o irq.o mux.o flash.o serial.o devices.o dma.o 6 + obj-y := io.o id.o sram-init.o sram.o time.o irq.o mux.o flash.o \ 7 + serial.o devices.o dma.o 7 8 obj-y += clock.o clock_data.o opp_data.o reset.o pm_bus.o timer.o 8 9 9 10 ifneq ($(CONFIG_SND_OMAP_SOC_MCBSP),)
-1
arch/arm/mach-omap1/board-ams-delta.c
··· 625 625 .atag_offset = 0x100, 626 626 .map_io = ams_delta_map_io, 627 627 .init_early = omap1_init_early, 628 - .reserve = omap_reserve, 629 628 .init_irq = omap1_init_irq, 630 629 .init_machine = ams_delta_init, 631 630 .init_late = ams_delta_init_late,
+4 -5
arch/arm/mach-omap1/board-fsample.c
··· 27 27 #include <asm/mach/arch.h> 28 28 #include <asm/mach/map.h> 29 29 30 - #include <plat/tc.h> 30 + #include <mach/tc.h> 31 31 #include <mach/mux.h> 32 32 #include <mach/flash.h> 33 - #include <plat/fpga.h> 34 33 #include <linux/platform_data/keypad-omap.h> 35 34 36 35 #include <mach/hardware.h> 37 36 38 37 #include "iomap.h" 39 38 #include "common.h" 39 + #include "fpga.h" 40 40 41 41 /* fsample is pretty close to p2-sample */ 42 42 ··· 123 123 124 124 static void __init fsample_init_smc91x(void) 125 125 { 126 - fpga_write(1, H2P2_DBG_FPGA_LAN_RESET); 126 + __raw_writeb(1, H2P2_DBG_FPGA_LAN_RESET); 127 127 mdelay(50); 128 - fpga_write(fpga_read(H2P2_DBG_FPGA_LAN_RESET) & ~1, 128 + __raw_writeb(__raw_readb(H2P2_DBG_FPGA_LAN_RESET) & ~1, 129 129 H2P2_DBG_FPGA_LAN_RESET); 130 130 mdelay(50); 131 131 } ··· 362 362 .atag_offset = 0x100, 363 363 .map_io = omap_fsample_map_io, 364 364 .init_early = omap1_init_early, 365 - .reserve = omap_reserve, 366 365 .init_irq = omap1_init_irq, 367 366 .init_machine = omap_fsample_init, 368 367 .init_late = omap1_init_late,
-1
arch/arm/mach-omap1/board-generic.c
··· 81 81 .atag_offset = 0x100, 82 82 .map_io = omap16xx_map_io, 83 83 .init_early = omap1_init_early, 84 - .reserve = omap_reserve, 85 84 .init_irq = omap1_init_irq, 86 85 .init_machine = omap_generic_init, 87 86 .init_late = omap1_init_late,
+2 -3
arch/arm/mach-omap1/board-h2-mmc.c
··· 13 13 */ 14 14 #include <linux/gpio.h> 15 15 #include <linux/platform_device.h> 16 - 16 + #include <linux/platform_data/gpio-omap.h> 17 17 #include <linux/i2c/tps65010.h> 18 18 19 - #include <plat/mmc.h> 20 - 21 19 #include "board-h2.h" 20 + #include "mmc.h" 22 21 23 22 #if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) 24 23
+3 -3
arch/arm/mach-omap1/board-h2.c
··· 39 39 #include <asm/mach/map.h> 40 40 41 41 #include <mach/mux.h> 42 - #include <plat/dma.h> 43 - #include <plat/tc.h> 42 + #include <plat-omap/dma-omap.h> 43 + #include <mach/tc.h> 44 44 #include <mach/irda.h> 45 45 #include <linux/platform_data/keypad-omap.h> 46 46 #include <mach/flash.h> ··· 50 50 51 51 #include "common.h" 52 52 #include "board-h2.h" 53 + #include "dma.h" 53 54 54 55 /* At OMAP1610 Innovator the Ethernet is directly connected to CS1 */ 55 56 #define OMAP1610_ETHR_START 0x04000300 ··· 459 458 .atag_offset = 0x100, 460 459 .map_io = omap16xx_map_io, 461 460 .init_early = omap1_init_early, 462 - .reserve = omap_reserve, 463 461 .init_irq = omap1_init_irq, 464 462 .init_machine = h2_init, 465 463 .init_late = omap1_init_late,
+1 -2
arch/arm/mach-omap1/board-h3-mmc.c
··· 16 16 17 17 #include <linux/i2c/tps65010.h> 18 18 19 - #include <plat/mmc.h> 20 - 21 19 #include "board-h3.h" 20 + #include "mmc.h" 22 21 23 22 #if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) 24 23
+2 -3
arch/arm/mach-omap1/board-h3.c
··· 41 41 #include <asm/mach/map.h> 42 42 43 43 #include <mach/mux.h> 44 - #include <plat/tc.h> 44 + #include <mach/tc.h> 45 45 #include <linux/platform_data/keypad-omap.h> 46 - #include <plat/dma.h> 46 + #include <plat-omap/dma-omap.h> 47 47 #include <mach/flash.h> 48 48 49 49 #include <mach/hardware.h> ··· 452 452 .atag_offset = 0x100, 453 453 .map_io = omap16xx_map_io, 454 454 .init_early = omap1_init_early, 455 - .reserve = omap_reserve, 456 455 .init_irq = omap1_init_irq, 457 456 .init_machine = h3_init, 458 457 .init_late = omap1_init_late,
+1 -2
arch/arm/mach-omap1/board-htcherald.c
··· 43 43 #include <asm/mach/arch.h> 44 44 45 45 #include <mach/omap7xx.h> 46 - #include <plat/mmc.h> 46 + #include "mmc.h" 47 47 48 48 #include <mach/irqs.h> 49 49 #include <mach/usb.h> ··· 600 600 .atag_offset = 0x100, 601 601 .map_io = htcherald_map_io, 602 602 .init_early = omap1_init_early, 603 - .reserve = omap_reserve, 604 603 .init_irq = omap1_init_irq, 605 604 .init_machine = htcherald_init, 606 605 .init_late = omap1_init_late,
+15 -15
arch/arm/mach-omap1/board-innovator.c
··· 33 33 34 34 #include <mach/mux.h> 35 35 #include <mach/flash.h> 36 - #include <plat/fpga.h> 37 - #include <plat/tc.h> 36 + #include <mach/tc.h> 38 37 #include <linux/platform_data/keypad-omap.h> 39 - #include <plat/mmc.h> 40 38 41 39 #include <mach/hardware.h> 42 40 #include <mach/usb.h> 43 41 44 42 #include "iomap.h" 45 43 #include "common.h" 44 + #include "mmc.h" 46 45 47 46 /* At OMAP1610 Innovator the Ethernet is directly connected to CS1 */ 48 47 #define INNOVATOR1610_ETHR_START 0x04000300 ··· 214 215 215 216 static int innovator_get_pendown_state(void) 216 217 { 217 - return !(fpga_read(OMAP1510_FPGA_TOUCHSCREEN) & (1 << 5)); 218 + return !(__raw_readb(OMAP1510_FPGA_TOUCHSCREEN) & (1 << 5)); 218 219 } 219 220 220 221 static const struct ads7846_platform_data innovator1510_ts_info = { ··· 278 279 static void __init innovator_init_smc91x(void) 279 280 { 280 281 if (cpu_is_omap1510()) { 281 - fpga_write(fpga_read(OMAP1510_FPGA_RST) & ~1, 282 + __raw_writeb(__raw_readb(OMAP1510_FPGA_RST) & ~1, 282 283 OMAP1510_FPGA_RST); 283 284 udelay(750); 284 285 } else { ··· 334 335 int vdd) 335 336 { 336 337 if (power_on) 337 - fpga_write(fpga_read(OMAP1510_FPGA_POWER) | (1 << 3), 338 + __raw_writeb(__raw_readb(OMAP1510_FPGA_POWER) | (1 << 3), 338 339 OMAP1510_FPGA_POWER); 339 340 else 340 - fpga_write(fpga_read(OMAP1510_FPGA_POWER) & ~(1 << 3), 341 + __raw_writeb(__raw_readb(OMAP1510_FPGA_POWER) & ~(1 << 3), 341 342 OMAP1510_FPGA_POWER); 342 343 343 344 return 0; ··· 389 390 omap_cfg_reg(UART3_TX); 390 391 omap_cfg_reg(UART3_RX); 391 392 392 - reg = fpga_read(OMAP1510_FPGA_POWER); 393 + reg = __raw_readb(OMAP1510_FPGA_POWER); 393 394 reg |= OMAP1510_FPGA_PCR_COM1_EN; 394 - fpga_write(reg, OMAP1510_FPGA_POWER); 395 + __raw_writeb(reg, OMAP1510_FPGA_POWER); 395 396 udelay(10); 396 397 397 - reg = fpga_read(OMAP1510_FPGA_POWER); 398 + reg = __raw_readb(OMAP1510_FPGA_POWER); 398 399 reg |= OMAP1510_FPGA_PCR_COM2_EN; 399 - fpga_write(reg, OMAP1510_FPGA_POWER); 400 + __raw_writeb(reg, OMAP1510_FPGA_POWER); 400 401 udelay(10); 401 402 402 403 platform_add_devices(innovator1510_devices, ARRAY_SIZE(innovator1510_devices)); ··· 436 437 */ 437 438 static void __init innovator_map_io(void) 438 439 { 440 + #ifdef CONFIG_ARCH_OMAP15XX 439 441 omap15xx_map_io(); 440 442 441 443 iotable_init(innovator1510_io_desc, ARRAY_SIZE(innovator1510_io_desc)); ··· 444 444 445 445 /* Dump the Innovator FPGA rev early - useful info for support. */ 446 446 pr_debug("Innovator FPGA Rev %d.%d Board Rev %d\n", 447 - fpga_read(OMAP1510_FPGA_REV_HIGH), 448 - fpga_read(OMAP1510_FPGA_REV_LOW), 449 - fpga_read(OMAP1510_FPGA_BOARD_REV)); 447 + __raw_readb(OMAP1510_FPGA_REV_HIGH), 448 + __raw_readb(OMAP1510_FPGA_REV_LOW), 449 + __raw_readb(OMAP1510_FPGA_BOARD_REV)); 450 + #endif 450 451 } 451 452 452 453 MACHINE_START(OMAP_INNOVATOR, "TI-Innovator") ··· 455 454 .atag_offset = 0x100, 456 455 .map_io = innovator_map_io, 457 456 .init_early = omap1_init_early, 458 - .reserve = omap_reserve, 459 457 .init_irq = omap1_init_irq, 460 458 .init_machine = innovator_init, 461 459 .init_late = omap1_init_late,
+2 -3
arch/arm/mach-omap1/board-nokia770.c
··· 29 29 #include <asm/mach/map.h> 30 30 31 31 #include <mach/mux.h> 32 - #include <plat/mmc.h> 33 - #include <plat/clock.h> 34 32 35 33 #include <mach/hardware.h> 36 34 #include <mach/usb.h> 37 35 38 36 #include "common.h" 37 + #include "clock.h" 38 + #include "mmc.h" 39 39 40 40 #define ADS7846_PENDOWN_GPIO 15 41 41 ··· 251 251 .atag_offset = 0x100, 252 252 .map_io = omap16xx_map_io, 253 253 .init_early = omap1_init_early, 254 - .reserve = omap_reserve, 255 254 .init_irq = omap1_init_irq, 256 255 .init_machine = omap_nokia770_init, 257 256 .init_late = omap1_init_late,
+1 -2
arch/arm/mach-omap1/board-osk.c
··· 48 48 49 49 #include <mach/flash.h> 50 50 #include <mach/mux.h> 51 - #include <plat/tc.h> 51 + #include <mach/tc.h> 52 52 53 53 #include <mach/hardware.h> 54 54 #include <mach/usb.h> ··· 606 606 .atag_offset = 0x100, 607 607 .map_io = omap16xx_map_io, 608 608 .init_early = omap1_init_early, 609 - .reserve = omap_reserve, 610 609 .init_irq = omap1_init_irq, 611 610 .init_machine = osk_init, 612 611 .init_late = omap1_init_late,
+3 -3
arch/arm/mach-omap1/board-palmte.c
··· 36 36 37 37 #include <mach/flash.h> 38 38 #include <mach/mux.h> 39 - #include <plat/tc.h> 40 - #include <plat/dma.h> 39 + #include <mach/tc.h> 40 + #include <plat-omap/dma-omap.h> 41 41 #include <mach/irda.h> 42 42 #include <linux/platform_data/keypad-omap.h> 43 43 ··· 45 45 #include <mach/usb.h> 46 46 47 47 #include "common.h" 48 + #include "dma.h" 48 49 49 50 #define PALMTE_USBDETECT_GPIO 0 50 51 #define PALMTE_USB_OR_DC_GPIO 1 ··· 265 264 .atag_offset = 0x100, 266 265 .map_io = omap15xx_map_io, 267 266 .init_early = omap1_init_early, 268 - .reserve = omap_reserve, 269 267 .init_irq = omap1_init_irq, 270 268 .init_machine = omap_palmte_init, 271 269 .init_late = omap1_init_late,
+4 -4
arch/arm/mach-omap1/board-palmtt.c
··· 28 28 #include <linux/spi/spi.h> 29 29 #include <linux/spi/ads7846.h> 30 30 #include <linux/platform_data/omap1_bl.h> 31 + #include <linux/platform_data/leds-omap.h> 31 32 32 33 #include <asm/mach-types.h> 33 34 #include <asm/mach/arch.h> 34 35 #include <asm/mach/map.h> 35 36 36 - #include <plat/led.h> 37 37 #include <mach/flash.h> 38 38 #include <mach/mux.h> 39 - #include <plat/dma.h> 40 - #include <plat/tc.h> 39 + #include <plat-omap/dma-omap.h> 40 + #include <mach/tc.h> 41 41 #include <mach/irda.h> 42 42 #include <linux/platform_data/keypad-omap.h> 43 43 ··· 45 45 #include <mach/usb.h> 46 46 47 47 #include "common.h" 48 + #include "dma.h" 48 49 49 50 #define PALMTT_USBDETECT_GPIO 0 50 51 #define PALMTT_CABLE_GPIO 1 ··· 311 310 .atag_offset = 0x100, 312 311 .map_io = omap15xx_map_io, 313 312 .init_early = omap1_init_early, 314 - .reserve = omap_reserve, 315 313 .init_irq = omap1_init_irq, 316 314 .init_machine = omap_palmtt_init, 317 315 .init_late = omap1_init_late,
+3 -3
arch/arm/mach-omap1/board-palmz71.c
··· 38 38 39 39 #include <mach/flash.h> 40 40 #include <mach/mux.h> 41 - #include <plat/dma.h> 42 - #include <plat/tc.h> 41 + #include <plat-omap/dma-omap.h> 42 + #include <mach/tc.h> 43 43 #include <mach/irda.h> 44 44 #include <linux/platform_data/keypad-omap.h> 45 45 ··· 47 47 #include <mach/usb.h> 48 48 49 49 #include "common.h" 50 + #include "dma.h" 50 51 51 52 #define PALMZ71_USBDETECT_GPIO 0 52 53 #define PALMZ71_PENIRQ_GPIO 6 ··· 327 326 .atag_offset = 0x100, 328 327 .map_io = omap15xx_map_io, 329 328 .init_early = omap1_init_early, 330 - .reserve = omap_reserve, 331 329 .init_irq = omap1_init_irq, 332 330 .init_machine = omap_palmz71_init, 333 331 .init_late = omap1_init_late,
+4 -5
arch/arm/mach-omap1/board-perseus2.c
··· 28 28 #include <asm/mach/arch.h> 29 29 #include <asm/mach/map.h> 30 30 31 - #include <plat/tc.h> 31 + #include <mach/tc.h> 32 32 #include <mach/mux.h> 33 - #include <plat/fpga.h> 34 33 #include <mach/flash.h> 35 34 36 35 #include <mach/hardware.h> 37 36 38 37 #include "iomap.h" 39 38 #include "common.h" 39 + #include "fpga.h" 40 40 41 41 static const unsigned int p2_keymap[] = { 42 42 KEY(0, 0, KEY_UP), ··· 231 231 232 232 static void __init perseus2_init_smc91x(void) 233 233 { 234 - fpga_write(1, H2P2_DBG_FPGA_LAN_RESET); 234 + __raw_writeb(1, H2P2_DBG_FPGA_LAN_RESET); 235 235 mdelay(50); 236 - fpga_write(fpga_read(H2P2_DBG_FPGA_LAN_RESET) & ~1, 236 + __raw_writeb(__raw_readb(H2P2_DBG_FPGA_LAN_RESET) & ~1, 237 237 H2P2_DBG_FPGA_LAN_RESET); 238 238 mdelay(50); 239 239 } ··· 324 324 .atag_offset = 0x100, 325 325 .map_io = omap_perseus2_map_io, 326 326 .init_early = omap1_init_early, 327 - .reserve = omap_reserve, 328 327 .init_irq = omap1_init_irq, 329 328 .init_machine = omap_perseus2_init, 330 329 .init_late = omap1_init_late,
+2 -1
arch/arm/mach-omap1/board-sx1-mmc.c
··· 16 16 #include <linux/platform_device.h> 17 17 18 18 #include <mach/hardware.h> 19 - #include <plat/mmc.h> 20 19 #include <mach/board-sx1.h> 20 + 21 + #include "mmc.h" 21 22 22 23 #if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) 23 24
+3 -3
arch/arm/mach-omap1/board-sx1.c
··· 36 36 37 37 #include <mach/flash.h> 38 38 #include <mach/mux.h> 39 - #include <plat/dma.h> 39 + #include <plat-omap/dma-omap.h> 40 40 #include <mach/irda.h> 41 - #include <plat/tc.h> 41 + #include <mach/tc.h> 42 42 #include <mach/board-sx1.h> 43 43 44 44 #include <mach/hardware.h> 45 45 #include <mach/usb.h> 46 46 47 47 #include "common.h" 48 + #include "dma.h" 48 49 49 50 /* Write to I2C device */ 50 51 int sx1_i2c_write_byte(u8 devaddr, u8 regoffset, u8 value) ··· 404 403 .atag_offset = 0x100, 405 404 .map_io = omap15xx_map_io, 406 405 .init_early = omap1_init_early, 407 - .reserve = omap_reserve, 408 406 .init_irq = omap1_init_irq, 409 407 .init_machine = omap_sx1_init, 410 408 .init_late = omap1_init_late,
+1 -2
arch/arm/mach-omap1/board-voiceblue.c
··· 34 34 #include <mach/board-voiceblue.h> 35 35 #include <mach/flash.h> 36 36 #include <mach/mux.h> 37 - #include <plat/tc.h> 37 + #include <mach/tc.h> 38 38 39 39 #include <mach/hardware.h> 40 40 #include <mach/usb.h> ··· 286 286 .atag_offset = 0x100, 287 287 .map_io = omap15xx_map_io, 288 288 .init_early = omap1_init_early, 289 - .reserve = omap_reserve, 290 289 .init_irq = omap1_init_irq, 291 290 .init_machine = voiceblue_init, 292 291 .init_late = omap1_init_late,
+501 -6
arch/arm/mach-omap1/clock.c
··· 12 12 * published by the Free Software Foundation. 13 13 */ 14 14 #include <linux/kernel.h> 15 + #include <linux/export.h> 15 16 #include <linux/list.h> 16 17 #include <linux/errno.h> 17 18 #include <linux/err.h> ··· 22 21 23 22 #include <asm/mach-types.h> 24 23 25 - #include <plat/cpu.h> 26 - #include <plat/usb.h> 27 - #include <plat/clock.h> 28 - #include <plat/sram.h> 29 - #include <plat/clkdev_omap.h> 30 - 31 24 #include <mach/hardware.h> 32 25 26 + #include "soc.h" 33 27 #include "iomap.h" 34 28 #include "clock.h" 35 29 #include "opp.h" 30 + #include "sram.h" 36 31 37 32 __u32 arm_idlect1_mask; 38 33 struct clk *api_ck_p, *ck_dpll1_p, *ck_ref_p; 34 + 35 + static LIST_HEAD(clocks); 36 + static DEFINE_MUTEX(clocks_mutex); 37 + static DEFINE_SPINLOCK(clockfw_lock); 39 38 40 39 /* 41 40 * Omap1 specific clock functions ··· 608 607 } 609 608 610 609 #endif 610 + 611 + 612 + int clk_enable(struct clk *clk) 613 + { 614 + unsigned long flags; 615 + int ret; 616 + 617 + if (clk == NULL || IS_ERR(clk)) 618 + return -EINVAL; 619 + 620 + spin_lock_irqsave(&clockfw_lock, flags); 621 + ret = omap1_clk_enable(clk); 622 + spin_unlock_irqrestore(&clockfw_lock, flags); 623 + 624 + return ret; 625 + } 626 + EXPORT_SYMBOL(clk_enable); 627 + 628 + void clk_disable(struct clk *clk) 629 + { 630 + unsigned long flags; 631 + 632 + if (clk == NULL || IS_ERR(clk)) 633 + return; 634 + 635 + spin_lock_irqsave(&clockfw_lock, flags); 636 + if (clk->usecount == 0) { 637 + pr_err("Trying disable clock %s with 0 usecount\n", 638 + clk->name); 639 + WARN_ON(1); 640 + goto out; 641 + } 642 + 643 + omap1_clk_disable(clk); 644 + 645 + out: 646 + spin_unlock_irqrestore(&clockfw_lock, flags); 647 + } 648 + EXPORT_SYMBOL(clk_disable); 649 + 650 + unsigned long clk_get_rate(struct clk *clk) 651 + { 652 + unsigned long flags; 653 + unsigned long ret; 654 + 655 + if (clk == NULL || IS_ERR(clk)) 656 + return 0; 657 + 658 + spin_lock_irqsave(&clockfw_lock, flags); 659 + ret = clk->rate; 660 + spin_unlock_irqrestore(&clockfw_lock, flags); 661 + 662 + return ret; 663 + } 664 + EXPORT_SYMBOL(clk_get_rate); 665 + 666 + /* 667 + * Optional clock functions defined in include/linux/clk.h 668 + */ 669 + 670 + long clk_round_rate(struct clk *clk, unsigned long rate) 671 + { 672 + unsigned long flags; 673 + long ret; 674 + 675 + if (clk == NULL || IS_ERR(clk)) 676 + return 0; 677 + 678 + spin_lock_irqsave(&clockfw_lock, flags); 679 + ret = omap1_clk_round_rate(clk, rate); 680 + spin_unlock_irqrestore(&clockfw_lock, flags); 681 + 682 + return ret; 683 + } 684 + EXPORT_SYMBOL(clk_round_rate); 685 + 686 + int clk_set_rate(struct clk *clk, unsigned long rate) 687 + { 688 + unsigned long flags; 689 + int ret = -EINVAL; 690 + 691 + if (clk == NULL || IS_ERR(clk)) 692 + return ret; 693 + 694 + spin_lock_irqsave(&clockfw_lock, flags); 695 + ret = omap1_clk_set_rate(clk, rate); 696 + if (ret == 0) 697 + propagate_rate(clk); 698 + spin_unlock_irqrestore(&clockfw_lock, flags); 699 + 700 + return ret; 701 + } 702 + EXPORT_SYMBOL(clk_set_rate); 703 + 704 + int clk_set_parent(struct clk *clk, struct clk *parent) 705 + { 706 + WARN_ONCE(1, "clk_set_parent() not implemented for OMAP1\n"); 707 + 708 + return -EINVAL; 709 + } 710 + EXPORT_SYMBOL(clk_set_parent); 711 + 712 + struct clk *clk_get_parent(struct clk *clk) 713 + { 714 + return clk->parent; 715 + } 716 + EXPORT_SYMBOL(clk_get_parent); 717 + 718 + /* 719 + * OMAP specific clock functions shared between omap1 and omap2 720 + */ 721 + 722 + int __initdata mpurate; 723 + 724 + /* 725 + * By default we use the rate set by the bootloader. 726 + * You can override this with mpurate= cmdline option. 727 + */ 728 + static int __init omap_clk_setup(char *str) 729 + { 730 + get_option(&str, &mpurate); 731 + 732 + if (!mpurate) 733 + return 1; 734 + 735 + if (mpurate < 1000) 736 + mpurate *= 1000000; 737 + 738 + return 1; 739 + } 740 + __setup("mpurate=", omap_clk_setup); 741 + 742 + /* Used for clocks that always have same value as the parent clock */ 743 + unsigned long followparent_recalc(struct clk *clk) 744 + { 745 + return clk->parent->rate; 746 + } 747 + 748 + /* 749 + * Used for clocks that have the same value as the parent clock, 750 + * divided by some factor 751 + */ 752 + unsigned long omap_fixed_divisor_recalc(struct clk *clk) 753 + { 754 + WARN_ON(!clk->fixed_div); 755 + 756 + return clk->parent->rate / clk->fixed_div; 757 + } 758 + 759 + void clk_reparent(struct clk *child, struct clk *parent) 760 + { 761 + list_del_init(&child->sibling); 762 + if (parent) 763 + list_add(&child->sibling, &parent->children); 764 + child->parent = parent; 765 + 766 + /* now do the debugfs renaming to reattach the child 767 + to the proper parent */ 768 + } 769 + 770 + /* Propagate rate to children */ 771 + void propagate_rate(struct clk *tclk) 772 + { 773 + struct clk *clkp; 774 + 775 + list_for_each_entry(clkp, &tclk->children, sibling) { 776 + if (clkp->recalc) 777 + clkp->rate = clkp->recalc(clkp); 778 + propagate_rate(clkp); 779 + } 780 + } 781 + 782 + static LIST_HEAD(root_clks); 783 + 784 + /** 785 + * recalculate_root_clocks - recalculate and propagate all root clocks 786 + * 787 + * Recalculates all root clocks (clocks with no parent), which if the 788 + * clock's .recalc is set correctly, should also propagate their rates. 789 + * Called at init. 790 + */ 791 + void recalculate_root_clocks(void) 792 + { 793 + struct clk *clkp; 794 + 795 + list_for_each_entry(clkp, &root_clks, sibling) { 796 + if (clkp->recalc) 797 + clkp->rate = clkp->recalc(clkp); 798 + propagate_rate(clkp); 799 + } 800 + } 801 + 802 + /** 803 + * clk_preinit - initialize any fields in the struct clk before clk init 804 + * @clk: struct clk * to initialize 805 + * 806 + * Initialize any struct clk fields needed before normal clk initialization 807 + * can run. No return value. 808 + */ 809 + void clk_preinit(struct clk *clk) 810 + { 811 + INIT_LIST_HEAD(&clk->children); 812 + } 813 + 814 + int clk_register(struct clk *clk) 815 + { 816 + if (clk == NULL || IS_ERR(clk)) 817 + return -EINVAL; 818 + 819 + /* 820 + * trap out already registered clocks 821 + */ 822 + if (clk->node.next || clk->node.prev) 823 + return 0; 824 + 825 + mutex_lock(&clocks_mutex); 826 + if (clk->parent) 827 + list_add(&clk->sibling, &clk->parent->children); 828 + else 829 + list_add(&clk->sibling, &root_clks); 830 + 831 + list_add(&clk->node, &clocks); 832 + if (clk->init) 833 + clk->init(clk); 834 + mutex_unlock(&clocks_mutex); 835 + 836 + return 0; 837 + } 838 + EXPORT_SYMBOL(clk_register); 839 + 840 + void clk_unregister(struct clk *clk) 841 + { 842 + if (clk == NULL || IS_ERR(clk)) 843 + return; 844 + 845 + mutex_lock(&clocks_mutex); 846 + list_del(&clk->sibling); 847 + list_del(&clk->node); 848 + mutex_unlock(&clocks_mutex); 849 + } 850 + EXPORT_SYMBOL(clk_unregister); 851 + 852 + void clk_enable_init_clocks(void) 853 + { 854 + struct clk *clkp; 855 + 856 + list_for_each_entry(clkp, &clocks, node) 857 + if (clkp->flags & ENABLE_ON_INIT) 858 + clk_enable(clkp); 859 + } 860 + 861 + /** 862 + * omap_clk_get_by_name - locate OMAP struct clk by its name 863 + * @name: name of the struct clk to locate 864 + * 865 + * Locate an OMAP struct clk by its name. Assumes that struct clk 866 + * names are unique. Returns NULL if not found or a pointer to the 867 + * struct clk if found. 868 + */ 869 + struct clk *omap_clk_get_by_name(const char *name) 870 + { 871 + struct clk *c; 872 + struct clk *ret = NULL; 873 + 874 + mutex_lock(&clocks_mutex); 875 + 876 + list_for_each_entry(c, &clocks, node) { 877 + if (!strcmp(c->name, name)) { 878 + ret = c; 879 + break; 880 + } 881 + } 882 + 883 + mutex_unlock(&clocks_mutex); 884 + 885 + return ret; 886 + } 887 + 888 + int omap_clk_enable_autoidle_all(void) 889 + { 890 + struct clk *c; 891 + unsigned long flags; 892 + 893 + spin_lock_irqsave(&clockfw_lock, flags); 894 + 895 + list_for_each_entry(c, &clocks, node) 896 + if (c->ops->allow_idle) 897 + c->ops->allow_idle(c); 898 + 899 + spin_unlock_irqrestore(&clockfw_lock, flags); 900 + 901 + return 0; 902 + } 903 + 904 + int omap_clk_disable_autoidle_all(void) 905 + { 906 + struct clk *c; 907 + unsigned long flags; 908 + 909 + spin_lock_irqsave(&clockfw_lock, flags); 910 + 911 + list_for_each_entry(c, &clocks, node) 912 + if (c->ops->deny_idle) 913 + c->ops->deny_idle(c); 914 + 915 + spin_unlock_irqrestore(&clockfw_lock, flags); 916 + 917 + return 0; 918 + } 919 + 920 + /* 921 + * Low level helpers 922 + */ 923 + static int clkll_enable_null(struct clk *clk) 924 + { 925 + return 0; 926 + } 927 + 928 + static void clkll_disable_null(struct clk *clk) 929 + { 930 + } 931 + 932 + const struct clkops clkops_null = { 933 + .enable = clkll_enable_null, 934 + .disable = clkll_disable_null, 935 + }; 936 + 937 + /* 938 + * Dummy clock 939 + * 940 + * Used for clock aliases that are needed on some OMAPs, but not others 941 + */ 942 + struct clk dummy_ck = { 943 + .name = "dummy", 944 + .ops = &clkops_null, 945 + }; 946 + 947 + /* 948 + * 949 + */ 950 + 951 + #ifdef CONFIG_OMAP_RESET_CLOCKS 952 + /* 953 + * Disable any unused clocks left on by the bootloader 954 + */ 955 + static int __init clk_disable_unused(void) 956 + { 957 + struct clk *ck; 958 + unsigned long flags; 959 + 960 + pr_info("clock: disabling unused clocks to save power\n"); 961 + 962 + spin_lock_irqsave(&clockfw_lock, flags); 963 + list_for_each_entry(ck, &clocks, node) { 964 + if (ck->ops == &clkops_null) 965 + continue; 966 + 967 + if (ck->usecount > 0 || !ck->enable_reg) 968 + continue; 969 + 970 + omap1_clk_disable_unused(ck); 971 + } 972 + spin_unlock_irqrestore(&clockfw_lock, flags); 973 + 974 + return 0; 975 + } 976 + late_initcall(clk_disable_unused); 977 + late_initcall(omap_clk_enable_autoidle_all); 978 + #endif 979 + 980 + #if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS) 981 + /* 982 + * debugfs support to trace clock tree hierarchy and attributes 983 + */ 984 + 985 + #include <linux/debugfs.h> 986 + #include <linux/seq_file.h> 987 + 988 + static struct dentry *clk_debugfs_root; 989 + 990 + static int clk_dbg_show_summary(struct seq_file *s, void *unused) 991 + { 992 + struct clk *c; 993 + struct clk *pa; 994 + 995 + mutex_lock(&clocks_mutex); 996 + seq_printf(s, "%-30s %-30s %-10s %s\n", 997 + "clock-name", "parent-name", "rate", "use-count"); 998 + 999 + list_for_each_entry(c, &clocks, node) { 1000 + pa = c->parent; 1001 + seq_printf(s, "%-30s %-30s %-10lu %d\n", 1002 + c->name, pa ? pa->name : "none", c->rate, 1003 + c->usecount); 1004 + } 1005 + mutex_unlock(&clocks_mutex); 1006 + 1007 + return 0; 1008 + } 1009 + 1010 + static int clk_dbg_open(struct inode *inode, struct file *file) 1011 + { 1012 + return single_open(file, clk_dbg_show_summary, inode->i_private); 1013 + } 1014 + 1015 + static const struct file_operations debug_clock_fops = { 1016 + .open = clk_dbg_open, 1017 + .read = seq_read, 1018 + .llseek = seq_lseek, 1019 + .release = single_release, 1020 + }; 1021 + 1022 + static int clk_debugfs_register_one(struct clk *c) 1023 + { 1024 + int err; 1025 + struct dentry *d; 1026 + struct clk *pa = c->parent; 1027 + 1028 + d = debugfs_create_dir(c->name, pa ? pa->dent : clk_debugfs_root); 1029 + if (!d) 1030 + return -ENOMEM; 1031 + c->dent = d; 1032 + 1033 + d = debugfs_create_u8("usecount", S_IRUGO, c->dent, (u8 *)&c->usecount); 1034 + if (!d) { 1035 + err = -ENOMEM; 1036 + goto err_out; 1037 + } 1038 + d = debugfs_create_u32("rate", S_IRUGO, c->dent, (u32 *)&c->rate); 1039 + if (!d) { 1040 + err = -ENOMEM; 1041 + goto err_out; 1042 + } 1043 + d = debugfs_create_x32("flags", S_IRUGO, c->dent, (u32 *)&c->flags); 1044 + if (!d) { 1045 + err = -ENOMEM; 1046 + goto err_out; 1047 + } 1048 + return 0; 1049 + 1050 + err_out: 1051 + debugfs_remove_recursive(c->dent); 1052 + return err; 1053 + } 1054 + 1055 + static int clk_debugfs_register(struct clk *c) 1056 + { 1057 + int err; 1058 + struct clk *pa = c->parent; 1059 + 1060 + if (pa && !pa->dent) { 1061 + err = clk_debugfs_register(pa); 1062 + if (err) 1063 + return err; 1064 + } 1065 + 1066 + if (!c->dent) { 1067 + err = clk_debugfs_register_one(c); 1068 + if (err) 1069 + return err; 1070 + } 1071 + return 0; 1072 + } 1073 + 1074 + static int __init clk_debugfs_init(void) 1075 + { 1076 + struct clk *c; 1077 + struct dentry *d; 1078 + int err; 1079 + 1080 + d = debugfs_create_dir("clock", NULL); 1081 + if (!d) 1082 + return -ENOMEM; 1083 + clk_debugfs_root = d; 1084 + 1085 + list_for_each_entry(c, &clocks, node) { 1086 + err = clk_debugfs_register(c); 1087 + if (err) 1088 + goto err_out; 1089 + } 1090 + 1091 + d = debugfs_create_file("summary", S_IRUGO, 1092 + d, NULL, &debug_clock_fops); 1093 + if (!d) 1094 + return -ENOMEM; 1095 + 1096 + return 0; 1097 + err_out: 1098 + debugfs_remove_recursive(clk_debugfs_root); 1099 + return err; 1100 + } 1101 + late_initcall(clk_debugfs_init); 1102 + 1103 + #endif /* defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS) */
+177 -1
arch/arm/mach-omap1/clock.h
··· 14 14 #define __ARCH_ARM_MACH_OMAP1_CLOCK_H 15 15 16 16 #include <linux/clk.h> 17 + #include <linux/list.h> 17 18 18 - #include <plat/clock.h> 19 + #include <linux/clkdev.h> 20 + 21 + struct module; 22 + struct clk; 23 + 24 + struct omap_clk { 25 + u16 cpu; 26 + struct clk_lookup lk; 27 + }; 28 + 29 + #define CLK(dev, con, ck, cp) \ 30 + { \ 31 + .cpu = cp, \ 32 + .lk = { \ 33 + .dev_id = dev, \ 34 + .con_id = con, \ 35 + .clk = ck, \ 36 + }, \ 37 + } 38 + 39 + /* Platform flags for the clkdev-OMAP integration code */ 40 + #define CK_310 (1 << 0) 41 + #define CK_7XX (1 << 1) /* 7xx, 850 */ 42 + #define CK_1510 (1 << 2) 43 + #define CK_16XX (1 << 3) /* 16xx, 17xx, 5912 */ 44 + #define CK_1710 (1 << 4) /* 1710 extra for rate selection */ 45 + 46 + 47 + /* Temporary, needed during the common clock framework conversion */ 48 + #define __clk_get_name(clk) (clk->name) 49 + #define __clk_get_parent(clk) (clk->parent) 50 + #define __clk_get_rate(clk) (clk->rate) 51 + 52 + /** 53 + * struct clkops - some clock function pointers 54 + * @enable: fn ptr that enables the current clock in hardware 55 + * @disable: fn ptr that enables the current clock in hardware 56 + * @find_idlest: function returning the IDLEST register for the clock's IP blk 57 + * @find_companion: function returning the "companion" clk reg for the clock 58 + * @allow_idle: fn ptr that enables autoidle for the current clock in hardware 59 + * @deny_idle: fn ptr that disables autoidle for the current clock in hardware 60 + * 61 + * A "companion" clk is an accompanying clock to the one being queried 62 + * that must be enabled for the IP module connected to the clock to 63 + * become accessible by the hardware. Neither @find_idlest nor 64 + * @find_companion should be needed; that information is IP 65 + * block-specific; the hwmod code has been created to handle this, but 66 + * until hwmod data is ready and drivers have been converted to use PM 67 + * runtime calls in place of clk_enable()/clk_disable(), @find_idlest and 68 + * @find_companion must, unfortunately, remain. 69 + */ 70 + struct clkops { 71 + int (*enable)(struct clk *); 72 + void (*disable)(struct clk *); 73 + void (*find_idlest)(struct clk *, void __iomem **, 74 + u8 *, u8 *); 75 + void (*find_companion)(struct clk *, void __iomem **, 76 + u8 *); 77 + void (*allow_idle)(struct clk *); 78 + void (*deny_idle)(struct clk *); 79 + }; 80 + 81 + /* 82 + * struct clk.flags possibilities 83 + * 84 + * XXX document the rest of the clock flags here 85 + * 86 + * CLOCK_CLKOUTX2: (OMAP4 only) DPLL CLKOUT and CLKOUTX2 GATE_CTRL 87 + * bits share the same register. This flag allows the 88 + * omap4_dpllmx*() code to determine which GATE_CTRL bit field 89 + * should be used. This is a temporary solution - a better approach 90 + * would be to associate clock type-specific data with the clock, 91 + * similar to the struct dpll_data approach. 92 + */ 93 + #define ENABLE_REG_32BIT (1 << 0) /* Use 32-bit access */ 94 + #define CLOCK_IDLE_CONTROL (1 << 1) 95 + #define CLOCK_NO_IDLE_PARENT (1 << 2) 96 + #define ENABLE_ON_INIT (1 << 3) /* Enable upon framework init */ 97 + #define INVERT_ENABLE (1 << 4) /* 0 enables, 1 disables */ 98 + #define CLOCK_CLKOUTX2 (1 << 5) 99 + 100 + /** 101 + * struct clk - OMAP struct clk 102 + * @node: list_head connecting this clock into the full clock list 103 + * @ops: struct clkops * for this clock 104 + * @name: the name of the clock in the hardware (used in hwmod data and debug) 105 + * @parent: pointer to this clock's parent struct clk 106 + * @children: list_head connecting to the child clks' @sibling list_heads 107 + * @sibling: list_head connecting this clk to its parent clk's @children 108 + * @rate: current clock rate 109 + * @enable_reg: register to write to enable the clock (see @enable_bit) 110 + * @recalc: fn ptr that returns the clock's current rate 111 + * @set_rate: fn ptr that can change the clock's current rate 112 + * @round_rate: fn ptr that can round the clock's current rate 113 + * @init: fn ptr to do clock-specific initialization 114 + * @enable_bit: bitshift to write to enable/disable the clock (see @enable_reg) 115 + * @usecount: number of users that have requested this clock to be enabled 116 + * @fixed_div: when > 0, this clock's rate is its parent's rate / @fixed_div 117 + * @flags: see "struct clk.flags possibilities" above 118 + * @rate_offset: bitshift for rate selection bitfield (OMAP1 only) 119 + * @src_offset: bitshift for source selection bitfield (OMAP1 only) 120 + * 121 + * XXX @rate_offset, @src_offset should probably be removed and OMAP1 122 + * clock code converted to use clksel. 123 + * 124 + * XXX @usecount is poorly named. It should be "enable_count" or 125 + * something similar. "users" in the description refers to kernel 126 + * code (core code or drivers) that have called clk_enable() and not 127 + * yet called clk_disable(); the usecount of parent clocks is also 128 + * incremented by the clock code when clk_enable() is called on child 129 + * clocks and decremented by the clock code when clk_disable() is 130 + * called on child clocks. 131 + * 132 + * XXX @clkdm, @usecount, @children, @sibling should be marked for 133 + * internal use only. 134 + * 135 + * @children and @sibling are used to optimize parent-to-child clock 136 + * tree traversals. (child-to-parent traversals use @parent.) 137 + * 138 + * XXX The notion of the clock's current rate probably needs to be 139 + * separated from the clock's target rate. 140 + */ 141 + struct clk { 142 + struct list_head node; 143 + const struct clkops *ops; 144 + const char *name; 145 + struct clk *parent; 146 + struct list_head children; 147 + struct list_head sibling; /* node for children */ 148 + unsigned long rate; 149 + void __iomem *enable_reg; 150 + unsigned long (*recalc)(struct clk *); 151 + int (*set_rate)(struct clk *, unsigned long); 152 + long (*round_rate)(struct clk *, unsigned long); 153 + void (*init)(struct clk *); 154 + u8 enable_bit; 155 + s8 usecount; 156 + u8 fixed_div; 157 + u8 flags; 158 + u8 rate_offset; 159 + u8 src_offset; 160 + #if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS) 161 + struct dentry *dent; /* For visible tree hierarchy */ 162 + #endif 163 + }; 164 + 165 + struct clk_functions { 166 + int (*clk_enable)(struct clk *clk); 167 + void (*clk_disable)(struct clk *clk); 168 + long (*clk_round_rate)(struct clk *clk, unsigned long rate); 169 + int (*clk_set_rate)(struct clk *clk, unsigned long rate); 170 + int (*clk_set_parent)(struct clk *clk, struct clk *parent); 171 + void (*clk_allow_idle)(struct clk *clk); 172 + void (*clk_deny_idle)(struct clk *clk); 173 + void (*clk_disable_unused)(struct clk *clk); 174 + }; 175 + 176 + extern int mpurate; 177 + 178 + extern int clk_init(struct clk_functions *custom_clocks); 179 + extern void clk_preinit(struct clk *clk); 180 + extern int clk_register(struct clk *clk); 181 + extern void clk_reparent(struct clk *child, struct clk *parent); 182 + extern void clk_unregister(struct clk *clk); 183 + extern void propagate_rate(struct clk *clk); 184 + extern void recalculate_root_clocks(void); 185 + extern unsigned long followparent_recalc(struct clk *clk); 186 + extern void clk_enable_init_clocks(void); 187 + unsigned long omap_fixed_divisor_recalc(struct clk *clk); 188 + extern struct clk *omap_clk_get_by_name(const char *name); 189 + extern int omap_clk_enable_autoidle_all(void); 190 + extern int omap_clk_disable_autoidle_all(void); 191 + 192 + extern const struct clkops clkops_null; 193 + 194 + extern struct clk dummy_ck; 19 195 20 196 int omap1_clk_init(void); 21 197 void omap1_clk_late_init(void);
+2 -14
arch/arm/mach-omap1/clock_data.c
··· 22 22 23 23 #include <asm/mach-types.h> /* for machine_is_* */ 24 24 25 - #include <plat/clock.h> 26 - #include <plat/cpu.h> 27 - #include <plat/clkdev_omap.h> 28 - #include <plat/sram.h> /* for omap_sram_reprogram_clock() */ 25 + #include "soc.h" 29 26 30 27 #include <mach/hardware.h> 31 28 #include <mach/usb.h> /* for OTG_BASE */ 32 29 33 30 #include "iomap.h" 34 31 #include "clock.h" 32 + #include "sram.h" 35 33 36 34 /* Some ARM_IDLECT1 bit shifts - used in struct arm_idlect1_clk */ 37 35 #define IDL_CLKOUT_ARM_SHIFT 12 ··· 763 765 * init 764 766 */ 765 767 766 - static struct clk_functions omap1_clk_functions = { 767 - .clk_enable = omap1_clk_enable, 768 - .clk_disable = omap1_clk_disable, 769 - .clk_round_rate = omap1_clk_round_rate, 770 - .clk_set_rate = omap1_clk_set_rate, 771 - .clk_disable_unused = omap1_clk_disable_unused, 772 - }; 773 - 774 768 static void __init omap1_show_rates(void) 775 769 { 776 770 pr_notice("Clocking rate (xtal/DPLL1/MPU): %ld.%01ld/%ld.%01ld/%ld.%01ld MHz\n", ··· 792 802 omap_writew(reg, SOFT_REQ_REG); 793 803 if (!cpu_is_omap15xx()) 794 804 omap_writew(0, SOFT_REQ_REG2); 795 - 796 - clk_init(&omap1_clk_functions); 797 805 798 806 /* By default all idlect1 clocks are allowed to idle */ 799 807 arm_idlect1_mask = ~0;
+4 -1
arch/arm/mach-omap1/common.h
··· 26 26 #ifndef __ARCH_ARM_MACH_OMAP1_COMMON_H 27 27 #define __ARCH_ARM_MACH_OMAP1_COMMON_H 28 28 29 - #include <plat/common.h> 30 29 #include <linux/mtd/mtd.h> 30 + #include <linux/i2c-omap.h> 31 + 32 + #include <plat/i2c.h> 31 33 32 34 #if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850) 33 35 void omap7xx_map_io(void); ··· 40 38 #endif 41 39 42 40 #ifdef CONFIG_ARCH_OMAP15XX 41 + void omap1510_fpga_init_irq(void); 43 42 void omap15xx_map_io(void); 44 43 #else 45 44 static inline void omap15xx_map_io(void)
+11 -3
arch/arm/mach-omap1/devices.c
··· 19 19 20 20 #include <asm/mach/map.h> 21 21 22 - #include <plat/tc.h> 22 + #include <mach/tc.h> 23 23 #include <mach/mux.h> 24 - #include <plat/dma.h> 25 - #include <plat/mmc.h> 26 24 27 25 #include <mach/omap7xx.h> 28 26 #include <mach/camera.h> ··· 28 30 29 31 #include "common.h" 30 32 #include "clock.h" 33 + #include "dma.h" 34 + #include "mmc.h" 35 + #include "sram.h" 31 36 32 37 #if defined(CONFIG_SND_SOC) || defined(CONFIG_SND_SOC_MODULE) 33 38 ··· 175 174 res[3].start = tx_req; 176 175 res[3].name = "tx"; 177 176 res[3].flags = IORESOURCE_DMA; 177 + 178 + if (cpu_is_omap7xx()) 179 + data->slots[0].features = MMC_OMAP7XX; 180 + if (cpu_is_omap15xx()) 181 + data->slots[0].features = MMC_OMAP15XX; 182 + if (cpu_is_omap16xx()) 183 + data->slots[0].features = MMC_OMAP16XX; 178 184 179 185 ret = platform_device_add_resources(pdev, res, ARRAY_SIZE(res)); 180 186 if (ret == 0)
+7 -2
arch/arm/mach-omap1/dma.c
··· 25 25 #include <linux/device.h> 26 26 #include <linux/io.h> 27 27 28 - #include <plat/dma.h> 29 - #include <plat/tc.h> 28 + #include <plat-omap/dma-omap.h> 29 + #include <mach/tc.h> 30 30 31 31 #include <mach/irqs.h> 32 + 33 + #include "dma.h" 32 34 33 35 #define OMAP1_DMA_BASE (0xfffed800) 34 36 #define OMAP1_LOGICAL_DMA_CH_COUNT 17 ··· 320 318 if (cpu_is_omap15xx()) 321 319 d->dev_caps = ENABLE_1510_MODE; 322 320 enable_1510_mode = d->dev_caps & ENABLE_1510_MODE; 321 + 322 + if (cpu_is_omap16xx()) 323 + d->dev_caps = ENABLE_16XX_MODE; 323 324 324 325 d->dev_caps |= SRC_PORT; 325 326 d->dev_caps |= DST_PORT;
+83
arch/arm/mach-omap1/dma.h
··· 1 + /* 2 + * OMAP1 DMA channel definitions 3 + * 4 + * This program is free software; you can redistribute it and/or modify 5 + * it under the terms of the GNU General Public License as published by 6 + * the Free Software Foundation; either version 2 of the License, or 7 + * (at your option) any later version. 8 + * 9 + * This program is distributed in the hope that it will be useful, 10 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 + * GNU General Public License for more details. 13 + * 14 + * You should have received a copy of the GNU General Public License 15 + * along with this program; if not, write to the Free Software 16 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 + */ 18 + 19 + #ifndef __OMAP1_DMA_CHANNEL_H 20 + #define __OMAP1_DMA_CHANNEL_H 21 + 22 + /* DMA channels for omap1 */ 23 + #define OMAP_DMA_NO_DEVICE 0 24 + #define OMAP_DMA_MCSI1_TX 1 25 + #define OMAP_DMA_MCSI1_RX 2 26 + #define OMAP_DMA_I2C_RX 3 27 + #define OMAP_DMA_I2C_TX 4 28 + #define OMAP_DMA_EXT_NDMA_REQ 5 29 + #define OMAP_DMA_EXT_NDMA_REQ2 6 30 + #define OMAP_DMA_UWIRE_TX 7 31 + #define OMAP_DMA_MCBSP1_TX 8 32 + #define OMAP_DMA_MCBSP1_RX 9 33 + #define OMAP_DMA_MCBSP3_TX 10 34 + #define OMAP_DMA_MCBSP3_RX 11 35 + #define OMAP_DMA_UART1_TX 12 36 + #define OMAP_DMA_UART1_RX 13 37 + #define OMAP_DMA_UART2_TX 14 38 + #define OMAP_DMA_UART2_RX 15 39 + #define OMAP_DMA_MCBSP2_TX 16 40 + #define OMAP_DMA_MCBSP2_RX 17 41 + #define OMAP_DMA_UART3_TX 18 42 + #define OMAP_DMA_UART3_RX 19 43 + #define OMAP_DMA_CAMERA_IF_RX 20 44 + #define OMAP_DMA_MMC_TX 21 45 + #define OMAP_DMA_MMC_RX 22 46 + #define OMAP_DMA_NAND 23 47 + #define OMAP_DMA_IRQ_LCD_LINE 24 48 + #define OMAP_DMA_MEMORY_STICK 25 49 + #define OMAP_DMA_USB_W2FC_RX0 26 50 + #define OMAP_DMA_USB_W2FC_RX1 27 51 + #define OMAP_DMA_USB_W2FC_RX2 28 52 + #define OMAP_DMA_USB_W2FC_TX0 29 53 + #define OMAP_DMA_USB_W2FC_TX1 30 54 + #define OMAP_DMA_USB_W2FC_TX2 31 55 + 56 + /* These are only for 1610 */ 57 + #define OMAP_DMA_CRYPTO_DES_IN 32 58 + #define OMAP_DMA_SPI_TX 33 59 + #define OMAP_DMA_SPI_RX 34 60 + #define OMAP_DMA_CRYPTO_HASH 35 61 + #define OMAP_DMA_CCP_ATTN 36 62 + #define OMAP_DMA_CCP_FIFO_NOT_EMPTY 37 63 + #define OMAP_DMA_CMT_APE_TX_CHAN_0 38 64 + #define OMAP_DMA_CMT_APE_RV_CHAN_0 39 65 + #define OMAP_DMA_CMT_APE_TX_CHAN_1 40 66 + #define OMAP_DMA_CMT_APE_RV_CHAN_1 41 67 + #define OMAP_DMA_CMT_APE_TX_CHAN_2 42 68 + #define OMAP_DMA_CMT_APE_RV_CHAN_2 43 69 + #define OMAP_DMA_CMT_APE_TX_CHAN_3 44 70 + #define OMAP_DMA_CMT_APE_RV_CHAN_3 45 71 + #define OMAP_DMA_CMT_APE_TX_CHAN_4 46 72 + #define OMAP_DMA_CMT_APE_RV_CHAN_4 47 73 + #define OMAP_DMA_CMT_APE_TX_CHAN_5 48 74 + #define OMAP_DMA_CMT_APE_RV_CHAN_5 49 75 + #define OMAP_DMA_CMT_APE_TX_CHAN_6 50 76 + #define OMAP_DMA_CMT_APE_RV_CHAN_6 51 77 + #define OMAP_DMA_CMT_APE_TX_CHAN_7 52 78 + #define OMAP_DMA_CMT_APE_RV_CHAN_7 53 79 + #define OMAP_DMA_MMC2_TX 54 80 + #define OMAP_DMA_MMC2_RX 55 81 + #define OMAP_DMA_CRYPTO_DES_OUT 56 82 + 83 + #endif /* __OMAP1_DMA_CHANNEL_H */
+1 -1
arch/arm/mach-omap1/flash.c
··· 10 10 #include <linux/mtd/mtd.h> 11 11 #include <linux/mtd/map.h> 12 12 13 - #include <plat/tc.h> 13 + #include <mach/tc.h> 14 14 #include <mach/flash.h> 15 15 16 16 #include <mach/hardware.h>
+2 -2
arch/arm/mach-omap1/fpga.c
··· 27 27 #include <asm/irq.h> 28 28 #include <asm/mach/irq.h> 29 29 30 - #include <plat/fpga.h> 31 - 32 30 #include <mach/hardware.h> 33 31 34 32 #include "iomap.h" 33 + #include "common.h" 34 + #include "fpga.h" 35 35 36 36 static void fpga_mask_irq(struct irq_data *d) 37 37 {
+52
arch/arm/mach-omap1/fpga.h
··· 1 + /* 2 + * Interrupt handler for OMAP-1510 FPGA 3 + * 4 + * Copyright (C) 2001 RidgeRun, Inc. 5 + * Author: Greg Lonnon <glonnon@ridgerun.com> 6 + * 7 + * Copyright (C) 2002 MontaVista Software, Inc. 8 + * 9 + * Separated FPGA interrupts from innovator1510.c and cleaned up for 2.6 10 + * Copyright (C) 2004 Nokia Corporation by Tony Lindrgen <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 + #ifndef __ASM_ARCH_OMAP_FPGA_H 18 + #define __ASM_ARCH_OMAP_FPGA_H 19 + 20 + /* 21 + * --------------------------------------------------------------------------- 22 + * H2/P2 Debug board FPGA 23 + * --------------------------------------------------------------------------- 24 + */ 25 + /* maps in the FPGA registers and the ETHR registers */ 26 + #define H2P2_DBG_FPGA_BASE 0xE8000000 /* VA */ 27 + #define H2P2_DBG_FPGA_SIZE SZ_4K /* SIZE */ 28 + #define H2P2_DBG_FPGA_START 0x04000000 /* PA */ 29 + 30 + #define H2P2_DBG_FPGA_ETHR_START (H2P2_DBG_FPGA_START + 0x300) 31 + #define H2P2_DBG_FPGA_FPGA_REV IOMEM(H2P2_DBG_FPGA_BASE + 0x10) /* FPGA Revision */ 32 + #define H2P2_DBG_FPGA_BOARD_REV IOMEM(H2P2_DBG_FPGA_BASE + 0x12) /* Board Revision */ 33 + #define H2P2_DBG_FPGA_GPIO IOMEM(H2P2_DBG_FPGA_BASE + 0x14) /* GPIO outputs */ 34 + #define H2P2_DBG_FPGA_LEDS IOMEM(H2P2_DBG_FPGA_BASE + 0x16) /* LEDs outputs */ 35 + #define H2P2_DBG_FPGA_MISC_INPUTS IOMEM(H2P2_DBG_FPGA_BASE + 0x18) /* Misc inputs */ 36 + #define H2P2_DBG_FPGA_LAN_STATUS IOMEM(H2P2_DBG_FPGA_BASE + 0x1A) /* LAN Status line */ 37 + #define H2P2_DBG_FPGA_LAN_RESET IOMEM(H2P2_DBG_FPGA_BASE + 0x1C) /* LAN Reset line */ 38 + 39 + /* LEDs definition on debug board (16 LEDs, all physically green) */ 40 + #define H2P2_DBG_FPGA_LED_GREEN (1 << 15) 41 + #define H2P2_DBG_FPGA_LED_AMBER (1 << 14) 42 + #define H2P2_DBG_FPGA_LED_RED (1 << 13) 43 + #define H2P2_DBG_FPGA_LED_BLUE (1 << 12) 44 + /* cpu0 load-meter LEDs */ 45 + #define H2P2_DBG_FPGA_LOAD_METER (1 << 0) // A bit of fun on our board ... 46 + #define H2P2_DBG_FPGA_LOAD_METER_SIZE 11 47 + #define H2P2_DBG_FPGA_LOAD_METER_MASK ((1 << H2P2_DBG_FPGA_LOAD_METER_SIZE) - 1) 48 + 49 + #define H2P2_DBG_FPGA_P2_LED_TIMER (1 << 0) 50 + #define H2P2_DBG_FPGA_P2_LED_IDLE (1 << 1) 51 + 52 + #endif
+2
arch/arm/mach-omap1/gpio15xx.c
··· 19 19 #include <linux/gpio.h> 20 20 #include <linux/platform_data/gpio-omap.h> 21 21 22 + #include <mach/irqs.h> 23 + 22 24 #define OMAP1_MPUIO_VBASE OMAP1_MPUIO_BASE 23 25 #define OMAP1510_GPIO_BASE 0xFFFCE000 24 26
+2
arch/arm/mach-omap1/gpio16xx.c
··· 19 19 #include <linux/gpio.h> 20 20 #include <linux/platform_data/gpio-omap.h> 21 21 22 + #include <mach/irqs.h> 23 + 22 24 #define OMAP1610_GPIO1_BASE 0xfffbe400 23 25 #define OMAP1610_GPIO2_BASE 0xfffbec00 24 26 #define OMAP1610_GPIO3_BASE 0xfffbb400
+2
arch/arm/mach-omap1/gpio7xx.c
··· 19 19 #include <linux/gpio.h> 20 20 #include <linux/platform_data/gpio-omap.h> 21 21 22 + #include <mach/irqs.h> 23 + 22 24 #define OMAP7XX_GPIO1_BASE 0xfffbc000 23 25 #define OMAP7XX_GPIO2_BASE 0xfffbc800 24 26 #define OMAP7XX_GPIO3_BASE 0xfffbd000
+61 -3
arch/arm/mach-omap1/i2c.c
··· 19 19 * 20 20 */ 21 21 22 - #include <plat/i2c.h> 22 + #include <linux/i2c-omap.h> 23 23 #include <mach/mux.h> 24 - #include <plat/cpu.h> 24 + #include "soc.h" 25 25 26 - void __init omap1_i2c_mux_pins(int bus_id) 26 + #include <plat/i2c.h> 27 + 28 + #define OMAP_I2C_SIZE 0x3f 29 + #define OMAP1_I2C_BASE 0xfffb3800 30 + #define OMAP1_INT_I2C (32 + 4) 31 + 32 + static const char name[] = "omap_i2c"; 33 + 34 + static struct resource i2c_resources[2] = { 35 + }; 36 + 37 + static struct platform_device omap_i2c_devices[1] = { 38 + }; 39 + 40 + static void __init omap1_i2c_mux_pins(int bus_id) 27 41 { 28 42 if (cpu_is_omap7xx()) { 29 43 omap_cfg_reg(I2C_7XX_SDA); ··· 46 32 omap_cfg_reg(I2C_SDA); 47 33 omap_cfg_reg(I2C_SCL); 48 34 } 35 + } 36 + 37 + int __init omap_i2c_add_bus(struct omap_i2c_bus_platform_data *pdata, 38 + int bus_id) 39 + { 40 + struct platform_device *pdev; 41 + struct resource *res; 42 + 43 + if (bus_id > 1) 44 + return -EINVAL; 45 + 46 + omap1_i2c_mux_pins(bus_id); 47 + 48 + pdev = &omap_i2c_devices[bus_id - 1]; 49 + pdev->id = bus_id; 50 + pdev->name = name; 51 + pdev->num_resources = ARRAY_SIZE(i2c_resources); 52 + res = i2c_resources; 53 + res[0].start = OMAP1_I2C_BASE; 54 + res[0].end = res[0].start + OMAP_I2C_SIZE; 55 + res[0].flags = IORESOURCE_MEM; 56 + res[1].start = OMAP1_INT_I2C; 57 + res[1].flags = IORESOURCE_IRQ; 58 + pdev->resource = res; 59 + 60 + /* all OMAP1 have IP version 1 register set */ 61 + pdata->rev = OMAP_I2C_IP_VERSION_1; 62 + 63 + /* all OMAP1 I2C are implemented like this */ 64 + pdata->flags = OMAP_I2C_FLAG_NO_FIFO | 65 + OMAP_I2C_FLAG_SIMPLE_CLOCK | 66 + OMAP_I2C_FLAG_16BIT_DATA_REG | 67 + OMAP_I2C_FLAG_ALWAYS_ARMXOR_CLK; 68 + 69 + /* how the cpu bus is wired up differs for 7xx only */ 70 + 71 + if (cpu_is_omap7xx()) 72 + pdata->flags |= OMAP_I2C_FLAG_BUS_SHIFT_1; 73 + else 74 + pdata->flags |= OMAP_I2C_FLAG_BUS_SHIFT_2; 75 + 76 + pdev->dev.platform_data = pdata; 77 + 78 + return platform_device_register(pdev); 49 79 }
+1 -1
arch/arm/mach-omap1/id.c
··· 17 17 #include <linux/io.h> 18 18 #include <asm/system_info.h> 19 19 20 - #include <plat/cpu.h> 20 + #include "soc.h" 21 21 22 22 #include <mach/hardware.h> 23 23
+1 -1
arch/arm/mach-omap1/include/mach/debug-macro.S
··· 13 13 14 14 #include <linux/serial_reg.h> 15 15 16 - #include <plat/serial.h> 16 + #include "serial.h" 17 17 18 18 .pushsection .data 19 19 omap_uart_phys: .word 0x0
-2
arch/arm/mach-omap1/include/mach/entry-macro.S
··· 13 13 #include <mach/hardware.h> 14 14 #include <mach/irqs.h> 15 15 16 - #include "../../iomap.h" 17 - 18 16 .macro get_irqnr_preamble, base, tmp 19 17 .endm 20 18
-3
arch/arm/mach-omap1/include/mach/gpio.h
··· 1 - /* 2 - * arch/arm/mach-omap1/include/mach/gpio.h 3 - */
+6 -3
arch/arm/mach-omap1/include/mach/hardware.h
··· 39 39 #include <asm/sizes.h> 40 40 #ifndef __ASSEMBLER__ 41 41 #include <asm/types.h> 42 - #include <plat/cpu.h> 42 + #include <mach/soc.h> 43 43 44 44 /* 45 45 * NOTE: Please use ioremap + __raw_read/write where possible instead of these ··· 51 51 extern void omap_writew(u16 v, u32 pa); 52 52 extern void omap_writel(u32 v, u32 pa); 53 53 54 - #include <plat/tc.h> 54 + #include <mach/tc.h> 55 55 56 56 /* Almost all documentation for chip and board memory maps assumes 57 57 * BM is clear. Most devel boards have a switch to control booting ··· 72 72 73 73 #endif /* ifndef __ASSEMBLER__ */ 74 74 75 - #include <plat/serial.h> 75 + #define OMAP1_IO_OFFSET 0x01000000 /* Virtual IO = 0xfefb0000 */ 76 + #define OMAP1_IO_ADDRESS(pa) IOMEM((pa) - OMAP1_IO_OFFSET) 77 + 78 + #include <mach/serial.h> 76 79 77 80 /* 78 81 * ---------------------------------------------------------------------------
+1 -1
arch/arm/mach-omap1/include/mach/memory.h
··· 19 19 * because of the strncmp(). 20 20 */ 21 21 #if defined(CONFIG_ARCH_OMAP15XX) && !defined(__ASSEMBLER__) 22 - #include <plat/cpu.h> 22 + #include <mach/soc.h> 23 23 24 24 /* 25 25 * OMAP-1510 Local Bus address offset
+113
arch/arm/mach-omap1/include/mach/omap1510.h
··· 45 45 46 46 #define OMAP1510_DSP_MMU_BASE (0xfffed200) 47 47 48 + /* 49 + * --------------------------------------------------------------------------- 50 + * OMAP-1510 FPGA 51 + * --------------------------------------------------------------------------- 52 + */ 53 + #define OMAP1510_FPGA_BASE 0xE8000000 /* VA */ 54 + #define OMAP1510_FPGA_SIZE SZ_4K 55 + #define OMAP1510_FPGA_START 0x08000000 /* PA */ 56 + 57 + /* Revision */ 58 + #define OMAP1510_FPGA_REV_LOW IOMEM(OMAP1510_FPGA_BASE + 0x0) 59 + #define OMAP1510_FPGA_REV_HIGH IOMEM(OMAP1510_FPGA_BASE + 0x1) 60 + #define OMAP1510_FPGA_LCD_PANEL_CONTROL IOMEM(OMAP1510_FPGA_BASE + 0x2) 61 + #define OMAP1510_FPGA_LED_DIGIT IOMEM(OMAP1510_FPGA_BASE + 0x3) 62 + #define INNOVATOR_FPGA_HID_SPI IOMEM(OMAP1510_FPGA_BASE + 0x4) 63 + #define OMAP1510_FPGA_POWER IOMEM(OMAP1510_FPGA_BASE + 0x5) 64 + 65 + /* Interrupt status */ 66 + #define OMAP1510_FPGA_ISR_LO IOMEM(OMAP1510_FPGA_BASE + 0x6) 67 + #define OMAP1510_FPGA_ISR_HI IOMEM(OMAP1510_FPGA_BASE + 0x7) 68 + 69 + /* Interrupt mask */ 70 + #define OMAP1510_FPGA_IMR_LO IOMEM(OMAP1510_FPGA_BASE + 0x8) 71 + #define OMAP1510_FPGA_IMR_HI IOMEM(OMAP1510_FPGA_BASE + 0x9) 72 + 73 + /* Reset registers */ 74 + #define OMAP1510_FPGA_HOST_RESET IOMEM(OMAP1510_FPGA_BASE + 0xa) 75 + #define OMAP1510_FPGA_RST IOMEM(OMAP1510_FPGA_BASE + 0xb) 76 + 77 + #define OMAP1510_FPGA_AUDIO IOMEM(OMAP1510_FPGA_BASE + 0xc) 78 + #define OMAP1510_FPGA_DIP IOMEM(OMAP1510_FPGA_BASE + 0xe) 79 + #define OMAP1510_FPGA_FPGA_IO IOMEM(OMAP1510_FPGA_BASE + 0xf) 80 + #define OMAP1510_FPGA_UART1 IOMEM(OMAP1510_FPGA_BASE + 0x14) 81 + #define OMAP1510_FPGA_UART2 IOMEM(OMAP1510_FPGA_BASE + 0x15) 82 + #define OMAP1510_FPGA_OMAP1510_STATUS IOMEM(OMAP1510_FPGA_BASE + 0x16) 83 + #define OMAP1510_FPGA_BOARD_REV IOMEM(OMAP1510_FPGA_BASE + 0x18) 84 + #define INNOVATOR_FPGA_CAM_USB_CONTROL IOMEM(OMAP1510_FPGA_BASE + 0x20c) 85 + #define OMAP1510P1_PPT_DATA IOMEM(OMAP1510_FPGA_BASE + 0x100) 86 + #define OMAP1510P1_PPT_STATUS IOMEM(OMAP1510_FPGA_BASE + 0x101) 87 + #define OMAP1510P1_PPT_CONTROL IOMEM(OMAP1510_FPGA_BASE + 0x102) 88 + 89 + #define OMAP1510_FPGA_TOUCHSCREEN IOMEM(OMAP1510_FPGA_BASE + 0x204) 90 + 91 + #define INNOVATOR_FPGA_INFO IOMEM(OMAP1510_FPGA_BASE + 0x205) 92 + #define INNOVATOR_FPGA_LCD_BRIGHT_LO IOMEM(OMAP1510_FPGA_BASE + 0x206) 93 + #define INNOVATOR_FPGA_LCD_BRIGHT_HI IOMEM(OMAP1510_FPGA_BASE + 0x207) 94 + #define INNOVATOR_FPGA_LED_GRN_LO IOMEM(OMAP1510_FPGA_BASE + 0x208) 95 + #define INNOVATOR_FPGA_LED_GRN_HI IOMEM(OMAP1510_FPGA_BASE + 0x209) 96 + #define INNOVATOR_FPGA_LED_RED_LO IOMEM(OMAP1510_FPGA_BASE + 0x20a) 97 + #define INNOVATOR_FPGA_LED_RED_HI IOMEM(OMAP1510_FPGA_BASE + 0x20b) 98 + #define INNOVATOR_FPGA_EXP_CONTROL IOMEM(OMAP1510_FPGA_BASE + 0x20d) 99 + #define INNOVATOR_FPGA_ISR2 IOMEM(OMAP1510_FPGA_BASE + 0x20e) 100 + #define INNOVATOR_FPGA_IMR2 IOMEM(OMAP1510_FPGA_BASE + 0x210) 101 + 102 + #define OMAP1510_FPGA_ETHR_START (OMAP1510_FPGA_START + 0x300) 103 + 104 + /* 105 + * Power up Giga UART driver, turn on HID clock. 106 + * Turn off BT power, since we're not using it and it 107 + * draws power. 108 + */ 109 + #define OMAP1510_FPGA_RESET_VALUE 0x42 110 + 111 + #define OMAP1510_FPGA_PCR_IF_PD0 (1 << 7) 112 + #define OMAP1510_FPGA_PCR_COM2_EN (1 << 6) 113 + #define OMAP1510_FPGA_PCR_COM1_EN (1 << 5) 114 + #define OMAP1510_FPGA_PCR_EXP_PD0 (1 << 4) 115 + #define OMAP1510_FPGA_PCR_EXP_PD1 (1 << 3) 116 + #define OMAP1510_FPGA_PCR_48MHZ_CLK (1 << 2) 117 + #define OMAP1510_FPGA_PCR_4MHZ_CLK (1 << 1) 118 + #define OMAP1510_FPGA_PCR_RSRVD_BIT0 (1 << 0) 119 + 120 + /* 121 + * Innovator/OMAP1510 FPGA HID register bit definitions 122 + */ 123 + #define OMAP1510_FPGA_HID_SCLK (1<<0) /* output */ 124 + #define OMAP1510_FPGA_HID_MOSI (1<<1) /* output */ 125 + #define OMAP1510_FPGA_HID_nSS (1<<2) /* output 0/1 chip idle/select */ 126 + #define OMAP1510_FPGA_HID_nHSUS (1<<3) /* output 0/1 host active/suspended */ 127 + #define OMAP1510_FPGA_HID_MISO (1<<4) /* input */ 128 + #define OMAP1510_FPGA_HID_ATN (1<<5) /* input 0/1 chip idle/ATN */ 129 + #define OMAP1510_FPGA_HID_rsrvd (1<<6) 130 + #define OMAP1510_FPGA_HID_RESETn (1<<7) /* output - 0/1 USAR reset/run */ 131 + 132 + /* The FPGA IRQ is cascaded through GPIO_13 */ 133 + #define OMAP1510_INT_FPGA (IH_GPIO_BASE + 13) 134 + 135 + /* IRQ Numbers for interrupts muxed through the FPGA */ 136 + #define OMAP1510_INT_FPGA_ATN (OMAP_FPGA_IRQ_BASE + 0) 137 + #define OMAP1510_INT_FPGA_ACK (OMAP_FPGA_IRQ_BASE + 1) 138 + #define OMAP1510_INT_FPGA2 (OMAP_FPGA_IRQ_BASE + 2) 139 + #define OMAP1510_INT_FPGA3 (OMAP_FPGA_IRQ_BASE + 3) 140 + #define OMAP1510_INT_FPGA4 (OMAP_FPGA_IRQ_BASE + 4) 141 + #define OMAP1510_INT_FPGA5 (OMAP_FPGA_IRQ_BASE + 5) 142 + #define OMAP1510_INT_FPGA6 (OMAP_FPGA_IRQ_BASE + 6) 143 + #define OMAP1510_INT_FPGA7 (OMAP_FPGA_IRQ_BASE + 7) 144 + #define OMAP1510_INT_FPGA8 (OMAP_FPGA_IRQ_BASE + 8) 145 + #define OMAP1510_INT_FPGA9 (OMAP_FPGA_IRQ_BASE + 9) 146 + #define OMAP1510_INT_FPGA10 (OMAP_FPGA_IRQ_BASE + 10) 147 + #define OMAP1510_INT_FPGA11 (OMAP_FPGA_IRQ_BASE + 11) 148 + #define OMAP1510_INT_FPGA12 (OMAP_FPGA_IRQ_BASE + 12) 149 + #define OMAP1510_INT_ETHER (OMAP_FPGA_IRQ_BASE + 13) 150 + #define OMAP1510_INT_FPGAUART1 (OMAP_FPGA_IRQ_BASE + 14) 151 + #define OMAP1510_INT_FPGAUART2 (OMAP_FPGA_IRQ_BASE + 15) 152 + #define OMAP1510_INT_FPGA_TS (OMAP_FPGA_IRQ_BASE + 16) 153 + #define OMAP1510_INT_FPGA17 (OMAP_FPGA_IRQ_BASE + 17) 154 + #define OMAP1510_INT_FPGA_CAM (OMAP_FPGA_IRQ_BASE + 18) 155 + #define OMAP1510_INT_FPGA_RTC_A (OMAP_FPGA_IRQ_BASE + 19) 156 + #define OMAP1510_INT_FPGA_RTC_B (OMAP_FPGA_IRQ_BASE + 20) 157 + #define OMAP1510_INT_FPGA_CD (OMAP_FPGA_IRQ_BASE + 21) 158 + #define OMAP1510_INT_FPGA22 (OMAP_FPGA_IRQ_BASE + 22) 159 + #define OMAP1510_INT_FPGA23 (OMAP_FPGA_IRQ_BASE + 23) 160 + 48 161 #endif /* __ASM_ARCH_OMAP15XX_H */ 49 162
+53
arch/arm/mach-omap1/include/mach/serial.h
··· 1 + /* 2 + * Copyright (C) 2009 Texas Instruments 3 + * Added OMAP4 support- Santosh Shilimkar <santosh.shilimkar@ti.com> 4 + * 5 + * This program is distributed in the hope that it will be useful, 6 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 7 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 8 + * GNU General Public License for more details. 9 + */ 10 + 11 + #ifndef __ASM_ARCH_SERIAL_H 12 + #define __ASM_ARCH_SERIAL_H 13 + 14 + #include <linux/init.h> 15 + 16 + /* 17 + * Memory entry used for the DEBUG_LL UART configuration, relative to 18 + * start of RAM. See also uncompress.h and debug-macro.S. 19 + * 20 + * Note that using a memory location for storing the UART configuration 21 + * has at least two limitations: 22 + * 23 + * 1. Kernel uncompress code cannot overlap OMAP_UART_INFO as the 24 + * uncompress code could then partially overwrite itself 25 + * 2. We assume printascii is called at least once before paging_init, 26 + * and addruart has a chance to read OMAP_UART_INFO 27 + */ 28 + #define OMAP_UART_INFO_OFS 0x3ffc 29 + 30 + /* OMAP1 serial ports */ 31 + #define OMAP1_UART1_BASE 0xfffb0000 32 + #define OMAP1_UART2_BASE 0xfffb0800 33 + #define OMAP1_UART3_BASE 0xfffb9800 34 + 35 + #define OMAP_PORT_SHIFT 2 36 + #define OMAP7XX_PORT_SHIFT 0 37 + 38 + #define OMAP1510_BASE_BAUD (12000000/16) 39 + #define OMAP16XX_BASE_BAUD (48000000/16) 40 + 41 + /* 42 + * DEBUG_LL port encoding stored into the UART1 scratchpad register by 43 + * decomp_setup in uncompress.h 44 + */ 45 + #define OMAP1UART1 11 46 + #define OMAP1UART2 12 47 + #define OMAP1UART3 13 48 + 49 + #ifndef __ASSEMBLER__ 50 + extern void omap_serial_init(void); 51 + #endif 52 + 53 + #endif
+229
arch/arm/mach-omap1/include/mach/soc.h
··· 1 + /* 2 + * OMAP cpu type detection 3 + * 4 + * Copyright (C) 2004, 2008 Nokia Corporation 5 + * 6 + * Copyright (C) 2009-11 Texas Instruments. 7 + * 8 + * Written by Tony Lindgren <tony.lindgren@nokia.com> 9 + * 10 + * Added OMAP4/5 specific defines - Santosh Shilimkar<santosh.shilimkar@ti.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 as published by 14 + * the Free Software Foundation; either version 2 of the License, or 15 + * (at your option) any later version. 16 + * 17 + * This program is distributed in the hope that it will be useful, 18 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 + * GNU General Public License for more details. 21 + * 22 + * You should have received a copy of the GNU General Public License 23 + * along with this program; if not, write to the Free Software 24 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 25 + * 26 + */ 27 + 28 + #ifndef __ASM_ARCH_OMAP_CPU_H 29 + #define __ASM_ARCH_OMAP_CPU_H 30 + 31 + #ifndef __ASSEMBLY__ 32 + 33 + #include <linux/bitops.h> 34 + 35 + /* 36 + * Test if multicore OMAP support is needed 37 + */ 38 + #undef MULTI_OMAP1 39 + #undef OMAP_NAME 40 + 41 + #ifdef CONFIG_ARCH_OMAP730 42 + # ifdef OMAP_NAME 43 + # undef MULTI_OMAP1 44 + # define MULTI_OMAP1 45 + # else 46 + # define OMAP_NAME omap730 47 + # endif 48 + #endif 49 + #ifdef CONFIG_ARCH_OMAP850 50 + # ifdef OMAP_NAME 51 + # undef MULTI_OMAP1 52 + # define MULTI_OMAP1 53 + # else 54 + # define OMAP_NAME omap850 55 + # endif 56 + #endif 57 + #ifdef CONFIG_ARCH_OMAP15XX 58 + # ifdef OMAP_NAME 59 + # undef MULTI_OMAP1 60 + # define MULTI_OMAP1 61 + # else 62 + # define OMAP_NAME omap1510 63 + # endif 64 + #endif 65 + #ifdef CONFIG_ARCH_OMAP16XX 66 + # ifdef OMAP_NAME 67 + # undef MULTI_OMAP1 68 + # define MULTI_OMAP1 69 + # else 70 + # define OMAP_NAME omap16xx 71 + # endif 72 + #endif 73 + 74 + /* 75 + * omap_rev bits: 76 + * CPU id bits (0730, 1510, 1710, 2422...) [31:16] 77 + * CPU revision (See _REV_ defined in cpu.h) [15:08] 78 + * CPU class bits (15xx, 16xx, 24xx, 34xx...) [07:00] 79 + */ 80 + unsigned int omap_rev(void); 81 + 82 + /* 83 + * Get the CPU revision for OMAP devices 84 + */ 85 + #define GET_OMAP_REVISION() ((omap_rev() >> 8) & 0xff) 86 + 87 + /* 88 + * Macros to group OMAP into cpu classes. 89 + * These can be used in most places. 90 + * cpu_is_omap7xx(): True for OMAP730, OMAP850 91 + * cpu_is_omap15xx(): True for OMAP1510, OMAP5910 and OMAP310 92 + * cpu_is_omap16xx(): True for OMAP1610, OMAP5912 and OMAP1710 93 + */ 94 + #define GET_OMAP_CLASS (omap_rev() & 0xff) 95 + 96 + #define IS_OMAP_CLASS(class, id) \ 97 + static inline int is_omap ##class (void) \ 98 + { \ 99 + return (GET_OMAP_CLASS == (id)) ? 1 : 0; \ 100 + } 101 + 102 + #define GET_OMAP_SUBCLASS ((omap_rev() >> 20) & 0x0fff) 103 + 104 + #define IS_OMAP_SUBCLASS(subclass, id) \ 105 + static inline int is_omap ##subclass (void) \ 106 + { \ 107 + return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0; \ 108 + } 109 + 110 + IS_OMAP_CLASS(7xx, 0x07) 111 + IS_OMAP_CLASS(15xx, 0x15) 112 + IS_OMAP_CLASS(16xx, 0x16) 113 + 114 + #define cpu_is_omap7xx() 0 115 + #define cpu_is_omap15xx() 0 116 + #define cpu_is_omap16xx() 0 117 + 118 + #if defined(MULTI_OMAP1) 119 + # if defined(CONFIG_ARCH_OMAP730) 120 + # undef cpu_is_omap7xx 121 + # define cpu_is_omap7xx() is_omap7xx() 122 + # endif 123 + # if defined(CONFIG_ARCH_OMAP850) 124 + # undef cpu_is_omap7xx 125 + # define cpu_is_omap7xx() is_omap7xx() 126 + # endif 127 + # if defined(CONFIG_ARCH_OMAP15XX) 128 + # undef cpu_is_omap15xx 129 + # define cpu_is_omap15xx() is_omap15xx() 130 + # endif 131 + # if defined(CONFIG_ARCH_OMAP16XX) 132 + # undef cpu_is_omap16xx 133 + # define cpu_is_omap16xx() is_omap16xx() 134 + # endif 135 + #else 136 + # if defined(CONFIG_ARCH_OMAP730) 137 + # undef cpu_is_omap7xx 138 + # define cpu_is_omap7xx() 1 139 + # endif 140 + # if defined(CONFIG_ARCH_OMAP850) 141 + # undef cpu_is_omap7xx 142 + # define cpu_is_omap7xx() 1 143 + # endif 144 + # if defined(CONFIG_ARCH_OMAP15XX) 145 + # undef cpu_is_omap15xx 146 + # define cpu_is_omap15xx() 1 147 + # endif 148 + # if defined(CONFIG_ARCH_OMAP16XX) 149 + # undef cpu_is_omap16xx 150 + # define cpu_is_omap16xx() 1 151 + # endif 152 + #endif 153 + 154 + /* 155 + * Macros to detect individual cpu types. 156 + * These are only rarely needed. 157 + * cpu_is_omap310(): True for OMAP310 158 + * cpu_is_omap1510(): True for OMAP1510 159 + * cpu_is_omap1610(): True for OMAP1610 160 + * cpu_is_omap1611(): True for OMAP1611 161 + * cpu_is_omap5912(): True for OMAP5912 162 + * cpu_is_omap1621(): True for OMAP1621 163 + * cpu_is_omap1710(): True for OMAP1710 164 + */ 165 + #define GET_OMAP_TYPE ((omap_rev() >> 16) & 0xffff) 166 + 167 + #define IS_OMAP_TYPE(type, id) \ 168 + static inline int is_omap ##type (void) \ 169 + { \ 170 + return (GET_OMAP_TYPE == (id)) ? 1 : 0; \ 171 + } 172 + 173 + IS_OMAP_TYPE(310, 0x0310) 174 + IS_OMAP_TYPE(1510, 0x1510) 175 + IS_OMAP_TYPE(1610, 0x1610) 176 + IS_OMAP_TYPE(1611, 0x1611) 177 + IS_OMAP_TYPE(5912, 0x1611) 178 + IS_OMAP_TYPE(1621, 0x1621) 179 + IS_OMAP_TYPE(1710, 0x1710) 180 + 181 + #define cpu_is_omap310() 0 182 + #define cpu_is_omap1510() 0 183 + #define cpu_is_omap1610() 0 184 + #define cpu_is_omap5912() 0 185 + #define cpu_is_omap1611() 0 186 + #define cpu_is_omap1621() 0 187 + #define cpu_is_omap1710() 0 188 + 189 + /* These are needed to compile common code */ 190 + #ifdef CONFIG_ARCH_OMAP1 191 + #define cpu_is_omap242x() 0 192 + #define cpu_is_omap2430() 0 193 + #define cpu_is_omap243x() 0 194 + #define cpu_is_omap24xx() 0 195 + #define cpu_is_omap34xx() 0 196 + #define cpu_is_omap44xx() 0 197 + #define soc_is_omap54xx() 0 198 + #define soc_is_am33xx() 0 199 + #define cpu_class_is_omap1() 1 200 + #define cpu_class_is_omap2() 0 201 + #endif 202 + 203 + /* 204 + * Whether we have MULTI_OMAP1 or not, we still need to distinguish 205 + * between 310 vs. 1510 and 1611B/5912 vs. 1710. 206 + */ 207 + 208 + #if defined(CONFIG_ARCH_OMAP15XX) 209 + # undef cpu_is_omap310 210 + # undef cpu_is_omap1510 211 + # define cpu_is_omap310() is_omap310() 212 + # define cpu_is_omap1510() is_omap1510() 213 + #endif 214 + 215 + #if defined(CONFIG_ARCH_OMAP16XX) 216 + # undef cpu_is_omap1610 217 + # undef cpu_is_omap1611 218 + # undef cpu_is_omap5912 219 + # undef cpu_is_omap1621 220 + # undef cpu_is_omap1710 221 + # define cpu_is_omap1610() is_omap1610() 222 + # define cpu_is_omap1611() is_omap1611() 223 + # define cpu_is_omap5912() is_omap5912() 224 + # define cpu_is_omap1621() is_omap1621() 225 + # define cpu_is_omap1710() is_omap1710() 226 + #endif 227 + 228 + #endif /* __ASSEMBLY__ */ 229 + #endif
+119 -2
arch/arm/mach-omap1/include/mach/uncompress.h
··· 1 1 /* 2 - * arch/arm/mach-omap1/include/mach/uncompress.h 2 + * arch/arm/plat-omap/include/mach/uncompress.h 3 + * 4 + * Serial port stubs for kernel decompress status messages 5 + * 6 + * Initially based on: 7 + * linux-2.4.15-rmk1-dsplinux1.6/arch/arm/plat-omap/include/mach1510/uncompress.h 8 + * Copyright (C) 2000 RidgeRun, Inc. 9 + * Author: Greg Lonnon <glonnon@ridgerun.com> 10 + * 11 + * Rewritten by: 12 + * Author: <source@mvista.com> 13 + * 2004 (c) MontaVista Software, Inc. 14 + * 15 + * This file is licensed under the terms of the GNU General Public License 16 + * version 2. This program is licensed "as is" without any warranty of any 17 + * kind, whether express or implied. 3 18 */ 4 19 5 - #include <plat/uncompress.h> 20 + #include <linux/types.h> 21 + #include <linux/serial_reg.h> 22 + 23 + #include <asm/memory.h> 24 + #include <asm/mach-types.h> 25 + 26 + #include "serial.h" 27 + 28 + #define MDR1_MODE_MASK 0x07 29 + 30 + volatile u8 *uart_base; 31 + int uart_shift; 32 + 33 + /* 34 + * Store the DEBUG_LL uart number into memory. 35 + * See also debug-macro.S, and serial.c for related code. 36 + */ 37 + static void set_omap_uart_info(unsigned char port) 38 + { 39 + /* 40 + * Get address of some.bss variable and round it down 41 + * a la CONFIG_AUTO_ZRELADDR. 42 + */ 43 + u32 ram_start = (u32)&uart_shift & 0xf8000000; 44 + u32 *uart_info = (u32 *)(ram_start + OMAP_UART_INFO_OFS); 45 + *uart_info = port; 46 + } 47 + 48 + static void putc(int c) 49 + { 50 + if (!uart_base) 51 + return; 52 + 53 + /* Check for UART 16x mode */ 54 + if ((uart_base[UART_OMAP_MDR1 << uart_shift] & MDR1_MODE_MASK) != 0) 55 + return; 56 + 57 + while (!(uart_base[UART_LSR << uart_shift] & UART_LSR_THRE)) 58 + barrier(); 59 + uart_base[UART_TX << uart_shift] = c; 60 + } 61 + 62 + static inline void flush(void) 63 + { 64 + } 65 + 66 + /* 67 + * Macros to configure UART1 and debug UART 68 + */ 69 + #define _DEBUG_LL_ENTRY(mach, dbg_uart, dbg_shft, dbg_id) \ 70 + if (machine_is_##mach()) { \ 71 + uart_base = (volatile u8 *)(dbg_uart); \ 72 + uart_shift = (dbg_shft); \ 73 + port = (dbg_id); \ 74 + set_omap_uart_info(port); \ 75 + break; \ 76 + } 77 + 78 + #define DEBUG_LL_OMAP7XX(p, mach) \ 79 + _DEBUG_LL_ENTRY(mach, OMAP1_UART##p##_BASE, OMAP7XX_PORT_SHIFT, \ 80 + OMAP1UART##p) 81 + 82 + #define DEBUG_LL_OMAP1(p, mach) \ 83 + _DEBUG_LL_ENTRY(mach, OMAP1_UART##p##_BASE, OMAP_PORT_SHIFT, \ 84 + OMAP1UART##p) 85 + 86 + static inline void arch_decomp_setup(void) 87 + { 88 + int port = 0; 89 + 90 + /* 91 + * Initialize the port based on the machine ID from the bootloader. 92 + * Note that we're using macros here instead of switch statement 93 + * as machine_is functions are optimized out for the boards that 94 + * are not selected. 95 + */ 96 + do { 97 + /* omap7xx/8xx based boards using UART1 with shift 0 */ 98 + DEBUG_LL_OMAP7XX(1, herald); 99 + DEBUG_LL_OMAP7XX(1, omap_perseus2); 100 + 101 + /* omap15xx/16xx based boards using UART1 */ 102 + DEBUG_LL_OMAP1(1, ams_delta); 103 + DEBUG_LL_OMAP1(1, nokia770); 104 + DEBUG_LL_OMAP1(1, omap_h2); 105 + DEBUG_LL_OMAP1(1, omap_h3); 106 + DEBUG_LL_OMAP1(1, omap_innovator); 107 + DEBUG_LL_OMAP1(1, omap_osk); 108 + DEBUG_LL_OMAP1(1, omap_palmte); 109 + DEBUG_LL_OMAP1(1, omap_palmz71); 110 + 111 + /* omap15xx/16xx based boards using UART2 */ 112 + DEBUG_LL_OMAP1(2, omap_palmtt); 113 + 114 + /* omap15xx/16xx based boards using UART3 */ 115 + DEBUG_LL_OMAP1(3, sx1); 116 + } while (0); 117 + } 118 + 119 + /* 120 + * nothing to do 121 + */ 122 + #define arch_decomp_wdog()
+2 -3
arch/arm/mach-omap1/io.c
··· 17 17 #include <asm/mach/map.h> 18 18 19 19 #include <mach/mux.h> 20 - #include <plat/tc.h> 21 - #include <plat/dma.h> 20 + #include <mach/tc.h> 21 + #include <plat-omap/dma-omap.h> 22 22 23 23 #include "iomap.h" 24 24 #include "common.h" ··· 134 134 */ 135 135 omap1_clk_init(); 136 136 omap1_mux_init(); 137 - omap_init_consistent_dma_size(); 138 137 } 139 138 140 139 void __init omap1_init_late(void)
-3
arch/arm/mach-omap1/iomap.h
··· 22 22 * 675 Mass Ave, Cambridge, MA 02139, USA. 23 23 */ 24 24 25 - #define OMAP1_IO_OFFSET 0x01000000 /* Virtual IO = 0xfefb0000 */ 26 - #define OMAP1_IO_ADDRESS(pa) IOMEM((pa) - OMAP1_IO_OFFSET) 27 - 28 25 /* 29 26 * ---------------------------------------------------------------------------- 30 27 * Omap1 specific IO mapping
+1 -1
arch/arm/mach-omap1/irq.c
··· 45 45 #include <asm/irq.h> 46 46 #include <asm/mach/irq.h> 47 47 48 - #include <plat/cpu.h> 48 + #include "soc.h" 49 49 50 50 #include <mach/hardware.h> 51 51
+3 -1
arch/arm/mach-omap1/lcd_dma.c
··· 27 27 #include <linux/interrupt.h> 28 28 #include <linux/io.h> 29 29 30 - #include <plat/dma.h> 30 + #include <plat-omap/dma-omap.h> 31 31 32 32 #include <mach/hardware.h> 33 33 #include <mach/lcdc.h> 34 + 35 + #include "dma.h" 34 36 35 37 int omap_lcd_dma_running(void) 36 38 {
+3 -2
arch/arm/mach-omap1/mcbsp.c
··· 19 19 #include <linux/platform_device.h> 20 20 #include <linux/slab.h> 21 21 22 - #include <plat/dma.h> 22 + #include <plat-omap/dma-omap.h> 23 23 #include <mach/mux.h> 24 - #include <plat/cpu.h> 24 + #include "soc.h" 25 25 #include <linux/platform_data/asoc-ti-mcbsp.h> 26 26 27 27 #include <mach/irqs.h> 28 28 29 29 #include "iomap.h" 30 + #include "dma.h" 30 31 31 32 #define DPS_RSTCT2_PER_EN (1 << 0) 32 33 #define DSP_RSTCT2_WD_PER_EN (1 << 1)
+18
arch/arm/mach-omap1/mmc.h
··· 1 + #include <linux/mmc/host.h> 2 + #include <linux/platform_data/mmc-omap.h> 3 + 4 + #define OMAP15XX_NR_MMC 1 5 + #define OMAP16XX_NR_MMC 2 6 + #define OMAP1_MMC_SIZE 0x080 7 + #define OMAP1_MMC1_BASE 0xfffb7800 8 + #define OMAP1_MMC2_BASE 0xfffb7c00 /* omap16xx only */ 9 + 10 + #if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) 11 + void omap1_init_mmc(struct omap_mmc_platform_data **mmc_data, 12 + int nr_controllers); 13 + #else 14 + static inline void omap1_init_mmc(struct omap_mmc_platform_data **mmc_data, 15 + int nr_controllers) 16 + { 17 + } 18 + #endif
+1 -1
arch/arm/mach-omap1/opp_data.c
··· 10 10 * published by the Free Software Foundation. 11 11 */ 12 12 13 - #include <plat/clkdev_omap.h> 13 + #include "clock.h" 14 14 #include "opp.h" 15 15 16 16 /*-------------------------------------------------------------------------
+5 -5
arch/arm/mach-omap1/pm.c
··· 44 44 #include <linux/io.h> 45 45 #include <linux/atomic.h> 46 46 47 + #include <asm/fncpy.h> 47 48 #include <asm/system_misc.h> 48 49 #include <asm/irq.h> 49 50 #include <asm/mach/time.h> 50 51 #include <asm/mach/irq.h> 51 52 52 - #include <plat/cpu.h> 53 - #include <plat/clock.h> 54 - #include <plat/sram.h> 55 - #include <plat/tc.h> 53 + #include <mach/tc.h> 56 54 #include <mach/mux.h> 57 - #include <plat/dma.h> 55 + #include <plat-omap/dma-omap.h> 58 56 #include <plat/dmtimer.h> 59 57 60 58 #include <mach/irqs.h> 61 59 62 60 #include "iomap.h" 61 + #include "clock.h" 63 62 #include "pm.h" 63 + #include "sram.h" 64 64 65 65 static unsigned int arm_sleep_save[ARM_SLEEP_SAVE_SIZE]; 66 66 static unsigned short dsp_sleep_save[DSP_SLEEP_SAVE_SIZE];
+1 -2
arch/arm/mach-omap1/pm_bus.c
··· 19 19 #include <linux/clk.h> 20 20 #include <linux/err.h> 21 21 22 - #include <plat/omap_device.h> 23 - #include <plat/omap-pm.h> 22 + #include "soc.h" 24 23 25 24 #ifdef CONFIG_PM_RUNTIME 26 25 static int omap1_pm_runtime_suspend(struct device *dev)
-1
arch/arm/mach-omap1/serial.c
··· 23 23 #include <asm/mach-types.h> 24 24 25 25 #include <mach/mux.h> 26 - #include <plat/fpga.h> 27 26 28 27 #include "pm.h" 29 28
+2
arch/arm/mach-omap1/sleep.S
··· 36 36 37 37 #include <asm/assembler.h> 38 38 39 + #include <mach/hardware.h> 40 + 39 41 #include "iomap.h" 40 42 #include "pm.h" 41 43
+4
arch/arm/mach-omap1/soc.h
··· 1 + /* 2 + * We can move mach/soc.h here once the drivers are fixed 3 + */ 4 + #include <mach/soc.h>
+76
arch/arm/mach-omap1/sram-init.c
··· 1 + /* 2 + * OMAP SRAM detection and management 3 + * 4 + * Copyright (C) 2005 Nokia Corporation 5 + * Written by Tony Lindgren <tony@atomide.com> 6 + * 7 + * This program 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 + 12 + #include <linux/module.h> 13 + #include <linux/kernel.h> 14 + #include <linux/init.h> 15 + #include <linux/io.h> 16 + 17 + #include <asm/fncpy.h> 18 + #include <asm/tlb.h> 19 + #include <asm/cacheflush.h> 20 + 21 + #include <asm/mach/map.h> 22 + 23 + #include "soc.h" 24 + #include "sram.h" 25 + 26 + #define OMAP1_SRAM_PA 0x20000000 27 + #define SRAM_BOOTLOADER_SZ 0x80 28 + 29 + /* 30 + * The amount of SRAM depends on the core type. 31 + * Note that we cannot try to test for SRAM here because writes 32 + * to secure SRAM will hang the system. Also the SRAM is not 33 + * yet mapped at this point. 34 + */ 35 + static void __init omap_detect_and_map_sram(void) 36 + { 37 + unsigned long omap_sram_skip = SRAM_BOOTLOADER_SZ; 38 + unsigned long omap_sram_start = OMAP1_SRAM_PA; 39 + unsigned long omap_sram_size; 40 + 41 + if (cpu_is_omap7xx()) 42 + omap_sram_size = 0x32000; /* 200K */ 43 + else if (cpu_is_omap15xx()) 44 + omap_sram_size = 0x30000; /* 192K */ 45 + else if (cpu_is_omap1610() || cpu_is_omap1611() || 46 + cpu_is_omap1621() || cpu_is_omap1710()) 47 + omap_sram_size = 0x4000; /* 16K */ 48 + else { 49 + pr_err("Could not detect SRAM size\n"); 50 + omap_sram_size = 0x4000; 51 + } 52 + 53 + omap_map_sram(omap_sram_start, omap_sram_size, 54 + omap_sram_skip, 1); 55 + } 56 + 57 + static void (*_omap_sram_reprogram_clock)(u32 dpllctl, u32 ckctl); 58 + 59 + void omap_sram_reprogram_clock(u32 dpllctl, u32 ckctl) 60 + { 61 + BUG_ON(!_omap_sram_reprogram_clock); 62 + /* On 730, bit 13 must always be 1 */ 63 + if (cpu_is_omap7xx()) 64 + ckctl |= 0x2000; 65 + _omap_sram_reprogram_clock(dpllctl, ckctl); 66 + } 67 + 68 + int __init omap_sram_init(void) 69 + { 70 + omap_detect_and_map_sram(); 71 + _omap_sram_reprogram_clock = 72 + omap_sram_push(omap1_sram_reprogram_clock, 73 + omap1_sram_reprogram_clock_sz); 74 + 75 + return 0; 76 + }
+7
arch/arm/mach-omap1/sram.h
··· 1 + #include <plat/sram.h> 2 + 3 + extern void omap_sram_reprogram_clock(u32 dpllctl, u32 ckctl); 4 + 5 + /* Do not use these */ 6 + extern void omap1_sram_reprogram_clock(u32 ckctl, u32 dpllctl); 7 + extern unsigned long omap1_sram_reprogram_clock_sz;
+1
arch/arm/mach-omap1/timer32k.c
··· 50 50 #include <asm/mach/irq.h> 51 51 #include <asm/mach/time.h> 52 52 53 + #include <plat/counter-32k.h> 53 54 #include <plat/dmtimer.h> 54 55 55 56 #include <mach/hardware.h>
+3 -3
arch/arm/mach-omap1/usb.c
··· 301 301 302 302 #endif 303 303 304 - u32 __init omap1_usb0_init(unsigned nwires, unsigned is_device) 304 + static u32 __init omap1_usb0_init(unsigned nwires, unsigned is_device) 305 305 { 306 306 u32 syscon1 = 0; 307 307 ··· 409 409 return syscon1 << 16; 410 410 } 411 411 412 - u32 __init omap1_usb1_init(unsigned nwires) 412 + static u32 __init omap1_usb1_init(unsigned nwires) 413 413 { 414 414 u32 syscon1 = 0; 415 415 ··· 475 475 return syscon1 << 20; 476 476 } 477 477 478 - u32 __init omap1_usb2_init(unsigned nwires, unsigned alt_pingroup) 478 + static u32 __init omap1_usb2_init(unsigned nwires, unsigned alt_pingroup) 479 479 { 480 480 u32 syscon1 = 0; 481 481
+3 -1
arch/arm/mach-omap2/Makefile
··· 4 4 5 5 # Common support 6 6 obj-y := id.o io.o control.o mux.o devices.o serial.o gpmc.o timer.o pm.o \ 7 - common.o gpio.o dma.o wd_timer.o display.o i2c.o hdq1w.o omap_hwmod.o 7 + common.o gpio.o dma.o wd_timer.o display.o i2c.o hdq1w.o omap_hwmod.o \ 8 + omap_device.o sram.o 8 9 9 10 # INTCPS IP block support - XXX should be moved to drivers/ 10 11 obj-$(CONFIG_ARCH_OMAP2) += irq.o ··· 70 69 obj-$(CONFIG_ARCH_OMAP4) += sleep44xx.o 71 70 obj-$(CONFIG_SOC_OMAP5) += omap-mpuss-lowpower.o sleep44xx.o 72 71 obj-$(CONFIG_PM_DEBUG) += pm-debug.o 72 + obj-$(CONFIG_OMAP_PM_NOOP) += omap-pm-noop.o 73 73 74 74 obj-$(CONFIG_POWER_AVS_OMAP) += sr_device.o 75 75 obj-$(CONFIG_POWER_AVS_OMAP_CLASS3) += smartreflex-class3.o
+1 -1
arch/arm/mach-omap2/am35xx-emac.c
··· 18 18 #include <linux/err.h> 19 19 #include <linux/davinci_emac.h> 20 20 #include <asm/system.h> 21 - #include <plat/omap_device.h> 21 + #include "omap_device.h" 22 22 #include "am35xx.h" 23 23 #include "control.h" 24 24 #include "am35xx-emac.h"
+1 -3
arch/arm/mach-omap2/board-2430sdp.c
··· 28 28 #include <linux/io.h> 29 29 #include <linux/gpio.h> 30 30 31 - #include <mach/hardware.h> 32 31 #include <asm/mach-types.h> 33 32 #include <asm/mach/arch.h> 34 33 #include <asm/mach/map.h> 35 34 36 35 #include "common.h" 37 - #include <plat/gpmc.h> 38 - #include <plat/usb.h> 36 + #include "gpmc.h" 39 37 #include "gpmc-smc91x.h" 40 38 41 39 #include <video/omapdss.h>
+3 -3
arch/arm/mach-omap2/board-3430sdp.c
··· 30 30 #include <asm/mach/arch.h> 31 31 #include <asm/mach/map.h> 32 32 33 - #include <plat/usb.h> 34 33 #include "common.h" 35 - #include <plat/dma.h> 36 - #include <plat/gpmc.h> 34 + #include <plat-omap/dma-omap.h> 37 35 #include <video/omapdss.h> 38 36 #include <video/omap-panel-tfp410.h> 39 37 38 + #include "gpmc.h" 40 39 #include "gpmc-smc91x.h" 41 40 41 + #include "soc.h" 42 42 #include "board-flash.h" 43 43 #include "mux.h" 44 44 #include "sdram-qimonda-hyb18m512160af-6.h"
+1 -2
arch/arm/mach-omap2/board-3630sdp.c
··· 18 18 19 19 #include "common.h" 20 20 #include "gpmc-smc91x.h" 21 - #include <plat/usb.h> 22 21 23 - #include <mach/board-zoom.h> 22 + #include "board-zoom.h" 24 23 25 24 #include "board-flash.h" 26 25 #include "mux.h"
+2 -2
arch/arm/mach-omap2/board-4430sdp.c
··· 27 27 #include <linux/leds.h> 28 28 #include <linux/leds_pwm.h> 29 29 #include <linux/platform_data/omap4-keypad.h> 30 + #include <linux/usb/musb.h> 30 31 31 32 #include <asm/hardware/gic.h> 32 33 #include <asm/mach-types.h> ··· 35 34 #include <asm/mach/map.h> 36 35 37 36 #include "common.h" 38 - #include <plat/usb.h> 39 - #include <plat/mmc.h> 40 37 #include "omap4-keypad.h" 41 38 #include <video/omapdss.h> 42 39 #include <video/omap-panel-nokia-dsi.h> ··· 44 45 45 46 #include "soc.h" 46 47 #include "mux.h" 48 + #include "mmc.h" 47 49 #include "hsmmc.h" 48 50 #include "control.h" 49 51 #include "common-board-devices.h"
-1
arch/arm/mach-omap2/board-am3517crane.c
··· 26 26 #include <asm/mach/map.h> 27 27 28 28 #include "common.h" 29 - #include <plat/usb.h> 30 29 31 30 #include "am35xx-emac.h" 32 31 #include "mux.h"
+1 -1
arch/arm/mach-omap2/board-am3517evm.c
··· 25 25 #include <linux/can/platform/ti_hecc.h> 26 26 #include <linux/davinci_emac.h> 27 27 #include <linux/mmc/host.h> 28 + #include <linux/usb/musb.h> 28 29 #include <linux/platform_data/gpio-omap.h> 29 30 30 31 #include "am35xx.h" ··· 34 33 #include <asm/mach/map.h> 35 34 36 35 #include "common.h" 37 - #include <plat/usb.h> 38 36 #include <video/omapdss.h> 39 37 #include <video/omap-panel-generic-dpi.h> 40 38 #include <video/omap-panel-tfp410.h>
+2 -2
arch/arm/mach-omap2/board-apollon.c
··· 28 28 #include <linux/clk.h> 29 29 #include <linux/smc91x.h> 30 30 #include <linux/gpio.h> 31 + #include <linux/platform_data/leds-omap.h> 31 32 32 33 #include <asm/mach-types.h> 33 34 #include <asm/mach/arch.h> 34 35 #include <asm/mach/flash.h> 35 36 36 - #include <plat/led.h> 37 37 #include "common.h" 38 - #include <plat/gpmc.h> 38 + #include "gpmc.h" 39 39 40 40 #include <video/omapdss.h> 41 41 #include <video/omap-panel-generic-dpi.h>
+4 -6
arch/arm/mach-omap2/board-cm-t35.c
··· 38 38 #include <asm/mach/arch.h> 39 39 #include <asm/mach/map.h> 40 40 41 - #include "common.h" 42 41 #include <linux/platform_data/mtd-nand-omap2.h> 43 - #include <plat/gpmc.h> 44 - #include <plat/usb.h> 45 42 #include <video/omapdss.h> 46 43 #include <video/omap-panel-generic-dpi.h> 47 44 #include <video/omap-panel-tfp410.h> 48 45 #include <linux/platform_data/spi-omap2-mcspi.h> 49 46 50 - #include <mach/hardware.h> 51 - 47 + #include "common.h" 52 48 #include "mux.h" 53 49 #include "sdram-micron-mt46h32m32lf-6.h" 54 50 #include "hsmmc.h" 55 51 #include "common-board-devices.h" 52 + #include "gpmc.h" 53 + #include "gpmc-nand.h" 56 54 57 55 #define CM_T35_GPIO_PENDOWN 57 58 56 #define SB_T35_USB_HUB_RESET_GPIO 167 ··· 179 181 180 182 static void __init cm_t35_init_nand(void) 181 183 { 182 - if (gpmc_nand_init(&cm_t35_nand_data) < 0) 184 + if (gpmc_nand_init(&cm_t35_nand_data, NULL) < 0) 183 185 pr_err("CM-T35: Unable to register NAND device\n"); 184 186 } 185 187 #else
+3 -3
arch/arm/mach-omap2/board-cm-t3517.c
··· 39 39 #include <asm/mach/map.h> 40 40 41 41 #include "common.h" 42 - #include <plat/usb.h> 43 42 #include <linux/platform_data/mtd-nand-omap2.h> 44 - #include <plat/gpmc.h> 43 + #include "gpmc.h" 45 44 46 45 #include "am35xx.h" 47 46 ··· 48 49 #include "control.h" 49 50 #include "common-board-devices.h" 50 51 #include "am35xx-emac.h" 52 + #include "gpmc-nand.h" 51 53 52 54 #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE) 53 55 static struct gpio_led cm_t3517_leds[] = { ··· 240 240 241 241 static void __init cm_t3517_init_nand(void) 242 242 { 243 - if (gpmc_nand_init(&cm_t3517_nand_data) < 0) 243 + if (gpmc_nand_init(&cm_t3517_nand_data, NULL) < 0) 244 244 pr_err("CM-T3517: NAND initialization failed\n"); 245 245 } 246 246 #else
+7 -4
arch/arm/mach-omap2/board-devkit8000.c
··· 39 39 #include <asm/mach/flash.h> 40 40 41 41 #include "common.h" 42 - #include <plat/gpmc.h> 42 + #include "gpmc.h" 43 43 #include <linux/platform_data/mtd-nand-omap2.h> 44 - #include <plat/usb.h> 45 44 #include <video/omapdss.h> 46 45 #include <video/omap-panel-generic-dpi.h> 47 46 #include <video/omap-panel-tfp410.h> ··· 54 55 #include "sdram-micron-mt46h32m32lf-6.h" 55 56 #include "mux.h" 56 57 #include "hsmmc.h" 58 + #include "board-flash.h" 57 59 #include "common-board-devices.h" 60 + 61 + #define NAND_CS 0 58 62 59 63 #define OMAP_DM9000_GPIO_IRQ 25 60 64 #define OMAP3_DEVKIT_TS_GPIO 27 ··· 623 621 624 622 usb_musb_init(NULL); 625 623 usbhs_init(&usbhs_bdata); 626 - omap_nand_flash_init(NAND_BUSWIDTH_16, devkit8000_nand_partitions, 627 - ARRAY_SIZE(devkit8000_nand_partitions)); 624 + board_nand_init(devkit8000_nand_partitions, 625 + ARRAY_SIZE(devkit8000_nand_partitions), NAND_CS, 626 + NAND_BUSWIDTH_16, NULL); 628 627 omap_twl4030_audio_init("omap3beagle"); 629 628 630 629 /* Ensure SDRC pins are mux'd for self-refresh */
+26 -26
arch/arm/mach-omap2/board-flash.c
··· 17 17 #include <linux/mtd/physmap.h> 18 18 #include <linux/io.h> 19 19 20 - #include <plat/cpu.h> 21 - #include <plat/gpmc.h> 22 20 #include <linux/platform_data/mtd-nand-omap2.h> 23 21 #include <linux/platform_data/mtd-onenand-omap2.h> 24 - #include <plat/tc.h> 25 22 23 + #include "soc.h" 26 24 #include "common.h" 27 25 #include "board-flash.h" 26 + #include "gpmc-onenand.h" 27 + #include "gpmc-nand.h" 28 28 29 29 #define REG_FPGA_REV 0x10 30 30 #define REG_FPGA_DIP_SWITCH_INPUT2 0x60 ··· 104 104 defined(CONFIG_MTD_NAND_OMAP2_MODULE) 105 105 106 106 /* Note that all values in this struct are in nanoseconds */ 107 - static struct gpmc_timings nand_timings = { 107 + struct gpmc_timings nand_default_timings[1] = { 108 + { 109 + .sync_clk = 0, 108 110 109 - .sync_clk = 0, 111 + .cs_on = 0, 112 + .cs_rd_off = 36, 113 + .cs_wr_off = 36, 110 114 111 - .cs_on = 0, 112 - .cs_rd_off = 36, 113 - .cs_wr_off = 36, 115 + .adv_on = 6, 116 + .adv_rd_off = 24, 117 + .adv_wr_off = 36, 114 118 115 - .adv_on = 6, 116 - .adv_rd_off = 24, 117 - .adv_wr_off = 36, 119 + .we_off = 30, 120 + .oe_off = 48, 118 121 119 - .we_off = 30, 120 - .oe_off = 48, 122 + .access = 54, 123 + .rd_cycle = 72, 124 + .wr_cycle = 72, 121 125 122 - .access = 54, 123 - .rd_cycle = 72, 124 - .wr_cycle = 72, 125 - 126 - .wr_access = 30, 127 - .wr_data_mux_bus = 0, 126 + .wr_access = 30, 127 + .wr_data_mux_bus = 0, 128 + }, 128 129 }; 129 130 130 - static struct omap_nand_platform_data board_nand_data = { 131 - .gpmc_t = &nand_timings, 132 - }; 131 + static struct omap_nand_platform_data board_nand_data; 133 132 134 133 void 135 - __init board_nand_init(struct mtd_partition *nand_parts, 136 - u8 nr_parts, u8 cs, int nand_type) 134 + __init board_nand_init(struct mtd_partition *nand_parts, u8 nr_parts, u8 cs, 135 + int nand_type, struct gpmc_timings *gpmc_t) 137 136 { 138 137 board_nand_data.cs = cs; 139 138 board_nand_data.parts = nand_parts; ··· 140 141 board_nand_data.devsize = nand_type; 141 142 142 143 board_nand_data.ecc_opt = OMAP_ECC_HAMMING_CODE_DEFAULT; 143 - gpmc_nand_init(&board_nand_data); 144 + gpmc_nand_init(&board_nand_data, gpmc_t); 144 145 } 145 146 #endif /* CONFIG_MTD_NAND_OMAP2 || CONFIG_MTD_NAND_OMAP2_MODULE */ 146 147 ··· 237 238 pr_err("NAND: Unable to find configuration in GPMC\n"); 238 239 else 239 240 board_nand_init(partition_info[2].parts, 240 - partition_info[2].nr_parts, nandcs, nand_type); 241 + partition_info[2].nr_parts, nandcs, 242 + nand_type, nand_default_timings); 241 243 }
+5 -3
arch/arm/mach-omap2/board-flash.h
··· 12 12 */ 13 13 #include <linux/mtd/mtd.h> 14 14 #include <linux/mtd/partitions.h> 15 - #include <plat/gpmc.h> 15 + #include "gpmc.h" 16 16 17 17 #define PDC_NOR 1 18 18 #define PDC_NAND 2 ··· 40 40 #if defined(CONFIG_MTD_NAND_OMAP2) || \ 41 41 defined(CONFIG_MTD_NAND_OMAP2_MODULE) 42 42 extern void board_nand_init(struct mtd_partition *nand_parts, 43 - u8 nr_parts, u8 cs, int nand_type); 43 + u8 nr_parts, u8 cs, int nand_type, struct gpmc_timings *gpmc_t); 44 + extern struct gpmc_timings nand_default_timings[]; 44 45 #else 45 46 static inline void board_nand_init(struct mtd_partition *nand_parts, 46 - u8 nr_parts, u8 cs, int nand_type) 47 + u8 nr_parts, u8 cs, int nand_type, struct gpmc_timings *gpmc_t) 47 48 { 48 49 } 50 + #define nand_default_timings NULL 49 51 #endif 50 52 51 53 #if defined(CONFIG_MTD_ONENAND_OMAP2) || \
+4 -4
arch/arm/mach-omap2/board-h4.c
··· 26 26 #include <linux/clk.h> 27 27 #include <linux/io.h> 28 28 #include <linux/input/matrix_keypad.h> 29 + #include <linux/mfd/menelaus.h> 29 30 30 31 #include <asm/mach-types.h> 31 32 #include <asm/mach/arch.h> 32 33 #include <asm/mach/map.h> 33 34 34 - #include <plat/menelaus.h> 35 - #include <plat/dma.h> 36 - #include <plat/gpmc.h> 37 - #include "debug-devices.h" 35 + #include <plat-omap/dma-omap.h> 36 + #include <plat/debug-devices.h> 38 37 39 38 #include <video/omapdss.h> 40 39 #include <video/omap-panel-generic-dpi.h> ··· 41 42 #include "common.h" 42 43 #include "mux.h" 43 44 #include "control.h" 45 + #include "gpmc.h" 44 46 45 47 #define H4_FLASH_CS 0 46 48 #define H4_SMC91X_CS 1
+4 -5
arch/arm/mach-omap2/board-igep0020.c
··· 29 29 #include <asm/mach-types.h> 30 30 #include <asm/mach/arch.h> 31 31 32 - #include "common.h" 33 - #include <plat/gpmc.h> 34 - #include <plat/usb.h> 35 - 36 32 #include <video/omapdss.h> 37 33 #include <video/omap-panel-tfp410.h> 38 34 #include <linux/platform_data/mtd-onenand-omap2.h> 39 35 36 + #include "common.h" 37 + #include "gpmc.h" 40 38 #include "mux.h" 41 39 #include "hsmmc.h" 42 40 #include "sdram-numonyx-m65kxxxxam.h" 43 41 #include "common-board-devices.h" 44 42 #include "board-flash.h" 45 43 #include "control.h" 44 + #include "gpmc-onenand.h" 46 45 47 46 #define IGEP2_SMSC911X_CS 5 48 47 #define IGEP2_SMSC911X_GPIO 176 ··· 174 175 pr_info("IGEP: initializing NAND memory device\n"); 175 176 board_nand_init(igep_flash_partitions, 176 177 ARRAY_SIZE(igep_flash_partitions), 177 - 0, NAND_BUSWIDTH_16); 178 + 0, NAND_BUSWIDTH_16, nand_default_timings); 178 179 } else if (mux == IGEP_SYSBOOT_ONENAND) { 179 180 pr_info("IGEP: initializing OneNAND memory device\n"); 180 181 board_onenand_init(igep_flash_partitions,
+4 -5
arch/arm/mach-omap2/board-ldp.c
··· 35 35 #include <asm/mach/map.h> 36 36 37 37 #include "common.h" 38 - #include <plat/gpmc.h> 39 - #include <mach/board-zoom.h> 40 - #include <plat/usb.h> 38 + #include "board-zoom.h" 39 + #include "gpmc.h" 41 40 #include "gpmc-smsc911x.h" 42 41 43 42 #include <video/omapdss.h> ··· 419 420 omap_serial_init(); 420 421 omap_sdrc_init(NULL, NULL); 421 422 usb_musb_init(NULL); 422 - board_nand_init(ldp_nand_partitions, 423 - ARRAY_SIZE(ldp_nand_partitions), ZOOM_NAND_CS, 0); 423 + board_nand_init(ldp_nand_partitions, ARRAY_SIZE(ldp_nand_partitions), 424 + ZOOM_NAND_CS, 0, nand_default_timings); 424 425 425 426 omap_hsmmc_init(mmc); 426 427 ldp_display_init();
+3 -2
arch/arm/mach-omap2/board-n8x0.c
··· 22 22 #include <linux/usb/musb.h> 23 23 #include <linux/platform_data/spi-omap2-mcspi.h> 24 24 #include <linux/platform_data/mtd-onenand-omap2.h> 25 + #include <linux/mfd/menelaus.h> 25 26 #include <sound/tlv320aic3x.h> 26 27 27 28 #include <asm/mach/arch.h> 28 29 #include <asm/mach-types.h> 29 30 30 31 #include "common.h" 31 - #include <plat/menelaus.h> 32 - #include <plat/mmc.h> 32 + #include "mmc.h" 33 33 34 34 #include "mux.h" 35 + #include "gpmc-onenand.h" 35 36 36 37 #define TUSB6010_ASYNC_CS 1 37 38 #define TUSB6010_SYNC_CS 4
+10 -6
arch/arm/mach-omap2/board-omap3beagle.c
··· 39 39 #include <asm/mach/map.h> 40 40 #include <asm/mach/flash.h> 41 41 42 - #include "common.h" 43 42 #include <video/omapdss.h> 44 43 #include <video/omap-panel-tfp410.h> 45 - #include <plat/gpmc.h> 46 44 #include <linux/platform_data/mtd-nand-omap2.h> 47 - #include <plat/usb.h> 48 - #include <plat/omap_device.h> 49 45 46 + #include "common.h" 47 + #include "omap_device.h" 48 + #include "gpmc.h" 49 + #include "soc.h" 50 50 #include "mux.h" 51 51 #include "hsmmc.h" 52 52 #include "pm.h" 53 + #include "board-flash.h" 53 54 #include "common-board-devices.h" 55 + 56 + #define NAND_CS 0 54 57 55 58 /* 56 59 * OMAP3 Beagle revision ··· 521 518 522 519 usb_musb_init(NULL); 523 520 usbhs_init(&usbhs_bdata); 524 - omap_nand_flash_init(NAND_BUSWIDTH_16, omap3beagle_nand_partitions, 525 - ARRAY_SIZE(omap3beagle_nand_partitions)); 521 + board_nand_init(omap3beagle_nand_partitions, 522 + ARRAY_SIZE(omap3beagle_nand_partitions), NAND_CS, 523 + NAND_BUSWIDTH_16, NULL); 526 524 omap_twl4030_audio_init("omap3beagle"); 527 525 528 526 /* Ensure msecure is mux'd to be able to set the RTC. */
+8 -3
arch/arm/mach-omap2/board-omap3evm.c
··· 32 32 #include <linux/spi/ads7846.h> 33 33 #include <linux/i2c/twl.h> 34 34 #include <linux/usb/otg.h> 35 + #include <linux/usb/musb.h> 35 36 #include <linux/usb/nop-usb-xceiv.h> 36 37 #include <linux/smsc911x.h> 37 38 ··· 46 45 #include <asm/mach/arch.h> 47 46 #include <asm/mach/map.h> 48 47 49 - #include <plat/usb.h> 50 48 #include <linux/platform_data/mtd-nand-omap2.h> 51 49 #include "common.h" 52 50 #include <linux/platform_data/spi-omap2-mcspi.h> 53 51 #include <video/omapdss.h> 54 52 #include <video/omap-panel-tfp410.h> 55 53 54 + #include "soc.h" 56 55 #include "mux.h" 57 56 #include "sdram-micron-mt46h32m32lf-6.h" 58 57 #include "hsmmc.h" 59 58 #include "common-board-devices.h" 59 + #include "board-flash.h" 60 + 61 + #define NAND_CS 0 60 62 61 63 #define OMAP3_EVM_TS_GPIO 175 62 64 #define OMAP3_EVM_EHCI_VBUS 22 ··· 735 731 } 736 732 usb_musb_init(&musb_board_data); 737 733 usbhs_init(&usbhs_bdata); 738 - omap_nand_flash_init(NAND_BUSWIDTH_16, omap3evm_nand_partitions, 739 - ARRAY_SIZE(omap3evm_nand_partitions)); 734 + board_nand_init(omap3evm_nand_partitions, 735 + ARRAY_SIZE(omap3evm_nand_partitions), NAND_CS, 736 + NAND_BUSWIDTH_16, NULL); 740 737 741 738 omap_ads7846_init(1, OMAP3_EVM_TS_GPIO, 310, NULL); 742 739 omap3evm_init_smsc911x();
+2 -5
arch/arm/mach-omap2/board-omap3logic.c
··· 34 34 #include <asm/mach/arch.h> 35 35 #include <asm/mach/map.h> 36 36 37 - #include "gpmc-smsc911x.h" 38 - #include <plat/gpmc.h> 39 - #include <plat/sdrc.h> 40 - #include <plat/usb.h> 41 - 42 37 #include "common.h" 43 38 #include "mux.h" 44 39 #include "hsmmc.h" 45 40 #include "control.h" 46 41 #include "common-board-devices.h" 42 + #include "gpmc.h" 43 + #include "gpmc-smsc911x.h" 47 44 48 45 #define OMAP3LOGIC_SMSC911X_CS 1 49 46
+2 -2
arch/arm/mach-omap2/board-omap3pandora.c
··· 42 42 #include <asm/mach/map.h> 43 43 44 44 #include "common.h" 45 - #include <plat/usb.h> 46 45 #include <video/omapdss.h> 47 46 #include <linux/platform_data/mtd-nand-omap2.h> 48 47 ··· 49 50 #include "sdram-micron-mt46h32m32lf-6.h" 50 51 #include "hsmmc.h" 51 52 #include "common-board-devices.h" 53 + #include "gpmc-nand.h" 52 54 53 55 #define PANDORA_WIFI_IRQ_GPIO 21 54 56 #define PANDORA_WIFI_NRESET_GPIO 23 ··· 602 602 omap_ads7846_init(1, OMAP3_PANDORA_TS_GPIO, 0, NULL); 603 603 usbhs_init(&usbhs_bdata); 604 604 usb_musb_init(NULL); 605 - gpmc_nand_init(&pandora_nand_data); 605 + gpmc_nand_init(&pandora_nand_data, NULL); 606 606 607 607 /* Ensure SDRC pins are mux'd for self-refresh */ 608 608 omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
+1 -2
arch/arm/mach-omap2/board-omap3stalker.c
··· 40 40 #include <asm/mach/flash.h> 41 41 42 42 #include "common.h" 43 - #include <plat/gpmc.h> 43 + #include "gpmc.h" 44 44 #include <linux/platform_data/mtd-nand-omap2.h> 45 - #include <plat/usb.h> 46 45 #include <video/omapdss.h> 47 46 #include <video/omap-panel-generic-dpi.h> 48 47 #include <video/omap-panel-tfp410.h>
+7 -4
arch/arm/mach-omap2/board-omap3touchbook.c
··· 44 44 #include <asm/system_info.h> 45 45 46 46 #include "common.h" 47 - #include <plat/gpmc.h> 47 + #include "gpmc.h" 48 48 #include <linux/platform_data/mtd-nand-omap2.h> 49 - #include <plat/usb.h> 50 49 51 50 #include "mux.h" 52 51 #include "hsmmc.h" 52 + #include "board-flash.h" 53 53 #include "common-board-devices.h" 54 54 55 55 #include <asm/setup.h> ··· 58 58 #define OMAP3_TS_GPIO 162 59 59 #define TB_BL_PWM_TIMER 9 60 60 #define TB_KILL_POWER_GPIO 168 61 + 62 + #define NAND_CS 0 61 63 62 64 static unsigned long touchbook_revision; 63 65 ··· 367 365 omap_ads7846_init(4, OMAP3_TS_GPIO, 310, &ads7846_pdata); 368 366 usb_musb_init(NULL); 369 367 usbhs_init(&usbhs_bdata); 370 - omap_nand_flash_init(NAND_BUSWIDTH_16, omap3touchbook_nand_partitions, 371 - ARRAY_SIZE(omap3touchbook_nand_partitions)); 368 + board_nand_init(omap3touchbook_nand_partitions, 369 + ARRAY_SIZE(omap3touchbook_nand_partitions), NAND_CS, 370 + NAND_BUSWIDTH_16, NULL); 372 371 373 372 /* Ensure SDRC pins are mux'd for self-refresh */ 374 373 omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
+3 -3
arch/arm/mach-omap2/board-omap4panda.c
··· 29 29 #include <linux/regulator/machine.h> 30 30 #include <linux/regulator/fixed.h> 31 31 #include <linux/ti_wilink_st.h> 32 + #include <linux/usb/musb.h> 32 33 #include <linux/wl12xx.h> 33 34 #include <linux/platform_data/omap-abe-twl6040.h> 34 35 ··· 39 38 #include <asm/mach/map.h> 40 39 #include <video/omapdss.h> 41 40 42 - #include "common.h" 43 - #include <plat/usb.h> 44 - #include <plat/mmc.h> 45 41 #include <video/omap-panel-tfp410.h> 46 42 43 + #include "common.h" 47 44 #include "soc.h" 45 + #include "mmc.h" 48 46 #include "hsmmc.h" 49 47 #include "control.h" 50 48 #include "mux.h"
+7 -4
arch/arm/mach-omap2/board-overo.c
··· 49 49 #include <video/omapdss.h> 50 50 #include <video/omap-panel-generic-dpi.h> 51 51 #include <video/omap-panel-tfp410.h> 52 - #include <plat/gpmc.h> 53 - #include <plat/usb.h> 54 52 53 + #include "common.h" 55 54 #include "mux.h" 56 55 #include "sdram-micron-mt46h32m32lf-6.h" 56 + #include "gpmc.h" 57 57 #include "hsmmc.h" 58 + #include "board-flash.h" 58 59 #include "common-board-devices.h" 60 + 61 + #define NAND_CS 0 59 62 60 63 #define OVERO_GPIO_BT_XGATE 15 61 64 #define OVERO_GPIO_W2W_NRESET 16 ··· 498 495 omap_serial_init(); 499 496 omap_sdrc_init(mt46h32m32lf6_sdrc_params, 500 497 mt46h32m32lf6_sdrc_params); 501 - omap_nand_flash_init(0, overo_nand_partitions, 502 - ARRAY_SIZE(overo_nand_partitions)); 498 + board_nand_init(overo_nand_partitions, 499 + ARRAY_SIZE(overo_nand_partitions), NAND_CS, 0, NULL); 503 500 usb_musb_init(NULL); 504 501 usbhs_init(&usbhs_bdata); 505 502 overo_spi_init();
+3 -6
arch/arm/mach-omap2/board-rm680.c
··· 22 22 #include <asm/mach/arch.h> 23 23 #include <asm/mach-types.h> 24 24 25 - #include <plat/i2c.h> 26 - #include <plat/mmc.h> 27 - #include <plat/usb.h> 28 - #include <plat/gpmc.h> 29 25 #include "common.h" 30 - #include <plat/serial.h> 31 - 32 26 #include "mux.h" 27 + #include "gpmc.h" 28 + #include "mmc.h" 33 29 #include "hsmmc.h" 34 30 #include "sdram-nokia.h" 35 31 #include "common-board-devices.h" 32 + #include "gpmc-onenand.h" 36 33 37 34 static struct regulator_consumer_supply rm680_vemmc_consumers[] = { 38 35 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"),
+4 -3
arch/arm/mach-omap2/board-rx51-peripherals.c
··· 31 31 #include <asm/system_info.h> 32 32 33 33 #include "common.h" 34 - #include <plat/dma.h> 35 - #include <plat/gpmc.h> 36 - #include <plat/omap-pm.h> 34 + #include <plat-omap/dma-omap.h> 37 35 #include "gpmc-smc91x.h" 38 36 39 37 #include "board-rx51.h" ··· 50 52 #endif 51 53 52 54 #include "mux.h" 55 + #include "omap-pm.h" 53 56 #include "hsmmc.h" 54 57 #include "common-board-devices.h" 58 + #include "gpmc.h" 59 + #include "gpmc-onenand.h" 55 60 56 61 #define SYSTEM_REV_B_USES_VAUX3 0x1699 57 62 #define SYSTEM_REV_S_USES_VAUX3 0x8
+4 -4
arch/arm/mach-omap2/board-rx51.c
··· 17 17 #include <linux/io.h> 18 18 #include <linux/gpio.h> 19 19 #include <linux/leds.h> 20 + #include <linux/usb/musb.h> 20 21 #include <linux/platform_data/spi-omap2-mcspi.h> 21 22 22 23 #include <asm/mach-types.h> 23 24 #include <asm/mach/arch.h> 24 25 #include <asm/mach/map.h> 25 26 26 - #include "common.h" 27 - #include <plat/dma.h> 28 - #include <plat/gpmc.h> 29 - #include <plat/usb.h> 27 + #include <plat-omap/dma-omap.h> 30 28 29 + #include "common.h" 31 30 #include "mux.h" 31 + #include "gpmc.h" 32 32 #include "pm.h" 33 33 #include "sdram-nokia.h" 34 34
+2 -1
arch/arm/mach-omap2/board-ti8168evm.c
··· 14 14 */ 15 15 #include <linux/kernel.h> 16 16 #include <linux/init.h> 17 + #include <linux/platform_device.h> 18 + #include <linux/usb/musb.h> 17 19 18 20 #include <asm/mach-types.h> 19 21 #include <asm/mach/arch.h> 20 22 #include <asm/mach/map.h> 21 23 22 24 #include "common.h" 23 - #include <plat/usb.h> 24 25 25 26 static struct omap_musb_board_data musb_board_data = { 26 27 .set_phy_power = ti81xx_musb_phy_power,
+2 -2
arch/arm/mach-omap2/board-zoom-debugboard.c
··· 17 17 #include <linux/regulator/fixed.h> 18 18 #include <linux/regulator/machine.h> 19 19 20 - #include <plat/gpmc.h> 20 + #include "gpmc.h" 21 21 #include "gpmc-smsc911x.h" 22 22 23 - #include <mach/board-zoom.h> 23 + #include "board-zoom.h" 24 24 25 25 #include "soc.h" 26 26 #include "common.h"
+2 -1
arch/arm/mach-omap2/board-zoom-display.c
··· 16 16 #include <linux/spi/spi.h> 17 17 #include <linux/platform_data/spi-omap2-mcspi.h> 18 18 #include <video/omapdss.h> 19 - #include <mach/board-zoom.h> 19 + #include "board-zoom.h" 20 20 21 + #include "soc.h" 21 22 #include "common.h" 22 23 23 24 #define LCD_PANEL_RESET_GPIO_PROD 96
+1 -2
arch/arm/mach-omap2/board-zoom-peripherals.c
··· 26 26 #include <asm/mach/map.h> 27 27 28 28 #include "common.h" 29 - #include <plat/usb.h> 30 29 31 - #include <mach/board-zoom.h> 30 + #include "board-zoom.h" 32 31 33 32 #include "mux.h" 34 33 #include "hsmmc.h"
+4 -4
arch/arm/mach-omap2/board-zoom.c
··· 22 22 #include <asm/mach/arch.h> 23 23 24 24 #include "common.h" 25 - #include <plat/usb.h> 26 25 27 - #include <mach/board-zoom.h> 26 + #include "board-zoom.h" 28 27 29 28 #include "board-flash.h" 30 29 #include "mux.h" ··· 112 113 usbhs_init(&usbhs_bdata); 113 114 } 114 115 115 - board_nand_init(zoom_nand_partitions, ARRAY_SIZE(zoom_nand_partitions), 116 - ZOOM_NAND_CS, NAND_BUSWIDTH_16); 116 + board_nand_init(zoom_nand_partitions, 117 + ARRAY_SIZE(zoom_nand_partitions), ZOOM_NAND_CS, 118 + NAND_BUSWIDTH_16, nand_default_timings); 117 119 zoom_debugboard_init(); 118 120 zoom_peripherals_init(); 119 121
-1
arch/arm/mach-omap2/clkt2xxx_apll.c
··· 21 21 #include <linux/clk.h> 22 22 #include <linux/io.h> 23 23 24 - #include <plat/clock.h> 25 24 #include <plat/prcm.h> 26 25 27 26 #include "clock.h"
-2
arch/arm/mach-omap2/clkt2xxx_dpll.c
··· 14 14 #include <linux/clk.h> 15 15 #include <linux/io.h> 16 16 17 - #include <plat/clock.h> 18 - 19 17 #include "clock.h" 20 18 #include "cm2xxx_3xxx.h" 21 19 #include "cm-regbits-24xx.h"
+2 -4
arch/arm/mach-omap2/clkt2xxx_dpllcore.c
··· 25 25 #include <linux/clk.h> 26 26 #include <linux/io.h> 27 27 28 - #include <plat/clock.h> 29 - #include <plat/sram.h> 30 - #include <plat/sdrc.h> 31 - 32 28 #include "clock.h" 33 29 #include "clock2xxx.h" 34 30 #include "opp2xxx.h" 35 31 #include "cm2xxx_3xxx.h" 36 32 #include "cm-regbits-24xx.h" 33 + #include "sdrc.h" 34 + #include "sram.h" 37 35 38 36 /* #define DOWN_VARIABLE_DPLL 1 */ /* Experimental */ 39 37
-2
arch/arm/mach-omap2/clkt2xxx_osc.c
··· 23 23 #include <linux/clk.h> 24 24 #include <linux/io.h> 25 25 26 - #include <plat/clock.h> 27 - 28 26 #include "clock.h" 29 27 #include "clock2xxx.h" 30 28 #include "prm2xxx_3xxx.h"
-2
arch/arm/mach-omap2/clkt2xxx_sys.c
··· 22 22 #include <linux/clk.h> 23 23 #include <linux/io.h> 24 24 25 - #include <plat/clock.h> 26 - 27 25 #include "clock.h" 28 26 #include "clock2xxx.h" 29 27 #include "prm2xxx_3xxx.h"
+2 -4
arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c
··· 33 33 #include <linux/cpufreq.h> 34 34 #include <linux/slab.h> 35 35 36 - #include <plat/clock.h> 37 - #include <plat/sram.h> 38 - #include <plat/sdrc.h> 39 - 40 36 #include "soc.h" 41 37 #include "clock.h" 42 38 #include "clock2xxx.h" 43 39 #include "opp2xxx.h" 44 40 #include "cm2xxx_3xxx.h" 45 41 #include "cm-regbits-24xx.h" 42 + #include "sdrc.h" 43 + #include "sram.h" 46 44 47 45 const struct prcm_config *curr_prcm_set; 48 46 const struct prcm_config *rate_table;
+1 -4
arch/arm/mach-omap2/clkt34xx_dpll3m2.c
··· 21 21 #include <linux/clk.h> 22 22 #include <linux/io.h> 23 23 24 - #include <plat/clock.h> 25 - #include <plat/sram.h> 26 - #include <plat/sdrc.h> 27 - 28 24 #include "clock.h" 29 25 #include "clock3xxx.h" 30 26 #include "clock34xx.h" 31 27 #include "sdrc.h" 28 + #include "sram.h" 32 29 33 30 #define CYCLES_PER_MHZ 1000000 34 31
-2
arch/arm/mach-omap2/clkt_clksel.c
··· 45 45 #include <linux/io.h> 46 46 #include <linux/bug.h> 47 47 48 - #include <plat/clock.h> 49 - 50 48 #include "clock.h" 51 49 52 50 /* Private functions */
-2
arch/arm/mach-omap2/clkt_dpll.c
··· 21 21 22 22 #include <asm/div64.h> 23 23 24 - #include <plat/clock.h> 25 - 26 24 #include "soc.h" 27 25 #include "clock.h" 28 26 #include "cm-regbits-24xx.h"
-1
arch/arm/mach-omap2/clkt_iclk.c
··· 14 14 #include <linux/clk.h> 15 15 #include <linux/io.h> 16 16 17 - #include <plat/clock.h> 18 17 #include <plat/prcm.h> 19 18 20 19 #include "clock.h"
+510 -8
arch/arm/mach-omap2/clock.c
··· 15 15 #undef DEBUG 16 16 17 17 #include <linux/kernel.h> 18 + #include <linux/export.h> 18 19 #include <linux/list.h> 19 20 #include <linux/errno.h> 20 21 #include <linux/err.h> ··· 26 25 27 26 #include <asm/cpu.h> 28 27 29 - #include <plat/clock.h> 30 28 #include <plat/prcm.h> 31 29 32 30 #include <trace/events/power.h> ··· 46 46 * afterwards. 47 47 */ 48 48 static bool clkdm_control = true; 49 + 50 + static LIST_HEAD(clocks); 51 + static DEFINE_MUTEX(clocks_mutex); 52 + static DEFINE_SPINLOCK(clockfw_lock); 49 53 50 54 /* 51 55 * OMAP2+ specific clock functions ··· 516 512 517 513 /* Common data */ 518 514 519 - struct clk_functions omap2_clk_functions = { 520 - .clk_enable = omap2_clk_enable, 521 - .clk_disable = omap2_clk_disable, 522 - .clk_round_rate = omap2_clk_round_rate, 523 - .clk_set_rate = omap2_clk_set_rate, 524 - .clk_set_parent = omap2_clk_set_parent, 525 - .clk_disable_unused = omap2_clk_disable_unused, 515 + int clk_enable(struct clk *clk) 516 + { 517 + unsigned long flags; 518 + int ret; 519 + 520 + if (clk == NULL || IS_ERR(clk)) 521 + return -EINVAL; 522 + 523 + spin_lock_irqsave(&clockfw_lock, flags); 524 + ret = omap2_clk_enable(clk); 525 + spin_unlock_irqrestore(&clockfw_lock, flags); 526 + 527 + return ret; 528 + } 529 + EXPORT_SYMBOL(clk_enable); 530 + 531 + void clk_disable(struct clk *clk) 532 + { 533 + unsigned long flags; 534 + 535 + if (clk == NULL || IS_ERR(clk)) 536 + return; 537 + 538 + spin_lock_irqsave(&clockfw_lock, flags); 539 + if (clk->usecount == 0) { 540 + pr_err("Trying disable clock %s with 0 usecount\n", 541 + clk->name); 542 + WARN_ON(1); 543 + goto out; 544 + } 545 + 546 + omap2_clk_disable(clk); 547 + 548 + out: 549 + spin_unlock_irqrestore(&clockfw_lock, flags); 550 + } 551 + EXPORT_SYMBOL(clk_disable); 552 + 553 + unsigned long clk_get_rate(struct clk *clk) 554 + { 555 + unsigned long flags; 556 + unsigned long ret; 557 + 558 + if (clk == NULL || IS_ERR(clk)) 559 + return 0; 560 + 561 + spin_lock_irqsave(&clockfw_lock, flags); 562 + ret = clk->rate; 563 + spin_unlock_irqrestore(&clockfw_lock, flags); 564 + 565 + return ret; 566 + } 567 + EXPORT_SYMBOL(clk_get_rate); 568 + 569 + /* 570 + * Optional clock functions defined in include/linux/clk.h 571 + */ 572 + 573 + long clk_round_rate(struct clk *clk, unsigned long rate) 574 + { 575 + unsigned long flags; 576 + long ret; 577 + 578 + if (clk == NULL || IS_ERR(clk)) 579 + return 0; 580 + 581 + spin_lock_irqsave(&clockfw_lock, flags); 582 + ret = omap2_clk_round_rate(clk, rate); 583 + spin_unlock_irqrestore(&clockfw_lock, flags); 584 + 585 + return ret; 586 + } 587 + EXPORT_SYMBOL(clk_round_rate); 588 + 589 + int clk_set_rate(struct clk *clk, unsigned long rate) 590 + { 591 + unsigned long flags; 592 + int ret = -EINVAL; 593 + 594 + if (clk == NULL || IS_ERR(clk)) 595 + return ret; 596 + 597 + spin_lock_irqsave(&clockfw_lock, flags); 598 + ret = omap2_clk_set_rate(clk, rate); 599 + if (ret == 0) 600 + propagate_rate(clk); 601 + spin_unlock_irqrestore(&clockfw_lock, flags); 602 + 603 + return ret; 604 + } 605 + EXPORT_SYMBOL(clk_set_rate); 606 + 607 + int clk_set_parent(struct clk *clk, struct clk *parent) 608 + { 609 + unsigned long flags; 610 + int ret = -EINVAL; 611 + 612 + if (clk == NULL || IS_ERR(clk) || parent == NULL || IS_ERR(parent)) 613 + return ret; 614 + 615 + spin_lock_irqsave(&clockfw_lock, flags); 616 + if (clk->usecount == 0) { 617 + ret = omap2_clk_set_parent(clk, parent); 618 + if (ret == 0) 619 + propagate_rate(clk); 620 + } else { 621 + ret = -EBUSY; 622 + } 623 + spin_unlock_irqrestore(&clockfw_lock, flags); 624 + 625 + return ret; 626 + } 627 + EXPORT_SYMBOL(clk_set_parent); 628 + 629 + struct clk *clk_get_parent(struct clk *clk) 630 + { 631 + return clk->parent; 632 + } 633 + EXPORT_SYMBOL(clk_get_parent); 634 + 635 + /* 636 + * OMAP specific clock functions shared between omap1 and omap2 637 + */ 638 + 639 + int __initdata mpurate; 640 + 641 + /* 642 + * By default we use the rate set by the bootloader. 643 + * You can override this with mpurate= cmdline option. 644 + */ 645 + static int __init omap_clk_setup(char *str) 646 + { 647 + get_option(&str, &mpurate); 648 + 649 + if (!mpurate) 650 + return 1; 651 + 652 + if (mpurate < 1000) 653 + mpurate *= 1000000; 654 + 655 + return 1; 656 + } 657 + __setup("mpurate=", omap_clk_setup); 658 + 659 + /* Used for clocks that always have same value as the parent clock */ 660 + unsigned long followparent_recalc(struct clk *clk) 661 + { 662 + return clk->parent->rate; 663 + } 664 + 665 + /* 666 + * Used for clocks that have the same value as the parent clock, 667 + * divided by some factor 668 + */ 669 + unsigned long omap_fixed_divisor_recalc(struct clk *clk) 670 + { 671 + WARN_ON(!clk->fixed_div); 672 + 673 + return clk->parent->rate / clk->fixed_div; 674 + } 675 + 676 + void clk_reparent(struct clk *child, struct clk *parent) 677 + { 678 + list_del_init(&child->sibling); 679 + if (parent) 680 + list_add(&child->sibling, &parent->children); 681 + child->parent = parent; 682 + 683 + /* now do the debugfs renaming to reattach the child 684 + to the proper parent */ 685 + } 686 + 687 + /* Propagate rate to children */ 688 + void propagate_rate(struct clk *tclk) 689 + { 690 + struct clk *clkp; 691 + 692 + list_for_each_entry(clkp, &tclk->children, sibling) { 693 + if (clkp->recalc) 694 + clkp->rate = clkp->recalc(clkp); 695 + propagate_rate(clkp); 696 + } 697 + } 698 + 699 + static LIST_HEAD(root_clks); 700 + 701 + /** 702 + * recalculate_root_clocks - recalculate and propagate all root clocks 703 + * 704 + * Recalculates all root clocks (clocks with no parent), which if the 705 + * clock's .recalc is set correctly, should also propagate their rates. 706 + * Called at init. 707 + */ 708 + void recalculate_root_clocks(void) 709 + { 710 + struct clk *clkp; 711 + 712 + list_for_each_entry(clkp, &root_clks, sibling) { 713 + if (clkp->recalc) 714 + clkp->rate = clkp->recalc(clkp); 715 + propagate_rate(clkp); 716 + } 717 + } 718 + 719 + /** 720 + * clk_preinit - initialize any fields in the struct clk before clk init 721 + * @clk: struct clk * to initialize 722 + * 723 + * Initialize any struct clk fields needed before normal clk initialization 724 + * can run. No return value. 725 + */ 726 + void clk_preinit(struct clk *clk) 727 + { 728 + INIT_LIST_HEAD(&clk->children); 729 + } 730 + 731 + int clk_register(struct clk *clk) 732 + { 733 + if (clk == NULL || IS_ERR(clk)) 734 + return -EINVAL; 735 + 736 + /* 737 + * trap out already registered clocks 738 + */ 739 + if (clk->node.next || clk->node.prev) 740 + return 0; 741 + 742 + mutex_lock(&clocks_mutex); 743 + if (clk->parent) 744 + list_add(&clk->sibling, &clk->parent->children); 745 + else 746 + list_add(&clk->sibling, &root_clks); 747 + 748 + list_add(&clk->node, &clocks); 749 + if (clk->init) 750 + clk->init(clk); 751 + mutex_unlock(&clocks_mutex); 752 + 753 + return 0; 754 + } 755 + EXPORT_SYMBOL(clk_register); 756 + 757 + void clk_unregister(struct clk *clk) 758 + { 759 + if (clk == NULL || IS_ERR(clk)) 760 + return; 761 + 762 + mutex_lock(&clocks_mutex); 763 + list_del(&clk->sibling); 764 + list_del(&clk->node); 765 + mutex_unlock(&clocks_mutex); 766 + } 767 + EXPORT_SYMBOL(clk_unregister); 768 + 769 + void clk_enable_init_clocks(void) 770 + { 771 + struct clk *clkp; 772 + 773 + list_for_each_entry(clkp, &clocks, node) 774 + if (clkp->flags & ENABLE_ON_INIT) 775 + clk_enable(clkp); 776 + } 777 + 778 + /** 779 + * omap_clk_get_by_name - locate OMAP struct clk by its name 780 + * @name: name of the struct clk to locate 781 + * 782 + * Locate an OMAP struct clk by its name. Assumes that struct clk 783 + * names are unique. Returns NULL if not found or a pointer to the 784 + * struct clk if found. 785 + */ 786 + struct clk *omap_clk_get_by_name(const char *name) 787 + { 788 + struct clk *c; 789 + struct clk *ret = NULL; 790 + 791 + mutex_lock(&clocks_mutex); 792 + 793 + list_for_each_entry(c, &clocks, node) { 794 + if (!strcmp(c->name, name)) { 795 + ret = c; 796 + break; 797 + } 798 + } 799 + 800 + mutex_unlock(&clocks_mutex); 801 + 802 + return ret; 803 + } 804 + 805 + int omap_clk_enable_autoidle_all(void) 806 + { 807 + struct clk *c; 808 + unsigned long flags; 809 + 810 + spin_lock_irqsave(&clockfw_lock, flags); 811 + 812 + list_for_each_entry(c, &clocks, node) 813 + if (c->ops->allow_idle) 814 + c->ops->allow_idle(c); 815 + 816 + spin_unlock_irqrestore(&clockfw_lock, flags); 817 + 818 + return 0; 819 + } 820 + 821 + int omap_clk_disable_autoidle_all(void) 822 + { 823 + struct clk *c; 824 + unsigned long flags; 825 + 826 + spin_lock_irqsave(&clockfw_lock, flags); 827 + 828 + list_for_each_entry(c, &clocks, node) 829 + if (c->ops->deny_idle) 830 + c->ops->deny_idle(c); 831 + 832 + spin_unlock_irqrestore(&clockfw_lock, flags); 833 + 834 + return 0; 835 + } 836 + 837 + /* 838 + * Low level helpers 839 + */ 840 + static int clkll_enable_null(struct clk *clk) 841 + { 842 + return 0; 843 + } 844 + 845 + static void clkll_disable_null(struct clk *clk) 846 + { 847 + } 848 + 849 + const struct clkops clkops_null = { 850 + .enable = clkll_enable_null, 851 + .disable = clkll_disable_null, 526 852 }; 853 + 854 + /* 855 + * Dummy clock 856 + * 857 + * Used for clock aliases that are needed on some OMAPs, but not others 858 + */ 859 + struct clk dummy_ck = { 860 + .name = "dummy", 861 + .ops = &clkops_null, 862 + }; 863 + 864 + /* 865 + * 866 + */ 867 + 868 + #ifdef CONFIG_OMAP_RESET_CLOCKS 869 + /* 870 + * Disable any unused clocks left on by the bootloader 871 + */ 872 + static int __init clk_disable_unused(void) 873 + { 874 + struct clk *ck; 875 + unsigned long flags; 876 + 877 + pr_info("clock: disabling unused clocks to save power\n"); 878 + 879 + spin_lock_irqsave(&clockfw_lock, flags); 880 + list_for_each_entry(ck, &clocks, node) { 881 + if (ck->ops == &clkops_null) 882 + continue; 883 + 884 + if (ck->usecount > 0 || !ck->enable_reg) 885 + continue; 886 + 887 + omap2_clk_disable_unused(ck); 888 + } 889 + spin_unlock_irqrestore(&clockfw_lock, flags); 890 + 891 + return 0; 892 + } 893 + late_initcall(clk_disable_unused); 894 + late_initcall(omap_clk_enable_autoidle_all); 895 + #endif 896 + 897 + #if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS) 898 + /* 899 + * debugfs support to trace clock tree hierarchy and attributes 900 + */ 901 + 902 + #include <linux/debugfs.h> 903 + #include <linux/seq_file.h> 904 + 905 + static struct dentry *clk_debugfs_root; 906 + 907 + static int clk_dbg_show_summary(struct seq_file *s, void *unused) 908 + { 909 + struct clk *c; 910 + struct clk *pa; 911 + 912 + mutex_lock(&clocks_mutex); 913 + seq_printf(s, "%-30s %-30s %-10s %s\n", 914 + "clock-name", "parent-name", "rate", "use-count"); 915 + 916 + list_for_each_entry(c, &clocks, node) { 917 + pa = c->parent; 918 + seq_printf(s, "%-30s %-30s %-10lu %d\n", 919 + c->name, pa ? pa->name : "none", c->rate, 920 + c->usecount); 921 + } 922 + mutex_unlock(&clocks_mutex); 923 + 924 + return 0; 925 + } 926 + 927 + static int clk_dbg_open(struct inode *inode, struct file *file) 928 + { 929 + return single_open(file, clk_dbg_show_summary, inode->i_private); 930 + } 931 + 932 + static const struct file_operations debug_clock_fops = { 933 + .open = clk_dbg_open, 934 + .read = seq_read, 935 + .llseek = seq_lseek, 936 + .release = single_release, 937 + }; 938 + 939 + static int clk_debugfs_register_one(struct clk *c) 940 + { 941 + int err; 942 + struct dentry *d; 943 + struct clk *pa = c->parent; 944 + 945 + d = debugfs_create_dir(c->name, pa ? pa->dent : clk_debugfs_root); 946 + if (!d) 947 + return -ENOMEM; 948 + c->dent = d; 949 + 950 + d = debugfs_create_u8("usecount", S_IRUGO, c->dent, (u8 *)&c->usecount); 951 + if (!d) { 952 + err = -ENOMEM; 953 + goto err_out; 954 + } 955 + d = debugfs_create_u32("rate", S_IRUGO, c->dent, (u32 *)&c->rate); 956 + if (!d) { 957 + err = -ENOMEM; 958 + goto err_out; 959 + } 960 + d = debugfs_create_x32("flags", S_IRUGO, c->dent, (u32 *)&c->flags); 961 + if (!d) { 962 + err = -ENOMEM; 963 + goto err_out; 964 + } 965 + return 0; 966 + 967 + err_out: 968 + debugfs_remove_recursive(c->dent); 969 + return err; 970 + } 971 + 972 + static int clk_debugfs_register(struct clk *c) 973 + { 974 + int err; 975 + struct clk *pa = c->parent; 976 + 977 + if (pa && !pa->dent) { 978 + err = clk_debugfs_register(pa); 979 + if (err) 980 + return err; 981 + } 982 + 983 + if (!c->dent) { 984 + err = clk_debugfs_register_one(c); 985 + if (err) 986 + return err; 987 + } 988 + return 0; 989 + } 990 + 991 + static int __init clk_debugfs_init(void) 992 + { 993 + struct clk *c; 994 + struct dentry *d; 995 + int err; 996 + 997 + d = debugfs_create_dir("clock", NULL); 998 + if (!d) 999 + return -ENOMEM; 1000 + clk_debugfs_root = d; 1001 + 1002 + list_for_each_entry(c, &clocks, node) { 1003 + err = clk_debugfs_register(c); 1004 + if (err) 1005 + goto err_out; 1006 + } 1007 + 1008 + d = debugfs_create_file("summary", S_IRUGO, 1009 + d, NULL, &debug_clock_fops); 1010 + if (!d) 1011 + return -ENOMEM; 1012 + 1013 + return 0; 1014 + err_out: 1015 + debugfs_remove_recursive(clk_debugfs_root); 1016 + return err; 1017 + } 1018 + late_initcall(clk_debugfs_init); 1019 + 1020 + #endif /* defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS) */ 527 1021
+316 -1
arch/arm/mach-omap2/clock.h
··· 17 17 #define __ARCH_ARM_MACH_OMAP2_CLOCK_H 18 18 19 19 #include <linux/kernel.h> 20 + #include <linux/list.h> 20 21 21 - #include <plat/clock.h> 22 + #include <linux/clkdev.h> 23 + 24 + struct omap_clk { 25 + u16 cpu; 26 + struct clk_lookup lk; 27 + }; 28 + 29 + #define CLK(dev, con, ck, cp) \ 30 + { \ 31 + .cpu = cp, \ 32 + .lk = { \ 33 + .dev_id = dev, \ 34 + .con_id = con, \ 35 + .clk = ck, \ 36 + }, \ 37 + } 38 + 39 + /* Platform flags for the clkdev-OMAP integration code */ 40 + #define CK_242X (1 << 0) 41 + #define CK_243X (1 << 1) /* 243x, 253x */ 42 + #define CK_3430ES1 (1 << 2) /* 34xxES1 only */ 43 + #define CK_3430ES2PLUS (1 << 3) /* 34xxES2, ES3, non-Sitara 35xx only */ 44 + #define CK_AM35XX (1 << 4) /* Sitara AM35xx */ 45 + #define CK_36XX (1 << 5) /* 36xx/37xx-specific clocks */ 46 + #define CK_443X (1 << 6) 47 + #define CK_TI816X (1 << 7) 48 + #define CK_446X (1 << 8) 49 + #define CK_AM33XX (1 << 9) /* AM33xx specific clocks */ 50 + 51 + 52 + #define CK_34XX (CK_3430ES1 | CK_3430ES2PLUS) 53 + #define CK_3XXX (CK_34XX | CK_AM35XX | CK_36XX) 54 + 55 + struct module; 56 + struct clk; 57 + struct clockdomain; 58 + 59 + /* Temporary, needed during the common clock framework conversion */ 60 + #define __clk_get_name(clk) (clk->name) 61 + #define __clk_get_parent(clk) (clk->parent) 62 + #define __clk_get_rate(clk) (clk->rate) 63 + 64 + /** 65 + * struct clkops - some clock function pointers 66 + * @enable: fn ptr that enables the current clock in hardware 67 + * @disable: fn ptr that enables the current clock in hardware 68 + * @find_idlest: function returning the IDLEST register for the clock's IP blk 69 + * @find_companion: function returning the "companion" clk reg for the clock 70 + * @allow_idle: fn ptr that enables autoidle for the current clock in hardware 71 + * @deny_idle: fn ptr that disables autoidle for the current clock in hardware 72 + * 73 + * A "companion" clk is an accompanying clock to the one being queried 74 + * that must be enabled for the IP module connected to the clock to 75 + * become accessible by the hardware. Neither @find_idlest nor 76 + * @find_companion should be needed; that information is IP 77 + * block-specific; the hwmod code has been created to handle this, but 78 + * until hwmod data is ready and drivers have been converted to use PM 79 + * runtime calls in place of clk_enable()/clk_disable(), @find_idlest and 80 + * @find_companion must, unfortunately, remain. 81 + */ 82 + struct clkops { 83 + int (*enable)(struct clk *); 84 + void (*disable)(struct clk *); 85 + void (*find_idlest)(struct clk *, void __iomem **, 86 + u8 *, u8 *); 87 + void (*find_companion)(struct clk *, void __iomem **, 88 + u8 *); 89 + void (*allow_idle)(struct clk *); 90 + void (*deny_idle)(struct clk *); 91 + }; 92 + 93 + /* struct clksel_rate.flags possibilities */ 94 + #define RATE_IN_242X (1 << 0) 95 + #define RATE_IN_243X (1 << 1) 96 + #define RATE_IN_3430ES1 (1 << 2) /* 3430ES1 rates only */ 97 + #define RATE_IN_3430ES2PLUS (1 << 3) /* 3430 ES >= 2 rates only */ 98 + #define RATE_IN_36XX (1 << 4) 99 + #define RATE_IN_4430 (1 << 5) 100 + #define RATE_IN_TI816X (1 << 6) 101 + #define RATE_IN_4460 (1 << 7) 102 + #define RATE_IN_AM33XX (1 << 8) 103 + #define RATE_IN_TI814X (1 << 9) 104 + 105 + #define RATE_IN_24XX (RATE_IN_242X | RATE_IN_243X) 106 + #define RATE_IN_34XX (RATE_IN_3430ES1 | RATE_IN_3430ES2PLUS) 107 + #define RATE_IN_3XXX (RATE_IN_34XX | RATE_IN_36XX) 108 + #define RATE_IN_44XX (RATE_IN_4430 | RATE_IN_4460) 109 + 110 + /* RATE_IN_3430ES2PLUS_36XX includes 34xx/35xx with ES >=2, and all 36xx/37xx */ 111 + #define RATE_IN_3430ES2PLUS_36XX (RATE_IN_3430ES2PLUS | RATE_IN_36XX) 112 + 113 + 114 + /** 115 + * struct clksel_rate - register bitfield values corresponding to clk divisors 116 + * @val: register bitfield value (shifted to bit 0) 117 + * @div: clock divisor corresponding to @val 118 + * @flags: (see "struct clksel_rate.flags possibilities" above) 119 + * 120 + * @val should match the value of a read from struct clk.clksel_reg 121 + * AND'ed with struct clk.clksel_mask, shifted right to bit 0. 122 + * 123 + * @div is the divisor that should be applied to the parent clock's rate 124 + * to produce the current clock's rate. 125 + */ 126 + struct clksel_rate { 127 + u32 val; 128 + u8 div; 129 + u16 flags; 130 + }; 131 + 132 + /** 133 + * struct clksel - available parent clocks, and a pointer to their divisors 134 + * @parent: struct clk * to a possible parent clock 135 + * @rates: available divisors for this parent clock 136 + * 137 + * A struct clksel is always associated with one or more struct clks 138 + * and one or more struct clksel_rates. 139 + */ 140 + struct clksel { 141 + struct clk *parent; 142 + const struct clksel_rate *rates; 143 + }; 144 + 145 + /** 146 + * struct dpll_data - DPLL registers and integration data 147 + * @mult_div1_reg: register containing the DPLL M and N bitfields 148 + * @mult_mask: mask of the DPLL M bitfield in @mult_div1_reg 149 + * @div1_mask: mask of the DPLL N bitfield in @mult_div1_reg 150 + * @clk_bypass: struct clk pointer to the clock's bypass clock input 151 + * @clk_ref: struct clk pointer to the clock's reference clock input 152 + * @control_reg: register containing the DPLL mode bitfield 153 + * @enable_mask: mask of the DPLL mode bitfield in @control_reg 154 + * @last_rounded_rate: cache of the last rate result of omap2_dpll_round_rate() 155 + * @last_rounded_m: cache of the last M result of omap2_dpll_round_rate() 156 + * @max_multiplier: maximum valid non-bypass multiplier value (actual) 157 + * @last_rounded_n: cache of the last N result of omap2_dpll_round_rate() 158 + * @min_divider: minimum valid non-bypass divider value (actual) 159 + * @max_divider: maximum valid non-bypass divider value (actual) 160 + * @modes: possible values of @enable_mask 161 + * @autoidle_reg: register containing the DPLL autoidle mode bitfield 162 + * @idlest_reg: register containing the DPLL idle status bitfield 163 + * @autoidle_mask: mask of the DPLL autoidle mode bitfield in @autoidle_reg 164 + * @freqsel_mask: mask of the DPLL jitter correction bitfield in @control_reg 165 + * @idlest_mask: mask of the DPLL idle status bitfield in @idlest_reg 166 + * @auto_recal_bit: bitshift of the driftguard enable bit in @control_reg 167 + * @recal_en_bit: bitshift of the PRM_IRQENABLE_* bit for recalibration IRQs 168 + * @recal_st_bit: bitshift of the PRM_IRQSTATUS_* bit for recalibration IRQs 169 + * @flags: DPLL type/features (see below) 170 + * 171 + * Possible values for @flags: 172 + * DPLL_J_TYPE: "J-type DPLL" (only some 36xx, 4xxx DPLLs) 173 + * 174 + * @freqsel_mask is only used on the OMAP34xx family and AM35xx. 175 + * 176 + * XXX Some DPLLs have multiple bypass inputs, so it's not technically 177 + * correct to only have one @clk_bypass pointer. 178 + * 179 + * XXX The runtime-variable fields (@last_rounded_rate, @last_rounded_m, 180 + * @last_rounded_n) should be separated from the runtime-fixed fields 181 + * and placed into a different structure, so that the runtime-fixed data 182 + * can be placed into read-only space. 183 + */ 184 + struct dpll_data { 185 + void __iomem *mult_div1_reg; 186 + u32 mult_mask; 187 + u32 div1_mask; 188 + struct clk *clk_bypass; 189 + struct clk *clk_ref; 190 + void __iomem *control_reg; 191 + u32 enable_mask; 192 + unsigned long last_rounded_rate; 193 + u16 last_rounded_m; 194 + u16 max_multiplier; 195 + u8 last_rounded_n; 196 + u8 min_divider; 197 + u16 max_divider; 198 + u8 modes; 199 + void __iomem *autoidle_reg; 200 + void __iomem *idlest_reg; 201 + u32 autoidle_mask; 202 + u32 freqsel_mask; 203 + u32 idlest_mask; 204 + u32 dco_mask; 205 + u32 sddiv_mask; 206 + u8 auto_recal_bit; 207 + u8 recal_en_bit; 208 + u8 recal_st_bit; 209 + u8 flags; 210 + }; 211 + 212 + /* 213 + * struct clk.flags possibilities 214 + * 215 + * XXX document the rest of the clock flags here 216 + * 217 + * CLOCK_CLKOUTX2: (OMAP4 only) DPLL CLKOUT and CLKOUTX2 GATE_CTRL 218 + * bits share the same register. This flag allows the 219 + * omap4_dpllmx*() code to determine which GATE_CTRL bit field 220 + * should be used. This is a temporary solution - a better approach 221 + * would be to associate clock type-specific data with the clock, 222 + * similar to the struct dpll_data approach. 223 + */ 224 + #define ENABLE_REG_32BIT (1 << 0) /* Use 32-bit access */ 225 + #define CLOCK_IDLE_CONTROL (1 << 1) 226 + #define CLOCK_NO_IDLE_PARENT (1 << 2) 227 + #define ENABLE_ON_INIT (1 << 3) /* Enable upon framework init */ 228 + #define INVERT_ENABLE (1 << 4) /* 0 enables, 1 disables */ 229 + #define CLOCK_CLKOUTX2 (1 << 5) 230 + 231 + /** 232 + * struct clk - OMAP struct clk 233 + * @node: list_head connecting this clock into the full clock list 234 + * @ops: struct clkops * for this clock 235 + * @name: the name of the clock in the hardware (used in hwmod data and debug) 236 + * @parent: pointer to this clock's parent struct clk 237 + * @children: list_head connecting to the child clks' @sibling list_heads 238 + * @sibling: list_head connecting this clk to its parent clk's @children 239 + * @rate: current clock rate 240 + * @enable_reg: register to write to enable the clock (see @enable_bit) 241 + * @recalc: fn ptr that returns the clock's current rate 242 + * @set_rate: fn ptr that can change the clock's current rate 243 + * @round_rate: fn ptr that can round the clock's current rate 244 + * @init: fn ptr to do clock-specific initialization 245 + * @enable_bit: bitshift to write to enable/disable the clock (see @enable_reg) 246 + * @usecount: number of users that have requested this clock to be enabled 247 + * @fixed_div: when > 0, this clock's rate is its parent's rate / @fixed_div 248 + * @flags: see "struct clk.flags possibilities" above 249 + * @clksel_reg: for clksel clks, register va containing src/divisor select 250 + * @clksel_mask: bitmask in @clksel_reg for the src/divisor selector 251 + * @clksel: for clksel clks, pointer to struct clksel for this clock 252 + * @dpll_data: for DPLLs, pointer to struct dpll_data for this clock 253 + * @clkdm_name: clockdomain name that this clock is contained in 254 + * @clkdm: pointer to struct clockdomain, resolved from @clkdm_name at runtime 255 + * @rate_offset: bitshift for rate selection bitfield (OMAP1 only) 256 + * @src_offset: bitshift for source selection bitfield (OMAP1 only) 257 + * 258 + * XXX @rate_offset, @src_offset should probably be removed and OMAP1 259 + * clock code converted to use clksel. 260 + * 261 + * XXX @usecount is poorly named. It should be "enable_count" or 262 + * something similar. "users" in the description refers to kernel 263 + * code (core code or drivers) that have called clk_enable() and not 264 + * yet called clk_disable(); the usecount of parent clocks is also 265 + * incremented by the clock code when clk_enable() is called on child 266 + * clocks and decremented by the clock code when clk_disable() is 267 + * called on child clocks. 268 + * 269 + * XXX @clkdm, @usecount, @children, @sibling should be marked for 270 + * internal use only. 271 + * 272 + * @children and @sibling are used to optimize parent-to-child clock 273 + * tree traversals. (child-to-parent traversals use @parent.) 274 + * 275 + * XXX The notion of the clock's current rate probably needs to be 276 + * separated from the clock's target rate. 277 + */ 278 + struct clk { 279 + struct list_head node; 280 + const struct clkops *ops; 281 + const char *name; 282 + struct clk *parent; 283 + struct list_head children; 284 + struct list_head sibling; /* node for children */ 285 + unsigned long rate; 286 + void __iomem *enable_reg; 287 + unsigned long (*recalc)(struct clk *); 288 + int (*set_rate)(struct clk *, unsigned long); 289 + long (*round_rate)(struct clk *, unsigned long); 290 + void (*init)(struct clk *); 291 + u8 enable_bit; 292 + s8 usecount; 293 + u8 fixed_div; 294 + u8 flags; 295 + void __iomem *clksel_reg; 296 + u32 clksel_mask; 297 + const struct clksel *clksel; 298 + struct dpll_data *dpll_data; 299 + const char *clkdm_name; 300 + struct clockdomain *clkdm; 301 + #if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS) 302 + struct dentry *dent; /* For visible tree hierarchy */ 303 + #endif 304 + }; 305 + 306 + struct clk_functions { 307 + int (*clk_enable)(struct clk *clk); 308 + void (*clk_disable)(struct clk *clk); 309 + long (*clk_round_rate)(struct clk *clk, unsigned long rate); 310 + int (*clk_set_rate)(struct clk *clk, unsigned long rate); 311 + int (*clk_set_parent)(struct clk *clk, struct clk *parent); 312 + void (*clk_allow_idle)(struct clk *clk); 313 + void (*clk_deny_idle)(struct clk *clk); 314 + void (*clk_disable_unused)(struct clk *clk); 315 + }; 316 + 317 + extern int mpurate; 318 + 319 + extern int clk_init(struct clk_functions *custom_clocks); 320 + extern void clk_preinit(struct clk *clk); 321 + extern int clk_register(struct clk *clk); 322 + extern void clk_reparent(struct clk *child, struct clk *parent); 323 + extern void clk_unregister(struct clk *clk); 324 + extern void propagate_rate(struct clk *clk); 325 + extern void recalculate_root_clocks(void); 326 + extern unsigned long followparent_recalc(struct clk *clk); 327 + extern void clk_enable_init_clocks(void); 328 + unsigned long omap_fixed_divisor_recalc(struct clk *clk); 329 + extern struct clk *omap_clk_get_by_name(const char *name); 330 + extern int omap_clk_enable_autoidle_all(void); 331 + extern int omap_clk_disable_autoidle_all(void); 332 + 333 + extern const struct clkops clkops_null; 334 + 335 + extern struct clk dummy_ck; 336 + 22 337 23 338 /* CM_CLKSEL2_PLL.CORE_CLK_SRC bits (2XXX) */ 24 339 #define CORE_CLK_SRC_32K 0x0
-4
arch/arm/mach-omap2/clock2420_data.c
··· 18 18 #include <linux/clk.h> 19 19 #include <linux/list.h> 20 20 21 - #include <plat/clkdev_omap.h> 22 - 23 21 #include "soc.h" 24 22 #include "iomap.h" 25 23 #include "clock.h" ··· 1932 1934 cm_idlest_pll = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST); 1933 1935 cpu_mask = RATE_IN_242X; 1934 1936 rate_table = omap2420_rate_table; 1935 - 1936 - clk_init(&omap2_clk_functions); 1937 1937 1938 1938 for (c = omap2420_clks; c < omap2420_clks + ARRAY_SIZE(omap2420_clks); 1939 1939 c++)
-2
arch/arm/mach-omap2/clock2430.c
··· 21 21 #include <linux/clk.h> 22 22 #include <linux/io.h> 23 23 24 - #include <plat/clock.h> 25 - 26 24 #include "soc.h" 27 25 #include "iomap.h" 28 26 #include "clock.h"
-4
arch/arm/mach-omap2/clock2430_data.c
··· 17 17 #include <linux/clk.h> 18 18 #include <linux/list.h> 19 19 20 - #include <plat/clkdev_omap.h> 21 - 22 20 #include "soc.h" 23 21 #include "iomap.h" 24 22 #include "clock.h" ··· 2031 2033 cm_idlest_pll = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST); 2032 2034 cpu_mask = RATE_IN_243X; 2033 2035 rate_table = omap2430_rate_table; 2034 - 2035 - clk_init(&omap2_clk_functions); 2036 2036 2037 2037 for (c = omap2430_clks; c < omap2430_clks + ARRAY_SIZE(omap2430_clks); 2038 2038 c++)
-2
arch/arm/mach-omap2/clock2xxx.c
··· 22 22 #include <linux/clk.h> 23 23 #include <linux/io.h> 24 24 25 - #include <plat/clock.h> 26 - 27 25 #include "soc.h" 28 26 #include "clock.h" 29 27 #include "clock2xxx.h"
+1 -4
arch/arm/mach-omap2/clock33xx_data.c
··· 17 17 #include <linux/kernel.h> 18 18 #include <linux/list.h> 19 19 #include <linux/clk.h> 20 - #include <plat/clkdev_omap.h> 21 20 22 - #include "am33xx.h" 21 + #include "soc.h" 23 22 #include "iomap.h" 24 23 #include "control.h" 25 24 #include "clock.h" ··· 1085 1086 cpu_mask = RATE_IN_AM33XX; 1086 1087 cpu_clkflg = CK_AM33XX; 1087 1088 } 1088 - 1089 - clk_init(&omap2_clk_functions); 1090 1089 1091 1090 for (c = am33xx_clks; c < am33xx_clks + ARRAY_SIZE(am33xx_clks); c++) 1092 1091 clk_preinit(c->lk.clk);
-2
arch/arm/mach-omap2/clock34xx.c
··· 21 21 #include <linux/clk.h> 22 22 #include <linux/io.h> 23 23 24 - #include <plat/clock.h> 25 - 26 24 #include "clock.h" 27 25 #include "clock34xx.h" 28 26 #include "cm2xxx_3xxx.h"
-2
arch/arm/mach-omap2/clock3517.c
··· 21 21 #include <linux/clk.h> 22 22 #include <linux/io.h> 23 23 24 - #include <plat/clock.h> 25 - 26 24 #include "clock.h" 27 25 #include "clock3517.h" 28 26 #include "cm2xxx_3xxx.h"
-2
arch/arm/mach-omap2/clock36xx.c
··· 22 22 #include <linux/clk.h> 23 23 #include <linux/io.h> 24 24 25 - #include <plat/clock.h> 26 - 27 25 #include "clock.h" 28 26 #include "clock36xx.h" 29 27
-2
arch/arm/mach-omap2/clock3xxx.c
··· 21 21 #include <linux/clk.h> 22 22 #include <linux/io.h> 23 23 24 - #include <plat/clock.h> 25 - 26 24 #include "soc.h" 27 25 #include "clock.h" 28 26 #include "clock3xxx.h"
-4
arch/arm/mach-omap2/clock3xxx_data.c
··· 21 21 #include <linux/list.h> 22 22 #include <linux/io.h> 23 23 24 - #include <plat/clkdev_omap.h> 25 - 26 24 #include "soc.h" 27 25 #include "iomap.h" 28 26 #include "clock.h" ··· 3570 3572 dpll4_dd = dpll4_dd_3630; 3571 3573 else 3572 3574 dpll4_dd = dpll4_dd_34xx; 3573 - 3574 - clk_init(&omap2_clk_functions); 3575 3575 3576 3576 for (c = omap3xxx_clks; c < omap3xxx_clks + ARRAY_SIZE(omap3xxx_clks); 3577 3577 c++)
-4
arch/arm/mach-omap2/clock44xx_data.c
··· 28 28 #include <linux/clk.h> 29 29 #include <linux/io.h> 30 30 31 - #include <plat/clkdev_omap.h> 32 - 33 31 #include "soc.h" 34 32 #include "iomap.h" 35 33 #include "clock.h" ··· 3363 3365 } else { 3364 3366 return 0; 3365 3367 } 3366 - 3367 - clk_init(&omap2_clk_functions); 3368 3368 3369 3369 /* 3370 3370 * Must stay commented until all OMAP SoC drivers are
+2 -1
arch/arm/mach-omap2/clockdomain.c
··· 27 27 28 28 #include <linux/bitops.h> 29 29 30 - #include <plat/clock.h> 30 + #include "soc.h" 31 + #include "clock.h" 31 32 #include "clockdomain.h" 32 33 33 34 /* clkdm_list contains all registered struct clockdomains */
+2 -3
arch/arm/mach-omap2/clockdomain.h
··· 18 18 #include <linux/spinlock.h> 19 19 20 20 #include "powerdomain.h" 21 - #include <plat/clock.h> 22 - #include <plat/omap_hwmod.h> 23 - #include <plat/cpu.h> 21 + #include "clock.h" 22 + #include "omap_hwmod.h" 24 23 25 24 /* 26 25 * Clockdomain flags
+2
arch/arm/mach-omap2/clockdomain2xxx_3xxx.c
··· 14 14 15 15 #include <linux/types.h> 16 16 #include <plat/prcm.h> 17 + 18 + #include "soc.h" 17 19 #include "prm.h" 18 20 #include "prm2xxx_3xxx.h" 19 21 #include "cm.h"
+1
arch/arm/mach-omap2/clockdomains2420_data.c
··· 35 35 #include <linux/kernel.h> 36 36 #include <linux/io.h> 37 37 38 + #include "soc.h" 38 39 #include "clockdomain.h" 39 40 #include "prm2xxx_3xxx.h" 40 41 #include "cm2xxx_3xxx.h"
+1
arch/arm/mach-omap2/clockdomains2430_data.c
··· 35 35 #include <linux/kernel.h> 36 36 #include <linux/io.h> 37 37 38 + #include "soc.h" 38 39 #include "clockdomain.h" 39 40 #include "prm2xxx_3xxx.h" 40 41 #include "cm2xxx_3xxx.h"
+1
arch/arm/mach-omap2/clockdomains3xxx_data.c
··· 33 33 #include <linux/kernel.h> 34 34 #include <linux/io.h> 35 35 36 + #include "soc.h" 36 37 #include "clockdomain.h" 37 38 #include "prm2xxx_3xxx.h" 38 39 #include "cm2xxx_3xxx.h"
-2
arch/arm/mach-omap2/cm33xx.c
··· 22 22 #include <linux/err.h> 23 23 #include <linux/io.h> 24 24 25 - #include <plat/common.h> 26 - 27 25 #include "cm.h" 28 26 #include "cm33xx.h" 29 27 #include "cm-regbits-34xx.h"
-46
arch/arm/mach-omap2/common-board-devices.c
··· 25 25 #include <linux/spi/ads7846.h> 26 26 27 27 #include <linux/platform_data/spi-omap2-mcspi.h> 28 - #include <linux/platform_data/mtd-nand-omap2.h> 29 28 30 29 #include "common.h" 31 30 #include "common-board-devices.h" ··· 92 93 #else 93 94 void __init omap_ads7846_init(int bus_num, int gpio_pendown, int gpio_debounce, 94 95 struct ads7846_platform_data *board_pdata) 95 - { 96 - } 97 - #endif 98 - 99 - #if defined(CONFIG_MTD_NAND_OMAP2) || defined(CONFIG_MTD_NAND_OMAP2_MODULE) 100 - static struct omap_nand_platform_data nand_data; 101 - 102 - void __init omap_nand_flash_init(int options, struct mtd_partition *parts, 103 - int nr_parts) 104 - { 105 - u8 cs = 0; 106 - u8 nandcs = GPMC_CS_NUM + 1; 107 - 108 - /* find out the chip-select on which NAND exists */ 109 - while (cs < GPMC_CS_NUM) { 110 - u32 ret = 0; 111 - ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1); 112 - 113 - if ((ret & 0xC00) == 0x800) { 114 - printk(KERN_INFO "Found NAND on CS%d\n", cs); 115 - if (nandcs > GPMC_CS_NUM) 116 - nandcs = cs; 117 - } 118 - cs++; 119 - } 120 - 121 - if (nandcs > GPMC_CS_NUM) { 122 - pr_info("NAND: Unable to find configuration in GPMC\n"); 123 - return; 124 - } 125 - 126 - if (nandcs < GPMC_CS_NUM) { 127 - nand_data.cs = nandcs; 128 - nand_data.parts = parts; 129 - nand_data.nr_parts = nr_parts; 130 - nand_data.devsize = options; 131 - 132 - printk(KERN_INFO "Registering NAND on CS%d\n", nandcs); 133 - if (gpmc_nand_init(&nand_data) < 0) 134 - printk(KERN_ERR "Unable to register NAND device\n"); 135 - } 136 - } 137 - #else 138 - void __init omap_nand_flash_init(int options, struct mtd_partition *parts, 139 - int nr_parts) 140 96 { 141 97 } 142 98 #endif
-1
arch/arm/mach-omap2/common-board-devices.h
··· 10 10 11 11 void omap_ads7846_init(int bus_num, int gpio_pendown, int gpio_debounce, 12 12 struct ads7846_platform_data *board_pdata); 13 - void omap_nand_flash_init(int opts, struct mtd_partition *parts, int n_parts); 14 13 15 14 #endif /* __OMAP_COMMON_BOARD_DEVICES__ */
+21 -1
arch/arm/mach-omap2/common.c
··· 16 16 #include <linux/init.h> 17 17 #include <linux/clk.h> 18 18 #include <linux/io.h> 19 + #include <linux/platform_data/dsp-omap.h> 19 20 20 - #include <plat/clock.h> 21 + #include <plat/vram.h> 21 22 22 23 #include "soc.h" 23 24 #include "iomap.h" 24 25 #include "common.h" 26 + #include "clock.h" 25 27 #include "sdrc.h" 26 28 #include "control.h" 29 + #include "omap-secure.h" 27 30 28 31 /* Global address base setup code */ 29 32 ··· 203 200 omap5_map_common_io(); 204 201 } 205 202 #endif 203 + 204 + /* 205 + * Stub function for OMAP2 so that common files 206 + * continue to build when custom builds are used 207 + */ 208 + int __weak omap_secure_ram_reserve_memblock(void) 209 + { 210 + return 0; 211 + } 212 + 213 + void __init omap_reserve(void) 214 + { 215 + omap_vram_reserve_sdram_memblock(); 216 + omap_dsp_reserve_sdram_memblock(); 217 + omap_secure_ram_reserve_memblock(); 218 + omap_barrier_reserve_memblock(); 219 + }
+10 -3
arch/arm/mach-omap2/common.h
··· 28 28 29 29 #include <linux/irq.h> 30 30 #include <linux/delay.h> 31 + #include <linux/i2c.h> 31 32 #include <linux/i2c/twl.h> 33 + #include <linux/i2c-omap.h> 32 34 33 35 #include <asm/proc-fns.h> 34 36 35 - #include <plat/cpu.h> 36 - #include <plat/serial.h> 37 - #include <plat/common.h> 37 + #include "i2c.h" 38 + #include "serial.h" 39 + 40 + #include "usb.h" 38 41 39 42 #define OMAP_INTC_START NR_IRQS 40 43 ··· 341 338 struct omap_sdrc_params *sdrc_cs1); 342 339 struct omap2_hsmmc_info; 343 340 extern int omap4_twl6030_hsmmc_init(struct omap2_hsmmc_info *controllers); 341 + extern void omap_reserve(void); 342 + 343 + struct omap_hwmod; 344 + extern int omap_dss_reset(struct omap_hwmod *); 344 345 345 346 #endif /* __ASSEMBLER__ */ 346 347 #endif /* __ARCH_ARM_MACH_OMAP2PLUS_COMMON_H */
+1 -3
arch/arm/mach-omap2/control.c
··· 1 1 /* 2 2 * OMAP2/3 System Control Module register access 3 3 * 4 - * Copyright (C) 2007 Texas Instruments, Inc. 4 + * Copyright (C) 2007, 2012 Texas Instruments, Inc. 5 5 * Copyright (C) 2007 Nokia Corporation 6 6 * 7 7 * Written by Paul Walmsley ··· 14 14 15 15 #include <linux/kernel.h> 16 16 #include <linux/io.h> 17 - 18 - #include <plat/sdrc.h> 19 17 20 18 #include "soc.h" 21 19 #include "iomap.h"
-7
arch/arm/mach-omap2/debug-devices.h arch/arm/plat-omap/include/plat/debug-devices.h
··· 1 - #ifndef _OMAP_DEBUG_DEVICES_H 2 - #define _OMAP_DEBUG_DEVICES_H 3 - 4 - #include <linux/types.h> 5 - 6 1 /* for TI reference platforms sharing the same debug card */ 7 2 extern int debug_card_init(u32 addr, unsigned gpio); 8 - 9 - #endif
+5 -3
arch/arm/mach-omap2/devices.c
··· 23 23 #include <asm/mach-types.h> 24 24 #include <asm/mach/map.h> 25 25 26 + #include <plat-omap/dma-omap.h> 27 + 26 28 #include "iomap.h" 27 - #include <plat/dma.h> 28 - #include <plat/omap_hwmod.h> 29 - #include <plat/omap_device.h> 29 + #include "omap_hwmod.h" 30 + #include "omap_device.h" 30 31 #include "omap4-keypad.h" 31 32 32 33 #include "soc.h" ··· 35 34 #include "mux.h" 36 35 #include "control.h" 37 36 #include "devices.h" 37 + #include "dma.h" 38 38 39 39 #define L3_MODULES_MAX_LEN 12 40 40 #define L3_MODULES 3
+42 -3
arch/arm/mach-omap2/display.c
··· 25 25 #include <linux/delay.h> 26 26 27 27 #include <video/omapdss.h> 28 - #include <plat/omap_hwmod.h> 29 - #include <plat/omap_device.h> 30 - #include <plat/omap-pm.h> 28 + #include "omap_hwmod.h" 29 + #include "omap_device.h" 30 + #include "omap-pm.h" 31 31 #include "common.h" 32 32 33 + #include "soc.h" 33 34 #include "iomap.h" 34 35 #include "mux.h" 35 36 #include "control.h" ··· 285 284 return ERR_PTR(r); 286 285 } 287 286 287 + static enum omapdss_version __init omap_display_get_version(void) 288 + { 289 + if (cpu_is_omap24xx()) 290 + return OMAPDSS_VER_OMAP24xx; 291 + else if (cpu_is_omap3630()) 292 + return OMAPDSS_VER_OMAP3630; 293 + else if (cpu_is_omap34xx()) { 294 + if (soc_is_am35xx()) { 295 + return OMAPDSS_VER_AM35xx; 296 + } else { 297 + if (omap_rev() < OMAP3430_REV_ES3_0) 298 + return OMAPDSS_VER_OMAP34xx_ES1; 299 + else 300 + return OMAPDSS_VER_OMAP34xx_ES3; 301 + } 302 + } else if (omap_rev() == OMAP4430_REV_ES1_0) 303 + return OMAPDSS_VER_OMAP4430_ES1; 304 + else if (omap_rev() == OMAP4430_REV_ES2_0 || 305 + omap_rev() == OMAP4430_REV_ES2_1 || 306 + omap_rev() == OMAP4430_REV_ES2_2) 307 + return OMAPDSS_VER_OMAP4430_ES2; 308 + else if (cpu_is_omap44xx()) 309 + return OMAPDSS_VER_OMAP4; 310 + else if (soc_is_omap54xx()) 311 + return OMAPDSS_VER_OMAP5; 312 + else 313 + return OMAPDSS_VER_UNKNOWN; 314 + } 315 + 288 316 int __init omap_display_init(struct omap_dss_board_info *board_data) 289 317 { 290 318 int r = 0; ··· 321 291 int i, oh_count; 322 292 const struct omap_dss_hwmod_data *curr_dss_hwmod; 323 293 struct platform_device *dss_pdev; 294 + enum omapdss_version ver; 324 295 325 296 /* create omapdss device */ 326 297 298 + ver = omap_display_get_version(); 299 + 300 + if (ver == OMAPDSS_VER_UNKNOWN) { 301 + pr_err("DSS not supported on this SoC\n"); 302 + return -ENODEV; 303 + } 304 + 305 + board_data->version = ver; 327 306 board_data->dsi_enable_pads = omap_dsi_enable_pads; 328 307 board_data->dsi_disable_pads = omap_dsi_disable_pads; 329 308 board_data->get_context_loss_count = omap_pm_get_dev_context_loss_count;
+8 -3
arch/arm/mach-omap2/dma.c
··· 28 28 #include <linux/init.h> 29 29 #include <linux/device.h> 30 30 31 - #include <plat/omap_hwmod.h> 32 - #include <plat/omap_device.h> 33 - #include <plat/dma.h> 31 + #include <plat-omap/dma-omap.h> 32 + 33 + #include "soc.h" 34 + #include "omap_hwmod.h" 35 + #include "omap_device.h" 34 36 35 37 #define OMAP2_DMA_STRIDE 0x60 36 38 ··· 275 273 dev_err(&pdev->dev, "%s: kzalloc fail\n", __func__); 276 274 return -ENOMEM; 277 275 } 276 + 277 + if (cpu_is_omap34xx() && (omap_type() != OMAP2_DEVICE_TYPE_GP)) 278 + d->dev_caps |= HS_CHANNELS_RESERVED; 278 279 279 280 /* Check the capabilities register for descriptor loading feature */ 280 281 if (dma_read(CAPS_0, 0) & DMA_HAS_DESCRIPTOR_CAPS)
+131
arch/arm/mach-omap2/dma.h
··· 1 + /* 2 + * OMAP2PLUS DMA channel definitions 3 + * 4 + * This program is free software; you can redistribute it and/or modify 5 + * it under the terms of the GNU General Public License as published by 6 + * the Free Software Foundation; either version 2 of the License, or 7 + * (at your option) any later version. 8 + * 9 + * This program is distributed in the hope that it will be useful, 10 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 + * GNU General Public License for more details. 13 + * 14 + * You should have received a copy of the GNU General Public License 15 + * along with this program; if not, write to the Free Software 16 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 + */ 18 + 19 + #ifndef __OMAP2PLUS_DMA_CHANNEL_H 20 + #define __OMAP2PLUS_DMA_CHANNEL_H 21 + 22 + 23 + /* DMA channels for 24xx */ 24 + #define OMAP24XX_DMA_NO_DEVICE 0 25 + #define OMAP24XX_DMA_XTI_DMA 1 /* S_DMA_0 */ 26 + #define OMAP24XX_DMA_EXT_DMAREQ0 2 /* S_DMA_1 */ 27 + #define OMAP24XX_DMA_EXT_DMAREQ1 3 /* S_DMA_2 */ 28 + #define OMAP24XX_DMA_GPMC 4 /* S_DMA_3 */ 29 + #define OMAP24XX_DMA_GFX 5 /* S_DMA_4 */ 30 + #define OMAP24XX_DMA_DSS 6 /* S_DMA_5 */ 31 + #define OMAP242X_DMA_VLYNQ_TX 7 /* S_DMA_6 */ 32 + #define OMAP24XX_DMA_EXT_DMAREQ2 7 /* S_DMA_6 */ 33 + #define OMAP24XX_DMA_CWT 8 /* S_DMA_7 */ 34 + #define OMAP24XX_DMA_AES_TX 9 /* S_DMA_8 */ 35 + #define OMAP24XX_DMA_AES_RX 10 /* S_DMA_9 */ 36 + #define OMAP24XX_DMA_DES_TX 11 /* S_DMA_10 */ 37 + #define OMAP24XX_DMA_DES_RX 12 /* S_DMA_11 */ 38 + #define OMAP24XX_DMA_SHA1MD5_RX 13 /* S_DMA_12 */ 39 + #define OMAP34XX_DMA_SHA2MD5_RX 13 /* S_DMA_12 */ 40 + #define OMAP242X_DMA_EXT_DMAREQ2 14 /* S_DMA_13 */ 41 + #define OMAP242X_DMA_EXT_DMAREQ3 15 /* S_DMA_14 */ 42 + #define OMAP242X_DMA_EXT_DMAREQ4 16 /* S_DMA_15 */ 43 + #define OMAP242X_DMA_EAC_AC_RD 17 /* S_DMA_16 */ 44 + #define OMAP242X_DMA_EAC_AC_WR 18 /* S_DMA_17 */ 45 + #define OMAP242X_DMA_EAC_MD_UL_RD 19 /* S_DMA_18 */ 46 + #define OMAP242X_DMA_EAC_MD_UL_WR 20 /* S_DMA_19 */ 47 + #define OMAP242X_DMA_EAC_MD_DL_RD 21 /* S_DMA_20 */ 48 + #define OMAP242X_DMA_EAC_MD_DL_WR 22 /* S_DMA_21 */ 49 + #define OMAP242X_DMA_EAC_BT_UL_RD 23 /* S_DMA_22 */ 50 + #define OMAP242X_DMA_EAC_BT_UL_WR 24 /* S_DMA_23 */ 51 + #define OMAP242X_DMA_EAC_BT_DL_RD 25 /* S_DMA_24 */ 52 + #define OMAP242X_DMA_EAC_BT_DL_WR 26 /* S_DMA_25 */ 53 + #define OMAP243X_DMA_EXT_DMAREQ3 14 /* S_DMA_13 */ 54 + #define OMAP24XX_DMA_SPI3_TX0 15 /* S_DMA_14 */ 55 + #define OMAP24XX_DMA_SPI3_RX0 16 /* S_DMA_15 */ 56 + #define OMAP24XX_DMA_MCBSP3_TX 17 /* S_DMA_16 */ 57 + #define OMAP24XX_DMA_MCBSP3_RX 18 /* S_DMA_17 */ 58 + #define OMAP24XX_DMA_MCBSP4_TX 19 /* S_DMA_18 */ 59 + #define OMAP24XX_DMA_MCBSP4_RX 20 /* S_DMA_19 */ 60 + #define OMAP24XX_DMA_MCBSP5_TX 21 /* S_DMA_20 */ 61 + #define OMAP24XX_DMA_MCBSP5_RX 22 /* S_DMA_21 */ 62 + #define OMAP24XX_DMA_SPI3_TX1 23 /* S_DMA_22 */ 63 + #define OMAP24XX_DMA_SPI3_RX1 24 /* S_DMA_23 */ 64 + #define OMAP243X_DMA_EXT_DMAREQ4 25 /* S_DMA_24 */ 65 + #define OMAP243X_DMA_EXT_DMAREQ5 26 /* S_DMA_25 */ 66 + #define OMAP34XX_DMA_I2C3_TX 25 /* S_DMA_24 */ 67 + #define OMAP34XX_DMA_I2C3_RX 26 /* S_DMA_25 */ 68 + #define OMAP24XX_DMA_I2C1_TX 27 /* S_DMA_26 */ 69 + #define OMAP24XX_DMA_I2C1_RX 28 /* S_DMA_27 */ 70 + #define OMAP24XX_DMA_I2C2_TX 29 /* S_DMA_28 */ 71 + #define OMAP24XX_DMA_I2C2_RX 30 /* S_DMA_29 */ 72 + #define OMAP24XX_DMA_MCBSP1_TX 31 /* S_DMA_30 */ 73 + #define OMAP24XX_DMA_MCBSP1_RX 32 /* S_DMA_31 */ 74 + #define OMAP24XX_DMA_MCBSP2_TX 33 /* S_DMA_32 */ 75 + #define OMAP24XX_DMA_MCBSP2_RX 34 /* S_DMA_33 */ 76 + #define OMAP24XX_DMA_SPI1_TX0 35 /* S_DMA_34 */ 77 + #define OMAP24XX_DMA_SPI1_RX0 36 /* S_DMA_35 */ 78 + #define OMAP24XX_DMA_SPI1_TX1 37 /* S_DMA_36 */ 79 + #define OMAP24XX_DMA_SPI1_RX1 38 /* S_DMA_37 */ 80 + #define OMAP24XX_DMA_SPI1_TX2 39 /* S_DMA_38 */ 81 + #define OMAP24XX_DMA_SPI1_RX2 40 /* S_DMA_39 */ 82 + #define OMAP24XX_DMA_SPI1_TX3 41 /* S_DMA_40 */ 83 + #define OMAP24XX_DMA_SPI1_RX3 42 /* S_DMA_41 */ 84 + #define OMAP24XX_DMA_SPI2_TX0 43 /* S_DMA_42 */ 85 + #define OMAP24XX_DMA_SPI2_RX0 44 /* S_DMA_43 */ 86 + #define OMAP24XX_DMA_SPI2_TX1 45 /* S_DMA_44 */ 87 + #define OMAP24XX_DMA_SPI2_RX1 46 /* S_DMA_45 */ 88 + #define OMAP24XX_DMA_MMC2_TX 47 /* S_DMA_46 */ 89 + #define OMAP24XX_DMA_MMC2_RX 48 /* S_DMA_47 */ 90 + #define OMAP24XX_DMA_UART1_TX 49 /* S_DMA_48 */ 91 + #define OMAP24XX_DMA_UART1_RX 50 /* S_DMA_49 */ 92 + #define OMAP24XX_DMA_UART2_TX 51 /* S_DMA_50 */ 93 + #define OMAP24XX_DMA_UART2_RX 52 /* S_DMA_51 */ 94 + #define OMAP24XX_DMA_UART3_TX 53 /* S_DMA_52 */ 95 + #define OMAP24XX_DMA_UART3_RX 54 /* S_DMA_53 */ 96 + #define OMAP24XX_DMA_USB_W2FC_TX0 55 /* S_DMA_54 */ 97 + #define OMAP24XX_DMA_USB_W2FC_RX0 56 /* S_DMA_55 */ 98 + #define OMAP24XX_DMA_USB_W2FC_TX1 57 /* S_DMA_56 */ 99 + #define OMAP24XX_DMA_USB_W2FC_RX1 58 /* S_DMA_57 */ 100 + #define OMAP24XX_DMA_USB_W2FC_TX2 59 /* S_DMA_58 */ 101 + #define OMAP24XX_DMA_USB_W2FC_RX2 60 /* S_DMA_59 */ 102 + #define OMAP24XX_DMA_MMC1_TX 61 /* S_DMA_60 */ 103 + #define OMAP24XX_DMA_MMC1_RX 62 /* S_DMA_61 */ 104 + #define OMAP24XX_DMA_MS 63 /* S_DMA_62 */ 105 + #define OMAP242X_DMA_EXT_DMAREQ5 64 /* S_DMA_63 */ 106 + #define OMAP243X_DMA_EXT_DMAREQ6 64 /* S_DMA_63 */ 107 + #define OMAP34XX_DMA_EXT_DMAREQ3 64 /* S_DMA_63 */ 108 + #define OMAP34XX_DMA_AES2_TX 65 /* S_DMA_64 */ 109 + #define OMAP34XX_DMA_AES2_RX 66 /* S_DMA_65 */ 110 + #define OMAP34XX_DMA_DES2_TX 67 /* S_DMA_66 */ 111 + #define OMAP34XX_DMA_DES2_RX 68 /* S_DMA_67 */ 112 + #define OMAP34XX_DMA_SHA1MD5_RX 69 /* S_DMA_68 */ 113 + #define OMAP34XX_DMA_SPI4_TX0 70 /* S_DMA_69 */ 114 + #define OMAP34XX_DMA_SPI4_RX0 71 /* S_DMA_70 */ 115 + #define OMAP34XX_DSS_DMA0 72 /* S_DMA_71 */ 116 + #define OMAP34XX_DSS_DMA1 73 /* S_DMA_72 */ 117 + #define OMAP34XX_DSS_DMA2 74 /* S_DMA_73 */ 118 + #define OMAP34XX_DSS_DMA3 75 /* S_DMA_74 */ 119 + #define OMAP34XX_DMA_MMC3_TX 77 /* S_DMA_76 */ 120 + #define OMAP34XX_DMA_MMC3_RX 78 /* S_DMA_77 */ 121 + #define OMAP34XX_DMA_USIM_TX 79 /* S_DMA_78 */ 122 + #define OMAP34XX_DMA_USIM_RX 80 /* S_DMA_79 */ 123 + 124 + #define OMAP36XX_DMA_UART4_TX 81 /* S_DMA_80 */ 125 + #define OMAP36XX_DMA_UART4_RX 82 /* S_DMA_81 */ 126 + 127 + /* Only for AM35xx */ 128 + #define AM35XX_DMA_UART4_TX 54 129 + #define AM35XX_DMA_UART4_RX 55 130 + 131 + #endif /* __OMAP2PLUS_DMA_CHANNEL_H */
-2
arch/arm/mach-omap2/dpll3xxx.c
··· 28 28 #include <linux/bitops.h> 29 29 #include <linux/clkdev.h> 30 30 31 - #include <plat/clock.h> 32 - 33 31 #include "soc.h" 34 32 #include "clock.h" 35 33 #include "cm2xxx_3xxx.h"
-2
arch/arm/mach-omap2/dpll44xx.c
··· 15 15 #include <linux/io.h> 16 16 #include <linux/bitops.h> 17 17 18 - #include <plat/clock.h> 19 - 20 18 #include "soc.h" 21 19 #include "clock.h" 22 20 #include "clock44xx.h"
+2 -2
arch/arm/mach-omap2/drm.c
··· 24 24 #include <linux/platform_device.h> 25 25 #include <linux/dma-mapping.h> 26 26 27 - #include <plat/omap_device.h> 28 - #include <plat/omap_hwmod.h> 27 + #include "omap_device.h" 28 + #include "omap_hwmod.h" 29 29 30 30 #if defined(CONFIG_DRM_OMAP) || (CONFIG_DRM_OMAP_MODULE) 31 31
+1 -1
arch/arm/mach-omap2/dsp.c
··· 27 27 #include "cm2xxx_3xxx.h" 28 28 #include "prm2xxx_3xxx.h" 29 29 #ifdef CONFIG_BRIDGE_DVFS 30 - #include <plat/omap-pm.h> 30 + #include "omap-pm.h" 31 31 #endif 32 32 33 33 #include <linux/platform_data/dsp-omap.h>
+3 -3
arch/arm/mach-omap2/gpio.c
··· 23 23 #include <linux/of.h> 24 24 #include <linux/platform_data/gpio-omap.h> 25 25 26 - #include <plat/omap_hwmod.h> 27 - #include <plat/omap_device.h> 28 - #include <plat/omap-pm.h> 26 + #include "omap_hwmod.h" 27 + #include "omap_device.h" 28 + #include "omap-pm.h" 29 29 30 30 #include "powerdomain.h" 31 31
+55 -30
arch/arm/mach-omap2/gpmc-nand.c
··· 17 17 18 18 #include <asm/mach/flash.h> 19 19 20 - #include <plat/gpmc.h> 21 - 20 + #include "gpmc.h" 22 21 #include "soc.h" 22 + #include "gpmc-nand.h" 23 + 24 + /* minimum size for IO mapping */ 25 + #define NAND_IO_SIZE 4 23 26 24 27 static struct resource gpmc_nand_resource[] = { 25 28 { ··· 43 40 .resource = gpmc_nand_resource, 44 41 }; 45 42 46 - static int omap2_nand_gpmc_retime(struct omap_nand_platform_data *gpmc_nand_data) 43 + static int omap2_nand_gpmc_retime( 44 + struct omap_nand_platform_data *gpmc_nand_data, 45 + struct gpmc_timings *gpmc_t) 47 46 { 48 47 struct gpmc_timings t; 49 48 int err; 50 49 51 - if (!gpmc_nand_data->gpmc_t) 52 - return 0; 53 - 54 50 memset(&t, 0, sizeof(t)); 55 - t.sync_clk = gpmc_nand_data->gpmc_t->sync_clk; 56 - t.cs_on = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->cs_on); 57 - t.adv_on = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->adv_on); 51 + t.sync_clk = gpmc_t->sync_clk; 52 + t.cs_on = gpmc_round_ns_to_ticks(gpmc_t->cs_on); 53 + t.adv_on = gpmc_round_ns_to_ticks(gpmc_t->adv_on); 58 54 59 55 /* Read */ 60 - t.adv_rd_off = gpmc_round_ns_to_ticks( 61 - gpmc_nand_data->gpmc_t->adv_rd_off); 56 + t.adv_rd_off = gpmc_round_ns_to_ticks(gpmc_t->adv_rd_off); 62 57 t.oe_on = t.adv_on; 63 - t.access = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->access); 64 - t.oe_off = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->oe_off); 65 - t.cs_rd_off = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->cs_rd_off); 66 - t.rd_cycle = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->rd_cycle); 58 + t.access = gpmc_round_ns_to_ticks(gpmc_t->access); 59 + t.oe_off = gpmc_round_ns_to_ticks(gpmc_t->oe_off); 60 + t.cs_rd_off = gpmc_round_ns_to_ticks(gpmc_t->cs_rd_off); 61 + t.rd_cycle = gpmc_round_ns_to_ticks(gpmc_t->rd_cycle); 67 62 68 63 /* Write */ 69 - t.adv_wr_off = gpmc_round_ns_to_ticks( 70 - gpmc_nand_data->gpmc_t->adv_wr_off); 64 + t.adv_wr_off = gpmc_round_ns_to_ticks(gpmc_t->adv_wr_off); 71 65 t.we_on = t.oe_on; 72 66 if (cpu_is_omap34xx()) { 73 - t.wr_data_mux_bus = gpmc_round_ns_to_ticks( 74 - gpmc_nand_data->gpmc_t->wr_data_mux_bus); 75 - t.wr_access = gpmc_round_ns_to_ticks( 76 - gpmc_nand_data->gpmc_t->wr_access); 67 + t.wr_data_mux_bus = gpmc_round_ns_to_ticks(gpmc_t->wr_data_mux_bus); 68 + t.wr_access = gpmc_round_ns_to_ticks(gpmc_t->wr_access); 77 69 } 78 - t.we_off = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->we_off); 79 - t.cs_wr_off = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->cs_wr_off); 80 - t.wr_cycle = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->wr_cycle); 70 + t.we_off = gpmc_round_ns_to_ticks(gpmc_t->we_off); 71 + t.cs_wr_off = gpmc_round_ns_to_ticks(gpmc_t->cs_wr_off); 72 + t.wr_cycle = gpmc_round_ns_to_ticks(gpmc_t->wr_cycle); 81 73 82 74 /* Configure GPMC */ 83 75 if (gpmc_nand_data->devsize == NAND_BUSWIDTH_16) ··· 89 91 return 0; 90 92 } 91 93 92 - int __init gpmc_nand_init(struct omap_nand_platform_data *gpmc_nand_data) 94 + static bool __init gpmc_hwecc_bch_capable(enum omap_ecc ecc_opt) 95 + { 96 + /* support only OMAP3 class */ 97 + if (!cpu_is_omap34xx()) { 98 + pr_err("BCH ecc is not supported on this CPU\n"); 99 + return 0; 100 + } 101 + 102 + /* 103 + * For now, assume 4-bit mode is only supported on OMAP3630 ES1.x, x>=1. 104 + * Other chips may be added if confirmed to work. 105 + */ 106 + if ((ecc_opt == OMAP_ECC_BCH4_CODE_HW) && 107 + (!cpu_is_omap3630() || (GET_OMAP_REVISION() == 0))) { 108 + pr_err("BCH 4-bit mode is not supported on this CPU\n"); 109 + return 0; 110 + } 111 + 112 + return 1; 113 + } 114 + 115 + int __init gpmc_nand_init(struct omap_nand_platform_data *gpmc_nand_data, 116 + struct gpmc_timings *gpmc_t) 93 117 { 94 118 int err = 0; 95 119 struct device *dev = &gpmc_nand_device.dev; ··· 132 112 gpmc_get_client_irq(GPMC_IRQ_FIFOEVENTENABLE); 133 113 gpmc_nand_resource[2].start = 134 114 gpmc_get_client_irq(GPMC_IRQ_COUNT_EVENT); 135 - /* Set timings in GPMC */ 136 - err = omap2_nand_gpmc_retime(gpmc_nand_data); 137 - if (err < 0) { 138 - dev_err(dev, "Unable to set gpmc timings: %d\n", err); 139 - return err; 115 + 116 + if (gpmc_t) { 117 + err = omap2_nand_gpmc_retime(gpmc_nand_data, gpmc_t); 118 + if (err < 0) { 119 + dev_err(dev, "Unable to set gpmc timings: %d\n", err); 120 + return err; 121 + } 140 122 } 141 123 142 124 /* Enable RD PIN Monitoring Reg */ ··· 147 125 } 148 126 149 127 gpmc_update_nand_reg(&gpmc_nand_data->reg, gpmc_nand_data->cs); 128 + 129 + if (!gpmc_hwecc_bch_capable(gpmc_nand_data->ecc_opt)) 130 + return -EINVAL; 150 131 151 132 err = platform_device_register(&gpmc_nand_device); 152 133 if (err < 0) {
+27
arch/arm/mach-omap2/gpmc-nand.h
··· 1 + /* 2 + * arch/arm/mach-omap2/gpmc-nand.h 3 + * 4 + * This program is free software; you can redistribute it and/or modify it 5 + * under the terms of the GNU General Public License as published by the 6 + * Free Software Foundation; either version 2 of the License, or (at your 7 + * option) any later version. 8 + */ 9 + 10 + #ifndef __OMAP2_GPMC_NAND_H 11 + #define __OMAP2_GPMC_NAND_H 12 + 13 + #include "gpmc.h" 14 + #include <linux/platform_data/mtd-nand-omap2.h> 15 + 16 + #if IS_ENABLED(CONFIG_MTD_NAND_OMAP2) 17 + extern int gpmc_nand_init(struct omap_nand_platform_data *d, 18 + struct gpmc_timings *gpmc_t); 19 + #else 20 + static inline int gpmc_nand_init(struct omap_nand_platform_data *d, 21 + struct gpmc_timings *gpmc_t) 22 + { 23 + return 0; 24 + } 25 + #endif 26 + 27 + #endif
+118 -96
arch/arm/mach-omap2/gpmc-onenand.c
··· 16 16 #include <linux/mtd/onenand_regs.h> 17 17 #include <linux/io.h> 18 18 #include <linux/platform_data/mtd-onenand-omap2.h> 19 + #include <linux/err.h> 19 20 20 21 #include <asm/mach/flash.h> 21 22 22 - #include <plat/gpmc.h> 23 - 23 + #include "gpmc.h" 24 24 #include "soc.h" 25 + #include "gpmc-onenand.h" 25 26 26 27 #define ONENAND_IO_SIZE SZ_128K 28 + 29 + #define ONENAND_FLAG_SYNCREAD (1 << 0) 30 + #define ONENAND_FLAG_SYNCWRITE (1 << 1) 31 + #define ONENAND_FLAG_HF (1 << 2) 32 + #define ONENAND_FLAG_VHF (1 << 3) 33 + 34 + static unsigned onenand_flags; 35 + static unsigned latency; 36 + static int fclk_offset; 27 37 28 38 static struct omap_onenand_platform_data *gpmc_onenand_data; 29 39 ··· 48 38 .resource = &gpmc_onenand_resource, 49 39 }; 50 40 51 - static int omap2_onenand_set_async_mode(int cs, void __iomem *onenand_base) 41 + static struct gpmc_timings omap2_onenand_calc_async_timings(void) 52 42 { 53 43 struct gpmc_timings t; 54 - u32 reg; 55 - int err; 56 44 57 45 const int t_cer = 15; 58 46 const int t_avdp = 12; ··· 62 54 const int t_ds = 30; 63 55 const int t_wpl = 40; 64 56 const int t_wph = 30; 65 - 66 - /* Ensure sync read and sync write are disabled */ 67 - reg = readw(onenand_base + ONENAND_REG_SYS_CFG1); 68 - reg &= ~ONENAND_SYS_CFG1_SYNC_READ & ~ONENAND_SYS_CFG1_SYNC_WRITE; 69 - writew(reg, onenand_base + ONENAND_REG_SYS_CFG1); 70 57 71 58 memset(&t, 0, sizeof(t)); 72 59 t.sync_clk = 0; ··· 89 86 t.cs_wr_off = t.we_off + gpmc_round_ns_to_ticks(t_wph); 90 87 t.wr_cycle = t.cs_wr_off + gpmc_round_ns_to_ticks(t_cez); 91 88 89 + return t; 90 + } 91 + 92 + static int gpmc_set_async_mode(int cs, struct gpmc_timings *t) 93 + { 92 94 /* Configure GPMC for asynchronous read */ 93 95 gpmc_cs_write_reg(cs, GPMC_CS_CONFIG1, 94 96 GPMC_CONFIG1_DEVICESIZE_16 | 95 97 GPMC_CONFIG1_MUXADDDATA); 96 98 97 - err = gpmc_cs_set_timings(cs, &t); 98 - if (err) 99 - return err; 99 + return gpmc_cs_set_timings(cs, t); 100 + } 101 + 102 + static void omap2_onenand_set_async_mode(void __iomem *onenand_base) 103 + { 104 + u32 reg; 100 105 101 106 /* Ensure sync read and sync write are disabled */ 102 107 reg = readw(onenand_base + ONENAND_REG_SYS_CFG1); 103 108 reg &= ~ONENAND_SYS_CFG1_SYNC_READ & ~ONENAND_SYS_CFG1_SYNC_WRITE; 104 109 writew(reg, onenand_base + ONENAND_REG_SYS_CFG1); 105 - 106 - return 0; 107 110 } 108 111 109 - static void set_onenand_cfg(void __iomem *onenand_base, int latency, 110 - int sync_read, int sync_write, int hf, int vhf) 112 + static void set_onenand_cfg(void __iomem *onenand_base) 111 113 { 112 114 u32 reg; 113 115 ··· 120 112 reg &= ~((0x7 << ONENAND_SYS_CFG1_BRL_SHIFT) | (0x7 << 9)); 121 113 reg |= (latency << ONENAND_SYS_CFG1_BRL_SHIFT) | 122 114 ONENAND_SYS_CFG1_BL_16; 123 - if (sync_read) 115 + if (onenand_flags & ONENAND_FLAG_SYNCREAD) 124 116 reg |= ONENAND_SYS_CFG1_SYNC_READ; 125 117 else 126 118 reg &= ~ONENAND_SYS_CFG1_SYNC_READ; 127 - if (sync_write) 119 + if (onenand_flags & ONENAND_FLAG_SYNCWRITE) 128 120 reg |= ONENAND_SYS_CFG1_SYNC_WRITE; 129 121 else 130 122 reg &= ~ONENAND_SYS_CFG1_SYNC_WRITE; 131 - if (hf) 123 + if (onenand_flags & ONENAND_FLAG_HF) 132 124 reg |= ONENAND_SYS_CFG1_HF; 133 125 else 134 126 reg &= ~ONENAND_SYS_CFG1_HF; 135 - if (vhf) 127 + if (onenand_flags & ONENAND_FLAG_VHF) 136 128 reg |= ONENAND_SYS_CFG1_VHF; 137 129 else 138 130 reg &= ~ONENAND_SYS_CFG1_VHF; ··· 140 132 } 141 133 142 134 static int omap2_onenand_get_freq(struct omap_onenand_platform_data *cfg, 143 - void __iomem *onenand_base, bool *clk_dep) 135 + void __iomem *onenand_base) 144 136 { 145 137 u16 ver = readw(onenand_base + ONENAND_REG_VERSION_ID); 146 - int freq = 0; 147 - 148 - if (cfg->get_freq) { 149 - struct onenand_freq_info fi; 150 - 151 - fi.maf_id = readw(onenand_base + ONENAND_REG_MANUFACTURER_ID); 152 - fi.dev_id = readw(onenand_base + ONENAND_REG_DEVICE_ID); 153 - fi.ver_id = ver; 154 - freq = cfg->get_freq(&fi, clk_dep); 155 - if (freq) 156 - return freq; 157 - } 138 + int freq; 158 139 159 140 switch ((ver >> 4) & 0xf) { 160 141 case 0: ··· 169 172 return freq; 170 173 } 171 174 172 - static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg, 173 - void __iomem *onenand_base, 174 - int *freq_ptr) 175 + static struct gpmc_timings 176 + omap2_onenand_calc_sync_timings(struct omap_onenand_platform_data *cfg, 177 + int freq) 175 178 { 176 179 struct gpmc_timings t; 177 180 const int t_cer = 15; ··· 181 184 const int t_wpl = 40; 182 185 const int t_wph = 30; 183 186 int min_gpmc_clk_period, t_ces, t_avds, t_avdh, t_ach, t_aavdh, t_rdyo; 184 - int div, fclk_offset_ns, fclk_offset, gpmc_clk_ns, latency; 185 - int first_time = 0, hf = 0, vhf = 0, sync_read = 0, sync_write = 0; 186 - int err, ticks_cez; 187 - int cs = cfg->cs, freq = *freq_ptr; 188 187 u32 reg; 189 - bool clk_dep = false; 188 + int div, fclk_offset_ns, gpmc_clk_ns; 189 + int ticks_cez; 190 + int cs = cfg->cs; 190 191 191 - if (cfg->flags & ONENAND_SYNC_READ) { 192 - sync_read = 1; 193 - } else if (cfg->flags & ONENAND_SYNC_READWRITE) { 194 - sync_read = 1; 195 - sync_write = 1; 196 - } else 197 - return omap2_onenand_set_async_mode(cs, onenand_base); 198 - 199 - if (!freq) { 200 - /* Very first call freq is not known */ 201 - err = omap2_onenand_set_async_mode(cs, onenand_base); 202 - if (err) 203 - return err; 204 - freq = omap2_onenand_get_freq(cfg, onenand_base, &clk_dep); 205 - first_time = 1; 206 - } 192 + if (cfg->flags & ONENAND_SYNC_READ) 193 + onenand_flags = ONENAND_FLAG_SYNCREAD; 194 + else if (cfg->flags & ONENAND_SYNC_READWRITE) 195 + onenand_flags = ONENAND_FLAG_SYNCREAD | ONENAND_FLAG_SYNCWRITE; 207 196 208 197 switch (freq) { 209 198 case 104: ··· 227 244 t_ach = 9; 228 245 t_aavdh = 7; 229 246 t_rdyo = 15; 230 - sync_write = 0; 247 + onenand_flags &= ~ONENAND_FLAG_SYNCWRITE; 231 248 break; 232 249 } 233 250 234 - div = gpmc_cs_calc_divider(cs, min_gpmc_clk_period); 251 + div = gpmc_calc_divider(min_gpmc_clk_period); 235 252 gpmc_clk_ns = gpmc_ticks_to_ns(div); 236 253 if (gpmc_clk_ns < 15) /* >66Mhz */ 237 - hf = 1; 254 + onenand_flags |= ONENAND_FLAG_HF; 255 + else 256 + onenand_flags &= ~ONENAND_FLAG_HF; 238 257 if (gpmc_clk_ns < 12) /* >83Mhz */ 239 - vhf = 1; 240 - if (vhf) 258 + onenand_flags |= ONENAND_FLAG_VHF; 259 + else 260 + onenand_flags &= ~ONENAND_FLAG_VHF; 261 + if (onenand_flags & ONENAND_FLAG_VHF) 241 262 latency = 8; 242 - else if (hf) 263 + else if (onenand_flags & ONENAND_FLAG_HF) 243 264 latency = 6; 244 265 else if (gpmc_clk_ns >= 25) /* 40 MHz*/ 245 266 latency = 3; 246 267 else 247 268 latency = 4; 248 269 249 - if (clk_dep) { 250 - if (gpmc_clk_ns < 12) { /* >83Mhz */ 251 - t_ces = 3; 252 - t_avds = 4; 253 - } else if (gpmc_clk_ns < 15) { /* >66Mhz */ 254 - t_ces = 5; 255 - t_avds = 4; 256 - } else if (gpmc_clk_ns < 25) { /* >40Mhz */ 257 - t_ces = 6; 258 - t_avds = 5; 259 - } else { 260 - t_ces = 7; 261 - t_avds = 7; 262 - } 263 - } 264 - 265 - if (first_time) 266 - set_onenand_cfg(onenand_base, latency, 267 - sync_read, sync_write, hf, vhf); 270 + /* Set synchronous read timings */ 271 + memset(&t, 0, sizeof(t)); 268 272 269 273 if (div == 1) { 270 274 reg = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG2); ··· 277 307 gpmc_cs_write_reg(cs, GPMC_CS_CONFIG4, reg); 278 308 } 279 309 280 - /* Set synchronous read timings */ 281 - memset(&t, 0, sizeof(t)); 282 310 t.sync_clk = min_gpmc_clk_period; 283 311 t.cs_on = 0; 284 312 t.adv_on = 0; ··· 298 330 ticks_cez); 299 331 300 332 /* Write */ 301 - if (sync_write) { 333 + if (onenand_flags & ONENAND_FLAG_SYNCWRITE) { 302 334 t.adv_wr_off = t.adv_rd_off; 303 335 t.we_on = 0; 304 336 t.we_off = t.cs_rd_off; ··· 323 355 } 324 356 } 325 357 358 + return t; 359 + } 360 + 361 + static int gpmc_set_sync_mode(int cs, struct gpmc_timings *t) 362 + { 363 + unsigned sync_read = onenand_flags & ONENAND_FLAG_SYNCREAD; 364 + unsigned sync_write = onenand_flags & ONENAND_FLAG_SYNCWRITE; 365 + 326 366 /* Configure GPMC for synchronous read */ 327 367 gpmc_cs_write_reg(cs, GPMC_CS_CONFIG1, 328 368 GPMC_CONFIG1_WRAPBURST_SUPP | ··· 347 371 GPMC_CONFIG1_DEVICETYPE_NOR | 348 372 GPMC_CONFIG1_MUXADDDATA); 349 373 350 - err = gpmc_cs_set_timings(cs, &t); 351 - if (err) 352 - return err; 374 + return gpmc_cs_set_timings(cs, t); 375 + } 353 376 354 - set_onenand_cfg(onenand_base, latency, sync_read, sync_write, hf, vhf); 377 + static int omap2_onenand_setup_async(void __iomem *onenand_base) 378 + { 379 + struct gpmc_timings t; 380 + int ret; 381 + 382 + omap2_onenand_set_async_mode(onenand_base); 383 + 384 + t = omap2_onenand_calc_async_timings(); 385 + 386 + ret = gpmc_set_async_mode(gpmc_onenand_data->cs, &t); 387 + if (IS_ERR_VALUE(ret)) 388 + return ret; 389 + 390 + omap2_onenand_set_async_mode(onenand_base); 391 + 392 + return 0; 393 + } 394 + 395 + static int omap2_onenand_setup_sync(void __iomem *onenand_base, int *freq_ptr) 396 + { 397 + int ret, freq = *freq_ptr; 398 + struct gpmc_timings t; 399 + 400 + if (!freq) { 401 + /* Very first call freq is not known */ 402 + freq = omap2_onenand_get_freq(gpmc_onenand_data, onenand_base); 403 + set_onenand_cfg(onenand_base); 404 + } 405 + 406 + t = omap2_onenand_calc_sync_timings(gpmc_onenand_data, freq); 407 + 408 + ret = gpmc_set_sync_mode(gpmc_onenand_data->cs, &t); 409 + if (IS_ERR_VALUE(ret)) 410 + return ret; 411 + 412 + set_onenand_cfg(onenand_base); 355 413 356 414 *freq_ptr = freq; 357 415 ··· 395 385 static int gpmc_onenand_setup(void __iomem *onenand_base, int *freq_ptr) 396 386 { 397 387 struct device *dev = &gpmc_onenand_device.dev; 388 + unsigned l = ONENAND_SYNC_READ | ONENAND_SYNC_READWRITE; 389 + int ret; 398 390 399 - /* Set sync timings in GPMC */ 400 - if (omap2_onenand_set_sync_mode(gpmc_onenand_data, onenand_base, 401 - freq_ptr) < 0) { 402 - dev_err(dev, "Unable to set synchronous mode\n"); 403 - return -EINVAL; 391 + ret = omap2_onenand_setup_async(onenand_base); 392 + if (ret) { 393 + dev_err(dev, "unable to set to async mode\n"); 394 + return ret; 404 395 } 405 396 406 - return 0; 397 + if (!(gpmc_onenand_data->flags & l)) 398 + return 0; 399 + 400 + ret = omap2_onenand_setup_sync(onenand_base, freq_ptr); 401 + if (ret) 402 + dev_err(dev, "unable to set to sync mode\n"); 403 + return ret; 407 404 } 408 405 409 406 void __init gpmc_onenand_init(struct omap_onenand_platform_data *_onenand_data) ··· 427 410 gpmc_onenand_data->flags &= ~ONENAND_SYNC_READWRITE; 428 411 gpmc_onenand_data->flags |= ONENAND_SYNC_READ; 429 412 } 413 + 414 + if (cpu_is_omap34xx()) 415 + gpmc_onenand_data->flags |= ONENAND_IN_OMAP34XX; 416 + else 417 + gpmc_onenand_data->flags &= ~ONENAND_IN_OMAP34XX; 430 418 431 419 err = gpmc_cs_request(gpmc_onenand_data->cs, ONENAND_IO_SIZE, 432 420 (unsigned long *)&gpmc_onenand_resource.start);
+24
arch/arm/mach-omap2/gpmc-onenand.h
··· 1 + /* 2 + * arch/arm/mach-omap2/gpmc-onenand.h 3 + * 4 + * This program is free software; you can redistribute it and/or modify it 5 + * under the terms of the GNU General Public License as published by the 6 + * Free Software Foundation; either version 2 of the License, or (at your 7 + * option) any later version. 8 + */ 9 + 10 + #ifndef __OMAP2_GPMC_ONENAND_H 11 + #define __OMAP2_GPMC_ONENAND_H 12 + 13 + #include <linux/platform_data/mtd-onenand-omap2.h> 14 + 15 + #if IS_ENABLED(CONFIG_MTD_ONENAND_OMAP2) 16 + extern void gpmc_onenand_init(struct omap_onenand_platform_data *d); 17 + #else 18 + #define board_onenand_data NULL 19 + static inline void gpmc_onenand_init(struct omap_onenand_platform_data *d) 20 + { 21 + } 22 + #endif 23 + 24 + #endif
+1 -1
arch/arm/mach-omap2/gpmc-smc91x.c
··· 17 17 #include <linux/io.h> 18 18 #include <linux/smc91x.h> 19 19 20 - #include <plat/gpmc.h> 20 + #include "gpmc.h" 21 21 #include "gpmc-smc91x.h" 22 22 23 23 #include "soc.h"
+1 -1
arch/arm/mach-omap2/gpmc-smsc911x.c
··· 20 20 #include <linux/io.h> 21 21 #include <linux/smsc911x.h> 22 22 23 - #include <plat/gpmc.h> 23 + #include "gpmc.h" 24 24 #include "gpmc-smsc911x.h" 25 25 26 26 static struct resource gpmc_smsc911x_resources[] = {
+23 -441
arch/arm/mach-omap2/gpmc.c
··· 26 26 #include <linux/interrupt.h> 27 27 #include <linux/platform_device.h> 28 28 29 - #include <asm/mach-types.h> 30 - #include <plat/gpmc.h> 29 + #include <linux/platform_data/mtd-nand-omap2.h> 31 30 32 - #include <plat/cpu.h> 33 - #include <plat/gpmc.h> 34 - #include <plat/sdrc.h> 35 - #include <plat/omap_device.h> 31 + #include <asm/mach-types.h> 36 32 37 33 #include "soc.h" 38 34 #include "common.h" 35 + #include "omap_device.h" 36 + #include "gpmc.h" 39 37 40 38 #define DEVICE_NAME "omap-gpmc" 41 39 ··· 57 59 #define GPMC_ECC_SIZE_CONFIG 0x1fc 58 60 #define GPMC_ECC1_RESULT 0x200 59 61 #define GPMC_ECC_BCH_RESULT_0 0x240 /* not available on OMAP2 */ 62 + #define GPMC_ECC_BCH_RESULT_1 0x244 /* not available on OMAP2 */ 63 + #define GPMC_ECC_BCH_RESULT_2 0x248 /* not available on OMAP2 */ 64 + #define GPMC_ECC_BCH_RESULT_3 0x24c /* not available on OMAP2 */ 60 65 61 66 /* GPMC ECC control settings */ 62 67 #define GPMC_ECC_CTRL_ECCCLEAR 0x100 ··· 76 75 77 76 #define GPMC_CS0_OFFSET 0x60 78 77 #define GPMC_CS_SIZE 0x30 78 + #define GPMC_BCH_SIZE 0x10 79 79 80 80 #define GPMC_MEM_START 0x00000000 81 81 #define GPMC_MEM_END 0x3FFFFFFF ··· 139 137 static struct resource gpmc_cs_mem[GPMC_CS_NUM]; 140 138 static DEFINE_SPINLOCK(gpmc_mem_lock); 141 139 static unsigned int gpmc_cs_map; /* flag for cs which are initialized */ 142 - static int gpmc_ecc_used = -EINVAL; /* cs using ecc engine */ 143 140 static struct device *gpmc_dev; 144 141 static int gpmc_irq; 145 142 static resource_size_t phys_base, mem_size; ··· 157 156 static u32 gpmc_read_reg(int idx) 158 157 { 159 158 return __raw_readl(gpmc_base + idx); 160 - } 161 - 162 - static void gpmc_cs_write_byte(int cs, int idx, u8 val) 163 - { 164 - void __iomem *reg_addr; 165 - 166 - reg_addr = gpmc_base + GPMC_CS0_OFFSET + (cs * GPMC_CS_SIZE) + idx; 167 - __raw_writeb(val, reg_addr); 168 - } 169 - 170 - static u8 gpmc_cs_read_byte(int cs, int idx) 171 - { 172 - void __iomem *reg_addr; 173 - 174 - reg_addr = gpmc_base + GPMC_CS0_OFFSET + (cs * GPMC_CS_SIZE) + idx; 175 - return __raw_readb(reg_addr); 176 159 } 177 160 178 161 void gpmc_cs_write_reg(int cs, int idx, u32 val) ··· 273 288 return -1 274 289 #endif 275 290 276 - int gpmc_cs_calc_divider(int cs, unsigned int sync_clk) 291 + int gpmc_calc_divider(unsigned int sync_clk) 277 292 { 278 293 int div; 279 294 u32 l; ··· 293 308 int div; 294 309 u32 l; 295 310 296 - div = gpmc_cs_calc_divider(cs, t->sync_clk); 311 + div = gpmc_calc_divider(t->sync_clk); 297 312 if (div < 0) 298 313 return div; 299 314 ··· 494 509 EXPORT_SYMBOL(gpmc_cs_free); 495 510 496 511 /** 497 - * gpmc_read_status - read access request to get the different gpmc status 498 - * @cmd: command type 499 - * @return status 500 - */ 501 - int gpmc_read_status(int cmd) 502 - { 503 - int status = -EINVAL; 504 - u32 regval = 0; 505 - 506 - switch (cmd) { 507 - case GPMC_GET_IRQ_STATUS: 508 - status = gpmc_read_reg(GPMC_IRQSTATUS); 509 - break; 510 - 511 - case GPMC_PREFETCH_FIFO_CNT: 512 - regval = gpmc_read_reg(GPMC_PREFETCH_STATUS); 513 - status = GPMC_PREFETCH_STATUS_FIFO_CNT(regval); 514 - break; 515 - 516 - case GPMC_PREFETCH_COUNT: 517 - regval = gpmc_read_reg(GPMC_PREFETCH_STATUS); 518 - status = GPMC_PREFETCH_STATUS_COUNT(regval); 519 - break; 520 - 521 - case GPMC_STATUS_BUFFER: 522 - regval = gpmc_read_reg(GPMC_STATUS); 523 - /* 1 : buffer is available to write */ 524 - status = regval & GPMC_STATUS_BUFF_EMPTY; 525 - break; 526 - 527 - default: 528 - printk(KERN_ERR "gpmc_read_status: Not supported\n"); 529 - } 530 - return status; 531 - } 532 - EXPORT_SYMBOL(gpmc_read_status); 533 - 534 - /** 535 512 * gpmc_cs_configure - write request to configure gpmc 536 513 * @cs: chip select number 537 514 * @cmd: command type ··· 561 614 } 562 615 EXPORT_SYMBOL(gpmc_cs_configure); 563 616 564 - /** 565 - * gpmc_nand_read - nand specific read access request 566 - * @cs: chip select number 567 - * @cmd: command type 568 - */ 569 - int gpmc_nand_read(int cs, int cmd) 570 - { 571 - int rval = -EINVAL; 572 - 573 - switch (cmd) { 574 - case GPMC_NAND_DATA: 575 - rval = gpmc_cs_read_byte(cs, GPMC_CS_NAND_DATA); 576 - break; 577 - 578 - default: 579 - printk(KERN_ERR "gpmc_read_nand_ctrl: Not supported\n"); 580 - } 581 - return rval; 582 - } 583 - EXPORT_SYMBOL(gpmc_nand_read); 584 - 585 - /** 586 - * gpmc_nand_write - nand specific write request 587 - * @cs: chip select number 588 - * @cmd: command type 589 - * @wval: value to write 590 - */ 591 - int gpmc_nand_write(int cs, int cmd, int wval) 592 - { 593 - int err = 0; 594 - 595 - switch (cmd) { 596 - case GPMC_NAND_COMMAND: 597 - gpmc_cs_write_byte(cs, GPMC_CS_NAND_COMMAND, wval); 598 - break; 599 - 600 - case GPMC_NAND_ADDRESS: 601 - gpmc_cs_write_byte(cs, GPMC_CS_NAND_ADDRESS, wval); 602 - break; 603 - 604 - case GPMC_NAND_DATA: 605 - gpmc_cs_write_byte(cs, GPMC_CS_NAND_DATA, wval); 606 - 607 - default: 608 - printk(KERN_ERR "gpmc_write_nand_ctrl: Not supported\n"); 609 - err = -EINVAL; 610 - } 611 - return err; 612 - } 613 - EXPORT_SYMBOL(gpmc_nand_write); 614 - 615 - 616 - 617 - /** 618 - * gpmc_prefetch_enable - configures and starts prefetch transfer 619 - * @cs: cs (chip select) number 620 - * @fifo_th: fifo threshold to be used for read/ write 621 - * @dma_mode: dma mode enable (1) or disable (0) 622 - * @u32_count: number of bytes to be transferred 623 - * @is_write: prefetch read(0) or write post(1) mode 624 - */ 625 - int gpmc_prefetch_enable(int cs, int fifo_th, int dma_mode, 626 - unsigned int u32_count, int is_write) 627 - { 628 - 629 - if (fifo_th > PREFETCH_FIFOTHRESHOLD_MAX) { 630 - pr_err("gpmc: fifo threshold is not supported\n"); 631 - return -1; 632 - } else if (!(gpmc_read_reg(GPMC_PREFETCH_CONTROL))) { 633 - /* Set the amount of bytes to be prefetched */ 634 - gpmc_write_reg(GPMC_PREFETCH_CONFIG2, u32_count); 635 - 636 - /* Set dma/mpu mode, the prefetch read / post write and 637 - * enable the engine. Set which cs is has requested for. 638 - */ 639 - gpmc_write_reg(GPMC_PREFETCH_CONFIG1, ((cs << CS_NUM_SHIFT) | 640 - PREFETCH_FIFOTHRESHOLD(fifo_th) | 641 - ENABLE_PREFETCH | 642 - (dma_mode << DMA_MPU_MODE) | 643 - (0x1 & is_write))); 644 - 645 - /* Start the prefetch engine */ 646 - gpmc_write_reg(GPMC_PREFETCH_CONTROL, 0x1); 647 - } else { 648 - return -EBUSY; 649 - } 650 - 651 - return 0; 652 - } 653 - EXPORT_SYMBOL(gpmc_prefetch_enable); 654 - 655 - /** 656 - * gpmc_prefetch_reset - disables and stops the prefetch engine 657 - */ 658 - int gpmc_prefetch_reset(int cs) 659 - { 660 - u32 config1; 661 - 662 - /* check if the same module/cs is trying to reset */ 663 - config1 = gpmc_read_reg(GPMC_PREFETCH_CONFIG1); 664 - if (((config1 >> CS_NUM_SHIFT) & 0x7) != cs) 665 - return -EINVAL; 666 - 667 - /* Stop the PFPW engine */ 668 - gpmc_write_reg(GPMC_PREFETCH_CONTROL, 0x0); 669 - 670 - /* Reset/disable the PFPW engine */ 671 - gpmc_write_reg(GPMC_PREFETCH_CONFIG1, 0x0); 672 - 673 - return 0; 674 - } 675 - EXPORT_SYMBOL(gpmc_prefetch_reset); 676 - 677 617 void gpmc_update_nand_reg(struct gpmc_nand_regs *reg, int cs) 678 618 { 619 + int i; 620 + 679 621 reg->gpmc_status = gpmc_base + GPMC_STATUS; 680 622 reg->gpmc_nand_command = gpmc_base + GPMC_CS0_OFFSET + 681 623 GPMC_CS_NAND_COMMAND + GPMC_CS_SIZE * cs; ··· 580 744 reg->gpmc_ecc_control = gpmc_base + GPMC_ECC_CONTROL; 581 745 reg->gpmc_ecc_size_config = gpmc_base + GPMC_ECC_SIZE_CONFIG; 582 746 reg->gpmc_ecc1_result = gpmc_base + GPMC_ECC1_RESULT; 583 - reg->gpmc_bch_result0 = gpmc_base + GPMC_ECC_BCH_RESULT_0; 747 + 748 + for (i = 0; i < GPMC_BCH_NUM_REMAINDER; i++) { 749 + reg->gpmc_bch_result0[i] = gpmc_base + GPMC_ECC_BCH_RESULT_0 + 750 + GPMC_BCH_SIZE * i; 751 + reg->gpmc_bch_result1[i] = gpmc_base + GPMC_ECC_BCH_RESULT_1 + 752 + GPMC_BCH_SIZE * i; 753 + reg->gpmc_bch_result2[i] = gpmc_base + GPMC_ECC_BCH_RESULT_2 + 754 + GPMC_BCH_SIZE * i; 755 + reg->gpmc_bch_result3[i] = gpmc_base + GPMC_ECC_BCH_RESULT_3 + 756 + GPMC_BCH_SIZE * i; 757 + } 584 758 } 585 759 586 760 int gpmc_get_client_irq(unsigned irq_config) ··· 938 1092 } 939 1093 } 940 1094 } 941 - #endif /* CONFIG_ARCH_OMAP3 */ 942 - 943 - /** 944 - * gpmc_enable_hwecc - enable hardware ecc functionality 945 - * @cs: chip select number 946 - * @mode: read/write mode 947 - * @dev_width: device bus width(1 for x16, 0 for x8) 948 - * @ecc_size: bytes for which ECC will be generated 949 - */ 950 - int gpmc_enable_hwecc(int cs, int mode, int dev_width, int ecc_size) 951 - { 952 - unsigned int val; 953 - 954 - /* check if ecc module is in used */ 955 - if (gpmc_ecc_used != -EINVAL) 956 - return -EINVAL; 957 - 958 - gpmc_ecc_used = cs; 959 - 960 - /* clear ecc and enable bits */ 961 - gpmc_write_reg(GPMC_ECC_CONTROL, 962 - GPMC_ECC_CTRL_ECCCLEAR | 963 - GPMC_ECC_CTRL_ECCREG1); 964 - 965 - /* program ecc and result sizes */ 966 - val = ((((ecc_size >> 1) - 1) << 22) | (0x0000000F)); 967 - gpmc_write_reg(GPMC_ECC_SIZE_CONFIG, val); 968 - 969 - switch (mode) { 970 - case GPMC_ECC_READ: 971 - case GPMC_ECC_WRITE: 972 - gpmc_write_reg(GPMC_ECC_CONTROL, 973 - GPMC_ECC_CTRL_ECCCLEAR | 974 - GPMC_ECC_CTRL_ECCREG1); 975 - break; 976 - case GPMC_ECC_READSYN: 977 - gpmc_write_reg(GPMC_ECC_CONTROL, 978 - GPMC_ECC_CTRL_ECCCLEAR | 979 - GPMC_ECC_CTRL_ECCDISABLE); 980 - break; 981 - default: 982 - printk(KERN_INFO "Error: Unrecognized Mode[%d]!\n", mode); 983 - break; 984 - } 985 - 986 - /* (ECC 16 or 8 bit col) | ( CS ) | ECC Enable */ 987 - val = (dev_width << 7) | (cs << 1) | (0x1); 988 - gpmc_write_reg(GPMC_ECC_CONFIG, val); 989 - return 0; 990 - } 991 - EXPORT_SYMBOL_GPL(gpmc_enable_hwecc); 992 - 993 - /** 994 - * gpmc_calculate_ecc - generate non-inverted ecc bytes 995 - * @cs: chip select number 996 - * @dat: data pointer over which ecc is computed 997 - * @ecc_code: ecc code buffer 998 - * 999 - * Using non-inverted ECC is considered ugly since writing a blank 1000 - * page (padding) will clear the ECC bytes. This is not a problem as long 1001 - * no one is trying to write data on the seemingly unused page. Reading 1002 - * an erased page will produce an ECC mismatch between generated and read 1003 - * ECC bytes that has to be dealt with separately. 1004 - */ 1005 - int gpmc_calculate_ecc(int cs, const u_char *dat, u_char *ecc_code) 1006 - { 1007 - unsigned int val = 0x0; 1008 - 1009 - if (gpmc_ecc_used != cs) 1010 - return -EINVAL; 1011 - 1012 - /* read ecc result */ 1013 - val = gpmc_read_reg(GPMC_ECC1_RESULT); 1014 - *ecc_code++ = val; /* P128e, ..., P1e */ 1015 - *ecc_code++ = val >> 16; /* P128o, ..., P1o */ 1016 - /* P2048o, P1024o, P512o, P256o, P2048e, P1024e, P512e, P256e */ 1017 - *ecc_code++ = ((val >> 8) & 0x0f) | ((val >> 20) & 0xf0); 1018 - 1019 - gpmc_ecc_used = -EINVAL; 1020 - return 0; 1021 - } 1022 - EXPORT_SYMBOL_GPL(gpmc_calculate_ecc); 1023 - 1024 - #ifdef CONFIG_ARCH_OMAP3 1025 - 1026 - /** 1027 - * gpmc_init_hwecc_bch - initialize hardware BCH ecc functionality 1028 - * @cs: chip select number 1029 - * @nsectors: how many 512-byte sectors to process 1030 - * @nerrors: how many errors to correct per sector (4 or 8) 1031 - * 1032 - * This function must be executed before any call to gpmc_enable_hwecc_bch. 1033 - */ 1034 - int gpmc_init_hwecc_bch(int cs, int nsectors, int nerrors) 1035 - { 1036 - /* check if ecc module is in use */ 1037 - if (gpmc_ecc_used != -EINVAL) 1038 - return -EINVAL; 1039 - 1040 - /* support only OMAP3 class */ 1041 - if (!cpu_is_omap34xx()) { 1042 - printk(KERN_ERR "BCH ecc is not supported on this CPU\n"); 1043 - return -EINVAL; 1044 - } 1045 - 1046 - /* 1047 - * For now, assume 4-bit mode is only supported on OMAP3630 ES1.x, x>=1. 1048 - * Other chips may be added if confirmed to work. 1049 - */ 1050 - if ((nerrors == 4) && 1051 - (!cpu_is_omap3630() || (GET_OMAP_REVISION() == 0))) { 1052 - printk(KERN_ERR "BCH 4-bit mode is not supported on this CPU\n"); 1053 - return -EINVAL; 1054 - } 1055 - 1056 - /* sanity check */ 1057 - if (nsectors > 8) { 1058 - printk(KERN_ERR "BCH cannot process %d sectors (max is 8)\n", 1059 - nsectors); 1060 - return -EINVAL; 1061 - } 1062 - 1063 - return 0; 1064 - } 1065 - EXPORT_SYMBOL_GPL(gpmc_init_hwecc_bch); 1066 - 1067 - /** 1068 - * gpmc_enable_hwecc_bch - enable hardware BCH ecc functionality 1069 - * @cs: chip select number 1070 - * @mode: read/write mode 1071 - * @dev_width: device bus width(1 for x16, 0 for x8) 1072 - * @nsectors: how many 512-byte sectors to process 1073 - * @nerrors: how many errors to correct per sector (4 or 8) 1074 - */ 1075 - int gpmc_enable_hwecc_bch(int cs, int mode, int dev_width, int nsectors, 1076 - int nerrors) 1077 - { 1078 - unsigned int val; 1079 - 1080 - /* check if ecc module is in use */ 1081 - if (gpmc_ecc_used != -EINVAL) 1082 - return -EINVAL; 1083 - 1084 - gpmc_ecc_used = cs; 1085 - 1086 - /* clear ecc and enable bits */ 1087 - gpmc_write_reg(GPMC_ECC_CONTROL, 0x1); 1088 - 1089 - /* 1090 - * When using BCH, sector size is hardcoded to 512 bytes. 1091 - * Here we are using wrapping mode 6 both for reading and writing, with: 1092 - * size0 = 0 (no additional protected byte in spare area) 1093 - * size1 = 32 (skip 32 nibbles = 16 bytes per sector in spare area) 1094 - */ 1095 - gpmc_write_reg(GPMC_ECC_SIZE_CONFIG, (32 << 22) | (0 << 12)); 1096 - 1097 - /* BCH configuration */ 1098 - val = ((1 << 16) | /* enable BCH */ 1099 - (((nerrors == 8) ? 1 : 0) << 12) | /* 8 or 4 bits */ 1100 - (0x06 << 8) | /* wrap mode = 6 */ 1101 - (dev_width << 7) | /* bus width */ 1102 - (((nsectors-1) & 0x7) << 4) | /* number of sectors */ 1103 - (cs << 1) | /* ECC CS */ 1104 - (0x1)); /* enable ECC */ 1105 - 1106 - gpmc_write_reg(GPMC_ECC_CONFIG, val); 1107 - gpmc_write_reg(GPMC_ECC_CONTROL, 0x101); 1108 - return 0; 1109 - } 1110 - EXPORT_SYMBOL_GPL(gpmc_enable_hwecc_bch); 1111 - 1112 - /** 1113 - * gpmc_calculate_ecc_bch4 - Generate 7 ecc bytes per sector of 512 data bytes 1114 - * @cs: chip select number 1115 - * @dat: The pointer to data on which ecc is computed 1116 - * @ecc: The ecc output buffer 1117 - */ 1118 - int gpmc_calculate_ecc_bch4(int cs, const u_char *dat, u_char *ecc) 1119 - { 1120 - int i; 1121 - unsigned long nsectors, reg, val1, val2; 1122 - 1123 - if (gpmc_ecc_used != cs) 1124 - return -EINVAL; 1125 - 1126 - nsectors = ((gpmc_read_reg(GPMC_ECC_CONFIG) >> 4) & 0x7) + 1; 1127 - 1128 - for (i = 0; i < nsectors; i++) { 1129 - 1130 - reg = GPMC_ECC_BCH_RESULT_0 + 16*i; 1131 - 1132 - /* Read hw-computed remainder */ 1133 - val1 = gpmc_read_reg(reg + 0); 1134 - val2 = gpmc_read_reg(reg + 4); 1135 - 1136 - /* 1137 - * Add constant polynomial to remainder, in order to get an ecc 1138 - * sequence of 0xFFs for a buffer filled with 0xFFs; and 1139 - * left-justify the resulting polynomial. 1140 - */ 1141 - *ecc++ = 0x28 ^ ((val2 >> 12) & 0xFF); 1142 - *ecc++ = 0x13 ^ ((val2 >> 4) & 0xFF); 1143 - *ecc++ = 0xcc ^ (((val2 & 0xF) << 4)|((val1 >> 28) & 0xF)); 1144 - *ecc++ = 0x39 ^ ((val1 >> 20) & 0xFF); 1145 - *ecc++ = 0x96 ^ ((val1 >> 12) & 0xFF); 1146 - *ecc++ = 0xac ^ ((val1 >> 4) & 0xFF); 1147 - *ecc++ = 0x7f ^ ((val1 & 0xF) << 4); 1148 - } 1149 - 1150 - gpmc_ecc_used = -EINVAL; 1151 - return 0; 1152 - } 1153 - EXPORT_SYMBOL_GPL(gpmc_calculate_ecc_bch4); 1154 - 1155 - /** 1156 - * gpmc_calculate_ecc_bch8 - Generate 13 ecc bytes per block of 512 data bytes 1157 - * @cs: chip select number 1158 - * @dat: The pointer to data on which ecc is computed 1159 - * @ecc: The ecc output buffer 1160 - */ 1161 - int gpmc_calculate_ecc_bch8(int cs, const u_char *dat, u_char *ecc) 1162 - { 1163 - int i; 1164 - unsigned long nsectors, reg, val1, val2, val3, val4; 1165 - 1166 - if (gpmc_ecc_used != cs) 1167 - return -EINVAL; 1168 - 1169 - nsectors = ((gpmc_read_reg(GPMC_ECC_CONFIG) >> 4) & 0x7) + 1; 1170 - 1171 - for (i = 0; i < nsectors; i++) { 1172 - 1173 - reg = GPMC_ECC_BCH_RESULT_0 + 16*i; 1174 - 1175 - /* Read hw-computed remainder */ 1176 - val1 = gpmc_read_reg(reg + 0); 1177 - val2 = gpmc_read_reg(reg + 4); 1178 - val3 = gpmc_read_reg(reg + 8); 1179 - val4 = gpmc_read_reg(reg + 12); 1180 - 1181 - /* 1182 - * Add constant polynomial to remainder, in order to get an ecc 1183 - * sequence of 0xFFs for a buffer filled with 0xFFs. 1184 - */ 1185 - *ecc++ = 0xef ^ (val4 & 0xFF); 1186 - *ecc++ = 0x51 ^ ((val3 >> 24) & 0xFF); 1187 - *ecc++ = 0x2e ^ ((val3 >> 16) & 0xFF); 1188 - *ecc++ = 0x09 ^ ((val3 >> 8) & 0xFF); 1189 - *ecc++ = 0xed ^ (val3 & 0xFF); 1190 - *ecc++ = 0x93 ^ ((val2 >> 24) & 0xFF); 1191 - *ecc++ = 0x9a ^ ((val2 >> 16) & 0xFF); 1192 - *ecc++ = 0xc2 ^ ((val2 >> 8) & 0xFF); 1193 - *ecc++ = 0x97 ^ (val2 & 0xFF); 1194 - *ecc++ = 0x79 ^ ((val1 >> 24) & 0xFF); 1195 - *ecc++ = 0xe5 ^ ((val1 >> 16) & 0xFF); 1196 - *ecc++ = 0x24 ^ ((val1 >> 8) & 0xFF); 1197 - *ecc++ = 0xb5 ^ (val1 & 0xFF); 1198 - } 1199 - 1200 - gpmc_ecc_used = -EINVAL; 1201 - return 0; 1202 - } 1203 - EXPORT_SYMBOL_GPL(gpmc_calculate_ecc_bch8); 1204 - 1205 1095 #endif /* CONFIG_ARCH_OMAP3 */
+2 -2
arch/arm/mach-omap2/hdq1w.c
··· 27 27 #include <linux/err.h> 28 28 #include <linux/platform_device.h> 29 29 30 - #include <plat/omap_hwmod.h> 31 - #include <plat/omap_device.h> 30 + #include "omap_hwmod.h" 31 + #include "omap_device.h" 32 32 #include "hdq1w.h" 33 33 34 34 #include "common.h"
+1 -1
arch/arm/mach-omap2/hdq1w.h
··· 21 21 #ifndef ARCH_ARM_MACH_OMAP2_HDQ1W_H 22 22 #define ARCH_ARM_MACH_OMAP2_HDQ1W_H 23 23 24 - #include <plat/omap_hwmod.h> 24 + #include "omap_hwmod.h" 25 25 26 26 /* 27 27 * XXX A future cleanup patch should modify
+4 -4
arch/arm/mach-omap2/hsmmc.c
··· 14 14 #include <linux/string.h> 15 15 #include <linux/delay.h> 16 16 #include <linux/gpio.h> 17 - #include <mach/hardware.h> 18 17 #include <linux/platform_data/gpio-omap.h> 19 18 20 - #include <plat/mmc.h> 21 - #include <plat/omap-pm.h> 22 - #include <plat/omap_device.h> 19 + #include "soc.h" 20 + #include "omap_device.h" 21 + #include "omap-pm.h" 23 22 24 23 #include "mux.h" 24 + #include "mmc.h" 25 25 #include "hsmmc.h" 26 26 #include "control.h" 27 27
+2 -2
arch/arm/mach-omap2/hwspinlock.c
··· 21 21 #include <linux/err.h> 22 22 #include <linux/hwspinlock.h> 23 23 24 - #include <plat/omap_hwmod.h> 25 - #include <plat/omap_device.h> 24 + #include "omap_hwmod.h" 25 + #include "omap_device.h" 26 26 27 27 static struct hwspinlock_pdata omap_hwspinlock_pdata __initdata = { 28 28 .base_id = 0,
+66 -3
arch/arm/mach-omap2/i2c.c
··· 19 19 * 20 20 */ 21 21 22 - #include <plat/i2c.h> 22 + #include "soc.h" 23 23 #include "common.h" 24 - #include <plat/omap_hwmod.h> 24 + #include "omap_hwmod.h" 25 + #include "omap_device.h" 25 26 26 27 #include "mux.h" 28 + #include "i2c.h" 27 29 28 30 /* In register I2C_CON, Bit 15 is the I2C enable bit */ 29 31 #define I2C_EN BIT(15) ··· 35 33 /* Maximum microseconds to wait for OMAP module to softreset */ 36 34 #define MAX_MODULE_SOFTRESET_WAIT 10000 37 35 38 - void __init omap2_i2c_mux_pins(int bus_id) 36 + #define MAX_OMAP_I2C_HWMOD_NAME_LEN 16 37 + 38 + static void __init omap2_i2c_mux_pins(int bus_id) 39 39 { 40 40 char mux_name[sizeof("i2c2_scl.i2c2_scl")]; 41 41 ··· 108 104 109 105 return 0; 110 106 } 107 + 108 + static int __init omap_i2c_nr_ports(void) 109 + { 110 + int ports = 0; 111 + 112 + if (cpu_is_omap24xx()) 113 + ports = 2; 114 + else if (cpu_is_omap34xx()) 115 + ports = 3; 116 + else if (cpu_is_omap44xx()) 117 + ports = 4; 118 + return ports; 119 + } 120 + 121 + static const char name[] = "omap_i2c"; 122 + 123 + int __init omap_i2c_add_bus(struct omap_i2c_bus_platform_data *i2c_pdata, 124 + int bus_id) 125 + { 126 + int l; 127 + struct omap_hwmod *oh; 128 + struct platform_device *pdev; 129 + char oh_name[MAX_OMAP_I2C_HWMOD_NAME_LEN]; 130 + struct omap_i2c_bus_platform_data *pdata; 131 + struct omap_i2c_dev_attr *dev_attr; 132 + 133 + if (bus_id > omap_i2c_nr_ports()) 134 + return -EINVAL; 135 + 136 + omap2_i2c_mux_pins(bus_id); 137 + 138 + l = snprintf(oh_name, MAX_OMAP_I2C_HWMOD_NAME_LEN, "i2c%d", bus_id); 139 + WARN(l >= MAX_OMAP_I2C_HWMOD_NAME_LEN, 140 + "String buffer overflow in I2C%d device setup\n", bus_id); 141 + oh = omap_hwmod_lookup(oh_name); 142 + if (!oh) { 143 + pr_err("Could not look up %s\n", oh_name); 144 + return -EEXIST; 145 + } 146 + 147 + pdata = i2c_pdata; 148 + /* 149 + * pass the hwmod class's CPU-specific knowledge of I2C IP revision in 150 + * use, and functionality implementation flags, up to the OMAP I2C 151 + * driver via platform data 152 + */ 153 + pdata->rev = oh->class->rev; 154 + 155 + dev_attr = (struct omap_i2c_dev_attr *)oh->dev_attr; 156 + pdata->flags = dev_attr->flags; 157 + 158 + pdev = omap_device_build(name, bus_id, oh, pdata, 159 + sizeof(struct omap_i2c_bus_platform_data), 160 + NULL, 0, 0); 161 + WARN(IS_ERR(pdev), "Could not build omap_device for %s\n", name); 162 + 163 + return PTR_RET(pdev); 164 + } 165 +
+42
arch/arm/mach-omap2/i2c.h
··· 1 + /* 2 + * Helper module for board specific I2C bus registration 3 + * 4 + * Copyright (C) 2009 Nokia Corporation. 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 + * version 2 as published by the Free Software Foundation. 9 + * 10 + * This program is distributed in the hope that it will be useful, but 11 + * WITHOUT ANY WARRANTY; without even the implied warranty of 12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 + * General Public License for more details. 14 + * 15 + * You should have received a copy of the GNU General Public License 16 + * along with this program; if not, write to the Free Software 17 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 18 + * 02110-1301 USA 19 + * 20 + */ 21 + 22 + #include <plat/i2c.h> 23 + 24 + #ifndef __MACH_OMAP2_I2C_H 25 + #define __MACH_OMAP2_I2C_H 26 + 27 + /** 28 + * i2c_dev_attr - OMAP I2C controller device attributes for omap_hwmod 29 + * @fifo_depth: total controller FIFO size (in bytes) 30 + * @flags: differences in hardware support capability 31 + * 32 + * @fifo_depth represents what exists on the hardware, not what is 33 + * actually configured at runtime by the device driver. 34 + */ 35 + struct omap_i2c_dev_attr { 36 + u8 fifo_depth; 37 + u32 flags; 38 + }; 39 + 40 + int omap_i2c_reset(struct omap_hwmod *oh); 41 + 42 + #endif /* __MACH_OMAP2_I2C_H */
arch/arm/mach-omap2/include/mach/board-zoom.h arch/arm/mach-omap2/board-zoom.h
+1 -1
arch/arm/mach-omap2/include/mach/debug-macro.S
··· 13 13 14 14 #include <linux/serial_reg.h> 15 15 16 - #include <plat/serial.h> 16 + #include <mach/serial.h> 17 17 18 18 #define UART_OFFSET(addr) ((addr) & 0x00ffffff) 19 19
-3
arch/arm/mach-omap2/include/mach/gpio.h
··· 1 - /* 2 - * arch/arm/mach-omap2/include/mach/gpio.h 3 - */
+173 -2
arch/arm/mach-omap2/include/mach/uncompress.h
··· 1 1 /* 2 - * arch/arm/mach-omap2/include/mach/uncompress.h 2 + * arch/arm/plat-omap/include/mach/uncompress.h 3 + * 4 + * Serial port stubs for kernel decompress status messages 5 + * 6 + * Initially based on: 7 + * linux-2.4.15-rmk1-dsplinux1.6/arch/arm/plat-omap/include/mach1510/uncompress.h 8 + * Copyright (C) 2000 RidgeRun, Inc. 9 + * Author: Greg Lonnon <glonnon@ridgerun.com> 10 + * 11 + * Rewritten by: 12 + * Author: <source@mvista.com> 13 + * 2004 (c) MontaVista Software, Inc. 14 + * 15 + * This file is licensed under the terms of the GNU General Public License 16 + * version 2. This program is licensed "as is" without any warranty of any 17 + * kind, whether express or implied. 3 18 */ 4 19 5 - #include <plat/uncompress.h> 20 + #include <linux/types.h> 21 + #include <linux/serial_reg.h> 22 + 23 + #include <asm/memory.h> 24 + #include <asm/mach-types.h> 25 + 26 + #include <mach/serial.h> 27 + 28 + #define MDR1_MODE_MASK 0x07 29 + 30 + volatile u8 *uart_base; 31 + int uart_shift; 32 + 33 + /* 34 + * Store the DEBUG_LL uart number into memory. 35 + * See also debug-macro.S, and serial.c for related code. 36 + */ 37 + static void set_omap_uart_info(unsigned char port) 38 + { 39 + /* 40 + * Get address of some.bss variable and round it down 41 + * a la CONFIG_AUTO_ZRELADDR. 42 + */ 43 + u32 ram_start = (u32)&uart_shift & 0xf8000000; 44 + u32 *uart_info = (u32 *)(ram_start + OMAP_UART_INFO_OFS); 45 + *uart_info = port; 46 + } 47 + 48 + static void putc(int c) 49 + { 50 + if (!uart_base) 51 + return; 52 + 53 + /* Check for UART 16x mode */ 54 + if ((uart_base[UART_OMAP_MDR1 << uart_shift] & MDR1_MODE_MASK) != 0) 55 + return; 56 + 57 + while (!(uart_base[UART_LSR << uart_shift] & UART_LSR_THRE)) 58 + barrier(); 59 + uart_base[UART_TX << uart_shift] = c; 60 + } 61 + 62 + static inline void flush(void) 63 + { 64 + } 65 + 66 + /* 67 + * Macros to configure UART1 and debug UART 68 + */ 69 + #define _DEBUG_LL_ENTRY(mach, dbg_uart, dbg_shft, dbg_id) \ 70 + if (machine_is_##mach()) { \ 71 + uart_base = (volatile u8 *)(dbg_uart); \ 72 + uart_shift = (dbg_shft); \ 73 + port = (dbg_id); \ 74 + set_omap_uart_info(port); \ 75 + break; \ 76 + } 77 + 78 + #define DEBUG_LL_OMAP2(p, mach) \ 79 + _DEBUG_LL_ENTRY(mach, OMAP2_UART##p##_BASE, OMAP_PORT_SHIFT, \ 80 + OMAP2UART##p) 81 + 82 + #define DEBUG_LL_OMAP3(p, mach) \ 83 + _DEBUG_LL_ENTRY(mach, OMAP3_UART##p##_BASE, OMAP_PORT_SHIFT, \ 84 + OMAP3UART##p) 85 + 86 + #define DEBUG_LL_OMAP4(p, mach) \ 87 + _DEBUG_LL_ENTRY(mach, OMAP4_UART##p##_BASE, OMAP_PORT_SHIFT, \ 88 + OMAP4UART##p) 89 + 90 + #define DEBUG_LL_OMAP5(p, mach) \ 91 + _DEBUG_LL_ENTRY(mach, OMAP5_UART##p##_BASE, OMAP_PORT_SHIFT, \ 92 + OMAP5UART##p) 93 + /* Zoom2/3 shift is different for UART1 and external port */ 94 + #define DEBUG_LL_ZOOM(mach) \ 95 + _DEBUG_LL_ENTRY(mach, ZOOM_UART_BASE, ZOOM_PORT_SHIFT, ZOOM_UART) 96 + 97 + #define DEBUG_LL_TI81XX(p, mach) \ 98 + _DEBUG_LL_ENTRY(mach, TI81XX_UART##p##_BASE, OMAP_PORT_SHIFT, \ 99 + TI81XXUART##p) 100 + 101 + #define DEBUG_LL_AM33XX(p, mach) \ 102 + _DEBUG_LL_ENTRY(mach, AM33XX_UART##p##_BASE, OMAP_PORT_SHIFT, \ 103 + AM33XXUART##p) 104 + 105 + static inline void arch_decomp_setup(void) 106 + { 107 + int port = 0; 108 + 109 + /* 110 + * Initialize the port based on the machine ID from the bootloader. 111 + * Note that we're using macros here instead of switch statement 112 + * as machine_is functions are optimized out for the boards that 113 + * are not selected. 114 + */ 115 + do { 116 + /* omap2 based boards using UART1 */ 117 + DEBUG_LL_OMAP2(1, omap_2430sdp); 118 + DEBUG_LL_OMAP2(1, omap_apollon); 119 + DEBUG_LL_OMAP2(1, omap_h4); 120 + 121 + /* omap2 based boards using UART3 */ 122 + DEBUG_LL_OMAP2(3, nokia_n800); 123 + DEBUG_LL_OMAP2(3, nokia_n810); 124 + DEBUG_LL_OMAP2(3, nokia_n810_wimax); 125 + 126 + /* omap3 based boards using UART1 */ 127 + DEBUG_LL_OMAP2(1, omap3evm); 128 + DEBUG_LL_OMAP3(1, omap_3430sdp); 129 + DEBUG_LL_OMAP3(1, omap_3630sdp); 130 + DEBUG_LL_OMAP3(1, omap3530_lv_som); 131 + DEBUG_LL_OMAP3(1, omap3_torpedo); 132 + 133 + /* omap3 based boards using UART3 */ 134 + DEBUG_LL_OMAP3(3, cm_t35); 135 + DEBUG_LL_OMAP3(3, cm_t3517); 136 + DEBUG_LL_OMAP3(3, cm_t3730); 137 + DEBUG_LL_OMAP3(3, craneboard); 138 + DEBUG_LL_OMAP3(3, devkit8000); 139 + DEBUG_LL_OMAP3(3, igep0020); 140 + DEBUG_LL_OMAP3(3, igep0030); 141 + DEBUG_LL_OMAP3(3, nokia_rm680); 142 + DEBUG_LL_OMAP3(3, nokia_rm696); 143 + DEBUG_LL_OMAP3(3, nokia_rx51); 144 + DEBUG_LL_OMAP3(3, omap3517evm); 145 + DEBUG_LL_OMAP3(3, omap3_beagle); 146 + DEBUG_LL_OMAP3(3, omap3_pandora); 147 + DEBUG_LL_OMAP3(3, omap_ldp); 148 + DEBUG_LL_OMAP3(3, overo); 149 + DEBUG_LL_OMAP3(3, touchbook); 150 + 151 + /* omap4 based boards using UART3 */ 152 + DEBUG_LL_OMAP4(3, omap_4430sdp); 153 + DEBUG_LL_OMAP4(3, omap4_panda); 154 + 155 + /* omap5 based boards using UART3 */ 156 + DEBUG_LL_OMAP5(3, omap5_sevm); 157 + 158 + /* zoom2/3 external uart */ 159 + DEBUG_LL_ZOOM(omap_zoom2); 160 + DEBUG_LL_ZOOM(omap_zoom3); 161 + 162 + /* TI8168 base boards using UART3 */ 163 + DEBUG_LL_TI81XX(3, ti8168evm); 164 + 165 + /* TI8148 base boards using UART1 */ 166 + DEBUG_LL_TI81XX(1, ti8148evm); 167 + 168 + /* AM33XX base boards using UART1 */ 169 + DEBUG_LL_AM33XX(1, am335xevm); 170 + } while (0); 171 + } 172 + 173 + /* 174 + * nothing to do 175 + */ 176 + #define arch_decomp_wdog()
+6 -19
arch/arm/mach-omap2/io.c
··· 25 25 #include <asm/tlb.h> 26 26 #include <asm/mach/map.h> 27 27 28 - #include <plat/sram.h> 29 - #include <plat/sdrc.h> 30 - #include <plat/serial.h> 31 - #include <plat/omap-pm.h> 32 - #include <plat/omap_hwmod.h> 33 - #include <plat/multi.h> 34 - #include <plat/dma.h> 28 + #include <plat-omap/dma-omap.h> 35 29 30 + #include "omap_hwmod.h" 36 31 #include "soc.h" 37 32 #include "iomap.h" 38 33 #include "voltage.h" ··· 38 43 #include "clock2xxx.h" 39 44 #include "clock3xxx.h" 40 45 #include "clock44xx.h" 46 + #include "omap-pm.h" 47 + #include "sdrc.h" 48 + #include "serial.h" 49 + #include "sram.h" 41 50 42 51 /* 43 52 * The machine specific code may provide the extra mapping besides the ··· 353 354 return omap_hwmod_set_postsetup_state(oh, *(u8 *)data); 354 355 } 355 356 356 - static void __init omap_common_init_early(void) 357 - { 358 - omap_init_consistent_dma_size(); 359 - } 360 - 361 357 static void __init omap_hwmod_init_postsetup(void) 362 358 { 363 359 u8 postsetup_state; ··· 373 379 { 374 380 omap2_set_globals_242x(); 375 381 omap2xxx_check_revision(); 376 - omap_common_init_early(); 377 382 omap2xxx_voltagedomains_init(); 378 383 omap242x_powerdomains_init(); 379 384 omap242x_clockdomains_init(); ··· 394 401 { 395 402 omap2_set_globals_243x(); 396 403 omap2xxx_check_revision(); 397 - omap_common_init_early(); 398 404 omap2xxx_voltagedomains_init(); 399 405 omap243x_powerdomains_init(); 400 406 omap243x_clockdomains_init(); ··· 420 428 omap2_set_globals_3xxx(); 421 429 omap3xxx_check_revision(); 422 430 omap3xxx_check_features(); 423 - omap_common_init_early(); 424 431 omap3xxx_voltagedomains_init(); 425 432 omap3xxx_powerdomains_init(); 426 433 omap3xxx_clockdomains_init(); ··· 453 462 omap2_set_globals_ti81xx(); 454 463 omap3xxx_check_revision(); 455 464 ti81xx_check_features(); 456 - omap_common_init_early(); 457 465 omap3xxx_voltagedomains_init(); 458 466 omap3xxx_powerdomains_init(); 459 467 omap3xxx_clockdomains_init(); ··· 510 520 omap2_set_globals_am33xx(); 511 521 omap3xxx_check_revision(); 512 522 ti81xx_check_features(); 513 - omap_common_init_early(); 514 523 am33xx_voltagedomains_init(); 515 524 am33xx_powerdomains_init(); 516 525 am33xx_clockdomains_init(); ··· 525 536 omap2_set_globals_443x(); 526 537 omap4xxx_check_revision(); 527 538 omap4xxx_check_features(); 528 - omap_common_init_early(); 529 539 omap44xx_voltagedomains_init(); 530 540 omap44xx_powerdomains_init(); 531 541 omap44xx_clockdomains_init(); ··· 546 558 { 547 559 omap2_set_globals_5xxx(); 548 560 omap5xxx_check_revision(); 549 - omap_common_init_early(); 550 561 } 551 562 #endif 552 563
+4 -3
arch/arm/mach-omap2/mcbsp.c
··· 19 19 #include <linux/platform_device.h> 20 20 #include <linux/slab.h> 21 21 #include <linux/platform_data/asoc-ti-mcbsp.h> 22 - 23 - #include <plat/dma.h> 24 - #include <plat/omap_device.h> 25 22 #include <linux/pm_runtime.h> 23 + 24 + #include <plat-omap/dma-omap.h> 25 + 26 + #include "omap_device.h" 26 27 27 28 /* 28 29 * FIXME: Find a mechanism to enable/disable runtime the McBSP ICLK autoidle.
+23
arch/arm/mach-omap2/mmc.h
··· 1 + #include <linux/mmc/host.h> 2 + #include <linux/platform_data/mmc-omap.h> 3 + 4 + #define OMAP24XX_NR_MMC 2 5 + #define OMAP2420_MMC_SIZE OMAP1_MMC_SIZE 6 + #define OMAP2_MMC1_BASE 0x4809c000 7 + 8 + #define OMAP4_MMC_REG_OFFSET 0x100 9 + 10 + #if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) 11 + void omap242x_init_mmc(struct omap_mmc_platform_data **mmc_data); 12 + #else 13 + static inline void omap242x_init_mmc(struct omap_mmc_platform_data **mmc_data) 14 + { 15 + } 16 + #endif 17 + 18 + struct omap_hwmod; 19 + int omap_msdi_reset(struct omap_hwmod *oh); 20 + 21 + /* called from board-specific card detection service routine */ 22 + extern void omap_mmc_notify_cover_event(struct device *dev, int slot, 23 + int is_closed);
+3 -4
arch/arm/mach-omap2/msdi.c
··· 25 25 #include <linux/err.h> 26 26 #include <linux/platform_data/gpio-omap.h> 27 27 28 - #include <plat/omap_hwmod.h> 29 - #include <plat/omap_device.h> 30 - #include <plat/mmc.h> 31 - 32 28 #include "common.h" 33 29 #include "control.h" 30 + #include "omap_hwmod.h" 31 + #include "omap_device.h" 34 32 #include "mux.h" 33 + #include "mmc.h" 35 34 36 35 /* 37 36 * MSDI_CON_OFFSET: offset in bytes of the MSDI IP block's CON register
+2 -1
arch/arm/mach-omap2/mux.c
··· 36 36 #include <linux/interrupt.h> 37 37 38 38 39 - #include <plat/omap_hwmod.h> 39 + #include "omap_hwmod.h" 40 40 41 + #include "soc.h" 41 42 #include "control.h" 42 43 #include "mux.h" 43 44 #include "prm.h"
+1
arch/arm/mach-omap2/omap-mpuss-lowpower.c
··· 50 50 #include <asm/suspend.h> 51 51 #include <asm/hardware/cache-l2x0.h> 52 52 53 + #include "soc.h" 53 54 #include "common.h" 54 55 #include "omap44xx.h" 55 56 #include "omap4-sar-layout.h"
-1
arch/arm/mach-omap2/omap-secure.c
··· 18 18 #include <asm/cacheflush.h> 19 19 #include <asm/memblock.h> 20 20 21 - #include <plat/omap-secure.h> 22 21 #include "omap-secure.h" 23 22 24 23 static phys_addr_t omap_secure_memblock_base;
+7
arch/arm/mach-omap2/omap-secure.h
··· 52 52 u32 arg1, u32 arg2, u32 arg3, u32 arg4); 53 53 extern u32 omap_smc2(u32 id, u32 falg, u32 pargs); 54 54 extern phys_addr_t omap_secure_ram_mempool_base(void); 55 + extern int omap_secure_ram_reserve_memblock(void); 55 56 57 + #ifdef CONFIG_OMAP4_ERRATA_I688 58 + extern int omap_barrier_reserve_memblock(void); 59 + #else 60 + static inline void omap_barrier_reserve_memblock(void) 61 + { } 62 + #endif 56 63 #endif /* __ASSEMBLER__ */ 57 64 #endif /* OMAP_ARCH_OMAP_SECURE_H */
+3 -5
arch/arm/mach-omap2/omap4-common.c
··· 25 25 #include <asm/mach/map.h> 26 26 #include <asm/memblock.h> 27 27 28 - #include <plat/sram.h> 29 - #include <plat/omap-secure.h> 30 - #include <plat/mmc.h> 31 - 32 28 #include "omap-wakeupgen.h" 33 - 34 29 #include "soc.h" 35 30 #include "common.h" 31 + #include "mmc.h" 36 32 #include "hsmmc.h" 37 33 #include "omap4-sar-layout.h" 34 + #include "omap-secure.h" 35 + #include "sram.h" 38 36 39 37 #ifdef CONFIG_CACHE_L2X0 40 38 static void __iomem *l2cache_base;
+2 -2
arch/arm/mach-omap2/omap_hwmod.c
··· 139 139 #include <linux/slab.h> 140 140 #include <linux/bootmem.h> 141 141 142 - #include <plat/clock.h> 143 - #include <plat/omap_hwmod.h> 142 + #include "clock.h" 143 + #include "omap_hwmod.h" 144 144 #include <plat/prcm.h> 145 145 146 146 #include "soc.h"
+8 -5
arch/arm/mach-omap2/omap_hwmod_2420_data.c
··· 12 12 * XXX handle crossbar/shared link difference for L3? 13 13 * XXX these should be marked initdata for multi-OMAP kernels 14 14 */ 15 + 16 + #include <linux/i2c-omap.h> 15 17 #include <linux/platform_data/spi-omap2-mcspi.h> 16 18 17 - #include <plat/omap_hwmod.h> 18 - #include <plat/dma.h> 19 - #include <plat/serial.h> 20 - #include <plat/i2c.h> 19 + #include <plat-omap/dma-omap.h> 21 20 #include <plat/dmtimer.h> 21 + 22 + #include "omap_hwmod.h" 22 23 #include "l3_2xxx.h" 23 24 #include "l4_2xxx.h" 24 - #include <plat/mmc.h> 25 25 26 26 #include "omap_hwmod_common_data.h" 27 27 28 28 #include "cm-regbits-24xx.h" 29 29 #include "prm-regbits-24xx.h" 30 + #include "i2c.h" 31 + #include "mmc.h" 32 + #include "serial.h" 30 33 #include "wd_timer.h" 31 34 32 35 /*
+7 -5
arch/arm/mach-omap2/omap_hwmod_2430_data.c
··· 12 12 * XXX handle crossbar/shared link difference for L3? 13 13 * XXX these should be marked initdata for multi-OMAP kernels 14 14 */ 15 + 16 + #include <linux/i2c-omap.h> 15 17 #include <linux/platform_data/asoc-ti-mcbsp.h> 16 18 #include <linux/platform_data/spi-omap2-mcspi.h> 17 19 18 - #include <plat/omap_hwmod.h> 19 - #include <plat/dma.h> 20 - #include <plat/serial.h> 21 - #include <plat/i2c.h> 20 + #include <plat-omap/dma-omap.h> 22 21 #include <plat/dmtimer.h> 23 - #include <plat/mmc.h> 22 + 23 + #include "omap_hwmod.h" 24 + #include "mmc.h" 24 25 #include "l3_2xxx.h" 25 26 26 27 #include "soc.h" 27 28 #include "omap_hwmod_common_data.h" 28 29 #include "prm-regbits-24xx.h" 29 30 #include "cm-regbits-24xx.h" 31 + #include "i2c.h" 30 32 #include "wd_timer.h" 31 33 32 34 /*
+1 -2
arch/arm/mach-omap2/omap_hwmod_2xxx_3xxx_interconnect_data.c
··· 13 13 */ 14 14 #include <asm/sizes.h> 15 15 16 - #include <plat/omap_hwmod.h> 17 - #include <plat/serial.h> 16 + #include "omap_hwmod.h" 18 17 19 18 #include "omap_hwmod_common_data.h" 20 19
+5 -4
arch/arm/mach-omap2/omap_hwmod_2xxx_3xxx_ipblock_data.c
··· 9 9 * it under the terms of the GNU General Public License version 2 as 10 10 * published by the Free Software Foundation. 11 11 */ 12 - #include <plat/omap_hwmod.h> 13 - #include <plat/serial.h> 14 - #include <plat/dma.h> 15 - #include <plat/common.h> 12 + 13 + #include <plat-omap/dma-omap.h> 14 + 15 + #include "omap_hwmod.h" 16 16 #include "hdq1w.h" 17 17 18 18 #include "omap_hwmod_common_data.h" 19 + #include "dma.h" 19 20 20 21 /* UART */ 21 22
+2 -2
arch/arm/mach-omap2/omap_hwmod_2xxx_interconnect_data.c
··· 13 13 */ 14 14 #include <asm/sizes.h> 15 15 16 - #include <plat/omap_hwmod.h> 17 - #include <plat/serial.h> 16 + #include "omap_hwmod.h" 18 17 #include "l3_2xxx.h" 19 18 #include "l4_2xxx.h" 19 + #include "serial.h" 20 20 21 21 #include "omap_hwmod_common_data.h" 22 22
+3 -3
arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c
··· 8 8 * it under the terms of the GNU General Public License version 2 as 9 9 * published by the Free Software Foundation. 10 10 */ 11 - #include <plat/omap_hwmod.h> 12 - #include <plat/serial.h> 11 + 13 12 #include <linux/platform_data/gpio-omap.h> 14 - #include <plat/dma.h> 13 + #include <plat-omap/dma-omap.h> 15 14 #include <plat/dmtimer.h> 16 15 #include <linux/platform_data/spi-omap2-mcspi.h> 17 16 17 + #include "omap_hwmod.h" 18 18 #include "omap_hwmod_common_data.h" 19 19 #include "cm-regbits-24xx.h" 20 20 #include "prm-regbits-24xx.h"
+5 -5
arch/arm/mach-omap2/omap_hwmod_33xx_data.c
··· 14 14 * GNU General Public License for more details. 15 15 */ 16 16 17 - #include <plat/omap_hwmod.h> 18 - #include <plat/cpu.h> 17 + #include <linux/i2c-omap.h> 18 + 19 + #include "omap_hwmod.h" 19 20 #include <linux/platform_data/gpio-omap.h> 20 21 #include <linux/platform_data/spi-omap2-mcspi.h> 21 - #include <plat/dma.h> 22 - #include <plat/mmc.h> 23 - #include <plat/i2c.h> 24 22 25 23 #include "omap_hwmod_common_data.h" 26 24 ··· 26 28 #include "cm33xx.h" 27 29 #include "prm33xx.h" 28 30 #include "prm-regbits-33xx.h" 31 + #include "i2c.h" 32 + #include "mmc.h" 29 33 30 34 /* 31 35 * IP blocks
+9 -5
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
··· 14 14 * 15 15 * XXX these should be marked initdata for multi-OMAP kernels 16 16 */ 17 + 18 + #include <linux/i2c-omap.h> 17 19 #include <linux/power/smartreflex.h> 18 20 #include <linux/platform_data/gpio-omap.h> 19 21 20 - #include <plat/omap_hwmod.h> 21 - #include <plat/dma.h> 22 - #include <plat/serial.h> 22 + #include <plat-omap/dma-omap.h> 23 23 #include "l3_3xxx.h" 24 24 #include "l4_3xxx.h" 25 - #include <plat/i2c.h> 26 - #include <plat/mmc.h> 27 25 #include <linux/platform_data/asoc-ti-mcbsp.h> 28 26 #include <linux/platform_data/spi-omap2-mcspi.h> 29 27 #include <plat/dmtimer.h> ··· 30 32 #include "am35xx.h" 31 33 32 34 #include "soc.h" 35 + #include "omap_hwmod.h" 33 36 #include "omap_hwmod_common_data.h" 34 37 #include "prm-regbits-34xx.h" 35 38 #include "cm-regbits-34xx.h" 39 + 40 + #include "dma.h" 41 + #include "i2c.h" 42 + #include "mmc.h" 36 43 #include "wd_timer.h" 44 + #include "serial.h" 37 45 38 46 /* 39 47 * OMAP3xxx hardware module integration data
+6 -5
arch/arm/mach-omap2/omap_hwmod_44xx_data.c
··· 21 21 #include <linux/io.h> 22 22 #include <linux/platform_data/gpio-omap.h> 23 23 #include <linux/power/smartreflex.h> 24 + #include <linux/i2c-omap.h> 24 25 25 - #include <plat/omap_hwmod.h> 26 - #include <plat/i2c.h> 27 - #include <plat/dma.h> 26 + #include <plat-omap/dma-omap.h> 27 + 28 28 #include <linux/platform_data/spi-omap2-mcspi.h> 29 29 #include <linux/platform_data/asoc-ti-mcbsp.h> 30 - #include <plat/mmc.h> 31 30 #include <plat/dmtimer.h> 32 - #include <plat/common.h> 33 31 #include <plat/iommu.h> 34 32 33 + #include "omap_hwmod.h" 35 34 #include "omap_hwmod_common_data.h" 36 35 #include "cm1_44xx.h" 37 36 #include "cm2_44xx.h" 38 37 #include "prm44xx.h" 39 38 #include "prm-regbits-44xx.h" 39 + #include "i2c.h" 40 + #include "mmc.h" 40 41 #include "wd_timer.h" 41 42 42 43 /* Base offset for all OMAP4 interrupts external to MPUSS */
+1 -1
arch/arm/mach-omap2/omap_hwmod_common_data.c
··· 16 16 * data and their integration with other OMAP modules and Linux. 17 17 */ 18 18 19 - #include <plat/omap_hwmod.h> 19 + #include "omap_hwmod.h" 20 20 21 21 #include "omap_hwmod_common_data.h" 22 22
+1 -1
arch/arm/mach-omap2/omap_hwmod_common_data.h
··· 13 13 #ifndef __ARCH_ARM_MACH_OMAP2_OMAP_HWMOD_COMMON_DATA_H 14 14 #define __ARCH_ARM_MACH_OMAP2_OMAP_HWMOD_COMMON_DATA_H 15 15 16 - #include <plat/omap_hwmod.h> 16 + #include "omap_hwmod.h" 17 17 18 18 #include "common.h" 19 19 #include "display.h"
+1 -1
arch/arm/mach-omap2/omap_opp_data.h
··· 19 19 #ifndef __ARCH_ARM_MACH_OMAP2_OMAP_OPP_DATA_H 20 20 #define __ARCH_ARM_MACH_OMAP2_OMAP_OPP_DATA_H 21 21 22 - #include <plat/omap_hwmod.h> 22 + #include "omap_hwmod.h" 23 23 24 24 #include "voltage.h" 25 25
+2 -2
arch/arm/mach-omap2/omap_phy_internal.c
··· 27 27 #include <linux/io.h> 28 28 #include <linux/err.h> 29 29 #include <linux/usb.h> 30 - 31 - #include <plat/usb.h> 30 + #include <linux/usb/musb.h> 32 31 33 32 #include "soc.h" 34 33 #include "control.h" 34 + #include "usb.h" 35 35 36 36 void am35x_musb_reset(void) 37 37 {
+1
arch/arm/mach-omap2/omap_twl.c
··· 18 18 #include <linux/kernel.h> 19 19 #include <linux/i2c/twl.h> 20 20 21 + #include "soc.h" 21 22 #include "voltage.h" 22 23 23 24 #include "pm.h"
+1 -1
arch/arm/mach-omap2/opp.c
··· 20 20 #include <linux/opp.h> 21 21 #include <linux/cpu.h> 22 22 23 - #include <plat/omap_device.h> 23 + #include "omap_device.h" 24 24 25 25 #include "omap_opp_data.h" 26 26
+1
arch/arm/mach-omap2/opp3xxx_data.c
··· 19 19 */ 20 20 #include <linux/module.h> 21 21 22 + #include "soc.h" 22 23 #include "control.h" 23 24 #include "omap_opp_data.h" 24 25 #include "pm.h"
+3 -2
arch/arm/mach-omap2/pm-debug.c
··· 27 27 #include <linux/module.h> 28 28 #include <linux/slab.h> 29 29 30 - #include <plat/clock.h> 30 + #include "clock.h" 31 31 #include "powerdomain.h" 32 32 #include "clockdomain.h" 33 33 #include <plat/dmtimer.h> 34 - #include <plat/omap-pm.h> 34 + #include "omap-pm.h" 35 35 36 + #include "soc.h" 36 37 #include "cm2xxx_3xxx.h" 37 38 #include "prm2xxx_3xxx.h" 38 39 #include "pm.h"
+3 -2
arch/arm/mach-omap2/pm.c
··· 20 20 21 21 #include <asm/system_misc.h> 22 22 23 - #include <plat/omap-pm.h> 24 - #include <plat/omap_device.h> 23 + #include "omap-pm.h" 24 + #include "omap_device.h" 25 25 #include "common.h" 26 26 27 + #include "soc.h" 27 28 #include "prcm-common.h" 28 29 #include "voltage.h" 29 30 #include "powerdomain.h"
+6 -3
arch/arm/mach-omap2/pm24xx.c
··· 31 31 #include <linux/gpio.h> 32 32 #include <linux/platform_data/gpio-omap.h> 33 33 34 + #include <asm/fncpy.h> 35 + 34 36 #include <asm/mach/time.h> 35 37 #include <asm/mach/irq.h> 36 38 #include <asm/mach-types.h> 37 39 #include <asm/system_misc.h> 38 40 39 - #include <plat/clock.h> 40 - #include <plat/sram.h> 41 - #include <plat/dma.h> 41 + #include <plat-omap/dma-omap.h> 42 42 43 + #include "soc.h" 43 44 #include "common.h" 45 + #include "clock.h" 44 46 #include "prm2xxx_3xxx.h" 45 47 #include "prm-regbits-24xx.h" 46 48 #include "cm2xxx_3xxx.h" 47 49 #include "cm-regbits-24xx.h" 48 50 #include "sdrc.h" 51 + #include "sram.h" 49 52 #include "pm.h" 50 53 #include "control.h" 51 54 #include "powerdomain.h"
+5 -4
arch/arm/mach-omap2/pm34xx.c
··· 32 32 33 33 #include <trace/events/power.h> 34 34 35 + #include <asm/fncpy.h> 35 36 #include <asm/suspend.h> 36 37 #include <asm/system_misc.h> 37 38 38 - #include <plat/sram.h> 39 39 #include "clockdomain.h" 40 40 #include "powerdomain.h" 41 - #include <plat/sdrc.h> 42 41 #include <plat/prcm.h> 43 - #include <plat/gpmc.h> 44 - #include <plat/dma.h> 42 + #include <plat-omap/dma-omap.h> 45 43 44 + #include "soc.h" 46 45 #include "common.h" 47 46 #include "cm2xxx_3xxx.h" 48 47 #include "cm-regbits-34xx.h" 48 + #include "gpmc.h" 49 49 #include "prm-regbits-34xx.h" 50 50 51 51 #include "prm2xxx_3xxx.h" 52 52 #include "pm.h" 53 53 #include "sdrc.h" 54 + #include "sram.h" 54 55 #include "control.h" 55 56 56 57 /* pm34xx errata defined in pm.h */
+1
arch/arm/mach-omap2/pm44xx.c
··· 18 18 #include <linux/slab.h> 19 19 #include <asm/system_misc.h> 20 20 21 + #include "soc.h" 21 22 #include "common.h" 22 23 #include "clockdomain.h" 23 24 #include "powerdomain.h"
+3 -2
arch/arm/mach-omap2/pmu.c
··· 15 15 16 16 #include <asm/pmu.h> 17 17 18 - #include <plat/omap_hwmod.h> 19 - #include <plat/omap_device.h> 18 + #include "soc.h" 19 + #include "omap_hwmod.h" 20 + #include "omap_device.h" 20 21 21 22 static char *omap2_pmu_oh_names[] = {"mpu"}; 22 23 static char *omap3_pmu_oh_names[] = {"mpu", "debugss"};
-2
arch/arm/mach-omap2/powerdomain.h
··· 22 22 23 23 #include <linux/atomic.h> 24 24 25 - #include <plat/cpu.h> 26 - 27 25 #include "voltage.h" 28 26 29 27 /* Powerdomain basic power states */
+1
arch/arm/mach-omap2/powerdomains2xxx_data.c
··· 14 14 #include <linux/kernel.h> 15 15 #include <linux/init.h> 16 16 17 + #include "soc.h" 17 18 #include "powerdomain.h" 18 19 #include "powerdomains2xxx_3xxx_data.h" 19 20
+1
arch/arm/mach-omap2/prcm.c
··· 28 28 #include "common.h" 29 29 #include <plat/prcm.h> 30 30 31 + #include "soc.h" 31 32 #include "clock.h" 32 33 #include "clock2xxx.h" 33 34 #include "cm2xxx_3xxx.h"
-2
arch/arm/mach-omap2/prm33xx.c
··· 19 19 #include <linux/err.h> 20 20 #include <linux/io.h> 21 21 22 - #include <plat/common.h> 23 - 24 22 #include "common.h" 25 23 #include "prm33xx.h" 26 24 #include "prm-regbits-33xx.h"
-1
arch/arm/mach-omap2/prm_common.c
··· 24 24 #include <linux/interrupt.h> 25 25 #include <linux/slab.h> 26 26 27 - #include <plat/common.h> 28 27 #include <plat/prcm.h> 29 28 30 29 #include "prm2xxx_3xxx.h"
+1 -1
arch/arm/mach-omap2/sdram-hynix-h8mbx00u0mer-0em.h
··· 11 11 #ifndef __ARCH_ARM_MACH_OMAP2_SDRAM_HYNIX_H8MBX00U0MER0EM 12 12 #define __ARCH_ARM_MACH_OMAP2_SDRAM_HYNIX_H8MBX00U0MER0EM 13 13 14 - #include <plat/sdrc.h> 14 + #include "sdrc.h" 15 15 16 16 /* Hynix H8MBX00U0MER-0EM */ 17 17 static struct omap_sdrc_params h8mbx00u0mer0em_sdrc_params[] = {
+1 -1
arch/arm/mach-omap2/sdram-micron-mt46h32m32lf-6.h
··· 14 14 #ifndef ARCH_ARM_MACH_OMAP2_SDRAM_MICRON_MT46H32M32LF 15 15 #define ARCH_ARM_MACH_OMAP2_SDRAM_MICRON_MT46H32M32LF 16 16 17 - #include <plat/sdrc.h> 17 + #include "sdrc.h" 18 18 19 19 /* Micron MT46H32M32LF-6 */ 20 20 /* XXX Using ARE = 0x1 (no autorefresh burst) -- can this be changed? */
+1 -3
arch/arm/mach-omap2/sdram-nokia.c
··· 18 18 #include <linux/io.h> 19 19 20 20 #include "common.h" 21 - #include <plat/clock.h> 22 - #include <plat/sdrc.h> 23 - 24 21 #include "sdram-nokia.h" 22 + #include "sdrc.h" 25 23 26 24 /* In picoseconds, except for tREF (ns), tXP, tCKE, tWTR (clks) */ 27 25 struct sdram_timings {
+1 -1
arch/arm/mach-omap2/sdram-numonyx-m65kxxxxam.h
··· 11 11 #ifndef __ARCH_ARM_MACH_OMAP2_SDRAM_NUMONYX_M65KXXXXAM 12 12 #define __ARCH_ARM_MACH_OMAP2_SDRAM_NUMONYX_M65KXXXXAM 13 13 14 - #include <plat/sdrc.h> 14 + #include "sdrc.h" 15 15 16 16 /* Numonyx M65KXXXXAM */ 17 17 static struct omap_sdrc_params m65kxxxxam_sdrc_params[] = {
+1 -1
arch/arm/mach-omap2/sdram-qimonda-hyb18m512160af-6.h
··· 14 14 #ifndef ARCH_ARM_MACH_OMAP2_SDRAM_QIMONDA_HYB18M512160AF6 15 15 #define ARCH_ARM_MACH_OMAP2_SDRAM_QIMONDA_HYB18M512160AF6 16 16 17 - #include <plat/sdrc.h> 17 + #include "sdrc.h" 18 18 19 19 /* Qimonda HYB18M512160AF-6 */ 20 20 static struct omap_sdrc_params hyb18m512160af6_sdrc_params[] = {
+1 -20
arch/arm/mach-omap2/sdrc.c
··· 24 24 #include <linux/io.h> 25 25 26 26 #include "common.h" 27 - #include <plat/clock.h> 28 - #include <plat/sram.h> 29 - 30 - #include <plat/sdrc.h> 27 + #include "clock.h" 31 28 #include "sdrc.h" 32 29 33 30 static struct omap_sdrc_params *sdrc_init_params_cs0, *sdrc_init_params_cs1; ··· 157 160 sdrc_write_reg(l, SDRC_POWER); 158 161 omap2_sms_save_context(); 159 162 } 160 - 161 - void omap2_sms_write_rot_control(u32 val, unsigned ctx) 162 - { 163 - sms_write_reg(val, SMS_ROT_CONTROL(ctx)); 164 - } 165 - 166 - void omap2_sms_write_rot_size(u32 val, unsigned ctx) 167 - { 168 - sms_write_reg(val, SMS_ROT_SIZE(ctx)); 169 - } 170 - 171 - void omap2_sms_write_rot_physical_ba(u32 val, unsigned ctx) 172 - { 173 - sms_write_reg(val, SMS_ROT_PHYSICAL_BA(ctx)); 174 - } 175 -
+140 -6
arch/arm/mach-omap2/sdrc.h
··· 2 2 #define __ARCH_ARM_MACH_OMAP2_SDRC_H 3 3 4 4 /* 5 - * OMAP2 SDRC register definitions 5 + * OMAP2/3 SDRC/SMS macros and prototypes 6 6 * 7 - * Copyright (C) 2007 Texas Instruments, Inc. 8 - * Copyright (C) 2007 Nokia Corporation 7 + * Copyright (C) 2007-2008, 2012 Texas Instruments, Inc. 8 + * Copyright (C) 2007-2008 Nokia Corporation 9 9 * 10 - * Written by Paul Walmsley 10 + * Paul Walmsley 11 + * Tony Lindgren 12 + * Richard Woodruff 11 13 * 12 14 * This program is free software; you can redistribute it and/or modify 13 15 * it under the terms of the GNU General Public License version 2 as 14 16 * published by the Free Software Foundation. 15 17 */ 16 18 #undef DEBUG 17 - 18 - #include <plat/sdrc.h> 19 19 20 20 #ifndef __ASSEMBLER__ 21 21 ··· 50 50 { 51 51 return __raw_readl(OMAP_SMS_REGADDR(reg)); 52 52 } 53 + 54 + 55 + /** 56 + * struct omap_sdrc_params - SDRC parameters for a given SDRC clock rate 57 + * @rate: SDRC clock rate (in Hz) 58 + * @actim_ctrla: Value to program to SDRC_ACTIM_CTRLA for this rate 59 + * @actim_ctrlb: Value to program to SDRC_ACTIM_CTRLB for this rate 60 + * @rfr_ctrl: Value to program to SDRC_RFR_CTRL for this rate 61 + * @mr: Value to program to SDRC_MR for this rate 62 + * 63 + * This structure holds a pre-computed set of register values for the 64 + * SDRC for a given SDRC clock rate and SDRAM chip. These are 65 + * intended to be pre-computed and specified in an array in the board-*.c 66 + * files. The structure is keyed off the 'rate' field. 67 + */ 68 + struct omap_sdrc_params { 69 + unsigned long rate; 70 + u32 actim_ctrla; 71 + u32 actim_ctrlb; 72 + u32 rfr_ctrl; 73 + u32 mr; 74 + }; 75 + 76 + #ifdef CONFIG_SOC_HAS_OMAP2_SDRC 77 + void omap2_sdrc_init(struct omap_sdrc_params *sdrc_cs0, 78 + struct omap_sdrc_params *sdrc_cs1); 79 + #else 80 + static inline void __init omap2_sdrc_init(struct omap_sdrc_params *sdrc_cs0, 81 + struct omap_sdrc_params *sdrc_cs1) {}; 82 + #endif 83 + 84 + int omap2_sdrc_get_params(unsigned long r, 85 + struct omap_sdrc_params **sdrc_cs0, 86 + struct omap_sdrc_params **sdrc_cs1); 87 + void omap2_sms_save_context(void); 88 + void omap2_sms_restore_context(void); 89 + 90 + struct memory_timings { 91 + u32 m_type; /* ddr = 1, sdr = 0 */ 92 + u32 dll_mode; /* use lock mode = 1, unlock mode = 0 */ 93 + u32 slow_dll_ctrl; /* unlock mode, dll value for slow speed */ 94 + u32 fast_dll_ctrl; /* unlock mode, dll value for fast speed */ 95 + u32 base_cs; /* base chip select to use for calculations */ 96 + }; 97 + 98 + extern void omap2xxx_sdrc_init_params(u32 force_lock_to_unlock_mode); 99 + struct omap_sdrc_params *rx51_get_sdram_timings(void); 100 + 101 + u32 omap2xxx_sdrc_dll_is_unlocked(void); 102 + u32 omap2xxx_sdrc_reprogram(u32 level, u32 force); 103 + 104 + 53 105 #else 54 106 #define OMAP242X_SDRC_REGADDR(reg) \ 55 107 OMAP2_L3_IO_ADDRESS(OMAP2420_SDRC_BASE + (reg)) ··· 109 57 OMAP2_L3_IO_ADDRESS(OMAP243X_SDRC_BASE + (reg)) 110 58 #define OMAP34XX_SDRC_REGADDR(reg) \ 111 59 OMAP2_L3_IO_ADDRESS(OMAP343X_SDRC_BASE + (reg)) 60 + 112 61 #endif /* __ASSEMBLER__ */ 113 62 114 63 /* Minimum frequency that the SDRC DLL can lock at */ ··· 126 73 * 2^MPURATE_BASE_SHIFT MHz for SDRC to stabilize 127 74 */ 128 75 #define SDRC_MPURATE_LOOPS 96 76 + 77 + /* SDRC register offsets - read/write with sdrc_{read,write}_reg() */ 78 + 79 + #define SDRC_SYSCONFIG 0x010 80 + #define SDRC_CS_CFG 0x040 81 + #define SDRC_SHARING 0x044 82 + #define SDRC_ERR_TYPE 0x04C 83 + #define SDRC_DLLA_CTRL 0x060 84 + #define SDRC_DLLA_STATUS 0x064 85 + #define SDRC_DLLB_CTRL 0x068 86 + #define SDRC_DLLB_STATUS 0x06C 87 + #define SDRC_POWER 0x070 88 + #define SDRC_MCFG_0 0x080 89 + #define SDRC_MR_0 0x084 90 + #define SDRC_EMR2_0 0x08c 91 + #define SDRC_ACTIM_CTRL_A_0 0x09c 92 + #define SDRC_ACTIM_CTRL_B_0 0x0a0 93 + #define SDRC_RFR_CTRL_0 0x0a4 94 + #define SDRC_MANUAL_0 0x0a8 95 + #define SDRC_MCFG_1 0x0B0 96 + #define SDRC_MR_1 0x0B4 97 + #define SDRC_EMR2_1 0x0BC 98 + #define SDRC_ACTIM_CTRL_A_1 0x0C4 99 + #define SDRC_ACTIM_CTRL_B_1 0x0C8 100 + #define SDRC_RFR_CTRL_1 0x0D4 101 + #define SDRC_MANUAL_1 0x0D8 102 + 103 + #define SDRC_POWER_AUTOCOUNT_SHIFT 8 104 + #define SDRC_POWER_AUTOCOUNT_MASK (0xffff << SDRC_POWER_AUTOCOUNT_SHIFT) 105 + #define SDRC_POWER_CLKCTRL_SHIFT 4 106 + #define SDRC_POWER_CLKCTRL_MASK (0x3 << SDRC_POWER_CLKCTRL_SHIFT) 107 + #define SDRC_SELF_REFRESH_ON_AUTOCOUNT (0x2 << SDRC_POWER_CLKCTRL_SHIFT) 108 + 109 + /* 110 + * These values represent the number of memory clock cycles between 111 + * autorefresh initiation. They assume 1 refresh per 64 ms (JEDEC), 8192 112 + * rows per device, and include a subtraction of a 50 cycle window in the 113 + * event that the autorefresh command is delayed due to other SDRC activity. 114 + * The '| 1' sets the ARE field to send one autorefresh when the autorefresh 115 + * counter reaches 0. 116 + * 117 + * These represent optimal values for common parts, it won't work for all. 118 + * As long as you scale down, most parameters are still work, they just 119 + * become sub-optimal. The RFR value goes in the opposite direction. If you 120 + * don't adjust it down as your clock period increases the refresh interval 121 + * will not be met. Setting all parameters for complete worst case may work, 122 + * but may cut memory performance by 2x. Due to errata the DLLs need to be 123 + * unlocked and their value needs run time calibration. A dynamic call is 124 + * need for that as no single right value exists acorss production samples. 125 + * 126 + * Only the FULL speed values are given. Current code is such that rate 127 + * changes must be made at DPLLoutx2. The actual value adjustment for low 128 + * frequency operation will be handled by omap_set_performance() 129 + * 130 + * By having the boot loader boot up in the fastest L4 speed available likely 131 + * will result in something which you can switch between. 132 + */ 133 + #define SDRC_RFR_CTRL_165MHz (0x00044c00 | 1) 134 + #define SDRC_RFR_CTRL_133MHz (0x0003de00 | 1) 135 + #define SDRC_RFR_CTRL_100MHz (0x0002da01 | 1) 136 + #define SDRC_RFR_CTRL_110MHz (0x0002da01 | 1) /* Need to calc */ 137 + #define SDRC_RFR_CTRL_BYPASS (0x00005000 | 1) /* Need to calc */ 138 + 139 + 140 + /* 141 + * SMS register access 142 + */ 143 + 144 + #define OMAP242X_SMS_REGADDR(reg) \ 145 + (void __iomem *)OMAP2_L3_IO_ADDRESS(OMAP2420_SMS_BASE + reg) 146 + #define OMAP243X_SMS_REGADDR(reg) \ 147 + (void __iomem *)OMAP2_L3_IO_ADDRESS(OMAP243X_SMS_BASE + reg) 148 + #define OMAP343X_SMS_REGADDR(reg) \ 149 + (void __iomem *)OMAP2_L3_IO_ADDRESS(OMAP343X_SMS_BASE + reg) 150 + 151 + /* SMS register offsets - read/write with sms_{read,write}_reg() */ 152 + 153 + #define SMS_SYSCONFIG 0x010 154 + /* REVISIT: fill in other SMS registers here */ 155 + 156 + 129 157 130 158 #endif
+1 -4
arch/arm/mach-omap2/sdrc2xxx.c
··· 24 24 #include <linux/clk.h> 25 25 #include <linux/io.h> 26 26 27 - #include <plat/clock.h> 28 - #include <plat/sram.h> 29 - #include <plat/sdrc.h> 30 - 31 27 #include "soc.h" 32 28 #include "iomap.h" 33 29 #include "common.h" 34 30 #include "prm2xxx_3xxx.h" 35 31 #include "clock.h" 36 32 #include "sdrc.h" 33 + #include "sram.h" 37 34 38 35 /* Memory timing, DLL mode flags */ 39 36 #define M_DDR 1
+7 -6
arch/arm/mach-omap2/serial.c
··· 28 28 #include <linux/console.h> 29 29 30 30 #include <plat/omap-serial.h> 31 - #include "common.h" 32 - #include <plat/dma.h> 33 - #include <plat/omap_hwmod.h> 34 - #include <plat/omap_device.h> 35 - #include <plat/omap-pm.h> 36 - #include <plat/serial.h> 31 + #include <plat-omap/dma-omap.h> 37 32 33 + #include "common.h" 34 + #include "omap_hwmod.h" 35 + #include "omap_device.h" 36 + #include "omap-pm.h" 37 + #include "soc.h" 38 38 #include "prm2xxx_3xxx.h" 39 39 #include "pm.h" 40 40 #include "cm2xxx_3xxx.h" 41 41 #include "prm-regbits-34xx.h" 42 42 #include "control.h" 43 43 #include "mux.h" 44 + #include "serial.h" 44 45 45 46 /* 46 47 * NOTE: By default the serial auto_suspend timeout is disabled as it causes
+1
arch/arm/mach-omap2/serial.h
··· 1 + #include <mach/serial.h>
+1 -2
arch/arm/mach-omap2/sleep34xx.S
··· 26 26 27 27 #include <asm/assembler.h> 28 28 29 - #include <plat/sram.h> 30 - 31 29 #include "omap34xx.h" 32 30 #include "iomap.h" 33 31 #include "cm2xxx_3xxx.h" 34 32 #include "prm2xxx_3xxx.h" 35 33 #include "sdrc.h" 34 + #include "sram.h" 36 35 #include "control.h" 37 36 38 37 /*
+467 -1
arch/arm/mach-omap2/soc.h
··· 1 - #include <plat/cpu.h> 1 + /* 2 + * OMAP cpu type detection 3 + * 4 + * Copyright (C) 2004, 2008 Nokia Corporation 5 + * 6 + * Copyright (C) 2009-11 Texas Instruments. 7 + * 8 + * Written by Tony Lindgren <tony.lindgren@nokia.com> 9 + * 10 + * Added OMAP4/5 specific defines - Santosh Shilimkar<santosh.shilimkar@ti.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 as published by 14 + * the Free Software Foundation; either version 2 of the License, or 15 + * (at your option) any later version. 16 + * 17 + * This program is distributed in the hope that it will be useful, 18 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 + * GNU General Public License for more details. 21 + * 22 + * You should have received a copy of the GNU General Public License 23 + * along with this program; if not, write to the Free Software 24 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 25 + * 26 + */ 27 + 2 28 #include "omap24xx.h" 3 29 #include "omap34xx.h" 4 30 #include "omap44xx.h" 5 31 #include "ti81xx.h" 6 32 #include "am33xx.h" 7 33 #include "omap54xx.h" 34 + 35 + #ifndef __ASSEMBLY__ 36 + 37 + #include <linux/bitops.h> 38 + 39 + /* 40 + * Test if multicore OMAP support is needed 41 + */ 42 + #undef MULTI_OMAP2 43 + #undef OMAP_NAME 44 + 45 + #ifdef CONFIG_SOC_OMAP2420 46 + # ifdef OMAP_NAME 47 + # undef MULTI_OMAP2 48 + # define MULTI_OMAP2 49 + # else 50 + # define OMAP_NAME omap2420 51 + # endif 52 + #endif 53 + #ifdef CONFIG_SOC_OMAP2430 54 + # ifdef OMAP_NAME 55 + # undef MULTI_OMAP2 56 + # define MULTI_OMAP2 57 + # else 58 + # define OMAP_NAME omap2430 59 + # endif 60 + #endif 61 + #ifdef CONFIG_ARCH_OMAP3 62 + # ifdef OMAP_NAME 63 + # undef MULTI_OMAP2 64 + # define MULTI_OMAP2 65 + # else 66 + # define OMAP_NAME omap3 67 + # endif 68 + #endif 69 + #ifdef CONFIG_ARCH_OMAP4 70 + # ifdef OMAP_NAME 71 + # undef MULTI_OMAP2 72 + # define MULTI_OMAP2 73 + # else 74 + # define OMAP_NAME omap4 75 + # endif 76 + #endif 77 + 78 + #ifdef CONFIG_SOC_OMAP5 79 + # ifdef OMAP_NAME 80 + # undef MULTI_OMAP2 81 + # define MULTI_OMAP2 82 + # else 83 + # define OMAP_NAME omap5 84 + # endif 85 + #endif 86 + 87 + #ifdef CONFIG_SOC_AM33XX 88 + # ifdef OMAP_NAME 89 + # undef MULTI_OMAP2 90 + # define MULTI_OMAP2 91 + # else 92 + # define OMAP_NAME am33xx 93 + # endif 94 + #endif 95 + 96 + /* 97 + * Omap device type i.e. EMU/HS/TST/GP/BAD 98 + */ 99 + #define OMAP2_DEVICE_TYPE_TEST 0 100 + #define OMAP2_DEVICE_TYPE_EMU 1 101 + #define OMAP2_DEVICE_TYPE_SEC 2 102 + #define OMAP2_DEVICE_TYPE_GP 3 103 + #define OMAP2_DEVICE_TYPE_BAD 4 104 + 105 + int omap_type(void); 106 + 107 + /* 108 + * omap_rev bits: 109 + * CPU id bits (0730, 1510, 1710, 2422...) [31:16] 110 + * CPU revision (See _REV_ defined in cpu.h) [15:08] 111 + * CPU class bits (15xx, 16xx, 24xx, 34xx...) [07:00] 112 + */ 113 + unsigned int omap_rev(void); 114 + 115 + /* 116 + * Get the CPU revision for OMAP devices 117 + */ 118 + #define GET_OMAP_REVISION() ((omap_rev() >> 8) & 0xff) 119 + 120 + /* 121 + * Macros to group OMAP into cpu classes. 122 + * These can be used in most places. 123 + * cpu_is_omap24xx(): True for OMAP2420, OMAP2422, OMAP2423, OMAP2430 124 + * cpu_is_omap242x(): True for OMAP2420, OMAP2422, OMAP2423 125 + * cpu_is_omap243x(): True for OMAP2430 126 + * cpu_is_omap343x(): True for OMAP3430 127 + * cpu_is_omap443x(): True for OMAP4430 128 + * cpu_is_omap446x(): True for OMAP4460 129 + * cpu_is_omap447x(): True for OMAP4470 130 + * soc_is_omap543x(): True for OMAP5430, OMAP5432 131 + */ 132 + #define GET_OMAP_CLASS (omap_rev() & 0xff) 133 + 134 + #define IS_OMAP_CLASS(class, id) \ 135 + static inline int is_omap ##class (void) \ 136 + { \ 137 + return (GET_OMAP_CLASS == (id)) ? 1 : 0; \ 138 + } 139 + 140 + #define GET_AM_CLASS ((omap_rev() >> 24) & 0xff) 141 + 142 + #define IS_AM_CLASS(class, id) \ 143 + static inline int is_am ##class (void) \ 144 + { \ 145 + return (GET_AM_CLASS == (id)) ? 1 : 0; \ 146 + } 147 + 148 + #define GET_TI_CLASS ((omap_rev() >> 24) & 0xff) 149 + 150 + #define IS_TI_CLASS(class, id) \ 151 + static inline int is_ti ##class (void) \ 152 + { \ 153 + return (GET_TI_CLASS == (id)) ? 1 : 0; \ 154 + } 155 + 156 + #define GET_OMAP_SUBCLASS ((omap_rev() >> 20) & 0x0fff) 157 + 158 + #define IS_OMAP_SUBCLASS(subclass, id) \ 159 + static inline int is_omap ##subclass (void) \ 160 + { \ 161 + return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0; \ 162 + } 163 + 164 + #define IS_TI_SUBCLASS(subclass, id) \ 165 + static inline int is_ti ##subclass (void) \ 166 + { \ 167 + return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0; \ 168 + } 169 + 170 + #define IS_AM_SUBCLASS(subclass, id) \ 171 + static inline int is_am ##subclass (void) \ 172 + { \ 173 + return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0; \ 174 + } 175 + 176 + IS_OMAP_CLASS(24xx, 0x24) 177 + IS_OMAP_CLASS(34xx, 0x34) 178 + IS_OMAP_CLASS(44xx, 0x44) 179 + IS_AM_CLASS(35xx, 0x35) 180 + IS_OMAP_CLASS(54xx, 0x54) 181 + IS_AM_CLASS(33xx, 0x33) 182 + 183 + IS_TI_CLASS(81xx, 0x81) 184 + 185 + IS_OMAP_SUBCLASS(242x, 0x242) 186 + IS_OMAP_SUBCLASS(243x, 0x243) 187 + IS_OMAP_SUBCLASS(343x, 0x343) 188 + IS_OMAP_SUBCLASS(363x, 0x363) 189 + IS_OMAP_SUBCLASS(443x, 0x443) 190 + IS_OMAP_SUBCLASS(446x, 0x446) 191 + IS_OMAP_SUBCLASS(447x, 0x447) 192 + IS_OMAP_SUBCLASS(543x, 0x543) 193 + 194 + IS_TI_SUBCLASS(816x, 0x816) 195 + IS_TI_SUBCLASS(814x, 0x814) 196 + IS_AM_SUBCLASS(335x, 0x335) 197 + 198 + #define cpu_is_omap24xx() 0 199 + #define cpu_is_omap242x() 0 200 + #define cpu_is_omap243x() 0 201 + #define cpu_is_omap34xx() 0 202 + #define cpu_is_omap343x() 0 203 + #define cpu_is_ti81xx() 0 204 + #define cpu_is_ti816x() 0 205 + #define cpu_is_ti814x() 0 206 + #define soc_is_am35xx() 0 207 + #define soc_is_am33xx() 0 208 + #define soc_is_am335x() 0 209 + #define cpu_is_omap44xx() 0 210 + #define cpu_is_omap443x() 0 211 + #define cpu_is_omap446x() 0 212 + #define cpu_is_omap447x() 0 213 + #define soc_is_omap54xx() 0 214 + #define soc_is_omap543x() 0 215 + 216 + #if defined(MULTI_OMAP2) 217 + # if defined(CONFIG_ARCH_OMAP2) 218 + # undef cpu_is_omap24xx 219 + # define cpu_is_omap24xx() is_omap24xx() 220 + # endif 221 + # if defined (CONFIG_SOC_OMAP2420) 222 + # undef cpu_is_omap242x 223 + # define cpu_is_omap242x() is_omap242x() 224 + # endif 225 + # if defined (CONFIG_SOC_OMAP2430) 226 + # undef cpu_is_omap243x 227 + # define cpu_is_omap243x() is_omap243x() 228 + # endif 229 + # if defined(CONFIG_ARCH_OMAP3) 230 + # undef cpu_is_omap34xx 231 + # undef cpu_is_omap343x 232 + # define cpu_is_omap34xx() is_omap34xx() 233 + # define cpu_is_omap343x() is_omap343x() 234 + # endif 235 + #else 236 + # if defined(CONFIG_ARCH_OMAP2) 237 + # undef cpu_is_omap24xx 238 + # define cpu_is_omap24xx() 1 239 + # endif 240 + # if defined(CONFIG_SOC_OMAP2420) 241 + # undef cpu_is_omap242x 242 + # define cpu_is_omap242x() 1 243 + # endif 244 + # if defined(CONFIG_SOC_OMAP2430) 245 + # undef cpu_is_omap243x 246 + # define cpu_is_omap243x() 1 247 + # endif 248 + # if defined(CONFIG_ARCH_OMAP3) 249 + # undef cpu_is_omap34xx 250 + # define cpu_is_omap34xx() 1 251 + # endif 252 + # if defined(CONFIG_SOC_OMAP3430) 253 + # undef cpu_is_omap343x 254 + # define cpu_is_omap343x() 1 255 + # endif 256 + #endif 257 + 258 + /* 259 + * Macros to detect individual cpu types. 260 + * These are only rarely needed. 261 + * cpu_is_omap2420(): True for OMAP2420 262 + * cpu_is_omap2422(): True for OMAP2422 263 + * cpu_is_omap2423(): True for OMAP2423 264 + * cpu_is_omap2430(): True for OMAP2430 265 + * cpu_is_omap3430(): True for OMAP3430 266 + */ 267 + #define GET_OMAP_TYPE ((omap_rev() >> 16) & 0xffff) 268 + 269 + #define IS_OMAP_TYPE(type, id) \ 270 + static inline int is_omap ##type (void) \ 271 + { \ 272 + return (GET_OMAP_TYPE == (id)) ? 1 : 0; \ 273 + } 274 + 275 + IS_OMAP_TYPE(2420, 0x2420) 276 + IS_OMAP_TYPE(2422, 0x2422) 277 + IS_OMAP_TYPE(2423, 0x2423) 278 + IS_OMAP_TYPE(2430, 0x2430) 279 + IS_OMAP_TYPE(3430, 0x3430) 280 + 281 + #define cpu_is_omap2420() 0 282 + #define cpu_is_omap2422() 0 283 + #define cpu_is_omap2423() 0 284 + #define cpu_is_omap2430() 0 285 + #define cpu_is_omap3430() 0 286 + #define cpu_is_omap3630() 0 287 + #define soc_is_omap5430() 0 288 + 289 + /* These are needed for the common code */ 290 + #ifdef CONFIG_ARCH_OMAP2PLUS 291 + #define cpu_is_omap7xx() 0 292 + #define cpu_is_omap15xx() 0 293 + #define cpu_is_omap16xx() 0 294 + #define cpu_is_omap1510() 0 295 + #define cpu_is_omap1610() 0 296 + #define cpu_is_omap1611() 0 297 + #define cpu_is_omap1621() 0 298 + #define cpu_is_omap1710() 0 299 + #define cpu_class_is_omap1() 0 300 + #define cpu_class_is_omap2() 1 301 + #endif 302 + 303 + #if defined(CONFIG_ARCH_OMAP2) 304 + # undef cpu_is_omap2420 305 + # undef cpu_is_omap2422 306 + # undef cpu_is_omap2423 307 + # undef cpu_is_omap2430 308 + # define cpu_is_omap2420() is_omap2420() 309 + # define cpu_is_omap2422() is_omap2422() 310 + # define cpu_is_omap2423() is_omap2423() 311 + # define cpu_is_omap2430() is_omap2430() 312 + #endif 313 + 314 + #if defined(CONFIG_ARCH_OMAP3) 315 + # undef cpu_is_omap3430 316 + # undef cpu_is_ti81xx 317 + # undef cpu_is_ti816x 318 + # undef cpu_is_ti814x 319 + # undef soc_is_am35xx 320 + # define cpu_is_omap3430() is_omap3430() 321 + # undef cpu_is_omap3630 322 + # define cpu_is_omap3630() is_omap363x() 323 + # define cpu_is_ti81xx() is_ti81xx() 324 + # define cpu_is_ti816x() is_ti816x() 325 + # define cpu_is_ti814x() is_ti814x() 326 + # define soc_is_am35xx() is_am35xx() 327 + #endif 328 + 329 + # if defined(CONFIG_SOC_AM33XX) 330 + # undef soc_is_am33xx 331 + # undef soc_is_am335x 332 + # define soc_is_am33xx() is_am33xx() 333 + # define soc_is_am335x() is_am335x() 334 + #endif 335 + 336 + # if defined(CONFIG_ARCH_OMAP4) 337 + # undef cpu_is_omap44xx 338 + # undef cpu_is_omap443x 339 + # undef cpu_is_omap446x 340 + # undef cpu_is_omap447x 341 + # define cpu_is_omap44xx() is_omap44xx() 342 + # define cpu_is_omap443x() is_omap443x() 343 + # define cpu_is_omap446x() is_omap446x() 344 + # define cpu_is_omap447x() is_omap447x() 345 + # endif 346 + 347 + # if defined(CONFIG_SOC_OMAP5) 348 + # undef soc_is_omap54xx 349 + # undef soc_is_omap543x 350 + # define soc_is_omap54xx() is_omap54xx() 351 + # define soc_is_omap543x() is_omap543x() 352 + #endif 353 + 354 + /* Various silicon revisions for omap2 */ 355 + #define OMAP242X_CLASS 0x24200024 356 + #define OMAP2420_REV_ES1_0 OMAP242X_CLASS 357 + #define OMAP2420_REV_ES2_0 (OMAP242X_CLASS | (0x1 << 8)) 358 + 359 + #define OMAP243X_CLASS 0x24300024 360 + #define OMAP2430_REV_ES1_0 OMAP243X_CLASS 361 + 362 + #define OMAP343X_CLASS 0x34300034 363 + #define OMAP3430_REV_ES1_0 OMAP343X_CLASS 364 + #define OMAP3430_REV_ES2_0 (OMAP343X_CLASS | (0x1 << 8)) 365 + #define OMAP3430_REV_ES2_1 (OMAP343X_CLASS | (0x2 << 8)) 366 + #define OMAP3430_REV_ES3_0 (OMAP343X_CLASS | (0x3 << 8)) 367 + #define OMAP3430_REV_ES3_1 (OMAP343X_CLASS | (0x4 << 8)) 368 + #define OMAP3430_REV_ES3_1_2 (OMAP343X_CLASS | (0x5 << 8)) 369 + 370 + #define OMAP363X_CLASS 0x36300034 371 + #define OMAP3630_REV_ES1_0 OMAP363X_CLASS 372 + #define OMAP3630_REV_ES1_1 (OMAP363X_CLASS | (0x1 << 8)) 373 + #define OMAP3630_REV_ES1_2 (OMAP363X_CLASS | (0x2 << 8)) 374 + 375 + #define TI816X_CLASS 0x81600034 376 + #define TI8168_REV_ES1_0 TI816X_CLASS 377 + #define TI8168_REV_ES1_1 (TI816X_CLASS | (0x1 << 8)) 378 + 379 + #define TI814X_CLASS 0x81400034 380 + #define TI8148_REV_ES1_0 TI814X_CLASS 381 + #define TI8148_REV_ES2_0 (TI814X_CLASS | (0x1 << 8)) 382 + #define TI8148_REV_ES2_1 (TI814X_CLASS | (0x2 << 8)) 383 + 384 + #define AM35XX_CLASS 0x35170034 385 + #define AM35XX_REV_ES1_0 AM35XX_CLASS 386 + #define AM35XX_REV_ES1_1 (AM35XX_CLASS | (0x1 << 8)) 387 + 388 + #define AM335X_CLASS 0x33500033 389 + #define AM335X_REV_ES1_0 AM335X_CLASS 390 + 391 + #define OMAP443X_CLASS 0x44300044 392 + #define OMAP4430_REV_ES1_0 (OMAP443X_CLASS | (0x10 << 8)) 393 + #define OMAP4430_REV_ES2_0 (OMAP443X_CLASS | (0x20 << 8)) 394 + #define OMAP4430_REV_ES2_1 (OMAP443X_CLASS | (0x21 << 8)) 395 + #define OMAP4430_REV_ES2_2 (OMAP443X_CLASS | (0x22 << 8)) 396 + #define OMAP4430_REV_ES2_3 (OMAP443X_CLASS | (0x23 << 8)) 397 + 398 + #define OMAP446X_CLASS 0x44600044 399 + #define OMAP4460_REV_ES1_0 (OMAP446X_CLASS | (0x10 << 8)) 400 + #define OMAP4460_REV_ES1_1 (OMAP446X_CLASS | (0x11 << 8)) 401 + 402 + #define OMAP447X_CLASS 0x44700044 403 + #define OMAP4470_REV_ES1_0 (OMAP447X_CLASS | (0x10 << 8)) 404 + 405 + #define OMAP54XX_CLASS 0x54000054 406 + #define OMAP5430_REV_ES1_0 (OMAP54XX_CLASS | (0x30 << 16) | (0x10 << 8)) 407 + #define OMAP5432_REV_ES1_0 (OMAP54XX_CLASS | (0x32 << 16) | (0x10 << 8)) 408 + 409 + void omap2xxx_check_revision(void); 410 + void omap3xxx_check_revision(void); 411 + void omap4xxx_check_revision(void); 412 + void omap5xxx_check_revision(void); 413 + void omap3xxx_check_features(void); 414 + void ti81xx_check_features(void); 415 + void omap4xxx_check_features(void); 416 + 417 + /* 418 + * Runtime detection of OMAP3 features 419 + * 420 + * OMAP3_HAS_IO_CHAIN_CTRL: Some later members of the OMAP3 chip 421 + * family have OS-level control over the I/O chain clock. This is 422 + * to avoid a window during which wakeups could potentially be lost 423 + * during powerdomain transitions. If this bit is set, it 424 + * indicates that the chip does support OS-level control of this 425 + * feature. 426 + */ 427 + extern u32 omap_features; 428 + 429 + #define OMAP3_HAS_L2CACHE BIT(0) 430 + #define OMAP3_HAS_IVA BIT(1) 431 + #define OMAP3_HAS_SGX BIT(2) 432 + #define OMAP3_HAS_NEON BIT(3) 433 + #define OMAP3_HAS_ISP BIT(4) 434 + #define OMAP3_HAS_192MHZ_CLK BIT(5) 435 + #define OMAP3_HAS_IO_WAKEUP BIT(6) 436 + #define OMAP3_HAS_SDRC BIT(7) 437 + #define OMAP3_HAS_IO_CHAIN_CTRL BIT(8) 438 + #define OMAP4_HAS_MPU_1GHZ BIT(9) 439 + #define OMAP4_HAS_MPU_1_2GHZ BIT(10) 440 + #define OMAP4_HAS_MPU_1_5GHZ BIT(11) 441 + 442 + 443 + #define OMAP3_HAS_FEATURE(feat,flag) \ 444 + static inline unsigned int omap3_has_ ##feat(void) \ 445 + { \ 446 + return omap_features & OMAP3_HAS_ ##flag; \ 447 + } \ 448 + 449 + OMAP3_HAS_FEATURE(l2cache, L2CACHE) 450 + OMAP3_HAS_FEATURE(sgx, SGX) 451 + OMAP3_HAS_FEATURE(iva, IVA) 452 + OMAP3_HAS_FEATURE(neon, NEON) 453 + OMAP3_HAS_FEATURE(isp, ISP) 454 + OMAP3_HAS_FEATURE(192mhz_clk, 192MHZ_CLK) 455 + OMAP3_HAS_FEATURE(io_wakeup, IO_WAKEUP) 456 + OMAP3_HAS_FEATURE(sdrc, SDRC) 457 + OMAP3_HAS_FEATURE(io_chain_ctrl, IO_CHAIN_CTRL) 458 + 459 + /* 460 + * Runtime detection of OMAP4 features 461 + */ 462 + #define OMAP4_HAS_FEATURE(feat, flag) \ 463 + static inline unsigned int omap4_has_ ##feat(void) \ 464 + { \ 465 + return omap_features & OMAP4_HAS_ ##flag; \ 466 + } \ 467 + 468 + OMAP4_HAS_FEATURE(mpu_1ghz, MPU_1GHZ) 469 + OMAP4_HAS_FEATURE(mpu_1_2ghz, MPU_1_2GHZ) 470 + OMAP4_HAS_FEATURE(mpu_1_5ghz, MPU_1_5GHZ) 471 + 472 + #endif /* __ASSEMBLY__ */ 473 +
+2 -2
arch/arm/mach-omap2/sr_device.c
··· 23 23 #include <linux/slab.h> 24 24 #include <linux/io.h> 25 25 26 - #include <plat/omap_device.h> 27 - 26 + #include "soc.h" 27 + #include "omap_device.h" 28 28 #include "voltage.h" 29 29 #include "control.h" 30 30 #include "pm.h"
+305
arch/arm/mach-omap2/sram.c
··· 1 + /* 2 + * 3 + * OMAP SRAM detection and management 4 + * 5 + * Copyright (C) 2005 Nokia Corporation 6 + * Written by Tony Lindgren <tony@atomide.com> 7 + * 8 + * Copyright (C) 2009-2012 Texas Instruments 9 + * Added OMAP4/5 support - Santosh Shilimkar <santosh.shilimkar@ti.com> 10 + * 11 + * This program is free software; you can redistribute it and/or modify 12 + * it under the terms of the GNU General Public License version 2 as 13 + * published by the Free Software Foundation. 14 + */ 15 + 16 + #include <linux/module.h> 17 + #include <linux/kernel.h> 18 + #include <linux/init.h> 19 + #include <linux/io.h> 20 + 21 + #include <asm/fncpy.h> 22 + #include <asm/tlb.h> 23 + #include <asm/cacheflush.h> 24 + 25 + #include <asm/mach/map.h> 26 + 27 + #include "soc.h" 28 + #include "iomap.h" 29 + #include "prm2xxx_3xxx.h" 30 + #include "sdrc.h" 31 + #include "sram.h" 32 + 33 + #define OMAP2_SRAM_PUB_PA (OMAP2_SRAM_PA + 0xf800) 34 + #define OMAP3_SRAM_PUB_PA (OMAP3_SRAM_PA + 0x8000) 35 + #ifdef CONFIG_OMAP4_ERRATA_I688 36 + #define OMAP4_SRAM_PUB_PA OMAP4_SRAM_PA 37 + #else 38 + #define OMAP4_SRAM_PUB_PA (OMAP4_SRAM_PA + 0x4000) 39 + #endif 40 + #define OMAP5_SRAM_PA 0x40300000 41 + 42 + #define SRAM_BOOTLOADER_SZ 0x00 43 + 44 + #define OMAP24XX_VA_REQINFOPERM0 OMAP2_L3_IO_ADDRESS(0x68005048) 45 + #define OMAP24XX_VA_READPERM0 OMAP2_L3_IO_ADDRESS(0x68005050) 46 + #define OMAP24XX_VA_WRITEPERM0 OMAP2_L3_IO_ADDRESS(0x68005058) 47 + 48 + #define OMAP34XX_VA_REQINFOPERM0 OMAP2_L3_IO_ADDRESS(0x68012848) 49 + #define OMAP34XX_VA_READPERM0 OMAP2_L3_IO_ADDRESS(0x68012850) 50 + #define OMAP34XX_VA_WRITEPERM0 OMAP2_L3_IO_ADDRESS(0x68012858) 51 + #define OMAP34XX_VA_ADDR_MATCH2 OMAP2_L3_IO_ADDRESS(0x68012880) 52 + #define OMAP34XX_VA_SMS_RG_ATT0 OMAP2_L3_IO_ADDRESS(0x6C000048) 53 + 54 + #define GP_DEVICE 0x300 55 + 56 + #define ROUND_DOWN(value,boundary) ((value) & (~((boundary)-1))) 57 + 58 + static unsigned long omap_sram_start; 59 + static unsigned long omap_sram_skip; 60 + static unsigned long omap_sram_size; 61 + 62 + /* 63 + * Depending on the target RAMFS firewall setup, the public usable amount of 64 + * SRAM varies. The default accessible size for all device types is 2k. A GP 65 + * device allows ARM11 but not other initiators for full size. This 66 + * functionality seems ok until some nice security API happens. 67 + */ 68 + static int is_sram_locked(void) 69 + { 70 + if (OMAP2_DEVICE_TYPE_GP == omap_type()) { 71 + /* RAMFW: R/W access to all initiators for all qualifier sets */ 72 + if (cpu_is_omap242x()) { 73 + __raw_writel(0xFF, OMAP24XX_VA_REQINFOPERM0); /* all q-vects */ 74 + __raw_writel(0xCFDE, OMAP24XX_VA_READPERM0); /* all i-read */ 75 + __raw_writel(0xCFDE, OMAP24XX_VA_WRITEPERM0); /* all i-write */ 76 + } 77 + if (cpu_is_omap34xx()) { 78 + __raw_writel(0xFFFF, OMAP34XX_VA_REQINFOPERM0); /* all q-vects */ 79 + __raw_writel(0xFFFF, OMAP34XX_VA_READPERM0); /* all i-read */ 80 + __raw_writel(0xFFFF, OMAP34XX_VA_WRITEPERM0); /* all i-write */ 81 + __raw_writel(0x0, OMAP34XX_VA_ADDR_MATCH2); 82 + __raw_writel(0xFFFFFFFF, OMAP34XX_VA_SMS_RG_ATT0); 83 + } 84 + return 0; 85 + } else 86 + return 1; /* assume locked with no PPA or security driver */ 87 + } 88 + 89 + /* 90 + * The amount of SRAM depends on the core type. 91 + * Note that we cannot try to test for SRAM here because writes 92 + * to secure SRAM will hang the system. Also the SRAM is not 93 + * yet mapped at this point. 94 + */ 95 + static void __init omap_detect_sram(void) 96 + { 97 + omap_sram_skip = SRAM_BOOTLOADER_SZ; 98 + if (is_sram_locked()) { 99 + if (cpu_is_omap34xx()) { 100 + omap_sram_start = OMAP3_SRAM_PUB_PA; 101 + if ((omap_type() == OMAP2_DEVICE_TYPE_EMU) || 102 + (omap_type() == OMAP2_DEVICE_TYPE_SEC)) { 103 + omap_sram_size = 0x7000; /* 28K */ 104 + omap_sram_skip += SZ_16K; 105 + } else { 106 + omap_sram_size = 0x8000; /* 32K */ 107 + } 108 + } else if (cpu_is_omap44xx()) { 109 + omap_sram_start = OMAP4_SRAM_PUB_PA; 110 + omap_sram_size = 0xa000; /* 40K */ 111 + } else if (soc_is_omap54xx()) { 112 + omap_sram_start = OMAP5_SRAM_PA; 113 + omap_sram_size = SZ_128K; /* 128KB */ 114 + } else { 115 + omap_sram_start = OMAP2_SRAM_PUB_PA; 116 + omap_sram_size = 0x800; /* 2K */ 117 + } 118 + } else { 119 + if (soc_is_am33xx()) { 120 + omap_sram_start = AM33XX_SRAM_PA; 121 + omap_sram_size = 0x10000; /* 64K */ 122 + } else if (cpu_is_omap34xx()) { 123 + omap_sram_start = OMAP3_SRAM_PA; 124 + omap_sram_size = 0x10000; /* 64K */ 125 + } else if (cpu_is_omap44xx()) { 126 + omap_sram_start = OMAP4_SRAM_PA; 127 + omap_sram_size = 0xe000; /* 56K */ 128 + } else if (soc_is_omap54xx()) { 129 + omap_sram_start = OMAP5_SRAM_PA; 130 + omap_sram_size = SZ_128K; /* 128KB */ 131 + } else { 132 + omap_sram_start = OMAP2_SRAM_PA; 133 + if (cpu_is_omap242x()) 134 + omap_sram_size = 0xa0000; /* 640K */ 135 + else if (cpu_is_omap243x()) 136 + omap_sram_size = 0x10000; /* 64K */ 137 + } 138 + } 139 + } 140 + 141 + /* 142 + * Note that we cannot use ioremap for SRAM, as clock init needs SRAM early. 143 + */ 144 + static void __init omap2_map_sram(void) 145 + { 146 + int cached = 1; 147 + 148 + #ifdef CONFIG_OMAP4_ERRATA_I688 149 + if (cpu_is_omap44xx()) { 150 + omap_sram_start += PAGE_SIZE; 151 + omap_sram_size -= SZ_16K; 152 + } 153 + #endif 154 + if (cpu_is_omap34xx()) { 155 + /* 156 + * SRAM must be marked as non-cached on OMAP3 since the 157 + * CORE DPLL M2 divider change code (in SRAM) runs with the 158 + * SDRAM controller disabled, and if it is marked cached, 159 + * the ARM may attempt to write cache lines back to SDRAM 160 + * which will cause the system to hang. 161 + */ 162 + cached = 0; 163 + } 164 + 165 + omap_map_sram(omap_sram_start, omap_sram_size, 166 + omap_sram_skip, cached); 167 + } 168 + 169 + static void (*_omap2_sram_ddr_init)(u32 *slow_dll_ctrl, u32 fast_dll_ctrl, 170 + u32 base_cs, u32 force_unlock); 171 + 172 + void omap2_sram_ddr_init(u32 *slow_dll_ctrl, u32 fast_dll_ctrl, 173 + u32 base_cs, u32 force_unlock) 174 + { 175 + BUG_ON(!_omap2_sram_ddr_init); 176 + _omap2_sram_ddr_init(slow_dll_ctrl, fast_dll_ctrl, 177 + base_cs, force_unlock); 178 + } 179 + 180 + static void (*_omap2_sram_reprogram_sdrc)(u32 perf_level, u32 dll_val, 181 + u32 mem_type); 182 + 183 + void omap2_sram_reprogram_sdrc(u32 perf_level, u32 dll_val, u32 mem_type) 184 + { 185 + BUG_ON(!_omap2_sram_reprogram_sdrc); 186 + _omap2_sram_reprogram_sdrc(perf_level, dll_val, mem_type); 187 + } 188 + 189 + static u32 (*_omap2_set_prcm)(u32 dpll_ctrl_val, u32 sdrc_rfr_val, int bypass); 190 + 191 + u32 omap2_set_prcm(u32 dpll_ctrl_val, u32 sdrc_rfr_val, int bypass) 192 + { 193 + BUG_ON(!_omap2_set_prcm); 194 + return _omap2_set_prcm(dpll_ctrl_val, sdrc_rfr_val, bypass); 195 + } 196 + 197 + #ifdef CONFIG_SOC_OMAP2420 198 + static int __init omap242x_sram_init(void) 199 + { 200 + _omap2_sram_ddr_init = omap_sram_push(omap242x_sram_ddr_init, 201 + omap242x_sram_ddr_init_sz); 202 + 203 + _omap2_sram_reprogram_sdrc = omap_sram_push(omap242x_sram_reprogram_sdrc, 204 + omap242x_sram_reprogram_sdrc_sz); 205 + 206 + _omap2_set_prcm = omap_sram_push(omap242x_sram_set_prcm, 207 + omap242x_sram_set_prcm_sz); 208 + 209 + return 0; 210 + } 211 + #else 212 + static inline int omap242x_sram_init(void) 213 + { 214 + return 0; 215 + } 216 + #endif 217 + 218 + #ifdef CONFIG_SOC_OMAP2430 219 + static int __init omap243x_sram_init(void) 220 + { 221 + _omap2_sram_ddr_init = omap_sram_push(omap243x_sram_ddr_init, 222 + omap243x_sram_ddr_init_sz); 223 + 224 + _omap2_sram_reprogram_sdrc = omap_sram_push(omap243x_sram_reprogram_sdrc, 225 + omap243x_sram_reprogram_sdrc_sz); 226 + 227 + _omap2_set_prcm = omap_sram_push(omap243x_sram_set_prcm, 228 + omap243x_sram_set_prcm_sz); 229 + 230 + return 0; 231 + } 232 + #else 233 + static inline int omap243x_sram_init(void) 234 + { 235 + return 0; 236 + } 237 + #endif 238 + 239 + #ifdef CONFIG_ARCH_OMAP3 240 + 241 + static u32 (*_omap3_sram_configure_core_dpll)( 242 + u32 m2, u32 unlock_dll, u32 f, u32 inc, 243 + u32 sdrc_rfr_ctrl_0, u32 sdrc_actim_ctrl_a_0, 244 + u32 sdrc_actim_ctrl_b_0, u32 sdrc_mr_0, 245 + u32 sdrc_rfr_ctrl_1, u32 sdrc_actim_ctrl_a_1, 246 + u32 sdrc_actim_ctrl_b_1, u32 sdrc_mr_1); 247 + 248 + u32 omap3_configure_core_dpll(u32 m2, u32 unlock_dll, u32 f, u32 inc, 249 + u32 sdrc_rfr_ctrl_0, u32 sdrc_actim_ctrl_a_0, 250 + u32 sdrc_actim_ctrl_b_0, u32 sdrc_mr_0, 251 + u32 sdrc_rfr_ctrl_1, u32 sdrc_actim_ctrl_a_1, 252 + u32 sdrc_actim_ctrl_b_1, u32 sdrc_mr_1) 253 + { 254 + BUG_ON(!_omap3_sram_configure_core_dpll); 255 + return _omap3_sram_configure_core_dpll( 256 + m2, unlock_dll, f, inc, 257 + sdrc_rfr_ctrl_0, sdrc_actim_ctrl_a_0, 258 + sdrc_actim_ctrl_b_0, sdrc_mr_0, 259 + sdrc_rfr_ctrl_1, sdrc_actim_ctrl_a_1, 260 + sdrc_actim_ctrl_b_1, sdrc_mr_1); 261 + } 262 + 263 + void omap3_sram_restore_context(void) 264 + { 265 + omap_sram_reset(); 266 + 267 + _omap3_sram_configure_core_dpll = 268 + omap_sram_push(omap3_sram_configure_core_dpll, 269 + omap3_sram_configure_core_dpll_sz); 270 + omap_push_sram_idle(); 271 + } 272 + 273 + static inline int omap34xx_sram_init(void) 274 + { 275 + omap3_sram_restore_context(); 276 + return 0; 277 + } 278 + #else 279 + static inline int omap34xx_sram_init(void) 280 + { 281 + return 0; 282 + } 283 + #endif /* CONFIG_ARCH_OMAP3 */ 284 + 285 + static inline int am33xx_sram_init(void) 286 + { 287 + return 0; 288 + } 289 + 290 + int __init omap_sram_init(void) 291 + { 292 + omap_detect_sram(); 293 + omap2_map_sram(); 294 + 295 + if (cpu_is_omap242x()) 296 + omap242x_sram_init(); 297 + else if (cpu_is_omap2430()) 298 + omap243x_sram_init(); 299 + else if (soc_is_am33xx()) 300 + am33xx_sram_init(); 301 + else if (cpu_is_omap34xx()) 302 + omap34xx_sram_init(); 303 + 304 + return 0; 305 + }
+83
arch/arm/mach-omap2/sram.h
··· 1 + /* 2 + * Interface for functions that need to be run in internal SRAM 3 + * 4 + * This program is free software; you can redistribute it and/or modify 5 + * it under the terms of the GNU General Public License version 2 as 6 + * published by the Free Software Foundation. 7 + */ 8 + 9 + #ifndef __ASSEMBLY__ 10 + #include <plat/sram.h> 11 + 12 + extern void omap2_sram_ddr_init(u32 *slow_dll_ctrl, u32 fast_dll_ctrl, 13 + u32 base_cs, u32 force_unlock); 14 + extern void omap2_sram_reprogram_sdrc(u32 perf_level, u32 dll_val, 15 + u32 mem_type); 16 + extern u32 omap2_set_prcm(u32 dpll_ctrl_val, u32 sdrc_rfr_val, int bypass); 17 + 18 + extern u32 omap3_configure_core_dpll( 19 + u32 m2, u32 unlock_dll, u32 f, u32 inc, 20 + u32 sdrc_rfr_ctrl_0, u32 sdrc_actim_ctrl_a_0, 21 + u32 sdrc_actim_ctrl_b_0, u32 sdrc_mr_0, 22 + u32 sdrc_rfr_ctrl_1, u32 sdrc_actim_ctrl_a_1, 23 + u32 sdrc_actim_ctrl_b_1, u32 sdrc_mr_1); 24 + extern void omap3_sram_restore_context(void); 25 + 26 + /* Do not use these */ 27 + extern void omap24xx_sram_reprogram_clock(u32 ckctl, u32 dpllctl); 28 + extern unsigned long omap24xx_sram_reprogram_clock_sz; 29 + 30 + extern void omap242x_sram_ddr_init(u32 *slow_dll_ctrl, u32 fast_dll_ctrl, 31 + u32 base_cs, u32 force_unlock); 32 + extern unsigned long omap242x_sram_ddr_init_sz; 33 + 34 + extern u32 omap242x_sram_set_prcm(u32 dpll_ctrl_val, u32 sdrc_rfr_val, 35 + int bypass); 36 + extern unsigned long omap242x_sram_set_prcm_sz; 37 + 38 + extern void omap242x_sram_reprogram_sdrc(u32 perf_level, u32 dll_val, 39 + u32 mem_type); 40 + extern unsigned long omap242x_sram_reprogram_sdrc_sz; 41 + 42 + 43 + extern void omap243x_sram_ddr_init(u32 *slow_dll_ctrl, u32 fast_dll_ctrl, 44 + u32 base_cs, u32 force_unlock); 45 + extern unsigned long omap243x_sram_ddr_init_sz; 46 + 47 + extern u32 omap243x_sram_set_prcm(u32 dpll_ctrl_val, u32 sdrc_rfr_val, 48 + int bypass); 49 + extern unsigned long omap243x_sram_set_prcm_sz; 50 + 51 + extern void omap243x_sram_reprogram_sdrc(u32 perf_level, u32 dll_val, 52 + u32 mem_type); 53 + extern unsigned long omap243x_sram_reprogram_sdrc_sz; 54 + 55 + extern u32 omap3_sram_configure_core_dpll( 56 + u32 m2, u32 unlock_dll, u32 f, u32 inc, 57 + u32 sdrc_rfr_ctrl_0, u32 sdrc_actim_ctrl_a_0, 58 + u32 sdrc_actim_ctrl_b_0, u32 sdrc_mr_0, 59 + u32 sdrc_rfr_ctrl_1, u32 sdrc_actim_ctrl_a_1, 60 + u32 sdrc_actim_ctrl_b_1, u32 sdrc_mr_1); 61 + extern unsigned long omap3_sram_configure_core_dpll_sz; 62 + 63 + #ifdef CONFIG_PM 64 + extern void omap_push_sram_idle(void); 65 + #else 66 + static inline void omap_push_sram_idle(void) {} 67 + #endif /* CONFIG_PM */ 68 + 69 + #endif /* __ASSEMBLY__ */ 70 + 71 + /* 72 + * OMAP2+: define the SRAM PA addresses. 73 + * Used by the SRAM management code and the idle sleep code. 74 + */ 75 + #define OMAP2_SRAM_PA 0x40200000 76 + #define OMAP3_SRAM_PA 0x40200000 77 + #ifdef CONFIG_OMAP4_ERRATA_I688 78 + #define OMAP4_SRAM_PA 0x40304000 79 + #define OMAP4_SRAM_VA 0xfe404000 80 + #else 81 + #define OMAP4_SRAM_PA 0x40300000 82 + #endif 83 + #define AM33XX_SRAM_PA 0x40300000
+6 -3
arch/arm/mach-omap2/timer.c
··· 43 43 #include <asm/sched_clock.h> 44 44 45 45 #include <asm/arch_timer.h> 46 - #include <plat/omap_hwmod.h> 47 - #include <plat/omap_device.h> 46 + #include "omap_hwmod.h" 47 + #include "omap_device.h" 48 + #include <plat/counter-32k.h> 48 49 #include <plat/dmtimer.h> 49 - #include <plat/omap-pm.h> 50 + #include "omap-pm.h" 50 51 51 52 #include "soc.h" 52 53 #include "common.h" ··· 559 558 560 559 if (timer_dev_attr) 561 560 pdata->timer_capability = timer_dev_attr->timer_capability; 561 + 562 + pdata->get_context_loss_count = omap_pm_get_dev_context_loss_count; 562 563 563 564 pdev = omap_device_build(name, id, oh, pdata, sizeof(*pdata), 564 565 NULL, 0, 0);
-3
arch/arm/mach-omap2/twl-common.c
··· 26 26 #include <linux/regulator/machine.h> 27 27 #include <linux/regulator/fixed.h> 28 28 29 - #include <plat/i2c.h> 30 - #include <plat/usb.h> 31 - 32 29 #include "soc.h" 33 30 #include "twl-common.h" 34 31 #include "pm.h"
+3 -3
arch/arm/mach-omap2/usb-host.c
··· 25 25 26 26 #include <asm/io.h> 27 27 28 - #include <plat/usb.h> 29 - #include <plat/omap_device.h> 30 - 28 + #include "soc.h" 29 + #include "omap_device.h" 31 30 #include "mux.h" 31 + #include "usb.h" 32 32 33 33 #ifdef CONFIG_MFD_OMAP_USB_HOST 34 34
+3 -5
arch/arm/mach-omap2/usb-musb.c
··· 25 25 #include <linux/io.h> 26 26 #include <linux/usb/musb.h> 27 27 28 - #include <plat/usb.h> 29 - #include <plat/omap_device.h> 30 - 31 - #include "am35xx.h" 32 - 28 + #include "omap_device.h" 29 + #include "soc.h" 33 30 #include "mux.h" 31 + #include "usb.h" 34 32 35 33 static struct musb_hdrc_config musb_config = { 36 34 .multipoint = 1,
+2 -1
arch/arm/mach-omap2/usb-tusb6010.c
··· 15 15 #include <linux/platform_device.h> 16 16 #include <linux/gpio.h> 17 17 #include <linux/export.h> 18 + #include <linux/platform_data/usb-omap.h> 18 19 19 20 #include <linux/usb/musb.h> 20 21 21 - #include <plat/gpmc.h> 22 + #include "gpmc.h" 22 23 23 24 #include "mux.h" 24 25
+82
arch/arm/mach-omap2/usb.h
··· 1 + #include <linux/platform_data/usb-omap.h> 2 + 3 + /* AM35x */ 4 + /* USB 2.0 PHY Control */ 5 + #define CONF2_PHY_GPIOMODE (1 << 23) 6 + #define CONF2_OTGMODE (3 << 14) 7 + #define CONF2_NO_OVERRIDE (0 << 14) 8 + #define CONF2_FORCE_HOST (1 << 14) 9 + #define CONF2_FORCE_DEVICE (2 << 14) 10 + #define CONF2_FORCE_HOST_VBUS_LOW (3 << 14) 11 + #define CONF2_SESENDEN (1 << 13) 12 + #define CONF2_VBDTCTEN (1 << 12) 13 + #define CONF2_REFFREQ_24MHZ (2 << 8) 14 + #define CONF2_REFFREQ_26MHZ (7 << 8) 15 + #define CONF2_REFFREQ_13MHZ (6 << 8) 16 + #define CONF2_REFFREQ (0xf << 8) 17 + #define CONF2_PHYCLKGD (1 << 7) 18 + #define CONF2_VBUSSENSE (1 << 6) 19 + #define CONF2_PHY_PLLON (1 << 5) 20 + #define CONF2_RESET (1 << 4) 21 + #define CONF2_PHYPWRDN (1 << 3) 22 + #define CONF2_OTGPWRDN (1 << 2) 23 + #define CONF2_DATPOL (1 << 1) 24 + 25 + /* TI81XX specific definitions */ 26 + #define USBCTRL0 0x620 27 + #define USBSTAT0 0x624 28 + 29 + /* TI816X PHY controls bits */ 30 + #define TI816X_USBPHY0_NORMAL_MODE (1 << 0) 31 + #define TI816X_USBPHY_REFCLK_OSC (1 << 8) 32 + 33 + /* TI814X PHY controls bits */ 34 + #define USBPHY_CM_PWRDN (1 << 0) 35 + #define USBPHY_OTG_PWRDN (1 << 1) 36 + #define USBPHY_CHGDET_DIS (1 << 2) 37 + #define USBPHY_CHGDET_RSTRT (1 << 3) 38 + #define USBPHY_SRCONDM (1 << 4) 39 + #define USBPHY_SINKONDP (1 << 5) 40 + #define USBPHY_CHGISINK_EN (1 << 6) 41 + #define USBPHY_CHGVSRC_EN (1 << 7) 42 + #define USBPHY_DMPULLUP (1 << 8) 43 + #define USBPHY_DPPULLUP (1 << 9) 44 + #define USBPHY_CDET_EXTCTL (1 << 10) 45 + #define USBPHY_GPIO_MODE (1 << 12) 46 + #define USBPHY_DPOPBUFCTL (1 << 13) 47 + #define USBPHY_DMOPBUFCTL (1 << 14) 48 + #define USBPHY_DPINPUT (1 << 15) 49 + #define USBPHY_DMINPUT (1 << 16) 50 + #define USBPHY_DPGPIO_PD (1 << 17) 51 + #define USBPHY_DMGPIO_PD (1 << 18) 52 + #define USBPHY_OTGVDET_EN (1 << 19) 53 + #define USBPHY_OTGSESSEND_EN (1 << 20) 54 + #define USBPHY_DATA_POLARITY (1 << 23) 55 + 56 + struct usbhs_omap_board_data { 57 + enum usbhs_omap_port_mode port_mode[OMAP3_HS_USB_PORTS]; 58 + 59 + /* have to be valid if phy_reset is true and portx is in phy mode */ 60 + int reset_gpio_port[OMAP3_HS_USB_PORTS]; 61 + 62 + /* Set this to true for ES2.x silicon */ 63 + unsigned es2_compatibility:1; 64 + 65 + unsigned phy_reset:1; 66 + 67 + /* 68 + * Regulators for USB PHYs. 69 + * Each PHY can have a separate regulator. 70 + */ 71 + struct regulator *regulator[OMAP3_HS_USB_PORTS]; 72 + }; 73 + 74 + extern void usb_musb_init(struct omap_musb_board_data *board_data); 75 + extern void usbhs_init(const struct usbhs_omap_board_data *pdata); 76 + 77 + extern void am35x_musb_reset(void); 78 + extern void am35x_musb_phy_power(u8 on); 79 + extern void am35x_musb_clear_irq(void); 80 + extern void am35x_set_mode(u8 musb_mode); 81 + extern void ti81xx_musb_phy_power(u8 on); 82 +
+1 -1
arch/arm/mach-omap2/wd_timer.c
··· 11 11 #include <linux/io.h> 12 12 #include <linux/err.h> 13 13 14 - #include <plat/omap_hwmod.h> 14 + #include "omap_hwmod.h" 15 15 16 16 #include "wd_timer.h" 17 17 #include "common.h"
+1 -1
arch/arm/mach-omap2/wd_timer.h
··· 10 10 #ifndef __ARCH_ARM_MACH_OMAP2_WD_TIMER_H 11 11 #define __ARCH_ARM_MACH_OMAP2_WD_TIMER_H 12 12 13 - #include <plat/omap_hwmod.h> 13 + #include "omap_hwmod.h" 14 14 15 15 extern int omap2_wd_timer_disable(struct omap_hwmod *oh); 16 16 extern int omap2_wd_timer_reset(struct omap_hwmod *oh);
+1 -3
arch/arm/plat-omap/Makefile
··· 3 3 # 4 4 5 5 # Common support 6 - obj-y := common.o sram.o clock.o dma.o fb.o counter_32k.o 6 + obj-y := sram.o dma.o fb.o counter_32k.o 7 7 obj-m := 8 8 obj-n := 9 9 obj- := 10 10 11 11 # omap_device support (OMAP2+ only at the moment) 12 - obj-$(CONFIG_ARCH_OMAP2PLUS) += omap_device.o 13 12 14 13 obj-$(CONFIG_OMAP_DM_TIMER) += dmtimer.o 15 14 obj-$(CONFIG_OMAP_DEBUG_DEVICES) += debug-devices.o ··· 19 20 # OMAP mailbox framework 20 21 obj-$(CONFIG_OMAP_MBOX_FWK) += mailbox.o 21 22 22 - obj-$(CONFIG_OMAP_PM_NOOP) += omap-pm-noop.o
-544
arch/arm/plat-omap/clock.c
··· 1 - /* 2 - * linux/arch/arm/plat-omap/clock.c 3 - * 4 - * Copyright (C) 2004 - 2008 Nokia corporation 5 - * Written by Tuukka Tikkanen <tuukka.tikkanen@elektrobit.com> 6 - * 7 - * Modified for omap shared clock framework by Tony Lindgren <tony@atomide.com> 8 - * 9 - * This program is free software; you can redistribute it and/or modify 10 - * it under the terms of the GNU General Public License version 2 as 11 - * published by the Free Software Foundation. 12 - */ 13 - #include <linux/kernel.h> 14 - #include <linux/init.h> 15 - #include <linux/list.h> 16 - #include <linux/errno.h> 17 - #include <linux/export.h> 18 - #include <linux/err.h> 19 - #include <linux/string.h> 20 - #include <linux/clk.h> 21 - #include <linux/mutex.h> 22 - #include <linux/cpufreq.h> 23 - #include <linux/io.h> 24 - 25 - #include <plat/clock.h> 26 - 27 - static LIST_HEAD(clocks); 28 - static DEFINE_MUTEX(clocks_mutex); 29 - static DEFINE_SPINLOCK(clockfw_lock); 30 - 31 - static struct clk_functions *arch_clock; 32 - 33 - /* 34 - * Standard clock functions defined in include/linux/clk.h 35 - */ 36 - 37 - int clk_enable(struct clk *clk) 38 - { 39 - unsigned long flags; 40 - int ret; 41 - 42 - if (clk == NULL || IS_ERR(clk)) 43 - return -EINVAL; 44 - 45 - if (!arch_clock || !arch_clock->clk_enable) 46 - return -EINVAL; 47 - 48 - spin_lock_irqsave(&clockfw_lock, flags); 49 - ret = arch_clock->clk_enable(clk); 50 - spin_unlock_irqrestore(&clockfw_lock, flags); 51 - 52 - return ret; 53 - } 54 - EXPORT_SYMBOL(clk_enable); 55 - 56 - void clk_disable(struct clk *clk) 57 - { 58 - unsigned long flags; 59 - 60 - if (clk == NULL || IS_ERR(clk)) 61 - return; 62 - 63 - if (!arch_clock || !arch_clock->clk_disable) 64 - return; 65 - 66 - spin_lock_irqsave(&clockfw_lock, flags); 67 - if (clk->usecount == 0) { 68 - pr_err("Trying disable clock %s with 0 usecount\n", 69 - clk->name); 70 - WARN_ON(1); 71 - goto out; 72 - } 73 - 74 - arch_clock->clk_disable(clk); 75 - 76 - out: 77 - spin_unlock_irqrestore(&clockfw_lock, flags); 78 - } 79 - EXPORT_SYMBOL(clk_disable); 80 - 81 - unsigned long clk_get_rate(struct clk *clk) 82 - { 83 - unsigned long flags; 84 - unsigned long ret; 85 - 86 - if (clk == NULL || IS_ERR(clk)) 87 - return 0; 88 - 89 - spin_lock_irqsave(&clockfw_lock, flags); 90 - ret = clk->rate; 91 - spin_unlock_irqrestore(&clockfw_lock, flags); 92 - 93 - return ret; 94 - } 95 - EXPORT_SYMBOL(clk_get_rate); 96 - 97 - /* 98 - * Optional clock functions defined in include/linux/clk.h 99 - */ 100 - 101 - long clk_round_rate(struct clk *clk, unsigned long rate) 102 - { 103 - unsigned long flags; 104 - long ret; 105 - 106 - if (clk == NULL || IS_ERR(clk)) 107 - return 0; 108 - 109 - if (!arch_clock || !arch_clock->clk_round_rate) 110 - return 0; 111 - 112 - spin_lock_irqsave(&clockfw_lock, flags); 113 - ret = arch_clock->clk_round_rate(clk, rate); 114 - spin_unlock_irqrestore(&clockfw_lock, flags); 115 - 116 - return ret; 117 - } 118 - EXPORT_SYMBOL(clk_round_rate); 119 - 120 - int clk_set_rate(struct clk *clk, unsigned long rate) 121 - { 122 - unsigned long flags; 123 - int ret = -EINVAL; 124 - 125 - if (clk == NULL || IS_ERR(clk)) 126 - return ret; 127 - 128 - if (!arch_clock || !arch_clock->clk_set_rate) 129 - return ret; 130 - 131 - spin_lock_irqsave(&clockfw_lock, flags); 132 - ret = arch_clock->clk_set_rate(clk, rate); 133 - if (ret == 0) 134 - propagate_rate(clk); 135 - spin_unlock_irqrestore(&clockfw_lock, flags); 136 - 137 - return ret; 138 - } 139 - EXPORT_SYMBOL(clk_set_rate); 140 - 141 - int clk_set_parent(struct clk *clk, struct clk *parent) 142 - { 143 - unsigned long flags; 144 - int ret = -EINVAL; 145 - 146 - if (clk == NULL || IS_ERR(clk) || parent == NULL || IS_ERR(parent)) 147 - return ret; 148 - 149 - if (!arch_clock || !arch_clock->clk_set_parent) 150 - return ret; 151 - 152 - spin_lock_irqsave(&clockfw_lock, flags); 153 - if (clk->usecount == 0) { 154 - ret = arch_clock->clk_set_parent(clk, parent); 155 - if (ret == 0) 156 - propagate_rate(clk); 157 - } else 158 - ret = -EBUSY; 159 - spin_unlock_irqrestore(&clockfw_lock, flags); 160 - 161 - return ret; 162 - } 163 - EXPORT_SYMBOL(clk_set_parent); 164 - 165 - struct clk *clk_get_parent(struct clk *clk) 166 - { 167 - return clk->parent; 168 - } 169 - EXPORT_SYMBOL(clk_get_parent); 170 - 171 - /* 172 - * OMAP specific clock functions shared between omap1 and omap2 173 - */ 174 - 175 - int __initdata mpurate; 176 - 177 - /* 178 - * By default we use the rate set by the bootloader. 179 - * You can override this with mpurate= cmdline option. 180 - */ 181 - static int __init omap_clk_setup(char *str) 182 - { 183 - get_option(&str, &mpurate); 184 - 185 - if (!mpurate) 186 - return 1; 187 - 188 - if (mpurate < 1000) 189 - mpurate *= 1000000; 190 - 191 - return 1; 192 - } 193 - __setup("mpurate=", omap_clk_setup); 194 - 195 - /* Used for clocks that always have same value as the parent clock */ 196 - unsigned long followparent_recalc(struct clk *clk) 197 - { 198 - return clk->parent->rate; 199 - } 200 - 201 - /* 202 - * Used for clocks that have the same value as the parent clock, 203 - * divided by some factor 204 - */ 205 - unsigned long omap_fixed_divisor_recalc(struct clk *clk) 206 - { 207 - WARN_ON(!clk->fixed_div); 208 - 209 - return clk->parent->rate / clk->fixed_div; 210 - } 211 - 212 - void clk_reparent(struct clk *child, struct clk *parent) 213 - { 214 - list_del_init(&child->sibling); 215 - if (parent) 216 - list_add(&child->sibling, &parent->children); 217 - child->parent = parent; 218 - 219 - /* now do the debugfs renaming to reattach the child 220 - to the proper parent */ 221 - } 222 - 223 - /* Propagate rate to children */ 224 - void propagate_rate(struct clk *tclk) 225 - { 226 - struct clk *clkp; 227 - 228 - list_for_each_entry(clkp, &tclk->children, sibling) { 229 - if (clkp->recalc) 230 - clkp->rate = clkp->recalc(clkp); 231 - propagate_rate(clkp); 232 - } 233 - } 234 - 235 - static LIST_HEAD(root_clks); 236 - 237 - /** 238 - * recalculate_root_clocks - recalculate and propagate all root clocks 239 - * 240 - * Recalculates all root clocks (clocks with no parent), which if the 241 - * clock's .recalc is set correctly, should also propagate their rates. 242 - * Called at init. 243 - */ 244 - void recalculate_root_clocks(void) 245 - { 246 - struct clk *clkp; 247 - 248 - list_for_each_entry(clkp, &root_clks, sibling) { 249 - if (clkp->recalc) 250 - clkp->rate = clkp->recalc(clkp); 251 - propagate_rate(clkp); 252 - } 253 - } 254 - 255 - /** 256 - * clk_preinit - initialize any fields in the struct clk before clk init 257 - * @clk: struct clk * to initialize 258 - * 259 - * Initialize any struct clk fields needed before normal clk initialization 260 - * can run. No return value. 261 - */ 262 - void clk_preinit(struct clk *clk) 263 - { 264 - INIT_LIST_HEAD(&clk->children); 265 - } 266 - 267 - int clk_register(struct clk *clk) 268 - { 269 - if (clk == NULL || IS_ERR(clk)) 270 - return -EINVAL; 271 - 272 - /* 273 - * trap out already registered clocks 274 - */ 275 - if (clk->node.next || clk->node.prev) 276 - return 0; 277 - 278 - mutex_lock(&clocks_mutex); 279 - if (clk->parent) 280 - list_add(&clk->sibling, &clk->parent->children); 281 - else 282 - list_add(&clk->sibling, &root_clks); 283 - 284 - list_add(&clk->node, &clocks); 285 - if (clk->init) 286 - clk->init(clk); 287 - mutex_unlock(&clocks_mutex); 288 - 289 - return 0; 290 - } 291 - EXPORT_SYMBOL(clk_register); 292 - 293 - void clk_unregister(struct clk *clk) 294 - { 295 - if (clk == NULL || IS_ERR(clk)) 296 - return; 297 - 298 - mutex_lock(&clocks_mutex); 299 - list_del(&clk->sibling); 300 - list_del(&clk->node); 301 - mutex_unlock(&clocks_mutex); 302 - } 303 - EXPORT_SYMBOL(clk_unregister); 304 - 305 - void clk_enable_init_clocks(void) 306 - { 307 - struct clk *clkp; 308 - 309 - list_for_each_entry(clkp, &clocks, node) { 310 - if (clkp->flags & ENABLE_ON_INIT) 311 - clk_enable(clkp); 312 - } 313 - } 314 - 315 - int omap_clk_enable_autoidle_all(void) 316 - { 317 - struct clk *c; 318 - unsigned long flags; 319 - 320 - spin_lock_irqsave(&clockfw_lock, flags); 321 - 322 - list_for_each_entry(c, &clocks, node) 323 - if (c->ops->allow_idle) 324 - c->ops->allow_idle(c); 325 - 326 - spin_unlock_irqrestore(&clockfw_lock, flags); 327 - 328 - return 0; 329 - } 330 - 331 - int omap_clk_disable_autoidle_all(void) 332 - { 333 - struct clk *c; 334 - unsigned long flags; 335 - 336 - spin_lock_irqsave(&clockfw_lock, flags); 337 - 338 - list_for_each_entry(c, &clocks, node) 339 - if (c->ops->deny_idle) 340 - c->ops->deny_idle(c); 341 - 342 - spin_unlock_irqrestore(&clockfw_lock, flags); 343 - 344 - return 0; 345 - } 346 - 347 - /* 348 - * Low level helpers 349 - */ 350 - static int clkll_enable_null(struct clk *clk) 351 - { 352 - return 0; 353 - } 354 - 355 - static void clkll_disable_null(struct clk *clk) 356 - { 357 - } 358 - 359 - const struct clkops clkops_null = { 360 - .enable = clkll_enable_null, 361 - .disable = clkll_disable_null, 362 - }; 363 - 364 - /* 365 - * Dummy clock 366 - * 367 - * Used for clock aliases that are needed on some OMAPs, but not others 368 - */ 369 - struct clk dummy_ck = { 370 - .name = "dummy", 371 - .ops = &clkops_null, 372 - }; 373 - 374 - /* 375 - * 376 - */ 377 - 378 - #ifdef CONFIG_OMAP_RESET_CLOCKS 379 - /* 380 - * Disable any unused clocks left on by the bootloader 381 - */ 382 - static int __init clk_disable_unused(void) 383 - { 384 - struct clk *ck; 385 - unsigned long flags; 386 - 387 - if (!arch_clock || !arch_clock->clk_disable_unused) 388 - return 0; 389 - 390 - pr_info("clock: disabling unused clocks to save power\n"); 391 - 392 - spin_lock_irqsave(&clockfw_lock, flags); 393 - list_for_each_entry(ck, &clocks, node) { 394 - if (ck->ops == &clkops_null) 395 - continue; 396 - 397 - if (ck->usecount > 0 || !ck->enable_reg) 398 - continue; 399 - 400 - arch_clock->clk_disable_unused(ck); 401 - } 402 - spin_unlock_irqrestore(&clockfw_lock, flags); 403 - 404 - return 0; 405 - } 406 - late_initcall(clk_disable_unused); 407 - late_initcall(omap_clk_enable_autoidle_all); 408 - #endif 409 - 410 - int __init clk_init(struct clk_functions * custom_clocks) 411 - { 412 - if (!custom_clocks) { 413 - pr_err("No custom clock functions registered\n"); 414 - BUG(); 415 - } 416 - 417 - arch_clock = custom_clocks; 418 - 419 - return 0; 420 - } 421 - 422 - #if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS) 423 - /* 424 - * debugfs support to trace clock tree hierarchy and attributes 425 - */ 426 - 427 - #include <linux/debugfs.h> 428 - #include <linux/seq_file.h> 429 - 430 - static struct dentry *clk_debugfs_root; 431 - 432 - static int clk_dbg_show_summary(struct seq_file *s, void *unused) 433 - { 434 - struct clk *c; 435 - struct clk *pa; 436 - 437 - mutex_lock(&clocks_mutex); 438 - seq_printf(s, "%-30s %-30s %-10s %s\n", 439 - "clock-name", "parent-name", "rate", "use-count"); 440 - 441 - list_for_each_entry(c, &clocks, node) { 442 - pa = c->parent; 443 - seq_printf(s, "%-30s %-30s %-10lu %d\n", 444 - c->name, pa ? pa->name : "none", c->rate, c->usecount); 445 - } 446 - mutex_unlock(&clocks_mutex); 447 - 448 - return 0; 449 - } 450 - 451 - static int clk_dbg_open(struct inode *inode, struct file *file) 452 - { 453 - return single_open(file, clk_dbg_show_summary, inode->i_private); 454 - } 455 - 456 - static const struct file_operations debug_clock_fops = { 457 - .open = clk_dbg_open, 458 - .read = seq_read, 459 - .llseek = seq_lseek, 460 - .release = single_release, 461 - }; 462 - 463 - static int clk_debugfs_register_one(struct clk *c) 464 - { 465 - int err; 466 - struct dentry *d; 467 - struct clk *pa = c->parent; 468 - 469 - d = debugfs_create_dir(c->name, pa ? pa->dent : clk_debugfs_root); 470 - if (!d) 471 - return -ENOMEM; 472 - c->dent = d; 473 - 474 - d = debugfs_create_u8("usecount", S_IRUGO, c->dent, (u8 *)&c->usecount); 475 - if (!d) { 476 - err = -ENOMEM; 477 - goto err_out; 478 - } 479 - d = debugfs_create_u32("rate", S_IRUGO, c->dent, (u32 *)&c->rate); 480 - if (!d) { 481 - err = -ENOMEM; 482 - goto err_out; 483 - } 484 - d = debugfs_create_x32("flags", S_IRUGO, c->dent, (u32 *)&c->flags); 485 - if (!d) { 486 - err = -ENOMEM; 487 - goto err_out; 488 - } 489 - return 0; 490 - 491 - err_out: 492 - debugfs_remove_recursive(c->dent); 493 - return err; 494 - } 495 - 496 - static int clk_debugfs_register(struct clk *c) 497 - { 498 - int err; 499 - struct clk *pa = c->parent; 500 - 501 - if (pa && !pa->dent) { 502 - err = clk_debugfs_register(pa); 503 - if (err) 504 - return err; 505 - } 506 - 507 - if (!c->dent) { 508 - err = clk_debugfs_register_one(c); 509 - if (err) 510 - return err; 511 - } 512 - return 0; 513 - } 514 - 515 - static int __init clk_debugfs_init(void) 516 - { 517 - struct clk *c; 518 - struct dentry *d; 519 - int err; 520 - 521 - d = debugfs_create_dir("clock", NULL); 522 - if (!d) 523 - return -ENOMEM; 524 - clk_debugfs_root = d; 525 - 526 - list_for_each_entry(c, &clocks, node) { 527 - err = clk_debugfs_register(c); 528 - if (err) 529 - goto err_out; 530 - } 531 - 532 - d = debugfs_create_file("summary", S_IRUGO, 533 - d, NULL, &debug_clock_fops); 534 - if (!d) 535 - return -ENOMEM; 536 - 537 - return 0; 538 - err_out: 539 - debugfs_remove_recursive(clk_debugfs_root); 540 - return err; 541 - } 542 - late_initcall(clk_debugfs_init); 543 - 544 - #endif /* defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS) */
-48
arch/arm/plat-omap/common.c
··· 1 - /* 2 - * linux/arch/arm/plat-omap/common.c 3 - * 4 - * Code common to all OMAP machines. 5 - * The file is created by Tony Lindgren <tony@atomide.com> 6 - * 7 - * Copyright (C) 2009 Texas Instruments 8 - * Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com> 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 - #include <linux/kernel.h> 15 - #include <linux/init.h> 16 - #include <linux/io.h> 17 - #include <linux/dma-mapping.h> 18 - 19 - #include <plat/common.h> 20 - #include <plat/vram.h> 21 - #include <linux/platform_data/dsp-omap.h> 22 - #include <plat/dma.h> 23 - 24 - #include <plat/omap-secure.h> 25 - 26 - void __init omap_reserve(void) 27 - { 28 - omap_vram_reserve_sdram_memblock(); 29 - omap_dsp_reserve_sdram_memblock(); 30 - omap_secure_ram_reserve_memblock(); 31 - omap_barrier_reserve_memblock(); 32 - } 33 - 34 - void __init omap_init_consistent_dma_size(void) 35 - { 36 - #ifdef CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE 37 - init_consistent_dma_size(CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE << 20); 38 - #endif 39 - } 40 - 41 - /* 42 - * Stub function for OMAP2 so that common files 43 - * continue to build when custom builds are used 44 - */ 45 - int __weak omap_secure_ram_reserve_memblock(void) 46 - { 47 - return 0; 48 - }
-3
arch/arm/plat-omap/counter_32k.c
··· 22 22 #include <asm/mach/time.h> 23 23 #include <asm/sched_clock.h> 24 24 25 - #include <plat/common.h> 26 - #include <plat/clock.h> 27 - 28 25 /* OMAP2_32KSYNCNT_CR_OFF: offset of 32ksync counter register */ 29 26 #define OMAP2_32KSYNCNT_REV_OFF 0x0 30 27 #define OMAP2_32KSYNCNT_REV_SCHEME (0x3 << 30)
+1 -2
arch/arm/plat-omap/debug-devices.c
··· 15 15 #include <linux/io.h> 16 16 #include <linux/smc91x.h> 17 17 18 - #include <mach/hardware.h> 19 - #include "../mach-omap2/debug-devices.h" 18 + #include <plat/debug-devices.h> 20 19 21 20 /* Many OMAP development platforms reuse the same "debug board"; these 22 21 * platforms include H2, H3, H4, and Perseus2.
+20 -3
arch/arm/plat-omap/debug-leds.c
··· 17 17 #include <linux/platform_data/gpio-omap.h> 18 18 #include <linux/slab.h> 19 19 20 - #include <mach/hardware.h> 21 20 #include <asm/mach-types.h> 22 - 23 - #include <plat/fpga.h> 24 21 25 22 /* Many OMAP development platforms reuse the same "debug board"; these 26 23 * platforms include H2, H3, H4, and Perseus2. There are 16 LEDs on the 27 24 * debug board (all green), accessed through FPGA registers. 28 25 */ 26 + 27 + /* NOTE: most boards don't have a static mapping for the FPGA ... */ 28 + struct h2p2_dbg_fpga { 29 + /* offset 0x00 */ 30 + u16 smc91x[8]; 31 + /* offset 0x10 */ 32 + u16 fpga_rev; 33 + u16 board_rev; 34 + u16 gpio_outputs; 35 + u16 leds; 36 + /* offset 0x18 */ 37 + u16 misc_inputs; 38 + u16 lan_status; 39 + u16 lan_reset; 40 + u16 reserved0; 41 + /* offset 0x20 */ 42 + u16 ps2_data; 43 + u16 ps2_ctrl; 44 + /* plus also 4 rs232 ports ... */ 45 + }; 29 46 30 47 static struct h2p2_dbg_fpga __iomem *fpga; 31 48
+69 -67
arch/arm/plat-omap/dma.c
··· 36 36 #include <linux/slab.h> 37 37 #include <linux/delay.h> 38 38 39 - #include <plat/cpu.h> 40 - #include <plat/dma.h> 41 - #include <plat/tc.h> 39 + #include <plat-omap/dma-omap.h> 42 40 43 41 /* 44 42 * MAX_LOGICAL_DMA_CH_COUNT: the maximum number of logical DMA ··· 173 175 #define omap_writel(val, reg) do {} while (0) 174 176 #endif 175 177 178 + #ifdef CONFIG_ARCH_OMAP1 176 179 void omap_set_dma_priority(int lch, int dst_port, int priority) 177 180 { 178 181 unsigned long reg; 179 182 u32 l; 180 183 181 - if (cpu_class_is_omap1()) { 184 + if (dma_omap1()) { 182 185 switch (dst_port) { 183 186 case OMAP_DMA_PORT_OCP_T1: /* FFFECC00 */ 184 187 reg = OMAP_TC_OCPT1_PRIOR; ··· 202 203 l |= (priority & 0xf) << 8; 203 204 omap_writel(l, reg); 204 205 } 205 - 206 - if (cpu_class_is_omap2()) { 207 - u32 ccr; 208 - 209 - ccr = p->dma_read(CCR, lch); 210 - if (priority) 211 - ccr |= (1 << 6); 212 - else 213 - ccr &= ~(1 << 6); 214 - p->dma_write(ccr, CCR, lch); 215 - } 216 206 } 207 + #endif 208 + 209 + #ifdef CONFIG_ARCH_OMAP2PLUS 210 + void omap_set_dma_priority(int lch, int dst_port, int priority) 211 + { 212 + u32 ccr; 213 + 214 + ccr = p->dma_read(CCR, lch); 215 + if (priority) 216 + ccr |= (1 << 6); 217 + else 218 + ccr &= ~(1 << 6); 219 + p->dma_write(ccr, CCR, lch); 220 + } 221 + #endif 217 222 EXPORT_SYMBOL(omap_set_dma_priority); 218 223 219 224 void omap_set_dma_transfer_params(int lch, int data_type, int elem_count, ··· 231 228 l |= data_type; 232 229 p->dma_write(l, CSDP, lch); 233 230 234 - if (cpu_class_is_omap1()) { 231 + if (dma_omap1()) { 235 232 u16 ccr; 236 233 237 234 ccr = p->dma_read(CCR, lch); ··· 247 244 p->dma_write(ccr, CCR2, lch); 248 245 } 249 246 250 - if (cpu_class_is_omap2() && dma_trigger) { 247 + if (dma_omap2plus() && dma_trigger) { 251 248 u32 val; 252 249 253 250 val = p->dma_read(CCR, lch); ··· 287 284 { 288 285 BUG_ON(omap_dma_in_1510_mode()); 289 286 290 - if (cpu_class_is_omap1()) { 287 + if (dma_omap1()) { 291 288 u16 w; 292 289 293 290 w = p->dma_read(CCR2, lch); ··· 317 314 p->dma_write(w, LCH_CTRL, lch); 318 315 } 319 316 320 - if (cpu_class_is_omap2()) { 317 + if (dma_omap2plus()) { 321 318 u32 val; 322 319 323 320 val = p->dma_read(CCR, lch); ··· 345 342 346 343 void omap_set_dma_write_mode(int lch, enum omap_dma_write_mode mode) 347 344 { 348 - if (cpu_class_is_omap2()) { 345 + if (dma_omap2plus()) { 349 346 u32 csdp; 350 347 351 348 csdp = p->dma_read(CSDP, lch); ··· 358 355 359 356 void omap_set_dma_channel_mode(int lch, enum omap_dma_channel_mode mode) 360 357 { 361 - if (cpu_class_is_omap1() && !cpu_is_omap15xx()) { 358 + if (dma_omap1() && !dma_omap15xx()) { 362 359 u32 l; 363 360 364 361 l = p->dma_read(LCH_CTRL, lch); ··· 376 373 { 377 374 u32 l; 378 375 379 - if (cpu_class_is_omap1()) { 376 + if (dma_omap1()) { 380 377 u16 w; 381 378 382 379 w = p->dma_read(CSDP, lch); ··· 418 415 419 416 void omap_set_dma_src_index(int lch, int eidx, int fidx) 420 417 { 421 - if (cpu_class_is_omap2()) 418 + if (dma_omap2plus()) 422 419 return; 423 420 424 421 p->dma_write(eidx, CSEI, lch); ··· 450 447 case OMAP_DMA_DATA_BURST_DIS: 451 448 break; 452 449 case OMAP_DMA_DATA_BURST_4: 453 - if (cpu_class_is_omap2()) 450 + if (dma_omap2plus()) 454 451 burst = 0x1; 455 452 else 456 453 burst = 0x2; 457 454 break; 458 455 case OMAP_DMA_DATA_BURST_8: 459 - if (cpu_class_is_omap2()) { 456 + if (dma_omap2plus()) { 460 457 burst = 0x2; 461 458 break; 462 459 } ··· 466 463 * fall through 467 464 */ 468 465 case OMAP_DMA_DATA_BURST_16: 469 - if (cpu_class_is_omap2()) { 466 + if (dma_omap2plus()) { 470 467 burst = 0x3; 471 468 break; 472 469 } ··· 490 487 { 491 488 u32 l; 492 489 493 - if (cpu_class_is_omap1()) { 490 + if (dma_omap1()) { 494 491 l = p->dma_read(CSDP, lch); 495 492 l &= ~(0x1f << 9); 496 493 l |= dest_port << 9; ··· 511 508 512 509 void omap_set_dma_dest_index(int lch, int eidx, int fidx) 513 510 { 514 - if (cpu_class_is_omap2()) 511 + if (dma_omap2plus()) 515 512 return; 516 513 517 514 p->dma_write(eidx, CDEI, lch); ··· 543 540 case OMAP_DMA_DATA_BURST_DIS: 544 541 break; 545 542 case OMAP_DMA_DATA_BURST_4: 546 - if (cpu_class_is_omap2()) 543 + if (dma_omap2plus()) 547 544 burst = 0x1; 548 545 else 549 546 burst = 0x2; 550 547 break; 551 548 case OMAP_DMA_DATA_BURST_8: 552 - if (cpu_class_is_omap2()) 549 + if (dma_omap2plus()) 553 550 burst = 0x2; 554 551 else 555 552 burst = 0x3; 556 553 break; 557 554 case OMAP_DMA_DATA_BURST_16: 558 - if (cpu_class_is_omap2()) { 555 + if (dma_omap2plus()) { 559 556 burst = 0x3; 560 557 break; 561 558 } ··· 576 573 static inline void omap_enable_channel_irq(int lch) 577 574 { 578 575 /* Clear CSR */ 579 - if (cpu_class_is_omap1()) 576 + if (dma_omap1()) 580 577 p->dma_read(CSR, lch); 581 578 else 582 579 p->dma_write(OMAP2_DMA_CSR_CLEAR_MASK, CSR, lch); ··· 590 587 /* disable channel interrupts */ 591 588 p->dma_write(0, CICR, lch); 592 589 /* Clear CSR */ 593 - if (cpu_class_is_omap1()) 590 + if (dma_omap1()) 594 591 p->dma_read(CSR, lch); 595 592 else 596 593 p->dma_write(OMAP2_DMA_CSR_CLEAR_MASK, CSR, lch); ··· 614 611 615 612 l = p->dma_read(CLNK_CTRL, lch); 616 613 617 - if (cpu_class_is_omap1()) 614 + if (dma_omap1()) 618 615 l &= ~(1 << 14); 619 616 620 617 /* Set the ENABLE_LNK bits */ ··· 622 619 l = dma_chan[lch].next_lch | (1 << 15); 623 620 624 621 #ifndef CONFIG_ARCH_OMAP1 625 - if (cpu_class_is_omap2()) 622 + if (dma_omap2plus()) 626 623 if (dma_chan[lch].next_linked_ch != -1) 627 624 l = dma_chan[lch].next_linked_ch | (1 << 15); 628 625 #endif ··· 639 636 /* Disable interrupts */ 640 637 omap_disable_channel_irq(lch); 641 638 642 - if (cpu_class_is_omap1()) { 639 + if (dma_omap1()) { 643 640 /* Set the STOP_LNK bit */ 644 641 l |= 1 << 14; 645 642 } 646 643 647 - if (cpu_class_is_omap2()) { 644 + if (dma_omap2plus()) { 648 645 /* Clear the ENABLE_LNK bit */ 649 646 l &= ~(1 << 15); 650 647 } ··· 658 655 u32 val; 659 656 unsigned long flags; 660 657 661 - if (!cpu_class_is_omap2()) 658 + if (dma_omap1()) 662 659 return; 663 660 664 661 spin_lock_irqsave(&dma_chan_lock, flags); ··· 676 673 u32 val; 677 674 unsigned long flags; 678 675 679 - if (!cpu_class_is_omap2()) 676 + if (dma_omap1()) 680 677 return; 681 678 682 679 spin_lock_irqsave(&dma_chan_lock, flags); ··· 715 712 if (p->clear_lch_regs) 716 713 p->clear_lch_regs(free_ch); 717 714 718 - if (cpu_class_is_omap2()) 715 + if (dma_omap2plus()) 719 716 omap_clear_dma(free_ch); 720 717 721 718 spin_unlock_irqrestore(&dma_chan_lock, flags); ··· 726 723 chan->flags = 0; 727 724 728 725 #ifndef CONFIG_ARCH_OMAP1 729 - if (cpu_class_is_omap2()) { 726 + if (dma_omap2plus()) { 730 727 chan->chain_id = -1; 731 728 chan->next_linked_ch = -1; 732 729 } ··· 734 731 735 732 chan->enabled_irqs = OMAP_DMA_DROP_IRQ | OMAP_DMA_BLOCK_IRQ; 736 733 737 - if (cpu_class_is_omap1()) 734 + if (dma_omap1()) 738 735 chan->enabled_irqs |= OMAP1_DMA_TOUT_IRQ; 739 - else if (cpu_class_is_omap2()) 736 + else if (dma_omap2plus()) 740 737 chan->enabled_irqs |= OMAP2_DMA_MISALIGNED_ERR_IRQ | 741 738 OMAP2_DMA_TRANS_ERR_IRQ; 742 739 743 - if (cpu_is_omap16xx()) { 740 + if (dma_omap16xx()) { 744 741 /* If the sync device is set, configure it dynamically. */ 745 742 if (dev_id != 0) { 746 743 set_gdma_dev(free_ch + 1, dev_id); ··· 751 748 * id. 752 749 */ 753 750 p->dma_write(dev_id | (1 << 10), CCR, free_ch); 754 - } else if (cpu_is_omap7xx() || cpu_is_omap15xx()) { 751 + } else if (dma_omap1()) { 755 752 p->dma_write(dev_id, CCR, free_ch); 756 753 } 757 754 758 - if (cpu_class_is_omap2()) { 755 + if (dma_omap2plus()) { 759 756 omap_enable_channel_irq(free_ch); 760 757 omap2_enable_irq_lch(free_ch); 761 758 } ··· 777 774 } 778 775 779 776 /* Disable interrupt for logical channel */ 780 - if (cpu_class_is_omap2()) 777 + if (dma_omap2plus()) 781 778 omap2_disable_irq_lch(lch); 782 779 783 780 /* Disable all DMA interrupts for the channel. */ ··· 787 784 p->dma_write(0, CCR, lch); 788 785 789 786 /* Clear registers */ 790 - if (cpu_class_is_omap2()) 787 + if (dma_omap2plus()) 791 788 omap_clear_dma(lch); 792 789 793 790 spin_lock_irqsave(&dma_chan_lock, flags); ··· 813 810 { 814 811 u32 reg; 815 812 816 - if (!cpu_class_is_omap2()) { 813 + if (dma_omap1()) { 817 814 printk(KERN_ERR "FIXME: no %s on 15xx/16xx\n", __func__); 818 815 return; 819 816 } ··· 852 849 } 853 850 l = p->dma_read(CCR, lch); 854 851 l &= ~((1 << 6) | (1 << 26)); 855 - if (cpu_class_is_omap2() && !cpu_is_omap242x()) 852 + if (d->dev_caps & IS_RW_PRIORITY) 856 853 l |= ((read_prio & 0x1) << 6) | ((write_prio & 0x1) << 26); 857 854 else 858 855 l |= ((read_prio & 0x1) << 6); ··· 885 882 * The CPC/CDAC register needs to be initialized to zero 886 883 * before starting dma transfer. 887 884 */ 888 - if (cpu_is_omap15xx()) 885 + if (dma_omap15xx()) 889 886 p->dma_write(0, CPC, lch); 890 887 else 891 888 p->dma_write(0, CDAC, lch); ··· 1048 1045 { 1049 1046 dma_addr_t offset = 0; 1050 1047 1051 - if (cpu_is_omap15xx()) 1048 + if (dma_omap15xx()) 1052 1049 offset = p->dma_read(CPC, lch); 1053 1050 else 1054 1051 offset = p->dma_read(CSAC, lch); ··· 1056 1053 if (IS_DMA_ERRATA(DMA_ERRATA_3_3) && offset == 0) 1057 1054 offset = p->dma_read(CSAC, lch); 1058 1055 1059 - if (!cpu_is_omap15xx()) { 1056 + if (!dma_omap15xx()) { 1060 1057 /* 1061 1058 * CDAC == 0 indicates that the DMA transfer on the channel has 1062 1059 * not been started (no data has been transferred so far). ··· 1068 1065 offset = p->dma_read(CSSA, lch); 1069 1066 } 1070 1067 1071 - if (cpu_class_is_omap1()) 1068 + if (dma_omap1()) 1072 1069 offset |= (p->dma_read(CSSA, lch) & 0xFFFF0000); 1073 1070 1074 1071 return offset; ··· 1087 1084 { 1088 1085 dma_addr_t offset = 0; 1089 1086 1090 - if (cpu_is_omap15xx()) 1087 + if (dma_omap15xx()) 1091 1088 offset = p->dma_read(CPC, lch); 1092 1089 else 1093 1090 offset = p->dma_read(CDAC, lch); ··· 1096 1093 * omap 3.2/3.3 erratum: sometimes 0 is returned if CSAC/CDAC is 1097 1094 * read before the DMA controller finished disabling the channel. 1098 1095 */ 1099 - if (!cpu_is_omap15xx() && offset == 0) { 1096 + if (!dma_omap15xx() && offset == 0) { 1100 1097 offset = p->dma_read(CDAC, lch); 1101 1098 /* 1102 1099 * CDAC == 0 indicates that the DMA transfer on the channel has ··· 1107 1104 offset = p->dma_read(CDSA, lch); 1108 1105 } 1109 1106 1110 - if (cpu_class_is_omap1()) 1107 + if (dma_omap1()) 1111 1108 offset |= (p->dma_read(CDSA, lch) & 0xFFFF0000); 1112 1109 1113 1110 return offset; ··· 1124 1121 { 1125 1122 int lch; 1126 1123 1127 - if (cpu_class_is_omap1()) 1124 + if (dma_omap1()) 1128 1125 if (omap_lcd_dma_running()) 1129 1126 return 1; 1130 1127 ··· 2027 2024 dma_chan = d->chan; 2028 2025 enable_1510_mode = d->dev_caps & ENABLE_1510_MODE; 2029 2026 2030 - if (cpu_class_is_omap2()) { 2027 + if (dma_omap2plus()) { 2031 2028 dma_linked_lch = kzalloc(sizeof(struct dma_link_info) * 2032 2029 dma_lch_count, GFP_KERNEL); 2033 2030 if (!dma_linked_lch) { ··· 2039 2036 spin_lock_init(&dma_chan_lock); 2040 2037 for (ch = 0; ch < dma_chan_count; ch++) { 2041 2038 omap_clear_dma(ch); 2042 - if (cpu_class_is_omap2()) 2039 + if (dma_omap2plus()) 2043 2040 omap2_disable_irq_lch(ch); 2044 2041 2045 2042 dma_chan[ch].dev_id = -1; ··· 2048 2045 if (ch >= 6 && enable_1510_mode) 2049 2046 continue; 2050 2047 2051 - if (cpu_class_is_omap1()) { 2048 + if (dma_omap1()) { 2052 2049 /* 2053 2050 * request_irq() doesn't like dev_id (ie. ch) being 2054 2051 * zero, so we have to kludge around this. ··· 2073 2070 } 2074 2071 } 2075 2072 2076 - if (cpu_class_is_omap2() && !cpu_is_omap242x()) 2073 + if (d->dev_caps & IS_RW_PRIORITY) 2077 2074 omap_dma_set_global_params(DMA_DEFAULT_ARB_RATE, 2078 2075 DMA_DEFAULT_FIFO_DEPTH, 0); 2079 2076 2080 - if (cpu_class_is_omap2()) { 2077 + if (dma_omap2plus()) { 2081 2078 strcpy(irq_name, "0"); 2082 2079 dma_irq = platform_get_irq_byname(pdev, irq_name); 2083 2080 if (dma_irq < 0) { ··· 2092 2089 } 2093 2090 } 2094 2091 2095 - /* reserve dma channels 0 and 1 in high security devices */ 2096 - if (cpu_is_omap34xx() && 2097 - (omap_type() != OMAP2_DEVICE_TYPE_GP)) { 2092 + /* reserve dma channels 0 and 1 in high security devices on 34xx */ 2093 + if (d->dev_caps & HS_CHANNELS_RESERVED) { 2098 2094 pr_info("Reserving DMA channels 0 and 1 for HS ROM code\n"); 2099 2095 dma_chan[0].dev_id = 0; 2100 2096 dma_chan[1].dev_id = 1; ··· 2120 2118 { 2121 2119 int dma_irq; 2122 2120 2123 - if (cpu_class_is_omap2()) { 2121 + if (dma_omap2plus()) { 2124 2122 char irq_name[4]; 2125 2123 strcpy(irq_name, "0"); 2126 2124 dma_irq = platform_get_irq_byname(pdev, irq_name);
+11 -9
arch/arm/plat-omap/dmtimer.c
··· 42 42 #include <linux/pm_runtime.h> 43 43 44 44 #include <plat/dmtimer.h> 45 - #include <plat/omap-pm.h> 46 - 47 - #include <mach/hardware.h> 48 45 49 46 static u32 omap_reserved_systimers; 50 47 static LIST_HEAD(omap_timer_list); ··· 268 271 EXPORT_SYMBOL_GPL(omap_dm_timer_get_irq); 269 272 270 273 #if defined(CONFIG_ARCH_OMAP1) 271 - 274 + #include <mach/hardware.h> 272 275 /** 273 276 * omap_dm_timer_modify_idlect_mask - Check if any running timers use ARMXOR 274 277 * @inputmask: current value of idlect mask ··· 345 348 omap_dm_timer_enable(timer); 346 349 347 350 if (!(timer->capability & OMAP_TIMER_ALWON)) { 348 - if (omap_pm_get_dev_context_loss_count(&timer->pdev->dev) != 351 + if (timer->get_context_loss_count && 352 + timer->get_context_loss_count(&timer->pdev->dev) != 349 353 timer->ctx_loss_count) 350 354 omap_timer_restore_context(timer); 351 355 } ··· 375 377 376 378 __omap_dm_timer_stop(timer, timer->posted, rate); 377 379 378 - if (!(timer->capability & OMAP_TIMER_ALWON)) 379 - timer->ctx_loss_count = 380 - omap_pm_get_dev_context_loss_count(&timer->pdev->dev); 380 + if (!(timer->capability & OMAP_TIMER_ALWON)) { 381 + if (timer->get_context_loss_count) 382 + timer->ctx_loss_count = 383 + timer->get_context_loss_count(&timer->pdev->dev); 384 + } 381 385 382 386 /* 383 387 * Since the register values are computed and written within ··· 495 495 omap_dm_timer_enable(timer); 496 496 497 497 if (!(timer->capability & OMAP_TIMER_ALWON)) { 498 - if (omap_pm_get_dev_context_loss_count(&timer->pdev->dev) != 498 + if (timer->get_context_loss_count && 499 + timer->get_context_loss_count(&timer->pdev->dev) != 499 500 timer->ctx_loss_count) 500 501 omap_timer_restore_context(timer); 501 502 } ··· 730 729 timer->reserved = omap_dm_timer_reserved_systimer(timer->id); 731 730 timer->pdev = pdev; 732 731 timer->capability = pdata->timer_capability; 732 + timer->get_context_loss_count = pdata->get_context_loss_count; 733 733 734 734 /* Skip pm_runtime_enable for OMAP1 */ 735 735 if (!(timer->capability & OMAP_TIMER_NEEDS_RESET)) {
+61 -1
arch/arm/plat-omap/fb.c
··· 30 30 #include <linux/io.h> 31 31 #include <linux/omapfb.h> 32 32 33 - #include <mach/hardware.h> 34 33 #include <asm/mach/map.h> 34 + 35 + #include <plat/cpu.h> 36 + 37 + #ifdef CONFIG_OMAP2_VRFB 38 + 39 + /* 40 + * The first memory resource is the register region for VRFB, 41 + * the rest are VRFB virtual memory areas for each VRFB context. 42 + */ 43 + 44 + static const struct resource omap2_vrfb_resources[] = { 45 + DEFINE_RES_MEM_NAMED(0x68008000u, 0x40, "vrfb-regs"), 46 + DEFINE_RES_MEM_NAMED(0x70000000u, 0x4000000, "vrfb-area-0"), 47 + DEFINE_RES_MEM_NAMED(0x74000000u, 0x4000000, "vrfb-area-1"), 48 + DEFINE_RES_MEM_NAMED(0x78000000u, 0x4000000, "vrfb-area-2"), 49 + DEFINE_RES_MEM_NAMED(0x7c000000u, 0x4000000, "vrfb-area-3"), 50 + }; 51 + 52 + static const struct resource omap3_vrfb_resources[] = { 53 + DEFINE_RES_MEM_NAMED(0x6C000180u, 0xc0, "vrfb-regs"), 54 + DEFINE_RES_MEM_NAMED(0x70000000u, 0x4000000, "vrfb-area-0"), 55 + DEFINE_RES_MEM_NAMED(0x74000000u, 0x4000000, "vrfb-area-1"), 56 + DEFINE_RES_MEM_NAMED(0x78000000u, 0x4000000, "vrfb-area-2"), 57 + DEFINE_RES_MEM_NAMED(0x7c000000u, 0x4000000, "vrfb-area-3"), 58 + DEFINE_RES_MEM_NAMED(0xe0000000u, 0x4000000, "vrfb-area-4"), 59 + DEFINE_RES_MEM_NAMED(0xe4000000u, 0x4000000, "vrfb-area-5"), 60 + DEFINE_RES_MEM_NAMED(0xe8000000u, 0x4000000, "vrfb-area-6"), 61 + DEFINE_RES_MEM_NAMED(0xec000000u, 0x4000000, "vrfb-area-7"), 62 + DEFINE_RES_MEM_NAMED(0xf0000000u, 0x4000000, "vrfb-area-8"), 63 + DEFINE_RES_MEM_NAMED(0xf4000000u, 0x4000000, "vrfb-area-9"), 64 + DEFINE_RES_MEM_NAMED(0xf8000000u, 0x4000000, "vrfb-area-10"), 65 + DEFINE_RES_MEM_NAMED(0xfc000000u, 0x4000000, "vrfb-area-11"), 66 + }; 67 + 68 + static int __init omap_init_vrfb(void) 69 + { 70 + struct platform_device *pdev; 71 + const struct resource *res; 72 + unsigned int num_res; 73 + 74 + if (cpu_is_omap24xx()) { 75 + res = omap2_vrfb_resources; 76 + num_res = ARRAY_SIZE(omap2_vrfb_resources); 77 + } else if (cpu_is_omap34xx()) { 78 + res = omap3_vrfb_resources; 79 + num_res = ARRAY_SIZE(omap3_vrfb_resources); 80 + } else { 81 + return 0; 82 + } 83 + 84 + pdev = platform_device_register_resndata(NULL, "omapvrfb", -1, 85 + res, num_res, NULL, 0); 86 + 87 + if (IS_ERR(pdev)) 88 + return PTR_ERR(pdev); 89 + else 90 + return 0; 91 + } 92 + 93 + arch_initcall(omap_init_vrfb); 94 + #endif 35 95 36 96 #if defined(CONFIG_FB_OMAP) || defined(CONFIG_FB_OMAP_MODULE) 37 97
+6 -149
arch/arm/plat-omap/i2c.c
··· 26 26 #include <linux/kernel.h> 27 27 #include <linux/platform_device.h> 28 28 #include <linux/i2c.h> 29 + #include <linux/i2c-omap.h> 29 30 #include <linux/slab.h> 30 31 #include <linux/err.h> 31 32 #include <linux/clk.h> 32 33 33 - #include <mach/irqs.h> 34 34 #include <plat/i2c.h> 35 - #include <plat/omap_device.h> 36 35 37 - #define OMAP_I2C_SIZE 0x3f 38 - #define OMAP1_I2C_BASE 0xfffb3800 39 - #define OMAP1_INT_I2C (32 + 4) 40 - 41 - static const char name[] = "omap_i2c"; 42 - 43 - #define I2C_RESOURCE_BUILDER(base, irq) \ 44 - { \ 45 - .start = (base), \ 46 - .end = (base) + OMAP_I2C_SIZE, \ 47 - .flags = IORESOURCE_MEM, \ 48 - }, \ 49 - { \ 50 - .start = (irq), \ 51 - .flags = IORESOURCE_IRQ, \ 52 - }, 53 - 54 - static struct resource i2c_resources[][2] = { 55 - { I2C_RESOURCE_BUILDER(0, 0) }, 56 - }; 57 - 58 - #define I2C_DEV_BUILDER(bus_id, res, data) \ 59 - { \ 60 - .id = (bus_id), \ 61 - .name = name, \ 62 - .num_resources = ARRAY_SIZE(res), \ 63 - .resource = (res), \ 64 - .dev = { \ 65 - .platform_data = (data), \ 66 - }, \ 67 - } 68 - 69 - #define MAX_OMAP_I2C_HWMOD_NAME_LEN 16 70 36 #define OMAP_I2C_MAX_CONTROLLERS 4 71 37 static struct omap_i2c_bus_platform_data i2c_pdata[OMAP_I2C_MAX_CONTROLLERS]; 72 - static struct platform_device omap_i2c_devices[] = { 73 - I2C_DEV_BUILDER(1, i2c_resources[0], &i2c_pdata[0]), 74 - }; 75 38 76 39 #define OMAP_I2C_CMDLINE_SETUP (BIT(31)) 77 - 78 - static int __init omap_i2c_nr_ports(void) 79 - { 80 - int ports = 0; 81 - 82 - if (cpu_class_is_omap1()) 83 - ports = 1; 84 - else if (cpu_is_omap24xx()) 85 - ports = 2; 86 - else if (cpu_is_omap34xx()) 87 - ports = 3; 88 - else if (cpu_is_omap44xx()) 89 - ports = 4; 90 - 91 - return ports; 92 - } 93 - 94 - static inline int omap1_i2c_add_bus(int bus_id) 95 - { 96 - struct platform_device *pdev; 97 - struct omap_i2c_bus_platform_data *pdata; 98 - struct resource *res; 99 - 100 - omap1_i2c_mux_pins(bus_id); 101 - 102 - pdev = &omap_i2c_devices[bus_id - 1]; 103 - res = pdev->resource; 104 - res[0].start = OMAP1_I2C_BASE; 105 - res[0].end = res[0].start + OMAP_I2C_SIZE; 106 - res[1].start = OMAP1_INT_I2C; 107 - pdata = &i2c_pdata[bus_id - 1]; 108 - 109 - /* all OMAP1 have IP version 1 register set */ 110 - pdata->rev = OMAP_I2C_IP_VERSION_1; 111 - 112 - /* all OMAP1 I2C are implemented like this */ 113 - pdata->flags = OMAP_I2C_FLAG_NO_FIFO | 114 - OMAP_I2C_FLAG_SIMPLE_CLOCK | 115 - OMAP_I2C_FLAG_16BIT_DATA_REG | 116 - OMAP_I2C_FLAG_ALWAYS_ARMXOR_CLK; 117 - 118 - /* how the cpu bus is wired up differs for 7xx only */ 119 - 120 - if (cpu_is_omap7xx()) 121 - pdata->flags |= OMAP_I2C_FLAG_BUS_SHIFT_1; 122 - else 123 - pdata->flags |= OMAP_I2C_FLAG_BUS_SHIFT_2; 124 - 125 - return platform_device_register(pdev); 126 - } 127 - 128 - 129 - #ifdef CONFIG_ARCH_OMAP2PLUS 130 - static inline int omap2_i2c_add_bus(int bus_id) 131 - { 132 - int l; 133 - struct omap_hwmod *oh; 134 - struct platform_device *pdev; 135 - char oh_name[MAX_OMAP_I2C_HWMOD_NAME_LEN]; 136 - struct omap_i2c_bus_platform_data *pdata; 137 - struct omap_i2c_dev_attr *dev_attr; 138 - 139 - omap2_i2c_mux_pins(bus_id); 140 - 141 - l = snprintf(oh_name, MAX_OMAP_I2C_HWMOD_NAME_LEN, "i2c%d", bus_id); 142 - WARN(l >= MAX_OMAP_I2C_HWMOD_NAME_LEN, 143 - "String buffer overflow in I2C%d device setup\n", bus_id); 144 - oh = omap_hwmod_lookup(oh_name); 145 - if (!oh) { 146 - pr_err("Could not look up %s\n", oh_name); 147 - return -EEXIST; 148 - } 149 - 150 - pdata = &i2c_pdata[bus_id - 1]; 151 - /* 152 - * pass the hwmod class's CPU-specific knowledge of I2C IP revision in 153 - * use, and functionality implementation flags, up to the OMAP I2C 154 - * driver via platform data 155 - */ 156 - pdata->rev = oh->class->rev; 157 - 158 - dev_attr = (struct omap_i2c_dev_attr *)oh->dev_attr; 159 - pdata->flags = dev_attr->flags; 160 - 161 - pdev = omap_device_build(name, bus_id, oh, pdata, 162 - sizeof(struct omap_i2c_bus_platform_data), 163 - NULL, 0, 0); 164 - WARN(IS_ERR(pdev), "Could not build omap_device for %s\n", name); 165 - 166 - return PTR_RET(pdev); 167 - } 168 - #else 169 - static inline int omap2_i2c_add_bus(int bus_id) 170 - { 171 - return 0; 172 - } 173 - #endif 174 - 175 - static int __init omap_i2c_add_bus(int bus_id) 176 - { 177 - if (cpu_class_is_omap1()) 178 - return omap1_i2c_add_bus(bus_id); 179 - else 180 - return omap2_i2c_add_bus(bus_id); 181 - } 182 40 183 41 /** 184 42 * omap_i2c_bus_setup - Process command line options for the I2C bus speed ··· 51 193 */ 52 194 static int __init omap_i2c_bus_setup(char *str) 53 195 { 54 - int ports; 55 196 int ints[3]; 56 197 57 - ports = omap_i2c_nr_ports(); 58 198 get_options(str, 3, ints); 59 - if (ints[0] < 2 || ints[1] < 1 || ints[1] > ports) 199 + if (ints[0] < 2 || ints[1] < 1 || 200 + ints[1] > OMAP_I2C_MAX_CONTROLLERS) 60 201 return 0; 61 202 i2c_pdata[ints[1] - 1].clkrate = ints[2]; 62 203 i2c_pdata[ints[1] - 1].clkrate |= OMAP_I2C_CMDLINE_SETUP; ··· 75 218 for (i = 0; i < ARRAY_SIZE(i2c_pdata); i++) 76 219 if (i2c_pdata[i].clkrate & OMAP_I2C_CMDLINE_SETUP) { 77 220 i2c_pdata[i].clkrate &= ~OMAP_I2C_CMDLINE_SETUP; 78 - err = omap_i2c_add_bus(i + 1); 221 + err = omap_i2c_add_bus(&i2c_pdata[i], i + 1); 79 222 if (err) 80 223 goto out; 81 224 } ··· 100 243 { 101 244 int err; 102 245 103 - BUG_ON(bus_id < 1 || bus_id > omap_i2c_nr_ports()); 246 + BUG_ON(bus_id < 1 || bus_id > OMAP_I2C_MAX_CONTROLLERS); 104 247 105 248 if (info) { 106 249 err = i2c_register_board_info(bus_id, info, len); ··· 113 256 114 257 i2c_pdata[bus_id - 1].clkrate &= ~OMAP_I2C_CMDLINE_SETUP; 115 258 116 - return omap_i2c_add_bus(bus_id); 259 + return omap_i2c_add_bus(&i2c_pdata[bus_id - 1], bus_id); 117 260 }
-51
arch/arm/plat-omap/include/plat/clkdev_omap.h
··· 1 - /* 2 - * clkdev <-> OMAP integration 3 - * 4 - * Russell King <linux@arm.linux.org.uk> 5 - * 6 - */ 7 - 8 - #ifndef __ARCH_ARM_PLAT_OMAP_INCLUDE_PLAT_CLKDEV_OMAP_H 9 - #define __ARCH_ARM_PLAT_OMAP_INCLUDE_PLAT_CLKDEV_OMAP_H 10 - 11 - #include <linux/clkdev.h> 12 - 13 - struct omap_clk { 14 - u16 cpu; 15 - struct clk_lookup lk; 16 - }; 17 - 18 - #define CLK(dev, con, ck, cp) \ 19 - { \ 20 - .cpu = cp, \ 21 - .lk = { \ 22 - .dev_id = dev, \ 23 - .con_id = con, \ 24 - .clk = ck, \ 25 - }, \ 26 - } 27 - 28 - /* Platform flags for the clkdev-OMAP integration code */ 29 - #define CK_310 (1 << 0) 30 - #define CK_7XX (1 << 1) /* 7xx, 850 */ 31 - #define CK_1510 (1 << 2) 32 - #define CK_16XX (1 << 3) /* 16xx, 17xx, 5912 */ 33 - #define CK_242X (1 << 4) 34 - #define CK_243X (1 << 5) /* 243x, 253x */ 35 - #define CK_3430ES1 (1 << 6) /* 34xxES1 only */ 36 - #define CK_3430ES2PLUS (1 << 7) /* 34xxES2, ES3, non-Sitara 35xx only */ 37 - #define CK_AM35XX (1 << 9) /* Sitara AM35xx */ 38 - #define CK_36XX (1 << 10) /* 36xx/37xx-specific clocks */ 39 - #define CK_443X (1 << 11) 40 - #define CK_TI816X (1 << 12) 41 - #define CK_446X (1 << 13) 42 - #define CK_AM33XX (1 << 14) /* AM33xx specific clocks */ 43 - #define CK_1710 (1 << 15) /* 1710 extra for rate selection */ 44 - 45 - 46 - #define CK_34XX (CK_3430ES1 | CK_3430ES2PLUS) 47 - #define CK_3XXX (CK_34XX | CK_AM35XX | CK_36XX) 48 - 49 - 50 - #endif 51 -
-309
arch/arm/plat-omap/include/plat/clock.h
··· 1 - /* 2 - * OMAP clock: data structure definitions, function prototypes, shared macros 3 - * 4 - * Copyright (C) 2004-2005, 2008-2010 Nokia Corporation 5 - * Written by Tuukka Tikkanen <tuukka.tikkanen@elektrobit.com> 6 - * Based on clocks.h by Tony Lindgren, Gordon McNutt and RidgeRun, Inc 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 - #ifndef __ARCH_ARM_OMAP_CLOCK_H 14 - #define __ARCH_ARM_OMAP_CLOCK_H 15 - 16 - #include <linux/list.h> 17 - 18 - struct module; 19 - struct clk; 20 - struct clockdomain; 21 - 22 - /* Temporary, needed during the common clock framework conversion */ 23 - #define __clk_get_name(clk) (clk->name) 24 - #define __clk_get_parent(clk) (clk->parent) 25 - #define __clk_get_rate(clk) (clk->rate) 26 - 27 - /** 28 - * struct clkops - some clock function pointers 29 - * @enable: fn ptr that enables the current clock in hardware 30 - * @disable: fn ptr that enables the current clock in hardware 31 - * @find_idlest: function returning the IDLEST register for the clock's IP blk 32 - * @find_companion: function returning the "companion" clk reg for the clock 33 - * @allow_idle: fn ptr that enables autoidle for the current clock in hardware 34 - * @deny_idle: fn ptr that disables autoidle for the current clock in hardware 35 - * 36 - * A "companion" clk is an accompanying clock to the one being queried 37 - * that must be enabled for the IP module connected to the clock to 38 - * become accessible by the hardware. Neither @find_idlest nor 39 - * @find_companion should be needed; that information is IP 40 - * block-specific; the hwmod code has been created to handle this, but 41 - * until hwmod data is ready and drivers have been converted to use PM 42 - * runtime calls in place of clk_enable()/clk_disable(), @find_idlest and 43 - * @find_companion must, unfortunately, remain. 44 - */ 45 - struct clkops { 46 - int (*enable)(struct clk *); 47 - void (*disable)(struct clk *); 48 - void (*find_idlest)(struct clk *, void __iomem **, 49 - u8 *, u8 *); 50 - void (*find_companion)(struct clk *, void __iomem **, 51 - u8 *); 52 - void (*allow_idle)(struct clk *); 53 - void (*deny_idle)(struct clk *); 54 - }; 55 - 56 - #ifdef CONFIG_ARCH_OMAP2PLUS 57 - 58 - /* struct clksel_rate.flags possibilities */ 59 - #define RATE_IN_242X (1 << 0) 60 - #define RATE_IN_243X (1 << 1) 61 - #define RATE_IN_3430ES1 (1 << 2) /* 3430ES1 rates only */ 62 - #define RATE_IN_3430ES2PLUS (1 << 3) /* 3430 ES >= 2 rates only */ 63 - #define RATE_IN_36XX (1 << 4) 64 - #define RATE_IN_4430 (1 << 5) 65 - #define RATE_IN_TI816X (1 << 6) 66 - #define RATE_IN_4460 (1 << 7) 67 - #define RATE_IN_AM33XX (1 << 8) 68 - #define RATE_IN_TI814X (1 << 9) 69 - 70 - #define RATE_IN_24XX (RATE_IN_242X | RATE_IN_243X) 71 - #define RATE_IN_34XX (RATE_IN_3430ES1 | RATE_IN_3430ES2PLUS) 72 - #define RATE_IN_3XXX (RATE_IN_34XX | RATE_IN_36XX) 73 - #define RATE_IN_44XX (RATE_IN_4430 | RATE_IN_4460) 74 - 75 - /* RATE_IN_3430ES2PLUS_36XX includes 34xx/35xx with ES >=2, and all 36xx/37xx */ 76 - #define RATE_IN_3430ES2PLUS_36XX (RATE_IN_3430ES2PLUS | RATE_IN_36XX) 77 - 78 - 79 - /** 80 - * struct clksel_rate - register bitfield values corresponding to clk divisors 81 - * @val: register bitfield value (shifted to bit 0) 82 - * @div: clock divisor corresponding to @val 83 - * @flags: (see "struct clksel_rate.flags possibilities" above) 84 - * 85 - * @val should match the value of a read from struct clk.clksel_reg 86 - * AND'ed with struct clk.clksel_mask, shifted right to bit 0. 87 - * 88 - * @div is the divisor that should be applied to the parent clock's rate 89 - * to produce the current clock's rate. 90 - */ 91 - struct clksel_rate { 92 - u32 val; 93 - u8 div; 94 - u16 flags; 95 - }; 96 - 97 - /** 98 - * struct clksel - available parent clocks, and a pointer to their divisors 99 - * @parent: struct clk * to a possible parent clock 100 - * @rates: available divisors for this parent clock 101 - * 102 - * A struct clksel is always associated with one or more struct clks 103 - * and one or more struct clksel_rates. 104 - */ 105 - struct clksel { 106 - struct clk *parent; 107 - const struct clksel_rate *rates; 108 - }; 109 - 110 - /** 111 - * struct dpll_data - DPLL registers and integration data 112 - * @mult_div1_reg: register containing the DPLL M and N bitfields 113 - * @mult_mask: mask of the DPLL M bitfield in @mult_div1_reg 114 - * @div1_mask: mask of the DPLL N bitfield in @mult_div1_reg 115 - * @clk_bypass: struct clk pointer to the clock's bypass clock input 116 - * @clk_ref: struct clk pointer to the clock's reference clock input 117 - * @control_reg: register containing the DPLL mode bitfield 118 - * @enable_mask: mask of the DPLL mode bitfield in @control_reg 119 - * @last_rounded_rate: cache of the last rate result of omap2_dpll_round_rate() 120 - * @last_rounded_m: cache of the last M result of omap2_dpll_round_rate() 121 - * @max_multiplier: maximum valid non-bypass multiplier value (actual) 122 - * @last_rounded_n: cache of the last N result of omap2_dpll_round_rate() 123 - * @min_divider: minimum valid non-bypass divider value (actual) 124 - * @max_divider: maximum valid non-bypass divider value (actual) 125 - * @modes: possible values of @enable_mask 126 - * @autoidle_reg: register containing the DPLL autoidle mode bitfield 127 - * @idlest_reg: register containing the DPLL idle status bitfield 128 - * @autoidle_mask: mask of the DPLL autoidle mode bitfield in @autoidle_reg 129 - * @freqsel_mask: mask of the DPLL jitter correction bitfield in @control_reg 130 - * @idlest_mask: mask of the DPLL idle status bitfield in @idlest_reg 131 - * @auto_recal_bit: bitshift of the driftguard enable bit in @control_reg 132 - * @recal_en_bit: bitshift of the PRM_IRQENABLE_* bit for recalibration IRQs 133 - * @recal_st_bit: bitshift of the PRM_IRQSTATUS_* bit for recalibration IRQs 134 - * @flags: DPLL type/features (see below) 135 - * 136 - * Possible values for @flags: 137 - * DPLL_J_TYPE: "J-type DPLL" (only some 36xx, 4xxx DPLLs) 138 - * 139 - * @freqsel_mask is only used on the OMAP34xx family and AM35xx. 140 - * 141 - * XXX Some DPLLs have multiple bypass inputs, so it's not technically 142 - * correct to only have one @clk_bypass pointer. 143 - * 144 - * XXX The runtime-variable fields (@last_rounded_rate, @last_rounded_m, 145 - * @last_rounded_n) should be separated from the runtime-fixed fields 146 - * and placed into a different structure, so that the runtime-fixed data 147 - * can be placed into read-only space. 148 - */ 149 - struct dpll_data { 150 - void __iomem *mult_div1_reg; 151 - u32 mult_mask; 152 - u32 div1_mask; 153 - struct clk *clk_bypass; 154 - struct clk *clk_ref; 155 - void __iomem *control_reg; 156 - u32 enable_mask; 157 - unsigned long last_rounded_rate; 158 - u16 last_rounded_m; 159 - u16 max_multiplier; 160 - u8 last_rounded_n; 161 - u8 min_divider; 162 - u16 max_divider; 163 - u8 modes; 164 - void __iomem *autoidle_reg; 165 - void __iomem *idlest_reg; 166 - u32 autoidle_mask; 167 - u32 freqsel_mask; 168 - u32 idlest_mask; 169 - u32 dco_mask; 170 - u32 sddiv_mask; 171 - u8 auto_recal_bit; 172 - u8 recal_en_bit; 173 - u8 recal_st_bit; 174 - u8 flags; 175 - }; 176 - 177 - #endif 178 - 179 - /* 180 - * struct clk.flags possibilities 181 - * 182 - * XXX document the rest of the clock flags here 183 - * 184 - * CLOCK_CLKOUTX2: (OMAP4 only) DPLL CLKOUT and CLKOUTX2 GATE_CTRL 185 - * bits share the same register. This flag allows the 186 - * omap4_dpllmx*() code to determine which GATE_CTRL bit field 187 - * should be used. This is a temporary solution - a better approach 188 - * would be to associate clock type-specific data with the clock, 189 - * similar to the struct dpll_data approach. 190 - */ 191 - #define ENABLE_REG_32BIT (1 << 0) /* Use 32-bit access */ 192 - #define CLOCK_IDLE_CONTROL (1 << 1) 193 - #define CLOCK_NO_IDLE_PARENT (1 << 2) 194 - #define ENABLE_ON_INIT (1 << 3) /* Enable upon framework init */ 195 - #define INVERT_ENABLE (1 << 4) /* 0 enables, 1 disables */ 196 - #define CLOCK_CLKOUTX2 (1 << 5) 197 - 198 - /** 199 - * struct clk - OMAP struct clk 200 - * @node: list_head connecting this clock into the full clock list 201 - * @ops: struct clkops * for this clock 202 - * @name: the name of the clock in the hardware (used in hwmod data and debug) 203 - * @parent: pointer to this clock's parent struct clk 204 - * @children: list_head connecting to the child clks' @sibling list_heads 205 - * @sibling: list_head connecting this clk to its parent clk's @children 206 - * @rate: current clock rate 207 - * @enable_reg: register to write to enable the clock (see @enable_bit) 208 - * @recalc: fn ptr that returns the clock's current rate 209 - * @set_rate: fn ptr that can change the clock's current rate 210 - * @round_rate: fn ptr that can round the clock's current rate 211 - * @init: fn ptr to do clock-specific initialization 212 - * @enable_bit: bitshift to write to enable/disable the clock (see @enable_reg) 213 - * @usecount: number of users that have requested this clock to be enabled 214 - * @fixed_div: when > 0, this clock's rate is its parent's rate / @fixed_div 215 - * @flags: see "struct clk.flags possibilities" above 216 - * @clksel_reg: for clksel clks, register va containing src/divisor select 217 - * @clksel_mask: bitmask in @clksel_reg for the src/divisor selector 218 - * @clksel: for clksel clks, pointer to struct clksel for this clock 219 - * @dpll_data: for DPLLs, pointer to struct dpll_data for this clock 220 - * @clkdm_name: clockdomain name that this clock is contained in 221 - * @clkdm: pointer to struct clockdomain, resolved from @clkdm_name at runtime 222 - * @rate_offset: bitshift for rate selection bitfield (OMAP1 only) 223 - * @src_offset: bitshift for source selection bitfield (OMAP1 only) 224 - * 225 - * XXX @rate_offset, @src_offset should probably be removed and OMAP1 226 - * clock code converted to use clksel. 227 - * 228 - * XXX @usecount is poorly named. It should be "enable_count" or 229 - * something similar. "users" in the description refers to kernel 230 - * code (core code or drivers) that have called clk_enable() and not 231 - * yet called clk_disable(); the usecount of parent clocks is also 232 - * incremented by the clock code when clk_enable() is called on child 233 - * clocks and decremented by the clock code when clk_disable() is 234 - * called on child clocks. 235 - * 236 - * XXX @clkdm, @usecount, @children, @sibling should be marked for 237 - * internal use only. 238 - * 239 - * @children and @sibling are used to optimize parent-to-child clock 240 - * tree traversals. (child-to-parent traversals use @parent.) 241 - * 242 - * XXX The notion of the clock's current rate probably needs to be 243 - * separated from the clock's target rate. 244 - */ 245 - struct clk { 246 - struct list_head node; 247 - const struct clkops *ops; 248 - const char *name; 249 - struct clk *parent; 250 - struct list_head children; 251 - struct list_head sibling; /* node for children */ 252 - unsigned long rate; 253 - void __iomem *enable_reg; 254 - unsigned long (*recalc)(struct clk *); 255 - int (*set_rate)(struct clk *, unsigned long); 256 - long (*round_rate)(struct clk *, unsigned long); 257 - void (*init)(struct clk *); 258 - u8 enable_bit; 259 - s8 usecount; 260 - u8 fixed_div; 261 - u8 flags; 262 - #ifdef CONFIG_ARCH_OMAP2PLUS 263 - void __iomem *clksel_reg; 264 - u32 clksel_mask; 265 - const struct clksel *clksel; 266 - struct dpll_data *dpll_data; 267 - const char *clkdm_name; 268 - struct clockdomain *clkdm; 269 - #else 270 - u8 rate_offset; 271 - u8 src_offset; 272 - #endif 273 - #if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS) 274 - struct dentry *dent; /* For visible tree hierarchy */ 275 - #endif 276 - }; 277 - 278 - struct clk_functions { 279 - int (*clk_enable)(struct clk *clk); 280 - void (*clk_disable)(struct clk *clk); 281 - long (*clk_round_rate)(struct clk *clk, unsigned long rate); 282 - int (*clk_set_rate)(struct clk *clk, unsigned long rate); 283 - int (*clk_set_parent)(struct clk *clk, struct clk *parent); 284 - void (*clk_allow_idle)(struct clk *clk); 285 - void (*clk_deny_idle)(struct clk *clk); 286 - void (*clk_disable_unused)(struct clk *clk); 287 - }; 288 - 289 - extern int mpurate; 290 - 291 - extern int clk_init(struct clk_functions *custom_clocks); 292 - extern void clk_preinit(struct clk *clk); 293 - extern int clk_register(struct clk *clk); 294 - extern void clk_reparent(struct clk *child, struct clk *parent); 295 - extern void clk_unregister(struct clk *clk); 296 - extern void propagate_rate(struct clk *clk); 297 - extern void recalculate_root_clocks(void); 298 - extern unsigned long followparent_recalc(struct clk *clk); 299 - extern void clk_enable_init_clocks(void); 300 - unsigned long omap_fixed_divisor_recalc(struct clk *clk); 301 - extern struct clk *omap_clk_get_by_name(const char *name); 302 - extern int omap_clk_enable_autoidle_all(void); 303 - extern int omap_clk_disable_autoidle_all(void); 304 - 305 - extern const struct clkops clkops_null; 306 - 307 - extern struct clk dummy_ck; 308 - 309 - #endif
-42
arch/arm/plat-omap/include/plat/common.h
··· 1 - /* 2 - * arch/arm/plat-omap/include/mach/common.h 3 - * 4 - * Header for code common to all OMAP machines. 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 - 27 - #ifndef __ARCH_ARM_MACH_OMAP_COMMON_H 28 - #define __ARCH_ARM_MACH_OMAP_COMMON_H 29 - 30 - #include <plat/i2c.h> 31 - #include <plat/omap_hwmod.h> 32 - 33 - extern int __init omap_init_clocksource_32k(void __iomem *vbase); 34 - 35 - extern void __init omap_check_revision(void); 36 - 37 - extern void omap_reserve(void); 38 - extern int omap_dss_reset(struct omap_hwmod *); 39 - 40 - void omap_sram_init(void); 41 - 42 - #endif /* __ARCH_ARM_MACH_OMAP_COMMON_H */
+1
arch/arm/plat-omap/include/plat/counter-32k.h
··· 1 + int omap_init_clocksource_32k(void __iomem *vbase);
+4 -464
arch/arm/plat-omap/include/plat/cpu.h
··· 1 1 /* 2 - * arch/arm/plat-omap/include/mach/cpu.h 3 - * 4 2 * OMAP cpu type detection 5 3 * 6 4 * Copyright (C) 2004, 2008 Nokia Corporation ··· 28 30 #ifndef __ASM_ARCH_OMAP_CPU_H 29 31 #define __ASM_ARCH_OMAP_CPU_H 30 32 31 - #ifndef __ASSEMBLY__ 32 - 33 - #include <linux/bitops.h> 34 - #include <plat/multi.h> 35 - 36 - /* 37 - * Omap device type i.e. EMU/HS/TST/GP/BAD 38 - */ 39 - #define OMAP2_DEVICE_TYPE_TEST 0 40 - #define OMAP2_DEVICE_TYPE_EMU 1 41 - #define OMAP2_DEVICE_TYPE_SEC 2 42 - #define OMAP2_DEVICE_TYPE_GP 3 43 - #define OMAP2_DEVICE_TYPE_BAD 4 44 - 45 - int omap_type(void); 46 - 47 - /* 48 - * omap_rev bits: 49 - * CPU id bits (0730, 1510, 1710, 2422...) [31:16] 50 - * CPU revision (See _REV_ defined in cpu.h) [15:08] 51 - * CPU class bits (15xx, 16xx, 24xx, 34xx...) [07:00] 52 - */ 53 - unsigned int omap_rev(void); 54 - 55 - /* 56 - * Get the CPU revision for OMAP devices 57 - */ 58 - #define GET_OMAP_REVISION() ((omap_rev() >> 8) & 0xff) 59 - 60 - /* 61 - * Macros to group OMAP into cpu classes. 62 - * These can be used in most places. 63 - * cpu_is_omap7xx(): True for OMAP730, OMAP850 64 - * cpu_is_omap15xx(): True for OMAP1510, OMAP5910 and OMAP310 65 - * cpu_is_omap16xx(): True for OMAP1610, OMAP5912 and OMAP1710 66 - * cpu_is_omap24xx(): True for OMAP2420, OMAP2422, OMAP2423, OMAP2430 67 - * cpu_is_omap242x(): True for OMAP2420, OMAP2422, OMAP2423 68 - * cpu_is_omap243x(): True for OMAP2430 69 - * cpu_is_omap343x(): True for OMAP3430 70 - * cpu_is_omap443x(): True for OMAP4430 71 - * cpu_is_omap446x(): True for OMAP4460 72 - * cpu_is_omap447x(): True for OMAP4470 73 - * soc_is_omap543x(): True for OMAP5430, OMAP5432 74 - */ 75 - #define GET_OMAP_CLASS (omap_rev() & 0xff) 76 - 77 - #define IS_OMAP_CLASS(class, id) \ 78 - static inline int is_omap ##class (void) \ 79 - { \ 80 - return (GET_OMAP_CLASS == (id)) ? 1 : 0; \ 81 - } 82 - 83 - #define GET_AM_CLASS ((omap_rev() >> 24) & 0xff) 84 - 85 - #define IS_AM_CLASS(class, id) \ 86 - static inline int is_am ##class (void) \ 87 - { \ 88 - return (GET_AM_CLASS == (id)) ? 1 : 0; \ 89 - } 90 - 91 - #define GET_TI_CLASS ((omap_rev() >> 24) & 0xff) 92 - 93 - #define IS_TI_CLASS(class, id) \ 94 - static inline int is_ti ##class (void) \ 95 - { \ 96 - return (GET_TI_CLASS == (id)) ? 1 : 0; \ 97 - } 98 - 99 - #define GET_OMAP_SUBCLASS ((omap_rev() >> 20) & 0x0fff) 100 - 101 - #define IS_OMAP_SUBCLASS(subclass, id) \ 102 - static inline int is_omap ##subclass (void) \ 103 - { \ 104 - return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0; \ 105 - } 106 - 107 - #define IS_TI_SUBCLASS(subclass, id) \ 108 - static inline int is_ti ##subclass (void) \ 109 - { \ 110 - return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0; \ 111 - } 112 - 113 - #define IS_AM_SUBCLASS(subclass, id) \ 114 - static inline int is_am ##subclass (void) \ 115 - { \ 116 - return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0; \ 117 - } 118 - 119 - IS_OMAP_CLASS(7xx, 0x07) 120 - IS_OMAP_CLASS(15xx, 0x15) 121 - IS_OMAP_CLASS(16xx, 0x16) 122 - IS_OMAP_CLASS(24xx, 0x24) 123 - IS_OMAP_CLASS(34xx, 0x34) 124 - IS_OMAP_CLASS(44xx, 0x44) 125 - IS_AM_CLASS(35xx, 0x35) 126 - IS_OMAP_CLASS(54xx, 0x54) 127 - IS_AM_CLASS(33xx, 0x33) 128 - 129 - IS_TI_CLASS(81xx, 0x81) 130 - 131 - IS_OMAP_SUBCLASS(242x, 0x242) 132 - IS_OMAP_SUBCLASS(243x, 0x243) 133 - IS_OMAP_SUBCLASS(343x, 0x343) 134 - IS_OMAP_SUBCLASS(363x, 0x363) 135 - IS_OMAP_SUBCLASS(443x, 0x443) 136 - IS_OMAP_SUBCLASS(446x, 0x446) 137 - IS_OMAP_SUBCLASS(447x, 0x447) 138 - IS_OMAP_SUBCLASS(543x, 0x543) 139 - 140 - IS_TI_SUBCLASS(816x, 0x816) 141 - IS_TI_SUBCLASS(814x, 0x814) 142 - IS_AM_SUBCLASS(335x, 0x335) 143 - 144 - #define cpu_is_omap7xx() 0 145 - #define cpu_is_omap15xx() 0 146 - #define cpu_is_omap16xx() 0 147 - #define cpu_is_omap24xx() 0 148 - #define cpu_is_omap242x() 0 149 - #define cpu_is_omap243x() 0 150 - #define cpu_is_omap34xx() 0 151 - #define cpu_is_omap343x() 0 152 - #define cpu_is_ti81xx() 0 153 - #define cpu_is_ti816x() 0 154 - #define cpu_is_ti814x() 0 155 - #define soc_is_am35xx() 0 156 - #define soc_is_am33xx() 0 157 - #define soc_is_am335x() 0 158 - #define cpu_is_omap44xx() 0 159 - #define cpu_is_omap443x() 0 160 - #define cpu_is_omap446x() 0 161 - #define cpu_is_omap447x() 0 162 - #define soc_is_omap54xx() 0 163 - #define soc_is_omap543x() 0 164 - 165 - #if defined(MULTI_OMAP1) 166 - # if defined(CONFIG_ARCH_OMAP730) 167 - # undef cpu_is_omap7xx 168 - # define cpu_is_omap7xx() is_omap7xx() 169 - # endif 170 - # if defined(CONFIG_ARCH_OMAP850) 171 - # undef cpu_is_omap7xx 172 - # define cpu_is_omap7xx() is_omap7xx() 173 - # endif 174 - # if defined(CONFIG_ARCH_OMAP15XX) 175 - # undef cpu_is_omap15xx 176 - # define cpu_is_omap15xx() is_omap15xx() 177 - # endif 178 - # if defined(CONFIG_ARCH_OMAP16XX) 179 - # undef cpu_is_omap16xx 180 - # define cpu_is_omap16xx() is_omap16xx() 181 - # endif 182 - #else 183 - # if defined(CONFIG_ARCH_OMAP730) 184 - # undef cpu_is_omap7xx 185 - # define cpu_is_omap7xx() 1 186 - # endif 187 - # if defined(CONFIG_ARCH_OMAP850) 188 - # undef cpu_is_omap7xx 189 - # define cpu_is_omap7xx() 1 190 - # endif 191 - # if defined(CONFIG_ARCH_OMAP15XX) 192 - # undef cpu_is_omap15xx 193 - # define cpu_is_omap15xx() 1 194 - # endif 195 - # if defined(CONFIG_ARCH_OMAP16XX) 196 - # undef cpu_is_omap16xx 197 - # define cpu_is_omap16xx() 1 198 - # endif 33 + #ifdef CONFIG_ARCH_OMAP1 34 + #include <mach/soc.h> 199 35 #endif 200 36 201 - #if defined(MULTI_OMAP2) 202 - # if defined(CONFIG_ARCH_OMAP2) 203 - # undef cpu_is_omap24xx 204 - # define cpu_is_omap24xx() is_omap24xx() 205 - # endif 206 - # if defined (CONFIG_SOC_OMAP2420) 207 - # undef cpu_is_omap242x 208 - # define cpu_is_omap242x() is_omap242x() 209 - # endif 210 - # if defined (CONFIG_SOC_OMAP2430) 211 - # undef cpu_is_omap243x 212 - # define cpu_is_omap243x() is_omap243x() 213 - # endif 214 - # if defined(CONFIG_ARCH_OMAP3) 215 - # undef cpu_is_omap34xx 216 - # undef cpu_is_omap343x 217 - # define cpu_is_omap34xx() is_omap34xx() 218 - # define cpu_is_omap343x() is_omap343x() 219 - # endif 220 - #else 221 - # if defined(CONFIG_ARCH_OMAP2) 222 - # undef cpu_is_omap24xx 223 - # define cpu_is_omap24xx() 1 224 - # endif 225 - # if defined(CONFIG_SOC_OMAP2420) 226 - # undef cpu_is_omap242x 227 - # define cpu_is_omap242x() 1 228 - # endif 229 - # if defined(CONFIG_SOC_OMAP2430) 230 - # undef cpu_is_omap243x 231 - # define cpu_is_omap243x() 1 232 - # endif 233 - # if defined(CONFIG_ARCH_OMAP3) 234 - # undef cpu_is_omap34xx 235 - # define cpu_is_omap34xx() 1 236 - # endif 237 - # if defined(CONFIG_SOC_OMAP3430) 238 - # undef cpu_is_omap343x 239 - # define cpu_is_omap343x() 1 240 - # endif 37 + #ifdef CONFIG_ARCH_OMAP2PLUS 38 + #include "../../mach-omap2/soc.h" 241 39 #endif 242 40 243 - /* 244 - * Macros to detect individual cpu types. 245 - * These are only rarely needed. 246 - * cpu_is_omap310(): True for OMAP310 247 - * cpu_is_omap1510(): True for OMAP1510 248 - * cpu_is_omap1610(): True for OMAP1610 249 - * cpu_is_omap1611(): True for OMAP1611 250 - * cpu_is_omap5912(): True for OMAP5912 251 - * cpu_is_omap1621(): True for OMAP1621 252 - * cpu_is_omap1710(): True for OMAP1710 253 - * cpu_is_omap2420(): True for OMAP2420 254 - * cpu_is_omap2422(): True for OMAP2422 255 - * cpu_is_omap2423(): True for OMAP2423 256 - * cpu_is_omap2430(): True for OMAP2430 257 - * cpu_is_omap3430(): True for OMAP3430 258 - */ 259 - #define GET_OMAP_TYPE ((omap_rev() >> 16) & 0xffff) 260 - 261 - #define IS_OMAP_TYPE(type, id) \ 262 - static inline int is_omap ##type (void) \ 263 - { \ 264 - return (GET_OMAP_TYPE == (id)) ? 1 : 0; \ 265 - } 266 - 267 - IS_OMAP_TYPE(310, 0x0310) 268 - IS_OMAP_TYPE(1510, 0x1510) 269 - IS_OMAP_TYPE(1610, 0x1610) 270 - IS_OMAP_TYPE(1611, 0x1611) 271 - IS_OMAP_TYPE(5912, 0x1611) 272 - IS_OMAP_TYPE(1621, 0x1621) 273 - IS_OMAP_TYPE(1710, 0x1710) 274 - IS_OMAP_TYPE(2420, 0x2420) 275 - IS_OMAP_TYPE(2422, 0x2422) 276 - IS_OMAP_TYPE(2423, 0x2423) 277 - IS_OMAP_TYPE(2430, 0x2430) 278 - IS_OMAP_TYPE(3430, 0x3430) 279 - 280 - #define cpu_is_omap310() 0 281 - #define cpu_is_omap1510() 0 282 - #define cpu_is_omap1610() 0 283 - #define cpu_is_omap5912() 0 284 - #define cpu_is_omap1611() 0 285 - #define cpu_is_omap1621() 0 286 - #define cpu_is_omap1710() 0 287 - #define cpu_is_omap2420() 0 288 - #define cpu_is_omap2422() 0 289 - #define cpu_is_omap2423() 0 290 - #define cpu_is_omap2430() 0 291 - #define cpu_is_omap3430() 0 292 - #define cpu_is_omap3630() 0 293 - #define soc_is_omap5430() 0 294 - 295 - /* 296 - * Whether we have MULTI_OMAP1 or not, we still need to distinguish 297 - * between 310 vs. 1510 and 1611B/5912 vs. 1710. 298 - */ 299 - 300 - #if defined(CONFIG_ARCH_OMAP15XX) 301 - # undef cpu_is_omap310 302 - # undef cpu_is_omap1510 303 - # define cpu_is_omap310() is_omap310() 304 - # define cpu_is_omap1510() is_omap1510() 305 - #endif 306 - 307 - #if defined(CONFIG_ARCH_OMAP16XX) 308 - # undef cpu_is_omap1610 309 - # undef cpu_is_omap1611 310 - # undef cpu_is_omap5912 311 - # undef cpu_is_omap1621 312 - # undef cpu_is_omap1710 313 - # define cpu_is_omap1610() is_omap1610() 314 - # define cpu_is_omap1611() is_omap1611() 315 - # define cpu_is_omap5912() is_omap5912() 316 - # define cpu_is_omap1621() is_omap1621() 317 - # define cpu_is_omap1710() is_omap1710() 318 - #endif 319 - 320 - #if defined(CONFIG_ARCH_OMAP2) 321 - # undef cpu_is_omap2420 322 - # undef cpu_is_omap2422 323 - # undef cpu_is_omap2423 324 - # undef cpu_is_omap2430 325 - # define cpu_is_omap2420() is_omap2420() 326 - # define cpu_is_omap2422() is_omap2422() 327 - # define cpu_is_omap2423() is_omap2423() 328 - # define cpu_is_omap2430() is_omap2430() 329 - #endif 330 - 331 - #if defined(CONFIG_ARCH_OMAP3) 332 - # undef cpu_is_omap3430 333 - # undef cpu_is_ti81xx 334 - # undef cpu_is_ti816x 335 - # undef cpu_is_ti814x 336 - # undef soc_is_am35xx 337 - # define cpu_is_omap3430() is_omap3430() 338 - # undef cpu_is_omap3630 339 - # define cpu_is_omap3630() is_omap363x() 340 - # define cpu_is_ti81xx() is_ti81xx() 341 - # define cpu_is_ti816x() is_ti816x() 342 - # define cpu_is_ti814x() is_ti814x() 343 - # define soc_is_am35xx() is_am35xx() 344 - #endif 345 - 346 - # if defined(CONFIG_SOC_AM33XX) 347 - # undef soc_is_am33xx 348 - # undef soc_is_am335x 349 - # define soc_is_am33xx() is_am33xx() 350 - # define soc_is_am335x() is_am335x() 351 - #endif 352 - 353 - # if defined(CONFIG_ARCH_OMAP4) 354 - # undef cpu_is_omap44xx 355 - # undef cpu_is_omap443x 356 - # undef cpu_is_omap446x 357 - # undef cpu_is_omap447x 358 - # define cpu_is_omap44xx() is_omap44xx() 359 - # define cpu_is_omap443x() is_omap443x() 360 - # define cpu_is_omap446x() is_omap446x() 361 - # define cpu_is_omap447x() is_omap447x() 362 - # endif 363 - 364 - # if defined(CONFIG_SOC_OMAP5) 365 - # undef soc_is_omap54xx 366 - # undef soc_is_omap543x 367 - # define soc_is_omap54xx() is_omap54xx() 368 - # define soc_is_omap543x() is_omap543x() 369 - #endif 370 - 371 - /* Macros to detect if we have OMAP1 or OMAP2 */ 372 - #define cpu_class_is_omap1() (cpu_is_omap7xx() || cpu_is_omap15xx() || \ 373 - cpu_is_omap16xx()) 374 - #define cpu_class_is_omap2() (cpu_is_omap24xx() || cpu_is_omap34xx() || \ 375 - cpu_is_omap44xx() || soc_is_omap54xx() || \ 376 - soc_is_am33xx()) 377 - 378 - /* Various silicon revisions for omap2 */ 379 - #define OMAP242X_CLASS 0x24200024 380 - #define OMAP2420_REV_ES1_0 OMAP242X_CLASS 381 - #define OMAP2420_REV_ES2_0 (OMAP242X_CLASS | (0x1 << 8)) 382 - 383 - #define OMAP243X_CLASS 0x24300024 384 - #define OMAP2430_REV_ES1_0 OMAP243X_CLASS 385 - 386 - #define OMAP343X_CLASS 0x34300034 387 - #define OMAP3430_REV_ES1_0 OMAP343X_CLASS 388 - #define OMAP3430_REV_ES2_0 (OMAP343X_CLASS | (0x1 << 8)) 389 - #define OMAP3430_REV_ES2_1 (OMAP343X_CLASS | (0x2 << 8)) 390 - #define OMAP3430_REV_ES3_0 (OMAP343X_CLASS | (0x3 << 8)) 391 - #define OMAP3430_REV_ES3_1 (OMAP343X_CLASS | (0x4 << 8)) 392 - #define OMAP3430_REV_ES3_1_2 (OMAP343X_CLASS | (0x5 << 8)) 393 - 394 - #define OMAP363X_CLASS 0x36300034 395 - #define OMAP3630_REV_ES1_0 OMAP363X_CLASS 396 - #define OMAP3630_REV_ES1_1 (OMAP363X_CLASS | (0x1 << 8)) 397 - #define OMAP3630_REV_ES1_2 (OMAP363X_CLASS | (0x2 << 8)) 398 - 399 - #define TI816X_CLASS 0x81600034 400 - #define TI8168_REV_ES1_0 TI816X_CLASS 401 - #define TI8168_REV_ES1_1 (TI816X_CLASS | (0x1 << 8)) 402 - 403 - #define TI814X_CLASS 0x81400034 404 - #define TI8148_REV_ES1_0 TI814X_CLASS 405 - #define TI8148_REV_ES2_0 (TI814X_CLASS | (0x1 << 8)) 406 - #define TI8148_REV_ES2_1 (TI814X_CLASS | (0x2 << 8)) 407 - 408 - #define AM35XX_CLASS 0x35170034 409 - #define AM35XX_REV_ES1_0 AM35XX_CLASS 410 - #define AM35XX_REV_ES1_1 (AM35XX_CLASS | (0x1 << 8)) 411 - 412 - #define AM335X_CLASS 0x33500033 413 - #define AM335X_REV_ES1_0 AM335X_CLASS 414 - 415 - #define OMAP443X_CLASS 0x44300044 416 - #define OMAP4430_REV_ES1_0 (OMAP443X_CLASS | (0x10 << 8)) 417 - #define OMAP4430_REV_ES2_0 (OMAP443X_CLASS | (0x20 << 8)) 418 - #define OMAP4430_REV_ES2_1 (OMAP443X_CLASS | (0x21 << 8)) 419 - #define OMAP4430_REV_ES2_2 (OMAP443X_CLASS | (0x22 << 8)) 420 - #define OMAP4430_REV_ES2_3 (OMAP443X_CLASS | (0x23 << 8)) 421 - 422 - #define OMAP446X_CLASS 0x44600044 423 - #define OMAP4460_REV_ES1_0 (OMAP446X_CLASS | (0x10 << 8)) 424 - #define OMAP4460_REV_ES1_1 (OMAP446X_CLASS | (0x11 << 8)) 425 - 426 - #define OMAP447X_CLASS 0x44700044 427 - #define OMAP4470_REV_ES1_0 (OMAP447X_CLASS | (0x10 << 8)) 428 - 429 - #define OMAP54XX_CLASS 0x54000054 430 - #define OMAP5430_REV_ES1_0 (OMAP54XX_CLASS | (0x30 << 16) | (0x10 << 8)) 431 - #define OMAP5432_REV_ES1_0 (OMAP54XX_CLASS | (0x32 << 16) | (0x10 << 8)) 432 - 433 - void omap2xxx_check_revision(void); 434 - void omap3xxx_check_revision(void); 435 - void omap4xxx_check_revision(void); 436 - void omap5xxx_check_revision(void); 437 - void omap3xxx_check_features(void); 438 - void ti81xx_check_features(void); 439 - void omap4xxx_check_features(void); 440 - 441 - /* 442 - * Runtime detection of OMAP3 features 443 - * 444 - * OMAP3_HAS_IO_CHAIN_CTRL: Some later members of the OMAP3 chip 445 - * family have OS-level control over the I/O chain clock. This is 446 - * to avoid a window during which wakeups could potentially be lost 447 - * during powerdomain transitions. If this bit is set, it 448 - * indicates that the chip does support OS-level control of this 449 - * feature. 450 - */ 451 - extern u32 omap_features; 452 - 453 - #define OMAP3_HAS_L2CACHE BIT(0) 454 - #define OMAP3_HAS_IVA BIT(1) 455 - #define OMAP3_HAS_SGX BIT(2) 456 - #define OMAP3_HAS_NEON BIT(3) 457 - #define OMAP3_HAS_ISP BIT(4) 458 - #define OMAP3_HAS_192MHZ_CLK BIT(5) 459 - #define OMAP3_HAS_IO_WAKEUP BIT(6) 460 - #define OMAP3_HAS_SDRC BIT(7) 461 - #define OMAP3_HAS_IO_CHAIN_CTRL BIT(8) 462 - #define OMAP4_HAS_MPU_1GHZ BIT(9) 463 - #define OMAP4_HAS_MPU_1_2GHZ BIT(10) 464 - #define OMAP4_HAS_MPU_1_5GHZ BIT(11) 465 - 466 - 467 - #define OMAP3_HAS_FEATURE(feat,flag) \ 468 - static inline unsigned int omap3_has_ ##feat(void) \ 469 - { \ 470 - return omap_features & OMAP3_HAS_ ##flag; \ 471 - } \ 472 - 473 - OMAP3_HAS_FEATURE(l2cache, L2CACHE) 474 - OMAP3_HAS_FEATURE(sgx, SGX) 475 - OMAP3_HAS_FEATURE(iva, IVA) 476 - OMAP3_HAS_FEATURE(neon, NEON) 477 - OMAP3_HAS_FEATURE(isp, ISP) 478 - OMAP3_HAS_FEATURE(192mhz_clk, 192MHZ_CLK) 479 - OMAP3_HAS_FEATURE(io_wakeup, IO_WAKEUP) 480 - OMAP3_HAS_FEATURE(sdrc, SDRC) 481 - OMAP3_HAS_FEATURE(io_chain_ctrl, IO_CHAIN_CTRL) 482 - 483 - /* 484 - * Runtime detection of OMAP4 features 485 - */ 486 - #define OMAP4_HAS_FEATURE(feat, flag) \ 487 - static inline unsigned int omap4_has_ ##feat(void) \ 488 - { \ 489 - return omap_features & OMAP4_HAS_ ##flag; \ 490 - } \ 491 - 492 - OMAP4_HAS_FEATURE(mpu_1ghz, MPU_1GHZ) 493 - OMAP4_HAS_FEATURE(mpu_1_2ghz, MPU_1_2GHZ) 494 - OMAP4_HAS_FEATURE(mpu_1_5ghz, MPU_1_5GHZ) 495 - 496 - #endif /* __ASSEMBLY__ */ 497 41 #endif
-147
arch/arm/plat-omap/include/plat/dma-44xx.h
··· 1 - /* 2 - * OMAP4 SDMA channel definitions 3 - * 4 - * Copyright (C) 2009-2010 Texas Instruments, Inc. 5 - * Copyright (C) 2009-2010 Nokia Corporation 6 - * 7 - * Santosh Shilimkar (santosh.shilimkar@ti.com) 8 - * Benoit Cousson (b-cousson@ti.com) 9 - * Paul Walmsley (paul@pwsan.com) 10 - * 11 - * This file is automatically generated from the OMAP hardware databases. 12 - * We respectfully ask that any modifications to this file be coordinated 13 - * with the public linux-omap@vger.kernel.org mailing list and the 14 - * authors above to ensure that the autogeneration scripts are kept 15 - * up-to-date with the file contents. 16 - * 17 - * This program is free software; you can redistribute it and/or modify 18 - * it under the terms of the GNU General Public License version 2 as 19 - * published by the Free Software Foundation. 20 - */ 21 - 22 - #ifndef __ARCH_ARM_MACH_OMAP2_OMAP44XX_DMA_H 23 - #define __ARCH_ARM_MACH_OMAP2_OMAP44XX_DMA_H 24 - 25 - #define OMAP44XX_DMA_SYS_REQ0 2 26 - #define OMAP44XX_DMA_SYS_REQ1 3 27 - #define OMAP44XX_DMA_GPMC 4 28 - #define OMAP44XX_DMA_DSS_DISPC_REQ 6 29 - #define OMAP44XX_DMA_SYS_REQ2 7 30 - #define OMAP44XX_DMA_MCASP1_AXEVT 8 31 - #define OMAP44XX_DMA_ISS_REQ1 9 32 - #define OMAP44XX_DMA_ISS_REQ2 10 33 - #define OMAP44XX_DMA_MCASP1_AREVT 11 34 - #define OMAP44XX_DMA_ISS_REQ3 12 35 - #define OMAP44XX_DMA_ISS_REQ4 13 36 - #define OMAP44XX_DMA_DSS_RFBI_REQ 14 37 - #define OMAP44XX_DMA_SPI3_TX0 15 38 - #define OMAP44XX_DMA_SPI3_RX0 16 39 - #define OMAP44XX_DMA_MCBSP2_TX 17 40 - #define OMAP44XX_DMA_MCBSP2_RX 18 41 - #define OMAP44XX_DMA_MCBSP3_TX 19 42 - #define OMAP44XX_DMA_MCBSP3_RX 20 43 - #define OMAP44XX_DMA_C2C_SSCM_GPO0 21 44 - #define OMAP44XX_DMA_C2C_SSCM_GPO1 22 45 - #define OMAP44XX_DMA_SPI3_TX1 23 46 - #define OMAP44XX_DMA_SPI3_RX1 24 47 - #define OMAP44XX_DMA_I2C3_TX 25 48 - #define OMAP44XX_DMA_I2C3_RX 26 49 - #define OMAP44XX_DMA_I2C1_TX 27 50 - #define OMAP44XX_DMA_I2C1_RX 28 51 - #define OMAP44XX_DMA_I2C2_TX 29 52 - #define OMAP44XX_DMA_I2C2_RX 30 53 - #define OMAP44XX_DMA_MCBSP4_TX 31 54 - #define OMAP44XX_DMA_MCBSP4_RX 32 55 - #define OMAP44XX_DMA_MCBSP1_TX 33 56 - #define OMAP44XX_DMA_MCBSP1_RX 34 57 - #define OMAP44XX_DMA_SPI1_TX0 35 58 - #define OMAP44XX_DMA_SPI1_RX0 36 59 - #define OMAP44XX_DMA_SPI1_TX1 37 60 - #define OMAP44XX_DMA_SPI1_RX1 38 61 - #define OMAP44XX_DMA_SPI1_TX2 39 62 - #define OMAP44XX_DMA_SPI1_RX2 40 63 - #define OMAP44XX_DMA_SPI1_TX3 41 64 - #define OMAP44XX_DMA_SPI1_RX3 42 65 - #define OMAP44XX_DMA_SPI2_TX0 43 66 - #define OMAP44XX_DMA_SPI2_RX0 44 67 - #define OMAP44XX_DMA_SPI2_TX1 45 68 - #define OMAP44XX_DMA_SPI2_RX1 46 69 - #define OMAP44XX_DMA_MMC2_TX 47 70 - #define OMAP44XX_DMA_MMC2_RX 48 71 - #define OMAP44XX_DMA_UART1_TX 49 72 - #define OMAP44XX_DMA_UART1_RX 50 73 - #define OMAP44XX_DMA_UART2_TX 51 74 - #define OMAP44XX_DMA_UART2_RX 52 75 - #define OMAP44XX_DMA_UART3_TX 53 76 - #define OMAP44XX_DMA_UART3_RX 54 77 - #define OMAP44XX_DMA_UART4_TX 55 78 - #define OMAP44XX_DMA_UART4_RX 56 79 - #define OMAP44XX_DMA_MMC4_TX 57 80 - #define OMAP44XX_DMA_MMC4_RX 58 81 - #define OMAP44XX_DMA_MMC5_TX 59 82 - #define OMAP44XX_DMA_MMC5_RX 60 83 - #define OMAP44XX_DMA_MMC1_TX 61 84 - #define OMAP44XX_DMA_MMC1_RX 62 85 - #define OMAP44XX_DMA_SYS_REQ3 64 86 - #define OMAP44XX_DMA_MCPDM_UP 65 87 - #define OMAP44XX_DMA_MCPDM_DL 66 88 - #define OMAP44XX_DMA_DMIC_REQ 67 89 - #define OMAP44XX_DMA_C2C_SSCM_GPO2 68 90 - #define OMAP44XX_DMA_C2C_SSCM_GPO3 69 91 - #define OMAP44XX_DMA_SPI4_TX0 70 92 - #define OMAP44XX_DMA_SPI4_RX0 71 93 - #define OMAP44XX_DMA_DSS_DSI1_REQ0 72 94 - #define OMAP44XX_DMA_DSS_DSI1_REQ1 73 95 - #define OMAP44XX_DMA_DSS_DSI1_REQ2 74 96 - #define OMAP44XX_DMA_DSS_DSI1_REQ3 75 97 - #define OMAP44XX_DMA_DSS_HDMI_REQ 76 98 - #define OMAP44XX_DMA_MMC3_TX 77 99 - #define OMAP44XX_DMA_MMC3_RX 78 100 - #define OMAP44XX_DMA_USIM_TX 79 101 - #define OMAP44XX_DMA_USIM_RX 80 102 - #define OMAP44XX_DMA_DSS_DSI2_REQ0 81 103 - #define OMAP44XX_DMA_DSS_DSI2_REQ1 82 104 - #define OMAP44XX_DMA_DSS_DSI2_REQ2 83 105 - #define OMAP44XX_DMA_DSS_DSI2_REQ3 84 106 - #define OMAP44XX_DMA_SLIMBUS1_TX0 85 107 - #define OMAP44XX_DMA_SLIMBUS1_TX1 86 108 - #define OMAP44XX_DMA_SLIMBUS1_TX2 87 109 - #define OMAP44XX_DMA_SLIMBUS1_TX3 88 110 - #define OMAP44XX_DMA_SLIMBUS1_RX0 89 111 - #define OMAP44XX_DMA_SLIMBUS1_RX1 90 112 - #define OMAP44XX_DMA_SLIMBUS1_RX2 91 113 - #define OMAP44XX_DMA_SLIMBUS1_RX3 92 114 - #define OMAP44XX_DMA_SLIMBUS2_TX0 93 115 - #define OMAP44XX_DMA_SLIMBUS2_TX1 94 116 - #define OMAP44XX_DMA_SLIMBUS2_TX2 95 117 - #define OMAP44XX_DMA_SLIMBUS2_TX3 96 118 - #define OMAP44XX_DMA_SLIMBUS2_RX0 97 119 - #define OMAP44XX_DMA_SLIMBUS2_RX1 98 120 - #define OMAP44XX_DMA_SLIMBUS2_RX2 99 121 - #define OMAP44XX_DMA_SLIMBUS2_RX3 100 122 - #define OMAP44XX_DMA_ABE_REQ_0 101 123 - #define OMAP44XX_DMA_ABE_REQ_1 102 124 - #define OMAP44XX_DMA_ABE_REQ_2 103 125 - #define OMAP44XX_DMA_ABE_REQ_3 104 126 - #define OMAP44XX_DMA_ABE_REQ_4 105 127 - #define OMAP44XX_DMA_ABE_REQ_5 106 128 - #define OMAP44XX_DMA_ABE_REQ_6 107 129 - #define OMAP44XX_DMA_ABE_REQ_7 108 130 - #define OMAP44XX_DMA_AES1_P_CTX_IN_REQ 109 131 - #define OMAP44XX_DMA_AES1_P_DATA_IN_REQ 110 132 - #define OMAP44XX_DMA_AES1_P_DATA_OUT_REQ 111 133 - #define OMAP44XX_DMA_AES2_P_CTX_IN_REQ 112 134 - #define OMAP44XX_DMA_AES2_P_DATA_IN_REQ 113 135 - #define OMAP44XX_DMA_AES2_P_DATA_OUT_REQ 114 136 - #define OMAP44XX_DMA_DES_P_CTX_IN_REQ 115 137 - #define OMAP44XX_DMA_DES_P_DATA_IN_REQ 116 138 - #define OMAP44XX_DMA_DES_P_DATA_OUT_REQ 117 139 - #define OMAP44XX_DMA_SHA2_CTXIN_P 118 140 - #define OMAP44XX_DMA_SHA2_DIN_P 119 141 - #define OMAP44XX_DMA_SHA2_CTXOUT_P 120 142 - #define OMAP44XX_DMA_AES1_P_CONTEXT_OUT_REQ 121 143 - #define OMAP44XX_DMA_AES2_P_CONTEXT_OUT_REQ 122 144 - #define OMAP44XX_DMA_I2C4_TX 124 145 - #define OMAP44XX_DMA_I2C4_RX 125 146 - 147 - #endif
+16 -185
arch/arm/plat-omap/include/plat/dma.h arch/arm/plat-omap/include/plat-omap/dma-omap.h
··· 1 1 /* 2 - * arch/arm/plat-omap/include/mach/dma.h 2 + * OMAP DMA handling defines and function 3 3 * 4 4 * Copyright (C) 2003 Nokia Corporation 5 5 * Author: Juha Yrjölä <juha.yrjola@nokia.com> ··· 23 23 24 24 #include <linux/platform_device.h> 25 25 26 - /* 27 - * TODO: These dma channel defines should go away once all 28 - * the omap drivers hwmod adapted. 29 - */ 30 - 31 - /* Move omap4 specific defines to dma-44xx.h */ 32 - #include "dma-44xx.h" 33 - 34 26 #define INT_DMA_LCD 25 35 - 36 - /* DMA channels for omap1 */ 37 - #define OMAP_DMA_NO_DEVICE 0 38 - #define OMAP_DMA_MCSI1_TX 1 39 - #define OMAP_DMA_MCSI1_RX 2 40 - #define OMAP_DMA_I2C_RX 3 41 - #define OMAP_DMA_I2C_TX 4 42 - #define OMAP_DMA_EXT_NDMA_REQ 5 43 - #define OMAP_DMA_EXT_NDMA_REQ2 6 44 - #define OMAP_DMA_UWIRE_TX 7 45 - #define OMAP_DMA_MCBSP1_TX 8 46 - #define OMAP_DMA_MCBSP1_RX 9 47 - #define OMAP_DMA_MCBSP3_TX 10 48 - #define OMAP_DMA_MCBSP3_RX 11 49 - #define OMAP_DMA_UART1_TX 12 50 - #define OMAP_DMA_UART1_RX 13 51 - #define OMAP_DMA_UART2_TX 14 52 - #define OMAP_DMA_UART2_RX 15 53 - #define OMAP_DMA_MCBSP2_TX 16 54 - #define OMAP_DMA_MCBSP2_RX 17 55 - #define OMAP_DMA_UART3_TX 18 56 - #define OMAP_DMA_UART3_RX 19 57 - #define OMAP_DMA_CAMERA_IF_RX 20 58 - #define OMAP_DMA_MMC_TX 21 59 - #define OMAP_DMA_MMC_RX 22 60 - #define OMAP_DMA_NAND 23 61 - #define OMAP_DMA_IRQ_LCD_LINE 24 62 - #define OMAP_DMA_MEMORY_STICK 25 63 - #define OMAP_DMA_USB_W2FC_RX0 26 64 - #define OMAP_DMA_USB_W2FC_RX1 27 65 - #define OMAP_DMA_USB_W2FC_RX2 28 66 - #define OMAP_DMA_USB_W2FC_TX0 29 67 - #define OMAP_DMA_USB_W2FC_TX1 30 68 - #define OMAP_DMA_USB_W2FC_TX2 31 69 - 70 - /* These are only for 1610 */ 71 - #define OMAP_DMA_CRYPTO_DES_IN 32 72 - #define OMAP_DMA_SPI_TX 33 73 - #define OMAP_DMA_SPI_RX 34 74 - #define OMAP_DMA_CRYPTO_HASH 35 75 - #define OMAP_DMA_CCP_ATTN 36 76 - #define OMAP_DMA_CCP_FIFO_NOT_EMPTY 37 77 - #define OMAP_DMA_CMT_APE_TX_CHAN_0 38 78 - #define OMAP_DMA_CMT_APE_RV_CHAN_0 39 79 - #define OMAP_DMA_CMT_APE_TX_CHAN_1 40 80 - #define OMAP_DMA_CMT_APE_RV_CHAN_1 41 81 - #define OMAP_DMA_CMT_APE_TX_CHAN_2 42 82 - #define OMAP_DMA_CMT_APE_RV_CHAN_2 43 83 - #define OMAP_DMA_CMT_APE_TX_CHAN_3 44 84 - #define OMAP_DMA_CMT_APE_RV_CHAN_3 45 85 - #define OMAP_DMA_CMT_APE_TX_CHAN_4 46 86 - #define OMAP_DMA_CMT_APE_RV_CHAN_4 47 87 - #define OMAP_DMA_CMT_APE_TX_CHAN_5 48 88 - #define OMAP_DMA_CMT_APE_RV_CHAN_5 49 89 - #define OMAP_DMA_CMT_APE_TX_CHAN_6 50 90 - #define OMAP_DMA_CMT_APE_RV_CHAN_6 51 91 - #define OMAP_DMA_CMT_APE_TX_CHAN_7 52 92 - #define OMAP_DMA_CMT_APE_RV_CHAN_7 53 93 - #define OMAP_DMA_MMC2_TX 54 94 - #define OMAP_DMA_MMC2_RX 55 95 - #define OMAP_DMA_CRYPTO_DES_OUT 56 96 - 97 - /* DMA channels for 24xx */ 98 - #define OMAP24XX_DMA_NO_DEVICE 0 99 - #define OMAP24XX_DMA_XTI_DMA 1 /* S_DMA_0 */ 100 - #define OMAP24XX_DMA_EXT_DMAREQ0 2 /* S_DMA_1 */ 101 - #define OMAP24XX_DMA_EXT_DMAREQ1 3 /* S_DMA_2 */ 102 - #define OMAP24XX_DMA_GPMC 4 /* S_DMA_3 */ 103 - #define OMAP24XX_DMA_GFX 5 /* S_DMA_4 */ 104 - #define OMAP24XX_DMA_DSS 6 /* S_DMA_5 */ 105 - #define OMAP242X_DMA_VLYNQ_TX 7 /* S_DMA_6 */ 106 - #define OMAP24XX_DMA_EXT_DMAREQ2 7 /* S_DMA_6 */ 107 - #define OMAP24XX_DMA_CWT 8 /* S_DMA_7 */ 108 - #define OMAP24XX_DMA_AES_TX 9 /* S_DMA_8 */ 109 - #define OMAP24XX_DMA_AES_RX 10 /* S_DMA_9 */ 110 - #define OMAP24XX_DMA_DES_TX 11 /* S_DMA_10 */ 111 - #define OMAP24XX_DMA_DES_RX 12 /* S_DMA_11 */ 112 - #define OMAP24XX_DMA_SHA1MD5_RX 13 /* S_DMA_12 */ 113 - #define OMAP34XX_DMA_SHA2MD5_RX 13 /* S_DMA_12 */ 114 - #define OMAP242X_DMA_EXT_DMAREQ2 14 /* S_DMA_13 */ 115 - #define OMAP242X_DMA_EXT_DMAREQ3 15 /* S_DMA_14 */ 116 - #define OMAP242X_DMA_EXT_DMAREQ4 16 /* S_DMA_15 */ 117 - #define OMAP242X_DMA_EAC_AC_RD 17 /* S_DMA_16 */ 118 - #define OMAP242X_DMA_EAC_AC_WR 18 /* S_DMA_17 */ 119 - #define OMAP242X_DMA_EAC_MD_UL_RD 19 /* S_DMA_18 */ 120 - #define OMAP242X_DMA_EAC_MD_UL_WR 20 /* S_DMA_19 */ 121 - #define OMAP242X_DMA_EAC_MD_DL_RD 21 /* S_DMA_20 */ 122 - #define OMAP242X_DMA_EAC_MD_DL_WR 22 /* S_DMA_21 */ 123 - #define OMAP242X_DMA_EAC_BT_UL_RD 23 /* S_DMA_22 */ 124 - #define OMAP242X_DMA_EAC_BT_UL_WR 24 /* S_DMA_23 */ 125 - #define OMAP242X_DMA_EAC_BT_DL_RD 25 /* S_DMA_24 */ 126 - #define OMAP242X_DMA_EAC_BT_DL_WR 26 /* S_DMA_25 */ 127 - #define OMAP243X_DMA_EXT_DMAREQ3 14 /* S_DMA_13 */ 128 - #define OMAP24XX_DMA_SPI3_TX0 15 /* S_DMA_14 */ 129 - #define OMAP24XX_DMA_SPI3_RX0 16 /* S_DMA_15 */ 130 - #define OMAP24XX_DMA_MCBSP3_TX 17 /* S_DMA_16 */ 131 - #define OMAP24XX_DMA_MCBSP3_RX 18 /* S_DMA_17 */ 132 - #define OMAP24XX_DMA_MCBSP4_TX 19 /* S_DMA_18 */ 133 - #define OMAP24XX_DMA_MCBSP4_RX 20 /* S_DMA_19 */ 134 - #define OMAP24XX_DMA_MCBSP5_TX 21 /* S_DMA_20 */ 135 - #define OMAP24XX_DMA_MCBSP5_RX 22 /* S_DMA_21 */ 136 - #define OMAP24XX_DMA_SPI3_TX1 23 /* S_DMA_22 */ 137 - #define OMAP24XX_DMA_SPI3_RX1 24 /* S_DMA_23 */ 138 - #define OMAP243X_DMA_EXT_DMAREQ4 25 /* S_DMA_24 */ 139 - #define OMAP243X_DMA_EXT_DMAREQ5 26 /* S_DMA_25 */ 140 - #define OMAP34XX_DMA_I2C3_TX 25 /* S_DMA_24 */ 141 - #define OMAP34XX_DMA_I2C3_RX 26 /* S_DMA_25 */ 142 - #define OMAP24XX_DMA_I2C1_TX 27 /* S_DMA_26 */ 143 - #define OMAP24XX_DMA_I2C1_RX 28 /* S_DMA_27 */ 144 - #define OMAP24XX_DMA_I2C2_TX 29 /* S_DMA_28 */ 145 - #define OMAP24XX_DMA_I2C2_RX 30 /* S_DMA_29 */ 146 - #define OMAP24XX_DMA_MCBSP1_TX 31 /* S_DMA_30 */ 147 - #define OMAP24XX_DMA_MCBSP1_RX 32 /* S_DMA_31 */ 148 - #define OMAP24XX_DMA_MCBSP2_TX 33 /* S_DMA_32 */ 149 - #define OMAP24XX_DMA_MCBSP2_RX 34 /* S_DMA_33 */ 150 - #define OMAP24XX_DMA_SPI1_TX0 35 /* S_DMA_34 */ 151 - #define OMAP24XX_DMA_SPI1_RX0 36 /* S_DMA_35 */ 152 - #define OMAP24XX_DMA_SPI1_TX1 37 /* S_DMA_36 */ 153 - #define OMAP24XX_DMA_SPI1_RX1 38 /* S_DMA_37 */ 154 - #define OMAP24XX_DMA_SPI1_TX2 39 /* S_DMA_38 */ 155 - #define OMAP24XX_DMA_SPI1_RX2 40 /* S_DMA_39 */ 156 - #define OMAP24XX_DMA_SPI1_TX3 41 /* S_DMA_40 */ 157 - #define OMAP24XX_DMA_SPI1_RX3 42 /* S_DMA_41 */ 158 - #define OMAP24XX_DMA_SPI2_TX0 43 /* S_DMA_42 */ 159 - #define OMAP24XX_DMA_SPI2_RX0 44 /* S_DMA_43 */ 160 - #define OMAP24XX_DMA_SPI2_TX1 45 /* S_DMA_44 */ 161 - #define OMAP24XX_DMA_SPI2_RX1 46 /* S_DMA_45 */ 162 - #define OMAP24XX_DMA_MMC2_TX 47 /* S_DMA_46 */ 163 - #define OMAP24XX_DMA_MMC2_RX 48 /* S_DMA_47 */ 164 - #define OMAP24XX_DMA_UART1_TX 49 /* S_DMA_48 */ 165 - #define OMAP24XX_DMA_UART1_RX 50 /* S_DMA_49 */ 166 - #define OMAP24XX_DMA_UART2_TX 51 /* S_DMA_50 */ 167 - #define OMAP24XX_DMA_UART2_RX 52 /* S_DMA_51 */ 168 - #define OMAP24XX_DMA_UART3_TX 53 /* S_DMA_52 */ 169 - #define OMAP24XX_DMA_UART3_RX 54 /* S_DMA_53 */ 170 - #define OMAP24XX_DMA_USB_W2FC_TX0 55 /* S_DMA_54 */ 171 - #define OMAP24XX_DMA_USB_W2FC_RX0 56 /* S_DMA_55 */ 172 - #define OMAP24XX_DMA_USB_W2FC_TX1 57 /* S_DMA_56 */ 173 - #define OMAP24XX_DMA_USB_W2FC_RX1 58 /* S_DMA_57 */ 174 - #define OMAP24XX_DMA_USB_W2FC_TX2 59 /* S_DMA_58 */ 175 - #define OMAP24XX_DMA_USB_W2FC_RX2 60 /* S_DMA_59 */ 176 - #define OMAP24XX_DMA_MMC1_TX 61 /* S_DMA_60 */ 177 - #define OMAP24XX_DMA_MMC1_RX 62 /* S_DMA_61 */ 178 - #define OMAP24XX_DMA_MS 63 /* S_DMA_62 */ 179 - #define OMAP242X_DMA_EXT_DMAREQ5 64 /* S_DMA_63 */ 180 - #define OMAP243X_DMA_EXT_DMAREQ6 64 /* S_DMA_63 */ 181 - #define OMAP34XX_DMA_EXT_DMAREQ3 64 /* S_DMA_63 */ 182 - #define OMAP34XX_DMA_AES2_TX 65 /* S_DMA_64 */ 183 - #define OMAP34XX_DMA_AES2_RX 66 /* S_DMA_65 */ 184 - #define OMAP34XX_DMA_DES2_TX 67 /* S_DMA_66 */ 185 - #define OMAP34XX_DMA_DES2_RX 68 /* S_DMA_67 */ 186 - #define OMAP34XX_DMA_SHA1MD5_RX 69 /* S_DMA_68 */ 187 - #define OMAP34XX_DMA_SPI4_TX0 70 /* S_DMA_69 */ 188 - #define OMAP34XX_DMA_SPI4_RX0 71 /* S_DMA_70 */ 189 - #define OMAP34XX_DSS_DMA0 72 /* S_DMA_71 */ 190 - #define OMAP34XX_DSS_DMA1 73 /* S_DMA_72 */ 191 - #define OMAP34XX_DSS_DMA2 74 /* S_DMA_73 */ 192 - #define OMAP34XX_DSS_DMA3 75 /* S_DMA_74 */ 193 - #define OMAP34XX_DMA_MMC3_TX 77 /* S_DMA_76 */ 194 - #define OMAP34XX_DMA_MMC3_RX 78 /* S_DMA_77 */ 195 - #define OMAP34XX_DMA_USIM_TX 79 /* S_DMA_78 */ 196 - #define OMAP34XX_DMA_USIM_RX 80 /* S_DMA_79 */ 197 - 198 - #define OMAP36XX_DMA_UART4_TX 81 /* S_DMA_80 */ 199 - #define OMAP36XX_DMA_UART4_RX 82 /* S_DMA_81 */ 200 - 201 - /* Only for AM35xx */ 202 - #define AM35XX_DMA_UART4_TX 54 203 - #define AM35XX_DMA_UART4_RX 55 204 - 205 - /*----------------------------------------------------------------------------*/ 206 27 207 28 #define OMAP1_DMA_TOUT_IRQ (1 << 0) 208 29 #define OMAP_DMA_DROP_IRQ (1 << 1) ··· 130 309 #define SRC_PORT BIT(0x7) 131 310 #define DST_PORT BIT(0x8) 132 311 #define SRC_INDEX BIT(0x9) 133 - #define DST_INDEX BIT(0xA) 134 - #define IS_BURST_ONLY4 BIT(0xB) 135 - #define CLEAR_CSR_ON_READ BIT(0xC) 136 - #define IS_WORD_16 BIT(0xD) 312 + #define DST_INDEX BIT(0xa) 313 + #define IS_BURST_ONLY4 BIT(0xb) 314 + #define CLEAR_CSR_ON_READ BIT(0xc) 315 + #define IS_WORD_16 BIT(0xd) 316 + #define ENABLE_16XX_MODE BIT(0xe) 317 + #define HS_CHANNELS_RESERVED BIT(0xf) 137 318 138 319 /* Defines for DMA Capabilities */ 139 320 #define DMA_HAS_TRANSPARENT_CAPS (0x1 << 18) ··· 272 449 u32 (*dma_read)(int reg, int lch); 273 450 }; 274 451 275 - extern void __init omap_init_consistent_dma_size(void); 452 + #ifdef CONFIG_ARCH_OMAP2PLUS 453 + #define dma_omap2plus() 1 454 + #else 455 + #define dma_omap2plus() 0 456 + #endif 457 + #define dma_omap1() (!dma_omap2plus()) 458 + #define dma_omap15xx() ((dma_omap1() && (d->dev_caps & ENABLE_1510_MODE))) 459 + #define dma_omap16xx() ((dma_omap1() && (d->dev_caps & ENABLE_16XX_MODE))) 460 + 276 461 extern void omap_set_dma_priority(int lch, int dst_port, int priority); 277 462 extern int omap_request_dma(int dev_id, const char *dev_name, 278 463 void (*callback)(int lch, u16 ch_status, void *data),
+2
arch/arm/plat-omap/include/plat/dmtimer.h
··· 94 94 /* set_timer_src - Only used for OMAP1 devices */ 95 95 int (*set_timer_src)(struct platform_device *pdev, int source); 96 96 u32 timer_capability; 97 + int (*get_context_loss_count)(struct device *); 97 98 }; 98 99 99 100 int omap_dm_timer_reserve_systimer(int id); ··· 264 263 unsigned reserved:1; 265 264 unsigned posted:1; 266 265 struct timer_regs context; 266 + int (*get_context_loss_count)(struct device *); 267 267 int ctx_loss_count; 268 268 int revision; 269 269 u32 capability;
-193
arch/arm/plat-omap/include/plat/fpga.h
··· 1 - /* 2 - * arch/arm/plat-omap/include/mach/fpga.h 3 - * 4 - * Interrupt handler for OMAP-1510 FPGA 5 - * 6 - * Copyright (C) 2001 RidgeRun, Inc. 7 - * Author: Greg Lonnon <glonnon@ridgerun.com> 8 - * 9 - * Copyright (C) 2002 MontaVista Software, Inc. 10 - * 11 - * Separated FPGA interrupts from innovator1510.c and cleaned up for 2.6 12 - * Copyright (C) 2004 Nokia Corporation by Tony Lindrgen <tony@atomide.com> 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 - #ifndef __ASM_ARCH_OMAP_FPGA_H 20 - #define __ASM_ARCH_OMAP_FPGA_H 21 - 22 - extern void omap1510_fpga_init_irq(void); 23 - 24 - #define fpga_read(reg) __raw_readb(reg) 25 - #define fpga_write(val, reg) __raw_writeb(val, reg) 26 - 27 - /* 28 - * --------------------------------------------------------------------------- 29 - * H2/P2 Debug board FPGA 30 - * --------------------------------------------------------------------------- 31 - */ 32 - /* maps in the FPGA registers and the ETHR registers */ 33 - #define H2P2_DBG_FPGA_BASE 0xE8000000 /* VA */ 34 - #define H2P2_DBG_FPGA_SIZE SZ_4K /* SIZE */ 35 - #define H2P2_DBG_FPGA_START 0x04000000 /* PA */ 36 - 37 - #define H2P2_DBG_FPGA_ETHR_START (H2P2_DBG_FPGA_START + 0x300) 38 - #define H2P2_DBG_FPGA_FPGA_REV IOMEM(H2P2_DBG_FPGA_BASE + 0x10) /* FPGA Revision */ 39 - #define H2P2_DBG_FPGA_BOARD_REV IOMEM(H2P2_DBG_FPGA_BASE + 0x12) /* Board Revision */ 40 - #define H2P2_DBG_FPGA_GPIO IOMEM(H2P2_DBG_FPGA_BASE + 0x14) /* GPIO outputs */ 41 - #define H2P2_DBG_FPGA_LEDS IOMEM(H2P2_DBG_FPGA_BASE + 0x16) /* LEDs outputs */ 42 - #define H2P2_DBG_FPGA_MISC_INPUTS IOMEM(H2P2_DBG_FPGA_BASE + 0x18) /* Misc inputs */ 43 - #define H2P2_DBG_FPGA_LAN_STATUS IOMEM(H2P2_DBG_FPGA_BASE + 0x1A) /* LAN Status line */ 44 - #define H2P2_DBG_FPGA_LAN_RESET IOMEM(H2P2_DBG_FPGA_BASE + 0x1C) /* LAN Reset line */ 45 - 46 - /* NOTE: most boards don't have a static mapping for the FPGA ... */ 47 - struct h2p2_dbg_fpga { 48 - /* offset 0x00 */ 49 - u16 smc91x[8]; 50 - /* offset 0x10 */ 51 - u16 fpga_rev; 52 - u16 board_rev; 53 - u16 gpio_outputs; 54 - u16 leds; 55 - /* offset 0x18 */ 56 - u16 misc_inputs; 57 - u16 lan_status; 58 - u16 lan_reset; 59 - u16 reserved0; 60 - /* offset 0x20 */ 61 - u16 ps2_data; 62 - u16 ps2_ctrl; 63 - /* plus also 4 rs232 ports ... */ 64 - }; 65 - 66 - /* LEDs definition on debug board (16 LEDs, all physically green) */ 67 - #define H2P2_DBG_FPGA_LED_GREEN (1 << 15) 68 - #define H2P2_DBG_FPGA_LED_AMBER (1 << 14) 69 - #define H2P2_DBG_FPGA_LED_RED (1 << 13) 70 - #define H2P2_DBG_FPGA_LED_BLUE (1 << 12) 71 - /* cpu0 load-meter LEDs */ 72 - #define H2P2_DBG_FPGA_LOAD_METER (1 << 0) // A bit of fun on our board ... 73 - #define H2P2_DBG_FPGA_LOAD_METER_SIZE 11 74 - #define H2P2_DBG_FPGA_LOAD_METER_MASK ((1 << H2P2_DBG_FPGA_LOAD_METER_SIZE) - 1) 75 - 76 - #define H2P2_DBG_FPGA_P2_LED_TIMER (1 << 0) 77 - #define H2P2_DBG_FPGA_P2_LED_IDLE (1 << 1) 78 - 79 - /* 80 - * --------------------------------------------------------------------------- 81 - * OMAP-1510 FPGA 82 - * --------------------------------------------------------------------------- 83 - */ 84 - #define OMAP1510_FPGA_BASE 0xE8000000 /* VA */ 85 - #define OMAP1510_FPGA_SIZE SZ_4K 86 - #define OMAP1510_FPGA_START 0x08000000 /* PA */ 87 - 88 - /* Revision */ 89 - #define OMAP1510_FPGA_REV_LOW IOMEM(OMAP1510_FPGA_BASE + 0x0) 90 - #define OMAP1510_FPGA_REV_HIGH IOMEM(OMAP1510_FPGA_BASE + 0x1) 91 - 92 - #define OMAP1510_FPGA_LCD_PANEL_CONTROL IOMEM(OMAP1510_FPGA_BASE + 0x2) 93 - #define OMAP1510_FPGA_LED_DIGIT IOMEM(OMAP1510_FPGA_BASE + 0x3) 94 - #define INNOVATOR_FPGA_HID_SPI IOMEM(OMAP1510_FPGA_BASE + 0x4) 95 - #define OMAP1510_FPGA_POWER IOMEM(OMAP1510_FPGA_BASE + 0x5) 96 - 97 - /* Interrupt status */ 98 - #define OMAP1510_FPGA_ISR_LO IOMEM(OMAP1510_FPGA_BASE + 0x6) 99 - #define OMAP1510_FPGA_ISR_HI IOMEM(OMAP1510_FPGA_BASE + 0x7) 100 - 101 - /* Interrupt mask */ 102 - #define OMAP1510_FPGA_IMR_LO IOMEM(OMAP1510_FPGA_BASE + 0x8) 103 - #define OMAP1510_FPGA_IMR_HI IOMEM(OMAP1510_FPGA_BASE + 0x9) 104 - 105 - /* Reset registers */ 106 - #define OMAP1510_FPGA_HOST_RESET IOMEM(OMAP1510_FPGA_BASE + 0xa) 107 - #define OMAP1510_FPGA_RST IOMEM(OMAP1510_FPGA_BASE + 0xb) 108 - 109 - #define OMAP1510_FPGA_AUDIO IOMEM(OMAP1510_FPGA_BASE + 0xc) 110 - #define OMAP1510_FPGA_DIP IOMEM(OMAP1510_FPGA_BASE + 0xe) 111 - #define OMAP1510_FPGA_FPGA_IO IOMEM(OMAP1510_FPGA_BASE + 0xf) 112 - #define OMAP1510_FPGA_UART1 IOMEM(OMAP1510_FPGA_BASE + 0x14) 113 - #define OMAP1510_FPGA_UART2 IOMEM(OMAP1510_FPGA_BASE + 0x15) 114 - #define OMAP1510_FPGA_OMAP1510_STATUS IOMEM(OMAP1510_FPGA_BASE + 0x16) 115 - #define OMAP1510_FPGA_BOARD_REV IOMEM(OMAP1510_FPGA_BASE + 0x18) 116 - #define OMAP1510P1_PPT_DATA IOMEM(OMAP1510_FPGA_BASE + 0x100) 117 - #define OMAP1510P1_PPT_STATUS IOMEM(OMAP1510_FPGA_BASE + 0x101) 118 - #define OMAP1510P1_PPT_CONTROL IOMEM(OMAP1510_FPGA_BASE + 0x102) 119 - 120 - #define OMAP1510_FPGA_TOUCHSCREEN IOMEM(OMAP1510_FPGA_BASE + 0x204) 121 - 122 - #define INNOVATOR_FPGA_INFO IOMEM(OMAP1510_FPGA_BASE + 0x205) 123 - #define INNOVATOR_FPGA_LCD_BRIGHT_LO IOMEM(OMAP1510_FPGA_BASE + 0x206) 124 - #define INNOVATOR_FPGA_LCD_BRIGHT_HI IOMEM(OMAP1510_FPGA_BASE + 0x207) 125 - #define INNOVATOR_FPGA_LED_GRN_LO IOMEM(OMAP1510_FPGA_BASE + 0x208) 126 - #define INNOVATOR_FPGA_LED_GRN_HI IOMEM(OMAP1510_FPGA_BASE + 0x209) 127 - #define INNOVATOR_FPGA_LED_RED_LO IOMEM(OMAP1510_FPGA_BASE + 0x20a) 128 - #define INNOVATOR_FPGA_LED_RED_HI IOMEM(OMAP1510_FPGA_BASE + 0x20b) 129 - #define INNOVATOR_FPGA_CAM_USB_CONTROL IOMEM(OMAP1510_FPGA_BASE + 0x20c) 130 - #define INNOVATOR_FPGA_EXP_CONTROL IOMEM(OMAP1510_FPGA_BASE + 0x20d) 131 - #define INNOVATOR_FPGA_ISR2 IOMEM(OMAP1510_FPGA_BASE + 0x20e) 132 - #define INNOVATOR_FPGA_IMR2 IOMEM(OMAP1510_FPGA_BASE + 0x210) 133 - 134 - #define OMAP1510_FPGA_ETHR_START (OMAP1510_FPGA_START + 0x300) 135 - 136 - /* 137 - * Power up Giga UART driver, turn on HID clock. 138 - * Turn off BT power, since we're not using it and it 139 - * draws power. 140 - */ 141 - #define OMAP1510_FPGA_RESET_VALUE 0x42 142 - 143 - #define OMAP1510_FPGA_PCR_IF_PD0 (1 << 7) 144 - #define OMAP1510_FPGA_PCR_COM2_EN (1 << 6) 145 - #define OMAP1510_FPGA_PCR_COM1_EN (1 << 5) 146 - #define OMAP1510_FPGA_PCR_EXP_PD0 (1 << 4) 147 - #define OMAP1510_FPGA_PCR_EXP_PD1 (1 << 3) 148 - #define OMAP1510_FPGA_PCR_48MHZ_CLK (1 << 2) 149 - #define OMAP1510_FPGA_PCR_4MHZ_CLK (1 << 1) 150 - #define OMAP1510_FPGA_PCR_RSRVD_BIT0 (1 << 0) 151 - 152 - /* 153 - * Innovator/OMAP1510 FPGA HID register bit definitions 154 - */ 155 - #define OMAP1510_FPGA_HID_SCLK (1<<0) /* output */ 156 - #define OMAP1510_FPGA_HID_MOSI (1<<1) /* output */ 157 - #define OMAP1510_FPGA_HID_nSS (1<<2) /* output 0/1 chip idle/select */ 158 - #define OMAP1510_FPGA_HID_nHSUS (1<<3) /* output 0/1 host active/suspended */ 159 - #define OMAP1510_FPGA_HID_MISO (1<<4) /* input */ 160 - #define OMAP1510_FPGA_HID_ATN (1<<5) /* input 0/1 chip idle/ATN */ 161 - #define OMAP1510_FPGA_HID_rsrvd (1<<6) 162 - #define OMAP1510_FPGA_HID_RESETn (1<<7) /* output - 0/1 USAR reset/run */ 163 - 164 - /* The FPGA IRQ is cascaded through GPIO_13 */ 165 - #define OMAP1510_INT_FPGA (IH_GPIO_BASE + 13) 166 - 167 - /* IRQ Numbers for interrupts muxed through the FPGA */ 168 - #define OMAP1510_INT_FPGA_ATN (OMAP_FPGA_IRQ_BASE + 0) 169 - #define OMAP1510_INT_FPGA_ACK (OMAP_FPGA_IRQ_BASE + 1) 170 - #define OMAP1510_INT_FPGA2 (OMAP_FPGA_IRQ_BASE + 2) 171 - #define OMAP1510_INT_FPGA3 (OMAP_FPGA_IRQ_BASE + 3) 172 - #define OMAP1510_INT_FPGA4 (OMAP_FPGA_IRQ_BASE + 4) 173 - #define OMAP1510_INT_FPGA5 (OMAP_FPGA_IRQ_BASE + 5) 174 - #define OMAP1510_INT_FPGA6 (OMAP_FPGA_IRQ_BASE + 6) 175 - #define OMAP1510_INT_FPGA7 (OMAP_FPGA_IRQ_BASE + 7) 176 - #define OMAP1510_INT_FPGA8 (OMAP_FPGA_IRQ_BASE + 8) 177 - #define OMAP1510_INT_FPGA9 (OMAP_FPGA_IRQ_BASE + 9) 178 - #define OMAP1510_INT_FPGA10 (OMAP_FPGA_IRQ_BASE + 10) 179 - #define OMAP1510_INT_FPGA11 (OMAP_FPGA_IRQ_BASE + 11) 180 - #define OMAP1510_INT_FPGA12 (OMAP_FPGA_IRQ_BASE + 12) 181 - #define OMAP1510_INT_ETHER (OMAP_FPGA_IRQ_BASE + 13) 182 - #define OMAP1510_INT_FPGAUART1 (OMAP_FPGA_IRQ_BASE + 14) 183 - #define OMAP1510_INT_FPGAUART2 (OMAP_FPGA_IRQ_BASE + 15) 184 - #define OMAP1510_INT_FPGA_TS (OMAP_FPGA_IRQ_BASE + 16) 185 - #define OMAP1510_INT_FPGA17 (OMAP_FPGA_IRQ_BASE + 17) 186 - #define OMAP1510_INT_FPGA_CAM (OMAP_FPGA_IRQ_BASE + 18) 187 - #define OMAP1510_INT_FPGA_RTC_A (OMAP_FPGA_IRQ_BASE + 19) 188 - #define OMAP1510_INT_FPGA_RTC_B (OMAP_FPGA_IRQ_BASE + 20) 189 - #define OMAP1510_INT_FPGA_CD (OMAP_FPGA_IRQ_BASE + 21) 190 - #define OMAP1510_INT_FPGA22 (OMAP_FPGA_IRQ_BASE + 22) 191 - #define OMAP1510_INT_FPGA23 (OMAP_FPGA_IRQ_BASE + 23) 192 - 193 - #endif
+3 -58
arch/arm/plat-omap/include/plat/gpmc.h arch/arm/mach-omap2/gpmc.h
··· 11 11 #ifndef __OMAP2_GPMC_H 12 12 #define __OMAP2_GPMC_H 13 13 14 + #include <linux/platform_data/mtd-nand-omap2.h> 15 + 14 16 /* Maximum Number of Chip Selects */ 15 17 #define GPMC_CS_NUM 8 16 18 ··· 33 31 #define GPMC_CONFIG_DEV_TYPE 0x00000003 34 32 #define GPMC_SET_IRQ_STATUS 0x00000004 35 33 #define GPMC_CONFIG_WP 0x00000005 36 - 37 - #define GPMC_GET_IRQ_STATUS 0x00000006 38 - #define GPMC_PREFETCH_FIFO_CNT 0x00000007 /* bytes available in FIFO for r/w */ 39 - #define GPMC_PREFETCH_COUNT 0x00000008 /* remaining bytes to be read/write*/ 40 - #define GPMC_STATUS_BUFFER 0x00000009 /* 1: buffer is available to write */ 41 - 42 - #define GPMC_NAND_COMMAND 0x0000000a 43 - #define GPMC_NAND_ADDRESS 0x0000000b 44 - #define GPMC_NAND_DATA 0x0000000c 45 34 46 35 #define GPMC_ENABLE_IRQ 0x0000000d 47 36 ··· 69 76 #define GPMC_DEVICETYPE_NOR 0 70 77 #define GPMC_DEVICETYPE_NAND 2 71 78 #define GPMC_CONFIG_WRITEPROTECT 0x00000010 72 - #define GPMC_STATUS_BUFF_EMPTY 0x00000001 73 79 #define WR_RD_PIN_MONITORING 0x00600000 74 - #define GPMC_PREFETCH_STATUS_FIFO_CNT(val) ((val >> 24) & 0x7F) 75 - #define GPMC_PREFETCH_STATUS_COUNT(val) (val & 0x00003fff) 76 80 #define GPMC_IRQ_FIFOEVENTENABLE 0x01 77 81 #define GPMC_IRQ_COUNT_EVENT 0x02 78 82 79 - #define PREFETCH_FIFOTHRESHOLD_MAX 0x40 80 - #define PREFETCH_FIFOTHRESHOLD(val) ((val) << 8) 81 - 82 - enum omap_ecc { 83 - /* 1-bit ecc: stored at end of spare area */ 84 - OMAP_ECC_HAMMING_CODE_DEFAULT = 0, /* Default, s/w method */ 85 - OMAP_ECC_HAMMING_CODE_HW, /* gpmc to detect the error */ 86 - /* 1-bit ecc: stored at beginning of spare area as romcode */ 87 - OMAP_ECC_HAMMING_CODE_HW_ROMCODE, /* gpmc method & romcode layout */ 88 - OMAP_ECC_BCH4_CODE_HW, /* 4-bit BCH ecc code */ 89 - OMAP_ECC_BCH8_CODE_HW, /* 8-bit BCH ecc code */ 90 - }; 91 83 92 84 /* 93 85 * Note that all values in this struct are in nanoseconds except sync_clk ··· 111 133 u16 wr_data_mux_bus; /* WRDATAONADMUXBUS */ 112 134 }; 113 135 114 - struct gpmc_nand_regs { 115 - void __iomem *gpmc_status; 116 - void __iomem *gpmc_nand_command; 117 - void __iomem *gpmc_nand_address; 118 - void __iomem *gpmc_nand_data; 119 - void __iomem *gpmc_prefetch_config1; 120 - void __iomem *gpmc_prefetch_config2; 121 - void __iomem *gpmc_prefetch_control; 122 - void __iomem *gpmc_prefetch_status; 123 - void __iomem *gpmc_ecc_config; 124 - void __iomem *gpmc_ecc_control; 125 - void __iomem *gpmc_ecc_size_config; 126 - void __iomem *gpmc_ecc1_result; 127 - void __iomem *gpmc_bch_result0; 128 - }; 129 - 130 136 extern void gpmc_update_nand_reg(struct gpmc_nand_regs *reg, int cs); 131 137 extern int gpmc_get_client_irq(unsigned irq_config); 132 138 ··· 122 160 123 161 extern void gpmc_cs_write_reg(int cs, int idx, u32 val); 124 162 extern u32 gpmc_cs_read_reg(int cs, int idx); 125 - extern int gpmc_cs_calc_divider(int cs, unsigned int sync_clk); 163 + extern int gpmc_calc_divider(unsigned int sync_clk); 126 164 extern int gpmc_cs_set_timings(int cs, const struct gpmc_timings *t); 127 165 extern int gpmc_cs_request(int cs, unsigned long size, unsigned long *base); 128 166 extern void gpmc_cs_free(int cs); 129 167 extern int gpmc_cs_set_reserved(int cs, int reserved); 130 168 extern int gpmc_cs_reserved(int cs); 131 - extern int gpmc_prefetch_enable(int cs, int fifo_th, int dma_mode, 132 - unsigned int u32_count, int is_write); 133 - extern int gpmc_prefetch_reset(int cs); 134 169 extern void omap3_gpmc_save_context(void); 135 170 extern void omap3_gpmc_restore_context(void); 136 - extern int gpmc_read_status(int cmd); 137 171 extern int gpmc_cs_configure(int cs, int cmd, int wval); 138 - extern int gpmc_nand_read(int cs, int cmd); 139 - extern int gpmc_nand_write(int cs, int cmd, int wval); 140 - 141 - int gpmc_enable_hwecc(int cs, int mode, int dev_width, int ecc_size); 142 - int gpmc_calculate_ecc(int cs, const u_char *dat, u_char *ecc_code); 143 - 144 - #ifdef CONFIG_ARCH_OMAP3 145 - int gpmc_init_hwecc_bch(int cs, int nsectors, int nerrors); 146 - int gpmc_enable_hwecc_bch(int cs, int mode, int dev_width, int nsectors, 147 - int nerrors); 148 - int gpmc_calculate_ecc_bch4(int cs, const u_char *dat, u_char *ecc); 149 - int gpmc_calculate_ecc_bch8(int cs, const u_char *dat, u_char *ecc); 150 - #endif /* CONFIG_ARCH_OMAP3 */ 151 172 152 173 #endif
+9 -21
arch/arm/plat-omap/include/plat/i2c.h
··· 18 18 * 02110-1301 USA 19 19 * 20 20 */ 21 - #ifndef __ASM__ARCH_OMAP_I2C_H 22 - #define __ASM__ARCH_OMAP_I2C_H 23 21 24 - #include <linux/i2c.h> 25 - #include <linux/i2c-omap.h> 22 + #ifndef __PLAT_OMAP_I2C_H 23 + #define __PLAT_OMAP_I2C_H 24 + 25 + struct i2c_board_info; 26 + struct omap_i2c_bus_platform_data; 27 + 28 + int omap_i2c_add_bus(struct omap_i2c_bus_platform_data *i2c_pdata, 29 + int bus_id); 26 30 27 31 #if defined(CONFIG_I2C_OMAP) || defined(CONFIG_I2C_OMAP_MODULE) 28 32 extern int omap_register_i2c_bus(int bus_id, u32 clkrate, ··· 41 37 } 42 38 #endif 43 39 44 - /** 45 - * i2c_dev_attr - OMAP I2C controller device attributes for omap_hwmod 46 - * @fifo_depth: total controller FIFO size (in bytes) 47 - * @flags: differences in hardware support capability 48 - * 49 - * @fifo_depth represents what exists on the hardware, not what is 50 - * actually configured at runtime by the device driver. 51 - */ 52 - struct omap_i2c_dev_attr { 53 - u8 fifo_depth; 54 - u32 flags; 55 - }; 56 - 57 - void __init omap1_i2c_mux_pins(int bus_id); 58 - void __init omap2_i2c_mux_pins(int bus_id); 59 - 60 40 struct omap_hwmod; 61 41 int omap_i2c_reset(struct omap_hwmod *oh); 62 42 63 - #endif /* __ASM__ARCH_OMAP_I2C_H */ 43 + #endif /* __PLAT_OMAP_I2C_H */
-2
arch/arm/plat-omap/include/plat/led.h include/linux/platform_data/leds-omap.h
··· 1 1 /* 2 - * arch/arm/plat-omap/include/mach/led.h 3 - * 4 2 * Copyright (C) 2006 Samsung Electronics 5 3 * Kyungmin Park <kyungmin.park@samsung.com> 6 4 *
-2
arch/arm/plat-omap/include/plat/menelaus.h include/linux/mfd/menelaus.h
··· 1 1 /* 2 - * arch/arm/plat-omap/include/mach/menelaus.h 3 - * 4 2 * Functions to access Menelaus power management chip 5 3 */ 6 4
+5 -43
arch/arm/plat-omap/include/plat/mmc.h include/linux/platform_data/mmc-omap.h
··· 8 8 * published by the Free Software Foundation. 9 9 */ 10 10 11 - #ifndef __OMAP2_MMC_H 12 - #define __OMAP2_MMC_H 13 - 14 - #include <linux/types.h> 15 - #include <linux/device.h> 16 - #include <linux/mmc/host.h> 17 - 18 - #include <plat/omap_hwmod.h> 19 - 20 - #define OMAP15XX_NR_MMC 1 21 - #define OMAP16XX_NR_MMC 2 22 - #define OMAP1_MMC_SIZE 0x080 23 - #define OMAP1_MMC1_BASE 0xfffb7800 24 - #define OMAP1_MMC2_BASE 0xfffb7c00 /* omap16xx only */ 25 - 26 - #define OMAP24XX_NR_MMC 2 27 - #define OMAP2420_MMC_SIZE OMAP1_MMC_SIZE 28 - #define OMAP2_MMC1_BASE 0x4809c000 29 - 30 - #define OMAP4_MMC_REG_OFFSET 0x100 31 - 32 11 #define OMAP_MMC_MAX_SLOTS 2 33 12 34 13 /* ··· 28 49 */ 29 50 #define OMAP_HSMMC_SUPPORTS_DUAL_VOLT BIT(0) 30 51 #define OMAP_HSMMC_BROKEN_MULTIBLOCK_READ BIT(1) 52 + 53 + struct mmc_card; 31 54 32 55 struct omap_mmc_dev_attr { 33 56 u8 flags; ··· 107 126 /* we can put the features above into this variable */ 108 127 #define HSMMC_HAS_PBIAS (1 << 0) 109 128 #define HSMMC_HAS_UPDATED_RESET (1 << 1) 129 + #define MMC_OMAP7XX (1 << 2) 130 + #define MMC_OMAP15XX (1 << 3) 131 + #define MMC_OMAP16XX (1 << 4) 110 132 unsigned features; 111 133 112 134 int switch_pin; /* gpio (card detect) */ ··· 148 164 149 165 } slots[OMAP_MMC_MAX_SLOTS]; 150 166 }; 151 - 152 - /* called from board-specific card detection service routine */ 153 - extern void omap_mmc_notify_cover_event(struct device *dev, int slot, 154 - int is_closed); 155 - 156 - #if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) 157 - void omap1_init_mmc(struct omap_mmc_platform_data **mmc_data, 158 - int nr_controllers); 159 - void omap242x_init_mmc(struct omap_mmc_platform_data **mmc_data); 160 - #else 161 - static inline void omap1_init_mmc(struct omap_mmc_platform_data **mmc_data, 162 - int nr_controllers) 163 - { 164 - } 165 - static inline void omap242x_init_mmc(struct omap_mmc_platform_data **mmc_data) 166 - { 167 - } 168 - #endif 169 - 170 - extern int omap_msdi_reset(struct omap_hwmod *oh); 171 - 172 - #endif
-120
arch/arm/plat-omap/include/plat/multi.h
··· 1 - /* 2 - * Support for compiling in multiple OMAP processors 3 - * 4 - * Copyright (C) 2010 Nokia Corporation 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 - 22 - #ifndef __PLAT_OMAP_MULTI_H 23 - #define __PLAT_OMAP_MULTI_H 24 - 25 - /* 26 - * Test if multicore OMAP support is needed 27 - */ 28 - #undef MULTI_OMAP1 29 - #undef MULTI_OMAP2 30 - #undef OMAP_NAME 31 - 32 - #ifdef CONFIG_ARCH_OMAP730 33 - # ifdef OMAP_NAME 34 - # undef MULTI_OMAP1 35 - # define MULTI_OMAP1 36 - # else 37 - # define OMAP_NAME omap730 38 - # endif 39 - #endif 40 - #ifdef CONFIG_ARCH_OMAP850 41 - # ifdef OMAP_NAME 42 - # undef MULTI_OMAP1 43 - # define MULTI_OMAP1 44 - # else 45 - # define OMAP_NAME omap850 46 - # endif 47 - #endif 48 - #ifdef CONFIG_ARCH_OMAP15XX 49 - # ifdef OMAP_NAME 50 - # undef MULTI_OMAP1 51 - # define MULTI_OMAP1 52 - # else 53 - # define OMAP_NAME omap1510 54 - # endif 55 - #endif 56 - #ifdef CONFIG_ARCH_OMAP16XX 57 - # ifdef OMAP_NAME 58 - # undef MULTI_OMAP1 59 - # define MULTI_OMAP1 60 - # else 61 - # define OMAP_NAME omap16xx 62 - # endif 63 - #endif 64 - #ifdef CONFIG_ARCH_OMAP2PLUS 65 - # if (defined(OMAP_NAME) || defined(MULTI_OMAP1)) 66 - # error "OMAP1 and OMAP2PLUS can't be selected at the same time" 67 - # endif 68 - #endif 69 - #ifdef CONFIG_SOC_OMAP2420 70 - # ifdef OMAP_NAME 71 - # undef MULTI_OMAP2 72 - # define MULTI_OMAP2 73 - # else 74 - # define OMAP_NAME omap2420 75 - # endif 76 - #endif 77 - #ifdef CONFIG_SOC_OMAP2430 78 - # ifdef OMAP_NAME 79 - # undef MULTI_OMAP2 80 - # define MULTI_OMAP2 81 - # else 82 - # define OMAP_NAME omap2430 83 - # endif 84 - #endif 85 - #ifdef CONFIG_ARCH_OMAP3 86 - # ifdef OMAP_NAME 87 - # undef MULTI_OMAP2 88 - # define MULTI_OMAP2 89 - # else 90 - # define OMAP_NAME omap3 91 - # endif 92 - #endif 93 - #ifdef CONFIG_ARCH_OMAP4 94 - # ifdef OMAP_NAME 95 - # undef MULTI_OMAP2 96 - # define MULTI_OMAP2 97 - # else 98 - # define OMAP_NAME omap4 99 - # endif 100 - #endif 101 - 102 - #ifdef CONFIG_SOC_OMAP5 103 - # ifdef OMAP_NAME 104 - # undef MULTI_OMAP2 105 - # define MULTI_OMAP2 106 - # else 107 - # define OMAP_NAME omap5 108 - # endif 109 - #endif 110 - 111 - #ifdef CONFIG_SOC_AM33XX 112 - # ifdef OMAP_NAME 113 - # undef MULTI_OMAP2 114 - # define MULTI_OMAP2 115 - # else 116 - # define OMAP_NAME am33xx 117 - # endif 118 - #endif 119 - 120 - #endif /* __PLAT_OMAP_MULTI_H */
arch/arm/plat-omap/include/plat/omap-pm.h arch/arm/mach-omap2/omap-pm.h
-14
arch/arm/plat-omap/include/plat/omap-secure.h
··· 1 - #ifndef __OMAP_SECURE_H__ 2 - #define __OMAP_SECURE_H__ 3 - 4 - #include <linux/types.h> 5 - 6 - extern int omap_secure_ram_reserve_memblock(void); 7 - 8 - #ifdef CONFIG_OMAP4_ERRATA_I688 9 - extern int omap_barrier_reserve_memblock(void); 10 - #else 11 - static inline void omap_barrier_reserve_memblock(void) 12 - { } 13 - #endif 14 - #endif /* __OMAP_SECURE_H__ */
+1 -1
arch/arm/plat-omap/include/plat/omap_device.h arch/arm/mach-omap2/omap_device.h
··· 34 34 #include <linux/kernel.h> 35 35 #include <linux/platform_device.h> 36 36 37 - #include <plat/omap_hwmod.h> 37 + #include "omap_hwmod.h" 38 38 39 39 extern struct dev_pm_domain omap_device_pm_domain; 40 40
-1
arch/arm/plat-omap/include/plat/omap_hwmod.h arch/arm/mach-omap2/omap_hwmod.h
··· 35 35 #include <linux/list.h> 36 36 #include <linux/ioport.h> 37 37 #include <linux/spinlock.h> 38 - #include <plat/cpu.h> 39 38 40 39 struct omap_device; 41 40
-164
arch/arm/plat-omap/include/plat/sdrc.h
··· 1 - #ifndef ____ASM_ARCH_SDRC_H 2 - #define ____ASM_ARCH_SDRC_H 3 - 4 - /* 5 - * OMAP2/3 SDRC/SMS register definitions 6 - * 7 - * Copyright (C) 2007-2008 Texas Instruments, Inc. 8 - * Copyright (C) 2007-2008 Nokia Corporation 9 - * 10 - * Tony Lindgren 11 - * Paul Walmsley 12 - * Richard Woodruff 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 - 20 - /* SDRC register offsets - read/write with sdrc_{read,write}_reg() */ 21 - 22 - #define SDRC_SYSCONFIG 0x010 23 - #define SDRC_CS_CFG 0x040 24 - #define SDRC_SHARING 0x044 25 - #define SDRC_ERR_TYPE 0x04C 26 - #define SDRC_DLLA_CTRL 0x060 27 - #define SDRC_DLLA_STATUS 0x064 28 - #define SDRC_DLLB_CTRL 0x068 29 - #define SDRC_DLLB_STATUS 0x06C 30 - #define SDRC_POWER 0x070 31 - #define SDRC_MCFG_0 0x080 32 - #define SDRC_MR_0 0x084 33 - #define SDRC_EMR2_0 0x08c 34 - #define SDRC_ACTIM_CTRL_A_0 0x09c 35 - #define SDRC_ACTIM_CTRL_B_0 0x0a0 36 - #define SDRC_RFR_CTRL_0 0x0a4 37 - #define SDRC_MANUAL_0 0x0a8 38 - #define SDRC_MCFG_1 0x0B0 39 - #define SDRC_MR_1 0x0B4 40 - #define SDRC_EMR2_1 0x0BC 41 - #define SDRC_ACTIM_CTRL_A_1 0x0C4 42 - #define SDRC_ACTIM_CTRL_B_1 0x0C8 43 - #define SDRC_RFR_CTRL_1 0x0D4 44 - #define SDRC_MANUAL_1 0x0D8 45 - 46 - #define SDRC_POWER_AUTOCOUNT_SHIFT 8 47 - #define SDRC_POWER_AUTOCOUNT_MASK (0xffff << SDRC_POWER_AUTOCOUNT_SHIFT) 48 - #define SDRC_POWER_CLKCTRL_SHIFT 4 49 - #define SDRC_POWER_CLKCTRL_MASK (0x3 << SDRC_POWER_CLKCTRL_SHIFT) 50 - #define SDRC_SELF_REFRESH_ON_AUTOCOUNT (0x2 << SDRC_POWER_CLKCTRL_SHIFT) 51 - 52 - /* 53 - * These values represent the number of memory clock cycles between 54 - * autorefresh initiation. They assume 1 refresh per 64 ms (JEDEC), 8192 55 - * rows per device, and include a subtraction of a 50 cycle window in the 56 - * event that the autorefresh command is delayed due to other SDRC activity. 57 - * The '| 1' sets the ARE field to send one autorefresh when the autorefresh 58 - * counter reaches 0. 59 - * 60 - * These represent optimal values for common parts, it won't work for all. 61 - * As long as you scale down, most parameters are still work, they just 62 - * become sub-optimal. The RFR value goes in the opposite direction. If you 63 - * don't adjust it down as your clock period increases the refresh interval 64 - * will not be met. Setting all parameters for complete worst case may work, 65 - * but may cut memory performance by 2x. Due to errata the DLLs need to be 66 - * unlocked and their value needs run time calibration. A dynamic call is 67 - * need for that as no single right value exists acorss production samples. 68 - * 69 - * Only the FULL speed values are given. Current code is such that rate 70 - * changes must be made at DPLLoutx2. The actual value adjustment for low 71 - * frequency operation will be handled by omap_set_performance() 72 - * 73 - * By having the boot loader boot up in the fastest L4 speed available likely 74 - * will result in something which you can switch between. 75 - */ 76 - #define SDRC_RFR_CTRL_165MHz (0x00044c00 | 1) 77 - #define SDRC_RFR_CTRL_133MHz (0x0003de00 | 1) 78 - #define SDRC_RFR_CTRL_100MHz (0x0002da01 | 1) 79 - #define SDRC_RFR_CTRL_110MHz (0x0002da01 | 1) /* Need to calc */ 80 - #define SDRC_RFR_CTRL_BYPASS (0x00005000 | 1) /* Need to calc */ 81 - 82 - 83 - /* 84 - * SMS register access 85 - */ 86 - 87 - #define OMAP242X_SMS_REGADDR(reg) \ 88 - (void __iomem *)OMAP2_L3_IO_ADDRESS(OMAP2420_SMS_BASE + reg) 89 - #define OMAP243X_SMS_REGADDR(reg) \ 90 - (void __iomem *)OMAP2_L3_IO_ADDRESS(OMAP243X_SMS_BASE + reg) 91 - #define OMAP343X_SMS_REGADDR(reg) \ 92 - (void __iomem *)OMAP2_L3_IO_ADDRESS(OMAP343X_SMS_BASE + reg) 93 - 94 - /* SMS register offsets - read/write with sms_{read,write}_reg() */ 95 - 96 - #define SMS_SYSCONFIG 0x010 97 - #define SMS_ROT_CONTROL(context) (0x180 + 0x10 * context) 98 - #define SMS_ROT_SIZE(context) (0x184 + 0x10 * context) 99 - #define SMS_ROT_PHYSICAL_BA(context) (0x188 + 0x10 * context) 100 - /* REVISIT: fill in other SMS registers here */ 101 - 102 - 103 - #ifndef __ASSEMBLER__ 104 - 105 - /** 106 - * struct omap_sdrc_params - SDRC parameters for a given SDRC clock rate 107 - * @rate: SDRC clock rate (in Hz) 108 - * @actim_ctrla: Value to program to SDRC_ACTIM_CTRLA for this rate 109 - * @actim_ctrlb: Value to program to SDRC_ACTIM_CTRLB for this rate 110 - * @rfr_ctrl: Value to program to SDRC_RFR_CTRL for this rate 111 - * @mr: Value to program to SDRC_MR for this rate 112 - * 113 - * This structure holds a pre-computed set of register values for the 114 - * SDRC for a given SDRC clock rate and SDRAM chip. These are 115 - * intended to be pre-computed and specified in an array in the board-*.c 116 - * files. The structure is keyed off the 'rate' field. 117 - */ 118 - struct omap_sdrc_params { 119 - unsigned long rate; 120 - u32 actim_ctrla; 121 - u32 actim_ctrlb; 122 - u32 rfr_ctrl; 123 - u32 mr; 124 - }; 125 - 126 - #ifdef CONFIG_SOC_HAS_OMAP2_SDRC 127 - void omap2_sdrc_init(struct omap_sdrc_params *sdrc_cs0, 128 - struct omap_sdrc_params *sdrc_cs1); 129 - #else 130 - static inline void __init omap2_sdrc_init(struct omap_sdrc_params *sdrc_cs0, 131 - struct omap_sdrc_params *sdrc_cs1) {}; 132 - #endif 133 - 134 - int omap2_sdrc_get_params(unsigned long r, 135 - struct omap_sdrc_params **sdrc_cs0, 136 - struct omap_sdrc_params **sdrc_cs1); 137 - void omap2_sms_save_context(void); 138 - void omap2_sms_restore_context(void); 139 - 140 - void omap2_sms_write_rot_control(u32 val, unsigned ctx); 141 - void omap2_sms_write_rot_size(u32 val, unsigned ctx); 142 - void omap2_sms_write_rot_physical_ba(u32 val, unsigned ctx); 143 - 144 - #ifdef CONFIG_ARCH_OMAP2 145 - 146 - struct memory_timings { 147 - u32 m_type; /* ddr = 1, sdr = 0 */ 148 - u32 dll_mode; /* use lock mode = 1, unlock mode = 0 */ 149 - u32 slow_dll_ctrl; /* unlock mode, dll value for slow speed */ 150 - u32 fast_dll_ctrl; /* unlock mode, dll value for fast speed */ 151 - u32 base_cs; /* base chip select to use for calculations */ 152 - }; 153 - 154 - extern void omap2xxx_sdrc_init_params(u32 force_lock_to_unlock_mode); 155 - struct omap_sdrc_params *rx51_get_sdram_timings(void); 156 - 157 - u32 omap2xxx_sdrc_dll_is_unlocked(void); 158 - u32 omap2xxx_sdrc_reprogram(u32 level, u32 force); 159 - 160 - #endif /* CONFIG_ARCH_OMAP2 */ 161 - 162 - #endif /* __ASSEMBLER__ */ 163 - 164 - #endif
-29
arch/arm/plat-omap/include/plat/serial.h arch/arm/mach-omap2/include/mach/serial.h
··· 1 1 /* 2 - * arch/arm/plat-omap/include/mach/serial.h 3 - * 4 2 * Copyright (C) 2009 Texas Instruments 5 3 * Added OMAP4 support- Santosh Shilimkar <santosh.shilimkar@ti.com> 6 4 * ··· 7 9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 8 10 * GNU General Public License for more details. 9 11 */ 10 - 11 - #ifndef __ASM_ARCH_SERIAL_H 12 - #define __ASM_ARCH_SERIAL_H 13 - 14 - #include <linux/init.h> 15 12 16 13 /* 17 14 * Memory entry used for the DEBUG_LL UART configuration, relative to ··· 21 28 * and addruart has a chance to read OMAP_UART_INFO 22 29 */ 23 30 #define OMAP_UART_INFO_OFS 0x3ffc 24 - 25 - /* OMAP1 serial ports */ 26 - #define OMAP1_UART1_BASE 0xfffb0000 27 - #define OMAP1_UART2_BASE 0xfffb0800 28 - #define OMAP1_UART3_BASE 0xfffb9800 29 31 30 32 /* OMAP2 serial ports */ 31 33 #define OMAP2_UART1_BASE 0x4806a000 ··· 64 76 #define ZOOM_UART_VIRT 0xfa400000 65 77 66 78 #define OMAP_PORT_SHIFT 2 67 - #define OMAP7XX_PORT_SHIFT 0 68 79 #define ZOOM_PORT_SHIFT 1 69 80 70 - #define OMAP1510_BASE_BAUD (12000000/16) 71 - #define OMAP16XX_BASE_BAUD (48000000/16) 72 81 #define OMAP24XX_BASE_BAUD (48000000/16) 73 82 74 83 /* 75 84 * DEBUG_LL port encoding stored into the UART1 scratchpad register by 76 85 * decomp_setup in uncompress.h 77 86 */ 78 - #define OMAP1UART1 11 79 - #define OMAP1UART2 12 80 - #define OMAP1UART3 13 81 87 #define OMAP2UART1 21 82 88 #define OMAP2UART2 22 83 89 #define OMAP2UART3 23 ··· 91 109 #define OMAP5UART4 OMAP4UART4 92 110 #define ZOOM_UART 95 /* Only on zoom2/3 */ 93 111 94 - /* This is only used by 8250.c for omap1510 */ 95 - #define is_omap_port(pt) ({int __ret = 0; \ 96 - if ((pt)->port.mapbase == OMAP1_UART1_BASE || \ 97 - (pt)->port.mapbase == OMAP1_UART2_BASE || \ 98 - (pt)->port.mapbase == OMAP1_UART3_BASE) \ 99 - __ret = 1; \ 100 - __ret; \ 101 - }) 102 - 103 112 #ifndef __ASSEMBLER__ 104 113 105 114 struct omap_board_data; ··· 100 127 extern void omap_serial_board_init(struct omap_uart_port_info *platform_data); 101 128 extern void omap_serial_init_port(struct omap_board_data *bdata, 102 129 struct omap_uart_port_info *platform_data); 103 - #endif 104 - 105 130 #endif
+4 -93
arch/arm/plat-omap/include/plat/sram.h
··· 1 - /* 2 - * arch/arm/plat-omap/include/mach/sram.h 3 - * 4 - * Interface for functions that need to be run in internal SRAM 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 - */ 1 + int omap_sram_init(void); 10 2 11 - #ifndef __ARCH_ARM_OMAP_SRAM_H 12 - #define __ARCH_ARM_OMAP_SRAM_H 13 - 14 - #ifndef __ASSEMBLY__ 15 - #include <asm/fncpy.h> 3 + void omap_map_sram(unsigned long start, unsigned long size, 4 + unsigned long skip, int cached); 5 + void omap_sram_reset(void); 16 6 17 7 extern void *omap_sram_push_address(unsigned long size); 18 8 ··· 14 24 _res = fncpy(_sram_address, &(funcp), size); \ 15 25 _res; \ 16 26 }) 17 - 18 - extern void omap_sram_reprogram_clock(u32 dpllctl, u32 ckctl); 19 - 20 - extern void omap2_sram_ddr_init(u32 *slow_dll_ctrl, u32 fast_dll_ctrl, 21 - u32 base_cs, u32 force_unlock); 22 - extern void omap2_sram_reprogram_sdrc(u32 perf_level, u32 dll_val, 23 - u32 mem_type); 24 - extern u32 omap2_set_prcm(u32 dpll_ctrl_val, u32 sdrc_rfr_val, int bypass); 25 - 26 - extern u32 omap3_configure_core_dpll( 27 - u32 m2, u32 unlock_dll, u32 f, u32 inc, 28 - u32 sdrc_rfr_ctrl_0, u32 sdrc_actim_ctrl_a_0, 29 - u32 sdrc_actim_ctrl_b_0, u32 sdrc_mr_0, 30 - u32 sdrc_rfr_ctrl_1, u32 sdrc_actim_ctrl_a_1, 31 - u32 sdrc_actim_ctrl_b_1, u32 sdrc_mr_1); 32 - extern void omap3_sram_restore_context(void); 33 - 34 - /* Do not use these */ 35 - extern void omap1_sram_reprogram_clock(u32 ckctl, u32 dpllctl); 36 - extern unsigned long omap1_sram_reprogram_clock_sz; 37 - 38 - extern void omap24xx_sram_reprogram_clock(u32 ckctl, u32 dpllctl); 39 - extern unsigned long omap24xx_sram_reprogram_clock_sz; 40 - 41 - extern void omap242x_sram_ddr_init(u32 *slow_dll_ctrl, u32 fast_dll_ctrl, 42 - u32 base_cs, u32 force_unlock); 43 - extern unsigned long omap242x_sram_ddr_init_sz; 44 - 45 - extern u32 omap242x_sram_set_prcm(u32 dpll_ctrl_val, u32 sdrc_rfr_val, 46 - int bypass); 47 - extern unsigned long omap242x_sram_set_prcm_sz; 48 - 49 - extern void omap242x_sram_reprogram_sdrc(u32 perf_level, u32 dll_val, 50 - u32 mem_type); 51 - extern unsigned long omap242x_sram_reprogram_sdrc_sz; 52 - 53 - 54 - extern void omap243x_sram_ddr_init(u32 *slow_dll_ctrl, u32 fast_dll_ctrl, 55 - u32 base_cs, u32 force_unlock); 56 - extern unsigned long omap243x_sram_ddr_init_sz; 57 - 58 - extern u32 omap243x_sram_set_prcm(u32 dpll_ctrl_val, u32 sdrc_rfr_val, 59 - int bypass); 60 - extern unsigned long omap243x_sram_set_prcm_sz; 61 - 62 - extern void omap243x_sram_reprogram_sdrc(u32 perf_level, u32 dll_val, 63 - u32 mem_type); 64 - extern unsigned long omap243x_sram_reprogram_sdrc_sz; 65 - 66 - extern u32 omap3_sram_configure_core_dpll( 67 - u32 m2, u32 unlock_dll, u32 f, u32 inc, 68 - u32 sdrc_rfr_ctrl_0, u32 sdrc_actim_ctrl_a_0, 69 - u32 sdrc_actim_ctrl_b_0, u32 sdrc_mr_0, 70 - u32 sdrc_rfr_ctrl_1, u32 sdrc_actim_ctrl_a_1, 71 - u32 sdrc_actim_ctrl_b_1, u32 sdrc_mr_1); 72 - extern unsigned long omap3_sram_configure_core_dpll_sz; 73 - 74 - #ifdef CONFIG_PM 75 - extern void omap_push_sram_idle(void); 76 - #else 77 - static inline void omap_push_sram_idle(void) {} 78 - #endif /* CONFIG_PM */ 79 - 80 - #endif /* __ASSEMBLY__ */ 81 - 82 - /* 83 - * OMAP2+: define the SRAM PA addresses. 84 - * Used by the SRAM management code and the idle sleep code. 85 - */ 86 - #define OMAP2_SRAM_PA 0x40200000 87 - #define OMAP3_SRAM_PA 0x40200000 88 - #ifdef CONFIG_OMAP4_ERRATA_I688 89 - #define OMAP4_SRAM_PA 0x40304000 90 - #define OMAP4_SRAM_VA 0xfe404000 91 - #else 92 - #define OMAP4_SRAM_PA 0x40300000 93 - #endif 94 - #define AM33XX_SRAM_PA 0x40300000 95 - #endif
arch/arm/plat-omap/include/plat/tc.h arch/arm/mach-omap1/include/mach/tc.h
-204
arch/arm/plat-omap/include/plat/uncompress.h
··· 1 - /* 2 - * arch/arm/plat-omap/include/mach/uncompress.h 3 - * 4 - * Serial port stubs for kernel decompress status messages 5 - * 6 - * Initially based on: 7 - * linux-2.4.15-rmk1-dsplinux1.6/arch/arm/plat-omap/include/mach1510/uncompress.h 8 - * Copyright (C) 2000 RidgeRun, Inc. 9 - * Author: Greg Lonnon <glonnon@ridgerun.com> 10 - * 11 - * Rewritten by: 12 - * Author: <source@mvista.com> 13 - * 2004 (c) MontaVista Software, Inc. 14 - * 15 - * This file is licensed under the terms of the GNU General Public License 16 - * version 2. This program is licensed "as is" without any warranty of any 17 - * kind, whether express or implied. 18 - */ 19 - 20 - #include <linux/types.h> 21 - #include <linux/serial_reg.h> 22 - 23 - #include <asm/memory.h> 24 - #include <asm/mach-types.h> 25 - 26 - #include <plat/serial.h> 27 - 28 - #define MDR1_MODE_MASK 0x07 29 - 30 - volatile u8 *uart_base; 31 - int uart_shift; 32 - 33 - /* 34 - * Store the DEBUG_LL uart number into memory. 35 - * See also debug-macro.S, and serial.c for related code. 36 - */ 37 - static void set_omap_uart_info(unsigned char port) 38 - { 39 - /* 40 - * Get address of some.bss variable and round it down 41 - * a la CONFIG_AUTO_ZRELADDR. 42 - */ 43 - u32 ram_start = (u32)&uart_shift & 0xf8000000; 44 - u32 *uart_info = (u32 *)(ram_start + OMAP_UART_INFO_OFS); 45 - *uart_info = port; 46 - } 47 - 48 - static void putc(int c) 49 - { 50 - if (!uart_base) 51 - return; 52 - 53 - /* Check for UART 16x mode */ 54 - if ((uart_base[UART_OMAP_MDR1 << uart_shift] & MDR1_MODE_MASK) != 0) 55 - return; 56 - 57 - while (!(uart_base[UART_LSR << uart_shift] & UART_LSR_THRE)) 58 - barrier(); 59 - uart_base[UART_TX << uart_shift] = c; 60 - } 61 - 62 - static inline void flush(void) 63 - { 64 - } 65 - 66 - /* 67 - * Macros to configure UART1 and debug UART 68 - */ 69 - #define _DEBUG_LL_ENTRY(mach, dbg_uart, dbg_shft, dbg_id) \ 70 - if (machine_is_##mach()) { \ 71 - uart_base = (volatile u8 *)(dbg_uart); \ 72 - uart_shift = (dbg_shft); \ 73 - port = (dbg_id); \ 74 - set_omap_uart_info(port); \ 75 - break; \ 76 - } 77 - 78 - #define DEBUG_LL_OMAP7XX(p, mach) \ 79 - _DEBUG_LL_ENTRY(mach, OMAP1_UART##p##_BASE, OMAP7XX_PORT_SHIFT, \ 80 - OMAP1UART##p) 81 - 82 - #define DEBUG_LL_OMAP1(p, mach) \ 83 - _DEBUG_LL_ENTRY(mach, OMAP1_UART##p##_BASE, OMAP_PORT_SHIFT, \ 84 - OMAP1UART##p) 85 - 86 - #define DEBUG_LL_OMAP2(p, mach) \ 87 - _DEBUG_LL_ENTRY(mach, OMAP2_UART##p##_BASE, OMAP_PORT_SHIFT, \ 88 - OMAP2UART##p) 89 - 90 - #define DEBUG_LL_OMAP3(p, mach) \ 91 - _DEBUG_LL_ENTRY(mach, OMAP3_UART##p##_BASE, OMAP_PORT_SHIFT, \ 92 - OMAP3UART##p) 93 - 94 - #define DEBUG_LL_OMAP4(p, mach) \ 95 - _DEBUG_LL_ENTRY(mach, OMAP4_UART##p##_BASE, OMAP_PORT_SHIFT, \ 96 - OMAP4UART##p) 97 - 98 - #define DEBUG_LL_OMAP5(p, mach) \ 99 - _DEBUG_LL_ENTRY(mach, OMAP5_UART##p##_BASE, OMAP_PORT_SHIFT, \ 100 - OMAP5UART##p) 101 - /* Zoom2/3 shift is different for UART1 and external port */ 102 - #define DEBUG_LL_ZOOM(mach) \ 103 - _DEBUG_LL_ENTRY(mach, ZOOM_UART_BASE, ZOOM_PORT_SHIFT, ZOOM_UART) 104 - 105 - #define DEBUG_LL_TI81XX(p, mach) \ 106 - _DEBUG_LL_ENTRY(mach, TI81XX_UART##p##_BASE, OMAP_PORT_SHIFT, \ 107 - TI81XXUART##p) 108 - 109 - #define DEBUG_LL_AM33XX(p, mach) \ 110 - _DEBUG_LL_ENTRY(mach, AM33XX_UART##p##_BASE, OMAP_PORT_SHIFT, \ 111 - AM33XXUART##p) 112 - 113 - static inline void arch_decomp_setup(void) 114 - { 115 - int port = 0; 116 - 117 - /* 118 - * Initialize the port based on the machine ID from the bootloader. 119 - * Note that we're using macros here instead of switch statement 120 - * as machine_is functions are optimized out for the boards that 121 - * are not selected. 122 - */ 123 - do { 124 - /* omap7xx/8xx based boards using UART1 with shift 0 */ 125 - DEBUG_LL_OMAP7XX(1, herald); 126 - DEBUG_LL_OMAP7XX(1, omap_perseus2); 127 - 128 - /* omap15xx/16xx based boards using UART1 */ 129 - DEBUG_LL_OMAP1(1, ams_delta); 130 - DEBUG_LL_OMAP1(1, nokia770); 131 - DEBUG_LL_OMAP1(1, omap_h2); 132 - DEBUG_LL_OMAP1(1, omap_h3); 133 - DEBUG_LL_OMAP1(1, omap_innovator); 134 - DEBUG_LL_OMAP1(1, omap_osk); 135 - DEBUG_LL_OMAP1(1, omap_palmte); 136 - DEBUG_LL_OMAP1(1, omap_palmz71); 137 - 138 - /* omap15xx/16xx based boards using UART2 */ 139 - DEBUG_LL_OMAP1(2, omap_palmtt); 140 - 141 - /* omap15xx/16xx based boards using UART3 */ 142 - DEBUG_LL_OMAP1(3, sx1); 143 - 144 - /* omap2 based boards using UART1 */ 145 - DEBUG_LL_OMAP2(1, omap_2430sdp); 146 - DEBUG_LL_OMAP2(1, omap_apollon); 147 - DEBUG_LL_OMAP2(1, omap_h4); 148 - 149 - /* omap2 based boards using UART3 */ 150 - DEBUG_LL_OMAP2(3, nokia_n800); 151 - DEBUG_LL_OMAP2(3, nokia_n810); 152 - DEBUG_LL_OMAP2(3, nokia_n810_wimax); 153 - 154 - /* omap3 based boards using UART1 */ 155 - DEBUG_LL_OMAP2(1, omap3evm); 156 - DEBUG_LL_OMAP3(1, omap_3430sdp); 157 - DEBUG_LL_OMAP3(1, omap_3630sdp); 158 - DEBUG_LL_OMAP3(1, omap3530_lv_som); 159 - DEBUG_LL_OMAP3(1, omap3_torpedo); 160 - 161 - /* omap3 based boards using UART3 */ 162 - DEBUG_LL_OMAP3(3, cm_t35); 163 - DEBUG_LL_OMAP3(3, cm_t3517); 164 - DEBUG_LL_OMAP3(3, cm_t3730); 165 - DEBUG_LL_OMAP3(3, craneboard); 166 - DEBUG_LL_OMAP3(3, devkit8000); 167 - DEBUG_LL_OMAP3(3, igep0020); 168 - DEBUG_LL_OMAP3(3, igep0030); 169 - DEBUG_LL_OMAP3(3, nokia_rm680); 170 - DEBUG_LL_OMAP3(3, nokia_rm696); 171 - DEBUG_LL_OMAP3(3, nokia_rx51); 172 - DEBUG_LL_OMAP3(3, omap3517evm); 173 - DEBUG_LL_OMAP3(3, omap3_beagle); 174 - DEBUG_LL_OMAP3(3, omap3_pandora); 175 - DEBUG_LL_OMAP3(3, omap_ldp); 176 - DEBUG_LL_OMAP3(3, overo); 177 - DEBUG_LL_OMAP3(3, touchbook); 178 - 179 - /* omap4 based boards using UART3 */ 180 - DEBUG_LL_OMAP4(3, omap_4430sdp); 181 - DEBUG_LL_OMAP4(3, omap4_panda); 182 - 183 - /* omap5 based boards using UART3 */ 184 - DEBUG_LL_OMAP5(3, omap5_sevm); 185 - 186 - /* zoom2/3 external uart */ 187 - DEBUG_LL_ZOOM(omap_zoom2); 188 - DEBUG_LL_ZOOM(omap_zoom3); 189 - 190 - /* TI8168 base boards using UART3 */ 191 - DEBUG_LL_TI81XX(3, ti8168evm); 192 - 193 - /* TI8148 base boards using UART1 */ 194 - DEBUG_LL_TI81XX(1, ti8148evm); 195 - 196 - /* AM33XX base boards using UART1 */ 197 - DEBUG_LL_AM33XX(1, am335xevm); 198 - } while (0); 199 - } 200 - 201 - /* 202 - * nothing to do 203 - */ 204 - #define arch_decomp_wdog()
-179
arch/arm/plat-omap/include/plat/usb.h
··· 1 - // include/asm-arm/mach-omap/usb.h 2 - 3 - #ifndef __ASM_ARCH_OMAP_USB_H 4 - #define __ASM_ARCH_OMAP_USB_H 5 - 6 - #include <linux/io.h> 7 - #include <linux/platform_device.h> 8 - #include <linux/usb/musb.h> 9 - 10 - #define OMAP3_HS_USB_PORTS 3 11 - 12 - enum usbhs_omap_port_mode { 13 - OMAP_USBHS_PORT_MODE_UNUSED, 14 - OMAP_EHCI_PORT_MODE_PHY, 15 - OMAP_EHCI_PORT_MODE_TLL, 16 - OMAP_EHCI_PORT_MODE_HSIC, 17 - OMAP_OHCI_PORT_MODE_PHY_6PIN_DATSE0, 18 - OMAP_OHCI_PORT_MODE_PHY_6PIN_DPDM, 19 - OMAP_OHCI_PORT_MODE_PHY_3PIN_DATSE0, 20 - OMAP_OHCI_PORT_MODE_PHY_4PIN_DPDM, 21 - OMAP_OHCI_PORT_MODE_TLL_6PIN_DATSE0, 22 - OMAP_OHCI_PORT_MODE_TLL_6PIN_DPDM, 23 - OMAP_OHCI_PORT_MODE_TLL_3PIN_DATSE0, 24 - OMAP_OHCI_PORT_MODE_TLL_4PIN_DPDM, 25 - OMAP_OHCI_PORT_MODE_TLL_2PIN_DATSE0, 26 - OMAP_OHCI_PORT_MODE_TLL_2PIN_DPDM 27 - }; 28 - 29 - struct usbhs_omap_board_data { 30 - enum usbhs_omap_port_mode port_mode[OMAP3_HS_USB_PORTS]; 31 - 32 - /* have to be valid if phy_reset is true and portx is in phy mode */ 33 - int reset_gpio_port[OMAP3_HS_USB_PORTS]; 34 - 35 - /* Set this to true for ES2.x silicon */ 36 - unsigned es2_compatibility:1; 37 - 38 - unsigned phy_reset:1; 39 - 40 - /* 41 - * Regulators for USB PHYs. 42 - * Each PHY can have a separate regulator. 43 - */ 44 - struct regulator *regulator[OMAP3_HS_USB_PORTS]; 45 - }; 46 - 47 - #ifdef CONFIG_ARCH_OMAP2PLUS 48 - 49 - struct ehci_hcd_omap_platform_data { 50 - enum usbhs_omap_port_mode port_mode[OMAP3_HS_USB_PORTS]; 51 - int reset_gpio_port[OMAP3_HS_USB_PORTS]; 52 - struct regulator *regulator[OMAP3_HS_USB_PORTS]; 53 - unsigned phy_reset:1; 54 - }; 55 - 56 - struct ohci_hcd_omap_platform_data { 57 - enum usbhs_omap_port_mode port_mode[OMAP3_HS_USB_PORTS]; 58 - unsigned es2_compatibility:1; 59 - }; 60 - 61 - struct usbhs_omap_platform_data { 62 - enum usbhs_omap_port_mode port_mode[OMAP3_HS_USB_PORTS]; 63 - 64 - struct ehci_hcd_omap_platform_data *ehci_data; 65 - struct ohci_hcd_omap_platform_data *ohci_data; 66 - }; 67 - 68 - struct usbtll_omap_platform_data { 69 - enum usbhs_omap_port_mode port_mode[OMAP3_HS_USB_PORTS]; 70 - }; 71 - /*-------------------------------------------------------------------------*/ 72 - 73 - struct omap_musb_board_data { 74 - u8 interface_type; 75 - u8 mode; 76 - u16 power; 77 - unsigned extvbus:1; 78 - void (*set_phy_power)(u8 on); 79 - void (*clear_irq)(void); 80 - void (*set_mode)(u8 mode); 81 - void (*reset)(void); 82 - }; 83 - 84 - enum musb_interface {MUSB_INTERFACE_ULPI, MUSB_INTERFACE_UTMI}; 85 - 86 - extern void usb_musb_init(struct omap_musb_board_data *board_data); 87 - 88 - extern void usbhs_init(const struct usbhs_omap_board_data *pdata); 89 - extern int omap_tll_enable(void); 90 - extern int omap_tll_disable(void); 91 - 92 - extern int omap4430_phy_power(struct device *dev, int ID, int on); 93 - extern int omap4430_phy_set_clk(struct device *dev, int on); 94 - extern int omap4430_phy_init(struct device *dev); 95 - extern int omap4430_phy_exit(struct device *dev); 96 - extern int omap4430_phy_suspend(struct device *dev, int suspend); 97 - 98 - #endif 99 - 100 - extern void am35x_musb_reset(void); 101 - extern void am35x_musb_phy_power(u8 on); 102 - extern void am35x_musb_clear_irq(void); 103 - extern void am35x_set_mode(u8 musb_mode); 104 - extern void ti81xx_musb_phy_power(u8 on); 105 - 106 - /* AM35x */ 107 - /* USB 2.0 PHY Control */ 108 - #define CONF2_PHY_GPIOMODE (1 << 23) 109 - #define CONF2_OTGMODE (3 << 14) 110 - #define CONF2_NO_OVERRIDE (0 << 14) 111 - #define CONF2_FORCE_HOST (1 << 14) 112 - #define CONF2_FORCE_DEVICE (2 << 14) 113 - #define CONF2_FORCE_HOST_VBUS_LOW (3 << 14) 114 - #define CONF2_SESENDEN (1 << 13) 115 - #define CONF2_VBDTCTEN (1 << 12) 116 - #define CONF2_REFFREQ_24MHZ (2 << 8) 117 - #define CONF2_REFFREQ_26MHZ (7 << 8) 118 - #define CONF2_REFFREQ_13MHZ (6 << 8) 119 - #define CONF2_REFFREQ (0xf << 8) 120 - #define CONF2_PHYCLKGD (1 << 7) 121 - #define CONF2_VBUSSENSE (1 << 6) 122 - #define CONF2_PHY_PLLON (1 << 5) 123 - #define CONF2_RESET (1 << 4) 124 - #define CONF2_PHYPWRDN (1 << 3) 125 - #define CONF2_OTGPWRDN (1 << 2) 126 - #define CONF2_DATPOL (1 << 1) 127 - 128 - /* TI81XX specific definitions */ 129 - #define USBCTRL0 0x620 130 - #define USBSTAT0 0x624 131 - 132 - /* TI816X PHY controls bits */ 133 - #define TI816X_USBPHY0_NORMAL_MODE (1 << 0) 134 - #define TI816X_USBPHY_REFCLK_OSC (1 << 8) 135 - 136 - /* TI814X PHY controls bits */ 137 - #define USBPHY_CM_PWRDN (1 << 0) 138 - #define USBPHY_OTG_PWRDN (1 << 1) 139 - #define USBPHY_CHGDET_DIS (1 << 2) 140 - #define USBPHY_CHGDET_RSTRT (1 << 3) 141 - #define USBPHY_SRCONDM (1 << 4) 142 - #define USBPHY_SINKONDP (1 << 5) 143 - #define USBPHY_CHGISINK_EN (1 << 6) 144 - #define USBPHY_CHGVSRC_EN (1 << 7) 145 - #define USBPHY_DMPULLUP (1 << 8) 146 - #define USBPHY_DPPULLUP (1 << 9) 147 - #define USBPHY_CDET_EXTCTL (1 << 10) 148 - #define USBPHY_GPIO_MODE (1 << 12) 149 - #define USBPHY_DPOPBUFCTL (1 << 13) 150 - #define USBPHY_DMOPBUFCTL (1 << 14) 151 - #define USBPHY_DPINPUT (1 << 15) 152 - #define USBPHY_DMINPUT (1 << 16) 153 - #define USBPHY_DPGPIO_PD (1 << 17) 154 - #define USBPHY_DMGPIO_PD (1 << 18) 155 - #define USBPHY_OTGVDET_EN (1 << 19) 156 - #define USBPHY_OTGSESSEND_EN (1 << 20) 157 - #define USBPHY_DATA_POLARITY (1 << 23) 158 - 159 - #if defined(CONFIG_ARCH_OMAP1) && defined(CONFIG_USB) 160 - u32 omap1_usb0_init(unsigned nwires, unsigned is_device); 161 - u32 omap1_usb1_init(unsigned nwires); 162 - u32 omap1_usb2_init(unsigned nwires, unsigned alt_pingroup); 163 - #else 164 - static inline u32 omap1_usb0_init(unsigned nwires, unsigned is_device) 165 - { 166 - return 0; 167 - } 168 - static inline u32 omap1_usb1_init(unsigned nwires) 169 - { 170 - return 0; 171 - 172 - } 173 - static inline u32 omap1_usb2_init(unsigned nwires, unsigned alt_pingroup) 174 - { 175 - return 0; 176 - } 177 - #endif 178 - 179 - #endif /* __ASM_ARCH_OMAP_USB_H */
+2
arch/arm/plat-omap/include/plat/vrfb.h include/video/omapvrfb.h
··· 36 36 }; 37 37 38 38 #ifdef CONFIG_OMAP2_VRFB 39 + extern bool omap_vrfb_supported(void); 39 40 extern int omap_vrfb_request_ctx(struct vrfb *vrfb); 40 41 extern void omap_vrfb_release_ctx(struct vrfb *vrfb); 41 42 extern void omap_vrfb_adjust_size(u16 *width, u16 *height, ··· 50 49 extern void omap_vrfb_restore_context(void); 51 50 52 51 #else 52 + static inline bool omap_vrfb_supported(void) { return false; } 53 53 static inline int omap_vrfb_request_ctx(struct vrfb *vrfb) { return 0; } 54 54 static inline void omap_vrfb_release_ctx(struct vrfb *vrfb) {} 55 55 static inline void omap_vrfb_adjust_size(u16 *width, u16 *height,
+2 -3
arch/arm/plat-omap/omap-pm-noop.c arch/arm/mach-omap2/omap-pm-noop.c
··· 22 22 #include <linux/device.h> 23 23 #include <linux/platform_device.h> 24 24 25 - /* Interface documentation is in mach/omap-pm.h */ 26 - #include <plat/omap-pm.h> 27 - #include <plat/omap_device.h> 25 + #include "omap_device.h" 26 + #include "omap-pm.h" 28 27 29 28 static bool off_mode_enabled; 30 29 static int dummy_context_loss_counter;
+2 -3
arch/arm/plat-omap/omap_device.c arch/arm/mach-omap2/omap_device.c
··· 89 89 #include <linux/of.h> 90 90 #include <linux/notifier.h> 91 91 92 - #include <plat/omap_device.h> 93 - #include <plat/omap_hwmod.h> 94 - #include <plat/clock.h> 92 + #include "omap_device.h" 93 + #include "omap_hwmod.h" 95 94 96 95 /* These parameters are passed to _omap_device_{de,}activate() */ 97 96 #define USE_WAKEUP_LAT 0
+28 -338
arch/arm/plat-omap/sram.c
··· 20 20 #include <linux/init.h> 21 21 #include <linux/io.h> 22 22 23 + #include <asm/fncpy.h> 23 24 #include <asm/tlb.h> 24 25 #include <asm/cacheflush.h> 25 26 26 27 #include <asm/mach/map.h> 27 28 28 - #include <plat/sram.h> 29 - #include <plat/cpu.h> 30 - 31 - #include "sram.h" 32 - 33 - /* XXX These "sideways" includes will disappear when sram.c becomes a driver */ 34 - #include "../mach-omap2/iomap.h" 35 - #include "../mach-omap2/prm2xxx_3xxx.h" 36 - #include "../mach-omap2/sdrc.h" 37 - 38 - #define OMAP1_SRAM_PA 0x20000000 39 - #define OMAP2_SRAM_PUB_PA (OMAP2_SRAM_PA + 0xf800) 40 - #define OMAP3_SRAM_PUB_PA (OMAP3_SRAM_PA + 0x8000) 41 - #ifdef CONFIG_OMAP4_ERRATA_I688 42 - #define OMAP4_SRAM_PUB_PA OMAP4_SRAM_PA 43 - #else 44 - #define OMAP4_SRAM_PUB_PA (OMAP4_SRAM_PA + 0x4000) 45 - #endif 46 - #define OMAP5_SRAM_PA 0x40300000 47 - 48 - #if defined(CONFIG_ARCH_OMAP2PLUS) 49 - #define SRAM_BOOTLOADER_SZ 0x00 50 - #else 51 - #define SRAM_BOOTLOADER_SZ 0x80 52 - #endif 53 - 54 - #define OMAP24XX_VA_REQINFOPERM0 OMAP2_L3_IO_ADDRESS(0x68005048) 55 - #define OMAP24XX_VA_READPERM0 OMAP2_L3_IO_ADDRESS(0x68005050) 56 - #define OMAP24XX_VA_WRITEPERM0 OMAP2_L3_IO_ADDRESS(0x68005058) 57 - 58 - #define OMAP34XX_VA_REQINFOPERM0 OMAP2_L3_IO_ADDRESS(0x68012848) 59 - #define OMAP34XX_VA_READPERM0 OMAP2_L3_IO_ADDRESS(0x68012850) 60 - #define OMAP34XX_VA_WRITEPERM0 OMAP2_L3_IO_ADDRESS(0x68012858) 61 - #define OMAP34XX_VA_ADDR_MATCH2 OMAP2_L3_IO_ADDRESS(0x68012880) 62 - #define OMAP34XX_VA_SMS_RG_ATT0 OMAP2_L3_IO_ADDRESS(0x6C000048) 63 - 64 - #define GP_DEVICE 0x300 65 - 66 29 #define ROUND_DOWN(value,boundary) ((value) & (~((boundary)-1))) 67 30 68 - static unsigned long omap_sram_start; 69 31 static void __iomem *omap_sram_base; 70 32 static unsigned long omap_sram_skip; 71 33 static unsigned long omap_sram_size; 72 34 static void __iomem *omap_sram_ceil; 73 - 74 - /* 75 - * Depending on the target RAMFS firewall setup, the public usable amount of 76 - * SRAM varies. The default accessible size for all device types is 2k. A GP 77 - * device allows ARM11 but not other initiators for full size. This 78 - * functionality seems ok until some nice security API happens. 79 - */ 80 - static int is_sram_locked(void) 81 - { 82 - if (OMAP2_DEVICE_TYPE_GP == omap_type()) { 83 - /* RAMFW: R/W access to all initiators for all qualifier sets */ 84 - if (cpu_is_omap242x()) { 85 - __raw_writel(0xFF, OMAP24XX_VA_REQINFOPERM0); /* all q-vects */ 86 - __raw_writel(0xCFDE, OMAP24XX_VA_READPERM0); /* all i-read */ 87 - __raw_writel(0xCFDE, OMAP24XX_VA_WRITEPERM0); /* all i-write */ 88 - } 89 - if (cpu_is_omap34xx()) { 90 - __raw_writel(0xFFFF, OMAP34XX_VA_REQINFOPERM0); /* all q-vects */ 91 - __raw_writel(0xFFFF, OMAP34XX_VA_READPERM0); /* all i-read */ 92 - __raw_writel(0xFFFF, OMAP34XX_VA_WRITEPERM0); /* all i-write */ 93 - __raw_writel(0x0, OMAP34XX_VA_ADDR_MATCH2); 94 - __raw_writel(0xFFFFFFFF, OMAP34XX_VA_SMS_RG_ATT0); 95 - } 96 - return 0; 97 - } else 98 - return 1; /* assume locked with no PPA or security driver */ 99 - } 100 - 101 - /* 102 - * The amount of SRAM depends on the core type. 103 - * Note that we cannot try to test for SRAM here because writes 104 - * to secure SRAM will hang the system. Also the SRAM is not 105 - * yet mapped at this point. 106 - */ 107 - static void __init omap_detect_sram(void) 108 - { 109 - omap_sram_skip = SRAM_BOOTLOADER_SZ; 110 - if (cpu_class_is_omap2()) { 111 - if (is_sram_locked()) { 112 - if (cpu_is_omap34xx()) { 113 - omap_sram_start = OMAP3_SRAM_PUB_PA; 114 - if ((omap_type() == OMAP2_DEVICE_TYPE_EMU) || 115 - (omap_type() == OMAP2_DEVICE_TYPE_SEC)) { 116 - omap_sram_size = 0x7000; /* 28K */ 117 - omap_sram_skip += SZ_16K; 118 - } else { 119 - omap_sram_size = 0x8000; /* 32K */ 120 - } 121 - } else if (cpu_is_omap44xx()) { 122 - omap_sram_start = OMAP4_SRAM_PUB_PA; 123 - omap_sram_size = 0xa000; /* 40K */ 124 - } else if (soc_is_omap54xx()) { 125 - omap_sram_start = OMAP5_SRAM_PA; 126 - omap_sram_size = SZ_128K; /* 128KB */ 127 - } else { 128 - omap_sram_start = OMAP2_SRAM_PUB_PA; 129 - omap_sram_size = 0x800; /* 2K */ 130 - } 131 - } else { 132 - if (soc_is_am33xx()) { 133 - omap_sram_start = AM33XX_SRAM_PA; 134 - omap_sram_size = 0x10000; /* 64K */ 135 - } else if (cpu_is_omap34xx()) { 136 - omap_sram_start = OMAP3_SRAM_PA; 137 - omap_sram_size = 0x10000; /* 64K */ 138 - } else if (cpu_is_omap44xx()) { 139 - omap_sram_start = OMAP4_SRAM_PA; 140 - omap_sram_size = 0xe000; /* 56K */ 141 - } else if (soc_is_omap54xx()) { 142 - omap_sram_start = OMAP5_SRAM_PA; 143 - omap_sram_size = SZ_128K; /* 128KB */ 144 - } else { 145 - omap_sram_start = OMAP2_SRAM_PA; 146 - if (cpu_is_omap242x()) 147 - omap_sram_size = 0xa0000; /* 640K */ 148 - else if (cpu_is_omap243x()) 149 - omap_sram_size = 0x10000; /* 64K */ 150 - } 151 - } 152 - } else { 153 - omap_sram_start = OMAP1_SRAM_PA; 154 - 155 - if (cpu_is_omap7xx()) 156 - omap_sram_size = 0x32000; /* 200K */ 157 - else if (cpu_is_omap15xx()) 158 - omap_sram_size = 0x30000; /* 192K */ 159 - else if (cpu_is_omap1610() || cpu_is_omap1611() || 160 - cpu_is_omap1621() || cpu_is_omap1710()) 161 - omap_sram_size = 0x4000; /* 16K */ 162 - else { 163 - pr_err("Could not detect SRAM size\n"); 164 - omap_sram_size = 0x4000; 165 - } 166 - } 167 - } 168 - 169 - /* 170 - * Note that we cannot use ioremap for SRAM, as clock init needs SRAM early. 171 - */ 172 - static void __init omap_map_sram(void) 173 - { 174 - int cached = 1; 175 - 176 - if (omap_sram_size == 0) 177 - return; 178 - 179 - #ifdef CONFIG_OMAP4_ERRATA_I688 180 - if (cpu_is_omap44xx()) { 181 - omap_sram_start += PAGE_SIZE; 182 - omap_sram_size -= SZ_16K; 183 - } 184 - #endif 185 - if (cpu_is_omap34xx()) { 186 - /* 187 - * SRAM must be marked as non-cached on OMAP3 since the 188 - * CORE DPLL M2 divider change code (in SRAM) runs with the 189 - * SDRAM controller disabled, and if it is marked cached, 190 - * the ARM may attempt to write cache lines back to SDRAM 191 - * which will cause the system to hang. 192 - */ 193 - cached = 0; 194 - } 195 - 196 - omap_sram_start = ROUND_DOWN(omap_sram_start, PAGE_SIZE); 197 - omap_sram_base = __arm_ioremap_exec(omap_sram_start, omap_sram_size, 198 - cached); 199 - if (!omap_sram_base) { 200 - pr_err("SRAM: Could not map\n"); 201 - return; 202 - } 203 - 204 - omap_sram_ceil = omap_sram_base + omap_sram_size; 205 - 206 - /* 207 - * Looks like we need to preserve some bootloader code at the 208 - * beginning of SRAM for jumping to flash for reboot to work... 209 - */ 210 - memset_io(omap_sram_base + omap_sram_skip, 0, 211 - omap_sram_size - omap_sram_skip); 212 - } 213 35 214 36 /* 215 37 * Memory allocator for SRAM: calculates the new ceiling address ··· 58 236 return (void *)omap_sram_ceil; 59 237 } 60 238 61 - #ifdef CONFIG_ARCH_OMAP1 62 - 63 - static void (*_omap_sram_reprogram_clock)(u32 dpllctl, u32 ckctl); 64 - 65 - void omap_sram_reprogram_clock(u32 dpllctl, u32 ckctl) 66 - { 67 - BUG_ON(!_omap_sram_reprogram_clock); 68 - /* On 730, bit 13 must always be 1 */ 69 - if (cpu_is_omap7xx()) 70 - ckctl |= 0x2000; 71 - _omap_sram_reprogram_clock(dpllctl, ckctl); 72 - } 73 - 74 - static int __init omap1_sram_init(void) 75 - { 76 - _omap_sram_reprogram_clock = 77 - omap_sram_push(omap1_sram_reprogram_clock, 78 - omap1_sram_reprogram_clock_sz); 79 - 80 - return 0; 81 - } 82 - 83 - #else 84 - #define omap1_sram_init() do {} while (0) 85 - #endif 86 - 87 - #if defined(CONFIG_ARCH_OMAP2) 88 - 89 - static void (*_omap2_sram_ddr_init)(u32 *slow_dll_ctrl, u32 fast_dll_ctrl, 90 - u32 base_cs, u32 force_unlock); 91 - 92 - void omap2_sram_ddr_init(u32 *slow_dll_ctrl, u32 fast_dll_ctrl, 93 - u32 base_cs, u32 force_unlock) 94 - { 95 - BUG_ON(!_omap2_sram_ddr_init); 96 - _omap2_sram_ddr_init(slow_dll_ctrl, fast_dll_ctrl, 97 - base_cs, force_unlock); 98 - } 99 - 100 - static void (*_omap2_sram_reprogram_sdrc)(u32 perf_level, u32 dll_val, 101 - u32 mem_type); 102 - 103 - void omap2_sram_reprogram_sdrc(u32 perf_level, u32 dll_val, u32 mem_type) 104 - { 105 - BUG_ON(!_omap2_sram_reprogram_sdrc); 106 - _omap2_sram_reprogram_sdrc(perf_level, dll_val, mem_type); 107 - } 108 - 109 - static u32 (*_omap2_set_prcm)(u32 dpll_ctrl_val, u32 sdrc_rfr_val, int bypass); 110 - 111 - u32 omap2_set_prcm(u32 dpll_ctrl_val, u32 sdrc_rfr_val, int bypass) 112 - { 113 - BUG_ON(!_omap2_set_prcm); 114 - return _omap2_set_prcm(dpll_ctrl_val, sdrc_rfr_val, bypass); 115 - } 116 - #endif 117 - 118 - #ifdef CONFIG_SOC_OMAP2420 119 - static int __init omap242x_sram_init(void) 120 - { 121 - _omap2_sram_ddr_init = omap_sram_push(omap242x_sram_ddr_init, 122 - omap242x_sram_ddr_init_sz); 123 - 124 - _omap2_sram_reprogram_sdrc = omap_sram_push(omap242x_sram_reprogram_sdrc, 125 - omap242x_sram_reprogram_sdrc_sz); 126 - 127 - _omap2_set_prcm = omap_sram_push(omap242x_sram_set_prcm, 128 - omap242x_sram_set_prcm_sz); 129 - 130 - return 0; 131 - } 132 - #else 133 - static inline int omap242x_sram_init(void) 134 - { 135 - return 0; 136 - } 137 - #endif 138 - 139 - #ifdef CONFIG_SOC_OMAP2430 140 - static int __init omap243x_sram_init(void) 141 - { 142 - _omap2_sram_ddr_init = omap_sram_push(omap243x_sram_ddr_init, 143 - omap243x_sram_ddr_init_sz); 144 - 145 - _omap2_sram_reprogram_sdrc = omap_sram_push(omap243x_sram_reprogram_sdrc, 146 - omap243x_sram_reprogram_sdrc_sz); 147 - 148 - _omap2_set_prcm = omap_sram_push(omap243x_sram_set_prcm, 149 - omap243x_sram_set_prcm_sz); 150 - 151 - return 0; 152 - } 153 - #else 154 - static inline int omap243x_sram_init(void) 155 - { 156 - return 0; 157 - } 158 - #endif 159 - 160 - #ifdef CONFIG_ARCH_OMAP3 161 - 162 - static u32 (*_omap3_sram_configure_core_dpll)( 163 - u32 m2, u32 unlock_dll, u32 f, u32 inc, 164 - u32 sdrc_rfr_ctrl_0, u32 sdrc_actim_ctrl_a_0, 165 - u32 sdrc_actim_ctrl_b_0, u32 sdrc_mr_0, 166 - u32 sdrc_rfr_ctrl_1, u32 sdrc_actim_ctrl_a_1, 167 - u32 sdrc_actim_ctrl_b_1, u32 sdrc_mr_1); 168 - 169 - u32 omap3_configure_core_dpll(u32 m2, u32 unlock_dll, u32 f, u32 inc, 170 - u32 sdrc_rfr_ctrl_0, u32 sdrc_actim_ctrl_a_0, 171 - u32 sdrc_actim_ctrl_b_0, u32 sdrc_mr_0, 172 - u32 sdrc_rfr_ctrl_1, u32 sdrc_actim_ctrl_a_1, 173 - u32 sdrc_actim_ctrl_b_1, u32 sdrc_mr_1) 174 - { 175 - BUG_ON(!_omap3_sram_configure_core_dpll); 176 - return _omap3_sram_configure_core_dpll( 177 - m2, unlock_dll, f, inc, 178 - sdrc_rfr_ctrl_0, sdrc_actim_ctrl_a_0, 179 - sdrc_actim_ctrl_b_0, sdrc_mr_0, 180 - sdrc_rfr_ctrl_1, sdrc_actim_ctrl_a_1, 181 - sdrc_actim_ctrl_b_1, sdrc_mr_1); 182 - } 183 - 184 - void omap3_sram_restore_context(void) 239 + /* 240 + * The SRAM context is lost during off-idle and stack 241 + * needs to be reset. 242 + */ 243 + void omap_sram_reset(void) 185 244 { 186 245 omap_sram_ceil = omap_sram_base + omap_sram_size; 187 - 188 - _omap3_sram_configure_core_dpll = 189 - omap_sram_push(omap3_sram_configure_core_dpll, 190 - omap3_sram_configure_core_dpll_sz); 191 - omap_push_sram_idle(); 192 246 } 193 247 194 - static inline int omap34xx_sram_init(void) 248 + /* 249 + * Note that we cannot use ioremap for SRAM, as clock init needs SRAM early. 250 + */ 251 + void __init omap_map_sram(unsigned long start, unsigned long size, 252 + unsigned long skip, int cached) 195 253 { 196 - omap3_sram_restore_context(); 197 - return 0; 198 - } 199 - #else 200 - static inline int omap34xx_sram_init(void) 201 - { 202 - return 0; 203 - } 204 - #endif /* CONFIG_ARCH_OMAP3 */ 254 + if (size == 0) 255 + return; 205 256 206 - static inline int am33xx_sram_init(void) 207 - { 208 - return 0; 209 - } 257 + start = ROUND_DOWN(start, PAGE_SIZE); 258 + omap_sram_size = size; 259 + omap_sram_skip = skip; 260 + omap_sram_base = __arm_ioremap_exec(start, size, cached); 261 + if (!omap_sram_base) { 262 + pr_err("SRAM: Could not map\n"); 263 + return; 264 + } 210 265 211 - int __init omap_sram_init(void) 212 - { 213 - omap_detect_sram(); 214 - omap_map_sram(); 266 + omap_sram_reset(); 215 267 216 - if (!(cpu_class_is_omap2())) 217 - omap1_sram_init(); 218 - else if (cpu_is_omap242x()) 219 - omap242x_sram_init(); 220 - else if (cpu_is_omap2430()) 221 - omap243x_sram_init(); 222 - else if (soc_is_am33xx()) 223 - am33xx_sram_init(); 224 - else if (cpu_is_omap34xx()) 225 - omap34xx_sram_init(); 226 - 227 - return 0; 268 + /* 269 + * Looks like we need to preserve some bootloader code at the 270 + * beginning of SRAM for jumping to flash for reboot to work... 271 + */ 272 + memset_io(omap_sram_base + omap_sram_skip, 0, 273 + omap_sram_size - omap_sram_skip); 228 274 }
-6
arch/arm/plat-omap/sram.h
··· 1 - #ifndef __PLAT_OMAP_SRAM_H__ 2 - #define __PLAT_OMAP_SRAM_H__ 3 - 4 - extern int __init omap_sram_init(void); 5 - 6 - #endif /* __PLAT_OMAP_SRAM_H__ */
+1 -6
drivers/bluetooth/hci_ldisc.c
··· 270 270 */ 271 271 static int hci_uart_tty_open(struct tty_struct *tty) 272 272 { 273 - struct hci_uart *hu = (void *) tty->disc_data; 273 + struct hci_uart *hu; 274 274 275 275 BT_DBG("tty %p", tty); 276 - 277 - /* FIXME: This btw is bogus, nothing requires the old ldisc to clear 278 - the pointer */ 279 - if (hu) 280 - return -EEXIST; 281 276 282 277 /* Error if the tty has no write op instead of leaving an exploitable 283 278 hole */
-2
drivers/char/hw_random/omap-rng.c
··· 27 27 28 28 #include <asm/io.h> 29 29 30 - #include <plat/cpu.h> 31 - 32 30 #define RNG_OUT_REG 0x00 /* Output register */ 33 31 #define RNG_STAT_REG 0x04 /* Status register 34 32 [0] = STAT_BUSY */
+1 -7
drivers/crypto/omap-aes.c
··· 29 29 #include <crypto/scatterwalk.h> 30 30 #include <crypto/aes.h> 31 31 32 - #include <plat/cpu.h> 33 - #include <plat/dma.h> 32 + #include <plat-omap/dma-omap.h> 34 33 35 34 /* OMAP TRM gives bitfields as start:end, where start is the higher bit 36 35 number. For example 7:0 */ ··· 939 940 static int __init omap_aes_mod_init(void) 940 941 { 941 942 pr_info("loading %s driver\n", "omap-aes"); 942 - 943 - if (!cpu_class_is_omap2() || omap_type() != OMAP2_DEVICE_TYPE_SEC) { 944 - pr_err("Unsupported cpu\n"); 945 - return -ENODEV; 946 - } 947 943 948 944 return platform_driver_register(&omap_aes_driver); 949 945 }
+1 -9
drivers/crypto/omap-sham.c
··· 37 37 #include <crypto/hash.h> 38 38 #include <crypto/internal/hash.h> 39 39 40 - #include <plat/cpu.h> 41 - #include <plat/dma.h> 40 + #include <plat-omap/dma-omap.h> 42 41 #include <mach/irqs.h> 43 42 44 43 #define SHA_REG_DIGEST(x) (0x00 + ((x) * 0x04)) ··· 1287 1288 static int __init omap_sham_mod_init(void) 1288 1289 { 1289 1290 pr_info("loading %s driver\n", "omap-sham"); 1290 - 1291 - if (!cpu_class_is_omap2() || 1292 - (omap_type() != OMAP2_DEVICE_TYPE_SEC && 1293 - omap_type() != OMAP2_DEVICE_TYPE_EMU)) { 1294 - pr_err("Unsupported cpu\n"); 1295 - return -ENODEV; 1296 - } 1297 1291 1298 1292 return platform_driver_register(&omap_sham_driver); 1299 1293 }
+2 -3
drivers/dma/omap-dma.c
··· 19 19 20 20 #include "virt-dma.h" 21 21 22 - #include <plat/cpu.h> 23 - #include <plat/dma.h> 22 + #include <plat-omap/dma-omap.h> 24 23 25 24 struct omap_dmadev { 26 25 struct dma_device ddev; ··· 437 438 omap_disable_dma_irq(c->dma_ch, OMAP_DMA_BLOCK_IRQ); 438 439 } 439 440 440 - if (!cpu_class_is_omap1()) { 441 + if (dma_omap2plus()) { 441 442 omap_set_dma_src_burst_mode(c->dma_ch, OMAP_DMA_DATA_BURST_16); 442 443 omap_set_dma_dest_burst_mode(c->dma_ch, OMAP_DMA_DATA_BURST_16); 443 444 }
+2 -2
drivers/media/platform/omap/omap_vout.c
··· 45 45 #include <media/v4l2-ioctl.h> 46 46 47 47 #include <plat/cpu.h> 48 - #include <plat/dma.h> 49 - #include <plat/vrfb.h> 48 + #include <plat-omap/dma-omap.h> 49 + #include <video/omapvrfb.h> 50 50 #include <video/omapdss.h> 51 51 52 52 #include "omap_voutlib.h"
+4 -2
drivers/media/platform/omap/omap_vout_vrfb.c
··· 16 16 #include <media/videobuf-dma-contig.h> 17 17 #include <media/v4l2-device.h> 18 18 19 - #include <plat/dma.h> 20 - #include <plat/vrfb.h> 19 + #include <plat-omap/dma-omap.h> 20 + #include <video/omapvrfb.h> 21 21 22 22 #include "omap_voutdef.h" 23 23 #include "omap_voutlib.h" 24 + 25 + #define OMAP_DMA_NO_DEVICE 0 24 26 25 27 /* 26 28 * Function for allocating video buffers
+1 -1
drivers/media/platform/omap/omap_voutdef.h
··· 12 12 #define OMAP_VOUTDEF_H 13 13 14 14 #include <video/omapdss.h> 15 - #include <plat/vrfb.h> 15 + #include <video/omapvrfb.h> 16 16 17 17 #define YUYV_BPP 2 18 18 #define RGB565_BPP 2
+2
drivers/media/platform/omap3isp/isphist.c
··· 34 34 #include "ispreg.h" 35 35 #include "isphist.h" 36 36 37 + #define OMAP24XX_DMA_NO_DEVICE 0 38 + 37 39 #define HIST_CONFIG_DMA 1 38 40 39 41 #define HIST_USING_DMA(hist) ((hist)->dma_ch >= 0)
+1 -1
drivers/media/platform/omap3isp/ispstat.h
··· 30 30 31 31 #include <linux/types.h> 32 32 #include <linux/omap3isp.h> 33 - #include <plat/dma.h> 33 + #include <plat-omap/dma-omap.h> 34 34 #include <media/v4l2-event.h> 35 35 36 36 #include "isp.h"
-1
drivers/media/platform/omap3isp/ispvideo.c
··· 36 36 #include <media/v4l2-ioctl.h> 37 37 #include <plat/iommu.h> 38 38 #include <plat/iovmm.h> 39 - #include <plat/omap-pm.h> 40 39 41 40 #include "ispvideo.h" 42 41 #include "isp.h"
+2 -1
drivers/media/platform/soc_camera/omap1_camera.c
··· 34 34 #include <media/videobuf-dma-contig.h> 35 35 #include <media/videobuf-dma-sg.h> 36 36 37 - #include <plat/dma.h> 37 + #include <plat-omap/dma-omap.h> 38 38 39 39 40 40 #define DRIVER_NAME "omap1-camera" 41 41 #define DRIVER_VERSION "0.0.2" 42 42 43 + #define OMAP_DMA_CAMERA_IF_RX 20 43 44 44 45 /* 45 46 * ---------------------------------------------------------------------------
-1
drivers/media/rc/ir-rx51.c
··· 28 28 29 29 #include <plat/dmtimer.h> 30 30 #include <plat/clock.h> 31 - #include <plat/omap-pm.h> 32 31 33 32 #include <media/lirc.h> 34 33 #include <media/lirc_dev.h>
+1 -1
drivers/mfd/menelaus.c
··· 41 41 #include <linux/rtc.h> 42 42 #include <linux/bcd.h> 43 43 #include <linux/slab.h> 44 + #include <linux/mfd/menelaus.h> 44 45 45 46 #include <asm/mach/irq.h> 46 47 47 48 #include <asm/gpio.h> 48 - #include <plat/menelaus.h> 49 49 50 50 #define DRIVER_NAME "menelaus" 51 51
+4 -1
drivers/mfd/omap-usb-host.c
··· 26 26 #include <linux/spinlock.h> 27 27 #include <linux/gpio.h> 28 28 #include <plat/cpu.h> 29 - #include <plat/usb.h> 29 + #include <linux/platform_device.h> 30 + #include <linux/platform_data/usb-omap.h> 30 31 #include <linux/pm_runtime.h> 32 + 33 + #include "omap-usb.h" 31 34 32 35 #define USBHS_DRIVER_NAME "usbhs_omap" 33 36 #define OMAP_EHCI_DEVICE "ehci-omap"
+1 -1
drivers/mfd/omap-usb-tll.c
··· 25 25 #include <linux/clk.h> 26 26 #include <linux/io.h> 27 27 #include <linux/err.h> 28 - #include <plat/usb.h> 29 28 #include <linux/pm_runtime.h> 29 + #include <linux/platform_data/usb-omap.h> 30 30 31 31 #define USBTLL_DRIVER_NAME "usbhs_tll" 32 32
+2
drivers/mfd/omap-usb.h
··· 1 + extern int omap_tll_enable(void); 2 + extern int omap_tll_disable(void);
+26 -9
drivers/mmc/host/omap.c
··· 28 28 #include <linux/clk.h> 29 29 #include <linux/scatterlist.h> 30 30 #include <linux/slab.h> 31 + #include <linux/platform_data/mmc-omap.h> 31 32 32 - #include <plat/mmc.h> 33 - #include <plat/dma.h> 34 33 35 34 #define OMAP_MMC_REG_CMD 0x00 36 35 #define OMAP_MMC_REG_ARGL 0x01 ··· 71 72 #define OMAP_MMC_STAT_CARD_BUSY (1 << 2) 72 73 #define OMAP_MMC_STAT_END_OF_CMD (1 << 0) 73 74 75 + #define mmc_omap7xx() (host->features & MMC_OMAP7XX) 76 + #define mmc_omap15xx() (host->features & MMC_OMAP15XX) 77 + #define mmc_omap16xx() (host->features & MMC_OMAP16XX) 78 + #define MMC_OMAP1_MASK (MMC_OMAP7XX | MMC_OMAP15XX | MMC_OMAP16XX) 79 + #define mmc_omap1() (host->features & MMC_OMAP1_MASK) 80 + #define mmc_omap2() (!mmc_omap1()) 81 + 74 82 #define OMAP_MMC_REG(host, reg) (OMAP_MMC_REG_##reg << (host)->reg_shift) 75 83 #define OMAP_MMC_READ(host, reg) __raw_readw((host)->virt_base + OMAP_MMC_REG(host, reg)) 76 84 #define OMAP_MMC_WRITE(host, reg, val) __raw_writew((val), (host)->virt_base + OMAP_MMC_REG(host, reg)) ··· 89 83 #define OMAP_MMC_CMDTYPE_BCR 1 90 84 #define OMAP_MMC_CMDTYPE_AC 2 91 85 #define OMAP_MMC_CMDTYPE_ADTC 3 86 + 87 + #define OMAP_DMA_MMC_TX 21 88 + #define OMAP_DMA_MMC_RX 22 89 + #define OMAP_DMA_MMC2_TX 54 90 + #define OMAP_DMA_MMC2_RX 55 91 + 92 + #define OMAP24XX_DMA_MMC2_TX 47 93 + #define OMAP24XX_DMA_MMC2_RX 48 94 + #define OMAP24XX_DMA_MMC1_TX 61 95 + #define OMAP24XX_DMA_MMC1_RX 62 92 96 93 97 94 98 #define DRIVER_NAME "mmci-omap" ··· 163 147 u32 buffer_bytes_left; 164 148 u32 total_bytes_left; 165 149 150 + unsigned features; 166 151 unsigned use_dma:1; 167 152 unsigned brs_received:1, dma_done:1; 168 153 unsigned dma_in_use:1; ··· 1005 988 * blocksize is at least that large. Blocksize is 1006 989 * usually 512 bytes; but not for some SD reads. 1007 990 */ 1008 - burst = cpu_is_omap15xx() ? 32 : 64; 991 + burst = mmc_omap15xx() ? 32 : 64; 1009 992 if (burst > data->blksz) 1010 993 burst = data->blksz; 1011 994 ··· 1121 1104 if (slot->pdata->set_power != NULL) 1122 1105 slot->pdata->set_power(mmc_dev(slot->mmc), slot->id, power_on, 1123 1106 vdd); 1124 - 1125 - if (cpu_is_omap24xx()) { 1107 + if (mmc_omap2()) { 1126 1108 u16 w; 1127 1109 1128 1110 if (power_on) { ··· 1255 1239 mmc->ops = &mmc_omap_ops; 1256 1240 mmc->f_min = 400000; 1257 1241 1258 - if (cpu_class_is_omap2()) 1242 + if (mmc_omap2()) 1259 1243 mmc->f_max = 48000000; 1260 1244 else 1261 1245 mmc->f_max = 24000000; ··· 1375 1359 init_waitqueue_head(&host->slot_wq); 1376 1360 1377 1361 host->pdata = pdata; 1362 + host->features = host->pdata->slots[0].features; 1378 1363 host->dev = &pdev->dev; 1379 1364 platform_set_drvdata(pdev, host); 1380 1365 ··· 1408 1391 host->dma_tx_burst = -1; 1409 1392 host->dma_rx_burst = -1; 1410 1393 1411 - if (cpu_is_omap24xx()) 1394 + if (mmc_omap2()) 1412 1395 sig = host->id == 0 ? OMAP24XX_DMA_MMC1_TX : OMAP24XX_DMA_MMC2_TX; 1413 1396 else 1414 1397 sig = host->id == 0 ? OMAP_DMA_MMC_TX : OMAP_DMA_MMC2_TX; ··· 1424 1407 dev_warn(host->dev, "unable to obtain TX DMA engine channel %u\n", 1425 1408 sig); 1426 1409 #endif 1427 - if (cpu_is_omap24xx()) 1410 + if (mmc_omap2()) 1428 1411 sig = host->id == 0 ? OMAP24XX_DMA_MMC1_RX : OMAP24XX_DMA_MMC2_RX; 1429 1412 else 1430 1413 sig = host->id == 0 ? OMAP_DMA_MMC_RX : OMAP_DMA_MMC2_RX; ··· 1452 1435 } 1453 1436 1454 1437 host->nr_slots = pdata->nr_slots; 1455 - host->reg_shift = (cpu_is_omap7xx() ? 1 : 2); 1438 + host->reg_shift = (mmc_omap7xx() ? 1 : 2); 1456 1439 1457 1440 host->mmc_omap_wq = alloc_workqueue("mmc_omap", 0, 0); 1458 1441 if (!host->mmc_omap_wq)
+1 -3
drivers/mmc/host/omap_hsmmc.c
··· 38 38 #include <linux/gpio.h> 39 39 #include <linux/regulator/consumer.h> 40 40 #include <linux/pm_runtime.h> 41 - #include <mach/hardware.h> 42 - #include <plat/mmc.h> 43 - #include <plat/cpu.h> 41 + #include <linux/platform_data/mmc-omap.h> 44 42 45 43 /* OMAP HSMMC Host Controller Registers */ 46 44 #define OMAP_HSMMC_SYSSTATUS 0x0014
+107 -22
drivers/mtd/nand/omap2.c
··· 27 27 #include <linux/bch.h> 28 28 #endif 29 29 30 - #include <plat/dma.h> 31 - #include <plat/gpmc.h> 30 + #include <plat-omap/dma-omap.h> 32 31 #include <linux/platform_data/mtd-nand-omap2.h> 33 32 34 33 #define DRIVER_NAME "omap2-nand" ··· 105 106 #define CS_MASK 0x7 106 107 #define ENABLE_PREFETCH (0x1 << 7) 107 108 #define DMA_MPU_MODE_SHIFT 2 109 + #define ECCSIZE0_SHIFT 12 108 110 #define ECCSIZE1_SHIFT 22 109 111 #define ECC1RESULTSIZE 0x1 110 112 #define ECCCLEAR 0x100 111 113 #define ECC1 0x1 114 + #define PREFETCH_FIFOTHRESHOLD_MAX 0x40 115 + #define PREFETCH_FIFOTHRESHOLD(val) ((val) << 8) 116 + #define PREFETCH_STATUS_COUNT(val) (val & 0x00003fff) 117 + #define PREFETCH_STATUS_FIFO_CNT(val) ((val >> 24) & 0x7F) 118 + #define STATUS_BUFF_EMPTY 0x00000001 119 + 120 + #define OMAP24XX_DMA_GPMC 4 112 121 113 122 /* oob info generated runtime depending on ecc algorithm and layout selected */ 114 123 static struct nand_ecclayout omap_oobinfo; ··· 276 269 /* wait until buffer is available for write */ 277 270 do { 278 271 status = readl(info->reg.gpmc_status) & 279 - GPMC_STATUS_BUFF_EMPTY; 272 + STATUS_BUFF_EMPTY; 280 273 } while (!status); 281 274 } 282 275 } ··· 314 307 /* wait until buffer is available for write */ 315 308 do { 316 309 status = readl(info->reg.gpmc_status) & 317 - GPMC_STATUS_BUFF_EMPTY; 310 + STATUS_BUFF_EMPTY; 318 311 } while (!status); 319 312 } 320 313 } ··· 355 348 } else { 356 349 do { 357 350 r_count = readl(info->reg.gpmc_prefetch_status); 358 - r_count = GPMC_PREFETCH_STATUS_FIFO_CNT(r_count); 351 + r_count = PREFETCH_STATUS_FIFO_CNT(r_count); 359 352 r_count = r_count >> 2; 360 353 ioread32_rep(info->nand.IO_ADDR_R, p, r_count); 361 354 p += r_count; ··· 402 395 } else { 403 396 while (len) { 404 397 w_count = readl(info->reg.gpmc_prefetch_status); 405 - w_count = GPMC_PREFETCH_STATUS_FIFO_CNT(w_count); 398 + w_count = PREFETCH_STATUS_FIFO_CNT(w_count); 406 399 w_count = w_count >> 1; 407 400 for (i = 0; (i < w_count) && len; i++, len -= 2) 408 401 iowrite16(*p++, info->nand.IO_ADDR_W); ··· 414 407 do { 415 408 cpu_relax(); 416 409 val = readl(info->reg.gpmc_prefetch_status); 417 - val = GPMC_PREFETCH_STATUS_COUNT(val); 410 + val = PREFETCH_STATUS_COUNT(val); 418 411 } while (val && (tim++ < limit)); 419 412 420 413 /* disable and stop the PFPW engine */ ··· 500 493 do { 501 494 cpu_relax(); 502 495 val = readl(info->reg.gpmc_prefetch_status); 503 - val = GPMC_PREFETCH_STATUS_COUNT(val); 496 + val = PREFETCH_STATUS_COUNT(val); 504 497 } while (val && (tim++ < limit)); 505 498 506 499 /* disable and stop the PFPW engine */ ··· 563 556 u32 bytes; 564 557 565 558 bytes = readl(info->reg.gpmc_prefetch_status); 566 - bytes = GPMC_PREFETCH_STATUS_FIFO_CNT(bytes); 559 + bytes = PREFETCH_STATUS_FIFO_CNT(bytes); 567 560 bytes = bytes & 0xFFFC; /* io in multiple of 4 bytes */ 568 561 if (info->iomode == OMAP_NAND_IO_WRITE) { /* checks for write io */ 569 562 if (this_irq == info->gpmc_irq_count) ··· 689 682 limit = (loops_per_jiffy * msecs_to_jiffies(OMAP_NAND_TIMEOUT_MS)); 690 683 do { 691 684 val = readl(info->reg.gpmc_prefetch_status); 692 - val = GPMC_PREFETCH_STATUS_COUNT(val); 685 + val = PREFETCH_STATUS_COUNT(val); 693 686 cpu_relax(); 694 687 } while (val && (tim++ < limit)); 695 688 ··· 1003 996 cond_resched(); 1004 997 } 1005 998 1006 - status = gpmc_nand_read(info->gpmc_cs, GPMC_NAND_DATA); 999 + status = readb(info->reg.gpmc_nand_data); 1007 1000 return status; 1008 1001 } 1009 1002 ··· 1036 1029 static void omap3_enable_hwecc_bch(struct mtd_info *mtd, int mode) 1037 1030 { 1038 1031 int nerrors; 1039 - unsigned int dev_width; 1032 + unsigned int dev_width, nsectors; 1040 1033 struct omap_nand_info *info = container_of(mtd, struct omap_nand_info, 1041 1034 mtd); 1042 1035 struct nand_chip *chip = mtd->priv; 1036 + u32 val; 1043 1037 1044 1038 nerrors = (info->nand.ecc.bytes == 13) ? 8 : 4; 1045 1039 dev_width = (chip->options & NAND_BUSWIDTH_16) ? 1 : 0; 1040 + nsectors = 1; 1046 1041 /* 1047 1042 * Program GPMC to perform correction on one 512-byte sector at a time. 1048 1043 * Using 4 sectors at a time (i.e. ecc.size = 2048) is also possible and 1049 1044 * gives a slight (5%) performance gain (but requires additional code). 1050 1045 */ 1051 - (void)gpmc_enable_hwecc_bch(info->gpmc_cs, mode, dev_width, 1, nerrors); 1046 + 1047 + writel(ECC1, info->reg.gpmc_ecc_control); 1048 + 1049 + /* 1050 + * When using BCH, sector size is hardcoded to 512 bytes. 1051 + * Here we are using wrapping mode 6 both for reading and writing, with: 1052 + * size0 = 0 (no additional protected byte in spare area) 1053 + * size1 = 32 (skip 32 nibbles = 16 bytes per sector in spare area) 1054 + */ 1055 + val = (32 << ECCSIZE1_SHIFT) | (0 << ECCSIZE0_SHIFT); 1056 + writel(val, info->reg.gpmc_ecc_size_config); 1057 + 1058 + /* BCH configuration */ 1059 + val = ((1 << 16) | /* enable BCH */ 1060 + (((nerrors == 8) ? 1 : 0) << 12) | /* 8 or 4 bits */ 1061 + (0x06 << 8) | /* wrap mode = 6 */ 1062 + (dev_width << 7) | /* bus width */ 1063 + (((nsectors-1) & 0x7) << 4) | /* number of sectors */ 1064 + (info->gpmc_cs << 1) | /* ECC CS */ 1065 + (0x1)); /* enable ECC */ 1066 + 1067 + writel(val, info->reg.gpmc_ecc_config); 1068 + 1069 + /* clear ecc and enable bits */ 1070 + writel(ECCCLEAR | ECC1, info->reg.gpmc_ecc_control); 1052 1071 } 1053 1072 1054 1073 /** ··· 1088 1055 { 1089 1056 struct omap_nand_info *info = container_of(mtd, struct omap_nand_info, 1090 1057 mtd); 1091 - return gpmc_calculate_ecc_bch4(info->gpmc_cs, dat, ecc_code); 1058 + unsigned long nsectors, val1, val2; 1059 + int i; 1060 + 1061 + nsectors = ((readl(info->reg.gpmc_ecc_config) >> 4) & 0x7) + 1; 1062 + 1063 + for (i = 0; i < nsectors; i++) { 1064 + 1065 + /* Read hw-computed remainder */ 1066 + val1 = readl(info->reg.gpmc_bch_result0[i]); 1067 + val2 = readl(info->reg.gpmc_bch_result1[i]); 1068 + 1069 + /* 1070 + * Add constant polynomial to remainder, in order to get an ecc 1071 + * sequence of 0xFFs for a buffer filled with 0xFFs; and 1072 + * left-justify the resulting polynomial. 1073 + */ 1074 + *ecc_code++ = 0x28 ^ ((val2 >> 12) & 0xFF); 1075 + *ecc_code++ = 0x13 ^ ((val2 >> 4) & 0xFF); 1076 + *ecc_code++ = 0xcc ^ (((val2 & 0xF) << 4)|((val1 >> 28) & 0xF)); 1077 + *ecc_code++ = 0x39 ^ ((val1 >> 20) & 0xFF); 1078 + *ecc_code++ = 0x96 ^ ((val1 >> 12) & 0xFF); 1079 + *ecc_code++ = 0xac ^ ((val1 >> 4) & 0xFF); 1080 + *ecc_code++ = 0x7f ^ ((val1 & 0xF) << 4); 1081 + } 1082 + 1083 + return 0; 1092 1084 } 1093 1085 1094 1086 /** ··· 1127 1069 { 1128 1070 struct omap_nand_info *info = container_of(mtd, struct omap_nand_info, 1129 1071 mtd); 1130 - return gpmc_calculate_ecc_bch8(info->gpmc_cs, dat, ecc_code); 1072 + unsigned long nsectors, val1, val2, val3, val4; 1073 + int i; 1074 + 1075 + nsectors = ((readl(info->reg.gpmc_ecc_config) >> 4) & 0x7) + 1; 1076 + 1077 + for (i = 0; i < nsectors; i++) { 1078 + 1079 + /* Read hw-computed remainder */ 1080 + val1 = readl(info->reg.gpmc_bch_result0[i]); 1081 + val2 = readl(info->reg.gpmc_bch_result1[i]); 1082 + val3 = readl(info->reg.gpmc_bch_result2[i]); 1083 + val4 = readl(info->reg.gpmc_bch_result3[i]); 1084 + 1085 + /* 1086 + * Add constant polynomial to remainder, in order to get an ecc 1087 + * sequence of 0xFFs for a buffer filled with 0xFFs. 1088 + */ 1089 + *ecc_code++ = 0xef ^ (val4 & 0xFF); 1090 + *ecc_code++ = 0x51 ^ ((val3 >> 24) & 0xFF); 1091 + *ecc_code++ = 0x2e ^ ((val3 >> 16) & 0xFF); 1092 + *ecc_code++ = 0x09 ^ ((val3 >> 8) & 0xFF); 1093 + *ecc_code++ = 0xed ^ (val3 & 0xFF); 1094 + *ecc_code++ = 0x93 ^ ((val2 >> 24) & 0xFF); 1095 + *ecc_code++ = 0x9a ^ ((val2 >> 16) & 0xFF); 1096 + *ecc_code++ = 0xc2 ^ ((val2 >> 8) & 0xFF); 1097 + *ecc_code++ = 0x97 ^ (val2 & 0xFF); 1098 + *ecc_code++ = 0x79 ^ ((val1 >> 24) & 0xFF); 1099 + *ecc_code++ = 0xe5 ^ ((val1 >> 16) & 0xFF); 1100 + *ecc_code++ = 0x24 ^ ((val1 >> 8) & 0xFF); 1101 + *ecc_code++ = 0xb5 ^ (val1 & 0xFF); 1102 + } 1103 + 1104 + return 0; 1131 1105 } 1132 1106 1133 1107 /** ··· 1215 1125 */ 1216 1126 static int omap3_init_bch(struct mtd_info *mtd, int ecc_opt) 1217 1127 { 1218 - int ret, max_errors; 1128 + int max_errors; 1219 1129 struct omap_nand_info *info = container_of(mtd, struct omap_nand_info, 1220 1130 mtd); 1221 1131 #ifdef CONFIG_MTD_NAND_OMAP_BCH8 ··· 1231 1141 max_errors, hw_errors); 1232 1142 goto fail; 1233 1143 } 1234 - 1235 - /* initialize GPMC BCH engine */ 1236 - ret = gpmc_init_hwecc_bch(info->gpmc_cs, 1, max_errors); 1237 - if (ret) 1238 - goto fail; 1239 1144 1240 1145 /* software bch library is only used to detect and locate errors */ 1241 1146 info->bch = init_bch(13, max_errors, 0x201b /* hw polynomial */); ··· 1598 1513 /* Release NAND device, its internal structures and partitions */ 1599 1514 nand_release(&info->mtd); 1600 1515 iounmap(info->nand.IO_ADDR_R); 1601 - release_mem_region(info->phys_base, NAND_IO_SIZE); 1516 + release_mem_region(info->phys_base, info->mem_size); 1602 1517 kfree(info); 1603 1518 return 0; 1604 1519 }
+29 -18
drivers/mtd/onenand/omap2.c
··· 38 38 #include <linux/regulator/consumer.h> 39 39 40 40 #include <asm/mach/flash.h> 41 - #include <plat/gpmc.h> 42 41 #include <linux/platform_data/mtd-onenand-omap2.h> 43 42 #include <asm/gpio.h> 44 43 45 - #include <plat/dma.h> 46 - #include <plat/cpu.h> 44 + #include <plat-omap/dma-omap.h> 47 45 48 46 #define DRIVER_NAME "omap2-onenand" 49 47 ··· 61 63 int freq; 62 64 int (*setup)(void __iomem *base, int *freq_ptr); 63 65 struct regulator *regulator; 66 + u8 flags; 64 67 }; 65 68 66 69 static void omap2_onenand_dma_cb(int lch, u16 ch_status, void *data) ··· 154 155 if (!(syscfg & ONENAND_SYS_CFG1_IOBE)) { 155 156 syscfg |= ONENAND_SYS_CFG1_IOBE; 156 157 write_reg(c, syscfg, ONENAND_REG_SYS_CFG1); 157 - if (cpu_is_omap34xx()) 158 + if (c->flags & ONENAND_IN_OMAP34XX) 158 159 /* Add a delay to let GPIO settle */ 159 160 syscfg = read_reg(c, ONENAND_REG_SYS_CFG1); 160 161 } ··· 445 446 446 447 #else 447 448 448 - int omap3_onenand_read_bufferram(struct mtd_info *mtd, int area, 449 - unsigned char *buffer, int offset, 450 - size_t count); 449 + static int omap3_onenand_read_bufferram(struct mtd_info *mtd, int area, 450 + unsigned char *buffer, int offset, 451 + size_t count) 452 + { 453 + return -ENOSYS; 454 + } 451 455 452 - int omap3_onenand_write_bufferram(struct mtd_info *mtd, int area, 453 - const unsigned char *buffer, 454 - int offset, size_t count); 456 + static int omap3_onenand_write_bufferram(struct mtd_info *mtd, int area, 457 + const unsigned char *buffer, 458 + int offset, size_t count) 459 + { 460 + return -ENOSYS; 461 + } 455 462 456 463 #endif 457 464 ··· 555 550 556 551 #else 557 552 558 - int omap2_onenand_read_bufferram(struct mtd_info *mtd, int area, 559 - unsigned char *buffer, int offset, 560 - size_t count); 553 + static int omap2_onenand_read_bufferram(struct mtd_info *mtd, int area, 554 + unsigned char *buffer, int offset, 555 + size_t count) 556 + { 557 + return -ENOSYS; 558 + } 561 559 562 - int omap2_onenand_write_bufferram(struct mtd_info *mtd, int area, 563 - const unsigned char *buffer, 564 - int offset, size_t count); 560 + static int omap2_onenand_write_bufferram(struct mtd_info *mtd, int area, 561 + const unsigned char *buffer, 562 + int offset, size_t count) 563 + { 564 + return -ENOSYS; 565 + } 565 566 566 567 #endif 567 568 ··· 650 639 651 640 init_completion(&c->irq_done); 652 641 init_completion(&c->dma_done); 642 + c->flags = pdata->flags; 653 643 c->gpmc_cs = pdata->cs; 654 644 c->gpio_irq = pdata->gpio_irq; 655 645 c->dma_channel = pdata->dma_channel; ··· 741 729 this = &c->onenand; 742 730 if (c->dma_channel >= 0) { 743 731 this->wait = omap2_onenand_wait; 744 - if (cpu_is_omap34xx()) { 732 + if (c->flags & ONENAND_IN_OMAP34XX) { 745 733 this->read_bufferram = omap3_onenand_read_bufferram; 746 734 this->write_bufferram = omap3_onenand_write_bufferram; 747 735 } else { ··· 815 803 } 816 804 iounmap(c->onenand.base); 817 805 release_mem_region(c->phys_base, c->mem_size); 818 - gpmc_cs_free(c->gpmc_cs); 819 806 kfree(c); 820 807 821 808 return 0;
+1 -1
drivers/pcmcia/omap_cf.c
··· 25 25 #include <asm/sizes.h> 26 26 27 27 #include <mach/mux.h> 28 - #include <plat/tc.h> 28 + #include <mach/tc.h> 29 29 30 30 31 31 /* NOTE: don't expect this to support many I/O cards. The 16xx chips have
-1
drivers/staging/tidspbridge/include/dspbridge/host_os.h
··· 40 40 #include <linux/vmalloc.h> 41 41 #include <linux/ioport.h> 42 42 #include <linux/platform_device.h> 43 - #include <plat/clock.h> 44 43 #include <linux/clk.h> 45 44 #include <plat/mailbox.h> 46 45 #include <linux/pagemap.h>
+403 -349
drivers/tty/n_tty.c
··· 73 73 #define ECHO_OP_SET_CANON_COL 0x81 74 74 #define ECHO_OP_ERASE_TAB 0x82 75 75 76 + struct n_tty_data { 77 + unsigned int column; 78 + unsigned long overrun_time; 79 + int num_overrun; 80 + 81 + unsigned char lnext:1, erasing:1, raw:1, real_raw:1, icanon:1; 82 + unsigned char echo_overrun:1; 83 + 84 + DECLARE_BITMAP(process_char_map, 256); 85 + DECLARE_BITMAP(read_flags, N_TTY_BUF_SIZE); 86 + 87 + char *read_buf; 88 + int read_head; 89 + int read_tail; 90 + int read_cnt; 91 + 92 + unsigned char *echo_buf; 93 + unsigned int echo_pos; 94 + unsigned int echo_cnt; 95 + 96 + int canon_data; 97 + unsigned long canon_head; 98 + unsigned int canon_column; 99 + 100 + struct mutex atomic_read_lock; 101 + struct mutex output_lock; 102 + struct mutex echo_lock; 103 + spinlock_t read_lock; 104 + }; 105 + 76 106 static inline int tty_put_user(struct tty_struct *tty, unsigned char x, 77 107 unsigned char __user *ptr) 78 108 { 79 - tty_audit_add_data(tty, &x, 1); 109 + struct n_tty_data *ldata = tty->disc_data; 110 + 111 + tty_audit_add_data(tty, &x, 1, ldata->icanon); 80 112 return put_user(x, ptr); 81 113 } 82 114 ··· 124 92 125 93 static void n_tty_set_room(struct tty_struct *tty) 126 94 { 95 + struct n_tty_data *ldata = tty->disc_data; 127 96 int left; 128 97 int old_left; 129 98 130 - /* tty->read_cnt is not read locked ? */ 99 + /* ldata->read_cnt is not read locked ? */ 131 100 if (I_PARMRK(tty)) { 132 101 /* Multiply read_cnt by 3, since each byte might take up to 133 102 * three times as many spaces when PARMRK is set (depending on 134 103 * its flags, e.g. parity error). */ 135 - left = N_TTY_BUF_SIZE - tty->read_cnt * 3 - 1; 104 + left = N_TTY_BUF_SIZE - ldata->read_cnt * 3 - 1; 136 105 } else 137 - left = N_TTY_BUF_SIZE - tty->read_cnt - 1; 106 + left = N_TTY_BUF_SIZE - ldata->read_cnt - 1; 138 107 139 108 /* 140 109 * If we are doing input canonicalization, and there are no ··· 144 111 * characters will be beeped. 145 112 */ 146 113 if (left <= 0) 147 - left = tty->icanon && !tty->canon_data; 114 + left = ldata->icanon && !ldata->canon_data; 148 115 old_left = tty->receive_room; 149 116 tty->receive_room = left; 150 117 151 118 /* Did this open up the receive buffer? We may need to flip */ 152 - if (left && !old_left) 153 - schedule_work(&tty->buf.work); 119 + if (left && !old_left) { 120 + WARN_RATELIMIT(tty->port->itty == NULL, 121 + "scheduling with invalid itty"); 122 + schedule_work(&tty->port->buf.work); 123 + } 154 124 } 155 125 156 - static void put_tty_queue_nolock(unsigned char c, struct tty_struct *tty) 126 + static void put_tty_queue_nolock(unsigned char c, struct n_tty_data *ldata) 157 127 { 158 - if (tty->read_cnt < N_TTY_BUF_SIZE) { 159 - tty->read_buf[tty->read_head] = c; 160 - tty->read_head = (tty->read_head + 1) & (N_TTY_BUF_SIZE-1); 161 - tty->read_cnt++; 128 + if (ldata->read_cnt < N_TTY_BUF_SIZE) { 129 + ldata->read_buf[ldata->read_head] = c; 130 + ldata->read_head = (ldata->read_head + 1) & (N_TTY_BUF_SIZE-1); 131 + ldata->read_cnt++; 162 132 } 163 133 } 164 134 165 135 /** 166 136 * put_tty_queue - add character to tty 167 137 * @c: character 168 - * @tty: tty device 138 + * @ldata: n_tty data 169 139 * 170 140 * Add a character to the tty read_buf queue. This is done under the 171 141 * read_lock to serialize character addition and also to protect us 172 142 * against parallel reads or flushes 173 143 */ 174 144 175 - static void put_tty_queue(unsigned char c, struct tty_struct *tty) 145 + static void put_tty_queue(unsigned char c, struct n_tty_data *ldata) 176 146 { 177 147 unsigned long flags; 178 148 /* 179 149 * The problem of stomping on the buffers ends here. 180 150 * Why didn't anyone see this one coming? --AJK 181 151 */ 182 - spin_lock_irqsave(&tty->read_lock, flags); 183 - put_tty_queue_nolock(c, tty); 184 - spin_unlock_irqrestore(&tty->read_lock, flags); 152 + spin_lock_irqsave(&ldata->read_lock, flags); 153 + put_tty_queue_nolock(c, ldata); 154 + spin_unlock_irqrestore(&ldata->read_lock, flags); 185 155 } 186 156 187 157 /** ··· 215 179 216 180 static void reset_buffer_flags(struct tty_struct *tty) 217 181 { 182 + struct n_tty_data *ldata = tty->disc_data; 218 183 unsigned long flags; 219 184 220 - spin_lock_irqsave(&tty->read_lock, flags); 221 - tty->read_head = tty->read_tail = tty->read_cnt = 0; 222 - spin_unlock_irqrestore(&tty->read_lock, flags); 185 + spin_lock_irqsave(&ldata->read_lock, flags); 186 + ldata->read_head = ldata->read_tail = ldata->read_cnt = 0; 187 + spin_unlock_irqrestore(&ldata->read_lock, flags); 223 188 224 - mutex_lock(&tty->echo_lock); 225 - tty->echo_pos = tty->echo_cnt = tty->echo_overrun = 0; 226 - mutex_unlock(&tty->echo_lock); 189 + mutex_lock(&ldata->echo_lock); 190 + ldata->echo_pos = ldata->echo_cnt = ldata->echo_overrun = 0; 191 + mutex_unlock(&ldata->echo_lock); 227 192 228 - tty->canon_head = tty->canon_data = tty->erasing = 0; 229 - memset(&tty->read_flags, 0, sizeof tty->read_flags); 193 + ldata->canon_head = ldata->canon_data = ldata->erasing = 0; 194 + bitmap_zero(ldata->read_flags, N_TTY_BUF_SIZE); 230 195 n_tty_set_room(tty); 231 196 } 232 197 ··· 272 235 273 236 static ssize_t n_tty_chars_in_buffer(struct tty_struct *tty) 274 237 { 238 + struct n_tty_data *ldata = tty->disc_data; 275 239 unsigned long flags; 276 240 ssize_t n = 0; 277 241 278 - spin_lock_irqsave(&tty->read_lock, flags); 279 - if (!tty->icanon) { 280 - n = tty->read_cnt; 281 - } else if (tty->canon_data) { 282 - n = (tty->canon_head > tty->read_tail) ? 283 - tty->canon_head - tty->read_tail : 284 - tty->canon_head + (N_TTY_BUF_SIZE - tty->read_tail); 242 + spin_lock_irqsave(&ldata->read_lock, flags); 243 + if (!ldata->icanon) { 244 + n = ldata->read_cnt; 245 + } else if (ldata->canon_data) { 246 + n = (ldata->canon_head > ldata->read_tail) ? 247 + ldata->canon_head - ldata->read_tail : 248 + ldata->canon_head + (N_TTY_BUF_SIZE - ldata->read_tail); 285 249 } 286 - spin_unlock_irqrestore(&tty->read_lock, flags); 250 + spin_unlock_irqrestore(&ldata->read_lock, flags); 287 251 return n; 288 252 } 289 253 ··· 339 301 340 302 static int do_output_char(unsigned char c, struct tty_struct *tty, int space) 341 303 { 304 + struct n_tty_data *ldata = tty->disc_data; 342 305 int spaces; 343 306 344 307 if (!space) ··· 348 309 switch (c) { 349 310 case '\n': 350 311 if (O_ONLRET(tty)) 351 - tty->column = 0; 312 + ldata->column = 0; 352 313 if (O_ONLCR(tty)) { 353 314 if (space < 2) 354 315 return -1; 355 - tty->canon_column = tty->column = 0; 316 + ldata->canon_column = ldata->column = 0; 356 317 tty->ops->write(tty, "\r\n", 2); 357 318 return 2; 358 319 } 359 - tty->canon_column = tty->column; 320 + ldata->canon_column = ldata->column; 360 321 break; 361 322 case '\r': 362 - if (O_ONOCR(tty) && tty->column == 0) 323 + if (O_ONOCR(tty) && ldata->column == 0) 363 324 return 0; 364 325 if (O_OCRNL(tty)) { 365 326 c = '\n'; 366 327 if (O_ONLRET(tty)) 367 - tty->canon_column = tty->column = 0; 328 + ldata->canon_column = ldata->column = 0; 368 329 break; 369 330 } 370 - tty->canon_column = tty->column = 0; 331 + ldata->canon_column = ldata->column = 0; 371 332 break; 372 333 case '\t': 373 - spaces = 8 - (tty->column & 7); 334 + spaces = 8 - (ldata->column & 7); 374 335 if (O_TABDLY(tty) == XTABS) { 375 336 if (space < spaces) 376 337 return -1; 377 - tty->column += spaces; 338 + ldata->column += spaces; 378 339 tty->ops->write(tty, " ", spaces); 379 340 return spaces; 380 341 } 381 - tty->column += spaces; 342 + ldata->column += spaces; 382 343 break; 383 344 case '\b': 384 - if (tty->column > 0) 385 - tty->column--; 345 + if (ldata->column > 0) 346 + ldata->column--; 386 347 break; 387 348 default: 388 349 if (!iscntrl(c)) { 389 350 if (O_OLCUC(tty)) 390 351 c = toupper(c); 391 352 if (!is_continuation(c, tty)) 392 - tty->column++; 353 + ldata->column++; 393 354 } 394 355 break; 395 356 } ··· 414 375 415 376 static int process_output(unsigned char c, struct tty_struct *tty) 416 377 { 378 + struct n_tty_data *ldata = tty->disc_data; 417 379 int space, retval; 418 380 419 - mutex_lock(&tty->output_lock); 381 + mutex_lock(&ldata->output_lock); 420 382 421 383 space = tty_write_room(tty); 422 384 retval = do_output_char(c, tty, space); 423 385 424 - mutex_unlock(&tty->output_lock); 386 + mutex_unlock(&ldata->output_lock); 425 387 if (retval < 0) 426 388 return -1; 427 389 else ··· 451 411 static ssize_t process_output_block(struct tty_struct *tty, 452 412 const unsigned char *buf, unsigned int nr) 453 413 { 414 + struct n_tty_data *ldata = tty->disc_data; 454 415 int space; 455 416 int i; 456 417 const unsigned char *cp; 457 418 458 - mutex_lock(&tty->output_lock); 419 + mutex_lock(&ldata->output_lock); 459 420 460 421 space = tty_write_room(tty); 461 422 if (!space) { 462 - mutex_unlock(&tty->output_lock); 423 + mutex_unlock(&ldata->output_lock); 463 424 return 0; 464 425 } 465 426 if (nr > space) ··· 472 431 switch (c) { 473 432 case '\n': 474 433 if (O_ONLRET(tty)) 475 - tty->column = 0; 434 + ldata->column = 0; 476 435 if (O_ONLCR(tty)) 477 436 goto break_out; 478 - tty->canon_column = tty->column; 437 + ldata->canon_column = ldata->column; 479 438 break; 480 439 case '\r': 481 - if (O_ONOCR(tty) && tty->column == 0) 440 + if (O_ONOCR(tty) && ldata->column == 0) 482 441 goto break_out; 483 442 if (O_OCRNL(tty)) 484 443 goto break_out; 485 - tty->canon_column = tty->column = 0; 444 + ldata->canon_column = ldata->column = 0; 486 445 break; 487 446 case '\t': 488 447 goto break_out; 489 448 case '\b': 490 - if (tty->column > 0) 491 - tty->column--; 449 + if (ldata->column > 0) 450 + ldata->column--; 492 451 break; 493 452 default: 494 453 if (!iscntrl(c)) { 495 454 if (O_OLCUC(tty)) 496 455 goto break_out; 497 456 if (!is_continuation(c, tty)) 498 - tty->column++; 457 + ldata->column++; 499 458 } 500 459 break; 501 460 } ··· 503 462 break_out: 504 463 i = tty->ops->write(tty, buf, i); 505 464 506 - mutex_unlock(&tty->output_lock); 465 + mutex_unlock(&ldata->output_lock); 507 466 return i; 508 467 } 509 468 ··· 535 494 536 495 static void process_echoes(struct tty_struct *tty) 537 496 { 497 + struct n_tty_data *ldata = tty->disc_data; 538 498 int space, nr; 539 499 unsigned char c; 540 500 unsigned char *cp, *buf_end; 541 501 542 - if (!tty->echo_cnt) 502 + if (!ldata->echo_cnt) 543 503 return; 544 504 545 - mutex_lock(&tty->output_lock); 546 - mutex_lock(&tty->echo_lock); 505 + mutex_lock(&ldata->output_lock); 506 + mutex_lock(&ldata->echo_lock); 547 507 548 508 space = tty_write_room(tty); 549 509 550 - buf_end = tty->echo_buf + N_TTY_BUF_SIZE; 551 - cp = tty->echo_buf + tty->echo_pos; 552 - nr = tty->echo_cnt; 510 + buf_end = ldata->echo_buf + N_TTY_BUF_SIZE; 511 + cp = ldata->echo_buf + ldata->echo_pos; 512 + nr = ldata->echo_cnt; 553 513 while (nr > 0) { 554 514 c = *cp; 555 515 if (c == ECHO_OP_START) { ··· 587 545 * Otherwise, tab spacing is normal. 588 546 */ 589 547 if (!(num_chars & 0x80)) 590 - num_chars += tty->canon_column; 548 + num_chars += ldata->canon_column; 591 549 num_bs = 8 - (num_chars & 7); 592 550 593 551 if (num_bs > space) { ··· 597 555 space -= num_bs; 598 556 while (num_bs--) { 599 557 tty_put_char(tty, '\b'); 600 - if (tty->column > 0) 601 - tty->column--; 558 + if (ldata->column > 0) 559 + ldata->column--; 602 560 } 603 561 cp += 3; 604 562 nr -= 3; 605 563 break; 606 564 607 565 case ECHO_OP_SET_CANON_COL: 608 - tty->canon_column = tty->column; 566 + ldata->canon_column = ldata->column; 609 567 cp += 2; 610 568 nr -= 2; 611 569 break; 612 570 613 571 case ECHO_OP_MOVE_BACK_COL: 614 - if (tty->column > 0) 615 - tty->column--; 572 + if (ldata->column > 0) 573 + ldata->column--; 616 574 cp += 2; 617 575 nr -= 2; 618 576 break; ··· 624 582 break; 625 583 } 626 584 tty_put_char(tty, ECHO_OP_START); 627 - tty->column++; 585 + ldata->column++; 628 586 space--; 629 587 cp += 2; 630 588 nr -= 2; ··· 646 604 } 647 605 tty_put_char(tty, '^'); 648 606 tty_put_char(tty, op ^ 0100); 649 - tty->column += 2; 607 + ldata->column += 2; 650 608 space -= 2; 651 609 cp += 2; 652 610 nr -= 2; ··· 677 635 } 678 636 679 637 if (nr == 0) { 680 - tty->echo_pos = 0; 681 - tty->echo_cnt = 0; 682 - tty->echo_overrun = 0; 638 + ldata->echo_pos = 0; 639 + ldata->echo_cnt = 0; 640 + ldata->echo_overrun = 0; 683 641 } else { 684 - int num_processed = tty->echo_cnt - nr; 685 - tty->echo_pos += num_processed; 686 - tty->echo_pos &= N_TTY_BUF_SIZE - 1; 687 - tty->echo_cnt = nr; 642 + int num_processed = ldata->echo_cnt - nr; 643 + ldata->echo_pos += num_processed; 644 + ldata->echo_pos &= N_TTY_BUF_SIZE - 1; 645 + ldata->echo_cnt = nr; 688 646 if (num_processed > 0) 689 - tty->echo_overrun = 0; 647 + ldata->echo_overrun = 0; 690 648 } 691 649 692 - mutex_unlock(&tty->echo_lock); 693 - mutex_unlock(&tty->output_lock); 650 + mutex_unlock(&ldata->echo_lock); 651 + mutex_unlock(&ldata->output_lock); 694 652 695 653 if (tty->ops->flush_chars) 696 654 tty->ops->flush_chars(tty); ··· 699 657 /** 700 658 * add_echo_byte - add a byte to the echo buffer 701 659 * @c: unicode byte to echo 702 - * @tty: terminal device 660 + * @ldata: n_tty data 703 661 * 704 662 * Add a character or operation byte to the echo buffer. 705 663 * 706 664 * Should be called under the echo lock to protect the echo buffer. 707 665 */ 708 666 709 - static void add_echo_byte(unsigned char c, struct tty_struct *tty) 667 + static void add_echo_byte(unsigned char c, struct n_tty_data *ldata) 710 668 { 711 669 int new_byte_pos; 712 670 713 - if (tty->echo_cnt == N_TTY_BUF_SIZE) { 671 + if (ldata->echo_cnt == N_TTY_BUF_SIZE) { 714 672 /* Circular buffer is already at capacity */ 715 - new_byte_pos = tty->echo_pos; 673 + new_byte_pos = ldata->echo_pos; 716 674 717 675 /* 718 676 * Since the buffer start position needs to be advanced, 719 677 * be sure to step by a whole operation byte group. 720 678 */ 721 - if (tty->echo_buf[tty->echo_pos] == ECHO_OP_START) { 722 - if (tty->echo_buf[(tty->echo_pos + 1) & 679 + if (ldata->echo_buf[ldata->echo_pos] == ECHO_OP_START) { 680 + if (ldata->echo_buf[(ldata->echo_pos + 1) & 723 681 (N_TTY_BUF_SIZE - 1)] == 724 682 ECHO_OP_ERASE_TAB) { 725 - tty->echo_pos += 3; 726 - tty->echo_cnt -= 2; 683 + ldata->echo_pos += 3; 684 + ldata->echo_cnt -= 2; 727 685 } else { 728 - tty->echo_pos += 2; 729 - tty->echo_cnt -= 1; 686 + ldata->echo_pos += 2; 687 + ldata->echo_cnt -= 1; 730 688 } 731 689 } else { 732 - tty->echo_pos++; 690 + ldata->echo_pos++; 733 691 } 734 - tty->echo_pos &= N_TTY_BUF_SIZE - 1; 692 + ldata->echo_pos &= N_TTY_BUF_SIZE - 1; 735 693 736 - tty->echo_overrun = 1; 694 + ldata->echo_overrun = 1; 737 695 } else { 738 - new_byte_pos = tty->echo_pos + tty->echo_cnt; 696 + new_byte_pos = ldata->echo_pos + ldata->echo_cnt; 739 697 new_byte_pos &= N_TTY_BUF_SIZE - 1; 740 - tty->echo_cnt++; 698 + ldata->echo_cnt++; 741 699 } 742 700 743 - tty->echo_buf[new_byte_pos] = c; 701 + ldata->echo_buf[new_byte_pos] = c; 744 702 } 745 703 746 704 /** 747 705 * echo_move_back_col - add operation to move back a column 748 - * @tty: terminal device 706 + * @ldata: n_tty data 749 707 * 750 708 * Add an operation to the echo buffer to move back one column. 751 709 * 752 710 * Locking: echo_lock to protect the echo buffer 753 711 */ 754 712 755 - static void echo_move_back_col(struct tty_struct *tty) 713 + static void echo_move_back_col(struct n_tty_data *ldata) 756 714 { 757 - mutex_lock(&tty->echo_lock); 758 - 759 - add_echo_byte(ECHO_OP_START, tty); 760 - add_echo_byte(ECHO_OP_MOVE_BACK_COL, tty); 761 - 762 - mutex_unlock(&tty->echo_lock); 715 + mutex_lock(&ldata->echo_lock); 716 + add_echo_byte(ECHO_OP_START, ldata); 717 + add_echo_byte(ECHO_OP_MOVE_BACK_COL, ldata); 718 + mutex_unlock(&ldata->echo_lock); 763 719 } 764 720 765 721 /** 766 722 * echo_set_canon_col - add operation to set the canon column 767 - * @tty: terminal device 723 + * @ldata: n_tty data 768 724 * 769 725 * Add an operation to the echo buffer to set the canon column 770 726 * to the current column. ··· 770 730 * Locking: echo_lock to protect the echo buffer 771 731 */ 772 732 773 - static void echo_set_canon_col(struct tty_struct *tty) 733 + static void echo_set_canon_col(struct n_tty_data *ldata) 774 734 { 775 - mutex_lock(&tty->echo_lock); 776 - 777 - add_echo_byte(ECHO_OP_START, tty); 778 - add_echo_byte(ECHO_OP_SET_CANON_COL, tty); 779 - 780 - mutex_unlock(&tty->echo_lock); 735 + mutex_lock(&ldata->echo_lock); 736 + add_echo_byte(ECHO_OP_START, ldata); 737 + add_echo_byte(ECHO_OP_SET_CANON_COL, ldata); 738 + mutex_unlock(&ldata->echo_lock); 781 739 } 782 740 783 741 /** 784 742 * echo_erase_tab - add operation to erase a tab 785 743 * @num_chars: number of character columns already used 786 744 * @after_tab: true if num_chars starts after a previous tab 787 - * @tty: terminal device 745 + * @ldata: n_tty data 788 746 * 789 747 * Add an operation to the echo buffer to erase a tab. 790 748 * ··· 796 758 */ 797 759 798 760 static void echo_erase_tab(unsigned int num_chars, int after_tab, 799 - struct tty_struct *tty) 761 + struct n_tty_data *ldata) 800 762 { 801 - mutex_lock(&tty->echo_lock); 763 + mutex_lock(&ldata->echo_lock); 802 764 803 - add_echo_byte(ECHO_OP_START, tty); 804 - add_echo_byte(ECHO_OP_ERASE_TAB, tty); 765 + add_echo_byte(ECHO_OP_START, ldata); 766 + add_echo_byte(ECHO_OP_ERASE_TAB, ldata); 805 767 806 768 /* We only need to know this modulo 8 (tab spacing) */ 807 769 num_chars &= 7; ··· 810 772 if (after_tab) 811 773 num_chars |= 0x80; 812 774 813 - add_echo_byte(num_chars, tty); 775 + add_echo_byte(num_chars, ldata); 814 776 815 - mutex_unlock(&tty->echo_lock); 777 + mutex_unlock(&ldata->echo_lock); 816 778 } 817 779 818 780 /** ··· 828 790 * Locking: echo_lock to protect the echo buffer 829 791 */ 830 792 831 - static void echo_char_raw(unsigned char c, struct tty_struct *tty) 793 + static void echo_char_raw(unsigned char c, struct n_tty_data *ldata) 832 794 { 833 - mutex_lock(&tty->echo_lock); 834 - 795 + mutex_lock(&ldata->echo_lock); 835 796 if (c == ECHO_OP_START) { 836 - add_echo_byte(ECHO_OP_START, tty); 837 - add_echo_byte(ECHO_OP_START, tty); 797 + add_echo_byte(ECHO_OP_START, ldata); 798 + add_echo_byte(ECHO_OP_START, ldata); 838 799 } else { 839 - add_echo_byte(c, tty); 800 + add_echo_byte(c, ldata); 840 801 } 841 - 842 - mutex_unlock(&tty->echo_lock); 802 + mutex_unlock(&ldata->echo_lock); 843 803 } 844 804 845 805 /** ··· 856 820 857 821 static void echo_char(unsigned char c, struct tty_struct *tty) 858 822 { 859 - mutex_lock(&tty->echo_lock); 823 + struct n_tty_data *ldata = tty->disc_data; 824 + 825 + mutex_lock(&ldata->echo_lock); 860 826 861 827 if (c == ECHO_OP_START) { 862 - add_echo_byte(ECHO_OP_START, tty); 863 - add_echo_byte(ECHO_OP_START, tty); 828 + add_echo_byte(ECHO_OP_START, ldata); 829 + add_echo_byte(ECHO_OP_START, ldata); 864 830 } else { 865 831 if (L_ECHOCTL(tty) && iscntrl(c) && c != '\t') 866 - add_echo_byte(ECHO_OP_START, tty); 867 - add_echo_byte(c, tty); 832 + add_echo_byte(ECHO_OP_START, ldata); 833 + add_echo_byte(c, ldata); 868 834 } 869 835 870 - mutex_unlock(&tty->echo_lock); 836 + mutex_unlock(&ldata->echo_lock); 871 837 } 872 838 873 839 /** 874 840 * finish_erasing - complete erase 875 - * @tty: tty doing the erase 841 + * @ldata: n_tty data 876 842 */ 877 843 878 - static inline void finish_erasing(struct tty_struct *tty) 844 + static inline void finish_erasing(struct n_tty_data *ldata) 879 845 { 880 - if (tty->erasing) { 881 - echo_char_raw('/', tty); 882 - tty->erasing = 0; 846 + if (ldata->erasing) { 847 + echo_char_raw('/', ldata); 848 + ldata->erasing = 0; 883 849 } 884 850 } 885 851 ··· 899 861 900 862 static void eraser(unsigned char c, struct tty_struct *tty) 901 863 { 864 + struct n_tty_data *ldata = tty->disc_data; 902 865 enum { ERASE, WERASE, KILL } kill_type; 903 866 int head, seen_alnums, cnt; 904 867 unsigned long flags; 905 868 906 869 /* FIXME: locking needed ? */ 907 - if (tty->read_head == tty->canon_head) { 870 + if (ldata->read_head == ldata->canon_head) { 908 871 /* process_output('\a', tty); */ /* what do you think? */ 909 872 return; 910 873 } ··· 915 876 kill_type = WERASE; 916 877 else { 917 878 if (!L_ECHO(tty)) { 918 - spin_lock_irqsave(&tty->read_lock, flags); 919 - tty->read_cnt -= ((tty->read_head - tty->canon_head) & 879 + spin_lock_irqsave(&ldata->read_lock, flags); 880 + ldata->read_cnt -= ((ldata->read_head - ldata->canon_head) & 920 881 (N_TTY_BUF_SIZE - 1)); 921 - tty->read_head = tty->canon_head; 922 - spin_unlock_irqrestore(&tty->read_lock, flags); 882 + ldata->read_head = ldata->canon_head; 883 + spin_unlock_irqrestore(&ldata->read_lock, flags); 923 884 return; 924 885 } 925 886 if (!L_ECHOK(tty) || !L_ECHOKE(tty) || !L_ECHOE(tty)) { 926 - spin_lock_irqsave(&tty->read_lock, flags); 927 - tty->read_cnt -= ((tty->read_head - tty->canon_head) & 887 + spin_lock_irqsave(&ldata->read_lock, flags); 888 + ldata->read_cnt -= ((ldata->read_head - ldata->canon_head) & 928 889 (N_TTY_BUF_SIZE - 1)); 929 - tty->read_head = tty->canon_head; 930 - spin_unlock_irqrestore(&tty->read_lock, flags); 931 - finish_erasing(tty); 890 + ldata->read_head = ldata->canon_head; 891 + spin_unlock_irqrestore(&ldata->read_lock, flags); 892 + finish_erasing(ldata); 932 893 echo_char(KILL_CHAR(tty), tty); 933 894 /* Add a newline if ECHOK is on and ECHOKE is off. */ 934 895 if (L_ECHOK(tty)) 935 - echo_char_raw('\n', tty); 896 + echo_char_raw('\n', ldata); 936 897 return; 937 898 } 938 899 kill_type = KILL; ··· 940 901 941 902 seen_alnums = 0; 942 903 /* FIXME: Locking ?? */ 943 - while (tty->read_head != tty->canon_head) { 944 - head = tty->read_head; 904 + while (ldata->read_head != ldata->canon_head) { 905 + head = ldata->read_head; 945 906 946 907 /* erase a single possibly multibyte character */ 947 908 do { 948 909 head = (head - 1) & (N_TTY_BUF_SIZE-1); 949 - c = tty->read_buf[head]; 950 - } while (is_continuation(c, tty) && head != tty->canon_head); 910 + c = ldata->read_buf[head]; 911 + } while (is_continuation(c, tty) && head != ldata->canon_head); 951 912 952 913 /* do not partially erase */ 953 914 if (is_continuation(c, tty)) ··· 960 921 else if (seen_alnums) 961 922 break; 962 923 } 963 - cnt = (tty->read_head - head) & (N_TTY_BUF_SIZE-1); 964 - spin_lock_irqsave(&tty->read_lock, flags); 965 - tty->read_head = head; 966 - tty->read_cnt -= cnt; 967 - spin_unlock_irqrestore(&tty->read_lock, flags); 924 + cnt = (ldata->read_head - head) & (N_TTY_BUF_SIZE-1); 925 + spin_lock_irqsave(&ldata->read_lock, flags); 926 + ldata->read_head = head; 927 + ldata->read_cnt -= cnt; 928 + spin_unlock_irqrestore(&ldata->read_lock, flags); 968 929 if (L_ECHO(tty)) { 969 930 if (L_ECHOPRT(tty)) { 970 - if (!tty->erasing) { 971 - echo_char_raw('\\', tty); 972 - tty->erasing = 1; 931 + if (!ldata->erasing) { 932 + echo_char_raw('\\', ldata); 933 + ldata->erasing = 1; 973 934 } 974 935 /* if cnt > 1, output a multi-byte character */ 975 936 echo_char(c, tty); 976 937 while (--cnt > 0) { 977 938 head = (head+1) & (N_TTY_BUF_SIZE-1); 978 - echo_char_raw(tty->read_buf[head], tty); 979 - echo_move_back_col(tty); 939 + echo_char_raw(ldata->read_buf[head], 940 + ldata); 941 + echo_move_back_col(ldata); 980 942 } 981 943 } else if (kill_type == ERASE && !L_ECHOE(tty)) { 982 944 echo_char(ERASE_CHAR(tty), tty); 983 945 } else if (c == '\t') { 984 946 unsigned int num_chars = 0; 985 947 int after_tab = 0; 986 - unsigned long tail = tty->read_head; 948 + unsigned long tail = ldata->read_head; 987 949 988 950 /* 989 951 * Count the columns used for characters ··· 993 953 * This info is used to go back the correct 994 954 * number of columns. 995 955 */ 996 - while (tail != tty->canon_head) { 956 + while (tail != ldata->canon_head) { 997 957 tail = (tail-1) & (N_TTY_BUF_SIZE-1); 998 - c = tty->read_buf[tail]; 958 + c = ldata->read_buf[tail]; 999 959 if (c == '\t') { 1000 960 after_tab = 1; 1001 961 break; ··· 1006 966 num_chars++; 1007 967 } 1008 968 } 1009 - echo_erase_tab(num_chars, after_tab, tty); 969 + echo_erase_tab(num_chars, after_tab, ldata); 1010 970 } else { 1011 971 if (iscntrl(c) && L_ECHOCTL(tty)) { 1012 - echo_char_raw('\b', tty); 1013 - echo_char_raw(' ', tty); 1014 - echo_char_raw('\b', tty); 972 + echo_char_raw('\b', ldata); 973 + echo_char_raw(' ', ldata); 974 + echo_char_raw('\b', ldata); 1015 975 } 1016 976 if (!iscntrl(c) || L_ECHOCTL(tty)) { 1017 - echo_char_raw('\b', tty); 1018 - echo_char_raw(' ', tty); 1019 - echo_char_raw('\b', tty); 977 + echo_char_raw('\b', ldata); 978 + echo_char_raw(' ', ldata); 979 + echo_char_raw('\b', ldata); 1020 980 } 1021 981 } 1022 982 } 1023 983 if (kill_type == ERASE) 1024 984 break; 1025 985 } 1026 - if (tty->read_head == tty->canon_head && L_ECHO(tty)) 1027 - finish_erasing(tty); 986 + if (ldata->read_head == ldata->canon_head && L_ECHO(tty)) 987 + finish_erasing(ldata); 1028 988 } 1029 989 1030 990 /** ··· 1063 1023 1064 1024 static inline void n_tty_receive_break(struct tty_struct *tty) 1065 1025 { 1026 + struct n_tty_data *ldata = tty->disc_data; 1027 + 1066 1028 if (I_IGNBRK(tty)) 1067 1029 return; 1068 1030 if (I_BRKINT(tty)) { ··· 1072 1030 return; 1073 1031 } 1074 1032 if (I_PARMRK(tty)) { 1075 - put_tty_queue('\377', tty); 1076 - put_tty_queue('\0', tty); 1033 + put_tty_queue('\377', ldata); 1034 + put_tty_queue('\0', ldata); 1077 1035 } 1078 - put_tty_queue('\0', tty); 1036 + put_tty_queue('\0', ldata); 1079 1037 wake_up_interruptible(&tty->read_wait); 1080 1038 } 1081 1039 ··· 1094 1052 1095 1053 static inline void n_tty_receive_overrun(struct tty_struct *tty) 1096 1054 { 1055 + struct n_tty_data *ldata = tty->disc_data; 1097 1056 char buf[64]; 1098 1057 1099 - tty->num_overrun++; 1100 - if (time_before(tty->overrun_time, jiffies - HZ) || 1101 - time_after(tty->overrun_time, jiffies)) { 1058 + ldata->num_overrun++; 1059 + if (time_after(jiffies, ldata->overrun_time + HZ) || 1060 + time_after(ldata->overrun_time, jiffies)) { 1102 1061 printk(KERN_WARNING "%s: %d input overrun(s)\n", 1103 1062 tty_name(tty, buf), 1104 - tty->num_overrun); 1105 - tty->overrun_time = jiffies; 1106 - tty->num_overrun = 0; 1063 + ldata->num_overrun); 1064 + ldata->overrun_time = jiffies; 1065 + ldata->num_overrun = 0; 1107 1066 } 1108 1067 } 1109 1068 ··· 1119 1076 static inline void n_tty_receive_parity_error(struct tty_struct *tty, 1120 1077 unsigned char c) 1121 1078 { 1079 + struct n_tty_data *ldata = tty->disc_data; 1080 + 1122 1081 if (I_IGNPAR(tty)) 1123 1082 return; 1124 1083 if (I_PARMRK(tty)) { 1125 - put_tty_queue('\377', tty); 1126 - put_tty_queue('\0', tty); 1127 - put_tty_queue(c, tty); 1084 + put_tty_queue('\377', ldata); 1085 + put_tty_queue('\0', ldata); 1086 + put_tty_queue(c, ldata); 1128 1087 } else if (I_INPCK(tty)) 1129 - put_tty_queue('\0', tty); 1088 + put_tty_queue('\0', ldata); 1130 1089 else 1131 - put_tty_queue(c, tty); 1090 + put_tty_queue(c, ldata); 1132 1091 wake_up_interruptible(&tty->read_wait); 1133 1092 } 1134 1093 ··· 1146 1101 1147 1102 static inline void n_tty_receive_char(struct tty_struct *tty, unsigned char c) 1148 1103 { 1104 + struct n_tty_data *ldata = tty->disc_data; 1149 1105 unsigned long flags; 1150 1106 int parmrk; 1151 1107 1152 - if (tty->raw) { 1153 - put_tty_queue(c, tty); 1108 + if (ldata->raw) { 1109 + put_tty_queue(c, ldata); 1154 1110 return; 1155 1111 } 1156 1112 ··· 1161 1115 c = tolower(c); 1162 1116 1163 1117 if (L_EXTPROC(tty)) { 1164 - put_tty_queue(c, tty); 1118 + put_tty_queue(c, ldata); 1165 1119 return; 1166 1120 } 1167 1121 ··· 1189 1143 * handle specially, do shortcut processing to speed things 1190 1144 * up. 1191 1145 */ 1192 - if (!test_bit(c, tty->process_char_map) || tty->lnext) { 1193 - tty->lnext = 0; 1146 + if (!test_bit(c, ldata->process_char_map) || ldata->lnext) { 1147 + ldata->lnext = 0; 1194 1148 parmrk = (c == (unsigned char) '\377' && I_PARMRK(tty)) ? 1 : 0; 1195 - if (tty->read_cnt >= (N_TTY_BUF_SIZE - parmrk - 1)) { 1149 + if (ldata->read_cnt >= (N_TTY_BUF_SIZE - parmrk - 1)) { 1196 1150 /* beep if no space */ 1197 1151 if (L_ECHO(tty)) 1198 1152 process_output('\a', tty); 1199 1153 return; 1200 1154 } 1201 1155 if (L_ECHO(tty)) { 1202 - finish_erasing(tty); 1156 + finish_erasing(ldata); 1203 1157 /* Record the column of first canon char. */ 1204 - if (tty->canon_head == tty->read_head) 1205 - echo_set_canon_col(tty); 1158 + if (ldata->canon_head == ldata->read_head) 1159 + echo_set_canon_col(ldata); 1206 1160 echo_char(c, tty); 1207 1161 process_echoes(tty); 1208 1162 } 1209 1163 if (parmrk) 1210 - put_tty_queue(c, tty); 1211 - put_tty_queue(c, tty); 1164 + put_tty_queue(c, ldata); 1165 + put_tty_queue(c, ldata); 1212 1166 return; 1213 1167 } 1214 1168 ··· 1264 1218 } else if (c == '\n' && I_INLCR(tty)) 1265 1219 c = '\r'; 1266 1220 1267 - if (tty->icanon) { 1221 + if (ldata->icanon) { 1268 1222 if (c == ERASE_CHAR(tty) || c == KILL_CHAR(tty) || 1269 1223 (c == WERASE_CHAR(tty) && L_IEXTEN(tty))) { 1270 1224 eraser(c, tty); ··· 1272 1226 return; 1273 1227 } 1274 1228 if (c == LNEXT_CHAR(tty) && L_IEXTEN(tty)) { 1275 - tty->lnext = 1; 1229 + ldata->lnext = 1; 1276 1230 if (L_ECHO(tty)) { 1277 - finish_erasing(tty); 1231 + finish_erasing(ldata); 1278 1232 if (L_ECHOCTL(tty)) { 1279 - echo_char_raw('^', tty); 1280 - echo_char_raw('\b', tty); 1233 + echo_char_raw('^', ldata); 1234 + echo_char_raw('\b', ldata); 1281 1235 process_echoes(tty); 1282 1236 } 1283 1237 } ··· 1285 1239 } 1286 1240 if (c == REPRINT_CHAR(tty) && L_ECHO(tty) && 1287 1241 L_IEXTEN(tty)) { 1288 - unsigned long tail = tty->canon_head; 1242 + unsigned long tail = ldata->canon_head; 1289 1243 1290 - finish_erasing(tty); 1244 + finish_erasing(ldata); 1291 1245 echo_char(c, tty); 1292 - echo_char_raw('\n', tty); 1293 - while (tail != tty->read_head) { 1294 - echo_char(tty->read_buf[tail], tty); 1246 + echo_char_raw('\n', ldata); 1247 + while (tail != ldata->read_head) { 1248 + echo_char(ldata->read_buf[tail], tty); 1295 1249 tail = (tail+1) & (N_TTY_BUF_SIZE-1); 1296 1250 } 1297 1251 process_echoes(tty); 1298 1252 return; 1299 1253 } 1300 1254 if (c == '\n') { 1301 - if (tty->read_cnt >= N_TTY_BUF_SIZE) { 1255 + if (ldata->read_cnt >= N_TTY_BUF_SIZE) { 1302 1256 if (L_ECHO(tty)) 1303 1257 process_output('\a', tty); 1304 1258 return; 1305 1259 } 1306 1260 if (L_ECHO(tty) || L_ECHONL(tty)) { 1307 - echo_char_raw('\n', tty); 1261 + echo_char_raw('\n', ldata); 1308 1262 process_echoes(tty); 1309 1263 } 1310 1264 goto handle_newline; 1311 1265 } 1312 1266 if (c == EOF_CHAR(tty)) { 1313 - if (tty->read_cnt >= N_TTY_BUF_SIZE) 1267 + if (ldata->read_cnt >= N_TTY_BUF_SIZE) 1314 1268 return; 1315 - if (tty->canon_head != tty->read_head) 1269 + if (ldata->canon_head != ldata->read_head) 1316 1270 set_bit(TTY_PUSH, &tty->flags); 1317 1271 c = __DISABLED_CHAR; 1318 1272 goto handle_newline; ··· 1321 1275 (c == EOL2_CHAR(tty) && L_IEXTEN(tty))) { 1322 1276 parmrk = (c == (unsigned char) '\377' && I_PARMRK(tty)) 1323 1277 ? 1 : 0; 1324 - if (tty->read_cnt >= (N_TTY_BUF_SIZE - parmrk)) { 1278 + if (ldata->read_cnt >= (N_TTY_BUF_SIZE - parmrk)) { 1325 1279 if (L_ECHO(tty)) 1326 1280 process_output('\a', tty); 1327 1281 return; ··· 1331 1285 */ 1332 1286 if (L_ECHO(tty)) { 1333 1287 /* Record the column of first canon char. */ 1334 - if (tty->canon_head == tty->read_head) 1335 - echo_set_canon_col(tty); 1288 + if (ldata->canon_head == ldata->read_head) 1289 + echo_set_canon_col(ldata); 1336 1290 echo_char(c, tty); 1337 1291 process_echoes(tty); 1338 1292 } ··· 1341 1295 * EOL_CHAR and EOL2_CHAR? 1342 1296 */ 1343 1297 if (parmrk) 1344 - put_tty_queue(c, tty); 1298 + put_tty_queue(c, ldata); 1345 1299 1346 1300 handle_newline: 1347 - spin_lock_irqsave(&tty->read_lock, flags); 1348 - set_bit(tty->read_head, tty->read_flags); 1349 - put_tty_queue_nolock(c, tty); 1350 - tty->canon_head = tty->read_head; 1351 - tty->canon_data++; 1352 - spin_unlock_irqrestore(&tty->read_lock, flags); 1301 + spin_lock_irqsave(&ldata->read_lock, flags); 1302 + set_bit(ldata->read_head, ldata->read_flags); 1303 + put_tty_queue_nolock(c, ldata); 1304 + ldata->canon_head = ldata->read_head; 1305 + ldata->canon_data++; 1306 + spin_unlock_irqrestore(&ldata->read_lock, flags); 1353 1307 kill_fasync(&tty->fasync, SIGIO, POLL_IN); 1354 1308 if (waitqueue_active(&tty->read_wait)) 1355 1309 wake_up_interruptible(&tty->read_wait); ··· 1358 1312 } 1359 1313 1360 1314 parmrk = (c == (unsigned char) '\377' && I_PARMRK(tty)) ? 1 : 0; 1361 - if (tty->read_cnt >= (N_TTY_BUF_SIZE - parmrk - 1)) { 1315 + if (ldata->read_cnt >= (N_TTY_BUF_SIZE - parmrk - 1)) { 1362 1316 /* beep if no space */ 1363 1317 if (L_ECHO(tty)) 1364 1318 process_output('\a', tty); 1365 1319 return; 1366 1320 } 1367 1321 if (L_ECHO(tty)) { 1368 - finish_erasing(tty); 1322 + finish_erasing(ldata); 1369 1323 if (c == '\n') 1370 - echo_char_raw('\n', tty); 1324 + echo_char_raw('\n', ldata); 1371 1325 else { 1372 1326 /* Record the column of first canon char. */ 1373 - if (tty->canon_head == tty->read_head) 1374 - echo_set_canon_col(tty); 1327 + if (ldata->canon_head == ldata->read_head) 1328 + echo_set_canon_col(ldata); 1375 1329 echo_char(c, tty); 1376 1330 } 1377 1331 process_echoes(tty); 1378 1332 } 1379 1333 1380 1334 if (parmrk) 1381 - put_tty_queue(c, tty); 1335 + put_tty_queue(c, ldata); 1382 1336 1383 - put_tty_queue(c, tty); 1337 + put_tty_queue(c, ldata); 1384 1338 } 1385 1339 1386 1340 ··· 1415 1369 static void n_tty_receive_buf(struct tty_struct *tty, const unsigned char *cp, 1416 1370 char *fp, int count) 1417 1371 { 1372 + struct n_tty_data *ldata = tty->disc_data; 1418 1373 const unsigned char *p; 1419 1374 char *f, flags = TTY_NORMAL; 1420 1375 int i; 1421 1376 char buf[64]; 1422 1377 unsigned long cpuflags; 1423 1378 1424 - if (!tty->read_buf) 1425 - return; 1426 - 1427 - if (tty->real_raw) { 1428 - spin_lock_irqsave(&tty->read_lock, cpuflags); 1429 - i = min(N_TTY_BUF_SIZE - tty->read_cnt, 1430 - N_TTY_BUF_SIZE - tty->read_head); 1379 + if (ldata->real_raw) { 1380 + spin_lock_irqsave(&ldata->read_lock, cpuflags); 1381 + i = min(N_TTY_BUF_SIZE - ldata->read_cnt, 1382 + N_TTY_BUF_SIZE - ldata->read_head); 1431 1383 i = min(count, i); 1432 - memcpy(tty->read_buf + tty->read_head, cp, i); 1433 - tty->read_head = (tty->read_head + i) & (N_TTY_BUF_SIZE-1); 1434 - tty->read_cnt += i; 1384 + memcpy(ldata->read_buf + ldata->read_head, cp, i); 1385 + ldata->read_head = (ldata->read_head + i) & (N_TTY_BUF_SIZE-1); 1386 + ldata->read_cnt += i; 1435 1387 cp += i; 1436 1388 count -= i; 1437 1389 1438 - i = min(N_TTY_BUF_SIZE - tty->read_cnt, 1439 - N_TTY_BUF_SIZE - tty->read_head); 1390 + i = min(N_TTY_BUF_SIZE - ldata->read_cnt, 1391 + N_TTY_BUF_SIZE - ldata->read_head); 1440 1392 i = min(count, i); 1441 - memcpy(tty->read_buf + tty->read_head, cp, i); 1442 - tty->read_head = (tty->read_head + i) & (N_TTY_BUF_SIZE-1); 1443 - tty->read_cnt += i; 1444 - spin_unlock_irqrestore(&tty->read_lock, cpuflags); 1393 + memcpy(ldata->read_buf + ldata->read_head, cp, i); 1394 + ldata->read_head = (ldata->read_head + i) & (N_TTY_BUF_SIZE-1); 1395 + ldata->read_cnt += i; 1396 + spin_unlock_irqrestore(&ldata->read_lock, cpuflags); 1445 1397 } else { 1446 1398 for (i = count, p = cp, f = fp; i; i--, p++) { 1447 1399 if (f) ··· 1470 1426 1471 1427 n_tty_set_room(tty); 1472 1428 1473 - if ((!tty->icanon && (tty->read_cnt >= tty->minimum_to_wake)) || 1429 + if ((!ldata->icanon && (ldata->read_cnt >= tty->minimum_to_wake)) || 1474 1430 L_EXTPROC(tty)) { 1475 1431 kill_fasync(&tty->fasync, SIGIO, POLL_IN); 1476 1432 if (waitqueue_active(&tty->read_wait)) ··· 1514 1470 1515 1471 static void n_tty_set_termios(struct tty_struct *tty, struct ktermios *old) 1516 1472 { 1473 + struct n_tty_data *ldata = tty->disc_data; 1517 1474 int canon_change = 1; 1518 - BUG_ON(!tty); 1519 1475 1520 1476 if (old) 1521 1477 canon_change = (old->c_lflag ^ tty->termios.c_lflag) & ICANON; 1522 1478 if (canon_change) { 1523 - memset(&tty->read_flags, 0, sizeof tty->read_flags); 1524 - tty->canon_head = tty->read_tail; 1525 - tty->canon_data = 0; 1526 - tty->erasing = 0; 1479 + bitmap_zero(ldata->read_flags, N_TTY_BUF_SIZE); 1480 + ldata->canon_head = ldata->read_tail; 1481 + ldata->canon_data = 0; 1482 + ldata->erasing = 0; 1527 1483 } 1528 1484 1529 - if (canon_change && !L_ICANON(tty) && tty->read_cnt) 1485 + if (canon_change && !L_ICANON(tty) && ldata->read_cnt) 1530 1486 wake_up_interruptible(&tty->read_wait); 1531 1487 1532 - tty->icanon = (L_ICANON(tty) != 0); 1488 + ldata->icanon = (L_ICANON(tty) != 0); 1533 1489 if (test_bit(TTY_HW_COOK_IN, &tty->flags)) { 1534 - tty->raw = 1; 1535 - tty->real_raw = 1; 1490 + ldata->raw = 1; 1491 + ldata->real_raw = 1; 1536 1492 n_tty_set_room(tty); 1537 1493 return; 1538 1494 } ··· 1540 1496 I_ICRNL(tty) || I_INLCR(tty) || L_ICANON(tty) || 1541 1497 I_IXON(tty) || L_ISIG(tty) || L_ECHO(tty) || 1542 1498 I_PARMRK(tty)) { 1543 - memset(tty->process_char_map, 0, 256/8); 1499 + bitmap_zero(ldata->process_char_map, 256); 1544 1500 1545 1501 if (I_IGNCR(tty) || I_ICRNL(tty)) 1546 - set_bit('\r', tty->process_char_map); 1502 + set_bit('\r', ldata->process_char_map); 1547 1503 if (I_INLCR(tty)) 1548 - set_bit('\n', tty->process_char_map); 1504 + set_bit('\n', ldata->process_char_map); 1549 1505 1550 1506 if (L_ICANON(tty)) { 1551 - set_bit(ERASE_CHAR(tty), tty->process_char_map); 1552 - set_bit(KILL_CHAR(tty), tty->process_char_map); 1553 - set_bit(EOF_CHAR(tty), tty->process_char_map); 1554 - set_bit('\n', tty->process_char_map); 1555 - set_bit(EOL_CHAR(tty), tty->process_char_map); 1507 + set_bit(ERASE_CHAR(tty), ldata->process_char_map); 1508 + set_bit(KILL_CHAR(tty), ldata->process_char_map); 1509 + set_bit(EOF_CHAR(tty), ldata->process_char_map); 1510 + set_bit('\n', ldata->process_char_map); 1511 + set_bit(EOL_CHAR(tty), ldata->process_char_map); 1556 1512 if (L_IEXTEN(tty)) { 1557 1513 set_bit(WERASE_CHAR(tty), 1558 - tty->process_char_map); 1514 + ldata->process_char_map); 1559 1515 set_bit(LNEXT_CHAR(tty), 1560 - tty->process_char_map); 1516 + ldata->process_char_map); 1561 1517 set_bit(EOL2_CHAR(tty), 1562 - tty->process_char_map); 1518 + ldata->process_char_map); 1563 1519 if (L_ECHO(tty)) 1564 1520 set_bit(REPRINT_CHAR(tty), 1565 - tty->process_char_map); 1521 + ldata->process_char_map); 1566 1522 } 1567 1523 } 1568 1524 if (I_IXON(tty)) { 1569 - set_bit(START_CHAR(tty), tty->process_char_map); 1570 - set_bit(STOP_CHAR(tty), tty->process_char_map); 1525 + set_bit(START_CHAR(tty), ldata->process_char_map); 1526 + set_bit(STOP_CHAR(tty), ldata->process_char_map); 1571 1527 } 1572 1528 if (L_ISIG(tty)) { 1573 - set_bit(INTR_CHAR(tty), tty->process_char_map); 1574 - set_bit(QUIT_CHAR(tty), tty->process_char_map); 1575 - set_bit(SUSP_CHAR(tty), tty->process_char_map); 1529 + set_bit(INTR_CHAR(tty), ldata->process_char_map); 1530 + set_bit(QUIT_CHAR(tty), ldata->process_char_map); 1531 + set_bit(SUSP_CHAR(tty), ldata->process_char_map); 1576 1532 } 1577 - clear_bit(__DISABLED_CHAR, tty->process_char_map); 1578 - tty->raw = 0; 1579 - tty->real_raw = 0; 1533 + clear_bit(__DISABLED_CHAR, ldata->process_char_map); 1534 + ldata->raw = 0; 1535 + ldata->real_raw = 0; 1580 1536 } else { 1581 - tty->raw = 1; 1537 + ldata->raw = 1; 1582 1538 if ((I_IGNBRK(tty) || (!I_BRKINT(tty) && !I_PARMRK(tty))) && 1583 1539 (I_IGNPAR(tty) || !I_INPCK(tty)) && 1584 1540 (tty->driver->flags & TTY_DRIVER_REAL_RAW)) 1585 - tty->real_raw = 1; 1541 + ldata->real_raw = 1; 1586 1542 else 1587 - tty->real_raw = 0; 1543 + ldata->real_raw = 0; 1588 1544 } 1589 1545 n_tty_set_room(tty); 1590 1546 /* The termios change make the tty ready for I/O */ ··· 1604 1560 1605 1561 static void n_tty_close(struct tty_struct *tty) 1606 1562 { 1563 + struct n_tty_data *ldata = tty->disc_data; 1564 + 1607 1565 n_tty_flush_buffer(tty); 1608 - if (tty->read_buf) { 1609 - kfree(tty->read_buf); 1610 - tty->read_buf = NULL; 1611 - } 1612 - if (tty->echo_buf) { 1613 - kfree(tty->echo_buf); 1614 - tty->echo_buf = NULL; 1615 - } 1566 + kfree(ldata->read_buf); 1567 + kfree(ldata->echo_buf); 1568 + kfree(ldata); 1569 + tty->disc_data = NULL; 1616 1570 } 1617 1571 1618 1572 /** ··· 1625 1583 1626 1584 static int n_tty_open(struct tty_struct *tty) 1627 1585 { 1628 - if (!tty) 1629 - return -EINVAL; 1586 + struct n_tty_data *ldata; 1587 + 1588 + ldata = kzalloc(sizeof(*ldata), GFP_KERNEL); 1589 + if (!ldata) 1590 + goto err; 1591 + 1592 + ldata->overrun_time = jiffies; 1593 + mutex_init(&ldata->atomic_read_lock); 1594 + mutex_init(&ldata->output_lock); 1595 + mutex_init(&ldata->echo_lock); 1596 + spin_lock_init(&ldata->read_lock); 1630 1597 1631 1598 /* These are ugly. Currently a malloc failure here can panic */ 1632 - if (!tty->read_buf) { 1633 - tty->read_buf = kzalloc(N_TTY_BUF_SIZE, GFP_KERNEL); 1634 - if (!tty->read_buf) 1635 - return -ENOMEM; 1636 - } 1637 - if (!tty->echo_buf) { 1638 - tty->echo_buf = kzalloc(N_TTY_BUF_SIZE, GFP_KERNEL); 1599 + ldata->read_buf = kzalloc(N_TTY_BUF_SIZE, GFP_KERNEL); 1600 + ldata->echo_buf = kzalloc(N_TTY_BUF_SIZE, GFP_KERNEL); 1601 + if (!ldata->read_buf || !ldata->echo_buf) 1602 + goto err_free_bufs; 1639 1603 1640 - if (!tty->echo_buf) 1641 - return -ENOMEM; 1642 - } 1604 + tty->disc_data = ldata; 1643 1605 reset_buffer_flags(tty); 1644 1606 tty_unthrottle(tty); 1645 - tty->column = 0; 1607 + ldata->column = 0; 1646 1608 n_tty_set_termios(tty, NULL); 1647 1609 tty->minimum_to_wake = 1; 1648 1610 tty->closing = 0; 1611 + 1649 1612 return 0; 1613 + err_free_bufs: 1614 + kfree(ldata->read_buf); 1615 + kfree(ldata->echo_buf); 1616 + kfree(ldata); 1617 + err: 1618 + return -ENOMEM; 1650 1619 } 1651 1620 1652 1621 static inline int input_available_p(struct tty_struct *tty, int amt) 1653 1622 { 1623 + struct n_tty_data *ldata = tty->disc_data; 1624 + 1654 1625 tty_flush_to_ldisc(tty); 1655 - if (tty->icanon && !L_EXTPROC(tty)) { 1656 - if (tty->canon_data) 1626 + if (ldata->icanon && !L_EXTPROC(tty)) { 1627 + if (ldata->canon_data) 1657 1628 return 1; 1658 - } else if (tty->read_cnt >= (amt ? amt : 1)) 1629 + } else if (ldata->read_cnt >= (amt ? amt : 1)) 1659 1630 return 1; 1660 1631 1661 1632 return 0; ··· 1687 1632 * buffer, and once to drain the space from the (physical) beginning of 1688 1633 * the buffer to head pointer. 1689 1634 * 1690 - * Called under the tty->atomic_read_lock sem 1635 + * Called under the ldata->atomic_read_lock sem 1691 1636 * 1692 1637 */ 1693 1638 ··· 1696 1641 size_t *nr) 1697 1642 1698 1643 { 1644 + struct n_tty_data *ldata = tty->disc_data; 1699 1645 int retval; 1700 1646 size_t n; 1701 1647 unsigned long flags; 1702 1648 bool is_eof; 1703 1649 1704 1650 retval = 0; 1705 - spin_lock_irqsave(&tty->read_lock, flags); 1706 - n = min(tty->read_cnt, N_TTY_BUF_SIZE - tty->read_tail); 1651 + spin_lock_irqsave(&ldata->read_lock, flags); 1652 + n = min(ldata->read_cnt, N_TTY_BUF_SIZE - ldata->read_tail); 1707 1653 n = min(*nr, n); 1708 - spin_unlock_irqrestore(&tty->read_lock, flags); 1654 + spin_unlock_irqrestore(&ldata->read_lock, flags); 1709 1655 if (n) { 1710 - retval = copy_to_user(*b, &tty->read_buf[tty->read_tail], n); 1656 + retval = copy_to_user(*b, &ldata->read_buf[ldata->read_tail], n); 1711 1657 n -= retval; 1712 1658 is_eof = n == 1 && 1713 - tty->read_buf[tty->read_tail] == EOF_CHAR(tty); 1714 - tty_audit_add_data(tty, &tty->read_buf[tty->read_tail], n); 1715 - spin_lock_irqsave(&tty->read_lock, flags); 1716 - tty->read_tail = (tty->read_tail + n) & (N_TTY_BUF_SIZE-1); 1717 - tty->read_cnt -= n; 1659 + ldata->read_buf[ldata->read_tail] == EOF_CHAR(tty); 1660 + tty_audit_add_data(tty, &ldata->read_buf[ldata->read_tail], n, 1661 + ldata->icanon); 1662 + spin_lock_irqsave(&ldata->read_lock, flags); 1663 + ldata->read_tail = (ldata->read_tail + n) & (N_TTY_BUF_SIZE-1); 1664 + ldata->read_cnt -= n; 1718 1665 /* Turn single EOF into zero-length read */ 1719 - if (L_EXTPROC(tty) && tty->icanon && is_eof && !tty->read_cnt) 1666 + if (L_EXTPROC(tty) && ldata->icanon && is_eof && !ldata->read_cnt) 1720 1667 n = 0; 1721 - spin_unlock_irqrestore(&tty->read_lock, flags); 1668 + spin_unlock_irqrestore(&ldata->read_lock, flags); 1722 1669 *b += n; 1723 1670 *nr -= n; 1724 1671 } ··· 1787 1730 static ssize_t n_tty_read(struct tty_struct *tty, struct file *file, 1788 1731 unsigned char __user *buf, size_t nr) 1789 1732 { 1733 + struct n_tty_data *ldata = tty->disc_data; 1790 1734 unsigned char __user *b = buf; 1791 1735 DECLARE_WAITQUEUE(wait, current); 1792 1736 int c; ··· 1799 1741 int packet; 1800 1742 1801 1743 do_it_again: 1802 - 1803 - if (WARN_ON(!tty->read_buf)) 1804 - return -EAGAIN; 1805 - 1806 1744 c = job_control(tty, file); 1807 1745 if (c < 0) 1808 1746 return c; 1809 1747 1810 1748 minimum = time = 0; 1811 1749 timeout = MAX_SCHEDULE_TIMEOUT; 1812 - if (!tty->icanon) { 1750 + if (!ldata->icanon) { 1813 1751 time = (HZ / 10) * TIME_CHAR(tty); 1814 1752 minimum = MIN_CHAR(tty); 1815 1753 if (minimum) { ··· 1828 1774 * Internal serialization of reads. 1829 1775 */ 1830 1776 if (file->f_flags & O_NONBLOCK) { 1831 - if (!mutex_trylock(&tty->atomic_read_lock)) 1777 + if (!mutex_trylock(&ldata->atomic_read_lock)) 1832 1778 return -EAGAIN; 1833 1779 } else { 1834 - if (mutex_lock_interruptible(&tty->atomic_read_lock)) 1780 + if (mutex_lock_interruptible(&ldata->atomic_read_lock)) 1835 1781 return -ERESTARTSYS; 1836 1782 } 1837 1783 packet = tty->packet; ··· 1884 1830 /* FIXME: does n_tty_set_room need locking ? */ 1885 1831 n_tty_set_room(tty); 1886 1832 timeout = schedule_timeout(timeout); 1887 - BUG_ON(!tty->read_buf); 1888 1833 continue; 1889 1834 } 1890 1835 __set_current_state(TASK_RUNNING); ··· 1898 1845 nr--; 1899 1846 } 1900 1847 1901 - if (tty->icanon && !L_EXTPROC(tty)) { 1848 + if (ldata->icanon && !L_EXTPROC(tty)) { 1902 1849 /* N.B. avoid overrun if nr == 0 */ 1903 - spin_lock_irqsave(&tty->read_lock, flags); 1904 - while (nr && tty->read_cnt) { 1850 + spin_lock_irqsave(&ldata->read_lock, flags); 1851 + while (nr && ldata->read_cnt) { 1905 1852 int eol; 1906 1853 1907 - eol = test_and_clear_bit(tty->read_tail, 1908 - tty->read_flags); 1909 - c = tty->read_buf[tty->read_tail]; 1910 - tty->read_tail = ((tty->read_tail+1) & 1854 + eol = test_and_clear_bit(ldata->read_tail, 1855 + ldata->read_flags); 1856 + c = ldata->read_buf[ldata->read_tail]; 1857 + ldata->read_tail = ((ldata->read_tail+1) & 1911 1858 (N_TTY_BUF_SIZE-1)); 1912 - tty->read_cnt--; 1859 + ldata->read_cnt--; 1913 1860 if (eol) { 1914 1861 /* this test should be redundant: 1915 1862 * we shouldn't be reading data if 1916 1863 * canon_data is 0 1917 1864 */ 1918 - if (--tty->canon_data < 0) 1919 - tty->canon_data = 0; 1865 + if (--ldata->canon_data < 0) 1866 + ldata->canon_data = 0; 1920 1867 } 1921 - spin_unlock_irqrestore(&tty->read_lock, flags); 1868 + spin_unlock_irqrestore(&ldata->read_lock, flags); 1922 1869 1923 1870 if (!eol || (c != __DISABLED_CHAR)) { 1924 1871 if (tty_put_user(tty, c, b++)) { 1925 1872 retval = -EFAULT; 1926 1873 b--; 1927 - spin_lock_irqsave(&tty->read_lock, flags); 1874 + spin_lock_irqsave(&ldata->read_lock, flags); 1928 1875 break; 1929 1876 } 1930 1877 nr--; 1931 1878 } 1932 1879 if (eol) { 1933 1880 tty_audit_push(tty); 1934 - spin_lock_irqsave(&tty->read_lock, flags); 1881 + spin_lock_irqsave(&ldata->read_lock, flags); 1935 1882 break; 1936 1883 } 1937 - spin_lock_irqsave(&tty->read_lock, flags); 1884 + spin_lock_irqsave(&ldata->read_lock, flags); 1938 1885 } 1939 - spin_unlock_irqrestore(&tty->read_lock, flags); 1886 + spin_unlock_irqrestore(&ldata->read_lock, flags); 1940 1887 if (retval) 1941 1888 break; 1942 1889 } else { ··· 1968 1915 if (time) 1969 1916 timeout = time; 1970 1917 } 1971 - mutex_unlock(&tty->atomic_read_lock); 1918 + mutex_unlock(&ldata->atomic_read_lock); 1972 1919 remove_wait_queue(&tty->read_wait, &wait); 1973 1920 1974 1921 if (!waitqueue_active(&tty->read_wait)) ··· 2129 2076 return mask; 2130 2077 } 2131 2078 2132 - static unsigned long inq_canon(struct tty_struct *tty) 2079 + static unsigned long inq_canon(struct n_tty_data *ldata) 2133 2080 { 2134 2081 int nr, head, tail; 2135 2082 2136 - if (!tty->canon_data) 2083 + if (!ldata->canon_data) 2137 2084 return 0; 2138 - head = tty->canon_head; 2139 - tail = tty->read_tail; 2085 + head = ldata->canon_head; 2086 + tail = ldata->read_tail; 2140 2087 nr = (head - tail) & (N_TTY_BUF_SIZE-1); 2141 2088 /* Skip EOF-chars.. */ 2142 2089 while (head != tail) { 2143 - if (test_bit(tail, tty->read_flags) && 2144 - tty->read_buf[tail] == __DISABLED_CHAR) 2090 + if (test_bit(tail, ldata->read_flags) && 2091 + ldata->read_buf[tail] == __DISABLED_CHAR) 2145 2092 nr--; 2146 2093 tail = (tail+1) & (N_TTY_BUF_SIZE-1); 2147 2094 } ··· 2151 2098 static int n_tty_ioctl(struct tty_struct *tty, struct file *file, 2152 2099 unsigned int cmd, unsigned long arg) 2153 2100 { 2101 + struct n_tty_data *ldata = tty->disc_data; 2154 2102 int retval; 2155 2103 2156 2104 switch (cmd) { ··· 2159 2105 return put_user(tty_chars_in_buffer(tty), (int __user *) arg); 2160 2106 case TIOCINQ: 2161 2107 /* FIXME: Locking */ 2162 - retval = tty->read_cnt; 2108 + retval = ldata->read_cnt; 2163 2109 if (L_ICANON(tty)) 2164 - retval = inq_canon(tty); 2110 + retval = inq_canon(ldata); 2165 2111 return put_user(retval, (unsigned int __user *) arg); 2166 2112 default: 2167 2113 return n_tty_ioctl_helper(tty, file, cmd, arg);
+22 -8
drivers/tty/pty.c
··· 4 4 * Added support for a Unix98-style ptmx device. 5 5 * -- C. Scott Ananian <cananian@alumni.princeton.edu>, 14-Jan-1998 6 6 * 7 - * When reading this code see also fs/devpts. In particular note that the 8 - * driver_data field is used by the devpts side as a binding to the devpts 9 - * inode. 10 7 */ 11 8 12 9 #include <linux/module.h> ··· 56 59 #ifdef CONFIG_UNIX98_PTYS 57 60 if (tty->driver == ptm_driver) { 58 61 mutex_lock(&devpts_mutex); 59 - devpts_pty_kill(tty->link); 62 + devpts_pty_kill(tty->link->driver_data); 60 63 mutex_unlock(&devpts_mutex); 61 64 } 62 65 #endif ··· 93 96 94 97 static int pty_space(struct tty_struct *to) 95 98 { 96 - int n = 8192 - to->buf.memory_used; 99 + int n = 8192 - to->port->buf.memory_used; 97 100 if (n < 0) 98 101 return 0; 99 102 return n; ··· 345 348 tty_port_init(ports[1]); 346 349 o_tty->port = ports[0]; 347 350 tty->port = ports[1]; 351 + o_tty->port->itty = o_tty; 348 352 349 353 tty_driver_kref_get(driver); 350 354 tty->count++; ··· 364 366 return retval; 365 367 } 366 368 369 + /* this is called once with whichever end is closed last */ 370 + static void pty_unix98_shutdown(struct tty_struct *tty) 371 + { 372 + devpts_kill_index(tty->driver_data, tty->index); 373 + } 374 + 367 375 static void pty_cleanup(struct tty_struct *tty) 368 376 { 377 + tty->port->itty = NULL; 369 378 kfree(tty->port); 370 379 } 371 380 ··· 552 547 struct tty_struct *tty; 553 548 554 549 mutex_lock(&devpts_mutex); 555 - tty = devpts_get_tty(pts_inode, idx); 550 + tty = devpts_get_priv(pts_inode); 556 551 mutex_unlock(&devpts_mutex); 557 552 /* Master must be open before slave */ 558 553 if (!tty) ··· 586 581 .set_termios = pty_set_termios, 587 582 .ioctl = pty_unix98_ioctl, 588 583 .resize = pty_resize, 584 + .shutdown = pty_unix98_shutdown, 589 585 .cleanup = pty_cleanup 590 586 }; 591 587 ··· 602 596 .chars_in_buffer = pty_chars_in_buffer, 603 597 .unthrottle = pty_unthrottle, 604 598 .set_termios = pty_set_termios, 599 + .shutdown = pty_unix98_shutdown, 605 600 .cleanup = pty_cleanup, 606 601 }; 607 602 ··· 621 614 static int ptmx_open(struct inode *inode, struct file *filp) 622 615 { 623 616 struct tty_struct *tty; 617 + struct inode *slave_inode; 624 618 int retval; 625 619 int index; 626 620 ··· 658 650 659 651 tty_add_file(tty, filp); 660 652 661 - retval = devpts_pty_new(inode, tty->link); 662 - if (retval) 653 + slave_inode = devpts_pty_new(inode, 654 + MKDEV(UNIX98_PTY_SLAVE_MAJOR, index), index, 655 + tty->link); 656 + if (IS_ERR(slave_inode)) { 657 + retval = PTR_ERR(slave_inode); 663 658 goto err_release; 659 + } 664 660 665 661 retval = ptm_driver->ops->open(tty, filp); 666 662 if (retval) 667 663 goto err_release; 668 664 669 665 tty_unlock(tty); 666 + tty->driver_data = inode; 667 + tty->link->driver_data = slave_inode; 670 668 return 0; 671 669 err_release: 672 670 tty_unlock(tty);
+3 -6
drivers/tty/serial/8250/8250.c
··· 2349 2349 serial_port_out(port, UART_EFR, efr); 2350 2350 } 2351 2351 2352 - #ifdef CONFIG_ARCH_OMAP1 2353 2352 /* Workaround to enable 115200 baud on OMAP1510 internal ports */ 2354 - if (cpu_is_omap1510() && is_omap_port(up)) { 2353 + if (is_omap1510_8250(up)) { 2355 2354 if (baud == 115200) { 2356 2355 quot = 1; 2357 2356 serial_port_out(port, UART_OMAP_OSC_12M_SEL, 1); 2358 2357 } else 2359 2358 serial_port_out(port, UART_OMAP_OSC_12M_SEL, 0); 2360 2359 } 2361 - #endif 2362 2360 2363 2361 /* 2364 2362 * For NatSemi, switch to bank 2 not bank 1, to avoid resetting EXCR2, ··· 2437 2439 { 2438 2440 if (pt->port.iotype == UPIO_AU) 2439 2441 return 0x1000; 2440 - #ifdef CONFIG_ARCH_OMAP1 2441 - if (is_omap_port(pt)) 2442 + if (is_omap1_8250(pt)) 2442 2443 return 0x16 << pt->port.regshift; 2443 - #endif 2444 + 2444 2445 return 8 << pt->port.regshift; 2445 2446 } 2446 2447
+36
drivers/tty/serial/8250/8250.h
··· 106 106 static inline void serial8250_pnp_exit(void) { } 107 107 #endif 108 108 109 + #ifdef CONFIG_ARCH_OMAP1 110 + static inline int is_omap1_8250(struct uart_8250_port *pt) 111 + { 112 + int res; 113 + 114 + switch (pt->port.mapbase) { 115 + case OMAP1_UART1_BASE: 116 + case OMAP1_UART2_BASE: 117 + case OMAP1_UART3_BASE: 118 + res = 1; 119 + break; 120 + default: 121 + res = 0; 122 + break; 123 + } 124 + 125 + return res; 126 + } 127 + 128 + static inline int is_omap1510_8250(struct uart_8250_port *pt) 129 + { 130 + if (!cpu_is_omap1510()) 131 + return 0; 132 + 133 + return is_omap1_8250(pt); 134 + } 135 + #else 136 + static inline int is_omap1_8250(struct uart_8250_port *pt) 137 + { 138 + return 0; 139 + } 140 + static inline int is_omap1510_8250(struct uart_8250_port *pt) 141 + { 142 + return 0; 143 + } 144 + #endif
+1 -1
drivers/tty/serial/8250/8250_early.c
··· 140 140 serial_out(port, UART_FCR, 0); /* no fifo */ 141 141 serial_out(port, UART_MCR, 0x3); /* DTR + RTS */ 142 142 143 - divisor = port->uartclk / (16 * device->baud); 143 + divisor = DIV_ROUND_CLOSEST(port->uartclk, 16 * device->baud); 144 144 c = serial_in(port, UART_LCR); 145 145 serial_out(port, UART_LCR, c | UART_LCR_DLAB); 146 146 serial_out(port, UART_DLL, divisor & 0xff);
+8 -8
drivers/tty/serial/samsung.c
··· 530 530 switch (level) { 531 531 case 3: 532 532 if (!IS_ERR(ourport->baudclk)) 533 - clk_disable(ourport->baudclk); 533 + clk_disable_unprepare(ourport->baudclk); 534 534 535 - clk_disable(ourport->clk); 535 + clk_disable_unprepare(ourport->clk); 536 536 break; 537 537 538 538 case 0: 539 - clk_enable(ourport->clk); 539 + clk_prepare_enable(ourport->clk); 540 540 541 541 if (!IS_ERR(ourport->baudclk)) 542 - clk_enable(ourport->baudclk); 542 + clk_prepare_enable(ourport->baudclk); 543 543 544 544 break; 545 545 default: ··· 713 713 s3c24xx_serial_setsource(port, clk_sel); 714 714 715 715 if (!IS_ERR(ourport->baudclk)) { 716 - clk_disable(ourport->baudclk); 716 + clk_disable_unprepare(ourport->baudclk); 717 717 ourport->baudclk = ERR_PTR(-EINVAL); 718 718 } 719 719 720 - clk_enable(clk); 720 + clk_prepare_enable(clk); 721 721 722 722 ourport->baudclk = clk; 723 723 ourport->baudclk_rate = clk ? clk_get_rate(clk) : 0; ··· 1287 1287 struct s3c24xx_uart_port *ourport = to_ourport(port); 1288 1288 1289 1289 if (port) { 1290 - clk_enable(ourport->clk); 1290 + clk_prepare_enable(ourport->clk); 1291 1291 s3c24xx_serial_resetport(port, s3c24xx_port_to_cfg(port)); 1292 - clk_disable(ourport->clk); 1292 + clk_disable_unprepare(ourport->clk); 1293 1293 1294 1294 uart_resume_port(&s3c24xx_uart_drv, port); 1295 1295 }
+8 -7
drivers/tty/tty_audit.c
··· 23 23 }; 24 24 25 25 static struct tty_audit_buf *tty_audit_buf_alloc(int major, int minor, 26 - int icanon) 26 + unsigned icanon) 27 27 { 28 28 struct tty_audit_buf *buf; 29 29 ··· 239 239 * if TTY auditing is disabled or out of memory. Otherwise, return a new 240 240 * reference to the buffer. 241 241 */ 242 - static struct tty_audit_buf *tty_audit_buf_get(struct tty_struct *tty) 242 + static struct tty_audit_buf *tty_audit_buf_get(struct tty_struct *tty, 243 + unsigned icanon) 243 244 { 244 245 struct tty_audit_buf *buf, *buf2; 245 246 ··· 258 257 259 258 buf2 = tty_audit_buf_alloc(tty->driver->major, 260 259 tty->driver->minor_start + tty->index, 261 - tty->icanon); 260 + icanon); 262 261 if (buf2 == NULL) { 263 262 audit_log_lost("out of memory in TTY auditing"); 264 263 return NULL; ··· 288 287 * Audit @data of @size from @tty, if necessary. 289 288 */ 290 289 void tty_audit_add_data(struct tty_struct *tty, unsigned char *data, 291 - size_t size) 290 + size_t size, unsigned icanon) 292 291 { 293 292 struct tty_audit_buf *buf; 294 293 int major, minor; ··· 300 299 && tty->driver->subtype == PTY_TYPE_MASTER) 301 300 return; 302 301 303 - buf = tty_audit_buf_get(tty); 302 + buf = tty_audit_buf_get(tty, icanon); 304 303 if (!buf) 305 304 return; 306 305 ··· 308 307 major = tty->driver->major; 309 308 minor = tty->driver->minor_start + tty->index; 310 309 if (buf->major != major || buf->minor != minor 311 - || buf->icanon != tty->icanon) { 310 + || buf->icanon != icanon) { 312 311 tty_audit_buf_push_current(buf); 313 312 buf->major = major; 314 313 buf->minor = minor; 315 - buf->icanon = tty->icanon; 314 + buf->icanon = icanon; 316 315 } 317 316 do { 318 317 size_t run;
+129 -99
drivers/tty/tty_buffer.c
··· 27 27 * Locking: none 28 28 */ 29 29 30 - void tty_buffer_free_all(struct tty_struct *tty) 30 + void tty_buffer_free_all(struct tty_port *port) 31 31 { 32 + struct tty_bufhead *buf = &port->buf; 32 33 struct tty_buffer *thead; 33 - while ((thead = tty->buf.head) != NULL) { 34 - tty->buf.head = thead->next; 34 + 35 + while ((thead = buf->head) != NULL) { 36 + buf->head = thead->next; 35 37 kfree(thead); 36 38 } 37 - while ((thead = tty->buf.free) != NULL) { 38 - tty->buf.free = thead->next; 39 + while ((thead = buf->free) != NULL) { 40 + buf->free = thead->next; 39 41 kfree(thead); 40 42 } 41 - tty->buf.tail = NULL; 42 - tty->buf.memory_used = 0; 43 + buf->tail = NULL; 44 + buf->memory_used = 0; 43 45 } 44 46 45 47 /** ··· 56 54 * Locking: Caller must hold tty->buf.lock 57 55 */ 58 56 59 - static struct tty_buffer *tty_buffer_alloc(struct tty_struct *tty, size_t size) 57 + static struct tty_buffer *tty_buffer_alloc(struct tty_port *port, size_t size) 60 58 { 61 59 struct tty_buffer *p; 62 60 63 - if (tty->buf.memory_used + size > 65536) 61 + if (port->buf.memory_used + size > 65536) 64 62 return NULL; 65 63 p = kmalloc(sizeof(struct tty_buffer) + 2 * size, GFP_ATOMIC); 66 64 if (p == NULL) ··· 72 70 p->read = 0; 73 71 p->char_buf_ptr = (char *)(p->data); 74 72 p->flag_buf_ptr = (unsigned char *)p->char_buf_ptr + size; 75 - tty->buf.memory_used += size; 73 + port->buf.memory_used += size; 76 74 return p; 77 75 } 78 76 ··· 87 85 * Locking: Caller must hold tty->buf.lock 88 86 */ 89 87 90 - static void tty_buffer_free(struct tty_struct *tty, struct tty_buffer *b) 88 + static void tty_buffer_free(struct tty_port *port, struct tty_buffer *b) 91 89 { 90 + struct tty_bufhead *buf = &port->buf; 91 + 92 92 /* Dumb strategy for now - should keep some stats */ 93 - tty->buf.memory_used -= b->size; 94 - WARN_ON(tty->buf.memory_used < 0); 93 + buf->memory_used -= b->size; 94 + WARN_ON(buf->memory_used < 0); 95 95 96 96 if (b->size >= 512) 97 97 kfree(b); 98 98 else { 99 - b->next = tty->buf.free; 100 - tty->buf.free = b; 99 + b->next = buf->free; 100 + buf->free = b; 101 101 } 102 102 } 103 103 ··· 114 110 * Locking: Caller must hold tty->buf.lock 115 111 */ 116 112 117 - static void __tty_buffer_flush(struct tty_struct *tty) 113 + static void __tty_buffer_flush(struct tty_port *port) 118 114 { 115 + struct tty_bufhead *buf = &port->buf; 119 116 struct tty_buffer *thead; 120 117 121 - while ((thead = tty->buf.head) != NULL) { 122 - tty->buf.head = thead->next; 123 - tty_buffer_free(tty, thead); 118 + while ((thead = buf->head) != NULL) { 119 + buf->head = thead->next; 120 + tty_buffer_free(port, thead); 124 121 } 125 - tty->buf.tail = NULL; 122 + buf->tail = NULL; 126 123 } 127 124 128 125 /** ··· 139 134 140 135 void tty_buffer_flush(struct tty_struct *tty) 141 136 { 137 + struct tty_port *port = tty->port; 138 + struct tty_bufhead *buf = &port->buf; 142 139 unsigned long flags; 143 - spin_lock_irqsave(&tty->buf.lock, flags); 140 + 141 + spin_lock_irqsave(&buf->lock, flags); 144 142 145 143 /* If the data is being pushed to the tty layer then we can't 146 144 process it here. Instead set a flag and the flush_to_ldisc 147 145 path will process the flush request before it exits */ 148 - if (test_bit(TTY_FLUSHING, &tty->flags)) { 149 - set_bit(TTY_FLUSHPENDING, &tty->flags); 150 - spin_unlock_irqrestore(&tty->buf.lock, flags); 146 + if (test_bit(TTYP_FLUSHING, &port->iflags)) { 147 + set_bit(TTYP_FLUSHPENDING, &port->iflags); 148 + spin_unlock_irqrestore(&buf->lock, flags); 151 149 wait_event(tty->read_wait, 152 - test_bit(TTY_FLUSHPENDING, &tty->flags) == 0); 150 + test_bit(TTYP_FLUSHPENDING, &port->iflags) == 0); 153 151 return; 154 152 } else 155 - __tty_buffer_flush(tty); 156 - spin_unlock_irqrestore(&tty->buf.lock, flags); 153 + __tty_buffer_flush(port); 154 + spin_unlock_irqrestore(&buf->lock, flags); 157 155 } 158 156 159 157 /** ··· 171 163 * Locking: Caller must hold tty->buf.lock 172 164 */ 173 165 174 - static struct tty_buffer *tty_buffer_find(struct tty_struct *tty, size_t size) 166 + static struct tty_buffer *tty_buffer_find(struct tty_port *port, size_t size) 175 167 { 176 - struct tty_buffer **tbh = &tty->buf.free; 168 + struct tty_buffer **tbh = &port->buf.free; 177 169 while ((*tbh) != NULL) { 178 170 struct tty_buffer *t = *tbh; 179 171 if (t->size >= size) { ··· 182 174 t->used = 0; 183 175 t->commit = 0; 184 176 t->read = 0; 185 - tty->buf.memory_used += t->size; 177 + port->buf.memory_used += t->size; 186 178 return t; 187 179 } 188 180 tbh = &((*tbh)->next); 189 181 } 190 182 /* Round the buffer size out */ 191 183 size = (size + 0xFF) & ~0xFF; 192 - return tty_buffer_alloc(tty, size); 184 + return tty_buffer_alloc(port, size); 193 185 /* Should possibly check if this fails for the largest buffer we 194 186 have queued and recycle that ? */ 195 187 } ··· 200 192 * 201 193 * Make at least size bytes of linear space available for the tty 202 194 * buffer. If we fail return the size we managed to find. 203 - * Locking: Caller must hold tty->buf.lock 195 + * Locking: Caller must hold port->buf.lock 204 196 */ 205 - static int __tty_buffer_request_room(struct tty_struct *tty, size_t size) 197 + static int __tty_buffer_request_room(struct tty_port *port, size_t size) 206 198 { 199 + struct tty_bufhead *buf = &port->buf; 207 200 struct tty_buffer *b, *n; 208 201 int left; 209 202 /* OPTIMISATION: We could keep a per tty "zero" sized buffer to 210 203 remove this conditional if its worth it. This would be invisible 211 204 to the callers */ 212 - if ((b = tty->buf.tail) != NULL) 205 + b = buf->tail; 206 + if (b != NULL) 213 207 left = b->size - b->used; 214 208 else 215 209 left = 0; 216 210 217 211 if (left < size) { 218 212 /* This is the slow path - looking for new buffers to use */ 219 - if ((n = tty_buffer_find(tty, size)) != NULL) { 213 + if ((n = tty_buffer_find(port, size)) != NULL) { 220 214 if (b != NULL) { 221 215 b->next = n; 222 216 b->commit = b->used; 223 217 } else 224 - tty->buf.head = n; 225 - tty->buf.tail = n; 218 + buf->head = n; 219 + buf->tail = n; 226 220 } else 227 221 size = left; 228 222 } ··· 241 231 * Make at least size bytes of linear space available for the tty 242 232 * buffer. If we fail return the size we managed to find. 243 233 * 244 - * Locking: Takes tty->buf.lock 234 + * Locking: Takes port->buf.lock 245 235 */ 246 236 int tty_buffer_request_room(struct tty_struct *tty, size_t size) 247 237 { 238 + struct tty_port *port = tty->port; 248 239 unsigned long flags; 249 240 int length; 250 241 251 - spin_lock_irqsave(&tty->buf.lock, flags); 252 - length = __tty_buffer_request_room(tty, size); 253 - spin_unlock_irqrestore(&tty->buf.lock, flags); 242 + spin_lock_irqsave(&port->buf.lock, flags); 243 + length = __tty_buffer_request_room(port, size); 244 + spin_unlock_irqrestore(&port->buf.lock, flags); 254 245 return length; 255 246 } 256 247 EXPORT_SYMBOL_GPL(tty_buffer_request_room); ··· 266 255 * Queue a series of bytes to the tty buffering. All the characters 267 256 * passed are marked with the supplied flag. Returns the number added. 268 257 * 269 - * Locking: Called functions may take tty->buf.lock 258 + * Locking: Called functions may take port->buf.lock 270 259 */ 271 260 272 261 int tty_insert_flip_string_fixed_flag(struct tty_struct *tty, 273 262 const unsigned char *chars, char flag, size_t size) 274 263 { 264 + struct tty_bufhead *buf = &tty->port->buf; 275 265 int copied = 0; 276 266 do { 277 267 int goal = min_t(size_t, size - copied, TTY_BUFFER_PAGE); ··· 280 268 unsigned long flags; 281 269 struct tty_buffer *tb; 282 270 283 - spin_lock_irqsave(&tty->buf.lock, flags); 284 - space = __tty_buffer_request_room(tty, goal); 285 - tb = tty->buf.tail; 271 + spin_lock_irqsave(&buf->lock, flags); 272 + space = __tty_buffer_request_room(tty->port, goal); 273 + tb = buf->tail; 286 274 /* If there is no space then tb may be NULL */ 287 275 if (unlikely(space == 0)) { 288 - spin_unlock_irqrestore(&tty->buf.lock, flags); 276 + spin_unlock_irqrestore(&buf->lock, flags); 289 277 break; 290 278 } 291 279 memcpy(tb->char_buf_ptr + tb->used, chars, space); 292 280 memset(tb->flag_buf_ptr + tb->used, flag, space); 293 281 tb->used += space; 294 - spin_unlock_irqrestore(&tty->buf.lock, flags); 282 + spin_unlock_irqrestore(&buf->lock, flags); 295 283 copied += space; 296 284 chars += space; 297 285 /* There is a small chance that we need to split the data over ··· 312 300 * the flags array indicates the status of the character. Returns the 313 301 * number added. 314 302 * 315 - * Locking: Called functions may take tty->buf.lock 303 + * Locking: Called functions may take port->buf.lock 316 304 */ 317 305 318 306 int tty_insert_flip_string_flags(struct tty_struct *tty, 319 307 const unsigned char *chars, const char *flags, size_t size) 320 308 { 309 + struct tty_bufhead *buf = &tty->port->buf; 321 310 int copied = 0; 322 311 do { 323 312 int goal = min_t(size_t, size - copied, TTY_BUFFER_PAGE); ··· 326 313 unsigned long __flags; 327 314 struct tty_buffer *tb; 328 315 329 - spin_lock_irqsave(&tty->buf.lock, __flags); 330 - space = __tty_buffer_request_room(tty, goal); 331 - tb = tty->buf.tail; 316 + spin_lock_irqsave(&buf->lock, __flags); 317 + space = __tty_buffer_request_room(tty->port, goal); 318 + tb = buf->tail; 332 319 /* If there is no space then tb may be NULL */ 333 320 if (unlikely(space == 0)) { 334 - spin_unlock_irqrestore(&tty->buf.lock, __flags); 321 + spin_unlock_irqrestore(&buf->lock, __flags); 335 322 break; 336 323 } 337 324 memcpy(tb->char_buf_ptr + tb->used, chars, space); 338 325 memcpy(tb->flag_buf_ptr + tb->used, flags, space); 339 326 tb->used += space; 340 - spin_unlock_irqrestore(&tty->buf.lock, __flags); 327 + spin_unlock_irqrestore(&buf->lock, __flags); 341 328 copied += space; 342 329 chars += space; 343 330 flags += space; ··· 355 342 * Takes any pending buffers and transfers their ownership to the 356 343 * ldisc side of the queue. It then schedules those characters for 357 344 * processing by the line discipline. 345 + * Note that this function can only be used when the low_latency flag 346 + * is unset. Otherwise the workqueue won't be flushed. 358 347 * 359 - * Locking: Takes tty->buf.lock 348 + * Locking: Takes port->buf.lock 360 349 */ 361 350 362 351 void tty_schedule_flip(struct tty_struct *tty) 363 352 { 353 + struct tty_bufhead *buf = &tty->port->buf; 364 354 unsigned long flags; 365 - spin_lock_irqsave(&tty->buf.lock, flags); 366 - if (tty->buf.tail != NULL) 367 - tty->buf.tail->commit = tty->buf.tail->used; 368 - spin_unlock_irqrestore(&tty->buf.lock, flags); 369 - schedule_work(&tty->buf.work); 355 + WARN_ON(tty->low_latency); 356 + 357 + spin_lock_irqsave(&buf->lock, flags); 358 + if (buf->tail != NULL) 359 + buf->tail->commit = buf->tail->used; 360 + spin_unlock_irqrestore(&buf->lock, flags); 361 + schedule_work(&buf->work); 370 362 } 371 363 EXPORT_SYMBOL(tty_schedule_flip); 372 364 ··· 387 369 * that need their own block copy routines into the buffer. There is no 388 370 * guarantee the buffer is a DMA target! 389 371 * 390 - * Locking: May call functions taking tty->buf.lock 372 + * Locking: May call functions taking port->buf.lock 391 373 */ 392 374 393 375 int tty_prepare_flip_string(struct tty_struct *tty, unsigned char **chars, 394 - size_t size) 376 + size_t size) 395 377 { 378 + struct tty_bufhead *buf = &tty->port->buf; 396 379 int space; 397 380 unsigned long flags; 398 381 struct tty_buffer *tb; 399 382 400 - spin_lock_irqsave(&tty->buf.lock, flags); 401 - space = __tty_buffer_request_room(tty, size); 383 + spin_lock_irqsave(&buf->lock, flags); 384 + space = __tty_buffer_request_room(tty->port, size); 402 385 403 - tb = tty->buf.tail; 386 + tb = buf->tail; 404 387 if (likely(space)) { 405 388 *chars = tb->char_buf_ptr + tb->used; 406 389 memset(tb->flag_buf_ptr + tb->used, TTY_NORMAL, space); 407 390 tb->used += space; 408 391 } 409 - spin_unlock_irqrestore(&tty->buf.lock, flags); 392 + spin_unlock_irqrestore(&buf->lock, flags); 410 393 return space; 411 394 } 412 395 EXPORT_SYMBOL_GPL(tty_prepare_flip_string); ··· 425 406 * that need their own block copy routines into the buffer. There is no 426 407 * guarantee the buffer is a DMA target! 427 408 * 428 - * Locking: May call functions taking tty->buf.lock 409 + * Locking: May call functions taking port->buf.lock 429 410 */ 430 411 431 412 int tty_prepare_flip_string_flags(struct tty_struct *tty, 432 413 unsigned char **chars, char **flags, size_t size) 433 414 { 415 + struct tty_bufhead *buf = &tty->port->buf; 434 416 int space; 435 417 unsigned long __flags; 436 418 struct tty_buffer *tb; 437 419 438 - spin_lock_irqsave(&tty->buf.lock, __flags); 439 - space = __tty_buffer_request_room(tty, size); 420 + spin_lock_irqsave(&buf->lock, __flags); 421 + space = __tty_buffer_request_room(tty->port, size); 440 422 441 - tb = tty->buf.tail; 423 + tb = buf->tail; 442 424 if (likely(space)) { 443 425 *chars = tb->char_buf_ptr + tb->used; 444 426 *flags = tb->flag_buf_ptr + tb->used; 445 427 tb->used += space; 446 428 } 447 - spin_unlock_irqrestore(&tty->buf.lock, __flags); 429 + spin_unlock_irqrestore(&buf->lock, __flags); 448 430 return space; 449 431 } 450 432 EXPORT_SYMBOL_GPL(tty_prepare_flip_string_flags); ··· 466 446 467 447 static void flush_to_ldisc(struct work_struct *work) 468 448 { 469 - struct tty_struct *tty = 470 - container_of(work, struct tty_struct, buf.work); 449 + struct tty_port *port = container_of(work, struct tty_port, buf.work); 450 + struct tty_bufhead *buf = &port->buf; 451 + struct tty_struct *tty; 471 452 unsigned long flags; 472 453 struct tty_ldisc *disc; 454 + 455 + tty = port->itty; 456 + if (WARN_RATELIMIT(tty == NULL, "tty is NULL")) 457 + return; 473 458 474 459 disc = tty_ldisc_ref(tty); 475 460 if (disc == NULL) /* !TTY_LDISC */ 476 461 return; 477 462 478 - spin_lock_irqsave(&tty->buf.lock, flags); 463 + spin_lock_irqsave(&buf->lock, flags); 479 464 480 - if (!test_and_set_bit(TTY_FLUSHING, &tty->flags)) { 465 + if (!test_and_set_bit(TTYP_FLUSHING, &port->iflags)) { 481 466 struct tty_buffer *head; 482 - while ((head = tty->buf.head) != NULL) { 467 + while ((head = buf->head) != NULL) { 483 468 int count; 484 469 char *char_buf; 485 470 unsigned char *flag_buf; ··· 493 468 if (!count) { 494 469 if (head->next == NULL) 495 470 break; 496 - tty->buf.head = head->next; 497 - tty_buffer_free(tty, head); 471 + buf->head = head->next; 472 + tty_buffer_free(port, head); 498 473 continue; 499 474 } 500 475 /* Ldisc or user is trying to flush the buffers 501 476 we are feeding to the ldisc, stop feeding the 502 477 line discipline as we want to empty the queue */ 503 - if (test_bit(TTY_FLUSHPENDING, &tty->flags)) 478 + if (test_bit(TTYP_FLUSHPENDING, &port->iflags)) 504 479 break; 505 480 if (!tty->receive_room) 506 481 break; ··· 509 484 char_buf = head->char_buf_ptr + head->read; 510 485 flag_buf = head->flag_buf_ptr + head->read; 511 486 head->read += count; 512 - spin_unlock_irqrestore(&tty->buf.lock, flags); 487 + spin_unlock_irqrestore(&buf->lock, flags); 513 488 disc->ops->receive_buf(tty, char_buf, 514 489 flag_buf, count); 515 - spin_lock_irqsave(&tty->buf.lock, flags); 490 + spin_lock_irqsave(&buf->lock, flags); 516 491 } 517 - clear_bit(TTY_FLUSHING, &tty->flags); 492 + clear_bit(TTYP_FLUSHING, &port->iflags); 518 493 } 519 494 520 495 /* We may have a deferred request to flush the input buffer, 521 496 if so pull the chain under the lock and empty the queue */ 522 - if (test_bit(TTY_FLUSHPENDING, &tty->flags)) { 523 - __tty_buffer_flush(tty); 524 - clear_bit(TTY_FLUSHPENDING, &tty->flags); 497 + if (test_bit(TTYP_FLUSHPENDING, &port->iflags)) { 498 + __tty_buffer_flush(port); 499 + clear_bit(TTYP_FLUSHPENDING, &port->iflags); 525 500 wake_up(&tty->read_wait); 526 501 } 527 - spin_unlock_irqrestore(&tty->buf.lock, flags); 502 + spin_unlock_irqrestore(&buf->lock, flags); 528 503 529 504 tty_ldisc_deref(disc); 530 505 } ··· 539 514 */ 540 515 void tty_flush_to_ldisc(struct tty_struct *tty) 541 516 { 542 - flush_work(&tty->buf.work); 517 + if (!tty->low_latency) 518 + flush_work(&tty->port->buf.work); 543 519 } 544 520 545 521 /** ··· 558 532 559 533 void tty_flip_buffer_push(struct tty_struct *tty) 560 534 { 535 + struct tty_bufhead *buf = &tty->port->buf; 561 536 unsigned long flags; 562 - spin_lock_irqsave(&tty->buf.lock, flags); 563 - if (tty->buf.tail != NULL) 564 - tty->buf.tail->commit = tty->buf.tail->used; 565 - spin_unlock_irqrestore(&tty->buf.lock, flags); 537 + 538 + spin_lock_irqsave(&buf->lock, flags); 539 + if (buf->tail != NULL) 540 + buf->tail->commit = buf->tail->used; 541 + spin_unlock_irqrestore(&buf->lock, flags); 566 542 567 543 if (tty->low_latency) 568 - flush_to_ldisc(&tty->buf.work); 544 + flush_to_ldisc(&buf->work); 569 545 else 570 - schedule_work(&tty->buf.work); 546 + schedule_work(&buf->work); 571 547 } 572 548 EXPORT_SYMBOL(tty_flip_buffer_push); 573 549 ··· 583 555 * Locking: none 584 556 */ 585 557 586 - void tty_buffer_init(struct tty_struct *tty) 558 + void tty_buffer_init(struct tty_port *port) 587 559 { 588 - spin_lock_init(&tty->buf.lock); 589 - tty->buf.head = NULL; 590 - tty->buf.tail = NULL; 591 - tty->buf.free = NULL; 592 - tty->buf.memory_used = 0; 593 - INIT_WORK(&tty->buf.work, flush_to_ldisc); 560 + struct tty_bufhead *buf = &port->buf; 561 + 562 + spin_lock_init(&buf->lock); 563 + buf->head = NULL; 564 + buf->tail = NULL; 565 + buf->free = NULL; 566 + buf->memory_used = 0; 567 + INIT_WORK(&buf->work, flush_to_ldisc); 594 568 } 595 569
+3 -12
drivers/tty/tty_io.c
··· 186 186 if (tty->dev) 187 187 put_device(tty->dev); 188 188 kfree(tty->write_buf); 189 - tty_buffer_free_all(tty); 190 189 tty->magic = 0xDEADDEAD; 191 190 kfree(tty); 192 191 } ··· 1416 1417 "%s: %s driver does not set tty->port. This will crash the kernel later. Fix the driver!\n", 1417 1418 __func__, tty->driver->name); 1418 1419 1420 + tty->port->itty = tty; 1421 + 1419 1422 /* 1420 1423 * Structures all installed ... call the ldisc open routines. 1421 1424 * If we fail here just call release_tty to clean up. No need ··· 1553 1552 tty->ops->shutdown(tty); 1554 1553 tty_free_termios(tty); 1555 1554 tty_driver_remove_tty(tty->driver, tty); 1555 + tty->port->itty = NULL; 1556 1556 1557 1557 if (tty->link) 1558 1558 tty_kref_put(tty->link); ··· 1627 1625 struct tty_struct *tty = file_tty(filp); 1628 1626 struct tty_struct *o_tty; 1629 1627 int pty_master, tty_closing, o_tty_closing, do_sleep; 1630 - int devpts; 1631 1628 int idx; 1632 1629 char buf[64]; 1633 1630 ··· 1641 1640 idx = tty->index; 1642 1641 pty_master = (tty->driver->type == TTY_DRIVER_TYPE_PTY && 1643 1642 tty->driver->subtype == PTY_TYPE_MASTER); 1644 - devpts = (tty->driver->flags & TTY_DRIVER_DEVPTS_MEM) != 0; 1645 1643 /* Review: parallel close */ 1646 1644 o_tty = tty->link; 1647 1645 ··· 1799 1799 release_tty(tty, idx); 1800 1800 mutex_unlock(&tty_mutex); 1801 1801 1802 - /* Make this pty number available for reallocation */ 1803 - if (devpts) 1804 - devpts_kill_index(inode, idx); 1805 1802 return 0; 1806 1803 } 1807 1804 ··· 2934 2937 tty_ldisc_init(tty); 2935 2938 tty->session = NULL; 2936 2939 tty->pgrp = NULL; 2937 - tty->overrun_time = jiffies; 2938 - tty_buffer_init(tty); 2939 2940 mutex_init(&tty->legacy_mutex); 2940 2941 mutex_init(&tty->termios_mutex); 2941 2942 mutex_init(&tty->ldisc_mutex); 2942 2943 init_waitqueue_head(&tty->write_wait); 2943 2944 init_waitqueue_head(&tty->read_wait); 2944 2945 INIT_WORK(&tty->hangup_work, do_tty_hangup); 2945 - mutex_init(&tty->atomic_read_lock); 2946 2946 mutex_init(&tty->atomic_write_lock); 2947 - mutex_init(&tty->output_lock); 2948 - mutex_init(&tty->echo_lock); 2949 - spin_lock_init(&tty->read_lock); 2950 2947 spin_lock_init(&tty->ctrl_lock); 2951 2948 INIT_LIST_HEAD(&tty->tty_files); 2952 2949 INIT_WORK(&tty->SAK_work, do_SAK_work);
+10 -5
drivers/tty/tty_ldisc.c
··· 512 512 static int tty_ldisc_halt(struct tty_struct *tty) 513 513 { 514 514 clear_bit(TTY_LDISC, &tty->flags); 515 - return cancel_work_sync(&tty->buf.work); 515 + return cancel_work_sync(&tty->port->buf.work); 516 516 } 517 517 518 518 /** ··· 525 525 { 526 526 flush_work(&tty->hangup_work); 527 527 flush_work(&tty->SAK_work); 528 - flush_work(&tty->buf.work); 528 + flush_work(&tty->port->buf.work); 529 529 } 530 530 531 531 /** ··· 704 704 /* Restart the work queue in case no characters kick it off. Safe if 705 705 already running */ 706 706 if (work) 707 - schedule_work(&tty->buf.work); 707 + schedule_work(&tty->port->buf.work); 708 708 if (o_work) 709 - schedule_work(&o_tty->buf.work); 709 + schedule_work(&o_tty->port->buf.work); 710 710 mutex_unlock(&tty->ldisc_mutex); 711 711 tty_unlock(tty); 712 712 return retval; ··· 817 817 */ 818 818 clear_bit(TTY_LDISC, &tty->flags); 819 819 tty_unlock(tty); 820 - cancel_work_sync(&tty->buf.work); 820 + cancel_work_sync(&tty->port->buf.work); 821 821 mutex_unlock(&tty->ldisc_mutex); 822 822 retry: 823 823 tty_lock(tty); ··· 897 897 898 898 static void tty_ldisc_kill(struct tty_struct *tty) 899 899 { 900 + /* There cannot be users from userspace now. But there still might be 901 + * drivers holding a reference via tty_ldisc_ref. Do not steal them the 902 + * ldisc until they are done. */ 903 + tty_ldisc_wait_idle(tty, MAX_SCHEDULE_TIMEOUT); 904 + 900 905 mutex_lock(&tty->ldisc_mutex); 901 906 /* 902 907 * Now kill off the ldisc
+2
drivers/tty/tty_port.c
··· 21 21 void tty_port_init(struct tty_port *port) 22 22 { 23 23 memset(port, 0, sizeof(*port)); 24 + tty_buffer_init(port); 24 25 init_waitqueue_head(&port->open_wait); 25 26 init_waitqueue_head(&port->close_wait); 26 27 init_waitqueue_head(&port->delta_msr_wait); ··· 127 126 struct tty_port *port = container_of(kref, struct tty_port, kref); 128 127 if (port->xmit_buf) 129 128 free_page((unsigned long)port->xmit_buf); 129 + tty_buffer_free_all(port); 130 130 if (port->ops->destruct) 131 131 port->ops->destruct(port); 132 132 else
+2 -7
drivers/tty/vt/selection.c
··· 341 341 struct tty_ldisc *ld; 342 342 DECLARE_WAITQUEUE(wait, current); 343 343 344 - 345 344 console_lock(); 346 345 poke_blanked_console(); 347 346 console_unlock(); 348 347 349 - /* FIXME: wtf is this supposed to achieve ? */ 350 - ld = tty_ldisc_ref(tty); 351 - if (!ld) 352 - ld = tty_ldisc_ref_wait(tty); 348 + ld = tty_ldisc_ref_wait(tty); 353 349 354 350 /* FIXME: this is completely unsafe */ 355 351 add_wait_queue(&vc->paste_wait, &wait); ··· 357 361 } 358 362 count = sel_buffer_lth - pasted; 359 363 count = min(count, tty->receive_room); 360 - tty->ldisc->ops->receive_buf(tty, sel_buffer + pasted, 361 - NULL, count); 364 + ld->ops->receive_buf(tty, sel_buffer + pasted, NULL, count); 362 365 pasted += count; 363 366 } 364 367 remove_wait_queue(&vc->paste_wait, &wait);
+3 -1
drivers/usb/gadget/omap_udc.c
··· 44 44 #include <asm/unaligned.h> 45 45 #include <asm/mach-types.h> 46 46 47 - #include <plat/dma.h> 47 + #include <plat-omap/dma-omap.h> 48 48 49 49 #include <mach/usb.h> 50 50 ··· 60 60 61 61 #define DRIVER_DESC "OMAP UDC driver" 62 62 #define DRIVER_VERSION "4 October 2004" 63 + 64 + #define OMAP_DMA_USB_W2FC_TX0 29 63 65 64 66 /* 65 67 * The OMAP UDC needs _very_ early endpoint setup: before enabling the
+2 -1
drivers/usb/host/ehci-omap.c
··· 39 39 #include <linux/platform_device.h> 40 40 #include <linux/slab.h> 41 41 #include <linux/usb/ulpi.h> 42 - #include <plat/usb.h> 43 42 #include <linux/regulator/consumer.h> 44 43 #include <linux/pm_runtime.h> 45 44 #include <linux/gpio.h> 46 45 #include <linux/clk.h> 46 + 47 + #include <linux/platform_data/usb-omap.h> 47 48 48 49 /* EHCI Register Set */ 49 50 #define EHCI_INSNREG04 (0xA0)
+2 -3
drivers/usb/host/ohci-omap.c
··· 25 25 #include <asm/mach-types.h> 26 26 27 27 #include <mach/mux.h> 28 - #include <plat/fpga.h> 29 28 30 29 #include <mach/hardware.h> 31 30 #include <mach/irqs.h> ··· 92 93 { 93 94 if (on) { 94 95 if (machine_is_omap_innovator() && cpu_is_omap1510()) 95 - fpga_write(fpga_read(INNOVATOR_FPGA_CAM_USB_CONTROL) 96 + __raw_writeb(__raw_readb(INNOVATOR_FPGA_CAM_USB_CONTROL) 96 97 | ((1 << 5/*usb1*/) | (1 << 3/*usb2*/)), 97 98 INNOVATOR_FPGA_CAM_USB_CONTROL); 98 99 else if (machine_is_omap_osk()) 99 100 tps65010_set_gpio_out_value(GPIO1, LOW); 100 101 } else { 101 102 if (machine_is_omap_innovator() && cpu_is_omap1510()) 102 - fpga_write(fpga_read(INNOVATOR_FPGA_CAM_USB_CONTROL) 103 + __raw_writeb(__raw_readb(INNOVATOR_FPGA_CAM_USB_CONTROL) 103 104 & ~((1 << 5/*usb1*/) | (1 << 3/*usb2*/)), 104 105 INNOVATOR_FPGA_CAM_USB_CONTROL); 105 106 else if (machine_is_omap_osk())
-1
drivers/usb/host/ohci-omap3.c
··· 30 30 */ 31 31 32 32 #include <linux/platform_device.h> 33 - #include <plat/usb.h> 34 33 #include <linux/pm_runtime.h> 35 34 36 35 /*-------------------------------------------------------------------------*/
+1 -2
drivers/usb/musb/am35x.c
··· 34 34 #include <linux/platform_device.h> 35 35 #include <linux/dma-mapping.h> 36 36 #include <linux/usb/nop-usb-xceiv.h> 37 - 38 - #include <plat/usb.h> 37 + #include <linux/platform_data/usb-omap.h> 39 38 40 39 #include "musb_core.h" 41 40
+1 -2
drivers/usb/musb/musb_dsps.c
··· 38 38 #include <linux/pm_runtime.h> 39 39 #include <linux/module.h> 40 40 #include <linux/usb/nop-usb-xceiv.h> 41 + #include <linux/platform_data/usb-omap.h> 41 42 42 43 #include <linux/of.h> 43 44 #include <linux/of_device.h> 44 45 #include <linux/of_address.h> 45 - 46 - #include <plat/usb.h> 47 46 48 47 #include "musb_core.h" 49 48
+1 -1
drivers/usb/musb/omap2430.h
··· 10 10 #ifndef __MUSB_OMAP243X_H__ 11 11 #define __MUSB_OMAP243X_H__ 12 12 13 - #include <plat/usb.h> 13 + #include <linux/platform_data/usb-omap.h> 14 14 15 15 /* 16 16 * OMAP2430-specific definitions
+8 -1
drivers/usb/musb/tusb6010_omap.c
··· 16 16 #include <linux/platform_device.h> 17 17 #include <linux/dma-mapping.h> 18 18 #include <linux/slab.h> 19 - #include <plat/dma.h> 19 + #include <plat-omap/dma-omap.h> 20 20 21 21 #include "musb_core.h" 22 22 #include "tusb6010.h" ··· 24 24 #define to_chdat(c) ((struct tusb_omap_dma_ch *)(c)->private_data) 25 25 26 26 #define MAX_DMAREQ 5 /* REVISIT: Really 6, but req5 not OK */ 27 + 28 + #define OMAP24XX_DMA_EXT_DMAREQ0 2 29 + #define OMAP24XX_DMA_EXT_DMAREQ1 3 30 + #define OMAP242X_DMA_EXT_DMAREQ2 14 31 + #define OMAP242X_DMA_EXT_DMAREQ3 15 32 + #define OMAP242X_DMA_EXT_DMAREQ4 16 33 + #define OMAP242X_DMA_EXT_DMAREQ5 64 27 34 28 35 struct tusb_omap_dma_ch { 29 36 struct musb *musb;
+4 -3
drivers/video/omap/lcd_inn1510.c
··· 23 23 #include <linux/platform_device.h> 24 24 #include <linux/io.h> 25 25 26 - #include <plat/fpga.h> 26 + #include <mach/hardware.h> 27 + 27 28 #include "omapfb.h" 28 29 29 30 static int innovator1510_panel_init(struct lcd_panel *panel, ··· 39 38 40 39 static int innovator1510_panel_enable(struct lcd_panel *panel) 41 40 { 42 - fpga_write(0x7, OMAP1510_FPGA_LCD_PANEL_CONTROL); 41 + __raw_writeb(0x7, OMAP1510_FPGA_LCD_PANEL_CONTROL); 43 42 return 0; 44 43 } 45 44 46 45 static void innovator1510_panel_disable(struct lcd_panel *panel) 47 46 { 48 - fpga_write(0x0, OMAP1510_FPGA_LCD_PANEL_CONTROL); 47 + __raw_writeb(0x0, OMAP1510_FPGA_LCD_PANEL_CONTROL); 49 48 } 50 49 51 50 static unsigned long innovator1510_panel_get_caps(struct lcd_panel *panel)
+1 -1
drivers/video/omap/lcdc.c
··· 31 31 #include <linux/gfp.h> 32 32 33 33 #include <mach/lcdc.h> 34 - #include <plat/dma.h> 34 + #include <plat-omap/dma-omap.h> 35 35 36 36 #include <asm/mach-types.h> 37 37
+1 -1
drivers/video/omap/omapfb_main.c
··· 30 30 #include <linux/uaccess.h> 31 31 #include <linux/module.h> 32 32 33 - #include <plat/dma.h> 33 + #include <plat-omap/dma-omap.h> 34 34 35 35 #include "omapfb.h" 36 36 #include "lcdc.h"
+1 -1
drivers/video/omap/sossi.c
··· 25 25 #include <linux/io.h> 26 26 #include <linux/interrupt.h> 27 27 28 - #include <plat/dma.h> 28 + #include <plat-omap/dma-omap.h> 29 29 30 30 #include "omapfb.h" 31 31 #include "lcdc.h"
+1 -1
drivers/video/omap2/dss/core.c
··· 237 237 238 238 core.pdev = pdev; 239 239 240 - dss_features_init(); 240 + dss_features_init(pdata->version); 241 241 242 242 dss_apply_init(); 243 243
+28 -15
drivers/video/omap2/dss/dispc.c
··· 37 37 #include <linux/platform_device.h> 38 38 #include <linux/pm_runtime.h> 39 39 40 - #include <plat/cpu.h> 41 - 42 40 #include <video/omapdss.h> 43 41 44 42 #include "dss.h" ··· 4040 4042 .gfx_fifo_workaround = true, 4041 4043 }; 4042 4044 4043 - static int __init dispc_init_features(struct device *dev) 4045 + static int __init dispc_init_features(struct platform_device *pdev) 4044 4046 { 4047 + struct omap_dss_board_info *pdata = pdev->dev.platform_data; 4045 4048 const struct dispc_features *src; 4046 4049 struct dispc_features *dst; 4047 4050 4048 - dst = devm_kzalloc(dev, sizeof(*dst), GFP_KERNEL); 4051 + dst = devm_kzalloc(&pdev->dev, sizeof(*dst), GFP_KERNEL); 4049 4052 if (!dst) { 4050 - dev_err(dev, "Failed to allocate DISPC Features\n"); 4053 + dev_err(&pdev->dev, "Failed to allocate DISPC Features\n"); 4051 4054 return -ENOMEM; 4052 4055 } 4053 4056 4054 - if (cpu_is_omap24xx()) { 4057 + switch (pdata->version) { 4058 + case OMAPDSS_VER_OMAP24xx: 4055 4059 src = &omap24xx_dispc_feats; 4056 - } else if (cpu_is_omap34xx()) { 4057 - if (omap_rev() < OMAP3430_REV_ES3_0) 4058 - src = &omap34xx_rev1_0_dispc_feats; 4059 - else 4060 - src = &omap34xx_rev3_0_dispc_feats; 4061 - } else if (cpu_is_omap44xx()) { 4060 + break; 4061 + 4062 + case OMAPDSS_VER_OMAP34xx_ES1: 4063 + src = &omap34xx_rev1_0_dispc_feats; 4064 + break; 4065 + 4066 + case OMAPDSS_VER_OMAP34xx_ES3: 4067 + case OMAPDSS_VER_OMAP3630: 4068 + case OMAPDSS_VER_AM35xx: 4069 + src = &omap34xx_rev3_0_dispc_feats; 4070 + break; 4071 + 4072 + case OMAPDSS_VER_OMAP4430_ES1: 4073 + case OMAPDSS_VER_OMAP4430_ES2: 4074 + case OMAPDSS_VER_OMAP4: 4062 4075 src = &omap44xx_dispc_feats; 4063 - } else if (soc_is_omap54xx()) { 4076 + break; 4077 + 4078 + case OMAPDSS_VER_OMAP5: 4064 4079 src = &omap44xx_dispc_feats; 4065 - } else { 4080 + break; 4081 + 4082 + default: 4066 4083 return -ENODEV; 4067 4084 } 4068 4085 ··· 4097 4084 4098 4085 dispc.pdev = pdev; 4099 4086 4100 - r = dispc_init_features(&dispc.pdev->dev); 4087 + r = dispc_init_features(dispc.pdev); 4101 4088 if (r) 4102 4089 return r; 4103 4090
+27 -12
drivers/video/omap2/dss/dss.c
··· 35 35 36 36 #include <video/omapdss.h> 37 37 38 - #include <plat/cpu.h> 39 - 40 38 #include "dss.h" 41 39 #include "dss_features.h" 42 40 ··· 790 792 .dpi_select_source = &dss_dpi_select_source_omap5, 791 793 }; 792 794 793 - static int __init dss_init_features(struct device *dev) 795 + static int __init dss_init_features(struct platform_device *pdev) 794 796 { 797 + struct omap_dss_board_info *pdata = pdev->dev.platform_data; 795 798 const struct dss_features *src; 796 799 struct dss_features *dst; 797 800 798 - dst = devm_kzalloc(dev, sizeof(*dst), GFP_KERNEL); 801 + dst = devm_kzalloc(&pdev->dev, sizeof(*dst), GFP_KERNEL); 799 802 if (!dst) { 800 - dev_err(dev, "Failed to allocate local DSS Features\n"); 803 + dev_err(&pdev->dev, "Failed to allocate local DSS Features\n"); 801 804 return -ENOMEM; 802 805 } 803 806 804 - if (cpu_is_omap24xx()) 807 + switch (pdata->version) { 808 + case OMAPDSS_VER_OMAP24xx: 805 809 src = &omap24xx_dss_feats; 806 - else if (cpu_is_omap34xx()) 810 + break; 811 + 812 + case OMAPDSS_VER_OMAP34xx_ES1: 813 + case OMAPDSS_VER_OMAP34xx_ES3: 814 + case OMAPDSS_VER_AM35xx: 807 815 src = &omap34xx_dss_feats; 808 - else if (cpu_is_omap3630()) 816 + break; 817 + 818 + case OMAPDSS_VER_OMAP3630: 809 819 src = &omap3630_dss_feats; 810 - else if (cpu_is_omap44xx()) 820 + break; 821 + 822 + case OMAPDSS_VER_OMAP4430_ES1: 823 + case OMAPDSS_VER_OMAP4430_ES2: 824 + case OMAPDSS_VER_OMAP4: 811 825 src = &omap44xx_dss_feats; 812 - else if (soc_is_omap54xx()) 826 + break; 827 + 828 + case OMAPDSS_VER_OMAP5: 813 829 src = &omap54xx_dss_feats; 814 - else 830 + break; 831 + 832 + default: 815 833 return -ENODEV; 834 + } 816 835 817 836 memcpy(dst, src, sizeof(*dst)); 818 837 dss.feat = dst; ··· 846 831 847 832 dss.pdev = pdev; 848 833 849 - r = dss_init_features(&dss.pdev->dev); 834 + r = dss_init_features(dss.pdev); 850 835 if (r) 851 836 return r; 852 837
+44 -20
drivers/video/omap2/dss/dss_features.c
··· 23 23 #include <linux/slab.h> 24 24 25 25 #include <video/omapdss.h> 26 - #include <plat/cpu.h> 27 26 28 27 #include "dss.h" 29 28 #include "dss_features.h" ··· 824 825 825 826 }; 826 827 827 - void dss_init_hdmi_ip_ops(struct hdmi_ip_data *ip_data) 828 + void dss_init_hdmi_ip_ops(struct hdmi_ip_data *ip_data, 829 + enum omapdss_version version) 828 830 { 829 - if (cpu_is_omap44xx()) 831 + switch (version) { 832 + case OMAPDSS_VER_OMAP4430_ES1: 833 + case OMAPDSS_VER_OMAP4430_ES2: 834 + case OMAPDSS_VER_OMAP4: 830 835 ip_data->ops = &omap4_hdmi_functions; 836 + break; 837 + default: 838 + ip_data->ops = NULL; 839 + } 840 + 841 + WARN_ON(ip_data->ops == NULL); 831 842 } 832 843 #endif 833 844 ··· 938 929 return omap_current_dss_features->supported_rotation_types & rot_type; 939 930 } 940 931 941 - void dss_features_init(void) 932 + void dss_features_init(enum omapdss_version version) 942 933 { 943 - if (cpu_is_omap24xx()) 934 + switch (version) { 935 + case OMAPDSS_VER_OMAP24xx: 944 936 omap_current_dss_features = &omap2_dss_features; 945 - else if (cpu_is_omap3630()) 937 + break; 938 + 939 + case OMAPDSS_VER_OMAP34xx_ES1: 940 + case OMAPDSS_VER_OMAP34xx_ES3: 941 + omap_current_dss_features = &omap3430_dss_features; 942 + break; 943 + 944 + case OMAPDSS_VER_OMAP3630: 946 945 omap_current_dss_features = &omap3630_dss_features; 947 - else if (cpu_is_omap34xx()) { 948 - if (soc_is_am35xx()) { 949 - omap_current_dss_features = &am35xx_dss_features; 950 - } else { 951 - omap_current_dss_features = &omap3430_dss_features; 952 - } 953 - } 954 - else if (omap_rev() == OMAP4430_REV_ES1_0) 946 + break; 947 + 948 + case OMAPDSS_VER_OMAP4430_ES1: 955 949 omap_current_dss_features = &omap4430_es1_0_dss_features; 956 - else if (omap_rev() == OMAP4430_REV_ES2_0 || 957 - omap_rev() == OMAP4430_REV_ES2_1 || 958 - omap_rev() == OMAP4430_REV_ES2_2) 950 + break; 951 + 952 + case OMAPDSS_VER_OMAP4430_ES2: 959 953 omap_current_dss_features = &omap4430_es2_0_1_2_dss_features; 960 - else if (cpu_is_omap44xx()) 954 + break; 955 + 956 + case OMAPDSS_VER_OMAP4: 961 957 omap_current_dss_features = &omap4_dss_features; 962 - else if (soc_is_omap54xx()) 958 + break; 959 + 960 + case OMAPDSS_VER_OMAP5: 963 961 omap_current_dss_features = &omap5_dss_features; 964 - else 962 + break; 963 + 964 + case OMAPDSS_VER_AM35xx: 965 + omap_current_dss_features = &am35xx_dss_features; 966 + break; 967 + 968 + default: 965 969 DSSWARN("Unsupported OMAP version"); 970 + break; 971 + } 966 972 }
+3 -2
drivers/video/omap2/dss/dss_features.h
··· 123 123 124 124 bool dss_has_feature(enum dss_feat_id id); 125 125 void dss_feat_get_reg_field(enum dss_feat_reg_field id, u8 *start, u8 *end); 126 - void dss_features_init(void); 126 + void dss_features_init(enum omapdss_version version); 127 127 #if defined(CONFIG_OMAP4_DSS_HDMI) 128 - void dss_init_hdmi_ip_ops(struct hdmi_ip_data *ip_data); 128 + void dss_init_hdmi_ip_ops(struct hdmi_ip_data *ip_data, 129 + enum omapdss_version version); 129 130 #endif 130 131 #endif
+2 -1
drivers/video/omap2/dss/hdmi.c
··· 323 323 324 324 static int __init hdmi_init_display(struct omap_dss_device *dssdev) 325 325 { 326 + struct omap_dss_board_info *pdata = hdmi.pdev->dev.platform_data; 326 327 int r; 327 328 328 329 struct gpio gpios[] = { ··· 334 333 335 334 DSSDBG("init_display\n"); 336 335 337 - dss_init_hdmi_ip_ops(&hdmi.ip_data); 336 + dss_init_hdmi_ip_ops(&hdmi.ip_data, pdata->version); 338 337 339 338 if (hdmi.vdda_hdmi_dac_reg == NULL) { 340 339 struct regulator *reg;
+1 -1
drivers/video/omap2/omapfb/omapfb-ioctl.c
··· 30 30 #include <linux/export.h> 31 31 32 32 #include <video/omapdss.h> 33 - #include <plat/vrfb.h> 33 + #include <video/omapvrfb.h> 34 34 #include <plat/vram.h> 35 35 36 36 #include "omapfb.h"
+2 -6
drivers/video/omap2/omapfb/omapfb-main.c
··· 31 31 #include <linux/omapfb.h> 32 32 33 33 #include <video/omapdss.h> 34 - #include <plat/cpu.h> 35 34 #include <plat/vram.h> 36 - #include <plat/vrfb.h> 35 + #include <video/omapvrfb.h> 37 36 38 37 #include "omapfb.h" 39 38 ··· 2395 2396 goto err0; 2396 2397 } 2397 2398 2398 - /* TODO : Replace cpu check with omap_has_vrfb once HAS_FEATURE 2399 - * available for OMAP2 and OMAP3 2400 - */ 2401 - if (def_vrfb && !cpu_is_omap24xx() && !cpu_is_omap34xx()) { 2399 + if (def_vrfb && !omap_vrfb_supported()) { 2402 2400 def_vrfb = 0; 2403 2401 dev_warn(&pdev->dev, "VRFB is not supported on this hardware, " 2404 2402 "ignoring the module parameter vrfb=y\n");
+1 -1
drivers/video/omap2/omapfb/omapfb-sysfs.c
··· 30 30 #include <linux/omapfb.h> 31 31 32 32 #include <video/omapdss.h> 33 - #include <plat/vrfb.h> 33 + #include <video/omapvrfb.h> 34 34 35 35 #include "omapfb.h" 36 36
+121 -21
drivers/video/omap2/vrfb.c
··· 26 26 #include <linux/io.h> 27 27 #include <linux/bitops.h> 28 28 #include <linux/mutex.h> 29 + #include <linux/platform_device.h> 29 30 30 - #include <plat/vrfb.h> 31 - #include <plat/sdrc.h> 31 + #include <video/omapvrfb.h> 32 32 33 33 #ifdef DEBUG 34 34 #define DBG(format, ...) pr_debug("VRFB: " format, ## __VA_ARGS__) ··· 36 36 #define DBG(format, ...) 37 37 #endif 38 38 39 - #define SMS_ROT_VIRT_BASE(context, rot) \ 40 - (((context >= 4) ? 0xD0000000 : 0x70000000) \ 41 - + (0x4000000 * (context)) \ 42 - + (0x1000000 * (rot))) 39 + #define SMS_ROT_CONTROL(context) (0x0 + 0x10 * context) 40 + #define SMS_ROT_SIZE(context) (0x4 + 0x10 * context) 41 + #define SMS_ROT_PHYSICAL_BA(context) (0x8 + 0x10 * context) 42 + #define SMS_ROT_VIRT_BASE(rot) (0x1000000 * (rot)) 43 43 44 44 #define OMAP_VRFB_SIZE (2048 * 2048 * 4) 45 45 ··· 53 53 #define SMS_PW_OFFSET 4 54 54 #define SMS_PS_OFFSET 0 55 55 56 - #define VRFB_NUM_CTXS 12 57 56 /* bitmap of reserved contexts */ 58 57 static unsigned long ctx_map; 58 + 59 + struct vrfb_ctx { 60 + u32 base; 61 + u32 physical_ba; 62 + u32 control; 63 + u32 size; 64 + }; 59 65 60 66 static DEFINE_MUTEX(ctx_lock); 61 67 ··· 71 65 * we don't need locking, since no drivers will run until after the wake-up 72 66 * has finished. 73 67 */ 74 - static struct { 75 - u32 physical_ba; 76 - u32 control; 77 - u32 size; 78 - } vrfb_hw_context[VRFB_NUM_CTXS]; 68 + 69 + static void __iomem *vrfb_base; 70 + 71 + static int num_ctxs; 72 + static struct vrfb_ctx *ctxs; 73 + 74 + static bool vrfb_loaded; 75 + 76 + static void omap2_sms_write_rot_control(u32 val, unsigned ctx) 77 + { 78 + __raw_writel(val, vrfb_base + SMS_ROT_CONTROL(ctx)); 79 + } 80 + 81 + static void omap2_sms_write_rot_size(u32 val, unsigned ctx) 82 + { 83 + __raw_writel(val, vrfb_base + SMS_ROT_SIZE(ctx)); 84 + } 85 + 86 + static void omap2_sms_write_rot_physical_ba(u32 val, unsigned ctx) 87 + { 88 + __raw_writel(val, vrfb_base + SMS_ROT_PHYSICAL_BA(ctx)); 89 + } 79 90 80 91 static inline void restore_hw_context(int ctx) 81 92 { 82 - omap2_sms_write_rot_control(vrfb_hw_context[ctx].control, ctx); 83 - omap2_sms_write_rot_size(vrfb_hw_context[ctx].size, ctx); 84 - omap2_sms_write_rot_physical_ba(vrfb_hw_context[ctx].physical_ba, ctx); 93 + omap2_sms_write_rot_control(ctxs[ctx].control, ctx); 94 + omap2_sms_write_rot_size(ctxs[ctx].size, ctx); 95 + omap2_sms_write_rot_physical_ba(ctxs[ctx].physical_ba, ctx); 85 96 } 86 97 87 98 static u32 get_image_width_roundup(u16 width, u8 bytespp) ··· 219 196 control |= VRFB_PAGE_WIDTH_EXP << SMS_PW_OFFSET; 220 197 control |= VRFB_PAGE_HEIGHT_EXP << SMS_PH_OFFSET; 221 198 222 - vrfb_hw_context[ctx].physical_ba = paddr; 223 - vrfb_hw_context[ctx].size = size; 224 - vrfb_hw_context[ctx].control = control; 199 + ctxs[ctx].physical_ba = paddr; 200 + ctxs[ctx].size = size; 201 + ctxs[ctx].control = control; 225 202 226 203 omap2_sms_write_rot_physical_ba(paddr, ctx); 227 204 omap2_sms_write_rot_size(size, ctx); ··· 297 274 298 275 mutex_lock(&ctx_lock); 299 276 300 - for (ctx = 0; ctx < VRFB_NUM_CTXS; ++ctx) 277 + for (ctx = 0; ctx < num_ctxs; ++ctx) 301 278 if ((ctx_map & (1 << ctx)) == 0) 302 279 break; 303 280 304 - if (ctx == VRFB_NUM_CTXS) { 281 + if (ctx == num_ctxs) { 305 282 pr_err("vrfb: no free contexts\n"); 306 283 r = -EBUSY; 307 284 goto out; ··· 316 293 vrfb->context = ctx; 317 294 318 295 for (rot = 0; rot < 4; ++rot) { 319 - paddr = SMS_ROT_VIRT_BASE(ctx, rot); 296 + paddr = ctxs[ctx].base + SMS_ROT_VIRT_BASE(rot); 320 297 if (!request_mem_region(paddr, OMAP_VRFB_SIZE, "vrfb")) { 321 298 pr_err("vrfb: failed to reserve VRFB " 322 299 "area for ctx %d, rotation %d\n", ··· 337 314 return r; 338 315 } 339 316 EXPORT_SYMBOL(omap_vrfb_request_ctx); 317 + 318 + bool omap_vrfb_supported(void) 319 + { 320 + return vrfb_loaded; 321 + } 322 + EXPORT_SYMBOL(omap_vrfb_supported); 323 + 324 + static int __init vrfb_probe(struct platform_device *pdev) 325 + { 326 + struct resource *mem; 327 + int i; 328 + 329 + /* first resource is the register res, the rest are vrfb contexts */ 330 + 331 + mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 332 + if (!mem) { 333 + dev_err(&pdev->dev, "can't get vrfb base address\n"); 334 + return -EINVAL; 335 + } 336 + 337 + vrfb_base = devm_request_and_ioremap(&pdev->dev, mem); 338 + if (!vrfb_base) { 339 + dev_err(&pdev->dev, "can't ioremap vrfb memory\n"); 340 + return -ENOMEM; 341 + } 342 + 343 + num_ctxs = pdev->num_resources - 1; 344 + 345 + ctxs = devm_kzalloc(&pdev->dev, 346 + sizeof(struct vrfb_ctx) * num_ctxs, 347 + GFP_KERNEL); 348 + 349 + if (!ctxs) 350 + return -ENOMEM; 351 + 352 + for (i = 0; i < num_ctxs; ++i) { 353 + mem = platform_get_resource(pdev, IORESOURCE_MEM, 1 + i); 354 + if (!mem) { 355 + dev_err(&pdev->dev, "can't get vrfb ctx %d address\n", 356 + i); 357 + return -EINVAL; 358 + } 359 + 360 + ctxs[i].base = mem->start; 361 + } 362 + 363 + vrfb_loaded = true; 364 + 365 + return 0; 366 + } 367 + 368 + static void __exit vrfb_remove(struct platform_device *pdev) 369 + { 370 + vrfb_loaded = false; 371 + } 372 + 373 + static struct platform_driver vrfb_driver = { 374 + .driver.name = "omapvrfb", 375 + .remove = __exit_p(vrfb_remove), 376 + }; 377 + 378 + static int __init vrfb_init(void) 379 + { 380 + return platform_driver_probe(&vrfb_driver, &vrfb_probe); 381 + } 382 + 383 + static void __exit vrfb_exit(void) 384 + { 385 + platform_driver_unregister(&vrfb_driver); 386 + } 387 + 388 + module_init(vrfb_init); 389 + module_exit(vrfb_exit); 390 + 391 + MODULE_AUTHOR("Tomi Valkeinen <tomi.valkeinen@ti.com>"); 392 + MODULE_DESCRIPTION("OMAP VRFB"); 393 + MODULE_LICENSE("GPL v2");
+36 -25
fs/devpts/inode.c
··· 545 545 mutex_unlock(&allocated_ptys_lock); 546 546 } 547 547 548 - int devpts_pty_new(struct inode *ptmx_inode, struct tty_struct *tty) 548 + /** 549 + * devpts_pty_new -- create a new inode in /dev/pts/ 550 + * @ptmx_inode: inode of the master 551 + * @device: major+minor of the node to be created 552 + * @index: used as a name of the node 553 + * @priv: what's given back by devpts_get_priv 554 + * 555 + * The created inode is returned. Remove it from /dev/pts/ by devpts_pty_kill. 556 + */ 557 + struct inode *devpts_pty_new(struct inode *ptmx_inode, dev_t device, int index, 558 + void *priv) 549 559 { 550 - /* tty layer puts index from devpts_new_index() in here */ 551 - int number = tty->index; 552 - struct tty_driver *driver = tty->driver; 553 - dev_t device = MKDEV(driver->major, driver->minor_start+number); 554 560 struct dentry *dentry; 555 561 struct super_block *sb = pts_sb_from_inode(ptmx_inode); 556 - struct inode *inode = new_inode(sb); 562 + struct inode *inode; 557 563 struct dentry *root = sb->s_root; 558 564 struct pts_fs_info *fsi = DEVPTS_SB(sb); 559 565 struct pts_mount_opts *opts = &fsi->mount_opts; 560 - int ret = 0; 561 566 char s[12]; 562 567 563 - /* We're supposed to be given the slave end of a pty */ 564 - BUG_ON(driver->type != TTY_DRIVER_TYPE_PTY); 565 - BUG_ON(driver->subtype != PTY_TYPE_SLAVE); 566 - 568 + inode = new_inode(sb); 567 569 if (!inode) 568 - return -ENOMEM; 570 + return ERR_PTR(-ENOMEM); 569 571 570 - inode->i_ino = number + 3; 572 + inode->i_ino = index + 3; 571 573 inode->i_uid = opts->setuid ? opts->uid : current_fsuid(); 572 574 inode->i_gid = opts->setgid ? opts->gid : current_fsgid(); 573 575 inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; 574 576 init_special_inode(inode, S_IFCHR|opts->mode, device); 575 - inode->i_private = tty; 576 - tty->driver_data = inode; 577 + inode->i_private = priv; 577 578 578 - sprintf(s, "%d", number); 579 + sprintf(s, "%d", index); 579 580 580 581 mutex_lock(&root->d_inode->i_mutex); 581 582 ··· 586 585 fsnotify_create(root->d_inode, dentry); 587 586 } else { 588 587 iput(inode); 589 - ret = -ENOMEM; 588 + inode = ERR_PTR(-ENOMEM); 590 589 } 591 590 592 591 mutex_unlock(&root->d_inode->i_mutex); 593 592 594 - return ret; 593 + return inode; 595 594 } 596 595 597 - struct tty_struct *devpts_get_tty(struct inode *pts_inode, int number) 596 + /** 597 + * devpts_get_priv -- get private data for a slave 598 + * @pts_inode: inode of the slave 599 + * 600 + * Returns whatever was passed as priv in devpts_pty_new for a given inode. 601 + */ 602 + void *devpts_get_priv(struct inode *pts_inode) 598 603 { 599 604 struct dentry *dentry; 600 - struct tty_struct *tty; 605 + void *priv = NULL; 601 606 602 607 BUG_ON(pts_inode->i_rdev == MKDEV(TTYAUX_MAJOR, PTMX_MINOR)); 603 608 ··· 612 605 if (!dentry) 613 606 return NULL; 614 607 615 - tty = NULL; 616 608 if (pts_inode->i_sb->s_magic == DEVPTS_SUPER_MAGIC) 617 - tty = (struct tty_struct *)pts_inode->i_private; 609 + priv = pts_inode->i_private; 618 610 619 611 dput(dentry); 620 612 621 - return tty; 613 + return priv; 622 614 } 623 615 624 - void devpts_pty_kill(struct tty_struct *tty) 616 + /** 617 + * devpts_pty_kill -- remove inode form /dev/pts/ 618 + * @inode: inode of the slave to be removed 619 + * 620 + * This is an inverse operation of devpts_pty_new. 621 + */ 622 + void devpts_pty_kill(struct inode *inode) 625 623 { 626 - struct inode *inode = tty->driver_data; 627 624 struct super_block *sb = pts_sb_from_inode(inode); 628 625 struct dentry *root = sb->s_root; 629 626 struct dentry *dentry;
+10 -10
include/linux/devpts_fs.h
··· 20 20 int devpts_new_index(struct inode *ptmx_inode); 21 21 void devpts_kill_index(struct inode *ptmx_inode, int idx); 22 22 /* mknod in devpts */ 23 - int devpts_pty_new(struct inode *ptmx_inode, struct tty_struct *tty); 24 - /* get tty structure */ 25 - struct tty_struct *devpts_get_tty(struct inode *pts_inode, int number); 23 + struct inode *devpts_pty_new(struct inode *ptmx_inode, dev_t device, int index, 24 + void *priv); 25 + /* get private structure */ 26 + void *devpts_get_priv(struct inode *pts_inode); 26 27 /* unlink */ 27 - void devpts_pty_kill(struct tty_struct *tty); 28 + void devpts_pty_kill(struct inode *inode); 28 29 29 30 #else 30 31 31 32 /* Dummy stubs in the no-pty case */ 32 33 static inline int devpts_new_index(struct inode *ptmx_inode) { return -EINVAL; } 33 34 static inline void devpts_kill_index(struct inode *ptmx_inode, int idx) { } 34 - static inline int devpts_pty_new(struct inode *ptmx_inode, 35 - struct tty_struct *tty) 35 + static inline struct inode *devpts_pty_new(struct inode *ptmx_inode, 36 + dev_t device, int index, void *priv) 36 37 { 37 - return -EINVAL; 38 + return ERR_PTR(-EINVAL); 38 39 } 39 - static inline struct tty_struct *devpts_get_tty(struct inode *pts_inode, 40 - int number) 40 + static inline void *devpts_get_priv(struct inode *pts_inode) 41 41 { 42 42 return NULL; 43 43 } 44 - static inline void devpts_pty_kill(struct tty_struct *tty) { } 44 + static inline void devpts_pty_kill(struct inode *inode) { } 45 45 46 46 #endif 47 47
-1
include/linux/platform_data/gpio-omap.h
··· 26 26 27 27 #include <linux/io.h> 28 28 #include <linux/platform_device.h> 29 - #include <mach/irqs.h> 30 29 31 30 #define OMAP1_MPUIO_BASE 0xfffb5000 32 31
+34 -12
include/linux/platform_data/mtd-nand-omap2.h
··· 8 8 * published by the Free Software Foundation. 9 9 */ 10 10 11 - #include <plat/gpmc.h> 11 + #ifndef _MTD_NAND_OMAP2_H 12 + #define _MTD_NAND_OMAP2_H 13 + 12 14 #include <linux/mtd/partitions.h> 15 + 16 + #define GPMC_BCH_NUM_REMAINDER 8 13 17 14 18 enum nand_io { 15 19 NAND_OMAP_PREFETCH_POLLED = 0, /* prefetch polled mode, default */ ··· 22 18 NAND_OMAP_PREFETCH_IRQ /* prefetch enabled irq mode */ 23 19 }; 24 20 21 + enum omap_ecc { 22 + /* 1-bit ecc: stored at end of spare area */ 23 + OMAP_ECC_HAMMING_CODE_DEFAULT = 0, /* Default, s/w method */ 24 + OMAP_ECC_HAMMING_CODE_HW, /* gpmc to detect the error */ 25 + /* 1-bit ecc: stored at beginning of spare area as romcode */ 26 + OMAP_ECC_HAMMING_CODE_HW_ROMCODE, /* gpmc method & romcode layout */ 27 + OMAP_ECC_BCH4_CODE_HW, /* 4-bit BCH ecc code */ 28 + OMAP_ECC_BCH8_CODE_HW, /* 8-bit BCH ecc code */ 29 + }; 30 + 31 + struct gpmc_nand_regs { 32 + void __iomem *gpmc_status; 33 + void __iomem *gpmc_nand_command; 34 + void __iomem *gpmc_nand_address; 35 + void __iomem *gpmc_nand_data; 36 + void __iomem *gpmc_prefetch_config1; 37 + void __iomem *gpmc_prefetch_config2; 38 + void __iomem *gpmc_prefetch_control; 39 + void __iomem *gpmc_prefetch_status; 40 + void __iomem *gpmc_ecc_config; 41 + void __iomem *gpmc_ecc_control; 42 + void __iomem *gpmc_ecc_size_config; 43 + void __iomem *gpmc_ecc1_result; 44 + void __iomem *gpmc_bch_result0[GPMC_BCH_NUM_REMAINDER]; 45 + void __iomem *gpmc_bch_result1[GPMC_BCH_NUM_REMAINDER]; 46 + void __iomem *gpmc_bch_result2[GPMC_BCH_NUM_REMAINDER]; 47 + void __iomem *gpmc_bch_result3[GPMC_BCH_NUM_REMAINDER]; 48 + }; 49 + 25 50 struct omap_nand_platform_data { 26 51 int cs; 27 52 struct mtd_partition *parts; 28 - struct gpmc_timings *gpmc_t; 29 53 int nr_parts; 30 54 bool dev_ready; 31 55 enum nand_io xfer_type; ··· 62 30 struct gpmc_nand_regs reg; 63 31 }; 64 32 65 - /* minimum size for IO mapping */ 66 - #define NAND_IO_SIZE 4 67 - 68 - #if defined(CONFIG_MTD_NAND_OMAP2) || defined(CONFIG_MTD_NAND_OMAP2_MODULE) 69 - extern int gpmc_nand_init(struct omap_nand_platform_data *d); 70 - #else 71 - static inline int gpmc_nand_init(struct omap_nand_platform_data *d) 72 - { 73 - return 0; 74 - } 75 33 #endif
+4 -24
include/linux/platform_data/mtd-onenand-omap2.h
··· 9 9 * published by the Free Software Foundation. 10 10 */ 11 11 12 + #ifndef __MTD_ONENAND_OMAP2_H 13 + #define __MTD_ONENAND_OMAP2_H 14 + 12 15 #include <linux/mtd/mtd.h> 13 16 #include <linux/mtd/partitions.h> 14 17 15 18 #define ONENAND_SYNC_READ (1 << 0) 16 19 #define ONENAND_SYNC_READWRITE (1 << 1) 17 - 18 - struct onenand_freq_info { 19 - u16 maf_id; 20 - u16 dev_id; 21 - u16 ver_id; 22 - }; 20 + #define ONENAND_IN_OMAP34XX (1 << 2) 23 21 24 22 struct omap_onenand_platform_data { 25 23 int cs; ··· 25 27 struct mtd_partition *parts; 26 28 int nr_parts; 27 29 int (*onenand_setup)(void __iomem *, int *freq_ptr); 28 - int (*get_freq)(const struct onenand_freq_info *freq_info, 29 - bool *clk_dep); 30 30 int dma_channel; 31 31 u8 flags; 32 32 u8 regulator_can_sleep; 33 33 u8 skip_initial_unlocking; 34 34 }; 35 - 36 - #define ONENAND_MAX_PARTITIONS 8 37 - 38 - #if defined(CONFIG_MTD_ONENAND_OMAP2) || \ 39 - defined(CONFIG_MTD_ONENAND_OMAP2_MODULE) 40 - 41 - extern void gpmc_onenand_init(struct omap_onenand_platform_data *d); 42 - 43 - #else 44 - 45 - #define board_onenand_data NULL 46 - 47 - static inline void gpmc_onenand_init(struct omap_onenand_platform_data *d) 48 - { 49 - } 50 - 51 35 #endif
+80
include/linux/platform_data/usb-omap.h
··· 1 + /* 2 + * usb-omap.h - Platform data for the various OMAP USB IPs 3 + * 4 + * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com 5 + * 6 + * This software is distributed under the terms of the GNU General Public 7 + * License ("GPL") version 2, as published by the Free Software Foundation. 8 + * 9 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 10 + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 11 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 12 + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 13 + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 14 + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 15 + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 16 + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 17 + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 18 + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 19 + * POSSIBILITY OF SUCH DAMAGE. 20 + */ 21 + 22 + #define OMAP3_HS_USB_PORTS 3 23 + 24 + enum usbhs_omap_port_mode { 25 + OMAP_USBHS_PORT_MODE_UNUSED, 26 + OMAP_EHCI_PORT_MODE_PHY, 27 + OMAP_EHCI_PORT_MODE_TLL, 28 + OMAP_EHCI_PORT_MODE_HSIC, 29 + OMAP_OHCI_PORT_MODE_PHY_6PIN_DATSE0, 30 + OMAP_OHCI_PORT_MODE_PHY_6PIN_DPDM, 31 + OMAP_OHCI_PORT_MODE_PHY_3PIN_DATSE0, 32 + OMAP_OHCI_PORT_MODE_PHY_4PIN_DPDM, 33 + OMAP_OHCI_PORT_MODE_TLL_6PIN_DATSE0, 34 + OMAP_OHCI_PORT_MODE_TLL_6PIN_DPDM, 35 + OMAP_OHCI_PORT_MODE_TLL_3PIN_DATSE0, 36 + OMAP_OHCI_PORT_MODE_TLL_4PIN_DPDM, 37 + OMAP_OHCI_PORT_MODE_TLL_2PIN_DATSE0, 38 + OMAP_OHCI_PORT_MODE_TLL_2PIN_DPDM 39 + }; 40 + 41 + struct usbtll_omap_platform_data { 42 + enum usbhs_omap_port_mode port_mode[OMAP3_HS_USB_PORTS]; 43 + }; 44 + 45 + struct ehci_hcd_omap_platform_data { 46 + enum usbhs_omap_port_mode port_mode[OMAP3_HS_USB_PORTS]; 47 + int reset_gpio_port[OMAP3_HS_USB_PORTS]; 48 + struct regulator *regulator[OMAP3_HS_USB_PORTS]; 49 + unsigned phy_reset:1; 50 + }; 51 + 52 + struct ohci_hcd_omap_platform_data { 53 + enum usbhs_omap_port_mode port_mode[OMAP3_HS_USB_PORTS]; 54 + unsigned es2_compatibility:1; 55 + }; 56 + 57 + struct usbhs_omap_platform_data { 58 + enum usbhs_omap_port_mode port_mode[OMAP3_HS_USB_PORTS]; 59 + 60 + struct ehci_hcd_omap_platform_data *ehci_data; 61 + struct ohci_hcd_omap_platform_data *ohci_data; 62 + }; 63 + 64 + /*-------------------------------------------------------------------------*/ 65 + 66 + struct omap_musb_board_data { 67 + u8 interface_type; 68 + u8 mode; 69 + u16 power; 70 + unsigned extvbus:1; 71 + void (*set_phy_power)(u8 on); 72 + void (*clear_irq)(void); 73 + void (*set_mode)(u8 mode); 74 + void (*reset)(void); 75 + }; 76 + 77 + enum musb_interface { 78 + MUSB_INTERFACE_ULPI, 79 + MUSB_INTERFACE_UTMI 80 + };
+10 -34
include/linux/tty.h
··· 188 188 }; 189 189 190 190 struct tty_port { 191 + struct tty_bufhead buf; /* Locked internally */ 191 192 struct tty_struct *tty; /* Back pointer */ 193 + struct tty_struct *itty; /* internal back ptr */ 192 194 const struct tty_port_operations *ops; /* Port operations */ 193 195 spinlock_t lock; /* Lock protecting tty field */ 194 196 int blocked_open; /* Waiting to open */ ··· 199 197 wait_queue_head_t close_wait; /* Close waiters */ 200 198 wait_queue_head_t delta_msr_wait; /* Modem status change */ 201 199 unsigned long flags; /* TTY flags ASY_*/ 200 + unsigned long iflags; /* TTYP_ internal flags */ 201 + #define TTYP_FLUSHING 1 /* Flushing to ldisc in progress */ 202 + #define TTYP_FLUSHPENDING 2 /* Queued buffer flush pending */ 202 203 unsigned char console:1; /* port is a console */ 203 204 struct mutex mutex; /* Locking */ 204 205 struct mutex buf_mutex; /* Buffer alloc lock */ ··· 240 235 struct mutex ldisc_mutex; 241 236 struct tty_ldisc *ldisc; 242 237 238 + struct mutex atomic_write_lock; 243 239 struct mutex legacy_mutex; 244 240 struct mutex termios_mutex; 245 241 spinlock_t ctrl_lock; ··· 260 254 261 255 struct tty_struct *link; 262 256 struct fasync_struct *fasync; 263 - struct tty_bufhead buf; /* Locked internally */ 264 257 int alt_speed; /* For magic substitution of 38400 bps */ 265 258 wait_queue_head_t write_wait; 266 259 wait_queue_head_t read_wait; ··· 270 265 271 266 #define N_TTY_BUF_SIZE 4096 272 267 273 - /* 274 - * The following is data for the N_TTY line discipline. For 275 - * historical reasons, this is included in the tty structure. 276 - * Mostly locked by the BKL. 277 - */ 278 - unsigned int column; 279 - unsigned char lnext:1, erasing:1, raw:1, real_raw:1, icanon:1; 280 268 unsigned char closing:1; 281 - unsigned char echo_overrun:1; 282 269 unsigned short minimum_to_wake; 283 - unsigned long overrun_time; 284 - int num_overrun; 285 - unsigned long process_char_map[256/(8*sizeof(unsigned long))]; 286 - char *read_buf; 287 - int read_head; 288 - int read_tail; 289 - int read_cnt; 290 - unsigned long read_flags[N_TTY_BUF_SIZE/(8*sizeof(unsigned long))]; 291 - unsigned char *echo_buf; 292 - unsigned int echo_pos; 293 - unsigned int echo_cnt; 294 - int canon_data; 295 - unsigned long canon_head; 296 - unsigned int canon_column; 297 - struct mutex atomic_read_lock; 298 - struct mutex atomic_write_lock; 299 - struct mutex output_lock; 300 - struct mutex echo_lock; 301 270 unsigned char *write_buf; 302 271 int write_cnt; 303 - spinlock_t read_lock; 304 272 /* If the tty has a pending do_SAK, queue it here - akpm */ 305 273 struct work_struct SAK_work; 306 274 struct tty_port *port; ··· 313 335 #define TTY_PTY_LOCK 16 /* pty private */ 314 336 #define TTY_NO_WRITE_SPLIT 17 /* Preserve write boundaries to driver */ 315 337 #define TTY_HUPPED 18 /* Post driver->hangup() */ 316 - #define TTY_FLUSHING 19 /* Flushing to ldisc in progress */ 317 - #define TTY_FLUSHPENDING 20 /* Queued buffer flush pending */ 318 338 #define TTY_HUPPING 21 /* ->hangup() in progress */ 319 339 320 340 #define TTY_WRITE_FLUSH(tty) tty_write_flush((tty)) ··· 388 412 extern void no_tty(void); 389 413 extern void tty_flip_buffer_push(struct tty_struct *tty); 390 414 extern void tty_flush_to_ldisc(struct tty_struct *tty); 391 - extern void tty_buffer_free_all(struct tty_struct *tty); 415 + extern void tty_buffer_free_all(struct tty_port *port); 392 416 extern void tty_buffer_flush(struct tty_struct *tty); 393 - extern void tty_buffer_init(struct tty_struct *tty); 417 + extern void tty_buffer_init(struct tty_port *port); 394 418 extern speed_t tty_get_baud_rate(struct tty_struct *tty); 395 419 extern speed_t tty_termios_baud_rate(struct ktermios *termios); 396 420 extern speed_t tty_termios_input_baud_rate(struct ktermios *termios); ··· 511 535 /* tty_audit.c */ 512 536 #ifdef CONFIG_AUDIT 513 537 extern void tty_audit_add_data(struct tty_struct *tty, unsigned char *data, 514 - size_t size); 538 + size_t size, unsigned icanon); 515 539 extern void tty_audit_exit(void); 516 540 extern void tty_audit_fork(struct signal_struct *sig); 517 541 extern void tty_audit_tiocsti(struct tty_struct *tty, char ch); ··· 520 544 kuid_t loginuid, u32 sessionid); 521 545 #else 522 546 static inline void tty_audit_add_data(struct tty_struct *tty, 523 - unsigned char *data, size_t size) 547 + unsigned char *data, size_t size, unsigned icanon) 524 548 { 525 549 } 526 550 static inline void tty_audit_tiocsti(struct tty_struct *tty, char ch)
+1 -1
include/linux/tty_flip.h
··· 11 11 static inline int tty_insert_flip_char(struct tty_struct *tty, 12 12 unsigned char ch, char flag) 13 13 { 14 - struct tty_buffer *tb = tty->buf.tail; 14 + struct tty_buffer *tb = tty->port->buf.tail; 15 15 if (tb && tb->used < tb->size) { 16 16 tb->flag_buf_ptr[tb->used] = flag; 17 17 tb->char_buf_ptr[tb->used++] = ch;
+14
include/video/omapdss.h
··· 314 314 int dsi_enable_video_output(struct omap_dss_device *dssdev, int channel); 315 315 void dsi_disable_video_output(struct omap_dss_device *dssdev, int channel); 316 316 317 + enum omapdss_version { 318 + OMAPDSS_VER_UNKNOWN = 0, 319 + OMAPDSS_VER_OMAP24xx, 320 + OMAPDSS_VER_OMAP34xx_ES1, /* OMAP3430 ES1.0, 2.0 */ 321 + OMAPDSS_VER_OMAP34xx_ES3, /* OMAP3430 ES3.0+ */ 322 + OMAPDSS_VER_OMAP3630, 323 + OMAPDSS_VER_AM35xx, 324 + OMAPDSS_VER_OMAP4430_ES1, /* OMAP4430 ES1.0 */ 325 + OMAPDSS_VER_OMAP4430_ES2, /* OMAP4430 ES2.0, 2.1, 2.2 */ 326 + OMAPDSS_VER_OMAP4, /* All other OMAP4s */ 327 + OMAPDSS_VER_OMAP5, 328 + }; 329 + 317 330 /* Board specific data */ 318 331 struct omap_dss_board_info { 319 332 int (*get_context_loss_count)(struct device *dev); ··· 336 323 int (*dsi_enable_pads)(int dsi_id, unsigned lane_mask); 337 324 void (*dsi_disable_pads)(int dsi_id, unsigned lane_mask); 338 325 int (*set_min_bus_tput)(struct device *dev, unsigned long r); 326 + enum omapdss_version version; 339 327 }; 340 328 341 329 /* Init with the board info */
+11 -1
kernel/printk.c
··· 87 87 struct console *console_drivers; 88 88 EXPORT_SYMBOL_GPL(console_drivers); 89 89 90 + #ifdef CONFIG_LOCKDEP 91 + static struct lockdep_map console_lock_dep_map = { 92 + .name = "console_lock" 93 + }; 94 + #endif 95 + 90 96 /* 91 97 * This is used for debugging the mess that is the VT code by 92 98 * keeping track if we have the console semaphore held. It's ··· 1914 1908 */ 1915 1909 void console_lock(void) 1916 1910 { 1917 - BUG_ON(in_interrupt()); 1911 + might_sleep(); 1912 + 1918 1913 down(&console_sem); 1919 1914 if (console_suspended) 1920 1915 return; 1921 1916 console_locked = 1; 1922 1917 console_may_schedule = 1; 1918 + mutex_acquire(&console_lock_dep_map, 0, 0, _RET_IP_); 1923 1919 } 1924 1920 EXPORT_SYMBOL(console_lock); 1925 1921 ··· 1943 1935 } 1944 1936 console_locked = 1; 1945 1937 console_may_schedule = 0; 1938 + mutex_acquire(&console_lock_dep_map, 0, 1, _RET_IP_); 1946 1939 return 1; 1947 1940 } 1948 1941 EXPORT_SYMBOL(console_trylock); ··· 2104 2095 local_irq_restore(flags); 2105 2096 } 2106 2097 console_locked = 0; 2098 + mutex_release(&console_lock_dep_map, 1, _RET_IP_); 2107 2099 2108 2100 /* Release the exclusive_console once it is used */ 2109 2101 if (unlikely(exclusive_console))
-2
sound/soc/omap/am3517evm.c
··· 25 25 #include <sound/soc.h> 26 26 27 27 #include <asm/mach-types.h> 28 - #include <mach/hardware.h> 29 - #include <mach/gpio.h> 30 28 #include <linux/platform_data/asoc-ti-mcbsp.h> 31 29 32 30 #include "omap-mcbsp.h"
-1
sound/soc/omap/n810.c
··· 29 29 #include <sound/soc.h> 30 30 31 31 #include <asm/mach-types.h> 32 - #include <mach/hardware.h> 33 32 #include <linux/gpio.h> 34 33 #include <linux/module.h> 35 34 #include <linux/platform_data/asoc-ti-mcbsp.h>
+7 -2
sound/soc/omap/omap-pcm.c
··· 32 32 #include <sound/dmaengine_pcm.h> 33 33 #include <sound/soc.h> 34 34 35 - #include <plat/cpu.h> 36 35 #include "omap-pcm.h" 36 + 37 + #ifdef CONFIG_ARCH_OMAP1 38 + #define pcm_omap1510() cpu_is_omap1510() 39 + #else 40 + #define pcm_omap1510() 0 41 + #endif 37 42 38 43 static const struct snd_pcm_hardware omap_pcm_hardware = { 39 44 .info = SNDRV_PCM_INFO_MMAP | ··· 164 159 { 165 160 snd_pcm_uframes_t offset; 166 161 167 - if (cpu_is_omap1510()) 162 + if (pcm_omap1510()) 168 163 offset = snd_dmaengine_pcm_pointer_no_residue(substream); 169 164 else 170 165 offset = snd_dmaengine_pcm_pointer(substream);
-1
sound/soc/omap/osk5912.c
··· 28 28 #include <sound/soc.h> 29 29 30 30 #include <asm/mach-types.h> 31 - #include <mach/hardware.h> 32 31 #include <linux/gpio.h> 33 32 #include <linux/module.h> 34 33 #include <linux/platform_data/asoc-ti-mcbsp.h>
-2
sound/soc/omap/sdp3430.c
··· 31 31 #include <sound/jack.h> 32 32 33 33 #include <asm/mach-types.h> 34 - #include <mach/hardware.h> 35 - #include <mach/gpio.h> 36 34 #include <linux/platform_data/gpio-omap.h> 37 35 #include <linux/platform_data/asoc-ti-mcbsp.h> 38 36