All of lore.kernel.org
 help / color / mirror / Atom feed
From: Artem Lapkin <email2tema@gmail.com>
To: sjg@chromium.org
Cc: trini@konsulko.com, narmstrong@baylibre.com, twarren@nvidia.com,
	andre.przywara@arm.com, u-boot@lists.denx.de,
	u-boot-amlogic@groups.io, christianshewitt@gmail.com,
	art@khadas.com, nick@khadas.com, gouwa@khadas.com
Subject: [PATCH v2] image-board: fix wrong implementation ram disk address setup from cmdline
Date: Thu, 25 Nov 2021 11:08:59 +0800	[thread overview]
Message-ID: <20211125030859.2896352-1-art@khadas.com> (raw)

Problem

Wrong implementation logic: ramdisk cmdline image address always ignored!
Next block { rd_addr = hextoul(select, NULL) } unusable for raw initrd.

We have unbootable raw initrd images because, select_ramdisk for raw
initrd images ignore submited select addr and setup rd_datap value to 0

Signed-off-by: Artem Lapkin <art@khadas.com>
---
V2 changes
_ rebase to master
_ from https://patchwork.ozlabs.org/project/uboot/patch/20211016051915.4157293-1-art@khadas.com/
---
 boot/image-board.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/boot/image-board.c b/boot/image-board.c
index bf8817165c..87a8f07432 100644
--- a/boot/image-board.c
+++ b/boot/image-board.c
@@ -334,7 +334,7 @@ static int select_ramdisk(bootm_headers_t *images, const char *select, u8 arch,
 
 	if (select) {
 		ulong default_addr;
-		bool done = true;
+		bool done = false;
 
 		if (CONFIG_IS_ENABLED(FIT)) {
 			/*
@@ -352,13 +352,13 @@ static int select_ramdisk(bootm_headers_t *images, const char *select, u8 arch,
 					   &fit_uname_config)) {
 				debug("*  ramdisk: config '%s' from image at 0x%08lx\n",
 				      fit_uname_config, rd_addr);
+				done = true;
 			} else if (fit_parse_subimage(select, default_addr,
 						      &rd_addr,
 						      &fit_uname_ramdisk)) {
 				debug("*  ramdisk: subimage '%s' from image at 0x%08lx\n",
 				      fit_uname_ramdisk, rd_addr);
-			} else {
-				done = false;
+				done = true;
 			}
 		}
 		if (!done) {
-- 
2.25.1


             reply	other threads:[~2021-11-25  3:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-25  3:08 Artem Lapkin [this message]
2021-12-07 15:07 ` [PATCH v2] image-board: fix wrong implementation ram disk address setup from cmdline Simon Glass
2022-01-17 19:47 ` Tom Rini
2022-01-18  7:28   ` Art Nikpal
2022-01-23  3:32   ` Art Nikpal
2022-01-24  9:26     ` Neil Armstrong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211125030859.2896352-1-art@khadas.com \
    --to=email2tema@gmail.com \
    --cc=andre.przywara@arm.com \
    --cc=art@khadas.com \
    --cc=christianshewitt@gmail.com \
    --cc=gouwa@khadas.com \
    --cc=narmstrong@baylibre.com \
    --cc=nick@khadas.com \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=twarren@nvidia.com \
    --cc=u-boot-amlogic@groups.io \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.