1. 01 Jun, 2020 5 commits
  2. 31 May, 2020 2 commits
  3. 30 May, 2020 11 commits
  4. 29 May, 2020 9 commits
  5. 28 May, 2020 4 commits
    • Eugen Hristev's avatar
      misc: i2c_eeprom: implement different probe test eeprom offset · b24dc83f
      Eugen Hristev authored
      Because of this commit :
      5ae84860 ("misc: i2c_eeprom: verify that the chip is functional at probe()")
      at probe time, each eeprom is tested for read at offset 0.
      The Atmel AT24MAC402 eeprom has different mapping. One i2c slave address is
      used for the lower 0x80 bytes and another i2c slave address is used for the
      upper 0x80 bytes. Because of this basically the i2c master sees 2 different
      slaves. We need the upper bytes because we read the unique MAC address from
      this EEPROM area.
      However this implies that our slave address will return error on reads
      from address 0x0 to 0x80.
      To solve this, implemented an offset field inside platform data that is by
      default 0 (as it is used now), but can be changed in the compatible table.
      The probe function will now read at this offset and use it, instead of blindly
      checking offset 0.
      This will fix the regression noticed on these EEPROMs since the commit
      abovementioned that introduces the probe failed issue.
      Signed-off-by: Eugen Hristev's avatarEugen Hristev <eugen.hristev@microchip.com>
      Reviewed-by: Heiko Schocher's avatarHeiko Schocher <hs@denx.de>
    • Heinrich Schuchardt's avatar
      i2c: observe scl_count in i2c_deblock_gpio_loop() · da585c3c
      Heinrich Schuchardt authored
      When compiling with -Wtype-limits we see this error:
      drivers/i2c/i2c-uclass.c: In function ‘i2c_deblock_gpio_loop’:
      drivers/i2c/i2c-uclass.c:517:21: error: comparison of
      unsigned expression >= 0 is always true [-Werror=type-limits]
        517 |  while (scl_count-- >= 0) {
      Don't loop forever.
      Fixes: 1f746a2c ("i2c: Make deblock delay and SCL clock configurable")
      Signed-off-by: Heinrich Schuchardt's avatarHeinrich Schuchardt <xypron.glpk@gmx.de>
    • Raul E Rangel's avatar
      i2c: designware_i2c: Check if the device is powered · f6f9a016
      Raul E Rangel authored
      If the device doesn't return a version that means the device is
      The dw_i2c_regs had invalid offsets for the version field. I got the
      correct value from the DesignWare databook. It also matches what the
      Picasso PPR says.
      Signed-off-by: default avatarRaul E Rangel <rrangel@chromium.org>
      Reviewed-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      Reviewed-by: default avatarFurquan Shaikh <furquan@chromium.org>
      Tested on chromebook_coral:
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
    • Simon Glass's avatar
      i2c: designware_i2c: Tidy up use of NULL priv · bcf08503
      Simon Glass authored
      At present we still have pre-driver-model code in this driver and it makes
      things a bit confusing. In particular calc_bus_speed() is called with priv
      as NULL if not using driver model.
      This results in spk_cnt and comp_param1 being read from an invalid address
      if not using driver model. For comp_param1 this may not cause problems if
      reading from addresses close to 0 happens to be allowed, as high speed is
      only supported by DM code. But spk_cnt is subsequently used to calculate
      the bus periods and so this may cause problems (e.g. on spear600 board
      which has not been migrated yet).
      Add a new parameter regs parameter to calc_bus_speed() and add more
      comments to this function and to _dw_i2c_set_bus_speed(), which calls it.
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      Reported-by: Heinrich Schuchardt's avatarHeinrich Schuchardt <xypron.glpk@gmx.de>
  6. 27 May, 2020 9 commits