From: Bo Gan <ganboing@gmail.com>
To: opensbi@lists.infradead.org
Cc: linmin@eswincomputing.com, pinkesh.vaghela@einfochips.com,
gaohan@iscas.ac.cn, samuel@sholland.org, wangxiang@iscas.ac.cn
Subject: [PATCH v2 0/5] Initial ESWIN/EIC7700 support
Date: Sun, 16 Nov 2025 21:48:41 -0800 [thread overview]
Message-ID: <20251117054846.1335-1-ganboing@gmail.com> (raw)
EIC7700 is the SoC used in HiFive P550 and Milk-V Megrez. This SoC is
currently one of the only off-the-shelf board/chips that support H
extension, although it's v0.6.1. It also supports pre-ratified N-trace.
Add support for it so people can benefit from latest OpenSBI features.
The device-tree of HiFive P550 has been upstreamed to Linux:
https://lore.kernel.org/all/20250825132427.1618089-1-pinkesh.vaghela@einfochips.com/
However U-boot is not, and there are bugs in vendor U-boot device-tree,
and also inconsistencies between the two. Thus, this patch is coded with
the upstreamed device-tree as the reference, but tested with the patched
vendor U-boot device tree as `FW_FDT_PATH`. The patched vendor U-boot is
hosted here: https://github.com/ganboing/u-boot-eic7x/tree/eic7x-dt-fix
Refer to PATCH 5/5 for the instructions on building the firmware blob
and launch it through UART boot.
The major complication of this chip is that it requires certain memory
regions to be blocked with PMP entries to prevent speculative execution
or HW prefetcher from touching them to avoid bus errors. Also due to the
fact that this SoC handles cache incoherent DMA by mapping memory twice,
one as cached, and the other as uncached, we also need an extra PMP to
protect the OpenSBI in the uncached portion in address space. Following
changes are made to lib/ and firmware/ to make it possible:
- Allow platform to override pmp_(un)configure
- Add helper function for settings PMP TOR
- Add helper function to check if memregions are disjoint
- Introduce FIRMWARE_PACKED_RXRW for disabling power-of-2 RW split
The defconfig of EIC770X is separated out, because it has to require
CONFIG_FIRMWARE_PACKED_RXRW to not run out of PMP entries. It'll
change the layout of firmware sections to not power-of-2 align the
RW sections, so do not by default enable this for other platforms.
Signed-off-by: Bo Gan <ganboing@gmail.com>
---
Changes in v2:
- Major enhancement of PMP consolidation logic. Also fixed a Linux
Panic bug due to the mismatch between PMP settings and reserved
memory regions passed to Linux via FDT.
- Also protects the OpenSBI firmware in uncached memory portion of
address space.
- More detailed documentation on EIC770X/P550
---
Bo Gan (5):
lib: sbi: allow platform to override PMP configuration
lib: sbi: Add __pmp_set_tor for setting TOR regions
firmware: add CONFIG_FIRMWARE_PACKED_RXRW
include: sbi: Add helpers for sbi_domain_memregion
platform: generic: eswin: add EIC7700
firmware/Kconfig | 11 +
firmware/fw_base.ldS | 14 +-
include/sbi/riscv_asm.h | 7 +
include/sbi/sbi_domain.h | 23 ++
include/sbi/sbi_hart.h | 9 +
include/sbi/sbi_platform.h | 53 +++
lib/sbi/riscv_asm.c | 75 ++++-
lib/sbi/sbi_domain.c | 11 +
lib/sbi/sbi_domain_context.c | 11 +-
lib/sbi/sbi_hart.c | 97 ++++--
platform/generic/Kconfig | 6 +
platform/generic/configs/eic770x_defconfig | 28 ++
platform/generic/eswin/Kconfig | 29 ++
platform/generic/eswin/eic770x.c | 361 +++++++++++++++++++++
platform/generic/eswin/objects.mk | 11 +
platform/generic/include/eswin/eic770x.h | 66 ++++
16 files changed, 752 insertions(+), 60 deletions(-)
create mode 100644 platform/generic/configs/eic770x_defconfig
create mode 100644 platform/generic/eswin/Kconfig
create mode 100644 platform/generic/eswin/eic770x.c
create mode 100644 platform/generic/eswin/objects.mk
create mode 100644 platform/generic/include/eswin/eic770x.h
--
2.34.1
--
opensbi mailing list
opensbi@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/opensbi
next reply other threads:[~2025-11-17 5:50 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-17 5:48 Bo Gan [this message]
2025-11-17 5:48 ` [PATCH v2 1/5] lib: sbi: allow platform to override PMP (un)configuration Bo Gan
2025-11-17 5:48 ` [PATCH v2 2/5] lib: sbi: Add __pmp_set_tor for setting TOR regions Bo Gan
2025-11-17 5:48 ` [PATCH v2 3/5] firmware: add CONFIG_FIRMWARE_PACKED_RXRW Bo Gan
2025-11-17 5:48 ` [PATCH v2 4/5] include: sbi: Add helpers for sbi_domain_memregion Bo Gan
2025-11-17 5:48 ` [PATCH v2 5/5] platform: generic: eswin: add EIC7700 Bo Gan
2025-11-17 8:04 ` [PATCH v2 0/5] Initial ESWIN/EIC7700 support Anup Patel
2025-11-17 9:29 ` Bo Gan
2025-11-17 15:09 ` Anup Patel
2025-11-18 7:03 ` Bo Gan
2025-11-18 17:23 ` Anup Patel
2025-11-20 9:39 ` Bo Gan
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=20251117054846.1335-1-ganboing@gmail.com \
--to=ganboing@gmail.com \
--cc=gaohan@iscas.ac.cn \
--cc=linmin@eswincomputing.com \
--cc=opensbi@lists.infradead.org \
--cc=pinkesh.vaghela@einfochips.com \
--cc=samuel@sholland.org \
--cc=wangxiang@iscas.ac.cn \
/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