The GIC interrupt controller driver is using a custom init function
called directly from the prep_c function. For consistency move that to
use SYS_INIT.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
Add enum for LE Read Transmit Power phy values, which are different
form the values used for PHY update procedure since it includes values
for the LE Coded PHY coding schemes.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Added a new Bluetooth API that can be used to read the current and
maximum transmit power level of the radio. The reading operation is
performed over HCI.
Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
Add a serie of helpers to extract power management states from device
tree. DT_PM_STATE_ITEMS_LIST generates a list of a pm_state and
DT_PM_STATE_INFO_ITEMS_LIST a list of pm_state_info.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
- Remove SYS_ prefix
- shorten POWER_MANAGEMENT to just PM
- DEVICE_POWER_MANAGEMENT -> PM_DEVICE
and use PM_ as the prefix for all PM related Kconfigs
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Add convenience macros versions of DEVICE_DT_DECLARE and
DEVICE_DT_DEFINE that take a DT_INST number instead.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
In mqtt_keepalive_time_left(), return -1 if keep alive messages are
disabled by setting CONFIG_MQTT_KEEPALIVE=0.
This allows to use mqtt_keepalive_time_left() directly as an input
for poll(). If no keep-alive is expected, -1 would indicate
that poll() can block until new data is available on the socket.
Signed-off-by: Simen S. Røstad <simen.rostad@nordicsemi.no>
k_heap did not have an aligned alloc function, even though
this is supported by the internal sys_heap.
Signed-off-by: Maximilian Bachmann <m.bachmann@acontis.com>
It's disabled by default. When enabled, and if the device exposes both
MSI and MSI-X capabilities: MSI-X will be selected and MSI disabled on
the device.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Such interrupt remapping controller may be found along with Intel VT-D
hardware. Its base-address is via ACPI, and it enables up to 64K
interrupt indexes.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
And implement the support for intel64 which is basically the
architecture that will require it for now.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This is part of Intel VT-D and how to discover capabilities, base
addresses and so on in order to start taking advantage from it.
There is a lot to get from there, but currently we are interested only
by getting the remapping hardware base address. And more specifically
for interrupt remapping usage.
There might be more than one of such hardware so the exposed function is
made to retrieve all of them.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This enables software MSI "multi-vector" feature, letting the user to
register an isr handler per-MSI message.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Though it was noted that pcie_get_cap() is only used by MSI code so far,
there is no need to put it in msi code. If unused, linker will nuke it.
So let's move things to where it belongs to.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
These implemented a k_mem_pool in terms of the now universal k_heap
utility. That's no longer necessary now that the k_mem_pool API has
been removed.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Use the core k_heap API pervasively within our tree instead of the
z_mem_pool wrapper that provided compatibility with the older mempool
implementation.
Almost all of this is straightforward swapping of one alloc/free call
for another. In a few cases where code was holding onto an old-style
"mem_block" a local compatibility struct with a single field has been
swapped in to keep the invasiveness of the changes down.
Note that not all the relevant changes in this patch have in-tree test
coverage, though I validated that it all builds.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Add an optimized realloc() implementation that can successfully expand
allocations in place if there exists enough free memory after the
supplied block.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
The k_mem_pool allocator is no more, and the z_mem_pool compatibility
API is going away. The internal allocator should be a k_heap always.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Mark all k_mem_pool APIs deprecated for future code. Remaining
internal usage now uses equivalent "z_mem_pool" symbols instead.
Fixes#24358
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Remove the MEM_POOL_HEAP_BACKEND kconfig, treating it as true always.
Now the legacy mem_pool cannot be enabled and all usage uses the
k_heap/sys_heap backend.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This commit adds LiteX SoC Builder clock control driver for MMCM
module. It gives ability to change frequency, phase and duty cycle
on up to 7 clock outputs.
Signed-off-by: Pawel Czarnecki <pczarnecki@internships.antmicro.com>
Signed-off-by: Mateusz Holenko <mholenko@antmicro.com>
ARM64 is currently using SP_ELx as stack pointer for kernel and threads
because everything is running in EL1. If support for EL0 is required, it
is necessary to switch to use SP_EL0 instead, that is the only stack
pointer that can be accessed at all exception levels by threads.
While it is not required to keep using SP_EL0 also during the
exceptions, the current code implementation makes it easier to use the
same stack pointer as the one used by threads also during the
exceptions.
This patch moves the code from using SP_ELx to SP_EL0 and fill in the
missing entries in the vector table.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
Add helper defines for Extended Advertising parameters that
can be used while creating Extended Advertising sets.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
LwM2M engine by default sends piggybacked responses for requests after
all callbacks are executed. This approach however isn't good enough if
the application callback executes some lenghty operations (for instance
during FW update). Delaying the ACK may result in unnecessary
retransmissions.
This commits adds an API function which allows to send an early empty
ACK from the application callback. This prevents further retransmissions
from the server side. After all callbacks are executed, the LwM2M engine
will send the response as a separate CON message.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Extended nrf_rtc_timer driver to expose API for using RTC for
other purposes. System timer is using one compare channels,
other channels may be used through this API.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Make bt_conn_ref return NULL if the reference count has reached zero.
This makes it possible to re-use bt_conn_ref internally to re-use the
reference count mechanism to check if the reference is in use.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Update description of macros to create commands with mandatory
number of parameters. Added information that the command name is also
included in this number.
Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
Provide a helper to extract the devicetree node_id for a GPIO
controller from a gpio phandle array. This can be used with
DEVICE_DT_GET() to directly reference the corresponding controller
device.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
When using a devicetree node as an identifier we know the identifier
used to define the device structure. This allows code to directly
reference that structure, avoiding the need to look it up by label at
runtime.
Change the macros so DEVICE_DT_* device objects are globally visible
using the node identifier as the object identifier.
Also add the necessary API to verify that a device that was captured
at build time successfully completed initialization and any other
steps necessary before it can be safely used.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
For devices defined using devicetree nodes we need to pass the
devicetree node, and to infer names for the device and the driver from
it. Devices defined in the classical way don't need this. Introduce
another level of private abstraction that accepts the information from
either source, falling back to the old parameters when the provided
node is invalid.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
The dev_name is the canonical DT node identifier encoding the
devicetree path; the drv_name is the label of the corresponding node.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Introduce common API to achieve data transfer using system DMA.
"System DMA" uses the outbound memory mapped Host address,
it cannot understand Host/PCIe address.
This API will take of mapping the Host address, completing
the data transfer to/from Host memory and unmapping the window;
thus providing abstraction to the user.
Since v1:
- refactored code for the cases where we have valid mapped_addr
to improve error management logic
Signed-off-by: Abhishek Shah <abhishek.shah@broadcom.com>
For a given PCIe EP device, data transfer to/from Host memory can be
achieved with "System DMA" between mapped Host memory
(PCIe outbound memory) and EP device's local memory if EP is equipped
with a "System DMA controller".
Add public API to enable such DMA transfers.
The term "System DMA" is used to clarify that we are not talking about
dedicated "PCIe DMA"; rather the one which does not understand PCIe
address directly, and uses the mapped Host memory.
Signed-off-by: Abhishek Shah <abhishek.shah@broadcom.com>