Commit graph

57915 commits

Author SHA1 Message Date
Thomas Stranger
4c862c14c1 drivers: flash: stm32: wait for CFGBSY & BSY2 in wait_flash_idle
Some series (namely g0, u5, wb, wl, ?) use CFGBSY to indicate
that FLASH_CR is not ready to be modfied.

This commit adds this flag additionally to other the flash busy flags,
in flash_stm32_wait_flash_idle such that the driver waits before
trying to modify PG, PNB[6:0], PER, and MER bits in FLASH_CR.

Additionally, dual bank variants of STM32G0 have a seperarate BSY2 flag
for flash bank two.
Until now this was not yet checked in flash_stm32_wait_flash_idle.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-11-17 11:06:59 -05:00
Thomas Stranger
f15f9dfd72 flash: stm32: fix g0 error flags and move ifdef-ery to header
In STM32G0 HAL FLASH_FLAG_xxx defines don't follow the pattern of
other Series to simply redefine the FLASH_SR_xxx Msk.
Instead an ID for the SR reg and the position of the Error flag
are defined.

As a result error checking in flash_stm32_check_status was not working
until this fix on stm32g0 series.

In order to avoid complexity in the driver, the ifdef-ery of the flags
was moved to the header file.
Other series except g0 use FLASH_FLAG_xxx defines, because those
are valid for both cores in dual core(wl) and in secure/non-secure
targets(l5,u5).
FLASH_STM32_SR_ERRORS mask is introduced to check for any active error
in the SR.

The flags for SIZERR, MISERR, FASTERR are newly introduced.
the latter two are only required once fast programming is used,
which is not yet the case for any series.

The FLASH_SR_OPTVERR flag (option validity flag) is also present
in the SR, but is not added.
Also ecc errors are generally not checked, but these are in a different
register.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-11-17 11:06:59 -05:00
Thomas Stranger
519f5ffcde drivers: flash: stm32: mv security-mode dependent defines to header
An attempt to simplify the ifdef-ery around FLASH_SR is made.
Define Registers and flags in the header file instead of including
several individual operations in the driver.

FLASH_FLAG_BSY is not only defined for STM32L5, but also other series.
Therefore use this flag instead of FLASH_SR_BSY.
Only the g0 series definition is not valid in our context,
therefore use FLASH_SR_BSY1 instead.

No functional changes, only refactoring.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-11-17 11:06:59 -05:00
Kai Vehmanen
d184181c54 Revert "Tracing: Tracing/Kernel dependency issue fix"
This reverts commit f527a81dcf.

Fixes: https://github.com/zephyrproject-rtos/zephyr/issues/40411
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2021-11-17 10:17:43 -05:00
Kai Vehmanen
3abd3b31b7 Revert "Tracing: Added missing k_thread_heap_assign trace hook"
This reverts commit 861f2a741f.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2021-11-17 10:17:43 -05:00
Martin Tverdal
0d4f685dbd Bluetooth: Host: avoid runtime warning in bt_enable
Avoid runtime warning in bt_enable when CONFIG_BT_SETTINGS
and CONFIG_BT_DEVICE_NAME_DYNAMIC is not set.
This warning was intoroduced in
commit d76bba4b5e
("Bluetooth: host: Device name handling of invalid length")

Signed-off-by: Martin Tverdal <martin.tverdal@nordicsemi.no>
2021-11-17 12:40:20 +01:00
Christopher Friedt
5dc6686c63 logging: log_core: do not alias atomic_t
Previously, a `uint32_t` was aliased as an `atomic_t`. However,
with #39531, `atomic_t` is now a `long` under the hood, which
is 64-bit on 64-bit platforms.

Fixes #40369

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2021-11-17 12:25:10 +01:00
Christopher Friedt
c6f1027eca shell: do not alias atomic_t
Previously, a `uint32_t` was aliased as an `atomic_t`. However,
with #39531, `atomic_t` is now a `long` under the hood, which
is 64-bit on 64-bit platforms.

Fixes #40369

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2021-11-17 12:25:10 +01:00
Jani Hirsimäki
d2a7d29a08 drivers: net: ppp: configurable autostart
New Kconfig CONFIG_PPP_NET_IF_NO_AUTO_START
to have an option to disable of starting of the PPP networking interface
right after the init.

Signed-off-by: Jani Hirsimäki <jani.hirsimaki@nordicsemi.no>
2021-11-16 21:25:47 -05:00
Jani Hirsimäki
8a51a79d89 net: l2: ppp: possibility to have a custom MRU/MTU
Reading a set MTU from the used net_if when starting LCP.
This enables also other custom MTU/MRU to be set for the link than
the default CONFIG_NET_PPP_MTU_MRU (set by a ppp driver during
initialization).

Signed-off-by: Jani Hirsimäki <jani.hirsimaki@nordicsemi.no>
2021-11-16 21:25:47 -05:00
Torbjörn Leksell
861f2a741f Tracing: Added missing k_thread_heap_assign trace hook
Added missing k_thread_heap_assign trace hook call
which all trace systems have defined but which was
never called by the system.

Signed-off-by: Torbjörn Leksell <torbjorn.leksell@percepio.com>
2021-11-16 21:25:27 -05:00
Andries Kruithof
f023b5f611 Bluetooth: controller: push topic branch to main
Pushes all work done in the topic-ble-llcp branch into main branch
This is a refactoring of the LL control procedures; the refactored
control procedures are hidden behind a KConfig option and
per default disabled

Goal of the refactoring:

close issue Link Layer Control Procedure overhaul #15256
make it easier to add/update control procedures
Refactoring consists in principal of writing explicit state machines
for the control procedures.
To reduce the risk of regression errors unit-tests have been added

Following control procedures are implemented:

Connection update procedure
Channel map update procedure
Encryption procedure
Feature exchange procedure
Version exchange procedure
ACL termination procedure
Connection parameters request procedure
LE Ping procedure
Data Length Update procedure
PHY update procedure
Min. nr. Of channels used procedure
Constant Tone extension request procedure

This is a joined work by the people listed in the signed-off-by
list (in alphabetical order)

Signed-off-by: Andries Kruithof Andries.Kruithof@nordicsemi.no
Signed-off-by: Erik Brockhoff erbr@oticon.com
Signed-off-by: Piotr Pryga piotr.pryga@nordicsemi.no
Signed-off-by: Szymon Janc szymon.janc@codecoup.pl
Signed-off-by: Thomas Ebert Hansen thoh@oticon.com
Signed-off-by: Tommie Skriver tosk@demant.com

Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
2021-11-16 21:24:37 -05:00
Dominik Ermel
020d44456d mgmt/mcumgr/lib: Fix multi-image upload not working
The commit fixes the issue where duplicated code in
img_mgmt_impl_upload_inspect caused redirecting all image uploads,
in multi-image configuration, to the first image.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-11-16 21:24:09 -05:00
Tim Lin
e29a15c0e3 ITE: drivers/serial: add the UART driver for the PM callback function
IT8XXX2 uses shared ns16550.c driver which does not provide a power
management callback(pm_action_cb), so create driver to handle
IT8XXX2 specific UART features.

note: pm_action_cb(old name: pm_control_fn)

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2021-11-16 21:23:42 -05:00
Wealian Liao
1b416f7fd1 driver: gpio: npcx: Fix API header
For port_set_bits_raw(), port_clear_bits_raw(), and port_toggle_bits(),
the second parameter sould be gpio_port_pins_t type. Currently, it
doesn't have other side effect, but it sould be fix. This commit fixes
it.

Signed-off-by: Wealian Liao <WHLIAO@nuvoton.com>
2021-11-16 21:22:48 -05:00
Ioannis Glaropoulos
2aa9a76700 MAINTAINERS: remove maintainer-ship status for ioannisg
Removing maintainer and/or collaborator status on
- nRF platforms
- TF-M
- userspace
- cmsis-dsp
- MAINTAINERS file

for ioannisg. Replace with @anangl or others, where applicable.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-11-16 20:14:34 -05:00
Anas Nashif
a30e71a7de actions: clang: set reporting before calling twister
Otherwise reporting is skipped and failures are not recorded.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-11-16 16:23:43 -05:00
Anas Nashif
5595e2a739 actions: clang: use ccache
Use ccache to speed up builds.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-11-16 16:23:43 -05:00
Anas Nashif
977db5b049 actions: retry west update on various workflows
Retry west when update fails and use update.narrow configuration.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-11-16 16:23:43 -05:00
MORGER Patrick
90aa2d33b2 kconfig: fix typo in compiler options
This commit fix the misspelling of the word "diagnostics"

Signed-off-by: MORGER Patrick <patrick.morger@leica-geosystems.com>
2021-11-16 12:12:58 -05:00
Alexandre Bourdiol
022bb25691 tests: drivers: move "st,prescaler" to timers instead of pwm
Prescaler was misplaced in pwm binding, instead of timers binding.
For example, TIM6/TIM7 doesn't have PWM capability,
but have a prescaler.

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2021-11-16 09:55:30 -06:00
Alexandre Bourdiol
37ffd01f8c dts: arm: stm32: TIM6 and TIM7 doesn't support PWM capability
TIM6 and TIM7 doesn't have comparator, nor pin output.
Thus they can't support PWM.

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2021-11-16 09:55:30 -06:00
Alexandre Bourdiol
877379fba4 boards: arm: stm32: move "st,prescaler" to timers instead of pwm
Prescaler was misplaced in pwm binding, instead of timers binding.
For example, TIM6/TIM7 doesn't have PWM capability,
but have a prescaler.
This change also prepares the introduction of timer based counter
(which requires prescaler at timer level)

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2021-11-16 09:55:30 -06:00
Alexandre Bourdiol
3a60344522 drivers: pwm: stm32: move "st,prescaler" to timers instead of pwm
Prescaler was misplaced in pwm binding, instead of timers binding.
For example, TIM6/TIM7 doesn't have PWM capability,
but have a prescaler.
This change also prepares the introduction of timer based counter
(which requires prescaler at timer level)
For compatibility reason temporarily use pwm prescaler if it exists,
otehrwise use timers prescaler.
And thus avoid to avoid breaking boards out of tree.

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2021-11-16 09:55:30 -06:00
Alexandre Bourdiol
7f3423ae48 dts: arm: st: stm32: move "st,prescaler" to timers instead of pwm
Prescaler was misplaced in pwm binding, instead of timers binding.
For example, TIM6/TIM7 doesn't have PWM capability,
but have a prescaler.
This change also prepares the introduction of timer based counter
(which requires prescaler at timer level)

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2021-11-16 09:55:30 -06:00
Alexandre Bourdiol
37175e8643 dts: bindings: stm32: move "st,prescaler" to timers instead of pwm
Prescaler was misplaced in pwm binding, instead of timers binding.
For example, TIM6/TIM7 doesn't have PWM capability,
but have a prescaler.
Also prescaler is common to all PWM channels of the same timer.
This change also prepares the introduction of timer based counter
(which requires prescaler at timer level)
For compatibility reason temporarily keep pwm binding to avoid
breaking boards out of tree.
Block st,prescaler property in lptim binding
as lptim doesn't use this property for now.

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2021-11-16 09:55:30 -06:00
Lucas Dietrich
f7f0bc7022 drivers: can: Fixed timeout values comparison
Trivial fix of compilation error "invalid operands to binary "
when CONFIG_CAN_AUTO_BUS_OFF_RECOVERY = n

Fixes #40290

Signed-off-by: Lucas Dietrich <ld.adecy@gmail.com>
2021-11-16 10:14:02 -05:00
Daniel Leung
566c466343 soc: intel_adsp/cavs_v20: correct linker syntax for old binutils
Applying similar changes to cavs_v20 as in commit
8bc4539cec:

  Older binutils, like the (nine-year-old!) 2.23 version that powers
  many Cadence XCC toolchains, happen not to support the "~" operator to
  perform bitwise negation.  And they generate an absolutely hilarious
  series of inscrutable error messages when they try to tell you this
  fairly simple fact.

  Just fold it into the constant.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-11-16 10:13:46 -05:00
Daniel Leung
2d5c724ed8 Revert "soc: intel_adsp: fix linker script for cavs_v20"
This reverts commit 3cc14b2c2b.

Revert this due to the same reason as commit
a29b66bbf5:

  Unfortunately this mechanism doesn't seem to actually work on the SDK
  linker.  The emitted sections, when passed a symbol name as the "start
  address" just appear wherever the "." variable was pointing (in this
  case, into the cached region).  That breaks the kernel coherence
  layer, obviously.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-11-16 10:13:46 -05:00
Lukas Gehreke
0544f5dbc3 drivers: gpio: Added mcp230xx GPIO driver.
Added driver for the mcp230xx series I2C-based GPIO chips.

Signed-off-by: Lukas Gehreke <lk.gehreke@gmail.com>
2021-11-16 10:13:14 -05:00
Francois Ramu
eeb6921f34 tests: spi: spi loopback test running on the stm32f767zi nucleo
Add support of the tests/drivers/spi/spi_loopabck
with dma (V1).
Connect MISO pin (D12) to MOSI (D11) pin on the board
to pass the test.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-11-16 10:12:39 -05:00
Francois Ramu
dfc6611a31 tests: spi: loopback testing with NOCACHE MEMORY buffers for DMA
This patch is defining Tx buffers in NON CACHE memory for using
with DMA transfers. This requires the CONFIG_NOCACHE_MEMORY=y
flag when mcu is using CACHE.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-11-16 10:12:39 -05:00
Torbjörn Leksell
86d8b36955 Tracing: k_free tracing hook heap reference added
Added heap reference parameter to k_free tracing
hook to allow tracing of the pointer which was
passed as a parameter to a k_free call.
As part of this update the defines
(for this hook) in the various tracing formats
was also updated.

Signed-off-by: Torbjörn Leksell <torbjorn.leksell@percepio.com>
2021-11-16 09:45:01 -05:00
Aleksander Wasaznik
b4bcffb4de CODEOWNERS: Replace joerchan with alwa-nordic
I'm taking over for joerchan at Nordic Semiconductor as a Zephyr
Bluetooth host collaborator.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2021-11-16 07:44:40 -05:00
Anas Nashif
43622e0864 actions: clang: fix typo
Add missing ")".

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-11-16 13:02:57 +01:00
Anas Nashif
9852790811 actions: clang: do not rebase, use commit range
Avoid rebasing and instead use the commit range. This avoids issues with
trees having intermediate rebase data after a reboot (due to
cancellation).

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-11-16 06:48:20 -05:00
Anas Nashif
add37df1bc actions: run code coverage only on main tree
Run code coverage reporting on main zephyr repo only.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-11-16 06:48:20 -05:00
Torbjörn Leksell
f527a81dcf Tracing: Tracing/Kernel dependency issue fix
Added forward declarations of types declared
throughout kernel.h at the start of
kernel.h. With this change it is possible to
include tracing/tracing.h early in kernel.h
and use the tracing functionality in
kernel.h functions without compile errors
which would result if tracing/tracing.h
was included at the end of kernel.h
(type dependencies).

Signed-off-by: Torbjörn Leksell <torbjorn.leksell@percepio.com>
2021-11-16 06:40:00 -05:00
Vinayak Kariappa Chettimada
e07af1fa08 Bluetooth: Controller: Fix Periodic Sync Failed to be Established
Fix Periodic Advertising Synchronize implementation to
generate Synchronization Failed to be Established event
when 6 AUX_SYNC_IND PDUs are not received when establishing
synchronization.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-16 12:12:56 +01:00
Vinayak Kariappa Chettimada
f9ac97336d Bluetooth: Controller: Rename ticker operation callbacks
Rename ticker operation callback suitably to reflect their
purpose.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-16 12:12:56 +01:00
Dominik Ermel
1d17a4bc55 mgmt/mcumgr: Add CONFIG_IMG_MGMT_FRUGAL_LIST
The commit adds Kconfig options that enables "frugal status list";
when enabled, the status list will be sent with zero, empty and false
values omitted, slightly reducing number of bytes sent as response
from device.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-11-16 10:45:57 +01:00
Dominik Ermel
1593357dde manifest: Remove mcumgr from manifest
The commit removes mcumgr library, as module, from west.yml
manifest, as the mcumgr library source is now kept within Zephyr
source code tree.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-11-16 10:45:57 +01:00
Dominik Ermel
a29ab5106b mgmt/mcumgr/lib: Add Kconfig option MGMT_CBORATTR_FLOAT_SUPPORT
The option enables float numbers processing within CBOR attributes.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-11-16 10:45:57 +01:00
Dominik Ermel
cf10549e7e mgmt/mcumgr/lib: Replace license block
The commit changes licensing to SPDX tags.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-11-16 10:45:57 +01:00
Dominik Ermel
56e602b22b mgmt/mcumgr/lib: Fix compliance
Commit fixes compliance issues.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-11-16 10:45:57 +01:00
Dominik Ermel
0bc87573bf mgmt/mcumgr/lib: Documentation fixes
References to Mynewt have been removed and README for Zephyr has been
merged directly to the README.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-11-16 10:45:57 +01:00
Dominik Ermel
dfc57ae390 mgmt/mcumgr/lib: Remove non-Zephyr code
The commit removes MYNEWT sepcific code and code that has been
conditionally compiled with "ifndef _ZEPHYR_".

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-11-16 10:45:57 +01:00
Dominik Ermel
c8381a9d14 mgmt/mcumgr/lib: Remove log management commands
Not implemented.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-11-16 10:45:57 +01:00
Dominik Ermel
af75feac4f mgmt/mcumgr/lib: Copy mcumgr library under mgmt subsystem
The commit copies code of mcumgr, as a lib, under subsys/mgmt/mcumgr.
Only source files relevant for Zephyr have been copied, and changes
to source files have been limited only to path changes, where
required.
Samples have been left out as the only relevant sample, smp_svr,
is already within Zephyr source tree.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-11-16 10:45:57 +01:00
Jay Vasanth
70d4559fdf Microchip: MEC172x: eSPI driver
Updates to MEC172x eSPI driver to support ACPI shared
memory region and EC Host Command Subsystem through
ACPI_EC1 and Embedded Memory Interface (EMI).

Signed-off-by: Jay Vasanth <jay.vasanth@microchip.com>
2021-11-16 10:43:42 +01:00