Linux Kernel Patch for FL-K SPI Flash

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Linux Kernel Patch for FL-K SPI Flash

1,151 Views
ChristophG_Baum
Contributor III

Hello Group,

currently I'm working with the i.MX28 EVK and want to get SPI NOR-Flash (S25FL064K) working under Linux.

I soldered the chip and the resistors R320-R322 onto the board as described on the group start page.

As Linux Kernel I use the 2.6.35.3-imx_10.12.01 distributed by Freescale. To get the Spansion chip working I first tried to add "{ "s25fl064k",  INFO(0xef4017,      0,  64 * 1024, 128, SECT_4K) }," to the device list of the m25p80 driver. But this didn't show any success. So I tried the patch from Spansion (for 2.6.31) kernels (http://www.spansion.com/Support/Software/linux-2.6.31-fl.zip). This patch gives me lots of errors at compile time regarding undeclared functions (kzmalloc) and incompatible types for spin_(un)lock.

Are there any suggestions how to proceed?

Regards

Christoph

Tags (2)
0 Kudos
2 Replies

685 Views
ChristophG_Baum
Contributor III

Hello,

thanks for the help. Meanwhile I found the two places which needed changes:

1. the mx28EVK init code needed the device ID s25fl064k when calling the SPI init

2. the code which powers on the different SoC units needed "mxs-spi" added to the list of devices to be powered on

Now I can access the NOR flash r/w and also succeeded in booting from it.

Regards,

Christoph Baumann

0 Kudos

685 Views
BacemDaassi
Contributor II

Hello Christoph,

For SPI on i.MX28 you have 2 options. One is the native Linux driver m25p80.c. It provides basic functionality but does not support e.g. dual or quad IO. Besides adding the raw chip parameters to m25p80.c you will also need to add a corresponding entry to the board driver so it can attach the low level drivers to the m25p80 driver.

Alternatively, you can use our Spansion standalone driver as long as there is no other SPI device attached to the same bus. The code might need a little bit of a massage for 2.6.35 because some things have changed (spinlocks got replaced by mutexes, ...) but it should work after that.

Thanks!

Best regards,

Bacem Daassi

Spansion Inc.

0 Kudos