05 May, 2015

5 commits

  • The polling loops in sd_send_op_cond and mmc_complete_op_cond functions
    check the ready flag state at the end of the loop, that is after executing
    a delay inside the loop, which, in case of exiting with no error,
    is not needed. Also, one of these loops, as well as the loop
    in mmc_send_status, have the delay just before exiting on timeout
    conditions.

    Restructure all these loops to check the respective conditions before making
    a delay for the next loop pass, and to appropriately exit without the delay.

    Signed-off-by: Andrew Gabbasov

    Andrew Gabbasov
     
  • Some MMC cards come to ready state quite quickly, so that the respective
    flag appears to be set in mmc_send_op_cond already. In this case trying
    to continue polling the card with CMD1 in mmc_complete_op_cond is incorrect
    and may lead to unpredictable results. So check the flag before polling
    and skip it appropriately.

    Signed-off-by: Andrew Gabbasov

    Andrew Gabbasov
     
  • The previous change to use 'ocr' structure field for storing send_op_cond
    command response also stopped using command response directly
    outside of mmc_send_op_cond_iter(). Now it becomes possible to use
    command structure in mmc_send_op_cond_iter() locally, removing a necessity
    to pass it as an argument from the caller.

    Signed-off-by: Andrew Gabbasov

    Andrew Gabbasov
     
  • The 'op_cond_response' field in mmc structure contains the response
    from the last SEND_OP_COND MMC command while making iterational
    polling of the card. Later it is copied to 'ocr' field, designed
    to contain the OCR register value, which is actually the same
    response from the same command. So, these fields have actually
    the same data, just in different time periods. It's easier to use
    the same 'ocr' field in both cases at once, without temporary using
    of the 'op_cond_response' field.

    Signed-off-by: Andrew Gabbasov

    Andrew Gabbasov
     
  • The version flag constant name used in IS_MMC macro is incorrect/undefined.

    Signed-off-by: Andrew Gabbasov

    Andrew Gabbasov
     

29 Apr, 2015

29 commits


28 Apr, 2015

4 commits

  • Tom Rini
     
  • Upto now flash sector_size is assigned from params which isn't
    necessarily a sector size from vendor, so based on the SECT_*
    flags from flash_params the erase_size will compute and it will
    become the sector_size finally.

    Bug report (from Bin Meng):
    => sf probe
    SF: Detected SST25VF016B with page size 256 Bytes, erase size 4 KiB,
    total 2 MiB, mapped at ffe00000

    => sf erase 0 +100
    SF: 65536 bytes @ 0x0 Erased: OK

    Signed-off-by: Jagannadha Sutradharudu Teki
    Reported-by: Bin Meng
    Tested-by: Bin Meng

    Jagannadha Sutradharudu Teki
     
  • With SPI flash moving to driver model, commit fbb0991 "dm: Convert
    spi_flash_probe() and 'sf probe' to use driver model" ignored the
    SST flash-specific write op (byte program & word program), which
    actually broke the SST flash from wroking.

    This commit makes SST flash work again under driver model, by adding
    SST flash-specific handling in the spi_flash_std_write().

    Signed-off-by: Bin Meng
    Reviewed-by: Jagannadha Sutradharudu Teki

    Bin Meng
     
  • Add a new member 'flags' in struct spi_flash to store the flash flags
    during spi_flash_validate_params().

    Signed-off-by: Bin Meng
    Reviewed-by: Jagannadha Sutradharudu Teki

    Bin Meng
     

27 Apr, 2015

2 commits

  • The timeout value is never reset during the transfer. This means that when
    transferring more data we eventually trigger the timeout.

    This was reported on the mailing list:
    "Spansion SPI flash read timeout with AM335x"

    Signed-off-by: David Dueck
    CC: Tom Rini
    CC: Stefan Roese
    CC: Andy Pont
    Tested-by: David Dueck
    Reviewed-by: Jagannadha Sutradharudu Teki

    David Dueck
     
  • Instead of hardcoding the 'fdtfile' variable, let's detect the SoC and
    board variant on the fly and change the dtb name.

    Based on the scheme done on am335x board.

    Signed-off-by: Fabio Estevam
    Tested-By: Vagrant Cascadian
    Reviewed-by: Tom Rini

    Fabio Estevam