Re: [PATCH 8/18] ARM: OMAP: Add mailbox support for IVA

2007-04-16 Thread Tony Lindgren
* Tony Lindgren [EMAIL PROTECTED] [070409 21:23]:
 From: Hiroshi DOYU [EMAIL PROTECTED]
 
 This patch adds a generic mailbox interface for for DSP and IVA
 (Image Video Accelerator). This patch itself doesn't contain
 any IVA driver.

Here's an updated version that merges in two later fixes from Hiroshi.

Regards,

Tony
From 7845896508123512184412464ca22505c13a728d Mon Sep 17 00:00:00 2001
From: Hiroshi DOYU [EMAIL PROTECTED]
Date: Thu, 7 Dec 2006 15:43:59 -0800
Subject: [PATCH 8/18] ARM: OMAP: Add mailbox support for IVA

This patch adds a generic mailbox interface for for DSP and IVA
(Image Video Accelerator). This patch itself doesn't contain
any IVA driver.

Signed-off-by: Hiroshi DOYU [EMAIL PROTECTED]
Signed-off-by: Juha Yrjola [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap1/mailbox.c   |  206 
 arch/arm/mach-omap2/mailbox.c   |  310 ++
 arch/arm/plat-omap/mailbox.c|  352 +++
 arch/arm/plat-omap/mailbox.h|  193 +++
 include/asm-arm/arch-omap/mailbox.h |   68 +++
 5 files changed, 1129 insertions(+), 0 deletions(-)

Index: linux-2.6/arch/arm/mach-omap1/mailbox.c
===
--- /dev/null   1970-01-01 00:00:00.0 +
+++ linux-2.6/arch/arm/mach-omap1/mailbox.c 2007-04-16 18:19:40.0 
+
@@ -0,0 +1,206 @@
+/*
+ * Mailbox reservation modules for DSP
+ *
+ * Copyright (C) 2006 Nokia Corporation
+ * Written by: Hiroshi DOYU [EMAIL PROTECTED]
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file COPYING in the main directory of this archive
+ * for more details.
+ */
+
+#include linux/kernel.h
+#include linux/resource.h
+#include linux/interrupt.h
+#include linux/platform_device.h
+#include asm/arch/mailbox.h
+#include asm/arch/irqs.h
+#include asm/io.h
+
+#define MAILBOX_ARM2DSP1   0x00
+#define MAILBOX_ARM2DSP1b  0x04
+#define MAILBOX_DSP2ARM1   0x08
+#define MAILBOX_DSP2ARM1b  0x0c
+#define MAILBOX_DSP2ARM2   0x10
+#define MAILBOX_DSP2ARM2b  0x14
+#define MAILBOX_ARM2DSP1_Flag  0x18
+#define MAILBOX_DSP2ARM1_Flag  0x1c
+#define MAILBOX_DSP2ARM2_Flag  0x20
+
+unsigned long mbox_base;
+
+struct omap_mbox1_fifo {
+   unsigned long cmd;
+   unsigned long data;
+   unsigned long flag;
+};
+
+struct omap_mbox1_priv {
+   struct omap_mbox1_fifo tx_fifo;
+   struct omap_mbox1_fifo rx_fifo;
+};
+
+static inline int mbox_read_reg(unsigned int reg)
+{
+   return __raw_readw(mbox_base + reg);
+}
+
+static inline void mbox_write_reg(unsigned int val, unsigned int reg)
+{
+   __raw_writew(val, mbox_base + reg);
+}
+
+/* msg */
+static inline mbox_msg_t omap1_mbox_fifo_read(struct omap_mbox *mbox)
+{
+   struct omap_mbox1_fifo *fifo =
+   ((struct omap_mbox1_priv *)mbox-priv)-rx_fifo;
+   mbox_msg_t msg;
+
+   msg = mbox_read_reg(fifo-data);
+   msg |= ((mbox_msg_t) mbox_read_reg(fifo-cmd))  16;
+
+   return msg;
+}
+
+static inline void
+omap1_mbox_fifo_write(struct omap_mbox *mbox, mbox_msg_t msg)
+{
+   struct omap_mbox1_fifo *fifo =
+   ((struct omap_mbox1_priv *)mbox-priv)-tx_fifo;
+
+   mbox_write_reg(msg  0x, fifo-data);
+   mbox_write_reg(msg  16, fifo-cmd);
+}
+
+static inline int omap1_mbox_fifo_empty(struct omap_mbox *mbox)
+{
+   return 0;
+}
+
+static inline int omap1_mbox_fifo_full(struct omap_mbox *mbox)
+{
+   struct omap_mbox1_fifo *fifo =
+   ((struct omap_mbox1_priv *)mbox-priv)-rx_fifo;
+
+   return (mbox_read_reg(fifo-flag));
+}
+
+/* irq */
+static inline void
+omap1_mbox_enable_irq(struct omap_mbox *mbox, omap_mbox_type_t irq)
+{
+   if (irq == IRQ_RX)
+   enable_irq(mbox-irq);
+}
+
+static inline void
+omap1_mbox_disable_irq(struct omap_mbox *mbox, omap_mbox_type_t irq)
+{
+   if (irq == IRQ_RX)
+   disable_irq(mbox-irq);
+}
+
+static inline int
+omap1_mbox_is_irq(struct omap_mbox *mbox, omap_mbox_type_t irq)
+{
+   if (irq == IRQ_TX)
+   return 0;
+   return 1;
+}
+
+static struct omap_mbox_ops omap1_mbox_ops = {
+   .type   = OMAP_MBOX_TYPE1,
+   .fifo_read  = omap1_mbox_fifo_read,
+   .fifo_write = omap1_mbox_fifo_write,
+   .fifo_empty = omap1_mbox_fifo_empty,
+   .fifo_full  = omap1_mbox_fifo_full,
+   .enable_irq = omap1_mbox_enable_irq,
+   .disable_irq= omap1_mbox_disable_irq,
+   .is_irq = omap1_mbox_is_irq,
+};
+
+/* FIXME: the following struct should be created automatically by the user id 
*/
+
+/* DSP */
+static struct omap_mbox1_priv omap1_mbox_dsp_priv = {
+   .tx_fifo = {
+   .cmd= MAILBOX_ARM2DSP1b,
+   .data

Re: [PATCH 5/7] ARM: OMAP: Merge board specific files from N800 tree

2007-04-16 Thread Tony Lindgren
* Tony Lindgren [EMAIL PROTECTED] [070409 21:34]:
 From: Kai Svahn [EMAIL PROTECTED]
 
 This patch merges board specific files from N800 tree.
 Nokia has published the files at:
 
 http://repository.maemo.org/pool/maemo3.0/free/source/
 kernel-source-rx-34_2.6.18.orig.tar.gz
 kernel-source-rx-34_2.6.18-osso29.diff.gz

Here's an updated version that fixes compile after my last fix
to move externs to board-nokia.h.

Regards,

Tony
From fd345ea126336a514baf808170f1231999ba2c1d Mon Sep 17 00:00:00 2001
From: Kai Svahn [EMAIL PROTECTED]
Date: Fri, 26 Jan 2007 12:39:48 -0800
Subject: [PATCH 5/7] ARM: OMAP: Merge board specific files from N800 tree

This patch merges board specific files from N800 tree.
Nokia has published the files at:

http://repository.maemo.org/pool/maemo3.0/free/source/
kernel-source-rx-34_2.6.18.orig.tar.gz
kernel-source-rx-34_2.6.18-osso29.diff.gz

Signed-off-by: Kai Svahn [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]

Index: linux-2.6/arch/arm/mach-omap2/Kconfig
===
--- linux-2.6.orig/arch/arm/mach-omap2/Kconfig  2007-04-16 20:50:00.0 
+
+++ linux-2.6/arch/arm/mach-omap2/Kconfig   2007-04-16 20:50:00.0 
+
@@ -54,4 +54,13 @@ config MACH_OMAP_APOLLON
 
 config MACH_OMAP_2430SDP
bool OMAP 2430 SDP board
-   depends on ARCH_OMAP2  ARCH_OMAP24XX
\ No newline at end of file
+   depends on ARCH_OMAP2  ARCH_OMAP24XX
+
+config MACH_NOKIA_N800
+   bool Nokia N800
+   depends on ARCH_OMAP24XX
+
+config MACH_OMAP2_TUSB6010
+   bool
+   depends on ARCH_OMAP2  ARCH_OMAP2420
+   default y if MACH_NOKIA_N800
\ No newline at end of file
Index: linux-2.6/arch/arm/mach-omap2/Makefile
===
--- linux-2.6.orig/arch/arm/mach-omap2/Makefile 2007-04-16 20:50:00.0 
+
+++ linux-2.6/arch/arm/mach-omap2/Makefile  2007-04-16 20:50:00.0 
+
@@ -16,4 +16,8 @@ obj-$(CONFIG_MACH_OMAP_GENERIC)   += boar
 obj-$(CONFIG_MACH_OMAP_H4) += board-h4.o
 obj-$(CONFIG_MACH_OMAP_2430SDP)+= board-2430sdp.o
 obj-$(CONFIG_MACH_OMAP_APOLLON)+= board-apollon.o
+obj-$(CONFIG_MACH_NOKIA_N800)  += board-n800.o board-n800-flash.o \
+  board-n800-mmc.o board-n800-bt.o \
+  board-n800-audio.o board-n800-usb.o \
+  board-n800-dsp.o board-n800-pm.o
 
Index: linux-2.6/arch/arm/mach-omap2/board-n800-audio.c
===
--- /dev/null   1970-01-01 00:00:00.0 +
+++ linux-2.6/arch/arm/mach-omap2/board-n800-audio.c2007-04-16 
20:50:00.0 +
@@ -0,0 +1,366 @@
+/*
+ * linux/arch/arm/mach-omap2/board-n800-audio.c
+ *
+ * Copyright (C) 2006 Nokia Corporation
+ * Contact: Juha Yrjola
+ *  Jarkko Nikula [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.
+ *
+ * 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
+ *
+ */
+
+#include linux/err.h
+#include linux/clk.h
+#include linux/platform_device.h
+#include linux/spi/tsc2301.h
+
+#include asm/io.h
+#include asm/arch/eac.h
+
+#include ../plat-omap/dsp/dsp_common.h
+
+#if defined(CONFIG_SPI_TSC2301_AUDIO)  defined(CONFIG_SND_OMAP24XX_EAC)
+#define AUDIO_ENABLED
+
+static struct clk *sys_clkout2;
+static struct clk *func96m_clk;
+static struct device *eac_device;
+static struct device *tsc2301_device;
+
+static int enable_audio;
+static int audio_ok;
+static spinlock_t audio_lock;
+
+/*
+ * Leaving EAC and sys_clkout2 pins multiplexed to those subsystems results
+ * in about 2 mA extra current leak when audios are powered down. The
+ * workaround is to multiplex them to protected mode (with pull-ups enabled)
+ * whenever audio is not being used.
+ */
+static int eac_mux_disabled = 0;
+static int clkout2_mux_disabled = 0;
+static u32 saved_mux[2];
+
+static void n800_enable_eac_mux(void)
+{
+   if (!eac_mux_disabled)
+   return;
+   __raw_writel(saved_mux[1], IO_ADDRESS(0x48000124));
+   eac_mux_disabled = 0;
+}
+
+static void n800_disable_eac_mux(void)
+{
+   if (eac_mux_disabled) {
+   WARN_ON(eac_mux_disabled);
+   return;
+   }
+   saved_mux[1] = __raw_readl(IO_ADDRESS(0x48000124

Re: [PATCH 0/3] Aligning omap.c from Linux-OMAP to mainline kernel

2007-04-24 Thread Tony Lindgren
* Carlos Aguiar [EMAIL PROTECTED] [070424 21:01]:
 Hi Pierre,
 
 Find in this series the pending patches from Linux-OMAP to mainline for
 drivers/mmc/omap.c
 
 The patches series was applied against Linus' tree 2.6.21-rc7-git6.
 
 Anyway, it was tested on OMAP H2 (using omap_h2_1610_defconfig available
 on linus' tree).

Can you please repost them by adding a second From: line above the
commit message to the top of the mail?

That way the commit goest to the original author when Pierre applies
them to his tree.

So, for example:

...

From: Arnaud Patard [EMAIL PROTECTED]

This patch add a missing '\n' at the end of the 'cover is open' string
in mmc_omap_switch_handler().

Signed-off-by: Arnaud Patard [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]

...

Regards,

Tony
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 62/90] ARM: OMAP: Merge board specific files from N800 tree

2007-04-05 Thread Tony Lindgren
* Randy Dunlap [EMAIL PROTECTED] [070404 17:16]:
 On Wed,  4 Apr 2007 14:05:41 -0400 Tony Lindgren wrote:
 
  This patch merges board specific files from N800 tree.
  Nokia has published the files at:
  
 
 2 comments:
 
 a.  lots of printk() calls need log levels added as well as some
 indication of the source of the message, like a driver/module name
 or subsystem name[*]

I've update these to use dev_err() or dev_dbg() where possible,
and else use KERN_ERR or KERN_DEBUG.

 b.  externs should be in header files.

Moved them to board-nokia.h.

 * Maybe this isn't so critical for an embedded environment (?)

Updated patch attached.

Tony
From fd345ea126336a514baf808170f1231999ba2c1d Mon Sep 17 00:00:00 2001
From: Kai Svahn [EMAIL PROTECTED]
Date: Fri, 26 Jan 2007 12:39:48 -0800
Subject: [PATCH 62/90] ARM: OMAP: Merge board specific files from N800 tree

This patch merges board specific files from N800 tree.
Nokia has published the files at:

http://repository.maemo.org/pool/maemo3.0/free/source/
kernel-source-rx-34_2.6.18.orig.tar.gz
kernel-source-rx-34_2.6.18-osso29.diff.gz

Signed-off-by: Kai Svahn [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]

--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -22,9 +22,14 @@ config MACH_OMAP_GENERIC
bool Generic OMAP board
depends on ARCH_OMAP2  ARCH_OMAP24XX
 
+config MACH_NOKIA_N800
+   bool Nokia N800
+   depends on ARCH_OMAP24XX
+
 config MACH_OMAP2_TUSB6010
bool
depends on ARCH_OMAP2  ARCH_OMAP2420
+   default y if MACH_NOKIA_N800
 
 config MACH_OMAP_H4
bool OMAP 2420 H4 board
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -20,6 +20,10 @@ obj-$(CONFIG_MACH_OMAP_GENERIC)  += boar
 obj-$(CONFIG_MACH_OMAP_H4) += board-h4.o
 obj-$(CONFIG_MACH_OMAP_2430SDP)+= board-2430sdp.o
 obj-$(CONFIG_MACH_OMAP_APOLLON)+= board-apollon.o
+obj-$(CONFIG_MACH_NOKIA_N800)  += board-n800.o board-n800-flash.o \
+  board-n800-mmc.o board-n800-bt.o \
+  board-n800-audio.o board-n800-usb.o \
+  board-n800-dsp.o board-n800-pm.o
 
 # TUSB 6010 chips
 obj-$(CONFIG_MACH_OMAP2_TUSB6010)  += usb-tusb6010.o
--- /dev/null
+++ b/arch/arm/mach-omap2/board-n800-audio.c
@@ -0,0 +1,357 @@
+/*
+ * linux/arch/arm/mach-omap/omap2/board-n800-audio.c
+ *
+ * Copyright (C) 2006 Nokia Corporation
+ * Contact: Juha Yrjola
+ *  Jarkko Nikula [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.
+ *
+ * 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
+ *
+ */
+
+#include linux/err.h
+#include linux/clk.h
+#include linux/delay.h
+#include linux/platform_device.h
+#include linux/spi/tsc2301.h
+
+#include asm/io.h
+#include asm/arch/eac.h
+
+#include ../plat-omap/dsp/dsp_common.h
+
+#if defined(CONFIG_SPI_TSC2301_AUDIO)  defined(CONFIG_SND_OMAP24XX_EAC)
+#define AUDIO_ENABLED
+
+static struct clk *sys_clkout2;
+static struct clk *func96m_clk;
+static struct device *eac_device;
+static struct device *tsc2301_device;
+
+static int enable_audio;
+static int audio_ok;
+static spinlock_t audio_lock;
+
+
+/*
+ * Leaving EAC pins multiplexed to EAC functionality results
+ * in about 2 mA extra current leaked. The workaround is to
+ * multiplex the EAC pins to protected mode (with pull-ups enabled)
+ * whenever audio is not being used.
+ */
+static int mux_disabled;
+static u32 saved_mux[2];
+
+static void n800_enable_eac_mux(void)
+{
+   if (!mux_disabled)
+   return;
+   __raw_writel(saved_mux[0], IO_ADDRESS(0x48e8));
+   __raw_writel(saved_mux[1], IO_ADDRESS(0x48000124));
+   mux_disabled = 0;
+}
+
+static void n800_disable_eac_mux(void)
+{
+   u32 l;
+
+   if (mux_disabled) {
+   WARN_ON(mux_disabled);
+   return;
+   }
+   saved_mux[0] = __raw_readl(IO_ADDRESS(0x48e8));
+   saved_mux[1] = __raw_readl(IO_ADDRESS(0x48000124));
+   l = saved_mux[0]  ~0xff;
+   l |= 0x1f;
+   __raw_writel(l, IO_ADDRESS(0x48e8));
+   __raw_writel(0x1f1f1f1f, IO_ADDRESS(0x48000124));
+   mux_disabled = 1;
+}
+
+static int n800_eac_enable_ext_clocks(struct device *dev)
+{
+   BUG_ON(tsc2301_device == NULL);
+   n800_enable_eac_mux();
+   tsc2301_enable_mclk

[PATCH 0/10] ARM: OMAP: GPIO code updates shared between OMAP1 and OMAP2

2007-04-09 Thread Tony Lindgren
Hi,

The following patch series contains GPIO updates for OMAP.

This is take #2 of the earlier 90 patch mountain, which has
been split into six smaller series.

Regards,

Tony

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/10] ARM: OMAP: Enable 24xx GPIO autoidling

2007-04-09 Thread Tony Lindgren
From: Juha Yrjola [EMAIL PROTECTED]

Enable 24xx GPIO autoidling

Signed-off-by: Juha Yrjola [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/plat-omap/gpio.c |   10 ++
 1 files changed, 10 insertions(+), 0 deletions(-)

--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -1083,6 +1083,10 @@ static int __init _omap_gpio_init(void)
if (bank-method == METHOD_GPIO_24XX) {
__raw_writel(0x, bank-base + 
OMAP24XX_GPIO_IRQENABLE1);
__raw_writel(0x, bank-base + 
OMAP24XX_GPIO_IRQSTATUS1);
+   __raw_writew(0x0015, bank-base + 
OMAP24XX_GPIO_SYSCONFIG);
+
+   /* Initialize interface clock ungated, module enabled */
+   __raw_writel(0, bank-base + OMAP24XX_GPIO_CTRL);
 
gpio_count = 32;
}
@@ -1105,6 +1109,12 @@ static int __init _omap_gpio_init(void)
if (cpu_is_omap16xx())
omap_writel(omap_readl(ULPD_CAM_CLK_CTRL) | 0x04, 
ULPD_CAM_CLK_CTRL);
 
+#ifdef CONFIG_ARCH_OMAP24XX
+   /* Enable autoidle for the OCP interface */
+   if (cpu_is_omap24xx())
+   omap_writel(1  0, 0x48019010);
+#endif
+
return 0;
 }
 
-- 
1.4.4.2

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/10] ARM: OMAP: Implement workaround for GPIO wakeup bug in OMAP2420 silicon

2007-04-09 Thread Tony Lindgren
From: Juha Yrjola [EMAIL PROTECTED]

Some GPIOs on OMAP2420 do not have wakeup capabilities. If these GPIOs
are configured as IRQ sources, spurious interrupts will be generated
each time the core domain enters retention.

Signed-off-by: Juha Yrjola [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/plat-omap/gpio.c |  154 +++-
 1 files changed, 136 insertions(+), 18 deletions(-)

--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -118,8 +118,18 @@ struct gpio_bank {
u16 virtual_irq_start;
int method;
u32 reserved_map;
+#if defined (CONFIG_ARCH_OMAP16XX) || defined (CONFIG_ARCH_OMAP24XX)
u32 suspend_wakeup;
u32 saved_wakeup;
+#endif
+#ifdef CONFIG_ARCH_OMAP24XX
+   u32 non_wakeup_gpios;
+   u32 enabled_non_wakeup_gpios;
+
+   u32 saved_datain;
+   u32 saved_fallingdetect;
+   u32 saved_risingdetect;
+#endif
spinlock_t lock;
 };
 
@@ -398,8 +408,10 @@ do {   \
__raw_writel(l, base + reg); \
 } while(0)
 
-static inline void set_24xx_gpio_triggering(void __iomem *base, int gpio, int 
trigger)
+#ifdef CONFIG_ARCH_OMAP24XX
+static inline void set_24xx_gpio_triggering(struct gpio_bank *bank, int gpio, 
int trigger)
 {
+   void __iomem *base = bank-base;
u32 gpio_bit = 1  gpio;
 
MOD_REG_BIT(OMAP24XX_GPIO_LEVELDETECT0, gpio_bit,
@@ -410,9 +422,21 @@ static inline void set_24xx_gpio_triggering(void __iomem 
*base, int gpio, int tr
trigger  __IRQT_RISEDGE);
MOD_REG_BIT(OMAP24XX_GPIO_FALLINGDETECT, gpio_bit,
trigger  __IRQT_FALEDGE);
+   if (likely(!(bank-non_wakeup_gpios  gpio_bit))) {
+   if (trigger != 0)
+   __raw_writel(1  gpio, bank-base + 
OMAP24XX_GPIO_SETWKUENA);
+   else
+   __raw_writel(1  gpio, bank-base + 
OMAP24XX_GPIO_CLEARWKUENA);
+   } else {
+   if (trigger != 0)
+   bank-enabled_non_wakeup_gpios |= gpio_bit;
+   else
+   bank-enabled_non_wakeup_gpios = ~gpio_bit;
+   }
/* FIXME: Possibly do 'set_irq_handler(j, handle_level_irq)' if only 
level
 * triggering requested. */
 }
+#endif
 
 static int _set_gpio_triggering(struct gpio_bank *bank, int gpio, int trigger)
 {
@@ -440,6 +464,7 @@ static int _set_gpio_triggering(struct gpio_bank *bank, int 
gpio, int trigger)
else
goto bad;
break;
+#ifdef CONFIG_ARCH_OMAP16XX
case METHOD_GPIO_1610:
if (gpio  0x08)
reg += OMAP1610_GPIO_EDGE_CTRL2;
@@ -455,7 +480,14 @@ static int _set_gpio_triggering(struct gpio_bank *bank, 
int gpio, int trigger)
l |= 2  (gpio  1);
if (trigger  __IRQT_FALEDGE)
l |= 1  (gpio  1);
+   if (trigger)
+   /* Enable wake-up during idle for dynamic tick */
+   __raw_writel(1  gpio, bank-base + 
OMAP1610_GPIO_SET_WAKEUPENA);
+   else
+   __raw_writel(1  gpio, bank-base + 
OMAP1610_GPIO_CLEAR_WAKEUPENA);
break;
+#endif
+#ifdef CONFIG_ARCH_OMAP730
case METHOD_GPIO_730:
reg += OMAP730_GPIO_INT_CONTROL;
l = __raw_readl(reg);
@@ -466,9 +498,12 @@ static int _set_gpio_triggering(struct gpio_bank *bank, 
int gpio, int trigger)
else
goto bad;
break;
+#endif
+#ifdef CONFIG_ARCH_OMAP24XX
case METHOD_GPIO_24XX:
-   set_24xx_gpio_triggering(reg, gpio, trigger);
+   set_24xx_gpio_triggering(bank, gpio, trigger);
break;
+#endif
default:
BUG();
goto bad;
@@ -652,8 +687,8 @@ static inline void _set_gpio_irqenable(struct gpio_bank 
*bank, int gpio, int ena
 static int _set_gpio_wakeup(struct gpio_bank *bank, int gpio, int enable)
 {
switch (bank-method) {
+#ifdef CONFIG_ARCH_OMAP16XX
case METHOD_GPIO_1610:
-   case METHOD_GPIO_24XX:
spin_lock(bank-lock);
if (enable)
bank-suspend_wakeup |= (1  gpio);
@@ -661,6 +696,24 @@ static int _set_gpio_wakeup(struct gpio_bank *bank, int 
gpio, int enable)
bank-suspend_wakeup = ~(1  gpio);
spin_unlock(bank-lock);
return 0;
+#endif
+#ifdef CONFIG_ARCH_OMAP24XX
+   case METHOD_GPIO_24XX:
+   spin_lock(bank-lock);
+   if (enable) {
+   if (bank-non_wakeup_gpios  (1  gpio)) {
+   printk(KERN_ERR Unable to enable wakeup on
+   non-wakeup GPIO%d\n,
+   (bank - gpio_bank) * 32 + gpio

[PATCH 6/10] ARM: OMAP: plat-omap changes for 2430 SDP

2007-04-09 Thread Tony Lindgren
From: Syed Mohammed Khasim [EMAIL PROTECTED]

This patch adds minimal OMAP2430 support to plat-omap files to
get the kernel booting on 2430SDP.

Signed-off-by: Syed Mohammed Khasim [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/plat-omap/devices.c |6 +++-
 arch/arm/plat-omap/dmtimer.c |2 +
 arch/arm/plat-omap/gpio.c|   76 ++---
 arch/arm/plat-omap/mcbsp.c   |   15 +---
 4 files changed, 80 insertions(+), 19 deletions(-)

--- a/arch/arm/plat-omap/devices.c
+++ b/arch/arm/plat-omap/devices.c
@@ -429,6 +429,10 @@ static inline void omap_init_rng(void) {}
  */
 static int __init omap_init_devices(void)
 {
+/*
+ * Need to enable relevant once for 2430 SDP
+ */
+#ifndef CONFIG_MACH_OMAP_2430SDP
/* please keep these calls, and their implementations above,
 * in alphabetical order so they're easier to sort through.
 */
@@ -438,7 +442,7 @@ static int __init omap_init_devices(void)
omap_init_uwire();
omap_init_wdt();
omap_init_rng();
-
+#endif
return 0;
 }
 arch_initcall(omap_init_devices);
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -506,6 +506,8 @@ int omap_dm_timer_init(void)
BUG_ON(dm_source_clocks[i] == NULL);
}
 #endif
+   if (cpu_is_omap243x())
+   dm_timers[0].phys_base = 0x49018000;
 
for (i = 0; i  dm_timer_count; i++) {
 #ifdef CONFIG_ARCH_OMAP2
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -85,10 +85,17 @@
 /*
  * omap24xx specific GPIO registers
  */
-#define OMAP24XX_GPIO1_BASE(void __iomem *)0x48018000
-#define OMAP24XX_GPIO2_BASE(void __iomem *)0x4801a000
-#define OMAP24XX_GPIO3_BASE(void __iomem *)0x4801c000
-#define OMAP24XX_GPIO4_BASE(void __iomem *)0x4801e000
+#define OMAP242X_GPIO1_BASE(void __iomem *)0x48018000
+#define OMAP242X_GPIO2_BASE(void __iomem *)0x4801a000
+#define OMAP242X_GPIO3_BASE(void __iomem *)0x4801c000
+#define OMAP242X_GPIO4_BASE(void __iomem *)0x4801e000
+
+#define OMAP243X_GPIO1_BASE(void __iomem *)0x4900C000
+#define OMAP243X_GPIO2_BASE(void __iomem *)0x4900E000
+#define OMAP243X_GPIO3_BASE(void __iomem *)0x4901
+#define OMAP243X_GPIO4_BASE(void __iomem *)0x49012000
+#define OMAP243X_GPIO5_BASE(void __iomem *)0x480B6000
+
 #define OMAP24XX_GPIO_REVISION 0x
 #define OMAP24XX_GPIO_SYSCONFIG0x0010
 #define OMAP24XX_GPIO_SYSSTATUS0x0014
@@ -168,12 +175,22 @@ static struct gpio_bank gpio_bank_730[7] = {
 #endif
 
 #ifdef CONFIG_ARCH_OMAP24XX
-static struct gpio_bank gpio_bank_24xx[4] = {
-   { OMAP24XX_GPIO1_BASE, INT_24XX_GPIO_BANK1, IH_GPIO_BASE,   
METHOD_GPIO_24XX },
-   { OMAP24XX_GPIO2_BASE, INT_24XX_GPIO_BANK2, IH_GPIO_BASE + 32,  
METHOD_GPIO_24XX },
-   { OMAP24XX_GPIO3_BASE, INT_24XX_GPIO_BANK3, IH_GPIO_BASE + 64,  
METHOD_GPIO_24XX },
-   { OMAP24XX_GPIO4_BASE, INT_24XX_GPIO_BANK4, IH_GPIO_BASE + 96,  
METHOD_GPIO_24XX },
+
+static struct gpio_bank gpio_bank_242x[4] = {
+   { OMAP242X_GPIO1_BASE, INT_24XX_GPIO_BANK1, IH_GPIO_BASE,   
METHOD_GPIO_24XX },
+   { OMAP242X_GPIO2_BASE, INT_24XX_GPIO_BANK2, IH_GPIO_BASE + 32,  
METHOD_GPIO_24XX },
+   { OMAP242X_GPIO3_BASE, INT_24XX_GPIO_BANK3, IH_GPIO_BASE + 64,  
METHOD_GPIO_24XX },
+   { OMAP242X_GPIO4_BASE, INT_24XX_GPIO_BANK4, IH_GPIO_BASE + 96,  
METHOD_GPIO_24XX },
 };
+
+static struct gpio_bank gpio_bank_243x[5] = {
+   { OMAP243X_GPIO1_BASE, INT_24XX_GPIO_BANK1, IH_GPIO_BASE,   
METHOD_GPIO_24XX },
+   { OMAP243X_GPIO2_BASE, INT_24XX_GPIO_BANK2, IH_GPIO_BASE + 32,  
METHOD_GPIO_24XX },
+   { OMAP243X_GPIO3_BASE, INT_24XX_GPIO_BANK3, IH_GPIO_BASE + 64,  
METHOD_GPIO_24XX },
+   { OMAP243X_GPIO4_BASE, INT_24XX_GPIO_BANK4, IH_GPIO_BASE + 96,  
METHOD_GPIO_24XX },
+   { OMAP243X_GPIO5_BASE, INT_24XX_GPIO_BANK5, IH_GPIO_BASE + 128, 
METHOD_GPIO_24XX },
+};
+
 #endif
 
 static struct gpio_bank *gpio_bank;
@@ -1113,6 +1130,11 @@ static int initialized;
 static struct clk * gpio_ick;
 static struct clk * gpio_fck;
 
+#ifdef CONFIG_ARCH_OMAP2430
+static struct clk * gpio5_ick;
+static struct clk * gpio5_fck;
+#endif
+
 static int __init _omap_gpio_init(void)
 {
int i;
@@ -1138,7 +1160,25 @@ static int __init _omap_gpio_init(void)
printk(Could not get gpios_fck\n);
else
clk_enable(gpio_fck);
-   }
+
+   /*
+* On 2430 GPIO 5 uses CORE L4 ICLK
+*/
+#ifdef CONFIG_ARCH_OMAP2430
+   if (cpu_is_omap2430()) {
+   gpio5_ick = clk_get(NULL, gpio5_ick);
+   if (IS_ERR(gpio5_ick))
+   printk(Could not get gpio5_ick\n

[PATCH 9/10] ARM: OMAP: fix OMAP1 mpuio suspend/resume oops

2007-04-09 Thread Tony Lindgren
From: David Brownell [EMAIL PROTECTED]

Fix oops in omap16xx mpuio suspend/resume code; field wasn't initialized

Signed-off-by: David Brownell [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/plat-omap/gpio.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -1178,6 +1178,8 @@ static struct platform_device omap_mpuio_device = {
 
 static inline void mpuio_init(void)
 {
+   platform_set_drvdata(omap_mpuio_device, gpio_bank_1610[0]);
+
if (platform_driver_register(omap_mpuio_driver) == 0)
(void) platform_device_register(omap_mpuio_device);
 }
-- 
1.4.4.2

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3/10] ARM: OMAP: /sys/kernel/debug/omap_gpio

2007-04-09 Thread Tony Lindgren
From: David Brownell [EMAIL PROTECTED]

Add some GPIO debug support:  /sys/kernel/debug/omap_gpio dumps the state
of all GPIOs that have been claimed, including basic IRQ info if relevant.
Tested on 24xx, 16xx.

Includes minor bugfixes:  recording IRQ trigger mode (this should probably
be a genirq patch), adding missing space to non-wakeup warning

Signed-off-by: David Brownell [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/plat-omap/gpio.c |  130 -
 1 files changed, 129 insertions(+), 1 deletions(-)

--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -536,6 +536,10 @@ static int gpio_irq_type(unsigned irq, unsigned type)
bank = get_gpio_bank(gpio);
spin_lock(bank-lock);
retval = _set_gpio_triggering(bank, get_gpio_index(gpio), type);
+   if (retval == 0) {
+   irq_desc[irq].status = ~IRQ_TYPE_SENSE_MASK;
+   irq_desc[irq].status |= type;
+   }
spin_unlock(bank-lock);
return retval;
 }
@@ -702,7 +706,7 @@ static int _set_gpio_wakeup(struct gpio_bank *bank, int 
gpio, int enable)
spin_lock(bank-lock);
if (enable) {
if (bank-non_wakeup_gpios  (1  gpio)) {
-   printk(KERN_ERR Unable to enable wakeup on
+   printk(KERN_ERR Unable to enable wakeup on 
non-wakeup GPIO%d\n,
(bank - gpio_bank) * 32 + gpio);
spin_unlock(bank-lock);
@@ -1360,3 +1364,127 @@ EXPORT_SYMBOL(omap_set_gpio_dataout);
 EXPORT_SYMBOL(omap_get_gpio_datain);
 
 arch_initcall(omap_gpio_sysinit);
+
+
+#ifdef CONFIG_DEBUG_FS
+
+#include linux/debugfs.h
+#include linux/seq_file.h
+
+static int gpio_is_input(struct gpio_bank *bank, int mask)
+{
+   void __iomem *reg = bank-base;
+
+   switch (bank-method) {
+   case METHOD_MPUIO:
+   reg += OMAP_MPUIO_IO_CNTL;
+   break;
+   case METHOD_GPIO_1510:
+   reg += OMAP1510_GPIO_DIR_CONTROL;
+   break;
+   case METHOD_GPIO_1610:
+   reg += OMAP1610_GPIO_DIRECTION;
+   break;
+   case METHOD_GPIO_730:
+   reg += OMAP730_GPIO_DIR_CONTROL;
+   break;
+   case METHOD_GPIO_24XX:
+   reg += OMAP24XX_GPIO_OE;
+   break;
+   }
+   return __raw_readl(reg)  mask;
+}
+
+
+static int dbg_gpio_show(struct seq_file *s, void *unused)
+{
+   unsignedi, j, gpio;
+
+   for (i = 0, gpio = 0; i  gpio_bank_count; i++) {
+   struct gpio_bank*bank = gpio_bank + i;
+   unsignedbankwidth = 16;
+   u32 mask = 1;
+
+   if (!cpu_is_omap24xx()  bank-method == METHOD_MPUIO)
+   gpio = OMAP_MPUIO(0);
+   else if (cpu_is_omap24xx() || cpu_is_omap730())
+   bankwidth = 32;
+
+   for (j = 0; j  bankwidth; j++, gpio++, mask = 1) {
+   unsignedirq, value, is_in, irqstat;
+
+   if (!(bank-reserved_map  mask))
+   continue;
+
+   irq = bank-virtual_irq_start + j;
+   value = omap_get_gpio_datain(gpio);
+   is_in = gpio_is_input(bank, mask);
+
+   if (!cpu_is_omap24xx()  bank-method == METHOD_MPUIO)
+   seq_printf(s, MPUIO %2d: , j);
+   else
+   seq_printf(s, GPIO %3d: , gpio);
+   seq_printf(s, %s %s,
+   is_in ? in  : out,
+   value ? hi  : lo);
+
+   irqstat = irq_desc[irq].status;
+   if (is_in  ((bank-suspend_wakeup  mask)
+   || irqstat  IRQ_TYPE_SENSE_MASK)) {
+   char*trigger = NULL;
+
+   switch (irqstat  IRQ_TYPE_SENSE_MASK) {
+   case IRQ_TYPE_EDGE_FALLING:
+   trigger = falling;
+   break;
+   case IRQ_TYPE_EDGE_RISING:
+   trigger = rising;
+   break;
+   case IRQ_TYPE_EDGE_BOTH:
+   trigger = bothedge;
+   break;
+   case IRQ_TYPE_LEVEL_LOW:
+   trigger = low;
+   break;
+   case IRQ_TYPE_LEVEL_HIGH

[PATCH 4/10] ARM: OMAP: gpio init section cleanups

2007-04-09 Thread Tony Lindgren
From: David Brownell [EMAIL PROTECTED]

Minor GPIO cleanups:  remove needless #include, and omap_gpio_init()
should be __init, as well as all the board init code calling it.

Signed-off-by: David Brownell [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap1/board-fsample.c   |2 +-
 arch/arm/mach-omap1/board-h3.c|2 +-
 arch/arm/mach-omap1/board-innovator.c |2 +-
 arch/arm/mach-omap1/board-perseus2.c  |2 +-
 arch/arm/plat-omap/gpio.c |3 +--
 5 files changed, 5 insertions(+), 6 deletions(-)

--- a/arch/arm/mach-omap1/board-fsample.c
+++ b/arch/arm/mach-omap1/board-fsample.c
@@ -246,7 +246,7 @@ static void __init fsample_init_smc91x(void)
mdelay(50);
 }
 
-void omap_fsample_init_irq(void)
+static void __init omap_fsample_init_irq(void)
 {
omap1_init_common_hw();
omap_init_irq();
--- a/arch/arm/mach-omap1/board-h3.c
+++ b/arch/arm/mach-omap1/board-h3.c
@@ -455,7 +455,7 @@ static void __init h3_init_smc91x(void)
}
 }
 
-void h3_init_irq(void)
+static void __init h3_init_irq(void)
 {
omap1_init_common_hw();
omap_init_irq();
--- a/arch/arm/mach-omap1/board-innovator.c
+++ b/arch/arm/mach-omap1/board-innovator.c
@@ -308,7 +308,7 @@ static void __init innovator_init_smc91x(void)
}
 }
 
-void innovator_init_irq(void)
+static void __init innovator_init_irq(void)
 {
omap1_init_common_hw();
omap_init_irq();
--- a/arch/arm/mach-omap1/board-perseus2.c
+++ b/arch/arm/mach-omap1/board-perseus2.c
@@ -246,7 +246,7 @@ static void __init perseus2_init_smc91x(void)
mdelay(50);
 }
 
-void omap_perseus2_init_irq(void)
+static void __init omap_perseus2_init_irq(void)
 {
omap1_init_common_hw();
omap_init_irq();
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -13,7 +13,6 @@
 
 #include linux/init.h
 #include linux/module.h
-#include linux/sched.h
 #include linux/interrupt.h
 #include linux/ptrace.h
 #include linux/sysdev.h
@@ -1329,7 +1328,7 @@ void omap2_gpio_resume_after_retention(void)
  * This may get called early from board specific init
  * for boards that have interrupts routed via FPGA.
  */
-int omap_gpio_init(void)
+int __init omap_gpio_init(void)
 {
if (!initialized)
return _omap_gpio_init();
-- 
1.4.4.2

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 5/10] ARM: OMAP: gpio object shrinkage, cleanup

2007-04-09 Thread Tony Lindgren
From: David Brownell [EMAIL PROTECTED]

More GPIO/IRQ cleanup:

  - compile-time removal of much useless code
  * mpuio support on non-OMAP1.
  * 15xx/730/24xx gpio support on 1610
  * 15xx/730/16xx gpio support on 24xx
  * etc

  - remove all BUG() calls, which are always bad news ... replaced some
with normal fault reports for that call, others with WARN_ON(1).

  - small mpuio bugfix:  add missing set_type() method

Oh, and fix a minor merge issue: inode-u.generic_ip is now gone.

Signed-off-by: David Brownell [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/plat-omap/gpio.c |  166 +++--
 1 files changed, 130 insertions(+), 36 deletions(-)

--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -267,21 +267,34 @@ static void _set_gpio_direction(struct gpio_bank *bank, 
int gpio, int is_input)
u32 l;
 
switch (bank-method) {
+#ifdef CONFIG_ARCH_OMAP1
case METHOD_MPUIO:
reg += OMAP_MPUIO_IO_CNTL;
break;
+#endif
+#ifdef CONFIG_ARCH_OMAP15XX
case METHOD_GPIO_1510:
reg += OMAP1510_GPIO_DIR_CONTROL;
break;
+#endif
+#ifdef CONFIG_ARCH_OMAP16XX
case METHOD_GPIO_1610:
reg += OMAP1610_GPIO_DIRECTION;
break;
+#endif
+#ifdef CONFIG_ARCH_OMAP730
case METHOD_GPIO_730:
reg += OMAP730_GPIO_DIR_CONTROL;
break;
+#endif
+#ifdef CONFIG_ARCH_OMAP24XX
case METHOD_GPIO_24XX:
reg += OMAP24XX_GPIO_OE;
break;
+#endif
+   default:
+   WARN_ON(1);
+   return;
}
l = __raw_readl(reg);
if (is_input)
@@ -309,6 +322,7 @@ static void _set_gpio_dataout(struct gpio_bank *bank, int 
gpio, int enable)
u32 l = 0;
 
switch (bank-method) {
+#ifdef CONFIG_ARCH_OMAP1
case METHOD_MPUIO:
reg += OMAP_MPUIO_OUTPUT;
l = __raw_readl(reg);
@@ -317,6 +331,8 @@ static void _set_gpio_dataout(struct gpio_bank *bank, int 
gpio, int enable)
else
l = ~(1  gpio);
break;
+#endif
+#ifdef CONFIG_ARCH_OMAP15XX
case METHOD_GPIO_1510:
reg += OMAP1510_GPIO_DATA_OUTPUT;
l = __raw_readl(reg);
@@ -325,6 +341,8 @@ static void _set_gpio_dataout(struct gpio_bank *bank, int 
gpio, int enable)
else
l = ~(1  gpio);
break;
+#endif
+#ifdef CONFIG_ARCH_OMAP16XX
case METHOD_GPIO_1610:
if (enable)
reg += OMAP1610_GPIO_SET_DATAOUT;
@@ -332,6 +350,8 @@ static void _set_gpio_dataout(struct gpio_bank *bank, int 
gpio, int enable)
reg += OMAP1610_GPIO_CLEAR_DATAOUT;
l = 1  gpio;
break;
+#endif
+#ifdef CONFIG_ARCH_OMAP730
case METHOD_GPIO_730:
reg += OMAP730_GPIO_DATA_OUTPUT;
l = __raw_readl(reg);
@@ -340,6 +360,8 @@ static void _set_gpio_dataout(struct gpio_bank *bank, int 
gpio, int enable)
else
l = ~(1  gpio);
break;
+#endif
+#ifdef CONFIG_ARCH_OMAP24XX
case METHOD_GPIO_24XX:
if (enable)
reg += OMAP24XX_GPIO_SETDATAOUT;
@@ -347,8 +369,9 @@ static void _set_gpio_dataout(struct gpio_bank *bank, int 
gpio, int enable)
reg += OMAP24XX_GPIO_CLEARDATAOUT;
l = 1  gpio;
break;
+#endif
default:
-   BUG();
+   WARN_ON(1);
return;
}
__raw_writel(l, reg);
@@ -372,28 +395,37 @@ int omap_get_gpio_datain(int gpio)
void __iomem *reg;
 
if (check_gpio(gpio)  0)
-   return -1;
+   return -EINVAL;
bank = get_gpio_bank(gpio);
reg = bank-base;
switch (bank-method) {
+#ifdef CONFIG_ARCH_OMAP1
case METHOD_MPUIO:
reg += OMAP_MPUIO_INPUT_LATCH;
break;
+#endif
+#ifdef CONFIG_ARCH_OMAP15XX
case METHOD_GPIO_1510:
reg += OMAP1510_GPIO_DATA_INPUT;
break;
+#endif
+#ifdef CONFIG_ARCH_OMAP16XX
case METHOD_GPIO_1610:
reg += OMAP1610_GPIO_DATAIN;
break;
+#endif
+#ifdef CONFIG_ARCH_OMAP730
case METHOD_GPIO_730:
reg += OMAP730_GPIO_DATA_INPUT;
break;
+#endif
+#ifdef CONFIG_ARCH_OMAP24XX
case METHOD_GPIO_24XX:
reg += OMAP24XX_GPIO_DATAIN;
break;
+#endif
default:
-   BUG();
-   return -1;
+   return -EINVAL;
}
return (__raw_readl(reg)
 (1  get_gpio_index(gpio))) != 0;
@@ -443,6 +475,7 @@ static int _set_gpio_triggering(struct gpio_bank *bank, int 
gpio

[PATCH 8/10] ARM: OMAP: MPUIO wake updates

2007-04-09 Thread Tony Lindgren
From: David Brownell [EMAIL PROTECTED]

GPIO and MPUIO wake updates:

 - Hook MPUIOs into the irq wakeup framework too.  This uses a platform
   device to update irq enables during system sleep states, instead of
   a sys_device, since the latter is no longer needed for such things.

 - Also forward enable/disable irq wake requests to the relevant GPIO
   controller, so the top level IRQ dispatcher can (eventually) handle
   these wakeup events automatically if more than one GPIO pin needs to
   be a wakeup event source.

 - Minor tweak to the 24xx non-wakeup gpio stuff: no need to check such
   read-only data under the spinlock.

This assumes (maybe wrongly?) that only 16xx can do GPIO wakeup; without
a 15xx I can't test such stuff.

Also this expects the top level IRQ dispatcher to properly handle requests
to enable/disable irq wake, which is currently known to be wrong:  omap1
saves the flags but ignores them, omap2 doesn't even save it.  (Wakeup
events are, wrongly, hardwired in the relevant mach-omapX/pm.c file ...)
So MPUIO irqs won't yet trigger system wakeup.

Signed-off-by: David Brownell [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/plat-omap/gpio.c |   93 -
 1 files changed, 83 insertions(+), 10 deletions(-)

--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -773,29 +773,35 @@ static int _set_gpio_wakeup(struct gpio_bank *bank, int 
gpio, int enable)
 {
switch (bank-method) {
 #ifdef CONFIG_ARCH_OMAP16XX
+   case METHOD_MPUIO:
case METHOD_GPIO_1610:
spin_lock(bank-lock);
-   if (enable)
+   if (enable) {
bank-suspend_wakeup |= (1  gpio);
-   else
+   enable_irq_wake(bank-irq);
+   } else {
+   disable_irq_wake(bank-irq);
bank-suspend_wakeup = ~(1  gpio);
+   }
spin_unlock(bank-lock);
return 0;
 #endif
 #ifdef CONFIG_ARCH_OMAP24XX
case METHOD_GPIO_24XX:
+   if (bank-non_wakeup_gpios  (1  gpio)) {
+   printk(KERN_ERR Unable to modify wakeup on 
+   non-wakeup GPIO%d\n,
+   (bank - gpio_bank) * 32 + gpio);
+   return -EINVAL;
+   }
spin_lock(bank-lock);
if (enable) {
-   if (bank-non_wakeup_gpios  (1  gpio)) {
-   printk(KERN_ERR Unable to enable wakeup on 
-   non-wakeup GPIO%d\n,
-   (bank - gpio_bank) * 32 + gpio);
-   spin_unlock(bank-lock);
-   return -EINVAL;
-   }
bank-suspend_wakeup |= (1  gpio);
-   } else
+   enable_irq_wake(bank-irq);
+   } else {
+   disable_irq_wake(bank-irq);
bank-suspend_wakeup = ~(1  gpio);
+   }
spin_unlock(bank-lock);
return 0;
 #endif
@@ -,16 +1117,81 @@ static struct irq_chip mpuio_irq_chip = {
.mask   = mpuio_mask_irq,
.unmask = mpuio_unmask_irq,
.set_type   = gpio_irq_type,
+#ifdef CONFIG_ARCH_OMAP16XX
+   /* REVISIT: assuming only 16xx supports MPUIO wake events */
+   .set_wake   = gpio_wake_enable,
+#endif
 };
 
 
 #define bank_is_mpuio(bank)((bank)-method == METHOD_MPUIO)
 
+
+#ifdef CONFIG_ARCH_OMAP16XX
+
+#include linux/platform_device.h
+
+static int omap_mpuio_suspend_late(struct platform_device *pdev, pm_message_t 
mesg)
+{
+   struct gpio_bank*bank = platform_get_drvdata(pdev);
+   void __iomem*mask_reg = bank-base + OMAP_MPUIO_GPIO_MASKIT;
+
+   spin_lock(bank-lock);
+   bank-saved_wakeup = __raw_readl(mask_reg);
+   __raw_writel(0x  ~bank-suspend_wakeup, mask_reg);
+   spin_unlock(bank-lock);
+
+   return 0;
+}
+
+static int omap_mpuio_resume_early(struct platform_device *pdev)
+{
+   struct gpio_bank*bank = platform_get_drvdata(pdev);
+   void __iomem*mask_reg = bank-base + OMAP_MPUIO_GPIO_MASKIT;
+
+   spin_lock(bank-lock);
+   __raw_writel(bank-saved_wakeup, mask_reg);
+   spin_unlock(bank-lock);
+
+   return 0;
+}
+
+/* use platform_driver for this, now that there's no longer any
+ * point to sys_device (other than not disturbing old code).
+ */
+static struct platform_driver omap_mpuio_driver = {
+   .suspend_late   = omap_mpuio_suspend_late,
+   .resume_early   = omap_mpuio_resume_early,
+   .driver = {
+   .name   = mpuio,
+   },
+};
+
+static struct platform_device omap_mpuio_device = {
+   .name

[PATCH 7/10] ARM: OMAP: speed up gpio irq handling

2007-04-09 Thread Tony Lindgren
From: David Brownell [EMAIL PROTECTED]

Speedup and shrink GPIO irq handling code, by using a pointer
that's available in the irq_chip structure instead of calling
the get_gpio_bank() function.  On OMAP1 this saves 44 words,
most of which were in IRQ critical path methods.  Hey, every
few instructions help.

Signed-off-by: David Brownell [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/plat-omap/gpio.c |   17 +
 1 files changed, 9 insertions(+), 8 deletions(-)

--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -584,7 +584,7 @@ static int gpio_irq_type(unsigned irq, unsigned type)
 (type  (IRQ_TYPE_LEVEL_LOW|IRQ_TYPE_LEVEL_HIGH)))
return -EINVAL;
 
-   bank = get_gpio_bank(gpio);
+   bank = get_irq_chip_data(irq);
spin_lock(bank-lock);
retval = _set_gpio_triggering(bank, get_gpio_index(gpio), type);
if (retval == 0) {
@@ -823,7 +823,7 @@ static int gpio_wake_enable(unsigned int irq, unsigned int 
enable)
 
if (check_gpio(gpio)  0)
return -ENODEV;
-   bank = get_gpio_bank(gpio);
+   bank = get_irq_chip_data(irq);
retval = _set_gpio_wakeup(bank, get_gpio_index(gpio), enable);
 
return retval;
@@ -1038,7 +1038,7 @@ static void gpio_irq_handler(unsigned int irq, struct 
irq_desc *desc)
 static void gpio_irq_shutdown(unsigned int irq)
 {
unsigned int gpio = irq - IH_GPIO_BASE;
-   struct gpio_bank *bank = get_gpio_bank(gpio);
+   struct gpio_bank *bank = get_irq_chip_data(irq);
 
_reset_gpio(bank, gpio);
 }
@@ -1046,7 +1046,7 @@ static void gpio_irq_shutdown(unsigned int irq)
 static void gpio_ack_irq(unsigned int irq)
 {
unsigned int gpio = irq - IH_GPIO_BASE;
-   struct gpio_bank *bank = get_gpio_bank(gpio);
+   struct gpio_bank *bank = get_irq_chip_data(irq);
 
_clear_gpio_irqstatus(bank, gpio);
 }
@@ -1054,7 +1054,7 @@ static void gpio_ack_irq(unsigned int irq)
 static void gpio_mask_irq(unsigned int irq)
 {
unsigned int gpio = irq - IH_GPIO_BASE;
-   struct gpio_bank *bank = get_gpio_bank(gpio);
+   struct gpio_bank *bank = get_irq_chip_data(irq);
 
_set_gpio_irqenable(bank, gpio, 0);
 }
@@ -1063,7 +1063,7 @@ static void gpio_unmask_irq(unsigned int irq)
 {
unsigned int gpio = irq - IH_GPIO_BASE;
unsigned int gpio_idx = get_gpio_index(gpio);
-   struct gpio_bank *bank = get_gpio_bank(gpio);
+   struct gpio_bank *bank = get_irq_chip_data(irq);
 
_set_gpio_irqenable(bank, gpio_idx, 1);
 }
@@ -1092,7 +1092,7 @@ static void mpuio_ack_irq(unsigned int irq)
 static void mpuio_mask_irq(unsigned int irq)
 {
unsigned int gpio = OMAP_MPUIO(irq - IH_MPUIO_BASE);
-   struct gpio_bank *bank = get_gpio_bank(gpio);
+   struct gpio_bank *bank = get_irq_chip_data(irq);
 
_set_gpio_irqenable(bank, gpio, 0);
 }
@@ -1100,7 +1100,7 @@ static void mpuio_mask_irq(unsigned int irq)
 static void mpuio_unmask_irq(unsigned int irq)
 {
unsigned int gpio = OMAP_MPUIO(irq - IH_MPUIO_BASE);
-   struct gpio_bank *bank = get_gpio_bank(gpio);
+   struct gpio_bank *bank = get_irq_chip_data(irq);
 
_set_gpio_irqenable(bank, gpio, 1);
 }
@@ -1275,6 +1275,7 @@ static int __init _omap_gpio_init(void)
 #endif
for (j = bank-virtual_irq_start;
 j  bank-virtual_irq_start + gpio_count; j++) {
+   set_irq_chip_data(j, bank);
if (bank_is_mpuio(bank))
set_irq_chip(j, mpuio_irq_chip);
else
-- 
1.4.4.2

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 0/10] ARM: OMAP: GPIO code updates shared between OMAP1 and OMAP2

2007-04-09 Thread Tony Lindgren
* Tony Lindgren [EMAIL PROTECTED] [070409 17:01]:
 Hi,
 
 The following patch series contains GPIO updates for OMAP.
 
 This is take #2 of the earlier 90 patch mountain, which has
 been split into six smaller series.

Also please note that this series only has 9 patches total, not 10
like the subject says.

Tony
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 0/18] ARM: OMAP: Updates for common code shared between OMAP1 and OMAP2

2007-04-09 Thread Tony Lindgren
Hi,

The following patch series contains updates for common code
shared between OMAP1 and OMAP2

This is take #2 of the earlier 90 patch mountain, which has
been split into six smaller series.

Regards,

Tony

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/18] ARM: OMAP: Add DMA IRQ sanity checks

2007-04-09 Thread Tony Lindgren
From: Juha Yrjola [EMAIL PROTECTED]

Add DMA IRQ sanity checks

Signed-off-by: Juha Yrjola [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/plat-omap/dma.c |   25 ++---
 1 files changed, 18 insertions(+), 7 deletions(-)

--- a/arch/arm/plat-omap/dma.c
+++ b/arch/arm/plat-omap/dma.c
@@ -925,10 +925,17 @@ static int omap2_dma_handle_ch(int ch)
 {
u32 status = OMAP_DMA_CSR_REG(ch);
 
-   if (!status)
+   if (!status) {
+   if (printk_ratelimit())
+   printk(KERN_WARNING Spurious DMA IRQ for lch %d\n, 
ch);
return 0;
-   if (unlikely(dma_chan[ch].dev_id == -1))
+   }
+   if (unlikely(dma_chan[ch].dev_id == -1)) {
+   if (printk_ratelimit())
+   printk(KERN_WARNING IRQ %04x for non-allocated DMA
+   channel %d\n, status, ch);
return 0;
+   }
if (unlikely(status  OMAP_DMA_DROP_IRQ))
printk(KERN_INFO
   DMA synchronization event drop occurred with device 
@@ -959,11 +966,15 @@ static irqreturn_t omap2_dma_irq_handler(int irq, void 
*dev_id)
int i;
 
val = omap_readl(OMAP_DMA4_IRQSTATUS_L0);
-
-   for (i = 1; i = OMAP_LOGICAL_DMA_CH_COUNT; i++) {
-   int active = val  (1  (i - 1));
-   if (active)
-   omap2_dma_handle_ch(i - 1);
+   if (val == 0) {
+   if (printk_ratelimit())
+   printk(KERN_WARNING Spurious DMA IRQ\n);
+   return IRQ_HANDLED;
+   }
+   for (i = 0; i  OMAP_LOGICAL_DMA_CH_COUNT  val != 0; i++) {
+   if (val  1)
+   omap2_dma_handle_ch(i);
+   val = 1;
}
 
return IRQ_HANDLED;
-- 
1.4.4.2

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3/18] ARM: OMAP: FB: add controller platform data

2007-04-09 Thread Tony Lindgren
From: Imre Deak [EMAIL PROTECTED]

Add controller platform data

Signed-off-by: Imre Deak [EMAIL PROTECTED]
Signed-off-by: Juha Yrjola [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/plat-omap/fb.c|5 +
 include/asm-arm/arch-omap/omapfb.h |8 +---
 2 files changed, 10 insertions(+), 3 deletions(-)

--- a/arch/arm/plat-omap/fb.c
+++ b/arch/arm/plat-omap/fb.c
@@ -55,6 +55,11 @@ void omapfb_reserve_mem(void)
}
 }
 
+void omapfb_set_ctrl_platform_data(void *data)
+{
+   omapfb_config.ctrl_platform_data = data;
+}
+
 static inline int omap_init_fb(void)
 {
const struct omap_lcd_config *conf;
--- a/include/asm-arm/arch-omap/omapfb.h
+++ b/include/asm-arm/arch-omap/omapfb.h
@@ -292,8 +292,9 @@ struct omapfb_device {
 };
 
 struct omapfb_platform_data {
-   struct omap_lcd_config   lcd;
-   struct omap_fbmem_config fbmem;
+   struct omap_lcd_config  lcd;
+   struct omapfb_mem_desc  mem_desc;
+   void*ctrl_platform_data;
 };
 
 #define OMAPFB_EVENT_READY 1
@@ -317,8 +318,9 @@ extern int  omapfb_update_window_async(struct 
omapfb_update_window *win,
void (*callback)(void *),
void *callback_data);
 
-/* in arch/arm/plat-omap/devices.c */
+/* in arch/arm/plat-omap/fb.c */
 extern void omapfb_reserve_mem(void);
+extern void omapfb_set_ctrl_platform_data(void *pdata);
 
 #endif /* __KERNEL__ */
 
-- 
1.4.4.2

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/18] ARM: OMAP: Add function to print clock usecounts

2007-04-09 Thread Tony Lindgren
From: Juha Yrjola [EMAIL PROTECTED]

Useful for debugging power management code.

Signed-off-by: Juha Yrjola [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/plat-omap/clock.c |   35 +++
 1 files changed, 35 insertions(+), 0 deletions(-)

--- a/arch/arm/plat-omap/clock.c
+++ b/arch/arm/plat-omap/clock.c
@@ -33,6 +33,41 @@ static DEFINE_SPINLOCK(clockfw_lock);
 
 static struct clk_functions *arch_clock;
 
+#ifdef CONFIG_PM_DEBUG
+
+static void print_parents(struct clk *clk)
+{
+   struct clk *p;
+   int printed = 0;
+
+   list_for_each_entry(p, clocks, node) {
+   if (p-parent == clk  p-usecount) {
+   if (!clk-usecount  !printed) {
+   printk(MISMATCH: %s\n, clk-name);
+   printed = 1;
+   }
+   printk(\t%-15s\n, p-name);
+   }
+   }
+}
+
+void clk_print_usecounts(void)
+{
+   unsigned long flags;
+   struct clk *p;
+
+   spin_lock_irqsave(clockfw_lock, flags);
+   list_for_each_entry(p, clocks, node) {
+   if (p-usecount)
+   printk(%-15s: %d\n, p-name, p-usecount);
+   print_parents(p);
+
+   }
+   spin_unlock_irqrestore(clockfw_lock, flags);
+}
+
+#endif
+
 /*-
  * Standard clock functions defined in include/linux/clk.h
  *-*/
-- 
1.4.4.2

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 12/18] ARM: OMAP: Mostly cosmetic to sync up with linux-omap tree

2007-04-09 Thread Tony Lindgren
From: Tony Lindgren [EMAIL PROTECTED](none)

Mostly cosmetic to sync up with linux-omap tree

Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap1/Kconfig   |2 +-
 arch/arm/mach-omap2/devices.c |6 +++---
 arch/arm/plat-omap/devices.c  |4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

--- a/arch/arm/mach-omap1/Kconfig
+++ b/arch/arm/mach-omap1/Kconfig
@@ -46,7 +46,7 @@ config MACH_OMAP_H3
 config MACH_OMAP_OSK
bool TI OSK Support
depends on ARCH_OMAP1  ARCH_OMAP16XX
-   select TPS65010
+   select OMAP_MCBSP
help
  TI OMAP 5912 OSK (OMAP Starter Kit) board support. Say Y here
   if you have such a board.
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -24,7 +24,7 @@
 #include asm/arch/mux.h
 #include asm/arch/gpio.h
 
-#ifdefined(CONFIG_I2C_OMAP) || defined(CONFIG_I2C_OMAP_MODULE)
+#ifdefined(CONFIG_I2C_OMAP) || defined(CONFIG_I2C_OMAP_MODULE)
 
 #define OMAP2_I2C_BASE20x48072000
 #define OMAP2_I2C_INT2 57
@@ -42,8 +42,8 @@ static struct resource i2c_resources2[] = {
 };
 
 static struct platform_device omap_i2c_device2 = {
-.name   = i2c_omap,
-.id = 2,
+   .name   = i2c_omap,
+   .id = 2,
.num_resources  = ARRAY_SIZE(i2c_resources2),
.resource   = i2c_resources2,
 };
--- a/arch/arm/plat-omap/devices.c
+++ b/arch/arm/plat-omap/devices.c
@@ -112,8 +112,8 @@ static struct resource i2c_resources1[] = {
 /* DMA not used; works around erratum writing to non-empty i2c fifo */
 
 static struct platform_device omap_i2c_device1 = {
-.name   = i2c_omap,
-.id = 1,
+   .name   = i2c_omap,
+   .id = 1,
.num_resources  = ARRAY_SIZE(i2c_resources1),
.resource   = i2c_resources1,
 };
-- 
1.4.4.2

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 4/18] ARM: OMAP: h4 must have blinky leds!!

2007-04-09 Thread Tony Lindgren
From: David Brownell [EMAIL PROTECTED]

This adds generic support for the debug board LEDs used by most of
TI's OMAP reference boards, and board-specific support for the H4.

It's derived from the not-as-generic stuff used by OMAP1 H2/H3/P2.
Those should be able to switch easily to this version, and clean up
some of the omap1-specific code.

In addition to H4 support, one key improvement is supporting not just
the old ARM debug LED API (with timer and idle LEDs, plus four that
can be handy for kernel debugging), but it also supports the new
generic LED API (most useful for usermode stuff IMO).  Either or both
APIs can be enabled.

Signed-off-by: David Brownell [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap2/Kconfig |1 +
 arch/arm/mach-omap2/board-h4.c  |   14 ++
 arch/arm/plat-omap/Kconfig  |5 +
 arch/arm/plat-omap/Makefile |2 +-
 arch/arm/plat-omap/debug-leds.c |  319 +++
 5 files changed, 340 insertions(+), 1 deletions(-)

--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -20,6 +20,7 @@ config MACH_OMAP_GENERIC
 config MACH_OMAP_H4
bool OMAP 2420 H4 board
depends on ARCH_OMAP2  ARCH_OMAP24XX
+   select OMAP_DEBUG_LEDS if LEDS || LEDS_OMAP_DEBUG
 
 config MACH_OMAP_APOLLON
bool OMAP 2420 Apollon board
--- a/arch/arm/mach-omap2/board-h4.c
+++ b/arch/arm/mach-omap2/board-h4.c
@@ -266,12 +266,26 @@ static struct platform_device h4_lcd_device = {
.id = -1,
 };
 
+static struct resource h4_led_resources[] = {
+   [0] = {
+   .flags  = IORESOURCE_MEM,
+   },
+};
+
+static struct platform_device h4_led_device = {
+   .name   = omap_dbg_led,
+   .id = -1,
+   .num_resources  = ARRAY_SIZE(h4_led_resources),
+   .resource   = h4_led_resources,
+};
+
 static struct platform_device *h4_devices[] __initdata = {
h4_smc91x_device,
h4_flash_device,
h4_irda_device,
h4_kp_device,
h4_lcd_device,
+   h4_led_device,
 };
 
 static inline void __init h4_init_smc91x(void)
--- a/arch/arm/plat-omap/Kconfig
+++ b/arch/arm/plat-omap/Kconfig
@@ -19,6 +19,11 @@ endchoice
 
 comment OMAP Feature Selections
 
+config OMAP_DEBUG_LEDS
+   bool
+   help
+ For debug card leds on TI reference boards.
+
 config OMAP_RESET_CLOCKS
bool Reset unused clocks during boot
depends on ARCH_OMAP
--- a/arch/arm/plat-omap/Makefile
+++ b/arch/arm/plat-omap/Makefile
@@ -16,4 +16,4 @@ obj-$(CONFIG_ARCH_OMAP16XX) += ocpi.o
 
 obj-$(CONFIG_CPU_FREQ) += cpu-omap.o
 obj-$(CONFIG_OMAP_DM_TIMER) += dmtimer.o
-
+obj-$(CONFIG_OMAP_DEBUG_LEDS) += debug-leds.o
--- /dev/null
+++ b/arch/arm/plat-omap/debug-leds.c
@@ -0,0 +1,319 @@
+/*
+ * linux/arch/arm/plat-omap/debug-leds.c
+ *
+ * Copyright 2003 by Texas Instruments Incorporated
+ *
+ * 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.
+ */
+
+#include linux/init.h
+#include linux/platform_device.h
+#include linux/leds.h
+
+#include asm/io.h
+#include asm/hardware.h
+#include asm/leds.h
+#include asm/system.h
+#include asm/mach-types.h
+
+#include asm/arch/fpga.h
+#include asm/arch/gpio.h
+
+
+/* Many OMAP development platforms reuse the same debug board; these
+ * platforms include H2, H3, H4, and Perseus2.  There are 16 LEDs on the
+ * debug board (all green), accessed through FPGA registers.
+ *
+ * The surfer expansion board and H2 sample board also have two-color
+ * green+red LEDs (in parallel), used here for timer and idle indicators
+ * in preference to the ones on the debug board, for a Disco LED effect.
+ *
+ * This driver exports either the original ARM LED API, the new generic
+ * one, or both.
+ */
+
+static spinlock_t  lock;
+static struct h2p2_dbg_fpga __iomem*fpga;
+static u16 led_state, hw_led_state;
+
+
+#ifdef CONFIG_LEDS
+#define old_led_api()  1
+#else
+#define old_led_api()  0
+#endif
+
+#ifdef CONFIG_LEDS_OMAP_DEBUG
+#define new_led_api()  1
+#else
+#define new_led_api()  0
+#endif
+
+
+/*-*/
+
+/* original ARM debug LED API:
+ *  - timer and idle leds (some boards use non-FPGA leds here);
+ *  - up to 4 generic leds, easily accessed in-kernel (any context)
+ */
+
+#define GPIO_LED_RED   3
+#define GPIO_LED_GREEN OMAP_MPUIO(4)
+
+#define LED_STATE_ENABLED  0x01
+#define LED_STATE_CLAIMED  0x02
+#define LED_TIMER_ON   0x04
+
+#define GPIO_IDLE  GPIO_LED_GREEN
+#define GPIO_TIMER GPIO_LED_RED
+
+static void h2p2_dbg_leds_event(led_event_t evt)
+{
+   unsigned long flags;
+
+   spin_lock_irqsave(lock, flags);
+
+   if (!(led_state  LED_STATE_ENABLED)  evt != led_start

[PATCH 6/18] ARM: OMAP: Sync core code with linux-omap

2007-04-09 Thread Tony Lindgren
This patch syncs omap specific core code with linux-omap.
Most of the changes are needed to fix bitrot caused by
driver updates in linux-omap tree.

Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap1/Kconfig   |   17 ++--
 arch/arm/mach-omap1/Makefile  |5 +-
 arch/arm/mach-omap1/devices.c |   71 +--
 arch/arm/mach-omap2/Kconfig   |   27 +-
 arch/arm/mach-omap2/Makefile  |7 ++
 arch/arm/mach-omap2/devices.c |   60 +++-
 arch/arm/mach-omap2/gpmc.c|   12 ++-
 arch/arm/mach-omap2/io.c  |   24 +-
 arch/arm/plat-omap/Kconfig|8 ++
 arch/arm/plat-omap/Makefile   |   12 +++-
 arch/arm/plat-omap/common.c   |8 ++-
 arch/arm/plat-omap/devices.c  |   70 ++-
 arch/arm/plat-omap/dmtimer.c  |2 +-
 arch/arm/plat-omap/fb.c   |   72 
 arch/arm/plat-omap/sram.c |   77 ++---
 arch/arm/plat-omap/usb.c  |  199 
 16 files changed, 525 insertions(+), 146 deletions(-)

Index: linux-2.6/arch/arm/mach-omap1/Kconfig
===
--- linux-2.6.orig/arch/arm/mach-omap1/Kconfig  2007-04-06 09:00:28.0 
-0400
+++ linux-2.6/arch/arm/mach-omap1/Kconfig   2007-04-09 14:40:23.0 
-0400
@@ -22,6 +22,7 @@ comment OMAP Board Type
 config MACH_OMAP_INNOVATOR
bool TI Innovator
depends on ARCH_OMAP1  (ARCH_OMAP15XX || ARCH_OMAP16XX)
+   select OMAP_MCBSP
help
   TI OMAP 1510 or 1610 Innovator board support. Say Y here if you
   have such a board.
@@ -29,6 +30,7 @@ config MACH_OMAP_INNOVATOR
 config MACH_OMAP_H2
bool TI H2 Support
depends on ARCH_OMAP1  ARCH_OMAP16XX
+   select OMAP_MCBSP
help
  TI OMAP 1610/1611B H2 board support. Say Y here if you have such
  a board.
@@ -36,6 +38,7 @@ config MACH_OMAP_H2
 config MACH_OMAP_H3
bool TI H3 Support
depends on ARCH_OMAP1  ARCH_OMAP16XX
+   select GPIOEXPANDER_OMAP
help
  TI OMAP 1710 H3 board support. Say Y here if you have such
  a board.
Index: linux-2.6/arch/arm/mach-omap1/Makefile
===
--- linux-2.6.orig/arch/arm/mach-omap1/Makefile 2007-04-06 09:00:28.0 
-0400
+++ linux-2.6/arch/arm/mach-omap1/Makefile  2007-04-09 14:40:23.0 
-0400
@@ -37,4 +37,3 @@ led-$(CONFIG_MACH_OMAP_INNOVATOR) += led
 led-$(CONFIG_MACH_OMAP_PERSEUS2)   += leds-h2p2-debug.o
 led-$(CONFIG_MACH_OMAP_OSK)+= leds-osk.o
 obj-$(CONFIG_LEDS) += $(led-y)
-
Index: linux-2.6/arch/arm/mach-omap1/devices.c
===
--- linux-2.6.orig/arch/arm/mach-omap1/devices.c2007-04-06 
09:00:28.0 -0400
+++ linux-2.6/arch/arm/mach-omap1/devices.c 2007-04-09 14:40:23.0 
-0400
@@ -24,35 +24,6 @@
 #include asm/arch/mux.h
 #include asm/arch/gpio.h
 
-#ifdefined(CONFIG_OMAP1610_IR) || defined(CONFIG_OMAP161O_IR_MODULE)
-
-static u64 irda_dmamask = 0x;
-
-static struct platform_device omap1610ir_device = {
-   .name = omap1610-ir,
-   .id = -1,
-   .dev = {
-   .dma_mask   = irda_dmamask,
-   },
-};
-
-static void omap_init_irda(void)
-{
-   /* FIXME define and use a boot tag, members something like:
-*  u8  uart;   // uart1, or uart3
-* ... but driver only handles uart3 for now
-*  s16 fir_sel;// gpio for SIR vs FIR
-* ... may prefer a callback for SIR/MIR/FIR mode select;
-* while h2 uses a GPIO, H3 uses a gpio expander
-*/
-   if (machine_is_omap_h2()
-   || machine_is_omap_h3())
-   (void) platform_device_register(omap1610ir_device);
-}
-#else
-static inline void omap_init_irda(void) {}
-#endif
-
 /*-*/
 
 #if defined(CONFIG_RTC_DRV_OMAP) || defined(CONFIG_RTC_DRV_OMAP_MODULE)
@@ -90,6 +61,45 @@ static void omap_init_rtc(void)
 static inline void omap_init_rtc(void) {}
 #endif
 
+#if defined(CONFIG_OMAP_DSP) || defined(CONFIG_OMAP_DSP_MODULE)
+
+#if defined(CONFIG_ARCH_OMAP15XX)
+#  define OMAP1_MBOX_SIZE  0x23
+#  define INT_DSP_MAILBOX1 INT_1510_DSP_MAILBOX1
+#elif defined(CONFIG_ARCH_OMAP16XX)
+#  define OMAP1_MBOX_SIZE  0x2f
+#  define INT_DSP_MAILBOX1 INT_1610_DSP_MAILBOX1
+#endif
+
+#define OMAP1_MBOX_BASEIO_ADDRESS(OMAP16XX_MAILBOX_BASE)
+
+static struct resource mbox_resources[] = {
+   {
+   .start  = OMAP1_MBOX_BASE,
+   .end= OMAP1_MBOX_BASE + OMAP1_MBOX_SIZE,
+   .flags  = IORESOURCE_MEM,
+   },
+   {
+   .start  = INT_DSP_MAILBOX1,
+   .flags  = IORESOURCE_IRQ,
+   },
+};
+
+static

[PATCH 5/18] ARM: OMAP: Sync headers with linux-omap

2007-04-09 Thread Tony Lindgren
This patch syncs omap specific headers with linux-omap.
Most of the changes needed because of bitrot caused by
driver changes in linux-omap tree. Integrating this
is needed for adding support for various omap drivers.

Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 include/asm-arm/arch-omap/aic23.h |4 +-
 include/asm-arm/arch-omap/board-apollon.h |9 -
 include/asm-arm/arch-omap/board-h4.h  |3 -
 include/asm-arm/arch-omap/board.h |   41 +++--
 include/asm-arm/arch-omap/dsp.h   |  250 -
 include/asm-arm/arch-omap/dsp_common.h|   32 ++--
 include/asm-arm/arch-omap/gpio-switch.h   |   54 ++
 include/asm-arm/arch-omap/gpmc.h  |2 +
 include/asm-arm/arch-omap/hardware.h  |9 +
 include/asm-arm/arch-omap/io.h|   11 ++
 include/asm-arm/arch-omap/irqs.h  |   19 ++-
 include/asm-arm/arch-omap/lcd_lph8923.h   |   14 --
 include/asm-arm/arch-omap/lcd_mipid.h |   24 +++
 include/asm-arm/arch-omap/led.h   |   24 +++
 include/asm-arm/arch-omap/mcspi.h |1 -
 include/asm-arm/arch-omap/memory.h|   13 ++
 include/asm-arm/arch-omap/menelaus.h  |   17 ++-
 include/asm-arm/arch-omap/omap16xx.h  |   12 +-
 include/asm-arm/arch-omap/omap24xx.h  |9 +
 include/asm-arm/arch-omap/omapfb.h|  131 +--
 include/asm-arm/arch-omap/sram.h  |4 +-
 include/asm-arm/arch-omap/usb.h   |   40 -
 22 files changed, 334 insertions(+), 389 deletions(-)

Index: linux-2.6/include/asm-arm/arch-omap/aic23.h
===
--- linux-2.6.orig/include/asm-arm/arch-omap/aic23.h2007-04-06 
09:00:28.0 -0400
+++ linux-2.6/include/asm-arm/arch-omap/aic23.h 2007-04-09 14:22:43.0 
-0400
@@ -110,7 +110,7 @@
 #define TLV320AIC23ID1  (0x1a) // cs low
 #define TLV320AIC23ID2  (0x1b) // cs high
 
-void tlv320aic23_power_up(void);
-void tlv320aic23_power_down(void);
+void aic23_power_up(void);
+void aic23_power_down(void);
 
 #endif /* __ASM_ARCH_AIC23_H */
Index: linux-2.6/include/asm-arm/arch-omap/board-apollon.h
===
--- linux-2.6.orig/include/asm-arm/arch-omap/board-apollon.h2007-04-06 
09:00:28.0 -0400
+++ linux-2.6/include/asm-arm/arch-omap/board-apollon.h 2007-04-09 
14:22:43.0 -0400
@@ -30,16 +30,7 @@
 #define __ASM_ARCH_OMAP_APOLLON_H
 
 /* Placeholder for APOLLON specific defines */
-/* GPMC CS0 */
-#define APOLLON_CS0_BASE   0x
-/* GPMC CS1 */
-#define APOLLON_CS1_BASE   0x0800
-#define APOLLON_ETHR_START (APOLLON_CS1_BASE + 0x300)
 #define APOLLON_ETHR_GPIO_IRQ  74
-/* GPMC CS2 - reserved for OneNAND */
-#define APOLLON_CS2_BASE   0x1000
-/* GPMC CS3 - reserved for NOR or NAND */
-#define APOLLON_CS3_BASE   0x1800
 
 #endif /*  __ASM_ARCH_OMAP_APOLLON_H */
 
Index: linux-2.6/include/asm-arm/arch-omap/board-h4.h
===
--- linux-2.6.orig/include/asm-arm/arch-omap/board-h4.h 2007-04-06 
09:00:28.0 -0400
+++ linux-2.6/include/asm-arm/arch-omap/board-h4.h  2007-04-09 
14:22:43.0 -0400
@@ -30,9 +30,6 @@
 #define __ASM_ARCH_OMAP_H4_H
 
 /* Placeholder for H4 specific defines */
-/* GPMC CS1 */
-#define OMAP24XX_ETHR_START 0x08000300
 #define OMAP24XX_ETHR_GPIO_IRQ 92
-#define H4_CS0_BASE0x0400
 #endif /*  __ASM_ARCH_OMAP_H4_H */
 
Index: linux-2.6/include/asm-arm/arch-omap/board.h
===
--- linux-2.6.orig/include/asm-arm/arch-omap/board.h2007-04-06 
09:00:28.0 -0400
+++ linux-2.6/include/asm-arm/arch-omap/board.h 2007-04-09 14:22:43.0 
-0400
@@ -12,6 +12,8 @@
 
 #include linux/types.h
 
+#include asm/arch/gpio-switch.h
+
 /* Different peripheral ids */
 #define OMAP_TAG_CLOCK 0x4f01
 #define OMAP_TAG_MMC   0x4f02
@@ -99,26 +101,31 @@ struct omap_usb_config {
 struct omap_lcd_config {
char panel_name[16];
char ctrl_name[16];
+   s16  nreset_gpio;
+   u8   data_lines;
+};
+
+struct device;
+struct fb_info;
+struct omap_backlight_config {
+   int default_intensity;
+   int (*set_power)(struct device *dev, int state);
+   int (*check_fb)(struct fb_info *fb);
 };
 
 struct omap_fbmem_config {
-   u32 fb_sram_start;
-   u32 fb_sram_size;
-   u32 fb_sdram_start;
-   u32 fb_sdram_size;
-};
-
-/* Cover:
- *  high - closed
- *  low  - open
- * Connection:
- *  high - connected
- *  low  - disconnected
- */
-#define OMAP_GPIO_SWITCH_TYPE_COVER0x
-#define OMAP_GPIO_SWITCH_TYPE_CONNECTION   0x0001
-#define OMAP_GPIO_SWITCH_FLAG_INVERTED 0x0001
-#define OMAP_GPIO_SWITCH_FLAG_OUTPUT

[PATCH 17/18] ARM: OMAP: restore CONFIG_GENERIC_TIME

2007-04-09 Thread Tony Lindgren
From: David Brownell [EMAIL PROTECTED]

Somehow this got lost in a merge ...

Signed-off-by: David Brownell [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/Kconfig |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -363,6 +363,7 @@ config ARCH_LH7A40X
 config ARCH_OMAP
bool TI OMAP
select GENERIC_GPIO
+   select GENERIC_TIME
help
  Support for TI's OMAP platform (OMAP1 and OMAP2).
 
-- 
1.4.4.2

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 16/18] ARM: OMAP: partial LED fixes

2007-04-09 Thread Tony Lindgren
From: David Brownell [EMAIL PROTECTED]

Partial fix for CONFIG_LEDS breakage ... at least allow platforms
using the debug-leds support (H4 for now) to build with the generic
LED support, and default the LED that would be the timer LED to
trigger using the heartbeat (timer driven, rate depends on load).

Right now only H2 and P2 seem to have working LED support; this
at least makes H4 less broken.

Signed-off-by: David Brownell [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/plat-omap/debug-leds.c |   17 ++---
 1 files changed, 6 insertions(+), 11 deletions(-)

--- a/arch/arm/plat-omap/debug-leds.c
+++ b/arch/arm/plat-omap/debug-leds.c
@@ -39,12 +39,6 @@ static struct h2p2_dbg_fpga __iomem  *fpga;
 static u16 led_state, hw_led_state;
 
 
-#ifdef CONFIG_LEDS
-#define old_led_api()  1
-#else
-#define old_led_api()  0
-#endif
-
 #ifdef CONFIG_LEDS_OMAP_DEBUG
 #define new_led_api()  1
 #else
@@ -202,7 +196,8 @@ struct dbg_led {
 static struct dbg_led dbg_leds[] = {
/* REVISIT at least H2 uses different timer  cpu leds... */
 #ifndef CONFIG_LEDS_TIMER
-   { .mask = 1  0,  .cdev.name =  d4:green, }, /* timer */
+   { .mask = 1  0,  .cdev.name =  d4:green,
+   .cdev.default_trigger = heartbeat, },
 #endif
 #ifndef CONFIG_LEDS_CPU
{ .mask = 1  1,  .cdev.name =  d5:green, }, /* !idle */
@@ -274,10 +269,10 @@ static int /* __init */ fpga_probe(struct platform_device 
*pdev)
fpga = ioremap(iomem-start, H2P2_DBG_FPGA_SIZE);
__raw_writew(~0, fpga-leds);
 
-   if (old_led_api()) {
-   leds_event = h2p2_dbg_leds_event;
-   leds_event(led_start);
-   }
+#ifdef CONFIG_LEDS
+   leds_event = h2p2_dbg_leds_event;
+   leds_event(led_start);
+#endif
 
if (new_led_api()) {
newled_init(pdev-dev);
-- 
1.4.4.2

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 18/18] ARM: OMAP: Fix GCC-reported compile time bug

2007-04-09 Thread Tony Lindgren
From: David Brownell [EMAIL PROTECTED]

Fix GCC-reported compile time bug which prevents booting
when the framebuffer code is disabled.

Signed-off-by: David Brownell [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/plat-omap/fb.c |5 -
 1 files changed, 4 insertions(+), 1 deletions(-)

--- a/arch/arm/plat-omap/fb.c
+++ b/arch/arm/plat-omap/fb.c
@@ -333,7 +333,10 @@ unsigned long omapfb_reserve_sram(unsign
  unsigned long sram_vstart,
  unsigned long sram_size,
  unsigned long start_avail,
- unsigned long size_avail) {}
+ unsigned long size_avail)
+{
+   return 0;
+}
 
 
 #endif

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 0/6] ARM: OMAP: Updates for OMAP1 common code

2007-04-09 Thread Tony Lindgren
Hi,

The following patch series contains updates OMAP1 common
code.

This is take #2 of the earlier 90 patch mountain, which has
been split into six smaller series.

Regards,

Tony

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 7/18] ARM: OMAP: Avoid updating system time for sub-jiffy interrupts

2007-04-09 Thread Tony Lindgren
Updating system time and reprogramming timer can cause latency
issues on busy systems with lots of interrupts with constant
updating of time and reprogramming the system timer.

If a non-timer dyntick interrupt happens within a jiffy from
the last interrupt, updating time and reprogramming the timer
is unnecessary as we will get a timer interrupt soon anyways.

Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/plat-omap/timer32k.c |   11 +++
 1 files changed, 11 insertions(+), 0 deletions(-)

--- a/arch/arm/plat-omap/timer32k.c
+++ b/arch/arm/plat-omap/timer32k.c
@@ -219,6 +219,17 @@ static inline irqreturn_t _omap_32k_timer_interrupt(int 
irq, void *dev_id)
 
 static irqreturn_t omap_32k_timer_handler(int irq, void *dev_id)
 {
+   unsigned long now;
+
+   now = omap_32k_sync_timer_read();
+
+   /* Don't bother reprogramming timer if last tick was before next
+* jiffie. We will get another interrupt when previously programmed
+* timer expires. This cuts down interrupt load quite a bit.
+*/
+   if (now - omap_32k_last_tick  OMAP_32K_TICKS_PER_HZ)
+   return IRQ_HANDLED;
+
return _omap_32k_timer_interrupt(irq, dev_id);
 }
 
-- 
1.4.4.2

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 9/18] ARM: OMAP: Fix gpmc header

2007-04-09 Thread Tony Lindgren
Fix gpmc header

Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 include/asm-arm/arch-omap/gpmc.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Index: linux-2.6/include/asm-arm/arch-omap/gpmc.h
===
--- linux-2.6.orig/include/asm-arm/arch-omap/gpmc.h 2007-04-09 
14:22:43.0 -0400
+++ linux-2.6/include/asm-arm/arch-omap/gpmc.h  2007-04-09 14:46:49.0 
-0400
@@ -87,7 +87,7 @@ extern int gpmc_cs_calc_divider(int cs, 
 extern int gpmc_cs_set_timings(int cs, const struct gpmc_timings *t);
 extern int gpmc_cs_request(int cs, unsigned long size, unsigned long *base);
 extern void gpmc_cs_free(int cs);
-extern void gpmc_cs_set_reserved(int cs, int reserved);
+extern int gpmc_cs_set_reserved(int cs, int reserved);
 extern int gpmc_cs_reserved(int cs);
 
 #endif
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 14/18] ARM: OMAP: FB sync with N800 tree (support for dynamic SRAM allocations)

2007-04-09 Thread Tony Lindgren
From: Imre Deak [EMAIL PROTECTED]

- in addition to fixed FB regions - as passed by the bootloader -
  allow dynamic allocations
- do some more checking against overlapping / reserved regions
- move the FB specific parts out from sram.c to fb.c

Signed-off-by: Imre Deak [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap1/io.c |4 +-
 arch/arm/mach-omap2/io.c |3 +-
 arch/arm/plat-omap/fb.c  |  271 +
 arch/arm/plat-omap/sram.c|   60 ++---
 include/asm-arm/arch-omap/sram.h |3 -
 5 files changed, 256 insertions(+), 85 deletions(-)

Index: linux-2.6/arch/arm/mach-omap1/io.c
===
--- linux-2.6.orig/arch/arm/mach-omap1/io.c 2007-04-05 15:33:53.0 
-0400
+++ linux-2.6/arch/arm/mach-omap1/io.c  2007-04-09 14:47:05.0 -0400
@@ -17,11 +17,11 @@
 #include asm/io.h
 #include asm/arch/mux.h
 #include asm/arch/tc.h
-#include asm/arch/omapfb.h
 
 extern int omap1_clk_init(void);
 extern void omap_check_revision(void);
 extern void omap_sram_init(void);
+extern void omapfb_reserve_sdram(void);
 
 /*
  * The machine specific code may provide the extra mapping besides the
@@ -121,7 +121,7 @@ void __init omap1_map_common_io(void)
 #endif
 
omap_sram_init();
-   omapfb_reserve_mem();
+   omapfb_reserve_sdram();
 }
 
 /*
Index: linux-2.6/arch/arm/mach-omap2/io.c
===
--- linux-2.6.orig/arch/arm/mach-omap2/io.c 2007-04-09 14:40:23.0 
-0400
+++ linux-2.6/arch/arm/mach-omap2/io.c  2007-04-09 14:47:05.0 -0400
@@ -27,6 +27,7 @@ extern void omap_sram_init(void);
 extern int omap2_clk_init(void);
 extern void omap2_check_revision(void);
 extern void gpmc_init(void);
+extern void omapfb_reserve_sdram(void);
 
 /*
  * The machine specific code may provide the extra mapping besides the
@@ -72,7 +73,7 @@ void __init omap2_map_common_io(void)
 
omap2_check_revision();
omap_sram_init();
-   omapfb_reserve_mem();
+   omapfb_reserve_sdram();
 }
 
 void __init omap2_init_common_hw(void)
Index: linux-2.6/arch/arm/plat-omap/fb.c
===
--- linux-2.6.orig/arch/arm/plat-omap/fb.c  2007-04-09 14:40:23.0 
-0400
+++ linux-2.6/arch/arm/plat-omap/fb.c   2007-04-09 14:47:05.0 -0400
@@ -39,6 +39,8 @@
 #if defined(CONFIG_FB_OMAP) || defined(CONFIG_FB_OMAP_MODULE)
 
 static struct omapfb_platform_data omapfb_config;
+static int config_invalid;
+static int configured_regions;
 
 static u64 omap_fb_dma_mask = ~(u32)0;
 
@@ -53,46 +55,246 @@ static struct platform_device omap_fb_de
.num_resources = 0,
 };
 
-/* called from map_io */
-void omapfb_reserve_mem(void)
+static inline int ranges_overlap(unsigned long start1, unsigned long size1,
+unsigned long start2, unsigned long size2)
 {
-   const struct omap_fbmem_config *fbmem_conf;
-   unsigned long total_size;
+   return (start1 = start2  start1  start2 + size2) ||
+  (start2 = start1  start2  start1 + size1);
+}
+
+static inline int range_included(unsigned long start1, unsigned long size1,
+unsigned long start2, unsigned long size2)
+{
+   return start1 = start2  start1 + size1 = start2 + size2;
+}
+
+
+/* Check if there is an overlapping region. */
+static int fbmem_region_reserved(unsigned long start, size_t size)
+{
+   struct omapfb_mem_region *rg;
int i;
 
-   if (!omap_fb_sram_valid) {
-   /* FBMEM SRAM configuration was already found to be invalid.
-* Ignore the whole configuration block. */
-   omapfb_config.mem_desc.region_cnt = 0;
-   return;
+   rg = omapfb_config.mem_desc.region[0];
+   for (i = 0; i  OMAPFB_PLANE_NUM; i++, rg++) {
+   if (!rg-paddr)
+   /* Empty slot. */
+   continue;
+   if (ranges_overlap(start, size, rg-paddr, rg-size))
+   return 1;
}
+   return 0;
+}
 
-   i = 0;
-   total_size = 0;
-   while ((fbmem_conf = omap_get_nr_config(OMAP_TAG_FBMEM,
-   struct omap_fbmem_config, i)) != NULL) {
-   unsigned long start;
-   unsigned long size;
+/*
+ * Get the region_idx`th region from board config/ATAG and convert it to
+ * our internal format.
+ */
+static int get_fbmem_region(int region_idx, struct omapfb_mem_region *rg)
+{
+   const struct omap_fbmem_config  *conf;
+   u32 paddr;
 
-   if (i == OMAPFB_PLANE_NUM) {
-   printk(KERN_ERR ignoring extra plane info\n);
+   conf = omap_get_nr_config(OMAP_TAG_FBMEM,
+ struct omap_fbmem_config, region_idx

[PATCH 3/6] ARM: OMAP: add SoSSI clock

2007-04-09 Thread Tony Lindgren
From: Imre Deak [EMAIL PROTECTED]

This is needed, so that disabling the SoSSI clock during idle can
be prevented.

Signed-off-by: Imre Deak [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap1/clock.c |   34 ++
 arch/arm/mach-omap1/clock.h |   21 +++--
 2 files changed, 53 insertions(+), 2 deletions(-)

--- a/arch/arm/mach-omap1/clock.c
+++ b/arch/arm/mach-omap1/clock.c
@@ -49,6 +49,15 @@ static void omap1_uart_recalc(struct clk * clk)
clk-rate = 1200;
 }
 
+static void omap1_sossi_recalc(struct clk *clk)
+{
+   u32 div = omap_readl(MOD_CONF_CTRL_1);
+
+   div = (div  17)  0x7;
+   div++;
+   clk-rate = clk-parent-rate / div;
+}
+
 static int omap1_clk_enable_dsp_domain(struct clk *clk)
 {
int retval;
@@ -396,6 +405,31 @@ static int omap1_set_ext_clk_rate(struct clk * clk, 
unsigned long rate)
return 0;
 }
 
+static int omap1_set_sossi_rate(struct clk *clk, unsigned long rate)
+{
+   u32 l;
+   int div;
+   unsigned long p_rate;
+
+   p_rate = clk-parent-rate;
+   /* Round towards slower frequency */
+   div = (p_rate + rate - 1) / rate;
+   div--;
+   if (div  0 || div  7)
+   return -EINVAL;
+
+   l = omap_readl(MOD_CONF_CTRL_1);
+   l = ~(7  17);
+   l |= div  17;
+   omap_writel(l, MOD_CONF_CTRL_1);
+
+   clk-rate = p_rate / (div + 1);
+   if (unlikely(clk-flags  RATE_PROPAGATES))
+   propagate_rate(clk);
+
+   return 0;
+}
+
 static long omap1_round_ext_clk_rate(struct clk * clk, unsigned long rate)
 {
return 9600 / calc_ext_dsor(rate);
--- a/arch/arm/mach-omap1/clock.h
+++ b/arch/arm/mach-omap1/clock.h
@@ -17,6 +17,8 @@ static int omap1_clk_enable_generic(struct clk * clk);
 static void omap1_clk_disable_generic(struct clk * clk);
 static void omap1_ckctl_recalc(struct clk * clk);
 static void omap1_watchdog_recalc(struct clk * clk);
+static int omap1_set_sossi_rate(struct clk *clk, unsigned long rate);
+static void omap1_sossi_recalc(struct clk *clk);
 static void omap1_ckctl_recalc_dsp_domain(struct clk * clk);
 static int omap1_clk_enable_dsp_domain(struct clk * clk);
 static int omap1_clk_set_rate_dsp_domain(struct clk * clk, unsigned long rate);
@@ -168,9 +170,10 @@ static struct clk ck_dpll1 = {
 
 static struct arm_idlect1_clk ck_dpll1out = {
.clk = {
-   .name   = ck_dpll1out,
+   .name   = ck_dpll1out,
.parent = ck_dpll1,
-   .flags  = CLOCK_IN_OMAP16XX | CLOCK_IDLE_CONTROL,
+   .flags  = CLOCK_IN_OMAP16XX | CLOCK_IDLE_CONTROL |
+ ENABLE_REG_32BIT | RATE_PROPAGATES,
.enable_reg = (void __iomem *)ARM_IDLECT2,
.enable_bit = EN_CKOUT_ARM,
.recalc = followparent_recalc,
@@ -180,6 +183,19 @@ static struct arm_idlect1_clk ck_dpll1out = {
.idlect_shift   = 12,
 };
 
+static struct clk sossi_ck = {
+   .name   = ck_sossi,
+   .parent = ck_dpll1out.clk,
+   .flags  = CLOCK_IN_OMAP16XX | CLOCK_NO_IDLE_PARENT |
+ ENABLE_REG_32BIT,
+   .enable_reg = (void __iomem *)MOD_CONF_CTRL_1,
+   .enable_bit = 16,
+   .recalc = omap1_sossi_recalc,
+   .set_rate   = omap1_set_sossi_rate,
+   .enable = omap1_clk_enable_generic,
+   .disable= omap1_clk_disable_generic,
+};
+
 static struct clk arm_ck = {
.name   = arm_ck,
.parent = ck_dpll1,
@@ -760,6 +776,7 @@ static struct clk * onchip_clks[] = {
ck_dpll1,
/* CK_GEN1 clocks */
ck_dpll1out.clk,
+   sossi_ck,
arm_ck,
armper_ck.clk,
arm_gpio_ck,
-- 
1.4.4.2

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 4/6] ARM: OMAP: add SoSSI clock (remove manual checking of SoSSI state from idle)

2007-04-09 Thread Tony Lindgren
From: Imre Deak [EMAIL PROTECTED]

The SoSSI driver should already take care of this by enabling / disabling
its clock when necessary, so this legacy callout from the PM idle code
is not needed any more.

Signed-off-by: Imre Deak [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap1/pm.c|5 +
 arch/arm/plat-omap/dma.c|6 --
 include/asm-arm/arch-omap/dma.h |1 -
 3 files changed, 1 insertions(+), 11 deletions(-)

Index: linux-2.6/arch/arm/mach-omap1/pm.c
===
--- linux-2.6.orig/arch/arm/mach-omap1/pm.c 2007-04-09 16:38:12.0 
-0400
+++ linux-2.6/arch/arm/mach-omap1/pm.c  2007-04-09 16:39:10.0 -0400
@@ -155,11 +155,8 @@ void omap_pm_idle(void)
use_idlect1 = omap_dm_timer_modify_idlect_mask(use_idlect1);
 #endif
 
-   if (omap_dma_running()) {
+   if (omap_dma_running())
use_idlect1 = ~(1  6);
-   if (omap_lcd_dma_ext_running())
-   use_idlect1 = ~(1  12);
-   }
 
/* We should be able to remove the do_sleep variable and multiple
 * tests above as soon as drivers, timer and DMA code have been fixed.
Index: linux-2.6/arch/arm/plat-omap/dma.c
===
--- linux-2.6.orig/arch/arm/plat-omap/dma.c 2007-04-09 16:39:05.0 
-0400
+++ linux-2.6/arch/arm/plat-omap/dma.c  2007-04-09 16:39:10.0 -0400
@@ -1347,11 +1347,6 @@ void omap_stop_lcd_dma(void)
omap_writew(w, OMAP1610_DMA_LCD_CTRL);
 }
 
-int omap_lcd_dma_ext_running(void)
-{
-   return lcd_dma.ext_ctrl  lcd_dma.active;
-}
-
 
/**/
 
 static int __init omap_init_dma(void)
@@ -1493,7 +1488,6 @@ EXPORT_SYMBOL(omap_free_lcd_dma);
 EXPORT_SYMBOL(omap_enable_lcd_dma);
 EXPORT_SYMBOL(omap_setup_lcd_dma);
 EXPORT_SYMBOL(omap_stop_lcd_dma);
-EXPORT_SYMBOL(omap_lcd_dma_ext_running);
 EXPORT_SYMBOL(omap_set_lcd_dma_b1);
 EXPORT_SYMBOL(omap_set_lcd_dma_single_transfer);
 EXPORT_SYMBOL(omap_set_lcd_dma_ext_controller);
Index: linux-2.6/include/asm-arm/arch-omap/dma.h
===
--- linux-2.6.orig/include/asm-arm/arch-omap/dma.h  2007-04-09 
16:38:12.0 -0400
+++ linux-2.6/include/asm-arm/arch-omap/dma.h   2007-04-09 16:39:10.0 
-0400
@@ -417,7 +417,6 @@ extern void omap_free_lcd_dma(void);
 extern void omap_setup_lcd_dma(void);
 extern void omap_enable_lcd_dma(void);
 extern void omap_stop_lcd_dma(void);
-extern int  omap_lcd_dma_ext_running(void);
 extern void omap_set_lcd_dma_ext_controller(int external);
 extern void omap_set_lcd_dma_single_transfer(int single);
 extern void omap_set_lcd_dma_b1(unsigned long addr, u16 fb_xres, u16 fb_yres,
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/6] ARM: OMAP: Enable DSP clocks for McBSP on omap310

2007-04-09 Thread Tony Lindgren
From: Marek Vasut [EMAIL PROTECTED]

This patch enables some clock on omap310.

Signed-off-by: Marek Vasut [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap1/clock.h |   14 +++---
 1 files changed, 7 insertions(+), 7 deletions(-)

--- a/arch/arm/mach-omap1/clock.h
+++ b/arch/arm/mach-omap1/clock.h
@@ -282,7 +282,7 @@ static struct clk arminth_ck16xx = {
 static struct clk dsp_ck = {
.name   = dsp_ck,
.parent = ck_dpll1,
-   .flags  = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX |
+   .flags  = CLOCK_IN_OMAP310 | CLOCK_IN_OMAP1510 | 
CLOCK_IN_OMAP16XX |
  RATE_CKCTL,
.enable_reg = (void __iomem *)ARM_CKCTL,
.enable_bit = EN_DSPCK,
@@ -295,7 +295,7 @@ static struct clk dsp_ck = {
 static struct clk dspmmu_ck = {
.name   = dspmmu_ck,
.parent = ck_dpll1,
-   .flags  = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX |
+   .flags  = CLOCK_IN_OMAP310 | CLOCK_IN_OMAP1510 | 
CLOCK_IN_OMAP16XX |
  RATE_CKCTL | ALWAYS_ENABLED,
.rate_offset= CKCTL_DSPMMUDIV_OFFSET,
.recalc = omap1_ckctl_recalc,
@@ -306,7 +306,7 @@ static struct clk dspmmu_ck = {
 static struct clk dspper_ck = {
.name   = dspper_ck,
.parent = ck_dpll1,
-   .flags  = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX |
+   .flags  = CLOCK_IN_OMAP310 | CLOCK_IN_OMAP1510 | 
CLOCK_IN_OMAP16XX |
  RATE_CKCTL | VIRTUAL_IO_ADDRESS,
.enable_reg = (void __iomem *)DSP_IDLECT2,
.enable_bit = EN_PERCK,
@@ -320,7 +320,7 @@ static struct clk dspper_ck = {
 static struct clk dspxor_ck = {
.name   = dspxor_ck,
.parent = ck_ref,
-   .flags  = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX |
+   .flags  = CLOCK_IN_OMAP310 | CLOCK_IN_OMAP1510 | 
CLOCK_IN_OMAP16XX |
  VIRTUAL_IO_ADDRESS,
.enable_reg = (void __iomem *)DSP_IDLECT2,
.enable_bit = EN_XORPCK,
@@ -332,7 +332,7 @@ static struct clk dspxor_ck = {
 static struct clk dsptim_ck = {
.name   = dsptim_ck,
.parent = ck_ref,
-   .flags  = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX |
+   .flags  = CLOCK_IN_OMAP310 | CLOCK_IN_OMAP1510 | 
CLOCK_IN_OMAP16XX |
  VIRTUAL_IO_ADDRESS,
.enable_reg = (void __iomem *)DSP_IDLECT2,
.enable_bit = EN_DSPTIMCK,
@@ -374,7 +374,7 @@ static struct clk arminth_ck1510 = {
 
 static struct clk tipb_ck = {
/* No-idle controlled by tc_ck */
-   .name   = tibp_ck,
+   .name   = tipb_ck,
.parent = tc_ck.clk,
.flags  = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310 |
  ALWAYS_ENABLED,
@@ -733,7 +733,7 @@ remains active during MPU idle whenever this is enabled */
 static struct clk i2c_fck = {
.name   = i2c_fck,
.id = 1,
-   .flags  = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX |
+   .flags  = CLOCK_IN_OMAP310 | CLOCK_IN_OMAP1510 | 
CLOCK_IN_OMAP16XX |
  VIRTUAL_CLOCK | CLOCK_NO_IDLE_PARENT |
  ALWAYS_ENABLED,
.parent = armxor_ck.clk,
-- 
1.4.4.2

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/6] ARM: OMAP: omap camera builds again; Mistral init and mux

2007-04-09 Thread Tony Lindgren
From: David Brownell [EMAIL PROTECTED]

Support the camera connector on the OSK Mistral add-on board:

  - define muxing for both camera controllers
  - mux both of them for Mistral
  - teach ov9640 glue about mistral powerup/powerdown

Signed-off-by: David Brownell [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap1/board-osk.c |   32 
 arch/arm/mach-omap1/mux.c   |   24 
 include/asm-arm/arch-omap/mux.h |   23 +++
 3 files changed, 79 insertions(+), 0 deletions(-)

Index: linux-2.6/arch/arm/mach-omap1/board-osk.c
===
--- linux-2.6.orig/arch/arm/mach-omap1/board-osk.c  2007-04-06 
09:00:28.0 -0400
+++ linux-2.6/arch/arm/mach-omap1/board-osk.c   2007-04-09 14:49:51.0 
-0400
@@ -342,6 +342,38 @@ static void __init osk_mistral_init(void
 * can't talk to the ads or even the i2c eeprom.
 */
 
+   /* parallel camera interface */
+   omap_cfg_reg(J15_1610_CAM_LCLK);
+   omap_cfg_reg(J18_1610_CAM_D7);
+   omap_cfg_reg(J19_1610_CAM_D6);
+   omap_cfg_reg(J14_1610_CAM_D5);
+   omap_cfg_reg(K18_1610_CAM_D4);
+   omap_cfg_reg(K19_1610_CAM_D3);
+   omap_cfg_reg(K15_1610_CAM_D2);
+   omap_cfg_reg(K14_1610_CAM_D1);
+   omap_cfg_reg(L19_1610_CAM_D0);
+   omap_cfg_reg(L18_1610_CAM_VS);
+   omap_cfg_reg(L15_1610_CAM_HS);
+   omap_cfg_reg(M19_1610_CAM_RSTZ);
+   omap_cfg_reg(Y15_1610_CAM_OUTCLK);
+
+   /* serial camera interface */
+   omap_cfg_reg(H19_1610_CAM_EXCLK);
+   omap_cfg_reg(W13_1610_CCP_CLKM);
+   omap_cfg_reg(Y12_1610_CCP_CLKP);
+   /* CCP_DATAM CONFLICTS WITH UART1.TX (and serial console) */
+   // omap_cfg_reg(Y14_1610_CCP_DATAM);
+   omap_cfg_reg(W14_1610_CCP_DATAP);
+
+   /* CAM_PWDN */
+   if (omap_request_gpio(11) == 0) {
+   omap_cfg_reg(N20_1610_GPIO11);
+   omap_set_gpio_direction(11, 0 /* out */);
+   omap_set_gpio_dataout(11, 0 /* off */);
+   } else
+   pr_debug(OSK+Mistral: CAM_PWDN is awol\n);
+
+
// omap_cfg_reg(P19_1610_GPIO6);// BUSY
omap_cfg_reg(P20_1610_GPIO4);   // PENIRQ
set_irq_type(OMAP_GPIO_IRQ(4), IRQT_FALLING);
Index: linux-2.6/arch/arm/mach-omap1/mux.c
===
--- linux-2.6.orig/arch/arm/mach-omap1/mux.c2007-04-06 09:00:28.0 
-0400
+++ linux-2.6/arch/arm/mach-omap1/mux.c 2007-04-09 14:49:51.0 -0400
@@ -283,6 +283,30 @@ MUX_CFG(R11_1610_CF_IOIS16,   B,0, 
 MUX_CFG(V10_1610_CF_IREQ, A,   24,3,   2,   14,   0,   2, 0,  1)
 MUX_CFG(W10_1610_CF_RESET,A,   18,3,   2,   12,   1,   2, 1,  1)
 MUX_CFG(W11_1610_CF_CD1, 10,   15,3,   3,8,   1,   3, 1,  1)
+
+/* parallel camera */
+MUX_CFG(J15_1610_CAM_LCLK,4,   24,0,   0,  18,   1,0, 0,  0)
+MUX_CFG(J18_1610_CAM_D7,  4,   27,0,   0,  19,   1,0, 0,  0)
+MUX_CFG(J19_1610_CAM_D6,  5,0,0,   0,  20,   1,0, 0,  0)
+MUX_CFG(J14_1610_CAM_D5,  5,3,0,   0,  21,   1,0, 0,  0)
+MUX_CFG(K18_1610_CAM_D4,  5,6,0,   0,  22,   1,0, 0,  0)
+MUX_CFG(K19_1610_CAM_D3,  5,9,0,   0,  23,   1,0, 0,  0)
+MUX_CFG(K15_1610_CAM_D2,  5,   12,0,   0,  24,   1,0, 0,  0)
+MUX_CFG(K14_1610_CAM_D1,  5,   15,0,   0,  25,   1,0, 0,  0)
+MUX_CFG(L19_1610_CAM_D0,  5,   18,0,   0,  26,   1,0, 0,  0)
+MUX_CFG(L18_1610_CAM_VS,  5,   21,0,   0,  27,   1,0, 0,  0)
+MUX_CFG(L15_1610_CAM_HS,  5,   24,0,   0,  28,   1,0, 0,  0)
+MUX_CFG(M19_1610_CAM_RSTZ,5,   27,0,   0,  29,   0,0, 0,  0)
+MUX_CFG(Y15_1610_CAM_OUTCLK,  A,0,6,   2,   6,   0,2, 0,  0)
+
+/* serial camera */
+MUX_CFG(H19_1610_CAM_EXCLK,   4,   21,0,   0,  17,   0,0, 0,  0)
+   /* REVISIT 5912 spec sez CCP_* can't pullup or pulldown ... ? */
+MUX_CFG(Y12_1610_CCP_CLKP,8,   18,6,   1,  24,   1,1, 0,  0)
+MUX_CFG(W13_1610_CCP_CLKM,9,0,6,   1,  28,   1,1, 0,  0)
+MUX_CFG(W14_1610_CCP_DATAP,   9,   24,6,   2,   4,   1,2, 0,  0)
+MUX_CFG(Y14_1610_CCP_DATAM,   9,   21,6,   2,   3,   1,2, 0,  0)
+
 };
 #endif /* CONFIG_ARCH_OMAP15XX || CONFIG_ARCH_OMAP16XX */
 
Index: linux-2.6/include/asm-arm/arch-omap/mux.h
===
--- linux-2.6.orig/include/asm-arm/arch-omap/mux.h  2007-04-06 
09:00:28.0 -0400
+++ linux-2.6/include/asm-arm/arch-omap/mux.h   2007-04-09 14:49:51.0 
-0400
@@ -406,6 +406,29 @@ enum omap1xxx_index {
V10_1610_CF_IREQ,
W10_1610_CF_RESET,
W11_1610_CF_CD1,
+
+   /* parallel camera */
+   J15_1610_CAM_LCLK

[PATCH 5/6] ARM: OMAP: fix OMAP1 dmtimer build warning

2007-04-09 Thread Tony Lindgren
From: David Brownell [EMAIL PROTECTED]

Remove the OMAP1 version of omap_dm_timer_get_fclk(), and its associated
compile-time warning.  It would only BUG() if called, while it's only
called on OMAP2.

Signed-off-by: David Brownell [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/plat-omap/dmtimer.c |5 -
 1 files changed, 0 insertions(+), 5 deletions(-)

--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -271,11 +271,6 @@ int omap_dm_timer_get_irq(struct omap_dm_timer *timer)
 
 #if defined(CONFIG_ARCH_OMAP1)
 
-struct clk *omap_dm_timer_get_fclk(struct omap_dm_timer *timer)
-{
-   BUG();
-}
-
 /**
  * omap_dm_timer_modify_idlect_mask - Check if any running timers use ARMXOR
  * @inputmask: current value of idlect mask
-- 
1.4.4.2

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 6/6] ARM: OMAP: OSK led fixes

2007-04-09 Thread Tony Lindgren
From: David Brownell [EMAIL PROTECTED]

Bugfixes for the OSK led support:

 - Fix Kconfig merge glitches:  Mistral handles idle and timer leds just fine
 - Fix pm_suspend() runtime botch:  can't sleep, so can't touch tps65010 leds

Improvements:
 - Switch sense of Mistral idle led, so idle == off

Probably the TPS65010 leds should be handled only by the new led API.

Signed-off-by: David Brownell [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/Kconfig   |7 +--
 arch/arm/mach-omap1/leds-osk.c |6 +++---
 arch/arm/mach-omap1/pm.c   |   11 ---
 3 files changed, 8 insertions(+), 16 deletions(-)

Index: linux-2.6/arch/arm/Kconfig
===
--- linux-2.6.orig/arch/arm/Kconfig 2007-04-09 16:39:05.0 -0400
+++ linux-2.6/arch/arm/Kconfig  2007-04-09 16:39:15.0 -0400
@@ -668,7 +668,8 @@ config LEDS
 
 config LEDS_TIMER
bool Timer LED if (!ARCH_CDB89712  !ARCH_OMAP) || \
-   MACH_OMAP_H2 || MACH_OMAP_PERSEUS2
+   OMAP_OSK_MISTRAL || MACH_OMAP_H2 \
+   || MACH_OMAP_PERSEUS2
depends on LEDS
default y if ARCH_EBSA110
help
@@ -684,7 +685,9 @@ config LEDS_TIMER
 
 config LEDS_CPU
bool CPU usage LED if (!ARCH_CDB89712  !ARCH_EBSA110  \
-   !ARCH_OMAP) || MACH_OMAP_H2 || MACH_OMAP_PERSEUS2
+   !ARCH_OMAP) \
+   || OMAP_OSK_MISTRAL || MACH_OMAP_H2 \
+   || MACH_OMAP_PERSEUS2
depends on LEDS
help
  If you say Y here, the red LED will be used to give a good real
Index: linux-2.6/arch/arm/mach-omap1/leds-osk.c
===
--- linux-2.6.orig/arch/arm/mach-omap1/leds-osk.c   2007-04-09 
16:38:12.0 -0400
+++ linux-2.6/arch/arm/mach-omap1/leds-osk.c2007-04-09 16:39:15.0 
-0400
@@ -133,13 +133,13 @@ void osk_leds_event(led_event_t evt)
mistral_setled();
break;
 
-   case led_idle_start:
-   hw_led_state |= IDLE_LED;
+   case led_idle_start:/* idle == off */
+   hw_led_state = ~IDLE_LED;
mistral_setled();
break;
 
case led_idle_end:
-   hw_led_state = ~IDLE_LED;
+   hw_led_state |= IDLE_LED;
mistral_setled();
break;
 
Index: linux-2.6/arch/arm/mach-omap1/pm.c
===
--- linux-2.6.orig/arch/arm/mach-omap1/pm.c 2007-04-09 16:39:10.0 
-0400
+++ linux-2.6/arch/arm/mach-omap1/pm.c  2007-04-09 16:39:15.0 -0400
@@ -58,7 +58,6 @@
 #include asm/arch/tc.h
 #include asm/arch/pm.h
 #include asm/arch/mux.h
-#include asm/arch/tps65010.h
 #include asm/arch/dma.h
 #include asm/arch/dsp_common.h
 #include asm/arch/dmtimer.h
@@ -248,11 +247,6 @@ void omap_pm_suspend(void)
 
omap_serial_wake_trigger(1);
 
-   if (machine_is_omap_osk()) {
-   /* Stop LED1 (D9) blink */
-   tps65010_set_led(LED1, OFF);
-   }
-
if (!cpu_is_omap15xx())
omap_writew(0x, ULPD_SOFT_DISABLE_REQ_REG);
 
@@ -445,11 +439,6 @@ void omap_pm_suspend(void)
omap_serial_wake_trigger(0);
 
printk(PM: OMAP%x is re-starting from deep sleep...\n, system_rev);
-
-   if (machine_is_omap_osk()) {
-   /* Let LED1 (D9) blink again */
-   tps65010_set_led(LED1, BLINK);
-   }
 }
 
 #if defined(DEBUG)  defined(CONFIG_PROC_FS)
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 6/14] ARM: OMAP: Basic support for siemens sx1

2007-04-09 Thread Tony Lindgren
From: Vladimir Ananiev [EMAIL PROTECTED]

This adds basic support for Siemens SX1. More patches are available,
with video driver, mixer, and serial ports working. That is enough to
do gsm calls with right userland.

Signed-off-by: Pavel Machek [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap1/Kconfig   |   11 +
 arch/arm/mach-omap1/Makefile  |1 +
 arch/arm/mach-omap1/board-sx1.c   |  494 +
 include/asm-arm/arch-omap/board-sx1.h |   46 +++
 include/asm-arm/arch-omap/hardware.h  |4 +
 5 files changed, 556 insertions(+), 0 deletions(-)

Index: linux-2.6/arch/arm/mach-omap1/Kconfig
===
--- linux-2.6.orig/arch/arm/mach-omap1/Kconfig  2007-04-09 15:07:56.0 
-0400
+++ linux-2.6/arch/arm/mach-omap1/Kconfig   2007-04-09 15:08:00.0 
-0400
@@ -107,6 +107,17 @@ config MACH_OMAP_PALMTT
  http://www.hackndev.com/palm/tt/ for more information.
  Say Y here if you have this PDA model, say N otherwise.
 
+config MACH_SX1
+   bool Siemens SX1
+   depends on ARCH_OMAP1  ARCH_OMAP15XX
+   help
+ Support for the Siemens SX1 phone. To boot the kernel,
+ you'll need a SX1 compatible bootloader; check out
+ http://forum.oslik.ru and
+ http://www.handhelds.org/moin/moin.cgi/SiemensSX1
+ for more information.
+ Say Y here if you have such a phone, say NO otherwise.
+
 config MACH_NOKIA770
bool Nokia 770
depends on ARCH_OMAP1  ARCH_OMAP16XX
Index: linux-2.6/arch/arm/mach-omap1/Makefile
===
--- linux-2.6.orig/arch/arm/mach-omap1/Makefile 2007-04-09 15:07:56.0 
-0400
+++ linux-2.6/arch/arm/mach-omap1/Makefile  2007-04-09 15:08:00.0 
-0400
@@ -26,6 +26,7 @@ obj-$(CONFIG_MACH_OMAP_PALMZ71)   += boar
 obj-$(CONFIG_MACH_OMAP_PALMTT) += board-palmtt.o
 obj-$(CONFIG_MACH_NOKIA770)+= board-nokia770.o
 obj-$(CONFIG_MACH_AMS_DELTA)   += board-ams-delta.o
+obj-$(CONFIG_MACH_SX1) += board-sx1.o
 
 ifeq ($(CONFIG_ARCH_OMAP15XX),y)
 # Innovator-1510 FPGA
Index: linux-2.6/arch/arm/mach-omap1/board-sx1.c
===
--- /dev/null   1970-01-01 00:00:00.0 +
+++ linux-2.6/arch/arm/mach-omap1/board-sx1.c   2007-04-09 15:08:00.0 
-0400
@@ -0,0 +1,494 @@
+/*
+* linux/arch/arm/mach-omap1/board-sx1.c
+*
+* Modified from board-generic.c
+*
+* Support for the Siemens SX1 mobile phone.
+*
+* Original version : Vladimir Ananiev (Vovan888-at-gmail com)
+*
+* Maintainters : Vladimir Ananiev (aka Vovan888), Sergge
+*  oslik.ru
+*
+* 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.
+*/
+
+#include linux/kernel.h
+#include linux/init.h
+#include linux/input.h
+#include linux/platform_device.h
+#include linux/notifier.h
+#include linux/mtd/mtd.h
+#include linux/mtd/partitions.h
+#include linux/types.h
+#include linux/i2c.h
+#include linux/errno.h
+
+#include asm/hardware.h
+#include asm/mach-types.h
+#include asm/mach/arch.h
+#include asm/mach/flash.h
+#include asm/mach/map.h
+
+#include asm/arch/gpio.h
+#include asm/arch/mux.h
+#include asm/arch/irda.h
+#include asm/arch/usb.h
+#include asm/arch/tc.h
+#include asm/arch/board.h
+#include asm/arch/common.h
+#include asm/arch/mcbsp.h
+#include asm/arch/omap-alsa.h
+#include asm/arch/keypad.h
+
+/* Write to I2C device */
+int i2c_write_byte(u8 devaddr, u8 regoffset, u8 value)
+{
+   struct i2c_adapter *adap;
+   int err;
+   struct i2c_msg msg[1];
+   unsigned char data[2];
+
+   adap = i2c_get_adapter(0);
+   if (!adap)
+   return -ENODEV;
+   msg-addr = devaddr;/* I2C address of chip */
+   msg-flags = 0;
+   msg-len = 2;
+   msg-buf = data;
+   data[0] = regoffset;/* register num */
+   data[1] = value;/* register data */
+   err = i2c_transfer(adap, msg, 1);
+   if (err = 0)
+   return 0;
+   return err;
+}
+
+/* Read from I2C device */
+int i2c_read_byte(u8 devaddr, u8 regoffset, u8 * value)
+{
+   struct i2c_adapter *adap;
+   int err;
+   struct i2c_msg msg[1];
+   unsigned char data[2];
+
+   adap = i2c_get_adapter(0);
+   if (!adap)
+   return -ENODEV;
+
+   msg-addr = devaddr;/* I2C address of chip */
+   msg-flags = 0;
+   msg-len = 1;
+   msg-buf = data;
+   data[0] = regoffset;/* register num */
+   err = i2c_transfer(adap, msg, 1);
+
+   msg-addr = devaddr;/* I2C address */
+   msg-flags = I2C_M_RD;
+   msg-len = 1;
+   msg-buf = data;
+   err = i2c_transfer(adap, msg, 1

[PATCH 13/14] ARM: OMAP: TSC2101: add platform init / registration to board files

2007-04-09 Thread Tony Lindgren
From: Imre Deak [EMAIL PROTECTED]

H2 / H3 boards use this chip, update their board files.

Signed-off-by: Imre Deak [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap1/board-h2.c |   77 +++
 arch/arm/mach-omap1/board-h3.c |   88 
 2 files changed, 165 insertions(+), 0 deletions(-)

--- a/arch/arm/mach-omap1/board-h2.c
+++ b/arch/arm/mach-omap1/board-h2.c
@@ -28,6 +28,9 @@
 #include linux/mtd/partitions.h
 #include linux/input.h
 #include linux/workqueue.h
+#include linux/spi/spi.h
+#include linux/spi/tsc2101.h
+#include linux/clk.h
 
 #include asm/hardware.h
 #include asm/mach-types.h
@@ -297,6 +300,78 @@ static struct platform_device h2_lcd_device = {
.id = -1,
 };
 
+struct {
+   struct clk  *mclk;
+   int initialized;
+} h2_tsc2101;
+
+#define TSC2101_MUX_MCLK_ONR10_1610_MCLK_ON
+#define TSC2101_MUX_MCLK_OFF   R10_1610_MCLK_OFF
+
+static int h2_tsc2101_init(struct spi_device *spi)
+{
+   int r;
+
+   if (h2_tsc2101.initialized) {
+   printk(KERN_ERR tsc2101: already initialized\n);
+   return -ENODEV;
+   }
+
+   /* Get the MCLK */
+   h2_tsc2101.mclk = clk_get(spi-dev, mclk);
+   if (IS_ERR(h2_tsc2101.mclk)) {
+   dev_err(spi-dev, unable to get the clock MCLK\n);
+   return PTR_ERR(h2_tsc2101.mclk);
+   }
+   if ((r = clk_set_rate(h2_tsc2101.mclk, 1200))  0) {
+   dev_err(spi-dev, unable to set rate to the MCLK\n);
+   goto err;
+   }
+
+   omap_cfg_reg(TSC2101_MUX_MCLK_OFF);
+   omap_cfg_reg(N15_1610_UWIRE_CS1);
+
+   return 0;
+err:
+   clk_put(h2_tsc2101.mclk);
+   return r;
+}
+
+static void h2_tsc2101_cleanup(struct spi_device *spi)
+{
+   clk_put(h2_tsc2101.mclk);
+   omap_cfg_reg(TSC2101_MUX_MCLK_OFF);
+}
+
+static void h2_tsc2101_enable_mclk(struct spi_device *spi)
+{
+   omap_cfg_reg(TSC2101_MUX_MCLK_ON);
+   clk_enable(h2_tsc2101.mclk);
+}
+
+static void h2_tsc2101_disable_mclk(struct spi_device *spi)
+{
+   clk_disable(h2_tsc2101.mclk);
+   omap_cfg_reg(R10_1610_MCLK_OFF);
+}
+
+static struct tsc2101_platform_data h2_tsc2101_platform_data = {
+   .init   = h2_tsc2101_init,
+   .cleanup= h2_tsc2101_cleanup,
+   .enable_mclk= h2_tsc2101_enable_mclk,
+   .disable_mclk   = h2_tsc2101_disable_mclk,
+};
+
+static struct spi_board_info h2_spi_board_info[] __initdata = {
+   [0] = {
+   .modalias   = tsc2101,
+   .bus_num= 2,
+   .chip_select= 1,
+   .max_speed_hz   = 1600,
+   .platform_data  = h2_tsc2101_platform_data,
+   },
+};
+
 static struct omap_mcbsp_reg_cfg mcbsp_regs = {
.spcr2 = FREE | FRST | GRST | XRST | XINTM(3),
.spcr1 = RINTM(3) | RRST,
@@ -443,6 +518,8 @@ static void __init h2_init(void)
 #endif
 
platform_add_devices(h2_devices, ARRAY_SIZE(h2_devices));
+   spi_register_board_info(h2_spi_board_info,
+   ARRAY_SIZE(h2_spi_board_info));
omap_board_config = h2_config;
omap_board_config_size = ARRAY_SIZE(h2_config);
omap_serial_init();
--- a/arch/arm/mach-omap1/board-h3.c
+++ b/arch/arm/mach-omap1/board-h3.c
@@ -25,6 +25,9 @@
 #include linux/mtd/nand.h
 #include linux/mtd/partitions.h
 #include linux/input.h
+#include linux/clk.h
+#include linux/spi/spi.h
+#include linux/spi/tsc2101.h
 
 #include asm/setup.h
 #include asm/page.h
@@ -371,6 +374,89 @@ static struct platform_device h3_lcd_device = {
.id = -1,
 };
 
+struct {
+   struct clk  *mclk;
+   int initialized;
+} h3_tsc2101;
+
+#define TSC2101_MUX_MCLK_ONV5_1710_MCLK_ON
+#define TSC2101_MUX_MCLK_OFF   V5_1710_MCLK_OFF
+
+static int h3_tsc2101_init(struct spi_device *spi)
+{
+   u8 io_exp_val;
+   int r;
+
+   if (h3_tsc2101.initialized) {
+   printk(KERN_ERR tsc2101: already initialized\n);
+   return -ENODEV;
+   }
+
+   /* Get the MCLK */
+   h3_tsc2101.mclk = clk_get(spi-dev, mclk);
+   if (IS_ERR(h3_tsc2101.mclk)) {
+   dev_err(spi-dev, unable to get the clock MCLK\n);
+   return PTR_ERR(h3_tsc2101.mclk);
+   }
+   if ((r = clk_set_rate(h3_tsc2101.mclk, 1200))  0) {
+   dev_err(spi-dev, unable to set rate to the MCLK\n);
+   goto err;
+   }
+
+   if ((r = read_gpio_expa(io_exp_val, 0x24))) {
+   dev_err(spi-dev, error reading from I/O EXPANDER\n);
+   goto err;
+   }
+   io_exp_val |= 0x8;
+   if ((r = write_gpio_expa(io_exp_val, 0x24))) {
+   dev_err(spi-dev, error writing to I/O EXPANDER\n);
+   goto err;
+   }
+
+   omap_cfg_reg(N14_1610_UWIRE_CS0);
+   omap_cfg_reg

[PATCH 14/14] ARM: OMAP: H2 lcd updates for SPI framework

2007-04-09 Thread Tony Lindgren
From: Eduardo Valentin [EMAIL PROTECTED]

This is an updated patch to fix lcd for H2 board. It uses platform_data
field to pass spi_device to lcd driver.

Signed-off-by: Eduardo Valentin [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap1/board-h2.c |   14 +-
 1 files changed, 13 insertions(+), 1 deletions(-)

--- a/arch/arm/mach-omap1/board-h2.c
+++ b/arch/arm/mach-omap1/board-h2.c
@@ -308,6 +308,17 @@ struct {
 #define TSC2101_MUX_MCLK_ONR10_1610_MCLK_ON
 #define TSC2101_MUX_MCLK_OFF   R10_1610_MCLK_OFF
 
+static void h2_lcd_dev_init(struct spi_device *tsc2101)
+{
+   /* The LCD is connected to the GPIO pins of the TSC2101, so
+* we have to tie them here. We can also register the LCD driver
+* first only here, where we know that the TSC driver is ready.
+*/
+
+   h2_lcd_device.dev.platform_data = tsc2101;
+   platform_device_register(h2_lcd_device);
+}
+
 static int h2_tsc2101_init(struct spi_device *spi)
 {
int r;
@@ -331,6 +342,8 @@ static int h2_tsc2101_init(struct spi_device *spi)
omap_cfg_reg(TSC2101_MUX_MCLK_OFF);
omap_cfg_reg(N15_1610_UWIRE_CS1);
 
+   h2_lcd_dev_init(spi);
+
return 0;
 err:
clk_put(h2_tsc2101.mclk);
@@ -413,7 +426,6 @@ static struct platform_device *h2_devices[] __initdata = {
h2_smc91x_device,
h2_irda_device,
h2_kp_device,
-   h2_lcd_device,
h2_mcbsp1_device,
 };
 
-- 
1.4.4.2

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 0/18] ARM: OMAP: Updates for OMAP2 common code

2007-04-09 Thread Tony Lindgren
Hi,

The following patch series contains updates OMAP2 common
code.

This is take #2 of the earlier 90 patch mountain, which has
been split into six smaller series.

Regards,

Tony

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 6/18] ARM: OMAP: omap2/memory.c compile fixes

2007-04-09 Thread Tony Lindgren
From: David Brownell [EMAIL PROTECTED]

Remove some conflicting declarations in omap2/memory.c so that the
file builds again.

Signed-off-by: David Brownell [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap2/memory.c |   40 +---
 1 files changed, 5 insertions(+), 35 deletions(-)

--- a/arch/arm/mach-omap2/memory.c
+++ b/arch/arm/mach-omap2/memory.c
@@ -30,37 +30,6 @@
 #include prcm-regs.h
 #include memory.h
 
-#define SMS_BASE   0x68008000
-#define SMS_SYSCONFIG  0x010
-
-#define SDRC_BASE  0x68009000
-#define SDRC_SYSCONFIG 0x010
-#define SDRC_SYSSTATUS 0x014
-
-static const u32 sms_base = IO_ADDRESS(SMS_BASE);
-static const u32 sdrc_base = IO_ADDRESS(SDRC_BASE);
-
-
-static inline void sms_write_reg(int idx, u32 val)
-{
-   __raw_writel(val, sms_base + idx);
-}
-
-static inline u32 sms_read_reg(int idx)
-{
-   return __raw_readl(sms_base + idx);
-}
-
-static inline void sdrc_write_reg(int idx, u32 val)
-{
-   __raw_writel(val, sdrc_base + idx);
-}
-
-static inline u32 sdrc_read_reg(int idx)
-{
-   return __raw_readl(sdrc_base + idx);
-}
-
 
 static struct memory_timings mem_timings;
 
@@ -132,18 +101,19 @@ void omap2_init_memory_params(u32 
force_lock_to_unlock_mode)
mem_timings.slow_dll_ctrl |= ((1  1) | (3  8));
 }
 
+/* turn on smart idle modes for SDRAM scheduler and controller */
 void __init omap2_init_memory(void)
 {
u32 l;
 
-   l = sms_read_reg(SMS_SYSCONFIG);
+   l = SMS_SYSCONFIG;
l = ~(0x3  3);
l |= (0x2  3);
-   sms_write_reg(SMS_SYSCONFIG, l);
+   SMS_SYSCONFIG = l;
 
-   l = sdrc_read_reg(SDRC_SYSCONFIG);
+   l = SDRC_SYSCONFIG;
l = ~(0x3  3);
l |= (0x2  3);
-   sdrc_write_reg(SDRC_SYSCONFIG, l);
+   SDRC_SYSCONFIG = l;
 
 }
-- 
1.4.4.2

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/18] ARM: OMAP2: Place SMS and SDRC into smart idle mode

2007-04-09 Thread Tony Lindgren
From: Juha Yrjola [EMAIL PROTECTED]

Place SMS and SDRC into smart idle mode

Signed-off-by: Juha Yrjola [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap2/io.c |2 +
 arch/arm/mach-omap2/memory.c |   48 ++
 2 files changed, 50 insertions(+), 0 deletions(-)

Index: linux-2.6/arch/arm/mach-omap2/io.c
===
--- linux-2.6.orig/arch/arm/mach-omap2/io.c 2007-04-09 15:12:08.0 
-0400
+++ linux-2.6/arch/arm/mach-omap2/io.c  2007-04-09 15:26:32.0 -0400
@@ -26,6 +26,7 @@
 extern void omap_sram_init(void);
 extern int omap2_clk_init(void);
 extern void omap2_check_revision(void);
+extern void omap2_init_memory(void);
 extern void gpmc_init(void);
 extern void omapfb_reserve_sdram(void);
 
@@ -80,5 +81,6 @@ void __init omap2_init_common_hw(void)
 {
omap2_mux_init();
omap2_clk_init();
+   omap2_init_memory();
gpmc_init();
 }
Index: linux-2.6/arch/arm/mach-omap2/memory.c
===
--- linux-2.6.orig/arch/arm/mach-omap2/memory.c 2007-04-06 09:00:28.0 
-0400
+++ linux-2.6/arch/arm/mach-omap2/memory.c  2007-04-09 15:26:32.0 
-0400
@@ -30,6 +30,38 @@
 #include prcm-regs.h
 #include memory.h
 
+#define SMS_BASE   0x68008000
+#define SMS_SYSCONFIG  0x010
+
+#define SDRC_BASE  0x68009000
+#define SDRC_SYSCONFIG 0x010
+#define SDRC_SYSSTATUS 0x014
+
+static const u32 sms_base = IO_ADDRESS(SMS_BASE);
+static const u32 sdrc_base = IO_ADDRESS(SDRC_BASE);
+
+
+static inline void sms_write_reg(int idx, u32 val)
+{
+   __raw_writel(val, sms_base + idx);
+}
+
+static inline u32 sms_read_reg(int idx)
+{
+   return __raw_readl(sms_base + idx);
+}
+
+static inline void sdrc_write_reg(int idx, u32 val)
+{
+   __raw_writel(val, sdrc_base + idx);
+}
+
+static inline u32 sdrc_read_reg(int idx)
+{
+   return __raw_readl(sdrc_base + idx);
+}
+
+
 static struct memory_timings mem_timings;
 
 u32 omap2_memory_get_slow_dll_ctrl(void)
@@ -99,3 +131,19 @@ void omap2_init_memory_params(u32 force_
/* 90 degree phase for anything below 133Mhz + disable DLL filter */
mem_timings.slow_dll_ctrl |= ((1  1) | (3  8));
 }
+
+void __init omap2_init_memory(void)
+{
+   u32 l;
+
+   l = sms_read_reg(SMS_SYSCONFIG);
+   l = ~(0x3  3);
+   l |= (0x2  3);
+   sms_write_reg(SMS_SYSCONFIG, l);
+
+   l = sdrc_read_reg(SDRC_SYSCONFIG);
+   l = ~(0x3  3);
+   l |= (0x2  3);
+   sdrc_write_reg(SDRC_SYSCONFIG, l);
+
+}
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 11/18] ARM: OMAP: Tabify mux.c

2007-04-09 Thread Tony Lindgren
Tabify mux.c, no functional changes.

Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap2/mux.c |   38 +++---
 1 files changed, 19 insertions(+), 19 deletions(-)

--- a/arch/arm/mach-omap2/mux.c
+++ b/arch/arm/mach-omap2/mux.c
@@ -53,8 +53,8 @@ MUX_CFG_24XX(W19_24XX_SYS_NIRQ, 0x12c,  0,  1,  
1,  1)
 MUX_CFG_24XX(W14_24XX_SYS_CLKOUT,0x137,  0,  1,  1,  1)
 
 /* 24xx GPMC chipselects, wait pin monitoring */
-MUX_CFG_24XX(E2_GPMC_NCS2,   0x08e,  0,  1,  1,  1)
-MUX_CFG_24XX(L2_GPMC_NCS7,   0x093,  0,  1,  1,  1)
+MUX_CFG_24XX(E2_GPMC_NCS2,   0x08e,  0,  1,  1,  1)
+MUX_CFG_24XX(L2_GPMC_NCS7,   0x093,  0,  1,  1,  1)
 MUX_CFG_24XX(L3_GPMC_WAIT0,  0x09a,  0,  1,  1,  1)
 MUX_CFG_24XX(N7_GPMC_WAIT1,  0x09b,  0,  1,  1,  1)
 MUX_CFG_24XX(M1_GPMC_WAIT2,  0x09c,  0,  1,  1,  1)
@@ -67,18 +67,18 @@ MUX_CFG_24XX(W15_24XX_MCBSP2_DR,  0x126,  1,  1,  
0,  1)
 MUX_CFG_24XX(V15_24XX_MCBSP2_DX, 0x127,  1,  1,  0,  1)
 
 /* 24xx GPIO */
-MUX_CFG_24XX(M21_242X_GPIO11,0x0c9,  3,  1,  1,  
1)
-MUX_CFG_24XX(P21_242X_GPIO12,0x0ca,  3,  0,  0,  1)
-MUX_CFG_24XX(AA10_242X_GPIO13,   0x0e5,  3,  0,  0,  1)
-MUX_CFG_24XX(AA6_242X_GPIO14,0x0e6,  3,  0,  0,  
1)
-MUX_CFG_24XX(AA4_242X_GPIO15,0x0e7,  3,  0,  0,  
1)
-MUX_CFG_24XX(Y11_242X_GPIO16,0x0e8,  3,  0,  0,  
1)
-MUX_CFG_24XX(AA12_242X_GPIO17,   0x0e9,  3,  0,  0,  1)
-MUX_CFG_24XX(AA8_242X_GPIO58,0x0ea,  3,  0,  0,  
1)
+MUX_CFG_24XX(M21_242X_GPIO11,0x0c9,  3,  1,  1,  
1)
+MUX_CFG_24XX(P21_242X_GPIO12,0x0ca,  3,  0,  0,  
1)
+MUX_CFG_24XX(AA10_242X_GPIO13,   0x0e5,  3,  0,  0,  1)
+MUX_CFG_24XX(AA6_242X_GPIO14,0x0e6,  3,  0,  0,  
1)
+MUX_CFG_24XX(AA4_242X_GPIO15,0x0e7,  3,  0,  0,  
1)
+MUX_CFG_24XX(Y11_242X_GPIO16,0x0e8,  3,  0,  0,  
1)
+MUX_CFG_24XX(AA12_242X_GPIO17,   0x0e9,  3,  0,  0,  1)
+MUX_CFG_24XX(AA8_242X_GPIO58,0x0ea,  3,  0,  0,  
1)
 MUX_CFG_24XX(Y20_24XX_GPIO60,0x12c,  3,  0,  0,  
1)
-MUX_CFG_24XX(W4__24XX_GPIO74,0x0f2,  3,  0,  0,  
1)
+MUX_CFG_24XX(W4__24XX_GPIO74,0x0f2,  3,  0,  0,  
1)
 MUX_CFG_24XX(M15_24XX_GPIO92,0x10a,  3,  0,  0,  
1)
-MUX_CFG_24XX(J15_24XX_GPIO99,0x113,  3,  1,  1,  1)
+MUX_CFG_24XX(J15_24XX_GPIO99,0x113,  3,  1,  1,  
1)
 MUX_CFG_24XX(V14_24XX_GPIO117,   0x128,  3,  1,  0,  1)
 MUX_CFG_24XX(P14_24XX_GPIO125,   0x140,  3,  1,  1,  1)
 
@@ -95,17 +95,17 @@ MUX_CFG_24XX(T3_242X_GPIO55,  0xd9,   3,  
0,  0,  1)
 MUX_CFG_24XX(U2_242X_GPIO56, 0xda,   3,  0,  0,  1)
 
 /* 24xx external DMA requests */
-MUX_CFG_24XX(AA10_242X_DMAREQ0,  0x0e5,  2,  0,  0,  1)
-MUX_CFG_24XX(AA6_242X_DMAREQ1,   0x0e6,  2,  0,  0,  1)
-MUX_CFG_24XX(E4_242X_DMAREQ2,0x074,  2,  0,  0,  
1)
-MUX_CFG_24XX(G4_242X_DMAREQ3,0x073,  2,  0,  0,  
1)
-MUX_CFG_24XX(D3_242X_DMAREQ4,0x072,  2,  0,  0,  
1)
-MUX_CFG_24XX(E3_242X_DMAREQ5,0x071,  2,  0,  0,  
1)
+MUX_CFG_24XX(AA10_242X_DMAREQ0,  0x0e5,  2,  0,  0,  1)
+MUX_CFG_24XX(AA6_242X_DMAREQ1,   0x0e6,  2,  0,  0,  1)
+MUX_CFG_24XX(E4_242X_DMAREQ2,0x074,  2,  0,  0,  
1)
+MUX_CFG_24XX(G4_242X_DMAREQ3,0x073,  2,  0,  0,  
1)
+MUX_CFG_24XX(D3_242X_DMAREQ4,0x072,  2,  0,  0,  
1)
+MUX_CFG_24XX(E3_242X_DMAREQ5,0x071,  2,  0,  0,  
1)
 
 /* TSC IRQ */
 MUX_CFG_24XX(P20_24XX_TSC_IRQ,   0x108,  0,  0,  0,  1)
 
-/* UART3  */
+/* UART3 */
 MUX_CFG_24XX(K15_24XX_UART3_TX,  0x118,  0,  0,  0,  1)
 MUX_CFG_24XX(K14_24XX_UART3_RX,  0x119,  0,  0,  0,  1)
 
-- 
1.4.4.2

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 17/18] ARM: OMAP: Device init for OMAP24xx Enhanced Audio Controller

2007-04-09 Thread Tony Lindgren
From: Jarkko Nikula [EMAIL PROTECTED]

Device init for OMAP24xx Enhanced Audio Controller

Signed-off-by: Jarkko Nikula [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap2/devices.c |   33 +
 1 files changed, 33 insertions(+), 0 deletions(-)

Index: linux-2.6/arch/arm/mach-omap2/devices.c
===
--- linux-2.6.orig/arch/arm/mach-omap2/devices.c2007-04-09 
16:36:48.0 -0400
+++ linux-2.6/arch/arm/mach-omap2/devices.c 2007-04-09 16:37:04.0 
-0400
@@ -23,6 +23,7 @@
 #include asm/arch/board.h
 #include asm/arch/mux.h
 #include asm/arch/gpio.h
+#include asm/arch/eac.h
 
 #ifdefined(CONFIG_I2C_OMAP) || defined(CONFIG_I2C_OMAP_MODULE)
 
@@ -201,6 +202,38 @@ 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
+
 /*-*/
 
 static int __init omap2_init_devices(void)
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/18] ARM: OMAP2: Force APLLs always active

2007-04-09 Thread Tony Lindgren
From: Juha Yrjola [EMAIL PROTECTED]

The APLLs are most efficiently idled by hardware.

Signed-off-by: Juha Yrjola [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap2/clock.c |   13 ++---
 1 files changed, 2 insertions(+), 11 deletions(-)

--- a/arch/arm/mach-omap2/clock.c
+++ b/arch/arm/mach-omap2/clock.c
@@ -1160,8 +1160,8 @@ int __init omap2_clk_init(void)
clk_enable(sync_32k_ick);
clk_enable(omapctrl_ick);
 
-   /* Force the APLLs active during bootup to avoid disabling and
-* enabling them unnecessarily. */
+   /* Force the APLLs always active. The clocks are idled
+* automatically by hardware. */
clk_enable(apll96_ck);
clk_enable(apll54_ck);
 
@@ -1174,12 +1174,3 @@ int __init omap2_clk_init(void)
 
return 0;
 }
-
-static int __init omap2_disable_aplls(void)
-{
-   clk_disable(apll96_ck);
-   clk_disable(apll54_ck);
-
-   return 0;
-}
-late_initcall(omap2_disable_aplls);
-- 
1.4.4.2

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 7/18] ARM: OMAP: 24xx pinmux updates

2007-04-09 Thread Tony Lindgren
From: Kyungmin Park [EMAIL PROTECTED]

Add some OMAP 24xx pin mux declarations to support:

 - TUSB 6010 EVM (on H4)
 - All three full speed USB ports
 - GPIOs used with USB0 on Apollon and H4

For OMAP2, issue MUX_WARNINGS and debug messages correctly; and make the
message look more like the OMAP1 message.

Signed-off-by: Kyungmin Park [EMAIL PROTECTED]
Signed-off-by: David Brownell [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap2/mux.c   |   33 +++--
 arch/arm/plat-omap/mux.c|   19 +++
 include/asm-arm/arch-omap/mux.h |   31 ++-
 3 files changed, 76 insertions(+), 7 deletions(-)

Index: linux-2.6/arch/arm/mach-omap2/mux.c
===
--- linux-2.6.orig/arch/arm/mach-omap2/mux.c2007-04-06 09:00:28.0 
-0400
+++ linux-2.6/arch/arm/mach-omap2/mux.c 2007-04-09 15:23:42.0 -0400
@@ -43,7 +43,7 @@ struct pin_config __initdata_or_module o
 /* 24xx I2C */
 MUX_CFG_24XX(M19_24XX_I2C1_SCL,  0x111,  0,  0,  0,  1)
 MUX_CFG_24XX(L15_24XX_I2C1_SDA,  0x112,  0,  0,  0,  1)
-MUX_CFG_24XX(J15_24XX_I2C2_SCL,  0x113,  0,  0,  0,  1)
+MUX_CFG_24XX(J15_24XX_I2C2_SCL,  0x113,  0,  0,  1,  1)
 MUX_CFG_24XX(H19_24XX_I2C2_SDA,  0x114,  0,  0,  0,  1)
 
 /* Menelaus interrupt */
@@ -52,7 +52,9 @@ MUX_CFG_24XX(W19_24XX_SYS_NIRQ, 0x12c,
 /* 24xx clocks */
 MUX_CFG_24XX(W14_24XX_SYS_CLKOUT,0x137,  0,  1,  1,  1)
 
-/* 24xx GPMC wait pin monitoring */
+/* 24xx GPMC chipselects, wait pin monitoring */
+MUX_CFG_24XX(E2_GPMC_NCS2,   0x08e,  0,  1,  1,  1)
+MUX_CFG_24XX(L2_GPMC_NCS7,   0x093,  0,  1,  1,  1)
 MUX_CFG_24XX(L3_GPMC_WAIT0,  0x09a,  0,  1,  1,  1)
 MUX_CFG_24XX(N7_GPMC_WAIT1,  0x09b,  0,  1,  1,  1)
 MUX_CFG_24XX(M1_GPMC_WAIT2,  0x09c,  0,  1,  1,  1)
@@ -66,6 +68,7 @@ MUX_CFG_24XX(V15_24XX_MCBSP2_DX,0x127
 
 /* 24xx GPIO */
 MUX_CFG_24XX(M21_242X_GPIO11,0x0c9,  3,  1,  1,  
1)
+MUX_CFG_24XX(P21_242X_GPIO12,0x0ca,  3,  0,  0,  1)
 MUX_CFG_24XX(AA10_242X_GPIO13,   0x0e5,  3,  0,  0,  1)
 MUX_CFG_24XX(AA6_242X_GPIO14,0x0e6,  3,  0,  0,  
1)
 MUX_CFG_24XX(AA4_242X_GPIO15,0x0e7,  3,  0,  0,  
1)
@@ -75,7 +78,9 @@ MUX_CFG_24XX(AA8_242X_GPIO58,   0x0ea, 
 MUX_CFG_24XX(Y20_24XX_GPIO60,0x12c,  3,  0,  0,  
1)
 MUX_CFG_24XX(W4__24XX_GPIO74,0x0f2,  3,  0,  0,  
1)
 MUX_CFG_24XX(M15_24XX_GPIO92,0x10a,  3,  0,  0,  
1)
+MUX_CFG_24XX(J15_24XX_GPIO99,0x113,  3,  1,  1,  1)
 MUX_CFG_24XX(V14_24XX_GPIO117,   0x128,  3,  1,  0,  1)
+MUX_CFG_24XX(P14_24XX_GPIO125,   0x140,  3,  1,  1,  1)
 
 /* 242x DBG GPIO */
 MUX_CFG_24XX(V4_242X_GPIO49, 0xd3,   3,  0,  0,  1)
@@ -118,6 +123,30 @@ MUX_CFG_24XX(E18_24XX_MMC_DAT_DIR3,  0x
 MUX_CFG_24XX(G18_24XX_MMC_CMD_DIR,   0x0fd,  0,  0,  0,  1)
 MUX_CFG_24XX(H15_24XX_MMC_CLKI,  0x0fe,  0,  0,  0,  1)
 
+/* Full speed USB */
+MUX_CFG_24XX(J20_24XX_USB0_PUEN, 0x11d,  0,  0,  0,  1)
+MUX_CFG_24XX(J19_24XX_USB0_VP,   0x11e,  0,  0,  0,  1)
+MUX_CFG_24XX(K20_24XX_USB0_VM,   0x11f,  0,  0,  0,  1)
+MUX_CFG_24XX(J18_24XX_USB0_RCV,  0x120,  0,  0,  0,  1)
+MUX_CFG_24XX(K19_24XX_USB0_TXEN, 0x121,  0,  0,  0,  1)
+MUX_CFG_24XX(J14_24XX_USB0_SE0,  0x122,  0,  0,  0,  1)
+MUX_CFG_24XX(K18_24XX_USB0_DAT,  0x123,  0,  0,  0,  1)
+
+MUX_CFG_24XX(N14_24XX_USB1_SE0,  0x0ed,  2,  0,  0,  1)
+MUX_CFG_24XX(W12_24XX_USB1_SE0,  0x0dd,  3,  0,  0,  1)
+MUX_CFG_24XX(P15_24XX_USB1_DAT,  0x0ee,  2,  0,  0,  1)
+MUX_CFG_24XX(R13_24XX_USB1_DAT,  0x0e0,  3,  0,  0,  1)
+MUX_CFG_24XX(W20_24XX_USB1_TXEN, 0x0ec,  2,  0,  0,  1)
+MUX_CFG_24XX(P13_24XX_USB1_TXEN, 0x0df,  3,  0,  0,  1)
+MUX_CFG_24XX(V19_24XX_USB1_RCV,  0x0eb,  2,  0,  0,  1)
+MUX_CFG_24XX(V12_24XX_USB1_RCV,  0x0de,  3,  0,  0,  1)
+
+MUX_CFG_24XX(AA10_24XX_USB2_SE0, 0x0e5,  2,  0,  0,  1)
+MUX_CFG_24XX(Y11_24XX_USB2_DAT,  0x0e8,  2,  0,  0,  1)
+MUX_CFG_24XX(AA12_24XX_USB2_TXEN,0x0e9,  2,  0,  0,  1)
+MUX_CFG_24XX(AA6_24XX_USB2_RCV,  0x0e6,  2,  0,  0,  1)
+MUX_CFG_24XX(AA4_24XX_USB2_TLLSE0,   0x0e7,  2,  0,  0,  1)
+
 /* Keypad GPIO*/
 MUX_CFG_24XX(T19_24XX_KBR0,  0x106,  3,  1,  1,  1)
 MUX_CFG_24XX(R19_24XX_KBR1,  0x107,  3,  1

[PATCH 9/18] ARM: OMAP: abstract debug card setup (smc, leds)

2007-04-09 Thread Tony Lindgren
From: David Brownell [EMAIL PROTECTED]

Additional cleanup for debug boards on H2/P2/H3/H4:  move the init
code that's not board-specific into a new file where it can be easily
shared between all the different boards (avoiding code duplication,
and making it easier to support more devices).  Make H4 use that.

This should be easy to drop in to the OMAP1 boards using these debug
cards; the only difference seems to be that the p2 does an extra reset
of the smc using the fpga (probably all boards could do that, if it's
necessary) and doesn't use the gpio mux or request APIs.

Signed-off-by: David Brownell [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap2/Kconfig|2 +-
 arch/arm/mach-omap2/board-h4.c |   46 +--
 arch/arm/plat-omap/Kconfig |9 +++-
 arch/arm/plat-omap/Makefile|1 +
 arch/arm/plat-omap/debug-devices.c |   86 
 include/asm-arm/arch-omap/board.h  |4 ++
 6 files changed, 102 insertions(+), 46 deletions(-)

Index: linux-2.6/arch/arm/mach-omap2/Kconfig
===
--- linux-2.6.orig/arch/arm/mach-omap2/Kconfig  2007-04-09 15:12:08.0 
-0400
+++ linux-2.6/arch/arm/mach-omap2/Kconfig   2007-04-09 15:25:03.0 
-0400
@@ -21,7 +21,7 @@ config MACH_OMAP_GENERIC
 config MACH_OMAP_H4
bool OMAP 2420 H4 board
depends on ARCH_OMAP2  ARCH_OMAP24XX
-   select OMAP_DEBUG_LEDS if LEDS || LEDS_OMAP_DEBUG
+   select OMAP_DEBUG_DEVICES
 
 config MACH_OMAP_APOLLON
bool OMAP 2420 Apollon board
Index: linux-2.6/arch/arm/mach-omap2/board-h4.c
===
--- linux-2.6.orig/arch/arm/mach-omap2/board-h4.c   2007-04-09 
15:12:08.0 -0400
+++ linux-2.6/arch/arm/mach-omap2/board-h4.c2007-04-09 15:25:03.0 
-0400
@@ -131,26 +131,6 @@ static struct platform_device h4_flash_d
.resource   = h4_flash_resource,
 };
 
-static struct resource h4_smc91x_resources[] = {
-   [0] = {
-   .start  = OMAP24XX_ETHR_START,  /* Physical */
-   .end= OMAP24XX_ETHR_START + 0xf,
-   .flags  = IORESOURCE_MEM,
-   },
-   [1] = {
-   .start  = OMAP_GPIO_IRQ(OMAP24XX_ETHR_GPIO_IRQ),
-   .end= OMAP_GPIO_IRQ(OMAP24XX_ETHR_GPIO_IRQ),
-   .flags  = IORESOURCE_IRQ,
-   },
-};
-
-static struct platform_device h4_smc91x_device = {
-   .name   = smc91x,
-   .id = -1,
-   .num_resources  = ARRAY_SIZE(h4_smc91x_resources),
-   .resource   = h4_smc91x_resources,
-};
-
 /* Select between the IrDA and aGPS module
  */
 static int h4_select_irda(struct device *dev, int state)
@@ -266,29 +246,14 @@ static struct platform_device h4_lcd_dev
.id = -1,
 };
 
-static struct resource h4_led_resources[] = {
-   [0] = {
-   .flags  = IORESOURCE_MEM,
-   },
-};
-
-static struct platform_device h4_led_device = {
-   .name   = omap_dbg_led,
-   .id = -1,
-   .num_resources  = ARRAY_SIZE(h4_led_resources),
-   .resource   = h4_led_resources,
-};
-
 static struct platform_device *h4_devices[] __initdata = {
-   h4_smc91x_device,
h4_flash_device,
h4_irda_device,
h4_kp_device,
h4_lcd_device,
-   h4_led_device,
 };
 
-static inline void __init h4_init_smc91x(void)
+static inline void __init h4_init_debug(void)
 {
/* Make sure CS1 timings are correct */
GPMC_CONFIG1_1 = 0x00011200;
@@ -301,12 +266,8 @@ static inline void __init h4_init_smc91x
udelay(100);
 
omap_cfg_reg(M15_24XX_GPIO92);
-   if (omap_request_gpio(OMAP24XX_ETHR_GPIO_IRQ)  0) {
-   printk(KERN_ERR Failed to request GPIO%d for smc91x IRQ\n,
-   OMAP24XX_ETHR_GPIO_IRQ);
-   return;
-   }
-   omap_set_gpio_direction(OMAP24XX_ETHR_GPIO_IRQ, 1);
+   if (debug_card_init(cs_mem_base, OMAP24XX_ETHR_GPIO_IRQ)  0)
+   gpmc_cs_free(eth_cs);
 }
 
 static void __init omap_h4_init_irq(void)
@@ -314,7 +275,6 @@ static void __init omap_h4_init_irq(void
omap2_init_common_hw();
omap_init_irq();
omap_gpio_init();
-   h4_init_smc91x();
 }
 
 static struct omap_uart_config h4_uart_config __initdata = {
Index: linux-2.6/arch/arm/plat-omap/Kconfig
===
--- linux-2.6.orig/arch/arm/plat-omap/Kconfig   2007-04-09 15:12:08.0 
-0400
+++ linux-2.6/arch/arm/plat-omap/Kconfig2007-04-09 15:25:03.0 
-0400
@@ -19,10 +19,15 @@ endchoice
 
 comment OMAP Feature Selections
 
-config OMAP_DEBUG_LEDS
+config OMAP_DEBUG_DEVICES
bool
help
- For debug card leds on TI reference boards.
+ For debug cards on TI reference boards

[PATCH 10/18] ARM: OMAP: Add minimal OMAP2430 support

2007-04-09 Thread Tony Lindgren
From: Syed Mohammed Khasim [EMAIL PROTECTED]

This patch adds minimal OMAP2430 support to get the kernel booting on 2430SDP.

Signed-off-by: Syed Mohammed Khasim [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap2/Kconfig   |8 +
 arch/arm/mach-omap2/Makefile  |1 +
 arch/arm/mach-omap2/board-2430sdp.c   |  226 +
 arch/arm/mach-omap2/devices.c |2 +-
 arch/arm/mach-omap2/gpmc.c|7 +
 arch/arm/mach-omap2/id.c  |6 +
 arch/arm/mach-omap2/io.c  |   20 +++
 include/asm-arm/arch-omap/board-2430sdp.h |   41 +
 include/asm-arm/arch-omap/hardware.h  |4 +
 include/asm-arm/arch-omap/io.h|   10 ++
 include/asm-arm/arch-omap/omap24xx.h  |   12 ++
 12 files changed, 337 insertions(+), 1 deletions(-)

Index: linux-2.6/arch/arm/mach-omap2/Kconfig
===
--- linux-2.6.orig/arch/arm/mach-omap2/Kconfig  2007-04-09 16:36:46.0 
-0400
+++ linux-2.6/arch/arm/mach-omap2/Kconfig   2007-04-09 16:36:48.0 
-0400
@@ -11,6 +11,10 @@ config ARCH_OMAP2420
select OMAP_DM_TIMER
select ARCH_OMAP_OTG
 
+config ARCH_OMAP2430
+   bool OMAP2430 support
+   depends on ARCH_OMAP24XX
+
 comment OMAP Board Type
depends on ARCH_OMAP2
 
@@ -26,3 +30,7 @@ config MACH_OMAP_H4
 config MACH_OMAP_APOLLON
bool OMAP 2420 Apollon board
depends on ARCH_OMAP2  ARCH_OMAP24XX
+
+config MACH_OMAP_2430SDP
+   bool OMAP 2430 SDP board
+   depends on ARCH_OMAP2  ARCH_OMAP24XX
\ No newline at end of file
Index: linux-2.6/arch/arm/mach-omap2/Makefile
===
--- linux-2.6.orig/arch/arm/mach-omap2/Makefile 2007-04-09 16:36:47.0 
-0400
+++ linux-2.6/arch/arm/mach-omap2/Makefile  2007-04-09 16:36:48.0 
-0400
@@ -14,5 +14,6 @@ obj-$(CONFIG_PM) += pm.o pm-domain.o sle
 # Specific board support
 obj-$(CONFIG_MACH_OMAP_GENERIC)+= board-generic.o
 obj-$(CONFIG_MACH_OMAP_H4) += board-h4.o
+obj-$(CONFIG_MACH_OMAP_2430SDP)+= board-2430sdp.o
 obj-$(CONFIG_MACH_OMAP_APOLLON)+= board-apollon.o
 
Index: linux-2.6/arch/arm/mach-omap2/board-2430sdp.c
===
--- /dev/null   1970-01-01 00:00:00.0 +
+++ linux-2.6/arch/arm/mach-omap2/board-2430sdp.c   2007-04-09 
16:36:48.0 -0400
@@ -0,0 +1,218 @@
+/*
+ * linux/arch/arm/mach-omap2/board-2430sdp.c
+ *
+ * Copyright (C) 2006 Texas Instruments
+ *
+ * Modified from mach-omap2/board-generic.c
+ *
+ * Initial Code : Based on a patch from Komal Shah and Richard Woodruff
+ * Updated the Code for 2430 SDP : Syed Mohammed Khasim
+ *
+ * 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.
+ */
+
+#include linux/kernel.h
+#include linux/init.h
+#include linux/platform_device.h
+#include linux/mtd/mtd.h
+#include linux/mtd/partitions.h
+#include linux/delay.h
+#include linux/err.h
+#include linux/clk.h
+
+#include asm/hardware.h
+#include asm/mach-types.h
+#include asm/mach/arch.h
+#include asm/mach/map.h
+#include asm/mach/flash.h
+
+#include asm/arch/gpio.h
+#include asm/arch/mux.h
+#include asm/arch/board.h
+#include asm/arch/common.h
+#include asm/arch/gpmc.h
+#include prcm-regs.h
+
+#include asm/io.h
+
+
+#defineSDP2430_FLASH_CS0
+#defineSDP2430_SMC91X_CS   5
+
+static struct mtd_partition sdp2430_partitions[] = {
+   /* bootloader (U-Boot, etc) in first sector */
+   {
+   .name   = bootloader,
+   .offset = 0,
+   .size   = SZ_256K,
+   .mask_flags = MTD_WRITEABLE,/* force read-only */
+},
+   /* bootloader params in the next sector */
+   {
+   .name   = params,
+   .offset = MTDPART_OFS_APPEND,
+   .size   = SZ_128K,
+   .mask_flags = 0,
+},
+   /* kernel */
+   {
+   .name   = kernel,
+   .offset = MTDPART_OFS_APPEND,
+   .size   = SZ_2M,
+   .mask_flags = 0
+   },
+   /* file system */
+   {
+   .name   = filesystem,
+   .offset = MTDPART_OFS_APPEND,
+   .size   = MTDPART_SIZ_FULL,
+   .mask_flags = 0
+   }
+};
+
+static struct flash_platform_data sdp2430_flash_data = {
+   .map_name   = cfi_probe,
+   .width  = 2,
+   .parts  = sdp2430_partitions,
+   .nr_parts   = ARRAY_SIZE(sdp2430_partitions),
+};
+
+static struct resource

[PATCH 12/18] ARM: OMAP: TUSB EVM init

2007-04-09 Thread Tony Lindgren
From: David Brownell [EMAIL PROTECTED]

Add init support for the TUSB6010 EVM board, as connected to H4.

Signed-off-by: David Brownell [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap2/usb-tusb6010.c |  333 
 1 files changed, 333 insertions(+), 0 deletions(-)

Index: linux-2.6/arch/arm/mach-omap2/usb-tusb6010.c
===
--- /dev/null   1970-01-01 00:00:00.0 +
+++ linux-2.6/arch/arm/mach-omap2/usb-tusb6010.c2007-04-09 
15:29:32.0 -0400
@@ -0,0 +1,349 @@
+/*
+ * linux/arch/arm/mach-omap2/usb-tusb6010.c
+ *
+ * Copyright (C) 2006 Nokia Corporation
+ *
+ * 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.
+ */
+
+#include linux/types.h
+#include linux/errno.h
+#include linux/delay.h
+#include linux/platform_device.h
+
+#include linux/usb/musb.h
+
+#include asm/arch/gpmc.h
+#include asm/arch/gpio.h
+#include asm/arch/mux.h
+
+
+static u8  async_cs, sync_cs;
+static unsignedrefclk_psec;
+
+
+/* t2_ps, when quantized to fclk units, must happen no earlier than
+ * the clock after after t1_NS.
+ *
+ * Return a possibly updated value of t2_ps, converted to nsec.
+ */
+static unsigned
+next_clk(unsigned t1_NS, unsigned t2_ps, unsigned fclk_ps)
+{
+   unsignedt1_ps = t1_NS * 1000;
+   unsignedt1_f, t2_f;
+
+   if ((t1_ps + fclk_ps)  t2_ps)
+   return t2_ps / 1000;
+
+   t1_f = (t1_ps + fclk_ps - 1) / fclk_ps;
+   t2_f = (t2_ps + fclk_ps - 1) / fclk_ps;
+
+   if (t1_f = t2_f)
+   t2_f = t1_f + 1;
+
+   return (t2_f * fclk_ps) / 1000;
+}
+
+/* NOTE:  timings are from tusb 6010 datasheet Rev 1.8, 12-Sept 2006 */
+
+static int tusb_set_async_mode(unsigned sysclk_ps, unsigned fclk_ps)
+{
+   struct gpmc_timings t;
+   unsignedt_acsnh_advnh = sysclk_ps + 3000;
+   unsignedtmp;
+
+   memset(t, 0, sizeof(t));
+
+   /* CS_ON = t_acsnh_acsnl */
+   t.cs_on = 8;
+   /* ADV_ON = t_acsnh_advnh - t_advn */
+   t.adv_on = next_clk(t.cs_on, t_acsnh_advnh - 7000, fclk_ps);
+
+   /*
+* READ ... from omap2420 TRM fig 12-13
+*/
+
+   /* ADV_RD_OFF = t_acsnh_advnh */
+   t.adv_rd_off = next_clk(t.adv_on, t_acsnh_advnh, fclk_ps);
+
+   /* OE_ON = t_acsnh_advnh + t_advn_oen (then wait for nRDY) */
+   t.oe_on = next_clk(t.adv_on, t_acsnh_advnh + 1000, fclk_ps);
+
+   /* ACCESS = counters continue only after nRDY */
+   tmp = t.oe_on * 1000 + 300;
+   t.access = next_clk(t.oe_on, tmp, fclk_ps);
+
+   /* OE_OFF = after data gets sampled */
+   tmp = t.access * 1000;
+   t.oe_off = next_clk(t.access, tmp, fclk_ps);
+
+   t.cs_rd_off = t.oe_off;
+
+   tmp = t.cs_rd_off * 1000 + 7000 /* t_acsn_rdy_z */;
+   t.rd_cycle = next_clk(t.cs_rd_off, tmp, fclk_ps);
+
+   /*
+* WRITE ... from omap2420 TRM fig 12-15
+*/
+
+   /* ADV_WR_OFF = t_acsnh_advnh */
+   t.adv_wr_off = t.adv_rd_off;
+
+   /* WE_ON = t_acsnh_advnh + t_advn_wen (then wait for nRDY) */
+   t.we_on = next_clk(t.adv_wr_off, t_acsnh_advnh + 1000, fclk_ps);
+
+   /* WE_OFF = after data gets sampled */
+   tmp = t.we_on * 1000 + 300;
+   t.we_off = next_clk(t.we_on, tmp, fclk_ps);
+
+   t.cs_wr_off = t.we_off;
+
+   tmp = t.cs_wr_off * 1000 + 7000 /* t_acsn_rdy_z */;
+   t.wr_cycle = next_clk(t.cs_wr_off, tmp, fclk_ps);
+
+   return gpmc_cs_set_timings(async_cs, t);
+}
+
+static int tusb_set_sync_mode(unsigned sysclk_ps, unsigned fclk_ps)
+{
+   struct gpmc_timings t;
+   unsignedt_scsnh_advnh = sysclk_ps + 3000;
+   unsignedtmp;
+
+   memset(t, 0, sizeof(t));
+   t.cs_on = 8;
+
+   /* ADV_ON = t_acsnh_advnh - t_advn */
+   t.adv_on = next_clk(t.cs_on, t_scsnh_advnh - 7000, fclk_ps);
+
+   /* GPMC_CLK rate = fclk rate / div */
+   t.sync_clk = 12 /* 11.1 nsec */;
+   tmp = (t.sync_clk * 1000 + fclk_ps - 1) / fclk_ps;
+   if (tmp  4)
+   return -ERANGE;
+   if (tmp = 0)
+   tmp = 1;
+   t.page_burst_access = (fclk_ps * tmp) / 1000;
+
+   /*
+* READ ... based on omap2420 TRM fig 12-19, 12-20
+*/
+
+   /* ADV_RD_OFF = t_scsnh_advnh */
+   t.adv_rd_off = next_clk(t.adv_on, t_scsnh_advnh, fclk_ps);
+
+   /* OE_ON = t_scsnh_advnh + t_advn_oen * fclk_ps (then wait for nRDY) */
+   tmp = (t.adv_rd_off * 1000) + (3 * fclk_ps);
+   t.oe_on = next_clk(t.adv_on, tmp, fclk_ps);
+
+   /* ACCESS = number of clock cycles after t_adv_eon */
+   tmp = (t.oe_on * 1000) + (5 * fclk_ps);
+   t.access = next_clk(t.oe_on, tmp, fclk_ps);
+
+   /* OE_OFF

[PATCH 14/18] ARM: OMAP: Merge driver headers from N800 tree

2007-04-09 Thread Tony Lindgren
From: Kai Svahn [EMAIL PROTECTED]

This patch merges omap specific driver headers from
N800 tree.

Signed-off-by: Kai Svahn [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 include/asm-arm/arch-omap/blizzard.h |   12 
 include/asm-arm/arch-omap/eac.h  |  101 ++
 include/asm-arm/arch-omap/menelaus.h |   23 +++-
 include/asm-arm/arch-omap/mmc.h  |   67 ++
 include/asm-arm/arch-omap/onenand.h  |   19 ++
 5 files changed, 221 insertions(+), 1 deletions(-)

--- /dev/null
+++ b/include/asm-arm/arch-omap/blizzard.h
@@ -0,0 +1,12 @@
+#ifndef _BLIZZARD_H
+#define _BLIZZARD_H
+
+struct blizzard_platform_data {
+   void(*power_up)(struct device *dev);
+   void(*power_down)(struct device *dev);
+   unsigned long   (*get_clock_rate)(struct device *dev);
+
+   unsignedte_connected : 1;
+};
+
+#endif
--- /dev/null
+++ b/include/asm-arm/arch-omap/eac.h
@@ -0,0 +1,101 @@
+/*
+ * linux/include/asm-arm/arch-omap2/eac.h
+ *
+ * Defines for Enhanced Audio Controller
+ *
+ * Contact: Jarkko Nikula [EMAIL PROTECTED]
+ *
+ * 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 asm/arch/io.h
+#include asm/arch/hardware.h
+#include asm/irq.h
+
+#include sound/driver.h
+#include sound/core.h
+
+/* 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,
+};
+
+/* configuration structure for I2S mode */
+struct eac_i2s_conf {
+   /* it seems according to TRM that the polarity-changed I2S mode is not
+* only that frame sync polarity (EAC.AC_FS) is changed but also 
direction
+* of it and interface serial clock (EAC.AC_SCLK) */
+   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 */
+   int (* enable_ext_clocks)(struct device *eac_dev);
+   void(* disable_ext_clocks)(struct device *eac_dev);
+};
+
+extern void omap_init_eac(struct eac_platform_data *pdata);
+
+extern int eac_register_codec(struct device *eac_dev, struct eac_codec *codec);
+extern void eac_unregister_codec(struct device *eac_dev);
+
+extern int eac_set_mode(struct device *eac_dev, int play, int rec);
+
+#endif /* __ASM_ARM_ARCH_OMAP2_EAC_H */
--- a/include/asm-arm/arch-omap/menelaus.h
+++ b/include/asm-arm/arch-omap/menelaus.h
@@ -7,6 +7,15 @@
 #ifndef __ASM_ARCH_MENELAUS_H
 #define __ASM_ARCH_MENELAUS_H
 
+struct device;
+
+struct menelaus_platform_data {
+   int (* late_init)(struct device *dev);
+};
+
+/* Call only at init time. */
+extern void menelaus_set_platform_data(struct menelaus_platform_data *pdata);
+
 extern int menelaus_register_mmc_callback(void (*callback)(void *data, u8 
card_mask),
  void *data);
 extern void

[PATCH 18/18] ARM: OMAP: Fix PRCM base register usage for 243x

2007-04-09 Thread Tony Lindgren
From: Kevin Hilman [EMAIL PROTECTED]

The PRCM base register is different on 242x and 243x.  Use
the #ifdef'd #define from omap24xx.h instead of the locally
defined one.

Signed-off-by: Kevin Hilman [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap2/pm.c |3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

--- a/arch/arm/mach-omap2/pm.c
+++ b/arch/arm/mach-omap2/pm.c
@@ -45,7 +45,6 @@
 #include asm/arch/dma.h
 #include asm/arch/board.h
 
-#define PRCM_BASE  0x48008000
 #define PRCM_REVISION  0x000
 #define PRCM_SYSCONFIG 0x010
 #define PRCM_IRQSTATUS_MPU 0x018
@@ -144,7 +143,7 @@ static void (*omap2_sram_idle)(void);
 static void (*omap2_sram_suspend)(int dllctrl);
 static void (*saved_idle)(void);
 
-static u32 prcm_base = IO_ADDRESS(PRCM_BASE);
+static u32 prcm_base = IO_ADDRESS(OMAP24XX_PRCM_BASE);
 
 static inline void prcm_write_reg(int idx, u32 val)
 {

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 4/7] ARM: OMAP: cleanup apollon board

2007-04-09 Thread Tony Lindgren
From: Kyungmin Park [EMAIL PROTECTED]

- Add etherent gpmc handling
- Remove unused mux setting
- Add MMC switch pin comments

Signed-off-by: Kyungmin Park [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap2/board-apollon.c |   50 ++
 1 files changed, 38 insertions(+), 12 deletions(-)

--- a/arch/arm/mach-omap2/board-apollon.c
+++ b/arch/arm/mach-omap2/board-apollon.c
@@ -27,6 +27,8 @@
 #include linux/delay.h
 #include linux/leds.h
 #include linux/irq.h
+#include linux/err.h
+#include linux/clk.h
 
 #include asm/hardware.h
 #include asm/mach-types.h
@@ -187,16 +189,42 @@ static struct platform_device *apollon_devices[] 
__initdata = {
 static inline void __init apollon_init_smc91x(void)
 {
unsigned long base;
+   unsigned int rate;
+   struct clk *l3ck;
+   int eth_cs;
+
+   l3ck = clk_get(NULL, core_l3_ck);
+   if (IS_ERR(l3ck))
+   rate = 1;
+   else
+   rate = clk_get_rate(l3ck);
+
+   eth_cs = APOLLON_ETH_CS;
 
/* Make sure CS1 timings are correct */
-   GPMC_CONFIG1_1 = 0x00011203;
-   GPMC_CONFIG2_1 = 0x001f1f01;
-   GPMC_CONFIG3_1 = 0x00080803;
-   GPMC_CONFIG4_1 = 0x1c091c09;
-   GPMC_CONFIG5_1 = 0x041f1f1f;
-   GPMC_CONFIG6_1 = 0x04c4;
-
-   if (gpmc_cs_request(APOLLON_ETH_CS, SZ_16M, base)  0) {
+   gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG1, 0x00011200);
+
+   if (rate = 16000) {
+   gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG2, 0x001f1f01);
+   gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG3, 0x00080803);
+   gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG4, 0x1c0b1c0a);
+   gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG5, 0x041f1F1F);
+   gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG6, 0x04C4);
+   } else if (rate = 13000) {
+   gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG2, 0x001f1f00);
+   gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG3, 0x00080802);
+   gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG4, 0x1C091C09);
+   gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG5, 0x041f1F1F);
+   gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG6, 0x04C4);
+   } else {/* rate = 1 */
+   gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG2, 0x001f1f00);
+   gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG3, 0x00080802);
+   gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG4, 0x1C091C09);
+   gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG5, 0x031A1F1F);
+   gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG6, 0x03C2);
+   }
+
+   if (gpmc_cs_request(eth_cs, SZ_16M, base)  0) {
printk(KERN_ERR Failed to request GPMC CS for smc91x\n);
return;
}
@@ -208,7 +236,7 @@ static inline void __init apollon_init_smc91x(void)
if (omap_request_gpio(APOLLON_ETHR_GPIO_IRQ)  0) {
printk(KERN_ERR Failed to request GPIO%d for smc91x IRQ\n,
APOLLON_ETHR_GPIO_IRQ);
-   gpmc_cs_free(APOLLON_ETH_CS);
+   gpmc_cs_free(eth_cs);
return;
}
omap_set_gpio_direction(APOLLON_ETHR_GPIO_IRQ, 1);
@@ -232,6 +260,7 @@ static struct omap_mmc_config apollon_mmc_config __initdata 
= {
.wire4  = 1,
.wp_pin = -1,
.power_pin  = -1,
+   /* Note: If you want to detect card feature, please assign 37 */
.switch_pin = -1,
},
 };
@@ -336,9 +365,6 @@ static void __init omap_apollon_init(void)
apollon_flash_init();
apollon_usb_init();
 
-   /* REVISIT: where's the correct place */
-   omap_cfg_reg(W19_24XX_SYS_NIRQ);
-
/* Use Interal loop-back in MMC/SDIO Module Input Clock selection */
CONTROL_DEVCONF |= (1  24);
 
-- 
1.4.4.2

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 0/7] ARM: OMAP: Board updates and additions for OMAP2

2007-04-09 Thread Tony Lindgren
Hi,

The following patch series contains updates board updates and
additions for OMAP2 code.

This is take #2 of the earlier 90 patch mountain, which has
been split into six smaller series.

Regards,

Tony

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 6/7] ARM: OMAP: Replace mach-omap/omap2 with mach-omap2

2007-04-09 Thread Tony Lindgren
From: Trilok Soni [EMAIL PROTECTED]

Update board Apollon with correct file path.

Signed-off-by: Trilok Soni [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap2/board-apollon.c|2 +-
 arch/arm/mach-omap2/usb-tusb6010.c |2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

--- a/arch/arm/mach-omap2/board-apollon.c
+++ b/arch/arm/mach-omap2/board-apollon.c
@@ -4,7 +4,7 @@
  * Copyright (C) 2005,2006 Samsung Electronics
  * Author: Kyungmin Park [EMAIL PROTECTED]
  *
- * Modified from mach-omap/omap2/board-h4.c
+ * Modified from mach-omap2/board-h4.c
  *
  * Code for apollon OMAP2 board. Should work on many OMAP2 systems where
  * the bootloader passes the board-specific data to the kernel.

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/7] ARM: OMAP: Fix typo in board-h4.h

2007-04-09 Thread Tony Lindgren
From: Komal Shah [EMAIL PROTECTED]

Replace OMAP1610 with OMAP2420.

Signed-off-by: Komal Shah [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 include/asm-arm/arch-omap/board-h4.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

--- a/include/asm-arm/arch-omap/board-h4.h
+++ b/include/asm-arm/arch-omap/board-h4.h
@@ -1,7 +1,7 @@
 /*
  * linux/include/asm-arm/arch-omap/board-h4.h
  *
- * Hardware definitions for TI OMAP1610 H4 board.
+ * Hardware definitions for TI OMAP2420 H4 board.
  *
  * Initial creation by Dirk Behme [EMAIL PROTECTED]
  *
-- 
1.4.4.2

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/7] ARM: OMAP: USB peripheral support on H4

2007-04-09 Thread Tony Lindgren
From: David Brownell [EMAIL PROTECTED]

H4 has two peripheral ports, one for download and one for OTG.
The one to use is selected through Kconfig.

Signed-off-by: David Brownell [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap2/Kconfig|   21 ++
 arch/arm/mach-omap2/board-h4.c |   46 
 2 files changed, 67 insertions(+), 0 deletions(-)

Index: linux-2.6/arch/arm/mach-omap2/Kconfig
===
--- linux-2.6.orig/arch/arm/mach-omap2/Kconfig  2007-04-09 15:34:44.0 
-0400
+++ linux-2.6/arch/arm/mach-omap2/Kconfig   2007-04-09 15:35:08.0 
-0400
@@ -27,6 +27,27 @@ config MACH_OMAP_H4
depends on ARCH_OMAP2  ARCH_OMAP24XX
select OMAP_DEBUG_DEVICES
 
+config MACH_OMAP_H4_OTG
+   bool Use USB OTG connector, not device connector (S1.10)
+   depends on MACH_OMAP_H4
+   help
+ Set this if you've set S1.10 (on the mainboard) to use the
+ Mini-AB (OTG) connector and OTG transceiver with the USB0
+ port, instead of the Mini-B (download) connector with its
+ non-OTG transceiver.
+
+ Note that the download connector can be used to bootstrap
+ the system from the OMAP mask ROM.  Also, since this is a
+ development platform, you can also force the OTG port into
+ a non-OTG operational mode.
+
+config MACH_OMAP2_H4_USB1
+   bool Use USB1 port, not UART2 (S3.3)
+   depends on MACH_OMAP_H4
+   help
+ Set this if you've set SW3.3 (on the CPU card) so that the
+ expansion connectors receive USB1 signals instead of UART2.
+
 config MACH_OMAP_APOLLON
bool OMAP 2420 Apollon board
depends on ARCH_OMAP2  ARCH_OMAP24XX
Index: linux-2.6/arch/arm/mach-omap2/board-h4.c
===
--- linux-2.6.orig/arch/arm/mach-omap2/board-h4.c   2007-04-09 
15:33:31.0 -0400
+++ linux-2.6/arch/arm/mach-omap2/board-h4.c2007-04-09 15:35:08.0 
-0400
@@ -278,7 +278,11 @@ static void __init omap_h4_init_irq(void
 }
 
 static struct omap_uart_config h4_uart_config __initdata = {
+#ifdef CONFIG_MACH_OMAP2_H4_USB1
+   .enabled_uarts = ((1  0) | (1  1)),
+#else
.enabled_uarts = ((1  0) | (1  1) | (1  2)),
+#endif
 };
 
 static struct omap_mmc_config h4_mmc_config __initdata = {
@@ -295,10 +299,44 @@ static struct omap_lcd_config h4_lcd_con
.ctrl_name  = internal,
 };
 
+static struct omap_usb_config h4_usb_config __initdata = {
+#ifdef CONFIG_MACH_OMAP2_H4_USB1
+   /* NOTE:  usb1 could also be used with 3 wire signaling */
+   .pins[1]= 4,
+#endif
+
+#ifdef CONFIG_MACH_OMAP_H4_OTG
+   /* S1.10 ON -- USB OTG port
+* usb0 switched to Mini-AB port and isp1301 transceiver;
+* S2.POS3 = OFF, S2.POS4 = ON ... to allow battery charging
+*/
+   .otg= 1,
+   .pins[0]= 4,
+#ifdef CONFIG_USB_GADGET_OMAP
+   /* use OTG cable, or standard A-to-MiniB */
+   .hmc_mode   = 0x14, /* 0:dev/otg 1:host 2:disable */
+#elif  defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
+   /* use OTG cable, or NONSTANDARD (B-to-MiniB) */
+   .hmc_mode   = 0x11, /* 0:host 1:host 2:disable */
+#endif /* XX */
+
+#else
+   /* S1.10 OFF -- usb download port
+* usb0 switched to Mini-B port and isp1105 transceiver;
+* S2.POS3 = ON, S2.POS4 = OFF ... to enable battery charging
+*/
+   .register_dev   = 1,
+   .pins[0]= 3,
+// .hmc_mode   = 0x14, /* 0:dev 1:host 2:disable */
+   .hmc_mode   = 0x00, /* 0:dev|otg 1:disable 2:disable */
+#endif
+};
+
 static struct omap_board_config_kernel h4_config[] = {
{ OMAP_TAG_UART,h4_uart_config },
{ OMAP_TAG_MMC, h4_mmc_config },
{ OMAP_TAG_LCD, h4_lcd_config },
+   { OMAP_TAG_USB, h4_usb_config },
 };
 
 static void __init omap_h4_init(void)
@@ -321,6 +359,14 @@ static void __init omap_h4_init(void)
}
 #endif
 
+#ifdef CONFIG_MACH_OMAP2_H4_USB1
+   /* S3.3 controls whether these pins are for UART2 or USB1 */
+   omap_cfg_reg(N14_24XX_USB1_SE0);
+   omap_cfg_reg(P15_24XX_USB1_DAT);
+   omap_cfg_reg(W20_24XX_USB1_TXEN);
+   omap_cfg_reg(V19_24XX_USB1_RCV);
+#endif
+
platform_add_devices(h4_devices, ARRAY_SIZE(h4_devices));
omap_board_config = h4_config;
omap_board_config_size = ARRAY_SIZE(h4_config);
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 5/7] ARM: OMAP: Merge board specific files from N800 tree

2007-04-09 Thread Tony Lindgren
From: Kai Svahn [EMAIL PROTECTED]

This patch merges board specific files from N800 tree.
Nokia has published the files at:

http://repository.maemo.org/pool/maemo3.0/free/source/
kernel-source-rx-34_2.6.18.orig.tar.gz
kernel-source-rx-34_2.6.18-osso29.diff.gz

Signed-off-by: Kai Svahn [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]

Index: linux-2.6/arch/arm/mach-omap2/Kconfig
===
--- linux-2.6.orig/arch/arm/mach-omap2/Kconfig  2007-04-09 16:21:18.0 
-0400
+++ linux-2.6/arch/arm/mach-omap2/Kconfig   2007-04-09 16:21:18.0 
-0400
@@ -54,4 +54,13 @@ config MACH_OMAP_APOLLON
 
 config MACH_OMAP_2430SDP
bool OMAP 2430 SDP board
-   depends on ARCH_OMAP2  ARCH_OMAP24XX
\ No newline at end of file
+   depends on ARCH_OMAP2  ARCH_OMAP24XX
+
+config MACH_NOKIA_N800
+   bool Nokia N800
+   depends on ARCH_OMAP24XX
+
+config MACH_OMAP2_TUSB6010
+   bool
+   depends on ARCH_OMAP2  ARCH_OMAP2420
+   default y if MACH_NOKIA_N800
\ No newline at end of file
Index: linux-2.6/arch/arm/mach-omap2/Makefile
===
--- linux-2.6.orig/arch/arm/mach-omap2/Makefile 2007-04-09 16:21:17.0 
-0400
+++ linux-2.6/arch/arm/mach-omap2/Makefile  2007-04-09 16:21:18.0 
-0400
@@ -16,4 +16,8 @@ obj-$(CONFIG_MACH_OMAP_GENERIC)   += boar
 obj-$(CONFIG_MACH_OMAP_H4) += board-h4.o
 obj-$(CONFIG_MACH_OMAP_2430SDP)+= board-2430sdp.o
 obj-$(CONFIG_MACH_OMAP_APOLLON)+= board-apollon.o
+obj-$(CONFIG_MACH_NOKIA_N800)  += board-n800.o board-n800-flash.o \
+  board-n800-mmc.o board-n800-bt.o \
+  board-n800-audio.o board-n800-usb.o \
+  board-n800-dsp.o board-n800-pm.o
 
Index: linux-2.6/arch/arm/mach-omap2/board-n800-audio.c
===
--- /dev/null   1970-01-01 00:00:00.0 +
+++ linux-2.6/arch/arm/mach-omap2/board-n800-audio.c2007-04-09 
16:21:18.0 -0400
@@ -0,0 +1,366 @@
+/*
+ * linux/arch/arm/mach-omap2/board-n800-audio.c
+ *
+ * Copyright (C) 2006 Nokia Corporation
+ * Contact: Juha Yrjola
+ *  Jarkko Nikula [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.
+ *
+ * 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
+ *
+ */
+
+#include linux/err.h
+#include linux/clk.h
+#include linux/platform_device.h
+#include linux/spi/tsc2301.h
+
+#include asm/io.h
+#include asm/arch/eac.h
+
+#include ../plat-omap/dsp/dsp_common.h
+
+#if defined(CONFIG_SPI_TSC2301_AUDIO)  defined(CONFIG_SND_OMAP24XX_EAC)
+#define AUDIO_ENABLED
+
+static struct clk *sys_clkout2;
+static struct clk *func96m_clk;
+static struct device *eac_device;
+static struct device *tsc2301_device;
+
+static int enable_audio;
+static int audio_ok;
+static spinlock_t audio_lock;
+
+/*
+ * Leaving EAC and sys_clkout2 pins multiplexed to those subsystems results
+ * in about 2 mA extra current leak when audios are powered down. The
+ * workaround is to multiplex them to protected mode (with pull-ups enabled)
+ * whenever audio is not being used.
+ */
+static int eac_mux_disabled = 0;
+static int clkout2_mux_disabled = 0;
+static u32 saved_mux[2];
+
+static void n800_enable_eac_mux(void)
+{
+   if (!eac_mux_disabled)
+   return;
+   __raw_writel(saved_mux[1], IO_ADDRESS(0x48000124));
+   eac_mux_disabled = 0;
+}
+
+static void n800_disable_eac_mux(void)
+{
+   if (eac_mux_disabled) {
+   WARN_ON(eac_mux_disabled);
+   return;
+   }
+   saved_mux[1] = __raw_readl(IO_ADDRESS(0x48000124));
+   __raw_writel(0x1f1f1f1f, IO_ADDRESS(0x48000124));
+   eac_mux_disabled = 1;
+}
+
+static void n800_enable_clkout2_mux(void)
+{
+   if (!clkout2_mux_disabled)
+   return;
+   __raw_writel(saved_mux[0], IO_ADDRESS(0x48e8));
+   clkout2_mux_disabled = 0;
+}
+
+static void n800_disable_clkout2_mux(void)
+{
+   u32 l;
+
+   if (clkout2_mux_disabled) {
+   WARN_ON(clkout2_mux_disabled);
+   return;
+   }
+   saved_mux[0] = __raw_readl(IO_ADDRESS(0x48e8));
+   l = saved_mux[0]  ~0xff;
+   l |= 0x1f;
+   __raw_writel(l

[PATCH 7/7] ARM: OMAP: Add apollon gpio keys using gpio-keys input

2007-04-09 Thread Tony Lindgren
From: Kyungmin Park [EMAIL PROTECTED]

Add apollon gpio keys using gpio-keys input

Signed-off-by: Kyungmin Park [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap2/Makefile |3 +-
 arch/arm/mach-omap2/board-apollon-keys.c |   79 ++
 arch/arm/mach-omap2/board-apollon.c  |   53 
 3 files changed, 81 insertions(+), 54 deletions(-)

Index: linux-2.6/arch/arm/mach-omap2/Makefile
===
--- linux-2.6.orig/arch/arm/mach-omap2/Makefile 2007-04-09 16:21:18.0 
-0400
+++ linux-2.6/arch/arm/mach-omap2/Makefile  2007-04-09 16:21:52.0 
-0400
@@ -15,7 +15,8 @@ obj-$(CONFIG_PM) += pm.o sleep.o
 obj-$(CONFIG_MACH_OMAP_GENERIC)+= board-generic.o
 obj-$(CONFIG_MACH_OMAP_H4) += board-h4.o
 obj-$(CONFIG_MACH_OMAP_2430SDP)+= board-2430sdp.o
-obj-$(CONFIG_MACH_OMAP_APOLLON)+= board-apollon.o
+obj-$(CONFIG_MACH_OMAP_APOLLON)+= board-apollon.o \
+  board-apollon-keys.o
 obj-$(CONFIG_MACH_NOKIA_N800)  += board-n800.o board-n800-flash.o \
   board-n800-mmc.o board-n800-bt.o \
   board-n800-audio.o board-n800-usb.o \
Index: linux-2.6/arch/arm/mach-omap2/board-apollon-keys.c
===
--- /dev/null   1970-01-01 00:00:00.0 +
+++ linux-2.6/arch/arm/mach-omap2/board-apollon-keys.c  2007-04-09 
16:21:52.0 -0400
@@ -0,0 +1,79 @@
+/*
+ * linux/arch/arm/mach-omap2/board-apollon-keys.c
+ *
+ * Copyright (C) 2007 Samsung Electronics
+ * Author: Kyungmin Park [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.
+ */
+
+#include linux/kernel.h
+#include linux/init.h
+#include linux/platform_device.h
+#include linux/input.h
+#include linux/gpio_keys.h
+
+#include asm/arch/gpio.h
+#include asm/arch/mux.h
+
+#define SW_ENTER_GPIO1616
+#define SW_UP_GPIO17   17
+#define SW_DOWN_GPIO58 58
+
+static struct gpio_keys_button apollon_gpio_keys_buttons[] = {
+   [0] = {
+   .keycode= KEY_ENTER,
+   .gpio   = SW_ENTER_GPIO16,
+   .desc   = enter sw,
+   },
+   [1] = {
+   .keycode= KEY_UP,
+   .gpio   = SW_UP_GPIO17,
+   .desc   = up sw,
+   },
+   [2] = {
+   .keycode= KEY_DOWN,
+   .gpio   = SW_DOWN_GPIO58,
+   .desc   = down sw,
+   },
+};
+
+static struct gpio_keys_platform_data apollon_gpio_keys = {
+   .buttons= apollon_gpio_keys_buttons,
+   .nbuttons   = ARRAY_SIZE(apollon_gpio_keys_buttons),
+};
+
+static struct platform_device apollon_gpio_keys_device = {
+   .name   = gpio-keys,
+   .id = -1,
+   .dev= {
+   .platform_data  = apollon_gpio_keys,
+   },
+};
+
+static void __init apollon_sw_init(void)
+{
+   /* Enter SW - Y11 */
+   omap_cfg_reg(Y11_242X_GPIO16);
+   omap_request_gpio(SW_ENTER_GPIO16);
+   omap_set_gpio_direction(SW_ENTER_GPIO16, 1);
+   /* Up SW - AA12 */
+   omap_cfg_reg(AA12_242X_GPIO17);
+   omap_request_gpio(SW_UP_GPIO17);
+   omap_set_gpio_direction(SW_UP_GPIO17, 1);
+   /* Down SW - AA8 */
+   omap_cfg_reg(AA8_242X_GPIO58);
+   omap_request_gpio(SW_DOWN_GPIO58);
+   omap_set_gpio_direction(SW_DOWN_GPIO58, 1);
+}
+
+static int __init omap_apollon_keys_init(void)
+{
+   apollon_sw_init();
+
+   return platform_device_register(apollon_gpio_keys_device);
+}
+
+arch_initcall(omap_apollon_keys_init);
Index: linux-2.6/arch/arm/mach-omap2/board-apollon.c
===
--- linux-2.6.orig/arch/arm/mach-omap2/board-apollon.c  2007-04-09 
16:21:41.0 -0400
+++ linux-2.6/arch/arm/mach-omap2/board-apollon.c   2007-04-09 
16:21:52.0 -0400
@@ -22,11 +22,8 @@
 #include linux/mtd/mtd.h
 #include linux/mtd/partitions.h
 #include linux/mtd/onenand.h
-#include linux/irq.h
-#include linux/interrupt.h
 #include linux/delay.h
 #include linux/leds.h
-#include linux/irq.h
 #include linux/err.h
 #include linux/clk.h
 
@@ -48,9 +45,6 @@
 #define LED0_GPIO1313
 #define LED1_GPIO1414
 #define LED2_GPIO1515
-#define SW_ENTER_GPIO1616
-#define SW_UP_GPIO17   17
-#define SW_DOWN_GPIO58 58
 
 #define APOLLON_FLASH_CS   0
 #define APOLLON_ETH_CS 1
@@ -302,52 +296,6 @@ static void __init

[PATCH 3/7] ARM: OMAP: Sync H4 board init with linux-omap

2007-04-09 Thread Tony Lindgren
This patch syncs H4 board init with linux-omap tree.

Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap2/board-h4.c|  180 +++--
 10 files changed, 380 insertions(+), 176 deletions(-)

--- a/arch/arm/mach-omap2/board-h4.c
+++ b/arch/arm/mach-omap2/board-h4.c
@@ -19,6 +19,8 @@
 #include linux/delay.h
 #include linux/workqueue.h
 #include linux/input.h
+#include linux/err.h
+#include linux/clk.h
 
 #include asm/hardware.h
 #include asm/mach-types.h
@@ -36,10 +38,14 @@
 #include asm/arch/keypad.h
 #include asm/arch/menelaus.h
 #include asm/arch/dma.h
+#include asm/arch/gpmc.h
 #include prcm-regs.h
 
 #include asm/io.h
 
+#define H4_FLASH_CS0
+#define H4_SMC91X_CS   1
+
 static unsigned int row_gpios[6] = { 88, 89, 124, 11, 6, 96 };
 static unsigned int col_gpios[7] = { 90, 91, 100, 36, 12, 97, 98 };
 
@@ -116,8 +122,6 @@ static struct flash_platform_data h4_flash_data = {
 };
 
 static struct resource h4_flash_resource = {
-   .start  = H4_CS0_BASE,
-   .end= H4_CS0_BASE + SZ_64M - 1,
.flags  = IORESOURCE_MEM,
 };
 
@@ -133,6 +137,7 @@ static struct platform_device h4_flash_device = {
 
 /* Select between the IrDA and aGPS module
  */
+#if defined(CONFIG_OMAP_IR) || defined(CONFIG_OMAP_IR_MODULE)
 static int h4_select_irda(struct device *dev, int state)
 {
unsigned char expa;
@@ -192,6 +197,10 @@ static int h4_transceiver_mode(struct device *dev, int 
mode)
 
return 0;
 }
+#else
+static int h4_select_irda(struct device *dev, int state) { return 0; }
+static int h4_transceiver_mode(struct device *dev, int mode) { return 0; }
+#endif
 
 static struct omap_irda_config h4_irda_data = {
.transceiver_cap= IR_SIRMODE | IR_MIRMODE | IR_FIRMODE,
@@ -253,16 +262,80 @@ static struct platform_device *h4_devices[] __initdata = {
h4_lcd_device,
 };
 
+/* 2420 Sysboot setup (2430 is different) */
+static u32 get_sysboot_value(void)
+{
+   return (omap_readl(OMAP242X_CONTROL_STATUS)  0xFFF);
+}
+
+/* FIXME: This function should be moved to some other file, gpmc.c? */
+
+/* H4-2420's always used muxed mode, H4-2422's always use non-muxed
+ *
+ * Note: OMAP-GIT doesn't correctly do is_cpu_omap2422 and is_cpu_omap2423
+ *  correctly.  The macro needs to look at production_id not just hawkeye.
+ */
+static u32 is_gpmc_muxed(void)
+{
+   u32 mux;
+   mux = get_sysboot_value();
+   if ((mux  0xF) == 0xd)
+   return 1;   /* NAND config (could be either) */
+   if (mux  0x2)  /* if mux'ed */
+   return 1;
+   else
+   return 0;
+}
+
 static inline void __init h4_init_debug(void)
 {
+   int eth_cs;
+   unsigned long cs_mem_base;
+   unsigned int muxed, rate;
+   struct clk *l3ck;
+
+   eth_cs  = H4_SMC91X_CS;
+
+   l3ck = clk_get(NULL, core_l3_ck);
+   if (IS_ERR(l3ck))
+   rate = 1;
+   else
+   rate = clk_get_rate(l3ck);
+
+   if (is_gpmc_muxed())
+   muxed = 0x200;
+   else
+   muxed = 0;
+
/* Make sure CS1 timings are correct */
-   GPMC_CONFIG1_1 = 0x00011200;
-   GPMC_CONFIG2_1 = 0x001f1f01;
-   GPMC_CONFIG3_1 = 0x00080803;
-   GPMC_CONFIG4_1 = 0x1c091c09;
-   GPMC_CONFIG5_1 = 0x041f1f1f;
-   GPMC_CONFIG6_1 = 0x04c4;
-   GPMC_CONFIG7_1 = 0x0f40 | (0x0800  24);
+   gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG1,
+ 0x00011000 | muxed);
+
+   if (rate = 16000) {
+   gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG2, 0x001f1f01);
+   gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG3, 0x00080803);
+   gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG4, 0x1c0b1c0a);
+   gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG5, 0x041f1F1F);
+   gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG6, 0x04C4);
+   } else if (rate = 13000) {
+   gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG2, 0x001f1f00);
+   gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG3, 0x00080802);
+   gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG4, 0x1C091C09);
+   gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG5, 0x041f1F1F);
+   gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG6, 0x04C4);
+   } else {/* rate = 1 */
+   gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG2, 0x001f1f00);
+   gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG3, 0x00080802);
+   gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG4, 0x1C091C09);
+   gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG5, 0x031A1F1F);
+   gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG6, 0x03C2);
+   }
+
+   if (gpmc_cs_request(eth_cs, SZ_16M, cs_mem_base)  0) {
+   printk(KERN_ERR Failed to request GPMC mem for smc91x\n);
+   return;
+   }
+
udelay(100);
 
omap_cfg_reg(M15_24XX_GPIO92

[PATCH 13/18] ARM: OMAP: Merge gpmc changes from N800 tree

2007-04-09 Thread Tony Lindgren
From: Kai Svahn [EMAIL PROTECTED]

This patch merges gpmc changes from N800 tree
and adds gpmc_get_fclk_period() to gpmc.h.

Signed-off-by: Kai Svahn [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap2/gpmc.c   |7 +++
 include/asm-arm/arch-omap/gpmc.h |1 +
 2 files changed, 8 insertions(+), 0 deletions(-)

Index: linux-2.6/arch/arm/mach-omap2/gpmc.c
===
--- linux-2.6.orig/arch/arm/mach-omap2/gpmc.c   2007-04-09 16:36:48.0 
-0400
+++ linux-2.6/arch/arm/mach-omap2/gpmc.c2007-04-09 16:36:54.0 
-0400
@@ -111,6 +111,13 @@ unsigned int gpmc_ns_to_ticks(unsigned i
return (time_ns * 1000 + tick_ps - 1) / tick_ps;
 }
 
+unsigned int gpmc_round_ns_to_ticks(unsigned int time_ns)
+{
+   unsigned long ticks = gpmc_ns_to_ticks(time_ns);
+
+   return ticks * gpmc_get_fclk_period() / 1000;
+}
+
 #ifdef DEBUG
 static int set_gpmc_timing_reg(int cs, int reg, int st_bit, int end_bit,
   int time, const char *name)
Index: linux-2.6/include/asm-arm/arch-omap/gpmc.h
===
--- linux-2.6.orig/include/asm-arm/arch-omap/gpmc.h 2007-04-09 
16:36:41.0 -0400
+++ linux-2.6/include/asm-arm/arch-omap/gpmc.h  2007-04-09 16:36:54.0 
-0400
@@ -81,6 +81,8 @@ struct gpmc_timings {
 };
 
 extern unsigned int gpmc_ns_to_ticks(unsigned int time_ns);
+extern unsigned int gpmc_round_ns_to_ticks(unsigned int time_ns);
+extern unsigned long gpmc_get_fclk_period(void);
 
 extern void gpmc_cs_write_reg(int cs, int idx, u32 val);
 extern u32 gpmc_cs_read_reg(int cs, int idx);
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 16/18] ARM: OMAP: 243x: Add mappings for SDRC and SMS

2007-04-09 Thread Tony Lindgren
From: Kevin Hilman [EMAIL PROTECTED]

Add mappings for SDRC ans SMS so that omap2_memory_init() works on the
2430.  This also allows the mpurate= command-line option to work.

Signed-off-by: Kevin Hilman [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap2/io.c |   17 -
 include/asm-arm/arch-omap/io.h   |7 +++
 include/asm-arm/arch-omap/omap24xx.h |3 ++-
 3 files changed, 21 insertions(+), 6 deletions(-)

Index: linux-2.6/arch/arm/mach-omap2/io.c
===
--- linux-2.6.orig/arch/arm/mach-omap2/io.c 2007-04-09 15:34:44.0 
-0400
+++ linux-2.6/arch/arm/mach-omap2/io.c  2007-04-09 15:34:49.0 -0400
@@ -55,6 +55,18 @@ static struct map_desc omap2_io_desc[] _
.length = OMAP243X_GPMC_SIZE,
.type   = MT_DEVICE
},
+   {
+   .virtual= OMAP243X_SDRC_VIRT,
+   .pfn= __phys_to_pfn(OMAP243X_SDRC_PHYS),
+   .length = OMAP243X_SDRC_SIZE,
+   .type   = MT_DEVICE
+   },
+   {
+   .virtual= OMAP243X_SMS_VIRT,
+   .pfn= __phys_to_pfn(OMAP243X_SMS_PHYS),
+   .length = OMAP243X_SMS_SIZE,
+   .type   = MT_DEVICE
+   },
 #endif
{
.virtual= DSP_MEM_24XX_VIRT,
@@ -96,11 +108,6 @@ void __init omap2_init_common_hw(void)
 {
omap2_mux_init();
omap2_clk_init();
-/*
- * Need to Fix this for 2430
- */
-#ifndef CONFIG_ARCH_OMAP2430
omap2_init_memory();
-#endif
gpmc_init();
 }
Index: linux-2.6/include/asm-arm/arch-omap/io.h
===
--- linux-2.6.orig/include/asm-arm/arch-omap/io.h   2007-04-09 
15:34:44.0 -0400
+++ linux-2.6/include/asm-arm/arch-omap/io.h2007-04-09 15:34:49.0 
-0400
@@ -80,6 +80,13 @@
 #define OMAP243X_GPMC_PHYS OMAP243X_GPMC_BASE  /* 0x4900 */
 #define OMAP243X_GPMC_VIRT 0xFE00
 #define OMAP243X_GPMC_SIZE SZ_1M
+#define OMAP243X_SDRC_PHYS OMAP24XX_SDRC_BASE
+#define OMAP243X_SDRC_VIRT 0xFD00
+#define OMAP243X_SDRC_SIZE SZ_1M
+#define OMAP243X_SMS_PHYS  OMAP243X_SMS_BASE
+#define OMAP243X_SMS_VIRT  0xFC00
+#define OMAP243X_SMS_SIZE  SZ_1M
+
 #endif
 
 #define IO_OFFSET  0x9000
Index: linux-2.6/include/asm-arm/arch-omap/omap24xx.h
===
--- linux-2.6.orig/include/asm-arm/arch-omap/omap24xx.h 2007-04-09 
15:34:44.0 -0400
+++ linux-2.6/include/asm-arm/arch-omap/omap24xx.h  2007-04-09 
15:34:49.0 -0400
@@ -27,8 +27,9 @@
 #ifdef CONFIG_ARCH_OMAP2430
 #define OMAP24XX_32KSYNCT_BASE (L4_WK_243X_BASE + 0x2)
 #define OMAP24XX_PRCM_BASE (L4_WK_243X_BASE + 0x6000)
-#define OMAP24XX_SDRC_BASE (0x6D00)
 #define OMAP242X_CONTROL_STATUS(L4_24XX_BASE + 0x2f8)
+#define OMAP243X_SMS_BASE  0x6C00
+#define OMAP24XX_SDRC_BASE 0x6D00
 #define OMAP243X_GPMC_BASE 0x6E00
 #endif
 
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3/18] ARM: OMAP: Enable serial idling and wakeup features

2007-04-09 Thread Tony Lindgren
From: Juha Yrjola [EMAIL PROTECTED]

Enable serial idling and wakeup features

Signed-off-by: Juha Yrjola [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap2/serial.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -84,7 +84,7 @@ static inline void __init omap_serial_reset(struct 
plat_serial8250_port *p)
serial_write_reg(p, UART_OMAP_MDR1, 0x07);
serial_write_reg(p, UART_OMAP_SCR, 0x08);
serial_write_reg(p, UART_OMAP_MDR1, 0x00);
-   serial_write_reg(p, UART_OMAP_SYSC, 0x01);
+   serial_write_reg(p, UART_OMAP_SYSC, (0x02  3) | (1  2) | (1  0));
 }
 
 void __init omap_serial_init()
-- 
1.4.4.2

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 8/18] ARM: OMAP: omap2/gpmc updates

2007-04-09 Thread Tony Lindgren
From: David Brownell [EMAIL PROTECTED]

GPMC updates:
 - bugfixes: wrong/missing flags, omitted write, wrong test
 - don't map memory segments starting at zero
 - improve debug messaging
 - export gpmc_get_fclk_perio]d() since it's needed to calc timings
 - expect gpmc_cs_set_timings() caller to have initialized sync vs async

Note that this API is glitchy; likely the best fix would be to add
a member to struct gpmc_timings to hold GPMC_CONFIG1, since that
holds one key aspect of the GPMC timings (the gpmc_fclk divisor,
and sync vs. async == whether that divisor matters).

Signed-off-by: David Brownell [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap2/gpmc.c   |   33 ++---
 include/asm-arm/arch-omap/gpmc.h |3 ++-
 2 files changed, 24 insertions(+), 12 deletions(-)

--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -88,7 +88,7 @@ u32 gpmc_cs_read_reg(int cs, int idx)
 }
 
 /* TODO: Add support for gpmc_fck to clock framework and use it */
-static unsigned long gpmc_get_fclk_period(void)
+unsigned long gpmc_get_fclk_period(void)
 {
/* In picoseconds */
return 10 / ((clk_get_rate(gpmc_l3_clk)) / 1000);
@@ -120,15 +120,21 @@ static int set_gpmc_timing_reg(int cs, int reg, int 
st_bit, int end_bit,
else
ticks = gpmc_ns_to_ticks(time);
nr_bits = end_bit - st_bit + 1;
-   if (ticks = 1  nr_bits)
+   if (ticks = 1  nr_bits) {
+#ifdef DEBUG
+   printk(KERN_INFO GPMC CS%d: %-10s* %3d ns, %3d ticks = %d\n,
+   cs, name, time, ticks, 1  nr_bits);
+#endif
return -1;
+   }
 
mask = (1  nr_bits) - 1;
l = gpmc_cs_read_reg(cs, reg);
 #ifdef DEBUG
-   printk(KERN_INFO GPMC CS%d: %-10s: %d ticks, %3lu ns (was %i ticks)\n,
+   printk(KERN_INFO
+   GPMC CS%d: %-10s: %3d ticks, %3lu ns (was %3i ticks) %3d ns\n,
   cs, name, ticks, gpmc_get_fclk_period() * ticks / 1000,
-  (l  st_bit)  mask);
+   (l  st_bit)  mask, time);
 #endif
l = ~(mask  st_bit);
l |= ticks  st_bit;
@@ -157,7 +163,7 @@ int gpmc_cs_calc_divider(int cs, unsigned int sync_clk)
div = l / gpmc_get_fclk_period();
if (div  4)
return -1;
-   if (div  0)
+   if (div = 0)
div = 1;
 
return div;
@@ -191,14 +197,19 @@ int gpmc_cs_set_timings(int cs, const struct gpmc_timings 
*t)
 
GPMC_SET_ONE(GPMC_CS_CONFIG5, 24, 27, page_burst_access);
 
+   /* caller is expected to have initialized CONFIG1 to cover
+* at least sync vs async
+*/
+   l = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
+   if (l  (GPMC_CONFIG1_READTYPE_SYNC | GPMC_CONFIG1_WRITETYPE_SYNC)) {
 #ifdef DEBUG
-   printk(KERN_INFO GPMC CS%d CLK period is %lu (div %d)\n,
-  cs, gpmc_get_fclk_period(), div);
+   printk(KERN_INFO GPMC CS%d CLK period is %lu ns (div %d)\n,
+   cs, (div * gpmc_get_fclk_period()) / 1000, div);
 #endif
-
-   l = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
-   l = ~0x03;
-   l |= (div - 1);
+   l = ~0x03;
+   l |= (div - 1);
+   gpmc_cs_write_reg(cs, GPMC_CS_CONFIG1, l);
+   }
 
return 0;
 }
--- a/include/asm-arm/arch-omap/gpmc.h
+++ b/include/asm-arm/arch-omap/gpmc.h
@@ -23,9 +23,10 @@
 #define GPMC_CS_NAND_DATA  0x24
 
 #define GPMC_CONFIG1_WRAPBURST_SUPP (1  31)
-#define GPMC_CONFIG1_READMULTIPLE_SUPP  (1  20)
+#define GPMC_CONFIG1_READMULTIPLE_SUPP  (1  30)
 #define GPMC_CONFIG1_READTYPE_ASYNC (0  29)
 #define GPMC_CONFIG1_READTYPE_SYNC  (1  29)
+#define GPMC_CONFIG1_WRITEMULTIPLE_SUPP (1  28)
 #define GPMC_CONFIG1_WRITETYPE_ASYNC(0  27)
 #define GPMC_CONFIG1_WRITETYPE_SYNC (1  27)
 #define GPMC_CONFIG1_CLKACTIVATIONTIME(val) ((val  3)  25)
-- 
1.4.4.2

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 15/18] ARM: OMAP: Merge PM code from N800 tree

2007-04-09 Thread Tony Lindgren
From: Kai Svahn [EMAIL PROTECTED]

This patch merges omap2 PM code from N800 tree.

Patch adds support for sleep while idle for omap2
and handy serial console debbugging code. It also
moves code from pm-domain.c to pm.c.

This code can be used as a base for developing
power management for all omap24xx boards.

Signed-off-by: Kai Svahn [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]

Index: linux-2.6/arch/arm/mach-omap2/Makefile
===
--- linux-2.6.orig/arch/arm/mach-omap2/Makefile 2007-04-09 14:52:28.0 
-0400
+++ linux-2.6/arch/arm/mach-omap2/Makefile  2007-04-09 15:17:39.0 
-0400
@@ -9,7 +9,7 @@ obj-y := irq.o id.o io.o sram-fn.o memor
 obj-$(CONFIG_OMAP_MPU_TIMER)   += timer-gp.o
 
 # Power Management
-obj-$(CONFIG_PM) += pm.o pm-domain.o sleep.o
+obj-$(CONFIG_PM) += pm.o sleep.o
 
 # Specific board support
 obj-$(CONFIG_MACH_OMAP_GENERIC)+= board-generic.o
Index: linux-2.6/arch/arm/mach-omap2/pm-domain.c
===
--- linux-2.6.orig/arch/arm/mach-omap2/pm-domain.c  2007-04-05 
15:33:53.0 -0400
+++ /dev/null   1970-01-01 00:00:00.0 +
@@ -1,299 +0,0 @@
-/*
- * linux/arch/arm/mach-omap2/pm-domain.c
- *
- * Power domain functions for OMAP2
- *
- * Copyright (C) 2006 Nokia Corporation
- * Tony Lindgren [EMAIL PROTECTED]
- *
- * Some code based on earlier OMAP2 sample PM code
- * Copyright (C) 2005 Texas Instruments, Inc.
- * Richard Woodruff [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.
- */
-
-#include linux/module.h
-#include linux/init.h
-#include linux/clk.h
-
-#include asm/io.h
-
-#include prcm-regs.h
-
-/* Power domain offsets */
-#define PM_MPU_OFFSET  0x100
-#define PM_CORE_OFFSET 0x200
-#define PM_GFX_OFFSET  0x300
-#define PM_WKUP_OFFSET 0x400   /* Autoidle only */
-#define PM_PLL_OFFSET  0x500   /* Autoidle only */
-#define PM_DSP_OFFSET  0x800
-#define PM_MDM_OFFSET  0xc00
-
-/* Power domain wake-up dependency control register */
-#define PM_WKDEP_OFFSET0xc8
-#defineEN_MDM  (1  5)
-#defineEN_WKUP (1  4)
-#defineEN_GFX  (1  3)
-#defineEN_DSP  (1  2)
-#defineEN_MPU  (1  1)
-#defineEN_CORE (1  0)
-
-/* Core power domain state transition control register */
-#define PM_PWSTCTRL_OFFSET 0xe0
-#defineFORCESTATE  (1  18)   /* Only for DSP 
 GFX */
-#defineMEM4RETSTATE(1  6)
-#defineMEM3RETSTATE(1  5)
-#defineMEM2RETSTATE(1  4)
-#defineMEM1RETSTATE(1  3)
-#defineLOGICRETSTATE   (1  2)/* Logic is 
retained */
-#definePOWERSTATE_OFF  0x3
-#definePOWERSTATE_RETENTION0x1
-#definePOWERSTATE_ON   0x0
-
-/* Power domain state register */
-#define PM_PWSTST_OFFSET   0xe4
-
-/* Hardware supervised state transition control register */
-#define CM_CLKSTCTRL_OFFSET0x48
-#defineAUTOSTAT_MPU(1  0)/* MPU */
-#defineAUTOSTAT_DSS(1  2)/* Core */
-#defineAUTOSTAT_L4 (1  1)/* Core */
-#defineAUTOSTAT_L3 (1  0)/* Core */
-#defineAUTOSTAT_GFX(1  0)/* GFX */
-#defineAUTOSTAT_IVA(1  8)/* 2420 IVA in 
DSP domain */
-#defineAUTOSTAT_DSP(1  0)/* DSP */
-#defineAUTOSTAT_MDM(1  0)/* MDM */
-
-/* Automatic control of interface clock idling */
-#define CM_AUTOIDLE1_OFFSET0x30
-#define CM_AUTOIDLE2_OFFSET0x34/* Core only */
-#define CM_AUTOIDLE3_OFFSET0x38/* Core only */
-#define CM_AUTOIDLE4_OFFSET0x3c/* Core only */
-#defineAUTO_54M(x) (((x)  0x3)  6)
-#defineAUTO_96M(x) (((x)  0x3)  2)
-#defineAUTO_DPLL(x)(((x)  0x3)  0)
-#defineAUTO_STOPPED0x3
-#defineAUTO_BYPASS_FAST0x2 /* DPLL only */
-#defineAUTO_BYPASS_LOW_POWER   0x1 /* DPLL only */
-#defineAUTO_DISABLED   0x0
-
-/* Voltage control

[PATCH 4/18] ARM: OMAP: Optimize INTC register accesses and enable autoidling

2007-04-09 Thread Tony Lindgren
From: Juha Yrjola [EMAIL PROTECTED]

Use virtual addresses directly instead of physical addresses to
avoid having to recalculate the virtual address with every
register access.

Signed-off-by: Juha Yrjola [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap2/irq.c |   19 +++
 1 files changed, 11 insertions(+), 8 deletions(-)

--- a/arch/arm/mach-omap2/irq.c
+++ b/arch/arm/mach-omap2/irq.c
@@ -37,7 +37,7 @@ static struct omap_irq_bank {
 } __attribute__ ((aligned(4))) irq_banks[] = {
{
/* MPU INTC */
-   .base_reg   = OMAP24XX_IC_BASE,
+   .base_reg   = IO_ADDRESS(OMAP24XX_IC_BASE),
.nr_irqs= 96,
}, {
/* XXX: DSP INTC */
@@ -47,7 +47,7 @@ static struct omap_irq_bank {
 /* XXX: FIQ and additional INTC support (only MPU at the moment) */
 static void omap_ack_irq(unsigned int irq)
 {
-   omap_writel(0x1, irq_banks[0].base_reg + INTC_CONTROL);
+   __raw_writel(0x1, irq_banks[0].base_reg + INTC_CONTROL);
 }
 
 static void omap_mask_irq(unsigned int irq)
@@ -60,7 +60,7 @@ static void omap_mask_irq(unsigned int irq)
irq %= 32;
}
 
-   omap_writel(1  irq, irq_banks[0].base_reg + INTC_MIR_SET0 + offset);
+   __raw_writel(1  irq, irq_banks[0].base_reg + INTC_MIR_SET0 + offset);
 }
 
 static void omap_unmask_irq(unsigned int irq)
@@ -73,7 +73,7 @@ static void omap_unmask_irq(unsigned int irq)
irq %= 32;
}
 
-   omap_writel(1  irq, irq_banks[0].base_reg + INTC_MIR_CLEAR0 + offset);
+   __raw_writel(1  irq, irq_banks[0].base_reg + INTC_MIR_CLEAR0 + 
offset);
 }
 
 static void omap_mask_ack_irq(unsigned int irq)
@@ -93,17 +93,20 @@ static void __init omap_irq_bank_init_one(struct 
omap_irq_bank *bank)
 {
unsigned long tmp;
 
-   tmp = omap_readl(bank-base_reg + INTC_REVISION)  0xff;
+   tmp = __raw_readl(bank-base_reg + INTC_REVISION)  0xff;
printk(KERN_INFO IRQ: Found an INTC at 0x%08lx 
 (revision %ld.%ld) with %d interrupts\n,
 bank-base_reg, tmp  4, tmp  0xf, bank-nr_irqs);
 
-   tmp = omap_readl(bank-base_reg + INTC_SYSCONFIG);
+   tmp = __raw_readl(bank-base_reg + INTC_SYSCONFIG);
tmp |= 1  1;  /* soft reset */
-   omap_writel(tmp, bank-base_reg + INTC_SYSCONFIG);
+   __raw_writel(tmp, bank-base_reg + INTC_SYSCONFIG);
 
-   while (!(omap_readl(bank-base_reg + INTC_SYSSTATUS)  0x1))
+   while (!(__raw_readl(bank-base_reg + INTC_SYSSTATUS)  0x1))
/* Wait for reset to complete */;
+
+   /* Enable autoidle */
+   __raw_writel(1  0, bank-base_reg + INTC_SYSCONFIG);
 }
 
 void __init omap_init_irq(void)
-- 
1.4.4.2

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 5/18] ARM: OMAP: Board Apollon update, fix boot

2007-04-09 Thread Tony Lindgren
From: Kyungmin Park [EMAIL PROTECTED]

Update Apollon board init to initialize NAND, USB,
and LEDs. Also configure GPMC memory for smc91x Ethernet.

Signed-off-by: Kyungmin Park [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap2/board-apollon.c |   99 +++---
 1 files changed, 90 insertions(+), 9 deletions(-)

--- a/arch/arm/mach-omap2/board-apollon.c
+++ b/arch/arm/mach-omap2/board-apollon.c
@@ -25,6 +25,8 @@
 #include linux/irq.h
 #include linux/interrupt.h
 #include linux/delay.h
+#include linux/leds.h
+#include linux/irq.h
 
 #include asm/hardware.h
 #include asm/mach-types.h
@@ -32,10 +34,12 @@
 #include asm/mach/flash.h
 
 #include asm/arch/gpio.h
+#include asm/arch/led.h
 #include asm/arch/mux.h
 #include asm/arch/usb.h
 #include asm/arch/board.h
 #include asm/arch/common.h
+#include asm/arch/gpmc.h
 #include prcm-regs.h
 
 /* LED  Switch macros */
@@ -46,6 +50,9 @@
 #define SW_UP_GPIO17   17
 #define SW_DOWN_GPIO58 58
 
+#define APOLLON_FLASH_CS   0
+#define APOLLON_ETH_CS 1
+
 static struct mtd_partition apollon_partitions[] = {
{
.name   = X-Loader + U-Boot,
@@ -85,10 +92,10 @@ static struct flash_platform_data apollon_flash_data = {
.nr_parts   = ARRAY_SIZE(apollon_partitions),
 };
 
-static struct resource apollon_flash_resource = {
-   .start  = APOLLON_CS0_BASE,
-   .end= APOLLON_CS0_BASE + SZ_128K,
-   .flags  = IORESOURCE_MEM,
+static struct resource apollon_flash_resource[] = {
+   [0] = {
+   .flags  = IORESOURCE_MEM,
+   },
 };
 
 static struct platform_device apollon_onenand_device = {
@@ -97,14 +104,24 @@ static struct platform_device apollon_onenand_device = {
.dev= {
.platform_data  = apollon_flash_data,
},
-   .num_resources  = ARRAY_SIZE(apollon_flash_resource),
-   .resource   = apollon_flash_resource,
+   .num_resources  = ARRAY_SIZE(apollon_flash_resource),
+   .resource   = apollon_flash_resource,
 };
 
+static void __init apollon_flash_init(void)
+{
+   unsigned long base;
+
+   if (gpmc_cs_request(APOLLON_FLASH_CS, SZ_128K, base)  0) {
+   printk(KERN_ERR Cannot request OneNAND GPMC CS\n);
+   return;
+   }
+   apollon_flash_resource[0].start = base;
+   apollon_flash_resource[0].end   = base + SZ_128K - 1;
+}
+
 static struct resource apollon_smc91x_resources[] = {
[0] = {
-   .start  = APOLLON_ETHR_START,   /* Physical */
-   .end= APOLLON_ETHR_START + 0xf,
.flags  = IORESOURCE_MEM,
},
[1] = {
@@ -126,14 +143,51 @@ static struct platform_device apollon_lcd_device = {
.id = -1,
 };
 
+static struct omap_led_config apollon_led_config[] = {
+   {
+   .cdev   = {
+   .name   = apollon:led0,
+   },
+   .gpio   = LED0_GPIO13,
+   },
+   {
+   .cdev   = {
+   .name   = apollon:led1,
+   },
+   .gpio   = LED1_GPIO14,
+   },
+   {
+   .cdev   = {
+   .name   = apollon:led2,
+   },
+   .gpio   = LED2_GPIO15,
+   },
+};
+
+static struct omap_led_platform_data apollon_led_data = {
+   .nr_leds= ARRAY_SIZE(apollon_led_config),
+   .leds   = apollon_led_config,
+};
+
+static struct platform_device apollon_led_device = {
+   .name   = omap-led,
+   .id = -1,
+   .dev= {
+   .platform_data  = apollon_led_data,
+   },
+};
+
 static struct platform_device *apollon_devices[] __initdata = {
apollon_onenand_device,
apollon_smc91x_device,
apollon_lcd_device,
+   apollon_led_device,
 };
 
 static inline void __init apollon_init_smc91x(void)
 {
+   unsigned long base;
+
/* Make sure CS1 timings are correct */
GPMC_CONFIG1_1 = 0x00011203;
GPMC_CONFIG2_1 = 0x001f1f01;
@@ -141,13 +195,20 @@ static inline void __init apollon_init_smc91x(void)
GPMC_CONFIG4_1 = 0x1c091c09;
GPMC_CONFIG5_1 = 0x041f1f1f;
GPMC_CONFIG6_1 = 0x04c4;
-   GPMC_CONFIG7_1 = 0x0f40 | (APOLLON_CS1_BASE  24);
+
+   if (gpmc_cs_request(APOLLON_ETH_CS, SZ_16M, base)  0) {
+   printk(KERN_ERR Failed to request GPMC CS for smc91x\n);
+   return;
+   }
+   apollon_smc91x_resources[0].start = base + 0x300;
+   apollon_smc91x_resources[0].end   = base + 0x30f;
udelay(100);
 
omap_cfg_reg(W4__24XX_GPIO74);
if (omap_request_gpio(APOLLON_ETHR_GPIO_IRQ)  0) {
printk(KERN_ERR Failed to request GPIO%d for smc91x IRQ\n,
APOLLON_ETHR_GPIO_IRQ);
+   gpmc_cs_free

[PATCH 8/14] ARM: OMAP: Update omap h2 defconfig

2007-04-09 Thread Tony Lindgren
Update omap h2 defconfig

Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/configs/omap_h2_1610_defconfig |   88 +--
 1 files changed, 71 insertions(+), 17 deletions(-)

--- a/arch/arm/configs/omap_h2_1610_defconfig
+++ b/arch/arm/configs/omap_h2_1610_defconfig
@@ -1,10 +1,15 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.17
-# Thu Jun 29 15:25:18 2006
+# Linux kernel version: 2.6.19
+# Thu Dec  7 15:16:40 2006
 #
 CONFIG_ARM=y
+# CONFIG_GENERIC_TIME is not set
 CONFIG_MMU=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+CONFIG_HARDIRQS_SW_RESEND=y
+CONFIG_GENERIC_IRQ_PROBE=y
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
@@ -26,16 +31,21 @@ CONFIG_LOCALVERSION=
 CONFIG_LOCALVERSION_AUTO=y
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+# CONFIG_IPC_NS is not set
 # CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
-CONFIG_SYSCTL=y
+# CONFIG_TASKSTATS is not set
+# CONFIG_UTS_NS is not set
 # CONFIG_AUDIT is not set
 # CONFIG_IKCONFIG is not set
+# CONFIG_SYSFS_DEPRECATED is not set
 # CONFIG_RELAY is not set
 CONFIG_INITRAMFS_SOURCE=
-CONFIG_UID16=y
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_SYSCTL=y
 # CONFIG_EMBEDDED is not set
+CONFIG_UID16=y
+CONFIG_SYSCTL_SYSCALL=y
 CONFIG_KALLSYMS=y
 # CONFIG_KALLSYMS_EXTRA_PASS is not set
 CONFIG_HOTPLUG=y
@@ -47,6 +57,8 @@ CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_SHMEM=y
 CONFIG_SLAB=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_RT_MUTEXES=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
 # CONFIG_SLOB is not set
@@ -64,7 +76,10 @@ CONFIG_MODULE_UNLOAD=y
 #
 # Block layer
 #
+CONFIG_BLOCK=y
+# CONFIG_LBD is not set
 # CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
 
 #
 # IO Schedulers
@@ -86,7 +101,7 @@ CONFIG_DEFAULT_IOSCHED=anticipatory
 # CONFIG_ARCH_INTEGRATOR is not set
 # CONFIG_ARCH_REALVIEW is not set
 # CONFIG_ARCH_VERSATILE is not set
-# CONFIG_ARCH_AT91RM9200 is not set
+# CONFIG_ARCH_AT91 is not set
 # CONFIG_ARCH_CLPS7500 is not set
 # CONFIG_ARCH_CLPS711X is not set
 # CONFIG_ARCH_CO285 is not set
@@ -96,7 +111,8 @@ CONFIG_DEFAULT_IOSCHED=anticipatory
 # CONFIG_ARCH_NETX is not set
 # CONFIG_ARCH_H720X is not set
 # CONFIG_ARCH_IMX is not set
-# CONFIG_ARCH_IOP3XX is not set
+# CONFIG_ARCH_IOP32X is not set
+# CONFIG_ARCH_IOP33X is not set
 # CONFIG_ARCH_IXP4XX is not set
 # CONFIG_ARCH_IXP2000 is not set
 # CONFIG_ARCH_IXP23XX is not set
@@ -121,9 +137,12 @@ CONFIG_ARCH_OMAP1=y
 # OMAP Feature Selections
 #
 # CONFIG_OMAP_RESET_CLOCKS is not set
+# CONFIG_OMAP_BOOT_TAG is not set
+# CONFIG_OMAP_GPIO_SWITCH is not set
 CONFIG_OMAP_MUX=y
 # CONFIG_OMAP_MUX_DEBUG is not set
 CONFIG_OMAP_MUX_WARNINGS=y
+CONFIG_OMAP_MCBSP=y
 # CONFIG_OMAP_MPU_TIMER is not set
 CONFIG_OMAP_32K_TIMER=y
 CONFIG_OMAP_32K_TIMER_HZ=128
@@ -171,6 +190,8 @@ CONFIG_CPU_ABRT_EV5TJ=y
 CONFIG_CPU_CACHE_VIVT=y
 CONFIG_CPU_COPY_V4WB=y
 CONFIG_CPU_TLB_V4WBI=y
+CONFIG_CPU_CP15=y
+CONFIG_CPU_CP15_MMU=y
 
 #
 # Processor Features
@@ -206,6 +227,7 @@ CONFIG_FLATMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
 # CONFIG_SPARSEMEM_STATIC is not set
 CONFIG_SPLIT_PTLOCK_CPUS=4096
+# CONFIG_RESOURCES_64BIT is not set
 # CONFIG_LEDS is not set
 CONFIG_ALIGNMENT_TRAP=y
 
@@ -259,6 +281,7 @@ CONFIG_BINFMT_AOUT=y
 CONFIG_PM=y
 # CONFIG_PM_LEGACY is not set
 # CONFIG_PM_DEBUG is not set
+# CONFIG_PM_SYSFS_DEPRECATED is not set
 # CONFIG_APM is not set
 
 #
@@ -275,6 +298,7 @@ CONFIG_PACKET=y
 CONFIG_UNIX=y
 CONFIG_XFRM=y
 # CONFIG_XFRM_USER is not set
+# CONFIG_XFRM_SUB_POLICY is not set
 # CONFIG_NET_KEY is not set
 CONFIG_INET=y
 # CONFIG_IP_MULTICAST is not set
@@ -295,10 +319,13 @@ CONFIG_IP_PNP_BOOTP=y
 # CONFIG_INET_TUNNEL is not set
 CONFIG_INET_XFRM_MODE_TRANSPORT=y
 CONFIG_INET_XFRM_MODE_TUNNEL=y
+CONFIG_INET_XFRM_MODE_BEET=y
 CONFIG_INET_DIAG=y
 CONFIG_INET_TCP_DIAG=y
 # CONFIG_TCP_CONG_ADVANCED is not set
-CONFIG_TCP_CONG_BIC=y
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_DEFAULT_TCP_CONG=cubic
+# CONFIG_TCP_MD5SIG is not set
 # CONFIG_IPV6 is not set
 # CONFIG_INET6_XFRM_TUNNEL is not set
 # CONFIG_INET6_TUNNEL is not set
@@ -328,7 +355,6 @@ CONFIG_TCP_CONG_BIC=y
 # CONFIG_ATALK is not set
 # CONFIG_X25 is not set
 # CONFIG_LAPB is not set
-# CONFIG_NET_DIVERT is not set
 # CONFIG_ECONET is not set
 # CONFIG_WAN_ROUTER is not set
 
@@ -387,6 +413,7 @@ CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_COUNT=16
 CONFIG_BLK_DEV_RAM_SIZE=8192
+CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CDROM_PKTCDVD is not set
 CONFIG_ATA_OVER_ETH=m
@@ -396,6 +423,8 @@ CONFIG_ATA_OVER_ETH=m
 #
 # CONFIG_RAID_ATTRS is not set
 CONFIG_SCSI=y
+# CONFIG_SCSI_TGT is not set
+# CONFIG_SCSI_NETLINK is not set
 CONFIG_SCSI_PROC_FS=y
 
 #
@@ -414,23 +443,29 @@ CONFIG_SCSI_PROC_FS=y
 # CONFIG_SCSI_MULTI_LUN is not set
 # CONFIG_SCSI_CONSTANTS is not set
 # CONFIG_SCSI_LOGGING is not set
+# CONFIG_SCSI_SCAN_ASYNC is not set
 
 #
-# SCSI Transport Attributes

[PATCH 7/14] ARM: OMAP: Sync board specific files with linux-omap

2007-04-09 Thread Tony Lindgren
This patch syncs omap board specific files with linux-omap tree.

Patch consists mostly of driver updates done in linux-omap
tree for drivers not yet in mainline kernel.

Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap1/board-ams-delta.c |   59 +++-
 arch/arm/mach-omap1/board-h2.c|   79 ++
 arch/arm/mach-omap1/board-h3.c|   41 
 arch/arm/mach-omap1/board-nokia770.c  |   53 --
 arch/arm/mach-omap1/board-osk.c   |1 +
 arch/arm/mach-omap1/board-palmte.c|  123 --
 arch/arm/mach-omap1/board-palmtt.c|4 +-
 arch/arm/mach-omap1/board-voiceblue.c |2 +-
 10 files changed, 380 insertions(+), 176 deletions(-)

Index: linux-2.6/arch/arm/mach-omap1/board-ams-delta.c
===
--- linux-2.6.orig/arch/arm/mach-omap1/board-ams-delta.c2007-04-09 
16:40:19.0 -0400
+++ linux-2.6/arch/arm/mach-omap1/board-ams-delta.c 2007-04-09 
16:40:23.0 -0400
@@ -34,20 +34,20 @@ static u8 ams_delta_latch1_reg;
 static u16 ams_delta_latch2_reg;
 
 static int ams_delta_keymap[] = {
-   KEY(0, 0, KEY_F1),  /* Advert   */
+   KEY(0, 0, KEY_F1),  /* Advert*/
 
-   KEY(3, 0, KEY_COFFEE),  /* Games */
+   KEY(3, 0, KEY_COFFEE),  /* Games */
KEY(2, 0, KEY_QUESTION),/* Directory */
-   KEY(3, 2, KEY_CONNECT), /* Internet  */
-   KEY(2, 1, KEY_SHOP),/* Services  */
-   KEY(1, 1, KEY_PHONE),   /* VoiceMail */
-
-   KEY(1, 0, KEY_DELETE),  /* Delete   */
-   KEY(2, 2, KEY_PLAY),/* Play   */
-   KEY(0, 1, KEY_PAGEUP),  /* Up   */
-   KEY(3, 1, KEY_PAGEDOWN),/* Down   */
-   KEY(0, 2, KEY_EMAIL),   /* ReadEmail */
-   KEY(1, 2, KEY_STOP),/* Stop   */
+   KEY(3, 2, KEY_CONNECT), /* Internet  */
+   KEY(2, 1, KEY_SHOP),/* Services  */
+   KEY(1, 1, KEY_PHONE),   /* VoiceMail */
+
+   KEY(1, 0, KEY_DELETE),  /* Delete*/
+   KEY(2, 2, KEY_PLAY),/* Play  */
+   KEY(0, 1, KEY_PAGEUP),  /* Up*/
+   KEY(3, 1, KEY_PAGEDOWN),/* Down  */
+   KEY(0, 2, KEY_EMAIL),   /* ReadEmail */
+   KEY(1, 2, KEY_STOP),/* Stop  */
 
/* Numeric keypad portion */
KEY(7, 0, KEY_KP1),
@@ -61,20 +61,20 @@ static int ams_delta_keymap[] = {
KEY(5, 2, KEY_KP9),
KEY(6, 3, KEY_KP0),
KEY(7, 3, KEY_KPASTERISK),
-   KEY(5, 3, KEY_KPDOT),   /* # key */
-   KEY(2, 7, KEY_NUMLOCK), /* Mute   */
-   KEY(1, 7, KEY_KPMINUS), /* Recall   */
-   KEY(1, 6, KEY_KPPLUS),  /* Redial   */
-   KEY(6, 7, KEY_KPSLASH), /* Handsfree */
-   KEY(0, 6, KEY_ENTER),   /* Video */
-
-   KEY(4, 7, KEY_CAMERA),  /* Photo */
-
-   KEY(4, 0, KEY_F2),  /* Home   */
-   KEY(4, 1, KEY_F3),  /* Office   */
-   KEY(4, 2, KEY_F4),  /* Mobile   */
-   KEY(7, 7, KEY_F5),  /* SMS  */
-   KEY(5, 7, KEY_F6),  /* Email */
+   KEY(5, 3, KEY_KPDOT),   /* # key */
+   KEY(2, 7, KEY_NUMLOCK), /* Mute  */
+   KEY(1, 7, KEY_KPMINUS), /* Recall*/
+   KEY(1, 6, KEY_KPPLUS),  /* Redial*/
+   KEY(6, 7, KEY_KPSLASH), /* Handsfree */
+   KEY(0, 6, KEY_ENTER),   /* Video */
+
+   KEY(4, 7, KEY_CAMERA),  /* Photo */
+
+   KEY(4, 0, KEY_F2),  /* Home  */
+   KEY(4, 1, KEY_F3),  /* Office*/
+   KEY(4, 2, KEY_F4),  /* Mobile*/
+   KEY(7, 7, KEY_F5),  /* SMS   */
+   KEY(5, 7, KEY_F6),  /* Email */
 
/* QWERTY portion of keypad */
KEY(4, 3, KEY_Q),
@@ -107,7 +107,7 @@ static int ams_delta_keymap[] = {
KEY(3, 6, KEY_M),
KEY(2, 6, KEY_SPACE),
 
-   KEY(0, 7, KEY_LEFTSHIFT),   /* Vol up   */
+   KEY(0, 7, KEY_LEFTSHIFT),   /* Vol up*/
KEY(3, 7, KEY_LEFTCTRL),/* Vol down  */
 
0
@@ -158,6 +158,10 @@ static struct map_desc ams_delta_io_desc
}
 };
 
+static struct omap_lcd_config ams_delta_lcd_config __initdata = {
+   .ctrl_name  = internal,
+};
+
 static struct omap_uart_config ams_delta_uart_config __initdata = {
.enabled_uarts = 1,
 };
@@ -169,6 +173,7 @@ static struct omap_usb_config ams_delta_
 };
 
 static struct omap_board_config_kernel ams_delta_config[] = {
+   { OMAP_TAG_LCD, ams_delta_lcd_config },
{ OMAP_TAG_UART,ams_delta_uart_config },
{ OMAP_TAG_USB, ams_delta_usb_config },
 };
@@ -199,6 +204,11 @@ static struct platform_device ams_delta_
.resource   = ams_delta_kp_resources,
 };
 
+static struct platform_device ams_delta_lcd_device

[PATCH 11/14] ARM: OMAP: H3 workqueue fixes

2007-04-09 Thread Tony Lindgren
From: Dirk Behme [EMAIL PROTECTED]

Signed-off-by: Dirk Behme [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap1/board-h3.c   |   12 +++-
 include/asm-arm/arch-omap/irda.h |1 +
 2 files changed, 8 insertions(+), 5 deletions(-)

Index: linux-2.6/arch/arm/mach-omap1/board-h3.c
===
--- linux-2.6.orig/arch/arm/mach-omap1/board-h3.c   2007-04-09 
16:40:23.0 -0400
+++ linux-2.6/arch/arm/mach-omap1/board-h3.c2007-04-09 16:40:34.0 
-0400
@@ -296,9 +296,11 @@ static int h3_select_irda(struct device 
return err;
 }
 
-static void set_trans_mode(void *data)
+static void set_trans_mode(struct work_struct *work)
 {
-   int *mode = data;
+   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;
 
@@ -308,7 +310,7 @@ static void set_trans_mode(void *data)
 
expa = ~0x03;
 
-   if (*mode  IR_SIRMODE) {
+   if (mode  IR_SIRMODE) {
expa |= 0x01;
} else { /* MIR/FIR */
expa |= 0x03;
@@ -323,9 +325,9 @@ static int h3_transceiver_mode(struct de
 {
struct omap_irda_config *irda_config = dev-platform_data;
 
+   irda_config-mode = mode;
cancel_delayed_work(irda_config-gpio_expa);
-   PREPARE_WORK(irda_config-gpio_expa, set_trans_mode, mode);
-#error this is not permitted - mode is an argument variable
+   PREPARE_DELAYED_WORK(irda_config-gpio_expa, set_trans_mode);
schedule_delayed_work(irda_config-gpio_expa, 0);
 
return 0;
Index: linux-2.6/include/asm-arm/arch-omap/irda.h
===
--- linux-2.6.orig/include/asm-arm/arch-omap/irda.h 2007-04-09 
16:38:12.0 -0400
+++ linux-2.6/include/asm-arm/arch-omap/irda.h  2007-04-09 16:40:34.0 
-0400
@@ -31,6 +31,7 @@ struct omap_irda_config {
unsigned long src_start;
int tx_trigger;
int rx_trigger;
+   int mode;
 };
 
 #endif
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 12/14] ARM: OMAP: N770: add missing LCD, LCD controller, touchscreen device registration

2007-04-09 Thread Tony Lindgren
From: Imre Deak [EMAIL PROTECTED]

These were left out from the board file when merging these drivers,
add them here.

Call GPIO init from the board file as well, since the platform device init
code uses the GPIO API.

Signed-off-by: Imre Deak [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap1/board-nokia770.c |   88 ++
 1 files changed, 88 insertions(+), 0 deletions(-)

--- a/arch/arm/mach-omap1/board-nokia770.c
+++ b/arch/arm/mach-omap1/board-nokia770.c
@@ -33,9 +33,14 @@
 #include asm/arch/dsp_common.h
 #include asm/arch/aic23.h
 #include asm/arch/gpio.h
+#include asm/arch/omapfb.h
+#include asm/arch/hwa742.h
+#include asm/arch/lcd_mipid.h
 
 #include ../plat-omap/dsp/dsp_common.h
 
+#define ADS7846_PENDOWN_GPIO   15
+
 static void __init omap_nokia770_init_irq(void)
 {
/* On Nokia 770, the SleepX signal is masked with an
@@ -96,6 +101,41 @@ static struct platform_device *nokia770_devices[] 
__initdata = {
nokia770_kp_device,
 };
 
+static void mipid_shutdown(struct mipid_platform_data *pdata)
+{
+   if (pdata-nreset_gpio != -1) {
+   printk(KERN_INFO shutdown LCD\n);
+   omap_set_gpio_dataout(pdata-nreset_gpio, 0);
+   msleep(120);
+   }
+}
+
+static struct mipid_platform_data nokia770_mipid_platform_data = {
+   .shutdown = mipid_shutdown,
+};
+
+static void mipid_dev_init(void)
+{
+   const struct omap_lcd_config *conf;
+
+   conf = omap_get_config(OMAP_TAG_LCD, struct omap_lcd_config);
+   if (conf != NULL) {
+   nokia770_mipid_platform_data.nreset_gpio = conf-nreset_gpio;
+   nokia770_mipid_platform_data.data_lines = conf-data_lines;
+   }
+}
+
+static void ads7846_dev_init(void)
+{
+   if (omap_request_gpio(ADS7846_PENDOWN_GPIO)  0)
+   printk(KERN_ERR can't get ads7846 pen down GPIO\n);
+}
+
+static int ads7846_get_pendown_state(void)
+{
+   return !omap_get_gpio_datain(ADS7846_PENDOWN_GPIO);
+}
+
 static struct ads7846_platform_data nokia770_ads7846_platform_data __initdata 
= {
.x_max  = 0x0fff,
.y_max  = 0x0fff,
@@ -103,6 +143,8 @@ static struct ads7846_platform_data 
nokia770_ads7846_platform_data __initdata =
.pressure_max   = 255,
.debounce_max   = 10,
.debounce_tol   = 3,
+   .debounce_rep   = 1,
+   .get_pendown_state  = ads7846_get_pendown_state,
 };
 
 static struct spi_board_info nokia770_spi_board_info[] __initdata = {
@@ -111,6 +153,7 @@ static struct spi_board_info nokia770_spi_board_info[] 
__initdata = {
.bus_num= 2,
.chip_select= 3,
.max_speed_hz   = 1200,
+   .platform_data  = nokia770_mipid_platform_data,
},
[1] = {
.modalias   = ads7846,
@@ -122,6 +165,47 @@ static struct spi_board_info nokia770_spi_board_info[] 
__initdata = {
},
 };
 
+static struct {
+   struct clk *sys_ck;
+} hwa742;
+
+static int hwa742_get_clocks(void)
+{
+   hwa742.sys_ck = clk_get(NULL, bclk);
+   if (IS_ERR(hwa742.sys_ck)) {
+   printk(KERN_ERR can't get HWA742 clock\n);
+   return PTR_ERR(hwa742.sys_ck);
+   }
+   return 0;
+}
+
+static unsigned long hwa742_get_clock_rate(struct device *dev)
+{
+   return clk_get_rate(hwa742.sys_ck);
+}
+
+static void hwa742_power_up(struct device *dev)
+{
+   clk_enable(hwa742.sys_ck);
+}
+
+static void hwa742_power_down(struct device *dev)
+{
+   clk_disable(hwa742.sys_ck);
+}
+
+static struct hwa742_platform_data nokia770_hwa742_platform_data = {
+   .get_clock_rate = hwa742_get_clock_rate,
+   .power_up   = hwa742_power_up,
+   .power_down = hwa742_power_down,
+   .te_connected   = 1,
+};
+
+static void hwa742_dev_init(void)
+{
+   hwa742_get_clocks();
+   omapfb_set_ctrl_platform_data(nokia770_hwa742_platform_data);
+}
 
 /* assume no Mini-AB port */
 
@@ -287,8 +371,12 @@ static void __init omap_nokia770_init(void)
ARRAY_SIZE(nokia770_spi_board_info));
omap_board_config = nokia770_config;
omap_board_config_size = ARRAY_SIZE(nokia770_config);
+   omap_gpio_init();
omap_serial_init();
omap_dsp_init();
+   hwa742_dev_init();
+   ads7846_dev_init();
+   mipid_dev_init();
 }
 
 static void __init omap_nokia770_map_io(void)
-- 
1.4.4.2

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 10/14] ARM: OMAP: osk+mistral backlight, power, board specific

2007-04-09 Thread Tony Lindgren
From: David Brownell [EMAIL PROTECTED]

Mistral-specific:

  - Add PWL-driven LCD backlight device

  - Apply power to the board even when the LCD isn't configured; things
like EEPROM, temperature sensor, and wakeup switch depend on it.

Signed-off-by: David Brownell [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap1/board-osk.c |   22 ++
 1 files changed, 22 insertions(+), 0 deletions(-)

Index: linux-2.6/arch/arm/mach-omap1/board-osk.c
===
--- linux-2.6.orig/arch/arm/mach-omap1/board-osk.c  2007-04-09 
16:40:23.0 -0400
+++ linux-2.6/arch/arm/mach-omap1/board-osk.c   2007-04-09 16:40:29.0 
-0400
@@ -293,6 +293,18 @@ static struct platform_device osk5912_kp
.resource   = osk5912_kp_resources,
 };
 
+static struct omap_backlight_config mistral_bl_data = {
+   .default_intensity  = 0xa0,
+};
+
+static struct platform_device mistral_bl_device = {
+   .name   = omap-bl,
+   .id = -1,
+   .dev= {
+   .platform_data = mistral_bl_data,
+   },
+};
+
 static struct platform_device osk5912_lcd_device = {
.name   = lcd_osk,
.id = -1,
@@ -300,6 +312,7 @@ static struct platform_device osk5912_lc
 
 static struct platform_device *mistral_devices[] __initdata = {
osk5912_kp_device,
+   mistral_bl_device,
osk5912_lcd_device,
 };
 
@@ -405,6 +418,15 @@ static void __init osk_mistral_init(void
} else
printk(KERN_ERR OSK+Mistral: wakeup button is awol\n);
 
+   /* LCD:  backlight, and power; power controls other devices on the
+* board, like the touchscreen, EEPROM, and wakeup (!) switch.
+*/
+   omap_cfg_reg(PWL);
+   if (omap_request_gpio(2) == 0) {
+   omap_set_gpio_direction(2, 0 /* out */);
+   omap_set_gpio_dataout(2, 1 /* on */);
+   }
+
platform_add_devices(mistral_devices, ARRAY_SIZE(mistral_devices));
 }
 #else
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 28/90] ARM: OMAP: USB peripheral support on H4

2007-04-09 Thread Tony Lindgren
* Pavel Machek [EMAIL PROTECTED] [070408 08:02]:
 Hi!
 
  From: David Brownell [EMAIL PROTECTED]
  
  H4 has two peripheral ports, one for download and one for OTG.
  The one to use is selected through Kconfig.
  
  NOTE:  not yet working; I suspect there's a clock still turned off
  or something like that, since neither port responds.
 
 Hmm, it would be nice to merge this with patch that makes it
 working... for easier review.

I've merged the later fixes into this patch, please see the reposted
series and renumbered patch:

[PATCH 1/7] ARM: OMAP: USB peripheral support on H4

And it is working now, so I've updated the commit message too.

 But it is new code, so maybe it can just go in
 
  Signed-off-by: David Brownell [EMAIL PROTECTED]
  Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
 
  +#else
  +   /* S1.10 OFF -- usb download port
  +* usb0 switched to Mini-B port and isp1105 transceiver;
  +* S2.POS3 = ON, S2.POS4 = OFF ... to enable battery charging
  +*/
  +   .register_dev   = 1,
  +   .pins[0]= 3,
  +// .hmc_mode   = 0x14, /* 0:dev 1:host 2:disable */
  +   .hmc_mode   = 0x00, /* 0:dev|otg 1:disable 2:disable */
 
 No c++ comments, please... but I somehow suspect this one is fixed
 later in series.

That was fixed in the later patch too.

Regards,

Tony
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/14] ARM: OMAP: Add support for Amstrad Delta keypad

2007-04-09 Thread Tony Lindgren
From: Jonathan McDowell [EMAIL PROTECTED]

This adds support for the keypad on the top of the Amstrad Delta. It's
just a standard omap-keypad so all we need to do is add the keypad
layout and platform data to the board definition file.

Signed-off-by: Jonathan McDowell [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap1/board-ams-delta.c |  108 +
 1 files changed, 108 insertions(+), 0 deletions(-)

Index: linux-2.6/arch/arm/mach-omap1/board-ams-delta.c
===
--- linux-2.6.orig/arch/arm/mach-omap1/board-ams-delta.c2007-04-09 
14:50:28.0 -0400
+++ linux-2.6/arch/arm/mach-omap1/board-ams-delta.c 2007-04-09 
14:52:01.0 -0400
@@ -14,6 +14,7 @@
 
 #include linux/kernel.h
 #include linux/init.h
+#include linux/input.h
 #include linux/platform_device.h
 
 #include asm/hardware.h
@@ -23,6 +24,7 @@
 
 #include asm/arch/board-ams-delta.h
 #include asm/arch/gpio.h
+#include asm/arch/keypad.h
 #include asm/arch/mux.h
 #include asm/arch/usb.h
 #include asm/arch/board.h
@@ -31,6 +33,86 @@
 static u8 ams_delta_latch1_reg;
 static u16 ams_delta_latch2_reg;
 
+static int ams_delta_keymap[] = {
+   KEY(0, 0, KEY_F1),  /* Advert   */
+
+   KEY(3, 0, KEY_COFFEE),  /* Games */
+   KEY(2, 0, KEY_QUESTION),/* Directory */
+   KEY(3, 2, KEY_CONNECT), /* Internet  */
+   KEY(2, 1, KEY_SHOP),/* Services  */
+   KEY(1, 1, KEY_PHONE),   /* VoiceMail */
+
+   KEY(1, 0, KEY_DELETE),  /* Delete   */
+   KEY(2, 2, KEY_PLAY),/* Play   */
+   KEY(0, 1, KEY_PAGEUP),  /* Up   */
+   KEY(3, 1, KEY_PAGEDOWN),/* Down   */
+   KEY(0, 2, KEY_EMAIL),   /* ReadEmail */
+   KEY(1, 2, KEY_STOP),/* Stop   */
+
+   /* Numeric keypad portion */
+   KEY(7, 0, KEY_KP1),
+   KEY(6, 0, KEY_KP2),
+   KEY(5, 0, KEY_KP3),
+   KEY(7, 1, KEY_KP4),
+   KEY(6, 1, KEY_KP5),
+   KEY(5, 1, KEY_KP6),
+   KEY(7, 2, KEY_KP7),
+   KEY(6, 2, KEY_KP8),
+   KEY(5, 2, KEY_KP9),
+   KEY(6, 3, KEY_KP0),
+   KEY(7, 3, KEY_KPASTERISK),
+   KEY(5, 3, KEY_KPDOT),   /* # key */
+   KEY(2, 7, KEY_NUMLOCK), /* Mute   */
+   KEY(1, 7, KEY_KPMINUS), /* Recall   */
+   KEY(1, 6, KEY_KPPLUS),  /* Redial   */
+   KEY(6, 7, KEY_KPSLASH), /* Handsfree */
+   KEY(0, 6, KEY_ENTER),   /* Video */
+
+   KEY(4, 7, KEY_CAMERA),  /* Photo */
+
+   KEY(4, 0, KEY_F2),  /* Home   */
+   KEY(4, 1, KEY_F3),  /* Office   */
+   KEY(4, 2, KEY_F4),  /* Mobile   */
+   KEY(7, 7, KEY_F5),  /* SMS  */
+   KEY(5, 7, KEY_F6),  /* Email */
+
+   /* QWERTY portion of keypad */
+   KEY(4, 3, KEY_Q),
+   KEY(3, 3, KEY_W),
+   KEY(2, 3, KEY_E),
+   KEY(1, 3, KEY_R),
+   KEY(0, 3, KEY_T),
+   KEY(7, 4, KEY_Y),
+   KEY(6, 4, KEY_U),
+   KEY(5, 4, KEY_I),
+   KEY(4, 4, KEY_O),
+   KEY(3, 4, KEY_P),
+
+   KEY(2, 4, KEY_A),
+   KEY(1, 4, KEY_S),
+   KEY(0, 4, KEY_D),
+   KEY(7, 5, KEY_F),
+   KEY(6, 5, KEY_G),
+   KEY(5, 5, KEY_H),
+   KEY(4, 5, KEY_J),
+   KEY(3, 5, KEY_K),
+   KEY(2, 5, KEY_L),
+
+   KEY(1, 5, KEY_Z),
+   KEY(0, 5, KEY_X),
+   KEY(7, 6, KEY_C),
+   KEY(6, 6, KEY_V),
+   KEY(5, 6, KEY_B),
+   KEY(4, 6, KEY_N),
+   KEY(3, 6, KEY_M),
+   KEY(2, 6, KEY_SPACE),
+
+   KEY(0, 7, KEY_LEFTSHIFT),   /* Vol up   */
+   KEY(3, 7, KEY_LEFTCTRL),/* Vol down  */
+
+   0
+};
+
 void ams_delta_latch1_write(u8 mask, u8 value)
 {
ams_delta_latch1_reg = ~mask;
@@ -91,12 +173,39 @@ static struct omap_board_config_kernel a
{ OMAP_TAG_USB, ams_delta_usb_config },
 };
 
+static struct resource ams_delta_kp_resources[] = {
+   [0] = {
+   .start  = INT_KEYBOARD,
+   .end= INT_KEYBOARD,
+   .flags  = IORESOURCE_IRQ,
+   },
+};
+
+static struct omap_kp_platform_data ams_delta_kp_data = {
+   .rows   = 8,
+   .cols   = 8,
+   .keymap = ams_delta_keymap,
+   .keymapsize = ARRAY_SIZE(ams_delta_keymap),
+   .delay  = 9,
+};
+
+static struct platform_device ams_delta_kp_device = {
+   .name   = omap-keypad,
+   .id = -1,
+   .dev= {
+   .platform_data = ams_delta_kp_data,
+   },
+   .num_resources  = ARRAY_SIZE(ams_delta_kp_resources),
+   .resource   = ams_delta_kp_resources,
+};
+
 static struct platform_device ams_delta_led_device = {
.name   = ams-delta-led,
.id = -1
 };
 
 static struct platform_device *ams_delta_devices[] __initdata = {
+   ams_delta_kp_device,
ams_delta_led_device,
 };
 
-
To unsubscribe from this list: send the line

[PATCH 4/14] ARM: OMAP: Register tsc2102 on Palm Tungsten E

2007-04-09 Thread Tony Lindgren
From: Andrzej Zaborowski [EMAIL PROTECTED]

Add palmte board config bits for TSC2102 controlled devices. This will
enable touchscreen, audio and APM code to report battery level.

If there are other boards at some point that use a TSC2102, similar
code can be used.

Signed-off-by: Andrzej Zaborowski [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap1/board-palmte.c |  123 
 1 files changed, 123 insertions(+), 0 deletions(-)

--- a/arch/arm/mach-omap1/board-palmte.c
+++ b/arch/arm/mach-omap1/board-palmte.c
@@ -321,6 +321,116 @@ static struct tsc2102_config palmte_tsc2102_config = {
.alsa_config= palmte_alsa_config,
 };
 
+static struct omap_mcbsp_reg_cfg palmte_mcbsp1_regs = {
+   .spcr2  = FRST | GRST | XRST | XINTM(3),
+   .xcr2   = XDATDLY(1) | XFIG,
+   .xcr1   = XWDLEN1(OMAP_MCBSP_WORD_32),
+   .pcr0   = SCLKME | FSXP | CLKXP,
+};
+
+static struct omap_alsa_codec_config palmte_alsa_config = {
+   .name   = TSC2102 audio,
+   .mcbsp_regs_alsa= palmte_mcbsp1_regs,
+   .codec_configure_dev= NULL, /* tsc2102_configure, */
+   .codec_set_samplerate   = NULL, /* tsc2102_set_samplerate, */
+   .codec_clock_setup  = NULL, /* tsc2102_clock_setup, */
+   .codec_clock_on = NULL, /* tsc2102_clock_on, */
+   .codec_clock_off= NULL, /* tsc2102_clock_off, */
+   .get_default_samplerate = NULL, /* tsc2102_get_default_samplerate, */
+};
+
+#ifdef CONFIG_APM
+/*
+ * Values measured in 10 minute intervals averaged over 10 samples.
+ * May differ slightly from device to device but should be accurate
+ * enough to give basic idea of battery life left and trigger
+ * potential alerts.
+ */
+static const int palmte_battery_sample[] = {
+   2194, 2157, 2138, 2120,
+   2104, 2089, 2075, 2061,
+   2048, 2038, 2026, 2016,
+   2008, 1998, 1989, 1980,
+   1970, 1958, 1945, 1928,
+   1910, 1888, 1860, 1827,
+   1791, 1751, 1709, 1656,
+};
+
+#define INTERVAL   10
+#define BATTERY_HIGH_TRESHOLD  66
+#define BATTERY_LOW_TRESHOLD   33
+
+static void palmte_get_power_status(struct apm_power_info *info, int *battery)
+{
+   int charging, batt, hi, lo, mid;
+
+   charging = !omap_get_gpio_datain(PALMTE_DC_GPIO);
+   batt = battery[0];
+   if (charging)
+   batt -= 60;
+
+   hi = ARRAY_SIZE(palmte_battery_sample);
+   lo = 0;
+
+   info-battery_flag = 0;
+   info-units = APM_UNITS_MINS;
+
+   if (batt  palmte_battery_sample[lo]) {
+   info-battery_life = 100;
+   info-time = INTERVAL * ARRAY_SIZE(palmte_battery_sample);
+   } else if (batt = palmte_battery_sample[hi - 1]) {
+   info-battery_life = 0;
+   info-time = 0;
+   } else {
+   while (hi  lo + 1) {
+   mid = (hi + lo)  2;
+   if (batt = palmte_battery_sample[mid])
+   lo = mid;
+   else
+   hi = mid;
+   }
+
+   mid = palmte_battery_sample[lo] - palmte_battery_sample[hi];
+   hi = palmte_battery_sample[lo] - batt;
+   info-battery_life = 100 - (100 * lo + 100 * hi / mid) /
+   ARRAY_SIZE(palmte_battery_sample);
+   info-time = INTERVAL * (ARRAY_SIZE(palmte_battery_sample) -
+   lo) - INTERVAL * hi / mid;
+   }
+
+   if (charging) {
+   info-ac_line_status = APM_AC_ONLINE;
+   info-battery_status = APM_BATTERY_STATUS_CHARGING;
+   info-battery_flag |= APM_BATTERY_FLAG_CHARGING;
+   } else {
+   info-ac_line_status = APM_AC_OFFLINE;
+   if (info-battery_life  BATTERY_HIGH_TRESHOLD)
+   info-battery_status = APM_BATTERY_STATUS_HIGH;
+   else if (info-battery_life  BATTERY_LOW_TRESHOLD)
+   info-battery_status = APM_BATTERY_STATUS_LOW;
+   else
+   info-battery_status = APM_BATTERY_STATUS_CRITICAL;
+   }
+
+   if (info-battery_life  BATTERY_HIGH_TRESHOLD)
+   info-battery_flag |= APM_BATTERY_FLAG_HIGH;
+   else if (info-battery_life  BATTERY_LOW_TRESHOLD)
+   info-battery_flag |= APM_BATTERY_FLAG_LOW;
+   else
+   info-battery_flag |= APM_BATTERY_FLAG_CRITICAL;
+}
+#else
+#define palmte_get_power_statusNULL
+#endif
+
+static struct tsc2102_config palmte_tsc2102_config = {
+   .use_internal   = 0,
+   .monitor= TSC_BAT1 | TSC_AUX | TSC_TEMP,
+   .temp_at25c = { 2200, 2615 },
+   .apm_report = palmte_get_power_status,
+   .alsa_config= palmte_alsa_config,
+};
+
 static struct omap_board_config_kernel palmte_config[] = {
{ OMAP_TAG_USB, palmte_usb_config

[PATCH 0/14] ARM: OMAP: Board updates and additions for OMAP1

2007-04-09 Thread Tony Lindgren
Hi,

The following patch series contains updates board updates and
additions for OMAP1 code.

This is take #2 of the earlier 90 patch mountain, which has
been split into six smaller series.

Regards,

Tony

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/14] ARM: OMAP: Palm Tungsten E board update

2007-04-09 Thread Tony Lindgren
From: Andrzej Zaborowski [EMAIL PROTECTED]

General update of the board file for Palm Tungsten E. Registers the
platform devices contained in the PDA (ROM chip, keypad, infra-red)
and updates the configuration for USB and MMC, whose config values
were previously guessed in most cases due to lack of documentation
(and now are confirmed by a number of users). Macros for GPIO pins are
moved to a file in include/asm-arm/arch-omap.

Signed-off-by: Andrzej Zaborowski [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap1/Kconfig  |9 +-
 arch/arm/mach-omap1/board-palmte.c   |  377 --
 include/asm-arm/arch-omap/board-palmte.h |   34 +++
 include/asm-arm/arch-omap/hardware.h |4 +
 4 files changed, 401 insertions(+), 23 deletions(-)

Index: linux-2.6/arch/arm/mach-omap1/Kconfig
===
--- linux-2.6.orig/arch/arm/mach-omap1/Kconfig  2007-04-09 14:46:56.0 
-0400
+++ linux-2.6/arch/arm/mach-omap1/Kconfig   2007-04-09 14:49:36.0 
-0400
@@ -84,11 +84,10 @@ config MACH_OMAP_PALMTE
bool Palm Tungsten E
depends on ARCH_OMAP1  ARCH_OMAP15XX
help
-  Support for the Palm Tungsten E PDA. Currently only the LCD panel
-  is supported. To boot the kernel, you'll need a PalmOS compatible
-  bootloader; check out http://palmtelinux.sourceforge.net for more
-  informations.
-  Say Y here if you have such a PDA, say NO otherwise.
+ Support for the Palm Tungsten E PDA.  To boot the kernel, you'll
+ need a PalmOS compatible bootloader; check out
+ http://palmtelinux.sourceforge.net/ for more information.
+ Say Y here if you have this PDA model, say N otherwise.
 
 config MACH_NOKIA770
bool Nokia 770
Index: linux-2.6/arch/arm/mach-omap1/board-palmte.c
===
--- linux-2.6.orig/arch/arm/mach-omap1/board-palmte.c   2007-04-06 
09:00:28.0 -0400
+++ linux-2.6/arch/arm/mach-omap1/board-palmte.c2007-04-09 
14:49:36.0 -0400
@@ -17,49 +17,189 @@
 
 #include linux/kernel.h
 #include linux/init.h
+#include linux/input.h
 #include linux/platform_device.h
-#include linux/notifier.h
-#include linux/clk.h
+#include linux/mtd/mtd.h
+#include linux/mtd/partitions.h
+#include linux/spi/spi.h
+#include linux/spi/tsc2102.h
+#include linux/interrupt.h
 
+#include asm/apm.h
 #include asm/hardware.h
 #include asm/mach-types.h
 #include asm/mach/arch.h
 #include asm/mach/map.h
+#include asm/mach/flash.h
 
 #include asm/arch/gpio.h
 #include asm/arch/mux.h
 #include asm/arch/usb.h
+#include asm/arch/tc.h
+#include asm/arch/dma.h
 #include asm/arch/board.h
+#include asm/arch/irda.h
+#include asm/arch/keypad.h
 #include asm/arch/common.h
+#include asm/arch/mcbsp.h
+#include asm/arch/omap-alsa.h
 
-static void __init omap_generic_init_irq(void)
+static void __init omap_palmte_init_irq(void)
 {
omap1_init_common_hw();
omap_init_irq();
+   omap_gpio_init();
 }
 
+static int palmte_keymap[] = {
+   KEY(0, 0, KEY_F1),
+   KEY(0, 1, KEY_F2),
+   KEY(0, 2, KEY_F3),
+   KEY(0, 3, KEY_F4),
+   KEY(0, 4, KEY_POWER),
+   KEY(1, 0, KEY_LEFT),
+   KEY(1, 1, KEY_DOWN),
+   KEY(1, 2, KEY_UP),
+   KEY(1, 3, KEY_RIGHT),
+   KEY(1, 4, KEY_CENTER),
+   0,
+};
+
+static struct omap_kp_platform_data palmte_kp_data = {
+   .rows   = 8,
+   .cols   = 8,
+   .keymap = palmte_keymap,
+   .rep= 1,
+   .delay  = 12,
+};
+
+static struct resource palmte_kp_resources[] = {
+   [0] = {
+   .start  = INT_KEYBOARD,
+   .end= INT_KEYBOARD,
+   .flags  = IORESOURCE_IRQ,
+   },
+};
+
+static struct platform_device palmte_kp_device = {
+   .name   = omap-keypad,
+   .id = -1,
+   .dev= {
+   .platform_data  = palmte_kp_data,
+   },
+   .num_resources  = ARRAY_SIZE(palmte_kp_resources),
+   .resource   = palmte_kp_resources,
+};
+
+static struct mtd_partition palmte_rom_partitions[] = {
+   /* PalmOS Small ROM, contains the bootloader and the debugger */
+   {
+   .name   = smallrom,
+   .offset = 0,
+   .size   = 0xa000,
+   .mask_flags = MTD_WRITEABLE,
+   },
+   /* PalmOS Big ROM, a filesystem with all the OS code and data */
+   {
+   .name   = bigrom,
+   .offset = SZ_128K,
+   /*
+* 0x5f bytes big in the multi-language (EFIGS) version,
+* 0x7b bytes in the English-only (enUS) version.
+*/
+   .size   = 0x7b,
+   .mask_flags = MTD_WRITEABLE,
+   },
+};
+
+static struct flash_platform_data

[PATCH 3/14] ARM: OMAP: PalmZ71 support

2007-04-09 Thread Tony Lindgren
From: Marek Vasut [EMAIL PROTECTED]

Palmz71 specific things - board file.

Signed-off-by: Marek Vasut [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap1/Kconfig   |9 +
 arch/arm/mach-omap1/Makefile  |1 +
 arch/arm/mach-omap1/board-palmz71.c   |  384 +
 include/asm-arm/arch-omap/board-palmz71.h |   26 ++
 include/asm-arm/arch-omap/hardware.h  |4 +
 5 files changed, 424 insertions(+), 0 deletions(-)

Index: linux-2.6/arch/arm/mach-omap1/Kconfig
===
--- linux-2.6.orig/arch/arm/mach-omap1/Kconfig  2007-04-09 15:12:08.0 
-0400
+++ linux-2.6/arch/arm/mach-omap1/Kconfig   2007-04-09 15:16:08.0 
-0400
@@ -89,6 +89,15 @@ config MACH_OMAP_PALMTE
  http://palmtelinux.sourceforge.net/ for more information.
  Say Y here if you have this PDA model, say N otherwise.
 
+config MACH_OMAP_PALMZ71
+   bool Palm Zire71
+   depends on ARCH_OMAP1  ARCH_OMAP15XX
+   help
+Support for the Palm Zire71 PDA. To boot the kernel,
+you'll need a PalmOS compatible bootloader; check out
+http://hackndev.com/palm/z71 for more informations.
+Say Y here if you have such a PDA, say N otherwise.
+
 config MACH_NOKIA770
bool Nokia 770
depends on ARCH_OMAP1  ARCH_OMAP16XX
Index: linux-2.6/arch/arm/mach-omap1/Makefile
===
--- linux-2.6.orig/arch/arm/mach-omap1/Makefile 2007-04-09 15:12:08.0 
-0400
+++ linux-2.6/arch/arm/mach-omap1/Makefile  2007-04-09 15:16:08.0 
-0400
@@ -22,6 +22,7 @@ obj-$(CONFIG_MACH_OMAP_OSK)   += board-os
 obj-$(CONFIG_MACH_OMAP_H3) += board-h3.o
 obj-$(CONFIG_MACH_VOICEBLUE)   += board-voiceblue.o
 obj-$(CONFIG_MACH_OMAP_PALMTE) += board-palmte.o
+obj-$(CONFIG_MACH_OMAP_PALMZ71)+= board-palmz71.o
 obj-$(CONFIG_MACH_NOKIA770)+= board-nokia770.o
 obj-$(CONFIG_MACH_AMS_DELTA)   += board-ams-delta.o
 
Index: linux-2.6/arch/arm/mach-omap1/board-palmz71.c
===
--- /dev/null   1970-01-01 00:00:00.0 +
+++ linux-2.6/arch/arm/mach-omap1/board-palmz71.c   2007-04-09 
15:16:27.0 -0400
@@ -0,0 +1,383 @@
+/*
+ * linux/arch/arm/mach-omap1/board-palmz71.c
+ *
+ * Modified from board-generic.c
+ *
+ * Support for the Palm Zire71 PDA.
+ *
+ * Original version : Laurent Gonzalez
+ *
+ * Modified for zire71 : Marek Vasut
+ *
+ * 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.
+ */
+
+#include linux/delay.h
+#include linux/kernel.h
+#include linux/init.h
+#include linux/platform_device.h
+#include linux/notifier.h
+#include linux/clk.h
+#include linux/irq.h
+#include linux/input.h
+#include linux/interrupt.h
+#include linux/mtd/mtd.h
+#include linux/mtd/partitions.h
+
+#include asm/hardware.h
+#include asm/mach-types.h
+#include asm/mach/arch.h
+#include asm/mach/map.h
+#include asm/mach/flash.h
+
+#include asm/arch/mcbsp.h
+#include asm/arch/gpio.h
+#include asm/arch/mux.h
+#include asm/arch/usb.h
+#include asm/arch/dma.h
+#include asm/arch/tc.h
+#include asm/arch/board.h
+#include asm/arch/irda.h
+#include asm/arch/keypad.h
+#include asm/arch/common.h
+#include asm/arch/omap-alsa.h
+
+#include linux/input.h
+#include linux/spi/spi.h
+#include linux/spi/ads7846.h
+
+static void __init
+omap_palmz71_init_irq(void)
+{
+   omap1_init_common_hw();
+   omap_init_irq();
+   omap_gpio_init();
+}
+
+static int palmz71_keymap[] = {
+   KEY(0, 0, KEY_F1),
+   KEY(0, 1, KEY_F2),
+   KEY(0, 2, KEY_F3),
+   KEY(0, 3, KEY_F4),
+   KEY(0, 4, KEY_POWER),
+   KEY(1, 0, KEY_LEFT),
+   KEY(1, 1, KEY_DOWN),
+   KEY(1, 2, KEY_UP),
+   KEY(1, 3, KEY_RIGHT),
+   KEY(1, 4, KEY_CENTER),
+   KEY(2, 0, KEY_CAMERA),
+   0,
+};
+
+static struct omap_kp_platform_data palmz71_kp_data = {
+   .rows   = 8,
+   .cols   = 8,
+   .keymap = palmz71_keymap,
+   .rep= 1,
+   .delay  = 80,
+};
+
+static struct resource palmz71_kp_resources[] = {
+   [0] = {
+   .start  = INT_KEYBOARD,
+   .end= INT_KEYBOARD,
+   .flags  = IORESOURCE_IRQ,
+   },
+};
+
+static struct platform_device palmz71_kp_device = {
+   .name   = omap-keypad,
+   .id = -1,
+   .dev= {
+   .platform_data = palmz71_kp_data,
+   },
+   .num_resources  = ARRAY_SIZE(palmz71_kp_resources),
+   .resource   = palmz71_kp_resources,
+};
+
+static struct mtd_partition palmz71_rom_partitions[] = {
+   /* PalmOS Small ROM, contains the bootloader and the debugger */
+   {
+   .name

[PATCH 5/14] ARM: OMAP: Palm Tungsten|T support

2007-04-09 Thread Tony Lindgren
From: Marek Vasut [EMAIL PROTECTED]

This patch adds board file and necessary includes for Palm Tungsten|T.

Signed-off-by: Marek Vasut [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap1/Kconfig  |9 +
 arch/arm/mach-omap1/Makefile |1 +
 arch/arm/mach-omap1/board-palmtt.c   |  357 ++
 include/asm-arm/arch-omap/board-palmtt.h |   23 ++
 include/asm-arm/arch-omap/hardware.h |4 +
 5 files changed, 394 insertions(+), 0 deletions(-)

Index: linux-2.6/arch/arm/mach-omap1/Kconfig
===
--- linux-2.6.orig/arch/arm/mach-omap1/Kconfig  2007-04-09 15:02:38.0 
-0400
+++ linux-2.6/arch/arm/mach-omap1/Kconfig   2007-04-09 15:07:56.0 
-0400
@@ -98,6 +98,15 @@ config MACH_OMAP_PALMZ71
 http://hackndev.com/palm/z71 for more informations.
 Say Y here if you have such a PDA, say N otherwise.
 
+config MACH_OMAP_PALMTT
+   bool Palm Tungsten|T
+   depends on ARCH_OMAP1  ARCH_OMAP15XX
+   help
+ Support for the Palm Tungsten|T PDA. To boot the kernel, you'll
+ need a PalmOS compatible bootloader (Garux); check out
+ http://www.hackndev.com/palm/tt/ for more information.
+ Say Y here if you have this PDA model, say N otherwise.
+
 config MACH_NOKIA770
bool Nokia 770
depends on ARCH_OMAP1  ARCH_OMAP16XX
Index: linux-2.6/arch/arm/mach-omap1/Makefile
===
--- linux-2.6.orig/arch/arm/mach-omap1/Makefile 2007-04-09 15:02:38.0 
-0400
+++ linux-2.6/arch/arm/mach-omap1/Makefile  2007-04-09 15:07:56.0 
-0400
@@ -23,6 +23,7 @@ obj-$(CONFIG_MACH_OMAP_H3)+= board-h3.
 obj-$(CONFIG_MACH_VOICEBLUE)   += board-voiceblue.o
 obj-$(CONFIG_MACH_OMAP_PALMTE) += board-palmte.o
 obj-$(CONFIG_MACH_OMAP_PALMZ71)+= board-palmz71.o
+obj-$(CONFIG_MACH_OMAP_PALMTT) += board-palmtt.o
 obj-$(CONFIG_MACH_NOKIA770)+= board-nokia770.o
 obj-$(CONFIG_MACH_AMS_DELTA)   += board-ams-delta.o
 
Index: linux-2.6/arch/arm/mach-omap1/board-palmtt.c
===
--- /dev/null   1970-01-01 00:00:00.0 +
+++ linux-2.6/arch/arm/mach-omap1/board-palmtt.c2007-04-09 
15:07:56.0 -0400
@@ -0,0 +1,357 @@
+/*
+ * linux/arch/arm/mach-omap1/board-palmtt.c
+ *
+ * Modified from board-palmtt2.c
+ *
+ * Modified and amended for Palm Tungsten|T
+ * by Marek Vasut [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.
+ */
+
+#include linux/delay.h
+#include linux/kernel.h
+#include linux/init.h
+#include linux/platform_device.h
+#include linux/notifier.h
+#include linux/clk.h
+#include linux/input.h
+#include linux/interrupt.h
+#include linux/mtd/mtd.h
+#include linux/mtd/partitions.h
+#include linux/leds.h
+
+#include asm/hardware.h
+#include asm/mach-types.h
+#include asm/mach/arch.h
+#include asm/mach/map.h
+#include asm/mach/flash.h
+
+#include asm/arch/led.h
+#include asm/arch/mcbsp.h
+#include asm/arch/gpio.h
+#include asm/arch/mux.h
+#include asm/arch/usb.h
+#include asm/arch/dma.h
+#include asm/arch/tc.h
+#include asm/arch/board.h
+#include asm/arch/irda.h
+#include asm/arch/keypad.h
+#include asm/arch/common.h
+#include asm/arch/omap-alsa.h
+
+#include linux/input.h
+#include linux/spi/spi.h
+#include linux/spi/ads7846.h
+
+static int palmtt_keymap[] = {
+   KEY(0, 0, KEY_ESC),
+   KEY(0, 1, KEY_SPACE),
+   KEY(0, 2, KEY_LEFTCTRL),
+   KEY(0, 3, KEY_TAB),
+   KEY(0, 4, KEY_ENTER),
+   KEY(1, 0, KEY_LEFT),
+   KEY(1, 1, KEY_DOWN),
+   KEY(1, 2, KEY_UP),
+   KEY(1, 3, KEY_RIGHT),
+   KEY(2, 0, KEY_SLEEP),
+   KEY(2, 4, KEY_Y),
+   0
+};
+
+static struct mtd_partition palmtt_partitions[] = {
+   {
+   .name   = write8k,
+   .offset = 0,
+   .size   = SZ_8K,
+   .mask_flags = 0,
+   },
+   {
+   .name   = PalmOS-BootLoader(ro),
+   .offset = SZ_8K,
+   .size   = 7 * SZ_8K,
+   .mask_flags = MTD_WRITEABLE,
+   },
+   {
+   .name   = u-boot,
+   .offset = MTDPART_OFS_APPEND,
+   .size   = 8 * SZ_8K,
+   .mask_flags = 0,
+   },
+   {
+   .name   = PalmOS-FS(ro),
+   .offset = MTDPART_OFS_APPEND,
+   .size   = 7 * SZ_1M + 4 * SZ_64K - 16 * SZ_8K,
+   .mask_flags = MTD_WRITEABLE,
+   },
+   {
+   .name   = u-boot(rez

[PATCH 9/14] ARM: OMAP: Add omap osk defconfig

2007-04-09 Thread Tony Lindgren
Add omap osk defconfig

Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/configs/omap_osk_5912_defconfig | 1120 ++
 1 files changed, 1120 insertions(+), 0 deletions(-)

--- /dev/null
+++ b/arch/arm/configs/omap_osk_5912_defconfig
@@ -0,0 +1,1120 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.19
+# Thu Dec  7 16:32:04 2006
+#
+CONFIG_ARM=y
+# CONFIG_GENERIC_TIME is not set
+CONFIG_MMU=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+CONFIG_HARDIRQS_SW_RESEND=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_VECTORS_BASE=0x
+CONFIG_DEFCONFIG_LIST=/lib/modules/$UNAME_RELEASE/.config
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+
+#
+# General setup
+#
+CONFIG_LOCALVERSION=
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+# CONFIG_IPC_NS is not set
+# CONFIG_POSIX_MQUEUE is not set
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_UTS_NS is not set
+# CONFIG_AUDIT is not set
+# CONFIG_IKCONFIG is not set
+# CONFIG_SYSFS_DEPRECATED is not set
+# CONFIG_RELAY is not set
+CONFIG_INITRAMFS_SOURCE=
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_SYSCTL=y
+# CONFIG_EMBEDDED is not set
+CONFIG_UID16=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_SHMEM=y
+CONFIG_SLAB=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_RT_MUTEXES=y
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+# CONFIG_SLOB is not set
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_KMOD=y
+
+#
+# Block layer
+#
+CONFIG_BLOCK=y
+# CONFIG_LBD is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+# CONFIG_DEFAULT_AS is not set
+# CONFIG_DEFAULT_DEADLINE is not set
+CONFIG_DEFAULT_CFQ=y
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED=cfq
+
+#
+# System Type
+#
+# CONFIG_ARCH_AAEC2000 is not set
+# CONFIG_ARCH_INTEGRATOR is not set
+# CONFIG_ARCH_REALVIEW is not set
+# CONFIG_ARCH_VERSATILE is not set
+# CONFIG_ARCH_AT91 is not set
+# CONFIG_ARCH_CLPS7500 is not set
+# CONFIG_ARCH_CLPS711X is not set
+# CONFIG_ARCH_CO285 is not set
+# CONFIG_ARCH_EBSA110 is not set
+# CONFIG_ARCH_EP93XX is not set
+# CONFIG_ARCH_FOOTBRIDGE is not set
+# CONFIG_ARCH_NETX is not set
+# CONFIG_ARCH_H720X is not set
+# CONFIG_ARCH_IMX is not set
+# CONFIG_ARCH_IOP32X is not set
+# CONFIG_ARCH_IOP33X is not set
+# CONFIG_ARCH_IXP4XX is not set
+# CONFIG_ARCH_IXP2000 is not set
+# CONFIG_ARCH_IXP23XX is not set
+# CONFIG_ARCH_L7200 is not set
+# CONFIG_ARCH_PNX4008 is not set
+# CONFIG_ARCH_PXA is not set
+# CONFIG_ARCH_RPC is not set
+# CONFIG_ARCH_SA1100 is not set
+# CONFIG_ARCH_S3C2410 is not set
+# CONFIG_ARCH_SHARK is not set
+# CONFIG_ARCH_LH7A40X is not set
+CONFIG_ARCH_OMAP=y
+
+#
+# TI OMAP Implementations
+#
+CONFIG_ARCH_OMAP_OTG=y
+CONFIG_ARCH_OMAP1=y
+# CONFIG_ARCH_OMAP2 is not set
+
+#
+# OMAP Feature Selections
+#
+CONFIG_OMAP_RESET_CLOCKS=y
+# CONFIG_OMAP_BOOT_TAG is not set
+# CONFIG_OMAP_GPIO_SWITCH is not set
+CONFIG_OMAP_MUX=y
+# CONFIG_OMAP_MUX_DEBUG is not set
+CONFIG_OMAP_MUX_WARNINGS=y
+CONFIG_OMAP_MCBSP=y
+# CONFIG_OMAP_MPU_TIMER is not set
+CONFIG_OMAP_32K_TIMER=y
+CONFIG_OMAP_32K_TIMER_HZ=128
+# CONFIG_OMAP_DM_TIMER is not set
+CONFIG_OMAP_LL_DEBUG_UART1=y
+# CONFIG_OMAP_LL_DEBUG_UART2 is not set
+# CONFIG_OMAP_LL_DEBUG_UART3 is not set
+CONFIG_OMAP_SERIAL_WAKE=y
+
+#
+# OMAP Core Type
+#
+# CONFIG_ARCH_OMAP730 is not set
+# CONFIG_ARCH_OMAP15XX is not set
+CONFIG_ARCH_OMAP16XX=y
+
+#
+# OMAP Board Type
+#
+# CONFIG_MACH_OMAP_INNOVATOR is not set
+# CONFIG_MACH_OMAP_H2 is not set
+# CONFIG_MACH_OMAP_H3 is not set
+CONFIG_MACH_OMAP_OSK=y
+# CONFIG_OMAP_OSK_MISTRAL is not set
+# CONFIG_MACH_NOKIA770 is not set
+# CONFIG_MACH_OMAP_GENERIC is not set
+
+#
+# OMAP CPU Speed
+#
+# CONFIG_OMAP_CLOCKS_SET_BY_BOOTLOADER is not set
+# CONFIG_OMAP_ARM_216MHZ is not set
+CONFIG_OMAP_ARM_192MHZ=y
+# CONFIG_OMAP_ARM_168MHZ is not set
+# CONFIG_OMAP_ARM_120MHZ is not set
+# CONFIG_OMAP_ARM_60MHZ is not set
+# CONFIG_OMAP_ARM_30MHZ is not set
+
+#
+# Processor Type
+#
+CONFIG_CPU_32=y
+CONFIG_CPU_ARM926T=y
+CONFIG_CPU_32v5=y
+CONFIG_CPU_ABRT_EV5TJ=y
+CONFIG_CPU_CACHE_VIVT=y
+CONFIG_CPU_COPY_V4WB=y
+CONFIG_CPU_TLB_V4WBI=y
+CONFIG_CPU_CP15=y
+CONFIG_CPU_CP15_MMU=y
+
+#
+# Processor Features
+#
+# CONFIG_ARM_THUMB is not set
+# CONFIG_CPU_ICACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_DISABLE is not set

Re: [PATCH 0/90] Post 2.6.21 OMAP update

2007-04-09 Thread Tony Lindgren
* Roland Dreier [EMAIL PROTECTED] [070405 14:29]:
   Hmm, yeah I'll see if I could group them a bit. The problem there
   is that the patch series contains multiple rounds of add and fix
   cycles. Pretty much all the non-dependant fixes have already been
   applied, BTW.
 
 I think it's nice to roll up fixes into patches that haven't been
 merged upstream yet.  For example I try to avoid merging series like
 
   Add feature A
   Add feature B
   Fix 1 for feature A
   Fix 2 for feature A
   Fix for fix 1 for feature A
 
 because that means I already knew the first patch was broken before it
 ever got merged.  And it's better to avoid setting any more booby
 traps for people trying to use git bisect or something like
 that... enough bugs get merged by accident without us merging known
 bugs.  So before I merge, I go back and create a new series like
 
   Add fixed feature A
   Add feature B

OK, done and reposted. Your suggestion got the following fixes merged
into other patches:

0022-ARM-OMAP-Fix-Amstrad-Delta-omap-keypad-usage.txt
0023-ARM-OMAP-PalmZ71-extra-brace-fix.txt
0024-ARM-OMAP-Fix-typo-in-gpio.txt
0030-ARM-OMAP-Palm-Zire71-minor-fixes.txt
0033-ARM-OMAP-This-patch-enables-I2C-2-support-for-2430-SDP.txt
0034-ARM-OMAP-Set-keypad-sense-delays-for-the-Palms.txt
0048-ARM-OMAP-I2C-1-init-fix-for-2430.txt
0049-ARM-OMAP-update-board-2430-file-for-TWL-PIH-interrupts.txt
0050-ARM-OMAP-board-sdp2430.c-Remove-unnecessary-includes.txt
0056-ARM-OMAP-Make-board-palmz71-compile-again.txt
0058-ARM-OMAP-musb_hdrc-tusb-dma-patch-minor.txt
0064-ARM-OMAP-Fix-warning-in-pm.c.txt
0065-ARM-OMAP-Convert-interrupt-flags-SA_-to-IRQF_.txt
0073-ARM-OMAP-Add-onennand-board-specific-support-for-N800.txt
0074-ARM-OMAP-N800-Update-board-specific-audio-support.txt
0079-ARM-OMAP-fix-H4-dependencies-again.txt
0081-ARM-OMAP-omap2-pm.c-build-fix.txt
0084-ARM-OMAP-Update-changed-TSC2301-config-names-in-N800-board-files.txt
0089-ARM-OMAP-Activate-MPU-retention-code-in-omap2-pm.c.txt

I also split 0040-ARM-OMAP-Sync-board-specific-files-with-linux-omap.txt
into two patches, one for OMAP1 and one for OMAP2.

So now there are somewhat smaller mountain of patches :)

Regards,

Tony

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 10/18] ARM: OMAP: Fix warning in timer32k.c

2007-04-09 Thread Tony Lindgren
From: Dirk Behme [EMAIL PROTECTED]

ARM: OMAP: Fix warning in timer32k.c if CONFIG_NO_IDLE_HZ
isn't set:

arch/arm/plat-omap/timer32k.c:221: warning:
'omap_32k_timer_handler' defined but not used

Signed-off-by: Dirk Behme [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/plat-omap/timer32k.c |   24 
 1 files changed, 12 insertions(+), 12 deletions(-)

--- a/arch/arm/plat-omap/timer32k.c
+++ b/arch/arm/plat-omap/timer32k.c
@@ -217,6 +217,18 @@ static inline irqreturn_t _omap_32k_timer_interrupt(int 
irq, void *dev_id)
return IRQ_HANDLED;
 }
 
+static irqreturn_t omap_32k_timer_interrupt(int irq, void *dev_id)
+{
+   unsigned long flags;
+
+   write_seqlock_irqsave(xtime_lock, flags);
+   _omap_32k_timer_interrupt(irq, dev_id);
+   write_sequnlock_irqrestore(xtime_lock, flags);
+
+   return IRQ_HANDLED;
+}
+
+#ifdef CONFIG_NO_IDLE_HZ
 static irqreturn_t omap_32k_timer_handler(int irq, void *dev_id)
 {
unsigned long now;
@@ -233,18 +245,6 @@ static irqreturn_t omap_32k_timer_handler(int irq, void 
*dev_id)
return _omap_32k_timer_interrupt(irq, dev_id);
 }
 
-static irqreturn_t omap_32k_timer_interrupt(int irq, void *dev_id)
-{
-   unsigned long flags;
-
-   write_seqlock_irqsave(xtime_lock, flags);
-   _omap_32k_timer_interrupt(irq, dev_id);
-   write_sequnlock_irqrestore(xtime_lock, flags);
-
-   return IRQ_HANDLED;
-}
-
-#ifdef CONFIG_NO_IDLE_HZ
 /*
  * Programs the next timer interrupt needed. Called when dynamic tick is
  * enabled, and to reprogram the ticks to skip from pm_idle. Note that
-- 
1.4.4.2

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 13/18] ARM: OMAP: Sync framebuffer headers with N800 tree

2007-04-09 Thread Tony Lindgren
From: Kai Svahn [EMAIL PROTECTED]

This patch syncs framebuffer headers with N800 tree.

Signed-off-by: Kai Svahn [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 include/asm-arm/arch-omap/hwa742.h |   12 +++
 include/asm-arm/arch-omap/omapfb.h |   61 ++--
 2 files changed, 63 insertions(+), 10 deletions(-)

--- /dev/null
+++ b/include/asm-arm/arch-omap/hwa742.h
@@ -0,0 +1,12 @@
+#ifndef _HWA742_H
+#define _HWA742_H
+
+struct hwa742_platform_data {
+   void(*power_up)(struct device *dev);
+   void(*power_down)(struct device *dev);
+   unsigned long   (*get_clock_rate)(struct device *dev);
+
+   unsignedte_connected:1;
+};
+
+#endif
--- a/include/asm-arm/arch-omap/omapfb.h
+++ b/include/asm-arm/arch-omap/omapfb.h
@@ -38,30 +38,47 @@
 #define OMAPFB_SYNC_GFXOMAP_IO(37)
 #define OMAPFB_VSYNC   OMAP_IO(38)
 #define OMAPFB_SET_UPDATE_MODE OMAP_IOW(40, int)
-#define OMAPFB_UPDATE_WINDOW_OLD OMAP_IOW(41, struct omapfb_update_window_old)
+#define OMAPFB_GET_CAPSOMAP_IOR(42, struct omapfb_caps)
 #define OMAPFB_GET_UPDATE_MODE OMAP_IOW(43, int)
 #define OMAPFB_LCD_TESTOMAP_IOW(45, int)
 #define OMAPFB_CTRL_TEST   OMAP_IOW(46, int)
-#define OMAPFB_UPDATE_WINDOW   OMAP_IOW(47, struct omapfb_update_window)
+#define OMAPFB_UPDATE_WINDOW_OLD OMAP_IOW(47, struct omapfb_update_window_old)
 #define OMAPFB_SET_COLOR_KEY   OMAP_IOW(50, struct omapfb_color_key)
 #define OMAPFB_GET_COLOR_KEY   OMAP_IOW(51, struct omapfb_color_key)
 #define OMAPFB_SETUP_PLANE OMAP_IOW(52, struct omapfb_plane_info)
 #define OMAPFB_QUERY_PLANE OMAP_IOW(53, struct omapfb_plane_info)
+#define OMAPFB_UPDATE_WINDOW   OMAP_IOW(54, struct omapfb_update_window)
+#define OMAPFB_SETUP_MEM   OMAP_IOW(55, struct omapfb_mem_info)
+#define OMAPFB_QUERY_MEM   OMAP_IOW(56, struct omapfb_mem_info)
 
 #define OMAPFB_CAPS_GENERIC_MASK   0x0fff
 #define OMAPFB_CAPS_LCDC_MASK  0x00fff000
 #define OMAPFB_CAPS_PANEL_MASK 0xff00
 
 #define OMAPFB_CAPS_MANUAL_UPDATE  0x1000
+#define OMAPFB_CAPS_TEARSYNC   0x2000
+#define OMAPFB_CAPS_PLANE_RELOCATE_MEM 0x4000
+#define OMAPFB_CAPS_PLANE_SCALE0x8000
+#define OMAPFB_CAPS_WINDOW_PIXEL_DOUBLE0x0001
+#define OMAPFB_CAPS_WINDOW_SCALE   0x0002
+#define OMAPFB_CAPS_WINDOW_OVERLAY 0x0004
 #define OMAPFB_CAPS_SET_BACKLIGHT  0x0100
 
 /* Values from DSP must map to lower 16-bits */
-#define OMAPFB_FORMAT_MASK 0x00ff
-#define OMAPFB_FORMAT_FLAG_DOUBLE  0x0100
+#define OMAPFB_FORMAT_MASK 0x00ff
+#define OMAPFB_FORMAT_FLAG_DOUBLE  0x0100
+#define OMAPFB_FORMAT_FLAG_TEARSYNC0x0200
+#define OMAPFB_FORMAT_FLAG_FORCE_VSYNC 0x0400
+#define OMAPFB_FORMAT_FLAG_ENABLE_OVERLAY  0x0800
+#define OMAPFB_FORMAT_FLAG_DISABLE_OVERLAY 0x1000
 
 #define OMAPFB_EVENT_READY 1
 #define OMAPFB_EVENT_DISABLED  2
 
+#define OMAPFB_MEMTYPE_SDRAM   0
+#define OMAPFB_MEMTYPE_SRAM1
+#define OMAPFB_MEMTYPE_MAX 1
+
 enum omapfb_color_format {
OMAPFB_COLOR_RGB565 = 0,
OMAPFB_COLOR_YUV422,
@@ -78,11 +95,15 @@ struct omapfb_update_window {
__u32 x, y;
__u32 width, height;
__u32 format;
+   __u32 out_x, out_y;
+   __u32 out_width, out_height;
+   __u32 reserved[8];
 };
 
 struct omapfb_update_window_old {
__u32 x, y;
__u32 width, height;
+   __u32 format;
 };
 
 enum omapfb_plane {
@@ -108,6 +129,18 @@ struct omapfb_plane_info {
__u32 reserved2[12];
 };
 
+struct omapfb_mem_info {
+   __u32 size;
+   __u8  type;
+   __u8  reserved[3];
+};
+
+struct omapfb_caps {
+   __u32 ctrl;
+   __u32 plane_color;
+   __u32 wnd_color;
+};
+
 enum omapfb_color_key_type {
OMAPFB_COLOR_KEY_DISABLED = 0,
OMAPFB_COLOR_KEY_GFX_DST,
@@ -191,8 +224,6 @@ struct lcd_panel {
int (*run_test) (struct lcd_panel *panel, int test_num);
 };
 
-struct omapfb_device;
-
 struct extif_timings {
int cs_on_time;
int cs_off_time;
@@ -216,6 +247,7 @@ struct lcd_ctrl_extif {
int  (*init)(struct omapfb_device *fbdev);
void (*cleanup) (void);
void (*get_clk_info)(u32 *clk_period, u32 *max_clk_div);
+   unsigned long (*get_max_tx_rate)(void);
int  (*convert_timings) (struct extif_timings *timings);
void (*set_timings) (const struct extif_timings *timings);
void (*set_bits_per_cycle)(int bpc);
@@ -224,6 +256,10 @@ struct lcd_ctrl_extif {
void (*write_data)  (const void *buf, unsigned int len);
void (*transfer_area)   (int width, int height,
 void (callback)(void * data), void *data);
+   int  (*setup_tearsync)  (unsigned pin_cnt

[PATCH 11/18] ARM: OMAP: Update timer32k.c to compile

2007-04-09 Thread Tony Lindgren
This patch updates 32KiHZ timer code to compile.

Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/plat-omap/timer32k.c |   12 +---
 1 files changed, 1 insertions(+), 11 deletions(-)

--- a/arch/arm/plat-omap/timer32k.c
+++ b/arch/arm/plat-omap/timer32k.c
@@ -42,6 +42,7 @@
 #include linux/spinlock.h
 #include linux/err.h
 #include linux/clk.h
+#include linux/clocksource.h
 
 #include asm/system.h
 #include asm/hardware.h
@@ -171,15 +172,6 @@ omap_32k_ticks_to_nsecs(unsigned long ticks_32k)
 static unsigned long omap_32k_last_tick = 0;
 
 /*
- * Returns elapsed usecs since last 32k timer interrupt
- */
-static unsigned long omap_32k_timer_gettimeoffset(void)
-{
-   unsigned long now = omap_32k_sync_timer_read();
-   return omap_32k_ticks_to_usecs(now - omap_32k_last_tick);
-}
-
-/*
  * Returns current time from boot in nsecs. It's OK for this to wrap
  * around for now, as it's just a relative time stamp.
  */
@@ -302,7 +294,6 @@ static __init void omap_init_32k_timer(void)
 
if (cpu_class_is_omap1())
setup_irq(INT_OS_TIMER, omap_32k_timer_irq);
-   omap_timer.offset  = omap_32k_timer_gettimeoffset;
omap_32k_last_tick = omap_32k_sync_timer_read();
 
 #ifdef CONFIG_ARCH_OMAP2
@@ -337,5 +328,4 @@ static void __init omap_timer_init(void)
 
 struct sys_timer omap_timer = {
.init   = omap_timer_init,
-   .offset = NULL, /* Initialized later */
 };
-- 
1.4.4.2

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 15/18] ARM: OMAP: add SoSSI clock (call propagate_rate for childrens)

2007-04-09 Thread Tony Lindgren
From: Imre Deak [EMAIL PROTECTED]

Clocks with the follow parent rate mode were not updating their
children at propagate rate time.

Signed-off-by: Imre Deak [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/plat-omap/clock.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

--- a/arch/arm/plat-omap/clock.c
+++ b/arch/arm/plat-omap/clock.c
@@ -284,6 +284,8 @@ void followparent_recalc(struct clk *clk)
return;
 
clk-rate = clk-parent-rate;
+   if (unlikely(clk-flags  RATE_PROPAGATES))
+   propagate_rate(clk);
 }
 
 /* Propagate rate to children */
-- 
1.4.4.2

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 0/90] Post 2.6.21 OMAP update

2007-04-09 Thread Tony Lindgren
Hi,

* Russell King [EMAIL PROTECTED] [070406 03:19]:
 On Thu, Apr 05, 2007 at 09:27:13PM +0100, Alan Cox wrote:
   Hmm, yeah I'll see if I could group them a bit. The problem there
   is that the patch series contains multiple rounds of add and fix
   cycles. Pretty much all the non-dependant fixes have already been
   applied, BTW.
  
  Bear in mind that it doesn't work now, so merging some stuff and being in
  a more merged but still not yet a tree to build OMAP from is not a
  regression or a problem.
  
  Going back some time the PA-RISC merge occurred over several months until
  one day it was all there.
 
 I think Tony's problem is the volume of changes though - I think it is
 fair to say that in 2.6.18 it was fully merged and working.
 
 Since then, for one reason or another the merge windows got missed (ISTR
 it was triggered due to me not being able to devote the full 14 days to
 kernel work during the 2.6.19 merge window due to going on holiday) which
 has resulted in subsequent merge windows being missed, and therefore the
 number of changes increasing and the problem Tony's now in.
 
 In that respect, if it no longer works now, it's technically a
 regression.

Yeah, it works, but the current omap code in the mainline kernel is still
mostly at 2.6.18 level like you mentioned.

 Clearly the real solution is for rmk never to go on holiday during a
 merge window, but I don't personally find that acceptable.  Or maybe
 human cloning, but I'm sure there's people here who think that one rmk
 is enough. ;)

Or maybe there should be a two week common code and interface merge
window, then another two weeks for merging board and driver specific
stuff?

That would make it easier to update the board and driver specific
patches to the common code and interface changes first before they
are submitted.

Regards,

Tony
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 8/18] ARM: OMAP: Add mailbox support for IVA

2007-04-09 Thread Tony Lindgren
From: Hiroshi DOYU [EMAIL PROTECTED]

This patch adds a generic mailbox interface for for DSP and IVA
(Image Video Accelerator). This patch itself doesn't contain
any IVA driver.

Signed-off-by: Hiroshi DOYU [EMAIL PROTECTED]
Signed-off-by: Juha Yrjola [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap1/mailbox.c   |  206 
 arch/arm/mach-omap2/mailbox.c   |  310 ++
 arch/arm/plat-omap/mailbox.c|  352 +++
 arch/arm/plat-omap/mailbox.h|  193 +++
 include/asm-arm/arch-omap/mailbox.h |   68 +++
 5 files changed, 1129 insertions(+), 0 deletions(-)

--- /dev/null
+++ b/arch/arm/mach-omap1/mailbox.c
@@ -0,0 +1,206 @@
+/*
+ * Mailbox reservation modules for DSP
+ *
+ * Copyright (C) 2006 Nokia Corporation
+ * Written by: Hiroshi DOYU [EMAIL PROTECTED]
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file COPYING in the main directory of this archive
+ * for more details.
+ */
+
+#include linux/kernel.h
+#include linux/resource.h
+#include linux/interrupt.h
+#include linux/platform_device.h
+#include asm/arch/mailbox.h
+#include asm/arch/irqs.h
+#include asm/io.h
+
+#define MAILBOX_ARM2DSP1   0x00
+#define MAILBOX_ARM2DSP1b  0x04
+#define MAILBOX_DSP2ARM1   0x08
+#define MAILBOX_DSP2ARM1b  0x0c
+#define MAILBOX_DSP2ARM2   0x10
+#define MAILBOX_DSP2ARM2b  0x14
+#define MAILBOX_ARM2DSP1_Flag  0x18
+#define MAILBOX_DSP2ARM1_Flag  0x1c
+#define MAILBOX_DSP2ARM2_Flag  0x20
+
+unsigned long mbox_base;
+
+struct omap_mbox1_fifo {
+   unsigned long cmd;
+   unsigned long data;
+   unsigned long flag;
+};
+
+struct omap_mbox1_priv {
+   struct omap_mbox1_fifo tx_fifo;
+   struct omap_mbox1_fifo rx_fifo;
+};
+
+static inline int mbox_read_reg(unsigned int reg)
+{
+   return __raw_readw(mbox_base + reg);
+}
+
+static inline void mbox_write_reg(unsigned int val, unsigned int reg)
+{
+   __raw_writew(val, mbox_base + reg);
+}
+
+/* msg */
+static inline mbox_msg_t omap1_mbox_fifo_read(struct omap_mbox *mbox)
+{
+   struct omap_mbox1_fifo *fifo =
+   ((struct omap_mbox1_priv *)mbox-priv)-rx_fifo;
+   mbox_msg_t msg;
+
+   msg = mbox_read_reg(fifo-data);
+   msg |= ((mbox_msg_t) mbox_read_reg(fifo-cmd))  16;
+
+   return msg;
+}
+
+static inline void
+omap1_mbox_fifo_write(struct omap_mbox *mbox, mbox_msg_t msg)
+{
+   struct omap_mbox1_fifo *fifo =
+   ((struct omap_mbox1_priv *)mbox-priv)-tx_fifo;
+
+   mbox_write_reg(msg  0x, fifo-data);
+   mbox_write_reg(msg  16, fifo-cmd);
+}
+
+static inline int omap1_mbox_fifo_empty(struct omap_mbox *mbox)
+{
+   return 0;
+}
+
+static inline int omap1_mbox_fifo_full(struct omap_mbox *mbox)
+{
+   struct omap_mbox1_fifo *fifo =
+   ((struct omap_mbox1_priv *)mbox-priv)-rx_fifo;
+
+   return (mbox_read_reg(fifo-flag));
+}
+
+/* irq */
+static inline void
+omap1_mbox_enable_irq(struct omap_mbox *mbox, omap_mbox_type_t irq)
+{
+   if (irq == IRQ_RX)
+   enable_irq(mbox-irq);
+}
+
+static inline void
+omap1_mbox_disable_irq(struct omap_mbox *mbox, omap_mbox_type_t irq)
+{
+   if (irq == IRQ_RX)
+   disable_irq(mbox-irq);
+}
+
+static inline int
+omap1_mbox_is_irq(struct omap_mbox *mbox, omap_mbox_type_t irq)
+{
+   if (irq == IRQ_TX)
+   return 0;
+   return 1;
+}
+
+struct omap_mbox_ops omap1_mbox_ops = {
+   .type = OMAP_MBOX_TYPE1,
+   .fifo_read = omap1_mbox_fifo_read,
+   .fifo_write = omap1_mbox_fifo_write,
+   .fifo_empty = omap1_mbox_fifo_empty,
+   .fifo_full = omap1_mbox_fifo_full,
+   .enable_irq = omap1_mbox_enable_irq,
+   .disable_irq = omap1_mbox_disable_irq,
+   .is_irq = omap1_mbox_is_irq,
+};
+
+/* FIXME: the following struct should be created automatically by the user id  
*/
+
+/* DSP */
+static struct omap_mbox1_priv omap1_mbox_dsp_priv = {
+   .tx_fifo = {
+   .cmd  = MAILBOX_ARM2DSP1b,
+   .data = MAILBOX_ARM2DSP1,
+   .flag = MAILBOX_ARM2DSP1_Flag,
+   },
+   .rx_fifo = {
+   .cmd  = MAILBOX_DSP2ARM1b,
+   .data = MAILBOX_DSP2ARM1,
+   .flag = MAILBOX_DSP2ARM1_Flag,
+   },
+};
+
+struct omap_mbox mbox_dsp_info = {
+   .name = dsp,
+   .ops  = omap1_mbox_ops,
+   .priv = omap1_mbox_dsp_priv,
+};
+EXPORT_SYMBOL(mbox_dsp_info);
+
+static int __init omap1_mbox_probe(struct platform_device *pdev)
+{
+   struct resource *res;
+   int ret = 0;
+
+   if (pdev-num_resources != 2) {
+   dev_err(pdev-dev, invalid number of resources: %d\n,
+   pdev-num_resources);
+   return -ENODEV;
+   }
+
+   /* MBOX base

[PATCH 8/90] ARM: OMAP: FB: add controller platform data

2007-04-04 Thread Tony Lindgren
From: Imre Deak [EMAIL PROTECTED]

Add controller platform data

Signed-off-by: Imre Deak [EMAIL PROTECTED]
Signed-off-by: Juha Yrjola [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/plat-omap/fb.c|5 +
 include/asm-arm/arch-omap/omapfb.h |8 +---
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/arch/arm/plat-omap/fb.c b/arch/arm/plat-omap/fb.c
index 56acb87..91ebdaf 100644
--- a/arch/arm/plat-omap/fb.c
+++ b/arch/arm/plat-omap/fb.c
@@ -55,6 +55,11 @@ void omapfb_reserve_mem(void)
}
 }
 
+void omapfb_set_ctrl_platform_data(void *data)
+{
+   omapfb_config.ctrl_platform_data = data;
+}
+
 static inline int omap_init_fb(void)
 {
const struct omap_lcd_config *conf;
diff --git a/include/asm-arm/arch-omap/omapfb.h 
b/include/asm-arm/arch-omap/omapfb.h
index fccdb3d..ce80a71 100644
--- a/include/asm-arm/arch-omap/omapfb.h
+++ b/include/asm-arm/arch-omap/omapfb.h
@@ -292,8 +292,9 @@ struct omapfb_device {
 };
 
 struct omapfb_platform_data {
-   struct omap_lcd_config   lcd;
-   struct omap_fbmem_config fbmem;
+   struct omap_lcd_config  lcd;
+   struct omapfb_mem_desc  mem_desc;
+   void*ctrl_platform_data;
 };
 
 #define OMAPFB_EVENT_READY 1
@@ -317,8 +318,9 @@ extern int  omapfb_update_window_async(struct 
omapfb_update_window *win,
void (*callback)(void *),
void *callback_data);
 
-/* in arch/arm/plat-omap/devices.c */
+/* in arch/arm/plat-omap/fb.c */
 extern void omapfb_reserve_mem(void);
+extern void omapfb_set_ctrl_platform_data(void *pdata);
 
 #endif /* __KERNEL__ */
 
-- 
1.4.4.2

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 5/90] ARM: OMAP: Add function to print clock usecounts

2007-04-04 Thread Tony Lindgren
From: Juha Yrjola [EMAIL PROTECTED]

Useful for debugging power management code.

Signed-off-by: Juha Yrjola [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/plat-omap/clock.c |   35 +++
 1 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-omap/clock.c b/arch/arm/plat-omap/clock.c
index f1179ad..3d017b0 100644
--- a/arch/arm/plat-omap/clock.c
+++ b/arch/arm/plat-omap/clock.c
@@ -33,6 +33,41 @@ static DEFINE_SPINLOCK(clockfw_lock);
 
 static struct clk_functions *arch_clock;
 
+#ifdef CONFIG_PM_DEBUG
+
+static void print_parents(struct clk *clk)
+{
+   struct clk *p;
+   int printed = 0;
+
+   list_for_each_entry(p, clocks, node) {
+   if (p-parent == clk  p-usecount) {
+   if (!clk-usecount  !printed) {
+   printk(MISMATCH: %s\n, clk-name);
+   printed = 1;
+   }
+   printk(\t%-15s\n, p-name);
+   }
+   }
+}
+
+void clk_print_usecounts(void)
+{
+   unsigned long flags;
+   struct clk *p;
+
+   spin_lock_irqsave(clockfw_lock, flags);
+   list_for_each_entry(p, clocks, node) {
+   if (p-usecount)
+   printk(%-15s: %d\n, p-name, p-usecount);
+   print_parents(p);
+
+   }
+   spin_unlock_irqrestore(clockfw_lock, flags);
+}
+
+#endif
+
 /*-
  * Standard clock functions defined in include/linux/clk.h
  *-*/
-- 
1.4.4.2

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 7/90] ARM: OMAP: Optimize INTC register accesses and enable autoidling

2007-04-04 Thread Tony Lindgren
From: Juha Yrjola [EMAIL PROTECTED]

Use virtual addresses directly instead of physical addresses to
avoid having to recalculate the virtual address with every
register access.

Signed-off-by: Juha Yrjola [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap2/irq.c |   19 +++
 1 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mach-omap2/irq.c b/arch/arm/mach-omap2/irq.c
index a39d306..f064f72 100644
--- a/arch/arm/mach-omap2/irq.c
+++ b/arch/arm/mach-omap2/irq.c
@@ -37,7 +37,7 @@ static struct omap_irq_bank {
 } __attribute__ ((aligned(4))) irq_banks[] = {
{
/* MPU INTC */
-   .base_reg   = OMAP24XX_IC_BASE,
+   .base_reg   = IO_ADDRESS(OMAP24XX_IC_BASE),
.nr_irqs= 96,
}, {
/* XXX: DSP INTC */
@@ -47,7 +47,7 @@ static struct omap_irq_bank {
 /* XXX: FIQ and additional INTC support (only MPU at the moment) */
 static void omap_ack_irq(unsigned int irq)
 {
-   omap_writel(0x1, irq_banks[0].base_reg + INTC_CONTROL);
+   __raw_writel(0x1, irq_banks[0].base_reg + INTC_CONTROL);
 }
 
 static void omap_mask_irq(unsigned int irq)
@@ -60,7 +60,7 @@ static void omap_mask_irq(unsigned int irq)
irq %= 32;
}
 
-   omap_writel(1  irq, irq_banks[0].base_reg + INTC_MIR_SET0 + offset);
+   __raw_writel(1  irq, irq_banks[0].base_reg + INTC_MIR_SET0 + offset);
 }
 
 static void omap_unmask_irq(unsigned int irq)
@@ -73,7 +73,7 @@ static void omap_unmask_irq(unsigned int irq)
irq %= 32;
}
 
-   omap_writel(1  irq, irq_banks[0].base_reg + INTC_MIR_CLEAR0 + offset);
+   __raw_writel(1  irq, irq_banks[0].base_reg + INTC_MIR_CLEAR0 + 
offset);
 }
 
 static void omap_mask_ack_irq(unsigned int irq)
@@ -93,17 +93,20 @@ static void __init omap_irq_bank_init_one(struct 
omap_irq_bank *bank)
 {
unsigned long tmp;
 
-   tmp = omap_readl(bank-base_reg + INTC_REVISION)  0xff;
+   tmp = __raw_readl(bank-base_reg + INTC_REVISION)  0xff;
printk(KERN_INFO IRQ: Found an INTC at 0x%08lx 
 (revision %ld.%ld) with %d interrupts\n,
 bank-base_reg, tmp  4, tmp  0xf, bank-nr_irqs);
 
-   tmp = omap_readl(bank-base_reg + INTC_SYSCONFIG);
+   tmp = __raw_readl(bank-base_reg + INTC_SYSCONFIG);
tmp |= 1  1;  /* soft reset */
-   omap_writel(tmp, bank-base_reg + INTC_SYSCONFIG);
+   __raw_writel(tmp, bank-base_reg + INTC_SYSCONFIG);
 
-   while (!(omap_readl(bank-base_reg + INTC_SYSSTATUS)  0x1))
+   while (!(__raw_readl(bank-base_reg + INTC_SYSSTATUS)  0x1))
/* Wait for reset to complete */;
+
+   /* Enable autoidle */
+   __raw_writel(1  0, bank-base_reg + INTC_SYSCONFIG);
 }
 
 void __init omap_init_irq(void)
-- 
1.4.4.2

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/90] ARM: OMAP: Force APLLs always active

2007-04-04 Thread Tony Lindgren
From: Juha Yrjola [EMAIL PROTECTED]

The APLLs are most efficiently idled by hardware.

Signed-off-by: Juha Yrjola [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap2/clock.c |   13 ++---
 1 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
index 5170481..0306507 100644
--- a/arch/arm/mach-omap2/clock.c
+++ b/arch/arm/mach-omap2/clock.c
@@ -1160,8 +1160,8 @@ int __init omap2_clk_init(void)
clk_enable(sync_32k_ick);
clk_enable(omapctrl_ick);
 
-   /* Force the APLLs active during bootup to avoid disabling and
-* enabling them unnecessarily. */
+   /* Force the APLLs always active. The clocks are idled
+* automatically by hardware. */
clk_enable(apll96_ck);
clk_enable(apll54_ck);
 
@@ -1174,12 +1174,3 @@ int __init omap2_clk_init(void)
 
return 0;
 }
-
-static int __init omap2_disable_aplls(void)
-{
-   clk_disable(apll96_ck);
-   clk_disable(apll54_ck);
-
-   return 0;
-}
-late_initcall(omap2_disable_aplls);
-- 
1.4.4.2

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 0/90] Post 2.6.21 OMAP update

2007-04-04 Thread Tony Lindgren
Hi all,

Attached is a rather large OMAP update for post 2.6.21.

OMAP is a series of ARM processors from Texas Instruments
used in various cell phones and PDAs.

The patch series is based on code that has been brewing
in the linux-omap tree since last fall.

We'd like to switch the linux-omap tree to use the mainline
tree for core omap stuff, and this series attemps to do it
for most part. 

As the patch series is big, Andrew Morton asked me to post
it to LKML instead of linux-arm-kernel list for a wider review,
so please comment on the patches if you have a chance!

The patches touch only omap specific code at:

arch/arm/Kconfig
arch/arm/plat-omap
arch/arm/mach-omap1
arch/arm/mach-omap2
include/asm-arm/arch-omap

Regards,

Tony


-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3/90] ARM: OMAP: Add DMA IRQ sanity checks

2007-04-04 Thread Tony Lindgren
From: Juha Yrjola [EMAIL PROTECTED]

Add DMA IRQ sanity checks

Signed-off-by: Juha Yrjola [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/plat-omap/dma.c |   25 ++---
 1 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
index f3f84fb..2d86b10 100644
--- a/arch/arm/plat-omap/dma.c
+++ b/arch/arm/plat-omap/dma.c
@@ -925,10 +925,17 @@ static int omap2_dma_handle_ch(int ch)
 {
u32 status = OMAP_DMA_CSR_REG(ch);
 
-   if (!status)
+   if (!status) {
+   if (printk_ratelimit())
+   printk(KERN_WARNING Spurious DMA IRQ for lch %d\n, 
ch);
return 0;
-   if (unlikely(dma_chan[ch].dev_id == -1))
+   }
+   if (unlikely(dma_chan[ch].dev_id == -1)) {
+   if (printk_ratelimit())
+   printk(KERN_WARNING IRQ %04x for non-allocated DMA
+   channel %d\n, status, ch);
return 0;
+   }
if (unlikely(status  OMAP_DMA_DROP_IRQ))
printk(KERN_INFO
   DMA synchronization event drop occurred with device 
@@ -959,11 +966,15 @@ static irqreturn_t omap2_dma_irq_handler(int irq, void 
*dev_id)
int i;
 
val = omap_readl(OMAP_DMA4_IRQSTATUS_L0);
-
-   for (i = 1; i = OMAP_LOGICAL_DMA_CH_COUNT; i++) {
-   int active = val  (1  (i - 1));
-   if (active)
-   omap2_dma_handle_ch(i - 1);
+   if (val == 0) {
+   if (printk_ratelimit())
+   printk(KERN_WARNING Spurious DMA IRQ\n);
+   return IRQ_HANDLED;
+   }
+   for (i = 0; i  OMAP_LOGICAL_DMA_CH_COUNT  val != 0; i++) {
+   if (val  1)
+   omap2_dma_handle_ch(i);
+   val = 1;
}
 
return IRQ_HANDLED;
-- 
1.4.4.2

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 4/90] ARM: OMAP: Enable 24xx GPIO autoidling

2007-04-04 Thread Tony Lindgren
From: Juha Yrjola [EMAIL PROTECTED]

Enable 24xx GPIO autoidling

Signed-off-by: Juha Yrjola [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/plat-omap/gpio.c |   10 ++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index b8c01de..e2547a7 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -1083,6 +1083,10 @@ static int __init _omap_gpio_init(void)
if (bank-method == METHOD_GPIO_24XX) {
__raw_writel(0x, bank-base + 
OMAP24XX_GPIO_IRQENABLE1);
__raw_writel(0x, bank-base + 
OMAP24XX_GPIO_IRQSTATUS1);
+   __raw_writew(0x0015, bank-base + 
OMAP24XX_GPIO_SYSCONFIG);
+
+   /* Initialize interface clock ungated, module enabled */
+   __raw_writel(0, bank-base + OMAP24XX_GPIO_CTRL);
 
gpio_count = 32;
}
@@ -1105,6 +1109,12 @@ static int __init _omap_gpio_init(void)
if (cpu_is_omap16xx())
omap_writel(omap_readl(ULPD_CAM_CLK_CTRL) | 0x04, 
ULPD_CAM_CLK_CTRL);
 
+#ifdef CONFIG_ARCH_OMAP24XX
+   /* Enable autoidle for the OCP interface */
+   if (cpu_is_omap24xx())
+   omap_writel(1  0, 0x48019010);
+#endif
+
return 0;
 }
 
-- 
1.4.4.2

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/90] ARM: OMAP: Place SMS and SDRC into smart idle mode

2007-04-04 Thread Tony Lindgren
From: Juha Yrjola [EMAIL PROTECTED]

Place SMS and SDRC into smart idle mode

Signed-off-by: Juha Yrjola [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap2/io.c |2 +
 arch/arm/mach-omap2/memory.c |   48 ++
 2 files changed, 50 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index a0728c3..748920f 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -26,6 +26,7 @@
 extern void omap_sram_init(void);
 extern int omap2_clk_init(void);
 extern void omap2_check_revision(void);
+extern void omap2_init_memory(void);
 extern void gpmc_init(void);
 
 /*
@@ -67,5 +68,6 @@ void __init omap2_init_common_hw(void)
 {
omap2_mux_init();
omap2_clk_init();
+   omap2_init_memory();
gpmc_init();
 }
diff --git a/arch/arm/mach-omap2/memory.c b/arch/arm/mach-omap2/memory.c
index 85cbc2a..f173aa8 100644
--- a/arch/arm/mach-omap2/memory.c
+++ b/arch/arm/mach-omap2/memory.c
@@ -30,6 +30,38 @@
 #include prcm-regs.h
 #include memory.h
 
+#define SMS_BASE   0x68008000
+#define SMS_SYSCONFIG  0x010
+
+#define SDRC_BASE  0x68009000
+#define SDRC_SYSCONFIG 0x010
+#define SDRC_SYSSTATUS 0x014
+
+static const u32 sms_base = IO_ADDRESS(SMS_BASE);
+static const u32 sdrc_base = IO_ADDRESS(SDRC_BASE);
+
+
+static inline void sms_write_reg(int idx, u32 val)
+{
+   __raw_writel(val, sms_base + idx);
+}
+
+static inline u32 sms_read_reg(int idx)
+{
+   return __raw_readl(sms_base + idx);
+}
+
+static inline void sdrc_write_reg(int idx, u32 val)
+{
+   __raw_writel(val, sdrc_base + idx);
+}
+
+static inline u32 sdrc_read_reg(int idx)
+{
+   return __raw_readl(sdrc_base + idx);
+}
+
+
 static struct memory_timings mem_timings;
 
 u32 omap2_memory_get_slow_dll_ctrl(void)
@@ -99,3 +131,19 @@ void omap2_init_memory_params(u32 force_lock_to_unlock_mode)
/* 90 degree phase for anything below 133Mhz + disable DLL filter */
mem_timings.slow_dll_ctrl |= ((1  1) | (3  8));
 }
+
+void __init omap2_init_memory(void)
+{
+   u32 l;
+
+   l = sms_read_reg(SMS_SYSCONFIG);
+   l = ~(0x3  3);
+   l |= (0x2  3);
+   sms_write_reg(SMS_SYSCONFIG, l);
+
+   l = sdrc_read_reg(SDRC_SYSCONFIG);
+   l = ~(0x3  3);
+   l |= (0x2  3);
+   sdrc_write_reg(SDRC_SYSCONFIG, l);
+
+}
-- 
1.4.4.2

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 6/90] ARM: OMAP: Enable serial idling and wakeup features

2007-04-04 Thread Tony Lindgren
From: Juha Yrjola [EMAIL PROTECTED]

Enable serial idling and wakeup features

Signed-off-by: Juha Yrjola [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap2/serial.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index aaa5589..e9c367f 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -84,7 +84,7 @@ static inline void __init omap_serial_reset(struct 
plat_serial8250_port *p)
serial_write_reg(p, UART_OMAP_MDR1, 0x07);
serial_write_reg(p, UART_OMAP_SCR, 0x08);
serial_write_reg(p, UART_OMAP_MDR1, 0x00);
-   serial_write_reg(p, UART_OMAP_SYSC, 0x01);
+   serial_write_reg(p, UART_OMAP_SYSC, (0x02  3) | (1  2) | (1  0));
 }
 
 void __init omap_serial_init()
-- 
1.4.4.2

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 9/90] ARM: OMAP: Palm Tungsten E board update

2007-04-04 Thread Tony Lindgren
From: Andrzej Zaborowski [EMAIL PROTECTED]

General update of the board file for Palm Tungsten E. Registers the
platform devices contained in the PDA (ROM chip, keypad, infra-red)
and updates the configuration for USB and MMC, whose config values
were previously guessed in most cases due to lack of documentation
(and now are confirmed by a number of users). Macros for GPIO pins are
moved to a file in include/asm-arm/arch-omap.

Signed-off-by: Andrzej Zaborowski [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap1/Kconfig  |9 +-
 arch/arm/mach-omap1/board-palmte.c   |  377 --
 include/asm-arm/arch-omap/board-palmte.h |   34 +++
 include/asm-arm/arch-omap/hardware.h |4 +
 4 files changed, 401 insertions(+), 23 deletions(-)

diff --git a/arch/arm/mach-omap1/Kconfig b/arch/arm/mach-omap1/Kconfig
index 8781aae..cc266bf 100644
--- a/arch/arm/mach-omap1/Kconfig
+++ b/arch/arm/mach-omap1/Kconfig
@@ -81,11 +81,10 @@ config MACH_OMAP_PALMTE
bool Palm Tungsten E
depends on ARCH_OMAP1  ARCH_OMAP15XX
help
-  Support for the Palm Tungsten E PDA. Currently only the LCD panel
-  is supported. To boot the kernel, you'll need a PalmOS compatible
-  bootloader; check out http://palmtelinux.sourceforge.net for more
-  informations.
-  Say Y here if you have such a PDA, say NO otherwise.
+ Support for the Palm Tungsten E PDA.  To boot the kernel, you'll
+ need a PalmOS compatible bootloader; check out
+ http://palmtelinux.sourceforge.net/ for more information.
+ Say Y here if you have this PDA model, say N otherwise.
 
 config MACH_NOKIA770
bool Nokia 770
diff --git a/arch/arm/mach-omap1/board-palmte.c 
b/arch/arm/mach-omap1/board-palmte.c
index 4bc8a62..c23e8b6 100644
--- a/arch/arm/mach-omap1/board-palmte.c
+++ b/arch/arm/mach-omap1/board-palmte.c
@@ -17,49 +17,189 @@
 
 #include linux/kernel.h
 #include linux/init.h
+#include linux/input.h
 #include linux/platform_device.h
-#include linux/notifier.h
-#include linux/clk.h
+#include linux/mtd/mtd.h
+#include linux/mtd/partitions.h
+#include linux/spi/spi.h
+#include linux/spi/tsc2102.h
+#include linux/interrupt.h
 
+#include asm/apm.h
 #include asm/hardware.h
 #include asm/mach-types.h
 #include asm/mach/arch.h
 #include asm/mach/map.h
+#include asm/mach/flash.h
 
 #include asm/arch/gpio.h
 #include asm/arch/mux.h
 #include asm/arch/usb.h
+#include asm/arch/tc.h
+#include asm/arch/dma.h
 #include asm/arch/board.h
+#include asm/arch/irda.h
+#include asm/arch/keypad.h
 #include asm/arch/common.h
+#include asm/arch/mcbsp.h
+#include asm/arch/omap-alsa.h
 
-static void __init omap_generic_init_irq(void)
+static void __init omap_palmte_init_irq(void)
 {
omap1_init_common_hw();
omap_init_irq();
+   omap_gpio_init();
 }
 
+static int palmte_keymap[] = {
+   KEY(0, 0, KEY_F1),
+   KEY(0, 1, KEY_F2),
+   KEY(0, 2, KEY_F3),
+   KEY(0, 3, KEY_F4),
+   KEY(0, 4, KEY_POWER),
+   KEY(1, 0, KEY_LEFT),
+   KEY(1, 1, KEY_DOWN),
+   KEY(1, 2, KEY_UP),
+   KEY(1, 3, KEY_RIGHT),
+   KEY(1, 4, KEY_CENTER),
+   0,
+};
+
+static struct omap_kp_platform_data palmte_kp_data = {
+   .rows   = 8,
+   .cols   = 8,
+   .keymap = palmte_keymap,
+   .rep= 1,
+   .delay  = 12,
+};
+
+static struct resource palmte_kp_resources[] = {
+   [0] = {
+   .start  = INT_KEYBOARD,
+   .end= INT_KEYBOARD,
+   .flags  = IORESOURCE_IRQ,
+   },
+};
+
+static struct platform_device palmte_kp_device = {
+   .name   = omap-keypad,
+   .id = -1,
+   .dev= {
+   .platform_data  = palmte_kp_data,
+   },
+   .num_resources  = ARRAY_SIZE(palmte_kp_resources),
+   .resource   = palmte_kp_resources,
+};
+
+static struct mtd_partition palmte_rom_partitions[] = {
+   /* PalmOS Small ROM, contains the bootloader and the debugger */
+   {
+   .name   = smallrom,
+   .offset = 0,
+   .size   = 0xa000,
+   .mask_flags = MTD_WRITEABLE,
+   },
+   /* PalmOS Big ROM, a filesystem with all the OS code and data */
+   {
+   .name   = bigrom,
+   .offset = SZ_128K,
+   /*
+* 0x5f bytes big in the multi-language (EFIGS) version,
+* 0x7b bytes in the English-only (enUS) version.
+*/
+   .size   = 0x7b,
+   .mask_flags = MTD_WRITEABLE,
+   },
+};
+
+static struct flash_platform_data palmte_rom_data = {
+   .map_name   = map_rom,
+   .width  = 2,
+   .parts  = palmte_rom_partitions,
+   .nr_parts   = ARRAY_SIZE(palmte_rom_partitions),
+};
+
+static struct

[PATCH 10/90] ARM: OMAP: Implement workaround for GPIO wakeup bug in OMAP2420 silicon

2007-04-04 Thread Tony Lindgren
From: Juha Yrjola [EMAIL PROTECTED]

Some GPIOs on OMAP2420 do not have wakeup capabilities. If these GPIOs
are configured as IRQ sources, spurious interrupts will be generated
each time the core domain enters retention.

Signed-off-by: Juha Yrjola [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/plat-omap/gpio.c |  154 +++-
 1 files changed, 136 insertions(+), 18 deletions(-)

diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index e2547a7..c6cded5 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -118,8 +118,18 @@ struct gpio_bank {
u16 virtual_irq_start;
int method;
u32 reserved_map;
+#if defined (CONFIG_ARCH_OMAP16XX) || defined (CONFIG_ARCH_OMAP24XX)
u32 suspend_wakeup;
u32 saved_wakeup;
+#endif
+#ifdef CONFIG_ARCH_OMAP24XX
+   u32 non_wakeup_gpios;
+   u32 enabled_non_wakeup_gpios;
+
+   u32 saved_datain;
+   u32 saved_fallingdetect;
+   u32 saved_risingdetect;
+#endif
spinlock_t lock;
 };
 
@@ -398,8 +408,10 @@ do {   \
__raw_writel(l, base + reg); \
 } while(0)
 
-static inline void set_24xx_gpio_triggering(void __iomem *base, int gpio, int 
trigger)
+#ifdef CONFIG_ARCH_OMAP24XX
+static inline void set_24xx_gpio_triggering(struct gpio_bank *bank, int gpio, 
int trigger)
 {
+   void __iomem *base = bank-base;
u32 gpio_bit = 1  gpio;
 
MOD_REG_BIT(OMAP24XX_GPIO_LEVELDETECT0, gpio_bit,
@@ -410,9 +422,21 @@ static inline void set_24xx_gpio_triggering(void __iomem 
*base, int gpio, int tr
trigger  __IRQT_RISEDGE);
MOD_REG_BIT(OMAP24XX_GPIO_FALLINGDETECT, gpio_bit,
trigger  __IRQT_FALEDGE);
+   if (likely(!(bank-non_wakeup_gpios  gpio_bit))) {
+   if (trigger != 0)
+   __raw_writel(1  gpio, bank-base + 
OMAP24XX_GPIO_SETWKUENA);
+   else
+   __raw_writel(1  gpio, bank-base + 
OMAP24XX_GPIO_CLEARWKUENA);
+   } else {
+   if (trigger != 0)
+   bank-enabled_non_wakeup_gpios |= gpio_bit;
+   else
+   bank-enabled_non_wakeup_gpios = ~gpio_bit;
+   }
/* FIXME: Possibly do 'set_irq_handler(j, handle_level_irq)' if only 
level
 * triggering requested. */
 }
+#endif
 
 static int _set_gpio_triggering(struct gpio_bank *bank, int gpio, int trigger)
 {
@@ -440,6 +464,7 @@ static int _set_gpio_triggering(struct gpio_bank *bank, int 
gpio, int trigger)
else
goto bad;
break;
+#ifdef CONFIG_ARCH_OMAP16XX
case METHOD_GPIO_1610:
if (gpio  0x08)
reg += OMAP1610_GPIO_EDGE_CTRL2;
@@ -455,7 +480,14 @@ static int _set_gpio_triggering(struct gpio_bank *bank, 
int gpio, int trigger)
l |= 2  (gpio  1);
if (trigger  __IRQT_FALEDGE)
l |= 1  (gpio  1);
+   if (trigger)
+   /* Enable wake-up during idle for dynamic tick */
+   __raw_writel(1  gpio, bank-base + 
OMAP1610_GPIO_SET_WAKEUPENA);
+   else
+   __raw_writel(1  gpio, bank-base + 
OMAP1610_GPIO_CLEAR_WAKEUPENA);
break;
+#endif
+#ifdef CONFIG_ARCH_OMAP730
case METHOD_GPIO_730:
reg += OMAP730_GPIO_INT_CONTROL;
l = __raw_readl(reg);
@@ -466,9 +498,12 @@ static int _set_gpio_triggering(struct gpio_bank *bank, 
int gpio, int trigger)
else
goto bad;
break;
+#endif
+#ifdef CONFIG_ARCH_OMAP24XX
case METHOD_GPIO_24XX:
-   set_24xx_gpio_triggering(reg, gpio, trigger);
+   set_24xx_gpio_triggering(bank, gpio, trigger);
break;
+#endif
default:
BUG();
goto bad;
@@ -652,8 +687,8 @@ static inline void _set_gpio_irqenable(struct gpio_bank 
*bank, int gpio, int ena
 static int _set_gpio_wakeup(struct gpio_bank *bank, int gpio, int enable)
 {
switch (bank-method) {
+#ifdef CONFIG_ARCH_OMAP16XX
case METHOD_GPIO_1610:
-   case METHOD_GPIO_24XX:
spin_lock(bank-lock);
if (enable)
bank-suspend_wakeup |= (1  gpio);
@@ -661,6 +696,24 @@ static int _set_gpio_wakeup(struct gpio_bank *bank, int 
gpio, int enable)
bank-suspend_wakeup = ~(1  gpio);
spin_unlock(bank-lock);
return 0;
+#endif
+#ifdef CONFIG_ARCH_OMAP24XX
+   case METHOD_GPIO_24XX:
+   spin_lock(bank-lock);
+   if (enable) {
+   if (bank-non_wakeup_gpios  (1  gpio)) {
+   printk(KERN_ERR Unable to enable wakeup on
+   non-wakeup GPIO%d\n

[PATCH 12/90] ARM: OMAP: Fix apollon boot

2007-04-04 Thread Tony Lindgren
From: Kyungmin Park [EMAIL PROTECTED]

In previous GPMC patch, there was a typo. Fix typo and add header files for
set_irq_type() warnings.

Signed-off-by: Kyungmin Park [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap2/board-apollon.c |   99 +++---
 1 files changed, 90 insertions(+), 9 deletions(-)

diff --git a/arch/arm/mach-omap2/board-apollon.c 
b/arch/arm/mach-omap2/board-apollon.c
index 878ff91..3bb49c1 100644
--- a/arch/arm/mach-omap2/board-apollon.c
+++ b/arch/arm/mach-omap2/board-apollon.c
@@ -25,6 +25,8 @@
 #include linux/irq.h
 #include linux/interrupt.h
 #include linux/delay.h
+#include linux/leds.h
+#include linux/irq.h
 
 #include asm/hardware.h
 #include asm/mach-types.h
@@ -32,10 +34,12 @@
 #include asm/mach/flash.h
 
 #include asm/arch/gpio.h
+#include asm/arch/led.h
 #include asm/arch/mux.h
 #include asm/arch/usb.h
 #include asm/arch/board.h
 #include asm/arch/common.h
+#include asm/arch/gpmc.h
 #include prcm-regs.h
 
 /* LED  Switch macros */
@@ -46,6 +50,9 @@
 #define SW_UP_GPIO17   17
 #define SW_DOWN_GPIO58 58
 
+#define APOLLON_FLASH_CS   0
+#define APOLLON_ETH_CS 1
+
 static struct mtd_partition apollon_partitions[] = {
{
.name   = X-Loader + U-Boot,
@@ -85,10 +92,10 @@ static struct flash_platform_data apollon_flash_data = {
.nr_parts   = ARRAY_SIZE(apollon_partitions),
 };
 
-static struct resource apollon_flash_resource = {
-   .start  = APOLLON_CS0_BASE,
-   .end= APOLLON_CS0_BASE + SZ_128K,
-   .flags  = IORESOURCE_MEM,
+static struct resource apollon_flash_resource[] = {
+   [0] = {
+   .flags  = IORESOURCE_MEM,
+   },
 };
 
 static struct platform_device apollon_onenand_device = {
@@ -97,14 +104,24 @@ static struct platform_device apollon_onenand_device = {
.dev= {
.platform_data  = apollon_flash_data,
},
-   .num_resources  = ARRAY_SIZE(apollon_flash_resource),
-   .resource   = apollon_flash_resource,
+   .num_resources  = ARRAY_SIZE(apollon_flash_resource),
+   .resource   = apollon_flash_resource,
 };
 
+static void __init apollon_flash_init(void)
+{
+   unsigned long base;
+
+   if (gpmc_cs_request(APOLLON_FLASH_CS, SZ_128K, base)  0) {
+   printk(KERN_ERR Cannot request OneNAND GPMC CS\n);
+   return;
+   }
+   apollon_flash_resource[0].start = base;
+   apollon_flash_resource[0].end   = base + SZ_128K - 1;
+}
+
 static struct resource apollon_smc91x_resources[] = {
[0] = {
-   .start  = APOLLON_ETHR_START,   /* Physical */
-   .end= APOLLON_ETHR_START + 0xf,
.flags  = IORESOURCE_MEM,
},
[1] = {
@@ -126,14 +143,51 @@ static struct platform_device apollon_lcd_device = {
.id = -1,
 };
 
+static struct omap_led_config apollon_led_config[] = {
+   {
+   .cdev   = {
+   .name   = apollon:led0,
+   },
+   .gpio   = LED0_GPIO13,
+   },
+   {
+   .cdev   = {
+   .name   = apollon:led1,
+   },
+   .gpio   = LED1_GPIO14,
+   },
+   {
+   .cdev   = {
+   .name   = apollon:led2,
+   },
+   .gpio   = LED2_GPIO15,
+   },
+};
+
+static struct omap_led_platform_data apollon_led_data = {
+   .nr_leds= ARRAY_SIZE(apollon_led_config),
+   .leds   = apollon_led_config,
+};
+
+static struct platform_device apollon_led_device = {
+   .name   = omap-led,
+   .id = -1,
+   .dev= {
+   .platform_data  = apollon_led_data,
+   },
+};
+
 static struct platform_device *apollon_devices[] __initdata = {
apollon_onenand_device,
apollon_smc91x_device,
apollon_lcd_device,
+   apollon_led_device,
 };
 
 static inline void __init apollon_init_smc91x(void)
 {
+   unsigned long base;
+
/* Make sure CS1 timings are correct */
GPMC_CONFIG1_1 = 0x00011203;
GPMC_CONFIG2_1 = 0x001f1f01;
@@ -141,13 +195,20 @@ static inline void __init apollon_init_smc91x(void)
GPMC_CONFIG4_1 = 0x1c091c09;
GPMC_CONFIG5_1 = 0x041f1f1f;
GPMC_CONFIG6_1 = 0x04c4;
-   GPMC_CONFIG7_1 = 0x0f40 | (APOLLON_CS1_BASE  24);
+
+   if (gpmc_cs_request(APOLLON_ETH_CS, SZ_16M, base)  0) {
+   printk(KERN_ERR Failed to request GPMC CS for smc91x\n);
+   return;
+   }
+   apollon_smc91x_resources[0].start = base + 0x300;
+   apollon_smc91x_resources[0].end   = base + 0x30f;
udelay(100);
 
omap_cfg_reg(W4__24XX_GPIO74);
if (omap_request_gpio(APOLLON_ETHR_GPIO_IRQ)  0) {
printk(KERN_ERR Failed

[PATCH 11/90] ARM: OMAP: Add support for Amstrad Delta keypad

2007-04-04 Thread Tony Lindgren
From: Jonathan McDowell [EMAIL PROTECTED]

This adds support for the keypad on the top of the Amstrad Delta. It's
just a standard omap-keypad so all we need to do is add the keypad
layout and platform data to the board definition file.

Signed-off-by: Jonathan McDowell [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap1/board-ams-delta.c |  108 +
 1 files changed, 108 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap1/board-ams-delta.c 
b/arch/arm/mach-omap1/board-ams-delta.c
index 8437d06..ad6265f 100644
--- a/arch/arm/mach-omap1/board-ams-delta.c
+++ b/arch/arm/mach-omap1/board-ams-delta.c
@@ -14,6 +14,7 @@
 
 #include linux/kernel.h
 #include linux/init.h
+#include linux/input.h
 #include linux/platform_device.h
 
 #include asm/hardware.h
@@ -23,6 +24,7 @@
 
 #include asm/arch/board-ams-delta.h
 #include asm/arch/gpio.h
+#include asm/arch/keypad.h
 #include asm/arch/mux.h
 #include asm/arch/usb.h
 #include asm/arch/board.h
@@ -31,6 +33,86 @@
 static u8 ams_delta_latch1_reg;
 static u16 ams_delta_latch2_reg;
 
+static int ams_delta_keymap[] = {
+   KEY(0, 0, KEY_F1),  /* Advert   */
+
+   KEY(3, 0, KEY_COFFEE),  /* Games */
+   KEY(2, 0, KEY_QUESTION),/* Directory */
+   KEY(3, 2, KEY_CONNECT), /* Internet  */
+   KEY(2, 1, KEY_SHOP),/* Services  */
+   KEY(1, 1, KEY_PHONE),   /* VoiceMail */
+
+   KEY(1, 0, KEY_DELETE),  /* Delete   */
+   KEY(2, 2, KEY_PLAY),/* Play   */
+   KEY(0, 1, KEY_PAGEUP),  /* Up   */
+   KEY(3, 1, KEY_PAGEDOWN),/* Down   */
+   KEY(0, 2, KEY_EMAIL),   /* ReadEmail */
+   KEY(1, 2, KEY_STOP),/* Stop   */
+
+   /* Numeric keypad portion */
+   KEY(7, 0, KEY_KP1),
+   KEY(6, 0, KEY_KP2),
+   KEY(5, 0, KEY_KP3),
+   KEY(7, 1, KEY_KP4),
+   KEY(6, 1, KEY_KP5),
+   KEY(5, 1, KEY_KP6),
+   KEY(7, 2, KEY_KP7),
+   KEY(6, 2, KEY_KP8),
+   KEY(5, 2, KEY_KP9),
+   KEY(6, 3, KEY_KP0),
+   KEY(7, 3, KEY_KPASTERISK),
+   KEY(5, 3, KEY_KPDOT),   /* # key */
+   KEY(2, 7, KEY_NUMLOCK), /* Mute   */
+   KEY(1, 7, KEY_KPMINUS), /* Recall   */
+   KEY(1, 6, KEY_KPPLUS),  /* Redial   */
+   KEY(6, 7, KEY_KPSLASH), /* Handsfree */
+   KEY(0, 6, KEY_ENTER),   /* Video */
+
+   KEY(4, 7, KEY_CAMERA),  /* Photo */
+
+   KEY(4, 0, KEY_F2),  /* Home   */
+   KEY(4, 1, KEY_F3),  /* Office   */
+   KEY(4, 2, KEY_F4),  /* Mobile   */
+   KEY(7, 7, KEY_F5),  /* SMS  */
+   KEY(5, 7, KEY_F6),  /* Email */
+
+   /* QWERTY portion of keypad */
+   KEY(4, 3, KEY_Q),
+   KEY(3, 3, KEY_W),
+   KEY(2, 3, KEY_E),
+   KEY(1, 3, KEY_R),
+   KEY(0, 3, KEY_T),
+   KEY(7, 4, KEY_Y),
+   KEY(6, 4, KEY_U),
+   KEY(5, 4, KEY_I),
+   KEY(4, 4, KEY_O),
+   KEY(3, 4, KEY_P),
+
+   KEY(2, 4, KEY_A),
+   KEY(1, 4, KEY_S),
+   KEY(0, 4, KEY_D),
+   KEY(7, 5, KEY_F),
+   KEY(6, 5, KEY_G),
+   KEY(5, 5, KEY_H),
+   KEY(4, 5, KEY_J),
+   KEY(3, 5, KEY_K),
+   KEY(2, 5, KEY_L),
+
+   KEY(1, 5, KEY_Z),
+   KEY(0, 5, KEY_X),
+   KEY(7, 6, KEY_C),
+   KEY(6, 6, KEY_V),
+   KEY(5, 6, KEY_B),
+   KEY(4, 6, KEY_N),
+   KEY(3, 6, KEY_M),
+   KEY(2, 6, KEY_SPACE),
+
+   KEY(0, 7, KEY_LEFTSHIFT),   /* Vol up   */
+   KEY(3, 7, KEY_LEFTCTRL),/* Vol down  */
+
+   0
+};
+
 void ams_delta_latch1_write(u8 mask, u8 value)
 {
ams_delta_latch1_reg = ~mask;
@@ -91,12 +173,38 @@ static struct omap_board_config_kernel ams_delta_config[] 
= {
{ OMAP_TAG_USB, ams_delta_usb_config },
 };
 
+static struct resource ams_delta_kp_resources[] = {
+   [0] = {
+   .start  = INT_KEYBOARD,
+   .end= INT_KEYBOARD,
+   .flags  = IORESOURCE_IRQ,
+   },
+};
+
+static struct omap_kp_platform_data ams_delta_kp_data = {
+   .rows   = 8,
+   .cols   = 8,
+   .keymap = ams_delta_keymap,
+   .rep= 1,
+};
+
+static struct platform_device ams_delta_kp_device = {
+   .name   = omap-keypad,
+   .id = -1,
+   .dev= {
+   .platform_data = ams_delta_kp_data,
+   },
+   .num_resources  = ARRAY_SIZE(ams_delta_kp_resources),
+   .resource   = ams_delta_kp_resources,
+};
+
 static struct platform_device ams_delta_led_device = {
.name   = ams-delta-led,
.id = -1
 };
 
 static struct platform_device *ams_delta_devices[] __initdata = {
+   ams_delta_kp_device,
ams_delta_led_device,
 };
 
-- 
1.4.4.2

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http

[PATCH 18/90] ARM: OMAP: PalmZ71 support

2007-04-04 Thread Tony Lindgren
From: =?utf-8?q?Marek_Va=C5=A1ut?= [EMAIL PROTECTED]

Palmz71 specific things - board file.

Signed-off-by: Marek VaĊĦut [EMAIL PROTECTED]
Signed-off-by: Tony Lindgren [EMAIL PROTECTED]
---
 arch/arm/mach-omap1/Kconfig   |9 +
 arch/arm/mach-omap1/Makefile  |1 +
 arch/arm/mach-omap1/board-palmz71.c   |  384 +
 include/asm-arm/arch-omap/board-palmz71.h |   26 ++
 include/asm-arm/arch-omap/hardware.h  |4 +
 5 files changed, 424 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap1/Kconfig b/arch/arm/mach-omap1/Kconfig
index cc266bf..1cdb0ea 100644
--- a/arch/arm/mach-omap1/Kconfig
+++ b/arch/arm/mach-omap1/Kconfig
@@ -86,6 +86,15 @@ config MACH_OMAP_PALMTE
  http://palmtelinux.sourceforge.net/ for more information.
  Say Y here if you have this PDA model, say N otherwise.
 
+config MACH_OMAP_PALMZ71
+   bool Palm Zire71
+   depends on ARCH_OMAP1  ARCH_OMAP15XX
+   help
+Support for the Palm Zire71 PDA. To boot the kernel,
+you'll need a PalmOS compatible bootloader; check out
+http://hackndev.com/palm/z71 for more informations.
+Say Y here if you have such a PDA, say N otherwise.
+
 config MACH_NOKIA770
bool Nokia 770
depends on ARCH_OMAP1  ARCH_OMAP16XX
diff --git a/arch/arm/mach-omap1/Makefile b/arch/arm/mach-omap1/Makefile
index 7165f74..1a62c78 100644
--- a/arch/arm/mach-omap1/Makefile
+++ b/arch/arm/mach-omap1/Makefile
@@ -22,6 +22,7 @@ obj-$(CONFIG_MACH_OMAP_OSK)   += board-osk.o
 obj-$(CONFIG_MACH_OMAP_H3) += board-h3.o
 obj-$(CONFIG_MACH_VOICEBLUE)   += board-voiceblue.o
 obj-$(CONFIG_MACH_OMAP_PALMTE) += board-palmte.o
+obj-$(CONFIG_MACH_OMAP_PALMZ71)+= board-palmz71.o
 obj-$(CONFIG_MACH_NOKIA770)+= board-nokia770.o
 obj-$(CONFIG_MACH_AMS_DELTA)   += board-ams-delta.o
 
diff --git a/arch/arm/mach-omap1/board-palmz71.c 
b/arch/arm/mach-omap1/board-palmz71.c
new file mode 100644
index 000..d02eb34
--- /dev/null
+++ b/arch/arm/mach-omap1/board-palmz71.c
@@ -0,0 +1,384 @@
+/*
+ * linux/arch/arm/mach-omap1/board-palmz71.c
+ *
+ * Modified from board-generic.c
+ *
+ * Support for the Palm Zire71 PDA.
+ *
+ * Original version : Laurent Gonzalez
+ *
+ * Modified for zire71 : Marek Vasut
+ *
+ * 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.
+ */
+
+#include linux/delay.h
+#include linux/kernel.h
+#include linux/init.h
+#include linux/platform_device.h
+#include linux/notifier.h
+#include linux/clk.h
+#include linux/irq.h
+#include linux/input.h
+#include linux/interrupt.h
+#include linux/mtd/mtd.h
+#include linux/mtd/partitions.h
+
+#include asm/hardware.h
+#include asm/mach-types.h
+#include asm/mach/arch.h
+#include asm/mach/map.h
+#include asm/mach/flash.h
+
+#include asm/arch/mcbsp.h
+#include asm/arch/gpio.h
+#include asm/arch/mux.h
+#include asm/arch/usb.h
+#include asm/arch/dma.h
+#include asm/arch/tc.h
+#include asm/arch/board.h
+#include asm/arch/irda.h
+#include asm/arch/keypad.h
+#include asm/arch/common.h
+#include asm/arch/omap-alsa.h
+
+#include linux/input.h
+#include linux/spi/spi.h
+#include linux/spi/ads7846.h
+
+static void __init
+omap_palmz71_init_irq(void)
+{
+   omap1_init_common_hw();
+   omap_init_irq();
+   omap_gpio_init();
+}
+
+static int palmz71_keymap[] = {
+   KEY(0, 0, KEY_F1),
+   KEY(0, 1, KEY_F2),
+   KEY(0, 2, KEY_F3),
+   KEY(0, 3, KEY_F4),
+   KEY(0, 4, KEY_POWER),
+   KEY(1, 0, KEY_LEFT),
+   KEY(1, 1, KEY_DOWN),
+   KEY(1, 2, KEY_UP),
+   KEY(1, 3, KEY_RIGHT),
+   KEY(1, 4, KEY_CENTER),
+   KEY(2, 0, KEY_CAMERA),
+   0,
+};
+
+static struct omap_kp_platform_data palmz71_kp_data = {
+   .rows   = 8,
+   .cols   = 8,
+   .keymap = palmz71_keymap,
+   .rep= 1,
+};
+
+static struct resource palmz71_kp_resources[] = {
+   [0] = {
+   .start  = INT_KEYBOARD,
+   .end= INT_KEYBOARD,
+   .flags  = IORESOURCE_IRQ,
+   },
+};
+
+static struct platform_device palmz71_kp_device = {
+   .name   = omap-keypad,
+   .id = -1,
+   .dev= {
+   .platform_data = palmz71_kp_data,
+   },
+   .num_resources  = ARRAY_SIZE(palmz71_kp_resources),
+   .resource   = palmz71_kp_resources,
+};
+
+static struct mtd_partition palmz71_rom_partitions[] = {
+   /* PalmOS Small ROM, contains the bootloader and the debugger */
+   {
+   .name   = smallrom,
+   .offset = 0,
+   .size   = 0xa000,
+   .mask_flags = MTD_WRITEABLE,
+   },
+   /* PalmOS Big ROM, a filesystem with all the OS code and data */
+   {
+   .name   = bigrom

  1   2   3   4   5   6   7   8   9   10   >