Skip to content

Commit 8f93a5a

Browse files
committed
Add stm32mp2 support
1 parent fc90d89 commit 8f93a5a

4 files changed

Lines changed: 30 additions & 0 deletions

File tree

build_sdk.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,17 @@ class KernelPath:
162162
"KernelCustomDTSOverlay": Path("custom_dts/overlay-zynqmp-kria-k26.dts"),
163163
} | DEFAULT_KERNEL_OPTIONS_AARCH64,
164164
),
165+
BoardInfo(
166+
name="stm32mp2",
167+
arch=KernelArch.AARCH64,
168+
gcc_cpu="cortex-a35",
169+
loader_link_address=0x88000000,
170+
smp_cores=2,
171+
kernel_options={
172+
"KernelPlatform": "stm32mp2",
173+
"KernelARMPlatform": "stm32mp257f-ev1",
174+
} | DEFAULT_KERNEL_OPTIONS_AARCH64,
175+
),
165176
BoardInfo(
166177
name="tqma8xqp1gb",
167178
arch=KernelArch.AARCH64,

loader/src/aarch64/cpus.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ static const size_t psci_target_cpus[4] = {0x00, 0x01, 0x02, 0x03};
5858
static const size_t psci_target_cpus[4] = {0x00, 0x01, 0x02, 0x03};
5959
#elif defined(CONFIG_PLAT_ROCKPRO64)
6060
static const size_t psci_target_cpus[4] = {0x00, 0x01, 0x02, 0x03};
61+
#elif defined(CONFIG_PLAT_STM32MP2)
62+
static const size_t psci_target_cpus[2] = {0x00, 0x01};
6163
#elif defined(CONFIG_PLAT_QEMU_ARM_VIRT)
6264
/* QEMU is special and can have arbitrary numbers of cores */
6365
// TODO.

loader/src/uart.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,20 @@ void putc(uint8_t ch)
188188
while ((*UART_REG(ULSR) & ULSR_THRE) == 0);
189189
*UART_REG(UTHR) = ch;
190190
}
191+
#elif defined(CONFIG_PLAT_STM32MP2)
192+
193+
#define UART_BASE 0x400e0000
194+
#define USART_ISR 0x1c
195+
#define USART_TDR 0x28
196+
#define USART_ISR_TXE 0x80
197+
198+
void uart_init(void) {}
199+
200+
void putc(uint8_t ch)
201+
{
202+
while (!(*UART_REG(USART_ISR) & USART_ISR_TXE));
203+
*UART_REG(USART_TDR) = ch;
204+
}
191205
#elif defined(CONFIG_ARCH_RISCV64)
192206

193207
#include "riscv/sbi.h"

platforms.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,6 @@ platforms:
9494
- name: zcu102
9595
cmake_plat: zcu102
9696
since: 1.3.0
97+
- name: stm32mp2
98+
cmake_plat: stm32mp2
99+
since: dev

0 commit comments

Comments
 (0)