[PATCH 11/11] ARM: OMAP3: Clean up spurious interrupt check logic

2009-04-14 Thread Tony Lindgren
From: Roger Quadros 

SPURIOUSIRQ is contained in bits 31:7 of INTC_SIR, so
INTC_SIR must be right shifted by 7, not 6.

No change in logic, only changes for better readability.
Refer to register definition of INTCPS_SIR_IRQ in OMAP3 Manual.

Signed-off-by: Roger Quadros 
Signed-off-by: Tony Lindgren 
---
 arch/arm/mach-omap2/irq.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/irq.c b/arch/arm/mach-omap2/irq.c
index 9ba20d9..998c5c4 100644
--- a/arch/arm/mach-omap2/irq.c
+++ b/arch/arm/mach-omap2/irq.c
@@ -73,9 +73,9 @@ static int omap_check_spurious(unsigned int irq)
u32 sir, spurious;
 
sir = intc_bank_read_reg(&irq_banks[0], INTC_SIR);
-   spurious = sir >> 6;
+   spurious = sir >> 7;
 
-   if (spurious > 1) {
+   if (spurious) {
printk(KERN_WARNING "Spurious irq %i: 0x%08x, please flush "
"posted write for irq %i\n",
irq, sir, previous_irq);

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 10/11] ARM: OMAP3: Fixed spurious IRQ issue for GPIO interrupts

2009-04-14 Thread Tony Lindgren
From: Roger Quadros 

Flush posted write to IRQSTATUS register in GPIO IRQ handler.
This eliminates the below error for all peripherals that use GPIO interrupts.

<4>Spurious irq 95: 0xffdf, please flush posted write for irq 31

Signed-off-by: Roger Quadros 
Signed-off-by: Tony Lindgren 
---
 arch/arm/plat-omap/gpio.c |6 +-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index 210a1c0..17d7afe 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -758,8 +758,12 @@ static void _clear_gpio_irqbank(struct gpio_bank *bank, 
int gpio_mask)
 
/* Workaround for clearing DSP GPIO interrupts to allow retention */
 #if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX)
+   reg = bank->base + OMAP24XX_GPIO_IRQSTATUS2;
if (cpu_is_omap24xx() || cpu_is_omap34xx())
-   __raw_writel(gpio_mask, bank->base + OMAP24XX_GPIO_IRQSTATUS2);
+   __raw_writel(gpio_mask, reg);
+
+   /* Flush posted write for the irq status to avoid spurious interrupts */
+   __raw_readl(reg);
 #endif
 }
 

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 09/11] ARM: OMAP3: remove duplicated #include

2009-04-14 Thread Tony Lindgren
From: Huang Weiyi 

Removed duplicated #include in arch/arm/mach-omap2/board-rx51.c.

Signed-off-by: Huang Weiyi 
Signed-off-by: Tony Lindgren 
---
 arch/arm/mach-omap2/board-rx51.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c
index 3a0daac..374ff63 100644
--- a/arch/arm/mach-omap2/board-rx51.c
+++ b/arch/arm/mach-omap2/board-rx51.c
@@ -15,7 +15,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include 

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 08/11] ARM: OMAP2/3: GPIO: do not attempt to wake-enable

2009-04-14 Thread Tony Lindgren
From: Kevin Hilman 

The GPIO IRQ enable/disable path attempts to also enable IRQ wake
support for the parent GPIO bank IRQ as well.  However, since there is
no 'set_wake' hook for the bank IRQs, these calls will always fail.
Also, since the enable will fail on the suspend path, the disable on
the resume path will trigger unbalanced enable/disable warnings.

This was discovered in the suspend/resume path on OMAP3/Beagle using
the gpio-keys driver which disables/re-enables GPIO IRQ wakeups in the
suspend/resume path.

Signed-off-by: Kevin Hilman 
Signed-off-by: Tony Lindgren 
---
 arch/arm/plat-omap/gpio.c |   14 --
 1 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index d3fa41e..210a1c0 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -921,13 +921,10 @@ static int _set_gpio_wakeup(struct gpio_bank *bank, int 
gpio, int enable)
case METHOD_MPUIO:
case METHOD_GPIO_1610:
spin_lock_irqsave(&bank->lock, flags);
-   if (enable) {
+   if (enable)
bank->suspend_wakeup |= (1 << gpio);
-   enable_irq_wake(bank->irq);
-   } else {
-   disable_irq_wake(bank->irq);
+   else
bank->suspend_wakeup &= ~(1 << gpio);
-   }
spin_unlock_irqrestore(&bank->lock, flags);
return 0;
 #endif
@@ -940,13 +937,10 @@ static int _set_gpio_wakeup(struct gpio_bank *bank, int 
gpio, int enable)
return -EINVAL;
}
spin_lock_irqsave(&bank->lock, flags);
-   if (enable) {
+   if (enable)
bank->suspend_wakeup |= (1 << gpio);
-   enable_irq_wake(bank->irq);
-   } else {
-   disable_irq_wake(bank->irq);
+   else
bank->suspend_wakeup &= ~(1 << gpio);
-   }
spin_unlock_irqrestore(&bank->lock, flags);
return 0;
 #endif

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 07/11] ARM: OMAP2: possible division by 0

2009-04-14 Thread Tony Lindgren
From: Roel Kluin 

In linus' git tree the functions can be found at:
vi arch/arm/mach-omap2/usb-tusb6010.c +200  - tusb6010_platform_retime()
vi arch/arm/mach-omap2/gpmc.c +94   - gpmc_get_fclk_period()
vi arch/arm/mach-omap2/usb-tusb6010.c +53   - tusb_set_async_mode()
vi arch/arm/mach-omap2/usb-tusb6010.c +111  - tusb_set_sync_mode()

is -ENODEV appropriate when sysclk_ps == 0?

This was found by code analysis, please review.
-->8-8<-
gpmc_get_fclk_period() may return 0 when gpmc_l3_clk is not enabled. This is
not checked in tusb6010_platform_retime() nor in tusb_set_async_mode() it
seems. In tusb_set_sync_mode() this may result in a division by zero.

Signed-off-by: Roel Kluin 
Signed-off-by: Tony Lindgren 
---
 arch/arm/mach-omap2/usb-tusb6010.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/usb-tusb6010.c 
b/arch/arm/mach-omap2/usb-tusb6010.c
index 15e5090..8df55f4 100644
--- a/arch/arm/mach-omap2/usb-tusb6010.c
+++ b/arch/arm/mach-omap2/usb-tusb6010.c
@@ -187,7 +187,7 @@ int tusb6010_platform_retime(unsigned is_refclk)
unsignedsysclk_ps;
int status;
 
-   if (!refclk_psec)
+   if (!refclk_psec || sysclk_ps == 0)
return -ENODEV;
 
sysclk_ps = is_refclk ? refclk_psec : TUSB6010_OSCCLK_60;

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 06/11] ARM: OMAP2: Remove defines and resource init for OMAP24XX EAC

2009-04-14 Thread Tony Lindgren
From: Jarkko Nikula 

There is no anymore legacy driver for OMAP24XX Enhanced Audio Controller
in linux-omap and it was newer in mainline so cleanup these unneeded
defines and initialization code.

Signed-off-by: Jarkko Nikula 
Signed-off-by: Tony Lindgren 
---
 arch/arm/mach-omap2/devices.c |   33 ---
 arch/arm/plat-omap/include/mach/eac.h |  100 -
 2 files changed, 0 insertions(+), 133 deletions(-)
 delete mode 100644 arch/arm/plat-omap/include/mach/eac.h

diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index d6b4b2f..496983a 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -25,7 +25,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE)
@@ -366,38 +365,6 @@ static void omap_init_mcspi(void)
 static inline void omap_init_mcspi(void) {}
 #endif
 
-#ifdef CONFIG_SND_OMAP24XX_EAC
-
-#define OMAP2_EAC_BASE 0x4809
-
-static struct resource omap2_eac_resources[] = {
-   {
-   .start  = OMAP2_EAC_BASE,
-   .end= OMAP2_EAC_BASE + 0x109,
-   .flags  = IORESOURCE_MEM,
-   },
-};
-
-static struct platform_device omap2_eac_device = {
-   .name   = "omap24xx-eac",
-   .id = -1,
-   .num_resources  = ARRAY_SIZE(omap2_eac_resources),
-   .resource   = omap2_eac_resources,
-   .dev = {
-   .platform_data = NULL,
-   },
-};
-
-void omap_init_eac(struct eac_platform_data *pdata)
-{
-   omap2_eac_device.dev.platform_data = pdata;
-   platform_device_register(&omap2_eac_device);
-}
-
-#else
-void omap_init_eac(struct eac_platform_data *pdata) {}
-#endif
-
 #ifdef CONFIG_OMAP_SHA1_MD5
 static struct resource sha1_md5_resources[] = {
{
diff --git a/arch/arm/plat-omap/include/mach/eac.h 
b/arch/arm/plat-omap/include/mach/eac.h
deleted file mode 100644
index 9e62cf0..000
--- a/arch/arm/plat-omap/include/mach/eac.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * arch/arm/plat-omap/include/mach2/eac.h
- *
- * Defines for Enhanced Audio Controller
- *
- * Contact: Jarkko Nikula 
- *
- * Copyright (C) 2006 Nokia Corporation
- * Copyright (C) 2004 Texas Instruments, Inc.
- *
- * 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.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef __ASM_ARM_ARCH_OMAP2_EAC_H
-#define __ASM_ARM_ARCH_OMAP2_EAC_H
-
-#include 
-#include 
-#include 
-
-#include 
-
-/* master codec clock source */
-#define EAC_MCLK_EXT_MASK  0x100
-enum eac_mclk_src {
-   EAC_MCLK_INT_1129, /* internal 96 MHz / 8.5 = 11.29 Mhz */
-   EAC_MCLK_EXT_11289600 = EAC_MCLK_EXT_MASK,
-   EAC_MCLK_EXT_12288000,
-   EAC_MCLK_EXT_2x11289600,
-   EAC_MCLK_EXT_2x12288000,
-};
-
-/* codec port interface mode */
-enum eac_codec_mode {
-   EAC_CODEC_PCM,
-   EAC_CODEC_AC97,
-   EAC_CODEC_I2S_MASTER, /* codec port, I.e. EAC is the master */
-   EAC_CODEC_I2S_SLAVE,
-};
-
-/* configuration structure for I2S mode */
-struct eac_i2s_conf {
-   /* if enabled, then first data slot (left channel) is signaled as
-* positive level of frame sync EAC.AC_FS */
-   unsignedpolarity_changed_mode:1;
-   /* if enabled, then serial data starts one clock cycle after the
-* of EAC.AC_FS for first audio slot */
-   unsignedsync_delay_enable:1;
-};
-
-/* configuration structure for EAC codec port */
-struct eac_codec {
-   enum eac_mclk_src   mclk_src;
-
-   enum eac_codec_mode codec_mode;
-   union {
-   struct eac_i2s_conf i2s;
-   } codec_conf;
-
-   int default_rate; /* audio sampling rate */
-
-   int (* set_power)(void *private_data, int dac, int adc);
-   int (* register_controls)(void *private_data,
- struct snd_card *card);
-   const char  *short_name;
-
-   void*private_data;
-};
-
-/* structure for passing platform dependent data to the EAC driver */
-struct eac_platform_data {
-int(* init)(struct device *eac_dev);
-   void(* cleanup)(struct device *eac_dev);
-   /* these callbacks are used to configure & control external MCLK
-* source. NULL if not used */
-   i

[PATCH 05/11] ARM: OMAP1: Fix mmc_set_power GPIO usage

2009-04-14 Thread Tony Lindgren
From: Ladislav Michl 

Simple simplification...

Signed-off-by: Ladislav Michl 
Signed-off-by: Tony Lindgren 
---
 arch/arm/mach-omap1/board-h3-mmc.c   |6 +-
 arch/arm/mach-omap1/board-nokia770.c |6 +-
 2 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-omap1/board-h3-mmc.c 
b/arch/arm/mach-omap1/board-h3-mmc.c
index 0d8a3c1..5e8877c 100644
--- a/arch/arm/mach-omap1/board-h3-mmc.c
+++ b/arch/arm/mach-omap1/board-h3-mmc.c
@@ -26,11 +26,7 @@
 static int mmc_set_power(struct device *dev, int slot, int power_on,
int vdd)
 {
-   if (power_on)
-   gpio_direction_output(H3_TPS_GPIO_MMC_PWR_EN, 1);
-   else
-   gpio_direction_output(H3_TPS_GPIO_MMC_PWR_EN, 0);
-
+   gpio_set_value(H3_TPS_GPIO_MMC_PWR_EN, power_on);
return 0;
 }
 
diff --git a/arch/arm/mach-omap1/board-nokia770.c 
b/arch/arm/mach-omap1/board-nokia770.c
index 7bc7a3c..d1ed136 100644
--- a/arch/arm/mach-omap1/board-nokia770.c
+++ b/arch/arm/mach-omap1/board-nokia770.c
@@ -181,11 +181,7 @@ static struct omap_usb_config nokia770_usb_config 
__initdata = {
 static int nokia770_mmc_set_power(struct device *dev, int slot, int power_on,
int vdd)
 {
-   if (power_on)
-   gpio_set_value(NOKIA770_GPIO_MMC_POWER, 1);
-   else
-   gpio_set_value(NOKIA770_GPIO_MMC_POWER, 0);
-
+   gpio_set_value(NOKIA770_GPIO_MMC_POWER, power_on);
return 0;
 }
 

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 03/11] ARM: OMAP: MMC: Remove unused power_pin

2009-04-14 Thread Tony Lindgren
From: Ladislav Michl 

Remove unused power_pin

Signed-off-by: Ladislav Michl 
Signed-off-by: Tony Lindgren 
---
 arch/arm/plat-omap/include/mach/mmc.h |1 -
 drivers/mmc/host/omap.c   |2 --
 2 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/arch/arm/plat-omap/include/mach/mmc.h 
b/arch/arm/plat-omap/include/mach/mmc.h
index 4435bd4..81d5b36 100644
--- a/arch/arm/plat-omap/include/mach/mmc.h
+++ b/arch/arm/plat-omap/include/mach/mmc.h
@@ -79,7 +79,6 @@ struct omap_mmc_platform_data {
 
/* use the internal clock */
unsigned internal_clock:1;
-   s16 power_pin;
 
int switch_pin; /* gpio (card detect) */
int gpio_wp;/* gpio (write protect) */
diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c
index 5570849..bfa25c0 100644
--- a/drivers/mmc/host/omap.c
+++ b/drivers/mmc/host/omap.c
@@ -157,8 +157,6 @@ struct mmc_omap_host {
struct timer_list   dma_timer;
unsigneddma_len;
 
-   short   power_pin;
-
struct mmc_omap_slot*slots[OMAP_MMC_MAX_SLOTS];
struct mmc_omap_slot*current_slot;
spinlock_t  slot_lock;

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 04/11] ARM: OMAP1: Simplify board-h2 MMC setup

2009-04-14 Thread Tony Lindgren
From: Ladislav Michl 

Simplify board-h2 MMC setup

Signed-off-by: Ladislav Michl 
Signed-off-by: Tony Lindgren 
---
 arch/arm/mach-omap1/board-h2-mmc.c |   14 --
 1 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-omap1/board-h2-mmc.c 
b/arch/arm/mach-omap1/board-h2-mmc.c
index 44d4a96..46098f5 100644
--- a/arch/arm/mach-omap1/board-h2-mmc.c
+++ b/arch/arm/mach-omap1/board-h2-mmc.c
@@ -26,19 +26,13 @@
 static int mmc_set_power(struct device *dev, int slot, int power_on,
int vdd)
 {
-   if (power_on)
-   gpio_direction_output(H2_TPS_GPIO_MMC_PWR_EN, 1);
-   else
-   gpio_direction_output(H2_TPS_GPIO_MMC_PWR_EN, 0);
-
+   gpio_set_value(H2_TPS_GPIO_MMC_PWR_EN, power_on);
return 0;
 }
 
 static int mmc_late_init(struct device *dev)
 {
-   int ret;
-
-   ret = gpio_request(H2_TPS_GPIO_MMC_PWR_EN, "MMC power");
+   int ret = gpio_request(H2_TPS_GPIO_MMC_PWR_EN, "MMC power");
if (ret < 0)
return ret;
 
@@ -47,7 +41,7 @@ static int mmc_late_init(struct device *dev)
return ret;
 }
 
-static void mmc_shutdown(struct device *dev)
+static void mmc_cleanup(struct device *dev)
 {
gpio_free(H2_TPS_GPIO_MMC_PWR_EN);
 }
@@ -60,7 +54,7 @@ static void mmc_shutdown(struct device *dev)
 static struct omap_mmc_platform_data mmc1_data = {
.nr_slots   = 1,
.init   = mmc_late_init,
-   .shutdown   = mmc_shutdown,
+   .cleanup= mmc_cleanup,
.dma_mask   = 0x,
.slots[0]   = {
.set_power  = mmc_set_power,

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 02/11] ARM: OMAP: Remove old dead gpio expander code

2009-04-14 Thread Tony Lindgren
This should be done with GPIO calls. Patches against the
mainline tree welcome to add the necessary working functionality
back.

Signed-off-by: Tony Lindgren 
---
 arch/arm/mach-omap1/board-h3.c |  101 
 arch/arm/mach-omap2/board-h4.c |   95 ---
 arch/arm/plat-omap/include/mach/gpioexpander.h |   35 
 arch/arm/plat-omap/include/mach/irda.h |4 -
 4 files changed, 0 insertions(+), 235 deletions(-)
 delete mode 100644 arch/arm/plat-omap/include/mach/gpioexpander.h

diff --git a/arch/arm/mach-omap1/board-h3.c b/arch/arm/mach-omap1/board-h3.c
index 4695965..f597968 100644
--- a/arch/arm/mach-omap1/board-h3.c
+++ b/arch/arm/mach-omap1/board-h3.c
@@ -39,12 +39,10 @@
 #include 
 #include 
 
-#include 
 #include 
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -276,104 +274,6 @@ static struct platform_device h3_kp_device = {
.resource   = h3_kp_resources,
 };
 
-
-/* Select between the IrDA and aGPS module
- */
-static int h3_select_irda(struct device *dev, int state)
-{
-   unsigned char expa;
-   int err = 0;
-
-   if ((err = read_gpio_expa(&expa, 0x26))) {
-   printk(KERN_ERR "Error reading from I/O EXPANDER \n");
-   return err;
-   }
-
-   /* 'P6' enable/disable IRDA_TX and IRDA_RX */
-   if (state & IR_SEL) { /* IrDA */
-   if ((err = write_gpio_expa(expa | 0x40, 0x26))) {
-   printk(KERN_ERR "Error writing to I/O EXPANDER \n");
-   return err;
-   }
-   } else {
-   if ((err = write_gpio_expa(expa & ~0x40, 0x26))) {
-   printk(KERN_ERR "Error writing to I/O EXPANDER \n");
-   return err;
-   }
-   }
-   return err;
-}
-
-static void set_trans_mode(struct work_struct *work)
-{
-   struct omap_irda_config *irda_config =
-   container_of(work, struct omap_irda_config, gpio_expa.work);
-   int mode = irda_config->mode;
-   unsigned char expa;
-   int err = 0;
-
-   if ((err = read_gpio_expa(&expa, 0x27)) != 0) {
-   printk(KERN_ERR "Error reading from I/O expander\n");
-   }
-
-   expa &= ~0x03;
-
-   if (mode & IR_SIRMODE) {
-   expa |= 0x01;
-   } else { /* MIR/FIR */
-   expa |= 0x03;
-   }
-
-   if ((err = write_gpio_expa(expa, 0x27)) != 0) {
-   printk(KERN_ERR "Error writing to I/O expander\n");
-   }
-}
-
-static int h3_transceiver_mode(struct device *dev, int mode)
-{
-   struct omap_irda_config *irda_config = dev->platform_data;
-
-   irda_config->mode = mode;
-   cancel_delayed_work(&irda_config->gpio_expa);
-   PREPARE_DELAYED_WORK(&irda_config->gpio_expa, set_trans_mode);
-   schedule_delayed_work(&irda_config->gpio_expa, 0);
-
-   return 0;
-}
-
-static struct omap_irda_config h3_irda_data = {
-   .transceiver_cap= IR_SIRMODE | IR_MIRMODE | IR_FIRMODE,
-   .transceiver_mode   = h3_transceiver_mode,
-   .select_irda= h3_select_irda,
-   .rx_channel = OMAP_DMA_UART3_RX,
-   .tx_channel = OMAP_DMA_UART3_TX,
-   .dest_start = UART3_THR,
-   .src_start  = UART3_RHR,
-   .tx_trigger = 0,
-   .rx_trigger = 0,
-};
-
-static struct resource h3_irda_resources[] = {
-   [0] = {
-   .start  = INT_UART3,
-   .end= INT_UART3,
-   .flags  = IORESOURCE_IRQ,
-   },
-};
-
-static u64 irda_dmamask = 0x;
-
-static struct platform_device h3_irda_device = {
-   .name   = "omapirda",
-   .id = 0,
-   .dev= {
-   .platform_data  = &h3_irda_data,
-   .dma_mask   = &irda_dmamask,
-   },
-   .num_resources  = ARRAY_SIZE(h3_irda_resources),
-   .resource   = h3_irda_resources,
-};
-
 static struct platform_device h3_lcd_device = {
.name   = "lcd_h3",
.id = -1,
@@ -395,7 +295,6 @@ static struct platform_device *devices[] __initdata = {
&nand_device,
 &smc91x_device,
&intlat_device,
-   &h3_irda_device,
&h3_kp_device,
&h3_lcd_device,
 };
diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c
index a0267a9..e7d017c 100644
--- a/arch/arm/mach-omap2/board-h4.c
+++ b/arch/arm/mach-omap2/board-h4.c
@@ -33,10 +33,8 @@
 
 #include 
 #include 
-#include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -138,98 +136,6 @@ static struct platform_device h4_flash_device = {
.resource   = &h4_flash_resource,
 };
 
-/* Select between the IrDA and aGPS module
- */
-static int h4_select_irda(struct device *dev, int state)
-{
-   unsigned char expa;
-   int err = 0;
-
-   if ((err 

[PATCH 01/11] ARM: OMAP: Fix for possible race condition in omap_free_dma()

2009-04-14 Thread Tony Lindgren
From: Santosh Shilimkar 

Fix the possible race condition in omap_free_dma(). Function omap_free_dma()
sets the dev_id = -1 and then accesses the channel afterwards to clear it.
But setting the dev_id=-1 makes the channel available for allocation again.
So it is possible someone else can grab it and results are unpredictable.
To avod this DMA channle is cleared first and then the dev_id = -1 is set.

Thanks to McNeil, Sean  for ointing out this issue.

Signed-off-by: Santosh Shilimkar 
Signed-off-by: Tony Lindgren 
---
 arch/arm/plat-omap/dma.c |   13 ++---
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
index 21cc014..7fc8c04 100644
--- a/arch/arm/plat-omap/dma.c
+++ b/arch/arm/plat-omap/dma.c
@@ -760,19 +760,12 @@ void omap_free_dma(int lch)
 {
unsigned long flags;
 
-   spin_lock_irqsave(&dma_chan_lock, flags);
if (dma_chan[lch].dev_id == -1) {
pr_err("omap_dma: trying to free unallocated DMA channel %d\n",
   lch);
-   spin_unlock_irqrestore(&dma_chan_lock, flags);
return;
}
 
-   dma_chan[lch].dev_id = -1;
-   dma_chan[lch].next_lch = -1;
-   dma_chan[lch].callback = NULL;
-   spin_unlock_irqrestore(&dma_chan_lock, flags);
-
if (cpu_class_is_omap1()) {
/* Disable all DMA interrupts for the channel. */
dma_write(0, CICR(lch));
@@ -798,6 +791,12 @@ void omap_free_dma(int lch)
dma_write(0, CCR(lch));
omap_clear_dma(lch);
}
+
+   spin_lock_irqsave(&dma_chan_lock, flags);
+   dma_chan[lch].dev_id = -1;
+   dma_chan[lch].next_lch = -1;
+   dma_chan[lch].callback = NULL;
+   spin_unlock_irqrestore(&dma_chan_lock, flags);
 }
 EXPORT_SYMBOL(omap_free_dma);
 

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 00/11] Omap fixes for 2.6.30-rc1

2009-04-14 Thread Tony Lindgren
Hi all,

Here are some omap fixes for review.

Regards,

Tony

---

Huang Weiyi (1):
  ARM: OMAP3: remove duplicated #include

Jarkko Nikula (1):
  ARM: OMAP2: Remove defines and resource init for OMAP24XX EAC

Kevin Hilman (1):
  ARM: OMAP2/3: GPIO: do not attempt to wake-enable

Ladislav Michl (3):
  ARM: OMAP1: Fix mmc_set_power GPIO usage
  ARM: OMAP1: Simplify board-h2 MMC setup
  ARM: OMAP: MMC: Remove unused power_pin

Roel Kluin (1):
  ARM: OMAP2: possible division by 0

Roger Quadros (2):
  ARM: OMAP3: Clean up spurious interrupt check logic
  ARM: OMAP3: Fixed spurious IRQ issue for GPIO interrupts

Santosh Shilimkar (1):
  ARM: OMAP: Fix for possible race condition in omap_free_dma()

Tony Lindgren (1):
  ARM: OMAP: Remove old dead gpio expander code


 arch/arm/mach-omap1/board-h2-mmc.c |   14 +--
 arch/arm/mach-omap1/board-h3-mmc.c |6 -
 arch/arm/mach-omap1/board-h3.c |  101 
 arch/arm/mach-omap1/board-nokia770.c   |6 -
 arch/arm/mach-omap2/board-h4.c |   95 ---
 arch/arm/mach-omap2/board-rx51.c   |1 
 arch/arm/mach-omap2/devices.c  |   33 
 arch/arm/mach-omap2/irq.c  |4 -
 arch/arm/mach-omap2/usb-tusb6010.c |2 
 arch/arm/plat-omap/dma.c   |   13 +--
 arch/arm/plat-omap/gpio.c  |   20 ++---
 arch/arm/plat-omap/include/mach/eac.h  |  100 
 arch/arm/plat-omap/include/mach/gpioexpander.h |   35 
 arch/arm/plat-omap/include/mach/irda.h |4 -
 arch/arm/plat-omap/include/mach/mmc.h  |1 
 drivers/mmc/host/omap.c|2 
 16 files changed, 24 insertions(+), 413 deletions(-)
 delete mode 100644 arch/arm/plat-omap/include/mach/eac.h
 delete mode 100644 arch/arm/plat-omap/include/mach/gpioexpander.h

-- 
Signature
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 7/7] OMAP2/3 GPTIMER: allow system tick GPTIMER to be changed in board-*.c files

2009-04-14 Thread Tony Lindgren
* Paul Walmsley  [090414 11:27]:
> Add a function omap2_gp_clockevent_set_gptimer() for board-*.c files
> to use in .init_irq functions to configure the system tick GPTIMER.
> Practical choices at this point are GPTIMER1 or GPTIMER12.  Both of
> these timers are in the WKUP powerdomain, and so are unaffected by
> chip power management.  GPTIMER1 can use sys_clk as a source, for
> applications where a high-resolution timer is more important than
> power management.  GPTIMER12 has the special property that it has the
> secure 32kHz oscillator as its source clock, which may be less prone
> to glitches than the off-chip 32kHz oscillator.  But on HS devices, it
> may not be available for Linux use.
> 
> It appears that most boards are fine with GPTIMER1, but BeagleBoard
> should use GPTIMER12 when using a 32KiHz timer source, due to hardware bugs
> in revisions B4 and below.  Modify board-omap3beagle.c to use GPTIMER12.
> 
> This patch originally used a Kbuild config option to select the GPTIMER,
> but was changed to allow this to be specified in board-*.c files, per
> Tony's request.
> 
> Tested on Beagle rev B4 ES2.1, with and without CONFIG_OMAP_32K_TIMER, and
> 3430SDP.

Although this adds new code, it would be nice to merge this during the
-rc cycle as it fixes an issue on quite a few boards out there.

Without this fix a large number of Beagle boards will eventually hang with
no timer interrupts happening.

Tony

 
> Signed-off-by: Paul Walmsley 
> Signed-off-by: Tony Lindgren 
> ---
>  arch/arm/mach-omap2/board-omap3beagle.c|4 ++
>  arch/arm/mach-omap2/clock24xx.c|1 +
>  arch/arm/mach-omap2/clock24xx.h|   10 +-
>  arch/arm/mach-omap2/clock34xx.h|1 -
>  arch/arm/mach-omap2/timer-gp.c |   48 
> ++--
>  arch/arm/plat-omap/dmtimer.c   |   20 
>  arch/arm/plat-omap/include/mach/dmtimer.h  |2 +
>  arch/arm/plat-omap/include/mach/timer-gp.h |   17 ++
>  8 files changed, 91 insertions(+), 12 deletions(-)
>  create mode 100644 arch/arm/plat-omap/include/mach/timer-gp.h
> 
> diff --git a/arch/arm/mach-omap2/board-omap3beagle.c 
> b/arch/arm/mach-omap2/board-omap3beagle.c
> index 744740a..3a7a29d 100644
> --- a/arch/arm/mach-omap2/board-omap3beagle.c
> +++ b/arch/arm/mach-omap2/board-omap3beagle.c
> @@ -42,6 +42,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  
>  #include "mmc-twl4030.h"
>  
> @@ -186,6 +187,9 @@ static void __init omap3_beagle_init_irq(void)
>  {
>   omap2_init_common_hw(NULL);
>   omap_init_irq();
> +#ifdef CONFIG_OMAP_32K_TIMER
> + omap2_gp_clockevent_set_gptimer(12);
> +#endif
>   omap_gpio_init();
>  }
>  
> diff --git a/arch/arm/mach-omap2/clock24xx.c b/arch/arm/mach-omap2/clock24xx.c
> index 4306392..fa2bd09 100644
> --- a/arch/arm/mach-omap2/clock24xx.c
> +++ b/arch/arm/mach-omap2/clock24xx.c
> @@ -66,6 +66,7 @@ struct omap_clk {
>  static struct omap_clk omap24xx_clks[] = {
>   /* external root sources */
>   CLK(NULL,   "func_32k_ck",  &func_32k_ck,   CK_243X | CK_242X),
> + CLK(NULL,   "secure_32k_ck", &secure_32k_ck, CK_243X | CK_242X),
>   CLK(NULL,   "osc_ck",   &osc_ck,CK_243X | CK_242X),
>   CLK(NULL,   "sys_ck",   &sys_ck,CK_243X | CK_242X),
>   CLK(NULL,   "alt_ck",   &alt_ck,CK_243X | CK_242X),
> diff --git a/arch/arm/mach-omap2/clock24xx.h b/arch/arm/mach-omap2/clock24xx.h
> index 33c3e5b..72003f7 100644
> --- a/arch/arm/mach-omap2/clock24xx.h
> +++ b/arch/arm/mach-omap2/clock24xx.h
> @@ -625,6 +625,14 @@ static struct clk func_32k_ck = {
>   .clkdm_name = "wkup_clkdm",
>  };
>  
> +static struct clk secure_32k_fck = {
> + .name   = "secure_32k_fck",
> + .ops= &clkops_null,
> + .rate   = 32768,
> + .flags  = RATE_FIXED,
> + .clkdm_name = "wkup_clkdm",
> +};
> +
>  /* Typical 12/13MHz in standalone mode, will be 26Mhz in chassis mode */
>  static struct clk osc_ck = { /* (*12, *13, 19.2, *26, 38.4)MHz */
>   .name   = "osc_ck",
> @@ -1790,7 +1798,7 @@ static struct clk gpt12_ick = {
>  static struct clk gpt12_fck = {
>   .name   = "gpt12_fck",
>   .ops= &clkops_omap2_dflt_wait,
> - .parent = &func_32k_ck,
> + .parent = &secure_32k_ck,
>   .clkdm_name = "core_l4_clkdm",
>   .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
>   .enable_bit = OMAP24XX_EN_GPT12_SHIFT,
> diff --git a/arch/arm/mach-omap2/clock34xx.h b/arch/arm/mach-omap2/clock34xx.h
> index f009017..6763b8f 100644
> --- a/arch/arm/mach-omap2/clock34xx.h
> +++ b/arch/arm/mach-omap2/clock34xx.h
> @@ -2901,7 +2901,6 @@ static struct clk sr_l4_ick = {
>  
>  /* SECURE_32K_FCK clocks */
>  
> -/* XXX This clock no longer exists in 3430 TRM rev F */
>  static struct clk gpt12_fck = {
>   .name   = "gpt12_fck",
>  

RE: 2.6.29 and SDP3430

2009-04-14 Thread Woodruff, Richard

> -Original Message-
> From: Pandita, Vikram
> Sent: Tuesday, April 14, 2009 3:08 PM
> To: Menon, Nishanth; Woodruff, Richard; Jarkko Nikula
> Cc: linux-omap
> Subject: RE: 2.6.29 and SDP3430
> I am also seeing a hang at following bootup time:
>
> console [ttyS2] enabled
> <6>brd: module loaded
> brd: module loaded
> <6>loop: module loaded
> loop: module loaded
> <6>i2c /dev entries driver
> i2c /dev entries driver
> ...


I looked really briefly on image with emulator.

It was in a big loop which fairly often was going into I2C.  Normal timer 
interrupts were firing.  Just the boot was not progressing.  It seems fixing is 
just time and debug.

Regards,
Richard W.


--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: 2.6.29 and SDP3430

2009-04-14 Thread Pandita, Vikram

>-Original Message-
>From: linux-omap-ow...@vger.kernel.org 
>[mailto:linux-omap-ow...@vger.kernel.org] On Behalf Of Menon,
>Nishanth
>Using the following:
>arm-none-linux-gnueabi-gcc (Sourcery G++ Lite 2008q3-72) 4.3.2
>
>I am past the lockup on calibration, but it now gets stuck as follows:
>NET: Registered protocol family 15
>RPC: Registered udp transport module.
>RPC: Registered tcp transport module.
>Disabling unused clock "gpt2_ick"
>Disabling unused clock "gpt2_fck"
>Disabling unused clock "wdt2_ick"
>Disabling unused clock "wdt2_fck"
>Disabling unused clock "dpll4_m6x2_ck"
>Disabling unused clock "dpll4_m5x2_ck"
>Disabling unused clock "dpll3_m3x2_ck"
>Disabling unused clock "sys_clkout1"
>variant c rev 1
>implementor 41 architecture 3 part 30 variant c rev 1
>regulator_init_complete: incomplete constraints, leaving VAUX3 on
>

On master of Linux-Omap: 2.6.30-rc1
Board: LDP(3430)
Toolchain version: arm-none-linux-gnueabi-gcc (Sourcery G++ Lite 2008q3-72) 
4.3.2

I am also seeing a hang at following bootup time:

console [ttyS2] enabled
<6>brd: module loaded
brd: module loaded
<6>loop: module loaded
loop: module loaded
<6>i2c /dev entries driver
i2c /dev entries driver
...

And after a long time I see constant Crash dumps as follows

Mem-info:
Mem-info:
Normal per-cpu:
Normal per-cpu:
CPU0: hi:   42, btch:   7 usd:   6
CPU0: hi:   42, btch:   7 usd:   6
Active_anon:0 active_file:0 inactive_anon:0
 inactive_file:0 unevictable:0 dirty:0 writeback:0 unstable:0
 free:133 slab:31174 mapped:0 pagetables:0 bounce:0
Active_anon:0 active_file:0 inactive_anon:0
 inactive_file:0 unevictable:0 dirty:0 writeback:0 unstable:0
 free:133 slab:31174 mapped:0 pagetables:0 bounce:0
Normal free:532kB min:1440kB low:1800kB high:2160kB active_anon:0kB inactive_ano
n:0kB active_file:0kB inactive_file:0kB unevictable:0kB present:130048kB pages_s
canned:0 all_unreclaimable? no
Normal free:532kB min:1440kB low:1800kB high:2160kB active_anon:0kB inactive_ano
n:0kB active_file:0kB inactive_file:0kB unevictable:0kB present:130048kB pages_s
canned:0 all_unreclaimable? no
lowmem_reserve[]:lowmem_reserve[]: 0 0 0 0

Normal: Normal: 1*4kB 1*4kB 0*8kB 0*8kB 1*16kB 1*16kB 0*32kB 0*32kB 0*64kB 0*64k
B 0*128kB 0*128kB 0*256kB 0*256kB 1*512kB 1*512kB 0*1024kB 0*1024kB 0*2048kB 0*2
048kB 0*4096kB 0*4096kB = 532kB
= 532kB
0 total pagecache pages
0 total pagecache pages
0 pages in swap cache
0 pages in swap cache
Swap cache stats: add 0, delete 0, find 0/0
Swap cache stats: add 0, delete 0, find 0/0
Free swap  = 0kB
Free swap  = 0kB
Total swap = 0kB
Total swap = 0kB
32768 pages of RAM
32768 pages of RAM
164 free pages
164 free pages
1371 reserved pages
1371 reserved pages
31174 slab pages
31174 slab pages
0 pages shared
0 pages shared
0 pages swap cached
0 pages swap cached
<4>swapper: page allocation failure. order:0, mode:0x20
swapper: page allocation failure. order:0, mode:0x20
[] [] (unwind_backtrace+0x0/0xdc) (unwind_backtrace+0x0/0xdc
) from [] from [] (__alloc_pages_internal+0x384/0x3a4)
(__alloc_pages_internal+0x384/0x3a4)
[] [] (__alloc_pages_internal+0x384/0x3a4) (__alloc_pages_in
ternal+0x384/0x3a4) from [] from [] (cache_alloc_refill+0x24
0/0x4bc)
(cache_alloc_refill+0x240/0x4bc)
[] [] (cache_alloc_refill+0x240/0x4bc) (cache_alloc_refill+0
x240/0x4bc) from [] from [] (kmem_cache_alloc+0x44/0x7c)
(kmem_cache_alloc+0x44/0x7c)
[] [] (kmem_cache_alloc+0x44/0x7c) (kmem_cache_alloc+0x44/0x
7c) from [] from [] (call_usermodehelper_setup+0x20/0x70)
(call_usermodehelper_setup+0x20/0x70)
[] [] (call_usermodehelper_setup+0x20/0x70) (call_usermodehe
lper_setup+0x20/0x70) from [] from [] (kobject_uevent_env+0x
30c/0x388)
(kobject_uevent_env+0x30c/0x388)
[] [] (kobject_uevent_env+0x30c/0x388) (kobject_uevent_env+0
x30c/0x388) from [] from [] (device_add+0x4f4/0x540)
(device_add+0x4f4/0x540)
[] [] (device_add+0x4f4/0x540) (device_add+0x4f4/0x540) from
 [] from [] (device_create_vargs+0x74/0xa4)
(device_create_vargs+0x74/0xa4)
[] [] (device_create_vargs+0x74/0xa4) (device_create_vargs+0
x74/0xa4) from [] from [] (device_create+0x1c/0x24)
(device_create+0x1c/0x24)
[] [] (device_create+0x1c/0x24) (device_create+0x1c/0x24) fr
om [] from [] (i2cdev_attach_adapter+0x94/0xe8)
(i2cdev_attach_adapter+0x94/0xe8)
[] [] (i2cdev_attach_adapter+0x94/0xe8) (i2cdev_attach_adapt
er+0x94/0xe8) from [] from [] (__attach_adapter+0x28/0x30)
(__attach_adapter+0x28/0x30)
[] [] (__attach_adapter+0x28/0x30) (__attach_adapter+0x28/0x
30) from [] from [] (class_for_each_device+0x6c/0xac)
(class_for_each_device+0x6c/0xac)
[] [] (class_for_each_device+0x6c/0xac) (class_for_each_devi
ce+0x6c/0xac) from [] from [] (i2c_register_driver+0xd0/0xf0
)
(i2c_register_driver+0xd0/0xf0)
[] [] (i2c_register_driver+0xd0/0xf0) (i2c_register_driver+0
xd0/0xf0) from [] from [] (i2c_dev_init+0x50/0xa0)
(i2c_dev_init+0x50/0xa0)
[] [] (i2c_dev_init+0x50/0xa0) (i2c_dev_init+0x50/0xa0) from
 [] from [] (do_one_initcall+0x54/0x194)
(do_one_initcall+0x54/0x194)
[] [] (do_one_i

Re: [PATCH 1/7] OMAP24xx/25xx clock: init osc_ck, sys_ck internal lists early

2009-04-14 Thread Russell King - ARM Linux
On Tue, Apr 14, 2009 at 12:31:47PM -0600, Paul Walmsley wrote:
> Modifying subject line since lists.arm.linux.org.uk mail server bounces 
> subjects containing "xxx".

And quite rightly too.
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/7] OMAP24xx/25xx clock: init osc_ck, sys_ck internal lists early

2009-04-14 Thread Paul Walmsley

Modifying subject line since lists.arm.linux.org.uk mail server bounces 
subjects containing "xxx".

- Paul

On Tue, 14 Apr 2009, Paul Walmsley wrote:

> Commit 3f0a820c4c0b4670fb5f164baa5582e23c2ef118 breaks OMAP2xxx boot
> during initial propagate_rate() on osc_ck and sys_ck.  Fix by calling
> clk_init_one() for these clocks first.
> 
> Resolves
> 
> <1>Unable to handle kernel NULL pointer dereference at virtual address 
> 
> <1>pgd = c0004000
> <1>[] *pgd=
> Internal error: Oops: 5 [#1]
> Modules linked in:
> CPU: 0Not tainted  (2.6.29-omap1 #37)
> PC is at propagate_rate+0x10/0x60
> LR is at omap2_clk_init+0x30/0x218
> ...
> 
> Signed-off-by: Paul Walmsley 
> Tested-by: Jarkko Nikula 
> Cc: Russell King 
> ---
>  arch/arm/mach-omap2/clock24xx.c |2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/clock24xx.c b/arch/arm/mach-omap2/clock24xx.c
> index 1e839c5..3b7ecc6 100644
> --- a/arch/arm/mach-omap2/clock24xx.c
> +++ b/arch/arm/mach-omap2/clock24xx.c
> @@ -720,6 +720,8 @@ int __init omap2_clk_init(void)
>  
>   clk_init(&omap2_clk_functions);
>  
> + clk_init_one(&osc_ck);
> + clk_init_one(&sys_ck);
>   osc_ck.rate = omap2_osc_clk_recalc(&osc_ck);
>   propagate_rate(&osc_ck);
>   sys_ck.rate = omap2_sys_clk_recalc(&sys_ck);
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/7] OMAP24xx/OMAP25xx clock: fix broken cpu_mask code

2009-04-14 Thread Paul Walmsley

Modifying subject line since lists.arm.linux.org.uk mail server bounces
subjects containing "xxx".

- Paul

On Tue, 14 Apr 2009, Paul Walmsley wrote:

> Commit 8ad8ff6548f1c0bcbeaa02f274b3927c5015a921 breaks the OMAP2xxx
> cpu_mask code, which causes OMAP2xxx to panic on boot.  Fix by
> removing the cpu_mask auto variable and by changing CK_242X
> and CK_243X to use RATE_IN_242X/RATE_IN_243X.
> 
> Resolves
> 
> <1>Unable to handle kernel NULL pointer dereference at virtual address 
> 000c
> <1>pgd = c0004000
> <1>[000c] *pgd=
> Internal error: Oops: 5 [#1]
> Modules linked in:
> CPU: 0Not tainted  (2.6.29-omap1 #32)
> PC is at omap2_clk_set_parent+0x104/0x120
> LR is at omap2_clk_set_parent+0x28/0x120
> 
> Signed-off-by: Paul Walmsley 
> Tested-by: Jarkko Nikula 
> Cc: Russell King 
> ---
>  arch/arm/mach-omap2/clock24xx.c |   12 +++-
>  1 files changed, 3 insertions(+), 9 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/clock24xx.c b/arch/arm/mach-omap2/clock24xx.c
> index 3b7ecc6..4306392 100644
> --- a/arch/arm/mach-omap2/clock24xx.c
> +++ b/arch/arm/mach-omap2/clock24xx.c
> @@ -60,8 +60,8 @@ struct omap_clk {
>   },  \
>   }
>  
> -#define CK_243X  (1 << 0)
> -#define CK_242X  (1 << 1)
> +#define CK_243X  RATE_IN_243X
> +#define CK_242X  RATE_IN_242X
>  
>  static struct omap_clk omap24xx_clks[] = {
>   /* external root sources */
> @@ -711,7 +711,7 @@ int __init omap2_clk_init(void)
>  {
>   struct prcm_config *prcm;
>   struct omap_clk *c;
> - u32 clkrate, cpu_mask;
> + u32 clkrate;
>  
>   if (cpu_is_omap242x())
>   cpu_mask = RATE_IN_242X;
> @@ -730,12 +730,6 @@ int __init omap2_clk_init(void)
>   for (c = omap24xx_clks; c < omap24xx_clks + ARRAY_SIZE(omap24xx_clks); 
> c++)
>   clk_init_one(c->lk.clk);
>  
> - cpu_mask = 0;
> - if (cpu_is_omap2420())
> - cpu_mask |= CK_242X;
> - if (cpu_is_omap2430())
> - cpu_mask |= CK_243X;
> -
>   for (c = omap24xx_clks; c < omap24xx_clks + ARRAY_SIZE(omap24xx_clks); 
> c++)
>   if (c->cpu & cpu_mask) {
>   clkdev_add(&c->lk);
> 
> 


- Paul
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 6/7] OMAP: dmtimer: enable all timers to be wakeup events

2009-04-14 Thread Paul Walmsley
From: Kevin Hilman 

All GP timers on OMAP2/3 can generate wakeup events.  The wakeup status is
cleared in the PRCM interrupt handler.

Signed-off-by: Kevin Hilman 
Signed-off-by: Paul Walmsley 
---
 arch/arm/plat-omap/dmtimer.c |6 ++
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index c99d611..a05205c 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -321,11 +321,9 @@ static void omap_dm_timer_reset(struct omap_dm_timer 
*timer)
l |= 0x2 << 8;   /* Set clock activity to perserve f-clock on idle */
 
/*
-* Enable wake-up only for GPT1 on OMAP2 CPUs.
-* FIXME: All timers should have wake-up enabled and clear
-* PRCM status.
+* Enable wake-up on OMAP2 CPUs.
 */
-   if (cpu_class_is_omap2() && (timer == &dm_timers[0]))
+   if (cpu_class_is_omap2())
l |= 1 << 2;
omap_dm_timer_write_reg(timer, OMAP_TIMER_OCP_CFG_REG, l);
 


--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 7/7] OMAP2/3 GPTIMER: allow system tick GPTIMER to be changed in board-*.c files

2009-04-14 Thread Paul Walmsley
Add a function omap2_gp_clockevent_set_gptimer() for board-*.c files
to use in .init_irq functions to configure the system tick GPTIMER.
Practical choices at this point are GPTIMER1 or GPTIMER12.  Both of
these timers are in the WKUP powerdomain, and so are unaffected by
chip power management.  GPTIMER1 can use sys_clk as a source, for
applications where a high-resolution timer is more important than
power management.  GPTIMER12 has the special property that it has the
secure 32kHz oscillator as its source clock, which may be less prone
to glitches than the off-chip 32kHz oscillator.  But on HS devices, it
may not be available for Linux use.

It appears that most boards are fine with GPTIMER1, but BeagleBoard
should use GPTIMER12 when using a 32KiHz timer source, due to hardware bugs
in revisions B4 and below.  Modify board-omap3beagle.c to use GPTIMER12.

This patch originally used a Kbuild config option to select the GPTIMER,
but was changed to allow this to be specified in board-*.c files, per
Tony's request.

Tested on Beagle rev B4 ES2.1, with and without CONFIG_OMAP_32K_TIMER, and
3430SDP.

Signed-off-by: Paul Walmsley 
Signed-off-by: Tony Lindgren 
---
 arch/arm/mach-omap2/board-omap3beagle.c|4 ++
 arch/arm/mach-omap2/clock24xx.c|1 +
 arch/arm/mach-omap2/clock24xx.h|   10 +-
 arch/arm/mach-omap2/clock34xx.h|1 -
 arch/arm/mach-omap2/timer-gp.c |   48 ++--
 arch/arm/plat-omap/dmtimer.c   |   20 
 arch/arm/plat-omap/include/mach/dmtimer.h  |2 +
 arch/arm/plat-omap/include/mach/timer-gp.h |   17 ++
 8 files changed, 91 insertions(+), 12 deletions(-)
 create mode 100644 arch/arm/plat-omap/include/mach/timer-gp.h

diff --git a/arch/arm/mach-omap2/board-omap3beagle.c 
b/arch/arm/mach-omap2/board-omap3beagle.c
index 744740a..3a7a29d 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -42,6 +42,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "mmc-twl4030.h"
 
@@ -186,6 +187,9 @@ static void __init omap3_beagle_init_irq(void)
 {
omap2_init_common_hw(NULL);
omap_init_irq();
+#ifdef CONFIG_OMAP_32K_TIMER
+   omap2_gp_clockevent_set_gptimer(12);
+#endif
omap_gpio_init();
 }
 
diff --git a/arch/arm/mach-omap2/clock24xx.c b/arch/arm/mach-omap2/clock24xx.c
index 4306392..fa2bd09 100644
--- a/arch/arm/mach-omap2/clock24xx.c
+++ b/arch/arm/mach-omap2/clock24xx.c
@@ -66,6 +66,7 @@ struct omap_clk {
 static struct omap_clk omap24xx_clks[] = {
/* external root sources */
CLK(NULL,   "func_32k_ck",  &func_32k_ck,   CK_243X | CK_242X),
+   CLK(NULL,   "secure_32k_ck", &secure_32k_ck, CK_243X | CK_242X),
CLK(NULL,   "osc_ck",   &osc_ck,CK_243X | CK_242X),
CLK(NULL,   "sys_ck",   &sys_ck,CK_243X | CK_242X),
CLK(NULL,   "alt_ck",   &alt_ck,CK_243X | CK_242X),
diff --git a/arch/arm/mach-omap2/clock24xx.h b/arch/arm/mach-omap2/clock24xx.h
index 33c3e5b..72003f7 100644
--- a/arch/arm/mach-omap2/clock24xx.h
+++ b/arch/arm/mach-omap2/clock24xx.h
@@ -625,6 +625,14 @@ static struct clk func_32k_ck = {
.clkdm_name = "wkup_clkdm",
 };
 
+static struct clk secure_32k_fck = {
+   .name   = "secure_32k_fck",
+   .ops= &clkops_null,
+   .rate   = 32768,
+   .flags  = RATE_FIXED,
+   .clkdm_name = "wkup_clkdm",
+};
+
 /* Typical 12/13MHz in standalone mode, will be 26Mhz in chassis mode */
 static struct clk osc_ck = {   /* (*12, *13, 19.2, *26, 38.4)MHz */
.name   = "osc_ck",
@@ -1790,7 +1798,7 @@ static struct clk gpt12_ick = {
 static struct clk gpt12_fck = {
.name   = "gpt12_fck",
.ops= &clkops_omap2_dflt_wait,
-   .parent = &func_32k_ck,
+   .parent = &secure_32k_ck,
.clkdm_name = "core_l4_clkdm",
.enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
.enable_bit = OMAP24XX_EN_GPT12_SHIFT,
diff --git a/arch/arm/mach-omap2/clock34xx.h b/arch/arm/mach-omap2/clock34xx.h
index f009017..6763b8f 100644
--- a/arch/arm/mach-omap2/clock34xx.h
+++ b/arch/arm/mach-omap2/clock34xx.h
@@ -2901,7 +2901,6 @@ static struct clk sr_l4_ick = {
 
 /* SECURE_32K_FCK clocks */
 
-/* XXX This clock no longer exists in 3430 TRM rev F */
 static struct clk gpt12_fck = {
.name   = "gpt12_fck",
.ops= &clkops_null,
diff --git a/arch/arm/mach-omap2/timer-gp.c b/arch/arm/mach-omap2/timer-gp.c
index 9fc13a2..7835048 100644
--- a/arch/arm/mach-omap2/timer-gp.c
+++ b/arch/arm/mach-omap2/timer-gp.c
@@ -3,6 +3,8 @@
  *
  * OMAP2 GP timer support.
  *
+ * Copyright (C) 2009 Nokia Corporation
+ *
  * Update to use new clocksource/clockevent layers
  * Author: Kevin Hilman, MontaVista Software, Inc. 
  * Copyright (C) 2007 MontaVista Sof

[PATCH 5/7] OMAP3 GPTIMER: fix GPTIMER12 IRQ

2009-04-14 Thread Paul Walmsley
GPTIMER12 IRQ is at IRQ 95 on OMAP3, unlike OMAP2.  (ref: OMAP34xx
Multimedia High Security (HS) Device Silicon Revision 3.0 Security
Addendum Rev. B, SWPU119B)

Signed-off-by: Paul Walmsley 
Signed-off-by: Tony Lindgren 
---
 arch/arm/plat-omap/dmtimer.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index bfd4757..c99d611 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -238,7 +238,7 @@ static struct omap_dm_timer omap3_dm_timers[] = {
{ .phys_base = 0x4904, .irq = INT_24XX_GPTIMER9 },
{ .phys_base = 0x48086000, .irq = INT_24XX_GPTIMER10 },
{ .phys_base = 0x48088000, .irq = INT_24XX_GPTIMER11 },
-   { .phys_base = 0x48304000, .irq = INT_24XX_GPTIMER12 },
+   { .phys_base = 0x48304000, .irq = INT_34XX_GPT12_IRQ },
 };
 
 static const char *omap3_dm_source_names[] __initdata = {


--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/7] OMAP3: clock: Camera module doesn't have IDLEST bit

2009-04-14 Thread Paul Walmsley
From: Sergio Aguirre 

This patch avoids waiting for the camera module to become ready,
since it doesn't have IDLEST bit.

Based on a earlier hack done by Paul Walmsley on Sep 9 2008 on
linux-omap tree.

Signed-off-by: Sergio Aguirre 
Signed-off-by: Paul Walmsley 
---
 arch/arm/mach-omap2/clock34xx.h |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-omap2/clock34xx.h b/arch/arm/mach-omap2/clock34xx.h
index 70ec10d..f009017 100644
--- a/arch/arm/mach-omap2/clock34xx.h
+++ b/arch/arm/mach-omap2/clock34xx.h
@@ -2052,7 +2052,7 @@ static struct clk dss_ick = {
 
 static struct clk cam_mclk = {
.name   = "cam_mclk",
-   .ops= &clkops_omap2_dflt_wait,
+   .ops= &clkops_omap2_dflt,
.parent = &dpll4_m5x2_ck,
.enable_reg = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_FCLKEN),
.enable_bit = OMAP3430_EN_CAM_SHIFT,
@@ -2063,7 +2063,7 @@ static struct clk cam_mclk = {
 static struct clk cam_ick = {
/* Handles both L3 and L4 clocks */
.name   = "cam_ick",
-   .ops= &clkops_omap2_dflt_wait,
+   .ops= &clkops_omap2_dflt,
.parent = &l4_ick,
.init   = &omap2_init_clk_clkdm,
.enable_reg = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_ICLKEN),
@@ -2074,7 +2074,7 @@ static struct clk cam_ick = {
 
 static struct clk csi2_96m_fck = {
.name   = "csi2_96m_fck",
-   .ops= &clkops_omap2_dflt_wait,
+   .ops= &clkops_omap2_dflt,
.parent = &core_96m_fck,
.init   = &omap2_init_clk_clkdm,
.enable_reg = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_FCLKEN),


--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 4/7] OMAP1: clock: Typo fix for clock in omap1

2009-04-14 Thread Paul Walmsley
From: Arun KS 

Typo error when requesting for clock for dsp in omap1

Signed-off-by: Arun KS 
Signed-off-by: Paul Walmsley 
---
 arch/arm/mach-omap1/mcbsp.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap1/mcbsp.c b/arch/arm/mach-omap1/mcbsp.c
index d040c3f..a2d7814 100644
--- a/arch/arm/mach-omap1/mcbsp.c
+++ b/arch/arm/mach-omap1/mcbsp.c
@@ -40,8 +40,8 @@ static void omap1_mcbsp_request(unsigned int id)
 */
if (id == OMAP_MCBSP1 || id == OMAP_MCBSP3) {
if (dsp_use++ == 0) {
-   api_clk = clk_get(NULL, "api_clk");
-   dsp_clk = clk_get(NULL, "dsp_clk");
+   api_clk = clk_get(NULL, "api_ck");
+   dsp_clk = clk_get(NULL, "dsp_ck");
if (!IS_ERR(api_clk) && !IS_ERR(dsp_clk)) {
clk_enable(api_clk);
clk_enable(dsp_clk);


--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/7] OMAP2xxx clock: fix broken cpu_mask code

2009-04-14 Thread Paul Walmsley
Commit 8ad8ff6548f1c0bcbeaa02f274b3927c5015a921 breaks the OMAP2xxx
cpu_mask code, which causes OMAP2xxx to panic on boot.  Fix by
removing the cpu_mask auto variable and by changing CK_242X
and CK_243X to use RATE_IN_242X/RATE_IN_243X.

Resolves

<1>Unable to handle kernel NULL pointer dereference at virtual address 000c
<1>pgd = c0004000
<1>[000c] *pgd=
Internal error: Oops: 5 [#1]
Modules linked in:
CPU: 0Not tainted  (2.6.29-omap1 #32)
PC is at omap2_clk_set_parent+0x104/0x120
LR is at omap2_clk_set_parent+0x28/0x120

Signed-off-by: Paul Walmsley 
Tested-by: Jarkko Nikula 
Cc: Russell King 
---
 arch/arm/mach-omap2/clock24xx.c |   12 +++-
 1 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/arch/arm/mach-omap2/clock24xx.c b/arch/arm/mach-omap2/clock24xx.c
index 3b7ecc6..4306392 100644
--- a/arch/arm/mach-omap2/clock24xx.c
+++ b/arch/arm/mach-omap2/clock24xx.c
@@ -60,8 +60,8 @@ struct omap_clk {
},  \
}
 
-#define CK_243X(1 << 0)
-#define CK_242X(1 << 1)
+#define CK_243XRATE_IN_243X
+#define CK_242XRATE_IN_242X
 
 static struct omap_clk omap24xx_clks[] = {
/* external root sources */
@@ -711,7 +711,7 @@ int __init omap2_clk_init(void)
 {
struct prcm_config *prcm;
struct omap_clk *c;
-   u32 clkrate, cpu_mask;
+   u32 clkrate;
 
if (cpu_is_omap242x())
cpu_mask = RATE_IN_242X;
@@ -730,12 +730,6 @@ int __init omap2_clk_init(void)
for (c = omap24xx_clks; c < omap24xx_clks + ARRAY_SIZE(omap24xx_clks); 
c++)
clk_init_one(c->lk.clk);
 
-   cpu_mask = 0;
-   if (cpu_is_omap2420())
-   cpu_mask |= CK_242X;
-   if (cpu_is_omap2430())
-   cpu_mask |= CK_243X;
-
for (c = omap24xx_clks; c < omap24xx_clks + ARRAY_SIZE(omap24xx_clks); 
c++)
if (c->cpu & cpu_mask) {
clkdev_add(&c->lk);


--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/7] OMAP2xxx clock: init osc_ck, sys_ck internal lists early

2009-04-14 Thread Paul Walmsley
Commit 3f0a820c4c0b4670fb5f164baa5582e23c2ef118 breaks OMAP2xxx boot
during initial propagate_rate() on osc_ck and sys_ck.  Fix by calling
clk_init_one() for these clocks first.

Resolves

<1>Unable to handle kernel NULL pointer dereference at virtual address 
<1>pgd = c0004000
<1>[] *pgd=
Internal error: Oops: 5 [#1]
Modules linked in:
CPU: 0Not tainted  (2.6.29-omap1 #37)
PC is at propagate_rate+0x10/0x60
LR is at omap2_clk_init+0x30/0x218
...

Signed-off-by: Paul Walmsley 
Tested-by: Jarkko Nikula 
Cc: Russell King 
---
 arch/arm/mach-omap2/clock24xx.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/clock24xx.c b/arch/arm/mach-omap2/clock24xx.c
index 1e839c5..3b7ecc6 100644
--- a/arch/arm/mach-omap2/clock24xx.c
+++ b/arch/arm/mach-omap2/clock24xx.c
@@ -720,6 +720,8 @@ int __init omap2_clk_init(void)
 
clk_init(&omap2_clk_functions);
 
+   clk_init_one(&osc_ck);
+   clk_init_one(&sys_ck);
osc_ck.rate = omap2_osc_clk_recalc(&osc_ck);
propagate_rate(&osc_ck);
sys_ck.rate = omap2_sys_clk_recalc(&sys_ck);


--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/7] OMAP clock fixes for v2.6.30-rc1

2009-04-14 Thread Paul Walmsley
Hi Russell,

Here are some OMAP clock-related fixes against v2.6.30-rc1.  If you
are happy with these, Tony will merge them into his omap-fixes branch
for you to pull.

You might consider the last patch to be too big to be a fix; if so,
please let me know and it will be moved to a feature series.


regards

- Paul

---

Arun KS (1):
  OMAP1: clock: Typo fix for clock in omap1

Kevin Hilman (1):
  OMAP: dmtimer: enable all timers to be wakeup events

Paul Walmsley (4):
  OMAP2/3 GPTIMER: allow system tick GPTIMER to be changed in board-*.c 
files
  OMAP3 GPTIMER: fix GPTIMER12 IRQ
  OMAP2xxx clock: fix broken cpu_mask code
  OMAP2xxx clock: init osc_ck, sys_ck internal lists early

Sergio Aguirre (1):
  OMAP3: clock: Camera module doesn't have IDLEST bit


 arch/arm/mach-omap1/mcbsp.c|4 +-
 arch/arm/mach-omap2/board-omap3beagle.c|4 ++
 arch/arm/mach-omap2/clock24xx.c|   15 -
 arch/arm/mach-omap2/clock24xx.h|   10 +-
 arch/arm/mach-omap2/clock34xx.h|7 ++--
 arch/arm/mach-omap2/timer-gp.c |   48 ++--
 arch/arm/plat-omap/dmtimer.c   |   28 ++--
 arch/arm/plat-omap/include/mach/dmtimer.h  |2 +
 arch/arm/plat-omap/include/mach/timer-gp.h |   17 ++
 9 files changed, 104 insertions(+), 31 deletions(-)
 create mode 100644 arch/arm/plat-omap/include/mach/timer-gp.h


omap-clock-fixes
   textdata bss dec hex filename
4601895  249952  304788 5156635  4eaf1b vmlinux.3430sdp.orig
4602055  249952  304788 5156795  4eafbb vmlinux.3430sdp


--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html