By default, when building for the non-secure version of the
board, use TF-M as the secure firmware binary.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
Several driver libraries uses:
```
zephyr_sources_ifdef()
```
instead of
```
zephyr_library()
zephyr_library_sources_ifdef()
```
This results in a messy Zephyr lib as described in: #8825
One reason for drivers to use the first approach is because an empty
Zephyr library results in a CMake build failure which again leads to
twister issues when just enabling a driver and build for all known
boards and then process the DTS result.
Secondly, a CMake build failure prevents the user from launching
menuconfig and disable the driver that creates the empty library.
See #9573 for extra details.
This commit verifies all Zephyr libraries, and if a library is found to
have no source files it will be excluded from the build and a warning
will be printed to the user.
Printing a warning instead of a hard failure ensures that:
- menuconfig can still be opened
- CMake does not fail which allows twister to advance in the test case
- Makes it possible to cleanup CMakeLists driver files
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
The change is done to avoid redefinition errors while attempting
to enable flash_simulator with stm32 platform (stm32f4_disco)
which exports its own definition of FLASH macro, from stm32f407xx.h.
Unfortunately the stm32 definition is visible within flash_simulator
via inclusion of device.h.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
The vtable cannot point to address 1 as that is clearly not a
valid address and will fail when the code tries to access it
in various fdtable.c functions. Point the vtable in tests either
to NULL or to a valid vtable.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
3rd parameter (struct k_mutex *) was added to
z_get_fd_obj_and_vtable() so add it to calls in the tests.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The fdtable infrastructure provides a possibility to prevent
concurrent access to file descriptor. Use that functionality
in eventfd API.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
After changes in commit a42d6c98d3, the
pkt can no longer be a NULL pointer. Remove the unnecessary NULL pointer
check to silence the Coverity.
Coverity ID: 219536
Fixes#32912
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The sample showed the error between the two clocks, but did not show
how to use the skew to reconstruct one clock from the other and the
resulting error.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
It doesn't hurt always having the image header and generating the binary
output. I find myself constantly setting those to 'y', so make it
definitive.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
Thi GICv3 driver is configuring the controller accessing the system
registers ICC_*. To be able to do that without trapping we have to
explicitly set at boot in EL3 the value of the ICC_SRE_EL3 register that
is architecturally set to UNKNOWN value on warm reset.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
Define the FLASH_CCFG memory region from a devicetree partition instead
of from math in the linker file. Removing the special math case results
in the FLASH_CCFG region overlapping the FLASH region, but the linker
accepts this until the FLASH region actually starts placing variables
in the FLASH_CCFG region.
As a result, applications that don't fit in (FLASH_SIZE - 88) bytes will
still fail to link, just with an overlapping memory region error instead
of an overflow error.
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
Move the definition of the two IPC RAM blocks from `#define`'s in family
linker scripts to proper devicetree nodes. Use the devicetree nodes to
generate the memory regions.
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
Simplify the linker script by using the helper macros introduced in
<linker/devicetree_regions.h>. The conditional checks on the Kconfig
symbols are discarded as their default values are typically set via
the status="okay" property of the nodes, and hence the behaviour doesn't
change.
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
Adds a public macro for creating memory regions from devicetree nodes.
`DT_REGION_FROM_NODE_STATUS_OKAY` declares the memory regions for
consumption by ld, assuming the node exists and has `status = "okay"`.
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
- added an option to use GPIO to enable USB DFU.
Patch required as wait_for_usb_dfu() function started to
take time argument since was #30015 merged.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Remove board code and a few associated samples/tests that explicitly
call pinmux_pin_set() to set a given pin as GPIO. This is handled as
part of gpio_mcux_configure() so we don't need to do it again.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Set the PCR[MUX] field to kPORT_MuxAsGpio as part of configuring a GPIO
pin. This removes the need to explicitly call pinmux_pin_set() in board
code.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
If `CONFIG_NET_ICMPV4_ACCEPT_BROADCAST` is enabled ICMPv4 should reply
to request packets sent to the broadcast address of an interface with
the unicast address of that interface from the same subnet.
Previously the code blindly copied the ICMP source address which meant
it would reply to broadcast packets with a broadcast source address.
Signed-off-by: Arvin Farahmand <arvinf@ip-logix.com>
Support setting MAC address manually at runtime for Atmel SAM Ethernet
driver. The MAC address can be set using an ethernet management
request, e.g. (`net_mgmt(NET_REQUEST_ETHERNET_SET_MAC_ADDRESS, ...)`).
Signed-off-by: Arvin Farahmand <arvinf@ip-logix.com>
This function always returns the same value for a given thread.
Add the const attribute to it so the compiler won't call it over and
over needlessly each time _current is referenced, making for far more
efficient code.
The __attribute_const__ symbol is used to mimic the Linux equivalent.
We want to make it clear that this is distinct from the const keyword.
Fix the test_x86_cpu_scrubs_regs where the compiler wasn't told that a
bunch of registers are being clobbered as highlighted by this change.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
A bug was introduced when encoding/decoding moved to separate
functions where sizeof no longer had the correct argument.
The size of the encode buffer is passed to the encode function.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
The `init_string` array could have been used uninitialized, fix this
by initializing it as an empty string, which is a desired content in
case it's not overwritten.
CID: 220302
Fixes#33839
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Currently the SRAM location is fixed for all the boards derived from
qemu_cortex_a53. While this is acceptable when the image is directly
loaded in SRAM by QEMU, in some cases Zephyr can be loaded in RAM by
another piece of software or by semihosting at a different address
before jumping into it.
When for example TF-A is used and Zephyr is run as BL33 payload using
QEMU, in this case the default location in RAM is at a different
address (when preloaded BL33 base address is not used).
To address these cases, move the SRAM location into the board-specific
DTS so that it can be adjusted on a board by board basis.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
Let's fully exploit tpidrro_el0 by storing in it the current CPU's
struct _cpu instance alongside the userspace mode flag bit. This
greatly simplifies the code needed to get at the cpu structure, and
this paves the way to much simpler multi cluster support, as there
is no longer the need to decode MPIDR all the time.
The same code is used in the !SMP case as there are benefits there too
such as avoiding the literal pool, and it looks cleaner.
The tpidrro_el0 value is no longer stored in the exception stack frame.
Instead, we simply restore the user mode flag based on the SPSR value.
This way, more flag bits could be used independently in the future.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
This avoids contention between unrelated slabs and allows for
userspace accessible slabs when located in memory partitions.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
The commit coccinelle/coccinelle@47bd4cae52 changed a behavior of
parsing right before coccinelle v1.1.0. With the commit, the current
scripts under scripts/coccinelle/ errors out with:
minus: parse error:
File ".../zephyr/scripts/coccinelle/deref_null.cocci",
line 25, column 42, charpos = 666
around = '...',
whole content = (E != NULL && ...) ? <+...E->f@p1...+> : ...
I've already raised an issue upstream coccinelle/coccinelle#257. But
Debian is already shipping v1.1.0 and we need a fix.
The proposed fix doesn't change the semantics, it just explicitly
states that the rule is an expression.
Signed-off-by: Yasushi SHOJI <yashi@spacecubics.com>
The structure is now k_work_delayable.
The init function is now k_work_init_delayable.
The submit function is now the k_work_reschedule.
The cancel function is now the k_work_cancel_delayable.
Signed-off-by: Francois Ramu <francois.ramu@st.com>
Add the missing parts for adding support
to stm32h7 dma driver.
The fix is to make dmamux driver work with
dma v1 driver.
Signed-off-by: Shlomi Vaknin <shlomi.39sd@gmail.com>
Add support for u-blox BMD-360-EVAL which uses the nRF52811.
This board is functionally equivalent to the nRF52dk with a
nRF52811 mounted in place of the nRF52832 with the exception
of not having debug-in and the shield SWD header.
DEVELOP_IN_NRF52832 is *not* required since the IC
used is the nRF52811.
Note that header pin numbers noted in index.rst are shown with
respect to the pin 1 markings on the BMD-3xx-EVAL boards, and are
flipped from the nRF52dk_nrf52811.
Tested with blinky, button, and Bluetooth peripheral_hr
Edited to include changes similar to those requested in
https://github.com/zephyrproject-rtos/zephyr/pull/33850
(nRF52810 there vs. nRF52811 here)
Signed-off-by: Bob Recny <bob.recny@u-blox.com>
First design towards ISO adaptation layer, this PR introduces
data-structures and framework for Rx unframed PDUs (BT RX ingress).
Two callbacks are defined for the SDU production (BT RX egress), one for
SDU allocation as well as a callback for emitting a reassembled SDU.
Signed-off-by: Asger Munk Nielsen <asmk@oticon.com>
If we have CONFIG_NET_SOCKETS_POSIX_NAMES enabled (which is now
default), and also have CONFIG_NEWLIB_LIBC enabled, latest versions
of GCC throw a strange error like:
error: conflicting types for 'zsock_fcntl'
692 | #define fcntl zsock_fcntl
After enough consideration, it seems that when Newlib is used, its
fcntl.h header is used, which declares fcntl() with POSIX prototype:
"int fcntl(int fd, int cmd, ...)". It seems that recent GCC, when
seeing the #define like above, checks that its right-hand side
(zsock_fcntl(int, int, int) above) is compatible with an existing
LHS prototype. That doesn't make sense from the point of view of
the C preprocessor semantics, and yet that's what apparently happens.
Make GCC happy by defining an inline wrapper function with
signature compatible with POSIX fcntl prototype, and use it in
the define, instead of zsock_fcntl directly.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Add numeric http status code to the response struct to allow for
easier processing by the caller. Textual status already exists.
Signed-off-by: Justin Morton <justin.morton@nordicsemi.no>
This commit puts the radio in sleep mode when the diagnostics are
stopped.
This fixes an assert on MAC code when `ot diag stop` command is
issued while `ot diag send` is still ongoing.
Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
Add pinctrl-0 properties for configuration of peripherals like UART,
I2C, ADC, etc. These settings are based on what is defined in
the board/pinmux.c file.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Add pinctrl-0 properties for configuration of peripherals like UART,
I2C, ADC, etc. These settings are based on what is defined in
the board/pinmux.c file.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>