Skip to content
Snippets Groups Projects
Select Git revision
  • master default protected
  • early-display
  • variant-emmc-nvme-boot
  • 2023-01-25
  • v3
  • variant-emmc-nvme-boot
  • 2020-06-01
7 results

mxs_spi.c

Forked from Reform / reform-boundary-uboot
Source project has a limited visibility.
  • Matt Sealey's avatar
    c6b52c49
    spi: fix mxs_spi_slave structure allocation to clear memory · c6b52c49
    Matt Sealey authored
    
    Use calloc() instead of malloc() to allocate the mxs_spi_slave structure.
    Clearing the memory is necessary since most of the time this gets done
    super early in boot, but on warm reboots, and when SPI probing is done
    long after the init stages it could actually pick up previously used memory,
    and things like the chipselect polarity and other data end up being filled
    with trash data if not explicitly set by the board files.
    
    This solves a semi-random, almost unreproducable error whereby SPI devices
    act very, very strangly on boot.
    
    Signed-off-by: default avatarMatt Sealey <matt@genesi-usa.com>
    Acked-by: default avatarStefano Babic <sbabic@denx.de>
    c6b52c49
    History
    spi: fix mxs_spi_slave structure allocation to clear memory
    Matt Sealey authored
    
    Use calloc() instead of malloc() to allocate the mxs_spi_slave structure.
    Clearing the memory is necessary since most of the time this gets done
    super early in boot, but on warm reboots, and when SPI probing is done
    long after the init stages it could actually pick up previously used memory,
    and things like the chipselect polarity and other data end up being filled
    with trash data if not explicitly set by the board files.
    
    This solves a semi-random, almost unreproducable error whereby SPI devices
    act very, very strangly on boot.
    
    Signed-off-by: default avatarMatt Sealey <matt@genesi-usa.com>
    Acked-by: default avatarStefano Babic <sbabic@denx.de>