1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/kconfigs/Kconfig.features
bors[bot] 755442fe27
Merge #19712
19712: cpu/riscv: Add PMP driver r=MrKevinWeiss a=Teufelchen1

### Contribution description

Hi! 🐘 

this adds a basic RISC-V physical memory protection (PMP) driver to RIOT. Well, 'driver' might be a stretched, feels more like a little utility :)

EDIT: Also added  a no-execute RAM option for the hifive & a corresponding test

Since I only have an Hifive rev b, it's only enabled on this board / cpu. I also tested the code on an ESP32-C but the feature can't be enabled there, as `cpu/riscv_common/` is not used by the ESP32...

### Testing procedure

* Grab a hifive rev b
* go to `examples/hello-world`
* Add `USEMODULES += periph_pmp` to the `Makefile`
* Include `pmp.h` in `main.c`
* Add code e.g. `print_pmpcfg(0);`
* compile & flash & term 

You should see something like this:
```
# Hello World!
# You are running RIOT on a(n) hifive1b board.
# This board features a(n) fe310 MCU.
# pmp00cfg: - R-X OFF   0x00000000 - 0x00000000
```



Co-authored-by: Teufelchen1 <bennet.blischke@outlook.com>
2023-06-29 09:57:31 +00:00

563 lines
13 KiB
Plaintext

# Copyright (c) 2020 HAW Hamburg
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
#
# Declaration of generic features that CPUs and boards may provide
config HAS_ARCH_8BIT
bool
help
Indicates that the CPU has a 8-bits architecture.
config HAS_ARCH_16BIT
bool
help
Indicates that the CPU has a 16-bits architecture.
config HAS_ARCH_32BIT
bool
help
Indicates that the CPU has a 32-bits architecture.
config HAS_ARCH_ARM
bool
help
Indicates that the current architecture is ARM.
config HAS_ARDUINO_ANALOG
bool
help
Indicates that Arduino analog pins mappings are provided.
config HAS_ARDUINO_DAC
bool
help
Indicates that Arduino DAC pins mappings are provided.
config HAS_ARDUINO_I2C
bool
help
Indicates that Arduino I²C bus mappings are provided.
config HAS_ARDUINO_PINS
bool
help
Indicates that Arduino digital pins mappings are provided.
config HAS_ARDUINO_PWM
bool
help
Indicates that Arduino digital pin to PWM mappings are provided.
config HAS_ARDUINO_SHIELD_ISP
bool
help
Indicates that the board is electrically and mechanically compatible
with shields that mate with the ISP header for SPI connectivity.
config HAS_ARDUINO_SHIELD_MEGA
bool
# The Arduino Mega 2560 is backward compatible with Arduino UNO shields. So
# any board compatible with Mega shields will automatically be compatible
# with UNO shields.
select HAS_ARDUINO_SHIELD_UNO
help
Indicates that the board is mechanically and electrically compatible
with shields developed for the Arduino Mega 2560. (Note: Not including
the ISP header, that requires HAS_ARDUINO_SHIELD_ISP in addition.)
config HAS_ARDUINO_SHIELD_NANO
bool
help
Indicates that the board is mechanically and electrically compatible
with shields developed for the Arduino Nano. (Note: Not including
the ISP header, that requires HAS_ARDUINO_SHIELD_ISP in addition.)
config HAS_ARDUINO_SHIELD_UNO
bool
help
Indicates that the board is mechanically and electrically compatible
with shields developed for the Arduino Nano. (Note: Not including
the ISP header, that requires HAS_ARDUINO_SHIELD_ISP in addition.)
config HAS_ARDUINO_SPI
bool
help
Indicates that Arduino SPI bus mappings are provided.
config HAS_ARDUINO_UART
bool
help
Indicates that Arduino UART device mappings are provided.
config HAS_BACKUP_RAM
bool
help
Indicates that Backup RAM is supported.
config HAS_BLE_ADV_EXT
bool
help
Indicates the current platform supports Bluetooth 5 Advertising
Extension
config HAS_BLE_NIMBLE
bool
help
Indicates that the NimBLE stack is supported on the current platform.
config HAS_BLE_NIMBLE_NETIF
bool
help
Indicates that NimBLE netif is supported on the current platform.
config HAS_BLE_PHY_2MBIT
bool
help
Indicates that the BLE radio supports the 2Mbit PHY mode
config HAS_BLE_PHY_CODED
bool
help
Indicates that the BLE radio supports the CODED PHY mode
config HAS_CPP
bool
help
Indicates that C++ is supported.
config HAS_CPU_CHECK_ADDRESS
bool
help
Indicates that address validity check is supported.
config HAS_DBGPIN
bool
help
Indicates that a platform provides the neccessary initialization hooks
for the dbgpin module.
config HAS_EMULATOR_RENODE
bool
help
Indicates that the platform is compatible with the Renode emulator.
config HAS_ETHERNET
bool
help
Indicates that Ethernet connectivity is present.
config HAS_PERIPH_FLASHPAGE_IN_ADDRESS_SPACE
bool
help
Indicates that static memory sections can fundamentally be turned
into flash pages.
config HAS_HIGHLEVEL_STDIO
bool
help
Indicates that a high-level stdio method (such as CDC ACM) is used.
This requires a running thread and set-up and will not print during
a crash.
config HAS_LIBSTDCPP
bool
help
Indicates that in addition to C++ support an libstdc++ is available.
config HAS_NO_IDLE_THREAD
bool
help
Indicates that this MCU doesn't need the idle thread
config HAS_MOTOR_DRIVER
bool
help
Indicates that a motor_driver configuration is present.
config HAS_PERIPH_ADC
bool
help
Indicates that an ADC peripheral is present.
config HAS_PERIPH_CAN
bool
help
Indicates that a CAN peripheral is present.
config HAS_PERIPH_CORETIMER
bool
help
Indicates that the CLINT timer can be used as timer peripheral
config HAS_PERIPH_CPUID
bool
help
Indicates that a CPU ID peripheral is present.
config HAS_PERIPH_DAC
bool
help
Indicates that a DAC peripheral is present.
config HAS_PERIPH_DMA
bool
help
Indicates that a DMA peripheral is present.
config HAS_PERIPH_EEPROM
bool
help
Indicates that a EEPROM peripheral is present.
config HAS_PERIPH_ETH
bool
help
Indicates that an Ethernet peripheral is present.
config HAS_PERIPH_FLASHPAGE
bool
help
Indicates that a Flashpage peripheral is present.
config HAS_PERIPH_FLASHPAGE_PAGEWISE
bool
help
Indicates that the Flashpage peripheral supports pagewise writing.
config HAS_PERIPH_FLASHPAGE_RWEE
bool
help
Indicates that the Flashpage peripheral is of the Read While Write.
config HAS_PERIPH_GPIO
bool
help
Indicates that a GPIO peripheral is present.
config HAS_PERIPH_GPIO_IRQ
bool
help
Indicates that the GPIO peripheral supports external interrupts is
present.
config HAS_PERIPH_GPIO_FAST_READ
bool
help
Indicates that the GPIO peripheral supports a mode in which pin read
operations are faster, usually with a tradeoff against a different
property.
config HAS_PERIPH_GPIO_TAMPER_WAKE
bool
help
Indicates that Tamper Detection can be used to wake the CPU from
Deep Sleep.
config HAS_PERIPH_GPIO_LL
bool
help
Indicates that the gpio_ll driver is implemented for the MCU's GPIO
peripheral.
config HAS_PERIPH_GPIO_LL_IRQ
bool
help
Indicates that IRQ support for the gpio_ll driver is implemented for the
MCU's GPIO peripheral.
config HAS_PERIPH_GPIO_LL_IRQ_LEVEL_TRIGGERED_HIGH
bool
help
Indicates that IRQs can be triggered level based for signal high.
config HAS_PERIPH_GPIO_LL_IRQ_LEVEL_TRIGGERED_LOW
bool
help
Indicates that IRQs can be triggered level based for signal low.
config HAS_PERIPH_GPIO_LL_IRQ_UNMASK
bool
help
Indicates that the GPIO peripheral supports unmasking interrupts without
clearing pending IRQs that came in while masked.
config HAS_PERIPH_HWRNG
bool
help
Indicates that a Hardware Random Number Generator (HWRNG) peripheral is
present.
config HAS_PERIPH_I2C
bool
help
Indicates that an I2C peripheral is present.
config HAS_PERIPH_I2C_RECONFIGURE
bool
help
Indicates that the I2C peripheral allows pin reconfiguration peripheral
is present.
config HAS_PERIPH_ICS
bool
help
Indicates that an ICS peripheral is present.
config HAS_PERIPH_IR
bool
help
Indicates that an IR peripheral is present.
config HAS_PERIPH_LPUART
bool
help
Indicates that a low-power UART peripheral is present.
config HAS_PERIPH_LTDC
bool
select MODULE_PERIPH_LTDC if MODULE_DISP_DEV
help
Indicates that a LTDC peripheral is present.
config HAS_PERIPH_MCG
bool
help
Indicates that an MCG peripheral is present.
config HAS_PERIPH_CLIC
bool
help
Indicates that a RISC-V Core-local Interrupt Controller (CLIC) peripheral is present.
config HAS_PERIPH_PIO
bool
help
Indicates that Programmable IO (PIO) is supported by the CPU
config HAS_PERIPH_PLIC
bool
help
Indicates that a RISC-V Platform-local Interrupt Controller (PLIC) peripheral is present.
config HAS_PERIPH_PMP
bool
help
Indicates that a RISC-V physical memory protection (PMP) peripheral is present.
config HAS_PERIPH_PM
bool
help
Indicates that a Power Management (PM) peripheral is present.
config HAS_PERIPH_PTP
bool
help
Indicates that a PTP clock is present.
config HAS_PERIPH_PTP_SPEED_ADJUSTMENT
bool
help
Indicates that the PTP clock speed can be adjust. This can be used for clock drift correction and synchronization.
config HAS_PERIPH_PTP_TIMER
bool
help
Indicates that the PTP clock can be used as timer.
config HAS_PERIPH_PTP_TXRX_TIMESTAMPS
bool
help
Indicates that the PTP clock can provide exact time stamps of the
reception and transmission of frames.
config HAS_PERIPH_PWM
bool
help
Indicates that a PWM peripheral is present.
config HAS_PERIPH_QDEC
bool
help
Indicates that a QDEC peripheral is present.
config HAS_PERIPH_RTC
bool
help
Indicates that an RTC peripheral is present.
config HAS_PERIPH_RTC_MEM
bool
help
Indicates that the RTC peripheral provides storage memory for deep sleep.
config HAS_PERIPH_RTC_MS
bool
help
Indicates that the RTC peripheral can provide sub-second timestamps.
config HAS_PERIPH_RTT
bool
help
Indicates that an RTT peripheral is present.
config HAS_PERIPH_RTT_SET_COUNTER
bool
help
Indicates that the RTT peripheral implements rtt_set_counter().
config HAS_PERIPH_RTT_OVERFLOW
bool
help
Indicates that the RTT provides an overflow callback.
config HAS_PERIPH_SPI
bool
help
Indicates that an SPI peripheral is present.
config HAS_PERIPH_SPI_ON_QSPI
bool
help
Indicates that the QSPI peripheral can be used in SPI mode.
config HAS_PERIPH_SPI_RECONFIGURE
bool
help
Indicates that the SPI peripheral allows pin reconfiguration.
config HAS_PERIPH_SPI_GPIO_MODE
bool
help
Indicates that the SPI peripheral supports configuring the GPIOs modes.
config HAS_PERIPH_TEMPERATURE
bool
help
Indicates that a Temperature peripheral is present.
config HAS_PERIPH_TIMER
bool
help
Indicates that a Timer peripheral is present.
config HAS_PERIPH_TIMER_PERIODIC
bool
help
Indicates that the Timer peripheral provides the periodic timeout
functionality.
config HAS_PERIPH_UART
bool
help
Indicates that an UART peripheral is present.
config HAS_PERIPH_UART_COLLISION
bool
help
Indicates that the UART peripheral supports hardware collision detection.
config HAS_PERIPH_UART_HW_FC
bool
help
Indicates that the UART peripheral supports hardware flow control.
config HAS_PERIPH_UART_MODECFG
bool
help
Indicates that the UART peripheral allows mode configuration.
config HAS_PERIPH_UART_NONBLOCKING
bool
help
Indicates that the UART peripheral allows non-blocking operations.
config HAS_PERIPH_UART_RECONFIGURE
bool
help
Indicates that the UART pins can be re-configured as GPIOs.
config HAS_PERIPH_UART_RXSTART_IRQ
bool
help
Indicates that the UART has an Interrupt for Start Condition detected.
config HAS_PERIPH_USBDEV
bool
help
Indicates that an USBDEV peripheral is present.
config HAS_PERIPH_USBDEV_HS
bool
help
Indicates that the USBDEV peripheral supports High-Speed.
config HAS_PERIPH_USBDEV_HS_UTMI
bool
help
Indicates that an USBDEV HS peripheral with internal UTMI+ HS PHY is present.
config HAS_PERIPH_USBDEV_HS_ULPI
bool
help
Indicates that an USBDEV HS peripheral with ULPI HS PHY is present.
config HAS_PERIPH_VBAT
bool
help
Indicates that backup battery monitoring is supported
config HAS_PERIPH_WDT
bool
help
Indicates that a Watchdog Timer (WDT) peripheral is present.
config HAS_PERIPH_WDT_CB
bool
help
Indicates that the WDT peripheral allows setting a callback.
config HAS_PICOLIBC
bool
help
Indicates that the picolibc C library is available for the platform.
config HAS_PIO_I2C
bool
help
Indicates that there is a PIO program to provide emulated I2C
config HAS_NEWLIB
bool
help
Indicates that the newlib C library is available for the platform.
config HAS_PUF_SRAM
bool
help
Indicates that the PUF-SRAM module has been tested on the platform.
config HAS_RIOTBOOT
bool
help
Indicates that the riotboot booloader is supported.
config HAS_RUST_TARGET
bool
help
Indicates that a Rust target definition ("triple") is known.
config HAS_SDCARD_SPI
bool
help
Indicates that an SD-Card SPI configuration is provided.
config HAS_SSP
bool
help
Indicates that Stack Smashing Protection is supported.