The 'zephyr,memory-region-mpu' property was addede gqas a
convenient way to create and configure MPU regions using information
coming from DT. It has been used a lot since it was introduced so I
guess we can consider it a Zephyr success story ™ .
Unfortunately it has been proved to be a bit limited and with some
important limitations:
1. It was introduced as a property of the compatible
zephyr,memory-region that is used to create linker regions and
sections from DT data. This means that we can actually create MPU
regions only for DT-defined regions and sections.
2. The naming is unfortunate because it is implying that it is used only
for MPU.
3. It is misplaced being in include/zephyr/linker/devicetree_regions.h
and still it has nothing to do with the linker at all.
4. It is exporting a function called LINKER_DT_REGION_MPU that again has
nothing to do with the linker.
Point (1) is also particularly limiting because it is preventing us to
characterize memory regions that are not generated using the
'zephyr,memory-region' compatible, like generic mmio-sram regions.
While we fix all the issues, we also want to extend a bit the range of
usefulness of this property. We are renaming it 'zephyr,memory-attr' and
it is now carrying information about the type of memory the property is
attached to (cacheable, non-cacheable, IO, eXecutable, etc...). The user
can use this property and the DT API coming with it to act on the memory
node it is accompanied by.
We are still providing the DT_MEMORY_ATTR_APPLY() macro that can be used
to create the MPU regions as before, but we are adding also a
DT_MEMORY_ATTR_FOREACH_NODE() macro that can be used to cycle through
the memory nodes and act on those.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
Allows the application to force the use of an NRPA.
This is applied regardless of any other roles running (ie scanner) or
advertising type.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Co-authored-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
Added several missing brief descriptions and documented some of the
fields guarded by Kconfig options.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Grouped some defines together, documented service classes and
attributes, and fixed some missing javadoc-style comments.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Using `arg + 0` in sizeof causes problems with `void *`, so use the
type name instead, but make sure it's at least `sizeof(int)` because
the variadic expects a minimum of `int` size. This allows deleting
the specialization for `void *`, which the linker wasn't choosing
reliably anyway.
Signed-off-by: Paul Fagerburg <pfagerburg@google.com>
This commit adds extenstion interface that extends ieee802154_radio.h
New OT-specific capability, transmit mode and configuration parameter
is added.
Signed-off-by: Andrzej Kuroś <andrzej.kuros@nordicsemi.no>
The `attr_get` method is added to the ieee802154_radio to allow
reading of driver specific attributes of given device.
The enum `ieee802154_attr` provides common extension pattern
allowing to extend the attribute set.
Accessor function `ieee802154_radio_attr_get` is provided.
Signed-off-by: Andrzej Kuroś <andrzej.kuros@nordicsemi.no>
The ieee802154_tx_mode and ieee802154_config_type types are given
values allowing to extend these types elsewhere.
Signed-off-by: Andrzej Kuroś <andrzej.kuros@nordicsemi.no>
Adds a helper function for initializing devices into the expected power
state, through the devices `pm_device_action_cb_t`. This eliminates code
duplication between the init functions and the PM callback.
The expected device states in order of priority are:
* No power applied to device, `OFF`
* `zephyr,pm-device-runtime-auto` enabled, `SUSPEND`
* Otherwise, `ACTIVE`
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
Add a sub-priority field to `Z_INIT_ENTRY_SECTION`, which is used to
ensure that multiple drivers running at the same init priority still
run in an order that respects their devicetree dependencies.
This is primarily useful when multiple instances of the same device are
instantiated that can depend on each other, for example power domains
and i2c muxes.
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
Generate a zero padded variant of `_ORD` that is suitable for use in
linker scripts with the `SORT` property, so that `6` is correctly placed
before `24`, and so on.
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
This is meant as a substitute for sys_clock_timeout_end_calc()
Current sys_clock_timeout_end_calc() usage opens up many bug
possibilities due to the actual timeout evaluation's open-coded nature.
Issue ##50611 is one example.
- Some users store the returned value in a signed variable, others in
an unsigned one, making the comparison with UINT64_MAX (corresponding
to K_FOREVER) wrong in the signed case.
- Some users compute the difference and store that in a signed variable
to compare against 0 which still doesn't work with K_FOREVER. And when
this difference is used as a timeout argument then the K_FOREVER
nature of the timeout is lost.
- Some users complexify their code by special-casing K_NO_WAIT and
K_FOREVER inline which is bad for both code readability and binary
size.
Let's introduce a better abstraction to deal with absolute timepoints
with an opaque type to be used with a well-defined API.
The word "timeout" was avoided in the naming on purpose as the timeout
namespace is quite crowded already and it is preferable to make a
distinction between relative time periods (timeouts) and absolute time
values (timepoints).
A few stacks are also adjusted as they were too tight on X86.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
The NXP Pixel pipeline engine (PXP) is a 2D DMA engine capable of
accelerating display rotation, color space conversion, and limited
2D blending operations. This DMA driver only supports rotation of a
framebuffer, via a set of custom dma_slot values. Only DMA channel 0
is supported or utilized.
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
Implement a driver for the PWM controller MAX31790. This driver
also implements the RPM mode of the controller, which can
be accessed via setting pwm_flags_t accordingly to macros
defined in the driver specific header.
Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
With some of the recent work to disable unnecessary system
calls, there is a scenario where `z_impl_k_thread_stack_free()`
is not defined and an undefined symbol error occurs.
Safety was very concerned that dynamic thread stack code might
touch other code that does not malloc, so add a separate file
for the stack alloc and free stubs.
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
Currently priv_stacks_noinit is being put onto the flash waiting
to be copied into memory at boot. This is a waste of flash space
as priviledge stacks are initialized at runtime. So mark
the linker section as NOLOAD to save some flash space.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Rather than looking at the pool of completions for spinning use an
atomic counter of total completions ever done. The relative number of
completions being waited on by rtio_submit may then always be correctly
done.
Prior to this a race was possible, and understood, as
rtio_cqe_consumable was a likely but not guaranteed count of completions.
Sure enough on an SMP system the likely count was ahead of the actual
available completions and a race was caught by the simple test case.
Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
This adds the CONFIG_UART_USE_RUNTIME_CONFIGURE guard to
disable the API function pointers if the kconfig is not enabled.
Both .configure and .config_get should only be usable if runtime
(re-)configuration of UART is needed.
Ifdef guards are added to drivers previously lacking this guard.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Add missing documentation for SYS_HASHMAP_DEFAULT_ALLOCATOR and
sys_hashmap struct.
Fixed minor type in SYS_HASHMAP_DEFINE_STATIC_ADVANCED doc.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Cleaned up doxygen group for hash_map and hash_map_api
Adding brief/desc to the main group instead of the file to actually
surface them in the documentation
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Show hash functions under Hashmap doc entry.
Also fixed minor issue with '.' character ending @brief early.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Enabled support for is31fl3733 driver. This driver supports
the full LED API, and enables the following features of the is31fl3733:
- individual LED dimming
- individual LED enable/disable
- bulk writes of LED enabled and dimming states
- global LED current limit
- blanking (via custom API)
Signed-off-by: Daniel DeGrasse <daniel@degrasse.com>
It's similar to DIV_ROUND_UP, but rounds to the nearest integer.
Some basic unit tests were introduced to check that it works as
intended.
Signed-off-by: Kornel Dulęba <mindal@semihalf.com>
Adds an optional callback upon image data being written, can be
used for syncing or timeout purposes.
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
This CL attempts to implement npcx's flash driver instead of the
original one (npcx spi driver plus spi_nor flash driver).
Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
Make #defines properly Doxygen-documented, add some named groups, and add a
few missing comments to some #defines.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Split the BT_APPEARANCE_* doc on two lines as several lines were
dangerously close to 100-character line limit + some constants were
misaligned.
This makes follow-up commit possible without breaking code formatting
rules.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Replaces the manual lookup function with a lookup function which
is provided when registering MCUmgr handlers which can be used to
find the function to translate error codes, allowing out of tree
MCUmgr handlers to provide error translation handlers.
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Dummy inline functions are useful to avoid ifdeffery in code when a
certain option is not available. pm_state_set/pm_state_exit_post_ops,
are only called from the PM subsystem, so never called if CONFIG_PM=n,
that is, never surrounded with ifdeffery.
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>