m68knommu: make BOOTPARAM setup common
authorGreg Ungerer <gerg@snapgear.com>
Wed, 25 Jul 2007 12:07:20 +0000 (22:07 +1000)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Wed, 25 Jul 2007 18:05:01 +0000 (11:05 -0700)
Currently most of the m68knommu cpu/board setup files are handling
the setup of fixed boot parameters (via CONFIG_BOOTPARAM) themselves.
Move all this into the common setup code.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 files changed:
arch/m68knommu/kernel/setup.c
arch/m68knommu/platform/5206/config.c
arch/m68knommu/platform/5206e/config.c
arch/m68knommu/platform/520x/config.c
arch/m68knommu/platform/523x/config.c
arch/m68knommu/platform/5249/config.c
arch/m68knommu/platform/5272/config.c
arch/m68knommu/platform/527x/config.c
arch/m68knommu/platform/528x/config.c
arch/m68knommu/platform/5307/config.c
arch/m68knommu/platform/532x/config.c
arch/m68knommu/platform/5407/config.c
arch/m68knommu/platform/68VZ328/config.c

index 2203f694f26bb303ec057debe68bd3746891d4a3..a5ac0d40fbec4c83a309b37af115512ca462b93e 100644 (file)
@@ -132,6 +132,11 @@ void setup_arch(char **cmdline_p)
 
        config_BSP(&command_line[0], sizeof(command_line));
 
+#if defined(CONFIG_BOOTPARAM)
+       strncpy(&command_line[0], CONFIG_BOOTPARAM_STRING, sizeof(command_line));
+       command_line[sizeof(command_line) - 1] = 0;
+#endif
+
        printk(KERN_INFO "\x0F\r\n\nuClinux/" CPU "\n");
 
 #ifdef CONFIG_UCDIMM
index 3343830aad10f40ce267e522ce41a51d62727a18..d265ed4e5afccdee7a5c389917ac842db089d031 100644 (file)
@@ -98,14 +98,6 @@ int mcf_timerirqpending(int timer)
 void config_BSP(char *commandp, int size)
 {
        mcf_setimr(MCFSIM_IMR_MASKALL);
-
-#if defined(CONFIG_BOOTPARAM)
-       strncpy(commandp, CONFIG_BOOTPARAM_STRING, size);
-       commandp[size-1] = 0;
-#else
-       memset(commandp, 0, size);
-#endif
-
        mach_sched_init = coldfire_timer_init;
        mach_tick = coldfire_tick;
        mach_gettimeoffset = coldfire_timer_offset;
index 0f67320b4031aaea269cfc7e7004ed9ce6ef905c..7fa5e8254c313e83cbe6071b30609589f7f96674 100644 (file)
@@ -98,15 +98,10 @@ void config_BSP(char *commandp, int size)
 {
        mcf_setimr(MCFSIM_IMR_MASKALL);
 
-#if defined(CONFIG_BOOTPARAM)
-       strncpy(commandp, CONFIG_BOOTPARAM_STRING, size);
-       commandp[size-1] = 0;
-#elif defined(CONFIG_NETtel)
+#if defined(CONFIG_NETtel)
        /* Copy command line from FLASH to local buffer... */
        memcpy(commandp, (char *) 0xf0004000, size);
        commandp[size-1] = 0;
-#else
-       memset(commandp, 0, size);
 #endif /* CONFIG_NETtel */
 
        mach_sched_init = coldfire_timer_init;
index 58b2878deb61e8524de686639cd63ff5ef1fa018..85830f9882f3bfde4e7496fd7ba9701d000b3ab8 100644 (file)
@@ -48,13 +48,6 @@ void mcf_autovector(unsigned int vec)
 
 void config_BSP(char *commandp, int size)
 {
-#ifdef CONFIG_BOOTPARAM
-    strncpy(commandp, CONFIG_BOOTPARAM_STRING, size);
-    commandp[size-1] = 0;
-#else
-    memset(commandp, 0, size);
-#endif
-
     mach_sched_init = coldfire_pit_init;
     mach_tick = coldfire_pit_tick;
     mach_gettimeoffset = coldfire_pit_offset;
index 9b054e6caee20a22df0adb1b0d79baf7db10403d..c0157e1100356abc0b994bd35a9a8cbf60bf5407 100644 (file)
@@ -63,14 +63,6 @@ void mcf_autovector(unsigned int vec)
 void config_BSP(char *commandp, int size)
 {
        mcf_disableall();
-
-#ifdef CONFIG_BOOTPARAM
-       strncpy(commandp, CONFIG_BOOTPARAM_STRING, size);
-       commandp[size-1] = 0;
-#else
-       memset(commandp, 0, size);
-#endif
-
        mach_sched_init = coldfire_pit_init;
        mach_tick = coldfire_pit_tick;
        mach_gettimeoffset = coldfire_pit_offset;
index d6706079d64ab4ba1f08a1a64aee8902ec57ab5e..4cdeb719512df8c4e2f5c23f6ac6f8b0740471b3 100644 (file)
@@ -96,14 +96,6 @@ int mcf_timerirqpending(int timer)
 void config_BSP(char *commandp, int size)
 {
        mcf_setimr(MCFSIM_IMR_MASKALL);
-
-#if defined(CONFIG_BOOTPARAM)
-       strncpy(commandp, CONFIG_BOOTPARAM_STRING, size);
-       commandp[size-1] = 0;
-#else
-       memset(commandp, 0, size);
-#endif
-
        mach_sched_init = coldfire_timer_init;
        mach_tick = coldfire_tick;
        mach_gettimeoffset = coldfire_timer_offset;
index 6b437cc977763c6f19645b5114eafb58e47bd12d..609b10e4b9b9a049a842147438ba7251330ee6c0 100644 (file)
@@ -113,10 +113,7 @@ void config_BSP(char *commandp, int size)
 
        mcf_disableall();
 
-#if defined(CONFIG_BOOTPARAM)
-       strncpy(commandp, CONFIG_BOOTPARAM_STRING, size);
-       commandp[size-1] = 0;
-#elif defined(CONFIG_NETtel) || defined(CONFIG_SCALES)
+#if defined(CONFIG_NETtel) || defined(CONFIG_SCALES)
        /* Copy command line from FLASH to local buffer... */
        memcpy(commandp, (char *) 0xf0004000, size);
        commandp[size-1] = 0;
@@ -128,8 +125,6 @@ void config_BSP(char *commandp, int size)
        /* Copy command line from FLASH to local buffer... */
        memcpy(commandp, (char *) 0xf0010000, size);
        commandp[size-1] = 0;
-#else
-       memset(commandp, 0, size);
 #endif
 
        mcf_timervector = 69;
index 28e7d964eef14d85e374e609b303893a033bba9a..126dac06648200c0c38d496a367d51afa35ca2fd 100644 (file)
@@ -63,14 +63,6 @@ void mcf_autovector(unsigned int vec)
 void config_BSP(char *commandp, int size)
 {
        mcf_disableall();
-
-#ifdef CONFIG_BOOTPARAM
-       strncpy(commandp, CONFIG_BOOTPARAM_STRING, size);
-       commandp[size-1] = 0;
-#else
-       memset(commandp, 0, size);
-#endif
-
        mach_sched_init = coldfire_pit_init;
        mach_tick = coldfire_pit_tick;
        mach_gettimeoffset = coldfire_pit_offset;
index 805b4f74ff1948e04638255f7b072c3670f653ef..aab1ef0c1f7837f6dbd4fb99becded00c630af07 100644 (file)
@@ -63,14 +63,6 @@ void mcf_autovector(unsigned int vec)
 void config_BSP(char *commandp, int size)
 {
        mcf_disableall();
-
-#ifdef CONFIG_BOOTPARAM
-       strncpy(commandp, CONFIG_BOOTPARAM_STRING, size);
-       commandp[size-1] = 0;
-#else
-       memset(commandp, 0, size);
-#endif
-
        mach_sched_init = coldfire_pit_init;
        mach_tick = coldfire_pit_tick;
        mach_gettimeoffset = coldfire_pit_offset;
index e04b84deb57d0cfdf83a161c6cff8c7b1cd85c6c..1f10e941b87c993babacdb886610e5b3e63b200e 100644 (file)
@@ -111,10 +111,7 @@ void config_BSP(char *commandp, int size)
 {
        mcf_setimr(MCFSIM_IMR_MASKALL);
 
-#if defined(CONFIG_BOOTPARAM)
-       strncpy(commandp, CONFIG_BOOTPARAM_STRING, size);
-       commandp[size-1] = 0;
-#elif defined(CONFIG_NETtel) || defined(CONFIG_eLIA) || \
+#if defined(CONFIG_NETtel) || defined(CONFIG_eLIA) || \
       defined(CONFIG_DISKtel) || defined(CONFIG_SECUREEDGEMP3) || \
       defined(CONFIG_CLEOPATRA)
        /* Copy command line from FLASH to local buffer... */
@@ -124,8 +121,6 @@ void config_BSP(char *commandp, int size)
        mcf_timervector = 30;
        mcf_profilevector = 31;
        mcf_timerlevel = 6;
-#else
-       memset(commandp, 0, size);
 #endif
 
        mach_sched_init = coldfire_timer_init;
index 664c3a12b0c128a6f927c82fc2ab2731add26f8d..dc39c466e33f69c7309048a53e78e94f502a4730 100644 (file)
@@ -92,10 +92,7 @@ void config_BSP(char *commandp, int size)
 {
        mcf_setimr(MCFSIM_IMR_MASKALL);
 
-#if defined(CONFIG_BOOTPARAM)
-       strncpy(commandp, CONFIG_BOOTPARAM_STRING, size);
-       commandp[size-1] = 0;
-#else
+#if !defined(CONFIG_BOOTPARAM)
        /* Copy command line from FLASH to local buffer... */
        memcpy(commandp, (char *) 0x4000, 4);
        if(strncmp(commandp, "kcl ", 4) == 0){
index 036f62876241f82b4aa16c5adec42828845acf71..fde417fdd6504209b108703a5e1a40c6e534719e 100644 (file)
@@ -102,13 +102,6 @@ void config_BSP(char *commandp, int size)
 {
        mcf_setimr(MCFSIM_IMR_MASKALL);
 
-#if defined(CONFIG_BOOTPARAM)
-       strncpy(commandp, CONFIG_BOOTPARAM_STRING, size);
-       commandp[size-1] = 0;
-#else
-       memset(commandp, 0, size);
-#endif
-
 #if defined(CONFIG_CLEOPATRA)
        /* Different timer setup - to prevent device clash */
        mcf_timervector = 30;
index 8abe0f6e7235b8e9984adca29f5d90ada099dde8..79dced929c97aa4fa7e8363477d70a6798038a3a 100644 (file)
@@ -191,13 +191,6 @@ void config_BSP(char *command, int size)
 {
        printk(KERN_INFO "68VZ328 DragonBallVZ support (c) 2001 Lineo, Inc.\n");
 
-#if defined(CONFIG_BOOTPARAM)
-       strncpy(command, CONFIG_BOOTPARAM_STRING, size);
-       command[size-1] = 0;
-#else
-       memset(command, 0, size);
-#endif
-
        init_hardware(command, size);
 
        mach_sched_init = (void *) m68328_timer_init;