1. 20 Oct, 2020 4 commits
  2. 03 Nov, 2017 1 commit
    • Julius Werner's avatar
      vboot: Update block devices from VbExKeyboardRead() to fix SD detection · 0c084919
      Julius Werner authored
      The problem with SD cards is that you need to keep track of removals and
      reinsertions so that you know when you have to fully reinitialize it. In
      depthcharge, we do that by maintaining a 'present' member in the MMC
      controller object. On every update() call to the controller, we check if
      the previously known 'present' state still matches the current
      card_detect pin value, and if it doesn't we handle the respective
      insertion or removal.
      This works fine in recovery mode: vboot keeps checking for new media
      automatically every second, so we regularly call update() on all our
      removable block device controllers. But in dev mode, vboot only asks us
      to do that when it reads an explicit Ctrl+U from the user. This creates
      a problem when the user inserts an SD card with an invalid image,
      presses Ctrl+U (vboot sees that the image is invalid and beeps),
      replaces the SD card with a different one and presses Ctrl+U again. We
      only call update() twice on the block device controller in this case,
      and in both cases there is a card present. The driver has no chance to
      notice that it is no longer the same card and has to be reinitialized.
      It's hard to solve this in a good way: we could make it the
      responsibility of the individual MMC controller driver to track this
      (through some sort of controller-internal hardware latch), but it's
      unclear whether all controllers could support that, and it would have to
      be fixed in every single controller driver individually. We could also
      change the vboot API to add an explicit polling function that tells
      depthcharge to update this state, but that seems overkill at a time
      where we're thinking about moving away from depthcharge at some point
      anyway (towards a solution that probably wouldn't have this problem).
      This patch implements the quick and dirty fix of updating removable
      block device controllers in the only continuously polled vboot callback
      we have in dev mode, which is VbExKeyboardRead(). It's not exactly a
      clean solution from a design standpoint, but it'll work. USB storage
      devices essentially get the same treatment already because libpayload
      unconditionally calls usb_poll() as part of havechar()... so it's not
      really any worse than what we already have, just in a different place.
      TEST=Boot an Elm, plug in a uSD card without a good image, press Ctrl+U,
      replace SD card with one that has a good image, press Ctrl+U again,
      watch it boot.
      Change-Id: I729a37028140f354478422078804e750079a4c23
      Signed-off-by: default avatarJulius Werner <jwerner@chromium.org>
      Reviewed-on: https://chromium-review.googlesource.com/750321
      Reviewed-by: default avatarAaron Durbin <adurbin@chromium.org>
      Reviewed-by: default avatarFurquan Shaikh <furquan@chromium.org>
      (cherry picked from commit 6b4baa85)
      Reviewed-on: https://chromium-review.googlesource.com/753861
      Commit-Queue: Aaron Durbin <adurbin@chromium.org>
      Tested-by: default avatarAaron Durbin <adurbin@chromium.org>
  3. 20 Oct, 2017 2 commits
  4. 16 Oct, 2017 1 commit
  5. 13 Oct, 2017 1 commit
  6. 10 Oct, 2017 1 commit
  7. 29 Sep, 2017 1 commit
  8. 26 Sep, 2017 1 commit
  9. 25 Sep, 2017 1 commit
  10. 22 Sep, 2017 1 commit
  11. 21 Sep, 2017 2 commits
  12. 13 Sep, 2017 1 commit
  13. 09 Sep, 2017 4 commits
  14. 08 Sep, 2017 1 commit
  15. 07 Sep, 2017 4 commits
  16. 29 Aug, 2017 1 commit
  17. 25 Aug, 2017 1 commit
  18. 22 Aug, 2017 2 commits
  19. 19 Aug, 2017 2 commits
  20. 18 Aug, 2017 2 commits
    • Caveh Jalali's avatar
      TCPC: use EC_CMD_PD_CHIP_INFO for TCPC info · e45c8083
      Caveh Jalali authored
      we have a dedicated EC command to get the TCPC version info - no need
      to directly scrape the regs.  this can also be used to force the EC to
      refresh its view (cache) of the TCPC version after a firmware update,
      so this is a good thing all around.
      i'm also removing dependencies on PD_SUSPEND and EC I2C tunneling in
      the *_check_hash() flow so this can work even when we have
      addresses the case where the AP does a soft reboot without affecting
      the EC.
      TEST=verified TCPC firmware update works as before.
      Change-Id: Ia64c93bfda50dd5a651836224b9fb9f6ce1db57c
      Signed-off-by: default avatarCaveh Jalali <caveh@google.com>
      Reviewed-on: https://chromium-review.googlesource.com/615089
      Reviewed-by: default avatarJulius Werner <jwerner@chromium.org>
    • Daisuke Nojiri's avatar
      crosEC: Do not add padding when writing to flash · 42f2d0c4
      Daisuke Nojiri authored
      When Depthcharge writes to flash through EC, it adds padding to make
      the data size equal to write_block_size of the SPI flash. Though this
      might be necessary for a certain board (Pit as described in CL:62895),
      this fails if we're writing to the end of the SPI flash because EC
      checks whether (offset + size) exceeds the flash size or not
      I think we should play this trick (padding to write block size) on the
      EC side. That is, if EC receives a short packet, it should add padding
      by itself if it's required.
      Pit has been removed from the crosEC tree. If this patch breaks another
      board, we'll fix it differently (as suggested above).
      TEST=Let Depthcharge on Fizz write a RW image to the slot B, which is
      located at the end.
      Change-Id: I2f51917976189ea01de8c5787f6329f0a45c7f74
      Signed-off-by: default avatarDaisuke Nojiri <dnojiri@chromium.org>
      Reviewed-on: https://chromium-review.googlesource.com/618164
      Reviewed-by: default avatarAaron Durbin <adurbin@chromium.org>
      Reviewed-by: default avatarRandall Spangler <rspangler@chromium.org>
  21. 17 Aug, 2017 1 commit
  22. 16 Aug, 2017 1 commit
  23. 15 Aug, 2017 2 commits
    • Caveh Jalali's avatar
      anx3429: FW update driver. · 8d3cfc6d
      Caveh Jalali authored
      this driver adds the capability to update the firmware of the anx3429
      TCPC.  the driver will be registered with vboot to be invoked during
      software sync, much like the ps8751 TCPC update driver.
      TEST=in conjunction with follow-on CLs, verified we can update the
      	OTP.  for now, only tested with a test pattern being
      	programmed into an unused area of the OTP ROM.
      Change-Id: I518aa4f9408bcaf624278685015d91395fad43f6
      Signed-off-by: default avatarCaveh Jalali <caveh@google.com>
      Reviewed-on: https://chromium-review.googlesource.com/592641
    • Shelley Chen's avatar
      detachables: Disable "Enable Developer Mode" entry in Recovery Menu · 7a72ea10
      Shelley Chen authored
      Remove "Enable Developer Mode" entry in Recovery Menu when board is
      already in developer mode.  Having the entry present was confusing
      users trying to enable dev mode when machine already in dev mode and
      seeing nothing happen.  Changing VbExDisplayMenu API so that a
      disabled_idx_mask is passed down to allow for the general
      disabling/enabling of menu items.
      BUG=b:63078243, b:35585623
      TEST=reboot into recovery with DUT already in dev mode.  Make sure
           Enable Developer Mode entry is not displayed.
           reboot into recovery with DUT in normal mode.  Make sure
           Enable Developer Mode entry is displayed and can be selected.
      Change-Id: I70f07acd740169e077d19148f70e66f9c78bd520
      Signed-off-by: default avatarShelley Chen <shchen@chromium.org>
      Reviewed-on: https://chromium-review.googlesource.com/565335
      Reviewed-by: default avatarJulius Werner <jwerner@chromium.org>
  24. 09 Aug, 2017 2 commits