Patchwork [U-Boot,1/7] omap4: make omap4 code common for future reuse

login
register
mail settings
Submitter SRICHARAN R
Date Oct. 19, 2011, 12:47 p.m.
Message ID <1319028444-11748-2-git-send-email-r.sricharan@ti.com>
Download mbox | patch
Permalink /patch/120615/
State Superseded
Headers show

Comments

SRICHARAN R - Oct. 19, 2011, 12:47 p.m.
Much of omap4 soc support code can be reused for omap5.
Move them to the omap-common directory to facilitate
this.

Signed-off-by: sricharan <r.sricharan@ti.com>
---
 arch/arm/cpu/armv7/omap-common/Makefile            |   13 +++++++++++++
 .../clocks.c => omap-common/clocks-common.c}       |    0
 .../{omap4/emif.c => omap-common/emif-common.c}    |    0
 .../{omap4/board.c => omap-common/hwinit-common.c} |    2 +-
 .../armv7/{omap4 => omap-common}/lowlevel_init.S   |    0
 .../{omap4/mem.c => omap-common/mem-common.c}      |    0
 arch/arm/cpu/armv7/omap4/Makefile                  |    6 ------
 7 files changed, 14 insertions(+), 7 deletions(-)
 rename arch/arm/cpu/armv7/{omap4/clocks.c => omap-common/clocks-common.c} (100%)
 rename arch/arm/cpu/armv7/{omap4/emif.c => omap-common/emif-common.c} (100%)
 rename arch/arm/cpu/armv7/{omap4/board.c => omap-common/hwinit-common.c} (99%)
 rename arch/arm/cpu/armv7/{omap4 => omap-common}/lowlevel_init.S (100%)
 rename arch/arm/cpu/armv7/{omap4/mem.c => omap-common/mem-common.c} (100%)
Tom Rini - Oct. 19, 2011, 4:41 p.m.
On Wed, Oct 19, 2011 at 5:47 AM, sricharan <r.sricharan@ti.com> wrote:
> Much of omap4 soc support code can be reused for omap5.
> Move them to the omap-common directory to facilitate
> this.
>
> Signed-off-by: sricharan <r.sricharan@ti.com>

Yay for re-use, but shouldn't we just call it omap-common/emif.c, etc?
omap-common/emif-common.c seems redundant.
SRICHARAN R - Oct. 21, 2011, 1:01 p.m.
Hi Rini,

On Wed, Oct 19, 2011 at 10:11 PM, Tom Rini <tom.rini@gmail.com> wrote:
> On Wed, Oct 19, 2011 at 5:47 AM, sricharan <r.sricharan@ti.com> wrote:
>> Much of omap4 soc support code can be reused for omap5.
>> Move them to the omap-common directory to facilitate
>> this.
>>
>> Signed-off-by: sricharan <r.sricharan@ti.com>
>
> Yay for re-use, but shouldn't we just call it omap-common/emif.c, etc?
> omap-common/emif-common.c seems redundant.
>
Ya, first thought like that. But there is one more emif.c in SOC
specific directories.
> --
> Tom
>

Patch

diff --git a/arch/arm/cpu/armv7/omap-common/Makefile b/arch/arm/cpu/armv7/omap-common/Makefile
index 0b96b47..05f4fb3 100644
--- a/arch/arm/cpu/armv7/omap-common/Makefile
+++ b/arch/arm/cpu/armv7/omap-common/Makefile
@@ -31,6 +31,13 @@  COBJS	:= timer.o
 COBJS	+= utils.o
 COBJS	+= gpio.o
 
+ifdef CONFIG_OMAP44XX
+COBJS	+= hwinit-common.o
+COBJS	+= clocks-common.o
+COBJS	+= emif-common.o
+SOBJS	+= lowlevel_init.o
+endif
+
 ifdef CONFIG_SPL_BUILD
 COBJS	+= spl.o
 ifdef CONFIG_SPL_NAND_SUPPORT
@@ -41,6 +48,12 @@  COBJS	+= spl_mmc.o
 endif
 endif
 
+ifndef CONFIG_SPL_BUILD
+ifdef CONFIG_OMAP44XX
+COBJS	+= mem-common.o
+endif
+endif
+
 SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
 
diff --git a/arch/arm/cpu/armv7/omap4/clocks.c b/arch/arm/cpu/armv7/omap-common/clocks-common.c
similarity index 100%
rename from arch/arm/cpu/armv7/omap4/clocks.c
rename to arch/arm/cpu/armv7/omap-common/clocks-common.c
diff --git a/arch/arm/cpu/armv7/omap4/emif.c b/arch/arm/cpu/armv7/omap-common/emif-common.c
similarity index 100%
rename from arch/arm/cpu/armv7/omap4/emif.c
rename to arch/arm/cpu/armv7/omap-common/emif-common.c
diff --git a/arch/arm/cpu/armv7/omap4/board.c b/arch/arm/cpu/armv7/omap-common/hwinit-common.c
similarity index 99%
rename from arch/arm/cpu/armv7/omap4/board.c
rename to arch/arm/cpu/armv7/omap-common/hwinit-common.c
index 8584fdd..e4b4f5d 100644
--- a/arch/arm/cpu/armv7/omap4/board.c
+++ b/arch/arm/cpu/armv7/omap-common/hwinit-common.c
@@ -34,7 +34,7 @@ 
 #include <asm/sizes.h>
 #include <asm/arch/emif.h>
 #include <asm/arch/gpio.h>
-#include "omap4_mux_data.h"
+#include "../omap4/omap4_mux_data.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
diff --git a/arch/arm/cpu/armv7/omap4/lowlevel_init.S b/arch/arm/cpu/armv7/omap-common/lowlevel_init.S
similarity index 100%
rename from arch/arm/cpu/armv7/omap4/lowlevel_init.S
rename to arch/arm/cpu/armv7/omap-common/lowlevel_init.S
diff --git a/arch/arm/cpu/armv7/omap4/mem.c b/arch/arm/cpu/armv7/omap-common/mem-common.c
similarity index 100%
rename from arch/arm/cpu/armv7/omap4/mem.c
rename to arch/arm/cpu/armv7/omap-common/mem-common.c
diff --git a/arch/arm/cpu/armv7/omap4/Makefile b/arch/arm/cpu/armv7/omap4/Makefile
index e7ee0b8..d912729 100644
--- a/arch/arm/cpu/armv7/omap4/Makefile
+++ b/arch/arm/cpu/armv7/omap4/Makefile
@@ -25,15 +25,9 @@  include $(TOPDIR)/config.mk
 
 LIB	=  $(obj)lib$(SOC).o
 
-SOBJS	+= lowlevel_init.o
-
-COBJS	+= board.o
-COBJS	+= clocks.o
-COBJS	+= emif.o
 COBJS	+= sdram_elpida.o
 
 ifndef CONFIG_SPL_BUILD
-COBJS	+= mem.o
 COBJS	+= sys_info.o
 endif