Commit Graph

67934 Commits

Author SHA1 Message Date
Joakim Andersson 83d5402fe8 Bluetooth: host: Fix SMP local keys check when starting encryption
Fix SMP check of existing local keys when attempting to start security
with required security mode 1 level 4. The logic for checking the
conditions was wrong, leading to a situation where encryption would be
attempted to be started by the central instead of initiating a new
pairing procedure. This would fail when the connection was encrypted and
the connection would be disconnected.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2022-08-05 15:05:56 +02:00
Mariusz Skamra 42e372fc3e Bluetooth: audio: ascs: Fix sending invalid ATT_ERROR_RSP error code
This fixes sending invalid ATT Request Not Supported error code as a
response to Control Point write request.
ATT Request Not Supported error code is used to inform that
"ATT Server does not support the request received from the client",
so it should not be sent in this case.
If the requested opcode is unsupported, ASCS mandates to send ATT
Notification from Control Point with Unsupported opcode Response_Code
only. If the request received from the client is properly formatted,
ATT Write Response can be sent to complete the ATT transaction.

Fixes: ASCS/SR/SPE/BI-01-C
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-08-05 15:05:17 +02:00
Mariusz Skamra a0ea971e9f Bluetooth: audio: ascs: Use BT_WARN to log peer invalid behavior
BT_ERR() should really be reserved for local errors only,
thus BT_WARN() is the right choice whenever a remote peer
sends something invalid that we cleanly handle.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-08-05 15:05:07 +02:00
Mariusz Skamra c88b5dab61 Bluetooth: audio: ascs: Fix handling zero Number_of_ASEs parameter
As per ASCS_v1.0
"A client-initiated ASE Control operation shall be defined as an
invalid length operation if the Number_of_ASEs parameter value is
less than 1".

Fixes: ASCS/SR/SPE/BI-{02,03,04,05,06}-C
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-08-05 15:05:07 +02:00
Florian Grandel 4f8c952c4a drivers: ieee802154: Make raw mode and l2 mutually exclusive
Activating both, the IEEE 802.15.4 raw mode /and/ the L2 mode is not
possible and in fact leads to a build error.

It should therefore not be possible to activate both options at the same
time. This is achieved by only offering the (rather exotic) raw mode
once the L2-support for the IEEE 802.15.4 has been switched off.

Fixes: #48715

Signed-off-by: Florian Grandel <jerico.dev@gmail.com>
2022-08-05 15:04:43 +02:00
Florian Grandel bb86f8b967 net: ip: build IEEE 802.15.4 L2 without IP support
While a previous change had already decoupled the IEEE 802.15.4 L2 from
IP upper layers, this only worked when at least one other interface of
the device supported IP.

This change removes this requirement and thereby fixes a build error
that occurred when disabling IP support while maintaining IEEE 802.15.4
L2 support.

Fixes: #48718

Signed-off-by: Florian Grandel <jerico.dev@gmail.com>
2022-08-05 15:04:37 +02:00
Jeremy Bettis d7727b9415 cmake: Use cmake var not env for sdk
ZEPHYR_SDK_INSTALL_DIR is set from the env if it is not passed
explicitly to cmake, but one usage was reading directly from the env,
not allowing passing the var to cmake instead.

Change find_package of Zephyr-sdk to read from cmake var not env var.

Signed-off-by: Jeremy Bettis <jbettis@google.com>
2022-08-05 14:03:15 +02:00
Fabio Baltieri cd7c44a152 doc: release-3.2: add a note about LEGACY_INCLUDE_PATH deprecation
Add a note about changing LEGACY_INCLUDE_PATH default value, add a note
about the option being removed after two major releases, in 3.4.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-08-05 13:03:54 +02:00
Fabio Baltieri f9447aeff6 Kconfig: flag LEGACY_INCLUDE_PATH as deprecated
Deprecate the LEGACY_INCLUDE_PATH so that it can be removed down the
road.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-08-05 13:03:54 +02:00
Johan Hedberg 7ebaf1b10b Bluetooth: host: Fix scan info dangling pointer
Clear pointer to the le_adv_recv() stack frame before returning to the
calling function. This fixes a potential compiler warning newer gcc
versions.

zephyr/subsys/bluetooth/host/scan.c: In function ‘le_adv_recv’:
zephyr/subsys/bluetooth/host/scan.c:463:20: error: storing the address
of local variable ‘id_addr’ in ‘*info.addr’ [-Werror=dangling-pointer=]
  463 |         info->addr = &id_addr;
      |         ~~~~~~~~~~~^~~~~~~~~~
zephyr/subsys/bluetooth/host/scan.c:439:22: note: ‘id_addr’ declared here
  439 |         bt_addr_le_t id_addr;
      |                      ^~~~~~~

Fixes #48459

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2022-08-05 13:03:32 +02:00
Krzysztof Kopyściński f71741cea0 tests: bluetooth: tester: add support for testing Multiple Notifications
Enabled Multiple Notifications and added command for
bt_gatt_notify_multiple().

Increased possible number of connections to execute GATT/SR/GAN/BV-02-C

Signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
2022-08-05 13:01:46 +02:00
Keith Short f896fc2306 scripts: gen_handles: Sort the device handles
Replicate the devicetree dependencies into a sorted list. This ensures
that the structures added to the .__device_handles_pass2 section are
reproducible from build to build.

Tested with: west build -b native_posix tests/drivers/build_all/sensor

Without this change, two consecutive builds do not compare.

Signed-off-by: Keith Short <keithshort@google.com>
2022-08-05 13:00:35 +02:00
Andriy Gelman 4348cafa19 boards: xmc45_relax_kit: Add led node
Adds two LEDs.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2022-08-05 13:00:21 +02:00
Andriy Gelman af6179d567 drivers: gpio: Add xmc4xxx drivers
Adds gpio drivers for xmc4xxx SoCs.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2022-08-05 13:00:21 +02:00
Gerard Marull-Paretas a57001347f scripts: west_commands: runners: jlink: support pylink >= 0.14
pylink 0.14.0 changed the class variable where JLink DLL library name
(libjlinkarm) is stored. This patch adds support for new pylink
libraries while keeping backwards compatibility.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-05 12:58:23 +02:00
Gerard Marull-Paretas 54ebcf7318 tests: drivers: build_all: ieee802154: remove mcr20a from spi.dtsi
This driver can't be compiled on all platforms as it's a NXP specific
driver (requires NXP HAL). Because spi.dtsi file is used by app.overlay
(and so enabled in multiple configs, including native_posix) it needs to
be removed. Note that MCR20A driver is already covered by the
ieee802154.build.mcr20a test case, which runs specifically on a NXP
board.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-05 12:56:47 +02:00
Gerard Marull-Paretas 61361e870b kconfig: remove redundant IEEE 802.15.4 defaults or selections
All IEEE 802.15.4 drivers are now automatically enabled if they are
'okay' in DT and all of its dependencies are 'y', including
CONFIG_IEEE802154. This means individual driver enablement is not
necessary anymore in Kconfig.defconfig files or samples/tests. Boards
need to still make sure any dependencies are enabled, e.g. SPI bus in
some cases.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-05 12:56:47 +02:00
Gerard Marull-Paretas a6058dc4b1 drivers: ieee802154: IEEE802154 depends on NETWORKING
Previous to this change, each individual driver option depended on
NETWORKING. Instead, move dependency one level up.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-05 12:56:47 +02:00
Gerard Marull-Paretas 352c9c34ee drivers: ieee802154: depend on DT status and default to y
Make all drivers default to 'y' and dependent on being enabled in DT.
This will allow simplifying many samples/tests.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-05 12:56:47 +02:00
Gerard Marull-Paretas ada8d72888 boards: remove non-minimal peripherals from defconfig
According to the board porting guidelines, boards should "leave
peripherals and their drivers disabled by default". In Zephyr we
tipically enable GPIO and SERIAL, as they are virtually required by all
samples/tests in tree. However, for the rest of peripherals it is up to
the application/test to enable the necessary driver classes. It is also
useful that board's Kconfig.defconfig enables certain driver peripherals
based on a condition, e.g. enable I2C if SENSOR=y.

Ref. https://docs.zephyrproject.org/latest/hardware/porting/
board_porting.html#general-recommendations

This patch removes the following driver classes from defconfig files:

- CONFIG_ADC
- CONFIG_COUNTER
- CONFIG_EEPROM
- CONFIG_ENTROPY
- CONFIG_ESPI
- CONFIG_HWINFO
- CONFIG_I2C
- CONFIG_LED
- CONFIG_NETWORKING
- CONFIG_PS2
- CONFIG_PWM
- CONFIG_SENSOR
- CONFIG_SPI
- CONFIG_SPI_SLAVE
- CONFIG_WATCHDOG

Note that a previous attempt was done in #38510.

Fixes #30694

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-05 12:55:51 +02:00
Gerard Marull-Paretas cb448591ed samples: modules: tflite-micro: magic_wand: add missing CONFIG_I2C=y
The magic_want sample requires I2C bus to be enabled (used sensor is
connected to the bus).

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-05 12:55:51 +02:00
Gerard Marull-Paretas c26d7259f8 samples: drivers: lcd_cyclonev_socdk: add missing CONFIG_I2C=y
The sample relies on using I2C API, so it must enable CONFIG_I2C.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-05 12:55:51 +02:00
Gerard Marull-Paretas ef8bae7110 boards: mec1501modular_assy6885: move UART_SOC_MAPPING to Kconfig.defconfig
Set the ESPI_PERIPHERAL_UART_SOC_MAPPING default value to 1 in
Kconfig.defconfig, only if ESPI=y.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-05 12:55:51 +02:00
Gerard Marull-Paretas 991ba97a9b boards: mec1501modular_assy6885: remove redundant I2C_INIT_PRIORITY
This board has no devices connected to the I2C bus, so there's no need
to customize init priorities at the board level.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-05 12:55:51 +02:00
Gerard Marull-Paretas cba17e2c96 boards: mec15xxevb_assy6853: remove redundant I2C_INIT_PRIORITY
In this board I2C is required to talk to a GPIO expander (PCA95XX). By
default I2C devices are initialized with KERNEL_INIT_PRIORITY_DEVICE
(set to 50), and the PCA95XX driver is initialized with priority 70.
This means that there is no need to customize I2C priority as it will
always come before.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-05 12:55:51 +02:00
Gerard Marull-Paretas 4131bff04c boards: litex_vexriscv: enable ETH_LITEETH(0) and L2 if NETWORKING
Automatically enable:

CONFIG_ETH_LITEETH
CONFIG_ETH_LITEETH0
CONFIG_NET_L2_ETHERNET

if CONFIG_NETWORKING=y.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-05 12:55:51 +02:00
Gerard Marull-Paretas aeb228048b boards: ip_k66f: enable SPI if NET_DSA=y
SPI is required by DSA_KSZ8794, enabled if NET_SDA=y.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-05 12:55:51 +02:00
Gerard Marull-Paretas d105556721 boards: cyclonev_socdk: remove redundant COUNTER_INIT_PRIORITY
Counter devices are now initialized with priority 60 by default, which
guarantees it will come after I2C (50).

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-05 12:55:51 +02:00
Gerard Marull-Paretas bbda65a99a drivers: counter: increase COUNTER_INIT_PRIORITY
Some counter devices depend on buses (e.g. I2C for Maxim DS3231). Bus
devices are tipically initialized with KERNEL_INIT_PRIORITY_DEVICE as
well, so there's no guarantee counter will be initialized be initialized
before without manually tweaking priorities.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-05 12:55:51 +02:00
NingX Zhao 9ba764bbf0 kernel: queue: move queue testcase to new ztest
Move queue testcases to new ztest.

Signed-off-by: NingX Zhao <ningx.zhao@intel.com>
2022-08-05 11:46:59 +01:00
Bartosz Bilas e7eee79e7e drivers: modem: gsm: adjust logs level
Let's switch to the LOG_DBG for +CREG, +CESQ and +CSQ
AT commands responses because they flood the console so much.

Signed-off-by: Bartosz Bilas <b.bilas@grinn-global.com>
2022-08-05 11:43:11 +01:00
Erwan Gouriou e12d103a80 soc: stm32: Remove direct COUNTER_RTC_STM32 to COUNTER dependency
COUNTER_RTC_STM32 used to be enabled directly based on COUNTER status.
This should not be the case anymore as we should first check
DT_HAS_ST_STM32_RTC_ENABLED status (which is already done in
drivers/counter/Kconfig.stm32_rtc).

Remove these 3 lines that are not correct anymore.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-08-05 11:42:33 +01:00
Henri Xavier 3ba0cb19ea soc/arm64: Do not allow userspace to directly access peripherals
In some arm64 boards, MMU regions are set so userspace can access all
peripherals (MT_P_RW_U_RW), including the GIC.
This seems like a mistake, which has been copy/pasted in some boards.

Change this to no userspace access by default (MT_P_RW_U_NA),
like the other boards.

Signed-off-by: Henri Xavier <datacomos@huawei.com>
2022-08-05 06:28:57 +01:00
Erwan Gouriou 1e25763f57 tests: pm: device_wakeup_api: Fix comment on wakeup capable assert
If assert triggers, display the current state in order not
to confuse assert message reader.
Same logic is used for following asserts.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-08-05 06:27:35 +01:00
Hu Zhenyu 57487622f5 kernel: Init the base.slice_ticks for dummy_thread
Fixes #46324
Set dummy_thread->base.slice_ticks to 0 when
CONFIG_TIMESLICE_PER_THREAD is set. To avoid
_current_cpu->slice_ticks be a big number.

Signed-off-by: Hu Zhenyu <zhenyu.hu@intel.com>
2022-08-04 19:44:24 -04:00
Kumar Gala 6c67239bc9 tests: subsys: pm: Remove unneccessary devicetree label prop
Remove "label" properties that are not used from devicetree
overlay files.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-04 16:46:20 -05:00
Declan Snyder f3e5967cd4 doc: Updated NXP Docs to indicate entropy support
Updated documentation to indicate support for
random number generation on NXP boards.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2022-08-04 16:45:51 -05:00
Gerard Marull-Paretas 7007451955 scripts: build: elf_parser: use node name for Graphviz diagrams
The elf_parser library now generates a dot file with device dependencies
that can be later rendered using Graphviz. Each node in the diagram
contains the device label (taken from DT node). In some cases the label
property can be None, leading to build failures like:

```
line 273, in device_dependency_graph
text = '{:s}\\nOrdinal: {:d} | Handle: {:d}\\n{:s}'.format(
TypeError: unsupported format string passed to NoneType.__format__
```

This patch switches to node name instead, which will always be set to
some value. This value is actually what devices get now as a name if
they do not have a label set.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-04 18:36:35 +02:00
Jay Vasanth 82d4521c5c tests: eeprom: Add mec172x board overlay
Add mec172xevb_assy6906 board overlay for eeprom test.

Signed-off-by: Jay Vasanth <jay.vasanth@microchip.com>
2022-08-04 18:36:18 +02:00
Jay Vasanth 8014a026d1 drivers: eeprom: MEC172x - Add read/write APIs support
Add functions to support EEPROM read and EEPROM write.

Signed-off-by: Jay Vasanth <jay.vasanth@microchip.com>
2022-08-04 18:36:18 +02:00
Jay Vasanth ccb77af3b7 eeprom: Add Microchip eeprom driver skeleton
Prepare for Microchip eeprom driver addition. Update
dtsi, kconfig, cmake and relevant soc files for eeprom
driver addition.

Signed-off-by: Jay Vasanth <jay.vasanth@microchip.com>
2022-08-04 18:36:18 +02:00
Aurelien Jarno c24acd0c26 drivers: adc: fix ADC_DT_SPEC* helpers for channels >= 10
Use the just introduced IS_EQ() to get the channel child node matching the
input.

Fixes #47119

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2022-08-04 17:35:39 +01:00
Aurelien Jarno 72a1362eaf tests: unit: util: Add test for IS_EQ
Add a basic test for the just introduced IS_EQ macro.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2022-08-04 17:35:39 +01:00
Aurelien Jarno d98a75a4cb sys: util: export Z_IS_EQ macro as IS_EQ
And also add the corresponding documentation.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2022-08-04 17:35:39 +01:00
Kumar Gala 9341b98821 sys: util: add a Z_IS_EQ macro to compare integers
This macro compares two integers from 0 to 255 at compile time, using
the preprocessor.

Signed-off-by: Kumar Gala <galak@kernel.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2022-08-04 17:35:39 +01:00
Yves Vandervennet cd7dbe92b1 soc: arm: nxp_lpc: lpc55xxx: disabling LPC55S36 IAP support
This is temporary until support has been enabled. lpc55s36's IAP controller
is different and does not match previous implementations.
The Zephyr driver uses a data structure matching the IAP controller to
implement a feature that should normally come out of the ROM.

Since IAP support is not in yet, disabling the option in the SoC's Kconfig
and disabling the node in the device tree is the proper way to go forward.

Signed-off-by: Yves Vandervennet <yves.vandervennet@nxp.com>
2022-08-04 10:47:16 -05:00
Neil Chen 28b3f8d315 west.yml: Update NXP HAL to get the latest SDK
- Update the NXP HAL SDK

Signed-off-by: Neil Chen <cheng.chen_1@nxp.com>
2022-08-04 10:47:16 -05:00
Neil Chen 84fbdf1a23 board: arm: Add board support for lpcxpresso55s36
- Add pinctrl, dts, doc

Signed-off-by: Neil Chen <cheng.chen_1@nxp.com>
2022-08-04 10:47:16 -05:00
Neil Chen 91f3ffb69b dts: arm: nxp: Add dtsi for LPC55S36
The default RAM configuration for LPC55S36:
- sramx 0x4000000  16K
- sram0 0x20000000 16K
- sram1 0x20004000 16K
- sram2 0x20008000 32K
- sram3 0x20010000 32K
- sram4 0x20018000 16K

Signed-off-by: Neil Chen <cheng.chen_1@nxp.com>
2022-08-04 10:47:16 -05:00
Neil Chen 5642d4f805 soc: arm: nxp_lpc: lpc55xxx: LPC55S36: add device support
- Add soc information for LPC55S36

Signed-off-by: Neil Chen <cheng.chen_1@nxp.com>
2022-08-04 10:47:16 -05:00