Commit graph

13851 commits

Author SHA1 Message Date
Shawn Nematbakhsh cd0f54fb88 drivers: timer: riscv_machine_timer: Add support for OpenTitan
OpenTitan uses a timer compliant with the RISC-V privileged
specification.

Signed-off-by: Shawn Nematbakhsh <shawn@rivosinc.com>
2023-01-27 19:25:26 +09:00
Shawn Nematbakhsh 1d3fb5490f drivers: serial: Add support for OpenTitan serial UART
UART output confirmed to work in simulation.

Signed-off-by: Shawn Nematbakhsh <shawn@rivosinc.com>
2023-01-27 19:25:26 +09:00
Jeroen van Dooren 77824a1820 drivers: display: ili9341: add 4th parameter in DISCTRL command
As stated in the datasheet https://www.crystalfontz.com/controllers/Ilitek/ILI9341/142/
there's a 4th parameter in DISCTRL command

Signed-off-by: Jeroen van Dooren <jeroen.van.dooren@nobleo.nl>
2023-01-27 19:24:13 +09:00
Wouter Cappelle 0934f705eb sensor: SHT3x: Fix low repeatability in single shot mode
Fix the low readability read command which was swapped with high
readability. This should fix an issue which caused a sensor fetch
fail in low repeatability single shot mode (no data ready)

Signed-off-by: Wouter Cappelle <wouter.cappelle@crodeon.com>
2023-01-27 18:11:02 +09:00
Andrei Emeltchenko 3f0487b725 drivers: adc_ads1119: Fix using wrong status bit
Fixes using wrong status bit for ADS1119_STATUS_MASK_ID. Moreover
using BIT(8) does not make much sense for working with uint8_t.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2023-01-27 18:09:49 +09:00
Stancu Florin 817e41f965 boards: cc1352p1_launchxl: new board, support antenna switching
Added new CC1352P1 LaunchXL board supporting 20dBm TX for its
sub-GHz radio.

Note that the board has a multiplexer circuit to switch between
2.4GHz, High-Power TX and Sub1GHz states, for which a custom board
module was implemented, together with board-specific device-tree
bindings and pinctrl definitions for each of the RF states.

Signed-off-by: Stancu Florin <niflostancu@gmail.com>
2023-01-27 17:44:38 +09:00
Stancu Florin e41de9235a drivers: ieee802154: cc13xx_cc26xx_subg: PA TX amplifier support
Enhance IEEE802154 Sub-GHz driver to support CC13x2P's internal power
amplifier (20dBm) for TX.

Note: requires board-specific antenna switching for it to work
properly.

Signed-off-by: Stancu Florin <niflostancu@gmail.com>
2023-01-27 17:44:38 +09:00
Trent Piepho 43781ba2a0 i2c: Add an option to dump all I2C messages to the log
When turned on, the existing i2c dump code is use to log every I2C
transaction at debug level.

This can be very useful for detecting problems with I2C peripherals.

Signed-off-by: Trent Piepho <trent.piepho@igorinstitute.com>
2023-01-26 14:55:44 -05:00
Trent Piepho 0c7ff3b728 i2c: Improve formatting of i2c dump function
If an i2c message is for just one byte, instead of logging it with a
hexdump after logging the other message info, just added the one byte to
the same log message.

Since most i2c messages are one byte, this significantly reduces the
number of messages and lines needed to log i2c transactions, from three
line per message to just one.  It's also a lot easier to read.

Signed-off-by: Trent Piepho <trent.piepho@igorinstitute.com>
2023-01-26 14:55:44 -05:00
Trent Piepho c09f6918fa i2c: Allow dumping the data of read messages
Add an argument to i2c_dump_msgs() to log the data from reads too.  And
then rename the function to i2c_dump_msgs_rw() so the API doesn't
change.  If the dump is done after a transaction is processed, as
opposed to before, then the read data is valid and can be very useful.

Signed-off-by: Trent Piepho <trent.piepho@igorinstitute.com>
2023-01-26 14:55:44 -05:00
Andrzej Głąbek 37665b5e95 drivers: spi_context: Refactor spi_context_wait_for_completion()
Refactor the code of this function to make it a bit easier to read.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2023-01-27 01:22:15 +09:00
Andrzej Głąbek f36c15e2e3 drivers: spi_context: Use total transfer length in timeout calculation
When estimating the time that a given SPI transfer will take, whole
buffer sets for TX and RX need to be taken into account, not only their
first parts. Correct `spi_context_wait_for_completion()` accordingly.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2023-01-27 01:22:15 +09:00
Michael Larson 0267612305 drivers: flash: spi_nor: Fix spi_nor_sfdp_read conditional
spi_nor_sfdp_read is now called from spi_nor_process_sfdp for the
CONFIG_SPI_NOR_SFDP_RUNTIME case and that could be defined without
CONFIG_FLASH_JESD216_API being defined

Signed-off-by: Michael Larson <larson@whisper.ai>
2023-01-27 01:21:52 +09:00
Francois Ramu 05da8d7a7a drivers: flash: stm32 page layout size differs in stm32u5 or stm32l5
Adjust the size of the stm32_flash_layout[] table depending on the
bank configuration of the stm32u5 or stm32l5 devices.
That will avoid div by zero error in flash_get_page_info()
if the layout_size is not correct.
Assign the *layout_size only once with the correct value : 3 or 1.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2023-01-27 01:05:44 +09:00
Cyril Fougeray 4d7e150189 drivers: i2c: stm32: format
Detected by checkpatch.pl

Signed-off-by: Cyril Fougeray <cyril.fougeray@worldcoin.org>
2023-01-27 01:02:08 +09:00
Cyril Fougeray 400fa70ca2 drivers: i2c: stm32: PM device runtime support
Lock I2C device state when used so that Power Manager doesn't
suspend the device.
Initial state is a suspended device.

Signed-off-by: Cyril Fougeray <cyril.fougeray@worldcoin.org>
2023-01-27 01:02:08 +09:00
Cyril Fougeray 7710082e87 drivers: i2c: stm32: PM device support
Clock and pins used by the I2C device are suspended when power
manager requires it.
Do not compile function i2c_stm32_suspend when PM_DEVICE isn't
 enabled as it is left unused and will make the compiler throw
 a warning.

Signed-off-by: Cyril Fougeray <cyril.fougeray@worldcoin.org>
2023-01-27 01:02:08 +09:00
Cyril Fougeray 51fa86bb98 drivers: exti: stm32: expose STM32_EXTI_LINE_NONE
Common STM32_EXTI_LINE_NONE for declaration and setting
of wakeup EXTI line when configured.

Signed-off-by: Cyril Fougeray <cyril.fougeray@worldcoin.org>
2023-01-27 01:02:08 +09:00
Benjamin Björnsson 500809f8fa drivers: can: can_loopback: Abort pending messages when stopped
This commit aims at updating the drivers stop function to better
follow the CAN header file which specifiec that stopping the CAN
controller should "abort any pending CAN frame transmissions".

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2023-01-27 00:58:59 +09:00
Johann Fischer e60a4efbb0 drivers: udc: do not update MPS for isochronous endpoints
Zero data payload size for isochronous endpoints is a
is a valid setting for default interface.
Also do not update MPS of control endpoint since it is
set by the driver.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2023-01-27 00:57:22 +09:00
Chamira Perera da3e3d3ed3 drivers: ethernet: stm32: Enabling stats for the driver.
The change enables the ethernet driver to save statistics in a
structure in the ethernet driver API structure. In addition, the
change also attempts to update error statistics based on errors
reported in the STM32 ethernet HAL API.

Fixes #53995

Signed-off-by: Chamira Perera <chamira.perera@audinate.com>
2023-01-27 00:56:06 +09:00
David Leach cde1573619 drivers: entropy: use non-cache intermediate buffer for RNG
The CAAM hardware needs to read RNG values into a non-cache
buffer. Since the contract to Zephyr RNG functions do not
require non-cache buffers, we use an intermediate non-cache
buffer to retrieve results.

Added a Kconfig to control the size of the intermediate buffer.

Fixes #53035

Signed-off-by: David Leach <david.leach@nxp.com>
2023-01-26 09:46:20 -06:00
Brian Juel Folkmann 8d11d183f6 drivers: flash: bug fix stm32 ospi flash erase
This commit fixes a bug in the STM32 ospi flash driver when attempting
to erase an area that spans more than one erase sector.
Without this fix, only the first sector is actually erased, the rest
silently fails the erase.
Issue is that the write enable latch command is only sent for the first
erase command.

Signed-off-by: Brian Juel Folkmann <bju@trackunit.com>
2023-01-26 09:39:59 +00:00
Armin Brauns 219dd436d1 drivers/clock_control: stm32l4: allow enabling MCO output
This enables the MCO clock output pin to be configured through Kconfig on
stm32l4 devices.

Signed-off-by: Armin Brauns <armin.brauns@embedded-solutions.at>
2023-01-26 09:39:33 +00:00
Armin Brauns 706f5caf0e drivers/clock_control: stm32f7: allow enabling MCO outputs
This enables the MCO clock output pins to be configured through Kconfig on
stm32f7 devices.

Signed-off-by: Armin Brauns <armin.brauns@embedded-solutions.at>
2023-01-26 09:39:33 +00:00
Yuval Peress e7443bb203 sensors: Add attribute configuration for icm42688
Implement the attribute get/set for the icm426888

Signed-off-by: Yuval Peress <peress@google.com>
2023-01-25 09:48:05 -06:00
Yuval Peress ad4cb88494 sensor_shell: add attribute support
Add 2 new sub-commands to the sensor command (attr_get and attr_set).
These commands can be used to access the driver's attr_set and attr_get
functions.

Signed-off-by: Yuval Peress <peress@google.com>
2023-01-25 09:48:05 -06:00
Yuval Peress 3f4c568f71 sensor_shell: run clang-format
Run clang-format on the sensor_shell.c to make diffs easier for the
next commit.

Signed-off-by: Yuval Peress <peress@google.com>
2023-01-25 09:48:05 -06:00
Henrik Brix Andersen 55d0ffa874 drivers: can: remove CAN_HAS_CANFD Kconfig helper
Remove the CAN_HAS_CANFD Kconfig helper symbol in order to allow enabling
CAN-FD support in the API regardless of driver support.

Change default to CAN-FD support being disabled and have samples and tests
that require CAN-FD support turn it on. This aligns the default
configuration across CAN controller drivers regardless of their
capabilities.

The rationale behind this is that we are starting to see MCUs with multiple
CAN controllers, some CAN-FD compatible, some not (e.g. NXP i.MX RT1060 and
FPGAs). Automatically enabling CAN-FD support based on the presence of a
CAN-FD capable CAN controller leads to different application default
settings based on the CAN controller(s) in use.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2023-01-25 15:00:39 +00:00
Henrik Brix Andersen f1a7ec96db drivers: can: remove CAN_HAS_RX_TIMESTAMP Kconfig helper
Remove the CAN_HAS_RX_TIMESTAMP Kconfig helper symbol in order to allow
enabling CAN RX timestamps in the API regardless of driver support.

This simplifies application prj.conf settings across board supporting/not
supporting RX timestamps considerably.

CAN drivers not supporting RX timestamps already initialize the timestamp
to 0 for received frames.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2023-01-25 15:00:39 +00:00
Guillaume Gautier 6deebdd13a drivers: adc: Remove now unused variables for STM32 ADC
Remove boolean variables for internal channels now that we use channel
number directly

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2023-01-25 15:00:21 +00:00
Guillaume Gautier 9c6d44ef5a drivers: adc: Simplify STM32 ADC channels setup
Now that we have the information of internal channel number for STM32
ADCs in the dts, we can use it to remove a lot of specific code and
make it clearer.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2023-01-25 15:00:21 +00:00
Erwan Gouriou 34e49a7c54 drivers: adc: stm32: Refactor driver init section
Slightly refactor STM32_ADC_INIT macro.
adc_stm32_cfg_##index declaration is now part of ADC_STM32_INIT
and extracted from CONFIG_ADC_STM32_SHARED_IRQS #ifdef.

Aim is to minimize code duplication when adding new adc_stm32_cfg_X
or adc_stm32_data_Y entries

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2023-01-25 15:00:21 +00:00
Andrei Emeltchenko ec8c9f05fc drivers: ieee802154_rf2xx: Fix logical operation
Fix using AND instead of OR.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2023-01-25 14:58:09 +00:00
Andrzej Głąbek cf871aec64 drivers: nrf_rtc_timer: Adjust set_absolute_alarm to prevent CC misses
This is a follow-up to commit 205e684958.

The recently added nrf_rtc_timer test case (test_next_cycle_timeouts)
revealed a problem in the current implementation of this function.
Adjust it to avoid missing COMPARE events in specific circumstances.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2023-01-25 11:25:01 +00:00
Marcin Jabrzyk 61916c69dd drivers: watchdog: Fix RP2040 watchdog load time
RP2040 requires watchdog load time in us, but Zephyr
watchdog window values are in ms. Make sure that it is
adjusted to hardware requirements.

Signed-off-by: Marcin Jabrzyk <marcin.jabrzyk@gmail.com>
2023-01-24 19:01:34 -08:00
Evgeniy Paltsev 9eb8baeff9 ARC: irq: idu: mask IRQ before level setup
Currently we setup irq trigger type (pulse or level) in IDU
before we Mask (disable) IRQ line.

The IDU is disabled at this moment, however we still may
accidentally generate interrupt by trigger setup.

To avoid that let's mask (disable) IRQ before trigger type setup.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
2023-01-24 18:57:50 -08:00
Benjamin Kyd ee1e514b3b driver: ethernet: cvsx remove ugly whitespace
Remove the ugly whitespace in drivers/ethernet/eth_cyclonev.c

Signed-off-by: Benjamin Kyd <benjamin.kyd@intel.com>
2023-01-24 17:46:17 -06:00
Benjamin Kyd f3a610fffe drivers: ethernet: cvsx change bit label
Change the bit label to include the BIT() macro to tidy up the code.

Signed-off-by: Benjamin Kyd <benjamin.kyd@intel.com>
2023-01-24 17:46:17 -06:00
Benjamin Kyd aad76523e1 drivers: ethernet: bugfix for Cyclone V Ethernet
bugfix for Cyclone V Ethernet Phy error and timeout overflow.
 - p->instance was incorrectly assumed to be a reference to
   the emac device, this is ammended
 - the volatile uint16_t timeout would often overflow
 - code cleanup and added more macros for housekeeping

Signed-off-by: Benjamin Kyd <benjamin.kyd@intel.com>
2023-01-24 17:46:17 -06:00
Jeppe Odgaard a76b908f4c drivers: sensor: add mcux quadrature encoder
Add a driver for the NXP MCUX Quadrature Decoder. The driver
is simple and only implements the phase a and phase b inputs. The
module has additional features which can be added in future PRs.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2023-01-24 10:21:39 -06:00
Marc Desvaux d72f65f358 drivers: ethernet: PTP clock CONFIGURATED
Set PTP Configuration done on ETH_STM32_HAL_API_V2

Signed-off-by: Marc Desvaux <marc.desvaux-ext@st.com>
2023-01-24 14:34:34 +00:00
Francois Ramu 210e0b76bf dts: bindings: pwm custom macro for STM32 vendor
Change the name of the custom macro defined for the stm32 devices
to fit the VND_PWM_xxx model
Keeping old deprecated macro, though.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2023-01-24 14:49:53 +01:00
Manuel Arguelles 8d2778f326 drivers: ethernet: add support for NXP S32 NETC
Introduce Ethernet low-level driver for NXP S32 Network Controller
(NETC). Current driver allows to manage from Zephyr a Physical Station
Interface (SI) and/or a Virtual SI. The NETC has an integrated Ethernet
Switch. Currently the Switch is initialized from this driver with a
default configuration, and all ports are enabled and transparent for
the user. A separate Switch driver should be addressed in future patches.

Signed-off-by: Manuel Arguelles <manuel.arguelles@nxp.com>
2023-01-24 14:37:20 +01:00
Manuel Arguelles 1d6452c57b drivers: mdio: add support for NXP S32 NETC EMDIO
Introduce NXP S32 NETC External MDIO controller driver. Driver supports
a single instance, as current support is based on NXP S32Z/E SoCs.

Signed-off-by: Manuel Arguelles <manuel.arguelles@nxp.com>
2023-01-24 14:37:20 +01:00
Manuel Arguelles 642303ac7e drivers: eth: phy_mii: support Gigabit ethernet
Advertise Gigabit Ethernet if the PHY supports it. As with the
other speeds, it is assumed the PHY supports both duplex modes.

Signed-off-by: Manuel Arguelles <manuel.arguelles@nxp.com>
2023-01-24 14:37:20 +01:00
Manuel Arguelles 60608b7a31 drivers: mbox: add support for NXP S32 MRU
Introduce NXP S32 Message Receive Unit (MRU) driver based
of Mbox API. The MRU couples with a processor and allows to
receive messages from senders, which are other modules or
processors.

Signed-off-by: Manuel Arguelles <manuel.arguelles@nxp.com>
2023-01-24 14:37:20 +01:00
Manuel Arguelles 47de21d5c0 drivers: mbox: separate NRFx specific Kconfig
Separate NRFx Mbox driver Kconfig to make place for other drivers.

Signed-off-by: Manuel Arguelles <manuel.arguelles@nxp.com>
2023-01-24 14:37:20 +01:00
Sam Hurst 6b4b7a02e7 usb-c: tcpc: Enable ISR Hard Reset sent bits
This change enables the ISR Hard Reset sent bits, so that
an interrupt is generated when a Hard Reset is sent or
the Hard Reset failed.

Signed-off-by: Sam Hurst <sbh1187@gmail.com>
2023-01-24 09:43:20 +01:00
Sam Hurst 603ac13145 usb-c: tcpc: Correctly detect Hard Reset sent detection
The Hard Reset sent signal was tested twice in the same
"if else" structure but only handled in the last test. This
change removes the first detection so that Hard Reset can
be correctly detected.

Signed-off-by: Sam Hurst <sbh1187@gmail.com>
2023-01-24 09:43:20 +01:00