Commit graph

393 commits

Author SHA1 Message Date
Alexander Kozhinov 3ad1f91a80 drivers: pinumx: stm32: pinmux_stm32h7: added ethernet pins
added ethernet pins definition for stm32h7 SoC series

Signed-off-by: Alexander Kozhinov <AlexanderKozhinov@yandex.com>
2020-07-21 15:12:18 +02:00
Jeremy LOCHE 8344b8080b drivers: pinmux: corrected all USART6 alternate functions
Fixed AF for USART 6 on PC6/PC7 PG8/PG9/PG12/PG13/PG14/PG15
All RTS/CTS/RX/TX pins now have correct AF7 instead of wrong AF8.

Signed-off-by: Jeremy LOCHE <lochejeremy@gmail.com>
2020-07-13 11:53:12 +02:00
Jeremy LOCHE 695bd85b99 drivers: pinmux: stm32h7: fix incorrect PG9/PG14 usart6 AF
Fixes AF of PG9/PG14 for usart6. Must be AF7 instead of AF8

Signed-off-by: Jeremy LOCHE <lochejeremy@gmail.com>
2020-07-13 11:53:12 +02:00
Kwon Tae-young a4d5207675 drivers: pinmux: stm32f7: CAN, SPI, I2C pinmuxes added
All pinmux supporting CAN, SPI and I2C of F7 series are added.
Since the F7 series supports up to two CANs,
the pin names of CANs have been changed.

Several minor pinmux errors have also been fixed.
Sorted by Alternate function.

Signed-off-by: Kwon Tae-young <tykwon@m2i.co.kr>
2020-06-23 19:05:26 +02:00
Markus Becker 51d84c9eb4 drivers: pinmux: stm32: add PWM pinmux on PA3 for F4 series
Add PWM2 CH4 functionality on PA3 pin.

Signed-off-by: Markus Becker <markus.becker@tridonic.com>
2020-06-16 19:11:35 +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
Andreas Sandberg aec341e677 boards: arm: b_l072z_lrwan1: Enable the USB controller
The STM32L072CZ MCU has a built-in USB device controller which is
supported by Zephyr's USB STM32 driver. The b_l072z_lrwan1 board has a
micro-USB connector that is wired to the MCU via two solder bridges
(SB15 and SB16) that need to be closed to connect the data lines.

Update the board documentation to describe the solder bridges and
enable the USB controller in the device tree.

Signed-off-by: Andreas Sandberg <andreas@sandberg.pp.se>
2020-06-11 13:11:59 -05:00
Dimitris Tassopoulos c2e9c1fa49 boards: nucleo_f401re: added pwm-led0
Added onboard led to the devicetree to be supported also with pwm-led0

Signed-off-by: Dimitris Tassopoulos <dimtass@gmail.com>
2020-06-11 10:58:58 +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
Martí Bolívar 6e8775ff84 devicetree: remove DT_HAS_NODE_STATUS_OKAY
Several reviewers agreed that DT_HAS_NODE_STATUS_OKAY(...) was an
undesirable API for the following reasons:

- it's inconsistent with the rest of the DT_NODE_HAS_FOO names
- DT_NODE_HAS_FOO_BAR_BAZ(node) was agreed upon as a shorthand
  for macros which are equivalent to
  DT_NODE_HAS_FOO(node) && DT_NODE_HAS_BAR(node) &&
- DT_NODE_HAS_BAZ(node), and DT_HAS_NODE_STATUS_OKAY is an odd duck
- DT_NODE_HAS_STATUS(..., okay) was viewed as more readable anyway
- it is seen as a somewhat aesthetically challenged name

Replace all users with DT_NODE_HAS_STATUS(..., okay), which is
semantically equivalent.

This is mostly done with sed, but a few remaining cases were done by
hand, along with whitespace, docs, and comment changes. These special
cases include the Nordic SOC static assert files.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-13 18:24:42 +02:00
Martí Bolívar 7e0eed9235 devicetree: allow access to all nodes
Usually, we want to operate only on "available" device
nodes ("available" means "status is okay and a matching binding is
found"), but that's not true in all cases.

Sometimes we want to operate on special nodes without matching
bindings, such as those describing memory.

To handle the distinction, change various additional devicetree APIs
making it clear that they operate only on available device nodes,
adjusting gen_defines and devicetree.h implementation details
accordingly:

- emit macros for all existing nodes in gen_defines.py, regardless
  of status or matching binding
- rename DT_NUM_INST to DT_NUM_INST_STATUS_OKAY
- rename DT_NODE_HAS_COMPAT to DT_NODE_HAS_COMPAT_STATUS_OKAY
- rename DT_INST_FOREACH to DT_INST_FOREACH_STATUS_OKAY
- rename DT_ANY_INST_ON_BUS to DT_ANY_INST_ON_BUS_STATUS_OKAY
- rewrite DT_HAS_NODE_STATUS_OKAY in terms of a new DT_NODE_HAS_STATUS
- resurrect DT_HAS_NODE in the form of DT_NODE_EXISTS
- remove DT_COMPAT_ON_BUS as a public API
- use the new default_prop_types edtlib parameter

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-08 19:37:18 -05:00
Tomasz Bursztyka 97326c0445 device: Fix structure attributes access
Since struct devconfig was merged earlier into struct device, let's fix
accessing config_info, name, ... attributes everywhere via:

grep -rlZ 'dev->config->' | xargs -0 sed -i 's/dev->config->/dev->/g'

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-05-08 23:07:44 +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
Helge Juul dc0c938359 boards: arm: stm32f746g_disco: enable sdmmc support
Update dtsi and pinmux macros for stm32f7 family. Add sdmmc1 to dts file
for stm32f746g_disco. Also add board specific configuration file for
fat_fs sample.

Signed-off-by: Helge Juul <helge@fastmail.com>
2020-05-08 10:53:10 +02:00
Anthony Brandon a71f77e601 boards: arm: stm32l496g_disco: enable sdmmc support
Update the dtsi for stm32l471 (which the higher SoCs are based on) to
support the stm32-sdmmc disk access device. Enable the device for the
stm32l496g_disco board, and update the pinmuxing.
Note that the stm32l496g_disco board also has a card detect gpio
(MFX_GPIO8), but this is not supported yet. When not specified the
driver will assume a card is present.

Signed-off-by: Anthony Brandon <anthony@amarulasolutions.com>
2020-05-08 10:53:10 +02:00
Erwan Gouriou 4b3d79f1bb drivers: stm32: Add pinmux headers for stm32l5
Copy/pasted from L4 series.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-05-08 00:34:34 -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
Francois Ramu 01e9983142 drivers: pinmux: stm32wb: use a pull-down for SPI SCK pin
Like stm32 L4 does,
when the STM32WBx SoC goes into STOP mode, the SPI device is disabled.
This cause the pins to not be drived anymore (i.e. they are floating)
except through their pull-up or pull-down.

From the logical point of view, the NSS pin is held high by a pull-up
so it's not a problem if the other pins are floating. However those pins
are floating input for the slaves, which increase their power
consumption.

The solution is to hold the state of the pins through a pull-up or a
pull-down. This is already done for the NSS and MOSI pins, but not for
SCK. Fix that by using pull-down on the SCK pin the same way it is
already done for the MOSI pin.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-05-07 23:00:32 -05:00
Kumar Gala 0a7d4e2135 devicetree: Change DT_FOREACH_IMPL_ to not insert semicolon
Remove semicolon between instance invocations of DT_FOREACH_IMPL_ and
thus DT_INST_FOREACH.  This provides more flexibility to the user.  This
requires we fixup in tree users to add semicolon where needed.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-07 20:03:56 -05:00
Pete Johanson 91d6139338 boards: arm: nucleo_wb55rg: Enable USB for stm32wb.
* Define USB driver for base stm32wb device.
* Enable USB for the nucleo_wb55rg board.
* Properly initialize USB power + clock for the platform.

Signed-off-by: Pete Johanson <peter@peterjohanson.com>
2020-05-06 10:46:23 -05:00
Kumar Gala fdd85d5ad7 dts: Rename DT_HAS_NODE macro to DT_HAS_NODE_STATUS_OKAY
Rename DT_HAS_NODE to DT_HAS_NODE_STATUS_OKAY so the semantics are
clear.  As going forward DT_HAS_NODE will report if a NODE exists
regardless of its status.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-06 05:25:41 -05:00
Martin Jäger e55483495e drivers: pinmux: stm32: Complete STM32F0 series
Fix some wrong assignments for SPI2 and add all other alternative
functions for USART, I2C, SPI and CAN according to STM32F091VC
datasheet, which is at the top end of this series.

https://www.st.com/resource/en/datasheet/stm32f091vc.pdf

Signed-off-by: Martin Jäger <martin@libre.solar>
2020-05-05 11:06:47 -05:00
Daniel Leung 5692702248 drivers: pinmux: mchp_xec: Convert to using new device tree macros
Convert driver to use the new device tree macro's instead of
dts_fixup.h based macros. This moves us closer to removing both
dts_fixup.h and per instance Kconfig symbols.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-04-28 07:43:31 -05:00
Kumar Gala 1192e32dac drivers: pinmux: sam0: Conver to new DT macros
Convert pinmux driver to use nodelabels to get references to devicetree
nodes using the new devicetree.h macros.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-25 13:47:39 -05:00
Kwon Tae-young 84817f4906 drivers: pinmux: stm32l4: I2C_1, CAN pinmuxes added
Add pin configuration for I2C_1 and CAN.

Signed-off-by: Kwon Tae-young <tykwon@m2i.co.kr>
2020-04-24 06:36:35 -05:00
Aurelien Jarno 298df51c0c drivers: pinmux: stm32l4: Add extra pins for I2C1
Add I2C1 SDA/SCL configuration on pins PA9 and PA10, as they are
currently only available on other pins.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2020-04-22 17:39:12 +02:00
Kumar Gala 576033f858 drivers: pinmux: intel_s1000: Convert to DT_INST
Convert driver to use new DT_INST macros throughout.  This allows us to
also remove dts_fixup.h that are no longer used.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-20 15:21:39 -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 c2b2aad8ae soc: arm: stm32l1: Add UART4 and UART5 supports
Add UART4 and UART5 supports for STM32L1 series.

Signed-off-by: Takumi Ando <takumi@t15.red>
2020-04-20 15:54:22 +02:00
Aurelien Jarno 2a396561d4 drivers: pinmux: stm32l4: use a pull-down for SPI SCK pin
When the STM32L4x SoC goes into STOP mode, the SPI device is disabled.
This cause the pins to not be drived anymore (i.e. they are floating)
except through their pull-up or pull-down.

From the logical point of view, the NSS pin is held high by a pull-up
so it's not a problem if the other pins are floating. However those pins
are floating input for the slaves, which increase their power
consumption.

The solution is to hold the state of the pins through a pull-up or a
pull-down. This is already done for the NSS and MOSI pins, but not for
SCK. Fix that by using pull-down on the SCK pin the same way it is
already done for the MOSI pin.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2020-04-17 13:21:12 -05:00
Aurelien Jarno c695899e04 drivers: pinmux: stm32l4: use consistent config for SPI pins
Most of the MISO and MOSI SPI pins of STM32L4 SoCs are configured with
a pull-down except PE14 and PE15. Change them for consistency.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2020-04-17 13:21:12 -05:00
Kumar Gala 8f0018663f drivers: pinmux: rv32m1: Convert driver to new DT_INST macros
Convert driver to use DT_INST macros and remove related board per
instance Kconfig symbol usage.

Updated the openisa,rv32m1_vega-pinmux binding to require the label
property and updated the rv32m1.dtsi to add label properties for the
pinmux nodes.

Also update gpio_basic_api test to use DT_NODELABEL.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-10 14:38:04 -05:00
Abe Kohandel 5f3ed2660c drivers: pinmux: stm32: add pin for I2S3_WS on F4 series
Enable I2S3 WS functionality on PA15 pin

Signed-off-by: Abe Kohandel <abe@electronshepherds.com>
2020-04-08 12:07:14 -05:00
Gerard Marull-Paretas 4194360cb5 drivers: pwm: stm32: add support for H7 series
Enable PWM support for H7 series.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2020-04-04 15:00:11 +02:00
Francois Ramu 66fd31959c drivers: pinmux: stm32: add pin for UART5 on H7 series
Enable UART5 Rx and TX pins for H7 series:
H742, H743/753, H745/755, H747/757, H750.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-03-30 12:58:10 -05:00
Kumar Gala 8ea8925ebe drivers: esp32: Convert esp32 drivers to new DT_INST macros
Convert older DT_INST_ macro use in esp32 drivers to the new
include/devicetree.h DT_INST macro APIs.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-26 08:49:11 -05:00
Takumi Ando 8d106d198e drivers: adc: Add STM32L1X ADC support
Add ADC driver support for STM32L1X SoC series.

Signed-off-by: Takumi Ando <takumi@t15.red>
2020-03-19 03:10:39 -05:00
Gerard Marull-Paretas 39b1f6cbba drivers: i2c: stm32: add support for H7 series
Enable I2C driver for STM32 H7 series.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2020-03-18 15:48:48 -05:00
Gerard Marull-Paretas f2b9e5235f drivers: pinmux: stm32: fix PB6 LPUART1 alt function on H7
LPUART1 TX alternate function number for PB6 was not correct in the
pinmux settings for H7 series.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2020-03-18 15:48:48 -05:00
Francois Ramu 36ec040473 driver: pinmux: stm32f7 configure speed for SPI clock pins
This patch is setting the pin to very high speed for all
the SPI2 clock outputs, for the stm32f7 soc series.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-03-17 16:01:22 -05:00
Jukka Rissanen f53d9756be board: arm: black_f407ve: Initial support
Add support for black_f407ve board which is based on
stm32f407xx soc.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-03-12 20:18:39 +02:00
Richard Osterloh 8ccccbb7f6 drivers: pinmux: Add SPI1 NSS config on PA15
Add alternative function 5 configuration for PA15
on STM32F4 devices.

Signed-off-by: Richard Osterloh <richard.osterloh@gmail.com>
2020-03-11 13:06:55 -05:00
Ulf Magnusson eddd98f811 kconfig: Replace some single-symbol 'if's with 'depends on'
I think people might be reading differences into 'if' and 'depends on'
that aren't there, like maybe 'if' being needed to "hide" a symbol,
while 'depends on' just adds a dependency.

There are no differences between 'if' and 'depends on'. 'if' is just a
shorthand for 'depends on'. They work the same when it comes to creating
implicit menus too.

The way symbols get "hidden" is through their dependencies not being
satisfied ('if'/'depends on' get copied up as a dependency on the
prompt).

Since 'if' and 'depends on' are the same, an 'if' with just a single
symbol in it can be replaced with a 'depends on'. IMO, it's best to
avoid 'if' there as a style choice too, because it confuses people into
thinking there's deep Kconfig magic going on that requires 'if'.

Going for 'depends on' can also remove some nested 'if's, which
generates nicer symbol information and docs, because nested 'if's really
are so simple/dumb that they just add the dependencies from both 'if's
to all symbols within.

Replace a bunch of single-symbol 'if's with 'depends on' to despam the
Kconfig files a bit and make it clearer how things work. Also do some
other minor related dependency refactoring.

The replacement isn't complete. Will fix up the rest later. Splitting it
a bit to make it more manageable.

(Everything above is true for choices, menus, and comments as well.)

Detected by tweaking the Kconfiglib parsing code. It's impossible to
detect after parsing, because 'if' turns into 'depends on'.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-02-08 08:32:42 -05:00
Ivo Clarysse 29d2a438ab drivers: pinmux: stm32f4: add CAN_2 pins
Add pinmux definitions for CAN_2 RX/TX pins on PB5/PB6 and PB12/PB13.

Signed-off-by: Ivo Clarysse <ivo@bcdevices.com>
2020-01-30 14:27:28 -05:00
Henrik Brix Andersen 0b15a836a5 drivers: pinmux: stm32f3: add CAN_1 pins
Add pinmux definitions for CAN_1 RX/TX pins on PD0/PD1.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-01-29 09:47:27 +01:00
Peter Bigot 0b0d2e640b treewide: use full path to clock_control/stm32_clock_control.h header
The build infrastructure should not be adding the drivers subdirectory
to the include path.  Fix the legacy uses that depended on that
addition.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-26 17:52:12 +01:00
Kumar Gala b1602c8e39 arm: Removed support for CC2650
The SoC, driver, and board support for the CC2650 and CC2650 Sensortag
aren't currently supported and we are removing them as such.  If anyone
is interesting in supporting this platform we can easily recovery it
from git.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-01-18 09:27:55 -06:00
Pushpal Sidhu 74f9c23ac6 pinmux: stm32: l4: Make SPI SCK and MOSI pins Very High Speed
Ensure that the SPI SCK and MOSI pins are set to very high as slower
SPI speeds will cause device hangs when used. This is due to the state
changing too fast for hardware, causing RXE to never fire and thus
hang.

Signed-off-by: Pushpal Sidhu <psidhu.devel@gmail.com>
2020-01-17 06:47:20 -06:00
Filip Brozovic 19d1ea2646 boards: stm32g0316-disco: add support for the ST STM32G0316-DISCO board
Add support for the ST STM32G0316-DISCO development board. This board
features an ST STM32G031J6 MCU on a breakable SO8 to DIL8 module, a user
LED and a button.

Signed-off-by: Filip Brozovic <fbrozovic@gmail.com>
2019-12-18 22:06:39 +01:00
Pauli Salmenrinne ca6eee5444 boards: stm32f411e_disco: Add pwm to drive green led
This enables the fade_led example to work with this board.

Signed-off-by: Pauli Salmenrinne <susundberg@gmail.com>
2019-12-18 14:48:06 -06:00