Skip to contentSkip to conversation

ARM: OMAP2+: Cleanup series in order to remove ARCH_OMAPx dependency

PATCH New Vaibhav Hiremath 3 participants 12 messages Jun 28, 2012 – Jul 5, 2012

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

v3 cover ARM: OMAP2+: Cleanup series in order to remove ARCH_OMAPx dependency

In current implementation, some places we are still using ARCH_OMAPx config option, making it difficult to add new devices; for example, while adding am33xx device support I came across multiple instances where I had to patch the existing code to make it work for am33xx.

This patch tries to cleanup existing code for some of the ARCH_OMAP2/3/4 dependency on the code.

NOTE: Patch series has been build tested for all possible
combination of OMAP2, 3, 4 configurations.

History on Patch-series:
========================
Changes from V2:
- Rebased against latest linux-omap/master
- Removed [Patch 4/4], fixed it separately as independent patch. Already in Mainline.
- Fixed comments form KevinH, added Makefile rule for sdrc.c

Changes from V1:
- Fixed comments from Tony
- Config option name of SOC_HAS_SDRC changed to SOC_HAS_OMAP2_SDRC
- Config option name for SOC_HAS_DPLL_xxx flags to SOC_HAS_OMAP3_DPLL_xxx.

Vaibhav Hiremath (3):
ARM: OMAP2+: CLEANUP: All OMAP2PLUS uses omap-device.o target so add
one entry
ARM: OMAP2+: CLEANUP: Move omap3 dpll ops to dpll3xxx.c
ARM: OMAP2+: CLEANUP: Remove unnecessary ifdef around

    __omap2_set_globals
 arch/arm/mach-omap2/Kconfig    |    8 ++++++++
 arch/arm/mach-omap2/Makefile   |    3 ++-
 arch/arm/mach-omap2/clock.c    |   18 ------------------
 arch/arm/mach-omap2/common.c   |    8 +-------
 arch/arm/mach-omap2/common.h   |    5 +++++
 arch/arm/mach-omap2/dpll3xxx.c |   14 ++++++++++++++
 arch/arm/plat-omap/Makefile    |    4 +---
 7 files changed, 31 insertions(+), 29 deletions(-)
#1 lore raw

PATCH v3 1/3 ARM: OMAP2+: CLEANUP: All OMAP2PLUS uses omap-device.o target so add one entry

All OMAP2PLUS based devices, builds omap-device.o target; so just add one entry so that there is no need to patch this file for any future OMAP2+ devices.

Cc Tony Lindgren <[email protected]>
Cc Kevin Hilman <[email protected]>
Cc Paul Walmsley <[email protected]>

NOTE: No code change from last version.

---
 arch/arm/plat-omap/Makefile |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
arch/arm/plat-omap/Makefile +1 -3
index 6d87532..961bf85 100644
@@ -10,9 +10,7 @@ obj-n :=
 obj-  :=
 
 # omap_device support (OMAP2+ only at the moment)
-obj-$(CONFIG_ARCH_OMAP2) += omap_device.o
-obj-$(CONFIG_ARCH_OMAP3) += omap_device.o
-obj-$(CONFIG_ARCH_OMAP4) += omap_device.o
+obj-$(CONFIG_ARCH_OMAP2PLUS) += omap_device.o
 
 obj-$(CONFIG_OMAP_DM_TIMER) += dmtimer.o
 obj-$(CONFIG_OMAP_DEBUG_DEVICES) += debug-devices.o

--
1.7.0.4

maintainer
#2 lore raw

PATCH v3 1/3 ARM: OMAP2+: CLEANUP: All OMAP2PLUS uses omap-device.o target so add one entry

Hi

Applying these, but few comments below to make my life easier..

Quoted 10 lines · Vaibhav Hiremath

All OMAP2PLUS based devices, builds omap-device.o target; so just add one entry so that there is no need to patch this file for any future OMAP2+ devices.

Cc Tony Lindgren <[email protected]>
Cc Kevin Hilman <[email protected]>
Cc Paul Walmsley <[email protected]>

NOTE: No code change from last version.

Extra comments like this should be within the --- sections so they down't show up when applying the patch. Otherwise I have to manually edit every patch, which sucks.

Then, I'm leaving out the CLEANUP part in $Subject, that alone is not a reason to patch anything. The description should say why the patch is needed, which it does. If you want to specify that this should be grouped in the clean-up branch, then that too could be mentioned within the --- sections.

Quoted 20 lines
---
 arch/arm/plat-omap/Makefile |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
arch/arm/plat-omap/Makefile +1 -4
index 6d87532..961bf85 100644
@@ -10,9 +10,7 @@ obj-n :=
 obj-  :=
 
 # omap_device support (OMAP2+ only at the moment)
-obj-$(CONFIG_ARCH_OMAP2) += omap_device.o
-obj-$(CONFIG_ARCH_OMAP3) += omap_device.o
-obj-$(CONFIG_ARCH_OMAP4) += omap_device.o
+obj-$(CONFIG_ARCH_OMAP2PLUS) += omap_device.o
 
 obj-$(CONFIG_OMAP_DM_TIMER) += dmtimer.o
 obj-$(CONFIG_OMAP_DEBUG_DEVICES) += debug-devices.o
--
Quoted 2 lines

1.7.0.4

This patch did not apply for some reason, I got:

patching file arch/arm/plat-omap/Makefile
patch: **** malformed patch at line 73: 1.7.0.4

So please tune up your scripts a bit to the patches can be applied as they are without manual editing ;)

Thanks,

Tony

#3 lore raw

PATCH v3 1/3 ARM: OMAP2+: CLEANUP: All OMAP2PLUS uses omap-device.o target so add one entry

Quoted 14 lines · Tony Lindgren

Hi

Applying these, but few comments below to make my life easier..

Quoted 9 lines · Vaibhav Hiremath

All OMAP2PLUS based devices, builds omap-device.o target; so just add one entry so that there is no need to patch this file for any future OMAP2+ devices.

Cc Tony Lindgren <[email protected]>
Cc Kevin Hilman <[email protected]>
Cc Paul Walmsley <[email protected]>
Quoted 6 lines
Quoted 1 line

NOTE: No code change from last version.

Extra comments like this should be within the --- sections so they down't show up when applying the patch. Otherwise I have to manually edit every patch, which sucks.

Oops...my bad.

These comments I keep deliberately after signoff so that I can move it after --- section while submitting, but somehow missed to do it for this patch-series.
I will take care of it in the future, sorry for inconvenience.

Quoted 6 lines

Then, I'm leaving out the CLEANUP part in $Subject, that alone is not a reason to patch anything. The description should say why the patch is needed, which it does. If you want to specify that this should be grouped in the clean-up branch, then that too could be mentioned within the --- sections.

Point taken, and will follow now.

Quoted 25 lines
Quoted 20 lines
---
 arch/arm/plat-omap/Makefile |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
arch/arm/plat-omap/Makefile +1 -4
index 6d87532..961bf85 100644
@@ -10,9 +10,7 @@ obj-n :=
 obj-  :=
 
 # omap_device support (OMAP2+ only at the moment)
-obj-$(CONFIG_ARCH_OMAP2) += omap_device.o
-obj-$(CONFIG_ARCH_OMAP3) += omap_device.o
-obj-$(CONFIG_ARCH_OMAP4) += omap_device.o
+obj-$(CONFIG_ARCH_OMAP2PLUS) += omap_device.o
 
 obj-$(CONFIG_OMAP_DM_TIMER) += dmtimer.o
 obj-$(CONFIG_OMAP_DEBUG_DEVICES) += debug-devices.o
--
Quoted 2 lines

1.7.0.4

This patch did not apply for some reason, I got:

Quoted 6 lines

patching file arch/arm/plat-omap/Makefile
patch: **** malformed patch at line 73: 1.7.0.4

So please tune up your scripts a bit to the patches can be applied as they are without manual editing ;)

Hmmmm...

I usually submit the patch against linux-omap/master (to handle cross dependencies), which in some cases fails on other branches you maintain. Probably I will make sure that it allies atleast to relevant branches, for example, in this case it should be applied on linux-omap/cleanup branch as well.

Thanks,
Vaibhav

maintainer
#4 lore raw

PATCH v3 1/3 ARM: OMAP2+: CLEANUP: All OMAP2PLUS uses omap-device.o target so add one entry

Quoted 11 lines · Hiremath, Vaibhav
Quoted 9 lines · Tony Lindgren

This patch did not apply for some reason, I got:

patching file arch/arm/plat-omap/Makefile
patch: **** malformed patch at line 73: 1.7.0.4

So please tune up your scripts a bit to the patches can be applied as they are without manual editing ;)

Quoted 7 lines

Hmmmm...

I usually submit the patch against linux-omap/master (to handle cross dependencies), which in some cases fails on other branches you maintain. Probably I will make sure that it allies atleast to relevant branches, for example, in this case it should be applied on linux-omap/cleanup branch as well.

The malformed patch error usually means that something messed up the patch, like the mail server.. Maybe tabs got replaced with spaces or something?

Tony

#5 lore raw

PATCH v3 2/3 ARM: OMAP2+: CLEANUP: Move omap3 dpll ops to dpll3xxx.c

In reply to Vaibhav Hiremath

In order to remove unnecessary idefs, move noncore and core dpll ops to dpll3xxx.c file (where it should have been already).

The clkops (clkops_omap3_core_dpll_ops & clkops_omap3_noncore_dpll_ops) is used in clock data files, and dependency is already handled by Makefile rule.

NOTE: No code change from last version.

---
 arch/arm/mach-omap2/clock.c    |   18 ------------------
 arch/arm/mach-omap2/dpll3xxx.c |   14 ++++++++++++++
 2 files changed, 14 insertions(+), 18 deletions(-)
arch/arm/mach-omap2/clock.c +0 -18
index 5c4e665..ea3f565 100644
@@ -398,24 +398,6 @@ int omap2_clk_set_parent(struct clk *clk, struct clk *new_parent)
 	return omap2_clksel_set_parent(clk, new_parent);
 }
 
-/* OMAP3/4 non-CORE DPLL clkops */
-
-#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
-
-const struct clkops clkops_omap3_noncore_dpll_ops = {
-	.enable		= omap3_noncore_dpll_enable,
-	.disable	= omap3_noncore_dpll_disable,
-	.allow_idle	= omap3_dpll_allow_idle,
-	.deny_idle	= omap3_dpll_deny_idle,
-};
-
-const struct clkops clkops_omap3_core_dpll_ops = {
-	.allow_idle	= omap3_dpll_allow_idle,
-	.deny_idle	= omap3_dpll_deny_idle,
-};
-
-#endif
-
 /*
  * OMAP2+ clock reset and init functions
  */
arch/arm/mach-omap2/dpll3xxx.c +14 -0
index f0f10be..ff6f237 100644
@@ -628,3 +628,17 @@ unsigned long omap3_clkoutx2_recalc(struct clk *clk)
 		rate = clk->parent->rate * 2;
 	return rate;
 }
+
+/* OMAP3/4 non-CORE DPLL clkops */
+
+const struct clkops clkops_omap3_noncore_dpll_ops = {
+	.enable		= omap3_noncore_dpll_enable,
+	.disable	= omap3_noncore_dpll_disable,
+	.allow_idle	= omap3_dpll_allow_idle,
+	.deny_idle	= omap3_dpll_deny_idle,
+};
+
+const struct clkops clkops_omap3_core_dpll_ops = {
+	.allow_idle	= omap3_dpll_allow_idle,
+	.deny_idle	= omap3_dpll_deny_idle,
+};

--
1.7.0.4

#6 lore raw

PATCH v3 3/3 ARM: OMAP2+: CLEANUP: Remove unnecessary ifdef around __omap2_set_globals

In reply to Vaibhav Hiremath

The function __omap2_set_globals() can be common across all platforms/architectures, even in case of omap4, internally it calls same set of functions as in __omap2_set_globals() function (except for sdrc).
This patch adds new config flag SOC_HAS_OMAP2_SDRC to handle sdrc, so that we can reuse same function across omap2/3/4...

Cc Tony Lindgren <[email protected]>
Cc Kevin Hilman <[email protected]>
Cc Paul Walmsley <[email protected]>

Changes from V1:
- Added Makefile rule to build sdrc.c file for new option SOC_HAS_OMAP2_SDRC (as per Kevin's comment).

---
 arch/arm/mach-omap2/Kconfig  |    8 ++++++++
 arch/arm/mach-omap2/Makefile |    3 ++-
 arch/arm/mach-omap2/common.c |    8 +-------
 arch/arm/mach-omap2/common.h |    5 +++++
 4 files changed, 16 insertions(+), 8 deletions(-)
arch/arm/mach-omap2/Kconfig +8 -0
index 208b950..82d9d18 100644
@@ -21,12 +21,16 @@ config ARCH_OMAP2PLUS_TYPICAL
 	help
 	  Compile a kernel suitable for booting most boards
 
+config SOC_HAS_OMAP2_SDRC
+	bool "OMAP2 SDRAM Controller support"
+
 config ARCH_OMAP2
 	bool "TI OMAP2"
 	depends on ARCH_OMAP2PLUS
 	default y
 	select CPU_V6
 	select MULTI_IRQ_HANDLER
+	select SOC_HAS_OMAP2_SDRC
 
 config ARCH_OMAP3
 	bool "TI OMAP3"
@@ -39,6 +43,7 @@ config ARCH_OMAP3
 	select PM_OPP if PM
 	select ARM_CPU_SUSPEND if PM
 	select MULTI_IRQ_HANDLER
+	select SOC_HAS_OMAP2_SDRC
 
 config ARCH_OMAP4
 	bool "TI OMAP4"
@@ -66,16 +71,19 @@ config SOC_OMAP2420
 	depends on ARCH_OMAP2
 	default y
 	select OMAP_DM_TIMER
+	select SOC_HAS_OMAP2_SDRC
 
 config SOC_OMAP2430
 	bool "OMAP2430 support"
 	depends on ARCH_OMAP2
 	default y
+	select SOC_HAS_OMAP2_SDRC
 
 config SOC_OMAP3430
 	bool "OMAP3430 support"
 	depends on ARCH_OMAP3
 	default y
+	select SOC_HAS_OMAP2_SDRC
 
 config SOC_TI81XX
 	bool "TI81XX support"
arch/arm/mach-omap2/Makefile +2 -1
index e5c17d3..3767164 100644
@@ -6,7 +6,7 @@
 obj-y := id.o io.o control.o mux.o devices.o serial.o gpmc.o timer.o pm.o \
 	 common.o gpio.o dma.o wd_timer.o display.o i2c.o hdq1w.o
 
-omap-2-3-common				= irq.o sdrc.o
+omap-2-3-common				= irq.o
 hwmod-common				= omap_hwmod.o \
 					  omap_hwmod_common_data.o
 clock-common				= clock.o clock_common_data.o \
@@ -23,6 +23,7 @@ obj-y += mcbsp.o
 endif
 
 obj-$(CONFIG_TWL4030_CORE) += omap_twl.o
+obj-$(CONFIG_SOC_HAS_OMAP2_SDRC)	+= sdrc.o
 
 # SMP support ONLY available for OMAP4
 
arch/arm/mach-omap2/common.c +1 -7
index 8a6953a..7978e5e 100644
@@ -29,8 +29,6 @@
 
 /* Global address base setup code */
 
-#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
-
 static void __init __omap2_set_globals(struct omap_globals *omap2_globals)
 {
 	omap2_set_globals_tap(omap2_globals);
@@ -39,8 +37,6 @@ static void __init __omap2_set_globals(struct omap_globals *omap2_globals)
 	omap2_set_globals_prcm(omap2_globals);
 }
 
-#endif
-
 #if defined(CONFIG_SOC_OMAP2420)
 
 static struct omap_globals omap242x_globals = {
@@ -171,9 +167,7 @@ static struct omap_globals omap4_globals = {
 
 void __init omap2_set_globals_443x(void)
 {
-	omap2_set_globals_tap(&omap4_globals);
-	omap2_set_globals_control(&omap4_globals);
-	omap2_set_globals_prcm(&omap4_globals);
+	__omap2_set_globals(&omap4_globals);
 }
 
 void __init omap4_map_io(void)
arch/arm/mach-omap2/common.h +5 -0
index 5d99c1b..404f172 100644
@@ -174,7 +174,12 @@ void omap2_set_globals_am33xx(void);
 
 /* These get called from omap2_set_globals_xxxx(), do not call these */
 void omap2_set_globals_tap(struct omap_globals *);
+#if defined(CONFIG_SOC_HAS_OMAP2_SDRC)
 void omap2_set_globals_sdrc(struct omap_globals *);
+#else
+static inline void omap2_set_globals_sdrc(struct omap_globals *omap2_globals)
+{ }
+#endif
 void omap2_set_globals_control(struct omap_globals *);
 void omap2_set_globals_prcm(struct omap_globals *);
 

--
1.7.0.4

#7 lore raw

PATCH v3 3/3 ARM: OMAP2+: CLEANUP: Remove unnecessary ifdef around __omap2_set_globals

Hi Vaibhav,

One small comment.

Quoted 52 lines · Vaibhav Hiremath

The function __omap2_set_globals() can be common across all platforms/architectures, even in case of omap4, internally it calls same set of functions as in __omap2_set_globals() function (except for sdrc).
This patch adds new config flag SOC_HAS_OMAP2_SDRC to handle sdrc, so that we can reuse same function across omap2/3/4...

Cc Tony Lindgren <[email protected]>
Cc Kevin Hilman <[email protected]>
Cc Paul Walmsley <[email protected]>

Changes from V1:
- Added Makefile rule to build sdrc.c file for new option SOC_HAS_OMAP2_SDRC (as per Kevin's comment).

---
  arch/arm/mach-omap2/Kconfig  |    8 ++++++++
  arch/arm/mach-omap2/Makefile |    3 ++-
  arch/arm/mach-omap2/common.c |    8 +-------
  arch/arm/mach-omap2/common.h |    5 +++++
  4 files changed, 16 insertions(+), 8 deletions(-)
arch/arm/mach-omap2/Kconfig +5 -0
index 208b950..82d9d18 100644
@@ -21,12 +21,16 @@ config ARCH_OMAP2PLUS_TYPICAL
  	help
  	  Compile a kernel suitable for booting most boards
 
+config SOC_HAS_OMAP2_SDRC
+	bool "OMAP2 SDRAM Controller support"
+
  config ARCH_OMAP2
  	bool "TI OMAP2"
  	depends on ARCH_OMAP2PLUS
  	default y
  	select CPU_V6
  	select MULTI_IRQ_HANDLER
+	select SOC_HAS_OMAP2_SDRC
 
  config ARCH_OMAP3
  	bool "TI OMAP3"
@@ -39,6 +43,7 @@ config ARCH_OMAP3
  	select PM_OPP if PM
  	select ARM_CPU_SUSPEND if PM
  	select MULTI_IRQ_HANDLER
+	select SOC_HAS_OMAP2_SDRC
 
  config ARCH_OMAP4
  	bool "TI OMAP4"

arch/arm/mach-omap2/Kconfig config SOC_OMAP2420 · line 74

Quoted 4 lines
arch/arm/mach-omap2/Kconfig +1 -0
@@ -66,16 +71,19 @@ config SOC_OMAP2420
  	depends on ARCH_OMAP2
  	default y
  	select OMAP_DM_TIMER
+	select SOC_HAS_OMAP2_SDRC

OMAP4 does not have the SDRC but the EMIF like TI8XX.

Regards,
Benoit

#8 lore raw

PATCH v3 3/3 ARM: OMAP2+: CLEANUP: Remove unnecessary ifdef around __omap2_set_globals

Quoted 54 lines · Benoit

Hi Vaibhav,

One small comment.

Quoted 49 lines · Vaibhav Hiremath

The function __omap2_set_globals() can be common across all platforms/architectures, even in case of omap4, internally it calls same set of functions as in __omap2_set_globals() function (except for sdrc).
This patch adds new config flag SOC_HAS_OMAP2_SDRC to handle sdrc, so that we can reuse same function across omap2/3/4...

Cc Tony Lindgren <[email protected]>
Cc Kevin Hilman <[email protected]>
Cc Paul Walmsley <[email protected]>

Changes from V1:
- Added Makefile rule to build sdrc.c file for new option SOC_HAS_OMAP2_SDRC (as per Kevin's comment).

---
  arch/arm/mach-omap2/Kconfig  |    8 ++++++++
  arch/arm/mach-omap2/Makefile |    3 ++-
  arch/arm/mach-omap2/common.c |    8 +-------
  arch/arm/mach-omap2/common.h |    5 +++++
  4 files changed, 16 insertions(+), 8 deletions(-)
arch/arm/mach-omap2/Kconfig +5 -0
index 208b950..82d9d18 100644
@@ -21,12 +21,16 @@ config ARCH_OMAP2PLUS_TYPICAL
  	help
  	  Compile a kernel suitable for booting most boards
 
+config SOC_HAS_OMAP2_SDRC
+	bool "OMAP2 SDRAM Controller support"
+
  config ARCH_OMAP2
  	bool "TI OMAP2"
  	depends on ARCH_OMAP2PLUS
  	default y
  	select CPU_V6
  	select MULTI_IRQ_HANDLER
+	select SOC_HAS_OMAP2_SDRC
 
  config ARCH_OMAP3
  	bool "TI OMAP3"
@@ -39,6 +43,7 @@ config ARCH_OMAP3
  	select PM_OPP if PM
  	select ARM_CPU_SUSPEND if PM
  	select MULTI_IRQ_HANDLER
+	select SOC_HAS_OMAP2_SDRC
 
Quoted 10 lines

arch/arm/mach-omap2/Kconfig config SOC_OMAP2420 · line 74

Quoted 7 lines
arch/arm/mach-omap2/Kconfig +1 -0
  config ARCH_OMAP4
  	bool "TI OMAP4"
@@ -66,16 +71,19 @@ config SOC_OMAP2420
  	depends on ARCH_OMAP2
  	default y
  	select OMAP_DM_TIMER
+	select SOC_HAS_OMAP2_SDRC

OMAP4 does not have the SDRC but the EMIF like TI8XX.

Good catch :)

Will fix it and send next version shortly.

Thanks,
Vaibhav

#9 lore raw

PATCH v3 3/3 ARM: OMAP2+: CLEANUP: Remove unnecessary ifdef around __omap2_set_globals

In reply to Benoit Cousson
Quoted 54 lines · Benoit

Hi Vaibhav,

One small comment.

Quoted 49 lines · Vaibhav Hiremath

The function __omap2_set_globals() can be common across all platforms/architectures, even in case of omap4, internally it calls same set of functions as in __omap2_set_globals() function (except for sdrc).
This patch adds new config flag SOC_HAS_OMAP2_SDRC to handle sdrc, so that we can reuse same function across omap2/3/4...

Cc Tony Lindgren <[email protected]>
Cc Kevin Hilman <[email protected]>
Cc Paul Walmsley <[email protected]>

Changes from V1:
- Added Makefile rule to build sdrc.c file for new option SOC_HAS_OMAP2_SDRC (as per Kevin's comment).

---
  arch/arm/mach-omap2/Kconfig  |    8 ++++++++
  arch/arm/mach-omap2/Makefile |    3 ++-
  arch/arm/mach-omap2/common.c |    8 +-------
  arch/arm/mach-omap2/common.h |    5 +++++
  4 files changed, 16 insertions(+), 8 deletions(-)
arch/arm/mach-omap2/Kconfig +5 -0
index 208b950..82d9d18 100644
@@ -21,12 +21,16 @@ config ARCH_OMAP2PLUS_TYPICAL
  	help
  	  Compile a kernel suitable for booting most boards
 
+config SOC_HAS_OMAP2_SDRC
+	bool "OMAP2 SDRAM Controller support"
+
  config ARCH_OMAP2
  	bool "TI OMAP2"
  	depends on ARCH_OMAP2PLUS
  	default y
  	select CPU_V6
  	select MULTI_IRQ_HANDLER
+	select SOC_HAS_OMAP2_SDRC
 
  config ARCH_OMAP3
  	bool "TI OMAP3"
@@ -39,6 +43,7 @@ config ARCH_OMAP3
  	select PM_OPP if PM
  	select ARM_CPU_SUSPEND if PM
  	select MULTI_IRQ_HANDLER
+	select SOC_HAS_OMAP2_SDRC
 
Quoted 10 lines

arch/arm/mach-omap2/Kconfig config SOC_OMAP2420 · line 74

Quoted 7 lines
arch/arm/mach-omap2/Kconfig +1 -0
  config ARCH_OMAP4
  	bool "TI OMAP4"
@@ -66,16 +71,19 @@ config SOC_OMAP2420
  	depends on ARCH_OMAP2
  	default y
  	select OMAP_DM_TIMER
+	select SOC_HAS_OMAP2_SDRC

OMAP4 does not have the SDRC but the EMIF like TI8XX.

Benoit,

This selection is happening for SOC_OMAP2420 and not for OMAP4.

Thanks,
Vaibhav

#10 lore raw

PATCH v3 3/3 ARM: OMAP2+: CLEANUP: Remove unnecessary ifdef around __omap2_set_globals

Quoted 66 lines · Vaibhav
Quoted 54 lines · Benoit

Hi Vaibhav,

One small comment.

Quoted 49 lines · Vaibhav Hiremath

The function __omap2_set_globals() can be common across all platforms/architectures, even in case of omap4, internally it calls same set of functions as in __omap2_set_globals() function (except for sdrc).
This patch adds new config flag SOC_HAS_OMAP2_SDRC to handle sdrc, so that we can reuse same function across omap2/3/4...

Cc Tony Lindgren <[email protected]>
Cc Kevin Hilman <[email protected]>
Cc Paul Walmsley <[email protected]>

Changes from V1:
- Added Makefile rule to build sdrc.c file for new option SOC_HAS_OMAP2_SDRC (as per Kevin's comment).

---
   arch/arm/mach-omap2/Kconfig  |    8 ++++++++
   arch/arm/mach-omap2/Makefile |    3 ++-
   arch/arm/mach-omap2/common.c |    8 +-------
   arch/arm/mach-omap2/common.h |    5 +++++
   4 files changed, 16 insertions(+), 8 deletions(-)
arch/arm/mach-omap2/Kconfig +5 -0
index 208b950..82d9d18 100644
@@ -21,12 +21,16 @@ config ARCH_OMAP2PLUS_TYPICAL
   	help
   	  Compile a kernel suitable for booting most boards
 
+config SOC_HAS_OMAP2_SDRC
+	bool "OMAP2 SDRAM Controller support"
+
   config ARCH_OMAP2
   	bool "TI OMAP2"
   	depends on ARCH_OMAP2PLUS
   	default y
   	select CPU_V6
   	select MULTI_IRQ_HANDLER
+	select SOC_HAS_OMAP2_SDRC
 
   config ARCH_OMAP3
   	bool "TI OMAP3"
@@ -39,6 +43,7 @@ config ARCH_OMAP3
   	select PM_OPP if PM
   	select ARM_CPU_SUSPEND if PM
   	select MULTI_IRQ_HANDLER
+	select SOC_HAS_OMAP2_SDRC
 
Quoted 10 lines

arch/arm/mach-omap2/Kconfig config SOC_OMAP2420 · line 74

Quoted 7 lines
arch/arm/mach-omap2/Kconfig +1 -0
   config ARCH_OMAP4
   	bool "TI OMAP4"
@@ -66,16 +71,19 @@ config SOC_OMAP2420
   	depends on ARCH_OMAP2
   	default y
   	select OMAP_DM_TIMER
+	select SOC_HAS_OMAP2_SDRC

OMAP4 does not have the SDRC but the EMIF like TI8XX.

Quoted 3 lines

Benoit,

This selection is happening for SOC_OMAP2420 and not for OMAP4.

Hehe, indeed, I missed the context and was fooled by the config ARCH_OMAP4.

I don't have any comment then :-)

Benoit

maintainer
#11 lore raw

PATCH v3 3/3 ARM: OMAP2+: CLEANUP: Remove unnecessary ifdef around __omap2_set_globals

Quoted 6 lines · Benoit Cousson
Quoted 5 lines · Vaibhav
Quoted 3 lines · Benoit

OMAP4 does not have the SDRC but the EMIF like TI8XX.

Quoted 7 lines
Quoted 3 lines

Benoit,

This selection is happening for SOC_OMAP2420 and not for OMAP4.

Hehe, indeed, I missed the context and was fooled by the config ARCH_OMAP4.

I don't have any comment then :-)

That's very close to Acked-by then?

Tony