@@ -16,6 +16,7 @@ config SUPERH
select CPU_NO_EFFICIENT_FFS
select DMA_DECLARE_COHERENT
select GENERIC_ATOMIC64
+ select GENERIC_CMDLINE
select GENERIC_CMOS_UPDATE if SH_SH03 || SH_DREAMCAST
select GENERIC_IDLE_POLL_SETUP
select GENERIC_IRQ_SHOW
@@ -742,35 +743,6 @@ config ROMIMAGE_MMCIF
first part of the romImage which in turn loads the rest the kernel
image to RAM using the MMCIF hardware block.
-choice
- prompt "Kernel command line"
- optional
- default CMDLINE_OVERWRITE
- help
- Setting this option allows the kernel command line arguments
- to be set.
-
-config CMDLINE_OVERWRITE
- bool "Overwrite bootloader kernel arguments"
- help
- Given string will overwrite any arguments passed in by
- a bootloader.
-
-config CMDLINE_EXTEND
- bool "Extend bootloader kernel arguments"
- help
- Given string will be concatenated with arguments passed in
- by a bootloader.
-
-endchoice
-
-config CMDLINE
- string "Kernel command line arguments string"
- depends on CMDLINE_OVERWRITE || CMDLINE_EXTEND
- default "console=ttySC1,115200"
-
-endmenu
-
menu "Bus options"
config SUPERHYWAY
@@ -15,7 +15,7 @@ CONFIG_SH_AP325RXA=y
CONFIG_HIGH_RES_TIMERS=y
CONFIG_SECCOMP=y
CONFIG_PREEMPT=y
-CONFIG_CMDLINE_OVERWRITE=y
+CONFIG_CMDLINE_FORCE=y
CONFIG_CMDLINE="console=tty1 console=ttySC5,38400 root=/dev/nfs ip=dhcp"
CONFIG_NET=y
CONFIG_PACKET=y
@@ -22,7 +22,7 @@ CONFIG_NR_DMA_CHANNELS_BOOL=y
CONFIG_NR_DMA_CHANNELS=9
CONFIG_SECCOMP=y
CONFIG_PREEMPT=y
-CONFIG_CMDLINE_OVERWRITE=y
+CONFIG_CMDLINE_FORCE=y
CONFIG_CMDLINE="console=ttySC1,115200 panic=3"
CONFIG_MAPLE=y
CONFIG_PCI=y
@@ -14,7 +14,7 @@ CONFIG_FLATMEM_MANUAL=y
CONFIG_SH_ECOVEC=y
# CONFIG_SH_TIMER_TMU is not set
CONFIG_KEXEC=y
-CONFIG_CMDLINE_OVERWRITE=y
+CONFIG_CMDLINE_FORCE=y
CONFIG_CMDLINE="console=ttySC0,115200"
# CONFIG_SUSPEND is not set
CONFIG_NET=y
@@ -16,7 +16,7 @@ CONFIG_SH_ECOVEC=y
CONFIG_HEARTBEAT=y
CONFIG_SECCOMP=y
CONFIG_PREEMPT=y
-CONFIG_CMDLINE_OVERWRITE=y
+CONFIG_CMDLINE_FORCE=y
CONFIG_CMDLINE="console=tty0, console=ttySC0,115200 root=/dev/nfs ip=dhcp mem=248M memchunk.vpu=8m memchunk.veu0=4m"
CONFIG_NET=y
CONFIG_PACKET=y
@@ -19,7 +19,7 @@ CONFIG_HIGH_RES_TIMERS=y
CONFIG_SH_DMA=y
CONFIG_SH_DMA_API=y
CONFIG_PREEMPT=y
-CONFIG_CMDLINE_OVERWRITE=y
+CONFIG_CMDLINE_FORCE=y
CONFIG_CMDLINE="mem=64M console=ttySC2,115200 root=/dev/nfs rw nfsroot=192.168.0.3:/scripts/filesys ip=192.168.0.4"
CONFIG_NET=y
CONFIG_PACKET=y
@@ -14,7 +14,7 @@ CONFIG_MEMORY_START=0x0c000000
CONFIG_SH_ESPT=y
CONFIG_SH_PCLK_FREQ=66666666
CONFIG_SECCOMP=y
-CONFIG_CMDLINE_OVERWRITE=y
+CONFIG_CMDLINE_FORCE=y
CONFIG_CMDLINE="console=ttySC0,115200 root=/dev/nfs ip=bootp"
CONFIG_NET=y
CONFIG_PACKET=y
@@ -10,7 +10,7 @@ CONFIG_CPU_BIG_ENDIAN=y
CONFIG_SH_DEVICE_TREE=y
CONFIG_SH_JCORE_SOC=y
CONFIG_HZ_100=y
-CONFIG_CMDLINE_OVERWRITE=y
+CONFIG_CMDLINE_FORCE=y
CONFIG_CMDLINE="console=ttyUL0 earlycon"
CONFIG_BINFMT_ELF_FDPIC=y
CONFIG_BINFMT_FLAT=y
@@ -15,7 +15,7 @@ CONFIG_SH_KFR2R09=y
# CONFIG_SH_TIMER_TMU is not set
CONFIG_HZ_100=y
CONFIG_KEXEC=y
-CONFIG_CMDLINE_OVERWRITE=y
+CONFIG_CMDLINE_FORCE=y
CONFIG_CMDLINE="console=ttySC1,115200 quiet"
# CONFIG_SUSPEND is not set
CONFIG_NET=y
@@ -19,7 +19,7 @@ CONFIG_NO_HZ=y
CONFIG_HZ_1000=y
CONFIG_KEXEC=y
CONFIG_PREEMPT=y
-CONFIG_CMDLINE_OVERWRITE=y
+CONFIG_CMDLINE_FORCE=y
CONFIG_CMDLINE="console=tty0 console=ttySC1,115200"
# CONFIG_SUSPEND is not set
CONFIG_CPU_IDLE=y
@@ -12,7 +12,7 @@ CONFIG_FLATMEM_MANUAL=y
CONFIG_SH_LBOX_RE2=y
CONFIG_SH_PCLK_FREQ=40000000
CONFIG_KEXEC=y
-CONFIG_CMDLINE_OVERWRITE=y
+CONFIG_CMDLINE_FORCE=y
CONFIG_CMDLINE="console=ttySC1,115200 root=/dev/sda1"
CONFIG_PCI=y
CONFIG_PCCARD=y
@@ -11,7 +11,7 @@ CONFIG_SH_DMA=y
CONFIG_SH_DMA_API=y
CONFIG_HEARTBEAT=y
CONFIG_PREEMPT=y
-CONFIG_CMDLINE_OVERWRITE=y
+CONFIG_CMDLINE_FORCE=y
CONFIG_CMDLINE="console=ttySC0,115200 root=/dev/hda1"
CONFIG_SUPERHYWAY=y
CONFIG_NET=y
@@ -15,7 +15,7 @@ CONFIG_NUMA=y
CONFIG_SH_MIGOR=y
# CONFIG_SH_TIMER_CMT is not set
CONFIG_SECCOMP=y
-CONFIG_CMDLINE_OVERWRITE=y
+CONFIG_CMDLINE_FORCE=y
CONFIG_CMDLINE="console=tty0 console=ttySC0,115200 earlyprintk=serial ip=on root=/dev/nfs ip=dhcp"
CONFIG_NET=y
CONFIG_PACKET=y
@@ -25,7 +25,7 @@ CONFIG_SH_DMA_API=y
CONFIG_HEARTBEAT=y
CONFIG_HZ_100=y
CONFIG_PREEMPT=y
-CONFIG_CMDLINE_OVERWRITE=y
+CONFIG_CMDLINE_FORCE=y
CONFIG_CMDLINE="console=ttySC1,115200 root=/dev/mtdblock2 rootfstype=jffs2 mem=63M mtdparts=physmap-flash.0:0x00100000(bootloader)ro,0x00500000(Kernel)ro,0x00A00000(Filesystem)"
CONFIG_NET=y
CONFIG_PACKET=y
@@ -20,7 +20,7 @@ CONFIG_SH_PCLK_FREQ=33333333
CONFIG_PUSH_SWITCH=y
CONFIG_KEXEC=y
CONFIG_PREEMPT=y
-CONFIG_CMDLINE_OVERWRITE=y
+CONFIG_CMDLINE_FORCE=y
CONFIG_CMDLINE="console=ttySC0,115200 root=/dev/sda1"
CONFIG_PCI=y
CONFIG_NET=y
@@ -26,7 +26,7 @@ CONFIG_HEARTBEAT=y
CONFIG_PUSH_SWITCH=y
CONFIG_KEXEC=y
CONFIG_PREEMPT=y
-CONFIG_CMDLINE_OVERWRITE=y
+CONFIG_CMDLINE_FORCE=y
CONFIG_CMDLINE="console=ttySC0,115200 root=/dev/sda1"
CONFIG_PCI=y
CONFIG_BINFMT_MISC=m
@@ -21,7 +21,7 @@ CONFIG_CPU_BIG_ENDIAN=y
CONFIG_SH_RSK=y
CONFIG_SH_PCLK_FREQ=40000000
CONFIG_HZ_1000=y
-CONFIG_CMDLINE_OVERWRITE=y
+CONFIG_CMDLINE_FORCE=y
CONFIG_CMDLINE="console=ttySC0,115200 earlyprintk=serial ignore_loglevel"
CONFIG_BINFMT_FLAT=y
CONFIG_BINFMT_ZFLAT=y
@@ -26,7 +26,7 @@ CONFIG_CPU_FREQ=y
CONFIG_SH_CPU_FREQ=y
CONFIG_HEARTBEAT=y
CONFIG_HZ_1000=y
-CONFIG_CMDLINE_OVERWRITE=y
+CONFIG_CMDLINE_FORCE=y
CONFIG_CMDLINE="console=ttySC0,115200 earlyprintk=serial ignore_loglevel"
CONFIG_BINFMT_FLAT=y
CONFIG_BINFMT_ZFLAT=y
@@ -11,7 +11,7 @@ CONFIG_FLATMEM_MANUAL=y
CONFIG_SH_RTS7751R2D=y
CONFIG_RTS7751R2D_1=y
CONFIG_HEARTBEAT=y
-CONFIG_CMDLINE_OVERWRITE=y
+CONFIG_CMDLINE_FORCE=y
CONFIG_CMDLINE="console=tty0 console=ttySC1,115200 root=/dev/sda1"
CONFIG_PCI=y
CONFIG_HOTPLUG_PCI=y
@@ -11,7 +11,7 @@ CONFIG_FLATMEM_MANUAL=y
CONFIG_SH_RTS7751R2D=y
CONFIG_RTS7751R2D_PLUS=y
CONFIG_HEARTBEAT=y
-CONFIG_CMDLINE_OVERWRITE=y
+CONFIG_CMDLINE_FORCE=y
CONFIG_CMDLINE="console=tty0 console=ttySC1,115200 root=/dev/sda1"
CONFIG_PCI=y
CONFIG_HOTPLUG_PCI=y
@@ -22,7 +22,7 @@ CONFIG_SH_DMA=y
CONFIG_SH_DMA_API=y
CONFIG_HEARTBEAT=y
CONFIG_PREEMPT=y
-CONFIG_CMDLINE_OVERWRITE=y
+CONFIG_CMDLINE_FORCE=y
CONFIG_CMDLINE="mem=128M console=tty0 console=ttySC0,115200 ip=bootp root=/dev/nfs nfsroot=192.168.0.1:/home/rootfs"
CONFIG_PCI=y
CONFIG_PCI_DEBUG=y
@@ -70,7 +70,7 @@ CONFIG_HOTPLUG_CPU=y
CONFIG_PREEMPT=y
CONFIG_INTC_USERIMASK=y
CONFIG_INTC_BALANCING=y
-CONFIG_CMDLINE_OVERWRITE=y
+CONFIG_CMDLINE_FORCE=y
CONFIG_CMDLINE="console=ttySC1,115200 earlyprintk=sh-sci.1,115200 root=/dev/sda1 nmi_debug=state,debounce rootdelay=5 pmb=iomap ignore_loglevel"
CONFIG_PCI=y
CONFIG_PCIEPORTBUS=y
@@ -36,7 +36,7 @@ CONFIG_SH_CPU_FREQ=y
CONFIG_HEARTBEAT=y
CONFIG_HZ_1000=y
CONFIG_PREEMPT=y
-CONFIG_CMDLINE_OVERWRITE=y
+CONFIG_CMDLINE_FORCE=y
CONFIG_CMDLINE="console=ttySC3,115200 ignore_loglevel earlyprintk=serial"
CONFIG_BINFMT_FLAT=y
CONFIG_BINFMT_ZFLAT=y
@@ -17,7 +17,7 @@ CONFIG_FLATMEM_MANUAL=y
CONFIG_SH_7343_SOLUTION_ENGINE=y
# CONFIG_SH_TIMER_CMT is not set
CONFIG_HEARTBEAT=y
-CONFIG_CMDLINE_OVERWRITE=y
+CONFIG_CMDLINE_FORCE=y
CONFIG_CMDLINE="console=ttySC0,115200"
CONFIG_NET=y
CONFIG_PACKET=y
@@ -22,7 +22,7 @@ CONFIG_SH_SOLUTION_ENGINE=y
CONFIG_SH_PCLK_FREQ=66666666
CONFIG_HEARTBEAT=y
CONFIG_PREEMPT_VOLUNTARY=y
-CONFIG_CMDLINE_OVERWRITE=y
+CONFIG_CMDLINE_FORCE=y
CONFIG_CMDLINE="console=ttySC0,115200 root=/dev/sda1"
CONFIG_NET=y
CONFIG_PACKET=y
@@ -22,7 +22,7 @@ CONFIG_SH_7721_SOLUTION_ENGINE=y
CONFIG_SH_PCLK_FREQ=33333333
CONFIG_HEARTBEAT=y
CONFIG_PREEMPT_VOLUNTARY=y
-CONFIG_CMDLINE_OVERWRITE=y
+CONFIG_CMDLINE_FORCE=y
CONFIG_CMDLINE="console=ttySC0,115200 root=/dev/sda2"
CONFIG_NET=y
CONFIG_PACKET=y
@@ -17,7 +17,7 @@ CONFIG_SH_DMA_API=y
CONFIG_HEARTBEAT=y
CONFIG_SECCOMP=y
CONFIG_PREEMPT=y
-CONFIG_CMDLINE_OVERWRITE=y
+CONFIG_CMDLINE_FORCE=y
CONFIG_CMDLINE="console=tty1 console=ttySC3,115200 root=/dev/nfs ip=dhcp memchunk.vpu=4m"
CONFIG_NET=y
CONFIG_PACKET=y
@@ -12,7 +12,7 @@ CONFIG_MEMORY_START=0x0c000000
CONFIG_FLATMEM_MANUAL=y
CONFIG_SH_7751_SOLUTION_ENGINE=y
CONFIG_HEARTBEAT=y
-CONFIG_CMDLINE_OVERWRITE=y
+CONFIG_CMDLINE_FORCE=y
CONFIG_CMDLINE="console=ttySC1,38400"
CONFIG_NET=y
CONFIG_PACKET=y
@@ -14,7 +14,7 @@ CONFIG_MEMORY_SIZE=0x08000000
CONFIG_SH_7780_SOLUTION_ENGINE=y
CONFIG_SH_PCLK_FREQ=33333333
CONFIG_HEARTBEAT=y
-CONFIG_CMDLINE_OVERWRITE=y
+CONFIG_CMDLINE_FORCE=y
CONFIG_CMDLINE="console=ttySC0,115200 root=/dev/sda1"
CONFIG_PCI=y
CONFIG_NET=y
@@ -16,7 +16,7 @@ CONFIG_FLATMEM_MANUAL=y
CONFIG_SH_SH03=y
CONFIG_HEARTBEAT=y
CONFIG_PREEMPT=y
-CONFIG_CMDLINE_OVERWRITE=y
+CONFIG_CMDLINE_FORCE=y
CONFIG_CMDLINE="console=ttySC1,115200 mem=64M root=/dev/nfs"
CONFIG_PCI=y
CONFIG_HOTPLUG_PCI=y
@@ -20,7 +20,7 @@ CONFIG_SH_DMA=y
CONFIG_SH_DMA_API=y
CONFIG_NR_DMA_CHANNELS_BOOL=y
CONFIG_HZ_100=y
-CONFIG_CMDLINE_OVERWRITE=y
+CONFIG_CMDLINE_FORCE=y
CONFIG_CMDLINE="console=ttySC1,115200 ip=dhcp root=/dev/nfs rw nfsroot=/nfs/rootfs,rsize=1024,wsize=1024 earlyprintk=sh-sci.1"
CONFIG_PCCARD=y
CONFIG_BINFMT_MISC=y
@@ -21,7 +21,7 @@ CONFIG_FLATMEM_MANUAL=y
CONFIG_SH_SH7757LCR=y
CONFIG_HEARTBEAT=y
CONFIG_SECCOMP=y
-CONFIG_CMDLINE_OVERWRITE=y
+CONFIG_CMDLINE_FORCE=y
CONFIG_CMDLINE="console=ttySC2,115200 root=/dev/nfs ip=dhcp"
CONFIG_NET=y
CONFIG_PACKET=y
@@ -14,7 +14,7 @@ CONFIG_MEMORY_START=0x0c000000
CONFIG_SH_SH7763RDP=y
CONFIG_SH_PCLK_FREQ=66666666
CONFIG_SECCOMP=y
-CONFIG_CMDLINE_OVERWRITE=y
+CONFIG_CMDLINE_FORCE=y
CONFIG_CMDLINE="console=ttySC2,115200 root=/dev/sda1 rootdelay=10"
CONFIG_NET=y
CONFIG_PACKET=y
@@ -18,7 +18,7 @@ CONFIG_FLATMEM_MANUAL=y
# CONFIG_SH_ADC is not set
CONFIG_SH_SHMIN=y
CONFIG_SH_PCLK_FREQ=32000000
-CONFIG_CMDLINE_OVERWRITE=y
+CONFIG_CMDLINE_FORCE=y
CONFIG_CMDLINE="console=ttySC1,115200 root=1f01 mtdparts=phys_mapped_flash:64k(firm)ro,-(sys) netdev=34,0x300,eth0 "
CONFIG_NET=y
CONFIG_UNIX=y
@@ -47,7 +47,7 @@ CONFIG_KEXEC=y
CONFIG_SECCOMP=y
CONFIG_SMP=y
CONFIG_PREEMPT=y
-CONFIG_CMDLINE_OVERWRITE=y
+CONFIG_CMDLINE_FORCE=y
CONFIG_CMDLINE="console=ttySC0,115200 earlyprintk=bios ignore_loglevel"
CONFIG_BINFMT_MISC=y
CONFIG_NET=y
@@ -20,7 +20,7 @@ CONFIG_SH_PCLK_FREQ=30000000
CONFIG_SH_DMA=y
CONFIG_SH_DMA_API=y
CONFIG_PREEMPT_VOLUNTARY=y
-CONFIG_CMDLINE_OVERWRITE=y
+CONFIG_CMDLINE_FORCE=y
CONFIG_CMDLINE="console=ttySC1,38400N81 root=/dev/nfs ip=:::::eth1:autoconf rw"
CONFIG_PCI=y
CONFIG_HOTPLUG_PCI=y
@@ -18,7 +18,7 @@ CONFIG_HIGH_RES_TIMERS=y
CONFIG_HZ_100=y
CONFIG_KEXEC=y
CONFIG_PREEMPT=y
-CONFIG_CMDLINE_OVERWRITE=y
+CONFIG_CMDLINE_FORCE=y
CONFIG_CMDLINE="console=ttySC0,115200 root=/dev/nfs ip=dhcp"
CONFIG_NET=y
CONFIG_PACKET=y
@@ -32,6 +32,7 @@
#include <linux/of.h>
#include <linux/of_fdt.h>
#include <linux/uaccess.h>
+#include <linux/cmdline.h>
#include <uapi/linux/mount.h>
#include <asm/io.h>
#include <asm/page.h>
@@ -306,15 +307,7 @@ void __init setup_arch(char **cmdline_p)
bss_resource.start = virt_to_phys(__bss_start);
bss_resource.end = virt_to_phys(__bss_stop)-1;
-#ifdef CONFIG_CMDLINE_OVERWRITE
- strlcpy(command_line, CONFIG_CMDLINE, sizeof(command_line));
-#else
- strlcpy(command_line, COMMAND_LINE, sizeof(command_line));
-#ifdef CONFIG_CMDLINE_EXTEND
- strlcat(command_line, " ", sizeof(command_line));
- strlcat(command_line, CONFIG_CMDLINE, sizeof(command_line));
-#endif
-#endif
+ cmdline_build(command_line, COMMAND_LINE, sizeof(command_line));
/* Save unparsed command line copy for /proc/cmdline */
memcpy(boot_command_line, command_line, COMMAND_LINE_SIZE);
This converts the architecture to GENERIC_CMDLINE. Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> --- arch/sh/Kconfig | 30 +-------------------- arch/sh/configs/ap325rxa_defconfig | 2 +- arch/sh/configs/dreamcast_defconfig | 2 +- arch/sh/configs/ecovec24-romimage_defconfig | 2 +- arch/sh/configs/ecovec24_defconfig | 2 +- arch/sh/configs/edosk7760_defconfig | 2 +- arch/sh/configs/espt_defconfig | 2 +- arch/sh/configs/j2_defconfig | 2 +- arch/sh/configs/kfr2r09-romimage_defconfig | 2 +- arch/sh/configs/kfr2r09_defconfig | 2 +- arch/sh/configs/lboxre2_defconfig | 2 +- arch/sh/configs/microdev_defconfig | 2 +- arch/sh/configs/migor_defconfig | 2 +- arch/sh/configs/polaris_defconfig | 2 +- arch/sh/configs/r7780mp_defconfig | 2 +- arch/sh/configs/r7785rp_defconfig | 2 +- arch/sh/configs/rsk7201_defconfig | 2 +- arch/sh/configs/rsk7203_defconfig | 2 +- arch/sh/configs/rts7751r2d1_defconfig | 2 +- arch/sh/configs/rts7751r2dplus_defconfig | 2 +- arch/sh/configs/sdk7780_defconfig | 2 +- arch/sh/configs/sdk7786_defconfig | 2 +- arch/sh/configs/se7206_defconfig | 2 +- arch/sh/configs/se7343_defconfig | 2 +- arch/sh/configs/se7712_defconfig | 2 +- arch/sh/configs/se7721_defconfig | 2 +- arch/sh/configs/se7724_defconfig | 2 +- arch/sh/configs/se7751_defconfig | 2 +- arch/sh/configs/se7780_defconfig | 2 +- arch/sh/configs/sh03_defconfig | 2 +- arch/sh/configs/sh2007_defconfig | 2 +- arch/sh/configs/sh7757lcr_defconfig | 2 +- arch/sh/configs/sh7763rdp_defconfig | 2 +- arch/sh/configs/shmin_defconfig | 2 +- arch/sh/configs/shx3_defconfig | 2 +- arch/sh/configs/titan_defconfig | 2 +- arch/sh/configs/ul2_defconfig | 2 +- arch/sh/kernel/setup.c | 11 ++------ 38 files changed, 39 insertions(+), 74 deletions(-)