Commit graph

57737 commits

Author SHA1 Message Date
Maureen Helm
836651b453 drivers: gpio: Refactor drivers to use shared init priority
Refactors all of the on-chip GPIO drivers to use a shared driver class
initialization priority configuration, CONFIG_GPIO_INIT_PRIORITY, to
allow configuring GPIO drivers separately from other devices. This is
similar to other driver classes like I2C and SPI.

Most drivers previously used CONFIG_KERNEL_INIT_PRIORITY_DEFAULT or
CONFIG_KERNEL_INIT_PRIORITY_DEVICE, therefore the default for this new
option is the lower of the two, which means earlier initialization.

Driver-specific options for off-chip I2C- or SPI-based GPIO drivers are
left intact because they often need to be initialized at a different
priority than on-chip GPIO drivers.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2021-11-15 14:38:55 -05:00
Anas Nashif
a5c2a6169b actions: footprint: fix csv formatting
Fix formatting of plan.txt CSV file and make it parseable by script.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-11-15 11:12:05 -05:00
Nicolas Pitre
5aeb809374 lib/os/heap-validate: code cleanup
Remove code duplication, use common code idiom, etc.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2021-11-15 11:03:57 -05:00
Nicolas Pitre
f13387d8d2 lib/os/heap: fix a type
Rationale in commit b1eefc0c26 ("lib/os/heap: straighten up our type
usage").

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2021-11-15 11:03:57 -05:00
Eug Krashtan
806ce3723d net: coap: add response code 4.29
Extend coap.h with response code "Too Many Requests" according
to RFC 8516

Signed-off-by: Eug Krashtan <eug.krashtan@gmail.com>
2021-11-15 10:14:42 -05:00
Gerard Marull-Paretas
fc4e8b016d tracing: macros: improve Doxygen
- Include macros in the `subsys_tracing` group
- Hide internal macros/helpers
- Fix incorrect usage of @def
- Add missing parameter docs

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-15 10:12:56 -05:00
Gerard Marull-Paretas
c8b5b0c6fc tracing: format: improve Doxygen
- Add APIs to the `subsys_tracing` group
- Add some missing documentation
- Minor header file style fixes

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-15 10:12:56 -05:00
Gerard Marull-Paretas
ffebac6578 tracing: improve Doxygen structure
- Add tracing to the subsys group
- Use `subsys_tracing` "namespace"
- Some minor header style improvements

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-15 10:12:56 -05:00
Christopher Friedt
6735f11bac Bluetooth: Audio: otc: update print format specifier for atomics
Atomics changed from `int` to `long` and print format specifiers
must be updated as well.

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2021-11-15 09:59:01 -05:00
Christopher Friedt
ed7eec4c94 tests: kernel: atomics: expand atomic operations to 64-bit
This change updates the atomic tests to validate 32-bits on
32-bit architectures and 64-bits on 64-bit architectures.

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2021-11-15 09:59:01 -05:00
Christopher Friedt
b00619118d west.yml: sof: update audio/sof for long atomic_t
The audio/sof Zephyr module needed print specifiers updated
for the transition from `int` to `long` for `atomic_t`
which supports 32-bit atomics and also 64-bit atomics.

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2021-11-15 09:59:01 -05:00
Christopher Friedt
829eec9ec5 portability: cmsis: use correct type for atomics
With the change of `atomic_t` from `int` to `long` there
were a few places where there was some type aliasing
occuring.

Update CMSIS to use `atomic_t` rather than `int` for all
atomic operations.

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2021-11-15 09:59:01 -05:00
Christopher Friedt
7c6039a1d2 drivers: serial: nrfx: refactor for atomic_t as long
This driver aliases a regular `int` to `atomic_t` but that
should be updated to `long` with the change to `atomic_t`.

Added a comment to highlight that the variable was aliased.

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2021-11-15 09:59:01 -05:00
Christopher Friedt
3e86c627f7 kernel: atomics: update print specifiers for atomic_t
The print specifier for `atomic_t` should be updated
to `%ld`, `%lu`, or `%lx` to account for the type
change of `atomic_t` to `long`.

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2021-11-15 09:59:01 -05:00
Christopher Friedt
80f73a053f doc kernel: atomics: support for 64-bit atomic operations
By redefining `atomic_t` as `long`, the type is 32-bit on
32-bit architectures and 64-bit on 64-bit architectures.

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2021-11-15 09:59:01 -05:00
Christopher Friedt
174cb7f9f1 kernel: atomics: support for 64-bit atomic operations
With this change, `atomic_t` is 32-bit for 32-bit architectures
and 64-bit for 64-bit architectures. More specifically,
`sizeof(atomic_t) == sizeof(long)`.

Fixes #39530

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2021-11-15 09:59:01 -05:00
Andy Ross
0b400d86c0 drivers/timer/cavs_timer: Fix race in k_cycle_get_64()
In commit 918a574c88 ("clock: add k_cycle_get_64") this driver was
augmented with a count64() method to get a 64 bit cycle output from
the two-32-bit-word device registers.

Unfortunately it appeared to be trying to use a spinlock around the
two (low/high) reads to protect against overflow.  But that doesn't
work: spinlocks protect against other CPU code using the same
spinlock, not against a hardware counter that is incrementing in real
time!

Thankfully there was already a count() routine in place that does a
detect-overflow-and-retry loop to solve this.  Use that.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-11-15 09:54:31 -05:00
Emil Lindqvist
f0af9275ed logging: typecast to stop signed-unsigned comparison
If source_id is -1, which is a valid value, it will be
converted to unsigned since it's compared with an unsigned
which means it will be huge and asserts will trigger. To avoid
this, we typecast the unsigned part to signed.

Resolves #40115

Signed-off-by: Emil Lindqvist <emil@lindq.gr>
2021-11-15 08:53:51 -05:00
Enjia Mai
9ed986ae64 tests: logging: adjust the structure of logging test cases
Adjust the logging test case code to make them the same as other test
cases which deal with the CONFIG_USERSPACE used. It does not change
the original test logic, but just the file structure changed.

It also corrects the duplicated testsuite name of logging testcases.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2021-11-15 10:17:25 +01:00
Anas Nashif
7424126060 boards: qemu_cortex_a9: use SUPPORTED_EMU_PLATFORMS
We moved from EMU_PLATFORM to SUPPORTED_EMU_PLATFORMS.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-11-14 10:11:06 -05:00
Anas Nashif
c3a1b4e8f3 action: codecov: do not run on weekends
No need to run on weekends, nothing much happens, so lets save some
resources.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-11-13 17:29:54 -05:00
Anas Nashif
5ce51a91da actions: fix typo in clang action
Fix a minor typo in action and always set variable controlling reports.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-11-13 17:29:54 -05:00
Anas Nashif
5832a8e19f action: configure git user
Configure git for rebase by setting user name, email.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-11-13 15:19:38 -05:00
Anas Nashif
8a4f0ae889 actions: optimize clang actions
- use zephyr runner
- reduce number of builders and adapt matrix to be platform based
- check for changed files and optimize run accordingly, should reduce
  build times depending on what has changed
- If no source has changed, skip twister completely.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-11-13 09:30:25 -05:00
Emil Gydesen
7b73472139 Bluetooth: shell: Enable ISO for the BT shell
Enable ISO (unicast and broadcast) for the BT shell.
This allows users to use the ISO features (if supported by
the controller) in the shell.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-11-13 08:00:16 -05:00
Gerard Marull-Paretas
392a0bee31 doc: guides: pm: system: improve some sentences
Improve some sentences to make them easier to understand.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-13 07:59:51 -05:00
Gerard Marull-Paretas
f51f5276b5 doc: reference: drivers: remove incorrect reference
The PM documentation does not provide any details on usage of
SYS_DEVICE_DEFINE, so remove the reference.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-13 07:59:51 -05:00
Gerard Marull-Paretas
a4d257f19b doc: guides: pm: device_runtime: new guide
Add a new and more extensive guide that describes the device runtime
API. It contains a brief introduction, API design principles and goals,
some example sequence diagrams and usage guidelines.

While the API still needs important additions, such a guide will
hopefully guide developers when trying to deal with device PM in Zephyr.

Note: sequence diagrams have been created using PlantUML (2021 version).
The rendered SVG diagrams embed the original code if they have to be
edited and re-rendered.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-13 07:59:51 -05:00
Gerard Marull-Paretas
40a94743a3 doc: guides: pm: device_runtime: remove outdated statement
The device runtime API does no longer use pm_device_state_set().

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-13 07:59:51 -05:00
Gerard Marull-Paretas
f28b57ff8d doc: guides: pm: system: fix DT bindings references
Use the :dtcompatible: role to refer to DT bindings.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-13 07:59:51 -05:00
Gerard Marull-Paretas
68db978fb2 doc: guides: pm: device_runtime: remove API definitions
The API is already rendered automatically by breathe, so do not manually
add definitions again.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-13 07:59:51 -05:00
Gerard Marull-Paretas
d1cb73a29c doc: guides: pm: device: remove API definitions
The API is already rendered automatically by breathe, so do not
duplicate it manually.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-13 07:59:51 -05:00
Gerard Marull-Paretas
51dfd38baa doc: guides: pm: system: simplify C references
- Remove duplicated information (e.g. enum list, available in the API
  docs)
- Use C domain to reference

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-13 07:59:51 -05:00
Gerard Marull-Paretas
f64a9c1aba doc: reference: pm: include all API and move to pm
Include all API groups (some where missing) and move to pm folder
instead of power_management for consistency.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-13 07:59:51 -05:00
Gerard Marull-Paretas
cfa56f2ecb doc: reference: pm: remove Kconfig list
Kconfig options will be listed as needed in the guidelines.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-13 07:59:51 -05:00
Gerard Marull-Paretas
4d6803383d doc: pm: split sections and move to guides
Splitted the PM reference document into smaller chunks (overview,
system, device and device_runtime). Moved this content to the guides
section, since the documentation intent is to provide general PM subsys
information and usage guidelines.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-13 07:59:51 -05:00
Gerard Marull-Paretas
11cf06f5d5 doc: reference: pm: move terms to glossary
Glossary is a place where all terms can be defined, so move them there.
Some terms have been slightly adjusted and SOC interface remove since it
was not much relevant.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-13 07:59:51 -05:00
Joakim Andersson
4a60dce67c modules: tfm: Update crypto modules prompt strings
Update crypto modules prompt strings to follow the Kconfig guidelines.
"For a Kconfig symbol that enables a driver/subsystem FOO, consider
having just “Foo” as the prompt, instead of “Enable Foo support” or the
like."

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-11-13 07:58:50 -05:00
Joakim Andersson
aaa38bfcb6 modules: tfm: Split CRYPTO_ASYMMETRIC module into SIGN and ENCRYPT
The ASSYMETRIC crypto module has been split in two, for sign and
encrypt. Update Kconfig entries to match.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-11-13 07:58:50 -05:00
Joakim Andersson
81c5fb47a8 modules: tfm: Remove CRYPTO_GENERATOR_MODULE kconfig
Remove CRYPTO_GENERATOR_MODULE Kconfig which has been removed.
Its features are covered by TFM_CRYPTO_KEY_MODULE and
CRYPTO_KEY_DERIVATION_MODULE.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-11-13 07:58:50 -05:00
Herman Berget
49c2c37417 tests: bluetooth: tester: Reading multiple variable length
Adds support for reading multiple variable length characteristics.
Previously read_multiple() always set the variable flag to false.

This is used by GATT/CL/GAT/BV-03-C.

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2021-11-13 07:54:27 -05:00
Yasushi SHOJI
b48276e995 doc/application: Use tabs for Setting Variables
Setting variables for console is platform dependent.  Having
uninterested platform mixed in is too noisy and hard to read.  Follow
"Getting Started Guide" pattern to use tabs to group things.

Getting Started Guide uses "Ubuntu" to reference Linux based platform
but Application Development uses "Linux".  This commit doesn't change
the choice of words and sticks to "Linux".

The order of the platfroms is, OTOH, unified to "Linux/macOS" from
"macOS/Linux".

This commit only changes formatting, no wording change.

Signed-off-by: Yasushi SHOJI <yashi@spacecubics.com>
2021-11-12 21:34:29 -05:00
Filip Kokosinski
0851255258 boards: riscv: hifive1: add support for QEMU and Renode simulation
This commit adds required config files for Renode simulation and adds
missing QEMU_binary_suffix. It also adds flash and newlib tags to
ignore_tags, as flash chip is currently not provided by default in
Renode for FE310 and newlib does not fit into the available memory.

Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
2021-11-12 21:33:42 -05:00
Filip Kokosinski
5980f89e54 doc/application: add a note about choosing emulator platform
New targets have been added that allow the user to choose a specific
emulator platform. Inform about this in the docs.

Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
2021-11-12 21:33:42 -05:00
Filip Kokosinski
94428044e2 cmake: support multiple entries in board.cmake
Currently there is no way to support running a board on multiple
emulation platforms nor to choose a desired emulation platform for the
simulation to be run on. This commit introduces a new
SUPPORTED_EMU_PLATFORMS list, which defines available emulation
platforms for a given board.

Fixes #12375.

Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
2021-11-12 21:33:42 -05:00
Lixin Guo
6aa783ed6a kernel: mmu: exclude some funcs from coverage
page_frame_dump() and z_page_frames_dump() are used for
debug print, so there is no need to cover those funcs.
__weak function is also excluded, every test overrides it.

Signed-off-by: Lixin Guo <lixinx.guo@intel.com>
2021-11-12 11:57:50 -05:00
Lixin Guo
21e1e8cf23 tests: work_queue: add a test case for coverage
Add a test case for k_work_poll_cancel() API.

Signed-off-by: Lixin Guo <lixinx.guo@intel.com>
2021-11-12 11:56:23 -05:00
Ruibin Chang
e501c4a21a ITE boards/it8xxx2_evb: remove CONFIG_* not for every application
These drivers are no longer enabled for every application,
even hello_world. The right SoC-specific drivers are
enabled in applications that need them.

Signed-off-by: Ruibin Chang <Ruibin.Chang@ite.com.tw>
2021-11-12 10:25:47 -06:00
Ruibin Chang
4393f66ba2 ITE soc/riscv-ite/it8xxx2: move config to soc from board
Make config conditional and move to soc Kconfig.defconfig.series
from it8xxx2_evb_defconfig.

Signed-off-by: Ruibin Chang <Ruibin.Chang@ite.com.tw>
2021-11-12 10:25:47 -06:00
Sebastian Bøe
b39384f5df tf-m: Fix flashing of samples on nrf5340 and nrf9160 boards
Always flash the merged hex file.

This fixes flashing for samples. Before "west flash" only worked for
tests.

I don't know why this was not done from the get-go.

This also fixes builds that enables CONFIG_TFM_REGRESSION_NS, which will
use the tfm_ns application file instead of the zephyr application, and
will merge tfm_ns hex into the merged hex file. Otherwise the wrong
application hex file will be flashed.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-11-12 15:03:09 +01:00