Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[opentitantool] Convenience for external programs #25358

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Nov 22, 2024

  1. [opentitantool] Add ability to access SPI via flashrom

    Some transports/debuggers expose the SPI ports in a way that can be
    accessed by the flashrom program, without going through opentitanlib.
    
    This CL introduces a new `flashrom-args` command under `spi`:
    
    ```
    opentitantool --conf ... --usb-serial 2042355F3236 spi --bus=SPI1 flashrom-args
    {
      programmer: "raiden_debug_spi:serial=2042355F3236,target=2"
    }
    ```
    
    This can be used in cases where the flashrom program better knows how to
    communicate with e.g. the SPI flash chip mounted on the OpenTitan
    development shield, in order to quickly load some data into it as part
    of setup before testing code on the OpenTitan chip.
    
    Signed-off-by: Jes B. Klinke <[email protected]>
    
    Change-Id: I9511b449f303a5f0cd901dac19ce9654209b3fd1
    jesultra committed Nov 22, 2024
    Configuration menu
    Copy the full SHA
    5f9fc5e View commit details
    Browse the repository at this point in the history
  2. [opentitantool] Add ability to access underlying serial device

    Some transports/debuggers expose the serial ports in a way that can be
    accessed by other programs, without necessarily going through
    opentitanlib.
    
    This CL introduces a new `uart` top level command and `os-device` under
    it, (in hindsigt, `console` and `rescue` probably beloned under the same
    top-level, in order to share some flag processing.)
    
    The idea is that `opentitantool` can be queried, using a set of
    configuration file with aliases and command line usb serial number, and
    will print the path of the underlying OS device corresponding to the
    given port of the given debugger:
    
    ```
    opentitantool --conf ... --usb-serial ... uart --uart=EC os-device
    {
      path: "/dev/ttyUSB6"
    }
    ```
    
    This can be used in cases where processing of output from the OpenTitan
    chip takes place in external scripts or programs.  Such cases currently
    will have to use an `opentitantool console` process to pass data between
    the serial device and its stdin/stdout pipes to the actual script doing
    the actual processing, which is wasteful.
    
    Change-Id: Id4dfff38fbc74ec65366d3a7e49a6844ae52c8ee
    Signed-off-by: Jes B. Klinke <[email protected]>
    jesultra committed Nov 22, 2024
    Configuration menu
    Copy the full SHA
    1d12737 View commit details
    Browse the repository at this point in the history