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

Hm2 bspi fixes #2288

Merged
merged 5 commits into from
Jan 18, 2023
Merged

Hm2 bspi fixes #2288

merged 5 commits into from
Jan 18, 2023

Commits on Jan 18, 2023

  1. Configuration menu
    Copy the full SHA
    662a8de View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    46ac11c View commit details
    Browse the repository at this point in the history
  3. hostmot2 bspi: add hm2_bspi_clear_fifo()

    The BSPI module has a receive fifo and a transmit fifo per instance
    (shared among all the channels of that instance).
    
    Writing anything to the fifo count register clears both fifos, discarding
    any old read data and any pending write data.
    SebKuzminsky committed Jan 18, 2023
    Configuration menu
    Copy the full SHA
    c147f05 View commit details
    Browse the repository at this point in the history
  4. mesa-7i65: fix a bug with stale data in fifo

    Writing to BSPI channels with echo enabled also simultaneously reads from
    those channels.  The read bytes go into the BSPI instance's read fifo,
    where they stay until the driver reads them out.
    
    By writing to the (echo-y) ADCs to configure them, we also put some
    bytes into the read fifo.  When we later try to read the analog and
    digital inputs, we'll actually get the old bytes from the ADC setup,
    and everything will be off by a handful of bytes, resulting in incorrect
    information being used.
    
    This commit fixes the problem by clearing the FIFO after setting up
    the ADCs.
    
    There may be another bug lurking in here - if somehow the FIFO becomes
    out of sync, we'll never recover.  A future hacker will get the pleasure
    of rediscovering this problem and fixing it.
    SebKuzminsky committed Jan 18, 2023
    Configuration menu
    Copy the full SHA
    8f25d4b View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    640a6c9 View commit details
    Browse the repository at this point in the history