Negative error codes cannot be returned if the function returns an
unsigned integer. Change function's API to return the read compare
register value through a pointer and the actual result as a signed
integer.
Signed-off-by: Jędrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
We are not able to achive 50ppm on nRF54L.
Working on fixing it propperly, but untill we do set what we get.
Signed-off-by: Martin Tverdal <martin.tverdal@nordicsemi.no>
add gpio_intel driver with acpi based resource enumeration support.
Also updated test cases overlay with new dts entires.
Signed-off-by: Najumon B.A <najumon.ba@intel.com>
The commit "drivers: ethernet: dsa_ksz8xxx: use
NET_DEVICE_DT_DEFINE_INSTANCE"
(SHA1: f78a081066) replaced
NET_DEVICE_INIT_INSTANCE() with NET_DEVICE_DT_DEFINE_INSTANCE() to
facilitate the removal of deprecated (from Zephyr's 3.2 release)
DT_LABEL() macro.
Unfortunately, the per LAN port initialization is necessary for correct
operation of the DSA driver - otherwise following errors were visible
when LLDP DSA sample (samples/net/dsa/src) was run on ip_k66f board:
<wrn> net_if: iface 0x20001440 is down
<inf> net_dsa_lldp_sample: LLDP pkt recv -> lan1
<inf> net_dsa_lldp_sample: CHASSIS ID: 38:05:43:69:XX:ZZ
<inf> net_dsa_lldp_sample: PORT ID: 38:05:43:69:XX:ZZ
<inf> net_dsa_lldp_sample: TTL: 120s
<inf> net_dsa_lldp_sample: SYSTEM NAME: mtt
<err> net_dsa_lldp_sample: Failed to send, errno 115
The fix is to use again NET_DEVICE_INIT_INSTANCE() with "lan"X name
assigned (to avoid too long names when recommended DT_PROP() is
used instead of DT_LABEL()).
Fixes: f78a081066
Signed-off-by: Lukasz Majewski <lukma@denx.de>
Add an I3C shell. This includes support of all I3C CCC commands that
currently have helper functions implemented. This also includes all
the read/write shell commands that the i2c shell supported. An Info
command is also provided which will print out all i3c and i2c info
of an i3c bus. Only SDR read/writes are currently implemented.
Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
Updates the linker script fragments under 'drivers' to use
Z_LINK_ITERABLE_SUBALIGN for the subalignment instead of
a hardcoded value of 4.
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
This commit removes unnecessary usage of the `ARG_UNUSED` macro and
unnecessary initialization of the `ret` variable where its value is
guaranteed to be overwritten by subsequent operations.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Interrupt handlers are expected to have a pototype
void (const void*)
but nrfx_grtc_irq_handler has just a void(void)
(with no input parameter).
Fix it by using a trampoline.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
FTM internal counter can be clocked by one of three clock sources
independent of the module bus clock. This patch introduces a DT property
to perform the clock selection from DT.
DT sources are updated to keep the current clock selection for all boards,
with exception of ucans32k1sic board which is migrated to use system
clock by default, as this seems to be a better choice for most cases.
Some PWM LED samples require slower clock so overlays are added for
those cases.
Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
There is no reason to pass addrlen by pointer, since it is a read-only in
the context of sockaddr_to_nsos_mid().
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
Add support for half-duplex (3-wire) SPI operation using the Raspberry
Pi Pico PIO. To allow control of the size of the driver, including
half-duplex support is optional, under the control of Kconfig options.
The original PIO source code is also included as a reference.
Corrected 3-wire tx/rx counts.
Enable half-duplex code based on DTS configuration
Replace runtime checks with static BUILD_ASSERT()
Remove too-fussy Kconfig options
Removed PIO source per review request
Signed-off-by: Steve Boylan <stephen.boylan@beechwoods.com>
Redundant kLPSPI_MasterPcsContinuous transfer config flag
is eliminated since this is set earlier.
Signed-off-by: Dipak Shetty <dipak.shetty@zeiss.com>
Submit USBFSOTG_EVT_XFER on halt clear to allow queued
transfers to execute as soon as endpoint STALL is cleared.
Signed-off-by: Mark Wang <yichang.wang@nxp.com>
Make DSA dependent on ETH_DSA_SUPPORT which is selected by driver
kconfigs, rather than having a list of dependencies.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Deprecate ETH_MCUX, by:
- Marking it as DEPRECATED in Kconfig, obviously.
- Unmarking the new driver as experimental.
- Putting the new and old drivers in the same folder.
- Reworking the menu appearance of the driver selection.
Note that technically now it is possible to choose the wrong
driver than what is enabled in DT, this is intentional, but
the correct one will obviously be enabled by default.
- Convert all sample overlays to the new Kconfigs. This was
part of the motivation for the shared overlays, as it was
causing twister/CI logs to look ugly and misleading due
to Kconfig warnings.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
I have tested the DSA support with ETH_NXP_ENET driver and it
works, so marking it as supported by adding it to the dependency
list for the DSA feature.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
The MAC address macros are ridiculous in this driver.
Rewrite to be simpler and use eth.h common function.
Also, clarify the mac address generation on the DT overlays.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Convert from multiple threads for each instance to use
one workqueue for all instances. The benefit is to save
memory and use a kernel function that already exists
for a use case like this.
Also introduce the ETH_NXP_ENET_RX_THREAD_PRIORITY kconfig,
which makes the thread priority of the workqueue configurable.
Finally, remove the code enabling the RxBufferInterrupt, since
the meaning of it isn't used currently in this driver.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Add functionality for when NET_POWER_MANAGEMENT (ie PM_DEVICE)
is enabled. This function code originally comes from the
old eth_mcux driver which was only tested on kinetis family SOCs,
so that family kconfig is a dependency for this feature for now.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Some comments in this driver are just redundant - the code
spells out exactly what the comment says. And some comment
blocks are just unnecessary to have. Finally, remove the TODO
comment because this is flagged by static analysis and there
are already tracking issues for the zero copy enhancement.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
The dependencies should be in a 'depends on' clause.
Also, 'depends on PTP_CLOCK' is redundant because this is
within 'if PTP_CLOCK' already.
Additionally, conditionally include the PTP header in the mac driver.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Added changes required for nxp_enet ethernet driver to work
with multiple PHYs and fixed few problems:
- The cfg_link API resets PHY before configuring link. It was moved
here so the ethernet driver does not have to reset it - not all
PHYs need reset before configuring link and moving the reset code
here makes possible to have the reset done in a PHY specific way
(for example to reset by toggling GPIO pin). It also avoids ethernet
driver touching PHY registers without locking.
- When reset GPIO is not defined, reset is performed by setting reset
bit in control register.
- The cfg_link API does not return error when autonegotiation fails.
This fixes situation when the link is down at system start - ethernet
driver then skipped setting link-change callback and link was never
to be detected again.
- Added reset of excessive bits 16-31 when reading register values.
As only 16 bits are read from PHY, but the API is supposed to read
into uint32_t, the remaining bits contained previous data after
a successful read.
- Fixed missing mutex unlock when querying link state and link was down.
- Added missing initializer to link state variables. This could result
in link state change detection while link was still down, because
the speed/duplex settings could be random and old and new state
could be wrongly detected as different.
- Not logging link speed/duplex status when link is not up.
Signed-off-by: Stanislav Poboril <stanislav.poboril@nxp.com>
The lpadc driver needs to obtain its functional clock to configure
the acquisition time. This patch add support for I.MX RT three digit
parts, I.MX RT11xx parts, and LPC parts.
Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
When RX length was 0 and error was reported then UART_RX_STOPPED event
was not sent. Fixing the condition check to ensure that UART_RX_STOPPED
is always generated.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Clean error state on re-enabling RX. If previous transmission ended with
an error it should not impact next receiving session.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
The Open_PDM_Filter_64/128() functions of the third-party OpenPDMFilter
library are designed to handle a fixed PCM block size of 1 ms of audio.
Allow the MPxxDTyy drivers to use a block size of more than 1 ms by
calling the filtering function multiple times, once for each ms of
audio.
Fixeszephyrproject-rtos/zephyr#69447
Signed-off-by: Petar Susac <petar.susac@byte-lab.com>
Adds a DAC driver for Texas Instruments DACx0501 family of devices
Signed-off-by: Eran Gal <erang@google.com>
Co-authored-by: Martin Jäger <17674105+martinjaeger@users.noreply.github.com>
... so that the pin is kept in a defined state when the IO3 line is
not controlled by the QSPI peripheral (when the peripheral is disabled
or disconnected from the pin).
The IO3 pin in Quad SPI flash chips usually has dual functionality -
it is an I/O line when the chip is configured to work in Quad (4 I/O)
mode and it is a HOLD# or RESET# line when the chip is configured to
work in non-Quad (2 I/O) mode. In the latter case, it is important that
the line is kept in the inactive (high) state, otherwise communication
with the chip may be disrupted (and this actually happens when e.g.
the spi_flash sample is used on a brand new nRF5340 or nRF52840 DK -
the nrf_qspi_nor driver fails to initialize and the sample just ends
up with the "mx25r6435f@0: device not ready" message).
This commit addresses the problem in the same way that it was done for
the CSN line in commit 6d8172f4e9.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
Some SPI based displays expect the ability to lock the SPI bus after a
transaction completes, or to hold CS low. In order to accommodate this
within the MIPI DBI layer, add the mipi_dbi_release API, which allows
SPI displays to hold then release the SPI bus used by the MIPI
abstraction layer.
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
Nuvoton NPCX chips have reset registers which allow to reset the
peripheral hardware modules. This commit adds the support by
implementing the reset driver. Note that only the reset_line_toggle API
is supported because of the nature of the reset controller's design.
Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
Move resetting of the receiver state to disabling function so that once
uart is disabled there is no data pending in the module.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
This driver creates a disk_access that transparently reads from and writes
to a file in a file system.
Signed-off-by: Armin Brauns <armin.brauns@embedded-solutions.at>
DT nodes and compatible had been renamed and Kconfig option was relying
on the names that do not exists.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Have seen timeout error occur when doing an emit stop at
end of a multiple register write to a mmc5633 mag sensor IC.
The i3c_mcux driver would return on such an error without
doing the k_condvar_broadcast(), since the stop wasn't
technically done (or unclear if it was), and then future
transfers requests waiting on the condvar could be blocked
forever. Add a limited retry when a timeout occurs to
avoid such a stall condition from happening.
Signed-off-by: Mike J. Chen <mjchen@google.com>
`bt_recv` is invoked from the BT long work queue, which is preemptible.
The host uses cooperative scheduling to ensure thread safety.
Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
Removes conditional calling k_busy_wait() on single threaded
systems and uses k_sleep for both single and multi threaded
systems.
Commit e375d82 ("kernel: Implement k_sleep for Single Thread")
eliminated the need to call k_busy_wait() on single threaded
systems in place of k_sleep.
Signed-off-by: Ricardo Rivera-Matos <rriveram@opensource.cirrus.com>
Removes conditional calling k_busy_wait() on single threaded
systems and uses k_sleep for both single and multi threaded
systems.
Commit e375d82 ("kernel: Implement k_sleep for Single Thread")
eliminated the need to call k_busy_wait() on single threaded
systems in place of k_sleep.
Signed-off-by: Ricardo Rivera-Matos <rriveram@opensource.cirrus.com>
WiFi scan results were not updated with information about channel, after
scan results parsing was updated. Fix that.
Fixes: a6b06004c2 ("drivers: wifi: esp_at: handle commas in SSIDs during
scan and status")
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
There's no way this log level was intentional: this line is just the
title / prefix of a multi-line section with mostly LOG_INF statements.
Fixes commit 6423bc3bc8 ("drivers: dai: intel: ssp: Improve logging
output") which was very large hence error-prone.
Fixes SOF bug https://github.com/thesofproject/sof/issues/9026
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Since the minimum/maximum supported bitrates are now stored in the common
CAN controller driver configuration struct, retrieving these can no longer
fail.
Add new CAN controller API functions can_get_bitrate_min() and
can_get_bitrate_max() reflecting this and deprecate the existing
can_get_min_bitrate() and can_get_max_bitrate().
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Previously the logic was inverted for error_callback_en where 0 was
enablement and 1 was disable. This was likely done so that the default,
sensibly so, was to enable the error callback if possible. A variety of
in tree users had confused the enable/disable value.
Change the name of the flag to error_callback_dis where the default
remains 0 (do not disable the callback!) and correct in tree uses of the
flag where it seemed incorrect.
Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
Currently you have to manually type out the device name for each command.
This commit adds support for <device> entry tab completion and device
lookup if help is enabled.
Signed-off-by: Hans Binderup <habi@bang-olufsen.dk>
DisableDeepSleepIRQ() disables the NVIC irq, while PINT need it to fire an
event when the interrupt is used. So while the interrupt is not used in
DeepSleep mode, it should still be available to be used.
Signed-off-by: Hessel van der Molen <hvandermolen@dexels.com>
Fixes the issue of CAN failing to exit sleep mode
inside can_stm32_init() when a software reset is done.
For stm32 the CAN is first made to enter initialization
mode first and then made to exit the sleep mode.
Signed-off-by: Aditya Ganesh <adityaganesh2k@gmail.com>
The adc_ads1119 driver is unable to overwrite the configuration register,
the chip therefore always works with its default settings. Register access
macros are fixed by this commit.
Fixes: #70091
Signed-off-by: Jan Kubiznak <jan.kubiznak@deveritec.com>
CSS was deprecated from the mcu-sdk. Removing driver from lpc55s36
to clear build error.
This is a temporary patch to remove the build error.
Fixes#69961
Signed-off-by: David Leach <david.leach@nxp.com>
All connect() syscalls result in EISCONN error, since underlying
_sock_connect() is attempted to be called twice. Once from net_context.c'
bind_default() (with INADDR_ANY) as part of esp_bind() and second time as
part of esp_connect().
Do not call _sock_connect() from esp_bind(INADDR_ANY), which happens as
part of connect().
Fixes: dbf3d6e911 ("drivers: esp_at: implement bind() and recvfrom() for
UDP sockets")
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
zsock_poll_internal() iterates through all fds to call
ZFD_IOCTL_POLL_UPDATE on them. In cases when -EAGAIN is returned from one
of such syscalls (which happens for example for TLS sockets when in the
middle of a TLS handshake) whole fds array is iterated once again. This
means that ZFD_IOCTL_POLL_UPDATE can be called more than once for a single
preceding ZFD_IOCTL_POLL_PREPARE operation. This resulted in error in
nsos_adapt_poll_remove() call, which was not intended to be called twice.
In case ZFD_IOCTL_POLL_UPDATE is called second time, update 'revents' just
by calling poll() syscall on the host (Linux) side with 0 timeout.
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
From IMXRT1170RM.pdf, iomuxc_gpr->GPR17 is
used to configure FlexRAM bank 0~7.
iomuxc_gpr->GPR18 is used to configure
FlexRAM bank 8~15.
Set low 2 bytes to iomuxc_gpr->GPR17.
Set high 2 bytes to iomuxc_gpr->GPR18.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Make use of sensor_ug_to_ms2() and sensor_10udegrees_to_rad() APIs
to convert from raw values into proper units (i.e. m/s^2 for accel
and rad/s for gyro).
Signed-off-by: Armando Visconti <armando.visconti@st.com>
Apparently there was a typo in the last commit.
Looks like it was refactored without trying to build.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Use the most adapted instruction for the sector erase command
It can be 0x20 or ox21 or 0x21DE in octo - DTR mode.
The value is given by the SFDP table and filled in the erase_types
table the during the SFDP discovery process.
Signed-off-by: Francois Ramu <francois.ramu@st.com>
The commit adds dependency on Kconfig FLASH_PAGE_LAYOUT to subsystems
that really require it:
FCB, NVS, LittleFS
and removes direct selection from '*.conf' files where no longer
needed.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
If a clock control device is set in the `clocks` property,
it is used to determine the frequency.
If `fixed-clock` is set for the clocks, we use that value as is.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Introduce the `COMPAT_SPECIFIC_...` macros to determine the function name
from the compatible name.
These macros allow the isolation of device-dependent code in a generic way.
For example, if the compatible name is `ambiq,uart`,
The `COMPAT_SPECIFIC_DEFINE` macro is replaced by `AMBIQ_UART_DEFINE`.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Removing dependency on cyhal in airoc wifi driver.
It need to build airoc wifi driver with different than
PSoC 6 Soc like STM32
Signed-off-by: Nazar Palamar <nazar.palamar@infineon.com>
The nRF IEEE 802.15.4 driver might report a received Ack frame with
invalid timestamp, if the timestamp could not have been taken. The upper
layers are not prepared to handle such a case as they expect that for a
received frame, the timestamp is always present and valid.
This commit detects this situation and handles it gracefully by
reporting the transmission as failed as if no Ack was received.
Signed-off-by: Jędrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
Implement a sensor for the output diagnostics of the power train
switch TLE9104.
Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
When running the cdc_acm demo on a board with an external ULPI
phy, the device is unable to enumerate:
usb 1-1.8.3.1: new full-speed USB device number 51 using ehci-pci
usb 1-1.8.3.1: device descriptor read/64, error -32
usb 1-1.8.3.1: device descriptor read/64, error -32
the console shows:
[00:00:00.001,000] cdc_acm_echo: Wait for DTR
[00:00:00.007,000] usb_cdc_acm: Device suspended
[00:00:00.902,000] usb_cdc_acm: Device resumed
[00:00:00.902,000] usb_cdc_acm: from suspend
[00:00:25.526,000] usb_cdc_acm: Device suspended
By not disabling the ULPI clock in low power, the usb enumeration
is working and we can run the cdc_acm demo. While touching
this code, add some comments to clarify the macro nesting.
Signed-off-by: Axel Haslam <ahaslam@baylibre.com>
This commit enables pinctrl on i.MX8ULP. This includes:
1) Adding `pinctrl_soc.h` header file.
2) Adding DTS node for IOMUXC1, which is one of the
IPs responsible for managing the 8ULP pads.
3) Adding .dtsi with pin definitions. For now, only
the LPUART7 pads are added to this file because this
is going to be the only consummer for now.
4) Modifying the `pinctrl_imx.c` driver to work for 8ULP.
5) Enabling the `CONFIG_HAS_MCUX_IOMUXC`, which is a
dependency of `CONFIG_PINCTRL_IMX`.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Currently, when using the `pinctrl_imx.c` driver one has
to manually enable `CONFIG_PINCTRL_IMX` even if the pinctrl
node using the driver is enabled. This is redundant and prone
to error as one would expect the driver to be enabled when
the node is also enabled.
This commit fixes the issue by enabling `CONFIG_PINCTRL_IMX`
by default and adding a new dependency on the state of the
pinctrl node (i.e: node needs to be enabled for the configuration
to also be set to `y`).
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Add PWM instances found on nRF54H20 and nRF54L15 devices,
so that PWM driver can be utilized on these.
Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
The valid range of hdop (horizontal diffusion of precision) goes
from 0-100000, but because we are using a uint16_t, we truncate
anything above UINT16_MAX.
This fix changes the size of the hdop member to a uint32_t, which
allows us to capture valid (but admittedly very poor) readings.
Signed-off-by: Rob Newberry <rob@zenomoto.com>
Moves a Kconfig that appears everywhere in the wrong place so that
it is enclosed if if statment check, so it only shows for device
that have the driver enabled
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
- update the console configuration defines references
- add missing header file with flash capabilities
- replace all console wait-until-ready calls by single one
Signed-off-by: Marek Matej <marek.matej@espressif.com>
The LL_APBx_GRPn_ReleaseReset clears reset bit in RCC,
however this bit is reset by default. Code that set
this bit was removed in previous commit
0856e99155
Keepint the autonomous clocks for STM32U5 family.
Signed-off-by: Adam Berlinger <adam.berlinger@st.com>
Magic constants throughout the code made this difficult to reason about,
especially with two different units of measurement (bytes and words) at
play.
Signed-off-by: Armin Brauns <armin.brauns@embedded-solutions.at>
The RX FIFO size is in words, so needs to be subtracted from the total
memory size *after* it's divided by 4.
Fixes#70789.
Signed-off-by: Armin Brauns <armin.brauns@embedded-solutions.at>
Add driver for ST7796s display. This is a MIPI DBI display controller,
with a frame memory of 320x480x18 pixels. Support for 4 wire SPI mode is
implemented using the MIPI DBI API.
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
Warn about potential device tree errors for cases when driver's
client tries to configure a pin as GPIO but which is not
in GPIO mode.
Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
It is impossible to perform flash reads during a flash write. When the
data to write to flash lies in the flash itself, it is buffered in ram
before writing.
Signed-off-by: Lukas Gehreke <lk.gehreke@gmail.com>
Move providing of the first buffer in uart_rx_enable from that
function to the callback which is called from nrfx_uarte_rx_enable
context. By doing this nrfx_uarte_rx_buffer_set is called when
RX configuration flags are already known to the driver.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Provide support for reading events longer than 127 bytes in
ST SPI protocol v1 by splitting them into several SPI transactions.
Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
Introduce NXP LCDIC driver using MIPI DBI class. This peripheral
supports 8080 and SPI 3/4 wire mode, although only SPI 4 wire support is
currently implemented. The driver supports DMA and interrupt driven
transfers.
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
The soc_secure_* function are used by the non-secure application
to access hardware resources which are mapped as secure.
Using these functions for hardware resources mapped as non-secure
is missleading.
We have some soc_secure_* functions which read FICR values.
In nRF91 and nRF53 platforms this made sense since FICR
has hardware fixed mapping as secure.
For nRF54 though the FICR has hardware fixed mapping as non-secure.
This change refactors the soc_secure.h to exclude the functions
which read FICR values from being included when FICR is mapped as
non-secure.
Also updates the hwinfo and ieee802154 drivers to adjust to this change.
Signed-off-by: Georgios Vasilakis <georgios.vasilakis@nordicsemi.no>
Adds an option that allows for locking all interrupts when reading
the data from this sensor, this can be used alongside systems like
Bluetooth to vastly increase chances of getting a reading from the
sensor successfully, at the risk of losing Bluetooth packets.
Signed-off-by: Jamie McCrae <spam@helper3000.net>
User is able to enable packet capture for low level HDLC data
frames received from and sent to network. This data can sent to
remote system for analysis. The captured data is encapsulated
into Linux cooked mode SLL packets.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Improve code consistency and fix CONFIG_POSIX_API=n compatibility with use
of ZSOCK_* and DNS_* macros.
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
The initial version of an input driver for Cirque Pinnacle ASIC supports:
* Setting sensitivity
* Choosing between relative and absolute modes
* Relative mode
* Primary tap
* Swapping X and Y
* Absolute mode
* Setting number of idle packets
* Clipping coordinates outside of active range
* Scaling coordinates
* Inverting X and Y coordinates
Signed-off-by: Ilia Kharin <akscram@gmail.com>
To prevent postponing data flush until filling fifo. Now the flush will
occur at the scheduled time, regardless of subsequent poll_out reqs.
Signed-off-by: Luis Ubieda <luisf@croxel.com>
A few lines above this change explicitly enable the UART FIFO. Then this
line, goes and disables it. This seems to be from a workaround where the
parity and stop bits are not coming in correctly in the config. Fixing
that will be another patch. But, the FIFO should always be enabled. This
is visible when trying to use bit rates that are reasonably fast. Even in
IRQ mode, with a sufficient bit rate, bytes are readily dropped.
Tested on a Sparkfun Promicro rp2040 board.
Signed-off-by: David Brown <david.brown@linaro.org>
Automatically select CONFIG_GPIO when the GPIO-controlled CAN transceiver
driver is enabled. Update board configurations to benefit from this.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Cf Errata sheet, 2.2.4: With HSE active, switching the system clock source
from any other source to HSI, spuriously deactivates HSE.
Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
In case of chain loaded application with PLL set as the sysclk source,
directly exit the init function.
This also applies to exit from stop mode and was tested successfully.
Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
For now DSI settings are hard-coded for the specific
LCD module used on the STM32H747I Discovery board
Signed-off-by: Erik Andersson <erian747@gmail.com>
To support the NT35510 display, some additional
options needs to be configurable in the STM32
DSI peripheral
Signed-off-by: Erik Andersson <erian747@gmail.com>
The Low Power Flexcomm driver manages the interrupt handling
and provides an API to register interrupt callbacks.
Register the NXP LPI2C interrupt handler.
Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
Update the driver to account for variations in the SDK driver
when it uses the instance number instead of the base address.
Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
LPFlexcomm is a MFD device hence select this Kconfig whenever
it is enabled.
Remove the selection from the individual driver Kconfig files.
Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
On some boards, there is not dedicated reset pin for GT911, it might
be the same pin with display IC, or might be tighted to a high level
voltage.
This patch makes the rst_gpio can be empty.
Signed-off-by: Jason Yu <zejiang.yu@nxp.com>
Add support for performing pinctrl operations. For now,
the only supported operation is applying the pinctrl default
state. Pinctrl is left optional to allow for scenarios in which
this is not required (e.g: AMP system in which another
OS configures the pinctrl).
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Add a property to select the push-pull GPIO output type to drive the
I2C recovery. The default is open-drain.
Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
This patch add supports for performing clock-related operations
on i.MX8ULP. This consists of:
1) Adding a LUT.
2) Adding an initialization function meant to tell the
HAL which rate the XTALs on the boards (EVK and EVK9)
run at. This is used by the functions that compute the
rate of an IP clock.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
In the case of some SOCs simply using the PCC base and clock
offset to build the clock ID passed to the HAL is not sufficient
since the clock ID may also contain some flags (e.g: see the case of
i.MX8ULP). For such SOCs, we change the semantic of the value passed
from the DTS (which is simply called "name", thus allowing us to
interpret it differently from SOC to SOC) to an index in a LUT
used to fetch the clock ID that can be safely passed to the HAL.
For compatibility reasons, we also keep the old way and use it
for SOCs which don't define such a LUT. The driver will decide
which method to use based on the LUT size (i.e: if 0, use the
old way, if != 0 use the new way).
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Change, for audio DSP and M7 cores, SOC_<name> to match
the exact soc name.
Update the board files accordingly.
These configs are used in SOF and NXP_HAL, so change
sha for these modules.
Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Rename ad5592 files in dts, driver and include to ad559x and add support
for I2C bus which is required for AD5593.
Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
Run clang-format on qdec_stm32.c.
This moves '\' in macros to line index 100, which ensures '\' still
aligns if a macro is edited with a new line that is longer than the
previous longest line.
Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
Negative temperatures were converted to the sensor_value struct
incorrectly.
This fixes the causes: signed/unsigned mixups and integer overflows.
Also clarified temperature calculation using multiplier/divisor config
values.
Fixes#68240
Signed-off-by: Boris Mulder <b.mulder@innoseis.com>
Based on the iis2dlpc driver, with some significant differences in
interrupt handling.
Signed-off-by: Armin Brauns <armin.brauns@embedded-solutions.at>
Add the invocation of an interrupt config function
(config->irq_config_func). Absence of this call results in the DMA
driver not being able to service interrupts raised by the DMA
peripheral.
This case was observed on the i.MX RT685's HiFi 4 DSP domain, where DMA
was not functional because of this.
Signed-off-by: Vit Stanicek <vit.stanicek@nxp.com>
Enable Transmitter Delay Compensation whenever the data phase timing
parameters allow it.
Fixes: #70447
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Remove broken support for Transmitter Delay Compensation from the Bosch
M_CAN backend driver.
Even if this was enabled via Kconfig, the TDC bit in the DBTP register set
during driver initialization is overwritten in can_mcan_set_timing_data(),
turning TDC off.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
The VLAN packets are prepared in Ethernet L2 so no need to have
special handling in the driver.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The VLAN packets are prepared in Ethernet L2 so no need to have
special handling in the driver.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The VLAN packets are prepared in Ethernet L2 so no need to have
special handling in the driver.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The VLAN packets are prepared in Ethernet L2 so no need to have
special handling in the driver.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The VLAN packets are prepared in Ethernet L2 so no need to have
special handling in the driver.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The VLAN packets are prepared in Ethernet L2 so no need to have
special handling in the driver.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The VLAN packets are prepared in Ethernet L2 so no need to have
special handling in the driver.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The VLAN packets are prepared in Ethernet L2 so no need to have
special handling in the driver.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The VLAN packets are prepared in Ethernet L2 so no need to have
special handling in the driver.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Virtual LAN logic is now done in Ethernet L2 so no need to manipulate
VLAN packets in the driver.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Remove ethernet-fixed-link binding as it is redundant with the
phy bindings. Clearly, ethernet does not work without the L1
layer, which is a phy device, or an integrated mac/phy device,
and all of these things should be described properly in DT.
The schema did not even come with a compatible, meaning nodelabels
were hardcoded into the drivers, which is unacceptable.
- Remove the binding file for ethernet-fixed-link.yaml.
- Remove fixed link functionality from the nxp s32 gmac driver.
Since this functionality is already covered by the phy support,
it is redundant.
- Remove fixed link include from the s32 gmac binding.
- Remove fixed link include from the nuvoton numaker binding.
As far as I can tell the corresonding driver does not even
use it anyways, and I did not find any board with this device
that describes a "fixed link".
- Move the definition into the nxp,kinetis-ethernet binding
as the eth_mcux driver, which is already being deprecated,
does use this, contain the debt to the legacy driver.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Addresses an issue where attempts to transmit data fail.
The identified cause of this failure is the handling of the
`rx_irq_enable` and `tx_irq_enable` flags. The `else if` handling the
`tx_irq_enable` was replaced by an `if` so both flags can be true,
and both functions can be called. This fix was tested with the
`cellular_modem` example successfully.
Signed-off-by: Fabian Kainka <kainka@cognid.de>
Added configuration of long press reset functionality.
Includes ship/hibernate to wake debounce time and
disabled/one_button/two_button mode selection.
Signed-off-by: Andy Sinclair <andy.sinclair@nordicsemi.no>
Multicast rule as 01:00:00:00:00:00 is actually shadowing
broadcast rule, enabling broadcast packets to be received/forwarded
even if broadcast rule/filter is not set.
Set the multicast filter with an appropriate mask.
Signed-off-by: Angelo Dureghello <adureghello@baylibre.com>
The DHT20 sensor is a temperature and humidity sensor that uses I2C to
communicate with a microcontroller. The DHT20 sensor is Aosong.
use standard crc
update description to add reference to AHT20 and AM2301B
clean code, use defines and bit manipulation
add dht20 to i2c test suite for build tests
update bit manipulation
use more defines instead of raw numbers
add bindings to allow aht20 or am2301b to be used in devicetree
in all 3 cases, the same dht20.c driver is compiled
Signed-off-by: Nathan Olff <nathan@kickmaker.net>
The Low Power Flexcomm driver manages the interrupt handling
and provides an API to register interrupt callbacks.
Register the NXP LPSPI interrupt handler.
Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
Update the driver to account for variations in the SDK driver
when it uses the instance number instead of the base address.
Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
1. Update EDMA driver for version 4
2. The DMAMux module is not always present. Use the
feature define to make this optional.
3. Use the EDMA_SetChannelMux API for SoC's that supports
this feature.
Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
The ILimCntl name can be understood as both register name and its field
name. Therefore it is better to change macro name so it contains both
register and field name. Second field of this register will be also
utilized by this driver in the future and new code will be aligned to
this naming convention.
Signed-off-by: Lukasz Madej <l.madej@grinn-global.com>
Fix validation of `linear_range_get_index()` results.
The function can resturn both 0 or -ERANGE but -EINVAL is never
returned. Use comparison against 0 to make the validation robust.
Use valid maximum index for the linear range. The 0x0C is reserved
value and should not be used. Therefore replace it with 0x0B.
Signed-off-by: Lukasz Madej <l.madej@grinn-global.com>
`max20335_get_constant_charge_current()` and
`max20335_set_chgin_to_sys_current_limit()` functions has redundant input
values validation. Drop not important ones to make the code clean.
While on it remove `max20335_get_constant_charge_voltage()` function
since it become useless.
Signed-off-by: Lukasz Madej <l.madej@grinn-global.com>
Maximum charging current is selected with an external resistor in
the MAX20335 charger. Therefore it is not possible to configure it
with software directly. There is only a capability to limit current
set with hardware but configuration of the limiter is not
straight-forward.
To reflect real functionality, drop usage of
`constant-charge-current-max-microamp` property as an required one and
use custom `chgin-to-sys-current-limit-microamp` instead.
Use enum in binding file to signalize improper values at compile time.
Drop support for `CHARGER_PROP_CONSTANT_CHARGE_CURRENT_UA` API property
since this cannot be handled.
The `max20335_get_constant_charge_current()` function become useless so
remove it.
Signed-off-by: Lukasz Madej <l.madej@grinn-global.com>
Currently, the driver supports only VGA resolution while 480x272 is
needed to match with the display resolution on i.MX RT10XX family.
Also, the current framerate is very low, about 3-4 fps without doing
anything else with the image buffers (just discarding them).
Rework the driver to address the low framerate issue as well as to add
support for 480x272 and 1280x720 resolutions.
Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
Add missing fields to complete info struct to
chat script for Telit ME910G1. Also for test
suite modem bg95.
Signed-off-by: Jeff Welder <Jeff.Welder@ellenbytech.com>
Fix compiler errors and warnings that are issued when compiling this
driver for use without the optional interrupt facilities.
When interrupts are not enabled for any instance of this device,
there's currently a compiler error in gpio_xlnx_axi_pin_interrupt_configure
due to the function's header being located within the ifdef-block for
interrupt-driven operation.
Fully encapsulate the interrupt-related functions
gpio_xlnx_axi_pin_interrupt_configure, gpio_xlnx_axi_manage_callback
and gpio_xlnx_axi_get_pending_int with ifdefs checking for interrupt
mode inorder to remove compiler warnings caused by those functions
being always present so far, while not being used in the API function
pointer table when all instances of this GPIO controller are operating
in polling mode. This circumstance causes a "declared, but not used"
compiler warning for each of those functions.
Signed-off-by: Immo Birnbaum <mail@birnbaum.immo>
This config selects a variant of the HCI driver interface that spills
out host internals unto the drivers and even the Zephyr controller. It
will now be removed in favor of driver interfaces that hide the
internals of the host.
The new default is `CONFIG_BT_RECV_WORKQ_BT`.
Any references to the removed kconfig are refactored out.
Any out-of-tree driver using the removed interface can be easily adapted
by copying the following implementations into the driver as private
functions:
- `hci_driver.h:BT_HCI_EVT_FLAG_RECV_PRIO`
- `hci_driver.h:BT_HCI_EVT_FLAG_RECV`
- `hci_driver.h:bt_hci_evt_get_flags`
- `hci_raw.c:bt_recv_prio`
In combination these symbols function as a interface adapter. These
symbols will be removed in this PR in subsequent commits.
Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
Rework the data scaling algorithm for the "deadzone" mode so that the
deadzone is subtracted from the input rather than from the output. This
makes the whole output range usable rather than making the output jump
from the center value to the minimum deadzone range.
This changes the calibration data structure as well so now all values
refer to the input data, which is more coherent.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
This somehow worked without problems during the test runs, but we found a
corner case where this leads to an error.
Signed-off-by: Juliane Schulze <juliane.schulze@deveritec.com>
Add driver for Angst+Pfister O2 sensors FCX-MLD25 & FCX-MLD95 and maybe
more. Tested with FCX-MLD25.
Supports get O2 value, get status, and power management.
Note that in suspended power mode heating output is at 20 %, thus
probably not suited for a battery powered device.
Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
Since there is only one consumer of the data stored in the buffers,
it is enough to have one read index variable which can be stored in
the data associated with the module and not in the buffer space (where
there is a read index for each buffer).
Additionally, we can safely assume that module works with small buffers
so 127 byte limit is enough. Based on that assumption completed flag
can be stored on a single byte together with write index. After this
change, control data for each buffer takes 1 byte (3 bytes previously).
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
There was a wrong order of conditions checking. First indexes were
compared and then completed flag was checked. It was possible that
after checking first condition context is preempted and new data
is written to the buffer and completed flag is set. In that case
both conditions are met but data added in preemption is dropped.
In order to avoid that completed flag must be checked first.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Return availability of free buffers after data is consumed. This
information may be important for the module using uart_async_rx to
schedule next reception if there is a new buffer available.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Add buffer releasing to consuming function to allow better buffer
utilization since buffer is available earlier.
Note that releasing in claiming function is still needed as there
are cases when there are empty but completed buffers and those
need to be consumed in claiming phase.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Removing a field which was redundant. It was only incremented but
never read.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Use `pm_device_driver_init` to ensure that init is run correctly
regardless of the power state.
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
Byte value written to the device's
ERXFCON: ETHERNET RECEIVE FILTER CONTROL REGISTER
Sets the devices receive packet filter, optional. If not set
in device tree previous hard coded value`0xA3` is used.
Uni, multi and broadcast packets with valid CRC are accepted.
Signed-off-by: Dean Sellers <dsellers@evos.com.au>
MODEM_UBX: Adds Support for UBX Messages in Modem Subsystem.
GNSS API Supported: get_supported_systems, set_fix_rate, get_fix_rate,
set_enabled_systems, get_enabled_systems, set_navigation_mode,
get_navigation_mode.
Boards Tested: MIMXRT1062_FMURT6, VMU_RT1170.
Note: Partial support for U-BLOX Messages is provided as of now.
Signed-off-by: Sumit Batra <sumit.batra@nxp.com>
Signed-off-by: Mayank Mahajan <mayankmahajan.x@nxp.com>
The STTS22H is an ultralow-power, high-accuracy, digital temperature
sensor offering high performance over the entire operating temperature
range. This driver is based on stmemsc HAL i/f v2.3
https://www.st.com/resource/en/datasheet/stts22h.pdf
Signed-off-by: Armando Visconti <armando.visconti@st.com>
Error check was incorrect, causing wait for complete
not to be done. This can result in emit stop not
working on writes because controller won't do the
stop if it is still busy processing transmit.
Signed-off-by: Mike J. Chen <mjchen@google.com>
There has been missing line initializing the hold pin,
which caused SPI NOR device init to fail with -ENODEV,
if property defining such pin has been present in device
definition.
Fixes#70661
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
As correctly pointed during the initial PR Review, when the MTU-size is
23 the effective payload that can be transferred is MTU-3 = 20. Thus,
this change to be consistent.
Signed-off-by: Luis Ubieda <luisf@croxel.com>
arch_interface.h is for architecture and should not be
under sys/. So move it under include/zephyr/arch/.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Add ability to set a wakeup counter in case OS Timer is
disabled in certain low power modes. Also add code to
compensate the tick value.
Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
Make clock_control_on for STM32 behave the same as the HAL,
delaying after enabling peripheral clocks. Otherwise it may return
before the clock is actually enabled, causing subsequent writes to
peripheral registers to be silently ignored.
Signed-off-by: Kevin ORourke <kevin.orourke@ferroamp.se>
Optimize bit remapping in STM32 FDCAN driver by grouping consecutive bits.
Additionally, leverage shared bit mapping between MCAN_IR and MCAN_IE to
consolidate switch cases.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
This commit conditionally masks out `gpio_dw_isr` to prevent a build
warning if none of the instances of this driver are connected to an IRQ.
Signed-off-by: Chen Xingyu <hi@xingrz.me>
Switch to using `DT_*IRQN` helpers for obtaining the IRQ number instead of
directly accessing the `irq` cell. This change ensures that the encoded
values for multi-level interrupts are correctly retrieved.
Signed-off-by: Chen Xingyu <hi@xingrz.me>
Issue an upstream read transaction through uncached memory to flush
out all pending transactions before power down the host domain.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
So far only non-blocking accept() and recvfrom() were suported. This patch
implements blocking behavior, with the use of poll(fd, POLLIN) as helper
mechanism.
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
Use NSI_HW_EVENT() in order to periodically check for events in host
sockets. Whenever there is a socket event ready to be processed by Zephyr,
raise native_sim (newly introduced) CPU interrupt, so that Zephyr driver
can signal readiness with k_poll().
Maintain a list of Zephyr poll() executions in Zephyr context. Iterate
through them whenever there is some event to be processed.
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
Add driver for 'native_sim' target that implements offloaded socket
networking by the use of host networking stack and wrapped BSD sockets API.
This driver has following advantages over existing networking drivers for
emulated platforms that are already in tree:
* no TUN/TAP use means that no additional setup is required on the host
side:
* possible to use it within unpriviledged Docker containers, either for
development or in CI
* possibility to use and test offloaded sockets
(CONFIG_NET_SOCKETS_OFFLOAD=y) with emulated target, which allows
to increase tests coverage of this feature, without requirement of using
hardware
Native Simulator host libc has different error codes than embedded libc
used by Zephyr. Convert between those.
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
Enables usage Bluetooth LE GATT as a serial endpoint to exchange data
using UART APIs. This implementation is compatible with UART Interrupt
Driven APIs and uses the nus-uart device-tree node properties to
configure FIFO buffers for transmitting and receiving. Defining
multiple instances of the driver is possible and it allows implementing
multiple GATT NUS service instances to exchange data as separate serial
endpoints.
Signed-off-by: Luis Ubieda <luisf@croxel.com>
With the merge of zephyrproject-rtos/zephyr/pull/70254,
MCUX_CTIMER_CLK_OFFSET is no longer defined nor needed. Remove this from
the macro getting the clock subsystem in the ctimer PWM driver.
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
Most of the code is a port of FreeBSD's NVMe's driver, made by Jim
Harris (Intel).
Though all subsequent contributions that happened on this original
driver were made on files copyrighted by Intel, and under BSD-2 clause,
let's update the copyright header to point out Jim's original work and
major contributors were relevant.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
"RW pinctrl" is clearly SOC specific naming for an IP
that is not necessarily constrained to live on one SOC series.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Configures and initializes the EN GPIO to inactive prior
to calling the soft reset sequence during probe. The EN
pin may have been left asserted by the hardware on some systems.
Signed-off-by: Ricardo Rivera-Matos <rriveram@opensource.cirrus.com>
The number of interrupts received by the driver maybe less than
the number of data packets received by Ethernet,
so the driver should read the packets number
from the register REG_MACNP value.
Signed-off-by: Wafer Xie <wafer@jaguarmicro.com>
Configuration of GPIO as input now sets rising/falling
event orientation based on ACTIVE_HIGH/LOW setting.
Signed-off-by: Andy Sinclair <andy.sinclair@nordicsemi.no>
Modify the SPI Nor driver to be able to have multiple instances at
the same time.
This patch is heavily inspired by the at45 driver.
It was tested on the nRF5340 DK by using the external spi memory two times.
Macros were improved by de-nordic
Signed-off-by: Mehdi Zemzem <mehdi.zemzem2@gmail.com>
Updated revision for hal_ethos_u module, and adapted
ethosu_semaphore_take function prototype accordingly in order to align
with changes in the NPU driver
Signed-off-by: Ledion Daja <ledion.daja@arm.com>
Applying the modern way which is adding `default y` and
`depends on DT_HAS_...` to enable configs.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Removing `choice WS2812_STRIP_DRIVER` to enable the use of multiple
types of WS2812 drivers.
Also, `menuconfig WS2812_STRIP` will be deleted as it does not
correspond to the appropriate settings.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
uart flexcomm driver incorrectly used kStatus enum as mask when
checking for errors and enabling the error interrupts.
Signed-off-by: Johan Carlsson <johan.carlsson@teenage.engineering>
Enable support for setting and querying the FlexSPI clock rate to the
clock_control_mcux_syscon driver, as this is required by the
flash_flexspi_nor_driver
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
As we are replacing native_posix with native_sim, let's
use native_sim instead of native_posix as example platform.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Add a dummy IPSR flag to the RCar PFC driver. It is necessary
to ensure that the driver sets the 'peripheral' bit (the driver
resets this bit during the first call of 'pfc_rcar_set_gpsr') for
a pin that doesn't have a pin function defined in IPSR, but always
acts as a 'peripheral', for example, the MMC pins on the Spider
board.
Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
Split up the driver for the PWM controller MAX31790
into a multi function device driver.
Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
Move the pmw3610_spi_clk_on and pmw3610_spi_clk_off calls so that the
"on" call is before the first write. The datasheet calls for doing this
before any write operations, though some writes seems to work without
this in place, other seems to behave erroneously.
The non static functions do it on their own as they can be called
separately.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Align driver implementation to the watchdog driver API.
https://docs.zephyrproject.org/latest/hardware/peripherals/watchdog.html
int wdt_disable(const struct device *dev)
shall return:
0 – If successful.
-EFAULT – If watchdog instance is not enabled.
-EPERM – If watchdog can not be disabled directly by application code.
-errno – In case of any other failure.
Signed-off-by: Sebastian Głąb <sebastian.glab@nordicsemi.no>
Syscon clock driver previously used a sequence where clock IDs increased
sequentially. This had a few disadvantages:
- if a new SOC was introduced with more instances of a given IP, the
clock ID could not be sequential with the remaining IDs
- chance of collisions between clock IDs was relatively high
To resolve this, define LPC clock IDs using a bitmask macro. Note that
the CTIMER clock IDs are used within SOC clock files to perform clock
init, and the macro requires that the clock ID expand to an integer
rather than a expression with bitshifts (hence why the macro is not used
for these IDs)
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
When running SOF on Intel ADSP we choose to only serve the timer
interrupt on the primary core.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Some SAI instances are mutliline, meaning they can have multiple
TX/RX data lines (channels). Depending on the board, the index
of the TX/RX data lines that are connected to the consumer
(e.g: the codec) may not always be 0. This commit fixes this
issue by adding support for passing the index of the used
TX/RX data lines through the DTS.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
In the interrupt pending routine, only the interrupt status needs to be
cleared at the end of the interrupt routine. There is no need to do a
hardware reset(HALT) to avoid clearing the next transfer interrupt when
the current transfer is completed.
Test: Testing this function does not cause I2C data/clk to get stuck on
the system platform.
Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
Use the CAN clock and configuration ranges recommended by CAN in Automation
(CiA). Adjust the CAN shell test, which makes use of the fake CAN
controller driver, to match the new timing limits.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
For certain peripheral signal lines in nRF54H20, it is required
to set the clockpin bitfield for pins assigned to them, otherwise
the peripheral may not work properly, for example, there will be
no output from UART.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
RW61x DMA has the *unique* restriction that DMA access is not routed
through the FlexSPI cache engine, only via the non-cached address space.
To enable DMA to read from the FlexSPI AHB space directly, fixup any
address passed to the DMA engine that is in the FlexSPI AHB cached
region to be in the non cached region
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
Rework the driver to use HW MAC address filtering as an ethernet
capability.
Use a counter table for CRC indexes added/removed.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Firstly, build-asserting the execution/source memory sizes to be equal
wasn't working, due to the wrong (non-inst) DT API being used.
Secondly, this assert can be relaxed so that the source memory region
only needs to have greater than or equal size to the execution region,
as VPR firmware needs to fit into execution memory first and foremost.
This will come in handy, since MRAM partitions (typical source memory)
have stricter alignment requirements than RAM regions.
Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
Include soc.h in nxp MRT driver, so that CMSIS register definitions will
be available in this file
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
This commit enhances the accuracy of hardware cycle calculation before
setting the IT8xxx2 event timer. The next target cycle is calculated by
the last, elapsed, and expected timeout ticks. And then, the difference
in hardware cycles between the target cycle and the current cycle is set
into the event timer. This increased accuracy effectively resolves the
clock drift issue.
Tested with:
west build -p always -b it8xxx2_evb tests/kernel/timer/timer_api
-T kernel.timer.tickless
west build -p always -b it8xxx2_evb tests/kernel/timer/timer_behavior
-T kernel.timer.timer
Fixes#67474#67833
Signed-off-by: Ruibin Chang <Ruibin.Chang@ite.com.tw>
Signed-off-by: Ren Chen <Ren.Chen@ite.com.tw>
Default MAX_DATA_SIZE might be too small depending
on application (e.g. handling the scan result with 12 APs detected)
Added config option for MAX_DATA_SIZE and warning for the user
Signed-off-by: Samy Francelet <samy.francelet@ik.me>
Use SPI_LOCK_ON to lock configuration for multiple transaction while CS is
kept low.
Change control of CS line from direct GPIO manipulation to SPI driver API.
Signed-off-by: Michele Sardo <msmttchr@gmail.com>
Keep the SPI enabled when performing multiple transaction with
SPI_HOLD_ON_CS.
In such case, the end of transaction is marked by application calling
spi_release.
Signed-off-by: Michele Sardo <msmttchr@gmail.com>
Use the nrf_reset_network_force_off() function to release and set the
force-off signal.This ensures that the workaround for errata 161 is
applied.
Signed-off-by: Vidar Berg <vidar.berg@nordicsemi.no>
The expression (options & WDT_OPT_PAUSE_IN_SLEEP) is duplicated. Fix it
by replacing the second one with (options &WDT_OPT_PAUSE_HALTED_BY_DBG).
Signed-off-by: YunZe Li <yzli.cs@realtek.com>
It is found that when we use CONFIG_COUNTER and CONFIG_PM concurrently,
the RTC alarm callback can be used only once (in some cases, it just
won't work at all, e.g., using CONFIG_BT). By set the DBP bit on PWR
control register 1 via LL_PWR_EnableBkUpAccess function to temporarily
disable write protection every time we assign RTC alarm, we can register
alarm callback correctly. Tested on Nucleo WB55RG.
Fixes: #68673
Signed-off-by: Krisna Resi <krisna_resi@ymail.com>
Implement a sensor for the output diagnostics of the low side
switch BD8LB600FS.
Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
Split up the driver for the low side switch BD8LB600FS into a GPIO
and MFD part.
Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
Transition to a low power DMI L1 state should be allowed only after all
pending DMA channels transfers have started.
Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
Add support for XRGB32 pixel format as this is useful to test camera
and display drivers on i.MX RT11xx
Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
Change the suspend/resume code to ensure that the interrupt are disabled
before changing the pin configuration. The current sequence has been
reported to cause spurious readouts on some platforms, this takes the
existing code and duplicates for the suspend and resume case, but swaps
the interrupt disable and configure for the suspend case.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
This commit implements a network registration status API,
including return of reject cause in case of denial.
Signed-off-by: Emil Lindqvist <emil@lindq.gr>
A Bug in the watchdog driver code allows an unconfigured
WDT timer channel to be feed.
The first configured WDT timer channel has an id of zero.
At this point, data->m_allocated_channels is equal to one.
The condition of the if statement is invalid and allows
channel one to be feed.
Change the test condition from greater to greater-or-equal.
Add check if channel id is less than zero.
Signed-off-by: Sebastian Głąb <sebastian.glab@nordicsemi.no>
This commit fixes Kconfig.nxp_mailbox depends on is now
set to correct value DT_HAS_NXP_MBOX_MAILBOX_ENABLED.
Signed-off-by: Tomas Galbicka <tomas.galbicka@nxp.com>
The nrfx_qspi driver in nrfx 3.4.0 started checking conditions that
could trigger anomaly 159 on nRF5340 so make sure that QSPI transfers
are only performed with properly configured clocks (PCLK192M undivided
and HCLK128M divided by 2).
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
Fix up the BUILD_ASSERT so that it does not trigger if the resolution
cpi is not specified in the devicetree and left to the default value.
Also use the correct spelling for "cpi".
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
If I2C recovery mode uses GPIO push-pull to drive(3.3v), it will result
leakage in a pull-up voltage of 1.8V on the power rail, leading to
damage to 1.8V devices, including SoC, sensors.
Therefore, the recovery mode should be changed to GPIO open-drain type
to avoid this.
Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
Add support for devices that use the kinetis
GPIO/PORT scheme but with the slight modification
that the interrupt control bits are in the GPIO
peripheral instead of the PORT peripheral.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
The enum define is not implemented with the same name on all SoC's.
Use the register define instead.
Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
1. Add support to enable PORT control clocks
2. Add support for LP Flexcomm
3. MCX family has a different Clock API for USDHC.
Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
The Low Power Flexcomm driver manages the interrupt handling
and provides an API to register interrupt callbacks.
Register the NXP LPUART interrupt handler.
Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
1. This driver allows to configure the Low Power Flexcomm
interface as a UART, SPI or I2C device.
2. Manages the interrupts and dispatches it to the
appropriate device driver.
3. A Flexcomm interface can be configured to be used as
I2C and UART device. However a SPI device cannot be used
concurrently with I2C or UART. Add checks for this feature.
Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
Add connect match for dialing PPP connection.
Ensure PDP authentication is disabled.
Request manufacturer, firmware version, and IMSI from the modem.
Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
Support MCI_IO_MUX pinctrl in LPC GPIO driver
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Co-authored-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
See https://github.com/zephyrproject-rtos/zephyr/discussions/69997
The driver thinks that when there are zero touches, the screen is
pressed. This changes it so zero touches mean the screen is not
pressed.
Also, multi-touch is now considered a single touch, and the
TOUCH_ID is checked so that only valid touches are registered.
Signed-off-by: Glenn Andrews <glenn.andrews.42@gmail.com>
Split the common keyboard scanning code out of the XEC specific driver
and use the generic code instead.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Convert the XEC keyboard scanning driver from kscan to input, add the
corresponding kscan compatibility node to the current board, build test
only.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Add a blank define for the case where DMA channels are defined in ADC node
of the dts but STM32_ADC_DMA is not enabled. Otherwise compilation fails.
Also fix the way the DMA channel is configured by using a standard DT
macro, otherwise it doesn't work for dma-v2bis DMA types.
Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
Taking a spinlock will result in interrupts being blocked in the MIPI
DBI driver, which is not desired behavior while issuing SPI transfers,
since the driver may use interrupts to drive the transfer
Fixes#68815
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
For simulation, let's convert the hardcoded DT/real
HW address to the valid addr for simulation on the fly.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
The original calculation has two bugs. One is the calculated value, and the
other is that the value is not in one-millionth parts.
What the original calculation does is compute a scaled position value by
multiplying the raw sensor value (`dev_data->position`) by
`AS5600_FULL_ANGLE`, which represents a full rotation in degrees. It then
subtracts the product of the whole number of pulses (`val->val1`) and
`AS5600_PULSES_PER_REV` from this scaled position value.
((int32_t)dev_data->position * AS5600_FULL_ANGLE)
- (val->val1 * AS5600_PULSES_PER_REV);
What you actually need is to extract the fractional part of the value by
taking the modulo of AS5600_PULSES_PER_REV from the scaled value of the
position.
(((int32_t)dev_data->position * AS5600_FULL_ANGLE)
% AS5600_PULSES_PER_REV)
Then convert the value to one-millionth part.
* (AS5600_MILLION_UNIT / AS5600_PULSES_PER_REV);
Signed-off-by: Yasushi SHOJI <yashi@spacecubics.com>
Convert the internal uint16_t data of the driver to an internal type
that automatically switches from uint8_t to uint16_t depending on
whether any 16 bit device is present in the system or not. This shrinks
the internal structures by few bytes when the extra data is not needed.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Include into compilation the nrfx_gppi_dppi_ppib helper and related
interconnect layers when DPPIC nodes are enabled in DTS. Provide macro
definitions required by those interconnect layers based on information
from devicetree (the nrf_grtc_timer is only modified because a macro
that it uses became more generic).
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
ESP32 uart driver requires uart port number to its low level calls.
In case uart0 is disabled and uart1 is enabled, driver will set
default port num to 0 when it should be 1. This fixes this scenario
by retrieving uart pot number based on periphral address.
Fixes#69973
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Add a new CAN controller API function can_get_min_bitrate() for getting the
minimum supported bitrate of a CAN controller/transceiver combination.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Allow frontend drivers based on the SJA1000 backend to specify a minimum
supported bitrate.
The ESP32 TWAI supports bitrates from 25kbit/s to 1Mbit/s.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Add support for specifying the minimum bitrate supported by a CAN
controller in CAN_DT_DRIVER_CONFIG_GET() and
CAN_DT_DRIVER_CONFIG_INST_GET().
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Add new devicetree bindings for F4 and L1 series for configuration of
block size used in flash write operations.
Allow byte-size write operations in `flash_stm32f1x.c`. This file is
being shared between F0, F1, F3, L0 and L1 series. L0 and L1 series
allows for single byte writes.
Signed-off-by: Gustavo Silva <gustavograzs@gmail.com>
Move 'reset' member, which is const, from driver data to driver config.
This allows to reduce flash usage by few bytes.
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
The only difference is calling HAL_MMC_*() instead of HAL_SD_*() functions,
and removing the card detect logic.
Signed-off-by: Armin Brauns <armin.brauns@embedded-solutions.at>
Presently, this driver cannot handle multiple
DACs of the same type without throwing a
compile error due to a missing line ending.
This PR fixes that issue by adding the missing
line ending.
Signed-off-by: Kyle Kotowick <kotowick@invictonlabs.com>
Exclude devices based on ST SPI protocol v2 from special handling of
hci_reset opcode as it is redundant.
Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
Add raw mode in ST HCI SPI BT driver to support host-less configuration.
Remove compilation dependency for BT_QUIRK_NO_RESET as it applies to all
configurations.
Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
478530ec0aa1fe5f481786c25d50f7a081b22208 introduced a bug
where if the DT index while iterating its DT structure
initialization does not match the actual peripheral instance,
or if the device instance string is not just a simple integer,
but a more complex string like "00", or "02", either
the wrong peripheral address would be used, or the file
would failt to compile.
Let's fix this by reverting that change, and instead, for
simulation converting the hardcoded DT/real HW address
to the valid addr for simulation on the fly.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Add Nuvoton numaker series flash memory controller(RMC) with erase,
read & write features of soc-flash.
Signed-off-by: cyliang tw <cyliang@nuvoton.com>
Added the STM32G0X SOC series to the list of SOC that need to disable the
ADC while setting the oversampling bits to prevent writing over the
CKMODE bits.
Signed-off-by: Alexandre Poizat <apoizat@kalrayinc.com>
The ISR prototype is not matching the
signature for interrupt handlers, which results in
build warnings.
Let's fix it.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Fix issue related to "generic SPI" mode only, when a packet of
1512 bytes is received, net_pkt_write() fails and thrwos the error:
"Still some length to go 2".
This is due to net_pkt_rx_alloc_with_buffer() allocating a maximum
mtu/size of 1514, and driver is not removing 4 bytes of crc32 from
rx buffer, that comes to be 1516 (2 bytes over buffer limit).
Fix generic SPI rx frame size removing crc32 bytes.
Signed-off-by: Angelo Dureghello <adureghello@baylibre.com>
Add Open Alliance spi protocol support.
Open Alliance is a chunk-based SPI protocol, based on sending
over SPI an ethernet frame divided in smaller chunks, using a
specific 32-bit header for each chunk transferred. All chunks
can be sent or received by a single dma transfer.
Default mode is set to Open Alliance SPI without protection,
since the adin2111 dev. board comes shipped this way.
Tested:
- Open Alliance SPI, no protection (default board shipped)
- Open Alliance SPI, protection
- Generic SPI, no crc
- Generic SPI, with crc8
Signed-off-by: Angelo Dureghello <adureghello@baylibre.com>
After some debugging related to non-working "Generic SPI without CRC"
mode in eval_adin2111_ebz (CONFIG_ETH_ADIN2111_SPI_CFG0=n), noticed
that even after proper STATUS0 RESETC bit detection, registers,
for a certain period (some msecs) still reads as zero.
This patch fixes adin2111_await_device and with it the
"Generic SPI without CRC" mode.
Signed-off-by: Angelo Dureghello <adureghello@baylibre.com>
Enable appending of a crc32 at the end of the frame by the MAC,
always. This is always needed since the driver is not adding it.
This field has nothing to do with Generic SPI protocol-related
8-bit CRC, so this patch removes the CONFIG_ETH_ADIN2111_SPI_CFG0
choice related to this setting.
Testing without this flag set, packets are not forwareded in the
network, since the driver is not appending any crc32 header
to the frame.
Signed-off-by: Angelo Dureghello <adureghello@baylibre.com>
In the case that there are no more ISO buffers left,
"No available ISO buffers" is logged. However, given the
nature of ISO where we are (very) likely to get additional ISO
very soon after (typically every 7.5 or 10ms for audio),
this will get logged a lot, and the logging may in some
cases actually prevent the application from handling and
freeing existng buffers due to the immense logging,
which may make this (minor) issue into a blocking issue.
This is fixed by reducing the logging to the first
occurence, and then only every 100 afterwards, which has
shown to reduce the risk of this effectively blocking
the application.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Exhibit Renesas LCD controller's driver implementation. The driver
is intended to employ the controller in the continuous mode so
it can drive display panels in the parallel RGB mode.
Signed-off-by: Ioannis Karachalios <ioannis.karachalios.px@renesas.com>
HAL_OSPI_AutoPolling is checking is the status match
happened in a busy loop. That CPU intensive operation
can cause starvation of other tasks especially on flash
erase operations which can take seconds to complete.
So, replace the use of HAL_OSPI_AutoPolling with
HAL_OSPI_AutoPolling_IT. The match results
HAL_OSPI_StatusMatchCallback being called.
Signed-off-by: Miika Karanki <miika.karanki@vaisala.com>
Since a DMA cell now allows specifying a channel and a MUX value
there's no need to fetch these values from the HAL. This, in turn,
allows for more flexibility and reduces the coding effort for new
platforms that want to use the SAI driver.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Add support for status and online notification properties.
Fire these notifications from int_routine_handler work directly.
Such approach makes the code cleaner and does not affect overall
max20335 interrupt processing performance. However application code
processing these notifications cannot be blocking.
Signed-off-by: Lukasz Madej <l.madej@grinn-global.com>
An overflow compiler warning is generated when building for native_sim_64,
add an explicit cast to fix -Werror builds.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Allow not specifying the chat_filter parameter in a device
definition, which is equivalent to setting it to "".
Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
Building with GCC 9.4.0 gives the following warning/error:
error: closest_mv may be used uninitialized in this function
This commit fixes it.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Enabled the PIT and Multi channel support
for some of the rtXXXX devices.
- rt1010
- rt1060
- rt1160
- rt1170
Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
Updating the nxp,pit driver to support mutliple
channels. Updating the dts and board overlays
to account for the changes.
Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
Update all usages of the MBOX API to the latest API changes (to be
squashed for bisectability).
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
This patch refactors the MBOX API, so that it aligns with some common
Zephyr principles, main changes include:
- There is now a non-DT specific API that takes a regular struct device
and a channel identifier, instead of a struct that contains both. This
API should be used for cases where DT is not an option.
- There is a "dt-spec" variant of the API, meant to be used from
devicetree specifications.
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
The passed key does not have to be modifiable. Adapting the signature to
reflect this.
This allows the following commit to change cipher_ctx:🔑:bit_stream
to be pointing to an immutable key.
Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
Implement the set_format API so that applications can change format
at runtime instead of using the predefined one in the device tree.
Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
Add support for ARGB8888 pixel format as the camera pipeline on i.MX
RT11xx could output images in this format
Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
Add support for ARGB8888 pixel format as the camera pipeline on i.MX
RT11xx could output images in this format
Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
Extend support for automatic sample point location to also cover
can_calc_timing() and can_calc_timing_data().
Previously, automatic sample point location was only supported by
can_set_bitrate() and can_set_bitrate_data().
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Improve the internal CAN timing calculation code readability by unifying
variable and function naming, avoiding unnecessary casting, and rewording
comments.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
For sharing pin definition property with `worldsemi,ws2812-gpio`,
rename `output-pin` to `gpios`.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
ws2812-gpio's `in-gpios` property is not used as an input pin.
Renaming it to `gpios` to reflect the actual situation.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
By default N_VBUSEN signal is used by the host to define if VBUS
signal should be used for power supply (VBUS-IPSOUT).
This feature enables the possbibility to change this behaviour.
When N_VBUSEN detection is disabled, axp192 will automatically
decide to use VBUS (REG10H[7] = 1).
Please refer to datasheet for details.
Signed-off-by: Martin Kiepfer <mrmarteng@teleschirm.org>
AXP192 features an EXTEN pin that is on output only.
This commit appends control of EXTEN pin to gpio functionality
of AXP192.
Port-Mapping is as follows:
- [0..4]: GPIO0..4
- [5]: EXTEN
Signed-off-by: Martin Kiepfer <mrmarteng@teleschirm.org>
- The DSI_DPHY_PLL_VCO_MAX and DSI_DPHY_PLL_VCO_MIN macro value is
different when changing to different SoC, so the definition is moved
to soc level driver header.
- Remove the definition in this c file to fix the duplicate definition
issue.
Signed-off-by: Susan Su <susan.su@nxp.com>
Moved r8a77951/r8a77961 pfc tables and funcs from soc to drivers/pfc dir.
Move all Renesas pinctrl driver source and header files to a separate
directory "renesas" and every SoC series to a separate subdirectory.
Update the MAINTAINERS file to align with the changes in the
pinctrl directory.
Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
Move pfc_r8a779f0.c from the 'soc' directory to the 'drivers'
directory to avoid code duplication for the ARM64 Spider board.
Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
This adds the minimal get_time/set_time support for the rp2040 and
enables support by default on the Pico boards. This doesn't support
configuring the clock source or alarm interrupts yet.
Signed-off-by: Andrew Featherstone <andrew.featherstone@gmail.com>
RTC drivers should validate the `struct rtc_time`'s contents against the
provided `mask`. Promote this common code to a new rtc_utils file and
modify existing drivers to use this functionality. Extend the test
coverage to include verifying this behaviour.
This is groundwork ahead of adding support for the RP2040's (as used in
the Raspberry Pi Pico) RTC and alarm.
Signed-off-by: Andrew Featherstone <andrew.featherstone@gmail.com>
Charger hardware configuration registers are set to zero every time
external voltage is applied. Assure proper charger configuration by
buffering properties set by application and applying them at external
voltage connection event notified via interrupt.
Signed-off-by: Lukasz Madej <l.madej@grinn-global.com>
An anonymous enum describing charger status is used only by one
function therefore reduce scope of this enum.
Signed-off-by: Lukasz Madej <l.madej@grinn-global.com>
Utilization of chip interrupt line is mandatory to assure proper
charger state control. Handle interrupt to prepare the driver for
implementation of such functionality.
Modify charger status update so the current state is fetched in the
interrupt handler.
Use level based interrupts combined with interrupt disabling for a
period of time after interrupt handling to reduce number of interrupts
triggered by the charger. There may be a case where the charger
produces burst of interrupts for a several seconds and if the code
attempts to handle every single interrupt separatery then the system
might be significantly overloaded.
Co-authored-by: Bartosz Bilas <b.bilas@grinn-global.com>
Signed-off-by: Lukasz Madej <l.madej@grinn-global.com>
Rename `current_uv` argument name to `voltage_uv` in function
max20335_get_constant_charge_voltage() to make the name aligned with
its usage.
Signed-off-by: Lukasz Madej <l.madej@grinn-global.com>
Current driver handles charger status only but the charger chip
provides plenty of different statuses. Change name of
max20335_get_status() function to max20335_get_charger_status()
to make further implementations easier.
Signed-off-by: Lukasz Madej <l.madej@grinn-global.com>
Add a mailbox driver for VEVIF. The driver can be built in either
'local' or 'remote' configuration. This depends on the existence of the
'interrupts' property, which signals that the instance is managed
locally. VEVIF is, as expected, always managed by a VPR core.
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
Set driver to initialize at early POST_KERNEL, so that we make sure
other future dependencies priorities (eg VEVIF) do not conflict.
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
A seperate driver for NXP's LPI2C using RTIO and the I2C RTIO context
rather than semaphores, allowing for work to be done from any call
context at any time.
Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
Updates the sam twihs rtio driver to use a common i2c_rtio context
object and fixes a few logic issues currently in the driver in the
process.
Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
Implementing RTIO drivers, in theory, should be as simple as the normal
i2c drivers and generally be more consistent across implementations. To
do that some common code that calls driver specific code is needed much
like the venerable spi_context and its helpers.
This adds struct i2c_rtio as well as helpers to perform blocking i2c
transfers, i2c bus recovery, and similar such tasks.
Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
Rather than a depends on, which leaves it up to every single usage
of I2C_RTIO to then go and select RTIO, by selecting I2C_RTIO Kconfig
inherently selects RTIO now.
Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
In order to serialize all of the i2c functionality an added op code for
configuring the i2c controller was needed. Thankfully very simple.
Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
RAM allows for very fast reads and writes and lets us explore most of
the I2C controller APIs including RTIO. Theoretically supports any form
of i2c connected RAM but requires some tweaking to work with specific
parts potentially. Tested with Fujitsu's MB85 FeRAM part using an
arduino breakout.
Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
Added is_enabled devicetree property to fake regulator.
Allows testing of init behaviour when regulator is enabled
in hardware.
Signed-off-by: Andy Sinclair <andy.sinclair@nordicsemi.no>
Using the address of RDR/TDR for fifo base address computation
has the same effect as using the FSL_FEATURE_SAI_{TX/RX}_FIFO_BASEn
macro from NXP HAL. The only difference between the two is that
the macro is not defined for all SoCs so whenever we introduce
a new SoC that uses the SAI module we have to also introduce
the macro for said SoC. Using TDR/RDR has the advantage that
it doesn't require any additional changes to the NXP HAL.
Since we only support one data line per direction, it's fine
to just use RDR[0] and TDR[0] for the address computation.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Used RADIO_IRQ number is based on information provided by DT rather
than direct use of RADIO_IRQn.
Signed-off-by: Andrzej Kuroś <andrzej.kuros@nordicsemi.no>
Currently, the state transition function doesn't allow
the re-configuration of an already configured channel
(i.e: CHAN_CONFIGURED -> CHAN_CONFIGURED transition). This
causes problems when using `pulseaudio` and `SOF` because
the same channel ends up being configured multiple times
in the beginning due to how pulse seems to work. Logically
speaking, re-configuring an already configured channel is
not wrong so this commit solves the issue by allowing
the CHAN_CONFIGURED -> CHAN_CONFIGURED transition.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
On HAL RTD version 1.0.0, there is available Canexcel_Ip_DeactivateMD()
API that have similar capabilities as can_nxp_s32_abort_msg() API,
can use to instead.
Remove the reg grp_ctrl and reg base_dsc_ctrl that unused
after implementation this.
Signed-off-by: Cong Nguyen Huu <cong.nguyenhuu@nxp.com>
Add devicetree based settings for resolution, axis inversion and sleep
mode enable. Keep the resolution setting in its own function so it can
be called by the application again in runtime if needed.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
This was part of the mega hwmv2 commit. Looks like hpet drivers heavily
relies on soc.h. Reverting this for now while we look for a proper fix
and remove reliance on soc.h for drivers.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The active key mask can be used for supporting multiple keyboard layouts
with a single firmware. A possible use case is to support keyboard with
or without a numpad, in which case an entire set of columns may be
missing. Add a check to detect this condition and skip scanning that
column entirely if no keys are defined in it.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
The nRF91 series devices, when running the Serial LTE Modem (SLM)
application starting with nRF Connect SDK 2.6.0, can now be used as
standalone modems via the generic modem_cellular driver.
A configuration to run the cellular_modem sample on the nRF9160 DK
(plugged in to another nRF91 series device running SLM) is provided.
Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
Zephyr has a PWM-LED driver which makes calls to a PWM driver to control
the pin. The previous MCHP PWM-BBLED driver do not report its actual
PWM cycles, instead it reported the clock source it used: 32KHz or 48MHz.
This bug caused the LED-PWM driver set brightness to compute incorrect
parameters passed to the PWM-BBLED driver. The BBLED hardware has a
built-in divider of 256 therefore its maximum cycles are 128 and 48M/256
respectively. This change also simplified the calculations. A DT overlay
for the MEC172x EVB was added to the PWM-LED sample to demonstrate driver
operation. We found specifying >= 50 ms for the PWM period in the device
tree nodes provided a good operating range for the LED-PWM driver
parameter calculations.
Note: BBLED hardware implements an 8-bit PWM with a fixed divider of 256
and a 12-bit frequency pre-scaler. Duty cycle is represented by an 8-bit
value.
Signed-off-by: Manimaran A <manimaran.a@microchip.com>
Since all CAN controllers drivers seem to support automatic recovery (for
any future drivers for hardware without this hardware capability this can
easily be implemented in the driver), change the Zephyr CAN controller API
policy to:
- Always enable automatic bus recovery upon driver initialization,
regardless of Kconfig options. Since CAN controllers are initialized in
"stopped" state, no unwanted bus-off recovery will be started at this
point.
- Invert and rename the Kconfig CONFIG_CAN_AUTO_BUS_OFF_RECOVERY, which is
enabled by default, to CONFIG_CAN_MANUAL_RECOVERY_MODE, which is disabled
by default. Enabling CONFIG_CAN_MANUAL_RECOVERY_MODE=y enables support
for the can_recover() API function and a new manual recovery mode (see
next bullet). Keeping this guarded by Kconfig allows keeping the flash
footprint down for applications not using manual bus-off recovery.
- Introduce a new CAN controller operational mode
CAN_MODE_MANUAL_RECOVERY. Support for this is only enabled if
CONFIG_CAN_MANUAL_RECOVERY_MODE=y. Having this as a mode allows
applications to inquire whether the CAN controller supports manual
recovery mode via the can_get_capabilities() API function and either fail
or rely on automatic recovery - and it allows CAN controller drivers not
supporting manual recovery mode to fail early in can_set_mode() during
application startup instead of failing when can_recover() is called at a
later point in time.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
- Removed unused variables from the data struct
- Set all members of capability struct in `ssd1306_get_capabilities`
instead of zeroing it. This has the same effect but saves some bytes.
- Removed empty log
Signed-off-by: Greter Raffael <rgreter@baumer.com>
This allows to invert the display at runtime using the function
`ssd1306_set_pixel_format`. The current format is stored in the data
struct.
Also adjusted `ssd1306_get_capabilities` to return both supported
formats and the current one.
From the ssd1306 doc: 'In normal display a RAM data of 1 indicates an
"ON" pixel while in inverse display a RAM data of 0 indicates an "ON"
pixel.' Thus `PIXEL_FORMAT_MONO01 == SSD1306_SET_NORMAL_DISPLAY`.
Signed-off-by: Greter Raffael <rgreter@baumer.com>
Implemented link status detection using the W5500 built-in registers.
Added periodic link status polling, configurable via Kconfig.
Speeds up DHCPv4 from 9 seconds at best, to ~2 seconds after power-up.
Signed-off-by: Volodymyr Shymanskyy <vshymanskyi@gmail.com>
The adxl367_trigger.c file was missing a DT_COMPAT definition,
which resulted in the driver config structs being misaligned
between the driver source files. This is fixed here.
Signed-off-by: Maximilian Deubel <maximilian.deubel@nordicsemi.no>
By default, the sensor should be factory-programmed to operate
in Sleep Mode. A Measurement Request (MR) command is required
to exit the sensor from its sleep state. An MR command should
consist of the 7-bit address followed by an eighth bit set to
0 (write). However, many I2C controllers cannot generate merely
the address byte with no data. To overcome this limitation the
MR command should be followed by a dummy byte (zero value).
Signed-off-by: Ioannis Karachalios <ioannis.karachalios.px@renesas.com>
Clear the whole 192 bytes of bbram, before writing the magic value to it.
test pass "west twister -cviG -T tests/drivers/bbram/".
Fixes#69119
Signed-off-by: Ruibin Chang <Ruibin.Chang@ite.com.tw>
Add an initial input driver for the PixArt PAT9125EL, just core
functionalities for now, will add more configuration properties at a
later stage.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
The stream_start() callback needs to return 0 for success. However, to
indicate work has been successfully scheduled, k_work_schedule() could
return either 0 (already scheduled) or 1 (newly scheduled).
Due to this issue, the sw_generator could not start streaming. Fix it.
Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
The main improvement is that mcux_i3c_transfer() and
mcux_i3c_i2c_api_transfer() will try much harder to not return an error
that could be caused by the bus being busy. The bus could be busy because
of IBI handling, especially if there are multiple I3C devices all raising
IBI that need to be processed, which can involve a number of context
switches and delays and take considerable time such that an application
initiated I3C transfer request might have returned busy. Replaced the code
that polled for idle state with a timeout with an infinite loop on a
condvar. The condvar is broadcast to at the end of every stop, which should
be when the bus goes idle.
Details of other changes:
* Remove ibi_lock, which seemed not useful. Use the single lock (switched
from semaphore to mutex so it can be released by condvar) for both IBI
handling and application requests.
* Remove code that disables i3c controller interrupts during transfers.
Since the only interrupt is SLVSTART, and that just posts a work, it
didn't seem necessary to disable that interrupt.
* Don't clear SLVSTART interrupt in mcux_i3c_status_clear_all(), to prevent
any application transfers from accidentally clearing the SLVSTART
interrupt or the handling of one IBI clearing the START initiated by
another I3C device immeidately as the other one finishes.
The only clearing of SLVSTART is in the isr.
* Add back a wait in mcux_i3c_request_auto_ibi(), otherwise the ibitype
could be 0 if the processor is faster than the auto ibi handling.
An earlier change removed a wait for MCTRLDONE, which isn't
always set when AUTO_IBI is requested, but that could mean we try to
read the ibitype before it's ready. Waiting for IBIWON instead should be
correct and better, since the AUTO_IBI should result in IBIWON status bit
being set (and MCTRLDONE being set would not guarantee that IBIWON was
set).
* Change mcux_i3c_request_emit_stop() to still wait for idle if requested,
even if the STOP wasn't actually issued, and add the release of the new
condvar
* Change mcux_i3c_do_one_xfer_read() to handle the IBI use case differently
than the regular application requested transfer case. In the application
requested transfer case, the rx_len is known and set in RDTERM, so we
could check for the COMPLETE status bit, but for IBI transfers, we
just do a read to the payload buffer without knowing how many bytes
the target may send us so never get a COMPLETE. Rather than check for a
COMPLETE bit that might never occur, just have both cases read until we
either read all requested bytes or we get a timeout error. But for the
timeout error, if it's IBI and non-zero bytes were received, return
the bytes received instead of an error.
* Change mcux_i3c_do_one_xfer() to return the error returned by
mcux_i3c_do_one_xfer_read/write().
* Remove spurious return -EIO from end of mcux_i3c_do_daa()
* Change mcux_i3c_ibi_enable() to restore SLVSTART on error, and
add some LOG_ERR() messages for error cases. Also add check to
make sure idx is valid since there is a limit to how many IBI
this controller can support.
* Change mcux_i3c_ibi_disable() to always reenable SLVSTART interrupt,
even if the CCC to tell the target to disable IBI events fails.
* Change mcux_i3c_isr() to reenable SLVSTART interrupt if the
work_enqueue() fails.
Signed-off-by: Mike J. Chen <mjchen@google.com>
A payload size of 0xFF is valid and should not be a reason to keep
looping for more headers. The complete reqiurement is now:
```
header_slave[STATUS_HEADER_READY] == READY_NOW &&
header_slave[STATUS_HEADER_TOREAD] > 0
```
This fixes events being dropped when the payload size is 255.
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
SSIDs can contains commas (,) when receiving scan results (+CWLAP) or
status (+CWJAP) over AT command from ESP-AT chip. This is in conflict with
modem subsystem argument parsing, which separates arguments automatically
whenever comma is encountered.
Use a direct modem command parsing, so that commas within quoted strings
are taken into account to be part of that string, instead of being treated
as delimiter.
This solves `wifi scan` and `wifi status` Zephyr shell commands output, for
networks containing commas (like "My_2,4GHz_AP") as part of SSID.
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
According to [1], SSID and PSK need to be escaped:
Escape character syntax is needed if SSID or password contains any
special characters, such as , or " or \
Implement character escaping to fix connection attempt to WiFi APs
containing special characters as part of SSID, like "My_2,4GHz_AP".
Increase "connect command" buffer length to handle worst-case scenario of
all the SSID and PSK characters being special characters.
[1] https://docs.espressif.com/projects/esp-at/en/release-v2.4.0.0/esp32/AT_Command_Set/Wi-Fi_AT_Commands.html#id6
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
Opcodes for erase is taken from jedec basic flash parameter table
These expects 3 byte addresses.
When running with 4 byte addresses, opcodes to be used shall be taken
from JEDEC 4-byte Address Instruction Parameter table
Signed-off-by: Brian Juel Folkmann <bju@trackunit.com>
Adds support for the CP9314 switched capacitor converter. The
CP9314 is a multi-level DC/DC converter capable of operating in
2:1 and 3:1 modes.
Signed-off-by: Ricardo Rivera-Matos <rriveram@opensource.cirrus.com>
Emulate SERIAL_SUPPORT_INTERRUPT for UART_NATIVE_TTY, using a thread that
polls the tty and invokes the callback.
This allows interrupt-driven subsystems such as modbus to use a native tty,
which is useful for testing purposes.
Signed-off-by: Björn Stenberg <bjorn@haxx.se>
When CONFIG_XIP=y, execution address may come from a partition, so its
absolute address is needed. Fix code by using VPR_ADDR() macro in all
cases: execution and source addresses.
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
uart_stm32_async_rx_buf_rsp() does not return the necessary errors when
rx_next_buffer is already set & when async uart rx is disabled.
This patch was submitted by @mkaranki
Signed-off-by: Abderrahmane Jarmouni <abderrahmane.jarmouni-ext@st.com>
The finish interrupt after the previous transaction is completed may
occur in the next transaction. To do hardware reset at this time could
potentially lead to the failure of the transaction.
Therefore, removing the hardware reset upon completing the transaction
helps to avoid a race condition.
Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
Signed-off-by: Dino Li <Dino.Li@ite.com.tw>
Drop a bunch of display functions that only return "not supported", the
display API already handles these by checking for NULL API function
pointer.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
The start and stop of the DMA channel provides useful information in
default logs and they are not too frequent to cause bandwidth issues.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
The LOG_* macros already print the module name and the function, printting
again the __func__ have no additional benefit.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
The LOG_* macros already print the module name and the function, printting
again the __func__ have no additional benefit.
The debug prints lack context which can be used to identify the channel
which the message was printed for.
For example:
<inf> dma_dw_common: dw_dma_stop: dw_dma_stop: dma 0 channel drain time out
when multiple channels from multiple controllers are used we don't know
the exact channel that has been stopped:
<inf> dma_dw_common: dw_dma_stop: dma@7c000: channel 0 drain time out
<inf> dma_dw_common: dw_dma_stop: dma@7d000: channel 0 drain time out
Convert all LOG prints to add usable context to them and use the following
pattern wherever it is possible:
dma_dw_common: <function name>: <DMA device name>: message
for example:
<inf> dma_dw_common: dw_dma_stop: dma@7c000: channel 0 config
The parameter list of dw_dma_avail_data_size() and dw_dma_free_data_size()
extended to pass the dev pointer.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
IPM drivers are commonly used to send notifications/cause interrupts
without any transfer of data. To add this use case in the ESP32 IPM
driver, the guard statement is appended so that the pointer to the
data buffer is allowed to be zero only if the size of the data to be
transferred is zero. If size is given as 0 and data is equal to NULL,
we are thus only using the IPM as a doorbell, not to transfer data.
Signed-off-by: Celina Sophie Kalus <hello@celinakalus.de>
This commit introduces a driver for ADC keys, a common circuit design where
keys are connected to an ADC input via a resistor ladder.
Signed-off-by: Chen Xingyu <hi@xingrz.me>
Adds use of CHARGER_PROP_DISCHARGE_CURRENT_NOTIFICATION and
CHARGER_PROP_SYSTEM_VOLTAGE_NOTIFICATION_UV to the charger
sample application.
Signed-off-by: Ricardo Rivera-Matos <rriveram@opensource.cirrus.com>
Implement bind() and recvfrom() for UDP sockets. This is achived by
setting remote field in net_pkt which in return makes recvfrom() fill
in *src_addr. This is only implemented for passiv mode and CIPDINFO needs
to be enabled. Also set net_if to non-dormant when enabling AP mode to
make binding to a port and address possible.
Signed-off-by: John Johnson <john.filip.johnson@gmail.com>
The sys_mm_drv_unmap_page function first replaced the tlb entry with
the default one and then read the physical address that was mapped.
However, it was already overwritten, so it always release the default
physical address instead of the truly mapped one.
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
Added sys_mm_drv_update_page_flags function that allows to change access
flags to a already mapped memory region.
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
Compare value and DAC resolution in `dac_write_value` and return -EINVAL
if the value is above supported resolution.
Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
This patch handles multiple interrupt lines for errors. Each of the
4 DW SPI error interrupts (txo_err, rxo_err, rxu_err, mst_err) can
use a different line of the GIC, instead of using a single line of
the GIC for all error interrupts (err_int).
Signed-off-by: Julien Panis <jpanis@baylibre.com>
This patch manages DW SPI driver MMIO region. As a result, the driver now
runs properly on 64 bit platforms.
Signed-off-by: Julien Panis <jpanis@baylibre.com>
When CONFIG_SYSTEM_SLOPPY_IDLE is not set, then system
can sleep for -1 means waking Up at the max possible
counter value (INT_MAX)
When CONFIG_SYSTEM_SLOPPY_IDLE is set sleeping K_TICKS_FOREVER
means never wakingUp
Signed-off-by: Francois Ramu <francois.ramu@st.com>
Provide multiple write transaction support for BlueNRG-MS, st_hci_spi_v1
protocol. Since by default, BlueNRG-MS write buffer supports up to 127
bytes; however, it is possible to have consecutive write transactions
so as to send data more than 127 bytes.
Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
Added IS_ALIGNED macro to check if a pointer is aligned to
a given alignment. Additionally, removed a macro with a
conflicting name in drivers/crypto_intel.
Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
Adds conditional usage of locking mechanisms to allow building
without multithreading.
Signed-off-by: Mateusz Michalek <mateusz.michalek@nordicsemi.no>
Now RRAMC is set to use up to 512 B burst writes by default as most
time effective.
Requested slot time was changed to 8000 us for that case, as this is
required in order to hold the longest write operation.
Drivers differs slot duration depending on configured RRAMC buffers count
(CONFIG_NRF_RRAM_WRITE_BUFFER_SIZE).
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
When radio-synchronization was on
(CONFIG_SOC_FLASH_NRF_RADIO_SYNC_NONE=n) context of writing was shifted
by 4 instead of write-length (this caused redundant, self-shortening
writes to the same block.)
write-len was unset when requested write len was less than
RRAM_MAX_WRITE_BUFFER.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Signed-off-by: Jakub Zymelka <jakub.zymelka@nordicsemi.no>
Added synchronization with BLE radio operation to the RRAM flash
driver. The implementation is using framework which is already
provided for nrf52's flash driver.
Additional added resource locking mechanism while driver does writing
which solves mutual exclusion write access problem.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Signed-off-by: Jakub Zymelka <jakub.zymelka@nordicsemi.no>
Added a simple driver for RRAM. It is implemented as a flash driver,
because the "RRAM eFlash" macro obeys flash-like constraints.
Although users are not required to erase before write.
Signed-off-by: Jakub Zymelka <jakub.zymelka@nordicsemi.no>
Add driver for ScioSense ENS160 multi-gas sensor. The driver includes
support for I2C and SPI, attributes for setting temperature and
humidity compensation and data ready trigger.
Also add ScioSense to the list of vendor prefixes.
Signed-off-by: Gustavo Silva <gustavograzs@gmail.com>
Process the GPIO_INT_WAKEUP flag and set appropraite bits
in the SoC to wakeup the system from deep sleep mode.
Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
The network tests at tests/net use simulated network interfaces
and set CONFIG_NET_TEST to indicate that. If the config option
is set, then we do not want any extra Ethernet driver to
complicate the testing scenario so all external Ethernet
network interfaces should be disabled.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Cast val1 from sensor_value before multiplication in order to avoid
integer overflow, as indicated by Coverity CID 347136.
Signed-off-by: Renato Soma <renatoys08@gmail.com>
PR #64399 introduced checks for out-of-bounds filter IDs
in CAN drivers, along with logging of said IDs; however,
the call to LOG_ERR in the native POSIX/Linux driver is
missing the 'filter_id' argument.
This commit adds the missing argument to ensure proper
data is printed when the LOG_ERR call is performed.
Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
The pin in the loop start counting from 0, so the condition of the
for loop should not be equal to num_pins.
Fixes#69118
Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
Clearing virtual wire interrupt after calling handler may cause next
interrupt miss if the same virtual wire changes due to action in handler.
As the interrupt source is read from register, it can be cleared before
calling handler to avoid next interrupt miss due to action/delay in the
callback handler.
Signed-off-by: Venkataramana Kotakonda <venkataramana.kotakonda@intel.com>
Use K_KERNEL_STACK_SIZEOF() for calculating thread stack size, as this
takes K_KERNEL_STACK_RESERVED into account.
Fixes: #69129
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Use K_KERNEL_STACK_SIZEOF() for calculating thread stack size, as this
takes K_KERNEL_STACK_RESERVED into account.
Fixes: #69133
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Use K_KERNEL_STACK_SIZEOF() for calculating thread stack size, as this
takes K_KERNEL_STACK_RESERVED into account.
Fixes: #69132
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Use K_KERNEL_STACK_SIZEOF() for calculating thread stack size, as this
takes K_KERNEL_STACK_RESERVED into account.
Fixes: #69131
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Use K_KERNEL_STACK_SIZEOF() for calculating thread stack size, as this
takes K_KERNEL_STACK_RESERVED into account.
Fixes: #69130
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Fix missing check of the return value of `bq25180_set_charge_current`
function, resulting in logically dead code, as indicated by Coverity
CID 347197.
Signed-off-by: Gustavo Silva <gustavograzs@gmail.com>
- Fix using custom setup function
- Enable pRegOverrideTxStd and pRegOverrideTx20 in
ieee802154_cc13xx_subg_radio_div_setup struct
Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>
The driver seems to be designed to use the very last byte of the
buffer(scan, connect), so null terminating the status query
might have unintended consequences.
However we should not use strlen to determine the ssid_len,
to avoid depending on the following buffer(bssid) to be zeroed.
Related to CID 316354
Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
Clearing virtual wire interrupt after calling callback may cause
interrupt miss if the same virtual wire changes due to action
in handler.
e.g. HOST_RST_WRN pulse within 50 us
Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
device power management is not yet supported with eth_mcux
except on the kinetis series, but this should not break
the build for other platforms when PM_DEVICE is set
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
A division by 0 has once been observed inside
intel_adsp_hda_dma_host_reload(). It is apparently caused by a
preceding logic or hardware error, but in any case values, read from
the hardware should be checked for 0 before being used as a divisor.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Due to a typo it is not possible to select the sub-clock oscillator
(SOSC) as a clock source for an RA Microcontroller. This patch resolves
the issue.
Signed-off-by: Ian Morris <ian.d.morris@outlook.com>
Fix handling bus-off events in the Bosch M_CAN driver backend:
- Cancel all pending TX buffers when entering bus-off state
- Call all pending TX buffer callbacks with -ENETUNREACH when entering
bus-off
- Automatically initiate bus-off recovery if
CONFIG_CAN_AUTO_BUS_OFF_RECOVERY=y
Fixes: #68953
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
If the IPv6 DNS address is not a valid address, DNS will fallback
to the IPv4 DNS address.
Fix copying the IPv4 address to the IPv6 address by using
the IPv6 address destination length.
Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
The lower bits of the brightness control registers were erroneously
shifted even though FIELD_PREP already does the shifting. In practice,
the effect is negliglible but of course should be fixed.
Also add missing parenthesis around shifting operations to satisy static
analysis.
Signed-off-by: Mikkel Jakobsen <mikkel.aunsbjerg@escolifesciences.com>
Replace slave_register with target_register and slave_unregister
with target_unregister.
Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
Driver BBRAM for STM32 had a compilation error: "unknown type name
'RTC_TypeDef'" due to missing include file.
Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
The conversion of the raw sensor value overflows because
only a 32 bit multiplication is executed.
Fix the issue by promoting the raw sensor value to uint64_t before
executing the multiplication.
Analysis:
The current implementation overflows for all raw values grater
than 9544(14-bit).
But according to the datasheet the sensor has a maximum resolution of
20-bit. So Multiplying that value with 450.000 would need at least 39
bit to avoid an overflow, hence do it using 64-bit arithmetic.
Fixes CID 330657
Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
data->rtc_base is not being used anywhere while data->rtc_registers is
only used as a temporary variable. Remove them from the driver.
Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
UART_RX_RDY event can be generated from UARTE interrupt or k_timer
handler. When ENDRX event occurs then k_timer is stopped (it can
be restarted if there is another buffer provided). However, if UARTE
interrupt priority is higher than k_timer priority (RTC is used
underneath) then k_timer handler may still be executed later.
K_timer notifies new bytes based on RXDRDY HW event which is
counter by the TIMER (using PPI). It may happen that RXDRDY
event arrives due to byte received into RX FIFO but since there is
not buffer provided it stays in that FIFO. Given all this, it
was possible that RX_RDY event was reported from ENDRX UARTE event,
timer was stopped but because UARTE interrupt had higher priority
timer handler is executed after UARTE interrupt is handled. In
timer handler TIMER counter reports more bytes and calls
UART_RX_RDY event with null buffer and non-zero amount of bytes.
Fixed by generating UART_RX_RDY event only if RX buffer is not
null.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
No need to check if an uint8_t is greater or equal 0 in
lp50xx_set_brightness.
Fixes CID 322654
Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
The reference document says that the formula for negative
temperatures has two minus signs missing.
fixes#68710
Signed-off-by: Tobias Röhmel <tobias.roehmel@rwth-aachen.de>
The point of this commit is to allow users to request specific
channels. The following code snippet shows how this may now be
achieved:
int requested_channel = 5;
int ret = dma_request_channel(dev, &requested_channel);
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
After #63289, multi-level interrupts are now encoded using
macro magic. This means that using the generic DT_INST_IRQ_BY_IDX()
to fetch the INTID is no longer an option as the queried INTID
will be the one specified through the node's `interrupts`
properties. To fix this, switch to using DT_INST_IRQN_BY_IDX()
which will return the correctly encoded INTID.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Currently, the number of channels supported by the controlled
is computed based on the size of the channel array. This
works well only if there's no gaps (i.e: "dma-channels" property
is used or "valid-channels" property is used with contiguous
channels) but will break if there are any gaps. For instance,
if the user wants to use channels 16 and 17 and specifies them
through the "valid-channels" property, they won't be allowed
to do so because dma_request_channels() will stop at channel 1.
As such, to fix this, simply use the number of channels from
the HAL configuration which is the maximum number of channels.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Change reset pin polarity for MIPI DBI SPI controller, so that the board
devicetree is responsible for setting the GPIO to active low, and the
driver always sets the pin to a logic 1 to reset the display.
Fixes#68562
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
If the channel suspend with draining fails on stop because of reasons
outside of the scope of the DMA driver (the peripheral is powered off
before trying to drain for example) we must continue and disable the
channel.
The channel can be released by the client despite of it remained enabled.
A new DMA channel request can pick the channel (as it is released) but
re-configuration is going to be skipped and the use of the channel is going
to fail. Then we will see the same drain timeout on channel stop again
since the channel retained the configuration which resulted the first
timeout.
The drain timeout was made fatal by an earlier commit which fixed the
WAIT_FOR return value handling.
Fixes: 6226f9e6e4 ("dma: dw: fix the return value check")
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
The driver masked the return value of a pin read operation before
checking the error.
Thus not detecting a potential error and leading to logically
dead code, which was detected by coverity in CID 340853.
Anther instance XORs 1 before returning, resulting in an unexpected
return value;
Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
The res param in offload_freeaddrinfo is not used.
Mark it as unused, to avoid static analysis complaining about
Parse warning (PW.PARAM_SET_BUT_NOT_USED)
Fixes CID 316235
Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
uart_emul_fifo_read() didn't regard the size arg, hence if the RX ring
buffer contained more data than the size of the input rx_data buffer
size, this could result in buffer overflow. This becomes more obvious
when configuring device tree property latch-buffer-size > 1.
Signed-off-by: Andreas Anderberg <andreas.anderberg@u-blox.com>
This reverts commit 780b12854c.
"drivers: ieee802154: nrf: cache radio channel"
Implementation affected RCP devices in openthread as MAC layer
does not call `Receive()` functions after transmit is done.
Additionally, after sending a frame to a new channel (for example
while discovery operation), radio switches to RX state immediately
after TX, but continues to listen on old channel for about 5ms,
until MAC layer calls `Receive` operation, forcing to change the
channel.
Signed-off-by: Maciej Baczmanski <maciej.baczmanski@nordicsemi.no>
This CL updates the event data returned by espi_reset.
Return 0 for eSPI bus in reset, and 1 for eSPI bus out-of-reset.
Signed-off-by: Tom Chang <CHChang19@nuvoton.com>
First, the API ops are available only if
CONFIG_UART_USE_RUNTIME_CONFIGURE=y, but the driver was not guarding the
code. Also, according to the API specs, these functions are optional,
and the interface already returns -ENOSYS if they are not implemented.
To solve both problems, just drop the dummy implementation.
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
Systematically enable the UART clock again when exiting a low power mode
before reading the UART register.
Even though the previous code worked on STM32WBA, for most series, it is
necessary to enable the clock to access the registers, otherwise they read
as 0.
Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
info level is printed always to console and it's noisy.
Change to debug level, which can be enabled with
CONFIG_MODEM_MODULES_LOG_LEVEL_DBG
Signed-off-by: Parthiban Nallathambi <parthiban@linumiz.com>
Whenever UART_RX_DISABLED event is received module attempts to
re-enable receiver since in interrupt driven API receiver is
always on. However, it is possible that there is no free buffers
and in that case attempt to enable the receiver will fail with
-EBUSY. That scenario shall be accepted since the receiver will
be re-enabled when at least one buffer will be freed.
Given that, -EBUSY return shall be accepted (no assert) and
number of pending RX buffer requests shall be reset only on
successful enabling.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
return value of pwm_rpi_get_clkdiv contains implicit conversions
from 'float' to 'double', triggered by floating-point operations
involving mixed data types.
Signed-off-by: Jannis Ruellmann <j.ruellmann@kunbus.com>
Commit b2eaa6448076 ("drivers: dma: intel-adsp-hda: add delay to stop
host dma") added a wait on GBUSY state to host DMA stop.
This is problematic as in some case (like SOF chain-DMA usage),
the host DMA side RUN bit is not cleared when intel_adsp_hda_dma_stop()
is called. It is not possible to wait on GBUSY bit as there are
valid cases where it can remain set.
Address the original problem described in SOF bug #8686 and add a
polling check for intel_adsp_hda_is_enabled(). As per the bug
description, in some cases the GEN/FIFORDY bits are not cleared
immediately and if a new call to intel_adsp_hda_dma_stop() is made, the
PM refcounting will go haywire.
Link: https://github.com/thesofproject/sof/issues/8686
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
The CST816S chip ID have an alternative value. It seems that this
field represents in fact a version number of controller. Fix by adding
the new chip ID.
Signed-off-by: Joel Guittet <joelguittet@gmail.com>
Fix coverity integer handling issue (CWE-188).
Modifying a variable through a pointer of an incompatible type (other
than unsigned char) can lead to unpredictable results.
Fix: #67965
Coverity-CID: 248434
Signed-off-by: Armando Visconti <armando.visconti@st.com>
Using the 8 base clock cycles per bit period setting (instead of 16)
reduces the uart baud rate error when using a 12MHz crystal (found on
many RA Microcontroller development kits boards). This setting also
slightly reduces the error when using the internal 48MHz oscillator,
used by the Arduino UNO R4 Minima board currently support by Zephyr.
Signed-off-by: Ian Morris <ian.d.morris@outlook.com>
With the device_sync_sem semaphore, there is the possibility of
the code not returning to give it back
(mcux_flexcomm_master_transfer_callback is never called),
causing it to get stuck in k_sem_take(&data->device_sync_sem, K_FOREVER)
in subsequent calls.
The i2c driver recovers by other means
(enabling FSL_FEATURE_I2C_TIMEOUT_RECOVERY)
but the callback might not return.
Adding a timeout option allows for this occurrence to be avoided.
Signed-off-by: Guilherme Casa Nova <guilherme.casa_nova@dell.com>
Display is not working on STM32F429i-DISC1 board because
display_blanking_off() needs to be sent to ILI9341 device, but it's sent
to LTDC instead which does not implement it.
This patch adds a LTDC DT property that provides the pHandle of the
display's own controller so that display_blanking_off/on are forwarded to
it when they are called by an application.
Signed-off-by: Abderrahmane Jarmouni <abderrahmane.jarmouni-ext@st.com>
Check the return code of mipi_dbi_reset, and do not delay for the reset
wait time unless the mipi controller has issued a hardware reset to the
display.
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
Fix usage of MIPI buffer descriptor in ili9xxx driver. Previously, the
buffer descriptor size was being set to display buffer size. For cases
where the write height/width was not equal to the size of the buffer, this
resulted in additional data being written that was not needed. To
resolve this, calculate the mipi descriptor buffer size in the driver
Also, remove the unconditional setting of mipi_desc.height, as this
would override the previous (correct) setting.
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
Add a custom driver that takes care of loading and launching RISC-V VPR
cores found on the new nRF54 SoCs.
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
... in the related parts, so that the driver can be used on nRF54H20
where the clock control is not present yet.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
Extend Kconfig definitions and nrfx_config translations so that UARTE
instances that are available in nRF54H20 can be used.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
On nRF54H20, only the new shim can be used and the enhanced poll out
cannot be enabled since there is no DPPI support for this SoC yet.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
Move code that prepares `NRFX_CONFIG_GRTC_*` definitions based on
information from devicetree from the nRF54L15 nrfx_config header
to the global one, so that the code can be used by nRF54H20, too.
The checks that validate owned-channels and child-owned-channels
DT properties are moved to the nrf_grtc_timer driver so that
the global nrfx_config is not polluted unnecessarily.
The default values in nrfx_config_nrf54l15_enga_application.h
are restored to those from the corresponding template file.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
This adds new NXP mailbox driver for MBOX device.
NXP mailbox IP driver supports sending data between cores.
It uses 32 bit register to trigger irq to other core.
This driver implementation uses 4 bits for channel selection of
triggering mode, 4 bits for channel selection of data transfer and
rest 24 bits for data.
NXP mailbox IP Reference Manual UM11126, Chapter 52.
https://www.nxp.com/webapp/Download?colCode=UM11126
Signed-off-by: Tomas Galbicka <tomas.galbicka@nxp.com>
Address and size are given by the DTS register property
of the qspi nor : to be used by the qspi driver.
Signed-off-by: Francois Ramu <francois.ramu@st.com>
Address and size are given by the DTS register property
of the ospi nor : to be used by the ospi driver.
Signed-off-by: Francois Ramu <francois.ramu@st.com>
Add power management support to the gpio-qdec driver.
This is a bit complicated by the fact that the driver has two modes of
operation and the interrupt, timer and idle work ineract with each
other.
The suspend sequence is:
- set the suspended bit (inhibits the poll timer so that it does not
resubmit the idle work)
- cancel the idle work (so that it does not schedule and re-set the
interrupt or timers)
- disable interrupts (if used)
- stop the sampling timer
- disconnect the pins
The resume sequence is more or less the opposite.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Some devices like S32K1xx don't feature an internal 32.768 KHz
oscillator. Also, updated the code to use the existing HAL API
for this purpose.
Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
1. Configure 'core-clock' to 192MHz to generate necessary 48MHz
2. Support workaround to disallowing ISO IN/OUT EPs to be assigned
the same EP numbers
Signed-off-by: Chun-Chieh Li <ccli8@nuvoton.com>
drivers: eth: phy: tja1103: Handle link change
These changes enable -
TJA1103 driver to gracefully handle Link connect or disconnect events
between Ethernet PHY and its link partner and notify it to the
upper network layers
Signed-off-by: Sumit Batra <sumit.batra@nxp.com>
These changes enable -
1. S32 gmac driver to gracefully handle
net iface down and up net shell commands and
2. Link connect or disconnect events between
Ethernet PHY and its link partner.
Signed-off-by: Sumit Batra <sumit.batra@nxp.com>
Currently, whenever performing TRIGGER_PAUSE operation, the
data line is not disabled. This works well if TX and RX don't
operate at the same time or they operate in ASYNC-ASYNC mode. This
is because sai_tx_rx_disable() will disable transmitter/receiver
all the time since there's no dependencies to take into consideration.
However, in the ASYNC-SYNC mode, sai_tx_rx_disable() may not disable
the current asynchronous side if the synchronous side is still enabled.
As a consequence, the asynchronous side will remain enabled, thus
leading to an underrun/overrun.
To fix this issue, sai_trigger_pause() should disable the data line
each time it's called. This way, even if sai_tx_rx_disable() doesn't
disable the current direction, the data line will be disabled, thus
stopping the consumption/production of frames.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Supurious interrupts can be generated when the SPI device
is disabled. Ignore them within the SPI IRQ handler.
Co-authored-by: Georgij Cernysiov <geo.cgv@gmail.com>
Signed-off-by: Daniel Gaston Ochoa <dgastonochoa@gmail.com>
Allow to use H7 SPI FIFO to improve performance.
SPI FIFO usage can be enabled/disabled from devicetree.
Signed-off-by: Daniel Gaston Ochoa <dgastonochoa@gmail.com>
Set the transfer size in SPI H7 and check EOT instead of TXC
to be sure the transaction has finished. This is required to
enable the use of the SPI FIFO, as otherwise SPI seems to
operate in "continuous mode", which produces several SCK cycles
after the last frame has been sent/received. More details in the PR.
Signed-off-by: Daniel Gaston Ochoa <dgastonochoa@gmail.com>
In many cases suspending or resuming of a device is limited to
just a few register writes. Current solution assumes that those
operations may be blocking, asynchronous and take a lot of time.
Due to this assumption runtime PM API cannot be effectively used
from the interrupt context. Zephyr has few driver APIs which
can be used from an interrupt context and now use of runtime PM
is limited in those cases.
Patch introduces a new type of PM device - synchronous PM. If
device is specified as capable of synchronous PM operations then
device runtime getting and putting is executed in the critical
section. In that case, runtime API can be used from an interrupt
context. Additionally, this approach reduces RAM needed for
PM device (104 -> 20 bytes of RAM on ARM Cortex-M).
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Add cleanups to pin presence checks within the mipi_dbi SPI driver.
The cleanups now verify that GPIO and RESET pin devices are ready,
if they are present for the device instance.
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
Use a delegate for reporting the core clock rate of the fake CAN
driver. This allows overriding the delegate at run-time and inspecting its
call count.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Promote clk_ratio_adj to double for internal calculations related to ratio
to avoid compilation warnings related to implicit conversion from float
to double.
Signed-off-by: Mateusz Hołenko <mholenko@antmicro.com>
This adds support for the GRLIB SPIMCTRL SPI controller used in LEON and
NOEL-V systems. SPIMCTRL can operate in two different modes: In the
default mode it allows memory-mapped read access to the flash data. When
set in the user mode, it can be used to generate SPI bus transactions.
Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
Support SFDP probe in flexspi nor driver. This probe will allow the
flash driver to dynamically configure quad spi flashes for 1-4-4 mode,
expanding the flash chips supported with this driver.
The following data is read from the SFDP header:
- quad enable method
- fast read command (1-4-4 is maximum supported)
Fixes#55379
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
Add support for reclocking flexspi in ccm_rev2 driver. Clock update
functions are provided for the RT11xx.
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
Add support for reclocking the FlexSPI on NXP iMX RT10XX. This
functionality requires an SOC specific clock function to set
the clock rate, since the FlexSPI must be reset directly
before applying the new clock frequency.
Note that all clock constants are defined in this commit, since the
memc flexspi driver now depends on a clock node being present.
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
Updated the shared IRQ handler function in the shared interrupt controller
drivers to include support for the 'irq_number' parameter. When a single
driver manages multiple shared IRQs, it becomes challenging to determine
which IRQ line is invoking the handler. Therefore, I've introduced an
option to share the IRQ number to address this issue.
Signed-off-by: Navinkumar Balabakthan <navinkumar.balabakthan@intel.com>
eb2e5de01c made this a console driver but without adding the needed
hooks. This adds the hooks to support the console interface.
Fixes#65987Fixes#66264
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Add the white light channel to the
veml7700 sensor to allow for correction
of light sources with strong infrared
content.
Signed-off-by: Jeff Welder <Jeff.Welder@ellenbytech.com>
Convert ili9xxx display drivers to use MIPI DBI API. Due to the fact
this change requires a new devicetree structure for the display driver
to build, required devicetree changes are also included in this commit
for all boards and shields defining an instance of an ili9xxx display.
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
SPI controllers can easily implement MIPI DBI mode C, with the help of
GPIO pins for the reset and command/data signals. Introduce a MIPI DBI
compliant SPI driver, which emulates MIPI DBI mode C (SPI 3 and 4 wire).
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
Introduce MIPI DBI driver class. MIPI DBI devices encompass several
interface types. All interfaces have a data/command, reset, chip select,
and tearing effect signal
Beyond this, MIPI DBI operates in 3 modes:
Mode A- 16/8 data pins, one clock pin, one read/write pin. Similar to
Motorola type 6800 bus
Mode B- 16/8 data pins, one read/write pin. Similar to Intel 8080 bus
Mode C- 1 data output pin, 1 data input pin, one clock pin.
Implementable using SPI peripheral, or MIPI-DBI specific controller.
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
The LIS2DE12 is an ultra-low-power high- performance three-axis
linear accelerometer belonging to the “femto” family with digital
I2C/SPI serial interface standard output.
This driver is based on stmemsc HAL i/f v2.3
https://www.st.com/en/datasheet/lis2de12.pdf
Signed-off-by: Armando Visconti <armando.visconti@st.com>
Add APIs to:
1. read/write sensor regs on i2c/spi bus enabling adrress
auto-increment in a stmemsc specific way.
2. read/write sensor custom APIs.
Signed-off-by: Armando Visconti <armando.visconti@st.com>
1. Support the dma mode for andes_atcspi200
and use board adp_xc7k_ae350 for testing.
2. Refine the function mechanism.
Signed-off-by: Kevin Wang <kevinwang821020@google.com>
1. Remove the redundant code.
2. Use sys_set_bits and sys_clear_bits instead of customized MACRO.
Signed-off-by: Kevin Wang <kevinwang821020@google.com>
Add driver for the Microchip Polarfire SOC MSS SPI controller.
The interrupts of the MSS SPI are routed through PLIC(Platform level
interrupt controller).
Tested with generic spi-nor flash driver(spi_flash) with both Fixed
flash configuration and Read flash parameters at runtime(using SFDP).
Signed-off-by: Naga Sureshkumar Relli <nagasuresh.relli@microchip.com>
Bind WiFi network devices to the generic WiFi connectivity backend if
the appropriate option is set.
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
Adds CAN drivers for XMC4xxx SoCs.
XMC4xxx has multiple CAN nodes. The nodes share a common clock and
a message object pool.
The CAN nodes do not have a loopback mode. Instead there is an
internal bus which can be used to exchange messages between
nodes on the SoC. For this reason tests/samples which rely on the
loopback feature have been disabled.
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
It looks like driver references quite a few non-existing properties in
devicetree (see dts/bindings/spi/infineon,cat1-spi.yml). This mistake
was hidden because of DT_INST_PROP_OR(), which expands to the default if
the property is not present. However, after
260fc89643, the issue became visible
because sme DT_INST_PROP_OR() were changed to DT_INST_PROP().
Note that only fields not initialized to 0 (or false) have been kept.
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
Do not disable the ADC after the end of the measurement to avoid systematic
enabling which is time-consuming in case the configuration is unchanged.
Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
Reducing the number of times the code dereferences the pointer *reg,
which points to SRAM. By using a local variable tmp for operations before
assigning it to *reg.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Add basic PM support for STM32 RTC counter.
It is useful for Suspend to RAM support to reenable the RTC register clock
after wakeup from Standby.
Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
Interrupt handling in this chip is broken beyond repair, anyone unfortunate
enough to have to use it will probably come across this error and wonder
what's up.
Signed-off-by: Armin Brauns <armin.brauns@embedded-solutions.at>
It might happens that DT(_INST)_PROP_OR is used with boolean properties.
For instance:
.single_wire = DT_INST_PROP_OR(index, single_wire, false), \
.tx_rx_swap = DT_INST_PROP_OR(index, tx_rx_swap, false), \
This is not required as boolean properties are generated with false
value when not present, so the _OR macro extension is superflous
and the above code can be replaced by:
.single_wire = DT_INST_PROP(index, single_wire), \
.tx_rx_swap = DT_INST_PROP(index, tx_rx_swap), \
Signed-off-by: Roman Studenikin <srv@meta.com>
Fixing this "revealed" bug which got introduced when
a PR added the -Wdouble-promotion flag to GCC builds
Signed-off-by: Sumit Batra <sumit.batra@nxp.com>
For the flash driver, the base address is the MCU internal flash
address (usually 0x8000000). This PR gets the that address
from the device tree node "st,stm32-nv-flash"
instead of relying on the CONFIG_FLASH_BASE_ADDRESS
which might differ when building for another flash memory.
Signed-off-by: Francois Ramu <francois.ramu@st.com>
Fix the build of the gpio driver BD8LB600FS on the
board intel_adl_crb.
Fixes#68219.
Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
The driver uses pinctrl to configure pins instead of nrfx I2S API.
Check whether MCK pin was actually connected by pinctrl instead of
comparing nrfx_cfg.mck_pin that is always NRF_I2S_PIN_NOT_CONNECTED.
This makes it possible for nRF I2S to provide master clock even when
operating in I2S Slave mode.
Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
The driver cannot handle OUT transactions for an endpoint with an
MPS smaller than 64 bytes. To solve the issue, we will not use one
fixed value, EP_MPS, but instead use the actual MPS of an endpoint,
ep_state->ep_mps.
Signed-off-by: Marc Desvaux <marc.desvaux-ext@st.com>
Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
Added Kconfigs to define the size of:
- UART backend receive buffer
- UART backend transmit buffer
- Satellites array size
and increased the UART RX buffer size a default to 256 as 128
is just on the edge of to small at a baudrate of 115200.
Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
The pipe should be closed when suspended, both to save ressources
and to flush it. Without flushing the pipe, the driver may fail
to either resume or suspend the GNSS as the chat module starts
processing old data, which can contain acks to commands, breaking
the scripts.
Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
The implementation of power management did not account for
being on a power domain when initializing, and handling being
powered on and off at runtime.
The GNSS requires time to start up, which it always does when
powered on, before accepting commands. It also requires time
after resuming and suspending before accepting commands.
This commit implements this timeout, and improves logging to
make the power management more transparent, and removes some
redundant parenthesis for better readability.
Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
Based on edit done at r8a779f0 driver creation
(f5634a1a0e6f607809a7e4b8d1933a85b5eb7642)
following comments on #56043.
Signed-off-by: Aymeric Aillet <aymeric.aillet@iot.bzh>
Remove old unused defines from header
Use clang-format to apply coding guideline to r8a7795 driver
Signed-off-by: Aymeric Aillet <aymeric.aillet@iot.bzh>
Add an active discharge api for regulators. This uses the already
existing but previously unused regulator-active-discharge
property.
Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
The GPIO power domain driver needs device power management enabled
to compile if `PM_DEVICE_POWER_DOMAIN` is enabled.
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
Sort the included headers by name, remove unneeded includes and ensure
soc.h is included prior to the Zephyr CAN headers.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
There is default 15K-ohm pull-down for USB controller.
To disable the default pull-down to avoid signal contention in GPIO mode.
Signed-off-by: Ren Chen <Ren.Chen@ite.com.tw>
Guard use of I2S_EnableSecondaryChannel behind the SDK feature macro
that determines if this support is available, since when this macro is
not defined the SDK function is not implemented.
Fixes#68136
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
Set the correct VCO input range for the PLL frequency
with each bit PLL1RGE of the PLL1CFGR register
This get_vco_input_range is similar to the stm32h7 one.
Signed-off-by: Francois Ramu <francois.ramu@st.com>
Propagate the current CAN controller operation mode to the CAN transceiver
when enabling it.
Some more advanced CAN transceivers, especially those supporting Partial
Networking (CAN PN), require knowledge of the intended CAN operation mode
(e.g. normal mode vs. listen-only mode).
This commit simply prepares the CAN transceiver API for supporting such CAN
transceivers, although no in-tree drivers require this information yet.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Add system call can_get_transceiver() for getting the CAN transceiver
associated with a CAN controller.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
The srandom function is not available
unless _XOPEN_SOURCE is set > 500 or an equivalent
declaration is done.
Let's set it.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This code was using strptime from the C library in some cases,
but this function is an extension which many embedded libCs do
not provide, and which is not provided by default unless
_XOPEN_SOURCE or a similar macro is defined before the system headers
are included.
We could define _XOPEN_SOURCE for the libraries that provide it,
but instead of treating the host C library differently than
embedded libraries, let's just build the provided version always,
as that should provide better coverage of this code.
Note: It seems picolibc's strptime is broken,
until this very recent patch:
https://github.com/picolibc/picolibc/pull/657
so we should not select it when building for this library
for a while either.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This file uses several functions which are extensions to the the
std C library. Let's explicity select one of the extensions
which includes it instead of relaying on somebody having
set it for this file somewhere else.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This file uses several functions which are extensions to the the
std C library. Let's explicity select one of the extensions
which includes it instead of relaying on somebody having
set it for this file somewhere else.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This file uses several functions which are extensions to the the
std C library. Let's explicity select one of the extensions
which includes it instead of relaying on somebody having
set it for this file somewhere else.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This driver doesn't use any APIs outside of the Zephyr C library list, so
it doesn't need this _POSIX_C_SOURCE define.
Signed-off-by: Keith Packard <keithp@keithp.com>
soc\riscv\andes_v5\ae350\soc.h was empty and deleted,so revise
wdt_andes_atcwdt200.c to resolve
'fatal error: soc.h: No such file or directory'.
Signed-off-by: cyliang tw <cyliang@nuvoton.com>
Use 'struct uc81xx_tres16' for 16-bit 'tres' setup, instead of 'struct
uc81xx_tres8'. This fixes a regression when support for 'uc8175' was added
and 'struct uc81xx_tres' was replaced with 'struct uc81xx_tres16'.
Fixes: 7c46b0b898 ("drivers: display: uc81xx: add support for uc8175")
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
- In `set_vendor_ie_header_lm`, case when
`link_metrics_data_len == 0` has been ignored.
This commit fixes that by setting `header_ie->length = 0`
before returning.
- current implementation of enh ACK header IE returns
`-ENOTSUP` when `ack_ie.header_ie == NULL` or
`ack_ie.header_ie->length == 0`. This commit fixes that by
refactoring checks in `nrf5_configure`.
Co-authored-by: Przemyslaw Bida <przemyslaw.bida@nordicsemi.no>
Signed-off-by: Maciej Baczmanski <maciej.baczmanski@nordicsemi.no>
Mute GPIO mutes both channel 1 and channel 2.
So, only control it when all channels have to be muted.
Signed-off-by: Benjamin Lemouzy <blemouzy@centralp.fr>
Use gpio_is_ready_dt in the driver for the TLE9104 before
actually using the GPIO.
Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
In some hardware designs it might happen that the reset signal
for the TLE9104 is not used only for this purpose, but instead for
instance to reset other devices at the same time. For such a hardware
design it is then necessary to make the reset GPIO optional. The reset
will have to be triggered earlier on.
Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
This implements the daisy chain feature of the low side switch
BD8LB600FS. The daisy chaining is in hardware achieved via
connecting the MISO and MOSI lines of multiple instances of the IC
in a row. It is implemented in the driver through a variable number
of GPIOs on one instance. Therefore, one device tree instance of the
IC will handle multiple daisy chained physical instances.
Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
Add support for more than 2 I2S channels to the I2S Flexcomm driver.
Additionally, remove comment stating I2S PCM and Left justified formats
are not supported, as these formats are now validated to function
correctly.
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
The implementation uses the same approach as STM32F1x.
Program/erase speed can be set by setting 'write-block-size' flash
property to 1, 2, 4 or 8.
Signed-off-by: Patryk Duda <patrykd@google.com>
Add a command line option which will seed the random generator
from /dev/urandom.
This can be usefull for some particular tests in which we are
interested in having different random numbers in each run,
but we cannot provide a different random seed from command line.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Remove receive and transmit timeouts which are no
longer useful as the RECEIVE_READY and
TRANSMIT_IDLE events will be used to efficiently
manage timeouts between transmit/receive calls.
Then update the the in-tree drivers using the
modem_chat module to omit the process timeout
parameter.
Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
With PM, when resuming from low power mode, reenable the RNG register
clocks and check the health register. If it is not set to the desired
value, it means we exit Suspend to RAM mode, and that the RNG needs to be
reinitialized.
Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
Prevents the system to go in Suspend to RAM low power mode while ADC
measurement is in progress.
Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
When resuming from low power mode, if UART is disabled, this means that
we come from a mode that reset the registers, so we redo a full init of
the driver.
Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
Fix a bug where after a standby, it was impossible to reenable a GPIO
clock.
A counter is incremented each time pm_device_runtime_get is called, and
decremented each time pm_device_runtime_put is called. The
clock is only enabled if this counter equals 1.
When configuring a GPIO (as input or output), the timer is incremented, and
when disconnecting it, it is both incremented and decremented. Thus the
next time we try to configuring it, the clock is not enabled (since the
counter will now be equal to 2).
This causes a problem when using low power standby mode: after wakeup all
clocks are disabled and the GPIO clock can not be reenabled.
This commit fixes this bug by not incrementing the counter when disconnect
is asked (or in other words incrementing it only when configuring either
an input or an output).
Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
Add support for a backup standby timer in STM32 LPTIM driver for cases
when the LPTIM is not available (ie standby low power mode).
A counter (typically RTC) is used for such a case.
Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
Remove initialization of static variable to 0 to prevent resetting the
value when reinitializing the driver after resume from standby.
This has no impact since static variables are initialized to 0 by default.
Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
Provide different loop delays to `wait_until_ready` based upon the
operation that we are waiting for.
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
Don't monopolise the CPU in `spi_nor_wait_until_ready`. For slow flash
chips, operations can take minutes (Full chip erase on MX25R is listed
as 120s typical, 240s max).
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
This change marks each instance of the 'api' as 'static const'.
The rationale is that 'api' is used for declaring internal
module interfaces and is not intended to be modified at runtime.
By using 'static const', we ensure immutability, leading to usage of only
.rodata and a reduction in the .data area.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
When set, this GPIO controller has pins associated with the
keyboard controller. In this case the reg_gpcr property is
overloaded and used to write the keyboard GCTRL register
Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
This commit adds source and header files required for bmp581 I2C driver.
I have used bmp581_user.h to add more usage related definitions
but bmp581.h to add hardware related definitions.
Signed-off-by: Talha Can Havadar <havadartalha@gmail.com>
Signed-off-by: Gerhard Jörges <joerges@metratec.com>
The STM32 DMA driver supports cyclic mode by setting source_reload_en
and dest_reload_en. This causes the dma_callback to be called twice per
buffer run-through, at half-time and when wrapping back to the start of
the buffer.
However, the current implementation only calls dma_callback twice. When
wrapping the first time, it sets stream->busy to false and ignores
subsequent interrupts.
With this change, the busy flag is only cleared in non-cyclic mode.
Signed-off-by: Marco Widmer <marco.widmer@bytesatwork.ch>
For series that have two sampling time common channels, only one was used.
This commit add the support for the second one. The first two different
acquisition time values are used for the sequence and all further values
must match either of them, otherwise generating an error.
Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
This is driver limitation after removing CAN_FILTER_FDF flag #65108.
CANXL driver need to know CAN_FILTER_FDF for configuring Rx filter
so that it receives CAN classic or CAN FD frames when using non RX_FIFO.
So update driver that just supports CAN classic for non RX_FIFO.
Signed-off-by: Cong Nguyen Huu <cong.nguyenhuu@nxp.com>
Commit eeec09eb9a unintentionally modified
can_calc_timing_data() to be called with the nominal phase parameters
instead of the data phase parameters.
Before the change, the parameters were properly initialized in the macro
MCP251XFD_SET_TIMING_MACRO(inst, _data).
After the commit, can_calc_timing_data() gets called with the parameters
pointing to dev_cfg->common.sample_point instead of
dev_cfg->commom.sample_point_data.
This PR creates a separate function mcp251xfd_set_timing_data()
which calls can_calc_timing_data with the correct data parameters.
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
Just like for the old driver, for simulation, we cannot
get the UART regiter address for the pinctrl config structure
from DT, as that cannot match the one allocated at build time.
So let's override it at runtime with the correct address
which is stored in the UART config structure.
Also, do improve the condition for the busy wait during the poll_out,
for simulation, so we only busy wait if we will loop/the
Tx was busy.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
The TLA2021 driver depends on it's i2c controller and therefore needs
to be initialized later. ADC_INIT_PRIORITY by default equals
KERNEL_INIT_PRIORITY_DEVICE which should be used by independent devices.
Using this by default causing projects to fail where this driver is
enabled implicitly through board configuration and the priority is not
explicitly set.
Signed-off-by: Caspar Friedrich <c.s.w.friedrich@gmail.com>
This fixes following build error when rv32m1_vega_zero_riscy
board gets compiled:
implicit declaration of function 'INST_DT_CLOCK_IP_NAME'
Fixes#68012
Signed-off-by: Armando Visconti <armando.visconti@st.com>
This commit introduces a driver for NXP's eDMA IP.
The main reasons for introducing a new driver are the following:
1) The HAL EDMA wrappers don't support well different
eDMA versions (e.g: i.MX93 and i.MX8QM). As such, a new
revision had to be introduced, thus requiring a new Zephyr
driver.
2) The eDMA versions found on i.MX93, i.MX8QM, and i.MX8QXP
don't use the DMAMUX IP (instead, channel MUX-ing is performed
through an eDMA register in the case of i.MX93).
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
This commit updates the driver to use the flash layout pages,
rewriting it to utilize the flash_page_layout.c driver to
avoid duplicate code.
Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
Several STM32 variants include both shared IRQs for some ADCs and
separate IRQs for others (for example, STM32G473 has 5 ADCs, ADC1 and
ADC2 share one IRQ while ADC3, ADC4 and ADC5 each have unique
IRQs). The STM32 ADC driver however previously only supported either
separate IRQ lines for each operational ADC in the devicetree or a
single shared IRQ for all operational ADCs in the devicetree which
prevented all ADCs from being usable at the same time when the variant
contained a mix of both shared and separate ADC IRQ lines (only either
all the shared or all the separate and one of the shared might be used
at most for one application).
To allow for all ADCs in an STM32 variant to be usable in a single
application, generate an ISR and initialization function for each
unique IRQn as defined in the devicetree and give the task of
initialization to the first ADC which connects to that particular
IRQ. Each ISR function will generate code to call the ISR for each ADC
associated with that IRQn as was previously done for
CONFIG_ADC_STM32_SHARED_IRQS, allowing an ISR to be shared for the
ADCs sharing an IRQ while simultaneously providing separate ISRs for
each IRQ. Thus, the only information required to have ADCs either
share an ISR or not is provided by the devicetree.
Signed-off-by: Michael R Rosen <mrrosen@alumni.cmu.edu>
Extend the workaround for the unreliable SPI busy flag
to all F7 and L4 devices, which are affected by the same
erratum.
Fixes #67739
Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
Change the gpio_qdec driver to support optical encoders.
Add a property to use for defining an arbitrary number of GPIOs for the
sensing devices (typically infrared LEDs, but could also be the
biasing for the phototransistor), and one for adding a delay between
turning those on and reading the pin status.
The infrared LEDs typically consume a non negligible amount of power, so
there's also a new idle-poll-time-us property that enables two possible
modes of operation:
- if idle-poll-time-us is zero (default) the LEDs are enabled all the
time and the driver enters polling mode using the GPIO interrupt as
with mechanical encoders. This is usable for mains powered devices and
has the lowest overhead on the CPU.
- if idle-poll-time-us is non zero, then the driver polls the encoder
all the time, turning on the LEDs just before reading the state and
shutting them off immediately after, but when the encoder is idle it
switches the polling rate to idle-poll-time-us to save power, and only
polls at sample-time-us when some movement is detected.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
use CONFIG_SOC_INTEL_ACE15_MTPM instead of CONFIG_ACE_VERSION_1_5.
CONFIG_ACE_VERSION_1_5 leaked from SOF.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Fixes a compilation error in quectel_lcx6g driver when CONFIG_PM_DEVICE=y.
Corrects the function call in quectel_lcx6g_suspend from
'modem_chat_run_script_run' to 'modem_chat_run_script'.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
This commit repairs reading of data from other
channels than 0.
Refactors irq handler outside of DT define.
Trigger registered callback only when proper flag is set.
Signed-off-by: Tomas Galbicka <tomas.galbicka@nxp.com>
A growing number of CAN controllers do not have support for individual RX
hardware filters based on the Remote Transmission Request (RTR) bit. This
leads to various work-arounds on the driver level mixing hardware and
software filtering.
As the use of RTR frames is discouraged by CAN in Automation (CiA) - and
not even supported by newer standards, e.g. CAN FD - this often leads to
unnecessary overhead, added complexity, and worst-case to non-portable
behavior between various CAN controller drivers.
Instead, move to a simpler approach where the ability to accept/reject RTR
frames is globally configured via Kconfig. By default, all incoming RTR
frames are rejected at the driver level, a setting which can be supported
in hardware by most in-tree CAN controllers drivers.
Legacy applications or protocol implementations, where RTR reception is
required, can now select CONFIG_CAN_ACCEPT_RTR to accept incoming RTR
frames matching added CAN filters. These applications or protocols will
need to distinguish between RTR and data frames in their respective CAN RX
frame handling routines.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
The max size was determined by looking at the ARCH of the cpu. This really
comes from the ip configuration when generated. Add `max-xfer-size`
property to the devicetree.
Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
Only toggle the hw cs if the cs is not set as a gpio. SPI trancieve
should also return the rx len when in slave configuration.
Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
This cleans up the instantiation macro. DBG_COUNTER was also removed
as that appears to be unnecessary. This also allows for if it is a
serial target to be configured from the devicetree.
Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
The HAS_SPI_DW Kconfig is rather unncessary. If the synopsys designware
spi is to be included. It should come from the devicetree.
Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
In sdhc_spi_response_get, the logic for slow cards previously only
retried reads 16 times. Instead of using this approach, read from the
card every 10 ms until the command timeout is reached or it responds.
This way, the command timeout will be respected for cards that do not
respond.
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
Adding driver for GC9A01A 240x240 based LCD displays.
Should be working with GC9C01 as well (untested).
Signed-off-by: Martin Kiepfer <mrmarteng@teleschirm.org>
rssi 31 will be -51dBm or greater, where -51 is valid. Fix the
range by allowing until -51.
Signed-off-by: Parthiban Nallathambi <parthiban@linumiz.com>
* Internal Clock not getting stable during initialization
* SD clock was not enabled
* Removed duplicate file.
* Removed write to readonly registers
* Moved function pointer structure from data section to RO section
* Wrong macro names
* Refactoring of lower layer header file.
Signed-off-by: Tanmay Kathpalia <tanmay.kathpalia@intel.com>
Fixed an issue where `display_read()` in the SDL driver was not working.
In the current implementation, use texture to represent screen images.
To read this, draw it once on another surface and then read it.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Add SDL_DISPLAY_USE_HARDWARE_ACCELEREATOR to be able to switch
enable/disable hardware accelerator.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
The current implementation implicitly assumes that if the device is
configured to have the capability of acting as a CSL endpoint then in
case a delayed reception with matching ID finishes with a timeout no
action is needed. This assumption is correct when RxOnWhenIdle mode is
disabled because the transition to sleep is done automatically by the
driver below. However, it's wrong when RxOnWhenIdle is enabled. This
commit fixes that case by adding a call to event handler that notifies
the higher layer about the event and allows it to transition to RxOff if
needed.
Signed-off-by: Jędrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
Before, only one sensor device was supported. It
was possible to set a trigger on a second sensor
device, but the filtering of the channel data
would cause no channels from the new sensor
device to be read.
Also in trigger handler log of sampled data, print
the sensor name and channe name (instead of channel
number).
Signed-off-by: Mike J. Chen <mjchen@google.com>
New shim takes more flash and is causing some tests to overflow the
ROM memory. Switching to the legacy shim as default until it is fixed.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Remove the CAN_FILTER_FDF flag for filtering on classic CAN/CAN FD frames
as it is not supported natively by any known CAN controller.
Applications can still filter on classic CAN/CAN FD frames in their receive
callback functions as needed.
Fixes: #64554
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Add support for reconfiguring the period of an active PWM channel with
the SCTimer driver. Due to the design of the SCTimer IP, the period can
only be reconfigured when one channel is in use. Otherwise, only the
duty cycle of each channel can be updated.
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
The clock divider value is not being applied as the address of the
register to which it is being written is incorrect. A check of all RA MCU
datasheets confirms that, in all cases, the SCKDIVCR register is at an
offset of 0x20 (and not 0x21).
Signed-off-by: Ian Morris <ian.d.morris@outlook.com>
When adjusting the prescale to increase the I2C SCL low period,
the high period must also be subtracted to maintain a consistent
frequency.
Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
Add new shim which is based on nrfx driver.
Legacy shim is kept for transition period. It can be used after
setting CONFIG_UART_NRFX_UARTE_LEGACY_SHIM.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Add adaptation layer which allows to provide interrupt driven
API for drivers which exposes only asynchronous API.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Change the synchronization of RMC and GGA NMEA messages from a
timeout to matching their UTC timestamps.
Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
Remove gpio_clock_names and gpio_mcux_lpc_config->clock_ip_name from
drivers/gpio/gpio_mcux_lpc.c.
The drivers/gpio/gpio_mcux_lpc.c file did not compile with xt-clang
RI-2021.8-win32, as the gpio_clock_names was initialised with a
reference to a static const array. The clock_ip_name member was
initialised from this variable, but it isn't used anywhere else.
Signed-off-by: Vit Stanicek <vit.stanicek@nxp.com>
When the I2C is in the target mode and encounters the bus error, the
driver has to reset the bus to recover the I2C hardware. However, when
the hardware is disabled, the interrupt enable bits are also cleared
automatically by design. As a result, we need to enable the interrupts
after resetting the I2C hardware.
Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
Add driver for NXP nx20p3483 power path controller that can be used
to control and protect sink and source path of USB-C connector.
Signed-off-by: Michał Barnaś <mb@semihalf.com>
Add support for ppc shell command with subcommands that can print
the status of PPC (dead battery, sinking, sourcing, vbus detected),
dump registers and request the PPC to exit dead battery mode.
Signed-off-by: Michał Barnaś <mb@semihalf.com>
This commit adds an API to the Power Path Controllers (PPC) that
may be used with USB-C subsystem to control the current paths,
enabling and disabling sourcing and sinking VBUS and protect against
shorts, overvoltage and overcurrent.
Signed-off-by: Michał Barnaś <mb@semihalf.com>
According to the clic specification
(https://github.com/riscv/riscv-fast-interrupt), the mnxti register has
be written, in order to clear the pending bit for non-vectored
interrupts. For vectored interrupts, this is automatically done.
From the spec:
"If the pending interrupt is edge-triggered, hardware will automatically
clear the corresponding pending bit when the CSR instruction that
accesses xnxti includes a write."
I added a kconfig `RISCV_SOC_HAS_CUSTOM_IRQ_HANDLING` to allow custom
irq handling. If enabled, `__soc_handle_all_irqs` has to be implemented.
For clic, non-vectored mode, I added a `__soc_handle_all_irqs`, that
handles the pending interrupts according to the pseudo code in the spec.
Signed-off-by: Greter Raffael <rgreter@baumer.com>
The mechanism for hardware vectoring has changed in the clic spec
(https://github.com/riscv/riscv-fast-interrupt) in 2019. Before
vectoring was enabled via `mode` bits in `mtvec`. Support for this was
added in fc480c9382.
With more current clic implementations, this does not work anymore.
Changing the `mode` bits is reserved. Vectoring can be enabled
individually in the `shv` bit of `clicintattr[i]`.
Since the old mechanism is still used, I added a new Kconfig for it.
If this Kconfig is not set, we use the `shv` bit for harware vectoring.
Signed-off-by: Greter Raffael <rgreter@baumer.com>
The trig field of clicintattr is indeed in bits 2:1. However, the mask
`CLIC_INTATTR_TRIG_Msk` is only applied directly to the bitfield
`INTATTR.b.trg`. Therefore it doesn't have to be shifted additionally.
Signed-off-by: Greter Raffael <rgreter@baumer.com>
Add support of voltage control to Renesas PFC driver. Voltage register
mappings have been added to r8a77951 and r8a77961 SoCs.
Allow 'power-source' property for 'renesas,rcar-pfc' node. This property
will be used for configuring IO voltage on appropriate pin. For now it
is possible to have only two voltages: 1.8 and 3.3.
Note: it is possible to change voltage only for SD/MMC pins on r8a77951
and r8a77961 SoCs.
Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
Modify the sequence of pinctrl setting. Default setting as input mode
prevents leakage during changes to extended setting.
Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
Signed-off-by: Dino Li <Dino.Li@ite.com.tw>
When device runtime pm is enabled on console device, do not suspend
device synchronously on each char transmission, but rather use asynchronous
suspension request.
This will save useless and costly suspension/resumption procedure, which
can involve uart device clock suspension but also pin configuration
to sleep state (which itself involves gpio clock activation ...).
On STM32, using asynch device suspension allows to divide by 3 the
transmission time of a character chain.
Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
This change marks each instance of the 'i2c_driver_api' as 'static const'.
The rationale is that 'i2c_driver_api' is used for declaring internal
module interfaces and is not intended to be modified at runtime.
By using 'static const', we ensure immutability, leading to usage of only
.rodata and a reduction in the .data area.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
The place where TF-M places its non-secure api header files has changed
Therefore changing it for for all applications that use it.
Signed-off-by: Markus Swarowsky <markus.swarowsky@nordicsemi.no>
This change renames the RX message buffer from g_hciRxMsg to rxmsg,
as it does not follow the Zephyr coding style.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
This change relocates the tx/rx message buffer from the .bss section
to the .noinit section. This adjustment is aimed at reducing boot time by
lowering the size of the .bss section, without impacting the operational
functionality of the buffer.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Add driver for NXP DMIC peripheral. This peripheral is present on the
iMX RT5xx and iMX RT6xx parts, as well as some LPC SOCs. The following
features are supported:
- up to 2 simultaneous channels of L/R PCM data (4 channels are not
supported due to limitations of the DMA engine)
- individual configuration of gain and filter parameters for each DMIC
channel input
The driver has been tested with up to 4 PCM data streams (2 L/R channels),
as well as the MEMS microphones present on the RT595 EVK.
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
Co-authored-by: Yves Vandervennet <yves.vandervennet@nxp.com>
Add definition for DMIC clock source to LPC SYSCON clock control driver.
This constant allows drivers to get the DMIC bit clock frequency.
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
Allow the driver to compile without `CONFIG_NET_NATIVE_IPV4`. This can
happen if the driver is only desired for SSID scanning.
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
Master Inter-Data Idleness and Master SS Idleness
can configure with STM32 low level spi driver apis.
Signed-off-by: Mustafa Abdullah Kus <mustafa.kus@sparsetechnology.com>
Use proper errno.h error codes in pd_intel_adsp_set_power_enable()
instead of -1.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
The write protect register (PWPR) found on RA Microcontrollers is an 8-bit
register at an odd address. It was being accessed using a pointer to a
uint32_t which causes a fault on some devices in the series.
Signed-off-by: Ian Morris <ian.d.morris@outlook.com>
Add RGPIO gpio driver. This driver is used for i.MX93 and i.MX8ULP.
GPIO pinctrl, read/write and interrupt is supported. Runtime mmio
configuration is enabled, so no need for region definition in
mimx9/mmu_region.c
Signed-off-by: Chekhov Ma <chekhov.ma@nxp.com>
Increase the busy wait time granularity while runing in simulation
for poll mode. In this mode, the driver spends a *lot* of time
waiting for the UART to be done. The smallest frame time is
~10µs @ 1Mbps, so busywaiting in very small increments
is very wastefull as we keep shuting down and turning on the simulated
MCU.
Let's increase the busy wait time increments of the driver to 3 micros,
which should not change much the behaviour.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
After #63289, multi-level interrupts are now encoded using macro
magic. This means that using the generic DT_INST_IRQ_BY_IDX() to
fetch the INTID is no longer an option as the queried INTID will
be the one specified through the node's `interrupts` properties.
To fix this, switch to using DT_INST_IRQN_BY_IDX() which will
return the correctly encoded INTID.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
This commit implements parsing of the CESQ extended signal quality AT
command, extracting RSRP and RSRQ which is relevant for LTE connections.
It's used in the U-blox SARA-R5 modem instance. Furthermore, the IMEI,
IMSI is extracted in the same modem.
Signed-off-by: Emil Lindqvist <emil@lindq.gr>
Now that STM32_LPTIM_CLOCK choice symbol is defined from device tree,
remove the prompt which was defining it as a user selectable entry.
Remove the warning related to possible symbol misalignment with
device tree setting.
Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
The receiver ready flag of the (channel) status register
for the sam controller was not being interpreted correctly
for both the uart and usart implementation,
according to the uart api.
Tested and confirmed using the sam4sa16ca.
Signed-off-by: Jaro Van Landschoot <jaro.vanlandschoot@basalte.be>
As an example, when the gyro range is set to 250 deg/sec the scale
was set to 133 where it really should be 133.160058662. This leads
to a 0.12% error in the value returned. By separating the numerator
and denominator, we're able to drastically reduce the error.
Signed-off-by: Yuval Peress <peress@google.com>
The range map was sorted wrong since the function
bmi160_range_to_reg_val() that uses it checks for the user value less
than the range component of the bmi160_range struct. This means that
no matter what range is set, the value will always end up 2000dps.
Signed-off-by: Yuval Peress <peress@google.com>
Adding a hook for tests to inject a mock transport and migrating the
accel test to test bmi160 specific things. The old version of the test
which checks for read values is now covered by the generic test in
the sensor build_all target.
Signed-off-by: Yuval Peress <peress@google.com>
Add support for getting the following attribute values:
- SENSOR_ATTR_OFFSET
- SENSOR_ATTR_SAMPLING_FREQUENCY
- SENSOR_ATTR_FULL_SCALE
Signed-off-by: Yuval Peress <peress@google.com>
The logic in the driver was not aligned to the datasheet. Also,
temperature reading was not being done in fetch, but in channel_get.
There was also some extra conversions from SI->register->SI when
setting the range, this was causing the register value calculation to
produce an incorrect scale in some cases.
Tests were added to cover these cases.
Signed-off-by: Yuval Peress <peress@google.com>
Update the backend for sensor emulators to include a function for
setting the offset as well as a function to query an attribute's
metadata such as bounds and increment size. Additionally, add
backend support for setting the _xyz channel values.
Make the appropriate test changes to accomodate.
Signed-off-by: Yuval Peress <peress@google.com>
Ignore communication faults of the TLE9104 which are reported
before the communication watchdog is configured.
Fixes#67370
Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
Reduce some of the arithmetic required to decode a sample. Math is
documented in bma4xx_convert_raw_accel_to_q31.
This improved the accuracy from roughly 0.865mm/s2 to 0.001mm/s2 when
stationary and using a range of 4g.
Signed-off-by: Yuval Peress <peress@google.com>
ssize is a POSIX.1-2001 extension, which may or may
not be provided by the C library, or may be defined
to a different size in the host and embedded C library.
Two internal functions were returning ssize.
As these functions were just trampolines
into the same host API, which are already provided
by the native simulator let's just use those.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
ssize is a POSIX.1-2001 extension, which may or may
not be provided by the C library, or may be defined
to a different size in the host and embedded C library.
Two internal functions were returning ssize, but
one of them was a trampoline into the same host API,
which is already provided by the native simulator
so let's just use that instead.
The other is only carrying data that fits into an
int and is anyhow being cast in/to ints, so let's just
avoid the trouble by defining it as returning int.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
The current driver initializes the IADC with the default configuration
(IADC_INITSINGLE_DEFAULT), which aligns the data to the right.
To correctly read the 12-bit sample, it should be masked from the right
instead.
Signed-off-by: Paulo Santos <pauloroberto.santos@edge.ufal.br>
Calling I2S write with less bytes than I2S TX memory block size makes it
possible to synchronize the time when next block is used against some
other, possibly externally sourced, signal. Example use case includes
USB Audio where audio sink and/or source has to be synchronized against
USB SOF. In Asynchronous synchronization type the rate matching is
achieved by varying the number of samples sent/received by 1 sample
(e.g. for 48 kHz audio, 47 or 49 samples are transmitted during frame
instead of 48).
Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
Fix the log level of two LOG_ERR() statements which should have always
been LOG_INF(). As confirmed by the author Adrian in #60172
Fixes commit 3fbaed4de9 ("dai: intel: ace: dmic: Refactor of
dai_nhlt_dmic_dai_params_get function")
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Employ a code spell checking tool to scan and correct spelling errors
in all files within the drivers/i2c directory.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
.bss and .data are uncached in Zephyr builds for intel_adsp. No need
to try to manipulate cache of objects in those sections.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Driver is using the RISC-V PLIC interrupt controller without including
the necessary headers.
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
Employ a code spell checking tool to scan and correct spelling errors
in all files within the drivers/serial directory.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Employ a code spell checking tool to scan and correct spelling errors
in all files within the drivers/spi directory.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Employ a code spell checking tool to scan and correct spelling errors
in all files within the drivers/gpio directory.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
SOC_ESP32_NET is now SOC_ESP32_APPCPU, following espressif's
naming convention in the same manner as ESP32S3 app cpu.
SOC_ESP32_APPCU is now a subset of SOC_SERIES_ESP32.
This commit also changes the necessary files, samples and tests
for bisect purposes.
Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
According to hardware spec, host dma needs some delay to completely stop.
In the bug the host dma is disabled in different path in a few microseonds.
The first setting disabled the host dma and called pm_device_runtime_put
to power off it. The second setting found the host dma was still alive
and calle pm_device_runtime_put again. This results to pm->usage
checking failed.
BugLink: https://github.com/thesofproject/sof/issues/8686
Signed-off-by: Rander Wang <rander.wang@intel.com>
Add support for the 1KHz counter. Update the RTC
driver to allow the 1Hz and high resolution counters
to exist together.
Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
In order to avoid build failures as described in issue #67242,
make all ST drivers using HAL_ST module dependent to HAL_STMEMSC
and HAS_STLIB libs, which need to be configured in all samples
referring to them.
Signed-off-by: Armando Visconti <armando.visconti@st.com>
This is a driver targetting the Bosch BMA 4-series accelerometers. It
has been specifically developed for the BMA422 but should be compatible
with others in that line, excepting the BMA400. Supports key attributes
and async RTIO one-shot operation. I2C operation is supported, with
stubs for a SPI implementation provided for future improvement.
Signed-off-by: Tristan Honscheid <honscheid@google.com>
When using one of the internal channels (die_temp, vbat, vref) the
channels are enabled in the individual drivers and disabled again
whenever an adc conversion is complete.
This creates a race condition if the ADC is used from multiple threads.
This commit moves the disabling of the channels to the individual
drivers.
Signed-off-by: Brian Juel Folkmann <bju@trackunit.com>
This patch enhances the power-down sequence for the HOST (HST) domain
within the Intel ADSP ACE 1.5 architecture. It introduces a check to
ensure that a specific condition, represented by a magic key value, is
met before disabling the HST domain. This additional verification step
ensures that the HST domain is only powered down when it is safe to do
so, thereby maintaining the stability and reliability of the system.
Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
ERRATA 051421 states that if the SAI is FSYNC/BCLK master,
one of the directions is SYNC with the other, and the
ASYNC direction has the BYP bit toggled, the SYNC direction's
BCLK won't be generated properly.
This commit fixes this issue by enabling BCI for the SYNC
direction. What this does is it makes the SYNC direction use
the BCLK from the ASYNC direction's pad, which, if the BYP
bit is toggled, will be the undivided MCLK. Without this fix,
the SYNC direction will use the ASYNC direction's BCLK obtained
by dividing the MCLK via the following formula: MCLK / ((DIV + 1) * 2).
This is wrong because the ASYNC direction will use an undivided
MCLK while the SYNC direction will use a divided MCLK.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
With the introduction of the "rx_sync_mode" and "tx_sync_mode"
properties, the user may choose which synchronization mode the
SAI should use. To support this, the code had to be changed a
bit such that the software reset and the disable operations
work on all synchronization modes.
What this commit does, is it changes the software reset and
disable sequences such that they work with any of the
supported synchronization modes. Also, the syncMode field
of sai_transceiver_t structure is set to the value passed
from the DTS during sai_config_set().
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
In preparation for supporting all synchronization modes, this
commit introduces the rx_sync_mode/tx_sync_mode DTS properties.
Using these, the user will be able to specify which synchronization
mode the SAI should use.
At the moment, the driver does nothing with the values from
said properties but still checks if their values are sane
(i.e: it checks if the directions are both in SYNC mode which
is forbidden). By default, if "rx_sync_mode" or "tx_sync_mode"
is not specified, the direction will be set to ASYNC mode.
As such, below one may find a couple of valid examples
depicting this idea:
tx_sync_mode = <0>;
rx_sync_mode = <0>;
is the same as not specifying any of the properties,
tx_sync_mode = <1>;
rx_sync_mode = <0>;
is the same as:
tx_sync_mode = <1>;
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Add support for specifying the domain/kernel clock along with a common
clock divider for the STM32H7 CAN controller driver via devicetree.
Previously, the driver only supported using the PLL1_Q clock for
domain/kernel clock, but now the driver defaults to the HSE clock, which is
the chip default. Update existing boards to continue to use the PLL1_Q
clock.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
ESP32 - S2,S3 and C3 variants have only 14 bits counter.
where as the plain ESP32 variant has 20 bits counter.
application failed to set low frequency(1Hz) in S2, S3 and C3 variants.
to get very low frequencies on these variants,
frequency needs to be tuned with 18 bits clock divider.
so select the slow clock source (1MHz) with highest counter resolution.
this can be handled on the func'pwm_led_esp32_timer_set' with 'prescaler'.
Signed-off-by: Jeeva Kandasamy <jkandasa@gmail.com>
Some MCU have limitations with GPIO interrupts. Add a polling mode to
the gpio-keys driver to support those cases.
This required a bit of a refactoring of the driver data structure to add
a instance wide data, and move the pin specific pointer in the config
structure.
For polling, reuse the button 0 delayed work so we minimize the resource
waste, the two work handler functions are only referenced when used so
at least those are discarded automatically if no instance needs them.
Fix a bug in the PM structure instantiation as well.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Adjusted the code to guarantee resource release irrespective of operation
success or failure.
Fixes#67336
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
__bswap_ in zephyr/sys/byteorder.h conflicts with __bswap_ in host's
byteswap.h. byteswap.h from host compiler used in posix_native_64 boards
causes a compilation issue.
This commit renames __bswap_ to BSWAP_ to prevent collision.
Before this commit a compilation error can be created by adding #include
<byteswap.h> to samples/net/sockets/echo/src/socket_echo.c
This does not change external API to byteorder.h, but does change
internal implementation which some other source files depend on.
Replaced manual byteswap operations in devmem_service.c with APIs from
byteorder.h which automatically converts to CPU endianess when necessary.
Fixes#44324
Signed-off-by: Jonathan Hamberg <jonathanhamberg@gmail.com>
With commit 1d7476af, it fixed a build error with config
structure no longer having a base address field but left
the local variable defined. This resulted in a build warning
of an unused variable 'config' in two places.
Signed-off-by: David Leach <david.leach@nxp.com>
When usb middleware sends a start of frame notification to this driver,
call status_cb with USB_DC_SOF.
Signed-off-by: James Zipperer <jzipperer@fb.com>
Add an input driver to read data from an analog device, such as a
thumbstick, connected to an ADC channel, and report it as an input
device.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Add driver that based on RPI-PICO's PIO feature for ws2812.
This driver can handle WS2812 or compatible LED strips.
The single PIO node can handle up to 4 strips.
Any pins that can be configured for PIO can be used for strips.
I verified the samples/driver/led_ws2812 sample
working with WS2812(144 pcs) led strip using following patches.
- samples/drivers/led_ws2812/boards/rpi_pico.overlay
```
/ {
aliases {
led-strip = &ws2812;
};
};
&pinctrl {
ws2812_pio0_default: ws2812_pio0_default {
ws2812 {
pinmux = <PIO0_P21>;
};
};
};
&pio0 {
status = "okay";
pio-ws2812 {
compatible = "worldsemi,ws2812-rpi_pico-pio";
status = "okay";
pinctrl-0 = <&ws2812_pio0_default>;
pinctrl-names = "default";
bit-waveform = <3>, <3>, <4>;
ws2812: ws2812 {
status = "okay";
output-pin = <21>;
chain-length = <144>;
color-mapping = <LED_COLOR_ID_GREEN
LED_COLOR_ID_RED
LED_COLOR_ID_BLUE>;
reset-delay = <280>;
frequency = <800000>;
};
};
};
```
- samples/drivers/led_ws2812/boards/rpi_pico.conf
```
CONFIG_WS2812_STRIP_RPI_PICO_PIO=y
```
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Use proper register mask for software reset register so
reset magic value sent to device is not malformed.
Co-authored-by: Bartosz Bilas <b.bilas@grinn-global.com>
Signed-off-by: Lukasz Madej <l.madej@grinn-global.com>
While waiting for the UART to be ready in ISR
mode, for simulation only, add a tiny delay per
iteration of the busy wait loops to allow
time to pass.
This Z_SPIN_DELAY is an empty macro for any
other target than simulation.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Instead of getting the hardcoded address from the DT structure
use its symbolic name which will be resolved by the nRF HAL
definitions to the same value.
This allows the TIMER peripherals' addresses to be redefined
for the simulated targets.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
The ISR prototype is not matching the
signature for interrupt handlers, which results in
build warnings.
Let's fix it.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
For simulation, we cannot get the UART regiter address
for the pinctrl config structure from DT, as that
cannot match the one allocated at build time.
So let's override it at runtime with the correct address
which is stored in the UART config structure.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Instead of getting the hardcoded address from the DT structure
use its symbolic name which will be resolved by the nRF HAL
definitions to the same value.
This allows the GPIO peripherals' addresses to be redefined
for the simulated targets.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
The ISR prototype used when building without the
interrupt driven UART was not matching the
signature for interrupt handlers, which results in
build warnings.
Let's fix it.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Interrupt trigger type register each bit indicate the configured interrupt
type. bit value is 0 indicate level trigger interrupt, 1 indicate edge
trigger interrupt.
The level trigger defined to ~BIT(0) equal 0xfffffffe not equal 0.
Signed-off-by: Weiwei Guo <guoweiwei@syriusrobotics.com>
A Zero Length Packet can be used by higher layer stack to discover when
an endpoint is being processed by the host. An example of this was
introduced as part of 0127d000a2 ("usb: device: cdc_acm: Use ZLP to
detect initial host read") in the CDC ACM class.
Not invoking the callback for ZLPs results in the higher layer stack not
being informed when the packet is consumed. This manifests as a CDC ACM
USB-IP device that cannot transmit to the host while being able to
receive from the host.
Signed-off-by: Abe Kohandel <abe.kohandel@gmail.com>
Switch to using named IRQs as index-based access makes no guarantees about
devicetree interrupt order.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Switch to using named IRQs as index-based access makes no guarantees about
devicetree interrupt order.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Consistently use "int0" and "int1" as interrupt names for CAN controllers
based on the Bosch M_CAN IP core. This aligns with the upstream Linux
bindings.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
This commit partially reverts a change which was introduced in the
previous commit 5b9a0e5456.
usb_dc_ep_start_read() should also be called on transfer endpoints
like it has been before, otherwise the endpoint will not be armed
after it has been reconfigured.
Signed-off-by: Manuel Aebischer <manuel.aebischer@netmodule.com>
... so that it is possible to use a GPIO expander pin as the CS line.
Communication with the expander may involve an operation that cannot
be done from the interrupt context (e.g. an I2C transaction).
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
This is a follow-up to commit ea1be7f242.
After the driver performs its initialization, it needs to deactivate
the QSPI peripheral. Otherwise, the peripheral would unnecessarily
consume power until some QSPI operation is performed (and only then
it will get deactivated), what depending on the application may take
a significant amount of time.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
`release` is a mandatory method in the `struct spi_driver_api` API but
is not implemented in the SPI emulator. This can cause a test calling
`spi_release()` to segfault. Add a stub implementation that just returns
zero.
Signed-off-by: Tristan Honscheid <honscheid@google.com>
With commit 734adf52c6, the MCUX LPI2C config structure no longer
contains a direct base address pointer. The base address must be
accessed via DEVICE_MMIO_NAMED_GET. Some declarations in the LPCI2C
target mode handler still used the old method of accessing the base
address, causing a build failure. Fix these accesses to use the local
declaration of the "base" variable.
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
clangsa reports the error
mdio_nxp_enet.c:245:10: error: label at end of compound statement:
expected statement
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Added Kconfig assignment of qspi timeout.
Per nrfx v3.2 addition of qspi timeout in config
struct.
Signed-off-by: Kelly Helmut Lord <kellyhlord@gmail.com>
Introduce a new arch level Kconfig option to signal the implementation
of the RISCV Privileged ISA spec. This replaces
SOC_FAMILY_RISCV_PRIVILEGED, because this is not a SoC specific
property, nor a SoC family.
Note that the SoC family naming scheme will be fixed in upcoming
commits.
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
The controller can implement a reception FIFO as deep as 256 bytes.
However, the computation made by the driver code to determine how many
bytes can be asked is stored in a signed 8-bit variable called rx_empty.
If the reception FIFO depth is greater or equal to 128 bytes and the FIFO
is currently empty, the rx_empty value will be 128 (or more), which
stands for a negative value as the variable is signed.
Thus, the later code checking if the FIFO is full will run while it should
not and exit from the i2c_dw_data_ask() function too early.
This hangs the controller in an infinite loop of interrupt storm because
the interrupt flags are never cleared.
Storing the rx_empty empty on a signed 32-bit variable instead of a 8-bit
one solves the issue and is compliant with the controller hardware
specifications of a maximum FIFO depth of 256 bytes.
It has been agreed with upstream maintainers to change the type of the
variables tx_empty, rx_empty, cnt, rx_buffer_depth and tx_buffer_depth to
plain int because it is most effectively handled by the CPUs. Using 8-bit
or 16-bit variables had no meaning here.
Signed-off-by: Adrien Ricciardi <aricciardi@baylibre.com>
Add message buffer allowed values for S32K1xx devices. Except S32K14xW
parts which supports 64 MBs, the rest of the parts support a maximum of
32 MBs.
Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
The entire switch statement is already wrapped in a lock which is
acquired just before configuring the gpio pin.
Signed-off-by: Yuval Peress <peress@google.com>
Alarm interrupt is disabled in cancel_alarm, we should re-enable it
in set_alarm, at meanwhile, should reset the compare register in
cancel_alarm to avoid the contention condition in
cancel_alarm & set_alarm in short time.
This change fixes the test case failure at
zephyr\tests\drivers\counter\counter_basic_api.
Signed-off-by: Bryan Zhu <bzhu@ambiq.com>
The zephyr-gpio w1 driver introduced in this commit implements
all routines for the w1 api on top of the zephyr gpio driver.
W1 bit read, write, and reset operations are executed by
bit-banging the selected gpio.
Signed-off-by: Hudson C. Dalpra <hudson@bduncanltd.com>
Store the compile-time computed length of the `irq_count` into
a variable so that we have less to do in runtime.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Change the index variable type to `int` from `size_t` to compile
across 32bit and 64bit platforms without generating warnings.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Some STM32F4xx chips have an R division factor in PLL. Add possibility
to configure that.
Even though the output from the R division is not used, it can be
increased to reduce power consumption.
Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
This change adds support for enabling ethernet MAC hardware checksum
offloading for STM32H7 based devices.
In Section 58.5.9 of the STM32H7 reference manual it mentions that
the STM32H7 ethernet MAC supports a Checksum Offload Module (COE).
I have tested the changes on my end where I enabled
CONFIG_ETH_STM32_HW_CHECKSUM and ensured that an application that
runs Zephyr on the STM32H7 can interoperate with a device with a
completely different implementation. Also, I deliberately made
the software not populate the IPv4 and UDP header checksum fields
in their respective headers and the COE was able to populate the
IPv4 and UDP header checksums.
Given that CONFIG_ETH_STM32_HW_CHECKSUM is not enabled by default
application developers have the option to either enable it or
disable it.
Signed-off-by: Chamira Perera <chamira.perera@audinate.com>
Reduce code-complexity of stm32_clock_control_init() function, which is
used and exists for both M4/M7 cores.
Replace dublicated code by proper preprocessor guarding.
This change shall reduce code-errors and copy-paste errors since same
functional code is present only once now.
Identify even more common code
Signed-off-by: Alexander Kozhinov <ak.alexander.kozhinov@gmail.com>
Set suspended as initial power state, only when the
CONFIG_PM_DEVICE_RUNTIME config is enabled.
The initial state was incorrect, when CONFIG_PM_DEVICE=y and
CONFIG_PM_DEVICE_RUNTIME=n. In that case, the power state was SUSPENDED,
but the device was actually enabled.
Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
Updated API version enables multi-instance GPIOTE driver.
Additionally obsolete symbol that was used to specify
API version in the past was removed.
Affected drivers have been adjusted and appropriate changes
in affected files have been made.
Signed-off-by: Jakub Zymelka <jakub.zymelka@nordicsemi.no>
Like the stm32H5, stm32u5 usb device has an independent
power supply, but control bit is PWR_SVMCR_USV.
The control bit for the stm32H5 is PWR_USBSCR_USB33SV (no change)
Signed-off-by: Francois Ramu <francois.ramu@st.com>
In sys_clock_set_timeout(), input "ticks" is used to compute next
timeout point, Ambiq's STimer API used to sets next timeout has input
parameter as ui32Delta, which inside the API is using
"this value to add to the STimer counter and load into the comparator
register" according to its spec, thus the this delta clock is
almost equivalent to input "ticks"'s concept, and is not related to
last_count, it should be computed directly from input "ticks".
This correction fixes the test case failure at
zephyr\tests\kernel\tickless\tickless_concept.
Signed-off-by: Bryan Zhu <bzhu@ambiq.com>
Using SDL_DISPLAY_ZOOM_PCT would cause mouse pointer/touch input
to not click at the correct position.
Signed-off-by: Jakob Krantz <mail@jakobkrantz.se>
This change marks each instance of the 'spi_driver_api' as 'static const'.
The rationale is that 'spi_driver_api' is used for declaring internal
module interfaces and is not intended to be modified at runtime.
By using 'static const', we ensure immutability, leading to usage of only
.rodata and a reduction in the .data area.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
This change marks each instance of the 'api' as 'static const'.
The rationale is that 'api' is used for declaring internal
module interfaces and is not intended to be modified at runtime.
By using 'static const', we ensure immutability, leading to usage of only
.rodata and a reduction in the .data area.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Cache configured radio channel and apply them only when a relevant
radio task is requested.
This allows to configure the channel in the transmit metadata, thus
avoiding unneeded `nrf_802154` API calls in some scenarios.
Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
Signed-off-by: Jędrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
Remove `IEEE802154_SELECTIVE_TXPOWER` option.
Cache the tx power value in nRF5 driver and make use of it on each
operation.
Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
Signed-off-by: Jędrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
Rework the interrupt handlers of the FTM driver to support SoCs on
which FTM channels and overflow are routed through individual
interrupts, as opposed to a single OR'ed interrupt.
Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
Enable runtime mmio configuration in mcux_lpspi driver. The fsl_lpspi
driver relies on physical address to determine instance number.
So mmap flag 'K_MEM_DIRECT_MAP' is required.
Signed-off-by: Chekhov Ma <chekhov.ma@nxp.com>
Enable runtime mmio configuration in mcux_lpi2c driver. The fsl_lpi2c
driver relies on physical address to determine instance number.
So mmap flag 'K_MEM_DIRECT_MAP' is required.
Signed-off-by: Chekhov Ma <chekhov.ma@nxp.com>
Add return code to lpspi spi_mcux_transfer_next_packet and print the
kStatus_* return code since it information is lost when translated to
errno.
Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
Add a check to input_kbd_matrix_actual_key_mask_set() to return an error
if trying to change a key mask but the device does not define a keymask
in the first place.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
This fix adds the STM32L4P5xx to the list of devices that have an
offset-to-page shift calculation of 12 bits. Previously, the driver
would only shift the offset by 11 bits when calculating the page to
erase.
This would prevent the driver from erasing the correct page.
Signed-off-by: George Beckstein <george.beckstein@ampaworks.com>
Use LL_RTC_EnterInitMode and LL_RTC_DisableInitMode instead
of rtc_stm32_enter_initialization_mode and
rtc_stm32_leave_initialization_mode.
Signed-off-by: Petr Hlineny <development@hlineny.cz>
When device runtime pm is enabled, Backup Domain protection is active
most of the time. RTC driver need this protection to be disabled in
order to set the time or calibration. This fix disable the protection in
set time and set calibration functions.
Fixes: 62843
Signed-off-by: Petr Hlineny <development@hlineny.cz>
There can be a case where not all regulators are being used,
resulting in an unused-const-variable warning,
so let's add a __maybe_unused keyword to suppress it.
Signed-off-by: Bartosz Bilas <b.bilas@grinn-global.com>
This commit modifies the I2S driver to work for STM32H7
family of MCU's. Currently only TX is working.
Tested on nucleo_stm32h743zi. Requires dma1 & dmamux1 to be enabled.
Signed-off-by: Emil Lindqvist <emil@lindq.gr>
Fix issue #66806, caused by PR #65172.
Return -EINVAL from bt_spi_get_header if op is neither SPI_READ nor
SPI_WRITE.
Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
Current implementation of NXP mbox driver mbox_nxp_imx_mu
is using only one channel 0.
This commit adds support for multiple mbox channels as is
indented by mbox drivers.
Change done in .send api signaling mode leveraging provided
channel id to select correct General Purpose Interrupt.
Another change done in IRQHandler to check and handle all
channels.
Signed-off-by: Tomas Galbicka <tomas.galbicka@nxp.com>
The setting of initial state in handled by the common driver,
which calls the enable function for any regulator that has
regulator-boot-on set, and is not already enabled.
Signed-off-by: Andy Sinclair <andy.sinclair@nordicsemi.no>
When not using 4 channel capture, overflows were never reported
to the application, because the check was in the
four_channel_capture_support branch.
Signed-off-by: Fabian Pflug <fabian.pflug@grandcentrix.net>
Check the return values from the I2C API functions called in init() and
fail driver initialization if unsuccessful.
Fixes: #66827
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
The QCCID handler is Quectel specific and as such may not be part
of the modem cellular driver which only supports commands defined
in 3GPP TS 27.007
Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
The modem_cellular.c driver now uses a common script to get
signal strenght, which is run on demand. This is more efficient
than polling it, and simpler since every modem doesn't have to
define their own variant of the script.
Additionally, the CSQ handler now stores the "raw" rssi value
returned from AT+CSQ to be parsed by the cellular_modem_get_signal
implementation.
Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
Move the implementations of the cellular API in modem_cellular.c
to an cellular_driver_structure, and implement this API structure
withing the device drivers.
Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
In Passive Receive mode, ESP modem will buffer rx data.
This fix makes the data still available to user,
even though the peer has closed the socket.
Otherwise, user will fail to get the last rx data,
when the socket is closed by the peer.
Signed-off-by: Chun-Chieh Li <ccli8@nuvoton.com>
Don't execute `irq_enable` in process of the `ra_icu_irq_connect_dynamic`.
The caller of `ra_icu_irq_connect_dynamic` is only `gpio_ra_pin_configure`
at this time. `gpio_ra_pin_configure` calls `irq_enable` just after called
`ra_icu_irq_connect_dynamic`.
So removing 'irq_enable' from 'ra_icu_irq_connect_dynamic' has no effect
on behavior.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
DEVICE_MMIO_MAP() is an unnecessary process, so delete it.
I created uart_ra.c based on uart_rcar.c, but
I forgot to correct the name. I fixed it.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
Devices like the ATSAM series chips have retained registers
which are used to store memory. The memory is accessed just
like RAM, but since they are registers, their size and
address is used directly.
This commit adds a near complete copy of the generic retained
ram driver and bindings file, adding the reg property to
the bindings file, and updating the init macro in the driver
to use the reg address and size.
Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
Implement level based gpio interrupts, by using a worker queue to
repeatedly call the gpio callbacks until the gpio is no longer active.
Update unit test for new interrupts.
Bug #66401
Signed-off-by: Jeremy Bettis <jbettis@google.com>
Use #if instead of IS_ENABLED for
CONFIG_SOC_IT8XXX2_GPIO_GROUP_K_L_DEFAULT_PULL_DOWN, otherwise DTS files
are required to provide gpiok and gpiol even if they are not used.
Bug #66401
Signed-off-by: Jeremy Bettis <jbettis@google.com>
Similar to other ITE drivers, wrap register accesses in ECREG. This will
allow mocking out the registers in tests.
Bug #66401
Signed-off-by: Jeremy Bettis <jbettis@google.com>