From patchwork Mon Nov 9 14:12:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1396793 X-Patchwork-Delegate: bmeng.cn@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=KsgV0cpi; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CVCd35H8zz9sRK for ; Tue, 10 Nov 2020 01:12:55 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3F00E821A4; Mon, 9 Nov 2020 15:12:42 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="KsgV0cpi"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1EB92821A4; Mon, 9 Nov 2020 15:12:40 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd43.google.com (mail-io1-xd43.google.com [IPv6:2607:f8b0:4864:20::d43]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C7E63821A4 for ; Mon, 9 Nov 2020 15:12:36 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd43.google.com with SMTP id r9so9892399ioo.7 for ; Mon, 09 Nov 2020 06:12:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Ymy2mCPn/FA36s23eM6PGxTpMXBaiqEUQHfFhj1shhI=; b=KsgV0cpiIsfIM67QGmTb1fyHnuu6Xm8iOW/fAz3zsDiCjoL0qmZNqeg2wi+/1VWN+0 ncHgwoiuaoekq63FTTaGnYlrl6kGCxkLrNUTHGg1KBMKQaUHYqi+Gr+sV+N6vhbN8RSz MMb3KPoGqUzZqD+NBaK2unCwCaTgSuJ6WqUds= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ymy2mCPn/FA36s23eM6PGxTpMXBaiqEUQHfFhj1shhI=; b=dHH4EOKGyDcLSovPk+eidvYXwiHtUhVqbwtNy7oWYNdR5eqo5FRRDAZnHRYXW/9h9M Xp7WbKwaU11nIW+8hUkGAOND5FJqqC6pHKCInuhq8efX9n8loXzq88zlkxKc5cqr1+OD B5SlCh3Kq6IomYn+BQqgFAJaR5cknCjyD+2doDA0JcTj3GdN3/1yeC08sA1aWX40tWYI r6UTxLa0GREBdIcpaWepP05mB6QgWdlqWjwcUR5JkgwZBssAP6HmA4iB1kgjy4V3u8Xk bwr0VSv4DIuDT8DACHO+OVkGVVcnfqUHUcGA8rnEPazCRyYYn4u19IxPlStv3FKOppUi tvHQ== X-Gm-Message-State: AOAM530FMi9XXpCq8lDwxtrErnziaPsBLHyC2k+7ih/hmaydABN9Sxsg nGgGNVZgOn1UkKVlrYNk5W3p5ITDZMxgQg== X-Google-Smtp-Source: ABdhPJwPWKPGPZVVT8jB9dvfpt9+CiTUn24O4pw8SVjczUIMHPihM0gVgxjvB+4fUUr7qmaZcEUvmw== X-Received: by 2002:a02:2206:: with SMTP id o6mr11138623jao.137.1604931155363; Mon, 09 Nov 2020 06:12:35 -0800 (PST) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id y2sm5869944ioc.46.2020.11.09.06.12.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2020 06:12:34 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , Simon Glass , Igor Opaniuk , Wolfgang Wallner Subject: [PATCH 2/3] x86: zimage: Update cmdline parameter to be an env var Date: Mon, 9 Nov 2020 07:12:24 -0700 Message-Id: <20201109071220.2.I527e57c5ebe2b808b311693765b53a8219ef458d@changeid> X-Mailer: git-send-email 2.29.2.222.g5d2a92d10f8-goog In-Reply-To: <20201109071220.1.I7953ac0c0e042eb6e108f600ab08d1cb04258604@changeid> References: <20201109071220.1.I7953ac0c0e042eb6e108f600ab08d1cb04258604@changeid> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean With the updated changes to bootargs substitution[1], the zboot command needs to be updated to get its command line from an environment variable instead of a memory address. This is because the command-line string must be updated to convert %U to ${uuid}, etc. In any case it is more flexible to use a environment variable and it is best to do this before the release to avoid a subsequent change. Update the command accordingly. [1] http://patchwork.ozlabs.org/project/uboot/list/?series=212481 Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- arch/x86/lib/zimage.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/arch/x86/lib/zimage.c b/arch/x86/lib/zimage.c index f154827ec70..708025b2071 100644 --- a/arch/x86/lib/zimage.c +++ b/arch/x86/lib/zimage.c @@ -61,8 +61,8 @@ * BZIMAGE_LOAD_ADDR or ZIMAGE_LOAD_ADDR * @base_ptr: Pointer to the boot parameters, typically at address * DEFAULT_SETUP_BASE - * @cmdline: Address of 'override' command line, or 0 to use the one in the - * setup block + * @cmdline: Environment variable containing the 'override' command line, or + * NULL to use the one in the setup block */ struct zboot_state { ulong bzimage_addr; @@ -71,7 +71,7 @@ struct zboot_state { ulong initrd_size; ulong load_address; struct boot_params *base_ptr; - ulong cmdline; + char *cmdline; } state; enum { @@ -420,7 +420,7 @@ static int do_zboot_start(struct cmd_tbl *cmdtp, int flag, int argc, state.bzimage_addr = 0; } if (argc >= 7) - state.cmdline = simple_strtoul(argv[6], NULL, 16); + state.cmdline = env_get(argv[6]); return 0; } @@ -466,7 +466,7 @@ static int do_zboot_setup(struct cmd_tbl *cmdtp, int flag, int argc, } ret = setup_zimage(base_ptr, (char *)base_ptr + COMMAND_LINE_OFFSET, 0, state.initrd_addr, state.initrd_size, - state.cmdline); + (ulong)state.cmdline); if (ret) { puts("Setting up boot parameters failed ...\n"); return CMD_RET_FAILURE; @@ -757,8 +757,9 @@ U_BOOT_CMDREP_COMPLETE( " initrd size - The size of the initrd image to use, if any.\n" " setup - The address of the kernel setup region, if this\n" " is not at addr\n" - " cmdline - The address of the kernel command line, to\n" - " override U-Boot's normal cmdline generation\n" + " cmdline - Environment variable containing the kernel\n" + " command line, to override U-Boot's normal\n" + " cmdline generation\n" "\n" "Sub-commands to do part of the zboot sequence:\n" "\tstart [addr [arg ...]] - specify arguments\n"