From patchwork Wed Aug 14 11:00:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 819127 Delivered-To: patch@linaro.org Received: by 2002:adf:cd01:0:b0:367:895a:4699 with SMTP id w1csp646195wrm; Wed, 14 Aug 2024 04:04:59 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWiQ2toW+johKqhmLs6JprDrDlpxXKDusPLpz0svZW89gnAfGZ7XhKR/TVwFKUFWQvmt2eiwFSFlKQqXy0Jlj0V X-Google-Smtp-Source: AGHT+IHm9uQ2c86eyiFDK50f2zOaO9r28KZpDa6+iv0Nve+9/vZUVOTMZrHDuBBDkglbgTHnDF1t X-Received: by 2002:a17:907:f765:b0:a7a:c256:3cf with SMTP id a640c23a62f3a-a8366d38ec6mr190055066b.24.1723633498941; Wed, 14 Aug 2024 04:04:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723633498; cv=none; d=google.com; s=arc-20160816; b=y31yZ9DREDSFEG7zmBBQRwO5e2LSspkB0wBwDff6GiIdd6WvyjmzBgmP81fWV0U1bU 1l7PYp1/Cg+HG9WvoMO7o/9tY28TIKajbwJINHtPwsDvSogKnZHvW2rssFccY3tCIR+Q f3tOVLl3FxZVsqYDQzwLnhr45QM9aCATjdvpScJFimBV9k19zvSY620WbN5lXqPksYzw EvQmhd4YdXKp6az5PS85PIvns30PoYO8c562+k5bYOity6MQbiM6pVEMUQGhvUw8peMe FchXb/G8+pu5efJtglVbb0yeXaMyis0YQoY3uf+ZIqre6R/LJ/pun8DHpr5bYZqom4il PwAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=XZE+y8NzmQ+RrELtMf8x6qLKw/FE1EHqupzc2EVQeWM=; fh=w4WyT9xL7ErtT1TeetrD/m0Y0mAgjnERgxacGUpGjSg=; b=o/62i5xeB/NakEDGRMWVXBdwPQ5L9jHIG1QE+lRML5xWQThN19vsQRwwlt2BIHROc/ 8lbQWLj7IYP0joeRBWcDv601tTq8FWoP6A8TnOKgOto+L0e5NBWQd4RlX3qcfjiP2MZ7 jZqc+ihE8QJc3MxFdvHUgsWU4pnoyjyf5hxFfqspVtNgrV95IHJ8Job5oZW75KvdrnLe Rlvz4vzq6gfNYsyX00+hxTh5D6mOA7lh+b1CpP+2rWjMz3vUyS91M76K3urOJClfwxhn LN1OJ5e+BSu+iR/tbE1vPCshP7oAPg8ixGxjWuhBe9VmzIJUiczypGnrGkc2E9eXX66D l4dA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id a640c23a62f3a-a80f41ce3b7si193530666b.1043.2024.08.14.04.04.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Aug 2024 04:04:58 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 02945889FC; Wed, 14 Aug 2024 13:02:37 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 2644588815; Wed, 14 Aug 2024 13:02:36 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, SPF_HELO_NONE,SPF_SOFTFAIL,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id DAE8D88A7E for ; Wed, 14 Aug 2024 13:02:33 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sughosh.ganu@linaro.org Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4B8B9DA7; Wed, 14 Aug 2024 04:02:59 -0700 (PDT) Received: from a079122.blr.arm.com (a079122.arm.com [10.162.17.48]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CC3953F58B; Wed, 14 Aug 2024 04:02:28 -0700 (PDT) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Heinrich Schuchardt , Simon Glass , Marek Vasut , Tom Rini , Mark Kettenis , Michal Simek , Patrick DELAUNAY , Patrice CHOTARD , Huan Wang , Angelo Dureghello , Daniel Schwierzeck , Thomas Chou , Rick Chen , Max Filippov , Sughosh Ganu Subject: [PATCH v2 24/32] zynq: lmb: do not add to lmb map before relocation Date: Wed, 14 Aug 2024 16:30:01 +0530 Message-Id: <20240814110009.45310-25-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240814110009.45310-1-sughosh.ganu@linaro.org> References: <20240814110009.45310-1-sughosh.ganu@linaro.org> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean The LMB memory is typically not needed very early in the platform's boot. Do not add memory to the LMB map before relocation. Reservation of common areas and adding of memory is done after relocation. Signed-off-by: Sughosh Ganu --- Changes since V1: None board/xilinx/common/board.c | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/board/xilinx/common/board.c b/board/xilinx/common/board.c index f04c92a70f..3440402ab4 100644 --- a/board/xilinx/common/board.c +++ b/board/xilinx/common/board.c @@ -12,7 +12,6 @@ #include #include #include -#include #include #include #include @@ -665,36 +664,6 @@ int embedded_dtb_select(void) } #endif -#if IS_ENABLED(CONFIG_LMB) - -#ifndef MMU_SECTION_SIZE -#define MMU_SECTION_SIZE (1 * 1024 * 1024) -#endif - -phys_addr_t board_get_usable_ram_top(phys_size_t total_size) -{ - phys_size_t size; - phys_addr_t reg; - - if (!total_size) - return gd->ram_top; - - if (!IS_ALIGNED((ulong)gd->fdt_blob, 0x8)) - panic("Not 64bit aligned DT location: %p\n", gd->fdt_blob); - - /* found enough not-reserved memory to relocated U-Boot */ - lmb_add(gd->ram_base, gd->ram_size); - boot_fdt_add_mem_rsv_regions((void *)gd->fdt_blob); - size = ALIGN(CONFIG_SYS_MALLOC_LEN + total_size, MMU_SECTION_SIZE); - reg = lmb_alloc(size, MMU_SECTION_SIZE); - - if (!reg) - reg = gd->ram_top - size; - - return reg + size; -} -#endif - #ifdef CONFIG_OF_BOARD_SETUP #define MAX_RAND_SIZE 8 int ft_board_setup(void *blob, struct bd_info *bd)