Commit Graph

61981 Commits

Author SHA1 Message Date
Gerard Marull-Paretas 87b982d878 drivers: adc: shell: use DEVICE_DT_GET
ADC instances can be obtained at compile time, so use DEVICE_DT_GET.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-17 11:37:33 +01:00
Mariusz Skamra 26ff5a30d2 Bluetooth: bap: Remove EATT dependency
The EATT support is optional for BAP. The specification mandates the
minimum MTU supported to be 64 bytes.

As per BAP_v1.0
"The Unicast Server shall support a minimum ATT_MTU of 64 octets for
one Unenhanced ATT bearer, or for at least one Enhanced ATT bearer
if the Unicast Server supports Enhanced ATT bearers."

The same applies for other BAP roles.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-03-17 11:37:21 +01:00
Torsten Rasmussen a199291ddc cmake: remove base_name for dep file
With CMake 3.20 relative path inside DEPFILEs are treated relative to
CMAKE_CURRENT_BINARY_DIR and are transformed by CMake in its internal
dep file.

Therefore Zephyr build system must no longer add `base_name` to the
`-MT` argument for the preprocessor.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-03-17 11:37:07 +01:00
Gerard Marull-Paretas abce052f93 boards: arm: nrf5340dk_nrf5340: move defaults to Kconfig.defconfig
Kconfig.defconfig is the file meant for adjusting other Kconfig options
defaults. Also removed some redundant default conditions.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-17 11:36:59 +01:00
Tim Lin 12ac3fde4a ITE: drviers/adc: Adjust the wait time for acquiring a semaphore
After the ADC interrupt is enabled, the interrupt will be triggered
and the ADC channel valid data will be read, so there is no time
limit here.
Refer to the timeout is also set to K_FOREVER in the function of
adc_context_wait_for_completion().

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2022-03-17 11:36:48 +01:00
Alperen Sener 7dd34ce458 tests: Bluetooth: Mesh: Test secure network beacon intervals
Add tests checking that secure network beacon interval cannot be
less than 10s and not more than 600s for a provisioned node.

Signed-off-by: Alperen Sener <alperen.sener@nordicsemi.no>
2022-03-17 11:36:41 +01:00
Vinayak Kariappa Chettimada d402dbb652 Bluetooth: Controller: Fix auxiliary context flush on auxiliary stop
Fix auxiliary context from being flushed when scanner or
periodic synchronization is stopped, to avoid using the
disable_cb by both. Fixes an assertion when this race
condition happens.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-03-17 11:36:05 +01:00
Vinayak Kariappa Chettimada 3325aac985 Bluetooth: Controller: Fix to not send release message to HCI
Do not enqueue NODE_RX_TYPE_RELEASE into Auxiliary context
when stopping scanner, as this type is not to be passed to
HCI processing, which would lead to assertion.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-03-17 11:36:05 +01:00
Vinayak Kariappa Chettimada 8b26752199 Bluetooth: Controller: Fix auxiliary context leak on stop
Fix auxiliary context leak on stop, under race condition
where ULL High execution context does not release the
auxiliary context as stop has been requested, and done
has decremented the auxiliary context's reference count.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-03-17 11:36:05 +01:00
Vinayak Kariappa Chettimada c1e78c232e Bluetooth: Controller: Fix the order of Periodic Sync in HCI Reset
Fix the order of Periodic Synchronize reset during HCI
Reset Command. Perform scan reset last after Periodic
Synchronize reset to avoid resetting the auxiliary
context which may be in use by Periodic Synchronize.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-03-17 11:33:43 +01:00
Sylvio Alves ddf88c6b99 tests: kernel: context: add esp32c3 irq value
Allow esp32c3 soc to proper execute this kernel test.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2022-03-17 11:33:36 +01:00
Xavier Chapron 5cc583bf3a drivers: modem: modem_cmd_handler.c: Drop cmd from buf if args are missing
In 90c6dc5e7f, a change was introduced to
allow modem commands determine if they have enough data or not.
In a situation where some data is missing, the command should return
-EAGAIN and this should lead to another call of the command with more
data.
In this commit, the argument parser was also allowed to return -EAGAIN
to request more data due to missing arguments.

However, this can't work because in cmd_handler_process_rx_buf() before
calling process_cmd():
- we make sure that a CR/LF has been found.
- we compute match_len which can't be greater than the distance to the
  next CR/LF.
Therefore, even if the command argument parser ask for more data by
returning -EAGAIN, next call will have the same value for match_len,
meaning that the parsing of argument will result in the same missing
argument situation.
This leads to an infinite loop of parsing the same data over and over in
an infinite loop.

This commit change this behavior to always drop the data in such a
situation. The command will not be answered and will therefore timeout,
but at least, next commands will correctly parse their returned data.

Signed-off-by: Xavier Chapron <xavier.chapron@stimio.fr>
2022-03-17 11:33:17 +01:00
Valerio Setti eb94345e3b boards: arm: Add support for R-Car H3 Salvator-X board
Add initial support for the Salvator-X development board.

This work is strongly based on the H3ULCB board, but compared to it:
- device tree was enhanced
   - adding all available push buttons and LEDs
   - setting proper names according to the refdes used on the schematic and
     PCB silkscreen
- documentation was adapted to this board

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2022-03-17 11:33:10 +01:00
Tim Lin bec83df576 ITE: drivers/flash: remove flash write protection API
This API has be removed in Zephyr 2.8, and does not need to be used
as a static function. Because flash_it8xxx2_write_protection(false)
is not supported. If the IT83XX_GCTRL_EPLR register in the
flash_it8xxx2_write_protection(false) is written as 1, the flash
write region will not be protected later, only be cleared by
power-on reset.

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2022-03-17 11:32:51 +01:00
Erwan Gouriou 8a608de95c boards: nucleo_wb55rg: Flash partition not compatible w/ BLE f/w 1.13
Update board flash partition to be compatible with v1.13.0 f/w.
This configuration is compatible with stm32wb5x_BLE_Stack_full_fw
which should be installed at 0x080C7000.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-03-17 11:32:35 +01:00
Rubin Gerritsen c17bc7ad2a Bluetooth: Kconfig: Move audio and mesh to be shown under host
These subsystems are part of the host.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2022-03-17 11:12:47 +01:00
Rubin Gerritsen beaa73ff19 Bluetooth: Kconfig: Hide buffer configuration in a separate menu
Users will usually not want to browse through these. Therefore it is
better to hide them a bit.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2022-03-17 11:12:47 +01:00
Rubin Gerritsen 6a687da940 Bluetooth: Kconfig: Move BT_LIM_ADV_TIMEOUT to host config
This configuration is meant to be in the host.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2022-03-17 11:12:47 +01:00
Rubin Gerritsen 96a2f56ac6 Bluetooth: Kconfig: No use menu for observer and broadcaster configs
This will ensure that they don't turn up as sub-menus

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2022-03-17 11:12:47 +01:00
Rubin Gerritsen d13ff191c3 Bluetooth: Kconfig: Remove Controller comment line
The controller configuration is already a submenu

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2022-03-17 11:12:47 +01:00
Rubin Gerritsen 1e0e2370ac Bluetooth: Kconfig: Move GATT Kconfig to be part of host
This prevents GATT service selection being selectable when compiling
controller only builds.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2022-03-17 11:12:47 +01:00
Rubin Gerritsen db9ae3e09a Bluetooth: Kconfig: Move Host configuration to a separate menu
This reduces the number of visible options.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2022-03-17 11:12:47 +01:00
William Patty 01ebcda726 soc: riscv: riscv-privilege: add support for mtvec vectored mode
Enable support for mtvec vectored mode for privilege SOCs. This
is an optional feature and takes up addtional code space. It is
necessary to support this feature for privilege SOCs that only
support mtvec vectored mode.

Change was tested on qemu_riscv32 and qemu_riscv64 boards with
CONFIG_RISCV_MTVEC_VECTORED_MODE enabled.

Signed-off-by: William Patty <wpatty24@gmail.com>
2022-03-17 11:12:32 +01:00
Henrik Brix Andersen e3f93d7680 drivers: can: stm32fd: fix compilation
Fix compilation of the STM32 CAN-FD driver front-end.

Fixes: #43899

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-03-17 11:07:55 +01:00
Guennadi Liakhovetski 63a109e17f sof: disable the System Agent
The SOF System Agent is redundant under Zephyr, we're using different
performance monitors there.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-03-16 18:33:58 -04:00
Christopher Friedt 22b06c2388 maintainers: add cfriedt to posix subsys collaborators
I look forward to continuing to contribute.

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2022-03-16 16:29:49 -04:00
Rander Wang 8d821a587f soc: intel_adsp: update UUIDs of BRNGUP and BASEFW
The SOF ipc4 driver and Windows driver can't work with
SOF built with zephyr and ipc4 configuration on cAVS 1.8+
platforms. Because the UUIDs of BRNGUP and BASEFW are
copied from APL (cAVS 1.5), which is incompatible with
cAVS 1.8+ platforms.

This patch updates BRNGUP and BASEFW to use cAVS 1.8+ UUIDs.

Signed-off-by: Chao Song <chao.song@linux.intel.com>
Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-03-16 13:46:00 -04:00
Matthias Hauser ae71444426 dts/arm/st: g4: Temp sensor support generates build issue
Temp. remove temperature/vref channels as driver needs extra development.

Signed-off-by: Matthias Hauser <Matthias.Hauser@we-online.de>
2022-03-16 17:12:47 +01:00
Francois Ramu e489f79982 west.yml: takes the fix in the stm32 hal drivers
PR #133 to fix the stm32wlxx_ll_utils.c

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-03-16 10:39:38 -05:00
Robert Lubos cea2c8de3d tests: net: socket: Add getpeername() tests
Add tests for new getpeername() function.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2022-03-16 16:23:16 +01:00
Robert Lubos 81b92fcbb3 net: tcp: Verify accept callback before use
Closing a listening socket will set the accept callback to NULL.
This could lead to a crash, in case an already received packet,
finalizing the connection handshake, was processed after the socket was
closed. Thereby, it's needed to verify if the callback is actually set
before processing it.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2022-03-16 16:23:16 +01:00
Robert Lubos 08752aed0f net: sockets: Fix userspace accept() verification
The verification function for accept() did not take into account that
addr and addrlen pointers provided could be NULL.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2022-03-16 16:23:16 +01:00
Robert Lubos 546267ab3b net: sockets: Implement getpeername() function
Implement getpeername() function.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2022-03-16 16:23:16 +01:00
Gerard Marull-Paretas 1add69b5c3 tests: pm: policy_api: test latency change callback
Test that we get notified correctly when latency requirements change.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-16 15:26:47 +01:00
Gerard Marull-Paretas 8f913d1977 pm: policy: allow to get notifief when maximum latency changes
Add a new API that allows to register a callback that is called when the
maximum latency value changes. This can be used by SoC code to perform
actions based on certain latency values.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-16 15:26:47 +01:00
Gerard Marull-Paretas 9f355c73bc tests: pm: policy_api: test latency API
Add a new tests that checks the behavior of the policy when latency
requirements are imposed.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-16 15:26:47 +01:00
Gerard Marull-Paretas 35fd6eadbf pm: policy: new API to set maximum latency requirements
Add a new API that allows to configure maximum latency requirements.
When the policy manager computes the next state, it will check if the
state brings too much latency based on requirements. This can be useful,
for example, if a certain driver or the application want a system to
respond fast, since any low power state that brings too much latency
will not be used.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-16 15:26:47 +01:00
Gerard Marull-Paretas e6339eac1a pm: policy: assert on unbalanced state lock get/put
The state lock get/put calls should always be balanced: first call get
and then put. Add an assertion in case lock counter is about to go
negative, indicating a programming error.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-16 15:26:47 +01:00
Gerard Marull-Paretas 8714154338 tests: pm: policy_api: check status lock behavior
Test that policy manager behavior is correct when allowing/forbidding
certain states.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-16 15:26:47 +01:00
Gerard Marull-Paretas b618bdbaad drivers: spi: cc13xx_cc26xx: remove CONFIG_PM guards
API provides no-op fallback when CONFIG_PM=n

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-16 15:26:47 +01:00
Gerard Marull-Paretas a0ade1d856 drivers: i2c: cc13xx_cc26xx: remove CONFIG_PM guards
API provides no-op fallback when CONFIG_PM=n

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-16 15:26:47 +01:00
Gerard Marull-Paretas fa88c283a4 manifest: update hal_ti
Update hal_ti to pull updates on the PM constraints API.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-16 15:26:47 +01:00
Gerard Marull-Paretas 5a71eeb35c pm: policy: move constraints to policy API
The pm_constraint_* APIs were effectively used by the policy manager
only. This patch renames the API to the policy namespace and makes its
naming more explicit:

- pm_constraint_set -> pm_policy_state_lock_get()
- pm_constraint_release -> pm_policy_state_lock_put()
- pm_constraint_get -> pm_policy_state_lock_is_active()

The reason for these changes is that constraints can be of many types:
allow/disallow states, impose latency requirements, etc. The new naming
also makes explicit that the API calls will influence the PM policy
behavior.

All drivers and documentation have been updated accordingly.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-16 15:26:47 +01:00
Gerard Marull-Paretas d158f512ac pm: constraint: cleanup include list
Most include files were not used, and `toolchain.h` was missing (needed
by `__weak`).

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-16 15:26:47 +01:00
Gerard Marull-Paretas ebb88fb3a2 pm: constraint: remove unused logging
The constraint code does not log, so remove include/module declaration.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-16 15:26:47 +01:00
Gerard Marull-Paretas a66a4cdf6e pm: constraint: remove redundant assertions
1. state < PM_STATE_COUNT: the function argument is an enumeration that
   already indicates the valid values. It is a programming error to pass
   random integer values, the API should not be defensive "just in case
   the application has messed things up".
2. v < UINT_MAX: first, this assumes type used by `atomic_t` (opaque).
   Second, if the integer overflows it will just wrap around, so the
   check does nothing in practice.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-16 15:26:47 +01:00
Gerard Marull-Paretas 3c38a41991 pm: policy: remove unused logging
The policy file does not perform any logging, so just drop logging
include and declaration.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-16 15:26:47 +01:00
Gerard Marull-Paretas 2238387285 pm: policy: move to pm folder
Move policy code one level up for simplicity, since there is a single
source file. Source file has been renamed to "policy.c" to make things
clear.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-16 15:26:47 +01:00
Gerard Marull-Paretas 22fe2142f0 pm: policy: use DEFAULT/CUSTOM naming
The residency policy, is in reality, influences by other parameters for
example constraints. It has been renamed to "DEFAULT" policy to make it
more general. The "APP" policy has been renamed to "CUSTOM" to better
represent its purpose.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-16 15:26:47 +01:00
Jaxson Han 357aacab6b boards: fvp v8r: Fix the SRAM/FLASH to the right address
Fix SRAM base address to 0x0 and set the size to 128M
Fix FLASH base address to 0x88000000 and set the size to 64MB

Signed-off-by: Jaxson Han <jaxson.han@arm.com>
2022-03-16 09:19:44 -05:00