[U-Boot] dm-spi: spi_chip_select value

Simon Glass sjg at chromium.org
Fri Jun 26 17:53:36 CEST 2015


Hi Jagan,

On 23 June 2015 at 15:03, Jagan Teki <jteki at openedev.com> wrote:
> Hi Simon,
>
> I'm calling spi_chip_select(bus) from set_speed or claim_bus
> to get the cs value from sf probe.
>
> Seems like it returns the maximum number as 254, when I debug
> further seems like slave_platdata returns NULL
>
> int spi_chip_select(struct udevice *dev)
> {
>         struct dm_spi_slave_platdata *plat = dev_get_parent_platdata(dev);
>         / * this plat data returns NULL */
>
>         return plat ? plat->cs : -ENOENT;
> }
>

/**
 * spi_chip_select() - Get the chip select for a slave
 *
 * @return the chip select this slave is attached to
 */
int spi_chip_select(struct udevice *slave);

This function takes a slave device as a parameter, not a bus. Are you
passing it a bus?

> log:
> zynq-uboot> sf probe 1:0
> zynq_spi_ofdata_to_platdata: regs=e0007000 max-frequency=166666700
> zynq_spi_set_speed: cs 254
> zynq_spi_set_speed: regs=e0007000, mode=1000000
> zynq_spi_set_mode: regs=e0007000, mode=3
> zynq_spi_claim_bus: cs 254
> spi_xfer: bus:1 cs:254 bitlen:8 len:1 flags:1
> spi_xfer: Timeout! TX FIFO not full
> SF: Failed to get idcodes
> Failed to initialize SPI flash at 1:0 (error -1)
>
> Any help?
>
> thanks!
> --
> Jagan | openedev.

Regards,
Simon


More information about the U-Boot mailing list