This commit adds the implementation for the display_set_orientation API
to the ST7796S display driver.
Currently, the driver lacks support for changing the display orientation
at runtime. This change implements the API to allow for hardware-based
rotation using the MADCTL register.
The implementation was tested on an `rd_rw612_bga` board with a 320x480
display using the ST7796S controller. The API now correctly handles
rotations to 0, 90, 180, and 270 degrees by configuring the MY, MX, and
MV bits of the MADCTL register.
Signed-off-by: Nilesh Vyas <nileshvyas1112@gmail.com>
When SPI spec is reconfigured, avoid reallocating another sm and properly
free the loaded sm programs before attempting to load new programs.
Fix#94416.
Signed-off-by: Terry Geng <terry@terriex.com>
TI MSPM0 has a TRNG module to generate truly random bits. Add a support
for TI MSPM0 TRNG module.
Signed-off-by: Sanjay Vallimanalan <sanjay@linumiz.com>
Enabled intel LPSS DMA interface using dw common to support
usage of internal DMA in LPSS SPI to transfer and
receive data.
Signed-off-by: Bindu S <bindu.s@intel.com>
Update the driver (supporting samx7x SOCs) to support sama7g5 MCAN.
Differences lists bellow:
| samx7x MCAN | sama7g5 MCAN |
----------|---------------------------------|----------------------------|
CAN core | the same | the same |
clock | peripheral clock with a divider | generic & peripheral clock |
Msg RAM | address configured by CCFG_CAN0 | in SRAM, configured by SFR |
Signed-off-by: Tony Han <tony.han@microchip.com>
'GMAC_QUEUE_NUM' is a value of 'num-queues' for the first GMAC
instance getting from the device tree. It is used directly or
indirectly (by GMAC_PRIORITY_QUEUE_NUM) for defining and
initializing 'struct eth_sam_dev_data' with a value from Kconfig
(GMAC_ACTIVE_PRIORITY_QUEUE_NUM).
As there will be a big change for applying the corresponding
num-queues for each GMAC 'struct eth_sam_dev_data', here just
keep it as is. Adding the BUITD_ASSERT to make sure the array
queue_list[] is large enough for all GMAC instances.
Signed-off-by: Tony Han <tony.han@microchip.com>
Add variable 'random_mac_addr' for 'zephyr,random-mac-address' from
device tree. Update generate_mac() to get random MAC address for each
GAMC interface with the 'zephyr,random-mac-address' property.
Signed-off-by: Tony Han <tony.han@microchip.com>
Deprecate the 'ETH_SAM_GMAC_MAC_I2C_EEPROM' for the 'mac-eeprom' option,
Limite it to be used when there's only one activated GMAC instance.
Signed-off-by: Tony Han <tony.han@microchip.com>
As jumbo frame size is not supported by the networking subsystem, only
max_frame_size 1518 and 1536 can be used. The Frame size 1536 would
allow for packets with a vlan tag, so enable GMAC_NCFGR_MAXFS when
NET_VLAN is configured.
Signed-off-by: Tony Han <tony.han@microchip.com>
To allow every interface be initialized properly when there are more than
one instance, remove the static variable "init_done" which is used to make
the initialize procedure only be done once.
Signed-off-by: Tony Han <tony.han@microchip.com>
Add variable "ref_clk_source" to get and set the source for the GMAC
reference clock from DT for different GMAC instances.
Signed-off-by: Tony Han <tony.han@microchip.com>
Add variable "phy_conn_type" to get and use the phy_connection_type from
DT for different GMAC instances.
Update the judgement on phy_connection_type for multi instances support.
Signed-off-by: Tony Han <tony.han@microchip.com>
Change the driver from support 1 instance to support multi instances.
Changes includes:
- irq_config()
- config & data definitions
- ETH_NET_DEVICE_DT_INST_DEFINE
- PTP content / init / DEVICE_DEFINE
Limitations:
- generate_mac() to be updated for supporting multi instances.
- the configurations in Kconfig.sam_gmac are used for all instances.
Signed-off-by: Tony Han <tony.han@microchip.com>
Changes includes:
- add the variable for num_queues to eth_sam_dev_cfg
- update LOG with dev->name to distinguish different instances
Signed-off-by: Tony Han <tony.han@microchip.com>
The lists optimized includes:
- RX descriptors list
- TX descriptors list
- RX buffer accounting list
- TX buffer accounting list
- TX frames accounting list
Signed-off-by: Tony Han <tony.han@microchip.com>
Adjust driver so that pinctrl property is not required in device
tree. Remove card init functions from driver init, as set_io()
function is meant to power cycle the card (if pin is used) and
initialize card clock and bit width. If card is not inserted
while driver init runs, init() will fail unreasonably, so
card init should take place at set_io() calls.
Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
The h2ram is an independent 4KB section. With default settings of
CONFIG_ESPI_PERIPHERAL_HOST_CMD_PARAM_PORT_NUM and
CONFIG_ESPI_PERIPHERAL_ACPI_SHM_REGION_PORT_NUM,
There is a 2KB gap that is unused. This change was made to make
unused gap can be reused by other modules to reduce overall RAM
usage.
Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
Enhanced the shim driver to raise Wi-Fi management events
when starting or stopping SoftAP, specifically in cases
where CONFIG_WIFI_NM_HOSTAPD_AP is disabled.
Signed-off-by: Qiankun Li <qiankun.li@nxp.com>
Fixed regression related to adc reference and adjusted to be
compatible with NXP K and MCX series.
Signed-off-by: Vinicius Carvalho <carvalho-vinicius@outlook.com>
Remove C code overrides of RX buffer counts and sizes when the TX path
is disabled. Move the reduced resource requirements into the Kconfig
default values. Default RX buffer sizes are not changed by the commit.
Fixes#92356
Signed-off-by: Jordan Yates <jordan@embeint.com>
Fix start/stop driver API implementation. OT stack expects these
functions to only put IEEE802.15.4 in sleep mode and back in RX
mode when calling start. Fixes ifconfig down/up cycling as well
as nodes staying in leader role and not forming a network.
Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
- **Fix session mutex handling:** Ensure the `mtls_sessions_lock` is
always released in `mtls_get_unused_session_index` on failure
to prevent deadlocks.
- **Protect `in_use` flag:** Added mutex protection when setting
`in_use = false` in free functions.
- **Cleanup on setup failure:** Added calls to `mbedtls_*_free()`
in `mtls_session_setup()` when key initialization fails.
- **Free logic fix:** Corrected `if/else` structure in
`mtls_session_free()` to ensure the correct context is freed.
Signed-off-by: Badr Bacem KAABIA <badrbacemkaabia@gmail.com>
Remove erroneous calculation of `apkt->pkt->out_len` in
`mtls_ccm_decrypt_auth` and `mtls_gcm_decrypt_auth`.
The output length should be handled by the caller or the
AEAD decryption process itself.
Signed-off-by: Badr Bacem KAABIA <badrbacemkaabia@gmail.com>
The smbus driver initialization priority was previously set to
`KERNEL_INIT_PRIORITY_DEFAULT` (which is 40). However, the default init
priority of devices is typically `KERNEL_INIT_PRIORITY_DEVICE` (which is
50).
Since the stm32 smbus driver uses a reference to the underlying i2c
device, and since this driver was not being built in CI, this led to the
discovery that the smbus driver was initialized too early.
```shell
ERROR: Device initialization priority validation failed, the sequence of \
initialization calls does not match the devicetree dependencies.
ERROR: /smbus1 <smbus_stm32_init> is initialized before its dependency \
/soc/i2c@40005400 <i2c_stm32_init> (POST_KERNEL+1 < POST_KERNEL+4)
```
By setting the initialization priority to `KERNEL_INIT_PRIORITY_DEVICE`,
both smbus1 and i2c1 have their priorities evaluated in the same group,
and it becomes possible to determine relative priorities via phandle
dependency.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
The previous method of deriving the local MAC address from the MCU's
Unique ID (UID) by slicing the last 3 bytes had two issues:
1. **Low Entropy:** Risk of address collision because only a small
portion of the UID was used, and this portion may not vary much.
2. **Offset Error:** An incorrect offset calculation could copy
non-intended bytes.
This commit resolves both issues by replacing the slice operation
with a **CRC-32 hash** over the **entire 16-byte UID**.
The lower 3 bytes (24 bits) of the resulting CRC-32 are used as the
local part of the MAC address, maximizing randomization and ensuring
a high probability of uniqueness across all devices.
Signed-off-by: Badr Bacem KAABIA <badrbacemkaabia@gmail.com>
Checking virtual range is incorrect because size + 1 addresses are
considered: size + starting address (that is also part of an
allocation). Hence the last address of the range is impossible to map
Signed-off-by: Wojciech Jablonski <wojciech.jablonski@intel.com>
During board bringup the spi interface was not working as expected
and the lna9250 driver should have errored early when the chip was
not detected and reset but ended up busy waiting on setup. So, this
will error out on the init path when the chip can not be reset at
the driver instance.
Signed-off-by: Charles Hardin <ckhardin@gmail.com>
Flash MSPI NOR driver already has support for flash page layout, but did
not select the Kconfig symbol indicating so. Add the selection so
drivers can use the page layout api.
Signed-off-by: Daniel DeGrasse <ddegrasse@tenstorrent.com>
Coverity reported an untrusted loop bound caused by a missing check on
the count value in ataes132a_send_command() for the response received
from the device. As per datasheet section 6.1, count should be at least
3 bytes (1 byte for count, and 2 bytes for the 16 bits CRC).
While I'm expecting this condition to be very rare, it doesn't hurt to
implement a proper checking and report an error if count<3.
Coverity CID: 434625
Signed-off-by: Loic Domaigne <tech@domaigne.com>
Fixes two critical bugs in the Fujitsu MB85RCxx I2C FRAM driver when
handling transfers that cross page boundaries:
Fixes incorrect write length: The mb85rcxx_write function was
incorrectly passing the total remaining length (len) to the
underlying I2C transfer instead of the page-limited length (len_in_page).
This resulted in I2C errors or data corruption when writing past a page
boundary.
Fixes buffer pointer update: Corrects the loop's buffer pointer
arithmetic in both mb85rcxx_read and mb85rcxx_write. The original
code used incorrect casting (*(char *)&buf += len_in_page;), leading
to a strict aliasing violation and potentially undefined behavior.
The pointer is now correctly advanced using explicit casting:
- mb85rcxx_read: buf = (char *)buf + len_in_page;
- mb85rcxx_write: buf = (const char *)buf + len_in_page;
Signed-off-by: Badr Bacem KAABIA <badrbacemkaabia@gmail.com>
Add note about PSM/eDRX modes to make it clear that off-load driver
still important when using in baterry powered devices.
Signed-off-by: BUDKE Gerson Fernando <gerson.budke@leica-geosystems.com>
The snprintk function returns the number of characters that *would have
been* written if the buffer was large enough. This means if the return
value `ret` is greater than or equal to the buffer size `strsize`, the
output was truncated.
The existing check `(strsize < ret)` was incorrect as it did not
handle the case where `ret == strsize` (output fits exactly, but no
room for null terminator) and did not check for negative return values
which indicate an encoding error.
This commit corrects the check to `(ret < 0 || ret >= strsize)` to
properly detect truncation and errors, returning -ENOMEM in these
cases. This fix is applied to `gnss_dump_nav_data`, `gnss_dump_time`,
and `gnss_dump_satellite` functions.
Signed-off-by: Badr Bacem KAABIA <badrbacemkaabia@gmail.com>
Fix typos in the driver instantiation macro, which leads to page_size
and timeout_erase defaulting to 0 regardless of whether the
devicetree instance has the read-only property or not.
DT_INST_NODE_PROP_OR() -> DT_INST_PROP_OR()
Signed-off-by: Liam Ogletree <liam.ogletree@cirrus.com>
Added check for continuous or gated bit clock. Now clock does
not stop if I2S_OPT_BIT_CLK_CONT is selected.
Signed-off-by: Imran Sajjad <imransajjad89@gmail.com>
Fix several issues related to the incremental CRC API usage:
1. Ensure the lock is not prematurely released in crc_set_config,
preventing semaphore double-release (over-giving).
2. Reset the flag_crc_updated state on all error paths to prevent
incorrect seeding in subsequent attempts.
Signed-off-by: Badr Bacem KAABIA <badrbacemkaabia@gmail.com>
Avoid calling the HAL_XSPIM_Config function if the app is running
from flash in order to avoid locking since HAL_XSPIM_Config is once
turning off each XSPI instance when performing the configuration.
Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
The PSRAM could well be plugged to the XSPI2 instead of XSPI1
hence allow configuration of the IOPort and avoid forcing the
ChipSelect in order to allow working on both XSPI1 or XSPI2.
Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
Avoid copying the whole XSPI_HandleTypeDef structure into the
init function and use a pointer since the structure is already part
of the _data structure.
Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>