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>