Skip to content

Commit b49b9dd

Browse files
committed
tests: microblaze: test specific configuration additions for MicroBlaze
Internal references: FWRIVERHD-5201 Signed-off-by: Alp Sayin <[email protected]>
1 parent 69da9dd commit b49b9dd

File tree

7 files changed

+19
-3
lines changed

7 files changed

+19
-3
lines changed

scripts/schemas/twister/platform-schema.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ mapping:
5454
"sparc",
5555
"x86",
5656
"xtensa",
57+
"microblaze",
5758

5859
# unit testing
5960
"unit",

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ extern "C" {
144144
#define PROCESSOR_NAME "xtensa"
145145
#elif defined(CONFIG_SPARC)
146146
#define PROCESSOR_NAME "sparc"
147+
#elif defined(CONFIG_MICROBLAZE)
148+
#define PROCESSOR_NAME "microblaze"
147149
#endif
148150

149151
#ifndef PROCESSOR_NAME

tests/kernel/context/src/main.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,20 @@
6565
* unless TICK_IRQ is defined here for them
6666
*/
6767
#endif /* defined(CONFIG_ARCH_POSIX) */
68+
#elif defined(CONFIG_MICROBLAZE) && defined(CONFIG_XLNX_TMRCTR)
69+
#define TICK_IRQ DT_IRQN(DT_INST(CONFIG_XLNX_TMRCTR_TIMER_INDEX, xlnx_tmrctr))
6870
#else
6971

7072
extern const int32_t z_sys_timer_irq_for_test;
7173
#define TICK_IRQ (z_sys_timer_irq_for_test)
7274

7375
#endif
7476

75-
/* Cortex-M1 and Nios II do have a power saving instruction, so k_cpu_idle()
77+
/* Cortex-M1, MicroBlaze and Nios II do have a power saving instruction, so k_cpu_idle()
7678
* returns immediately
7779
*/
78-
#if !defined(CONFIG_CPU_CORTEX_M1) && !defined(CONFIG_NIOS2)
80+
#if !defined(CONFIG_CPU_CORTEX_M1) && !defined(CONFIG_NIOS2) && \
81+
(!(defined(CONFIG_MICROBLAZE) && defined(CONFIG_MICROBLAZE_IDLE_NOP)))
7982
#define HAS_POWERSAVE_INSTRUCTION
8083
#endif
8184

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ void entry_cpu_exception(void *p1, void *p2, void *p3)
9191
__asm__ volatile (".word 0x77777777");
9292
#else
9393
/* Triggers usage fault on ARM, illegal instruction on
94-
* xtensa, TLB exception (instruction fetch) on MIPS.
94+
* xtensa, TLB exception (instruction fetch) on MIPS,
95+
* illegal op-code instruction on microblaze
9596
*/
9697
{
9798
volatile long illegal = 0;
@@ -449,6 +450,11 @@ ZTEST(fatal_exception, test_fatal)
449450

450451
static void *fatal_setup(void)
451452
{
453+
454+
#if defined(CONFIG_MICROBLAZE)
455+
microblaze_enable_exceptions();
456+
#endif
457+
452458
#if defined(CONFIG_DEMAND_PAGING) && \
453459
!defined(CONFIG_LINKER_GENERIC_SECTIONS_PRESENT_AT_BOOT)
454460
uintptr_t pin_addr;

tests/kernel/interrupt/src/interrupt_offload.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ void isr_handler(const void *param)
9898
#define TEST_IRQ_DYN_LINE 0
9999
#endif
100100

101+
#elif defined(CONFIG_MICROBLAZE)
102+
#define TEST_IRQ_DYN_LINE 1
101103
#else
102104
#define TEST_IRQ_DYN_LINE 0
103105
#endif

tests/kernel/mem_protect/stackprot/testcase.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ tests:
55
- xtensa
66
- posix
77
- sparc
8+
- microblaze
89
tags:
910
- kernel
1011
- userspace

tests/lib/mpsc_pbuf/testcase.yaml

Lines changed: 1 addition & 0 deletions
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_microblaze
1314
- qemu_riscv32
1415
- qemu_riscv64
1516
- qemu_x86

0 commit comments

Comments
 (0)