This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/AM3359: SPI nor flash inclusion in device tree as a mtd device

Part Number: AM3359

Tool/software: Linux

Sir,

I want to communicate with S25FL256SAGMFIR01 Flash (256 Mbit) via SPI as a mtd device.

Kindly share the device tree code for the partitioning and inclusion of Flash.

i am unaware of which driver need to included for this flash in device tree.

thanks

Mobin

  • Hi Mobin,

    AM335x McSPI linux kernel driver is located at:

    linux-kernel/drivers/spi/spi-omap2-mcspi.c

    For more info you can check below pointers:

    downloads.ti.com/.../Foundational_Components_Kernel_Drivers.html
    linux-kernel/Documentation/devicetree/bindings/spi/omap-spi.txt

    S25FL256S flash driver is located at:

    linux-kernel/drivers/mtd/devices/m25p80.c
    linux-kernel/drivers/mtd/spi-nor/spi-nor.c

    For more info you can check below pointer:

    linux-kernel/Documentation/devicetree/bindings/mtd/jedec,spi-nor.txt

    For example McSPI NOR flash configuration in DTS, check below files:

    linux-kernel/arch/arm/boot/dts/am335x-icev2-common.dtsi
    linux-kernel/arch/arm/boot/dts/am335x-moxa-uc-8100-me-t.dts
    linux-kernel/arch/arm/boot/dts/am335x-phycore-som.dtsi
    linux-kernel/arch/arm/boot/dts/am57xx-idk-common.dtsi

    Regards,
    Pavel
  • Sir,

    I have added the following device tree code in device tree but the partition is not created as mtd blocks using the command "cat /proc/mtd".
    Any other configuration I have to do in any other place ???

    /*
    * Work with m25p80 as an MTD Flash chip
    */
    flash: m25p32@0 {
    status = "okay";
    compatible = "spi-nor";
    spi-max-frequency = <25000000>;
    reg = <0>;
    #address-cells = <1>;
    #size-cells = <1>;

    partition@0 {
    label = "spi_flash_part0";
    reg = <0x0 0x100000>;
    };

    parition@1 {
    label = "spi_flash_part1";
    reg = <0x100000 0x300000>;
    };
    };

    thanks
    Mobin
  • Sir,

    Waiting for the reply

    thanks
    Mobin
  • Mobin,

    Do you use AM335x TI PSDK? If yes, which version?

    Please attach the whole DTS file for review. You can put it in txt file and attach the txt file here in this e2e thread.

    Please attach the whole boot up log (uboot + kernel + rootfs + cat /proc/mtd command output). You can put it in txt file and attach the txt file here in this e2e thread.

    Regards,
    Pavel