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.

AM3352: Am3352 USB crash

Part Number: AM3352
Other Parts Discussed in Thread: TMP100, TPS65217

I have an issue with USB port , when I disconnect the cable from usb port from AM335x , I get kernel panic, or if I remove the cable and do ifconfig some times, it will crash. the kernel panic is below

ifconfig usb0 up
root@at-cx3:~# [ 54.656233] Unhandled fault: external abort on non-linefetch (0x1008) at 0xe08ec412
[ 54.663988] pgd = 5f6e0744
[ 54.666725] [e08ec412] *pgd=9f03a811, *pte=47401653, *ppte=47401453
[ 54.673080] Internal error: : 1008 [#1] PREEMPT ARM
[ 54.677994] Modules linked in: sha256_arm sha256_generic cfg80211 8021q pm33xx wkup_m3_ipc wkup_m3_rproc omap_aes_driver remoteproc crypto_engine omap_crypto omap_sham ti_emif_sram rtc_omap
[ 54.695079] CPU: 0 PID: 49 Comm: kworker/0:2 Not tainted 4.19.59-g8a2de5227-dirty #1
[ 54.702870] Hardware name: Generic AM33XX (Flattened Device Tree)
[ 54.709040] Workqueue: pm pm_runtime_work
[ 54.713111] PC is at musb_default_readw+0x10/0x1c
[ 54.717863] LR is at musb_is_tx_fifo_empty+0x48/0x54
[ 54.722864] pc : [<c05ccc04>] lr : [<c05d51e8>] psr: 200f0193
[ 54.729171] sp : df60bb68 ip : df60bb78 fp : df60bb74
[ 54.734432] r10: 200f0193 r9 : 200f0193 r8 : df622228
[ 54.739696] r7 : df622258 r6 : df62221c r5 : c05cc2c4 r4 : e08ec410
[ 54.746266] r3 : c05ccbf4 r2 : 00000001 r1 : e08ec412 r0 : e08ec410
[ 54.752841] Flags: nzCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment none
[ 54.760111] Control: 10c5387d Table: 9e344019 DAC: 00000051
[ 54.765900] Process kworker/0:2 (pid: 49, stack limit = 0x00d4bc2c)
[ 54.772211] Stack: (0xdf60bb68 to 0xdf60c000)
[ 54.776618] bb60: df60bb8c df60bb78 c05d51e8 c05ccc00 df63a83c df63a800
[ 54.784864] bb80: df60bbbc df60bb90 c05d5c80 c05d51ac df60bbbc df60bba0 c0d15a00 df622228
[ 54.793110] bba0: c0d159c0 ffffe000 00000000 c05d5c0c df60bc14 df60bbc0 c0185dc8 c05d5c18
[ 54.801356] bbc0: c018a5e8 c0a8f660 c0d47281 0000000c b96de118 c0d159c0 c0d15a14 00000000
[ 54.809601] bbe0: b96de118 0000000c 7fffffff c0d159c0 ffffe000 200f0193 00000003 7fffffff
[ 54.817847] bc00: ffffffff c0d4723e df60bc6c df60bc18 c0186588 c0185c44 ffffe000 0000000c
[ 54.826092] bc20: df60bc84 df60bc30 c01865e8 c01956fc b96de118 7fffffff ffffffff 7fffffff
[ 54.834338] bc40: ffffffff c0d07d40 df007100 00000000 df60bcc8 00000010 df007100 c0d4723e
[ 54.842583] bc60: df60bc7c df60bc70 c0119558 c0186474 df60bcc4 df60bc80 c016ee2c c0119534
[ 54.850828] bc80: b96d6bc0 0000000c 00000028 c0a8da30 c0a8da1c c0a8d9f4 df62221c df007100
[ 54.859073] bca0: df007100 00000001 00000000 df008000 df60a000 00000008 df60bce4 df60bcc8
[ 54.867317] bcc0: c016ef48 c016edd0 00000000 c0d03048 df007100 00000000 df60bcfc df60bce8
[ 54.875562] bce0: c016f008 c016ef1c df007100 00000000 df60bd14 df60bd00 c017267c c016efb0
[ 54.883806] bd00: c0d46488 00000000 df60bd24 df60bd18 c016dfac c01725c8 df60bd4c df60bd28
[ 54.892052] bd20: c016e778 c016df8c c0d79acc 600f0013 ffffffff df60bd9c ffffe000 df60a000
[ 54.900297] bd40: df60bd64 df60bd50 c0407818 c016e728 c011d054 600f0013 df60bdd4 df60bd68
[ 54.908542] bd60: c0101a0c c04077e8 00000000 00000000 00000000 c0d03048 ffffe000 a00f0013
[ 54.916786] bd80: 00000001 0000000a ffffe000 c0d14860 00000008 df60bdd4 df60bd68 df60bdb8
[ 54.925031] bda0: c0123a6c c011d054 600f0013 ffffffff 00000051 00000000 df60bdf4 df60bdc8
[ 54.933276] bdc0: 00000000 df133240 df60bdf4 df60bdd8 c011dd20 c011d01c df130610 00000000
[ 54.941520] bde0: c011dd74 0000000a df60be0c df60bdf8 c011dd98 c011dce4 df130610 00000000
[ 54.949766] be00: df60be44 df60be10 c053c40c c011dd80 c01725a8 c0174828 df007100 df130610
[ 54.958011] be20: ffffe000 04208060 0000000a ffffe000 c0d14860 00000008 df60be64 df60be48
[ 54.966256] be40: c053c554 c053c2cc df130610 00000000 c011dd74 0000000a df60bebc df60be68
[ 54.974501] be60: c053b28c c053c504 00000000 c015e3dc c0d14860 00000000 c0407818 df130610
[ 54.982744] be80: 00000000 00000002 00000000 c0d03048 00000000 df130610 00000000 00000002
[ 54.990990] bea0: 00000000 df1306c4 00000000 df1306b8 df60bee4 df60bec0 c053b8e0 c053b154
[ 54.999235] bec0: df1306b4 df5f6200 dfb40000 00000000 c0d0ddf8 00000000 df60bef4 df60bee8
[ 55.007481] bee0: c053ce7c c053b824 df60bf2c df60bef8 c0142120 c053cdac c0d0ddf8 c0d14860
[ 55.015726] bf00: ffffe000 df5f6200 c0d0ddf8 df5f6214 c0d14860 ffffe000 c0d0de0c c0d0ddf8
[ 55.023972] bf20: df60bf74 df60bf30 c01423c0 c0141f1c c0809eb4 c0a8a94c df5f2a40 00000000
[ 55.032217] bf40: c0d471ed c0d14860 c0142340 df5f2e00 df5f2a40 00000000 df60a000 df5f6200
[ 55.040462] bf60: c0142340 df06fe78 df60bfac df60bf78 c01484ec c014234c df5f2e18 df5f2e18
[ 55.048706] bf80: 00000000 df5f2a40 c0148394 00000000 00000000 00000000 00000000 00000000
[ 55.056950] bfa0: 00000000 df60bfb0 c01010e8 c01483a0 00000000 00000000 00000000 00000000
[ 55.065192] bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 55.073435] bfe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000
[ 55.081657] Backtrace:
[ 55.084159] [<c05ccbf4>] (musb_default_readw) from [<c05d51e8>] (musb_is_tx_fifo_empty+0x48/0x54)
[ 55.093111] [<c05d51a0>] (musb_is_tx_fifo_empty) from [<c05d5c80>] (cppi41_recheck_tx_req+0x74/0x12c)
[ 55.102390] r5:df63a800 r4:df63a83c
[ 55.106020] [<c05d5c0c>] (cppi41_recheck_tx_req) from [<c0185dc8>] (__hrtimer_run_queues.constprop.3+0x190/0x228)
[ 55.116357] r9:c05d5c0c r8:00000000 r7:ffffe000 r6:c0d159c0 r5:df622228 r4:c0d15a00
[ 55.124165] [<c0185c38>] (__hrtimer_run_queues.constprop.3) from [<c0186588>] (hrtimer_interrupt+0x120/0x30c)
[ 55.134152] r10:c0d4723e r9:ffffffff r8:7fffffff r7:00000003 r6:200f0193 r5:ffffe000
[ 55.142029] r4:c0d159c0
[ 55.144620] [<c0186468>] (hrtimer_interrupt) from [<c0119558>] (omap2_gp_timer_interrupt+0x30/0x38)
[ 55.153736] r10:c0d4723e r9:df007100 r8:00000010 r7:df60bcc8 r6:00000000 r5:df007100
[ 55.161612] r4:c0d07d40
[ 55.164194] [<c0119528>] (omap2_gp_timer_interrupt) from [<c016ee2c>] (__handle_irq_event_percpu+0x68/0x14c)
[ 55.174095] [<c016edc4>] (__handle_irq_event_percpu) from [<c016ef48>] (handle_irq_event_percpu+0x38/0x94)
[ 55.183822] r10:00000008 r9:df60a000 r8:df008000 r7:00000000 r6:00000001 r5:df007100
[ 55.191699] r4:df007100
[ 55.194270] [<c016ef10>] (handle_irq_event_percpu) from [<c016f008>] (handle_irq_event+0x64/0x90)
[ 55.203198] r5:00000000 r4:df007100
[ 55.206821] [<c016efa4>] (handle_irq_event) from [<c017267c>] (handle_level_irq+0xc0/0x160)
[ 55.215225] r5:00000000 r4:df007100
[ 55.218844] [<c01725bc>] (handle_level_irq) from [<c016dfac>] (generic_handle_irq+0x2c/0x3c)
[ 55.227336] r5:00000000 r4:c0d46488
[ 55.230954] [<c016df80>] (generic_handle_irq) from [<c016e778>] (__handle_domain_irq+0x5c/0xb0)
[ 55.239732] [<c016e71c>] (__handle_domain_irq) from [<c0407818>] (omap_intc_handle_irq+0x3c/0x94)
[ 55.248674] r9:df60a000 r8:ffffe000 r7:df60bd9c r6:ffffffff r5:600f0013 r4:c0d79acc
[ 55.256483] [<c04077dc>] (omap_intc_handle_irq) from [<c0101a0c>] (__irq_svc+0x6c/0xa8)
[ 55.264536] Exception stack(0xdf60bd68 to 0xdf60bdb0)
[ 55.269636] bd60: 00000000 00000000 00000000 c0d03048 ffffe000 a00f0013
[ 55.277880] bd80: 00000001 0000000a ffffe000 c0d14860 00000008 df60bdd4 df60bd68 df60bdb8
[ 55.286115] bda0: c0123a6c c011d054 600f0013 ffffffff
[ 55.291204] r5:600f0013 r4:c011d054
[ 55.294828] [<c011d010>] (omap_hwmod_idle) from [<c011dd20>] (omap_device_idle+0x48/0x9c)
[ 55.303058] r5:df133240 r4:00000000
[ 55.306675] [<c011dcd8>] (omap_device_idle) from [<c011dd98>] (_od_runtime_suspend+0x24/0x28)
[ 55.315261] r7:0000000a r6:c011dd74 r5:00000000 r4:df130610
[ 55.320973] [<c011dd74>] (_od_runtime_suspend) from [<c053c40c>] (__rpm_callback+0x14c/0x238)
[ 55.329553] r5:00000000 r4:df130610
[ 55.333169] [<c053c2c0>] (__rpm_callback) from [<c053c554>] (rpm_callback+0x5c/0x88)
[ 55.340975] r10:00000008 r9:c0d14860 r8:ffffe000 r7:0000000a r6:04208060 r5:ffffe000
[ 55.348852] r4:df130610
[ 55.351420] [<c053c4f8>] (rpm_callback) from [<c053b28c>] (rpm_suspend+0x144/0x5d8)
[ 55.359133] r7:0000000a r6:c011dd74 r5:00000000 r4:df130610
[ 55.364841] [<c053b148>] (rpm_suspend) from [<c053b8e0>] (rpm_idle+0xc8/0x144)
[ 55.372124] r10:df1306b8 r9:00000000 r8:df1306c4 r7:00000000 r6:00000002 r5:00000000
[ 55.380002] r4:df130610
[ 55.382570] [<c053b818>] (rpm_idle) from [<c053ce7c>] (pm_runtime_work+0xdc/0xe0)
[ 55.390114] r9:00000000 r8:c0d0ddf8 r7:00000000 r6:dfb40000 r5:df5f6200 r4:df1306b4
[ 55.397927] [<c053cda0>] (pm_runtime_work) from [<c0142120>] (process_one_work+0x210/0x430)
[ 55.406345] [<c0141f10>] (process_one_work) from [<c01423c0>] (worker_thread+0x80/0x674)
[ 55.414501] r10:c0d0ddf8 r9:c0d0de0c r8:ffffe000 r7:c0d14860 r6:df5f6214 r5:c0d0ddf8
[ 55.422377] r4:df5f6200
[ 55.424959] [<c0142340>] (worker_thread) from [<c01484ec>] (kthread+0x158/0x160)
[ 55.432417] r10:df06fe78 r9:c0142340 r8:df5f6200 r7:df60a000 r6:00000000 r5:df5f2a40
[ 55.440294] r4:df5f2e00
[ 55.442866] [<c0148394>] (kthread) from [<c01010e8>] (ret_from_fork+0x14/0x2c)
[ 55.450134] Exception stack(0xdf60bfb0 to 0xdf60bff8)
[ 55.455229] bfa0: 00000000 00000000 00000000 00000000
[ 55.463471] bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 55.471710] bfe0: 00000000 00000000 00000000 00000000 00000013 00000000
[ 55.478381] r10:00000000 r9:00000000 r8:00000000 r7:00000000 r6:00000000 r5:c0148394
[ 55.486258] r4:df5f2a40
[ 55.488831] Code: e1a0c00d e92dd800 e24cb004 e0801001 (e1d100b0)
[ 55.494986] ---[ end trace a320ad887f389379 ]---
[ 55.499640] Kernel panic - not syncing: Fatal exception in interrupt
[ 55.506048] ---[ end Kernel panic - not syncing: Fatal exception in interrupt ]---

I use  Linux version 4.19.59 and its yocto build for AM335x.

I am attaching the defconfig and dts file...

Also i disabled the  DMA and enabled PIO mode (see below), then this crash will go away but can never get an IP address if the cable is removed and if you do ifconfig, it will crash with another kernel panic

CONFIG_MUSB_PIO_ONLY is not set
CONFIG_USB_TI_CPPI41_DMA=y

We have been chasing this issue for weeks and has become critical , any help appreciated

the defconfig and dts files are attached

cxdefconfigorig.txt

/*
 * 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.
 */
#include <dt-bindings/net/ti-dp83867.h>

/ {
	cpus {
		cpu@0 {
			cpu0-supply = <&dcdc2_reg>;
		};
	};

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

	chosen {
		stdout-path = &uart0;
	};

	vmmcsd_fixed: fixedregulator0 {
		compatible = "regulator-fixed";
		regulator-name = "vmmcsd_fixed";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
	};

	leds {
		compatible = "gpio-leds";

		led0 {
			label = "cx3:green";
			gpios = <&gpio2 16 GPIO_ACTIVE_HIGH>;
			linux,default-trigger = "heartbeat";
			default-state = "off";
		};

		led1 {
			label = "cx3:red";
			gpios = <&gpio0 8 GPIO_ACTIVE_HIGH>;
			linux,default-trigger = "heartbeat";
			default-state = "off";
		};

		led2 {
			label = "cx3:blue";
			gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>;
			linux,default-trigger = "heartbeat";
			default-state = "off";
		};

		led3 {
			label = "cx3:yellow";
			gpios = <&gpio2 17 GPIO_ACTIVE_HIGH>;
			linux,default-trigger = "heartbeat";
			default-state = "off";
		};
	   };

};
/**************************************CX3 stuff begining ******************************************************/
&am33xx_pinmux {

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

	i2c2_pins_default: i2c2_pins_default {
		pinctrl-single,pins = <
			AM33XX_IOPAD(0x97c, PIN_INPUT_PULLUP | MUX_MODE3) /* (D17) uart1_rtsn.I2C2_SCL */
			AM33XX_IOPAD(0x978, PIN_INPUT_PULLUP | MUX_MODE3) /* (D18) uart1_ctsn.I2C2_SDA */
		>;
	};

	clkout2_pin: pinmux_clkout2_pin {
		pinctrl-single,pins = <
			AM33XX_IOPAD(0x9b4, PIN_OUTPUT_PULLDOWN | MUX_MODE3)	/* xdma_event_intr1.clkout2 */
		>;
	};

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

			/* Slave 2 */
			AM33XX_IOPAD(0x840, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* (R13) gpmc_a0.rgmii2_tctl */
			AM33XX_IOPAD(0x844, PIN_INPUT_PULLDOWN | MUX_MODE2) /* (V14) gpmc_a1.rgmii2_rctl */
			AM33XX_IOPAD(0x858, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* (U15) gpmc_a6.rgmii2_tclk */
			AM33XX_IOPAD(0x85c, PIN_INPUT_PULLDOWN | MUX_MODE2) /* (T15) gpmc_a7.rgmii2_rclk */
			AM33XX_IOPAD(0x854, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* (V15) gpmc_a5.rgmii2_td0 */
			AM33XX_IOPAD(0x850, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* (R14) gpmc_a4.rgmii2_td1 */
			AM33XX_IOPAD(0x84c, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* (T14) gpmc_a3.rgmii2_td2 */
			AM33XX_IOPAD(0x848, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* (U14) gpmc_a2.rgmii2_td3 */
			AM33XX_IOPAD(0x86c, PIN_INPUT_PULLDOWN | MUX_MODE2) /* (V17) gpmc_a11.rgmii2_rd0 */
			AM33XX_IOPAD(0x868, PIN_INPUT_PULLDOWN | MUX_MODE2) /* (T16) gpmc_a10.rgmii2_rd1 */
			AM33XX_IOPAD(0x864, PIN_INPUT_PULLDOWN | MUX_MODE2) /* (U16) gpmc_a9.rgmii2_rd2 */
			AM33XX_IOPAD(0x860, PIN_INPUT_PULLDOWN | MUX_MODE2) /* (V16) gpmc_a8.rgmii2_rd3 */
		>;
	};

	cpsw_sleep: cpsw_sleep {
		pinctrl-single,pins = <
			/* Slave 1 reset value */
			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 */

			/* Slave 2 reset value */
			AM33XX_IOPAD(0x840, PIN_INPUT_PULLDOWN | MUX_MODE7) /* (R13) gpmc_a0.rgmii2_tctl */
			AM33XX_IOPAD(0x844, PIN_INPUT_PULLDOWN | MUX_MODE7) /* (V14) gpmc_a1.rgmii2_rctl */
			AM33XX_IOPAD(0x858, PIN_INPUT_PULLDOWN | MUX_MODE7) /* (U15) gpmc_a6.rgmii2_tclk */
			AM33XX_IOPAD(0x85c, PIN_INPUT_PULLDOWN | MUX_MODE7) /* (T15) gpmc_a7.rgmii2_rclk */
			AM33XX_IOPAD(0x854, PIN_INPUT_PULLDOWN | MUX_MODE7) /* (V15) gpmc_a5.rgmii2_td0 */
			AM33XX_IOPAD(0x850, PIN_INPUT_PULLDOWN | MUX_MODE7) /* (R14) gpmc_a4.rgmii2_td1 */
			AM33XX_IOPAD(0x84c, PIN_INPUT_PULLDOWN | MUX_MODE7) /* (T14) gpmc_a3.rgmii2_td2 */
			AM33XX_IOPAD(0x848, PIN_INPUT_PULLDOWN | MUX_MODE7) /* (U14) gpmc_a2.rgmii2_td3 */
			AM33XX_IOPAD(0x86c, PIN_INPUT_PULLDOWN | MUX_MODE7) /* (V17) gpmc_a11.rgmii2_rd0 */
			AM33XX_IOPAD(0x868, PIN_INPUT_PULLDOWN | MUX_MODE7) /* (T16) gpmc_a10.rgmii2_rd1 */
			AM33XX_IOPAD(0x864, PIN_INPUT_PULLDOWN | MUX_MODE7) /* (U16) gpmc_a9.rgmii2_rd2 */
			AM33XX_IOPAD(0x860, PIN_INPUT_PULLDOWN | MUX_MODE7) /* (V16) gpmc_a8.rgmii2_rd3 */
		>;
	};

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

	/* Optional sleep pin settings. Must manually enter values in the below skeleton. */
	davinci_mdio_pins_sleep: davinci_mdio_pins_sleep {
		pinctrl-single,pins = <
			AM33XX_IOPAD(0x94c, PIN_INPUT_PULLDOWN | MUX_MODE7) /* (M18) mdio_clk.mdio_clk */
			AM33XX_IOPAD(0x948, PIN_INPUT_PULLDOWN | MUX_MODE7 ) /* (M17) mdio_data.mdio_data */
		>;
	};

/* eMMC */

	emmc_pins: pinmux_emmc_pins {
		pinctrl-single,pins = <
			AM33XX_IOPAD(0x880, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_csn1.mmc1_clk */
			AM33XX_IOPAD(0x884, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_csn2.mmc1_cmd */
			AM33XX_IOPAD(0x800, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad0.mmc1_dat0 */
			AM33XX_IOPAD(0x804, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad1.mmc1_dat1 */
			AM33XX_IOPAD(0x808, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad2.mmc1_dat2 */
			AM33XX_IOPAD(0x80c, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad3.mmc1_dat3 */
			AM33XX_IOPAD(0x810, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad4.mmc1_dat4 */
			AM33XX_IOPAD(0x814, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad5.mmc1_dat5 */
			AM33XX_IOPAD(0x818, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad6.mmc1_dat6 */
			AM33XX_IOPAD(0x81c, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad7.mmc1_dat7 */
		>;
	};
	
/* SPI */
	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 */
		>;
	};

	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 */
		>;
	};	

/* UART */
	uart0_pins_default: uart0_pins_default {
		pinctrl-single,pins = <
			AM33XX_IOPAD(0x970, PIN_INPUT_PULLUP | MUX_MODE0) /* (E15) uart0_rxd.uart0_rxd */
			AM33XX_IOPAD(0x974, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* (E16) uart0_txd.uart0_txd */
		>;
	};

	uart1_pins_default: uart1_pins_default {
		pinctrl-single,pins = <
			AM33XX_IOPAD(0x980, PIN_INPUT_PULLUP | MUX_MODE0) /* (D16) uart1_rxd.uart1_rxd */
			AM33XX_IOPAD(0x984, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* (D15) uart1_txd.uart1_txd */
		>;
	};

	uart2_pins_default: uart2_pins_default {
		pinctrl-single,pins = <
		AM33XX_IOPAD(0x900, PIN_INPUT | MUX_MODE3) /* (G17) mmc0_clk.uart2_rxd */
		AM33XX_IOPAD(0x904, PIN_OUTPUT | MUX_MODE3) /* (G18) mmc0_cmd.uart2_txd */
		>;
	};

	uart4_pins_default: uart4_pins_default {
		pinctrl-single,pins = <
			AM33XX_IOPAD(0x968, PIN_INPUT_PULLUP | MUX_MODE1) /* (E18) uart0_ctsn.uart4_rxd */
			AM33XX_IOPAD(0x96c, PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* (E17) uart0_rtsn.uart4_txd */
//			AM33XX_IOPAD(0x8f4, PIN_OUTPUT | MUX_MODE2) /* (F18) mmc0_dat2.uart4_rtsn - 485_CONTROL*/
		>;
	};		
};

/* SYSTEM UART */
&uart0 {
	pinctrl-names = "default";
	pinctrl-0 = <&uart0_pins_default>;
	status = "okay";
};

/* CLI */
&uart1 {
	pinctrl-names = "default";
	pinctrl-0 = <&uart1_pins_default>;
	status = "okay";
};

/* IRD */
&uart2 {
	pinctrl-names = "default";
	pinctrl-0 = <&uart2_pins_default>;
	status = "okay";

	serIrDA-rx-during-tx;
	//serIrDA-filter = <>;
	linux,serIrDA-enabled-at-boot-time;
};

/* RS-485 */
&uart4 {
	pinctrl-names = "default";
	pinctrl-0 = <&uart4_pins_default>;
	status = "okay";

	//rts-gpio = <&gpio2 27 GPIO_ACTIVE_HIGH>;
/*
	rs485-rts-delay = <a b>
	* a - the delay between rts signal and beginning of data sent in milliseconds.
	      it corresponds to the delay before sending data.
	 * b - the delay between end of data sent and rts signal in milliseconds
	 it corresponds to the delay after sending data and actual release of the line.
*/
	//rs485-rts-active-high;
	//rs485-rx-during-tx;
	//rs485-rts-delay = <0 1>;
	//linux,rs485-enabled-at-boot-time;
};
&usb {
	status = "okay";
};

&usb_ctrl_mod {
	status = "okay";
};

&usb0_phy {
	status = "okay";
};

&usb1_phy {
	status = "okay";
};

&usb0 {
	status = "okay";
	dr_mode = "peripheral";
	interrupts-extended = <&intc 18 &tps 0>;
	interrupt-names = "mc", "vbus";
};

&usb1 {
	status = "okay";
	dr_mode = "host";
};

&cppi41dma  {
	status = "okay";
};

/* I2C */
&i2c2 {
	pinctrl-names = "default";
	pinctrl-0 = <&i2c2_pins_default>;
	status = "okay";
	clock-frequency = <40000>;
};

&i2c0 {
	pinctrl-names = "default";
	pinctrl-0 = <&i2c0_pins_default>;
	status = "okay";
	clock-frequency = <40000>;

	/* Set OPP50 (0.95V) for VDD core */
		sleep-sequence = /bits/ 8 <
				0x02 0x24 0x0b 0x6d /* Password unlock 1 */
				0x02 0x24 0x10 0x02 /* Set DCDC3 to 0.95V */
				0x02 0x24 0x0b 0x6d /* Password unlock 2 */
				0x02 0x24 0x10 0x02 /* Set DCDC3 to 0.95V */
				0x02 0x24 0x0b 0x6c /* Password unlock 1 */
				0x02 0x24 0x11 0x86 /* Apply DCDC changes */
				0x02 0x24 0x0b 0x6c /* Password unlock 2 */
				0x02 0x24 0x11 0x86 /* Apply DCDC changes */
		>;

	/* Set OPP100 (1.10V) for VDD core */
		wake-sequence = /bits/ 8 <
				0x02 0x24 0x0b 0x6d /* Password unlock 1 */
				0x02 0x24 0x10 0x08 /* Set DCDC3 to 1.1V */
				0x02 0x24 0x0b 0x6d /* Password unlock 2 */
				0x02 0x24 0x10 0x08 /* Set DCDC3 to 1.1V */
				0x02 0x24 0x0b 0x6c /* Password unlock 1 */
				0x02 0x24 0x11 0x86 /* Apply DCDC changes */
				0x02 0x24 0x0b 0x6c /* Password unlock 2 */
				0x02 0x24 0x11 0x86 /* Apply DCDC changes */
		>;

		tps: tps@24 {
			reg = <0x24>;
		};
/*
No support in drivers
		eeprom@50 {
			compatible = "microchip,24lc128";
			reg = <0x50>;
			pagesize = <64>;
			status = "okay";
		};

		tmp100@48 {
			compatible = "tmp100";
			reg = <0x48>;
			status = "okay";
		};
*/
};

/* SPI */

&spi0 {
	#address-cells = <1>;
	#size-cells = <0>;

	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&spi0_pins_default>;
/*
	channel@0 {
		#address-cells = <1>;
		#size-cells = <0>;
		compatible = "rohm,dh2228fv";
		reg = <0>;
		spi-max-frequency = <48000000>;
		//spi-cpha;
	};

*/
	sfpFpga@0 {
		compatible = "atmel,sfpFpga";
		spi-max-frequency = <48000000>;
		reg = <0>;
	};

};

&spi1 {
	#address-cells = <1>;
	#size-cells = <0>;
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&spi1_pins_default>;

	channel@0 {
		#address-cells = <1>;
		#size-cells = <0>;
		compatible = "rohm,dh2228fv";
		reg = <0>;
		spi-max-frequency = <48000000>;
		//spi-cpha;
	};
};

/include/ "tps65217.dtsi"

&tps {
	/*
	 * Configure pmic to enter OFF-state instead of SLEEP-state ("RTC-only
	 * mode") at poweroff.  Most BeagleBone versions do not support RTC-only
	 * mode and risk hardware damage if this mode is entered.
	 *
	 * For details, see linux-omap mailing list May 2015 thread
	 *	[PATCH] ARM: dts: am335x-bone* enable pmic-shutdown-controller
	 * In particular, messages:
	 *	http://www.spinics.net/lists/linux-omap/msg118585.html
	 *	http://www.spinics.net/lists/linux-omap/msg118615.html
	 *
	 * You can override this later with
	 *	&tps {  /delete-property/ ti,pmic-shutdown-controller;  }
	 * if you want to use RTC-only mode and made sure you are not affected
	 * by the hardware problems. (Tip: double-check by performing a current
	 * measurement after shutdown: it should be less than 1 mA.)
	 */

	interrupts = <7>; /* NMI */
	interrupt-parent = <&intc>;

	ti,pmic-shutdown-controller;

	charger {
		status = "okay";
	};

	pwrbutton {
		status = "okay";
	};

	regulators {
		dcdc1_reg: regulator@0 {
			regulator-name = "vdds_dpr";
			regulator-always-on;
		};

		dcdc2_reg: regulator@1 {
			/* VDD_MPU voltage limits 0.95V - 1.26V with +/-4% tolerance */
			regulator-name = "vdd_mpu";
			regulator-min-microvolt = <925000>;
			regulator-max-microvolt = <1351500>;
			regulator-boot-on;
			regulator-always-on;
		};

		dcdc3_reg: regulator@2 {
			/* VDD_CORE voltage limits 0.95V - 1.1V with +/-4% tolerance */
			regulator-name = "vdd_core";
			regulator-min-microvolt = <925000>;
			regulator-max-microvolt = <1150000>;
			regulator-boot-on;
			regulator-always-on;
		};

		ldo1_reg: regulator@3 {
			regulator-name = "vio,vrtc,vdds";
			regulator-always-on;
		};

		ldo2_reg: regulator@4 {
			regulator-name = "vdd_3v3aux";
			regulator-always-on;
		};

		ldo3_reg: regulator@5 {
			regulator-name = "vdd_1v8";
			regulator-always-on;
		};

		ldo4_reg: regulator@6 {
			regulator-name = "vdd_3v3a";
			regulator-always-on;
		};
	};
};

/* PHY */
&mac {
	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&cpsw_default>;
	pinctrl-1 = <&cpsw_sleep>;
//	dual_emac=<1>;
	status = "okay";
};

&davinci_mdio {
	pinctrl-names = "default", "sleep";
	compatible = "ti,cpsw-mdio", "ti,davinci_mdio";
	pinctrl-0 = <&davinci_mdio_pins_default>;
	pinctrl-1 = <&davinci_mdio_pins_sleep>;
	status = "okay";

	dp83867_0: ethernet-phy@0 {
		reg = <0>;
		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;
	};

	dp83867_1: ethernet-phy@1 {
		reg = <1>;
		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;
	};
};
/*swapping ids to fix hardware issue */
&cpsw_emac0 {
	phy_id = <&davinci_mdio>, <1>;
	phy-mode = "rgmii-id";
//	dual_emac_res_vlan = <2>;
};

&cpsw_emac1 {
	phy_id = <&davinci_mdio>, <0>;
	phy-mode = "rgmii-id";
//	dual_emac_res_vlan = <1>;
};

/* ADC */
&tscadc {/* touch screen adc*/
	status = "okay";
};

&am335x_adc {
	ti,adc-channels = <0 1 2 3 4 5 6 7>;
};


&wkup_m3_ipc {
	ti,scale-data-fw = "am335x-bone-scale-data.bin";
};

/**************CX3 stuff ends*************************************************************************************************/

&am33xx_pinmux {
	pinctrl-names = "default";
//	pinctrl-0 = <&clkout2_pin>;


	mmc1_pins: pinmux_mmc1_pins {
		pinctrl-single,pins = <
			AM33XX_IOPAD(0x960, PIN_INPUT | MUX_MODE7)		/* spio0_cs1.gpio0_6 */
			AM33XX_IOPAD(0x8fc, PIN_INPUT_PULLUP | MUX_MODE0)	/* mmc0_dat0.mmc0_dat0 */
			AM33XX_IOPAD(0x8f8, PIN_INPUT_PULLUP | MUX_MODE0)	/* mmc0_dat1.mmc0_dat1 */
//conflict w/ uart4
//			AM33XX_IOPAD(0x8f4, PIN_INPUT_PULLUP | MUX_MODE0)	/* mmc0_dat2.mmc0_dat2 */
			AM33XX_IOPAD(0x8f0, PIN_INPUT_PULLUP | MUX_MODE0)	/* mmc0_dat3.mmc0_dat3 */
			AM33XX_IOPAD(0x904, PIN_INPUT_PULLUP | MUX_MODE0)	/* mmc0_cmd.mmc0_cmd */
			AM33XX_IOPAD(0x900, PIN_INPUT_PULLUP | MUX_MODE0)	/* mmc0_clk.mmc0_clk */
		>;
	};


};

&mmc1 {
	status = "okay";
	bus-width = <0x4>;
	pinctrl-names = "default";
	pinctrl-0 = <&mmc1_pins>;
	cd-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
};

  • Hi Anees,

    Anees Shahul1 said:
    I have an issue with USB port , when I disconnect the cable from usb port from AM335x , I get kernel panic, or if I remove the cable and do ifconfig some times, it will crash. the kernel panic is below

    Please describe the USB topology in your setup.

    The DTS shows USB0 port is configured in peripheral-only mode and USB1 is in host-only mode? which port the cable is attached to? Is another USB port in use while disconnecting the cable?

    When you do ifconfig, it is to the CPSW Ethernet port or a USB Ethernet port?

    Please run the following script on your board after booted into linux and before trigger the issue, and provide its output.

    #!/bin/bash
    #
    # Util to check USB subsystem for Linux kernel 3.12+ on TI Sitara devices
    #
    # Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/
    #
    #
    #  Redistribution and use in source and binary forms, with or without
    #  modification, are permitted provided that the following conditions
    #  are met:
    #
    #    Redistributions of source code must retain the above copyright
    #    notice, this list of conditions and the following disclaimer.
    #
    #    Redistributions in binary form must reproduce the above copyright
    #    notice, this list of conditions and the following disclaimer in the
    #    documentation and/or other materials provided with the
    #    distribution.
    #
    #    Neither the name of Texas Instruments Incorporated nor the names of
    #    its contributors may be used to endorse or promote products derived
    #    from this software without specific prior written permission.
    #
    #  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    #  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    #  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    #  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
    #  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    #  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    #  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    #  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    #  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    #  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    #  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    
    VERSION=0.3.0
    DTPATH=/proc/device-tree
    DEVPATH=/sys/devices/platform
    KMODPATH="/lib/modules/`uname -r`"
    
    ### ENV
    # $V: debug flag
    # $PLATFORM: force g_plaform if not found in device tree
    
    ### functions ###
    
    # $1 commands to be checked
    check_command() {
        local _lst="$*"
        local _cmd
    
        for _cmd in $_lst; do
            which $_cmd > /dev/null || {
                echo "Error: $_cmd command not found"
                exit 1
            }
        done
    }
    
    # check if the kernel is supported
    # this tool only runs on v4.0+ kernel
    # return 0 - if kernel version >= 4.0
    #        1 - if kernel version < 4.0
    has_supported_kernel() {
    	local _ver
    	local _t
    
        check_command uname
        uname -a
    	_ver=`uname -r`
        _t=${_ver%%.*}
        # 3.x.x or older, unsupported
        [ $_t -ge 4 ] || return 1
        return 0
    }
    
    # define variables for musb entries in sysfs and device tree
    # output variables: USB_DT_PARENT, USB0DT, USB1DT
    #                   USB_DEV_PARENT, USB0DEV, USB1DEV
    query_musb_entries() {
        local _lst
        local _t
        local _intr
    
        check_command find
    
        # find usb entry names in device-tree
        _t=$(find ${DTPATH}/ -maxdepth 2 -name '*47400000*')
        [ -n "$_t" ] && USB_DT_PARENT=$_t || {
            echo "usb parent DT node not found in device-tree"
            exit 1
        }
    
        _lst=$(find ${USB_DT_PARENT}/ -maxdepth 1 -name 'usb@*')
        [ -n "$_lst" ] || {
            echo "usb0 and usb1 DT node not found in device-tree"
            exit 1
        }
    
        # find USB child DT node based on its interrupt number
        for _t in $_lst; do
            [[ -f "${_t}/interrupts" ]] || continue
            _intr=$(hexdump ${_t}/interrupts | head -1 | cut -d' ' -f3)
            case $_intr in
                "1200") USB0DT=$_t;;
                "1300") USB1DT=$_t;;
                *)  echo "unkown usb interrupt number $_intr"
                    exit 1
            esac
        done
    
        # find device names in sysfs
        _t=$(find ${DEVPATH}/ -maxdepth 2 -name '*47400000*')
        [ -n "$_t" ] && USB_DEV_PARENT=$_t || {
            echo "usb device not found in sysfs"
            exit 1
        }
    
        _t=$(find ${USB_DEV_PARENT}/47401400.usb/ -maxdepth 1 -name 'musb-hdrc.*')
        [ -n "$_t" ] && USB0DEV=$_t || echo "usb0 device not found in sysfs"
    
        _t=$(find ${USB_DEV_PARENT}/47401c00.usb/ -maxdepth 1 -name 'musb-hdrc.*')
        [ -n "$_t" ] && USB1DEV=$_t || echo "usb1 device not found in sysfs"
    }
    
    # check if the platform is supported
    # return 0 - if platform is supported
    #        1 - if platform is not supported
    check_platform () {
    	local _hw
    
        check_command grep
        _hw=`cat ${DTPATH}/compatible | tr '\0' ' '`
        DBG_PRINT "DT compatible: $_hw"
    
        if [[ "$_hw" == *"ti,am33xx"* ]]; then
            g_platform="am335x"
        elif [[ "$_hw" == *"ti,am43"* ]]; then
            g_platform="am437x"
        else
            # read from ENV
            g_platform=$PLATFORM
        fi
    
        DBG_PRINT "g_platform: $g_platform"
        case $g_platform in
            "am335x")
                query_musb_entries
                return 0;;
            "am437x")
                USB0DT="$(find $DTPATH -name 'usb@48390000')"
                USB1DT="$(find $DTPATH -name 'usb@483d0000')"
                return 0;;
            *)
                echo "Unsupported \"$g_platform\""
                return 1;;
        esac
    }
    
    # get kernel config options from /proc/config.gz
    # params $@ - the list of config options to query, without 'CONFIG_'
    # return - the config options settings in /proc/config.gz
    get_kernel_configs() {
        local _opts="$@"
        local _lst=""
        local _t
    
        check_command zcat grep
        for _t in $_opts; do
            [ -z "$_lst" ] &&
                _lst="^CONFIG_${_t}\>" ||
                _lst="${_lst}\|^CONFIG_${_t}\>"
        done
        [ -z "$_lst" ] || zcat /proc/config.gz | grep "$_lst"
    }
    
    # check a kernel CONFIG option
    # params $1 - the config option list returned from get_kernel_config()
    #             if "", directly check $2 from /proc/config.gz
    #        $2 - the config option to check
    #        $3 = '-q', quiet output
    # return 0 - undefined
    #        1 - defined as 'm', kernel module
    #        2 - defined as 'y', kernel builtin
    check_kernel_config() {
        local _cfg
        local _t
    
        [ -n "$2" ] || return 0
    
        if [ -z "$1" ]; then
            check_command zcat
            _cfg=`zcat /proc/config.gz | grep "^$2\>"`
        else
            for _t in $1; do
                [[ "$_t" != "${2}="? ]] || { _cfg=$_t; break; }
            done
        fi
    
        case ${_cfg#*=} in
            "y") return 2;;
            "m") return 1;;
              *) [ "$3" = "-q" ] ||
                  echo "Error: $2 is undefined in kernel config"
              return 0;;
        esac
    }
    
    # check a kernel module
    # $1 - module name, relative path from drivers/, without .ko surfix
    # return 0 - found
    #        1 - error
    check_module() {
        local _modname
        local _moddep
    
        [ -n "$1" ] || return 1
    
        _modname="${KMODPATH}/kernel/drivers/${1}.ko"
        _moddep="${KMODPATH}/modules.dep"
    
        DBG_PRINT "${1}.ko checking..."
        [ -f $_modname ] || {
            echo "Error: $_modname not found."
            echo "       Please ensure 'make module_install' is done properly."
            return 1
        }
    
        DBG_PRINT "${1}.ko found"
        [ -f $_moddep ] || $g_printed_once || {
            echo "Error: $_moddep not found."
            echo "       Please ensure 'make module_install' is done properly."
            g_printed_once=true
        }
    
        DBG_PRINT "${1}.ko moddep checked"
        check_command lsmod basename tr
    
        lsmod | grep `basename $1 | tr '-' '_'` > /dev/null || {
            DBG_PRINT ">>>> ${1}.ko not found in lsmod:"
            if grep "${1}.ko:" $_moddep > /dev/null; then
                echo "Error: $_moddep seems to be valid,"
                echo "       but `basename $1`.ko is not loaded."
                echo "       Please provide /proc/config.gz and ${KMODPATH}/*"
                echo "       for further investigation."
            else
                echo "Error: `basename $1`: $_moddep is invalid."
                echo "       Please run command 'depmod' on the target to re-generate it,"
                echo "       then reboot the target. If the issue still exists, please"
                echo "       ensure 'make module_install' is done properly."
            fi
    
            return 1
        }
        DBG_PRINT "${1}.ko done"
        return 0
    }
    
    # check kernel config, and modules (if CONFIG_*=M) for musb
    check_musb_drivers() {
        local _lst=("USB_MUSB_HDRC" "USB_MUSB_DUAL_ROLE" "USB_OTG" "USB_MUSB_DSPS" \
                    "AM335X_PHY_USB" "MUSB_PIO_ONLY" "TI_CPPI41")
        local _opts
    
        _opts=$(get_kernel_configs ${_lst[*]})
    
        check_kernel_config "$_opts" CONFIG_USB_MUSB_HDRC
        [ $? != 1 ] || check_module 'usb/musb/musb_hdrc'
    
        check_kernel_config "$_opts" CONFIG_USB_MUSB_DUAL_ROLE -q
        [ $? != 0 ] || echo "Warning: CONFIG_USB_MUSB_DUAL_ROLE undefined."
    
        check_kernel_config "$_opts" CONFIG_USB_OTG -q
        [ $? == 0 ] || echo "Warning: CONFIG_USB_OTG defined."
    
        check_kernel_config "$_opts" CONFIG_USB_MUSB_DSPS
        [ $? != 1 ] || {
            check_module 'usb/musb/musb_dsps'
        }
    
        check_kernel_config "$_opts" CONFIG_AM335X_PHY_USB
        [ $? != 1 ] || {
            check_module 'usb/phy/phy-am335x'
            check_module 'usb/phy/phy-am335x-control'
        }
    
        check_kernel_config "$_opts" CONFIG_MUSB_PIO_ONLY -q
        [ $? != 0 ] || {
           if check_kernel_config "$_opts" CONFIG_TI_CPPI41 -q; then
               echo "Error: MUSB CPPI DMA mode is enabled, but CPPI moudle is not enabled in DMA Engine."
               echo "       Please enable CONFIG_TI_CPPI41 under DMA Engine Support in kernel config."
           fi
        }
    }
    
    # check kernel config, and modules (if CONFIG_*=M) for dwc3
    check_dwc3_drivers() {
        local _lst=("USB_DWC3" "USB_DWC3_DUAL_ROLE" "USB_OTG" "USB_DWC3_OMAP" \
                    "USB_XHCI_HCD" "OMAP_CONTROL_PHY" "OMAP_USB2")
        local _opts
    
        _opts=$(get_kernel_configs ${_lst[*]})
    
        check_kernel_config "$_opts" CONFIG_USB_DWC3
        [ $? != 1 ] || check_module 'usb/dwc3/dwc3'
    
        check_kernel_config "$_opts" CONFIG_USB_DWC3_DUAL_ROLE -q
        [ $? != 0 ] || echo "Warning: CONFIG_USB_DWC3_DUAL_ROLE undefined."
    
        check_kernel_config "$_opts" CONFIG_USB_OTG -q
        [ $? == 0 ] || echo "Warning: CONFIG_USB_OTG defined."
    
        check_kernel_config "$_opts" CONFIG_USB_DWC3_OMAP
        [ $? != 1 ] || check_module 'usb/dwc3/dwc3-omap'
    
        check_kernel_config "$_opts" CONFIG_USB_XHCI_HCD
        [ $? != 1 ] || {
            check_module 'usb/host/xhci-plat-hcd'
            check_module 'usb/host/xhci-hcd'
        }
    
        check_kernel_config "$_opts" CONFIG_OMAP_CONTROL_PHY
        [ $? != 1 ] || check_module 'phy/phy-omap-control'
    
        check_kernel_config "$_opts" CONFIG_OMAP_USB2
        [ $? != 1 ] || check_module 'phy/phy-omap-usb2'
    }
    
    check_musb_dt() {
        local _dt_dir
        local _ent
        local _sts
        local _t
    
        case $USB_DT_PARENT in
            *"usb@"*)
                _ent=("control@44e10620" "usb-phy@47401300" "usb-phy@47401b00" \
                      "usb@47401000" "usb@47401800" "dma-controller@47402000")
                ;;
            *"target-module@"*)
                _ent=("usb-phy@1300" "usb-phy@1b00" "usb@1400" "usb@1800" \
                      "dma-controller@2000")
                ;;
            *)
                echo "Warning: unknown USB DT ($USB_DT_PARENT)"
                return
        esac
    
        echo "Device Tree USB node status:"
        for _t in '.' ${_ent[*]}; do
            [ -d "${USB_DT_PARENT}/${_t}/" ] || {
                echo -e "\tWarning: USB DT node $_t not found"
                continue
            }
            [ -f "${USB_DT_PARENT}/${_t}/status" ] &&
                _sts=$(tr -d '\0' <${USB_DT_PARENT}/${_t}/status) ||
                _sts="(enabled)"
            echo -e "\t$_t: $_sts"
        done
    }
    
    dump_sysfs_debugfs() {
        local _debugfs
        local _l
        local _f
    
        _debugfs=`sed -ne 's/^debugfs \(.*\) debugfs.*/\1/p' /proc/mounts`
        [ -n "$_debugfs" ] || return
    
        case $g_platform in
            am335x)
                _debugfs=$(find $_debugfs -name 'musb-hdrc.*')
                _debugfs=${_debugfs%/*}
    
                for _f in $USB0DEV $USB1DEV; do
                    _l=$(basename $_f)
                    echo "$_l: mode $(cat ${_f}/mode), $(cat ${_f}/vbus)"
                    grep -i 'power\|devctl\|testmode' ${_debugfs}/${_l}/regdump
                done
                ;;
        esac
    }
    
    check_gadget_kernel_config() {
        local _lst=("USB_ZERO" "USB_AUDIO" "USB_ETH" "USB_G_NCM" "USB_MASS_STORAGE" \
                    "USB_G_SERIAL" "USB_G_PRINTER")
        local _opts
    
        _opts=$(get_kernel_configs ${_lst[*]})
    
        check_kernel_config "$_opts" CONFIG_USB_ZERO -q ||
            echo "Gadget Kernel Config: g_zero is enabled"
        check_kernel_config "$_opts" CONFIG_USB_AUDIO -q ||
            echo "Gadget Kernel Config: g_audio is enabled"
        check_kernel_config "$_opts" CONFIG_USB_ETH -q ||
            echo "Gadget Kernel Config: g_ether is enabled"
        check_kernel_config "$_opts" CONFIG_USB_G_NCM -q ||
            echo "Gadget Kernel Config: g_ncm is enabled"
        check_kernel_config "$_opts" CONFIG_USB_MASS_STORAGE -q ||
            echo "Gadget Kernel Config: g_mass_storage is enabled"
        check_kernel_config "$_opts" CONFIG_USB_G_SERIAL -q ||
            echo "Gadget Kernel Config: g_serial is enabled"
        check_kernel_config "$_opts" CONFIG_USB_G_PRINTER -q ||
            echo "Gadget Kernel Config: g_printer is enabled"
    }
    
    ### debug ###
    
    g_log_file=/tmp/chkusb.log
    
    DBG_ENABLE() { g_dbg_enabled=true; }
    DBG_DISABLE() { g_dbg_enabled=false; }
    DBG_LOG_RESET() { ! $g_dbg_enabled || echo > $g_log_file; }
    DBG_PRINT() { ! $g_dbg_enabled || echo "$(date +%H:%M:%S) [$(basename $0)]: $*"; }
    DBG_LOG() { DBG_PRINT $* >> $g_log_file; }
    DBG_LOG_MARK() { DBG_PRINT "----------------" >> $g_log_file; }
    
    
    ### main ####
    
    g_printed_once=false
    
    echo "chkusb.sh Version $VERSION"
    
    [ "$V" = "1" ] && DBG_ENABLE && DBG_LOG_RESET || DBG_DISABLE
    
    has_supported_kernel ||
        { echo "Unsupported kernel version: `uname -r`"; exit 1; }
    check_platform || exit 2
    DBG_PRINT device: $g_platform
    [ -d ${DTPATH} ] || { echo "Error: ${DTPATH} not found"; exit 3; }
    
    check_command lsusb
    if lsusb > /dev/null 2>&1; then
        echo "USB is initialized"
    else
        echo "USB initialization failed"
    fi
    
    # check kernel configs
    
    if [ -f /proc/config.gz ]; then
        case $g_platform in
            am335x) check_musb_drivers;;
            am437x) check_dwc3_drivers;;
        esac
    else
        echo "Error: /proc/config.gz not found"
    fi
    
    dump_sysfs_debugfs
    
    # check dr_mode & gadget drivers
    
    check_command basename
    for _usb_dir in "${USB0DT}" "${USB1DT}"; do
        [ -n "$_usb_dir" ] || continue
    
        [ -f "$_usb_dir/status" ] &&
            _status=`tr -d '\0' <$_usb_dir/status` ||
            _status='(enabled)'
        _dr_mode=`tr -d '\0'  <$_usb_dir/dr_mode`
        echo `basename $_usb_dir`: $_dr_mode, $_status
    
        [ "$_status" = "disabled" -o "$_dr_mode" = "host" ] || gadget_mode=true
    done
    
    case $g_platform in
        am335x) check_musb_dt;;
        *) ;;
    esac
    
    DBG_PRINT $gadget_mode
    $gadget_mode || exit 0
    
    echo
    
    check_kernel_config "" CONFIG_USB_LIBCOMPOSITE
    case $? in
        0) echo "Error: no any gadget driver enabled"
           exit 6;;
        1) is_gadget_builtin=false;;
        2) echo "The gadget driver is built-in"
           is_gadget_builtin=true;;
    esac
    
    [[ ! -f /proc/config.gz ]] || check_gadget_kernel_config
    
    g_driver=`grep '^DRIVER=' /sys/class/udc/*/uevent 2>/dev/null`
    echo "gadget driver loaded: ${g_driver:-(none)}"
    
    [[ $is_gadget_builtin == false ]] || exit 0
    
    echo
    
    if [ -d "$KMODPATH" ]; then
        echo "The list of USB gadget drivers installed:"
        ls -1Rp ${KMODPATH}/kernel/drivers/usb/gadget/{function,legacy}/
    else
        echo "Error: $KMODPATH not found"
        echo "       Please ensure 'make modules_install' is done properly."
        exit 7
    fi
    
    # vim: ft=sh:ts=4:sw=4:et
    

  • USB0 is used, USb1 is not used.Pls see attached config file and dts file


    eth0 Link encap:Ethernet HWaddr 88:3f:4a:93:04:2f
    inet addr:192.168.10.10 Bcast:192.168.10.255 Mask:255.255.255.0
    UP BROADCAST MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
    Interrupt:50

    lo Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0.0
    inet6 addr: ::1/128 Scope:Host
    UP LOOPBACK RUNNING MTU:65536 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

    usb0 Link encap:Ethernet HWaddr 6e:d8:4e:53:49:0f
    inet addr:192.168.4.197 Bcast:192.168.4.255 Mask:255.255.255.0
    inet6 addr: fe80::6cd8:4eff:fe53:490f/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:56 errors:0 dropped:0 overruns:0 frame:0
    TX packets:15 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:5494 (5.3 KiB) TX bytes:2254 (2.2 KiB)

    dts file

    /*
    * 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.
    */
    #include <dt-bindings/net/ti-dp83867.h>

    / {

    cpus {
    cpu@0 {
    cpu0-supply = <&dcdc2_reg>;
    };
    };

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

    chosen {
    stdout-path = &uart0;
    };

    vmmcsd_fixed: fixedregulator0 {
    compatible = "regulator-fixed";
    regulator-name = "vmmcsd_fixed";
    regulator-min-microvolt = <3300000>;
    regulator-max-microvolt = <3300000>;
    };
    leds {
    compatible = "gpio-leds";


    led0 {
    label = "cx3:green";
    gpios = <&gpio2 16 GPIO_ACTIVE_HIGH>;
    linux,default-trigger = "heartbeat";
    default-state = "off";
    };

    led1 {
    label = "cx3:red";
    gpios = <&gpio0 8 GPIO_ACTIVE_HIGH>;
    linux,default-trigger = "heartbeat";
    default-state = "off";
    };

    led2 {
    label = "cx3:blue";
    gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>;
    linux,default-trigger = "heartbeat";
    default-state = "off";
    };

    led3 {
    label = "cx3:yellow";
    gpios = <&gpio2 17 GPIO_ACTIVE_HIGH>;
    linux,default-trigger = "heartbeat";
    default-state = "off";
    };
    };
    };

    /**************************************CX3 stuff begining ******************************************************/
    &am33xx_pinmux {

    #if 0
    cx3_heartbeatred_default:cx3_heartbeatred_default {

    pinctrl-single,pins = <
    AM33XX_IOPAD(0x8d0, PIN_OUTPUT_PULLUP | MUX_MODE7) /* (V6) lcd_data12.gpio0[8]
    >;

    };
    cx3_heartbeatgreen_default:cx3_heartbeatred_default {

    pinctrl-single,pins = <
    AM33XX_IOPAD(0x8c8, PIN_OUTPUT_PULLUP | MUX_MODE7) /* (U5) lcd_data10.gpio2[16]
    >;

    };
    cx3_heartbeatblue_default:cx3_heartbeatred_default {

    pinctrl-single,pins = <
    AM33XX_IOPAD(0x8d0, PIN_OUTPUT_PULLUP | MUX_MODE7) /* (V6) lcd_data12.gpio0[8] */
    AM33XX_IOPAD(0x8c8, PIN_OUTPUT_PULLUP | MUX_MODE7) /* (U5) lcd_data10.gpio2[16] */
    >;

    };
    cx3_heartbeatyellow_default:cx3_heartbeatred_default {

    pinctrl-single,pins = <
    AM33XX_IOPAD(0x8d0, PIN_OUTPUT_PULLUP | MUX_MODE7) /* (V6) lcd_data12.gpio0[8] */
    AM33XX_IOPAD(0x8c8, PIN_OUTPUT_PULLUP | MUX_MODE7) /* (U5) lcd_data10.gpio2[16] */
    >;

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

    i2c2_pins_default: i2c2_pins_default {
    pinctrl-single,pins = <
    AM33XX_IOPAD(0x97c, PIN_INPUT_PULLUP | MUX_MODE3) /* (D17) uart1_rtsn.I2C2_SCL */
    AM33XX_IOPAD(0x978, PIN_INPUT_PULLUP | MUX_MODE3) /* (D18) uart1_ctsn.I2C2_SDA */
    >;
    };

    clkout2_pin: pinmux_clkout2_pin {
    pinctrl-single,pins = <
    AM33XX_IOPAD(0x9b4, PIN_OUTPUT_PULLDOWN | MUX_MODE3) /* xdma_event_intr1.clkout2 */
    >;
    };
    #if 0
    user_leds_default: user_leds_default {
    pinctrl-single,pins = <
    AM33XX_IOPAD(0x8c8, PIN_OUTPUT_PULLUP | MUX_MODE7) /* (U5) lcd_data10.gpio2[16] */
    >;
    };
    user_leds_sleep: user_leds_sleep {
    pinctrl-single,pins = <
    AM33XX_IOPAD(0x8c8, PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* (U5) lcd_data10.gpio2[16] */
    >;
    };
    #endif
    /* RGMII */
    cpsw_default: cpsw_default {
    pinctrl-single,pins = <
    /* Slave 1 */
    AM33XX_IOPAD(0x914, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* (J16) gmii1_txen.rgmii1_tctl */
    AM33XX_IOPAD(0x918, PIN_INPUT_PULLDOWN | MUX_MODE2) /* (J17) gmii1_rxdv.rgmii1_rctl */
    AM33XX_IOPAD(0x92c, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* (K18) gmii1_txclk.rgmii1_tclk */
    AM33XX_IOPAD(0x930, PIN_INPUT_PULLDOWN | MUX_MODE2) /* (L18) gmii1_rxclk.rgmii1_rclk */
    AM33XX_IOPAD(0x928, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* (K17) gmii1_txd0.rgmii1_td0 */
    AM33XX_IOPAD(0x924, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* (K16) gmii1_txd1.rgmii1_td1 */
    AM33XX_IOPAD(0x920, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* (K15) gmii1_txd2.rgmii1_td2 */
    AM33XX_IOPAD(0x91c, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* (J18) gmii1_txd3.rgmii1_td3 */
    AM33XX_IOPAD(0x940, PIN_INPUT_PULLDOWN | MUX_MODE2) /* (M16) gmii1_rxd0.rgmii1_rd0 */
    AM33XX_IOPAD(0x93c, PIN_INPUT_PULLDOWN | MUX_MODE2) /* (L15) gmii1_rxd1.rgmii1_rd1 */
    AM33XX_IOPAD(0x938, PIN_INPUT_PULLDOWN | MUX_MODE2) /* (L16) gmii1_rxd2.rgmii1_rd2 */
    AM33XX_IOPAD(0x934, PIN_INPUT_PULLDOWN | MUX_MODE2) /* (L17) gmii1_rxd3.rgmii1_rd3 */

    /* Slave 2 */
    AM33XX_IOPAD(0x840, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* (R13) gpmc_a0.rgmii2_tctl */
    AM33XX_IOPAD(0x844, PIN_INPUT_PULLDOWN | MUX_MODE2) /* (V14) gpmc_a1.rgmii2_rctl */
    AM33XX_IOPAD(0x858, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* (U15) gpmc_a6.rgmii2_tclk */
    AM33XX_IOPAD(0x85c, PIN_INPUT_PULLDOWN | MUX_MODE2) /* (T15) gpmc_a7.rgmii2_rclk */
    AM33XX_IOPAD(0x854, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* (V15) gpmc_a5.rgmii2_td0 */
    AM33XX_IOPAD(0x850, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* (R14) gpmc_a4.rgmii2_td1 */
    AM33XX_IOPAD(0x84c, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* (T14) gpmc_a3.rgmii2_td2 */
    AM33XX_IOPAD(0x848, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* (U14) gpmc_a2.rgmii2_td3 */
    AM33XX_IOPAD(0x86c, PIN_INPUT_PULLDOWN | MUX_MODE2) /* (V17) gpmc_a11.rgmii2_rd0 */
    AM33XX_IOPAD(0x868, PIN_INPUT_PULLDOWN | MUX_MODE2) /* (T16) gpmc_a10.rgmii2_rd1 */
    AM33XX_IOPAD(0x864, PIN_INPUT_PULLDOWN | MUX_MODE2) /* (U16) gpmc_a9.rgmii2_rd2 */
    AM33XX_IOPAD(0x860, PIN_INPUT_PULLDOWN | MUX_MODE2) /* (V16) gpmc_a8.rgmii2_rd3 */
    >;
    };

    cpsw_sleep: cpsw_sleep {
    pinctrl-single,pins = <
    /* Slave 1 reset value */
    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 */

    /* Slave 2 reset value */
    AM33XX_IOPAD(0x840, PIN_INPUT_PULLDOWN | MUX_MODE7) /* (R13) gpmc_a0.rgmii2_tctl */
    AM33XX_IOPAD(0x844, PIN_INPUT_PULLDOWN | MUX_MODE7) /* (V14) gpmc_a1.rgmii2_rctl */
    AM33XX_IOPAD(0x858, PIN_INPUT_PULLDOWN | MUX_MODE7) /* (U15) gpmc_a6.rgmii2_tclk */
    AM33XX_IOPAD(0x85c, PIN_INPUT_PULLDOWN | MUX_MODE7) /* (T15) gpmc_a7.rgmii2_rclk */
    AM33XX_IOPAD(0x854, PIN_INPUT_PULLDOWN | MUX_MODE7) /* (V15) gpmc_a5.rgmii2_td0 */
    AM33XX_IOPAD(0x850, PIN_INPUT_PULLDOWN | MUX_MODE7) /* (R14) gpmc_a4.rgmii2_td1 */
    AM33XX_IOPAD(0x84c, PIN_INPUT_PULLDOWN | MUX_MODE7) /* (T14) gpmc_a3.rgmii2_td2 */
    AM33XX_IOPAD(0x848, PIN_INPUT_PULLDOWN | MUX_MODE7) /* (U14) gpmc_a2.rgmii2_td3 */
    AM33XX_IOPAD(0x86c, PIN_INPUT_PULLDOWN | MUX_MODE7) /* (V17) gpmc_a11.rgmii2_rd0 */
    AM33XX_IOPAD(0x868, PIN_INPUT_PULLDOWN | MUX_MODE7) /* (T16) gpmc_a10.rgmii2_rd1 */
    AM33XX_IOPAD(0x864, PIN_INPUT_PULLDOWN | MUX_MODE7) /* (U16) gpmc_a9.rgmii2_rd2 */
    AM33XX_IOPAD(0x860, PIN_INPUT_PULLDOWN | MUX_MODE7) /* (V16) gpmc_a8.rgmii2_rd3 */
    >;
    };

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

    /* Optional sleep pin settings. Must manually enter values in the below skeleton. */
    davinci_mdio_pins_sleep: davinci_mdio_pins_sleep {
    pinctrl-single,pins = <
    AM33XX_IOPAD(0x94c, PIN_INPUT_PULLDOWN | MUX_MODE7) /* (M18) mdio_clk.mdio_clk */
    AM33XX_IOPAD(0x948, PIN_INPUT_PULLDOWN | MUX_MODE7 ) /* (M17) mdio_data.mdio_data */
    >;
    };

    /* eMMC */

    emmc_pins: pinmux_emmc_pins {
    pinctrl-single,pins = <
    AM33XX_IOPAD(0x880, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_csn1.mmc1_clk */
    AM33XX_IOPAD(0x884, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_csn2.mmc1_cmd */
    AM33XX_IOPAD(0x800, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad0.mmc1_dat0 */
    AM33XX_IOPAD(0x804, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad1.mmc1_dat1 */
    AM33XX_IOPAD(0x808, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad2.mmc1_dat2 */
    AM33XX_IOPAD(0x80c, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad3.mmc1_dat3 */
    AM33XX_IOPAD(0x810, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad4.mmc1_dat4 */
    AM33XX_IOPAD(0x814, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad5.mmc1_dat5 */
    AM33XX_IOPAD(0x818, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad6.mmc1_dat6 */
    AM33XX_IOPAD(0x81c, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad7.mmc1_dat7 */
    >;
    };

    /* SPI */
    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 */
    >;
    };

    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 */
    >;
    };

    /* UART */
    uart0_pins_default: uart0_pins_default {
    pinctrl-single,pins = <
    AM33XX_IOPAD(0x970, PIN_INPUT_PULLUP | MUX_MODE0) /* (E15) uart0_rxd.uart0_rxd */
    AM33XX_IOPAD(0x974, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* (E16) uart0_txd.uart0_txd */
    >;
    };

    uart1_pins_default: uart1_pins_default {
    pinctrl-single,pins = <
    AM33XX_IOPAD(0x980, PIN_INPUT_PULLUP | MUX_MODE0) /* (D16) uart1_rxd.uart1_rxd */
    AM33XX_IOPAD(0x984, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* (D15) uart1_txd.uart1_txd */
    >;
    };

    uart2_pins_default: uart2_pins_default {
    pinctrl-single,pins = <
    AM33XX_IOPAD(0x900, PIN_INPUT | MUX_MODE3) /* (G17) mmc0_clk.uart2_rxd */
    AM33XX_IOPAD(0x904, PIN_OUTPUT | MUX_MODE3) /* (G18) mmc0_cmd.uart2_txd */
    >;
    };
    #if 1
    uart4_pins_default: uart4_pins_default {
    pinctrl-single,pins = <
    AM33XX_IOPAD(0x968, PIN_INPUT_PULLUP | MUX_MODE1) /* (E18) uart0_ctsn.uart4_rxd */
    AM33XX_IOPAD(0x96c, PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* (E17) uart0_rtsn.uart4_txd */
    // AM33XX_IOPAD(0x8f4, PIN_OUTPUT | MUX_MODE2) /* (F18) mmc0_dat2.uart4_rtsn - 485_CONTROL*/
    >;
    };
    #endif
    };

    /* SYSTEM UART */
    &uart0 {
    pinctrl-names = "default";
    pinctrl-0 = <&uart0_pins_default>;
    status = "okay";
    };

    /* CLI */
    &uart1 {
    pinctrl-names = "default";
    pinctrl-0 = <&uart1_pins_default>;
    status = "okay";
    };

    /* IRD */
    &uart2 {
    pinctrl-names = "default";
    pinctrl-0 = <&uart2_pins_default>;
    status = "okay";

    serIrDA-rx-during-tx;
    //serIrDA-filter = <>;
    linux,serIrDA-enabled-at-boot-time;
    };


    /* RS-485 */
    &uart4 {
    pinctrl-names = "default";
    pinctrl-0 = <&uart4_pins_default>;
    status = "okay";

    //rts-gpio = <&gpio2 27 GPIO_ACTIVE_HIGH>;
    /*
    rs485-rts-delay = <a b>
    * a - the delay between rts signal and beginning of data sent in milliseconds.
    it corresponds to the delay before sending data.
    * b - the delay between end of data sent and rts signal in milliseconds
    it corresponds to the delay after sending data and actual release of the line.
    */
    //rs485-rts-active-high;
    //rs485-rx-during-tx;
    //rs485-rts-delay = <0 1>;
    //linux,rs485-enabled-at-boot-time;
    };

    &usb {
    status = "okay";
    };

    &usb_ctrl_mod {
    status = "okay";
    };

    &usb0_phy {
    status = "okay";
    };
    /*
    &usb1_phy {
    status = "okay";
    }; */

    &usb0 {
    status = "okay";
    dr_mode = "peripheral";
    interrupts-extended = <&intc 18 &tps 0>;
    interrupt-names = "mc", "vbus";
    };

    /*&usb1 {
    status = "okay";
    dr_mode = "host";
    };*/


    &cppi41dma {
    status = "okay";
    };


    /* I2C */
    &i2c2 {
    pinctrl-names = "default";
    pinctrl-0 = <&i2c2_pins_default>;
    status = "okay";
    clock-frequency = <40000>;
    };

    &i2c0 {
    pinctrl-names = "default";
    pinctrl-0 = <&i2c0_pins_default>;
    status = "okay";
    clock-frequency = <40000>;

    /* Set OPP50 (0.95V) for VDD core */
    sleep-sequence = /bits/ 8 <
    0x02 0x24 0x0b 0x6d /* Password unlock 1 */
    0x02 0x24 0x10 0x02 /* Set DCDC3 to 0.95V */
    0x02 0x24 0x0b 0x6d /* Password unlock 2 */
    0x02 0x24 0x10 0x02 /* Set DCDC3 to 0.95V */
    0x02 0x24 0x0b 0x6c /* Password unlock 1 */
    0x02 0x24 0x11 0x86 /* Apply DCDC changes */
    0x02 0x24 0x0b 0x6c /* Password unlock 2 */
    0x02 0x24 0x11 0x86 /* Apply DCDC changes */
    >;

    /* Set OPP100 (1.10V) for VDD core */
    wake-sequence = /bits/ 8 <
    0x02 0x24 0x0b 0x6d /* Password unlock 1 */
    0x02 0x24 0x10 0x08 /* Set DCDC3 to 1.1V */
    0x02 0x24 0x0b 0x6d /* Password unlock 2 */
    0x02 0x24 0x10 0x08 /* Set DCDC3 to 1.1V */
    0x02 0x24 0x0b 0x6c /* Password unlock 1 */
    0x02 0x24 0x11 0x86 /* Apply DCDC changes */
    0x02 0x24 0x0b 0x6c /* Password unlock 2 */
    0x02 0x24 0x11 0x86 /* Apply DCDC changes */
    >;

    tps: tps@24 {
    reg = <0x24>;
    };
    /*
    No support in drivers
    eeprom@50 {
    compatible = "microchip,24lc128";
    reg = <0x50>;
    pagesize = <64>;
    status = "okay";
    };

    tmp100@48 {
    compatible = "tmp100";
    reg = <0x48>;
    status = "okay";
    };
    */
    };

    /* SPI */

    &spi0 {
    #address-cells = <1>;
    #size-cells = <0>;

    status = "okay";
    pinctrl-names = "default";
    pinctrl-0 = <&spi0_pins_default>;
    /*
    channel@0 {
    #address-cells = <1>;
    #size-cells = <0>;
    compatible = "rohm,dh2228fv";
    reg = <0>;
    spi-max-frequency = <48000000>;
    //spi-cpha;
    };

    */
    sfpFpga@0 {
    compatible = "atmel,sfpFpga";
    spi-max-frequency = <48000000>;
    reg = <0>;
    };

    };

    &spi1 {
    #address-cells = <1>;
    #size-cells = <0>;
    status = "okay";
    pinctrl-names = "default";
    pinctrl-0 = <&spi1_pins_default>;

    channel@0 {
    #address-cells = <1>;
    #size-cells = <0>;
    compatible = "rohm,dh2228fv";
    reg = <0>;
    spi-max-frequency = <48000000>;
    //spi-cpha;
    };
    };

    /include/ "tps65217.dtsi"

    &tps {
    /*
    * Configure pmic to enter OFF-state instead of SLEEP-state ("RTC-only
    * mode") at poweroff. Most BeagleBone versions do not support RTC-only
    * mode and risk hardware damage if this mode is entered.
    *
    * For details, see linux-omap mailing list May 2015 thread
    * [PATCH] ARM: dts: am335x-bone* enable pmic-shutdown-controller
    * In particular, messages:
    * www.spinics.net/.../msg118585.html
    * www.spinics.net/.../msg118615.html
    *
    * You can override this later with
    * &tps { /delete-property/ ti,pmic-shutdown-controller; }
    * if you want to use RTC-only mode and made sure you are not affected
    * by the hardware problems. (Tip: double-check by performing a current
    * measurement after shutdown: it should be less than 1 mA.)
    */

    interrupts = <7>; /* NMI */
    interrupt-parent = <&intc>;

    ti,pmic-shutdown-controller;

    charger {
    status = "okay";
    };

    pwrbutton {
    status = "okay";
    };

    regulators {
    dcdc1_reg: regulator@0 {
    regulator-name = "vdds_dpr";
    regulator-always-on;
    };

    dcdc2_reg: regulator@1 {
    /* VDD_MPU voltage limits 0.95V - 1.26V with +/-4% tolerance */
    regulator-name = "vdd_mpu";
    regulator-min-microvolt = <925000>;
    regulator-max-microvolt = <1351500>;
    regulator-boot-on;
    regulator-always-on;
    };

    dcdc3_reg: regulator@2 {
    /* VDD_CORE voltage limits 0.95V - 1.1V with +/-4% tolerance */
    regulator-name = "vdd_core";
    regulator-min-microvolt = <925000>;
    regulator-max-microvolt = <1150000>;
    regulator-boot-on;
    regulator-always-on;
    };

    ldo1_reg: regulator@3 {
    regulator-name = "vio,vrtc,vdds";
    regulator-always-on;
    };

    ldo2_reg: regulator@4 {
    regulator-name = "vdd_3v3aux";
    regulator-always-on;
    };

    ldo3_reg: regulator@5 {
    regulator-name = "vdd_1v8";
    regulator-always-on;
    };

    ldo4_reg: regulator@6 {
    regulator-name = "vdd_3v3a";
    regulator-always-on;
    };
    };
    };

    /* PHY */
    &mac {
    pinctrl-names = "default", "sleep";
    pinctrl-0 = <&cpsw_default>;
    pinctrl-1 = <&cpsw_sleep>;
    // dual_emac=<1>;
    status = "okay";
    };

    &davinci_mdio {
    pinctrl-names = "default", "sleep";
    compatible = "ti,cpsw-mdio", "ti,davinci_mdio";
    pinctrl-0 = <&davinci_mdio_pins_default>;
    pinctrl-1 = <&davinci_mdio_pins_sleep>;
    status = "okay";

    dp83867_0: ethernet-phy@0 {
    reg = <0>;
    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;
    };

    dp83867_1: ethernet-phy@1 {
    reg = <1>;
    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;
    };
    };
    /*swapping ids to fix hardware issue */
    &cpsw_emac0 {
    phy_id = <&davinci_mdio>, <1>;
    phy-mode = "rgmii-id";
    // dual_emac_res_vlan = <2>;
    };

    &cpsw_emac1 {
    phy_id = <&davinci_mdio>, <0>;
    phy-mode = "rgmii-id";
    // dual_emac_res_vlan = <1>;
    };

    /* ADC */
    &tscadc {/* touch screen adc*/
    status = "okay";
    };

    &am335x_adc {
    ti,adc-channels = <0 1 2 3 4 5 6 7>;
    };


    &wkup_m3_ipc {
    ti,scale-data-fw = "am335x-bone-scale-data.bin";
    };

    /**************CX3 stuff ends*************************************************************************************************/

    &am33xx_pinmux {
    pinctrl-names = "default";
    // pinctrl-0 = <&clkout2_pin>;


    mmc1_pins: pinmux_mmc1_pins {
    pinctrl-single,pins = <
    AM33XX_IOPAD(0x960, PIN_INPUT | MUX_MODE7) /* spio0_cs1.gpio0_6 */
    AM33XX_IOPAD(0x8fc, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_dat0.mmc0_dat0 */
    AM33XX_IOPAD(0x8f8, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_dat1.mmc0_dat1 */
    //conflict w/ uart4
    // AM33XX_IOPAD(0x8f4, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_dat2.mmc0_dat2 */
    AM33XX_IOPAD(0x8f0, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_dat3.mmc0_dat3 */
    AM33XX_IOPAD(0x904, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_cmd.mmc0_cmd */
    AM33XX_IOPAD(0x900, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_clk.mmc0_clk */
    >;
    };


    };

    &mmc1 {
    status = "okay";
    bus-width = <0x4>;
    pinctrl-names = "default";
    pinctrl-0 = <&mmc1_pins>;
    cd-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
    };
    /{
    #if 0
    cx3gpios {
    pinctrl-names = "default";
    pinctrl-0 = <&cx3_gpio_default>;

    compatible = "gpio-leds";
    gpios = <&gpio0 8 GPIO_ACTIVE_HIGH>;
    };
    #endif

    };

  • chkusb.sh Version 0.3.0
    Linux at-cx3 4.19.59-g0f1afd933-dirty #1 PREEMPT Sat Jan 30 01:29:48 UTC 2021 ar mv7l GNU/Linux
    ./3286.chkusb.sh: line 103: hexdump: command not found
    unkown usb interrupt number

  • ./chkusb.sh

    chkusb.sh Version 0.3.0

    Linux at-cx3 4.19.59-g45a8a6025-dirty #1 PREEMPT Mon Feb 1 17:34:22 UTC 2021 armv7l GNU/Linux

    USB is initialized

    Warning: CONFIG_USB_OTG defined.

    musb-hdrc.0: mode b_peripheral, Vbus on, timeout 1100 msec

    /sys/kernel/debug/musb-hdrc.0/regdump:Power       : f0

    /sys/kernel/debug/musb-hdrc.0/regdump:Testmode    : 00

    /sys/kernel/debug/musb-hdrc.0/regdump:DevCtl      : 99

    musb-hdrc.1: mode a_wait_bcon, Vbus off, timeout 1100 msec

    /sys/kernel/debug/musb-hdrc.1/regdump:Power       : e0

    /sys/kernel/debug/musb-hdrc.1/regdump:Testmode    : 00

    /sys/kernel/debug/musb-hdrc.1/regdump:DevCtl      : 80

    usb@47401000: peripheral, okay

    usb@47401800: host, okay

    Device Tree USB node status:

            .: okay

            control@44e10620: okay

            usb-phy@47401300: okay

            usb-phy@47401b00: okay

            usb@47401000: okay

            usb@47401800: okay

            dma-controller@47402000: okay

     

    The gadget driver is built-in

    Gadget Kernel Config: g_ether is enabled

    gadget driver loaded: DRIVER=g_ether

    root@at-cx3:/usr/bin/arris#

  • Hi Anees,

    What is the OS running on the USB host?

    I am not sure what causes the issue. Just for testing, please do the following change in your kernel:

    1. change usb0 dr_mode from "peripheral" to "otg" in DTS;

    2. configure kernel to build g_ether driver as module, not build it in kernel. And do 'modprobe g_ether" on your board linux prompt to load this driver after booted;

    3. do the test to see if the issue still happen.

  • Hi

    I followed a TI document where USB configuration is mentioned

    https://training.ti.com/sites/default/files/docs/usb-m3-dwc3-kernel-config.pdf . changed my configuration . Also out USB1 back into dts.
     Most importantly I changed MUSB mode to PIO only and not DMA. now there is no kernel crash, I can connect and disconnect.
    Just to be clear we started with evm config in yocto build and started having this problem. 
    Specially i traced the issue to MUSB driver musb_cppi41.c , (This is already mentioned in the beginning of this issue posts). I am still not  very sure about why it happend ? and what we got is really stable so we can get this out to customers. We will be testing this in coming days
    Pls take a look at defconfig, dts and pls try to see why would the original crash happen with a different set of configuration
    Thanks
    Anees
    /*
     * 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.
     */
    #include <dt-bindings/net/ti-dp83867.h>
    
    / {
    
    	cpus {
    		cpu@0 {
    			cpu0-supply = <&dcdc2_reg>;
    		};
    	};
    
    	memory@80000000 {
    		device_type = "memory";
    		reg = <0x80000000 0x10000000>; /* 256 MB */
    	};
    
    	chosen {
    		stdout-path = &uart0;
    	};
    
    	vmmcsd_fixed: fixedregulator0 {
    		compatible = "regulator-fixed";
    		regulator-name = "vmmcsd_fixed";
    		regulator-min-microvolt = <3300000>;
    		regulator-max-microvolt = <3300000>;
    	};
    leds {
    		compatible = "gpio-leds";
    
    
    		led0 {
    			label = "cx3:green";
    			gpios = <&gpio2 16 GPIO_ACTIVE_HIGH>;
    			linux,default-trigger = "heartbeat";
    			default-state = "off";
    		};
    
    		led1 {
    			label = "cx3:red";
    			gpios = <&gpio0 8 GPIO_ACTIVE_HIGH>;
    			linux,default-trigger = "heartbeat";
    			default-state = "off";
    		};
    
    		led2 {
    			label = "cx3:blue";
    			gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>;
    			linux,default-trigger = "heartbeat";
    			default-state = "off";
    		};
    
    		led3 {
    			label = "cx3:yellow";
    			gpios = <&gpio2 17 GPIO_ACTIVE_HIGH>;
    			linux,default-trigger = "heartbeat";
    			default-state = "off";
    		};
    	   };
    };
    
    /**************************************CX3 stuff begining ******************************************************/
    &am33xx_pinmux {
    
    #if 0
    		cx3_heartbeatred_default:cx3_heartbeatred_default {
    
    			pinctrl-single,pins = <
    				AM33XX_IOPAD(0x8d0, PIN_OUTPUT_PULLUP | MUX_MODE7) /* (V6) lcd_data12.gpio0[8] 
    			>;
    	
    		};
    		cx3_heartbeatgreen_default:cx3_heartbeatred_default {
    
    			pinctrl-single,pins = <
    				AM33XX_IOPAD(0x8c8, PIN_OUTPUT_PULLUP | MUX_MODE7) /* (U5) lcd_data10.gpio2[16] 
    			>;
    	
    		};
    		cx3_heartbeatblue_default:cx3_heartbeatred_default {
    
    			pinctrl-single,pins = <
    				AM33XX_IOPAD(0x8d0, PIN_OUTPUT_PULLUP | MUX_MODE7) /* (V6) lcd_data12.gpio0[8] */
    				AM33XX_IOPAD(0x8c8, PIN_OUTPUT_PULLUP | MUX_MODE7) /* (U5) lcd_data10.gpio2[16] */
    			>;
    	
    		};
    		cx3_heartbeatyellow_default:cx3_heartbeatred_default {
    
    			pinctrl-single,pins = <
    				AM33XX_IOPAD(0x8d0, PIN_OUTPUT_PULLUP | MUX_MODE7) /* (V6) lcd_data12.gpio0[8] */
    				AM33XX_IOPAD(0x8c8, PIN_OUTPUT_PULLUP | MUX_MODE7) /* (U5) lcd_data10.gpio2[16] */
    			>;
    	
    		}; 
    #endif
    /* i2c */
    	i2c0_pins_default: i2c0_pins_default {
    		pinctrl-single,pins = <
    			AM33XX_IOPAD(0x98c, PIN_INPUT_PULLUP | MUX_MODE0) /* (C16) I2C0_SCL.I2C0_SCL */
    			AM33XX_IOPAD(0x988, PIN_INPUT_PULLUP | MUX_MODE0) /* (C17) I2C0_SDA.I2C0_SDA */
    		>;
    	};
    
    	i2c2_pins_default: i2c2_pins_default {
    		pinctrl-single,pins = <
    			AM33XX_IOPAD(0x97c, PIN_INPUT_PULLUP | MUX_MODE3) /* (D17) uart1_rtsn.I2C2_SCL */
    			AM33XX_IOPAD(0x978, PIN_INPUT_PULLUP | MUX_MODE3) /* (D18) uart1_ctsn.I2C2_SDA */
    		>;
    	};
    
    	clkout2_pin: pinmux_clkout2_pin {
    		pinctrl-single,pins = <
    			AM33XX_IOPAD(0x9b4, PIN_OUTPUT_PULLDOWN | MUX_MODE3)	/* xdma_event_intr1.clkout2 */
    		>;
    	};
    #if 0
    	user_leds_default: user_leds_default {
    		pinctrl-single,pins = <
    			AM33XX_IOPAD(0x8c8, PIN_OUTPUT_PULLUP | MUX_MODE7) /* (U5) lcd_data10.gpio2[16] */
    			>;
    		};
    	user_leds_sleep: user_leds_sleep {
    			pinctrl-single,pins = <
    			AM33XX_IOPAD(0x8c8, PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* (U5) lcd_data10.gpio2[16] */
    			>;
    		};	
    #endif
    /* RGMII */ 
    	cpsw_default: cpsw_default {
    		pinctrl-single,pins = <
    		    /* Slave 1 */ 
    			AM33XX_IOPAD(0x914, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* (J16) gmii1_txen.rgmii1_tctl */
    			AM33XX_IOPAD(0x918, PIN_INPUT_PULLDOWN | MUX_MODE2) /* (J17) gmii1_rxdv.rgmii1_rctl */
    			AM33XX_IOPAD(0x92c, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* (K18) gmii1_txclk.rgmii1_tclk */
    			AM33XX_IOPAD(0x930, PIN_INPUT_PULLDOWN | MUX_MODE2) /* (L18) gmii1_rxclk.rgmii1_rclk */
    			AM33XX_IOPAD(0x928, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* (K17) gmii1_txd0.rgmii1_td0 */
    			AM33XX_IOPAD(0x924, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* (K16) gmii1_txd1.rgmii1_td1 */
    			AM33XX_IOPAD(0x920, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* (K15) gmii1_txd2.rgmii1_td2 */
    			AM33XX_IOPAD(0x91c, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* (J18) gmii1_txd3.rgmii1_td3 */
    			AM33XX_IOPAD(0x940, PIN_INPUT_PULLDOWN | MUX_MODE2) /* (M16) gmii1_rxd0.rgmii1_rd0 */
    			AM33XX_IOPAD(0x93c, PIN_INPUT_PULLDOWN | MUX_MODE2) /* (L15) gmii1_rxd1.rgmii1_rd1 */
    			AM33XX_IOPAD(0x938, PIN_INPUT_PULLDOWN | MUX_MODE2) /* (L16) gmii1_rxd2.rgmii1_rd2 */
    			AM33XX_IOPAD(0x934, PIN_INPUT_PULLDOWN | MUX_MODE2) /* (L17) gmii1_rxd3.rgmii1_rd3 */
    
    			/* Slave 2 */
    			AM33XX_IOPAD(0x840, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* (R13) gpmc_a0.rgmii2_tctl */
    			AM33XX_IOPAD(0x844, PIN_INPUT_PULLDOWN | MUX_MODE2) /* (V14) gpmc_a1.rgmii2_rctl */
    			AM33XX_IOPAD(0x858, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* (U15) gpmc_a6.rgmii2_tclk */
    			AM33XX_IOPAD(0x85c, PIN_INPUT_PULLDOWN | MUX_MODE2) /* (T15) gpmc_a7.rgmii2_rclk */
    			AM33XX_IOPAD(0x854, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* (V15) gpmc_a5.rgmii2_td0 */
    			AM33XX_IOPAD(0x850, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* (R14) gpmc_a4.rgmii2_td1 */
    			AM33XX_IOPAD(0x84c, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* (T14) gpmc_a3.rgmii2_td2 */
    			AM33XX_IOPAD(0x848, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* (U14) gpmc_a2.rgmii2_td3 */
    			AM33XX_IOPAD(0x86c, PIN_INPUT_PULLDOWN | MUX_MODE2) /* (V17) gpmc_a11.rgmii2_rd0 */
    			AM33XX_IOPAD(0x868, PIN_INPUT_PULLDOWN | MUX_MODE2) /* (T16) gpmc_a10.rgmii2_rd1 */
    			AM33XX_IOPAD(0x864, PIN_INPUT_PULLDOWN | MUX_MODE2) /* (U16) gpmc_a9.rgmii2_rd2 */
    			AM33XX_IOPAD(0x860, PIN_INPUT_PULLDOWN | MUX_MODE2) /* (V16) gpmc_a8.rgmii2_rd3 */
    		>;
    	};
    
    	cpsw_sleep: cpsw_sleep {
    		pinctrl-single,pins = <
    			/* Slave 1 reset value */
    			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 */
    
    			/* Slave 2 reset value */
    			AM33XX_IOPAD(0x840, PIN_INPUT_PULLDOWN | MUX_MODE7) /* (R13) gpmc_a0.rgmii2_tctl */
    			AM33XX_IOPAD(0x844, PIN_INPUT_PULLDOWN | MUX_MODE7) /* (V14) gpmc_a1.rgmii2_rctl */
    			AM33XX_IOPAD(0x858, PIN_INPUT_PULLDOWN | MUX_MODE7) /* (U15) gpmc_a6.rgmii2_tclk */
    			AM33XX_IOPAD(0x85c, PIN_INPUT_PULLDOWN | MUX_MODE7) /* (T15) gpmc_a7.rgmii2_rclk */
    			AM33XX_IOPAD(0x854, PIN_INPUT_PULLDOWN | MUX_MODE7) /* (V15) gpmc_a5.rgmii2_td0 */
    			AM33XX_IOPAD(0x850, PIN_INPUT_PULLDOWN | MUX_MODE7) /* (R14) gpmc_a4.rgmii2_td1 */
    			AM33XX_IOPAD(0x84c, PIN_INPUT_PULLDOWN | MUX_MODE7) /* (T14) gpmc_a3.rgmii2_td2 */
    			AM33XX_IOPAD(0x848, PIN_INPUT_PULLDOWN | MUX_MODE7) /* (U14) gpmc_a2.rgmii2_td3 */
    			AM33XX_IOPAD(0x86c, PIN_INPUT_PULLDOWN | MUX_MODE7) /* (V17) gpmc_a11.rgmii2_rd0 */
    			AM33XX_IOPAD(0x868, PIN_INPUT_PULLDOWN | MUX_MODE7) /* (T16) gpmc_a10.rgmii2_rd1 */
    			AM33XX_IOPAD(0x864, PIN_INPUT_PULLDOWN | MUX_MODE7) /* (U16) gpmc_a9.rgmii2_rd2 */
    			AM33XX_IOPAD(0x860, PIN_INPUT_PULLDOWN | MUX_MODE7) /* (V16) gpmc_a8.rgmii2_rd3 */
    		>;
    	};
    
    /* mdio */
    	davinci_mdio_pins_default: davinci_mdio_pins_default {
    		pinctrl-single,pins = <
    			AM33XX_IOPAD(0x94c, PIN_OUTPUT_PULLUP | MUX_MODE0) /* (M18) mdio_clk.mdio_clk */
    			AM33XX_IOPAD(0x948, PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0) /* (M17) mdio_data.mdio_data */
    		>;
    	};
    
    	/* Optional sleep pin settings. Must manually enter values in the below skeleton. */
    	davinci_mdio_pins_sleep: davinci_mdio_pins_sleep {
    		pinctrl-single,pins = <
    			AM33XX_IOPAD(0x94c, PIN_INPUT_PULLDOWN | MUX_MODE7) /* (M18) mdio_clk.mdio_clk */
    			AM33XX_IOPAD(0x948, PIN_INPUT_PULLDOWN | MUX_MODE7 ) /* (M17) mdio_data.mdio_data */
    		>;
    	};
    
    /* eMMC */
    
    	emmc_pins: pinmux_emmc_pins {
    		pinctrl-single,pins = <
    			AM33XX_IOPAD(0x880, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_csn1.mmc1_clk */
    			AM33XX_IOPAD(0x884, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_csn2.mmc1_cmd */
    			AM33XX_IOPAD(0x800, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad0.mmc1_dat0 */
    			AM33XX_IOPAD(0x804, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad1.mmc1_dat1 */
    			AM33XX_IOPAD(0x808, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad2.mmc1_dat2 */
    			AM33XX_IOPAD(0x80c, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad3.mmc1_dat3 */
    			AM33XX_IOPAD(0x810, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad4.mmc1_dat4 */
    			AM33XX_IOPAD(0x814, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad5.mmc1_dat5 */
    			AM33XX_IOPAD(0x818, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad6.mmc1_dat6 */
    			AM33XX_IOPAD(0x81c, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad7.mmc1_dat7 */
    		>;
    	};
    	
    /* SPI */
    	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 */
    		>;
    	};
    
    	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 */
    		>;
    	};	
    
    /* UART */
    	uart0_pins_default: uart0_pins_default {
    		pinctrl-single,pins = <
    			AM33XX_IOPAD(0x970, PIN_INPUT_PULLUP | MUX_MODE0) /* (E15) uart0_rxd.uart0_rxd */
    			AM33XX_IOPAD(0x974, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* (E16) uart0_txd.uart0_txd */
    		>;
    	};
    
    	uart1_pins_default: uart1_pins_default {
    		pinctrl-single,pins = <
    			AM33XX_IOPAD(0x980, PIN_INPUT_PULLUP | MUX_MODE0) /* (D16) uart1_rxd.uart1_rxd */
    			AM33XX_IOPAD(0x984, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* (D15) uart1_txd.uart1_txd */
    		>;
    	};
    
    	uart2_pins_default: uart2_pins_default {
    		pinctrl-single,pins = <
    		AM33XX_IOPAD(0x900, PIN_INPUT | MUX_MODE3) /* (G17) mmc0_clk.uart2_rxd */
    		AM33XX_IOPAD(0x904, PIN_OUTPUT | MUX_MODE3) /* (G18) mmc0_cmd.uart2_txd */
    		>;
    	};
    #if 1
    	uart4_pins_default: uart4_pins_default {
    		pinctrl-single,pins = <
    			AM33XX_IOPAD(0x968, PIN_INPUT_PULLUP | MUX_MODE1) /* (E18) uart0_ctsn.uart4_rxd */
    			AM33XX_IOPAD(0x96c, PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* (E17) uart0_rtsn.uart4_txd */
    //			AM33XX_IOPAD(0x8f4, PIN_OUTPUT | MUX_MODE2) /* (F18) mmc0_dat2.uart4_rtsn - 485_CONTROL*/
    		>;
    	};
    #endif
    };
    
    /* SYSTEM UART */
    &uart0 {
    	pinctrl-names = "default";
    	pinctrl-0 = <&uart0_pins_default>;
    	status = "okay";
    };
    
    /* CLI */
    &uart1 {
    	pinctrl-names = "default";
    	pinctrl-0 = <&uart1_pins_default>;
    	status = "okay";
    };
    
    /* IRD */
    &uart2 {
    	pinctrl-names = "default";
    	pinctrl-0 = <&uart2_pins_default>;
    	status = "okay";
    
    	serIrDA-rx-during-tx;
    	//serIrDA-filter = <>;
    	linux,serIrDA-enabled-at-boot-time;
    };
    
    
    /* RS-485 */
    &uart4 {
    	pinctrl-names = "default";
    	pinctrl-0 = <&uart4_pins_default>;
    	status = "okay";
    
    	//rts-gpio = <&gpio2 27 GPIO_ACTIVE_HIGH>;
    /*
    	rs485-rts-delay = <a b>
    	* a - the delay between rts signal and beginning of data sent in milliseconds.
    	      it corresponds to the delay before sending data.
    	 * b - the delay between end of data sent and rts signal in milliseconds
    	 it corresponds to the delay after sending data and actual release of the line.
    */
    	//rs485-rts-active-high;
    	//rs485-rx-during-tx;
    	//rs485-rts-delay = <0 1>;
    	//linux,rs485-enabled-at-boot-time;
    };
    
    &usb {
    	status = "okay";
    };
    
    &usb_ctrl_mod {
    	status = "okay";
    };
    
     &usb0_phy {
    	status = "okay";
    };
    
    
    &usb1_phy {
    	status = "okay";
    };
    
    &usb0 {
    	status = "okay";
    	dr_mode = "peripheral";
    	interrupts-extended = <&intc 18 &tps 0>;
    	interrupt-names = "mc", "vbus";
    };
    
    
    &usb1 {
    	status = "okay";
    	dr_mode = "host";
    };
    
    &cppi41dma  {
    	status = "okay";
    };
    
    
    /* I2C */
    &i2c2 {
    	pinctrl-names = "default";
    	pinctrl-0 = <&i2c2_pins_default>;
    	status = "okay";
    	clock-frequency = <40000>;
    };
    
    &i2c0 {
    	pinctrl-names = "default";
    	pinctrl-0 = <&i2c0_pins_default>;
    	status = "okay";
    	clock-frequency = <40000>;
    
    	/* Set OPP50 (0.95V) for VDD core */
    		sleep-sequence = /bits/ 8 <
    				0x02 0x24 0x0b 0x6d /* Password unlock 1 */
    				0x02 0x24 0x10 0x02 /* Set DCDC3 to 0.95V */
    				0x02 0x24 0x0b 0x6d /* Password unlock 2 */
    				0x02 0x24 0x10 0x02 /* Set DCDC3 to 0.95V */
    				0x02 0x24 0x0b 0x6c /* Password unlock 1 */
    				0x02 0x24 0x11 0x86 /* Apply DCDC changes */
    				0x02 0x24 0x0b 0x6c /* Password unlock 2 */
    				0x02 0x24 0x11 0x86 /* Apply DCDC changes */
    		>;
    
    	/* Set OPP100 (1.10V) for VDD core */
    		wake-sequence = /bits/ 8 <
    				0x02 0x24 0x0b 0x6d /* Password unlock 1 */
    				0x02 0x24 0x10 0x08 /* Set DCDC3 to 1.1V */
    				0x02 0x24 0x0b 0x6d /* Password unlock 2 */
    				0x02 0x24 0x10 0x08 /* Set DCDC3 to 1.1V */
    				0x02 0x24 0x0b 0x6c /* Password unlock 1 */
    				0x02 0x24 0x11 0x86 /* Apply DCDC changes */
    				0x02 0x24 0x0b 0x6c /* Password unlock 2 */
    				0x02 0x24 0x11 0x86 /* Apply DCDC changes */
    		>;
    
    		tps: tps@24 {
    			reg = <0x24>;
    		};
    /*
    No support in drivers
    		eeprom@50 {
    			compatible = "microchip,24lc128";
    			reg = <0x50>;
    			pagesize = <64>;
    			status = "okay";
    		};
    
    		tmp100@48 {
    			compatible = "tmp100";
    			reg = <0x48>;
    			status = "okay";
    		};
    */
    };
    
    /* SPI */
    
    &spi0 {
    	#address-cells = <1>;
    	#size-cells = <0>;
    
    	status = "okay";
    	pinctrl-names = "default";
    	pinctrl-0 = <&spi0_pins_default>;
    /*
    	channel@0 {
    		#address-cells = <1>;
    		#size-cells = <0>;
    		compatible = "rohm,dh2228fv";
    		reg = <0>;
    		spi-max-frequency = <48000000>;
    		//spi-cpha;
    	};
    
    */
    	sfpFpga@0 {
    		compatible = "atmel,sfpFpga";
    		spi-max-frequency = <48000000>;
    		reg = <0>;
    	};
    
    };
    
    &spi1 {
    	#address-cells = <1>;
    	#size-cells = <0>;
    	status = "okay";
    	pinctrl-names = "default";
    	pinctrl-0 = <&spi1_pins_default>;
    
    	channel@0 {
    		#address-cells = <1>;
    		#size-cells = <0>;
    		compatible = "rohm,dh2228fv";
    		reg = <0>;
    		spi-max-frequency = <48000000>;
    		//spi-cpha;
    	};
    };
    
    /include/ "tps65217.dtsi"
    
    &tps {
    	/*
    	 * Configure pmic to enter OFF-state instead of SLEEP-state ("RTC-only
    	 * mode") at poweroff.  Most BeagleBone versions do not support RTC-only
    	 * mode and risk hardware damage if this mode is entered.
    	 *
    	 * For details, see linux-omap mailing list May 2015 thread
    	 *	[PATCH] ARM: dts: am335x-bone* enable pmic-shutdown-controller
    	 * In particular, messages:
    	 *	http://www.spinics.net/lists/linux-omap/msg118585.html
    	 *	http://www.spinics.net/lists/linux-omap/msg118615.html
    	 *
    	 * You can override this later with
    	 *	&tps {  /delete-property/ ti,pmic-shutdown-controller;  }
    	 * if you want to use RTC-only mode and made sure you are not affected
    	 * by the hardware problems. (Tip: double-check by performing a current
    	 * measurement after shutdown: it should be less than 1 mA.)
    	 */
    
    	interrupts = <7>; /* NMI */
    	interrupt-parent = <&intc>;
    
    	ti,pmic-shutdown-controller;
    
    	charger {
    		status = "okay";
    	};
    
    	pwrbutton {
    		status = "okay";
    	};
    
    	regulators {
    		dcdc1_reg: regulator@0 {
    			regulator-name = "vdds_dpr";
    			regulator-always-on;
    		};
    
    		dcdc2_reg: regulator@1 {
    			/* VDD_MPU voltage limits 0.95V - 1.26V with +/-4% tolerance */
    			regulator-name = "vdd_mpu";
    			regulator-min-microvolt = <925000>;
    			regulator-max-microvolt = <1351500>;
    			regulator-boot-on;
    			regulator-always-on;
    		};
    
    		dcdc3_reg: regulator@2 {
    			/* VDD_CORE voltage limits 0.95V - 1.1V with +/-4% tolerance */
    			regulator-name = "vdd_core";
    			regulator-min-microvolt = <925000>;
    			regulator-max-microvolt = <1150000>;
    			regulator-boot-on;
    			regulator-always-on;
    		};
    
    		ldo1_reg: regulator@3 {
    			regulator-name = "vio,vrtc,vdds";
    			regulator-always-on;
    		};
    
    		ldo2_reg: regulator@4 {
    			regulator-name = "vdd_3v3aux";
    			regulator-always-on;
    		};
    
    		ldo3_reg: regulator@5 {
    			regulator-name = "vdd_1v8";
    			regulator-always-on;
    		};
    
    		ldo4_reg: regulator@6 {
    			regulator-name = "vdd_3v3a";
    			regulator-always-on;
    		};
    	};
    };
    
    /* PHY */
    &mac {
    	pinctrl-names = "default", "sleep";
    	pinctrl-0 = <&cpsw_default>;
    	pinctrl-1 = <&cpsw_sleep>;
    //	dual_emac=<1>;
    	status = "okay";
    };
    
    &davinci_mdio {
    	pinctrl-names = "default", "sleep";
    	compatible = "ti,cpsw-mdio", "ti,davinci_mdio";
    	pinctrl-0 = <&davinci_mdio_pins_default>;
    	pinctrl-1 = <&davinci_mdio_pins_sleep>;
    	status = "okay";
    
    	dp83867_0: ethernet-phy@0 {
    		reg = <0>;
    		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;
    	};
    
    	dp83867_1: ethernet-phy@1 {
    		reg = <1>;
    		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;
    	};
    };
    /*swapping ids to fix hardware issue */
    &cpsw_emac0 {
    	phy_id = <&davinci_mdio>, <1>;
    	phy-mode = "rgmii-id";
    //	dual_emac_res_vlan = <2>;
    };
    
    &cpsw_emac1 {
    	phy_id = <&davinci_mdio>, <0>;
    	phy-mode = "rgmii-id";
    //	dual_emac_res_vlan = <1>;
    };
    
    /* ADC */
    &tscadc {/* touch screen adc*/
    	status = "okay";
    };
    
    &am335x_adc {
    	ti,adc-channels = <0 1 2 3 4 5 6 7>;
    };
    
    
    &wkup_m3_ipc {
    	ti,scale-data-fw = "am335x-bone-scale-data.bin";
    };
    
    /**************CX3 stuff ends*************************************************************************************************/
    
    &am33xx_pinmux {
    	pinctrl-names = "default";
    //	pinctrl-0 = <&clkout2_pin>;
    
    
    	mmc1_pins: pinmux_mmc1_pins {
    		pinctrl-single,pins = <
    			AM33XX_IOPAD(0x960, PIN_INPUT | MUX_MODE7)		/* spio0_cs1.gpio0_6 */
    			AM33XX_IOPAD(0x8fc, PIN_INPUT_PULLUP | MUX_MODE0)	/* mmc0_dat0.mmc0_dat0 */
    			AM33XX_IOPAD(0x8f8, PIN_INPUT_PULLUP | MUX_MODE0)	/* mmc0_dat1.mmc0_dat1 */
    //conflict w/ uart4
    //			AM33XX_IOPAD(0x8f4, PIN_INPUT_PULLUP | MUX_MODE0)	/* mmc0_dat2.mmc0_dat2 */
    			AM33XX_IOPAD(0x8f0, PIN_INPUT_PULLUP | MUX_MODE0)	/* mmc0_dat3.mmc0_dat3 */
    			AM33XX_IOPAD(0x904, PIN_INPUT_PULLUP | MUX_MODE0)	/* mmc0_cmd.mmc0_cmd */
    			AM33XX_IOPAD(0x900, PIN_INPUT_PULLUP | MUX_MODE0)	/* mmc0_clk.mmc0_clk */
    		>;
    	};
    
    
    };
    
    &mmc1 {
    	status = "okay";
    	bus-width = <0x4>;
    	pinctrl-names = "default";
    	pinctrl-0 = <&mmc1_pins>;
    	cd-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
    };
    /{
    #if 0
    	cx3gpios {
    		pinctrl-names = "default";
    		pinctrl-0 = <&cx3_gpio_default>;
    		
    		compatible = "gpio-leds";
    		gpios = <&gpio0 8 GPIO_ACTIVE_HIGH>;
    	};
    #endif
    
    };
    
    
  • Looking forward to your test result.

  • Yes, i will get to it . thanks!!!