Commit graph

24538 commits

Author SHA1 Message Date
Thao Luong
8bcfbf4d80 drivers: i2c: Add I2C driver support for Renesas RA8 devices
Add implemetation of I2C driver use IIC Master for Renesas RA8 devices

Signed-off-by: Ha Nguyen <ha.nguyen.fz@bp.renesas.com>
Signed-off-by: Thao Luong <thao.luong.uw@renesas.com>
Signed-off-by: Duy Phuong Hoang. Nguyen <duy.nguyen.xa@renesas.com>
2024-08-14 15:53:50 -05:00
Ryan Erickson
bbcf23e95e drivers: modem: cellular: hl7800 fix enter cmux
The OK response should be processed before entering CMUX mode.

Use UART ISR mode by default.

Fix warnings and errors produced by the sample.

Signed-off-by: Ryan Erickson <ryan.erickson@ezurio.com>
2024-08-14 15:51:04 -05:00
Alex Fabre
84889d4783 drivers: eth: fix stm32_hal PHY address resolution
When the PHY is hardware designed to communicate on address '1', the mdio
node of the device tree is labeled 'ethernet-phy@1'.
Therefore, STM32 HAL must adapt to resolve the appropriate DT node:
'ethernet_phy_1'.

Signed-off-by: Alex Fabre <alex.fabre@rtone.fr>
2024-08-14 15:50:24 -05:00
Pisit Sawangvonganan
e6ca8d9d12 modem: modem_cellular: streamline instance configuration with new macro
Introduced `MODEM_CELLULAR_DEFINE_INSTANCE` macro to streamline
the definition and initialization of modem cellular instances.

This macro enables passing parameters that vary among modems, including:
`power_pulse_duration_ms`, `reset_pulse_duration_ms`, `startup_time_ms`,
`shutdown_time_ms`, `autostarts`, `init_chat_script`, `dial_chat_script`
and `periodic_chat_script`.

This will reduce the number of redundant lines in the code, aiming for
improved maintainability.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-08-14 14:46:00 -04:00
Pisit Sawangvonganan
1f2c898788 modem: modem_cellular: consolidated user pipe data in to single macro
Introduced the `MODEM_CELLULAR_DEFINE_AND_INIT_USER_PIPES` macro to
consolidate multiple user pipe data definitions into a single macro call.

This will reduce the number of redundant lines in the code, aiming for
improved maintainability.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-08-14 14:46:00 -04:00
Nikodem Kastelik
022e81e8d2 drivers: retained_mem: nrf: implement using nrfx_ram_ctrl helper
Now retained_mem driver can utilize nrfx_ram_ctrl helper
for nRF devices. It provides abstraction over various RAM retention
peripherals like POWER, VMC or MEMCONF.

Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
2024-08-14 12:35:17 -04:00
Jordan Yates
a390f450ec sensor: voltage_divider: don't pulse enable pin
Don't pulse the enable pin on boot if the device is going to immediately
go into suspend mode via `zephyr,pm-device-runtime-auto`.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-08-14 12:34:45 -04:00
Charles Dias
0be1f31e16 drivers: video: stm32_dcmi: add set and get ctrl
Add set_ctrl and get_ctrl functions.

Signed-off-by: Charles Dias <charlesdias.cd@outlook.com>
2024-08-14 12:34:13 -04:00
Tahsin Mutlugun
99603e4c38 drivers: gpio: gpio_max32: Fix high-impedance setting
Put disconnected GPIOs to high impedance state by setting their
direction to input and pad control to none.

Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
2024-08-14 12:33:16 -04:00
Brett Witherspoon
a0f36d59b7 drivers: video: video_stm32_dcmi: Prevent out of bounds memory access
The frame event callback unconditionally copies into the enqueued video
buffer. The driver only supports fixed length frames, so reject enqueued
buffers that are not large enough to prevent invalid memory access.

Signed-off-by: Brett Witherspoon <brett@witherspoon.engineering>
2024-08-14 09:14:56 -04:00
Alberto Escolar Piedras
ad0fc3b5b1 drivers/bluetooth/userchan: Fix dependency
The driver can run in either native_posix or native_sim.
Let's make sure to set the dependencies acordingly.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-08-14 09:14:10 -04:00
Jun Lin
1aff275642 soc: npcx: scfg: select host interface type in global
The Host Interface Type in the DEVCNT register sets the HIF type
(either eSPI or LPC).
Currently, it is configured in the host-interface-related drivers like
eSPI or SHI. However, some I/O pads sourced from VHIF in the other
modules such as GPIO and I3C also rely on this field. It might be
problematic when using those I/Os without enabling eSPI or SHI drivers.
This commit moves the setting from the specific drivers to the global
system initialization function scfg_init().

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
2024-08-14 10:47:15 +01:00
Duy Nguyen
a95cade729 driver: serial: Convert Kconfig of renesas RA8 to rsource
Change Kconfig of renesas RA8 to rsource

Signed-off-by: Duy Nguyen <duy.nguyen.xa@renesas.com>
2024-08-14 10:46:27 +01:00
BH Li
2f40168287 drivers: adc: add ambiq adc driver
Add Ambiq adc driver

Signed-off-by: BH Li <bli@ambiq.com>
2024-08-14 10:45:47 +01:00
Reto Schneider
9aa2f5ffb0 drivers: serial: Add name to choice symbol
Add name to choice symbol, so that default value can be changed
downstream.

Developed-by: Andreas Rudolf <andreas.rudolf@husqvarnagroup.com>

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2024-08-14 09:40:34 +02:00
Pisit Sawangvonganan
c20126f950 drivers: serial: ns16550: apply __maybe_unused to ns16550_out,inword
Instead of disabling code with a specific compilation switch, enable it
and apply `__maybe_unused` in the `ns16550_outword` and `ns16550_inword`
functions to make the codebase cleaner.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-08-14 09:40:00 +02:00
Pisit Sawangvonganan
e868b6b49d drivers: serial: ns16550: fix typo
Correct the following typo in Kconfig and
the corresponding function.
- Kconfig.it8xxx2 from `BUADRATE` to `BAUDRATE`
- Correspoding function from `burdrate` to `baudrate`

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-08-14 09:40:00 +02:00
Charles Dias
1ed9eb6125 drivers: video: ov2640: fix vertical flip
Fix the vertical flip instruction into ov2640_set_vertical_flip
function.

Signed-off-by: Charles Dias <charlesdias.cd@outlook.com>
2024-08-14 09:38:39 +02:00
Krzysztof Gawryś
dfcc3b6db4 RP2040: clock control: support PLL On/Off
Simple improvement that adds control over SYS and USB PLLs in RPi Pico
(RP2040) MCU.

Signed-off-by: Krzysztof Gawryś <kgawrys@concisesoftware.com>
2024-08-13 18:29:03 -04:00
Murali Karicheri
7baf026adf drivers: flash: stm32h7: ignore STRBERR during flash write
When application code runs from M4 (resides on lower 896KiB of
the internal flash of bank2) and it does write to a block in
the upper 128KiB, write fails sometime (for example failed
1 out of 10 block write based on the tests) due to STRBERR.
As per technical reference manual section 4.7.4 of
STM32H745/755 SoC, application may ignore this error and
continue with write. So check for the flag and return okay
status for write(). Based on our tests, the application write
succeeds even when this error happens and match with document
description. So igoring this error flag is okay during write.

Signed-off-by: Murali Karicheri <murali.karicheri@sandc.com>
2024-08-13 18:19:41 -04:00
Flavio Ceolin
b9a0f0039f dma: emul: Fix pm action signature
The signature for dma_emul pm action callback is wrong.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-08-13 18:18:44 -04:00
Georgij Cernysiov
5246c16109 drivers: flash: stm32 ospi correct memory map return code
Use ENOTSUP instead of EIO to signal about not
supported configuration.

Signed-off-by: Georgij Cernysiov <geo.cgv@gmail.com>
2024-08-13 14:57:59 +02:00
Georgij Cernysiov
a1e39d0b64 drivers: flash: stm32 ospi reword memory map log output
Add more clarity to memory map log output.

Use LOG_DBG instead of LOG_INF to signal about
memory map mode being enabled.

Signed-off-by: Georgij Cernysiov <geo.cgv@gmail.com>
2024-08-13 14:57:59 +02:00
Georgij Cernysiov
f4b63f9644 drivers: flash: stm32 ospi extend memory map modes support
Extend memory map support to QUAD, DUAL, SPI modes.

Allow custom write opcode usage and SFDP:BFP read opcode.

Signed-off-by: Georgij Cernysiov <geo.cgv@gmail.com>
2024-08-13 14:57:59 +02:00
Armando Visconti
a47b88c09b drivers/sensor/st: iis2iclx: (fix) convert range into mg
Fix the sensor range setting at runtime which is currently returning error,
converting the SI (ms2) value passed thru SENSOR_ATTR_FULL_SCALE in mg (and
not in g) as this is the unit used in the driver internals.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2024-08-13 14:56:39 +02:00
Armando Visconti
c6f8d37056 drivers/sensor/st: iis2iclx: fix odr setting
Do not fail when requested rate passed in SENSOR_ATTR_SAMPLING_FREQUENCY
is not matching any of the odr values supported by sensor. Instead, round
it up to the next one.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2024-08-13 14:56:39 +02:00
Francois Ramu
48b84d2c65 drivers: counter: stm32 counter timer exclude stm32 devices without APB2
The STM32 devices like stm32F0/G0/C0 which have a f0-rcc compatible
does not have APB2 prescaler : do not try to set it.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-08-13 14:56:22 +02:00
Tim Lin
9bcf33bbc4 drivers/pinctrl: it8xxx2: Fix I2C5 pin leakage
When setting these pins as I2C alternate mode and then setting
GCR7 or func3-ext of GPIO extended, it will cause leakage.
In order to prevent leakage, it must be set to GPIO INPUT mode.

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2024-08-13 14:55:34 +02:00
Anke Xiao
7c7760f4cd drivers: counter: update counter_mcux_rtc.c
Set LPO 1KHZ clock for RTC if clock source 'LPO' is selected.
The frdm_ke17z512 has no 32KHZ OSC, the RTC clock comes from SOSC,
RTC_CLKIN, LPO 1KHZ. But usually the SOSC is connected with 8MHZ
oscilator, so only 1kHZ LPO is usable.
Update the nxp,kinetis-rtc.yaml to select RTC clock source.

Signed-off-by: Anke Xiao <anke.xiao@nxp.com>
2024-08-13 09:50:13 +01:00
Anke Xiao
9491e726ff drivers: pwm: update pwm_mcux_pwt.c
Skip period and pulse width capture configurations that
specific flags are not supported on ke17z.

Signed-off-by: Anke Xiao <anke.xiao@nxp.com>
2024-08-13 09:50:06 +01:00
Raffael Rostagno
cd27198727 intc: esp32c6: Fix for interrupt controller
Fixes repeated allocation of interrupt sources by successive calls
to esp_intr_alloc or esp_intr_enable for the same source.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2024-08-13 09:49:49 +01:00
Benjamin Gwin
47a0813561 drivers: serial: pl011: Fix ignored const qualifiers
When trying to build Zephyr with -Wignored-qualifiers this leads to a
compiler warning like:

zephyr/drivers/serial/uart_pl011_registers.h:40:1: error: type
qualifiers ignored on function return type [-Werror=ignored-qualifiers]

Since the return value is copied by the caller, making it const has no
effect and the compiler warns that this is being ignored. This enables
applications to build with additional compiler warnings turned on.

Signed-off-by: Benjamin Gwin <bgwin@google.com>
2024-08-12 19:25:34 -04:00
Armin Kessler
237c49acb8 drivers: dma: esp32: added support for multiple descriptors
Previously, configuring the GDMA was limited to a single descriptor,
restricting memory transfers to a maximum of 4kB.
This update introduces support for multiple descriptors, enabling users
to define multiple dma_blocks. The maximum number of descriptors can be
configured via the CONFIG_DMA_ESP32_DESCRIPTOR_NUM option.
Additionally, the dma_get_status() function now reports the index of the
currently processed descriptor
through the status.read_position and status.write_position fields.

Signed-off-by: Armin Kessler <ake@espros.com>
2024-08-12 19:23:38 -04:00
Manuel Argüelles
2786cb9512 drivers: intc: gic: implement set pending interrupt
Implement a function to set pending interrupts for Arm GIC.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2024-08-12 15:54:42 +02:00
Jan Peters
b8bef42add device_dt_metadata: handle dt_meta being NULL
Using  DEVICE_DEFINE, a device without a corresponding DT node can be
defined (for example CRYPTO_MTLS), Z_DEVICE_INIT() does not initialize
dt_meta for such devices, leaving the field as NULL.
device_get_dt_nodelabels() and functions calling it have to handle
dev->dt_meta == NULL to prevent fatal errors.

Signed-off-by: Jan Peters <peters@kt-elektronik.de>
2024-08-12 15:54:22 +02:00
Teresa Zepeda Ventura
403d0d6045 drivers: pinctrl: gecko: add support for a single usart
Added support for SoCs with a single usart

Signed-off-by: Teresa Zepeda Ventura <teresa.zvent@gmail.com>
2024-08-12 15:14:56 +02:00
Manuel Argüelles
c27a8e158a drivers: counter: nxp_sys_timer: support late and short alarms
Support short relative and late alarms for NXP System Timer Module
counter driver. The late alarm detection algorithm applied, is based on
existing counter drivers.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2024-08-12 15:14:34 +02:00
Gerard Marull-Paretas
f463e6d88a soc: nordic: pinctrl: rework nordic,clock-enable
Instead of forcing users to provide this setting, allow to describe
which signals require CLOCKPIN enablement at device nodes. This is later
captured by the pinctrl macros and applied in the pinctrl driver. Note
that name has been adjusted to nordic,clockpin-enable to avoid confusion
with clock related settings.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-08-12 12:58:58 +02:00
Krzysztof Chruściński
04a930fe74 drivers: serial: nrfx_uarte: Optimize code size
Code size can significantly reduced (220 bytes per instance) if data
structure (stored in RAM) is not initilized (can be moved to .bss).
Data for asynchronous API had two fields which can easily be moved
to the configuration structure (which is in ROM) because they do not
change duing runtime.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-08-12 12:44:02 +02:00
Krzysztof Chruściński
78ba6082d9 drivers: serial: nrfx_uarte: Optimize static peripheral configuration
When runtime configuration is not enable then we can determine at
compile time what are the hardware settings. Function which
translates zephyr values to nRF register values is not needed as
macros can do that at compile time.

This optimization saves almost 400 bytes of code.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-08-12 12:44:02 +02:00
Jiafei Pan
f498644106 drivers: eth: phy: add AR8031 PHY driver
Add PHY driver support for Qualcomm AR8031, it can use fixed link
or use auto negotiation.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2024-08-12 12:43:54 +02:00
Fin Maaß
e6235f49a7 drivers: ethernet: eth_xmc4xxx: fix get_phy
This fixes the eth_xmc4xxx_get_phy function.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-08-12 12:43:24 +02:00
Alberto Escolar Piedras
ee08327b4c Bluetooth: drivers: userchan: Fix gcc 13 overflow warning
gcc 13 produces a build warning (see below), as it seems to
believe the number of read bytes may overflow the frame_size
type.
Let's increase the frame_size bitwidth to avoid this.
(Any 32bit type, signed or unsigned, avoids this warning)

The build warning:
```
In file included from /usr/include/features.h:502,
                 from bits/libc-header-start.h:33,
                 from /usr/include/stdint.h:26,
                 from include/stdint.h:9,
                 from zephyr/include/zephyr/types.h:11,
                 from zephyr/include/zephyr/kernel_includes.h:21,
                 from zephyr/include/zephyr/kernel.h:17,
                 from zephyr/drivers/bluetooth/hci/userchan.c:9:
In function ‘read’,
    inlined from ‘rx_thread’ at drivers/bluetooth/hci/userchan.c:201:9:
/usr/include/i386-linux-gnu/bits/unistd.h:28:10: warning: ‘__read_alias’
specified size between 4294902273 and 4294967295 exceeds maximum object
size 2147483647
[-Wstringop-overflow=]
   28 |   return __glibc_fortify (read, __nbytes, sizeof (char),
      |          ^~~~~~~~~~~~~~~
drivers/bluetooth/hci/userchan.c: In function ‘rx_thread’:
drivers/bluetooth/hci/userchan.c:187:32: note: destination object allocated
  here
  187 |                 static uint8_t frame[512];
      |                                ^~~~~
/usr/include/i386-linux-gnu/bits/unistd-decl.h:29:16: note: in a call to
  function
‘__read_alias’ declared with attribute ‘access (write_only, 2, 3)’
   29 | extern ssize_t __REDIRECT_FORTIFY (__read_alias, (int __fd, void
      |                ^~~~~~~~~~~~~~~~~~
```

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-08-12 12:43:01 +02:00
Giancarlo Stasi
2f8af56042 drivers: console: rtt_console: use Segger recommended write API
Use recommended write API that internally locks RTT usage and checks
if the RTTcontrol block initialization is done.

Signed-off-by: Giancarlo Stasi <giancarlo.stasi.co@gmail.com>
2024-08-12 10:14:34 +02:00
Yong Cong Sin
d6e0b43006 drivers: intc: plic: print ISR(ARG) in shell cmd
Print the ISR & its ARG along with the IRQ and Hits in
`plic stats get <intc>` command, i.e.

```CONFIG_SYMTAB=n
uart:~$ plic stats get interrupt-controller@c000000
   IRQ        Hits	ISR(ARG)
    10         541	0x800054ee(0x80008170)
```

```CONFIG_SYMTAB=y
uart:~$ plic stats get interrupt-controller@c000000
   IRQ        Hits	ISR(ARG)
    10         114	uart_ns16550_isr(0x80008230)
```

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-08-12 10:10:57 +02:00
Furkan Akkiz
a6ae4f9221 drivers: watchdog: Add watchdog driver for MAX32xxx MCUs
Added watchdog driver for MAX32xxx MCUs

Signed-off-by: Furkan Akkiz <hasanfurkan.akkiz@analog.com>
Co-authored-by: Mert Vatansever <Mert.Vatansever@analog.com>
Co-authored-by: Sadik Ozer <sadik.ozer@analog.com>
2024-08-11 19:18:56 -05:00
Richard Wheatley
5ab83d8fee drivers: spi: remove old ambiq mspi
Remove the old Ambiq MSPI

Signed-off-by: Richard Wheatley <richard.wheatley@ambiq.com>
2024-08-11 19:18:09 -05:00
Richard Wheatley
188fc58c72 drivers: update AMBIQ drivers to use proper base address
REG_X_BASEADDR will be removed from all hal files.
This forces the use of the peripheral base address
Define MSPI_PORT macro for chip drivers

Signed-off-by: Richard Wheatley <richard.wheatley@ambiq.com>
2024-08-11 19:18:09 -05:00
Raffael Rostagno
3dc2e83c7a usb: esp32c6: Add support for USB serial port
Device tree configuration for USB serial node and clock control
fix for proper device initialization.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2024-08-11 19:16:35 -05:00
Richard Wheatley
0a945cbdec drivers: rtc: add ambiq rtc driver
Add Ambiq RTC driver

Signed-off-by: Richard Wheatley <richard.wheatley@ambiq.com>
2024-08-09 17:58:35 +01:00