Commit Graph

58400 Commits

Author SHA1 Message Date
Martí Bolívar 17ae4fe05a scripts: gen_dts_cmake: emit properties for /aliases
This enables cmake extensions that can look up the path for any
devicetree alias, or check if the alias is missing, etc.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-12-06 08:01:48 -05:00
Martí Bolívar b65b49bef6 scripts: gen_dts_cmake: a small optimization
Using edt.chosen_nodes looks like a simple attribute lookup, but it's
actually calling a property that will create a new list of chosen
nodes every time. Apply a small optimization by only creating the list
once.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-12-06 08:01:48 -05:00
Marc Reilly 54b6d26242 drivers: spi: add spi-bitbang driver
This adds an spi master mode driver via bitbanged gpio. Only syncronous
transfers are implemented. Clock signal timing is accomplished via busy
waits, the gpios are manipulated via the standard gpio interface; these
two factors limit the frequency at which it can operate - but here
a simple and generic implementation was chosen over performance.

The driver supports the various clock polarity and phase
configurations, and can also work with word sizes which are non
multiples of 8bits, currently up to 16 bits.

A sample program is also added demonstrating basic use of the driver
with 9bit data words.

Signed-off-by: Marc Reilly <marc@cpdesign.com.au>
2021-12-06 07:29:45 -05:00
Alex Kolosov f374d6b1f1 scripts: runners: Add west flash command for B91 platform
This commit implements west flash command for Telink B91 platform.
west flash command uses ICEman and SPI burn from AndeSight for flashing.

Signed-off-by: Alex Kolosov <rikorsev@gmail.com>
2021-12-06 07:28:38 -05:00
Anas Nashif 329321714d actions: reset git tree after rebase issues/conflict
We are reusing already checked out trees that might be in the middle of
a rebase or conflict. Remove files preventing us from doing another
rebase after the tree was reset.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-12-05 10:53:50 -05:00
Anas Nashif 77a7df31e5 ci: fix test plan for smaller sets
We were missing smaller sets and skipping tests when the set is smaller
than the allowed number of tests per node.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-12-05 10:53:50 -05:00
Anas Nashif 0e2c0767ca actions: twister: upload junit report as an artifact
Merge all results from all nodes and generate an HTML report and upload
it as an artifact for review of failures offline.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-12-05 10:53:50 -05:00
Anas Nashif d9c5aee2c9 actions: twister: fix schedule condition
Fix shell condition syntax.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-12-05 10:53:50 -05:00
Daniel Leung d387c863bb kernel: mem_domain: remove extra slash in Z_PROGBITS_SYM
The macro Z_PROGBITS_SYM has "\%" but this is not correct
usage to escape "%". So remove the extra slash. Note that
this macro is used directly to generate assembly code
so it cannot be "%%" as in escaping "%" in printf().

Fixes #40439

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-12-05 10:22:26 -05:00
Gerard Marull-Paretas 7bfd0976aa pm: state: PM_STATE_DT_ITEMS_LEN->DT_NUM_CPU_POWER_STATES
Rename PM_STATE_DT_ITEMS_LEN to DT_NUM_CPU_POWER_STATES to make its
purpose more clear. This macro could be made part of a Devicetree API
for PM in the future.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-12-04 12:33:57 -05:00
Gerard Marull-Paretas 5ab7d35e7c pm: state: PM_STATE_DT_ITEMS_LIST->PM_STATE_LIST_FROM_DT_CPU
Rename the PM_STATE_DT_ITEMS_LIST macro to PM_STATE_LIST_FROM_DT_CPU to
make its purpose more clear. Similar naming scheme is found e.g. in the
GPIO API.

Associated internal macros and docstrings have been adjusted, too.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-12-04 12:33:57 -05:00
Gerard Marull-Paretas fa96955305 pm: state: PM_STATE_INFO_DT_ITEMS_LIST->PM_STATE_INFO_LIST_FROM_DT_CPU
Rename the PM_STATE_INFO_DT_ITEMS_LIST macro to
PM_STATE_INFO_LIST_FROM_DT_CPU to make its purpose more clear. Similar
naming scheme is found e.g. in the GPIO API.

Associated internal macros and docstrings have been adjusted, too.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-12-04 12:33:57 -05:00
Gerard Marull-Paretas e1ba1e5209 pm: state: fix PM_STATE(_INFO)_DT_ITEMS_LIST docs
node_id is for a CPU node, not a zephyr,power-state compatible.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-12-04 12:33:57 -05:00
Gerard Marull-Paretas b8a6223deb pm: state: convert PM_STATE_DT_ITEM to standalone initializer
PM_STATE_DT_ITEM could not be used as a standalone initializer since it
had a trailing ',', making it an internal helper in practice.  This
change renames the macro to PM_STATE_DT_INIT, and moves the ',' to the
UTIL_LISTIFY helper.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-12-04 12:33:57 -05:00
Gerard Marull-Paretas 68372aa562 pm: state: convert PM_STATE_INFO_DT_ITEM to standalone initializer
PM_STATE_INFO_DT_ITEM could not be used as a standalone initializer
since it had a trailing ',', making it an internal helper in practice.
This change renames the macro to PM_STATE_INFO_DT_INIT, and moves the
',' to the UTIL_LISTIFY helper.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-12-04 12:33:57 -05:00
Gerard Marull-Paretas 5d5b2809b0 pm: state: improve formatting
- stick to 80 cols
- push macros '\' to 80 cols
- remove spaces from code examples
- add missing power-states node in example code

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-12-04 12:33:57 -05:00
Gerard Marull-Paretas 7a5cd51052 pm: state: simplify DT macros
Use DT_PHANDLE_BY_IDX in the intermediate UTIL_LISTIFY helper so that
initializer macros receive the node with properties of intereset.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-12-04 12:33:57 -05:00
Gerard Marull-Paretas 0735160336 codeowners: drivers: timer: include Kconfig files
Make the timer drivers expression more generic to cover both
implementation and Kconfig files.

Missing drivers were added to pass compliance checks. Owners added based
on maintainership, driver author, etc.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-12-04 07:34:53 -05:00
Gerard Marull-Paretas 493b6786ab drivers: timer: fix MISRA 5.7 violation
A couple of drivers violated MISRA 5.7 rule (Tag name should be unique),
triggering CI compliance errors.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-12-04 07:34:53 -05:00
Gerard Marull-Paretas 7d1bfb51ae drivers: timer: cortex_m_systick: improve ISR installation
A Cortex-M specific function (sys_clock_isr()) was defined as a weak
function, so in practice it was always available when system clock was
enabled, even if no Cortex-M systick was available. This patch
introduces an auxiliary Kconfig option that, when selected, the ISR
function gets installed. External SysTick drivers can also make use of
this function, thus achieving the same functionality offered today but
in a cleaner way.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-12-04 07:34:53 -05:00
Gerard Marull-Paretas 78dc8ce338 drivers: timer: improve sys_timer_disable usage
- Remove the weak symbol definition
- Notify about the capability of disabling via a selected Kconfig option
  (CONFIG_SYSTEM_TIMER_HAS_DISABLE_SUPPORT)
- Provide a dummy inline function when the functionality is not
  available

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-12-04 07:34:53 -05:00
Gerard Marull-Paretas 24a169e329 drivers: timer: split Kconfig
Split Kconfig into individual files for each driver. This improves
overall readability of the Kconfig options.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-12-04 07:34:53 -05:00
Gerard Marull-Paretas b1ced75386 drivers: timer: move initialization setup to drivers
The weak symbol sys_clock_driver_init has been removed, therefore moving
the init responsability to the drivers themselves. As a result, the init
function has now been made static on all drivers and moved to the
bottom, following the convention used in other areas.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-12-04 07:34:53 -05:00
Tom Burdick 7b1349cfe6 stats: i2c: I2C stats
Adds the ability for I2C drivers to report synchronous transfer stats
using a I2C specific macro to define the device instance.

The macro creates a container for device_state which allows for per
instance device class common data structure to be used in the device
class api (ex: i2c.h). This is used to maintain per driver instance
stats for all i2c drivers. This is a reusable idea across other device
classes as desired.

Using Kconfig device class stats may be turned on/off individually
this way as well, in this case I2C_STATS.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2021-12-04 07:22:56 -05:00
Tom Burdick e29d9e1e2f checkpatch: Add UTIL_CAT support to checkpatch
Checkpatch was checking for macro concats (##), however
we often use UTIL_CAT to allow for multiple macro expansion passes
to succeed.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2021-12-04 07:22:56 -05:00
Krzysztof Chruscinski f346af2c58 logging: Extend support for compilation with up to 31 arguments
Logging v2 supports 255 arguments but since logging v1 was supporting
only 15, and it is still compiled, more than 15 could not be used.
Extending logging v1 macro to accept up to 31 arguments. It will fail
during processing in case of v1 but will work with v2 enabled. It is
a temporary solution since v1 will be removed at some point.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-12-04 12:19:27 +01:00
Johann Fischer 35691d21d8 tests: thread_apis: fix cast to smaller integer type
Clang 12.0.0 complains about
"cast to smaller integer type 'enum control_method' from 'void *'
[-Werror,-Wvoid-pointer-to-enum-cast]".
Cast it to intptr_t type first.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-12-04 12:09:54 +01:00
Trond Einar Snekvik 6a8326ff1e modules: Use posix paths in Kconfig module prompts
kconfiglib doesn't render backslashes in menu strings, and the prompts
in the module menu will be unintelligible on Windows. Print these
menus as posix paths on Windows as well, so they don't look broken in
menuconfig.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2021-12-03 16:50:31 -06:00
Glauber Maroto Ferreira 31e5b1b861 soc: esp32s2: fix: data cache setup
data cache mode setup and enabling should be done only when
CONFIG_ESP_SPIRAM is enabled. Otherwise, memory layout will
conflict with defaults.

Signed-off-by: Glauber Maroto Ferreira <glauber.ferreira@espressif.com>
2021-12-03 16:45:16 -06:00
Daniel DeGrasse fe321920f5 boards: mimxrt1160_evk: Enable PWM for RT1160 EVK
Enables PWM for RT1160 EVK. Tested with sample led_pwm

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2021-12-03 16:44:12 -06:00
Daniel DeGrasse 20b43d7e8d boards: mimxrt1170_evk: Enable PWM on RT1170 EVK
PWM is enabled on RT1170 EVK, for both Cortex M4 and M7 cores. Tested
using led_pwm sample.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2021-12-03 16:44:12 -06:00
Daniel DeGrasse b0dfda1584 drivers: pwm_mcux: Update MCUX pwm driver to use clock bindings
MCUX PWM driver used hardcoded clock source. update driver to use clock
bindings to determine PWM peripheral clock frequency.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2021-12-03 16:44:12 -06:00
Bryce Wilkins 219bf88fe8 drivers: spi: Add optional delays to mcux flexcomm spi driver
Adds optional device tree properties to insert delays between spi chip
select assert/deassert and the clock edges, and also between spi
frames and transfers to the mcux flexcomm spi driver. If the properties
are not set, no additional delay is inserted.

Verified expected behavior on mimxrt685_evk and check with a scope
that the pre- and post-delay could be changed from the device tree
properties.

Signed-off-by: Bryce Wilkins <bryce.wilkins@gmail.com>
2021-12-03 16:42:10 -06:00
Emil Gydesen 4b822395ed Bluetooth: Audio: Add check conn in VCS client notify handler
As per the GATT documenation, the conn pointer may actually
be NULL in the notify callback, indicating that the connection
is being unpaired.

Add a check for conn == NULL to avoid calling bt_conn_index
on a NULL pointer.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-12-03 17:40:21 +02:00
Maureen Helm 2cf91050c8 cmake: Fix invalid warning related to rimage
Fixes an issue on SOF-supported boards where the build system
incorrectly believed that the rimage target was changing when rerunning
CMake, even though the user did not change any configuration. This issue
was introduced in commit 525fa76f4d.

Create initial build dir:
$ west build --board intel_adsp_cavs18 samples/subsys/audio/sof

Re-run CMake with no arguments in that build dir:
$ cd build
$ cmake .

CMake Warning at /home/mhelm/zephyrproject/zephyr/cmake/extensions.cmake:2403 (message):
  The build directory must be cleaned pristinely when changing rimage target,

  Current value="", Ignored value="cnl"
Call Stack (most recent call first):
  /home/mhelm/zephyrproject/zephyr/cmake/extensions.cmake:829 (zephyr_check_cache)
  /home/mhelm/zephyrproject/zephyr/boards/xtensa/intel_adsp_cavs18/board.cmake:6 (board_set_rimage_target)
  /home/mhelm/zephyrproject/zephyr/cmake/app/boilerplate.cmake:635 (include)
  /home/mhelm/zephyrproject/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)
  /home/mhelm/zephyrproject/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:40 (include_boilerplate)
  CMakeLists.txt:5 (find_package)

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2021-12-03 07:53:19 -05:00
Nicolas VINCENT 561ae900b5 actions: compliance: quote around var
If variable exit is not defined, the test is not properly executed.
Note that in case of an actual error the var would be defined and the
test executed properly.

Signed-off-by: Nicolas VINCENT <nicolas.vincent@vossloh.com>
2021-12-03 07:42:17 -05:00
Gerard Marull-Paretas 92b9aff9b3 scripts: checkpatch: typedefsfile: add pinctrl_soc_pin_t
The pinctrl_soc_pin_t is used as an opaque type in pinctrl to store pin
configurations which are SoC dependent.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-12-03 13:21:40 +01:00
Gerard Marull-Paretas 05284cfe17 doc: style admonitions
Only certain type of admonitions were styled (e.g. notes, warnings,
etc.). This change also styles generic admonitions such as:

```rst
... admonition:: Rationale

    ...
```

Fixes #40622

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-12-03 13:20:27 +01:00
Kai Vehmanen af79664da3 soc: cavs_v25: increase core count default to 4
The default config for cavs25 should be a 4 core config. Variants that
have less cores, need to override the config option to a smaller value.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2021-12-02 23:56:27 -05:00
Gerard Marull-Paretas 76aa706461 tests: subsys: logging: log_msg2: disable some tests on qemu_cortex_a9
logging.log_msg2_64b_timestamp and logging.log_msg2_fp_64b_timestamp are
currently failing on qemu_cortex_a9 due to #39978. Disable them on that
platform until the issue is fixed.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-12-02 23:55:23 -05:00
Sören Tempel fd089b361d uart: sifive: align txcnt of UART1 with UART0
The UART1 is not actually accessible on the HiFive1 since the
QFN48 package for the FE310, used by this board, does not expose the
required pads. However, it is still possible to use the UART1 on HiFive1
emulators (e.g. using UART0 for debugging and UART1 for SLIP).

Unfortunately, the UART0 and UART1 currently have different default
configurations when it comes to the configured transmission watermark
(txcnt). With a txcnt of zero (the default for UART1) the UART is not
actually usable (see #18118). Contrary to UART0 (see #23699), the UART1
does therefore not work by default on Zephyr which took me some time to
figure out.

This commit aligns the default UART1 configuration with the UART0,
thereby making it work by default.

Signed-off-by: Sören Tempel <tempel@uni-bremen.de>
2021-12-02 11:42:46 -06:00
Yuguo Zou abeaf94855 soc: arc: fix ARC_HAS_ACCL_REGS settings
ARC_HAS_ACCL_REGS should set to y to protect ACCL and ACCH registers
during irq. These registers could be used as GPRs by compilers and
therefore need store/restore during irq.

Signed-off-by: Yuguo Zou <yuguo.zou@synopsys.com>
2021-12-02 11:32:14 -06:00
Lucien Zhao f18df298f4 boards: arm: mimxrt1170_evk: Add rt1170_cm4 core debug way
Add cm4 core debug way into board.cmake

Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
2021-12-02 09:35:06 -06:00
Carles Cufi e3c6538344 tests: logging: Disable log2 deferred tests on qemu_cortex_a9
As described in #39978, an issue is currently preventing those tests
from executing correctly. Disable them until a fix is found.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2021-12-02 06:27:20 -06:00
Anas Nashif c8fd21d204 actions: twister: remove existing ccache directory
if .ccache exists, remove it and replace it with new .ccache directory.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-12-02 05:48:47 -05:00
Henrik Brix Andersen 8d5a0664d2 drivers: can: fix can_configure() when CAN-FD is enabled
Currently, can_configure() pass a hard-coded 0 for the data bitrate
(which is only used for CAN-FD), breaking this API for CAN-FD enabled
applications.

Instead pass in the provided bitrate for both arbitration phase and data
phase.

Fixes: #34375

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-12-02 10:55:03 +01:00
Henrik Brix Andersen 2cc3fab62f drivers: can: deprecate can_configure()
The can_configure() API call does not handle CAN-FD bitrates. Deprecate
the can_configure() API wrapper function in favour of the newer
can_set_bitrate() and can_set_mode() functions.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-12-02 10:54:44 +01:00
Henrik Brix Andersen 53f85df551 modules: canopennode: switch to using can_set_mode()
Switch from using can_configure() to using can_set_mode() for disabling
CAN controller transmissions.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-12-02 10:54:44 +01:00
Marek Pieta 0a1f553dc2 Bluetooth: host: Remove CCC update from GATT connected callback
The CCC update should be done after the connection is encrypted.
Before the connection is encrypted, the GATT Server does not know
if the reconnecting peer was actually bonded.

Fixes: #40759

Signed-off-by: Marek Pieta <Marek.Pieta@nordicsemi.no>
2021-12-02 10:54:22 +01:00
Paul He 2bf27f5953 samples: prod_consumer: use app_shared.h instead of main.h
Normally main.c file doesn't have a header file, because it doesn't
need to declare any interfaces to other modules.

In this sample, it's better to put the shared variables in one place,
and provide the interfaces to other modules, such as app_a, app_b,
and main.

Signed-off-by: Paul He <pawpawhe@gmail.com>
2021-12-02 10:53:55 +01:00