Skip to content
Snippets Groups Projects
  1. Oct 25, 2019
    • Marek Vasut's avatar
      mmc: Align MMC_TRACE with tiny printf · 09e10c52
      Marek Vasut authored
      
      The tiny printf implementation only supports %x format specifier,
      it does not support %X . Since it makes little difference whether
      the debug output prints hex numbers in capitals or not, change it
      to %x and make the MMC_TRACE output work with tiny printf too.
      
      Signed-off-by: default avatarMarek Vasut <marex@denx.de>
      Cc: Jaehoon Chung <jh80.chung@samsung.com>
      Cc: Simon Glass <sjg@chromium.org>
      09e10c52
    • Andre Przywara's avatar
      mmc: bring back partition init for non-DM MMC drivers · d13897d1
      Andre Przywara authored
      
      Commit d0851c893706 ("blk: Call part_init() in the post_probe() method")
      removed the call to part_init() in mmc.c, as this is done by the DM_MMC
      framework.
      However Allwinner is (still) relying on a non-DM MMC driver, so we are
      now missing the implicit partition init, leading to failing MMC accesses
      due to the missing partition information.
      
      Bring the call back just for non-DM MMC driver to fix this regression.
      
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      Reviewed-by: default avatarSimon Glass <sjg@chromium.org>
      Tested-by: default avatarSoeren Moch <smoch@web.de>
      d13897d1
    • Bin Meng's avatar
      blk: Call part_init() in the post_probe() method · 3d37e7cb
      Bin Meng authored
      
      part_init() is currently called in every DM BLK driver, either
      in its bind() or probe() method. However we can use the BLK
      uclass driver's post_probe() method to do it automatically.
      
      Update all DM BLK drivers to adopt this change.
      
      Signed-off-by: default avatarBin Meng <bmeng.cn@gmail.com>
      Reviewed-by: default avatarSimon Glass <sjg@chromium.org>
      3d37e7cb
    • Peng Fan's avatar
      mmc: add HS400 support · 8cb59630
      Peng Fan authored
      
      Add HS400 support.
      Selecting HS400 needs first select HS200 according to spec, so use
      a dedicated function for HS400.
      Add HS400 related macros.
      Remove the restriction of only using the low 6 bits of
      EXT_CSD_CARD_TYPE, using all the 8 bits.
      
      Signed-off-by: default avatarPeng Fan <peng.fan@nxp.com>
      Cc: Jaehoon Chung <jh80.chung@samsung.com>
      Cc: Jean-Jacques Hiblot <jjhiblot@ti.com>
      Cc: Stefano Babic <sbabic@denx.de>
      Cc: Kishon Vijay Abraham I <kishon@ti.com>
      Cc: Faiz Abbas <faiz_abbas@ti.com>
      Cc: Marek Vasut <marex@denx.de>
      Signed-off-by: default avatarPeng Fan <peng.fan@nxp.com>
      Signed-off-by: default avatarTroy Kisky <troy.kisky@boundarydevices.com>
      8cb59630
    • Jon Nettleton's avatar
      mmc: break out get_op_cond code to its own function · 9db28909
      Jon Nettleton authored
      
      This code is useful for testing the existance of devices that
      do not have card detect capabilities.  This breaks out the core
      functionality and leaves the actual init logic and error reporting
      in mmc_start_init().
      
      Signed-off-by: default avatarJon Nettleton <jon@solid-run.com>
      Signed-off-by: default avatarBaruch Siach <baruch@tkos.co.il>
      Reviewed-by: default avatarStefano Babic <sbabic@denx.de>
      9db28909
    • BOUGH CHEN's avatar
      mmc: correct the HS400 initialization process · a72e8c89
      BOUGH CHEN authored
      
      After the commit b9a2a0e2e9c0 ("mmc: Add support for downgrading
      HS200/HS400 to HS mode"), it add a parameter in mmc_set_card_speed()
      which indicates that the HS200/HS400 to HS downgrade is happening.
      
      During the HS400 initialization, first select to HS200, and config
      the related clock rate, then downgrade to HS mode. So here also need
      to config the downgrade value to be true for two reasons. First,
      make sure in the function mmc_set_card_speed(), after switch to HS
      mode, first config the clock rate, then read the EXT_CSD, avoid
      receiving data of EXT_CSD in HS mode at 200MHz. Second, after issue
      the MMC_CMD_SWITCH command, it need to wait a bit then switch bus
      properties.
      
      Test on i.MX8QM MEK board, some Micron eMMC will stuck in transfer
      mode in this case, and USDHC will never get data transfer complete
      status, cause the uboot hang.
      
      Signed-off-by: default avatarHaibo Chen <haibo.chen@nxp.com>
      Acked-by: default avatarMarek Vasut <marek.vasut@gmail.com>
      a72e8c89
    • Marek Vasut's avatar
      mmc: Downgrade SD/MMC from UHS/HS200/HS400 modes before boot · 632ac017
      Marek Vasut authored
      
      Older kernel versions or systems which do not connect eMMC reset line
      properly may not be able to handle situations where either the eMMC
      is left in HS200/HS400 mode or SD card in UHS modes by the bootloader
      and may misbehave. Downgrade the eMMC to HS/HS52 mode and/or SD card
      to non-UHS mode before booting the kernel to allow such older kernels
      to work with modern U-Boot.
      
      Signed-off-by: default avatarMarek Vasut <marek.vasut+renesas@gmail.com>
      Cc: Tom Rini <trini@konsulko.com>
      632ac017
    • Marek Vasut's avatar
      mmc: Do not poll using CMD13 when changing timing · b906fe98
      Marek Vasut authored
      
      When using CMD6 to switch eMMC card timing from HS200/HS400 to HS/legacy,
      do not poll for the completion status using CMD13, but rather wait 50mS.
      
      Once the card receives the CMD6 and starts executing it, the bus is in
      undefined state until both the card finishes executing the command and
      until the controller switches the bus to matching timing configuration.
      During this time, it is not possible to transport any commands or data
      across the bus, which includes the CMD13.
      
      Signed-off-by: default avatarMarek Vasut <marek.vasut+renesas@gmail.com>
      Cc: Jaehoon Chung <jh80.chung@samsung.com>
      b906fe98
    • Marek Vasut's avatar
      mmc: Add support for downgrading HS200/HS400 to HS mode · 7fdbef52
      Marek Vasut authored
      
      The mmc_select_mode_and_width() function can be called while the card
      is in HS200/HS400 mode and can be used to downgrade the card to lower
      mode, e.g. HS. This is used for example by mmc_boot_part_access_chk()
      which cannot access the card in HS200/HS400 mode and which is in turn
      called by saveenv if env is in the MMC.
      
      In such case, forcing the card clock to legacy frequency cannot work.
      Instead, the card must be switched to HS mode first, from which it can
      then be reprogrammed as needed.
      
      However, this procedure needs additional code changes, since the current
      implementation checks whether the card correctly switched to HS mode in
      mmc_set_card_speed(). The check only expects that the card will be going
      to HS mode from lower modes, not from higher modes, hence add a parameter
      which indicates that the HS200/HS400 to HS downgrade is happening. This
      makes the code send the switch command first, reconfigure the controller
      next and finally perform the EXT_CSD readback check. The last two steps
      cannot be done in reverse order as the card is already in HS mode when
      the clock are being switched on the controller side.
      
      Signed-off-by: default avatarMarek Vasut <marek.vasut+renesas@gmail.com>
      Cc: Jaehoon Chung <jh80.chung@samsung.com>
      Signed-off-by: default avatarTroy Kisky <troy.kisky@boundarydevices.com>
      7fdbef52
    • Marek Vasut's avatar
      mmc: Do not issue CMD 6 on SD 1.00 and SD 1.01 · bfb7ded1
      Marek Vasut authored
      
      According to SD Specifications Part 1 Physical Layer Simplified Specification
      Version 6.00 August 29, 2018, section 4.3.10 (Switch Function Command) and
      section 5.6 (SCR register), SD cards version 1.00 and 1.01 do not support the
      SD CMD 6.
      
      Currently, U-Boot will issue CMD 6 unconditionally in sd_set_card_speed()
      while configuring the bus for selected frequency. This will make SD cards
      version 1.00 and 1.01 time out and thus fail detection altogether.
      
      Fix this by not sending CMD 6 on such cards. Tested on Matsushita Electric
      Industrial Co., Ltd. Japan RP-SD008B / Victor 8MB SD card, CU-SD008, which
      is correctly detected with this patch as:
      
      Device: sd@ee160000
      Manufacturer ID: 1
      OEM: 5041
      Name: S008B
      Bus Speed: 25000000
      Mode : SD Legacy
      Rd Block Len: 512
      SD version 1.0
      High Capacity: No
      Capacity: 6.5 MiB
      Bus Width: 4-bit
      Erase Group Size: 512 Bytes
      
      Signed-off-by: default avatarMarek Vasut <marek.vasut+renesas@gmail.com>
      Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
      bfb7ded1
  2. Oct 23, 2019
  3. Oct 17, 2019
  4. Oct 16, 2019
  5. Oct 13, 2019
  6. Oct 10, 2019
  7. Oct 08, 2019
  8. Oct 05, 2019
  9. Oct 04, 2019
  10. Oct 01, 2019
  11. Sep 26, 2019
  12. Sep 25, 2019
Loading