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: AM3359 spi probe issue in u-boot

Part Number: AM3359

Tool/software: Linux

Hello all,

We are using a custom board based on am3359 icev2.We have an SPI flash connected to spi1.We enabled all the drivers and modified u-boot dts file accordingly.But our spi flash is not being detected by sf probe.But it is able to detect the default spi flash which comes with evm connected to spi0.I have attached the dts file.SPI flash part number :MT25QL256ABA1EW9-0SIT

Boot log:

U-Boot SPL 2018.01-00444-g96cdbefd5c-dirty (Jan 31 2019 - 16:06:34)
Trying to boot from NAND


U-Boot 2018.01-00444-g96cdbefd5c-dirty (Feb 11 2019 - 13:00:46 +0530)

CPU  : AM335X-GP rev 2.1
Model: TI AM335x EVM
DRAM:  512 MiB
NAND:  256 MiB
MMC:   OMAP SD/MMC: 0
Net:   Could not get PHY for cpsw: addr 0
cpsw, usb_ether
Hit any key to stop autoboot:  0
=> sf probe
SF: Detected w25q64cv with page size 256 Bytes, erase size 4 KiB, total 8 MiB
=> sf probe 1
SF: unrecognized JEDEC id bytes: ff, ff, ff
Failed to initialize SPI flash at 0:1
=> sf probe 1
SF: unrecognized JEDEC id bytes: ff, ff, ff
Failed to initialize SPI flash at 0:1

dts file:

/*
 * Copyright (C) 2016 Texas Instruments Incorporated - http://www.ti.com/
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */

/*
 * AM335x ICE V2 board
 * http://www.ti.com/tool/tmdsice3359
 */

/dts-v1/;

#include "am33xx.dtsi"
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/net/ti-dp83867.h>

/ {
	model = "TI AM3359 ICE-V2";
	compatible = "ti,am3359-icev2", "ti,am33xx";

	memory@80000000 {
		device_type = "memory";
		reg = <0x80000000 0x10000000>; /* 256 MB */
	};

	chosen {
		stdout-path = &uart0;
	};

	vbat: fixedregulator0 {
		compatible = "regulator-fixed";
		regulator-name = "vbat";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		regulator-boot-on;
	};

	vtt_fixed: fixedregulator1 {
		compatible = "regulator-fixed";
		regulator-name = "vtt";
		regulator-min-microvolt = <1500000>;
		regulator-max-microvolt = <1500000>;
		gpio = <&gpio0 18 GPIO_ACTIVE_HIGH>;
		regulator-always-on;
		regulator-boot-on;
		enable-active-high;
	};

	leds-iio {
		status = "disabled";
		compatible = "gpio-leds";
		led-out0 {
			label = "out0";
			gpios = <&tpic2810 0 GPIO_ACTIVE_HIGH>;
			default-state = "off";
		};

		led-out1 {
			label = "out1";
			gpios = <&tpic2810 1 GPIO_ACTIVE_HIGH>;
			default-state = "off";
		};

		led-out2 {
			label = "out2";
			gpios = <&tpic2810 2 GPIO_ACTIVE_HIGH>;
			default-state = "off";
		};

		led-out3 {
			label = "out3";
			gpios = <&tpic2810 3 GPIO_ACTIVE_HIGH>;
			default-state = "off";
		};

		led-out4 {
			label = "out4";
			gpios = <&tpic2810 4 GPIO_ACTIVE_HIGH>;
			default-state = "off";
		};

		led-out5 {
			label = "out5";
			gpios = <&tpic2810 5 GPIO_ACTIVE_HIGH>;
			default-state = "off";
		};

		led-out6 {
			label = "out6";
			gpios = <&tpic2810 6 GPIO_ACTIVE_HIGH>;
			default-state = "off";
		};

		led-out7 {
			label = "out7";
			gpios = <&tpic2810 7 GPIO_ACTIVE_HIGH>;
			default-state = "off";
		};
	};

	/* Tricolor status LEDs */
	leds1 {
		compatible = "gpio-leds";
		pinctrl-names = "default";
		pinctrl-0 = <&user_leds>;

		led0 {
			label = "status0:red:cpu0";
			gpios = <&gpio0 17 GPIO_ACTIVE_HIGH>;
			default-state = "off";
			linux,default-trigger = "cpu0";
		};

		led1 {
			label = "status0:green:usr";
			gpios = <&gpio0 16 GPIO_ACTIVE_HIGH>;
			default-state = "off";
		};

		led2 {
			label = "status0:yellow:usr";
			gpios = <&gpio3 9 GPIO_ACTIVE_HIGH>;
			default-state = "off";
		};

		led3 {
			label = "status1:red:mmc0";
			gpios = <&gpio1 30 GPIO_ACTIVE_HIGH>;
			default-state = "off";
			linux,default-trigger = "mmc0";
		};

		led4 {
			label = "status1:green:usr";
			gpios = <&gpio0 20 GPIO_ACTIVE_HIGH>;
			default-state = "off";
		};

		led5 {
			label = "status1:yellow:usr";
			gpios = <&gpio0 19 GPIO_ACTIVE_HIGH>;
			default-state = "off";
		};
	};
	gpio-decoder {
		compatible = "gpio-decoder";
		gpios = <&pca9536 3 GPIO_ACTIVE_HIGH>,
			<&pca9536 2 GPIO_ACTIVE_HIGH>,
			<&pca9536 1 GPIO_ACTIVE_HIGH>,
			<&pca9536 0 GPIO_ACTIVE_HIGH>;
		linux,axis = <0>; /* ABS_X */
		decoder-max-value = <9>;
	};

	/* Dual mac ethernet application node on icss */
	/*pruss_eth {
		compatible = "ti,am3359-prueth";
		pruss = <&pruss>;
		sram = <&ocmcram>;
		interrupt-parent = <&pruss_intc>;
		status = "disabled";

		pinctrl-0 = <&pruss_eth_default>;
		pinctrl-names = "default";

		pruss_emac0: ethernet-mii0 {
			phy-handle = <&pruss_eth0_phy>;
			phy-mode = "mii";
			interrupts = <20>, <22>;
			interrupt-names = "rx", "tx";
			/* Filled in by bootloader 
			local-mac-address = [00 00 00 00 00 00];
		};

		pruss_emac1: ethernet-mii1 {
			phy-handle = <&pruss_eth1_phy>;
			phy-mode = "mii";
			interrupts = <21>, <23>;
			interrupt-names = "rx", "tx";
			/* Filled in by bootloader 
			local-mac-address = [00 00 00 00 00 00];
		};
	};*/
};

&am33xx_pinmux {
	user_leds: user_leds {
		pinctrl-single,pins = <
			AM33XX_IOPAD(0x91c, PIN_OUTPUT | MUX_MODE7) /* (J18) gmii1_txd3.gpio0[16] */
			AM33XX_IOPAD(0x920, PIN_OUTPUT | MUX_MODE7) /* (K15) gmii1_txd2.gpio0[17] */
			AM33XX_IOPAD(0x9b0, PIN_OUTPUT | MUX_MODE7) /* (A15) xdma_event_intr0.gpio0[19] */
			AM33XX_IOPAD(0x9b4, PIN_OUTPUT | MUX_MODE7) /* (D14) xdma_event_intr1.gpio0[20] */
			AM33XX_IOPAD(0x880, PIN_OUTPUT | MUX_MODE7) /* (U9) gpmc_csn1.gpio1[30] */
			AM33XX_IOPAD(0x92c, PIN_OUTPUT | MUX_MODE7) /* (K18) gmii1_txclk.gpio3[9] */
		>;
	};

	mmc0_pins_default: mmc0_pins_default {
		pinctrl-single,pins = <
			AM33XX_IOPAD(0x8f0, PIN_INPUT_PULLUP | MUX_MODE0) /* (F17) mmc0_dat3.mmc0_dat3 */
			AM33XX_IOPAD(0x8f4, PIN_INPUT_PULLUP | MUX_MODE0) /* (F18) mmc0_dat2.mmc0_dat2 */
			AM33XX_IOPAD(0x8f8, PIN_INPUT_PULLUP | MUX_MODE0) /* (G15) mmc0_dat1.mmc0_dat1 */
			AM33XX_IOPAD(0x8fc, PIN_INPUT_PULLUP | MUX_MODE0) /* (G16) mmc0_dat0.mmc0_dat0 */
			AM33XX_IOPAD(0x900, PIN_INPUT_PULLUP | MUX_MODE0) /* (G17) mmc0_clk.mmc0_clk */
			AM33XX_IOPAD(0x904, PIN_INPUT_PULLUP | MUX_MODE0) /* (G18) mmc0_cmd.mmc0_cmd */
		>;
	};

	i2c0_pins_default: i2c0_pins_default {
		pinctrl-single,pins = <
			AM33XX_IOPAD(0x988, PIN_INPUT | MUX_MODE0) /* (C17) I2C0_SDA.I2C0_SDA */
			AM33XX_IOPAD(0x98c, PIN_INPUT | MUX_MODE0) /* (C16) I2C0_SCL.I2C0_SCL */
		>;
	};

	spi0_pins_default: spi0_pins_default {
		pinctrl-single,pins = <
			AM33XX_IOPAD(0x950, PIN_INPUT_PULLUP | MUX_MODE0) /* (A17) spi0_sclk.spi0_sclk */
			AM33XX_IOPAD(0x954, PIN_INPUT_PULLUP | MUX_MODE0) /* (B17) spi0_d0.spi0_d0 */
			AM33XX_IOPAD(0x958, PIN_INPUT_PULLUP | MUX_MODE0) /* (B16) spi0_d1.spi0_d1 */
			AM33XX_IOPAD(0x95c, PIN_INPUT_PULLUP | MUX_MODE0) /* (A16) spi0_cs0.spi0_cs0 */
			AM33XX_IOPAD(0x960, PIN_INPUT_PULLUP | MUX_MODE0) /* (C15) spi0_cs1.spi0_cs1 */
			AM33XX_IOPAD(0x9a0, PIN_INPUT_PULLUP | MUX_MODE7) /* (B12) mcasp0_aclkr.gpio3[18] */
		>;
	};
	

	spi1_pins_default: spi1_pins_default {
                pinctrl-single,pins = <
                AM33XX_IOPAD(0x990, PIN_INPUT_PULLUP | MUX_MODE3) /* (A13) mcasp0_aclkx.spi1_sclk */
                AM33XX_IOPAD(0x994, PIN_INPUT_PULLUP | MUX_MODE3) /* (B13) mcasp0_fsx.spi1_d0 */
                AM33XX_IOPAD(0x998, PIN_INPUT_PULLUP | MUX_MODE3) /* (D12) mcasp0_axr0.spi1_d1 */
                AM33XX_IOPAD(0x99c, PIN_INPUT_PULLUP | MUX_MODE3) /* (C12) mcasp0_ahclkr.spi1_cs0 */
                >;
        };

	uart3_pins_default: uart3_pins_default {
		pinctrl-single,pins = <
			AM33XX_IOPAD(0x934, PIN_INPUT_PULLUP | MUX_MODE1) /* (L17) gmii1_rxd3.uart3_rxd */
			AM33XX_IOPAD(0x938, PIN_OUTPUT_PULLUP | MUX_MODE1) /* (L16) gmii1_rxd2.uart3_txd */
		>;
	};
	
	 uart4_pins_default: uart4_pins_default {
                pinctrl-single,pins = <
                        AM33XX_IOPAD(0x870, PIN_INPUT_PULLUP | MUX_MODE6) /* (T17) gpmc_wait0.uart4_rxd */
                        AM33XX_IOPAD(0x874, PIN_OUTPUT_PULLUP | MUX_MODE6) /* (U17) gpmc_wpn.uart4_txd */
                >;
        };

     cpsw_default: cpsw_default {
                pinctrl-single,pins = <
                                /* Slave 1 */
                AM33XX_IOPAD(0x914, PIN_OUTPUT_PULLDOWN | MUX_MODE2)    /* mii1_txen.rgmii1_tctl */
                AM33XX_IOPAD(0x918, PIN_INPUT_PULLDOWN | MUX_MODE2)     /* mii1_rxdv.rgmii1_rctl */
                AM33XX_IOPAD(0x91c, PIN_OUTPUT_PULLDOWN | MUX_MODE2)    /* mii1_txd3.rgmii1_td3 */
                AM33XX_IOPAD(0x920, PIN_OUTPUT_PULLDOWN | MUX_MODE2)    /* mii1_txd2.rgmii1_td2 */
                AM33XX_IOPAD(0x924, PIN_OUTPUT_PULLDOWN | MUX_MODE2)    /* mii1_txd1.rgmii1_td1 */
                AM33XX_IOPAD(0x928, PIN_OUTPUT_PULLDOWN | MUX_MODE2)/* mii1_txd0.rgmii1_td0 */

                AM33XX_IOPAD(0x92c, PIN_OUTPUT_PULLDOWN | MUX_MODE2)    /* mii1_txclk.rgmii1_tclk */
                AM33XX_IOPAD(0x930, PIN_INPUT_PULLDOWN | MUX_MODE2)     /* mii1_rxclk.rgmii1_rclk */
                AM33XX_IOPAD(0x934, PIN_INPUT_PULLDOWN | MUX_MODE2)     /* mii1_rxd3.rgmii1_rd3 */
                AM33XX_IOPAD(0x938, PIN_INPUT_PULLDOWN | MUX_MODE2)     /* mii1_rxd2.rgmii1_rd2 */
                AM33XX_IOPAD(0x93c, PIN_INPUT_PULLDOWN | MUX_MODE2)     /* mii1_rxd1.rgmii1_rd1 */
                AM33XX_IOPAD(0x940, PIN_INPUT_PULLDOWN | MUX_MODE2)     /* mii1_rxd0.rgmii1_rd0 */
                AM33XX_IOPAD(0xA34, PIN_OUTPUT_PULLUP | MUX_MODE7) /* (F15) USB1_DRVVBUS.gpio3[13] */
        >;
        };

        cpsw_sleep: cpsw_sleep {
                pinctrl-single,pins = <
                AM33XX_IOPAD(0x914, (PIN_INPUT_PULLDOWN | MUX_MODE7) ) /* (J16) gmii1_txen.rgmii1_tctl */
                AM33XX_IOPAD(0x918, (PIN_INPUT_PULLDOWN | MUX_MODE7) ) /* (J17) gmii1_rxdv.rgmii1_rctl */
                AM33XX_IOPAD(0x92c, (PIN_INPUT_PULLDOWN | MUX_MODE7) ) /* (K18) gmii1_txclk.rgmii1_tclk */
                AM33XX_IOPAD(0x930, (PIN_INPUT_PULLDOWN | MUX_MODE7)) /* (L18) gmii1_rxclk.rgmii1_rclk */
                AM33XX_IOPAD(0x928, (PIN_INPUT_PULLDOWN | MUX_MODE7) ) /* (K17) gmii1_txd0.rgmii1_td0 */
                AM33XX_IOPAD(0x924, (PIN_INPUT_PULLDOWN | MUX_MODE7) ) /* (K16) gmii1_txd1.rgmii1_td1 */
                AM33XX_IOPAD(0x920, (PIN_INPUT_PULLDOWN | MUX_MODE7) ) /* (K15) gmii1_txd2.rgmii1_td2 */
                AM33XX_IOPAD(0x91c, (PIN_INPUT_PULLDOWN | MUX_MODE7) ) /* (J18) gmii1_txd3.rgmii1_td3 */
                AM33XX_IOPAD(0x940, (PIN_INPUT_PULLDOWN | MUX_MODE7) ) /* (M16) gmii1_rxd0.rgmii1_rd0 */
                AM33XX_IOPAD(0x93c, (PIN_INPUT_PULLDOWN | MUX_MODE7) ) /* (L15) gmii1_rxd1.rgmii1_rd1 */
                AM33XX_IOPAD(0x938, (PIN_INPUT_PULLDOWN | MUX_MODE7) ) /* (L16) gmii1_rxd2.rgmii1_rd2 */
                AM33XX_IOPAD(0x934, (PIN_INPUT_PULLDOWN | MUX_MODE7) ) /* (L17) gmii1_rxd3.rgmii1_rd3 */
                AM33XX_IOPAD(0xA34, PIN_OUTPUT_PULLDOWN | MUX_MODE7)    

                >;
        };

        davinci_mdio_default: davinci_mdio_default {
                pinctrl-single,pins = <
                        /* MDIO */
                        AM33XX_IOPAD(0x948, (PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0))     /* mdio_data.mdio_data */
                        AM33XX_IOPAD(0x94c, (PIN_OUTPUT_PULLUP | MUX_MODE0))                    /* mdio_clk.mdio_clk */
        
                >;
        };

        davinci_mdio_sleep: davinci_mdio_sleep {
                pinctrl-single,pins = <
                        /* MDIO reset value */
                        AM33XX_IOPAD(0x948, (PIN_INPUT_PULLDOWN | MUX_MODE7))
                        AM33XX_IOPAD(0x94c, (PIN_INPUT_PULLDOWN | MUX_MODE7))
                >;
        };


};

&i2c0 {
	pinctrl-names = "default";
	pinctrl-0 = <&i2c0_pins_default>;

	status = "okay";
	clock-frequency = <400000>;

	tps: power-controller@2d {
		reg = <0x2d>;
	};

	tpic2810: gpio@60 {
		compatible = "ti,tpic2810";
		reg = <0x60>;
		gpio-controller;
		#gpio-cells = <2>;
	};

	pca9536: gpio@41 {
		compatible = "ti,pca9536";
		reg = <0x41>;
		gpio-controller;
		#gpio-cells = <2>;
	};
};

&spi0 {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&spi0_pins_default>;

	sn65hvs882@1 {
		compatible = "pisosr-gpio";
		gpio-controller;
		#gpio-cells = <2>;

		load-gpios = <&gpio3 18 GPIO_ACTIVE_LOW>;

		reg = <1>;
		spi-max-frequency = <1000000>;
		spi-cpol;
	};

	spi_nor: flash@0 {
		#address-cells = <1>;
		#size-cells = <1>;
		compatible = "winbond,w25q64", "jedec,spi-nor";
		spi-max-frequency = <80000000>;
		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 0x660000>;
		};
	};

};


&spi1 {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&spi0_pins_default>;

	spi_nor1: flash@0 {
		#address-cells = <1>;
		#size-cells = <1>;
		compatible ="jedec,spi-nor";
		spi-max-frequency = <80000000>;
		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 0x660000>;
		};
	};

};



&tscadc {
	status = "okay";
	adc {
		ti,adc-channels = <1 2 3 4 5 6 7>;
	};
};

#include "tps65910.dtsi"

&tps {
	vcc1-supply = <&vbat>;
	vcc2-supply = <&vbat>;
	vcc3-supply = <&vbat>;
	vcc4-supply = <&vbat>;
	vcc5-supply = <&vbat>;
	vcc6-supply = <&vbat>;
	vcc7-supply = <&vbat>;
	vccio-supply = <&vbat>;

	regulators {
		vrtc_reg: regulator@0 {
			regulator-always-on;
		};

		vio_reg: regulator@1 {
			regulator-always-on;
		};

		vdd1_reg: regulator@2 {
			regulator-name = "vdd_mpu";
			regulator-min-microvolt = <912500>;
			regulator-max-microvolt = <1326000>;
			regulator-boot-on;
			regulator-always-on;
		};

		vdd2_reg: regulator@3 {
			regulator-name = "vdd_core";
			regulator-min-microvolt = <912500>;
			regulator-max-microvolt = <1144000>;
			regulator-boot-on;
			regulator-always-on;
		};

		vdd3_reg: regulator@4 {
			regulator-always-on;
		};

		vdig1_reg: regulator@5 {
			regulator-always-on;
		};

		vdig2_reg: regulator@6 {
			regulator-always-on;
		};

		vpll_reg: regulator@7 {
			regulator-always-on;
		};

		vdac_reg: regulator@8 {
			regulator-always-on;
		};

		vaux1_reg: regulator@9 {
			regulator-always-on;
		};

		vaux2_reg: regulator@10 {
			regulator-always-on;
		};

		vaux33_reg: regulator@11 {
			regulator-always-on;
		};

		vmmc_reg: regulator@12 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <3300000>;
			regulator-always-on;
		};
	};
};

&mmc1 {
	status = "okay";
	vmmc-supply = <&vmmc_reg>;
	bus-width = <4>;
	pinctrl-names = "default";
	pinctrl-0 = <&mmc0_pins_default>;
};

&gpio0 {
	/* Do not idle the GPIO used for holding the VTT regulator */
	ti,no-reset-on-init;
	ti,no-idle-on-init;

	p7 {
		gpio-hog;
		gpios = <7 GPIO_ACTIVE_HIGH>;
		output-high;
		line-name = "FET_SWITCH_CTRL";
	};
};

&uart3 {
	pinctrl-names = "default";
	pinctrl-0 = <&uart3_pins_default>;
	status = "okay";
};
&uart4 {
        pinctrl-names = "default";
        pinctrl-0 = <&uart4_pins_default>;
        status = "okay";
};

&gpio3 {
	p4 {
		gpio-hog;
		gpios = <4 GPIO_ACTIVE_HIGH>;
		output-high;
		line-name = "PR1_MII_CTRL";
	};

	p10 {
		gpio-hog;
		gpios = <10 GPIO_ACTIVE_HIGH>;
		/* ETH1 mux: Low for MII-PRU, high for RMII-CPSW */
		output-high;
		line-name = "MUX_MII_CTL1";
	};
};

&mac {
	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&cpsw_default>;
	pinctrl-1 = <&cpsw_sleep>;
	dual_emac = <1>;
	mode-gpios = <&gpio3 13 GPIO_ACTIVE_LOW>;
	status = "okay";
};



&davinci_mdio {
	pinctrl-names = "default", "sleep";
	compatible = "ti, cpsw-mdio","ti,davinci_mdio";
	pinctrl-0 = <&davinci_mdio_default>;
	pinctrl-1 = <&davinci_mdio_sleep>;
	status = "okay";
	ti,rx-internal-delay = <DP83867_RGMIIDCTL_1_75_NS>;
	ti,tx-internal-delay = <DP83867_RGMIIDCTL_1_75_NS>;
	ti,fifo-depth = <DP83867_PHYCR_FIFO_DEPTH_4_B_NIB>;
	ti,min-output-impedance;
	ti,dp83867-rxctrl-strap-quirk;
};

&cpsw_emac0 {
	phy_id = <&davinci_mdio>, <0x0>;
	phy-mode = "rgmii-id";
	status = "okay";
};

&cpsw_emac1 {
	phy_id = <&davinci_mdio>, <0x0>;
	phy-mode = "rgmii-id";
	status = "okay";
};


&i2c1{
        compatible = "ti,omap4-i2c";
        #address-cells = <1>;
        #size-cells = <0>;
        ti,hwmods = "i2c2";
        reg = <0x4802a000 0x1000>;
        interrupts = <71>;
        status = "okay";
		ad7414@48 {
			compatible = "analog,ad7414";
        		reg = <0x48>;
      		  	status = "okay";
    			};
      };


&gpmc {
status = "okay";
pinctrl-names = "default";
/*pinctrl-0 = <&gpmc_pins>;*/
ranges = <0 0 0x08000000 0x10000000>; /* CS0: NAND */
nand@0,0 {
reg = <0 0 0>; /* CS0, offset 0 */
ti,nand-ecc-opt = "bch8";
ti,elm-id = <&elm>;
nand-bus-width = <8>;
gpmc,device-width = <1>;
gpmc,sync-clk-ps = <0>;
gpmc,cs-on-ns = <0>;
gpmc,cs-rd-off-ns = <44>;
gpmc,cs-wr-off-ns = <44>;
gpmc,adv-on-ns = <6>;
gpmc,adv-rd-off-ns = <34>;
gpmc,adv-wr-off-ns = <44>;
gpmc,we-on-ns = <0>;
gpmc,we-off-ns = <40>;
gpmc,oe-on-ns = <0>;
gpmc,oe-off-ns = <54>;
gpmc,access-ns = <64>;
gpmc,rd-cycle-ns = <82>;
gpmc,wr-cycle-ns = <82>;
gpmc,wait-on-read = "true";
gpmc,wait-on-write = "true";
gpmc,bus-turnaround-ns = <0>;
gpmc,cycle2cycle-delay-ns = <0>;
gpmc,clk-activation-ns = <0>;
gpmc,wait-monitoring-ns = <0>;
gpmc,wr-access-ns = <40>;
gpmc,wr-data-mux-bus-ns = <0>;
/* MTD partition table */
/* All SPL-* partitions are sized to minimal length
* which can be independently programmable. For
* NAND flash this is equal to size of erase-block */
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "NAND.SPL";
reg = <0x00000000 0x000020000>;
};
partition@1 {
label = "NAND.SPL.backup1";
reg = <0x00020000 0x00020000>;
};
partition@2 {
label = "NAND.SPL.backup2";
reg = <0x00040000 0x00020000>;
};
partition@3 {
label = "NAND.SPL.backup3";
reg = <0x00060000 0x00020000>;
};
partition@4 {
label = "NAND.u-boot-spl-os";
reg = <0x00080000 0x00040000>;
};
partition@5 {
label = "NAND.u-boot";
reg = <0x000C0000 0x00100000>;
};
partition@6 {
label = "NAND.u-boot-env";
reg = <0x001C0000 0x00020000>;
};
partition@7 {
label = "NAND.kernel-dtb";
reg = <0x001E0000 0x00020000>;
};
partition@8 {
label = "NAND.kernel";
reg = <0x00200000 0x00800000>;
};
partition@9 {
label = "NAND.file-system";
reg = <0x00A00000 0x0F600000>;
};
};

fpga{
reg = <1 0 0x01000000>; /*CSn1*/

bank-width = <2>; /* GPMC_CONFIG1_DEVICESIZE(1) */

/*gpmc,burst-write;*/
/*gpmc,burst-read;*/
/*gpmc,burst-wrap;*/
gpmc,sync-read; /* GPMC_CONFIG1_READTYPE_ASYNC */
gpmc,sync-write; /* GPMC_CONFIG1_WRITETYPE_ASYNC */
gpmc,clk-activation-ns = <0>; /* GPMC_CONFIG1_CLKACTIVATIONTIME(2) */
gpmc,burst-length = <16>; /* GPMC_CONFIG1_PAGE_LEN(2) */
gpmc,mux-add-data = <2>; /* GPMC_CONFIG1_MUXTYPE(2) */

gpmc,sync-clk-ps = <20000>; /* CONFIG2 */

gpmc,cs-on-ns = <0>;
gpmc,cs-rd-off-ns = <100>;
gpmc,cs-wr-off-ns = <40>;

gpmc,adv-on-ns = <0>; /* CONFIG3 */
gpmc,adv-rd-off-ns = <20>;
gpmc,adv-wr-off-ns = <20>;

gpmc,we-on-ns = <20>; /* CONFIG4 */
gpmc,we-off-ns = <40>;
gpmc,oe-on-ns = <20>;
gpmc,oe-off-ns = <100>;

gpmc,page-burst-access-ns = <20>; /* CONFIG 5 */
gpmc,access-ns = <80>;
gpmc,rd-cycle-ns = <120>;
gpmc,wr-cycle-ns = <60>;
gpmc,wr-access-ns = <40>; /* CONFIG 6 */
gpmc,wr-data-mux-bus-ns = <20>;

/*gpmc,bus-turnaround-ns = <40>;*/ /* CONFIG6:3:0 = 4 */
gpmc,cycle2cycle-samecsen; /* CONFIG6:7 = 1 */
gpmc,cycle2cycle-delay-ns = <20>; /* CONFIG6:11:8 = 4 */

/* not using dma engine yet, but we can get the channel number here */
dmas = <&edma 1>;
dma-names = "cscdma";

};
};

Will the pinmuxing in dts file be enough?Or should I also do the pinmuxing in /board/ti/am335x/mux.c?

Regards,

Murugan S

  • Hello Murugan,

    You must modify the pinmux in both places.

    Best regards,
    Kemal

  • Hi Kemal,
    I appreciate the quick response.I am little bit confused about pin muxing in u-boot mux .c file .Can you tell which method is correct?

    Method 1:
    static struct module_pin_mux spi0_pin_mux[] = {
    {OFFSET(spi1_sclk), (MODE(0) | RXACTIVE | PULLUDEN)}, /* SPI0_SCLK */
    {OFFSET(spi1_d0), (MODE(0) | RXACTIVE |
    PULLUDEN | PULLUP_EN)}, /* SPI0_D0 */
    {OFFSET(spi1_d1), (MODE(0) | RXACTIVE | PULLUDEN)}, /* SPI0_D1 */
    {OFFSET(spi1_cs0), (MODE(0) | RXACTIVE |
    PULLUDEN | PULLUP_EN)}, /* SPI0_CS0 */
    {-1},
    };

    Here i could not figure out where values of spi1_sclk,spi1_d0,spi1_d1 etc are defined.I could only find a struct with these variables declared but not initiallized.So I tried this:

    Method 2:

    static struct module_pin_mux spi1_pin_mux[] = {
    {0x990, (MODE(3) | RXACTIVE | PULLUDEN)}, /* SPI0_SCLK */
    {0x994, (MODE(3) | RXACTIVE |
    PULLUDEN | PULLUP_EN)}, /* SPI0_D0 */
    {0x998, (MODE(3) | RXACTIVE | PULLUDEN)}, /* SPI0_D1 */
    {0x99c, (MODE(3) | RXACTIVE |
    PULLUDEN | PULLUP_EN)}, /* SPI0_CS0 */
    {-1},
    };


    Regards,
    Murugan S
  • The correct method is.

    static struct module_pin_mux spi1_pin_mux[] = {
        {OFFSET(mcasp0_aclkx), (MODE(3) | RXACTIVE | PULLUDEN)},    /* SPI1_SCLK */
        {OFFSET(mcasp0_fsx), (MODE(3) | RXACTIVE |
                PULLUDEN | PULLUP_EN)},            /* SPI1_D0 */
        {OFFSET(mcasp0_axr0), (MODE(3) | RXACTIVE | PULLUDEN)},    /* SPI1_D1 */
        {OFFSET(mcasp0_ahclkr), (MODE(3) | RXACTIVE |
                PULLUDEN | PULLUP_EN)},            /* SPI1_CS0 */
        {-1},
    };

    Also in your device tree you must change the pinctrl-0 = <&spi0_pins_default>; in &spi1 node to pinctrl-0 = <&spi1_pins_default>;.

  • Hi Kemal,

                                   I made the changes you suggested.When i try to probe uboot is crashing and resetting.

    U-boot log:

    => sf probe

    SF: Detected w25q64cv with page size 256 Bytes, erase size 4 KiB, total 8 MiB

    => sf probe 1:0

    data abort

    pc : [<9ff56e90>]          lr : [<9ff4e163>]

    reloc pc : [<8082ee90>]    lr : [<80826163>]

    sp : 9defe228  ip : 9df50574     fp : 00000003

    r10: 00000000  r9 : 9df07ed8     r8 : 00000003

    r7 : 016e3600  r6 : 00000000     r5 : 9df50930  r4 : 9df50930

    r3 : 481a0100  r2 : 00000002     r1 : 00000000  r0 : 9df50930

    Flags: nzCv  IRQs off  FIQs on  Mode SVC_32

    Resetting CPU ...

    resetting ...

                                    mux.c file :

    /*
     * mux.c
     *
     * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
     *
     * This program is free software; you can redistribute it and/or
     * modify it under the terms of the GNU General Public License as
     * published by the Free Software Foundation version 2.
     *
     * This program is distributed "as is" WITHOUT ANY WARRANTY of any
     * kind, whether express or implied; without even the implied warranty
     * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
     * GNU General Public License for more details.
     */
    
    #include <common.h>
    #include <asm/arch/sys_proto.h>
    #include <asm/arch/hardware.h>
    #include <asm/arch/mux.h>
    #include <asm/io.h>
    #include <i2c.h>
    #include "../common/board_detect.h"
    #include "board.h"
    
    static struct module_pin_mux uart0_pin_mux[] = {
    	{OFFSET(uart0_rxd), (MODE(0) | PULLUP_EN | RXACTIVE)},	/* UART0_RXD */
    	{OFFSET(uart0_txd), (MODE(0) | PULLUDEN)},		/* UART0_TXD */
    	{-1},
    };
    
    static struct module_pin_mux uart1_pin_mux[] = {
    	{OFFSET(uart1_rxd), (MODE(0) | PULLUP_EN | RXACTIVE)},	/* UART1_RXD */
    	{OFFSET(uart1_txd), (MODE(0) | PULLUDEN)},		/* UART1_TXD */
    	{-1},
    };
    
    static struct module_pin_mux uart2_pin_mux[] = {
    	{OFFSET(spi0_sclk), (MODE(1) | PULLUP_EN | RXACTIVE)},	/* UART2_RXD */
    	{OFFSET(spi0_d0), (MODE(1) | PULLUDEN)},		/* UART2_TXD */
    	{-1},
    };
    
    static struct module_pin_mux uart3_pin_mux[] = {
    	{OFFSET(spi0_cs1), (MODE(1) | PULLUP_EN | RXACTIVE)},	/* UART3_RXD */
    	{OFFSET(ecap0_in_pwm0_out), (MODE(1) | PULLUDEN)},	/* UART3_TXD */
    	{-1},
    };
    
    static struct module_pin_mux uart4_pin_mux[] = {
    	{OFFSET(gpmc_wait0), (MODE(6) | PULLUP_EN | RXACTIVE)},	/* UART4_RXD */
    	{OFFSET(gpmc_wpn), (MODE(6) | PULLUDEN)},		/* UART4_TXD */
    	{-1},
    };
    
    static struct module_pin_mux uart5_pin_mux[] = {
    	{OFFSET(lcd_data9), (MODE(4) | PULLUP_EN | RXACTIVE)},	/* UART5_RXD */
    	{OFFSET(lcd_data8), (MODE(4) | PULLUDEN)},		/* UART5_TXD */
    	{-1},
    };
    
    static struct module_pin_mux mmc0_pin_mux[] = {
    	{OFFSET(mmc0_dat3), (MODE(0) | RXACTIVE | PULLUP_EN)},	/* MMC0_DAT3 */
    	{OFFSET(mmc0_dat2), (MODE(0) | RXACTIVE | PULLUP_EN)},	/* MMC0_DAT2 */
    	{OFFSET(mmc0_dat1), (MODE(0) | RXACTIVE | PULLUP_EN)},	/* MMC0_DAT1 */
    	{OFFSET(mmc0_dat0), (MODE(0) | RXACTIVE | PULLUP_EN)},	/* MMC0_DAT0 */
    	{OFFSET(mmc0_clk), (MODE(0) | RXACTIVE | PULLUP_EN)},	/* MMC0_CLK */
    	{OFFSET(mmc0_cmd), (MODE(0) | RXACTIVE | PULLUP_EN)},	/* MMC0_CMD */
    	{OFFSET(mcasp0_aclkr), (MODE(4) | RXACTIVE)},		/* MMC0_WP */
    	{OFFSET(spi0_cs1), (MODE(7) | RXACTIVE | PULLUP_EN)},	/* GPIO0_6 */
    	{-1},
    };
    
    static struct module_pin_mux mmc0_no_cd_pin_mux[] = {
    	{OFFSET(mmc0_dat3), (MODE(0) | RXACTIVE | PULLUP_EN)},	/* MMC0_DAT3 */
    	{OFFSET(mmc0_dat2), (MODE(0) | RXACTIVE | PULLUP_EN)},	/* MMC0_DAT2 */
    	{OFFSET(mmc0_dat1), (MODE(0) | RXACTIVE | PULLUP_EN)},	/* MMC0_DAT1 */
    	{OFFSET(mmc0_dat0), (MODE(0) | RXACTIVE | PULLUP_EN)},	/* MMC0_DAT0 */
    	{OFFSET(mmc0_clk), (MODE(0) | RXACTIVE | PULLUP_EN)},	/* MMC0_CLK */
    	{OFFSET(mmc0_cmd), (MODE(0) | RXACTIVE | PULLUP_EN)},	/* MMC0_CMD */
    	{OFFSET(mcasp0_aclkr), (MODE(4) | RXACTIVE)},		/* MMC0_WP */
    	{-1},
    };
    
    static struct module_pin_mux mmc0_pin_mux_sk_evm[] = {
    	{OFFSET(mmc0_dat3), (MODE(0) | RXACTIVE | PULLUP_EN)},	/* MMC0_DAT3 */
    	{OFFSET(mmc0_dat2), (MODE(0) | RXACTIVE | PULLUP_EN)},	/* MMC0_DAT2 */
    	{OFFSET(mmc0_dat1), (MODE(0) | RXACTIVE | PULLUP_EN)},	/* MMC0_DAT1 */
    	{OFFSET(mmc0_dat0), (MODE(0) | RXACTIVE | PULLUP_EN)},	/* MMC0_DAT0 */
    	{OFFSET(mmc0_clk), (MODE(0) | RXACTIVE | PULLUP_EN)},	/* MMC0_CLK */
    	{OFFSET(mmc0_cmd), (MODE(0) | RXACTIVE | PULLUP_EN)},	/* MMC0_CMD */
    	{OFFSET(spi0_cs1), (MODE(5) | RXACTIVE | PULLUP_EN)},	/* MMC0_CD */
    	{-1},
    };
    
    static struct module_pin_mux mmc1_pin_mux[] = {
    	{OFFSET(gpmc_ad3), (MODE(1) | RXACTIVE | PULLUP_EN)},	/* MMC1_DAT3 */
    	{OFFSET(gpmc_ad2), (MODE(1) | RXACTIVE | PULLUP_EN)},	/* MMC1_DAT2 */
    	{OFFSET(gpmc_ad1), (MODE(1) | RXACTIVE | PULLUP_EN)},	/* MMC1_DAT1 */
    	{OFFSET(gpmc_ad0), (MODE(1) | RXACTIVE | PULLUP_EN)},	/* MMC1_DAT0 */
    	{OFFSET(gpmc_csn1), (MODE(2) | RXACTIVE | PULLUP_EN)},	/* MMC1_CLK */
    	{OFFSET(gpmc_csn2), (MODE(2) | RXACTIVE | PULLUP_EN)},	/* MMC1_CMD */
    	{OFFSET(gpmc_csn0), (MODE(7) | RXACTIVE | PULLUP_EN)},	/* MMC1_WP */
    	{OFFSET(gpmc_advn_ale), (MODE(7) | RXACTIVE | PULLUP_EN)},	/* MMC1_CD */
    	{-1},
    };
    
    static struct module_pin_mux i2c0_pin_mux[] = {
    	{OFFSET(i2c0_sda), (MODE(0) | RXACTIVE |
    			PULLUDEN | SLEWCTRL)}, /* I2C_DATA */
    	{OFFSET(i2c0_scl), (MODE(0) | RXACTIVE |
    			PULLUDEN | SLEWCTRL)}, /* I2C_SCLK */
    	{-1},
    };
    
    static struct module_pin_mux i2c1_pin_mux[] = {
    	{OFFSET(spi0_d1), (MODE(2) | RXACTIVE |
    			PULLUDEN | SLEWCTRL)},	/* I2C_DATA */
    	{OFFSET(spi0_cs0), (MODE(2) | RXACTIVE |
    			PULLUDEN | SLEWCTRL)},	/* I2C_SCLK */
    	{-1},
    };
    
    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},
    };
    
    
    static struct module_pin_mux spi1_pin_mux[] = {
    	{OFFSET(mcasp0_aclkx), (MODE(3) | RXACTIVE | PULLUDEN)},	/* SPI1_SCLK */
    	{OFFSET(mcasp0_fsx), (MODE(3) | RXACTIVE |
    			PULLUDEN | PULLUP_EN)},			/* SPI1_D0 */
    	{OFFSET(mcasp0_axr0), (MODE(3) | RXACTIVE | PULLUDEN)},	/* SPI1_D1 */
    	{OFFSET(mcasp0_ahclkr), (MODE(3) | RXACTIVE |
    			PULLUDEN | PULLUP_EN)},			/* SPI1_CS0 */
    	{-1},
    };
    
    
    static struct module_pin_mux gpio0_7_pin_mux[] = {
    	{OFFSET(ecap0_in_pwm0_out), (MODE(7) | PULLUDEN)},	/* GPIO0_7 */
    	{-1},
    };
    
    static struct module_pin_mux gpio0_18_pin_mux[] = {
    	{OFFSET(usb0_drvvbus), (MODE(7) | PULLUDEN)},	/* GPIO0_18 */
    	{-1},
    };
    /*added by astra*/
    static struct module_pin_mux gpio3_13_pin_mux[] = {
            {OFFSET(usb1_drvvbus), (MODE(7) | ((PIN_PULL_TYPE_SEL) & (~PIN_PULL_UD_EN & ~PIN_RX_ACTIVE)))},   /* GPIO3_13 */
            {-1},
    };
    
    
    static struct module_pin_mux rgmii1_pin_mux[] = {
    	{OFFSET(mii1_txen), MODE(2)},			/* RGMII1_TCTL */
    	{OFFSET(mii1_rxdv), MODE(2) | RXACTIVE},	/* RGMII1_RCTL */
    	{OFFSET(mii1_txd3), MODE(2)},			/* RGMII1_TD3 */
    	{OFFSET(mii1_txd2), MODE(2)},			/* RGMII1_TD2 */
    	{OFFSET(mii1_txd1), MODE(2)},			/* RGMII1_TD1 */
    	{OFFSET(mii1_txd0), MODE(2)},			/* RGMII1_TD0 */
    	{OFFSET(mii1_txclk), MODE(2)},			/* RGMII1_TCLK */
    	{OFFSET(mii1_rxclk), MODE(2) | RXACTIVE},	/* RGMII1_RCLK */
    	{OFFSET(mii1_rxd3), MODE(2) | RXACTIVE},	/* RGMII1_RD3 */
    	{OFFSET(mii1_rxd2), MODE(2) | RXACTIVE},	/* RGMII1_RD2 */
    	{OFFSET(mii1_rxd1), MODE(2) | RXACTIVE},	/* RGMII1_RD1 */
    	{OFFSET(mii1_rxd0), MODE(2) | RXACTIVE},	/* RGMII1_RD0 */
    	{OFFSET(mdio_data), MODE(0) | RXACTIVE | PULLUP_EN},/* MDIO_DATA */
    	{OFFSET(mdio_clk), MODE(0) | PULLUP_EN},	/* MDIO_CLK */
    	{OFFSET(mdio_clk), MODE(0) | PULLUP_EN},	/* MDIO_CLK */
    	
    	{-1},
    };
    
    static struct module_pin_mux mii1_pin_mux[] = {
    	{OFFSET(mii1_rxerr), MODE(0) | RXACTIVE},	/* MII1_RXERR */
    	{OFFSET(mii1_txen), MODE(0)},			/* MII1_TXEN */
    	{OFFSET(mii1_rxdv), MODE(0) | RXACTIVE},	/* MII1_RXDV */
    	{OFFSET(mii1_txd3), MODE(0)},			/* MII1_TXD3 */
    	{OFFSET(mii1_txd2), MODE(0)},			/* MII1_TXD2 */
    	{OFFSET(mii1_txd1), MODE(0)},			/* MII1_TXD1 */
    	{OFFSET(mii1_txd0), MODE(0)},			/* MII1_TXD0 */
    	{OFFSET(mii1_txclk), MODE(0) | RXACTIVE},	/* MII1_TXCLK */
    	{OFFSET(mii1_rxclk), MODE(0) | RXACTIVE},	/* MII1_RXCLK */
    	{OFFSET(mii1_rxd3), MODE(0) | RXACTIVE},	/* MII1_RXD3 */
    	{OFFSET(mii1_rxd2), MODE(0) | RXACTIVE},	/* MII1_RXD2 */
    	{OFFSET(mii1_rxd1), MODE(0) | RXACTIVE},	/* MII1_RXD1 */
    	{OFFSET(mii1_rxd0), MODE(0) | RXACTIVE},	/* MII1_RXD0 */
    	{OFFSET(mdio_data), MODE(0) | RXACTIVE | PULLUP_EN}, /* MDIO_DATA */
    	{OFFSET(mdio_clk), MODE(0) | PULLUP_EN},	/* MDIO_CLK */
    	{-1},
    };
    
    static struct module_pin_mux rmii1_pin_mux[] = {
    	{OFFSET(mdio_clk), MODE(0) | PULLUP_EN},	/* MDIO_CLK */
    	{OFFSET(mdio_data), MODE(0) | RXACTIVE | PULLUP_EN}, /* MDIO_DATA */
    	{OFFSET(mii1_crs), MODE(1) | RXACTIVE},		/* MII1_CRS */
    	{OFFSET(mii1_rxerr), MODE(1) | RXACTIVE},	/* MII1_RXERR */
    	{OFFSET(mii1_txen), MODE(1)},			/* MII1_TXEN */
    	{OFFSET(mii1_txd1), MODE(1)},			/* MII1_TXD1 */
    	{OFFSET(mii1_txd0), MODE(1)},			/* MII1_TXD0 */
    	{OFFSET(mii1_rxd1), MODE(1) | RXACTIVE},	/* MII1_RXD1 */
    	{OFFSET(mii1_rxd0), MODE(1) | RXACTIVE},	/* MII1_RXD0 */
    	{OFFSET(rmii1_refclk), MODE(0) | RXACTIVE},	/* RMII1_REFCLK */
    	{-1},
    };
    
    #ifdef CONFIG_NAND
    static struct module_pin_mux nand_pin_mux[] = {
    	{OFFSET(gpmc_ad0),	(MODE(0) | PULLUDDIS | RXACTIVE)}, /* AD0  */
    	{OFFSET(gpmc_ad1),	(MODE(0) | PULLUDDIS | RXACTIVE)}, /* AD1  */
    	{OFFSET(gpmc_ad2),	(MODE(0) | PULLUDDIS | RXACTIVE)}, /* AD2  */
    	{OFFSET(gpmc_ad3),	(MODE(0) | PULLUDDIS | RXACTIVE)}, /* AD3  */
    	{OFFSET(gpmc_ad4),	(MODE(0) | PULLUDDIS | RXACTIVE)}, /* AD4  */
    	{OFFSET(gpmc_ad5),	(MODE(0) | PULLUDDIS | RXACTIVE)}, /* AD5  */
    	{OFFSET(gpmc_ad6),	(MODE(0) | PULLUDDIS | RXACTIVE)}, /* AD6  */
    	{OFFSET(gpmc_ad7),	(MODE(0) | PULLUDDIS | RXACTIVE)}, /* AD7  */
    #ifdef CONFIG_SYS_NAND_BUSWIDTH_16BIT
    	{OFFSET(gpmc_ad8),	(MODE(0) | PULLUDDIS | RXACTIVE)}, /* AD8  */
    	{OFFSET(gpmc_ad9),	(MODE(0) | PULLUDDIS | RXACTIVE)}, /* AD9  */
    	{OFFSET(gpmc_ad10),	(MODE(0) | PULLUDDIS | RXACTIVE)}, /* AD10 */
    	{OFFSET(gpmc_ad11),	(MODE(0) | PULLUDDIS | RXACTIVE)}, /* AD11 */
    	{OFFSET(gpmc_ad12),	(MODE(0) | PULLUDDIS | RXACTIVE)}, /* AD12 */
    	{OFFSET(gpmc_ad13),	(MODE(0) | PULLUDDIS | RXACTIVE)}, /* AD13 */
    	{OFFSET(gpmc_ad14),	(MODE(0) | PULLUDDIS | RXACTIVE)}, /* AD14 */
    	{OFFSET(gpmc_ad15),	(MODE(0) | PULLUDDIS | RXACTIVE)}, /* AD15 */
    #endif
    	{OFFSET(gpmc_wait0),	(MODE(0) | PULLUP_EN | RXACTIVE)}, /* nWAIT */
    	{OFFSET(gpmc_wpn),	(MODE(7) | PULLUP_EN)},		   /* nWP */
    	{OFFSET(gpmc_csn0),	(MODE(0) | PULLUP_EN)},		   /* nCS */
    	{OFFSET(gpmc_wen),	(MODE(0) | PULLDOWN_EN)},	   /* WEN */
    	{OFFSET(gpmc_oen_ren),	(MODE(0) | PULLDOWN_EN)},	   /* OE */
    	{OFFSET(gpmc_advn_ale),	(MODE(0) | PULLDOWN_EN)},	   /* ADV_ALE */
    	{OFFSET(gpmc_be0n_cle),	(MODE(0) | PULLDOWN_EN)},	   /* BE_CLE */
    	{-1},
    };
    #elif defined(CONFIG_NOR)
    static struct module_pin_mux bone_norcape_pin_mux[] = {
    	{OFFSET(gpmc_a0), MODE(0) | PULLUDDIS},			/* NOR_A0 */
    	{OFFSET(gpmc_a1), MODE(0) | PULLUDDIS},			/* NOR_A1 */
    	{OFFSET(gpmc_a2), MODE(0) | PULLUDDIS},			/* NOR_A2 */
    	{OFFSET(gpmc_a3), MODE(0) | PULLUDDIS},			/* NOR_A3 */
    	{OFFSET(gpmc_a4), MODE(0) | PULLUDDIS},			/* NOR_A4 */
    	{OFFSET(gpmc_a5), MODE(0) | PULLUDDIS},			/* NOR_A5 */
    	{OFFSET(gpmc_a6), MODE(0) | PULLUDDIS},			/* NOR_A6 */
    	{OFFSET(gpmc_a7), MODE(0) | PULLUDDIS},			/* NOR_A7 */
    	{OFFSET(gpmc_ad0), MODE(0) | PULLUDDIS | RXACTIVE},	/* NOR_AD0 */
    	{OFFSET(gpmc_ad1), MODE(0) | PULLUDDIS | RXACTIVE},	/* NOR_AD1 */
    	{OFFSET(gpmc_ad2), MODE(0) | PULLUDDIS | RXACTIVE},	/* NOR_AD2 */
    	{OFFSET(gpmc_ad3), MODE(0) | PULLUDDIS | RXACTIVE},	/* NOR_AD3 */
    	{OFFSET(gpmc_ad4), MODE(0) | PULLUDDIS | RXACTIVE},	/* NOR_AD4 */
    	{OFFSET(gpmc_ad5), MODE(0) | PULLUDDIS | RXACTIVE},	/* NOR_AD5 */
    	{OFFSET(gpmc_ad6), MODE(0) | PULLUDDIS | RXACTIVE},	/* NOR_AD6 */
    	{OFFSET(gpmc_ad7), MODE(0) | PULLUDDIS | RXACTIVE},	/* NOR_AD7 */
    	{OFFSET(gpmc_ad8), MODE(0) | PULLUDDIS | RXACTIVE},	/* NOR_AD8 */
    	{OFFSET(gpmc_ad9), MODE(0) | PULLUDDIS | RXACTIVE},	/* NOR_AD9 */
    	{OFFSET(gpmc_ad10), MODE(0) | PULLUDDIS | RXACTIVE},	/* NOR_AD10 */
    	{OFFSET(gpmc_ad11), MODE(0) | PULLUDDIS | RXACTIVE},	/* NOR_AD11 */
    	{OFFSET(gpmc_ad12), MODE(0) | PULLUDDIS | RXACTIVE},	/* NOR_AD12 */
    	{OFFSET(gpmc_ad13), MODE(0) | PULLUDDIS | RXACTIVE},	/* NOR_AD13 */
    	{OFFSET(gpmc_ad14), MODE(0) | PULLUDDIS | RXACTIVE},	/* NOR_AD14 */
    	{OFFSET(gpmc_ad15), MODE(0) | PULLUDDIS | RXACTIVE},	/* NOR_AD15 */
    	{OFFSET(gpmc_csn0), MODE(0) | PULLUDEN | PULLUP_EN},     /* CE */
    	{OFFSET(gpmc_advn_ale), MODE(0) | PULLUDEN | PULLDOWN_EN}, /* ALE */
    	{OFFSET(gpmc_oen_ren), MODE(0) | PULLUDEN | PULLDOWN_EN},/* OEn_REN */
    	{OFFSET(gpmc_be0n_cle), MODE(0) | PULLUDEN | PULLDOWN_EN},/* unused */
    	{OFFSET(gpmc_wen), MODE(0) | PULLUDEN | PULLDOWN_EN},    /* WEN */
    	{OFFSET(gpmc_wait0), MODE(0) | PULLUDEN | PULLUP_EN | RXACTIVE},/*WAIT*/
    	{-1},
    };
    #endif
    
    static struct module_pin_mux uart3_icev2_pin_mux[] = {
    	{OFFSET(mii1_rxd3), (MODE(1) | PULLUP_EN | RXACTIVE)},	/* UART3_RXD */
    	{OFFSET(mii1_rxd2), MODE(1) | PULLUDEN},		/* UART3_TXD */
    	{-1},
    };
    
    #if defined(CONFIG_NOR_BOOT)
    void enable_norboot_pin_mux(void)
    {
    	configure_module_pin_mux(bone_norcape_pin_mux);
    }
    #endif
    
    void enable_uart0_pin_mux(void)
    {
    	configure_module_pin_mux(uart0_pin_mux);
    }
    
    void enable_uart1_pin_mux(void)
    {
    	configure_module_pin_mux(uart1_pin_mux);
    }
    
    void enable_uart2_pin_mux(void)
    {
    	configure_module_pin_mux(uart2_pin_mux);
    }
    
    void enable_uart3_pin_mux(void)
    {
    	configure_module_pin_mux(uart3_pin_mux);
    }
    
    void enable_uart4_pin_mux(void)
    {
    	configure_module_pin_mux(uart4_pin_mux);
    }
    
    void enable_uart5_pin_mux(void)
    {
    	configure_module_pin_mux(uart5_pin_mux);
    }
    
    void enable_i2c0_pin_mux(void)
    {
    	configure_module_pin_mux(i2c0_pin_mux);
    }
    
    /*
     * The AM335x GP EVM, if daughter card(s) are connected, can have 8
     * different profiles.  These profiles determine what peripherals are
     * valid and need pinmux to be configured.
     */
    #define PROFILE_NONE	0x0
    #define PROFILE_0	(1 << 0)
    #define PROFILE_1	(1 << 1)
    #define PROFILE_2	(1 << 2)
    #define PROFILE_3	(1 << 3)
    #define PROFILE_4	(1 << 4)
    #define PROFILE_5	(1 << 5)
    #define PROFILE_6	(1 << 6)
    #define PROFILE_7	(1 << 7)
    #define PROFILE_MASK	0x7
    #define PROFILE_ALL	0xFF
    
    /* CPLD registers */
    #define I2C_CPLD_ADDR	0x35
    #define CFG_REG		0x10
    
    static unsigned short detect_daughter_board_profile(void)
    {
    	unsigned short val;
    
    	if (i2c_probe(I2C_CPLD_ADDR))
    		return PROFILE_NONE;
    
    	if (i2c_read(I2C_CPLD_ADDR, CFG_REG, 1, (unsigned char *)(&val), 2))
    		return PROFILE_NONE;
    
    	return (1 << (val & PROFILE_MASK));
    }
    
    void enable_board_pin_mux(void)
    {
    	/* Do board-specific muxes. */
    	if (board_is_bone()) {
    		/* Beaglebone pinmux */
    		configure_module_pin_mux(mii1_pin_mux);
    		configure_module_pin_mux(mmc0_pin_mux);
    #if defined(CONFIG_NAND)
    		configure_module_pin_mux(nand_pin_mux);
    #elif defined(CONFIG_NOR)
    		configure_module_pin_mux(bone_norcape_pin_mux);
    #else
    		configure_module_pin_mux(mmc1_pin_mux);
    #endif
    	} else if (board_is_gp_evm()) {
    		/* General Purpose EVM */
    		unsigned short profile = detect_daughter_board_profile();
    		configure_module_pin_mux(rgmii1_pin_mux);
    		configure_module_pin_mux(mmc0_pin_mux);
    		/* In profile #2 i2c1 and spi0 conflict. */
    		if (profile & ~PROFILE_2)
    			configure_module_pin_mux(i2c1_pin_mux);
    		/* Profiles 2 & 3 don't have NAND */
    #ifdef CONFIG_NAND
    		if (profile & ~(PROFILE_2 | PROFILE_3))
    			configure_module_pin_mux(nand_pin_mux);
    #endif
    		else if (profile == PROFILE_2) {
    			configure_module_pin_mux(mmc1_pin_mux);
    			configure_module_pin_mux(spi0_pin_mux);
    		}
    	} else if (board_is_idk()) {
    		/* Industrial Motor Control (IDK) */
    		configure_module_pin_mux(mii1_pin_mux);
    		configure_module_pin_mux(mmc0_no_cd_pin_mux);
    	} else if (board_is_evm_sk()) {
    		/* Starter Kit EVM */
    		configure_module_pin_mux(i2c1_pin_mux);
    		configure_module_pin_mux(gpio0_7_pin_mux);
    		configure_module_pin_mux(rgmii1_pin_mux);
    		configure_module_pin_mux(mmc0_pin_mux_sk_evm);
    	} else if (board_is_bone_lt()) {
    		/* Beaglebone LT pinmux */
    		configure_module_pin_mux(mii1_pin_mux);
    		configure_module_pin_mux(mmc0_pin_mux);
    #if defined(CONFIG_NAND) && defined(CONFIG_EMMC_BOOT)
    		configure_module_pin_mux(nand_pin_mux);
    #elif defined(CONFIG_NOR) && defined(CONFIG_EMMC_BOOT)
    		configure_module_pin_mux(bone_norcape_pin_mux);
    #else
    		configure_module_pin_mux(mmc1_pin_mux);
    #endif
    	} else if (board_is_icev2()) {
    		configure_module_pin_mux(mmc0_pin_mux);
    		configure_module_pin_mux(gpio3_13_pin_mux);
    		configure_module_pin_mux(uart3_icev2_pin_mux);
    		configure_module_pin_mux(rgmii1_pin_mux);
    		configure_module_pin_mux(spi0_pin_mux);
    		configure_module_pin_mux(spi1_pin_mux);
    	} else {
    		/* Unknown board. We might still be able to boot. */
    		puts("Bad EEPROM or unknown board, cannot configure pinmux.");
    	}
    
    

                                                new dts file:

    /*
     * Copyright (C) 2016 Texas Instruments Incorporated - http://www.ti.com/
     *
     * This program is free software; you can redistribute it and/or modify
     * it under the terms of the GNU General Public License version 2 as
     * published by the Free Software Foundation.
     */
    
    /*
     * AM335x ICE V2 board
     * http://www.ti.com/tool/tmdsice3359
     */
    
    /dts-v1/;
    
    #include "am33xx.dtsi"
    #include <dt-bindings/interrupt-controller/irq.h>
    #include <dt-bindings/net/ti-dp83867.h>
    
    / {
    	model = "TI AM3359 ICE-V2";
    	compatible = "ti,am3359-icev2", "ti,am33xx";
    
    	memory@80000000 {
    		device_type = "memory";
    		reg = <0x80000000 0x10000000>; /* 256 MB */
    	};
    
    	chosen {
    		stdout-path = &uart0;
    	};
    
    	vbat: fixedregulator0 {
    		compatible = "regulator-fixed";
    		regulator-name = "vbat";
    		regulator-min-microvolt = <5000000>;
    		regulator-max-microvolt = <5000000>;
    		regulator-boot-on;
    	};
    
    	vtt_fixed: fixedregulator1 {
    		compatible = "regulator-fixed";
    		regulator-name = "vtt";
    		regulator-min-microvolt = <1500000>;
    		regulator-max-microvolt = <1500000>;
    		gpio = <&gpio0 18 GPIO_ACTIVE_HIGH>;
    		regulator-always-on;
    		regulator-boot-on;
    		enable-active-high;
    	};
    
    	leds-iio {
    		status = "disabled";
    		compatible = "gpio-leds";
    		led-out0 {
    			label = "out0";
    			gpios = <&tpic2810 0 GPIO_ACTIVE_HIGH>;
    			default-state = "off";
    		};
    
    		led-out1 {
    			label = "out1";
    			gpios = <&tpic2810 1 GPIO_ACTIVE_HIGH>;
    			default-state = "off";
    		};
    
    		led-out2 {
    			label = "out2";
    			gpios = <&tpic2810 2 GPIO_ACTIVE_HIGH>;
    			default-state = "off";
    		};
    
    		led-out3 {
    			label = "out3";
    			gpios = <&tpic2810 3 GPIO_ACTIVE_HIGH>;
    			default-state = "off";
    		};
    
    		led-out4 {
    			label = "out4";
    			gpios = <&tpic2810 4 GPIO_ACTIVE_HIGH>;
    			default-state = "off";
    		};
    
    		led-out5 {
    			label = "out5";
    			gpios = <&tpic2810 5 GPIO_ACTIVE_HIGH>;
    			default-state = "off";
    		};
    
    		led-out6 {
    			label = "out6";
    			gpios = <&tpic2810 6 GPIO_ACTIVE_HIGH>;
    			default-state = "off";
    		};
    
    		led-out7 {
    			label = "out7";
    			gpios = <&tpic2810 7 GPIO_ACTIVE_HIGH>;
    			default-state = "off";
    		};
    	};
    
    	/* Tricolor status LEDs */
    	leds1 {
    		compatible = "gpio-leds";
    		pinctrl-names = "default";
    		pinctrl-0 = <&user_leds>;
    
    		led0 {
    			label = "status0:red:cpu0";
    			gpios = <&gpio0 17 GPIO_ACTIVE_HIGH>;
    			default-state = "off";
    			linux,default-trigger = "cpu0";
    		};
    
    		led1 {
    			label = "status0:green:usr";
    			gpios = <&gpio0 16 GPIO_ACTIVE_HIGH>;
    			default-state = "off";
    		};
    
    		led2 {
    			label = "status0:yellow:usr";
    			gpios = <&gpio3 9 GPIO_ACTIVE_HIGH>;
    			default-state = "off";
    		};
    
    		led3 {
    			label = "status1:red:mmc0";
    			gpios = <&gpio1 30 GPIO_ACTIVE_HIGH>;
    			default-state = "off";
    			linux,default-trigger = "mmc0";
    		};
    
    		led4 {
    			label = "status1:green:usr";
    			gpios = <&gpio0 20 GPIO_ACTIVE_HIGH>;
    			default-state = "off";
    		};
    
    		led5 {
    			label = "status1:yellow:usr";
    			gpios = <&gpio0 19 GPIO_ACTIVE_HIGH>;
    			default-state = "off";
    		};
    	};
    	gpio-decoder {
    		compatible = "gpio-decoder";
    		gpios = <&pca9536 3 GPIO_ACTIVE_HIGH>,
    			<&pca9536 2 GPIO_ACTIVE_HIGH>,
    			<&pca9536 1 GPIO_ACTIVE_HIGH>,
    			<&pca9536 0 GPIO_ACTIVE_HIGH>;
    		linux,axis = <0>; /* ABS_X */
    		decoder-max-value = <9>;
    	};
    
    	/* Dual mac ethernet application node on icss */
    	/*pruss_eth {
    		compatible = "ti,am3359-prueth";
    		pruss = <&pruss>;
    		sram = <&ocmcram>;
    		interrupt-parent = <&pruss_intc>;
    		status = "disabled";
    
    		pinctrl-0 = <&pruss_eth_default>;
    		pinctrl-names = "default";
    
    		pruss_emac0: ethernet-mii0 {
    			phy-handle = <&pruss_eth0_phy>;
    			phy-mode = "mii";
    			interrupts = <20>, <22>;
    			interrupt-names = "rx", "tx";
    			/* Filled in by bootloader 
    			local-mac-address = [00 00 00 00 00 00];
    		};
    
    		pruss_emac1: ethernet-mii1 {
    			phy-handle = <&pruss_eth1_phy>;
    			phy-mode = "mii";
    			interrupts = <21>, <23>;
    			interrupt-names = "rx", "tx";
    			/* Filled in by bootloader 
    			local-mac-address = [00 00 00 00 00 00];
    		};
    	};*/
    };
    
    &am33xx_pinmux {
    	user_leds: user_leds {
    		pinctrl-single,pins = <
    			AM33XX_IOPAD(0x91c, PIN_OUTPUT | MUX_MODE7) /* (J18) gmii1_txd3.gpio0[16] */
    			AM33XX_IOPAD(0x920, PIN_OUTPUT | MUX_MODE7) /* (K15) gmii1_txd2.gpio0[17] */
    			AM33XX_IOPAD(0x9b0, PIN_OUTPUT | MUX_MODE7) /* (A15) xdma_event_intr0.gpio0[19] */
    			AM33XX_IOPAD(0x9b4, PIN_OUTPUT | MUX_MODE7) /* (D14) xdma_event_intr1.gpio0[20] */
    			AM33XX_IOPAD(0x880, PIN_OUTPUT | MUX_MODE7) /* (U9) gpmc_csn1.gpio1[30] */
    			AM33XX_IOPAD(0x92c, PIN_OUTPUT | MUX_MODE7) /* (K18) gmii1_txclk.gpio3[9] */
    		>;
    	};
    
    	mmc0_pins_default: mmc0_pins_default {
    		pinctrl-single,pins = <
    			AM33XX_IOPAD(0x8f0, PIN_INPUT_PULLUP | MUX_MODE0) /* (F17) mmc0_dat3.mmc0_dat3 */
    			AM33XX_IOPAD(0x8f4, PIN_INPUT_PULLUP | MUX_MODE0) /* (F18) mmc0_dat2.mmc0_dat2 */
    			AM33XX_IOPAD(0x8f8, PIN_INPUT_PULLUP | MUX_MODE0) /* (G15) mmc0_dat1.mmc0_dat1 */
    			AM33XX_IOPAD(0x8fc, PIN_INPUT_PULLUP | MUX_MODE0) /* (G16) mmc0_dat0.mmc0_dat0 */
    			AM33XX_IOPAD(0x900, PIN_INPUT_PULLUP | MUX_MODE0) /* (G17) mmc0_clk.mmc0_clk */
    			AM33XX_IOPAD(0x904, PIN_INPUT_PULLUP | MUX_MODE0) /* (G18) mmc0_cmd.mmc0_cmd */
    		>;
    	};
    
    	i2c0_pins_default: i2c0_pins_default {
    		pinctrl-single,pins = <
    			AM33XX_IOPAD(0x988, PIN_INPUT | MUX_MODE0) /* (C17) I2C0_SDA.I2C0_SDA */
    			AM33XX_IOPAD(0x98c, PIN_INPUT | MUX_MODE0) /* (C16) I2C0_SCL.I2C0_SCL */
    		>;
    	};
    
    	spi0_pins_default: spi0_pins_default {
    		pinctrl-single,pins = <
    			AM33XX_IOPAD(0x950, PIN_INPUT_PULLUP | MUX_MODE0) /* (A17) spi0_sclk.spi0_sclk */
    			AM33XX_IOPAD(0x954, PIN_INPUT_PULLUP | MUX_MODE0) /* (B17) spi0_d0.spi0_d0 */
    			AM33XX_IOPAD(0x958, PIN_INPUT_PULLUP | MUX_MODE0) /* (B16) spi0_d1.spi0_d1 */
    			AM33XX_IOPAD(0x95c, PIN_INPUT_PULLUP | MUX_MODE0) /* (A16) spi0_cs0.spi0_cs0 */
    			AM33XX_IOPAD(0x960, PIN_INPUT_PULLUP | MUX_MODE0) /* (C15) spi0_cs1.spi0_cs1 */
    			AM33XX_IOPAD(0x9a0, PIN_INPUT_PULLUP | MUX_MODE7) /* (B12) mcasp0_aclkr.gpio3[18] */
    		>;
    	};
    	
    	spi1_pins_default: spi1_pins_default {
                    pinctrl-single,pins = <
                    AM33XX_IOPAD(0x990, PIN_INPUT_PULLUP | MUX_MODE3) /* (A13) mcasp0_aclkx.spi1_sclk */
                    AM33XX_IOPAD(0x994, PIN_INPUT_PULLUP | MUX_MODE3) /* (B13) mcasp0_fsx.spi1_d0 */
                    AM33XX_IOPAD(0x998, PIN_INPUT_PULLUP | MUX_MODE3) /* (D12) mcasp0_axr0.spi1_d1 */
                    AM33XX_IOPAD(0x99c, PIN_INPUT_PULLUP | MUX_MODE3) /* (C12) mcasp0_ahclkr.spi1_cs0 */
                    >;
            };
    
    
    	uart3_pins_default: uart3_pins_default {
    		pinctrl-single,pins = <
    			AM33XX_IOPAD(0x934, PIN_INPUT_PULLUP | MUX_MODE1) /* (L17) gmii1_rxd3.uart3_rxd */
    			AM33XX_IOPAD(0x938, PIN_OUTPUT_PULLUP | MUX_MODE1) /* (L16) gmii1_rxd2.uart3_txd */
    		>;
    	};
    	
    	 uart4_pins_default: uart4_pins_default {
                    pinctrl-single,pins = <
                            AM33XX_IOPAD(0x870, PIN_INPUT_PULLUP | MUX_MODE6) /* (T17) gpmc_wait0.uart4_rxd */
                            AM33XX_IOPAD(0x874, PIN_OUTPUT_PULLUP | MUX_MODE6) /* (U17) gpmc_wpn.uart4_txd */
                    >;
            };
    
         cpsw_default: cpsw_default {
                    pinctrl-single,pins = <
                                    /* Slave 1 */
                    AM33XX_IOPAD(0x914, PIN_OUTPUT_PULLDOWN | MUX_MODE2)    /* mii1_txen.rgmii1_tctl */
                    AM33XX_IOPAD(0x918, PIN_INPUT_PULLDOWN | MUX_MODE2)     /* mii1_rxdv.rgmii1_rctl */
                    AM33XX_IOPAD(0x91c, PIN_OUTPUT_PULLDOWN | MUX_MODE2)    /* mii1_txd3.rgmii1_td3 */
                    AM33XX_IOPAD(0x920, PIN_OUTPUT_PULLDOWN | MUX_MODE2)    /* mii1_txd2.rgmii1_td2 */
                    AM33XX_IOPAD(0x924, PIN_OUTPUT_PULLDOWN | MUX_MODE2)    /* mii1_txd1.rgmii1_td1 */
                    AM33XX_IOPAD(0x928, PIN_OUTPUT_PULLDOWN | MUX_MODE2)/* mii1_txd0.rgmii1_td0 */
    
                    AM33XX_IOPAD(0x92c, PIN_OUTPUT_PULLDOWN | MUX_MODE2)    /* mii1_txclk.rgmii1_tclk */
                    AM33XX_IOPAD(0x930, PIN_INPUT_PULLDOWN | MUX_MODE2)     /* mii1_rxclk.rgmii1_rclk */
                    AM33XX_IOPAD(0x934, PIN_INPUT_PULLDOWN | MUX_MODE2)     /* mii1_rxd3.rgmii1_rd3 */
                    AM33XX_IOPAD(0x938, PIN_INPUT_PULLDOWN | MUX_MODE2)     /* mii1_rxd2.rgmii1_rd2 */
                    AM33XX_IOPAD(0x93c, PIN_INPUT_PULLDOWN | MUX_MODE2)     /* mii1_rxd1.rgmii1_rd1 */
                    AM33XX_IOPAD(0x940, PIN_INPUT_PULLDOWN | MUX_MODE2)     /* mii1_rxd0.rgmii1_rd0 */
                    AM33XX_IOPAD(0xA34, PIN_OUTPUT_PULLUP | MUX_MODE7) /* (F15) USB1_DRVVBUS.gpio3[13] */
            >;
            };
    
            cpsw_sleep: cpsw_sleep {
                    pinctrl-single,pins = <
                    AM33XX_IOPAD(0x914, (PIN_INPUT_PULLDOWN | MUX_MODE7) ) /* (J16) gmii1_txen.rgmii1_tctl */
                    AM33XX_IOPAD(0x918, (PIN_INPUT_PULLDOWN | MUX_MODE7) ) /* (J17) gmii1_rxdv.rgmii1_rctl */
                    AM33XX_IOPAD(0x92c, (PIN_INPUT_PULLDOWN | MUX_MODE7) ) /* (K18) gmii1_txclk.rgmii1_tclk */
                    AM33XX_IOPAD(0x930, (PIN_INPUT_PULLDOWN | MUX_MODE7)) /* (L18) gmii1_rxclk.rgmii1_rclk */
                    AM33XX_IOPAD(0x928, (PIN_INPUT_PULLDOWN | MUX_MODE7) ) /* (K17) gmii1_txd0.rgmii1_td0 */
                    AM33XX_IOPAD(0x924, (PIN_INPUT_PULLDOWN | MUX_MODE7) ) /* (K16) gmii1_txd1.rgmii1_td1 */
                    AM33XX_IOPAD(0x920, (PIN_INPUT_PULLDOWN | MUX_MODE7) ) /* (K15) gmii1_txd2.rgmii1_td2 */
                    AM33XX_IOPAD(0x91c, (PIN_INPUT_PULLDOWN | MUX_MODE7) ) /* (J18) gmii1_txd3.rgmii1_td3 */
                    AM33XX_IOPAD(0x940, (PIN_INPUT_PULLDOWN | MUX_MODE7) ) /* (M16) gmii1_rxd0.rgmii1_rd0 */
                    AM33XX_IOPAD(0x93c, (PIN_INPUT_PULLDOWN | MUX_MODE7) ) /* (L15) gmii1_rxd1.rgmii1_rd1 */
                    AM33XX_IOPAD(0x938, (PIN_INPUT_PULLDOWN | MUX_MODE7) ) /* (L16) gmii1_rxd2.rgmii1_rd2 */
                    AM33XX_IOPAD(0x934, (PIN_INPUT_PULLDOWN | MUX_MODE7) ) /* (L17) gmii1_rxd3.rgmii1_rd3 */
                    AM33XX_IOPAD(0xA34, PIN_OUTPUT_PULLDOWN | MUX_MODE7)    
    
                    >;
            };
    
            davinci_mdio_default: davinci_mdio_default {
                    pinctrl-single,pins = <
                            /* MDIO */
                            AM33XX_IOPAD(0x948, (PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0))     /* mdio_data.mdio_data */
                            AM33XX_IOPAD(0x94c, (PIN_OUTPUT_PULLUP | MUX_MODE0))                    /* mdio_clk.mdio_clk */
            
                    >;
            };
    
            davinci_mdio_sleep: davinci_mdio_sleep {
                    pinctrl-single,pins = <
                            /* MDIO reset value */
                            AM33XX_IOPAD(0x948, (PIN_INPUT_PULLDOWN | MUX_MODE7))
                            AM33XX_IOPAD(0x94c, (PIN_INPUT_PULLDOWN | MUX_MODE7))
                    >;
            };
    
    
    };
    
    &i2c0 {
    	pinctrl-names = "default";
    	pinctrl-0 = <&i2c0_pins_default>;
    
    	status = "okay";
    	clock-frequency = <400000>;
    
    	tps: power-controller@2d {
    		reg = <0x2d>;
    	};
    
    	tpic2810: gpio@60 {
    		compatible = "ti,tpic2810";
    		reg = <0x60>;
    		gpio-controller;
    		#gpio-cells = <2>;
    	};
    
    	pca9536: gpio@41 {
    		compatible = "ti,pca9536";
    		reg = <0x41>;
    		gpio-controller;
    		#gpio-cells = <2>;
    	};
    };
    
    &spi0 {
    	status = "okay";
    	pinctrl-names = "default";
    	pinctrl-0 = <&spi0_pins_default>;
    
    	sn65hvs882@1 {
    		compatible = "pisosr-gpio";
    		gpio-controller;
    		#gpio-cells = <2>;
    
    		load-gpios = <&gpio3 18 GPIO_ACTIVE_LOW>;
    
    		reg = <1>;
    		spi-max-frequency = <1000000>;
    		spi-cpol;
    	};
    
    	spi_nor: flash@0 {
    		#address-cells = <1>;
    		#size-cells = <1>;
    		compatible = "winbond,w25q64", "jedec,spi-nor";
    		spi-max-frequency = <80000000>;
    		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 0x660000>;
    		};
    	};
    
    };
    
    &spi1 {
    	status = "okay";
    	pinctrl-names = "default";
    	pinctrl-0 = <&spi1_pins_default>;
    
    	spi_nor1: flash@0 {
    		#address-cells = <1>;
    		#size-cells = <1>;
    		compatible = "winbond,w25q64", "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 0x660000>;
    		};
    	};
    
    };
    
    
    
    &tscadc {
    	status = "okay";
    	adc {
    		ti,adc-channels = <1 2 3 4 5 6 7>;
    	};
    };
    
    #include "tps65910.dtsi"
    
    &tps {
    	vcc1-supply = <&vbat>;
    	vcc2-supply = <&vbat>;
    	vcc3-supply = <&vbat>;
    	vcc4-supply = <&vbat>;
    	vcc5-supply = <&vbat>;
    	vcc6-supply = <&vbat>;
    	vcc7-supply = <&vbat>;
    	vccio-supply = <&vbat>;
    
    	regulators {
    		vrtc_reg: regulator@0 {
    			regulator-always-on;
    		};
    
    		vio_reg: regulator@1 {
    			regulator-always-on;
    		};
    
    		vdd1_reg: regulator@2 {
    			regulator-name = "vdd_mpu";
    			regulator-min-microvolt = <912500>;
    			regulator-max-microvolt = <1326000>;
    			regulator-boot-on;
    			regulator-always-on;
    		};
    
    		vdd2_reg: regulator@3 {
    			regulator-name = "vdd_core";
    			regulator-min-microvolt = <912500>;
    			regulator-max-microvolt = <1144000>;
    			regulator-boot-on;
    			regulator-always-on;
    		};
    
    		vdd3_reg: regulator@4 {
    			regulator-always-on;
    		};
    
    		vdig1_reg: regulator@5 {
    			regulator-always-on;
    		};
    
    		vdig2_reg: regulator@6 {
    			regulator-always-on;
    		};
    
    		vpll_reg: regulator@7 {
    			regulator-always-on;
    		};
    
    		vdac_reg: regulator@8 {
    			regulator-always-on;
    		};
    
    		vaux1_reg: regulator@9 {
    			regulator-always-on;
    		};
    
    		vaux2_reg: regulator@10 {
    			regulator-always-on;
    		};
    
    		vaux33_reg: regulator@11 {
    			regulator-always-on;
    		};
    
    		vmmc_reg: regulator@12 {
    			regulator-min-microvolt = <1800000>;
    			regulator-max-microvolt = <3300000>;
    			regulator-always-on;
    		};
    	};
    };
    
    &mmc1 {
    	status = "okay";
    	vmmc-supply = <&vmmc_reg>;
    	bus-width = <4>;
    	pinctrl-names = "default";
    	pinctrl-0 = <&mmc0_pins_default>;
    };
    
    &gpio0 {
    	/* Do not idle the GPIO used for holding the VTT regulator */
    	ti,no-reset-on-init;
    	ti,no-idle-on-init;
    
    	p7 {
    		gpio-hog;
    		gpios = <7 GPIO_ACTIVE_HIGH>;
    		output-high;
    		line-name = "FET_SWITCH_CTRL";
    	};
    };
    
    &uart3 {
    	pinctrl-names = "default";
    	pinctrl-0 = <&uart3_pins_default>;
    	status = "okay";
    };
    &uart4 {
            pinctrl-names = "default";
            pinctrl-0 = <&uart4_pins_default>;
            status = "okay";
    };
    
    &gpio3 {
    	p4 {
    		gpio-hog;
    		gpios = <4 GPIO_ACTIVE_HIGH>;
    		output-high;
    		line-name = "PR1_MII_CTRL";
    	};
    
    	p10 {
    		gpio-hog;
    		gpios = <10 GPIO_ACTIVE_HIGH>;
    		/* ETH1 mux: Low for MII-PRU, high for RMII-CPSW */
    		output-high;
    		line-name = "MUX_MII_CTL1";
    	};
    };
    
    &mac {
    	pinctrl-names = "default", "sleep";
    	pinctrl-0 = <&cpsw_default>;
    	pinctrl-1 = <&cpsw_sleep>;
    	dual_emac = <1>;
    	mode-gpios = <&gpio3 13 GPIO_ACTIVE_LOW>;
    	status = "okay";
    };
    
    
    
    &davinci_mdio {
    	pinctrl-names = "default", "sleep";
    	compatible = "ti, cpsw-mdio","ti,davinci_mdio";
    	pinctrl-0 = <&davinci_mdio_default>;
    	pinctrl-1 = <&davinci_mdio_sleep>;
    	status = "okay";
    	ti,rx-internal-delay = <DP83867_RGMIIDCTL_1_75_NS>;
    	ti,tx-internal-delay = <DP83867_RGMIIDCTL_1_75_NS>;
    	ti,fifo-depth = <DP83867_PHYCR_FIFO_DEPTH_4_B_NIB>;
    	ti,min-output-impedance;
    	ti,dp83867-rxctrl-strap-quirk;
    };
    
    &cpsw_emac0 {
    	phy_id = <&davinci_mdio>, <0x0>;
    	phy-mode = "rgmii-id";
    	status = "okay";
    };
    
    &cpsw_emac1 {
    	phy_id = <&davinci_mdio>, <0x0>;
    	phy-mode = "rgmii-id";
    	status = "okay";
    };
    
    
    &i2c1{
            compatible = "ti,omap4-i2c";
            #address-cells = <1>;
            #size-cells = <0>;
            ti,hwmods = "i2c2";
            reg = <0x4802a000 0x1000>;
            interrupts = <71>;
            status = "okay";
    		ad7414@48 {
    			compatible = "analog,ad7414";
            		reg = <0x48>;
          		  	status = "okay";
        			};
          };
    
    
    &gpmc {
    status = "okay";
    pinctrl-names = "default";
    /*pinctrl-0 = <&gpmc_pins>;*/
    ranges = <0 0 0x08000000 0x10000000>; /* CS0: NAND */
    nand@0,0 {
    reg = <0 0 0>; /* CS0, offset 0 */
    ti,nand-ecc-opt = "bch8";
    ti,elm-id = <&elm>;
    nand-bus-width = <8>;
    gpmc,device-width = <1>;
    gpmc,sync-clk-ps = <0>;
    gpmc,cs-on-ns = <0>;
    gpmc,cs-rd-off-ns = <44>;
    gpmc,cs-wr-off-ns = <44>;
    gpmc,adv-on-ns = <6>;
    gpmc,adv-rd-off-ns = <34>;
    gpmc,adv-wr-off-ns = <44>;
    gpmc,we-on-ns = <0>;
    gpmc,we-off-ns = <40>;
    gpmc,oe-on-ns = <0>;
    gpmc,oe-off-ns = <54>;
    gpmc,access-ns = <64>;
    gpmc,rd-cycle-ns = <82>;
    gpmc,wr-cycle-ns = <82>;
    gpmc,wait-on-read = "true";
    gpmc,wait-on-write = "true";
    gpmc,bus-turnaround-ns = <0>;
    gpmc,cycle2cycle-delay-ns = <0>;
    gpmc,clk-activation-ns = <0>;
    gpmc,wait-monitoring-ns = <0>;
    gpmc,wr-access-ns = <40>;
    gpmc,wr-data-mux-bus-ns = <0>;
    /* MTD partition table */
    /* All SPL-* partitions are sized to minimal length
    * which can be independently programmable. For
    * NAND flash this is equal to size of erase-block */
    #address-cells = <1>;
    #size-cells = <1>;
    partition@0 {
    label = "NAND.SPL";
    reg = <0x00000000 0x000020000>;
    };
    partition@1 {
    label = "NAND.SPL.backup1";
    reg = <0x00020000 0x00020000>;
    };
    partition@2 {
    label = "NAND.SPL.backup2";
    reg = <0x00040000 0x00020000>;
    };
    partition@3 {
    label = "NAND.SPL.backup3";
    reg = <0x00060000 0x00020000>;
    };
    partition@4 {
    label = "NAND.u-boot-spl-os";
    reg = <0x00080000 0x00040000>;
    };
    partition@5 {
    label = "NAND.u-boot";
    reg = <0x000C0000 0x00100000>;
    };
    partition@6 {
    label = "NAND.u-boot-env";
    reg = <0x001C0000 0x00020000>;
    };
    partition@7 {
    label = "NAND.kernel-dtb";
    reg = <0x001E0000 0x00020000>;
    };
    partition@8 {
    label = "NAND.kernel";
    reg = <0x00200000 0x00800000>;
    };
    partition@9 {
    label = "NAND.file-system";
    reg = <0x00A00000 0x0F600000>;
    };
    };
    
    fpga{
    reg = <1 0 0x01000000>; /*CSn1*/
    
    bank-width = <2>; /* GPMC_CONFIG1_DEVICESIZE(1) */
    
    /*gpmc,burst-write;*/
    /*gpmc,burst-read;*/
    /*gpmc,burst-wrap;*/
    gpmc,sync-read; /* GPMC_CONFIG1_READTYPE_ASYNC */
    gpmc,sync-write; /* GPMC_CONFIG1_WRITETYPE_ASYNC */
    gpmc,clk-activation-ns = <0>; /* GPMC_CONFIG1_CLKACTIVATIONTIME(2) */
    gpmc,burst-length = <16>; /* GPMC_CONFIG1_PAGE_LEN(2) */
    gpmc,mux-add-data = <2>; /* GPMC_CONFIG1_MUXTYPE(2) */
    
    gpmc,sync-clk-ps = <20000>; /* CONFIG2 */
    
    gpmc,cs-on-ns = <0>;
    gpmc,cs-rd-off-ns = <100>;
    gpmc,cs-wr-off-ns = <40>;
    
    gpmc,adv-on-ns = <0>; /* CONFIG3 */
    gpmc,adv-rd-off-ns = <20>;
    gpmc,adv-wr-off-ns = <20>;
    
    gpmc,we-on-ns = <20>; /* CONFIG4 */
    gpmc,we-off-ns = <40>;
    gpmc,oe-on-ns = <20>;
    gpmc,oe-off-ns = <100>;
    
    gpmc,page-burst-access-ns = <20>; /* CONFIG 5 */
    gpmc,access-ns = <80>;
    gpmc,rd-cycle-ns = <120>;
    gpmc,wr-cycle-ns = <60>;
    gpmc,wr-access-ns = <40>; /* CONFIG 6 */
    gpmc,wr-data-mux-bus-ns = <20>;
    
    /*gpmc,bus-turnaround-ns = <40>;*/ /* CONFIG6:3:0 = 4 */
    gpmc,cycle2cycle-samecsen; /* CONFIG6:7 = 1 */
    gpmc,cycle2cycle-delay-ns = <20>; /* CONFIG6:11:8 = 4 */
    
    /* not using dma engine yet, but we can get the channel number here */
    dmas = <&edma 1>;
    dma-names = "cscdma";
    
    };
    };
    

    Regards,

    Murugan S

  • Can you find out which changes caused the crash? These changes in the mux.c file or these in the device tree.

  • Hi Kemal,
    This crash was happening even before the modification of mux.c and dts file.

    Regards,
    Murugan S
  • Can you drop the :0 and try only => sf probe 1?

  • Hi Kemal,
    This is the output
    => sf probe 1
    SF: unrecognized JEDEC id bytes: ff, ff, ff
    Failed to initialize SPI flash at 0:1
    Command failed, result=1


    Regards,
    Murugan S
  • Could you check what activity there is on the SPI lines with an oscilloscope?
  • Hi Kemal,
    I did not enable clock for spi 1 in uboot.After enabling im able to detect spi flash.Thank you for your support.

    Regards,
    Murugan S