From patchwork Thu Nov 25 03:08:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Art Nikpal X-Patchwork-Id: 1559502 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=NdLLokK4; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4J02sT6JVbz9s5P for ; Thu, 25 Nov 2021 14:09:17 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9704582FD6; Thu, 25 Nov 2021 04:09:14 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="NdLLokK4"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BB52382FB3; Thu, 25 Nov 2021 04:09:12 +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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) (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 08EF981DB4 for ; Thu, 25 Nov 2021 04:09:09 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=email2tema@gmail.com Received: by mail-pj1-x1036.google.com with SMTP id gx15-20020a17090b124f00b001a695f3734aso4545362pjb.0 for ; Wed, 24 Nov 2021 19:09:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=gty+fyacM/AGt5HD1oDWWLpUuczab02jCSI0bTm7XP0=; b=NdLLokK4UE/lrv/kkSeQD418sLkJ+qL+wS0Mrl2/JhscHTOm7VH0Z6iYUt4eJxdPQt G1QDQLxwenx0mIa9x5RbPQQInAxqivS3Wxnyx2OxcbKxwUyjMC9F9PNDSD3aM4h+p2oB RDYhkR2Bpl2en5SD1WiysKu6yW7qLm5Of11FhZCQP0dl6FPkwKGawZgi0Wlq5WLJTUOS 1mXjzjyZlpRKOYV0dv/UsXG71r2T20KiQC9o+IvGt7gzblND+ICX2qgQfIXV3Ab14275 873eUkTUtiFh/5R+039pL7lHROxsbaOtdfhkrisYH65Xkir3LBONQ4gHfzqdUAa9LVhB HEfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=gty+fyacM/AGt5HD1oDWWLpUuczab02jCSI0bTm7XP0=; b=HuTRegWAO1mV7y7cJ5n76zX+gXu6cYda2tdTcLo4vBd5TE11OD4X41M8obrl71SNZc beT6h6iJt+U1X9Lu4m1PCp7TunC9EsAfHK9HPnZYDoGFiJ1mCPSMAAIH9Bs1umBrhzqH /61DgbAIbL2AQc6i1YxkMe2UsabXsdMplnQ/VeSiVMyRROoApDOMG8y+58wxN798OvDx uh3Z1cqLI7eMbKVHs/c7uiuYy96m0tp4bszZllFId0+HCUReouxqKxFzLhwjgGVK2To6 5B8SXkRv0rNP7fmCGtEY+I1YC+zRU0mP85vkeFBNwMzF6EUgYoZSER33QLZreutyyYME /SLw== X-Gm-Message-State: AOAM530cBBZik161E9i2RA1EQDJdzqZ5nTrihUNLSQMwLO21n7BX+7Hx M6HNmW1g90AbnY9c8uS7EeQ= X-Google-Smtp-Source: ABdhPJw2h/0NTXv6NVb6z7lI1fpmPgf+OPI1kMOsbC5at+dcJn4rbGQPAamCC+wGLzVY/QZOICVcXA== X-Received: by 2002:a17:90b:3ec6:: with SMTP id rm6mr2929011pjb.41.1637809747049; Wed, 24 Nov 2021 19:09:07 -0800 (PST) Received: from localhost.localdomain (199.19.111.227.16clouds.com. [199.19.111.227]) by smtp.gmail.com with ESMTPSA id g9sm1146209pfc.182.2021.11.24.19.09.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Nov 2021 19:09:06 -0800 (PST) From: Artem Lapkin X-Google-Original-From: Artem Lapkin 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 Message-Id: <20211125030859.2896352-1-art@khadas.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.37 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.2 at phobos.denx.de X-Virus-Status: Clean 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 Reviewed-by: Simon Glass --- 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) {