From patchwork Wed Oct 8 02:27:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 397513 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 7958114012E for ; Wed, 8 Oct 2014 13:28:14 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 064D3A73FF; Wed, 8 Oct 2014 04:28:11 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 82ebfBBVcmVY; Wed, 8 Oct 2014 04:28:10 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0624AA73F3; Wed, 8 Oct 2014 04:28:08 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BAC084A027 for ; Wed, 8 Oct 2014 04:27:52 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Hmz52H3lR8yR for ; Wed, 8 Oct 2014 04:27:52 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-pd0-f202.google.com (mail-pd0-f202.google.com [209.85.192.202]) by theia.denx.de (Postfix) with ESMTPS id 56C084B5D5 for ; Wed, 8 Oct 2014 04:27:49 +0200 (CEST) Received: by mail-pd0-f202.google.com with SMTP id fp1so1331833pdb.5 for ; Tue, 07 Oct 2014 19:27:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=HJvIbYtjN4ygo2cG/QalbLYwF3mMgi1i9w70C/2E/lA=; b=iLduVK4F2HOCQYBpvqcltpa51BpSl+dvsSjEHaLHklhd2K8fSPIGdfu5GiSkjTNPqz 6CNv1PTHDW1yvCA2ppLkWVNwfXRRn1v5oRNuLHLdDfmuRjLxql66HiDNJButP0XSfleg PSdRkVbIC9URZrQv+BNfpXsECpNhpT/tm6GSPWUmiTx4PVoXQiWPlQ/pBBXY2ng0OjB4 EwEvdCuQ8EkcaqY6HvN9ZZi8b1Livq4qmI2XxcnuCoIh1jqG38ppdcm8Nd1dXraGDC0/ 56ZhUpt/Gba3ka+xoW7OmS2tCy8keVTfR8VbhiBIddvATB7P05JGPRBjWDrIfa0vvlBs vORA== X-Gm-Message-State: ALoCoQle6HFDqSfNvonCnEU3AgC4SuZasUbKdXpKjuU0wEM7m0bpipKUEa0TQnQbKffpuJGuk0xR X-Received: by 10.70.131.135 with SMTP id om7mr5140388pdb.8.1412735267981; Tue, 07 Oct 2014 19:27:47 -0700 (PDT) Received: from corpmail-nozzle1-1.hot.corp.google.com ([100.108.1.104]) by gmr-mx.google.com with ESMTPS id e24si959708yhe.3.2014.10.07.19.27.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Oct 2014 19:27:47 -0700 (PDT) Received: from kaki.bld.corp.google.com ([172.29.216.32]) by corpmail-nozzle1-1.hot.corp.google.com with ESMTP id FYZeelxy.1; Tue, 07 Oct 2014 19:27:47 -0700 Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id 498622210B1; Tue, 7 Oct 2014 20:27:47 -0600 (MDT) From: Simon Glass To: U-Boot Mailing List Date: Tue, 7 Oct 2014 20:27:13 -0600 Message-Id: <1412735234-15986-4-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.1.0.rc2.206.gedb03e5 In-Reply-To: <1412735234-15986-1-git-send-email-sjg@chromium.org> References: <1412735234-15986-1-git-send-email-sjg@chromium.org> Cc: Graeme Russ Subject: [U-Boot] [PATCH v2 3/4] x86: Allow cmdline setup in setup_zimage() to be optional X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.13 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de If we are passing this using the device tree then we may not want to set this up here. Signed-off-by: Simon Glass --- Changes in v2: None arch/x86/lib/zimage.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/arch/x86/lib/zimage.c b/arch/x86/lib/zimage.c index 1f59bf2..2f0e92f 100644 --- a/arch/x86/lib/zimage.c +++ b/arch/x86/lib/zimage.c @@ -243,18 +243,21 @@ int setup_zimage(struct boot_params *setup_base, char *cmd_line, int auto_boot, hdr->loadflags |= HEAP_FLAG; } - if (bootproto >= 0x0202) { - hdr->cmd_line_ptr = (uintptr_t)cmd_line; - } else if (bootproto >= 0x0200) { - setup_base->screen_info.cl_magic = COMMAND_LINE_MAGIC; - setup_base->screen_info.cl_offset = - (uintptr_t)cmd_line - (uintptr_t)setup_base; + if (cmd_line) { + if (bootproto >= 0x0202) { + hdr->cmd_line_ptr = (uintptr_t)cmd_line; + } else if (bootproto >= 0x0200) { + setup_base->screen_info.cl_magic = COMMAND_LINE_MAGIC; + setup_base->screen_info.cl_offset = + (uintptr_t)cmd_line - (uintptr_t)setup_base; + + hdr->setup_move_size = 0x9100; + } - hdr->setup_move_size = 0x9100; + /* build command line at COMMAND_LINE_OFFSET */ + build_command_line(cmd_line, auto_boot); } - /* build command line at COMMAND_LINE_OFFSET */ - build_command_line(cmd_line, auto_boot); return 0; }