summaryrefslogtreecommitdiff
path: root/extra/usb_serial
Commit message (Collapse)AuthorAgeFilesLines
* ish: Trim down the release branchstabilize-wristpin-14469.59.B-ishstabilize-voshyr-14637.B-ishstabilize-quickfix-14695.187.B-ishstabilize-quickfix-14695.124.B-ishstabilize-quickfix-14526.91.B-ishstabilize-14695.85.B-ishstabilize-14695.107.B-ishstabilize-14682.B-ishstabilize-14633.B-ishstabilize-14616.B-ishstabilize-14589.B-ishstabilize-14588.98.B-ishstabilize-14588.14.B-ishstabilize-14588.123.B-ishstabilize-14536.B-ishstabilize-14532.B-ishstabilize-14528.B-ishstabilize-14526.89.B-ishstabilize-14526.84.B-ishstabilize-14526.73.B-ishstabilize-14526.67.B-ishstabilize-14526.57.B-ishstabilize-14498.B-ishstabilize-14496.B-ishstabilize-14477.B-ishstabilize-14469.9.B-ishstabilize-14469.8.B-ishstabilize-14469.58.B-ishstabilize-14469.41.B-ishstabilize-14442.B-ishstabilize-14438.B-ishstabilize-14411.B-ishstabilize-14396.B-ishstabilize-14395.B-ishstabilize-14388.62.B-ishstabilize-14388.61.B-ishstabilize-14388.52.B-ishstabilize-14385.B-ishstabilize-14345.B-ishstabilize-14336.B-ishstabilize-14333.B-ishrelease-R99-14469.B-ishrelease-R98-14388.B-ishrelease-R102-14695.B-ishrelease-R101-14588.B-ishrelease-R100-14526.B-ishfirmware-cherry-14454.B-ishfirmware-brya-14505.B-ishfirmware-brya-14505.71.B-ishfactory-kukui-14374.B-ishfactory-guybrush-14600.B-ishfactory-cherry-14455.B-ishfactory-brya-14517.B-ishJack Rosenthal2021-11-059-530/+0
| | | | | | | | | | | | | | | | | | | | | | In the interest of making long-term branch maintenance incur as little technical debt on us as possible, we should not maintain any files on the branch we are not actually using. This has the added effect of making it extremely clear when merging CLs from the main branch when changes have the possibility to affect us. The follow-on CL adds a convenience script to actually pull updates from the main branch and generate a CL for the update. BUG=b:204206272 BRANCH=ish TEST=make BOARD=arcada_ish && make BOARD=drallion_ish Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I17e4694c38219b5a0823e0a3e55a28d1348f4b18 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3262038 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* pylintrc: Copy Chromium OS platform2's configCraig Hesling2021-08-021-0/+4
| | | | | | | | | | | | | | | | | | | | This requests that cros lint (and repo upload hook) use the new Chromium OS 4 space indent policy. Since legacy python scripts still use 2 space, I added pylint ignore statements to the individual files to disable indentation checking. Note: There are still valid pylint errors in some of these legacy scripts. BRANCH=none BUG=none TEST=cros lint util/*.py Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: I439f5a87bc50f1f43a4996e574bbc0626922a88e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3064761 Reviewed-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* docs: Run mdformat on all .md filesTom Hughes2021-01-281-2/+1
| | | | | | | | | | | BRANCH=none BUG=b:178648877 TEST=view in gitiles Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I0ac5581ba7bc512234d40dbf34222422afa9c725 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2650551 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* usb_serial: Migrate console.py to python2/3 compatibleYilin Yang2020-09-261-15/+26
| | | | | | | | | | | | | | | Trace pyusb source code to make sure the correct interface, and change them properly. BUG=chromium:1031705 BRANCH=master TEST=None Signed-off-by: kerker <kerker@chromium.org> Change-Id: I185bf8a7d47f641f6554ba2d36a11d56967661b0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2422929 Reviewed-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* docs: update CCD docs locationsVadim Bendebury2020-07-101-1/+3
| | | | | | | | | | | | | BRANCH=none BUG=none TEST=verified that gitfiles points at the correct documents. Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Change-Id: I6123e74449d6dbda1645f4293dd24914ccaf0d37 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2276330 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org> Commit-Queue: Tom Hughes <tomhughes@chromium.org>
* Unify #! use in python scriptsStefan Reinauer2019-10-011-1/+1
| | | | | | | | | | | | | | | | | | Right now we have several different versions of #! in our python scripts. Unify them all and specify that we are using python2. Signed-off-by: Stefan Reinauer <reinauer@chromium.org> BUG=none BRANCH=none TEST=make buildall Change-Id: Iab33a3f5d4b827451a55542bcee8837b00da7867 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1817948 Commit-Queue: Stefan Reinauer <reinauer@chromium.org> Tested-by: Stefan Reinauer <reinauer@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* LICENSE: remove unnecessary (c) after CopyrightTom Hughes2019-06-191-1/+1
| | | | | | | | | | | | | | | | Ran the following command: git grep -l 'Copyright (c)' | \ xargs sed -i 's/Copyright (c)/Copyright/g' BRANCH=none BUG=none TEST=make buildall -j Change-Id: I6cc4a0f7e8b30d5b5f97d53c031c299f3e164ca7 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1663262 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* ec-devutils: update for pyusb-1.0.2Nick Sanders2019-05-241-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pyusb 1.0.2 changed two API calls upon which we depend: b3ee6cdfef8f find function returns an iterator. dac78933f6a6 Removed unnecessary length argument to util.get_string This CL only updates callers of these APIs (the previous CL contained some unrelated changes around kernel driver detach and closing stm32usb). Signed-off-by: Nick Sanders <nsanders@chromium.org> Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Based-on: https://chromium-review.googlesource.com/1125354 BRANCH=None BUG=chromium:958677 TEST=precq passes TEST=chromiumos-sdk tryjob buildbucketId=8915374561970847360 TEST=using servo v2 servod -b grunt => no python exceptions when starting servod TEST=using servo v4 servod -b grunt => no python exceptions when starting servod TEST=using u-Servo: servod -b grunt => no python exceptions when starting servod for i in {1..10000} ; do echo $i $(dut-control ec_uart_en spi1_buf_en ); done => No stability regression versus pyusb-1.0.0b1 TEST=servo_updater, EC console via servo Cq-Depend: chromium:1597548,chromium:1597156,chromium:1597157 Change-Id: Ic8101707838e5d19e901cf1f7125b97b5102f089 Reviewed-on: https://chromium-review.googlesource.com/1597156 Commit-Ready: Daniel Kurtz <djkurtz@chromium.org> Tested-by: Daniel Kurtz <djkurtz@chromium.org> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Chris McDonald <cjmcdonald@chromium.org>
* console.py: Handle non-TTY input (e.g. piped input), and other improvements.Matthew Blecker2019-02-081-69/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes: - Do not assume stdin input is a TTY. Only attempt to manipulate terminal settings when connected to an actual terminal. - Exit upon EOF. This is mostly relevant for non-TTY input, e.g. piped input, though this is not conditioned on TTY-ness. - For non-TTY inputs, sleep before exiting after EOF, in order to allow for for reading a response from the USB console device (e.g. from the Servo). The sleep time is configurable by -S / --notty-exit-sleep command line option, default 0.2 seconds. - Replace os.sleep(0.1) busy loop with waiting on a threading.Event. - Print a newline character upon exit so that a user's shell prompt will not be printed mid-line. BRANCH=none BUG=b:123727520 TEST=I tested handling of non-TTY input by piping Servo v4 console commands such as: $ echo version | ./console.py -d 18d1:501b $ echo reboot | ./console.py -d 18d1:501b With this change, console.py now exits on its own after sending the piped command. Previously when given piped input it would lose the first character of the input due to the attempt to change TTY settings, then it would wait indefinitely for ctrl+c or other signal, and finally it would traceback upon ctrl+c. I tested handling of TTY input in the usual manner, without redirecting stdin. That still works smootly, exits without error upon ctrl+c, and no longer causes the next shell prompt to start mid-line. Change-Id: I894a40a4409b0c422b82158f452f81943277285d Signed-off-by: Matthew Blecker <matthewb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1459139 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Nick Sanders <nsanders@chromium.org>
* Revert "ec-devutils: update pyusb to 1.0.2"Nick Sanders2018-07-261-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 7d26ae49bffcf269df82df7d0fee00e8c3341166. pyusb 1.0.2 fails under load and locks up the usb endpoint. BUG=b:111658037, chromium:865482 TEST=while RES=$(dut-control ec_uart_en spi1_buf_en ); do echo ${RES}; done CQ-DEPEND=CL:1149509 Original change's description: > ec-devutils: update pyusb to 1.0.2 > > Pyusb interface has changed yet again. Patch calls to get_string > and usb.core.find. Modify ordering of detetch kernel driver > and avoid rereferencing endpoints. > > BRANCH=None > BUG=b:110907544 > TEST=emerge ec-devutils, run powerlog, usb_console, servo_updater > > CQ-DEPEND=CL:1119632 > > Signed-off-by: Nick Sanders <nsanders@chromium.org> > > Change-Id: I33df474ce3bb57d2e11c9f384ac013b51d210843 > Reviewed-on: https://chromium-review.googlesource.com/1125354 > Commit-Ready: Nick Sanders <nsanders@chromium.org> > Tested-by: Nick Sanders <nsanders@chromium.org> > Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Bug: b:110907544 Change-Id: I04f015b4924e7fee76ab0f1734267e8e2d14faaa Reviewed-on: https://chromium-review.googlesource.com/1150963 Commit-Ready: Nick Sanders <nsanders@chromium.org> Tested-by: Nick Sanders <nsanders@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Nick Sanders <nsanders@chromium.org>
* ec-devutils: update pyusb to 1.0.2Nick Sanders2018-07-061-1/+2
| | | | | | | | | | | | | | | | | | | | Pyusb interface has changed yet again. Patch calls to get_string and usb.core.find. Modify ordering of detetch kernel driver and avoid rereferencing endpoints. BRANCH=None BUG=b:110907544 TEST=emerge ec-devutils, run powerlog, usb_console, servo_updater CQ-DEPEND=CL:1119632 Signed-off-by: Nick Sanders <nsanders@chromium.org> Change-Id: I33df474ce3bb57d2e11c9f384ac013b51d210843 Reviewed-on: https://chromium-review.googlesource.com/1125354 Commit-Ready: Nick Sanders <nsanders@chromium.org> Tested-by: Nick Sanders <nsanders@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* servo: add usb_console to chrootNick Sanders2017-11-161-3/+14
| | | | | | | | | | | | | | add usb_console, console.py to chroot install. This tool allows directly accessing the usb console of servo v4, servo micro, cr50, etc. BUG=b:69016431 BRANCH=None TEST=usb_console -d 18d1:501b Change-Id: If9d5d49cf31d785ea9a7cec0a4eeeb34abae9cd1 Signed-off-by: Nick Sanders <nsanders@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/773400
* usb_serial: add python consoleNick Sanders2016-11-081-0/+287
| | | | | | | | | | | | | | | console.py can access a Google USB serial endpoint specified by vid:pid and serial number BUG=chromium:608039 TEST=open console to send and receive text. BRANCH=None Change-Id: I735692b7031d73506be2745a2cd5225bfcefd396 Reviewed-on: https://chromium-review.googlesource.com/405030 Commit-Ready: Nick Sanders <nsanders@chromium.org> Tested-by: Nick Sanders <nsanders@chromium.org> Reviewed-by: Kevin Cheng <kevcheng@chromium.org>
* extra: usb_serial: correct doc pointerBrian Norris2016-07-151-1/+1
| | | | | | | | | | | BUG=none TEST=none BRANCH=none Change-Id: I64ac1c13fca055c6f7149744754ffe51d28383ff Signed-off-by: Brian Norris <briannorris@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/360665 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* USB Serial: Add README and update CCD docsAnton Staaf2016-06-151-0/+4
| | | | | | | | | | | | | | | | | | | | The README points the reader back to the docs directory where the CCD documentation lives. I've added information about the install script, and about how the raiden module identifies a CCD serial console. Signed-off-by: Anton Staaf <robotboy@chromium.org> BRANCH=None BUG=None TEST=make buildall -j Change-Id: I8714dffcad0b8c30f46529a8f2d670b5d432cda6 Reviewed-on: https://chromium-review.googlesource.com/352787 Commit-Ready: Anton Staaf <robotboy@chromium.org> Tested-by: Anton Staaf <robotboy@chromium.org> Reviewed-by: Anton Staaf <robotboy@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* USB Serial: Add fallback rule and scriptAnton Staaf2016-06-153-7/+114
| | | | | | | | | | | | | | | | | | | | | | This rule makes it easier to use CCD devices when the raiden module can't be installed for some reason. The rule informs the usbserial module that it should handle anything that looks like a simple serial port for any CCD compatible USB devices. The install script now detects failure when building and installing the raiden module and offers the --fallback option in that case. Signed-off-by: Anton Staaf <robotboy@chromium.org> BRANCH=None BUG=None TEST=make buildall -j Change-Id: I617bbdfb4c5cb9e9803f4088c651f84e3f72bd28 Reviewed-on: https://chromium-review.googlesource.com/351873 Commit-Ready: Anton Staaf <robotboy@chromium.org> Tested-by: Anton Staaf <robotboy@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* USB Serial: Add simple install scriptAnton Staaf2016-05-251-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The install script builds and installs the raiden module, it also copies the udev rules file into /etc/udev/rules.d and updates the module alias and dependency information. The install script will also retrigger udev to process rules for all devices that have the Google Vendor ID (0x18d1). This ensures that any devices that are connected when the install is run will immediately be available for use (as opposed to requiring that these devices be unplugged and replugged before use). Signed-off-by: Anton Staaf <robotboy@chromium.org> BRANCH=None BUG=None TEST=Remove udev rules file Remove raiden.ko module, aliases, and dependency information Reboot workstation Run ./install Plug in CCD capable device ls /dev/google Change-Id: I7bcb02f05ee84738a6259800afc4d0c69bea9e69 Reviewed-on: https://chromium-review.googlesource.com/347092 Commit-Ready: Anton Staaf <robotboy@chromium.org> Tested-by: Anton Staaf <robotboy@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* usb_serial: ignore make byproductsVadim Bendebury2016-05-241-0/+12
| | | | | | | | | | | | | | It is not trivial to direct output of this make file into a different directory, let's just add the byproducts to a local .gitignore. BRANCH=none BUG=none TEST='git status' after running make does not show any junk any more. Change-Id: Id04822102d788c6883cff36f26fd8f9d50c996aa Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/346746 Reviewed-by: Anton Staaf <robotboy@chromium.org>
* CCD: Disable ModemManager for CCD USB consolesAnton Staaf2015-05-062-14/+33
| | | | | | | | | | | | | | | | | | | | | | | | ModemManager likes to play with serial ports it shouldn't play with, mark our serial ports as off limits. This also bumps the ordering of this rules file just past the udev default rules because it uses environment variables populated by that file. Signed-off-by: Anton Staaf <robotboy@chromium.org> BRANCH=None BUG=None TEST=install new rules file, delete old rules file verify that symlinks to TTY's are still created verify that ModemManager leaves them alone now Change-Id: I4ded95192d78b5b1bbc661ca5b762e18307d2d60 Reviewed-on: https://chromium-review.googlesource.com/269743 Trybot-Ready: Anton Staaf <robotboy@chromium.org> Tested-by: Anton Staaf <robotboy@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org> Commit-Queue: Anton Staaf <robotboy@chromium.org>
* USB: Add udev rule to handle CCD devicesAnton Staaf2015-03-161-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | This udev rule creates a directory in /dev/google for each device attached. The name of the directory is unique to the device and is prefixed with the device product name. Within the directory there is a serial directory that contains symlinks to each USB serial port exposed by the device. The symlinks are named based on the USB interface name provided by the EC. Additional subdirectories can be added for I2C, JTAG, GPIOs, and SPI as needed. Signed-off-by: Anton Staaf <robotboy@chromium.org> BRANCH=None BUG=None TEST=Verify that two different CCD devices generate uniquely named entries. Change-Id: I7e6f2ace29b7302c7c072bcf6aab7c8f060b993a Reviewed-on: https://chromium-review.googlesource.com/260420 Trybot-Ready: Anton Staaf <robotboy@chromium.org> Tested-by: Anton Staaf <robotboy@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Commit-Queue: Anton Staaf <robotboy@chromium.org>
* USB-console: Add Linux USB serial kernel moduleAnton Staaf2014-10-292-0/+56
This is a simple kernel module and Makefile for building it out of tree. This module just uses the existing kernel usb serial driver and probes for the Google VID/Class/SubClass/Protocol that identifies a valid simple serial interface. This code should be rolled into the existing kernel driver at: drivers/usb/serial/usb-serial-simple.c While that happens, this module is still useful to developers. Signed-off-by: Anton Staaf <robotboy@chromium.org> BRANCH=None BUG=None TEST=cd extra/usb_serial; make; sudo insmod raiden.ko Connect the discovery-stm32f072 over USB and see that its console is discovered and works. Change-Id: I83661b816643c43b3e2dc9fdc825bc3a796af2f4 Reviewed-on: https://chromium-review.googlesource.com/225923 Reviewed-by: Olof Johansson <olofj@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Tested-by: Anton Staaf <robotboy@chromium.org> Commit-Queue: Anton Staaf <robotboy@chromium.org>