Series 2 EUSART and SiWx91x GSPI drivers were missing the
`iodev_submit` member from their API structs, leading to
null pointer dereference if CONFIG_SPI_RTIO was used.
Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
Exclude STM32F7 SoC series from PM support since that SoC doees not
yet manage power management in Zephyr and HAL API functions
LL_I2C_EnableWakeUpFromStop() and LL_I2C_DisableWakeUpFromStop()
are not implemented in the H7 HAL/LL drivers.
This change ports into the STM32 RTIO driver the change made in the
non-RTIO driver through commit 1804eb7bc3 ("drivers: i2c: stm32:
exclude stm32f7 family for PM").
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Drop few CONFIG_PM_DEVICE_RUNTIME guards, the pm_device_runtime
functions they are masking are no-op automatically when the
corresponding config option is not selected.
This change is related to the change made in the STM32 non-RTIO driver
trough commit 4f3523d9af ("i2c: stm32: drop few redundant guards").
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Always call pm_device_runtime_get() when registering a target
even if the device is not wakeup capable to prevent I2C target not being
function if the device goes into a SoC Stop mode.
This change ports into the STM32 v2 RTIO driver the change made in the
non-RTIO driver through commit 67f80e35b8 ("i2c: stm32: always call
runtime_get when registering targets").
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Build time configuration option to set TWT setup duration.
If AP does not respond to TWT setup request for this period,
STA will timeout and report setup failure.
Signed-off-by: Ajay Parida <ajay.parida@nordicsemi.no>
Added support for retrieving the regulatory domain information from
the siwx91x driver. Since the SDK does not provide a GET API for
region details, the driver now stores the country code and reuse
the configuration `sli_si91x_set_region_ap_request_t` to get the
channel information. This stored data is returned when a GET
operation is requested.
Signed-off-by: Arunmani Alagarsamy <arunmani.a@silabs.com>
Moved the `siwx91x_map_country_code_to_region()` function
from the Wi-Fi driver source file to nwp.c.
This change prepares the codebase for upcoming enhancements
related to the regulatory domain GET operation.
Signed-off-by: Arunmani Alagarsamy <arunmani.a@silabs.com>
Add support for configuring the regulatory domain (region code) to
ensure the device operates in compliance with local RF regulations.
The region must be set before the Wi-Fi interface becomes active
i.e., before scan or connection in STA mode, or before starting in
AP mode.
Since the SDK does not support setting the country code directly,
the driver maps country codes to region codes
Signed-off-by: Arunmani Alagarsamy <arunmani.a@silabs.com>
Move disks directory to disk to match with the naming of the driver
class. This only affects the recently introduced header for STM32 disk
drivers so it should be very low impact.
Signed-off-by: Daniel DeGrasse <ddegrasse@tenstorrent.com>
remove `select MDIO` from the
ethernet drivers, that don't directly use mdio
and only use the ethernet phy api, now that the
phys select MDIO
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
devices on a bus are recomended to
select its needed drivers, apply this to the eth phys
that need gpios, so that they just work by
enableing the device in the dts.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
devices on a bus are recomended to
select its protocol, apply this to the eth phys
on the mdio bus, so that they just work by
enableing the device in the dts.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
z_nxp_os_timer_ignore_timer_wakeup() was only added
when Standby mode was enabled. Move this function
out of the conditional section.
Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
As it's not being used anywhere in the driver. Moreover, the extra
unref would trigger a double-free assert (#94311); which is what
motivated this cleanup.
Signed-off-by: Luis Ubieda <luisf@croxel.com>
In order to allow the linker to place certain objects into external RAM,
e.g. heaps, adjust the memc initialization level to PRE_KERNEL_1, allowing
clock control and memc to come up before priority objects like heaps are
initialized.
Signed-off-by: Pete Johanson <pete.johanson@analog.com>
Determine event discardability after parsing the HCI header and require
at least one byte before reading the LE subevent. This removes a possible
OOB read on malformed/short LE Meta events. Also mark LE Extended
Advertising Report as discardable, matching legacy Advertising Report to
reduce RX pool pressure during heavy scanning.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
The TX flow control semaphore was initialized with a count of 1 and
released again after every bt_esp32_send() call. This broke the VHCI
flow control contract and could allow sending more packets than the
controller advertised.
This prevents host/controller overruns and ensures proper synchronization
with the ESP32 VHCI interface.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Fix a bug where if CONFIG_UART_ASYNC_API was enabled in the config, the
interrupt flags would get cleared after the interrupt driven API callback
finished executing, causing data loss if data happened to arrive after the
callback but before the flags were cleared.
Signed-off-by: Kamil Krzyżanowski <kamnxt@kamnxt.com>
This commit adds specific DMA configuration for STM32N6xx.
STM32N6xx uses GPDMA for SAI as STM32U5xx/U3xx/H5xx/H7RS etc.
In constrast to these series, STM32N6xx DMA requires a secure
and privileged channel.
Signed-off-by: Mario Paja <mariopaja@hotmail.com>
Add a workaround for `NRF53_ERRATA_159_ENABLE_WORKAROUND`
instead of simply printing an error and failing the transaction.
Signed-off-by: Anthony Williams <anthony289478@gmail.com>
Add device deinit function. Support is optional as it is not widely
used and it enables pinctrl sleep state so it impacts memory footprint.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
When PM or PM_DEVICE is enabled pinctrl sleep state is using for
device suspension. However, there are cases where power management is
not used but we still want to be able to put pins to sleep state, e.g.
device deinit.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Fix two issues with the SAI TX Stream.
1. Drain command does not release the last memory buffer
2. TX Stream status does not change to READY after STOPPING
Signed-off-by: Mario Paja <mariopaja@hotmail.com>
Issue: the alarm 1 do not generate interrupt
There are three compare registers in a SAM TC channel:
RA --> alarm 0
RB --> alarm 1
RC --> top_value
By default the RB/TOIB was configured as an input and no longer
generates interrupt.
Set the direction of TIOB to output for alarm 1 interrupt.
Fixeszephyrproject-rtos/zephyr#85018
Signed-off-by: CHEN Xing <xing.chen@microchip.com>
GPIO interrupts do not work on MCXA, MCXA has ICR register but feature
FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT value is 0, can't only use
this feature to support ICR. So adjust feature judgment.
Signed-off-by: Neil Chen <cheng.chen_1@nxp.com>
We can both optimize and clean up the code by using short circuit logic
and static variables instead of stack variables.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Refactor ISR by:
1) making a helper function to put the tickful calculation in, to reduce
an indentation level and cognitively separate this case while reading
2) Rewrite the calculations to simplify them. More info on that below.
Math changes:
- In the ISR, there was a variable called "now" which represented the
current cycle count of the timer. last_count was updated using a
calculation based on the number of elapsed ticks
and the hardware cycles per second value. However, this is
redundant because mathematically, this is equivalent to "now". So the
variable can just be set to now.
Proof is that the previous calculation was (in programming language):
(1) last_count = last_count + elapsed_ticks * CYC_PER_TICK
So let's rewrite this as the following to be clear about the different
values we are talking about here (in math language):
(2) count[t] = count[t-1] + elapsed_ticks * CYC_PER_TICK
We calculated elapsed ticks in the function as:
(3) elapsed_ticks = (now - last_count) / CYC_PER_TICK
(4) elapsed_ticks = (now - count[t-1]) / CYC_PER_TICK
Rearranging (2), we see
(5) elapsed_ticks = ( count[t] - count[t-1] ) / CYC_PER_TICK
Substituting this into (4), we get:
(6) ( count[t] - count[t-1] ) / CYC_PER_TICK =
(now - count[t-1]) / CYC_PER_TICK
Doing simple algebra, you can see we result with:
(7) count[t] = now
So therefore, we can simplify the programming expression to
(8) last_count = now
- The other change is regarding the calculation of the next tick match
value for tickful kernel mode. The previous calculation was doing:
(1) next = now + CYC_PER_TICK
We know that last_count is equivalent to now, at this point in the code
with the first change:
(2) next = last_count + CYC_PER_TICK
And then, for some reason, we are adding yet another CYC_PER_TICK to
next if (next - now) < MIN_DELAY. The reason for that I do not
understand, but let's write that down:
(3) next - now < MIN_DELAY
Now rewrite (2) as (4) and (3) as (5):
(4) count[t+1] = count[t] + CYC_PER_TICK
(5) count[t+1] - count[t] < MIN_DELAY
And now we substitute (4) into (5):
(6) count[t] + CYC_PER_TICK - count[t] < MIN_DELAY
And simplify:
(7) CYC_PER_TICK < MIN_DELAY
So actually no runtime calculations are needed here, this is a
hardcoding. The reason for this calculation I don't know, but we can
simplify the code.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
There are a couple places where effectively the exact same calculation
is done. Refactor to share code to do this calculation to make it easier
to read, and explode the code to multiple statements to be even easier
to follow the calculation. Compiler will likely optimize the same way
when opt enabled. Rename dticks variable to be more explicit what that
means (elapsed ticks).
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Refactor to remove nesting and consolidate lines of code.
I also ran clang format but that actually did not change very much in
addition to what I had already changed manually.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
1.Remove the code that sets the UTRIM register to 0,
because UTRIM is automatically loaded with a factory-trimmed
value, zeroing will affect the accuracy. Only need to clear
VREF UTRIM[TRIM2V1] at the initialization stage.
2. VREF does not have NXP_VREF_MODE_INTERNAL_REGULATOR mode,
the internal voltage regulator and chop oscillator are used
to suppress power supply noise and reduce voltage offset,
so remove the NXP_VREF_MODE_INTERNAL_REGULATOR mode.
there are only three modes in VREF, the first is the standby
mode (CSR[BUF21EN] = 0, CSR[HI_PWR_LV] = X), the second is
low power mode (CSR[BUF21EN] = 1, CSR[HI_PWR_LV] = 0), and
the third is high power mode (CSR[BUF21EN] = 1, CSR[HI_PWR_LV] = 1).
Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
RP2350 adds four more PWM slices from the eight available on RP2040,
which are only broken out to package pins on RP2350B. This change fixes
the driver to support the correct number of slices on RP2350.
Tested by confirming that PWM can correctly be configured on GPIO 44 of
RP2350B.
Signed-off-by: Peter Marheine <peter@taricorp.net>
Replace direct assignment of evt.evt_data with structured access via
espi_evt_data_pvt. This change separates the incoming evt_data into
type and data fields.
This update alse includes support for handling PVT, PVT2, and PVT3
events using the structured event data.
Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
For devices other than the stm32h745/747/755/757 that use
dual-core cortex-M4/cortex-M7, do not multiply flash
controller size by 2. Single-core stm32h7x devices define
their flash-controllers dtsi as a single area, not two banks.
Use the presence of the bank2-flash-size prop to determine if
this is a dual-core stm3h7x or not.
Signed-off-by: Rory Piper <rory.piper@signal-fire.com>
Introduce a new API function in the sdmmc_stm32 driver that allows
applications to access the Card Identification (CID) register of the
SD/MMC card. This functionality, already available in the SPI-based SD
and MMC subsystems, was previously missing from the STM32 SDMMC driver.
This enhancement enables use cases such as verifying the correct SD card
during manufacturing, ensuring that OEMs use the specified SD card, and
preventing mismatches.
Signed-off-by: Arthur Gay <arthur.gay@marshmallow.kids>
According to the STM32MP2 reference manual, the I2C controller uses
a single interrupt line for all events (EV + ERR), so the combined
interrupt must be enabled for the STM32MP2 series.
Signed-off-by: Tanguy Raufflet <tanguy.raufflet@savoirfairelinux.com>
The STM32MP2 series needs gpioz pinctrl support to be able to use
the GPIOZ pins.
Signed-off-by: Tanguy Raufflet <tanguy.raufflet@savoirfairelinux.com>