From patchwork Tue Oct 3 02:29:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahisa Kojima X-Patchwork-Id: 728712 Delivered-To: patch@linaro.org Received: by 2002:a5d:60c8:0:b0:31d:da82:a3b4 with SMTP id x8csp1941535wrt; Mon, 2 Oct 2023 19:31:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEbcnsvLGBU5Vy2ZlM3QV0wQC0tskyIYJQrV1t41rhFlUSwAp9ctVSRbti6fco9ful99Gov X-Received: by 2002:adf:e806:0:b0:314:15b7:20a5 with SMTP id o6-20020adfe806000000b0031415b720a5mr11489379wrm.54.1696300271180; Mon, 02 Oct 2023 19:31:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696300271; cv=none; d=google.com; s=arc-20160816; b=BHpOv7dY+B2zE7rb6cenkKWLD4PR3Q9gEfv9nQMWFrQ7efM8Nm7OehbMCtWk20EFiv o0L1ZwOGYAhwhgCzN4LKifRHMtHjibefKm4H3h/W72Sv/pnZAg/BmhH75XZ9QX1R9rH+ OWXlFZCn+fwEfU5YH2x3dqUSIxQNZ9m8+N+mFs8DLgrFr04tDFNM1o3nhV+9oEbKo+gK hW4uzaZhka/k9yZMDgeKnJVVN602kVgnD1frA2gExFx5CcLO2sjFRbq1+q3uuBbXhegI upcMNUNWxhhDlttNuhB5l9laG8Zy7LdtunHyMm9FqCTjLR00g6k/P8GnGz8Y1nbJOoI6 GR0A== 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:message-id:date:subject:cc:to:from:dkim-signature; bh=IwZU4tN2gg3ctDPxgMuveMtsbUcHWw+ysYfHoZZu/DM=; fh=VNe+QE+Dan6jsHHJjeeKHWUJWH+nnCHMUN3h1SA/GfA=; b=KHcWJGb5SM1t02LT0IuBLjQKQNCtOrqiRCHDumrLTc9YkkidQ2esmZFhkY0MLQtZqR vb53F3AZGD9PDV4fxLEBSIlemH1Ly9IRK/xiYni7suNvydxa5yS3hTrK8eQQzmTxdxbX uDxSK/imHaPZW6YRYME06JSLhacA/84NTjJb6wk7Cmgr1oSjMNRdADpw2qN+OqArOI1l B8lqecmMYmwxdKtUtNPgAvjy/lTbp36jx4g/AOw1QEH+qJ2B1j+ndJWymLHNpN5DrT8r qiXn9gshba+ftGKQcYYlEBA+PqLVH8EMBKbjdA+HhN1NMclEkdNMkplFPsTqoIwkLAir KS0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VtfJLGOj; 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=pass (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 j2-20020a056000124200b00325962a4920si174598wrx.192.2023.10.02.19.31.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 19:31:11 -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; dkim=pass header.i=@linaro.org header.s=google header.b=VtfJLGOj; 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=pass (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 0583386DA7; Tue, 3 Oct 2023 04:31:10 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.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=linaro.org header.i=@linaro.org header.b="VtfJLGOj"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4F55386DBC; Tue, 3 Oct 2023 04:31:09 +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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ot1-x32c.google.com (mail-ot1-x32c.google.com [IPv6:2607:f8b0:4864:20::32c]) (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 F1A5386D94 for ; Tue, 3 Oct 2023 04:31:06 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=masahisa.kojima@linaro.org Received: by mail-ot1-x32c.google.com with SMTP id 46e09a7af769-6c67060fdfaso264748a34.2 for ; Mon, 02 Oct 2023 19:31:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696300265; x=1696905065; darn=lists.denx.de; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=IwZU4tN2gg3ctDPxgMuveMtsbUcHWw+ysYfHoZZu/DM=; b=VtfJLGOj1CJ6vyZENpIV/btBtzOFyh+FggZ3BQNBtepNHQL0VsDkmQPf+rj614iY+4 ElTsqqqrHCBmqkXwVau3AFeLnwupvwEYF80H6RyhyEsC02Wl03r+FvjwB44uR+cDhPdR SDpPq7wqeqCg/ci+8E0P30Lu+ZsvQAEk5Zz5eZ43kSL0N7+uIXDfXig4anT45BEr5UDl cxw5cbDVswfUcn1h5SRZNa1vPCUxs+D7atn/BJSZNzQKuFlHa6NGweMK0c6EiORnL9nT i8Awsq+r9g1Fm+3mAyKfKZbxWV3z2FFKciztgf2GhA+a70hyEMTN2fFuixzEWK75n8Zm CH6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696300265; x=1696905065; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=IwZU4tN2gg3ctDPxgMuveMtsbUcHWw+ysYfHoZZu/DM=; b=urZ03VMZvWustuPFJ9mvIVbPVCDU2ZrChUShZeiBfWcPi0U/YKIOkmPaJrDrPMc6Op L4frIbmsjXRwK1D6FwSsp0zrF/b3lTyeWxA3S44s/O1vI55BLchx7Uk5JY6JLk7tFkJb XaLz++k0EakVNSQF5wKmkvJYLkxzRIkHJY8pwNzsrhWLFx/Y0oZupo7sQXICR0zCaEFU iiAvkmtdI1TDgxFxG5p4LAYVv7HLB5D37Y4RNIMZqw1o2WdWoUrbpvnjcDvrHtQ3ni2l pcVWTo88QibX3vZ8ODT1tNmALJaas67gtmABtdXuUlgPpGEHrqLA9VBB6s514tm3omW4 guRg== X-Gm-Message-State: AOJu0Yxc0o1i8yVktJbT3VOJ2VChy/PZeimp6/1DfhWT4SY7oTMZuz7t zC1SdIPNoZ/DVVHOsf8e0iZr2KGpHoYHLGHtKdc= X-Received: by 2002:a54:4714:0:b0:3ae:a81:55a9 with SMTP id k20-20020a544714000000b003ae0a8155a9mr13251153oik.24.1696300265196; Mon, 02 Oct 2023 19:31:05 -0700 (PDT) Received: from localhost ([164.70.16.189]) by smtp.gmail.com with ESMTPSA id 14-20020a17090a000e00b00273744e6eccsm188091pja.12.2023.10.02.19.31.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 19:31:04 -0700 (PDT) From: Masahisa Kojima To: u-boot@lists.denx.de Cc: Jassi Brar , Ryosuke Saito , Ilias Apalodimas , Masahisa Kojima Subject: [PATCH] board: synquacer: set actual gd->ram_top and gd->ram_size Date: Tue, 3 Oct 2023 11:29:57 +0900 Message-Id: <20231003022957.1743493-1-masahisa.kojima@linaro.org> X-Mailer: git-send-email 2.34.1 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 Current gd->ram_size and gd->ram_top reflect only the first DRAM bank even if the SynQuacer Developerbox could have up to three DRAM banks. With the commit 06d514d77c37 ("lmb: consider EFI memory map"), the first DRAM bank indicates <4GB address, so whole >4GB memory is marked as EFI_BOOT_SERVICES_DATA and it results that U-Boot can not access >4GB memory. Since 64-bits DRAM address is fully available on the SynQuacer Developerbox, let's set the installed DIMM information to gd->ram_top and gd->ram_size. Signed-off-by: Masahisa Kojima Acked-by: Jassi Brar --- board/socionext/developerbox/developerbox.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/board/socionext/developerbox/developerbox.c b/board/socionext/developerbox/developerbox.c index 204e5a41a5..9585944d80 100644 --- a/board/socionext/developerbox/developerbox.c +++ b/board/socionext/developerbox/developerbox.c @@ -145,13 +145,27 @@ int dram_init(void) { struct draminfo *synquacer_draminfo = (void *)SQ_DRAMINFO_BASE; struct draminfo_entry *ent = synquacer_draminfo->entry; + unsigned long size = 0; + int i; + + for (i = 0; i < synquacer_draminfo->nr_regions; i++) + size += ent[i].size; - gd->ram_size = ent[0].size; + gd->ram_size = size; gd->ram_base = ent[0].base; return 0; } +phys_addr_t board_get_usable_ram_top(phys_size_t total_size) +{ + struct draminfo *synquacer_draminfo = (void *)SQ_DRAMINFO_BASE; + struct draminfo_entry *ent = synquacer_draminfo->entry; + + return ent[synquacer_draminfo->nr_regions - 1].base + + ent[synquacer_draminfo->nr_regions - 1].size; +} + int dram_init_banksize(void) { struct draminfo *synquacer_draminfo = (void *)SQ_DRAMINFO_BASE;