omap platform init patches for 2.6.35 merge window
Subsystems (4)
Tony Lindgren
maintainercover omap platform init patches for 2.6.35 merge window
Hi all,
Here are some omap patches mostly to get some more devices initialized.
With these the omap4 Ethernet should work, the drivers related patches are queued too.
Regards,
Tony
---
Abraham Arce (2):
OMAP4: Ethernet: KS8851 Board Support
OMAP4: Networking: Defconfig Support
Mika Westerberg (1):
OMAP2/3/4: DMA: disable channel interrupts in omap_init_dma()
Santosh Shilimkar (1):
omap4: Move SOC specific code from board file
Syed Rafiuddin (1):
OMAP4: SPI: Fix Driver Kconfig
Tony Lindgren (1):
omap: GPIO: Fix OMAP4 GPIO reg access issues
manjugk manjugk (1):
omap: DMA: Fix multi-line comments
stanley.miao (3):
omap: init the gpio pinmux for mmc
omap: hsmmc: fix the hsmmc driver for am3517
AM3517: rename the i2c boardinfo to make it more readable
arch/arm/configs/omap_4430sdp_defconfig | 57 ++++++++++ arch/arm/mach-omap2/Makefile | 2 arch/arm/mach-omap2/board-4430sdp.c | 128 +++++++++++++++-------- arch/arm/mach-omap2/board-am3517evm.c | 20 ++-- arch/arm/mach-omap2/devices.c | 9 ++ arch/arm/mach-omap2/hsmmc.c | 27 ++++- arch/arm/mach-omap2/include/mach/omap4-common.h | 26 +++++ arch/arm/mach-omap2/omap-smp.c | 2 arch/arm/mach-omap2/omap4-common.c | 72 +++++++++++++ arch/arm/plat-omap/common.c | 3 - arch/arm/plat-omap/dma.c | 45 ++++++-- arch/arm/plat-omap/gpio.c | 59 ++++++++--- arch/arm/plat-omap/include/plat/common.h | 3 - arch/arm/plat-omap/include/plat/mmc.h | 4 + drivers/spi/Kconfig | 6 + 15 files changed, 362 insertions(+), 101 deletions(-) create mode 100644 arch/arm/mach-omap2/include/mach/omap4-common.h create mode 100644 arch/arm/mach-omap2/omap4-common.c
Signature · 1 line
Signature
Tony Lindgren
maintainerPATCH 1/10 OMAP2/3/4: DMA: disable channel interrupts in omap_init_dma()
From: Mika Westerberg <[email protected]>
If we are softbooting another kernel using kexec, DMA controller state is not known when we are performing omap_init_dma(). It is possible that some DMA channels are already active. For example after kexec we get:
<4>IRQ 0020 for non-allocated DMAchannel 5
<4>IRQ 0020 for non-allocated DMAchannel 5
<4>IRQ 0020 for non-allocated DMAchannel 5
<4>IRQ 0020 for non-allocated DMAchannel 5
<4>IRQ 0020 for non-allocated DMAchannel 5
To prevent any weird things happening, we disable all channel interrupts during init.
--- arch/arm/plat-omap/dma.c | 27 +++++++++++++++++++-------- 1 files changed, 19 insertions(+), 8 deletions(-)
arch/arm/plat-omap/dma.c +19 -8
@@ -709,6 +709,21 @@ static inline void omap2_enable_irq_lch(int lch)spin_unlock_irqrestore (&dma_chan_lock, flags); } +static inline void omap2_disable_irq_lch (int lch) +{ +u32 val; +unsigned long flags; + +if (!cpu_class_is_omap2 ()) +return ; + +spin_lock_irqsave (&dma_chan_lock, flags); + val =dma_read (IRQENABLE_L0 ); + val &= ~(1 << lch); +dma_write (val,IRQENABLE_L0 ); +spin_unlock_irqrestore (&dma_chan_lock, flags); +} +int omap_request_dma (int dev_id,const char *dev_name,void (*callback)(int lch,u16 ch_status,void *data),void *data,int *dma_ch_out)
@@ -807,14 +822,7 @@ void omap_free_dma(int lch) }if (cpu_class_is_omap2 ()) { -u32 val; - -spin_lock_irqsave (&dma_chan_lock, flags); -/* Disable interrupts */ - val =dma_read (IRQENABLE_L0 ); - val &= ~(1 << lch); -dma_write (val,IRQENABLE_L0 ); -spin_unlock_irqrestore (&dma_chan_lock, flags); +omap2_disable_irq_lch (lch);/* Clear the CSR register and IRQ status register */ dma_write (OMAP2_DMA_CSR_CLEAR_MASK ,CSR (lch));
@@ -2107,6 +2115,9 @@ static int __init omap_init_dma(void)for (ch =0 ; ch < dma_chan_count; ch++) {omap_clear_dma (ch); +if (cpu_class_is_omap2 ()) +omap2_disable_irq_lch (ch); + dma_chan[ch].dev_id =-1 ; dma_chan[ch].next_lch =-1 ;
Tony Lindgren
maintainerPATCH 2/10 omap: DMA: Fix multi-line comments
In reply to Tony LindgrenFrom: manjugk manjugk <[email protected]>
Multi line comments are fixed as per CodingStyle guidelines.
--- arch/arm/plat-omap/dma.c | 18 ++++++++++++------ 1 files changed, 12 insertions(+), 6 deletions(-)
arch/arm/plat-omap/dma.c +12 -6
@@ -501,7 +501,8 @@ void omap_set_dma_src_burst_mode(int lch, enum omap_dma_burst_mode burst_mode) burst =0x2 ;break ; } -/* not supported by current hardware on OMAP1 +/* +* not supported by current hardware on OMAP1 * w |= (0x03 << 7); * fall through */
@@ -510,7 +511,8 @@ void omap_set_dma_src_burst_mode(int lch, enum omap_dma_burst_mode burst_mode) burst =0x3 ;break ; } -/* OMAP1 don't support burst 16 +/* +* OMAP1 don't support burst 16 * fall through */ default :
@@ -604,7 +606,8 @@ void omap_set_dma_dest_burst_mode(int lch, enum omap_dma_burst_mode burst_mode) burst =0x3 ;break ; } -/* OMAP1 don't support burst 16 +/* +* OMAP1 don't support burst 16 * fall through */ default :
@@ -1285,8 +1288,10 @@ int omap_request_dma_chain(int dev_id, const char *dev_name,return -EINVAL ; } -/* Allocate a queue to maintain the status of the channels -* in the chain */ +/* +* Allocate a queue to maintain the status of the channels +* in the chain +*/ channels =kmalloc (sizeof (*channels) * no_of_chans,GFP_KERNEL );if (channels ==NULL ) {printk (KERN_ERR "omap_dma: No memory for channel queue\n" );
@@ -1915,7 +1920,8 @@ static int omap2_dma_handle_ch(int ch)printk (KERN_INFO "DMA transaction error with device %d\n" , dma_chan[ch].dev_id);if (cpu_class_is_omap2 ()) { -/* Errata: sDMA Channel is not disabled +/* +* Errata: sDMA Channel is not disabled * after a transaction error. So we explicitely * disable the channel */
Tony Lindgren
maintainerPATCH 3/10 omap: init the gpio pinmux for mmc
In reply to Tony LindgrenFrom: stanley.miao <[email protected]>
There is two gpio for mmc use, one is for card detecting, another is used for checking write protect. Intialize its pinmux in case the bootloader doesn't set it.
--- arch/arm/mach-omap2/devices.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/devices.c +9 -0
@@ -591,6 +591,15 @@ static inline void omap_hsmmc_reset(void) {}static inline void omap2_mmc_mux (struct omap_mmc_platform_data *mmc_controller,int controller_nr) { +if ((mmc_controller->slots[0 ].switch_pin >0 ) && \ + (mmc_controller->slots[0 ].switch_pin <OMAP_MAX_GPIO_LINES )) +omap_mux_init_gpio (mmc_controller->slots[0 ].switch_pin, +OMAP_PIN_INPUT_PULLUP ); +if ((mmc_controller->slots[0 ].gpio_wp >0 ) && \ + (mmc_controller->slots[0 ].gpio_wp <OMAP_MAX_GPIO_LINES )) +omap_mux_init_gpio (mmc_controller->slots[0 ].gpio_wp, +OMAP_PIN_INPUT_PULLUP ); +if (cpu_is_omap2420 () && controller_nr ==0 ) {omap_cfg_reg (H18_24XX_MMC_CMD );omap_cfg_reg (H15_24XX_MMC_CLKI );
Tony Lindgren
maintainerPATCH 4/10 omap: hsmmc: fix the hsmmc driver for am3517
In reply to Tony LindgrenFrom: stanley.miao <[email protected]>
AM3517 don't have the register OMAP343X_CONTROL_PBIAS_LITE and the regulators like "vmmc", so we set a noop "set_power" function for it.
--- arch/arm/mach-omap2/hsmmc.c | 27 +++++++++++++++++++++------ arch/arm/plat-omap/include/plat/mmc.h | 4 ++++ 2 files changed, 25 insertions(+), 6 deletions(-)
arch/arm/mach-omap2/hsmmc.c +21 -6
@@ -139,6 +139,12 @@ static void hsmmc23_before_set_reg(struct device *dev, int slot, } } +static int nop_mmc_set_power (struct device *dev,int slot,int power_on, +int vdd) +{ +return 0 ; +} +static struct omap_mmc_platform_data *hsmmc_data[OMAP34XX_NR_MMC ]__initdata ;void __init omap2_hsmmc_init (struct omap2_hsmmc_info *controllers)
@@ -216,11 +222,18 @@ void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers)*/ mmc->slots[0 ].ocr_mask = c->ocr_mask; +if (cpu_is_omap3517 () ||cpu_is_omap3505 ()) + mmc->slots[0 ].set_power = nop_mmc_set_power; +else + mmc->slots[0 ].features |=HSMMC_HAS_PBIAS ; +switch (c->mmc) {case 1 : -/* on-chip level shifting via PBIAS0/PBIAS1 */ - mmc->slots[0 ].before_set_reg = hsmmc1_before_set_reg; - mmc->slots[0 ].after_set_reg = hsmmc1_after_set_reg; +if (mmc->slots[0 ].features &HSMMC_HAS_PBIAS ) { +/* on-chip level shifting via PBIAS0/PBIAS1 */ + mmc->slots[0 ].before_set_reg = hsmmc1_before_set_reg; + mmc->slots[0 ].after_set_reg = hsmmc1_after_set_reg; + }/* Omap3630 HSMMC1 supports only 4-bit */ if (cpu_is_omap3630 () && c->wires >4 ) {
@@ -235,9 +248,11 @@ void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers) c->wires =4 ;/* FALLTHROUGH */ case 3 : -/* off-chip level shifting, or none */ - mmc->slots[0 ].before_set_reg = hsmmc23_before_set_reg; - mmc->slots[0 ].after_set_reg =NULL ; +if (mmc->slots[0 ].features &HSMMC_HAS_PBIAS ) { +/* off-chip level shifting, or none */ + mmc->slots[0 ].before_set_reg = hsmmc23_before_set_reg; + mmc->slots[0 ].after_set_reg =NULL ; + }break ;default :pr_err ("MMC%d configuration not supported!\n" , c->mmc);
arch/arm/plat-omap/include/plat/mmc.h +4 -0
@@ -102,6 +102,10 @@ struct omap_mmc_platform_data {/* Regulator off remapped to sleep */ unsigned vcc_aux_disable_is_sleep:1; +/* we can put the features above into this variable */ +#define HSMMC_HAS_PBIAS (1 << 0) +unsigned features; +int switch_pin;/* gpio (card detect) */ int gpio_wp;/* gpio (write protect) */
Tony Lindgren
maintainerPATCH 5/10 OMAP4: SPI: Fix Driver Kconfig
In reply to Tony LindgrenFrom: Syed Rafiuddin <[email protected]>
Change dependency to ARCH_OMAP2PLUS to allow systems based on omap24xx, omap34xx or omap44xx
--- drivers/spi/Kconfig | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/spi/Kconfig +3 -3
@@ -180,10 +180,10 @@ config SPI_OMAP_UWIRE This hooks up to the MicroWire controller on OMAP1 chips. config SPI_OMAP24XX - tristate "McSPI driver for OMAP24xx/OMAP34xx" - depends on ARCH_OMAP2 || ARCH_OMAP3 + tristate "McSPI driver for OMAP" + depends on ARCH_OMAP2PLUS help - SPI master controller for OMAP24xx/OMAP34xx Multichannel SPI + SPI master controller for OMAP24XX and later Multichannel SPI (McSPI) modules. config SPI_OMAP_100K
Tony Lindgren
maintainerPATCH 6/10 OMAP4: Ethernet: KS8851 Board Support
In reply to Tony LindgrenFrom: Abraham Arce <[email protected]>
Enable Micrel KS8851 SPI network chip for OMAP4430
--- arch/arm/mach-omap2/board-4430sdp.c | 81 +++++++++++++++++++++++++++++++++++ 1 files changed, 81 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/board-4430sdp.c +81 -0
@@ -18,6 +18,7 @@#include <linux/io.h> #include <linux/gpio.h> #include <linux/usb/otg.h> +#include <linux/spi/spi.h> #include <mach/hardware.h> #include <asm/mach-types.h>
@@ -32,6 +33,75 @@#include <asm/hardware/gic.h> #include <asm/hardware/cache-l2x0.h> +#define ETH_KS8851_IRQ 34 +#define ETH_KS8851_POWER_ON 48 +#define ETH_KS8851_QUART 138 + +static struct spi_board_info sdp4430_spi_board_info[]__initdata = { + { + .modalias ="ks8851" , + .bus_num =1 , + .chip_select =0 , + .max_speed_hz =24000000 , + .irq =ETH_KS8851_IRQ , + }, +}; + +static int omap_ethernet_init (void ) +{ +int status; + +/* Request of GPIO lines */ + + status =gpio_request (ETH_KS8851_POWER_ON ,"eth_power" ); +if (status) { +pr_err ("Cannot request GPIO %d\n" ,ETH_KS8851_POWER_ON ); +return status; + } + + status =gpio_request (ETH_KS8851_QUART ,"quart" ); +if (status) { +pr_err ("Cannot request GPIO %d\n" ,ETH_KS8851_QUART ); + goto error1; + } + + status =gpio_request (ETH_KS8851_IRQ ,"eth_irq" ); +if (status) { +pr_err ("Cannot request GPIO %d\n" ,ETH_KS8851_IRQ ); + goto error2; + } + +/* Configuration of requested GPIO lines */ + + status =gpio_direction_output (ETH_KS8851_POWER_ON ,1 ); +if (status) { +pr_err ("Cannot set output GPIO %d\n" ,ETH_KS8851_IRQ ); + goto error3; + } + + status =gpio_direction_output (ETH_KS8851_QUART ,1 ); +if (status) { +pr_err ("Cannot set output GPIO %d\n" ,ETH_KS8851_QUART ); + goto error3; + } + + status =gpio_direction_input (ETH_KS8851_IRQ ); +if (status) { +pr_err ("Cannot set input GPIO %d\n" ,ETH_KS8851_IRQ ); + goto error3; + } + +return 0 ; + +error3: +gpio_free (ETH_KS8851_IRQ ); +error2: +gpio_free (ETH_KS8851_QUART ); +error1: +gpio_free (ETH_KS8851_POWER_ON ); +return status; +} +static struct platform_device sdp4430_lcd_device = { .name ="sdp4430_lcd" , .id =-1 ,
@@ -113,6 +183,8 @@ static struct omap_musb_board_data musb_board_data = {static void __init omap_4430sdp_init (void ) { +int status; +platform_add_devices (sdp4430_devices,ARRAY_SIZE (sdp4430_devices));omap_serial_init ();/* OMAP4 SDP uses internal transceiver so register nop transceiver */
@@ -120,6 +192,15 @@ static void __init omap_4430sdp_init(void)/* FIXME: allow multi-omap to boot until musb is updated for omap4 */ if (!cpu_is_omap44xx ())usb_musb_init (&musb_board_data); + + status =omap_ethernet_init (); +if (status) { +pr_err ("Ethernet initialization failed: %d\n" , status); + }else { + sdp4430_spi_board_info[0 ].irq =gpio_to_irq (ETH_KS8851_IRQ ); +spi_register_board_info (sdp4430_spi_board_info, +ARRAY_SIZE (sdp4430_spi_board_info)); + } }static void __init omap_4430sdp_map_io (void )
Tony Lindgren
maintainerPATCH 7/10 OMAP4: Networking: Defconfig Support
In reply to Tony LindgrenFrom: Abraham Arce <[email protected]>
Enable KS8851 SPI support +
Networking Support
- Packet Socket
- TCP/IP
Network Filesystems
- NFS Client
- Root Filesystem on NFS
--- arch/arm/configs/omap_4430sdp_defconfig | 57 ++++++++++++++++++++++++++++++- 1 files changed, 55 insertions(+), 2 deletions(-)
arch/arm/configs/omap_4430sdp_defconfig +55 -2
@@ -343,7 +343,34 @@ CONFIG_BINFMT_MISC=y # # CONFIG_PM is not set CONFIG_ARCH_SUSPEND_POSSIBLE=y -# CONFIG_NET is not set +CONFIG_NET=y + +# +# Networking options +# +CONFIG_PACKET=y +CONFIG_XFRM=y +CONFIG_INET=y +CONFIG_IP_FIB_HASH=y +CONFIG_IP_PNP=y +CONFIG_IP_PNP_DHCP=y +CONFIG_IP_PNP_BOOTP=y +CONFIG_IP_PNP_RARP=y +CONFIG_INET_XFRM_MODE_TRANSPORT=y +CONFIG_INET_XFRM_MODE_TUNNEL=y +CONFIG_INET_XFRM_MODE_BEET=y +CONFIG_INET_LRO=y +CONFIG_INET_DIAG=y +CONFIG_INET_TCP_DIAG=y +CONFIG_TCP_CONG_CUBIC=y +CONFIG_DEFAULT_TCP_CONG="cubic" +# CONFIG_IPV6 is not set + +# +# Network testing +# +# CONFIG_WIRELESS is not set + # # Device Drivers
@@ -386,6 +413,13 @@ CONFIG_HAVE_IDE=y # CONFIG_ATA is not set # CONFIG_MD is not set # CONFIG_PHONE is not set +CONFIG_NETDEVICES=y +CONFIG_NET_ETHERNET=y +CONFIG_MII=y +CONFIG_KS8851=y +# CONFIG_NETDEV_1000 is not set +# CONFIG_NETDEV_10000 is not set +# CONFIG_WLAN is not set # # Input device support
@@ -457,7 +491,13 @@ CONFIG_HW_RANDOM=y # CONFIG_RAW_DRIVER is not set # CONFIG_TCG_TPM is not set # CONFIG_I2C is not set -# CONFIG_SPI is not set +CONFIG_SPI=y +CONFIG_SPI_MASTER=y + +# +# SPI Master Controller Drivers +# +CONFIG_SPI_OMAP24XX=y # # PPS support
@@ -634,6 +674,19 @@ CONFIG_MISC_FILESYSTEMS=y # CONFIG_ROMFS_FS is not set # CONFIG_SYSV_FS is not set # CONFIG_UFS_FS is not set +CONFIG_NETWORK_FILESYSTEMS=y +CONFIG_NFS_FS=y +CONFIG_NFS_V3=y +CONFIG_NFS_V3_ACL=y +CONFIG_NFS_V4=y +CONFIG_ROOT_NFS=y +CONFIG_LOCKD=y +CONFIG_LOCKD_V4=y +CONFIG_NFS_ACL_SUPPORT=y +CONFIG_NFS_COMMON=y +CONFIG_SUNRPC=y +CONFIG_SUNRPC_GSS=y +CONFIG_RPCSEC_GSS_KRB5=y # # Partition Types
Tony Lindgren
maintainerPATCH 8/10 omap4: Move SOC specific code from board file
In reply to Tony LindgrenFrom: Santosh Shilimkar <[email protected]>
This patch moves OMAP4 soc specific code from 4430sdp board file. The change is necessary so that newer board support can be added with minimal changes. This will be also problematic for multi-board, multi-omap builds.
--- arch/arm/mach-omap2/Makefile | 2 - arch/arm/mach-omap2/board-4430sdp.c | 47 --------------- arch/arm/mach-omap2/include/mach/omap4-common.h | 26 ++++++++ arch/arm/mach-omap2/omap-smp.c | 2 - arch/arm/mach-omap2/omap4-common.c | 72 +++++++++++++++++++++++ arch/arm/plat-omap/common.c | 3 - arch/arm/plat-omap/include/plat/common.h | 3 - 7 files changed, 101 insertions(+), 54 deletions(-) create mode 100644 arch/arm/mach-omap2/include/mach/omap4-common.h create mode 100644 arch/arm/mach-omap2/omap4-common.c
arch/arm/mach-omap2/Makefile +1 -1
@@ -22,7 +22,7 @@ obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o # SMP support ONLY available for OMAP4 obj-$(CONFIG_SMP) += omap-smp.o omap-headsmp.o obj-$(CONFIG_LOCAL_TIMERS) += timer-mpu.o -obj-$(CONFIG_ARCH_OMAP4) += omap44xx-smc.o +obj-$(CONFIG_ARCH_OMAP4) += omap44xx-smc.o omap4-common.o AFLAGS_omap44xx-smc.o :=-Wa,-march=armv7-a
arch/arm/mach-omap2/board-4430sdp.c +1 -46
65 lines not on this page · raw message
arch/arm/mach-omap2/include/mach/omap4-common.h new file +26 -0
@@ -0,0 +1,26 @@ +/* +* omap4-common.h: OMAP4 specific common header file +* +* Copyright (C) 2010 Texas Instruments, Inc. +* +* Author: +* Santosh Shilimkar <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ +#ifndef OMAP_ARCH_OMAP4_COMMON_H +#define OMAP_ARCH_OMAP4_COMMON_H + +#ifdef CONFIG_CACHE_L2X0 +extern void __iomem *l2cache_base; +#endif + +extern void __iomem *gic_cpu_base_addr; +extern void __iomem *gic_dist_base_addr; + +extern void __init gic_init_irq (void ); +extern void omap_smc1 (u32 fn,u32 arg); + +#endif
arch/arm/mach-omap2/omap-smp.c +1 -1
@@ -24,7 +24,7 @@#include <asm/localtimer.h> #include <asm/smp_scu.h> #include <mach/hardware.h> -#include <plat/common.h> +#include <mach/omap4-common.h> /* SCU base address */ static void __iomem *scu_base;
arch/arm/mach-omap2/omap4-common.c new file +72 -0
72 lines not on this page · raw message
arch/arm/plat-omap/common.c +0 -3
@@ -47,9 +47,6 @@struct omap_board_config_kernel *omap_board_config;int omap_board_config_size; -/* used by omap-smp.c and board-4430sdp.c */ -void __iomem *gic_cpu_base_addr; -static const void *get_config (u16 tag,size_t len,int skip,size_t *len_out) {struct omap_board_config_kernel *kinfo =NULL ;
arch/arm/plat-omap/include/plat/common.h +0 -3
@@ -31,9 +31,6 @@struct sys_timer ; -/* used by omap-smp.c and board-4430sdp.c */ -extern void __iomem *gic_cpu_base_addr; -extern void omap_map_common_io (void );extern struct sys_timer omap_timer;
Tony Lindgren
maintainerPATCH 9/10 omap: GPIO: Fix OMAP4 GPIO reg access issues
In reply to Tony LindgrenFrom: Tony Lindgren <[email protected]>
Access to some of the OMAP4 GPIO registers are not properly handled. This patch fixes it.
This patch is tested on 3430SDP and 4430SDP boards
--- arch/arm/plat-omap/gpio.c | 59 ++++++++++++++++++++++++++++++++++++--------- 1 files changed, 47 insertions(+), 12 deletions(-)
arch/arm/plat-omap/gpio.c +47 -12
@@ -138,7 +138,11 @@#define OMAP4_GPIO_IRQSTATUSCLR1 0x0040#define OMAP4_GPIO_IRQWAKEN0 0x0044#define OMAP4_GPIO_IRQWAKEN1 0x0048 -#define OMAP4_GPIO_SYSSTATUS 0x0104 +#define OMAP4_GPIO_SYSSTATUS 0x0114 +#define OMAP4_GPIO_IRQENABLE1 0x011c +#define OMAP4_GPIO_WAKE_EN 0x0120 +#define OMAP4_GPIO_IRQSTATUS2 0x0128 +#define OMAP4_GPIO_IRQENABLE2 0x012c#define OMAP4_GPIO_CTRL 0x0130#define OMAP4_GPIO_OE 0x0134#define OMAP4_GPIO_DATAIN 0x0138
@@ -149,6 +153,10 @@#define OMAP4_GPIO_FALLINGDETECT 0x014c#define OMAP4_GPIO_DEBOUNCENABLE 0x0150#define OMAP4_GPIO_DEBOUNCINGTIME 0x0154 +#define OMAP4_GPIO_CLEARIRQENABLE1 0x0160 +#define OMAP4_GPIO_SETIRQENABLE1 0x0164 +#define OMAP4_GPIO_CLEARWKUENA 0x0180 +#define OMAP4_GPIO_SETWKUENA 0x0184#define OMAP4_GPIO_CLEARDATAOUT 0x0190#define OMAP4_GPIO_SETDATAOUT 0x0194/*
@@ -591,12 +599,16 @@ static int _get_gpio_dataout(struct gpio_bank *bank, int gpio) reg +=OMAP7XX_GPIO_DATA_OUTPUT ;break ;#endif -#ifdef CONFIG_ARCH_OMAP2PLUS +#if defined(CONFIG_ARCH_OMAP2 ) || defined(CONFIG_ARCH_OMAP3 )case METHOD_GPIO_24XX : -case METHOD_GPIO_44XX : reg +=OMAP24XX_GPIO_DATAOUT ;break ;#endif +#ifdef CONFIG_ARCH_OMAP4 +case METHOD_GPIO_44XX : + reg +=OMAP4_GPIO_DATAOUT ; +break ; +#endif default :return -EINVAL ; }
@@ -1213,11 +1225,17 @@ static int omap_gpio_request(struct gpio_chip *chip, unsigned offset)#endif if (!cpu_class_is_omap1 ()) {if (!bank->mod_usage) { +void __iomem *reg = bank->base;u32 ctrl; - ctrl =__raw_readl (bank->base +OMAP24XX_GPIO_CTRL ); - ctrl &=0xFFFFFFFE ; + +if (cpu_is_omap24xx () ||cpu_is_omap34xx ()) + reg +=OMAP24XX_GPIO_CTRL ; +else if (cpu_is_omap44xx ()) + reg +=OMAP4_GPIO_CTRL ; + ctrl =__raw_readl (reg);/* Module is enabled, clocks are not gated */ -__raw_writel (ctrl, bank->base +OMAP24XX_GPIO_CTRL ); + ctrl &=0xFFFFFFFE ; +__raw_writel (ctrl, reg); } bank->mod_usage |=1 << offset; }
@@ -1239,22 +1257,34 @@ static void omap_gpio_free(struct gpio_chip *chip, unsigned offset)__raw_writel (1 << offset, reg); }#endif -#ifdef CONFIG_ARCH_OMAP2PLUS -if ((bank->method ==METHOD_GPIO_24XX ) || - (bank->method ==METHOD_GPIO_44XX )) { +#if defined(CONFIG_ARCH_OMAP2 ) || defined(CONFIG_ARCH_OMAP3 ) +if (bank->method ==METHOD_GPIO_24XX ) {/* Disable wake-up during idle for dynamic tick */ void __iomem *reg = bank->base +OMAP24XX_GPIO_CLEARWKUENA ;__raw_writel (1 << offset, reg); }#endif +#ifdef CONFIG_ARCH_OMAP4 +if (bank->method ==METHOD_GPIO_44XX ) { +/* Disable wake-up during idle for dynamic tick */ +void __iomem *reg = bank->base +OMAP4_GPIO_IRQWAKEN0 ; +__raw_writel (1 << offset, reg); + } +#endif if (!cpu_class_is_omap1 ()) { bank->mod_usage &= ~(1 << offset);if (!bank->mod_usage) { +void __iomem *reg = bank->base;u32 ctrl; - ctrl =__raw_readl (bank->base +OMAP24XX_GPIO_CTRL ); + +if (cpu_is_omap24xx () ||cpu_is_omap34xx ()) + reg +=OMAP24XX_GPIO_CTRL ; +else if (cpu_is_omap44xx ()) + reg +=OMAP4_GPIO_CTRL ; + ctrl =__raw_readl (reg);/* Module is disabled, clocks are gated */ ctrl |=1 ; -__raw_writel (ctrl, bank->base +OMAP24XX_GPIO_CTRL ); +__raw_writel (ctrl, reg); } }_reset_gpio (bank, bank->chip.base + offset);
@@ -1583,9 +1613,14 @@ static int gpio_is_input(struct gpio_bank *bank, int mask) reg +=OMAP7XX_GPIO_DIR_CONTROL ;break ;case METHOD_GPIO_24XX : -case METHOD_GPIO_44XX : reg +=OMAP24XX_GPIO_OE ;break ; +case METHOD_GPIO_44XX : + reg +=OMAP4_GPIO_OE ; +break ; +default : +WARN_ONCE (1 ,"gpio_is_input: incorrect OMAP GPIO method" ); +return -EINVAL ; }return __raw_readl (reg) & mask; }
Tony Lindgren
maintainerPATCH 10/10 AM3517: rename the i2c boardinfo to make it more readable
In reply to Tony LindgrenFrom: stanley.miao <[email protected]>
There are three i2c buses on am3517, and each i2c bus has several devices on it, so we can't name the i2c boardinfo structures with one of these devices. In order to make it more readable, now rename these three boardinfo structures based on i2c indexes.
--- arch/arm/mach-omap2/board-am3517evm.c | 20 ++++++++++---------- 1 files changed, 10 insertions(+), 10 deletions(-)
arch/arm/mach-omap2/board-am3517evm.c +10 -10
@@ -136,7 +136,7 @@ void am3517_evm_ethernet_init(struct emac_platform_data *pdata)#define LCD_PANEL_BKLIGHT_PWR 182#define LCD_PANEL_PWM 181 -static struct i2c_board_info __initdata am3517evm_i2c_boardinfo[] = { +static struct i2c_board_info __initdata am3517evm_i2c1_boardinfo[] = { {I2C_BOARD_INFO ("s35390a" ,0x30 ), .type ="s35390a" ,
@@ -166,7 +166,7 @@ static void __init am3517_evm_rtc_init(void)gpio_free (GPIO_RTCS35390A_IRQ );return ; } - am3517evm_i2c_boardinfo[0 ].irq =gpio_to_irq (GPIO_RTCS35390A_IRQ ); + am3517evm_i2c1_boardinfo[0 ].irq =gpio_to_irq (GPIO_RTCS35390A_IRQ ); }/*
@@ -177,7 +177,7 @@ static void __init am3517_evm_rtc_init(void)static struct pca953x_platform_data am3517evm_gpio_expander_info_0 = { .gpio_base =OMAP_MAX_GPIO_LINES , }; -static struct i2c_board_info __initdata am3517evm_tca6416_info_0[] = { +static struct i2c_board_info __initdata am3517evm_i2c2_boardinfo[] = { {I2C_BOARD_INFO ("tca6416" ,0x21 ), .platform_data = &am3517evm_gpio_expander_info_0,
@@ -191,7 +191,7 @@ static struct pca953x_platform_data am3517evm_ui_gpio_expander_info_1 = {static struct pca953x_platform_data am3517evm_ui_gpio_expander_info_2 = { .gpio_base =OMAP_MAX_GPIO_LINES +32 , }; -static struct i2c_board_info __initdata am3517evm_ui_tca6416_info[] = { +static struct i2c_board_info __initdata am3517evm_i2c3_boardinfo[] = { {I2C_BOARD_INFO ("tca6416" ,0x20 ), .platform_data = &am3517evm_ui_gpio_expander_info_1,
@@ -205,10 +205,10 @@ static struct i2c_board_info __initdata am3517evm_ui_tca6416_info[] = {static int __init am3517_evm_i2c_init (void ) {omap_register_i2c_bus (1 ,400 ,NULL ,0 ); -omap_register_i2c_bus (2 ,400 , am3517evm_tca6416_info_0, -ARRAY_SIZE (am3517evm_tca6416_info_0)); -omap_register_i2c_bus (3 ,400 , am3517evm_ui_tca6416_info, -ARRAY_SIZE (am3517evm_ui_tca6416_info)); +omap_register_i2c_bus (2 ,400 , am3517evm_i2c2_boardinfo, +ARRAY_SIZE (am3517evm_i2c2_boardinfo)); +omap_register_i2c_bus (3 ,400 , am3517evm_i2c3_boardinfo, +ARRAY_SIZE (am3517evm_i2c3_boardinfo));return 0 ; }
@@ -455,8 +455,8 @@ static void __init am3517_evm_init(void)/* RTC - S35390A */ am3517_evm_rtc_init (); -i2c_register_board_info (1 , am3517evm_i2c_boardinfo, -ARRAY_SIZE (am3517evm_i2c_boardinfo)); +i2c_register_board_info (1 , am3517evm_i2c1_boardinfo, +ARRAY_SIZE (am3517evm_i2c1_boardinfo));/*Ethernet*/ am3517_evm_ethernet_init (&am3517_evm_emac_pdata); }