From patchwork Tue Mar 15 05:21:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jian-Hong Pan X-Patchwork-Id: 1605579 X-Patchwork-Delegate: pbrobinson@gmail.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=endlessos.org header.i=@endlessos.org header.a=rsa-sha256 header.s=google header.b=mcWLP1gn; dkim-atps=neutral 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=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4KHs3q0G78z9sDX for ; Tue, 15 Mar 2022 22:43:17 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 274A08365D; Tue, 15 Mar 2022 12:43:08 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=endlessos.org 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=endlessos.org header.i=@endlessos.org header.b="mcWLP1gn"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 43CAA839AA; Tue, 15 Mar 2022 06:23:00 +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,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) (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 72B56836A9 for ; Tue, 15 Mar 2022 06:22:55 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=endlessos.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jhp@endlessos.org Received: by mail-pj1-x102f.google.com with SMTP id kx6-20020a17090b228600b001bf859159bfso1338357pjb.1 for ; Mon, 14 Mar 2022 22:22:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=endlessos.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=0wQd1n1l/Y7+QK7SRzXbrQLaL9kx2yMBllBJqMASc4c=; b=mcWLP1gnGxZDDemygZKmXksOwodjIsx8kzva4ipVOr7rmh2VZ42jzQTAMotENc0pNW 8DLOAM5wd1o5RdWAdqdsGlWo60gXdvp8M/tZclvuOM8nLHDTp5naOhHTVPxsEUrvn9jj E4zRiGgbKrB29usf1K+4oYsaVTnUCUh1AScFQdgUAoWWQqJQT12OzbinNMpzpU6d8KTv U2PFj3FLHfoDxjnsa4qbYzxvhnfRCWToKvqDZ/OcJutcfdWGgAvtUnVJZFx520Jp1nD1 C7060WW0g7C1jGPEi5436ZrXdmSzM+fWpGVnmAB0z4oBHlDRRIUbFKWXW4QYgpk0/Ipt rldQ== 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=0wQd1n1l/Y7+QK7SRzXbrQLaL9kx2yMBllBJqMASc4c=; b=Tcm0Z2EjUsdo3QZ+St3nmJsuYIQH536ABrfsUqv5K9OSIa/9ZvQsGOLauylq4gRScl ILVk05FGI/xikC8m9gWF5zkJOIWfWPbAnBxx5L7+Dl3WIcTxm2dOlCTxTS02y6UEvpV0 E5XnTsK4g5duRNrvKIZaLRqNmwQ+z59vWK1kIqRGEW9zXGY66Bk4o88VQY1pBoEHZ0qd Z074hQ9G+XkRTeBCF61j8zYnsdA998J/4zNiL3RBQuD2bnhCz9m+CVY+TPEqOs6kNPqr u5DY2sAVcnQb1Gpkop4bu91Ir+EYOBACBkT4mMnkff2pU2fV5oxS5sAbf0I6ZKrupp9X DNHQ== X-Gm-Message-State: AOAM530AP/ajs4du8xsqwQjRMZf+g5mHbBMWAy3LPpJyuEeU5BD2eCGN ai8yGAj/A88rcahLwU3eUk9ACV4i4Aelqg== X-Google-Smtp-Source: ABdhPJwhmJRIbwEAGcz68itFL1pd6SeNgLrtq2pDjvsA2aJGGohyescw3adyHgPFd4Soj8TVhbkv2w== X-Received: by 2002:a17:902:8549:b0:153:563a:39a1 with SMTP id d9-20020a170902854900b00153563a39a1mr11444385plo.21.1647321773766; Mon, 14 Mar 2022 22:22:53 -0700 (PDT) Received: from starnight.endlessm-sf.com (123-204-46-122.static.seed.net.tw. [123.204.46.122]) by smtp.googlemail.com with ESMTPSA id l18-20020a056a00141200b004f75395b2cesm22288849pfu.150.2022.03.14.22.22.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Mar 2022 22:22:53 -0700 (PDT) From: Jian-Hong Pan To: Matthias Brugger Cc: u-boot@lists.denx.de, linux@endlessos.org, Jian-Hong Pan Subject: [PATCH] rpi: Redefine memory offsets for increased kernel image size Date: Tue, 15 Mar 2022 13:21:16 +0800 Message-Id: <20220315052115.12956-1-jhp@endlessos.org> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-Mailman-Approved-At: Tue, 15 Mar 2022 12:43:06 +0100 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.5 at phobos.denx.de X-Virus-Status: Clean The uncompressed kernel image size increases along the kernel's development. It might be more than 36MB, which will overlap the script address, even the device tree blob and initial RAM disk memory area. This patch extends the reserved memory of kernel image up to 0x02900000 permits fairly large (roughly 40.5M) kernels. Also, moves the other offset addresses. Buglink: https://lists.denx.de/pipermail/u-boot/2021-February/439578.html Signed-off-by: Jian-Hong Pan --- include/configs/rpi.h | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/include/configs/rpi.h b/include/configs/rpi.h index d5e064fb37..166408d3f8 100644 --- a/include/configs/rpi.h +++ b/include/configs/rpi.h @@ -105,33 +105,34 @@ * For Aarch64, the kernel image is uncompressed and must be loaded at * text_offset bytes (specified in the header of the Image) into a 2MB * boundary. The 'booti' command relocates the image if necessary. Linux uses - * a default text_offset of 0x80000. In summary, loading at 0x80000 - * satisfies all these constraints and reserving memory up to 0x02400000 - * permits fairly large (roughly 36M) kernels. + * a default text_offset of 0x80000. In some cases, it may be relocated to + * offset 0x200000. In summary, loading at 0x80000 satisfies all these + * constraints and reserving memory up to 0x02900000 permits fairly large + * (roughly 40.5M) kernels. * * scriptaddr and pxefile_addr_r can be pretty much anywhere that doesn't * conflict with something else. Reserving 1M for each of them at - * 0x02400000-0x02500000 and 0x02500000-0x02600000 should be plenty. + * 0x02900000-0x02A00000 and 0x02A00000-0x02B00000 should be plenty. * * On ARM, both the DTB and any possible initrd must be loaded such that they * fit inside the lowmem mapping in Linux. In practice, this usually means not * more than ~700M away from the start of the kernel image but this number can * be larger OR smaller depending on e.g. the 'vmalloc=xxxM' command line * parameter given to the kernel. So reserving memory from low to high - * satisfies this constraint again. Reserving 1M at 0x02600000-0x02700000 for - * the DTB leaves rest of the free RAM to the initrd starting at 0x02700000. + * satisfies this constraint again. Reserving 1M at 0x02B00000-0x02C00000 for + * the DTB leaves rest of the free RAM to the initrd starting at 0x02C00000. * Even with the smallest possible CPU-GPU memory split of the CPU getting - * only 64M, the remaining 25M starting at 0x02700000 should allow quite + * only 64M, the remaining 20M starting at 0x02C00000 should allow quite * large initrds before they start colliding with U-Boot. */ #define ENV_MEM_LAYOUT_SETTINGS \ "fdt_high=" FDT_HIGH "\0" \ "initrd_high=" INITRD_HIGH "\0" \ "kernel_addr_r=0x00080000\0" \ - "scriptaddr=0x02400000\0" \ - "pxefile_addr_r=0x02500000\0" \ - "fdt_addr_r=0x02600000\0" \ - "ramdisk_addr_r=0x02700000\0" + "scriptaddr=0x02900000\0" \ + "pxefile_addr_r=0x02A00000\0" \ + "fdt_addr_r=0x02B00000\0" \ + "ramdisk_addr_r=0x02C00000\0" #if CONFIG_IS_ENABLED(CMD_MMC) #define BOOT_TARGET_MMC(func) \