From ce170beeb74ef44e60f6be0204782be564910760 Mon Sep 17 00:00:00 2001 From: Sricharan Date: Tue, 15 Nov 2011 09:49:50 -0500 Subject: [PATCH] omap4: make omap4 code common for future reuse 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 Signed-off-by: Sandeep Paulraj --- arch/arm/cpu/armv7/omap-common/Makefile | 13 +++++++++++++ .../{omap4/clocks.c => omap-common/clocks-common.c} | 0 .../{omap4/emif.c => omap-common/emif-common.c} | 4 ++-- .../{omap4/board.c => omap-common/hwinit-common.c} | 2 +- .../armv7/{omap4 => omap-common}/lowlevel_init.S | 0 .../armv7/{omap4/mem.c => omap-common/mem-common.c} | 0 arch/arm/cpu/armv7/omap4/Makefile | 6 ------ 7 files changed, 16 insertions(+), 9 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} (99%) 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%) diff --git a/arch/arm/cpu/armv7/omap-common/Makefile b/arch/arm/cpu/armv7/omap-common/Makefile index 1dee81f22a..ea2545dca8 100644 --- a/arch/arm/cpu/armv7/omap-common/Makefile +++ b/arch/arm/cpu/armv7/omap-common/Makefile @@ -33,6 +33,13 @@ ifdef CONFIG_OMAP COBJS += gpio.o endif +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 @@ -43,6 +50,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 99% rename from arch/arm/cpu/armv7/omap4/emif.c rename to arch/arm/cpu/armv7/omap-common/emif-common.c index 988b2050fa..94c8bed24e 100644 --- a/arch/arm/cpu/armv7/omap4/emif.c +++ b/arch/arm/cpu/armv7/omap-common/emif-common.c @@ -1218,9 +1218,9 @@ void sdram_init(void) in_sdram = running_from_sdram(); debug("in_sdram = %d\n", in_sdram); - if (!in_sdram) { + if (!in_sdram) bypass_dpll(&prcm->cm_clkmode_dpll_core); - } + do_sdram_init(OMAP44XX_EMIF1); do_sdram_init(OMAP44XX_EMIF2); 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 2497e3e729..8e765cfe7f 100644 --- a/arch/arm/cpu/armv7/omap4/board.c +++ b/arch/arm/cpu/armv7/omap-common/hwinit-common.c @@ -34,7 +34,7 @@ #include #include #include -#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 e7ee0b8c0a..d91272958f 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 -- 2.34.1