Commit graph

11754 commits

Author SHA1 Message Date
Sjors Hettinga ae31773ddd drivers: net: loopback: Add counting of number of dropped packets
When the loopback drops driver packets, the number of dropped
packets is counted and can be requested externally.

Signed-off-by: Sjors Hettinga <s.a.hettinga@gmail.com>
2022-05-16 16:55:51 +02:00
Wael Barakat 4b3fe99b83 drivers: gpio: nrf: fix pin number used in getting GPIOTE channel
Incorrect GPIOTE channel was being freed because the pin number
being used is not the absolute pin but the pin within the port.

Signed-off-by: Wael Barakat <waelsbarakat@gmail.com>
2022-05-16 09:41:04 +02:00
Felipe Neves 44631ebada drivers: wifi: esp_at: add support for firmware
V2.1 for ESP At and make it to coexist
with the current versions.

Signed-off-by: Felipe Neves <felipe.neves@linaro.org>
2022-05-15 21:34:32 +02:00
Keiya Nobuta 5d662ae3f8 drivers: kscan: Add CAP1203 driver
Add driver for Microchip CAP1203 3-Channel Capacitive Touch Sensor

datasheet: https://ww1.microchip.com/downloads/en/DeviceDoc/00001572B.pdf

Signed-off-by: Keiya Nobuta <nobuta.keiya@fujitsu.com>
2022-05-15 21:31:54 +02:00
Andrzej Głąbek 77edc2c852 dts: Include ADC DT binding headers from nRF SoC dtsi files
Add inclusions of header files with devicetree related ADC definitions
to the nRF SoC dtsi files so that those definitions can be used also
for nRF SoC based boards.
Provide definitions of nRF ADC and SAADC analog inputs suitable
for use in devicetree.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2022-05-13 12:46:06 -07:00
Nazar Palamar d940d23c10 modules: hal_infineon: added initial Kconfig and CMakeLists.txt
- added initial Kconfig
- added initial CMakeLists.txt (root, core-lib,  mtb-pal-cat1)
- updated module, driver and soc to use CONFIG_USE_INFINEON_xx
  defines from modules/hal_infineon/Kconfig

Signed-off-by: Nazar Palamar <nazar.palamar@infineon.com>
2022-05-13 21:34:59 +02:00
TOKITA Hiroshi 7e4cf8308d drivers: display: st7735r: added inversion-on property
Add 'inversion-on' property to st7735r.
Issue INVON(21h) command on initializing if inversion-on was enabled.
As a result of this command, the display color is inverted.
Otherwise, INVOFF(20h) will be issued.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2022-05-13 11:04:21 -07:00
Georgij Cernysiov 4f10178f3d drivers: flash: stm32: qspi: use ternary and asserts in quad prepare
Use ternary operation and asserts to reduce the footprint
and code size.

Signed-off-by: Georgij Cernysiov <geo.cgv@gmail.com>
2022-05-13 08:44:54 -07:00
Georgij Cernysiov c54e7d162a drivers: flash: stm32: qspi: remove flag_quad_io_en field
There is no need in the `flag_quad_io_en` field.
When QE enabling failed, then the driver `init` fails as well.

There is no way to use qspi in quad mode if qe is not enabled.

Signed-off-by: Georgij Cernysiov <geo.cgv@gmail.com>
2022-05-13 08:44:54 -07:00
Georgij Cernysiov a8e0699972 drivers: flash: stm32: qspi: always include gpio header
Always include gpio header.

Signed-off-by: Georgij Cernysiov <geo.cgv@gmail.com>
2022-05-13 08:44:54 -07:00
Georgij Cernysiov 13af1ca9f1 drivers: flash: stm32: qspi: support SFDP quad enable requirements
Parses SFDP QER related DW15 to use as the source for QER.

Signed-off-by: Georgij Cernysiov <geo.cgv@gmail.com>
2022-05-13 08:44:54 -07:00
Georgij Cernysiov 685f2098c4 drivers: flash: stm32: qspi: support DTS quad enable requirements
Adds support for DTS quad_enable_requirements property.

Signed-off-by: Georgij Cernysiov <geo.cgv@gmail.com>
2022-05-13 08:44:54 -07:00
Georgij Cernysiov 706697168b drivers: flash: stm32: qspi: move prepare cmd is enable check
Moves IS_ENABLE check from prepare program and read to the caller.

Signed-off-by: Georgij Cernysiov <geo.cgv@gmail.com>
2022-05-13 08:44:54 -07:00
Georgij Cernysiov bbdfe6d9e0 drivers: flash: stm32: qspi: support 1-4-4 and 1-1-4 quad read modes
Adds support for 1-4-4 and 1-1-4 read modes.

SFDP is used to query for available read instructions, then the
fastest one is used.

Signed-off-by: Georgij Cernysiov <geo.cgv@gmail.com>
2022-05-13 08:44:54 -07:00
Georgij Cernysiov 0216353263 drivers: flash: stm32: qspi: support DTS writeoc
Adds support for DTS writeoc.

Uses 1-4-4 mode by default (as the original driver).

Signed-off-by: Georgij Cernysiov <geo.cgv@gmail.com>
2022-05-13 08:44:54 -07:00
Georgij Cernysiov 4ef6b82681 drivers: flash: stm32: qspi: minor cleanup
Removes double line and log output regarding
device initialization.

Signed-off-by: Georgij Cernysiov <geo.cgv@gmail.com>
2022-05-13 08:44:54 -07:00
Georgij Cernysiov c2dfeb11c1 drivers: flash: jesd216: correct comment mistake
Corrects type name in the comment for the DW15 QER field.

Signed-off-by: Georgij Cernysiov <geo.cgv@gmail.com>
2022-05-13 08:44:54 -07:00
Georgij Cernysiov b43741cd5d drivers: flash: spi_nor: add SR3 read and write defines
Adds Status Register 3 read and write opcode defines.

Signed-off-by: Georgij Cernysiov <geo.cgv@gmail.com>
2022-05-13 08:44:54 -07:00
Georgij Cernysiov 22c8022b54 drivers: falsh: spi_nor: add PP_1_1_4 and rename 4PP
* Renames 4PP define to PP_1_4_4
* Adds PP_1_1_4 define

That matches linux kernel defines a bit more.

Signed-off-by: Georgij Cernysiov <geo.cgv@gmail.com>
2022-05-13 08:44:54 -07:00
Georgij Cernysiov 78ecf65267 drivers: flash: spi_nor: remove not used QE bit define
Removes unused QE bit define.

Signed-off-by: Georgij Cernysiov <geo.cgv@gmail.com>
2022-05-13 08:44:54 -07:00
Thomas Altenbach cc51031445 drivers/entropy: stm32: fix inter-core race condition
On STM32WB and dual-core STM32H7 MCUs, the RNG peripheral is shared
between the cores and its access is protected by a hardware semaphore.
Locking was not performed in the current entropy driver, leading to a
race condition when multiple cores concurrently used the RNG. This
commit implements the necessary logic for locking the HSEM during entropy
generation on multi-core STM32 MCUs. It also reconfigures the RNG in case
the configuration was changed by the other core, as this can happen e.g
on STM32WB MCUs.

Signed-off-by: Thomas Altenbach <taltenbach@witekio.com>
2022-05-13 10:28:53 -05:00
Peter Johanson 43b77a2191 drivers: usb: Add RP2040 USB device support.
Add USB device driver for Rasberry Pico family of controllers.

Signed-off-by: Peter Johanson <peter@peterjohanson.com>
2022-05-13 16:28:27 +02:00
Jonathan Hahn 05cc2e1ac3 drivers: serial: add pin inversion to stm32 u(s)art
Additional properties are added to stm32 u(s)art to allow
for signal inversion.

Signed-off-by: Jonathan Hahn <Jonathan.Hahn@t-online.de>
2022-05-13 08:45:55 -05:00
Jordan Yates 993cad1b4a wifi: esp_at: cleanup sockets at network close
Some sockets (UDP sockets at least) do not generate "<N>,CLOSED"
messages when the WiFi network drops. As a result the networking stack
thinks these sockets are still open after the network has dropped, and
after any subsequent reconnections.

This affects the DNS resolver library in particular, which leaves UDP
sockets open permanently by default.

Manually close these sockets when the network drops to ensure a clean
state the next time the network connects.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2022-05-13 14:53:48 +02:00
Jordan Yates a2c0bd8dd1 wifi: esp_at: notify receivers on async close
`esp_close_work` can be queued from the `on_cmd_closed`, which clears
`ESP_SOCK_CONNECTED` and sets `ESP_SOCK_CLOSE_PENDING`, but does no
further work. The receive callback should still be run with no data when
the socket is closed through this mechanism.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2022-05-13 14:53:48 +02:00
Jordan Yates c28874657b spi: spi_b91: use new DT_INST_STRING_TOKEN macro
Use the dedicated `DT_INST_STRING_TOKEN` macro instead of manually
retrieving `DT_DRV_INST`.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2022-05-13 14:17:08 +02:00
Yasushi SHOJI f14e9e408b serial: xilinx: uartlite: Fix bus fault
Xilinx AXI UART Lite v2.0[1] has the following clause for both RX and TX
FIFO respectively:

    When a read request is issued to an empty FIFO, a bus error (SLVERR) is
    generated and the result is undefined.

    When a write request is issued while the FIFO is full, a bus
    error (SLVERR) is generated and the data is not written into the FIFO.

To protect this, we have:

    xlnx_uartlite_read_status(dev) & STAT_REG_RX_FIFO_VALID_DATA, and
    xlnx_uartlite_read_status(dev) & STAT_REG_TX_FIFO_FULL

but these are not enough for multi-threaded apps.  Consider two threads
calling poll_out(), it is always possible for a thread to be swapped out
right after reading the status register, the other thread fill the TX FIFO,
and the original thread is swapped back to write more data to the FIFO
because previously read status doesn't indicate the FIFO is full.

To close this race condition, this commit uses a spinlock for each FIFO.
This ensures that only one thread accesses the FIFO even for SMP cases.

This closes #45302.

[1] https://docs.xilinx.com/v/u/en-US/pg142-axi-uartlite

Signed-off-by: Yasushi SHOJI <yashi@spacecubics.com>
2022-05-12 19:05:15 -04:00
Daniel DeGrasse ddee8d7f4e drivers: pwm_imx: add pin control support
Add pin control support to pwm_imx driver.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-05-12 16:57:17 -05:00
Daniel DeGrasse 7299a2994a drivers: i2c_imx: add pin control support
Add pin control support to i2c_imx driver.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-05-12 16:57:17 -05:00
Daniel DeGrasse c4a7985064 drivers: uart_imx: add pin control support
Add pin control support to uart_imx serial driver.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-05-12 16:57:17 -05:00
Daniel DeGrasse 694637a83c drivers: uart_mcux_iuart: add pin control support
Add pin control support to mcux_iuart driver.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-05-12 16:57:17 -05:00
Daniel DeGrasse 0f7145e037 drivers: gpio_imx: Add pin control support
Add pin control support to gpio_imx driver, so that GPIO pin muxes will
be selected when the use configures a pin as GPIO.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-05-12 16:57:17 -05:00
Daniel DeGrasse a4ad9d4c60 drivers: gpio_mcux_igpio: add additional SOC pin control settings
Add additional pin controller settings for iMX application core SOCs, as
well as a "fallback" pin control setting.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-05-12 16:57:17 -05:00
Daniel DeGrasse bc841e1fb7 drivers: pinctrl: refactor pin control support for imx rt
Refactor iMX RT pin control support to use more generic names, as the
IOMUXC peripheral is present on non RT iMX application cores.
Additionally, make selection of the pin control driver occur at the SOC
level.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-05-12 16:57:17 -05:00
Francois Ramu 084dc3f0dd drivers: flash: ospi factorized for stm32 devices
Simplifies the driver and Gives a generic function to prepare the Regular
commands for each instruction.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-05-12 14:56:25 -05:00
Francois Ramu 16754378fb drivers: flash : introduce a new driver for the OCTOSPI
This is the stm32 octospi driver based on the exisitng quadspi
 for stm32 devices and source code from the STM32Cube.
This drivers initialized the peripheral and the NOR memory
in SPI or OctoSPI mode with STR or DTR data Transfer rates.
The NOR-flash can provide the SDFP table directly (if supported)
or through the DeviceTree.
 Limitation: no DMA transfer.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-05-12 14:56:25 -05:00
Francois Ramu 712d2537be drivers: flash: JESD216 ospi command for SFDP
Includes the 16bit command to read the SFDP in the NOR flash.
according to the JEDEC standard.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-05-12 14:56:25 -05:00
Francois Ramu 5b029377ab drivers: flash: spi nor header includes definition for OSPI commands
With the introduction of the OSPI NOR flash controller
more octal commands and parameters are defined.
It completes the existing SPI commands

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-05-12 14:56:25 -05:00
Jose Alberto Meza 3ebe2a8e80 drivers: pinctrl: xec: Prevent glitch for QMSPI on MAF
Whenever EC bootloader already configured a pin as output and
high, any further reconfiguration via pinctrl driver causes a
glitch in said pin with current sequence.

Defer pin direction configuration to be last operation over
gpio control register to avoid the glitch.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2022-05-12 14:49:45 -05:00
Jordan Yates 9d58fa7ac9 wifi: esp_at: log message on async close
Log a message when the modem asynchronously closes a link. This is
useful information to the user as it can explain the root cause of later
failures.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2022-05-12 15:27:01 -04:00
Mulin Chao 33c7119e87 drivers: espi: host_subs: add pinctrl driver support
Replace soc-specific pin functions with Zephyr pinctrl api functions for
pin-mux configuration in npcx eSPI and host_subs driver.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2022-05-12 14:24:03 -05:00
Mulin Chao 7ef371b2e7 drivers: adc: add pinctrl driver support
Replace soc-specific pin functions with Zephyr pinctrl api functions for
pin-mux configuration in npcx adc driver. Please notice users need to
configure the corresponding pinctrl nodes in 'pinctrl-0' property in the
adc0 DT node. For example, if ADC0 and ADC2 channels are selected for
the application, please add the follwoings in your board DT layout file.

&adc0 {
	status = "okay";
	/* Use adc0 channel 0 and 2 for 'adc_api' driver tests */
	pinctrl-0 = <&adc0_chan0_gp45
		     &adc0_chan2_gp43>;
	pinctrl-names = "default";
};

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2022-05-12 14:24:03 -05:00
Mulin Chao 22f9036577 drivers: sensor: npcx_tach: add pinctrl driver support
Replace soc-specific pin functions with Zephyr pinctrl api functions for
pin-mux configuration in npcx tachometer driver.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2022-05-12 14:24:03 -05:00
Mulin Chao 95f6dc6c35 drivers: ps2: add Zephyr pinctrl support
Replace soc-specific pin functions with Zephyr pinctrl api functions for
pin-mux configuration in ps2 driver.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2022-05-12 14:24:03 -05:00
Mulin Chao 8f65bdabab drivers: pwm: add pinctrl driver support
Replace soc-specific pin functions with Zephyr pinctrl api functions for
pin-mux configuration in pwm driver.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2022-05-12 14:24:03 -05:00
Mulin Chao a4b07c396d drivers: i2c: add pinctrl driver support
Replace soc-specific pin functions with Zephyr pinctrl api functions for
pin-mux configuration in i2c driver.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2022-05-12 14:24:03 -05:00
Mulin Chao 8efc935288 drivers: uart: add pinctrl driver support
Replace soc-specific pin functions with Zephyr pinctrl api functions for
pin-mux configuration in uart driver.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2022-05-12 14:24:03 -05:00
Mulin Chao d53d574bf0 drivers: pinctrl: npcx: add initial pin-controller driver
This CL is the initial version for npcx pinctrl driver and introduces
pinctrl nodes for both IO-pads and peripheral devices for each npcx
series. Users can set pin configuration via these nodes in the board
layout DT file. It also wraps all configurations related to pin-muxing
in pinctrl_soc.h. Regarding the other pin properties, we will implement
them later.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2022-05-12 14:24:03 -05:00
Mahesh Mahadevan 8157e4bebf display: Update ELCDIF driver to use a config
Update the MCUX ELCDIF driver to use CONFIG_MCUX_ELCDIF_POOL_BLOCK_NUM
for the number for frame buffers to allocate.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2022-05-12 09:26:50 -05:00
Mahesh Mahadevan 450a1c0982 drivers: display: Add support for Raydium RM68200
Add support for the Raydium RM68200 MIPI DSI panel.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2022-05-12 09:26:50 -05:00