[PATCH v2] arm: omap3: cm-t35: add support for cm-t3730

2011-05-08 Thread Igor Grinberg
cm-t3730 is basically the same board as cm-t35, but has DM3730 SoC
assembled and therefore some changes are required.

Signed-off-by: Igor Grinberg grinb...@compulab.co.il
Acked-by: Mike Rapoport m...@compulab.co.il
---
v2: Add debug uart entry

 arch/arm/mach-omap2/Kconfig  |2 +-
 arch/arm/mach-omap2/board-cm-t35.c   |   62 +++--
 arch/arm/plat-omap/include/plat/uncompress.h |1 +
 3 files changed, 49 insertions(+), 16 deletions(-)

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index b997a35..920b6bc 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -266,7 +266,7 @@ config MACH_OMAP_ZOOM3
select REGULATOR_FIXED_VOLTAGE
 
 config MACH_CM_T35
-   bool CompuLab CM-T35 module
+   bool CompuLab CM-T35/CM-T3730 modules
depends on ARCH_OMAP3
default y
select OMAP_PACKAGE_CUS
diff --git a/arch/arm/mach-omap2/board-cm-t35.c 
b/arch/arm/mach-omap2/board-cm-t35.c
index 6063be8..c0f6ce0 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -524,7 +524,7 @@ static void __init cm_t35_init_early(void)
 }
 
 #ifdef CONFIG_OMAP_MUX
-static struct omap_board_mux board_mux[] __initdata = {
+static struct omap_board_mux cm_t35_common_board_mux[] __initdata = {
/* nCS and IRQ for CM-T35 ethernet */
OMAP3_MUX(GPMC_NCS5, OMAP_MUX_MODE0),
OMAP3_MUX(UART3_CTS_RCTX, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP),
@@ -580,17 +580,12 @@ static struct omap_board_mux board_mux[] __initdata = {
OMAP3_MUX(UART1_TX, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
OMAP3_MUX(UART1_RX, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
 
-   /* DSS */
+   /* common DSS */
OMAP3_MUX(DSS_PCLK, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
OMAP3_MUX(DSS_HSYNC, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
OMAP3_MUX(DSS_VSYNC, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
OMAP3_MUX(DSS_ACBIAS, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
-   OMAP3_MUX(DSS_DATA0, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
-   OMAP3_MUX(DSS_DATA1, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
-   OMAP3_MUX(DSS_DATA2, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
-   OMAP3_MUX(DSS_DATA3, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
-   OMAP3_MUX(DSS_DATA4, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
-   OMAP3_MUX(DSS_DATA5, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
+
OMAP3_MUX(DSS_DATA6, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
OMAP3_MUX(DSS_DATA7, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
OMAP3_MUX(DSS_DATA8, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
@@ -603,12 +598,6 @@ static struct omap_board_mux board_mux[] __initdata = {
OMAP3_MUX(DSS_DATA15, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
OMAP3_MUX(DSS_DATA16, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
OMAP3_MUX(DSS_DATA17, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
-   OMAP3_MUX(DSS_DATA18, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
-   OMAP3_MUX(DSS_DATA19, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
-   OMAP3_MUX(DSS_DATA20, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
-   OMAP3_MUX(DSS_DATA21, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
-   OMAP3_MUX(DSS_DATA22, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
-   OMAP3_MUX(DSS_DATA23, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
 
/* display controls */
OMAP3_MUX(MCBSP1_FSR, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),
@@ -621,6 +610,39 @@ static struct omap_board_mux board_mux[] __initdata = {
 
{ .reg_offset = OMAP_MUX_TERMINATOR },
 };
+
+static void cm_t35_mux_init(void)
+{
+   int mux_mode = OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT;
+
+   omap3_mux_init(cm_t35_common_board_mux, OMAP_PACKAGE_CUS);
+
+   if (cpu_is_omap34xx()) {
+   omap_mux_init_signal(gpio_70, mux_mode);
+   omap_mux_init_signal(gpio_71, mux_mode);
+   omap_mux_init_signal(gpio_72, mux_mode);
+   omap_mux_init_signal(gpio_73, mux_mode);
+   omap_mux_init_signal(gpio_74, mux_mode);
+   omap_mux_init_signal(gpio_75, mux_mode);
+   } else if (cpu_is_omap3630()) {
+   mux_mode = OMAP_MUX_MODE3 | OMAP_PIN_OUTPUT;
+   omap_mux_init_signal(sys_boot0, mux_mode);
+   omap_mux_init_signal(sys_boot1, mux_mode);
+   omap_mux_init_signal(sys_boot3, mux_mode);
+   omap_mux_init_signal(sys_boot4, mux_mode);
+   omap_mux_init_signal(sys_boot5, mux_mode);
+   omap_mux_init_signal(sys_boot6, mux_mode);
+   }
+
+   omap_mux_init_signal(dss_data18, mux_mode);
+   omap_mux_init_signal(dss_data19, mux_mode);
+   omap_mux_init_signal(dss_data20, mux_mode);
+   omap_mux_init_signal(dss_data21, mux_mode);
+   omap_mux_init_signal(dss_data22, mux_mode);
+   omap_mux_init_signal(dss_data23, mux_mode);
+}
+#else
+static inline void cm_t35_mux_init(void) {}
 #endif
 
 static struct omap_board_config_kernel cm_t35_config[] __initdata = {
@@ -630,7 +652,7 @@ static void __init 

[PATCH] OMAP: don't trace functions called from sched_clock

2011-05-08 Thread Rabin Vincent
omap_readl() is used from the sched_clock() implementations and so must
be marked notrace to avoid recursion in ftrace.  Same thing with
mpu_read() for OMAP1.

Signed-off-by: Rabin Vincent ra...@rab.in
---
 arch/arm/mach-omap1/io.c   |2 +-
 arch/arm/mach-omap1/time.c |2 +-
 arch/arm/mach-omap2/io.c   |2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-omap1/io.c b/arch/arm/mach-omap1/io.c
index 870886a..36ec2d7 100644
--- a/arch/arm/mach-omap1/io.c
+++ b/arch/arm/mach-omap1/io.c
@@ -158,7 +158,7 @@ u16 omap_readw(u32 pa)
 }
 EXPORT_SYMBOL(omap_readw);
 
-u32 omap_readl(u32 pa)
+u32 notrace omap_readl(u32 pa)
 {
return __raw_readl(OMAP1_IO_ADDRESS(pa));
 }
diff --git a/arch/arm/mach-omap1/time.c b/arch/arm/mach-omap1/time.c
index 6885d2f..88c5c5e 100644
--- a/arch/arm/mach-omap1/time.c
+++ b/arch/arm/mach-omap1/time.c
@@ -203,7 +203,7 @@ static struct irqaction omap_mpu_timer2_irq = {
.handler= omap_mpu_timer2_interrupt,
 };
 
-static cycle_t mpu_read(struct clocksource *cs)
+static cycle_t notrace mpu_read(struct clocksource *cs)
 {
return ~omap_mpu_timer_read(1);
 }
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 441e79d..f1987b1 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -441,7 +441,7 @@ u16 omap_readw(u32 pa)
 }
 EXPORT_SYMBOL(omap_readw);
 
-u32 omap_readl(u32 pa)
+u32 notrace omap_readl(u32 pa)
 {
return __raw_readl(OMAP2_L4_IO_ADDRESS(pa));
 }
-- 
1.7.4.1

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


Re: [PATCH 4/4] USB: TWL6025 allow different regulator name

2011-05-08 Thread Liam Girdwood
On Wed, 2011-04-27 at 13:45 +0300, Felipe Balbi wrote:
 Hi,
 
 On Wed, Apr 27, 2011 at 10:39:51AM +0100, Graeme Gregory wrote:
  The twl6025 uses a different regulator for USB than the 6030 so select
  the correct regulator name depending on the subclass of device.
  
  Signed-off-by: Graeme Gregory g...@slimlogic.co.uk
 
 I don't see the point of this patch. It's just a string. Use the same
 name and add a comment saying that on datasheet/TRM/documentation the
 name LDO is actually referred to as LDOUSB. It's the same functionality
 anyway.
 

I think for the avoidance of any doubt, it's probably best to use the
TWL6025 string name here as it will importantly match the TWL6025 TRM
and any schematics using the TWL6025. Getting this wrong during TWL6025
board integration has the potential for hardware damage.

Liam

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


OMAP1: unnecessary timer interrupt handler code?

2011-05-08 Thread Russell King - ARM Linux
MPU timer 2 is used on OMAP1 for the clock source and scheduler clock.
It registers an interrupt, which counts the number of overflows of
this timer.  However, this counter is only referenced by the interrupt
handler.

So, it seems that the following code serves very little purpose.  Can
it be simply deleted?

static unsigned long omap_mpu_timer2_overflows;

static irqreturn_t omap_mpu_timer2_interrupt(int irq, void *dev_id)
{
omap_mpu_timer2_overflows++;
return IRQ_HANDLED;
}

static struct irqaction omap_mpu_timer2_irq = {
.name   = mpu_timer2,
.flags  = IRQF_DISABLED,
.handler= omap_mpu_timer2_interrupt,
};

...
static void __init omap_init_clocksource(unsigned long rate)
{
...
setup_irq(INT_TIMER2, omap_mpu_timer2_irq);
...
}
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/4] MFD: TWL6025: add phoenix lite support to twl6030

2011-05-08 Thread Liam Girdwood
On Wed, 2011-04-27 at 13:40 +0300, Felipe Balbi wrote: 
 On Wed, Apr 27, 2011 at 10:39:48AM +0100, Graeme Gregory wrote:


  +   /* TWL6025 LDO regulators */
  +   struct regulator_init_data  *ldo1;
  +   struct regulator_init_data  *ldo2;
  +   struct regulator_init_data  *ldo3;
  +   struct regulator_init_data  *ldo4;
  +   struct regulator_init_data  *ldo5;
  +   struct regulator_init_data  *ldo6;
  +   struct regulator_init_data  *ldo7;
  +   struct regulator_init_data  *ldoln;
  +   struct regulator_init_data  *ldousb;
  +   /* TWL6025 DCDC regulators */
  +   struct regulator_init_data  *smps3;
  +   struct regulator_init_data  *smps4;
  +   struct regulator_init_data  *vio6025;
 
 this is just becoming really really ugly. You need a more clever way of
 handling this. Maybe passing an array of regulators and the array size
 instead of continuously adding fields to this structure.
 

Ok, I agree that optimising the platform data here is desirable, but I
think we will have to stick with this atm as the twl driver has some
rather annoying limitations that make optimising things like this a pita
atm.

I guess we should look at fixing the twl driver within TI in order to
make it more adaptable (i.e. support future twl ICs) and also a non
singleton device.

Liam

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


[PATCH 1/2] Initial BN Nook Color (encore) support.

2011-05-08 Thread green
From: Oleg Drokin gr...@linuxhacker.ru

Bare-bones board file, comes with serial console, gpio keys,
MMC/SDCard and USB support.

Signed-off-by: Oleg Drokin gr...@linuxhacker.ru
---
 arch/arm/mach-omap2/Kconfig  |5 +
 arch/arm/mach-omap2/Makefile |2 +
 arch/arm/mach-omap2/board-omap3encore.c  |  363 ++
 arch/arm/plat-omap/include/plat/uncompress.h |1 +
 arch/arm/tools/mach-types|2 +-
 5 files changed, 372 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-omap3encore.c

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index b997a35..5370561 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -173,6 +173,11 @@ config MACH_OMAP3_TORPEDO
 for full description please see the products webpage at
 
http://www.logicpd.com/products/development-kits/zoom-omap35x-torpedo-development-kit
 
+config MACH_ENCORE
+bool Barnes  Noble Encore (Nook Color)
+depends on ARCH_OMAP3
+select OMAP_PACKAGE_CBP
+
 config MACH_OVERO
bool Gumstix Overo board
depends on ARCH_OMAP3
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index a0c2cae..619e5ca 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -189,6 +189,8 @@ obj-$(CONFIG_MACH_OMAP3530_LV_SOM)  += 
board-omap3logic.o \
   hsmmc.o
 obj-$(CONFIG_MACH_OMAP3_TORPEDO)+= board-omap3logic.o \
   hsmmc.o
+obj-$(CONFIG_MACH_ENCORE)  += board-omap3encore.o \
+  hsmmc.o
 obj-$(CONFIG_MACH_OVERO)   += board-overo.o \
   hsmmc.o
 obj-$(CONFIG_MACH_OMAP3EVM)+= board-omap3evm.o \
diff --git a/arch/arm/mach-omap2/board-omap3encore.c 
b/arch/arm/mach-omap2/board-omap3encore.c
new file mode 100644
index 000..6c044c0
--- /dev/null
+++ b/arch/arm/mach-omap2/board-omap3encore.c
@@ -0,0 +1,363 @@
+/*
+ * Support for BarnsNoble Nook Color
+ *
+ * Loosely based on mach-omap2/board-zoom.c
+ * Copyright (C) 2008-2010 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.
+ *
+ * May 2011 Oleg Drokin gr...@linuxhacker.ru - Port to 2.6.39
+ *
+ */
+
+#include linux/kernel.h
+#include linux/platform_device.h
+#include linux/gpio_keys.h
+#include linux/err.h
+
+#include linux/spi/spi.h
+#include linux/i2c/twl.h
+#include linux/regulator/machine.h
+#include linux/regulator/fixed.h
+#include mach/hardware.h
+#include asm/mach-types.h
+#include asm/mach/arch.h
+
+#include linux/gpio.h
+#include plat/board.h
+#include plat/common.h
+#include plat/usb.h
+#include plat/mux.h
+#include plat/sram.h
+#include plat/mmc.h
+#include plat/omap-serial.h
+#include plat/system.h
+
+#include mux.h
+#include hsmmc.h
+#include sdram-hynix-h8mbx00u0mer-0em.h
+
+/* Encore-specific device-info and i2c addresses. */
+/* Battery, bus 1 */
+#define MAX17042_I2C_SLAVE_ADDRESS 0x36
+#define MAX17042_GPIO_FOR_IRQ  100
+
+/*addition of MAXIM8903/TI GPIO mapping WRT schematics */
+#define MAX8903_UOK_GPIO_FOR_IRQ   115
+#define MAX8903_DOK_GPIO_FOR_IRQ   114
+#define MAX8903_GPIO_CHG_EN110
+#define MAX8903_GPIO_CHG_STATUS111
+#define MAX8903_GPIO_CHG_FLT   101
+#define MAX8903_GPIO_CHG_IUSB  102
+#define MAX8903_GPIO_CHG_USUS  104
+#define MAX8903_GPIO_CHG_ILM   61
+
+/* TI WLAN */
+#define ENCORE_WIFI_PMENA_GPIO 22
+#define ENCORE_WIFI_IRQ_GPIO   15
+#define ENCORE_WIFI_EN_POW 16
+
+/* Accelerometer i2c bus 1*/
+#define KXTF9_I2C_SLAVE_ADDRESS0x0F
+#define KXTF9_GPIO_FOR_PWR 34
+#define KXTF9_GPIO_FOR_IRQ 113
+
+/* Touch screen i2c bus 2*/
+#define CYTTSP_I2C_SLAVEADDRESS34
+#define ENCORE_CYTTSP_GPIO 99
+#define ENCORE_CYTTSP_RESET_GPIO   46
+
+/* Audio codec, i2c bus 2 */
+#define AUDIO_CODEC_POWER_ENABLE_GPIO  103
+#define AUDIO_CODEC_RESET_GPIO 37
+#define AUDIO_CODEC_IRQ_GPIO   59
+#define AIC3100_I2CSLAVEADDRESS0x18
+
+
+/* Different HW revisions */
+#define BOARD_ENCORE_REV_EVT1A 0x1
+#define BOARD_ENCORE_REV_EVT1B 0x2
+#define BOARD_ENCORE_REV_EVT2  0x3
+#define BOARD_ENCORE_REV_DVT   0x4
+#define BOARD_ENCORE_REV_PVT   0x5
+#define BOARD_ENCORE_REV_UNKNOWN   0x6
+
+static inline int is_encore_board_evt2(void)
+{
+   return (system_rev = BOARD_ENCORE_REV_EVT2);
+}
+
+static inline int is_encore_board_evt1b(void)
+{
+   return (system_rev == BOARD_ENCORE_REV_EVT1B);
+}
+
+static int encore_twl4030_keymap[] = {
+   KEY(1, 0, 

[PATCH 2/2] Add tps65921 chip

2011-05-08 Thread green
From: Oleg Drokin gr...@linuxhacker.ru

Very similar to TPS65920
List of differences: http://www.ti.com/litv/pdf/swcu066b

Signed-off-by: Oleg Drokin gr...@linuxhacker.ru
---
 drivers/mfd/twl-core.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c
index 960b5be..3daebcc 100644
--- a/drivers/mfd/twl-core.c
+++ b/drivers/mfd/twl-core.c
@@ -1107,6 +1107,8 @@ static const struct i2c_device_id twl_ids[] = {
{ tps65950, 0 },  /* catalog version of twl5030 */
{ tps65930, TPS_SUBSET }, /* fewer LDOs and DACs; no charger */
{ tps65920, TPS_SUBSET }, /* fewer LDOs; no codec or charger */
+   { tps65921, TPS_SUBSET }, /* fewer LDOs; no codec, no LED
+  and vibrator. Charger in USB module*/
{ twl6030, TWL6030_CLASS },   /* Phoenix power chip */
{ /* end of list */ },
 };
-- 
1.7.4.4

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


Initial BN Nook Color support, take three

2011-05-08 Thread green
This is yet another attempt. All previous feedback incorporated.
Rebased against devel-cleanup.

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