Commit graph

23353 commits

Author SHA1 Message Date
Chris Friedt
f4e07d15d6 sys: util: define bits per byte, nibble, and nibbles per byte
Collect some common bit-widths redefined in various locations
and put them under sys/util.h .

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-10-15 19:05:06 +01:00
Chaitanya Tata
b40cb4c46c drivers: nrfwifi: Use Zephyr tooling to load nRF70 FW file
Instead of relying on INCBIN macros which do not properly add
dependencies, e.g., modifying FW file doesn't trigger rebuild.

Use the Zephyr cmake tooling to load the FW patch file as a header.

This also improves memory report where the patch target is clearly
visible instead of a hidden section.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-10-15 19:04:29 +01:00
Chaitanya Tata
7f9be54897 Revert "drivers: nrfwifi: Fix rebuilding when FW blobs are changes"
This reverts commit e2e96acebf.
This will be properly fixes by adding a target for nRF70.bin and
removing INCBIN approach.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-10-15 19:04:29 +01:00
Jilay Pandya
ecada895da drivers: stepper: update drivers as per the api changes
This commit deprecates passing of async signal in functions such as move
and set_target_position. As per the new API, the async signal has to be
set via set_async_signal.

If RAMPSTAT_POLL is activated then enable_constant_velocity_mode would be
able to raise signals like END_STOP_DETECTED & SENSORLESS_STALL_DETECTED.
This commit also adjusts shell script in order to test these signals.

Signed-off-by: Jilay Pandya <jilay.pandya@zeiss.com>
2024-10-15 13:53:16 +02:00
Jilay Pandya
4f18d64b30 drivers: stepper: api: introduce stepper_set_event_callback function
- Refactor stepper_signal_result to stepper_event.
- Introduce stepper_set_event_callback function
- Deprecate k_poll_signal

Signed-off-by: Jilay Pandya <jilay.pandya@zeiss.com>
2024-10-15 13:53:16 +02:00
Tim Lin
7fa962589f ITE: it8xxx2: Remove CONFIG_PINCTRL from soc defconfig file
The driver Kconfig determines whether pinctrl is enabled
instead of soc defconfig.

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2024-10-15 13:52:55 +02:00
Daniel DeGrasse
d2df15a0e9 drivers: video: video_mcux_smartdma: add SMARTDMA video driver
Add SMARTDMA video driver. This driver uses the SMARTDMA engine as a
parallel camera interface, which can read QVGA frames from a camera
device. Due to SRAM constraints, the video driver divides the camera
stream into multiple horizontal video buffers as it streams them back to
an application.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-10-15 04:10:50 -04:00
Daniel DeGrasse
f386cc26fa drivers: video: ov7670: improve resolution init code
Improve resolution init code for OV7670 driver, to properly program the
full set of registers needed to realize a given output resolution. The
settings for these registers are based on those used in the MCUX SDK
driver, which are derived from the resolution register settings given in
the OV7670 programming guide, with a different configuration for the
CLKSRC and DBLV registers used for the input clock.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-10-15 04:10:50 -04:00
Daniel DeGrasse
126306981d drivers: dma: dma_mcux_smartdma: update interface to support custom FW
The SMARTDMA is a programmable DMA engine, and supports custom firmware
in order to run complex DMA operations. Update the driver to increase
the flexibility users have when configuring the SMARTDMA with
custom firmware, and remove the RT500 display firmware specific
definitions and functionality from the driver.

This display setup is now handled from the MIPI DSI driver, since the
firmware used for this case is specific to the MIPI DSI IP.

This change also requires an update to the RT500 devicetree, as the
register definition for the SMARTDMA has changed, so the base address
must as well.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-10-15 04:10:50 -04:00
Daniel DeGrasse
561198ac75 drivers: video: handle line_offset field
Since all video drivers in tree use a full frame, their video buffers
will always start at a line_offset of 0 within the frame.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-10-15 04:10:50 -04:00
Daniel DeGrasse
ec6ffc8b33 drivers: video: update video drivers to handle min/max line count
Update existing video drivers to handle the min/max line count field
within the video_caps structure. All drivers work with full frames
currently, so use the special LINE_COUNT_HEIGHT value to indicate this.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-10-15 04:10:50 -04:00
Paweł Czaplewski
9fe959857a drivers: sensor: tmp1075: Add tmp1075 sensor driver and sample
TI tmp1075 driver implemented based on tmp108 driver.
The driver initializes the sensor based on the DTS.

Added tmp1075 example overlay file to thermometer sample.
All you need to do to use the sensor is to connect the I2C and
optionally interrupt line.
To see default DTS configuration option inspect `ti,tmp1075.yaml`
bindings file and sensor spec.

Signed-off-by: Paweł Czaplewski <pawel.czaplewski@arrow.com>
2024-10-15 04:10:40 -04:00
Bernhard Krämer
6ea04441f9 drivers: ethernet: Add DP83825 phy driver
Includes dt binding

Signed-off-by: Bernhard Krämer <bdkrae@gmail.com>
2024-10-15 04:10:06 -04:00
TOKITA Hiroshi
042a40d0e3 drivers: lora: rylrxxx: Add stdio.h to resolve function prototypes
The source code uses functions from stdio.h,
such as `sprintf()`, but they are not explicitly included
so that we will add it.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-10-15 04:09:56 -04:00
TOKITA Hiroshi
1d4c29ab29 drivers: lora: rylrxxx: Fix missing default y in LORA_RYLRXXX
The `default y`, which is coupled with
`depends on DT_HAS_REYAX_RYLRXXX_ENABLED` to link the settings with
DeviceTree, which was missing, so I added it.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-10-15 04:09:56 -04:00
Adrian Warecki
256ab0c919 ace: mm: tlb: Check tlb translation enabled before flushing cache
Before unmapping a memory page, the cache is flushed. If the given memory
page is not mapped, this operation ends with a cpu exception on the
ptl platform. Add check if tlb translation is active before flushing.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2024-10-15 04:09:49 -04:00
Adrian Warecki
0e9b9b0cf3 ace: mm: tlb: Ignore unmappig error in driver initalization
The sys_mm_drv_unmap_region_initial function is responsible for unmapping
all unused virtual memory during tlb driver initialization. Most addresses
will not have a mapped page. Ignore the error code indicating unmapped
memory that will occur when trying to unmap.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2024-10-15 04:09:49 -04:00
Declan Snyder
2ab104625e drivers: mdio_nxp_enet: Don't disable IRQ
No real need to be enabling and disabling IRQs, this logic has been
reported to be causing spurious interrupts and strange behavior, we can
just enable the interrupt and switch to interrupt based logic one time
and keep the interrupt enabled at that point.

Also, fix a W1C bug where |= was used instead of = to clear a flag.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-10-15 04:08:30 -04:00
Marcin Szymczyk
a555838033 drivers: mbox: nrf_vevif_task_rx: align to direct IRQs
Allow using direct IRQs (which are obligatory when buiding
with `CONFIG_GEN_SW_ISR_TABLE=n`).

Signed-off-by: Marcin Szymczyk <marcin.szymczyk@nordicsemi.no>
2024-10-15 04:07:32 -04:00
Dean Sellers
43897a4e60 drivers: ethernet: enc28j60: Fix carrier on race on init
If there is a carrier (cable plugged in) on device initialisation
there is a race between the interrupt service and the L2 init.

Signed-off-by: Dean Sellers <dsellers@evos.com.au>
2024-10-15 04:05:50 -04:00
Guillaume Gautier
f4f1b1a365 drivers: adc: stm32: fix clock check for stm32f1
STM32F1 doesn't have synchronous/asynchronous source clock choice.
The recently added clock check was failing compilation for these series.
This commit removes the check for F1.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-10-15 04:05:22 -04:00
Lucien Zhao
62c62da1ba dts: arm: nxp: rt118x: add qtmr instances
update driver clock to adapt qtmr clock structure
add 8 qtmr instances

Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
2024-10-15 04:37:47 +01:00
Jordan Yates
4361c96c48 adc: current_sense_amplifier: resistance in milli-ohms
Change the unit of the sense resistor in the devicetree binding from
micro-ohms to milli-ohms. This is done for three reasons.

Firstly, the maximum value resistor that can currently be represented
is 4.2 kOhms, due to the limitation of devicetree properties to 32 bits.

Secondly, storing the resistance at such a high resolution makes
overflows much more likely when the desired output unit is micro-amps,
not milli-amps.

Finally, micro-ohms, are an unnecessarily precise unit for the purpose
of these calculations, and a resolution that is not realistic to
achieve. The high resistor resolution results in large divisors that
reduce the resolution of outputs. Unlike resistors characterised down to
the micro-ohm, devices wanting to measure micro-amps are actually
realistic.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-10-14 13:05:07 +02:00
Michal Simek
50919747bf drivers: ipm: xlnx: fix AMD copyright
There is nothing like AMD-Xilinx Inc. That's why use full AMD name
instead.

Fixes: 09e2a4e9eb ("drivers: ipm: add zynqmp r5f support")
Co-developed-by: Mubin Sayyed <mubin.sayyed@amd.com>
Signed-off-by: Mubin Sayyed <mubin.sayyed@amd.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
2024-10-14 13:03:48 +02:00
Sylvio Alves
7a57d55c76 drivers: bt: airoc: fix compliance check
Fix compliance check related to "symbols without children".
Using regular 'config' entry.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-10-14 13:03:28 +02:00
Declan Snyder
ca829e1b77 include: spi: Clarify data frame units and meaning
Make clear in the include/ header that data frame size
is the same thing as word size for the context of this API.

Also, add some comments to the spi_context to make it easier
for driver writers to understand how to use the functions,
by noting the meaning of the dfs and len parameters to the update
functions. Otherwise it takes some time to understand what they mean.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-10-14 13:03:10 +02:00
Robert Lubos
c4803752a8 net: Deprecate CONFIG_NET_SOCKETS_POLL_MAX
CONFIG_ZVFS_POLL_MAX is now used to control the maximum number of poll()
entires. Thereby, CONFIG_NET_SOCKETS_POLL_MAX is redundant and shall
be deprecated.

Modify the defaults for NET_SOCKETS_POLL_MAX and ZVS_POLL_MAX so that
the deprecation actually makes sense instead of symbol removal. In case
the application still sets the old config, it will modify the
ZVS_POLL_MAX default.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-10-14 13:01:51 +02:00
Mahesh Mahadevan
1f0a15fa08 drivers: sensor: Fix NXP LPCMP driver
Fix Build failure due to undefined variable.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2024-10-14 13:01:13 +02:00
Daniel Leung
1ec5ce05f9 dp: swdp_bitbang: fix unused variable build error
The variable config in sw_port_off() is not used, and it's
causing CI build error about unused variable. So remove it.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-10-11 17:04:38 -05:00
Maximilian Deubel
b0936ae353 drivers: dp: swdp_bitbang: power optimization
This patch changes GPIO initialization
to be in PORT_OFF state by default.
Also, if no transceiver is attached to the signals,
the GPIOs are configured to be disconnected to preserve power.

I tested this on a prototype board where we are going to have
a debugger in a low-power context.

Signed-off-by: Maximilian Deubel <maximilian.deubel@nordicsemi.no>
2024-10-11 13:20:18 -04:00
Krzysztof Chruściński
e11d050b23 drivers: pwm: nrfx: Improve runtime PM
Rework PM handling to use pm_device_driver_init(). Shim is not using
put and get internally as there is no api that disables or stops
pwm so it is hard to determine when to put the device. There are cases
when PWM peripheral is stopped but PWM is still active because
duty cycle is 100% or 0% and pin is driven by GPIO and not PWM.

If user want to use runtime PM with PWM it is possible and getting
the device will initialize internal data and putting will suspend
by forcing PWM stop if used and setting pins to sleep state. However,
from power consumption perspective it is enough to set 0% or 100%
duty cycle on all channels.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-10-11 13:18:34 -04:00
Krzysztof Chruściński
c3a33cfd3e drivers: pwm: nrfx: Disable PWM peripheral when not used
Shim was not correctly disabling PWM when it was not used. Task
STOP was triggered but PWM->ENABLE remained set which caused
increased current. Added interrupt and enabled event handler in
the nrfx driver to allow disabling PWM on STOPPED event.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-10-11 13:18:34 -04:00
Krzysztof Chruściński
0ab86c48dd drivers: pwm: nrfx: Improve device generation macros
Use NRFX_FOREACH_PRESENT macro to iterate over all PWM instances
and create device only for those enabled in the devicetree.
This approach removes need of changing driver code when new
instance id is added.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-10-11 13:18:34 -04:00
Guillaume Gautier
ded9e11d59 drivers: dma: stm32 dmamux: fix for c0 hal update
Fix the DMAMUX driver for the STM32C0 HAL update. Typedef used in function
is now const.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-10-11 13:18:01 -04:00
Guillaume Gautier
48ba84bb95 drivers: clock: stm32 common: update ahb prescaler
STM32C0 have a different prescaler for SYSCLK and for HCLK.
Updates the clock driver to use the appropriate prescaler for each series.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-10-11 13:18:01 -04:00
Reto Schneider
7fa5a222a0 drivers: flash: Sort CMake and Kconfig files alphabetically
By sorting the lines alphabetically, merge conflicts can be reduced.

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2024-10-11 13:16:15 -04:00
Joakim Andersson
d794d58d64 drivers: nrf_qspi_nor: Check poll period before sleep
Check that the poll period is non-zero before sleeping.

Signed-off-by: Joakim Andersson <joerchan@gmail.com>
2024-10-11 13:16:05 -04:00
Joakim Andersson
14c896b647 drivers: nrf_qspi_nor: Fix build without multithreading
Fix build of nrf_qspi_nor flash driver without multithreading enabled.
This is required for builds like mcuboot.

Signed-off-by: Joakim Andersson <joerchan@gmail.com>
2024-10-11 13:16:05 -04:00
Wajdi ELMuhtadi
9af50a7b19 drivers: sensor: wsen_tids: remove wsen_tids driver
Remove wsen_tids since the hal update
is no longer compatible with this version.

Signed-off-by: Wajdi ELMuhtadi <wajdi.elmuhtadi@we-online.com>
2024-10-11 13:15:10 -04:00
Wajdi ELMuhtadi
8f684cfe9b drivers: sensor: wsen_pdus: remove wsen_pdus driver
Remove wsen_pdus since the hal update
is no longer compatible with this version.

Signed-off-by: Wajdi ELMuhtadi <wajdi.elmuhtadi@we-online.com>
2024-10-11 13:15:10 -04:00
Wajdi ELMuhtadi
8c0b09ddc3 drivers: sensor: wsen_pads: remove wsen_pads driver
Remove wsen_pads since the hal update
is no longer compatible with this version.

Signed-off-by: Wajdi ELMuhtadi <wajdi.elmuhtadi@we-online.com>
2024-10-11 13:15:10 -04:00
Wajdi ELMuhtadi
449bf8019c drivers: sensor: wsen_hids: remove wsen_hids driver
Remove wsen_hids since the hal update
is no longer compatible with this version.

Signed-off-by: Wajdi ELMuhtadi <wajdi.elmuhtadi@we-online.com>
2024-10-11 13:15:10 -04:00
Wajdi ELMuhtadi
5f584052d8 drivers: sensor: wsen_itds: remove wsen_itds driver
Remove wsen_itds driver since the hal update
is no longer compatible with this version.

Signed-off-by: Wajdi ELMuhtadi <wajdi.elmuhtadi@we-online.com>
2024-10-11 13:15:10 -04:00
Duy Phuong Hoang. Nguyen
59dbbb347d drivers: pwm: Initial support for PWM driver on RA8
Add PWM driver code support for RA8. This support is using
GPT HW

Signed-off-by: Duy Phuong Hoang. Nguyen <duy.nguyen.xa@renesas.com>
2024-10-11 09:28:29 +02:00
Lucas Dietrich
11abb5e4fc drivers: crypto: Fix pointer type warnings in STM32 AES driver
This patch resolves compiler warnings related to mismatched pointer types
between the STM32L4 and generic STM32 AES HAL by introducing CAST_VEC
macro.

Fix github CI warning

Signed-off-by: Lucas Dietrich <ld.adecy@gmail.com>
2024-10-11 09:28:12 +02:00
Lucas Dietrich
ad431dcc23 drivers: crypto: Add support for STM32L4 AES accelerator
This patch completes the addition of support for the STM32L4 AES
accelerator by introducing conditional handling for different STM32 AES
HAL variants. Key changes include:

- Created device tree bindings `st,stm32l4-aes` for STM32L4 AES
- Replaced `copy_reverse_words` with `copy_words_adjust_endianness`
to handle endianness conversion for different variants.

Signed-off-by: Lucas Dietrich <ld.adecy@gmail.com>
2024-10-11 09:28:12 +02:00
Lucas Dietrich
8f0de8455d drivers: crypto: Refactor encryption and decryption functions for STM32 AES
This patch introduces a unified function pointer approach to handle
encryption and decryption operations for the STM32 AES accelerator.

- Replace separate `do_encrypt` and `do_decrypt` functions with a generic
`do_aes` function, using function pointers to AES HAL functions.

Signed-off-by: Lucas Dietrich <ld.adecy@gmail.com>
2024-10-11 09:28:12 +02:00
Alexander Kozhinov
fbeda5959d drivers: ethernet: eth_stm32_hal_priv.h
Remove unused missleading definition.

Signed-off-by: Alexander Kozhinov <ak.alexander.kozhinov@gmail.com>
2024-10-11 09:28:05 +02:00
Alexander Kozhinov
0036b8bf21 drivers: ethernet: eth_stm32_hal
Drop preprocessor redefinitions

Some preprocessor defines were redefined to follow
stm32 hal naming conventions.
People seems to be confused by redefines and use
them with alternating names.
This PR does not change code behaviour,
but shall increase it's readability.

Signed-off-by: Alexander Kozhinov <ak.alexander.kozhinov@gmail.com>
2024-10-11 09:28:05 +02:00
Laurentiu Mihalcea
202794273d drivers: intc: irqstr: add PM support
Add support for PM. The strategy is as follows:

	1) For level 1 interrupts: don't care, these don't
	require the PM domain of irqsteer to be turned on
	since they are, well, direct.

	2) For level 2 interrupts: use the reference count
	of the dispatchers.

Upon doing a get() on a dispatcher with its reference count
set to 0, before enabling the IRQ (meaning accessing the
reg. space) increment the reference count of the irqstr device
(which will result in the PM domain being enabled if 0).

Upon doin a put() on a dispatcher with its reference count
set to 1, after disabling the IRQ (meaning accessing the
reg. space) decrement the reference count of the irqstr device
(which will result in the PM domain being disabled if 0).

In summary, the PM domain of the device will be enabled if
at least one dispatcher is in use. On the other hand, the
PM domain of the device will be disabled if there's no
dispatchers in use (assuming there's no other dependencies).

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-10-11 09:27:57 +02:00