The commit removes storage.stream_flash.mpu_allow_flash_write as it was
pointless, and moves nrf52840, as integration platform, to
storage.stream_flash.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Do all input validation etc BEFORE setting up configuration,
instead of mixing these things everywhere. Also condense the formatting
of the code.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Remove unneeded prepare_start function since all uses of it are paired
with the start function. Also, probably should not mess with chip select
before deciding to do the transfer. And just return on some error like
the rest of the driver does instead of assert.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Next packet function is way more complicated than it needs to be. Clean
it up by simplifying the code and making readable helper functions.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Move transceive funtions next to each other and clean up the wrapping of
functions to eliminate the ifdefs.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Small change to consolidate the amount of lines of code in
the spi_mcux_isr by making a macro for the argument and removing
a line of code that was commented out.
Also move the ISR to be the first function in the file which is
common in many other drivers, instead of randomly in the middle of the
file. And move the isr callback to be next to the isr.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Add closing comment for #ifdef and remove unnecessary
indentation of an else block. Also move the transcieve_rtio
function to be near the other rtio functions. And move function
prototypes to top of file.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Create helper functions for duplicated code related to
checking for DMA devices, with readable names.
Also remove unneeded function prototype.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Do initializations in a more logical order,
remove unnecessarily duplicated code,
reorder stack variables to be in reverse christmas tree order.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Remove parent_dev from config struct, and simplify code for the
definition and use of the irq config function.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Organize #includes and #defines for less redundancy
and more readability.
Shorten some macros to avoid multi line statements.
Add some comments.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
posix.common contains testsuites that can be separated into smaller
groups of tests. This change moves spinlock into a singular
testsuite at tests/posix/spinlocks app directory.
Signed-off-by: Marvin Ouma <pancakesdeath@protonmail.com>
Remove implementation of pin configuration for Series 2 devices.
The silabs,dbus-pinctrl driver should be used instead.
Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
The GECKO_PIN() macro does not do anything except pass the
argument through unaltered. It only serves to make DeviceTree
files more verbose. It was inconsistently used, make the .dts
files consistent by never using it.
The DBUS pinctrl driver doesn't use the port or location macros
from the gpio_gecko.h header. The pin number macro is the only
other thing defined in this header. Stop including the header on
Series 2 based boards.
Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
Swap from silabs,gecko-pinctrl to silabs,dbus-pinctrl for all boards
with Series 2 SoCs. Explicitly declare pin properties as part of
pinctrl pinout configuration.
Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
Silicon Labs Series 2 and newer devices do alternate function
configuration fundamentally differently from Series 0 and 1. Pin routing
is done in a centralized fashion in the GPIO peripheral, as opposed to
having ROUTE registers in every peripheral. The concept of alternate
function location numbers also does not exist, functions are directly
assigned to GPIOs by their port and pin number.
This commit adds a new pinctrl driver for devices that use DBUS. It fully
makes use of pinctrl design principles as outlined in the Zephyr
documentation. The previous driver hard-codes pin properties such as filter
and pull-up/down in the driver itself, while the new driver leaves this up
to the user as configurable DeviceTree properties. The previous driver has
hard-coded support for UART, SPI and I2C, while the new driver has generic
support for all DBUS signals.
Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
This moves GATT releated defines that are used by both Mesh Proxy
Service and Mesh Provisioning Service implementations to a common
header file.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
By default if CONFIG_BT_MESH_PROXY_USE_DEVICE_NAME
or CONFIG_BT_MESH_PB_GATT_USE_DEVICE_NAME is enabled, the mesh stack
will add BT_DATA_NAME_COMPLETE AD Type along with the Mesh Proxy Service
or Mesh Provisioning Service advertisements accordingly.
When BT_LE_ADV_OPT_USE_NAME was present and
CONFIG_BT_DEVICE_NAME_DYNAMIC is enabled, the advertised name was
automatically updated by the host. This turned out to be a side-effect
rather than expected behavior and after #71700 this behavior waa
changed.
But customers use dynamic name feature.
This commit makes the mesh stack use bt_get_name to get the device name,
which returns runtime name if CONFIG_BT_DEVICE_NAME_DYNAMIC is enabled.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Moving from TinyCrypt to PSA Crypto API caused failures in the cpu_net
build due to RAM being overflowed. It turned out that 8192 bytes were
allocated for system heap memory, but Mbed TLS is the only user
of that memory (I found this though puncover) for AES purposes.
We reduce that to 1024 bytes because this should be enough for
this purpose.
Note: albeit this is also a standalone example, it's used extensively
in other samples/tests and babblesim, so a failure in building it
propagates in a lot of other failures.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Increase test and main stack sizes for the qemu_cortex_m3 platform
in order to be able to successfully run the test.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
This commit fixes
tests/bsim/bluetooth/ll/multiple_id/tests_scripts/multiple.sh.
The reason is that this test seems to depend on random number
sequence in order to have the proper scheduling.
It also fixes some AC tests by commenting out failing test
cases. The reason of the failure is still unknown and needs
to be investigated in future work.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Moving from TinyCrypt to PSA Crypto API caused an entropy source
to be always required, so this commit adds it in tests where
necessary.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
BT uses PSA Crypto API to perform crypto operations and, on this
platform, these APIs are implemented through Mbed TLS. In order
to properly initialize this library, a random number generator
is required.
* If the platform supports an HW entropy generator (ex: native_sim,
nrf), then ENTROPY_GENERATOR must be used;
* Otherwise (ex: qemu_cortex_m3) test random generator can be
enabled.
Enabling the proper option at board Kconfig level allows for
a more compact code change instead of manually editing _all_
the samples/tests that required this fix.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
On platforms like nrf5340 there are 2 CPUs:
- one is the cpu_net which takes care of the radio stuff and
owns the HW random generator
- one is the cpu_app which holds application data and polls
cpu_net through HCI commands when it needs some random data.
The PSA core implemented in Mbed TLS needs random data at initialization
time, which happens early in the boot process. If we wait for BT to
be ready before issuing the HCI command, then PSA core intialization
will fail. In facts there is no need for the BT to be completely
initialized just to ask for some random data from the cpu_app to
the cpu_net since the HW random generator will likely be already
functional in the cpu_net.
So let's just try the HCI command and, if something is not right,
it will fail anyway. There's no need to anticipate the failure.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Increase the number of key slots in the PSA Crypto core
for some tests using more keys than the default (16).
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Include Mbed TLS headers to the build system. This is required
because these tests do not follow the "standard build pattern"
of Mbed TLS in Zephyr, otherwise include files would be already
available after the library has been linked. In these examples
some BT source files and Kconfigs are manually added to the
CmakeLists.txt file bypassing the standard library build pattern,
so Mbed TLS headers must also be added manually.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
As part of the work of deprecating TinyCrypt in favor of
PSA crypto API, this commit fixes some kconfigs in order to
reduce the RAM footprint. In all involved samples RAM usage
was extremely high even with TinyCrypt (usually > 98%) and
of course it got overflowed once TinyCrypt got replaced by
Mbed TLS's PSA Crypto API.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Since the TinyCrypt library is being deprecated in Zephyr, this
commit modified the dependencies of BT_RPA. Instead of selecting
TinyCrypt, it relies on BT_HOST_CRYPTO or BT_CTLR_CRYPTO. This
helps both in the deprecation process of TinyCrypt, but also this
is more correct dependency since these 2 symbols are extensively
used in the rpa.c source code.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Since the TinyCrypt library is being deprecated in Zephyr, this
commit set TinyCrypt usage in BT mesh as deprecated and it sets
Mbed TLS PSA Crypto API as the default option (when TF-M is not
available).
Tests are also updated in this commit.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
This commit sets PSA Crypto API as the default library to perform
ECC-DH in HCI, replacing TinyCrypt (which is being deprecated).
Therefore the symbol BT_TINYCRYPT_ECC is renamed as BT_SEND_ECC_EMULATION.
References in samples/tests are also fixed.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
CONFIG_BT_USE_PSA_API was used in BT crypto/host modules to select
PSA crypto API over TinyCrypt (which was the default until now).
Since TinyCrypt is being deprecated and PSA crypto API is the new
standard library for crypto operations, CONFIG_BT_USE_PSA_API is
no more needed.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Update TF-M revision to include a fix for crypto_sizes.h header
which is no more aligned to the Mbed TLS one and this causes
build failures in tests.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Flash node should not be under the peripheral bus, it is not a
peripheral. The base address of the flash was getting set correctly by
accident due to the fmu node mapping it out of the range of the
peripheral node by coincidence.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>