diff --git a/scripts/schemas/twister/platform-schema.yaml b/scripts/schemas/twister/platform-schema.yaml index c651f83c3e3641..626e84beb8c855 100644 --- a/scripts/schemas/twister/platform-schema.yaml +++ b/scripts/schemas/twister/platform-schema.yaml @@ -54,6 +54,7 @@ mapping: "sparc", "x86", "xtensa", + "microblaze", # unit testing "unit", diff --git a/subsys/mgmt/mcumgr/grp/os_mgmt/include/os_mgmt_processor.h b/subsys/mgmt/mcumgr/grp/os_mgmt/include/os_mgmt_processor.h index 83b2f5987354c0..44decbff4e3e99 100644 --- a/subsys/mgmt/mcumgr/grp/os_mgmt/include/os_mgmt_processor.h +++ b/subsys/mgmt/mcumgr/grp/os_mgmt/include/os_mgmt_processor.h @@ -144,6 +144,8 @@ extern "C" { #define PROCESSOR_NAME "xtensa" #elif defined(CONFIG_SPARC) #define PROCESSOR_NAME "sparc" +#elif defined(CONFIG_MICROBLAZE) +#define PROCESSOR_NAME "microblaze" #endif #ifndef PROCESSOR_NAME diff --git a/tests/kernel/context/src/main.c b/tests/kernel/context/src/main.c index 516ddb1ef5bd24..1b943789dcd42b 100644 --- a/tests/kernel/context/src/main.c +++ b/tests/kernel/context/src/main.c @@ -65,6 +65,8 @@ * unless TICK_IRQ is defined here for them */ #endif /* defined(CONFIG_ARCH_POSIX) */ +#elif defined(CONFIG_MICROBLAZE) && defined(CONFIG_XLNX_TMRCTR) +#define TICK_IRQ DT_IRQN(DT_INST(CONFIG_XLNX_TMRCTR_TIMER_INDEX, xlnx_tmrctr)) #else extern const int32_t z_sys_timer_irq_for_test; @@ -72,10 +74,11 @@ extern const int32_t z_sys_timer_irq_for_test; #endif -/* Cortex-M1 and Nios II do have a power saving instruction, so k_cpu_idle() +/* Cortex-M1, MicroBlaze and Nios II do have a power saving instruction, so k_cpu_idle() * returns immediately */ -#if !defined(CONFIG_CPU_CORTEX_M1) && !defined(CONFIG_NIOS2) +#if !defined(CONFIG_CPU_CORTEX_M1) && !defined(CONFIG_NIOS2) && \ + (!(defined(CONFIG_MICROBLAZE) && defined(CONFIG_MICROBLAZE_IDLE_NOP))) #define HAS_POWERSAVE_INSTRUCTION #endif diff --git a/tests/kernel/fatal/exception/src/main.c b/tests/kernel/fatal/exception/src/main.c index a946d02de7f9e9..2b1ce885d8d9a4 100644 --- a/tests/kernel/fatal/exception/src/main.c +++ b/tests/kernel/fatal/exception/src/main.c @@ -91,7 +91,8 @@ void entry_cpu_exception(void *p1, void *p2, void *p3) __asm__ volatile (".word 0x77777777"); #else /* Triggers usage fault on ARM, illegal instruction on - * xtensa, TLB exception (instruction fetch) on MIPS. + * xtensa, TLB exception (instruction fetch) on MIPS, + * illegal op-code instruction on microblaze */ { volatile long illegal = 0; @@ -449,6 +450,11 @@ ZTEST(fatal_exception, test_fatal) static void *fatal_setup(void) { + +#if defined(CONFIG_MICROBLAZE) + microblaze_enable_exceptions(); +#endif + #if defined(CONFIG_DEMAND_PAGING) && \ !defined(CONFIG_LINKER_GENERIC_SECTIONS_PRESENT_AT_BOOT) uintptr_t pin_addr; diff --git a/tests/kernel/interrupt/src/interrupt_offload.c b/tests/kernel/interrupt/src/interrupt_offload.c index b2ac007c14ffdd..418d63f9bb78bc 100644 --- a/tests/kernel/interrupt/src/interrupt_offload.c +++ b/tests/kernel/interrupt/src/interrupt_offload.c @@ -98,6 +98,8 @@ void isr_handler(const void *param) #define TEST_IRQ_DYN_LINE 0 #endif +#elif defined(CONFIG_MICROBLAZE) +#define TEST_IRQ_DYN_LINE 1 #else #define TEST_IRQ_DYN_LINE 0 #endif diff --git a/tests/kernel/mem_protect/stackprot/testcase.yaml b/tests/kernel/mem_protect/stackprot/testcase.yaml index c8955a0cfa1524..3ee36e1aa4a0c2 100644 --- a/tests/kernel/mem_protect/stackprot/testcase.yaml +++ b/tests/kernel/mem_protect/stackprot/testcase.yaml @@ -5,6 +5,7 @@ tests: - xtensa - posix - sparc + - microblaze tags: - kernel - userspace diff --git a/tests/lib/mpsc_pbuf/testcase.yaml b/tests/lib/mpsc_pbuf/testcase.yaml index f2665aa93f56a0..68b0ccd7c8809b 100644 --- a/tests/lib/mpsc_pbuf/testcase.yaml +++ b/tests/lib/mpsc_pbuf/testcase.yaml @@ -10,6 +10,7 @@ tests: - qemu_cortex_r5 - qemu_leon3 - qemu_nios2 + - qemu_microblaze - qemu_riscv32 - qemu_riscv64 - qemu_x86