AnsweredAssumed Answered

Access SPI eeprom from u-boot

Question asked by Jemish Patel on Apr 5, 2016
Latest reply on Apr 6, 2016 by igorpadykov

Hi All,


We are using imx6q based customize board for our product. In our board we have SPI EEPORM (Part number :25AA010A). We are able to operate SPI EEPROM from kernel space. We don't have any issue.


Now we want to use same SPI EEPROM from u-boot level. I tried to to access it using  "sspi" command on u-boot but didn't succeed. Every time I got below error :


sspi [<bus>:]<cs>[.<mode>] <bit_len> <dout> - Send and receive bits

<bus>     - Identifies the SPI bus

<cs>      - Identifies the chip select

<mode>    - Identifies the SPI mode to use

<bit_len> - Number of bits to send (base 10)

<dout>    - Hexadecimal string that gets sent


=> sspi 1:0.0 8 3 

pre_div = 14, post_div=2

reg_ctrl = 0xe2f1

reg_config = 0x0

spi_xchg_single: bitlen 8 dout 0x8ffa5044 din 0x8ffa5064

Sending SPI 0x30

spi_xchg_single: Timeout!

Error -5 during SPI transaction

Here I have two concerns why it is showing 0x30 even though I write 3 only.

Doesn't matter whatever I write it always shows timeout error.


Can we use this utility as reference to read/write spi eeprom?

I would appreciate if anyone can suggest any other reference code that we can use.

Has any one previously use SPI from u-boot to access SPI slave?


Any suggestion or pointers would be appreciated.

As we have produce demo on 12th April 2016 this is bit crucial for us.