[PATCH v2] clk: ti: fix dual-registration of uart4_ick

2015-09-29 Thread Ben Dooks
On the OMAP AM3517 platform the uart4_ick gets registered
twice, causing any power managment to /dev/ttyO3 to fail
when trying to wake the device up.

This solves the following oops:

[] Unhandled fault: external abort on non-linefetch (0x1028) at 0xfa09e008
[] PC is at serial_omap_pm+0x48/0x15c
[] LR is at _raw_spin_unlock_irqrestore+0x30/0x5c

Cc: sta...@vger.kernel.org
Cc: mturque...@baylibre.com
Cc: sb...@codeaurora.org
Cc: linux-...@vger.kernel.org
Cc: linux-omap@vger.kernel.org
Cc: t-kri...@ti.com
Cc: linux-ker...@lists.codethink.co.uk
Signed-off-by: Ben Dooks 
--
v2:
- fix omap36xx series clock registration for uart4
---
 drivers/clk/ti/clk-3xxx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/ti/clk-3xxx.c b/drivers/clk/ti/clk-3xxx.c
index 5e12f32..8d94b97 100644
--- a/drivers/clk/ti/clk-3xxx.c
+++ b/drivers/clk/ti/clk-3xxx.c
@@ -374,7 +374,6 @@ static struct ti_dt_clk omap3xxx_clks[] = {
DT_CLK(NULL, "gpio2_ick", "gpio2_ick"),
DT_CLK(NULL, "wdt3_ick", "wdt3_ick"),
DT_CLK(NULL, "uart3_ick", "uart3_ick"),
-   DT_CLK(NULL, "uart4_ick", "uart4_ick"),
DT_CLK(NULL, "gpt9_ick", "gpt9_ick"),
DT_CLK(NULL, "gpt8_ick", "gpt8_ick"),
DT_CLK(NULL, "gpt7_ick", "gpt7_ick"),
@@ -523,6 +522,7 @@ static struct ti_dt_clk am35xx_clks[] = {
 static struct ti_dt_clk omap36xx_clks[] = {
DT_CLK(NULL, "omap_192m_alwon_fck", "omap_192m_alwon_fck"),
DT_CLK(NULL, "uart4_fck", "uart4_fck"),
+   DT_CLK(NULL, "uart4_ick", "uart4_ick"),
{ .node_name = NULL },
 };
 
-- 
2.5.3

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


Re: [PATCH] clk: ti: fix dual-registration of uart4_ick

2015-09-29 Thread Ben Dooks
On 25/09/15 06:42, Tero Kristo wrote:
> On 09/23/2015 08:30 PM, Tony Lindgren wrote:
>> * Ben Dooks  [150923 07:53]:
>>> On the OMAP AM3517 platform the uart4_ick gets registered
>>> twice, causing any power managment to /dev/ttyO3 to fail
>>> when trying to wake the device up.
>>>
>>> This solves the following oops:
>>>
>>> [] Unhandled fault: external abort on non-linefetch (0x1028) at
>>> 0xfa09e008
>>> [] PC is at serial_omap_pm+0x48/0x15c
>>> [] LR is at _raw_spin_unlock_irqrestore+0x30/0x5c
>>
>> No uart4 on 34xx/35xx, that got introduced with 36xx so:
>>
>> Acked-by: Tony Lindgren 
>>
>>> Signed-off-by: Ben Dooks 
>>> ---
>>>   drivers/clk/ti/clk-3xxx.c | 1 -
>>>   1 file changed, 1 deletion(-)
>>>
>>> diff --git a/drivers/clk/ti/clk-3xxx.c b/drivers/clk/ti/clk-3xxx.c
>>> index 5e12f32..2e7ef1f 100644
>>> --- a/drivers/clk/ti/clk-3xxx.c
>>> +++ b/drivers/clk/ti/clk-3xxx.c
>>> @@ -374,7 +374,6 @@ static struct ti_dt_clk omap3xxx_clks[] = {
>>>   DT_CLK(NULL, "gpio2_ick", "gpio2_ick"),
>>>   DT_CLK(NULL, "wdt3_ick", "wdt3_ick"),
>>>   DT_CLK(NULL, "uart3_ick", "uart3_ick"),
>>> -DT_CLK(NULL, "uart4_ick", "uart4_ick"),
>>>   DT_CLK(NULL, "gpt9_ick", "gpt9_ick"),
>>>   DT_CLK(NULL, "gpt8_ick", "gpt8_ick"),
>>>   DT_CLK(NULL, "gpt7_ick", "gpt7_ick"),
> 
> NAK.
> 
> This patch is actually only partially correct, it removes the uart4_ick
> alias for omap36xx also. It should be added back to the omap36xx clks
> array. Care to post a v2?

Thankyou for the feedback. I'll update, but do not have a device to test.

-- 
Ben Dooks   http://www.codethink.co.uk/
Senior Engineer Codethink - Providing Genius
--
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


[PATCHv3] arm: omap2: timer: always define omap4_local_timer_init

2015-09-29 Thread Felipe Balbi
omap4_local_timer_init() can be used by other
platforms as is. At least AM437x wants to use
it. Instead of making omap4-only and providing
a stub for builds without OMAP4, we can just
always define that function.

Reported-by: Nishanth Menon 
Signed-off-by: Felipe Balbi 
---

changes since v2:
  - move ifdefs around

changes since v1:
  - make sure result builds on AM43xx-only builds


 arch/arm/mach-omap2/timer.c | 16 +++-
 1 file changed, 3 insertions(+), 13 deletions(-)

diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index e4d8701f99f9..3ebe16cd645e 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -634,32 +634,22 @@ OMAP_SYS_32K_TIMER_INIT(3_secure, 12, "secure_32k_fck", 
"ti,timer-secure",
2, "timer_sys_ck", NULL);
 #endif /* CONFIG_ARCH_OMAP3 */
 
-#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_SOC_AM33XX) || \
-   defined(CONFIG_SOC_AM43XX)
+#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_SOC_AM33XX)
 OMAP_SYS_GP_TIMER_INIT(3, 2, "timer_sys_ck", NULL,
   1, "timer_sys_ck", "ti,timer-alwon");
 #endif
 
 #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) || \
-   defined(CONFIG_SOC_DRA7XX)
+   defined(CONFIG_SOC_DRA7XX) || defined(CONFIG_SOC_AM43XX)
 static OMAP_SYS_32K_TIMER_INIT(4, 1, "timer_32k_ck", "ti,timer-alwon",
   2, "sys_clkin_ck", NULL);
-#endif
 
-#ifdef CONFIG_ARCH_OMAP4
-#ifdef CONFIG_HAVE_ARM_TWD
 void __init omap4_local_timer_init(void)
 {
omap4_sync32k_timer_init();
clocksource_of_init();
 }
-#else
-void __init omap4_local_timer_init(void)
-{
-   omap4_sync32k_timer_init();
-}
-#endif /* CONFIG_HAVE_ARM_TWD */
-#endif /* CONFIG_ARCH_OMAP4 */
+#endif
 
 #if defined(CONFIG_SOC_OMAP5) || defined(CONFIG_SOC_DRA7XX)
 void __init omap5_realtime_timer_init(void)
-- 
2.5.3

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


Re: [PATCHv4] arm: omap2: timer: always define omap4_local_timer_init

2015-09-29 Thread Nishanth Menon
On 09/29/2015 11:15 AM, Felipe Balbi wrote:
> omap4_local_timer_init() can be used by other
> platforms as is. At least AM437x wants to use
> it. Instead of making omap4-only and providing
> a stub for builds without OMAP4, we can just
> make sure that function is always available
> for all SoCs that need it.

Sounds right now. $subject needs fixing. if Tony is ok picking and
fixing it up himself...

Reviewed-by: Nishanth Menon 

> 
> Reported-by: Nishanth Menon 
> Signed-off-by: Felipe Balbi 
> ---
> 
> changes since v3:
>   - modify commit log slightly
> 
> changes since v2:
>   - move ifdefs around
> 
> changes since v1:
>   - make sure result builds on AM43xx-only builds
> 
>  arch/arm/mach-omap2/timer.c | 16 +++-
>  1 file changed, 3 insertions(+), 13 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
> index e4d8701f99f9..3ebe16cd645e 100644
> --- a/arch/arm/mach-omap2/timer.c
> +++ b/arch/arm/mach-omap2/timer.c
> @@ -634,32 +634,22 @@ OMAP_SYS_32K_TIMER_INIT(3_secure, 12, "secure_32k_fck", 
> "ti,timer-secure",
>   2, "timer_sys_ck", NULL);
>  #endif /* CONFIG_ARCH_OMAP3 */
>  
> -#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_SOC_AM33XX) || \
> - defined(CONFIG_SOC_AM43XX)
> +#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_SOC_AM33XX)
>  OMAP_SYS_GP_TIMER_INIT(3, 2, "timer_sys_ck", NULL,
>  1, "timer_sys_ck", "ti,timer-alwon");
>  #endif
>  
>  #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) || \
> - defined(CONFIG_SOC_DRA7XX)
> + defined(CONFIG_SOC_DRA7XX) || defined(CONFIG_SOC_AM43XX)
>  static OMAP_SYS_32K_TIMER_INIT(4, 1, "timer_32k_ck", "ti,timer-alwon",
>  2, "sys_clkin_ck", NULL);
> -#endif
>  
> -#ifdef CONFIG_ARCH_OMAP4
> -#ifdef CONFIG_HAVE_ARM_TWD
>  void __init omap4_local_timer_init(void)
>  {
>   omap4_sync32k_timer_init();
>   clocksource_of_init();
>  }
> -#else
> -void __init omap4_local_timer_init(void)
> -{
> - omap4_sync32k_timer_init();
> -}
> -#endif /* CONFIG_HAVE_ARM_TWD */
> -#endif /* CONFIG_ARCH_OMAP4 */
> +#endif
>  
>  #if defined(CONFIG_SOC_OMAP5) || defined(CONFIG_SOC_DRA7XX)
>  void __init omap5_realtime_timer_init(void)
> 


-- 
Regards,
Nishanth Menon
--
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: [PATCHv3] arm: omap2: timer: always define omap4_local_timer_init

2015-09-29 Thread Nishanth Menon
On 09/29/2015 10:53 AM, Felipe Balbi wrote:
> omap4_local_timer_init() can be used by other
> platforms as is. At least AM437x wants to use
> it. Instead of making omap4-only and providing
> a stub for builds without OMAP4, we can just
> always define that function.
> 
> Reported-by: Nishanth Menon 
> Signed-off-by: Felipe Balbi 
> ---
> 
> changes since v2:
>   - move ifdefs around
> 
> changes since v1:
>   - make sure result builds on AM43xx-only builds
> 
> 
>  arch/arm/mach-omap2/timer.c | 16 +++-
>  1 file changed, 3 insertions(+), 13 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
> index e4d8701f99f9..3ebe16cd645e 100644
> --- a/arch/arm/mach-omap2/timer.c
> +++ b/arch/arm/mach-omap2/timer.c
> @@ -634,32 +634,22 @@ OMAP_SYS_32K_TIMER_INIT(3_secure, 12, "secure_32k_fck", 
> "ti,timer-secure",
>   2, "timer_sys_ck", NULL);
>  #endif /* CONFIG_ARCH_OMAP3 */
>  
> -#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_SOC_AM33XX) || \
> - defined(CONFIG_SOC_AM43XX)
> +#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_SOC_AM33XX)
>  OMAP_SYS_GP_TIMER_INIT(3, 2, "timer_sys_ck", NULL,
>  1, "timer_sys_ck", "ti,timer-alwon");
>  #endif
>  
>  #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) || \
> - defined(CONFIG_SOC_DRA7XX)
> + defined(CONFIG_SOC_DRA7XX) || defined(CONFIG_SOC_AM43XX)
>  static OMAP_SYS_32K_TIMER_INIT(4, 1, "timer_32k_ck", "ti,timer-alwon",
>  2, "sys_clkin_ck", NULL);
> -#endif
>  
> -#ifdef CONFIG_ARCH_OMAP4
> -#ifdef CONFIG_HAVE_ARM_TWD
>  void __init omap4_local_timer_init(void)
>  {
>   omap4_sync32k_timer_init();
>   clocksource_of_init();
>  }
> -#else
> -void __init omap4_local_timer_init(void)
> -{
> - omap4_sync32k_timer_init();
> -}
> -#endif /* CONFIG_HAVE_ARM_TWD */
> -#endif /* CONFIG_ARCH_OMAP4 */
> +#endif
>  
>  #if defined(CONFIG_SOC_OMAP5) || defined(CONFIG_SOC_DRA7XX)
>  void __init omap5_realtime_timer_init(void)
> 

OK -> the change was subtle for v3 -> you now have the entire
omap4_local_timer_init under the same #ifdef as for the rest.

but then, you are wrong on $subject and commit message since you are no
longer always enabling the local_timer_init.

otherwise the change itself looks ok to me.


-- 
Regards,
Nishanth Menon
--
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


[PATCHv4] arm: omap2: timer: always define omap4_local_timer_init

2015-09-29 Thread Felipe Balbi
omap4_local_timer_init() can be used by other
platforms as is. At least AM437x wants to use
it. Instead of making omap4-only and providing
a stub for builds without OMAP4, we can just
make sure that function is always available
for all SoCs that need it.

Reported-by: Nishanth Menon 
Signed-off-by: Felipe Balbi 
---

changes since v3:
  - modify commit log slightly

changes since v2:
  - move ifdefs around

changes since v1:
  - make sure result builds on AM43xx-only builds

 arch/arm/mach-omap2/timer.c | 16 +++-
 1 file changed, 3 insertions(+), 13 deletions(-)

diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index e4d8701f99f9..3ebe16cd645e 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -634,32 +634,22 @@ OMAP_SYS_32K_TIMER_INIT(3_secure, 12, "secure_32k_fck", 
"ti,timer-secure",
2, "timer_sys_ck", NULL);
 #endif /* CONFIG_ARCH_OMAP3 */
 
-#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_SOC_AM33XX) || \
-   defined(CONFIG_SOC_AM43XX)
+#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_SOC_AM33XX)
 OMAP_SYS_GP_TIMER_INIT(3, 2, "timer_sys_ck", NULL,
   1, "timer_sys_ck", "ti,timer-alwon");
 #endif
 
 #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) || \
-   defined(CONFIG_SOC_DRA7XX)
+   defined(CONFIG_SOC_DRA7XX) || defined(CONFIG_SOC_AM43XX)
 static OMAP_SYS_32K_TIMER_INIT(4, 1, "timer_32k_ck", "ti,timer-alwon",
   2, "sys_clkin_ck", NULL);
-#endif
 
-#ifdef CONFIG_ARCH_OMAP4
-#ifdef CONFIG_HAVE_ARM_TWD
 void __init omap4_local_timer_init(void)
 {
omap4_sync32k_timer_init();
clocksource_of_init();
 }
-#else
-void __init omap4_local_timer_init(void)
-{
-   omap4_sync32k_timer_init();
-}
-#endif /* CONFIG_HAVE_ARM_TWD */
-#endif /* CONFIG_ARCH_OMAP4 */
+#endif
 
 #if defined(CONFIG_SOC_OMAP5) || defined(CONFIG_SOC_DRA7XX)
 void __init omap5_realtime_timer_init(void)
-- 
2.5.3

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


[RFC/PATCH 09/11] clocksource: add TI 32.768 Hz counter driver

2015-09-29 Thread Felipe Balbi
Introduce a new clocksource driver for Texas
Instruments 32.768 Hz device which is available
on most OMAP-like devices.

Signed-off-by: Felipe Balbi 
---
 drivers/clocksource/Kconfig|   8 +++
 drivers/clocksource/Makefile   |   1 +
 drivers/clocksource/timer-ti-32k.c | 121 +
 3 files changed, 130 insertions(+)
 create mode 100644 drivers/clocksource/timer-ti-32k.c

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index a7726db13abb..0ccfd12a00a3 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -115,6 +115,14 @@ config CLKSRC_PISTACHIO
bool
select CLKSRC_OF
 
+config CLKSRC_TI_32K
+   bool "Texas Instruments 32.768 Hz Clocksource"
+   depends on OF && ARCH_OMAP2PLUS
+   select CLKSRC_OF
+   help
+ This option enables support for Texas Instruments 32.768 Hz 
clocksource
+ available on many OMAP-like platforms.
+
 config CLKSRC_STM32
bool "Clocksource for STM32 SoCs" if !ARCH_STM32
depends on OF && ARM && (ARCH_STM32 || COMPILE_TEST)
diff --git a/drivers/clocksource/Makefile b/drivers/clocksource/Makefile
index 5c00863c3e33..749abc3665b3 100644
--- a/drivers/clocksource/Makefile
+++ b/drivers/clocksource/Makefile
@@ -45,6 +45,7 @@ obj-$(CONFIG_VF_PIT_TIMER)+= vf_pit_timer.o
 obj-$(CONFIG_CLKSRC_QCOM)  += qcom-timer.o
 obj-$(CONFIG_MTK_TIMER)+= mtk_timer.o
 obj-$(CONFIG_CLKSRC_PISTACHIO) += time-pistachio.o
+obj-$(CONFIG_CLKSRC_TI_32K)+= timer-ti-32k.o
 
 obj-$(CONFIG_ARM_ARCH_TIMER)   += arm_arch_timer.o
 obj-$(CONFIG_ARM_GLOBAL_TIMER) += arm_global_timer.o
diff --git a/drivers/clocksource/timer-ti-32k.c 
b/drivers/clocksource/timer-ti-32k.c
new file mode 100644
index ..10ccce2eb645
--- /dev/null
+++ b/drivers/clocksource/timer-ti-32k.c
@@ -0,0 +1,121 @@
+/**
+ * timer-ti-32k.c - OMAP2 32k Timer Support
+ *
+ * Copyright (C) 2015 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 version 2  of
+ * the License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see .
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+/* OMAP2_32KSYNCNT_CR_OFF: offset of 32ksync counter register */
+#define OMAP2_32KSYNCNT_REV_OFF0x0
+#define OMAP2_32KSYNCNT_REV_SCHEME (0x3 << 30)
+#define OMAP2_32KSYNCNT_CR_OFF_LOW 0x10
+#define OMAP2_32KSYNCNT_CR_OFF_HIGH0x30
+
+/*
+ * 32KHz clocksource ... always available, on pretty most chips except
+ * OMAP 730 and 1510.  Other timers could be used as clocksources, with
+ * higher resolution in free-running counter modes (e.g. 12 MHz xtal),
+ * but systems won't necessarily want to spend resources that way.
+ */
+static void __iomem *sync32k_cnt_reg;
+
+/**
+ * omap_read_persistent_clock64 -  Return time from a persistent clock.
+ *
+ * Reads the time from a source which isn't disabled during PM, the
+ * 32k sync timer.  Convert the cycles elapsed since last read into
+ * nsecs and adds to a monotonically increasing timespec64.
+ */
+static struct timespec64 persistent_ts;
+static cycles_t cycles;
+static unsigned int persistent_mult, persistent_shift;
+
+static u64 notrace omap_32k_read_sched_clock(void)
+{
+   return readl_relaxed(sync32k_cnt_reg);
+}
+
+static void omap_read_persistent_clock64(struct timespec64 *ts)
+{
+   unsigned long long nsecs;
+   cycles_t last_cycles;
+
+   last_cycles = cycles;
+   cycles = sync32k_cnt_reg ? readl_relaxed(sync32k_cnt_reg) : 0;
+
+   nsecs = clocksource_cyc2ns(cycles - last_cycles,
+   persistent_mult, persistent_shift);
+
+   timespec64_add_ns(_ts, nsecs);
+
+   *ts = persistent_ts;
+}
+
+static void __init ti_32k_timer_init(struct device_node *np)
+{
+   void __iomem *vbase;
+   int ret;
+
+   vbase = of_iomap(np, 0);
+   if (!vbase) {
+   pr_err("Can't ioremap 32k timer base\n");
+   return;
+   }
+
+   /*
+* 32k sync Counter IP register offsets vary between the
+* highlander version and the legacy ones.
+* The 'SCHEME' bits(30-31) of the revision register is used
+* to identify the version.
+*/
+   if (readl_relaxed(vbase + OMAP2_32KSYNCNT_REV_OFF) &
+   

[RFC/PATCH 07/11] arm: omap2: timer: remove omap4_local_timer_init

2015-09-29 Thread Felipe Balbi
We're now always calling clocksource_of_init()
whenever booting with DT, so we can use the
generic omap_sync32k_timer_init() (which will
be renamed in a follow-up patch) for OMAP4
as well.

Signed-off-by: Felipe Balbi 
---
 arch/arm/mach-omap2/board-generic.c | 4 ++--
 arch/arm/mach-omap2/common.h| 1 -
 arch/arm/mach-omap2/timer.c | 8 
 3 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/arch/arm/mach-omap2/board-generic.c 
b/arch/arm/mach-omap2/board-generic.c
index d08191ffabd9..13f7df92baf4 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -235,7 +235,7 @@ DT_MACHINE_START(OMAP4_DT, "Generic OMAP4 (Flattened Device 
Tree)")
.init_irq   = omap_gic_of_init,
.init_machine   = omap_generic_init,
.init_late  = omap4430_init_late,
-   .init_time  = omap4_local_timer_init,
+   .init_time  = omap_sync32k_timer_init,
.dt_compat  = omap4_boards_compat,
.restart= omap44xx_restart,
 MACHINE_END
@@ -279,7 +279,7 @@ DT_MACHINE_START(AM43_DT, "Generic AM43 (Flattened Device 
Tree)")
.init_late  = am43xx_init_late,
.init_irq   = omap_gic_of_init,
.init_machine   = omap_generic_init,
-   .init_time  = omap4_local_timer_init,
+   .init_time  = omap_sync32k_timer_init,
.dt_compat  = am43_boards_compat,
.restart= omap44xx_restart,
 MACHINE_END
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
index 844ad031f7f0..bf42fc4e78f4 100644
--- a/arch/arm/mach-omap2/common.h
+++ b/arch/arm/mach-omap2/common.h
@@ -91,7 +91,6 @@ extern void omap2_init_common_infrastructure(void);
 extern void omap_sync32k_timer_init(void);
 extern void omap3_secure_sync32k_timer_init(void);
 extern void omap3_gptimer_timer_init(void);
-extern void omap4_local_timer_init(void);
 #ifdef CONFIG_CACHE_L2X0
 int omap_l2_cache_init(void);
 #define OMAP_L2C_AUX_CTRL  (L2C_AUX_CTRL_SHARED_OVERRIDE | \
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index 1ae563736b12..86c726ba2dd9 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -521,14 +521,6 @@ void __init omap3_gptimer_timer_init(void)
 }
 #endif
 
-#if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) || \
-   defined(CONFIG_SOC_DRA7XX) || defined(CONFIG_SOC_AM43XX)
-void __init omap4_local_timer_init(void)
-{
-   omap_sync32k_timer_init();
-}
-#endif
-
 #if defined(CONFIG_SOC_OMAP5) || defined(CONFIG_SOC_DRA7XX)
 
 /*
-- 
2.5.3

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


[RFC/PATCH 03/11] arm: omap2: timer: remove __omap_gptimer_init()

2015-09-29 Thread Felipe Balbi
since now we can reuse __omap_sync32k_timer_init()
for OMAP3-like devices, we can safely remove
__omap_gptimer_init().

Signed-off-by: Felipe Balbi 
---
 arch/arm/mach-omap2/timer.c | 14 ++
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index 4f9cd4b2e6b0..44db46ccd474 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -596,16 +596,6 @@ static inline void __init realtime_counter_init(void)
 {}
 #endif
 
-static void __init __omap_gptimer_init(int clkev_nr, const char *clkev_src,
-   const char *clkev_prop, int clksrc_nr, const char *clksrc_src,
-   const char *clksrc_prop)
-{
-   omap_clk_init();
-   omap_dmtimer_init();
-   omap2_gp_clockevent_init(clkev_nr, clkev_src, clkev_prop);
-   omap2_gptimer_clocksource_init(clksrc_nr, clksrc_src, clksrc_prop);
-}
-
 static void __init __omap_sync32k_timer_init(int clkev_nr, const char 
*clkev_src,
const char *clkev_prop, int clksrc_nr, const char *clksrc_src,
const char *clksrc_prop, bool gptimer)
@@ -647,8 +637,8 @@ void __init omap3_secure_sync32k_timer_init(void)
 #if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_SOC_AM33XX)
 void __init omap3_gptimer_timer_init(void)
 {
-   __omap_gptimer_init(2, "timer_sys_ck", NULL,
-  1, "timer_sys_ck", "ti,timer-alwon");
+   __omap_sync32k_timer_init(2, "timer_sys_ck", NULL,
+   1, "timer_sys_ck", "ti,timer-alwon", true);
 }
 #endif
 
-- 
2.5.3

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


[RFC/PATCH 11/11] arm: boot: dts: omap: add missing default status for 32k counter

2015-09-29 Thread Felipe Balbi
All devices should have a default status. Ignoring
the arguments if it should be 'okay' or 'disabled'
by default, let's set them all the 'disabled' and
have boards enable 32k counter.

Signed-off-by: Felipe Balbi 
---
 arch/arm/boot/dts/am4372.dtsi | 1 +
 arch/arm/boot/dts/am437x-gp-evm.dts   | 4 
 arch/arm/boot/dts/am437x-idk-evm.dts  | 4 
 arch/arm/boot/dts/am437x-sk-evm.dts   | 4 
 arch/arm/boot/dts/am43x-epos-evm.dts  | 4 
 arch/arm/boot/dts/dra7.dtsi   | 1 +
 arch/arm/boot/dts/omap2420-h4.dts | 4 
 arch/arm/boot/dts/omap2420.dtsi   | 1 +
 arch/arm/boot/dts/omap2430.dtsi   | 1 +
 arch/arm/boot/dts/omap3-beagle-xm.dts | 4 
 arch/arm/boot/dts/omap3-beagle.dts| 4 
 arch/arm/boot/dts/omap3-ldp.dts   | 4 
 arch/arm/boot/dts/omap3-n900.dts  | 4 
 arch/arm/boot/dts/omap3.dtsi  | 1 +
 arch/arm/boot/dts/omap3430-sdp.dts| 4 
 arch/arm/boot/dts/omap4-sdp.dts   | 4 
 arch/arm/boot/dts/omap4.dtsi  | 1 +
 arch/arm/boot/dts/omap5-cm-t54.dts| 4 
 arch/arm/boot/dts/omap5-uevm.dts  | 4 
 arch/arm/boot/dts/omap5.dtsi  | 1 +
 20 files changed, 59 insertions(+)

diff --git a/arch/arm/boot/dts/am4372.dtsi b/arch/arm/boot/dts/am4372.dtsi
index 0447c04a40cc..0a3e0a82ea96 100644
--- a/arch/arm/boot/dts/am4372.dtsi
+++ b/arch/arm/boot/dts/am4372.dtsi
@@ -349,6 +349,7 @@
compatible = 
"ti,am4372-counter32k","ti,omap-counter32k";
reg = <0x44e86000 0x40>;
ti,hwmods = "counter_32k";
+   status = "disabled";
};
 
rtc: rtc@44e3e000 {
diff --git a/arch/arm/boot/dts/am437x-gp-evm.dts 
b/arch/arm/boot/dts/am437x-gp-evm.dts
index 22038f21f228..f4b6cb6efde3 100644
--- a/arch/arm/boot/dts/am437x-gp-evm.dts
+++ b/arch/arm/boot/dts/am437x-gp-evm.dts
@@ -954,3 +954,7 @@
clock-names = "ext-clk", "int-clk";
status = "okay";
 };
+
+ {
+   status = "okay";
+};
diff --git a/arch/arm/boot/dts/am437x-idk-evm.dts 
b/arch/arm/boot/dts/am437x-idk-evm.dts
index af25801418b4..17c429d4e136 100644
--- a/arch/arm/boot/dts/am437x-idk-evm.dts
+++ b/arch/arm/boot/dts/am437x-idk-evm.dts
@@ -413,3 +413,7 @@
  {
cpu0-supply = <>;
 };
+
+ {
+   status = "okay";
+};
diff --git a/arch/arm/boot/dts/am437x-sk-evm.dts 
b/arch/arm/boot/dts/am437x-sk-evm.dts
index 7da7c2da4af1..f0d9d26e644e 100644
--- a/arch/arm/boot/dts/am437x-sk-evm.dts
+++ b/arch/arm/boot/dts/am437x-sk-evm.dts
@@ -734,3 +734,7 @@
};
};
 };
+
+ {
+   status = "okay";
+};
diff --git a/arch/arm/boot/dts/am43x-epos-evm.dts 
b/arch/arm/boot/dts/am43x-epos-evm.dts
index 86c2dfbe8875..9a0cd866e3ab 100644
--- a/arch/arm/boot/dts/am43x-epos-evm.dts
+++ b/arch/arm/boot/dts/am43x-epos-evm.dts
@@ -792,3 +792,7 @@
tx-num-evt = <32>;
rx-num-evt = <32>;
 };
+
+ {
+   status = "okay";
+};
diff --git a/arch/arm/boot/dts/dra7.dtsi b/arch/arm/boot/dts/dra7.dtsi
index 5d65db9ebc2b..a6f2072b6c46 100644
--- a/arch/arm/boot/dts/dra7.dtsi
+++ b/arch/arm/boot/dts/dra7.dtsi
@@ -193,6 +193,7 @@
compatible = "ti,omap-counter32k";
reg = <0x4000 0x40>;
ti,hwmods = "counter_32k";
+   status = "disabled";
};
 
prm: prm@6000 {
diff --git a/arch/arm/boot/dts/omap2420-h4.dts 
b/arch/arm/boot/dts/omap2420-h4.dts
index 34cdecb4fdda..f41d95836dcf 100644
--- a/arch/arm/boot/dts/omap2420-h4.dts
+++ b/arch/arm/boot/dts/omap2420-h4.dts
@@ -64,3 +64,7 @@
};
};
 };
+
+ {
+   status = "okay";
+};
diff --git a/arch/arm/boot/dts/omap2420.dtsi b/arch/arm/boot/dts/omap2420.dtsi
index 5b9a376cc31e..abef0670e7e6 100644
--- a/arch/arm/boot/dts/omap2420.dtsi
+++ b/arch/arm/boot/dts/omap2420.dtsi
@@ -70,6 +70,7 @@
compatible = "ti,omap-counter32k";
reg = <0x4000 0x20>;
ti,hwmods = "counter_32k";
+   status = "disabled";
};
};
 
diff --git a/arch/arm/boot/dts/omap2430.dtsi b/arch/arm/boot/dts/omap2430.dtsi
index 2390f387c271..f501b6f355a4 100644
--- a/arch/arm/boot/dts/omap2430.dtsi
+++ b/arch/arm/boot/dts/omap2430.dtsi
@@ -82,6 +82,7 @@
compatible = "ti,omap-counter32k";
reg = <0x2 0x20>;
ti,hwmods = "counter_32k";
+   status = "disabled";
};
};
 
diff --git a/arch/arm/boot/dts/omap3-beagle-xm.dts 
b/arch/arm/boot/dts/omap3-beagle-xm.dts
index 7c4dca122a91..47a354f22363 100644
--- a/arch/arm/boot/dts/omap3-beagle-xm.dts
+++ b/arch/arm/boot/dts/omap3-beagle-xm.dts
@@ -390,3 +390,7 @@
  

[PATCH 1/2] ti-soc-thermal: implement omap3 support

2015-09-29 Thread Eduardo Valentin
From: Pavel Machek 

This adds support for OMAP3 chips to ti-soc-thermal. As requested by
TI people, it is marked unreliable and warning is printed.

Signed-off-by: Pavel Machek 
Signed-off-by: Eduardo Valentin 
---
 .../devicetree/bindings/thermal/ti_soc_thermal.txt |   7 ++
 drivers/thermal/ti-soc-thermal/Kconfig |  15 +++
 drivers/thermal/ti-soc-thermal/Makefile|   1 +
 .../thermal/ti-soc-thermal/omap3-thermal-data.c| 103 +
 drivers/thermal/ti-soc-thermal/ti-bandgap.c|  10 ++
 drivers/thermal/ti-soc-thermal/ti-bandgap.h|   9 ++
 6 files changed, 145 insertions(+)
 create mode 100644 drivers/thermal/ti-soc-thermal/omap3-thermal-data.c

diff --git a/Documentation/devicetree/bindings/thermal/ti_soc_thermal.txt 
b/Documentation/devicetree/bindings/thermal/ti_soc_thermal.txt
index 0c9222d..d9a1b54 100644
--- a/Documentation/devicetree/bindings/thermal/ti_soc_thermal.txt
+++ b/Documentation/devicetree/bindings/thermal/ti_soc_thermal.txt
@@ -10,6 +10,7 @@ to the silicon temperature.
 
 Required properties:
 - compatible : Should be:
+  - "ti,omap34xx-bandgap" : for OMAP34xx bandgap
   - "ti,omap4430-bandgap" : for OMAP4430 bandgap
   - "ti,omap4460-bandgap" : for OMAP4460 bandgap
   - "ti,omap4470-bandgap" : for OMAP4470 bandgap
@@ -25,6 +26,12 @@ to each bandgap version, because the mapping may change from
 soc to soc, apart of depending on available features.
 
 Example:
+OMAP34xx:
+bandgap {
+   reg = <0x48002524 0x4>;
+   compatible = "ti,omap34xx-bandgap";
+};
+
 OMAP4430:
 bandgap {
reg = <0x4a002260 0x4 0x4a00232C 0x4>;
diff --git a/drivers/thermal/ti-soc-thermal/Kconfig 
b/drivers/thermal/ti-soc-thermal/Kconfig
index cb6686f..ea8283f 100644
--- a/drivers/thermal/ti-soc-thermal/Kconfig
+++ b/drivers/thermal/ti-soc-thermal/Kconfig
@@ -19,6 +19,21 @@ config TI_THERMAL
  This includes trip points definitions, extrapolation rules and
  CPU cooling device bindings.
 
+config OMAP3_THERMAL
+   bool "Texas Instruments OMAP3 thermal support"
+   depends on TI_SOC_THERMAL
+   depends on ARCH_OMAP3 || COMPILE_TEST
+   help
+ If you say yes here you get thermal support for the Texas Instruments
+ OMAP3 SoC family. The current chips supported are:
+  - OMAP3430
+
+ OMAP3 chips normally don't need thermal management, and sensors in
+ this generation are not accurate, nor they are very close to
+ the important hotspots.
+
+ Say 'N' here.
+
 config OMAP4_THERMAL
bool "Texas Instruments OMAP4 thermal support"
depends on TI_SOC_THERMAL
diff --git a/drivers/thermal/ti-soc-thermal/Makefile 
b/drivers/thermal/ti-soc-thermal/Makefile
index 1226b24..0f89bdf 100644
--- a/drivers/thermal/ti-soc-thermal/Makefile
+++ b/drivers/thermal/ti-soc-thermal/Makefile
@@ -2,5 +2,6 @@ obj-$(CONFIG_TI_SOC_THERMAL)+= ti-soc-thermal.o
 ti-soc-thermal-y   := ti-bandgap.o
 ti-soc-thermal-$(CONFIG_TI_THERMAL)+= ti-thermal-common.o
 ti-soc-thermal-$(CONFIG_DRA752_THERMAL)+= dra752-thermal-data.o
+ti-soc-thermal-$(CONFIG_OMAP3_THERMAL) += omap3-thermal-data.o
 ti-soc-thermal-$(CONFIG_OMAP4_THERMAL) += omap4-thermal-data.o
 ti-soc-thermal-$(CONFIG_OMAP5_THERMAL) += omap5-thermal-data.o
diff --git a/drivers/thermal/ti-soc-thermal/omap3-thermal-data.c 
b/drivers/thermal/ti-soc-thermal/omap3-thermal-data.c
new file mode 100644
index 000..8470225
--- /dev/null
+++ b/drivers/thermal/ti-soc-thermal/omap3-thermal-data.c
@@ -0,0 +1,103 @@
+/*
+ * OMAP3 thermal driver.
+ *
+ * Copyright (C) 2011-2012 Texas Instruments Inc.
+ * Copyright (C) 2014 Pavel Machek 
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * Note
+ * http://www.ti.com/lit/er/sprz278f/sprz278f.pdf "Advisory
+ * 3.1.1.186 MMC OCP Clock Not Gated When Thermal Sensor Is Used"
+ *
+ * Also TI says:
+ * Just be careful when you try to make thermal policy like decisions
+ * based on this sensor. Placement of the sensor w.r.t the actual logic
+ * generating heat has to be a factor as well. If you are just looking
+ * for an approximation temperature (thermometerish kind), you might be
+ * ok with this. I am not sure we'd find any TI data around this.. just a
+ * heads up.
+ */
+
+#include "ti-thermal.h"
+#include "ti-bandgap.h"
+
+/*
+ * OMAP34XX has one instance of thermal sensor for MPU
+ * need to describe the individual bit fields
+ */
+static struct temp_sensor_registers

[PATCH 0/2] thermal: omap3 support

2015-09-29 Thread Eduardo Valentin
Folks,

I am add these two patches for next merge window. Pavels patch
was idling for some time in the mailing list and I found it
and gave it a try. In the process, added 36xx support too.

DTS part is not done though.

Anyways, they are in linux-next now. Have fun.

BR,

Eduardo Valentin (1):
  thermal: ti-soc-thermal: add OMAP36xx support

Pavel Machek (1):
  ti-soc-thermal: implement omap3 support

 .../devicetree/bindings/thermal/ti_soc_thermal.txt |  14 ++
 drivers/thermal/ti-soc-thermal/Kconfig |  15 ++
 drivers/thermal/ti-soc-thermal/Makefile|   1 +
 .../thermal/ti-soc-thermal/omap3-thermal-data.c| 176 +
 drivers/thermal/ti-soc-thermal/ti-bandgap.c|  14 ++
 drivers/thermal/ti-soc-thermal/ti-bandgap.h|  11 ++
 6 files changed, 231 insertions(+)
 create mode 100644 drivers/thermal/ti-soc-thermal/omap3-thermal-data.c

-- 
2.5.0

--
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 2/2] thermal: ti-soc-thermal: add OMAP36xx support

2015-09-29 Thread Eduardo Valentin
Add OMAP36xx support to ti-soc-thermal driver. This
chip is also unreliable. The data provided here is
based on OMAP36xx TRM:
http://www.ti.com/lit/ug/swpu177aa/swpu177aa.pdf

Signed-off-by: Eduardo Valentin 
Signed-off-by: Eduardo Valentin 
---
 .../devicetree/bindings/thermal/ti_soc_thermal.txt |  7 +++
 .../thermal/ti-soc-thermal/omap3-thermal-data.c| 73 ++
 drivers/thermal/ti-soc-thermal/ti-bandgap.c|  4 ++
 drivers/thermal/ti-soc-thermal/ti-bandgap.h|  2 +
 4 files changed, 86 insertions(+)

diff --git a/Documentation/devicetree/bindings/thermal/ti_soc_thermal.txt 
b/Documentation/devicetree/bindings/thermal/ti_soc_thermal.txt
index d9a1b54..6299dd8 100644
--- a/Documentation/devicetree/bindings/thermal/ti_soc_thermal.txt
+++ b/Documentation/devicetree/bindings/thermal/ti_soc_thermal.txt
@@ -11,6 +11,7 @@ to the silicon temperature.
 Required properties:
 - compatible : Should be:
   - "ti,omap34xx-bandgap" : for OMAP34xx bandgap
+  - "ti,omap36xx-bandgap" : for OMAP36xx bandgap
   - "ti,omap4430-bandgap" : for OMAP4430 bandgap
   - "ti,omap4460-bandgap" : for OMAP4460 bandgap
   - "ti,omap4470-bandgap" : for OMAP4470 bandgap
@@ -32,6 +33,12 @@ bandgap {
compatible = "ti,omap34xx-bandgap";
 };
 
+OMAP36xx:
+bandgap {
+   reg = <0x48002524 0x4>;
+   compatible = "ti,omap36xx-bandgap";
+};
+
 OMAP4430:
 bandgap {
reg = <0x4a002260 0x4 0x4a00232C 0x4>;
diff --git a/drivers/thermal/ti-soc-thermal/omap3-thermal-data.c 
b/drivers/thermal/ti-soc-thermal/omap3-thermal-data.c
index 8470225..3ee3434 100644
--- a/drivers/thermal/ti-soc-thermal/omap3-thermal-data.c
+++ b/drivers/thermal/ti-soc-thermal/omap3-thermal-data.c
@@ -101,3 +101,76 @@ const struct ti_bandgap_data omap34xx_data = {
},
.sensor_count = 1,
 };
+
+/*
+ * OMAP36XX has one instance of thermal sensor for MPU
+ * need to describe the individual bit fields
+ */
+static struct temp_sensor_registers
+omap36xx_mpu_temp_sensor_registers = {
+   .temp_sensor_ctrl = 0,
+   .bgap_soc_mask = BIT(9),
+   .bgap_eocz_mask = BIT(8),
+   .bgap_dtemp_mask = 0xFF,
+
+   .bgap_mode_ctrl = 0,
+   .mode_ctrl_mask = BIT(10),
+};
+
+/* Thresholds and limits for OMAP36XX MPU temperature sensor */
+static struct temp_sensor_data omap36xx_mpu_temp_sensor_data = {
+   .min_freq = 32768,
+   .max_freq = 32768,
+   .max_temp = 125000,
+   .min_temp = -4,
+   .hyst_val = 5000,
+};
+
+/*
+ * Temperature values in milli degree celsius
+ */
+static const int
+omap36xx_adc_to_temp[128] = {
+   -4, -4, -4, -4, -4, -4, -4, -4,
+   -4, -4, -4, -4, -4, -38000, -35000, -34000,
+   -32000, -3, -28000, -26000, -24000, -22000, -2, -18500,
+   -17000, -15000, -13500, -12000, -1, -8000, -6500, -5000, -3500,
+   -1500, 0, 2000, 3500, 5000, 6500, 8500, 1, 12000, 13500,
+   15000, 17000, 19000, 21000, 23000, 25000, 27000, 28500, 3,
+   32000, 33500, 35000, 37000, 38500, 4, 42000, 43500, 45000,
+   47000, 48500, 5, 52000, 53500, 55000, 57000, 58500, 6,
+   62000, 64000, 66000, 68000, 7, 71500, 73500, 75000, 77000,
+   78500, 8, 82000, 83500, 85000, 87000, 88500, 9, 92000,
+   93500, 95000, 97000, 98500, 10, 102000, 103500, 105000, 107000,
+   109000, 111000, 113000, 115000, 117000, 118500, 12, 122000,
+   123500, 125000, 125000, 125000, 125000, 125000, 125000, 125000,
+   125000, 125000, 125000, 125000, 125000, 125000, 125000, 125000,
+   125000, 125000, 125000, 125000, 125000, 125000, 125000
+};
+
+/* OMAP36XX data */
+const struct ti_bandgap_data omap36xx_data = {
+   .features = TI_BANDGAP_FEATURE_CLK_CTRL | TI_BANDGAP_FEATURE_UNRELIABLE,
+   .fclock_name = "ts_fck",
+   .div_ck_name = "ts_fck",
+   .conv_table = omap36xx_adc_to_temp,
+   .adc_start_val = 0,
+   .adc_end_val = 127,
+   .expose_sensor = ti_thermal_expose_sensor,
+   .remove_sensor = ti_thermal_remove_sensor,
+
+   .sensors = {
+   {
+   .registers = _mpu_temp_sensor_registers,
+   .ts_data = _mpu_temp_sensor_data,
+   .domain = "cpu",
+   .slope = 0,
+   .constant = 2,
+   .slope_pcb = 0,
+   .constant_pcb = 2,
+   .register_cooling = NULL,
+   .unregister_cooling = NULL,
+   },
+   },
+   .sensor_count = 1,
+};
diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.c 
b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
index 9f9ed72..1e34a1e 100644
--- a/drivers/thermal/ti-soc-thermal/ti-bandgap.c
+++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
@@ -1588,6 +1588,10 @@ static const struct of_device_id of_ti_bandgap_match[] = 
{
.compatible = "ti,omap34xx-bandgap",
.data = (void *)_data,
   

Re: [PATCHv3 1/1] ti-soc-thermal: implement omap3 support

2015-09-29 Thread Eduardo Valentin
On Tue, Sep 15, 2015 at 01:24:16PM +0200, Pavel Machek wrote:
> On Wed 2015-09-09 21:58:09, Eduardo Valentin wrote:
> > From: Pavel Machek 
> > 
> > This adds support for OMAP3 chips to ti-soc-thermal. As requested by
> > TI people, it is marked unreliable and warning is printed.
> > 
> > Cc: Zhang Rui 
> > Cc: linux...@vger.kernel.org
> > Cc: linux-omap@vger.kernel.org
> > Cc: linux-ker...@vger.kernel.org
> > Signed-off-by: Pavel Machek 
> > Signed-off-by: Eduardo Valentin 
> > ---
> >  .../devicetree/bindings/thermal/ti_soc_thermal.txt |   7 ++
> >  drivers/thermal/ti-soc-thermal/Kconfig |  15 +++
> >  drivers/thermal/ti-soc-thermal/Makefile|   1 +
> >  .../thermal/ti-soc-thermal/omap3-thermal-data.c| 103 
> > +
> >  drivers/thermal/ti-soc-thermal/ti-bandgap.c|  10 ++
> >  drivers/thermal/ti-soc-thermal/ti-bandgap.h|   9 ++
> >  6 files changed, 145 insertions(+)
> >  create mode 100644 drivers/thermal/ti-soc-thermal/omap3-thermal-data.c
> > ---
> > 
> > Just not leave Pavels work behind, I took his patch and amended a couple
> > of things:
> > (1) added the omap3 DT example
> > (2) improved the dev_warn message
> > (3) improved the code documentation
> 
> Thanks!
> 
> Is it on its way to mainline or is there something more to do?


Nothing else to do. I am applying to my next branch.

> 
>   Pavel
> 
> -- 
> (english) http://www.livejournal.com/~pavelmachek
> (cesky, pictures) 
> http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC/PATCH 00/11] arm: omap: counter32k rework

2015-09-29 Thread Felipe Balbi
Hi,

the following patches de-obfuscate arch/arm/mach-omap2/timer.c
and start moving code to drivers/clocksource. So far only counter32k
has been moved over.

Note that we can't get rid of all the code (yet) because there are
still platforms relying to legacy boot and because of the strong
coupling with OMAP's hwmod layer.

This is, for now, an RFC and has be written on top of [1]. Boot tested
with AM335x and AM437x.

[1] http://marc.info/?l=linux-omap=144354336924308=2

ps: if anybody has a good idea on how to get rid of
register_persistent_clock(), please let me know

Felipe Balbi (11):
  arm: omap2: timer: get rid of obfuscating macros
  arm: omap2: timer: add a gptimer argument to sync32k_timer_init()
  arm: omap2: timer: remove __omap_gptimer_init()
  arm: omap2: timer: provide generic sync32k_timer_init function
  arm: omap2: timer: move realtime_counter_init() around
  arm: omap2: timer: always call clocksource_of_init() when DT
  arm: omap2: timer: remove omap4_local_timer_init
  arm: omap2: timer: rename omap_sync32k_timer_init()
  clocksource: add TI 32.768 Hz counter driver
  arm: omap2: timer: limit hwmod usage to non-DT boots
  arm: boot: dts: omap: add missing default status for 32k counter

 arch/arm/boot/dts/am4372.dtsi |   1 +
 arch/arm/boot/dts/am437x-gp-evm.dts   |   4 +
 arch/arm/boot/dts/am437x-idk-evm.dts  |   4 +
 arch/arm/boot/dts/am437x-sk-evm.dts   |   4 +
 arch/arm/boot/dts/am43x-epos-evm.dts  |   4 +
 arch/arm/boot/dts/dra7.dtsi   |   1 +
 arch/arm/boot/dts/omap2420-h4.dts |   4 +
 arch/arm/boot/dts/omap2420.dtsi   |   1 +
 arch/arm/boot/dts/omap2430.dtsi   |   1 +
 arch/arm/boot/dts/omap3-beagle-xm.dts |   4 +
 arch/arm/boot/dts/omap3-beagle.dts|   4 +
 arch/arm/boot/dts/omap3-ldp.dts   |   4 +
 arch/arm/boot/dts/omap3-n900.dts  |   4 +
 arch/arm/boot/dts/omap3.dtsi  |   1 +
 arch/arm/boot/dts/omap3430-sdp.dts|   4 +
 arch/arm/boot/dts/omap4-sdp.dts   |   4 +
 arch/arm/boot/dts/omap4.dtsi  |   1 +
 arch/arm/boot/dts/omap5-cm-t54.dts|   4 +
 arch/arm/boot/dts/omap5-uevm.dts  |   4 +
 arch/arm/boot/dts/omap5.dtsi  |   1 +
 arch/arm/mach-omap2/board-generic.c   |  14 ++--
 arch/arm/mach-omap2/board-ldp.c   |   2 +-
 arch/arm/mach-omap2/board-rx51.c  |   2 +-
 arch/arm/mach-omap2/common.h  |   4 +-
 arch/arm/mach-omap2/timer.c   | 138 ++
 drivers/clocksource/Kconfig   |   8 ++
 drivers/clocksource/Makefile  |   1 +
 drivers/clocksource/timer-ti-32k.c| 121 +
 28 files changed, 255 insertions(+), 94 deletions(-)
 create mode 100644 drivers/clocksource/timer-ti-32k.c

-- 
2.5.3

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


[RFC/PATCH 05/11] arm: omap2: timer: move realtime_counter_init() around

2015-09-29 Thread Felipe Balbi
no functional changes, just moving that function
closer to its calling location.

Signed-off-by: Felipe Balbi 
---
 arch/arm/mach-omap2/timer.c | 102 ++--
 1 file changed, 50 insertions(+), 52 deletions(-)

diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index a416bcb38f2c..deccec2d6ed8 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -480,7 +480,55 @@ static void __init omap2_gptimer_clocksource_init(int 
gptimer_id,
clocksource_gpt.name, clksrc.rate);
 }
 
-#ifdef CONFIG_SOC_HAS_REALTIME_COUNTER
+static void __init __omap_sync32k_timer_init(int clkev_nr, const char 
*clkev_src,
+   const char *clkev_prop, int clksrc_nr, const char *clksrc_src,
+   const char *clksrc_prop, bool gptimer)
+{
+   omap_clk_init();
+   omap_dmtimer_init();
+   omap2_gp_clockevent_init(clkev_nr, clkev_src, clkev_prop);
+
+   /* Enable the use of clocksource="gp_timer" kernel parameter */
+   if (use_gptimer_clksrc || gptimer)
+   omap2_gptimer_clocksource_init(clksrc_nr, clksrc_src,
+   clksrc_prop);
+   else
+   omap2_sync32k_clocksource_init();
+}
+
+void __init omap_sync32k_timer_init(void)
+{
+   __omap_sync32k_timer_init(1, "timer_32k_ck", "ti,timer-alwon",
+   2, "timer_sys_ck", NULL, false);
+}
+
+#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_SOC_AM43XX)
+void __init omap3_secure_sync32k_timer_init(void)
+{
+   __omap_sync32k_timer_init(12, "secure_32k_fck", "ti,timer-secure",
+   2, "timer_sys_ck", NULL, false);
+}
+#endif /* CONFIG_ARCH_OMAP3 */
+
+#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_SOC_AM33XX)
+void __init omap3_gptimer_timer_init(void)
+{
+   __omap_sync32k_timer_init(2, "timer_sys_ck", NULL,
+   1, "timer_sys_ck", "ti,timer-alwon", true);
+}
+#endif
+
+#if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) || \
+   defined(CONFIG_SOC_DRA7XX) || defined(CONFIG_SOC_AM43XX)
+void __init omap4_local_timer_init(void)
+{
+   omap_sync32k_timer_init();
+   clocksource_of_init();
+}
+#endif
+
+#if defined(CONFIG_SOC_OMAP5) || defined(CONFIG_SOC_DRA7XX)
+
 /*
  * The realtime counter also called master counter, is a free-running
  * counter, which is related to real time. It produces the count used
@@ -492,6 +540,7 @@ static void __init omap2_gptimer_clocksource_init(int 
gptimer_id,
  */
 static void __init realtime_counter_init(void)
 {
+#ifdef CONFIG_SOC_HAS_REALTIME_COUNTER
void __iomem *base;
static struct clk *sys_clk;
unsigned long rate;
@@ -590,60 +639,9 @@ sysclk1_based:
set_cntfreq();
 
iounmap(base);
-}
-#else
-static inline void __init realtime_counter_init(void)
-{}
 #endif
-
-static void __init __omap_sync32k_timer_init(int clkev_nr, const char 
*clkev_src,
-   const char *clkev_prop, int clksrc_nr, const char *clksrc_src,
-   const char *clksrc_prop, bool gptimer)
-{
-   omap_clk_init();
-   omap_dmtimer_init();
-   omap2_gp_clockevent_init(clkev_nr, clkev_src, clkev_prop);
-
-   /* Enable the use of clocksource="gp_timer" kernel parameter */
-   if (use_gptimer_clksrc || gptimer)
-   omap2_gptimer_clocksource_init(clksrc_nr, clksrc_src,
-   clksrc_prop);
-   else
-   omap2_sync32k_clocksource_init();
-}
-
-void __init omap_sync32k_timer_init(void)
-{
-   __omap_sync32k_timer_init(1, "timer_32k_ck", "ti,timer-alwon",
-   2, "timer_sys_ck", NULL, false);
 }
 
-#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_SOC_AM43XX)
-void __init omap3_secure_sync32k_timer_init(void)
-{
-   __omap_sync32k_timer_init(12, "secure_32k_fck", "ti,timer-secure",
-   2, "timer_sys_ck", NULL, false);
-}
-#endif /* CONFIG_ARCH_OMAP3 */
-
-#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_SOC_AM33XX)
-void __init omap3_gptimer_timer_init(void)
-{
-   __omap_sync32k_timer_init(2, "timer_sys_ck", NULL,
-   1, "timer_sys_ck", "ti,timer-alwon", true);
-}
-#endif
-
-#if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) || \
-   defined(CONFIG_SOC_DRA7XX) || defined(CONFIG_SOC_AM43XX)
-void __init omap4_local_timer_init(void)
-{
-   omap_sync32k_timer_init();
-   clocksource_of_init();
-}
-#endif
-
-#if defined(CONFIG_SOC_OMAP5) || defined(CONFIG_SOC_DRA7XX)
 void __init omap5_realtime_timer_init(void)
 {
omap_sync32k_timer_init();
-- 
2.5.3

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


[PATCH] clk: ti: dflt: fix enable_reg validity check

2015-09-29 Thread Suman Anna
The default clock enabling functions for TI clocks -
omap2_dflt_clk_enable() and omap2_dflt_clk_disable() perform a
NULL check for the enable_reg field of the clk_hw_omap structure.
This enable_reg field however is merely a combination of the index
of the master IP module, and the offset from the master IP module's
base address. A value of 0 is perfectly valid, and the current error
checking will fail in these cases. The issue was found when trying
to enable the iva2_ck clock on OMAP3 platforms.

So, switch the check to use IS_ERR. This correction is similar to the
logic used in commit c807dbedb5e5 ("clk: ti: fix ti_clk_get_reg_addr
error handling").

Signed-off-by: Suman Anna 
---
Hi Tero,

Patch done against 4.3-rc3. There are couple of similar checks in
drivers/clk/ti/clockdomain.c, but those seem to be ok. This is
a non-urgent fix, as there are currently no active users of
iva2_ck in the kernel (the MMU node is disabled in DT atm).

Boot tested on OMAP3 Beagle-XM, AM437x GP EVM, AM335x BeagleBone
Black, OMAP4 Panda, OMAP5 uEVM and DRA7 Beagle-X15 boards.

regards
Suman

Following is the error log from a unit test of the IVA MMU on OMAP3 using
some additional patch to enable the DTS node,

[   86.626342] omap_iommu_test_init: iommu_test_init entered
[   86.632080] omap_iommu_test iommu_test: Enabling IOMMU...
[   86.647460] omap_iommu_test iommu_test: testing IOMMU 5d00.mmu
[   86.654815] omap2_dflt_clk_enable: iva2_ck missing enable_reg
[   86.680938] [ cut here ]
[   86.685821] WARNING: CPU: 0 PID: 910 at drivers/clk/clk.c:675 
clk_disable+0x28/0x34()
[   86.694091] Modules linked in: iommu_dt_test(O+)
[   86.698974] CPU: 0 PID: 910 Comm: insmod Tainted: G   O
4.3.0-rc3-8-g61458979cbbe #40
[   86.708618] Hardware name: Generic OMAP36xx (Flattened Device Tree)
[   86.715240] [] (unwind_backtrace) from [] 
(show_stack+0x10/0x14)
[   86.723419] [] (show_stack) from [] 
(dump_stack+0x84/0x9c)
[   86.731048] [] (dump_stack) from [] 
(warn_slowpath_common+0x78/0xb4)
[   86.739593] [] (warn_slowpath_common) from [] 
(warn_slowpath_null+0x1c/0x24)
[   86.748870] [] (warn_slowpath_null) from [] 
(clk_disable+0x28/0x34)
[   86.757324] [] (clk_disable) from [] 
(_disable_clocks+0x18/0x68)
[   86.765502] [] (_disable_clocks) from [] 
(omap_hwmod_deassert_hardreset+0xc8/0x180)
[   86.775421] [] (omap_hwmod_deassert_hardreset) from [] 
(omap_device_deassert_hardreset+0x34/
0x54)
[   86.786621] [] (omap_device_deassert_hardreset) from [] 
(omap_iommu_attach_dev+0xbc/0x1fc)
[   86.797180] [] (omap_iommu_attach_dev) from [] 
(__iommu_attach_device+0x1c/0x80)
[   86.806854] [] (__iommu_attach_device) from [] 
(omap_iommu_test_probe+0xd0/0x21c [iommu_dt_t
est])
[   86.818054] [] (omap_iommu_test_probe [iommu_dt_test]) from 
[] (platform_drv_probe+0x44/0xa4
)
[   86.828857] [] (platform_drv_probe) from [] 
(driver_probe_device+0x1f4/0x2f0)
[   86.838195] [] (driver_probe_device) from [] 
(__driver_attach+0x94/0x98)
[   86.847045] [] (__driver_attach) from [] 
(bus_for_each_dev+0x6c/0xa0)
[   86.855651] [] (bus_for_each_dev) from [] 
(bus_add_driver+0x18c/0x214)
[   86.864349] [] (bus_add_driver) from [] 
(driver_register+0x78/0xf8)
[   86.872772] [] (driver_register) from [] 
(do_one_initcall+0x80/0x1dc)
[   86.881378] [] (do_one_initcall) from [] 
(do_init_module+0x5c/0x1d0)
[   86.889892] [] (do_init_module) from [] 
(load_module+0x1818/0x1f70)
[   86.898315] [] (load_module) from [] 
(SyS_init_module+0xdc/0x14c)
[   86.906555] [] (SyS_init_module) from [] 
(ret_fast_syscall+0x0/0x1c)
[   86.915039] ---[ end trace 49b229a4289ab8b2 ]---
[   86.919891] omap_hwmod: mmu_iva: failed to hardreset
[   86.925384] omap-iommu 5d00.mmu: deassert_reset failed: -16
[   86.931640] omap_iommu_test iommu_test: can't get omap iommu: -16
[   86.938140] omap_iommu_test iommu_test: can't attach iommu device: -16
[   86.945068] omap_iommu_test_init failed, ret = -16

 drivers/clk/ti/clkt_dflt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/ti/clkt_dflt.c b/drivers/clk/ti/clkt_dflt.c
index 90d7d8a21c49..1ddc288fce4e 100644
--- a/drivers/clk/ti/clkt_dflt.c
+++ b/drivers/clk/ti/clkt_dflt.c
@@ -222,7 +222,7 @@ int omap2_dflt_clk_enable(struct clk_hw *hw)
}
}
 
-   if (unlikely(!clk->enable_reg)) {
+   if (unlikely(IS_ERR(clk->enable_reg))) {
pr_err("%s: %s missing enable_reg\n", __func__,
   clk_hw_get_name(hw));
ret = -EINVAL;
@@ -264,7 +264,7 @@ void omap2_dflt_clk_disable(struct clk_hw *hw)
u32 v;
 
clk = to_clk_hw_omap(hw);
-   if (!clk->enable_reg) {
+   if (IS_ERR(clk->enable_reg)) {
/*
 * 'independent' here refers to a clock which is not
 * controlled by its parent.
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to 

[RFC/PATCH 02/11] arm: omap2: timer: add a gptimer argument to sync32k_timer_init()

2015-09-29 Thread Felipe Balbi
as it turns out, __omap_gptimer_init() and
__omap_sync32k_timer_init() are essentially
the same thing, but __omap_gptimer_init() wants
to always use gptimer.

Instead of forcing all those devices to pass
a use_gptimer cmdline argument, we add a new
function argument to __omap_sync32k_timer_init()
in preparation to deleting __omap_gptimer_init().

On a follow-up patch, we will remove uses of
__omap_gptimer_init() and replace them with
__omap_sync32k_timer_init() and pass the last
argument as true.

Signed-off-by: Felipe Balbi 
---
 arch/arm/mach-omap2/timer.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index 1f6532bd104e..4f9cd4b2e6b0 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -608,14 +608,14 @@ static void __init __omap_gptimer_init(int clkev_nr, 
const char *clkev_src,
 
 static void __init __omap_sync32k_timer_init(int clkev_nr, const char 
*clkev_src,
const char *clkev_prop, int clksrc_nr, const char *clksrc_src,
-   const char *clksrc_prop)
+   const char *clksrc_prop, bool gptimer)
 {
omap_clk_init();
omap_dmtimer_init();
omap2_gp_clockevent_init(clkev_nr, clkev_src, clkev_prop);
 
/* Enable the use of clocksource="gp_timer" kernel parameter */
-   if (use_gptimer_clksrc)
+   if (use_gptimer_clksrc || gptimer)
omap2_gptimer_clocksource_init(clksrc_nr, clksrc_src,
clksrc_prop);
else
@@ -626,7 +626,7 @@ static void __init __omap_sync32k_timer_init(int clkev_nr, 
const char *clkev_src
 void __init omap2_sync32k_timer_init(void)
 {
__omap_sync32k_timer_init(1, "timer_32k_ck", "ti,timer-alwon",
-   2, "timer_sys_ck", NULL);
+   2, "timer_sys_ck", NULL, false);
 }
 #endif /* CONFIG_ARCH_OMAP2 */
 
@@ -634,13 +634,13 @@ void __init omap2_sync32k_timer_init(void)
 void __init omap3_sync32k_timer_init(void)
 {
__omap_sync32k_timer_init(1, "timer_32k_ck", "ti,timer-alwon",
-   2, "timer_sys_ck", NULL);
+   2, "timer_sys_ck", NULL, false);
 }
 
 void __init omap3_secure_sync32k_timer_init(void)
 {
__omap_sync32k_timer_init(12, "secure_32k_fck", "ti,timer-secure",
-   2, "timer_sys_ck", NULL);
+   2, "timer_sys_ck", NULL, false);
 }
 #endif /* CONFIG_ARCH_OMAP3 */
 
@@ -657,7 +657,7 @@ void __init omap3_gptimer_timer_init(void)
 static void __init omap4_sync32k_timer_init(void)
 {
__omap_sync32k_timer_init(1, "timer_32k_ck", "ti,timer-alwon",
-  2, "sys_clkin_ck", NULL);
+   2, "sys_clkin_ck", NULL, false);
 }
 
 void __init omap4_local_timer_init(void)
-- 
2.5.3

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


[RFC/PATCH 04/11] arm: omap2: timer: provide generic sync32k_timer_init function

2015-09-29 Thread Felipe Balbi
instead of constantly defining a small wrapper
around __omap_sync32k_timer_init(), let's define
a generic one which can be used by all OMAPs.

Signed-off-by: Felipe Balbi 
---
 arch/arm/mach-omap2/board-generic.c | 10 +-
 arch/arm/mach-omap2/board-ldp.c |  2 +-
 arch/arm/mach-omap2/board-rx51.c|  2 +-
 arch/arm/mach-omap2/common.h|  3 +--
 arch/arm/mach-omap2/timer.c | 20 +++-
 5 files changed, 11 insertions(+), 26 deletions(-)

diff --git a/arch/arm/mach-omap2/board-generic.c 
b/arch/arm/mach-omap2/board-generic.c
index 89bf39663d61..d08191ffabd9 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -53,7 +53,7 @@ DT_MACHINE_START(OMAP242X_DT, "Generic OMAP2420 (Flattened 
Device Tree)")
.map_io = omap242x_map_io,
.init_early = omap2420_init_early,
.init_machine   = omap_generic_init,
-   .init_time  = omap2_sync32k_timer_init,
+   .init_time  = omap_sync32k_timer_init,
.dt_compat  = omap242x_boards_compat,
.restart= omap2xxx_restart,
 MACHINE_END
@@ -70,7 +70,7 @@ DT_MACHINE_START(OMAP243X_DT, "Generic OMAP2430 (Flattened 
Device Tree)")
.map_io = omap243x_map_io,
.init_early = omap2430_init_early,
.init_machine   = omap_generic_init,
-   .init_time  = omap2_sync32k_timer_init,
+   .init_time  = omap_sync32k_timer_init,
.dt_compat  = omap243x_boards_compat,
.restart= omap2xxx_restart,
 MACHINE_END
@@ -89,7 +89,7 @@ DT_MACHINE_START(OMAP3_N900_DT, "Nokia RX-51 board")
.init_early = omap3430_init_early,
.init_machine   = omap_generic_init,
.init_late  = omap3_init_late,
-   .init_time  = omap3_sync32k_timer_init,
+   .init_time  = omap_sync32k_timer_init,
.dt_compat  = n900_boards_compat,
.restart= omap3xxx_restart,
 MACHINE_END
@@ -107,7 +107,7 @@ DT_MACHINE_START(OMAP3_DT, "Generic OMAP3 (Flattened Device 
Tree)")
.init_early = omap3430_init_early,
.init_machine   = omap_generic_init,
.init_late  = omap3_init_late,
-   .init_time  = omap3_sync32k_timer_init,
+   .init_time  = omap_sync32k_timer_init,
.dt_compat  = omap3_boards_compat,
.restart= omap3xxx_restart,
 MACHINE_END
@@ -123,7 +123,7 @@ DT_MACHINE_START(OMAP36XX_DT, "Generic OMAP36xx (Flattened 
Device Tree)")
.init_early = omap3630_init_early,
.init_machine   = omap_generic_init,
.init_late  = omap3_init_late,
-   .init_time  = omap3_sync32k_timer_init,
+   .init_time  = omap_sync32k_timer_init,
.dt_compat  = omap36xx_boards_compat,
.restart= omap3xxx_restart,
 MACHINE_END
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index c2975af4cd5d..0d3a57c6931f 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -424,6 +424,6 @@ MACHINE_START(OMAP_LDP, "OMAP LDP board")
.init_irq   = omap3_init_irq,
.init_machine   = omap_ldp_init,
.init_late  = omap3430_init_late,
-   .init_time  = omap3_sync32k_timer_init,
+   .init_time  = omap_sync32k_timer_init,
.restart= omap3xxx_restart,
 MACHINE_END
diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c
index 2d1e5a6beb85..830256c434ec 100644
--- a/arch/arm/mach-omap2/board-rx51.c
+++ b/arch/arm/mach-omap2/board-rx51.c
@@ -136,6 +136,6 @@ MACHINE_START(NOKIA_RX51, "Nokia RX-51 board")
.init_irq   = omap3_init_irq,
.init_machine   = rx51_init,
.init_late  = omap3430_init_late,
-   .init_time  = omap3_sync32k_timer_init,
+   .init_time  = omap_sync32k_timer_init,
.restart= omap3xxx_restart,
 MACHINE_END
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
index 92e92cfc2775..844ad031f7f0 100644
--- a/arch/arm/mach-omap2/common.h
+++ b/arch/arm/mach-omap2/common.h
@@ -88,8 +88,7 @@ static inline int omap_mux_late_init(void)
 
 extern void omap2_init_common_infrastructure(void);
 
-extern void omap2_sync32k_timer_init(void);
-extern void omap3_sync32k_timer_init(void);
+extern void omap_sync32k_timer_init(void);
 extern void omap3_secure_sync32k_timer_init(void);
 extern void omap3_gptimer_timer_init(void);
 extern void omap4_local_timer_init(void);
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index 44db46ccd474..a416bcb38f2c 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -612,21 +612,13 @@ static void __init __omap_sync32k_timer_init(int 
clkev_nr, const char *clkev_src
omap2_sync32k_clocksource_init();
 }
 
-#ifdef CONFIG_ARCH_OMAP2
-void __init omap2_sync32k_timer_init(void)
+void __init omap_sync32k_timer_init(void)
 {
   

[RFC/PATCH 08/11] arm: omap2: timer: rename omap_sync32k_timer_init()

2015-09-29 Thread Felipe Balbi
this function is not only about the 32k sync
timer, it's OMAP's generic init_time implementation.

Let's rename it to make that detail easier to
notice.

Signed-off-by: Felipe Balbi 
---
 arch/arm/mach-omap2/board-generic.c | 14 +++---
 arch/arm/mach-omap2/board-ldp.c |  2 +-
 arch/arm/mach-omap2/board-rx51.c|  2 +-
 arch/arm/mach-omap2/common.h|  2 +-
 arch/arm/mach-omap2/timer.c |  4 ++--
 5 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/arch/arm/mach-omap2/board-generic.c 
b/arch/arm/mach-omap2/board-generic.c
index 13f7df92baf4..0052cfa18a8d 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -53,7 +53,7 @@ DT_MACHINE_START(OMAP242X_DT, "Generic OMAP2420 (Flattened 
Device Tree)")
.map_io = omap242x_map_io,
.init_early = omap2420_init_early,
.init_machine   = omap_generic_init,
-   .init_time  = omap_sync32k_timer_init,
+   .init_time  = omap_init_time,
.dt_compat  = omap242x_boards_compat,
.restart= omap2xxx_restart,
 MACHINE_END
@@ -70,7 +70,7 @@ DT_MACHINE_START(OMAP243X_DT, "Generic OMAP2430 (Flattened 
Device Tree)")
.map_io = omap243x_map_io,
.init_early = omap2430_init_early,
.init_machine   = omap_generic_init,
-   .init_time  = omap_sync32k_timer_init,
+   .init_time  = omap_init_time,
.dt_compat  = omap243x_boards_compat,
.restart= omap2xxx_restart,
 MACHINE_END
@@ -89,7 +89,7 @@ DT_MACHINE_START(OMAP3_N900_DT, "Nokia RX-51 board")
.init_early = omap3430_init_early,
.init_machine   = omap_generic_init,
.init_late  = omap3_init_late,
-   .init_time  = omap_sync32k_timer_init,
+   .init_time  = omap_init_time,
.dt_compat  = n900_boards_compat,
.restart= omap3xxx_restart,
 MACHINE_END
@@ -107,7 +107,7 @@ DT_MACHINE_START(OMAP3_DT, "Generic OMAP3 (Flattened Device 
Tree)")
.init_early = omap3430_init_early,
.init_machine   = omap_generic_init,
.init_late  = omap3_init_late,
-   .init_time  = omap_sync32k_timer_init,
+   .init_time  = omap_init_time,
.dt_compat  = omap3_boards_compat,
.restart= omap3xxx_restart,
 MACHINE_END
@@ -123,7 +123,7 @@ DT_MACHINE_START(OMAP36XX_DT, "Generic OMAP36xx (Flattened 
Device Tree)")
.init_early = omap3630_init_early,
.init_machine   = omap_generic_init,
.init_late  = omap3_init_late,
-   .init_time  = omap_sync32k_timer_init,
+   .init_time  = omap_init_time,
.dt_compat  = omap36xx_boards_compat,
.restart= omap3xxx_restart,
 MACHINE_END
@@ -235,7 +235,7 @@ DT_MACHINE_START(OMAP4_DT, "Generic OMAP4 (Flattened Device 
Tree)")
.init_irq   = omap_gic_of_init,
.init_machine   = omap_generic_init,
.init_late  = omap4430_init_late,
-   .init_time  = omap_sync32k_timer_init,
+   .init_time  = omap_init_time,
.dt_compat  = omap4_boards_compat,
.restart= omap44xx_restart,
 MACHINE_END
@@ -279,7 +279,7 @@ DT_MACHINE_START(AM43_DT, "Generic AM43 (Flattened Device 
Tree)")
.init_late  = am43xx_init_late,
.init_irq   = omap_gic_of_init,
.init_machine   = omap_generic_init,
-   .init_time  = omap_sync32k_timer_init,
+   .init_time  = omap_init_time,
.dt_compat  = am43_boards_compat,
.restart= omap44xx_restart,
 MACHINE_END
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index 0d3a57c6931f..d9c3ffc39329 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -424,6 +424,6 @@ MACHINE_START(OMAP_LDP, "OMAP LDP board")
.init_irq   = omap3_init_irq,
.init_machine   = omap_ldp_init,
.init_late  = omap3430_init_late,
-   .init_time  = omap_sync32k_timer_init,
+   .init_time  = omap_init_time,
.restart= omap3xxx_restart,
 MACHINE_END
diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c
index 830256c434ec..41161ca97d74 100644
--- a/arch/arm/mach-omap2/board-rx51.c
+++ b/arch/arm/mach-omap2/board-rx51.c
@@ -136,6 +136,6 @@ MACHINE_START(NOKIA_RX51, "Nokia RX-51 board")
.init_irq   = omap3_init_irq,
.init_machine   = rx51_init,
.init_late  = omap3430_init_late,
-   .init_time  = omap_sync32k_timer_init,
+   .init_time  = omap_init_time,
.restart= omap3xxx_restart,
 MACHINE_END
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
index bf42fc4e78f4..e1e274334290 100644
--- a/arch/arm/mach-omap2/common.h
+++ b/arch/arm/mach-omap2/common.h
@@ -88,7 +88,7 @@ static inline int omap_mux_late_init(void)
 
 extern void 

[RFC/PATCH 10/11] arm: omap2: timer: limit hwmod usage to non-DT boots

2015-09-29 Thread Felipe Balbi
now that we have a working 32k clocksource driver,
we can limit HWMOD usage to non-DT boots and rely
on clocksource_of_init() every time we boot
with DT.

Signed-off-by: Felipe Balbi 
---
 arch/arm/mach-omap2/timer.c | 30 +++---
 1 file changed, 11 insertions(+), 19 deletions(-)

diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index 8b3ac8d5d38b..24c5a63c9c6e 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -398,7 +398,6 @@ static int __init __maybe_unused 
omap2_sync32k_clocksource_init(void)
int ret;
struct device_node *np = NULL;
struct omap_hwmod *oh;
-   void __iomem *vbase;
const char *oh_name = "counter_32k";
 
/*
@@ -424,18 +423,6 @@ static int __init __maybe_unused 
omap2_sync32k_clocksource_init(void)
 
omap_hwmod_setup_one(oh_name);
 
-   if (np) {
-   vbase = of_iomap(np, 0);
-   of_node_put(np);
-   } else {
-   vbase = omap_hwmod_get_mpu_rt_va(oh);
-   }
-
-   if (!vbase) {
-   pr_warn("%s: failed to get counter_32k resource\n", __func__);
-   return -ENXIO;
-   }
-
ret = omap_hwmod_enable(oh);
if (ret) {
pr_warn("%s: failed to enable counter_32k module (%d)\n",
@@ -443,13 +430,18 @@ static int __init __maybe_unused 
omap2_sync32k_clocksource_init(void)
return ret;
}
 
-   ret = omap_init_clocksource_32k(vbase);
-   if (ret) {
-   pr_warn("%s: failed to initialize counter_32k as a clocksource 
(%d)\n",
-   __func__, ret);
-   omap_hwmod_idle(oh);
-   }
+   if (!of_have_populated_dt()) {
+   void __iomem *vbase;
 
+   vbase = omap_hwmod_get_mpu_rt_va(oh);
+
+   ret = omap_init_clocksource_32k(vbase);
+   if (ret) {
+   pr_warn("%s: failed to initialize counter_32k as a 
clocksource (%d)\n",
+   __func__, ret);
+   omap_hwmod_idle(oh);
+   }
+   }
return ret;
 }
 
-- 
2.5.3

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


[RFC/PATCH 01/11] arm: omap2: timer: get rid of obfuscating macros

2015-09-29 Thread Felipe Balbi
those macros just make it a lot more difficult
to grep around and actually find similarities.

In this patch, we will simply remove them and
replace with actual functions and later commits
will come to further clean this up.

Signed-off-by: Felipe Balbi 
---
 arch/arm/mach-omap2/timer.c | 70 -
 1 file changed, 43 insertions(+), 27 deletions(-)

diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index 3ebe16cd645e..1f6532bd104e 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -596,53 +596,69 @@ static inline void __init realtime_counter_init(void)
 {}
 #endif
 
-#define OMAP_SYS_GP_TIMER_INIT(name, clkev_nr, clkev_src, clkev_prop,  \
-  clksrc_nr, clksrc_src, clksrc_prop)  \
-void __init omap##name##_gptimer_timer_init(void)  \
-{  \
-   omap_clk_init();\
-   omap_dmtimer_init();\
-   omap2_gp_clockevent_init((clkev_nr), clkev_src, clkev_prop);\
-   omap2_gptimer_clocksource_init((clksrc_nr), clksrc_src, \
-   clksrc_prop);   \
+static void __init __omap_gptimer_init(int clkev_nr, const char *clkev_src,
+   const char *clkev_prop, int clksrc_nr, const char *clksrc_src,
+   const char *clksrc_prop)
+{
+   omap_clk_init();
+   omap_dmtimer_init();
+   omap2_gp_clockevent_init(clkev_nr, clkev_src, clkev_prop);
+   omap2_gptimer_clocksource_init(clksrc_nr, clksrc_src, clksrc_prop);
 }
 
-#define OMAP_SYS_32K_TIMER_INIT(name, clkev_nr, clkev_src, clkev_prop, \
-   clksrc_nr, clksrc_src, clksrc_prop) \
-void __init omap##name##_sync32k_timer_init(void)  \
-{  \
-   omap_clk_init();\
-   omap_dmtimer_init();\
-   omap2_gp_clockevent_init((clkev_nr), clkev_src, clkev_prop);\
-   /* Enable the use of clocksource="gp_timer" kernel parameter */ \
-   if (use_gptimer_clksrc) \
-   omap2_gptimer_clocksource_init((clksrc_nr), clksrc_src, \
-   clksrc_prop);   \
-   else\
-   omap2_sync32k_clocksource_init();   \
+static void __init __omap_sync32k_timer_init(int clkev_nr, const char 
*clkev_src,
+   const char *clkev_prop, int clksrc_nr, const char *clksrc_src,
+   const char *clksrc_prop)
+{
+   omap_clk_init();
+   omap_dmtimer_init();
+   omap2_gp_clockevent_init(clkev_nr, clkev_src, clkev_prop);
+
+   /* Enable the use of clocksource="gp_timer" kernel parameter */
+   if (use_gptimer_clksrc)
+   omap2_gptimer_clocksource_init(clksrc_nr, clksrc_src,
+   clksrc_prop);
+   else
+   omap2_sync32k_clocksource_init();
 }
 
 #ifdef CONFIG_ARCH_OMAP2
-OMAP_SYS_32K_TIMER_INIT(2, 1, "timer_32k_ck", "ti,timer-alwon",
+void __init omap2_sync32k_timer_init(void)
+{
+   __omap_sync32k_timer_init(1, "timer_32k_ck", "ti,timer-alwon",
2, "timer_sys_ck", NULL);
+}
 #endif /* CONFIG_ARCH_OMAP2 */
 
 #if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_SOC_AM43XX)
-OMAP_SYS_32K_TIMER_INIT(3, 1, "timer_32k_ck", "ti,timer-alwon",
+void __init omap3_sync32k_timer_init(void)
+{
+   __omap_sync32k_timer_init(1, "timer_32k_ck", "ti,timer-alwon",
2, "timer_sys_ck", NULL);
-OMAP_SYS_32K_TIMER_INIT(3_secure, 12, "secure_32k_fck", "ti,timer-secure",
+}
+
+void __init omap3_secure_sync32k_timer_init(void)
+{
+   __omap_sync32k_timer_init(12, "secure_32k_fck", "ti,timer-secure",
2, "timer_sys_ck", NULL);
+}
 #endif /* CONFIG_ARCH_OMAP3 */
 
 #if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_SOC_AM33XX)
-OMAP_SYS_GP_TIMER_INIT(3, 2, "timer_sys_ck", NULL,
+void __init omap3_gptimer_timer_init(void)
+{
+   __omap_gptimer_init(2, "timer_sys_ck", NULL,
   1, "timer_sys_ck", "ti,timer-alwon");
+}
 #endif
 
 #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) || \
defined(CONFIG_SOC_DRA7XX) || defined(CONFIG_SOC_AM43XX)
-static OMAP_SYS_32K_TIMER_INIT(4, 1, "timer_32k_ck", "ti,timer-alwon",
+static void __init omap4_sync32k_timer_init(void)
+{
+   __omap_sync32k_timer_init(1, "timer_32k_ck", "ti,timer-alwon",
   2, "sys_clkin_ck", NULL);
+}
 
 void __init omap4_local_timer_init(void)
 {
-- 
2.5.3

--
To unsubscribe from this list: send the line "unsubscribe 

[RFC/PATCH 06/11] arm: omap2: timer: always call clocksource_of_init() when DT

2015-09-29 Thread Felipe Balbi
If booting with DT, let's make sure to always
call clocksource_of_init() as this will make
it easier to move timer code to drivers/clocksource
in the future.

Signed-off-by: Felipe Balbi 
---
 arch/arm/mach-omap2/timer.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index deccec2d6ed8..1ae563736b12 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -500,6 +500,9 @@ void __init omap_sync32k_timer_init(void)
 {
__omap_sync32k_timer_init(1, "timer_32k_ck", "ti,timer-alwon",
2, "timer_sys_ck", NULL, false);
+
+   if (of_have_populated_dt())
+   clocksource_of_init();
 }
 
 #if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_SOC_AM43XX)
@@ -523,7 +526,6 @@ void __init omap3_gptimer_timer_init(void)
 void __init omap4_local_timer_init(void)
 {
omap_sync32k_timer_init();
-   clocksource_of_init();
 }
 #endif
 
@@ -644,10 +646,8 @@ sysclk1_based:
 
 void __init omap5_realtime_timer_init(void)
 {
-   omap_sync32k_timer_init();
realtime_counter_init();
-
-   clocksource_of_init();
+   omap_sync32k_timer_init();
 }
 #endif /* CONFIG_SOC_OMAP5 || CONFIG_SOC_DRA7XX */
 
-- 
2.5.3

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


RE: [PATCH] ARM: OMAP2: erratum I688 handling disabled for AM335x

2015-09-29 Thread Woodruff, Richard
Hello Robert,

> From: Robert Schwebel [mailto:r.schwe...@pengutronix.de]
> Sent: Tuesday, September 29, 2015 12:50 PM
> > -1-
> > Barrier side effects of the patch may be beneficial for other reasons.  But
> AM335x should be immune from this particular issue.
> 
> Is this a matter of fact, or just an assumption?
> Could you clarify this with the TI hardware folks?

Which point are you asking for clarification on?

-0- is factual.  The conditions to trigger bridge bugs are specific and tied to 
cited component issues. These factors can lead to a HW clock gate before 
completion of bus protocol.  The result is a misaligned of HW FIFO pointer 
inside of the retiming bridge. At hang it is possible to attach through 
JTAG-DAP and see writes going to the wrong address due to misalignment.  The 
bridge component did fail in simulation and was fixed per hw-bug database as I 
mention.  In my sampling of customers which ramped with aggressive power 
management ~10/10 I worked with hit this issue on 4430 on robustness tests.  We 
did verify signatures at hang.

There may be other errata which have a hang condition which users experience 
but their root cause is not the same as i688.   Really any action which results 
in a bus protocol violation can end up in a hang.  For instance a wrong 
sequencing of DSS pipeline/DMA control can cause the IP to crash.  If the IP 
crashes while in the middle of talking with DDR a hang will result.  There is 
no timeout on the interconnect so a watchdog will be needed to recover from 
such events.

-1- is partially an assumption based on previous Linux macros and code 
structure.

Regards,
Richard W.

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


Re: [PATCH] ARM: OMAP2: erratum I688 handling disabled for AM335x

2015-09-29 Thread Robert Schwebel
Hi Richard,

On Fri, Sep 25, 2015 at 08:44:29PM +, Woodruff, Richard wrote:
> > From: Menon, Nishanth
> > Sent: Friday, September 25, 2015 9:44 AM
> 
> > > If I688 is not needed on am335x, then it seems there are still some
> > > mysteries remaining with this erratum to unravel. Something like
> > > difference in the L3 implementation. Maybe somebody from TI can
> > > investigate which SoCs this is really needed on?
> 
> > + Richard who probably has the oldest history on the topic.
> > 
> > I suspect strongly that the erratum was discovered during A9 OMAP4 days,
> > but never percolated to older SoC erratum documentation. The need of
> > barrier logic was clarified with SoC folks to confirm the behavior though.
> 
> -0-
> After looking up i688 in data base and reviewing AM335x SOC I do NOT think 
> i688 will exhibit for AM335x.
>  - it appears not to be using pieces which have issues on path.
> 
> I688 could impact SOCs which use a DMM and the interconnect infrastructure 
> which supports it.
> 
> I believe hang issues on path could be mapped to 3 sources:
>   - asyncbrige used from MPUSS to Arteris NOC to DMM
>   - Dual EMIF idle (ocp-connect/disconnect) policy on path
>   - PL310 idle signal usage on path
> 
> SOCs using similar chassis components of OMAP4430 time are impacted.  Errata 
> aspect in generic bridge map to Aegis, J5E, ...
> 
> The hangs are brought out by enabling power management features which causes 
> micro-idles on path which can trigger a lock up.
> 
> Later SOCs pulled in fixes in one or all areas.  Some SOCs are not using 
> components.
> 
> -1-
> Barrier side effects of the patch may be beneficial for other reasons.  But 
> AM335x should be immune from this particular issue.

Is this a matter of fact, or just an assumption?
Could you clarify this with the TI hardware folks?

rsc
-- 
Pengutronix e.K.   | |
Industrial Linux Solutions | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] ARM: OMAP2: erratum I688 handling disabled for AM335x

2015-09-29 Thread Robert Schwebel
On Tue, Sep 29, 2015 at 06:06:36PM +, Woodruff, Richard wrote:
> > From: Robert Schwebel [mailto:r.schwe...@pengutronix.de]
> > Sent: Tuesday, September 29, 2015 12:50 PM
> > > -1-
> > > Barrier side effects of the patch may be beneficial for other reasons.  
> > > But
> > AM335x should be immune from this particular issue.
> > 
> > Is this a matter of fact, or just an assumption?
> > Could you clarify this with the TI hardware folks?
> 
> Which point are you asking for clarification on?
> 
> -0- is factual.  The conditions to trigger bridge bugs are specific and tied 
> to cited component issues. These factors can lead to a HW clock gate before 
> completion of bus protocol.  The result is a misaligned of HW FIFO pointer 
> inside of the retiming bridge. At hang it is possible to attach through 
> JTAG-DAP and see writes going to the wrong address due to misalignment.  The 
> bridge component did fail in simulation and was fixed per hw-bug database as 
> I mention.  In my sampling of customers which ramped with aggressive power 
> management ~10/10 I worked with hit this issue on 4430 on robustness tests.  
> We did verify signatures at hang.
> 
> There may be other errata which have a hang condition which users experience 
> but their root cause is not the same as i688.   Really any action which 
> results in a bus protocol violation can end up in a hang.  For instance a 
> wrong sequencing of DSS pipeline/DMA control can cause the IP to crash.  If 
> the IP crashes while in the middle of talking with DDR a hang will result.  
> There is no timeout on the interconnect so a watchdog will be needed to 
> recover from such events.
> 
> -1- is partially an assumption based on previous Linux macros and code 
> structure.

Thanks for the explanation!

rsc
-- 
Pengutronix e.K.   | |
Industrial Linux Solutions | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |
--
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