Commit graph

55626 commits

Author SHA1 Message Date
Pavel Vasilyev
79af744dc1 tests: Bluetooth: Mesh: Make mesh initialization function generic
This commit makes this small piece of code reusable in other tests.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2021-08-26 14:04:38 -04:00
Gerson Fernando Budke
71b27487f1 boards: arm: sam4l_ek: Enable USB device ctrl
Enable SAM4L USBC device controller.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2021-08-26 14:03:44 -04:00
Gerson Fernando Budke
1c43138333 drivers: usb: dc: sam: Add full driver fsm
Add sam4l full finite state machine based on Atmel Software Framework.
This allows driver detect protocol errors and sync all requests.  This
version is compliance with Linux USB tests.

Note: Tests are timing sensitive and log may affect results.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2021-08-26 14:03:44 -04:00
Gerson Fernando Budke
670c067563 drivers: usb: dc: sam: Add atmel USBC controller
Add atmel USBC device controller.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2021-08-26 14:03:44 -04:00
Gerson Fernando Budke
f53fce30b2 dts: usb: Add atmel USBC device ctrl
Add atmel USBC device controller dts entries.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2021-08-26 14:03:44 -04:00
Joakim Andersson
334369ab44 Bluetooth: host: Fix dereference before null check
Fix dereference before null check in att.c

Fixes: #37947

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-08-26 13:57:16 -04:00
Vinayak Kariappa Chettimada
2e9f6d0201 Bluetooth: Controller: Remove unused PDU size defines
Remove unused legacy PDU size extra defines.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-26 13:42:41 -04:00
Vinayak Kariappa Chettimada
af41a508d6 Bluetooth: Controller: Fix radio packet size for Extended Scanning
Fix maximum radio packet size configuration to use 255 bytes
for Extended Scanning and Periodic Synchronization.

Add a Kconfig option so that application can reduce RAM
usage if a specific user scenario can live with smaller PDU
receptions.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-26 13:42:41 -04:00
Vinayak Kariappa Chettimada
d3bda1dc06 Bluetooth: Controller: Minor rearrange rx packet set after radio config
Minor rearrange of rx packet set statements after radio
configuration function calls.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-26 13:42:41 -04:00
Emil Gydesen
f79b39c104 Bluetooth: shell: Remove accidentally added debug config
Remove two debug config values from the BT shell that
was accidentally merged.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-08-26 13:42:22 -04:00
Piotr Pryga
2897870fa5 Bluetooth: controller: Fix aux ptr offset calculation for S2 Coded PHY
In the calculation of auxiliary PDU offset for periodic advertising
AUX_CHAIN_IND PDUs there were used old macro that was removed.
The code didn't compile.
Also there were no support for S2 Coded PHY in the offset calculation.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-08-26 13:14:38 -04:00
Emil Gydesen
4bd326d6c9 Bluetooth: ISO: Remove use of conn->channels for ISO
The channels list were originally meant to be used
for multiple bt_iso_chan per iso connect (bt_conn), but
that is not the case for the current API, and won't be
going forward, so the use of the list has been removed.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-08-26 13:14:22 -04:00
Yuval Peress
ab6e724ab4 emul: espi: Add ACPI Shared Memory functions
Add the bare minimum to set and access the ACPI shared memory via the
eSPI emulator.

Signed-off-by: Yuval Peress <peress@chromium.org>
2021-08-26 13:14:05 -04:00
Gerard Marull-Paretas
e17e0c7b64 devicetree: delete deprecated header
Delete the "generated_dts_board.h" file which was renamed to
devicetree.h a long time ago and was kept for compatibility.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-08-26 12:24:33 -04:00
Iuliana Prodan
371a73cc71 manifest: update sof module
Update SOF module to latest main.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-08-26 12:24:19 -04:00
Evgeniy Paltsev
4aff397f1d CODEOWNERS: add owners for ARC MWDT libC layer
Add condeowner for ARC MWDT libC layer files

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
2021-08-26 11:51:06 -04:00
Danny Oerndrup
e3ab68ff1a toolchain: doc: Custom toolchain doc updated for other.h requirement
Added missing toolchain name to path for generic.cmake and target.cmake.

Added section explaining the need for, and the use of, the
toolchain/other.h header file.

Signed-off-by: Danny Oerndrup <daor@demant.com>
2021-08-26 09:28:19 -04:00
Danny Oerndrup
94202f3ed7 toolchain: cmake: Off-tree toolchains gets other.h included if selected
To ensure that an off-tree toolchain gets the toolchain/other.h header
included, such that it can include the correct header for the
toolchain via the other.h, the define __TOOLCHAIN_CUSTOM__ will be set
when ever the cmake flag TOOLCHAIN_USE_CUSTOM is set.
An off-tree toolchain needs to set the set(TOOLCHAIN_USE_CUSTOM 1) in
the off-tree generic.cmake and/or target.cmake, in order for the
include/other.h to be included. The generic.cmake and target.cmake will
be under ${TOOLCHAIN_ROOT}/cmake/toolchain/${ZEPHYR_TOOLCHAIN_VARIANT}/

As the TOOLCHAIN_USE_CUSTOM is only set for off-tree toolchains, this
has no impact on in-tree toolchains and their functionality.

Fixes zephyrproject-rtos#36117

Signed-off-by: Danny Oerndrup <daor@demant.com>
2021-08-26 09:28:19 -04:00
Emil Gydesen
51f2022f7b Bluetooth: Audio: Add initial server values in bt_vcs_register_param
Add support for setting initial values in bt_vcs_register_param
when registering a VCS service

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-08-26 09:13:58 -04:00
Grixa Yrev
6a8abcb225 usb: cdc_acm: trigger TX IRQ when CDC ACM class is ready
Before commit 4f2682bd79
("usb: cdc_acm: avoid spurious interrupt on configured or resume
events") spurious rx-interrupt provided start to read shell tx ring
buffer by CDC ACM UART. Now shell log backend not transmit data,
until CDC ACM UART received data from host.

This PR added invoking interrupt callback if tx interrupt is enable,
when CDC ACM class go to configured state, and flag tx_ready go to true.

Signed-off-by: Grixa Yrev <GrixaYrev@yandex.ru>
2021-08-26 09:13:42 -04:00
Sigvart Hovland
bcbc53015d dfu: boot: Add implementation for multi-image swap type check
Adds multi-image implementations for checking swap type based on image
index.

Signed-off-by: Sigvart Hovland <sigvart.hovland@nordicsemi.no>
2021-08-26 09:13:13 -04:00
Emil Gydesen
9341a3d50c Bluetooth: ISO: Add NULL check in bt_iso_big_sync
Verify that the ISO channels supplied by the caller
are non-NULL.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-08-26 09:12:47 -04:00
Emil Gydesen
581d07e494 Bluetooth: ISO: Add NULL check in bt_iso_big_create
Verify that the ISO channels supplied by the caller
are non-NULL.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-08-26 09:12:47 -04:00
Emil Gydesen
06ebe239c1 Bluetooth: ISO: Add NULL check in cleanup_big
In case that creating a BIG fails due to missing
ISO channel, cleanup_big would try to access a
NULL pointer.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-08-26 09:12:47 -04:00
Emil Gydesen
77509a31d5 Bluetooth: sample: Update default latency of iso broadcast benchmark
The default latency (0) is an invalid value (minimum is 5).
Set to 10 to match the connected ISO benchmark.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-08-26 09:12:16 -04:00
Francois Ramu
75c76fef36 tests: drivers: uart async with DMA on stm32fx nucleo144 boards
It enables the usart6 to run the testcase with a DMA
tests/drivers/uart/uart_async_api. DMA2 (of type V1)
is configured on channel 5 (request) streams 7 & 2.
USART Tx and Rx PG14 - PG9 pins (14 & 16 of CN10)
are connected to PASS the test.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-08-26 06:56:49 -04:00
Luc Viala
19c519eb05 modbus: copy trans_id & proto_id to response header
Copy Transaction and Protocol Identifiers to response header.

Signed-off-by: Luc Viala <luc.viala19@gmail.com>
2021-08-26 06:56:25 -04:00
Vinayak Kariappa Chettimada
2f38c522fd Bluetooth: Controller: Remove ULL header include in LLL
Do not include ULL header in LLL, instead values and fields
required in LLL shall be declared in LLL contexts.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-26 06:55:43 -04:00
Naiyuan Tian
66c931dbd4 tests: interrupt: fix typos in the commits
While reading the code, find typos in the code commits.
tests:kernel:interrupt:src:dynamic_isr, line 110 and 115.

Signed-off-by: Naiyuan Tian <naiyuan.tian@intel.com>
2021-08-26 06:54:55 -04:00
Naiyuan Tian
4cb1f0ef94 tests: common: fix typos in the commits
While reading the code, find typo in the code comment.
In file irq_offload.c, line 163.

Signed-off-by: Naiyuan Tian <naiyuan.tian@intel.com>
2021-08-26 06:54:55 -04:00
Markus Fuchs
b852bdd816 fs: fat_fs: Fix fs_statvfs when using variable sector sizes
The fs_statvfs function assumes FatFs is configured for a fixed sector
size and therefore may return wrong sector sizes when it is configured
for variable sector sizes instead. Fix that by returning the ssize
variable given in the file system object structure.

Signed-off-by: Markus Fuchs <markus.fuchs@ch.sauter-bc.com>
2021-08-26 06:53:57 -04:00
Dominik Ermel
d1c0eb1a51 samples: littlefs: Fix printk messages for native_posix_64
The formatting options, passed to the printk, caused warnings when
compiling for native_posix_64.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-08-26 06:53:28 -04:00
Dominik Ermel
8e970554ae include/fs: Remove definitions of ssize_t and off_t
The sys/types.h definitions of ssize_t and off_t will be used.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-08-26 06:53:28 -04:00
Stephanos Ioannidis
52b2d39b6a cmake: extensions: Add corresponding ifndef for all ifdef functions
This commit adds the corresponding '_ifndef' functions for all the
existing '_ifdef' functions.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2021-08-25 22:08:01 -04:00
Stephanos Ioannidis
877239abfe cmake: extensions: Move ifndef functions to correct location
This commit moves the '_ifndef' functions that are implemented in the
"3.1. *_ifdef" section to the "3.2. *_ifndef" section.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2021-08-25 22:08:01 -04:00
Torsten Rasmussen
892310863d doc: modules guide updated with Zephyr CMake lists description
This commit extends the `Build system integration` section in the Zephyr
modules guide with a description on how a module may append additional
values to Zephyr CMake lists.

This is useful for modules that might need to append values to the
`SYSCALL_INCLUDE_DIRS` list.

This commit is followup to the discussion found in:
https://github.com/zephyrproject-rtos/zephyr/pull/33756

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2021-08-25 22:07:34 -04:00
Flavio Ceolin
3c0e7ade99 tracing: Add k_work_queue_init info
Add tracing information for k_work_queue_init

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-08-25 22:07:04 -04:00
Flavio Ceolin
c42cde5b69 kernel: work_q: Fix k_work_queue_start documentation
Inform that the queue has to be initialized in zeroed memory or with
the k_work_queue_init before use.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-08-25 22:07:04 -04:00
Flavio Ceolin
d9aa414831 kernel: work_q: Add an init function
k_work_queue_start receives a struct that is expected to be
uninitialized (zeroed). Otherwise the behavior is undefined.

Following the Zephyr semantics, this pr introduce a new init function
for this struct.

Fixes #36865

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-08-25 22:07:04 -04:00
Torsten Rasmussen
fcf720941f cmake: dts: import devicetree symbols into CMake
This commit introduces devicetree API in CMake so that devicetree
properties and register block can be used in the CMake build system.

The script scripts/dts/gen_dts_cmake.py processes the edt.pickle and
generates a corresponding devicetree property map in a devicetree_target
that is then used in CMake.

The following devicetree API has been made available in Zephyr CMake:
- dt_nodelabel(<var> NODELABEL <label>)
- dt_node_exists(<var> PATH <path>)
- dt_node_has_status(<var> PATH <path> STATUS <status>)
- dt_prop(<var> PATH <path> PROPERTY <prop>)
- dt_prop(<var> PATH <path> INDEX <idx> PROPERTY <prop>)
- dt_num_regs(<var> PATH <path>)
- dt_reg_addr(<var> PATH <path> [INDEX <idx>])
- dt_reg_size(<var> PATH <path> [INDEX <idx>])
- dt_has_chosen(<var> PROPERTY <prop>)
- dt_chosen(<var> PROPERTY <prop>)

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-08-25 20:28:26 -04:00
Jordan Yates
4c32e21fc7 tests: devicetree: test supported devices API
Add tests for the supported devices API.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-08-25 19:43:54 -04:00
Jordan Yates
b01e41ccdd device: supported devices visitor API
Adds an API to query and visit supported devices. Follows the example
set by the required devices API.

Implements #37793.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-08-25 19:43:54 -04:00
Jordan Yates
0c6588ff47 device: iterable supported devices
Add supported device information to the device `handles` array. This
enables API's to iterate over supported devices for power management
purposes.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-08-25 19:43:54 -04:00
Jordan Yates
ec331c6fe2 device: simplify structure of handles array
Force the inclusion of a `DEVICE_HANDLE_SEP` at the end of the
devicetree dependency section of the array. This lets us simplify the
implementation of `device_required_handles_get`, as there is only one
symbol the section ends with.

This does not use any extra ROM as the array is padded out to the
original size with `DEVICE_HANDLE_ENDS` anyway.

Also adds a description of the array format where the array is
instantiated.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-08-25 19:43:54 -04:00
Jordan Yates
b5c4140afb device: optimize handles array
Optimize the handles array by making the following observations:
 * The devicetree ordinal at index 0 in pass1 is discarded by
   gen_handles.py, and therefore does not appear in the pass2 array.
 * gen_handles.py does not need `DEVICE_HANDLE_ENDS` to determine the
   end of the handle array, as that information is present in the .elf.

Therefore, instead of replacing the devicetree ordinal with an
additional `DEVICE_HANDLE_ENDS` at the end (to preserve lengths), we
can simply move the ordinal to the end and have it be the original
`DEVICE_HANDLE_ENDS` symbol. This reduces the size of the array by
one handle per device (2 bytes).

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-08-25 19:43:54 -04:00
Jordan Yates
1660386f11 device: whitespace cleanup
Remove double spaces after full stops in doxygen comments.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-08-25 19:43:54 -04:00
Flavio Ceolin
4960a9aa7a pm: device_runtime: Fix possible underflow
The runtime API is referenced count and uses a uint32_t.
Avoid underflow when dealing with put requests.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-08-25 19:40:17 -04:00
Flavio Ceolin
93ae6e930a pm: device_runtime: Fix return values
Return 0 in cases where the request does not trigger a device state
change, only incremented or to decremented the reference count.

Fixes #37821

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-08-25 19:40:17 -04:00
Martí Bolívar
36c73da2f5 dt-bindings: b91-pinctrl: use new DT pinctrl accessors
Update to use the new APIs.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-25 18:09:00 -04:00
Martí Bolívar
2b9d477576 adc: npcx: use new DT pinctrl accessors
Update to use the new APIs.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-25 18:09:00 -04:00