Add hal support for two Bee series SoCs: rtl87x2g & rtl8752h.
Signed-off-by: Zhiyuan Tang <zhiyuan_tang@realsil.com.cn>
Signed-off-by: Yuzhuo Liu <yuzhuo_liu@realsil.com.cn>
Use the new SPI FIFO related property to retrieve FIFO size (instead of
guessing it from the supported data width), and to check that the
TSIZE register is not written with a value that exceeds the maximal
supported transfer size.
Also reorder the spi_stm32_config structure to have better packing.
Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
Add two FIFO related properties for the st,stm32h7-spi bindings:
- Size of the FIFO
- Maximal size of the transfer when fifo-enable property is used
Also fill all dtsi files that require the new properties.
Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
For an asynchronous transfer, the driver was waiting until transfer was
ended to leave the transceive function, which defeated the purpose of
async. Restore previous behavior. The transfer is still blocking for
half duplex though.
Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
Add the fifo-enable property to the overlays with the st,stm32h7-spi
compatible so that they it is tested on test bench.
Also slightly increase the latency tolerance for Nucleo G071RB.
Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
This commit adds the support of the FIFO threshold for H7-compatible SPI.
This makes full use of the two FIFOs (Tx and Rx) available for these
devices, by packing the frames together in a single read or write when
possible, reducing the number of operations.
The FIFO threshold is supported only when fifo-enabled property is enabled
in device tree.
This new implementation is useful in interrupt mode at fast speed:
on Nucleo H753ZI, test_spi_complete_multiple_timed at fast speed indicates
a theoretical minimum duration of 27 µs, with a latency measurement of
18 µs for the new code against 34 µs previously, and a huge 76 µs when
fifo-enable is not present.
There are no noticeable changes at slow speed, or in polling or DMA mode.
Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
Until now, SPI DMA transfers were not possible for H7-compatible STM32
devices if the fifo-enable property was enabled.
This commit adds the support of this property with DMA usage.
Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
Move udc_stm32_clock_enable() and udc_stm32_clock_disable() above their
callers, grouped with other helper functions. This allows removing an ugly
forward declaration at the top of the driver.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
The (driver-internal!) function udc_stm32_ep_flush() was very short and
only called from one function. Inline its contents inside the caller.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
Move udc_stm32_lock(), udc_stm32_unlock() and udc_stm32_init() above all
other functions which implement callbacks of the UDC API (and are already
in the same order as the initializer for udc_stm32_api).
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
Move HAL_PCDEx_SetConnectionState with the other HAL callbacks
(except SETUP/DATA IN/DATA OUT) to make driver easier to browse.
Also move a relevant comment to a more appropriate place and update it.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
Move HAL callbacks for SETUP/DATA IN/DATA OUT events next to (above) the
lower half/worker thread handler for these events. This makes it easier to
follow the event handling logic.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
The macro `hpcd2data` is defined as a wrapper around CONTAINER_OF(), but
was also adding a `;` at the end which is not right.
Remove the trailing `;` in the macro's definition.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
Add a comment documenting why ordinals are used to create the per-instance
symbol names, as this is a very uncommon practice among STM32 drivers.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
The undefined Kconfig compliance check may report symbols as
undefined when the corresponding external module is not present.
This results in false positives, since such symbols are provided
only when the module is included in the workspace.
Exclude doc/develop/manifest/external from the grep search used by
the undefined Kconfig check.
This avoids extending UNDEF_KCONFIG_ALLOWLIST for optional external
modules while keeping the check strict for core Zephyr symbols.
Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
- Added sam_e54_xpro overlay file for gpio_hogs test project.
- Added sam_e54_xpro platform allow in testcase.yaml
Signed-off-by: farsin NASAR V A <farsin.nasarva@microchip.com>
Replace usage of atoi() with strtol() when parsing numeric values
from ES-WIFI AT command responses.
strtol() provides well-defined behavior and allows proper error
handling.
Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
The GPIO port test modifies the state of the entire port (gpio
controller) associated with the test pin (typically a LED).
Support running GPIO port tests on a port that is also used for
other functions by saving and restoring the output state of the
GPIO port between each testcase.
This is required on certain Silicon Labs boards where the LED
used for the test is on the same port as the GPIO used to enable
console output ("vcom enable"). If the port state isn't restored
after the test, subsequent console output isn't received by the
debugger.
Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
The `Z_GENLIST_LEN` macro declared the loop iterator `node` as
`static`. This causes the variable to be stored in the data segment,
shared across all invocations of the generated `sys_*_len` function.
This makes the function non-reentrant and unsafe in multi-threaded
environments. If an ISR or another thread calls the function
concurrently, the shared iterator state gets corrupted, leading to
incorrect results or infinite loops.
Removing the `static` keyword ensures `node` is allocated on the
stack, making the function thread-safe.
Signed-off-by: Hubert Feurstein <hubert.feurstein@stratum9.at>
Remove #if-defry for inclusion of functions definitions.
This change follows practices recommended in the zephyr-rtos
API Design Guide.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Improve the descriptions of the two STM32 FDCAN variants and add devicetree
node examples.
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
Use the IRONSIDE_SUPPORT_DIR cmake variable to determine the location
of the UICR generator script location, to allow overriding the location
if needed.
Since the CMake that would normally set this variable in
modules/hal_nordic/ironside/se/CMakeLists.txt is not actually run in the
gen_uicr image, refactor the logic for setting the variable so that it
can be included in the gen_uicr image directly.
Signed-off-by: Jonathan Nilsen <jonathan.nilsen@nordicsemi.no>
In Slave Half-Duplex TX mode, the driver disables SPE immediately
after loading data into DR, before the Master provides clock.
Since the Slave depends on the Master for clock, data is never
actually shifted out.
Fix by treating Slave Half-Duplex TX like SPI_HOLD_ON_CS: keep SPE
enabled after spi_write() returns, and let the application call
spi_release() once the Master has clocked out the data.
Tested on NUCLEO-F439ZI with SPI1 (master) and SPI3 (slave) in
half-duplex configuration.
Signed-off-by: PyoJin Yoon <volphin310@gmail.com>
Previously the name was only set when CONFIG_NET_L2_PPP_LOG_LEVEL >=
LOG_LEVEL_DBG. NET_ERR/NET_WRN in ipv6cp (and others) use fsm->name
as %s at any log level, which could pass NULL into the logger and
crash in cbprintf/strlen. Always assign the name so logging is safe.
Signed-off-by: Jani Hirsimäki <jani.hirsimaki@nordicsemi.no>
When calling `gpio_pin_configure` with GPIO_OUTPUT_INIT_LOW or
GPIO_OUTPUT_INIT_HIGH, it is expected from the driver to set initial
output state. The current driver implementation does not set this
user provided initial state.
This commit sets requested output state before changing channel mode
to output.
Signed-off-by: Stan Verschuuren <stverschuuren@gmail.com>
MAX14906 implementation of GPIO function `port_toggle_bits` writes
back old register value instead of inverted new value.
This commit XOR's current output state with requested pins (as expected)
and writes new value to register.
Signed-off-by: Stan Verschuuren <stverschuuren@gmail.com>
The MAX149x6 drivers do not implement the generic GPIO function
port_set_masked_raw. The current implementation therefore hard faults due
to dereferencing NULL ptr on calls to gpio_port_set_masked_raw.
This commit adds port_set_masked_raw for both MAX14906 and MAX14916.
Signed-off-by: Stan Verschuuren <stverschuuren@gmail.com>
The MAX14906 SetOUT register packs direction bits in [7:4] and output
state in [3:0]. The existing implementation clears all output bits
regardless of pin mask, as the mask is ANDed with 0xf0 before inversion.
This commit fixes that by masking before inverting.
Signed-off-by: Stan Verschuuren <stverschuuren@gmail.com>
The MAX14906 can be operated compliantly without directly controlling
EN/FAULT/SYNCH/READY ports. The MAX14906 DTS files already reflect this
optional nature.
This commit makes the driver treat these ports as optional without changing
the business logic of the driver. If these ports are not defined,
certain diagnostic logging calls are simply skipped over.
Signed-off-by: Stan Verschuuren <stverschuuren@gmail.com>
The MAX14906 (p36), MAX14915 (p26), and MAX14916 (p28) datasheets state
that the device includes A0,A1,ThrErr bits in CRC calculation. The existing
solution doesnt handle these bits.
This commit passes the 3 top bits of the SDO check byte to the CRC
function, making the CRC calculation datasheet compliant
Signed-off-by: Stan Verschuuren <stverschuuren@gmail.com>
Some implementations of the DesginWare I2C controller do not support the
system suspending to idle during an I2C transaction. Add a Kconfig
option to allow locking of the power management policy state during
I2C transactions.
Signed-off-by: Keith Short <keithshort@google.com>
xg24_rb4187c has an external SPI NOR flash in addition to the
internal flash. Disable the NOR flash to make the test run on
the internal flash.
Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
Refactored main function for Twister execution.
- Rewrote the main function as a class and divided it into smaller,
more maintainable methods.
- Improved code structure, making it easier
to test with unit and module tests.
- Reduced the amount of code in a single function,
enhancing readability and understanding
Signed-off-by: Lukasz Fundakowski <lukasz.fundakowski@nordicsemi.no>
Add board support for the Alif Ensemble E8 Development Kit
featuring the Enemble E8 SoC.
The Ensemble E8 SoC contains two Cortex-M55 CPU clusters: RTSS-HP
(High Performance, up to 400 MHz) and RTSS-HE (High Efficiency,
up to 160 MHz). Following the hardware model, each CPU cluster
is defined as a separate board target:
- ensemble_e8_dk/ae822fa0e5597ls0/rtss_hp
- ensemble_e8_dk/ae822fa0e5597ls0/rtss_he
Initial support includes UART for console output.
Link: https://alifsemi.com/support/kits/ensemble-e8devkit
Co-authored-by: Tanay Rami <tanay@alifsemi.com>
Co-authored-by: Prabhakar Kumar <prabhakar.kumar@alifsemi.com>
Signed-off-by: Silesh C V <silesh@alifsemi.com>
Add device tree nodes for ns16550 compatible uart instances common
to all Socs in the ensemble family. Additional uart instances available
on specific SoCs will be added in the corresponding SoC specific dtsi
file.
Signed-off-by: Silesh C V <silesh@alifsemi.com>
Add device tree include file for the Alif Ensemble E8 SoC
AE822FA0E5597LS0.
This dtsi defines resources specific to this SoC variant in
addition to the common peripheral definitions from ensemble_common.dtsi.
Signed-off-by: Silesh C V <silesh@alifsemi.com>