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>