Skip to content

Commit 2b2a77d

Browse files
committed
tests: Add basic test-set for OpenRISC architecture port
The OpenRISC 1000 architecture can be tested through the qemu_or1k emulated SoC and board. Because this emulated device has minimal external hardware by default, this patch enables a minimal suite of tests covering core kernel features for the CPU architecture. When running the test suite, OpenRISC was found to require additional stack space to prevent an overflow. Therefore, a minimal additional amount of storage: 128-bytes, was added that was found in practice to allow tests to complete. Note that Qemu version 9.2.0 or newer is required so as to include the following commit: commit 3eb43aeb164f1f83c97ff693c7d464b49755110c Author: Joel Holdsworth <[email protected]> Date: Fri Jun 7 15:29:33 2024 -0700 hw/openrisc: Fixed undercounting of TTCR in continuous mode This fixes a bug in the implementation of the emulated OpenRISC Tick Timer which prevents the Zephyr OpenRISC port from task-scheduling properly. Signed-off-by: Joel Holdsworth <[email protected]>
1 parent 94e2e41 commit 2b2a77d

File tree

12 files changed

+22
-0
lines changed

12 files changed

+22
-0
lines changed

subsys/mgmt/mcumgr/grp/os_mgmt/include/os_mgmt_processor.h

+2
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@ extern "C" {
154154
#define PROCESSOR_NAME "xtensa"
155155
#elif defined(CONFIG_SPARC)
156156
#define PROCESSOR_NAME "sparc"
157+
#elif defined(CONFIG_OPENRISC)
158+
#define PROCESSOR_NAME "openrisc"
157159
#endif
158160

159161
#ifndef PROCESSOR_NAME

subsys/testsuite/Kconfig

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ config TEST_EXTRA_STACK_SIZE
1818
int "Test function extra thread stack size"
1919
default 2048 if COVERAGE_GCOV
2020
default 768 if XTENSA
21+
default 128 if OPENRISC
2122
default 0
2223
depends on TEST
2324
help

subsys/testsuite/include/zephyr/interrupt_util.h

+8
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,14 @@ static inline void trigger_irq(int irq)
204204
z_mips_enter_irq(irq);
205205
}
206206

207+
#elif defined(CONFIG_OPENRISC)
208+
extern void z_openrisc_enter_irq(int);
209+
210+
static inline void trigger_irq(int irq)
211+
{
212+
z_openrisc_enter_irq(irq);
213+
}
214+
207215
#elif defined(CONFIG_CPU_CORTEX_R5) && defined(CONFIG_VIM)
208216

209217
extern void z_vim_arm_enter_irq(int);

subsys/testsuite/include/zephyr/test_asm_inline_gcc.h

+2
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ static inline void timestamp_serialize(void)
4848
#define timestamp_serialize()
4949
#elif defined(CONFIG_MIPS)
5050
#define timestamp_serialize()
51+
#elif defined(CONFIG_OPENRISC)
52+
#define timestamp_serialize()
5153
#else
5254
#error implementation of timestamp_serialize() not provided for your CPU target
5355
#endif

tests/kernel/context/src/main.c

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
*/
5757
#elif defined(CONFIG_SPARC)
5858
#elif defined(CONFIG_MIPS)
59+
#elif defined(CONFIG_OPENRISC)
5960
#elif defined(CONFIG_ARCH_POSIX)
6061
#if defined(CONFIG_BOARD_NATIVE_POSIX) || defined(CONFIG_BOARD_NATIVE_SIM)
6162
#define TICK_IRQ TIMER_TICK_IRQ

tests/kernel/fatal/exception/src/main.c

+2
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ void entry_cpu_exception_extend(void *p1, void *p2, void *p3)
123123
*/
124124
#elif defined(CONFIG_ARC)
125125
__asm__ volatile ("swi");
126+
#elif defined(CONFIG_OPENRISC)
127+
__asm__ volatile ("l.trap 0");
126128
#else
127129
/* used to create a divide by zero error on X86 and MIPS */
128130
volatile int error;

tests/kernel/fatal/no-multithreading/testcase.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ common:
44
- qemu_arc/qemu_arc_em
55
- qemu_arc/qemu_arc_hs
66
- qemu_arc/qemu_arc_hs6x
7+
- qemu_or1k
78
- qemu_riscv32
89
- qemu_riscv32e
910
- qemu_riscv64

tests/kernel/mem_slab/mslab_api/testcase.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ tests:
2323
- qemu_riscv32e
2424
- qemu_riscv64
2525
- qemu_leon3
26+
- qemu_or1k
2627
integration_platforms:
2728
- qemu_cortex_m3
2829
- qemu_arc/qemu_arc_hs

tests/kernel/threads/no-multithreading/testcase.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ tests:
1919
- qemu_arc/qemu_arc_em
2020
- qemu_arc/qemu_arc_hs
2121
- qemu_arc/qemu_arc_hs6x
22+
- qemu_or1k
2223
- qemu_riscv32
2324
- qemu_riscv32e
2425
- qemu_riscv64

tests/kernel/timer/timer_api/testcase.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ tests:
2020
- qemu_arc/qemu_arc_hs
2121
- qemu_arc/qemu_arc_hs6x
2222
- qemu_leon3
23+
- qemu_or1k
2324
integration_platforms:
2425
- qemu_cortex_m3
2526
- nsim/nsim_em

tests/lib/mpsc_pbuf/testcase.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ tests:
1010
- qemu_cortex_r5
1111
- qemu_leon3
1212
- qemu_nios2
13+
- qemu_or1k
1314
- qemu_riscv32
1415
- qemu_riscv64
1516
- qemu_x86

tests/lib/multi_heap/testcase.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ tests:
2323
- qemu_riscv32e
2424
- qemu_riscv64
2525
- qemu_leon3
26+
- qemu_or1k
2627
integration_platforms:
2728
- qemu_cortex_m3
2829
extra_configs:

0 commit comments

Comments
 (0)