Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9A583C4332F for ; Sat, 16 Dec 2023 03:18:36 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0B54787CBF; Sat, 16 Dec 2023 04:15:35 +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="aIgrm3An"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6DC1187C78; Sat, 16 Dec 2023 04:15:29 +0100 (CET) Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) (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 2F6AD87C84 for ; Sat, 16 Dec 2023 04:15:27 +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-xd2f.google.com with SMTP id ca18e2360f4ac-7b3b819f8a3so70491939f.1 for ; Fri, 15 Dec 2023 19:15:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1702696525; x=1703301325; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=DYgKeQH2CXVAEdnRudWChj+hNqi+mNBzAH3qs4VLq7o=; b=aIgrm3AnDw1EvKEWE3DdFSLrSZD/ABMX4OJOMse5DjFpBFT0w3vPEMbVzwXmsKTfdr Uoq/8gYn+8KdPY4OahegwbSk/yv+KbUZYStVl1vRUMMLhI95J81z4tU3p1Knupn688t/ 7Yv8jmrFPtBNw3hTEWy81tibjkd6PNk5/x1pU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702696525; x=1703301325; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DYgKeQH2CXVAEdnRudWChj+hNqi+mNBzAH3qs4VLq7o=; b=eSR+Yn2CdUBBU4aCIqchoTgzZ/EiYqNDgQBtpBkljwTUNQ9c1L/Y2D/J7mCem0+Sr8 b3Twfq6dDnt+O+9p1dIyPq2uIJzEPMlt3MtvOImYUz5qlYt7/HCmr2c3HjKh++v7P9FA uqJA3bBUR131ldfe93z6EPSER5kVk2rsZj03A7AcLR6Aeumr+EAbOa0cP0vyRs4ne2TN ZPo3/vtqF+AeYQkcNoU73A4NbJPL41o+xhMNvvwBh7byyavxsIoc9uSIoVGE3sH2kZQD QMKEIiA/wJwbWkOCHVFI+prC9nvqLZaCf9nYiH081YVCN6tpskOyIlI5MH4F3mS7V0Aw nCrA== X-Gm-Message-State: AOJu0Yyc3a/kWHMwPLBu8sc0Hip3hbQyeplv1h7DJEVKMKcaPwKli+Mj nwmufCWEAURTpsO6cceFFg3EOBuZrdtR+PAqDMGUyQ== X-Google-Smtp-Source: AGHT+IHKUrZRcXz3/pFmEuH9f1JAKKnwnzvRm4vbwEJzWZOCnmjsn/lO9FICPBiqSMvync7kDwy8KQ== X-Received: by 2002:a05:6e02:174a:b0:35d:695a:d318 with SMTP id y10-20020a056e02174a00b0035d695ad318mr13469487ill.77.1702696525657; Fri, 15 Dec 2023 19:15:25 -0800 (PST) Received: from sjg1.lan (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id z10-20020a92ceca000000b0035f75e80d1esm542163ilq.52.2023.12.15.19.15.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 19:15:25 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Patrick Delaunay , Patrice Chotard , Sean Anderson , uboot-stm32@st-md-mailman.stormreply.com Subject: [PATCH v3 20/22] stm32: Use bootm_run() and bootz_run() Date: Fri, 15 Dec 2023 20:14:24 -0700 Message-ID: <20231216031446.2222362-16-sjg@chromium.org> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog In-Reply-To: <20231216031446.2222362-1-sjg@chromium.org> References: <20231216031446.2222362-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.103.8 at phobos.denx.de X-Virus-Status: Clean Use the new bootm/z_run() functions to avoid having to create an argument list for the stm32prog code. Signed-off-by: Simon Glass Reviewed-by: Patrick Delaunay --- Changes in v3: - Rename addr_fit to addr_img in struct bootm_info .../cmd_stm32prog/cmd_stm32prog.c | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c b/arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c index 8670535844d3..adee6e05b636 100644 --- a/arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c +++ b/arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -125,12 +126,10 @@ static int do_stm32prog(struct cmd_tbl *cmdtp, int flag, int argc, char dtb_addr[20]; char initrd_addr[40]; char *fdt_arg, *initrd_arg; - char *bootm_argv[5] = { - "bootm", boot_addr_start, - }; const void *uimage = (void *)data->uimage; const void *dtb = (void *)data->dtb; const void *initrd = (void *)data->initrd; + struct bootm_info bmi; fdt_arg = dtb_addr; if (!dtb) @@ -141,7 +140,7 @@ static int do_stm32prog(struct cmd_tbl *cmdtp, int flag, int argc, snprintf(boot_addr_start, sizeof(boot_addr_start) - 1, "0x%p", uimage); - initrd_arg = "-"; + initrd_arg = NULL; if (initrd) { snprintf(initrd_addr, sizeof(initrd_addr) - 1, "0x%p:0x%zx", initrd, data->initrd_size); @@ -149,15 +148,18 @@ static int do_stm32prog(struct cmd_tbl *cmdtp, int flag, int argc, } printf("Booting kernel at %s %s %s...\n\n\n", boot_addr_start, - initrd_arg, fdt_arg); - bootm_argv[2] = initrd_arg; - bootm_argv[3] = fdt_arg; + initrd_arg ?: "-", fdt_arg); + + bootm_init(&bmi); + bmi.addr_img = boot_addr_start; + bmi.conf_ramdisk = initrd_arg; + bmi.conf_fdt = fdt_arg; /* Try bootm for legacy and FIT format image */ if (genimg_get_format(uimage) != IMAGE_FORMAT_INVALID) - do_bootm(cmdtp, 0, 4, bootm_argv); + bootm_run(&bmi); else if (IS_ENABLED(CONFIG_CMD_BOOTZ)) - do_bootz(cmdtp, 0, 4, bootm_argv); + bootz_run(&bmi); } if (data->script) cmd_source_script(data->script, NULL, NULL); -- 2.43.0.472.g3155946c3a-goog