Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions build_sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,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,
Expand Down
2 changes: 2 additions & 0 deletions loader/src/aarch64/cpus.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,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.
Expand Down
14 changes: 14 additions & 0 deletions loader/src/uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 3 additions & 0 deletions platforms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,6 @@ platforms:
- name: zcu102
cmake_plat: zcu102
since: 1.3.0
- name: stm32mp2
cmake_plat: stm32mp2
since: dev