[PATCH] OMAP: RX51: Add log partition

2009-05-06 Thread Adrian Hunter

From 22d5b418dd2535f326d7f3ee5661db8159b9845d Mon Sep 17 00:00:00 2001

From: Adrian Hunter 
Date: Thu, 7 May 2009 09:45:32 +0300
Subject: [PATCH] OMAP: RX51: Add log partition

Signed-off-by: Adrian Hunter 
---
arch/arm/configs/rx51_defconfig  |2 +-
arch/arm/mach-omap2/board-rx51-peripherals.c |5 +
2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/arch/arm/configs/rx51_defconfig b/arch/arm/configs/rx51_defconfig
index 2672a70..7ee4b6a 100644
--- a/arch/arm/configs/rx51_defconfig
+++ b/arch/arm/configs/rx51_defconfig
@@ -288,7 +288,7 @@ CONFIG_ALIGNMENT_TRAP=y
#
CONFIG_ZBOOT_ROM_TEXT=0x0
CONFIG_ZBOOT_ROM_BSS=0x0
-CONFIG_CMDLINE="init=/sbin/preinit ubi.mtd=4 root=ubi0:rootfs rootfstype=ubifs rw 
console=ttyMTD5"
+CONFIG_CMDLINE="init=/sbin/preinit ubi.mtd=rootfs root=ubi0:rootfs rootfstype=ubifs 
rootflags=bulk_read,no_chk_data_crc rw console=ttyMTD,log console=tty0"
# CONFIG_XIP_KERNEL is not set
# CONFIG_KEXEC is not set

diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c 
b/arch/arm/mach-omap2/board-rx51-peripherals.c
index 55e8568..4d10f5c 100644
--- a/arch/arm/mach-omap2/board-rx51-peripherals.c
+++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
@@ -494,6 +494,11 @@ static struct mtd_partition onenand_partitions[] = {
.size   = 0x6,
},
{
+   .name   = "log",
+   .offset = MTDPART_OFS_APPEND,
+   .size   = 0x4,
+   },
+   {
.name   = "kernel",
.offset = MTDPART_OFS_APPEND,
.size   = 0x20,
--
1.5.6.3

--
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


[RESUBMIT][PATCH 6/7] OMAP4: Clock stubs since clock management framework not in.

2009-05-06 Thread Santosh Shilimkar
This patch update the cooomon clock.c file for OMAP4. The clk_get() and
clk_put() sunctions are moved to  common place in arch/arm/common/clkdev.c
Since on current OMAP4 platform clk management is still not supported, the
platform file is stubbed with those functions.

Once the framework is ready, this WILL be replaced with a full
clkdev implementation.

Signed-off-by: Santosh Shilimkar 
---
 arch/arm/plat-omap/clock.c |   30 ++
 1 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-omap/clock.c b/arch/arm/plat-omap/clock.c
index 2e06145..f7c3b0a 100644
--- a/arch/arm/plat-omap/clock.c
+++ b/arch/arm/plat-omap/clock.c
@@ -36,10 +36,34 @@ static struct clk_functions *arch_clock;
  * Standard clock functions defined in include/linux/clk.h
  *-*/
 
+/* This functions is moved to arch/arm/common/clkdev.c. For OMAP4 since
+ * clock framework is not up , it is defined here to avoid rework in
+ * every driver */
+
+/* Dummy hooks only for OMAP4.For rest OMAPs, common clkdev is used */
+#if defined(CONFIG_ARCH_OMAP4)
+struct clk *clk_get(struct device *dev, const char *id)
+{
+   return NULL;
+}
+EXPORT_SYMBOL(clk_get);
+
+void clk_put(struct clk *clk)
+{
+}
+EXPORT_SYMBOL(clk_put);
+void omap2_clk_prepare_for_reboot(void)
+{
+}
+EXPORT_SYMBOL(omap2_clk_prepare_for_reboot);
+#endif
 int clk_enable(struct clk *clk)
 {
unsigned long flags;
int ret = 0;
+   if (cpu_is_omap44xx())
+   /* OMAP4 clk framework not supported yet */
+   return 0;
 
if (clk == NULL || IS_ERR(clk))
return -EINVAL;
@@ -56,6 +80,9 @@ EXPORT_SYMBOL(clk_enable);
 void clk_disable(struct clk *clk)
 {
unsigned long flags;
+   if (cpu_is_omap44xx())
+   /* OMAP4 clk framework not supported yet */
+   return ;
 
if (clk == NULL || IS_ERR(clk))
return;
@@ -80,6 +107,9 @@ unsigned long clk_get_rate(struct clk *clk)
 {
unsigned long flags;
unsigned long ret = 0;
+   if (cpu_is_omap44xx())
+   /* OMAP4 clk framework not supported yet */
+   return 0;
 
if (clk == NULL || IS_ERR(clk))
return 0;
-- 
1.5.4.7

--
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


[RESUBMIT][PATCH 7/7] Enable build for OMAP4.

2009-05-06 Thread Santosh Shilimkar
This patch updates the Makefile and defconfig for OMAP4. Minimal set of
drivers are enabled fot the kernel bootup.

Signed-off-by: Santosh Shilimkar 
---
 arch/arm/Makefile   |1 +
 arch/arm/configs/omap_4430sdp_defconfig |  807 +++
 arch/arm/mach-omap2/Makefile|   13 +-
 3 files changed, 817 insertions(+), 4 deletions(-)
 create mode 100644 arch/arm/configs/omap_4430sdp_defconfig

diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index e84729b..676d10d 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -127,6 +127,7 @@ endif
  machine-$(CONFIG_ARCH_OMAP1) := omap1
  machine-$(CONFIG_ARCH_OMAP2) := omap2
  machine-$(CONFIG_ARCH_OMAP3) := omap2
+ machine-$(CONFIG_ARCH_OMAP4) := omap2
 plat-$(CONFIG_ARCH_OMAP)  := omap
  machine-$(CONFIG_ARCH_S3C2410)   := s3c2410 s3c2400 s3c2412 s3c2440 
s3c2442 s3c2443
  machine-$(CONFIG_ARCH_S3C24A0)   := s3c24a0
diff --git a/arch/arm/configs/omap_4430sdp_defconfig 
b/arch/arm/configs/omap_4430sdp_defconfig
new file mode 100644
index 000..43532bc
--- /dev/null
+++ b/arch/arm/configs/omap_4430sdp_defconfig
@@ -0,0 +1,807 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.29
+# Fri April 19 19:58:24 20089
+#
+CONFIG_ARM=y
+CONFIG_SYS_SUPPORTS_APM_EMULATION=y
+CONFIG_GENERIC_GPIO=y
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_MMU=y
+# CONFIG_NO_IOPORT is not set
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_HAVE_LATENCYTOP_SUPPORT=y
+CONFIG_LOCKDEP_SUPPORT=y
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+CONFIG_HARDIRQS_SW_RESEND=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_ARCH_HAS_ILOG2_U32 is not set
+# CONFIG_ARCH_HAS_ILOG2_U64 is not set
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
+CONFIG_VECTORS_BASE=0x
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+CONFIG_BSD_PROCESS_ACCT=y
+# CONFIG_BSD_PROCESS_ACCT_V3 is not set
+
+#
+# RCU Subsystem
+#
+CONFIG_CLASSIC_RCU=y
+# CONFIG_TREE_RCU is not set
+# CONFIG_PREEMPT_RCU is not set
+# CONFIG_TREE_RCU_TRACE is not set
+# CONFIG_PREEMPT_RCU_TRACE is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_GROUP_SCHED=y
+CONFIG_FAIR_GROUP_SCHED=y
+# CONFIG_RT_GROUP_SCHED is not set
+CONFIG_USER_SCHED=y
+# CONFIG_CGROUP_SCHED is not set
+# CONFIG_CGROUPS is not set
+CONFIG_SYSFS_DEPRECATED=y
+CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_RELAY is not set
+# CONFIG_NAMESPACES is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_SYSCTL=y
+CONFIG_ANON_INODES=y
+CONFIG_EMBEDDED=y
+CONFIG_UID16=y
+# CONFIG_SYSCTL_SYSCALL is not set
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+# CONFIG_ELF_CORE is not set
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_AIO=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_COMPAT_BRK=y
+# CONFIG_SLAB is not set
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+# CONFIG_PROFILING is not set
+CONFIG_HAVE_OPROFILE=y
+# CONFIG_KPROBES is not set
+CONFIG_HAVE_KPROBES=y
+CONFIG_HAVE_KRETPROBES=y
+CONFIG_HAVE_CLK=y
+CONFIG_HAVE_GENERIC_DMA_COHERENT=y
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+# CONFIG_MODULE_FORCE_LOAD is not set
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+CONFIG_MODVERSIONS=y
+CONFIG_MODULE_SRCVERSION_ALL=y
+CONFIG_BLOCK=y
+# CONFIG_LBD is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_BLK_DEV_INTEGRITY is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+CONFIG_DEFAULT_AS=y
+# CONFIG_DEFAULT_DEADLINE is not set
+# CONFIG_DEFAULT_CFQ is not set
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="anticipatory"
+# CONFIG_FREEZER is not set
+
+#
+# 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_CLPS711X 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_IOP13XX is not set
+# CONFIG_ARCH_IOP32X is not set
+# CONFIG_ARCH_IOP33X is not set
+# CONFIG_ARCH_IXP23XX is not set
+# CONFIG_ARCH_IXP2000 is not set
+# CONFIG_ARCH_IXP4XX is not set
+# CONFIG_ARCH_L7200 is not set
+# CONFIG_ARCH_KIRKWOO

[RESUBMIT][PATCH 3/7] OMAP4: Update common omap platform headers.

2009-05-06 Thread Santosh Shilimkar
This patch updates the common platform headers files for OMAP4430.
On OMAP4, GIC is used instead of INTC, hence all the private peripheral
interrupts are shifted by an offset of 32. So if the hardcoding is not
done for IRQ lines in drivers, then this change won't impact any driver.

Signed-off-by: Santosh Shilimkar 
---
 arch/arm/plat-omap/include/mach/clock.h   |8 ++-
 arch/arm/plat-omap/include/mach/common.h  |1 +
 arch/arm/plat-omap/include/mach/control.h |7 +-
 arch/arm/plat-omap/include/mach/debug-macro.S |2 +-
 arch/arm/plat-omap/include/mach/dma.h |1 +
 arch/arm/plat-omap/include/mach/entry-macro.S |   46 -
 arch/arm/plat-omap/include/mach/io.h  |   37 ++
 arch/arm/plat-omap/include/mach/irqs.h|   89 +
 arch/arm/plat-omap/include/mach/memory.h  |3 +-
 arch/arm/plat-omap/include/mach/serial.h  |   16 -
 10 files changed, 198 insertions(+), 12 deletions(-)

diff --git a/arch/arm/plat-omap/include/mach/clock.h 
b/arch/arm/plat-omap/include/mach/clock.h
index 073a2c5..058a808 100644
--- a/arch/arm/plat-omap/include/mach/clock.h
+++ b/arch/arm/plat-omap/include/mach/clock.h
@@ -22,7 +22,8 @@ struct clkops {
void(*disable)(struct clk *);
 };
 
-#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
+#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) || \
+   defined(CONFIG_ARCH_OMAP4)
 
 struct clksel_rate {
u32 val;
@@ -51,7 +52,7 @@ struct dpll_data {
u8  max_divider;
u32 max_tolerance;
u16 max_multiplier;
-#  if defined(CONFIG_ARCH_OMAP3)
+#  if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
u8  modes;
void __iomem*autoidle_reg;
void __iomem*idlest_reg;
@@ -83,7 +84,8 @@ struct clk {
void(*init)(struct clk *);
__u8enable_bit;
__s8usecount;
-#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
+#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) || \
+   defined(CONFIG_ARCH_OMAP4)
u8  fixed_div;
void __iomem*clksel_reg;
u32 clksel_mask;
diff --git a/arch/arm/plat-omap/include/mach/common.h 
b/arch/arm/plat-omap/include/mach/common.h
index 0ecf36d..4b18833 100644
--- a/arch/arm/plat-omap/include/mach/common.h
+++ b/arch/arm/plat-omap/include/mach/common.h
@@ -62,6 +62,7 @@ struct omap_globals {
 void omap2_set_globals_242x(void);
 void omap2_set_globals_243x(void);
 void omap2_set_globals_343x(void);
+void omap2_set_globals_443x(void);
 
 /* These get called from omap2_set_globals_(), do not call these */
 void omap2_set_globals_tap(struct omap_globals *);
diff --git a/arch/arm/plat-omap/include/mach/control.h 
b/arch/arm/plat-omap/include/mach/control.h
index 269147f..f45ec62 100644
--- a/arch/arm/plat-omap/include/mach/control.h
+++ b/arch/arm/plat-omap/include/mach/control.h
@@ -1,9 +1,9 @@
 /*
  * arch/arm/plat-omap/include/mach/control.h
  *
- * OMAP2/3 System Control Module definitions
+ * OMAP2/3/4 System Control Module definitions
  *
- * Copyright (C) 2007-2008 Texas Instruments, Inc.
+ * Copyright (C) 2007-2009 Texas Instruments, Inc.
  * Copyright (C) 2007-2008 Nokia Corporation
  *
  * Written by Paul Walmsley
@@ -190,7 +190,8 @@
 #define OMAP2_PBIASLITEVMODE0  (1 << 0)
 
 #ifndef __ASSEMBLY__
-#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
+#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) || \
+   defined(CONFIG_ARCH_OMAP4)
 extern void __iomem *omap_ctrl_base_get(void);
 extern u8 omap_ctrl_readb(u16 offset);
 extern u16 omap_ctrl_readw(u16 offset);
diff --git a/arch/arm/plat-omap/include/mach/debug-macro.S 
b/arch/arm/plat-omap/include/mach/debug-macro.S
index 1b11f5c..ac24050 100644
--- a/arch/arm/plat-omap/include/mach/debug-macro.S
+++ b/arch/arm/plat-omap/include/mach/debug-macro.S
@@ -36,7 +36,7 @@
add \rx, \rx, #0x4000   @ UART 3
 #endif
 
-#elif  CONFIG_ARCH_OMAP3
+#elif defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
moveq   \rx, #0x4800@ physical base address
movne   \rx, #0xd800@ virtual base
orr \rx, \rx, #0x0006a000
diff --git a/arch/arm/plat-omap/include/mach/dma.h 
b/arch/arm/plat-omap/include/mach/dma.h
index 54fe966..8e05b6a 100644
--- a/arch/arm/plat-omap/include/mach/dma.h
+++ b/arch/arm/plat-omap/include/mach/dma.h
@@ -48,6 +48,7 @@
 /* Hardware registers for omap2 and omap3 */
 #define OMAP24XX_DMA4_BASE (L4_24XX_BASE + 0x56000)
 #define OMAP34XX_DMA4_BASE (L4_34XX_BASE + 0x56000)
+#define OMAP44XX_DMA4_BASE (L4_44XX_BASE + 0x56000)
 
 #d

[RESUBMIT][PATCH 5/7] OMAP4: Update common omap machine specific sources.

2009-05-06 Thread Santosh Shilimkar
This patch updates the common machine spcific source files for OMAP4430.
Few OMAP4 peripherals are common with OMAP3 architecture. Lot of code
gets re-used because of this.

Signed-off-by: Santosh Shilimkar 
---
 arch/arm/mach-omap2/clockdomain.c |2 +
 arch/arm/mach-omap2/gpmc.c|6 
 arch/arm/mach-omap2/id.c  |8 +-
 arch/arm/mach-omap2/io.c  |   51 -
 arch/arm/mach-omap2/powerdomain.c |2 +
 arch/arm/mach-omap2/sdrc.c|2 +
 arch/arm/mach-omap2/serial.c  |7 +
 arch/arm/mach-omap2/timer-gp.c|9 +-
 8 files changed, 83 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-omap2/clockdomain.c 
b/arch/arm/mach-omap2/clockdomain.c
index 0e7d501..1497d18 100644
--- a/arch/arm/mach-omap2/clockdomain.c
+++ b/arch/arm/mach-omap2/clockdomain.c
@@ -177,6 +177,8 @@ void clkdm_init(struct clockdomain **clkdms,
struct clockdomain **c = NULL;
struct clkdm_pwrdm_autodep *autodep = NULL;
 
+   if (cpu_is_omap44xx())
+   return ; /* FIXME: Not yet support */
if (clkdms)
for (c = clkdms; *c; c++)
clkdm_register(*c);
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index 2249049..f91934b 100644
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -5,6 +5,9 @@
  *
  * Author: Juha Yrjola
  *
+ * Copyright (C) 2009 Texas Instruments
+ * Added OMAP4 support - Santosh Shilimkar 
+ *
  * 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.
@@ -424,6 +427,9 @@ void __init gpmc_init(void)
} else if (cpu_is_omap34xx()) {
ck = "gpmc_fck";
l = OMAP34XX_GPMC_BASE;
+   } else if (cpu_is_omap44xx()) {
+   ck = "gpmc_fck";
+   l = OMAP44XX_GPMC_BASE;
}
 
gpmc_l3_clk = clk_get(NULL, ck);
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index 34b5914..40e0e4b 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -6,6 +6,9 @@
  * Copyright (C) 2005 Nokia Corporation
  * Written by Tony Lindgren 
  *
+ * Copyright (C) 2009 Texas Instruments
+ * Added OMAP4 support - Santosh Shilimkar 
+ *
  * 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.
@@ -196,7 +199,10 @@ void __init omap2_check_revision(void)
 * At this point we have an idea about the processor revision set
 * earlier with omap2_set_globals_tap().
 */
-   if (cpu_is_omap24xx())
+   if (cpu_is_omap44xx()) {
+   printk(KERN_INFO "FIXME: CPU revision = OMAP4430\n");
+   return;
+   } else if (cpu_is_omap24xx())
omap24xx_check_revision();
else if (cpu_is_omap34xx())
omap34xx_check_revision();
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 916fcd3..6db7791 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -4,12 +4,14 @@
  * OMAP2 I/O mapping code
  *
  * Copyright (C) 2005 Nokia Corporation
- * Copyright (C) 2007 Texas Instruments
+ * Copyright (C) 2007-2009 Texas Instruments
  *
  * Author:
  * Juha Yrjola 
  * Syed Khasim 
  *
+ * Added OMAP4 support - Santosh Shilimkar 
+ *
  * 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.
@@ -30,7 +32,9 @@
 #include 
 #include 
 
+#ifndef CONFIG_ARCH_OMAP4  /* FIXME: Remove this once clkdev is ready */
 #include "clock.h"
+#endif
 
 #include 
 
@@ -166,6 +170,46 @@ static struct map_desc omap34xx_io_desc[] __initdata = {
},
 };
 #endif
+#ifdef CONFIG_ARCH_OMAP4
+static struct map_desc omap44xx_io_desc[] __initdata = {
+   {
+   .virtual= L3_44XX_VIRT,
+   .pfn= __phys_to_pfn(L3_44XX_PHYS),
+   .length = L3_44XX_SIZE,
+   .type   = MT_DEVICE,
+   },
+   {
+   .virtual= L4_44XX_VIRT,
+   .pfn= __phys_to_pfn(L4_44XX_PHYS),
+   .length = L4_44XX_SIZE,
+   .type   = MT_DEVICE,
+   },
+   {
+   .virtual= L4_WK_44XX_VIRT,
+   .pfn= __phys_to_pfn(L4_WK_44XX_PHYS),
+   .length = L4_WK_44XX_SIZE,
+   .type   = MT_DEVICE,
+   },
+   {
+   .virtual= OMAP44XX_GPMC_VIRT,
+   .pfn= __phys_to_pfn(OMAP44XX_GPMC_PHYS),
+   .length = OMAP44XX_GPMC_SIZE,
+   .type   = MT_DEVICE,
+   },
+   {
+ 

[RESUBMIT][PATCH 4/7] OMAP4: Update common omap platform common sources.

2009-05-06 Thread Santosh Shilimkar
This patch updates the common platform source  files for OMAP4430.
Few OMAP4 peripherals are common with OMAP3 architecture.

Signed-off-by: Santosh Shilimkar 
---
 arch/arm/plat-omap/common.c  |   29 +-
 arch/arm/plat-omap/devices.c |2 +
 arch/arm/plat-omap/dma.c |   21 +--
 arch/arm/plat-omap/dmtimer.c |   59 +-
 arch/arm/plat-omap/gpio.c|  134 +++---
 arch/arm/plat-omap/io.c  |   30 +-
 arch/arm/plat-omap/mux.c |3 +
 arch/arm/plat-omap/sram.c|   23 +++
 8 files changed, 257 insertions(+), 44 deletions(-)

diff --git a/arch/arm/plat-omap/common.c b/arch/arm/plat-omap/common.c
index d179714..06cb281 100644
--- a/arch/arm/plat-omap/common.c
+++ b/arch/arm/plat-omap/common.c
@@ -3,6 +3,9 @@
  *
  * Code common to all OMAP machines.
  *
+ * Copyright (C) 2009 Texas Instruments
+ * Added OMAP4 support - Santosh Shilimkar 
+ *
  * 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.
@@ -177,7 +180,8 @@ console_initcall(omap_add_serial_console);
 
 #if defined(CONFIG_ARCH_OMAP16XX)
 #define TIMER_32K_SYNCHRONIZED 0xfffbc410
-#elif defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX)
+#elif defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) || \
+   defined(CONFIG_ARCH_OMAP4)
 #define TIMER_32K_SYNCHRONIZED (OMAP2_32KSYNCT_BASE + 0x10)
 #endif
 
@@ -309,3 +313,26 @@ void __init omap2_set_globals_343x(void)
 }
 #endif
 
+#if defined(CONFIG_ARCH_OMAP4)
+static struct omap_globals *omap4_globals;
+
+static void __init __omap4_set_globals(void)
+{
+   omap2_set_globals_tap(omap4_globals);
+   omap2_set_globals_control(omap4_globals);
+}
+static struct omap_globals omap443x_globals = {
+   .class  = OMAP443X_CLASS,
+   .tap= OMAP2_IO_ADDRESS(0x4830A000),
+   .ctrl   = OMAP2_IO_ADDRESS(OMAP443X_CTRL_BASE),
+   .prm= OMAP2_IO_ADDRESS(OMAP4430_PRM_BASE),
+   .cm = OMAP2_IO_ADDRESS(OMAP4430_CM_BASE),
+};
+
+void __init omap2_set_globals_443x(void)
+{
+   omap4_globals = &omap443x_globals;
+   __omap4_set_globals();
+}
+#endif
+
diff --git a/arch/arm/plat-omap/devices.c b/arch/arm/plat-omap/devices.c
index 87fb7ff..a016c6c 100644
--- a/arch/arm/plat-omap/devices.c
+++ b/arch/arm/plat-omap/devices.c
@@ -311,6 +311,8 @@ static void omap_init_wdt(void)
wdt_resources[0].start = 0x49016000; /* WDT2 */
else if (cpu_is_omap343x())
wdt_resources[0].start = 0x48314000; /* WDT2 */
+   else if (cpu_is_omap44xx())
+   wdt_resources[0].start = 0x4A314000;
else
return;
 
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
index 21cc014..24f8d35 100644
--- a/arch/arm/plat-omap/dma.c
+++ b/arch/arm/plat-omap/dma.c
@@ -10,6 +10,9 @@
  * Merged to support both OMAP1 and OMAP2 by Tony Lindgren 
  * Some functions based on earlier dma-omap.c Copyright (C) 2001 RidgeRun, Inc.
  *
+ * Copyright (C) 2009 Texas Instruments
+ * Added OMAP4 support - Santosh Shilimkar 
+ *
  * Support functions for the OMAP internal DMA channels.
  *
  * This program is free software; you can redistribute it and/or modify
@@ -852,7 +855,7 @@ omap_dma_set_prio_lch(int lch, unsigned char read_prio,
}
l = dma_read(CCR(lch));
l &= ~((1 << 6) | (1 << 26));
-   if (cpu_is_omap2430() || cpu_is_omap34xx())
+   if (cpu_is_omap2430() || cpu_is_omap34xx() ||  cpu_is_omap44xx())
l |= ((read_prio & 0x1) << 6) | ((write_prio & 0x1) << 26);
else
l |= ((read_prio & 0x1) << 6);
@@ -1824,7 +1827,8 @@ static irqreturn_t omap1_dma_irq_handler(int irq, void 
*dev_id)
 #define omap1_dma_irq_handler  NULL
 #endif
 
-#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
+#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) || \
+   defined(CONFIG_ARCH_OMAP4)
 
 static int omap2_dma_handle_ch(int ch)
 {
@@ -2319,6 +2323,9 @@ static int __init omap_init_dma(void)
} else if (cpu_is_omap34xx()) {
omap_dma_base = IO_ADDRESS(OMAP34XX_DMA4_BASE);
dma_lch_count = OMAP_DMA4_LOGICAL_DMA_CH_COUNT;
+   } else if (cpu_is_omap44xx()) {
+   omap_dma_base = IO_ADDRESS(OMAP44XX_DMA4_BASE);
+   dma_lch_count = OMAP_DMA4_LOGICAL_DMA_CH_COUNT;
} else {
pr_err("DMA init failed for unsupported omap\n");
return -ENODEV;
@@ -2417,12 +2424,16 @@ static int __init omap_init_dma(void)
}
}
 
-   if (cpu_is_omap2430() || cpu_is_omap34xx())
+   if (cpu_is_omap2430() || cpu_is_omap34xx() || cpu_is_omap44xx())
omap_dma_set_global_params(DMA_DEFAULT_ARB_RATE,
DMA_DEFAULT_FIFO_DEPTH, 0);
 
-   if (cpu_class_

[RESUBMIT][PATCH 2/7] OMAP4: Create board support for OMAP_4430SDP.

2009-05-06 Thread Santosh Shilimkar
This patch creates the bare minimal board files  to support
OMAP_4430SDP. Additinaly new omap44xx.h is created which contains
the base addresses for OMAP4430.File omap34xx.h is adapted to avoid
multiple definitions of common omap base address definitions.

Signed-off-by: Santosh Shilimkar 
---
 arch/arm/mach-omap2/board-4430sdp.c|   91 
 arch/arm/plat-omap/include/mach/hardware.h |1 +
 arch/arm/plat-omap/include/mach/omap34xx.h |   10 ++--
 arch/arm/plat-omap/include/mach/omap44xx.h |   61 +++
 4 files changed, 158 insertions(+), 5 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-4430sdp.c
 create mode 100644 arch/arm/plat-omap/include/mach/omap44xx.h

diff --git a/arch/arm/mach-omap2/board-4430sdp.c 
b/arch/arm/mach-omap2/board-4430sdp.c
new file mode 100644
index 000..157e9e4
--- /dev/null
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -0,0 +1,91 @@
+/*
+ * Board support file for OMAP4430 SDP.
+ *
+ * Copyright (C) 2009 Texas Instruments
+ *
+ * Author: Santosh Shilimkar 
+ *
+ * Based on mach-omap2/board-3430sdp.c
+ *
+ * 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 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+static struct platform_device sdp4430_lcd_device = {
+   .name   = "sdp4430_lcd",
+   .id = -1,
+};
+
+static struct platform_device *sdp4430_devices[] __initdata = {
+   &sdp4430_lcd_device,
+};
+
+static struct omap_uart_config sdp4430_uart_config __initdata = {
+   .enabled_uarts  = ((1 << 0) | (1 << 1) | (1 << 2)),
+};
+
+static struct omap_lcd_config sdp4430_lcd_config __initdata = {
+   .ctrl_name  = "internal",
+};
+
+static struct omap_board_config_kernel sdp4430_config[] __initdata = {
+   { OMAP_TAG_UART,&sdp4430_uart_config },
+   { OMAP_TAG_LCD, &sdp4430_lcd_config },
+};
+
+static void __init gic_init_irq(void)
+{
+   gic_dist_init(0, IO_ADDRESS(OMAP44XX_GIC_DIST_BASE), 29);
+   gic_cpu_init(0, IO_ADDRESS(OMAP44XX_GIC_CPU_BASE));
+}
+
+static void __init omap_4430sdp_init_irq(void)
+{
+   omap2_init_common_hw(NULL);
+   gic_init_irq();
+   omap_gpio_init();
+}
+
+
+static void __init omap_4430sdp_init(void)
+{
+   platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices));
+   omap_board_config = sdp4430_config;
+   omap_board_config_size = ARRAY_SIZE(sdp4430_config);
+   omap_serial_init();
+
+}
+
+static void __init omap_4430sdp_map_io(void)
+{
+   omap2_set_globals_443x();
+   omap2_map_common_io();
+}
+
+MACHINE_START(OMAP_4430SDP, "OMAP4430 4430SDP board")
+   /* Maintainer: Santosh Shilimkar - Texas Instruments Inc */
+   .phys_io= 0x4800,
+   .io_pg_offst= ((0xd800) >> 18) & 0xfffc,
+   .boot_params= 0x8100,
+   .map_io = omap_4430sdp_map_io,
+   .init_irq   = omap_4430sdp_init_irq,
+   .init_machine   = omap_4430sdp_init,
+   .timer  = &omap_timer,
+MACHINE_END
diff --git a/arch/arm/plat-omap/include/mach/hardware.h 
b/arch/arm/plat-omap/include/mach/hardware.h
index 3dc423e..26c1fbf 100644
--- a/arch/arm/plat-omap/include/mach/hardware.h
+++ b/arch/arm/plat-omap/include/mach/hardware.h
@@ -285,5 +285,6 @@
 #include "omap16xx.h"
 #include "omap24xx.h"
 #include "omap34xx.h"
+#include "omap44xx.h"
 
 #endif /* __ASM_ARCH_OMAP_HARDWARE_H */
diff --git a/arch/arm/plat-omap/include/mach/omap34xx.h 
b/arch/arm/plat-omap/include/mach/omap34xx.h
index ab64015..4cf9859 100644
--- a/arch/arm/plat-omap/include/mach/omap34xx.h
+++ b/arch/arm/plat-omap/include/mach/omap34xx.h
@@ -3,7 +3,7 @@
  *
  * This file contains the processor specific definitions of the TI OMAP34XX.
  *
- * Copyright (C) 2007 Texas Instruments.
+ * Copyright (C) 2007-2009 Texas Instruments.
  * Copyright (C) 2007 Nokia Corporation.
  *
  * This program is free software; you can redistribute it and/or modify
@@ -31,13 +31,9 @@
 
 #define L4_34XX_BASE   0x4800
 #define L4_WK_34XX_BASE0x4830
-#define L4_WK_OMAP_BASEL4_WK_34XX_BASE
 #define L4_PER_34XX_BASE   0x4900
-#define L4_PER_OMAP_BASE   L4_PER_34XX_BASE
 #define L4_EMU_34XX_BASE   0x5400
-#define L4_EMU_BASEL4_EMU_34XX_BASE
 #define L3_34XX_BASE   0x6800
-#define L3_OMAP_BASE   L3_34XX_BASE
 
 #define OMAP3430_32KSYNCT_BASE 0x4832
 #define OMAP3430_CM_BASE   0x48004800
@@ -85,6 +81,10 @@
 
 #if defined(CONFIG_ARCH_OMAP3430)
 
+#define L4_WK_OMAP_BASEL4_WK_34XX_BASE
+#define L4_PER_OMAP_BASE   L4_PER_34XX_BASE
+#define L4_EMU_BASEL4_EMU_34XX_BASE
+#define L3_OMAP_BASE   L3_34X

[RESUBMIT][PATCH 1/7] OMAP4: Create architecture macros and config entries.

2009-05-06 Thread Santosh Shilimkar
This patch creates the architectural macros for OMAP4. The MULTI_OMAP
build is not yet supported by OMAP4.

Signed-off-by: Santosh Shilimkar 
---
 arch/arm/mach-omap2/Kconfig   |6 +-
 arch/arm/plat-omap/Kconfig|   11 ---
 arch/arm/plat-omap/include/mach/cpu.h |   21 +++--
 3 files changed, 32 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 64ab386..81bbc1e 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -25,7 +25,7 @@ config ARCH_OMAP3430
select ARCH_OMAP_OTG
 
 comment "OMAP Board Type"
-   depends on ARCH_OMAP2 || ARCH_OMAP3
+   depends on ARCH_OMAP2 || ARCH_OMAP3 || ARCH_OMAP4
 
 config MACH_OMAP_GENERIC
bool "Generic OMAP board"
@@ -67,3 +67,7 @@ config MACH_OMAP_3430SDP
 config MACH_NOKIA_RX51
bool "Nokia RX-51 board"
depends on ARCH_OMAP3 && ARCH_OMAP34XX
+
+config MACH_OMAP_4430SDP
+   bool "OMAP 4430 SDP board"
+   depends on ARCH_OMAP4
diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig
index 9dd68fa..89499e6 100644
--- a/arch/arm/plat-omap/Kconfig
+++ b/arch/arm/plat-omap/Kconfig
@@ -23,6 +23,11 @@ config ARCH_OMAP3
select CPU_V7
select COMMON_CLKDEV
 
+config ARCH_OMAP4
+   bool "TI OMAP4"
+   select CPU_V7
+   select ARM_GIC
+
 endchoice
 
 comment "OMAP Feature Selections"
@@ -128,13 +133,13 @@ config OMAP_MPU_TIMER
 
 config OMAP_32K_TIMER
bool "Use 32KHz timer"
-   depends on ARCH_OMAP16XX || ARCH_OMAP24XX || ARCH_OMAP34XX
+   depends on ARCH_OMAP16XX || ARCH_OMAP24XX || ARCH_OMAP34XX || ARCH_OMAP4
help
  Select this option if you want to enable the OMAP 32KHz timer.
  This timer saves power compared to the OMAP_MPU_TIMER, and has
  support for no tick during idle. The 32KHz timer provides less
  intra-tick resolution than OMAP_MPU_TIMER. The 32KHz timer is
- currently only available for OMAP16XX, 24XX and 34XX.
+ currently only available for OMAP16XX, 24XX, 34XX and OMAP4.
 
 endchoice
 
@@ -149,7 +154,7 @@ config OMAP_32K_TIMER_HZ
 
 config OMAP_DM_TIMER
bool "Use dual-mode timer"
-   depends on ARCH_OMAP16XX || ARCH_OMAP24XX || ARCH_OMAP34XX
+   depends on ARCH_OMAP16XX || ARCH_OMAP24XX || ARCH_OMAP34XX || ARCH_OMAP4
help
 Select this option if you want to use OMAP Dual-Mode timers.
 
diff --git a/arch/arm/plat-omap/include/mach/cpu.h 
b/arch/arm/plat-omap/include/mach/cpu.h
index 98b1442..fc60c4e 100644
--- a/arch/arm/plat-omap/include/mach/cpu.h
+++ b/arch/arm/plat-omap/include/mach/cpu.h
@@ -5,8 +5,12 @@
  *
  * Copyright (C) 2004, 2008 Nokia Corporation
  *
+ * Copyright (C) 2009 Texas Instruments.
+ *
  * Written by Tony Lindgren 
  *
+ * Added OMAP4 specific defines - Santosh Shilimkar
+ *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
@@ -155,6 +159,8 @@ IS_OMAP_SUBCLASS(343x, 0x343)
 #define cpu_is_omap243x()  0
 #define cpu_is_omap34xx()  0
 #define cpu_is_omap343x()  0
+#define cpu_is_omap44xx()  0
+#define cpu_is_omap443x()  0
 
 #if defined(MULTI_OMAP1)
 # if defined(CONFIG_ARCH_OMAP730)
@@ -348,12 +354,21 @@ IS_OMAP_TYPE(3430, 0x3430)
 # define cpu_is_omap3430() is_omap3430()
 #endif
 
+# if defined(CONFIG_ARCH_OMAP4)
+# undef cpu_is_omap44xx
+# undef cpu_is_omap443x
+# define cpu_is_omap44xx() 1
+# define cpu_is_omap443x() 1
+# endif
+
 /* Macros to detect if we have OMAP1 or OMAP2 */
 #define cpu_class_is_omap1()   (cpu_is_omap7xx() || cpu_is_omap15xx() || \
cpu_is_omap16xx())
-#define cpu_class_is_omap2()   (cpu_is_omap24xx() || cpu_is_omap34xx())
+#define cpu_class_is_omap2()   (cpu_is_omap24xx() || cpu_is_omap34xx() || \
+   cpu_is_omap44xx())
 
-#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
+#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) || \
+   defined(CONFIG_ARCH_OMAP4)
 
 /* Various silicon revisions for omap2 */
 #define OMAP242X_CLASS 0x24200024
@@ -370,6 +385,8 @@ IS_OMAP_TYPE(3430, 0x3430)
 #define OMAP3430_REV_ES3_0 0x34303034
 #define OMAP3430_REV_ES3_1 0x34304034
 
+#define OMAP443X_CLASS 0x44300034
+
 /*
  * omap_chip bits
  *
-- 
1.5.4.7

--
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: Beep sound in the end of audio file

2009-05-06 Thread Peter Ujfalusi
On Wednesday 06 May 2009 17:19:49 ext Todd Fischer wrote:
> Hi,
>
> FWIW: while developing a GSTreamer presentation using a BegleBoard (rev C),
> I noticed the same "tuck" sound.  It also occurs a second or two after the
> GST application exits.  I assumed it was some power management code that
> was disabling the audio codec after it had gone idle, but never looked into
> it.  BeagleBoard also uses TWL4030.
>
> GST command: gst-launch audiotestsrc freq=1000 num-buffers=100 ! alsasink
>
> /proc/version: Linux version 2.6.28-omap1 (ddo...@aleph) (gcc version 4.3.1
> (GCC) ) #2 Thu Mar 5 08:55:58 CST 2009

The "tuck" is coming from the codec, when it is powered down (in the old 
twl4030 codec found in omap-2.6.28 branch of linux-omap).
But, it still happens with the latest version, when the codec is muted only.
I can observe the "tuck" on Headset output, but not on the PreDrive...
The Headset enable and disable is implemented according to the TRM, but it 
seams that additional tweaking is needed..

-- 
Péter
--
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] ARM: OMAP: Fix tusb6010 init error and compilation warning

2009-05-06 Thread Jarkko Nikula
On Thu, 23 Apr 2009 20:06:39 +0300
Kalle Valo  wrote:

> Jarkko Nikula  writes:
> 
> > Fix "tusb6010 init error 5, -19" and compilation warning from
> > function tusb6010_platform_retime "warning: 'sysclk_ps' is used
> > uninitialized in this function".
> >
> > I suppose commit c094ba34b8f780885d029ce3c2715a194b780e5d was meant
> > to test for zero fclk_ps instead of sysclk_ps.
> 
> I was suffering exactly this problem and this patch fixed it. Now usb
> network works again, thanks a lot for fixing this!
> 
> > Signed-off-by: Jarkko Nikula 
> > Cc: Roel Kluin 
> 
> Tested-by: Kalle Valo 
> 
Ping? This patch was a fix for 2.6.30-rcX.


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


Re: [PATCH 2/6] omap iommu: omap2 architecture specific functions

2009-05-06 Thread Hiroshi DOYU
From: "ext Kanigeri, Hari" 
Subject: RE: [PATCH 2/6] omap iommu: omap2 architecture specific functions
Date: Wed, 6 May 2009 16:31:37 +0200

> Hi,
> 
> > +static u32 omap2_iommu_fault_isr(struct iommu *obj, u32 *ra)
> > +{
> > +   int i;
> > +   u32 stat, da;
> > +   const char *err_msg[] = {
> > +   "tlb miss",
> > +   "translation fault",
> > +   "emulation miss",
> > +   "table walk fault",
> > +   "multi hit fault",
> > +   };
> > +
> > +   stat = iommu_read_reg(obj, MMU_IRQSTATUS);
> > +   stat &= MMU_IRQ_MASK;
> > +   if (!stat)
> > +   return 0;
> > +
> > +   da = iommu_read_reg(obj, MMU_FAULT_AD);
> > +   *ra = da;
> > +
> > +   dev_err(obj->dev, "%s:\tda:%08x ", __func__, da);
> > +
> > +   for (i = 0; i < ARRAY_SIZE(err_msg); i++) {
> > +   if (stat & (1 << i))
> > +   printk("%s ", err_msg[i]);
> > +   }
> > +   printk("\n");
> > +
> > +   iommu_write_reg(obj, stat, MMU_IRQSTATUS);
> > +   return stat;
> > +}
> > +
> 
> -- I see you are acking the MMU fault in the ISR, but I don't think
> this will be enough to stop the further generation of MMU faults as
> the device will again try to access the same fault address. 

My idea is that, an iommu fault should be handled by a client
specific/provided callback function enough flexibly that it can handle
more complecated use cases like implementing on-demand dynamic memory
mapping at getting an iommu fault.

linux/arch/arm/plat-omap/iommu.c:

+static irqreturn_t iommu_fault_handler(int irq, void *data)
+{
+   u32 stat, da;
+   u32 *iopgd, *iopte;
+   int err = -EIO;
+   struct iommu *obj = data;
+
+   if (!obj->refcount)
+   return IRQ_NONE;
+
+   /* Dynamic loading TLB or PTE */
+   if (obj->isr)
+   err = obj->isr(obj);
  ^^

If the above "isr" function sets a new "tlb" or "pte" entry, then
further iommu fault won't happen anymore.

> 
> In the mean time before the callback mechanism is implemented, we
> should consider disabling the MMU for the device that caused the MMU
> fault to stop further generation of MMU faults.
> 
> + printk("\n");
> +
> + iommu_write_reg(obj, stat, MMU_IRQSTATUS);
> + omap2_iommu_disable(obj) ---> [HK]
> + return stat;
> +}

It's not bad idea at all to disable iommu temporary as a default
behavior, but maybe it should be done in the latter half of
"iommu_fault_handler()".

> 
> Thank you,
> Best regards,
> Hari
--
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] PM: suspend_device_irqs(): don't disable wakeup IRQs

2009-05-06 Thread Kim Kyuwon
2009/5/7 Arve Hjønnevåg :
> 2009/5/6 Kim Kyuwon :
>> 2009/5/7 Arve Hjønnevåg :
>>> On Wed, May 6, 2009 at 5:16 PM, Kevin Hilman
>>>  wrote:
 "Rafael J. Wysocki"  writes:

> On Wednesday 06 May 2009, Kevin Hilman wrote:
>> Kevin Hilman  writes:
>>>
 There is at least one problem with that which is why Kyuwon Kim added
 the ->disable hook to OMAP's irq_chip.  The problem is with drivers
 that call disable_irq() in their suspend hook, usually done to prevent
 the device from waking the system since on OMAP, any IRQ can be
 configured to wake the system.

>>>
>>> This does not sound correct. disable_irq_wake should be used for this.
>>> A driver may need to mask its interrupt before suspending but this
>>> should not also disable it as a wakeup source.
>>
>> I wish I could use disable_irq_wake(), but it doesn't work in OMAP.
>
> This does not sound like a hardware problem.

We may need advices of TI engineers.
However, as far as I know, It is impossible to disable 'interrupt
wake-up' with interrupt enabled. Because an interrupt itself generate
a system wake-up event in OMAP3430 (Hardware level).
-- 
Kyuwon

> --
> Arve Hjønnevåg
--
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] Fix the size of twl4030 script

2009-05-06 Thread Kim Kyuwon
Hi All,

I sent this patch about 1 month ago.
Can anybody check I'm sending correct patch?

Thanks you!
Kyuwon.

2009/4/10 Kim Kyuwon :
> The array size of wrst_seq is ARRAY_SIZE(wrst_seq)
>
> Signed-off-by: Kim Kyuwon 
> ---
>  arch/arm/mach-omap2/board-3430sdp.c |2 +-
>  arch/arm/mach-omap2/board-ldp.c |2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/board-3430sdp.c
> b/arch/arm/mach-omap2/board-3430sdp.c
> index 03acac7..38550e2 100644
> --- a/arch/arm/mach-omap2/board-3430sdp.c
> +++ b/arch/arm/mach-omap2/board-3430sdp.c
> @@ -473,7 +473,7 @@ static struct twl4030_ins wrst_seq[] __initdata = {
>  };
>  static struct twl4030_script wrst_script __initdata = {
>.script = wrst_seq,
> -   .size   = ARRAY_SIZE(wakeup_seq),
> +   .size   = ARRAY_SIZE(wrst_seq),
>.flags  = TRITON_WRST_SCRIPT,
>  };
>
> diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
> index 804fd8e..da814d7 100644
> --- a/arch/arm/mach-omap2/board-ldp.c
> +++ b/arch/arm/mach-omap2/board-ldp.c
> @@ -450,7 +450,7 @@ static struct twl4030_ins wrst_seq[] __initdata = {
>
>  static struct twl4030_script wrst_script __initdata = {
>.script = wrst_seq,
> -   .size   = ARRAY_SIZE(wakeup_seq),
> +   .size   = ARRAY_SIZE(wrst_seq),
>.flags  = TRITON_WRST_SCRIPT,
>  };
>
> --
> 1.5.2.5
>
> --
> Kyuwon (규원)
>

-- 
Kyuwon
--
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] rtc: rtc-twl4030 don't mask alarm interrupts on suspend

2009-05-06 Thread Kim Kyuwon
Hi All,

This patch was originally sent to linux-omap mailing list.
(Please refer to http://markmail.org/thread/o643d7w224zo3i7n)

David Brownell said, if I've tested this:

 Acked-by: David Brownell 

Of course, I've tested.

Regards,
Kyuwon
--
From: Kim Kyuwon 
Subject: [PATCH] rtc: rtc-twl4030 don't mask alarm interrupts on suspend

This patch enables the alarm interrupt of TWL4030 RTC to wake up the
system from suspend. You can test this patch with following command.

# echo +10 > /sys/class/rtc/rtc0/wakealarm; echo mem > /sys/power/state;

Signed-off-by: Kim Kyuwon 
---
 drivers/rtc/rtc-twl4030.c |4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-twl4030.c b/drivers/rtc/rtc-twl4030.c
index ad35f76..c185939 100644
--- a/drivers/rtc/rtc-twl4030.c
+++ b/drivers/rtc/rtc-twl4030.c
@@ -495,9 +495,7 @@ static int twl4030_rtc_suspend(struct platform_device 
*pdev, pm_message_t state)
 {
irqstat = rtc_irq_bits;
 
-   /* REVISIT alarm may need to wake us from sleep */
-   mask_rtc_irq_bit(BIT_RTC_INTERRUPTS_REG_IT_TIMER_M |
-BIT_RTC_INTERRUPTS_REG_IT_ALARM_M);
+   mask_rtc_irq_bit(BIT_RTC_INTERRUPTS_REG_IT_TIMER_M);
return 0;
 }
 
-- 
1.5.2.5
--
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: Beagleboard rev C memory timings & suspend/resume

2009-05-06 Thread Paul Walmsley
Hello Jean,

sorry about the delay,

On Wed, 29 Apr 2009, Jean Pihet wrote:

> The suspend/resume on Beagleboard has some problem due to bad memory timings.
> Suspending for more than 5 to 10 seconds shows memory corruption.
> 
> The new chips on rev Cx boards are using 2 DDR chip selects and it looks like 
> the 2nd memory part is not correctly put into self refresh. As an 
> experimentation I tried the same kernel with 'mem=128M' and it resumes 
> correctly after 1 min in suspend.

Nice work, this seems likely to be the cause.

> I could not find the latest DDR detailed specs from Micron. The part number 
> is 
> MT29C2G48MAKLCJI-6 IT. Are those available? Is this part identical to 2 1Gb 
> parts?

The combined part's web page is:

http://www.micron.com/products/partdetail?part=MT29C2G48MAKLCJI-6%20IT

The SDRAM datasheet is the same that is used for all the other Micron 
parts that we've run across so far:

http://download.micron.com/pdf/datasheets/dram/mobile/1gb_ddr_mobile_sdram_t48m.pdf

> Now for the code in the kernel, there are some changes needed to support 2 
> CS'es:
> - the SDRC parameters need to be updated for the new memory part
> - the SDRC parameters need to include the ACTIM_CTRL_A_0, ACTIM_CTRL_A_1, 
> ACTIM_CTRL_B_0, ACTIM_CTRL_B_1, RFR_CTRL_0 and RFR_CTRL_1 registers. Since 
> the parameters for the 2nd CS are the same, this can be avoided by writing 
> the same values to the 2 sets of registers
> - is there a need to differentiate between 1Gb and 2Gb chips, or can we just 
> write the same params for both CS'es even if only one is being used?
> - the 'configure_sdrc' function in arch/arm/mach-omap2/sram34xx.S needs to 
> program the 2 sets of registers. Here is a patch excerpt below. This patch 
> only does not help the suspend/resume though.
> 
> Any idea or suggestion?

Looks like a good start.  Since the two SDRC chip-selects can technically 
address parts with different timings, we should not assume that the two 
chip selects will be the same.  Admittedly this seems like an unlikely 
situation, but it's not impossible for non-POP OMAPs.

Re: suspend/resume, if you're talking about the code in sleep34xx.S, it 
looks like this is already in good shape.

Re: board & SDRC changes: would suggest modifying omap2_sdrc_init() to 
take either two struct omap_sdrc_params pointers, or one struct with two 
pointers.  omap2_init_common_hw() will also need to be updated for that, 
and all of the board-*.c files also.

Sound reasonable?

> ldr r11, omap3_sdrc_mr_0
> str r6, [r11]
> ldr r6, [r11]   @ posted-write barrier for SDRC
> +   ldr r11, omap3_sdrc_mr_1
> +   str r6, [r11]
> +   ldr r6, [r11]   @ posted-write barrier for SDRC
> bx  lr

By the way, there's no need to duplicate the posted-write barrier.  There 
should only be one, appearing right before the 'bx lr'.

regards,

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


[PATCH] OMAP_LDP: Support LCD display as a FB device on ZOOM MDK (Re: LDP support)

2009-05-06 Thread Tony Lindgren
* Tony Lindgren  [090505 21:00]:
> * Russell King - ARM Linux  [090505 12:52]:
> > On Tue, Apr 28, 2009 at 03:42:37PM -0700, Tony Lindgren wrote:
> > > * Russell King - ARM Linux  [090428 15:07]:
> > > > Tony, et.al.,
> > > > 
> > > > Any ideas when more LDP support will be pushed into mainline (such as
> > > > the framebuffer support)?
> > > 
> > > I'll be looking at the board-*.c patches for the next merge window
> > > hopefully this week or next week.
> > > 
> > > Looks like LDP keyboard, touchscreen & RTC are pretty much ready
> > > to go. Then the MMC has some regulator updates, but AFAIK the MMC
> > > should work OK already.
> > > 
> > > For the framebuffer, Imre and Tomi know the status the best, so
> > > I've added them to Cc.
> > > 
> > > Imre has been meaning to send a bunch of drivers/video/omap changes
> > > to the fbdev list for a while now and LDP framebuffer may depend on
> > > those. Imre, any news on the status of sending the fb patches
> > > upstream?
> > > 
> > > Then there are the upcoming DSS patches from Tomi, but those still
> > > need some work before they're ready to go.
> > 
> > Is there any news on this?  Will we see more functional OMAP3 / LDP
> > support queued for the next merge window?
> 
> Yes fro the stuff listed above, but still no news on the framebuffer
> patches. Imre?

Added Stanley Miao to Cc. Here's an updated version of Stanley's patch to
add fb support for LDP.

I don't have an LDP, maybe you guys can give it a try against the mainline
kernel and see if it works! There might be some changes needed to 
drivers/video/omap/dispc.c too.. And those should be handled by Imre.

But if this works, at least we can then add support for few more boards
easily while waiting for Imre to send his updates.

Cheers,

Tony 
commit 6ceeed27b64fab326963a8a867c7549443e7536e
Author: Stanley Miao 
Date:   Wed May 6 15:09:35 2009 -0700

OMAP_LDP: Support LCD display as a FB device on ZOOM MDK

Add glue to control the OMAP_LDP LCD as a frame buffer device
using the existing dispc.c driver under omapfb.

Patch updated for mainline kernel. Note that the
drivers/video/omap should be updated to pass omap_lcd_config
in platform_data. The patch should also be updated to compile
if twl4030 is not selected, and eventually to use the regulator
framework.

Signed-off-by: Stanley.Miao 
Signed-off-by: Tony Lindgren 

diff --git a/arch/arm/configs/omap_ldp_defconfig b/arch/arm/configs/omap_ldp_defconfig
index 679a4a3..8a979cd 100644
--- a/arch/arm/configs/omap_ldp_defconfig
+++ b/arch/arm/configs/omap_ldp_defconfig
@@ -685,11 +685,16 @@ CONFIG_GPIOLIB=y
 # CONFIG_GPIO_SYSFS is not set
 
 #
+# Memory mapped GPIO expanders:
+#
+
+#
 # I2C GPIO expanders:
 #
 # CONFIG_GPIO_MAX732X is not set
 # CONFIG_GPIO_PCA953X is not set
 # CONFIG_GPIO_PCF857X is not set
+CONFIG_GPIO_TWL4030=y
 
 #
 # PCI GPIO expanders:
@@ -740,12 +745,19 @@ CONFIG_SSB_POSSIBLE=y
 #
 # CONFIG_MFD_CORE is not set
 # CONFIG_MFD_SM501 is not set
+# CONFIG_MFD_ASIC3 is not set
 # CONFIG_HTC_EGPIO is not set
 # CONFIG_HTC_PASIC3 is not set
+# CONFIG_TPS65010 is not set
+CONFIG_TWL4030_CORE=y
 # CONFIG_MFD_TMIO is not set
 # CONFIG_MFD_T7L66XB is not set
 # CONFIG_MFD_TC6387XB is not set
 # CONFIG_MFD_TC6393XB is not set
+# CONFIG_PMIC_DA903X is not set
+# CONFIG_MFD_WM8400 is not set
+# CONFIG_MFD_WM8350_I2C is not set
+# CONFIG_MFD_PCF50633 is not set
 
 #
 # Multimedia devices
@@ -767,8 +779,45 @@ CONFIG_DAB=y
 #
 # CONFIG_VGASTATE is not set
 CONFIG_VIDEO_OUTPUT_CONTROL=m
-# CONFIG_FB is not set
-# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+CONFIG_FB=y
+CONFIG_FIRMWARE_EDID=y
+# CONFIG_FB_DDC is not set
+# CONFIG_FB_BOOT_VESA_SUPPORT is not set
+CONFIG_FB_CFB_FILLRECT=y
+CONFIG_FB_CFB_COPYAREA=y
+CONFIG_FB_CFB_IMAGEBLIT=y
+# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
+# CONFIG_FB_SYS_FILLRECT is not set
+# CONFIG_FB_SYS_COPYAREA is not set
+# CONFIG_FB_SYS_IMAGEBLIT is not set
+# CONFIG_FB_FOREIGN_ENDIAN is not set
+# CONFIG_FB_SYS_FOPS is not set
+# CONFIG_FB_SVGALIB is not set
+# CONFIG_FB_MACMODES is not set
+# CONFIG_FB_BACKLIGHT is not set
+CONFIG_FB_MODE_HELPERS=y
+CONFIG_FB_TILEBLITTING=y
+
+#
+# Frame buffer hardware drivers
+#
+# CONFIG_FB_S1D13XXX is not set
+# CONFIG_FB_VIRTUAL is not set
+# CONFIG_FB_METRONOME is not set
+CONFIG_FB_OMAP=y
+CONFIG_FB_OMAP_LCD_VGA=y
+# CONFIG_FB_OMAP_LCDC_EXTERNAL is not set
+# CONFIG_FB_OMAP_BOOTLOADER_INIT is not set
+CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE=4
+CONFIG_BACKLIGHT_LCD_SUPPORT=y
+CONFIG_LCD_CLASS_DEVICE=y
+# CONFIG_LCD_LTV350QV is not set
+# CONFIG_LCD_ILI9320 is not set
+# CONFIG_LCD_TDO24M is not set
+# CONFIG_LCD_VGG2432A4 is not set
+CONFIG_LCD_PLATFORM=y
+CONFIG_BACKLIGHT_CLASS_DEVICE=y
+# CONFIG_BACKLIGHT_CORGI is not set
 
 #
 # Display device support
@@ -780,6 +829,16 @@ CONFIG_VIDEO_OUTPUT_CONTROL=m
 #
 # CONFIG_VGA_CONSOLE is not set
 CONFIG_DUMMY_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+# CONFIG_FRAMEBUFFER_CONSOLE_DETECT

[PATCH (V2)] TVP514x: Migration to sub-device framework

2009-05-06 Thread hvaibhav
From: Vaibhav Hiremath 

This patch converts TVP514x driver to sub-device framework
from V4L2-int framework.

NOTE: Please note that this patch has not been tested on any board,
  only compilation/build tested.

Changes (From Previous post):
- Added static function to_decoder which will replace all
  container_of instances.
- "unsigned int" replaced with "u32".
- Cleaned up for line indentation.
- pdata initialized, was missing in earlier patch.

TODO:
- Add support for some basic video/core functionality like,
.g_chip_ident
.reset
.g_input_status
- Migration master driver to validate this driver.
- validate on Davinci and OMAP boards.

Reviewed By "Hans Verkuil".

Signed-off-by: Brijesh Jadav 
Signed-off-by: Hardik Shah 
Signed-off-by: Vaibhav Hiremath 
---
 drivers/media/video/tvp514x.c  |  854 ++--
 drivers/media/video/tvp514x_regs.h |   10 -
 include/media/tvp514x.h|4 -
 3 files changed, 330 insertions(+), 538 deletions(-)

diff --git a/drivers/media/video/tvp514x.c b/drivers/media/video/tvp514x.c
index 4262e60..12b49ad 100644
--- a/drivers/media/video/tvp514x.c
+++ b/drivers/media/video/tvp514x.c
@@ -31,7 +31,11 @@
 #include 
 #include 
 #include 
-#include 
+
+#include 
+#include 
+#include 
+#include 
 #include 

 #include "tvp514x_regs.h"
@@ -49,13 +53,13 @@ static int debug;
 module_param(debug, bool, 0644);
 MODULE_PARM_DESC(debug, "Debug level (0-1)");

-#define dump_reg(client, reg, val) \
+#define dump_reg(sd, reg, val) \
do {\
-   val = tvp514x_read_reg(client, reg);\
-   v4l_info(client, "Reg(0x%.2X): 0x%.2X\n", reg, val); \
+   val = tvp514x_read_reg(sd, reg);\
+   v4l2_info(sd, "Reg(0x%.2X): 0x%.2X\n", reg, val); \
} while (0)

-/**
+/*
  * enum tvp514x_std - enum for supported standards
  */
 enum tvp514x_std {
@@ -64,15 +68,7 @@ enum tvp514x_std {
STD_INVALID
 };

-/**
- * enum tvp514x_state - enum for different decoder states
- */
-enum tvp514x_state {
-   STATE_NOT_DETECTED,
-   STATE_DETECTED
-};
-
-/**
+/*
  * struct tvp514x_std_info - Structure to store standard informations
  * @width: Line width in pixels
  * @height:Number of active lines
@@ -87,35 +83,29 @@ struct tvp514x_std_info {
 };

 static struct tvp514x_reg tvp514x_reg_list_default[0x40];
-/**
+/*
  * struct tvp514x_decoder - TVP5146/47 decoder object
- * @v4l2_int_device: Slave handle
- * @tvp514x_slave: Slave pointer which is used by @v4l2_int_device
+ * @sd: Subdevice Slave handle
  * @tvp514x_regs: copy of hw's regs with preset values.
  * @pdata: Board specific
- * @client: I2C client data
- * @id: Entry from I2C table
  * @ver: Chip version
- * @state: TVP5146/47 decoder state - detected or not-detected
+ * @state: TVP5146/47 decoder state - enabled or disabled.
  * @pix: Current pixel format
  * @num_fmts: Number of formats
  * @fmt_list: Format list
  * @current_std: Current standard
  * @num_stds: Number of standards
  * @std_list: Standards list
- * @route: input and output routing at chip level
+ * @input: Input routing at chip level
+ * @output: Output routing at chip level
  */
 struct tvp514x_decoder {
-   struct v4l2_int_device v4l2_int_device;
-   struct v4l2_int_slave tvp514x_slave;
+   struct v4l2_subdev sd;
struct tvp514x_reg tvp514x_regs[ARRAY_SIZE(tvp514x_reg_list_default)];
const struct tvp514x_platform_data *pdata;
-   struct i2c_client *client;
-
-   struct i2c_device_id *id;

int ver;
-   enum tvp514x_state state;
+   int state;

struct v4l2_pix_format pix;
int num_fmts;
@@ -124,8 +114,11 @@ struct tvp514x_decoder {
enum tvp514x_std current_std;
int num_stds;
struct tvp514x_std_info *std_list;
-
-   struct v4l2_routing route;
+   /*
+* Input and Output Routing parameters
+*/
+   u32 input;
+   u32 output;
 };

 /* TVP514x default register values */
@@ -191,7 +184,8 @@ static struct tvp514x_reg tvp514x_reg_list_default[] = {
{TOK_TERM, 0, 0},
 };

-/* List of image formats supported by TVP5146/47 decoder
+/*
+ * List of image formats supported by TVP5146/47 decoder
  * Currently we are using 8 bit mode only, but can be
  * extended to 10/20 bit mode.
  */
@@ -240,35 +234,27 @@ static struct tvp514x_std_info tvp514x_std_list[] = {
},
/* Standard: need to add for additional standard */
 };
-/*
- * Control structure for Auto Gain
- * This is temporary data, will get replaced once
- * v4l2_ctrl_query_fill supports it.
- */
-static const struct v4l2_queryctrl tvp514x_autogain_ctrl = {
-   .id = V4L2_CID_AUTOGAIN,
-   .name = "Gain, Automatic",
-   .type = V4L2_CTRL_TYPE_BOOLEAN,
-   .minimum = 0,
-   .maximum = 1

[APPLIED] [PATCH] OMAP clock: GPIO de-bounce clocks don't affect module idle

2009-05-06 Thread Tony Lindgren
This patch has been applied to the linux-omap
by youw fwiendly patch wobot.

Initial commit ID (Likely to change): 2489dcb52022e4a8d2747e7c18c844cd139610c6

PatchWorks
http://patchwork.kernel.org/patch/21946/

Git (Likely to change, and takes a while to get mirrored)
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=2489dcb52022e4a8d2747e7c18c844cd139610c6


--
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 0/7] Generic gpmc-onenand initialization, v3

2009-05-06 Thread Tony Lindgren
* Tony Lindgren  [090504 17:25]:
> Hi all,
> 
> Here's the whole series one more time, looks like I missed Juha
> from the recipients originally. After all it's mostly Juha's
> code! :)
> 
> To recap, this series creates a generic gpmc-onenand.c out of the
> board-n800-flash.c so we can get this init code to the mainline
> kernel. This series is against the linux-omap tree, the patch
> against the mainline tree will be posted later.

Pushing this series to linux-omap tree today.
 
> Regards,
> 
> Tony
> 
> ---
> 
> Tony Lindgren (7):
>   onenand_init: Clean-up for checkpatch.pl
>   onenand init: Convert omap3430sdp to use gpmc-onenand
>   onenand_init: Allow disabling sync read and write based on flags, v3
>   onenand init: Pass configuration data from board-*.c files
>   onenand init: Rename n800_* functions to gpmc_onenand_* functions
>   onenand init: Build gpmc-onenand.o based on CONFIG_MTD_ONENAND_OMAP2
>   onenand init: Rename board-n800-flash.c to gpmc-onenand.c
> 
> 
>  arch/arm/mach-omap2/Makefile |7 +-
>  arch/arm/mach-omap2/board-3430sdp-flash.c|   28 ---
>  arch/arm/mach-omap2/board-n800.c |   50 
>  arch/arm/mach-omap2/board-rx51-flash.c   |   21 -
>  arch/arm/mach-omap2/board-rx51-peripherals.c |   47 
>  arch/arm/mach-omap2/board-rx51.c |2 
>  arch/arm/mach-omap2/gpmc-onenand.c   |  105 
> --
>  arch/arm/plat-omap/include/mach/board.h  |8 --
>  arch/arm/plat-omap/include/mach/onenand.h|   29 +++
>  9 files changed, 177 insertions(+), 120 deletions(-)
>  delete mode 100644 arch/arm/mach-omap2/board-rx51-flash.c
>  rename arch/arm/mach-omap2/{board-n800-flash.c => gpmc-onenand.c} (78%)
> 
> -- 
> Signature
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH 2/6] omap iommu: omap2 architecture specific functions

2009-05-06 Thread Kanigeri, Hari
Hi,

> +static u32 omap2_iommu_fault_isr(struct iommu *obj, u32 *ra)
> +{
> + int i;
> + u32 stat, da;
> + const char *err_msg[] = {
> + "tlb miss",
> + "translation fault",
> + "emulation miss",
> + "table walk fault",
> + "multi hit fault",
> + };
> +
> + stat = iommu_read_reg(obj, MMU_IRQSTATUS);
> + stat &= MMU_IRQ_MASK;
> + if (!stat)
> + return 0;
> +
> + da = iommu_read_reg(obj, MMU_FAULT_AD);
> + *ra = da;
> +
> + dev_err(obj->dev, "%s:\tda:%08x ", __func__, da);
> +
> + for (i = 0; i < ARRAY_SIZE(err_msg); i++) {
> + if (stat & (1 << i))
> + printk("%s ", err_msg[i]);
> + }
> + printk("\n");
> +
> + iommu_write_reg(obj, stat, MMU_IRQSTATUS);
> + return stat;
> +}
> +

-- I see you are acking the MMU fault in the ISR, but I don't think this will 
be enough to stop the further generation of MMU faults as the device will again 
try to access the same fault address. 

In the mean time before the callback mechanism is implemented, we should 
consider disabling the MMU for the device that caused the MMU fault to stop 
further generation of MMU faults.

+   printk("\n");
+
+   iommu_write_reg(obj, stat, MMU_IRQSTATUS);
+   omap2_iommu_disable(obj) ---> [HK]
+   return stat;
+}

Thank you,
Best regards,
Hari
--
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: [alsa-devel] Beep sound in the end of audio file

2009-05-06 Thread Mark Brown
On Wed, May 06, 2009 at 07:30:03PM +0530, Aggarwal, Anuj wrote:

> > After a quick look I can not pin point the soc board file used with the
> > omap3evm board. Is it in the tree?

> [Aggarwal, Anuj] No, it is not. Reason being we already have beagle & 
> sdp3430 there, which are both similar to omap3evm, which I pushed. 
> So mine got rejected. We had some discussions on how to handle this
> scenario but nothing got finalized.

Not from the ALSA side it didn't...
--
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: [alsa-devel] Beep sound in the end of audio file

2009-05-06 Thread Jon Smirl
On Wed, May 6, 2009 at 10:01 AM, Jon Smirl  wrote:
> On Wed, May 6, 2009 at 1:33 AM, Peter Ujfalusi  
> wrote:
>> Hello,
>>
>> On Tuesday 05 May 2009 20:03:57 ext Aggarwal, Anuj wrote:
>>> Hi,
>>>
>>> After playing out any audio file on OMAP3 EVM, having TWL4030 codec,
>>> I am hearing a beep sound. I have also tried implementing a mute function
>>> in which I disabled all the inputs/outputs but still that didn't help.
>>>
>>> Any idea how this can be avoided?
>>
>> I have not heard from this kind of problem so far, which does not mean, that
>> it does not exist ;)
>> Can you describe the beep sound?
>>
>> After a quick look I can not pin point the soc board file used with the
>> omap3evm board. Is it in the tree?
>>
>> Does the beep happens in these cases also (after stopping it with Ctrl+C):
>> aplay -f dat /dev/zero
>> aplay -f dat /dev/urandom
>
>
> I'm having this problem on PowerPC
>
> Audio is played via multiple period buffers
> Am interrupt is generated on the end of each period
>
> The problem occurs at the end of the stream.
> The period containing the end of stream plays and generates an interrupt.
> ALSA then calls back with trigger(STOP)
>
> But I can't shut off the DMA fast enough on these slower CPUs (not
> 3Ghz) to prevent the next period from starting to play. This next
> period contains data from earlier in the stream. When a small amount
> of it plays it sounds like a short tone beep.
>
> The beep is only obvious if the last period being played mostly
> contains silence. In that case the silence will play, then you will be
> able to hear the burst of noise separated from the rest of the stream.

PS - a simple way to see if this is your problem. In the ISR memset the buffer
that just finished playing to zero. That will make the problem go away since the
stale data is now just silence.

>
> What I need to know is the address of the last valid sample in the
> stream. If I knew that I could just program the DMA hardware to stop
> after it played. I've been staring at ALSA core for a couple of days
> trying to figure out how to get the address for the end of the stream.
>
>
>
>
>>
>>
>> CC-ing alsa-devel...
>>
>>>
>>> Thanks and Regards,
>>> Anuj Aggarwal
>>>
>>> Platform Support Products
>>> Texas Instruments Incorporated
>>
>>
>> --
>> Péter
>> ___
>> Alsa-devel mailing list
>> alsa-de...@alsa-project.org
>> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>>
>
>
>
> --
> Jon Smirl
> jonsm...@gmail.com
>



-- 
Jon Smirl
jonsm...@gmail.com
--
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: [alsa-devel] Beep sound in the end of audio file

2009-05-06 Thread Jon Smirl
On Wed, May 6, 2009 at 1:33 AM, Peter Ujfalusi  wrote:
> Hello,
>
> On Tuesday 05 May 2009 20:03:57 ext Aggarwal, Anuj wrote:
>> Hi,
>>
>> After playing out any audio file on OMAP3 EVM, having TWL4030 codec,
>> I am hearing a beep sound. I have also tried implementing a mute function
>> in which I disabled all the inputs/outputs but still that didn't help.
>>
>> Any idea how this can be avoided?
>
> I have not heard from this kind of problem so far, which does not mean, that
> it does not exist ;)
> Can you describe the beep sound?
>
> After a quick look I can not pin point the soc board file used with the
> omap3evm board. Is it in the tree?
>
> Does the beep happens in these cases also (after stopping it with Ctrl+C):
> aplay -f dat /dev/zero
> aplay -f dat /dev/urandom


I'm having this problem on PowerPC

Audio is played via multiple period buffers
Am interrupt is generated on the end of each period

The problem occurs at the end of the stream.
The period containing the end of stream plays and generates an interrupt.
ALSA then calls back with trigger(STOP)

But I can't shut off the DMA fast enough on these slower CPUs (not
3Ghz) to prevent the next period from starting to play. This next
period contains data from earlier in the stream. When a small amount
of it plays it sounds like a short tone beep.

The beep is only obvious if the last period being played mostly
contains silence. In that case the silence will play, then you will be
able to hear the burst of noise separated from the rest of the stream.

What I need to know is the address of the last valid sample in the
stream. If I knew that I could just program the DMA hardware to stop
after it played. I've been staring at ALSA core for a couple of days
trying to figure out how to get the address for the end of the stream.




>
>
> CC-ing alsa-devel...
>
>>
>> Thanks and Regards,
>> Anuj Aggarwal
>>
>> Platform Support Products
>> Texas Instruments Incorporated
>
>
> --
> Péter
> ___
> Alsa-devel mailing list
> alsa-de...@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>



-- 
Jon Smirl
jonsm...@gmail.com
--
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: Beep sound in the end of audio file

2009-05-06 Thread Aggarwal, Anuj
> -Original Message-
> From: Peter Ujfalusi [mailto:peter.ujfal...@nokia.com]
> Sent: Wednesday, May 06, 2009 11:03 AM
> To: Aggarwal, Anuj
> Cc: linux-omap@vger.kernel.org; alsa-de...@alsa-project.org
> Subject: Re: Beep sound in the end of audio file
> 
> Hello,
> 
> On Tuesday 05 May 2009 20:03:57 ext Aggarwal, Anuj wrote:
> > Hi,
> >
> > After playing out any audio file on OMAP3 EVM, having TWL4030 codec,
> > I am hearing a beep sound. I have also tried implementing a mute function
> > in which I disabled all the inputs/outputs but still that didn't help.
> >
> > Any idea how this can be avoided?
> 
> I have not heard from this kind of problem so far, which does not mean, that
> it does not exist ;)
> Can you describe the beep sound?
[Aggarwal, Anuj] It's kind of a "tuck" sound coming in the end, after 1 or  2 
seconds.
> 
> After a quick look I can not pin point the soc board file used with the
> omap3evm board. Is it in the tree?
[Aggarwal, Anuj] No, it is not. Reason being we already have beagle & 
sdp3430 there, which are both similar to omap3evm, which I pushed. 
So mine got rejected. We had some discussions on how to handle this
scenario but nothing got finalized.
> 
> Does the beep happens in these cases also (after stopping it with Ctrl+C):
> aplay -f dat /dev/zero
> aplay -f dat /dev/urandom
[Aggarwal, Anuj] Yes, it comes in both the cases.
> 
> 
> CC-ing alsa-devel...
> 
> >
> > Thanks and Regards,
> > Anuj Aggarwal
> >
> > Platform Support Products
> > Texas Instruments Incorporated
> 
> 
> --
> Péter

--
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] [PATCH] twl4030: Add some error checking to twl4030 init

2009-05-06 Thread Amit Kucheria
Check for return values of i2c read/write operations and size of scripts being
uploaded to TWL4030

(Removed the unrelated string changes based on David Brownell's comment)

Signed-off-by: Amit Kucheria 
---
 drivers/mfd/twl4030-power.c |   52 +++---
 1 files changed, 38 insertions(+), 14 deletions(-)

diff --git a/drivers/mfd/twl4030-power.c b/drivers/mfd/twl4030-power.c
index 9dc493b..8f5d149 100644
--- a/drivers/mfd/twl4030-power.c
+++ b/drivers/mfd/twl4030-power.c
@@ -257,36 +257,40 @@ static int __init config_warmreset_sequence(u8 address)
return err;
 }
 
-void twl4030_configure_resource(struct twl4030_resconfig *rconfig)
+static int __init twl4030_configure_resource(struct twl4030_resconfig *rconfig)
 {
int rconfig_addr;
+   int err;
u8 type;
 
if (rconfig->resource > NUM_OF_RESOURCES) {
printk(KERN_ERR
"TWL4030 Resource %d does not exist\n",
rconfig->resource);
-   return;
+   return -EINVAL;
}
 
rconfig_addr = res_config_addrs[rconfig->resource];
 
/* Set resource group */
-
if (rconfig->devgroup >= 0)
-   twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
+   err = twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
rconfig->devgroup << 5,
rconfig_addr + DEVGROUP_OFFSET);
+   if (err < 0) {
+   printk(KERN_ERR
+  "TWL4030 failed to program devgroup");
+   return err;
+   }
 
/* Set resource types */
-
-   if (twl4030_i2c_read_u8(TWL4030_MODULE_PM_RECEIVER,
-   &type,
-   rconfig_addr + TYPE_OFFSET) < 0) {
+   err = twl4030_i2c_read_u8(TWL4030_MODULE_PM_RECEIVER, &type,
+ rconfig_addr + TYPE_OFFSET);
+   if (err < 0) {
printk(KERN_ERR
-   "TWL4030 Resource %d type could not read\n",
-   rconfig->resource);
-   return;
+  "TWL4030 Resource %d type could not be read\n",
+  rconfig->resource);
+   return err;
}
 
if (rconfig->type >= 0) {
@@ -299,8 +303,15 @@ void twl4030_configure_resource(struct twl4030_resconfig 
*rconfig)
type |= rconfig->type2 << 3;
}
 
-   twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
+   err = twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
type, rconfig_addr + TYPE_OFFSET);
+   if (err < 0) {
+   printk(KERN_ERR
+  "TWL4030 failed to program resource type");
+   return err;
+   }
+
+   return 0;
 
 }
 
@@ -309,6 +320,12 @@ static int __init load_triton_script(struct twl4030_script 
*tscript)
u8 address = triton_next_free_address;
int err;
 
+   /* Make sure the script isn't going beyond last valid address */
+   if ((address + tscript->size) > (END_OF_SCRIPT-1)) {
+   printk(KERN_ERR "TWL4030 script too big error\n");
+   return -EINVAL;
+   }
+
err = twl4030_write_script(address, tscript->script, tscript->size);
if (err)
return err;
@@ -346,15 +363,22 @@ void __init twl4030_power_init(struct twl4030_power_data 
*triton2_scripts)
 
for (i = 0; i < triton2_scripts->size; i++) {
err = load_triton_script(triton2_scripts->scripts[i]);
-   if (err)
+   if (err < 0) {
+   printk(KERN_ERR "TWL4030 failed to load scripts");
break;
+   }
}
 
resconfig = triton2_scripts->resource_config;
if (resconfig) {
while (resconfig->resource) {
-   twl4030_configure_resource(resconfig);
+   err = twl4030_configure_resource(resconfig);
resconfig++;
+   if (err < 0) {
+   printk(KERN_ERR
+  "TWL4030 failed to configure resource");
+   break;
+   }
}
}
 
-- 
1.6.0.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


Incorporating linux-omap-pm patches into the linux-omap-2.6 mainline

2009-05-06 Thread Elvis Dowson

Hi,
   I've found a linux-omap-pm git repository that has some active  
development going on for OMAP3 power management.


git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm/git

There are 2 branches, pm and pm-next that contain a lot of new OMAP3  
specific power management patches.


When will these new features get incorporated into the linux-omap-2.6  
mainline?


Will it come as part of a new kernel release, say linux-omap3-2.6.30 ?

Best regards,

Elvis
--
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] input: Add support for the TSC2003 controller.

2009-05-06 Thread Thierry Reding
* Kwangwoo Lee wrote:
> On Wed, May 6, 2009 at 3:45 PM, Thierry Reding
>  wrote:
> > * Kwangwoo Lee wrote:
> > [...]
> >> Thanks for the patch. It looks good. :)
> >> The code in the patch is already merged in the main kernel tree.
> >>
> >> @@ -235,7 +245,7 @@ static irqreturn_t tsc2007_irq(int irq, void *handle)
> >>       spin_lock_irqsave(&ts->lock, flags);
> >>
> >>       if (likely(ts->get_pendown_state())) {
> >> -             disable_irq(ts->irq);
> >> +             disable_irq_nosync(ts->irq);
> >>               hrtimer_start(&ts->timer, ktime_set(0, TS_POLL_DELAY),
> >>                                       HRTIMER_MODE_REL);
> >>       }
> >
> > Oh, I hadn't noticed. I diffed against 2.6.30-rc4. Do you want me to send a
> > new patch or will you just rip that piece out?
> 
> Send fixed patch with your Signed-off-by line.

Attached is the previous patch with said change removed.

Thierry

From: Thierry Reding 
Subject: [PATCH] tsc2007: Fix for I2C controllers that sleep during transfers.

This patch fixes the tsc2007 driver with I2C controllers that sleep during
transfers. By moving the critical code to a workqueue, I2C transfers can be
scheduled to run in non-interrupt context.

Signed-off-by: Thierry Reding 

---
 drivers/input/touchscreen/tsc2007.c |   23 +--
 1 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/drivers/input/touchscreen/tsc2007.c b/drivers/input/touchscreen/tsc2007.c
index 4ab0702..2939355 100644
--- a/drivers/input/touchscreen/tsc2007.c
+++ b/drivers/input/touchscreen/tsc2007.c
@@ -70,6 +70,7 @@ struct ts_event {
 struct tsc2007 {
 	struct input_dev	*input;
 	char			phys[32];
+	struct work_struct	work;
 	struct hrtimer		timer;
 	struct ts_event		tc;
 
@@ -173,6 +174,9 @@ static void tsc2007_send_event(void *tsc)
 
 		dev_dbg(&ts->client->dev, "point(%4d,%4d), pressure (%4u)\n",
 			x, y, rt);
+	} else {
+		if (!ts->pendown)
+			ts->pendown = 1;
 	}
 
 	hrtimer_start(&ts->timer, ktime_set(0, TS_POLL_PERIOD),
@@ -197,11 +201,19 @@ static int tsc2007_read_values(struct tsc2007 *tsc)
 	return 0;
 }
 
+static void tsc2007_work(struct work_struct *work)
+{
+	struct tsc2007 *ts = container_of(work, struct tsc2007, work);
+	tsc2007_read_values(ts);
+	tsc2007_send_event(ts);
+}
+
 static enum hrtimer_restart tsc2007_timer(struct hrtimer *handle)
 {
 	struct tsc2007 *ts = container_of(handle, struct tsc2007, timer);
+	unsigned long flags = 0;
 
-	spin_lock_irq(&ts->lock);
+	spin_lock_irqsave(&ts->lock, flags);
 
 	if (unlikely(!ts->get_pendown_state() && ts->pendown)) {
 		struct input_dev *input = ts->input;
@@ -217,12 +229,10 @@ static enum hrtimer_restart tsc2007_timer(struct hrtimer *handle)
 	} else {
 		/* pen is still down, continue with the measurement */
 		dev_dbg(&ts->client->dev, "pen is still down\n");
-
-		tsc2007_read_values(ts);
-		tsc2007_send_event(ts);
+		schedule_work(&ts->work);
 	}
 
-	spin_unlock_irq(&ts->lock);
+	spin_unlock_irqrestore(&ts->lock, flags);
 
 	return HRTIMER_NORESTART;
 }
@@ -252,7 +262,7 @@ static int tsc2007_probe(struct i2c_client *client,
 			const struct i2c_device_id *id)
 {
 	struct tsc2007 *ts;
-	struct tsc2007_platform_data *pdata = pdata = client->dev.platform_data;
+	struct tsc2007_platform_data *pdata = client->dev.platform_data;
 	struct input_dev *input_dev;
 	int err;
 
@@ -279,6 +289,7 @@ static int tsc2007_probe(struct i2c_client *client,
 
 	hrtimer_init(&ts->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
 	ts->timer.function = tsc2007_timer;
+	INIT_WORK(&ts->work, tsc2007_work);
 
 	spin_lock_init(&ts->lock);
 
-- 
tg: (091438d..) adx/input/tsc2007 (depends on: adx/master)


RE: [PATCH] OMAP: HSMMC: Do not enable buffer ready interrupt if using DMA

2009-05-06 Thread Gadiyar, Anand
On Tue, May 5, 2009, Jarkko Lavinen wrote: 
> On Tue, Apr 21, 2009 at 09:39:22AM +0200, ext Gadiyar, Anand wrote:
> > From: Anand Gadiyar 
> > 
> > OMAP: HSMMC: Do not enable buffer ready interrupt if using DMA
> > 
> > This considerably reduces the number of interrupts during a transfer
> > and ought to result in some power saving.
> 
> I tried the patch with reading from the raw mmc block device to
> /dev/null with dd (with bs 32k and 1M).  I cannot see any
> difference in interrupt count from /proc/interrupts or in read
> speed. At least the patch works. Cpu was 34340es3.
> 
> I also trid without the patch just disabling the Buffer
> Read/write Ready bits from INT_EN_MASK which is then written to
> both MMCHS_IE and MMCHS_ISE.  Still no change in read speed nor
> mmc irq count.
> 
> Cheers
> Jarkko Lavinen

I discovered this while doing MMC writes. I did not check if there
was any difference during a read. I notice you have only tested with
MMC reads.

Here's what I get with and without the patch.

- Anand

Without patch
/ # mount -t vfat /dev/mmcblk0 /mnt/mmc
/ # cat /proc/interrupts | grep mmc
 83: 90INTC  mmc0
384:  1 twl4030  mmc0
/ # dd if=/dev/zero of=/mnt/mmc/32kbs.txt bs=32k count=1000
1000+0 records in
1000+0 records out
/ # cat /proc/interrupts | grep mmc
 83:   3760INTC  mmc0
384:  1 twl4030  mmc0
/ # dd if=/dev/zero of=/mnt/mmc/1Mbs.txt bs=1M count=32
32+0 records in
32+0 records out
/ # cat /proc/interrupts | grep mmc
 83:   7570INTC  mmc0
384:  1 twl4030  mmc0
/ # ls -l /mnt/mmc
-rwxr-xr-x1 root root 33554432 Dec 31 18:03 1Mbs.txt
-rwxr-xr-x1 root root 32768000 Dec 31 18:03 32kbs.txt
/ # umount /mnt/mmc


With patch
/ # mount -t vfat /dev/mmcblk0 /mnt/mmc
/ # cat /proc/interrupts | grep mmc
 83: 67INTC  mmc0
384:  0 twl4030  mmc0
/ # dd if=/dev/zero of=/mnt/mmc/32kbs.txt bs=32k count=1000
1000+0 records in
1000+0 records out
/ # cat /proc/interrupts | grep mmc
 83:   3103INTC  mmc0
384:  0 twl4030  mmc0
/ # dd if=/dev/zero of=/mnt/mmc/1Mbs.txt bs=1M count=32
32+0 records in
32+0 records out
/ # cat /proc/interrupts | grep mmc
 83:   6170INTC  mmc0
384:  0 twl4030  mmc0
/ # ls -l /mnt/mmc
-rwxr-xr-x1 root root 33554432 Dec 31 18:01 1Mbs.txt
-rwxr-xr-x1 root root 32768000 Dec 31 18:00 32kbs.txt
/ # umount /mnt/mmc--
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