From: Yu-Chien Peter Lin <peter.lin@sifive.com>
To: opensbi@lists.infradead.org
Cc: greentime.hu@sifive.com,
Yu-Chien Peter Lin <peter.lin@sifive.com>,
zong.li@sifive.com
Subject: [RFC PATCH 2/7] include: sbi: sbi_platform: add reserved_pmp_count field
Date: Fri, 15 Aug 2025 18:01:10 +0800 [thread overview]
Message-ID: <20250815100116.27776-3-peter.lin@sifive.com> (raw)
In-Reply-To: <20250815100116.27776-1-peter.lin@sifive.com>
Add reserved_pmp_count field to struct sbi_platform to specify the
configurable number of high-priority PMP entries reserved.
Signed-off-by: Yu-Chien Peter Lin <peter.lin@sifive.com>
---
include/sbi/sbi_platform.h | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/include/sbi/sbi_platform.h b/include/sbi/sbi_platform.h
index c6d30080..e2bf9b77 100644
--- a/include/sbi/sbi_platform.h
+++ b/include/sbi/sbi_platform.h
@@ -31,16 +31,18 @@
#define SBI_PLATFORM_HART_STACK_SIZE_OFFSET (0x54)
/** Offset of heap_size in struct sbi_platform */
#define SBI_PLATFORM_HEAP_SIZE_OFFSET (0x58)
+/** Offset of reserved PMP entry count in struct sbi_platform */
+#define SBI_PLATFORM_RESERVED_PMP_COUNT_OFFSET (0x5c)
/** Offset of reserved in struct sbi_platform */
-#define SBI_PLATFORM_RESERVED_OFFSET (0x5c)
+#define SBI_PLATFORM_RESERVED_OFFSET (0x60)
/** Offset of platform_ops_addr in struct sbi_platform */
-#define SBI_PLATFORM_OPS_OFFSET (0x60)
+#define SBI_PLATFORM_OPS_OFFSET (0x68)
/** Offset of firmware_context in struct sbi_platform */
-#define SBI_PLATFORM_FIRMWARE_CONTEXT_OFFSET (0x60 + __SIZEOF_POINTER__)
+#define SBI_PLATFORM_FIRMWARE_CONTEXT_OFFSET (0x68 + __SIZEOF_POINTER__)
/** Offset of hart_index2id in struct sbi_platform */
-#define SBI_PLATFORM_HART_INDEX2ID_OFFSET (0x60 + (__SIZEOF_POINTER__ * 2))
+#define SBI_PLATFORM_HART_INDEX2ID_OFFSET (0x68 + (__SIZEOF_POINTER__ * 2))
/** Offset of cbom_block_size in struct sbi_platform */
-#define SBI_PLATFORM_CBOM_BLOCK_SIZE_OFFSET (0x60 + (__SIZEOF_POINTER__ * 3))
+#define SBI_PLATFORM_CBOM_BLOCK_SIZE_OFFSET (0x68 + (__SIZEOF_POINTER__ * 3))
#define SBI_PLATFORM_TLB_RANGE_FLUSH_LIMIT_DEFAULT (1UL << 12)
@@ -182,6 +184,8 @@ struct sbi_platform {
u32 hart_stack_size;
/** Size of heap shared by all HARTs */
u32 heap_size;
+ /** Reserved PMP entry count */
+ u8 reserved_pmp_count;
/** Reserved for future use */
u32 reserved;
/** Pointer to sbi platform operations */
@@ -214,6 +218,7 @@ assert_member_offset(struct sbi_platform, features, SBI_PLATFORM_FEATURES_OFFSET
assert_member_offset(struct sbi_platform, hart_count, SBI_PLATFORM_HART_COUNT_OFFSET);
assert_member_offset(struct sbi_platform, hart_stack_size, SBI_PLATFORM_HART_STACK_SIZE_OFFSET);
assert_member_offset(struct sbi_platform, heap_size, SBI_PLATFORM_HEAP_SIZE_OFFSET);
+assert_member_offset(struct sbi_platform, reserved_pmp_count, SBI_PLATFORM_RESERVED_PMP_COUNT_OFFSET);
assert_member_offset(struct sbi_platform, reserved, SBI_PLATFORM_RESERVED_OFFSET);
assert_member_offset(struct sbi_platform, platform_ops_addr, SBI_PLATFORM_OPS_OFFSET);
assert_member_offset(struct sbi_platform, firmware_context, SBI_PLATFORM_FIRMWARE_CONTEXT_OFFSET);
--
2.48.0
--
opensbi mailing list
opensbi@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/opensbi
next prev parent reply other threads:[~2025-08-15 13:14 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-15 10:01 [RFC PATCH 0/7] Extend the reserved PMP entries Yu-Chien Peter Lin
2025-08-15 10:01 ` [RFC PATCH 1/7] lib: utils: fdt_helper: add fdt_has_isa_extension() helper Yu-Chien Peter Lin
2025-08-15 10:01 ` Yu-Chien Peter Lin [this message]
2025-08-15 10:01 ` [RFC PATCH 3/7] platform: generic: platform: introduce fw_platform_get_reserved_pmp_count() Yu-Chien Peter Lin
2025-08-15 10:01 ` [RFC PATCH 4/7] lib: sbi_init: print total and reserved PMP counts Yu-Chien Peter Lin
2025-08-15 10:01 ` [RFC PATCH 5/7] lib: sbi: riscv_asm: add reserved_pmp_alloc() to allocate a reserved PMP Yu-Chien Peter Lin
2025-08-15 10:01 ` [RFC PATCH 6/7] lib: sbi: sbi_hart: extend PMP handling to support multiple reserved entries Yu-Chien Peter Lin
2025-08-15 10:01 ` [RFC PATCH 7/7] docs: opensbi_config: add description for reserved-pmp-count Yu-Chien Peter Lin
2025-10-06 5:21 ` [RFC PATCH 0/7] Extend the reserved PMP entries 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=20250815100116.27776-3-peter.lin@sifive.com \
--to=peter.lin@sifive.com \
--cc=greentime.hu@sifive.com \
--cc=opensbi@lists.infradead.org \
--cc=zong.li@sifive.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox