[U-Boot] [RFC PATCH] MIPS: incaip: move board specific code out of generic code

Daniel Schwierzeck daniel.schwierzeck at gmail.com
Tue Apr 8 00:14:53 CEST 2014


This is required to switch MIPS platform to generic board.

Cc: Wolfgang Denk <wd at denx.de>
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck at gmail.com>
---
Wolfgang, I would rather remove this board. It is obviously dead and no one ever
cared about it since you have added it. The code does not conform to current
coding style. Also it needs a lot of cleanup if we switch to driver model 
eventually.
---
 arch/mips/include/asm/inca-ip.h     | 3 +++
 arch/mips/include/asm/u-boot-mips.h | 2 --
 arch/mips/lib/board.c               | 3 ---
 board/incaip/incaip.c               | 7 +++++--
 include/common.h                    | 3 ---
 include/configs/incaip.h            | 2 +-
 6 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/arch/mips/include/asm/inca-ip.h b/arch/mips/include/asm/inca-ip.h
index 5f03e2a..dcaa3e7 100644
--- a/arch/mips/include/asm/inca-ip.h
+++ b/arch/mips/include/asm/inca-ip.h
@@ -2428,3 +2428,6 @@ If set and clear bit are written concurrently with 1, the associated bit is not
 #define INCA_IP_ICU_ICU_EICR_EII2 (value)               (((( 1 << 3) - 1) & (value)) << 8)
 #define INCA_IP_ICU_ICU_EICR_EII1 (value)               (((( 1 << 3) - 1) & (value)) << 4)
 #define INCA_IP_ICU_ICU_EICR_EII0 (value)               (((( 1 << 3) - 1) & (value)) << 0)
+
+unsigned int incaip_get_cpuclk(void);
+int incaip_set_cpuclk(void);
diff --git a/arch/mips/include/asm/u-boot-mips.h b/arch/mips/include/asm/u-boot-mips.h
index 9f3cce9..a5b2fc0 100644
--- a/arch/mips/include/asm/u-boot-mips.h
+++ b/arch/mips/include/asm/u-boot-mips.h
@@ -21,5 +21,3 @@ static inline unsigned long image_copy_end(void)
 	extern char __image_copy_end[];
 	return (unsigned long) &__image_copy_end;
 }
-
-extern int incaip_set_cpuclk(void);
diff --git a/arch/mips/lib/board.c b/arch/mips/lib/board.c
index 317c825..3200d87 100644
--- a/arch/mips/lib/board.c
+++ b/arch/mips/lib/board.c
@@ -103,9 +103,6 @@ init_fnc_t *init_sequence[] = {
 	board_early_init_f,
 	timer_init,
 	env_init,		/* initialize environment */
-#ifdef CONFIG_INCA_IP
-	incaip_set_cpuclk,	/* set cpu clock according to env. variable */
-#endif
 	init_baudrate,		/* initialize baudrate settings */
 	serial_init,		/* serial communications setup */
 	console_init_f,
diff --git a/board/incaip/incaip.c b/board/incaip/incaip.c
index 217b8af..5abd2b8 100644
--- a/board/incaip/incaip.c
+++ b/board/incaip/incaip.c
@@ -13,8 +13,6 @@
 #include <asm/io.h>
 #include <asm/reboot.h>
 
-extern uint incaip_get_cpuclk(void);
-
 void _machine_restart(void)
 {
 	*INCA_IP_WDT_RST_REQ = 0x3f;
@@ -74,6 +72,11 @@ phys_size_t initdram(int board_type)
 	return max_size;
 }
 
+int board_early_init_f(void)
+{
+	return incaip_set_cpuclk();
+}
+
 int checkboard (void)
 {
 	unsigned long chipid = *INCA_IP_WDT_CHIPID;
diff --git a/include/common.h b/include/common.h
index cbd3c9e..f77273e 100644
--- a/include/common.h
+++ b/include/common.h
@@ -692,9 +692,6 @@ ulong	get_UCLK (void);
 #if defined(CONFIG_LH7A40X)
 ulong	get_PLLCLK (void);
 #endif
-#if defined CONFIG_INCA_IP
-uint	incaip_get_cpuclk (void);
-#endif
 #if defined(CONFIG_IMX)
 ulong get_systemPLLCLK(void);
 ulong get_FCLK(void);
diff --git a/include/configs/incaip.h b/include/configs/incaip.h
index e11d184..2c4893d 100644
--- a/include/configs/incaip.h
+++ b/include/configs/incaip.h
@@ -103,7 +103,7 @@
 
 #define CONFIG_SYS_BOOTPARAMS_LEN	128*1024
 
-#define CONFIG_SYS_MIPS_TIMER_FREQ	(incaip_get_cpuclk() / 2)
+#define CONFIG_SYS_MIPS_TIMER_FREQ	(CONFIG_CPU_CLOCK_RATE / 2)
 
 #define CONFIG_SYS_SDRAM_BASE		0x80000000
 
-- 
1.8.3.2



More information about the U-Boot mailing list