This removes the scanning and PA sync capabilities from the
broadcast sink implementation, moving the responsibility of this
to the application layer.
The reason for this is to add more flexibility and choice to the
upper layers, while simplifying the Broadcast Sink implementation.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The @note in bt_bap_stream_send did not make any sense, and has
been replaced with a new note.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Added some missing doxygen comments (missing javadoc style syntax)
Fixed some brief descriptions
Added named heading in conn_mgr_conn_binding
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Allow properties 'regulator-min-microvolt' and 'regulator-max-microvolt'
for fixed regulators: Note: they should be equal.
Add simple functions for getting list of allowed and count of voltages.
Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
Possible situation is that in some driver, devices can be controlled in
different ways: in some, we can only turn the power on or off, in others,
we can only control the voltage, and in some, we can control power supply
or voltage level. There may also be devices where there is no control
over power supply at all. A clear example of this can be eMMC devices
where the voltage is usually fixed and they are always powered on.
However, we would like to have a common code for controlling all the
mentioned types of devices, at least the driver shouldn't worry about the
implementation details of voltage regulators. Therefore, there may exist
empty regulators - regulators that only contain information about the
supported voltage, and we cannot change anything in them. The device tree
node description for such a regulator is only necessary for compatibility
with other regulators. Hence, we need to add the possibility of the
existence of such a dummy fixed-regulator.
In this commit, support for a fixed dummy regulator without the ability
for any control has been added. Note that such support also exists in the
Linux kernel. In other words, the logic of the fixed regulator has been
aligned with the logic of the fixed regulator inside the Linux kernel.
Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
Some architectures such as RISC-v support more than 255 interrupts
per aggrigator. This diff adds the ability to forgo the aggrigator
pattern and use a configurable number of bits for multilevel
interruts.
Signed-off-by: Joshua Lilly <jgl@meta.com>
Looking back at the current INPUT_LISTENER_CB_DEFINE api naming, it
feels like it's a bit overloaded. Rename it to a simpler
INPUT_CALLBACK_DEFINE.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
This renames the local variables in WAIT_FOR() to make them
more unique to avoid them being shadow variables.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
In print_pmp_entries(), start and end are function arguments
and yet another start and end are declared inside the for
loop. So rename the function arguments to fix shadow variables
warning.
The changes in csr_*() macros are needed to avoid shadowing
__v when nesting those functions together, for example,
csr_write(..., csr_read(...)).
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Rename the argument for UNALIGNED_GET() from p to g.
This fixes shadow variable warning of __p if UNALIGNED_GET()
is nested with UNALIGNED_PUT().
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Z_SYSCALL_VERIFY_MSG() does LOG_MODULE_DECLARE() internally to
log errors during verification. However, this is definitely
going to conflict with any LOG_MODULE_DECLARE() in the source
file using Z_SYSCALL_VERIFY_MSG(). So we need to selectively
disable -Wshadow for Z_SYSCALL_VERIFY_MSG() to avoid compiler
warnings as this is an intentional behavior.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This introduces two macros TOOLCHAIN_IGNORE_WSHADOW_BEGIN and
TOOLCHAIN_IGNORE_WSHADOW_END which can be used inside another
macro to ignore -Wshadow for certain block of code. This is
useful for common macros that may nest upon themselves
(for example, logging).
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This fixes 3 issues that came within PR #59124 for ppp uart usage.
Earlier start/stop of ppp was done at enable() but that
was removed in PR #59124. Now putting enable/disable() back and
putting start/stop there.
Additionally, there was a double ppp carrier ON when NET_EVENT_IF_DOWN.
For that net_if_carrier_on/off is set in uart ppp.c driver.
Also, maybe worth to be mentioned that after PR #59124 there is no
ppp carrier off when lcp is disconnected, for workaround that change,
application should use ppp dead/running events.
Signed-off-by: Jani Hirsimäki <jani.hirsimaki@nordicsemi.no>
Move the z_mapped_start marker for non-XIP builds to the base RAM address.
This has already been the marker's location when building for XIP.
Prior to this change, z_mapped_start was located at the start of the
text section for non-XIP builds. However, at least for the Cortex-A
family of CPUs, the first section located at the RAM base address
isn't the text section, but the single 4k page containing the exception
vectors which are copied to either address 0 or the HIVECS address upon
early boot.
This resulted in this first 4k page at the bottom of RAM to be considered
available for memory mappings via the MMU at run-time, followed by all
the permanently mapped stuff, with available mappable memory only
continuing behind z_mapped_end. A call at run-time requesting memory to
be mapped via the MMU therefore always assigned the single 4k page
containing the vectors data first, before continuing mapping physical
memory behind z_mapped_end. For any map call requesting more than 4k,
this resulted in a contiguous virtual memory address range mapped to
non-contiguous physical memory. This behaviour has already been
documented in #51024.
This behaviour would also cause further problems in case of support
for the Cortex-A's VBAR register, which has been proposed before, but
eventually wasn't merged. Letting VBAR point to the RAM base where
the 4k vectors page is located within the Zephyr image instead of
copying the vectors to either 0 or the HIVECS address means that this
page may under no circumstance be re-assigned for use as regular RAM
mapped via the MMU.
Signed-off-by: Immo Birnbaum <mail@birnbaum.immo>
This is a follow up to #53262, which still lacked the adjustment of the
.noinit section's position within the binary by the time the PR went
stale.
Adjust the linker command file so that the .bss and .noinit sections
are placed at the end of the resulting binary. Until now, those sections
have been located somewhere in the middle of the binary, so that the
inclusion of structures like statically defined heaps or large zero-
initialized arrays reflected 1:1 in the resulting binary's size. Even
for a stripped binary, such data was included in full as the linker
couldn't omit it due to subsequent sections within the binary.
This fix has been tested with a 32 MB statically allocated heap and
a 32 MB uint8 zero-initialized array. Both structures are clearly
identifyable in the memory consumption statistics, however, the final
binary's size is unaffected by their inclusion.
Signed-off-by: Immo Birnbaum <mail@birnbaum.immo>
Add new option to use thread local storage for stack
canaries. This makes harder to find the canaries location
and value. This is made optional because there is
a performance and size penalty when using it.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Moved alloca.h trick further down the file to workaround Doxygen
getting confused with #ifdef/#ifndef.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Data structures in Modules > Utilities > Data Structures were missing
some documentation.
Also properly hid the structures' internals (note that for some of the
files touched by this commit, some internals were already de-facto
hidden by Doxygen as they begin with an _ character).
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Move brief and description under group instead of file so that they show
up nicely in the documentation.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
In case native interface is used with NET_OFFLOAD enabled, the
net_if_is_ip_offloaded() could lead to a crash, if called on unbound
net_context (i.e. with no iface assigned to net_context yet).
As since commit 40d2240226 the net_context
allocated on offloaded interface is always assigned with the iface
pointer during its creation, it can be safely assumed that in case of
NULL pointer is provided we deal with a native interface. Therefore
instead of asserting on the iface pointer, indicate that the interface
is native when NULL pointer is provided.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This convenience API returns the absolute address of a fixed partition,
i.e., relative offset + base address. It's distinct from `DT_REG_ADDR()`
and `FIXED_PARTITION_OFFSET()`, both of which return just the offset.
The base address is taken from the parent memory node as given by the
newly added `DT_MEM_FROM_FIXED_PARTITION()`. This is expected to ensure
that the returned address is directly addressable by the CPU. This is
also meant to prevent `DT_FIXED_PARTITION_ADDR()` from working with
external memory partitions.
Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
This is a new fixed-partitions API, which serves as a companion to the
existing `DT_MTD_FROM_FIXED_PARTITION()`. In the following example:
flash-controller@0 {
compatible = "flash-controller";
flash@1000000 {
compatible = "soc-nv-flash";
partitions {
compatible = "fixed-partitions";
partition@3a000 {};
};
};
};
`DT_MTD_FROM_FIXED_PARTITION()` would let us map `partition@3a000` to
`flash-controller@0`. Now, the new `DT_MEM_FROM_FIXED_PARTITION()` can
let us retrieve the memory node (`flash@1000000`) as well, in a manner
consistent with the existing API.
Caution: if a fixed partition is not said to belong to a memory node,
like in this alternative example:
flash@0 {
compatible = "spi-nor";
partitions {
compatible = "fixed-partitions";
partition@0 {};
};
};
then `DT_MEM_FROM_FIXED_PARTITION()` will map `partition@0` to an
invalid node identifier. This partition belongs to `flash@0`, which
could be an MTD on a SPI bus.
For consistency, the existing `DT_MTD_FROM_FIXED_PARTITION()` is now re-
expressed in terms of the new `DT_MEM_FROM_FIXED_PARTITION()`.
Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
Add few extra definitions used by board DTSs and some that seems to make
sense for potential applications. These match the code and name of the
Linux event codes.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
At the moment, NET_EVENT_IPV6_PREFIX_ADD and NET_EVENT_IPV6_PREFIX_DEL
events provide provide information about an address without its length
and lifetime.
Signed-off-by: Konrad Derda <konrad.derda@nordicsemi.no>
atomic_t is a machine word signed integer but cq_count is meant to be an
unsigned positive only count of total completions. Cast when needed to
ensure the correct math and comparisons are being done.
Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
The RTIO API docs weren't being shown. I made a poor assumption thinking
I could simply include the top level doxygen group in index.rst which isn't
the case. Fix the groups, and remove a note about a poll function
that doesn't exist yet.
Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
Instead of implementing a custom power off API (pm_system_off),
implement the sys_poweroff hook, and indicate power off is supported by
selecting HAS_POWEROFF. Note that according to the PSCI specification
(DEN0022E), the SYSTEM_OFF operation does not return, however, an error
is printed and system is halted in case this occurs.
Note that the pm_system_off has also been deleted, from now on, systems
supporting PSCI should enable CONFIG_POWEROFF and call the standard
sys_poweroff() API.
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
Add a new API to perform an immediate system power off:
`sys_poweroff()`.
Until now, this functionality has been implemented via the system power
management module, but in a clunky fashion. The way system PM works is
by defining some idle states in devicetree, that, given some properties
(e.g. minimal residency, exit latency, etc.) are automatically selected
when system goes to idle based on the expected next wake-up. However,
system off is a power state that one typically wants to control manually
from the application because it implies state loss, and in most cases,
configuring some sort of wake-up source. So in general, it is not
desired to let the system enter this state automatically. This led to
the following stuff in-tree:
from `boards/arm/mimxrt595_evk/mimxrt595_evk_cm33.dts`:
```c
/*
* Deep power-down mode is supported in this SoC through
* 'PM_STATE_SOFT_OFF' state. There is no entry for this in device tree,
* user can call pm_state_force to enter this state.
*/
```
That is, state not being defined in devicetree so that PM subsystem
doesn't pick it automatically, but still implemented in in the PM hooks:
from `soc/arm/nxp_imx/rt5xx/power.c`, `pm_state_set()`:
```c
case PM_STATE_SOFT_OFF:
set_deepsleep_pin_config();
POWER_EnterDeepPowerDown(EXCLUDE_FROM_DEEP_POWERDOWN);
break;
```
And to actually make use of this state, users had to do this kind of
abominations:
```c
pm_state_force(0u, &(struct pm_state_info){ PM_STATE_SOFT_OFF, 0, 0 });
/* Now we need to go sleep. This will let the idle thread runs and
* the pm subsystem will use the forced state. To confirm that the
* forced state is used, lets set the same timeout used previously.
*/
k_sleep(K_SECONDS(SLEEP_S));
printk("ERROR: System off failed\n");
while (true) {
/* spin to avoid fall-off behavior */
}
```
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
Add support for LP5009, LP5012, LP5018 and LP5024 devices which only
differ by the number of LEDs they can control.
Also, update application sample to run on all these new supported
devices.
Based on initial work from:
- Marek Janus <marek.janus@grinn-global.com>
- Rico Ganahl <rico.ganahl@bytesatwork.ch>
Signed-off-by: Mathieu Anquetin <mathieu.anquetin@groupe-cahors.com>
Adds the force parameter to the reset command which is now
provided to the callback hook (if enabled).
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
This commit addst pinctrl support for Apollo4 SoCs.
Co-authored-by: Mateusz Sierszulski <msierszulski@antmicro.com>
Signed-off-by: Maciej Sobkowski <msobkowski@antmicro.com>
Introduce new API to compare two timepoint values to
find the one that is going to expire sooner, or is already
expired.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
When timers are configured out, timepoint-based timeouts are reduced to
"no wait" or "wait forever" only.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>