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

Merge tag 'cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc

Cleanups on various subarchitectures

Cleanup patches for various ARM platforms and some of their associated
drivers, the bulk of these is for mach-91.

Arnd ended up pulling in the restart branch from Russell in order to
fix up some simple but annoying merge conflicts.

* tag 'cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (44 commits)
arm/at91: fix build of stamp9g20
ARM: u300: delete memory.h
MAINTAINERS: add maintainer entry for Picochip picoxcell
ARM: picoxcell: move io mappings to common.c
ARM: picoxcell: don't reserve irq_descs
ARM: picoxcell: remove mach/memory.h
ARM: at91: delete the pcontrol_g20_defconfig
arm/tegra: Remove code that's ifndef CONFIG_ARM_GIC
arm/tegra: remove unused defines
arm/tegra: fix variable formatting in makefile
ARM: davinci: vpif: move code to driver core header from platform
ARM: at91/gpio: fix display of number of irq setuped
ARM: at91/gpio: drop PIN_BASE
ARM: at91/udc: use gpio_is_valid to check the gpio
ARM: at91/ohci: use gpio_is_valid to check the gpio
ARM: at91/nand: use gpio_is_valid to check the gpio
ARM: at91/mmc: use gpio_is_valid to check the gpio
ARM: at91/ide: use gpio_is_valid to check the gpio
ARM: at91/pata: use gpio_is_valid to check the gpio
ARM: at91/soc: use gpio_is_valid to check the gpio
...

+1640 -1497
+9
MAINTAINERS
··· 5111 5111 S: Maintained 5112 5112 F: drivers/mtd/devices/phram.c 5113 5113 5114 + PICOXCELL SUPPORT 5115 + M: Jamie Iles <jamie@jamieiles.com> 5116 + L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 5117 + T: git git://github.com/jamieiles/linux-2.6-ji.git 5118 + S: Supported 5119 + F: arch/arm/mach-picoxcell 5120 + F: drivers/*/picoxcell* 5121 + F: drivers/*/*/picoxcell* 5122 + 5114 5123 PIN CONTROL SUBSYSTEM 5115 5124 M: Linus Walleij <linus.walleij@linaro.org> 5116 5125 S: Maintained
+1 -1
arch/arm/Kconfig
··· 658 658 select HAVE_SCHED_CLOCK 659 659 select HAVE_TCM 660 660 select NO_IOPORT 661 + select SPARSE_IRQ 661 662 select USE_OF 662 663 help 663 664 This enables support for systems based on the Picochip picoXcell ··· 893 892 select HAVE_MACH_CLKDEV 894 893 select GENERIC_GPIO 895 894 select ARCH_REQUIRE_GPIOLIB 896 - select NEED_MACH_MEMORY_H 897 895 help 898 896 Support for ST-Ericsson U300 series mobile platforms. 899 897
+45
arch/arm/Kconfig.debug
··· 100 100 Note that the system will appear to hang during boot if there 101 101 is nothing connected to read from the DCC. 102 102 103 + config AT91_DEBUG_LL_DBGU0 104 + bool "Kernel low-level debugging on rm9200, 9260/9g20, 9261/9g10 and 9rl" 105 + depends on HAVE_AT91_DBGU0 106 + 107 + config AT91_DEBUG_LL_DBGU1 108 + bool "Kernel low-level debugging on 9263, 9g45 and cap9" 109 + depends on HAVE_AT91_DBGU1 110 + 103 111 config DEBUG_FOOTBRIDGE_COM1 104 112 bool "Kernel low-level debugging messages via footbridge 8250 at PCI COM1" 105 113 depends on FOOTBRIDGE ··· 254 246 Say Y here if you want the debug print routines to direct 255 247 their output to the standard serial port on the RealView 256 248 PB1176 platform. 249 + 250 + config DEBUG_MSM_UART1 251 + bool "Kernel low-level debugging messages via MSM UART1" 252 + depends on ARCH_MSM7X00A || ARCH_MSM7X30 || ARCH_QSD8X50 253 + help 254 + Say Y here if you want the debug print routines to direct 255 + their output to the first serial port on MSM devices. 256 + 257 + config DEBUG_MSM_UART2 258 + bool "Kernel low-level debugging messages via MSM UART2" 259 + depends on ARCH_MSM7X00A || ARCH_MSM7X30 || ARCH_QSD8X50 260 + help 261 + Say Y here if you want the debug print routines to direct 262 + their output to the second serial port on MSM devices. 263 + 264 + config DEBUG_MSM_UART3 265 + bool "Kernel low-level debugging messages via MSM UART3" 266 + depends on ARCH_MSM7X00A || ARCH_MSM7X30 || ARCH_QSD8X50 267 + help 268 + Say Y here if you want the debug print routines to direct 269 + their output to the third serial port on MSM devices. 270 + 271 + config DEBUG_MSM8660_UART 272 + bool "Kernel low-level debugging messages via MSM 8660 UART" 273 + depends on ARCH_MSM8X60 274 + select MSM_HAS_DEBUG_UART_HS 275 + help 276 + Say Y here if you want the debug print routines to direct 277 + their output to the serial port on MSM 8660 devices. 278 + 279 + config DEBUG_MSM8960_UART 280 + bool "Kernel low-level debugging messages via MSM 8960 UART" 281 + depends on ARCH_MSM8960 282 + select MSM_HAS_DEBUG_UART_HS 283 + help 284 + Say Y here if you want the debug print routines to direct 285 + their output to the serial port on MSM 8960 devices. 257 286 258 287 endchoice 259 288
-175
arch/arm/configs/pcontrol_g20_defconfig
··· 1 - CONFIG_EXPERIMENTAL=y 2 - CONFIG_CROSS_COMPILE="/opt/arm-2010q1/bin/arm-none-linux-gnueabi-" 3 - # CONFIG_LOCALVERSION_AUTO is not set 4 - # CONFIG_SWAP is not set 5 - CONFIG_SYSVIPC=y 6 - CONFIG_POSIX_MQUEUE=y 7 - CONFIG_TREE_PREEMPT_RCU=y 8 - CONFIG_IKCONFIG=y 9 - CONFIG_IKCONFIG_PROC=y 10 - CONFIG_LOG_BUF_SHIFT=14 11 - CONFIG_NAMESPACES=y 12 - CONFIG_BLK_DEV_INITRD=y 13 - CONFIG_EXPERT=y 14 - # CONFIG_SYSCTL_SYSCALL is not set 15 - # CONFIG_KALLSYMS is not set 16 - # CONFIG_VM_EVENT_COUNTERS is not set 17 - # CONFIG_COMPAT_BRK is not set 18 - CONFIG_SLAB=y 19 - CONFIG_MODULES=y 20 - CONFIG_MODULE_UNLOAD=y 21 - # CONFIG_LBDAF is not set 22 - # CONFIG_BLK_DEV_BSG is not set 23 - CONFIG_DEFAULT_DEADLINE=y 24 - CONFIG_ARCH_AT91=y 25 - CONFIG_ARCH_AT91SAM9G20=y 26 - CONFIG_MACH_PCONTROL_G20=y 27 - CONFIG_AT91_PROGRAMMABLE_CLOCKS=y 28 - CONFIG_NO_HZ=y 29 - CONFIG_HIGH_RES_TIMERS=y 30 - CONFIG_PREEMPT=y 31 - CONFIG_AEABI=y 32 - # CONFIG_OABI_COMPAT is not set 33 - CONFIG_ZBOOT_ROM_TEXT=0x0 34 - CONFIG_ZBOOT_ROM_BSS=0x0 35 - CONFIG_CMDLINE="console=ttyS0,115200 mem=128M mtdparts=atmel_nand:128k(bootstrap)ro,256k(uboot)ro,128k(env1)ro,128k(env2)ro,2M(linux),-(root) root=/dev/mmcblk0p1 rootwait rw" 36 - CONFIG_VFP=y 37 - CONFIG_BINFMT_MISC=y 38 - CONFIG_NET=y 39 - CONFIG_PACKET=y 40 - CONFIG_UNIX=y 41 - CONFIG_INET=y 42 - # CONFIG_INET_XFRM_MODE_TRANSPORT is not set 43 - # CONFIG_INET_XFRM_MODE_TUNNEL is not set 44 - # CONFIG_INET_XFRM_MODE_BEET is not set 45 - # CONFIG_INET_LRO is not set 46 - # CONFIG_IPV6 is not set 47 - CONFIG_VLAN_8021Q=y 48 - # CONFIG_WIRELESS is not set 49 - CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 50 - # CONFIG_FW_LOADER is not set 51 - CONFIG_MTD=y 52 - CONFIG_MTD_PARTITIONS=y 53 - CONFIG_MTD_CMDLINE_PARTS=y 54 - CONFIG_MTD_CHAR=y 55 - CONFIG_MTD_BLOCK=y 56 - CONFIG_MTD_COMPLEX_MAPPINGS=y 57 - CONFIG_MTD_PHRAM=m 58 - CONFIG_MTD_NAND=y 59 - CONFIG_MTD_NAND_ATMEL=y 60 - CONFIG_BLK_DEV_LOOP=y 61 - CONFIG_BLK_DEV_RAM=y 62 - CONFIG_BLK_DEV_RAM_SIZE=8192 63 - CONFIG_ATMEL_TCLIB=y 64 - CONFIG_EEPROM_AT24=m 65 - CONFIG_SCSI=m 66 - # CONFIG_SCSI_PROC_FS is not set 67 - CONFIG_BLK_DEV_SD=m 68 - CONFIG_SCSI_MULTI_LUN=y 69 - # CONFIG_SCSI_LOWLEVEL is not set 70 - CONFIG_NETDEVICES=y 71 - CONFIG_MACVLAN=m 72 - CONFIG_TUN=m 73 - CONFIG_SMSC_PHY=m 74 - CONFIG_BROADCOM_PHY=m 75 - CONFIG_NET_ETHERNET=y 76 - CONFIG_MII=y 77 - CONFIG_MACB=y 78 - CONFIG_SMSC911X=m 79 - # CONFIG_NETDEV_1000 is not set 80 - # CONFIG_NETDEV_10000 is not set 81 - # CONFIG_WLAN is not set 82 - CONFIG_PPP=m 83 - CONFIG_PPP_ASYNC=m 84 - CONFIG_PPP_DEFLATE=m 85 - CONFIG_PPP_MPPE=m 86 - CONFIG_INPUT_POLLDEV=y 87 - CONFIG_INPUT_SPARSEKMAP=y 88 - # CONFIG_INPUT_MOUSEDEV is not set 89 - CONFIG_INPUT_EVDEV=m 90 - CONFIG_INPUT_EVBUG=m 91 - # CONFIG_KEYBOARD_ATKBD is not set 92 - CONFIG_KEYBOARD_GPIO=m 93 - CONFIG_KEYBOARD_MATRIX=m 94 - # CONFIG_INPUT_MOUSE is not set 95 - CONFIG_INPUT_TOUCHSCREEN=y 96 - CONFIG_INPUT_MISC=y 97 - CONFIG_INPUT_UINPUT=m 98 - CONFIG_INPUT_GPIO_ROTARY_ENCODER=m 99 - # CONFIG_SERIO is not set 100 - # CONFIG_DEVKMEM is not set 101 - CONFIG_SERIAL_ATMEL=y 102 - CONFIG_SERIAL_ATMEL_CONSOLE=y 103 - CONFIG_SERIAL_MAX3100=m 104 - # CONFIG_LEGACY_PTYS is not set 105 - # CONFIG_HW_RANDOM is not set 106 - CONFIG_R3964=m 107 - CONFIG_I2C=m 108 - CONFIG_I2C_CHARDEV=m 109 - # CONFIG_I2C_HELPER_AUTO is not set 110 - CONFIG_I2C_GPIO=m 111 - CONFIG_SPI=y 112 - CONFIG_SPI_ATMEL=m 113 - CONFIG_SPI_SPIDEV=m 114 - CONFIG_GPIO_SYSFS=y 115 - CONFIG_W1=m 116 - CONFIG_W1_MASTER_GPIO=m 117 - CONFIG_W1_SLAVE_DS2431=m 118 - # CONFIG_HWMON is not set 119 - CONFIG_WATCHDOG=y 120 - CONFIG_AT91SAM9X_WATCHDOG=y 121 - # CONFIG_MFD_SUPPORT is not set 122 - # CONFIG_HID_SUPPORT is not set 123 - CONFIG_USB=y 124 - # CONFIG_USB_DEVICE_CLASS is not set 125 - CONFIG_USB_OHCI_HCD=y 126 - CONFIG_USB_STORAGE=m 127 - CONFIG_USB_LIBUSUAL=y 128 - CONFIG_USB_SERIAL=m 129 - CONFIG_USB_SERIAL_GENERIC=y 130 - CONFIG_USB_SERIAL_FTDI_SIO=m 131 - CONFIG_USB_SERIAL_PL2303=m 132 - CONFIG_USB_GADGET=y 133 - CONFIG_USB_ZERO=m 134 - CONFIG_USB_ETH=m 135 - CONFIG_USB_FILE_STORAGE=m 136 - CONFIG_USB_G_SERIAL=m 137 - CONFIG_USB_G_HID=m 138 - CONFIG_MMC=y 139 - CONFIG_MMC_UNSAFE_RESUME=y 140 - CONFIG_MMC_ATMELMCI=y 141 - CONFIG_NEW_LEDS=y 142 - CONFIG_LEDS_CLASS=y 143 - CONFIG_LEDS_GPIO=y 144 - CONFIG_LEDS_TRIGGERS=y 145 - CONFIG_LEDS_TRIGGER_TIMER=y 146 - CONFIG_LEDS_TRIGGER_HEARTBEAT=y 147 - CONFIG_LEDS_TRIGGER_DEFAULT_ON=y 148 - CONFIG_RTC_CLASS=y 149 - CONFIG_RTC_DRV_AT91SAM9=y 150 - CONFIG_AUXDISPLAY=y 151 - CONFIG_UIO=y 152 - CONFIG_UIO_PDRV=y 153 - CONFIG_STAGING=y 154 - # CONFIG_STAGING_EXCLUDE_BUILD is not set 155 - CONFIG_IIO=y 156 - CONFIG_EXT2_FS=y 157 - CONFIG_EXT3_FS=y 158 - # CONFIG_EXT3_FS_XATTR is not set 159 - CONFIG_VFAT_FS=y 160 - CONFIG_TMPFS=y 161 - CONFIG_JFFS2_FS=y 162 - CONFIG_NFS_FS=y 163 - CONFIG_NFS_V3=y 164 - CONFIG_NFS_V4=y 165 - CONFIG_PARTITION_ADVANCED=y 166 - CONFIG_NLS_CODEPAGE_437=y 167 - CONFIG_NLS_CODEPAGE_850=y 168 - CONFIG_NLS_ISO8859_1=y 169 - CONFIG_NLS_ISO8859_15=y 170 - CONFIG_NLS_UTF8=y 171 - # CONFIG_RCU_CPU_STALL_DETECTOR is not set 172 - CONFIG_CRYPTO=y 173 - CONFIG_CRYPTO_ANSI_CPRNG=y 174 - # CONFIG_CRYPTO_HW is not set 175 - CONFIG_CRC_CCITT=y
+22 -2
arch/arm/mach-at91/Kconfig
··· 3 3 config HAVE_AT91_DATAFLASH_CARD 4 4 bool 5 5 6 + config HAVE_AT91_DBGU0 7 + bool 8 + 9 + config HAVE_AT91_DBGU1 10 + bool 11 + 6 12 config HAVE_AT91_USART3 7 13 bool 8 14 ··· 27 21 bool "AT91RM9200" 28 22 select CPU_ARM920T 29 23 select GENERIC_CLOCKEVENTS 24 + select HAVE_AT91_DBGU0 30 25 select HAVE_AT91_USART3 31 26 32 27 config ARCH_AT91SAM9260 33 28 bool "AT91SAM9260 or AT91SAM9XE" 34 29 select CPU_ARM926T 35 30 select GENERIC_CLOCKEVENTS 31 + select HAVE_AT91_DBGU0 36 32 select HAVE_AT91_USART3 37 33 select HAVE_AT91_USART4 38 34 select HAVE_AT91_USART5 ··· 45 37 select CPU_ARM926T 46 38 select GENERIC_CLOCKEVENTS 47 39 select HAVE_FB_ATMEL 40 + select HAVE_AT91_DBGU0 48 41 49 42 config ARCH_AT91SAM9G10 50 43 bool "AT91SAM9G10" 51 44 select CPU_ARM926T 52 45 select GENERIC_CLOCKEVENTS 46 + select HAVE_AT91_DBGU0 53 47 select HAVE_FB_ATMEL 54 48 55 49 config ARCH_AT91SAM9263 ··· 60 50 select GENERIC_CLOCKEVENTS 61 51 select HAVE_FB_ATMEL 62 52 select HAVE_NET_MACB 53 + select HAVE_AT91_DBGU1 63 54 64 55 config ARCH_AT91SAM9RL 65 56 bool "AT91SAM9RL" ··· 68 57 select GENERIC_CLOCKEVENTS 69 58 select HAVE_AT91_USART3 70 59 select HAVE_FB_ATMEL 60 + select HAVE_AT91_DBGU0 71 61 72 62 config ARCH_AT91SAM9G20 73 63 bool "AT91SAM9G20" 74 64 select CPU_ARM926T 75 65 select GENERIC_CLOCKEVENTS 66 + select HAVE_AT91_DBGU0 76 67 select HAVE_AT91_USART3 77 68 select HAVE_AT91_USART4 78 69 select HAVE_AT91_USART5 ··· 87 74 select HAVE_AT91_USART3 88 75 select HAVE_FB_ATMEL 89 76 select HAVE_NET_MACB 77 + select HAVE_AT91_DBGU1 90 78 91 79 config ARCH_AT91CAP9 92 80 bool "AT91CAP9" ··· 95 81 select GENERIC_CLOCKEVENTS 96 82 select HAVE_FB_ATMEL 97 83 select HAVE_NET_MACB 84 + select HAVE_AT91_DBGU1 98 85 99 86 config ARCH_AT91X40 100 87 bool "AT91x40" ··· 525 510 choice 526 511 prompt "Select a UART for early kernel messages" 527 512 528 - config AT91_EARLY_DBGU 529 - bool "DBGU" 513 + config AT91_EARLY_DBGU0 514 + bool "DBGU on rm9200, 9260/9g20, 9261/9g10 and 9rl" 515 + depends on HAVE_AT91_DBGU0 516 + 517 + config AT91_EARLY_DBGU1 518 + bool "DBGU on 9263, 9g45 and cap9" 519 + depends on HAVE_AT91_DBGU1 530 520 531 521 config AT91_EARLY_USART0 532 522 bool "USART0"
+21 -19
arch/arm/mach-at91/at91cap9.c
··· 13 13 */ 14 14 15 15 #include <linux/module.h> 16 - #include <linux/pm.h> 17 16 18 17 #include <asm/irq.h> 19 18 #include <asm/mach/arch.h> ··· 22 23 #include <mach/at91cap9.h> 23 24 #include <mach/at91_pmc.h> 24 25 #include <mach/at91_rstc.h> 25 - #include <mach/at91_shdwc.h> 26 26 27 27 #include "soc.h" 28 28 #include "generic.h" 29 29 #include "clock.h" 30 + #include "sam9_smc.h" 30 31 31 32 /* -------------------------------------------------------------------- 32 33 * Clocks ··· 136 137 .type = CLK_TYPE_PERIPHERAL, 137 138 }; 138 139 static struct clk macb_clk = { 139 - .name = "macb_clk", 140 + .name = "pclk", 140 141 .pmc_mask = 1 << AT91CAP9_ID_EMAC, 141 142 .type = CLK_TYPE_PERIPHERAL, 142 143 }; ··· 209 210 }; 210 211 211 212 static struct clk_lookup periph_clocks_lookups[] = { 213 + /* One additional fake clock for macb_hclk */ 214 + CLKDEV_CON_ID("hclk", &macb_clk), 212 215 CLKDEV_CON_DEV_ID("hclk", "atmel_usba_udc", &utmi_clk), 213 216 CLKDEV_CON_DEV_ID("pclk", "atmel_usba_udc", &udphs_clk), 214 217 CLKDEV_CON_DEV_ID("mci_clk", "at91_mci.0", &mmc0_clk), ··· 222 221 CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), 223 222 /* fake hclk clock */ 224 223 CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk), 224 + CLKDEV_CON_ID("pioA", &pioABCD_clk), 225 + CLKDEV_CON_ID("pioB", &pioABCD_clk), 226 + CLKDEV_CON_ID("pioC", &pioABCD_clk), 227 + CLKDEV_CON_ID("pioD", &pioABCD_clk), 225 228 }; 226 229 227 230 static struct clk_lookup usart_clocks_lookups[] = { ··· 298 293 * GPIO 299 294 * -------------------------------------------------------------------- */ 300 295 301 - static struct at91_gpio_bank at91cap9_gpio[] = { 296 + static struct at91_gpio_bank at91cap9_gpio[] __initdata = { 302 297 { 303 298 .id = AT91CAP9_ID_PIOABCD, 304 - .offset = AT91_PIOA, 305 - .clock = &pioABCD_clk, 299 + .regbase = AT91CAP9_BASE_PIOA, 306 300 }, { 307 301 .id = AT91CAP9_ID_PIOABCD, 308 - .offset = AT91_PIOB, 309 - .clock = &pioABCD_clk, 302 + .regbase = AT91CAP9_BASE_PIOB, 310 303 }, { 311 304 .id = AT91CAP9_ID_PIOABCD, 312 - .offset = AT91_PIOC, 313 - .clock = &pioABCD_clk, 305 + .regbase = AT91CAP9_BASE_PIOC, 314 306 }, { 315 307 .id = AT91CAP9_ID_PIOABCD, 316 - .offset = AT91_PIOD, 317 - .clock = &pioABCD_clk, 308 + .regbase = AT91CAP9_BASE_PIOD, 318 309 } 319 310 }; 320 311 ··· 318 317 { 319 318 at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST); 320 319 } 321 - 322 - static void at91cap9_poweroff(void) 323 - { 324 - at91_sys_write(AT91_SHDW_CR, AT91_SHDW_KEY | AT91_SHDW_SHDW); 325 - } 326 - 327 320 328 321 /* -------------------------------------------------------------------- 329 322 * AT91CAP9 processor initialization ··· 328 333 at91_init_sram(0, AT91CAP9_SRAM_BASE, AT91CAP9_SRAM_SIZE); 329 334 } 330 335 336 + static void __init at91cap9_ioremap_registers(void) 337 + { 338 + at91_ioremap_shdwc(AT91CAP9_BASE_SHDWC); 339 + at91sam926x_ioremap_pit(AT91CAP9_BASE_PIT); 340 + at91sam9_ioremap_smc(0, AT91CAP9_BASE_SMC); 341 + } 342 + 331 343 static void __init at91cap9_initialize(void) 332 344 { 333 345 arm_pm_restart = at91cap9_restart; 334 - pm_power_off = at91cap9_poweroff; 335 346 at91_extern_irq = (1 << AT91CAP9_ID_IRQ0) | (1 << AT91CAP9_ID_IRQ1); 336 347 337 348 /* Register GPIO subsystem */ ··· 395 394 struct at91_init_soc __initdata at91cap9_soc = { 396 395 .map_io = at91cap9_map_io, 397 396 .default_irq_priority = at91cap9_default_irq_priority, 397 + .ioremap_registers = at91cap9_ioremap_registers, 398 398 .register_clocks = at91cap9_register_clocks, 399 399 .init = at91cap9_initialize, 400 400 };
+29 -20
arch/arm/mach-at91/at91cap9_devices.c
··· 76 76 77 77 /* Enable VBus control for UHP ports */ 78 78 for (i = 0; i < data->ports; i++) { 79 - if (data->vbus_pin[i]) 79 + if (gpio_is_valid(data->vbus_pin[i])) 80 80 at91_set_gpio_output(data->vbus_pin[i], 0); 81 81 } 82 82 ··· 179 179 usba_udc_data.pdata.num_ep = ARRAY_SIZE(usba_udc_ep); 180 180 memcpy(usba_udc_data.ep, usba_udc_ep, sizeof(usba_udc_ep)); 181 181 182 - if (data && data->vbus_pin > 0) { 182 + if (data && gpio_is_valid(data->vbus_pin)) { 183 183 at91_set_gpio_input(data->vbus_pin, 0); 184 184 at91_set_deglitch(data->vbus_pin, 1); 185 185 usba_udc_data.pdata.vbus_pin = data->vbus_pin; ··· 200 200 201 201 #if defined(CONFIG_MACB) || defined(CONFIG_MACB_MODULE) 202 202 static u64 eth_dmamask = DMA_BIT_MASK(32); 203 - static struct at91_eth_data eth_data; 203 + static struct macb_platform_data eth_data; 204 204 205 205 static struct resource eth_resources[] = { 206 206 [0] = { ··· 227 227 .num_resources = ARRAY_SIZE(eth_resources), 228 228 }; 229 229 230 - void __init at91_add_device_eth(struct at91_eth_data *data) 230 + void __init at91_add_device_eth(struct macb_platform_data *data) 231 231 { 232 232 if (!data) 233 233 return; 234 234 235 - if (data->phy_irq_pin) { 235 + if (gpio_is_valid(data->phy_irq_pin)) { 236 236 at91_set_gpio_input(data->phy_irq_pin, 0); 237 237 at91_set_deglitch(data->phy_irq_pin, 1); 238 238 } ··· 264 264 platform_device_register(&at91cap9_eth_device); 265 265 } 266 266 #else 267 - void __init at91_add_device_eth(struct at91_eth_data *data) {} 267 + void __init at91_add_device_eth(struct macb_platform_data *data) {} 268 268 #endif 269 269 270 270 ··· 332 332 return; 333 333 334 334 /* input/irq */ 335 - if (data->det_pin) { 335 + if (gpio_is_valid(data->det_pin)) { 336 336 at91_set_gpio_input(data->det_pin, 1); 337 337 at91_set_deglitch(data->det_pin, 1); 338 338 } 339 - if (data->wp_pin) 339 + if (gpio_is_valid(data->wp_pin)) 340 340 at91_set_gpio_input(data->wp_pin, 1); 341 - if (data->vcc_pin) 341 + if (gpio_is_valid(data->vcc_pin)) 342 342 at91_set_gpio_output(data->vcc_pin, 0); 343 343 344 344 if (mmc_id == 0) { /* MCI0 */ ··· 398 398 .flags = IORESOURCE_MEM, 399 399 }, 400 400 [1] = { 401 - .start = AT91_BASE_SYS + AT91_ECC, 402 - .end = AT91_BASE_SYS + AT91_ECC + SZ_512 - 1, 401 + .start = AT91CAP9_BASE_ECC, 402 + .end = AT91CAP9_BASE_ECC + SZ_512 - 1, 403 403 .flags = IORESOURCE_MEM, 404 404 } 405 405 }; ··· 425 425 at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_EBI_CS3A_SMC_SMARTMEDIA); 426 426 427 427 /* enable pin */ 428 - if (data->enable_pin) 428 + if (gpio_is_valid(data->enable_pin)) 429 429 at91_set_gpio_output(data->enable_pin, 1); 430 430 431 431 /* ready/busy pin */ 432 - if (data->rdy_pin) 432 + if (gpio_is_valid(data->rdy_pin)) 433 433 at91_set_gpio_input(data->rdy_pin, 1); 434 434 435 435 /* card detect pin */ 436 - if (data->det_pin) 436 + if (gpio_is_valid(data->det_pin)) 437 437 at91_set_gpio_input(data->det_pin, 1); 438 438 439 439 nand_data = *data; ··· 670 670 671 671 static struct resource rtt_resources[] = { 672 672 { 673 - .start = AT91_BASE_SYS + AT91_RTT, 674 - .end = AT91_BASE_SYS + AT91_RTT + SZ_16 - 1, 673 + .start = AT91CAP9_BASE_RTT, 674 + .end = AT91CAP9_BASE_RTT + SZ_16 - 1, 675 675 .flags = IORESOURCE_MEM, 676 676 } 677 677 }; ··· 694 694 * -------------------------------------------------------------------- */ 695 695 696 696 #if defined(CONFIG_AT91SAM9X_WATCHDOG) || defined(CONFIG_AT91SAM9X_WATCHDOG_MODULE) 697 + static struct resource wdt_resources[] = { 698 + { 699 + .start = AT91CAP9_BASE_WDT, 700 + .end = AT91CAP9_BASE_WDT + SZ_16 - 1, 701 + .flags = IORESOURCE_MEM, 702 + } 703 + }; 704 + 697 705 static struct platform_device at91cap9_wdt_device = { 698 706 .name = "at91_wdt", 699 707 .id = -1, 700 - .num_resources = 0, 708 + .resource = wdt_resources, 709 + .num_resources = ARRAY_SIZE(wdt_resources), 701 710 }; 702 711 703 712 static void __init at91_add_device_watchdog(void) ··· 816 807 at91_set_A_periph(AT91_PIN_PA9, 0); /* AC97RX */ 817 808 818 809 /* reset */ 819 - if (data->reset_pin) 810 + if (gpio_is_valid(data->reset_pin)) 820 811 at91_set_gpio_output(data->reset_pin, 0); 821 812 822 813 ac97_data = *data; ··· 1030 1021 #if defined(CONFIG_SERIAL_ATMEL) 1031 1022 static struct resource dbgu_resources[] = { 1032 1023 [0] = { 1033 - .start = AT91_BASE_SYS + AT91_DBGU, 1034 - .end = AT91_BASE_SYS + AT91_DBGU + SZ_512 - 1, 1024 + .start = AT91CAP9_BASE_DBGU, 1025 + .end = AT91CAP9_BASE_DBGU + SZ_512 - 1, 1035 1026 .flags = IORESOURCE_MEM, 1036 1027 }, 1037 1028 [1] = {
+15 -9
arch/arm/mach-at91/at91rm9200.c
··· 23 23 #include "soc.h" 24 24 #include "generic.h" 25 25 #include "clock.h" 26 + #include "sam9_smc.h" 26 27 27 28 static struct map_desc at91rm9200_io_desc[] __initdata = { 28 29 { ··· 196 195 CLKDEV_CON_DEV_ID("pclk", "ssc.2", &ssc2_clk), 197 196 /* fake hclk clock */ 198 197 CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk), 198 + CLKDEV_CON_ID("pioA", &pioA_clk), 199 + CLKDEV_CON_ID("pioB", &pioB_clk), 200 + CLKDEV_CON_ID("pioC", &pioC_clk), 201 + CLKDEV_CON_ID("pioD", &pioD_clk), 199 202 }; 200 203 201 204 static struct clk_lookup usart_clocks_lookups[] = { ··· 273 268 * GPIO 274 269 * -------------------------------------------------------------------- */ 275 270 276 - static struct at91_gpio_bank at91rm9200_gpio[] = { 271 + static struct at91_gpio_bank at91rm9200_gpio[] __initdata = { 277 272 { 278 273 .id = AT91RM9200_ID_PIOA, 279 - .offset = AT91_PIOA, 280 - .clock = &pioA_clk, 274 + .regbase = AT91RM9200_BASE_PIOA, 281 275 }, { 282 276 .id = AT91RM9200_ID_PIOB, 283 - .offset = AT91_PIOB, 284 - .clock = &pioB_clk, 277 + .regbase = AT91RM9200_BASE_PIOB, 285 278 }, { 286 279 .id = AT91RM9200_ID_PIOC, 287 - .offset = AT91_PIOC, 288 - .clock = &pioC_clk, 280 + .regbase = AT91RM9200_BASE_PIOC, 289 281 }, { 290 282 .id = AT91RM9200_ID_PIOD, 291 - .offset = AT91_PIOD, 292 - .clock = &pioD_clk, 283 + .regbase = AT91RM9200_BASE_PIOD, 293 284 } 294 285 }; 295 286 ··· 306 305 /* Map peripherals */ 307 306 at91_init_sram(0, AT91RM9200_SRAM_BASE, AT91RM9200_SRAM_SIZE); 308 307 iotable_init(at91rm9200_io_desc, ARRAY_SIZE(at91rm9200_io_desc)); 308 + } 309 + 310 + static void __init at91rm9200_ioremap_registers(void) 311 + { 309 312 } 310 313 311 314 static void __init at91rm9200_initialize(void) ··· 371 366 struct at91_init_soc __initdata at91rm9200_soc = { 372 367 .map_io = at91rm9200_map_io, 373 368 .default_irq_priority = at91rm9200_default_irq_priority, 369 + .ioremap_registers = at91rm9200_ioremap_registers, 374 370 .register_clocks = at91rm9200_register_clocks, 375 371 .init = at91rm9200_initialize, 376 372 };
+31 -17
arch/arm/mach-at91/at91rm9200_devices.c
··· 114 114 if (!data) 115 115 return; 116 116 117 - if (data->vbus_pin) { 117 + if (gpio_is_valid(data->vbus_pin)) { 118 118 at91_set_gpio_input(data->vbus_pin, 0); 119 119 at91_set_deglitch(data->vbus_pin, 1); 120 120 } 121 - if (data->pullup_pin) 121 + if (gpio_is_valid(data->pullup_pin)) 122 122 at91_set_gpio_output(data->pullup_pin, 0); 123 123 124 124 udc_data = *data; ··· 135 135 136 136 #if defined(CONFIG_ARM_AT91_ETHER) || defined(CONFIG_ARM_AT91_ETHER_MODULE) 137 137 static u64 eth_dmamask = DMA_BIT_MASK(32); 138 - static struct at91_eth_data eth_data; 138 + static struct macb_platform_data eth_data; 139 139 140 140 static struct resource eth_resources[] = { 141 141 [0] = { ··· 162 162 .num_resources = ARRAY_SIZE(eth_resources), 163 163 }; 164 164 165 - void __init at91_add_device_eth(struct at91_eth_data *data) 165 + void __init at91_add_device_eth(struct macb_platform_data *data) 166 166 { 167 167 if (!data) 168 168 return; 169 169 170 - if (data->phy_irq_pin) { 170 + if (gpio_is_valid(data->phy_irq_pin)) { 171 171 at91_set_gpio_input(data->phy_irq_pin, 0); 172 172 at91_set_deglitch(data->phy_irq_pin, 1); 173 173 } ··· 199 199 platform_device_register(&at91rm9200_eth_device); 200 200 } 201 201 #else 202 - void __init at91_add_device_eth(struct at91_eth_data *data) {} 202 + void __init at91_add_device_eth(struct macb_platform_data *data) {} 203 203 #endif 204 204 205 205 ··· 260 260 ); 261 261 262 262 /* input/irq */ 263 - if (data->irq_pin) { 263 + if (gpio_is_valid(data->irq_pin)) { 264 264 at91_set_gpio_input(data->irq_pin, 1); 265 265 at91_set_deglitch(data->irq_pin, 1); 266 266 } ··· 268 268 at91_set_deglitch(data->det_pin, 1); 269 269 270 270 /* outputs, initially off */ 271 - if (data->vcc_pin) 271 + if (gpio_is_valid(data->vcc_pin)) 272 272 at91_set_gpio_output(data->vcc_pin, 0); 273 273 at91_set_gpio_output(data->rst_pin, 0); 274 274 ··· 328 328 return; 329 329 330 330 /* input/irq */ 331 - if (data->det_pin) { 331 + if (gpio_is_valid(data->det_pin)) { 332 332 at91_set_gpio_input(data->det_pin, 1); 333 333 at91_set_deglitch(data->det_pin, 1); 334 334 } 335 - if (data->wp_pin) 335 + if (gpio_is_valid(data->wp_pin)) 336 336 at91_set_gpio_input(data->wp_pin, 1); 337 - if (data->vcc_pin) 337 + if (gpio_is_valid(data->vcc_pin)) 338 338 at91_set_gpio_output(data->vcc_pin, 0); 339 339 340 340 /* CLK */ ··· 419 419 ); 420 420 421 421 /* enable pin */ 422 - if (data->enable_pin) 422 + if (gpio_is_valid(data->enable_pin)) 423 423 at91_set_gpio_output(data->enable_pin, 1); 424 424 425 425 /* ready/busy pin */ 426 - if (data->rdy_pin) 426 + if (gpio_is_valid(data->rdy_pin)) 427 427 at91_set_gpio_input(data->rdy_pin, 1); 428 428 429 429 /* card detect pin */ 430 - if (data->det_pin) 430 + if (gpio_is_valid(data->det_pin)) 431 431 at91_set_gpio_input(data->det_pin, 1); 432 432 433 433 at91_set_A_periph(AT91_PIN_PC1, 0); /* SMOE */ ··· 665 665 * -------------------------------------------------------------------- */ 666 666 667 667 #if defined(CONFIG_RTC_DRV_AT91RM9200) || defined(CONFIG_RTC_DRV_AT91RM9200_MODULE) 668 + static struct resource rtc_resources[] = { 669 + [0] = { 670 + .start = AT91RM9200_BASE_RTC, 671 + .end = AT91RM9200_BASE_RTC + SZ_256 - 1, 672 + .flags = IORESOURCE_MEM, 673 + }, 674 + [1] = { 675 + .start = AT91_ID_SYS, 676 + .end = AT91_ID_SYS, 677 + .flags = IORESOURCE_IRQ, 678 + }, 679 + }; 680 + 668 681 static struct platform_device at91rm9200_rtc_device = { 669 682 .name = "at91_rtc", 670 683 .id = -1, 671 - .num_resources = 0, 684 + .resource = rtc_resources, 685 + .num_resources = ARRAY_SIZE(rtc_resources), 672 686 }; 673 687 674 688 static void __init at91_add_device_rtc(void) ··· 891 877 #if defined(CONFIG_SERIAL_ATMEL) 892 878 static struct resource dbgu_resources[] = { 893 879 [0] = { 894 - .start = AT91_BASE_SYS + AT91_DBGU, 895 - .end = AT91_BASE_SYS + AT91_DBGU + SZ_512 - 1, 880 + .start = AT91RM9200_BASE_DBGU, 881 + .end = AT91RM9200_BASE_DBGU + SZ_512 - 1, 896 882 .flags = IORESOURCE_MEM, 897 883 }, 898 884 [1] = {
+5 -3
arch/arm/mach-at91/at91rm9200_time.c
··· 32 32 static u32 irqmask; 33 33 static struct clock_event_device clkevt; 34 34 35 + #define RM9200_TIMER_LATCH ((AT91_SLOW_CLOCK + HZ/2) / HZ) 36 + 35 37 /* 36 38 * The ST_CRTR is updated asynchronously to the master clock ... but 37 39 * the updates as seen by the CPU don't seem to be strictly monotonic. ··· 76 74 if (sr & AT91_ST_PITS) { 77 75 u32 crtr = read_CRTR(); 78 76 79 - while (((crtr - last_crtr) & AT91_ST_CRTV) >= LATCH) { 80 - last_crtr += LATCH; 77 + while (((crtr - last_crtr) & AT91_ST_CRTV) >= RM9200_TIMER_LATCH) { 78 + last_crtr += RM9200_TIMER_LATCH; 81 79 clkevt.event_handler(&clkevt); 82 80 } 83 81 return IRQ_HANDLED; ··· 118 116 case CLOCK_EVT_MODE_PERIODIC: 119 117 /* PIT for periodic irqs; fixed rate of 1/HZ */ 120 118 irqmask = AT91_ST_PITS; 121 - at91_sys_write(AT91_ST_PIMR, LATCH); 119 + at91_sys_write(AT91_ST_PIMR, RM9200_TIMER_LATCH); 122 120 break; 123 121 case CLOCK_EVT_MODE_ONESHOT: 124 122 /* ALM for oneshot irqs, set by next_event()
+19 -17
arch/arm/mach-at91/at91sam9260.c
··· 11 11 */ 12 12 13 13 #include <linux/module.h> 14 - #include <linux/pm.h> 15 14 16 15 #include <asm/irq.h> 17 16 #include <asm/mach/arch.h> ··· 20 21 #include <mach/at91sam9260.h> 21 22 #include <mach/at91_pmc.h> 22 23 #include <mach/at91_rstc.h> 23 - #include <mach/at91_shdwc.h> 24 24 25 25 #include "soc.h" 26 26 #include "generic.h" 27 27 #include "clock.h" 28 + #include "sam9_smc.h" 28 29 29 30 /* -------------------------------------------------------------------- 30 31 * Clocks ··· 119 120 .type = CLK_TYPE_PERIPHERAL, 120 121 }; 121 122 static struct clk macb_clk = { 122 - .name = "macb_clk", 123 + .name = "pclk", 123 124 .pmc_mask = 1 << AT91SAM9260_ID_EMAC, 124 125 .type = CLK_TYPE_PERIPHERAL, 125 126 }; ··· 189 190 }; 190 191 191 192 static struct clk_lookup periph_clocks_lookups[] = { 193 + /* One additional fake clock for macb_hclk */ 194 + CLKDEV_CON_ID("hclk", &macb_clk), 192 195 CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk), 193 196 CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk), 194 197 CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tc0_clk), ··· 210 209 CLKDEV_CON_DEV_ID("usart", "fffd8000.serial", &usart5_clk), 211 210 /* fake hclk clock */ 212 211 CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk), 212 + CLKDEV_CON_ID("pioA", &pioA_clk), 213 + CLKDEV_CON_ID("pioB", &pioB_clk), 214 + CLKDEV_CON_ID("pioC", &pioC_clk), 213 215 }; 214 216 215 217 static struct clk_lookup usart_clocks_lookups[] = { ··· 274 270 * GPIO 275 271 * -------------------------------------------------------------------- */ 276 272 277 - static struct at91_gpio_bank at91sam9260_gpio[] = { 273 + static struct at91_gpio_bank at91sam9260_gpio[] __initdata = { 278 274 { 279 275 .id = AT91SAM9260_ID_PIOA, 280 - .offset = AT91_PIOA, 281 - .clock = &pioA_clk, 276 + .regbase = AT91SAM9260_BASE_PIOA, 282 277 }, { 283 278 .id = AT91SAM9260_ID_PIOB, 284 - .offset = AT91_PIOB, 285 - .clock = &pioB_clk, 279 + .regbase = AT91SAM9260_BASE_PIOB, 286 280 }, { 287 281 .id = AT91SAM9260_ID_PIOC, 288 - .offset = AT91_PIOC, 289 - .clock = &pioC_clk, 282 + .regbase = AT91SAM9260_BASE_PIOC, 290 283 } 291 284 }; 292 - 293 - static void at91sam9260_poweroff(void) 294 - { 295 - at91_sys_write(AT91_SHDW_CR, AT91_SHDW_KEY | AT91_SHDW_SHDW); 296 - } 297 - 298 285 299 286 /* -------------------------------------------------------------------- 300 287 * AT91SAM9260 processor initialization ··· 320 325 } 321 326 } 322 327 328 + static void __init at91sam9260_ioremap_registers(void) 329 + { 330 + at91_ioremap_shdwc(AT91SAM9260_BASE_SHDWC); 331 + at91sam926x_ioremap_pit(AT91SAM9260_BASE_PIT); 332 + at91sam9_ioremap_smc(0, AT91SAM9260_BASE_SMC); 333 + } 334 + 323 335 static void __init at91sam9260_initialize(void) 324 336 { 325 337 arm_pm_restart = at91sam9_alt_restart; 326 - pm_power_off = at91sam9260_poweroff; 327 338 at91_extern_irq = (1 << AT91SAM9260_ID_IRQ0) | (1 << AT91SAM9260_ID_IRQ1) 328 339 | (1 << AT91SAM9260_ID_IRQ2); 329 340 ··· 382 381 struct at91_init_soc __initdata at91sam9260_soc = { 383 382 .map_io = at91sam9260_map_io, 384 383 .default_irq_priority = at91sam9260_default_irq_priority, 384 + .ioremap_registers = at91sam9260_ioremap_registers, 385 385 .register_clocks = at91sam9260_register_clocks, 386 386 .init = at91sam9260_initialize, 387 387 };
+32 -23
arch/arm/mach-at91/at91sam9260_devices.c
··· 115 115 if (!data) 116 116 return; 117 117 118 - if (data->vbus_pin) { 118 + if (gpio_is_valid(data->vbus_pin)) { 119 119 at91_set_gpio_input(data->vbus_pin, 0); 120 120 at91_set_deglitch(data->vbus_pin, 1); 121 121 } ··· 136 136 137 137 #if defined(CONFIG_MACB) || defined(CONFIG_MACB_MODULE) 138 138 static u64 eth_dmamask = DMA_BIT_MASK(32); 139 - static struct at91_eth_data eth_data; 139 + static struct macb_platform_data eth_data; 140 140 141 141 static struct resource eth_resources[] = { 142 142 [0] = { ··· 163 163 .num_resources = ARRAY_SIZE(eth_resources), 164 164 }; 165 165 166 - void __init at91_add_device_eth(struct at91_eth_data *data) 166 + void __init at91_add_device_eth(struct macb_platform_data *data) 167 167 { 168 168 if (!data) 169 169 return; 170 170 171 - if (data->phy_irq_pin) { 171 + if (gpio_is_valid(data->phy_irq_pin)) { 172 172 at91_set_gpio_input(data->phy_irq_pin, 0); 173 173 at91_set_deglitch(data->phy_irq_pin, 1); 174 174 } ··· 200 200 platform_device_register(&at91sam9260_eth_device); 201 201 } 202 202 #else 203 - void __init at91_add_device_eth(struct at91_eth_data *data) {} 203 + void __init at91_add_device_eth(struct macb_platform_data *data) {} 204 204 #endif 205 205 206 206 ··· 243 243 return; 244 244 245 245 /* input/irq */ 246 - if (data->det_pin) { 246 + if (gpio_is_valid(data->det_pin)) { 247 247 at91_set_gpio_input(data->det_pin, 1); 248 248 at91_set_deglitch(data->det_pin, 1); 249 249 } 250 - if (data->wp_pin) 250 + if (gpio_is_valid(data->wp_pin)) 251 251 at91_set_gpio_input(data->wp_pin, 1); 252 - if (data->vcc_pin) 252 + if (gpio_is_valid(data->vcc_pin)) 253 253 at91_set_gpio_output(data->vcc_pin, 0); 254 254 255 255 /* CLK */ ··· 330 330 for (i = 0; i < ATMCI_MAX_NR_SLOTS; i++) { 331 331 if (data->slot[i].bus_width) { 332 332 /* input/irq */ 333 - if (data->slot[i].detect_pin) { 333 + if (gpio_is_valid(data->slot[i].detect_pin)) { 334 334 at91_set_gpio_input(data->slot[i].detect_pin, 1); 335 335 at91_set_deglitch(data->slot[i].detect_pin, 1); 336 336 } 337 - if (data->slot[i].wp_pin) 337 + if (gpio_is_valid(data->slot[i].wp_pin)) 338 338 at91_set_gpio_input(data->slot[i].wp_pin, 1); 339 339 340 340 switch (i) { ··· 399 399 .flags = IORESOURCE_MEM, 400 400 }, 401 401 [1] = { 402 - .start = AT91_BASE_SYS + AT91_ECC, 403 - .end = AT91_BASE_SYS + AT91_ECC + SZ_512 - 1, 402 + .start = AT91SAM9260_BASE_ECC, 403 + .end = AT91SAM9260_BASE_ECC + SZ_512 - 1, 404 404 .flags = IORESOURCE_MEM, 405 405 } 406 406 }; ··· 426 426 at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_CS3A_SMC_SMARTMEDIA); 427 427 428 428 /* enable pin */ 429 - if (data->enable_pin) 429 + if (gpio_is_valid(data->enable_pin)) 430 430 at91_set_gpio_output(data->enable_pin, 1); 431 431 432 432 /* ready/busy pin */ 433 - if (data->rdy_pin) 433 + if (gpio_is_valid(data->rdy_pin)) 434 434 at91_set_gpio_input(data->rdy_pin, 1); 435 435 436 436 /* card detect pin */ 437 - if (data->det_pin) 437 + if (gpio_is_valid(data->det_pin)) 438 438 at91_set_gpio_input(data->det_pin, 1); 439 439 440 440 nand_data = *data; ··· 714 714 715 715 static struct resource rtt_resources[] = { 716 716 { 717 - .start = AT91_BASE_SYS + AT91_RTT, 718 - .end = AT91_BASE_SYS + AT91_RTT + SZ_16 - 1, 717 + .start = AT91SAM9260_BASE_RTT, 718 + .end = AT91SAM9260_BASE_RTT + SZ_16 - 1, 719 719 .flags = IORESOURCE_MEM, 720 720 } 721 721 }; ··· 738 738 * -------------------------------------------------------------------- */ 739 739 740 740 #if defined(CONFIG_AT91SAM9X_WATCHDOG) || defined(CONFIG_AT91SAM9X_WATCHDOG_MODULE) 741 + static struct resource wdt_resources[] = { 742 + { 743 + .start = AT91SAM9260_BASE_WDT, 744 + .end = AT91SAM9260_BASE_WDT + SZ_16 - 1, 745 + .flags = IORESOURCE_MEM, 746 + } 747 + }; 748 + 741 749 static struct platform_device at91sam9260_wdt_device = { 742 750 .name = "at91_wdt", 743 751 .id = -1, 744 - .num_resources = 0, 752 + .resource = wdt_resources, 753 + .num_resources = ARRAY_SIZE(wdt_resources), 745 754 }; 746 755 747 756 static void __init at91_add_device_watchdog(void) ··· 846 837 #if defined(CONFIG_SERIAL_ATMEL) 847 838 static struct resource dbgu_resources[] = { 848 839 [0] = { 849 - .start = AT91_BASE_SYS + AT91_DBGU, 850 - .end = AT91_BASE_SYS + AT91_DBGU + SZ_512 - 1, 840 + .start = AT91SAM9260_BASE_DBGU, 841 + .end = AT91SAM9260_BASE_DBGU + SZ_512 - 1, 851 842 .flags = IORESOURCE_MEM, 852 843 }, 853 844 [1] = { ··· 1290 1281 1291 1282 at91_sys_write(AT91_MATRIX_EBICSA, csa); 1292 1283 1293 - if (data->rst_pin) { 1284 + if (gpio_is_valid(data->rst_pin)) { 1294 1285 at91_set_multi_drive(data->rst_pin, 0); 1295 1286 at91_set_gpio_output(data->rst_pin, 1); 1296 1287 } 1297 1288 1298 - if (data->irq_pin) { 1289 + if (gpio_is_valid(data->irq_pin)) { 1299 1290 at91_set_gpio_input(data->irq_pin, 0); 1300 1291 at91_set_deglitch(data->irq_pin, 1); 1301 1292 } 1302 1293 1303 - if (data->det_pin) { 1294 + if (gpio_is_valid(data->det_pin)) { 1304 1295 at91_set_gpio_input(data->det_pin, 0); 1305 1296 at91_set_deglitch(data->det_pin, 1); 1306 1297 }
+16 -16
arch/arm/mach-at91/at91sam9261.c
··· 11 11 */ 12 12 13 13 #include <linux/module.h> 14 - #include <linux/pm.h> 15 14 16 15 #include <asm/irq.h> 17 16 #include <asm/mach/arch.h> ··· 19 20 #include <mach/at91sam9261.h> 20 21 #include <mach/at91_pmc.h> 21 22 #include <mach/at91_rstc.h> 22 - #include <mach/at91_shdwc.h> 23 23 24 24 #include "soc.h" 25 25 #include "generic.h" 26 26 #include "clock.h" 27 + #include "sam9_smc.h" 27 28 28 29 /* -------------------------------------------------------------------- 29 30 * Clocks ··· 175 176 CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), 176 177 CLKDEV_CON_DEV_ID("pclk", "ssc.2", &ssc2_clk), 177 178 CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &hck0), 179 + CLKDEV_CON_ID("pioA", &pioA_clk), 180 + CLKDEV_CON_ID("pioB", &pioB_clk), 181 + CLKDEV_CON_ID("pioC", &pioC_clk), 178 182 }; 179 183 180 184 static struct clk_lookup usart_clocks_lookups[] = { ··· 253 251 * GPIO 254 252 * -------------------------------------------------------------------- */ 255 253 256 - static struct at91_gpio_bank at91sam9261_gpio[] = { 254 + static struct at91_gpio_bank at91sam9261_gpio[] __initdata = { 257 255 { 258 256 .id = AT91SAM9261_ID_PIOA, 259 - .offset = AT91_PIOA, 260 - .clock = &pioA_clk, 257 + .regbase = AT91SAM9261_BASE_PIOA, 261 258 }, { 262 259 .id = AT91SAM9261_ID_PIOB, 263 - .offset = AT91_PIOB, 264 - .clock = &pioB_clk, 260 + .regbase = AT91SAM9261_BASE_PIOB, 265 261 }, { 266 262 .id = AT91SAM9261_ID_PIOC, 267 - .offset = AT91_PIOC, 268 - .clock = &pioC_clk, 263 + .regbase = AT91SAM9261_BASE_PIOC, 269 264 } 270 265 }; 271 - 272 - static void at91sam9261_poweroff(void) 273 - { 274 - at91_sys_write(AT91_SHDW_CR, AT91_SHDW_KEY | AT91_SHDW_SHDW); 275 - } 276 - 277 266 278 267 /* -------------------------------------------------------------------- 279 268 * AT91SAM9261 processor initialization ··· 278 285 at91_init_sram(0, AT91SAM9261_SRAM_BASE, AT91SAM9261_SRAM_SIZE); 279 286 } 280 287 288 + static void __init at91sam9261_ioremap_registers(void) 289 + { 290 + at91_ioremap_shdwc(AT91SAM9261_BASE_SHDWC); 291 + at91sam926x_ioremap_pit(AT91SAM9261_BASE_PIT); 292 + at91sam9_ioremap_smc(0, AT91SAM9261_BASE_SMC); 293 + } 294 + 281 295 static void __init at91sam9261_initialize(void) 282 296 { 283 297 arm_pm_restart = at91sam9_alt_restart; 284 - pm_power_off = at91sam9261_poweroff; 285 298 at91_extern_irq = (1 << AT91SAM9261_ID_IRQ0) | (1 << AT91SAM9261_ID_IRQ1) 286 299 | (1 << AT91SAM9261_ID_IRQ2); 287 300 ··· 340 341 struct at91_init_soc __initdata at91sam9261_soc = { 341 342 .map_io = at91sam9261_map_io, 342 343 .default_irq_priority = at91sam9261_default_irq_priority, 344 + .ioremap_registers = at91sam9261_ioremap_registers, 343 345 .register_clocks = at91sam9261_register_clocks, 344 346 .init = at91sam9261_initialize, 345 347 };
+21 -12
arch/arm/mach-at91/at91sam9261_devices.c
··· 118 118 if (!data) 119 119 return; 120 120 121 - if (data->vbus_pin) { 121 + if (gpio_is_valid(data->vbus_pin)) { 122 122 at91_set_gpio_input(data->vbus_pin, 0); 123 123 at91_set_deglitch(data->vbus_pin, 1); 124 124 } ··· 171 171 return; 172 172 173 173 /* input/irq */ 174 - if (data->det_pin) { 174 + if (gpio_is_valid(data->det_pin)) { 175 175 at91_set_gpio_input(data->det_pin, 1); 176 176 at91_set_deglitch(data->det_pin, 1); 177 177 } 178 - if (data->wp_pin) 178 + if (gpio_is_valid(data->wp_pin)) 179 179 at91_set_gpio_input(data->wp_pin, 1); 180 - if (data->vcc_pin) 180 + if (gpio_is_valid(data->vcc_pin)) 181 181 at91_set_gpio_output(data->vcc_pin, 0); 182 182 183 183 /* CLK */ ··· 240 240 at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_CS3A_SMC_SMARTMEDIA); 241 241 242 242 /* enable pin */ 243 - if (data->enable_pin) 243 + if (gpio_is_valid(data->enable_pin)) 244 244 at91_set_gpio_output(data->enable_pin, 1); 245 245 246 246 /* ready/busy pin */ 247 - if (data->rdy_pin) 247 + if (gpio_is_valid(data->rdy_pin)) 248 248 at91_set_gpio_input(data->rdy_pin, 1); 249 249 250 250 /* card detect pin */ 251 - if (data->det_pin) 251 + if (gpio_is_valid(data->det_pin)) 252 252 at91_set_gpio_input(data->det_pin, 1); 253 253 254 254 at91_set_A_periph(AT91_PIN_PC0, 0); /* NANDOE */ ··· 600 600 601 601 static struct resource rtt_resources[] = { 602 602 { 603 - .start = AT91_BASE_SYS + AT91_RTT, 604 - .end = AT91_BASE_SYS + AT91_RTT + SZ_16 - 1, 603 + .start = AT91SAM9261_BASE_RTT, 604 + .end = AT91SAM9261_BASE_RTT + SZ_16 - 1, 605 605 .flags = IORESOURCE_MEM, 606 606 } 607 607 }; ··· 624 624 * -------------------------------------------------------------------- */ 625 625 626 626 #if defined(CONFIG_AT91SAM9X_WATCHDOG) || defined(CONFIG_AT91SAM9X_WATCHDOG_MODULE) 627 + static struct resource wdt_resources[] = { 628 + { 629 + .start = AT91SAM9261_BASE_WDT, 630 + .end = AT91SAM9261_BASE_WDT + SZ_16 - 1, 631 + .flags = IORESOURCE_MEM, 632 + } 633 + }; 634 + 627 635 static struct platform_device at91sam9261_wdt_device = { 628 636 .name = "at91_wdt", 629 637 .id = -1, 630 - .num_resources = 0, 638 + .resource = wdt_resources, 639 + .num_resources = ARRAY_SIZE(wdt_resources), 631 640 }; 632 641 633 642 static void __init at91_add_device_watchdog(void) ··· 825 816 #if defined(CONFIG_SERIAL_ATMEL) 826 817 static struct resource dbgu_resources[] = { 827 818 [0] = { 828 - .start = AT91_BASE_SYS + AT91_DBGU, 829 - .end = AT91_BASE_SYS + AT91_DBGU + SZ_512 - 1, 819 + .start = AT91SAM9261_BASE_DBGU, 820 + .end = AT91SAM9261_BASE_DBGU + SZ_512 - 1, 830 821 .flags = IORESOURCE_MEM, 831 822 }, 832 823 [1] = {
+24 -21
arch/arm/mach-at91/at91sam9263.c
··· 11 11 */ 12 12 13 13 #include <linux/module.h> 14 - #include <linux/pm.h> 15 14 16 15 #include <asm/irq.h> 17 16 #include <asm/mach/arch.h> ··· 18 19 #include <mach/at91sam9263.h> 19 20 #include <mach/at91_pmc.h> 20 21 #include <mach/at91_rstc.h> 21 - #include <mach/at91_shdwc.h> 22 22 23 23 #include "soc.h" 24 24 #include "generic.h" 25 25 #include "clock.h" 26 + #include "sam9_smc.h" 26 27 27 28 /* -------------------------------------------------------------------- 28 29 * Clocks ··· 117 118 .type = CLK_TYPE_PERIPHERAL, 118 119 }; 119 120 static struct clk macb_clk = { 120 - .name = "macb_clk", 121 + .name = "pclk", 121 122 .pmc_mask = 1 << AT91SAM9263_ID_EMAC, 122 123 .type = CLK_TYPE_PERIPHERAL, 123 124 }; ··· 181 182 }; 182 183 183 184 static struct clk_lookup periph_clocks_lookups[] = { 185 + /* One additional fake clock for macb_hclk */ 186 + CLKDEV_CON_ID("hclk", &macb_clk), 184 187 CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk), 185 188 CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), 186 189 CLKDEV_CON_DEV_ID("mci_clk", "at91_mci.0", &mmc0_clk), ··· 192 191 CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tcb_clk), 193 192 /* fake hclk clock */ 194 193 CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk), 194 + CLKDEV_CON_ID("pioA", &pioA_clk), 195 + CLKDEV_CON_ID("pioB", &pioB_clk), 196 + CLKDEV_CON_ID("pioC", &pioCDE_clk), 197 + CLKDEV_CON_ID("pioD", &pioCDE_clk), 198 + CLKDEV_CON_ID("pioE", &pioCDE_clk), 195 199 }; 196 200 197 201 static struct clk_lookup usart_clocks_lookups[] = { ··· 269 263 * GPIO 270 264 * -------------------------------------------------------------------- */ 271 265 272 - static struct at91_gpio_bank at91sam9263_gpio[] = { 266 + static struct at91_gpio_bank at91sam9263_gpio[] __initdata = { 273 267 { 274 268 .id = AT91SAM9263_ID_PIOA, 275 - .offset = AT91_PIOA, 276 - .clock = &pioA_clk, 269 + .regbase = AT91SAM9263_BASE_PIOA, 277 270 }, { 278 271 .id = AT91SAM9263_ID_PIOB, 279 - .offset = AT91_PIOB, 280 - .clock = &pioB_clk, 272 + .regbase = AT91SAM9263_BASE_PIOB, 281 273 }, { 282 274 .id = AT91SAM9263_ID_PIOCDE, 283 - .offset = AT91_PIOC, 284 - .clock = &pioCDE_clk, 275 + .regbase = AT91SAM9263_BASE_PIOC, 285 276 }, { 286 277 .id = AT91SAM9263_ID_PIOCDE, 287 - .offset = AT91_PIOD, 288 - .clock = &pioCDE_clk, 278 + .regbase = AT91SAM9263_BASE_PIOD, 289 279 }, { 290 280 .id = AT91SAM9263_ID_PIOCDE, 291 - .offset = AT91_PIOE, 292 - .clock = &pioCDE_clk, 281 + .regbase = AT91SAM9263_BASE_PIOE, 293 282 } 294 283 }; 295 - 296 - static void at91sam9263_poweroff(void) 297 - { 298 - at91_sys_write(AT91_SHDW_CR, AT91_SHDW_KEY | AT91_SHDW_SHDW); 299 - } 300 - 301 284 302 285 /* -------------------------------------------------------------------- 303 286 * AT91SAM9263 processor initialization ··· 298 303 at91_init_sram(1, AT91SAM9263_SRAM1_BASE, AT91SAM9263_SRAM1_SIZE); 299 304 } 300 305 306 + static void __init at91sam9263_ioremap_registers(void) 307 + { 308 + at91_ioremap_shdwc(AT91SAM9263_BASE_SHDWC); 309 + at91sam926x_ioremap_pit(AT91SAM9263_BASE_PIT); 310 + at91sam9_ioremap_smc(0, AT91SAM9263_BASE_SMC0); 311 + at91sam9_ioremap_smc(1, AT91SAM9263_BASE_SMC1); 312 + } 313 + 301 314 static void __init at91sam9263_initialize(void) 302 315 { 303 316 arm_pm_restart = at91sam9_alt_restart; 304 - pm_power_off = at91sam9263_poweroff; 305 317 at91_extern_irq = (1 << AT91SAM9263_ID_IRQ0) | (1 << AT91SAM9263_ID_IRQ1); 306 318 307 319 /* Register GPIO subsystem */ ··· 360 358 struct at91_init_soc __initdata at91sam9263_soc = { 361 359 .map_io = at91sam9263_map_io, 362 360 .default_irq_priority = at91sam9263_default_irq_priority, 361 + .ioremap_registers = at91sam9263_ioremap_registers, 363 362 .register_clocks = at91sam9263_register_clocks, 364 363 .init = at91sam9263_initialize, 365 364 };
+34 -25
arch/arm/mach-at91/at91sam9263_devices.c
··· 70 70 71 71 /* Enable VBus control for UHP ports */ 72 72 for (i = 0; i < data->ports; i++) { 73 - if (data->vbus_pin[i]) 73 + if (gpio_is_valid(data->vbus_pin[i])) 74 74 at91_set_gpio_output(data->vbus_pin[i], 0); 75 75 } 76 76 ··· 123 123 if (!data) 124 124 return; 125 125 126 - if (data->vbus_pin) { 126 + if (gpio_is_valid(data->vbus_pin)) { 127 127 at91_set_gpio_input(data->vbus_pin, 0); 128 128 at91_set_deglitch(data->vbus_pin, 1); 129 129 } ··· 144 144 145 145 #if defined(CONFIG_MACB) || defined(CONFIG_MACB_MODULE) 146 146 static u64 eth_dmamask = DMA_BIT_MASK(32); 147 - static struct at91_eth_data eth_data; 147 + static struct macb_platform_data eth_data; 148 148 149 149 static struct resource eth_resources[] = { 150 150 [0] = { ··· 171 171 .num_resources = ARRAY_SIZE(eth_resources), 172 172 }; 173 173 174 - void __init at91_add_device_eth(struct at91_eth_data *data) 174 + void __init at91_add_device_eth(struct macb_platform_data *data) 175 175 { 176 176 if (!data) 177 177 return; 178 178 179 - if (data->phy_irq_pin) { 179 + if (gpio_is_valid(data->phy_irq_pin)) { 180 180 at91_set_gpio_input(data->phy_irq_pin, 0); 181 181 at91_set_deglitch(data->phy_irq_pin, 1); 182 182 } ··· 208 208 platform_device_register(&at91sam9263_eth_device); 209 209 } 210 210 #else 211 - void __init at91_add_device_eth(struct at91_eth_data *data) {} 211 + void __init at91_add_device_eth(struct macb_platform_data *data) {} 212 212 #endif 213 213 214 214 ··· 276 276 return; 277 277 278 278 /* input/irq */ 279 - if (data->det_pin) { 279 + if (gpio_is_valid(data->det_pin)) { 280 280 at91_set_gpio_input(data->det_pin, 1); 281 281 at91_set_deglitch(data->det_pin, 1); 282 282 } 283 - if (data->wp_pin) 283 + if (gpio_is_valid(data->wp_pin)) 284 284 at91_set_gpio_input(data->wp_pin, 1); 285 - if (data->vcc_pin) 285 + if (gpio_is_valid(data->vcc_pin)) 286 286 at91_set_gpio_output(data->vcc_pin, 0); 287 287 288 288 if (mmc_id == 0) { /* MCI0 */ ··· 430 430 } 431 431 at91_sys_write(AT91_MATRIX_EBI0CSA, ebi0_csa); 432 432 433 - if (data->det_pin) { 433 + if (gpio_is_valid(data->det_pin)) { 434 434 at91_set_gpio_input(data->det_pin, 1); 435 435 at91_set_deglitch(data->det_pin, 1); 436 436 } 437 437 438 - if (data->irq_pin) { 438 + if (gpio_is_valid(data->irq_pin)) { 439 439 at91_set_gpio_input(data->irq_pin, 1); 440 440 at91_set_deglitch(data->irq_pin, 1); 441 441 } 442 442 443 - if (data->vcc_pin) 443 + if (gpio_is_valid(data->vcc_pin)) 444 444 /* initially off */ 445 445 at91_set_gpio_output(data->vcc_pin, 0); 446 446 ··· 473 473 .flags = IORESOURCE_MEM, 474 474 }, 475 475 [1] = { 476 - .start = AT91_BASE_SYS + AT91_ECC0, 477 - .end = AT91_BASE_SYS + AT91_ECC0 + SZ_512 - 1, 476 + .start = AT91SAM9263_BASE_ECC0, 477 + .end = AT91SAM9263_BASE_ECC0 + SZ_512 - 1, 478 478 .flags = IORESOURCE_MEM, 479 479 } 480 480 }; ··· 500 500 at91_sys_write(AT91_MATRIX_EBI0CSA, csa | AT91_MATRIX_EBI0_CS3A_SMC_SMARTMEDIA); 501 501 502 502 /* enable pin */ 503 - if (data->enable_pin) 503 + if (gpio_is_valid(data->enable_pin)) 504 504 at91_set_gpio_output(data->enable_pin, 1); 505 505 506 506 /* ready/busy pin */ 507 - if (data->rdy_pin) 507 + if (gpio_is_valid(data->rdy_pin)) 508 508 at91_set_gpio_input(data->rdy_pin, 1); 509 509 510 510 /* card detect pin */ 511 - if (data->det_pin) 511 + if (gpio_is_valid(data->det_pin)) 512 512 at91_set_gpio_input(data->det_pin, 1); 513 513 514 514 nand_data = *data; ··· 749 749 at91_set_A_periph(AT91_PIN_PB3, 0); /* AC97RX */ 750 750 751 751 /* reset */ 752 - if (data->reset_pin) 752 + if (gpio_is_valid(data->reset_pin)) 753 753 at91_set_gpio_output(data->reset_pin, 0); 754 754 755 755 ac97_data = *data; ··· 956 956 957 957 static struct resource rtt0_resources[] = { 958 958 { 959 - .start = AT91_BASE_SYS + AT91_RTT0, 960 - .end = AT91_BASE_SYS + AT91_RTT0 + SZ_16 - 1, 959 + .start = AT91SAM9263_BASE_RTT0, 960 + .end = AT91SAM9263_BASE_RTT0 + SZ_16 - 1, 961 961 .flags = IORESOURCE_MEM, 962 962 } 963 963 }; ··· 971 971 972 972 static struct resource rtt1_resources[] = { 973 973 { 974 - .start = AT91_BASE_SYS + AT91_RTT1, 975 - .end = AT91_BASE_SYS + AT91_RTT1 + SZ_16 - 1, 974 + .start = AT91SAM9263_BASE_RTT1, 975 + .end = AT91SAM9263_BASE_RTT1 + SZ_16 - 1, 976 976 .flags = IORESOURCE_MEM, 977 977 } 978 978 }; ··· 996 996 * -------------------------------------------------------------------- */ 997 997 998 998 #if defined(CONFIG_AT91SAM9X_WATCHDOG) || defined(CONFIG_AT91SAM9X_WATCHDOG_MODULE) 999 + static struct resource wdt_resources[] = { 1000 + { 1001 + .start = AT91SAM9263_BASE_WDT, 1002 + .end = AT91SAM9263_BASE_WDT + SZ_16 - 1, 1003 + .flags = IORESOURCE_MEM, 1004 + } 1005 + }; 1006 + 999 1007 static struct platform_device at91sam9263_wdt_device = { 1000 1008 .name = "at91_wdt", 1001 1009 .id = -1, 1002 - .num_resources = 0, 1010 + .resource = wdt_resources, 1011 + .num_resources = ARRAY_SIZE(wdt_resources), 1003 1012 }; 1004 1013 1005 1014 static void __init at91_add_device_watchdog(void) ··· 1205 1196 1206 1197 static struct resource dbgu_resources[] = { 1207 1198 [0] = { 1208 - .start = AT91_BASE_SYS + AT91_DBGU, 1209 - .end = AT91_BASE_SYS + AT91_DBGU + SZ_512 - 1, 1199 + .start = AT91SAM9263_BASE_DBGU, 1200 + .end = AT91SAM9263_BASE_DBGU + SZ_512 - 1, 1210 1201 .flags = IORESOURCE_MEM, 1211 1202 }, 1212 1203 [1] = {
+28 -10
arch/arm/mach-at91/at91sam926x_time.c
··· 25 25 26 26 static u32 pit_cycle; /* write-once */ 27 27 static u32 pit_cnt; /* access only w/system irq blocked */ 28 + static void __iomem *pit_base_addr __read_mostly; 28 29 30 + static inline unsigned int pit_read(unsigned int reg_offset) 31 + { 32 + return __raw_readl(pit_base_addr + reg_offset); 33 + } 34 + 35 + static inline void pit_write(unsigned int reg_offset, unsigned long value) 36 + { 37 + __raw_writel(value, pit_base_addr + reg_offset); 38 + } 29 39 30 40 /* 31 41 * Clocksource: just a monotonic counter of MCK/16 cycles. ··· 49 39 50 40 raw_local_irq_save(flags); 51 41 elapsed = pit_cnt; 52 - t = at91_sys_read(AT91_PIT_PIIR); 42 + t = pit_read(AT91_PIT_PIIR); 53 43 raw_local_irq_restore(flags); 54 44 55 45 elapsed += PIT_PICNT(t) * pit_cycle; ··· 74 64 switch (mode) { 75 65 case CLOCK_EVT_MODE_PERIODIC: 76 66 /* update clocksource counter */ 77 - pit_cnt += pit_cycle * PIT_PICNT(at91_sys_read(AT91_PIT_PIVR)); 78 - at91_sys_write(AT91_PIT_MR, (pit_cycle - 1) | AT91_PIT_PITEN 67 + pit_cnt += pit_cycle * PIT_PICNT(pit_read(AT91_PIT_PIVR)); 68 + pit_write(AT91_PIT_MR, (pit_cycle - 1) | AT91_PIT_PITEN 79 69 | AT91_PIT_PITIEN); 80 70 break; 81 71 case CLOCK_EVT_MODE_ONESHOT: ··· 84 74 case CLOCK_EVT_MODE_SHUTDOWN: 85 75 case CLOCK_EVT_MODE_UNUSED: 86 76 /* disable irq, leaving the clocksource active */ 87 - at91_sys_write(AT91_PIT_MR, (pit_cycle - 1) | AT91_PIT_PITEN); 77 + pit_write(AT91_PIT_MR, (pit_cycle - 1) | AT91_PIT_PITEN); 88 78 break; 89 79 case CLOCK_EVT_MODE_RESUME: 90 80 break; ··· 113 103 114 104 /* The PIT interrupt may be disabled, and is shared */ 115 105 if ((pit_clkevt.mode == CLOCK_EVT_MODE_PERIODIC) 116 - && (at91_sys_read(AT91_PIT_SR) & AT91_PIT_PITS)) { 106 + && (pit_read(AT91_PIT_SR) & AT91_PIT_PITS)) { 117 107 unsigned nr_ticks; 118 108 119 109 /* Get number of ticks performed before irq, and ack it */ 120 - nr_ticks = PIT_PICNT(at91_sys_read(AT91_PIT_PIVR)); 110 + nr_ticks = PIT_PICNT(pit_read(AT91_PIT_PIVR)); 121 111 do { 122 112 pit_cnt += pit_cycle; 123 113 pit_clkevt.event_handler(&pit_clkevt); ··· 139 129 static void at91sam926x_pit_reset(void) 140 130 { 141 131 /* Disable timer and irqs */ 142 - at91_sys_write(AT91_PIT_MR, 0); 132 + pit_write(AT91_PIT_MR, 0); 143 133 144 134 /* Clear any pending interrupts, wait for PIT to stop counting */ 145 - while (PIT_CPIV(at91_sys_read(AT91_PIT_PIVR)) != 0) 135 + while (PIT_CPIV(pit_read(AT91_PIT_PIVR)) != 0) 146 136 cpu_relax(); 147 137 148 138 /* Start PIT but don't enable IRQ */ 149 - at91_sys_write(AT91_PIT_MR, (pit_cycle - 1) | AT91_PIT_PITEN); 139 + pit_write(AT91_PIT_MR, (pit_cycle - 1) | AT91_PIT_PITEN); 150 140 } 151 141 152 142 /* ··· 188 178 static void at91sam926x_pit_suspend(void) 189 179 { 190 180 /* Disable timer */ 191 - at91_sys_write(AT91_PIT_MR, 0); 181 + pit_write(AT91_PIT_MR, 0); 182 + } 183 + 184 + void __init at91sam926x_ioremap_pit(u32 addr) 185 + { 186 + pit_base_addr = ioremap(addr, 16); 187 + 188 + if (!pit_base_addr) 189 + panic("Impossible to ioremap PIT\n"); 192 190 } 193 191 194 192 struct sys_timer at91sam926x_timer = {
+23 -21
arch/arm/mach-at91/at91sam9g45.c
··· 11 11 */ 12 12 13 13 #include <linux/module.h> 14 - #include <linux/pm.h> 15 14 #include <linux/dma-mapping.h> 16 15 17 16 #include <asm/irq.h> ··· 19 20 #include <mach/at91sam9g45.h> 20 21 #include <mach/at91_pmc.h> 21 22 #include <mach/at91_rstc.h> 22 - #include <mach/at91_shdwc.h> 23 23 #include <mach/cpu.h> 24 24 25 25 #include "soc.h" 26 26 #include "generic.h" 27 27 #include "clock.h" 28 + #include "sam9_smc.h" 28 29 29 30 /* -------------------------------------------------------------------- 30 31 * Clocks ··· 149 150 .type = CLK_TYPE_PERIPHERAL, 150 151 }; 151 152 static struct clk macb_clk = { 152 - .name = "macb_clk", 153 + .name = "pclk", 153 154 .pmc_mask = 1 << AT91SAM9G45_ID_EMAC, 154 155 .type = CLK_TYPE_PERIPHERAL, 155 156 }; ··· 208 209 }; 209 210 210 211 static struct clk_lookup periph_clocks_lookups[] = { 212 + /* One additional fake clock for macb_hclk */ 213 + CLKDEV_CON_ID("hclk", &macb_clk), 211 214 /* One additional fake clock for ohci */ 212 215 CLKDEV_CON_ID("ohci_clk", &uhphs_clk), 213 216 CLKDEV_CON_DEV_ID("ehci_clk", "atmel-ehci", &uhphs_clk), ··· 232 231 CLKDEV_CON_DEV_ID("usart", "fff98000.serial", &usart3_clk), 233 232 /* fake hclk clock */ 234 233 CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &uhphs_clk), 234 + CLKDEV_CON_ID("pioA", &pioA_clk), 235 + CLKDEV_CON_ID("pioB", &pioB_clk), 236 + CLKDEV_CON_ID("pioC", &pioC_clk), 237 + CLKDEV_CON_ID("pioD", &pioDE_clk), 238 + CLKDEV_CON_ID("pioE", &pioDE_clk), 235 239 }; 236 240 237 241 static struct clk_lookup usart_clocks_lookups[] = { ··· 299 293 * GPIO 300 294 * -------------------------------------------------------------------- */ 301 295 302 - static struct at91_gpio_bank at91sam9g45_gpio[] = { 296 + static struct at91_gpio_bank at91sam9g45_gpio[] __initdata = { 303 297 { 304 298 .id = AT91SAM9G45_ID_PIOA, 305 - .offset = AT91_PIOA, 306 - .clock = &pioA_clk, 299 + .regbase = AT91SAM9G45_BASE_PIOA, 307 300 }, { 308 301 .id = AT91SAM9G45_ID_PIOB, 309 - .offset = AT91_PIOB, 310 - .clock = &pioB_clk, 302 + .regbase = AT91SAM9G45_BASE_PIOB, 311 303 }, { 312 304 .id = AT91SAM9G45_ID_PIOC, 313 - .offset = AT91_PIOC, 314 - .clock = &pioC_clk, 305 + .regbase = AT91SAM9G45_BASE_PIOC, 315 306 }, { 316 307 .id = AT91SAM9G45_ID_PIODE, 317 - .offset = AT91_PIOD, 318 - .clock = &pioDE_clk, 308 + .regbase = AT91SAM9G45_BASE_PIOD, 319 309 }, { 320 310 .id = AT91SAM9G45_ID_PIODE, 321 - .offset = AT91_PIOE, 322 - .clock = &pioDE_clk, 311 + .regbase = AT91SAM9G45_BASE_PIOE, 323 312 } 324 313 }; 325 314 ··· 322 321 { 323 322 at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST); 324 323 } 325 - 326 - static void at91sam9g45_poweroff(void) 327 - { 328 - at91_sys_write(AT91_SHDW_CR, AT91_SHDW_KEY | AT91_SHDW_SHDW); 329 - } 330 - 331 324 332 325 /* -------------------------------------------------------------------- 333 326 * AT91SAM9G45 processor initialization ··· 333 338 init_consistent_dma_size(SZ_4M); 334 339 } 335 340 341 + static void __init at91sam9g45_ioremap_registers(void) 342 + { 343 + at91_ioremap_shdwc(AT91SAM9G45_BASE_SHDWC); 344 + at91sam926x_ioremap_pit(AT91SAM9G45_BASE_PIT); 345 + at91sam9_ioremap_smc(0, AT91SAM9G45_BASE_SMC); 346 + } 347 + 336 348 static void __init at91sam9g45_initialize(void) 337 349 { 338 350 arm_pm_restart = at91sam9g45_restart; 339 - pm_power_off = at91sam9g45_poweroff; 340 351 at91_extern_irq = (1 << AT91SAM9G45_ID_IRQ0); 341 352 342 353 /* Register GPIO subsystem */ ··· 394 393 struct at91_init_soc __initdata at91sam9g45_soc = { 395 394 .map_io = at91sam9g45_map_io, 396 395 .default_irq_priority = at91sam9g45_default_irq_priority, 396 + .ioremap_registers = at91sam9g45_ioremap_registers, 397 397 .register_clocks = at91sam9g45_register_clocks, 398 398 .init = at91sam9g45_initialize, 399 399 };
+46 -23
arch/arm/mach-at91/at91sam9g45_devices.c
··· 44 44 45 45 static struct resource hdmac_resources[] = { 46 46 [0] = { 47 - .start = AT91_BASE_SYS + AT91_DMA, 48 - .end = AT91_BASE_SYS + AT91_DMA + SZ_512 - 1, 47 + .start = AT91SAM9G45_BASE_DMA, 48 + .end = AT91SAM9G45_BASE_DMA + SZ_512 - 1, 49 49 .flags = IORESOURCE_MEM, 50 50 }, 51 51 [1] = { ··· 120 120 121 121 /* Enable VBus control for UHP ports */ 122 122 for (i = 0; i < data->ports; i++) { 123 - if (data->vbus_pin[i]) 123 + if (gpio_is_valid(data->vbus_pin[i])) 124 124 at91_set_gpio_output(data->vbus_pin[i], 0); 125 125 } 126 126 ··· 181 181 182 182 /* Enable VBus control for UHP ports */ 183 183 for (i = 0; i < data->ports; i++) { 184 - if (data->vbus_pin[i]) 184 + if (gpio_is_valid(data->vbus_pin[i])) 185 185 at91_set_gpio_output(data->vbus_pin[i], 0); 186 186 } 187 187 ··· 263 263 usba_udc_data.pdata.num_ep = ARRAY_SIZE(usba_udc_ep); 264 264 memcpy(usba_udc_data.ep, usba_udc_ep, sizeof(usba_udc_ep)); 265 265 266 - if (data && data->vbus_pin > 0) { 266 + if (data && gpio_is_valid(data->vbus_pin)) { 267 267 at91_set_gpio_input(data->vbus_pin, 0); 268 268 at91_set_deglitch(data->vbus_pin, 1); 269 269 usba_udc_data.pdata.vbus_pin = data->vbus_pin; ··· 284 284 285 285 #if defined(CONFIG_MACB) || defined(CONFIG_MACB_MODULE) 286 286 static u64 eth_dmamask = DMA_BIT_MASK(32); 287 - static struct at91_eth_data eth_data; 287 + static struct macb_platform_data eth_data; 288 288 289 289 static struct resource eth_resources[] = { 290 290 [0] = { ··· 311 311 .num_resources = ARRAY_SIZE(eth_resources), 312 312 }; 313 313 314 - void __init at91_add_device_eth(struct at91_eth_data *data) 314 + void __init at91_add_device_eth(struct macb_platform_data *data) 315 315 { 316 316 if (!data) 317 317 return; 318 318 319 - if (data->phy_irq_pin) { 319 + if (gpio_is_valid(data->phy_irq_pin)) { 320 320 at91_set_gpio_input(data->phy_irq_pin, 0); 321 321 at91_set_deglitch(data->phy_irq_pin, 1); 322 322 } ··· 348 348 platform_device_register(&at91sam9g45_eth_device); 349 349 } 350 350 #else 351 - void __init at91_add_device_eth(struct at91_eth_data *data) {} 351 + void __init at91_add_device_eth(struct macb_platform_data *data) {} 352 352 #endif 353 353 354 354 ··· 449 449 450 450 451 451 /* input/irq */ 452 - if (data->slot[0].detect_pin) { 452 + if (gpio_is_valid(data->slot[0].detect_pin)) { 453 453 at91_set_gpio_input(data->slot[0].detect_pin, 1); 454 454 at91_set_deglitch(data->slot[0].detect_pin, 1); 455 455 } 456 - if (data->slot[0].wp_pin) 456 + if (gpio_is_valid(data->slot[0].wp_pin)) 457 457 at91_set_gpio_input(data->slot[0].wp_pin, 1); 458 458 459 459 if (mmc_id == 0) { /* MCI0 */ ··· 529 529 .flags = IORESOURCE_MEM, 530 530 }, 531 531 [1] = { 532 - .start = AT91_BASE_SYS + AT91_ECC, 533 - .end = AT91_BASE_SYS + AT91_ECC + SZ_512 - 1, 532 + .start = AT91SAM9G45_BASE_ECC, 533 + .end = AT91SAM9G45_BASE_ECC + SZ_512 - 1, 534 534 .flags = IORESOURCE_MEM, 535 535 } 536 536 }; ··· 556 556 at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_EBI_CS3A_SMC_SMARTMEDIA); 557 557 558 558 /* enable pin */ 559 - if (data->enable_pin) 559 + if (gpio_is_valid(data->enable_pin)) 560 560 at91_set_gpio_output(data->enable_pin, 1); 561 561 562 562 /* ready/busy pin */ 563 - if (data->rdy_pin) 563 + if (gpio_is_valid(data->rdy_pin)) 564 564 at91_set_gpio_input(data->rdy_pin, 1); 565 565 566 566 /* card detect pin */ 567 - if (data->det_pin) 567 + if (gpio_is_valid(data->det_pin)) 568 568 at91_set_gpio_input(data->det_pin, 1); 569 569 570 570 nand_data = *data; ··· 859 859 at91_set_A_periph(AT91_PIN_PD6, 0); /* AC97RX */ 860 860 861 861 /* reset */ 862 - if (data->reset_pin) 862 + if (gpio_is_valid(data->reset_pin)) 863 863 at91_set_gpio_output(data->reset_pin, 0); 864 864 865 865 ac97_data = *data; ··· 1009 1009 * -------------------------------------------------------------------- */ 1010 1010 1011 1011 #if defined(CONFIG_RTC_DRV_AT91RM9200) || defined(CONFIG_RTC_DRV_AT91RM9200_MODULE) 1012 + static struct resource rtc_resources[] = { 1013 + [0] = { 1014 + .start = AT91SAM9G45_BASE_RTC, 1015 + .end = AT91SAM9G45_BASE_RTC + SZ_256 - 1, 1016 + .flags = IORESOURCE_MEM, 1017 + }, 1018 + [1] = { 1019 + .start = AT91_ID_SYS, 1020 + .end = AT91_ID_SYS, 1021 + .flags = IORESOURCE_IRQ, 1022 + }, 1023 + }; 1024 + 1012 1025 static struct platform_device at91sam9g45_rtc_device = { 1013 1026 .name = "at91_rtc", 1014 1027 .id = -1, 1015 - .num_resources = 0, 1028 + .resource = rtc_resources, 1029 + .num_resources = ARRAY_SIZE(rtc_resources), 1016 1030 }; 1017 1031 1018 1032 static void __init at91_add_device_rtc(void) ··· 1095 1081 1096 1082 static struct resource rtt_resources[] = { 1097 1083 { 1098 - .start = AT91_BASE_SYS + AT91_RTT, 1099 - .end = AT91_BASE_SYS + AT91_RTT + SZ_16 - 1, 1084 + .start = AT91SAM9G45_BASE_RTT, 1085 + .end = AT91SAM9G45_BASE_RTT + SZ_16 - 1, 1100 1086 .flags = IORESOURCE_MEM, 1101 1087 } 1102 1088 }; ··· 1147 1133 * -------------------------------------------------------------------- */ 1148 1134 1149 1135 #if defined(CONFIG_AT91SAM9X_WATCHDOG) || defined(CONFIG_AT91SAM9X_WATCHDOG_MODULE) 1136 + static struct resource wdt_resources[] = { 1137 + { 1138 + .start = AT91SAM9G45_BASE_WDT, 1139 + .end = AT91SAM9G45_BASE_WDT + SZ_16 - 1, 1140 + .flags = IORESOURCE_MEM, 1141 + } 1142 + }; 1143 + 1150 1144 static struct platform_device at91sam9g45_wdt_device = { 1151 1145 .name = "at91_wdt", 1152 1146 .id = -1, 1153 - .num_resources = 0, 1147 + .resource = wdt_resources, 1148 + .num_resources = ARRAY_SIZE(wdt_resources), 1154 1149 }; 1155 1150 1156 1151 static void __init at91_add_device_watchdog(void) ··· 1355 1332 #if defined(CONFIG_SERIAL_ATMEL) 1356 1333 static struct resource dbgu_resources[] = { 1357 1334 [0] = { 1358 - .start = AT91_BASE_SYS + AT91_DBGU, 1359 - .end = AT91_BASE_SYS + AT91_DBGU + SZ_512 - 1, 1335 + .start = AT91SAM9G45_BASE_DBGU, 1336 + .end = AT91SAM9G45_BASE_DBGU + SZ_512 - 1, 1360 1337 .flags = IORESOURCE_MEM, 1361 1338 }, 1362 1339 [1] = {
+18 -18
arch/arm/mach-at91/at91sam9rl.c
··· 10 10 */ 11 11 12 12 #include <linux/module.h> 13 - #include <linux/pm.h> 14 13 15 14 #include <asm/irq.h> 16 15 #include <asm/mach/arch.h> ··· 19 20 #include <mach/at91sam9rl.h> 20 21 #include <mach/at91_pmc.h> 21 22 #include <mach/at91_rstc.h> 22 - #include <mach/at91_shdwc.h> 23 23 24 24 #include "soc.h" 25 25 #include "generic.h" 26 26 #include "clock.h" 27 + #include "sam9_smc.h" 27 28 28 29 /* -------------------------------------------------------------------- 29 30 * Clocks ··· 183 184 CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.0", &tc2_clk), 184 185 CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk), 185 186 CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), 187 + CLKDEV_CON_ID("pioA", &pioA_clk), 188 + CLKDEV_CON_ID("pioB", &pioB_clk), 189 + CLKDEV_CON_ID("pioC", &pioC_clk), 190 + CLKDEV_CON_ID("pioD", &pioD_clk), 186 191 }; 187 192 188 193 static struct clk_lookup usart_clocks_lookups[] = { ··· 246 243 * GPIO 247 244 * -------------------------------------------------------------------- */ 248 245 249 - static struct at91_gpio_bank at91sam9rl_gpio[] = { 246 + static struct at91_gpio_bank at91sam9rl_gpio[] __initdata = { 250 247 { 251 248 .id = AT91SAM9RL_ID_PIOA, 252 - .offset = AT91_PIOA, 253 - .clock = &pioA_clk, 249 + .regbase = AT91SAM9RL_BASE_PIOA, 254 250 }, { 255 251 .id = AT91SAM9RL_ID_PIOB, 256 - .offset = AT91_PIOB, 257 - .clock = &pioB_clk, 252 + .regbase = AT91SAM9RL_BASE_PIOB, 258 253 }, { 259 254 .id = AT91SAM9RL_ID_PIOC, 260 - .offset = AT91_PIOC, 261 - .clock = &pioC_clk, 255 + .regbase = AT91SAM9RL_BASE_PIOC, 262 256 }, { 263 257 .id = AT91SAM9RL_ID_PIOD, 264 - .offset = AT91_PIOD, 265 - .clock = &pioD_clk, 258 + .regbase = AT91SAM9RL_BASE_PIOD, 266 259 } 267 260 }; 268 - 269 - static void at91sam9rl_poweroff(void) 270 - { 271 - at91_sys_write(AT91_SHDW_CR, AT91_SHDW_KEY | AT91_SHDW_SHDW); 272 - } 273 - 274 261 275 262 /* -------------------------------------------------------------------- 276 263 * AT91SAM9RL processor initialization ··· 283 290 at91_init_sram(0, AT91SAM9RL_SRAM_BASE, sram_size); 284 291 } 285 292 293 + static void __init at91sam9rl_ioremap_registers(void) 294 + { 295 + at91_ioremap_shdwc(AT91SAM9RL_BASE_SHDWC); 296 + at91sam926x_ioremap_pit(AT91SAM9RL_BASE_PIT); 297 + at91sam9_ioremap_smc(0, AT91SAM9RL_BASE_SMC); 298 + } 299 + 286 300 static void __init at91sam9rl_initialize(void) 287 301 { 288 302 arm_pm_restart = at91sam9_alt_restart; 289 - pm_power_off = at91sam9rl_poweroff; 290 303 at91_extern_irq = (1 << AT91SAM9RL_ID_IRQ0); 291 304 292 305 /* Register GPIO subsystem */ ··· 344 345 struct at91_init_soc __initdata at91sam9rl_soc = { 345 346 .map_io = at91sam9rl_map_io, 346 347 .default_irq_priority = at91sam9rl_default_irq_priority, 348 + .ioremap_registers = at91sam9rl_ioremap_registers, 347 349 .register_clocks = at91sam9rl_register_clocks, 348 350 .init = at91sam9rl_initialize, 349 351 };
+26 -17
arch/arm/mach-at91/at91sam9rl_devices.c
··· 39 39 40 40 static struct resource hdmac_resources[] = { 41 41 [0] = { 42 - .start = AT91_BASE_SYS + AT91_DMA, 43 - .end = AT91_BASE_SYS + AT91_DMA + SZ_512 - 1, 42 + .start = AT91SAM9RL_BASE_DMA, 43 + .end = AT91SAM9RL_BASE_DMA + SZ_512 - 1, 44 44 .flags = IORESOURCE_MEM, 45 45 }, 46 46 [2] = { ··· 147 147 usba_udc_data.pdata.num_ep = ARRAY_SIZE(usba_udc_ep); 148 148 memcpy(usba_udc_data.ep, usba_udc_ep, sizeof(usba_udc_ep)); 149 149 150 - if (data && data->vbus_pin > 0) { 150 + if (data && gpio_is_valid(data->vbus_pin)) { 151 151 at91_set_gpio_input(data->vbus_pin, 0); 152 152 at91_set_deglitch(data->vbus_pin, 1); 153 153 usba_udc_data.pdata.vbus_pin = data->vbus_pin; ··· 201 201 return; 202 202 203 203 /* input/irq */ 204 - if (data->det_pin) { 204 + if (gpio_is_valid(data->det_pin)) { 205 205 at91_set_gpio_input(data->det_pin, 1); 206 206 at91_set_deglitch(data->det_pin, 1); 207 207 } 208 - if (data->wp_pin) 208 + if (gpio_is_valid(data->wp_pin)) 209 209 at91_set_gpio_input(data->wp_pin, 1); 210 - if (data->vcc_pin) 210 + if (gpio_is_valid(data->vcc_pin)) 211 211 at91_set_gpio_output(data->vcc_pin, 0); 212 212 213 213 /* CLK */ ··· 248 248 .flags = IORESOURCE_MEM, 249 249 }, 250 250 [1] = { 251 - .start = AT91_BASE_SYS + AT91_ECC, 252 - .end = AT91_BASE_SYS + AT91_ECC + SZ_512 - 1, 251 + .start = AT91SAM9RL_BASE_ECC, 252 + .end = AT91SAM9RL_BASE_ECC + SZ_512 - 1, 253 253 .flags = IORESOURCE_MEM, 254 254 } 255 255 }; ··· 275 275 at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_CS3A_SMC_SMARTMEDIA); 276 276 277 277 /* enable pin */ 278 - if (data->enable_pin) 278 + if (gpio_is_valid(data->enable_pin)) 279 279 at91_set_gpio_output(data->enable_pin, 1); 280 280 281 281 /* ready/busy pin */ 282 - if (data->rdy_pin) 282 + if (gpio_is_valid(data->rdy_pin)) 283 283 at91_set_gpio_input(data->rdy_pin, 1); 284 284 285 285 /* card detect pin */ 286 - if (data->det_pin) 286 + if (gpio_is_valid(data->det_pin)) 287 287 at91_set_gpio_input(data->det_pin, 1); 288 288 289 289 at91_set_A_periph(AT91_PIN_PB4, 0); /* NANDOE */ ··· 483 483 at91_set_A_periph(AT91_PIN_PD4, 0); /* AC97RX */ 484 484 485 485 /* reset */ 486 - if (data->reset_pin) 486 + if (gpio_is_valid(data->reset_pin)) 487 487 at91_set_gpio_output(data->reset_pin, 0); 488 488 489 489 ac97_data = *data; ··· 685 685 686 686 static struct resource rtt_resources[] = { 687 687 { 688 - .start = AT91_BASE_SYS + AT91_RTT, 689 - .end = AT91_BASE_SYS + AT91_RTT + SZ_16 - 1, 688 + .start = AT91SAM9RL_BASE_RTT, 689 + .end = AT91SAM9RL_BASE_RTT + SZ_16 - 1, 690 690 .flags = IORESOURCE_MEM, 691 691 } 692 692 }; ··· 709 709 * -------------------------------------------------------------------- */ 710 710 711 711 #if defined(CONFIG_AT91SAM9X_WATCHDOG) || defined(CONFIG_AT91SAM9X_WATCHDOG_MODULE) 712 + static struct resource wdt_resources[] = { 713 + { 714 + .start = AT91SAM9RL_BASE_WDT, 715 + .end = AT91SAM9RL_BASE_WDT + SZ_16 - 1, 716 + .flags = IORESOURCE_MEM, 717 + } 718 + }; 719 + 712 720 static struct platform_device at91sam9rl_wdt_device = { 713 721 .name = "at91_wdt", 714 722 .id = -1, 715 - .num_resources = 0, 723 + .resource = wdt_resources, 724 + .num_resources = ARRAY_SIZE(wdt_resources), 716 725 }; 717 726 718 727 static void __init at91_add_device_watchdog(void) ··· 917 908 #if defined(CONFIG_SERIAL_ATMEL) 918 909 static struct resource dbgu_resources[] = { 919 910 [0] = { 920 - .start = AT91_BASE_SYS + AT91_DBGU, 921 - .end = AT91_BASE_SYS + AT91_DBGU + SZ_512 - 1, 911 + .start = AT91SAM9RL_BASE_DBGU, 912 + .end = AT91SAM9RL_BASE_DBGU + SZ_512 - 1, 922 913 .flags = IORESOURCE_MEM, 923 914 }, 924 915 [1] = {
+3 -1
arch/arm/mach-at91/board-1arm.c
··· 63 63 at91_set_serial_console(0); 64 64 } 65 65 66 - static struct at91_eth_data __initdata onearm_eth_data = { 66 + static struct macb_platform_data __initdata onearm_eth_data = { 67 67 .phy_irq_pin = AT91_PIN_PC4, 68 68 .is_rmii = 1, 69 69 }; 70 70 71 71 static struct at91_usbh_data __initdata onearm_usbh_data = { 72 72 .ports = 1, 73 + .vbus_pin = {-EINVAL, -EINVAL}, 74 + .overcurrent_pin= {-EINVAL, -EINVAL}, 73 75 }; 74 76 75 77 static struct at91_udc_data __initdata onearm_udc_data = {
+8 -2
arch/arm/mach-at91/board-afeb-9260v1.c
··· 75 75 */ 76 76 static struct at91_usbh_data __initdata afeb9260_usbh_data = { 77 77 .ports = 1, 78 + .vbus_pin = {-EINVAL, -EINVAL}, 79 + .overcurrent_pin= {-EINVAL, -EINVAL}, 78 80 }; 79 81 80 82 /* ··· 84 82 */ 85 83 static struct at91_udc_data __initdata afeb9260_udc_data = { 86 84 .vbus_pin = AT91_PIN_PC5, 87 - .pullup_pin = 0, /* pull-up driven by UDC */ 85 + .pullup_pin = -EINVAL, /* pull-up driven by UDC */ 88 86 }; 89 87 90 88 ··· 105 103 /* 106 104 * MACB Ethernet device 107 105 */ 108 - static struct at91_eth_data __initdata afeb9260_macb_data = { 106 + static struct macb_platform_data __initdata afeb9260_macb_data = { 109 107 .phy_irq_pin = AT91_PIN_PA9, 110 108 .is_rmii = 0, 111 109 }; ··· 140 138 .bus_width_16 = 0, 141 139 .parts = afeb9260_nand_partition, 142 140 .num_parts = ARRAY_SIZE(afeb9260_nand_partition), 141 + .det_pin = -EINVAL, 143 142 }; 144 143 145 144 ··· 152 149 .wp_pin = AT91_PIN_PC4, 153 150 .slot_b = 1, 154 151 .wire4 = 1, 152 + .vcc_pin = -EINVAL, 155 153 }; 156 154 157 155 ··· 173 169 static struct at91_cf_data afeb9260_cf_data = { 174 170 .chipselect = 4, 175 171 .irq_pin = AT91_PIN_PA6, 172 + .det_pin = -EINVAL, 173 + .vcc_pin = -EINVAL, 176 174 .rst_pin = AT91_PIN_PA7, 177 175 .flags = AT91_CF_TRUE_IDE, 178 176 };
+5 -3
arch/arm/mach-at91/board-cam60.c
··· 62 62 */ 63 63 static struct at91_usbh_data __initdata cam60_usbh_data = { 64 64 .ports = 1, 65 + .vbus_pin = {-EINVAL, -EINVAL}, 66 + .overcurrent_pin= {-EINVAL, -EINVAL}, 65 67 }; 66 68 67 69 ··· 117 115 /* 118 116 * MACB Ethernet device 119 117 */ 120 - static struct __initdata at91_eth_data cam60_macb_data = { 118 + static struct __initdata macb_platform_data cam60_macb_data = { 121 119 .phy_irq_pin = AT91_PIN_PB5, 122 120 .is_rmii = 0, 123 121 }; ··· 137 135 static struct atmel_nand_data __initdata cam60_nand_data = { 138 136 .ale = 21, 139 137 .cle = 22, 140 - // .det_pin = ... not there 138 + .det_pin = -EINVAL, 141 139 .rdy_pin = AT91_PIN_PA9, 142 140 .enable_pin = AT91_PIN_PA7, 143 141 .parts = cam60_nand_partition, ··· 165 163 static void __init cam60_add_device_nand(void) 166 164 { 167 165 /* configure chip-select 3 (NAND) */ 168 - sam9_smc_configure(3, &cam60_nand_smc_config); 166 + sam9_smc_configure(0, 3, &cam60_nand_smc_config); 169 167 170 168 at91_add_device_nand(&cam60_nand_data); 171 169 }
+12 -9
arch/arm/mach-at91/board-cap9adk.c
··· 70 70 */ 71 71 static struct at91_usbh_data __initdata cap9adk_usbh_data = { 72 72 .ports = 2, 73 + .vbus_pin = {-EINVAL, -EINVAL}, 74 + .overcurrent_pin= {-EINVAL, -EINVAL}, 73 75 }; 74 76 75 77 /* ··· 146 144 */ 147 145 static struct at91_mmc_data __initdata cap9adk_mmc_data = { 148 146 .wire4 = 1, 149 - // .det_pin = ... not connected 150 - // .wp_pin = ... not connected 151 - // .vcc_pin = ... not connected 147 + .det_pin = -EINVAL, 148 + .wp_pin = -EINVAL, 149 + .vcc_pin = -EINVAL, 152 150 }; 153 151 154 152 155 153 /* 156 154 * MACB Ethernet device 157 155 */ 158 - static struct at91_eth_data __initdata cap9adk_macb_data = { 156 + static struct macb_platform_data __initdata cap9adk_macb_data = { 157 + .phy_irq_pin = -EINVAL, 159 158 .is_rmii = 1, 160 159 }; 161 160 ··· 175 172 static struct atmel_nand_data __initdata cap9adk_nand_data = { 176 173 .ale = 21, 177 174 .cle = 22, 178 - // .det_pin = ... not connected 179 - // .rdy_pin = ... not connected 175 + .det_pin = -EINVAL, 176 + .rdy_pin = -EINVAL, 180 177 .enable_pin = AT91_PIN_PD15, 181 178 .parts = cap9adk_nand_partitions, 182 179 .num_parts = ARRAY_SIZE(cap9adk_nand_partitions), ··· 215 212 cap9adk_nand_smc_config.mode |= AT91_SMC_DBW_8; 216 213 217 214 /* configure chip-select 3 (NAND) */ 218 - sam9_smc_configure(3, &cap9adk_nand_smc_config); 215 + sam9_smc_configure(0, 3, &cap9adk_nand_smc_config); 219 216 220 217 at91_add_device_nand(&cap9adk_nand_data); 221 218 } ··· 285 282 at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_EBI_VDDIOMSEL_3_3V); 286 283 287 284 /* configure chip-select 0 (NOR) */ 288 - sam9_smc_configure(0, &cap9adk_nor_smc_config); 285 + sam9_smc_configure(0, 0, &cap9adk_nor_smc_config); 289 286 290 287 platform_device_register(&cap9adk_nor_flash); 291 288 } ··· 354 351 * AC97 355 352 */ 356 353 static struct ac97c_platform_data cap9adk_ac97_data = { 357 - // .reset_pin = ... not connected 354 + .reset_pin = -EINVAL, 358 355 }; 359 356 360 357
+6 -3
arch/arm/mach-at91/board-carmeva.c
··· 57 57 at91_set_serial_console(0); 58 58 } 59 59 60 - static struct at91_eth_data __initdata carmeva_eth_data = { 60 + static struct macb_platform_data __initdata carmeva_eth_data = { 61 61 .phy_irq_pin = AT91_PIN_PC4, 62 62 .is_rmii = 1, 63 63 }; 64 64 65 65 static struct at91_usbh_data __initdata carmeva_usbh_data = { 66 66 .ports = 2, 67 + .vbus_pin = {-EINVAL, -EINVAL}, 68 + .overcurrent_pin= {-EINVAL, -EINVAL}, 67 69 }; 68 70 69 71 static struct at91_udc_data __initdata carmeva_udc_data = { ··· 77 75 // static struct at91_cf_data __initdata carmeva_cf_data = { 78 76 // .det_pin = AT91_PIN_PB0, 79 77 // .rst_pin = AT91_PIN_PC5, 80 - // .irq_pin = ... not connected 81 - // .vcc_pin = ... always powered 78 + // .irq_pin = -EINVAL, 79 + // .vcc_pin = -EINVAL, 82 80 // }; 83 81 84 82 static struct at91_mmc_data __initdata carmeva_mmc_data = { ··· 86 84 .wire4 = 1, 87 85 .det_pin = AT91_PIN_PB10, 88 86 .wp_pin = AT91_PIN_PC14, 87 + .vcc_pin = -EINVAL, 89 88 }; 90 89 91 90 static struct spi_board_info carmeva_spi_devices[] = {
+10 -4
arch/arm/mach-at91/board-cpu9krea.c
··· 86 86 */ 87 87 static struct at91_usbh_data __initdata cpu9krea_usbh_data = { 88 88 .ports = 2, 89 + .vbus_pin = {-EINVAL, -EINVAL}, 90 + .overcurrent_pin= {-EINVAL, -EINVAL}, 89 91 }; 90 92 91 93 /* ··· 95 93 */ 96 94 static struct at91_udc_data __initdata cpu9krea_udc_data = { 97 95 .vbus_pin = AT91_PIN_PC8, 98 - .pullup_pin = 0, /* pull-up driven by UDC */ 96 + .pullup_pin = -EINVAL, /* pull-up driven by UDC */ 99 97 }; 100 98 101 99 /* 102 100 * MACB Ethernet device 103 101 */ 104 - static struct at91_eth_data __initdata cpu9krea_macb_data = { 102 + static struct macb_platform_data __initdata cpu9krea_macb_data = { 103 + .phy_irq_pin = -EINVAL, 105 104 .is_rmii = 1, 106 105 }; 107 106 ··· 115 112 .rdy_pin = AT91_PIN_PC13, 116 113 .enable_pin = AT91_PIN_PC14, 117 114 .bus_width_16 = 0, 115 + .det_pin = -EINVAL, 118 116 }; 119 117 120 118 #ifdef CONFIG_MACH_CPU9260 ··· 160 156 161 157 static void __init cpu9krea_add_device_nand(void) 162 158 { 163 - sam9_smc_configure(3, &cpu9krea_nand_smc_config); 159 + sam9_smc_configure(0, 3, &cpu9krea_nand_smc_config); 164 160 at91_add_device_nand(&cpu9krea_nand_data); 165 161 } 166 162 ··· 242 238 at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_VDDIOMSEL_3_3V); 243 239 244 240 /* configure chip-select 0 (NOR) */ 245 - sam9_smc_configure(0, &cpu9krea_nor_smc_config); 241 + sam9_smc_configure(0, 0, &cpu9krea_nor_smc_config); 246 242 247 243 platform_device_register(&cpu9krea_nor_flash); 248 244 } ··· 341 337 .slot_b = 0, 342 338 .wire4 = 1, 343 339 .det_pin = AT91_PIN_PA29, 340 + .wp_pin = -EINVAL, 341 + .vcc_pin = -EINVAL, 344 342 }; 345 343 346 344 static void __init cpu9krea_board_init(void)
+6 -1
arch/arm/mach-at91/board-cpuat91.c
··· 82 82 at91_set_serial_console(0); 83 83 } 84 84 85 - static struct at91_eth_data __initdata cpuat91_eth_data = { 85 + static struct macb_platform_data __initdata cpuat91_eth_data = { 86 + .phy_irq_pin = -EINVAL, 86 87 .is_rmii = 1, 87 88 }; 88 89 89 90 static struct at91_usbh_data __initdata cpuat91_usbh_data = { 90 91 .ports = 1, 92 + .vbus_pin = {-EINVAL, -EINVAL}, 93 + .overcurrent_pin= {-EINVAL, -EINVAL}, 91 94 }; 92 95 93 96 static struct at91_udc_data __initdata cpuat91_udc_data = { ··· 101 98 static struct at91_mmc_data __initdata cpuat91_mmc_data = { 102 99 .det_pin = AT91_PIN_PC2, 103 100 .wire4 = 1, 101 + .wp_pin = -EINVAL, 102 + .vcc_pin = -EINVAL, 104 103 }; 105 104 106 105 static struct physmap_flash_data cpuat91_flash_data = {
+5 -2
arch/arm/mach-at91/board-csb337.c
··· 58 58 at91_set_serial_console(0); 59 59 } 60 60 61 - static struct at91_eth_data __initdata csb337_eth_data = { 61 + static struct macb_platform_data __initdata csb337_eth_data = { 62 62 .phy_irq_pin = AT91_PIN_PC2, 63 63 .is_rmii = 0, 64 64 }; 65 65 66 66 static struct at91_usbh_data __initdata csb337_usbh_data = { 67 67 .ports = 2, 68 + .vbus_pin = {-EINVAL, -EINVAL}, 69 + .overcurrent_pin= {-EINVAL, -EINVAL}, 68 70 }; 69 71 70 72 static struct at91_udc_data __initdata csb337_udc_data = { 71 - // this has no VBUS sensing pin 72 73 .pullup_pin = AT91_PIN_PA24, 74 + .vbus_pin = -EINVAL, 73 75 }; 74 76 75 77 static struct i2c_board_info __initdata csb337_i2c_devices[] = { ··· 100 98 .slot_b = 0, 101 99 .wire4 = 1, 102 100 .wp_pin = AT91_PIN_PD6, 101 + .vcc_pin = -EINVAL, 103 102 }; 104 103 105 104 static struct spi_board_info csb337_spi_devices[] = {
+3 -1
arch/arm/mach-at91/board-csb637.c
··· 52 52 at91_set_serial_console(0); 53 53 } 54 54 55 - static struct at91_eth_data __initdata csb637_eth_data = { 55 + static struct macb_platform_data __initdata csb637_eth_data = { 56 56 .phy_irq_pin = AT91_PIN_PC0, 57 57 .is_rmii = 0, 58 58 }; 59 59 60 60 static struct at91_usbh_data __initdata csb637_usbh_data = { 61 61 .ports = 2, 62 + .vbus_pin = {-EINVAL, -EINVAL}, 63 + .overcurrent_pin= {-EINVAL, -EINVAL}, 62 64 }; 63 65 64 66 static struct at91_udc_data __initdata csb637_udc_data = {
+2 -1
arch/arm/mach-at91/board-dt.c
··· 50 50 static struct atmel_nand_data __initdata ek_nand_data = { 51 51 .ale = 21, 52 52 .cle = 22, 53 + .det_pin = -EINVAL, 53 54 .rdy_pin = AT91_PIN_PC8, 54 55 .enable_pin = AT91_PIN_PC14, 55 56 }; ··· 83 82 ek_nand_smc_config.mode |= AT91_SMC_DBW_8; 84 83 85 84 /* configure chip-select 3 (NAND) */ 86 - sam9_smc_configure(3, &ek_nand_smc_config); 85 + sam9_smc_configure(0, 3, &ek_nand_smc_config); 87 86 88 87 at91_add_device_nand(&ek_nand_data); 89 88 }
+8 -3
arch/arm/mach-at91/board-eb9200.c
··· 60 60 at91_set_serial_console(0); 61 61 } 62 62 63 - static struct at91_eth_data __initdata eb9200_eth_data = { 63 + static struct macb_platform_data __initdata eb9200_eth_data = { 64 64 .phy_irq_pin = AT91_PIN_PC4, 65 65 .is_rmii = 1, 66 66 }; 67 67 68 68 static struct at91_usbh_data __initdata eb9200_usbh_data = { 69 69 .ports = 2, 70 + .vbus_pin = {-EINVAL, -EINVAL}, 71 + .overcurrent_pin= {-EINVAL, -EINVAL}, 70 72 }; 71 73 72 74 static struct at91_udc_data __initdata eb9200_udc_data = { ··· 77 75 }; 78 76 79 77 static struct at91_cf_data __initdata eb9200_cf_data = { 78 + .irq_pin = -EINVAL, 80 79 .det_pin = AT91_PIN_PB0, 80 + .vcc_pin = -EINVAL, 81 81 .rst_pin = AT91_PIN_PC5, 82 - // .irq_pin = ... not connected 83 - // .vcc_pin = ... always powered 84 82 }; 85 83 86 84 static struct at91_mmc_data __initdata eb9200_mmc_data = { 87 85 .slot_b = 0, 88 86 .wire4 = 1, 87 + .det_pin = -EINVAL, 88 + .wp_pin = -EINVAL, 89 + .vcc_pin = -EINVAL, 89 90 }; 90 91 91 92 static struct i2c_board_info __initdata eb9200_i2c_devices[] = {
+6 -1
arch/arm/mach-at91/board-ecbat91.c
··· 64 64 at91_set_serial_console(0); 65 65 } 66 66 67 - static struct at91_eth_data __initdata ecb_at91eth_data = { 67 + static struct macb_platform_data __initdata ecb_at91eth_data = { 68 68 .phy_irq_pin = AT91_PIN_PC4, 69 69 .is_rmii = 0, 70 70 }; 71 71 72 72 static struct at91_usbh_data __initdata ecb_at91usbh_data = { 73 73 .ports = 1, 74 + .vbus_pin = {-EINVAL, -EINVAL}, 75 + .overcurrent_pin= {-EINVAL, -EINVAL}, 74 76 }; 75 77 76 78 static struct at91_mmc_data __initdata ecb_at91mmc_data = { 77 79 .slot_b = 0, 78 80 .wire4 = 1, 81 + .det_pin = -EINVAL, 82 + .wp_pin = -EINVAL, 83 + .vcc_pin = -EINVAL, 79 84 }; 80 85 81 86
+6 -1
arch/arm/mach-at91/board-eco920.c
··· 47 47 at91_set_serial_console(0); 48 48 } 49 49 50 - static struct at91_eth_data __initdata eco920_eth_data = { 50 + static struct macb_platform_data __initdata eco920_eth_data = { 51 51 .phy_irq_pin = AT91_PIN_PC2, 52 52 .is_rmii = 1, 53 53 }; 54 54 55 55 static struct at91_usbh_data __initdata eco920_usbh_data = { 56 56 .ports = 1, 57 + .vbus_pin = {-EINVAL, -EINVAL}, 58 + .overcurrent_pin= {-EINVAL, -EINVAL}, 57 59 }; 58 60 59 61 static struct at91_udc_data __initdata eco920_udc_data = { ··· 66 64 static struct at91_mmc_data __initdata eco920_mmc_data = { 67 65 .slot_b = 0, 68 66 .wire4 = 0, 67 + .det_pin = -EINVAL, 68 + .wp_pin = -EINVAL, 69 + .vcc_pin = -EINVAL, 69 70 }; 70 71 71 72 static struct physmap_flash_data eco920_flash_data = {
+4 -1
arch/arm/mach-at91/board-flexibity.c
··· 52 52 /* USB Host port */ 53 53 static struct at91_usbh_data __initdata flexibity_usbh_data = { 54 54 .ports = 2, 55 + .vbus_pin = {-EINVAL, -EINVAL}, 56 + .overcurrent_pin= {-EINVAL, -EINVAL}, 55 57 }; 56 58 57 59 /* USB Device port */ 58 60 static struct at91_udc_data __initdata flexibity_udc_data = { 59 61 .vbus_pin = AT91_PIN_PC5, 60 - .pullup_pin = 0, /* pull-up driven by UDC */ 62 + .pullup_pin = -EINVAL, /* pull-up driven by UDC */ 61 63 }; 62 64 63 65 /* SPI devices */ ··· 78 76 .wire4 = 1, 79 77 .det_pin = AT91_PIN_PC9, 80 78 .wp_pin = AT91_PIN_PC4, 79 + .vcc_pin = -EINVAL, 81 80 }; 82 81 83 82 /* LEDs */
+7 -2
arch/arm/mach-at91/board-foxg20.c
··· 106 106 */ 107 107 static struct at91_usbh_data __initdata foxg20_usbh_data = { 108 108 .ports = 2, 109 + .vbus_pin = {-EINVAL, -EINVAL}, 110 + .overcurrent_pin= {-EINVAL, -EINVAL}, 109 111 }; 110 112 111 113 /* ··· 115 113 */ 116 114 static struct at91_udc_data __initdata foxg20_udc_data = { 117 115 .vbus_pin = AT91_PIN_PC6, 118 - .pullup_pin = 0, /* pull-up driven by UDC */ 116 + .pullup_pin = -EINVAL, /* pull-up driven by UDC */ 119 117 }; 120 118 121 119 ··· 137 135 /* 138 136 * MACB Ethernet device 139 137 */ 140 - static struct at91_eth_data __initdata foxg20_macb_data = { 138 + static struct macb_platform_data __initdata foxg20_macb_data = { 141 139 .phy_irq_pin = AT91_PIN_PA7, 142 140 .is_rmii = 1, 143 141 }; ··· 149 147 static struct at91_mmc_data __initdata foxg20_mmc_data = { 150 148 .slot_b = 1, 151 149 .wire4 = 1, 150 + .det_pin = -EINVAL, 151 + .wp_pin = -EINVAL, 152 + .vcc_pin = -EINVAL, 152 153 }; 153 154 154 155
+5 -2
arch/arm/mach-at91/board-gsia18s.c
··· 80 80 */ 81 81 static struct at91_usbh_data __initdata usbh_data = { 82 82 .ports = 2, 83 + .vbus_pin = {-EINVAL, -EINVAL}, 84 + .overcurrent_pin= {-EINVAL, -EINVAL}, 83 85 }; 84 86 85 87 /* ··· 89 87 */ 90 88 static struct at91_udc_data __initdata udc_data = { 91 89 .vbus_pin = AT91_PIN_PA22, 92 - .pullup_pin = 0, /* pull-up driven by UDC */ 90 + .pullup_pin = -EINVAL, /* pull-up driven by UDC */ 93 91 }; 94 92 95 93 /* 96 94 * MACB Ethernet device 97 95 */ 98 - static struct at91_eth_data __initdata macb_data = { 96 + static struct macb_platform_data __initdata macb_data = { 99 97 .phy_irq_pin = AT91_PIN_PA28, 100 98 .is_rmii = 1, 101 99 }; ··· 532 530 static struct at91_cf_data __initdata gsia18s_cf1_data = { 533 531 .irq_pin = AT91_PIN_PA27, 534 532 .det_pin = AT91_PIN_PB30, 533 + .vcc_pin = -EINVAL, 535 534 .rst_pin = AT91_PIN_PB31, 536 535 .chipselect = 5, 537 536 .flags = AT91_CF_TRUE_IDE,
+3 -1
arch/arm/mach-at91/board-kafa.c
··· 61 61 at91_set_serial_console(0); 62 62 } 63 63 64 - static struct at91_eth_data __initdata kafa_eth_data = { 64 + static struct macb_platform_data __initdata kafa_eth_data = { 65 65 .phy_irq_pin = AT91_PIN_PC4, 66 66 .is_rmii = 0, 67 67 }; 68 68 69 69 static struct at91_usbh_data __initdata kafa_usbh_data = { 70 70 .ports = 1, 71 + .vbus_pin = {-EINVAL, -EINVAL}, 72 + .overcurrent_pin= {-EINVAL, -EINVAL}, 71 73 }; 72 74 73 75 static struct at91_udc_data __initdata kafa_udc_data = {
+6 -2
arch/arm/mach-at91/board-kb9202.c
··· 69 69 at91_set_serial_console(0); 70 70 } 71 71 72 - static struct at91_eth_data __initdata kb9202_eth_data = { 72 + static struct macb_platform_data __initdata kb9202_eth_data = { 73 73 .phy_irq_pin = AT91_PIN_PB29, 74 74 .is_rmii = 0, 75 75 }; 76 76 77 77 static struct at91_usbh_data __initdata kb9202_usbh_data = { 78 78 .ports = 1, 79 + .vbus_pin = {-EINVAL, -EINVAL}, 80 + .overcurrent_pin= {-EINVAL, -EINVAL}, 79 81 }; 80 82 81 83 static struct at91_udc_data __initdata kb9202_udc_data = { ··· 89 87 .det_pin = AT91_PIN_PB2, 90 88 .slot_b = 0, 91 89 .wire4 = 1, 90 + .wp_pin = -EINVAL, 91 + .vcc_pin = -EINVAL, 92 92 }; 93 93 94 94 static struct mtd_partition __initdata kb9202_nand_partition[] = { ··· 104 100 static struct atmel_nand_data __initdata kb9202_nand_data = { 105 101 .ale = 22, 106 102 .cle = 21, 107 - // .det_pin = ... not there 103 + .det_pin = -EINVAL, 108 104 .rdy_pin = AT91_PIN_PC29, 109 105 .enable_pin = AT91_PIN_PC28, 110 106 .parts = kb9202_nand_partition,
+6 -3
arch/arm/mach-at91/board-neocore926.c
··· 72 72 static struct at91_usbh_data __initdata neocore926_usbh_data = { 73 73 .ports = 2, 74 74 .vbus_pin = { AT91_PIN_PA24, AT91_PIN_PA21 }, 75 + .overcurrent_pin= {-EINVAL, -EINVAL}, 75 76 }; 76 77 77 78 /* ··· 80 79 */ 81 80 static struct at91_udc_data __initdata neocore926_udc_data = { 82 81 .vbus_pin = AT91_PIN_PA25, 83 - .pullup_pin = 0, /* pull-up driven by UDC */ 82 + .pullup_pin = -EINVAL, /* pull-up driven by UDC */ 84 83 }; 85 84 86 85 ··· 150 149 .wire4 = 1, 151 150 .det_pin = AT91_PIN_PE18, 152 151 .wp_pin = AT91_PIN_PE19, 152 + .vcc_pin = -EINVAL, 153 153 }; 154 154 155 155 156 156 /* 157 157 * MACB Ethernet device 158 158 */ 159 - static struct at91_eth_data __initdata neocore926_macb_data = { 159 + static struct macb_platform_data __initdata neocore926_macb_data = { 160 160 .phy_irq_pin = AT91_PIN_PE31, 161 161 .is_rmii = 1, 162 162 }; ··· 192 190 .enable_pin = AT91_PIN_PD15, 193 191 .parts = neocore926_nand_partition, 194 192 .num_parts = ARRAY_SIZE(neocore926_nand_partition), 193 + .det_pin = -EINVAL, 195 194 }; 196 195 197 196 static struct sam9_smc_config __initdata neocore926_nand_smc_config = { ··· 216 213 static void __init neocore926_add_device_nand(void) 217 214 { 218 215 /* configure chip-select 3 (NAND) */ 219 - sam9_smc_configure(3, &neocore926_nand_smc_config); 216 + sam9_smc_configure(0, 3, &neocore926_nand_smc_config); 220 217 221 218 at91_add_device_nand(&neocore926_nand_data); 222 219 }
+5 -3
arch/arm/mach-at91/board-pcontrol-g20.c
··· 96 96 static void __init add_device_pcontrol(void) 97 97 { 98 98 /* configure chip-select 4 (IO compatible to 8051 X4 ) */ 99 - sam9_smc_configure(4, &pcontrol_smc_config[0]); 99 + sam9_smc_configure(0, 4, &pcontrol_smc_config[0]); 100 100 /* configure chip-select 7 (FerroRAM 256KiBx16bit MR2A16A D4 ) */ 101 - sam9_smc_configure(7, &pcontrol_smc_config[1]); 101 + sam9_smc_configure(0, 7, &pcontrol_smc_config[1]); 102 102 } 103 103 104 104 ··· 107 107 */ 108 108 static struct at91_usbh_data __initdata usbh_data = { 109 109 .ports = 2, 110 + .vbus_pin = {-EINVAL, -EINVAL}, 111 + .overcurrent_pin= {-EINVAL, -EINVAL}, 110 112 }; 111 113 112 114 ··· 124 122 /* 125 123 * MACB Ethernet device 126 124 */ 127 - static struct at91_eth_data __initdata macb_data = { 125 + static struct macb_platform_data __initdata macb_data = { 128 126 .phy_irq_pin = AT91_PIN_PA28, 129 127 .is_rmii = 1, 130 128 };
+4 -1
arch/arm/mach-at91/board-picotux200.c
··· 60 60 at91_set_serial_console(0); 61 61 } 62 62 63 - static struct at91_eth_data __initdata picotux200_eth_data = { 63 + static struct macb_platform_data __initdata picotux200_eth_data = { 64 64 .phy_irq_pin = AT91_PIN_PC4, 65 65 .is_rmii = 1, 66 66 }; 67 67 68 68 static struct at91_usbh_data __initdata picotux200_usbh_data = { 69 69 .ports = 1, 70 + .vbus_pin = {-EINVAL, -EINVAL}, 71 + .overcurrent_pin= {-EINVAL, -EINVAL}, 70 72 }; 71 73 72 74 static struct at91_mmc_data __initdata picotux200_mmc_data = { ··· 76 74 .slot_b = 0, 77 75 .wire4 = 1, 78 76 .wp_pin = AT91_PIN_PA17, 77 + .vcc_pin = -EINVAL, 79 78 }; 80 79 81 80 #define PICOTUX200_FLASH_BASE AT91_CHIPSELECT_0
+10 -8
arch/arm/mach-at91/board-qil-a9260.c
··· 77 77 */ 78 78 static struct at91_usbh_data __initdata ek_usbh_data = { 79 79 .ports = 2, 80 + .vbus_pin = {-EINVAL, -EINVAL}, 81 + .overcurrent_pin= {-EINVAL, -EINVAL}, 80 82 }; 81 83 82 84 /* ··· 86 84 */ 87 85 static struct at91_udc_data __initdata ek_udc_data = { 88 86 .vbus_pin = AT91_PIN_PC5, 89 - .pullup_pin = 0, /* pull-up driven by UDC */ 87 + .pullup_pin = -EINVAL, /* pull-up driven by UDC */ 90 88 }; 91 89 92 90 /* ··· 106 104 /* 107 105 * MACB Ethernet device 108 106 */ 109 - static struct at91_eth_data __initdata ek_macb_data = { 107 + static struct macb_platform_data __initdata ek_macb_data = { 110 108 .phy_irq_pin = AT91_PIN_PA31, 111 109 .is_rmii = 1, 112 110 }; ··· 135 133 static struct atmel_nand_data __initdata ek_nand_data = { 136 134 .ale = 21, 137 135 .cle = 22, 138 - // .det_pin = ... not connected 136 + .det_pin = -EINVAL, 139 137 .rdy_pin = AT91_PIN_PC13, 140 138 .enable_pin = AT91_PIN_PC14, 141 139 .parts = ek_nand_partition, ··· 163 161 static void __init ek_add_device_nand(void) 164 162 { 165 163 /* configure chip-select 3 (NAND) */ 166 - sam9_smc_configure(3, &ek_nand_smc_config); 164 + sam9_smc_configure(0, 3, &ek_nand_smc_config); 167 165 168 166 at91_add_device_nand(&ek_nand_data); 169 167 } ··· 174 172 static struct at91_mmc_data __initdata ek_mmc_data = { 175 173 .slot_b = 0, 176 174 .wire4 = 1, 177 - // .det_pin = ... not connected 178 - // .wp_pin = ... not connected 179 - // .vcc_pin = ... not connected 175 + .det_pin = -EINVAL, 176 + .wp_pin = -EINVAL, 177 + .vcc_pin = -EINVAL, 180 178 }; 181 179 182 180 /* ··· 253 251 /* LEDs */ 254 252 at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds)); 255 253 /* shutdown controller, wakeup button (5 msec low) */ 256 - at91_sys_write(AT91_SHDW_MR, AT91_SHDW_CPTWK0_(10) | AT91_SHDW_WKMODE0_LOW 254 + at91_shdwc_write(AT91_SHDW_MR, AT91_SHDW_CPTWK0_(10) | AT91_SHDW_WKMODE0_LOW 257 255 | AT91_SHDW_RTTWKEN); 258 256 } 259 257
+9 -4
arch/arm/mach-at91/board-rm9200dk.c
··· 65 65 at91_set_serial_console(0); 66 66 } 67 67 68 - static struct at91_eth_data __initdata dk_eth_data = { 68 + static struct macb_platform_data __initdata dk_eth_data = { 69 69 .phy_irq_pin = AT91_PIN_PC4, 70 70 .is_rmii = 1, 71 71 }; 72 72 73 73 static struct at91_usbh_data __initdata dk_usbh_data = { 74 74 .ports = 2, 75 + .vbus_pin = {-EINVAL, -EINVAL}, 76 + .overcurrent_pin= {-EINVAL, -EINVAL}, 75 77 }; 76 78 77 79 static struct at91_udc_data __initdata dk_udc_data = { ··· 82 80 }; 83 81 84 82 static struct at91_cf_data __initdata dk_cf_data = { 83 + .irq_pin = -EINVAL, 85 84 .det_pin = AT91_PIN_PB0, 85 + .vcc_pin = -EINVAL, 86 86 .rst_pin = AT91_PIN_PC5, 87 - // .irq_pin = ... not connected 88 - // .vcc_pin = ... always powered 89 87 }; 90 88 91 89 #ifndef CONFIG_MTD_AT91_DATAFLASH_CARD 92 90 static struct at91_mmc_data __initdata dk_mmc_data = { 93 91 .slot_b = 0, 94 92 .wire4 = 1, 93 + .det_pin = -EINVAL, 94 + .wp_pin = -EINVAL, 95 + .vcc_pin = -EINVAL, 95 96 }; 96 97 #endif 97 98 ··· 148 143 .cle = 21, 149 144 .det_pin = AT91_PIN_PB1, 150 145 .rdy_pin = AT91_PIN_PC2, 151 - // .enable_pin = ... not there 146 + .enable_pin = -EINVAL, 152 147 .parts = dk_nand_partition, 153 148 .num_parts = ARRAY_SIZE(dk_nand_partition), 154 149 };
+4 -1
arch/arm/mach-at91/board-rm9200ek.c
··· 65 65 at91_set_serial_console(0); 66 66 } 67 67 68 - static struct at91_eth_data __initdata ek_eth_data = { 68 + static struct macb_platform_data __initdata ek_eth_data = { 69 69 .phy_irq_pin = AT91_PIN_PC4, 70 70 .is_rmii = 1, 71 71 }; 72 72 73 73 static struct at91_usbh_data __initdata ek_usbh_data = { 74 74 .ports = 2, 75 + .vbus_pin = {-EINVAL, -EINVAL}, 76 + .overcurrent_pin= {-EINVAL, -EINVAL}, 75 77 }; 76 78 77 79 static struct at91_udc_data __initdata ek_udc_data = { ··· 87 85 .slot_b = 0, 88 86 .wire4 = 1, 89 87 .wp_pin = AT91_PIN_PA17, 88 + .vcc_pin = -EINVAL, 90 89 }; 91 90 #endif 92 91
+3 -1
arch/arm/mach-at91/board-rsi-ews.c
··· 60 60 /* 61 61 * Ethernet 62 62 */ 63 - static struct at91_eth_data rsi_ews_eth_data __initdata = { 63 + static struct macb_platform_data rsi_ews_eth_data __initdata = { 64 64 .phy_irq_pin = AT91_PIN_PC4, 65 65 .is_rmii = 1, 66 66 }; ··· 70 70 */ 71 71 static struct at91_usbh_data rsi_ews_usbh_data __initdata = { 72 72 .ports = 1, 73 + .vbus_pin = {-EINVAL, -EINVAL}, 74 + .overcurrent_pin= {-EINVAL, -EINVAL}, 73 75 }; 74 76 75 77 /*
+7 -5
arch/arm/mach-at91/board-sam9-l9260.c
··· 72 72 */ 73 73 static struct at91_usbh_data __initdata ek_usbh_data = { 74 74 .ports = 2, 75 + .vbus_pin = {-EINVAL, -EINVAL}, 76 + .overcurrent_pin= {-EINVAL, -EINVAL}, 75 77 }; 76 78 77 79 /* ··· 81 79 */ 82 80 static struct at91_udc_data __initdata ek_udc_data = { 83 81 .vbus_pin = AT91_PIN_PC5, 84 - .pullup_pin = 0, /* pull-up driven by UDC */ 82 + .pullup_pin = -EINVAL, /* pull-up driven by UDC */ 85 83 }; 86 84 87 85 ··· 111 109 /* 112 110 * MACB Ethernet device 113 111 */ 114 - static struct at91_eth_data __initdata ek_macb_data = { 112 + static struct macb_platform_data __initdata ek_macb_data = { 115 113 .phy_irq_pin = AT91_PIN_PA7, 116 114 .is_rmii = 0, 117 115 }; ··· 136 134 static struct atmel_nand_data __initdata ek_nand_data = { 137 135 .ale = 21, 138 136 .cle = 22, 139 - // .det_pin = ... not connected 137 + .det_pin = -EINVAL, 140 138 .rdy_pin = AT91_PIN_PC13, 141 139 .enable_pin = AT91_PIN_PC14, 142 140 .parts = ek_nand_partition, ··· 164 162 static void __init ek_add_device_nand(void) 165 163 { 166 164 /* configure chip-select 3 (NAND) */ 167 - sam9_smc_configure(3, &ek_nand_smc_config); 165 + sam9_smc_configure(0, 3, &ek_nand_smc_config); 168 166 169 167 at91_add_device_nand(&ek_nand_data); 170 168 } ··· 178 176 .wire4 = 1, 179 177 .det_pin = AT91_PIN_PC8, 180 178 .wp_pin = AT91_PIN_PC4, 181 - // .vcc_pin = ... not connected 179 + .vcc_pin = -EINVAL, 182 180 }; 183 181 184 182 static void __init ek_board_init(void)
+9 -7
arch/arm/mach-at91/board-sam9260ek.c
··· 75 75 */ 76 76 static struct at91_usbh_data __initdata ek_usbh_data = { 77 77 .ports = 2, 78 + .vbus_pin = {-EINVAL, -EINVAL}, 79 + .overcurrent_pin= {-EINVAL, -EINVAL}, 78 80 }; 79 81 80 82 /* ··· 84 82 */ 85 83 static struct at91_udc_data __initdata ek_udc_data = { 86 84 .vbus_pin = AT91_PIN_PC5, 87 - .pullup_pin = 0, /* pull-up driven by UDC */ 85 + .pullup_pin = -EINVAL, /* pull-up driven by UDC */ 88 86 }; 89 87 90 88 ··· 153 151 /* 154 152 * MACB Ethernet device 155 153 */ 156 - static struct at91_eth_data __initdata ek_macb_data = { 154 + static struct macb_platform_data __initdata ek_macb_data = { 157 155 .phy_irq_pin = AT91_PIN_PA7, 158 156 .is_rmii = 1, 159 157 }; ··· 178 176 static struct atmel_nand_data __initdata ek_nand_data = { 179 177 .ale = 21, 180 178 .cle = 22, 181 - // .det_pin = ... not connected 179 + .det_pin = -EINVAL, 182 180 .rdy_pin = AT91_PIN_PC13, 183 181 .enable_pin = AT91_PIN_PC14, 184 182 .parts = ek_nand_partition, ··· 213 211 ek_nand_smc_config.mode |= AT91_SMC_DBW_8; 214 212 215 213 /* configure chip-select 3 (NAND) */ 216 - sam9_smc_configure(3, &ek_nand_smc_config); 214 + sam9_smc_configure(0, 3, &ek_nand_smc_config); 217 215 218 216 at91_add_device_nand(&ek_nand_data); 219 217 } ··· 225 223 static struct at91_mmc_data __initdata ek_mmc_data = { 226 224 .slot_b = 1, 227 225 .wire4 = 1, 228 - // .det_pin = ... not connected 229 - // .wp_pin = ... not connected 230 - // .vcc_pin = ... not connected 226 + .det_pin = -EINVAL, 227 + .wp_pin = -EINVAL, 228 + .vcc_pin = -EINVAL, 231 229 }; 232 230 233 231
+9 -4
arch/arm/mach-at91/board-sam9261ek.c
··· 131 131 static void __init ek_add_device_dm9000(void) 132 132 { 133 133 /* Configure chip-select 2 (DM9000) */ 134 - sam9_smc_configure(2, &dm9000_smc_config); 134 + sam9_smc_configure(0, 2, &dm9000_smc_config); 135 135 136 136 /* Configure Reset signal as output */ 137 137 at91_set_gpio_output(AT91_PIN_PC10, 0); ··· 151 151 */ 152 152 static struct at91_usbh_data __initdata ek_usbh_data = { 153 153 .ports = 2, 154 + .vbus_pin = {-EINVAL, -EINVAL}, 155 + .overcurrent_pin= {-EINVAL, -EINVAL}, 154 156 }; 155 157 156 158 ··· 161 159 */ 162 160 static struct at91_udc_data __initdata ek_udc_data = { 163 161 .vbus_pin = AT91_PIN_PB29, 164 - .pullup_pin = 0, /* pull-up driven by UDC */ 162 + .pullup_pin = -EINVAL, /* pull-up driven by UDC */ 165 163 }; 166 164 167 165 ··· 184 182 static struct atmel_nand_data __initdata ek_nand_data = { 185 183 .ale = 22, 186 184 .cle = 21, 187 - // .det_pin = ... not connected 185 + .det_pin = -EINVAL, 188 186 .rdy_pin = AT91_PIN_PC15, 189 187 .enable_pin = AT91_PIN_PC14, 190 188 .parts = ek_nand_partition, ··· 219 217 ek_nand_smc_config.mode |= AT91_SMC_DBW_8; 220 218 221 219 /* configure chip-select 3 (NAND) */ 222 - sam9_smc_configure(3, &ek_nand_smc_config); 220 + sam9_smc_configure(0, 3, &ek_nand_smc_config); 223 221 224 222 at91_add_device_nand(&ek_nand_data); 225 223 } ··· 347 345 */ 348 346 static struct at91_mmc_data __initdata ek_mmc_data = { 349 347 .wire4 = 1, 348 + .det_pin = -EINVAL, 349 + .wp_pin = -EINVAL, 350 + .vcc_pin = -EINVAL, 350 351 }; 351 352 352 353 #endif /* CONFIG_SPI_ATMEL_* */
+7 -5
arch/arm/mach-at91/board-sam9263ek.c
··· 74 74 static struct at91_usbh_data __initdata ek_usbh_data = { 75 75 .ports = 2, 76 76 .vbus_pin = { AT91_PIN_PA24, AT91_PIN_PA21 }, 77 + .overcurrent_pin= {-EINVAL, -EINVAL}, 77 78 }; 78 79 79 80 /* ··· 82 81 */ 83 82 static struct at91_udc_data __initdata ek_udc_data = { 84 83 .vbus_pin = AT91_PIN_PA25, 85 - .pullup_pin = 0, /* pull-up driven by UDC */ 84 + .pullup_pin = -EINVAL, /* pull-up driven by UDC */ 86 85 }; 87 86 88 87 ··· 152 151 .wire4 = 1, 153 152 .det_pin = AT91_PIN_PE18, 154 153 .wp_pin = AT91_PIN_PE19, 155 - // .vcc_pin = ... not connected 154 + .vcc_pin = -EINVAL, 156 155 }; 157 156 158 157 159 158 /* 160 159 * MACB Ethernet device 161 160 */ 162 - static struct at91_eth_data __initdata ek_macb_data = { 161 + static struct macb_platform_data __initdata ek_macb_data = { 163 162 .phy_irq_pin = AT91_PIN_PE31, 164 163 .is_rmii = 1, 165 164 }; ··· 184 183 static struct atmel_nand_data __initdata ek_nand_data = { 185 184 .ale = 21, 186 185 .cle = 22, 187 - // .det_pin = ... not connected 186 + .det_pin = -EINVAL, 188 187 .rdy_pin = AT91_PIN_PA22, 189 188 .enable_pin = AT91_PIN_PD15, 190 189 .parts = ek_nand_partition, ··· 219 218 ek_nand_smc_config.mode |= AT91_SMC_DBW_8; 220 219 221 220 /* configure chip-select 3 (NAND) */ 222 - sam9_smc_configure(3, &ek_nand_smc_config); 221 + sam9_smc_configure(0, 3, &ek_nand_smc_config); 223 222 224 223 at91_add_device_nand(&ek_nand_data); 225 224 } ··· 354 353 * reset_pin is not connected: NRST 355 354 */ 356 355 static struct ac97c_platform_data ek_ac97_data = { 356 + .reset_pin = -EINVAL, 357 357 }; 358 358 359 359
+10 -3
arch/arm/mach-at91/board-sam9g20ek.c
··· 86 86 */ 87 87 static struct at91_usbh_data __initdata ek_usbh_data = { 88 88 .ports = 2, 89 + .vbus_pin = {-EINVAL, -EINVAL}, 90 + .overcurrent_pin= {-EINVAL, -EINVAL}, 89 91 }; 90 92 91 93 /* ··· 95 93 */ 96 94 static struct at91_udc_data __initdata ek_udc_data = { 97 95 .vbus_pin = AT91_PIN_PC5, 98 - .pullup_pin = 0, /* pull-up driven by UDC */ 96 + .pullup_pin = -EINVAL, /* pull-up driven by UDC */ 99 97 }; 100 98 101 99 ··· 125 123 /* 126 124 * MACB Ethernet device 127 125 */ 128 - static struct at91_eth_data __initdata ek_macb_data = { 126 + static struct macb_platform_data __initdata ek_macb_data = { 129 127 .phy_irq_pin = AT91_PIN_PA7, 130 128 .is_rmii = 1, 131 129 }; ··· 165 163 .cle = 22, 166 164 .rdy_pin = AT91_PIN_PC13, 167 165 .enable_pin = AT91_PIN_PC14, 166 + .det_pin = -EINVAL, 168 167 .parts = ek_nand_partition, 169 168 .num_parts = ARRAY_SIZE(ek_nand_partition), 170 169 }; ··· 198 195 ek_nand_smc_config.mode |= AT91_SMC_DBW_8; 199 196 200 197 /* configure chip-select 3 (NAND) */ 201 - sam9_smc_configure(3, &ek_nand_smc_config); 198 + sam9_smc_configure(0, 3, &ek_nand_smc_config); 202 199 203 200 at91_add_device_nand(&ek_nand_data); 204 201 } ··· 213 210 .slot[1] = { 214 211 .bus_width = 4, 215 212 .detect_pin = AT91_PIN_PC9, 213 + .wp_pin = -EINVAL, 216 214 }, 217 215 218 216 }; ··· 222 218 .slot_b = 1, /* Only one slot so use slot B */ 223 219 .wire4 = 1, 224 220 .det_pin = AT91_PIN_PC9, 221 + .wp_pin = -EINVAL, 222 + .vcc_pin = -EINVAL, 225 223 }; 226 224 #endif 227 225 ··· 233 227 if (ek_have_2mmc()) { 234 228 ek_mmc_data.slot[0].bus_width = 4; 235 229 ek_mmc_data.slot[0].detect_pin = AT91_PIN_PC2; 230 + ek_mmc_data.slot[0].wp_pin = -1; 236 231 } 237 232 at91_add_device_mci(0, &ek_mmc_data); 238 233 #else
+6 -2
arch/arm/mach-at91/board-sam9m10g45ek.c
··· 69 69 static struct at91_usbh_data __initdata ek_usbh_hs_data = { 70 70 .ports = 2, 71 71 .vbus_pin = {AT91_PIN_PD1, AT91_PIN_PD3}, 72 + .overcurrent_pin= {-EINVAL, -EINVAL}, 72 73 }; 73 74 74 75 ··· 101 100 .slot[0] = { 102 101 .bus_width = 4, 103 102 .detect_pin = AT91_PIN_PD10, 103 + .wp_pin = -EINVAL, 104 104 }, 105 105 }; 106 106 ··· 117 115 /* 118 116 * MACB Ethernet device 119 117 */ 120 - static struct at91_eth_data __initdata ek_macb_data = { 118 + static struct macb_platform_data __initdata ek_macb_data = { 121 119 .phy_irq_pin = AT91_PIN_PD5, 122 120 .is_rmii = 1, 123 121 }; ··· 145 143 .cle = 22, 146 144 .rdy_pin = AT91_PIN_PC8, 147 145 .enable_pin = AT91_PIN_PC14, 146 + .det_pin = -EINVAL, 148 147 .parts = ek_nand_partition, 149 148 .num_parts = ARRAY_SIZE(ek_nand_partition), 150 149 }; ··· 178 175 ek_nand_smc_config.mode |= AT91_SMC_DBW_8; 179 176 180 177 /* configure chip-select 3 (NAND) */ 181 - sam9_smc_configure(3, &ek_nand_smc_config); 178 + sam9_smc_configure(0, 3, &ek_nand_smc_config); 182 179 183 180 at91_add_device_nand(&ek_nand_data); 184 181 } ··· 333 330 * reset_pin is not connected: NRST 334 331 */ 335 332 static struct ac97c_platform_data ek_ac97_data = { 333 + .reset_pin = -EINVAL, 336 334 }; 337 335 338 336
+5 -4
arch/arm/mach-at91/board-sam9rlek.c
··· 67 67 static struct at91_mmc_data __initdata ek_mmc_data = { 68 68 .wire4 = 1, 69 69 .det_pin = AT91_PIN_PA15, 70 - // .wp_pin = ... not connected 71 - // .vcc_pin = ... not connected 70 + .wp_pin = -EINVAL, 71 + .vcc_pin = -EINVAL, 72 72 }; 73 73 74 74 ··· 91 91 static struct atmel_nand_data __initdata ek_nand_data = { 92 92 .ale = 21, 93 93 .cle = 22, 94 - // .det_pin = ... not connected 94 + .det_pin = -EINVAL, 95 95 .rdy_pin = AT91_PIN_PD17, 96 96 .enable_pin = AT91_PIN_PB6, 97 97 .parts = ek_nand_partition, ··· 119 119 static void __init ek_add_device_nand(void) 120 120 { 121 121 /* configure chip-select 3 (NAND) */ 122 - sam9_smc_configure(3, &ek_nand_smc_config); 122 + sam9_smc_configure(0, 3, &ek_nand_smc_config); 123 123 124 124 at91_add_device_nand(&ek_nand_data); 125 125 } ··· 204 204 * reset_pin is not connected: NRST 205 205 */ 206 206 static struct ac97c_platform_data ek_ac97_data = { 207 + .reset_pin = -EINVAL, 207 208 }; 208 209 209 210
+8 -2
arch/arm/mach-at91/board-snapper9260.c
··· 57 57 58 58 static struct at91_usbh_data __initdata snapper9260_usbh_data = { 59 59 .ports = 2, 60 + .vbus_pin = {-EINVAL, -EINVAL}, 61 + .overcurrent_pin= {-EINVAL, -EINVAL}, 60 62 }; 61 63 62 64 static struct at91_udc_data __initdata snapper9260_udc_data = { 63 65 .vbus_pin = SNAPPER9260_IO_EXP_GPIO(5), 64 66 .vbus_active_low = 1, 65 67 .vbus_polled = 1, 68 + .pullup_pin = -EINVAL, 66 69 }; 67 70 68 - static struct at91_eth_data snapper9260_macb_data = { 71 + static struct macb_platform_data snapper9260_macb_data = { 72 + .phy_irq_pin = -EINVAL, 69 73 .is_rmii = 1, 70 74 }; 71 75 ··· 108 104 .parts = snapper9260_nand_partitions, 109 105 .num_parts = ARRAY_SIZE(snapper9260_nand_partitions), 110 106 .bus_width_16 = 0, 107 + .enable_pin = -EINVAL, 108 + .det_pin = -EINVAL, 111 109 }; 112 110 113 111 static struct sam9_smc_config __initdata snapper9260_nand_smc_config = { ··· 155 149 static void __init snapper9260_add_device_nand(void) 156 150 { 157 151 at91_set_A_periph(AT91_PIN_PC14, 0); 158 - sam9_smc_configure(3, &snapper9260_nand_smc_config); 152 + sam9_smc_configure(0, 3, &snapper9260_nand_smc_config); 159 153 at91_add_device_nand(&snapper9260_nand_data); 160 154 } 161 155
+12 -4
arch/arm/mach-at91/board-stamp9g20.c
··· 85 85 .rdy_pin = AT91_PIN_PC13, 86 86 .enable_pin = AT91_PIN_PC14, 87 87 .bus_width_16 = 0, 88 + .det_pin = -EINVAL, 88 89 }; 89 90 90 91 static struct sam9_smc_config __initdata nand_smc_config = { ··· 109 108 static void __init add_device_nand(void) 110 109 { 111 110 /* configure chip-select 3 (NAND) */ 112 - sam9_smc_configure(3, &nand_smc_config); 111 + sam9_smc_configure(0, 3, &nand_smc_config); 113 112 114 113 at91_add_device_nand(&nand_data); 115 114 } ··· 123 122 static struct mci_platform_data __initdata mmc_data = { 124 123 .slot[0] = { 125 124 .bus_width = 4, 125 + .detect_pin = -1, 126 + .wp_pin = -1, 126 127 }, 127 128 }; 128 129 #else 129 130 static struct at91_mmc_data __initdata mmc_data = { 130 131 .slot_b = 0, 131 132 .wire4 = 1, 133 + .det_pin = -EINVAL, 134 + .wp_pin = -EINVAL, 135 + .vcc_pin = -EINVAL, 132 136 }; 133 137 #endif 134 138 ··· 143 137 */ 144 138 static struct at91_usbh_data __initdata usbh_data = { 145 139 .ports = 2, 140 + .vbus_pin = {-EINVAL, -EINVAL}, 141 + .overcurrent_pin= {-EINVAL, -EINVAL}, 146 142 }; 147 143 148 144 ··· 153 145 */ 154 146 static struct at91_udc_data __initdata portuxg20_udc_data = { 155 147 .vbus_pin = AT91_PIN_PC7, 156 - .pullup_pin = 0, /* pull-up driven by UDC */ 148 + .pullup_pin = -EINVAL, /* pull-up driven by UDC */ 157 149 }; 158 150 159 151 static struct at91_udc_data __initdata stamp9g20evb_udc_data = { 160 152 .vbus_pin = AT91_PIN_PA22, 161 - .pullup_pin = 0, /* pull-up driven by UDC */ 153 + .pullup_pin = -EINVAL, /* pull-up driven by UDC */ 162 154 }; 163 155 164 156 165 157 /* 166 158 * MACB Ethernet device 167 159 */ 168 - static struct at91_eth_data __initdata macb_data = { 160 + static struct macb_platform_data __initdata macb_data = { 169 161 .phy_irq_pin = AT91_PIN_PA28, 170 162 .is_rmii = 1, 171 163 };
+8 -6
arch/arm/mach-at91/board-usb-a926x.c
··· 66 66 */ 67 67 static struct at91_usbh_data __initdata ek_usbh_data = { 68 68 .ports = 2, 69 + .vbus_pin = {-EINVAL, -EINVAL}, 70 + .overcurrent_pin= {-EINVAL, -EINVAL}, 69 71 }; 70 72 71 73 /* ··· 75 73 */ 76 74 static struct at91_udc_data __initdata ek_udc_data = { 77 75 .vbus_pin = AT91_PIN_PB11, 78 - .pullup_pin = 0, /* pull-up driven by UDC */ 76 + .pullup_pin = -EINVAL, /* pull-up driven by UDC */ 79 77 }; 80 78 81 79 static void __init ek_add_device_udc(void) ··· 148 146 /* 149 147 * MACB Ethernet device 150 148 */ 151 - static struct at91_eth_data __initdata ek_macb_data = { 149 + static struct macb_platform_data __initdata ek_macb_data = { 152 150 .phy_irq_pin = AT91_PIN_PE31, 153 151 .is_rmii = 1, 154 152 }; ··· 195 193 static struct atmel_nand_data __initdata ek_nand_data = { 196 194 .ale = 21, 197 195 .cle = 22, 198 - // .det_pin = ... not connected 196 + .det_pin = -EINVAL, 199 197 .rdy_pin = AT91_PIN_PA22, 200 198 .enable_pin = AT91_PIN_PD15, 201 199 .parts = ek_nand_partition, ··· 247 245 248 246 /* configure chip-select 3 (NAND) */ 249 247 if (machine_is_usb_a9g20()) 250 - sam9_smc_configure(3, &usb_a9g20_nand_smc_config); 248 + sam9_smc_configure(0, 3, &usb_a9g20_nand_smc_config); 251 249 else 252 - sam9_smc_configure(3, &usb_a9260_nand_smc_config); 250 + sam9_smc_configure(0, 3, &usb_a9260_nand_smc_config); 253 251 254 252 at91_add_device_nand(&ek_nand_data); 255 253 } ··· 346 344 /* I2C */ 347 345 at91_add_device_i2c(NULL, 0); 348 346 /* shutdown controller, wakeup button (5 msec low) */ 349 - at91_sys_write(AT91_SHDW_MR, AT91_SHDW_CPTWK0_(10) 347 + at91_shdwc_write(AT91_SHDW_MR, AT91_SHDW_CPTWK0_(10) 350 348 | AT91_SHDW_WKMODE0_LOW 351 349 | AT91_SHDW_RTTWKEN); 352 350 }
+6 -3
arch/arm/mach-at91/board-yl-9200.c
··· 110 110 /* 111 111 * Ethernet 112 112 */ 113 - static struct at91_eth_data __initdata yl9200_eth_data = { 113 + static struct macb_platform_data __initdata yl9200_eth_data = { 114 114 .phy_irq_pin = AT91_PIN_PB28, 115 115 .is_rmii = 1, 116 116 }; ··· 120 120 */ 121 121 static struct at91_usbh_data __initdata yl9200_usbh_data = { 122 122 .ports = 1, /* PQFP version of AT91RM9200 */ 123 + .vbus_pin = {-EINVAL, -EINVAL}, 124 + .overcurrent_pin= {-EINVAL, -EINVAL}, 123 125 }; 124 126 125 127 /* ··· 139 137 */ 140 138 static struct at91_mmc_data __initdata yl9200_mmc_data = { 141 139 .det_pin = AT91_PIN_PB9, 142 - // .wp_pin = ... not connected 143 140 .wire4 = 1, 141 + .wp_pin = -EINVAL, 142 + .vcc_pin = -EINVAL, 144 143 }; 145 144 146 145 /* ··· 178 175 static struct atmel_nand_data __initdata yl9200_nand_data = { 179 176 .ale = 6, 180 177 .cle = 7, 181 - // .det_pin = ... not connected 178 + .det_pin = -EINVAL, 182 179 .rdy_pin = AT91_PIN_PC14, /* R/!B (Sheet10) */ 183 180 .enable_pin = AT91_PIN_PC15, /* !CE (Sheet10) */ 184 181 .parts = yl9200_nand_partition,
+5 -2
arch/arm/mach-at91/generic.h
··· 29 29 /* Timer */ 30 30 struct sys_timer; 31 31 extern struct sys_timer at91rm9200_timer; 32 + extern void at91sam926x_ioremap_pit(u32 addr); 32 33 extern struct sys_timer at91sam926x_timer; 33 34 extern struct sys_timer at91x40_timer; 34 35 ··· 60 59 /* reset */ 61 60 extern void at91sam9_alt_restart(char, const char *); 62 61 62 + /* shutdown */ 63 + extern void at91_ioremap_shdwc(u32 base_addr); 64 + 63 65 /* GPIO */ 64 66 #define AT91RM9200_PQFP 3 /* AT91RM9200 PQFP package has 3 banks */ 65 67 #define AT91RM9200_BGA 4 /* AT91RM9200 BGA package has 4 banks */ 66 68 67 69 struct at91_gpio_bank { 68 70 unsigned short id; /* peripheral ID */ 69 - unsigned long offset; /* offset from system peripheral base */ 70 - struct clk *clock; /* associated clock */ 71 + unsigned long regbase; /* offset from system peripheral base */ 71 72 }; 72 73 extern void __init at91_gpio_init(struct at91_gpio_bank *, int nr_banks); 73 74 extern void __init at91_gpio_irq_setup(void);
+49 -36
arch/arm/mach-at91/gpio.c
··· 29 29 struct at91_gpio_chip { 30 30 struct gpio_chip chip; 31 31 struct at91_gpio_chip *next; /* Bank sharing same clock */ 32 - struct at91_gpio_bank *bank; /* Bank definition */ 32 + int id; /* ID of register bank */ 33 33 void __iomem *regbase; /* Base of register bank */ 34 + struct clk *clock; /* associated clock */ 34 35 }; 35 36 36 37 #define to_at91_gpio_chip(c) container_of(c, struct at91_gpio_chip, chip) ··· 59 58 } 60 59 61 60 static struct at91_gpio_chip gpio_chip[] = { 62 - AT91_GPIO_CHIP("A", 0x00 + PIN_BASE, 32), 63 - AT91_GPIO_CHIP("B", 0x20 + PIN_BASE, 32), 64 - AT91_GPIO_CHIP("C", 0x40 + PIN_BASE, 32), 65 - AT91_GPIO_CHIP("D", 0x60 + PIN_BASE, 32), 66 - AT91_GPIO_CHIP("E", 0x80 + PIN_BASE, 32), 61 + AT91_GPIO_CHIP("pioA", 0x00, 32), 62 + AT91_GPIO_CHIP("pioB", 0x20, 32), 63 + AT91_GPIO_CHIP("pioC", 0x40, 32), 64 + AT91_GPIO_CHIP("pioD", 0x60, 32), 65 + AT91_GPIO_CHIP("pioE", 0x80, 32), 67 66 }; 68 67 69 68 static int gpio_banks; 70 69 71 70 static inline void __iomem *pin_to_controller(unsigned pin) 72 71 { 73 - pin -= PIN_BASE; 74 72 pin /= 32; 75 73 if (likely(pin < gpio_banks)) 76 74 return gpio_chip[pin].regbase; ··· 79 79 80 80 static inline unsigned pin_to_mask(unsigned pin) 81 81 { 82 - pin -= PIN_BASE; 83 82 return 1 << (pin % 32); 84 83 } 85 84 ··· 273 274 274 275 static int gpio_irq_set_wake(struct irq_data *d, unsigned state) 275 276 { 276 - unsigned mask = pin_to_mask(d->irq); 277 - unsigned bank = (d->irq - PIN_BASE) / 32; 277 + unsigned pin = irq_to_gpio(d->irq); 278 + unsigned mask = pin_to_mask(pin); 279 + unsigned bank = pin / 32; 278 280 279 281 if (unlikely(bank >= MAX_GPIO_BANKS)) 280 282 return -EINVAL; ··· 285 285 else 286 286 wakeups[bank] &= ~mask; 287 287 288 - irq_set_irq_wake(gpio_chip[bank].bank->id, state); 288 + irq_set_irq_wake(gpio_chip[bank].id, state); 289 289 290 290 return 0; 291 291 } ··· 302 302 __raw_writel(wakeups[i], pio + PIO_IER); 303 303 304 304 if (!wakeups[i]) 305 - clk_disable(gpio_chip[i].bank->clock); 305 + clk_disable(gpio_chip[i].clock); 306 306 else { 307 307 #ifdef CONFIG_PM_DEBUG 308 308 printk(KERN_DEBUG "GPIO-%c may wake for %08x\n", 'A'+i, wakeups[i]); ··· 319 319 void __iomem *pio = gpio_chip[i].regbase; 320 320 321 321 if (!wakeups[i]) 322 - clk_enable(gpio_chip[i].bank->clock); 322 + clk_enable(gpio_chip[i].clock); 323 323 324 324 __raw_writel(wakeups[i], pio + PIO_IDR); 325 325 __raw_writel(backups[i], pio + PIO_IER); ··· 344 344 345 345 static void gpio_irq_mask(struct irq_data *d) 346 346 { 347 - void __iomem *pio = pin_to_controller(d->irq); 348 - unsigned mask = pin_to_mask(d->irq); 347 + unsigned pin = irq_to_gpio(d->irq); 348 + void __iomem *pio = pin_to_controller(pin); 349 + unsigned mask = pin_to_mask(pin); 349 350 350 351 if (pio) 351 352 __raw_writel(mask, pio + PIO_IDR); ··· 354 353 355 354 static void gpio_irq_unmask(struct irq_data *d) 356 355 { 357 - void __iomem *pio = pin_to_controller(d->irq); 358 - unsigned mask = pin_to_mask(d->irq); 356 + unsigned pin = irq_to_gpio(d->irq); 357 + void __iomem *pio = pin_to_controller(pin); 358 + unsigned mask = pin_to_mask(pin); 359 359 360 360 if (pio) 361 361 __raw_writel(mask, pio + PIO_IER); ··· 384 382 385 383 static void gpio_irq_handler(unsigned irq, struct irq_desc *desc) 386 384 { 387 - unsigned pin; 385 + unsigned irq_pin; 388 386 struct irq_data *idata = irq_desc_get_irq_data(desc); 389 387 struct irq_chip *chip = irq_data_get_irq_chip(idata); 390 388 struct at91_gpio_chip *at91_gpio = irq_data_get_irq_chip_data(idata); ··· 407 405 continue; 408 406 } 409 407 410 - pin = at91_gpio->chip.base; 408 + irq_pin = gpio_to_irq(at91_gpio->chip.base); 411 409 412 410 while (isr) { 413 411 if (isr & 1) 414 - generic_handle_irq(pin); 415 - pin++; 412 + generic_handle_irq(irq_pin); 413 + irq_pin++; 416 414 isr >>= 1; 417 415 } 418 416 } ··· 440 438 seq_printf(s, "%i:\t", j); 441 439 442 440 for (bank = 0; bank < gpio_banks; bank++) { 443 - unsigned pin = PIN_BASE + (32 * bank) + j; 441 + unsigned pin = (32 * bank) + j; 444 442 void __iomem *pio = pin_to_controller(pin); 445 443 unsigned mask = pin_to_mask(pin); 446 444 ··· 493 491 */ 494 492 void __init at91_gpio_irq_setup(void) 495 493 { 496 - unsigned pioc, pin; 494 + unsigned pioc, irq = gpio_to_irq(0); 497 495 struct at91_gpio_chip *this, *prev; 498 496 499 - for (pioc = 0, pin = PIN_BASE, this = gpio_chip, prev = NULL; 497 + for (pioc = 0, this = gpio_chip, prev = NULL; 500 498 pioc++ < gpio_banks; 501 499 prev = this, this++) { 502 - unsigned id = this->bank->id; 500 + unsigned id = this->id; 503 501 unsigned i; 504 502 505 503 __raw_writel(~0, this->regbase + PIO_IDR); 506 504 507 - for (i = 0, pin = this->chip.base; i < 32; i++, pin++) { 508 - irq_set_lockdep_class(pin, &gpio_lock_class); 505 + for (i = 0, irq = gpio_to_irq(this->chip.base); i < 32; 506 + i++, irq++) { 507 + irq_set_lockdep_class(irq, &gpio_lock_class); 509 508 510 509 /* 511 510 * Can use the "simple" and not "edge" handler since it's 512 511 * shorter, and the AIC handles interrupts sanely. 513 512 */ 514 - irq_set_chip_and_handler(pin, &gpio_irqchip, 513 + irq_set_chip_and_handler(irq, &gpio_irqchip, 515 514 handle_simple_irq); 516 - set_irq_flags(pin, IRQF_VALID); 515 + set_irq_flags(irq, IRQF_VALID); 517 516 } 518 517 519 518 /* The toplevel handler handles one bank of GPIOs, except ··· 527 524 irq_set_chip_data(id, this); 528 525 irq_set_chained_handler(id, gpio_irq_handler); 529 526 } 530 - pr_info("AT91: %d gpio irqs in %d banks\n", pin - PIN_BASE, gpio_banks); 527 + pr_info("AT91: %d gpio irqs in %d banks\n", irq - gpio_to_irq(0), gpio_banks); 531 528 } 532 529 533 530 /* gpiolib support */ ··· 615 612 for (i = 0; i < nr_banks; i++) { 616 613 at91_gpio = &gpio_chip[i]; 617 614 618 - at91_gpio->bank = &data[i]; 619 - at91_gpio->chip.base = PIN_BASE + i * 32; 620 - at91_gpio->regbase = at91_gpio->bank->offset + 621 - (void __iomem *)AT91_VA_BASE_SYS; 615 + at91_gpio->id = data[i].id; 616 + at91_gpio->chip.base = i * 32; 617 + 618 + at91_gpio->regbase = ioremap(data[i].regbase, 512); 619 + if (!at91_gpio->regbase) { 620 + pr_err("at91_gpio.%d, failed to map registers, ignoring.\n", i); 621 + continue; 622 + } 623 + 624 + at91_gpio->clock = clk_get_sys(NULL, at91_gpio->chip.label); 625 + if (!at91_gpio->clock) { 626 + pr_err("at91_gpio.%d, failed to get clock, ignoring.\n", i); 627 + continue; 628 + } 622 629 623 630 /* enable PIO controller's clock */ 624 - clk_enable(at91_gpio->bank->clock); 631 + clk_enable(at91_gpio->clock); 625 632 626 633 /* AT91SAM9263_ID_PIOCDE groups PIOC, PIOD, PIOE */ 627 - if (last && last->bank->id == at91_gpio->bank->id) 634 + if (last && last->id == at91_gpio->id) 628 635 last->next = at91_gpio; 629 636 last = at91_gpio; 630 637
+30 -18
arch/arm/mach-at91/include/mach/at91_aic.h
··· 16 16 #ifndef AT91_AIC_H 17 17 #define AT91_AIC_H 18 18 19 - #define AT91_AIC_SMR(n) (AT91_AIC + ((n) * 4)) /* Source Mode Registers 0-31 */ 19 + #ifndef __ASSEMBLY__ 20 + extern void __iomem *at91_aic_base; 21 + 22 + #define at91_aic_read(field) \ 23 + __raw_readl(at91_aic_base + field) 24 + 25 + #define at91_aic_write(field, value) \ 26 + __raw_writel(value, at91_aic_base + field); 27 + #else 28 + .extern at91_aic_base 29 + #endif 30 + 31 + #define AT91_AIC_SMR(n) ((n) * 4) /* Source Mode Registers 0-31 */ 20 32 #define AT91_AIC_PRIOR (7 << 0) /* Priority Level */ 21 33 #define AT91_AIC_SRCTYPE (3 << 5) /* Interrupt Source Type */ 22 34 #define AT91_AIC_SRCTYPE_LOW (0 << 5) ··· 36 24 #define AT91_AIC_SRCTYPE_HIGH (2 << 5) 37 25 #define AT91_AIC_SRCTYPE_RISING (3 << 5) 38 26 39 - #define AT91_AIC_SVR(n) (AT91_AIC + 0x80 + ((n) * 4)) /* Source Vector Registers 0-31 */ 40 - #define AT91_AIC_IVR (AT91_AIC + 0x100) /* Interrupt Vector Register */ 41 - #define AT91_AIC_FVR (AT91_AIC + 0x104) /* Fast Interrupt Vector Register */ 42 - #define AT91_AIC_ISR (AT91_AIC + 0x108) /* Interrupt Status Register */ 27 + #define AT91_AIC_SVR(n) (0x80 + ((n) * 4)) /* Source Vector Registers 0-31 */ 28 + #define AT91_AIC_IVR 0x100 /* Interrupt Vector Register */ 29 + #define AT91_AIC_FVR 0x104 /* Fast Interrupt Vector Register */ 30 + #define AT91_AIC_ISR 0x108 /* Interrupt Status Register */ 43 31 #define AT91_AIC_IRQID (0x1f << 0) /* Current Interrupt Identifier */ 44 32 45 - #define AT91_AIC_IPR (AT91_AIC + 0x10c) /* Interrupt Pending Register */ 46 - #define AT91_AIC_IMR (AT91_AIC + 0x110) /* Interrupt Mask Register */ 47 - #define AT91_AIC_CISR (AT91_AIC + 0x114) /* Core Interrupt Status Register */ 33 + #define AT91_AIC_IPR 0x10c /* Interrupt Pending Register */ 34 + #define AT91_AIC_IMR 0x110 /* Interrupt Mask Register */ 35 + #define AT91_AIC_CISR 0x114 /* Core Interrupt Status Register */ 48 36 #define AT91_AIC_NFIQ (1 << 0) /* nFIQ Status */ 49 37 #define AT91_AIC_NIRQ (1 << 1) /* nIRQ Status */ 50 38 51 - #define AT91_AIC_IECR (AT91_AIC + 0x120) /* Interrupt Enable Command Register */ 52 - #define AT91_AIC_IDCR (AT91_AIC + 0x124) /* Interrupt Disable Command Register */ 53 - #define AT91_AIC_ICCR (AT91_AIC + 0x128) /* Interrupt Clear Command Register */ 54 - #define AT91_AIC_ISCR (AT91_AIC + 0x12c) /* Interrupt Set Command Register */ 55 - #define AT91_AIC_EOICR (AT91_AIC + 0x130) /* End of Interrupt Command Register */ 56 - #define AT91_AIC_SPU (AT91_AIC + 0x134) /* Spurious Interrupt Vector Register */ 57 - #define AT91_AIC_DCR (AT91_AIC + 0x138) /* Debug Control Register */ 39 + #define AT91_AIC_IECR 0x120 /* Interrupt Enable Command Register */ 40 + #define AT91_AIC_IDCR 0x124 /* Interrupt Disable Command Register */ 41 + #define AT91_AIC_ICCR 0x128 /* Interrupt Clear Command Register */ 42 + #define AT91_AIC_ISCR 0x12c /* Interrupt Set Command Register */ 43 + #define AT91_AIC_EOICR 0x130 /* End of Interrupt Command Register */ 44 + #define AT91_AIC_SPU 0x134 /* Spurious Interrupt Vector Register */ 45 + #define AT91_AIC_DCR 0x138 /* Debug Control Register */ 58 46 #define AT91_AIC_DCR_PROT (1 << 0) /* Protection Mode */ 59 47 #define AT91_AIC_DCR_GMSK (1 << 1) /* General Mask */ 60 48 61 - #define AT91_AIC_FFER (AT91_AIC + 0x140) /* Fast Forcing Enable Register [SAM9 only] */ 62 - #define AT91_AIC_FFDR (AT91_AIC + 0x144) /* Fast Forcing Disable Register [SAM9 only] */ 63 - #define AT91_AIC_FFSR (AT91_AIC + 0x148) /* Fast Forcing Status Register [SAM9 only] */ 49 + #define AT91_AIC_FFER 0x140 /* Fast Forcing Enable Register [SAM9 only] */ 50 + #define AT91_AIC_FFDR 0x144 /* Fast Forcing Disable Register [SAM9 only] */ 51 + #define AT91_AIC_FFSR 0x148 /* Fast Forcing Status Register [SAM9 only] */ 64 52 65 53 #endif
+1 -1
arch/arm/mach-at91/include/mach/at91_dbgu.h
··· 19 19 #define dbgu_readl(dbgu, field) \ 20 20 __raw_readl(AT91_VA_BASE_SYS + dbgu + AT91_DBGU_ ## field) 21 21 22 - #ifdef AT91_DBGU 22 + #if !defined(CONFIG_ARCH_AT91X40) 23 23 #define AT91_DBGU_CR (0x00) /* Control Register */ 24 24 #define AT91_DBGU_MR (0x04) /* Mode Register */ 25 25 #define AT91_DBGU_IER (0x08) /* Interrupt Enable Register */
+4 -4
arch/arm/mach-at91/include/mach/at91_pit.h
··· 16 16 #ifndef AT91_PIT_H 17 17 #define AT91_PIT_H 18 18 19 - #define AT91_PIT_MR (AT91_PIT + 0x00) /* Mode Register */ 19 + #define AT91_PIT_MR 0x00 /* Mode Register */ 20 20 #define AT91_PIT_PITIEN (1 << 25) /* Timer Interrupt Enable */ 21 21 #define AT91_PIT_PITEN (1 << 24) /* Timer Enabled */ 22 22 #define AT91_PIT_PIV (0xfffff) /* Periodic Interval Value */ 23 23 24 - #define AT91_PIT_SR (AT91_PIT + 0x04) /* Status Register */ 24 + #define AT91_PIT_SR 0x04 /* Status Register */ 25 25 #define AT91_PIT_PITS (1 << 0) /* Timer Status */ 26 26 27 - #define AT91_PIT_PIVR (AT91_PIT + 0x08) /* Periodic Interval Value Register */ 28 - #define AT91_PIT_PIIR (AT91_PIT + 0x0c) /* Periodic Interval Image Register */ 27 + #define AT91_PIT_PIVR 0x08 /* Periodic Interval Value Register */ 28 + #define AT91_PIT_PIIR 0x0c /* Periodic Interval Image Register */ 29 29 #define AT91_PIT_PICNT (0xfff << 20) /* Interval Counter */ 30 30 #define AT91_PIT_CPIV (0xfffff) /* Inverval Value */ 31 31
+12 -12
arch/arm/mach-at91/include/mach/at91_rtc.h
··· 16 16 #ifndef AT91_RTC_H 17 17 #define AT91_RTC_H 18 18 19 - #define AT91_RTC_CR (AT91_RTC + 0x00) /* Control Register */ 19 + #define AT91_RTC_CR 0x00 /* Control Register */ 20 20 #define AT91_RTC_UPDTIM (1 << 0) /* Update Request Time Register */ 21 21 #define AT91_RTC_UPDCAL (1 << 1) /* Update Request Calendar Register */ 22 22 #define AT91_RTC_TIMEVSEL (3 << 8) /* Time Event Selection */ ··· 29 29 #define AT91_RTC_CALEVSEL_MONTH (1 << 16) 30 30 #define AT91_RTC_CALEVSEL_YEAR (2 << 16) 31 31 32 - #define AT91_RTC_MR (AT91_RTC + 0x04) /* Mode Register */ 32 + #define AT91_RTC_MR 0x04 /* Mode Register */ 33 33 #define AT91_RTC_HRMOD (1 << 0) /* 12/24 Hour Mode */ 34 34 35 - #define AT91_RTC_TIMR (AT91_RTC + 0x08) /* Time Register */ 35 + #define AT91_RTC_TIMR 0x08 /* Time Register */ 36 36 #define AT91_RTC_SEC (0x7f << 0) /* Current Second */ 37 37 #define AT91_RTC_MIN (0x7f << 8) /* Current Minute */ 38 38 #define AT91_RTC_HOUR (0x3f << 16) /* Current Hour */ 39 39 #define AT91_RTC_AMPM (1 << 22) /* Ante Meridiem Post Meridiem Indicator */ 40 40 41 - #define AT91_RTC_CALR (AT91_RTC + 0x0c) /* Calendar Register */ 41 + #define AT91_RTC_CALR 0x0c /* Calendar Register */ 42 42 #define AT91_RTC_CENT (0x7f << 0) /* Current Century */ 43 43 #define AT91_RTC_YEAR (0xff << 8) /* Current Year */ 44 44 #define AT91_RTC_MONTH (0x1f << 16) /* Current Month */ 45 45 #define AT91_RTC_DAY (7 << 21) /* Current Day */ 46 46 #define AT91_RTC_DATE (0x3f << 24) /* Current Date */ 47 47 48 - #define AT91_RTC_TIMALR (AT91_RTC + 0x10) /* Time Alarm Register */ 48 + #define AT91_RTC_TIMALR 0x10 /* Time Alarm Register */ 49 49 #define AT91_RTC_SECEN (1 << 7) /* Second Alarm Enable */ 50 50 #define AT91_RTC_MINEN (1 << 15) /* Minute Alarm Enable */ 51 51 #define AT91_RTC_HOUREN (1 << 23) /* Hour Alarm Enable */ 52 52 53 - #define AT91_RTC_CALALR (AT91_RTC + 0x14) /* Calendar Alarm Register */ 53 + #define AT91_RTC_CALALR 0x14 /* Calendar Alarm Register */ 54 54 #define AT91_RTC_MTHEN (1 << 23) /* Month Alarm Enable */ 55 55 #define AT91_RTC_DATEEN (1 << 31) /* Date Alarm Enable */ 56 56 57 - #define AT91_RTC_SR (AT91_RTC + 0x18) /* Status Register */ 57 + #define AT91_RTC_SR 0x18 /* Status Register */ 58 58 #define AT91_RTC_ACKUPD (1 << 0) /* Acknowledge for Update */ 59 59 #define AT91_RTC_ALARM (1 << 1) /* Alarm Flag */ 60 60 #define AT91_RTC_SECEV (1 << 2) /* Second Event */ 61 61 #define AT91_RTC_TIMEV (1 << 3) /* Time Event */ 62 62 #define AT91_RTC_CALEV (1 << 4) /* Calendar Event */ 63 63 64 - #define AT91_RTC_SCCR (AT91_RTC + 0x1c) /* Status Clear Command Register */ 65 - #define AT91_RTC_IER (AT91_RTC + 0x20) /* Interrupt Enable Register */ 66 - #define AT91_RTC_IDR (AT91_RTC + 0x24) /* Interrupt Disable Register */ 67 - #define AT91_RTC_IMR (AT91_RTC + 0x28) /* Interrupt Mask Register */ 64 + #define AT91_RTC_SCCR 0x1c /* Status Clear Command Register */ 65 + #define AT91_RTC_IER 0x20 /* Interrupt Enable Register */ 66 + #define AT91_RTC_IDR 0x24 /* Interrupt Disable Register */ 67 + #define AT91_RTC_IMR 0x28 /* Interrupt Mask Register */ 68 68 69 - #define AT91_RTC_VER (AT91_RTC + 0x2c) /* Valid Entry Register */ 69 + #define AT91_RTC_VER 0x2c /* Valid Entry Register */ 70 70 #define AT91_RTC_NVTIM (1 << 0) /* Non valid Time */ 71 71 #define AT91_RTC_NVCAL (1 << 1) /* Non valid Calendar */ 72 72 #define AT91_RTC_NVTIMALR (1 << 2) /* Non valid Time Alarm */
+13 -3
arch/arm/mach-at91/include/mach/at91_shdwc.h
··· 16 16 #ifndef AT91_SHDWC_H 17 17 #define AT91_SHDWC_H 18 18 19 - #define AT91_SHDW_CR (AT91_SHDWC + 0x00) /* Shut Down Control Register */ 19 + #ifndef __ASSEMBLY__ 20 + extern void __iomem *at91_shdwc_base; 21 + 22 + #define at91_shdwc_read(field) \ 23 + __raw_readl(at91_shdwc_base + field) 24 + 25 + #define at91_shdwc_write(field, value) \ 26 + __raw_writel(value, at91_shdwc_base + field); 27 + #endif 28 + 29 + #define AT91_SHDW_CR 0x00 /* Shut Down Control Register */ 20 30 #define AT91_SHDW_SHDW (1 << 0) /* Shut Down command */ 21 31 #define AT91_SHDW_KEY (0xa5 << 24) /* KEY Password */ 22 32 23 - #define AT91_SHDW_MR (AT91_SHDWC + 0x04) /* Shut Down Mode Register */ 33 + #define AT91_SHDW_MR 0x04 /* Shut Down Mode Register */ 24 34 #define AT91_SHDW_WKMODE0 (3 << 0) /* Wake-up 0 Mode Selection */ 25 35 #define AT91_SHDW_WKMODE0_NONE 0 26 36 #define AT91_SHDW_WKMODE0_HIGH 1 ··· 40 30 #define AT91_SHDW_CPTWK0_(x) ((x) << 4) 41 31 #define AT91_SHDW_RTTWKEN (1 << 16) /* Real Time Timer Wake-up Enable */ 42 32 43 - #define AT91_SHDW_SR (AT91_SHDWC + 0x08) /* Shut Down Status Register */ 33 + #define AT91_SHDW_SR 0x08 /* Shut Down Status Register */ 44 34 #define AT91_SHDW_WAKEUP0 (1 << 0) /* Wake-up 0 Status */ 45 35 #define AT91_SHDW_RTTWK (1 << 16) /* Real-time Timer Wake-up */ 46 36 #define AT91_SHDW_RTCWK (1 << 17) /* Real-time Clock Wake-up [SAM9RL] */
+13 -14
arch/arm/mach-at91/include/mach/at91cap9.h
··· 79 79 /* 80 80 * System Peripherals (offset from AT91_BASE_SYS) 81 81 */ 82 - #define AT91_ECC (0xffffe200 - AT91_BASE_SYS) 83 82 #define AT91_BCRAMC (0xffffe400 - AT91_BASE_SYS) 84 83 #define AT91_DDRSDRC0 (0xffffe600 - AT91_BASE_SYS) 85 - #define AT91_SMC (0xffffe800 - AT91_BASE_SYS) 86 84 #define AT91_MATRIX (0xffffea00 - AT91_BASE_SYS) 87 - #define AT91_CCFG (0xffffeb10 - AT91_BASE_SYS) 88 - #define AT91_DMA (0xffffec00 - AT91_BASE_SYS) 89 - #define AT91_DBGU (0xffffee00 - AT91_BASE_SYS) 90 - #define AT91_AIC (0xfffff000 - AT91_BASE_SYS) 91 - #define AT91_PIOA (0xfffff200 - AT91_BASE_SYS) 92 - #define AT91_PIOB (0xfffff400 - AT91_BASE_SYS) 93 - #define AT91_PIOC (0xfffff600 - AT91_BASE_SYS) 94 - #define AT91_PIOD (0xfffff800 - AT91_BASE_SYS) 95 85 #define AT91_PMC (0xfffffc00 - AT91_BASE_SYS) 96 86 #define AT91_RSTC (0xfffffd00 - AT91_BASE_SYS) 97 - #define AT91_SHDWC (0xfffffd10 - AT91_BASE_SYS) 98 - #define AT91_RTT (0xfffffd20 - AT91_BASE_SYS) 99 - #define AT91_PIT (0xfffffd30 - AT91_BASE_SYS) 100 - #define AT91_WDT (0xfffffd40 - AT91_BASE_SYS) 101 87 #define AT91_GPBR (cpu_is_at91cap9_revB() ? \ 102 88 (0xfffffd50 - AT91_BASE_SYS) : \ 103 89 (0xfffffd60 - AT91_BASE_SYS)) 90 + 91 + #define AT91CAP9_BASE_ECC 0xffffe200 92 + #define AT91CAP9_BASE_DMA 0xffffec00 93 + #define AT91CAP9_BASE_SMC 0xffffe800 94 + #define AT91CAP9_BASE_DBGU AT91_BASE_DBGU1 95 + #define AT91CAP9_BASE_PIOA 0xfffff200 96 + #define AT91CAP9_BASE_PIOB 0xfffff400 97 + #define AT91CAP9_BASE_PIOC 0xfffff600 98 + #define AT91CAP9_BASE_PIOD 0xfffff800 99 + #define AT91CAP9_BASE_SHDWC 0xfffffd10 100 + #define AT91CAP9_BASE_RTT 0xfffffd20 101 + #define AT91CAP9_BASE_PIT 0xfffffd30 102 + #define AT91CAP9_BASE_WDT 0xfffffd40 104 103 105 104 #define AT91_USART0 AT91CAP9_BASE_US0 106 105 #define AT91_USART1 AT91CAP9_BASE_US1
+7 -7
arch/arm/mach-at91/include/mach/at91rm9200.h
··· 79 79 /* 80 80 * System Peripherals (offset from AT91_BASE_SYS) 81 81 */ 82 - #define AT91_AIC (0xfffff000 - AT91_BASE_SYS) /* Advanced Interrupt Controller */ 83 - #define AT91_DBGU (0xfffff200 - AT91_BASE_SYS) /* Debug Unit */ 84 - #define AT91_PIOA (0xfffff400 - AT91_BASE_SYS) /* PIO Controller A */ 85 - #define AT91_PIOB (0xfffff600 - AT91_BASE_SYS) /* PIO Controller B */ 86 - #define AT91_PIOC (0xfffff800 - AT91_BASE_SYS) /* PIO Controller C */ 87 - #define AT91_PIOD (0xfffffa00 - AT91_BASE_SYS) /* PIO Controller D */ 88 82 #define AT91_PMC (0xfffffc00 - AT91_BASE_SYS) /* Power Management Controller */ 89 83 #define AT91_ST (0xfffffd00 - AT91_BASE_SYS) /* System Timer */ 90 - #define AT91_RTC (0xfffffe00 - AT91_BASE_SYS) /* Real-Time Clock */ 91 84 #define AT91_MC (0xffffff00 - AT91_BASE_SYS) /* Memory Controllers */ 85 + 86 + #define AT91RM9200_BASE_DBGU AT91_BASE_DBGU0 /* Debug Unit */ 87 + #define AT91RM9200_BASE_PIOA 0xfffff400 /* PIO Controller A */ 88 + #define AT91RM9200_BASE_PIOB 0xfffff600 /* PIO Controller B */ 89 + #define AT91RM9200_BASE_PIOC 0xfffff800 /* PIO Controller C */ 90 + #define AT91RM9200_BASE_PIOD 0xfffffa00 /* PIO Controller D */ 91 + #define AT91RM9200_BASE_RTC 0xfffffe00 /* Real-Time Clock */ 92 92 93 93 #define AT91_USART0 AT91RM9200_BASE_US0 94 94 #define AT91_USART1 AT91RM9200_BASE_US1
+11 -12
arch/arm/mach-at91/include/mach/at91sam9260.h
··· 80 80 /* 81 81 * System Peripherals (offset from AT91_BASE_SYS) 82 82 */ 83 - #define AT91_ECC (0xffffe800 - AT91_BASE_SYS) 84 83 #define AT91_SDRAMC0 (0xffffea00 - AT91_BASE_SYS) 85 - #define AT91_SMC (0xffffec00 - AT91_BASE_SYS) 86 84 #define AT91_MATRIX (0xffffee00 - AT91_BASE_SYS) 87 - #define AT91_CCFG (0xffffef10 - AT91_BASE_SYS) 88 - #define AT91_AIC (0xfffff000 - AT91_BASE_SYS) 89 - #define AT91_DBGU (0xfffff200 - AT91_BASE_SYS) 90 - #define AT91_PIOA (0xfffff400 - AT91_BASE_SYS) 91 - #define AT91_PIOB (0xfffff600 - AT91_BASE_SYS) 92 - #define AT91_PIOC (0xfffff800 - AT91_BASE_SYS) 93 85 #define AT91_PMC (0xfffffc00 - AT91_BASE_SYS) 94 86 #define AT91_RSTC (0xfffffd00 - AT91_BASE_SYS) 95 - #define AT91_SHDWC (0xfffffd10 - AT91_BASE_SYS) 96 - #define AT91_RTT (0xfffffd20 - AT91_BASE_SYS) 97 - #define AT91_PIT (0xfffffd30 - AT91_BASE_SYS) 98 - #define AT91_WDT (0xfffffd40 - AT91_BASE_SYS) 99 87 #define AT91_GPBR (0xfffffd50 - AT91_BASE_SYS) 88 + 89 + #define AT91SAM9260_BASE_ECC 0xffffe800 90 + #define AT91SAM9260_BASE_SMC 0xffffec00 91 + #define AT91SAM9260_BASE_DBGU AT91_BASE_DBGU0 92 + #define AT91SAM9260_BASE_PIOA 0xfffff400 93 + #define AT91SAM9260_BASE_PIOB 0xfffff600 94 + #define AT91SAM9260_BASE_PIOC 0xfffff800 95 + #define AT91SAM9260_BASE_SHDWC 0xfffffd10 96 + #define AT91SAM9260_BASE_RTT 0xfffffd20 97 + #define AT91SAM9260_BASE_PIT 0xfffffd30 98 + #define AT91SAM9260_BASE_WDT 0xfffffd40 100 99 101 100 #define AT91_USART0 AT91SAM9260_BASE_US0 102 101 #define AT91_USART1 AT91SAM9260_BASE_US1
+10 -10
arch/arm/mach-at91/include/mach/at91sam9261.h
··· 66 66 * System Peripherals (offset from AT91_BASE_SYS) 67 67 */ 68 68 #define AT91_SDRAMC0 (0xffffea00 - AT91_BASE_SYS) 69 - #define AT91_SMC (0xffffec00 - AT91_BASE_SYS) 70 69 #define AT91_MATRIX (0xffffee00 - AT91_BASE_SYS) 71 - #define AT91_AIC (0xfffff000 - AT91_BASE_SYS) 72 - #define AT91_DBGU (0xfffff200 - AT91_BASE_SYS) 73 - #define AT91_PIOA (0xfffff400 - AT91_BASE_SYS) 74 - #define AT91_PIOB (0xfffff600 - AT91_BASE_SYS) 75 - #define AT91_PIOC (0xfffff800 - AT91_BASE_SYS) 76 70 #define AT91_PMC (0xfffffc00 - AT91_BASE_SYS) 77 71 #define AT91_RSTC (0xfffffd00 - AT91_BASE_SYS) 78 - #define AT91_SHDWC (0xfffffd10 - AT91_BASE_SYS) 79 - #define AT91_RTT (0xfffffd20 - AT91_BASE_SYS) 80 - #define AT91_PIT (0xfffffd30 - AT91_BASE_SYS) 81 - #define AT91_WDT (0xfffffd40 - AT91_BASE_SYS) 82 72 #define AT91_GPBR (0xfffffd50 - AT91_BASE_SYS) 73 + 74 + #define AT91SAM9261_BASE_SMC 0xffffec00 75 + #define AT91SAM9261_BASE_DBGU AT91_BASE_DBGU0 76 + #define AT91SAM9261_BASE_PIOA 0xfffff400 77 + #define AT91SAM9261_BASE_PIOB 0xfffff600 78 + #define AT91SAM9261_BASE_PIOC 0xfffff800 79 + #define AT91SAM9261_BASE_SHDWC 0xfffffd10 80 + #define AT91SAM9261_BASE_RTT 0xfffffd20 81 + #define AT91SAM9261_BASE_PIT 0xfffffd30 82 + #define AT91SAM9261_BASE_WDT 0xfffffd40 83 83 84 84 #define AT91_USART0 AT91SAM9261_BASE_US0 85 85 #define AT91_USART1 AT91SAM9261_BASE_US1
+16 -17
arch/arm/mach-at91/include/mach/at91sam9263.h
··· 74 74 /* 75 75 * System Peripherals (offset from AT91_BASE_SYS) 76 76 */ 77 - #define AT91_ECC0 (0xffffe000 - AT91_BASE_SYS) 78 77 #define AT91_SDRAMC0 (0xffffe200 - AT91_BASE_SYS) 79 - #define AT91_SMC0 (0xffffe400 - AT91_BASE_SYS) 80 - #define AT91_ECC1 (0xffffe600 - AT91_BASE_SYS) 81 78 #define AT91_SDRAMC1 (0xffffe800 - AT91_BASE_SYS) 82 - #define AT91_SMC1 (0xffffea00 - AT91_BASE_SYS) 83 79 #define AT91_MATRIX (0xffffec00 - AT91_BASE_SYS) 84 - #define AT91_CCFG (0xffffed10 - AT91_BASE_SYS) 85 - #define AT91_DBGU (0xffffee00 - AT91_BASE_SYS) 86 - #define AT91_AIC (0xfffff000 - AT91_BASE_SYS) 87 - #define AT91_PIOA (0xfffff200 - AT91_BASE_SYS) 88 - #define AT91_PIOB (0xfffff400 - AT91_BASE_SYS) 89 - #define AT91_PIOC (0xfffff600 - AT91_BASE_SYS) 90 - #define AT91_PIOD (0xfffff800 - AT91_BASE_SYS) 91 - #define AT91_PIOE (0xfffffa00 - AT91_BASE_SYS) 92 80 #define AT91_PMC (0xfffffc00 - AT91_BASE_SYS) 93 81 #define AT91_RSTC (0xfffffd00 - AT91_BASE_SYS) 94 - #define AT91_SHDWC (0xfffffd10 - AT91_BASE_SYS) 95 - #define AT91_RTT0 (0xfffffd20 - AT91_BASE_SYS) 96 - #define AT91_PIT (0xfffffd30 - AT91_BASE_SYS) 97 - #define AT91_WDT (0xfffffd40 - AT91_BASE_SYS) 98 - #define AT91_RTT1 (0xfffffd50 - AT91_BASE_SYS) 99 82 #define AT91_GPBR (0xfffffd60 - AT91_BASE_SYS) 83 + 84 + #define AT91SAM9263_BASE_ECC0 0xffffe000 85 + #define AT91SAM9263_BASE_SMC0 0xffffe400 86 + #define AT91SAM9263_BASE_ECC1 0xffffe600 87 + #define AT91SAM9263_BASE_SMC1 0xffffea00 88 + #define AT91SAM9263_BASE_DBGU AT91_BASE_DBGU1 89 + #define AT91SAM9263_BASE_PIOA 0xfffff200 90 + #define AT91SAM9263_BASE_PIOB 0xfffff400 91 + #define AT91SAM9263_BASE_PIOC 0xfffff600 92 + #define AT91SAM9263_BASE_PIOD 0xfffff800 93 + #define AT91SAM9263_BASE_PIOE 0xfffffa00 94 + #define AT91SAM9263_BASE_SHDWC 0xfffffd10 95 + #define AT91SAM9263_BASE_RTT0 0xfffffd20 96 + #define AT91SAM9263_BASE_PIT 0xfffffd30 97 + #define AT91SAM9263_BASE_WDT 0xfffffd40 98 + #define AT91SAM9263_BASE_RTT1 0xfffffd50 100 99 101 100 #define AT91_USART0 AT91SAM9263_BASE_US0 102 101 #define AT91_USART1 AT91SAM9263_BASE_US1
+6 -11
arch/arm/mach-at91/include/mach/at91sam9_smc.h
··· 16 16 #ifndef AT91SAM9_SMC_H 17 17 #define AT91SAM9_SMC_H 18 18 19 - #define AT91_SMC_SETUP(n) (AT91_SMC + 0x00 + ((n)*0x10)) /* Setup Register for CS n */ 19 + #include <mach/cpu.h> 20 + 21 + #define AT91_SMC_SETUP 0x00 /* Setup Register for CS n */ 20 22 #define AT91_SMC_NWESETUP (0x3f << 0) /* NWE Setup Length */ 21 23 #define AT91_SMC_NWESETUP_(x) ((x) << 0) 22 24 #define AT91_SMC_NCS_WRSETUP (0x3f << 8) /* NCS Setup Length in Write Access */ ··· 28 26 #define AT91_SMC_NCS_RDSETUP (0x3f << 24) /* NCS Setup Length in Read Access */ 29 27 #define AT91_SMC_NCS_RDSETUP_(x) ((x) << 24) 30 28 31 - #define AT91_SMC_PULSE(n) (AT91_SMC + 0x04 + ((n)*0x10)) /* Pulse Register for CS n */ 29 + #define AT91_SMC_PULSE 0x04 /* Pulse Register for CS n */ 32 30 #define AT91_SMC_NWEPULSE (0x7f << 0) /* NWE Pulse Length */ 33 31 #define AT91_SMC_NWEPULSE_(x) ((x) << 0) 34 32 #define AT91_SMC_NCS_WRPULSE (0x7f << 8) /* NCS Pulse Length in Write Access */ ··· 38 36 #define AT91_SMC_NCS_RDPULSE (0x7f << 24) /* NCS Pulse Length in Read Access */ 39 37 #define AT91_SMC_NCS_RDPULSE_(x)((x) << 24) 40 38 41 - #define AT91_SMC_CYCLE(n) (AT91_SMC + 0x08 + ((n)*0x10)) /* Cycle Register for CS n */ 39 + #define AT91_SMC_CYCLE 0x08 /* Cycle Register for CS n */ 42 40 #define AT91_SMC_NWECYCLE (0x1ff << 0 ) /* Total Write Cycle Length */ 43 41 #define AT91_SMC_NWECYCLE_(x) ((x) << 0) 44 42 #define AT91_SMC_NRDCYCLE (0x1ff << 16) /* Total Read Cycle Length */ 45 43 #define AT91_SMC_NRDCYCLE_(x) ((x) << 16) 46 44 47 - #define AT91_SMC_MODE(n) (AT91_SMC + 0x0c + ((n)*0x10)) /* Mode Register for CS n */ 45 + #define AT91_SMC_MODE 0x0c /* Mode Register for CS n */ 48 46 #define AT91_SMC_READMODE (1 << 0) /* Read Mode */ 49 47 #define AT91_SMC_WRITEMODE (1 << 1) /* Write Mode */ 50 48 #define AT91_SMC_EXNWMODE (3 << 4) /* NWAIT Mode */ ··· 67 65 #define AT91_SMC_PS_8 (1 << 28) 68 66 #define AT91_SMC_PS_16 (2 << 28) 69 67 #define AT91_SMC_PS_32 (3 << 28) 70 - 71 - #if defined(AT91_SMC1) /* The AT91SAM9263 has 2 Static Memory contollers */ 72 - #define AT91_SMC1_SETUP(n) (AT91_SMC1 + 0x00 + ((n)*0x10)) /* Setup Register for CS n */ 73 - #define AT91_SMC1_PULSE(n) (AT91_SMC1 + 0x04 + ((n)*0x10)) /* Pulse Register for CS n */ 74 - #define AT91_SMC1_CYCLE(n) (AT91_SMC1 + 0x08 + ((n)*0x10)) /* Cycle Register for CS n */ 75 - #define AT91_SMC1_MODE(n) (AT91_SMC1 + 0x0c + ((n)*0x10)) /* Mode Register for CS n */ 76 - #endif 77 68 78 69 #endif
+15 -15
arch/arm/mach-at91/include/mach/at91sam9g45.h
··· 86 86 /* 87 87 * System Peripherals (offset from AT91_BASE_SYS) 88 88 */ 89 - #define AT91_ECC (0xffffe200 - AT91_BASE_SYS) 90 89 #define AT91_DDRSDRC1 (0xffffe400 - AT91_BASE_SYS) 91 90 #define AT91_DDRSDRC0 (0xffffe600 - AT91_BASE_SYS) 92 - #define AT91_SMC (0xffffe800 - AT91_BASE_SYS) 93 91 #define AT91_MATRIX (0xffffea00 - AT91_BASE_SYS) 94 - #define AT91_DMA (0xffffec00 - AT91_BASE_SYS) 95 - #define AT91_DBGU (0xffffee00 - AT91_BASE_SYS) 96 - #define AT91_AIC (0xfffff000 - AT91_BASE_SYS) 97 - #define AT91_PIOA (0xfffff200 - AT91_BASE_SYS) 98 - #define AT91_PIOB (0xfffff400 - AT91_BASE_SYS) 99 - #define AT91_PIOC (0xfffff600 - AT91_BASE_SYS) 100 - #define AT91_PIOD (0xfffff800 - AT91_BASE_SYS) 101 - #define AT91_PIOE (0xfffffa00 - AT91_BASE_SYS) 102 92 #define AT91_PMC (0xfffffc00 - AT91_BASE_SYS) 103 93 #define AT91_RSTC (0xfffffd00 - AT91_BASE_SYS) 104 - #define AT91_SHDWC (0xfffffd10 - AT91_BASE_SYS) 105 - #define AT91_RTT (0xfffffd20 - AT91_BASE_SYS) 106 - #define AT91_PIT (0xfffffd30 - AT91_BASE_SYS) 107 - #define AT91_WDT (0xfffffd40 - AT91_BASE_SYS) 108 94 #define AT91_GPBR (0xfffffd60 - AT91_BASE_SYS) 109 - #define AT91_RTC (0xfffffdb0 - AT91_BASE_SYS) 95 + 96 + #define AT91SAM9G45_BASE_ECC 0xffffe200 97 + #define AT91SAM9G45_BASE_DMA 0xffffec00 98 + #define AT91SAM9G45_BASE_SMC 0xffffe800 99 + #define AT91SAM9G45_BASE_DBGU AT91_BASE_DBGU1 100 + #define AT91SAM9G45_BASE_PIOA 0xfffff200 101 + #define AT91SAM9G45_BASE_PIOB 0xfffff400 102 + #define AT91SAM9G45_BASE_PIOC 0xfffff600 103 + #define AT91SAM9G45_BASE_PIOD 0xfffff800 104 + #define AT91SAM9G45_BASE_PIOE 0xfffffa00 105 + #define AT91SAM9G45_BASE_SHDWC 0xfffffd10 106 + #define AT91SAM9G45_BASE_RTT 0xfffffd20 107 + #define AT91SAM9G45_BASE_PIT 0xfffffd30 108 + #define AT91SAM9G45_BASE_WDT 0xfffffd40 109 + #define AT91SAM9G45_BASE_RTC 0xfffffdb0 110 110 111 111 #define AT91_USART0 AT91SAM9G45_BASE_US0 112 112 #define AT91_USART1 AT91SAM9G45_BASE_US1
+14 -15
arch/arm/mach-at91/include/mach/at91sam9rl.h
··· 69 69 /* 70 70 * System Peripherals (offset from AT91_BASE_SYS) 71 71 */ 72 - #define AT91_DMA (0xffffe600 - AT91_BASE_SYS) 73 - #define AT91_ECC (0xffffe800 - AT91_BASE_SYS) 74 72 #define AT91_SDRAMC0 (0xffffea00 - AT91_BASE_SYS) 75 - #define AT91_SMC (0xffffec00 - AT91_BASE_SYS) 76 73 #define AT91_MATRIX (0xffffee00 - AT91_BASE_SYS) 77 - #define AT91_CCFG (0xffffef10 - AT91_BASE_SYS) 78 - #define AT91_AIC (0xfffff000 - AT91_BASE_SYS) 79 - #define AT91_DBGU (0xfffff200 - AT91_BASE_SYS) 80 - #define AT91_PIOA (0xfffff400 - AT91_BASE_SYS) 81 - #define AT91_PIOB (0xfffff600 - AT91_BASE_SYS) 82 - #define AT91_PIOC (0xfffff800 - AT91_BASE_SYS) 83 - #define AT91_PIOD (0xfffffa00 - AT91_BASE_SYS) 84 74 #define AT91_PMC (0xfffffc00 - AT91_BASE_SYS) 85 75 #define AT91_RSTC (0xfffffd00 - AT91_BASE_SYS) 86 - #define AT91_SHDWC (0xfffffd10 - AT91_BASE_SYS) 87 - #define AT91_RTT (0xfffffd20 - AT91_BASE_SYS) 88 - #define AT91_PIT (0xfffffd30 - AT91_BASE_SYS) 89 - #define AT91_WDT (0xfffffd40 - AT91_BASE_SYS) 90 76 #define AT91_SCKCR (0xfffffd50 - AT91_BASE_SYS) 91 77 #define AT91_GPBR (0xfffffd60 - AT91_BASE_SYS) 92 - #define AT91_RTC (0xfffffe00 - AT91_BASE_SYS) 78 + 79 + #define AT91SAM9RL_BASE_DMA 0xffffe600 80 + #define AT91SAM9RL_BASE_ECC 0xffffe800 81 + #define AT91SAM9RL_BASE_SMC 0xffffec00 82 + #define AT91SAM9RL_BASE_DBGU AT91_BASE_DBGU0 83 + #define AT91SAM9RL_BASE_PIOA 0xfffff400 84 + #define AT91SAM9RL_BASE_PIOB 0xfffff600 85 + #define AT91SAM9RL_BASE_PIOC 0xfffff800 86 + #define AT91SAM9RL_BASE_PIOD 0xfffffa00 87 + #define AT91SAM9RL_BASE_SHDWC 0xfffffd10 88 + #define AT91SAM9RL_BASE_RTT 0xfffffd20 89 + #define AT91SAM9RL_BASE_PIT 0xfffffd30 90 + #define AT91SAM9RL_BASE_WDT 0xfffffd40 91 + #define AT91SAM9RL_BASE_RTC 0xfffffe00 93 92 94 93 #define AT91_USART0 AT91SAM9RL_BASE_US0 95 94 #define AT91_USART1 AT91SAM9RL_BASE_US1
-1
arch/arm/mach-at91/include/mach/at91x40.h
··· 40 40 #define AT91_PIOA (0xffff0000 - AT91_BASE_SYS) /* PIO Controller A */ 41 41 #define AT91_PS (0xffff4000 - AT91_BASE_SYS) /* Power Save */ 42 42 #define AT91_WD (0xffff8000 - AT91_BASE_SYS) /* Watchdog Timer */ 43 - #define AT91_AIC (0xfffff000 - AT91_BASE_SYS) /* Advanced Interrupt Controller */ 44 43 45 44 /* 46 45 * The AT91x40 series doesn't have a debug unit like the other AT91 parts.
+16 -26
arch/arm/mach-at91/include/mach/board.h
··· 40 40 #include <linux/atmel-mci.h> 41 41 #include <sound/atmel-ac97c.h> 42 42 #include <linux/serial.h> 43 + #include <linux/platform_data/macb.h> 43 44 44 45 /* USB Device */ 45 46 struct at91_udc_data { 46 - u8 vbus_pin; /* high == host powering us */ 47 + int vbus_pin; /* high == host powering us */ 47 48 u8 vbus_active_low; /* vbus polarity */ 48 49 u8 vbus_polled; /* Use polling, not interrupt */ 49 - u8 pullup_pin; /* active == D+ pulled up */ 50 + int pullup_pin; /* active == D+ pulled up */ 50 51 u8 pullup_active_low; /* true == pullup_pin is active low */ 51 52 }; 52 53 extern void __init at91_add_device_udc(struct at91_udc_data *data); ··· 57 56 58 57 /* Compact Flash */ 59 58 struct at91_cf_data { 60 - u8 irq_pin; /* I/O IRQ */ 61 - u8 det_pin; /* Card detect */ 62 - u8 vcc_pin; /* power switching */ 63 - u8 rst_pin; /* card reset */ 59 + int irq_pin; /* I/O IRQ */ 60 + int det_pin; /* Card detect */ 61 + int vcc_pin; /* power switching */ 62 + int rst_pin; /* card reset */ 64 63 u8 chipselect; /* EBI Chip Select number */ 65 64 u8 flags; 66 65 #define AT91_CF_TRUE_IDE 0x01 ··· 71 70 /* MMC / SD */ 72 71 /* at91_mci platform config */ 73 72 struct at91_mmc_data { 74 - u8 det_pin; /* card detect IRQ */ 73 + int det_pin; /* card detect IRQ */ 75 74 unsigned slot_b:1; /* uses Slot B */ 76 75 unsigned wire4:1; /* (SD) supports DAT0..DAT3 */ 77 - u8 wp_pin; /* (SD) writeprotect detect */ 78 - u8 vcc_pin; /* power switching (high == on) */ 76 + int wp_pin; /* (SD) writeprotect detect */ 77 + int vcc_pin; /* power switching (high == on) */ 79 78 }; 80 79 extern void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data); 81 80 82 81 /* atmel-mci platform config */ 83 82 extern void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data); 84 83 85 - /* Ethernet (EMAC & MACB) */ 86 - struct at91_eth_data { 87 - u32 phy_mask; 88 - u8 phy_irq_pin; /* PHY IRQ */ 89 - u8 is_rmii; /* using RMII interface? */ 90 - }; 91 - extern void __init at91_add_device_eth(struct at91_eth_data *data); 92 - 93 - #if defined(CONFIG_ARCH_AT91SAM9260) || defined(CONFIG_ARCH_AT91SAM9263) || defined(CONFIG_ARCH_AT91SAM9G20) || defined(CONFIG_ARCH_AT91CAP9) \ 94 - || defined(CONFIG_ARCH_AT91SAM9G45) 95 - #define eth_platform_data at91_eth_data 96 - #endif 84 + extern void __init at91_add_device_eth(struct macb_platform_data *data); 97 85 98 86 /* USB Host */ 99 87 struct at91_usbh_data { 100 88 u8 ports; /* number of ports on root hub */ 101 - u8 vbus_pin[2]; /* port power-control pin */ 89 + int vbus_pin[2]; /* port power-control pin */ 102 90 u8 vbus_pin_inverted; 103 91 u8 overcurrent_supported; 104 - u8 overcurrent_pin[2]; 92 + int overcurrent_pin[2]; 105 93 u8 overcurrent_status[2]; 106 94 u8 overcurrent_changed[2]; 107 95 }; ··· 100 110 101 111 /* NAND / SmartMedia */ 102 112 struct atmel_nand_data { 103 - u8 enable_pin; /* chip enable */ 104 - u8 det_pin; /* card detect */ 105 - u8 rdy_pin; /* ready/busy */ 113 + int enable_pin; /* chip enable */ 114 + int det_pin; /* card detect */ 115 + int rdy_pin; /* ready/busy */ 106 116 u8 rdy_pin_active_low; /* rdy_pin value is inverted */ 107 117 u8 ale; /* address line number connected to ALE */ 108 118 u8 cle; /* address line number connected to CLE */
+8 -2
arch/arm/mach-at91/include/mach/debug-macro.S
··· 14 14 #include <mach/hardware.h> 15 15 #include <mach/at91_dbgu.h> 16 16 17 + #if defined(CONFIG_AT91_DEBUG_LL_DBGU0) 18 + #define AT91_DBGU AT91_BASE_DBGU0 19 + #else 20 + #define AT91_DBGU AT91_BASE_DBGU1 21 + #endif 22 + 17 23 .macro addruart, rp, rv, tmp 18 - ldr \rp, =(AT91_BASE_SYS + AT91_DBGU) @ System peripherals (phys address) 19 - ldr \rv, =(AT91_VA_BASE_SYS + AT91_DBGU) @ System peripherals (virt address) 24 + ldr \rp, =AT91_DBGU @ System peripherals (phys address) 25 + ldr \rv, =AT91_IO_P2V(AT91_DBGU) @ System peripherals (virt address) 20 26 .endm 21 27 22 28 .macro senduart,rd,rx
+6 -5
arch/arm/mach-at91/include/mach/entry-macro.S
··· 17 17 .endm 18 18 19 19 .macro get_irqnr_preamble, base, tmp 20 - ldr \base, =(AT91_VA_BASE_SYS + AT91_AIC) @ base virtual address of AIC peripheral 20 + ldr \base, =at91_aic_base @ base virtual address of AIC peripheral 21 + ldr \base, [\base] 21 22 .endm 22 23 23 24 .macro arch_ret_to_user, tmp1, tmp2 24 25 .endm 25 26 26 27 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp 27 - ldr \irqnr, [\base, #(AT91_AIC_IVR - AT91_AIC)] @ read IRQ vector register: de-asserts nIRQ to processor (and clears interrupt) 28 - ldr \irqstat, [\base, #(AT91_AIC_ISR - AT91_AIC)] @ read interrupt source number 29 - teq \irqstat, #0 @ ISR is 0 when no current interrupt, or spurious interrupt 30 - streq \tmp, [\base, #(AT91_AIC_EOICR - AT91_AIC)] @ not going to be handled further, then ACK it now. 28 + ldr \irqnr, [\base, #AT91_AIC_IVR] @ read IRQ vector register: de-asserts nIRQ to processor (and clears interrupt) 29 + ldr \irqstat, [\base, #AT91_AIC_ISR] @ read interrupt source number 30 + teq \irqstat, #0 @ ISR is 0 when no current interrupt, or spurious interrupt 31 + streq \tmp, [\base, #AT91_AIC_EOICR] @ not going to be handled further, then ACK it now. 31 32 .endm 32 33
+163 -165
arch/arm/mach-at91/include/mach/gpio.h
··· 16 16 #include <linux/kernel.h> 17 17 #include <asm/irq.h> 18 18 19 - #define PIN_BASE NR_AIC_IRQS 20 - 21 19 #define MAX_GPIO_BANKS 5 22 - #define NR_BUILTIN_GPIO (PIN_BASE + (MAX_GPIO_BANKS * 32)) 20 + #define NR_BUILTIN_GPIO (MAX_GPIO_BANKS * 32) 23 21 24 22 /* these pin numbers double as IRQ numbers, like AT91xxx_ID_* values */ 25 23 26 - #define AT91_PIN_PA0 (PIN_BASE + 0x00 + 0) 27 - #define AT91_PIN_PA1 (PIN_BASE + 0x00 + 1) 28 - #define AT91_PIN_PA2 (PIN_BASE + 0x00 + 2) 29 - #define AT91_PIN_PA3 (PIN_BASE + 0x00 + 3) 30 - #define AT91_PIN_PA4 (PIN_BASE + 0x00 + 4) 31 - #define AT91_PIN_PA5 (PIN_BASE + 0x00 + 5) 32 - #define AT91_PIN_PA6 (PIN_BASE + 0x00 + 6) 33 - #define AT91_PIN_PA7 (PIN_BASE + 0x00 + 7) 34 - #define AT91_PIN_PA8 (PIN_BASE + 0x00 + 8) 35 - #define AT91_PIN_PA9 (PIN_BASE + 0x00 + 9) 36 - #define AT91_PIN_PA10 (PIN_BASE + 0x00 + 10) 37 - #define AT91_PIN_PA11 (PIN_BASE + 0x00 + 11) 38 - #define AT91_PIN_PA12 (PIN_BASE + 0x00 + 12) 39 - #define AT91_PIN_PA13 (PIN_BASE + 0x00 + 13) 40 - #define AT91_PIN_PA14 (PIN_BASE + 0x00 + 14) 41 - #define AT91_PIN_PA15 (PIN_BASE + 0x00 + 15) 42 - #define AT91_PIN_PA16 (PIN_BASE + 0x00 + 16) 43 - #define AT91_PIN_PA17 (PIN_BASE + 0x00 + 17) 44 - #define AT91_PIN_PA18 (PIN_BASE + 0x00 + 18) 45 - #define AT91_PIN_PA19 (PIN_BASE + 0x00 + 19) 46 - #define AT91_PIN_PA20 (PIN_BASE + 0x00 + 20) 47 - #define AT91_PIN_PA21 (PIN_BASE + 0x00 + 21) 48 - #define AT91_PIN_PA22 (PIN_BASE + 0x00 + 22) 49 - #define AT91_PIN_PA23 (PIN_BASE + 0x00 + 23) 50 - #define AT91_PIN_PA24 (PIN_BASE + 0x00 + 24) 51 - #define AT91_PIN_PA25 (PIN_BASE + 0x00 + 25) 52 - #define AT91_PIN_PA26 (PIN_BASE + 0x00 + 26) 53 - #define AT91_PIN_PA27 (PIN_BASE + 0x00 + 27) 54 - #define AT91_PIN_PA28 (PIN_BASE + 0x00 + 28) 55 - #define AT91_PIN_PA29 (PIN_BASE + 0x00 + 29) 56 - #define AT91_PIN_PA30 (PIN_BASE + 0x00 + 30) 57 - #define AT91_PIN_PA31 (PIN_BASE + 0x00 + 31) 24 + #define AT91_PIN_PA0 (0x00 + 0) 25 + #define AT91_PIN_PA1 (0x00 + 1) 26 + #define AT91_PIN_PA2 (0x00 + 2) 27 + #define AT91_PIN_PA3 (0x00 + 3) 28 + #define AT91_PIN_PA4 (0x00 + 4) 29 + #define AT91_PIN_PA5 (0x00 + 5) 30 + #define AT91_PIN_PA6 (0x00 + 6) 31 + #define AT91_PIN_PA7 (0x00 + 7) 32 + #define AT91_PIN_PA8 (0x00 + 8) 33 + #define AT91_PIN_PA9 (0x00 + 9) 34 + #define AT91_PIN_PA10 (0x00 + 10) 35 + #define AT91_PIN_PA11 (0x00 + 11) 36 + #define AT91_PIN_PA12 (0x00 + 12) 37 + #define AT91_PIN_PA13 (0x00 + 13) 38 + #define AT91_PIN_PA14 (0x00 + 14) 39 + #define AT91_PIN_PA15 (0x00 + 15) 40 + #define AT91_PIN_PA16 (0x00 + 16) 41 + #define AT91_PIN_PA17 (0x00 + 17) 42 + #define AT91_PIN_PA18 (0x00 + 18) 43 + #define AT91_PIN_PA19 (0x00 + 19) 44 + #define AT91_PIN_PA20 (0x00 + 20) 45 + #define AT91_PIN_PA21 (0x00 + 21) 46 + #define AT91_PIN_PA22 (0x00 + 22) 47 + #define AT91_PIN_PA23 (0x00 + 23) 48 + #define AT91_PIN_PA24 (0x00 + 24) 49 + #define AT91_PIN_PA25 (0x00 + 25) 50 + #define AT91_PIN_PA26 (0x00 + 26) 51 + #define AT91_PIN_PA27 (0x00 + 27) 52 + #define AT91_PIN_PA28 (0x00 + 28) 53 + #define AT91_PIN_PA29 (0x00 + 29) 54 + #define AT91_PIN_PA30 (0x00 + 30) 55 + #define AT91_PIN_PA31 (0x00 + 31) 58 56 59 - #define AT91_PIN_PB0 (PIN_BASE + 0x20 + 0) 60 - #define AT91_PIN_PB1 (PIN_BASE + 0x20 + 1) 61 - #define AT91_PIN_PB2 (PIN_BASE + 0x20 + 2) 62 - #define AT91_PIN_PB3 (PIN_BASE + 0x20 + 3) 63 - #define AT91_PIN_PB4 (PIN_BASE + 0x20 + 4) 64 - #define AT91_PIN_PB5 (PIN_BASE + 0x20 + 5) 65 - #define AT91_PIN_PB6 (PIN_BASE + 0x20 + 6) 66 - #define AT91_PIN_PB7 (PIN_BASE + 0x20 + 7) 67 - #define AT91_PIN_PB8 (PIN_BASE + 0x20 + 8) 68 - #define AT91_PIN_PB9 (PIN_BASE + 0x20 + 9) 69 - #define AT91_PIN_PB10 (PIN_BASE + 0x20 + 10) 70 - #define AT91_PIN_PB11 (PIN_BASE + 0x20 + 11) 71 - #define AT91_PIN_PB12 (PIN_BASE + 0x20 + 12) 72 - #define AT91_PIN_PB13 (PIN_BASE + 0x20 + 13) 73 - #define AT91_PIN_PB14 (PIN_BASE + 0x20 + 14) 74 - #define AT91_PIN_PB15 (PIN_BASE + 0x20 + 15) 75 - #define AT91_PIN_PB16 (PIN_BASE + 0x20 + 16) 76 - #define AT91_PIN_PB17 (PIN_BASE + 0x20 + 17) 77 - #define AT91_PIN_PB18 (PIN_BASE + 0x20 + 18) 78 - #define AT91_PIN_PB19 (PIN_BASE + 0x20 + 19) 79 - #define AT91_PIN_PB20 (PIN_BASE + 0x20 + 20) 80 - #define AT91_PIN_PB21 (PIN_BASE + 0x20 + 21) 81 - #define AT91_PIN_PB22 (PIN_BASE + 0x20 + 22) 82 - #define AT91_PIN_PB23 (PIN_BASE + 0x20 + 23) 83 - #define AT91_PIN_PB24 (PIN_BASE + 0x20 + 24) 84 - #define AT91_PIN_PB25 (PIN_BASE + 0x20 + 25) 85 - #define AT91_PIN_PB26 (PIN_BASE + 0x20 + 26) 86 - #define AT91_PIN_PB27 (PIN_BASE + 0x20 + 27) 87 - #define AT91_PIN_PB28 (PIN_BASE + 0x20 + 28) 88 - #define AT91_PIN_PB29 (PIN_BASE + 0x20 + 29) 89 - #define AT91_PIN_PB30 (PIN_BASE + 0x20 + 30) 90 - #define AT91_PIN_PB31 (PIN_BASE + 0x20 + 31) 57 + #define AT91_PIN_PB0 (0x20 + 0) 58 + #define AT91_PIN_PB1 (0x20 + 1) 59 + #define AT91_PIN_PB2 (0x20 + 2) 60 + #define AT91_PIN_PB3 (0x20 + 3) 61 + #define AT91_PIN_PB4 (0x20 + 4) 62 + #define AT91_PIN_PB5 (0x20 + 5) 63 + #define AT91_PIN_PB6 (0x20 + 6) 64 + #define AT91_PIN_PB7 (0x20 + 7) 65 + #define AT91_PIN_PB8 (0x20 + 8) 66 + #define AT91_PIN_PB9 (0x20 + 9) 67 + #define AT91_PIN_PB10 (0x20 + 10) 68 + #define AT91_PIN_PB11 (0x20 + 11) 69 + #define AT91_PIN_PB12 (0x20 + 12) 70 + #define AT91_PIN_PB13 (0x20 + 13) 71 + #define AT91_PIN_PB14 (0x20 + 14) 72 + #define AT91_PIN_PB15 (0x20 + 15) 73 + #define AT91_PIN_PB16 (0x20 + 16) 74 + #define AT91_PIN_PB17 (0x20 + 17) 75 + #define AT91_PIN_PB18 (0x20 + 18) 76 + #define AT91_PIN_PB19 (0x20 + 19) 77 + #define AT91_PIN_PB20 (0x20 + 20) 78 + #define AT91_PIN_PB21 (0x20 + 21) 79 + #define AT91_PIN_PB22 (0x20 + 22) 80 + #define AT91_PIN_PB23 (0x20 + 23) 81 + #define AT91_PIN_PB24 (0x20 + 24) 82 + #define AT91_PIN_PB25 (0x20 + 25) 83 + #define AT91_PIN_PB26 (0x20 + 26) 84 + #define AT91_PIN_PB27 (0x20 + 27) 85 + #define AT91_PIN_PB28 (0x20 + 28) 86 + #define AT91_PIN_PB29 (0x20 + 29) 87 + #define AT91_PIN_PB30 (0x20 + 30) 88 + #define AT91_PIN_PB31 (0x20 + 31) 91 89 92 - #define AT91_PIN_PC0 (PIN_BASE + 0x40 + 0) 93 - #define AT91_PIN_PC1 (PIN_BASE + 0x40 + 1) 94 - #define AT91_PIN_PC2 (PIN_BASE + 0x40 + 2) 95 - #define AT91_PIN_PC3 (PIN_BASE + 0x40 + 3) 96 - #define AT91_PIN_PC4 (PIN_BASE + 0x40 + 4) 97 - #define AT91_PIN_PC5 (PIN_BASE + 0x40 + 5) 98 - #define AT91_PIN_PC6 (PIN_BASE + 0x40 + 6) 99 - #define AT91_PIN_PC7 (PIN_BASE + 0x40 + 7) 100 - #define AT91_PIN_PC8 (PIN_BASE + 0x40 + 8) 101 - #define AT91_PIN_PC9 (PIN_BASE + 0x40 + 9) 102 - #define AT91_PIN_PC10 (PIN_BASE + 0x40 + 10) 103 - #define AT91_PIN_PC11 (PIN_BASE + 0x40 + 11) 104 - #define AT91_PIN_PC12 (PIN_BASE + 0x40 + 12) 105 - #define AT91_PIN_PC13 (PIN_BASE + 0x40 + 13) 106 - #define AT91_PIN_PC14 (PIN_BASE + 0x40 + 14) 107 - #define AT91_PIN_PC15 (PIN_BASE + 0x40 + 15) 108 - #define AT91_PIN_PC16 (PIN_BASE + 0x40 + 16) 109 - #define AT91_PIN_PC17 (PIN_BASE + 0x40 + 17) 110 - #define AT91_PIN_PC18 (PIN_BASE + 0x40 + 18) 111 - #define AT91_PIN_PC19 (PIN_BASE + 0x40 + 19) 112 - #define AT91_PIN_PC20 (PIN_BASE + 0x40 + 20) 113 - #define AT91_PIN_PC21 (PIN_BASE + 0x40 + 21) 114 - #define AT91_PIN_PC22 (PIN_BASE + 0x40 + 22) 115 - #define AT91_PIN_PC23 (PIN_BASE + 0x40 + 23) 116 - #define AT91_PIN_PC24 (PIN_BASE + 0x40 + 24) 117 - #define AT91_PIN_PC25 (PIN_BASE + 0x40 + 25) 118 - #define AT91_PIN_PC26 (PIN_BASE + 0x40 + 26) 119 - #define AT91_PIN_PC27 (PIN_BASE + 0x40 + 27) 120 - #define AT91_PIN_PC28 (PIN_BASE + 0x40 + 28) 121 - #define AT91_PIN_PC29 (PIN_BASE + 0x40 + 29) 122 - #define AT91_PIN_PC30 (PIN_BASE + 0x40 + 30) 123 - #define AT91_PIN_PC31 (PIN_BASE + 0x40 + 31) 90 + #define AT91_PIN_PC0 (0x40 + 0) 91 + #define AT91_PIN_PC1 (0x40 + 1) 92 + #define AT91_PIN_PC2 (0x40 + 2) 93 + #define AT91_PIN_PC3 (0x40 + 3) 94 + #define AT91_PIN_PC4 (0x40 + 4) 95 + #define AT91_PIN_PC5 (0x40 + 5) 96 + #define AT91_PIN_PC6 (0x40 + 6) 97 + #define AT91_PIN_PC7 (0x40 + 7) 98 + #define AT91_PIN_PC8 (0x40 + 8) 99 + #define AT91_PIN_PC9 (0x40 + 9) 100 + #define AT91_PIN_PC10 (0x40 + 10) 101 + #define AT91_PIN_PC11 (0x40 + 11) 102 + #define AT91_PIN_PC12 (0x40 + 12) 103 + #define AT91_PIN_PC13 (0x40 + 13) 104 + #define AT91_PIN_PC14 (0x40 + 14) 105 + #define AT91_PIN_PC15 (0x40 + 15) 106 + #define AT91_PIN_PC16 (0x40 + 16) 107 + #define AT91_PIN_PC17 (0x40 + 17) 108 + #define AT91_PIN_PC18 (0x40 + 18) 109 + #define AT91_PIN_PC19 (0x40 + 19) 110 + #define AT91_PIN_PC20 (0x40 + 20) 111 + #define AT91_PIN_PC21 (0x40 + 21) 112 + #define AT91_PIN_PC22 (0x40 + 22) 113 + #define AT91_PIN_PC23 (0x40 + 23) 114 + #define AT91_PIN_PC24 (0x40 + 24) 115 + #define AT91_PIN_PC25 (0x40 + 25) 116 + #define AT91_PIN_PC26 (0x40 + 26) 117 + #define AT91_PIN_PC27 (0x40 + 27) 118 + #define AT91_PIN_PC28 (0x40 + 28) 119 + #define AT91_PIN_PC29 (0x40 + 29) 120 + #define AT91_PIN_PC30 (0x40 + 30) 121 + #define AT91_PIN_PC31 (0x40 + 31) 124 122 125 - #define AT91_PIN_PD0 (PIN_BASE + 0x60 + 0) 126 - #define AT91_PIN_PD1 (PIN_BASE + 0x60 + 1) 127 - #define AT91_PIN_PD2 (PIN_BASE + 0x60 + 2) 128 - #define AT91_PIN_PD3 (PIN_BASE + 0x60 + 3) 129 - #define AT91_PIN_PD4 (PIN_BASE + 0x60 + 4) 130 - #define AT91_PIN_PD5 (PIN_BASE + 0x60 + 5) 131 - #define AT91_PIN_PD6 (PIN_BASE + 0x60 + 6) 132 - #define AT91_PIN_PD7 (PIN_BASE + 0x60 + 7) 133 - #define AT91_PIN_PD8 (PIN_BASE + 0x60 + 8) 134 - #define AT91_PIN_PD9 (PIN_BASE + 0x60 + 9) 135 - #define AT91_PIN_PD10 (PIN_BASE + 0x60 + 10) 136 - #define AT91_PIN_PD11 (PIN_BASE + 0x60 + 11) 137 - #define AT91_PIN_PD12 (PIN_BASE + 0x60 + 12) 138 - #define AT91_PIN_PD13 (PIN_BASE + 0x60 + 13) 139 - #define AT91_PIN_PD14 (PIN_BASE + 0x60 + 14) 140 - #define AT91_PIN_PD15 (PIN_BASE + 0x60 + 15) 141 - #define AT91_PIN_PD16 (PIN_BASE + 0x60 + 16) 142 - #define AT91_PIN_PD17 (PIN_BASE + 0x60 + 17) 143 - #define AT91_PIN_PD18 (PIN_BASE + 0x60 + 18) 144 - #define AT91_PIN_PD19 (PIN_BASE + 0x60 + 19) 145 - #define AT91_PIN_PD20 (PIN_BASE + 0x60 + 20) 146 - #define AT91_PIN_PD21 (PIN_BASE + 0x60 + 21) 147 - #define AT91_PIN_PD22 (PIN_BASE + 0x60 + 22) 148 - #define AT91_PIN_PD23 (PIN_BASE + 0x60 + 23) 149 - #define AT91_PIN_PD24 (PIN_BASE + 0x60 + 24) 150 - #define AT91_PIN_PD25 (PIN_BASE + 0x60 + 25) 151 - #define AT91_PIN_PD26 (PIN_BASE + 0x60 + 26) 152 - #define AT91_PIN_PD27 (PIN_BASE + 0x60 + 27) 153 - #define AT91_PIN_PD28 (PIN_BASE + 0x60 + 28) 154 - #define AT91_PIN_PD29 (PIN_BASE + 0x60 + 29) 155 - #define AT91_PIN_PD30 (PIN_BASE + 0x60 + 30) 156 - #define AT91_PIN_PD31 (PIN_BASE + 0x60 + 31) 123 + #define AT91_PIN_PD0 (0x60 + 0) 124 + #define AT91_PIN_PD1 (0x60 + 1) 125 + #define AT91_PIN_PD2 (0x60 + 2) 126 + #define AT91_PIN_PD3 (0x60 + 3) 127 + #define AT91_PIN_PD4 (0x60 + 4) 128 + #define AT91_PIN_PD5 (0x60 + 5) 129 + #define AT91_PIN_PD6 (0x60 + 6) 130 + #define AT91_PIN_PD7 (0x60 + 7) 131 + #define AT91_PIN_PD8 (0x60 + 8) 132 + #define AT91_PIN_PD9 (0x60 + 9) 133 + #define AT91_PIN_PD10 (0x60 + 10) 134 + #define AT91_PIN_PD11 (0x60 + 11) 135 + #define AT91_PIN_PD12 (0x60 + 12) 136 + #define AT91_PIN_PD13 (0x60 + 13) 137 + #define AT91_PIN_PD14 (0x60 + 14) 138 + #define AT91_PIN_PD15 (0x60 + 15) 139 + #define AT91_PIN_PD16 (0x60 + 16) 140 + #define AT91_PIN_PD17 (0x60 + 17) 141 + #define AT91_PIN_PD18 (0x60 + 18) 142 + #define AT91_PIN_PD19 (0x60 + 19) 143 + #define AT91_PIN_PD20 (0x60 + 20) 144 + #define AT91_PIN_PD21 (0x60 + 21) 145 + #define AT91_PIN_PD22 (0x60 + 22) 146 + #define AT91_PIN_PD23 (0x60 + 23) 147 + #define AT91_PIN_PD24 (0x60 + 24) 148 + #define AT91_PIN_PD25 (0x60 + 25) 149 + #define AT91_PIN_PD26 (0x60 + 26) 150 + #define AT91_PIN_PD27 (0x60 + 27) 151 + #define AT91_PIN_PD28 (0x60 + 28) 152 + #define AT91_PIN_PD29 (0x60 + 29) 153 + #define AT91_PIN_PD30 (0x60 + 30) 154 + #define AT91_PIN_PD31 (0x60 + 31) 157 155 158 - #define AT91_PIN_PE0 (PIN_BASE + 0x80 + 0) 159 - #define AT91_PIN_PE1 (PIN_BASE + 0x80 + 1) 160 - #define AT91_PIN_PE2 (PIN_BASE + 0x80 + 2) 161 - #define AT91_PIN_PE3 (PIN_BASE + 0x80 + 3) 162 - #define AT91_PIN_PE4 (PIN_BASE + 0x80 + 4) 163 - #define AT91_PIN_PE5 (PIN_BASE + 0x80 + 5) 164 - #define AT91_PIN_PE6 (PIN_BASE + 0x80 + 6) 165 - #define AT91_PIN_PE7 (PIN_BASE + 0x80 + 7) 166 - #define AT91_PIN_PE8 (PIN_BASE + 0x80 + 8) 167 - #define AT91_PIN_PE9 (PIN_BASE + 0x80 + 9) 168 - #define AT91_PIN_PE10 (PIN_BASE + 0x80 + 10) 169 - #define AT91_PIN_PE11 (PIN_BASE + 0x80 + 11) 170 - #define AT91_PIN_PE12 (PIN_BASE + 0x80 + 12) 171 - #define AT91_PIN_PE13 (PIN_BASE + 0x80 + 13) 172 - #define AT91_PIN_PE14 (PIN_BASE + 0x80 + 14) 173 - #define AT91_PIN_PE15 (PIN_BASE + 0x80 + 15) 174 - #define AT91_PIN_PE16 (PIN_BASE + 0x80 + 16) 175 - #define AT91_PIN_PE17 (PIN_BASE + 0x80 + 17) 176 - #define AT91_PIN_PE18 (PIN_BASE + 0x80 + 18) 177 - #define AT91_PIN_PE19 (PIN_BASE + 0x80 + 19) 178 - #define AT91_PIN_PE20 (PIN_BASE + 0x80 + 20) 179 - #define AT91_PIN_PE21 (PIN_BASE + 0x80 + 21) 180 - #define AT91_PIN_PE22 (PIN_BASE + 0x80 + 22) 181 - #define AT91_PIN_PE23 (PIN_BASE + 0x80 + 23) 182 - #define AT91_PIN_PE24 (PIN_BASE + 0x80 + 24) 183 - #define AT91_PIN_PE25 (PIN_BASE + 0x80 + 25) 184 - #define AT91_PIN_PE26 (PIN_BASE + 0x80 + 26) 185 - #define AT91_PIN_PE27 (PIN_BASE + 0x80 + 27) 186 - #define AT91_PIN_PE28 (PIN_BASE + 0x80 + 28) 187 - #define AT91_PIN_PE29 (PIN_BASE + 0x80 + 29) 188 - #define AT91_PIN_PE30 (PIN_BASE + 0x80 + 30) 189 - #define AT91_PIN_PE31 (PIN_BASE + 0x80 + 31) 156 + #define AT91_PIN_PE0 (0x80 + 0) 157 + #define AT91_PIN_PE1 (0x80 + 1) 158 + #define AT91_PIN_PE2 (0x80 + 2) 159 + #define AT91_PIN_PE3 (0x80 + 3) 160 + #define AT91_PIN_PE4 (0x80 + 4) 161 + #define AT91_PIN_PE5 (0x80 + 5) 162 + #define AT91_PIN_PE6 (0x80 + 6) 163 + #define AT91_PIN_PE7 (0x80 + 7) 164 + #define AT91_PIN_PE8 (0x80 + 8) 165 + #define AT91_PIN_PE9 (0x80 + 9) 166 + #define AT91_PIN_PE10 (0x80 + 10) 167 + #define AT91_PIN_PE11 (0x80 + 11) 168 + #define AT91_PIN_PE12 (0x80 + 12) 169 + #define AT91_PIN_PE13 (0x80 + 13) 170 + #define AT91_PIN_PE14 (0x80 + 14) 171 + #define AT91_PIN_PE15 (0x80 + 15) 172 + #define AT91_PIN_PE16 (0x80 + 16) 173 + #define AT91_PIN_PE17 (0x80 + 17) 174 + #define AT91_PIN_PE18 (0x80 + 18) 175 + #define AT91_PIN_PE19 (0x80 + 19) 176 + #define AT91_PIN_PE20 (0x80 + 20) 177 + #define AT91_PIN_PE21 (0x80 + 21) 178 + #define AT91_PIN_PE22 (0x80 + 22) 179 + #define AT91_PIN_PE23 (0x80 + 23) 180 + #define AT91_PIN_PE24 (0x80 + 24) 181 + #define AT91_PIN_PE25 (0x80 + 25) 182 + #define AT91_PIN_PE26 (0x80 + 26) 183 + #define AT91_PIN_PE27 (0x80 + 27) 184 + #define AT91_PIN_PE28 (0x80 + 28) 185 + #define AT91_PIN_PE29 (0x80 + 29) 186 + #define AT91_PIN_PE30 (0x80 + 30) 187 + #define AT91_PIN_PE31 (0x80 + 31) 190 188 191 189 #ifndef __ASSEMBLY__ 192 190 /* setup setup routines, called from board init or driver probe() */ ··· 213 215 214 216 #include <asm/errno.h> 215 217 216 - #define gpio_to_irq(gpio) (gpio) 217 - #define irq_to_gpio(irq) (irq) 218 + #define gpio_to_irq(gpio) (gpio + NR_AIC_IRQS) 219 + #define irq_to_gpio(irq) (irq - NR_AIC_IRQS) 218 220 219 221 #endif /* __ASSEMBLY__ */ 220 222
+12
arch/arm/mach-at91/include/mach/hardware.h
··· 16 16 17 17 #include <asm/sizes.h> 18 18 19 + /* DBGU base */ 20 + /* rm9200, 9260/9g20, 9261/9g10, 9rl */ 21 + #define AT91_BASE_DBGU0 0xfffff200 22 + /* 9263, 9g45, cap9 */ 23 + #define AT91_BASE_DBGU1 0xffffee00 24 + 19 25 #if defined(CONFIG_ARCH_AT91RM9200) 20 26 #include <mach/at91rm9200.h> 21 27 #elif defined(CONFIG_ARCH_AT91SAM9260) || defined(CONFIG_ARCH_AT91SAM9G20) ··· 56 50 */ 57 51 #define AT91_BASE_SYS 0xffffc000 58 52 #endif 53 + 54 + /* 55 + * On all at91 have the Advanced Interrupt Controller starts at address 56 + * 0xfffff000 57 + */ 58 + #define AT91_AIC 0xfffff000 59 59 60 60 /* 61 61 * Peripheral identifiers/interrupts.
+1 -1
arch/arm/mach-at91/include/mach/irqs.h
··· 31 31 * Acknowledge interrupt with AIC after interrupt has been handled. 32 32 * (by kernel/irq.c) 33 33 */ 34 - #define irq_finish(irq) do { at91_sys_write(AT91_AIC_EOICR, 0); } while (0) 34 + #define irq_finish(irq) do { at91_aic_write(AT91_AIC_EOICR, 0); } while (0) 35 35 36 36 37 37 /*
+6 -61
arch/arm/mach-at91/include/mach/timex.h
··· 23 23 24 24 #include <mach/hardware.h> 25 25 26 - #if defined(CONFIG_ARCH_AT91RM9200) 27 - 28 - #define CLOCK_TICK_RATE (AT91_SLOW_CLOCK) 29 - 30 - #elif defined(CONFIG_ARCH_AT91SAM9260) 31 - 32 - #if defined(CONFIG_MACH_USB_A9260) || defined(CONFIG_MACH_QIL_A9260) 33 - #define AT91SAM9_MASTER_CLOCK 90000000 34 - #else 35 - #define AT91SAM9_MASTER_CLOCK 99300000 36 - #endif 37 - 38 - #define CLOCK_TICK_RATE (AT91SAM9_MASTER_CLOCK/16) 39 - 40 - #elif defined(CONFIG_ARCH_AT91SAM9261) 41 - 42 - #define AT91SAM9_MASTER_CLOCK 99300000 43 - #define CLOCK_TICK_RATE (AT91SAM9_MASTER_CLOCK/16) 44 - 45 - #elif defined(CONFIG_ARCH_AT91SAM9G10) 46 - 47 - #define AT91SAM9_MASTER_CLOCK 133000000 48 - #define CLOCK_TICK_RATE (AT91SAM9_MASTER_CLOCK/16) 49 - 50 - #elif defined(CONFIG_ARCH_AT91SAM9263) 51 - 52 - #if defined(CONFIG_MACH_USB_A9263) 53 - #define AT91SAM9_MASTER_CLOCK 90000000 54 - #else 55 - #define AT91SAM9_MASTER_CLOCK 99959500 56 - #endif 57 - 58 - #define CLOCK_TICK_RATE (AT91SAM9_MASTER_CLOCK/16) 59 - 60 - #elif defined(CONFIG_ARCH_AT91SAM9RL) 61 - 62 - #define AT91SAM9_MASTER_CLOCK 100000000 63 - #define CLOCK_TICK_RATE (AT91SAM9_MASTER_CLOCK/16) 64 - 65 - #elif defined(CONFIG_ARCH_AT91SAM9G20) 66 - 67 - #if defined(CONFIG_MACH_USB_A9G20) 68 - #define AT91SAM9_MASTER_CLOCK 133000000 69 - #else 70 - #define AT91SAM9_MASTER_CLOCK 132096000 71 - #endif 72 - 73 - #define CLOCK_TICK_RATE (AT91SAM9_MASTER_CLOCK/16) 74 - 75 - #elif defined(CONFIG_ARCH_AT91SAM9G45) 76 - 77 - #define AT91SAM9_MASTER_CLOCK 133333333 78 - #define CLOCK_TICK_RATE (AT91SAM9_MASTER_CLOCK/16) 79 - 80 - #elif defined(CONFIG_ARCH_AT91CAP9) 81 - 82 - #define AT91CAP9_MASTER_CLOCK 100000000 83 - #define CLOCK_TICK_RATE (AT91CAP9_MASTER_CLOCK/16) 84 - 85 - #elif defined(CONFIG_ARCH_AT91X40) 26 + #ifdef CONFIG_ARCH_AT91X40 86 27 87 28 #define AT91X40_MASTER_CLOCK 40000000 88 29 #define CLOCK_TICK_RATE (AT91X40_MASTER_CLOCK) 89 30 90 - #endif 31 + #else 32 + 33 + #define CLOCK_TICK_RATE 12345678 91 34 92 35 #endif 36 + 37 + #endif /* __ASM_ARCH_TIMEX_H */
+4 -2
arch/arm/mach-at91/include/mach/uncompress.h
··· 24 24 #include <linux/io.h> 25 25 #include <linux/atmel_serial.h> 26 26 27 - #if defined(CONFIG_AT91_EARLY_DBGU) 28 - #define UART_OFFSET (AT91_DBGU + AT91_BASE_SYS) 27 + #if defined(CONFIG_AT91_EARLY_DBGU0) 28 + #define UART_OFFSET AT91_BASE_DBGU0 29 + #elif defined(CONFIG_AT91_EARLY_DBGU1) 30 + #define UART_OFFSET AT91_BASE_DBGU1 29 31 #elif defined(CONFIG_AT91_EARLY_USART0) 30 32 #define UART_OFFSET AT91_USART0 31 33 #elif defined(CONFIG_AT91_EARLY_USART1)
+22 -16
arch/arm/mach-at91/irq.c
··· 33 33 #include <asm/mach/irq.h> 34 34 #include <asm/mach/map.h> 35 35 36 + void __iomem *at91_aic_base; 36 37 37 38 static void at91_aic_mask_irq(struct irq_data *d) 38 39 { 39 40 /* Disable interrupt on AIC */ 40 - at91_sys_write(AT91_AIC_IDCR, 1 << d->irq); 41 + at91_aic_write(AT91_AIC_IDCR, 1 << d->irq); 41 42 } 42 43 43 44 static void at91_aic_unmask_irq(struct irq_data *d) 44 45 { 45 46 /* Enable interrupt on AIC */ 46 - at91_sys_write(AT91_AIC_IECR, 1 << d->irq); 47 + at91_aic_write(AT91_AIC_IECR, 1 << d->irq); 47 48 } 48 49 49 50 unsigned int at91_extern_irq; ··· 78 77 return -EINVAL; 79 78 } 80 79 81 - smr = at91_sys_read(AT91_AIC_SMR(d->irq)) & ~AT91_AIC_SRCTYPE; 82 - at91_sys_write(AT91_AIC_SMR(d->irq), smr | srctype); 80 + smr = at91_aic_read(AT91_AIC_SMR(d->irq)) & ~AT91_AIC_SRCTYPE; 81 + at91_aic_write(AT91_AIC_SMR(d->irq), smr | srctype); 83 82 return 0; 84 83 } 85 84 ··· 103 102 104 103 void at91_irq_suspend(void) 105 104 { 106 - backups = at91_sys_read(AT91_AIC_IMR); 107 - at91_sys_write(AT91_AIC_IDCR, backups); 108 - at91_sys_write(AT91_AIC_IECR, wakeups); 105 + backups = at91_aic_read(AT91_AIC_IMR); 106 + at91_aic_write(AT91_AIC_IDCR, backups); 107 + at91_aic_write(AT91_AIC_IECR, wakeups); 109 108 } 110 109 111 110 void at91_irq_resume(void) 112 111 { 113 - at91_sys_write(AT91_AIC_IDCR, wakeups); 114 - at91_sys_write(AT91_AIC_IECR, backups); 112 + at91_aic_write(AT91_AIC_IDCR, wakeups); 113 + at91_aic_write(AT91_AIC_IECR, backups); 115 114 } 116 115 117 116 #else ··· 134 133 { 135 134 unsigned int i; 136 135 136 + at91_aic_base = ioremap(AT91_AIC, 512); 137 + 138 + if (!at91_aic_base) 139 + panic("Impossible to ioremap AT91_AIC\n"); 140 + 137 141 /* 138 142 * The IVR is used by macro get_irqnr_and_base to read and verify. 139 143 * The irq number is NR_AIC_IRQS when a spurious interrupt has occurred. 140 144 */ 141 145 for (i = 0; i < NR_AIC_IRQS; i++) { 142 146 /* Put irq number in Source Vector Register: */ 143 - at91_sys_write(AT91_AIC_SVR(i), i); 147 + at91_aic_write(AT91_AIC_SVR(i), i); 144 148 /* Active Low interrupt, with the specified priority */ 145 - at91_sys_write(AT91_AIC_SMR(i), AT91_AIC_SRCTYPE_LOW | priority[i]); 149 + at91_aic_write(AT91_AIC_SMR(i), AT91_AIC_SRCTYPE_LOW | priority[i]); 146 150 147 151 irq_set_chip_and_handler(i, &at91_aic_chip, handle_level_irq); 148 152 set_irq_flags(i, IRQF_VALID | IRQF_PROBE); 149 153 150 154 /* Perform 8 End Of Interrupt Command to make sure AIC will not Lock out nIRQ */ 151 155 if (i < 8) 152 - at91_sys_write(AT91_AIC_EOICR, 0); 156 + at91_aic_write(AT91_AIC_EOICR, 0); 153 157 } 154 158 155 159 /* 156 160 * Spurious Interrupt ID in Spurious Vector Register is NR_AIC_IRQS 157 161 * When there is no current interrupt, the IRQ Vector Register reads the value stored in AIC_SPU 158 162 */ 159 - at91_sys_write(AT91_AIC_SPU, NR_AIC_IRQS); 163 + at91_aic_write(AT91_AIC_SPU, NR_AIC_IRQS); 160 164 161 165 /* No debugging in AIC: Debug (Protect) Control Register */ 162 - at91_sys_write(AT91_AIC_DCR, 0); 166 + at91_aic_write(AT91_AIC_DCR, 0); 163 167 164 168 /* Disable and clear all interrupts initially */ 165 - at91_sys_write(AT91_AIC_IDCR, 0xFFFFFFFF); 166 - at91_sys_write(AT91_AIC_ICCR, 0xFFFFFFFF); 169 + at91_aic_write(AT91_AIC_IDCR, 0xFFFFFFFF); 170 + at91_aic_write(AT91_AIC_ICCR, 0xFFFFFFFF); 167 171 }
+7 -4
arch/arm/mach-at91/pm.c
··· 34 34 /* 35 35 * Show the reason for the previous system reset. 36 36 */ 37 - #if defined(AT91_SHDWC) 37 + #if defined(AT91_RSTC) 38 38 39 39 #include <mach/at91_rstc.h> 40 40 #include <mach/at91_shdwc.h> ··· 58 58 char *reason, *r2 = reset; 59 59 u32 reset_type, wake_type; 60 60 61 + if (!at91_shdwc_base) 62 + return; 63 + 61 64 reset_type = at91_sys_read(AT91_RSTC_SR) & AT91_RSTC_RSTTYP; 62 - wake_type = at91_sys_read(AT91_SHDW_SR); 65 + wake_type = at91_shdwc_read(AT91_SHDW_SR); 63 66 64 67 switch (reset_type) { 65 68 case AT91_RSTC_RSTTYP_GENERAL: ··· 218 215 | (1 << AT91_ID_FIQ) 219 216 | (1 << AT91_ID_SYS) 220 217 | (at91_extern_irq)) 221 - & at91_sys_read(AT91_AIC_IMR), 218 + & at91_aic_read(AT91_AIC_IMR), 222 219 state); 223 220 224 221 switch (state) { ··· 286 283 } 287 284 288 285 pr_debug("AT91: PM - wakeup %08x\n", 289 - at91_sys_read(AT91_AIC_IPR) & at91_sys_read(AT91_AIC_IMR)); 286 + at91_aic_read(AT91_AIC_IPR) & at91_aic_read(AT91_AIC_IMR)); 290 287 291 288 error: 292 289 target_state = PM_SUSPEND_ON;
+41 -21
arch/arm/mach-at91/sam9_smc.c
··· 10 10 11 11 #include <linux/module.h> 12 12 #include <linux/io.h> 13 + #include <linux/of.h> 14 + #include <linux/of_address.h> 13 15 14 16 #include <mach/at91sam9_smc.h> 15 17 16 18 #include "sam9_smc.h" 17 19 18 - void __init sam9_smc_configure(int cs, struct sam9_smc_config* config) 20 + 21 + #define AT91_SMC_CS(id, n) (smc_base_addr[id] + ((n) * 0x10)) 22 + 23 + static void __iomem *smc_base_addr[2]; 24 + 25 + static void __init sam9_smc_cs_configure(void __iomem *base, struct sam9_smc_config* config) 19 26 { 27 + 20 28 /* Setup register */ 21 - at91_sys_write(AT91_SMC_SETUP(cs), 22 - AT91_SMC_NWESETUP_(config->nwe_setup) 23 - | AT91_SMC_NCS_WRSETUP_(config->ncs_write_setup) 24 - | AT91_SMC_NRDSETUP_(config->nrd_setup) 25 - | AT91_SMC_NCS_RDSETUP_(config->ncs_read_setup) 26 - ); 29 + __raw_writel(AT91_SMC_NWESETUP_(config->nwe_setup) 30 + | AT91_SMC_NCS_WRSETUP_(config->ncs_write_setup) 31 + | AT91_SMC_NRDSETUP_(config->nrd_setup) 32 + | AT91_SMC_NCS_RDSETUP_(config->ncs_read_setup), 33 + base + AT91_SMC_SETUP); 27 34 28 35 /* Pulse register */ 29 - at91_sys_write(AT91_SMC_PULSE(cs), 30 - AT91_SMC_NWEPULSE_(config->nwe_pulse) 31 - | AT91_SMC_NCS_WRPULSE_(config->ncs_write_pulse) 32 - | AT91_SMC_NRDPULSE_(config->nrd_pulse) 33 - | AT91_SMC_NCS_RDPULSE_(config->ncs_read_pulse) 34 - ); 36 + __raw_writel(AT91_SMC_NWEPULSE_(config->nwe_pulse) 37 + | AT91_SMC_NCS_WRPULSE_(config->ncs_write_pulse) 38 + | AT91_SMC_NRDPULSE_(config->nrd_pulse) 39 + | AT91_SMC_NCS_RDPULSE_(config->ncs_read_pulse), 40 + base + AT91_SMC_PULSE); 35 41 36 42 /* Cycle register */ 37 - at91_sys_write(AT91_SMC_CYCLE(cs), 38 - AT91_SMC_NWECYCLE_(config->write_cycle) 39 - | AT91_SMC_NRDCYCLE_(config->read_cycle) 40 - ); 43 + __raw_writel(AT91_SMC_NWECYCLE_(config->write_cycle) 44 + | AT91_SMC_NRDCYCLE_(config->read_cycle), 45 + base + AT91_SMC_CYCLE); 41 46 42 47 /* Mode register */ 43 - at91_sys_write(AT91_SMC_MODE(cs), 44 - config->mode 45 - | AT91_SMC_TDF_(config->tdf_cycles) 46 - ); 48 + __raw_writel(config->mode 49 + | AT91_SMC_TDF_(config->tdf_cycles), 50 + base + AT91_SMC_MODE); 51 + } 52 + 53 + void __init sam9_smc_configure(int id, int cs, struct sam9_smc_config* config) 54 + { 55 + sam9_smc_cs_configure(AT91_SMC_CS(id, cs), config); 56 + } 57 + 58 + void __init at91sam9_ioremap_smc(int id, u32 addr) 59 + { 60 + if (id > 1) { 61 + pr_warn("%s: id > 2\n", __func__); 62 + return; 63 + } 64 + smc_base_addr[id] = ioremap(addr, 512); 65 + if (!smc_base_addr[id]) 66 + pr_warn("Impossible to ioremap smc.%d 0x%x\n", id, addr); 47 67 }
+2 -1
arch/arm/mach-at91/sam9_smc.h
··· 30 30 u8 tdf_cycles:4; 31 31 }; 32 32 33 - extern void __init sam9_smc_configure(int cs, struct sam9_smc_config* config); 33 + extern void __init sam9_smc_configure(int id, int cs, struct sam9_smc_config* config); 34 + extern void __init at91sam9_ioremap_smc(int id, u32 addr);
+21 -5
arch/arm/mach-at91/setup.c
··· 8 8 #include <linux/module.h> 9 9 #include <linux/io.h> 10 10 #include <linux/mm.h> 11 + #include <linux/pm.h> 11 12 12 13 #include <asm/mach/map.h> 13 14 ··· 16 15 #include <mach/cpu.h> 17 16 #include <mach/at91_dbgu.h> 18 17 #include <mach/at91_pmc.h> 18 + #include <mach/at91_shdwc.h> 19 19 20 20 #include "soc.h" 21 21 #include "generic.h" ··· 74 72 .length = SZ_16K, 75 73 .type = MT_DEVICE, 76 74 }; 77 - 78 - #define AT91_DBGU0 0xfffff200 79 - #define AT91_DBGU1 0xffffee00 80 75 81 76 static void __init soc_detect(u32 dbgu_base) 82 77 { ··· 247 248 at91_soc_initdata.type = AT91_SOC_NONE; 248 249 at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE; 249 250 250 - soc_detect(AT91_DBGU0); 251 + soc_detect(AT91_BASE_DBGU0); 251 252 if (!at91_soc_is_detected()) 252 - soc_detect(AT91_DBGU1); 253 + soc_detect(AT91_BASE_DBGU1); 253 254 254 255 if (!at91_soc_is_detected()) 255 256 panic("AT91: Impossible to detect the SOC type"); ··· 266 267 at91_boot_soc.map_io(); 267 268 } 268 269 270 + void __iomem *at91_shdwc_base = NULL; 271 + 272 + static void at91sam9_poweroff(void) 273 + { 274 + at91_shdwc_write(AT91_SHDW_CR, AT91_SHDW_KEY | AT91_SHDW_SHDW); 275 + } 276 + 277 + void __init at91_ioremap_shdwc(u32 base_addr) 278 + { 279 + at91_shdwc_base = ioremap(base_addr, 16); 280 + if (!at91_shdwc_base) 281 + panic("Impossible to ioremap at91_shdwc_base\n"); 282 + pm_power_off = at91sam9_poweroff; 283 + } 284 + 269 285 void __init at91_initialize(unsigned long main_clock) 270 286 { 287 + at91_boot_soc.ioremap_registers(); 288 + 271 289 /* Init clock subsystem */ 272 290 at91_clock_init(main_clock); 273 291
+1
arch/arm/mach-at91/soc.h
··· 7 7 struct at91_init_soc { 8 8 unsigned int *default_irq_priority; 9 9 void (*map_io)(void); 10 + void (*ioremap_registers)(void); 10 11 void (*register_clocks)(void); 11 12 void (*init)(void); 12 13 };
+1 -52
arch/arm/mach-davinci/include/mach/dm646x.h
··· 16 16 #include <linux/i2c.h> 17 17 #include <linux/videodev2.h> 18 18 #include <linux/davinci_emac.h> 19 + #include <media/davinci/vpif_types.h> 19 20 20 21 #define DM646X_EMAC_BASE (0x01C80000) 21 22 #define DM646X_EMAC_MDIO_BASE (DM646X_EMAC_BASE + 0x4000) ··· 34 33 int __init dm646x_init_edma(struct edma_rsv_info *rsv); 35 34 36 35 void dm646x_video_init(void); 37 - 38 - enum vpif_if_type { 39 - VPIF_IF_BT656, 40 - VPIF_IF_BT1120, 41 - VPIF_IF_RAW_BAYER 42 - }; 43 - 44 - struct vpif_interface { 45 - enum vpif_if_type if_type; 46 - unsigned hd_pol:1; 47 - unsigned vd_pol:1; 48 - unsigned fid_pol:1; 49 - }; 50 - 51 - struct vpif_subdev_info { 52 - const char *name; 53 - struct i2c_board_info board_info; 54 - u32 input; 55 - u32 output; 56 - unsigned can_route:1; 57 - struct vpif_interface vpif_if; 58 - }; 59 - 60 - struct vpif_display_config { 61 - int (*set_clock)(int, int); 62 - struct vpif_subdev_info *subdevinfo; 63 - int subdev_count; 64 - const char **output; 65 - int output_count; 66 - const char *card_name; 67 - }; 68 - 69 - struct vpif_input { 70 - struct v4l2_input input; 71 - const char *subdev_name; 72 - }; 73 - 74 - #define VPIF_CAPTURE_MAX_CHANNELS 2 75 - 76 - struct vpif_capture_chan_config { 77 - const struct vpif_input *inputs; 78 - int input_count; 79 - }; 80 - 81 - struct vpif_capture_config { 82 - int (*setup_input_channel_mode)(int); 83 - int (*setup_input_path)(int, const char *); 84 - struct vpif_capture_chan_config chan_config[VPIF_CAPTURE_MAX_CHANNELS]; 85 - struct vpif_subdev_info *subdev_info; 86 - int subdev_count; 87 - const char *card_name; 88 - }; 89 36 90 37 void dm646x_setup_vpif(struct vpif_display_config *, 91 38 struct vpif_capture_config *);
+3 -17
arch/arm/mach-exynos/common.c
··· 19 19 #include <linux/serial_core.h> 20 20 21 21 #include <asm/proc-fns.h> 22 + #include <asm/exception.h> 22 23 #include <asm/hardware/cache-l2x0.h> 23 24 #include <asm/hardware/gic.h> 24 25 #include <asm/mach/map.h> ··· 43 42 #include <plat/regs-serial.h> 44 43 45 44 #include "common.h" 46 - 47 - unsigned int gic_bank_offset __read_mostly; 48 45 49 46 static const char name_exynos4210[] = "EXYNOS4210"; 50 47 static const char name_exynos4212[] = "EXYNOS4212"; ··· 385 386 } 386 387 } 387 388 388 - static void exynos4_gic_irq_fix_base(struct irq_data *d) 389 - { 390 - struct gic_chip_data *gic_data = irq_data_get_irq_chip_data(d); 391 - 392 - gic_data->cpu_base = S5P_VA_GIC_CPU + 393 - (gic_bank_offset * smp_processor_id()); 394 - 395 - gic_data->dist_base = S5P_VA_GIC_DIST + 396 - (gic_bank_offset * smp_processor_id()); 397 - } 398 - 399 389 void __init exynos4_init_irq(void) 400 390 { 401 391 int irq; 392 + unsigned int gic_bank_offset; 402 393 403 394 gic_bank_offset = soc_is_exynos4412() ? 0x4000 : 0x8000; 404 395 405 - gic_init(0, IRQ_PPI(0), S5P_VA_GIC_DIST, S5P_VA_GIC_CPU); 406 - gic_arch_extn.irq_eoi = exynos4_gic_irq_fix_base; 407 - gic_arch_extn.irq_unmask = exynos4_gic_irq_fix_base; 408 - gic_arch_extn.irq_mask = exynos4_gic_irq_fix_base; 396 + gic_init_bases(0, IRQ_PPI(0), S5P_VA_GIC_DIST, S5P_VA_GIC_CPU, gic_bank_offset); 409 397 410 398 for (irq = 0; irq < MAX_COMBINER_NR; irq++) { 411 399
+3 -32
arch/arm/mach-msm/Kconfig
··· 13 13 select CPU_V6 14 14 select GPIO_MSM_V1 15 15 select MSM_PROC_COMM 16 - select HAS_MSM_DEBUG_UART_PHYS 17 16 18 17 config ARCH_MSM7X30 19 18 bool "MSM7x30" ··· 24 25 select MSM_GPIOMUX 25 26 select GPIO_MSM_V1 26 27 select MSM_PROC_COMM 27 - select HAS_MSM_DEBUG_UART_PHYS 28 28 29 29 config ARCH_QSD8X50 30 30 bool "QSD8X50" ··· 35 37 select MSM_GPIOMUX 36 38 select GPIO_MSM_V1 37 39 select MSM_PROC_COMM 38 - select HAS_MSM_DEBUG_UART_PHYS 39 40 40 41 config ARCH_MSM8X60 41 42 bool "MSM8X60" ··· 60 63 61 64 endchoice 62 65 66 + config MSM_HAS_DEBUG_UART_HS 67 + bool 68 + 63 69 config MSM_SOC_REV_A 64 70 bool 65 71 config ARCH_MSM_SCORPIONMP ··· 72 72 config ARCH_MSM_ARM11 73 73 bool 74 74 config ARCH_MSM_SCORPION 75 - bool 76 - 77 - config HAS_MSM_DEBUG_UART_PHYS 78 75 bool 79 76 80 77 config MSM_VIC ··· 149 152 Support for the Qualcomm MSM8960 RUMI3 emulator. 150 153 151 154 endmenu 152 - 153 - config MSM_DEBUG_UART 154 - int 155 - default 1 if MSM_DEBUG_UART1 156 - default 2 if MSM_DEBUG_UART2 157 - default 3 if MSM_DEBUG_UART3 158 - 159 - if HAS_MSM_DEBUG_UART_PHYS 160 - choice 161 - prompt "Debug UART" 162 - 163 - default MSM_DEBUG_UART_NONE 164 - 165 - config MSM_DEBUG_UART_NONE 166 - bool "None" 167 - 168 - config MSM_DEBUG_UART1 169 - bool "UART1" 170 - 171 - config MSM_DEBUG_UART2 172 - bool "UART2" 173 - 174 - config MSM_DEBUG_UART3 175 - bool "UART3" 176 - endchoice 177 - endif 178 155 179 156 config MSM_SMD_PKG3 180 157 bool
+32 -19
arch/arm/mach-msm/include/mach/debug-macro.S
··· 1 - /* arch/arm/mach-msm7200/include/mach/debug-macro.S 1 + /* 2 2 * 3 3 * Copyright (C) 2007 Google, Inc. 4 + * Copyright (c) 2011, Code Aurora Forum. All rights reserved. 4 5 * Author: Brian Swetland <swetland@google.com> 5 6 * 6 7 * This software is licensed under the terms of the GNU General Public ··· 15 14 * 16 15 */ 17 16 18 - 19 - 20 17 #include <mach/hardware.h> 21 18 #include <mach/msm_iomap.h> 22 19 23 - #if defined(CONFIG_HAS_MSM_DEBUG_UART_PHYS) && !defined(CONFIG_MSM_DEBUG_UART_NONE) 24 20 .macro addruart, rp, rv, tmp 21 + #ifdef MSM_DEBUG_UART_PHYS 25 22 ldr \rp, =MSM_DEBUG_UART_PHYS 26 23 ldr \rv, =MSM_DEBUG_UART_BASE 24 + #endif 27 25 .endm 28 26 29 - .macro senduart,rd,rx 27 + .macro senduart, rd, rx 28 + #ifdef CONFIG_MSM_HAS_DEBUG_UART_HS 29 + @ Write the 1 character to UARTDM_TF 30 + str \rd, [\rx, #0x70] 31 + #else 30 32 teq \rx, #0 31 33 strne \rd, [\rx, #0x0C] 34 + #endif 32 35 .endm 33 36 34 - .macro waituart,rd,rx 37 + .macro waituart, rd, rx 38 + #ifdef CONFIG_MSM_HAS_DEBUG_UART_HS 39 + @ check for TX_EMT in UARTDM_SR 40 + ldr \rd, [\rx, #0x08] 41 + tst \rd, #0x08 42 + bne 1002f 43 + @ wait for TXREADY in UARTDM_ISR 44 + 1001: ldr \rd, [\rx, #0x14] 45 + tst \rd, #0x80 46 + beq 1001b 47 + 1002: 48 + @ Clear TX_READY by writing to the UARTDM_CR register 49 + mov \rd, #0x300 50 + str \rd, [\rx, #0x10] 51 + @ Write 0x1 to NCF register 52 + mov \rd, #0x1 53 + str \rd, [\rx, #0x40] 54 + @ UARTDM reg. Read to induce delay 55 + ldr \rd, [\rx, #0x08] 56 + #else 35 57 @ wait for TX_READY 36 58 1001: ldr \rd, [\rx, #0x08] 37 59 tst \rd, #0x04 38 60 beq 1001b 39 - .endm 40 - #else 41 - .macro addruart, rp, rv, tmp 42 - mov \rv, #0xff000000 43 - orr \rv, \rv, #0x00f00000 44 - .endm 45 - 46 - .macro senduart,rd,rx 47 - .endm 48 - 49 - .macro waituart,rd,rx 50 - .endm 51 61 #endif 62 + .endm 52 63 53 - .macro busyuart,rd,rx 64 + .macro busyuart, rd, rx 54 65 .endm
-12
arch/arm/mach-msm/include/mach/msm_iomap-7x00.h
··· 78 78 #define MSM_UART3_PHYS 0xA9C00000 79 79 #define MSM_UART3_SIZE SZ_4K 80 80 81 - #ifdef CONFIG_MSM_DEBUG_UART 82 - #define MSM_DEBUG_UART_BASE 0xE1000000 83 - #if CONFIG_MSM_DEBUG_UART == 1 84 - #define MSM_DEBUG_UART_PHYS MSM_UART1_PHYS 85 - #elif CONFIG_MSM_DEBUG_UART == 2 86 - #define MSM_DEBUG_UART_PHYS MSM_UART2_PHYS 87 - #elif CONFIG_MSM_DEBUG_UART == 3 88 - #define MSM_DEBUG_UART_PHYS MSM_UART3_PHYS 89 - #endif 90 - #define MSM_DEBUG_UART_SIZE SZ_4K 91 - #endif 92 - 93 81 #define MSM_SDC1_PHYS 0xA0400000 94 82 #define MSM_SDC1_SIZE SZ_4K 95 83
-12
arch/arm/mach-msm/include/mach/msm_iomap-7x30.h
··· 89 89 #define MSM_UART3_PHYS 0xACC00000 90 90 #define MSM_UART3_SIZE SZ_4K 91 91 92 - #ifdef CONFIG_MSM_DEBUG_UART 93 - #define MSM_DEBUG_UART_BASE 0xE1000000 94 - #if CONFIG_MSM_DEBUG_UART == 1 95 - #define MSM_DEBUG_UART_PHYS MSM_UART1_PHYS 96 - #elif CONFIG_MSM_DEBUG_UART == 2 97 - #define MSM_DEBUG_UART_PHYS MSM_UART2_PHYS 98 - #elif CONFIG_MSM_DEBUG_UART == 3 99 - #define MSM_DEBUG_UART_PHYS MSM_UART3_PHYS 100 - #endif 101 - #define MSM_DEBUG_UART_SIZE SZ_4K 102 - #endif 103 - 104 92 #define MSM_MDC_BASE IOMEM(0xE0200000) 105 93 #define MSM_MDC_PHYS 0xAA500000 106 94 #define MSM_MDC_SIZE SZ_1M
+5
arch/arm/mach-msm/include/mach/msm_iomap-8960.h
··· 45 45 #define MSM8960_TMR0_PHYS 0x0208A000 46 46 #define MSM8960_TMR0_SIZE SZ_4K 47 47 48 + #ifdef CONFIG_DEBUG_MSM8960_UART 49 + #define MSM_DEBUG_UART_BASE 0xE1040000 50 + #define MSM_DEBUG_UART_PHYS 0x16440000 51 + #endif 52 + 48 53 #endif
-12
arch/arm/mach-msm/include/mach/msm_iomap-8x50.h
··· 83 83 #define MSM_UART3_PHYS 0xA9C00000 84 84 #define MSM_UART3_SIZE SZ_4K 85 85 86 - #ifdef CONFIG_MSM_DEBUG_UART 87 - #define MSM_DEBUG_UART_BASE 0xE1000000 88 - #if CONFIG_MSM_DEBUG_UART == 1 89 - #define MSM_DEBUG_UART_PHYS MSM_UART1_PHYS 90 - #elif CONFIG_MSM_DEBUG_UART == 2 91 - #define MSM_DEBUG_UART_PHYS MSM_UART2_PHYS 92 - #elif CONFIG_MSM_DEBUG_UART == 3 93 - #define MSM_DEBUG_UART_PHYS MSM_UART3_PHYS 94 - #endif 95 - #define MSM_DEBUG_UART_SIZE SZ_4K 96 - #endif 97 - 98 86 #define MSM_MDC_BASE IOMEM(0xE0200000) 99 87 #define MSM_MDC_PHYS 0xAA500000 100 88 #define MSM_MDC_SIZE SZ_1M
+5
arch/arm/mach-msm/include/mach/msm_iomap-8x60.h
··· 62 62 #define MSM8X60_TMR0_PHYS 0x02040000 63 63 #define MSM8X60_TMR0_SIZE SZ_4K 64 64 65 + #ifdef CONFIG_DEBUG_MSM8660_UART 66 + #define MSM_DEBUG_UART_BASE 0xE1040000 67 + #define MSM_DEBUG_UART_PHYS 0x19C40000 68 + #endif 69 + 65 70 #endif
+12
arch/arm/mach-msm/include/mach/msm_iomap.h
··· 55 55 56 56 #include "msm_iomap-8960.h" 57 57 58 + #define MSM_DEBUG_UART_SIZE SZ_4K 59 + #if defined(CONFIG_DEBUG_MSM_UART1) 60 + #define MSM_DEBUG_UART_BASE 0xE1000000 61 + #define MSM_DEBUG_UART_PHYS MSM_UART1_PHYS 62 + #elif defined(CONFIG_DEBUG_MSM_UART2) 63 + #define MSM_DEBUG_UART_BASE 0xE1000000 64 + #define MSM_DEBUG_UART_PHYS MSM_UART2_PHYS 65 + #elif defined(CONFIG_DEBUG_MSM_UART3) 66 + #define MSM_DEBUG_UART_BASE 0xE1000000 67 + #define MSM_DEBUG_UART_PHYS MSM_UART3_PHYS 68 + #endif 69 + 58 70 /* Virtual addresses shared across all MSM targets. */ 59 71 #define MSM_CSR_BASE IOMEM(0xE0001000) 60 72 #define MSM_QGIC_DIST_BASE IOMEM(0xF0000000)
+31 -8
arch/arm/mach-msm/include/mach/uncompress.h
··· 1 - /* arch/arm/mach-msm/include/mach/uncompress.h 2 - * 1 + /* 3 2 * Copyright (C) 2007 Google, Inc. 3 + * Copyright (c) 2011, Code Aurora Forum. All rights reserved. 4 4 * 5 5 * This software is licensed under the terms of the GNU General Public 6 6 * License version 2, as published by the Free Software Foundation, and ··· 14 14 */ 15 15 16 16 #ifndef __ASM_ARCH_MSM_UNCOMPRESS_H 17 + #define __ASM_ARCH_MSM_UNCOMPRESS_H 17 18 18 - #include "hardware.h" 19 - #include "linux/io.h" 20 - #include "mach/msm_iomap.h" 19 + #include <asm/processor.h> 20 + #include <mach/msm_iomap.h> 21 + 22 + #define UART_CSR (*(volatile uint32_t *)(MSM_DEBUG_UART_PHYS + 0x08)) 23 + #define UART_TF (*(volatile uint32_t *)(MSM_DEBUG_UART_PHYS + 0x0c)) 24 + 25 + #define UART_DM_SR (*((volatile uint32_t *)(MSM_DEBUG_UART_PHYS + 0x08))) 26 + #define UART_DM_CR (*((volatile uint32_t *)(MSM_DEBUG_UART_PHYS + 0x10))) 27 + #define UART_DM_ISR (*((volatile uint32_t *)(MSM_DEBUG_UART_PHYS + 0x14))) 28 + #define UART_DM_NCHAR (*((volatile uint32_t *)(MSM_DEBUG_UART_PHYS + 0x40))) 29 + #define UART_DM_TF (*((volatile uint32_t *)(MSM_DEBUG_UART_PHYS + 0x70))) 21 30 22 31 static void putc(int c) 23 32 { 24 33 #if defined(MSM_DEBUG_UART_PHYS) 25 - unsigned base = MSM_DEBUG_UART_PHYS; 26 - while (!(readl(base + 0x08) & 0x04)) ; 27 - writel(c, base + 0x0c); 34 + #ifdef CONFIG_MSM_HAS_DEBUG_UART_HS 35 + /* 36 + * Wait for TX_READY to be set; but skip it if we have a 37 + * TX underrun. 38 + */ 39 + if (UART_DM_SR & 0x08) 40 + while (!(UART_DM_ISR & 0x80)) 41 + cpu_relax(); 42 + 43 + UART_DM_CR = 0x300; 44 + UART_DM_NCHAR = 0x1; 45 + UART_DM_TF = c; 46 + #else 47 + while (!(UART_CSR & 0x04)) 48 + cpu_relax(); 49 + UART_TF = c; 50 + #endif 28 51 #endif 29 52 } 30 53
+12 -3
arch/arm/mach-msm/io.c
··· 47 47 MSM_CHIP_DEVICE(GPIO1, MSM7X00), 48 48 MSM_CHIP_DEVICE(GPIO2, MSM7X00), 49 49 MSM_DEVICE(CLK_CTL), 50 - #ifdef CONFIG_MSM_DEBUG_UART 50 + #if defined(CONFIG_DEBUG_MSM_UART1) || defined(CONFIG_DEBUG_MSM_UART2) || \ 51 + defined(CONFIG_DEBUG_MSM_UART3) 51 52 MSM_DEVICE(DEBUG_UART), 52 53 #endif 53 54 #ifdef CONFIG_ARCH_MSM7X30 ··· 85 84 MSM_DEVICE(SCPLL), 86 85 MSM_DEVICE(AD5), 87 86 MSM_DEVICE(MDC), 88 - #ifdef CONFIG_MSM_DEBUG_UART 87 + #if defined(CONFIG_DEBUG_MSM_UART1) || defined(CONFIG_DEBUG_MSM_UART2) || \ 88 + defined(CONFIG_DEBUG_MSM_UART3) 89 89 MSM_DEVICE(DEBUG_UART), 90 90 #endif 91 91 { ··· 111 109 MSM_CHIP_DEVICE(TMR0, MSM8X60), 112 110 MSM_DEVICE(ACC), 113 111 MSM_DEVICE(GCC), 112 + #ifdef CONFIG_DEBUG_MSM8660_UART 113 + MSM_DEVICE(DEBUG_UART), 114 + #endif 114 115 }; 115 116 116 117 void __init msm_map_msm8x60_io(void) ··· 128 123 MSM_CHIP_DEVICE(QGIC_CPU, MSM8960), 129 124 MSM_CHIP_DEVICE(TMR, MSM8960), 130 125 MSM_CHIP_DEVICE(TMR0, MSM8960), 126 + #ifdef CONFIG_DEBUG_MSM8960_UART 127 + MSM_DEVICE(DEBUG_UART), 128 + #endif 131 129 }; 132 130 133 131 void __init msm_map_msm8960_io(void) ··· 154 146 MSM_DEVICE(SAW), 155 147 MSM_DEVICE(GCC), 156 148 MSM_DEVICE(TCSR), 157 - #ifdef CONFIG_MSM_DEBUG_UART 149 + #if defined(CONFIG_DEBUG_MSM_UART1) || defined(CONFIG_DEBUG_MSM_UART2) || \ 150 + defined(CONFIG_DEBUG_MSM_UART3) 158 151 MSM_DEVICE(DEBUG_UART), 159 152 #endif 160 153 {
+1 -1
arch/arm/mach-msm/platsmp.c
··· 79 79 ret = scm_set_boot_addr(virt_to_phys(msm_secondary_startup), 80 80 SCM_FLAG_COLDBOOT_CPU1); 81 81 if (ret == 0) { 82 - void *sc1_base_ptr; 82 + void __iomem *sc1_base_ptr; 83 83 sc1_base_ptr = ioremap_nocache(0x00902000, SZ_4K*2); 84 84 if (sc1_base_ptr) { 85 85 writel(0, sc1_base_ptr + VDD_SC1_ARRAY_CLAMP_GFS_CTL);
-1
arch/arm/mach-picoxcell/Makefile
··· 1 1 obj-y := common.o 2 2 obj-y += time.o 3 - obj-y += io.o
+14 -1
arch/arm/mach-picoxcell/common.c
··· 16 16 17 17 #include <asm/mach/arch.h> 18 18 #include <asm/hardware/vic.h> 19 + #include <asm/mach/map.h> 19 20 20 21 #include <mach/map.h> 21 22 #include <mach/picoxcell_soc.h> 22 23 23 24 #include "common.h" 25 + 26 + static struct map_desc io_map __initdata = { 27 + .virtual = PHYS_TO_IO(PICOXCELL_PERIPH_BASE), 28 + .pfn = __phys_to_pfn(PICOXCELL_PERIPH_BASE), 29 + .length = PICOXCELL_PERIPH_LENGTH, 30 + .type = MT_DEVICE, 31 + }; 32 + 33 + static void __init picoxcell_map_io(void) 34 + { 35 + iotable_init(&io_map, 1); 36 + } 24 37 25 38 static void __init picoxcell_init_machine(void) 26 39 { ··· 58 45 59 46 DT_MACHINE_START(PICOXCELL, "Picochip picoXcell") 60 47 .map_io = picoxcell_map_io, 61 - .nr_irqs = ARCH_NR_IRQS, 48 + .nr_irqs = NR_IRQS_LEGACY, 62 49 .init_irq = picoxcell_init_irq, 63 50 .handle_irq = vic_handle_irq, 64 51 .timer = &picoxcell_timer,
-1
arch/arm/mach-picoxcell/common.h
··· 13 13 #include <asm/mach/time.h> 14 14 15 15 extern struct sys_timer picoxcell_timer; 16 - extern void picoxcell_map_io(void); 17 16 18 17 #endif /* __PICOXCELL_COMMON_H__ */
+2 -7
arch/arm/mach-picoxcell/include/mach/irqs.h
··· 1 1 /* 2 2 * Copyright (c) 2011 Picochip Ltd., Jamie Iles 3 3 * 4 - * This file contains the hardware definitions of the picoXcell SoC devices. 5 - * 6 4 * This program is free software; you can redistribute it and/or modify 7 5 * it under the terms of the GNU General Public License as published by 8 6 * the Free Software Foundation; either version 2 of the License, or ··· 14 16 #ifndef __MACH_IRQS_H 15 17 #define __MACH_IRQS_H 16 18 17 - #define ARCH_NR_IRQS 64 18 - #define NR_IRQS (128 + ARCH_NR_IRQS) 19 - 20 - #define IRQ_VIC0_BASE 0 21 - #define IRQ_VIC1_BASE 32 19 + /* We dynamically allocate our irq_desc's. */ 20 + #define NR_IRQS 0 22 21 23 22 #endif /* __MACH_IRQS_H */
-1
arch/arm/mach-picoxcell/include/mach/memory.h
··· 1 - /* empty */
-32
arch/arm/mach-picoxcell/io.c
··· 1 - /* 2 - * Copyright (c) 2011 Picochip Ltd., Jamie Iles 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 - * All enquiries to support@picochip.com 9 - */ 10 - #include <linux/io.h> 11 - #include <linux/mm.h> 12 - #include <linux/module.h> 13 - #include <linux/of.h> 14 - 15 - #include <asm/mach/map.h> 16 - 17 - #include <mach/map.h> 18 - #include <mach/picoxcell_soc.h> 19 - 20 - #include "common.h" 21 - 22 - void __init picoxcell_map_io(void) 23 - { 24 - struct map_desc io_map = { 25 - .virtual = PHYS_TO_IO(PICOXCELL_PERIPH_BASE), 26 - .pfn = __phys_to_pfn(PICOXCELL_PERIPH_BASE), 27 - .length = PICOXCELL_PERIPH_LENGTH, 28 - .type = MT_DEVICE, 29 - }; 30 - 31 - iotable_init(&io_map, 1); 32 - }
+13 -13
arch/arm/mach-tegra/Makefile
··· 18 18 obj-$(CONFIG_TEGRA_PCI) += pcie.o 19 19 obj-$(CONFIG_USB_SUPPORT) += usb_phy.o 20 20 21 - obj-${CONFIG_MACH_HARMONY} += board-harmony.o 22 - obj-${CONFIG_MACH_HARMONY} += board-harmony-pinmux.o 23 - obj-${CONFIG_MACH_HARMONY} += board-harmony-pcie.o 24 - obj-${CONFIG_MACH_HARMONY} += board-harmony-power.o 21 + obj-$(CONFIG_MACH_HARMONY) += board-harmony.o 22 + obj-$(CONFIG_MACH_HARMONY) += board-harmony-pinmux.o 23 + obj-$(CONFIG_MACH_HARMONY) += board-harmony-pcie.o 24 + obj-$(CONFIG_MACH_HARMONY) += board-harmony-power.o 25 25 26 - obj-${CONFIG_MACH_PAZ00} += board-paz00.o 27 - obj-${CONFIG_MACH_PAZ00} += board-paz00-pinmux.o 26 + obj-$(CONFIG_MACH_PAZ00) += board-paz00.o 27 + obj-$(CONFIG_MACH_PAZ00) += board-paz00-pinmux.o 28 28 29 - obj-${CONFIG_MACH_SEABOARD} += board-seaboard.o 30 - obj-${CONFIG_MACH_SEABOARD} += board-seaboard-pinmux.o 29 + obj-$(CONFIG_MACH_SEABOARD) += board-seaboard.o 30 + obj-$(CONFIG_MACH_SEABOARD) += board-seaboard-pinmux.o 31 31 32 - obj-${CONFIG_MACH_TEGRA_DT} += board-dt.o 33 - obj-${CONFIG_MACH_TEGRA_DT} += board-harmony-pinmux.o 34 - obj-${CONFIG_MACH_TEGRA_DT} += board-seaboard-pinmux.o 32 + obj-$(CONFIG_MACH_TEGRA_DT) += board-dt.o 33 + obj-$(CONFIG_MACH_TEGRA_DT) += board-harmony-pinmux.o 34 + obj-$(CONFIG_MACH_TEGRA_DT) += board-seaboard-pinmux.o 35 35 36 - obj-${CONFIG_MACH_TRIMSLICE} += board-trimslice.o 37 - obj-${CONFIG_MACH_TRIMSLICE} += board-trimslice-pinmux.o 36 + obj-$(CONFIG_MACH_TRIMSLICE) += board-trimslice.o 37 + obj-$(CONFIG_MACH_TRIMSLICE) += board-trimslice-pinmux.o
-18
arch/arm/mach-tegra/include/mach/entry-macro.S
··· 18 18 19 19 .macro arch_ret_to_user, tmp1, tmp2 20 20 .endm 21 - 22 - #if !defined(CONFIG_ARM_GIC) 23 - /* legacy interrupt controller for AP16 */ 24 - 25 - .macro get_irqnr_preamble, base, tmp 26 - @ enable imprecise aborts 27 - cpsie a 28 - @ EVP base at 0xf010f000 29 - mov \base, #0xf0000000 30 - orr \base, #0x00100000 31 - orr \base, #0x0000f000 32 - .endm 33 - 34 - .macro get_irqnr_and_base, irqnr, irqstat, base, tmp 35 - ldr \irqnr, [\base, #0x20] @ EVT_IRQ_STS 36 - cmp \irqnr, #0x80 37 - .endm 38 - #endif
-4
arch/arm/mach-tegra/irq.c
··· 28 28 29 29 #include "board.h" 30 30 31 - #define INT_SYS_NR (INT_GPIO_BASE - INT_PRI_BASE) 32 - #define INT_SYS_SZ (INT_SEC_BASE - INT_PRI_BASE) 33 - #define PPI_NR ((INT_SYS_NR+INT_SYS_SZ-1)/INT_SYS_SZ) 34 - 35 31 #define ICTLR_CPU_IEP_VFIQ 0x08 36 32 #define ICTLR_CPU_IEP_FIR 0x14 37 33 #define ICTLR_CPU_IEP_FIR_SET 0x18
-19
arch/arm/mach-u300/include/mach/memory.h
··· 1 - /* 2 - * 3 - * arch/arm/mach-u300/include/mach/memory.h 4 - * 5 - * 6 - * Copyright (C) 2007-2009 ST-Ericsson AB 7 - * License terms: GNU General Public License (GPL) version 2 8 - * Memory virtual/physical mapping constants. 9 - * Author: Linus Walleij <linus.walleij@stericsson.com> 10 - * Author: Jonas Aaberg <jonas.aberg@stericsson.com> 11 - */ 12 - 13 - #ifndef __MACH_MEMORY_H 14 - #define __MACH_MEMORY_H 15 - 16 - #define PLAT_PHYS_OFFSET UL(0x48000000) 17 - #define BOOT_PARAMS_OFFSET 0x100 18 - 19 - #endif
+1 -1
arch/arm/mach-u300/u300.c
··· 47 47 48 48 MACHINE_START(U300, MACH_U300_STRING) 49 49 /* Maintainer: Linus Walleij <linus.walleij@stericsson.com> */ 50 - .atag_offset = BOOT_PARAMS_OFFSET, 50 + .atag_offset = 0x100, 51 51 .map_io = u300_map_io, 52 52 .init_irq = u300_init_irq, 53 53 .handle_irq = vic_handle_irq,
+1 -1
arch/avr32/boards/atngw100/setup.c
··· 109 109 u8 addr[6]; 110 110 }; 111 111 static struct eth_addr __initdata hw_addr[2]; 112 - static struct eth_platform_data __initdata eth_data[2]; 112 + static struct macb_platform_data __initdata eth_data[2]; 113 113 114 114 static struct spi_board_info spi0_board_info[] __initdata = { 115 115 {
+1 -1
arch/avr32/boards/atstk1000/atstk1002.c
··· 105 105 }; 106 106 107 107 static struct eth_addr __initdata hw_addr[2]; 108 - static struct eth_platform_data __initdata eth_data[2] = { 108 + static struct macb_platform_data __initdata eth_data[2] = { 109 109 { 110 110 /* 111 111 * The MDIO pullups on STK1000 are a bit too weak for
+1 -1
arch/avr32/boards/favr-32/setup.c
··· 50 50 u8 addr[6]; 51 51 }; 52 52 static struct eth_addr __initdata hw_addr[1]; 53 - static struct eth_platform_data __initdata eth_data[1] = { 53 + static struct macb_platform_data __initdata eth_data[1] = { 54 54 { 55 55 .phy_mask = ~(1U << 1), 56 56 },
+1 -1
arch/avr32/boards/hammerhead/setup.c
··· 102 102 }; 103 103 104 104 static struct eth_addr __initdata hw_addr[1]; 105 - static struct eth_platform_data __initdata eth_data[1]; 105 + static struct macb_platform_data __initdata eth_data[1]; 106 106 107 107 /* 108 108 * The next two functions should go away as the boot loader is
+1 -1
arch/avr32/boards/merisc/setup.c
··· 52 52 }; 53 53 54 54 static struct eth_addr __initdata hw_addr[2]; 55 - static struct eth_platform_data __initdata eth_data[2]; 55 + static struct macb_platform_data __initdata eth_data[2]; 56 56 57 57 static int ads7846_get_pendown_state_PB26(void) 58 58 {
+1 -1
arch/avr32/boards/mimc200/setup.c
··· 86 86 u8 addr[6]; 87 87 }; 88 88 static struct eth_addr __initdata hw_addr[2]; 89 - static struct eth_platform_data __initdata eth_data[2]; 89 + static struct macb_platform_data __initdata eth_data[2]; 90 90 91 91 static struct spi_eeprom eeprom_25lc010 = { 92 92 .name = "25lc010",
+4 -4
arch/avr32/mach-at32ap/at32ap700x.c
··· 1067 1067 * -------------------------------------------------------------------- */ 1068 1068 1069 1069 #ifdef CONFIG_CPU_AT32AP7000 1070 - static struct eth_platform_data macb0_data; 1070 + static struct macb_platform_data macb0_data; 1071 1071 static struct resource macb0_resource[] = { 1072 1072 PBMEM(0xfff01800), 1073 1073 IRQ(25), ··· 1076 1076 DEV_CLK(hclk, macb0, hsb, 8); 1077 1077 DEV_CLK(pclk, macb0, pbb, 6); 1078 1078 1079 - static struct eth_platform_data macb1_data; 1079 + static struct macb_platform_data macb1_data; 1080 1080 static struct resource macb1_resource[] = { 1081 1081 PBMEM(0xfff01c00), 1082 1082 IRQ(26), ··· 1086 1086 DEV_CLK(pclk, macb1, pbb, 7); 1087 1087 1088 1088 struct platform_device *__init 1089 - at32_add_device_eth(unsigned int id, struct eth_platform_data *data) 1089 + at32_add_device_eth(unsigned int id, struct macb_platform_data *data) 1090 1090 { 1091 1091 struct platform_device *pdev; 1092 1092 u32 pin_mask; ··· 1163 1163 return NULL; 1164 1164 } 1165 1165 1166 - memcpy(pdev->dev.platform_data, data, sizeof(struct eth_platform_data)); 1166 + memcpy(pdev->dev.platform_data, data, sizeof(struct macb_platform_data)); 1167 1167 platform_device_register(pdev); 1168 1168 1169 1169 return pdev;
+2 -5
arch/avr32/mach-at32ap/include/mach/board.h
··· 6 6 7 7 #include <linux/types.h> 8 8 #include <linux/serial.h> 9 + #include <linux/platform_data/macb.h> 9 10 10 11 #define GPIO_PIN_NONE (-1) 11 12 ··· 43 42 void at32_map_usart(unsigned int hw_id, unsigned int line, int flags); 44 43 struct platform_device *at32_add_device_usart(unsigned int id); 45 44 46 - struct eth_platform_data { 47 - u32 phy_mask; 48 - u8 is_rmii; 49 - }; 50 45 struct platform_device * 51 - at32_add_device_eth(unsigned int id, struct eth_platform_data *data); 46 + at32_add_device_eth(unsigned int id, struct macb_platform_data *data); 52 47 53 48 struct spi_board_info; 54 49 struct platform_device *
+3 -3
drivers/ata/pata_at91.c
··· 360 360 ap->flags |= ATA_FLAG_SLAVE_POSS; 361 361 ap->pio_mask = ATA_PIO4; 362 362 363 - if (!irq) { 363 + if (!gpio_is_valid(irq)) { 364 364 ap->flags |= ATA_FLAG_PIO_POLLING; 365 365 ata_port_desc(ap, "no IRQ, using PIO polling"); 366 366 } ··· 414 414 415 415 host->private_data = info; 416 416 417 - ret = ata_host_activate(host, irq ? gpio_to_irq(irq) : 0, 418 - irq ? ata_sff_interrupt : NULL, 417 + return ata_host_activate(host, gpio_is_valid(irq) ? gpio_to_irq(irq) : 0, 418 + gpio_is_valid(irq) ? ata_sff_interrupt : NULL, 419 419 irq_flags, &pata_at91_sht); 420 420 421 421 if (!ret)
+1 -1
drivers/ide/at91_ide.c
··· 314 314 apply_timings(board->chipselect, 0, ide_timing_find_mode(XFER_PIO_0), 0); 315 315 316 316 /* with GPIO interrupt we have to do quirks in handler */ 317 - if (board->irq_pin >= PIN_BASE) 317 + if (gpio_is_valid(board->irq_pin)) 318 318 host->irq_handler = at91_irq_handler; 319 319 320 320 host->ports[0]->select_data = board->chipselect;
+1
drivers/media/video/davinci/vpif.h
··· 20 20 #include <linux/videodev2.h> 21 21 #include <mach/hardware.h> 22 22 #include <mach/dm646x.h> 23 + #include <media/davinci/vpif_types.h> 23 24 24 25 /* Maximum channel allowed */ 25 26 #define VPIF_NUM_CHANNELS (4)
+1 -1
drivers/media/video/davinci/vpif_capture.h
··· 27 27 #include <media/v4l2-device.h> 28 28 #include <media/videobuf-core.h> 29 29 #include <media/videobuf-dma-contig.h> 30 - #include <mach/dm646x.h> 30 + #include <media/davinci/vpif_types.h> 31 31 32 32 #include "vpif.h" 33 33
+1
drivers/media/video/davinci/vpif_display.h
··· 22 22 #include <media/v4l2-device.h> 23 23 #include <media/videobuf-core.h> 24 24 #include <media/videobuf-dma-contig.h> 25 + #include <media/davinci/vpif_types.h> 25 26 26 27 #include "vpif.h" 27 28
+15 -15
drivers/mmc/host/at91_mci.c
··· 741 741 at91_mci_write(host, AT91_MCI_MR, (at91_mci_read(host, AT91_MCI_MR) & ~AT91_MCI_CLKDIV) | clkdiv); 742 742 743 743 /* maybe switch power to the card */ 744 - if (host->board->vcc_pin) { 744 + if (gpio_is_valid(host->board->vcc_pin)) { 745 745 switch (ios->power_mode) { 746 746 case MMC_POWER_OFF: 747 747 gpio_set_value(host->board->vcc_pin, 0); ··· 897 897 { 898 898 struct at91mci_host *host = mmc_priv(mmc); 899 899 900 - if (host->board->wp_pin) 900 + if (gpio_is_valid(host->board->wp_pin)) 901 901 return !!gpio_get_value(host->board->wp_pin); 902 902 /* 903 903 * Board doesn't support read only detection; let the mmc core ··· 991 991 * Reserve GPIOs ... board init code makes sure these pins are set 992 992 * up as GPIOs with the right direction (input, except for vcc) 993 993 */ 994 - if (host->board->det_pin) { 994 + if (gpio_is_valid(host->board->det_pin)) { 995 995 ret = gpio_request(host->board->det_pin, "mmc_detect"); 996 996 if (ret < 0) { 997 997 dev_dbg(&pdev->dev, "couldn't claim card detect pin\n"); 998 998 goto fail4b; 999 999 } 1000 1000 } 1001 - if (host->board->wp_pin) { 1001 + if (gpio_is_valid(host->board->wp_pin)) { 1002 1002 ret = gpio_request(host->board->wp_pin, "mmc_wp"); 1003 1003 if (ret < 0) { 1004 1004 dev_dbg(&pdev->dev, "couldn't claim wp sense pin\n"); 1005 1005 goto fail4; 1006 1006 } 1007 1007 } 1008 - if (host->board->vcc_pin) { 1008 + if (gpio_is_valid(host->board->vcc_pin)) { 1009 1009 ret = gpio_request(host->board->vcc_pin, "mmc_vcc"); 1010 1010 if (ret < 0) { 1011 1011 dev_dbg(&pdev->dev, "couldn't claim vcc switch pin\n"); ··· 1057 1057 /* 1058 1058 * Add host to MMC layer 1059 1059 */ 1060 - if (host->board->det_pin) { 1060 + if (gpio_is_valid(host->board->det_pin)) { 1061 1061 host->present = !gpio_get_value(host->board->det_pin); 1062 1062 } 1063 1063 else ··· 1068 1068 /* 1069 1069 * monitor card insertion/removal if we can 1070 1070 */ 1071 - if (host->board->det_pin) { 1071 + if (gpio_is_valid(host->board->det_pin)) { 1072 1072 ret = request_irq(gpio_to_irq(host->board->det_pin), 1073 1073 at91_mmc_det_irq, 0, mmc_hostname(mmc), host); 1074 1074 if (ret) ··· 1087 1087 fail1: 1088 1088 clk_put(host->mci_clk); 1089 1089 fail2: 1090 - if (host->board->vcc_pin) 1090 + if (gpio_is_valid(host->board->vcc_pin)) 1091 1091 gpio_free(host->board->vcc_pin); 1092 1092 fail3: 1093 - if (host->board->wp_pin) 1093 + if (gpio_is_valid(host->board->wp_pin)) 1094 1094 gpio_free(host->board->wp_pin); 1095 1095 fail4: 1096 - if (host->board->det_pin) 1096 + if (gpio_is_valid(host->board->det_pin)) 1097 1097 gpio_free(host->board->det_pin); 1098 1098 fail4b: 1099 1099 if (host->buffer) ··· 1125 1125 dma_free_coherent(&pdev->dev, MCI_BUFSIZE, 1126 1126 host->buffer, host->physical_address); 1127 1127 1128 - if (host->board->det_pin) { 1128 + if (gpio_is_valid(host->board->det_pin)) { 1129 1129 if (device_can_wakeup(&pdev->dev)) 1130 1130 free_irq(gpio_to_irq(host->board->det_pin), host); 1131 1131 device_init_wakeup(&pdev->dev, 0); ··· 1140 1140 clk_disable(host->mci_clk); /* Disable the peripheral clock */ 1141 1141 clk_put(host->mci_clk); 1142 1142 1143 - if (host->board->vcc_pin) 1143 + if (gpio_is_valid(host->board->vcc_pin)) 1144 1144 gpio_free(host->board->vcc_pin); 1145 - if (host->board->wp_pin) 1145 + if (gpio_is_valid(host->board->wp_pin)) 1146 1146 gpio_free(host->board->wp_pin); 1147 1147 1148 1148 iounmap(host->baseaddr); ··· 1163 1163 struct at91mci_host *host = mmc_priv(mmc); 1164 1164 int ret = 0; 1165 1165 1166 - if (host->board->det_pin && device_may_wakeup(&pdev->dev)) 1166 + if (gpio_is_valid(host->board->det_pin) && device_may_wakeup(&pdev->dev)) 1167 1167 enable_irq_wake(host->board->det_pin); 1168 1168 1169 1169 if (mmc) ··· 1178 1178 struct at91mci_host *host = mmc_priv(mmc); 1179 1179 int ret = 0; 1180 1180 1181 - if (host->board->det_pin && device_may_wakeup(&pdev->dev)) 1181 + if (gpio_is_valid(host->board->det_pin) && device_may_wakeup(&pdev->dev)) 1182 1182 disable_irq_wake(host->board->det_pin); 1183 1183 1184 1184 if (mmc)
+4 -4
drivers/mtd/nand/atmel_nand.c
··· 113 113 */ 114 114 static void atmel_nand_enable(struct atmel_nand_host *host) 115 115 { 116 - if (host->board->enable_pin) 116 + if (gpio_is_valid(host->board->enable_pin)) 117 117 gpio_set_value(host->board->enable_pin, 0); 118 118 } 119 119 ··· 122 122 */ 123 123 static void atmel_nand_disable(struct atmel_nand_host *host) 124 124 { 125 - if (host->board->enable_pin) 125 + if (gpio_is_valid(host->board->enable_pin)) 126 126 gpio_set_value(host->board->enable_pin, 1); 127 127 } 128 128 ··· 492 492 nand_chip->IO_ADDR_W = host->io_base; 493 493 nand_chip->cmd_ctrl = atmel_nand_cmd_ctrl; 494 494 495 - if (host->board->rdy_pin) 495 + if (gpio_is_valid(host->board->rdy_pin)) 496 496 nand_chip->dev_ready = atmel_nand_device_ready; 497 497 498 498 regs = platform_get_resource(pdev, IORESOURCE_MEM, 1); ··· 530 530 platform_set_drvdata(pdev, host); 531 531 atmel_nand_enable(host); 532 532 533 - if (host->board->det_pin) { 533 + if (gpio_is_valid(host->board->det_pin)) { 534 534 if (gpio_get_value(host->board->det_pin)) { 535 535 printk(KERN_INFO "No SmartMedia card inserted.\n"); 536 536 res = -ENXIO;
+2 -1
drivers/net/ethernet/cadence/at91_ether.c
··· 26 26 #include <linux/skbuff.h> 27 27 #include <linux/dma-mapping.h> 28 28 #include <linux/ethtool.h> 29 + #include <linux/platform_data/macb.h> 29 30 #include <linux/platform_device.h> 30 31 #include <linux/clk.h> 31 32 #include <linux/gfp.h> ··· 985 984 static int __init at91ether_setup(unsigned long phy_type, unsigned short phy_address, 986 985 struct platform_device *pdev, struct clk *ether_clk) 987 986 { 988 - struct at91_eth_data *board_data = pdev->dev.platform_data; 987 + struct macb_platform_data *board_data = pdev->dev.platform_data; 989 988 struct net_device *dev; 990 989 struct at91_private *lp; 991 990 unsigned int val;
+3 -1
drivers/net/ethernet/cadence/at91_ether.h
··· 85 85 struct at91_private 86 86 { 87 87 struct mii_if_info mii; /* ethtool support */ 88 - struct at91_eth_data board_data; /* board-specific configuration */ 88 + struct macb_platform_data board_data; /* board-specific 89 + * configuration (shared with 90 + * macb for common data */ 89 91 struct clk *ether_clk; /* clock */ 90 92 91 93 /* PHY */
+62 -91
drivers/net/ethernet/cadence/macb.c
··· 8 8 * published by the Free Software Foundation. 9 9 */ 10 10 11 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 11 12 #include <linux/clk.h> 12 13 #include <linux/module.h> 13 14 #include <linux/moduleparam.h> ··· 20 19 #include <linux/netdevice.h> 21 20 #include <linux/etherdevice.h> 22 21 #include <linux/dma-mapping.h> 22 + #include <linux/platform_data/macb.h> 23 23 #include <linux/platform_device.h> 24 24 #include <linux/phy.h> 25 - 26 - #include <mach/board.h> 27 - #include <mach/cpu.h> 28 25 29 26 #include "macb.h" 30 27 ··· 83 84 if (is_valid_ether_addr(addr)) { 84 85 memcpy(bp->dev->dev_addr, addr, sizeof(addr)); 85 86 } else { 86 - dev_info(&bp->pdev->dev, "invalid hw address, using random\n"); 87 + netdev_info(bp->dev, "invalid hw address, using random\n"); 87 88 random_ether_addr(bp->dev->dev_addr); 88 89 } 89 90 } ··· 177 178 178 179 if (status_change) { 179 180 if (phydev->link) 180 - printk(KERN_INFO "%s: link up (%d/%s)\n", 181 - dev->name, phydev->speed, 182 - DUPLEX_FULL == phydev->duplex ? "Full":"Half"); 181 + netdev_info(dev, "link up (%d/%s)\n", 182 + phydev->speed, 183 + phydev->duplex == DUPLEX_FULL ? 184 + "Full" : "Half"); 183 185 else 184 - printk(KERN_INFO "%s: link down\n", dev->name); 186 + netdev_info(dev, "link down\n"); 185 187 } 186 188 } 187 189 ··· 191 191 { 192 192 struct macb *bp = netdev_priv(dev); 193 193 struct phy_device *phydev; 194 - struct eth_platform_data *pdata; 194 + struct macb_platform_data *pdata; 195 195 int ret; 196 196 197 197 phydev = phy_find_first(bp->mii_bus); 198 198 if (!phydev) { 199 - printk (KERN_ERR "%s: no PHY found\n", dev->name); 199 + netdev_err(dev, "no PHY found\n"); 200 200 return -1; 201 201 } 202 202 ··· 209 209 PHY_INTERFACE_MODE_RMII : 210 210 PHY_INTERFACE_MODE_MII); 211 211 if (ret) { 212 - printk(KERN_ERR "%s: Could not attach to PHY\n", dev->name); 212 + netdev_err(dev, "Could not attach to PHY\n"); 213 213 return ret; 214 214 } 215 215 ··· 228 228 229 229 static int macb_mii_init(struct macb *bp) 230 230 { 231 - struct eth_platform_data *pdata; 231 + struct macb_platform_data *pdata; 232 232 int err = -ENXIO, i; 233 233 234 234 /* Enable management port */ ··· 303 303 status = macb_readl(bp, TSR); 304 304 macb_writel(bp, TSR, status); 305 305 306 - dev_dbg(&bp->pdev->dev, "macb_tx status = %02lx\n", 307 - (unsigned long)status); 306 + netdev_dbg(bp->dev, "macb_tx status = %02lx\n", (unsigned long)status); 308 307 309 308 if (status & (MACB_BIT(UND) | MACB_BIT(TSR_RLE))) { 310 309 int i; 311 - printk(KERN_ERR "%s: TX %s, resetting buffers\n", 312 - bp->dev->name, status & MACB_BIT(UND) ? 313 - "underrun" : "retry limit exceeded"); 310 + netdev_err(bp->dev, "TX %s, resetting buffers\n", 311 + status & MACB_BIT(UND) ? 312 + "underrun" : "retry limit exceeded"); 314 313 315 314 /* Transfer ongoing, disable transmitter, to avoid confusion */ 316 315 if (status & MACB_BIT(TGO)) ··· 368 369 if (!(bufstat & MACB_BIT(TX_USED))) 369 370 break; 370 371 371 - dev_dbg(&bp->pdev->dev, "skb %u (data %p) TX complete\n", 372 - tail, skb->data); 372 + netdev_dbg(bp->dev, "skb %u (data %p) TX complete\n", 373 + tail, skb->data); 373 374 dma_unmap_single(&bp->pdev->dev, rp->mapping, skb->len, 374 375 DMA_TO_DEVICE); 375 376 bp->stats.tx_packets++; ··· 394 395 395 396 len = MACB_BFEXT(RX_FRMLEN, bp->rx_ring[last_frag].ctrl); 396 397 397 - dev_dbg(&bp->pdev->dev, "macb_rx_frame frags %u - %u (len %u)\n", 398 - first_frag, last_frag, len); 398 + netdev_dbg(bp->dev, "macb_rx_frame frags %u - %u (len %u)\n", 399 + first_frag, last_frag, len); 399 400 400 401 skb = dev_alloc_skb(len + RX_OFFSET); 401 402 if (!skb) { ··· 436 437 437 438 bp->stats.rx_packets++; 438 439 bp->stats.rx_bytes += len; 439 - dev_dbg(&bp->pdev->dev, "received skb of length %u, csum: %08x\n", 440 - skb->len, skb->csum); 440 + netdev_dbg(bp->dev, "received skb of length %u, csum: %08x\n", 441 + skb->len, skb->csum); 441 442 netif_receive_skb(skb); 442 443 443 444 return 0; ··· 514 515 515 516 work_done = 0; 516 517 517 - dev_dbg(&bp->pdev->dev, "poll: status = %08lx, budget = %d\n", 518 - (unsigned long)status, budget); 518 + netdev_dbg(bp->dev, "poll: status = %08lx, budget = %d\n", 519 + (unsigned long)status, budget); 519 520 520 521 work_done = macb_rx(bp, budget); 521 522 if (work_done < budget) { ··· 564 565 macb_writel(bp, IDR, MACB_RX_INT_FLAGS); 565 566 566 567 if (napi_schedule_prep(&bp->napi)) { 567 - dev_dbg(&bp->pdev->dev, 568 - "scheduling RX softirq\n"); 568 + netdev_dbg(bp->dev, "scheduling RX softirq\n"); 569 569 __napi_schedule(&bp->napi); 570 570 } 571 571 } ··· 585 587 586 588 if (status & MACB_BIT(HRESP)) { 587 589 /* 588 - * TODO: Reset the hardware, and maybe move the printk 589 - * to a lower-priority context as well (work queue?) 590 + * TODO: Reset the hardware, and maybe move the 591 + * netdev_err to a lower-priority context as well 592 + * (work queue?) 590 593 */ 591 - printk(KERN_ERR "%s: DMA bus error: HRESP not OK\n", 592 - dev->name); 594 + netdev_err(dev, "DMA bus error: HRESP not OK\n"); 593 595 } 594 596 595 597 status = macb_readl(bp, ISR); ··· 624 626 unsigned long flags; 625 627 626 628 #ifdef DEBUG 627 - int i; 628 - dev_dbg(&bp->pdev->dev, 629 - "start_xmit: len %u head %p data %p tail %p end %p\n", 630 - skb->len, skb->head, skb->data, 631 - skb_tail_pointer(skb), skb_end_pointer(skb)); 632 - dev_dbg(&bp->pdev->dev, 633 - "data:"); 634 - for (i = 0; i < 16; i++) 635 - printk(" %02x", (unsigned int)skb->data[i]); 636 - printk("\n"); 629 + netdev_dbg(bp->dev, 630 + "start_xmit: len %u head %p data %p tail %p end %p\n", 631 + skb->len, skb->head, skb->data, 632 + skb_tail_pointer(skb), skb_end_pointer(skb)); 633 + print_hex_dump(KERN_DEBUG, "data: ", DUMP_PREFIX_OFFSET, 16, 1, 634 + skb->data, 16, true); 637 635 #endif 638 636 639 637 len = skb->len; ··· 639 645 if (TX_BUFFS_AVAIL(bp) < 1) { 640 646 netif_stop_queue(dev); 641 647 spin_unlock_irqrestore(&bp->lock, flags); 642 - dev_err(&bp->pdev->dev, 643 - "BUG! Tx Ring full when queue awake!\n"); 644 - dev_dbg(&bp->pdev->dev, "tx_head = %u, tx_tail = %u\n", 645 - bp->tx_head, bp->tx_tail); 648 + netdev_err(bp->dev, "BUG! Tx Ring full when queue awake!\n"); 649 + netdev_dbg(bp->dev, "tx_head = %u, tx_tail = %u\n", 650 + bp->tx_head, bp->tx_tail); 646 651 return NETDEV_TX_BUSY; 647 652 } 648 653 649 654 entry = bp->tx_head; 650 - dev_dbg(&bp->pdev->dev, "Allocated ring entry %u\n", entry); 655 + netdev_dbg(bp->dev, "Allocated ring entry %u\n", entry); 651 656 mapping = dma_map_single(&bp->pdev->dev, skb->data, 652 657 len, DMA_TO_DEVICE); 653 658 bp->tx_skb[entry].skb = skb; 654 659 bp->tx_skb[entry].mapping = mapping; 655 - dev_dbg(&bp->pdev->dev, "Mapped skb data %p to DMA addr %08lx\n", 656 - skb->data, (unsigned long)mapping); 660 + netdev_dbg(bp->dev, "Mapped skb data %p to DMA addr %08lx\n", 661 + skb->data, (unsigned long)mapping); 657 662 658 663 ctrl = MACB_BF(TX_FRMLEN, len); 659 664 ctrl |= MACB_BIT(TX_LAST); ··· 716 723 &bp->rx_ring_dma, GFP_KERNEL); 717 724 if (!bp->rx_ring) 718 725 goto out_err; 719 - dev_dbg(&bp->pdev->dev, 720 - "Allocated RX ring of %d bytes at %08lx (mapped %p)\n", 721 - size, (unsigned long)bp->rx_ring_dma, bp->rx_ring); 726 + netdev_dbg(bp->dev, 727 + "Allocated RX ring of %d bytes at %08lx (mapped %p)\n", 728 + size, (unsigned long)bp->rx_ring_dma, bp->rx_ring); 722 729 723 730 size = TX_RING_BYTES; 724 731 bp->tx_ring = dma_alloc_coherent(&bp->pdev->dev, size, 725 732 &bp->tx_ring_dma, GFP_KERNEL); 726 733 if (!bp->tx_ring) 727 734 goto out_err; 728 - dev_dbg(&bp->pdev->dev, 729 - "Allocated TX ring of %d bytes at %08lx (mapped %p)\n", 730 - size, (unsigned long)bp->tx_ring_dma, bp->tx_ring); 735 + netdev_dbg(bp->dev, 736 + "Allocated TX ring of %d bytes at %08lx (mapped %p)\n", 737 + size, (unsigned long)bp->tx_ring_dma, bp->tx_ring); 731 738 732 739 size = RX_RING_SIZE * RX_BUFFER_SIZE; 733 740 bp->rx_buffers = dma_alloc_coherent(&bp->pdev->dev, size, 734 741 &bp->rx_buffers_dma, GFP_KERNEL); 735 742 if (!bp->rx_buffers) 736 743 goto out_err; 737 - dev_dbg(&bp->pdev->dev, 738 - "Allocated RX buffers of %d bytes at %08lx (mapped %p)\n", 739 - size, (unsigned long)bp->rx_buffers_dma, bp->rx_buffers); 744 + netdev_dbg(bp->dev, 745 + "Allocated RX buffers of %d bytes at %08lx (mapped %p)\n", 746 + size, (unsigned long)bp->rx_buffers_dma, bp->rx_buffers); 740 747 741 748 return 0; 742 749 ··· 947 954 struct macb *bp = netdev_priv(dev); 948 955 int err; 949 956 950 - dev_dbg(&bp->pdev->dev, "open\n"); 957 + netdev_dbg(bp->dev, "open\n"); 951 958 952 959 /* if the phy is not yet register, retry later*/ 953 960 if (!bp->phy_dev) ··· 958 965 959 966 err = macb_alloc_consistent(bp); 960 967 if (err) { 961 - printk(KERN_ERR 962 - "%s: Unable to allocate DMA memory (error %d)\n", 963 - dev->name, err); 968 + netdev_err(dev, "Unable to allocate DMA memory (error %d)\n", 969 + err); 964 970 return err; 965 971 } 966 972 ··· 1111 1119 1112 1120 static int __init macb_probe(struct platform_device *pdev) 1113 1121 { 1114 - struct eth_platform_data *pdata; 1122 + struct macb_platform_data *pdata; 1115 1123 struct resource *regs; 1116 1124 struct net_device *dev; 1117 1125 struct macb *bp; ··· 1144 1152 1145 1153 spin_lock_init(&bp->lock); 1146 1154 1147 - #if defined(CONFIG_ARCH_AT91) 1148 - bp->pclk = clk_get(&pdev->dev, "macb_clk"); 1155 + bp->pclk = clk_get(&pdev->dev, "pclk"); 1149 1156 if (IS_ERR(bp->pclk)) { 1150 1157 dev_err(&pdev->dev, "failed to get macb_clk\n"); 1151 1158 goto err_out_free_dev; 1152 1159 } 1153 1160 clk_enable(bp->pclk); 1154 - #else 1155 - bp->pclk = clk_get(&pdev->dev, "pclk"); 1156 - if (IS_ERR(bp->pclk)) { 1157 - dev_err(&pdev->dev, "failed to get pclk\n"); 1158 - goto err_out_free_dev; 1159 - } 1161 + 1160 1162 bp->hclk = clk_get(&pdev->dev, "hclk"); 1161 1163 if (IS_ERR(bp->hclk)) { 1162 1164 dev_err(&pdev->dev, "failed to get hclk\n"); 1163 1165 goto err_out_put_pclk; 1164 1166 } 1165 - 1166 - clk_enable(bp->pclk); 1167 1167 clk_enable(bp->hclk); 1168 - #endif 1169 1168 1170 1169 bp->regs = ioremap(regs->start, resource_size(regs)); 1171 1170 if (!bp->regs) { ··· 1168 1185 dev->irq = platform_get_irq(pdev, 0); 1169 1186 err = request_irq(dev->irq, macb_interrupt, 0, dev->name, dev); 1170 1187 if (err) { 1171 - printk(KERN_ERR 1172 - "%s: Unable to request IRQ %d (error %d)\n", 1173 - dev->name, dev->irq, err); 1188 + dev_err(&pdev->dev, "Unable to request IRQ %d (error %d)\n", 1189 + dev->irq, err); 1174 1190 goto err_out_iounmap; 1175 1191 } 1176 1192 ··· 1221 1239 1222 1240 platform_set_drvdata(pdev, dev); 1223 1241 1224 - printk(KERN_INFO "%s: Atmel MACB at 0x%08lx irq %d (%pM)\n", 1225 - dev->name, dev->base_addr, dev->irq, dev->dev_addr); 1242 + netdev_info(dev, "Atmel MACB at 0x%08lx irq %d (%pM)\n", 1243 + dev->base_addr, dev->irq, dev->dev_addr); 1226 1244 1227 1245 phydev = bp->phy_dev; 1228 - printk(KERN_INFO "%s: attached PHY driver [%s] " 1229 - "(mii_bus:phy_addr=%s, irq=%d)\n", dev->name, 1230 - phydev->drv->name, dev_name(&phydev->dev), phydev->irq); 1246 + netdev_info(dev, "attached PHY driver [%s] (mii_bus:phy_addr=%s, irq=%d)\n", 1247 + phydev->drv->name, dev_name(&phydev->dev), phydev->irq); 1231 1248 1232 1249 return 0; 1233 1250 ··· 1237 1256 err_out_iounmap: 1238 1257 iounmap(bp->regs); 1239 1258 err_out_disable_clocks: 1240 - #ifndef CONFIG_ARCH_AT91 1241 1259 clk_disable(bp->hclk); 1242 1260 clk_put(bp->hclk); 1243 - #endif 1244 1261 clk_disable(bp->pclk); 1245 - #ifndef CONFIG_ARCH_AT91 1246 1262 err_out_put_pclk: 1247 - #endif 1248 1263 clk_put(bp->pclk); 1249 1264 err_out_free_dev: 1250 1265 free_netdev(dev); ··· 1266 1289 unregister_netdev(dev); 1267 1290 free_irq(dev->irq, dev); 1268 1291 iounmap(bp->regs); 1269 - #ifndef CONFIG_ARCH_AT91 1270 1292 clk_disable(bp->hclk); 1271 1293 clk_put(bp->hclk); 1272 - #endif 1273 1294 clk_disable(bp->pclk); 1274 1295 clk_put(bp->pclk); 1275 1296 free_netdev(dev); ··· 1285 1310 1286 1311 netif_device_detach(netdev); 1287 1312 1288 - #ifndef CONFIG_ARCH_AT91 1289 1313 clk_disable(bp->hclk); 1290 - #endif 1291 1314 clk_disable(bp->pclk); 1292 1315 1293 1316 return 0; ··· 1297 1324 struct macb *bp = netdev_priv(netdev); 1298 1325 1299 1326 clk_enable(bp->pclk); 1300 - #ifndef CONFIG_ARCH_AT91 1301 1327 clk_enable(bp->hclk); 1302 - #endif 1303 1328 1304 1329 netif_device_attach(netdev); 1305 1330
+63 -38
drivers/rtc/rtc-at91rm9200.c
··· 32 32 33 33 #include <mach/at91_rtc.h> 34 34 35 + #define at91_rtc_read(field) \ 36 + __raw_readl(at91_rtc_regs + field) 37 + #define at91_rtc_write(field, val) \ 38 + __raw_writel((val), at91_rtc_regs + field) 35 39 36 40 #define AT91_RTC_EPOCH 1900UL /* just like arch/arm/common/rtctime.c */ 37 41 38 42 static DECLARE_COMPLETION(at91_rtc_updated); 39 43 static unsigned int at91_alarm_year = AT91_RTC_EPOCH; 44 + static void __iomem *at91_rtc_regs; 45 + static int irq; 40 46 41 47 /* 42 48 * Decode time/date into rtc_time structure ··· 54 48 55 49 /* must read twice in case it changes */ 56 50 do { 57 - time = at91_sys_read(timereg); 58 - date = at91_sys_read(calreg); 59 - } while ((time != at91_sys_read(timereg)) || 60 - (date != at91_sys_read(calreg))); 51 + time = at91_rtc_read(timereg); 52 + date = at91_rtc_read(calreg); 53 + } while ((time != at91_rtc_read(timereg)) || 54 + (date != at91_rtc_read(calreg))); 61 55 62 56 tm->tm_sec = bcd2bin((time & AT91_RTC_SEC) >> 0); 63 57 tm->tm_min = bcd2bin((time & AT91_RTC_MIN) >> 8); ··· 104 98 tm->tm_hour, tm->tm_min, tm->tm_sec); 105 99 106 100 /* Stop Time/Calendar from counting */ 107 - cr = at91_sys_read(AT91_RTC_CR); 108 - at91_sys_write(AT91_RTC_CR, cr | AT91_RTC_UPDCAL | AT91_RTC_UPDTIM); 101 + cr = at91_rtc_read(AT91_RTC_CR); 102 + at91_rtc_write(AT91_RTC_CR, cr | AT91_RTC_UPDCAL | AT91_RTC_UPDTIM); 109 103 110 - at91_sys_write(AT91_RTC_IER, AT91_RTC_ACKUPD); 104 + at91_rtc_write(AT91_RTC_IER, AT91_RTC_ACKUPD); 111 105 wait_for_completion(&at91_rtc_updated); /* wait for ACKUPD interrupt */ 112 - at91_sys_write(AT91_RTC_IDR, AT91_RTC_ACKUPD); 106 + at91_rtc_write(AT91_RTC_IDR, AT91_RTC_ACKUPD); 113 107 114 - at91_sys_write(AT91_RTC_TIMR, 108 + at91_rtc_write(AT91_RTC_TIMR, 115 109 bin2bcd(tm->tm_sec) << 0 116 110 | bin2bcd(tm->tm_min) << 8 117 111 | bin2bcd(tm->tm_hour) << 16); 118 112 119 - at91_sys_write(AT91_RTC_CALR, 113 + at91_rtc_write(AT91_RTC_CALR, 120 114 bin2bcd((tm->tm_year + 1900) / 100) /* century */ 121 115 | bin2bcd(tm->tm_year % 100) << 8 /* year */ 122 116 | bin2bcd(tm->tm_mon + 1) << 16 /* tm_mon starts at zero */ ··· 124 118 | bin2bcd(tm->tm_mday) << 24); 125 119 126 120 /* Restart Time/Calendar */ 127 - cr = at91_sys_read(AT91_RTC_CR); 128 - at91_sys_write(AT91_RTC_CR, cr & ~(AT91_RTC_UPDCAL | AT91_RTC_UPDTIM)); 121 + cr = at91_rtc_read(AT91_RTC_CR); 122 + at91_rtc_write(AT91_RTC_CR, cr & ~(AT91_RTC_UPDCAL | AT91_RTC_UPDTIM)); 129 123 130 124 return 0; 131 125 } ··· 141 135 tm->tm_yday = rtc_year_days(tm->tm_mday, tm->tm_mon, tm->tm_year); 142 136 tm->tm_year = at91_alarm_year - 1900; 143 137 144 - alrm->enabled = (at91_sys_read(AT91_RTC_IMR) & AT91_RTC_ALARM) 138 + alrm->enabled = (at91_rtc_read(AT91_RTC_IMR) & AT91_RTC_ALARM) 145 139 ? 1 : 0; 146 140 147 141 pr_debug("%s(): %4d-%02d-%02d %02d:%02d:%02d\n", __func__, ··· 166 160 tm.tm_min = alrm->time.tm_min; 167 161 tm.tm_sec = alrm->time.tm_sec; 168 162 169 - at91_sys_write(AT91_RTC_IDR, AT91_RTC_ALARM); 170 - at91_sys_write(AT91_RTC_TIMALR, 163 + at91_rtc_write(AT91_RTC_IDR, AT91_RTC_ALARM); 164 + at91_rtc_write(AT91_RTC_TIMALR, 171 165 bin2bcd(tm.tm_sec) << 0 172 166 | bin2bcd(tm.tm_min) << 8 173 167 | bin2bcd(tm.tm_hour) << 16 174 168 | AT91_RTC_HOUREN | AT91_RTC_MINEN | AT91_RTC_SECEN); 175 - at91_sys_write(AT91_RTC_CALALR, 169 + at91_rtc_write(AT91_RTC_CALALR, 176 170 bin2bcd(tm.tm_mon + 1) << 16 /* tm_mon starts at zero */ 177 171 | bin2bcd(tm.tm_mday) << 24 178 172 | AT91_RTC_DATEEN | AT91_RTC_MTHEN); 179 173 180 174 if (alrm->enabled) { 181 - at91_sys_write(AT91_RTC_SCCR, AT91_RTC_ALARM); 182 - at91_sys_write(AT91_RTC_IER, AT91_RTC_ALARM); 175 + at91_rtc_write(AT91_RTC_SCCR, AT91_RTC_ALARM); 176 + at91_rtc_write(AT91_RTC_IER, AT91_RTC_ALARM); 183 177 } 184 178 185 179 pr_debug("%s(): %4d-%02d-%02d %02d:%02d:%02d\n", __func__, ··· 194 188 pr_debug("%s(): cmd=%08x\n", __func__, enabled); 195 189 196 190 if (enabled) { 197 - at91_sys_write(AT91_RTC_SCCR, AT91_RTC_ALARM); 198 - at91_sys_write(AT91_RTC_IER, AT91_RTC_ALARM); 191 + at91_rtc_write(AT91_RTC_SCCR, AT91_RTC_ALARM); 192 + at91_rtc_write(AT91_RTC_IER, AT91_RTC_ALARM); 199 193 } else 200 - at91_sys_write(AT91_RTC_IDR, AT91_RTC_ALARM); 194 + at91_rtc_write(AT91_RTC_IDR, AT91_RTC_ALARM); 201 195 202 196 return 0; 203 197 } ··· 206 200 */ 207 201 static int at91_rtc_proc(struct device *dev, struct seq_file *seq) 208 202 { 209 - unsigned long imr = at91_sys_read(AT91_RTC_IMR); 203 + unsigned long imr = at91_rtc_read(AT91_RTC_IMR); 210 204 211 205 seq_printf(seq, "update_IRQ\t: %s\n", 212 206 (imr & AT91_RTC_ACKUPD) ? "yes" : "no"); ··· 226 220 unsigned int rtsr; 227 221 unsigned long events = 0; 228 222 229 - rtsr = at91_sys_read(AT91_RTC_SR) & at91_sys_read(AT91_RTC_IMR); 223 + rtsr = at91_rtc_read(AT91_RTC_SR) & at91_rtc_read(AT91_RTC_IMR); 230 224 if (rtsr) { /* this interrupt is shared! Is it ours? */ 231 225 if (rtsr & AT91_RTC_ALARM) 232 226 events |= (RTC_AF | RTC_IRQF); ··· 235 229 if (rtsr & AT91_RTC_ACKUPD) 236 230 complete(&at91_rtc_updated); 237 231 238 - at91_sys_write(AT91_RTC_SCCR, rtsr); /* clear status reg */ 232 + at91_rtc_write(AT91_RTC_SCCR, rtsr); /* clear status reg */ 239 233 240 234 rtc_update_irq(rtc, 1, events); 241 235 ··· 262 256 static int __init at91_rtc_probe(struct platform_device *pdev) 263 257 { 264 258 struct rtc_device *rtc; 265 - int ret; 259 + struct resource *regs; 260 + int ret = 0; 266 261 267 - at91_sys_write(AT91_RTC_CR, 0); 268 - at91_sys_write(AT91_RTC_MR, 0); /* 24 hour mode */ 262 + regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); 263 + if (!regs) { 264 + dev_err(&pdev->dev, "no mmio resource defined\n"); 265 + return -ENXIO; 266 + } 267 + 268 + irq = platform_get_irq(pdev, 0); 269 + if (irq < 0) { 270 + dev_err(&pdev->dev, "no irq resource defined\n"); 271 + return -ENXIO; 272 + } 273 + 274 + at91_rtc_regs = ioremap(regs->start, resource_size(regs)); 275 + if (!at91_rtc_regs) { 276 + dev_err(&pdev->dev, "failed to map registers, aborting.\n"); 277 + return -ENOMEM; 278 + } 279 + 280 + at91_rtc_write(AT91_RTC_CR, 0); 281 + at91_rtc_write(AT91_RTC_MR, 0); /* 24 hour mode */ 269 282 270 283 /* Disable all interrupts */ 271 - at91_sys_write(AT91_RTC_IDR, AT91_RTC_ACKUPD | AT91_RTC_ALARM | 284 + at91_rtc_write(AT91_RTC_IDR, AT91_RTC_ACKUPD | AT91_RTC_ALARM | 272 285 AT91_RTC_SECEV | AT91_RTC_TIMEV | 273 286 AT91_RTC_CALEV); 274 287 275 - ret = request_irq(AT91_ID_SYS, at91_rtc_interrupt, 288 + ret = request_irq(irq, at91_rtc_interrupt, 276 289 IRQF_SHARED, 277 290 "at91_rtc", pdev); 278 291 if (ret) { 279 292 printk(KERN_ERR "at91_rtc: IRQ %d already in use.\n", 280 - AT91_ID_SYS); 293 + irq); 281 294 return ret; 282 295 } 283 296 ··· 309 284 rtc = rtc_device_register(pdev->name, &pdev->dev, 310 285 &at91_rtc_ops, THIS_MODULE); 311 286 if (IS_ERR(rtc)) { 312 - free_irq(AT91_ID_SYS, pdev); 287 + free_irq(irq, pdev); 313 288 return PTR_ERR(rtc); 314 289 } 315 290 platform_set_drvdata(pdev, rtc); ··· 326 301 struct rtc_device *rtc = platform_get_drvdata(pdev); 327 302 328 303 /* Disable all interrupts */ 329 - at91_sys_write(AT91_RTC_IDR, AT91_RTC_ACKUPD | AT91_RTC_ALARM | 304 + at91_rtc_write(AT91_RTC_IDR, AT91_RTC_ACKUPD | AT91_RTC_ALARM | 330 305 AT91_RTC_SECEV | AT91_RTC_TIMEV | 331 306 AT91_RTC_CALEV); 332 - free_irq(AT91_ID_SYS, pdev); 307 + free_irq(irq, pdev); 333 308 334 309 rtc_device_unregister(rtc); 335 310 platform_set_drvdata(pdev, NULL); ··· 348 323 /* this IRQ is shared with DBGU and other hardware which isn't 349 324 * necessarily doing PM like we are... 350 325 */ 351 - at91_rtc_imr = at91_sys_read(AT91_RTC_IMR) 326 + at91_rtc_imr = at91_rtc_read(AT91_RTC_IMR) 352 327 & (AT91_RTC_ALARM|AT91_RTC_SECEV); 353 328 if (at91_rtc_imr) { 354 329 if (device_may_wakeup(dev)) 355 - enable_irq_wake(AT91_ID_SYS); 330 + enable_irq_wake(irq); 356 331 else 357 - at91_sys_write(AT91_RTC_IDR, at91_rtc_imr); 332 + at91_rtc_write(AT91_RTC_IDR, at91_rtc_imr); 358 333 } 359 334 return 0; 360 335 } ··· 363 338 { 364 339 if (at91_rtc_imr) { 365 340 if (device_may_wakeup(dev)) 366 - disable_irq_wake(AT91_ID_SYS); 341 + disable_irq_wake(irq); 367 342 else 368 - at91_sys_write(AT91_RTC_IER, at91_rtc_imr); 343 + at91_rtc_write(AT91_RTC_IER, at91_rtc_imr); 369 344 } 370 345 return 0; 371 346 }
+7 -7
drivers/usb/gadget/at91_udc.c
··· 1748 1748 1749 1749 /* rm9200 needs manual D+ pullup; off by default */ 1750 1750 if (cpu_is_at91rm9200()) { 1751 - if (udc->board.pullup_pin <= 0) { 1751 + if (gpio_is_valid(udc->board.pullup_pin)) { 1752 1752 DBG("no D+ pullup?\n"); 1753 1753 retval = -ENODEV; 1754 1754 goto fail0; ··· 1815 1815 DBG("request irq %d failed\n", udc->udp_irq); 1816 1816 goto fail1; 1817 1817 } 1818 - if (udc->board.vbus_pin > 0) { 1818 + if (gpio_is_valid(udc->board.vbus_pin)) { 1819 1819 retval = gpio_request(udc->board.vbus_pin, "udc_vbus"); 1820 1820 if (retval < 0) { 1821 1821 DBG("request vbus pin failed\n"); ··· 1859 1859 INFO("%s version %s\n", driver_name, DRIVER_VERSION); 1860 1860 return 0; 1861 1861 fail4: 1862 - if (udc->board.vbus_pin > 0 && !udc->board.vbus_polled) 1862 + if (gpio_is_valid(udc->board.vbus_pin) && !udc->board.vbus_polled) 1863 1863 free_irq(udc->board.vbus_pin, udc); 1864 1864 fail3: 1865 - if (udc->board.vbus_pin > 0) 1865 + if (gpio_is_valid(udc->board.vbus_pin)) 1866 1866 gpio_free(udc->board.vbus_pin); 1867 1867 fail2: 1868 1868 free_irq(udc->udp_irq, udc); ··· 1897 1897 1898 1898 device_init_wakeup(&pdev->dev, 0); 1899 1899 remove_debug_file(udc); 1900 - if (udc->board.vbus_pin > 0) { 1900 + if (gpio_is_valid(udc->board.vbus_pin)) { 1901 1901 free_irq(udc->board.vbus_pin, udc); 1902 1902 gpio_free(udc->board.vbus_pin); 1903 1903 } ··· 1941 1941 enable_irq_wake(udc->udp_irq); 1942 1942 1943 1943 udc->active_suspend = wake; 1944 - if (udc->board.vbus_pin > 0 && !udc->board.vbus_polled && wake) 1944 + if (gpio_is_valid(udc->board.vbus_pin) && !udc->board.vbus_polled && wake) 1945 1945 enable_irq_wake(udc->board.vbus_pin); 1946 1946 return 0; 1947 1947 } ··· 1951 1951 struct at91_udc *udc = platform_get_drvdata(pdev); 1952 1952 unsigned long flags; 1953 1953 1954 - if (udc->board.vbus_pin > 0 && !udc->board.vbus_polled && 1954 + if (gpio_is_valid(udc->board.vbus_pin) && !udc->board.vbus_polled && 1955 1955 udc->active_suspend) 1956 1956 disable_irq_wake(udc->board.vbus_pin); 1957 1957
+6 -6
drivers/usb/host/ohci-at91.c
··· 223 223 if (port < 0 || port >= 2) 224 224 return; 225 225 226 - if (pdata->vbus_pin[port] <= 0) 226 + if (!gpio_is_valid(pdata->vbus_pin[port])) 227 227 return; 228 228 229 229 gpio_set_value(pdata->vbus_pin[port], !pdata->vbus_pin_inverted ^ enable); ··· 234 234 if (port < 0 || port >= 2) 235 235 return -EINVAL; 236 236 237 - if (pdata->vbus_pin[port] <= 0) 237 + if (!gpio_is_valid(pdata->vbus_pin[port])) 238 238 return -EINVAL; 239 239 240 240 return gpio_get_value(pdata->vbus_pin[port]) ^ !pdata->vbus_pin_inverted; ··· 465 465 466 466 if (pdata) { 467 467 for (i = 0; i < ARRAY_SIZE(pdata->vbus_pin); i++) { 468 - if (pdata->vbus_pin[i] <= 0) 468 + if (!gpio_is_valid(pdata->vbus_pin[i])) 469 469 continue; 470 470 gpio_request(pdata->vbus_pin[i], "ohci_vbus"); 471 471 ohci_at91_usb_set_power(pdata, i, 1); ··· 474 474 for (i = 0; i < ARRAY_SIZE(pdata->overcurrent_pin); i++) { 475 475 int ret; 476 476 477 - if (pdata->overcurrent_pin[i] <= 0) 477 + if (!gpio_is_valid(pdata->overcurrent_pin[i])) 478 478 continue; 479 479 gpio_request(pdata->overcurrent_pin[i], "ohci_overcurrent"); 480 480 ··· 499 499 500 500 if (pdata) { 501 501 for (i = 0; i < ARRAY_SIZE(pdata->vbus_pin); i++) { 502 - if (pdata->vbus_pin[i] <= 0) 502 + if (!gpio_is_valid(pdata->vbus_pin[i])) 503 503 continue; 504 504 ohci_at91_usb_set_power(pdata, i, 0); 505 505 gpio_free(pdata->vbus_pin[i]); 506 506 } 507 507 508 508 for (i = 0; i < ARRAY_SIZE(pdata->overcurrent_pin); i++) { 509 - if (pdata->overcurrent_pin[i] <= 0) 509 + if (!gpio_is_valid(pdata->overcurrent_pin[i])) 510 510 continue; 511 511 free_irq(gpio_to_irq(pdata->overcurrent_pin[i]), pdev); 512 512 gpio_free(pdata->overcurrent_pin[i]);
+19 -3
drivers/watchdog/at91sam9_wdt.c
··· 35 35 36 36 #define DRV_NAME "AT91SAM9 Watchdog" 37 37 38 + #define wdt_read(field) \ 39 + __raw_readl(at91wdt_private.base + field) 40 + #define wdt_write(field, val) \ 41 + __raw_writel((val), at91wdt_private.base + field) 42 + 38 43 /* AT91SAM9 watchdog runs a 12bit counter @ 256Hz, 39 44 * use this to convert a watchdog 40 45 * value from/to milliseconds. ··· 68 63 static void at91_ping(unsigned long data); 69 64 70 65 static struct { 66 + void __iomem *base; 71 67 unsigned long next_heartbeat; /* the next_heartbeat for the timer */ 72 68 unsigned long open; 73 69 char expect_close; ··· 83 77 */ 84 78 static inline void at91_wdt_reset(void) 85 79 { 86 - at91_sys_write(AT91_WDT_CR, AT91_WDT_KEY | AT91_WDT_WDRSTT); 80 + wdt_write(AT91_WDT_CR, AT91_WDT_KEY | AT91_WDT_WDRSTT); 87 81 } 88 82 89 83 /* ··· 138 132 unsigned int mr; 139 133 140 134 /* Check if disabled */ 141 - mr = at91_sys_read(AT91_WDT_MR); 135 + mr = wdt_read(AT91_WDT_MR); 142 136 if (mr & AT91_WDT_WDDIS) { 143 137 printk(KERN_ERR DRV_NAME": sorry, watchdog is disabled\n"); 144 138 return -EIO; ··· 155 149 | AT91_WDT_WDDBGHLT /* disabled in debug mode */ 156 150 | AT91_WDT_WDD /* restart at any time */ 157 151 | (timeout & AT91_WDT_WDV); /* timer value */ 158 - at91_sys_write(AT91_WDT_MR, reg); 152 + wdt_write(AT91_WDT_MR, reg); 159 153 160 154 return 0; 161 155 } ··· 254 248 255 249 static int __init at91wdt_probe(struct platform_device *pdev) 256 250 { 251 + struct resource *r; 257 252 int res; 258 253 259 254 if (at91wdt_miscdev.parent) 260 255 return -EBUSY; 261 256 at91wdt_miscdev.parent = &pdev->dev; 257 + 258 + r = platform_get_resource(pdev, IORESOURCE_MEM, 0); 259 + if (!r) 260 + return -ENODEV; 261 + at91wdt_private.base = ioremap(r->start, resource_size(r)); 262 + if (!at91wdt_private.base) { 263 + dev_err(&pdev->dev, "failed to map registers, aborting.\n"); 264 + return -ENOMEM; 265 + } 262 266 263 267 /* Set watchdog */ 264 268 res = at91_wdt_settimeout(ms_to_ticks(WDT_HW_TIMEOUT * 1000));
+3 -3
drivers/watchdog/at91sam9_wdt.h
··· 16 16 #ifndef AT91_WDT_H 17 17 #define AT91_WDT_H 18 18 19 - #define AT91_WDT_CR (AT91_WDT + 0x00) /* Watchdog Control Register */ 19 + #define AT91_WDT_CR 0x00 /* Watchdog Control Register */ 20 20 #define AT91_WDT_WDRSTT (1 << 0) /* Restart */ 21 21 #define AT91_WDT_KEY (0xa5 << 24) /* KEY Password */ 22 22 23 - #define AT91_WDT_MR (AT91_WDT + 0x04) /* Watchdog Mode Register */ 23 + #define AT91_WDT_MR 0x04 /* Watchdog Mode Register */ 24 24 #define AT91_WDT_WDV (0xfff << 0) /* Counter Value */ 25 25 #define AT91_WDT_WDFIEN (1 << 12) /* Fault Interrupt Enable */ 26 26 #define AT91_WDT_WDRSTEN (1 << 13) /* Reset Processor */ ··· 30 30 #define AT91_WDT_WDDBGHLT (1 << 28) /* Debug Halt */ 31 31 #define AT91_WDT_WDIDLEHLT (1 << 29) /* Idle Halt */ 32 32 33 - #define AT91_WDT_SR (AT91_WDT + 0x08) /* Watchdog Status Register */ 33 + #define AT91_WDT_SR 0x08 /* Watchdog Status Register */ 34 34 #define AT91_WDT_WDUNF (1 << 0) /* Watchdog Underflow */ 35 35 #define AT91_WDT_WDERR (1 << 1) /* Watchdog Error */ 36 36
+17
include/linux/platform_data/macb.h
··· 1 + /* 2 + * Copyright (C) 2004-2006 Atmel Corporation 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 + #ifndef __MACB_PDATA_H__ 9 + #define __MACB_PDATA_H__ 10 + 11 + struct macb_platform_data { 12 + u32 phy_mask; 13 + int phy_irq_pin; /* PHY IRQ */ 14 + u8 is_rmii; /* using RMII interface? */ 15 + }; 16 + 17 + #endif /* __MACB_PDATA_H__ */
+71
include/media/davinci/vpif_types.h
··· 1 + /* 2 + * Copyright (C) 2011 Texas Instruments Inc 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 version 2. 7 + * 8 + * This program is distributed in the hope that it will be useful, 9 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 + * GNU General Public License for more details. 12 + * 13 + * You should have received a copy of the GNU General Public License 14 + * along with this program; if not, write to the Free Software 15 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 + */ 17 + #ifndef _VPIF_TYPES_H 18 + #define _VPIF_TYPES_H 19 + 20 + #define VPIF_CAPTURE_MAX_CHANNELS 2 21 + 22 + enum vpif_if_type { 23 + VPIF_IF_BT656, 24 + VPIF_IF_BT1120, 25 + VPIF_IF_RAW_BAYER 26 + }; 27 + 28 + struct vpif_interface { 29 + enum vpif_if_type if_type; 30 + unsigned hd_pol:1; 31 + unsigned vd_pol:1; 32 + unsigned fid_pol:1; 33 + }; 34 + 35 + struct vpif_subdev_info { 36 + const char *name; 37 + struct i2c_board_info board_info; 38 + u32 input; 39 + u32 output; 40 + unsigned can_route:1; 41 + struct vpif_interface vpif_if; 42 + }; 43 + 44 + struct vpif_display_config { 45 + int (*set_clock)(int, int); 46 + struct vpif_subdev_info *subdevinfo; 47 + int subdev_count; 48 + const char **output; 49 + int output_count; 50 + const char *card_name; 51 + }; 52 + 53 + struct vpif_input { 54 + struct v4l2_input input; 55 + const char *subdev_name; 56 + }; 57 + 58 + struct vpif_capture_chan_config { 59 + const struct vpif_input *inputs; 60 + int input_count; 61 + }; 62 + 63 + struct vpif_capture_config { 64 + int (*setup_input_channel_mode)(int); 65 + int (*setup_input_path)(int, const char *); 66 + struct vpif_capture_chan_config chan_config[VPIF_CAPTURE_MAX_CHANNELS]; 67 + struct vpif_subdev_info *subdev_info; 68 + int subdev_count; 69 + const char *card_name; 70 + }; 71 + #endif /* _VPIF_TYPES_H */