You are in luck, a colleague has asked me to get the SPI Flash device working again.
We are using a spansion S25FL132K device.
In the DeviceTree source I have :
spi4: spi@7000dc00 {
compatible = "nvidia,tegra114-spi";
reg = <0x0 0x7000dc00 0x0 0x200>;
interrupts = <0x0 0x5e 0x4>;
nvidia,dma-request-selector = <0x7 0x1b>;
nvidia,memory-clients = <0xe>;
#address-cells = <0x1>;
#size-cells = <0x0>;
clocks = <0xc 0x68>;
status = "okay";
dmas = <0x7 0x1b 0x7 0x1b>;
dma-names = "rx", "tx";
eeprom@0 {
compatible = "a25fl132k";
spi-max-frequency = <100000000>;
reg = <0>;
addr-size = <2>;
page-size = <256>;
eeprom-size = <1024>;
eeprom-name = "johnsat25";
};
};
Strickly speaking, the description is wrong - it is not an EEPROM but all that is important is the device id.
The deivce id must be added to a driver. The driver is
kernel/drivers/mtd/devices/m25p80.c
Find the table of devices :
static const struct spi_device_id m25p_ids[] = {
For device S25FL132K add :
// INFO(_jedec_id, _ext_id, _sector_size, _n_sectors, _flags)
{ "a25fl132k", INFO(0x014016, 0, 16 * 256, 1024, 0) },
Finally, in the default config file, add :
CONFIG_SPI=y
CONFIG_SPI_TEGRA114=y
CONFIG_SPI_MASTER=y
CONFIG_SPI_SPIDEV=y
CONFIG_MTD_M25P80=y
CONFIG_MTD=y
CONFIG_MTD_JEDECPROBE=m
CONFIG_MTD_GEN_PROBE=m
CONFIG_MTD_PHYSMAP=m
CONFIG_MTD_CHAR=y
CONFIG_MTD_BLOCK=y
Compile, download and boot up the Jetson.
The SPI flash should appear as
/dev/mtd0
It is a char device.
You have not actually said what SPI device you are trying to interface to?
SPI is just a low level protocol to talk to devices - you need to know what you are talking to.
The device may have a protocol on top of the SPI.