linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] SAMSUNG: S3C64XX: Fix SoC identification for S3C64xx devices
@ 2011-10-17 21:21 Mark Brown
  2011-10-18  0:08 ` Kukjin Kim
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Brown @ 2011-10-17 21:21 UTC (permalink / raw)
  To: linux-arm-kernel

The IS_SAMSUNG_CPU() macro works by comparing the CPU ID mask exactly with
the CPU ID. This was failing for S3C64xx SoCs as in order to support
identification of the exact device the mask covers both variants of the
chip, meaning that the test would always fail on S3C6410 devices. This in
turn caused the core GPIO subsystem to fail to identify the CPU and not
support any GPIOs, crippling the system.

As a minimally invasive fix change the test for the class to be done by
checking each implementation and oring them together.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---

Arnd, this fixes the issue I had with Kukjin's GPIO pull request - with
this applied my systems boot much more happily.

 arch/arm/plat-samsung/include/plat/cpu.h |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/plat-samsung/include/plat/cpu.h b/arch/arm/plat-samsung/include/plat/cpu.h
index 54f370f..40fd7b6 100644
--- a/arch/arm/plat-samsung/include/plat/cpu.h
+++ b/arch/arm/plat-samsung/include/plat/cpu.h
@@ -25,7 +25,6 @@ extern unsigned long samsung_cpu_id;
 
 #define S3C6400_CPU_ID		0x36400000
 #define S3C6410_CPU_ID		0x36410000
-#define S3C64XX_CPU_ID		(S3C6400_CPU_ID & S3C6410_CPU_ID)
 #define S3C64XX_CPU_MASK	0xFFFFF000
 
 #define S5P6440_CPU_ID		0x56440000
@@ -50,7 +49,8 @@ static inline int is_samsung_##name(void)	\
 }
 
 IS_SAMSUNG_CPU(s3c24xx, S3C24XX_CPU_ID, S3C24XX_CPU_MASK)
-IS_SAMSUNG_CPU(s3c64xx, S3C64XX_CPU_ID, S3C64XX_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)
 IS_SAMSUNG_CPU(s5p6450, S5P6450_CPU_ID, S5P64XX_CPU_MASK)
 IS_SAMSUNG_CPU(s5pc100, S5PC100_CPU_ID, S5PC100_CPU_MASK)
@@ -69,7 +69,7 @@ IS_SAMSUNG_CPU(exynos4412, EXYNOS4412_CPU_ID, EXYNOS4_CPU_MASK)
 #endif
 
 #if defined(CONFIG_CPU_S3C6400) || defined(CONFIG_CPU_S3C6410)
-# define soc_is_s3c64xx()	is_samsung_s3c64xx()
+# define soc_is_s3c64xx()	(is_samsung_s3c6400() || is_samsung_s3c6410())
 #else
 # define soc_is_s3c64xx()	0
 #endif
-- 
1.7.6.3

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

* [PATCH] SAMSUNG: S3C64XX: Fix SoC identification for S3C64xx devices
  2011-10-17 21:21 [PATCH] SAMSUNG: S3C64XX: Fix SoC identification for S3C64xx devices Mark Brown
@ 2011-10-18  0:08 ` Kukjin Kim
  0 siblings, 0 replies; 2+ messages in thread
From: Kukjin Kim @ 2011-10-18  0:08 UTC (permalink / raw)
  To: linux-arm-kernel

Mark Brown wrote:
> 
> The IS_SAMSUNG_CPU() macro works by comparing the CPU ID mask exactly
> with
> the CPU ID. This was failing for S3C64xx SoCs as in order to support
> identification of the exact device the mask covers both variants of the
> chip, meaning that the test would always fail on S3C6410 devices. This in
> turn caused the core GPIO subsystem to fail to identify the CPU and not
> support any GPIOs, crippling the system.
> 
> As a minimally invasive fix change the test for the class to be done by
> checking each implementation and oring them together.
> 
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> ---
> 
Mark,

Oops :(
Thanks and applied.

> Arnd, this fixes the issue I had with Kukjin's GPIO pull request - with
> this applied my systems boot much more happily.
> 
Arnd, I added this into next-samsung-devel-3 which has been requested pull
yesterday.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.


>  arch/arm/plat-samsung/include/plat/cpu.h |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/plat-samsung/include/plat/cpu.h b/arch/arm/plat-
> samsung/include/plat/cpu.h
> index 54f370f..40fd7b6 100644
> --- a/arch/arm/plat-samsung/include/plat/cpu.h
> +++ b/arch/arm/plat-samsung/include/plat/cpu.h
> @@ -25,7 +25,6 @@ extern unsigned long samsung_cpu_id;
> 
>  #define S3C6400_CPU_ID		0x36400000
>  #define S3C6410_CPU_ID		0x36410000
> -#define S3C64XX_CPU_ID		(S3C6400_CPU_ID &
> S3C6410_CPU_ID)
>  #define S3C64XX_CPU_MASK	0xFFFFF000
> 
>  #define S5P6440_CPU_ID		0x56440000
> @@ -50,7 +49,8 @@ static inline int is_samsung_##name(void)	\
>  }
> 
>  IS_SAMSUNG_CPU(s3c24xx, S3C24XX_CPU_ID, S3C24XX_CPU_MASK)
> -IS_SAMSUNG_CPU(s3c64xx, S3C64XX_CPU_ID, S3C64XX_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)
>  IS_SAMSUNG_CPU(s5p6450, S5P6450_CPU_ID, S5P64XX_CPU_MASK)
>  IS_SAMSUNG_CPU(s5pc100, S5PC100_CPU_ID, S5PC100_CPU_MASK)
> @@ -69,7 +69,7 @@ IS_SAMSUNG_CPU(exynos4412, EXYNOS4412_CPU_ID,
> EXYNOS4_CPU_MASK)
>  #endif
> 
>  #if defined(CONFIG_CPU_S3C6400) || defined(CONFIG_CPU_S3C6410)
> -# define soc_is_s3c64xx()	is_samsung_s3c64xx()
> +# define soc_is_s3c64xx()	(is_samsung_s3c6400() ||
> is_samsung_s3c6410())
>  #else
>  # define soc_is_s3c64xx()	0
>  #endif
> --
> 1.7.6.3

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

end of thread, other threads:[~2011-10-18  0:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-17 21:21 [PATCH] SAMSUNG: S3C64XX: Fix SoC identification for S3C64xx devices Mark Brown
2011-10-18  0:08 ` Kukjin Kim

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).