A special SYS_INIT() callback with hardcoded PRE_KERNEL_1 level 0 priority
inside the STM32 pinctrl driver was configuring the SWD-JTAG ports on
STM32F1 series.
Since this is the only series which requires such configuration, move this
code to the SoC-specific init hook instead (which has almost the same
priority as PRE_KERNEL_1 level 0 - it runs just slightly earlier).
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
The CLOCK_CONTROL_NRF_K32SRC_RC_CALIBRATION calibration feature uses
HFCLK (hfxo in devicetree) as reference to calibrate the internal RC.
If the hfxo is not present, calibration is not possible, and if the
driver attempts to do it anyway, HFCLK will be requested wasting
power, and the calibration will never complete.
Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
integrate the mdio driver area into the
ethernet driver area. mdio itself is defined as part
of the ethernet specification.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Use official TDK Invensense driver for icm45686 sensor in tdk_hal module.
Supports icm456xx variants.
Signed-off-by: Remi Buisson <remi.buisson@tdk.com>
The drive mode validation added in commit ede19a4337 was rejecting
valid configurations for input pins. The validation ensures that
GPIO_SINGLE_ENDED and GPIO_LINE_OPEN_DRAIN flags match the hardware
capabilities of each MCP23xxx variant (push-pull vs open-drain).
However, this validation was applied to all pin configurations,
including input pins. Input pins do not have a drive mode, so
applications typically configure them without setting drive mode flags.
This caused the validation to incorrectly reject input pin configurations
with -ENOTSUP.
Fix by only validating drive mode flags when GPIO_OUTPUT is set.
Input pins now configure successfully, while output pins still receive
proper validation to ensure the requested drive mode matches the
hardware capabilities.
Fixes: ede19a4337 ("drivers: mcp23xxx: add support for open-drain ...")
Signed-off-by: Cliff Brake <cbrake@bec-systems.com>
This adds a driver for the interprocessor mailbox in the Raspberry Pi
Pico SoCs (RP2040/RP2350).
The SIO subsystem contains a set of low-latency peripherals, including a
pair of mailboxes (FIFOs) for inter-processor communication. One of the
FIFOs can only be written by core 0 and read by core 1, the other can
only be written by core 1 and read by core 0.
According to the datasheets [1] [2], the register interface is the
same in both SoCs and the only functional differences are that the
mailbox in the RP2040 is 8 entries deep vs 4 in the RP2350, and that the
RP2350 defines the same core-specific interrupt number, while the RP2040
defines two different IRQ numbers.
Tested on a Raspberry Pi Pico 2W (RP2350).
[1]: https://datasheets.raspberrypi.com/rp2350/rp2350-datasheet.pdf
[2]: https://datasheets.raspberrypi.com/rp2040/rp2040-datasheet.pdf
Signed-off-by: Ricardo Cañuelo Navarro <rcn@igalia.com>
This commit fixes the inconsistent type usage. Functions which
initialised i2c registers as uint16_t, changed to uint32_t to
match with register definition struct.
Signed-off-by: Sunil Hegde <s-hegde3@ti.com>
The driver used a decrement loop to check for time out during message
transfer, which was not sufficient. The newer implementation uses a
fixed time of 1000ms for timeout to be consistent with the Linux
kernel.
Signed-off-by: Sunil Hegde <s-hegde3@ti.com>
The driver was not correctly extracting FIFO byte counts
from the BUFSTAT register, causing multi-byte I2C transfers
to fail.
The BUFSTAT register layout is:
- Bits [13:8]: RX FIFO byte count
- Bits [5:0]: TX FIFO byte count
Also, the driver didnot update the remaining bytes after
each transfer which is fixed by decrementing the remaining
message length after each transfer.
This fix aligns the driver implementation with Linux.
Signed-off-by: Sunil Hegde <s-hegde3@ti.com>
Add support for secure TISCI communication paths to enable
message exchange with secure contexts on TI SoCs.
- Add secure header wrapping for outbound messages on secure path
- Add secure header parsing for inbound messages on secure path
Signed-off-by: Dave Joseph <d-joseph@ti.com>
- Add ti,is-secure device tree property to indicate secure host entities
- Add is_secure field in device config
Signed-off-by: Dave Joseph <d-joseph@ti.com>
- Add missing TISCI message type macros in tisci.h
- Clean macro organisation
- Add Secure indicator for message that require secure thread
Signed-off-by: Dave Joseph <d-joseph@ti.com>
HL7800 only supports restoring 1 socket on boot. This means,
only the first socket created can be restored.
This isn't very useful, so never restore sockets on boot.
The driver already handles recreating sockets when
low power modes are used.
Signed-off-by: Ryan Erickson <ryan.erickson@ezurio.com>
iface_status_work_cb() calls notify_all_tcp_sockets_closed() while
holding hl7800_lock(). The close-all path can re-enter hl7800 via
socket callbacks, causing a lock inversion deadlock.
Signed-off-by: Scott Coleman - wsl <scott@sjcdev.com>
TCP connect refused triggers +K**P_NOTIF ,5.
The current handler falls through to default, marks network_dropped,
and later closes all sockets, taking down unrelated
connections (e.g., MQTT).
Signed-off-by: Scott Coleman - wsl <scott@sjcdev.com>
The WWDG timeout check used a signed comparison between the requested
and computed timeout, causing valid configurations to be rejected when
the computed timeout was slightly lower than the requested one.
Replace the comparison by an absolute‑difference check so that the
configured timeout is accepted as long as it stays within the allowed
error margin.
This fixes spurious -EINVAL returned by install_timeout() on STM32.
Signed-off-by: Fabrice DJIATSA <fabrice.djiatsa-ext@st.com>
Add a hwinfo backend for GD32 providing:
- device unique ID readout from the 96-bit UID registers
- reset cause reporting via the RCU_RSTSCK reset status register
Reset cause mapping uses the hal_gigadevice RCU_RSTSCK flag definitions
and reports supported causes based on the macros available in the HAL.
Signed-off-by: Aleksandr Senin <al@meshium.net>
Correct a bitmask issue on the temperature alert threshold
as per the datasheet (Section 7.5.7.4.2).
Signed-off-by: Jeremy Thompson <jthompson@blackberry.com>
Add initial NB-NTN RAT support to the HL78xx driver:
* Enable RAT selection for NB-NTN (SET_RAT_NBNTN_CMD_LEGACY).
* Configure NTN positioning via +KNTNCFG("POS", provider, dynamic).
* Query +KNTNCFG at init and cache into modem_status.ntn_rat.
* Handle +KNTNEV:"POSREQ" and raise MODEM_HL78XX_EVENT_NTN_POSREQ.
* If MANUAL position source is enabled, push +KNTNCMD("POS") with
Kconfig-provided latitude/longitude/altitude.
* Kconfig updates:
- Add MODEM_HL78XX_ADDRESS_FAMILY_IP and default it for NB-NTN.
- Add NTN_MANUAL_{LATITUDE,LONGITUDE,ALTITUDE} under MANUAL source.
* For NB-NTN, program PDP context without explicit AF in +KCNXCFG and
use address family "IP".
* Extend socket connect and TLS handshake timeout ranges to 120 s to
tolerate higher RTT on NTN links.
Non-NTN builds keep previous behavior.
Signed-off-by: Zafer SEN <zafersn93@gmail.com>
Adds device power manager support to TMAG5273 driver.
Suspending the device will put it into its SLEEP mode, resuming will
restore it to the mode configured in devicetree.
Before communicating with a device in sleep mode, an extra I2C transfer
is needed. Something like this is briefly mentioned in the datasheet,
but without any more specific details. The wake up has also been added
to the init function, even in case PM is disabled.
The device is marked as busy for the whole sample_fetch function.
Signed-off-by: Marek Maškarinec <marek.maskarinec@hardwario.com>
LTE modems typically support default PDP context (cid 0) which
is activated when network is attached.
Allow driver to choose whether this CID 0 is used by default, and
skip the whole APN state.
Some modems require PDP context to be defined by AT+CGDCONT=1 command
but do not necessary need the APN name.
Add both options as a Devicetree settings as an enum value so that
specific DTS bindings may change the default while allowing user
to override. Booleans with "default: true" would not work.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
- Implement flash read, write and erase APIs.
- flash rows are automatically erased during Cy_Flash_WriteRow()
operation.
- Implement erase by writing the erased value (0xFF) to maintain
compatibility with the Zephyr flash API.i
Signed-off-by: Manojkumar Konisetty <manoj@aerlync.com>
Signed-off-by: Sayooj K Karun <sayooj@aerlync.com>
- Introduce FLASH_INFINEON_PSOC4 to enable the flash driver for the
Infineon PSoC4 family.
- This option selects required flash capabilities.
Signed-off-by: Manojkumar Konisetty <manoj@aerlync.com>
Signed-off-by: Sayooj K Karun <sayooj@aerlync.com>
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>
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>
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>