This adds the ability to de-initialization a memory domain.
This requires support in the architecture layer. One usage of
this is to release the resources associated with the domain.
For example, we can release allocated page tables so they can
go back to the pool of page tables to be allocated later.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
In commit 7a671993eacf7542a450d62439c012503b7cda2e a change was introduced
that placed variables in llextspecific sections. In the linker script
these are guarded by `#ifdef CONFIG_LLEXT`, but not the corresponding
C code, so these variables are being put in sections that are not
specified in linker scripts. This causes issues with IAR linker,
which warns about these orphan sections.
Signed-off-by: Gustav Holmberg <gustav.holmberg@iar.com>
Add a new parameter to SHMEM's write_message() functon, which is meant to
allow it to perform the required configuration whenever the SCMI stack
(via the SCMI transport layer) wishes to poll for the reply.
For now, don't implement any logic related to this. Thus, no functional
change.
This commit is part of #102904.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Add a new parameter to the transport layer's send_message() function,
which is meant to allow it to perform the required configuration whenever
the SCMI stack user (via the SCMI core layer) wishes to poll for the
reply.
For now, don't implement any logic related to this. Thus, no functional
change.
This commit is part of #102904.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Much like the kernel or llext, rtio.h had become quite large though the
concepts and data types are not.
Restructure the headers into logically grouped components.
Signed-off-by: Tom Burdick <thomas.burdick@infineon.com>
Used to configure the baudrate with the more modern UBX-CFG-VALSET
if supported, and falling back on UBX-CFG-PRT otherwise.
Adding the UART1 related configuration keys.
Just using the baudrate one, relying on the other default parameters.
Signed-off-by: Philémon Jaermann <p.jaermann@gmail.com>
CTS is missing the Local Time Information characteristic and this
commit adds the UUID and the full characteristic to its service.
The peripheral example has been updated as well to use this and
implement it on the example so it is easy to test it out.
Signed-off-by: Martin Moya <moyamartin1@gmail.com>
The micsr_* helpers use a two-step MISELECT+MIREG sequence that is not
atomic. If an interrupt fires between writing MISELECT and accessing
MIREG, the handler could modify MISELECT, causing the MIREG operation
to target the wrong indirect register.
Wrap the MISELECT+MIREG sequence in each micsr_* helper with
irq_lock/irq_unlock to prevent preemption during the two-step access.
This ensures all callers are automatically protected without needing
to add locking at each call site.
Move the micsr_* helpers from csr.h into a new icsr.h header to avoid
pulling zephyr/irq.h into csr.h, which causes circular dependencies
on some SoCs. Code that needs indirect CSR access now explicitly
includes icsr.h.
Signed-off-by: Afonso Oliveira <afonso.oliveira707@gmail.com>
zeroing CNTHCTL_EL2 traps physical timer/counter access from EL1 to EL2,
but Zephyr has no hypervisor to handle those traps.
Enabling access is the standard EL2→EL1 drop behavior.
Signed-off-by: Joakim Tjernlund <joakim.tjernlund@infinera.com>
- Move the variable declaration and related code from kernel/timeout.c
to a new kernel/sys_clock_hw_cycles.c file. The motivation is that
both functions are part of the system clock frequency plumbing
(runtime query / update) and don’t naturally fit the responsibilities
of timeout.c, which is otherwise focused on timeout queue management
and tick announcement logic.
- Make sys_clock_hw_cycles_per_sec_runtime_get() (and its
z_impl_sys_clock_hw_cycles_per_sec_runtime_get() implementation)
visible under CONFIG_SYSTEM_CLOCK_HW_CYCLES_PER_SEC_RUNTIME_UPDATE
as well, not only under CONFIG_TIMER_READS_ITS_FREQUENCY_AT_RUNTIME.
This allows callers and time unit conversion helpers to retrieve the
current system timer frequency after runtime clock changes even when
the timer driver does not discover the rate by querying hardware.
Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
Add infrastructure to support updating the system timer frequency at
runtime on platforms where the timer clock rate can change dynamically.
Introduce CONFIG_SYSTEM_CLOCK_HW_CYCLES_PER_SEC_RUNTIME_UPDATE Kconfig
option that enables runtime frequency updates. This option is mutually
exclusive with CPU_FREQ_PER_CPU_SCALING since the system timer frequency
is tracked as a single global value.
Add z_sys_clock_hw_cycles_per_sec_update() API that platforms must call
after applying a system timer clock change. The kernel provides a weak
default implementation that updates the stored frequency value used by
sys_clock_hw_cycles_per_sec().
System timer drivers that cache derived constants or need to reprogram
hardware on frequency changes can provide a strong override of this
function to maintain driver state consistency while ensuring the stored
frequency is also updated.
Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
Added support for elapsed time service (ETS). The service
is introduced currently with the experimental tag.
Signed-off-by: Dipak Shetty <shetty.dipak@gmx.com>
Now that everything uses the generic STM32L4 PLL binding, remove all
references from the the old PLLSAI binding:
- Remove the lines using div_divr (it is now post_div_r)
- Remove the clock source check since it is now done in the driver
- Remove the PLLSAI binding since it is no longer used
Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
Make the STM32L4 PLLSAIx macros available if the PLLSAIs are defined with
the generic L4 PLL compatible.
Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
Refactor bt_tbs_set_uri_scheme_list to take a single string instead
of an array of URIs. This should not affect applications much
in any way (and may actually be easier to use), but simplifies
the implementation significantly, and reduces memory footprint.
Additionally it also make the client and server more similar
as bt_tbs_client_read_uri_list just returns it as a single
string as well.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add driver for the Infineon SAR ADC peripheral with device tree
binding. The driver uses a generic compatible (infineon,sar-adc)
with an infineon,version property to differentiate IP block
revisions (v2, v3). Features include:
- Single-ended and differential channel configuration
- Configurable resolution (8-12 bits)
- Multiple voltage reference sources (internal, VDDA, VDDA/2, external)
- Channel reference validation against block-level vref-src
- Hardware compensation for SAR v2/v3 single-ended channel limitation
- Interrupt-driven conversion completion
- Integration with peripheral clock control
The driver includes a compile-time per-instance API structure to
correctly report reference voltage to the ADC framework for accurate
raw-to-millivolts conversion.
Tested on CY8CKIT-041S-MAX (SAR v2) and CY8CPROTO-041TP (SAR v3) boards.
Signed-off-by: Braeden Lane <Braeden.Lane@infineon.com>
Co-authored-by: Deepika R <deepika@aerlync.com>
Co-authored-by: Sayooj K Karun <sayooj@aerlync.com>
Add option to use default alignment when building a cbprintf package
on riscv (rv32e). It is useful in case when cbprintf packages are not
formatted on rv32e but on another core. There is such case on nrf54h20
where log messages are formatted by the ARM Cortex M33 core (cpuapp)
and without this option 64 bit arguments are incorrectly formatted.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
When CONFIG_WAITQ_SCALABLE=y, wake up all threads from a post-waitq-walk
callback which is invoked while the scheduler spinlock is still held. This
solves the race condition that was worked around via `no_wake_in_timeout`
flag in k_thread and `is_timeout` parameter of z_sched_wake_thread_locked()
which can now both be dropped.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
When CONFIG_WAITQ_SCALABLE=n, the callback invoked by z_sched_waitq_walk()
is allowed to remove the thread provided as argument from the wait queue
(an operation implicitly performed when waking up a thread).
Use this to our advantage when waking threads pending on a k_event by
waking threads as part of the waitq walk callback instead of building
a list of threads to wake and performing the wake outside the callback.
When CONFIG_WAITQ_SCALABLE=n, this allows removing a pointer-sized field
from the thread structure which reduces the overhead of CONFIG_EVENTS=y.
The old implementation (build list in callback and wake outside callback)
is retained and used when CONFIG_WAITQ_SCALABLE=y since we can't modify
the wait queue as part of the walk callback in this situation. This is now
documented above the corresponding field in k_thread structure.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
Only bind to a controller after probing. Wait that a class is matching and
assigned to a device to assign a host controller to a class. This allows
a class to be used by any of the controller in place.
Remove the `c_data->uhs_ctx` field, not used anywhere, in favor of using
`c_data->udev->ctx`.
Signed-off-by: Josuah Demangeon <me@josuah.net>
The options field of struct bt_le_per_adv_param are defined in Doxygen
group bt_le_per_adv_opt, not bt_le_adv_opt
Signed-off-by: Titouan Christophe <titouan.christophe@mind.be>
When Periodic Advertisement with Responses is enabled with
`CONFIG_BT_PER_ADV_RSP`, some extra optional fields are included in
struct bt_le_ext_adv_cb and struct bt_le_per_adv_param. Even though
these fields are properly doxygen-documented, they are not included
in the HTML docs because they are excluded with conditional compilation.
Update the conditional macros to include them when building the
documentation so they appear there, and add a note to the
corresponding kconfig option to enable them.
Signed-off-by: Titouan Christophe <titouan.christophe@mind.be>
The `Z_GENLIST_LEN` macro declared the loop iterator `node` as
`static`. This causes the variable to be stored in the data segment,
shared across all invocations of the generated `sys_*_len` function.
This makes the function non-reentrant and unsafe in multi-threaded
environments. If an ISR or another thread calls the function
concurrently, the shared iterator state gets corrupted, leading to
incorrect results or infinite loops.
Removing the `static` keyword ensures `node` is allocated on the
stack, making the function thread-safe.
Signed-off-by: Hubert Feurstein <hubert.feurstein@stratum9.at>
Remove #if-defry for inclusion of functions definitions.
This change follows practices recommended in the zephyr-rtos
API Design Guide.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Add device tree bindings for the Alif Semiconductor pin controller
and Ensemble SoC specific pin definitions.
The binding supports pin multiplexing via predefined macros that
encode port, pin, and alternate function into a 32-bit value.
Pad configuration (input enable, drive strength, slew rate, bias
control, etc.) is specified using standard pinctrl properties.
Signed-off-by: Silesh C V <silesh@alifsemi.com>
Alif SoCs organize clock control into multiple register regions
(called clock modules in the driver). Bitfields in these modules
are used to manage different clocks in the SoC. Add headers that
define the encoding of the information necessary to operate on
the clocks.
The encoding packs clock control information into a single 32-bit
value that includes clock module and register offset within the
module, clock enable information and clock source information.
Note that alif-clocks-common.h contains the common encoding scheme,
module definitions etc. that could be reused by other Alif SoCs and
alif-ensemble-clocks.h defines the peripheral clock IDs specific to
the Ensemble family (UART 0-7 clocks are added for initial support).
Co-authored-by: Manoj A Murudi <manoj.murudi@alifsemi.com>
Signed-off-by: Silesh C V <silesh@alifsemi.com>
Add clock control driver
Implement bootup clock initialization, on, off, configure and get_rate API
Signed-off-by: Sunil Abraham <sunil.abraham@microchip.com>
Use the DEVICE_API_GET() helper macro when extracting the bt_hci API from a
device pointer. This also enforces that the given device pointer actually
implements the API in question.
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
- Adds the g1 driver for eic for microchip devices
- Uses the APIs of the eic driver from gpio driver
Signed-off-by: Muhammed Asif <muhammed.asif@microchip.com>
Various functions in kernel.h used the `@retval` command, which requires
a return value to be specified right afterwards, without actually providing
said return value. This causes the first word after the command to render
in a different color inside the documentation which looks odd.
Fix by using `@return` instead or adding the missing return value for the
`@retval` depending on the situation.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
A `@retval` command was missing which caused the documentation for -EINVAL
to be integrated in the documentation paragraph for return value -ENOTSUP
instead of being in its own paragraph.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>