Update the IMSIC driver to use the renamed micsr_* indirect CSR
access functions instead of the old icsr_* names.
Signed-off-by: Afonso Oliveira <afonsoo@synopsys.com>
ataes132a_state is an array of CRYPTO_MAX_SESSION length.
This constant must be used when iterating over its elements
and not ATAES132A_AES_KEY_SIZE (even they having the same
value).
Signed-off-by: Flavio Ceolin <flavio@hubblenetwork.com>
The settings and calculations are often done in micro or nano seconds
and the result is not always shown. So, just add the period cycles as
part of the error message to get the calculated value.
Signed-off-by: Charles Hardin <ckhardin@gmail.com>
The interrupts should only be enabled after the START condition is set
by either writing to TWIHS_THR(for writes) or by writing TWIHS_CR_START
to TWIHS_CR. Otherwise, the TXCOMP interrupt may fire before the driver
is ready, causing invalid reads and the semaphore to deadlock.
Link: https://ww1.microchip.com/downloads/en/DeviceDoc/SAM-E70-S70-V70-V71-Family-Data-Sheet-DS60001527D.pdf
Signed-off-by: Alex Kar <github@alexkar598.dev>
In uart_stm32_async_rx_buf_rsp(), when the provided RX buffer is not
located in non-cacheable memory, the function would return -EFAULT
while still holding the IRQ lock acquired at the start of the critical
section. This causes a system deadlock as interrupts remain disabled
indefinitely.
The nocache validation check has been moved outside the critical
section to ensure proper error handling. The check is performed before
acquiring irq_lock(), maintaining the same validation behavior while
preventing the lock from being held during the early error return.
Fixes a bug where async UART RX operations with improperly
placed buffers would hang the system.
Signed-off-by: Miika Karanki <miika.karanki@vaisala.com>
Fix submit condition for non-control transfer. Do submit when any
of the following conditions is met:
1. Transfer buffer (net_buf) is full
2. Last packet size is less than mps
3. Isochronous transfer
USB mass may request C1 for sector size (512 bytes)-aligned and C2
for CBW (13 bytes).
Signed-off-by: Chun-Chieh Li <ccli8@nuvoton.com>
With USBD and HSUSBD re-organized, SoC must have USBD and HSUSBD at
the same time to pass compile. However, M2L31 just has USBD and meets
compile error with HSUSBD unsupported. To avoid adding too many
conditional (#if condition) code for the error, create one dummy
HSUSBD device definition for M2L31 to pass compile.
Signed-off-by: Chun-Chieh Li <ccli8@nuvoton.com>
For HSUSBD, Control transfer with Data OUT stage will break. This is
caused by FIFO flush which cannot be done timely even though in Setup
token interrupt handler. For this, error recovery with FIFO is not
done in Setup token/packet handler and rely on USB reset handler to do
it as catch-all.
Signed-off-by: Chun-Chieh Li <ccli8@nuvoton.com>
Some SoC series allow USB controller to be disabled temporarily
on unplug, and then enabled back on re-plug. Add support for such
configuration option in DT and UDC driver.
Signed-off-by: Chun-Chieh Li <ccli8@nuvoton.com>
Add support for center-aligned PWM mode in addition to the existing
edge-aligned mode. When center-aligned mode is configured, adjust
pulse and period cycles by dividing by 2 to maintain correct timing.
Add validation checks in PWM capture functionality to edge-aligned
mode only, as capture is not supported in center-aligned mode.
Assign the value directly to avoid re-calculating period_cycles
based on pwm_freq in TPM_SetupPwm, which could lead to precision loss.
Signed-off-by: Felix Wang <fei.wang_3@nxp.com>
Replace interrupt register checks with explicit capture_active flag
to track capture state. This provides more reliable state management
and fixes potential race conditions when checking if capture is active.
Also optimize TPM_SetupPwm call to only configure the specific channel
being set instead of all channels, improving efficiency.
Signed-off-by: Felix Wang <fei.wang_3@nxp.com>
The driver uses spinlocks for synchronization (due to strict timing
requirements) which makes it defacto incompatible with almost all SPI
backend drivers, as most of them use `k_sem_take` internally.
This change reworks the driver in the following way to solve this
problem:
- Replace driver locks with `k_mutex`
- Run the `load` functions on the system workqueue to execute them on
a cooperative priority
- Use additional local spinlock in the `bitbang` driver variant to ensure
precise timing
Signed-off-by: Martin Stumpf <finomnis@gmail.com>
The ICE40 driver uses a CS hack that effectively 'steals' the CS pin
from the SPI driver during `load` by setting the CS pin id to 0.
This triggered the newly introduced assert during gpio_set.
This change introduces a hotfix for this where, instead of setting the
CS pin to 0, it sets the entire CS to 'hardware based'.
It is still a hack and should be reworked at some point.
Signed-off-by: Martin Stumpf <finomnis@gmail.com>
When in pre-kernel, kernel objects may not be in a usable state.
Therefore, guard k_mutex_lock()/k_mutex_unlock() usage with
!k_is_pre_kernel().
Signed-off-by: Gatien Chevallier <gatien.chevallier@foss.st.com>
The driver was using EDAC_NXP_ERROR_INJECT instead of the correct
CONFIG_EDAC_NXP_ERROR_INJECT Kconfig symbol for conditional compilation.
Signed-off-by: Yves Wang <zhengjia.wang@nxp.com>
Move camera XCLK setup from DVP driver (POST_KERNEL) to esp_lcd_cam.c
(PRE_KERNEL_2) to ensure the image sensor receives clock before its
I2C initialization. This fixes a race condition where sensors like
ov2640 would fail to respond during probe because XCLK wasn't yet
configured.
Also adds timestamp to captured video buffers and removes a noisy
error log for set_selection when the source returns -ENOSYS.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
when pipe 1 or 2 is selected and parallel bus is chosen
HAL_DCMIPP_PARALLEL_SetConfig is failing, since it gets called twice
and driver is already in HAL_DCMIPP_STATE_READY state
Signed-off-by: Roman Pustobaiev <romanpustobayev@gmail.com>
Wifi chip module may depend on SDHC(SDIO) module.
Currnetly, default init. priority is
CONFIG_WIFI_INIT_PRIORITY(80) & CONFIG_SDHC_INIT_PRIORITY(85).
It causes the issue.
Signed-off-by: Kevin Chan <kevin.chan3@infineon.com>
Use SHELL_HELP macro for help strings to ensure consistency across
various shell modules and to save on flash usage.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Remove parts of the legacy implementation in eth_stm32_hal_common.c for
the loading of the MAC address when the device-tree is used. Use
net_eth_mac_load() for all these cases that were not destined for
production-ready products.
When cfg->mac_cfg.type == NET_ETH_MAC_DEFAULT, it means that neither
"zephyr,random-mac-address", "local-mac-address" or "nvmem-cells" were
used. For this case, keep the legacy property-less implementation to
avoid compilation errors and have a default, backward-compatible case.
Warning: this commit causes backward compatibility breakage for
implementations using "zephyr,random-mac-address" or "local-mac-address"
properties.
Signed-off-by: Gatien Chevallier <gatien.chevallier@foss.st.com>
Adds support for using MCUmgr over UART (not via shell) in a raw
mode which does not include base64 and other SMP over console
encoding
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Use SHELL_HELP macro for help strings to ensure consistency across
various shell modules and to save on code size.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Use SHELL_HELP macro for help strings to ensure consistency across
various shell modules and to save on code size.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Correct the behavior when printing interger menu values.
Current loop is not correct since it is waiting for a 0 value
to stop while for integer menu any value is possible.
Modify in order to loop until reaching the maximum number of
entries listed at the ctrl init time.
Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
"integer menu" ctrl type is longer than the 8 bytes long
typebuf hence rename the type into "int menu" and increase
the typebuf buffer in addition to increase alignment during
print of the ctrl values.
Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
curr_state is known to be false when reaching the STARTING state
check, making the explicit '!curr_state' condition redundant.
Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
Add a kconfig to be used as a flag for indicating if it supports 64b
ticks and another flag which will enable the 64b api. The kconfig
indicating that it supports 64b is a dependency of the kconfig that
will enable the api.
Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
Some counters, such as those that use fractional adders, tick at
resolutions greater than 4294967295Hz. This changes the freq in the common
info to a uint64_t. This adds a KConfig that can be selected by a driver.
This also has the counter ticks to sec (and vice versa) helper functions
call the get frequency for 64 bits if the kconfig is selected.
Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
__parse_ipv4_address() never reports errors and always returns 0.
The error check at the call site is therefore dead code.
Make the function void and drop the unused error handling.
Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
The return value variable was initialized but always overwritten
before being evaluated.
Remove the redundant initialization to simplify the code.
No functional change.
Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
There are currently two other sdhc drivers that support this interrupt:
Infineon and Ambiq. Both those vendor HALs automatically mask the
interrupt after invoking the callback[1][2], expecting the user to
unmask it asynchronously once they've cleared the card's interrupt
condition.
The NXP usdhc driver doesn't do this and so is inconsistent with the
other two. This has caused bugs with higher-level drivers, such as the
AIROC Wi-Fi driver (#101100). Fix the issue by masking the interrupt
ourselves.
[1] 470f874ce4/mtb-hal-cat1/source/cyhal_sdhc.c (L1251-L1260)
[2] 5efc022852/mcu/apollo510/hal/mcu/am_hal_sdhc.c (L2256)Fixes#101100
Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>
Moves clock selection/assignment from the clock driver to the
peripherals that subscribe to the clock. This allows multiple
devices such as PWM/Counters to share a peripheral clock.
Signed-off-by: John Batch <john.batch@infineon.com>
Adds making a peripheral clock connection to the initialization for
SDHC. Other updates to use the clk_dst field from the binding.
Signed-off-by: John Batch <john.batch@infineon.com>
Updates the Infineon Counter and PWM drivers based on the TCPWM device
to connect with a clock. This update allows multiple devices to connect
to the same peripheral clock, and supports the TCPWM architecture of the
PSC3 device family.
Corrects initialization of the PWM on the PSC3 family to select the
correct output type.
Signed-off-by: John Batch <john.batch@infineon.com>