21 May, 2014

1 commit


17 Apr, 2014

1 commit

  • Compile-testing for a 64-bit arch uncovers several bad casts:

    In file included from include/linux/linkage.h:4:0,
    from include/linux/kernel.h:6,
    from drivers/mtd/devices/st_spi_fsm.c:15:
    drivers/mtd/devices/st_spi_fsm.c: In function ‘stfsm_read_fifo’:
    drivers/mtd/devices/st_spi_fsm.c:758:11: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    BUG_ON((((uint32_t)buf) & 0x3) || (size & 0x3));
    ...

    Use uintptr_t instead of uint32_t, since it's guaranteed to be
    pointer-sized.

    We also see this warning, if size_t is not 32 bits wide:

    In file included from drivers/mtd/devices/st_spi_fsm.c:15:0:
    drivers/mtd/devices/st_spi_fsm.c: In function ‘stfsm_mtd_write’:
    include/linux/kernel.h:712:17: warning: comparison of distinct pointer types lacks a cast [enabled by default]
    (void) (&_min1 == &_min2); \
    ^
    drivers/mtd/devices/st_spi_fsm.c:1704:11: note: in expansion of macro ‘min’
    bytes = min(FLASH_PAGESIZE - page_offs, len);
    ^

    Just use min_t() to force the type conversion, since we don't really
    want to upgrade 'page_offs' and 'bytes' to size_t; they only should be
    handling
    Acked-by: Lee Jones

    Brian Norris
     

15 Apr, 2014

9 commits

  • Many of the serial_flash_cmds.h opcodes are duplicated with spi-nor.h.
    Let's begin to unify them.

    Signed-off-by: Brian Norris
    Acked-by: Lee Jones
    Reviewed-by: Marek Vasut

    Brian Norris
     
  • Begin to unify the differences between serial_flash_cmds.h and
    spi-nor.h.

    Signed-off-by: Brian Norris
    Acked-by: Lee Jones
    Reviewed-by: Marek Vasut

    Brian Norris
     
  • These are also in serial_flash_cmds.h. (FWIW, I didn't know the C
    preprocessor allowed redefinitions without warning like this.)

    Signed-off-by: Brian Norris
    Acked-by: Lee Jones
    Reviewed-by: Marek Vasut

    Brian Norris
     
  • This patch adds support for the Macronix MX25L3255E device. Unlike the other
    Macronix devices we have seen, this device supports WRITE_1_4_4 at reasonable
    frequencies. Rather than masking out WRITE_1_4_4 support altogether, we now
    rely on the table parameters to indicate whether or not WRITE_1_4_4 should be
    used.

    Signed-off-by: Angus Clark
    Signed-off-by: Lee Jones
    Signed-off-by: Brian Norris

    Angus Clark
     
  • Add Spansion S25FL032P to the list of known devices.

    Signed-off-by: Angus Clark
    Signed-off-by: Lee Jones
    Signed-off-by: Brian Norris

    Angus Clark
     
  • This patch refactors the fsm_read_status() and fsm_write_status() code to
    support 1 or 2 byte operations, with a specified command. This allows us to
    remove device/register specific code, such as the N25Q fsm_wrvcr() function.

    The 'QE' configuration code is updated accordingly, with minor tweaks to ensure
    the register values are only written if actually required. One notable change
    in this area is that the 'W25Q_STATUS_QE' bit-field is now defined with respect
    to the 'SR2' register, rather than the combined 'SR1+SR2' register which is only
    used for write operations.

    Signed-off-by: Angus Clark
    Signed-off-by: Lee Jones
    Signed-off-by: Brian Norris

    Angus Clark
     
  • Update the configuration of the Macronix 'QE' bit, such that
    we only set or clear the bit if required.

    Signed-off-by: Angus Clark
    Signed-off-by: Lee Jones
    Signed-off-by: Brian Norris

    Angus Clark
     
  • Support for the Macronix 32-bit addressing scheme was originally developed using
    the MX25L25635E device. As is often the case, it was found that the presence of
    a "WAIT" instruction was required for the "EN4B/EX4B" FSM Sequence to complete.
    (It is known that the SPI FSM Controller makes certain undocumented assumptions
    regarding what constitutes a valid sequence.) However, further testing
    suggested that a small delay was required after issuing the "EX4B" command;
    without this delay, data corruptions were observed, consistent with the device
    not being ready to retrieve data. Although the issue was not fully understood,
    the workaround of adding a small delay was implemented, while awaiting
    clarification from Macronix.

    The same behaviour has now been found with a second Macronix device, the
    MX25L25655E. However, with this device, it seems that the delay is also
    required after the 'EN4B' commands. This discovery has prompted us to revisit
    the issue.

    Although still not conclusive, further tests have suggested that the issue is
    down to the SPI FSM Controller, rather than the Macronix devices. Furthermore,
    an alternative workaround has emerged which is to set the WAIT time to
    0x00000001, rather then 0x00000000. (Note, the WAIT instruction is used purely
    for the purpose of achieving "sequence validity", rather than actually
    implementing a delay!)

    The issue is now being investigated by the Design and Validation teams. In the
    meantime, we implement the alternative workaround, which reduces the effective
    delay from 1us to 1ns.

    Signed-off-by: Angus Clark
    Signed-off-by: Lee Jones
    Signed-off-by: Brian Norris

    Angus Clark
     
  • Add Macronix MX25L25655E to the list of known devices.

    Signed-off-by: Angus Clark
    Signed-off-by: Lee Jones
    Signed-off-by: Brian Norris

    Angus Clark
     

20 Mar, 2014

29 commits