From patchwork Sat Jan 12 17:48:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 211528 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 A6BA22C00FF for ; Sun, 13 Jan 2013 04:49:54 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C2F6A4A11E; Sat, 12 Jan 2013 18:49:51 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 B-inYI45Nntu; Sat, 12 Jan 2013 18:49:51 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5D1744A118; Sat, 12 Jan 2013 18:49:33 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2FD664A0BB for ; Sat, 12 Jan 2013 18:49:30 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 LwWOfm2l+C26 for ; Sat, 12 Jan 2013 18:49:29 +0100 (CET) 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-ea0-f202.google.com (mail-ea0-f202.google.com [209.85.215.202]) by theia.denx.de (Postfix) with ESMTPS id D6D2D4A112 for ; Sat, 12 Jan 2013 18:49:24 +0100 (CET) Received: by mail-ea0-f202.google.com with SMTP id a1so26026eaa.3 for ; Sat, 12 Jan 2013 09:49:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=I9c7Xii9C+5UnndJ89d8YDrsizlQNDHPXafqqoq32XE=; b=e6NFEqIdM4EGUnAKctJC58MxVBFOwsdRwSb8i3j0X7TCzN2215fgxZ/T6faXpkmiqJ CbI/ag2fmn5hscnOjZiZjT1iY93wPum4ykGFRLElqsPZqJu5vkcpxHDHt08hT3UXjHso Tka8Plx1iDpdOOFFF643bG0cWg2pA/fLaV41sf9EG8dR1brj2nC/i64+rUgyacL1v0wE XbzT0HnZJ/vhlP1eRMJoQPpnM9JyiqZjh05q+htmqMi/81hCAfKojk1oleFH+5CfC/A6 9Np8lkpaz9MMOLMRYBpFcLBeZdmK/r9CxnceSlaD4/jvIkX22wqCo5U00gOMSzldN1Kk SMqw== X-Received: by 10.14.180.2 with SMTP id i2mr16077070eem.1.1358012963209; Sat, 12 Jan 2013 09:49:23 -0800 (PST) Received: from hpza10.eem.corp.google.com ([74.125.121.33]) by gmr-mx.google.com with ESMTPS id g9si3259868eeo.1.2013.01.12.09.49.23 (version=TLSv1 cipher=AES128-SHA bits=128/128); Sat, 12 Jan 2013 09:49:23 -0800 (PST) Received: from kaka.mtv.corp.google.com (kaka.mtv.corp.google.com [172.22.73.79]) by hpza10.eem.corp.google.com (Postfix) with ESMTP id B85C5200057; Sat, 12 Jan 2013 09:49:22 -0800 (PST) Received: by kaka.mtv.corp.google.com (Postfix, from userid 121222) id 1B6ED160954; Sat, 12 Jan 2013 09:49:22 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Date: Sat, 12 Jan 2013 09:48:47 -0800 Message-Id: <1358012928-2112-4-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <1358012928-2112-1-git-send-email-sjg@chromium.org> References: <1358012928-2112-1-git-send-email-sjg@chromium.org> X-Gm-Message-State: ALoCoQkan6UvqhV7AjN0VNWcwUoUv5D7ZRJVYz68MYVPW4bZJwRZjqeqzVfFqS0GeoRDYmZOmgSivIFes3LZ0w0RagR/6ZMIGn+k/sJa4e8IGgiQseg6TTab/xjWSqdBmKnv2W5Y2R2Lft9CFRpNvWnkAAX0HTNLz1FDARL7hL9PHqA8spPVNyM+IiGwbcx+EdK8Kf5vjhVN Cc: Graeme Russ , Vadim Bendebury Subject: [U-Boot] [RFC PATCH 3/4] x86: Allow cmdline setup in setup_zimage() to be optional X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 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. TBD. Signed-off-by: Simon Glass --- arch/x86/lib/zimage.c | 21 ++++++++++++--------- 1 files changed, 12 insertions(+), 9 deletions(-) diff --git a/arch/x86/lib/zimage.c b/arch/x86/lib/zimage.c index 8819afd..9fc450a 100644 --- a/arch/x86/lib/zimage.c +++ b/arch/x86/lib/zimage.c @@ -269,18 +269,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; }