Adding a way to pre-install the irg/vector on an irte and a way to get
an irte based on irq/vector.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This will not only be used by MSI remapping but by all relevant
interrupts.
Fix also IRTE settings:
- handle x2apic for destination id
- destination mode is always logical (as for IOAPIC)
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
In XAPIC mode, it's possible to tell VT-D to let interrupt in compatible
format passing through.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
SHV bit depends on the number of vectors allocated.
If it's facing a multi-vector MSI array, it will set the bit.
If not the bit must be 0.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Refactor to handle this case. This is valid only when MSI multi-vector
feature is enabled.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
As all interruption need to go through VT-D, calling vt-d remap will
happen on lower level as seen next, so make sure all pcie related
irq/vector get tighten to their respective allocated IRTE.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Allocate an IRTE for all irq being connected through
arch_irq_connect_dynamic(). This will be mandatory since VT-D expects to
filter all interruptions (but the one it generates, as we will see
later).
Taking into account CONFIG_INTEL_VTD_ICTL_XAPIC_PASSTHROUGH, which could
help for debugging.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
There is no need to differentiate with multi-vector or not, MSI vs
MSI-x: all need to be remapped if Intel VT-D is on.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
While this does not change anything for ia32, this is fixing the chicken
& egg issue on intel64 if (and only if) interrupt remapping is enabled
so pcie_connect_dynamic_irq() is to be called properly.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This is meant to be called by drivers on PCIe BUS with a fixed (from
DTS) IRQ or an MSI one. I.e.: all drivers without a runtime IRQ
detection/allocation.
The arch-specific macro is required to be implemented relevantly.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
The is meant to fix a chicken & egg issue with MSI interrupt remapping.
Currently, drivers first connect the irq (by-passing any possible MSI
remapping), so the IRQ ends-up being remapped at the IOAPIC level which
is not what we want.
So adding a dedicated function to properly handle this case. This is
valid only for runtime dynamic IRQ connection obviously.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
And since it does yet another round of pcie_get_cap() on PCIE_MSI_CAP_ID
and PCIE_MSIX_CAP_ID, let's factorize that into a utility function and
change the relevant places to use that function instead.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Align compiler flags of SOF Zephyr build with the build SOF XTOS
and use -fstrict-overflow.
With -fno-strict-overflow, some versions of XCC compiler (e.g. xt-xcc
12.0.8) always emit a "bltu" instruction to check for overflow in loops
like:
unsigned int n;
for(n = 0; n < 1024; n++)
do_arithmetic();
With "-fno-strict-overflow", you'll have:
18: 068076 loop a0, 22 <dummy_dspload+0x22>
1b: 445a add.n a4, a4, a5
1d: 551b addi.n a5, a5, 1
1f: 023657 bltu a6, a5, 25 <dummy_dspload+0x25>
22: fffc86 j 18 <dummy_dspload+0x18>
With "-fstrict-overflow":
16: 038476 loop a4, 1d <dummy_dspload+0x1d>
19: 223a add.n a2, a2, a3
1b: 331b addi.n a3, a3, 1
As this is a common pattern in audio DSP code, change the default
for SOF builds to -fstrict-overflow.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
The inner loops of SOF audio algorithms benefit from
compiler optimizations. On Intel cAVS platforms, it was noted
zero-overhead loops ("loop" family of instructions) is not
used for fixed-size inner loops when using -Os (optimize for
size) and the XCC xtensa toolchain.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
The -q flag supresses all wget output, even when there is a failure.
This makes it difficult to diagnose CI failures when the download fails.
The --no-verbose flag is a better choice: it is silent enough but it
always shows the outcome.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Improve the documentation so that both z_device_is_ready and
device_is_ready are consistent with each other. Information about PM has
been removed since device_is_ready does not take into account the PM
status of a device.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
The functionality provided by device_usable_check is already provided by
device_is_ready. The (z_)device_usable_check APIs have been
re-implemented using the (z_)device_is_ready APIs and have been marked
as deprecated.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
device_usable_check() can return 0 or -ENODEV, so using device_is_ready
is equivalent if we return -ENODEV when the device is not ready.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Instead of using device_usable_check() syscall, implement a new syscall
for device_is_ready that uses z_device_is_ready underneath.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Rename z_device_ready to z_device_is_ready. Function name suggests a
boolean result this way, in line with other functions (e.g.
device_is_ready).
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Add fixture disk_sdcard for the sdcard test, since the test requires an
SD card to be present on the board.
Fixes#41331
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
Fix for issue 39978. This commit assigns the __rodata_region_start marker
to the ROMABLE region prior to the inclusion of linker/common-rom.ld,
linker/thread-local-storage.ld and linker/cplusplus-rom.ld. Prior to this
fix, the __rodata_region_start marker was properly aligned and indicated
the expected memory location for the start of the rodata section and
similar sections, but it was disconnected from the ROMABLE region into
which the subsequent sections are being integrated, resulting in placement
of those sections right behind the previous section in the ROMABLE region
and therefore at addresses below the __rodata_region_start marker.
For the sake of consistent behaviour, the end marker of the text region
has been modified accordingly.
Signed-off-by: Immo Birnbaum <Immo.Birnbaum@weidmueller.com>
This structure can be reused to set periodic advertising data.
The structure tries fills the buffer as much as possible.
Later this can be reused for setting advertising data in other cases
as well.
Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
Enable EDMA0 node to prevent build warning when DMA MCUX driver is
included in build.
Fixes#41524
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
bt_le_stop() previously did the same restting as bt_scan_reset(). After
the recent changes they were out of sync.
Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
How the conversion worked was unclear. Moving the conversion out to a
separate function and documenting how it works makes the code easier to
understand.
Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
The host reassembles fragmented advertising reports from the controller.
Non-complete advertising reports from different advertisers may not be
interleaved. If non-complete advertising reports from an advertiser
is received while advertising reports from another advertiser is
reassembled, an error message is logged and the advertising report is
discarded. Future scan results may be incomplete.
Advertising reports from legacy PDUs or complete extended advertising
reports may be interleaved as these do not require reassembly.
If the controller sends more advertising data than fits in the
reassembly buffer, the data is truncated. Further advertising reports
from the advertiser are discarded until the final complete advertising
report is received and discarded.
Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
Add support for the touchscreen controller on STM32F769I-DISC0(MB1166).
The touchscreen uses Focaltech FT6202 which is compatible with FT5336.
Tested with kscan_touch sample application.
Signed-off-by: Konstantinos Papadopoulos <kostas.papadopulos@gmail.com>
commit 65f0c8641c
("boards/shields: add zephyr,display chosen property")
added a chosen display property to most of the boards.
This was missing for the pinetime board.
Signed-off-by: Casper Meijn <casper@meijn.net>
Getopt has been moved from /lib/utils to /lib/posix hence
CODEOWNERS must be updated accordingly.
Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
Getopt has been rework in this way that calling it does not require
extra state parameter and its execution is thread safe.
Global parameters describing the state of the getopt function have been
made available to ensure full API compatibility in using this library.
However, referencing these global variables directly is not thread
safe. In order to get the state of the getopt function for the thread
that is currently using it, call: getopt_state_get();
Extended the library with getopt_long and getopt_long_only functions.
Moved getopt libary from utils to posix.
Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
The resource pool of the short-lived dummy thread "stub" may be
inherited by other threads created during system initialization. This
commit initializes this resource pool to NULL or the system pool to
ensure that a well-defined resource pool propagates to other threads
that inherit it from the dummy thread.
Fixes#41482.
Signed-off-by: Berend Ozceri <berend@recogni.com>
Assign unique memory-region attribute values for both OCM
memory areas so that the lower region starting at address 0
is identified as OCM_LOW, while the alternate location for
the OCM memory is identified as OCM_HIGH.
The updated linker command file will use those identifiers
for OCM section mapping based on which of the two OCM areas
is marked as 'chosen' at the board level.
Signed-off-by: Immo Birnbaum <Immo.Birnbaum@weidmueller.com>
Fix the mapping of the sections to be located in the On-Chip
Memory so that the OCM memory region name always matches that
of the chosen OCM DT node's memory-region attribute.
Signed-off-by: Immo Birnbaum <Immo.Birnbaum@weidmueller.com>
YAML description file for the On-Chip Memory of the Xilinx
Zynq-7000, DT identifier "xlnx,zynq-ocm".
Signed-off-by: Immo Birnbaum <Immo.Birnbaum@weidmueller.com>
Remove the manual selection of `CONFIG_GPIO_EMUL` as it is now enabled
by default when devicetree nodes exist.
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
Enable the emulated GPIO driver by default if instances exist in
devicetree. This removes the need to manually enable `CONFIG_GPIO_EMUL`
when `CONFIG_GPIO` is enabled.
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>