Commit graph

86920 commits

Author SHA1 Message Date
Tim Lin f1dc11174c ITE: drivers/i2c: Add a property for I2C located channel
Add a property for I2C channel switch selection. This property will
write to the SMBxxCHS register according to the I2C node you selected,
which can make channel swapping.

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2023-11-08 10:08:28 +01:00
Murali Karicheri 2c5f5bfd0a samples: fs: fat_fs: support on stm32h747i-disco board
This patch allow demonstrating fat_fs sample application on
stm32h747i-disco  board with SD card.

Build fs_sample using following command

west build -p always -b stm32h747i_disco_m7 \
	samples/subsys/fs/fs_sample

Signed-off-by: Murali Karicheri <murali.karicheri@sandc.com>
2023-11-08 10:08:19 +01:00
Tom Burdick 982cc794e3 llext: Make the shell list command output nicer
Remove unnecessary newline characters from shell_print, it already adds
them. Align the table pipe characters better in the list of modules.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2023-11-08 10:07:50 +01:00
Tom Burdick 6d651e37a3 llext: Track module memory usage
The memory usage shown in the shell was 0 which is obviously incorrect.
At some point the memory allocation tracking was dropped from llext.c
mistakenly. Add it back.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2023-11-08 10:07:50 +01:00
Tom Burdick 79c9f17320 samples: llext shell_loader reduced size
Reduce the heap and stack sizes needed for the shell loader sample app
so more devices may try it out.

Tried on a mimxrt1010_evk and noted the total ram usage was
approximately 44000 bytes. Prior to this change the mimxrt1010_evk was
unable to run the sample as the bss section overflowed the ram size.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2023-11-08 10:07:50 +01:00
Bartosz Bilas 2c09999d24 drivers: dac: add driver for AD5592
Add MFD subdriver for the built-in DAC controller
in AD5592 chip.

Signed-off-by: Bartosz Bilas <b.bilas@grinn-global.com>
2023-11-08 10:07:41 +01:00
Bartosz Bilas 0689d3dc11 drivers: gpio: add driver for AD5592
Add MFD subdriver for the built-in GPIO controller
in AD5592 chip.

Signed-off-by: Bartosz Bilas <b.bilas@grinn-global.com>
2023-11-08 10:07:41 +01:00
Bartosz Bilas ad3c5a27b4 drivers: adc: add driver for AD5592
Add MFD subdriver for the built-in ADC controller
in AD5592 chip.

Signed-off-by: Bartosz Bilas <b.bilas@grinn-global.com>
2023-11-08 10:07:41 +01:00
Bartosz Bilas 9bdff044f0 drivers: mfd: add AD5592 MFD driver
This commit introduces a driver for
Analog AD5592 8-channel, configurable ADC/DAC/GPIO chip.

Signed-off-by: Bartosz Bilas <b.bilas@grinn-global.com>
2023-11-08 10:07:41 +01:00
Alexander Razinkov d2c101d466 kernel: init: conditional .bss section zeroing
Some platforms already have .bss section zeroed-out externally before the
Zephyr initialization and there is no sence to zero it out the second time
from the SW.
Such boot-time optimization could be critical e.g. for RTL Simulation.

Signed-off-by: Alexander Razinkov <alexander.razinkov@syntacore.com>
2023-11-08 10:07:26 +01:00
Fabio Baltieri 8816852c2c doc: dts: api: update the inter-node dependencies documentation
Update the inter-node dependencies documentation to clarify the child
node dependency inheritance recently introduced in 403640b75e.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-11-08 10:06:57 +01:00
Manuel Argüelles bda3b101d3 serial: nxp_s32: use instance-based DT macros
At present, many of the NXP S32 shim drivers do not make use of
devicetree instance-based macros because the NXP S32 HAL relies on an
index-based approach, requiring knowledge of the peripheral instance
index during both compilation and runtime, and this index might not
align with the devicetree instance index.

The proposed solution in this patch eliminates this limitation by
determining the peripheral instance index during compilation
through macrobatics and defining the driver's ISR within the shim
driver itself.

Note that for some peripheral instances is needed to redefine the
HAL macros of the peripheral base address, since the naming is not
uniform for all instances.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-11-08 10:06:46 +01:00
Guillaume Gautier 2caf720c51 samples: board: stm32 pm: add adc power management sample
Add a sample for STM32 ADC power management

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2023-11-08 10:06:32 +01:00
Guillaume Gautier 479ba144a7 drivers: adc: stm32: enable PM
Enable PM for STM32 ADC.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2023-11-08 10:06:32 +01:00
Guillaume Gautier 13ca0dc806 drivers: adc: stm32: refactor calibration
Refactor calibration code in anticipation of PM addition.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2023-11-08 10:06:32 +01:00
Maximilian Deubel 84bfb4a63b boards: arm: nrf9161dk: remove scratch partition
This patch removes the now unused scratch partition and enlarges
the application slots instead.

Signed-off-by: Maximilian Deubel <maximilian.deubel@nordicsemi.no>
2023-11-08 10:06:03 +01:00
Maximilian Deubel 386b658008 boards: arm: add nrf9131ek_nrf9131
This patch adds the nRF9131-EK board.

Signed-off-by: Maximilian Deubel <maximilian.deubel@nordicsemi.no>
2023-11-08 10:06:03 +01:00
Fabio Baltieri 8bec2d7b37 boards: roc_rk3568: do not use as default test platform
Only qemu boards are used as default in CI, drop the default property
from this one.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-11-07 17:44:25 -05:00
Georgij Cernysiov 3be2956b86 drivers: ethernet: fix adin set_config lock
Use correct argument to lock/unlock the MAC.

Signed-off-by: Georgij Cernysiov <geo.cgv@gmail.com>
2023-11-07 16:22:58 -06:00
Andy Sinclair ec52722861 drivers: regulator: npm1300: Add boot state detection
Added boot state detection, so that the reference count is
set correctly and enable/disable work as expected.

With this fix it is no longer necessary to set
regulator-boot-on when the regulator is enabled in hardware.

Signed-off-by: Andy Sinclair <andy.sinclair@nordicsemi.no>
2023-11-07 14:48:15 +00:00
Murali Karicheri ec031029f4 samples: fs: littlefs: sdmmc: remove fstab and fixed partition
For littleFS, the fstab entries in DTS are ignored currently.
So remove the overlay entries for the same. Also fixed-partitions
can't be used for sdmmc-disk. So remove the same. We just need to
have sdmmc node with zephyr,sdmmc-disk compatible string to have
littleFS working on disk.

build littleFS sample as follows:-

west build -p always -b stm32h747i_disco_m7 \
samples/subsys/fs/littlefs/ -- \
-DOVERLAY_CONFIG=boards/stm32h747i_disco_m7.conf \
-DCONF_FILE=prj_blk.conf

Signed-off-by: Murali Karicheri <murali.karicheri@sandc.com>
2023-11-07 14:11:06 +01:00
Daniel DeGrasse 9dd8f94fd4 drivers: flash: mcux_flexspi_nor: Remove flash reads while programming
Care must be taken to avoid any flash access while programming the flash
attached to the FlexSPI either via executing XIP code or reading RO data.

Remove locations where a constant device pointer might be dereferenced
within the mcux_flexspi_nor driver, to help avoid RWW hazards.

Fixes #64702

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2023-11-07 14:11:00 +01:00
Tomasz Moń f2c804b46e nrf_usbd_common: Do not use USBD HAL
Use MDK directly instead of via USBD HAL to not mix direct register
accesses with USBD HAL. In my opinion this change is not really
necessary but reviewers are strict about consistency.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2023-11-07 14:06:51 +01:00
Tomasz Moń f533ec16e6 nrf_usbd_common: Remove dynamic feeders/consumers
There is no point in setting the feeder or consumer at runtime. The time
saved due to not checking conditions on each transaction is smaller than
the additional cost of calling function via pointer.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2023-11-07 14:06:51 +01:00
Tomasz Moń 3e6b86ff73 nrf_usbd_common: Keep interrupt configuration constant
Do not enable nor disable endpoint done interrupts at runtime because it
is not necessary. Simply keep all relevant interrupts enabled when USBD
is active and disable all interrupts when USBD is disabled.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2023-11-07 14:06:51 +01:00
Tomasz Moń 3d523a9cb4 nrf_usbd_common: Refactor interrupt handling code
Ensure strict order within interrupt processing to eliminate workaround
in IN transfer acknowledged handler. EPDATASTATUS and DMA done events
are processed in a way that eliminates the possibility for race condions
between interrupt handler and host IN tokens.

Store last started DMA endpoint and use it in common handler for all DMA
finished events. Unify use of ep dma waiting variable because atomics
only make sense if all accesses are through atomic functions - here the
accesses are guarded with critical section.

Do not disable SETUP interrupt when DMA transfers data on endpoint 0 but
simply postpone handling if currently active DMA is on endpoint 0.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2023-11-07 14:06:51 +01:00
Tomasz Moń fc59ed701b nrf_usbd_common: Disable started interrupt handling
There is no point in calling an empty function on every single DMA
transfer start. While the empty function is just BX LR the fact that is
is called on every DMA transfer makes its impact visible. This change
improves CDC ACM echo throughput by approximately 2%.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2023-11-07 14:06:51 +01:00
Tomasz Moń 0efdff96df nrf_usbd_common: Remove early DMA process handling
Early DMA process handling actually decreases performance in real world
scenarios because real world scenarios tend to be CPU bound. Moreover
the actual optimization is questionable because DMA semaphore can only
be released after the respective endpoint end event is handled. Remove
early DMA processing altogether and only check pending DMA at the end of
interrupt handler.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2023-11-07 14:06:51 +01:00
Tomasz Moń a0a80f6299 nrf_usbd_common: Guard DMA with semaphore
Rely on semaphore to serialize access to DMA instead of busy looping
after triggering DMA. With this change Ozone Code Profile generated with
J-Trace Pro on nrf52840dk_nrf52840 board running headphones microphone
sample shows following Load changes (trace data was reset once playback
and recording started and percentages were taken when memcpy reached
200 000 Run Count):
  * usbd_dmareq_process() from 17.16% to 2.24%
  * memcpy() from 9.37% to 8.36%
  * nrf_usbd_common_irq_handler() from 8.89% to 10.88%

Mark nrf_usbd_common_stop() as static because the caller must acquire
DMA semaphore before calling this function and the only place where it
is used is already acquiring the semaphore.

Disable EP0 SETUP interrupt when there is active DMA on EP0 to eliminate
the need for aborting DMA on EP0. This code path should not really
happen in real life though because hosts must not issue new SETUP before
a relatively long timeout (at least 50 ms).

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2023-11-07 14:06:51 +01:00
Tomasz Moń 8db6919695 nrfx_usbd: Rename to nrf_usbd_common
Rename local usbd copy from nrfx_usbd to nrf_usbd_common and use it in
both USB stacks. Renaming header to nrf_usbd_common.h allows breaking
changes in exposed interface. Mark all doxygen comments as internal
because local usbd copy should not be treated as public interface
because we are under refactoring process that aims to arrive at native
driver and therefore drop nrf_usbd_common in the future.

Use Zephyr constructs directly instead of nrfx glue macros.

No functional changes.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2023-11-07 14:06:51 +01:00
Tomasz Moń 2010d4d599 nrfx_usbd: Copy nrfx usbd code to Zephyr
Copy nrfx_usbd code from zephyrproject-rtos/hal_nordic git revision
d054a315eb888ba70e09e5f6decd4097b0276d1f. This enables us to refactor
the code towards a native driver in a step by step manner where the
smallest changes that bring biggest performance improvements are done
early on.

The code is not a vanilla copy from zephyrproject-rtos/hal_nordic.
The code was reformated with clang-format to match project style.
Manual modifications were done to change comments formatting, place
constant comparisons on the right and add blank lines to pass Zephyr
compliance check.

Relicense to Apache 2.0.

No functional changes.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2023-11-07 14:06:51 +01:00
Ingar Kulbrandstad e1a5605889 Bluetooth: Mesh: Remove experimental tag
Remove experimental tag for Mesh Protocol v1.1,
Mesh Model v1.1, Mesh DFU v1.0 and Mesh BLOB v1.0
features.

Signed-off-by: Ingar Kulbrandstad <ingar.kulbrandstad@nordicsemi.no>
2023-11-07 11:57:17 +01:00
Alberto Escolar Piedras 8b456ea2a1 treewide: Replace all uses of CONCAT with _CONCAT
One of the ARM architure files, defined since long ago
CONCAT having the exact same purpose as Zephyr's _CONCAT.
Unfortunately this header is included almost always
and the macro defined in all ARM based platforms,
which seems to have lead to many uses of this macro
instead of _CONCAT.

Fix it by using _CONCAT instead.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-07 11:55:51 +01:00
Aleksander Wasaznik bfff0f9f4c Bluetooth: Host: Tests: Move testlib to common
This is the first patch with the goal of establishing a common library
for Bluetooth utilities that are commonly used for setup in Bluetooth
Host tests. The ultimate goal is to remove redundant (near) copies of
these utilities and other more ad-hoc solutions.

This patch moves one instance of testlib (from
tests/bsim/bluetooth/host/att/long_read) to
tests/bluetooth/common/testlib and makes it a proper CMake library.

The long_read test is updated to link to the new CMake library.

Further changes and de-duplication will come in later patches.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2023-11-07 10:09:33 +01:00
Daniel Mangum 133f20abc5 docs: rpi_pico: fix typo in SPI PIO sample
Fixes minor typo in the SPI via PIO sample documentation.

Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
2023-11-07 09:55:22 +01:00
Emil Gydesen 9e58ad31e9 tests: Bluetooth: BAP Broadcast sink RX fail fix
Added an additional check before failing a BSIM test
on ISO error, so that when we stop the broadcast source
(after the sink have received the expected data), lost data
does not trigger a test failure.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-11-07 09:55:14 +01:00
Rubin Gerritsen 8b2dd61eba Bluetooth: HCI: Add bt_hci_get_ver_str()
This new API returns the version string corresponding to a given
HCI version.

The API can be used by applications to print out human-readable
information about the controller being used.

Adding this API removes possible code duplication.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2023-11-07 09:55:05 +01:00
Andrei Emeltchenko a4a4e6872c tests: ieee802154: Remove double new line from logs
NET_XXX() functions already add newline.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2023-11-07 09:54:49 +01:00
Andrei Emeltchenko cde428cbca tests: ieee802154_test: Fix missing format specifier
Add missing format specifier.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2023-11-07 09:54:49 +01:00
Andrei Emeltchenko 92da98389e drivers: akm09918c_emul: Correct print format
Correct print format for msgs->len.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2023-11-07 09:54:49 +01:00
Andrei Emeltchenko 0e358bb957 drivers: adltc2990_emul: Correct print format
Correct print format for msgs->len.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2023-11-07 09:54:49 +01:00
Bartosz Bilas 00badc243d tests: drivers: gpio: fix cs gpios reg property
Adjust the reg of the CS gpios to fix the warning
about the same value used for all existing nodes.

Signed-off-by: Bartosz Bilas <b.bilas@grinn-global.com>
2023-11-07 09:54:38 +01:00
Jukka Rissanen e89c9a6671 net: tcp: Fix compilation if congestion avoidance is disabled
Fix tcp.c compilation if user unsets
CONFIG_NET_TCP_CONGESTION_AVOIDANCE config option.

Fixes #64824

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-11-07 09:54:31 +01:00
Jordan Yates ee57b56ba5 doc: contribute: instructions for local viewing of docs
Add instructions for serving the generated HTML docs on a local IP
address.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-11-07 09:54:22 +01:00
Mike J. Chen 054f9d7a82 drivers: gpio: gpio_mcux_lpc: fix bug disabling pulls
If the gpio had pull previous enabled, but new config
request wants the pull disabled, the code was failing
to clear the previous pull setting.

Signed-off-by: Mike J. Chen <mjchen@google.com>
2023-11-07 09:54:15 +01:00
Keith Short 63b8890ad4 ITE: drivers/i2c/i2c_ite_enhance: Fix I2C dump messages
The ISR for CQ mode was unconditionally writing into the I2C message
buffer for all transfer types. The correct data was transferred on the
I2C interface, but the clobber caused CONFIG_I2C_LOG_LEVEL_DBG to
display incorrect data for I2C writes.

This change will also help performance of large I2C write transactions.

Signed-off-by: Keith Short <keithshort@google.com>
2023-11-07 09:54:06 +01:00
Dmitrii Golovanov 82ec6394a1 soc: arm: Fix cmake linker.ld warning for arduino_uno_r4_minima
Fix cmake depreciation warning on pre-defined linker.id
(soc/arm/renesas_ra/ra4m1/linker.ld) used for arduino_uno_r4_minima.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2023-11-07 09:53:57 +01:00
Chaitanya Tata d12627e70f wifi: shell: Move defaults to beginning
This sets defaults first and then overrides if configured, easier to
read.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2023-11-07 09:53:39 +01:00
Chaitanya Tata 8c179870d4 wifi: shell: Fix default band value
The enum is mainly to print output of band, so, the default value is 0
which means 2.4GHz, which is not correct when using it to configure like
in connect.

Fix the default value to unknown i.e., no user preference. This way we
can use same enum for both set and get.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2023-11-07 09:53:39 +01:00
Benjamin Cabé 08ca98fbd1 doc: gsg: Remove misleading mention of Powershell
While we will probably want to properly document how to use Powershell
on Windows in the near future, current Getting Started Guide contained a
misleading mention to activating Pythonv venv using Powershell that this
commit removes.

Addresses comments raised in #64682.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-11-07 09:53:30 +01:00