From patchwork Sun Nov 10 04:12:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 290031 X-Patchwork-Delegate: sjg@chromium.org 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 50EB92C0077 for ; Sun, 10 Nov 2013 15:13:33 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 196BC4A407; Sun, 10 Nov 2013 05:13: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 ld+QyNrt3tdC; Sun, 10 Nov 2013 05:13:29 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3E3264A3E8; Sun, 10 Nov 2013 05:13:25 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 06BDC4A3D0 for ; Sun, 10 Nov 2013 05:13:23 +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 bTGyynMyzgRI for ; Sun, 10 Nov 2013 05:13:17 +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-gg0-f201.google.com (mail-gg0-f201.google.com [209.85.161.201]) by theia.denx.de (Postfix) with ESMTPS id 3E5AE4A3E8 for ; Sun, 10 Nov 2013 05:13:11 +0100 (CET) Received: by mail-gg0-f201.google.com with SMTP id l25so287820ggc.4 for ; Sat, 09 Nov 2013 20:13:09 -0800 (PST) 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=2TB01bATzT5kbF9bxeehbAvPRiUtMroHu3zhhctWxpg=; b=BWHei0rcYvANVEBn5Da9BaO7wr9zN3HX9g8nzRdzfvGtENtDxzcOZuQGsa6k4HvfHD 38NPp41Gt6YbvZOBzsAtElxK0zq/AoKWdJB5QtPsdlUNufiK0RVX4SKRPObwY8lDWBeM vXpgwUQ3y4rPxcZ3ZFpKnHXLgQlnwVqc0kG3eLdoo2tXaydgETiRApv6lrP4tHeGu9Mz mtrWtk4Yz0PftKWc0sA11HPAHr7ERDnpAu3I9u7xtJL2tcehfWLVRC/84QaKaHeAY2CE kq8k0aaCyxdQFY0I62dwRaXahbVT7K+KhzxDzAmAcPNZEpo2+qzOCRxU0UDxlwAOqP0t FjtQ== X-Gm-Message-State: ALoCoQl6Aeqe3T48PXlUwza6oqnaVW1DtB8c6YYDcV6jqHJ9enSSrkU3w8EZgsp7CwF7PX6So2tVjIJE64OQ3EB15KP81S9tNASUThqH8SXtumcSiJAulqkXI/TzOOoLxkyfrgqXvdZYCFeQtJJCjRqEI8mz6ZL3gDpmu69CsxE1elas05wBdORTYqUFWrzJoD4D/D7fcb33 X-Received: by 10.52.31.69 with SMTP id y5mr9292072vdh.4.1384056789394; Sat, 09 Nov 2013 20:13:09 -0800 (PST) Received: from corp2gmr1-2.hot.corp.google.com (corp2gmr1-2.hot.corp.google.com [172.24.189.93]) by gmr-mx.google.com with ESMTPS id a24si1319760yhl.1.2013.11.09.20.13.09 for (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 09 Nov 2013 20:13:09 -0800 (PST) Received: from kaki.bld.corp.google.com (kaki.bld.corp.google.com [172.29.216.32]) by corp2gmr1-2.hot.corp.google.com (Postfix) with ESMTP id 43C315A41EA; Sat, 9 Nov 2013 20:13:09 -0800 (PST) Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id 4E07C221979; Sat, 9 Nov 2013 21:12:12 -0700 (MST) From: Simon Glass To: U-Boot Mailing List Date: Sat, 9 Nov 2013 21:12:06 -0700 Message-Id: <1384056727-12082-4-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.8.4.1 In-Reply-To: <1384056727-12082-1-git-send-email-sjg@chromium.org> References: <1384056727-12082-1-git-send-email-sjg@chromium.org> Cc: u-boot-review@google.com 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.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 --- 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; }