Message ID | 20231104203753.1579217-5-seanga2@gmail.com |
---|---|
State | Accepted |
Commit | cdc0434ac06ad5cc0cb8361dcd5d4ab72a8db0c7 |
Delegated to: | Dario Binacchi |
Headers | show
Return-Path: <u-boot-bounces@lists.denx.de> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=aM7upb/1; dkim-atps=neutral Authentication-Results: legolas.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=patchwork.ozlabs.org) 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 ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SN8Zl4n64z1yQs for <incoming@patchwork.ozlabs.org>; Sun, 5 Nov 2023 07:38:23 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 97F1B86F97; Sat, 4 Nov 2023 21:38: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=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="aM7upb/1"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4E5818704D; Sat, 4 Nov 2023 21:38:08 +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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-qk1-x731.google.com (mail-qk1-x731.google.com [IPv6:2607:f8b0:4864:20::731]) (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 DCC948701C for <u-boot@lists.denx.de>; Sat, 4 Nov 2023 21:38:03 +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=seanga2@gmail.com Received: by mail-qk1-x731.google.com with SMTP id af79cd13be357-778a108ae49so346675385a.0 for <u-boot@lists.denx.de>; Sat, 04 Nov 2023 13:38:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699130281; x=1699735081; 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=eBkT22D95T+d0QN77dhXpJpLEzKcUA24ygj4yY8Vugc=; b=aM7upb/1S8xtKpYtq5T/S525A3Szg+U0xAKHBwUf7w35aIfGWzONleyWvoLCFrlUFP OMpTKa48hpSjRNUpF6HkzCNfmi99K2fXl44TH/xwVDtzjL+ShIWvFBYCujKd+W3A3W/4 iQzpb+abEL70tnsuU8mPpW887thBU9iKc9I0WPej/MGh5/1zxuPsyCkEOQ0HieYfTFGX XOuEmwexql9PZir1mu11oqhOePW+1qCpqMrCO8d82M6Fa2GBulLLJ9CqJyOg1aHGADER akWE0zDcdhMDS/U1tpKHYFvAq4LcealFj8PEeR7k9cH5Aftq+sJqbPfUBzcKImrPELvy dvMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699130281; x=1699735081; 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=eBkT22D95T+d0QN77dhXpJpLEzKcUA24ygj4yY8Vugc=; b=oVFt9+aFJhSZVRH6gtcE1nD6c1Mdpug0eypFIUjWKcBw2sFbGa0FTm+2f9XAbeQc7P vTnFRhynnXVQPqxHo6hr5OHDPv+sS6qBi770heKqIercjEjMshYR2v3e2Lf1BhdKjolZ LzNlbkHW+dqndN/WWWCz7E9X6dpZnbq9FVp8Ztv3R9R6gkk8WADh4SjuQR2kDsHj7dCt uZX9h5atYntx+002liU0btO1WalQpGWJa55poBN94gNAAwnYSulsRDJAJ+8qeSk4xngi s/F3FG36n48BZeZ3xI72VdVW4kz7O2cSM8Owc+pIlt+kJM5FoTPO/guWBznr8oAukoWe wJ0Q== X-Gm-Message-State: AOJu0YxX1XmXIKoKr1brg8/ljw9tRFjIyeIeMaapidQWpdDfJJyzdL3P JFSM2ACwIVgPSQPu6+hr+kpKrr+eiAW42w== X-Google-Smtp-Source: AGHT+IHIYkNdlz1l8HqfRfoUeqj2lU8TBsblmYCWuPa1neflQxUzQZ/ivhEAgft+h8Y/UgFzXiNEoQ== X-Received: by 2002:a05:620a:1790:b0:775:92ac:a3d6 with SMTP id ay16-20020a05620a179000b0077592aca3d6mr9856497qkb.14.1699130281087; Sat, 04 Nov 2023 13:38:01 -0700 (PDT) Received: from localhost (pool-108-48-157-169.washdc.fios.verizon.net. [108.48.157.169]) by smtp.gmail.com with UTF8SMTPSA id x3-20020ae9e643000000b00767d8e12ce3sm1834177qkl.49.2023.11.04.13.38.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 04 Nov 2023 13:38:00 -0700 (PDT) From: Sean Anderson <seanga2@gmail.com> To: u-boot@lists.denx.de, Dario Binacchi <dario.binacchi@amarulasolutions.com>, Michael Trimarchi <michael@amarulasolutions.com> Cc: Tom Rini <trini@konsulko.com>, Sean Anderson <seanga2@gmail.com> Subject: [PATCH v2 04/15] nand: spl_loaders: Only read enough pages to load the image Date: Sat, 4 Nov 2023 16:37:42 -0400 Message-Id: <20231104203753.1579217-5-seanga2@gmail.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20231104203753.1579217-1-seanga2@gmail.com> References: <20231104203753.1579217-1-seanga2@gmail.com> 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 <u-boot.lists.denx.de> List-Unsubscribe: <https://lists.denx.de/options/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=unsubscribe> List-Archive: <https://lists.denx.de/pipermail/u-boot/> List-Post: <mailto:u-boot@lists.denx.de> List-Help: <mailto:u-boot-request@lists.denx.de?subject=help> List-Subscribe: <https://lists.denx.de/listinfo/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=subscribe> Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" <u-boot-bounces@lists.denx.de> X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean |
Series |
nand: Add sandbox tests
|
expand
|
diff --git a/drivers/mtd/nand/raw/nand_spl_loaders.c b/drivers/mtd/nand/raw/nand_spl_loaders.c index 35d6b1d6c0c..db4213ea3dc 100644 --- a/drivers/mtd/nand/raw/nand_spl_loaders.c +++ b/drivers/mtd/nand/raw/nand_spl_loaders.c @@ -12,8 +12,11 @@ int nand_spl_load_image(uint32_t offs, unsigned int size, void *dst) while (block <= lastblock) { if (!nand_is_bad_block(block)) { /* Skip bad blocks */ - while (page < SYS_NAND_BLOCK_PAGES) { + while (size && page < SYS_NAND_BLOCK_PAGES) { nand_read_page(block, page, dst); + + size -= min(size, CONFIG_SYS_NAND_PAGE_SIZE - + page_offset); /* * When offs is not aligned to page address the * extra offset is copied to dst as well. Copy