Skip to content

Commit dbba99d

Browse files
committed
Add stm32mp2 support
Signed-off-by: Christian Bruel <christian.bruel@foss.st.com>
1 parent c83d507 commit dbba99d

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
@@ -163,6 +163,17 @@ class KernelPath:
163163
"KernelCustomDTSOverlay": Path("custom_dts/overlay-zynqmp-kria-k26.dts"),
164164
} | DEFAULT_KERNEL_OPTIONS_AARCH64,
165165
),
166+
BoardInfo(
167+
name="stm32mp2",
168+
arch=KernelArch.AARCH64,
169+
gcc_cpu="cortex-a35",
170+
loader_link_address=0x88000000,
171+
smp_cores=2,
172+
kernel_options={
173+
"KernelPlatform": "stm32mp2",
174+
"KernelARMPlatform": "stm32mp257f-ev1",
175+
} | DEFAULT_KERNEL_OPTIONS_AARCH64,
176+
),
166177
BoardInfo(
167178
name="tqma8xqp1gb",
168179
arch=KernelArch.AARCH64,

loader/src/aarch64/cpus.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ static const size_t psci_target_cpus[4] = {0x00, 0x01, 0x02, 0x03};
6363
static const size_t psci_target_cpus[4] = {0x00, 0x01, 0x02, 0x03};
6464
#elif defined(CONFIG_PLAT_ROCKPRO64)
6565
static const size_t psci_target_cpus[4] = {0x00, 0x01, 0x02, 0x03};
66+
#elif defined(CONFIG_PLAT_STM32MP2)
67+
static const size_t psci_target_cpus[2] = {0x00, 0x01};
6668
#elif defined(CONFIG_PLAT_QEMU_ARM_VIRT)
6769
/* QEMU is special and can have arbitrary numbers of cores */
6870
// 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)