Commit graph

53090 commits

Author SHA1 Message Date
Jeremy Bettis 2de4a902de cmake: Support coverage flags on all archs
Most arch's CMakeLists.txt contain rules to add compiler and linker
flags for coverage if CONFIG_COVERAGE is enabled, but 4 of them were
missing this.

Instead, set the coverage flags in arch/common/CMakeLists.txt which
affects all archs.

Signed-off-by: Jeremy Bettis <jbettis@chromium.org>
2021-06-10 18:01:36 -04:00
Maksim Masalski e96df40004 arch: x86: cast to the same size composite expression
Essential type of RHS operand (64 bit) is wider than essential
type of composite expression in LHS operand (32 bit).
LHS entry_val is 32 bit, and RHS (phys+offset) is 64 bit.
Cast RHS composite expression to the (pentry_t) type.

Found as a coding guideline violation (MISRA R10.7) by static
coding scanning tool.

Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
2021-06-10 17:17:23 -04:00
Fabio Baltieri 6cbf6a50a0 soc: npcx: setup custom MPU regions for npcx7
NPCX7 variants allocate code RAM either at 0x10070000 or 0x10090000.
The MPU requires addresses and region sizes to be aligned, so the
generic cortex_m/arm_mpu_regions.c results in an ineffective setup with
the addresses above.

This adds a custom mpu_regions setup for the npcx7, which covers both
available sizes, resulting in these two possible setups:

- 192kB devices

  Code ram: 0x10090000 to 0x100bffff
MPU region: 0x10080000 to 0x100bffff (256k)

- 320kB devices

    Code ram: 0x10070000 to 0x100bffff
MPU region 0: 0x10040000 to 0x1007ffff (256k)
MPU region 1: 0x10080000 to 0x100bffff (256k)

In both cases MPU data RAM setting is from 0x200c0000 to 0x200cffff,
matching the generic Cortex-m setup.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2021-06-10 17:14:49 -04:00
Pavel Vasilyev f5ba999257 Bluetooth: Mesh: Fix setting remote public key in provisioner
This aligns provisioner and provisionee APIs in terms of endianess
of public key provided by an application.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2021-06-10 17:14:03 -04:00
Pavel Vasilyev 0335d5fb01 Bluetooth: Mesh: Add OOB Public Key support for provisionee role
This commit allows an unprovisioned device to exchange its public key
using out-of-band techology (see MeshPRFv1.0.1, table 5.19 and section
5.4.2.3).

For in-band public key exchange, the mesh stack uses HCI commands to
generate public and private keys, and DH key. This, however, doesn't
work for OOB public key exchange since there is no command to generate
DH key with a private key provided by an application. Therefore, this
commit adds direct usage of TinyCrypto into the mesh stack for DH key
generation for OOB public key support.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2021-06-10 17:14:03 -04:00
Jonathan Rico ecae33740d Bluetooth: host: Prevent race condition in pairing procedure
Moving the key check after checking that no pairing or encryption
procedure is started fixes a race condition that is seen in some PTS
tests:

GATT/CL/GAR/BI-04-C
GATT/CL/GAR/BI-16-C
GATT/CL/GAR/BI-21-C
GATT/CL/GAW/BI-05-C
GATT/CL/GAW/BI-12-C

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2021-06-10 17:13:41 -04:00
Julien Massot d6fd631130 soc: renesas_rcar: gen3: enable L1 cache and branch prediction
Use CMSIS abstraction to enable L1 cache and branch prediction.

Signed-off-by: Julien Massot <julien.massot@iot.bzh>
2021-06-10 17:13:21 -04:00
Denis Brockus 4c888ed25b gpio: Add GPIO voltage overrides
Add GPIO_flag values for GPIO DTS creation that
allows for pins that do not use the default
voltage.  IT8xxx2 supports setting voltage
levels for each pin. The default for this SoC
is 3P3 but they can be set individually to
1P8.

This will be used, for example:

	i2c_c_scl {
		gpios = <&gpioc 1 (GPIO_INPUT | GPIO_VOLTAGE_1P8)>;
		enum-name = "GPIO_I2C_C_SCL";
		label = "I2C_C_SCL";
	};

Signed-off-by: Denis Brockus <dbrockus@google.com>
2021-06-10 17:12:08 -04:00
Yonatan Schachter 782c9b7973 drivers: hwinfo: Added Gecko support for reset cause
This commit provides implementations for the reset cause
API functions as part of hwinfo.

Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
2021-06-10 17:10:28 -04:00
Krishna Mohan Dani bfa650d708 samples/drivers: stm32f3_disco: Enable DAC Sample application
This commit enables DAC sample application to build and run on
stm32f3_disco platform. Updated documentation.

Signed-off-by: Krishna Mohan Dani <krishnamohan.d@hcl.com>
2021-06-10 16:00:04 -05:00
Krishna Mohan Dani 71192fb821 drivers/dac: stm32: Enabling DAC Loopback tests for stm32f3_disco
This commit enables dac_loopback to build and run on stm32f3_disco
platform.
This has been tested with twister and also as a standalone
dac_loopback test and is working as expected.

Signed-off-by: Krishna Mohan Dani <krishnamohan.d@hcl.com>
2021-06-10 16:00:04 -05:00
Krishna Mohan Dani c5fa10d26e drivers/dac: stm32: Enabling DAC tests for stm32f3_disco
This commit enables test_dac to build and run on stm32f3_disco
platform.
This has been tested with twister and also as a standalone test_dac
test and is working as expected.

Signed-off-by: Krishna Mohan Dani <krishnamohan.d@hcl.com>
2021-06-10 16:00:04 -05:00
Krishna Mohan Dani 63aff58daf boards/arm: stm32f3_disco: enabling dac support in device tree
This commit enables DAC support for stm32f3_disco platform in device
tree.

Signed-off-by: Krishna Mohan Dani <krishnamohan.d@hcl.com>
2021-06-10 16:00:04 -05:00
Krishna Mohan Dani bba5090b4d dts/arm: STM32: Adding DAC1 & DAC2 support for stm32f3 in dtsi
This commit adds DAC1 support in dtsi for stm32f3 series. Some
stm32f3 series has DAC2 so adding the same where applicable.

Signed-off-by: Krishna Mohan Dani <krishnamohan.d@hcl.com>
2021-06-10 16:00:04 -05:00
Arvin Farahmand a62c1eb0f2 docs: hwinfo: improve API documentation
Clarify documentation for `hwinfo_get_reset_cause`.

Signed-off-by: Arvin Farahmand <arvinf@ip-logix.com>
2021-06-10 15:56:44 -05:00
Alexandre Bourdiol f021fa8e80 drivers: flash: stm32f4: Remove useless definition and use CMSIS
Remove useless definiton STM32F4X_SECTOR_MASK and use CMSIS instead.

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2021-06-10 15:53:41 -05:00
Alexandre Bourdiol 6798135694 drivers: flash: stm32f7: Remove useless definition and use CMSIS
Remove useless definiton STM32F7X_SECTOR_MASK and use CMSIS instead.
By the way fix bug as '|' should be in fact '&',
but thanks to '~' inversion, '|' is now good.

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2021-06-10 15:53:41 -05:00
Henrik Brix Andersen 650c760e27 doc: guides: flash_debug: coredump: remove extraneous backtick
Remove extraneous backtick from coredump documentation.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2021-06-10 13:17:45 -05:00
Pawel Dunaj 1286c8d105 net: depend dns resolver on native net
DNS resolver won't work for offloaded stack.

Signed-off-by: Pawel Dunaj <pawel.dunaj@nordicsemi.no>
2021-06-10 17:44:51 +03:00
Kumar Gala 168bdaadc5 run_ci.sh: Move creation of test_file.txt into a function
Make a single function that handles creation of test_file.txt and fold
get_tests_to_run into it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-06-10 07:53:58 -05:00
Kumar Gala 5e46a6453c run_ci.sh: Rename test_file_main to test_file_full
Rename test_file_main to test_file_full to be more consistent with the
usage of "full" elsewhere.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-06-10 07:53:58 -05:00
Kumar Gala 4e7a444131 run_ci.sh: rework logic to be a bit more consistent
Treat all test_file_* files the same and just explicitly set the header
in the final test_file.txt.  This makes the logic the same regardless of
what paths tests are coming from.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-06-10 07:53:58 -05:00
Kumar Gala fd8dabcb95 run_ci.sh: Fix what tests run with -l
If the local option (-l) was specified we were ignoring the results
of what_changed.py and always setting a "FULL" build.  Only explicitly
set a FULL run if we are building for a commit to the tree (local and
PR builds should respect the output of what_changed.py).

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-06-10 07:53:58 -05:00
Kumar Gala 88cf35cb24 run_ci.sh: Rename master to main branch in example comment
Since we use 'main' now, rename the example comment usage to use
that branch name instead of 'master'.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-06-10 07:53:58 -05:00
Anas Nashif a1a5e5536e manifest: update civetweb
Integrate change to relax cmake version requirements which was causing a
warning on every build.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-06-10 07:53:38 -05:00
Kumar Gala b6781264d7 samples: drivers: remove entropy sample
This sample doesn't do anything interesting and we have
tests/drivers/entropy to can show how to call the API.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-06-10 08:07:19 -04:00
Katsuhiro Suzuki 262c7deca6 actions: replace duplicated label for RISCV
This patch removes duplicated label RISCVv32/64 and replace into
RISCV that has already used in GitHub.

Signed-off-by: Katsuhiro Suzuki <katsuhiro@katsuster.net>
2021-06-10 07:53:49 -04:00
Rafał Kuźnia cab64a9c61 drivers: ieee802154: copy back the TX buffer into the upper layer
Copy back the TX buffer content back into the upper layer
in case of a TX failure.

This is necessary in when frame encryption by the radio driver
is used. The shim layer for the nRF5 driver has a buffer, that
is used by the driver to authenticate and encrypt the frame
in-place. In case of a TX failure, the buffer contents
are propagated back to the upper layer. The upper layer
must use the same secured frame for retransmission.

Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
2021-06-10 11:03:40 +03:00
Rafał Kuźnia 24b2ef4590 net: openthread: set ieee802154_frame_retry flag
The ieee802154_frame_retry will be set by the OpenThread integration
layer in the event of frame retransmission.

Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
2021-06-10 11:03:40 +03:00
Rafał Kuźnia 9070190bc6 drivers: ieee802154: add option to retransmit a frame
Use the nrf_802154_retransmit_csma_ca_raw and
nrf_802154_retransmit_at_raw API to retry the frame transmission
after a failed attempt.

The retry must be performed only in response to
a nrf_802154_transmit_failed event.

Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
2021-06-10 11:03:40 +03:00
Rafał Kuźnia d24f6dd79e manifest: update hal_nordic
The new hal_nordic revision updates the nRF 802.15.4 component.

Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
2021-06-10 11:03:40 +03:00
Rafał Kuźnia 9197495b7c net: pkt: add ieee802154_frame_retry field
The ieee802154_frame_retry flag indicates that a transmission
retry is being performed. This flag may be used by the upper layer
to instruct the IEEE802.15.4 driver implementations to not perform
any modifications to the transmitted frame.

This flag should be used only in the event of a previously failed
transmission.

Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
2021-06-10 11:03:40 +03:00
Jaxson Han 0c03a0572b arch: arm64: mpu: Fix mpu init assertion fail
During mpu init, we check MSA_frac bits[55:52] and MSA bits[51:48] of
the ID_AA64MMFR0_EL1 register. Currently we only allow 1F to pass the
check. But according to Armv8-R AArch64 manual [1], both 1F and 2F
indicates the processor supports MPU. This commit aims at fixing this.

[1]: https://developer.arm.com/documentation/ddi0600/latest/

Signed-off-by: Jaxson Han <jaxson.han@arm.com>
2021-06-09 23:40:03 -05:00
Martí Bolívar 8875340db4 python-devicetree: tox: fix mypy
Recent versions of mypy have learned that the yaml module has type
stubs and the tool is now erroring out when it discovers we import
yaml since the stubs are not involved.

This is breaking CI on unrelated patches; fix it following the
instructions here:

https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-06-09 21:01:55 -04:00
Martí Bolívar bb718ebe68 tests: devicetree: remove useless assert
There's no reason for this assert to be here; it should be removed.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-06-09 19:02:04 -05:00
Carles Cufi d9848b155d Bluetooth: host: Optionally disable GATT sec re-establishment
Some centrals deal poorly with receiving a security request immediately
after reconnection whenever reconnecting with characteristics that are
notifiable or indicatable and requiring security. In particular,
Android 9 and earlier devices may lose bond information when this
happens, some Microsoft Surface devices will enter an invalid state
and, on top of that, Apple's Bluetooth Low Energy guidelines explicitly
discourage this behavior.

In order to allow interoperability with those devices, make the GATT
automatic security request sending as a peripheral optional by
introducing a new Kconfig option, BT_GATT_AUTO_SEC_REQ.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2021-06-09 21:10:14 +03:00
Devaraj Ranganna 4f0c52c2c5 samples: tfm_integration: docs: Fix incorrect sample name
The README.rst in `samples/tfm_integration/tfm_ipc` was incorrectly
referring to `psa_level_1`. README.rst has been updated to refer to
`tfm_ipc` example.

Signed-off-by: Devaraj Ranganna <devaraj.ranganna@linaro.org>
2021-06-09 19:48:43 +02:00
Devaraj Ranganna ac9197b640 samples: tfm_integration: Rename sample psa_level_1 to psa_crypto
The example in folder `samples/tfm_integration/psa_level_1` contains
code that demonstrate usage of PSA crypto APIs in Zephyr rather than the
PSA levels. Therefore renaming the sample as `psa_crypto`.

Signed-off-by: Devaraj Ranganna <devaraj.ranganna@linaro.org>
2021-06-09 19:48:43 +02:00
Devaraj Ranganna 155ea1862b samples: tfm_integration: Enable PSA IPC mode
Enable PSA IPC mode in psa_level_1 sample.

Signed-off-by: Devaraj Ranganna <devaraj.ranganna@linaro.org>
2021-06-09 19:48:43 +02:00
Kevin Townsend 0d1fe4a161 samples: tfm_integration: Extend PSA cryptography demo
This commit extends the psa_level_1 sample's use of the PSA
Cryptography 1.0 API to demonstrate the following functionality:

- Generate a persistent key (secp256r1)
- Display the public key based on the private key above
- Calculates the SHA256 hash of a payload
- Signs the hash with the persistent key
- Verifies the signature using the public key
- Destroys the key

Signed-off-by: Kevin Townsend <kevin.townsend@linaro.org>
2021-06-09 19:48:43 +02:00
Kumar Gala 45eca4ce10 samples: eeprom: Fix build issues with x_nucleo_eeprma2 sample
There are a number of platforms that the x_nucleo_eeprma2 eeprom sample
can't build on.  Also fix issue with missing include of <mem.h> header
to get DT_SIZE_* macros used by the overlay.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-06-09 11:51:14 -05:00
Eug Krashtan 86fc962a48 net: coap: Keep user data inside message
Keeping user data in the CoAP packet

Signed-off-by: Eug Krashtan <eug.krashtan@gmail.com>
2021-06-09 18:41:42 +03:00
Martí Bolívar 88eda6f77d linker: allocate devices in ROM
Pull request https://github.com/zephyrproject-rtos/zephyr/pull/24873
marked all the struct devices const.

However, the linker scripts were never updated to actually allocate
the struct devices in ROM. They're still in RAM, so the main benefit
of this work has not been realized.

Fix it.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-06-09 16:32:52 +02:00
Lingao Meng 9644e9bc99 drivers: Fix missing auto_attach_cmd
When run native posix with `-attach_uart_cmd=<cmd>`,
should attach cmd by arguments.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-06-09 16:18:17 +02:00
Kumar Gala 9fd51225fc tests: drivers: build_all: Remove stale files
Now that we've split out the build_all test there are a few left
over files that aren't needed any more.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-06-09 09:17:35 -05:00
Kumar Gala c8205c41ba tests: drivers: build_all: split xlnx pwm/counter test out
Move xlnx pwm/counter tests to their own directories.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-06-09 09:17:35 -05:00
Kumar Gala a6b1f6c618 tests: drivers: build_all: split led test out
Move led tests to their own directory.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-06-09 09:17:35 -05:00
Kumar Gala a4a685b9f8 tests: drivers: build_all: split gpio test out
Move gpio tests to their own directory.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-06-09 09:17:35 -05:00
Kumar Gala 91a2d53e9c tests: drivers: build_all: split ethernet test out
Move ethernet tests to their own directory.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-06-09 09:17:35 -05:00
Kumar Gala c28b678d24 tests: drivers: build_all: split eeprom test out
Move eeprom tests to their own directory.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-06-09 09:17:35 -05:00