Commit graph

23353 commits

Author SHA1 Message Date
Zhengwei Wang
96ff0f1e04 drivers: timer: Optimized the ambiq stimer driver
The original driver has two defects: 1. When setting the next timeout
value the original implementation simply sets a delta value equal to
ticks * CYC_PER_TICK. This operation is reckless and may incorrectly
"reset" the fractional tick, causing clock skew. 2. The original
implementation doesn't handle the counter overflow situation. When the
counter overflows from 0xffffffff to 0x0, the uptimer counter becomes
incorrect. We have fixed above issue by rewriting most of the functions in
this driver and verified it by running all tests under
tests/kernel/timer folder.

Signed-off-by: Zhengwei Wang <zwang@ambiq.com>
2024-06-06 07:52:32 -04:00
Declan Snyder
a42ada8426 drivers: nxp_enet: Disable hw accel with IPV6
As far as I can tell it appears that the hardware
does not support acceleration of ICMPV6 checksums.
For now, the easiest way to fix the runtime failure of
IPV6 is just to disable the hardware acceleration if
IPV6 is expected to be used.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-06-06 07:51:16 -04:00
Tom Burdick
d95caa51a4 sys: Add a lockfree mpsc and spsc queues
Moves the rtio_ prefixed lockfree queues to sys alongside existing
mpsc/spsc pbuf, ringbuf, and similar queue-like data structures.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2024-06-06 00:42:29 -07:00
Francois Ramu
bde663f484 drivers: gpio: stm32 gpio driver supporting the stm32H7RS
Introduce the stm32h7RS serie to the gpio driver,
based on the stm32h7
The SBS controller is used to configure the EXTI line among
the different GPIO port.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-06-06 00:41:43 -07:00
Francois Ramu
c0750e9867 drivers: pinctrl: stm32 pinctrl driver supporting the stm32H7RS
Introduce the stm32h7RS serie to the pin control driver,
New GPIO port M, N, O, P
Then add the complete list and from A to P (16 port
coded on 5 bits)

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-06-06 00:41:43 -07:00
Francois Ramu
e6ebb044ac drivers: clock: stm32 clock driver supporting the stm32H7RS
Introduce the stm32h7RS serie to the clock_controller,
based on the stm32h7 clock driver
Datasheet DS14359 rev 1 gives CPU max freq of 500MHz

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-06-06 00:41:43 -07:00
Tim Lin
76ced4a82d drivers: pinctrl: ITE: Add a property configure pin current strength
Add the property of drive-strength to drive a high or low current
selection. If this property is not configured, it is the default
setting. According to the SPEC, the default drive current selection
varies from different pins.
Define the high level 0b: 8mA
           low  level 1b: 4mA or 2mA

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2024-06-06 00:41:35 -07:00
Peter van der Perk
af52f1b290 clock: mcux_ccm: add qtmr clock
Add defines for QTMR peripheral

Signed-off-by: Peter van der Perk <peter.vanderperk@nxp.com>
2024-06-06 09:41:22 +02:00
Peter van der Perk
9addbe77fc drivers: pwm: pwm_mcux_qtmr: Add QTMR driver.
PWM driver for QTMR peripheral

Signed-off-by: Peter van der Perk <peter.vanderperk@nxp.com>
2024-06-06 09:41:22 +02:00
Henrik Brix Andersen
633065ec3b drivers: can: mcux: flexcan: calculate and set proper TDCO
Calculate and set a proper Transceiver Delay Compensation Offset (TDCO)
based on FlexCAN FD timing.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-06-06 00:40:45 -07:00
Ryan Erickson
2eef28a624 drivers: change Laird references to Ezurio
Laird is now Ezurio.
Update web links.

Signed-off-by: Ryan Erickson <ryan.erickson@ezurio.com>
2024-06-05 17:37:54 -05:00
Abderrahmane Jarmouni
efc209b47f drivers: gpio: stm32: support wkup pins configuration
Introduce a custom STM32_GPIO_WKUP GPIO flag.
Use the newly introduced stm32_pwr_wkup_pin_cfg_gpio() public
function to configure GPIO pins, that have the STM32_GPIO_WKUP
flag in DT, as sources for STM32 PWR wake-up pins, on the condition
that there is a wake-up pin that corresponds to each of them.
These GPIO pins can then be used to power on the system after Poweroff
like a reset pin.

Signed-off-by: Abderrahmane Jarmouni <abderrahmane.jarmouni-ext@st.com>
2024-06-05 17:35:55 -05:00
Henrik Brix Andersen
68096cedae drivers: can: rename struct can_driver_config fields
Rename the "bus_speed" and "bus_speed_data" fields of struct
can_driver_config to "bitrate" and "bitrate_data" to match the
corresponding devicetree properties and the terminology used in the rest of
the CAN subsystem API.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-06-05 14:43:00 +01:00
Henrik Brix Andersen
695e704b5d dts: bindings: can: rename bus-speed/bus-speed-data properties
Deprecate the CAN controller bus-speed/bus-speed-data properties and rename
them to bitrate/bitrate-data to match the terminology used in other CAN
devicetree properties and the CAN subsystem API.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-06-05 14:43:00 +01:00
Nikodem Kastelik
fc0718ed46 drivers: spi: nrf: add support for spim12x instances
SPIM12x instances can perform DMA only from memory region
that is cacheable by default.
SPIM12x instances pins are configured via CTRLSEL mechanism,
which prevents the GPIO registers from ensuring correct bus
state when peripheral does not drive the bus lines.
External configuration of SPIM12x ENABLE register fixes this issue.

Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
2024-06-05 14:42:50 +01:00
Nikodem Kastelik
7080f0f83f drivers: spi: nrf: fix async cs deactivation
Chip Select signal must be deactivated only after transaction
is finalized. In async case this means it cannot be done from
`transceive` call context, as this context is left as soon as
transfer is initialized.

Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
2024-06-05 14:42:50 +01:00
Nikodem Kastelik
41ad1f3ddb drivers: pinctrl: nrf: use CLOCKPIN for slow SPIM MOSI
Fast SPIM instances must not have CLOCKPIN setting applied to MOSI.

Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
2024-06-05 14:42:50 +01:00
Ayush Singh
02d71a135c drivers: cc13xx_cc26xx: pwm: Fix building blinky_pwm
- Add channel, flags to pwm-cells
- Replace __ASSERT_UNREACHABLE with CODE_UNREACHABLE

Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>
2024-06-05 04:24:38 -07:00
Declan Snyder
90986e7e22 drivers: mcux_lptmr_timer: Fix compat string error
Fix error due to compatible string changing in DT and
forgetting to update this driver with the change.

Also make the counter symbol hidden.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-06-05 04:24:30 -07:00
Kai Vehmanen
a4fdd915d5 drivers: dma: intel_adsp_hda: change L1 exit defaults
DMA_INTEL_ADSP_HDA_TIMING_L1_EXIT should be set by default
for both Intel ACE15 and ACE20 platforms.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-06-05 01:38:54 -07:00
Daniel Kampert
246e614ac3 drivers: rtc: rtc_mc146818: Patch incorrect field comparisons
Minutes and hour values are incorrectly compared with MAX_SEC.

Compare minutes and hour to MAX_MIN and MAX_HOUR respectively.

Signed-off-by: Daniel Kampert <DanielKampert@kampis-elektroecke.de>
2024-06-05 01:38:33 -07:00
Krzysztof Chruściński
d07b13dbc2 drivers: serial: nrfx_uarte: Allow use of legacy shim on RISCV cores
Legacy shim takes less flash so it should be a first choice on cores
with less code memory (like RISCV cores on nrf54h20). Adding new
instances support to the legacy shim.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-06-05 01:37:57 -07:00
Sven Depoorter
dda604c96f drivers: display: ssd16xx: performance improvement
The driver writes the scan entry mode to the display controller on each
set_window call. Multiple calls to set_window can be needed to update
a single frame buffer in the controller.

There's a performance improvement by only setting the scan mode when
the orientation is changed (set_orientation, see previous commit)
and when the profile has changed.
For the latter the scan_mode is lost on the controller
due to a software reset.

Signed-off-by: Sven Depoorter <svndepoorter@gmail.com>
2024-06-04 19:13:18 -04:00
Sven Depoorter
e01f422b02 drivers: display: ssd16xx: implement display_set_orientation API
I chose this approach instead of software rotation because I need it for
an ultra low power project.
Rotation in steps of 0, 90, 180, 270 degrees is done by changing
the data entry modes.
This commit removes the orientation-flipped property as it is redundant.

I made the assumption that the current driver implementation is right
about controller X/Y versus display width/height. The display controller X
parameter matches with the display height (dts) and display controller Y
parameter matches with the display width (dts). It looks like display
manufacturers choose to have it like this because a wider screen probably
makes more sense.

Tested on the reel_board with a 250x122 display (ssd1673 controller)
and a custom PCB with a 200x200 display (ssd1681 controller).
Also tested all orientations with various width/height dts overrides.

Signed-off-by: Sven Depoorter <svndepoorter@gmail.com>
2024-06-04 19:13:18 -04:00
Yassine El Aissaoui
5c308e0344 bluetooth: hci_nxp: move vendor specific setup to its dedicated place
Some vendor specific setup was done inside
the open() HCI function, those should be
inside setup() function instead.

Signed-off-by: Yassine El Aissaoui <yassine.elaissaoui@nxp.com>
2024-06-04 19:10:22 -04:00
Dominik Ermel
459517badc drivers/flash/spi_nor: Fix DPD exit
Incorrectly placed preprocessor conditions caused exit_dpd
when there has been no instance of a device with
dpd_wakeup_sequence parameter.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Signed-off-by: Jan Tore Guggedal <jantore.guggedal@nordicsemi.no>
2024-06-04 16:28:59 -05:00
Chris Friedt
0fa97326c7 posix: create kconfig options for pse51, pse52, pse53
Create Kconfig "shortcuts" for PSE51, PSE52, and PSE53.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-04 16:27:12 -05:00
Chris Friedt
2bc722a97e posix: deprecate POSIX_FNMATCH GETOPT GETENTROPY
The functions fnmatch(), getopt(), getentropy()
and others are grouped into the standard Option Group
POSIX_C_LIB_EXT.

The getentropy() function is currently in-draft for
Issue 8 as of 2021.

https://www.opengroup.org/austin/docs/austin_1110.pdf

Not surprisingly, the POSIX_C_LIB_EXT Option Group
also includes the highly debated strnlen() function.

Moving that function will be deferred until later.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-04 16:27:12 -05:00
Chris Friedt
bc4374b5fe posix: deprecate POSIX_MAX_FDS and add POSIX_DEVICE_IO
The POSIX_MAX_FDS option does not correspond to any standard
POSIX option. It was used to define the size of the file
descriptor table, which is by no means exclusively used by
POSIX (also net, fs, ...).

POSIX_MAX_FDS is being deprecated in order to ensure that
Zephyr's POSIX Kconfig variables correspond to those defined in
the specification, as of IEEE 1003.1-2017. Namely,
POSIX_OPEN_MAX. CONFIG_POSIX_MAX_OPEN_FILES is being deprecated
for the same reason.

To mitigate any possible layering violations, that option is
not user selectable. It tracks the newly added
CONFIG_ZVFS_OPEN_MAX option, which is native to Zephyr.

With this deprecation, we introduce the following Kconfig
options that map directly to standard POSIX Option Groups by
simply removing "CONFIG_":

* CONFIG_POSIX_DEVICE_IO

Similarly, with this deprecation, we introduce the following
Kconfig options that map directly to standard POSIX Options by
simply removing "CONFIG":

* CONFIG_POSIX_OPEN_MAX

In order to maintain parity with the current feature set, we
introduce the following Kconfig options.

* CONFIG_POSIX_DEVICE_IO_ALIAS_CLOSE
* CONFIG_POSIX_DEVICE_IO_ALIAS_OPEN
* CONFIG_POSIX_DEVICE_IO_ALIAS_READ
* CONFIG_POSIX_DEVICE_IO_ALIAS_WRITE

Gate open(), close(), read(), and write() via the
CONFIG_POSIX_DEVICE_IO Kconfig option and move
implementations into device_io.c, to be conformant with the
spec.

Lastly, stage function names for upcoming ZVFS work, to be
completed as part of the LTSv3 Roadmap (e.g. zvfs_open(), ..).

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-04 16:27:12 -05:00
Alberto Escolar Piedras
038b7b8c41 drivers/clock_control nrf: Treat simulated nRF54L15 like real
Default the clock accuracy for the simulated 54L15 target
just as for the real target.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-06-04 14:04:57 -05:00
Declan Snyder
e4cf90faa3 drivers: counter_smartbond_timer: Fix warning
Fix the warning about control reaching end of non void
function by adding a default to the switch statement.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-06-04 14:04:09 -05:00
Yong Cong Sin
e54b27b967 arch: define struct arch_esf and deprecate z_arch_esf_t
Make `struct arch_esf` compulsory for all architectures by
declaring it in the `arch_interface.h` header.

After this commit, the named struct `z_arch_esf_t` is only used
internally to generate offsets, and is slated to be removed
from the `arch_interface.h` header in the future.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-06-04 14:02:51 -05:00
Chris Braissant
61536c1096 drivers/sensor: lps22hh: Enable fetching individual sensor channels
Add the possibility to fetch specific sensor channels independently,
either pressure data with SENSOR_CHAN_PRESS or temperature data
with SENSOR_CHAN_AMBIENT_TEMP.
Additionally, the option to fetch both channels simultaneously remains
available using SENSOR_CHAN_ALL, thus not breaking any samples.

Signed-off-by: Chris Braissant <chrisbraissant@gmail.com>
2024-06-04 16:38:00 +02:00
Aurelien Jarno
371f22b937 drivers: sensor: st: add driver for the STM32 Digital Temperature Sensor
This add basic support for the STM32 Digital Temperature Sensor found
notably on the STM32H7 series. It work in interrupt mode and support
basic power device management.

It does not support the more advanced features like using the
temperature threshold, triggers from LPTIM or using the LSE clock in
during sleep or stop.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2024-06-04 16:37:19 +02:00
Jeppe Odgaard
052eb6180d drivers: adc: adc_ad559x: fix 5593 adc read
The AD5593 conversion result also contains the channel read and not just a
value:
| adc channel (3 bits) | adc value (12 bits) |

This value was not removed from the result before using it as an adc value.

Reuse the AD5592 code to fix the issue.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2024-06-04 16:36:14 +02:00
Nazar Palamar
7c3b66eac8 soc: psoc6: update pinctrl for PSoC6 MCU (legacy)
update pinctrl for PSoC6 MCU (legacy)

Signed-off-by: Nazar Palamar <nazar.palamar@infineon.com>
2024-06-04 16:35:39 +02:00
Henrik Brix Andersen
b711caea6d drivers: eeprom: atmel_at2x: improve Kconfig help descriptions
Improve the Kconfig descriptions for the atmel,at2x EEPROM driver. This
driver works for a number of different EEPROM families manufactured by
vendors other than Atmel.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-06-04 13:40:14 +02:00
Anas Nashif
07fb31c31e drivers: dai/ssp: Support dynamic SSP management
This commit refactors the Intel SSP DAI driver to support dynamic
management of SSP IP. This change additionally separates the
management of the DAI part from the management part of the SSP IP.

Key changes:
- Add new static functions to manage SSP IP power.
- Update the DAI SSP configuration functions to use the new management
  approach.
- Update device tree bindings and instances to reflect the new SSP IP
  management mechanism.
- ace30 (PTL) support.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
2024-06-04 13:40:04 +02:00
Jaroslaw Stelter
74b53df064 drivers: mm/intel_adsp: Add MMU support to MM driver
In the Intel platforms most of HPSRAM is used by modules when
are required. By default all these banks are powered off and are
enabled by L2 MM driver only when needed.

At the driver initialisation each unused page is unmaped and
when whole HPSRAM bank is unused the power is switched off.

Since mapping memory in MMU TLB and flushing it at system start is
not needed and time consuming, this patch modifies the init
sequence to avoid it.

Additionally it adds MMU maping and unmaping for pages allocated
from unused pool.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-06-04 13:40:04 +02:00
Anas Nashif
d35a2b89f3 intel_adsp: dmic: enable support for ptl use new headers
headers for dmic are now part of the SoC and maintained per generation,
so create one header for PTL and build the code for PTL in some of the
drivers (dmic_nhlt).

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-06-04 13:40:04 +02:00
Jaroslaw Stelter
b0abe57bc5 drivers: dai/dmic: Add support for ace30 (PTL)
Add dmic support in PTL.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
2024-06-04 13:40:04 +02:00
Tahsin Mutlugun
21723941a2 drivers: spi: Add MAX32690 SPI driver
Add SPI driver for Analog Devices MAX32690 MCU. Supports interrupt-based
transfers.

Co-Authored-By: Mert Vatansever <mert.vatansever@analog.com>
Co-Authored-By: Sadik Ozer <sadik.ozer@analog.com>
Co-Authored-By: Rob Cornall <rob.cornall@analog.com>
Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
2024-06-04 13:39:51 +02:00
Aaron Ye
30c41e9559 drivers: bluetooth: hci_ambiq: add necessary SPI CS control
Before sending packet to controller the host needs to poll the status of
controller to know it's ready, or before reading packets from controller
the host needs to get the payload size of coming packets by sending
specific command and putting the status or size to the rx buffer, the CS
should be held at this moment to continue to send or receive packets.
This change is needed for the based SPI driver update.

Signed-off-by: Aaron Ye <aye@ambiq.com>
2024-06-04 13:39:27 +02:00
Hao Luo
524ea22952 drivers: spi: Add support for Apollo3 SoCs SPI
This commit adds support for the SPI which
can be found in Apollo3 SoCs, it can work in
both DMA and non-DMA modes

Signed-off-by: Hao Luo <hluo@ambiq.com>
2024-06-04 13:39:27 +02:00
Guillaume Gautier
425452bddc drivers: clock: stm32f1,f3: fix adc prescaler
Fix a compilation error occurring when a prescaler was set for ADC on F1
and F3 family.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-06-04 13:39:14 +02:00
Francois Ramu
447bdea7ff drivers: entropy: stm32 entropy driver add semaphore protection
Add a semaphore to protect the disable access to the RNG peripheral
when the PM is going to suspend mode.
The change does not affect other stm32 than CONFIG_SOC_SERIES_STM32WBX
or CONFIG_STM32H7_DUAL_CORE

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-06-04 13:37:05 +02:00
Henrik Brix Andersen
c56134ebff drivers: flash: flash_util: params may be unused
The params variable may be unused depending on the Kconfig options enabled.

Fixes: #73697

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-06-04 10:14:01 +02:00
Dominik Ermel
7e658607fc drivers: flash: shell: Add support for devices without erase
Shell will now work with devices that do not implement erase callback.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-06-04 08:00:46 +02:00
Dominik Ermel
56142dcc73 drivers: flash: Mark numaker series RMC as no_explicit_erase
The device is based on ReRAM and does not require erase.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-06-04 08:00:46 +02:00
Dominik Ermel
0c10b20cc8 drivers: nrf_qspi_nor: Mark driver with FLASH_HAS_EXPLICIT_ERASE
All QSPI connected NOR Flash devices require erase prior to
write.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-06-04 08:00:46 +02:00