Re: [PATCH 1/4] ARM: OMAP3: cm-t35: add regulator supply for ads7846

2011-11-20 Thread Igor Grinberg
On 11/19/11 02:14, Tony Lindgren wrote:
 * Igor Grinberg grinb...@compulab.co.il [08 04:47]:
 On 11/07/11 22:31, Tony Lindgren wrote:
 * Igor Grinberg grinb...@compulab.co.il [06 04:45]:
 Hi Tony,

 On 11/05/11 01:57, Tony Lindgren wrote:
 * Tony Lindgren t...@atomide.com [04 16:05]:
 * Igor Grinberg grinb...@compulab.co.il [111019 02:05]:

 Applying to board branch for v3.3 merge window.

 Hmm, actually I suggest you respin patches 2 and 3 so they apply
 on their own to current fixes branch. Then update 1 and 4 to
 apply on top of those.

 This way we can apply 2 and 3 during the -rc cycle, and then
 queue 1 and 4 for the next merge window.

 Well, actually all them are fixes, although it cannot be understood
 from the subject.
 I will adjust the subjects (and may be the commit messages also)
 to be more specific and resend.

 Hmm 1  4 are features that never worked type fixes, so they
 have flame potential. Those have to wait for the next merge window.

 Not exactly:

 1/4 is a fix that I should have submitted more than a year ago,
 just after the ads7846 got support for the regulators:
 
 Sounds like it's not that urgent then :)
 
 Or I can just apply all of them into board branch to wait for the
 next merge window.

 That can be an option, if it bothers you too much,
 but I prefer to have this already in 3.2.
 
 I'll just apply them into board branch to wait for the next merge
 window then.

No problem, thanks


-- 
Regards,
Igor.
--
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


[RFC PATCH 00/11] arm:omap:am33xx: Add basic voltage, power, clock HWMOD data

2011-11-20 Thread Vaibhav Hiremath
This patch series adds support for AM335X basic voltage, power,
clock and HWMOD data to existing OMAP framework.
Care has been taken while adding new API's to make sure that
we don't duplicate the code, and API's being added only
wherever required (where we didn't had any option).

The main purpose of this patch-series is to get early feedback 
review comments from list.

NOTE: Also please note that, most of the files are auto-generated
using HW data base and then modified based on latest kernel changes 
bug fixes.

For further information on AM33XX family of devices, please
refer to below links,

Official website -
http://www.ti.com/product/am3359

Link to Public TRM -
http://www.ti.com/lit/ug/spruh73a/spruh73a.pdf

This patch series has beed created on top of linux-omap/master +
AM33XX baseport patches submitted previously.
Link to AM335X Baseport patches -

http://www.spinics.net/lists/linux-omap/msg60088.html
http://www.spinics.net/lists/linux-omap/msg60087.html
http://www.spinics.net/lists/linux-omap/msg60090.html
http://www.spinics.net/lists/linux-omap/msg60089.html

Testing -
- These patches has been tested on OMAP3EVM to make sure
 nothing has been broken.
- Patches has also been tested on AM335X EVM
(with few additional patches).
- All the patches can be accessible from,
http://arago-project.org/git/people/?p=vaibhav/ti-psp-omap-video.git;a=summary 
am335x-staging

Afzal Mohammed (6):
  arm:omap:am33xx: Add voltage domain data
  arm:omap:am33xx: Integrate voltage domain
  arm:omap:am33xx: Add power domain data
  arm:omap:am33xx: Integrate powerdomain to OMAP power framework
  arm:omap:am33xx: Add Clock  clockdomain data
  arm:omap:am33xx: Integrate clock  clockdomain to OMAP clock
framework

Vaibhav Hiremath (5):
  arm:omap:am33xx: Add irq, dma and module base addr to SoC header
files
  arm:omap:am33xx: Add HWMOD data
  arm:omap:am33xx: Integrate AM33XX hwmods to omap HWMOD framework
  ARM:omap:am33xx: Add clock control api's
  arm:omap:am33xx: Add am335x support in generic omap_hwmod

 arch/arm/mach-omap2/Makefile  |9 +
 arch/arm/mach-omap2/clock33xx.c   |   82 +
 arch/arm/mach-omap2/clock33xx.h   |   40 +
 arch/arm/mach-omap2/clock33xx_data.c  | 1936 +++
 arch/arm/mach-omap2/clock3xxx_data.c  |5 +-
 arch/arm/mach-omap2/clockdomain.h |1 +
 arch/arm/mach-omap2/clockdomain2xxx_3xxx.c|   18 +-
 arch/arm/mach-omap2/clockdomains33xx_data.c   |  223 +++
 arch/arm/mach-omap2/cm-regbits-33xx.h |  683 +++
 arch/arm/mach-omap2/cm2xxx_3xxx.c |   34 +
 arch/arm/mach-omap2/cm2xxx_3xxx.h |6 +
 arch/arm/mach-omap2/cm33xx.c  |   51 +
 arch/arm/mach-omap2/cm33xx.h  |  390 
 arch/arm/mach-omap2/cminst33xx.c  |  311 
 arch/arm/mach-omap2/cminst33xx.h  |   63 +
 arch/arm/mach-omap2/io.c  |5 +
 arch/arm/mach-omap2/omap_hwmod.c  |   42 +-
 arch/arm/mach-omap2/omap_hwmod_33xx_data.c| 2474 +
 arch/arm/mach-omap2/powerdomain.h |4 +-
 arch/arm/mach-omap2/powerdomain33xx.c |  155 ++
 arch/arm/mach-omap2/powerdomains33xx_data.c   |  115 ++
 arch/arm/mach-omap2/prm-regbits-33xx.h|  357 
 arch/arm/mach-omap2/prm33xx.h |  123 ++
 arch/arm/mach-omap2/prminst33xx.c |   74 +
 arch/arm/mach-omap2/prminst33xx.h |   25 +
 arch/arm/mach-omap2/voltage.h |1 +
 arch/arm/mach-omap2/voltagedomains33xx_data.c |   37 +
 arch/arm/plat-omap/include/plat/am33xx.h  |   40 +
 arch/arm/plat-omap/include/plat/dma-33xx.h|   85 +
 arch/arm/plat-omap/include/plat/dma.h |1 +
 arch/arm/plat-omap/include/plat/irqs-33xx.h   |  143 ++
 arch/arm/plat-omap/include/plat/irqs.h|1 +
 arch/arm/plat-omap/include/plat/omap_hwmod.h  |1 +
 arch/arm/plat-omap/include/plat/serial.h  |5 +
 34 files changed, 7525 insertions(+), 15 deletions(-)
 create mode 100644 arch/arm/mach-omap2/clock33xx.c
 create mode 100644 arch/arm/mach-omap2/clock33xx.h
 create mode 100644 arch/arm/mach-omap2/clock33xx_data.c
 create mode 100644 arch/arm/mach-omap2/clockdomains33xx_data.c
 create mode 100644 arch/arm/mach-omap2/cm-regbits-33xx.h
 create mode 100644 arch/arm/mach-omap2/cm33xx.c
 create mode 100644 arch/arm/mach-omap2/cm33xx.h
 create mode 100644 arch/arm/mach-omap2/cminst33xx.c
 create mode 100644 arch/arm/mach-omap2/cminst33xx.h
 create mode 100644 arch/arm/mach-omap2/omap_hwmod_33xx_data.c
 create mode 100644 arch/arm/mach-omap2/powerdomain33xx.c
 create mode 100644 arch/arm/mach-omap2/powerdomains33xx_data.c
 create mode 100644 arch/arm/mach-omap2/prm-regbits-33xx.h
 create mode 100644 arch/arm/mach-omap2/prm33xx.h
 create mode 100644 arch/arm/mach-omap2/prminst33xx.c
 create mode 100644 arch/arm/mach-omap2/prminst33xx.h
 

[RFC PATCH 01/11] arm:omap:am33xx: Add voltage domain data

2011-11-20 Thread Vaibhav Hiremath
From: Afzal Mohammed af...@ti.com

Currently dummy voltage domain data is being created
in order to succeed boot process.
Nothing has been done w.r.t actual hardware (voltage control).

Signed-off-by: Afzal Mohammed af...@ti.com
Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 arch/arm/mach-omap2/voltage.h |1 +
 arch/arm/mach-omap2/voltagedomains33xx_data.c |   37 +
 2 files changed, 38 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-omap2/voltagedomains33xx_data.c

diff --git a/arch/arm/mach-omap2/voltage.h b/arch/arm/mach-omap2/voltage.h
index 16a1b09..a7c43c1 100644
--- a/arch/arm/mach-omap2/voltage.h
+++ b/arch/arm/mach-omap2/voltage.h
@@ -156,6 +156,7 @@ int omap_voltage_late_init(void);

 extern void omap2xxx_voltagedomains_init(void);
 extern void omap3xxx_voltagedomains_init(void);
+extern void am33xx_voltagedomains_init(void);
 extern void omap44xx_voltagedomains_init(void);

 struct voltagedomain *voltdm_lookup(const char *name);
diff --git a/arch/arm/mach-omap2/voltagedomains33xx_data.c 
b/arch/arm/mach-omap2/voltagedomains33xx_data.c
new file mode 100644
index 000..f8c817a
--- /dev/null
+++ b/arch/arm/mach-omap2/voltagedomains33xx_data.c
@@ -0,0 +1,37 @@
+/*
+ * AM33XX voltage domain data
+ *
+ * Copyright (C) 2011 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.
+ */
+#include linux/kernel.h
+#include linux/init.h
+
+#include voltage.h
+
+static struct voltagedomain am33xx_voltdm_mpu = {
+   .name = mpu,
+};
+
+static struct voltagedomain am33xx_voltdm_core = {
+   .name = core,
+};
+
+static struct voltagedomain am33xx_voltdm_rtc = {
+   .name = rtc,
+};
+
+static struct voltagedomain *voltagedomains_am33xx[] __initdata = {
+   am33xx_voltdm_mpu,
+   am33xx_voltdm_core,
+   am33xx_voltdm_rtc,
+   NULL,
+};
+
+void __init am33xx_voltagedomains_init(void)
+{
+   voltdm_init(voltagedomains_am33xx);
+}
--
1.7.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


[RFC PATCH 02/11] arm:omap:am33xx: Integrate voltage domain data

2011-11-20 Thread Vaibhav Hiremath
From: Afzal Mohammed af...@ti.com

Hook up AM33XX voltage domain info to OMAP framework.

Signed-off-by: Afzal Mohammed af...@ti.com
Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 arch/arm/mach-omap2/Makefile |2 ++
 arch/arm/mach-omap2/io.c |1 +
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index b33a85f..d4a9a61 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -95,6 +95,8 @@ obj-$(CONFIG_ARCH_OMAP2)  += 
$(voltagedomain-common) \
   voltagedomains2xxx_data.o
 obj-$(CONFIG_ARCH_OMAP3)   += $(voltagedomain-common) \
   voltagedomains3xxx_data.o
+obj-$(CONFIG_SOC_OMAPAM33XX)   += $(voltagedomain-common) \
+  voltagedomains33xx_data.o
 obj-$(CONFIG_ARCH_OMAP4)   += $(voltagedomain-common) \
   voltagedomains44xx_data.o

diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index e958c04..b67d2ca 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -465,6 +465,7 @@ void __init am33xx_init_early(void)
 {
omap2_set_globals_am33xx();
omap_common_init_early();
+   am33xx_voltagedomains_init();
omap3xxx_clk_init();
 }
 #endif
--
1.7.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


[RFC PATCH 06/11] arm:omap:am33xx: Integrate clock clockdomain to OMAP clock framework

2011-11-20 Thread Vaibhav Hiremath
From: Afzal Mohammed af...@ti.com

Hook up AM33XX clock  clock domain data to OMAP framework.

Signed-off-by: Afzal Mohammed af...@ti.com
Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 arch/arm/mach-omap2/Makefile   |4 +++-
 arch/arm/mach-omap2/clock3xxx_data.c   |5 +++--
 arch/arm/mach-omap2/clockdomain2xxx_3xxx.c |   18 --
 arch/arm/mach-omap2/io.c   |1 +
 4 files changed, 23 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index b5f20d2..19330dc 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -81,7 +81,7 @@ endif
 obj-$(CONFIG_ARCH_OMAP2)   += prcm.o cm2xxx_3xxx.o prm2xxx_3xxx.o
 obj-$(CONFIG_ARCH_OMAP3)   += prcm.o cm2xxx_3xxx.o prm2xxx_3xxx.o \
   vc3xxx_data.o vp3xxx_data.o
-obj-$(CONFIG_SOC_OMAPAM33XX)   += prminst33xx.o
+obj-$(CONFIG_SOC_OMAPAM33XX)   += prminst33xx.o cm33xx.o
 # XXX The presence of cm2xxx_3xxx.o on the line below is temporary and
 # will be removed once the OMAP4 part of the codebase is converted to
 # use OMAP4-specific PRCM functions.
@@ -127,6 +127,7 @@ obj-$(CONFIG_ARCH_OMAP3)+= clockdomain.o \
   clockdomain2xxx_3xxx.o \
   clockdomains2xxx_3xxx_data.o \
   clockdomains3xxx_data.o
+obj-$(CONFIG_SOC_OMAPAM33XX)   += clockdomains33xx_data.o
 obj-$(CONFIG_ARCH_OMAP4)   += clockdomain.o \
   clockdomain44xx.o \
   clockdomains44xx_data.o
@@ -145,6 +146,7 @@ obj-$(CONFIG_ARCH_OMAP3)+= $(clock-common) 
clock3xxx.o \
   clock3517.o clock36xx.o \
   dpll3xxx.o clock3xxx_data.o \
   clkt_iclk.o
+obj-$(CONFIG_SOC_OMAPAM33XX)   += clock33xx_data.o clock33xx.o
 obj-$(CONFIG_ARCH_OMAP4)   += $(clock-common) clock44xx_data.o \
   dpll3xxx.o dpll44xx.o

diff --git a/arch/arm/mach-omap2/clock3xxx_data.c 
b/arch/arm/mach-omap2/clock3xxx_data.c
index c1ab6bc..9fe72da 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -27,6 +27,7 @@
 #include clock34xx.h
 #include clock36xx.h
 #include clock3517.h
+#include clock33xx.h

 #include cm2xxx_3xxx.h
 #include cm-regbits-34xx.h
@@ -3518,8 +3519,8 @@ int __init omap3xxx_clk_init(void)
cpu_mask = RATE_IN_TI816X;
cpu_clkflg = CK_TI816X;
} else if (cpu_is_am33xx()) {
-   cpu_mask = RATE_IN_AM33XX;
-   cpu_clkflg = CK_AM33XX;
+   am33xx_clk_init();
+   return 0;
} else if (cpu_is_omap34xx()) {
if (omap_rev() == OMAP3430_REV_ES1_0) {
cpu_mask = RATE_IN_3430ES1;
diff --git a/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c 
b/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c
index a0d68db..edcab10 100644
--- a/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c
+++ b/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c
@@ -147,6 +147,9 @@ static void _enable_hwsup(struct clockdomain *clkdm)
if (cpu_is_omap24xx())
omap2xxx_cm_clkdm_enable_hwsup(clkdm-pwrdm.ptr-prcm_offs,
   clkdm-clktrctrl_mask);
+   else if (cpu_is_am33xx())
+   am33xx_cm_clkdm_enable_hwsup(clkdm-cm_inst, clkdm-clkdm_offs,
+  clkdm-clktrctrl_mask);
else if (cpu_is_omap34xx())
omap3xxx_cm_clkdm_enable_hwsup(clkdm-pwrdm.ptr-prcm_offs,
   clkdm-clktrctrl_mask);
@@ -157,6 +160,9 @@ static void _disable_hwsup(struct clockdomain *clkdm)
if (cpu_is_omap24xx())
omap2xxx_cm_clkdm_disable_hwsup(clkdm-pwrdm.ptr-prcm_offs,
clkdm-clktrctrl_mask);
+   else if (cpu_is_am33xx())
+   am33xx_cm_clkdm_disable_hwsup(clkdm-cm_inst, clkdm-clkdm_offs,
+  clkdm-clktrctrl_mask);
else if (cpu_is_omap34xx())
omap3xxx_cm_clkdm_disable_hwsup(clkdm-pwrdm.ptr-prcm_offs,
clkdm-clktrctrl_mask);
@@ -211,14 +217,22 @@ static int omap2_clkdm_clk_disable(struct clockdomain 
*clkdm)

 static int omap3_clkdm_sleep(struct clockdomain *clkdm)
 {
-   omap3xxx_cm_clkdm_force_sleep(clkdm-pwrdm.ptr-prcm_offs,
+   if (cpu_is_am33xx())
+   am33xx_cm_clkdm_force_sleep(clkdm-cm_inst, clkdm-clkdm_offs,
+   clkdm-clktrctrl_mask);
+   else
+   

[RFC PATCH 03/11] arm:omap:am33xx: Add power domain data

2011-11-20 Thread Vaibhav Hiremath
From: Afzal Mohammed af...@ti.com

This patch adds AM33XX power domain data,
corresponding API's to access PRM module and
PRM register offsets  bit fields.

Signed-off-by: Rachna Patil rac...@ti.com
Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
Signed-off-by: Afzal Mohammed af...@ti.com
---
 arch/arm/mach-omap2/powerdomain.h   |4 +-
 arch/arm/mach-omap2/powerdomain33xx.c   |  155 
 arch/arm/mach-omap2/powerdomains33xx_data.c |  115 +
 arch/arm/mach-omap2/prm-regbits-33xx.h  |  357 +++
 arch/arm/mach-omap2/prm33xx.h   |  123 +
 arch/arm/mach-omap2/prminst33xx.c   |   74 ++
 arch/arm/mach-omap2/prminst33xx.h   |   25 ++
 7 files changed, 852 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/mach-omap2/powerdomain33xx.c
 create mode 100644 arch/arm/mach-omap2/powerdomains33xx_data.c
 create mode 100644 arch/arm/mach-omap2/prm-regbits-33xx.h
 create mode 100644 arch/arm/mach-omap2/prm33xx.h
 create mode 100644 arch/arm/mach-omap2/prminst33xx.c
 create mode 100644 arch/arm/mach-omap2/prminst33xx.h

diff --git a/arch/arm/mach-omap2/powerdomain.h 
b/arch/arm/mach-omap2/powerdomain.h
index 0d72a8a..9efa823 100644
--- a/arch/arm/mach-omap2/powerdomain.h
+++ b/arch/arm/mach-omap2/powerdomain.h
@@ -69,7 +69,7 @@
  * Maximum number of clockdomains that can be associated with a powerdomain.
  * CORE powerdomain on OMAP4 is the worst case
  */
-#define PWRDM_MAX_CLKDMS   9
+#define PWRDM_MAX_CLKDMS   11

 /* XXX A completely arbitrary number. What is reasonable here? */
 #define PWRDM_TRANSITION_BAILOUT 10
@@ -223,10 +223,12 @@ bool pwrdm_can_ever_lose_context(struct powerdomain 
*pwrdm);
 extern void omap242x_powerdomains_init(void);
 extern void omap243x_powerdomains_init(void);
 extern void omap3xxx_powerdomains_init(void);
+extern void am33xx_powerdomains_init(void);
 extern void omap44xx_powerdomains_init(void);

 extern struct pwrdm_ops omap2_pwrdm_operations;
 extern struct pwrdm_ops omap3_pwrdm_operations;
+extern struct pwrdm_ops am33xx_pwrdm_operations;
 extern struct pwrdm_ops omap4_pwrdm_operations;

 /* Common Internal functions used across OMAP rev's */
diff --git a/arch/arm/mach-omap2/powerdomain33xx.c 
b/arch/arm/mach-omap2/powerdomain33xx.c
new file mode 100644
index 000..80bfd42
--- /dev/null
+++ b/arch/arm/mach-omap2/powerdomain33xx.c
@@ -0,0 +1,155 @@
+/*
+ * AM33XX Powerdomain control
+ *
+ * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * 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 version 2.
+ *
+ * This program is distributed as is WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include linux/io.h
+#include linux/errno.h
+#include linux/delay.h
+
+#include plat/prcm.h
+
+#include powerdomain.h
+#include prm33xx.h
+#include prm-regbits-33xx.h
+#include prminst33xx.h
+
+
+static int am33xx_pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
+{
+   am33xx_prminst_rmw_inst_reg_bits(OMAP_POWERSTATE_MASK,
+   (pwrst  OMAP_POWERSTATE_SHIFT),
+   pwrdm-prcm_offs, AM33XX_PM_PWSTCTRL);
+   return 0;
+}
+
+static int am33xx_pwrdm_read_next_pwrst(struct powerdomain *pwrdm)
+{
+   u32 v;
+
+   v = am33xx_prminst_read_inst_reg(pwrdm-prcm_offs, AM33XX_PM_PWSTCTRL);
+   v = OMAP_POWERSTATE_MASK;
+   v = OMAP_POWERSTATE_SHIFT;
+
+   return v;
+}
+
+static int am33xx_pwrdm_read_pwrst(struct powerdomain *pwrdm)
+{
+   u32 v;
+
+   v = am33xx_prminst_read_inst_reg(pwrdm-prcm_offs, AM33XX_PM_PWSTST);
+   v = OMAP_POWERSTATEST_MASK;
+   v = OMAP_POWERSTATEST_SHIFT;
+
+   return v;
+}
+
+static int am33xx_pwrdm_read_prev_pwrst(struct powerdomain *pwrdm)
+{
+   u32 v;
+
+   v = am33xx_prminst_read_inst_reg(pwrdm-prcm_offs, AM33XX_PM_PWSTST);
+   v = AM33XX_LASTPOWERSTATEENTERED_MASK;
+   v = AM33XX_LASTPOWERSTATEENTERED_SHIFT;
+
+   return v;
+}
+
+static int am33xx_pwrdm_set_lowpwrstchange(struct powerdomain *pwrdm)
+{
+   am33xx_prminst_rmw_inst_reg_bits(AM33XX_LOWPOWERSTATECHANGE_MASK,
+   (1  AM33XX_LOWPOWERSTATECHANGE_SHIFT),
+   pwrdm-prcm_offs, AM33XX_PM_PWSTCTRL);
+   return 0;
+}
+
+static int am33xx_pwrdm_clear_all_prev_pwrst(struct powerdomain *pwrdm)
+{
+   am33xx_prminst_rmw_inst_reg_bits(AM33XX_LASTPOWERSTATEENTERED_MASK,
+   AM33XX_LASTPOWERSTATEENTERED_MASK,
+   pwrdm-prcm_offs, AM33XX_PM_PWSTST);
+   return 0;
+}
+
+static int am33xx_pwrdm_set_logic_retst(struct powerdomain *pwrdm, u8 pwrst)
+{
+   

[RFC PATCH 04/11] arm:omap:am33xx: Integrate powerdomain to OMAP power framework

2011-11-20 Thread Vaibhav Hiremath
From: Afzal Mohammed af...@ti.com

Hook up AM33XX power domain to OMAP framework.

Signed-off-by: Afzal Mohammed af...@ti.com
Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 arch/arm/mach-omap2/Makefile |3 +++
 arch/arm/mach-omap2/io.c |1 +
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index d4a9a61..b5f20d2 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -81,6 +81,7 @@ endif
 obj-$(CONFIG_ARCH_OMAP2)   += prcm.o cm2xxx_3xxx.o prm2xxx_3xxx.o
 obj-$(CONFIG_ARCH_OMAP3)   += prcm.o cm2xxx_3xxx.o prm2xxx_3xxx.o \
   vc3xxx_data.o vp3xxx_data.o
+obj-$(CONFIG_SOC_OMAPAM33XX)   += prminst33xx.o
 # XXX The presence of cm2xxx_3xxx.o on the line below is temporary and
 # will be removed once the OMAP4 part of the codebase is converted to
 # use OMAP4-specific PRCM functions.
@@ -110,6 +111,8 @@ obj-$(CONFIG_ARCH_OMAP3)+= 
$(powerdomain-common) \
   powerdomain2xxx_3xxx.o \
   powerdomains3xxx_data.o \
   powerdomains2xxx_3xxx_data.o
+obj-$(CONFIG_SOC_OMAPAM33XX)   += powerdomain33xx.o \
+  powerdomains33xx_data.o
 obj-$(CONFIG_ARCH_OMAP4)   += $(powerdomain-common) \
   powerdomain44xx.o \
   powerdomains44xx_data.o
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index b67d2ca..7ea23d8 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -466,6 +466,7 @@ void __init am33xx_init_early(void)
omap2_set_globals_am33xx();
omap_common_init_early();
am33xx_voltagedomains_init();
+   am33xx_powerdomains_init();
omap3xxx_clk_init();
 }
 #endif
--
1.7.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


[RFC PATCH 09/11] arm:omap:am33xx: Integrate AM33XX hwmods to omap HWMOD framework

2011-11-20 Thread Vaibhav Hiremath
Hook up AM33XX HWMOD data to OMAP framework.

Signed-off-by: Afzal Mohammed af...@ti.com
Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 arch/arm/mach-omap2/Makefile |1 +
 arch/arm/mach-omap2/io.c |2 ++
 arch/arm/mach-omap2/omap_hwmod.c |   13 +
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 19330dc..706a8ef 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -168,6 +168,7 @@ obj-$(CONFIG_SOC_OMAP2430)  += 
omap_hwmod_2xxx_ipblock_data.o \
 obj-$(CONFIG_ARCH_OMAP3)   += omap_hwmod_2xxx_3xxx_ipblock_data.o \
   
omap_hwmod_2xxx_3xxx_interconnect_data.o \
   omap_hwmod_3xxx_data.o
+obj-$(CONFIG_SOC_OMAPAM33XX)   += omap_hwmod_33xx_data.o
 obj-$(CONFIG_ARCH_OMAP4)   += omap_hwmod_44xx_data.o

 # EMU peripherals
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 82e2817..3afe4e6 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -468,6 +468,8 @@ void __init am33xx_init_early(void)
am33xx_voltagedomains_init();
am33xx_powerdomains_init();
am33xx_clockdomains_init();
+   am33xx_hwmod_init();
+   omap_hwmod_init_postsetup();
omap3xxx_clk_init();
 }
 #endif
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 6b3088d..dfd3743 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -1051,7 +1051,7 @@ static struct omap_hwmod *_lookup(const char *name)
  */
 static int _init_clkdm(struct omap_hwmod *oh)
 {
-   if (cpu_is_omap24xx() || cpu_is_omap34xx())
+   if (cpu_is_omap24xx() || (cpu_is_omap34xx()  !cpu_is_am33xx()))
return 0;

if (!oh-clkdm_name) {
@@ -1134,9 +1134,14 @@ static int _wait_target_ready(struct omap_hwmod *oh)
/* XXX check clock enable states */

if (cpu_is_omap24xx() || cpu_is_omap34xx()) {
-   ret = omap2_cm_wait_module_ready(oh-prcm.omap2.module_offs,
-oh-prcm.omap2.idlest_reg_id,
-
oh-prcm.omap2.idlest_idle_bit);
+   if (cpu_is_am33xx())
+   ret = am33xx_cm_wait_module_ready(oh-clkdm-cm_inst,
+   oh-prcm.omap4.clkctrl_offs);
+   else
+   ret = omap2_cm_wait_module_ready(
+   oh-prcm.omap2.module_offs,
+   oh-prcm.omap2.idlest_reg_id,
+   oh-prcm.omap2.idlest_idle_bit);
} else if (cpu_is_omap44xx()) {
if (!oh-clkdm)
return -EINVAL;
--
1.7.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


[RFC PATCH 07/11] arm:omap:am33xx: Add irq, dma and module base addr to SoC header files

2011-11-20 Thread Vaibhav Hiremath
This patch creats seperate irq and dma defination header file
and updates the module base addresses required for HWMOD data.

Signed-off-by: Afzal Mohammed af...@ti.com
Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 arch/arm/plat-omap/include/plat/am33xx.h|   40 
 arch/arm/plat-omap/include/plat/dma-33xx.h  |   85 
 arch/arm/plat-omap/include/plat/dma.h   |1 +
 arch/arm/plat-omap/include/plat/irqs-33xx.h |  143 +++
 arch/arm/plat-omap/include/plat/irqs.h  |1 +
 arch/arm/plat-omap/include/plat/serial.h|5 +
 6 files changed, 275 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/plat-omap/include/plat/dma-33xx.h
 create mode 100644 arch/arm/plat-omap/include/plat/irqs-33xx.h

diff --git a/arch/arm/plat-omap/include/plat/am33xx.h 
b/arch/arm/plat-omap/include/plat/am33xx.h
index 06c19bb..1162d82 100644
--- a/arch/arm/plat-omap/include/plat/am33xx.h
+++ b/arch/arm/plat-omap/include/plat/am33xx.h
@@ -22,4 +22,44 @@
 #define AM33XX_CTRL_BASE   AM33XX_SCM_BASE
 #define AM33XX_PRCM_BASE   0x44E0

+#define AM33XX_GPIO0_BASE  0x44E07000
+#define AM33XX_GPIO1_BASE  0x4804C000
+#define AM33XX_GPIO2_BASE  0x481AC000
+#define AM33XX_GPIO3_BASE  0x481AE000
+
+#define AM33XX_TIMER0_BASE 0x44E05000
+#define AM33XX_TIMER1_BASE 0x44E31000
+#define AM33XX_TIMER2_BASE 0x4804
+#define AM33XX_TIMER3_BASE 0x48042000
+#define AM33XX_TIMER4_BASE 0x48044000
+#define AM33XX_TIMER5_BASE 0x48046000
+#define AM33XX_TIMER6_BASE 0x48048000
+#define AM33XX_TIMER7_BASE 0x4804A000
+
+#define AM33XX_WDT1_BASE   0x44E35000
+
+#define AM33XX_TSC_BASE0x44E0D000
+#define AM33XX_RTC_BASE0x44E3E000
+
+#define AM33XX_ASP0_BASE   0x48038000
+#define AM33XX_ASP1_BASE   0x4803C000
+
+#define AM33XX_MMC0_BASE   0x48060100
+#define AM33XX_MMC1_BASE   0x481D8100
+#define AM33XX_MMC2_BASE   0x47810100
+
+#define AM33XX_I2C0_BASE   0x44E0B000
+#define AM33XX_I2C1_BASE   0x4802A000
+#define AM33XX_I2C2_BASE   0x4819C000
+
+#define AM33XX_SPI0_BASE   0x4803
+#define AM33XX_SPI1_BASE   0x481A
+
+#define AM33XX_DCAN0_BASE  0x481CC000
+#define AM33XX_DCAN1_BASE  0x481D
+
+#define AM33XX_USBSS_BASE  0x4740
+#define AM33XX_USB0_BASE   0x47401000
+#define AM33XX_USB1_BASE   0x47401800
+
 #endif /* __ASM_ARCH_AM33XX_H */
diff --git a/arch/arm/plat-omap/include/plat/dma-33xx.h 
b/arch/arm/plat-omap/include/plat/dma-33xx.h
new file mode 100644
index 000..f78edb4
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/dma-33xx.h
@@ -0,0 +1,85 @@
+/*
+ * AM33XX SDMA channel definitions
+ *
+ * This file is automatically generated from the AM33XX hardware databases.
+ *
+ * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * 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 version 2.
+ *
+ * This program is distributed as is WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __ARCH_ARM_MACH_OMAP2_AM33XX_DMA_H
+#define __ARCH_ARM_MACH_OMAP2_AM33XX_DMA_H
+
+
+#define AM33XX_DMA_ICSS0_7 0
+#define AM33XX_DMA_ICSS0_6 1
+#define AM33XX_DMA_MMCHS1_W2
+#define AM33XX_DMA_MMCHS1_R3
+#define AM33XX_DMA_AESEIP36T0_CTXIN4
+#define AM33XX_DMA_AESEIP36T0_DIN  5
+#define AM33XX_DMA_AESEIP36T0_DOUT 6
+#define AM33XX_DMA_AESEIP36T0_CTXOUT   7
+#define AM33XX_DMA_MCASP0_X8
+#define AM33XX_DMA_MCASP0_R9
+#define AM33XX_DMA_MCASP1_X10
+#define AM33XX_DMA_MCASP1_R11
+#define AM33XX_DMA_MCASP2_X12
+#define AM33XX_DMA_MCASP2_R13
+#define AM33XX_DMA_PWMSS0_EPWM 14
+#define AM33XX_DMA_PWMSS1_EPWM 15
+#define AM33XX_DMA_SPIOCP0_CH0W16
+#define AM33XX_DMA_SPIOCP0_CH0R17
+#define AM33XX_DMA_SPIOCP0_CH1W18
+#define AM33XX_DMA_SPIOCP0_CH1R19
+#define AM33XX_DMA_SPIOCP3_CH1W20
+#define AM33XX_DMA_SPIOCP3_CH1R21
+#define AM33XX_DMA_GPIO22
+#define AM33XX_DMA_GPIO1   23
+#define AM33XX_DMA_MMCHS0_W24
+#define AM33XX_DMA_MMCHS0_R 

[RFC PATCH 11/11] arm:omap:am33xx: Add am335x support in generic omap_hwmod

2011-11-20 Thread Vaibhav Hiremath
AM335X is bit different than OMAP3/4 architecture when it comes to
PRCM module, for example, the way module is enabled/disabled.
Although it is closer to OMAP4 architecure but the register offset
and PRCM partitions won't match, so we need to seperate API's
for AM335X.

Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 arch/arm/mach-omap2/omap_hwmod.c |   29 +++--
 1 files changed, 23 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index dfd3743..4360cb7 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -147,6 +147,7 @@

 #include cm2xxx_3xxx.h
 #include cminst44xx.h
+#include cminst33xx.h
 #include prm2xxx_3xxx.h
 #include prm44xx.h
 #include prminst44xx.h
@@ -689,7 +690,7 @@ static void _disable_optional_clocks(struct omap_hwmod *oh)
 static void _enable_module(struct omap_hwmod *oh)
 {
/* The module mode does not exist prior OMAP4 */
-   if (cpu_is_omap24xx() || cpu_is_omap34xx())
+   if (!cpu_is_am33xx()  (cpu_is_omap24xx() || cpu_is_omap34xx()))
return;

if (!oh-clkdm || !oh-prcm.omap4.modulemode)
@@ -698,7 +699,13 @@ static void _enable_module(struct omap_hwmod *oh)
pr_debug(omap_hwmod: %s: _enable_module: %d\n,
 oh-name, oh-prcm.omap4.modulemode);

-   omap4_cminst_module_enable(oh-prcm.omap4.modulemode,
+   if (cpu_is_am33xx())
+   am33xx_cminst_module_enable(oh-prcm.omap4.modulemode,
+  oh-clkdm-cm_inst,
+  oh-clkdm-clkdm_offs,
+  oh-prcm.omap4.clkctrl_offs);
+   else
+   omap4_cminst_module_enable(oh-prcm.omap4.modulemode,
   oh-clkdm-prcm_partition,
   oh-clkdm-cm_inst,
   oh-clkdm-clkdm_offs,
@@ -715,7 +722,7 @@ static void _enable_module(struct omap_hwmod *oh)
 static void _disable_module(struct omap_hwmod *oh)
 {
/* The module mode does not exist prior OMAP4 */
-   if (cpu_is_omap24xx() || cpu_is_omap34xx())
+   if (!cpu_is_am33xx()  (cpu_is_omap24xx() || cpu_is_omap34xx()))
return;

if (!oh-clkdm || !oh-prcm.omap4.modulemode)
@@ -723,7 +730,12 @@ static void _disable_module(struct omap_hwmod *oh)

pr_debug(omap_hwmod: %s: _disable_module\n, oh-name);

-   omap4_cminst_module_disable(oh-clkdm-prcm_partition,
+   if (cpu_is_am33xx())
+   am33xx_cminst_module_disable(oh-clkdm-cm_inst,
+   oh-clkdm-clkdm_offs,
+   oh-prcm.omap4.clkctrl_offs);
+   else
+   omap4_cminst_module_disable(oh-clkdm-prcm_partition,
oh-clkdm-cm_inst,
oh-clkdm-clkdm_offs,
oh-prcm.omap4.clkctrl_offs);
@@ -1169,7 +1181,7 @@ static int _wait_target_ready(struct omap_hwmod *oh)
 static int _wait_target_disable(struct omap_hwmod *oh)
 {
/* TODO: For now just handle OMAP4+ */
-   if (cpu_is_omap24xx() || cpu_is_omap34xx())
+   if (!cpu_is_am33xx()  (cpu_is_omap24xx() || cpu_is_omap34xx()))
return 0;

if (!oh)
@@ -1181,7 +1193,12 @@ static int _wait_target_disable(struct omap_hwmod *oh)
if (oh-flags  HWMOD_NO_IDLEST)
return 0;

-   return omap4_cminst_wait_module_idle(oh-clkdm-prcm_partition,
+   if (cpu_is_am33xx())
+   return am33xx_cminst_wait_module_idle(oh-clkdm-cm_inst,
+oh-clkdm-clkdm_offs,
+oh-prcm.omap4.clkctrl_offs);
+   else
+   return omap4_cminst_wait_module_idle(oh-clkdm-prcm_partition,
 oh-clkdm-cm_inst,
 oh-clkdm-clkdm_offs,
 oh-prcm.omap4.clkctrl_offs);
--
1.7.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


[RFC PATCH 10/11] ARM:omap:am33xx: Add clock control api's

2011-11-20 Thread Vaibhav Hiremath
Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
Signed-off-by: Afzal Mohammed af...@ti.com
---
 arch/arm/mach-omap2/Makefile |3 +-
 arch/arm/mach-omap2/cminst33xx.c |  311 ++
 arch/arm/mach-omap2/cminst33xx.h |   63 
 3 files changed, 376 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/mach-omap2/cminst33xx.c
 create mode 100644 arch/arm/mach-omap2/cminst33xx.h

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 706a8ef..784428a 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -81,7 +81,8 @@ endif
 obj-$(CONFIG_ARCH_OMAP2)   += prcm.o cm2xxx_3xxx.o prm2xxx_3xxx.o
 obj-$(CONFIG_ARCH_OMAP3)   += prcm.o cm2xxx_3xxx.o prm2xxx_3xxx.o \
   vc3xxx_data.o vp3xxx_data.o
-obj-$(CONFIG_SOC_OMAPAM33XX)   += prminst33xx.o cm33xx.o
+obj-$(CONFIG_SOC_OMAPAM33XX)   += cminst33xx.o prminst33xx.o cm33xx.o
+
 # XXX The presence of cm2xxx_3xxx.o on the line below is temporary and
 # will be removed once the OMAP4 part of the codebase is converted to
 # use OMAP4-specific PRCM functions.
diff --git a/arch/arm/mach-omap2/cminst33xx.c b/arch/arm/mach-omap2/cminst33xx.c
new file mode 100644
index 000..e534350
--- /dev/null
+++ b/arch/arm/mach-omap2/cminst33xx.c
@@ -0,0 +1,311 @@
+/*
+ * AM33XX CM instance functions
+ *
+ * Copyright (C) 2011 Texas Instruments, Inc.
+ * Vaibhav Hiremath hvaib...@ti.com
+ *
+ * Reference taken from from OMAP4
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include linux/kernel.h
+#include linux/types.h
+#include linux/errno.h
+#include linux/err.h
+#include linux/io.h
+
+#include plat/common.h
+
+#include cm.h
+#include cm33xx.h
+#include cminst33xx.h
+#include cm-regbits-34xx.h
+#include cm-regbits-33xx.h
+#include prm33xx.h
+
+/*
+ * CLKCTRL_IDLEST_*: possible values for the CM_*_CLKCTRL.IDLEST bitfield:
+ *
+ *   0x0 func: Module is fully functional, including OCP
+ *   0x1 trans:Module is performing transition: wakeup, or sleep, or sleep
+ * abortion
+ *   0x2 idle: Module is in Idle mode (only OCP part). It is functional if
+ * using separate functional clock
+ *   0x3 disabled: Module is disabled and cannot be accessed
+ *
+ */
+#define CLKCTRL_IDLEST_FUNCTIONAL  0x0
+#define CLKCTRL_IDLEST_INTRANSITION0x1
+#define CLKCTRL_IDLEST_INTERFACE_IDLE  0x2
+#define CLKCTRL_IDLEST_DISABLED0x3
+
+/* Private functions */
+
+/**
+ * _clkctrl_idlest - read a CM_*_CLKCTRL register; mask  shift IDLEST bitfield
+ * @inst: CM instance register offset (*_INST macro)
+ * @cdoffs: Clockdomain register offset (*_CDOFFS macro)
+ * @clkctrl_offs: Module clock control register offset (*_CLKCTRL macro)
+ *
+ * Return the IDLEST bitfield of a CM_*_CLKCTRL register, shifted down to
+ * bit 0.
+ */
+static u32 _clkctrl_idlest(u16 inst, s16 cdoffs, u16 clkctrl_offs)
+{
+   u32 v = am33xx_cminst_read_inst_reg(inst, clkctrl_offs);
+   v = AM33XX_IDLEST_MASK;
+   v = AM33XX_IDLEST_SHIFT;
+   return v;
+}
+
+/**
+ * _is_module_ready - can module registers be accessed without causing an 
abort?
+ * @inst: CM instance register offset (*_INST macro)
+ * @cdoffs: Clockdomain register offset (*_CDOFFS macro)
+ * @clkctrl_offs: Module clock control register offset (*_CLKCTRL macro)
+ *
+ * Returns true if the module's CM_*_CLKCTRL.IDLEST bitfield is either
+ * *FUNCTIONAL or *INTERFACE_IDLE; false otherwise.
+ */
+static bool _is_module_ready(u16 inst, s16 cdoffs, u16 clkctrl_offs)
+{
+   u32 v;
+
+   v = _clkctrl_idlest(inst, cdoffs, clkctrl_offs);
+
+   return (v == CLKCTRL_IDLEST_FUNCTIONAL ||
+   v == CLKCTRL_IDLEST_INTERFACE_IDLE) ? true : false;
+}
+
+/* Public functions */
+
+/* Read a register in a CM instance */
+u32 am33xx_cminst_read_inst_reg(s16 inst, u16 idx)
+{
+   return __raw_readl(cm_base + inst + idx);
+}
+
+/* Write into a register in a CM instance */
+void am33xx_cminst_write_inst_reg(u32 val, s16 inst, u16 idx)
+{
+   __raw_writel(val, cm_base + inst + idx);
+}
+
+/* Read-modify-write a register in CM1. Caller must lock */
+u32 am33xx_cminst_rmw_inst_reg_bits(u32 mask, u32 bits, s16 inst, s16 idx)
+{
+   u32 v;
+
+   v = am33xx_cminst_read_inst_reg(inst, idx);
+   v = ~mask;
+   v |= bits;
+   am33xx_cminst_write_inst_reg(v, inst, idx);
+
+   return v;
+}
+
+u32 am33xx_cminst_set_inst_reg_bits(u32 bits, s16 inst, s16 idx)
+{
+   return am33xx_cminst_rmw_inst_reg_bits(bits, bits, inst, idx);
+}
+
+u32 am33xx_cminst_clear_inst_reg_bits(u32 bits, s16 inst, s16 idx)
+{
+   return am33xx_cminst_rmw_inst_reg_bits(bits, 0x0, inst, idx);
+}
+
+u32 am33xx_cminst_read_inst_reg_bits(u16 

Re: [PATCH 2/4] omap_dss: add FocalTech ETM070003DH6 display support

2011-11-20 Thread Ilya Yanok
Hi Tomi,

On 17.11.2011 14:26, Tomi Valkeinen wrote:
 +.acbi   = 0x0,
 +.acb= 0x28,
 
 You could just remove .acbi and .acb, I don't think they are needed.

You are right.

 +.config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS |
 +  OMAP_DSS_LCD_IHS,
 +.power_on_delay = 50,
 +.power_off_delay= 100,
 
 Did you check from the panel spec if any delays are needed? These look
 like just copied from the Sharp panel data.

Actually they were copied from some vendor code, but you are right
again, I can't see anything concerning the delays in the panel spec and
panel works ok with the delays thrown out.

Regards, Ilya.
--
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 V2] omap_dss: add FocalTech ETM070003DH6 display support

2011-11-20 Thread Ilya Yanok
Add data for the FocalTech ETM070003DH6 display to the generic_dpi_panel
display driver.

Signed-off-by: Ilya Yanok ya...@emcraft.com
---
Changes from V1:
 - acb, acbi, power_on_delay and power_off_delay fields removed.

 drivers/video/omap2/displays/panel-generic-dpi.c |   20 
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/drivers/video/omap2/displays/panel-generic-dpi.c 
b/drivers/video/omap2/displays/panel-generic-dpi.c
index 519c47d..593f831 100644
--- a/drivers/video/omap2/displays/panel-generic-dpi.c
+++ b/drivers/video/omap2/displays/panel-generic-dpi.c
@@ -297,6 +297,26 @@ static struct panel_config generic_dpi_panels[] = {
 
.name   = apollon,
},
+   /* FocalTech ETM070003DH6 */
+   {
+   {
+   .x_res  = 800,
+   .y_res  = 480,
+
+   .pixel_clock= 28000,
+
+   .hsw= 48,
+   .hfp= 40,
+   .hbp= 40,
+
+   .vsw= 3,
+   .vfp= 13,
+   .vbp= 29,
+   },
+   .config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS |
+ OMAP_DSS_LCD_IHS,
+   .name   = focaltech_etm070003dh6,
+   },
 };
 
 struct panel_drv_data {
-- 
1.7.6.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


Re: omap_hsmmc noisy/broken for suspend resume

2011-11-20 Thread Girish K S
On 19 November 2011 01:13, Kevin Hilman khil...@deeprootsystems.com wrote:
 Hello Girish,

 On 11/03/2011 09:21 PM, Girish K S wrote:
 On 3 November 2011 17:24, Kevin Hilman khil...@ti.com wrote:
 Hello,

 Using Linus' master branch, I was testing PM functionality on OMAP3/4
 and noticed that the MMC driver is now rather noisy during suspend on
 OMAP3[1], but seems to work.


 [...]

 / # echo mem  /sys/power/state
 [  811.145507] PM: Syncing filesystems ... done.
 [  811.150268] PM: Preparing system for mem sleep
 [  811.155059] Freezing user space processes ... (elapsed 0.01 seconds) 
 done.
 [  811.179992] Freezing remaining freezable tasks ... (elapsed 0.01 
 seconds) done.
 [  811.203460] PM: Entering mem sleep
 [  811.207489] Suspending console(s) (use no_console_suspend to debug)
 a[  811.225860] [ cut here ]
 [  811.225891] WARNING: at /work/kernel/omap/pm/drivers/mmc/core/core.c:453 
 mmc_wait_for_cmd+0x78/0x84()
 [  811.225921] Modules linked in:
 [  811.225952] [c001a810] (unwind_backtrace+0x0/0xf0) from [c00525d0] 
 (warn_slowpath_common+0x4c/0x64)
 [  811.225982] [c00525d0] (warn_slowpath_common+0x4c/0x64) from 
 [c0052604] (warn_slowpath_null+0x1c/0x24)
 [  811.226013] [c0052604] (warn_slowpath_null+0x1c/0x24) from 
 [c033a494] (mmc_wait_for_cmd+0x78/0x84)
 [  811.226043] [c033a494] (mmc_wait_for_cmd+0x78/0x84) from [c033e7b8] 
 (mmc_switch+0x74/0x118)
 [  811.226074] [c033e7b8] (mmc_switch+0x74/0x118) from [c033b034] 
 (mmc_power_off+0xd8/0x108)

 The problem is caused by the card-poweroff_notify_state =
 MMC_POWERED_ON; statement in the mmc_card_init function
 it is set for the non eMMC4.5 devices. I will rectify this and soon
 send a patch for the same.

 Is this the patch that fixes this issue:

        http://article.gmane.org/gmane.linux.kernel.mmc/10961

 I found this by digging (since I'm not subscribed to linux-mmc), but it
 would've been much more efficient if you Cc the original lists where the
 issue was reported, and especially the person reporting the bug so it
 can be tested by those reporting the problem.
 Did you mention in your first mail? You are not subscribed in the list.
 I tested the above patch and verified it gets rid of all the noise in
 the OMAP HS-MMC driver.

 Chris, I see this is already in mmc-next.  Feel free to add:

 Tested-by: Kevin Hilman khil...@ti.com

 If you like.

 Thanks,

 Kevin

--
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 v2] ARM: OMAP2+: hwmod: Add a new state to handle hwmods left enabled at init

2011-11-20 Thread Rajendra Nayak
An hwmod with a 'HWMOD_INIT_NO_IDLE' flag set, is left in
enabled state by the hwmod framework post the initial setup.
Once a real user of the device (a driver) tries to enable it
at a later point, the hwmod framework throws a WARN() about
the device being already in enabled state.

Fix this by introducing a new state '_HWMOD_STATE_ENABLED_AT_INIT'
to identify such devices/hwmods, so nothing but just a state
change to '_HWMOD_STATE_ENABLED' can be done when the device/hwmod
is requested to be enabled (the first time) by its driver/user.

A good example of a such a device is an UART used as debug console.
The UART module needs to be kept enabled through the boot, until the
UART driver takes control of it, for debug prints to appear on
the console.

Acked-by: Kevin Hilman khil...@ti.com
Acked-by: Benoit Cousson b-cous...@ti.com
Signed-off-by: Rajendra Nayak rna...@ti.com
---
changes in v2:
Fixed minor typos, removed stay change, updated comment
in header.

 arch/arm/mach-omap2/omap_hwmod.c |   15 ++-
 arch/arm/plat-omap/include/plat/omap_hwmod.h |6 ++
 2 files changed, 20 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 6b3088d..72ee723 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -1441,6 +1441,17 @@ static int _enable(struct omap_hwmod *oh)
 
pr_debug(omap_hwmod: %s: enabling\n, oh-name);
 
+   /*
+* hwmods' with HWMOD_INIT_NO_IDLE flag set, are left
+* in enabled state at init.
+* Now that someone is really trying to enable them,
+* just update the state.
+*/
+   if (oh-_state == _HWMOD_STATE_ENABLED_AT_INIT) {
+   oh-_state = _HWMOD_STATE_ENABLED;
+   return 0;
+   }
+
if (oh-_state != _HWMOD_STATE_INITIALIZED 
oh-_state != _HWMOD_STATE_IDLE 
oh-_state != _HWMOD_STATE_DISABLED) {
@@ -1744,8 +1755,10 @@ static int _setup(struct omap_hwmod *oh, void *data)
 * it should be set by the core code as a runtime flag during startup
 */
if ((oh-flags  HWMOD_INIT_NO_IDLE) 
-   (postsetup_state == _HWMOD_STATE_IDLE))
+   (postsetup_state == _HWMOD_STATE_IDLE)) {
+   oh-_state = _HWMOD_STATE_ENABLED_AT_INIT;
postsetup_state = _HWMOD_STATE_ENABLED;
+   }
 
if (postsetup_state == _HWMOD_STATE_IDLE)
_idle(oh);
diff --git a/arch/arm/plat-omap/include/plat/omap_hwmod.h 
b/arch/arm/plat-omap/include/plat/omap_hwmod.h
index 8b372ed..2bd3929 100644
--- a/arch/arm/plat-omap/include/plat/omap_hwmod.h
+++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h
@@ -436,6 +436,12 @@ struct omap_hwmod_omap4_prcm {
 #define _HWMOD_STATE_ENABLED   4
 #define _HWMOD_STATE_IDLE  5
 #define _HWMOD_STATE_DISABLED  6
+/*
+ * This state signifies the hwmod was left enabled
+ * after init, by the framework, because of the
+ * 'HWMOD_INIT_NO_IDLE' flag.
+ */
+#define _HWMOD_STATE_ENABLED_AT_INIT   7
 
 /**
  * struct omap_hwmod_class - the type of an IP block
-- 
1.7.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


[PATCH v2] OMAP: I2C: Fix the interrupt clearing in OMAP4

2011-11-20 Thread Shubhrajyoti D
For OMAP4 Interrupt enable register is a legacy register.
To clear the interrupts we were writing 0 to it. However on OMAP4
we were writing 1 to  IRQENABLE_CLR which clears only the arbitration
lost interrupt. The patch intends to fix the same by writing 1
to all the bits.

Signed-off-by: Shubhrajyoti D shubhrajy...@ti.com
---
 drivers/i2c/busses/i2c-omap.c |   15 ++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index 2dfb631..bf4376f 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -167,6 +167,10 @@ enum {
 #define SYSC_IDLEMODE_SMART0x2
 #define SYSC_CLOCKACTIVITY_FCLK0x2
 
+
+/* Mask to clear all the interrupts */
+#define OMAP_I2C_IRQENABLE_CLR_ALL 0x6FFF
+
 /* Errata definitions */
 #define I2C_OMAP_ERRATA_I207   (1  0)
 #define I2C_OMAP3_1P153(1  1)
@@ -308,8 +312,17 @@ static void omap_i2c_idle(struct omap_i2c_dev *dev)
pdata = pdev-dev.platform_data;
 
dev-iestate = omap_i2c_read_reg(dev, OMAP_I2C_IE_REG);
+
+   /*
+* The Interrupt enable register is a legacy register for OMAP4.
+* However to clear all the interrupts we could write 0 to Interrupt
+* enable reg  or  should write 1 to all the bits of the
+* I2C_IRQENABLE_CLR register.
+*/
+
if (dev-rev = OMAP_I2C_REV_ON_4430)
-   omap_i2c_write_reg(dev, OMAP_I2C_IRQENABLE_CLR, 1);
+   omap_i2c_write_reg(dev, OMAP_I2C_IRQENABLE_CLR,
+   OMAP_I2C_IRQENABLE_CLR_ALL);
else
omap_i2c_write_reg(dev, OMAP_I2C_IE_REG, 0);
 
-- 
1.7.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