Skip to content

Commit 3e53a79

Browse files
committed
soc: qemu: Added qemu_or1k simulated SoC
Qemu includes support for the OpenRISC 1000 CPU architecture. This patch adds a Zephyr SoC definition which enables usage of this feature. The SoC definition closely mirrors the Qemu MIPS Malta SoC definition. Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
1 parent ab91570 commit 3e53a79

File tree

7 files changed

+62
-0
lines changed

7 files changed

+62
-0
lines changed

MAINTAINERS.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5578,6 +5578,7 @@ OpenRISC Arch:
55785578
- arch/openrisc/
55795579
- drivers/timer/*openrisc*
55805580
- include/zephyr/arch/openrisc/
5581+
- soc/qemu/or1k/
55815582
labels:
55825583
- "area: OpenRISC"
55835584
tests:

soc/qemu/or1k/CMakeLists.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#
2+
# Copyright (c) 2025 NVIDIA Corporation <jholdsworth@nvidia.com>
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
7+
zephyr_compile_options(
8+
${TOOLCHAIN_C_FLAGS}
9+
)
10+
11+
zephyr_ld_options(
12+
${TOOLCHAIN_LD_FLAGS}
13+
)
14+
15+
set(SOC_LINKER_SCRIPT ${ZEPHYR_BASE}/include/zephyr/arch/openrisc/linker.ld CACHE INTERNAL "")

soc/qemu/or1k/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#
2+
# Copyright (c) 2025 NVIDIA Corporation <jholdsworth@nvidia.com>
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
7+
config SOC_QEMU_OR1K
8+
select OPENRISC

soc/qemu/or1k/Kconfig.defconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#
2+
# Copyright (c) 2025 NVIDIA Corporation <jholdsworth@nvidia.com>
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
7+
if SOC_QEMU_OR1K
8+
9+
config SYS_CLOCK_HW_CYCLES_PER_SEC
10+
default 20000000
11+
12+
config NUM_IRQS
13+
default 32
14+
15+
endif # SOC_QEMU_OR1K

soc/qemu/or1k/Kconfig.soc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#
2+
# Copyright (c) 2025 NVIDIA Corporation <jholdsworth@nvidia.com>
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
7+
config SOC_QEMU_OR1K
8+
bool
9+
10+
config SOC
11+
default "qemu_or1k" if SOC_QEMU_OR1K

soc/qemu/or1k/soc.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/*
2+
* Copyright (c) 2025 NVIDIA Corporation <jholdsworth@nvidia.com>
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#ifndef __QEMU_OR1K_SOC_H__
8+
#define __QEMU_OR1K_SOC_H__
9+
10+
#endif /* __QEMU_OR1K_SOC_H__ */

soc/qemu/or1k/soc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
socs:
2+
- name: qemu_or1k

0 commit comments

Comments
 (0)