Commit graph

23353 commits

Author SHA1 Message Date
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
Lasse Fröhner
710c89ed11 fix: initialize gpio_keys input from pin state
Some kind of race condition caused the gpio_keys input module to
occasionally miss an event after boot. This is fixed by initializing the
pin state variable in the input_gpio_keys module.

Related to https://github.com/starcopter/bms-firmware/issues/6

Signed-off-by: Lasse Fröhner <lasse@starcopter.com>
2024-08-09 17:58:16 +01:00
Yuval Peress
690134356c i2c_emul: Add support for CONFIG_I2C_TARGET_BUFFER_MODE
Add emulation and test to support the buffered target mode.

Signed-off-by: Yuval Peress <peress@google.com>
2024-08-09 08:40:51 -04:00
Yuval Peress
c394b2e6f8 test: Add i2c emulation for targets
Update i2c_emul.c to support i2c_target_register and i2c_target_unregister
function calls as well as support address forwarding in emulation.
Address forwarding helps us test IPCs in native sim. Instead of having to
emulate 2 separate cores, we can forward read/write requests from one bus
to another bus (effectively creating a loop). This way the same image can
simulate both the controller and the target.

Signed-off-by: Yuval Peress <peress@google.com>
2024-08-09 08:40:51 -04:00
Armin Brauns
ede19a4337 drivers: mcp23xxx: add support for open-drain chip variants
Pin definitions should correctly reflect the actual drive mode of the GPIO
controller, either push-pull or open drain.

Signed-off-by: Armin Brauns <armin.brauns@embedded-solutions.at>
2024-08-09 09:55:30 +02:00
Armin Brauns
054cc09c88 drivers: add bindings for all existing mcp23xxx variants
This allows getting rid of the ngpios property, which is implicit in the
part number. It also prepares for configuring pins as open-drain on
supporting chips in the next commit.

Signed-off-by: Armin Brauns <armin.brauns@embedded-solutions.at>
2024-08-09 09:55:30 +02:00
Armin Brauns
75b3bf5b6c drivers: remove legacy mcp23s17 driver
This chip is handled by the more generic mcp23xxx driver, which will get a
microchip,mcp23s17 compatible binding in the next commit.

Signed-off-by: Armin Brauns <armin.brauns@embedded-solutions.at>
2024-08-09 09:55:30 +02:00
Juliane Schulze
932306a6e5 drivers: vcnl36825t: fix power consumption issues
- apply correct order to suspend/resume when using continuous mode
- unset LPEN (low-power-enable) bit on suspend (causing excessive
  current draw)
- fix a starting issue which lead to higher power consumption

Signed-off-by: Juliane Schulze <juliane.schulze@deveritec.com>
2024-08-09 09:55:07 +02:00
Robin Carrupt
80aa24ad95 sensor/ntc_thermistor: Corrected the type of adc values to accept 16 bits
The NTC thermistor sensor in drivers/sensor/ntc_thermistor/ntc_thermistor.c
cannot work with a 16-bit ADC.
The voltage becomes negative if the ADC raw value is 0x8000 or higher.

To correct this, I changed the types in the
ntc_thermistor_data struct from int16_t to int32_t.

This also corrects a potential problem at line 53
where we transform an int16_t into an int32_t.

Fixes: #75203
Signed-off-by: Robin Carrupt <robincarrupt@gmail.com>
2024-08-09 09:54:43 +02:00
Lukasz Majewski
b0e0bbfe5d drivers: ethernet: tc6: Combine read chunks into continuous net buffer
Up till now the size of net buffer chunk was set to only 64B. This
approach was acceptable for IPv4 support as all headers would fit into
64B of allocated continuous memory.

With enabled support for IPv6 one would observe following errors when
Neighbor Discovery [ND] is performed:

net_pkt: Uncontiguous data cannot be linearized
net_ipv6_nd: DROP: NULL NA header
net_icmpv6: ICMPv6 handling failure (-5)

As some IPv6 headers span on multiple 64B net_pkt buffer instances.

To fix this error - the received chunks are stored to large enough single
net_pkt buffer fragment.

Signed-off-by: Stefan Bigler <linux@bigler.io>
Signed-off-by: Lukasz Majewski <lukma@denx.de>
2024-08-08 20:21:58 -04:00
Stefan Bigler
52a35edb49 drivers: ethernet: Continue transmission when setting mac or promisc mode
To change mac or enable/disable promiscous mode transmit/receive does not
need to be disabled.
Disabling and enabling again leads to not transmitting anything afterwards.

Signed-off-by: Stefan Bigler <linux@bigler.io>
Signed-off-by: Lukasz Majewski <lukma@denx.de>
2024-08-08 20:21:58 -04:00
Stefan Bigler
fef277af42 drivers: ethernet: lan865x: Enable all multicast MAC addr for IPv6
Up till now the configuration of LAN865x was NOT allowing any
multicast frames to be received.

However, those are required for correct handling of IPv6's Neighbor
Discovery [ND] protocol.

This patch - by setting all bits in hash enable register - allows
all muticast MAC addresses to be recived.

Of course - more granular approach to specify set of addresses to
be allowed would be better and will be added in the future.

Signed-off-by: Stefan Bigler <linux@bigler.io>
[Cleanup + modified comment]
Signed-off-by: Lukasz Majewski <lukma@denx.de>
2024-08-08 20:21:58 -04:00
Lukasz Majewski
155fa2e9c9 drivers: ethernet: tc6: Add comment regarding RFA bit set in OA_CONFIG0
Add extra information regarding the case when ZAREFE (0b01) combination
is set for RFA in OA_CONFIG0 register.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2024-08-08 20:21:58 -04:00
Lukasz Majewski
209093d28e drivers: ethernet: lan865x: Update SPEC_ADD1_BOTTOM register comment
The current commit required some clarification.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2024-08-08 20:21:58 -04:00
Ricardo Rivera-Matos
b5a5bddf60 haptics: Introduces support for DRV2605 Haptic Driver
Adds support for the DRV2605 haptic driver.

Signed-off-by: Ricardo Rivera-Matos <rriveram@opensource.cirrus.com>
2024-08-08 15:57:12 +02:00
Ricardo Rivera-Matos
977c70a6c0 haptics: Introduces a haptics API
Introduces a haptics API for use with LRA driver ICs to
create haptic feedback events.

Signed-off-by: Ricardo Rivera-Matos <ricardo.rivera-matos@cirrus.com>
2024-08-08 15:57:12 +02:00
Tomi Fontanilles
2249b87b5e drivers: hwinfo: add the HWINFO_HAS_DRIVER Kconfig option
Introduce a Kconfig option to signal whether a HW info driver is
available when HWINFO is enabled.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-08-08 15:37:40 +02:00
Jordan Yates
5d87cd654f sdhc: sdhc_spi: compile-time determine if sdhc_ones needed
Use the new `SPI_MOSI_OVERRUN_DT` macro to determine at compile-time
whether the 512 byte array of `sdhc_ones` is required.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-08-08 06:17:45 -04:00
Pisit Sawangvonganan
dcd0a2756d drivers: spi: remove '&' when assigning init_fn
Remove address-of operator ('&') when assigning `init_fn`
function pointer in `DEVICE_DT_INST_DEFINE` macro.

This change aims to maintain consistency among the drivers in
`drivers/spi`, ensuring that all function pointer assignments
follow the same pattern.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-08-08 06:08:04 -04:00
Dino Li
c3a4a1a0f6 drivers: intc_ite_it8xxx2: disable debug mode then reset for tests
After flashed EC image, we needed to manually press the reset button
on it8xxx2_evb. Now, without pressing the button, we can disable
debug mode and trigger a watchdog hard reset for running tests.

After flash EC, running below tests can pass (without pressing the button):
west build -p always -b it8xxx2_evb tests/drivers/watchdog/wdt_basic_api
west build -p always -b it8xxx2_evb tests/kernel/timer/timer_api
west build -p always -b it8xxx2_evb tests/kernel/fatal/exception

Signed-off-by: Dino Li <Dino.Li@ite.com.tw>
Signed-off-by: Ruibin Chang <Ruibin.Chang@ite.com.tw>
2024-08-08 06:07:35 -04:00
Richard Wheatley
4af3d1005b drivers: pinctrl: updated to add interrupt direction
Updated to add pinctrl interrupt direction

Signed-off-by: Richard Wheatley <richard.wheatley@ambiq.com>
2024-08-08 06:06:21 -04:00
Benedikt Schmidt
f8399bd773 drivers: flash: implement RDP for STM32F7
Implement the readout protection for the STM32F7 series.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-08-07 19:02:49 -04:00
Benedikt Schmidt
db2261b6f5 drivers: flash: reduce redundancy in RDP implementation on STM32
Reduce the redundancy in the readout protection implementation
on STM32 MCUs.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-08-07 19:02:49 -04:00
Alvis Sun
421ca39cf0 divers: clock_control: npcx: HFCBCD3 in CDCG is only available in npcx4
As title.

Signed-off-by: Alvis Sun <yfsun@nuvoton.com>
2024-08-07 19:01:18 -04:00
Maochen Wang
4c2ce36e6f drivers: wifi: Add NXP wifi shim driver support
Add NXP wifi shim driver code.

Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
2024-08-07 07:17:23 -04:00
Felipe Neves
af91d06b00 drivers: mbox: mbox_esp32: add support for esp32 MBOX driver
as an alternative for IPM driver.

Signed-off-by: Felipe Neves <ryukokki.felipe@gmail.com>
2024-08-07 07:17:01 -04:00
Duy Phuong Hoang. Nguyen
0c93268e52 driver: clock: Update clock control driver for RA8
This update is to support clock API for RA8
Move the clock initialize function into clock driver
Peripheral clock now has 2 more property in clock cell for enable
and disable clock to peripheral module

Signed-off-by: Duy Phuong Hoang. Nguyen <duy.nguyen.xa@renesas.com>
2024-08-07 07:16:45 -04:00
Yiding Jia
eb351436ad drivers: pinctrl: rp2040: oe-override option
This change adds the device tree property for specifying oe-override
(output-enable override behavior), as well as defines for possible values
of the property.

RP2040 GPIOs can be configured to automatically invert the output-enable
signal from the selected peripheral function. This is useful for tasks like
writing efficient PIO code, such as in the i2c example in the rp2040
datasheet.


Signed-off-by: Yiding Jia <yiding.jia@gmail.com>
2024-08-07 07:16:28 -04:00
Derek Snell
200a669dd2 drivers: display: display_mcux_elcdif: Add PXP flip feature
display_write() can leverage PXP to flip the image.

Signed-off-by: Derek Snell <derek.snell@nxp.com>
2024-08-07 07:14:20 -04:00
Derek Snell
2b601fa3a0 drivers: dma: dma_mcux_pxp: Add flip feature
PXP can flip an image in input buffer horizontally, vertically, or both.

Signed-off-by: Derek Snell <derek.snell@nxp.com>
2024-08-07 07:14:20 -04:00
Konrad Sikora
f3af39b4d7 drivers: sensor: Fix DHT20 build failure with CRC configured
Fixes the build error: 'crc' undeclared for
DHT20 sensor with CONFIG_DHT20_CRC option enabled.

Signed-off-by: Konrad Sikora <kontakt@konradsikora.pl>
2024-08-07 07:14:11 -04:00
Ryan McClelland
e12602ae02 i3c: drivers: check for reserved addresses for i2c scan
According to 5.1.2.2.5 I3C Target Address Restrictions in the I3C
v1.1.1 specification. Certain addresses are not allowed. These are
all marked as reserved in the address map. Print "RS" if they are
reserved and skipped.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-08-07 07:13:42 -04:00
Chaitanya Tata
bf4d8cc2cc drivers: wifi: nrf: Fix build error in utils
When Wi-Fi utils is enabled it causes build error due to missing rename
in a couple of places.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-08-07 07:13:27 -04:00
Chaitanya Tata
8c3f1cf662 drivers: wifi: nrf: Fix include path for version
The version header is generated during build and generated path included
already has "zephyr" directory.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-08-07 07:13:27 -04:00
Johann Fischer
5ddaa3b1a1 drivers: udc: add opaque pointer to store upper layer private data
Add an opaque pointer to store upper layer private data and initialize
it with the USB device context during controller initialization. Use the
pointer in event processing to get the correct context.

Fixes commit 48f2a4bc1a
("usb: device_next: remove initialized state checks in event processing")

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-08-06 17:17:41 -04:00
Jason Murphy
364af34de0 drivers: dma: Add MAX32655 DMA driver
Add DMA driver for MAX32655 MCU

Co-authored-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
Signed-off-by: Jason Murphy <jason.murphy@analog.com>
2024-08-06 17:16:35 -04:00