diff --git a/dts/examples/nucleo_l476rg_autotest.dts b/dts/examples/nucleo_l476rg_autotest.dts new file mode 100644 index 00000000..aea81978 --- /dev/null +++ b/dts/examples/nucleo_l476rg_autotest.dts @@ -0,0 +1,179 @@ +/* + * Copyright (c) 2023,Ledger SAS + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#include +#include +#include + +/{ + chosen { + sentry,debug_stdout = <&usart1>; + sentry,autotestram_section = <&autotest_ram>; + sentry,autotestcode_section = <&autotest_code>; + }; + reserved-memory { + autotest_code: autotest_code@800d000 { + reg = <0x800d000 0x3000>; + compatible = "outpost,memory-pool"; + }; + + autotest_ram: autotest_memory@20008000 { + reg = <0x20008000 0x1000>; + compatible = "outpost,memory-pool"; + }; + + shm_autotest_1: memory@2000a000 { + // mappable, dma allowed + reg = <0x2000a000 0x256>; + outpost,shm; + dma-pool; + outpost,label = <0xf00>; + outpost,owner = <0xbabe>; + }; + + shm_autotest_2: memory@2000b000 { + // mappable, dma allowed + reg = <0x2000b000 0x100>; + outpost,shm; + dma-pool; + outpost,label = <0xf01>; + outpost,owner = <0xbabe>; + }; + + shm_autotest_3: memory@2000b100 { + // mappable, dma refused + reg = <0x2000b100 0x100>; + outpost,shm; + outpost,label = <0xf02>; + outpost,owner = <0xbabe>; + }; + + shm_autotest_4: memory@2000b200 { + // not mappable, dma allowed + reg = <0x2000b200 0x100>; + outpost,shm; + dma-pool; + outpost,no-map; + outpost,label = <0xf03>; + outpost,owner = <0xbabe>; + }; + }; + +}; + +&flash0 { + reg = <0x08000000 DT_SIZE_K(512)>; +}; + +&clk_lsi { + status = "okay"; +}; + +&clk_hsi { + status = "okay"; +}; + +&pll { + vco_m_div = <2>; + vco_n_mul = <36>; + pqr_div = <0>, <6>, <4>; + clocks = <&clk_hsi>; + status = "okay"; + compatible = "st,stm32l4xx-pll"; +}; + +&flash { + wait-state = <3>; /* According to voltage supply and sysclock */ + status = "okay"; +}; + +&exti { + events = <40>; + status = "okay"; +}; + +&rcc { + clocks = <&pll>; + clock-frequency = ; + bus-prescalers = <1>, <2>, <2>; + bus-names = "ahb", "apb1", "apb2"; + status = "okay"; + + mco { + pinctrl-0 = <&rcc_mco_pa8>; + clockout = <&pll>; /* XXX use reg value from svd */ + prescaler = <4>; + status = "okay"; + }; +}; + +&gpioa { + status = "okay"; +}; + +&gpiob { + status = "okay"; +}; + +&gpioc { + status = "okay"; +}; + +&gpiod { + status = "okay"; +}; + +&gpioe { + status = "okay"; +}; + +&gpiof { + status = "okay"; +}; + +&gpiog { + status = "okay"; +}; + +&usart1 { + status = "okay"; + pinctrl-0 = <&usart1_tx>, <&usart1_rx>; +}; + +&pinctrl { + usart1_tx: usart1_tx_pa9 { + pinmux = <&gpioa 9 STM32_DT_PIN_MODE_ALTFUNC(7)>; + pincfg = ; + }; + + usart1_rx: usart1_rx_pa10 { + pinmux = <&gpioa 10 STM32_DT_PIN_MODE_ALTFUNC(7)>; + pincfg = ; + }; + + rcc_mco_pa8: rcc_mco_pa8 { + pinmux = <&gpioa 8 STM32_DT_PIN_MODE_ALTFUNC(0)>; + pincfg = ; + }; +}; + +&rng { + /* XXX: badly defined in orig dts */ + clocks = <&rcc STM32_CLOCK_BUS_AHB2 0x00040000>; + status = "okay"; +}; + +&syscfg { + status = "okay"; +}; diff --git a/dts/meson.build b/dts/meson.build new file mode 100644 index 00000000..0995ae90 --- /dev/null +++ b/dts/meson.build @@ -0,0 +1,47 @@ +# SPDX-License-Identifier: Apache-2.0 +# +# Copyright 2025 Ledger SAS +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +dtsi_files = files( + 'sentry.dtsi' +) + +install_data( + dtsi_files, + install_dir: get_option('datadir') + '/dts', + install_tag: 'devel', +) + +examples_dts_files = files( + 'examples/nucleo_f401re.dts', + 'examples/nucleo_l476rg_autotest.dts', + 'examples/nucleo_l476rg_debug.dts', + 'examples/nucleo_l476rg.dts', + 'examples/nucleo_u5a5_autotest.dts', + 'examples/nucleo_u5a5.dts', + 'examples/nucleo_u5a5_nooutput.dts', + 'examples/nucleo_wb55_autotest.dts', + 'examples/stm32f429i_disc1_autotest.dts', + 'examples/stm32f429i_disc1_debug.dts', + 'examples/stm32f429i_disc1.dts', + 'examples/stm32f429i_disc1_release.dts', +) + +install_data( + examples_dts_files, + follow_symlinks: false, + install_dir: get_option('datadir') + '/dts/board', + install_tag: 'devel', +) diff --git a/meson.build b/meson.build index 069b378a..c16ea419 100644 --- a/meson.build +++ b/meson.build @@ -184,6 +184,7 @@ endif # Finally, kernel can be built and then tools that might need some kernel headers. subdir('support/arch') subdir('schemas') +subdir('dts') subdir('uapi') subdir('idle') subdir('autotest')