Commit graph

23353 commits

Author SHA1 Message Date
Dominik Ermel
4fd503adac drivers/flashdisk: Remove erase for devices that do not require it
No erase when not needed by device.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-06-04 08:00:46 +02:00
Dominik Ermel
294187b576 flash/spi_nor: Mark driver with FLASH_HAS_EXPLICIT_ERASE
Sets the Kconfig CONFIG_FLASH_HAS_EXPLICIT_ERASE.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-06-04 08:00:46 +02:00
Dominik Ermel
3c24e1a530 drivers/flash/Ambiq: Set erase capabilities, depending on SoC
The commit selects HAS_NO_EXPLICIT_ERASE for Apollo4,
with MRAM, and HAS_EXPLICIT_ERASE for Apollo3 which has Flash,
for a driver that shares code between SoCs.

In case of Apollo4 the no_explicit_erase capability is set to
true, while it remains false for Apollo3.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-06-04 08:00:46 +02:00
Dominik Ermel
ea627fda7e drivers/flash: Add explict erase capability with proper values
Add explicit_erase capability and set proper value to it,
depending on type of a device.
Select FLASH_HAS_EXPLICIT_ERASE by devices that have program-erase
characteristics and FLASH_HAS_NO_EXPLICIT_ERASE, where needed.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-06-04 08:00:46 +02:00
Dominik Ermel
0e970c8362 drivers/flash/nrf_mram: Set no explicit erase capability to true
NRF MRAM does not require erase prior to re-programming already
written area.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-06-04 08:00:46 +02:00
Dominik Ermel
127bc5e35e drivers/flash/nrf_rram: Set no explicit erase capability to true
NRF RRAM does not require erase prior to re-programming already
written area.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-06-04 08:00:46 +02:00
Dominik Ermel
6d75bc519b drivers/flash/nrf: Mark driver as FLASH_HAS_EXPLICIT_ERASE
Select CONFIG_FLASH_HAS_EXPLICIT_ERASE for the NRF driver.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-06-04 08:00:46 +02:00
Dominik Ermel
ff81b52448 drivers/flash_simulator: Add support for non-erase device
The commit adds support for testing non-explicite-erase
device on Flash Simulator. This is addition to already supported
explicit erase before write, aka Flash, type of device behaviour.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-06-04 08:00:46 +02:00
Dominik Ermel
b8d073c572 drivers/flash: Add flash_fill() and flash_flatten()
The commit adds two new API calls:
 - flash_fill - that allows to fill selected part of device with
   specified value;
 - flash_flatten - that allows to erase or fill device with
   erase_value, depending on whether driver for the device provides
   erase callback.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-06-04 08:00:46 +02:00
Dominik Ermel
b3c9f957c6 drivers/flash: Add explicit_erase property
The commit adds and no_explicit_erase capability to flash_parameters,
that indicates whether device is program-erase type device; such
devices, like Flash type devices, require erase prior to writing
random data at any previously programmed location.
This capability should only be set by drivers.

The flash_params_get_erase_cap() function has been added, for parsing
flash_parameters object to obtain erase capabilities of device.
The function returns capabilities as combination of bits representing
them. Currently it will return:
 0 -- no erase capabilities
 FLASH_ERASE_C_EXPLICIT -- erase required before write of random data.
Additional capabilities have been reserved but are not yet used.

There are following Kconfig options added:
 FLASH_HAS_EXPLICIT_ERASE
 FLASH_HAS_NO_EXPLICIT_ERASE
that should be selected by device driver to indicate whether
devices served by driver needs erase prior to write.
The above Kconfigs are used to figure out whether app is built
for hardware that requires erase prior to write.
They can be also used to detect that it is attempted to build
some subsystem that will not work with provided hardware, for example
file system that has not been prepared to work with devices that
do not require erase.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-06-04 08:00:46 +02:00
Tom Chang
a33341ac66 drivers: espi: npcx: add support 66MHz eSPI clock
This CL adds support 66MHz eSPI clock for NPCX4.

Signed-off-by: Tom Chang <CHChang19@nuvoton.com>
2024-06-04 07:56:19 +02:00
Luca Burelli
912a581a95 drivers/led: add IS31FL3194 LED driver
Add support for the IS31FL3194 3-channel LED driver. This driver can be
configured to handle its outputs as either a single RGB LED or (up to)
three independent LEDs.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-06-03 15:30:01 -04:00
Ioannis Karachalios
5b0cc42968 drivers: clock_control: smartbond: Update clock control driver
This commit should deal with the followings:

1. PLL requires that VDD level be changed to 1V2 and then released
   to 0V9 when it's turned off. Changing the VDD level should be
   done when the regulator driver is available. Otherwise, the VDD
   level will be fixed to 1V2 (reset value).

2. Check if PLL is allowed to be turned off as it might happen that
   USB is enabled which is clocked by PLL.

3. Do not wait for the PLL to lock. This is now performed silently
   when PLL is requested.

4. Before switching to PLL we should check if PLL is already enabled
   as it might happen that PLL node is initially disabled.

Signed-off-by: Ioannis Karachalios <ioannis.karachalios.px@renesas.com>
2024-06-03 15:41:20 +02:00
Ioannis Karachalios
570a508633 drivers: regulator: smartbond: Regulator driver update
This commit should deal with the followings:

1. Change regulator's driver priority as it should now
   be used by the clock control driver.
2. Check if the VDD level is permitted to change when PLL
   is the system clock. This is because the PLL requires
   that VDD be 1.2V.

Signed-off-by: Ioannis Karachalios <ioannis.karachalios.px@renesas.com>
2024-06-03 15:41:20 +02:00
Ioannis Karachalios
8c651be4ef drivers: counter: smartbond: Add support for PM
This commit should add all the functionality needed for the counter
driver to work when PM is enabled. The sleep state is bound to the
counter start/stop functionality. TIMER3/4 block instances are
powered by PD_SYS and so sleep should be constrained when they are
up and running. On the other hand TIMER1/2 block instances are
powered by PD_TMR which is always on (used to generate the os tick).

Signed-off-by: Ioannis Karachalios <ioannis.karachalios.px@renesas.com>
2024-06-03 15:40:24 +02:00
Alexander Kozhinov
0f1d69d21a drivers: can_mcan: can_mcan_line_1_isr: add more debug outputs
In some cases CAN-Bus communication may be
disturbed by other parts of SoC. For example USB
may disturb CAN communication if electircal wiring
of the board is not done properly or the system is
in development stage.
This change adds debug-prints s.t. CAN-Bus protocol
errors in arbitration or data phases can be
detected while in CAN-Bus ISR.

Signed-off-by: Alexander Kozhinov <ak.alexander.kozhinov@gmail.com>
2024-06-03 15:38:38 +02:00
Gerard Marull-Paretas
71dcbdd29c drivers: clock_control: nrf_auxpll: add lock timeout
This patch adds a timeout to the clock_control_on() implementation. The
reason for this timeout is to prevent system freezes when the PLL is
configured incorrectly, or, if BICR is wrong. The locking time of the
AUXPLL is <30us, however, when it starts it also starts other
dependencies which take much longer to become ready. The locking time
has been experimentally measured to be around 2ms, so a 10x bound has
been added.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-06-03 03:39:26 -07:00
Aurelien Jarno
19827b9be5 drivers: rtc: rtc_shell: fix milliseconds display
The RTC shell get command displays the time according to the ISO8601
standard. Fix the milliseconds field to be displayed on 3 digits instead
of 6 like if they were microseconds. In addition change the separator
between seconds and milliseconds to a dot like specified in the ISO8601
standard.

Before:
2024-06-02T22:33:10:000667

After:
2024-06-02T22:33:10.667

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2024-06-03 03:39:17 -07:00
Gerard Marull-Paretas
e2f8f5b131 drivers: can: mcan: skip read/write to mram if data length is 0
can_mcan_send/can_mcan_get_message issued a message ram write/read even
when data length was 0. This caused some issues on systems where data
cache is enabled, because the cache invd/flushing calls present in the
mcan driver can fail if provided length is 0.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-06-03 03:01:22 -07:00
cyliang tw
9bb6e2d6f4 drivers: can: support for numaker m2l31x
Add Nuvoton numaker m2l31x series can-fd controller in Kconfig.numaker
Add can-fd nodes in m2l31x.dtsi

Signed-off-by: cyliang tw <cyliang@nuvoton.com>
2024-06-03 09:49:17 +02:00
Florian Weber
8f852551e0 drivers: sensor: akm09918c: fix decoder api define
Decoder api was not defined and lead to build error
if it is used in userland.
Fix that by adding necessary DT_DRV_COMPAT #define
in akm09918c sensor decoder.

Signed-off-by: Florian Weber <florian.weber@live.de>
2024-06-02 00:43:08 +02:00
Andy Ross
e0c56f1998 drivers/timer: MediaTek audio DSP timer device
These devices have a somewhat odd hybrid design, with a free-running
64 bit up counter but no comparator.  Instead interrupts are triggered
by (one of an array of) 32 bit down counters with reset (a-la SysTick,
but without the 24 bit precision issues).  The combination actually
results in a fairly simple driver as we can skip the comparator
rounding math.

Signed-off-by: Andy Ross <andyross@google.com>
2024-06-01 05:40:05 -07:00
Andy Ross
3f07d70cf3 drivers: MediaTek MT8195 Audio DSP interrupt controller
Add an interrupt controller driver for this device.  This is an
extremely simple second level controller with per-interrupt-bit
registers for "enable" and "status".  There is no internal latching,
so no "clear/ACK" process is needed.

Signed-off-by: Andy Ross <andyross@google.com>
2024-06-01 05:40:05 -07:00
Eduardo Montoya
01b0d8736e drivers: ieee802154: nrf5: sleep if idle when RxOnWhenIdle=0
When RxOnWhenIdle is set to False, turn the radio off
if no operation is ongoing in order to save power.

Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
2024-06-01 10:25:31 +02:00
Henrik Brix Andersen
c4c69606e6 drivers: can: shell: optionally bypass the shell when printing CAN frames
Optionally bypass the shell when printing received CAN frames in order not
to break up the line containing the frame. This allows for parsing the
printed CAN frames using Twisters pytest and console harnesses with the
cost of the shell ignoring input while the frame is being printed.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-05-31 16:40:01 -05:00
Tomi Fontanilles
c1342b3aa9 modules: mbedtls: remove the default enabling of features
In an effort to shave off code size, remove out-of-the-box
enabling of crypto features (except SHA-256).

Configurations are adjusted to enable what they need.

Bonuses:

- When enabled, AES now defaults to using a smaller version
(`CONFIG_MBEDTLS_AES_ROM_TABLES` isn't default enabled anymore,
and if enabled, `CONFIG_MBEDTLS_AES_FEWER_TABLES` defaults to y).

- Conditions around Mbed TLS Kconfig options have been improved
to reflect the reality of the dependencies.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-05-31 16:33:06 -05:00
Anke Xiao
13690daa34 drivers: clock_control: add a soc config macro wrap flexbus clock
ke17z7 platform does not define flexbus clock-related macros,
so comment it out.

Signed-off-by: Anke Xiao <anke.xiao@nxp.com>
2024-05-31 16:31:33 -05:00
Francois Ramu
7b73a343cb drivers: flash: stm32 ospi driver aborts memmap before erase/write
This change is aborting the memoryMapped mode of the octo-flash
before erasing or writing the NOR. Operations are performed in
command mode.
Reading is always performed in MemoryMapped mode (memcopy)

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-05-31 09:52:54 -05:00
Francois Ramu
7593a14a0a drivers: flash: stm32 ospi drivers with Memorymapped mode
Enable the MemoryMapped Mode for the stm32 octoFlash driver
Configure the Flash in MemoryMapped to use in XiP mode.
With this mode the erase and write are not supported.
Address and size are given by the DTS register property.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-05-31 09:52:54 -05:00
Zhaoxiang Jin
0507021009 drivers: sensor/nxp: Add NXP LPCMP driver
Add NXP LPCMP driver

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2024-05-31 09:51:29 -05:00
Lucas Tamborrino
aa692309bf drivers: wdt: espressif: Add 32K Xtal Watchdog
This WDT is responsible for monitoring the external
32.728 Hz crystal connected to pins XTAL_32K_P and
XTAL_32K_N. If an oscillation failure is detected
the hardware automatically switch to RTC_RC_SLOW
clock source and triggers an interrupt.

Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
2024-05-30 16:52:37 -05:00
Ioannis Karachalios
44e9f2ca8f drivers: crypto: smartbond: Crypto Driver Update
This commit should fix the followings:
1. Suppress compiler warnings
2. Cryptographic mode should first be exercised before
   applying the secure key
3. In-memory word swap operations should be omitted as
   the key should reside in the flash memory and so any
   write access should raise a busfault exception

Signed-off-by: Ioannis Karachalios <ioannis.karachalios.px@renesas.com>
2024-05-30 16:51:03 -05:00
Ioannis Karachalios
29026e8a89 drivers: i2c: smartbond: Update busy check condition
The controller should be considered
inactive when TX/RX FIFOs are empty
and there is no data in SPI_RX_TX_REG.

Signed-off-by: Ioannis Karachalios <ioannis.karachalios.px@renesas.com>
2024-05-30 09:48:31 -05: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
Bram Vlerick
3ea5f799dd i2c: target: eeprom_target: add addressable size assert
Add build-time assert to check if the size defined is actually addressable.
i.e: if address-width is set to 8, the maximum addressable size is 256
bytes.

Signed-off-by: Bram Vlerick <bram.vlerick@openpixelsystems.org>
2024-05-30 05:31:40 -07:00
Bram Vlerick
935e8c4b13 i2c: target: eeprom_target: add address_width parameter
Add a parameter to allow the configuration of the number of address
bytes used by the I2C master. This allows the driver to expose larger
buffer sizes.

Tested with standard linux at24 driver.

Signed-off-by: Bram Vlerick <bram.vlerick@openpixelsystems.org>
2024-05-30 05:31:40 -07:00
Gerard Marull-Paretas
cdcb05527d drivers: can: nrf: add driver
Add driver for the Nordic CAN peripheral, based on Bosch MCAN IP.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-05-30 05:20:50 -07:00
Gerard Marull-Paretas
0d4d4e7754 drivers: pinctrl: nrf: add support for CAN TX/RX
So that we can configure CAN pins.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-05-30 05:20:50 -07:00
Jordan Yates
b9c9426b62 sensor: bme680: simplify conversion logic
Read less data from the sensor and use standard zephyr functions for
extracting integers from byte arrays.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-05-30 02:06:19 -07:00
Jordan Yates
b67185b90d sensor: bme680: fix fetch API conformance
`sensor_sample_fetch` is documented to read all of a sensor's active
channels and block until complete. The previous implementation read
the result from the previous call and triggered the next sample.

As a result the first call always failed, and subsequent calls would
return data one sampling period old.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-05-30 02:06:19 -07:00
Patrick Stewart
1868987a2f Bluetooth: userchan: Support TCP fragmentation of HCI packets
Keep reading from the HCI socket when a packet is incomplete. The other
end may not write entire packets, or TCP could fragment in the middle of a
packet.
Also fix a potential infinite loop by advancing to the next packet before
any continue statements.

Signed-off-by: Patrick Stewart <patrick@rfcreations.com>
2024-05-30 01:01:04 -07:00
Tom Burdick
d2ccc91d7d sensors: Add a blocking sensor_read call
Rename the current sensor_read to sensor_read_async_pool and create a
new blocking sensor_read helper.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2024-05-30 09:00:43 +02:00
Johan Hedberg
f48a57b2a8 Bluetooth: drivers: Remove unmaintained B91 HCI driver
The driver isn't currently buildable due to "west blobs" support never
having been added for hal_telink. Furthermore, even if the blob
dependency is manually made available it turns out the code has
bitrotten to the point where it doesn't build anymore. This situation
has continued for several years without anyone taking action, so I think
it's safe to assume this is unmaintained and should be removed.

Signed-off-by: Johan Hedberg <johan.hedberg@gmail.com>
2024-05-30 09:00:22 +02:00
Trung Hieu Le
206897658a drivers: display: elcdif: Modify interrupt enablement
The elcdif interrupt is enabled in the write function and disabled in
the IRQ handler for each new frame update. Disabling the interrupt when
no new frame needs to be sent gives the CPU the possibility to enter
low-power mode. However, when the application's frame rate
matches the LCD refresh rate, this adds additional latency.

This commit provides a config to choose between following options:
- Toggle the CUR_FRAME_DONE_IRQ_EN in the write function and in IRQ
handler for each new frame when the power mangement is a concern.
- Activate the CUR_FRAME_DONE_IRQ_EN once at the init function when
low latency is required.

Signed-off-by: Trung Hieu Le <trunghieu.le@nxp.com>
2024-05-29 10:49:48 -07:00
Bjarki Arge Andreasen
79640aea09 drivers: console: remove uart_mux and gsm_mux
Remove the deprecated uart_mux and gsm_mux modules and all of
their configurations/dependencies across zephyr.

Optimally uart_mux and gsm_mux would be removed in their own
respective PRs, but the two modules are directly coupled, so
to preserve bisectability, they must be removed together.

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-05-29 10:49:08 -07:00
Bjarki Arge Andreasen
e79428cda8 drivers: modem: remove gsm_ppp.c device driver
Remove the deprecated gsm_ppp.c device driver and associated
dts compatible.

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-05-29 10:49:08 -07:00
Bjarki Arge Andreasen
40a44c2118 drivers: modem: modem_cellular: Remove support for gsm_ppp
The new modem_cellular driver had support for the deprecated
generic zephyr,gsm-ppp dts compatible for backwards compatibility.

zephyr,gsm-ppp is being removed, and as such, modem_cellular.c
no longer needs to support it.

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-05-29 10:49:08 -07:00
Bjarki Arge Andreasen
b0a9ae266b drivers: net: ppp: Remove integration with GSM_MUX
The gsm_ppp driver is deprecated, and will be removed, along with
its dependencies UART_MUX and GSM_MUX.

This commit removes the integration with GSM_MUX from ppp.c, making
it solely dependent on the chosen node zephyr,ppp-uart.

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-05-29 10:49:08 -07:00
Bjarki Arge Andreasen
7e764610b1 drivers: modem: modem_iface_uart: Remove gsm_mux integration
gsm_mux and uart_mux are deprecated and will be removed.
Remove integration with gsm_mux and uart_mux from modem_shell.c

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-05-29 10:49:08 -07:00
Bjarki Arge Andreasen
a36545b72b drivers: modem: modem_shell: Remove integration with gsm_mux
gsm_mux and uart_mux are deprecated and will be removed.
Remove integration with gsm_mux and uart_mux from modem_shell.c

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-05-29 10:49:08 -07:00