Pattern being <domain>_<model>.<c/h>.
Here interrupt_controller as a domain would be far too long so
shortening it to "intc", as DTS does actually.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
wdt_install_timeout() was skipped as it installs an ISR-context
callback handler function. The rest are simple wrappers.
Added myself as the maintainer of the syscall handlers. WDT
subsystem appears to not currently have an owner.
Fixes: #21432
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This patch enables SPI4 on the 96Boards STM32 Sensors Mezzanine.
SPI4 has been broken out to a Grove Connector on the board.
Changes:
- Updated board dts to enable spi4
- Updated board Kconfig
- Updated board documentation
- Update board pinmux
- Updated stm32f4 pinmux header file
- Updated stm32f401 dtsi
- Updated stm32f4 defconfig to enable PORTE GPIO
- Added board to spi_loopback test
Test: spi_loopback test passed
Signed-off-by: Sahaj Sarup <sahaj.sarup@linaro.org>
The GPT based counter is a count up timer.
This fixes counter_basic_api tests.
Fix over 80 chars coding style issue.
Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
Cleanup around COND_CODE_1 usage and replacing with
IF_ENABLED if applicable.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Low frequency and high frequency clocks had separate devices
while they are actually handled by single peripheral with single
interrupt. The split was done probably because opaque subsys
argument in the API was used for other purposes and there was
no way to pass the information which clock should be controlled.
Implementation changes some time ago and subsys parameter was
no longer used. It now can be used to indicate which clock should
be controlled.
Change become necessary when nrf5340 is taken into account where
there are more clocks and current approach would lead to create
multiple devices - mess.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
OpenThread recently introduced CMake build system into its repostiory
so we no longer need autotools to build OpenThread libraries and can
integrate them natively.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
NRF devices hardware has flash protection which doesn't
reflect flash API definition well. So fare protection
mechanism was emulated by the software and the driver deals
with hardware flash protection on its own.
Recent change to protection behavior requirement allows
to remove flash API behavior emulation at all.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Setting EEPROM_STM32 with `default y` under `if SOC_FAMILY_STM32`
overrides `depends on SOC_SERIES_STM32L1X` in EEPROM_STM32
definition.
Then, if ever EEPROM is set in any file (as in
tests/drivers/build_all`), EEPROM_STM32 will be indeed set,
with potential issues on series where driver is not yet correctly
handled.
Fix this by removing EEPROM_STM32 definition in STM32 generic
file and set `default y` along with the `depends on` to keep
it effective.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Uses the generated device tree macros, DT_NXP_LPC_USART_USART_*, in the
mcux flexcomm driver and removes the now unused dts fixups from the
lpc54xxx and lpc55xxx socs.
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
Renames the lpc usart shim driver to more accurately reflect the
flexcomm hardware IP and to prepare for instantiating it on an SoC
outside the LPC family.
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
Add initial Atmel at86rf2xx transceiver driver. This driver uses device
tree to configure the physical interface. The driver had capability to
use multiple transceiver and systems with multiple bands can be used.
With this, 2.4GHz ISM and Sub-Giga can be used simultaneous.
Below a valid DT example. This samples assume same SPI port with two
transceivers.
&spi0 {
status = "okay";
label = "SPI_RF2XX";
cs-gpios = <&porta 31 0 &porta 30 0>;
rf2xx@0 {
compatible = "atmel,rf2xx";
reg = <0x0>;
label = "RF2XX_0";
spi-max-frequency = <7800000>;
irq-gpios = <&portb 2 0>;
reset-gpios = <&porta 3 0>;
slptr-gpios = <&portb 3 0>;
status = "okay";
};
rf2xx@1 {
compatible = "atmel,rf2xx";
reg = <0x1>;
label = "RF2XX_1";
spi-max-frequency = <7800000>;
irq-gpios = <&portb 4 0>;
reset-gpios = <&porta 4 0>;
slptr-gpios = <&portb 4 0>;
status = "okay";
};
};
At the moment driver assume two transceiver are enouth for majority of
appications. Sub-Giga band will be enabled in future.
Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
It is possible that the network interface is not yet initialized
when status of the PHY changes. In this case we must not call
net_eth_carrier_on() as that will cause a crash.
This was noticed with mimxrt1050_evk board.
Fixes: #21257
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Enable ESPI OOB channel by default in XEC driver.
Enable OOB channel transmit interrupt and handle OOB up/down correctly.
Change interrupt clearing, clear low level interrupt bits in subhandlers
and high level interrupt in aggregate handlers at the end.
Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
MCHP I2C spec recommends that for repeated start update control register
De-assert ACK in preparation for NACK to end transfer.
Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
Remove leading/trailing blank lines in .c, .h, .py, .rst, .yml, and
.yaml files.
Will avoid failures with the new CI test in
https://github.com/zephyrproject-rtos/ci-tools/pull/112, though it only
checks changed files.
Move the 'target-notes' target in boards/xtensa/odroid_go/doc/index.rst
to get rid of the trailing blank line there. It was probably misplaced.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Newer SoCs like SAME54 provide dedicated registers to store
the USB trim configuration.
Use those registers if they are defined in ASF to access the
calibration data.
Signed-off-by: Benjamin Valentin <benpicco@googlemail.com>
On newer sam0 SoCs peripherals are enabled through the MCLK
instead of the PM register.
Use the MCLK register if it's availiable.
Signed-off-by: Benjamin Valentin <benpicco@googlemail.com>
Newer SoCs like SAME54 have multiple IRQs for the USB peripheral.
Automatically enable all IRQs configured in the DTS.
Signed-off-by: Benjamin Valentin <benpicco@googlemail.com>
Adds a shim layer around the mcux lpc flexcomm driver to adapt it to the
zephyr spi interface. It leverages heavily from the existing mcux dspi
shim driver.
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
The GIC-400 driver currently only supports SPIs because the (32) offset
for the INTIDs is hard-coded in the driver. At the driver level there is
no really difference between PPIs and SPIs so we can easily extend the
driver to support PPIs as well.
This is useful if we want to add support for the ARM Generic Timers that
use INTIDs in the PPI range.
SPI interrupts are in the range [0-987]. PPI interrupts are in the range
[0-15].
This commit adds interrupt 'type' cell to the GIC device tree binding
and changes the 'irq' cell to use interrupt type-specific index, rather
than a linear IRQ number.
The 'type'+'irq (index)' combo is automatically fixed up into a linear
IRQ number by the scripts/dts/gen_defines.py script.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
Same deal as in commit 677f1e6 ("config: Turn pointless/confusing
'menuconfig's into 'config's"), for a newly introduced symbol.
Also clean up a header to be consistent with recent cleanups.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
The implementation did not account for the incrementing the reference
count past the maximum positive value. Doing so on a signed integer
results in undefined behavior. Switch to an unsigned integer where
such an increment results in a zero count, and add an assert that this
has not happened.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
When items were removed from the list there was not lock which may
lead to race condition and list corruption. Extracted list handling
into external function.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
If clock started immediately after requesting then request was
not yet placed in the list and user callback was not called.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Some of defines are present in several header files.
Those defines are the same with value but with different naming.
Common defines are brought to usb_common.h
Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
Upper layers like OpenThread expect the radio driver to forward ACK
frame received by the radio.
Simulate this behavior on kw41z by recreating the ACK frame from the
available data.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
nRF5 driver did not utilize `ieee802154_radio_handle_ack` API, therefore
did not provide ACK frames to the upper layer. This commit fixes this
problem.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Add support for the built-in Programmable Interrupt Controller
found in the SweRV EH1 RISC-V CPU
Signed-off-by: Olof Kindgren <olof.kindgren@gmail.com>
Extended flash simulator for posix architecture to read/write data
from a binary file on the host file system.
Further enable the flash simulator by default on native_posix(_64)
boards and updated the documentation accordingly.
Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
The counter driver tests have been updated so the driver needs
to be updated too.
() Test expects a free running counter.
() Test expects any alarms cannot be set beyond the top value.
() Also, the counter only triggers interrupts when counter reaches
zero (as configured as counting down), it can be do relative
alarms. So return -ENOTSUP when absolute alarms are requested.
() The test expects the callback to be removed once alarm is
triggered. Implement this too.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The DMA driver of stm32 used to use `stm32_dma_enable_fifo()`,
which is located in dma_stm32_v1.c to set DMDIS bit, enable
interrupt generation and set FIFO threshold. Now since FIFO
threshold is initialized with `stm32_dma_get_fifo_threshold()`
and interrupt generation is also configured in dma_stm32.c, this
function will only have one job, to configure FIFO mode.
We can add FIFO mode operation in dma_stm32.c directly and
remove it from dma_stm32_v1.c.
Signed-off-by: Song Qiang <songqiang1304521@gmail.com>
When using the EWIF it is a good idea to clear it before enabling the
watchdog. Otherwise, the watchdog callback will be called upon watchdog
enable if EWIF is enabled. This patch fixes this case.
Signed-off-by: Ioannis Konstantelias <ikonstadel@gmail.com>
Bool symbols implicitly default to 'n'.
A 'default n' can make sense e.g. in a Kconfig.defconfig file, if you
want to override a 'default y' on the base definition of the symbol. It
isn't used like that on any of these symbols though.
Also replace some
config
prompt "foo"
bool/int
with the more common shorthand
config
bool/int "foo"
See the 'Style recommendations and shorthands' section in
https://docs.zephyrproject.org/latest/guides/kconfig/index.html.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
After switching to nrfx 2.0.0, the Kconfig choice options that allowed
enabling of pull-up or pull-down for MISO lines in SPIs and SPIMs are
not properly supported, they are simply ignored. This commit restores
the possibility of applying pull configuration for MISO lines.
In earlier nrfx versions, the MISO pull configuration could be only
set globally, in nrfx_config files, for all SPI and SPIM instances
together. Since nrfx 2.0.0, this configuration can be applied per
instance. This commit takes advantage of this possibility and instead
of using a common Kconfig option as a global setting for all instances,
allows applying individual instance settings via devicetree.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
Previously, if a control transfer had data, it would be unhandled and
left in the usbip socket to be interpreted as the next usbip packet,
leading to explosions.
Signed-off-by: Josh Gao <josh@jmgao.dev>
This is a follow-up to commit 84f8235005.
Default initialization to 0 of the .dcx_pin field in the extended part
of the SPIM configuration is incorrect, because this means that pin 0
should be used as the D/CX line. For the SPIM instance that provides
the extended functionality, this results in undesired assignment of
the pin 0, and for the other SPIM instances, this causes that their
initialization fails with the NRFX_ERROR_NOT_SUPPORTED code.
This commit sets this field to NRFX_SPIM_PIN_NOT_USED, to indicate that
the D/CX line is not supposed to be used.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
By default all events are processed through bt_recv, which results
in lost events and subsys/bluetooth/hci_core.c:hci_event function
assertions fail to pass
Signed-off-by: ZhongYao Luo <LuoZhongYao@gmail.com>
According to the context information, the processing of
net_buf_add_u8 within the get_evt_buf function is
redundant and incorrect.
Signed-off-by: ZhongYao Luo <LuoZhongYao@gmail.com>
Commit 5a9a33b0cf changes interrupt
destination in an attempt to broadcast interrupts. However, this
change causes interrupts to stop working on the UP Squared board
in non-SMP configuration. According to QEMU source code,
physical destination address 0xFF000000 is a special case where
it broadcasts the interrupts. However, none of the IOAPIC
documentation (that I can find) describes this behavior. So,
revert that commit.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Seems to be fine to temporarly cast to int there as frequencies are in
Mhz and not Ghz.
Fixes#20497
Coverity CID: 205638
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Fill the `rx_delay` field in the SPIM configuration structure only when
the RXDELAY feature is present in a given SPIM instance, to prevent
compilation errors when some other SPIM instance is enabled together
with SPIM3.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
When setting a timeout measure the number of accumulated unannounced
ticks. If this value exceeds half the 24-bit cycle counter range
force an announcement so the unannounced cycles are incorporated into
the system tick counter.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
When both buffer and max data to read are zero return
the available data in buffer.
Fixes#20838
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
When using the RC clock source a periodic calibration is invoked that
involves reading from the die temperature sensor. The code did not
protect against execution order that caused the periodic calibration
to be invoked before the temperature sensor was initialized.
Update the temperature sensor to detect that it has not been
initialized and so should reject attempts to fetch a reading.
Update the calibration code to do nothing when temperature reading
fails.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
z_vrfy_flash_get_page_count defined as a function prototype in place of
a real function due to a stray semicolon.
Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
Coverity discovered that a logical AND was used in place of
a bit-wise AND. So fix it.
Fixes#20489
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Fixed handling of HCI events in the HCI driver over RPMsg. Now,
the driver makes use of discardable buffer pool when allocating
memory for certain HCI event types (e.g. Advertising Report Event).
Applications that are flooded with Advertising Reports will run
much better after this change (e.g. Mesh applications).
Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
Fix an issue discovered by Coverity where there is a potential
out of bound access on the divisor arrays.
Fixes#20495Fixes#20496
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Some early tickless drivers had a common pattern where they would
compute a tick maximum for the request (i.e. the maximum the hardware
counter can handle) but apply it only on the input tick value and not
on the adjusted final value, opening up the overflow condition it was
supposed to have prevented.
Fixes#20939 (Strictly it fixes the specific pattern that was
discovered in that bug. It's not impossible that other drivers with
alternative implementations have a similar issue, though they look OK
to me via a quick audit).
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
event_index must be lower than NRFX_IPC_ID_MAX_VALUE.
As of now, maximum index is 16.
Fixes#20962, #20964, #20967
Signed-off-by: Marcin Szymczyk <marcin.szymczyk@nordicsemi.no>
Similar to what we do in other timer drivers, the maximum ticks
supplied in z_clock_set_timeout(..) needs to be MAX_TICKS at
maximum, when K_FOREVER is supplied as argument to the function.
In addition to that, the value we load onto the SysTick LOAD
register shall be truncated to MAX_CYCLES. This is required
to prevent loading a trash value to LOAD register, as only
the lowest 24 bits may be safely written.
Finally, we move the enforcement of the minimum delay to be
programmed on LOAD (i.e. MIN_DELAY) at the end step of the
calculation of the cycles-to-be-programmed. This prevents
from misscalculating the delay, as any required adjustment
is applied at the end, after the delay is rounded up to
the next tick boundary.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
When setting a timeout measure the number of accumulated unannounced
ticks. If this value exceeds half the 32-bit cycle counter range
force an announcement so the unannounced cycles are incorporated into
the system tick counter.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
The commit fixes the update of the absolute counter of HW cycles
in the SysTick ISR for TICKLESS mode.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
The previous solution depended on a magic number and was inefficient
(entered the second-wrap conditional even when a second wrap hadn't
been observed). Replace with an algorithm that is deterministic.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Add detailed documentation for the internal 'elapsed()'
function, as well as for the local counter variables used
in the SysTick driver.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
Unsupported bits of the Current Value Register
are read as zero, so we remove the redundant
ANDing with the max supported counter value.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
The original code assumed that limiting the tick count to the maximum
cycle value representable without wrapping would guarantee that adding
the resulting cycle offset to last_count would not lap the counter.
This is not true when elapsed time, which is also added to the cycle
offset, exceeds one tick. Cap the maximum offset at the number of
cycles corresponding to the maximum number of ticks without wrapping.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Add clearing error event to UART and UARTE drivers.
Without it driver goes into infinite interrupt loop.
Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
So fare all nRF flash memories had flash base address at 0.
nRF flash driver was implemented in such way that it
really used absolute addresses, while convention are relative
addresses (for flash_map as well), which was not visible as start
address offset was 0.
It will become visible on nRF53 which has networking flash
with non-zero base address.
This patch switch nRF flash driver to use relative addresses for flash.
UICR absolute addressing is kept.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Add the possibility to compile out the PS/2 driver if
the application is not using the KBC 8042 peripheral. This
helps to remove warnings for unused PS/2 isr function
Signed-off-by: Francisco Munoz <francisco.munoz.ruiz@intel.com>
Initial implementation of the keyboard controller peripheral
in the eSPI driver. This allows to communicate ps2 and kscan
data between EC and Host
Signed-off-by: Francisco Munoz <francisco.munoz.ruiz@intel.com>