diff --git a/build_sdk.py b/build_sdk.py index c98143173..072dc2a44 100644 --- a/build_sdk.py +++ b/build_sdk.py @@ -163,6 +163,17 @@ class KernelPath: "KernelCustomDTSOverlay": Path("custom_dts/overlay-zynqmp-kria-k26.dts"), } | DEFAULT_KERNEL_OPTIONS_AARCH64, ), + BoardInfo( + name="stm32mp2", + arch=KernelArch.AARCH64, + gcc_cpu="cortex-a35", + loader_link_address=0x88000000, + smp_cores=2, + kernel_options={ + "KernelPlatform": "stm32mp2", + "KernelARMPlatform": "stm32mp257f-ev1", + } | DEFAULT_KERNEL_OPTIONS_AARCH64, + ), BoardInfo( name="tqma8xqp1gb", arch=KernelArch.AARCH64, diff --git a/docs/manual.md b/docs/manual.md index 198d95df3..c04851a81 100644 --- a/docs/manual.md +++ b/docs/manual.md @@ -1186,6 +1186,7 @@ The currently supported platforms are: * rpi4b_8gb * serengeti * star64 +* stm32mp25_ev1 * tqma8xqp1gb * ultra96v2 * x86_64_generic @@ -1556,6 +1557,30 @@ ZynqMP> tftpboot 0x40000000 loader.img ZynqMP> go 0x40000000 ``` +## STM32MP25 evaluation board {#stm32mp25_ev1} + +A newly flashed card will autoboot to Linux. You will need to break (Ctrl+c) or disable autoboot. When entering the U-Boot console, load the Microkit binary image at address 0x88000000: + +For initial SD card file system flashing using the initial first-stage boot loader TF-A, +please see the instructions on the +[seL4 website](https://docs.sel4.systems/Hardware/MP25EV1.html). + +For example, to load the image via the current SD/MMC, identify the partition +containing the image to be loaded. Assuming it is labelized "bootfs" on the partition 8: + +``` +STM32MP> mmc part +... +8 0x00002242 0x00034241 "bootfs" +... +STM32MP> ext2ls mmc 0:8 +... + 2759776 loader.img +... +STM32MP> ext2load mmc 0:8 0x88000000 loader.img +STM32MP> go 0x88000000 +``` + ## x86-64 generic {#x86_64_generic} This board supports x86-64 platforms with generic microarchitecture and no virtualisation. diff --git a/loader/src/aarch64/cpus.c b/loader/src/aarch64/cpus.c index 130000248..b5210751a 100644 --- a/loader/src/aarch64/cpus.c +++ b/loader/src/aarch64/cpus.c @@ -63,6 +63,8 @@ static const size_t psci_target_cpus[4] = {0x00, 0x01, 0x02, 0x03}; static const size_t psci_target_cpus[4] = {0x00, 0x01, 0x02, 0x03}; #elif defined(CONFIG_PLAT_ROCKPRO64) static const size_t psci_target_cpus[4] = {0x00, 0x01, 0x02, 0x03}; +#elif defined(CONFIG_PLAT_STM32MP2) +static const size_t psci_target_cpus[2] = {0x00, 0x01}; #elif defined(CONFIG_PLAT_QEMU_ARM_VIRT) /* QEMU is special and can have arbitrary numbers of cores */ // TODO. diff --git a/loader/src/uart.c b/loader/src/uart.c index ad04f23ee..0361da794 100644 --- a/loader/src/uart.c +++ b/loader/src/uart.c @@ -188,6 +188,20 @@ void putc(uint8_t ch) while ((*UART_REG(ULSR) & ULSR_THRE) == 0); *UART_REG(UTHR) = ch; } +#elif defined(CONFIG_PLAT_STM32MP2) + +#define UART_BASE 0x400e0000 +#define USART_ISR 0x1c +#define USART_TDR 0x28 +#define USART_ISR_TXE 0x80 + +void uart_init(void) {} + +void putc(uint8_t ch) +{ + while (!(*UART_REG(USART_ISR) & USART_ISR_TXE)); + *UART_REG(USART_TDR) = ch; +} #elif defined(CONFIG_ARCH_RISCV64) #include "riscv/sbi.h" diff --git a/platforms.yml b/platforms.yml index 3ae555633..3f0b3d06a 100644 --- a/platforms.yml +++ b/platforms.yml @@ -94,3 +94,6 @@ platforms: - name: zcu102 cmake_plat: zcu102 since: 1.3.0 + - name: stm32mp2 + cmake_plat: stm32mp257f-ev1 + since: dev