Commit graph

47431 commits

Author SHA1 Message Date
Andy Ross e956639dd6 kernel: Remove CONFIG_LEGACY_TIMEOUT_API
This was a fallback for an API change several versions ago.  It's time
for it to go.

Fixes: #30893

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-01-14 21:33:16 -05:00
Anas Nashif 384ad9c3d4 checkpatch: increate line length to 100
Change max line length to 100, this is to follow Linux and to allow for
more readable code. Most warning we get now from checkpatch are because
of this limit which has prevented us from enforcing warning.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-01-14 17:29:37 -05:00
Anas Nashif 5d50797dad ci: handle checpatch warnings as errors
Fail CI if we have both errors and warnings.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-01-14 17:29:37 -05:00
Marc Herbert d7ac0e08fc doc: west: add note about west update --keep-descendants option
The previous and short description wasn't enough for me to understand
the interesting trade-off of --keep-descendants, thanks to
@mbolivar-nordic for clarifying this on Slack.

For reference this option was added in west commit 11b8588303 part of
https://github.com/zephyrproject-rtos/west/pull/165/

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-01-14 16:24:53 -06:00
Noelle Clement 220316c937 soc: arm: stm32: Add support for STM32L152xC SoCs
STM32L152xC SoC differs from other L1 SoCs in RAM (32KiB) and
flash (256KiB) size, EEPROM size (8Kib) and amount of interrupts
(57, see STM32Cube). Devicetree and Kconfig support.

Signed-off-by: Noelle Clement <noelleclement@hotmail.com>
2021-01-14 16:22:17 -06:00
Hake Huang f02454f68a tests: update edma test pattern
align test pattern with testcase.yml

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2021-01-14 16:14:51 -06:00
Hake Huang f8f8aa1ef7 dts: nxp edma update edma label to aligne with config setting
after 7c699348a8
Convert drivers to new DT device macros

now the device name is aligned with label so we need
align them to default config

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2021-01-14 16:14:51 -06:00
Carlo Caione c5b898743a aarch64: Fix alignment fault on z_bss_zero()
Using newlibc with AArch64 is causing an alignement fault in
z_bss_zero() when the code is run on real hardware (on QEMU the problem
is not reproducible).

The main cause is that the memset() function exported by newlibc is
using 'DC ZVA' to zero out memory.

While this is often a nice optimization, this is causing the issue on
AArch64 because memset() is being used before the MMU is enabled, and
when the MMU is disabled all data accesses will be treated as
Device_nGnRnE.

This is a problem because quoting from the ARM reference manual: "If the
memory region being zeroed is any type of Device memory, then DC ZVA
generates an Alignment fault which is prioritized in the same way as
other alignment faults that are determined by the memory type".

newlibc tries to be a bit smart about this reading the DCZID_EL0
register before deciding whether using 'DC ZVA' or not. While this is a
good idea for code running in EL0, currently the Zephyr kernel is
running in EL1. This means that the value of the DCZID_EL0 register is
actually retrieved from the HCR_EL2.TDZ bit, that is always 0 because
EL2 is not currently supported / enabled. So the 'DC ZVA' instruction is
unconditionally used in the newlibc memset() implementation.

The "standard" solution for this case is usually to use a different
memset routine to be specifically used for two cases: (1) against IO
memory or (2) against normal memory but with MMU disabled (which means
all memory is considered device memory for data accesses).

To fix this issue in Zephyr we avoid calling memset() when clearing the
bss, and instead we use a simple loop to zero the memory region.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-01-14 13:37:47 -08:00
Andrzej Głąbek 4f44caf229 boards: nrf21540dk_nrf52840: Fix minor imperfections in documentation
Fis a few issues, mostly typos, in the nRF21540 DK board documentation.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2021-01-14 21:43:43 +01:00
Anas Nashif 827ecb7bd0 twister: fix build_on_all configuration
Logic for scope of platforms to be checked was changed and this options
now only applies to limited scope, fix this and reset scope when a
testcase declares it needs to build on available platforms.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-01-14 13:59:42 -05:00
Julien Massot 6e5e7c1640 west.yml: Update cmsis revision
DSP: Fix invalid CMakeList configuration for arm_sin_cos
Core-R: Make GIC and TIM configurable

Signed-off-by: Julien Massot <julien.massot@iot.bzh>
2021-01-14 12:44:34 -06:00
Katsuhiro Suzuki 32f23059a2 dts: bindings: add IRQ priority support for SiFive PLIC
This patch adds IRQ priority support for SiFive PLIC by device-tree.
Some IRQ sources of plic use Kconfig to set priority of their IRQ.

- AON: no driver
- I2C, SPI, PWM: not use IRQ
- GPIO, UART: default 1

So this patch specifies IRQ priority 1 for all sources.

Currently these drivers (gpio and uart) do not support that they get
and use IRQ priority from device-tree. We need more patches.

Signed-off-by: Katsuhiro Suzuki <katsuhiro@katsuster.net>
2021-01-14 12:43:58 -06:00
Andrzej Puzdrowski d9c308cce9 tests/subsys/dfu/mcuboot: support mcuboot max alignment
MCUboot support flash write-bock-size up to BOOT_MAX_ALIGN.
This patch takes this into account.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-01-14 18:03:38 +01:00
Andrzej Puzdrowski 049dac2a8a modules: introduce MCUBOOT_BOOTUTIL module
Some parts of subsys/dfu/boot code are re-implementations of
what is implemented in the MCUBoot repository.

Mcuboot's repository already provide implementation of function
required for application for interact with the MCUboot.

This patch introduces new MCUBOOT_BOOTUTIL module which covers
common code which is used in the bootloader and the chainnloaded
application.

dfu/boot: use MCUBoot's source code

Module was reworked so it start using MCUBoot's
bootutil_public API instead of copied code.

Reworked boot_is_img_confirmed() used MCUBoot's API
for determine image_ok flag.

mcuboot_shell switchd to use MCUboot's boot_read_swap_state_by_id()
This is MCUBoot function, use it for avoid linking conflict.

test/subsys/mcuboot: fix `test_write_confirm`

dfu/boot library was reworked so it uses MCUboot's bootutil_public
library whenever it can.
The library required that image was marked as copy-done before it
can be pending.
This patch adds such mark which fixes the test.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-01-14 18:03:38 +01:00
Guennadi Liakhovetski 9bfee48d5d xtensa: fix an assembly warning in start_address.S
Add missing .end and .size in start_address.S

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-01-14 11:41:39 -05:00
Henrik Brix Andersen 94ae6fcb9b manifest: update mcuboot
Synchronized up to:
e512181609

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-01-14 16:54:20 +01:00
Fabio Baltieri fe746f9693 samples: ipsp: add a debug config build example
Add an example referring to the (already existing) prj_dbg.conf config.

Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
2021-01-14 16:57:07 +02:00
Fabio Baltieri a01b5b0d9a samples: ipsp: stop registering mcast addr
The IPSP example code is explicitly registering the all local-link nodes
address (ff02::1). This is currently already registered by the normal
IPv6 stack at interface initialization, so doing it in the application
is redundant.

Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
2021-01-14 16:57:07 +02:00
Fabio Baltieri 4a4c63519d net: if: check for multicast address already registered
Add a check to stop a multicast address to be registered multiple times.
This can happen if the application is using net_if_ipv6_maddr_add()
directly.

Tested on the existing bluetooth/ipsp sample:

<wrn> net_if: Multicast address ff02::1 is is already registered.

Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
2021-01-14 16:57:07 +02:00
Fabio Baltieri f6fbf1ffe8 samples: ipsp: increase the maximum multicast addr count
This sample is trying to register four multicast addesses:

uart:~$ net iface
...
IPv6 multicast addresses (max 8):
        ff02::1
        ff02::1:ff01:c41e
        ff02::1:ff00:1
        ff02::1

Increasing CONFIG_NET_IF_MCAST_IPV6_ADDR_COUNT to 4 to make neighbor
discovery work correctly.

Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
2021-01-14 16:57:07 +02:00
Fabio Baltieri 36d8230d15 net: bt: enable solicit node multicast group registration
6lowpan over BLE should work without solicit node multicast messages
according to RFC7668[1], but that requires Neighbor Solicitation with
Address Registration Option, which is currently not implemented in
either Zephyr or Linux. This is causing the router to fallback to normal
neighbor solicitation based discovery, but the NS frames are being
discarded in the host stack because the solicit node multicast groups
are not registered.

This drops the NET_L2_MULTICAST_SKIP_JOIN_SOLICIT_NODE as a workaround
and adds a TODO about it.

[1] https://tools.ietf.org/html/rfc7668#section-3.2.3

Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
2021-01-14 16:57:07 +02:00
Sylvio Alves 232851a428 xtensa: remove core-macros.h from xtensa HAL
core-macros.h includes other files not part of the xtensa HAL, make this
esp32 specific

Fixes #31301

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2021-01-14 09:40:08 -05:00
Pavel Vasilyev 561a8e4f0e Bluetooth: Mesh: Break up mesh settings
The mesh settings.c module is a giant piece of code responsible for
storing the mesh stack configuration. Such approach makes it difficult
to control the data to be stored, breaks the stack modules'
encapsulation by forcing them to reveal the internal kitchen, which
leads to unpleasant issues such as #19799.

This commit moves the responsibility of storing the configuration
to corresponding modules while keeping control of the moment of storing
the configuration and of starting the stack after the settingss loading
is completed.

This doesn't introduce any abstraction between the mesh settings.c and
other modules as it will add more complexity and overhead than necessary
for the actual task.

Fixes #19850

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2021-01-14 16:38:50 +02:00
Piotr Pryga 472febfe69 Bluetooth: host: direction: Add public API to set CTE TX enable for adv
Add public function to set Constant Tone Extension transmission
enabled or disabled for periodic advertising.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-01-14 15:26:32 +01:00
Piotr Pryga 0a09441e47 Bluetooth: host: Rename and make non-static HCI cmd state update
Enable CTE HCI command requires update of a state of its
execution after receive command completion response from
controller. Host has already implemented such functionality
but it was used only internally by hci_core.

This commit changes it to be accessible from other sourece files
in host.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-01-14 15:26:32 +01:00
Piotr Pryga f36b7a8732 Bluetooth: controller: hci: Add HCI_Set_Connectionless_CTE_TX_Enable cmd
Add implementation of HCI_Set_Connecitonless_CTE_TX_Enable
command to HCI. Add scratch implementation of command handling
functions to controller.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-01-14 15:26:32 +01:00
Piotr Pryga 9d711d6e09 Bluetooth: host: direction: Fix compilation error
Fix compilation error caused by missing header files.
Reorganized order of header files include.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-01-14 15:26:32 +01:00
Piotr Pryga 43a1304e9a Bluetooth: controller: df: Config help corrction correction
Correct names of kconfig entries to mach to style of other entries.
Style correction in hci.c. Use the same approach of checking if
Kconfig entry is enabled.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-01-14 15:26:32 +01:00
Alexandre Bourdiol 48a60c5315 drivers: flash: stm32h7: compilation issue. Fix typo
REAL_FLASH_SIZE renamed to REAL_FLASH_SIZE_KB

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2021-01-14 08:11:33 -06:00
Fabio Baltieri 0b6e77db99 dts: npcx7m6fb: define the port as i2c bus rather than the controller
The npcx7m6fb dts defines i2c controller and ports, where the controller
is a property in the port node definition and the device nodes should be
defined as subnodes of the port.

This changes the binding definitions to reflect that, defining the port
as an i2c-controller so that in can inherit sub-nodes for i2c devices,
and the controller as a generic node.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2021-01-14 08:11:17 -06:00
Torsten Rasmussen 81746d1893 doc: Application <BOARD>_<revision>.overlay description
This commit is a follow-up to #29990 with added board adjustment files
for shields and DTS overlay description.

It adds `boards/<BOARD>_<revision>.overlay` and
`boards/<BOARD>_<revision>.conf` to the list of files containing board
specific adjustments.
It also adds `<BOARD>.conf` to the documentation, as this has always
been supported but not described in shield docs.

It documents the possibility of using
`boards/<BOARD>_<revision>.overlay` files for DTS adjustments to
specific board revisions.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-01-14 08:09:34 -06:00
Kumar Gala 3befd7d45f cleanup: rename sanitycheck references to twister
Cleanup references to sanitycheck that should now be twister.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-01-14 07:50:52 -06:00
Katsuhiro Suzuki fadef43433 kernel: describe detailed means of K_FP_REGS flag
Current brief of the flag is ambiguous. This patch adds more details
about K_FP_REGS flag.

Signed-off-by: Katsuhiro Suzuki <katsuhiro@katsuster.net>
2021-01-14 14:24:51 +01:00
Hake Huang 129ddfe5c6 tests: fpu_sharing fix print size issue
As FPU enalbed the printf code size is changed,
so increase main stack size to make test pass on NXP RT platforms

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2021-01-14 07:30:30 -05:00
Martí Bolívar 7745f3edba west boards: add --name filter
This is an optional regular expression that can be used to filter the
output.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-01-14 12:39:21 +01:00
Ioannis Glaropoulos c6c14724ba arch: arm: cortex_m: fix stack overflow error detection
In rare cases when a thread may overflow its stack, the
core will not report a Stacking Error. This is the case
when a large stack array is created, making the PSP cross
beyond the stack guard; in this case a MemManage fault
won't cause a stacking error (but only a Data Access
Violation error). We fix the fault handling logic so
such errors are reported as stack overflows and not as
generic CPU exceptions.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-01-14 12:35:47 +01:00
Ioannis Glaropoulos 202c2fde54 arch: arm: cortex_m: do not read MMFAR if MMARVALID is not set
When the MMARVALID bit is not set, do not read the MMFAR
register to get the fault address in a MemManage fault.
This change prevents the fault handler to erroneously
assume MMFAR contains a valid address.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-01-14 12:35:47 +01:00
Jakub Rzeszutko 889e37b8d9 shell: shell_utils internal api update
Add prefix z_ to internal functions provided by the shell_utils
module.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2021-01-14 12:07:25 +01:00
Jakub Rzeszutko 31bc7d2d1e shell: make shell_root_cmd_find function static
Function shell_root_cmd_find was only used in shell_utils.c file.
Hence it is changed to static and renamed to root_cmd_find.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2021-01-14 12:07:25 +01:00
Jakub Rzeszutko 0738e1f04d shell: remove unused function shell_command_add
This function is not used at all.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2021-01-14 12:07:25 +01:00
Jakub Rzeszutko 0eea85bf08 shell: shell_ops internal api update
Add prefix z_ to internal functions provided by the shell_ops module.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2021-01-14 12:07:25 +01:00
Jakub Rzeszutko 52c999210f shell: internal api update in shell.h
Add Z_ prefix for internal macros.
Remove obsolete defines.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2021-01-14 12:07:25 +01:00
Jakub Rzeszutko 14022083b2 shell: internal api update: uart backend
Add prefix Z_ to internal macros.
Remove obsolete and not used macros.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2021-01-14 12:07:25 +01:00
Jakub Rzeszutko 37e8d825bf shell: internal api update: log backend
Add prefix z_ to internal functions and macros handling log backend.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2021-01-14 12:07:25 +01:00
Jakub Rzeszutko 91b01ce703 shell: internal api update: history module
Add prefix z_ to internal functions handling history feature.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2021-01-14 12:07:25 +01:00
Jakub Rzeszutko 58c7114c17 shell: internal api update: wildcards
Mark global wildcard functions with z_ prefix.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2021-01-14 12:07:25 +01:00
Jakub Rzeszutko fb6155a242 shell: internal api update: help module
Add prefix z_ to internal functions printing help.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2021-01-14 12:07:25 +01:00
Jakub Rzeszutko 460995c810 shell: internal api update: fprintf
Add z_ prefix to internal fprintf functions and macros.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2021-01-14 12:07:25 +01:00
Anas Nashif fc1b5de4c3 kernel: move thread definitions to thread.h
Move thread definitions to its own header to avoid redeclaration and
redefinition of types which is not allowed in some standards.

Fixes #29937

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-01-13 18:18:42 -05:00
Guennadi Liakhovetski ca0e5df219 xtensa: don't build and run the reset handler twice
Currently Zephyr links reset-vector.S twice in xtensa builds:
into the bootloader and the main image. It is run at the end
of the boot loader execution and immediately after that again
in the beginning of the main code. This patch adds a
configuration option to select whether to link the file to the
bootloader or to the application. The default is to the
application, as needed e.g. for QEMU, SOF links it to the
bootloader like in native builds.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-01-13 18:17:40 -05:00