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: Customising .ubi filesystem

Part Number: AM3359


Tool/software: Linux

We're working on a custom board based on AM3359. SDK we are using is ti-processor-sdk-linux-am335x-evm-05.00.00.15

How to customise tisdk-rootfs-image-am335x-evm.ubi filesystem to boot processor via spi flash.

We are using Micron Serial NOR Flash Memory (MT25QL256ABA), 256Mb, 3V Multiple I/O Serial Flash Memory for booting the processor.

Regards

Vamsi

  • Hello Vamsi,

    Please, refer to this page and this thread.

    Best regards,
    Kemal

  • Below is the boot log when I did sf probe 0 using this link.

    U-Boot SPL 2018.01-00228-g4579b13-dirty (Mar 18 2019 - 13:44:28)
    Trying to boot from MMC1
    *** Warning - bad CRC, using default environment

    reading u-boot.img
    reading u-boot.img
    reading u-boot.img
    reading u-boot.img
    bootlist count 9,5


    U-Boot 2018.01-00228-g4579b13-dirty (Mar 18 2019 - 13:44:28 +0530)

    CPU  : AM335X-GP rev 2.1
    Model: TI AM335x EVM
    DRAM:  256 MiB
    NAND:  0 MiB
    MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
    *** Warning - bad CRC, using default environment

    <ethaddr> not set. Validating first E-fuse MAC
    Net:   cpsw, usb_ether
    Hit any key to stop autoboot:  0
    =>
    =>
    =>
    => mmc rescan
    => sf probe 0
    SF: unrecognized JEDEC id bytes: ff, ff, ff
    Failed to initialize SPI flash at 0:0
    =>

    Can you tell me what to do further to get rid off this?

  • Our pinmux is proper. We enabled clock also for spi0. Below is the definition of spi0 pin mux in u-boot.

    static struct module_pin_mux spi0_pin_mux[] = {
        {OFFSET(spi0_sclk), (MODE(0) | RXACTIVE | PULLUDEN)},    /* SPI0_SCLK */
        {OFFSET(spi0_d0), (MODE(0) | RXACTIVE |
                PULLUDEN | PULLUP_EN)},            /* SPI0_D0 */
        {OFFSET(spi0_d1), (MODE(0) | RXACTIVE | PULLUDEN)},    /* SPI0_D1 */
        {OFFSET(spi0_cs0), (MODE(0) | RXACTIVE |
                PULLUDEN | PULLUP_EN)},            /* SPI0_CS0 */
        {-1},
    };

    calling this pinmux (configure_module_pin_mux(spi0_pin_mux);) from enable_board_pin_mux(void) function in our mux.c in u-boot.

  • Using JTAG, we followed steps given for Booting Via SPI in this link.

    After Loading the spi_flash_writer_AM335X.out onto the board, below is the output.

    [CortxA8] AM335X part detected. SF: Got idcode ff ff ff
    Checking if Winbond flash writer can be used..
    SF: Unsupported Winbond ID ffff
    No known Serial Flash found


    What can be the issue?

  • Can you attach your board's &spi0 device tree node settings?

  • spi0_pins: spi0_pins {
    pinctrl-single,pins = <
    AM33XX_IOPAD(0x950, PIN_OUTPUT_PULLUP | MUX_MODE0) //spi0_sclk
    AM33XX_IOPAD(0x954, PIN_OUTPUT_PULLUP | MUX_MODE0) //spi0_d0
    AM33XX_IOPAD(0x958, PIN_INPUT_PULLUP | MUX_MODE0) //spi0_d1
    AM33XX_IOPAD(0x95c, PIN_OUTPUT | MUX_MODE0) //spi0_cs0
    >;
    };

    &spi0
    {
    pinctrl-names = "default";
    pinctrl-0 = <&spi0_pins>;
    ti,pindir-d0-out-d1-in = <1>;
    status = "okay";
    spidev@0
    {
    pinctrl-0 = <&spi0_pins>;
    compatible = "spidev";
    spi-max-frequency = <48000000>;
    reg = <0>;
    };
    };
  • Can you try these settings?

    &spi0 {
    	status = "okay";
    	pinctrl-names = "default";
    	pinctrl-0 = <&spi0_pins>;
    
    	spi_nor: flash@0 {
    		#address-cells = <1>;
    		#size-cells = <1>;
    		compatible = "jedec,spi-nor";
    		spi-max-frequency = <48000000>;
    		m25p,fast-read;
    		reg = <0>;
    
    		partition@0 {
    			label = "u-boot-spl";
    			reg = <0x0 0x80000>;
    			read-only;
    		};
    
    		partition@1 {
    			label = "u-boot";
    			reg = <0x80000 0x100000>;
    			read-only;
    		};
    
    		partition@2 {
    			label = "u-boot-env";
    			reg = <0x180000 0x20000>;
    			read-only;
    		};
    
    		partition@3 {
    			label = "misc";
    			reg = <0x1A0000 0x1E60000>;
    		};
    	};
    };
  • Hello Vamsi,

    Does the spi flash work with the above device tree settings now?

    Best regards,
    Kemal
  • Hi Kemal,

    I copied the above spi0 settings to dts files present in both u-boot and linux. But the same issue is persisting.

    => mmc rescan
    => sf probe 0
    SF: unrecognized JEDEC id bytes: ff, ff, ff
    Failed to initialize SPI flash at 0:0

    Regards
    Vamsi
  • Can you attach the SPI part of your schematic and an oscilloscope screenshot which shows that the clock is present?
  • Hello Vamsi,

    Were you able to resolve this issue? I’ve not heard back from you in a month. I hope we were able to help. I’m going to close the thread now and mark the issue resolved. If you have any follow-up questions, please reply to this thread or start a new thread.

    Thanks,
    Kemal