diff mbox

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

Message ID 1396908893-12011-1-git-send-email-daniel.schwierzeck@gmail.com
State RFC
Delegated to: Daniel Schwierzeck
Headers show

Commit Message

Daniel Schwierzeck April 7, 2014, 10:14 p.m. UTC
This is required to switch MIPS platform to generic board.

Cc: Wolfgang Denk <wd@denx.de>
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@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(-)

Comments

Wolfgang Denk April 8, 2014, 7:39 p.m. UTC | #1
Dear Daniel,

In message <1396908893-12011-1-git-send-email-daniel.schwierzeck@gmail.com> you wrote:
> This is required to switch MIPS platform to generic board.
> 
> Cc: Wolfgang Denk <wd@denx.de>
> Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@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.

I agree that it nakes no sense to put endless efforts on this ancient
piece of dead hardware.  I'll be happy if you can provide a removal
patch.  Alternatively, I can do one, but it will take a while until I
find time to do so.

Thanks.

Wolfgang Denk
Daniel Schwierzeck April 8, 2014, 7:56 p.m. UTC | #2
2014-04-08 21:39 GMT+02:00 Wolfgang Denk <wd@denx.de>:
> Dear Daniel,
>
> In message <1396908893-12011-1-git-send-email-daniel.schwierzeck@gmail.com> you wrote:
>> This is required to switch MIPS platform to generic board.
>>
>> Cc: Wolfgang Denk <wd@denx.de>
>> Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@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.
>
> I agree that it nakes no sense to put endless efforts on this ancient
> piece of dead hardware.  I'll be happy if you can provide a removal
> patch.  Alternatively, I can do one, but it will take a while until I
> find time to do so.
>

ok I will prepare a patch during the next merge window, thanks.
Daniel Schwierzeck April 9, 2014, 10:57 p.m. UTC | #3
Dear Wolfgang,

2014-04-08 21:56 GMT+02:00 Daniel Schwierzeck <daniel.schwierzeck@gmail.com>:
> 2014-04-08 21:39 GMT+02:00 Wolfgang Denk <wd@denx.de>:
>> Dear Daniel,
>>
>> In message <1396908893-12011-1-git-send-email-daniel.schwierzeck@gmail.com> you wrote:
>>> This is required to switch MIPS platform to generic board.
>>>
>>> Cc: Wolfgang Denk <wd@denx.de>
>>> Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@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.
>>
>> I agree that it nakes no sense to put endless efforts on this ancient
>> piece of dead hardware.  I'll be happy if you can provide a removal
>> patch.  Alternatively, I can do one, but it will take a while until I
>> find time to do so.
>>
>
> ok I will prepare a patch during the next merge window, thanks.

Still one question. You respectively DENX generate and provide a DULG
for INCA-IP [1]. Does it serve as reference for the MIPS ELDK? When
yes may I suggest to replace it with Malta board? Malta is the only
platform which is concurrently supported in mainline kernel and U-Boot
and it is also supported by Qemu.

[1] http://www.denx.de/wiki/view/DULG/Manual?stickboard=incaip
Wolfgang Denk April 10, 2014, 6:07 a.m. UTC | #4
Dear Daniel,

In message <CACUy__WJBfHdHs2xjbyK24Fw1apdWwmSqM=1SheqJD0H2LQWdQ@mail.gmail.com> you wrote:
> 
> Still one question. You respectively DENX generate and provide a DULG
> for INCA-IP [1]. Does it serve as reference for the MIPS ELDK? When

NO, this is dead as well.

> yes may I suggest to replace it with Malta board? Malta is the only
> platform which is concurrently supported in mainline kernel and U-Boot
> and it is also supported by Qemu.

Yes, this is a good idea, I think.  However, there is currently no
maintained version of the DULG for MIPS.  Volunteers to add one are
welcome.

Best regards,

Wolfgang Denk
diff mbox

Patch

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