From patchwork Fri Oct 18 18:42:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roy Franz X-Patchwork-Id: 21169 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f198.google.com (mail-ob0-f198.google.com [209.85.214.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E0582202FF for ; Fri, 18 Oct 2013 18:42:20 +0000 (UTC) Received: by mail-ob0-f198.google.com with SMTP id va2sf11965440obc.1 for ; Fri, 18 Oct 2013 11:42:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=AI6wCU/N3NISk5OxpgUFXsHnRaceUKcGJoySUWR1gFo=; b=aBZM7+Ioo+rhlE40XLyLWjrCYA3G5UyY+eNZhTIFXTwPUVs6K9EbP4KTkQn3cv49U7 R3TAfRZfMwtkpOFjFDMSLUZdhHa0N4OmmYOUxLgiZy97Gp/YGCZscwMeQqy1j8sAiDnw BeMEPpYnew3ciCVzAL1ysbJhTn3josBbIX+wLlL20+3GmeUx/UU1qAJqPbOMozQyIixv o9k62u9SF0lOTGFUk/QeGPQ+omw+07+8x6JNBebf1Ot6YTgPESW6Wq4sAnB6yjSvOrgc Iqlmo303XHZrFgEIkUprk7ngLvSX2zloz5lfOxlU6gzUchF+z0KjvWsVRpbIroTTvjqh yQ9A== X-Received: by 10.182.153.35 with SMTP id vd3mr1588449obb.37.1382121739772; Fri, 18 Oct 2013 11:42:19 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.53.2 with SMTP id x2ls591747qeo.34.gmail; Fri, 18 Oct 2013 11:42:19 -0700 (PDT) X-Received: by 10.58.161.231 with SMTP id xv7mr3092322veb.2.1382121739610; Fri, 18 Oct 2013 11:42:19 -0700 (PDT) Received: from mail-ve0-f178.google.com (mail-ve0-f178.google.com [209.85.128.178]) by mx.google.com with ESMTPS id ag10si553079vec.98.2013.10.18.11.42.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Oct 2013 11:42:19 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.178 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.178; Received: by mail-ve0-f178.google.com with SMTP id jy13so2210357veb.37 for ; Fri, 18 Oct 2013 11:42:19 -0700 (PDT) X-Gm-Message-State: ALoCoQkE15zi1z9Et/th8oaIWWWpTjaXTBLI5o7NDubqdpXvh4jAW02SDh7QDo+qWI8Z3FAOW+02 X-Received: by 10.52.231.5 with SMTP id tc5mr21156vdc.36.1382121739505; Fri, 18 Oct 2013 11:42:19 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp56474vcz; Fri, 18 Oct 2013 11:42:19 -0700 (PDT) X-Received: by 10.66.152.102 with SMTP id ux6mr4734861pab.79.1382121738216; Fri, 18 Oct 2013 11:42:18 -0700 (PDT) Received: from mail-pd0-f171.google.com (mail-pd0-f171.google.com [209.85.192.171]) by mx.google.com with ESMTPS id fk10si2129289pab.145.2013.10.18.11.42.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Oct 2013 11:42:18 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.171 is neither permitted nor denied by best guess record for domain of roy.franz@linaro.org) client-ip=209.85.192.171; Received: by mail-pd0-f171.google.com with SMTP id z10so5145000pdj.2 for ; Fri, 18 Oct 2013 11:42:17 -0700 (PDT) X-Received: by 10.68.252.68 with SMTP id zq4mr4421311pbc.154.1382121737274; Fri, 18 Oct 2013 11:42:17 -0700 (PDT) Received: from rfranz-i7.local (c-98-244-40-86.hsd1.ca.comcast.net. [98.244.40.86]) by mx.google.com with ESMTPSA id ta10sm6127739pab.5.2013.10.18.11.42.15 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Oct 2013 11:42:16 -0700 (PDT) From: Roy Franz To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, grant.likely@linaro.org, patches@linaro.org, Roy Franz Subject: [PATCH] Make -kernel command line option optional Date: Fri, 18 Oct 2013 11:42:11 -0700 Message-Id: <1382121731-879-1-git-send-email-roy.franz@linaro.org> X-Mailer: git-send-email 1.7.10.4 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: roy.franz@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.178 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Grant Likely The kernel parameter is not used when booting using firmware such as UEFI. The firmware image is supplied with the -pflash parameter, and the -kernel parameter should not be required since the kernel will be loaded by the firmware. Signed-off-by: Roy Franz Signed-off-by: Grant Likely --- hw/arm/boot.c | 47 ++++++++++++++++++++++------------------------- 1 file changed, 22 insertions(+), 25 deletions(-) diff --git a/hw/arm/boot.c b/hw/arm/boot.c index 1e313af..66a057d 100644 --- a/hw/arm/boot.c +++ b/hw/arm/boot.c @@ -352,12 +352,6 @@ void arm_load_kernel(ARMCPU *cpu, struct arm_boot_info *info) hwaddr entry; int big_endian; - /* Load the kernel. */ - if (!info->kernel_filename) { - fprintf(stderr, "Kernel image must be specified\n"); - exit(1); - } - info->dtb_filename = qemu_opt_get(qemu_get_machine_opts(), "dtb"); if (!info->secondary_cpu_reset_hook) { @@ -389,26 +383,29 @@ void arm_load_kernel(ARMCPU *cpu, struct arm_boot_info *info) info->initrd_start = info->loader_start + MIN(info->ram_size / 2, 128 * 1024 * 1024); - /* Assume that raw images are linux kernels, and ELF images are not. */ - kernel_size = load_elf(info->kernel_filename, NULL, NULL, &elf_entry, - NULL, NULL, big_endian, ELF_MACHINE, 1); - entry = elf_entry; - if (kernel_size < 0) { - kernel_size = load_uimage(info->kernel_filename, &entry, NULL, - &is_linux); - } - if (kernel_size < 0) { - entry = info->loader_start + KERNEL_LOAD_ADDR; - kernel_size = load_image_targphys(info->kernel_filename, entry, - info->ram_size - KERNEL_LOAD_ADDR); - is_linux = 1; - } - if (kernel_size < 0) { - fprintf(stderr, "qemu: could not load kernel '%s'\n", - info->kernel_filename); - exit(1); + if (info->kernel_filename) { + /* Assume that raw images are linux kernels, and ELF images are not. */ + kernel_size = load_elf(info->kernel_filename, NULL, NULL, &elf_entry, + NULL, NULL, big_endian, ELF_MACHINE, 1); + entry = elf_entry; + if (kernel_size < 0) { + kernel_size = load_uimage(info->kernel_filename, &entry, NULL, + &is_linux); + } + if (kernel_size < 0) { + entry = info->loader_start + KERNEL_LOAD_ADDR; + kernel_size = load_image_targphys(info->kernel_filename, entry, + info->ram_size - KERNEL_LOAD_ADDR); + is_linux = 1; + } + if (kernel_size < 0) { + fprintf(stderr, "qemu: could not load kernel '%s'\n", + info->kernel_filename); + exit(1); + } + info->entry = entry; } - info->entry = entry; + if (is_linux) { if (info->initrd_filename) { initrd_size = load_ramdisk(info->initrd_filename,