From patchwork Tue Oct 6 15:47:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Daniel Walker (danielwa)" X-Patchwork-Id: 526971 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id C7FAA140D96 for ; Wed, 7 Oct 2015 07:28:14 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=cisco.com header.i=@cisco.com header.b=W8PjY8En; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 9B8601A012E for ; Wed, 7 Oct 2015 07:28:14 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=cisco.com header.i=@cisco.com header.b=W8PjY8En; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org X-Greylist: delayed 714 seconds by postgrey-1.35 at bilbo; Wed, 07 Oct 2015 02:59:28 AEDT Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=cisco.com header.i=@cisco.com header.b=W8PjY8En; dkim-atps=neutral Received: from rcdn-iport-6.cisco.com (rcdn-iport-6.cisco.com [173.37.86.77]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 300501A0036 for ; Wed, 7 Oct 2015 02:59:27 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=3610; q=dns/txt; s=iport; t=1444147168; x=1445356768; h=from:to:cc:subject:date:message-id; bh=Hz8tElKTLUsPxxUrvT/Y4zxumzJokZ93+nKK7QBspv4=; b=W8PjY8EnRlrjrXWd9IkVTdc0YiuPHOHtFXvgj4zSjoW82GFbQOo2S9p9 aWLaN4WSc7woBCpMM8QSJ93bSdEf/A0Td6k8bNYyWUnP2VOxn7u3G6tTk 5vg+b/uEqcVEmygGzAgSUR5vHsynibp6oEaNjREyjKy8nBxc7BymhxCVa o=; X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0D9AQDV7BNW/4UNJK1egyeBQroChCIBDYFahhqBODgUAQEBAQEBAYEKhCd9gT4BEoguv1wBAQEBAQEBAwIBHwuGaIoLhDUFhziGRogGjReBV48whniDbx8BAUKCER2BdB4ziD8BAQE X-IronPort-AV: E=Sophos;i="5.17,644,1437436800"; d="scan'208";a="35031840" Received: from alln-core-11.cisco.com ([173.36.13.133]) by rcdn-iport-6.cisco.com with ESMTP; 06 Oct 2015 15:47:17 +0000 Received: from zorba.cisco.com ([10.21.172.159]) by alln-core-11.cisco.com (8.14.5/8.14.5) with ESMTP id t96FlEKc028914; Tue, 6 Oct 2015 15:47:17 GMT From: Daniel Walker To: xe-kernel@external.cisco.com, Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Subject: [PATCH-RFC 3/7] powerpc: convert to generic builtin command line Date: Tue, 6 Oct 2015 08:47:10 -0700 Message-Id: <1444146434-12776-3-git-send-email-danielwa@cisco.com> X-Mailer: git-send-email 2.1.4 X-Auto-Response-Suppress: DR, OOF, AutoReply X-Mailman-Approved-At: Wed, 07 Oct 2015 07:26:56 +1100 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Walker , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" This updates the powerpc code to use the CONFIG_GENERIC_CMDLINE option. Cc: xe-kernel@external.cisco.com Cc: Daniel Walker Signed-off-by: Daniel Walker --- arch/powerpc/Kconfig | 23 +---------------------- arch/powerpc/kernel/prom.c | 4 ++++ arch/powerpc/kernel/prom_init.c | 8 ++++---- 3 files changed, 9 insertions(+), 26 deletions(-) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 9a7057e..26252dc 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -160,6 +160,7 @@ config PPC select EDAC_ATOMIC_SCRUB select ARCH_HAS_DMA_SET_COHERENT_MASK select HAVE_ARCH_SECCOMP_FILTER + select GENERIC_CMDLINE config GENERIC_CSUM def_bool CPU_LITTLE_ENDIAN @@ -640,28 +641,6 @@ config PPC_DENORMALISATION Add support for handling denormalisation of single precision values. Useful for bare metal only. If unsure say Y here. -config CMDLINE_BOOL - bool "Default bootloader kernel arguments" - -config CMDLINE - string "Initial kernel command string" - depends on CMDLINE_BOOL - default "console=ttyS0,9600 console=tty0 root=/dev/sda2" - help - On some platforms, there is currently no way for the boot loader to - pass arguments to the kernel. For these platforms, you can supply - some command-line options at build time by entering them here. In - most cases you will need to specify the root device here. - -config CMDLINE_FORCE - bool "Always use the default kernel command string" - depends on CMDLINE_BOOL - help - Always use the default kernel command string, even if the boot - loader passes other arguments to the kernel. - This is useful if you cannot or don't want to change the - command-line options your boot loader passes to the kernel. - config EXTRA_TARGETS string "Additional default image types" help diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index bef76c5..3281d5a 100644 --- a/arch/powerpc/kernel/prom.c +++ b/arch/powerpc/kernel/prom.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include @@ -670,6 +671,9 @@ void __init early_init_devtree(void *params) */ of_scan_flat_dt(early_init_dt_scan_chosen_ppc, boot_command_line); + /* append and prepend any arguments built into the kernel. */ + cmdline_add_builtin(boot_command_line, NULL, COMMAND_LINE_SIZE); + /* Scan memory nodes and rebuild MEMBLOCKs */ of_scan_flat_dt(early_init_dt_scan_root, NULL); of_scan_flat_dt(early_init_dt_scan_memory_ppc, NULL); diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c index 15099c4..2dd2608 100644 --- a/arch/powerpc/kernel/prom_init.c +++ b/arch/powerpc/kernel/prom_init.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -595,11 +596,10 @@ static void __init early_cmdline_parse(void) p = prom_cmd_line; if ((long)prom.chosen > 0) l = prom_getprop(prom.chosen, "bootargs", p, COMMAND_LINE_SIZE-1); -#ifdef CONFIG_CMDLINE + if (l <= 0 || p[0] == '\0') /* dbl check */ - strlcpy(prom_cmd_line, - CONFIG_CMDLINE, sizeof(prom_cmd_line)); -#endif /* CONFIG_CMDLINE */ + cmdline_add_builtin(prom_cmd_line, NULL, sizeof(prom_cmd_line)); + prom_printf("command line: %s\n", prom_cmd_line); #ifdef CONFIG_PPC64