From patchwork Mon Dec 5 17:47:42 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 5484 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 8A52323E03 for ; Mon, 5 Dec 2011 17:47:53 +0000 (UTC) Received: from mail-lpp01m010-f52.google.com (mail-lpp01m010-f52.google.com [209.85.215.52]) by fiordland.canonical.com (Postfix) with ESMTP id 6F607A18155 for ; Mon, 5 Dec 2011 17:47:53 +0000 (UTC) Received: by mail-lpp01m010-f52.google.com with SMTP id m6so427621lag.11 for ; Mon, 05 Dec 2011 09:47:53 -0800 (PST) Received: by 10.152.105.67 with SMTP id gk3mr6708259lab.48.1323107273343; Mon, 05 Dec 2011 09:47:53 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.41.198 with SMTP id h6cs271317lal; Mon, 5 Dec 2011 09:47:53 -0800 (PST) Received: by 10.236.153.42 with SMTP id e30mr14402152yhk.10.1323107267536; Mon, 05 Dec 2011 09:47:47 -0800 (PST) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [81.2.115.146]) by mx.google.com with ESMTPS id y3si7666745anh.210.2011.12.05.09.47.46 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 05 Dec 2011 09:47:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) client-ip=81.2.115.146; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) smtp.mail=pm215@archaic.org.uk Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1RXcdj-0000Up-93; Mon, 05 Dec 2011 17:47:43 +0000 From: Peter Maydell To: android-virt@lists.cs.columbia.edu Cc: Marc Zyngier , Christoffer Dall , patches@linaro.org Subject: [PATCH 5/6] Makefile, boot.S: Allow kernel command line to be set in makefile Date: Mon, 5 Dec 2011 17:47:42 +0000 Message-Id: <1323107263-1870-6-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1323107263-1870-1-git-send-email-peter.maydell@linaro.org> References: <1323107263-1870-1-git-send-email-peter.maydell@linaro.org> Allow the kernel command line to be set in the makefile rather than forcing the user to edit boot.S every time. Signed-off-by: Peter Maydell --- Makefile | 14 +++++++++++++- boot.S | 5 +++++ 2 files changed, 18 insertions(+), 1 deletions(-) diff --git a/Makefile b/Makefile index 0e07bf1..160cabd 100644 --- a/Makefile +++ b/Makefile @@ -24,6 +24,18 @@ endif #CPPFLAGS += -march=armv7-m #CPPFLAGS += -mthumb -Wa,-mthumb -Wa,-mimplicit-it=always +# Kernel command line +# MPS: +# KCMD = "rdinit=/bin/sh console=ttyAMA3 mem=4M earlyprintk" +# not-vexpress (ie EB, RealviewPB, etc), with initrd +# KCMD = "console=ttyAMA0 mem=256M earlyprintk" +# not-vexpress, without initrd: +# KCMD = "root=/dev/nfs nfsroot=10.1.77.43:/work/debootstrap/arm ip=dhcp console=ttyAMA0 mem=256M earlyprintk" +# Vexpress, with initrd: +# KCMD = "console=ttyAMA0 mem=512M mem=512M@0x880000000 earlyprintk ip=192.168.27.200::192.168.27.1:255.255.255.0:angstrom:eth0:off" +# VExpress, without initrd: +KCMD ?= "console=ttyAMA0 mem=512M mem=512M@0x880000000 earlyprintk root=/dev/nfs nfsroot=172.31.252.250:/srv/arm-oneiric-root,tcp rw ip=dhcp nfsrootdebug" + MONITOR = monitor.S BOOTLOADER = boot.S KERNEL_SRC = ../linux-kvm-arm @@ -54,7 +66,7 @@ $(IMAGE): boot.o monitor.o model.lds $(KERNEL) $(FILESYSTEM) Makefile $(LD) -o $@ --script=model.lds boot.o: $(BOOTLOADER) - $(CC) $(CPPFLAGS) -c -o $@ $< + $(CC) $(CPPFLAGS) -DKCMD='$(KCMD)' -c -o $@ $< monitor.o: $(MONITOR) $(CC) $(CPPFLAGS) -c -o $@ $< diff --git a/boot.S b/boot.S index 6de3721..e1c8d78 100644 --- a/boot.S +++ b/boot.S @@ -142,6 +142,10 @@ atags: @ ATAG_CMDLINE .long (1f - .) >> 2 .long 0x54410009 +#ifdef KCMD + /* User-specified command line always overrides */ + .asciz KCMD +#else #ifdef MACH_MPS .asciz "rdinit=/bin/sh console=ttyAMA3 mem=4M earlyprintk" #elif defined(VEXPRESS) @@ -161,6 +165,7 @@ atags: #endif #endif +#endif .align 2 1: