All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anup Patel <apatel@ventanamicro.com>
To: opensbi@lists.infradead.org
Subject: [PATCH 2/5] platform: generic: Fine tune fw_platform_calculate_heap_size()
Date: Mon, 11 Dec 2023 23:37:35 +0530	[thread overview]
Message-ID: <20231211180738.891727-3-apatel@ventanamicro.com> (raw)
In-Reply-To: <20231211180738.891727-1-apatel@ventanamicro.com>

Let's use SBI_TLB_INFO_SIZE instead of hard-coded 0x40 in
fw_platform_calculate_heap_size() to fine tune the heap size
required for per-hart TLB fifos.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
---
 platform/generic/platform.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/platform/generic/platform.c b/platform/generic/platform.c
index 08ae92a..8507227 100644
--- a/platform/generic/platform.c
+++ b/platform/generic/platform.c
@@ -16,6 +16,7 @@
 #include <sbi/sbi_platform.h>
 #include <sbi/sbi_string.h>
 #include <sbi/sbi_system.h>
+#include <sbi/sbi_tlb.h>
 #include <sbi_utils/fdt/fdt_domain.h>
 #include <sbi_utils/fdt/fdt_fixup.h>
 #include <sbi_utils/fdt/fdt_helper.h>
@@ -63,7 +64,7 @@ static u32 fw_platform_calculate_heap_size(u32 hart_count)
 	heap_size = SBI_PLATFORM_DEFAULT_HEAP_SIZE(hart_count);
 
 	/* For TLB fifo */
-	heap_size += 0x40 * (hart_count) * (hart_count);
+	heap_size += SBI_TLB_INFO_SIZE * (hart_count) * (hart_count);
 
 	return BIT_ALIGN(heap_size, HEAP_BASE_ALIGN);
 }
-- 
2.34.1



  parent reply	other threads:[~2023-12-11 18:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-11 18:07 [PATCH 0/5] Assorted improvements Anup Patel
2023-12-11 18:07 ` [PATCH 1/5] lib: sbi_tlb: Reduce size of struct sbi_tlb_info Anup Patel
2023-12-11 18:16   ` Samuel Holland
2023-12-12  8:58     ` Anup Patel
2023-12-11 18:07 ` Anup Patel [this message]
2023-12-11 18:07 ` [PATCH 3/5] lib: utils/irqchip: Add shared MMIO region for PLIC in root domain Anup Patel
2023-12-11 18:07 ` [PATCH 4/5] lib: sbi: Allow ecall handlers to directly update register state Anup Patel
2023-12-11 18:07 ` [PATCH 5/5] lib: sbi: Remove the SBI_ETRAP error code Anup Patel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231211180738.891727-3-apatel@ventanamicro.com \
    --to=apatel@ventanamicro.com \
    --cc=opensbi@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.