Add common header files for Intel SoC FPGA. The header files define the
handoff data structure and system manager base addresses needed by
Agilex initial bring up.
Signed-off-by: Siew Chin Lim <elly.siew.chin.lim@intel.com>
Add new common inline functions sys_set_bits and set_clear_bits to set
and clear multiple bits via bit mask in single function call.
Signed-off-by: Siew Chin Lim <elly.siew.chin.lim@intel.com>
The shared multi-heap memory pool manager uses the multi-heap allocator
to manage a set of reserved memory regions with different capabilities /
attributes (cacheable, non-cacheable, etc...) defined in the DT.
The user can request allocation from the shared pool specifying the
capability / attribute of interest for the memory (cacheable /
non-cacheable memory, etc...)
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
Added note to release notes about timeout units used in
uart_tx and uart_rx_enable.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Updated uart_rx_enable() and uart_tx() to use timeout given
in microseconds. Previously argument was given in milliseconds.
However, there are cases when milliseconds granularity is not
enough and can significantly reduce a throughput, e.g. 1ms is
100 bytes at 1Mb.
Updated 4 drivers which implement asynchronous API. Updated
places where API was used.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Add macro for representing forever timeout in microseconds.
Macro is similar to already existing SYS_FOREVER_MS.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Use ZEPHYR_<MODULE>_MODULE_DIR instead of relative paths. Moving the
module folder would otherwise break the build system.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
The struct basically only had a pointer to
bt_iso_chan_path as well as duplicating the pid and
the direction.
The commit removes the struct as it was more confusing than helpful,
and instead use the PID for the bt_iso_chan_path and
supply the direction as a argument instead.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
A recent change broke the fallback to using a simple
HCI data path configuration in case that the application
does not provide a data path.
This commit fixes that issue, while retaining the
intended update from the change that broke the fallback,
as well as making the code a bit easier to read
and more documented.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
There was an error in handling of max number of IQ reports
generated by controller. Accordin to BT Core Spec 5.1 the host
may request a number of CTEs to be sampled and reported by
controller while enable IQ sampling. The max_cte_count value
set to zero means sample all CTEs in a periodic advertising chain.
The commit fixes wrong handling of the max_cte_count provided
value to generate expected number of IQ reports.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
The irq_lock() usage here is incompatible with SMP systems, and one's
first reaction might be to convert it to a spinlock.
But are those irq_lock() instances really necessary?
Commit 6161ea2542 ("net: socket: socketpair: mitigate possible race
condition") doesn't say much:
> There was a possible race condition between sock_is_nonblock()
> and k_sem_take() in spair_read() and spair_write() that was
> mitigated.
A possible race without the irq_lock would be:
thread A thread B
| |
+ spair_write(): |
+ is_nonblock = sock_is_nonblock(spair); [false]
* [preemption here] |
| + spair_ioctl():
| + res = k_sem_take(&spair->sem, K_FOREVER);
| + [...]
| + spair->flags |= SPAIR_FLAG_NONBLOCK;
| * [preemption here]
+ res = k_sem_take(&spair->sem, K_NO_WAIT); [-1]
+ if (res < 0) { |
+ if (is_nonblock) { [skipped] }
* res = k_sem_take(&spair->sem, K_FOREVER); [blocks here]
| + [...]
But the version with irq_lock() isn't much better:
thread A thread B
| |
| + spair_ioctl():
| + res = k_sem_take(&spair->sem, K_FOREVER);
| + [...]
| * [preemption here]
+ spair_write(): |
+ irq_lock(); |
+ is_nonblock = sock_is_nonblock(spair); [false]
+ res = k_sem_take(&spair->sem, K_NO_WAIT); [-1]
+ irq_unlock(); |
* [preemption here] |
| + spair->flags |= SPAIR_FLAG_NONBLOCK;
| + [...]
| + k_sem_give(&spair->sem);
| + spair_read():
| + res = k_sem_take(&spair->sem, K_NO_WAIT);
| * [preemption here]
+ if (res < 0) { |
+ if (is_nonblock) { [skipped] }
* res = k_sem_take(&spair->sem, K_FOREVER); [blocks here]
In both cases the last k_sem_take(K_FOREVER) will block despite
SPAIR_FLAG_NONBLOCK being set at that moment. Other race scenarios
exist too, and on SMP they are even more likely.
The only guarantee provided by the irq_lock() is to make sure that
whenever the semaphore is acquired then the is_nonblock value is always
current. A better way to achieve that and be SMP compatible is to simply
move the initial sock_is_nonblock() *after* the k_sem_take() and remove
those irq_locks().
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Add the arm64 MMU arch_virt_region_align() implementation used
to return a possible virtual addres alignment in order to
optimize the MMU table layout and possibly avoid using L3 tables
and use some L1 & L3 blocks instead for most of the mapping.
Suggested-by: Nicolas Pitre <npitre@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
On ARM64 platforms, when mapping multiple memory zones with size
not multiple of a L2 block size (2MiB), all the following mappings
will probably use L3 tables.
And a huge mapping will consume all possible L3 tables.
In order to reduce usage of L3 tables, this introduces a new
arch_virt_region_align() optional architecture specific
call to eventually return a more optimal virtual address
alignment than the default MMU_PAGE_SIZE.
This alignment is used in virt_region_alloc() by:
- requesting more pages in virt_region_bitmap to make sure we request
up to the possible aligned virtual address
- freeing the supplementary pages used for alignment
Suggested-by: Nicolas Pitre <npitre@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Only one single IPC service backend is currently present: multi_instance
backend. This backend is heavily relying on the RPMsg multi_instance
code to instanciate and manage instances and endpoints. Samples exist
for both in the samples/subsys/ipc/ directory.
With this patch we are "unpacking" the RPMsg multi_service code to make
it more modular and reusable by different backends.
In particular we are re-organizing the code into two helper libraries:
an RPMsg library and a VRING / virtqueues static allocation library. At
the same time we rewrite the multi_instance backend to make fully use of
those new libraries and remove the old multi_instance sample.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
In order to allow for further options to be deprecated with minimal
impact, add a deprecation argparse Action and a callable instantiator
that can be used to deprecate options in favor of new ones.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
In an effort to standardize the way that a particular debugger or device
instance is identified when there are multiple present, introduce a new
-i/--dev-id option common to all runners that allows the user to specify
which device to interact with when there are multiple connected.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
While adding support for service type enumeration, a regression was
introduced which prevented mDNS ptr query responses.
1. There was an off-by-one error with label size checking
2. Valid queries were failing to match in `dns_rec_match()` due to
not checking for either NULL or 0 "wildcard" port
Fixes#39284
Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
This option was deprecated for the v2.6 release, and has therefore met
the 2 release deprecation cycle requirements.
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
Replaces the prefixes of gpio_matrix_in and gpio_matrix_out
to unify those function calls on all supported socs.
Signed-off-by: Glauber Maroto Ferreira <glauber.ferreira@espressif.com>
Fixes undefined references to sys_port_trace_k_thread_abort_enter()
and sys_port_trace_k_thread_abort_enter().
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
When the driver was called to set the period length for a channel
to 0, it set the COUNTERTOP register in the PWM peripheral to 0,
what resulted in an undefined behavior of the peripheral (and lack
of the STOPPED event sometimes).
The PWM API does not precise how should a zero length period be
handled; some drivers return the -EINVAL error in such case, some
do not. This patch fixes the pwm_nrfx driver so that it does not
change the previously used COUNTERTOP register value when the period
length is set to 0, and because the pulse cycles are always limited
by the driver to period cycles (so 0 in this case), in result the
relevant channel is simply deactivated. This allows users to switch
off a channel by requesting the pulse width to be set to 0 without
providing a non-zero period in such call.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
Implement the CPU idle task. The system should enter this task when
there is no any task to ensure power saving.
Tested on it8xxx2_evb board. It will reduce 12.5mA when system enters
the CPU idle task.
Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
If CONFIG_STREAM_FLASH_ERASE is set, a page erase is done before
writing the coredump header to the flash. If the flash page erase size
is larger than the flash write size this results in erasing part of
the coredump data.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
The stream api initialization for the coredump flash backend used an
incorrect size.
This commit subtracts the header size.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Debugging ESP32 SoCs is not possible if the commands
halt, target and load are enabled by default.
This MR allows this configs to be used as input parameters.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
The filtering of periodic advertisements by scanner may be not needed
in certain situations e.g. while use of periodic advertising by BT ISO.
To make the code smaller and avoid execution of not needed code the
functionality will be conditionally compilable. It may be enabled
or disabled by use of CONFIG_BT_CTLR_SYNC_PERIODIC_CTE_TYPE_FILTERING
Kconfig option.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
The receiver and transmitter in the test are synchronized by
use of sleep functions. The change in handling of periodic
advertising synchronized event caused missmach in waiting
times. Receiver is notified about established synchronization
later that it was in the past. Due to that the wait for end
of transmitter operation was too long.
Temporary fix for the problem is decrease of receiver sleep
time by one periodic advertising interval.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
First implementation of periodic advertising sync filtering
requires existence of Direction Finding Extension in Radio
peripheral.
To add the filtering support for other Nodric SOCs software
based PDU traversing for CTEInfo should be implemented.
In case there is no DFE in Radio peripheral, actual filtering
is done in ULL.
The commit provides necessary changes to previous solution.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Enable filtering of periodic advertisements to synchronize
with advertisenemts that include CTE.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Follow up on changes in lower link layer to add filtering
of periodic advertisements synchronization by CTE type.
The NODE_RX_TYPE_SYNC is used to transport information that:
- Sync is established. In such situation the node_rx
includes data related with received PDU
- Sync scanning is terminated.
In first case ULL will generate NODE_RX_TYPE_SYNC_REPORT
after sending NODE_RX_TYPE_SYNC.
Also EVENT_DONE_EXTRA_TYPE_SYNC handling has additional
execution path that terminates sync scanning if requested
by lower link layer. In other case it adjusts sync scan
window and maintains timeout as usual.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Periodic advertisement synchronization may be filtered by CTE type.
If particular CTE type is not allowed then depening on filtering policy:
- if filtering policy is off synchronization if terminated
- if filtering policy is on synchronization is continued to
synchonize with another device from allowed adverisements list.
If synchronization is established and peer device changes CTE type
to one that is not allowed, synchronization should be maintained.
There are two new execution paths. First one is executed when
synchronization is created. In this case CTEILINE is enabled
to parse PDU for CTEInfo field. In this execution path CTE
type is verified. Second execution path does not include
parsing PDU for CTEInfo and verification of CTE type.
Information about sync allowed is added to node_rx instance
that transports received PDU data. In case the sync has to be
terminated the node_rx will not hold PDU data.
Also done event is extended with information about sync
termination if CTE type is not allowed and filtering
policy is off.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
To enable runtime parsing of PDU to find CTEInfo field CTEINLINE mode
has to be enabled. Thanks to that it is possible to verify if the PDU
has allowed CTE type e.g. for periodic advertising synchornization.
To run CTEInfo parsing other parametrers of CTEINLINE are not relevant.
If Radio is set to disable after PDU END event the CTE sampling
will not be processed.
The commit moves the radio_df_cte_inline_set_enable function to make
it accessible even the direction finding features are disabled.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>