Skip to content

Commit

Permalink
meson,install: installing dts and dtsi files (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
pthierry-ledger authored Jan 15, 2025
2 parents 56cdc67 + 0c79872 commit 6a2ddba
Show file tree
Hide file tree
Showing 3 changed files with 227 additions and 0 deletions.
179 changes: 179 additions & 0 deletions dts/examples/nucleo_l476rg_autotest.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
/*
* Copyright (c) 2023,Ledger SAS
*
* SPDX-License-Identifier: Apache-2.0
*/

/dts-v1/;

#include <st/l4/stm32l476Xg.dtsi>
#include <dt-bindings/pinctrl/stm32-pinctrl.h>
#include <sentry.dtsi>

/{
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 = <DT_FREQ_M(72)>;
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 = <STM32_OTYPER_PUSH_PULL \
STM32_OSPEEDR_VERY_HIGH_SPEED \
STM32_PUPDR_NO_PULL>;
};

usart1_rx: usart1_rx_pa10 {
pinmux = <&gpioa 10 STM32_DT_PIN_MODE_ALTFUNC(7)>;
pincfg = <STM32_OTYPER_PUSH_PULL \
STM32_OSPEEDR_VERY_HIGH_SPEED \
STM32_PUPDR_NO_PULL>;
};

rcc_mco_pa8: rcc_mco_pa8 {
pinmux = <&gpioa 8 STM32_DT_PIN_MODE_ALTFUNC(0)>;
pincfg = <STM32_OTYPER_PUSH_PULL \
STM32_OSPEEDR_VERY_HIGH_SPEED \
STM32_PUPDR_NO_PULL>;
};
};

&rng {
/* XXX: badly defined in orig dts */
clocks = <&rcc STM32_CLOCK_BUS_AHB2 0x00040000>;
status = "okay";
};

&syscfg {
status = "okay";
};
47 changes: 47 additions & 0 deletions dts/meson.build
Original file line number Diff line number Diff line change
@@ -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',
)
1 change: 1 addition & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 6a2ddba

Please sign in to comment.