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>
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>
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>
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>
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>
By adding new SoC to Zephyr drivers has to be updated.
Commit affects:
- USB driver
- support for nRF52833 added.
- support for USB_DEVICE_REMOTE_WAKEUP in hid-mouse added.
- SPI
- IEEE 802.15.4
- CLOCK CONTROL
Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
Update calls to nrfx HAL functions to reflect API changes introduced in
nrfx 2.0.0. All these functions are now called with the first parameter
pointing to the structure of registers of the relevant peripheral.
Also a few functions got renamed:
- nrf_gpiote_int_is_enabled to nrf_gpiote_int_enable_check
- nrf_gpiote_event_is_set to nrf_gpiote_event_check
- nrf_rng_event_get to nrf_rng_event_check
- nrf_rng_int_get to nrf_rng_int_enable_check
- nrf_rtc_event_pending to nrf_rtc_event_check
- nrf_rtc_int_is_enabled to nrf_rtc_int_enable_check
- nrf_timer_cc_read to nrf_timer_cc_get
- nrf_timer_cc_write to nrf_timer_cc_set
Default configuration values were removed from nrfx_config files,
so the drivers pwm_nrfx and spi_nrfx_spis no longer can use those.
Function nrfx_pwm_init() now takes one more parameter - context pointer
that is passed to the event handler, not used in the pwm_nrfx driver.
HALs for UART and UARTE now allow configuration of the parity type
and the number of stop bits, for SoCs that provide the corresponding
registers.
Signed-off-by: Karol Lasończyk <karol.lasonczyk@nordicsemi.no>
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
Use this short header style in all Kconfig files:
# <description>
# <copyright>
# <license>
...
Also change all <description>s from
# Kconfig[.extension] - Foo-related options
to just
# Foo-related options
It's clear enough that it's about Kconfig.
The <description> cleanup was done with this command, along with some
manual cleanup (big letter at the start, etc.)
git ls-files '*Kconfig*' | \
xargs sed -i -E '1 s/#\s*Kconfig[\w.-]*\s*-\s*/# /'
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Re-run with updated script to convert integer literal delay arguments to
k_sleep to use the standard timeout macros.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Use the int_literal_to_timeout Coccinelle script to convert literal
integer arguments for kernel API timeout parameters to the standard
timeout value representations.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
'enable-pin-remap' is defined as 'type: boolean' in
dts/bindings/usb/st,stm32-usb.yaml, so it generates either
#define DT_USB_ENABLE_PIN_REMAP 1
or
#define DT_USB_ENABLE_PIN_REMAP 0
depending on if 'enable-pin-remap;' appears on the node or not.
Since a macro is always generated, #ifdef won't work. The test needs to
be this instead:
#if DT_USB_ENABLE_PIN_REMAP == 1
(Should be careful with '#if HMZ == 0' though, because it's true even if
HMZ is undefined.)
This behavior was inherited from the old scripts, and some things depend
on it, e.g. by expanding macros in initializers.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
This board and SoC was discontinued some time ago and is currently not
maintained in the zephyr tree.
Remove all associated configurations and variants from the tree.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This patch introduces a dedicated work queue for handling the events
from ISR (i.e. for notifying the USB device stack, for executing the
enpoints callbacks, etc.). The system work queue cannot be used for
this purpose as it might be used in applications for scheduling USB
transfers and this could lead to a deadlock when the USB device stack
would not be notified about certain event because of a system work
queue item waiting for a USB transfer to be finished.
The FIFO named so far `work_queue` is renamed to `usbd_evt_fifo`
to better indicate its purpose and to avoid confusion.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
This patch populates "clocks" property in stm32 usb nodes
for clock related usb configuration code of each dtsi files
Signed-off-by: Francois Ramu <francois.ramu@st.com>
Cleanup around USB_NRFX_EVT_QUEUE_SIZE option.
Add value range for USB_NRFX_EVT_QUEUE_SIZE to Kconfig.
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
Use REQTYPE_GET_DIR and REQTYPE_GET_TYPE macros from
USB subsystem instead of specially introduced.
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
Check the device state before nrfx_usbd_disable and
nrfx_usbd_uninit. Otherwise it may lead to an ASSERT
inside the HAL driver.
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
Do not use NRF_USBD_EP_NR_GET in ep_is_valid because
it masks the higher nibble. Although this behavior is valid
to get an index from an endpoint, it is not suitable to check
if the address is incorrect, such as: 0x11.
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
Low speed isn't supported in device mode for any of the STM32
references.
Remove the code that refer to it.
Fixes#17114
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
move misc/util.h to sys/util.h and
create a shim for backward-compatibility.
No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.
Related to #16539
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
move misc/byteorder.h to sys/byteorder.h and
create a shim for backward-compatibility.
No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.
Related to #16539
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
move gpio.h to drivers/gpio.h and
create a shim for backward-compatibility.
No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.
Related to #16539
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
move clock_control.h to drivers/clock_control.h and
create a shim for backward-compatibility.
No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.
Related to #16539
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The shim didn't check if a given endpoint was enabled before requesting
the nrfx_usbd driver to perform a read or write operation on it.
In certain circumstances this led to nrfx_usbd driver being stuck in
a loop waiting for the associated DMA transfer to complete.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
This reverts commit 03ef375f5f.
The cfg.en flag contains only the state of the endpoint as seen by the
shim. It is mainly used to enable the endpoints when the USB peripheral
becomes ready for operation (and the USB stack may want to enable some
endpoints earlier, especially the control ones, so the operation must
be sometimes deferred). In particular, setting this flag to false has
no effect on the actual state of the endpoint in the hardware.
Moreover, this flag was set to false for all the endpoints, including
the control ones which should not be disabled, so such operation
actually fooled the shim.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
This patch removes the "hard" selection of the USB_DEVICE_REMOTE_WAKEUP
Kconfig option for USB devices made on the nRF52840 SoC. Now it's up to
the application to decide if it wants to enable the option. This change
makes it possible to pass the USB3CV Chapter 9 Tests for applications
that don't use the remote wakeup feature, since when a USB device only
reports that it supports this feature, and the mentioned option makes
it to do so, one of the test cases expects the USB device to actually
perform the remote wakeup. And when the feature is not reported as
supported, the test case is skipped.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
The defines should have had a _0 on them, now that we generate the
proper defines, fixup the cases that used that old scheme.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>