From patchwork Thu Dec 10 05:00:25 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: yoshii.takashi@gmail.com X-Patchwork-Id: 66170 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 nBA519jk007180 for ; Thu, 10 Dec 2009 05:01:09 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753498AbZLJFAj (ORCPT ); Thu, 10 Dec 2009 00:00:39 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753972AbZLJFAi (ORCPT ); Thu, 10 Dec 2009 00:00:38 -0500 Received: from mail-yw0-f198.google.com ([209.85.211.198]:45662 "EHLO mail-yw0-f198.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752980AbZLJFA2 (ORCPT ); Thu, 10 Dec 2009 00:00:28 -0500 Received: by ywh36 with SMTP id 36so7385615ywh.15 for ; Wed, 09 Dec 2009 21:00:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:in-reply-to:references:x-mailer:mime-version :content-type:content-transfer-encoding; bh=qYdBM1kP0KMVVQ6J/p6P/YhweeqEeCykOXsQoF/DZFE=; b=G+eGaRsB8ta2JQzMnX/k6cwo6cVO64R1IjLVSGd64O87h/v90bc/PpR69RtsaEbEdF BKJh5LExaWgb/pARJpTxYPbZdIPSEC0j8Scs4FZJckjWvwJ+mYTyBXN3Ttd309h1IKeT zyHSuSYERpmzs3iE4TZ7sxE1EIbuBBb/AafqE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type:content-transfer-encoding; b=qiuMnmlOtXXRJL+Ro4mw+Sma2m7a9vUsjL9JWGkDh6EWyx+ynRs5515qAIke4O5OGb t4yzsqEI1iMKGzTKrpFKmvoIaAB/hlG0bxk0GDfBPFuhQUUZkP8j4dKGurtdnyMLyVLx H0klMGQT7UFiuQRF4ZenxsSvpZngYmQYYvIDE= Received: by 10.90.16.14 with SMTP id 14mr7004330agp.102.1260421233044; Wed, 09 Dec 2009 21:00:33 -0800 (PST) Received: from genny.localdomain (49.14.32.202.bf.2iij.net [202.32.14.49]) by mx.google.com with ESMTPS id 15sm254209gxk.12.2009.12.09.21.00.29 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 09 Dec 2009 21:00:31 -0800 (PST) Date: Thu, 10 Dec 2009 14:00:25 +0900 From: yoshii.takashi@gmail.com To: Stuart MENEFY Cc: Paul Mundt , yoshii.takashi@renesas.com, linux-sh@vger.kernel.org Subject: Re: [PATCH] sh: Add CONFIG_PARAM_* to set boot parameters. Message-Id: <20091210140025.9f989f97.yoshii.takashi@gmail.com> In-Reply-To: <4B1E5118.9000006@st.com> References: <20091130170254.65d2a0ab.yoshii.takashi@renesas.com> <20091202013545.GA11047@linux-sh.org> <20091208140126.d63968b9.yoshii.takashi@renesas.com> <20091208081853.GA25932@linux-sh.org> <4B1E5118.9000006@st.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/boot/compressed/head_32.S b/arch/sh/boot/compressed/head_32.S index 02a3093..0a96edb 100644 --- a/arch/sh/boot/compressed/head_32.S +++ b/arch/sh/boot/compressed/head_32.S @@ -99,6 +99,12 @@ decompress_kernel_addr: kernel_start_addr: .long _text+PAGE_SIZE +#if defined(CONFIG_CMDLINE) + .skip startup + 0x100 - . +cmdline: + .asciz CONFIG_CMDLINE ! default command line +#endif + .align 9 fake_headers_as_bzImage: .word 0 @@ -117,3 +123,48 @@ fake_headers_as_bzImage: .long 0x100000 ! 0x100000 = default for big kernel .long 0 ! address of loaded ramdisk image .long 0 # its size in bytes + + .skip startup + 0x220 - . + + ! address of empty_zero_page +#ifdef CONFIG_PMB_FIXED + .long CONFIG_PAGE_OFFSET + (CONFIG_MEMORY_START & 0x1fffffff) \ + + CONFIG_ZERO_PAGE_OFFSET +#elif defined(CONFIG_32BIT) + .long CONFIG_PAGE_OFFSET + CONFIG_ZERO_PAGE_OFFSET +#else + .long CONFIG_PAGE_OFFSET + CONFIG_MEMORY_START \ + + CONFIG_ZERO_PAGE_OFFSET +#endif + .long _edata - startup ! size of zImage + .long default_values - startup + + ! default values of boot parameters and flags + .align 2 +default_values: +#ifdef CONFIG_PARAM_BOOL + .long CONFIG_PARAM_MOUNT_ROOT_RDONLY + .long CONFIG_PARAM_RAMDISK_FLAGS + .long CONFIG_PARAM_ORIG_ROOT_DEV + .long CONFIG_PARAM_LOADER_TYPE + .long CONFIG_PARAM_INITRD_START + .long CONFIG_PARAM_INITRD_SIZE +#else + .long 1 /* MOUNT_ROOT_RDONLY */ + .long 0 /* RAMDISK_FLAGS */ + .long 0x0200 /* ORIG_ROOT_DEV */ + .long 1 /* LOADER_TYPE */ + .long 0x00000000 /* INITRD_START */ + .long 0x00000000 /* INITRD_SIZE */ +#endif + ! Mode flag +#ifdef CONFIG_32BIT + .long 0x53453f00 + 32 /* "SE?" = 32 bit */ +#else + .long 0x53453f00 + 29 /* "SE?" = 29 bit */ +#endif +#if defined(CONFIG_CMDLINE) + .long cmdline - startup ! offset of the default command line +#else + .long 0 ! no default provided +#endif diff --git a/arch/sh/kernel/head_32.S b/arch/sh/kernel/head_32.S index a78be74..58325fe 100644 --- a/arch/sh/kernel/head_32.S +++ b/arch/sh/kernel/head_32.S @@ -27,17 +27,36 @@ .section .empty_zero_page, "aw" ENTRY(empty_zero_page) +#ifdef CONFIG_PARAM_BOOL + .long CONFIG_PARAM_MOUNT_ROOT_RDONLY + .long CONFIG_PARAM_RAMDISK_FLAGS + .long CONFIG_PARAM_ORIG_ROOT_DEV + .long CONFIG_PARAM_LOADER_TYPE + .long CONFIG_PARAM_INITRD_START + .long CONFIG_PARAM_INITRD_SIZE +#else .long 1 /* MOUNT_ROOT_RDONLY */ .long 0 /* RAMDISK_FLAGS */ .long 0x0200 /* ORIG_ROOT_DEV */ .long 1 /* LOADER_TYPE */ .long 0x00000000 /* INITRD_START */ .long 0x00000000 /* INITRD_SIZE */ +#endif #ifdef CONFIG_32BIT .long 0x53453f00 + 32 /* "SE?" = 32 bit */ #else .long 0x53453f00 + 29 /* "SE?" = 29 bit */ #endif +#if defined(CONFIG_CMDLINE) + .long 0x100 /* offset of the default command line */ +#else + .long 0 +#endif +#if defined(CONFIG_CMDLINE) + .skip empty_zero_page + 0x100 - . +cmdline: + .asciz CONFIG_CMDLINE ! default command line +#endif 1: .skip PAGE_SIZE - empty_zero_page - 1b diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index 88cdeb9..97b2668 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig @@ -799,6 +799,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"