Commit graph

126,787 commits

Author SHA1 Message Date
Hein Wessels
70a8be66de drivers: gpio: esp32: correct comment about pin drive strength
The comment about which drive strength option is high or low was
wrong and this commit fixes it. For example, ESP32_GPIO_DS_ALT
results in GPIO_DRIVE_CAP_0 being used which is the weakest
option according to the HAL file espressif-esp32-gpio.h.

Signed-off-by: Hein Wessels <heinwessels93@gmail.com>
2025-08-20 13:45:16 +02:00
Mario Paja
31fc280c12 boards: seeed: xiao_esp32c6 external antenna support
This PR adds adds The RF switch node and support for
the extenal antenna.

Signed-off-by: Mario Paja <mariopaja@hotmail.com>
2025-08-20 13:44:55 +02:00
Emil Gydesen
b7b6d39a45 tests: Bluetooth: Tester: HAP BSIM test
Adds BSIM testing of the HAP features of the BT Tester.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-08-20 12:06:28 +02:00
Thorsten Klein
b0f40e4dd0 scripts: zephyr_module: accept empty env vars for extra modules
Proceed if the environment variables ZEPHYR_EXTRA_MODULES or
EXTRA_ZEPHYR_MODULES are set to an empty string. Handle same way as if
the variable is unset.

Signed-off-by: Thorsten Klein <thorsten.klein@bshg.com>
2025-08-20 12:06:07 +02:00
Cla Mattia Galliard
5b68835fca MAINTAINERS.yml: transfer membership to alternative account
Transfer the membership to alternative account.

Signed-off-by: Cla Mattia Galliard <cla-mattia.galliard@zuehlke.com>
2025-08-20 12:05:59 +02:00
Chang An
2ce80f1696 samples: Bluetooth: make bap_broadcast_source work with google pixel
Broadcast name used for scaning device that displays information on the
available broadcast sources.

Signed-off-by: Chang An <chang.an_1@nxp.com>
2025-08-20 12:05:48 +02:00
Jamie McCrae
db8f991c77 kconfig: Use $(...) instead of ${...} for getting variables
Updates this to comply with the Zephyr Kconfig recommendations

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-08-20 12:05:41 +02:00
Jamie McCrae
ea9815ff34 scripts: zephyr_module: Add variable with module path
Adds a variable that has the path of the module directory, this
is supplied as an argument when running cmake normally but is
not supplied when running the check compliance script, this
addition allows checks to be ran that use such syntax in Kconfig
files. This is then removed from cmake as the python file handles
it instead

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-08-20 12:05:41 +02:00
Paul Wedeck
86c72a19fc boards: fk723m1_zgt6: initial support
Add the FK723M1-ZGT6 V1.0 board based on
the stm32h723zgt6.

Signed-off-by: Paul Wedeck <paulwedeck@gmail.com>
2025-08-20 12:05:35 +02:00
BUDKE Gerson Fernando
32712a4003 docs: migration-guide-4.3: Add st,stm32u5-otghs-phy note
Add migration note with details to guide user to correct select the
clock reference.

Signed-off-by: BUDKE Gerson Fernando <gerson.budke@leica-geosystems.com>
2025-08-20 12:05:24 +02:00
BUDKE Gerson Fernando
77070941fa dts: phy: Add clock-reference prop in stm32u5-otghs-phy
The OTG_HS PHY from stm32u5a5xx device require the correct reference
clock frequency selction in SYSCFG_OTGHSPHYCR. The current default is
hard coded to 16Mhz (which matches the development board crystal).
However, a custom board my require a different crystal and then the
USB will not work. This add a required field in the
st,stm32u5-otghs-phy binding to force user to select the correct
clock reference. The current nucleo_u5a5zj_q baord was updated to
reflect the mandatory field.

Signed-off-by: BUDKE Gerson Fernando <gerson.budke@leica-geosystems.com>
2025-08-20 12:05:24 +02:00
Benjamin Cabé
ad0f411f5f include: video: group video-controls.h under main video Doxygen group
Ensure the "Video Controls" do not show up as a top level device API
but are rather folded into the main video Doxygen group.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-08-20 09:29:28 +02:00
Pieter De Gendt
f1b4c7c992 drivers: ethernet: nxp_imx_netc: Fix LAA bit location
The Locally Administered Address (LAA) bit should be set on the first
octet of the MAC address.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-08-20 09:29:14 +02:00
Lars-Ove Karlsson
7ec00e958d toolchain: linker: IAR fix for new linker optimization options
The IAR linker ilink does not have any optimization options, and
with the newly added linker optimization flags that default to
the compiler optimization flags, ilink will fail with an
"illegal command line option" error.
This temporary workaround will use a harmless option instead to
avoid errors, until we can update the linker.

Signed-off-by: Lars-Ove Karlsson <lars-ove.karlsson@iar.com>
2025-08-20 09:29:04 +02:00
Adrian Gielniewski
163526b2fc drivers: Do not use deprecated OpenThread instance pointer.
Implementation should use a dedicated function to get OpenThread
instance instead of using the deprecated pointer from context.

Signed-off-by: Adrian Gielniewski <adrian.gielniewski@nordicsemi.no>
2025-08-20 09:28:10 +02:00
Alain Volmat
d9a916dca4 dts: arm: st: add pllsai2 node for stm32l4 series 7 and upper
Add a disabled node describing the PLLSAI2 pll available from
stm32l47* and upper.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2025-08-20 09:28:02 +02:00
Alain Volmat
b6bc2e22a9 dts: arm: st: add pllsai1 node into stm32l4.dtsi
Add a disabled node describing the PLLSAI1 pll within the stm32l4.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2025-08-20 09:28:02 +02:00
Alain Volmat
7d447a1dda drivers: clock: stm32: add PLLSAI2 support (common + L4)
Add stm32 common clock handling for the SAI2 PLL.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2025-08-20 09:28:02 +02:00
Alain Volmat
0abbc2f0f3 drivers: clock: stm32: add PLLSAI1 support (common + L4)
Add stm32 common clock handling for the SAI1 PLL.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2025-08-20 09:28:02 +02:00
Alain Volmat
f5ff9fd080 dts: arm: st: include stm32l4plus_clock.h in stm32l4+ dtsi
Add include of the stm32l4+ specific clock bindings in
stm32l4p5.dtsi in order to let all stm32l4+ benefit from it.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2025-08-20 09:28:02 +02:00
Alain Volmat
d646b9b267 include: dt-bindings: stm32_clocks: add stm32l4+ bindings header
On stm32l4+ series, the SAI1 and SAI2 clock source selection fields
are within a different register hence a different binding header
file is introduced to allow proper field usage on those platforms.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2025-08-20 09:28:02 +02:00
Alain Volmat
565bae248f dts: bindings: stm32_clocks: add bindings for PLLSAI of STM32L4
Add description of the SAI1 and SAI2 PLLs of the stm32l4.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2025-08-20 09:28:02 +02:00
Lucien Zhao
1695dc04cc dts: bindings: hwinfo: Modify bindings name
Modify the name of the binding yml file to ensure
it is consistent with "compatible".

Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
2025-08-20 07:42:31 +02:00
Mike J. Chen
d47353928c drivers: dma_mcux_lpc: fix missing peripheral case
Change 4e0e3c990d caused
a regression in that SPI_MCUX_FLEXCOMM_TX DMA
transfers weren't properly set to be a peripheral
transfer.

Signed-off-by: Mike J. Chen <mjchen@google.com>
2025-08-20 07:40:13 +02:00
CHEN Xing
147f8b040c modules: update west.yml for hal_atmel
Sam4l use different TC_CMR_WAVEFORM_EEVT macro name.
Update these macro names to be consistent with other sam mcu.

Signed-off-by: CHEN Xing <xing.chen@microchip.com>
2025-08-20 07:40:03 +02:00
Declan Snyder
0f66420cb2 drivers: mcux_edma: Fix dtcm desc kconfig dep
The syntax was wrong for the chosen dtcm node. Also fixing build error
on 1180 by re-allowing the symbol on some tests.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-08-20 07:39:54 +02:00
Zhaoxiang Jin
a27aecfd28 tests: dac: Enable dac_api test on mimxrt1180_evk
1.Enable dac_api test on mimxrt1180_evk
2.Reorganized the test_dac.c file so that the same
dac configuration items are placed under the one
conditional macro.

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2025-08-20 07:39:31 +02:00
Zhaoxiang Jin
1a8496d86c samples: dac: Enable dac sample on mimxrt1180_evk
Enable dac sample on mimxrt1180_evk

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2025-08-20 07:39:31 +02:00
Zhaoxiang Jin
7638d2204a boards: nxp: Enable DAC on mimxrt1180_evk cm33 and cm7
Enable DAC on mimxrt1180_evk cm33 and cm7

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2025-08-20 07:39:31 +02:00
Zhaoxiang Jin
fe9272c150 dts: nxp: Enable dac for nxp rt118x
Enable dac for nxp rt118x

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2025-08-20 07:39:31 +02:00
Krzysztof Chruściński
5718af02c5 scripts: west_command: build: Support for conditional platform configs
extra_configs or extra_args can use additional filtering which was not
supported by the west build command. West is not aware of arch so that
filter type is not supported but platform (board) is known so it can
be used to apply expected configuration.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-08-20 07:39:16 +02:00
Mahesh Mahadevan
004955b58c boards: rw612: Enable XTAL32
This oscillator has better accuracy and is available by default
on this board.
Disable this in the ethernet variant where XTAL32 is disconnected
so we can use the ethernet pins.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2025-08-20 07:38:27 +02:00
Mahesh Mahadevan
c3058ec765 dts: nxp_rw6xx: Use device tree property to configure XTAL32
Switch the XTAL32 configuration from Kconfig to devicetree

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2025-08-20 07:38:27 +02:00
Benjamin Cabé
f4a85bbaa9 include: drivers: consolidate emulation headers
Do not clutter the "Device Drivers" documentation with emulation
headers.
Ensure each emulated device API appears both in the device group as
well as "Emulator interfaces" (e.g. bbram_emul is showing up in
both BBRAM docs as well as Emulator Interfaces docs)

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-08-20 02:43:24 +02:00
Tomáš Juřena
488b1aa1c1 boards: makerbase: Use STM32_CLOCK macro in all boards
Replacing the hexadecimal values with bit position is less error-prone
and easier to follow.

The change was done by following command (convert only values where one
bit is set):

```
find boards/st/ -type f \( -name "*.dts" -o -name "*.dtsi" \) \
  -exec gawk -i inplace '{
    if (match(\
        $0,\
        /(.*)STM32_CLOCK_BUS_([A-Z0-9_]+)[ \t]+0x([0-9A-Fa-f]+)>([;,]?)/,\
        m)) {
      val = strtonum("0x" m[3])
      if (and(val, val-1) == 0) {
        bit = int(log(val)/log(2))
        print m[1] "STM32_CLOCK(" m[2] ", " bit ")>" m[4]
      } else {
        print $0
      }
    } else {
      print
    }
  }' {} \;
```

Signed-off-by: Tomáš Juřena <jurenatomas@gmail.com>
2025-08-20 02:18:25 +02:00
Tomáš Juřena
17a0b3ea6e boards: iar: Use STM32_CLOCK macro in all boards
Replacing the hexadecimal values with bit position is less error-prone
and easier to follow.

The change was done by following command (convert only values where one
bit is set):

```
find boards/st/ -type f \( -name "*.dts" -o -name "*.dtsi" \) \
  -exec gawk -i inplace '{
    if (match(\
        $0,\
        /(.*)STM32_CLOCK_BUS_([A-Z0-9_]+)[ \t]+0x([0-9A-Fa-f]+)>([;,]?)/,\
        m)) {
      val = strtonum("0x" m[3])
      if (and(val, val-1) == 0) {
        bit = int(log(val)/log(2))
        print m[1] "STM32_CLOCK(" m[2] ", " bit ")>" m[4]
      } else {
        print $0
      }
    } else {
      print
    }
  }' {} \;
```

Signed-off-by: Tomáš Juřena <jurenatomas@gmail.com>
2025-08-20 02:18:25 +02:00
Tomáš Juřena
a7d9a81279 boards: antmicro: Use STM32_CLOCK macro in all boards
Replacing the hexadecimal values with bit position is less error-prone
and easier to follow.

The change was done by following command (convert only values where one
bit is set):

```
find boards/st/ -type f \( -name "*.dts" -o -name "*.dtsi" \) \
  -exec gawk -i inplace '{
    if (match(\
        $0,\
        /(.*)STM32_CLOCK_BUS_([A-Z0-9_]+)[ \t]+0x([0-9A-Fa-f]+)>([;,]?)/,\
        m)) {
      val = strtonum("0x" m[3])
      if (and(val, val-1) == 0) {
        bit = int(log(val)/log(2))
        print m[1] "STM32_CLOCK(" m[2] ", " bit ")>" m[4]
      } else {
        print $0
      }
    } else {
      print
    }
  }' {} \;
```

Signed-off-by: Tomáš Juřena <jurenatomas@gmail.com>
2025-08-20 02:18:25 +02:00
Tomáš Juřena
7b33edd1b9 boards: witte: Use STM32_CLOCK macro in all boards
Replacing the hexadecimal values with bit position is less error-prone
and easier to follow.

The change was done by following command (convert only values where one
bit is set):

```
find boards/st/ -type f \( -name "*.dts" -o -name "*.dtsi" \) \
  -exec gawk -i inplace '{
    if (match(\
        $0,\
        /(.*)STM32_CLOCK_BUS_([A-Z0-9_]+)[ \t]+0x([0-9A-Fa-f]+)>([;,]?)/,\
        m)) {
      val = strtonum("0x" m[3])
      if (and(val, val-1) == 0) {
        bit = int(log(val)/log(2))
        print m[1] "STM32_CLOCK(" m[2] ", " bit ")>" m[4]
      } else {
        print $0
      }
    } else {
      print
    }
  }' {} \;
```

Signed-off-by: Tomáš Juřena <jurenatomas@gmail.com>
2025-08-20 02:18:25 +02:00
Tomáš Juřena
bb047704cf boards: rakwireless: Use STM32_CLOCK macro in all boards
Replacing the hexadecimal values with bit position is less error-prone
and easier to follow.

The change was done by following command (convert only values where one
bit is set):

```
find boards/st/ -type f \( -name "*.dts" -o -name "*.dtsi" \) \
  -exec gawk -i inplace '{
    if (match(\
        $0,\
        /(.*)STM32_CLOCK_BUS_([A-Z0-9_]+)[ \t]+0x([0-9A-Fa-f]+)>([;,]?)/,\
        m)) {
      val = strtonum("0x" m[3])
      if (and(val, val-1) == 0) {
        bit = int(log(val)/log(2))
        print m[1] "STM32_CLOCK(" m[2] ", " bit ")>" m[4]
      } else {
        print $0
      }
    } else {
      print
    }
  }' {} \;
```

Signed-off-by: Tomáš Juřena <jurenatomas@gmail.com>
2025-08-20 02:18:25 +02:00
Tomáš Juřena
da2672c781 boards: weact: Use STM32_CLOCK macro in all boards
Replacing the hexadecimal values with bit position is less error-prone
and easier to follow.

The change was done by following command (convert only values where one
bit is set):

```
find boards/st/ -type f \( -name "*.dts" -o -name "*.dtsi" \) \
  -exec gawk -i inplace '{
    if (match(\
        $0,\
        /(.*)STM32_CLOCK_BUS_([A-Z0-9_]+)[ \t]+0x([0-9A-Fa-f]+)>([;,]?)/,\
        m)) {
      val = strtonum("0x" m[3])
      if (and(val, val-1) == 0) {
        bit = int(log(val)/log(2))
        print m[1] "STM32_CLOCK(" m[2] ", " bit ")>" m[4]
      } else {
        print $0
      }
    } else {
      print
    }
  }' {} \;
```

Signed-off-by: Tomáš Juřena <jurenatomas@gmail.com>
2025-08-20 02:18:25 +02:00
Tomáš Juřena
80036d3a3b boards: we: Use STM32_CLOCK macro in all boards
Replacing the hexadecimal values with bit position is less error-prone
and easier to follow.

The change was done by following command (convert only values where one
bit is set):

```
find boards/st/ -type f \( -name "*.dts" -o -name "*.dtsi" \) \
  -exec gawk -i inplace '{
    if (match(\
        $0,\
        /(.*)STM32_CLOCK_BUS_([A-Z0-9_]+)[ \t]+0x([0-9A-Fa-f]+)>([;,]?)/,\
        m)) {
      val = strtonum("0x" m[3])
      if (and(val, val-1) == 0) {
        bit = int(log(val)/log(2))
        print m[1] "STM32_CLOCK(" m[2] ", " bit ")>" m[4]
      } else {
        print $0
      }
    } else {
      print
    }
  }' {} \;
```

Signed-off-by: Tomáš Juřena <jurenatomas@gmail.com>
2025-08-20 02:18:25 +02:00
Tomáš Juřena
750857d1cf boards: seger: Use STM32_CLOCK macro in all boards
Replacing the hexadecimal values with bit position is less error-prone
and easier to follow.

The change was done by following command (convert only values where one
bit is set):

```
find boards/st/ -type f \( -name "*.dts" -o -name "*.dtsi" \) \
  -exec gawk -i inplace '{
    if (match(\
        $0,\
        /(.*)STM32_CLOCK_BUS_([A-Z0-9_]+)[ \t]+0x([0-9A-Fa-f]+)>([;,]?)/,\
        m)) {
      val = strtonum("0x" m[3])
      if (and(val, val-1) == 0) {
        bit = int(log(val)/log(2))
        print m[1] "STM32_CLOCK(" m[2] ", " bit ")>" m[4]
      } else {
        print $0
      }
    } else {
      print
    }
  }' {} \;
```

Signed-off-by: Tomáš Juřena <jurenatomas@gmail.com>
2025-08-20 02:18:25 +02:00
Tomáš Juřena
25d0a03baa boards: seeed: Use STM32_CLOCK macro in all boards
Replacing the hexadecimal values with bit position is less error-prone
and easier to follow.

The change was done by following command (convert only values where one
bit is set):

```
find boards/st/ -type f \( -name "*.dts" -o -name "*.dtsi" \) \
  -exec gawk -i inplace '{
    if (match(\
        $0,\
        /(.*)STM32_CLOCK_BUS_([A-Z0-9_]+)[ \t]+0x([0-9A-Fa-f]+)>([;,]?)/,\
        m)) {
      val = strtonum("0x" m[3])
      if (and(val, val-1) == 0) {
        bit = int(log(val)/log(2))
        print m[1] "STM32_CLOCK(" m[2] ", " bit ")>" m[4]
      } else {
        print $0
      }
    } else {
      print
    }
  }' {} \;
```

Signed-off-by: Tomáš Juřena <jurenatomas@gmail.com>
2025-08-20 02:18:25 +02:00
Tomáš Juřena
0d18f32137 boards: seco: Use STM32_CLOCK macro in all boards
Replacing the hexadecimal values with bit position is less error-prone
and easier to follow.

The change was done by following command (convert only values where one
bit is set):

```
find boards/st/ -type f \( -name "*.dts" -o -name "*.dtsi" \) \
  -exec gawk -i inplace '{
    if (match(\
        $0,\
        /(.*)STM32_CLOCK_BUS_([A-Z0-9_]+)[ \t]+0x([0-9A-Fa-f]+)>([;,]?)/,\
        m)) {
      val = strtonum("0x" m[3])
      if (and(val, val-1) == 0) {
        bit = int(log(val)/log(2))
        print m[1] "STM32_CLOCK(" m[2] ", " bit ")>" m[4]
      } else {
        print $0
      }
    } else {
      print
    }
  }' {} \;
```

Signed-off-by: Tomáš Juřena <jurenatomas@gmail.com>
2025-08-20 02:18:25 +02:00
Tomáš Juřena
fc94af1e8f boards: ronoth: Use STM32_CLOCK macro in all boards
Replacing the hexadecimal values with bit position is less error-prone
and easier to follow.

The change was done by following command (convert only values where one
bit is set):

```
find boards/st/ -type f \( -name "*.dts" -o -name "*.dtsi" \) \
  -exec gawk -i inplace '{
    if (match(\
        $0,\
        /(.*)STM32_CLOCK_BUS_([A-Z0-9_]+)[ \t]+0x([0-9A-Fa-f]+)>([;,]?)/,\
        m)) {
      val = strtonum("0x" m[3])
      if (and(val, val-1) == 0) {
        bit = int(log(val)/log(2))
        print m[1] "STM32_CLOCK(" m[2] ", " bit ")>" m[4]
      } else {
        print $0
      }
    } else {
      print
    }
  }' {} \;
```

Signed-off-by: Tomáš Juřena <jurenatomas@gmail.com>
2025-08-20 02:18:25 +02:00
Tomáš Juřena
4531b8ab18 boards: others: Use STM32_CLOCK macro in all boards
Replacing the hexadecimal values with bit position is less error-prone
and easier to follow.

The change was done by following command (convert only values where one
bit is set):

```
find boards/st/ -type f \( -name "*.dts" -o -name "*.dtsi" \) \
  -exec gawk -i inplace '{
    if (match(\
        $0,\
        /(.*)STM32_CLOCK_BUS_([A-Z0-9_]+)[ \t]+0x([0-9A-Fa-f]+)>([;,]?)/,\
        m)) {
      val = strtonum("0x" m[3])
      if (and(val, val-1) == 0) {
        bit = int(log(val)/log(2))
        print m[1] "STM32_CLOCK(" m[2] ", " bit ")>" m[4]
      } else {
        print $0
      }
    } else {
      print
    }
  }' {} \;
```

Signed-off-by: Tomáš Juřena <jurenatomas@gmail.com>
2025-08-20 02:18:25 +02:00
Tomáš Juřena
da1fa63a5c boards: olimex: Use STM32_CLOCK macro in all boards
Replacing the hexadecimal values with bit position is less error-prone
and easier to follow.

The change was done by following command (convert only values where one
bit is set):

```
find boards/st/ -type f \( -name "*.dts" -o -name "*.dtsi" \) \
  -exec gawk -i inplace '{
    if (match(\
        $0,\
        /(.*)STM32_CLOCK_BUS_([A-Z0-9_]+)[ \t]+0x([0-9A-Fa-f]+)>([;,]?)/,\
        m)) {
      val = strtonum("0x" m[3])
      if (and(val, val-1) == 0) {
        bit = int(log(val)/log(2))
        print m[1] "STM32_CLOCK(" m[2] ", " bit ")>" m[4]
      } else {
        print $0
      }
    } else {
      print
    }
  }' {} \;
```

Signed-off-by: Tomáš Juřena <jurenatomas@gmail.com>
2025-08-20 02:18:25 +02:00
Tomáš Juřena
41214e9484 boards: mxchip: Use STM32_CLOCK macro in all boards
Replacing the hexadecimal values with bit position is less error-prone
and easier to follow.

The change was done by following command (convert only values where one
bit is set):

```
find boards/st/ -type f \( -name "*.dts" -o -name "*.dtsi" \) \
  -exec gawk -i inplace '{
    if (match(\
        $0,\
        /(.*)STM32_CLOCK_BUS_([A-Z0-9_]+)[ \t]+0x([0-9A-Fa-f]+)>([;,]?)/,\
        m)) {
      val = strtonum("0x" m[3])
      if (and(val, val-1) == 0) {
        bit = int(log(val)/log(2))
        print m[1] "STM32_CLOCK(" m[2] ", " bit ")>" m[4]
      } else {
        print $0
      }
    } else {
      print
    }
  }' {} \;
```

Signed-off-by: Tomáš Juřena <jurenatomas@gmail.com>
2025-08-20 02:18:25 +02:00
Tomáš Juřena
65ddf37780 boards: microe: Use STM32_CLOCK macro in all boards
Replacing the hexadecimal values with bit position is less error-prone
and easier to follow.

The change was done by following command (convert only values where one
bit is set):

```
find boards/st/ -type f \( -name "*.dts" -o -name "*.dtsi" \) \
  -exec gawk -i inplace '{
    if (match(\
        $0,\
        /(.*)STM32_CLOCK_BUS_([A-Z0-9_]+)[ \t]+0x([0-9A-Fa-f]+)>([;,]?)/,\
        m)) {
      val = strtonum("0x" m[3])
      if (and(val, val-1) == 0) {
        bit = int(log(val)/log(2))
        print m[1] "STM32_CLOCK(" m[2] ", " bit ")>" m[4]
      } else {
        print $0
      }
    } else {
      print
    }
  }' {} \;
```

Signed-off-by: Tomáš Juřena <jurenatomas@gmail.com>
2025-08-20 02:18:25 +02:00
Tomáš Juřena
4d04478674 boards: google: Use STM32_CLOCK macro in all boards
Replacing the hexadecimal values with bit position is less error-prone
and easier to follow.

The change was done by following command (convert only values where one
bit is set):

```
find boards/st/ -type f \( -name "*.dts" -o -name "*.dtsi" \) \
  -exec gawk -i inplace '{
    if (match(\
        $0,\
        /(.*)STM32_CLOCK_BUS_([A-Z0-9_]+)[ \t]+0x([0-9A-Fa-f]+)>([;,]?)/,\
        m)) {
      val = strtonum("0x" m[3])
      if (and(val, val-1) == 0) {
        bit = int(log(val)/log(2))
        print m[1] "STM32_CLOCK(" m[2] ", " bit ")>" m[4]
      } else {
        print $0
      }
    } else {
      print
    }
  }' {} \;
```

Signed-off-by: Tomáš Juřena <jurenatomas@gmail.com>
2025-08-20 02:18:25 +02:00