summaryrefslogtreecommitdiff
path: root/chip/stm32/usb_hw.h
Commit message (Collapse)AuthorAgeFilesLines
* USBHC: Add USB host command interfaceDaisuke Nojiri2022-03-291-0/+7
| | | | | | | | | | | | | | This patch adds a host command interface for USB. BUG=b:211496726 BRANCH=None TEST=Prism on Vell. Change-Id: Icead7a1bdc593b3c4740ede0ddd5fc2cf5700bfa Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3354039 Reviewed-by: caveh jalali <caveh@chromium.org> Commit-Queue: caveh jalali <caveh@chromium.org>
* ec: Minor cleanup of magic number commonly used in STM32 USBBrian J. Nemec2020-06-041-0/+3
| | | | | | | | | | | | | | | | | Minor cleanup of a commonly used magic number in the STM32 USB interface. BUG=none BRANCH=none TEST=Builds Signed-off-by: Brian Nemec <bnemec@chromium.org> Change-Id: I2c0b7947810aae651e452db42ac27221ab19b99b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2224763 Tested-by: Brian Nemec <bnemec@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org> Commit-Queue: Brian Nemec <bnemec@chromium.org>
* chip/stm32/usb_hw: include stdint.h and stddef.hPatrick Georgi2018-10-191-0/+3
| | | | | | | | | | | | | | | It uses it, and its includers shouldn't need to know that. BUG=none BRANCH=none TEST=none Change-Id: Icf13d558e4d0772841a06313b352f88d40f1e165 Signed-off-by: Patrick Georgi <pgeorgi@google.com> Reviewed-on: https://chromium-review.googlesource.com/1177709 Commit-Ready: Patrick Georgi <pgeorgi@chromium.org> Tested-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-by: Jonathan Brandmeyer <jbrandmeyer@chromium.org>
* stm32: convert to CONFIG_CHIP_MEMORY_REGIONSVincent Palatin2018-03-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the former special case for USB RAM Add additional RAM regions for STM32H7. For USB RAM, add an explicit alignment directive to ensure we always meet the 8-byte boundary hardware constraint for the BTABLE. This was already true because we put the .usb_ram.btable section first. I keep this property by alpha-sorting the sections but makes it more explicit by adding a 2-digit numeric prefix: e.g. 00_firstsection, 99_lastsection. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=none BUG=b:67081508 TEST=on ZerbleBarn, along with the following CLs, run the firmware with large arrays in special AHB memory regions. TEST=build all targets with and without the patch and verify that all smap files are identical. Change-Id: I9ee7f519a13cb14ba9997220f22180028f9c0175 Reviewed-on: https://chromium-review.googlesource.com/946369 Commit-Ready: Vincent Palatin <vpalatin@chromium.org> Tested-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* chip/stm32/usb_hid_keyboard: add dynamic backlight detection supportWei-Ning Huang2017-12-121-0/+3
| | | | | | | | | | | | | | | | | | | | | | In order to make a single hammer image support both base with and without keyboard backlight. We need a way to dynamically determine if backlight is present, and send the correct HID descriptors. This is done through declaring two HID descriptors and return the correct one depending on whether or not the backlight is present. BRANCH=none BUG=b:67722756 TEST=On reworked board with pull-down on backlight pin, USB descriptor has backlight HID report descriptor, and is functional. TEST=On old board with both pull-up and pull-down (equivalent to having pull-up only, i.e. no backlight) USB descriptor does not have backlight HID report descriptor Change-Id: Ie3eac9b3d4cd749308ccfb96a7db469701f9793b Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/770600 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* stm32/usb: Patching framework for USB descriptorsNicolas Boichat2017-12-121-0/+21
| | | | | | | | | | | | | | | | | | In some cases, we want to be able to dynamically modify a few bytes in the USB descriptor (in our case, length of referenced items), but it could also be other things like flags. These 2 new functions allow to keep all the USB descriptor in flash, and modify these few bytes before writing them in the USB buffer. BRANCH=none BUG=b:37447752 TEST=Flash hammer, USB descriptors are valid. Change-Id: I8624255fa43f52a0aaa21d20e963f3974f236912 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/771057 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* chip/stm32/usb: Replace reset handler by generic event handlerNicolas Boichat2017-08-161-5/+22
| | | | | | | | | | | | | | | | | | | Some USB interface handlers need to know when USB has been successfully resumed after a wake event. For example, this is useful so that HID keyboard can send the events at the right time. BRANCH=none BUG=b:35775048 TEST=Using USB HID keyboard patches to queue keys in a FIFO: After USB autosuspends, press a single key and hold it. Without this patch the endpoint data only gets reloaded on the _next_ event. TEST=On hammer, I2C passthrough still works. Change-Id: I9b52b9de16767c8a66c702a5ae70369334a3d590 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/569547 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* chip/stm32/usb: Allow interface handler to reply with more than 64 bytesNicolas Boichat2016-11-221-0/+4
| | | | | | | | | | | | | | | | For example, when a HID descriptor is longer than 64 bytes, we need to split it in multiple packets. BRANCH=none BUG=chrome-os-partner:59083 TEST=make buildall -j TEST=make BOARD=hammer -j && util/flash_ec --board=hammer Change-Id: I25a05eabaf9413e332fe3cd70695a0d53639713d Reviewed-on: https://chromium-review.googlesource.com/409316 Commit-Ready: Nicolas Boichat <drinkcat@chromium.org> Tested-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* sweetberry: add dwc usb supportNick Sanders2016-09-011-0/+6
| | | | | | | | | | | | | | | stm32f446 uses a synopsys designware USB block rather than the typical ST one. This change adds driver support for the new block, including usb console support. BUG=chromium:608039 TEST=usb console works BRANCH=None Change-Id: I0e143758ae0b5285f1c94ea2ec5aee159e22e00c Signed-off-by: Nick Sanders <nsanders@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/365448 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* cleanup: Remove device-specific stuff from include/usb.hBill Richardson2015-05-281-0/+85
This moves the STM32-specific code out of the common header file and into the chip directory where it belongs. Note that this doesn't actually change the code for non-STM32 SoCs; that will happen in a separate CL for clarity. BUG=chrome-os-partner:40693 BRANCH=none TEST=make buildall Change-Id: Ifdf0086e86a1088fb011b9ac4d6c70ab8da47aec Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/273577 Reviewed-by: Randall Spangler <rspangler@chromium.org>