public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] Add support for OMAP35x processors
@ 2008-09-01 19:57 Sanjeev Premi
  2008-09-01 19:57 ` [PATCH 2/3] Runtime check for OMAP35x Sanjeev Premi
  2008-09-01 19:57 ` [PATCH 3/3] Updates to OMAP3EVM defconfig Sanjeev Premi
  0 siblings, 2 replies; 6+ messages in thread
From: Sanjeev Premi @ 2008-09-01 19:57 UTC (permalink / raw)
  To: linux-omap; +Cc: Sanjeev Premi

This patch adds basic support for the OMAP35x Applications Processors.
(See: http://focus.ti.com/general/docs/gencontent.tsp?contentId=46725)
  - OMAP3503
  - OMAP3515
  - OMAP3525
  - OMAP3530
---
 arch/arm/mach-omap2/Kconfig |   50 ++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 49 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 365b982..73e0726 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -25,6 +25,54 @@ config ARCH_OMAP3430
 	depends on ARCH_OMAP3 && ARCH_OMAP34XX
 	select ARCH_OMAP_OTG
 
+config ARCH_OMAP35XX
+	bool "OMAP35x Family"
+	select ARCH_OMAP3
+	select ARCH_OMAP34XX
+	select ARCH_OMAP3430
+	select OMAP3430_ES2
+	select NEON
+	help
+	  OMAP35x family of processors based on ARM Cortex-A8
+	  in combination with IVA2.2 core and OpenGL ES2.0
+	  compatible graphics engine.
+
+	  ARM Cortex-A8 contains NEON SIMD coprocessor.
+
+choice
+	prompt "Current choice"
+	default ARCH_OMAP3503
+
+config ARCH_OMAP3503
+	bool "OMAP3503"
+	depends on ARCH_OMAP35XX
+	help
+	  Contains ARM Cortex-A8 processor.
+
+config ARCH_OMAP3515
+	bool "OMAP3515"
+	depends on ARCH_OMAP35XX
+	help
+	   Contains ARM Cortex-A8 processor and SGX530 subsystem
+	   for 2D and 3D graphics acceleration.
+
+config ARCH_OMAP3525
+	bool "OMAP3525"
+	depends on ARCH_OMAP35XX
+	help
+	  Contains ARM Cortex-A8 processor and IVA2.2 subsystem
+	  with a C64x+ DSP core.
+
+config ARCH_OMAP3530
+	bool "OMAP3530"
+	depends on ARCH_OMAP35XX
+	help
+	   Contains ARM Cortex-A8 processor, IVA2.2 subsystem
+	   with a C64x+ DSP Core and SGX530 subsystem for 2D
+	   and 3D graphics acceleration.
+
+endchoice
+
 comment "OMAP Board Type"
 	depends on ARCH_OMAP2 || ARCH_OMAP3
 
@@ -117,7 +165,7 @@ config MACH_OMAP_3430SDP
 
 config MACH_OMAP3EVM
 	bool "OMAP 3530 EVM board"
-	depends on ARCH_OMAP3 && ARCH_OMAP34XX
+	depends on ARCH_OMAP35XX
 
 config MACH_OMAP3_BEAGLE
 	bool "OMAP3 BEAGLE board"
-- 
1.5.6

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

* [PATCH 2/3] Runtime check for OMAP35x
  2008-09-01 19:57 [PATCH 1/3] Add support for OMAP35x processors Sanjeev Premi
@ 2008-09-01 19:57 ` Sanjeev Premi
  2008-09-01 20:10   ` Russell King - ARM Linux
  2008-09-02 17:30   ` Premi, Sanjeev
  2008-09-01 19:57 ` [PATCH 3/3] Updates to OMAP3EVM defconfig Sanjeev Premi
  1 sibling, 2 replies; 6+ messages in thread
From: Sanjeev Premi @ 2008-09-01 19:57 UTC (permalink / raw)
  To: linux-omap; +Cc: Sanjeev Premi

Based on earlier review comments, added runtime
check of the OMAP35x via omap2_set_globasl_3503() etc.
---
 arch/arm/plat-omap/common.c        |   76 ++++++++++++++++++++++++++++++++++
 include/asm-arm/arch-omap/common.h |    4 ++
 include/asm-arm/arch-omap/cpu.h    |   79 ++++++++++++++++++++++++++++++++++++
 3 files changed, 159 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-omap/common.c b/arch/arm/plat-omap/common.c
index 3a5f05e..f8b04cc 100644
--- a/arch/arm/plat-omap/common.c
+++ b/arch/arm/plat-omap/common.c
@@ -334,3 +334,79 @@ void __init omap2_set_globals_343x(void)
 }
 #endif
 
+#if defined(CONFIG_ARCH_OMAP3503)
+
+static struct omap_globals omap3503_globals = {
+	.class	= OMAP35XX_CLASS,
+	.tap	= (__force void __iomem *)OMAP2_IO_ADDRESS(0x4830A000),
+	.sdrc	= (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP343X_SDRC_BASE),
+	.sms	= (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP343X_SMS_BASE),
+	.ctrl	= (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP343X_CTRL_BASE),
+	.prm	= (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP3430_PRM_BASE),
+	.cm	= (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP3430_CM_BASE),
+};
+
+void __init omap2_set_globals_3503(void)
+{
+	omap2_globals = &omap3503_globals;
+	__omap2_set_globals();
+}
+#endif
+
+#if defined(CONFIG_ARCH_OMAP3515)
+
+static struct omap_globals omap3515_globals = {
+	.class	= OMAP35XX_CLASS,
+	.tap	= (__force void __iomem *)OMAP2_IO_ADDRESS(0x4830A000),
+	.sdrc	= (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP343X_SDRC_BASE),
+	.sms	= (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP343X_SMS_BASE),
+	.ctrl	= (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP343X_CTRL_BASE),
+	.prm	= (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP3430_PRM_BASE),
+	.cm	= (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP3430_CM_BASE),
+};
+
+void __init omap2_set_globals_3515(void)
+{
+	omap2_globals = &omap3515_globals;
+	__omap2_set_globals();
+}
+#endif
+
+#if defined(CONFIG_ARCH_OMAP3525)
+
+static struct omap_globals omap3525_globals = {
+	.class	= OMAP35XX_CLASS,
+	.tap	= (__force void __iomem *)OMAP2_IO_ADDRESS(0x4830A000),
+	.sdrc	= (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP343X_SDRC_BASE),
+	.sms	= (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP343X_SMS_BASE),
+	.ctrl	= (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP343X_CTRL_BASE),
+	.prm	= (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP3430_PRM_BASE),
+	.cm	= (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP3430_CM_BASE),
+};
+
+void __init omap2_set_globals_3525(void)
+{
+	omap2_globals = &omap3525_globals;
+	__omap2_set_globals();
+}
+#endif
+
+#if defined(CONFIG_ARCH_OMAP3530)
+
+static struct omap_globals omap3530_globals = {
+	.class	= OMAP35XX_CLASS,
+	.tap	= (__force void __iomem *)OMAP2_IO_ADDRESS(0x4830A000),
+	.sdrc	= (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP343X_SDRC_BASE),
+	.sms	= (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP343X_SMS_BASE),
+	.ctrl	= (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP343X_CTRL_BASE),
+	.prm	= (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP3430_PRM_BASE),
+	.cm	= (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP3430_CM_BASE),
+};
+
+void __init omap2_set_globals_3530(void)
+{
+	omap2_globals = &omap3530_globals;
+	__omap2_set_globals();
+}
+#endif
+
diff --git a/include/asm-arm/arch-omap/common.h b/include/asm-arm/arch-omap/common.h
index 8a525ed..9bdb353 100644
--- a/include/asm-arm/arch-omap/common.h
+++ b/include/asm-arm/arch-omap/common.h
@@ -62,6 +62,10 @@ struct omap_globals {
 void omap2_set_globals_242x(void);
 void omap2_set_globals_243x(void);
 void omap2_set_globals_343x(void);
+void omap2_set_globals_3503(void);
+void omap2_set_globals_3515(void);
+void omap2_set_globals_3525(void);
+void omap2_set_globals_3535(void);
 
 /* These get called from omap2_set_globals_xxxx(), do not call these */
 void omap2_set_globals_tap(struct omap_globals *);
diff --git a/include/asm-arm/arch-omap/cpu.h b/include/asm-arm/arch-omap/cpu.h
index 33f26e9..bbe69ce 100644
--- a/include/asm-arm/arch-omap/cpu.h
+++ b/include/asm-arm/arch-omap/cpu.h
@@ -97,6 +97,45 @@ extern unsigned int system_rev;
 # endif
 #endif
 
+#ifdef CONFIG_ARCH_OMAP35XX
+# ifdef CONFIG_ARCH_OMAP3503
+#  ifdef OMAP_NAME
+#   undef  MULTI_OMAP2
+#   define MULTI_OMAP2
+#  else
+#   define OMAP_NAME omap3503
+#  endif
+# endif  /* ifdef CONFIG_ARCH_OMAP3503 */
+
+# ifdef CONFIG_ARCH_OMAP3515
+#  ifdef OMAP_NAME
+#   undef  MULTI_OMAP2
+#   define MULTI_OMAP2
+#  else
+#   define OMAP_NAME omap3515
+#  endif
+# endif  /* ifdef CONFIG_ARCH_OMAP3515 */
+
+# ifdef CONFIG_ARCH_OMAP3525
+#  ifdef OMAP_NAME
+#   undef  MULTI_OMAP2
+#   define MULTI_OMAP2
+#  else
+#   define OMAP_NAME omap3525
+#  endif
+# endif  /* ifdef CONFIG_ARCH_OMAP3525 */
+
+# ifdef CONFIG_ARCH_OMAP3530
+#  ifdef OMAP_NAME
+#   undef  MULTI_OMAP2
+#   define MULTI_OMAP2
+#  else
+#   define OMAP_NAME omap3530
+#  endif
+# endif  /* ifdef CONFIG_ARCH_OMAP3530 */
+
+#endif  /* ifdef CONFIG_ARCH_OMAP35XX */
+
 /*
  * Macros to group OMAP into cpu classes.
  * These can be used in most places.
@@ -107,6 +146,7 @@ extern unsigned int system_rev;
  * cpu_is_omap242x():	True for OMAP2420, OMAP2422, OMAP2423
  * cpu_is_omap243x():	True for OMAP2430
  * cpu_is_omap343x():	True for OMAP3430
+ * cpu_is_omap35x():	True for OMAP35x
  */
 #define GET_OMAP_CLASS	((system_rev >> 24) & 0xff)
 
@@ -142,6 +182,7 @@ IS_OMAP_SUBCLASS(343x, 0x343)
 #define cpu_is_omap243x()		0
 #define cpu_is_omap34xx()		0
 #define cpu_is_omap343x()		0
+#define cpu_is_omap35xx()		0
 
 #if defined(MULTI_OMAP1)
 # if defined(CONFIG_ARCH_OMAP730)
@@ -186,6 +227,10 @@ IS_OMAP_SUBCLASS(343x, 0x343)
 #  define cpu_is_omap34xx()		is_omap34xx()
 #  define cpu_is_omap343x()		is_omap343x()
 # endif
+# if defined(CONFIG_ARCH_OMAP35XX)
+#  undef  cpu_is_omap35xx
+#  define cpu_is_omap35xx()		is_omap35xx()
+# endif
 #else
 # if defined(CONFIG_ARCH_OMAP24XX)
 #  undef  cpu_is_omap24xx
@@ -225,6 +270,10 @@ IS_OMAP_SUBCLASS(343x, 0x343)
  * cpu_is_omap2423():	True for OMAP2423
  * cpu_is_omap2430():	True for OMAP2430
  * cpu_is_omap3430():	True for OMAP3430
+ * cpu_is_omap3503():	True for OMAP3503
+ * cpu_is_omap3515():	True for OMAP3515
+ * cpu_is_omap3525():	True for OMAP3525
+ * cpu_is_omap3530():	True for OMAP3530
  */
 #define GET_OMAP_TYPE	((system_rev >> 16) & 0xffff)
 
@@ -247,6 +296,10 @@ IS_OMAP_TYPE(2422, 0x2422)
 IS_OMAP_TYPE(2423, 0x2423)
 IS_OMAP_TYPE(2430, 0x2430)
 IS_OMAP_TYPE(3430, 0x3430)
+IS_OMAP_TYPE(3503, 0x3430)
+IS_OMAP_TYPE(3515, 0x3430)
+IS_OMAP_TYPE(3525, 0x3430)
+IS_OMAP_TYPE(3530, 0x3430)
 
 #define cpu_is_omap310()		0
 #define cpu_is_omap730()		0
@@ -261,6 +314,10 @@ IS_OMAP_TYPE(3430, 0x3430)
 #define cpu_is_omap2423()		0
 #define cpu_is_omap2430()		0
 #define cpu_is_omap3430()		0
+#define cpu_is_omap3503()		0
+#define cpu_is_omap3515()		0
+#define cpu_is_omap3525()		0
+#define cpu_is_omap3530()		0
 
 #if defined(MULTI_OMAP1)
 # if defined(CONFIG_ARCH_OMAP730)
@@ -314,6 +371,26 @@ IS_OMAP_TYPE(3430, 0x3430)
 # define cpu_is_omap3430()		is_omap3430()
 #endif
 
+#if defined(CONFIG_ARCH_OMAP35XX)
+# undef cpu_is_omap3503
+# undef cpu_is_omap3515
+# undef cpu_is_omap3525
+# undef cpu_is_omap3530
+
+# if defined(CONFIG_ARCH_OMAP3503)
+#  define cpu_is_omap3503()		1
+# endif
+# if defined(CONFIG_ARCH_OMAP3515)
+#  define cpu_is_omap3515()		1
+# endif
+# if defined(CONFIG_ARCH_OMAP3525)
+#  define cpu_is_omap3525()		1
+# endif
+# if defined(CONFIG_ARCH_OMAP3525)
+#  define cpu_is_omap3530()		1
+# endif
+#endif	/* if defined(CONFIG_ARCH_OMAP35XX) */
+
 /* Macros to detect if we have OMAP1 or OMAP2 */
 #define cpu_class_is_omap1()	(cpu_is_omap730() || cpu_is_omap15xx() || \
 				cpu_is_omap16xx())
@@ -359,6 +436,8 @@ IS_OMAP_TYPE(3430, 0x3430)
 #define OMAP3430_REV_ES2_1	0x34302000
 #define OMAP3430_REV_ES2_2	0x34303000
 
+#define OMAP35XX_CLASS		0x34300000
+
 /*
  * omap_chip bits
  *
-- 
1.5.6

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

* [PATCH 3/3] Updates to OMAP3EVM defconfig
  2008-09-01 19:57 [PATCH 1/3] Add support for OMAP35x processors Sanjeev Premi
  2008-09-01 19:57 ` [PATCH 2/3] Runtime check for OMAP35x Sanjeev Premi
@ 2008-09-01 19:57 ` Sanjeev Premi
  1 sibling, 0 replies; 6+ messages in thread
From: Sanjeev Premi @ 2008-09-01 19:57 UTC (permalink / raw)
  To: linux-omap; +Cc: Sanjeev Premi

---
 arch/arm/configs/omap3_evm_defconfig |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/arch/arm/configs/omap3_evm_defconfig b/arch/arm/configs/omap3_evm_defconfig
index 718c914..cdf74e9 100644
--- a/arch/arm/configs/omap3_evm_defconfig
+++ b/arch/arm/configs/omap3_evm_defconfig
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.26-rc1-omap1
-# Thu May  8 08:18:45 2008
+# Linux kernel version: 2.6.26-omap1
+# Thu Sep  1 22:10:43 2008
 #
 CONFIG_ARM=y
 CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -173,6 +173,7 @@ CONFIG_ARCH_OMAP3=y
 CONFIG_OMAP_DEBUG_SRAM_PATCH=y
 # CONFIG_OMAP_DEBUG_POWERDOMAIN is not set
 # CONFIG_OMAP_DEBUG_CLOCKDOMAIN is not set
+# CONFIG_OMAP_SMARTREFLEX is not set
 # CONFIG_OMAP_RESET_CLOCKS is not set
 CONFIG_OMAP_BOOT_TAG=y
 CONFIG_OMAP_BOOT_REASON=y
@@ -191,6 +192,11 @@ CONFIG_OMAP_LL_DEBUG_UART1=y
 # CONFIG_OMAP_LL_DEBUG_UART3 is not set
 CONFIG_ARCH_OMAP34XX=y
 CONFIG_ARCH_OMAP3430=y
+CONFIG_ARCH_OMAP35XX=y
+CONFIG_ARCH_OMAP3503=y
+# CONFIG_ARCH_OMAP3515 is not set
+# CONFIG_ARCH_OMAP3525 is not set
+# CONFIG_ARCH_OMAP3530 is not set
 
 #
 # OMAP Board Type
@@ -198,6 +204,8 @@ CONFIG_ARCH_OMAP3430=y
 # CONFIG_MACH_OMAP_3430SDP is not set
 CONFIG_MACH_OMAP3EVM=y
 # CONFIG_MACH_OMAP3_BEAGLE is not set
+# CONFIG_MACH_OMAP_LDP is not set
+CONFIG_OMAP_TICK_GPTIMER=1
 
 #
 # Boot options
@@ -297,7 +305,7 @@ CONFIG_FPE_NWFPE=y
 # CONFIG_FPE_FASTFPE is not set
 CONFIG_VFP=y
 CONFIG_VFPv3=y
-# CONFIG_NEON is not set
+CONFIG_NEON=y
 
 #
 # Userspace binary formats
@@ -778,6 +786,7 @@ CONFIG_SSB_POSSIBLE=y
 #
 # CONFIG_VIDEO_DEV is not set
 # CONFIG_DVB_CORE is not set
+# CONFIG_VIDEO_MEDIA is not set
 
 #
 # Multimedia drivers
-- 
1.5.6


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

* Re: [PATCH 2/3] Runtime check for OMAP35x
  2008-09-01 19:57 ` [PATCH 2/3] Runtime check for OMAP35x Sanjeev Premi
@ 2008-09-01 20:10   ` Russell King - ARM Linux
  2008-09-02  6:29     ` Premi, Sanjeev
  2008-09-02 17:30   ` Premi, Sanjeev
  1 sibling, 1 reply; 6+ messages in thread
From: Russell King - ARM Linux @ 2008-09-01 20:10 UTC (permalink / raw)
  To: Sanjeev Premi; +Cc: linux-omap

On Tue, Sep 02, 2008 at 01:27:46AM +0530, Sanjeev Premi wrote:
> Based on earlier review comments, added runtime
> check of the OMAP35x via omap2_set_globasl_3503() etc.
> ---
>  arch/arm/plat-omap/common.c        |   76 ++++++++++++++++++++++++++++++++++
>  include/asm-arm/arch-omap/common.h |    4 ++
>  include/asm-arm/arch-omap/cpu.h    |   79 ++++++++++++++++++++++++++++++++++++
>  3 files changed, 159 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/plat-omap/common.c b/arch/arm/plat-omap/common.c
> index 3a5f05e..f8b04cc 100644
> --- a/arch/arm/plat-omap/common.c
> +++ b/arch/arm/plat-omap/common.c
> @@ -334,3 +334,79 @@ void __init omap2_set_globals_343x(void)
>  }
>  #endif
>  
> +#if defined(CONFIG_ARCH_OMAP3503)
> +
> +static struct omap_globals omap3503_globals = {
> +	.class	= OMAP35XX_CLASS,
> +	.tap	= (__force void __iomem *)OMAP2_IO_ADDRESS(0x4830A000),

See my comments elsewhere about why this is Really Bad.  Any casts
outside of a few header files using __force are basically a bug.

In this case, you're being forced to use them because OMAP2_IO_ADDRESS
doesn't return the proper pointer values.  (I produced a patch for
comment on this list last week over this issue.)

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

* RE: [PATCH 2/3] Runtime check for OMAP35x
  2008-09-01 20:10   ` Russell King - ARM Linux
@ 2008-09-02  6:29     ` Premi, Sanjeev
  0 siblings, 0 replies; 6+ messages in thread
From: Premi, Sanjeev @ 2008-09-02  6:29 UTC (permalink / raw)
  To: Russell King - ARM Linux; +Cc: linux-omap@vger.kernel.org


-----Original Message-----
From: Russell King - ARM Linux [mailto:linux@arm.linux.org.uk] 
Sent: Tuesday, September 02, 2008 1:41 AM
To: Premi, Sanjeev
Cc: linux-omap@vger.kernel.org
Subject: Re: [PATCH 2/3] Runtime check for OMAP35x

On Tue, Sep 02, 2008 at 01:27:46AM +0530, Sanjeev Premi wrote:
> Based on earlier review comments, added runtime check of the OMAP35x 
> via omap2_set_globasl_3503() etc.
> ---
>  arch/arm/plat-omap/common.c        |   76 ++++++++++++++++++++++++++++++++++
>  include/asm-arm/arch-omap/common.h |    4 ++
>  include/asm-arm/arch-omap/cpu.h    |   79 ++++++++++++++++++++++++++++++++++++
>  3 files changed, 159 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/plat-omap/common.c b/arch/arm/plat-omap/common.c 
> index 3a5f05e..f8b04cc 100644
> --- a/arch/arm/plat-omap/common.c
> +++ b/arch/arm/plat-omap/common.c
> @@ -334,3 +334,79 @@ void __init omap2_set_globals_343x(void)  }  
> #endif
>  
> +#if defined(CONFIG_ARCH_OMAP3503)
> +
> +static struct omap_globals omap3503_globals = {
> +	.class	= OMAP35XX_CLASS,
> +	.tap	= (__force void __iomem *)OMAP2_IO_ADDRESS(0x4830A000),

See my comments elsewhere about why this is Really Bad.  Any casts outside of a few header files using __force are basically a bug.

In this case, you're being forced to use them because OMAP2_IO_ADDRESS doesn't return the proper pointer values.  (I produced a patch for comment on this list last week over this issue.)

[sp] I was trying to be consistent/similar with current code in the file. Will make appropriate changes as you suggest.

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

* RE: [PATCH 2/3] Runtime check for OMAP35x
  2008-09-01 19:57 ` [PATCH 2/3] Runtime check for OMAP35x Sanjeev Premi
  2008-09-01 20:10   ` Russell King - ARM Linux
@ 2008-09-02 17:30   ` Premi, Sanjeev
  1 sibling, 0 replies; 6+ messages in thread
From: Premi, Sanjeev @ 2008-09-02 17:30 UTC (permalink / raw)
  To: linux-omap@vger.kernel.org

 

> -----Original Message-----
> From: Premi, Sanjeev 
> Sent: Tuesday, September 02, 2008 1:28 AM
> To: linux-omap@vger.kernel.org
> Cc: Premi, Sanjeev
> Subject: [PATCH 2/3] Runtime check for OMAP35x
> 
> Based on earlier review comments, added runtime check of the 
> OMAP35x via omap2_set_globasl_3503() etc.
> ---
>  arch/arm/plat-omap/common.c        |   76 
> ++++++++++++++++++++++++++++++++++
>  include/asm-arm/arch-omap/common.h |    4 ++
>  include/asm-arm/arch-omap/cpu.h    |   79 
> ++++++++++++++++++++++++++++++++++++
>  3 files changed, 159 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/plat-omap/common.c 
> b/arch/arm/plat-omap/common.c index 3a5f05e..f8b04cc 100644
> --- a/arch/arm/plat-omap/common.c
> +++ b/arch/arm/plat-omap/common.c
> @@ -334,3 +334,79 @@ void __init omap2_set_globals_343x(void) 
>  }  #endif
>  
> +#if defined(CONFIG_ARCH_OMAP3503)
> +
> +static struct omap_globals omap3503_globals = {
> +	.class	= OMAP35XX_CLASS,
> +	.tap	= (__force void __iomem *)OMAP2_IO_ADDRESS(0x4830A000),
> +	.sdrc	= (__force void __iomem 
> *)OMAP2_IO_ADDRESS(OMAP343X_SDRC_BASE),
> +	.sms	= (__force void __iomem 
> *)OMAP2_IO_ADDRESS(OMAP343X_SMS_BASE),
> +	.ctrl	= (__force void __iomem 
> *)OMAP2_IO_ADDRESS(OMAP343X_CTRL_BASE),
> +	.prm	= (__force void __iomem 
> *)OMAP2_IO_ADDRESS(OMAP3430_PRM_BASE),
> +	.cm	= (__force void __iomem 
> *)OMAP2_IO_ADDRESS(OMAP3430_CM_BASE),
> +};
> +
> +void __init omap2_set_globals_3503(void) {
> +	omap2_globals = &omap3503_globals;
> +	__omap2_set_globals();
> +}
> +#endif
> +
> +#if defined(CONFIG_ARCH_OMAP3515)
> +
> +static struct omap_globals omap3515_globals = {
> +	.class	= OMAP35XX_CLASS,
> +	.tap	= (__force void __iomem *)OMAP2_IO_ADDRESS(0x4830A000),
> +	.sdrc	= (__force void __iomem 
> *)OMAP2_IO_ADDRESS(OMAP343X_SDRC_BASE),
> +	.sms	= (__force void __iomem 
> *)OMAP2_IO_ADDRESS(OMAP343X_SMS_BASE),
> +	.ctrl	= (__force void __iomem 
> *)OMAP2_IO_ADDRESS(OMAP343X_CTRL_BASE),
> +	.prm	= (__force void __iomem 
> *)OMAP2_IO_ADDRESS(OMAP3430_PRM_BASE),
> +	.cm	= (__force void __iomem 
> *)OMAP2_IO_ADDRESS(OMAP3430_CM_BASE),
> +};
> +
> +void __init omap2_set_globals_3515(void) {
> +	omap2_globals = &omap3515_globals;
> +	__omap2_set_globals();
> +}
> +#endif
> +
> +#if defined(CONFIG_ARCH_OMAP3525)
> +
> +static struct omap_globals omap3525_globals = {
> +	.class	= OMAP35XX_CLASS,
> +	.tap	= (__force void __iomem *)OMAP2_IO_ADDRESS(0x4830A000),
> +	.sdrc	= (__force void __iomem 
> *)OMAP2_IO_ADDRESS(OMAP343X_SDRC_BASE),
> +	.sms	= (__force void __iomem 
> *)OMAP2_IO_ADDRESS(OMAP343X_SMS_BASE),
> +	.ctrl	= (__force void __iomem 
> *)OMAP2_IO_ADDRESS(OMAP343X_CTRL_BASE),
> +	.prm	= (__force void __iomem 
> *)OMAP2_IO_ADDRESS(OMAP3430_PRM_BASE),
> +	.cm	= (__force void __iomem 
> *)OMAP2_IO_ADDRESS(OMAP3430_CM_BASE),
> +};
> +
> +void __init omap2_set_globals_3525(void) {
> +	omap2_globals = &omap3525_globals;
> +	__omap2_set_globals();
> +}
> +#endif
> +
> +#if defined(CONFIG_ARCH_OMAP3530)
> +
> +static struct omap_globals omap3530_globals = {
> +	.class	= OMAP35XX_CLASS,
> +	.tap	= (__force void __iomem *)OMAP2_IO_ADDRESS(0x4830A000),
> +	.sdrc	= (__force void __iomem 
> *)OMAP2_IO_ADDRESS(OMAP343X_SDRC_BASE),
> +	.sms	= (__force void __iomem 
> *)OMAP2_IO_ADDRESS(OMAP343X_SMS_BASE),
> +	.ctrl	= (__force void __iomem 
> *)OMAP2_IO_ADDRESS(OMAP343X_CTRL_BASE),
> +	.prm	= (__force void __iomem 
> *)OMAP2_IO_ADDRESS(OMAP3430_PRM_BASE),
> +	.cm	= (__force void __iomem 
> *)OMAP2_IO_ADDRESS(OMAP3430_CM_BASE),
> +};
> +
> +void __init omap2_set_globals_3530(void) {
> +	omap2_globals = &omap3530_globals;
> +	__omap2_set_globals();
> +}
> +#endif
> +
> diff --git a/include/asm-arm/arch-omap/common.h 
> b/include/asm-arm/arch-omap/common.h
> index 8a525ed..9bdb353 100644
> --- a/include/asm-arm/arch-omap/common.h
> +++ b/include/asm-arm/arch-omap/common.h
> @@ -62,6 +62,10 @@ struct omap_globals {  void 
> omap2_set_globals_242x(void);  void 
> omap2_set_globals_243x(void);  void omap2_set_globals_343x(void);
> +void omap2_set_globals_3503(void);
> +void omap2_set_globals_3515(void);
> +void omap2_set_globals_3525(void);
> +void omap2_set_globals_3535(void);
>  
>  /* These get called from omap2_set_globals_xxxx(), do not 
> call these */  void omap2_set_globals_tap(struct omap_globals 
> *); diff --git a/include/asm-arm/arch-omap/cpu.h 
> b/include/asm-arm/arch-omap/cpu.h index 33f26e9..bbe69ce 100644
> --- a/include/asm-arm/arch-omap/cpu.h
> +++ b/include/asm-arm/arch-omap/cpu.h
> @@ -97,6 +97,45 @@ extern unsigned int system_rev;  # endif  #endif
>  
> +#ifdef CONFIG_ARCH_OMAP35XX
> +# ifdef CONFIG_ARCH_OMAP3503
> +#  ifdef OMAP_NAME
> +#   undef  MULTI_OMAP2
> +#   define MULTI_OMAP2
> +#  else
> +#   define OMAP_NAME omap3503
> +#  endif
> +# endif  /* ifdef CONFIG_ARCH_OMAP3503 */
> +
> +# ifdef CONFIG_ARCH_OMAP3515
> +#  ifdef OMAP_NAME
> +#   undef  MULTI_OMAP2
> +#   define MULTI_OMAP2
> +#  else
> +#   define OMAP_NAME omap3515
> +#  endif
> +# endif  /* ifdef CONFIG_ARCH_OMAP3515 */
> +
> +# ifdef CONFIG_ARCH_OMAP3525
> +#  ifdef OMAP_NAME
> +#   undef  MULTI_OMAP2
> +#   define MULTI_OMAP2
> +#  else
> +#   define OMAP_NAME omap3525
> +#  endif
> +# endif  /* ifdef CONFIG_ARCH_OMAP3525 */
> +
> +# ifdef CONFIG_ARCH_OMAP3530
> +#  ifdef OMAP_NAME
> +#   undef  MULTI_OMAP2
> +#   define MULTI_OMAP2
> +#  else
> +#   define OMAP_NAME omap3530
> +#  endif
> +# endif  /* ifdef CONFIG_ARCH_OMAP3530 */
> +
> +#endif  /* ifdef CONFIG_ARCH_OMAP35XX */
> +
>  /*
>   * Macros to group OMAP into cpu classes.
>   * These can be used in most places.
> @@ -107,6 +146,7 @@ extern unsigned int system_rev;
>   * cpu_is_omap242x():	True for OMAP2420, OMAP2422, OMAP2423
>   * cpu_is_omap243x():	True for OMAP2430
>   * cpu_is_omap343x():	True for OMAP3430
> + * cpu_is_omap35x():	True for OMAP35x
>   */
>  #define GET_OMAP_CLASS	((system_rev >> 24) & 0xff)
>  
> @@ -142,6 +182,7 @@ IS_OMAP_SUBCLASS(343x, 0x343)
>  #define cpu_is_omap243x()		0
>  #define cpu_is_omap34xx()		0
>  #define cpu_is_omap343x()		0
> +#define cpu_is_omap35xx()		0
>  
>  #if defined(MULTI_OMAP1)
>  # if defined(CONFIG_ARCH_OMAP730)
> @@ -186,6 +227,10 @@ IS_OMAP_SUBCLASS(343x, 0x343)
>  #  define cpu_is_omap34xx()		is_omap34xx()
>  #  define cpu_is_omap343x()		is_omap343x()
>  # endif
> +# if defined(CONFIG_ARCH_OMAP35XX)
> +#  undef  cpu_is_omap35xx
> +#  define cpu_is_omap35xx()		is_omap35xx()
> +# endif
>  #else
>  # if defined(CONFIG_ARCH_OMAP24XX)
>  #  undef  cpu_is_omap24xx
> @@ -225,6 +270,10 @@ IS_OMAP_SUBCLASS(343x, 0x343)
>   * cpu_is_omap2423():	True for OMAP2423
>   * cpu_is_omap2430():	True for OMAP2430
>   * cpu_is_omap3430():	True for OMAP3430
> + * cpu_is_omap3503():	True for OMAP3503
> + * cpu_is_omap3515():	True for OMAP3515
> + * cpu_is_omap3525():	True for OMAP3525
> + * cpu_is_omap3530():	True for OMAP3530
>   */
>  #define GET_OMAP_TYPE	((system_rev >> 16) & 0xffff)
>  
> @@ -247,6 +296,10 @@ IS_OMAP_TYPE(2422, 0x2422)  
> IS_OMAP_TYPE(2423, 0x2423)  IS_OMAP_TYPE(2430, 0x2430)  
> IS_OMAP_TYPE(3430, 0x3430)
> +IS_OMAP_TYPE(3503, 0x3430)
> +IS_OMAP_TYPE(3515, 0x3430)
> +IS_OMAP_TYPE(3525, 0x3430)
> +IS_OMAP_TYPE(3530, 0x3430)
>  
>  #define cpu_is_omap310()		0
>  #define cpu_is_omap730()		0
> @@ -261,6 +314,10 @@ IS_OMAP_TYPE(3430, 0x3430)
>  #define cpu_is_omap2423()		0
>  #define cpu_is_omap2430()		0
>  #define cpu_is_omap3430()		0
> +#define cpu_is_omap3503()		0
> +#define cpu_is_omap3515()		0
> +#define cpu_is_omap3525()		0
> +#define cpu_is_omap3530()		0
>  
>  #if defined(MULTI_OMAP1)
>  # if defined(CONFIG_ARCH_OMAP730)
> @@ -314,6 +371,26 @@ IS_OMAP_TYPE(3430, 0x3430)
>  # define cpu_is_omap3430()		is_omap3430()
>  #endif
>  
> +#if defined(CONFIG_ARCH_OMAP35XX)
> +# undef cpu_is_omap3503
> +# undef cpu_is_omap3515
> +# undef cpu_is_omap3525
> +# undef cpu_is_omap3530
> +
> +# if defined(CONFIG_ARCH_OMAP3503)
> +#  define cpu_is_omap3503()		1
> +# endif
> +# if defined(CONFIG_ARCH_OMAP3515)
> +#  define cpu_is_omap3515()		1
> +# endif
> +# if defined(CONFIG_ARCH_OMAP3525)
> +#  define cpu_is_omap3525()		1
> +# endif
> +# if defined(CONFIG_ARCH_OMAP3525)
> +#  define cpu_is_omap3530()		1
> +# endif
> +#endif	/* if defined(CONFIG_ARCH_OMAP35XX) */
> +
>  /* Macros to detect if we have OMAP1 or OMAP2 */
>  #define cpu_class_is_omap1()	(cpu_is_omap730() || 
> cpu_is_omap15xx() || \
>  				cpu_is_omap16xx())
> @@ -359,6 +436,8 @@ IS_OMAP_TYPE(3430, 0x3430)
>  #define OMAP3430_REV_ES2_1	0x34302000
>  #define OMAP3430_REV_ES2_2	0x34303000
>  
> +#define OMAP35XX_CLASS		0x34300000
> +
>  /*
>   * omap_chip bits
>   *
> --
> 1.5.6
> 

This patch is breaking the build at following location in (arch/arm/mach-omap2/usb-musb.c)

   #ifdef CONFIG_USB_MUSB_SOC
   static struct resource musb_resources[] = {
        [0] = {
                .start  = cpu_is_omap34xx()
                        ? OMAP34XX_HSUSB_OTG_BASE
                        : OMAP243X_HS_BASE,
                .end    = cpu_is_omap34xx()
                        ? OMAP34XX_HSUSB_OTG_BASE + SZ_8K - 1
                        : OMAP243X_HS_BASE + SZ_8K -1,
                .flags  = IORESOURCE_MEM,
        },

Here, cpu_is_omap34xx() is expected to be evaluated as constant by the compiler, but my earlier patch was eveluating as inline function causing the build to fail.

Did not catch is earlier as CONFIG_USB_MUSB_SOC was not set in my .config :(

I will be re-submitting this patch again.

~sanjeev

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

end of thread, other threads:[~2008-09-02 17:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-01 19:57 [PATCH 1/3] Add support for OMAP35x processors Sanjeev Premi
2008-09-01 19:57 ` [PATCH 2/3] Runtime check for OMAP35x Sanjeev Premi
2008-09-01 20:10   ` Russell King - ARM Linux
2008-09-02  6:29     ` Premi, Sanjeev
2008-09-02 17:30   ` Premi, Sanjeev
2008-09-01 19:57 ` [PATCH 3/3] Updates to OMAP3EVM defconfig Sanjeev Premi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox