Commit graph

114 commits

Author SHA1 Message Date
Ali Hozhabri
c8d034cf0b soc: stm32: stm32wb0x: Dedicate RAM section for BLE part
Dedicate RAM section on STM32WB0x for BLE part based on the number
of radio tasks and device type.

Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
2024-11-25 14:42:54 +01:00
Jamie McCrae
2f800cea8f soc: Remove re-defining some defined types
Removes re-defining some Kconfigs that are already defined
e.g. in arch

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-11-18 07:41:23 -05:00
Francois Ramu
f781d7a26f soc: st: stm32U5/L5 series also have SWO line
Add the SWO trace output to the stm32H5/H7RS/L5/U5/WB series

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-11-07 18:05:07 -06:00
Alessandro Manganaro
4b4bba4fa4 soc: st: stm32: stm32wbax: STM32WBA Cube 1.4.1 integration
Removed unnecessary pure HAL stm32 functions

Headers cleanup

Signed-off-by: Alessandro Manganaro <alessandro.manganaro@st.com>
2024-10-27 01:08:47 +02:00
Alessandro Manganaro
13f1200e77 soc: st: stm32: stm32wbax: Files renaming
Files renaming done to better isolate zephyr related
functions from stm32 hal related functions

Signed-off-by: Alessandro Manganaro <alessandro.manganaro@st.com>
2024-10-27 01:08:47 +02:00
Mathieu Choplain
51412b5875 soc: st: stm32wb0: make SMPS mode visible to drivers
Make the SMPS_MODE define visible from drivers by moving it to soc.h

This define is for example used by the ADC driver to determine if sampling
should be synchronized with the SMPS clock.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-10-27 01:08:25 +02:00
Francois Ramu
48a2aedb78 soc: st: stm32h7rs serie requires specific power rails
Enables the XSPIM2 rail when using GPIO bank N
Enables the XSPIM1 rail when using GPIO bank O or P
Enables the USBvoltage detector when using the GPIO M

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-10-11 13:16:43 -04:00
Yong Cong Sin
52a202309b zephyr: bulk update to DT_NODE_HAS_STATUS_OKAY
Change instances of:

DT_NODE_HAS_STATUS(<node_id>, okay)

to

DT_NODE_HAS_STATUS_OKAY(<node_id>)

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-10-03 17:06:52 +01:00
Dan Collins
0e43dd23ae soc: st: adds support for stm32u545xx
This adds support for the stm32u545xx SoC, which extends
the stm32u5 family already present in Zephyr.

Signed-off-by: Dan Collins <dan@collinsnz.com>
2024-09-27 10:56:25 +01:00
Alexander Kozhinov
0f576b047f copyright: change email
Change my email copyright address since unavailability of old one

Signed-off-by: Alexander Kozhinov <ak.alexander.kozhinov@gmail.com>
2024-09-25 04:04:03 -04:00
Erwan Gouriou
3b697a29a2 soc: st: common: Simplify DBGMCU clock control flow
DBGMCU clock handling was not optimal.
If it exists, enable it before dealing with debug configuration in one
block, then deactivate it after in another block.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2024-09-24 14:28:11 -05:00
Erwan Gouriou
6840b58208 soc: st: common: Enable debug in sleep mode on H7
Similarly to debug in stop mode, enable debug in sleep mode on H7 series,
as initially described by `STM32_ENABLE_DEBUG_SLEEP_STOP` option.

Not extending it further to other series as I won't be able to test.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>

# Conflicts:
#	soc/st/stm32/common/soc_config.c
2024-09-24 14:28:11 -05:00
Erwan Gouriou
004a540063 soc: stm32: common: Fix use of legacy HAL API for debug config
HAL_Enable/DisableDBGStopMode() was one of the last usage of HAL
definitions from Legacy HAL APIs.
Use LL instead to harmonize code across series and remove this dependency.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2024-09-24 14:28:11 -05:00
Anas Nashif
f08c91a7e4 soc: stm32g4x/stm32l0x: fix soc hook calls
Missed 2 places related to power management.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-09-21 11:29:06 +02:00
Anas Nashif
c6a03606c2 soc: st: move init code from SYS_INIT to hooks
Replace SYS_INIT with SoC hooks and adapt SoC init code

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-09-20 13:15:31 +02:00
Mathieu Choplain
277504cfbc soc: st: stm32wb0: support SoCs without SMPS output current limit
The STM32WB06 and STM32WB07 SoCs do not support SMPS output current limit.
This makes the LL_PWR_SetSMPSPrechargeLimitCurrent function and all the
LL_PWR_SMPS_PRECH_LIMIT_CUR_xxx defines not visible when one of these SoCs
is selected, resulting in a build failure.

Fix this by only handling SMPS current limit when the feature is available.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-09-16 20:17:50 +02:00
Mathieu Choplain
16ab346f28 soc: st: stm32: add STM32WB0 series
Adds support for the STM32WB0 MCU series.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-09-12 10:03:37 +02:00
Fabrice DJIATSA
4a1f39b9d3 soc: st: stm32: stm32u0x: add soc configs for i2c shared irq
check if two or three I2C instances with same irq are enabled
at same time then enable shared_interrupt handler.

Signed-off-by: Fabrice DJIATSA <fabrice.djiatsa-ext@st.com>
2024-09-11 13:59:54 -04:00
Erwan Gouriou
0e30625eec drivers: clock_control: stm32: Default driver selection out of soc
Rather setting the driver default in soc, make it directly at symbol
level rather than soc and clean up redundant `select` occurrences.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2024-09-06 11:25:43 -04:00
Erwan Gouriou
1483396157 soc: stm32: Select CLOCK_CONTROL by default for whole family
CLOCK_CONTROL subsystem is expected to be enabled systematically on all
STM32 devices.
Make it a series default.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2024-09-06 11:25:43 -04:00
Fabrice DJIATSA
4677920956 soc: st: stm32: add soc for stm32u073
select soc for stm32u073 and irq configuration

Signed-off-by: Fabrice DJIATSA <fabrice.djiatsa-ext@st.com>
2024-09-05 12:25:43 +01:00
Francois Ramu
0fd7028eeb soc: stm32 decrease ticks per sec if sysclock is not LPTIM
Reduce the ticks per sec when the sysclock is low and
not LPTIM.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-09-04 09:53:50 +02:00
Fabrice DJIATSA
21150edc05 soc: st: stm32: add soc for stm32u031
select soc for stm32u031 and irq configuration

Signed-off-by: Fabrice DJIATSA <fabrice.djiatsa-ext@st.com>
2024-09-02 11:53:47 +02:00
IBEN EL HADJ MESSAOUD Marwa
a0c1ca409e soc: st: stm32: Add serie stm32u0
Add STM32U0 familly support

Signed-off-by: IBEN EL HADJ MESSAOUD Marwa <marwa.ibenelhadjmessaoud-ext@st.com>
2024-08-26 11:28:04 -04:00
Pisit Sawangvonganan
daae40811e style: soc: comply with MISRA C:2012 Rule 15.6
Add missing braces to comply with MISRA C:2012 Rule 15.6 and
also following Zephyr's style guideline.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-08-20 10:33:51 +02:00
Mike Banducci
5a8e60b12e soc: stm32: Add support for the stm32h755
Add support for the stm32h755 which is a close relative of
the stm32h745 with additional cryptography and hashing
peripherals.

Signed-off-by: Mike Banducci <michael.banducci@sandc.com>
2024-08-19 10:01:39 -04:00
Francois Ramu
c8e1fdf296 soc: stm32 devices have lower tick with lower sysclock
For stm32 platforms where the sysclock is less or equal to
32MHz, the Ticks per second is reduced to 8000 (instead of
10000).

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-08-07 19:03:18 -04:00
Rahul Arasikere
cc11b26a7d soc: st: stm32f765xx: Correct total number of IRQS.
The total number of IRQs for this chip is 110.
Refer to the reference manual table 46 for IRQs.

Signed-off-by: Rahul Arasikere <arasikere.rahul@gmail.com>
2024-07-30 18:28:53 +01:00
Miguel Gazquez
3408694960 drivers: memc: fix Kconfig option MEMC_STM32
This commit fixes a bug with the declaration of the Kconfig option
MEMC_STM32.

The option is defined in two files:
- `drivers/memc/Kconfig.stm32`, wich depends on
   - `MEMC`
   - `DT_HAS_ST_STM32_FMC_ENABLED`
-`soc/st/stm32/Kconfig.defconfig`, wich depends on
   - `MEMC`
   - `SOC_FAMILY_STM32`

So, if you have `CONFIG_MEMC=y` in your Kconfig options and you are on a
STM32 SoC, `CONFIG_MEMC_STM32` will be enabled, even if there is no
STM32 FMC enabled.

This Kconfig option causes the driver for the STM32 FMC to be compiled,
regardless of the presence of an enabled node for the FMC.
However, the driver fails to compile if there is no FMC node in the
devicetree. So, if you compile a project with `CONFIG_MEMC=y` on a board
with an STM32 SoC and no enabled FMC, the build will fail.

This commit deletes the Kconfig declaration in the `Kconfig.defconfig`,
as it isn't useful and is the one provoking the bug.
It also add in the `Kconfig.stm32` the compatible `st,stm32h7-fmc`, wich
use the same driver and so need to be enabled by the same Kconfig
option.

Signed-off-by: Miguel Gazquez <miguel.gazquez@bootlin.com>
2024-07-05 18:43:06 +02:00
Alessandro Manganaro
594e614f49 soc/st/stm32/st32wbax: STM32WBA55 BLE Ext Adv Fix
SYSTEM_WORKQUEUE_STACK_SIZE increase is required to fix not
only BLE Ext Adv (70935), but also other BLE use cases according
STM32WBA HCI driver

Signed-off-by: Alessandro Manganaro <alessandro.manganaro@st.com>
2024-07-01 09:04:32 -04:00
Francois Ramu
e58ab6d713 soc: stm32: config DBGMCU register writing for SWO configuration
Some stm32 series, do not have a LL_DBGMCU_SetTracePinAssignment
function  to enable trace IO port, this is the case with the
stm32h7 serie.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-06-18 15:52:10 +02:00
Adam Berlinger
19b39406eb soc: st: Add support for STOP3 on STM32U5
LPTIM is not available in STOP3 mode, so RTC needs to be used instead.
This code usese similar approach as STM32WBAx for suspend to ram.
The STOP3 is disabled by default in device tree.

Signed-off-by: Adam Berlinger <adam.berlinger@st.com>
2024-06-15 04:44:26 -04:00
Erwan Gouriou
0a8c3a6e27 soc: stm32: Enable prefecth when missing
Enable ART prefetch when not already done.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2024-06-13 08:05:04 -04:00
Erwan Gouriou
a4fc1b2cfa soc: stm32c0 Enable ART acceleration
Enable instruction cache as well as prefetch.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2024-06-13 08:05:04 -04:00
Erwan Gouriou
a9fb2c4dff soc: stm32g4: Enable ART acceleration
Enable instruction and data cache as well as prefetch.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2024-06-13 08:05:04 -04:00
Erwan Gouriou
76d8be4fe6 soc: stm32: stm32wb: Enable ART accelerations
Enable instruction and data cache as well as prefetch.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2024-06-13 08:05:04 -04:00
Johan Hedberg
b7b606bdaf Bluetooth: drivers: Convert ST STM32WBA driver to new API
Convert the hci_stm32wba.c driver to the new HCI API. Unlike in most cases,
the devicetree node is already enabled on the SoC level (rather than board
level). This is in order to mirror how the Kconfig option was originally
enabled, i.e. on the SoC level.

Signed-off-by: Johan Hedberg <johan.hedberg@gmail.com>
2024-06-11 19:42:49 -04:00
Johan Hedberg
97c3a1e4be Bluetooth: drivers: hci: Get rid of Kconfig choice
The drivers should be independent after the move to the new HCI driver
API. Having them as a choice also has unexpected consequences with some
drivers being unexpectedly enabled.

Signed-off-by: Johan Hedberg <johan.hedberg@gmail.com>
2024-06-11 19:42:49 -04:00
Alessandro Manganaro
7e9d07537d soc: st: stm32: stm32wbax: Updating hci interface with Cube FW 1.3.1
Updating hci interface according STM32WBA Cube FW 1.3.1

Signed-off-by: Alessandro Manganaro <alessandro.manganaro@st.com>
2024-06-10 15:04:36 -05:00
Celina Sophie Kalus
a5c67391bb soc: stm32h7: m4: Always enable hardware semaphore clock
When BCM4 bit is set to zero, the hardware semaphore clock is never
enabled on startup. The hardware semaphores might still randomly work,
but very unreliably, and the locking procedure will need several retries
despite no competition on the hardware semaphores. This leads to wasted
clock cycles on the M4 and sometimes even random kernel panics.

This can be solved by always enabling the hardware semaphore clock in
the init procedure of the M4, regardless of whether it is used within
the initialization or not. On the M7, it is already always enabled.

Signed-off-by: Celina Sophie Kalus <hello@celinakalus.de>
2024-06-10 16:56:59 +03:00
Francois Ramu
f909c4aee2 soc: st: stm32 common soc config introduce stm32h7R/h7S devices
Add the new STM32HRSX serie from STMicroelectronics

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-06-06 00:41:43 -07:00
Francois Ramu
4f995bd0ff soc: arm: stm32h7RS introduce stm32h7R/h7S devices
Add the new STM32HRSX serie with stm32H7R3, stm32H7R7,
stm32H7S3, stm32H7S7 devices from STMicroelectronics
Same MPU regions as stm32h7 device.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-06-06 00:41:43 -07:00
IBEN EL HADJ MESSAOUD Marwa
1e556a85df soc: st: stm32: add stm32h533xx support
Add STM32H533XX familly support

Signed-off-by: IBEN EL HADJ MESSAOUD Marwa <marwa.ibenelhadjmessaoud-ext@st.com>
2024-06-05 17:36:43 -05:00
Abderrahmane Jarmouni
323fcf94f9 soc: st: stm32: complete wkup pins cfg before poweroff
Complete wake-up pins configuration before powering off
the system when the CONFIG_STM32_WKUP_PINS flag is enabled.

Signed-off-by: Abderrahmane Jarmouni <abderrahmane.jarmouni-ext@st.com>
2024-06-05 17:35:55 -05:00
Abderrahmane Jarmouni
ae17e48036 soc: st: stm32: common: introduce a wake-up pins driver
Implement GPIO pins configuration as sources for STM32 PWR wake-up pins
behind the scenes exclusively from devicetree information for all series
using the public stm32_pwr_wkup_pin_cfg_gpio() function.
Introduce macros for parsing & storing DT wake-up pins config in C structs.
Introduce user-configurable STM32_WKUP_PINS Kconfig flag.

Signed-off-by: Abderrahmane Jarmouni <abderrahmane.jarmouni-ext@st.com>
2024-06-05 17:35:55 -05:00
Mathieu Choplain
8aa6ae43ce llext: add support for SLID-based linking
This commit introduces support for an alternate linking method in the
LLEXT subsystem, called "SLID" (short for Symbol Link Identifier),
enabled by the CONFIG_LLEXT_EXPORT_BUILTINS_BY_SLID Kconfig option.

SLID-based linking uses a unique identifier (integer) to identify
exported symbols, instead of using the symbol name as done currently.
This approach provides several benefits:
 * linking is faster because the comparison operation to determine
   whether we found the correct symbol in the export table is now an
   integer compare, instead of a string compare
 * binary size is reduced as symbol names can be dropped from the binary
 * confidentiality is improved as a side-effect, as symbol names are no
   longer present in the binary

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-06-03 15:29:34 -04:00
Lubos Koudelka
88de80b774 drivers: clock_control: stm32: adding config_regulator_voltage for L0
STM32 MCU shall set voltage regulator level with respect to set clock
frequency to reach optimal power consumption.
Voltage regulator is set prior to clock setting based on configuration
from dts/overlay file. Config_regulator_voltage is set as weak in
clock_stm32_ll_common - config_regulator_voltage can be
extended to other STM32 families without need to rewrite heavily
family clock driver, default one can be still used.

Signed-off-by: Lubos Koudelka <lubos.koudelka@st.com>
2024-05-30 09:47:12 -05:00
Romain Pelletant
202c16008f soc: stm32c0: add poweroff mode
Add poweroff mode support for STM32C0
Fixes #73371

Signed-off-by: Romain Pelletant <romainp@kickmaker.net>
2024-05-30 08:59:50 +02:00
Erwan Gouriou
101f791994 soc: stm32: common: Fix proprocessor if/else flow
No reason to be more complex than it should be.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2024-05-27 08:15:59 -07:00
Erwan Gouriou
0620cd9912 soc: stm32: common: Fix Kconfig symbol usage
These symbols don't exist.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2024-05-27 08:15:59 -07:00