Clarify what happens when the period parameter is zero or equal
to the period.
Signed-off-by: Alexander Wachter <alexander.wachter@leica-geosystems.com>
Use device tree provided configurations for arm architecture timer
PPIs.
This fixes issue of timer ppi not working on most hardware where
edge-triggered PPI are not supported.
Signed-off-by: Sandeep Tripathy <sandeep.tripathy@broadcom.com>
The driver-specific config_info structure referenced from the device
structure is marked const. Some drivers fail to preserve that
qualifier when casting the pointer to the driver-specific structure,
violating MISRA 11.8.
Changes produced by scripts/coccinelle/const_config_info.cocci.
Some changes proposed by the script are not included because they
reveal mutation of state through the const pointer, though the
code works as long as the driver-specific object is defined without
the const qualifier.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
If IO APIC is in logical destination mode, local APICs compare their
logical APIC ID defined in LDR (Logical Destination Register) with
the destination code sent with the interrupt to determine whether or not
to accept the incoming interrupt.
This patch programs LDR in xAPIC mode to support IO APIC logical mode.
The local APIC ID from local APIC ID register can't be used as the
'logical APIC ID' because LAPIC ID may not be consecutive numbers hence
it makes it impossible for LDR to encode 8 IDs within 8 bits.
This patch chooses 0 for BSP, and for APs, cpu_number which is the index
to x86_cpuboot[], which ultimately assigned in z_smp_init[].
Signed-off-by: Zide Chen <zide.chen@intel.com>
Add API for recovering an I2C bus. This API can be used to recover
from situations where the I2C master and one or more I2C slaves are
out of synchronization (e.g. if the I2C master was reset in the middle
of an I2C transaction or if a noise pulse was induced on the SCL
line).
Fixes#23441.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
This commit adds enumeration type for isochronous
endpoints specific information required by USB Audio Class.
Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
The DS3231 is an I2C real-time clock with internal temperature
compensated oscillator, maintaining civil time to 1 s precision with
nominal 2 ppm accuracy from 0-40 Cel.
The basic functionality is exposed as a counter that is always running
at 1 Hz. Much more functionality is exposed as driver-specific API,
including the ability to translate between the time scale of the DS3231
and the time scale of the Zephyr uptime clock. This allows correlation
of events in the system clock to UTC, TAI, or whatever time scale is
used to maintain the DS3231.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
Add an API to transmit a continuous wave at a fixed frequency. This
functionality is useful to test the radio in a lab setup.
Signed-off-by: Andreas Sandberg <andreas@sandberg.pp.se>
Add basic driver for GIC V3 interrupt controller.
This implementation supports
- distributor, re-distributor and cpu interface initialization
- configuration and handling of SPI, PPI and SGI.
- V2 Legacy mode is not supported and uses system interface.
Current implementation supports GIC secure state only.
All interrupts are routed to Secure EL1 as 'irq' by configuring
them as Group1 Secure.
TODO:
- MPIDR based affinity routing setting.
- percpu redistributor probe
- message based SPI and SGI generation api
- EL1NS support. Legacy mode support.
- LPI/ITS is not supported.
Signed-off-by: Sandeep Tripathy <sandeep.tripathy@broadcom.com>
Convert all canbus related API/samples/tests/subsys
to the new timeout API with k_timeout_t.
Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
Get rid of legacy timeout API and move to new timeout API for LoRa.
This involves changes to API, SX1276 driver and sample application.
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
API documentation for parameters that accept a duration specified in
milliseconds is updated to replace references to K_NO_WAIT with 0, and
K_FOREVER with SYS_FOREVER_MS.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
DAC (digital to analog converter) peripheral driver with a generic API
suitable for most MCUs (only basic DAC features considered).
Signed-off-by: Martin Jäger <martin@libre.solar>
Several functions that are syscalls were passing structs by value
instead of by reference. Just changed that and implemented missing
verfication handlers for them.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
espi_read_flash should have implementation called
z_impl_espi_read_flash and not z_impl_espi_flash_read. Same thing for
espi_write_flash.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit adds more pin function definitions (PINMUX_FUNC_I through
PINMUX_FUNC_P) to the pinmux interface header.
The SAM D5x and E5x series devices, for instances, define up to the
"function N" and this change is necessary to support such devices.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
Create support for muxed UARTs which are attached to a real
UART and which use GSM 07.10 muxing protocol to create virtual
channels that can be run on top of the real UART.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
HWINFO drivers should be responsible for ensuring that
the data structure is a sequence of bytes. That is not
what the current sam0 and nordic drivers do. The drivers
read the data as u32_t and then memcpy the data to a
buffer. This ensures the data has the endianness of the
underlying MCU, which in this case is Cortex M0 which
is little endian.
This commit fixes the endianness so the data can be
interpreted as a "left to right sequence of bytes".
This commit updates the API doc to provide clarification
of the data structure.
Add to 2.3 release notes.
Fixes#23444, #24103
Signed-off-by: Steven Slupsky <sslupsky@gmail.com>
Convert older DT_INST_ macro use in arm_cmsdk/arm drivers to the new
include/devicetree.h DT_INST macro APIs.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Add a k_timeout_t type, and use it everywhere that kernel API
functions were accepting a millisecond timeout argument. Instead of
forcing milliseconds everywhere (which are often not integrally
representable as system ticks), do the conversion to ticks at the
point where the timeout is created. This avoids an extra unit
conversion in some application code, and allows us to express the
timeout in units other than milliseconds to achieve greater precision.
The existing K_MSEC() et. al. macros now return initializers for a
k_timeout_t.
The K_NO_WAIT and K_FOREVER constants have now become k_timeout_t
values, which means they cannot be operated on as integers.
Applications which have their own APIs that need to inspect these
vs. user-provided timeouts can now use a K_TIMEOUT_EQ() predicate to
test for equality.
Timer drivers, which receive an integer tick count in ther
z_clock_set_timeout() functions, now use the integer-valued
K_TICKS_FOREVER constant instead of K_FOREVER.
For the initial release, to preserve source compatibility, a
CONFIG_LEGACY_TIMEOUT_API kconfig is provided. When true, the
k_timeout_t will remain a compatible 32 bit value that will work with
any legacy Zephyr application.
Some subsystems present timeout (or timeout-like) values to their own
users as APIs that would re-use the kernel's own constants and
conventions. These will require some minor design work to adapt to
the new scheme (in most cases just using k_timeout_t directly in their
own API), and they have not been changed in this patch, instead
selecting CONFIG_LEGACY_TIMEOUT_API via kconfig. These subsystems
include: CAN Bus, the Microbit display driver, I2S, LoRa modem
drivers, the UART Async API, Video hardware drivers, the console
subsystem, and the network buffer abstraction.
k_sleep() now takes a k_timeout_t argument, with a k_msleep() variant
provided that works identically to the original API.
Most of the changes here are just type/configuration management and
documentation, but there are logic changes in mempool, where a loop
that used a timeout numerically has been reworked using a new
z_timeout_end_calc() predicate. Also in queue.c, a (when POLL was
enabled) a similar loop was needlessly used to try to retry the
k_poll() call after a spurious failure. But k_poll() does not fail
spuriously, so the loop was removed.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This commit adds the GICD_SGIR register (used for generating software
generated interrupts) field definitions.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
Convert older DT_INST_ macro use in esp32 drivers to the new
include/devicetree.h DT_INST macro APIs.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Fix so that different isochronous synchronization modes can be used.
It filters out the synchronization mode before sending the endpoint
type to drivers.
Signed-off-by: Johan Carlsson <johan.carlsson@teenage.engineering>
Add header definition for bt_read_static_addr function. Declaring it
without a header definition will not give any compilation error when
function definition changes.
Refactor nRF SoC specific code into nRF specific source files and
provide weak definitions when these are not implemented. This will make
it easier to add handlers per vendor.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
This commit fixes the field definition names for `GICD_ICFGR`, which
were incorrectly prefixed with `GICC_`.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
The sole purpose of init options has been to enable hardware flow
control on NS16750 when asked. Use the proper DTS tags for this.
Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Add Platform Environment Control Interface API
This API defines following calls:
- peci_configure
- peci_enable
- peci_disable
- peci_transaction
Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
The current Generic Interrupt Controller (GIC) driver makes use of the
multi-level interrupt mechanism and `irq_nextlevel` public interface.
This is a less-than-ideal implementation for the following reasons:
1. The GIC is often used as the main interrupt controller for the
Cortex-A and Cortex-R family SoCs and, in this case, it is not a 2nd
level interrupt controller; in fact, it is the root interrupt
controller and therefore should be treated as such.
2. The only reason for using `irq_nextlevel` here is to interface the
architecture implementation to the interrupt controller functions.
Since there is no nesting or multiple instances of an interrupt
controller involved, there is really no point in adding such an
abstraction.
3. 2nd level topology adds many unnecessary abstractions and results
in strange coding artefacts as well as performance penalty due to
additional branching.
This commit refactors the GIC driver interface as follows:
1. Remove the current GIC driver interface based on the multi-level
interrupt mechanism and the `irq_nextlevel` public interface.
2. Define the GIC driver interface in
`include/drivers/interrupt_controller/gic.h` and allow the arch
implementation to directly invoke this interface.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
i2c_slave_register/unregister must not be syscalls since it provides
callbacks that will run in supervisor mode. Nonetheless, verification
functions were missing which means that these functions never worked
from usermode.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This change removes the hardcoded subsystem list in gen_kobject_list.py
favor of marking the relevant driver API structs with the _subsystem
sentinel.
Signed-off-by: Corey Wharton <coreyw7@fb.com>
Change the doxygen doc from "negative on error" to -ENOSUP and
negative value on driver specific errors.
Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
If IO APIC is in logical destination mode, local APICs compare their
logical APIC ID defined in LDR (Logical Destination Register) with
the destination code sent with the interrupt to determine whether or not
to accept the incoming interrupt.
This patch programs LDR in xAPIC mode to support IO APIC logical mode.
The local APIC ID from local APIC ID register can't be used as the
'logical APIC ID' because LAPIC ID may not be consecutive numbers hence
it makes it impossible for LDR to encode 8 IDs within 8 bits.
This patch chooses 0 for BSP, and for APs, cpu_number which is the index
to x86_cpuboot[], which ultimately assigned in z_smp_init[].
Signed-off-by: Zide Chen <zide.chen@intel.com>
GPIO_DIR_OUT is deprecated but allowed in devicetree bindings because
some in-tree bindings provided it in the past. GPIO_DIR_IN was the
former explicit way of representing the default direction. Put it
back so symmetry is maintained.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Added subsys argument to the callback, updated one driver which
used it and test cases.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Use gpio_pin_t uniformly when passing pin indexes to the driver. Use
gpio_flags_t uniformly when passing flags to the driver. Change name
of pin configuration function in API function table to be consistent
with other API functions.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>