linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] ARM: OMAP2+: wakeupgen: AM43x adaptation
@ 2013-10-09  7:12 Afzal Mohammed
  2013-10-12 10:22 ` Afzal Mohammed
  0 siblings, 1 reply; 4+ messages in thread
From: Afzal Mohammed @ 2013-10-09  7:12 UTC (permalink / raw)
  To: linux-arm-kernel

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 <nsekhar@ti.com>.

Signed-off-by: Afzal Mohammed <afzal@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

 arch/arm/mach-omap2/omap-wakeupgen.c | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-omap2/omap-wakeupgen.c b/arch/arm/mach-omap2/omap-wakeupgen.c
index 813c615..3664562 100644
--- a/arch/arm/mach-omap2/omap-wakeupgen.c
+++ b/arch/arm/mach-omap2/omap-wakeupgen.c
@@ -33,8 +33,12 @@
 #include "omap4-sar-layout.h"
 #include "common.h"
 
-#define MAX_NR_REG_BANKS	5
-#define MAX_IRQS		160
+#define AM43XX_NR_REG_BANKS	7
+#define AM43XX_IRQS		224
+#define MAX_NR_REG_BANKS	AM43XX_NR_REG_BANKS
+#define MAX_IRQS		AM43XX_IRQS
+#define DEFAULT_NR_REG_BANKS	5
+#define DEFAULT_IRQS		160
 #define WKG_MASK_ALL		0x00000000
 #define WKG_UNMASK_ALL		0xffffffff
 #define CPU_ENA_OFFSET		0x400
@@ -47,8 +51,8 @@ static void __iomem *wakeupgen_base;
 static void __iomem *sar_base;
 static DEFINE_RAW_SPINLOCK(wakeupgen_lock);
 static unsigned int irq_target_cpu[MAX_IRQS];
-static unsigned int irq_banks = MAX_NR_REG_BANKS;
-static unsigned int max_irqs = MAX_IRQS;
+static unsigned int irq_banks = DEFAULT_NR_REG_BANKS;
+static unsigned int max_irqs = DEFAULT_IRQS;
 static unsigned int omap_secure_apis;
 
 /*
@@ -418,12 +422,16 @@ int __init omap_wakeupgen_init(void)
 		irq_banks = OMAP4_NR_BANKS;
 		max_irqs = OMAP4_NR_IRQS;
 		omap_secure_apis = 1;
+	} else if (soc_is_am43xx()) {
+		irq_banks = AM43XX_NR_REG_BANKS;
+		max_irqs = AM43XX_IRQS;
 	}
 
 	/* Clear all IRQ bitmasks at wakeupGen level */
 	for (i = 0; i < irq_banks; i++) {
 		wakeupgen_writel(0, i, CPU0_ID);
-		wakeupgen_writel(0, i, CPU1_ID);
+		if (!soc_is_am43xx())
+			wakeupgen_writel(0, i, CPU1_ID);
 	}
 
 	/*
-- 
1.8.3.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v2] ARM: OMAP2+: wakeupgen: AM43x adaptation
  2013-10-09  7:12 [PATCH v2] ARM: OMAP2+: wakeupgen: AM43x adaptation Afzal Mohammed
@ 2013-10-12 10:22 ` Afzal Mohammed
  2013-10-22 13:53   ` Afzal Mohammed
  0 siblings, 1 reply; 4+ messages in thread
From: Afzal Mohammed @ 2013-10-12 10:22 UTC (permalink / raw)
  To: linux-arm-kernel

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 <nsekhar@ti.com>.
> 
> Signed-off-by: Afzal Mohammed <afzal@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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2] ARM: OMAP2+: wakeupgen: AM43x adaptation
  2013-10-12 10:22 ` Afzal Mohammed
@ 2013-10-22 13:53   ` Afzal Mohammed
  2013-10-22 14:29     ` Tony Lindgren
  0 siblings, 1 reply; 4+ messages in thread
From: Afzal Mohammed @ 2013-10-22 13:53 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Tony,

On Saturday 12 October 2013 03:52 PM, Afzal Mohammed wrote:
> 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 <nsekhar@ti.com>.
>>
>> Signed-off-by: Afzal Mohammed <afzal@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.

Ping

Regards
Afzal

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2] ARM: OMAP2+: wakeupgen: AM43x adaptation
  2013-10-22 13:53   ` Afzal Mohammed
@ 2013-10-22 14:29     ` Tony Lindgren
  0 siblings, 0 replies; 4+ messages in thread
From: Tony Lindgren @ 2013-10-22 14:29 UTC (permalink / raw)
  To: linux-arm-kernel

* Afzal Mohammed <afzal@ti.com> [131022 06:53]:
> Hi Tony,
> 
> On Saturday 12 October 2013 03:52 PM, Afzal Mohammed wrote:
> > 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 <nsekhar@ti.com>.
> >>
> >> Signed-off-by: Afzal Mohammed <afzal@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.
> 
> Ping

Thanks applying into omap-fo-rv3.13/fixes-not-urgent.

Tony

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-10-22 14:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-09  7:12 [PATCH v2] ARM: OMAP2+: wakeupgen: AM43x adaptation Afzal Mohammed
2013-10-12 10:22 ` Afzal Mohammed
2013-10-22 13:53   ` Afzal Mohammed
2013-10-22 14:29     ` Tony Lindgren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).