Commit graph

73200 commits

Author SHA1 Message Date
Declan Snyder
ff830fb0f8 tests: fat_fs_api: Conditionally compile MKFS test
MKFS testing inappropriately uses flash API in the FAT FS API test,
causing build errors for the test when testing file systems on storage
devices other than flash. Hotfix by making this part of the test
conditional on CONFIG_FLASH.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2022-12-14 18:37:09 +01:00
Fredrik Danebjer
c5b270e7b0 Bluetooth: GATT: Fix missing endianess conversion on include end-handle
Added missing conversion to CPU endianess for the include service
end-handle.

Signed-off-by: Fredrik Danebjer <fredrik@danebjer.com>
2022-12-14 17:26:03 +01:00
Gerard Marull-Paretas
85c7eb5c7a drivers: regulator: add API to read error flags
Add a new API to obtain the active error flags on a regulator, e.g.
overcurrent, overvoltage or over temperature.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-12-14 17:01:44 +01:00
Gerard Marull-Paretas
539d4aa6e6 drivers: regulator: add common init enable API
Add a new API for drivers that can be called to initialize the regulator
at init time if `regulator-boot-on` or `regulator-always-on` are set.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-12-14 17:01:44 +01:00
Gerard Marull-Paretas
9b5152153b drivers: regulator: add regulator_is_enabled
Add a new API to check if a regulator is enabled or not.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-12-14 17:01:44 +01:00
Gerard Marull-Paretas
305ce33b77 drivers: regulator: add parent DVS API
PCA9420 PMIC offers of multiple operation states, or DVS (Dynamic
Voltage Scaling). Such states may be automatically changed by hardware
using MODESEL0/1 pins. Certain MCUs allow to automatically configure
certain output pins when entering low power modes so that PMIC state is
changed without software intervention.  This means that application just
needs to configure the voltages for each state using
`nxp,modeN-microvolt`, set `nxp,enable-modesel-pins` in devicetree and
forget about configuring regulators.

This patch introduces a new _parent_ API to expose such functionality in
a vendor agnostic way. Consider this API as experimental for now, until
we have other usecases.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-12-14 17:01:44 +01:00
Gerard Marull-Paretas
10ce9684c3 drivers: regulator: fix/improve usage of devicetree properties
Most of devicetree properties for regulator, such as:

- regulator-min/max-microvolt
- regulator-min/max-microamp
- regulator-allowed-modes
- etc.

Are meant to specify limits on what consumers may set. They are **NOT**
meant to describe the hardware capabilities. For example, I could have a
BUCK converter that supports 0-5V output voltage, but my circuit may
only allow working on the 2.7-3.3V range.

This patch reworks the API so that the API class layer manages this
information. This is done by drivers collecting all such fields in a
common configuration structure that is later accessed by the class
layer. This simplifies drivers implementation. For example, if A
consumer calls regulator_set_voltage() with a voltage that is supported
but not allowed, driver code won't be called. Similarly, if a regulator
is configured to be `always-on`, enable/disable driver code will never
be called.

Drivers have been adjusted. PCA9420 mode settings have been removed from
devicetree in this commit as they are not actual modes but PMIC states.
This will be refactored in a follow-up commit.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-12-14 17:01:44 +01:00
Gerard Marull-Paretas
1029a4db6f drivers: regulator: pca9420: some minor improvements
- Remove redundant comments
- Remove internal *_mode functions, as they were only used once.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-12-14 17:01:44 +01:00
Gerard Marull-Paretas
8e60c2df0c drivers: regulator: add regulator_mode_t opaque type
Define regulator mode as an opaque type, same as we do in other
subsystems like GPIO (e.g. gpio_flags_t).

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-12-14 17:01:44 +01:00
Gerard Marull-Paretas
631096fce5 drivers: regulator: clarify regulator_set_current_limit()
- Clarify the documentation, add -EINVAL return value when current limit
  is out of the window.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-12-14 17:01:44 +01:00
Gerard Marull-Paretas
2bd6d50934 drivers: regulator: improve regulator_get_current_limit
- Function returns now the value by reference, similar to voltage
  counterparts.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-12-14 17:01:44 +01:00
Gerard Marull-Paretas
8db7e046c5 drivers: regulator: clarify regulator_set_mode interface
Clarify the API for regulators that have the option to set mode
externally, such as PCA9420. Adjust the PCA9420 driver to comply with
the interface.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-12-14 17:01:44 +01:00
Gerard Marull-Paretas
3d47b6dfba drivers: regulator: improve regulator_get_voltage
- Function now returns error, value is obtained by reference. This
  allows to propagate potential bus errors.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-12-14 17:01:44 +01:00
Gerard Marull-Paretas
b909d0e560 drivers: regulator: drop mode specific APIs
- Mode specific APIs repeat the same functionality offered by non-mode
  specific APIs
- The same functionality can be achieved by the non-mode APIs, since
  they apply to the active mode which can be set using
  regulator_set_mode() first.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-12-14 17:01:44 +01:00
Gerard Marull-Paretas
0a84377f1c drivers: regulator: clarify regulator_set_voltage
- Voltage is applied to the active or selected mode
- Implementation must return -EINVAL if given voltage window is not
  valid.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-12-14 17:01:44 +01:00
Gerard Marull-Paretas
4e8795a8ce drivers: regulator: provide generic regulator_is_supported_voltage
The function can be implemented by using regulator_count_voltages() +
regulator_list_voltage(), so there's no need to defer the job to each
driver.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-12-14 17:01:44 +01:00
Gerard Marull-Paretas
c77c3ac7d6 drivers: regulator: improve regulator_list_voltages
- Rename to regulator_list_voltage (it is listing a single voltage)
- Function returns the value via a parameters, so that we can indicate
  wether the given index is valid or not. If a driver doesn't implement
  this call, function returns -EINVAL (as it should be).

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-12-14 17:01:44 +01:00
Gerard Marull-Paretas
aab28d735f drivers: regulator: drop regulator_count_modes
The regulator_count_modes was an API that was not useful. Unlike with
voltages where the interface guarantees they are zero-indexed, modes can
take an arbitrary identifier. So counting supported modes doesn't
provide any useful information such as if a mode is allowed.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-12-14 17:01:44 +01:00
Gerard Marull-Paretas
9a73be82c4 drivers: regulator: improve regulator_count_voltages specs
- Interface guarantees that voltage indices start from zero to
  regulator_count_voltages()
- Function always return an unsigned number. If the device doesn't
  implement the API returned value is zero, as expected.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-12-14 17:01:44 +01:00
Alberto Escolar Piedras
9fc1ca7997 nrf52_bsim: Expand some bs_tests hooks descriptions
Expand the descriptions of some bs_tests hooks

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2022-12-14 16:34:55 +01:00
Alberto Escolar Piedras
fb95defce3 nrf52_bsim: Add option to delay CPU and test initialization
In some simulated test cases, it can be usefull
to delay the boot of the CPU and the test initialization
for a while. Namely by the offset of the device
relative to other simulated devices.

We add the option to select so from command line.
By default the option is disabled so this change is
backwards compatible.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2022-12-14 16:34:55 +01:00
Wojciech Slenska
4b2fffc7f9 shell: added SHELL_AUTOSTART configuration option
In some applications, there is a need to don't start the shell by
default, but run it later on some special condition.
When SHELL_AUTOSTART is set to n, the shell is not started after
boot but can be enabled later from the application code.

Signed-off-by: Wojciech Slenska <wsl@trackunit.com>
2022-12-14 15:17:02 +01:00
Ian Oliver
1675d49b4c log_core: Add Kconfig symbol for init priority
Users may want to do some configuration after the kernel is up, but
before initializing the log_core. Making the log_core's init priority
configurable makes that possible.

Signed-off-by: Ian Oliver <io@amperecomputing.com>
2022-12-14 15:16:54 +01:00
Emil Gydesen
5102950adc sample: Bluetooth: Add PA interval check in iso broadcast benchmark
Verify that the peridic advertising interval is non-0 to
ensure that the remote device is actually advertising
with peridic advertising enabled.

This fixes an issue where per_interval_ms would be set to 0,
causing bt_le_per_adv_sync_create to fail to invalid values.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-12-14 15:00:13 +01:00
Marcin Niestroj
2d3365200c settings: file: drop CONFIG_SETTINGS_FILE_DIR
There is already CONFIG_SETTINGS_FILE_PATH, which is set to full file path,
while CONFIG_SETTINGS_FILE_DIR is required to be set to its parent
directory. This is redundant, as parent directory path can be easily found
out either during runtime or optionally during buildtime by CMake.

CONFIG_SETTINGS_FILE_DIR was actually introduced recently after Zephyr 3.2
release as a replacement of deprecated CONFIG_SETTINGS_FS_DIR. This means,
that there is no need to deprecate it for 3.3 release and dropping it
should be fine. Adjust 3.3 release notes accordingly, so that
CONFIG_SETTINGS_FILE_PATH will be used directly.

This patch stops using deprecated CONFIG_SETTINGS_FS_DIR. There is actually
no value in respecting it, as setting anything other than parent directory
of CONFIG_SETTINGS_FS_FILE makes no sense.

There is actually one use of CONFIG_SETTINGS_FILE_DIR in file backend
tests, to derive directory for files containing tested settings.
CONFIG_SETTINGS_FILE_PATH is not used there, so it makes little sense to
derive directory name from it. Instead, just use hardcoded "/settings"
subdirectory, as this was the default value of CONFIG_SETTINGS_FILE_DIR.

Deriving parent directory can be done either in runtime or in
buildtime (e.g. using some helper CMake function). Doing it in runtime
however allows to create directory recursively (which this patch actually
implements), e.g. for some more nested FS tree structure. Additionally it
will simplify migration of settings configuration from Kconfig to
device-tree (yet to be developed feature).

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2022-12-14 14:11:03 +01:00
Marcin Niestroj
f386967b06 settings: do not panic on backend initialization errors
There is little reason to panic on settings backend initialization error.
Such behavior was introduced with initial settings subsystem support, which
was adapted from MyNewt. This is not the usual way how Zephyr handles
errors, so it is time to change that.

There is already handling of some errors by simply returning / propagating
them to caller. Rework all the paths that resulted in k_panic() to also
return error codes.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2022-12-14 14:10:55 +01:00
Tomasz Moń
fed6bde788 usb: device: cdc_acm: send more than 1 byte in poll out
Schedule CDC ACM tx work to happen 1 ms after first unprocessed data
write. This gives enough leeway for the task writing to the queue to
write more than 1 byte before USB workqueue preempts and schedules IN
transfer. Sending more than 1 byte at a time increases data throughput
because transaction overhead remains the same regardless of packet size.

Prior to this change, virtually every IN transaction carried only one
character when CDC ACM was used as a console.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2022-12-14 12:07:33 +01:00
Johann Fischer
95717520bf drivers: udc: do not call driver's dequeue on empty fifo
Do not call driver's dequeue implementation if endpoint fifo
is empty.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2022-12-14 12:06:03 +01:00
Johann Fischer
721b8c22d8 drivers: udc_nrf: dequeue instantly when endpoint is not busy
In the case that IN endpoint is not busy there will be
no notification from the HAL driver.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2022-12-14 12:06:03 +01:00
Johann Fischer
33a8635008 tests: drivers: udc: fix uninitialized variable and thread
Variable to get MPS supported by the controller was used
uninitialized. This caused the test to fail depending on
the memory state.

test_udc_device_get has to be called only once, at the very
beginning. This was overlooked during migration to new test API.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2022-12-14 12:06:03 +01:00
Michal Moskal
d46b9bd124 drivers: hwinfo: Implement hwinfo_get_device_id for ESP32-C3
ESP32-C3 uses different fuse addresses for storing the MAC addr,
but the the format is the same.

Signed-off-by: Michal Moskal <michal@moskal.me>
2022-12-14 09:51:44 +01:00
Marco Argiolas
f8f3629efd net: lib: lwm2m: add uCIFI LPWAN object
Add support for Low Power Wide Area Network (LPWAN) Object (ID 3412)

Signed-off-by: Marco Argiolas <marco.argiolas@ftpsolutions.com.au>
2022-12-14 09:51:38 +01:00
Dino Li
2ecdd8fa89 ITE soc/it8xxx2/linker: add sections for hw sha256 calculation
IT8XXX2 HW support sha256 calculation, and its calculation is
faster than FW. We place SHA256 message, hash and key data
(total 512bytes) in RAM. If we enable hw sha256, because
HW limits, the sha256 data must place in first 4KB of RAM.
We add sections for hw sha256 calculation in linker.

Signed-off-by: Dino Li <Dino.Li@ite.com.tw>
Signed-off-by: Ruibin Chang <Ruibin.Chang@ite.com.tw>
2022-12-14 09:51:25 +01:00
Jay Vasanth
739b8e6f36 mec172xmodular_assy6930: add board support
Add board files and documentation for mec172xmodular_assy6930.
This is for MEC172x Modular Card support.

Signed-off-by: Jay Vasanth <jay.vasanth@microchip.com>
2022-12-14 09:51:17 +01:00
Tom Burdick
603cc27045 dma: Add max block count attribute
Adds an attribute that describes the maximum number of scatter gather
blocks that the DMA will accept. Useful in cases where DMA is used as
the abstraction for moving data around (e.g. SoF audio streams) and
variances of the hardware need to inform decisions about how to use
the DMA API.

Co-authored-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
Co-authored-by: Jaska Uimonen <jaska.uimonen@intel.com>
Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2022-12-14 09:51:10 +01:00
Patryk Duda
17d3f3a5a0 boards: arm: Introduce Google Dragonclaw Development Board
Dragonclaw is a board created by Google for fingerprint-related
functionality development. Board schematics, layout and BOM is
available at:
https://chromium.googlesource.com/chromiumos/platform/ec/+/HEAD/docs/schematics/dragonclaw

Signed-off-by: Patryk Duda <pdk@semihalf.com>
2022-12-13 20:08:10 +00:00
Evgeniy Paltsev
d0f08e5422 tests: ARC: MWDT: allow allow-cpp.libcxx.arcmwdtlib for all arc targets
Allow allow-cpp.libcxx.arcmwdtlib for all arc targets in case of
ARC MWDT toolchain.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
2022-12-13 18:45:44 +01:00
Marcin Niestroj
ffa622b5b9 tests: settings: file: merge file_littlefs
There is little point in keeping separate:
 * tests/subsys/settings/file
 * tests/subsys/settings/file_littlefs

directories, `file_littlefs` is just a thin layer used to setup test suites
for tests implemented in `file` directory.

Merge both directories together. Support for new FS can be added by simply
adding:
 * new `settings_setup_<FS_OF_CHOICE>.c` which implements
   `config_setup_fs()` function
 * expanding `testcase.yaml` to add new tests with
   `CONFIG_FILE_SYSTEM_<FS_OF_CHOICE>=y` extra config option

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2022-12-13 18:45:30 +01:00
Marcin Niestroj
ba4cea40fd tests: settings: file_littlefs: relax dependency on LittleFS
Do some internal renaming to relax dependency on using LittleFS
specifically, making this test likely to be run on any FS.

Rename device-tree partition name `littlefs_dev` ->
`settings_file_partition`, so as does not need to be LittleFS to be
mounted and used for File settings storage.

Rename `config_setup_littlefs()` to `config_setup_fs()`, which can be
implemented for any other FS of choice.

Change FS mount point from '/littlefs' to '/fs'.

Rename `settings_test_littlefs.c` -> `settings_test_fs.c`, as this one just
defines test suites and there is nothing LittleFS specific.

Build `settings_setup_littlefs.c` only when
`CONFIG_FILE_SYSTEM_LITTLEFS=y`, so that any other FS can be added at a
later point with its specific implementation of `config_setup_fs()`
function.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2022-12-13 18:45:30 +01:00
Marcin Niestroj
413f849785 tests: settings: file_littlefs: fix comment about LittleFS
Fix a leftover from copy-pasted NFFS tests:
 * s/NFFS/LittleFS/
 * s/strcut/struct/

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2022-12-13 18:45:30 +01:00
Marcin Niestroj
f5ded678c5 tests: settings: file_littlefs: move prototype to header file
Move `config_setup_littlefs()` prototype to header file, so that potential
type mismatch will be detected by both `settings_setup_littlefs.c`
implementing it and `settings_test_littlefs.c` using it.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2022-12-13 18:45:30 +01:00
Dominik Ermel
5d482b5c0e doc/release: Add note on FAT driver update to 0.15
Added note on updating FAT driver to version 0.15 with patch1

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-12-13 10:44:01 -06:00
Dominik Ermel
a724ebe7f7 fs/fatfs: Update FAT FS support code for version 0.15 w/patch1
The commit applies small changes in ELM FAT driver support code,
required by the driver update to version 0.15.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-12-13 10:44:01 -06:00
Dominik Ermel
b57f237dc4 manifest: FAT FS module version upgrade to 0.15
The commit updates manifest entry for FAT FS driver to include
update to version 0.15.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-12-13 10:44:01 -06:00
Carlo Caione
c464a962e1 cache: Add documentation
To disambiguate the Kconfig options available to the user.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-12-13 16:31:42 +00:00
Carlo Caione
a031ecdc9d cache: Fix the doxygen documentation
And create a new group.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-12-13 16:31:42 +00:00
Marek Matej
e4dcccc856 manifest: update hal espressif
Add latest peripheral support to hal.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2022-12-13 16:29:38 +00:00
Marek Matej
984b2467c0 tests: dac: esp32: API test for CI
Add base DAC test used during CI.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2022-12-13 16:29:38 +00:00
Marek Matej
85b879594d samples: board: esp32: DAC sample code
Sample code demonstrate the DAC on ESP32 and ESP32-S2

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2022-12-13 16:29:38 +00:00
Marek Matej
f86a7d2c25 drivers: dac: esp32: Add support for DAC controller
Initial DAC driver for the ESP32/ESP32-S2 SOCs

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2022-12-13 16:29:38 +00:00