From patchwork Mon Nov 30 08:02:54 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Yoshii X-Patchwork-Id: 63626 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nAU8321A023602 for ; Mon, 30 Nov 2009 08:03:02 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752230AbZK3ICz (ORCPT ); Mon, 30 Nov 2009 03:02:55 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752447AbZK3ICy (ORCPT ); Mon, 30 Nov 2009 03:02:54 -0500 Received: from mail-yx0-f188.google.com ([209.85.210.188]:47663 "EHLO mail-yx0-f188.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752230AbZK3ICy (ORCPT ); Mon, 30 Nov 2009 03:02:54 -0500 Received: by yxe26 with SMTP id 26so2821885yxe.4 for ; Mon, 30 Nov 2009 00:03:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:date:from:to:subject :message-id:x-mailer:mime-version:content-type :content-transfer-encoding; bh=wN3gyY8JdlK1+IZOB31ygPJtMPgkTYqWWL03Ztge2VQ=; b=LVywuiZm7w7mMcytkUO9f2dwg+eTR6nynrrmo0gGUarYQjNhj0YtnY5qUSeLDY6hcA kOARMknamlT1J967nJYsFEuL/lm6eSouLtFvbdHs6DPV0CA69uxlXSLCUwbkggdRf1SO Uk8htjoSn1jk0k7eNK03cddrw9KMod8+EAKp8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:subject:message-id:x-mailer:mime-version :content-type:content-transfer-encoding; b=OsEdo6dUzW3yQy+4xme8dLOCcO5OVHKMEKY5YQb6IQnElMf08BHj3WerAhRDXSRJqv oi14RfRNGDpN/rYLCjGTxYZ1RYiTMdGwCLsD6ogf5GB0lKqQEcH7FKgkwb0Uk/UbMpVc ErQ4t/NcER1K9u1tGtBnTMSuLfv+7NU4rmSUE= Received: by 10.150.246.36 with SMTP id t36mr6675219ybh.120.1259568179621; Mon, 30 Nov 2009 00:02:59 -0800 (PST) Received: from genny.localdomain (49.14.32.202.bf.2iij.net [202.32.14.49]) by mx.google.com with ESMTPS id 16sm1161754gxk.3.2009.11.30.00.02.56 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 30 Nov 2009 00:02:58 -0800 (PST) Date: Mon, 30 Nov 2009 17:02:54 +0900 From: yoshii.takashi@renesas.com To: linux-sh@vger.kernel.org Subject: [PATCH] sh: Add CONFIG_PARAM_* to set boot parameters. Message-Id: <20091130170254.65d2a0ab.yoshii.takashi@renesas.com> X-Mailer: Sylpheed 2.7.1 (GTK+ 2.16.6; x86_64-pc-linux-gnu) Mime-Version: 1.0 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index 0031a69..4800a6f 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig @@ -798,6 +798,41 @@ config CMDLINE depends on CMDLINE_OVERWRITE || CMDLINE_EXTEND default "console=ttySC1,115200" +config PARAM_BOOL + bool "Default kernel params" + help + Setting this option allows the boot parameters to be set. + +config PARAM_MOUNT_ROOT_RDONLY + int "MOUNT_ROOT_RDONLY" + depends on PARAM_BOOL + default 1 + +config PARAM_RAMDISK_FLAGS + hex "RAMDISK_FLAGS" + depends on PARAM_BOOL + default 0 + +config PARAM_ORIG_ROOT_DEV + hex "ORIG_ROOT_DEV" + depends on PARAM_BOOL + default 0x200 + +config PARAM_LOADER_TYPE + hex "LOADER_TYPE" + depends on PARAM_BOOL + default 1 + +config PARAM_INITRD_START + hex "INITRD_START" + depends on PARAM_BOOL + default 0 + +config PARAM_INITRD_SIZE + hex "INITRD_SIZE" + depends on PARAM_BOOL + default 0 + endmenu menu "Bus options" diff --git a/arch/sh/include/asm/setup.h b/arch/sh/include/asm/setup.h index ce37435..715cd6f 100644 --- a/arch/sh/include/asm/setup.h +++ b/arch/sh/include/asm/setup.h @@ -4,17 +4,26 @@ #include #ifdef __KERNEL__ +#define PARAM ((unsigned char *)empty_zero_page) + +#if defined(CONFIG_PARAM_BOOL) +#define MOUNT_ROOT_RDONLY (unsigned long)CONFIG_PARAM_MOUNT_ROOT_RDONLY +#define RAMDISK_FLAGS (unsigned long)CONFIG_PARAM_RAMDISK_FLAGS +#define ORIG_ROOT_DEV (unsigned long)CONFIG_PARAM_ORIG_ROOT_DEV +#define LOADER_TYPE (unsigned long)CONFIG_PARAM_LOADER_TYPE +#define INITRD_START (unsigned long)CONFIG_PARAM_INITRD_START +#define INITRD_SIZE (unsigned long)CONFIG_PARAM_INITRD_SIZE +#else /* * This is set up by the setup-routine at boot-time */ -#define PARAM ((unsigned char *)empty_zero_page) - #define MOUNT_ROOT_RDONLY (*(unsigned long *) (PARAM+0x000)) #define RAMDISK_FLAGS (*(unsigned long *) (PARAM+0x004)) #define ORIG_ROOT_DEV (*(unsigned long *) (PARAM+0x008)) #define LOADER_TYPE (*(unsigned long *) (PARAM+0x00c)) #define INITRD_START (*(unsigned long *) (PARAM+0x010)) #define INITRD_SIZE (*(unsigned long *) (PARAM+0x014)) +#endif /* ... */ #define COMMAND_LINE ((char *) (PARAM+0x100))