Commit graph

23353 commits

Author SHA1 Message Date
Chris Friedt
41e4b5323a drivers: flash: shell: add "flash copy" command
Add a flash copy command, capable of copying a region in one
flash device to a region on the same or another flash device. The
destination is erased prior to copying.

This is useful for evaluating mcuboot on devices with little
on-chip resources, or devices that are incapable of running more
elaborate image management services (e.g. via bluetooth or
networking).

Additionally, it's useful for evaluating mcuboot on devices with
one or more images stored on external spi flash.

The command syntax is
flash copy <src_dev> <dst_dev> <src_offs> <dest_offs> <size>

E.g.
flash copy flash@0 flash-controller@abcd1234 0x1234 0x5678 21012
Copied 21012 bytes from flash@0:1234 to \
  flash-controller@abcd1234:5678

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-10-08 06:02:01 -04:00
Chris Friedt
ced4e16235 drivers: flash: provide a generic flash_copy() algorithm
Provide a generic flash_copy() algorithm that is capable of
copying from one flash device to another or within different
regions of the same flash device.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-10-08 06:02:01 -04:00
TOKITA Hiroshi
16c9b74e3a drivers: flash: rpi_pico: Rename to avoid conflicting with SDK
Some symbol names have been conflicted with introducing pico-sdk 2.0.0.
Rename these.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-10-08 06:01:23 -04:00
TOKITA Hiroshi
1400ee713a drivers: gpio: rpi_pico: Fitting for the changes made in pico-sdk 2.0.0
Following the GPIO interface changes in pico-sdk 2.0.0.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-10-08 06:01:23 -04:00
TOKITA Hiroshi
0f80f993f9 drivers: clock_control: renesas_ra: Adding macros to convert DT values
Adding the macros `RA_CGC_CLK_SRC` and `RA_CGC_CLK_DIV` that derive
the BSP clock settings from the DeviceTree node settings.
I also define some aliases to fill in the gaps with the BSP
naming conventions.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-10-08 06:01:10 -04:00
Rafael Laya
626174e982 drivers: i2c: Designware IP clang format pass
To reduce lint warnings during code review, it is best
to keep clang-format happy

This commit makes a lint pass to this driver

Signed-off-by: Rafael Laya <rafael_laya97@hotmail.com>
2024-10-07 20:15:54 -04:00
Rafael Laya
bccaeb9c16 drivers: Support Fast Plus Mode in I2C Designware
Adds the right clock settings for Fast Plus Mode
in the i2c Designware driver which the original author
left as a TODO. Similarly, I lack the hardware to test
high-speed mode, and so that mode remains not well
supported.

Signed-off-by: Rafael Laya <rafael_laya97@hotmail.com>
2024-10-07 20:15:54 -04:00
Yangbo Lu
11ef521c60 drivers: pwm_mcux_tpm: adapt to more platforms
The TPM max channel number was got from register array size.
However some platforms TPM instance may begin from TPM1 rather
than TPM0. This should be handled in driver.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2024-10-07 18:43:12 +02:00
Pisit Sawangvonganan
640a2ade8b drivers: serial: ra8_sci_b: adjust return usage in void functions
For code clarity, this commit adjusts the use of `return` statements
in functions with a void return type by:
- Remove unnecessary `return` statements when
  they don't affect control flow.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-10-07 18:42:58 +02:00
Pisit Sawangvonganan
626918588d drivers: serial: ra8_sci_b: revise switch-case in callback_adapter
Unified switch-case usage in `uart_ra_sci_b_callback_adapter` to use
`break` instead of `return`.
Typically, a `break` is used in switch-case statements unless an early
return is necessary, in which case `return` is appropriate.

For this case, using a `break` statement is the more suitable choice.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-10-07 18:42:58 +02:00
Gerard Marull-Paretas
5a4655f69f drivers: adc: nrfx_saadc: use CONFIG_NRF_PLATFORM_HALTIUM
So that any Haltium based SoC uses the same settings, including nRF54H20
EngB.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-10-07 18:42:14 +02:00
Adam Kondraciuk
bc7a5b6781 drivers: timer: nrf_grtc_timer: Align Zephyr to new AUTOEN read manner
The new GRTC reading manner of the SYSCOUNTER uses hardware mechanism which
allows to keep it alive when any of CPUs is not sleeping. Otherwise
the SYSCOUNTER goes into sleep mode. Thus there is no
longer need to maintain the `CONFIG_NRF_GRTC_SLEEP_ALLOWED` symbol, however
if the user wants to have the SYSCOUNTER enabled all the time the
`CONFIG_NRF_GRTC_ALWAYS_ON` can be used instead.
The nrfx_grtc  driver no longer provides the `wakeup-read-sleep` reading
manner.
Also setting the GRTC clock source is performed by the nrfx_grtc driver so
it has been removed from the `sys_clock_driver_init()` function.

Signed-off-by: Adam Kondraciuk <adam.kondraciuk@nordicsemi.no>
2024-10-07 18:42:14 +02:00
Gerard Marull-Paretas
97dff5bccb modules: hal_nordic: align PDM configuration
Introduce instance 0, PDM0, following nrfx 3.7.0 update.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-10-07 18:42:14 +02:00
Maximilian Deubel
fd686a25b3 drivers: dp: swdp_bitbang: Update SWD clock calculation
This patch updates the SWD clock calculation to the latest behavior
of DAPLink.

Signed-off-by: Maximilian Deubel <maximilian.deubel@nordicsemi.no>
2024-10-07 17:13:37 +01:00
Maximilian Deubel
621a6000d5 drivers: dp: swdp_bitbang: hardcode nRF53 SYSCLK
Since CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC is tied to the slow RTC clock
for the nRF53, use the default SYSCLK of 64MHz instead.

Signed-off-by: Maximilian Deubel <maximilian.deubel@nordicsemi.no>
2024-10-07 17:13:37 +01:00
Pisit Sawangvonganan
a378440116 drivers: intc: stm32: correct inconsistent parameter names
Correct several inconsistent parameter names in the following functions:
- stm32_gpio_intc_select_line_trigger: rename `trigger` to `trg`
  to match the header file.
- stm32_gpio_intc_set_irq_callback: rename the callback argument to `user`
  to match the `stm32_gpio_irq_cb_t` type.
- stm32_exti_get_line_src_port: rename `pin` to `line` to align with
  the Doxygen comment and implementation.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-10-07 17:12:34 +01:00
TOKITA Hiroshi
3f6bddc2bf drivers: mipi_dsi: Change MIPI_DSI priority to the same as DISPLAY
These priorities can be resolved automatically with the sub-priority
mechanism, so set them to the same value.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-10-07 17:11:58 +01:00
TOKITA Hiroshi
ef3847c3d8 drivers: mipi_dsi: Add dummy driver for vnd,mipi-dsi
Add dummy driver for "vnd,mipi-dsi" to use in build_all tests.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-10-07 17:11:58 +01:00
Guillaume Gautier
9566d4ecb5 drivers: adc: stm32: add a check for asynchronous clock source
Add a compile-time check to verify that a domain clock is explicitly
defined if a STM32 ADC is configured to use an asynchronous clock.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-10-07 13:40:06 +02:00
Guillaume Gautier
46d4be75e0 drivers: clock_control: st: add missing bus source clocks
Add missing bus source clocks for STM32H5, U5 and WBA

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-10-07 13:40:06 +02:00
Mateusz Holenko
aa7c367f44 drivers: led_strip: Fix formatting of log message
The previous version generated compilation warnings.

Signed-off-by: Mateusz Hołenko <mholenko@antmicro.com>
2024-10-07 13:39:59 +02:00
Ian Morris
627c33292a boards: mikroe: remove CONFIG_PINCTRL from defconfig of RA4M1 clicker
This PR fixes #78619 for the Mikroe RA4M1 Clicker board.

Signed-off-by: Ian Morris <ian.d.morris@outlook.com>
2024-10-05 14:05:48 -04:00
Ryan McClelland
ae63c62f0e drivers: i3c: implement support for ibi thr interrupts
Some IBI TIR packets can be larger than the ibi data fifo size
which can prevent it from receiving the full packet. This adds
a data struct in to the driver data where data can be pushed
to as data is being transfered.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-10-05 14:04:25 -04:00
Ryan McClelland
31e821bef6 drivers: i3c: cdns: grab mutex before adjusting prescalers
Grab the mutex before adjusting the prescalers to make sure no
transaction is on going.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-10-05 14:04:25 -04:00
Ryan McClelland
9c48f7eb37 drivers: i3c: cdns: correct sda push pull hold time
correct the comments and timing for the sda push-pull hold time
configuration.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-10-05 14:04:25 -04:00
Martin Stumpf
4ec266152d drivers: cc: mcux: Fix incorrect clock source of FlexSPI2
The clock control mcux rev2 returns FlexSPI1 clock rate when FlexSPI2
clock rate is requested.

Signed-off-by: Martin Stumpf <martin.stumpf@vected.de>
2024-10-04 22:52:39 +01:00
Daniel DeGrasse
22a922fded drivers: mipi_dbi: nxp_lcdic: add support for 8080 mode
Enable support for 8 bit 8080 mode in the NXP LCDIC driver. Support
for programming the minimum duration of the write active/inactive signal
is also added, since this will be required to support high display
clocks in 8080 mode.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-10-04 22:50:45 +01:00
Daniel DeGrasse
04726a22cb drivers: display: st7796s: respect rgb_is_inverted in 8080 8 bit mode
Update ST7796s display driver to respect the setting of rgb_is_inverted
in 8080 8 bit mode, as it was previously not applied for this mode.

Also, simplify the logic check for 16 bit mode- the new check is
functionally equivalent, but no longer inverts both boolean values.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-10-04 22:50:45 +01:00
Yong Cong Sin
796b795cda drivers: intc: plic: fix for SMP=n when MP_MAX_NUM_CPUS > 1
The functions to obtain the address are hardcoded to return
the address of the first core when `CONFIG_SMP != y`, this
causes an issue with enabling an IRQ when there are more than
one core in the system (`CONFIG_MP_MAX_NUM_CPUS > 1`), as the
driver would first enable the IRQ on the first core, and when
it tries to obtain the address for the following cores and
disable the IRQ on them, the functions continue to return the
address of the first core, causing the IRQ to be disabled
on the first core.

Fix this by determine if `CONFIG_MP_MAX_NUM_CPUS > 1` instead
of `CONFIG_SMP=y` when returning the address.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-10-04 10:50:14 +01:00
Krzysztof Chruściński
242331291d drivers: misc: coresight: nrf_etr: Imply UART asynchronous API
Asynchronous API is recommended to be used by ETR buffer handler but
polling is also supported. Imply UART_ASYNC_API so that it is possible
to disable it in project config and fall back to polling if needed. For
example to reduce memory footprint.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-10-04 10:46:54 +01:00
Tomasz Moń
508bd3edef drivers: udc_dwc2: Change hibernation exit on bus reset
Adhere to programming guide steps on Hibernation Exit on Host Initiated
Reset.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2024-10-03 17:08:36 +01:00
Tomasz Moń
f57e78de2a drivers: udc_dwc2: Suspend if connected to suspended bus
Peripherals are required to support the suspend state whenever VBUS
is powered, even if bus reset has not occurred (Mandate: Required,
Effective Date: February, 2010).

Remove the stale suspend check that essentially prevented the device
from hibernating when connected to already suspended bus.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2024-10-03 17:08:36 +01:00
Yong Cong Sin
52a202309b zephyr: bulk update to DT_NODE_HAS_STATUS_OKAY
Change instances of:

DT_NODE_HAS_STATUS(<node_id>, okay)

to

DT_NODE_HAS_STATUS_OKAY(<node_id>)

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-10-03 17:06:52 +01:00
Andrew Sonzogni
44d101acab drivers: sensor: lis2dw12: add interrupt status fetch
INT status can be fetched if the feature can't trigger via interrupt

Signed-off-by: Andrew Sonzogni <andrew@safehear.fr>
2024-10-03 11:41:51 +01:00
Andrew Sonzogni
70de35d9c9 drivers: sensor: lis2dw12: add inactivity detection
Add inactivity mode or stationary detection

Signed-off-by: Andrew Sonzogni <andrew@safehear.fr>
2024-10-03 11:41:51 +01:00
Andrew Sonzogni
c74dd3ee74 drivers: sensor: lis2dw12: add temp reading
adds support for reading temperature
Signed-off-by: Andrew Sonzogni <andrew@safehear.fr>
2024-10-03 11:41:51 +01:00
Yong Cong Sin
c710f8892b drivers: intc: plic: implement irq affinity configuration
- Implement irq-set-affinity in RISCV PLIC.
- Added new affinity shell command to get/set the irq(s)
  affinity in runtime, when `0` is sent as the `local_irq`, it
  means set/get all IRQs affinity.
- Some minor optimizations

Updated the build_all test to build this new configuration.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-10-02 13:48:05 -05:00
Jori Rintahaka
a3f2ba1928 drivers: bluetooth: silabs: move code from module to main tree
The code that handles passing events to and from the controller
resided in the hal_silabs module. This is an integral part of the
HCI driver that it can't work without, and logically belongs in
the driver.

Signed-off-by: Jori Rintahaka <jori.rintahaka@silabs.com>
2024-10-02 13:42:56 -05:00
Georgij Cernysiov
d8c0a67d7b drivers: ethernet: adin2111: fix generic spi frame reception
Fixes a bug that results in double RX buffer read from ADIN
when generic SPI protocol is used.

Actual frame size to be read must be RX_FSIZE - HEADER.
If we read less amount of bytes, then ADIN raises an IRQ or
signals via Pn_RX_RDY that there is another frame available, as
we fail to read the whole frame.

The fix for "Still some length to go 2" is still present, we drop
the CRC32 bytes from the frame prior allocation and network
stack pass.

Signed-off-by: Georgij Cernysiov <geo.cgv@gmail.com>
2024-10-02 13:40:42 -05:00
Daniel Gaston Ochoa
bce51b7706 drivers: spi: stm32h7: avoid unnecessary suspend
The SPI stm32 H7 driver always suspends the SPI transaction
when finishing the transceive operation. This, according to
the stm32 H7 datasheet, must only be done when the SPI master
is configured as receive-only, and the driver always
configures it as full-duplex.

Hence, remove this unnecessary operation for clarify and for
a potential reduction in the minimum time between SPI
transceive operations.

Signed-off-by: Daniel Gaston Ochoa <dgastonochoa@gmail.com>
2024-10-02 14:42:48 +01:00
Fabio Baltieri
f98fde07b3 devicetree: make DT_..._REG_ADDR return unsigned
`DT_..._REG_ADDR` macros do not always return an unsigned value. This
commit adds and unsigned 32bit prefix to ensure the value is always
unsigned.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-10-02 14:41:32 +01:00
Florian Grandel
117a0098f3 drivers: flash: simulator: fix address resolution
The flash simulator assumes that flash is being addressed with absolute
addresses by clients. But this is not the case. Given addresses are
relative to the flash base address.

The existing code only worked because the base address was always zero.
Testing with non-zero base addresses caused a mem fault/page fault.

(Reproducible e.g. when using the NVS settings subsystem on QEMU x86
with a non-zero base address in the soc-nv-flash node.)

Fixes #79082

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2024-10-02 10:12:27 +02:00
TOKITA Hiroshi
773d50e072 drivers: sensor: mc3419: Change the TRIGGER config to a typical
Because MC3419's TRIGGER's Kconfig was different from the typical
configuration, the `build_all` test settings were not correctly
applied.

The Kconfig configuration has been revised to be set in conjunction
with MC3419_TRIGGER_OWN_THREAD, even if MC3419_TRIGGER is not
explicitly specified.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-10-02 10:05:58 +02:00
Mathieu Choplain
5a0775b1ab dts: bindings: stm32-temp*: align 'avgslope' to datasheet format
Change the STM32 Temperature Sensor bindings to accept the average slope
value in string form instead of integer. With this change, it is possible
to use the raw decimal value found in each MCU's datasheet instead of
needing to scale it (differently depending on series!). This also allows
regrouping the property in a single file to reduce duplication.

Also update all DTSI files affected by this change and the dietemp driver
to accept the property's new format.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-10-02 10:03:03 +02:00
Mathieu Choplain
7f44ecb06a drivers: sensor: stm32_temp: update and comment conversion code
Update all the conversion code in the STM32 dietemp sensor driver to be
more readable and match the Reference Manuals. Additionally, comment all
the code to make it easy to understand.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-10-02 10:03:03 +02:00
Mathieu Choplain
dabcd605a8 drivers: sensor: stm32_temp: read calibration data in dedicated function
Move the reading of calibration data from manufacturing flash to a
dedicated function. This makes introduction of new STM32 series easier.

Additionally, use the sys_read16 primitive to read data instead of
manipulating and dereferencing raw manufacturing flash pointers.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-10-02 10:03:03 +02:00
Mathieu Choplain
2ef666a15c drivers: sensor: stm32_temp: make driver data field names closer to RM
Rename the fields of the STM32 dietemp sensor driver data structure to
match the names in Reference Manual more closely, and add documentation
comments to all of them.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-10-02 10:03:03 +02:00
Mathieu Choplain
70bf26b358 drivers: sensor: stm32_temp: convert samples in dedicated function
Factor out the ADC-sample-to-temperature conversion logic from the sensor
subsystem API implementation, and move it to a dedicated function.

This makes the driver more readable.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-10-02 10:03:03 +02:00
Mathieu Choplain
d307221065 drivers: sensor: stm32_temp: enable/disable channel in separate functions
Moves the temperature sensor channel enable and selection to separate
functions. This improves the driver's readability and makes introduction
of new STM32 series easier.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-10-02 10:03:03 +02:00
Kurtis Dinelle
5eeff698ca sensor: tsl2591: fix: Address CID 353644 & 353654
Fixes implicit sign-extension/potential overflow by explicitly casting
to int64_t.

Signed-off-by: Kurtis Dinelle <kurtisdinelle@gmail.com>
2024-10-02 10:01:43 +02:00