Commit graph

314 commits

Author SHA1 Message Date
Francois Ramu bb2797e7f0 soc: arm: stm32f0 add rtc feature on this serie
This patch enables the rtc on the stm32f0 soc series
from STMicroelectronics

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-07-24 16:16:21 +02:00
Francois Ramu 4d9dd59310 soc: arm: stm32wb has no PWR clock to enable
The stm32wb soc does not have any PWR clock
for its power IP block when initializing the module.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-07-09 17:35:43 +02:00
Alexandre Bourdiol c8ceca2d53 drivers: STM32 dualcore concurrent register access protection with HSEM
In case of dualcore, STM32H7, STM32W and STM32MP1,
protect concurrent register write access with HSEM.
Done for following drivers:
clock_control, counter, flash, gpio, interrupt_controller

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2020-07-09 11:27:56 +02:00
Francois Ramu fd5ce64db4 soc: arm: st_stm32 add low power to stm32wb series
This patch introduces the support of low power modes
for the STM32WBxx from STMicroelectronics based on the lptim
Here, the power modes are sleep modes have lptimer as wakeup source.
The sleep modes are configured by the SYS_POWER_MANAGEMENT.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-07-02 08:45:40 -04:00
Kwon Tae-young 8bd8b99618 soc: stm32: Add support for stm32f745xx
Add support for STM32F745XX SoC series.

Signed-off-by: Kwon Tae-young <tykwon@m2i.co.kr>
2020-06-23 19:05:26 +02:00
Alexander Kozhinov 54e8bda856 soc: stm32: Add support for stm32h745xx SoC
add stm32h745xx SoC and corresponding device tree

Signed-off-by: Alexander Kozhinov <AlexanderKozhinov@yandex.com>
2020-06-19 18:18:57 +02:00
Alexandre Bourdiol b8a4b9a1a0 soc: arm: st_stm32: add include of devictree.h in soc.h
Replace include of kernel_includes.h by devictree.h
Required when MPU is activated

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2020-06-19 08:55:44 -05:00
Alexandre Bourdiol 6f55614222 board: arm: Enable MPU for all STM32 boards supporting it
Only boards with at least 64K Flash will activate MPU because:
MPU + UERSPACE + All switches implicity activated
(CONFIG_MPU_STACK_GUARD, CONFIG_ARM_STACK_PROTECTION ...)
will consume about 40K Flash
(value computed on nucleo_f767_zi on tests/arch/arm/arm_ramfunc/).

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2020-06-19 08:55:44 -05:00
Gerard Marull-Paretas 528a98ba3f drivers: pwm: stm32: refactor driver using LL API
The PWM drivers has been refactored using the HAL LL API. Not only that,
but the set pin_set function is now faster, as channel output compare is
just initialized if needed.

NOTE: Has been tested using H743zi board for now.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2020-06-19 15:18:50 +02:00
Francois Ramu c0d939ef0a soc: arm: stm32l4s5 new supported device
this patch introduces the stm32L4S5xx soc
from STMicroelectronics (based on the stm32l4r5)

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-06-16 17:48:31 -05:00
Marcin Niestroj 406a33682a soc: stm32: stm32l0: add stm32l011x4 support
Those MCUs have 2KB RAM and 16KB FLASH memory, but they are still
powerful enough to run small configuration of Zephyr RTOS.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-06-16 19:09:23 +02:00
Bilal Wasim a2c4d82778 boards: arm: nucleo_f767zi: Add support for Hardware RNG
Added / Tested support for RNG on the STM32F767ZI nucleo board.
Updated the SoC defconfig to auto-enable the driver when
ENTROPY_GENERATOR is enabled, and updated the board README.

Signed-off-by: Bilal Wasim <bilalwasim676@gmail.com>
2020-06-16 19:09:10 +02:00
Francois Ramu bd17ff7a51 soc: arm: st_stm32 add low power to stm32l4 series
This patch introduces the support of low power modes
for the STM32L4xx from STMicroelectronics based on the lptim
Here, the power modes are sleep modes with lptimer as wakeup.
Depending on the SYS_POWER_MANAGEMENT configuration.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-06-15 16:54:04 +02:00
Ilya Tagunov b899bbf9b9 soc: stm32l1: Enable DAC support
Enable STM32 DAC driver for STM32L1 series.

Signed-off-by: Ilya Tagunov <tagunil@gmail.com>
2020-06-12 11:06:44 +02:00
Francois Ramu 5debc6a94d soc: arm: stm32f2 add rtc feature on this serie
This patch enables the rtc on the stm32f2 soc series
from STMicroelectronics

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-06-10 09:40:21 +02:00
Andreas Sandberg 19c165a119 drivers: entropy: stm32: Add support for STM32L0 SoCs
Add the necessary clock configuration to support STM32L-based
SoCs. This change likely adds support for other STM32 SoCs as well
since the HSI48 clock is configured for all SoCs that support it
(except the STM32L4x) instead of just the STM32G4X.

Signed-off-by: Andreas Sandberg <andreas@sandberg.pp.se>
2020-06-09 14:44:25 +02:00
Kumar Gala a1b77fd589 zephyr: replace zephyr integer types with C99 types
git grep -l 'u\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/u\(8\|16\|32\|64\)_t/uint\1_t/g"
	git grep -l 's\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/s\(8\|16\|32\|64\)_t/int\1_t/g"

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-06-08 08:23:57 -05:00
Pete Johanson f525a4b25a usb: stm32wb: Properly lock Sem5 before initializing USB.
* AN5289 notes that Sem5 should be held before configuring
  CLK48 for USB timing.

Signed-off-by: Pete Johanson <peter@peterjohanson.com>
2020-06-02 20:11:30 +02:00
Francois Ramu 992c005ab9 soc: arm: stm32 TICKS value with LPTIM config
This is defining the SYS_CLOCK_TICKS_PER_SEC default value
depending on the LPTIM CLOCK frequency in case of LPTIMER,
to get a TICK value as a divider of the LPTIM clock source.
It gives a better result in formulas when converting
ticks to count unit.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-05-29 14:13:05 +02:00
Sahaj Sarup 351f39f9cd board: arm: Add Support For 96Boards Aerocore2
Changes:

- Added all required board files in /boards/arm/96b_aerocore2
- Modified pinmux for stm32f4

Most of the changes in this PR is based on reverse-engineering of the
PCB layout and following commits in the PX4 firmware repository for
the same board. The manufacturer does not provide and or generate
schematics and pinout tables for this board.

This PR includes almost all of the interfaces connected to the STM32
MCU, the only thing not included is the J9 and J8 headers that connect
to a 96Boards baseboard.
These headers are not vital to the functionality of the Aerocore2.

Signed-off-by: Sahaj Sarup <sahaj.sarup@linaro.org>
2020-05-08 07:33:43 -05:00
Sahaj Sarup 161d8c0c21 arm: soc: add support for stm32f427
Add STM32F427. This is mainly aimed towards the stm32f427vi.

Changes:

- Add stm32f427 support based on previous work
done for the stm32f429.
- Rework currunt stm32f429 implimentation to now
be based on stm32f427.
- Introduce dedicated dtsi for the VI variant of both
stm32f427 and stm32f429. This is done to prevent stm32f4.dtsi
from being included twice.

Signed-off-by: Sahaj Sarup <sahaj.sarup@linaro.org>
2020-05-08 07:33:43 -05:00
Erwan Gouriou f81c5547f2 boards: nucleo_l552ze_q: Set system clock to 110MHz
Use MSI as PLL source. This enables to run system clock at 110MHz.
To achieve this, voltage regulator should be set to scale 0.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-05-08 00:34:34 -05:00
Erwan Gouriou 1d3c1f8d2e drivers/serial: Add support for stm32l5 soc
Add serial support for STM32L5 serial driver and instances

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-05-08 00:34:34 -05:00
Erwan Gouriou cdd5856167 driver/gpio: stm32: Add STM32L5 support
Add basic GPIO support. Regarding interface with EXTI,
STM32L5 is similar to STM32G0.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-05-08 00:34:34 -05:00
Erwan Gouriou 1f054a7b31 drivers/exti: stm32: Add support for STM32L5 series
Add support for stm32l5 socs on stm32 external interrupts driver

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-05-08 00:34:34 -05:00
Erwan Gouriou f258199595 drivers/clock_control: Add clock_control on STM32L5 series
Add clock_control driver for STM32L5.
It's based on L4/WB driver since it is similar IP.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-05-08 00:34:34 -05:00
Erwan Gouriou 3057d801c7 soc/arm/st_stm32: Add stm32l5 series soc support
This provides basic stm32l5 series SoC support.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-05-08 00:34:34 -05:00
Francois Ramu dc04ce84a4 soc: arm: stm32wb55x series enabling dma and dmamux
This patch defines the dma feature for the stm32wbXX
and the dmamux feature for the stm32wb55x
soc series from STMicroelectronics

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-05-07 23:03:20 -05:00
Gerard Marull-Paretas cfebfc188e drivers: adc: stm32: add support for H7 series
Add support for ADC on H7 series. Note that ADC1 and ADC2 share the same
register set, so it is added as "adc1_2".

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2020-05-07 23:01:59 -05:00
Richard Osterloh 6b41ce5b67 soc: stm32g4: Fix typo in include filename for wwdg
Due to a typo compiling the WWDG on the g4 family does not
work. This adds the correct include filename.

Signed-off-by: Richard Osterloh <richard.osterloh@gmail.com>
2020-05-07 17:24:20 -05:00
Armando Visconti 5097ce6e35 soc: arm: stm32: Enable I2S_STM32 in the common part
Enable I2S_STM32 in the soc common part, so it will no
longer be required in board default configuration.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2020-05-06 10:33:07 -05:00
Kumar Gala 463bce59e4 dts: Remove dts_fixup.h
Remove all remaining dts_fixup.h as all defines in the files are no
longer utilized.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-05 15:46:50 +02:00
Kumar Gala 26c2c010ee dts: Remove DT_ADC_{0..2}_NAME references from dts_fixup.h
Remove DT_ADC_{0..2}_NAME from dts_fixup.h, if this casues the
dts_fixup.h file to be empty we remove the file as well.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-04 14:00:44 -05:00
Kumar Gala b9e6339a4e soc: stm32: stm32f1: adc: Remove use of DT_FOO_LABEL defines
Complete STM32 conversion to new DT macros by removing
remaining occurences of DT_ST_STM32_ADC_FOO_LABEL.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-30 04:45:08 -05:00
Erwan Gouriou 0f91cdbb43 soc: stm32: adc: Remove use of DT_FOO_LABEL defines
Complete STM32 conversion to new DT macros by removing
remaining occurences of DT_ST_STM32_ADC_FOO_LABEL.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-04-29 16:09:15 -05:00
Erwan Gouriou 0d59f63c0a soc: stm32: clean up DT_RTC symbols
Replaced by the DT_INST version

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-04-29 13:13:58 -05:00
Erwan Gouriou 068e2b9032 soc: stm32: Cleanup DT_FLASH_DEV_NAME
No more needed

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-04-29 13:13:58 -05:00
Erwan Gouriou b53824ce63 soc: stm32: can: remove DT define leftover in fixup files
Could be cleaned up following migration of can driver to new DT API.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-04-29 09:08:13 -05:00
Erwan Gouriou 7989800f9e soc: stm32: lptim: remove DT define leftover in fixup files
Could be cleand up following migration of lptim driver to new DT API.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-04-29 09:08:13 -05:00
Erwan Gouriou 826e24ca58 drivers/can: stm32: configure driver thanks to compatible
Remove need to configure from soc/

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-04-28 14:49:55 -05:00
Brian Kubisiak fdf22d1072 arm: stm32f0: Add STM32F030XC support.
Add initial support for the stm32f030xc series of SoCs.

Signed-off-by: Brian Kubisiak <brian@kubisiak.com>
2020-04-24 09:56:46 +02:00
Kumar Gala e737761d23 soc: arm: stm32: stm32f4: remove DT_I2S defines
The DT_I2S_* defines can be removed as the driver is now utilizing the
new dt macros that don't require these defines.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-22 07:11:14 -05:00
Martin Jäger 414527926d drivers: dac: Add support for STM32L0 series
First implementation for STM32L0 series MCUs to be used for testing.

Signed-off-by: Martin Jäger <martin@libre.solar>
2020-04-20 17:41:48 +02:00
Takumi Ando 594bcaccac soc: arm: stm32l1: Fix NUM_IRQS at STM32L152xE
STM32L152xE series have 57(0-56) IRQs.

Signed-off-by: Takumi Ando <takumi@t15.red>
2020-04-20 15:54:22 +02:00
Martí Bolívar f3b4d8a86f soc: remove DT_WDT_0_NAME, DT_WDT_1_NAME
There are no more in-tree users of these fixup macros.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-04-17 16:09:07 -05:00
Kumar Gala fbdeda9df2 dts: arm: remove DT_NUM_IRQ_PRIO_BITS and DT_NUM_MPU_REGIONS
We don't need to define DT_NUM_IRQ_PRIO_BITS or DT_NUM_MPU_REGIONS in
dts_fixup.h files anymore, so we can remove them.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-17 15:17:43 +02:00
Paolo Teti 563990c9ce dts: stm32: G4: Add adc0 and adc1 nodes
Add adc0 and adc1 nodes for STM32G4X SoC series.

Signed-off-by: Paolo Teti <paolo.teti@gmail.com>
2020-04-15 08:26:28 -05:00
Erwan Gouriou c01c74c020 drivers/i2c: stm32: Use DT_NODELABEL_ macros
Make use of DT_NODELABEL macros to get device instances
information to configure drivers I2C instances.
This allows to remove I2C related lines in fixup.h files

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-04-15 08:21:30 -05:00
Erwan Gouriou 9580992b3e drivers/i2c: stm32: Configure driver by compatible
Use compatible information to configure i2c stm32.
With this, driver version selection is done thanks to compatible
and it is not needed anymore to do this via Kconfig symbol
selection under soc/

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-04-15 08:21:30 -05:00
Kumar Gala 43a7d26603 drivers: entropy: replace CONFIG_ENTROPY_NAME with DT macro
Replace CONFIG_ENTROPY_NAME with DT_CHOSEN_ZEPHYR_ENTROPY_LABEL.  We now
set zephyr,entropy in the chosen node of the device tree to the entropy
device.

This allows us to remove CONFIG_ENTROPY_NAME from dts_fixup.h.  Also
remove any other stale ENTROPY related defines in dts_fixup.h files.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-13 09:14:21 -05:00