From mboxrd@z Thu Jan 1 00:00:00 1970 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 8A0D7ECAAD5 for ; Fri, 9 Sep 2022 15:33:18 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 311D784B3D; Fri, 9 Sep 2022 17:33:10 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.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=kernel.org header.i=@kernel.org header.b="Bh8X/wnc"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B2A2D84B65; Fri, 9 Sep 2022 17:33:04 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D602A847F4 for ; Fri, 9 Sep 2022 17:33:00 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9EEC26202C; Fri, 9 Sep 2022 15:32:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E402FC433D6; Fri, 9 Sep 2022 15:32:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1662737579; bh=LBD5Ih2QgXv9QySv5PBn11+kkn1cdtPbNykXrsBZq6Y=; h=From:To:Subject:Date:From; b=Bh8X/wnc83lX4Gdn2d/gc10K++E+9bXbWJ7UqYRMWZ7CZliC4llGK+RaQuFhGQLUr k46RcBJnqu5h7YOek9KlXyO3ietwYbUIW9z1nMpW/XuAOVRPHg5jl6q4RLvfDJoq1W saQC3rEf/eo3LekNPuCmUvpbD2Rw4r7NRDv7tgIJS4UyeZT7OJ1CQno5D3oKtW8gkC /ShXlFnK3KNu4HWzMmPnDGtKOejKCYTDQyUP+SKKSX4X7QZIfAQ5fQSlf5ewX0Sp2o C2NElqxx8WJpfBuGhZlHe48b6OG+MbOWbu19aX/CJhoe8BcFyC9eyPZKmBQKfUlJnm 9kAhgeMyh1Tmg== Received: by pali.im (Postfix) id 07CDB7F4; Fri, 9 Sep 2022 17:32:56 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: u-boot@lists.denx.de, =?UTF-8?q?Marek=20Beh=C3=BAn?= , Peng Fan , Tom Rini Subject: [PATCH 0/9] Support for 4 GB DDR modules for 32-bit U-Boot builds Date: Fri, 9 Sep 2022 17:32:37 +0200 Message-Id: <20220909153246.8455-1-pali@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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.6 at phobos.denx.de X-Virus-Status: Clean This patch series fixes U-Boot code to correctly handle RAM size larger than 2 GB and then fixes fsl ddr driver to do not crash U-Boot when 4 GB DDR module is detected when U-Boot operates in 32-bit mode (as opposite of the 36-bit mode). With this patch series it is possible to boot 32-bit U-Boot with 4 GB SODIMM DDR3 module without crashes. U-Boot will still use just CONFIG_MAX_MEM_MAPPED amount of RAM, but it is better than crashing due to the truncating of 4GB value to 32-bit number (which is zero). I tested this patch series on powerpc P2020 based board but only with U-Boot v2022.04 because U-Boot master branch is still broken on P2020. Pali Rohár (9): common/memsize.c: Fix get_effective_memsize() to always check for CONFIG_MAX_MEM_MAPPED common/memsize.c: Fix get_effective_memsize() to check for overflow board_f: Fix types for board_get_usable_ram_top() board_f: Fix printing gd->ram_size and gd->ram_top ddr: fsl: Fix checking for maximal mappable memory ddr: fsl: Fix fsl_ddr_sdram_size() for 4GB modules with 32-bit phys_size_t ddr: fsl: Allow to detect 4 GB DDR modules in 32-bit mode ddr: fsl: Fix re-align of verbose DRAM information for non-SPL builds powerpc/mpc85xx: Explain TLB unmapped memory message arch/arm/mach-imx/imx8m/soc.c | 2 +- arch/arm/mach-mvebu/arm64-common.c | 2 +- arch/arm/mach-rockchip/sdram.c | 2 +- arch/arm/mach-stm32mp/dram_init.c | 2 +- arch/arm/mach-sunxi/board.c | 2 +- arch/arm/mach-tegra/board2.c | 2 +- arch/mips/mach-jz47xx/jz4780/jz4780.c | 2 +- arch/mips/mach-octeon/dram.c | 2 +- arch/powerpc/cpu/mpc85xx/tlb.c | 2 +- arch/riscv/cpu/fu540/dram.c | 2 +- arch/riscv/cpu/fu740/dram.c | 2 +- arch/riscv/cpu/generic/dram.c | 2 +- arch/x86/cpu/broadwell/sdram.c | 2 +- arch/x86/cpu/coreboot/sdram.c | 2 +- arch/x86/cpu/efi/payload.c | 2 +- arch/x86/cpu/efi/sdram.c | 2 +- arch/x86/cpu/intel_common/mrc.c | 4 ++-- arch/x86/cpu/ivybridge/sdram.c | 2 +- arch/x86/cpu/qemu/dram.c | 2 +- arch/x86/cpu/quark/dram.c | 2 +- arch/x86/cpu/slimbootloader/sdram.c | 2 +- arch/x86/cpu/tangier/sdram.c | 2 +- arch/x86/include/asm/mrc_common.h | 2 +- arch/x86/include/asm/u-boot-x86.h | 2 +- arch/x86/lib/fsp1/fsp_dram.c | 2 +- arch/x86/lib/fsp2/fsp_dram.c | 2 +- board/broadcom/bcmns3/ns3.c | 2 +- board/imgtec/boston/ddr.c | 2 +- board/menlo/m53menlo/m53menlo.c | 2 +- board/raspberrypi/rpi/rpi.c | 2 +- board/ti/am65x/evm.c | 2 +- board/ti/j721e/evm.c | 2 +- board/ti/j721s2/evm.c | 2 +- board/xilinx/zynqmp/zynqmp.c | 2 +- common/board_f.c | 6 ++--- common/memsize.c | 20 ++++++++++++---- drivers/ddr/fsl/lc_common_dimm_params.c | 3 +++ drivers/ddr/fsl/main.c | 31 ++++++++++++++++++++----- drivers/video/fsl_dcu_fb.c | 2 +- include/init.h | 2 +- 40 files changed, 84 insertions(+), 50 deletions(-) -- 2.20.1