[PATCH -next] usb: phy: omap: remove redundant dev_err call in omap_control_usb_probe()

2013-10-12 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn

There is a error message within devm_ioremap_resource
already, so remove the dev_err call to avoid redundant
error message.

Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn
---
 drivers/usb/phy/phy-omap-control.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/usb/phy/phy-omap-control.c 
b/drivers/usb/phy/phy-omap-control.c
index 09c5ace..1321e3f 100644
--- a/drivers/usb/phy/phy-omap-control.c
+++ b/drivers/usb/phy/phy-omap-control.c
@@ -253,10 +253,8 @@ static int omap_control_usb_probe(struct platform_device 
*pdev)
res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
power);
control_usb-power = devm_ioremap_resource(pdev-dev, res);
-   if (IS_ERR(control_usb-power)) {
-   dev_err(pdev-dev, Couldn't get power register\n);
+   if (IS_ERR(control_usb-power))
return PTR_ERR(control_usb-power);
-   }
}
 
if (control_usb-type == OMAP_CTRL_TYPE_PIPE3) {

--
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 v6 00/11] ARM: OMAP2+: AM43x PRCM basic support

2013-10-12 Thread Afzal Mohammed
Hi Paul,

This series adds PRCM support (except clock tree) for AM43x SoC's.
Please consider this for inclusion in the coming merge window.

This series has been tested on real silicon in AM43x EPOS EVM board with
the help of Tero's DT clock series and booted to prompt. This has been
tested on AM335x-EVM too.

These changes are made over your for-v3.13/hwmod tag

Changes compared to v5:
1. Rebased over for-v3.13/hwmod tag
2. rtc hwmod has been removed from AM43x hwmod database as rtc had
   issues on EPOS EVM
3. spinlock hwmod has been removed from AM43x hwmod database since
   sysconfig details has been recently added and as it doesn't have dt
   node, that would cause warning, spinlock has to be added after dt
   node has been added
4. Added Acked-by's from Tony and Rajendra
5. Minor fixing in comments

Patch 02/11 ARM: OMAP2+: hwmod: AM335x/AM43x: move common data may
not reach mailing lists due to bigger size, this series is also present
@git://gitorious.org/x0148406-public/linux-kernel.git tags/am43x-prcm-v6

Compared to v4, change is in fixing the powerdomain data.

Major changes compared to rfc v3:
1. All register offsets properly taken care for AM43x (with rfc v3, a
   couple of issues was detected while testing on pre-silicon)
2. There were two patches for common hwmod data movement (one for
   interconnect and other for ip block data), both were combined to have
   a cleaner series that is bisectable.
3. Cleaner seperation of common data

Major changes compared to v2 (v3 was only an rfc for current approach):
1. omap_hwmod_33xx_43xx_interconnect_data.c has the common interconnect
   ocp's structs shared between AM335x and AM43x
2. omap_hwmod_33xx_43xx_ipblock_data.c has the common hwmod structs
   shared between AM335x and AM43x
3. Instances where clock domain or clock topology has changed in the few
   cases, have separate structures for AM335x and AM43x
4. To handle scenarios where register offsets are different, they are
   dynamically init-ed in omap_hwmod_33xx_43xx_ipblock_data.c
5. Register offsets for hwmod's that are present either in AM335x or
   AM43x are updated statically in omap_hwmod_33xx_data.c or
   omap_hwmod_43xx_data.c as that was cleaner.
6. Remove the change that re-introduces SW_SLEEP for OMAP4, this will
   be taken care separately.


Additional details:
AM43x reuses most of the IP's from AM335x, as that is the case, much of
the AM335x hwmod data is reused. As AM43x PRCM register layout differs
from AM335x and is similar to OMAP4, power domain, clock domain  hwmod
operations are reused from OMAP4. Currently there is no public TRM
available for AM43x.

Regards
Afzal


Afzal Mohammed (7):
  ARM: OMAP2+: hwmod: AM335x/AM43x: move common data
  ARM: OMAP2+: hwmod: AM335x: runtime register update
  ARM: OMAP2+: hwmod: AM335x: remove static register offs
  ARM: OMAP2+: PRCM: AM43x definitions
  ARM: OMAP2+: hwmod: AM43x support
  ARM: OMAP2+: hwmod: AM43x operations
  ARM: OMAP2+: AM43x: PRCM kbuild

Ambresh K (3):
  ARM: OMAP2+: PM: AM43x powerdomain data
  ARM: OMAP2+: CM: AM43x clockdomain data
  ARM: OMAP2+: AM43x PRCM init

Ankur Kishore (1):
  ARM: OMAP2+: CM: cm_inst offset s16-u16

 arch/arm/mach-omap2/Makefile   |9 +-
 arch/arm/mach-omap2/clockdomain.h  |4 +-
 arch/arm/mach-omap2/clockdomains43xx_data.c|  196 ++
 arch/arm/mach-omap2/cm33xx.c   |   16 +-
 arch/arm/mach-omap2/cm33xx.h   |   12 +-
 arch/arm/mach-omap2/cminst44xx.c   |   29 +-
 arch/arm/mach-omap2/cminst44xx.h   |   26 +-
 arch/arm/mach-omap2/io.c   |6 +
 arch/arm/mach-omap2/omap_hwmod.c   |8 +
 arch/arm/mach-omap2/omap_hwmod.h   |1 +
 .../mach-omap2/omap_hwmod_33xx_43xx_common_data.h  |  163 ++
 .../omap_hwmod_33xx_43xx_interconnect_data.c   |  643 +++
 .../mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c | 1469 +++
 arch/arm/mach-omap2/omap_hwmod_33xx_data.c | 1979 +---
 arch/arm/mach-omap2/omap_hwmod_43xx_data.c |  619 ++
 arch/arm/mach-omap2/powerdomain.h  |1 +
 arch/arm/mach-omap2/powerdomains43xx_data.c|  136 ++
 arch/arm/mach-omap2/prcm43xx.h |  141 ++
 18 files changed, 3442 insertions(+), 2016 deletions(-)
 create mode 100644 arch/arm/mach-omap2/clockdomains43xx_data.c
 create mode 100644 arch/arm/mach-omap2/omap_hwmod_33xx_43xx_common_data.h
 create mode 100644 arch/arm/mach-omap2/omap_hwmod_33xx_43xx_interconnect_data.c
 create mode 100644 arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c
 create mode 100644 arch/arm/mach-omap2/omap_hwmod_43xx_data.c
 create mode 100644 arch/arm/mach-omap2/powerdomains43xx_data.c
 create mode 100644 arch/arm/mach-omap2/prcm43xx.h

-- 
1.8.3.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org

[PATCH v6 01/11] ARM: OMAP2+: CM: cm_inst offset s16-u16

2013-10-12 Thread Afzal Mohammed
From: Ankur Kishore a-kish...@ti.com

Most of the AM43x CM reg address offsets are with MSB bit '1' (on
16-bit value) leading to arithmetic miscalculations while calculating
CLOCK ENABLE register's address because cm_inst field was a type of
const s16, so make it const u16.

Also modify relevant functions so as to take care of the above.

[af...@ti.com: fixup and cleanup]

Signed-off-by: Ankur Kishore a-kish...@ti.com
Signed-off-by: Afzal Mohammed af...@ti.com
Acked-by: Rajendra Nayak rna...@ti.com
Acked-by: Tony Lindgren t...@atomide.com
---
 arch/arm/mach-omap2/clockdomain.h |  2 +-
 arch/arm/mach-omap2/cm33xx.c  | 16 
 arch/arm/mach-omap2/cm33xx.h  | 10 +-
 arch/arm/mach-omap2/cminst44xx.c  | 20 ++--
 arch/arm/mach-omap2/cminst44xx.h  | 26 +-
 5 files changed, 37 insertions(+), 37 deletions(-)

diff --git a/arch/arm/mach-omap2/clockdomain.h 
b/arch/arm/mach-omap2/clockdomain.h
index 4b03394..5431b0c 100644
--- a/arch/arm/mach-omap2/clockdomain.h
+++ b/arch/arm/mach-omap2/clockdomain.h
@@ -132,7 +132,7 @@ struct clockdomain {
u8 _flags;
const u8 dep_bit;
const u8 prcm_partition;
-   const s16 cm_inst;
+   const u16 cm_inst;
const u16 clkdm_offs;
struct clkdm_dep *wkdep_srcs;
struct clkdm_dep *sleepdep_srcs;
diff --git a/arch/arm/mach-omap2/cm33xx.c b/arch/arm/mach-omap2/cm33xx.c
index 325a515..40a22e5 100644
--- a/arch/arm/mach-omap2/cm33xx.c
+++ b/arch/arm/mach-omap2/cm33xx.c
@@ -48,13 +48,13 @@
 /* Private functions */
 
 /* Read a register in a CM instance */
-static inline u32 am33xx_cm_read_reg(s16 inst, u16 idx)
+static inline u32 am33xx_cm_read_reg(u16 inst, u16 idx)
 {
return __raw_readl(cm_base + inst + idx);
 }
 
 /* Write into a register in a CM */
-static inline void am33xx_cm_write_reg(u32 val, s16 inst, u16 idx)
+static inline void am33xx_cm_write_reg(u32 val, u16 inst, u16 idx)
 {
__raw_writel(val, cm_base + inst + idx);
 }
@@ -138,7 +138,7 @@ static bool _is_module_ready(u16 inst, s16 cdoffs, u16 
clkctrl_offs)
  * @c must be the unshifted value for CLKTRCTRL - i.e., this function
  * will handle the shift itself.
  */
-static void _clktrctrl_write(u8 c, s16 inst, u16 cdoffs)
+static void _clktrctrl_write(u8 c, u16 inst, u16 cdoffs)
 {
u32 v;
 
@@ -158,7 +158,7 @@ static void _clktrctrl_write(u8 c, s16 inst, u16 cdoffs)
  * Returns true if the clockdomain referred to by (@inst, @cdoffs)
  * is in hardware-supervised idle mode, or 0 otherwise.
  */
-bool am33xx_cm_is_clkdm_in_hwsup(s16 inst, u16 cdoffs)
+bool am33xx_cm_is_clkdm_in_hwsup(u16 inst, u16 cdoffs)
 {
u32 v;
 
@@ -177,7 +177,7 @@ bool am33xx_cm_is_clkdm_in_hwsup(s16 inst, u16 cdoffs)
  * Put a clockdomain referred to by (@inst, @cdoffs) into
  * hardware-supervised idle mode.  No return value.
  */
-void am33xx_cm_clkdm_enable_hwsup(s16 inst, u16 cdoffs)
+void am33xx_cm_clkdm_enable_hwsup(u16 inst, u16 cdoffs)
 {
_clktrctrl_write(OMAP34XX_CLKSTCTRL_ENABLE_AUTO, inst, cdoffs);
 }
@@ -191,7 +191,7 @@ void am33xx_cm_clkdm_enable_hwsup(s16 inst, u16 cdoffs)
  * software-supervised idle mode, i.e., controlled manually by the
  * Linux OMAP clockdomain code.  No return value.
  */
-void am33xx_cm_clkdm_disable_hwsup(s16 inst, u16 cdoffs)
+void am33xx_cm_clkdm_disable_hwsup(u16 inst, u16 cdoffs)
 {
_clktrctrl_write(OMAP34XX_CLKSTCTRL_DISABLE_AUTO, inst, cdoffs);
 }
@@ -204,7 +204,7 @@ void am33xx_cm_clkdm_disable_hwsup(s16 inst, u16 cdoffs)
  * Put a clockdomain referred to by (@inst, @cdoffs) into idle
  * No return value.
  */
-void am33xx_cm_clkdm_force_sleep(s16 inst, u16 cdoffs)
+void am33xx_cm_clkdm_force_sleep(u16 inst, u16 cdoffs)
 {
_clktrctrl_write(OMAP34XX_CLKSTCTRL_FORCE_SLEEP, inst, cdoffs);
 }
@@ -217,7 +217,7 @@ void am33xx_cm_clkdm_force_sleep(s16 inst, u16 cdoffs)
  * Take a clockdomain referred to by (@inst, @cdoffs) out of idle,
  * waking it up.  No return value.
  */
-void am33xx_cm_clkdm_force_wakeup(s16 inst, u16 cdoffs)
+void am33xx_cm_clkdm_force_wakeup(u16 inst, u16 cdoffs)
 {
_clktrctrl_write(OMAP34XX_CLKSTCTRL_FORCE_WAKEUP, inst, cdoffs);
 }
diff --git a/arch/arm/mach-omap2/cm33xx.h b/arch/arm/mach-omap2/cm33xx.h
index 9d1f4fc..757320b 100644
--- a/arch/arm/mach-omap2/cm33xx.h
+++ b/arch/arm/mach-omap2/cm33xx.h
@@ -377,11 +377,11 @@
 
 
 #ifndef __ASSEMBLER__
-extern bool am33xx_cm_is_clkdm_in_hwsup(s16 inst, u16 cdoffs);
-extern void am33xx_cm_clkdm_enable_hwsup(s16 inst, u16 cdoffs);
-extern void am33xx_cm_clkdm_disable_hwsup(s16 inst, u16 cdoffs);
-extern void am33xx_cm_clkdm_force_sleep(s16 inst, u16 cdoffs);
-extern void am33xx_cm_clkdm_force_wakeup(s16 inst, u16 cdoffs);
+bool am33xx_cm_is_clkdm_in_hwsup(u16 inst, u16 cdoffs);
+void am33xx_cm_clkdm_enable_hwsup(u16 inst, u16 cdoffs);
+void am33xx_cm_clkdm_disable_hwsup(u16 inst, u16 cdoffs);
+void am33xx_cm_clkdm_force_sleep(u16 inst, u16 cdoffs);
+void 

[PATCH v6 04/11] ARM: OMAP2+: hwmod: AM335x: remove static register offs

2013-10-12 Thread Afzal Mohammed
Hwmod common to AM43x and AM335x has register offsets different. It is
now updated based on SoC detection at run time, hence remove statically
initialized ones.

Signed-off-by: Afzal Mohammed af...@ti.com
Acked-by: Rajendra Nayak rna...@ti.com
Acked-by: Tony Lindgren t...@atomide.com
---
 .../mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c | 57 --
 1 file changed, 57 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c 
b/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c
index e66d02a..ffb371ff 100644
--- a/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c
@@ -44,7 +44,6 @@ struct omap_hwmod am33xx_l3_main_hwmod = {
.main_clk   = l3_gclk,
.prcm   = {
.omap4  = {
-   .clkctrl_offs   = AM33XX_CM_PER_L3_CLKCTRL_OFFSET,
.modulemode = MODULEMODE_SWCTRL,
},
},
@@ -66,7 +65,6 @@ struct omap_hwmod am33xx_l3_instr_hwmod = {
.main_clk   = l3_gclk,
.prcm   = {
.omap4  = {
-   .clkctrl_offs   = AM33XX_CM_PER_L3_INSTR_CLKCTRL_OFFSET,
.modulemode = MODULEMODE_SWCTRL,
},
},
@@ -89,7 +87,6 @@ struct omap_hwmod am33xx_l4_ls_hwmod = {
.main_clk   = l4ls_gclk,
.prcm   = {
.omap4  = {
-   .clkctrl_offs   = AM33XX_CM_PER_L4LS_CLKCTRL_OFFSET,
.modulemode = MODULEMODE_SWCTRL,
},
},
@@ -103,7 +100,6 @@ struct omap_hwmod am33xx_l4_wkup_hwmod = {
.flags  = HWMOD_INIT_NO_IDLE,
.prcm   = {
.omap4  = {
-   .clkctrl_offs   = AM33XX_CM_WKUP_L4WKUP_CLKCTRL_OFFSET,
.modulemode = MODULEMODE_SWCTRL,
},
},
@@ -124,7 +120,6 @@ struct omap_hwmod am33xx_mpu_hwmod = {
.main_clk   = dpll_mpu_m2_ck,
.prcm   = {
.omap4  = {
-   .clkctrl_offs   = AM33XX_CM_MPU_MPU_CLKCTRL_OFFSET,
.modulemode = MODULEMODE_SWCTRL,
},
},
@@ -159,8 +154,6 @@ struct omap_hwmod am33xx_pruss_hwmod = {
.main_clk   = pruss_ocp_gclk,
.prcm   = {
.omap4  = {
-   .clkctrl_offs   = AM33XX_CM_PER_PRUSS_CLKCTRL_OFFSET,
-   .rstctrl_offs   = AM33XX_RM_PER_RSTCTRL_OFFSET,
.modulemode = MODULEMODE_SWCTRL,
},
},
@@ -185,9 +178,6 @@ struct omap_hwmod am33xx_gfx_hwmod = {
.main_clk   = gfx_fck_div_ck,
.prcm   = {
.omap4  = {
-   .clkctrl_offs   = AM33XX_CM_GFX_GFX_CLKCTRL_OFFSET,
-   .rstctrl_offs   = AM33XX_RM_GFX_RSTCTRL_OFFSET,
-   .rstst_offs = AM33XX_RM_GFX_RSTST_OFFSET,
.modulemode = MODULEMODE_SWCTRL,
},
},
@@ -232,7 +222,6 @@ struct omap_hwmod am33xx_aes0_hwmod = {
.main_clk   = aes0_fck,
.prcm   = {
.omap4  = {
-   .clkctrl_offs   = AM33XX_CM_PER_AES0_CLKCTRL_OFFSET,
.modulemode = MODULEMODE_SWCTRL,
},
},
@@ -258,7 +247,6 @@ struct omap_hwmod am33xx_sha0_hwmod = {
.main_clk   = l3_gclk,
.prcm   = {
.omap4  = {
-   .clkctrl_offs   = AM33XX_CM_PER_SHA0_CLKCTRL_OFFSET,
.modulemode = MODULEMODE_SWCTRL,
},
},
@@ -277,7 +265,6 @@ struct omap_hwmod am33xx_ocmcram_hwmod = {
.main_clk   = l3_gclk,
.prcm   = {
.omap4  = {
-   .clkctrl_offs   = AM33XX_CM_PER_OCMCRAM_CLKCTRL_OFFSET,
.modulemode = MODULEMODE_SWCTRL,
},
},
@@ -296,7 +283,6 @@ struct omap_hwmod am33xx_smartreflex0_hwmod = {
.main_clk   = smartreflex0_fck,
.prcm   = {
.omap4  = {
-   .clkctrl_offs   = 
AM33XX_CM_WKUP_SMARTREFLEX0_CLKCTRL_OFFSET,
.modulemode = MODULEMODE_SWCTRL,
},
},
@@ -310,7 +296,6 @@ struct omap_hwmod am33xx_smartreflex1_hwmod = {
.main_clk   = smartreflex1_fck,
.prcm   = {
.omap4  = {
-   .clkctrl_offs   = 
AM33XX_CM_WKUP_SMARTREFLEX1_CLKCTRL_OFFSET,
.modulemode = MODULEMODE_SWCTRL,
},
},
@@ -352,7 +337,6 @@ struct omap_hwmod am33xx_cpgmac0_hwmod = {
.mpu_rt_idx = 1,
.prcm   = {
.omap4  = {
-   

[PATCH v6 07/11] ARM: OMAP2+: CM: AM43x clockdomain data

2013-10-12 Thread Afzal Mohammed
From: Ambresh K ambr...@ti.com

Add the data file to describe clock domains in AM43x SoC.
OMAP4 clockdomain operations is being reused here.

Signed-off-by: Ambresh K ambr...@ti.com
Signed-off-by: Afzal Mohammed af...@ti.com
Acked-by: Rajendra Nayak rna...@ti.com
Acked-by: Tony Lindgren t...@atomide.com
---
 arch/arm/mach-omap2/clockdomain.h   |   2 +
 arch/arm/mach-omap2/clockdomains43xx_data.c | 196 
 arch/arm/mach-omap2/cminst44xx.c|   9 ++
 3 files changed, 207 insertions(+)
 create mode 100644 arch/arm/mach-omap2/clockdomains43xx_data.c

diff --git a/arch/arm/mach-omap2/clockdomain.h 
b/arch/arm/mach-omap2/clockdomain.h
index 5431b0c..f17f006 100644
--- a/arch/arm/mach-omap2/clockdomain.h
+++ b/arch/arm/mach-omap2/clockdomain.h
@@ -218,6 +218,7 @@ extern void __init am33xx_clockdomains_init(void);
 extern void __init omap44xx_clockdomains_init(void);
 extern void __init omap54xx_clockdomains_init(void);
 extern void __init dra7xx_clockdomains_init(void);
+void am43xx_clockdomains_init(void);
 
 extern void clkdm_add_autodeps(struct clockdomain *clkdm);
 extern void clkdm_del_autodeps(struct clockdomain *clkdm);
@@ -226,6 +227,7 @@ extern struct clkdm_ops omap2_clkdm_operations;
 extern struct clkdm_ops omap3_clkdm_operations;
 extern struct clkdm_ops omap4_clkdm_operations;
 extern struct clkdm_ops am33xx_clkdm_operations;
+extern struct clkdm_ops am43xx_clkdm_operations;
 
 extern struct clkdm_dep gfx_24xx_wkdeps[];
 extern struct clkdm_dep dsp_24xx_wkdeps[];
diff --git a/arch/arm/mach-omap2/clockdomains43xx_data.c 
b/arch/arm/mach-omap2/clockdomains43xx_data.c
new file mode 100644
index 000..6d71c60
--- /dev/null
+++ b/arch/arm/mach-omap2/clockdomains43xx_data.c
@@ -0,0 +1,196 @@
+/*
+ * AM43xx Clock domains framework
+ *
+ * Copyright (C) 2013 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/io.h
+
+#include clockdomain.h
+#include prcm44xx.h
+#include prcm43xx.h
+
+static struct clockdomain l4_cefuse_43xx_clkdm = {
+   .name = l4_cefuse_clkdm,
+   .pwrdm= { .name = cefuse_pwrdm },
+   .prcm_partition   = AM43XX_CM_PARTITION,
+   .cm_inst  = AM43XX_CM_CEFUSE_INST,
+   .clkdm_offs   = AM43XX_CM_CEFUSE_CEFUSE_CDOFFS,
+   .flags= CLKDM_CAN_SWSUP,
+};
+
+static struct clockdomain mpu_43xx_clkdm = {
+   .name = mpu_clkdm,
+   .pwrdm= { .name = mpu_pwrdm },
+   .prcm_partition   = AM43XX_CM_PARTITION,
+   .cm_inst  = AM43XX_CM_MPU_INST,
+   .clkdm_offs   = AM43XX_CM_MPU_MPU_CDOFFS,
+   .flags= CLKDM_CAN_HWSUP_SWSUP,
+};
+
+static struct clockdomain l4ls_43xx_clkdm = {
+   .name = l4ls_clkdm,
+   .pwrdm= { .name = per_pwrdm },
+   .prcm_partition   = AM43XX_CM_PARTITION,
+   .cm_inst  = AM43XX_CM_PER_INST,
+   .clkdm_offs   = AM43XX_CM_PER_L4LS_CDOFFS,
+   .flags= CLKDM_CAN_SWSUP,
+};
+
+static struct clockdomain tamper_43xx_clkdm = {
+   .name = tamper_clkdm,
+   .pwrdm= { .name = tamper_pwrdm },
+   .prcm_partition   = AM43XX_CM_PARTITION,
+   .cm_inst  = AM43XX_CM_TAMPER_INST,
+   .clkdm_offs   = AM43XX_CM_TAMPER_TAMPER_CDOFFS,
+   .flags= CLKDM_CAN_SWSUP,
+};
+
+static struct clockdomain l4_rtc_43xx_clkdm = {
+   .name = l4_rtc_clkdm,
+   .pwrdm= { .name = rtc_pwrdm },
+   .prcm_partition   = AM43XX_CM_PARTITION,
+   .cm_inst  = AM43XX_CM_RTC_INST,
+   .clkdm_offs   = AM43XX_CM_RTC_RTC_CDOFFS,
+   .flags= CLKDM_CAN_SWSUP,
+};
+
+static struct clockdomain pruss_ocp_43xx_clkdm = {
+   .name = pruss_ocp_clkdm,
+   .pwrdm= { .name = per_pwrdm },
+   .prcm_partition   = AM43XX_CM_PARTITION,
+   .cm_inst  = AM43XX_CM_PER_INST,
+   .clkdm_offs   = AM43XX_CM_PER_ICSS_CDOFFS,
+   .flags= CLKDM_CAN_SWSUP,
+};
+
+static struct clockdomain ocpwp_l3_43xx_clkdm = {
+   .name = ocpwp_l3_clkdm,
+   .pwrdm= { .name = per_pwrdm },
+   .prcm_partition   = AM43XX_CM_PARTITION,
+   .cm_inst  = AM43XX_CM_PER_INST,
+   .clkdm_offs   = AM43XX_CM_PER_OCPWP_L3_CDOFFS,
+   .flags= CLKDM_CAN_SWSUP,
+};
+
+static struct clockdomain l3s_tsc_43xx_clkdm = {
+   .name = l3s_tsc_clkdm,
+   .pwrdm= { .name = wkup_pwrdm },
+   .prcm_partition   = AM43XX_CM_PARTITION,
+   .cm_inst  = AM43XX_CM_WKUP_INST,
+   .clkdm_offs   = AM43XX_CM_WKUP_L3S_TSC_CDOFFS,
+   .flags= CLKDM_CAN_SWSUP,
+};
+
+static struct 

[PATCH v6 06/11] ARM: OMAP2+: PM: AM43x powerdomain data

2013-10-12 Thread Afzal Mohammed
From: Ambresh K ambr...@ti.com

Add the data file to describe all power domains in AM43x SoC.
OMAP4 powerdomain operations is being reused here.

Signed-off-by: Ambresh K ambr...@ti.com
Signed-off-by: Afzal Mohammed af...@ti.com
Acked-by: Rajendra Nayak rna...@ti.com
Acked-by: Tony Lindgren t...@atomide.com
---
 arch/arm/mach-omap2/powerdomain.h   |   1 +
 arch/arm/mach-omap2/powerdomains43xx_data.c | 136 
 2 files changed, 137 insertions(+)
 create mode 100644 arch/arm/mach-omap2/powerdomains43xx_data.c

diff --git a/arch/arm/mach-omap2/powerdomain.h 
b/arch/arm/mach-omap2/powerdomain.h
index baf3d8b..da5a59a 100644
--- a/arch/arm/mach-omap2/powerdomain.h
+++ b/arch/arm/mach-omap2/powerdomain.h
@@ -257,6 +257,7 @@ extern void am33xx_powerdomains_init(void);
 extern void omap44xx_powerdomains_init(void);
 extern void omap54xx_powerdomains_init(void);
 extern void dra7xx_powerdomains_init(void);
+void am43xx_powerdomains_init(void);
 
 extern struct pwrdm_ops omap2_pwrdm_operations;
 extern struct pwrdm_ops omap3_pwrdm_operations;
diff --git a/arch/arm/mach-omap2/powerdomains43xx_data.c 
b/arch/arm/mach-omap2/powerdomains43xx_data.c
new file mode 100644
index 000..95fee54
--- /dev/null
+++ b/arch/arm/mach-omap2/powerdomains43xx_data.c
@@ -0,0 +1,136 @@
+/*
+ * AM43xx Power domains framework
+ *
+ * Copyright (C) 2013 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 powerdomain.h
+
+#include prcm-common.h
+#include prcm44xx.h
+#include prcm43xx.h
+
+static struct powerdomain gfx_43xx_pwrdm = {
+   .name = gfx_pwrdm,
+   .voltdm   = { .name = core },
+   .prcm_offs= AM43XX_PRM_GFX_INST,
+   .prcm_partition   = AM43XX_PRM_PARTITION,
+   .pwrsts   = PWRSTS_OFF_ON,
+   .banks= 1,
+   .pwrsts_mem_on  = {
+   [0] = PWRSTS_ON,/* gfx_mem */
+   },
+   .flags= PWRDM_HAS_LOWPOWERSTATECHANGE,
+};
+
+static struct powerdomain mpu_43xx_pwrdm = {
+   .name = mpu_pwrdm,
+   .voltdm   = { .name = mpu },
+   .prcm_offs= AM43XX_PRM_MPU_INST,
+   .prcm_partition   = AM43XX_PRM_PARTITION,
+   .pwrsts   = PWRSTS_OFF_RET_ON,
+   .pwrsts_logic_ret = PWRSTS_OFF_RET,
+   .banks= 3,
+   .pwrsts_mem_ret = {
+   [0] = PWRSTS_OFF_RET,   /* mpu_l1 */
+   [1] = PWRSTS_OFF_RET,   /* mpu_l2 */
+   [2] = PWRSTS_OFF_RET,   /* mpu_ram */
+   },
+   .pwrsts_mem_on  = {
+   [0] = PWRSTS_ON,/* mpu_l1 */
+   [1] = PWRSTS_ON,/* mpu_l2 */
+   [2] = PWRSTS_ON,/* mpu_ram */
+   },
+   .flags= PWRDM_HAS_LOWPOWERSTATECHANGE,
+};
+
+static struct powerdomain rtc_43xx_pwrdm = {
+   .name = rtc_pwrdm,
+   .voltdm   = { .name = rtc },
+   .prcm_offs= AM43XX_PRM_RTC_INST,
+   .prcm_partition   = AM43XX_PRM_PARTITION,
+   .pwrsts   = PWRSTS_ON,
+};
+
+static struct powerdomain wkup_43xx_pwrdm = {
+   .name = wkup_pwrdm,
+   .voltdm   = { .name = core },
+   .prcm_offs= AM43XX_PRM_WKUP_INST,
+   .prcm_partition   = AM43XX_PRM_PARTITION,
+   .pwrsts   = PWRSTS_ON,
+   .banks= 1,
+   .pwrsts_mem_on  = {
+   [0] = PWRSTS_ON,/* debugss_mem */
+   },
+};
+
+static struct powerdomain tamper_43xx_pwrdm = {
+   .name = tamper_pwrdm,
+   .voltdm   = { .name = tamper },
+   .prcm_offs= AM43XX_PRM_TAMPER_INST,
+   .prcm_partition   = AM43XX_PRM_PARTITION,
+   .pwrsts   = PWRSTS_ON,
+};
+
+static struct powerdomain cefuse_43xx_pwrdm = {
+   .name = cefuse_pwrdm,
+   .voltdm   = { .name = core },
+   .prcm_offs= AM43XX_PRM_CEFUSE_INST,
+   .prcm_partition   = AM43XX_PRM_PARTITION,
+   .pwrsts   = PWRSTS_OFF_ON,
+   .flags= PWRDM_HAS_LOWPOWERSTATECHANGE,
+};
+
+static struct powerdomain per_43xx_pwrdm = {
+   .name = per_pwrdm,
+   .voltdm   = { .name = core },
+   .prcm_offs= AM43XX_PRM_PER_INST,
+   .prcm_partition   = AM43XX_PRM_PARTITION,
+   .pwrsts   = PWRSTS_OFF_RET_ON,
+   .pwrsts_logic_ret = PWRSTS_OFF_RET,
+   .banks= 4,
+   .pwrsts_mem_ret = {
+   [0] = PWRSTS_OFF_RET,   /* icss_mem */
+   [1] = PWRSTS_OFF_RET,   /* per_mem */
+   [2] = PWRSTS_OFF_RET,   /* ram1_mem */
+   [3] = PWRSTS_OFF_RET,   /* ram2_mem */
+   },
+   .pwrsts_mem_on  = {
+   [0] = 

[PATCH v6 03/11] ARM: OMAP2+: hwmod: AM335x: runtime register update

2013-10-12 Thread Afzal Mohammed
Most of IP's in AM335x is present on AM43x and so in those cases both
will use same hwmod database (except for a few cases where clock related
details differ), but there is difference w.r.t register offset between
these. Update register offsets at runtime based on the SoC detected to
help in sharing otherwise same hwmod.

Signed-off-by: Afzal Mohammed af...@ti.com
Acked-by: Rajendra Nayak rna...@ti.com
Acked-by: Tony Lindgren t...@atomide.com
---
 .../mach-omap2/omap_hwmod_33xx_43xx_common_data.h  |  2 +
 .../mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c | 77 ++
 arch/arm/mach-omap2/omap_hwmod_33xx_data.c |  1 +
 3 files changed, 80 insertions(+)

diff --git a/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_common_data.h 
b/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_common_data.h
index e873e72..a9a7902 100644
--- a/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_common_data.h
+++ b/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_common_data.h
@@ -157,4 +157,6 @@ extern struct omap_hwmod_class am33xx_spi_hwmod_class;
 extern struct omap_gpio_dev_attr gpio_dev_attr;
 extern struct omap2_mcspi_dev_attr mcspi_attrib;
 
+void omap_hwmod_am33xx_reg(void);
+
 #endif
diff --git a/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c 
b/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c
index 669b7bd..e66d02a 100644
--- a/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c
@@ -24,6 +24,10 @@
 #include prm33xx.h
 #include omap_hwmod_33xx_43xx_common_data.h
 
+#define CLKCTRL(oh, clkctrl) ((oh).prcm.omap4.clkctrl_offs = (clkctrl))
+#define RSTCTRL(oh, rstctrl) ((oh).prcm.omap4.rstctrl_offs = (rstctrl))
+#define RSTST(oh, rstst) ((oh).prcm.omap4.rstst_offs = (rstst))
+
 /*
  * 'l3' class
  * instance(s): l3_main, l3_s, l3_instr
@@ -1373,3 +1377,76 @@ struct omap_hwmod am33xx_wd_timer1_hwmod = {
},
},
 };
+
+static void omap_hwmod_am33xx_clkctrl(void)
+{
+   CLKCTRL(am33xx_uart2_hwmod, AM33XX_CM_PER_UART1_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_uart3_hwmod, AM33XX_CM_PER_UART2_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_uart4_hwmod, AM33XX_CM_PER_UART3_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_uart5_hwmod, AM33XX_CM_PER_UART4_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_uart6_hwmod, AM33XX_CM_PER_UART5_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_dcan0_hwmod, AM33XX_CM_PER_DCAN0_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_dcan1_hwmod, AM33XX_CM_PER_DCAN1_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_elm_hwmod, AM33XX_CM_PER_ELM_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_epwmss0_hwmod, AM33XX_CM_PER_EPWMSS0_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_epwmss1_hwmod, AM33XX_CM_PER_EPWMSS1_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_epwmss2_hwmod, AM33XX_CM_PER_EPWMSS2_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_gpio1_hwmod, AM33XX_CM_PER_GPIO1_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_gpio2_hwmod, AM33XX_CM_PER_GPIO2_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_gpio3_hwmod, AM33XX_CM_PER_GPIO3_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_i2c2_hwmod, AM33XX_CM_PER_I2C1_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_i2c3_hwmod, AM33XX_CM_PER_I2C2_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_mailbox_hwmod, AM33XX_CM_PER_MAILBOX0_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_mcasp0_hwmod, AM33XX_CM_PER_MCASP0_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_mcasp1_hwmod, AM33XX_CM_PER_MCASP1_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_mmc0_hwmod, AM33XX_CM_PER_MMC0_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_mmc1_hwmod, AM33XX_CM_PER_MMC1_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_spi0_hwmod, AM33XX_CM_PER_SPI0_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_spi1_hwmod, AM33XX_CM_PER_SPI1_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_spinlock_hwmod, AM33XX_CM_PER_SPINLOCK_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_timer2_hwmod, AM33XX_CM_PER_TIMER2_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_timer3_hwmod, AM33XX_CM_PER_TIMER3_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_timer4_hwmod, AM33XX_CM_PER_TIMER4_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_timer5_hwmod, AM33XX_CM_PER_TIMER5_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_timer6_hwmod, AM33XX_CM_PER_TIMER6_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_timer7_hwmod, AM33XX_CM_PER_TIMER7_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_smartreflex0_hwmod,
+   AM33XX_CM_WKUP_SMARTREFLEX0_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_smartreflex1_hwmod,
+   AM33XX_CM_WKUP_SMARTREFLEX1_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_uart1_hwmod, AM33XX_CM_WKUP_UART0_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_timer1_hwmod, AM33XX_CM_WKUP_TIMER1_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_i2c1_hwmod, AM33XX_CM_WKUP_I2C0_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_wd_timer1_hwmod, AM33XX_CM_WKUP_WDT1_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_rtc_hwmod, AM33XX_CM_RTC_RTC_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_mmc2_hwmod, AM33XX_CM_PER_MMC2_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_gpmc_hwmod, AM33XX_CM_PER_GPMC_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_l4_ls_hwmod, AM33XX_CM_PER_L4LS_CLKCTRL_OFFSET);
+   

[PATCH v6 09/11] ARM: OMAP2+: hwmod: AM43x operations

2013-10-12 Thread Afzal Mohammed
Reuse OMAP4 operations on AM43x.

Context related ops are not used on AM43x, as this would not add value
when using DT and AM43x is DT only boot. This additionally helps not to
add context register offset for each hwmod.

Signed-off-by: Ambresh K ambr...@ti.com
Signed-off-by: Afzal Mohammed af...@ti.com
Acked-by: Rajendra Nayak rna...@ti.com
Acked-by: Tony Lindgren t...@atomide.com
---
 arch/arm/mach-omap2/omap_hwmod.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 1c217e8..e3f0eca 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -4144,6 +4144,14 @@ void __init omap_hwmod_init(void)
soc_ops.init_clkdm = _init_clkdm;
soc_ops.update_context_lost = _omap4_update_context_lost;
soc_ops.get_context_lost = _omap4_get_context_lost;
+   } else if (soc_is_am43xx()) {
+   soc_ops.enable_module = _omap4_enable_module;
+   soc_ops.disable_module = _omap4_disable_module;
+   soc_ops.wait_target_ready = _omap4_wait_target_ready;
+   soc_ops.assert_hardreset = _omap4_assert_hardreset;
+   soc_ops.deassert_hardreset = _omap4_deassert_hardreset;
+   soc_ops.is_hardreset_asserted = _omap4_is_hardreset_asserted;
+   soc_ops.init_clkdm = _init_clkdm;
} else if (soc_is_am33xx()) {
soc_ops.enable_module = _am33xx_enable_module;
soc_ops.disable_module = _am33xx_disable_module;
-- 
1.8.3.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


[PATCH v6 05/11] ARM: OMAP2+: PRCM: AM43x definitions

2013-10-12 Thread Afzal Mohammed
Add AM43x CMINST, CDOFFS, RM_RSTST  RM_RSTCTRL definitions - minimal
ones that would be used.

Signed-off-by: Afzal Mohammed af...@ti.com
Acked-by: Rajendra Nayak rna...@ti.com
Acked-by: Tony Lindgren t...@atomide.com
---
 arch/arm/mach-omap2/prcm43xx.h | 141 +
 1 file changed, 141 insertions(+)
 create mode 100644 arch/arm/mach-omap2/prcm43xx.h

diff --git a/arch/arm/mach-omap2/prcm43xx.h b/arch/arm/mach-omap2/prcm43xx.h
new file mode 100644
index 000..f0636ec
--- /dev/null
+++ b/arch/arm/mach-omap2/prcm43xx.h
@@ -0,0 +1,141 @@
+/*
+ * AM43x PRCM defines
+ *
+ * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2.  This program is licensed as is without any warranty of any
+ * kind, whether express or implied.
+ */
+
+#ifndef __ARCH_ARM_MACH_OMAP2_PRCM_43XX_H
+#define __ARCH_ARM_MACH_OMAP2_PRCM_43XX_H
+
+#define AM43XX_PRM_PARTITION   1
+#define AM43XX_CM_PARTITION1
+
+/* PRM instances */
+#define AM43XX_PRM_OCP_SOCKET_INST 0x
+#define AM43XX_PRM_MPU_INST0x0300
+#define AM43XX_PRM_GFX_INST0x0400
+#define AM43XX_PRM_RTC_INST0x0500
+#define AM43XX_PRM_TAMPER_INST 0x0600
+#define AM43XX_PRM_CEFUSE_INST 0x0700
+#define AM43XX_PRM_PER_INST0x0800
+#define AM43XX_PRM_WKUP_INST   0x2000
+#define AM43XX_PRM_DEVICE_INST 0x4000
+
+/* RM RSTCTRL offsets */
+#define AM43XX_RM_PER_RSTCTRL_OFFSET   0x0010
+#define AM43XX_RM_GFX_RSTCTRL_OFFSET   0x0010
+#define AM43XX_RM_WKUP_RSTCTRL_OFFSET  0x0010
+
+/* RM RSTST offsets */
+#define AM43XX_RM_GFX_RSTST_OFFSET 0x0014
+#define AM43XX_RM_WKUP_RSTST_OFFSET0x0014
+
+/* CM instances */
+#define AM43XX_CM_WKUP_INST0x2800
+#define AM43XX_CM_DEVICE_INST  0x4100
+#define AM43XX_CM_DPLL_INST0x4200
+#define AM43XX_CM_MPU_INST 0x8300
+#define AM43XX_CM_GFX_INST 0x8400
+#define AM43XX_CM_RTC_INST 0x8500
+#define AM43XX_CM_TAMPER_INST  0x8600
+#define AM43XX_CM_CEFUSE_INST  0x8700
+#define AM43XX_CM_PER_INST 0x8800
+
+/* CD offsets */
+#define AM43XX_CM_WKUP_L3_AON_CDOFFS   0x
+#define AM43XX_CM_WKUP_L3S_TSC_CDOFFS  0x0100
+#define AM43XX_CM_WKUP_L4_WKUP_AON_CDOFFS  0x0200
+#define AM43XX_CM_WKUP_WKUP_CDOFFS 0x0300
+#define AM43XX_CM_MPU_MPU_CDOFFS   0x
+#define AM43XX_CM_GFX_GFX_L3_CDOFFS0x
+#define AM43XX_CM_RTC_RTC_CDOFFS   0x
+#define AM43XX_CM_TAMPER_TAMPER_CDOFFS 0x
+#define AM43XX_CM_CEFUSE_CEFUSE_CDOFFS 0x
+#define AM43XX_CM_PER_L3_CDOFFS0x
+#define AM43XX_CM_PER_L3S_CDOFFS   0x0200
+#define AM43XX_CM_PER_ICSS_CDOFFS  0x0300
+#define AM43XX_CM_PER_L4LS_CDOFFS  0x0400
+#define AM43XX_CM_PER_EMIF_CDOFFS  0x0700
+#define AM43XX_CM_PER_DSS_CDOFFS   0x0a00
+#define AM43XX_CM_PER_CPSW_CDOFFS  0x0b00
+#define AM43XX_CM_PER_OCPWP_L3_CDOFFS  0x0c00
+
+/* CLK CTRL offsets */
+#define AM43XX_CM_PER_UART1_CLKCTRL_OFFSET 0x0580
+#define AM43XX_CM_PER_UART2_CLKCTRL_OFFSET 0x0588
+#define AM43XX_CM_PER_UART3_CLKCTRL_OFFSET 0x0590
+#define AM43XX_CM_PER_UART4_CLKCTRL_OFFSET 0x0598
+#define AM43XX_CM_PER_UART5_CLKCTRL_OFFSET 0x05a0
+#define AM43XX_CM_PER_DCAN0_CLKCTRL_OFFSET 0x0428
+#define AM43XX_CM_PER_DCAN1_CLKCTRL_OFFSET 0x0430
+#define AM43XX_CM_PER_ELM_CLKCTRL_OFFSET   0x0468
+#define AM43XX_CM_PER_EPWMSS0_CLKCTRL_OFFSET   0x0438
+#define AM43XX_CM_PER_EPWMSS1_CLKCTRL_OFFSET   0x0440
+#define AM43XX_CM_PER_EPWMSS2_CLKCTRL_OFFSET   0x0448
+#define AM43XX_CM_PER_GPIO1_CLKCTRL_OFFSET 0x0478
+#define AM43XX_CM_PER_GPIO2_CLKCTRL_OFFSET 0x0480
+#define AM43XX_CM_PER_GPIO3_CLKCTRL_OFFSET 0x0488
+#define AM43XX_CM_PER_I2C1_CLKCTRL_OFFSET  0x04a8
+#define AM43XX_CM_PER_I2C2_CLKCTRL_OFFSET  0x04b0
+#define AM43XX_CM_PER_MAILBOX0_CLKCTRL_OFFSET  0x04b8
+#define AM43XX_CM_PER_MMC0_CLKCTRL_OFFSET  0x04c0
+#define AM43XX_CM_PER_MMC1_CLKCTRL_OFFSET  0x04c8
+#define 

[PATCH v6 08/11] ARM: OMAP2+: hwmod: AM43x support

2013-10-12 Thread Afzal Mohammed
Add hwmod support for IP's that are present in AM43x, but not in AM335x.
AM43x additional ones added here are,
1. synctimer
2. timer8-11
3. ehrpwm3-5
4. spi2-4
5. gpio4-5

AM43x pruss interconnect which is different as compared to AM335x, has
been taken care.

And register offsets for same hwmod's shared with AM335x is different,
AM43x register offsets are updated appropriately.

ocp clock of those in l4_wkup is fed from sys_clkin_ck instead of
dpll_core_m4_div2_ck, so ocpif for those in AM43x l4_wkup has been
added seperately.

hwmod's has been added for those that have main clock (wkup_m3, control,
gpio0) and clock domain (l4_hs) different from AM335x. debugss and
adc_tsc that have different clocks and clockdomains repectively has not
been added due to the reasons mentioned below.

AM43x also has IP's like qspi, hdq1w, vpfe, des, rng, usb, dss, debugss,
adc_tsc. These are not handled here due to both/either of following
reasons,
1. To avoid churn; most of them don't have DT bindings, which would
   necessitate adding address space in hwmod, which any way would have
   to be removed once DT bindings happen with driver support.
2. patches would come in from sources other than the author

Signed-off-by: Afzal Mohammed af...@ti.com
Acked-by: Rajendra Nayak rna...@ti.com
Acked-by: Tony Lindgren t...@atomide.com
---
 arch/arm/mach-omap2/omap_hwmod.h   |   1 +
 .../mach-omap2/omap_hwmod_33xx_43xx_common_data.h  |   1 +
 .../mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c |  74 +++
 arch/arm/mach-omap2/omap_hwmod_43xx_data.c | 619 +
 4 files changed, 695 insertions(+)
 create mode 100644 arch/arm/mach-omap2/omap_hwmod_43xx_data.c

diff --git a/arch/arm/mach-omap2/omap_hwmod.h b/arch/arm/mach-omap2/omap_hwmod.h
index d02acf9..0f97d63 100644
--- a/arch/arm/mach-omap2/omap_hwmod.h
+++ b/arch/arm/mach-omap2/omap_hwmod.h
@@ -752,6 +752,7 @@ extern int omap44xx_hwmod_init(void);
 extern int omap54xx_hwmod_init(void);
 extern int am33xx_hwmod_init(void);
 extern int dra7xx_hwmod_init(void);
+int am43xx_hwmod_init(void);
 
 extern int __init omap_hwmod_register_links(struct omap_hwmod_ocp_if **ois);
 
diff --git a/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_common_data.h 
b/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_common_data.h
index a9a7902..130332c 100644
--- a/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_common_data.h
+++ b/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_common_data.h
@@ -158,5 +158,6 @@ extern struct omap_gpio_dev_attr gpio_dev_attr;
 extern struct omap2_mcspi_dev_attr mcspi_attrib;
 
 void omap_hwmod_am33xx_reg(void);
+void omap_hwmod_am43xx_reg(void);
 
 #endif
diff --git a/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c 
b/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c
index ffb371ff..0f17862 100644
--- a/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c
@@ -23,6 +23,7 @@
 #include cm33xx.h
 #include prm33xx.h
 #include omap_hwmod_33xx_43xx_common_data.h
+#include prcm43xx.h
 
 #define CLKCTRL(oh, clkctrl) ((oh).prcm.omap4.clkctrl_offs = (clkctrl))
 #define RSTCTRL(oh, rstctrl) ((oh).prcm.omap4.rstctrl_offs = (rstctrl))
@@ -1393,3 +1394,76 @@ void omap_hwmod_am33xx_reg(void)
omap_hwmod_am33xx_clkctrl();
omap_hwmod_am33xx_rst();
 }
+
+static void omap_hwmod_am43xx_clkctrl(void)
+{
+   CLKCTRL(am33xx_uart2_hwmod, AM43XX_CM_PER_UART1_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_uart3_hwmod, AM43XX_CM_PER_UART2_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_uart4_hwmod, AM43XX_CM_PER_UART3_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_uart5_hwmod, AM43XX_CM_PER_UART4_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_uart6_hwmod, AM43XX_CM_PER_UART5_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_dcan0_hwmod, AM43XX_CM_PER_DCAN0_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_dcan1_hwmod, AM43XX_CM_PER_DCAN1_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_elm_hwmod, AM43XX_CM_PER_ELM_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_epwmss0_hwmod, AM43XX_CM_PER_EPWMSS0_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_epwmss1_hwmod, AM43XX_CM_PER_EPWMSS1_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_epwmss2_hwmod, AM43XX_CM_PER_EPWMSS2_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_gpio1_hwmod, AM43XX_CM_PER_GPIO1_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_gpio2_hwmod, AM43XX_CM_PER_GPIO2_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_gpio3_hwmod, AM43XX_CM_PER_GPIO3_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_i2c2_hwmod, AM43XX_CM_PER_I2C1_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_i2c3_hwmod, AM43XX_CM_PER_I2C2_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_mailbox_hwmod, AM43XX_CM_PER_MAILBOX0_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_mcasp0_hwmod, AM43XX_CM_PER_MCASP0_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_mcasp1_hwmod, AM43XX_CM_PER_MCASP1_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_mmc0_hwmod, AM43XX_CM_PER_MMC0_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_mmc1_hwmod, AM43XX_CM_PER_MMC1_CLKCTRL_OFFSET);
+   CLKCTRL(am33xx_spi0_hwmod, AM43XX_CM_PER_SPI0_CLKCTRL_OFFSET);
+  

[PATCH v6 10/11] ARM: OMAP2+: AM43x: PRCM kbuild

2013-10-12 Thread Afzal Mohammed
Build AM43x power domain, clock domain and hwmod data.

Many of AM43x IP's and interconnects are similar as that in AM335x,
hence AM335x hwmod data is being reused with necessary changes.

Earlier the plan was to reuse AM335x specific PRCM code, but as AM43x
PRCM register layout is much similar to OMAP4/5, AM335x PRCM is
divorced and instead married with OMAP4/5 PRCM for AM43x.

Signed-off-by: Afzal Mohammed af...@ti.com
Acked-by: Rajendra Nayak rna...@ti.com
Acked-by: Tony Lindgren t...@atomide.com
---
 arch/arm/mach-omap2/Makefile | 7 ++-
 arch/arm/mach-omap2/cm33xx.h | 2 +-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 0746494..cb7b527 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -112,13 +112,13 @@ obj-$(CONFIG_ARCH_OMAP2)  += prm2xxx_3xxx.o 
prm2xxx.o cm2xxx.o
 obj-$(CONFIG_ARCH_OMAP3)   += prm2xxx_3xxx.o prm3xxx.o cm3xxx.o
 obj-$(CONFIG_ARCH_OMAP3)   += vc3xxx_data.o vp3xxx_data.o
 obj-$(CONFIG_SOC_AM33XX)   += prm33xx.o cm33xx.o
-obj-$(CONFIG_SOC_AM43XX)   += prm33xx.o cm33xx.o
 omap-prcm-4-5-common   =  cminst44xx.o cm44xx.o prm44xx.o \
   prcm_mpu44xx.o prminst44xx.o \
   vc44xx_data.o vp44xx_data.o
 obj-$(CONFIG_ARCH_OMAP4)   += $(omap-prcm-4-5-common)
 obj-$(CONFIG_SOC_OMAP5)+= $(omap-prcm-4-5-common)
 obj-$(CONFIG_SOC_DRA7XX)   += $(omap-prcm-4-5-common)
+obj-$(CONFIG_SOC_AM43XX)   += $(omap-prcm-4-5-common)
 
 # OMAP voltage domains
 voltagedomain-common   := voltage.o vc.o vp.o
@@ -146,6 +146,7 @@ obj-$(CONFIG_ARCH_OMAP4)+= 
powerdomains44xx_data.o
 obj-$(CONFIG_SOC_AM33XX)   += $(powerdomain-common)
 obj-$(CONFIG_SOC_AM33XX)   += powerdomains33xx_data.o
 obj-$(CONFIG_SOC_AM43XX)   += $(powerdomain-common)
+obj-$(CONFIG_SOC_AM43XX)   += powerdomains43xx_data.o
 obj-$(CONFIG_SOC_OMAP5)+= $(powerdomain-common)
 obj-$(CONFIG_SOC_OMAP5)+= powerdomains54xx_data.o
 obj-$(CONFIG_SOC_DRA7XX)   += $(powerdomain-common)
@@ -165,6 +166,7 @@ obj-$(CONFIG_ARCH_OMAP4)+= 
clockdomains44xx_data.o
 obj-$(CONFIG_SOC_AM33XX)   += $(clockdomain-common)
 obj-$(CONFIG_SOC_AM33XX)   += clockdomains33xx_data.o
 obj-$(CONFIG_SOC_AM43XX)   += $(clockdomain-common)
+obj-$(CONFIG_SOC_AM43XX)   += clockdomains43xx_data.o
 obj-$(CONFIG_SOC_OMAP5)+= $(clockdomain-common)
 obj-$(CONFIG_SOC_OMAP5)+= clockdomains54xx_data.o
 obj-$(CONFIG_SOC_DRA7XX)   += $(clockdomain-common)
@@ -212,6 +214,9 @@ obj-$(CONFIG_ARCH_OMAP3)+= 
omap_hwmod_3xxx_data.o
 obj-$(CONFIG_SOC_AM33XX)   += omap_hwmod_33xx_data.o
 obj-$(CONFIG_SOC_AM33XX)   += 
omap_hwmod_33xx_43xx_interconnect_data.o
 obj-$(CONFIG_SOC_AM33XX)   += omap_hwmod_33xx_43xx_ipblock_data.o
+obj-$(CONFIG_SOC_AM43XX)   += omap_hwmod_43xx_data.o
+obj-$(CONFIG_SOC_AM43XX)   += 
omap_hwmod_33xx_43xx_interconnect_data.o
+obj-$(CONFIG_SOC_AM43XX)   += omap_hwmod_33xx_43xx_ipblock_data.o
 obj-$(CONFIG_ARCH_OMAP4)   += omap_hwmod_44xx_data.o
 obj-$(CONFIG_SOC_OMAP5)+= omap_hwmod_54xx_data.o
 obj-$(CONFIG_SOC_DRA7XX)   += omap_hwmod_7xx_data.o
diff --git a/arch/arm/mach-omap2/cm33xx.h b/arch/arm/mach-omap2/cm33xx.h
index 757320b..cfb8891 100644
--- a/arch/arm/mach-omap2/cm33xx.h
+++ b/arch/arm/mach-omap2/cm33xx.h
@@ -383,7 +383,7 @@ void am33xx_cm_clkdm_disable_hwsup(u16 inst, u16 cdoffs);
 void am33xx_cm_clkdm_force_sleep(u16 inst, u16 cdoffs);
 void am33xx_cm_clkdm_force_wakeup(u16 inst, u16 cdoffs);
 
-#if defined(CONFIG_SOC_AM33XX) || defined(CONFIG_SOC_AM43XX)
+#ifdef CONFIG_SOC_AM33XX
 extern int am33xx_cm_wait_module_idle(u16 inst, s16 cdoffs,
u16 clkctrl_offs);
 extern void am33xx_cm_module_enable(u8 mode, u16 inst, s16 cdoffs,
-- 
1.8.3.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


[PATCH v6 11/11] ARM: OMAP2+: AM43x PRCM init

2013-10-12 Thread Afzal Mohammed
From: Ambresh K ambr...@ti.com

Initialise AM43x HWMOD, powerdomains and clockdomains.

Signed-off-by: Ambresh K ambr...@ti.com
Signed-off-by: Afzal Mohammed af...@ti.com
Acked-by: Rajendra Nayak rna...@ti.com
Acked-by: Tony Lindgren t...@atomide.com
---
 arch/arm/mach-omap2/io.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index ff2113c..c90f647 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -594,7 +594,13 @@ void __init am43xx_init_early(void)
  NULL);
omap2_set_globals_prm(AM33XX_L4_WK_IO_ADDRESS(AM43XX_PRCM_BASE));
omap2_set_globals_cm(AM33XX_L4_WK_IO_ADDRESS(AM43XX_PRCM_BASE), NULL);
+   omap_prm_base_init();
+   omap_cm_base_init();
omap3xxx_check_revision();
+   am43xx_powerdomains_init();
+   am43xx_clockdomains_init();
+   am43xx_hwmod_init();
+   omap_hwmod_init_postsetup();
 }
 #endif
 
-- 
1.8.3.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: [GIT PULL] ARM: OMAP2+: hwmod changes for v3.13

2013-10-12 Thread Afzal Mohammed
Hi Paul,

On Friday 11 October 2013 10:30 PM, Paul Walmsley wrote:

 The following changes since commit d0e639c9e06d44e713170031fe05fb60ebe680af:
 
   Linux 3.12-rc4 (2013-10-06 14:00:20 -0700)
 
 are available in the git repository at:
 
   git://git.kernel.org/pub/scm/linux/kernel/git/pjw/omap-pending.git 
 tags/for-v3.13/hwmod
 
 for you to fetch changes up to ace1e3ec4a2540c783e65884bb7be9cd45a0a295:
 
   ARM: AM33xx: hwmod: Add RNG module data (2013-10-09 09:02:51 -0600)
 
 - 
 Some OMAP hwmod changes for 3.13.  Significant changes here include:
 
 - - support for moving some of the hwmod flags to DT data
 
 - - support for the SSI, hardware spinlock, USB host/TLL, and RNG IP
   blocks for various OMAPs
 
 - - a fix that again decouples hwmod data changes from unrelated DT data
   patchsets
 
 Basic test logs are available at:
 
 http://www.pwsan.com/omap/testlogs/prcm_fixes_v3.13/20131009094936/
 
 The summary reports that the 4460varsomom boots are failing, but this looks
 incorrect - it's probably a bug in the validation scripts here.
 
 - 

Can you please consider AM43x PRCM basic support also for the coming
merge window. I have rebased the AM43x PRCM series over your
for-v3.13/hwmod tag and posted as v6. The series has been Acked-by
Tony and Rajendra. New version has been tested on real silicon in AM43x
EPOS EVM (previous versions were tested on presilicon platform).

Regards
Afzal
--
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 00/11] ARM: OMAP2+: CM cleanup series

2013-10-12 Thread Tero Kristo

On 10/12/2013 05:19 AM, Paul Walmsley wrote:

Hi

On Fri, 11 Oct 2013, Tero Kristo wrote:


A small cleanup set for CM. This basically gets rid of the omap2_cm_*
register accesses from the random code locations, and gathers these
under cm2xxx.c and cm3xxx.c. This is done in preparation for creating
a separate CM driver. The set also contains a couple of PRM cleanups
which I decided to take care of at the same time due to overlapping
code (PRCM interrupt handler + DSP reset.)

TODO: cleanup dsp bridge code (arch/arm/mach-omap2/dsp.c.)

Tested on OMAP3 beagle + 3.12-rc3.


Looks like at least one patch has a dependency on your DT clk patches:

Importing patch clk-ti-add-dt-alias-clock ...
error: drivers/clk/ti/Makefile: does not exist in index
error: include/linux/clk/ti.h: does not exist in index
stg import: Diff does not apply cleanly


Hmm what? No it doesn't have any dependency. At most, there could be 
merge conflicts between the two, as this is completely separated set.


-Tero



Tried compiling the rest, but the build broke:

arch/arm/mach-omap2/mcbsp.c: In function 'omap3_enable_st_clock':
arch/arm/mach-omap2/mcbsp.c:46:3: error: implicit declaration of function 
'omap2_clk_deny_idle'
arch/arm/mach-omap2/mcbsp.c:48:3: error: implicit declaration of function 
'omap2_clk_allow_idle'
make[1]: *** [arch/arm/mach-omap2/mcbsp.o] Error 1
make: *** [arch/arm/mach-omap2] Error 2
make: *** Waiting for unfinished jobs


- 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


Re: [PATCH v2] ARM: OMAP2+: wakeupgen: AM43x adaptation

2013-10-12 Thread Afzal Mohammed
Hi Tony,

On Wednesday 09 October 2013 12:42 PM, Afzal Mohammed wrote:
 AM43x has 224 interrupts and 7 banks, make it as maximum values. Keep
 default values as earlier, if am43x is detected, update interrupts and
 banks accordingly.
 
 Also AM43x has only one cpu, ensure that clearing bitmask at wakeupgen
 is done only for the single existing cpu, existing code assumes that
 there are two cpu's.
 
 If bitmask is cleared in wakeupgen for the nonexistent second cpu,
 an imprecise abort happens as soon as Kernel switches to user space.
 It was rootcaused by Sekhar Nori nsek...@ti.com.
 
 Signed-off-by: Afzal Mohammed af...@ti.com
 ---
 
 v2:
 1. make AM43x adaptation such that changes required for new SoC addition is 
 less
 2. avoid usage of am43x local variable, use soc_is_am43xx() instead

Seems you missed this one, please consider this for the coming merge
window. Without this AM43x would not boot to prompt.

Regards
Afzal

--
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: [PATCHv7 00/36] ARM: OMAP: clock data conversion to DT

2013-10-12 Thread Tero Kristo

On 10/12/2013 01:37 AM, Paul Walmsley wrote:

On Fri, 11 Oct 2013, Tero Kristo wrote:


Oh yea, one additional note you probably have missed. Mike asked us to fall
back to vendor specific bindings at around v6 or so of this set. Take a look
at v8, we have dropped the use of generic bindings, we are not trying to
declare those with this set.


No, I didn't miss it.


This set introduces vendor specific bindings only, and even these are
claimed 'unstable', which should be enough to discourage people from
burning those to OTP type memory.


Better to just avoid merging unstable bindings in the first place.

Please keep this in mind: any change that anyone makes to the DT data
needs to be supportable by the kernel into the indefinite future, once it
makes it into arch/arm/boot/dts or the DT binding documentation.  Also,
any changes need to work for other OSes, i.e., the changes should not be
Linux-specific.


As pointed out earlier, the unstable claim just points to the fact that 
we might have some generic clock bindings in distant future at which 
point we _might_ evolve that way. Personally I have no problems carrying 
these binding to the far future, as they are vendor specific, and pretty 
much also device specific (am3-dpll-* omap4-dpll-* etc.)


Later on, we can add also support for clock firmware or whatever if we 
want to optimize stuff.


If we do not merge the bindings now, what is your proposal then? We have 
a couple of new SoC:s in queue and getting them boot mainline currently 
we only have this option to get them to work. Hardware is not going to 
wait for two years so we can have generic clock bindings in place. I 
would rather have this resolved as soon as possible, and it would have 
been much better if you came forward with your claims at version 1 or 2 
of this set, rather than at v8 and saying all should be forfeit.


-Tero



Those have been stated goals for the Linux DT project since day one.
Some folks haven't been monitoring those goals very closely and that's
unfortunate.  We could have avoided some pretty big messes.


- 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


Re: [RESEND PATCH V2 1/2] ARM: dts: AM33xx: Add RNG node

2013-10-12 Thread Lokesh Vutla
Hi Benoit,
On Thursday 29 August 2013 06:22 PM, Lokesh Vutla wrote:
 Add the AM33xx RNG module's device tree data.
 Also add Documentation file describing the data
 for the RNG module.
Seems you missed this patch. Please consider this for this merge window.
Patch 2/2 is already taken by Paul.
Without this patch AM335x boot will crash as I mentioned in my cover letter.

Thanks and regards,
Lokesh
 
 Signed-off-by: Lokesh Vutla lokeshvu...@ti.com
 ---
 Changes since V1:
 - Drop status=disabled entry in dt node, Since
   RNG is present on all AM33xx platforms.
 
  .../devicetree/bindings/hwrng/omap_rng.txt |   22 
 
  arch/arm/boot/dts/am33xx.dtsi  |7 +++
  2 files changed, 29 insertions(+)
  create mode 100644 Documentation/devicetree/bindings/hwrng/omap_rng.txt
 
 diff --git a/Documentation/devicetree/bindings/hwrng/omap_rng.txt 
 b/Documentation/devicetree/bindings/hwrng/omap_rng.txt
 new file mode 100644
 index 000..6a62acd
 --- /dev/null
 +++ b/Documentation/devicetree/bindings/hwrng/omap_rng.txt
 @@ -0,0 +1,22 @@
 +OMAP SoC HWRNG Module
 +
 +Required properties:
 +
 +- compatible : Should contain entries for this and backward compatible
 +  RNG versions:
 +  - ti,omap2-rng for OMAP2.
 +  - ti,omap4-rng for OMAP4, OMAP5 and AM33XX.
 +  Note that these two versions are incompatible.
 +- ti,hwmods: Name of the hwmod associated with the RNG module
 +- reg : Offset and length of the register set for the module
 +- interrupts : the interrupt number for the RNG module.
 + Only used for ti,omap4-rng.
 +
 +Example:
 +/* AM335x */
 +rng: rng@4831 {
 + compatible = ti,omap4-rng;
 + ti,hwmods = rng;
 + reg = 0x4831 0x2000;
 + interrupts = 111;
 +};
 diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
 index 38b446b..26ebe30 100644
 --- a/arch/arm/boot/dts/am33xx.dtsi
 +++ b/arch/arm/boot/dts/am33xx.dtsi
 @@ -530,5 +530,12 @@
   #size-cells = 1;
   status = disabled;
   };
 +
 + rng: rng@4831 {
 + compatible = ti,omap4-rng;
 + ti,hwmods = rng;
 + reg = 0x4831 0x2000;
 + interrupts = 111;
 + };
   };
  };
 

--
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 v2 1/2] ARM: dts: dra7-evm: Add mmc1 node for micro-sd support

2013-10-12 Thread Balaji T K

On Saturday 12 October 2013 12:46 AM, Benoit Cousson wrote:

Hi Balaji,

On 11/10/2013 18:44, Balaji T K wrote:

On Thursday 10 October 2013 12:21 AM, Sekhar Nori wrote:

On Monday 07 October 2013 09:55 PM, Balaji T K wrote:

Add mmc1 dt node to dra7-evm board.
Input for ldo1 regulator is controlled by gpio 5 of pcf8575 chip (0x21)
on i2c1 bus. When dt support for gpio-pcf857x is available, input supply
will be modelled as cascaded regulator.

Signed-off-by: Balaji T K balaj...@ti.com


Acked-by: Sekhar Nori nsek...@ti.com


Hi Benoit,

Can you let me know if you have any comments on this patch series?


The series looks good, and I've just applied it for 3.13.


Thanks Benoit

- Balaji T K
--
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 00/11] ARM: OMAP2+: CM cleanup series

2013-10-12 Thread Paul Walmsley
Hi

On Sat, 12 Oct 2013, Tero Kristo wrote:

 Hmm what? No it doesn't have any dependency. At most, there could be merge
 conflicts between the two, as this is completely separated set.

Thanks, looks like I accidentally mixed this set with your other one.


- 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


Re: [RESEND PATCH V2 1/2] ARM: dts: AM33xx: Add RNG node

2013-10-12 Thread Paul Walmsley
On Sat, 12 Oct 2013, Lokesh Vutla wrote:

 Seems you missed this patch. Please consider this for this merge window.
 Patch 2/2 is already taken by Paul.
 Without this patch AM335x boot will crash as I mentioned in my cover letter.

That won't happen since this patch from Suman got merged:

http://www.mail-archive.com/linux-omap@vger.kernel.org/msg96447.html


- 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


RE: [PATCH v8 0/6] mtd:nand:omap2: clean-up of supported ECC schemes

2013-10-12 Thread Gupta, Pekon
Hi Brain,

 
 Hi Pekon,
 
 I will try to summarize the standing of your patch series.
 
 Patches 1 and 2 look good and have addressed all of the DT maintainers'
 comments, AFAICT. They are ready to go in, except that the following
 patches are not ready; they should probably go in together.
 
 You ignored most of my comments to patch 3, and it is insufficiently
 documented. Please take a look at my comments, both here (in v8) and in
 v6. It still should be split into more patches.
 
I tried splitting the earlier [PATCH 3/6], therefore a new patch for merging
various Hamming ECC schemes was spawned. But, I could not clean more
because I would have broken the NAND functionality in between the
patches.
My apologies, I missed some of you other comments, so I'm preparing
next version by splitting [PATCH 3/6] into more sub-patches for ease of
review. 
Most #ifdef were put to suppress warning of un-used functions during
compile time. So those cannot be removed, otherwise this patch would
give compile warnings under randconfig.


 Patch 4 does too much without describing it. Why are you dropping the
 old omap3_correct_data_bch() code? Is this just refactoring? If so, you
 should say so. And this also suggests that you have two logical changes
 going on that should be separated into different patches; one to
 refactor the open-coded NAND/BCH library to replace it with the
 nand_bch.{c,h} support library and one for the new ECC modes.
 
Agreed, I update commit log to be more explicit that here nand_bch.c
actually encapsulates lib/bch.c.
Here also I cannot remove #ifdef across nand_bch_free() because
it frees some bch control data, which would not be defined for all
ecc-schemes (it is specific to xx_SW  ecc schemes). Hence removing
#ifdef here would give null-pointer exception.


 Patch 5 is good but should wait until the other DT parts are acceptable
 and merged into MTD.
 
 Patch 6 needs rewriting to use devm_* functions properly, but it was
 never integral to this patch series. You can improve it and resend with
 this series or just send it separately afterward.
 
Yes I understood this, but I think it would be still good to explicitly
free the resources in case of module_remove(), because that would
free all resources instantaneously without waiting for devm_ to 
iterate thru the list when it wakes-up (I guess).

I'm not knowledgeable of exact implementation of devm_ and how
often does it iterates the list and frees the resources for corresponding
un-registered devices. So trusting you I'll include your feedbacks here.


with regards, pekon
--
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 v8 3/6] mtd:nand:omap2: clean-up BCHx_HW and BCHx_SW ECC configurations in device_probe

2013-10-12 Thread Gupta, Pekon
Hi Brian,

Thanks for such detailed review, please see some replies below..

 From: Brian Norris [mailto:computersforpe...@gmail.com]
  On Fri, Oct 11, 2013 at 07:06:40PM +0530, Pekon Gupta wrote:
[...]
 Why do you even need the #ifdef's for the #include's? It is not harmful
 to include headers for stuff that is only conditionally used. In fact,
 this creates a problem later when you try to use nand_bch_free(), and
 you have to surround it with extra #ifdef's.
 
 In short: these #ifdef's just breed more #ifdef's and cause the code to
 become harder to read and less maintainable.
 
There are 2 problems here:
(1) 
I have removed #ifdef across headers in next version. But I cannot remove
#ifdef across some callbacks for  cc.hwctl(), ecc.calculate(), ecc.correct(),
because then compilation would throw warnings for un-used functions.
(2)
OMAP driver uses generic lib/bch.c which is compiled only when
CONFIG_MTD_NAND_ECC_BCH is enabled. So to avoid compilation
issues, I had to put #ifdefs on all wrapper functions which use lib/bch.c
or nand_bch.c

I myself have tried in previous versions to avoid #ifdefs, but I ended
up in one or the other problem like (1) |  (2) above.
And this is where randconfig test failed earlier when Arnd Bergmann
commented, so some #ifdef would hv to be carried till be deprecate
some legacy ecc-schemes.
However, with patch split many redundant #ifdefs are now removed.


 (I commented about the #ifdef's around nand_bch_free() in v6, and you
 did not address the comment.)
 
Done now.. My bad again, I somehow mis-interpreted nand_bch.c earlier.


  @@ -1846,20 +1726,18 @@ static int omap_nand_probe(struct
  -   info-nand.options  |= NAND_SKIP_BBTSCAN;
  -#ifdef CONFIG_MTD_NAND_OMAP_BCH
  +   nand_chip-options  |= NAND_SKIP_BBTSCAN |
 NAND_BUSWIDTH_AUTO;
 
 I recommended (in v6) you split the NAND_BUSWIDTH_AUTO change to a
 new
 patch and to describe it in the commit. You did neither.
 
Sorry missed this purposely because I could not separate out the changes.
But now I have re-worked this in next revision as a separate patch.


  +   /* scan NAND device conncted to controller */
  +   if (nand_scan_ident(mtd, 1, NULL)) {
  +   err = -ENXIO;
  +   goto out_release_mem_region;
  +   }
  +   pr_info(%s: detected %s NAND flash\n, DRIVER_NAME,
  +   (nand_chip-options  NAND_BUSWIDTH_16) ?
 x16 : x8);
 
 I recommended you kill this in v6, and you did not address my comments.
 
Sorry, this was my bad.


with regards, pekon
--
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 v8 0/6] mtd:nand:omap2: clean-up of supported ECC schemes

2013-10-12 Thread Brian Norris

Hi Pekon,

On 10/12/2013 03:26 PM, Gupta, Pekon wrote:


I will try to summarize the standing of your patch series.

Patches 1 and 2 look good and have addressed all of the DT maintainers'
comments, AFAICT. They are ready to go in, except that the following
patches are not ready; they should probably go in together.

You ignored most of my comments to patch 3, and it is insufficiently
documented. Please take a look at my comments, both here (in v8) and in
v6. It still should be split into more patches.


I tried splitting the earlier [PATCH 3/6], therefore a new patch for merging
various Hamming ECC schemes was spawned. But, I could not clean more
because I would have broken the NAND functionality in between the
patches.


From what I understand, your comment cleans redundant code in patch 3 
is entirely its own logical change; you're replacing the SW ECC in 
omap2.c with the library wrapper in lib/bch.c, right? So this should be 
described as such (as replacing XXX with YYY) and can easily be its 
own patch?


Also, you add an 'mtd' and a 'nand_chip' (can you just call this 'chip' 
or maybe 'nand', like in other drivers?) variable to the probe function, 
and then partially convert the function over to inconsistently using mtd 
vs. info-mtd and nand_chip vs. info-nand. If you want to add these 
variables, just make it a separate patch.


I also mentioned your changes to the buswidth code, which seem to have 
snuck in again. This should be a separate patch.



My apologies, I missed some of you other comments, so I'm preparing
next version by splitting [PATCH 3/6] into more sub-patches for ease of
review.


Great, thanks.


Most #ifdef were put to suppress warning of un-used functions during
compile time. So those cannot be removed, otherwise this patch would
give compile warnings under randconfig.


Could be marked __maybe_unused instead? #ifdef's are also OK, if 
necessary. There were just a few places I pointed out that they was 
certainly not needed.



Patch 4 does too much without describing it. Why are you dropping the
old omap3_correct_data_bch() code? Is this just refactoring? If so, you
should say so. And this also suggests that you have two logical changes
going on that should be separated into different patches; one to
refactor the open-coded NAND/BCH library to replace it with the
nand_bch.{c,h} support library and one for the new ECC modes.


Agreed, I update commit log to be more explicit that here nand_bch.c
actually encapsulates lib/bch.c.
Here also I cannot remove #ifdef across nand_bch_free() because
it frees some bch control data, which would not be defined for all
ecc-schemes (it is specific to xx_SW  ecc schemes). Hence removing
#ifdef here would give null-pointer exception.


Note that nand_bch_free() (and many others in nand_bch.h) are given 
empty inline implementation for CONFIG_MTD_NAND_ECC_BCH=n. But if you 
are unsure, then you can leave the #ifdef's to be conservative.



Patch 5 is good but should wait until the other DT parts are acceptable
and merged into MTD.

Patch 6 needs rewriting to use devm_* functions properly, but it was
never integral to this patch series. You can improve it and resend with
this series or just send it separately afterward.


Yes I understood this, but I think it would be still good to explicitly
free the resources in case of module_remove(), because that would
free all resources instantaneously without waiting for devm_ to
iterate thru the list when it wakes-up (I guess).


devm_* is part of the driver core, so it does the cleanup immediately on 
a non-zero return from the probe() callback, or after exit from the 
remove() callback. It does not have to wake up. Its only overhead is 
the small amount of memory used for the linked-list management.


Again, this is an optional piece of work, so don't worry about it too 
much. But you get 0 benefit (just a slight increase in memory usage) if 
you just convert all the kfree() calls to devm_kfree().



I'm not knowledgeable of exact implementation of devm_ and how
often does it iterates the list and frees the resources for corresponding
un-registered devices. So trusting you I'll include your feedbacks here.


I haven't closely reviewed 100% of its implementation, but it is fairly 
straightforward and commonly used in many drivers. You should be fine 
using it as documented and recommended by me.


Thanks,
Brian
--
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 v8 3/6] mtd:nand:omap2: clean-up BCHx_HW and BCHx_SW ECC configurations in device_probe

2013-10-12 Thread Brian Norris

Hi Pekon,

On 10/12/2013 04:58 PM, Gupta, Pekon wrote:

From: Brian Norris [mailto:computersforpe...@gmail.com]

On Fri, Oct 11, 2013 at 07:06:40PM +0530, Pekon Gupta wrote:

[...]

Why do you even need the #ifdef's for the #include's? It is not harmful
to include headers for stuff that is only conditionally used. In fact,
this creates a problem later when you try to use nand_bch_free(), and
you have to surround it with extra #ifdef's.

In short: these #ifdef's just breed more #ifdef's and cause the code to
become harder to read and less maintainable.


First off, I should clarify this: the above comment was speaking *only* 
about surrounding the #include's with #ifdef's. Such #ifdef's only make 
everything else harder.


Now, I recognize that there are still many cases where you may need 
#ifdef's in the body of the code. I was only trying to hit the easiest ones.



There are 2 problems here:
(1)
I have removed #ifdef across headers in next version. But I cannot remove
#ifdef across some callbacks for  cc.hwctl(), ecc.calculate(), ecc.correct(),
because then compilation would throw warnings for un-used functions.


The __maybe_unused attribute can be given to functions that will compile 
but are unused, and the compiler will just remove unused ones from the 
binary without warning. That is probably (weakly) preferable to 
#ifdef's, if you can manage it. But I understand some #ifdef's are 
necessary.



(2)
OMAP driver uses generic lib/bch.c which is compiled only when
CONFIG_MTD_NAND_ECC_BCH is enabled. So to avoid compilation
issues, I had to put #ifdefs on all wrapper functions which use lib/bch.c
or nand_bch.c


nand_bch.c (and its corresponding nand_bch.h) has stub implementations 
so that extra #ifdef's often aren't needed. But include/linux/bch.h does 
not, so you are correct.



I myself have tried in previous versions to avoid #ifdefs, but I ended
up in one or the other problem like (1) |  (2) above.
And this is where randconfig test failed earlier when Arnd Bergmann
commented, so some #ifdef would hv to be carried till be deprecate
some legacy ecc-schemes.
However, with patch split many redundant #ifdefs are now removed.


Great, thanks for the effort.

Regards,
Brian
--
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