Commit graph

73966 commits

Author SHA1 Message Date
Guillaume Lager 24d9de4ec1 doc: release-notes: Add note on mcuboot dfu changes
Add a note on removed BOOT_TRAILER_IMG_STATUS_OFFS macro and its
replacement functions

Signed-off-by: Guillaume Lager <g.lager@innoseis.com>
2023-01-12 19:08:23 +01:00
Guillaume Lager e67e6d5af6 mcuboot: Remove public dependency on bootutil
BOOT_MAGIC_SZ and BOOT_MAX_ALIGN were used in the header without
including bootutil/bootutil_public.h. This change remove the need of
the inclusion by making the dependency private.
Fixes #52095

Signed-off-by: Guillaume Lager <g.lager@innoseis.com>
2023-01-12 19:08:23 +01:00
Ravi Dondaputi 551f8c40b2 net: shell: Support IPv6 address and route config
Add and delete options to configure IPv6 address
 and route from shell.

Signed-off-by: Ravi Dondaputi <ravi.dondaputi@nordicsemi.no>
2023-01-12 19:08:14 +01:00
Ravi Dondaputi d11ae3a4c8 net: shell: Add support to configure IP address
Add support to configure IP address using net shell.

Signed-off-by: Ravi Dondaputi <ravi.dondaputi@nordicsemi.no>
2023-01-12 19:08:14 +01:00
Krishna T bc80b0a232 net: shell: Use net management API for MAC address configuration
Fix a bug in setting MAC address using net_if API, the API doesn't do a
memcpy but just stores the pointer and shell was passing stack pointer.

We can use dynamic allocation but freeing the memory for the MAC address
would be trickier, so, use the net management API and let the underlying
drivers figure out the MAC address memory management.

Signed-off-by: Krishna T <krishna.t@nordicsemi.no>
2023-01-12 19:07:44 +01:00
Krishna T 7952197a89 net: shell: Add MAC address validation
Validate MAC address before setting, add new helper APIs to cover all
cases.

Signed-off-by: Krishna T <krishna.t@nordicsemi.no>
2023-01-12 19:07:44 +01:00
Gerard Marull-Paretas 6cbe9a0c16 boards: shields: npm1100_ek: add initial support
Add initial support for the nPM1100 EK. The EK is expected to be
connected to Arduino header pins (D2/3/4/5).

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-01-12 19:07:05 +01:00
Gerard Marull-Paretas 8c73db666c drivers: regulator: npm1100: add initial support
While nPM1100 is to be operated in fixed configuration for some
applications, it has some degree of configuration via GPIOs. For
example, mode (auto/PWM) can be configured via MODE pin. VBUS current
can also be adjusted using ISET pin, even though there is no API yet to
limit the PMIC input current.

This patch adds a new regulator class driver for nPM1100 PMIC, so that
it can be used with the standard regulator API when needed.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-01-12 19:07:05 +01:00
Michał Barnaś cc3faf27ca ec_host_cmd: add missing name to choice in Kconfig
It is recommended that choices in Kconfig have names
so this commit adds missing one for the type of
host commands peripheral.

Signed-off-by: Michał Barnaś <mb@semihalf.com>
2023-01-12 16:12:55 +00:00
Tom Burdick 54832687bc docs: Document the simulation platform metadata
Adds a quick note about what the simulation platorm metadata for twister.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2023-01-12 10:30:57 -05:00
Tom Burdick b64caed8be tests: Add platform key to rtio_api test
It's enough that the rtio tests run once per each unique (arch, simulation)
platform.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2023-01-12 10:30:57 -05:00
Tom Burdick 7fba189640 tests: log_api platform key
Ensures the log_api tests only run once per unique (arch, simulator)
platform.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2023-01-12 10:30:57 -05:00
Tom Burdick 38385ed3ff twister: Platform key for test suites
Adds an option to inform twister a testsuite should only be built and
run for platforms with unique sets of attributes. This enables
for example keying on unique (arch, simulation) platforms to run the test
suite on.

The most common usage may be test suites configured to run once per
(arch, simulation) pair as being enough. Additional information about
platforms may enable running a test once per hardware IP block or once
per soc family or soc avoiding duplicated effort in building and running
tests when once suffices.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2023-01-12 10:30:57 -05:00
Mateusz Sierszulski b36a31fd7a drivers: entropy: Add Gecko trng driver for EFR32BG22
This commit enables entropy driver on EFR32BG22 SoC.

Signed-off-by: Mateusz Sierszulski <msierszulski@antmicro.com>
2023-01-12 15:22:11 +00:00
Mirko Bottarelli 5f9eb210f7 boards: stm32l412: fifo compatibility to spi2
In file stm32l412.dtsi, spi2 was missing fifo compatibility,
this way failing to initialise fifo threshold correctly
when spi data width is configured.

Signed-off-by: Mirko Bottarelli <mirko.bottarelli@gmail.com>
2023-01-12 14:58:57 +01:00
Marco Peter 077273add7 dts: arm: st: Fix type in clock assignment of timer15
STM32Gxxx controllers only have a single APB bus.

Signed-off-by: Marco Peter <marco.peter@joylab.ch>
2023-01-12 13:45:54 +01:00
Emil Gydesen baad0c300f BluetootH: Host: add helper functions for resolved addresses
There is special handling done for resolved addresses to convert
them to "regular" addresses for the upper layers.
This commits adds two helper functions to check if they are
resolved, and if so, then properly copied.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-01-12 13:31:12 +01:00
Emil Gydesen 4af1c99f9d Bluetooth: Host: Translate id addr type for PA sync
We only expose random/public address types to the upper layers.
This is done by checking if the address type of events are
resolved addresses, and if so, then we translate them to
public/random.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-01-12 13:31:12 +01:00
Andrzej Głąbek c50108113d soc: nrf53: Fix extraction of the XOSC32MTRIM.SLOPE bitfield
The value in this bitfield is provided in the two's complement form,
so it requires special handling. Previously, it was read as just an
unsigned value and this could result in a wrongly computed CAPVALUE.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2023-01-12 13:30:58 +01:00
Erwan Gouriou 6cbb3f5eec drivers: clock_control: stm32: Fixed domain clock configuration
In some case, we may need to describe a domain clock for a device
while there is no way to configure it (ex: USB clock set on PLL_Q output
on F405 devices > It is not selectable).
Then, configuring a device clock domain in the clock_control driver
will allow to retrieve its subsys rate.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2023-01-12 12:46:53 +01:00
Erwan Gouriou c4b53d5daa dts: stm32f4: stm32f437 is a variant of stm32f427
stm32f427 + crypto = stm32f437

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2023-01-12 12:46:53 +01:00
Erwan Gouriou 7c147ef552 include: dt-bindings: stm32f4_clock.h: Add DCKCFGR registers
Add f4 binding files to provide DCKCFGR registers description
to enable clock selection for F410/F427/F446 variant lines

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2023-01-12 12:46:53 +01:00
Erwan Gouriou 92b8fb4db2 dts: stm32f4: rng is available on stm32f410
Add rng definition to f410.
Though, don't inherit directly in f412 as it's integrated
in a different way.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2023-01-12 12:46:53 +01:00
Erwan Gouriou 0050ad80a9 dts: stm32f4: stm32f412 is a variant of stm32f410
In order to ease description of DCKCFG regsiters,
make f412 a variant of f410 as it supposed to be.

Only exception is missing DAC1.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2023-01-12 12:46:53 +01:00
Dominik Ermel afd0c6f957 doc: release: 3.3: Add missing MCUmgr Kconfig replacements
MCUmgr Kconfig replacement table has been missing a few entries.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2023-01-12 12:46:39 +01:00
Florian Grandel e854314928 net: l2: ieee802154: fix double address swap
As we have to provide LL addresses in big endian to userspace to be
POSIX compliant and we also do not want to reserve extra space for
such addresses, bff6a5cce5 introduced
a change that swaps address bytes in place in the packet before
returning the packet with LL address pointers to userspace.

Unfortunately a regression sneaked into the code base while doing
so: The byte swapping was duplicated when using 6LoWPAN compression
and the byte swapping caused decryption to fail in some cases,
see #53630. This commit fixes the problem.

Fixes: #53630

Signed-off-by: Florian Grandel <jerico.dev@gmail.com>
2023-01-12 12:46:18 +01:00
Jamie McCrae ce31799c73 sysbuild: Allow board revisions to be specified for targets
Allows specifying board revisions when configuring target images
with sysbuild.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-01-12 12:44:53 +01:00
Krishna T 02ab878704 net: ethernet: Check return value for start/stop
The L2 networking layer checks for return value from enable, but
Ethernet is not checking and always returns 0, so, relay the return
value from the Ethernet driver to networking stack.

This fixes the issue of interface start failing but interface still
being up.

Signed-off-by: Krishna T <krishna.t@nordicsemi.no>
2023-01-12 12:14:55 +01:00
Gerson Fernando Budke ff6b526a14 mgmt: updatehub: Add storage abstraction
This add storage abstraction to allow switch between different flash
APIs. This remove the erase command at updatehub core and move it to
storage init phase.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2023-01-12 12:11:31 +01:00
Gerson Fernando Budke eb39f1f12e mgmt: updatehub: Clean-up mcuboot & system dependencies
Currently MCUboot and system reset are invoked directly in the sample
applicatiion. This introduce 2 new methods to isolate system from
application.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2023-01-12 12:11:31 +01:00
Gerson Fernando Budke 689d7cb085 mgmt: updatehub: Clean-up firmware headers
Move header includes to source file. Currently firmware source files
have a hardcode partition identificator. This moves identificators
to updatehub core.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2023-01-12 12:11:31 +01:00
Gerson Fernando Budke f3159e3885 mgmt: updatehub: Clean-up device headers
Move headers from header includes to source file.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2023-01-12 12:11:31 +01:00
Siddharth Chandrasekaran 73809472f8 mgmt/osdp: Add support for event delivery and notifications
The CP app sends PD a "command" and the PD responds to it. Some times,
the PD has something that it wants to tell the PD which it does so in
response to POLL command. Both CP and PD apps need a way to exchange
these info over the OSDP bus. To archive this we will introduce what are
called "events" that allow the PD app to enqueue and CP app to get
notified.

This is analogous to the incumbent "commands" abstraction where, the CP
app enqueues a command and the PD app gets notified of it.

Signed-off-by: Siddharth Chandrasekaran <sidcha.dev@gmail.com>
2023-01-12 12:04:11 +01:00
Siddharth Chandrasekaran c7fec71193 mgmt/osdp: Add length checks for commands and replies
For all commands and replies, the buffer length needed to build or the
length of data needed to decode needs to be checked and asserted. Right now
we do this by ad-hoc if-s. Add macros that do this at a common location.

Signed-off-by: Siddharth Chandrasekaran <sidcha.dev@gmail.com>
2023-01-12 12:04:11 +01:00
Siddharth Chandrasekaran f4e3f2b828 mgmt/osdp: Add inline methods for flag checks
The raw, flags check has become a bit excessive and has begun to affect
code readability. Provide inline functions for those accesses that are
frequent. Also, get rid of `struct osdp_cp` as it can be fully represented
by `struct osdp` itself.

Signed-off-by: Siddharth Chandrasekaran <sidcha.dev@gmail.com>
2023-01-12 12:04:11 +01:00
Siddharth Chandrasekaran b31e708c03 mgmt/osdp: Rename pd offset as index
CP has an array of PDs and pd->offset was the position of the PD in CP's
list. Since offset has many meanings, rename it to pd->idx.

Signed-off-by: Siddharth Chandrasekaran <sidcha.dev@gmail.com>
2023-01-12 12:04:11 +01:00
Siddharth Chandrasekaran 059abd8d8b mgmt/osdp: Flush RX buffer before sending data
Partial packets in the RX buffers cause the subsequent packet to be
treated as malformed. The RX buffer can have partial data if the sender
is too slow in sending the packet of if there is an interruption in
transmission mid-way.

To avoid any issues due to such partials, flush the uart channel before
sending the command/response.

Signed-off-by: Siddharth Chandrasekaran <sidcha.dev@gmail.com>
2023-01-12 12:04:11 +01:00
Siddharth Chandrasekaran a1f3c7631f mgmt/osdp: Cleanup log messages and return codes
The log lines in CP and PD had a prefix such as "CP: " and "PD: " that
does not add too much value as a given device an either be CP or PD
only. This patch removes those and enhances some other log lines while
at it.

It also adds a enum for return values throughout the module to improve
code quality.

Signed-off-by: Siddharth Chandrasekaran <sidcha.dev@gmail.com>
2023-01-12 12:04:11 +01:00
Kai Vehmanen 8374325062 drivers: dai: intel: dmic: don't use assert for error handling
The dai.h interface does not prohibit calling dai_config_get()
with different direction values. The dmic driver should handle
invalid direction value explicitly and not rely on an assert.

Link: https://github.com/thesofproject/sof/issues/6896
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-01-12 10:01:41 +01:00
Jordan Yates d8ac658578 tests: update expected exception codes
Update expected exception codes for Cortex-M, Cortex-R and Cortex-A
CPUs.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-01-12 10:01:05 +01:00
Jordan Yates 35e78c4502 arch: arm: return arm specific fatal error reasons
Return specific fault reasons instead of the generic
`K_ERR_CPU_EXCEPTION`, which provides minimal debugging aid.

Fixes #53093.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-01-12 10:01:05 +01:00
Jordan Yates 2684c7ca78 arch: arm: aarch32: define arch specific fatal errors
Define aarch32 specific fatal errors.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-01-12 10:01:05 +01:00
Jordan Yates 8113d1c67d fatal_types: define start of arch specific faults
Define the index where arch specific faults start. This is a specific
number to avoid arch specific fault values changing each time a new
generic fault is added.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-01-12 10:01:05 +01:00
Jordan Yates 581e5375ff fatal: move enum definition to dedicated header
This allows enum values to be referenced in architecture `arch.h` files
without circular dependencies.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-01-12 10:01:05 +01:00
Jamie McCrae d363781c94 gpio: Fix GPIO_DT_SPEC_INST_GET_BY_IDX_OR macro
Fixes the macro for getting the instance of a device tree GPIO
with index or default value.

Signed-off-by: Jamie McCrae <spam@helper3000.net>
2023-01-12 10:00:24 +01:00
Anas Nashif 73584dfe8d twister: support namespacing of extra configs
We want to be able to have platform or architecture extra configs
without having to duplicate a whole section of the test specification.

This adds support for namespacing of extra configs, for example:

arch:nios2:CONFIG_SYS_CLOCK_TICKS_PER_SEC=1000

or

platform:qemu_x86:CONFIG_FOO=y

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-01-12 10:00:05 +01:00
Sam Hurst d9c4ec31fc usb_c: Fix comments before "else" statements
Move comments that precede an "else" into the "else"
statement.

Signed-off-by: Sam Hurst <sbh1187@gmail.com>
2023-01-11 18:55:18 +01:00
Sam Hurst f84ee58abd usb_c: Add protocol error flag
Use a flag to report a protocol error to the states. This keeps
state specific actions in the state. Currently, those state
specific actions are handled in the pe_report_error function.

Signed-off-by: Sam Hurst <sbh1187@gmail.com>
2023-01-11 18:55:18 +01:00
Sam Hurst 6984162e92 samples: subsys: usb_c: sink: Add USBC_CSM_SINK_ONLY Config to prj.conf
Add CONFIG_USBC_CSM_SINK_ONLY=y to Sink's sample prj.conf.
This selects the Sink only Connection state machine
for the Sink sample and it explicitly show the user
of the Sink sample how the connection state machines are
selected.

Signed-off-by: Sam Hurst <sbh1187@gmail.com>
2023-01-11 18:32:43 +01:00
TOKITA Hiroshi fed4e1857f boards: gd32f450i_eval: Enable DMA transfer for nor-flash
Enable DMA transfer via SPI bus for nor-flash.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2023-01-11 08:50:56 -08:00