From f5b02f0341fbface4dc36e3225dc301be6e6419d Mon Sep 17 00:00:00 2001 From: Florent Valette Date: Mon, 30 Sep 2024 11:21:41 +0200 Subject: [PATCH] asm,cortex-m: Add warning at configure time if soc bus definition is missing. This may help while porting to new SoC. --- .../sentry/arch/asm-cortex-m/meson.build | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/kernel/include/sentry/arch/asm-cortex-m/meson.build b/kernel/include/sentry/arch/asm-cortex-m/meson.build index 64a1e36a..1a1552a8 100644 --- a/kernel/include/sentry/arch/asm-cortex-m/meson.build +++ b/kernel/include/sentry/arch/asm-cortex-m/meson.build @@ -45,6 +45,12 @@ core_h = custom_target('gen_core', command: [ jinja_cli, '-d', svd_json, '-o', '@OUTPUT@', '@INPUT@' ], ) +arch_header_set.add( + irq_def_h.to_list(), + layout_h.to_list(), + core_h.to_list(), +) + # the way we generate the buses list depend on the SoC family. To do # that, the input jinja template is selected depending on the configured SOC # family or subfamily @@ -58,16 +64,15 @@ buses_h_in_set.add(when: 'CONFIG_SOC_SUBFAMILY_STM32U5', if_true: files('stm32l4 # here, we can add other templates for other ARM SoC famillies if needed buses_h_in_set_config = buses_h_in_set.apply(kconfig_data, strict: false) -buses_h = custom_target('gen_buses', - input: buses_h_in_set_config.sources(), - output: 'buses.h', - depends: [ svd_json ], - command: [ jinja_cli, '-d', svd_json, '-o', '@OUTPUT@', '--define', 'NAME', 'RCC', '@INPUT@' ], -) +if buses_h_in_set_config.sources().length() != 0 + buses_h = custom_target('gen_buses', + input: buses_h_in_set_config.sources(), + output: 'buses.h', + depends: [ svd_json ], + command: [ jinja_cli, '-d', svd_json, '-o', '@OUTPUT@', '--define', 'NAME', 'RCC', '@INPUT@' ], + ) -arch_header_set.add( - irq_def_h.to_list(), - layout_h.to_list(), - core_h.to_list(), - buses_h.to_list(), -) + arch_header_set.add(buses_h.to_list()) +else + warning('Missing bus definition for SoC @0@'.format(kconfig_data.get('CONFIG_ARCH_SOCNAME'))) +endif