Commit graph

60811 commits

Author SHA1 Message Date
Jedrzej Ciupis a0c868d94b dts: add binding for nrf-gpio-forwarder
In nRF53 family of SoCs, GPIO pins must be explicitly forwarded by the
application core to the network core if the latter should drive them.
Add a binding of a generic GPIO pin forwarder.

Signed-off-by: Jedrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
2022-02-22 15:00:35 -08:00
Chris Trowbridge 52bee41bba drivers: ipm: Add support for NXP i.MX rev2 MU
With a number of the i.MX SoCs (e.g., the i.MX8M Plus), NXP has moved to
supporting the integrated Cortex-M cores with the MCUXpresso SDK (MCUX).
As a result, certain Zephyr drivers (such as the IPM driver) need to be
updated to utlize this new MCUX-based SDK.

This change adds support for the MCUX Messaging Unit driver pulled in by
this PR:
https://github.com/zephyrproject-rtos/hal_nxp/pull/130

Additionally, this change enables the new IPM_IMX_REV2 config for the
mimx8ml8_m7 SoC target which utilizes this new revision of the driver.

Signed-off-by: Chris Trowbridge <chris.trowbridge@lairdconnect.com>
2022-02-22 16:34:06 -06:00
Gerard Marull-Paretas 9df8151623 drivers: misc: grove_lcd_rgb: use custom log level
The driver was re-using the display log level, however, it is no longer
part of the display driver category.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-02-22 11:58:33 -08:00
Gerard Marull-Paretas 0bc64307d4 drivers: misc: grove_lcd_rgb: cleanup driver
- Cleanup list of includes
- Remove unused structs/definitions
- Make init function static (is called by system init)
- Make config/data naming and access consistent
- Remove redundant zero initialization of data

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-02-22 11:58:33 -08:00
Gerard Marull-Paretas 825655f0dc drivers: misc: grove_lcd_rgb: use k_sleep
The driver is sleeping in milliseconds using a custom wrapper around
k_busy_wait, move to k_sleep.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-02-22 11:58:33 -08:00
Gerard Marull-Paretas 498579ae25 drivers: misc: grove_lcd_rgb: use i2c_dt_spec
Modernize the driver a little bit by using i2c_dt_spec. Note that the
RGB on its own is another I2C device connected to the same bus. Ideally,
both should be defined in Devicetree, but this has not been done for
now.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-02-22 11:58:33 -08:00
Gerard Marull-Paretas b7cbddba05 drivers: misc: grove_lcd: drop GROVE_LCD_NAME
Since the driver is now Devicetree based there are better ways to obtain
a reference to the device: use the DT node label with DEVICE_DT_GET or
continue using device_get_binding with the label defined in DT (an
arbitrary value).

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-02-22 11:58:33 -08:00
Gerard Marull-Paretas 5d7bd90529 samples: sensor: th02: add Grove LCD compatible to the filter
The sample required the Grove LCD, so add it to the filter.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-02-22 11:58:33 -08:00
Gerard Marull-Paretas 9bbdc24864 samples: sensor: th02: fix grove lcd usage
The sample enabled the Grove LCD by default in prj.conf, and in the
README it is clearly stated that the sample is intended to work using
the LCD module. This patch remove the unnecessary ifdeffery and obtains
a reference to the display at compile time.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-02-22 11:58:33 -08:00
Gerard Marull-Paretas b5b7579e72 samples: drivers: misc: grove_display: filter by DT compat enabled
Filter sample by checking if the Grove LCD compatible is enabled or not.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-02-22 11:58:33 -08:00
Gerard Marull-Paretas 5be50262ea samples: drivers: misc: grove_display: use DEVICE_DT_GET
Obtain a reference to the Grove LCD device at compile time.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-02-22 11:58:33 -08:00
Gerard Marull-Paretas 0bb486aa29 drivers: misc: grove_lcd: port to Devicetree
The driver was never migrated to Devicetree, this patch converts the
driver to a proper Devicetree based device.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-02-22 11:58:33 -08:00
Gerard Marull-Paretas 9a00b99884 drivers: display: grove_lcd_rgb: move to misc
The driver does not implement a display API, it has a custom API. Having
it under display is confusing, since display API consumers may expect
they can use it. These sort of custom drivers fit better under
drivers/misc.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-02-22 11:58:33 -08:00
Marc Herbert 2fdc551acc sign.py: stop ignoring the -- -c foo.toml option passed to rimage
The -c option points rimage at its main and mandatory configuration
file ("signing schema"). The -c option passed by sign.py to rimage comes
from _two_ different places:

A. From the command line, example:

   west sign -t rimage -- OTHER_ARGS_FOR_RIMAGE -c foo.toml

However passing -- -c signing_schema.toml on the west sign command line
has always been optional because:

B. west sign systematically adds another `-c bar.toml` option. The name
   'bar' is found in the CMakeCache. Right now 'bar' comes from
   a product specific `board.cmake` file.

There were two problems fixed by this commit:

1. The -c option from the command line was passed _first_ but the last
   -c wins with rimage. The command line should have precedence.

2. The "last -c wins" behavior is not documented/official, it's an
   rimage implementation deteail.

To fix both, simply scan the command line for a '-c' option. If any is
found then it takes precedence over the CMakeCache-based value which is
dropped.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-02-22 11:55:09 -08:00
Henrik Brix Andersen c4f229f98f samples: drivers: can: enable CAN statistics
Enable CAN controller device statistics support.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-02-22 11:54:27 -08:00
Henrik Brix Andersen 4f90a9aa86 drivers: can: mcux: flexcan: add statistics support
Add support for CAN controller statistics to the NXP MCUX FlexCAN
driver.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-02-22 11:54:27 -08:00
Henrik Brix Andersen 28b5cfd46c drivers: can: add statistics support
Add CAN controller device statistics support.

Initially the following per-device statistics are supported:
- Dominant bit transmission errors
- Recessive bit transmission errors
- Bit stuffing errors
- CRC errors
- Format errors
- Acknowledge errors

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-02-22 11:54:27 -08:00
Chris Trowbridge f401be157f drivers: gpio: Add GPIO support for mimx8ml8_m7 (NXP i.MX8M Plus SoC)
The current MCUX IGPIO driver assumes that the target SoC supports
the DR_SET, DR_CLEAR, and DR_TOGGLE functionality, but some do not
(namely, the M7 core of the i.MX8M Plus SoC). Current releases of
the MCUXpresso SDK IGPIO driver contain utility functions to set,
clear, and toggle pins which include provisions to support SoCs
with and without DR_SET, DR_CLEAR, and DR_TOGGLE, and this change
switches to using these utility functions.

Additionally, this change enables GPIO support on the mimx8ml8_m7
target.

Signed-off-by: Chris Trowbridge <chris.trowbridge@lairdconnect.com>
2022-02-22 10:13:31 -08:00
Robert Lubos 9ac83be650 net: lwm2m: Add proper resource-level discovery attribute handling
In case an individual resource is being discovered, the LwM2M client
should not only fill the attributes assinged at the resource level, but
also the ones inherited from the object and object instance levels.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2022-02-22 10:12:27 -08:00
Robert Lubos ac8881f170 net: lwm2m: Allow to write attributes for resource instances
LwM2M 1.1 allows to write attributes for resource instances as well.

Resource instance level attributes need also to be taken into
consideration when adding/updating observers.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2022-02-22 10:12:27 -08:00
Robert Lubos 3e861c04e9 net: lwm2m: Add LwM2M 1.1 discovery support
LwM2M adds Resource Instance reporting in Discovery response, along with
attributes assinged at the Resource Instance level.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2022-02-22 10:12:27 -08:00
Aleksandr Khromykh 5653358825 test: Bluetooth: Mesh: additional model extension checks
This PR add more checks for model extension functionality for BLE Mesh.
It adds checking of:
* Models across multiple elements (should not share subscription lists)
* Sibling models (if models that extend the same model share
  a subscription list)
* Subscription list entry allocation (models within extension list
  use subscription list capacity of each other).

Signed-off-by: Aleksandr Khromykh <Aleksandr.Khromykh@nordicsemi.no>
2022-02-22 10:11:20 -08:00
Anas Nashif f0676d960b tests: condvar: fix priorities to make tests run
Fix priorities for the test threads to allow execution when test thread
yields.
Also cleanup some strings.

Fixes #42723

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-02-22 13:10:26 -05:00
Andries Kruithof fefe959c06 Bluetooth: controller: llcp: update CMake version for unittesting
The minimum CMake version required is 3.20.0, but the unittests
for the LLCP controller still referred to 3.13.1 as the minimum

Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
2022-02-22 10:09:57 -08:00
Robert Lubos b3188fdd1c samples: net: sockets: big_http_download: Increase TCP recv window size
Increase TCP receive window size in the sample to improve the download
speed.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2022-02-22 10:09:45 -08:00
Robert Lubos 4f5a19482b net: tcp: Make receive window size configurable
Add Kconfig option to set the receive window size.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2022-02-22 10:09:45 -08:00
Robert Lubos c25cd5a894 net: tcp: Allow to acknowledge zero-length packets
Peer may send a zero-length keepalive message, probing the recv window
size - TCP stack should still reply for such packets, otherwise
connection will stall.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2022-02-22 10:09:45 -08:00
Robert Lubos 74bc876bf5 net: tcp: Implement receive window handling
Add implementation of net_tcp_update_recv_wnd() function.

Move the window deacreasing code to the tcp module - receive window
has to be decreased before sending ACK, which was not possible when
window was decreased in the receive callback function.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2022-02-22 10:09:45 -08:00
Jun Lin 0bbf394ced driver: i2c: npcx: don't print the err log when SMBST is zero
In the I2C ISR, it prints the error message when SMBST is set to an
unexpected value. However, we found a spurious interrupt which caused
the SoC to enter the ISR with SMBST=0. Because the spurious interrupt
will not break the I2C operation, this commit limits the error log to
print if SMBST is not equivalent to 0 to prevent a false alert.

Signed-off-by: Andrew McRae <amcrae@google.com>
Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
2022-02-22 10:09:36 -08:00
Torsten Rasmussen 604f705fda cmake: doc: created a doc.cmake CMake module in Zephyr CMake modules dir
Creating a doc.cmake to the new Zephyr CMake modules dir.

This removes the need for `set(NO_BOILERPLATE TRUE)` before loading the
Zephyr CMake package.

It also removes the need within the doc/CMakeLists.txt file to manually
include individual parts of the Zephyr CMake files as this is now
controlled through a single Zephyr CMake doc module.

This aligns the way a Zephyr package is sourced with other places.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-02-22 10:02:39 -08:00
Torsten Rasmussen e4ccde3774 cmake: moved unittest.cmake to Zephyr CMake modules dir
Move the unittest.cmake to the new Zephyr CMake modules dir.

This allows us to have a single Zephyr CMake package and load unittest
module as: 'find_package(Zephyr COMPONENTS unittest)'

This unifies the way Zephyr package is sourced and removes the need for
a dedicated ZephyrUnittest package.

Deprecate the use of: 'find_package(ZephyrUnittest)'

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-02-22 10:02:39 -08:00
Torsten Rasmussen 61453e4a58 cmake: Zephyr CMake package and CMake modules
Create a cmake/modules folder containing all Zephyr CMake modules.
All Zephyr cmake files that are included from boilerplate are now
converted into CMake modules which can be individually loaded.

The Zephyr CMake package is updated to support loading of individual
CMake modules using the COMPONENTS argument to `find_package(Zephyr)`.
If the COMPONENTS argument is not specified, the default Zephyr build
system will load.
If COMPONENTS is specified then, only those components and the
dependencies will be loaded.

If a Zephyr CMake module depends on another CMake module which has not
been loaded, it will automatically be loaded.

This allows us to modularize and reuse individual parts of the Zephyr
CMake build system in a more flexible way in future.

Such usage could be:
- Higher livel multi image build system
- Invocation of individual components, for example dts processing by
  twister without loading all build code
- Doc build
- Unittesting

With this new CMake package and CMake module scheme then direct
sourcing of boilerplate.cmake has been deprecated.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-02-22 10:02:39 -08:00
Torsten Rasmussen 96b3e4d0c4 cmake: create a root.cmake CMake module
The root.cmake CMake module remove boilerplate code and place
it inside a dedicated root.cmake CMake module.

This is part of a general CMake overhaul to allow better modularization
and reuse of the Zephyr build system.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-02-22 10:02:39 -08:00
Torsten Rasmussen bdb99a330f cmake: create a kernel.cmake CMake module
The kernel.cmake CMake module remove boilerplate code and place
it inside a dedicated kernel.cmake CMake module.

This is part of a general CMake overhaul to allow better modularization
and reuse of the Zephyr build system.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-02-22 10:02:39 -08:00
Torsten Rasmussen 9bb162d1d5 cmake: create a configuration_files.cmake CMake module
The configuration_files.cmake CMake module remove boilerplate code and
place it inside a dedicated configuration_files.cmake CMake module.

This is part of a general CMake overhaul to allow better modularization
and reuse of the Zephyr build system.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-02-22 10:02:39 -08:00
Torsten Rasmussen d2b11174f3 cmake: create a user_cache.cmake CMake module
The user_cache.cmake CMake module remove boilerplate code and place it
inside a dedicated user_cache.cmake CMake module.

The user cache functions has been moved to the new Zephyr CMake module.

This is part of a general CMake overhaul to allow better modularization
and reuse of the Zephyr build system.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-02-22 10:02:39 -08:00
Torsten Rasmussen 5504096560 cmake: boards and shields cmake files repurposed
The boards.cmake and shields.cmake has been repurposed to do board and
shield validation so that such validation code can be re-factored out
of boilerplate itself.

The boards.cmake and shields.cmake will both perform validation and
printing errors when validation fails.

Also it will specify the boards and shields build targets.

This ensures that validation code, message printing and target
specification for boards and shields are located logically together.

This is part of a general CMake overhaul to allow better modularization
and reuse of the Zephyr build system.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-02-22 10:02:39 -08:00
Torsten Rasmussen de34b67c45 cmake: move CMAKE_<lang>_COMPILER_FORCED into toolchain code.
To prepare for more modular approach move the compiler forced out of
boilerplate and into the specific toolchain cmake code (generic/target).

Code is added to both generic and target toolchain modules to allow
future use of one module without requiring a load of the other module.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-02-22 10:02:39 -08:00
Torsten Rasmussen 254e35d61d cmake: create an arch.cmake module
The arch.cmake CMake module remove boilerplate code and place it inside
a dedicated arch.cmake CMake module.

This is part of a general CMake overhaul to allow better modularization
and reuse of the Zephyr build system.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-02-22 10:02:39 -08:00
Torsten Rasmussen 7f6bb02287 cmake: create a soc.cmake module
The soc.cmake CMake module remove boilerplate code and place it inside
a dedicated soc.cmake CMake module.

This is part of a general CMake overhaul to allow better modularization
and reuse of the Zephyr build system.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-02-22 10:02:39 -08:00
Torsten Rasmussen 0a9a3c0a79 cmake: default value for KCONFIG_BINARY_DIR moved to zephyr_modules
This is a cleanup commit moves the default setting of KCONFIG_BINARY_DIR
from boilerplate.cmake to zephyr_modules.cmake to prepare for better
re-usability.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-02-22 10:02:39 -08:00
Torsten Rasmussen a5d0b2f734 cmake: Move default value for AUTOCONF_H to kconfig.cmake
This is a cleanup commit moves the setting of AUTOCONF_H from
boilerplate.cmake to kconfig.cmake for better re-usability.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-02-22 10:02:39 -08:00
Fabio Baltieri b3daa58ee0 boards: arm: add missing memory-region compatible to stm32h7b3i_dk
Add missing compatible = "zephyr,memory-region" to the sdram2 node for
stm32h7b3i_dk.dts. This is required since 18ffcdcf74.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-02-22 12:43:42 -05:00
Tomasz Bursztyka 0c9ce49d2a arch/x86: Fix MSI MAP destination
When Zephyr runs directly on actual hardware, it will be always
directing MSI messages to BSP (BootStrap Processor). This was fine until
Zephyr could be ran on virtualizor that may NOT run it on BSP.

So directing MSI messages on current processor. If Zephyr runs on actual
hardware, it will be BSP since such setup is always made at boot time by
the BSP. On other use case it will be whatever is relevant at that time.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2022-02-22 10:35:39 -05:00
Tomasz Bursztyka 0affb29572 arch/x86: Add a CPUID function to get initial APIC ID
Depending on whether X2APIC is enabled or not, it will be safer to grab
such ID from the right place.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2022-02-22 10:35:39 -05:00
Tomasz Bursztyka 7ea9b169f7 arch/x86: Have a dedicated place for CPUID related functions
This will centralize CPUID related accessors. There was no need for it
so far, but this is going to change.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2022-02-22 10:35:39 -05:00
Tomislav Milkovic 52bf19b59b boards: arm: add support for stm32h7b3i_dk board
Add device trees for board and arduino connector, Kconfig and docs

Signed-off-by: Tomislav Milkovic <tomislav.milkovic95@gmail.com>
2022-02-22 10:34:56 -05:00
Tomislav Milkovic b2231c9d85 drivers: clock_control: stm32h7: select max clock freq for STM32H7B3
STM32H7B3 supports max SYSCLK and AHB clock frequencies of 280 MHz,
and max APB frequency of 140 MHz

Signed-off-by: Tomislav Milkovic <tomislav.milkovic95@gmail.com>
2022-02-22 10:34:56 -05:00
Tomislav Milkovic a0bc0672b8 soc: arm: stm32h7: add support for stm32h7b3xx and stm32h7b3xxq
Add SoC Kconfig configurations

Signed-off-by: Tomislav Milkovic <tomislav.milkovic95@gmail.com>
2022-02-22 10:34:56 -05:00
Tomislav Milkovic 72cc823e07 dts: arm: st: h7b3: add support for stm32h7b3
Add device tree support for STM32H7B3 line

Signed-off-by: Tomislav Milkovic <tomislav.milkovic95@gmail.com>
2022-02-22 10:34:56 -05:00