Introduce the basic ARM64 architecture support.
A new CONFIG_ARM64 symbol is introduced for the new architecture and new
cmake / Kconfig files are added to switch between ARM and ARM64.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
ARM cores may have a per-core architected timer, which provides per-cpu
timers, attached to a GIC to deliver its per-processor interrupts via
PPIs. This is the most common case supported by QEMU in the virt
platform.
This patch introduces support for this timer abstracting the way the
timer registers are actually accessed. This is needed because different
architectures (for example ARMv7-R vs ARMv8-A) use different registers
and even the same architecture (ARMv8-A) can actually use different
timers (ELx physical timers vs ELx virtual timers).
So we introduce the common driver here but the actual SoC / architecture
/ board must provide the three helpers (arm_arch_timer_set_compare(),
arm_arch_timer_toggle(), arm_arch_timer_count()) using an header file
imported through the arch/cpu.h header file.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
This construction was causing errors with recent gccs. If you look
carefully, it's generating the sequence:
simcall
mov a2, a2
mov a3, a3
...which is nonsensical. And now gcc is complaining about it with:
subsys/logging/log_backend_xtensa_sim.c:44:2:
error: invalid hard register usage between output operands
Just emit a single simcall instruction and let the assembly
constraints do their job.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
The initial prototypes for sys_trace_* are not needed
because they are either declared in the specified tracing header
or as empty #defines further in the header.
These actually cause linkage conflicts if CTF tracing is attempted
with C++ projects.
Signed-off-by: Nicholas Lowell <nlowell@lexmark.com>
Overlay files were concatenated into single string with no whitespace
between them. If '--extra-args OVERLAY_CONFIG="overlay-1.conf"
--extra-args OVERLAY_CONFIG="overlay-2.conf"' was used, then the result
was OVERLAY_CONFIG="overlay-1.confoverlay-2.conf".
Another thing was that overlay extra args were not properly removed from
the list of regular arguments. As a result we had incorrect list of
overlays and incorrect list of other arguments.
Rework code to extract overlays in loop in a safe manner. Use for that a
list of strings instead of string directly. Join those strings and form
a single OVERLAY_CONFIG argument just before running cmake.
Tested with following testcase.yaml line:
extra_args: ARG1 OVERLAY_CONFIG="overlay-1.conf"
ARG2 OVERLAY_CONFIG="overlay-2.conf"
Before this patch we got:
args = ['OVERLAY_CONFIG="overlay-1.conf"',
'OVERLAY_CONFIG="overlay-2.conf"']
After this patch we get:
args = ['ARG1', 'ARG2',
'OVERLAY_CONFIG="overlay-1.conf overlay-2.conf"']
While at it, fix also regex pattern by removing requirement of double
quotes around value. Match any option value instead and strip both
single and double quotes when match is positive. Tested with:
$ ./scripts/sanitycheck -T samples/hello_world/ -p qemu_x86 \
--extra-args OVERLAY_CONFIG=overlay1.conf '
--extra-args OVERLAY_CONFIG=\"overlay2.conf\" '
--extra-args OVERLAY_CONFIG=\'overlay3.conf\'
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
Dynamic MPU regions are used in build configurations with User
mode or MPU-based stack-overflow guards. If these features are
disabled, we skip calling the ARM function for re-programming
the MPU peripheral during context-switch. We also skip doing
this when jumping to main thread (although this brings limited
performace gain as it is called once in the boot cycle)
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
The __deprecated symbol can be pre-defined to avoid warnings of use of
deprecated API in tests of that API. Enable that same feature for
macros that are deprecated.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
This count is assigned to CONFIG_BT_ACL_RX_COUNT which expects a number
in the range of 1-64, otherwise kconfig fails.
Fixes#22259
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Lot of misdefined variables that went in undetected due to lack of CI on
this board. Fix them and test build with new SDK.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Change the output during CMake configure from
Devicetree configuration written to .../devicetree.conf
Parsing /home/ulf/z/z/Kconfig
Loaded configuration '.../frdm_kw41z_defconfig'
Merged configuration '.../prj.conf'
Configuration saved to '.../.config'
to
Devicetree header saved to '.../devicetree_unfixed.h'
Parsing /home/ulf/z/z/Kconfig
Loaded configuration '.../frdm_kw41z_defconfig'
Merged configuration '.../prj.conf'
Configuration saved to '.../.config'
Kconfig header saved to '.../autoconf.h'
devicetree_unfixed.h is more useful to be aware of than devicetree.conf
(still hoping we can get rid of it at some point), and seeing the
Kconfig header clarifies things to.
"Saved" instead of "written" for consistency. Maybe it could say
"Kconfig configuration" instead of "configuration" too, though it gets a
bit spammy in other contexts where the message shows up.
Updates Kconfiglib (and menuconfig/guiconfig, just to sync) to upstream
revision 061e71f7d7, to get this commit in, which is used to print the
header path:
Return a message from Kconfig.write_autoconf()
Like for Kconfig.write_config() and Kconfig.write_min_config(),
return a string from Kconfig.write_autoconf() with a message saying
that the header got saved, or that there were no changes to it. Can
be handy in tools.
Also make the "no change" message for the various files more
specific, by mentioning what type of file it is (configuration,
header, etc.)
Return True/False from Kconfig._write_if_changed() to indicate if
the file was updated. This also allows it to be reused in
Kconfig.write_min_config().
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Add pairing support callback to print remote pairing features when this
option is enabled.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Similar to pairing_confirm this callback is called each
time a peer requests pairing, but for all types of
pairings, except SSP. The pairing req/rsp information is
passed as a parameter so the application can decide
wheter to accept or reject the pairing.
Fixes: #21036
Signed-off-by: Martin Rieva <mrrv@demant.com>
Add error checking in zephyr_module.py so that if the user manually
specifies ZEPHYR_EXTRA_MODULES and the list contains something that
isn't in fact a valid module, we scream and die.
This should help with diagnosing module errors.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Add a new --check-missing-config-prefix check that looks for references
like
#if MACRO
#if(n)def MACRO
defined(MACRO)
IS_ENABLED(MACRO)
where MACRO is the name of a defined Kconfig symbol but doesn't have a
CONFIG_ prefix. Could be a typo.
Skip MACRO if it is #define'd somewhere, even if it looks like a Kconfig
symbol.
Found e.g. https://github.com/zephyrproject-rtos/zephyr/pull/22195.
Piggyback skipping binary files when grepping for Kconfig symbol
references.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
test_single_shot_alarm_instance may fail due to not supported setting
of top_value in call to counter_set_top_value.
Modified to accept not supported case.
Fixes#21745
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
So that the EDTT tool could be used by this script,
set its path so other scripts could find it
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Get latest EDTT version, which includes a fix for
LL/CON/MAS/BV-23-C regarding the feature set bitmask
check.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
In a combined build where bt_rand functions is implemented in the host
the RPA module should not use the bluetooth rand function since the RPA
module is common for host and controller.
Having the controller call the the host only to go through HCI back into
the controller would not be a good idea.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Fix infinite recursion in host-based bt_rand function. This would call
HCI LE Random Number command, which would in turn call bt_rand, causing
an infinite recursion.
bt_rand -> prng_reseed -> BT_HCI_OP_LE_RAND -> le_rand -> bt_rand
To solve this issue the controller should avoid doing calls into the
host, so all calls to bt_rand in the controller should be replaced with
a call to a controller function.
Fixes#22202
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Under SMP, when a thread is marked aborting, this thread may still
be running on another CPU. However, if there is only one thread
available to run, this thread may be selected to run again due to
next_up() not checking for the aborting state. Moreover, when
there is no IPI to signal to others k_thread_abort() being called,
the k_thread_abort() target thread is marked dead after a new
thread is selected to run. This causes the original thread calling
k_thread_abort() to mistaken that target thread is no longer
running and returns.
Note that, with working IPI, z_sched_ipi() is called as an ISR
to mark the target thread dead. A new thread is then selected to
run, so that the target thread would not be selected due to it
being dead.
This moves the code to mark thread dead into next_up(), where
the next best thread is selected, and the current thread being
swapped out. z_sched_ipi() now becomes an empty function, and
calls to it are removed.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Prepare for a day when all boards specify the chip select in the bus
devicetree node by making sure that the devicetree node associated
with arduino_spi uses the standard D10 pin from the arduino header as
the cs-gpios property value.
Also update the arduino tags in the board yaml files.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Write initial content of the display before blanking_off.
This allow faster update of the electronic ink displays as
the controller do not update the pannel when the banking
is enabled (currently this behaviour is only implemented
in gd7965 driver).
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
Switch to `NET_SOCKET_REGISTER` mechanism over the offloaded API
registration.
Including the following fixes from the review:
* The fd returned by the socket accept call needs to be finalized,
similar to how it is done for socket creation.
* sl_RecvFrom() in TI SimpleLink Host driver does not support NULL
pointers for 'from' address and address length, and sl_SendTo() does
not ignore the destination address when in connection mode, so passing
NULL would cause a failure. These issues have been reported to TI
(CC3X20SDK-1970, CC3X20SDK-1971).
Let's use sl_Recv and sl_Send to implement recvfrom/sendto in the case
of NULL addresses.
* simplelink_poll() should not process negative file descriptors in the
fds array after sl_Selecti() returns. A negative fd value indicates
that the entry is invalid and should be ignored.
Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This commit fixes an issue observed with SimpleLink sockets with
multiple definitions of `gethostname` function. So far, the definition
within `socket.h` was not visible when offloading was enabled.
As this is no longer the case, and SimpleLink partially uses POSIX
subsystem, builds for this platform resulted in compilation error.
The issue was fixed by moving `gethostname` declaration in unistd.h
inside the `#ifdef CONFIG_POSIX_API` block.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Instead of using a custom offloading interface, users can use
`NET_SOCKET_REGISTER` macro to register custom socket API provider. This
solution removes a limitation, that only one offloaded interface can be
registered and that it cannot be used together with native IP stack.
The only exception remainig are DNS releated operations -
`getaddrinfo`/`freeaddrinfo`, which, when offloaded, have to be
registered specifically.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Fix LE Create Connection command giving out of range parameters to the
controller, this came back as 0x30 (Out of Range Parameters) status code
on the command from the controller.
This appears to be the min and max CE parameters in the command.
Revert back memset from 137f704064
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Fix problem where application was notified about a new connection being
established, but no connection has actually been made.
This occurred because the LE Create Connection command failed directly
from the API, in which case the state transition thinks the err is valid
and always notifies the application.
Introduced by:
6c1f52dff7 for bt_conn_create_le
e9eebf0c40 for bt_conn_create_auto_le.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
It's no longer needed to call `mqtt_input` after `mqtt_disconnect`.
Doing this will actually return an error as the MQTT connection is no
longer active after calling `mqtt_disconnect`.
Fixes#22360
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Added support for native_posix targets.
Added setting FS back-end initialization which is used by
native_posix targets.
The test harness was adapted to the fact that key-value pairs
read-out order might be different for each back-end when call
settings_load().
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Corrected improper return value description of
settings_runtime_get().
Added return value description to each of settings handler
description.
Include run-time API into doxygen build.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Added sample for the settings subsystem.
The sample shows how to:
-initialize and register handler
-implement handles
-save and load data using registered handlers
-load subtree
-save or delete a certain value
-load subtree values or a value directly
- example on how to write data to the
setting destination and how to read data
from the setting destination using runtime API.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Fix an issue where a slot in the key pool was considered free when
either the address was cleared or no keys were written in the entry
(enc_size == 0). This caused a problem with simultaneous pairing
attempts that would be assigned the same entry.
This patch makes it so a a slot is considered free even when keys are
not yet present in the entry, and makes sure the address is cleared in
case of pairing failure or timeout so to mark the slot as free.
Signed-off-by: François Delawarde <fnde@oticon.com>
SW based privacy is an implementation detail in the zephyr link layers.
Therefore it should not be visible when selecting an out-of-tree
controller.
Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
Since a peer MIC failure closes the event, it does not allow a terminate
acknowledge. For that reason a peer MIC fail for central role must force
a conn_cleanup.
Signed-off-by: Morten Priess <mtpr@oticon.com>
Sort out mbedTLS dependencies in sockets Kconfig. mbedTLS will now
be enabled when TLS sockets and native network stack are enabled.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Only dump data when we are interested in the analysing coverage. By
default just collect the data.
CONFIG_COVERAGE_DUMP is used to control this behaviour.
This will help speed up sanitycheck and will avoid lots of noise in the
log when some tests with coverage enabled failed. Dumping data to
console is also suspected to be one of the reason why qemu hangs in CI.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>