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.

How to determine gpio address for dts file?

Other Parts Discussed in Thread: AM3354

I'm trying to determine which address to use in my dts file can someone help me determine which address to add for gpio3_10?

I want to use this pin via sysfs, and compute (3*32) + 10 = 106 as the pin number to echo to export.     However, here is my confusion: using the new pinmux tool (v4), it suggests address 0x130 for the dts file, but when I look at /sys/kernel/debug/pinctrl/44e10800.pinmux/pins,  I see that address ...930 is assigned to pin 76.   When I look at pin 106, I see that the pin configuration is as I set it (Output | MODE_7), however I don't seem to have control over the pin, and it show up at address ...9A8.    Why the discrepancy?   Can someone point me to a reference or explain this?

Hardware is AM3354, sdk v. 7, custom board based on evmsk

  • Hi Geoffrey,

    I will ask the SW team to answer this.

  • Hi Geoffrey,

    First of all, let me clarify that if your custom board has similar design as AM335x Starter Kit, then ball L18 (on which gpio3_10 can be pinmuxed) is used as rgmii1_rclk and is connected to the Ethernet transceiver. So it is not a good idea to change the pinmuxing of that ball.

    Clearing this, as I said gpio3_10 can be muxed on ball L18, which pin name is MII1_RX_CLK (see Table 4-1. Ball Characteristics (ZCE and ZCZ Packages) (continued) in AM3354 Data Manual.

    From TRM you can see that pinmux for this MII1_RX_CLK pin is controlled by conf_mii1_rx_clk register, again from TRM (Chapter 2 Memory Map & chapter 9 Control Module) we can determine its physical address: conf_mii1_rx_clk is @ 0x44E10930. Knowing that in am33xx.dtsi we have:
    am33xx_pinmux: pinmux@44e10800 follows that you should set offset of 0x130 for the conf_mii1_rx_clk.

    So in am335x_evmsk.dts you should add a device tree node similar to:

    gpio3_pins: pinmux_gpio3_pins {
    pinctrl-single,pins = <
    0x130 (PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* Set MII1_RX_CLK pin as GPIO3_10 */
    >;
    };

    &gpio3 {
    pinctrl-names = "default";
    pinctrl-0 = <&gpio3_pins>;
    status = "okay";
    }

    Clear the 0x130 (PIN_INPUT_PULLDOWN | MUX_MODE2) /* mii1_rxclk.rgmii1_rclk */ line from cpsw_default & cpsw_sleep nodes.
    And ball L18 (MII1_RX_CLK) should be configured as GPIO3_10 I/O with pull down enabled.

    Best Regards,
    Yordan
  • Thank you Yourdon, Once I saw what the new pinmux tool genereated, I was guessing at how to selected the offset address, now I know for sure. My board does not have the cpsw implemented, so it does not appear in the dts file.

    I add the lines you suggested, the code compiled using "make dtbs". I copied it from arch/boot/dts/am335x-kv1.dtb (the generated file) to my sd card's root, boot folder as the correct name (I know this because the board formerly booted). Then power up the board. I get through uboot OK, but then get stuck after I see the message "Starting kernel..."

    Below is the dts file as modified with your suggestions.  Any ideas what to try next?   I seems that most edits that I attempt to make to the dts file result in not booting.  Am I doing something wrong in the install process?

    /*
     * Copyright (C) 2012 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 Starter Kit
     * www.ti.com/.../tmdssk3358
     */
    
    /dts-v1/;
    
    #include "am33xx.dtsi"
    #include <dt-bindings/pwm/pwm.h>
    #define YOURDON
    / {
    	model = "TI AM335x KV1";
    	compatible = "ti,am335x-evmsk", "ti,am33xx";
    
    	cpus {
    		cpu@0 {
    			cpu0-supply = <&vcc_reg>;
    		};
    	};
    
    	memory {
    		device_type = "memory";
    		reg = <0x80000000 0x08000000>; /* 128 MB */
    	};
    
    	am33xx_pinmux: pinmux@44e10800 {
    		pinctrl-names = "default";
    
    		lcd_pins_default: lcd_pins_default {
    			pinctrl-single,pins = <
    				0x20 0x01	/* gpmc_ad8.lcd_data23, OUTPUT | MODE1 */
    				0x24 0x01	/* gpmc_ad9.lcd_data22, OUTPUT | MODE1 */
    				0x28 0x01	/* gpmc_ad10.lcd_data21, OUTPUT | MODE1 */
    				0x2c 0x01	/* gpmc_ad11.lcd_data20, OUTPUT | MODE1 */
    				0x30 0x01	/* gpmc_ad12.lcd_data19, OUTPUT | MODE1 */
    				0x34 0x01	/* gpmc_ad13.lcd_data18, OUTPUT | MODE1 */
    				0x38 0x01	/* gpmc_ad14.lcd_data17, OUTPUT | MODE1 */
    				0x3c 0x01	/* gpmc_ad15.lcd_data16, OUTPUT | MODE1 */
    				0xa0 0x00	/* lcd_data0.lcd_data0, OUTPUT | MODE0 */
    				0xa4 0x00	/* lcd_data1.lcd_data1, OUTPUT | MODE0 */
    				0xa8 0x00	/* lcd_data2.lcd_data2, OUTPUT | MODE0 */
    				0xac 0x00	/* lcd_data3.lcd_data3, OUTPUT | MODE0 */
    				0xb0 0x00	/* lcd_data4.lcd_data4, OUTPUT | MODE0 */
    				0xb4 0x00	/* lcd_data5.lcd_data5, OUTPUT | MODE0 */
    				0xb8 0x00	/* lcd_data6.lcd_data6, OUTPUT | MODE0 */
    				0xbc 0x00	/* lcd_data7.lcd_data7, OUTPUT | MODE0 */
    				0xc0 0x00	/* lcd_data8.lcd_data8, OUTPUT | MODE0 */
    				0xc4 0x00	/* lcd_data9.lcd_data9, OUTPUT | MODE0 */
    				0xc8 0x00	/* lcd_data10.lcd_data10, OUTPUT | MODE0 */
    				0xcc 0x00	/* lcd_data11.lcd_data11, OUTPUT | MODE0 */
    				0xd0 0x00	/* lcd_data12.lcd_data12, OUTPUT | MODE0 */
    				0xd4 0x00	/* lcd_data13.lcd_data13, OUTPUT | MODE0 */
    				0xd8 0x00	/* lcd_data14.lcd_data14, OUTPUT | MODE0 */
    				0xdc 0x00	/* lcd_data15.lcd_data15, OUTPUT | MODE0 */
    				0xe0 0x00	/* lcd_vsync.lcd_vsync, OUTPUT | MODE0 */
    				0xe4 0x00	/* lcd_hsync.lcd_hsync, OUTPUT | MODE0 */
    				0xe8 0x00	/* lcd_pclk.lcd_pclk, OUTPUT | MODE0 */
    				0xec 0x00	/* lcd_ac_bias_en.lcd_ac_bias_en, OUTPUT | MODE0 */
    			>;
    		};
    
    		lcd_pins_sleep: lcd_pins_sleep {
    			pinctrl-single,pins = <
    				0x20 (PIN_INPUT_PULLDOWN | MUX_MODE7)	/* gpmc_ad8.lcd_data23 */
    				0x24 (PIN_INPUT_PULLDOWN | MUX_MODE7)	/* gpmc_ad9.lcd_data22 */
    				0x28 (PIN_INPUT_PULLDOWN | MUX_MODE7)	/* gpmc_ad10.lcd_data21 */
    				0x2c (PIN_INPUT_PULLDOWN | MUX_MODE7)	/* gpmc_ad11.lcd_data20 */
    				0x30 (PIN_INPUT_PULLDOWN | MUX_MODE7)	/* gpmc_ad12.lcd_data19 */
    				0x34 (PIN_INPUT_PULLDOWN | MUX_MODE7)	/* gpmc_ad13.lcd_data18 */
    				0x38 (PIN_INPUT_PULLDOWN | MUX_MODE7)	/* gpmc_ad14.lcd_data17 */
    				0x3c (PIN_INPUT_PULLDOWN | MUX_MODE7)	/* gpmc_ad15.lcd_data16 */
    				0xa0 (PULL_DISABLE | MUX_MODE7)		/* lcd_data0.lcd_data0 */
    				0xa4 (PULL_DISABLE | MUX_MODE7)		/* lcd_data1.lcd_data1 */
    				0xa8 (PULL_DISABLE | MUX_MODE7)		/* lcd_data2.lcd_data2 */
    				0xac (PULL_DISABLE | MUX_MODE7)		/* lcd_data3.lcd_data3 */
    				0xb0 (PULL_DISABLE | MUX_MODE7)		/* lcd_data4.lcd_data4 */
    				0xb4 (PULL_DISABLE | MUX_MODE7)		/* lcd_data5.lcd_data5 */
    				0xb8 (PULL_DISABLE | MUX_MODE7)		/* lcd_data6.lcd_data6 */
    				0xbc (PULL_DISABLE | MUX_MODE7)		/* lcd_data7.lcd_data7 */
    				0xc0 (PULL_DISABLE | MUX_MODE7)		/* lcd_data8.lcd_data8 */
    				0xc4 (PULL_DISABLE | MUX_MODE7)		/* lcd_data9.lcd_data9 */
    				0xc8 (PULL_DISABLE | MUX_MODE7)		/* lcd_data10.lcd_data10 */
    				0xcc (PULL_DISABLE | MUX_MODE7)		/* lcd_data11.lcd_data11 */
    				0xd0 (PULL_DISABLE | MUX_MODE7)		/* lcd_data12.lcd_data12 */
    				0xd4 (PULL_DISABLE | MUX_MODE7)		/* lcd_data13.lcd_data13 */
    				0xd8 (PULL_DISABLE | MUX_MODE7)		/* lcd_data14.lcd_data14 */
    				0xdc (PULL_DISABLE | MUX_MODE7)		/* lcd_data15.lcd_data15 */
    				0xe0 (PULL_DISABLE | MUX_MODE7)	    /* lcd_vsync.lcd_vsync, OUTPUT | MODE0 */
    				0xe4 (PULL_DISABLE | MUX_MODE7)	    /* lcd_hsync.lcd_hsync */
    				0xe8 (PULL_DISABLE | MUX_MODE7)	    /* lcd_pclk.lcd_pclk */
    				0xec (PULL_DISABLE | MUX_MODE7)	    /* lcd_ac_bias_en.lcd_ac_bias_en */
    			>;
    		};
    
    		i2c0_pins: pinmux_i2c0_pins {
    			pinctrl-single,pins = <
    				0x188 (PIN_INPUT_PULLUP | MUX_MODE0)	/* i2c0_sda.i2c0_sda */
    				0x18c (PIN_INPUT_PULLUP | MUX_MODE0)	/* i2c0_scl.i2c0_scl */
    			>;
    		};
    
    		i2c1_pins: pinmux_i2c1_pins {
    			pinctrl-single,pins = <
    				0x180 (PIN_INPUT_PULLUP | MUX_MODE3)	/* uart1_rxd,i2c1_sda */
    				0x184 (PIN_INPUT_PULLUP | MUX_MODE3)	/* uart1_txd,i2c1_scl */
    			>;
    		};
    
    		i2c2_pins: pinmux_i2c2_pins {
    			pinctrl-single,pins = <
    				0x178 (PIN_INPUT_PULLUP | MUX_MODE3)	/* uart1_ctsn,i2c2_sda */
    				0x17c (PIN_INPUT_PULLUP | MUX_MODE3)	/* uart1_rtsn,i2c2_scl */
    			>;
    		};
    
            spi0_pins: pinmux_spi0_pins {
                pinctrl-single,pins = <
                    0x150 0x30	/* spi0_sclk.spi0_sclk, INPUT_PULLUP | MODE0 */
                    0x154 0x30	/* spi0_d0.spi0_d0, INPUT_PULLUP | MODE0 */
                    0x158 0x10	/* spi0_d1.spi0_d1, OUTPUT_PULLUP | MODE0 */
                    0x15c 0x10	/* spi0_cs0.spi0_cs0, OUTPUT_PULLUP | MODE0 */
                >;
            };
    
            spi1_pins: pinmux_spi1_pins {
    			pinctrl-single,pins = <
    				0x108 (PIN_INPUT_PULLUP | MUX_MODE2) /* gmii1_col,sp1_clk_mux1 */
    				0x10c (PIN_INPUT_PULLUP | MUX_MODE2)  /* gmii1_crs,spi1_d0_mux1 */
    				0x110 (PIN_OUTPUT_PULLUP | MUX_MODE2) /* gmii1_rxer,spi1_d1_mux1 */
    				0x144 (PIN_OUTPUT_PULLUP | MUX_MODE2) /* rmii1_refclk,spi1_cs0_mux1 */
    			>;
            };
    
            /* Console */
    		uart0_pins: pinmux_uart0_pins {
    			pinctrl-single,pins = <
    				0x170 (PIN_INPUT_PULLUP | MUX_MODE0)	/* uart0_rxd.uart0_rxd */
    				0x174 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)	/* uart0_txd.uart0_txd */
    			>;
    		};
    
            /* Bluetooth */
    		uart3_pins: pinmux_uart3_pins {
    			pinctrl-single,pins = <
    				0x134 (PIN_INPUT_PULLUP | MUX_MODE1)	/* gmii1_rxd3.uart3_rxd */
    				0x138 (PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* gmii1_rxd2.uart3_txd */
    				0x148 (PIN_OUTPUT_PULLDOWN | MUX_MODE3) /* mdio_data.uart3_ctsn */
    				0x14c (PIN_OUTPUT_PULLDOWN | MUX_MODE3) /* mdio_clk.uart3_rtsn */
    			>;
    		};
    
            /* KV2 comms */
    		uart4_pins: pinmux_uart4_pins {
    			pinctrl-single,pins = <
    				0x11c (PIN_INPUT_PULLDOWN | MUX_MODE3)  /* gmii1_txd3.uart4_rxd */
    				0x120 (PIN_OUTPUT_PULLDOWN | MUX_MODE3) /* gmii1_txd2.uart4_txd */
    			>;
    		};
    
    		clkout1_pin: pinmux_clkout1_pin {
    			pinctrl-single,pins = <
    				0x1b0 (PIN_OUTPUT_PULLDOWN | MUX_MODE3)		/* xdma_event_intr0.clkout1 */
    			>;
    		};
    
    		clkout2_pin: pinmux_clkout2_pin {
    			pinctrl-single,pins = <
    				0x1b4 (PIN_OUTPUT_PULLDOWN | MUX_MODE3)		/* xdma_event_intr1.clkout2 */
    			>;
    		};
    
            /* Backlight */
    		pwm_backlight_pins: backlight_pins {
    			pinctrl-single,pins = <
    				0x90 0x02	/* gpmc_advn_ale,timer4 (BKLT_PWM) */
    			>;
    		};
    
            /* SD card */
    		mmc1_pins_default: pinmux_mmc1_pins {
    			pinctrl-single,pins = <
    				0x0F0 (PIN_INPUT_PULLUP | MUX_MODE0)	/* mmc0_dat3.mmc0_dat3 */
    				0x0F4 (PIN_INPUT_PULLUP | MUX_MODE0)	/* mmc0_dat2.mmc0_dat2 */
    				0x0F8 (PIN_INPUT_PULLUP | MUX_MODE0)	/* mmc0_dat1.mmc0_dat1 */
    				0x0FC (PIN_INPUT_PULLUP | MUX_MODE0)	/* mmc0_dat0.mmc0_dat0 */
    				0x100 (PIN_INPUT_PULLUP | MUX_MODE0)	/* mmc0_clk.mmc0_clk */
    				0x104 (PIN_INPUT_PULLUP | MUX_MODE0)	/* mmc0_cmd.mmc0_cmd */
    			>;
    		};
    
    		mmc1_pins_sleep: pinmux_mmc1_pins_sleep {
    			pinctrl-single,pins = <
    				0x0F0 (PIN_INPUT_PULLDOWN | MUX_MODE7)
    				0x0F4 (PIN_INPUT_PULLDOWN | MUX_MODE7)
    				0x0F8 (PIN_INPUT_PULLDOWN | MUX_MODE7)
    				0x0FC (PIN_INPUT_PULLDOWN | MUX_MODE7)
    				0x100 (PIN_INPUT_PULLDOWN | MUX_MODE7)
    				0x104 (PIN_INPUT_PULLDOWN | MUX_MODE7)
    			>;
    		};
    
    
    		/* WL18xx WiFi */
    		mmc2_pins: pinmux_mmc2_pins {
    			pinctrl-single,pins = <
    				0x114 (PIN_OUTPUT_PULLDOWN | MUX_MODE7)	/* gmii1_txen.gpio3_3 (EN_WLAN) */
    				0x12c (PIN_INPUT | MUX_MODE7) /* gmii1_txclk.gpio3_9 (WL_INT) */
    				0x80 (PIN_INPUT | MUX_MODE2) /* gpmc_csn1.mmc1_clk */
    				0x84 (PIN_INPUT | MUX_MODE2) /* gpmc_csn2.mmc1_cmd */
    				0x00 (PIN_INPUT | MUX_MODE1) /* gpmc_ad0.mmc1_dat0 */
    				0x04 (PIN_INPUT | MUX_MODE1) /* gpmc_ad1.mmc1_dat1 */
    				0x08 (PIN_INPUT | MUX_MODE1) /* gpmc_ad2.mmc1_dat2 */
    				0x0c (PIN_INPUT | MUX_MODE1) /* gpmc_ad3.mmc1_dat3 */
    			>;
    		};
    
    
    
    
    #ifdef YOURDON
    gpio3_pins: gpio3_pins {
    
    pinctrl-single,pins = <
    
    0x130 ( PIN_OUTPUT | MUX_MODE7 ) /* (L18) gmii1_rxclk.gpio3[10] */
    
    >;
    
    };
    #endif
    
    	};
    
    	ocp {
    
    
    		uart0: serial@44e09000 {
    			pinctrl-names = "default";
    			pinctrl-0 = <&uart0_pins>;
    
    			status = "okay";
    		};
    
    		uart3: serial@481a6000 {
    			pinctrl-names = "default";
    			pinctrl-0 = <&uart3_pins>;
    
    			status = "okay";
    		};
    
    		uart4: serial@481a8000 {
    			pinctrl-names = "default";
    			pinctrl-0 = <&uart4_pins>;
    
    			status = "okay";
    		};
    
    		i2c0: i2c@44e0b000 {
    			pinctrl-names = "default";
    			pinctrl-0 = <&i2c0_pins>;
    
    			status = "okay";
    			clock-frequency = <400000>;
    
    			/* GT9137 Touchscreen */
    			goodix@14 {
    				compatible = "goodix,gt91xx";
    				status = "okay";
    
    				/* I2C client driver parameters */
    				reg = <0x14>;
    				interrupt-parent = <&gpio0>;
    				interrupts = <31>;
    
    				/* Goodix driver parameters */
    				interrupt-gpios = <&gpio0 31 0x00>;
    				reset-gpios = <&gpio2 0 0x00>;
    				goodix,product-id = "9137";
    				goodix,panel-coords = <0 0 480 800>;
    				goodix,display-coords = <0 0 480 800>;
    			};
    
    			/* CAT24C256 EEPROM */
    			eeprom@50 {
    				compatible = "at,24c256";
    				reg = <0x50>;
    			};
    		};
    
    		musb: usb@47400000 {
    			status = "okay";
    
    			control@44e10000 {
    				status = "okay";
    			};
    
    			usb-phy@47401300 {
    				status = "okay";
    			};
    
    			usb-phy@47401b00 {
    				status = "okay";
    			};
    
    			usb@47401000 {
    				status = "okay";
    			};
    
    			usb@47401800 {
    				status = "okay";
    				dr_mode = "host";
    			};
    
    			dma-controller@07402000  {
    				status = "okay";
    			};
    		};
    
    		spi1: spi@481a0000 {
    			status = "okay";
    			pinctrl-names = "default";
    			pinctrl-0 = <&spi1_pins>;
    			spi-display {
    				compatible = "kuvee,cordial-spi";
    				spi-max-frequency = <500000>;
    				reg = <0>; /* Chip select 0 */
    			};
    		};
    
    		lcdc: lcdc@0x4830e000 {
    			pinctrl-names = "default", "sleep";
    			pinctrl-0 = <&lcd_pins_default>;
    			pinctrl-1 = <&lcd_pins_sleep>;
    			status = "okay";
    			/* avoid stupid warning */
    			#address-cells = <1>;
    			#size-cells = <1>;
    			panel-info {
    				ac-bias           = <255>;
    				ac-bias-intrpt    = <0>;
    				dma-burst-sz      = <16>;
    				bpp               = <16>;
    				fdd               = <0x80>;
    				tft-alt-mode      = <0>;
    				stn-565-mode      = <0>;
    				mono-8bit-mode    = <0>;
    				sync-edge         = <0>;
    				sync-ctrl         = <1>;
    				raster-order      = <0>;
    				fifo-th           = <0>;
    			};
    			display-timings { /* Cordial CT040BLP32 */
    				480x800 {
    					hactive         = <480>;
    					vactive         = <800>;
    					hback-porch     = <5>;
    					hfront-porch    = <5>;
    					hsync-len       = <5>;
    					vback-porch     = <5>;
    					vfront-porch    = <5>;
    					vsync-len       = <5>;
    					clock-frequency = <16600000>;
    					hsync-active    = <0>;
    					vsync-active    = <0>;
    				};
    			};
    		};
    
    		wlcore {
    			compatible = "wlcore";
    			gpio = <&gpio3 9 0>; /* WL_INT */
    		};
    	};
    
    	vcc_reg: fixedregulator@0 {
    		compatible = "regulator-fixed";
    		regulator-name = "vcc";
    		regulator-min-microvolt = <1800000>;
    		regulator-max-microvolt = <1800000>;
    		regulator-boot-on;
    		regulator-always-on;
    	};
    
    	backlight {
    		compatible = "kv1-backlight";
    		brightness-levels = <0 1 2 3 4 5 6 7 8 9 10>;
    		default-brightness-level = <10>;
    	};
    };
    
    #ifdef YOURDON
    &gpio3 { 
    pinctrl-names = "default";
    pinctrl-0 = <&gpio3_pins>;
    status = "okay";
    };
    
    
    #endif
    /* Ambient light sensor */
    &tscadc {
    	status = "okay";
    	adc {
    		ti,adc-channels = <0 1>;
    	};
    };
    
    &gpio0 {
    	ti,no-reset;
    };
    
    /* SD card */
    &mmc1 {
    	status = "okay";
    	bus-width = <4>;
    	pinctrl-names = "default", "sleep";
    	pinctrl-0 = <&mmc1_pins_default>;
    	pinctrl-1 = <&mmc1_pins_sleep>;
    };
    
    /* WL18xx WiFi */
    &mmc2 {
    	status = "okay";
    	ti,non-removable;
    	bus-width = <4>;
    	cap-power-off-card;
    	pinctrl-names = "default";
    	pinctrl-0 = <&mmc2_pins>;
    	ti,non-removable;
        ti,needs-special-hs-handling;
    };
    

  • Remove the defines and ifdefs.  Also use gpio3_pins: pinmux_gpio3_pins NOT gpio3_pins: gpio3_pins. 

    Also can you stop your board at u-boot stage and share the output of printenv command? 

    Best Regards, 

    Yordan

  • Thank You Yordon,

    removed the defines and ifdefs, modified the pin definition. Still stuck in a boot loop. Here is the console output from printenv

    ramroot=/dev/ram0 rw
    ramrootfstype=ext2
    rdaddr=0x85080000
    rootpath=/export/rootfs
    soc=am33xx
    spiargs=setenv bootargs console=${console} ${optargs} root=${spiroot} rootfstype=${spirootfstype}
    spiboot=echo Booting from spi ...; run spiargs; sf probe ${spibusno}:0; sf read ${loadaddr} ${spisrcaddr} ${spiimgsize}; bootz ${loadaddr}
    spibusno=0
    spiimgsize=0x362000
    spiroot=/dev/mtdblock4 rw
    spirootfstype=jffs2
    spisrcaddr=0xe0000
    static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off
    stderr=serial
    stdin=serial
    stdout=serial
    usbnet_devaddr=20:cd:39:ea:b5:56
    vendor=ti
    ver=U-Boot 2014.10-rc2 (May 04 2015 - 14:34:33)

    Environment size: 4424/131067 bytes
    U-Boot#
    printenv
    arch=arm
    baudrate=115200
    board=am335x
    board_name=A335X_SK
    board_rev=00R1
    boot_fdt=try
    bootcmd=run findfdt; run mmcboot;setenv mmcdev 1; setenv bootpart 1:2; run mmcboot;run nandboot;
    bootcount=4
    bootdelay=1
    bootdir=/boot
    bootenv=uEnv.txt
    bootfile=zImage
    bootm_size=0x08000000
    bootpart=0:2
    console=ttyO0,115200n8
    cpu=armv7
    dfu_alt_info_emmc=rawemmc mmc 0 3751936
    dfu_alt_info_mmc=boot part 0 1;rootfs part 0 2;MLO fat 0 1;MLO.raw mmc 0x100 0x100;u-boot.img.raw mmc 0x300 0x400;spl-os-args.raw mmc 0x80 0x80;spl-os-image.raw mmc 0x900 0x2000;spl-os-args fat 0 1;spl-os-image fat 0 1;u-boot.img fat 0 1;uEnv.txt fat 0 1
    dfu_alt_info_nand=SPL part 0 1;SPL.backup1 part 0 2;SPL.backup2 part 0 3;SPL.backup3 part 0 4;u-boot part 0 5;u-boot-spl-os part 0 6;kernel part 0 8;rootfs part 0 9
    dfu_alt_info_ram=kernel ram 0x80200000 0xD80000;fdt ram 0x80F80000 0x80000;ramdisk ram 0x81000000 0x4000000
    eth1addr=20:cd:39:ea:b5:56
    ethact=cpsw
    ethaddr=20:cd:39:ea:b5:54
    fdt_addr_r=0x85000000
    fdtaddr=0x85000000
    fdtfile=undefined
    findfdt=if test $board_name = A335BONE; then setenv fdtfile am335x-bone.dtb; fi; if test $board_name = A335BNLT; then setenv fdtfile am335x-boneblack.dtb; fi; if test $board_name = A33515BB; then setenv fdtfile am335x-evm.dtb; fi; if test $board_name = A335X_SK; then setenv fdtfile am335x-evmsk.dtb; fi; if test $fdtfile = undefined; then echo WARNING: Could not determine device tree to use; fi;
    importbootenv=echo Importing environment from mmc ...; env import -t -r $loadaddr $filesize
    kernel_addr_r=0x81000000
    loadaddr=0x81000000
    loadbootenv=load mmc ${mmcdev} ${loadaddr} ${bootenv}
    loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}
    loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}
    loadramdisk=load mmc ${mmcdev} ${rdaddr} ramdisk.gz
    mmcargs=setenv bootargs console=${console} ${optargs} root=${mmcroot} rootfstype=${mmcrootfstype}
    mmcboot=mmc dev ${mmcdev}; if mmc rescan; then echo SD/MMC found on device ${mmcdev};if run loadbootenv; then echo Loaded environment from ${bootenv};run importbootenv;fi;if test -n $uenvcmd; then echo Running uenvcmd ...;run uenvcmd;fi;if run loadimage; then run mmcloados;fi;fi;
    mmcdev=0
    mmcloados=run mmcargs; if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if run loadfdt; then bootz ${loadaddr} - ${fdtaddr}; else if test ${boot_fdt} = try; then bootz; else echo WARN: Cannot load the DT; fi; fi; else bootz; fi;
    mmcroot=/dev/mmcblk0p2 ro
    mmcrootfstype=ext4 rootwait
    mtdids=nand0=nand.0
    mtdparts=mtdparts=nand.0:128k(NAND.SPL),128k(NAND.SPL.backup1),128k(NAND.SPL.backup2),128k(NAND.SPL.backup3),256k(NAND.u-boot-spl-os),1m(NAND.u-boot),128k(NAND.u-boot-env),128k(NAND.u-boot-env.backup1),8m(NAND.kernel),-(NAND.rootfs)
    nandargs=setenv bootargs console=${console} ${optargs} root=${nandroot} rootfstype=${nandrootfstype}
    nandboot=echo Booting from nand ...; run nandargs; nand read ${fdtaddr} u-boot-spl-os; nand read ${loadaddr} kernel; bootz ${loadaddr} - ${fdtaddr}
    nandroot=ubi0:rootfs rw ubi.mtd=9,2048
    nandrootfstype=ubifs rootwait=1
    netargs=setenv bootargs console=${console} ${optargs} root=/dev/nfs nfsroot=${serverip}:${rootpath},${nfsopts} rw ip=dhcp
    netboot=echo Booting from network ...; setenv autoload no; dhcp; tftp ${loadaddr} ${bootfile}; tftp ${fdtaddr} ${fdtfile}; run netargs; bootz ${loadaddr} - ${fdtaddr}
    nfsopts=nolock
    partitions=uuid_disk=${uuid_gpt_disk};name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}
    ramargs=setenv bootargs console=${console} ${optargs} root=${ramroot} rootfstype=${ramrootfstype}
    ramboot=echo Booting from ramdisk ...; run ramargs; bootz ${loadaddr} ${rdaddr} ${fdtaddr}
    ramdisk_addr_r=0x85080000
    ramroot=/dev/ram0 rw
    ramrootfstype=ext2
    rdaddr=0x85080000
    rootpath=/export/rootfs
    soc=am33xx
    spiargs=setenv bootargs console=${console} ${optargs} root=${spiroot} rootfstype=${spirootfstype}
    spiboot=echo Booting from spi ...; run spiargs; sf probe ${spibusno}:0; sf read ${loadaddr} ${spisrcaddr} ${spiimgsize}; bootz ${loadaddr}
    spibusno=0
    spiimgsize=0x362000
    spiroot=/dev/mtdblock4 rw
    spirootfstype=jffs2
    spisrcaddr=0xe0000
    static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off
    stderr=serial
    stdin=serial
    stdout=serial
    usbnet_devaddr=20:cd:39:ea:b5:56
    vendor=ti
    ver=U-Boot 2014.10-rc2 (May 04 2015 - 14:34:33)

    Environment size: 4424/131067 bytes
    U-Boot#

    For what it's worth here is the whole boot sequence:

    ramroot=/dev/ram0 rw
    ramrootfstype=ext2
    rdaddr=0x85080000
    rootpath=/export/rootfs
    soc=am33xx
    spiargs=setenv bootargs console=${console} ${optargs} root=${spiroot} rootfstype=${spirootfstype}
    spiboot=echo Booting from spi ...; run spiargs; sf probe ${spibusno}:0; sf read ${loadaddr} ${spisrcaddr} ${spiimgsize}; bootz ${loadaddr}
    spibusno=0
    spiimgsize=0x362000
    spiroot=/dev/mtdblock4 rw
    spirootfstype=jffs2
    spisrcaddr=0xe0000
    static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off
    stderr=serial
    stdin=serial
    stdout=serial
    usbnet_devaddr=20:cd:39:ea:b5:56
    vendor=ti
    ver=U-Boot 2014.10-rc2 (May 04 2015 - 14:34:33)

    Environment size: 4424/131067 bytes
    U-Boot#
    printenv
    arch=arm
    baudrate=115200
    board=am335x
    board_name=A335X_SK
    board_rev=00R1
    boot_fdt=try
    bootcmd=run findfdt; run mmcboot;setenv mmcdev 1; setenv bootpart 1:2; run mmcboot;run nandboot;
    bootcount=4
    bootdelay=1
    bootdir=/boot
    bootenv=uEnv.txt
    bootfile=zImage
    bootm_size=0x08000000
    bootpart=0:2
    console=ttyO0,115200n8
    cpu=armv7
    dfu_alt_info_emmc=rawemmc mmc 0 3751936
    dfu_alt_info_mmc=boot part 0 1;rootfs part 0 2;MLO fat 0 1;MLO.raw mmc 0x100 0x100;u-boot.img.raw mmc 0x300 0x400;spl-os-args.raw mmc 0x80 0x80;spl-os-image.raw mmc 0x900 0x2000;spl-os-args fat 0 1;spl-os-image fat 0 1;u-boot.img fat 0 1;uEnv.txt fat 0 1
    dfu_alt_info_nand=SPL part 0 1;SPL.backup1 part 0 2;SPL.backup2 part 0 3;SPL.backup3 part 0 4;u-boot part 0 5;u-boot-spl-os part 0 6;kernel part 0 8;rootfs part 0 9
    dfu_alt_info_ram=kernel ram 0x80200000 0xD80000;fdt ram 0x80F80000 0x80000;ramdisk ram 0x81000000 0x4000000
    eth1addr=20:cd:39:ea:b5:56
    ethact=cpsw
    ethaddr=20:cd:39:ea:b5:54
    fdt_addr_r=0x85000000
    fdtaddr=0x85000000
    fdtfile=undefined
    findfdt=if test $board_name = A335BONE; then setenv fdtfile am335x-bone.dtb; fi; if test $board_name = A335BNLT; then setenv fdtfile am335x-boneblack.dtb; fi; if test $board_name = A33515BB; then setenv fdtfile am335x-evm.dtb; fi; if test $board_name = A335X_SK; then setenv fdtfile am335x-evmsk.dtb; fi; if test $fdtfile = undefined; then echo WARNING: Could not determine device tree to use; fi;
    importbootenv=echo Importing environment from mmc ...; env import -t -r $loadaddr $filesize
    kernel_addr_r=0x81000000
    loadaddr=0x81000000
    loadbootenv=load mmc ${mmcdev} ${loadaddr} ${bootenv}
    loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}
    loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}
    loadramdisk=load mmc ${mmcdev} ${rdaddr} ramdisk.gz
    mmcargs=setenv bootargs console=${console} ${optargs} root=${mmcroot} rootfstype=${mmcrootfstype}
    mmcboot=mmc dev ${mmcdev}; if mmc rescan; then echo SD/MMC found on device ${mmcdev};if run loadbootenv; then echo Loaded environment from ${bootenv};run importbootenv;fi;if test -n $uenvcmd; then echo Running uenvcmd ...;run uenvcmd;fi;if run loadimage; then run mmcloados;fi;fi;
    mmcdev=0
    mmcloados=run mmcargs; if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if run loadfdt; then bootz ${loadaddr} - ${fdtaddr}; else if test ${boot_fdt} = try; then bootz; else echo WARN: Cannot load the DT; fi; fi; else bootz; fi;
    mmcroot=/dev/mmcblk0p2 ro
    mmcrootfstype=ext4 rootwait
    mtdids=nand0=nand.0
    mtdparts=mtdparts=nand.0:128k(NAND.SPL),128k(NAND.SPL.backup1),128k(NAND.SPL.backup2),128k(NAND.SPL.backup3),256k(NAND.u-boot-spl-os),1m(NAND.u-boot),128k(NAND.u-boot-env),128k(NAND.u-boot-env.backup1),8m(NAND.kernel),-(NAND.rootfs)
    nandargs=setenv bootargs console=${console} ${optargs} root=${nandroot} rootfstype=${nandrootfstype}
    nandboot=echo Booting from nand ...; run nandargs; nand read ${fdtaddr} u-boot-spl-os; nand read ${loadaddr} kernel; bootz ${loadaddr} - ${fdtaddr}
    nandroot=ubi0:rootfs rw ubi.mtd=9,2048
    nandrootfstype=ubifs rootwait=1
    netargs=setenv bootargs console=${console} ${optargs} root=/dev/nfs nfsroot=${serverip}:${rootpath},${nfsopts} rw ip=dhcp
    netboot=echo Booting from network ...; setenv autoload no; dhcp; tftp ${loadaddr} ${bootfile}; tftp ${fdtaddr} ${fdtfile}; run netargs; bootz ${loadaddr} - ${fdtaddr}
    nfsopts=nolock
    partitions=uuid_disk=${uuid_gpt_disk};name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}
    ramargs=setenv bootargs console=${console} ${optargs} root=${ramroot} rootfstype=${ramrootfstype}
    ramboot=echo Booting from ramdisk ...; run ramargs; bootz ${loadaddr} ${rdaddr} ${fdtaddr}
    ramdisk_addr_r=0x85080000
    ramroot=/dev/ram0 rw
    ramrootfstype=ext2
    rdaddr=0x85080000
    rootpath=/export/rootfs
    soc=am33xx
    spiargs=setenv bootargs console=${console} ${optargs} root=${spiroot} rootfstype=${spirootfstype}
    spiboot=echo Booting from spi ...; run spiargs; sf probe ${spibusno}:0; sf read ${loadaddr} ${spisrcaddr} ${spiimgsize}; bootz ${loadaddr}
    spibusno=0
    spiimgsize=0x362000
    spiroot=/dev/mtdblock4 rw
    spirootfstype=jffs2
    spisrcaddr=0xe0000
    static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off
    stderr=serial
    stdin=serial
    stdout=serial
    usbnet_devaddr=20:cd:39:ea:b5:56
    vendor=ti
    ver=U-Boot 2014.10-rc2 (May 04 2015 - 14:34:33)

    Environment size: 4424/131067 bytes
    U-Boot#run findfdt
    arch=arm
    baudrate=115200
    board=am335x
    board_name=A335X_SK
    board_rev=00R1
    boot_fdt=try
    bootcmd=run findfdt; run mmcboot;setenv mmcdev 1; setenv bootpart 1:2; run mmcboot;run nandboot;
    bootcount=4
    bootdelay=1
    bootdir=/boot
    bootenv=uEnv.txt
    bootfile=zImage
    bootm_size=0x08000000
    bootpart=0:2
    console=ttyO0,115200n8
    cpu=armv7
    dfu_alt_info_emmc=rawemmc mmc 0 3751936
    dfu_alt_info_mmc=boot part 0 1;rootfs part 0 2;MLO fat 0 1;MLO.raw mmc 0x100 0x100;u-boot.img.raw mmc 0x300 0x400;spl-os-args.raw mmc 0x80 0x80;spl-os-image.raw mmc 0x900 0x2000;spl-os-args fat 0 1;spl-os-image fat 0 1;u-boot.img fat 0 1;uEnv.txt fat 0 1
    dfu_alt_info_nand=SPL part 0 1;SPL.backup1 part 0 2;SPL.backup2 part 0 3;SPL.backup3 part 0 4;u-boot part 0 5;u-boot-spl-os part 0 6;kernel part 0 8;rootfs part 0 9
    dfu_alt_info_ram=kernel ram 0x80200000 0xD80000;fdt ram 0x80F80000 0x80000;ramdisk ram 0x81000000 0x4000000
    eth1addr=20:cd:39:ea:b5:56
    ethact=cpsw
    ethaddr=20:cd:39:ea:b5:54
    fdt_addr_r=0x85000000
    fdtaddr=0x85000000
    fdtfile=undefined
    findfdt=if test $board_name = A335BONE; then setenv fdtfile am335x-bone.dtb; fi; if test $board_name = A335BNLT; then setenv fdtfile am335x-boneblack.dtb; fi; if test $board_name = A33515BB; then setenv fdtfile am335x-evm.dtb; fi; if test $board_name = A335X_SK; then setenv fdtfile am335x-evmsk.dtb; fi; if test $fdtfile = undefined; then echo WARNING: Could not determine device tree to use; fi;
    importbootenv=echo Importing environment from mmc ...; env import -t -r $loadaddr $filesize
    kernel_addr_r=0x81000000
    loadaddr=0x81000000
    loadbootenv=load mmc ${mmcdev} ${loadaddr} ${bootenv}
    loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}
    loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}
    loadramdisk=load mmc ${mmcdev} ${rdaddr} ramdisk.gz
    mmcargs=setenv bootargs console=${console} ${optargs} root=${mmcroot} rootfstype=${mmcrootfstype}
    mmcboot=mmc dev ${mmcdev}; if mmc rescan; then echo SD/MMC found on device ${mmcdev};if run loadbootenv; then echo Loaded environment from ${bootenv};run importbootenv;fi;if test -n $uenvcmd; then echo Running uenvcmd ...;run uenvcmd;fi;if run loadimage; then run mmcloados;fi;fi;
    mmcdev=0
    mmcloados=run mmcargs; if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if run loadfdt; then bootz ${loadaddr} - ${fdtaddr}; else if test ${boot_fdt} = try; then bootz; else echo WARN: Cannot load the DT; fi; fi; else bootz; fi;
    mmcroot=/dev/mmcblk0p2 ro
    mmcrootfstype=ext4 rootwait
    mtdids=nand0=nand.0
    mtdparts=mtdparts=nand.0:128k(NAND.SPL),128k(NAND.SPL.backup1),128k(NAND.SPL.backup2),128k(NAND.SPL.backup3),256k(NAND.u-boot-spl-os),1m(NAND.u-boot),128k(NAND.u-boot-env),128k(NAND.u-boot-env.backup1),8m(NAND.kernel),-(NAND.rootfs)
    nandargs=setenv bootargs console=${console} ${optargs} root=${nandroot} rootfstype=${nandrootfstype}
    nandboot=echo Booting from nand ...; run nandargs; nand read ${fdtaddr} u-boot-spl-os; nand read ${loadaddr} kernel; bootz ${loadaddr} - ${fdtaddr}
    nandroot=ubi0:rootfs rw ubi.mtd=9,2048
    nandrootfstype=ubifs rootwait=1
    netargs=setenv bootargs console=${console} ${optargs} root=/dev/nfs nfsroot=${serverip}:${rootpath},${nfsopts} rw ip=dhcp
    netboot=echo Booting from network ...; setenv autoload no; dhcp; tftp ${loadaddr} ${bootfile}; tftp ${fdtaddr} ${fdtfile}; run netargs; bootz ${loadaddr} - ${fdtaddr}
    nfsopts=nolock
    partitions=uuid_disk=${uuid_gpt_disk};name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}
    ramargs=setenv bootargs console=${console} ${optargs} root=${ramroot} rootfstype=${ramrootfstype}
    ramboot=echo Booting from ramdisk ...; run ramargs; bootz ${loadaddr} ${rdaddr} ${fdtaddr}
    ramdisk_addr_r=0x85080000
    ramroot=/dev/ram0 rw
    ramrootfstype=ext2
    rdaddr=0x85080000
    rootpath=/export/rootfs
    soc=am33xx
    spiargs=setenv bootargs console=${console} ${optargs} root=${spiroot} rootfstype=${spirootfstype}
    spiboot=echo Booting from spi ...; run spiargs; sf probe ${spibusno}:0; sf read ${loadaddr} ${spisrcaddr} ${spiimgsize}; bootz ${loadaddr}
    spibusno=0
    spiimgsize=0x362000
    spiroot=/dev/mtdblock4 rw
    spirootfstype=jffs2
    spisrcaddr=0xe0000
    static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off
    stderr=serial
    stdin=serial
    stdout=serial
    usbnet_devaddr=20:cd:39:ea:b5:56
    vendor=ti
    ver=U-Boot 2014.10-rc2 (May 04 2015 - 14:34:33)

    Environment size: 4424/131067 bytes
    echoot# run findfdt
    U-Boot# echo $fdtfile
    echo $fdtfile
    $
    U-Boot# e
    Unknown command 'e' - try 'help'
    U-Boot#
    Unknown command 'e' - try 'help'
    U-Boot# echo $fdtfile
    am335x-evmsk.dtb
    U-Boot# \
    am335x-evmsk.dtb
    U-Boot#
    am335x-evmsk.dtb
    U-Boot#
    am335x-evmsk.dtb
    U-Boot# boot
    switch to partitions #0, OK
    mmc0 is current device
    SD/MMC found on device 0
    reading uEnv.txt
    ** Unable to read file uEnv.txt **
    4086976 bytes read in 289 ms (13.5 MiB/s)
    33677 bytes read in 60 ms (547.9 KiB/s)
    Kernel image @ 0x81000000 [ 0x000000 - 0x3e5cc0 ]
    ## Flattened Device Tree blob at 85000000
    Booting using the fdt blob at 0x85000000
    Loading Device Tree to 86712000, end 8671d38c ... OK

    Starting kernel ...

    U-Boot SPL 2014.10-rc2 (May 04 2015 - 14:34:33)
    CPU frequency: 800
    reading args
    spl_load_image_fat_os: error reading image args, err - -1
    reading u-boot.img
    reading u-boot.img


    U-Boot 2014.10-rc2 (May 04 2015 - 14:34:33)

    Watchdog enabled
    I2C: ready
    DRAM: 128 MiB
    NAND: 0 MiB
    MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
    *** Error - No Valid Environment Area found
    *** Warning - bad CRC, using default environment

    Net: <ethaddr> not set. Validating first E-fuse MAC
    Phy not found
    cpsw, usb_ether
    Hit any key to stop autoboot: 0
    switch to partitions #0, OK
    mmc0 is current device
    SD/MMC found on device 0
    reading uEnv.txt
    ** Unable to read file uEnv.txt **
    4086976 bytes read in 287 ms (13.6 MiB/s)
    33677 bytes read in 60 ms (547.9 KiB/s)
    Kernel image @ 0x81000000 [ 0x000000 - 0x3e5cc0 ]
    ## Flattened Device Tree blob at 85000000
    Booting using the fdt blob at 0x85000000
    Loading Device Tree to 86712000, end 8671d38c ... OK

    Starting kernel ...

  • OK, as I see from your previous post you use am335x-kv1.dtb as your device tree file. And still in u-boot environment variables there is no mention of it in findfdt line and fdtfile is set to undefined.

    What I can suggest is to set fdtfile=am335x-kv1.dtb in your u-boot sources.  Modify u-boot/include/configs/am335x_evm.h file as follows:

      #define CONFIG_EXTRA_ENV_SETTINGS \

                   DEFAULT_LINUX_BOOT_ENV \

                   "boot_fdt=try\0" \

                   "bootpart=0:2\0" \

                   "bootdir=/boot\0" \

                   "bootfile=zImage\0" \

                   "fdtfile=am335x-kv1.dtb\0" \                             //By default this is set to undefiend

                   "console=ttyO0,115200n8\0" \

    Rebuild your u-boot (copy it to the boot partition of your sd card) & boot your kernel with the modified dts (gpio3 node included). This should allow you to boot your device with the am335x-kv1.dtb.

    Hope this helps.

    Best Regards,

    Yordan

  • Great news, it works. It appeared that the defines and ifdefs were working as expected, so It must have been the name "pinmux"

    Can you explain to me why the word pinmux is important?

    Also, I have seen that often these are postpended with _default or _sleep, can you explain that too?
  • Hi Geoffrey,

    The pinmux word associates the gpio3_pins device tree node with the phisical address 0x44E10800 defined in am33xx_pinmux: pinmux@44e10800 dts node from am33xx.dtsi.

    The _default and _sleep are associated with the pin settings when corresponding IP is default state and when it is in sleep. I.e. during default operation of I2C, its pads should be I/O PULLUP, while during sleep they can be set as I/O PULLDOWN.

    Hope this helps.

    Best Regards,
    Yordan