From edb46592033b13b39ec74d3b2b3cee74ed6268bf Mon Sep 17 00:00:00 2001 From: Paul Olaru Date: Fri, 28 Apr 2023 13:11:09 +0300 Subject: [PATCH 1/3] arch: xtensa: core.h: Add define for UINT32_C This define is used by the new 2023 xt-clang toolchain and, while there are a few definitions (identical to this one) in various implementations such as newlib, none of them is in use when building SOF with Zephyr and XtensaTools. Add this define so that the toolchain provided headers work correctly. Signed-off-by: Paul Olaru --- src/arch/xtensa/include/xtensa/config/core.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/arch/xtensa/include/xtensa/config/core.h b/src/arch/xtensa/include/xtensa/config/core.h index f5bb44faf2ab..4cf7606df707 100644 --- a/src/arch/xtensa/include/xtensa/config/core.h +++ b/src/arch/xtensa/include/xtensa/config/core.h @@ -36,6 +36,24 @@ #ifndef XTENSA_CONFIG_CORE_H #define XTENSA_CONFIG_CORE_H +/* + * This define is used by the new 2023 xt-clang toolchain and, while there are a few definitions + * (identical to this one) in various implementations such as newlib, none of them is in use when + * building SOF with Zephyr and XtensaTools. + */ + +#if defined(__ZEPHYR__) + +#ifndef __UINT32_C +#define __UINT32_C(x) x ## U +#endif + +#ifndef UINT32_C +#define UINT32_C(x) __UINT32_C(x) +#endif + +#endif + /* CONFIGURATION INDEPENDENT DEFINITIONS: */ #ifdef __XTENSA__ #include From 480b24e8eae643beafc66b5957fe1140c29b80a8 Mon Sep 17 00:00:00 2001 From: Paul Olaru Date: Fri, 28 Apr 2023 13:12:39 +0300 Subject: [PATCH 2/3] drivers: imx: interrupt: Use Zephyr wrapper definitions For the functions platform_interrupt_clear and platform_interrupt_set, the existing definitions based on arch_interrupt_* do not compile with the xt-clang 2023 toolchain for imx. Use the Zephyr wrapper implementations for those for now. Signed-off-by: Paul Olaru --- src/drivers/imx/interrupt-generic.c | 2 ++ src/drivers/imx/interrupt-irqsteer.c | 2 ++ zephyr/wrapper.c | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/drivers/imx/interrupt-generic.c b/src/drivers/imx/interrupt-generic.c index 32e03cebf816..19b58922cf6d 100644 --- a/src/drivers/imx/interrupt-generic.c +++ b/src/drivers/imx/interrupt-generic.c @@ -36,6 +36,7 @@ int irqstr_get_sof_int(int irqstr_int) void platform_interrupt_init(void) {} +#ifndef __ZEPHYR__ void platform_interrupt_set(uint32_t irq) { arch_interrupt_set(irq); @@ -45,6 +46,7 @@ void platform_interrupt_clear(uint32_t irq, uint32_t mask) { arch_interrupt_clear(irq); } +#endif /* __ZEPHYR__ */ uint32_t platform_interrupt_get_enabled(void) { diff --git a/src/drivers/imx/interrupt-irqsteer.c b/src/drivers/imx/interrupt-irqsteer.c index 3b5fda616ffb..2ef4f2f89e11 100644 --- a/src/drivers/imx/interrupt-irqsteer.c +++ b/src/drivers/imx/interrupt-irqsteer.c @@ -451,6 +451,7 @@ void platform_interrupt_init(void) interrupt_cascade_register(dsp_irq + i); } +#ifndef __ZEPHYR__ void platform_interrupt_set(uint32_t irq) { if (interrupt_is_dsp_direct(irq)) @@ -462,6 +463,7 @@ void platform_interrupt_clear(uint32_t irq, uint32_t mask) if (interrupt_is_dsp_direct(irq)) arch_interrupt_clear(irq); } +#endif /* __ZEPHYR */ uint32_t platform_interrupt_get_enabled(void) { diff --git a/zephyr/wrapper.c b/zephyr/wrapper.c index 60108c4b417f..3f9f43ea7458 100644 --- a/zephyr/wrapper.c +++ b/zephyr/wrapper.c @@ -107,6 +107,7 @@ void interrupt_unmask(uint32_t irq, unsigned int cpu) { /* TODO: how do we unmask on other cores with Zephyr APIs */ } +#endif void platform_interrupt_set(uint32_t irq) { @@ -117,7 +118,6 @@ void platform_interrupt_clear(uint32_t irq, uint32_t mask) { /* handled by zephyr - needed for linkage */ } -#endif /* * Asynchronous Messaging Service From bf137f393b1af95bc07f76c0af4bb81b5b527081 Mon Sep 17 00:00:00 2001 From: Paul Olaru Date: Thu, 4 May 2023 13:30:51 +0300 Subject: [PATCH 3/3] west.yml: Upgrade zephyr to fa5117225a This update is needed to include Zephyr specific patches required for building SOF on i.MX platforms with Xtensa toolchain. Signed-off-by: Paul Olaru --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 9583cf6f4472..cc626256d346 100644 --- a/west.yml +++ b/west.yml @@ -43,7 +43,7 @@ manifest: - name: zephyr repo-path: zephyr - revision: aba3b12e311b4779338406fe3e7c4c54f655d0cd + revision: fa5117225af9c2167449d79cccd5f0e81bb10696 remote: zephyrproject # Import some projects listed in zephyr/west.yml@revision