Skip to contentSkip to conversation

ARM: S3C2443: introduce soc_is_s3c2443 macro

PATCH In review Alexander Varnin 2 participants 4 messages Nov 26, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ARM: S3C2443: introduce soc_is_s3c2443 macro

---
 arch/arm/plat-samsung/include/plat/cpu.h |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
arch/arm/plat-samsung/include/plat/cpu.h +10 -0
index ace4451..613f492 100644
@@ -23,6 +23,9 @@ extern unsigned long samsung_cpu_id;
 #define S3C24XX_CPU_ID		0x32400000
 #define S3C24XX_CPU_MASK	0xFFF00000
 
+#define S3C2443_CPU_ID		0x32443001
+#define S3C2443_CPU_MASK	0xFFFFFFFF
+
 #define S3C6400_CPU_ID		0x36400000
 #define S3C6410_CPU_ID		0x36410000
 #define S3C64XX_CPU_MASK	0xFFFFF000
@@ -52,6 +55,7 @@ static inline int is_samsung_##name(void)	\
 }
 
 IS_SAMSUNG_CPU(s3c24xx, S3C24XX_CPU_ID, S3C24XX_CPU_MASK)
+IS_SAMSUNG_CPU(s3c2443, S3C2443_CPU_ID, S3C2443_CPU_MASK)
 IS_SAMSUNG_CPU(s3c6400, S3C6400_CPU_ID, S3C64XX_CPU_MASK)
 IS_SAMSUNG_CPU(s3c6410, S3C6410_CPU_ID, S3C64XX_CPU_MASK)
 IS_SAMSUNG_CPU(s5p6440, S5P6440_CPU_ID, S5P64XX_CPU_MASK)
@@ -72,6 +76,12 @@ IS_SAMSUNG_CPU(exynos5250, EXYNOS5250_SOC_ID, EXYNOS5_SOC_MASK)
 # define soc_is_s3c24xx()	0
 #endif
 
+#if defined(CONFIG_CPU_S3C2443)
+# define soc_is_s3c2443()	is_samsung_s3c2443()
+#else
+# define soc_is_s3c2443()	0
+#endif
+
 #if defined(CONFIG_CPU_S3C6400) || defined(CONFIG_CPU_S3C6410)
 # define soc_is_s3c64xx()	(is_samsung_s3c6400() || is_samsung_s3c6410())
 #else
Signature · 1 line
1.7.2.5
#1 lore raw

PATCH 2/2 ARM: S3C2443: Workaround for 2443 EXTINT error

S3C2443 CPU has a problem with incorrect reading from EXTINTn registers. So s3c_irqext_type function wrongly modifies them. So add special check to s3c_irqext_type, to handle this case.

---
 arch/arm/plat-s3c24xx/irq.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
arch/arm/plat-s3c24xx/irq.c +15 -0
index fe57bbb..bb36fc9 100644
@@ -219,6 +219,21 @@ s3c_irqext_type(struct irq_data *data, unsigned int type)
 	}
 
 	value = __raw_readl(extint_reg);
+
+	if( (samsung_cpu_id & 0xfffff) == 0x43001) //Hack for 2443 error workaround
+	{
+	    int i;
+	    int fixed = 0;
+	    if(extint_reg == S3C24XX_EXTINT1 || extint_reg == S3C24XX_EXTINT2)
+		for(i=0; i<7;i++)
+		    fixed |= (((value >> ((7-i)*4+1)) & 7) | ((value >> ((7-i)*4-3)) & 8)) << i*4;
+	    else
+		for(i=0; i<7;i++)
+		    fixed |= ( (value >> (7-i)*4) & 0xf )  << i*4;
+	    fixed |= (((value>>1) & 7) | ((value<<3) & 8)) << 27;
+	    value = fixed;
+	}
+
 	value = (value & ~(7 << extint_offset)) | (newvalue << extint_offset);
 	__raw_writel(value, extint_reg);
 
Signature · 1 line
1.7.2.5
#2 lore raw

Re: [PATCH 2/2] ARM: S3C2443: Workaround for 2443 EXTINT error

Sorry, an old version.

26.11.2012 12:40, Alexander Varnin пишет:

Quoted 35 lines

S3C2443 CPU has a problem with incorrect reading from EXTINTn registers. So s3c_irqext_type function wrongly modifies them. So add special check to s3c_irqext_type, to handle this case.

---
  arch/arm/plat-s3c24xx/irq.c |   15 +++++++++++++++
  1 files changed, 15 insertions(+), 0 deletions(-)
arch/arm/plat-s3c24xx/irq.c +15 -0
index fe57bbb..bb36fc9 100644
@@ -219,6 +219,21 @@ s3c_irqext_type(struct irq_data *data, unsigned int type)
  	}
 
  	value = __raw_readl(extint_reg);
+
+	if( (samsung_cpu_id & 0xfffff) == 0x43001) //Hack for 2443 error workaround
+	{
+	    int i;
+	    int fixed = 0;
+	    if(extint_reg == S3C24XX_EXTINT1 || extint_reg == S3C24XX_EXTINT2)
+		for(i=0; i<7;i++)
+		    fixed |= (((value >> ((7-i)*4+1)) & 7) | ((value >> ((7-i)*4-3)) & 8)) << i*4;
+	    else
+		for(i=0; i<7;i++)
+		    fixed |= ( (value >> (7-i)*4) & 0xf )  << i*4;
+	    fixed |= (((value>>1) & 7) | ((value<<3) & 8)) << 27;
+	    value = fixed;
+	}
+
  	value = (value & ~(7 << extint_offset)) | (newvalue << extint_offset);
  	__raw_writel(value, extint_reg);
 
Acked-by on v1 1/2
#3 lore raw
In reply to Alexander Varnin

Am Montag, 26. November 2012, 09:40:02 schrieb Alexander Varnin:

Quoted 1 line
Quoted 39 lines
---
 arch/arm/plat-samsung/include/plat/cpu.h |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
(quoted diff) +0 -0

b/arch/arm/plat-samsung/include/plat/cpu.h index ace4451..613f492 100644

arch/arm/plat-samsung/include/plat/cpu.h +4 -0
@@ -23,6 +23,9 @@ extern unsigned long samsung_cpu_id;
 #define S3C24XX_CPU_ID		0x32400000
 #define S3C24XX_CPU_MASK	0xFFF00000
 
+#define S3C2443_CPU_ID		0x32443001
+#define S3C2443_CPU_MASK	0xFFFFFFFF
+
 #define S3C6400_CPU_ID		0x36400000
 #define S3C6410_CPU_ID		0x36410000
 #define S3C64XX_CPU_MASK	0xFFFFF000
@@ -52,6 +55,7 @@ static inline int is_samsung_##name(void)	\
 }
 
 IS_SAMSUNG_CPU(s3c24xx, S3C24XX_CPU_ID, S3C24XX_CPU_MASK)
+IS_SAMSUNG_CPU(s3c2443, S3C2443_CPU_ID, S3C2443_CPU_MASK)
 IS_SAMSUNG_CPU(s3c6400, S3C6400_CPU_ID, S3C64XX_CPU_MASK)
 IS_SAMSUNG_CPU(s3c6410, S3C6410_CPU_ID, S3C64XX_CPU_MASK)
 IS_SAMSUNG_CPU(s5p6440, S5P6440_CPU_ID, S5P64XX_CPU_MASK)
@@ -72,6 +76,12 @@ IS_SAMSUNG_CPU(exynos5250, EXYNOS5250_SOC_ID,

EXYNOS5_SOC_MASK) # define soc_is_s3c24xx() 0
#endif

arch/arm/plat-samsung/include/plat/cpu.h +6 -0
+#if defined(CONFIG_CPU_S3C2443)
+# define soc_is_s3c2443()	is_samsung_s3c2443()
+#else
+# define soc_is_s3c2443()	0
+#endif
+
 #if defined(CONFIG_CPU_S3C6400) || defined(CONFIG_CPU_S3C6410)
 # define soc_is_s3c64xx()	(is_samsung_s3c6400() || is_samsung_s3c6410())
 #else