usb_dc_mcux_ehci driver is one shim of the NXP SDK ehci driver.
select NOCACHE_MEMORY if HAS_MCUX_CACHE
Signed-off-by: Mark Wang <yichang.wang@nxp.com>
Return -EAGAIN on k_sem_take() failure to take write lock, the error
code is similar to nrfx write_in_progress flag.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
This implements three API functions that are required for
tests/subsys/usb/device to build:
- usb_dc_ep_disable()
- usb_dc_ep_halt()
- usb_dc_ep_flush()
While halt and disable are trivial, flush is just a stub for now.
Signed-off-by: Benjamin Valentin <benpicco@googlemail.com>
Make sure the parameters for the API functions are valid, return error
otherwise.
This is expected by the tests/subsys/usb/device test case.
Signed-off-by: Benjamin Valentin <benpicco@googlemail.com>
Make sure that when e.g. CONFIG_SERIAL is set, CONFIG_UART_SAM0 is
selected automatically when the sam0 SoC family is used.
Signed-off-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
I does make sense to use index only after we make sure it is valid,
issue is found in harness tests.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
If the user attempts to send data before the USB connection is
established (see the HID sample for an example of such code), the
DataInCallback never gets called which leaves the write semaphore in a
taken state forever.
Signed-off-by: Josef Gajdusek <atx@atx.name>
The SYSCFG_CFGR1_PA11_PA12_RMP define is present even on packages where
the remap isn't strictly required. This commit makes the remap optional
based on a DT property.
Also fixes syntax error caused by a missing );.
Signed-off-by: Josef Gajdusek <atx@atx.name>
HFCLK may be requested for multiple modules, i.e. Bluetooth stack.
When any other module has requested HFCLK to run, the driver will
return -EBUSY on free attempt which is not an error - thie means
that free request has been processed, but someone else is still
requiring the clock to run. When all clock users free the clock,
it may be disabled.
Related issue: #15145
Signed-off-by: Paweł Zadrożniak <pawel.zadrozniak@nordicsemi.no>
Check maximum packet size (MPS) of an endpoint in usb_dc_kinetis
and usb_dc_native_posix drivers.
resolves#14957resolves#14954
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
Update the files which contain no license information with the
'Apache-2.0' SPDX license identifier. Many source files in the tree are
missing licensing information, which makes it harder for compliance
tools to determine the correct license.
By default all files without license information are under the default
license of Zephyr, which is Apache version 2.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Fix build error when executing sanitycheck on stm32 devices.
Command to execute tests:
sanitycheck --device-testing --device-serial /dev/ttyACM0 -p <board>
-t usb
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Rename reserved function names in drivers/ subdirectory. Update
function macros concatenatenating function names with '##'. As
there is a conflict between the existing gpio_sch_manage_callback()
and _gpio_sch_manage_callback() names, leave the latter unmodified.
Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
Fixes bug introduced in #14875.
USBDETECTED event is be generated on cable attachment and
when cable is already attached during reset, but not when
the peripheral is re-initialized. When USB-enabled bootloader
is used, target application will not receive this event
and it needs to be generated again. This commit implements
a check against driver being enabled multiple times in case
of application without bootlader starting with cable attached
(both "fake" and "real" events are generated). Such dirty
trick allows bootloader to leave the peripheral in any state
before jumping to target application.
Fixes#15073
Signed-off-by: Paweł Zadrożniak <pawel.zadrozniak@nordicsemi.no>
We want to enable USB DC at not only VBUS detection event
but also it has been already high.
Signed-off-by: Takumi Ando <takumi.ando@atmark-techno.com>
Initialize a local struct variable to zero, to suppress
un-initialized variable error.
Fixes#14422.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
When we build with clang we can a warning related to mixing of enum
types. Just use nrfx_usbd_ep_status_t since that is the type returned
by nrfx_usbd_ep_status_get.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
When user disconnects the USB cable, peripheral should be
immediately disabled, howewer a delay may occur when driver
events are processed from a workqueue or higher-priority
thread/ISR is active. This may lead to a fake resume/reset
event (peripheral-specific behavior). This fix drops such
events when cable is detached.
Fixes#13822
Signed-off-by: Paweł Zadrożniak <pawel.zadrozniak@nordicsemi.no>
There are issues using lowercase min and max macros when compiling a C++
application with a third-party toolchain such as GNU ARM Embedded when
using some STL headers i.e. <chrono>.
This is because there are actual C++ functions called min and max
defined in some of the STL headers and these macros interfere with them.
By changing the macros to UPPERCASE, which is consistent with almost all
other pre-processor macros this naming conflict is avoided.
All files that use these macros have been updated.
Signed-off-by: Carlos Stuart <carlosstuart1970@gmail.com>
DT_USB_NUM_BIDIR_ENDPOINTS includes EP0, which we should not
take it into account when we check endpoint capabilities
Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
This commit fixes the issue with excess current being drawn
during sleep due to active HFCLK with external crystal.
Clock-related operations were moved to cable attachmend and
detachment handlers to ensure that HFCLK is not requested
when it's not needed.
Signed-off-by: Paweł Zadrożniak <pawel.zadrozniak@nordicsemi.no>
Clock ISR would callback into the USB driver before it was initialized
and ready to deal with events. This caused a fault.
Statically initialize the fifo to queue events and process them when the
USB device is initialized to avoid the problem.
Signed-off-by: Tom Burdick <thomas.burdick@gmail.com>
Add native_posix USB virtual driver connected over USBIP to the Host
Linux.
Fixes: #9846
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Convert usb_dc_stm32 driver GPIO disconnect to use new defines so we
can remove the dts_fixup.h code for it.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
1. Fix trailing comment for DT_USBHS_MAXIMUM_SPEED
2. Fix missed CONFIG_USB_HS_BASE_ADDRES that should be
DT_USB_HS_BASE_ADDRESS
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>