Nicholas Piggin and Anup Patel
a59c8fb9fb
lib: sbi: Move hart PMP functions to sbi_hart_pmp.c
...
The sbi_hart_pmp.c looks like a good place for the hart PMP CSR
access functions.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com >
Reviewed-by: Anup Patel <anup@brainfault.org >
Link: https://lore.kernel.org/r/20260430045528.420437-9-npiggin@gmail.com
Signed-off-by: Anup Patel <anup@brainfault.org >
2026-06-10 17:55:33 +05:30
Nicholas Piggin and Anup Patel
63350c6ea6
lib: sbi: Add hart_ prefix to PMP functions
...
PMP functions that deal with hart PMP CSRs are given a sbi_hart_ prefix,
to distinguish from RISC-V PMP encoding functions.
The is_pmp_entry_mapped() function is changed a little more, to align
with other PMP conventions, and made to return a bool to make it more
obvious that it returns a bool and not an SBI_ return code.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com >
Reviewed-by: Anup Patel <anup@brainfault.org >
Link: https://lore.kernel.org/r/20260430045528.420437-8-npiggin@gmail.com
Signed-off-by: Anup Patel <anup@brainfault.org >
2026-06-10 17:37:49 +05:30
Nicholas Piggin and Anup Patel
f7738cc1e5
lib: sbi: Add sbi_pmp_is_enabled() helper
...
Signed-off-by: Nicholas Piggin <npiggin@gmail.com >
Reviewed-by: Anup Patel <anup@brainfault.org >
Link: https://lore.kernel.org/r/20260430045528.420437-7-npiggin@gmail.com
Signed-off-by: Anup Patel <anup@brainfault.org >
2026-06-10 13:25:29 +05:30
Nicholas Piggin and Anup Patel
8f1a6164f2
lib: sbi: Add PMP CSR read and write accessors
...
PMPCFG CSR access is non-trivial as it requires shifting and masking, it
makes PMP manipulation code simpler if this basic CSR read/write access is
abstracted away.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com >
Reviewed-by: Anup Patel <anup@brainfault.org >
Link: https://lore.kernel.org/r/20260430045528.420437-6-npiggin@gmail.com
Signed-off-by: Anup Patel <anup@brainfault.org >
2026-06-10 13:23:18 +05:30
Nicholas Piggin and Anup Patel
e9797b5e57
lib: sbi: Move RISC-V PMP encoding functions to sbi_pmp.c
...
Create a new file for handling the RISC-V PMP format and the new pmp_t
type, as opposed to hart PMP CSR specific access.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com >
Reviewed-by: Anup Patel <anup@brainfault.org >
Link: https://lore.kernel.org/r/20260430045528.420437-4-npiggin@gmail.com
Signed-off-by: Anup Patel <anup@brainfault.org >
2026-06-10 13:17:30 +05:30
Nicholas Piggin and Anup Patel
c93a89f214
lib: sbi: split PMP encoding and CSR access
...
Allow PMP encoding functions to be shared with non-hart PMP manipulation
by splitting encoding / decoding and hart PMP CSR access into their own
functions.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com >
Reviewed-by: Anup Patel <anup@brainfault.org >
Link: https://lore.kernel.org/r/20260430045528.420437-3-npiggin@gmail.com
Signed-off-by: Anup Patel <anup@brainfault.org >
2026-06-10 09:57:58 +05:30
Nicholas Piggin and Anup Patel
8ae3b0985a
lib: sbi: Introduce pmp_t type
...
To help abstract details of PMP encoding and access, add a new pmp_t
type which contains address and cfg in the format of the riscv CSRs.
There is no functional change.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com >
Reviewed-by: Anup Patel <anup@brainfault.org >
Link: https://lore.kernel.org/r/20260430045528.420437-2-npiggin@gmail.com
Signed-off-by: Anup Patel <anup@brainfault.org >
2026-06-10 09:56:29 +05:30
Nicholas Piggin and Anup Patel
6767861c48
platform: generic: Tenstorrent Atlantis support
...
Add the Tenstorrent Atlantis as a generic-platform. This initial support
enables the single_fw_region option, and verifies and prints HART PMA
CSR configuration.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com >
Reviewed-by: Anup Patel <anup@brainfault.org >
Link: https://lore.kernel.org/r/20260424062520.238403-1-npiggin@gmail.com
Signed-off-by: Anup Patel <anup@brainfault.org >
2026-05-09 20:57:50 +05:30