Skip to content

Commit

Permalink
dts: removing autotest-relative shm from non-autotest build (#22)
Browse files Browse the repository at this point in the history
declared SHM in example dts are made for autotest mode, as their owner
is autotest.
In other cases, the kernel do `panic()` if a SHM is found with an
inexistant owner, which is the case of autotest SHM in debug or release
modes.

NOTE: dtsi to add in order to avoid duplication (another PR)
  • Loading branch information
pthierry-ledger authored Aug 29, 2024
2 parents 89b4fa0 + d2b6a0b commit dc3a65f
Show file tree
Hide file tree
Showing 5 changed files with 368 additions and 55 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/proof.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
with:
cross_files: ${{ format('{0}/{1}', env.MESON_CROSS_FILES, 'arm-none-eabi-gcc.ini') }}
actions: '["prefetch", "setup"]'
options: '-Dconfig=.config -Ddts=dts/examples/nucleo_u5a5.dts -Ddts-include-dirs=dts -Dwith_proof=true'
options: '-Dconfig=.config -Ddts=dts/examples/nucleo_u5a5_autotest.dts -Ddts-include-dirs=dts -Dwith_proof=true'
- name: run framaC
run: |
why3 config detect
Expand Down
26 changes: 0 additions & 26 deletions dts/examples/nucleo_u5a5.dts
Original file line number Diff line number Diff line change
Expand Up @@ -29,32 +29,6 @@

/{
reserved-memory {
shm_autotest_1: memory@2000a000 {
// mappable, dma allowed
reg = <0x2000a000 0x256>;
dma-pool;
outpost,shm;
outpost,label = <0xf00>;
outpost,owner = <0xbabe>;
};

shm_autotest_2: memory@2000b000 {
// not mappable, dma allowed
reg = <0x2000b000 0x100>;
outpost,shm;
dma-pool;
outpost,no-map;
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>;
};
};
};

Expand Down
1 change: 0 additions & 1 deletion dts/examples/nucleo_u5a5_autotest.dts

This file was deleted.

207 changes: 207 additions & 0 deletions dts/examples/nucleo_u5a5_autotest.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,207 @@
/*
* Copyright (c) 2023,Ledger SAS
*
* SPDX-License-Identifier: Apache-2.0
*/

/dts-v1/;

#include <st/u5/stm32u595.dtsi>
#include <dt-bindings/pinctrl/stm32-pinctrl.h>
#include <sentry.dtsi>

/{
chosen {
sentry,debug_stdout = <&usart1>;
};

aliases {
pll = &pll1;
};

led0: led_0 {
compatible = "gpio-leds";
outpost,owner = <0xbabe>;
pinctrl-0 = <&led_pc7 &led_pc7>;
status = "disabled";
};
};

/{
reserved-memory {
shm_autotest_1: memory@2000a000 {
// mappable, dma allowed
reg = <0x2000a000 0x256>;
dma-pool;
outpost,shm;
outpost,label = <0xf00>;
outpost,owner = <0xbabe>;
};

shm_autotest_2: memory@2000b000 {
// not mappable, dma allowed
reg = <0x2000b000 0x100>;
outpost,shm;
dma-pool;
outpost,no-map;
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>;
};
};
};

&led0 {
status = "okay";
};

&flash0 {
reg = <0x08000000 DT_SIZE_M(4)>;
};

&sram0 {
reg = <0x20000000 DT_SIZE_K(2514)>;
};

&gpdma1 {
status = "okay";
};

&clk_lsi {
status = "okay";
};

&clk_hsi {
status = "okay";
};

&clk_hse {
status = "okay";
};

&clk_msis {
status = "okay";
};

&pll1 {
status = "okay";
};

&pll3 {
status = "okay";
};

&flash {
wait-state = <4>; /* According to voltage supply and sysclock */
status = "okay";
};

&i2c1 {
status = "okay";
outpost,owner = <0xbabe>;
dma-rx = <&gpdma1 13>;
dma-tx = <&gpdma1 12>;
};

&rcc {
clocks = <&pll1>;
clock-frequency = <DT_FREQ_M(160)>;
bus-prescalers = <0>, <0>, <0>, <0>;
bus-names = "ahb", "apb1", "apb2", "apb3";
status = "okay";
};

&exti {
events = <26>;
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_pa9>, <&usart1_rx_pa10>;
};

&lpuart1{
status = "disabled";
pinctrl-0 = <&lpuart1_tx>, <&lpuart1_rx>;
};

&pinctrl {
usart1_tx_pa9: 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_pa10: 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>;
};

lpuart1_tx: lpuart1_tx {
pinmux = <&gpioc 1 STM32_DT_PIN_MODE_ALTFUNC(8)>;
pincfg = <STM32_OTYPER_PUSH_PULL \
STM32_OSPEEDR_VERY_HIGH_SPEED \
STM32_PUPDR_NO_PULL>;
};

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

led_pc7: led_pc7 {
pinmux = <&gpioc 7 STM32_DT_PIN_MODE_OUTPUT>;
pincfg = <STM32_OTYPER_PUSH_PULL \
STM32_OSPEEDR_VERY_HIGH_SPEED \
STM32_PUPDR_NO_PULL>;
};
};

&rng {
status = "okay";
};

&syscfg {
status = "okay";
};
26 changes: 0 additions & 26 deletions dts/examples/stm32f429i_disc1.dts
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,6 @@
};

reserved-memory {
shm_autotest_1: memory@2000a000 {
// mappable, dma allowed
reg = <0x2000a000 0x256>;
dma-pool;
outpost,shm;
outpost,label = <0xf00>;
outpost,owner = <0xbabe>;
};

shm_autotest_2: memory@2000b000 {
// not mappable, dma allowed
reg = <0x2000b000 0x100>;
outpost,shm;
dma-pool;
outpost,no-map;
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>;
};
};
};

Expand Down
1 change: 0 additions & 1 deletion dts/examples/stm32f429i_disc1_autotest.dts

This file was deleted.

Loading

0 comments on commit dc3a65f

Please sign in to comment.