Skip to content

Commit

Permalink
tests: microblaze: test specific configuration additions for MicroBlaze
Browse files Browse the repository at this point in the history
Internal references: FWRIVERHD-5201

Signed-off-by: Alp Sayin <alpsayin@gmail.com>
  • Loading branch information
alpsayin committed May 30, 2024
1 parent 3f15f30 commit e026713
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 3 deletions.
2 changes: 2 additions & 0 deletions subsys/mgmt/mcumgr/grp/os_mgmt/include/os_mgmt_processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,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
Expand Down
7 changes: 5 additions & 2 deletions tests/kernel/context/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,20 @@
* 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;
#define TICK_IRQ (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

Expand Down
8 changes: 7 additions & 1 deletion tests/kernel/fatal/exception/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions tests/kernel/interrupt/src/interrupt_offload.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions tests/kernel/mem_protect/stackprot/testcase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ tests:
- xtensa
- posix
- sparc
- microblaze
tags:
- kernel
- userspace
Expand Down
1 change: 1 addition & 0 deletions tests/lib/mpsc_pbuf/testcase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ tests:
- qemu_cortex_r5
- qemu_leon3
- qemu_nios2
- qemu_microblaze
- qemu_riscv32
- qemu_riscv64
- qemu_x86
Expand Down

0 comments on commit e026713

Please sign in to comment.