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.

AM6548: I2C controller timeout

Part Number: AM6548

Hi Ti,

We are using Linux RT SDK 07.01.00.18 on our customized board.

And we have a rtc chip on our I2C1 bus.

However, sometimes we will get i2c controller timed out. 

The reproduce rate is about 1/10~1/100, it's randomly happened.

Please help to check if any fix for this.

 

The log is as below, and dts file is attached.

root@AX-564EB0MB1T:/var/log# dmesg
[ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[ 0.000000] Linux version 5.2.60-rt15-yocto-preempt-rt (oe-user@oe-host) (gcc version 9.2.0 (GCC)) #1 SMP PREEMPT RT Thu Oct 19 10:06:17 UTC 2023
[ 0.000000] Machine model: Texas Instruments AM654 Base Board
[ 0.000000] efi: Getting EFI parameters from FDT:
[ 0.000000] efi: UEFI not found.
[ 0.000000] Reserved memory: created DMA memory pool at 0x00000000a0000000, size 1 MiB
[ 0.000000] OF: reserved mem: initialized node r5f-dma-memory@a0000000, compatible id shared-dma-pool
[ 0.000000] Reserved memory: created DMA memory pool at 0x00000000a0100000, size 15 MiB
[ 0.000000] OF: reserved mem: initialized node r5f-memory@a0100000, compatible id shared-dma-pool
[ 0.000000] Reserved memory: created DMA memory pool at 0x00000000a1000000, size 1 MiB
[ 0.000000] OF: reserved mem: initialized node r5f-dma-memory@a1000000, compatible id shared-dma-pool
[ 0.000000] Reserved memory: created DMA memory pool at 0x00000000a1100000, size 15 MiB
[ 0.000000] OF: reserved mem: initialized node r5f-memory@a1100000, compatible id shared-dma-pool
[ 0.000000] On node 0 totalpages: 247296
[ 0.000000] DMA32 zone: 4096 pages used for memmap
[ 0.000000] DMA32 zone: 0 pages reserved
[ 0.000000] DMA32 zone: 247296 pages, LIFO batch:63
[ 0.000000] psci: probing for conduit method from DT.
[ 0.000000] psci: PSCIv1.1 detected in firmware.
[ 0.000000] psci: Using standard PSCI v0.2 function IDs
[ 0.000000] psci: Trusted OS migration not required
[ 0.000000] psci: SMC Calling Convention v1.0
[ 0.000000] percpu: Embedded 25 pages/cpu s62400 r8192 d31808 u102400
[ 0.000000] pcpu-alloc: s62400 r8192 d31808 u102400 alloc=25*4096
[ 0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3
[ 0.000000] Detected VIPT I-cache on CPU0
[ 0.000000] CPU features: detected: GIC system register CPU interface
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 243200
[ 0.000000] Kernel command line: ostree_boot=LABEL=otaboot ostree=/ostree/1 ostree_root=LABEL=otaroot console=ttyS2,115200n8,115200 flux=fluxdata isolcpus=1-3
[ 0.000000] Dentry cache hash table entries: 131072 (order: 9, 2097152 bytes)
[ 0.000000] Inode-cache hash table entries: 65536 (order: 7, 524288 bytes)
[ 0.000000] Memory: 937972K/989184K available (7676K kernel code, 1344K rwdata, 1884K rodata, 832K init, 345K bss, 51212K reserved, 0K cma-reserved)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[ 0.000000] ftrace: allocating 27305 entries in 107 pages
[ 0.000000] rcu: Preemptible hierarchical RCU implementation.
[ 0.000000] rcu: RCU restricting CPUs from NR_CPUS=256 to nr_cpu_ids=4.
[ 0.000000] rcu: RCU priority boosting: priority 1 delay 500 ms.
[ 0.000000] rcu: RCU_SOFTIRQ processing moved to rcuc kthreads.
[ 0.000000] No expedited grace period (rcu_normal_after_boot).
[ 0.000000] Tasks RCU enabled.
[ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 100 jiffies.
[ 0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
[ 0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[ 0.000000] GICv3: GIC: Using split EOI/Deactivate mode
[ 0.000000] GICv3: Distributor has no Range Selector support
[ 0.000000] GICv3: no VLPI support, no direct LPI support
[ 0.000000] GICv3: CPU0: found redistributor 0 region 0:0x0000000001880000
[ 0.000000] ITS [mem 0x01820000-0x0182ffff]
[ 0.000000] GIC: enabling workaround for ITS: Socionext Synquacer pre-ITS
[ 0.000000] ITS@0x0000000001820000: Devices Table too large, reduce ids 20->19
[ 0.000000] ITS@0x0000000001820000: allocated 524288 Devices @be000000 (flat, esz 8, psz 64K, shr 0)
[ 0.000000] ITS: using cache flushing for cmd queue
[ 0.000000] GICv3: using LPI property table @0x00000000a2320000
[ 0.000000] GIC: using cache flushing for LPI property table
[ 0.000000] GICv3: CPU0: using allocated LPI pending table @0x00000000a2330000
[ 0.000000] random: get_random_bytes called from start_kernel+0x318/0x498 with crng_init=0
[ 0.000000] arch_timer: cp15 timer(s) running at 200.00MHz (phys).
[ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x2e2049d3e8, max_idle_ns: 440795210634 ns
[ 0.000000] sched_clock: 56 bits at 200MHz, resolution 5ns, wraps every 4398046511102ns
[ 0.000285] Console: colour dummy device 80x25
[ 0.000323] Calibrating delay loop (skipped), value calculated using timer frequency.. 400.00 BogoMIPS (lpj=200000)
[ 0.000333] pid_max: default: 32768 minimum: 301
[ 0.000466] LSM: Security Framework initializing
[ 0.000519] Mount-cache hash table entries: 2048 (order: 2, 16384 bytes)
[ 0.000531] Mountpoint-cache hash table entries: 2048 (order: 2, 16384 bytes)
[ 0.008036] ASID allocator initialised with 32768 entries
[ 0.010012] rcu: Hierarchical SRCU implementation.
[ 0.016194] Platform MSI: gic-its@1820000 domain created
[ 0.016332] EFI services will not be available.
[ 0.018101] smp: Bringing up secondary CPUs ...
[ 0.036523] Detected VIPT I-cache on CPU1
[ 0.036558] GICv3: CPU1: found redistributor 1 region 0:0x00000000018a0000
[ 0.036573] GICv3: CPU1: using allocated LPI pending table @0x00000000a2340000
[ 0.036612] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
[ 0.054779] Detected VIPT I-cache on CPU2
[ 0.054823] GICv3: CPU2: found redistributor 100 region 0:0x00000000018c0000
[ 0.054839] GICv3: CPU2: using allocated LPI pending table @0x00000000a2350000
[ 0.054886] CPU2: Booted secondary processor 0x0000000100 [0x410fd034]
[ 0.072807] Detected VIPT I-cache on CPU3
[ 0.072838] GICv3: CPU3: found redistributor 101 region 0:0x00000000018e0000
[ 0.072849] GICv3: CPU3: using allocated LPI pending table @0x00000000a2360000
[ 0.072881] CPU3: Booted secondary processor 0x0000000101 [0x410fd034]
[ 0.073035] smp: Brought up 1 node, 4 CPUs
[ 0.073044] SMP: Total of 4 processors activated.
[ 0.073051] CPU features: detected: 32-bit EL0 Support
[ 0.073058] CPU features: detected: CRC32 instructions
[ 0.073122] CPU: All CPU(s) started at EL2
[ 0.073149] alternatives: patching kernel code
[ 0.074173] devtmpfs: initialized
[ 0.088232] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1911260446275000 ns
[ 0.088258] futex hash table entries: 1024 (order: 5, 131072 bytes)
[ 0.088582] pinctrl core: initialized pinctrl subsystem
[ 0.088920] DMI not present or invalid.
[ 0.089275] NET: Registered protocol family 16
[ 0.090432] DMA: preallocated 256 KiB pool for atomic allocations
[ 0.119064] SCSI subsystem initialized
[ 0.119279] usbcore: registered new interface driver usbfs
[ 0.119337] usbcore: registered new interface driver hub
[ 0.119484] usbcore: registered new device driver usb
[ 0.120056] pps_core: LinuxPPS API ver. 1 registered
[ 0.120060] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[ 0.120074] PTP clock support registered
[ 0.122398] clocksource: Switched to clocksource arch_sys_counter
[ 0.224607] NET: Registered protocol family 2
[ 0.225361] tcp_listen_portaddr_hash hash table entries: 512 (order: 3, 32768 bytes)
[ 0.225494] TCP established hash table entries: 8192 (order: 4, 65536 bytes)
[ 0.225602] TCP bind hash table entries: 8192 (order: 6, 458752 bytes)
[ 0.226090] TCP: Hash tables configured (established 8192 bind 8192)
[ 0.226316] UDP hash table entries: 512 (order: 4, 65536 bytes)
[ 0.226510] UDP-Lite hash table entries: 512 (order: 4, 65536 bytes)
[ 0.226882] NET: Registered protocol family 1
[ 0.227187] Trying to unpack rootfs image as initramfs...
[ 1.271913] Freeing initrd memory: 17300K
[ 1.273728] Initialise system trusted keyrings
[ 1.273962] workingset: timestamp_bits=46 max_order=18 bucket_order=0
[ 1.286560] Key type asymmetric registered
[ 1.286572] Asymmetric key parser 'x509' registered
[ 1.286623] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 249)
[ 1.286629] io scheduler mq-deadline registered
[ 1.286634] io scheduler kyber registered
[ 1.289642] pinctrl-single 4301c000.pinmux: 70 pins, size 280
[ 1.290345] pinctrl-single 11c000.pinmux: 185 pins, size 740
[ 1.290759] pinctrl-single 11c2e8.pinmux: 9 pins, size 36
[ 1.293435] k3-ringacc 2b800000.ringacc: Failed to get MSI domain
[ 1.293566] k3-ringacc 3c000000.ringacc: Failed to get MSI domain
[ 1.294529] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[ 1.308240] brd: module loaded
[ 1.311060] libphy: Fixed MDIO Bus: probed
[ 1.312094] usbcore: registered new interface driver asix
[ 1.312143] usbcore: registered new interface driver ax88179_178a
[ 1.312175] usbcore: registered new interface driver cdc_ether
[ 1.312213] usbcore: registered new interface driver net1080
[ 1.312246] usbcore: registered new interface driver cdc_subset
[ 1.312277] usbcore: registered new interface driver zaurus
[ 1.312327] usbcore: registered new interface driver cdc_ncm
[ 1.313211] usbcore: registered new interface driver usb-storage
[ 1.313317] usbcore: registered new interface driver cp210x
[ 1.313341] usbserial: USB Serial support registered for cp210x
[ 1.313499] udc-core: couldn't find an available UDC - added [g_serial] to list of pending drivers
[ 1.313543] i2c /dev entries driver
[ 1.314450] device-mapper: ioctl: 4.40.0-ioctl (2019-01-18) initialised: dm-devel@redhat.com
[ 1.316155] sdhci: Secure Digital Host Controller Interface driver
[ 1.316159] sdhci: Copyright(c) Pierre Ossman
[ 1.316771] sdhci-pltfm: SDHCI platform and OF driver helper
[ 1.317226] ti-sci bus@100000:bus@28380000:bus@42040000:dmsc: invalid resource
[ 1.318774] u32 classifier
[ 1.318779] Actions configured
[ 1.319556] NET: Registered protocol family 10
[ 1.321837] Segment Routing with IPv6
[ 1.321913] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[ 1.322580] NET: Registered protocol family 17
[ 1.322737] 9pnet: Installing 9P2000 support
[ 1.323583] registered taskstats version 1
[ 1.323588] Loading compiled-in X.509 certificates
[ 1.332936] Key type encrypted registered
[ 1.337032] k3-ringacc 2b800000.ringacc: Failed to get MSI domain
[ 1.337186] k3-ringacc 3c000000.ringacc: Failed to get MSI domain
[ 1.341638] ti-sci bus@100000:bus@28380000:bus@42040000:dmsc: invalid resource
[ 1.342110] ti-sci bus@100000:bus@28380000:bus@42040000:dmsc: ABI: 3.1 (firmware rev 0x0015 '21.1.1--v2021.01a (Terrific Lla')
[ 1.395640] random: fast init done
[ 1.402646] omap_i2c 2000000.i2c: bus 2 rev0.12 at 100 kHz
[ 3.426408] omap_i2c 2010000.i2c: controller timed out
[ 3.426423] rtc-s35390a 3-0030: error resetting chip
[ 3.426912] rtc-s35390a: probe of 3-0030 failed with error -5
[ 3.426931] omap_i2c 2010000.i2c: bus 3 rev0.12 at 100 kHz
[ 3.427675] ti-sci-intr bus@100000:bus@28380000:bus@42040000:interrupt-controller2: Interrupt Router 156 domain created
[ 3.427879] ti-sci-intr bus@100000:interrupt-controller0: Interrupt Router 100 domain created
[ 3.428073] ti-sci-intr bus@100000:navss@30800000:interrupt-controller1: Interrupt Router 182 domain created
[ 3.428458] ti-sci-inta 33d00000.interrupt-controller: Interrupt Aggregator domain -1 created
[ 3.435646] k3-ringacc 2b800000.ringacc: Ring Accelerator probed rings:286, gp-rings[96,160] sci-dev-id:195
[ 3.435662] k3-ringacc 2b800000.ringacc: dma-ring-reset-quirk: disabled
[ 3.435668] k3-ringacc 2b800000.ringacc: RA Proxy rev. 66348100, num_proxies:64
[ 3.453134] k3-ringacc 3c000000.ringacc: Ring Accelerator probed rings:818, gp-rings[304,464] sci-dev-id:187
[ 3.453150] k3-ringacc 3c000000.ringacc: dma-ring-reset-quirk: disabled
[ 3.453155] k3-ringacc 3c000000.ringacc: RA Proxy rev. 66348100, num_proxies:64
[ 3.454152] 40a00000.serial: ttyS1 at MMIO 0x40a00000 (irq = 7, base_baud = 6000000) is a 8250
[ 3.455294] 2800000.serial: ttyS2 at MMIO 0x2800000 (irq = 17, base_baud = 3000000) is a 8250
[ 3.455566] printk: console [ttyS2]: printing thread started
[ 3.455580] printk: console [ttyS2] enabled
[ 3.456651] omap8250 2810000.serial: unable to register 8250 port
[ 3.456665] omap8250 2810000.serial: PM domain pd:147 will not be powered off
[ 3.457505] 2820000.serial: ttyS0 at MMIO 0x2820000 (irq = 19, base_baud = 3000000) is a 8250
[ 3.471171] davinci_mdio 46000f00.mdio: Configuring MDIO in manual mode
[ 3.504407] davinci_mdio 46000f00.mdio: davinci mdio revision 9.7, bus freq 1000000
[ 3.504420] libphy: 46000f00.mdio: probed
[ 3.508697] davinci_mdio 46000f00.mdio: phy[3]: device 46000f00.mdio:03, driver TI DP83822
[ 3.508747] am65-cpsw-nuss 46000000.ethernet: initializing am65 cpsw nuss version 0x6BA00102, cpsw version 0x6BA80102 Ports: 2 quirks:00000000
[ 3.508796] am65-cpsw-nuss 46000000.ethernet: Failed to request tx dma channel -517
[ 3.511205] am65-cpts 310d0000.cpts: CPTS ver 0x4e8a010b, freq:200000000, add_val:4 pps:0
[ 3.513332] dwc3 4010000.usb: Failed to get clk 'ref': -2
[ 3.514360] g_serial gadget: Gadget Serial v2.4
[ 3.514370] g_serial gadget: g_serial ready
[ 3.522914] dwc3 4030000.usb: Failed to get clk 'ref': -2
[ 3.524307] clk: failed to reparent clk:130:1 to clk:130:5: -22
[ 3.525762] mmc0: CQHCI version 5.10
[ 3.567411] mmc0: SDHCI controller on 4f80000.sdhci [4f80000.sdhci] using ADMA 64-bit
[ 3.568354] mmc1: CQHCI version 5.10
[ 3.638484] mmc0: Command Queue Engine enabled
[ 3.638499] mmc0: new HS200 MMC card at address 0001
[ 3.640264] mmcblk0: mmc0:0001 8GTF4R 7.28 GiB
[ 3.640661] mmcblk0boot0: mmc0:0001 8GTF4R partition 1 4.00 MiB
[ 3.641000] mmcblk0boot1: mmc0:0001 8GTF4R partition 2 4.00 MiB
[ 3.641308] mmcblk0rpmb: mmc0:0001 8GTF4R partition 3 512 KiB, chardev (247:0)
[ 3.643912] mmcblk0: p1 p2 < p5 p6 > p3
[ 5.079402] sdhci-am654 4fa0000.sdhci: Power on failed
[ 5.109405] mmc1: SDHCI controller on 4fa0000.sdhci [4fa0000.sdhci] using ADMA 64-bit
[ 5.123971] omap-mailbox 31f80000.mailbox: omap mailbox rev 0x66fc7100
[ 5.124507] omap-mailbox 31f81000.mailbox: omap mailbox rev 0x66fc7100
[ 5.129051] ti-udma 285c0000.dma-controller: Channels: 96 (tchan: 48, rchan: 48, gp-rflow: 48)
[ 5.147168] ti-udma 31150000.dma-controller: Channels: 267 (tchan: 119, rchan: 148, gp-rflow: 150)
[ 5.167167] 2810000.serial: ttyS3 at MMIO 0x2810000 (irq = 18, base_baud = 3000000) is a 8250
[ 5.180741] davinci_mdio 46000f00.mdio: Configuring MDIO in manual mode
[ 5.214406] davinci_mdio 46000f00.mdio: davinci mdio revision 9.7, bus freq 1000000
[ 5.214418] libphy: 46000f00.mdio: probed
[ 5.218706] davinci_mdio 46000f00.mdio: phy[3]: device 46000f00.mdio:03, driver TI DP83822
[ 5.218759] am65-cpsw-nuss 46000000.ethernet: initializing am65 cpsw nuss version 0x6BA00102, cpsw version 0x6BA80102 Ports: 2 quirks:00000000
[ 5.220050] am65-cpsw-nuss 46000000.ethernet: set new flow-id-base 48
[ 5.220798] am65-cpsw-nuss 46000000.ethernet: initialized cpsw ale version 1.4
[ 5.220805] am65-cpsw-nuss 46000000.ethernet: ALE Table size 64
[ 5.221966] am65-cpsw-nuss 46000000.ethernet: CPTS ver 0x4e8a010b, freq:200000000, add_val:4 pps:0
[ 5.229565] printk: console [netcon0]: printing thread started
[ 5.229593] printk: console [netcon0] enabled
[ 5.229596] netconsole: network logging started
[ 5.229603] hctosys: unable to open rtc device (rtc0)
[ 5.249776] Freeing unused kernel memory: 832K
[ 5.249892] Run /init as init process
[ 5.838655] EXT4-fs (mmcblk0p6): recovery complete
[ 5.839118] EXT4-fs (mmcblk0p6): mounted filesystem with ordered data mode. Opts: (null)
[ 5.871241] EXT4-fs (mmcblk0p5): recovery complete
[ 5.871276] EXT4-fs (mmcblk0p5): mounted filesystem with ordered data mode. Opts: (null)
[ 6.110938] systemd[1]: System time before build time, advancing clock.
[ 6.122629] systemd[1]: systemd 243-51-gfab6f01+ running in system mode. (+PAM -AUDIT -SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP -LIBCRYPTSETUP -GCRYPT -GNUTLS +ACL +XZ -LZ4 -SECCOMP +BLKID -ELFUTILS +KMOD -IDN2 -IDN -PCRE2 default-hierarchy=hybrid)
[ 6.123195] systemd[1]: Detected architecture arm64.
[ 6.136950] systemd[1]: Set hostname to <AX-564EB0MB1T>.
[ 6.574520] systemd[1]: boot.mount: Unit is bound to inactive unit dev-disk-by\x2dlabel-otaboot.device. Stopping, too.
[ 6.579074] random: systemd: uninitialized urandom read (16 bytes read)
[ 6.579274] systemd[1]: system-getty.slice: unit configures an IP firewall, but the local system does not support BPF/cgroup firewalling.
[ 6.579287] systemd[1]: (This warning is only shown for the first unit using IP firewalling.)
[ 6.583161] systemd[1]: Created slice system-getty.slice.
[ 6.592592] random: systemd: uninitialized urandom read (16 bytes read)
[ 6.594118] systemd[1]: Created slice system-serial\x2dgetty.slice.
[ 6.602543] random: systemd: uninitialized urandom read (16 bytes read)
[ 6.603930] systemd[1]: Created slice User and Session Slice.
[ 6.612880] systemd[1]: Started Dispatch Password Requests to Console Directory Watch.
[ 6.947215] fuse: init (API version 7.31)
[ 7.019521] EXT4-fs (mmcblk0p6): re-mounted. Opts: (null)
[ 8.564701] davinci_mdio b132400.mdio: Configuring MDIO in manual mode
[ 8.612447] davinci_mdio b132400.mdio: davinci mdio revision 1.7, bus freq 1000000
[ 8.612470] libphy: b132400.mdio: probed
[ 8.655253] davinci_mdio b132400.mdio: phy[1]: device b132400.mdio:01, driver TI DP83867
[ 8.662369] davinci_mdio b232400.mdio: Configuring MDIO in manual mode
[ 8.697464] davinci_mdio b232400.mdio: davinci mdio revision 1.7, bus freq 1000000
[ 8.697492] libphy: b232400.mdio: probed
[ 8.753772] davinci_mdio b232400.mdio: phy[2]: device b232400.mdio:02, driver TI DP83867
[ 8.957009] remoteproc remoteproc0: b034000.pru is available
[ 8.957146] pru-rproc b034000.pru: PRU rproc node /bus@100000/icssg@b000000/pru@34000 probed successfully
[ 8.959543] remoteproc remoteproc1: b004000.rtu is available
[ 8.959716] pru-rproc b004000.rtu: PRU rproc node /bus@100000/icssg@b000000/rtu@4000 probed successfully
[ 8.959963] pru-rproc b00a000.txpru: IRQ vring not found
[ 8.959969] pru-rproc b00a000.txpru: IRQ kick not found
[ 8.960054] remoteproc remoteproc2: b00a000.txpru is available
[ 8.960142] pru-rproc b00a000.txpru: PRU rproc node /bus@100000/icssg@b000000/txpru@a000 probed successfully
[ 8.985663] remoteproc remoteproc3: b038000.pru is available
[ 8.985821] pru-rproc b038000.pru: PRU rproc node /bus@100000/icssg@b000000/pru@38000 probed successfully
[ 8.989847] remoteproc remoteproc4: b006000.rtu is available
[ 8.989982] pru-rproc b006000.rtu: PRU rproc node /bus@100000/icssg@b000000/rtu@6000 probed successfully
[ 8.992656] pru-rproc b00c000.txpru: IRQ vring not found
[ 8.992670] pru-rproc b00c000.txpru: IRQ kick not found
[ 8.992785] remoteproc remoteproc5: b00c000.txpru is available
[ 8.992886] pru-rproc b00c000.txpru: PRU rproc node /bus@100000/icssg@b000000/txpru@c000 probed successfully
[ 8.996952] remoteproc remoteproc6: b134000.pru is available
[ 8.997096] pru-rproc b134000.pru: PRU rproc node /bus@100000/icssg@b100000/pru@34000 probed successfully
[ 9.005051] remoteproc remoteproc7: b104000.rtu is available
[ 9.005173] pru-rproc b104000.rtu: PRU rproc node /bus@100000/icssg@b100000/rtu@4000 probed successfully
[ 9.010707] pru-rproc b10a000.txpru: IRQ vring not found
[ 9.010723] pru-rproc b10a000.txpru: IRQ kick not found
[ 9.010834] remoteproc remoteproc8: b10a000.txpru is available
[ 9.010978] pru-rproc b10a000.txpru: PRU rproc node /bus@100000/icssg@b100000/txpru@a000 probed successfully
[ 9.021342] remoteproc remoteproc9: b138000.pru is available
[ 9.024379] pru-rproc b138000.pru: PRU rproc node /bus@100000/icssg@b100000/pru@38000 probed successfully
[ 9.029850] remoteproc remoteproc10: b106000.rtu is available
[ 9.029983] pru-rproc b106000.rtu: PRU rproc node /bus@100000/icssg@b100000/rtu@6000 probed successfully
[ 9.036715] pru-rproc b10c000.txpru: IRQ vring not found
[ 9.036730] pru-rproc b10c000.txpru: IRQ kick not found
[ 9.036847] remoteproc remoteproc11: b10c000.txpru is available
[ 9.036985] pru-rproc b10c000.txpru: PRU rproc node /bus@100000/icssg@b100000/txpru@c000 probed successfully
[ 9.042005] remoteproc remoteproc12: b234000.pru is available
[ 9.042122] pru-rproc b234000.pru: PRU rproc node /bus@100000/icssg@b200000/pru@34000 probed successfully
[ 9.047950] remoteproc remoteproc13: b204000.rtu is available
[ 9.048104] pru-rproc b204000.rtu: PRU rproc node /bus@100000/icssg@b200000/rtu@4000 probed successfully
[ 9.056050] pru-rproc b20a000.txpru: IRQ vring not found
[ 9.056065] pru-rproc b20a000.txpru: IRQ kick not found
[ 9.059202] remoteproc remoteproc14: b20a000.txpru is available
[ 9.059320] pru-rproc b20a000.txpru: PRU rproc node /bus@100000/icssg@b200000/txpru@a000 probed successfully
[ 9.066921] remoteproc remoteproc15: b238000.pru is available
[ 9.067049] pru-rproc b238000.pru: PRU rproc node /bus@100000/icssg@b200000/pru@38000 probed successfully
[ 9.074983] remoteproc remoteproc16: b206000.rtu is available
[ 9.075143] pru-rproc b206000.rtu: PRU rproc node /bus@100000/icssg@b200000/rtu@6000 probed successfully
[ 9.079840] pru-rproc b20c000.txpru: IRQ vring not found
[ 9.079854] pru-rproc b20c000.txpru: IRQ kick not found
[ 9.079962] remoteproc remoteproc17: b20c000.txpru is available
[ 9.080070] pru-rproc b20c000.txpru: PRU rproc node /bus@100000/icssg@b200000/txpru@c000 probed successfully
[ 9.761823] icssg-prueth pruss1_eth: port 1: using random MAC addr: f6:11:92:87:7a:1f
[ 9.776456] icssg-prueth pruss1_eth: TI PRU ethernet driver initialized: single EMAC mode
[ 9.819747] icssg-prueth pruss2_eth: port 1: using random MAC addr: 96:03:cb:73:71:3e
[ 9.857137] icssg-prueth pruss2_eth: TI PRU ethernet driver initialized: single EMAC mode
[ 10.085890] EXT4-fs (mmcblk0p3): recovery complete
[ 10.086825] EXT4-fs (mmcblk0p3): mounted filesystem with ordered data mode. Opts: (null)
[ 10.411582] systemd-journald[233]: Received client request to flush runtime journal.
[ 11.296538] am65-cpsw-nuss 46000000.ethernet EtherCAT: renamed from eth0
[ 11.394562] TI DP83822 46000f00.mdio:03: attached PHY driver [TI DP83822] (mii_bus:phy_addr=46000f00.mdio:03, irq=POLL)
[ 11.403199] am65-cpsw-nuss 46000000.ethernet EtherCAT: Link is Down
[ 11.458694] icssg-prueth pruss1_eth EthernetX1: renamed from eth1
[ 11.597871] remoteproc remoteproc6: powering up b134000.pru
[ 11.601261] remoteproc remoteproc6: Booting fw image ti-pruss/am65x-sr2-pru0-prueth-fw.elf, size 35544
[ 11.601487] pru-rproc b134000.pru: configured system_events[159-0] = 00000000,00000000,00000000,00000000,01000000
[ 11.601498] pru-rproc b134000.pru: configured intr_channels = 0x00000001 host_intr = 0x00000004
[ 11.601506] remoteproc remoteproc6: remote processor b134000.pru is now up
[ 11.601540] remoteproc remoteproc7: powering up b104000.rtu
[ 11.604484] remoteproc remoteproc7: Booting fw image ti-pruss/am65x-sr2-rtu0-prueth-fw.elf, size 29080
[ 11.604515] remoteproc remoteproc7: remote processor b104000.rtu is now up
[ 11.604548] remoteproc remoteproc8: powering up b10a000.txpru
[ 11.605454] remoteproc remoteproc8: Booting fw image ti-pruss/am65x-sr2-txpru0-prueth-fw.elf, size 32536
[ 11.605484] remoteproc remoteproc8: remote processor b10a000.txpru is now up
[ 11.618647] TI DP83867 b132400.mdio:01: attached PHY driver [TI DP83867] (mii_bus:phy_addr=b132400.mdio:01, irq=POLL)
[ 11.618822] net EthernetX1: started
[ 11.684123] icssg-prueth pruss2_eth EthernetX2: renamed from eth2
[ 11.818541] remoteproc remoteproc12: powering up b234000.pru
[ 11.818736] remoteproc remoteproc12: Booting fw image ti-pruss/am65x-sr2-pru0-prueth-fw.elf, size 35544
[ 11.818933] pru-rproc b234000.pru: configured system_events[159-0] = 00000000,00000000,00000000,00000000,01000000
[ 11.818943] pru-rproc b234000.pru: configured intr_channels = 0x00000001 host_intr = 0x00000004
[ 11.818952] remoteproc remoteproc12: remote processor b234000.pru is now up
[ 11.818982] remoteproc remoteproc13: powering up b204000.rtu
[ 11.819142] remoteproc remoteproc13: Booting fw image ti-pruss/am65x-sr2-rtu0-prueth-fw.elf, size 29080
[ 11.819164] remoteproc remoteproc13: remote processor b204000.rtu is now up
[ 11.819185] remoteproc remoteproc14: powering up b20a000.txpru
[ 11.819297] remoteproc remoteproc14: Booting fw image ti-pruss/am65x-sr2-txpru0-prueth-fw.elf, size 32536
[ 11.819319] remoteproc remoteproc14: remote processor b20a000.txpru is now up
[ 11.836551] TI DP83867 b232400.mdio:02: attached PHY driver [TI DP83867] (mii_bus:phy_addr=b232400.mdio:02, irq=POLL)
[ 11.836724] net EthernetX2: started
[ 11.901048] random: crng init done
[ 11.901062] random: 7 urandom warning(s) missed due to ratelimiting
[ 12.334046] FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[ 13.667068] icssg-prueth pruss1_eth EthernetX1: Link is Up - 100Mbps/Full - flow control off
[ 13.667142] IPv6: ADDRCONF(NETDEV_CHANGE): EthernetX1: link becomes ready

// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (C) 2016-2018 Texas Instruments Incorporated - http://www.ti.com/
 */

/dts-v1/;

#include "k3-am654.dtsi"
#include <dt-bindings/input/input.h>
#include <dt-bindings/net/ti-dp83867.h>

/ {
	compatible =  "ti,am654-evm", "ti,am654";
	model = "Texas Instruments AM654 Base Board";

	aliases {
		ethernet1 = &pruss1_emac0; //Ethernet port 0
		//ethernet2 = &pruss1_emac1; //EtherCAT port 1
		ethernet2 = &pruss2_emac0; //Ethernet port 1
	};

	chosen {
		stdout-path = "serial2:115200n8";
		bootargs = "earlycon=ns16550a,mmio32,0x02800000";
	};

	memory@80000000 {
		device_type = "memory";
#if 0
			/* 4G RAM */
			reg = <0x00000000 0x80000000 0x00000000 0x80000000>,
				<0x00000008 0x80000000 0x00000000 0x80000000>;
#endif
			/* 1G RAM */
			reg = <0x00000000 0x80000000 0x00000000 0x40000000>;
        };

	reserved_memory: reserved-memory {
		#address-cells = <2>;
		#size-cells = <2>;
		ranges;

		secure_ddr: secure_ddr@9e800000 {
			reg = <0 0x9e800000 0 0x01800000>; /* for OP-TEE */
			alignment = <0x1000>;
			no-map;
		};

		mcu_r5fss0_core0_dma_memory_region: r5f-dma-memory@a0000000 {
			compatible = "shared-dma-pool";
			reg = <0 0xa0000000 0 0x100000>;
			no-map;
		};

		mcu_r5fss0_core0_memory_region: r5f-memory@a0100000 {
			compatible = "shared-dma-pool";
			reg = <0 0xa0100000 0 0xf00000>;
			no-map;
		};

		mcu_r5fss0_core1_dma_memory_region: r5f-dma-memory@a1000000 {
			compatible = "shared-dma-pool";
			reg = <0 0xa1000000 0 0x100000>;
			no-map;
		};

		mcu_r5fss0_core1_memory_region: r5f-memory@a1100000 {
			compatible = "shared-dma-pool";
			reg = <0 0xa1100000 0 0xf00000>;
			no-map;
		};

		rtos_ipc_memory_region: ipc-memories@a2000000 {
			reg = <0x00 0xa2000000 0x00 0x00200000>;
			alignment = <0x1000>;
			no-map;
		};
	};

	eeprom_gpio: eeprom_gpio {
		compatible = "eeprom-gpio";
		eeprom-gpio = <&wkup_gpio0 7 GPIO_ACTIVE_HIGH>;
	};

	clk_ov5640_fixed: fixed-clock-ov5640 {
		compatible = "fixed-clock";
		#clock-cells = <0>;
		clock-frequency = <24000000>;
	};

	leds {
		pinctrl-names = "default";
		pinctrl-0 = <&ledgpio0_pins_default &ledgpio1_pins_default &ledgpio2_pins_default>;

		compatible = "gpio-leds";

		led1 {
			label = "LED-RUN";
			gpios = <&main_gpio0 27 GPIO_ACTIVE_LOW>;
		};

		led2 {
			label = "LED-ERR";
			gpios = <&main_gpio1 70 GPIO_ACTIVE_HIGH>;
		};

		led3 {
			label = "LED-BUS";
			gpios = <&main_gpio1 48 GPIO_ACTIVE_HIGH>;
		};

		led4 {
			label = "LED-232TX";
			gpios = <&main_gpio1 21 GPIO_ACTIVE_HIGH>;
		};

		led5 {
			label = "LED-232RX";
			gpios = <&main_gpio0 26 GPIO_ACTIVE_HIGH>;
		};

		led6 {
			label = "LED-485TX";
			gpios = <&main_gpio1 87 GPIO_ACTIVE_HIGH>;
		};

		led7 {
			label = "LED-485RX";
			gpios = <&main_gpio1 46 GPIO_ACTIVE_HIGH>;
		};

		led8 {
			label = "LED-SD";
			gpios = <&main_gpio0 23 GPIO_ACTIVE_HIGH>;
		};
	};

	//Eric+{
		/* Dual Ethernet application node on PRU-ICSSG1 */
	pruss1_eth: pruss1_eth {
		compatible = "ti,am654-icssg-prueth";
		pinctrl-names = "default";
		pinctrl-0 = <&ethernet0_pins_default>;
		sram = <&msmc_ram>;
		prus = <&pru1_0>, <&rtu1_0>, <&tx_pru1_0>,
				<&pru1_1>, <&rtu1_1>, <&tx_pru1_1>;
		firmware-name = "ti-pruss/am65x-sr2-pru0-prueth-fw.elf",
				"ti-pruss/am65x-sr2-rtu0-prueth-fw.elf",
				"ti-pruss/am65x-sr2-txpru0-prueth-fw.elf",
				"ti-pruss/am65x-sr2-pru1-prueth-fw.elf",
				"ti-pruss/am65x-sr2-rtu1-prueth-fw.elf",
				"ti-pruss/am65x-sr2-txpru1-prueth-fw.elf";

		ti,pruss-gp-mux-sel = <2>,      /* MII mode */
						<2>,
						<2>,
						<2>,      /* MII mode */
						<2>,
						<2>;
		mii-g-rt = <&icssg1_mii_g_rt>;
		mii-rt = <&icssg1_mii_rt>;
		dma-coherent;
		dmas = <&main_udmap 0xc200>, /* egress slice 0 */
			   <&main_udmap 0xc201>, /* egress slice 0 */
			   <&main_udmap 0xc202>, /* egress slice 0 */
			   <&main_udmap 0xc203>, /* egress slice 0 */
			   <&main_udmap 0xc204>, /* egress slice 1 */
			   <&main_udmap 0xc205>, /* egress slice 1 */
			   <&main_udmap 0xc206>, /* egress slice 1 */
			   <&main_udmap 0xc207>, /* egress slice 1 */

			   <&main_udmap 0x4200>, /* ingress slice 0 */
			   <&main_udmap 0x4201>, /* ingress slice 1 */
			   <&main_udmap 0x4202>, /* mgmnt rsp slice 0 */
			   <&main_udmap 0x4203>; /* mgmnt rsp slice 1 */
		dma-names = "tx0-0", "tx0-1", "tx0-2", "tx0-3",
					"tx1-0", "tx1-1", "tx1-2", "tx1-3",
					"rx0", "rx1",
					"rxmgm0", "rxmgm1";

        pruss1_emac0: ethernet-mii0 {
                phy-handle = <&pruss1_eth0_phy>;
                phy-mode = "rgmii-rxid";
                ti,half-duplex-capable;
                interrupts-extended = <&icssg1_intc 24>;
                syscon-rgmii-delay = <&scm_conf 0x4110>;
                iep = <&icssg1_iep0>;
                /* Filled in by bootloader */
                local-mac-address = [00 00 00 00 00 00];
        };
#if 0
        pruss1_emac1: ethernet-mii1 {
                phy-handle = <&pruss1_eth1_phy>;
                phy-mode = "rgmii-rxid";
                interrupts-extended = <&icssg1_intc 25>;
                syscon-rgmii-delay = <&scm_conf 0x4114>;
                /* Filled in by bootloader */
                local-mac-address = [00 00 00 00 00 00];
        };
#endif
	};
	//Eric+}

	/* Single Ethernet application node on PRU-ICSSG2 */ 
	pruss2_eth: pruss2_eth {
		compatible = "ti,am654-icssg-prueth";
		pinctrl-names = "default";
		pinctrl-0 = <&ethernet1_pins_default>;
		sram = <&msmc_ram>;
		prus = <&pru2_0>, <&rtu2_0>, <&tx_pru2_0>,
			<&pru2_1>, <&rtu2_1>, <&tx_pru2_1>;
		firmware-name = "ti-pruss/am65x-sr2-pru0-prueth-fw.elf",
				"ti-pruss/am65x-sr2-rtu0-prueth-fw.elf",
				"ti-pruss/am65x-sr2-txpru0-prueth-fw.elf",
				"ti-pruss/am65x-sr2-pru1-prueth-fw.elf",
				"ti-pruss/am65x-sr2-rtu1-prueth-fw.elf",
				"ti-pruss/am65x-sr2-txpru1-prueth-fw.elf";

		ti,pruss-gp-mux-sel = <2>,      /* MII mode */
				      <2>,
				      <2>,
				      <2>,	/* MII mode */
				      <2>,
				      <2>;
		mii-g-rt = <&icssg2_mii_g_rt>;
		mii-rt = <&icssg2_mii_rt>;
		dma-coherent;
		dmas = <&main_udmap 0xc300>, /* egress slice 0 */
		       <&main_udmap 0xc301>, /* egress slice 0 */
		       <&main_udmap 0xc302>, /* egress slice 0 */
		       <&main_udmap 0xc303>, /* egress slice 0 */
		       <&main_udmap 0xc304>, /* egress slice 1 */
		       <&main_udmap 0xc305>, /* egress slice 1 */
		       <&main_udmap 0xc306>, /* egress slice 1 */
		       <&main_udmap 0xc307>, /* egress slice 1 */

		       <&main_udmap 0x4300>, /* ingress slice 0 */
		       <&main_udmap 0x4301>, /* ingress slice 1 */
		       <&main_udmap 0x4302>, /* mgmnt rsp slice 0 */
		       <&main_udmap 0x4303>; /* mgmnt rsp slice 1 */
		dma-names = "tx0-0", "tx0-1", "tx0-2", "tx0-3",
			    "tx1-0", "tx1-1", "tx1-2", "tx1-3",
			    "rx0", "rx1",
			    "rxmgm0", "rxmgm1";

		pruss2_emac0: ethernet-mii0 {
			phy-handle = <&pruss2_eth0_phy>;
			phy-mode = "rgmii-rxid";
			ti,half-duplex-capable;
			interrupts-extended = <&icssg2_intc 24>;
			syscon-rgmii-delay = <&scm_conf 0x4120>;
			iep = <&icssg2_iep0>;
			/* Filled in by bootloader */
			local-mac-address = [00 00 00 00 00 00];
		};
	};
};

&wkup_pmx0 {
	pinctrl-names = "default";
	pinctrl-0 = <&eepromdone_pins_default &iovolctrl_pins_default &vbusctrl_pins_default>;

	phy2ax58100_pins_default: phy2ax58100_pins_default {
		pinctrl-single,pins = <
			AM65X_WKUP_IOPAD(0x0058, PIN_INPUT, 1) /* (N4) MCU_RGMII1_TX_CTL.MCU_RMII1_CRS_DV */
			AM65X_WKUP_IOPAD(0x005c, PIN_INPUT, 1) /* (N5) MCU_RGMII1_RX_CTL.MCU_RMII1_RX_ER */
			AM65X_WKUP_IOPAD(0x0068, PIN_OUTPUT, 1) /* (M4) MCU_RGMII1_TD1.MCU_RMII1_TXD1 */
			AM65X_WKUP_IOPAD(0x006c, PIN_OUTPUT, 1) /* (M5) MCU_RGMII1_TD0.MCU_RMII1_TXD0 */
			AM65X_WKUP_IOPAD(0x0080, PIN_INPUT, 1) /* (M6) MCU_RGMII1_RD1.MCU_RMII1_RXD1 */
			AM65X_WKUP_IOPAD(0x0084, PIN_INPUT, 1) /* (L6) MCU_RGMII1_RD0.MCU_RMII1_RXD0 */
			AM65X_WKUP_IOPAD(0x0070, PIN_OUTPUT, 1) /* (N1) MCU_RGMII1_TXC.MCU_RMII1_TX_EN */
			AM65X_WKUP_IOPAD(0x0074, PIN_INPUT, 1) /* (M1) MCU_RGMII1_RXC.MCU_RMII1_REF_CLK */
		>;
	};

	mcan0_pins_default: mcan0_pins_default {
		pinctrl-single,pins = <
			AM65X_WKUP_IOPAD(0x00ac, PIN_INPUT, 0) /* (W2) MCU_MCAN0_RX */
			AM65X_WKUP_IOPAD(0x00a8, PIN_OUTPUT, 0) /* (W1) MCU_MCAN0_TX */
		>;
	};

	phy2ax58100_mdio2_pins_default: phy2ax58100_mdio2_pins_default {
		pinctrl-single,pins = <
			AM65X_WKUP_IOPAD(0x008c, PIN_OUTPUT, 0) /* (L1) MCU_MDIO0_MDC */
			AM65X_WKUP_IOPAD(0x0088, PIN_INPUT, 0) /* (L4) MCU_MDIO0_MDIO */
		>;
	};

	usb5vsignal_pins_default: usb5vsignal_pins_default {
		pinctrl-single,pins = <
			AM65X_WKUP_IOPAD(0x00c4, PIN_INPUT, 7) /* (AD3) WKUP_GPIO0_5 */
		>;
	};

	iovolctrl_pins_default: iovolctrl_pins_default {
		pinctrl-single,pins = <
			AM65X_WKUP_IOPAD(0x00c8, PIN_OUTPUT, 7) /* (AC2) WKUP_GPIO0_6 */ /*IO_VOLCTRL*/
		>;
	};

	eepromdone_pins_default: eepromdone_pins_default {
		pinctrl-single,pins = <
			AM65X_WKUP_IOPAD(0x00cc, PIN_INPUT, 7) /* (AC1) WKUP_GPIO0_7 */ /*EEP_DONE*/
		>;
	};

	vbusctrl_pins_default: vbusctrl_pins_default {
		pinctrl-single,pins = <
			AM65X_WKUP_IOPAD(0x00D8, PIN_OUTPUT, 7) /* (AB3) WKUP_GPIO0_10 */ /*USBVBUSCTRL*/
		>;
	};
};

&main_pmx0 {
	pinctrl-names = "default";
	pinctrl-0 = <&gpio0_pins_default &gpio1_pins_default>;

	gpio1_pins_default: gpio1_pins_default {
		pinctrl-single,pins = <
			AM65X_IOPAD(0x01ec, PIN_OUTPUT, 7)  /* (AG11) GPIO1_27 */ /*Latch*/
			AM65X_IOPAD(0x01f0, PIN_INPUT, 7)   /* (AD11) GPIO1_28 */ /*/DO-FAULT*/
			AM65X_IOPAD(0x01f4, PIN_INPUT, 1)   /* (V24) PRG0_PRU0_GPO0.GPIO1_29 */
			AM65X_IOPAD(0x01f8, PIN_INPUT, 1)   /* (W25) PRG0_PRU0_GPO1.GPIO1_30 */
			AM65X_IOPAD(0x01fc, PIN_INPUT, 1)   /* (W24) PRG0_PRU0_GPO2.GPIO1_31 */
			AM65X_IOPAD(0x0200, PIN_INPUT, 1)   /* (AA27) PRG0_PRU0_GPO3.GPIO1_32 */
			AM65X_IOPAD(0x0204, PIN_INPUT, 1)   /* (Y24) PRG0_PRU0_GPO4.GPIO1_33 */
			AM65X_IOPAD(0x0208, PIN_INPUT, 1)   /* (V28) PRG0_PRU0_GPO5.GPIO1_34 */
			AM65X_IOPAD(0x020c, PIN_INPUT, 1)   /* (Y25) PRG0_PRU0_GPO6.GPIO1_35 */
			AM65X_IOPAD(0x0210, PIN_INPUT, 1)   /* (U27) PRG0_PRU0_GPO7.GPIO1_36 */
			AM65X_IOPAD(0x0214, PIN_INPUT, 7)   /* (V27) PRG0_PRU0_GPO8.GPIO1_37 */
			AM65X_IOPAD(0x0218, PIN_INPUT, 7)   /* (V26) PRG0_PRU0_GPO9.GPIO1_38 */
			AM65X_IOPAD(0x021c, PIN_INPUT, 7)   /* (U25) PRG0_PRU0_GPO10.GPIO1_39 */
			AM65X_IOPAD(0x0220, PIN_INPUT, 7)   /* (AB25) PRG0_PRU0_GPO11.GPIO1_40 */
			AM65X_IOPAD(0x0224, PIN_INPUT, 7)   /* (AD27) PRG0_PRU0_GPO12.GPIO1_41 */
			AM65X_IOPAD(0x0228, PIN_INPUT, 7)   /* (AC26) PRG0_PRU0_GPO13.GPIO1_42 */
			AM65X_IOPAD(0x022c, PIN_INPUT, 7)   /* (AD26) PRG0_PRU0_GPO14.GPIO1_43 */
			AM65X_IOPAD(0x0230, PIN_INPUT, 7)   /* (AA24) PRG0_PRU0_GPO15.GPIO1_44 */
			AM65X_IOPAD(0x0234, PIN_INPUT, 1)   /* (AD28) GPIO1_45 */ /*HS_PRU0_LV*/
			AM65X_IOPAD(0x023C, PIN_OUTPUT, 7)   /* (V25) GPIO1_47 */ /*HS_PRU0_IRQ*/
			AM65X_IOPAD(0x0244, PIN_OUTPUT_PULLDOWN, 7) /* (AB28) PRG0_PRU1_GPO0.GPIO1_49 */ /*****************************************************************************/
			AM65X_IOPAD(0x0248, PIN_OUTPUT_PULLDOWN, 7) /* (AC28) PRG0_PRU1_GPO1.GPIO1_50 */ /*We set the mode as 7 due to PRU cannot control default status of output pin*/
			AM65X_IOPAD(0x024c, PIN_OUTPUT_PULLDOWN, 7) /* (AC27) PRG0_PRU1_GPO2.GPIO1_51 */ /*And we set the mode back to 0 using memdev2 after PRU init*/
			AM65X_IOPAD(0x0250, PIN_OUTPUT_PULLDOWN, 7) /* (AB26) PRG0_PRU1_GPO3.GPIO1_52 */ /*****************************************************************************/
			AM65X_IOPAD(0x0284, PIN_INPUT, 7)   /* (AC24) GPIO1_65 */
			AM65X_IOPAD(0x0290, PIN_INPUT, 7)   /* (W26) GPIO1_68 */
			AM65X_IOPAD(0x0294, PIN_INPUT, 7)   /* (AE26) GPIO1_69 */
			AM65X_IOPAD(0x01d0, PIN_OUTPUT_PULLDOWN, 7) /* (AD12) GPIO1_20 */ /*SEL-OUT*/
		>;
	};

	ledgpio1_pins_default: ledgpio1_pins_default {
		pinctrl-single,pins = <
			AM65X_IOPAD(0x01d4, PIN_OUTPUT, 7)  /* (AG12) GPIO1_21 */ /* RS232-TX-LED */
			AM65X_IOPAD(0x0238, PIN_OUTPUT, 7)  /* (U26) GPIO1_46 */ /* RS485-RX-LED */
			AM65X_IOPAD(0x0240, PIN_OUTPUT, 7)  /* (U24) GPIO1_48 */ /* BUSFAULT-LED */
			AM65X_IOPAD(0x0298, PIN_OUTPUT, 7)  /* (AE28) GPIO1_70 */ /* ERROR-LED */
		>;
	};

	gpio0_pins_default: gpio0_pins_default {
		pinctrl-single,pins = <
			AM65X_IOPAD(0x0040, PIN_OUTPUT, 7)  /* (R28) GPIO0_16 */ /*ETH1-PHY-RESET*/
			AM65X_IOPAD(0x0058, PIN_INPUT, 7)   /* (R26) GPIO0_22 */ /*RUN/STOP SW*/
			AM65X_IOPAD(0x005c, PIN_OUTPUT, 7)  /* (R23) GPIO0_23 */ /* SD-CARD-READY-LED */
			AM65X_IOPAD(0x0060, PIN_OUTPUT, 7)  /* (T25) GPIO0_24 */ /*/AX58100-RST*/
			AM65X_IOPAD(0x0064, PIN_OUTPUT, 7)  /* (T24) GPIO0_25 */ /*/AX58100-PYH-RST*/
			AM65X_IOPAD(0x0068, PIN_OUTPUT, 7)  /* (R24) GPIO0_26 */ /* RS232-RX-LED */
			AM65X_IOPAD(0x0070, PIN_OUTPUT, 7)  /* (R25) GPIO0_28 */ /*GPIO-eMMC-RST*/
			AM65X_IOPAD(0x0074, PIN_INPUT, 7)   /* (T27) GPIO0_29 */ /*/24V-LV*/
			AM65X_IOPAD(0x00ac, PIN_INPUT, 1)   /* (AH15) PRG2_PRU1_GPO0.GPIO0_43 */
			AM65X_IOPAD(0x00b0, PIN_INPUT, 1)   /* (AC16) PRG2_PRU1_GPO1.GPIO0_44 */
			AM65X_IOPAD(0x00b4, PIN_INPUT, 1)   /* (AD17) PRG2_PRU1_GPO2.GPIO0_45 */
			AM65X_IOPAD(0x00b8, PIN_INPUT, 1)   /* (AH14) PRG2_PRU1_GPO3.GPIO0_46 */
			AM65X_IOPAD(0x00d4, PIN_OUTPUT, 7)  /* (AC15) GPIO0_53 */ /*CAN-TERM*/
			AM65X_IOPAD(0x00d8, PIN_INPUT, 1)   /* (AD14) GPIO0_54 */ /*HS_PRU2_LV*/
			AM65X_IOPAD(0x00dc, PIN_OUTPUT, 7)   /* (AE14) GPIO0_55 */ /*HS_PRU2_IRQ*/
			AM65X_IOPAD(0x00f4, PIN_INPUT | PIN_OUTPUT, 7)   /* (AF27) GPIO0_61 */ /*PRU0-IRQ*/
			AM65X_IOPAD(0x00fc, PIN_INPUT | PIN_OUTPUT, 7)   /* (AG27) GPIO0_63 */ /*PRU2-IRQ*/
			AM65X_IOPAD(0x0108, PIN_OUTPUT, 7)  /* (AH25) GPIO0_66 */ /*ETH0-PHY-RESET*/
			AM65X_IOPAD(0x0124, PIN_OUTPUT, 7)  /* (AH26) GPIO0_73 */ /*ECAT2-PHY-RST*/
		>;
	};

	ledgpio0_pins_default: ledgpio0_pins_default {
		pinctrl-single,pins = <
			AM65X_IOPAD(0x006c, PIN_OUTPUT | PIN_INPUT, 7) /* (T23) GPIO0_27 */ /* RUN-LED */
		>;
	};

	main_mmc0_pins_default: main-mmc0-pins-default {
		pinctrl-single,pins = <
			AM65X_IOPAD(0x01a8, PIN_INPUT_PULLDOWN, 0) /* (B25) MMC0_CLK */
			AM65X_IOPAD(0x01ac, PIN_INPUT_PULLUP, 0) /* (B27) MMC0_CMD */
			AM65X_IOPAD(0x01a4, PIN_INPUT_PULLUP, 0) /* (A26) MMC0_DAT0 */
			AM65X_IOPAD(0x01a0, PIN_INPUT_PULLUP, 0) /* (E25) MMC0_DAT1 */
			AM65X_IOPAD(0x019c, PIN_INPUT_PULLUP, 0) /* (C26) MMC0_DAT2 */
			AM65X_IOPAD(0x0198, PIN_INPUT_PULLUP, 0) /* (A25) MMC0_DAT3 */
			AM65X_IOPAD(0x0194, PIN_INPUT_PULLUP, 0) /* (E24) MMC0_DAT4 */
			AM65X_IOPAD(0x0190, PIN_INPUT_PULLUP, 0) /* (A24) MMC0_DAT5 */
			AM65X_IOPAD(0x018c, PIN_INPUT_PULLUP, 0) /* (B26) MMC0_DAT6 */
			AM65X_IOPAD(0x0188, PIN_INPUT_PULLUP, 0) /* (D25) MMC0_DAT7 */
			AM65X_IOPAD(0x01b0, PIN_INPUT, 0) /* (C25) MMC0_DS */
		>;
	};

	main_mmc1_pins_default: main-mmc1-pins-default {
		pinctrl-single,pins = <
			AM65X_IOPAD(0x02d4, PIN_INPUT_PULLDOWN, 0) /* (C27) MMC1_CLK */
			AM65X_IOPAD(0x02d8, PIN_INPUT_PULLUP, 0) /* (C28) MMC1_CMD */
			AM65X_IOPAD(0x02d0, PIN_INPUT_PULLUP, 0) /* (D28) MMC1_DAT0 */
			AM65X_IOPAD(0x02cc, PIN_INPUT_PULLUP, 0) /* (E27) MMC1_DAT1 */
			AM65X_IOPAD(0x02c8, PIN_INPUT_PULLUP, 0) /* (D26) MMC1_DAT2 */
			AM65X_IOPAD(0x02c4, PIN_INPUT_PULLUP, 0) /* (D27) MMC1_DAT3 */
			AM65X_IOPAD(0x02dc, PIN_INPUT_PULLUP, 0) /* (B24) MMC1_SDCD */
			AM65X_IOPAD(0x02e0, PIN_INPUT, 0) /* (C24) MMC1_SDWP */
		>;
	};

	icssg1_mdio_pins_default: icssg1_mdio_pins_default {
		pinctrl-single,pins = <
			AM65X_IOPAD(0x0180, PIN_INPUT, 0) /* (AD18) PRG1_MDIO0_MDIO */
			AM65X_IOPAD(0x0184, PIN_OUTPUT, 0) /* (AH18) PRG1_MDIO0_MDC */
		>;
	};

	ethernet0_pins_default: ethernet0_pins_default {
		pinctrl-single,pins = <
			AM65X_IOPAD(0x00e0, PIN_INPUT, 2) /* (AE22) PRG1_PRU0_GPO0.PRG1_RGMII1_RD0 */
			AM65X_IOPAD(0x00e4, PIN_INPUT, 2) /* (AG24) PRG1_PRU0_GPO1.PRG1_RGMII1_RD1 */
			AM65X_IOPAD(0x00e8, PIN_INPUT, 2) /* (AF23) PRG1_PRU0_GPO2.PRG1_RGMII1_RD2 */
			AM65X_IOPAD(0x00ec, PIN_INPUT, 2) /* (AD21) PRG1_PRU0_GPO3.PRG1_RGMII1_RD3 */
			AM65X_IOPAD(0x0110, PIN_OUTPUT, 2) /* (AH20) PRG1_PRU0_GPO12.PRG1_RGMII1_TD0 */
			AM65X_IOPAD(0x0114, PIN_OUTPUT, 2) /* (AH21) PRG1_PRU0_GPO13.PRG1_RGMII1_TD1 */
			AM65X_IOPAD(0x0118, PIN_OUTPUT, 2) /* (AG20) PRG1_PRU0_GPO14.PRG1_RGMII1_TD2 */
			AM65X_IOPAD(0x011c, PIN_OUTPUT, 2) /* (AD19) PRG1_PRU0_GPO15.PRG1_RGMII1_TD3 */
			AM65X_IOPAD(0x0120, PIN_INPUT, 2) /* (AD20) PRG1_PRU0_GPO16.PRG1_RGMII1_TXC */
			AM65X_IOPAD(0x010c, PIN_OUTPUT, 2) /* (AF21) PRG1_PRU0_GPO11.PRG1_RGMII1_TX_CTL */
			AM65X_IOPAD(0x00f8, PIN_INPUT, 2) /* (AF22) PRG1_PRU0_GPO6.PRG1_RGMII1_RXC */
			AM65X_IOPAD(0x00f0, PIN_INPUT, 2) /* (AG23) PRG1_PRU0_GPO4.PRG1_RGMII1_RX_CTL */

			//ethercat1_pins_default
			AM65X_IOPAD(0x0130, PIN_INPUT, 2) /* (AH24) PRG1_PRU1_GPO0.PRG1_RGMII2_RD0 */
			AM65X_IOPAD(0x0134, PIN_INPUT, 2) /* (AH23) PRG1_PRU1_GPO1.PRG1_RGMII2_RD1 */
			AM65X_IOPAD(0x0138, PIN_INPUT, 2) /* (AG21) PRG1_PRU1_GPO2.PRG1_RGMII2_RD2 */
			AM65X_IOPAD(0x013c, PIN_INPUT, 2) /* (AH22) PRG1_PRU1_GPO3.PRG1_RGMII2_RD3 */
			AM65X_IOPAD(0x0160, PIN_OUTPUT, 2) /* (AE20) PRG1_PRU1_GPO12.PRG1_RGMII2_TD0 */
			AM65X_IOPAD(0x0164, PIN_OUTPUT, 2) /* (AF19) PRG1_PRU1_GPO13.PRG1_RGMII2_TD1 */
			AM65X_IOPAD(0x0168, PIN_OUTPUT, 2) /* (AH19) PRG1_PRU1_GPO14.PRG1_RGMII2_TD2 */
			AM65X_IOPAD(0x016c, PIN_OUTPUT, 2) /* (AG19) PRG1_PRU1_GPO15.PRG1_RGMII2_TD3 */
			AM65X_IOPAD(0x0170, PIN_INPUT, 2) /* (AE19) PRG1_PRU1_GPO16.PRG1_RGMII2_TXC */
			AM65X_IOPAD(0x015c, PIN_OUTPUT, 2) /* (AC20) PRG1_PRU1_GPO11.PRG1_RGMII2_TX_CTL */
			AM65X_IOPAD(0x0148, PIN_INPUT, 2) /* (AG22) PRG1_PRU1_GPO6.PRG1_RGMII2_RXC */
			AM65X_IOPAD(0x0140, PIN_INPUT, 2) /* (AE21) PRG1_PRU1_GPO4.PRG1_RGMII2_RX_CTL */
		>;
	};

	icssg2_mdio_pins_default: icssg2_mdio_pins_default {
		pinctrl-single,pins = <
			AM65X_IOPAD(0x0094, PIN_INPUT, 2) /* (AC19) PRG2_PRU0_GPO7.PRG2_MDIO0_MDIO */
			AM65X_IOPAD(0x00c8, PIN_OUTPUT, 2) /* (AE15) PRG2_PRU1_GPO7.PRG2_MDIO0_MDC */
		>;
	};

	ethernet1_pins_default: ethernet1_pins_default {
		pinctrl-single,pins = <
			AM65X_IOPAD(0x0078, PIN_INPUT, 2) /* (AF18) PRG2_PRU0_GPO0.PRG2_RGMII1_RD0 */
			AM65X_IOPAD(0x007c, PIN_INPUT, 2) /* (AE18) PRG2_PRU0_GPO1.PRG2_RGMII1_RD1 */
			AM65X_IOPAD(0x0080, PIN_INPUT, 2) /* (AH17) PRG2_PRU0_GPO2.PRG2_RGMII1_RD2 */
			AM65X_IOPAD(0x0084, PIN_INPUT, 2) /* (AG18) PRG2_PRU0_GPO3.PRG2_RGMII1_RD3 */
			AM65X_IOPAD(0x0098, PIN_OUTPUT, 2) /* (AH16) PRG2_PRU0_GPO8.PRG2_RGMII1_TD0 */
			AM65X_IOPAD(0x009c, PIN_OUTPUT, 2) /* (AG16) PRG2_PRU0_GPO9.PRG2_RGMII1_TD1 */
			AM65X_IOPAD(0x00a0, PIN_OUTPUT, 2) /* (AF16) PRG2_PRU0_GPO10.PRG2_RGMII1_TD2 */
			AM65X_IOPAD(0x00a4, PIN_OUTPUT, 2) /* (AE16) PRG2_PRU0_GPO11.PRG2_RGMII1_TD3 */
			AM65X_IOPAD(0x00a8, PIN_INPUT, 2) /* (AD16) PRG2_PRU0_GPO16.PRG2_RGMII1_TXC */
			AM65X_IOPAD(0x0090, PIN_OUTPUT, 2) /* (AE17) PRG2_PRU0_GPO6.PRG2_RGMII1_TX_CTL */
			AM65X_IOPAD(0x008c, PIN_INPUT, 2) /* (AF17) PRG2_PRU0_GPO5.PRG2_RGMII1_RXC */
			AM65X_IOPAD(0x0088, PIN_INPUT, 2) /* (AG17) PRG2_PRU0_GPO4.PRG2_RGMII1_RX_CTL */
		>;
	};

	main_spi0_pins_default: main-spi0-pins-default {
		pinctrl-single,pins = <
			AM65X_IOPAD(0x01c4, PIN_INPUT_PULLUP, 0)  /* (AH13) GPIO1_17 */ /*SPI0-CLK*/
			AM65X_IOPAD(0x01c8, PIN_OUTPUT, 0)  /* (AE13) GPIO1_18 */ /*SPI0_D0*/
			AM65X_IOPAD(0x01cc, PIN_INPUT, 0)   /* (AD13) GPIO1_19 */ /*SPI0_D1*/
			AM65X_IOPAD(0x01bc, PIN_OUTPUT, 0)  /* (AG13) GPIO1_15 */ /*SPI0_CS0*/
			AM65X_IOPAD(0x01c0, PIN_OUTPUT, 0)  /* (AF13) GPIO1_16 */ /*SPI0_CS1*/
		>;
	};

	myspi2_pins_default: myspi2_pins_default {
		pinctrl-single,pins = <
			AM65X_IOPAD(0x01d8, PIN_OUTPUT, 0)  /* (AH12) GPIO1_22 */ /*SPI1_CLK*/
			AM65X_IOPAD(0x01dc, PIN_OUTPUT, 0)  /* (AE12) GPIO1_23 */ /*SPI1_D0*/
			AM65X_IOPAD(0x01e0, PIN_INPUT, 0)   /* (AF12) GPIO1_24 */ /*SPI1_D1*/
		>;
	};

	main_uart0_pins_default: main-uart0-pins-default {
		pinctrl-single,pins = <
			AM65X_IOPAD(0x01e4, PIN_INPUT, 0)   /* (AF11) GPIO1_25 */ /*UART0_RXD*/
			AM65X_IOPAD(0x01e8, PIN_OUTPUT, 0)  /* (AE11) GPIO1_26 */ /*UART0_TXD*/
		>;
	};

	rs232_pins_default: rs232_pins_default {
		pinctrl-single,pins = <
			AM65X_IOPAD(0x0288, PIN_INPUT, 6)   /* (Y27) GPIO1_66 */ /*RS232-RXD*/
			AM65X_IOPAD(0x0260, PIN_OUTPUT, 6)  /* (W28) GPIO1_56 */ /*RS232-TXD*/
		>;
	};

	rs485_pins_default: rs485_pins_default {
		pinctrl-single,pins = <
			AM65X_IOPAD(0x0174, PIN_INPUT, 6)   /* (AE23) GPIO0_93 */ /*RS485-RXD*/
			AM65X_IOPAD(0x014c, PIN_OUTPUT, 6)  /* (AD23) GPIO0_83 */ /*RS485-TXD*/
			AM65X_IOPAD(0x017c, PIN_OUTPUT_PULLDOWN, 7) /* (AC21) GPIO0_95 */ /*RS485-DIR*/
		>;
	};

	usb0_pins_default: usb0_pins_default {
		pinctrl-single,pins = <
			AM65X_IOPAD(0x02bc, PIN_OUTPUT, 0) /* (AD9) GPIO1_71 */ /*USB0_DRVVBUS*/
		>;
	};

	usb20_host_pins_default: usb20_host_pins_default {
		pinctrl-single,pins = <
			AM65X_IOPAD(0x02c0, PIN_OUTPUT, 0) /* (AC8) GPIO1_72 */ /*USB1_DRVVBUS*/
		>;
	};
};

&main_pmx1 {
	pinctrl-names = "default";
        pinctrl-0 = <&gpio2_pins_default>;

	main_i2c0_pins_default: main-i2c0-pins-default {
		pinctrl-single,pins = <
			AM65X_IOPAD(0x0000, PIN_INPUT, 0) /* (D20) I2C0_SCL */
			AM65X_IOPAD(0x0004, PIN_INPUT, 0) /* (C21) I2C0_SDA */
		>;
	};

	main_i2c1_pins_default: main-i2c1-pins-default {
		pinctrl-single,pins = <
			AM65X_IOPAD(0x0008, PIN_INPUT_PULLUP, 0) /* (B21) I2C1_SCL */
			AM65X_IOPAD(0x000c, PIN_INPUT_PULLUP, 0) /* (E21) I2C1_SDA */
		>;
	};

	gpio2_pins_default: gpio2_pins_default {
		pinctrl-single,pins = <
			AM65X_IOPAD(0x0010, PIN_OUTPUT, 7)  /* (D21) GPIO1_86 */ /* SER-COMM-EN */
			AM65X_IOPAD(0x0018, PIN_INPUT, 7)   /* (B22) GPIO1_88 */ /* DDR-TP0 */
			AM65X_IOPAD(0x001c, PIN_INPUT, 7)   /* (C23) GPIO1_89 */ /* DDR-TP1 */
		>;
	};

	ledgpio2_pins_default: ledgpio2_pins_default {
		pinctrl-single,pins = <
			AM65X_IOPAD(0x0014, PIN_OUTPUT, 7) /* (A22) GPIO1_87 */	/* RS485-TX-LED */
		>;
	};
};

&wkup_uart0 {
	/* Wakeup UART is used by System firmware */
	status = "disabled";
};

&main_uart0 {
	pinctrl-names = "default";
	pinctrl-0 = <&main_uart0_pins_default>;
	power-domains = <&k3_pds 146 TI_SCI_PD_SHARED>;
};

//Eric+{
&main_uart2 {
	pinctrl-names = "default";
	power-domains = <&k3_pds 148 TI_SCI_PD_SHARED>;
	pinctrl-0 = <&rs232_pins_default>;
	status = "okay";
};

&main_uart1 {
	pinctrl-names = "default";
	pinctrl-0 = <&rs485_pins_default>;
	power-domains = <&k3_pds 147 TI_SCI_PD_SHARED>;
	rts-gpios = <&main_gpio0 95 GPIO_ACTIVE_HIGH>;
	rs485-rts-active-high;
	rs485-rts-delay = <0 0>;
	linux,rs485-enabled-at-boot-time;
	status = "okay";
};
//Eric+}

&main_i2c0 {
	status = "okay";

	pinctrl-names = "default";
	pinctrl-0 = <&main_i2c0_pins_default>;
	clock-frequency = <100000>;

#if 0
	rx8130:rtc@32{
		compatible = "epson,rx8130-legacy";
		reg = <0x32>;
	};
#endif

	eeprom: eeprom@50 {
		compatible = "atmel,24c16";
		reg = <0x50>;
		pagesize = <16>;
	};
};

&main_i2c1 {
	status = "okay";

	pinctrl-names = "default";
	pinctrl-0 = <&main_i2c1_pins_default>;
	clock-frequency = <100000>;

	s35390a:rtc@30{
		compatible = "sii,s35390a";
		reg = <0x30>;
	};
};

&main_spi0 {
    status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&main_spi0_pins_default>;
	#address-cells = <1>;
	#size-cells= <0>;
	ti,pindir-d0-out-d1-in = <1>;

    spidev@0 {
        status = "okay";
        //compatible = "fairchild,74hc595";
        compatible = "linux,spidev";
        reg = <0>;
        spi-max-frequency = <1000000>;
    };
};

&main_spi1 {
    status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&myspi2_pins_default>;
	#address-cells = <1>;
	#size-cells= <0>;
	ti,pindir-d0-out-d1-in = <1>;

    spidev@0 {
        status = "okay";
        //compatible = "fairchild,74hc595";
        compatible = "linux,spidev";
        gpio-controller;
        #gpio-cells = <2>;
        reg = <0>;
        registers-number = <2>;
        registers-default = /bits/ 8 <0xb7>;
        spi-max-frequency = <100000>;
    };
};

&sdhci0 {
	pinctrl-names = "default";
	pinctrl-0 = <&main_mmc0_pins_default>;
	bus-width = <8>;
	non-removable;
	ti,driver-strength-ohm = <50>;
	disable-wp;
};

&sdhci1 {
	pinctrl-names = "default";
	pinctrl-0 = <&main_mmc1_pins_default>;
	ti,driver-strength-ohm = <50>;
	disable-wp;
};

&dwc3_1 {
	status = "okay";
};

&usb1_phy {
	status = "okay";
};

&usb1 {
	pinctrl-names = "default";
	pinctrl-0 = <&usb20_host_pins_default>;
	dr_mode = "host";
};

&dwc3_0 {
	status = "okay";
};

&usb0_phy {
	status = "okay";
};

//Eric+{

&m_can0 {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&mcan0_pins_default>;
	//stb-gpios = <&main_gpio1 47 GPIO_ACTIVE_HIGH>;
	can-transceiver {
		max-bitrate = <5000000>;
	};
};

&usb0 {
	pinctrl-names = "default";
	//pinctrl-0 = <&usb0_pins_default>;
	dr_mode = "peripheral";
};
//Eric+}

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

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

&serdes0 {
	status = "disabled";
};

&serdes1 {
	status = "disabled";
};

&pcie0_rc {
	status = "disabled";
};

&pcie0_ep {
	status = "disabled";
};

&pcie1_rc {
	status = "disabled";
};

&pcie1_ep {
	status = "disabled";
};

&mailbox0_cluster0 {
	interrupts = <436>;

	mbox_mcu_r5fss0_core0: mbox-mcu-r5fss0-core0 {
		ti,mbox-tx = <1 0 0>;
		ti,mbox-rx = <0 0 0>;
	};
};

&mailbox0_cluster1 {
	interrupts = <432>;

	mbox_mcu_r5fss0_core1: mbox-mcu-r5fss0-core1 {
		ti,mbox-tx = <1 0 0>;
		ti,mbox-rx = <0 0 0>;
	};
};

&mailbox0_cluster2 {
	status = "disabled";
};

&mailbox0_cluster3 {
	status = "disabled";
};

&mailbox0_cluster4 {
	status = "disabled";
};

&mailbox0_cluster5 {
	status = "disabled";
};

&mailbox0_cluster6 {
	status = "disabled";
};

&mailbox0_cluster7 {
	status = "disabled";
};

&mailbox0_cluster8 {
	status = "disabled";
};

&mailbox0_cluster9 {
	status = "disabled";
};

&mailbox0_cluster10 {
	status = "disabled";
};

&mailbox0_cluster11 {
	status = "disabled";
};

&mcu_r5fss0_core0 {
	memory-region = <&mcu_r5fss0_core0_dma_memory_region>,
			<&mcu_r5fss0_core0_memory_region>;
	mboxes = <&mailbox0_cluster0 &mbox_mcu_r5fss0_core0>;
};

&mcu_r5fss0_core1 {
	memory-region = <&mcu_r5fss0_core1_dma_memory_region>,
			<&mcu_r5fss0_core1_memory_region>;
	mboxes = <&mailbox0_cluster1 &mbox_mcu_r5fss0_core1>;
};

&mcu_cpsw {
	pinctrl-names = "default";
	//Eric- pinctrl-0 = <&mcu_cpsw_pins_default &mcu_mdio_pins_default>;
	pinctrl-0 = <&phy2ax58100_pins_default &phy2ax58100_mdio2_pins_default>;
};

&davinci_mdio {
	reset = <&main_gpio0 25 GPIO_ACTIVE_LOW>;
	reset-delay-us = <2>;   /* PHY datasheet states 1us min */

	phy0: ethernet-phy@3 {
		reg = <3>;
	};
};

&cpsw_port1 {
	phy-mode = "rmii";
	phy-handle = <&phy0>;
};

//Eric+{
&icssg1_mdio {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&icssg1_mdio_pins_default>;

	reset = <&main_gpio0 66 GPIO_ACTIVE_LOW>; /*83867*/
	//reset = <&main_gpio0 73 GPIO_ACTIVE_LOW>; /*83822*/
	reset-delay-us = <2>;

	/*83867*/
	pruss1_eth0_phy: ethernet-phy@1 {
		reg = <1>;
		ti,rx-internal-delay = <DP83867_RGMIIDCTL_2_00_NS>;
		ti,fifo-depth = <DP83867_PHYCR_FIFO_DEPTH_4_B_NIB>;
	};
#if 0
	/*83822*/
	pruss1_eth1_phy: ethernet-phy@7 {
		reg = <7>;
	};
#endif
};
//Eric+}

&icssg2_mdio {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&icssg2_mdio_pins_default>;

	reset = <&main_gpio0 16 GPIO_ACTIVE_LOW>;
	reset-delay-us = <2>;

	/*83867*/
	pruss2_eth0_phy: ethernet-phy@2 {
		reg = <2>;
		ti,rx-internal-delay = <DP83867_RGMIIDCTL_2_00_NS>;
		ti,fifo-depth = <DP83867_PHYCR_FIFO_DEPTH_4_B_NIB>;
	};
};

Thanks.

Eric

  • Hello Eric,

    Do you interact with the RTC during runtime? If so, are you seeing any differences in behavior when interacting with the RTC in a "working" case, as opposed to a "timeout during boot" case?

    Regards,

    Nick

  • Hi

    I'm not clear about this.

    Do you mean to access RTC after boot into OS?  or ????

    Eric

  • Hello Eric,

    Trying to understand software impact

    So far, what you have described is 4 lines that are output in the terminal:

    [ 3.426408] omap_i2c 2010000.i2c: controller timed out
    [ 3.426423] rtc-s35390a 3-0030: error resetting chip
    [ 3.426912] rtc-s35390a: probe of 3-0030 failed with error -5
    [ 3.426931] omap_i2c 2010000.i2c: bus 3 rev0.12 at 100 kHz

    Are you observing any other differences in how the chip is behaving?

    e.g., is that output above related to this later output? Or is this later output unrelated?

    [ 5.229603] hctosys: unable to open rtc device (rtc0)

    Is the I2C bus still nonresponsive after boot time finishes? Are there any other differences in the system behavior when that "timed out" output shows up?

    Hardware related questions

    How many boards are you testing? Is the behavior seen on all boards, or just a couple of them?

    Regards,

    Nick

  • Hi ,

    1.We are trying to access RTC in rc.local. That's way you can see the log below.

    [ 5.229603] hctosys: unable to open rtc device (rtc0)

    It's because rtc chip probe fail, and return error message when we access it.

    2.We have not much HW board, but we tried 3~4 pieces, and all can reproduce this. 

    Eric

  • Hello Eric,

    I am going to start by sending your thread to a HW team member, just to make sure this is not a HW design issue (e.g., noisy signals, etc).

    Please note that responses may be delayed due to Diwali. Feel free to ping the thread if you do not have a response by the end of the week.

    Regards,

    Nick

  • Hello Eric, 

    I am going to start by sending your thread to a HW team member, just to make sure this is not a HW design issue (e.g., noisy signals, etc).

    Could you please share the interface details.

    Regards,

    Sreenivasa

  • Hi ,

    Attached the i2c1 related schematic.

    If you need more, please let me know.

    Eric

  • Hello Eric, 

    Thank you.

    I see you used a discrete level translator. Do you see that being an issue.

    Is there a failure pattern that you have observed.

    have you tried reducing the I2C speed or reducing the pull values and tested.

    Would you be able to DNI the 22 pF cap and perform some testing.

    Regards,

    Sreenivasa

  • Hi ,

    We tried to get a failure pattern, but it's hard for us. The fail rate is quite low.

    I have tried with 100K and 400KHz, it's not work for this.

    And we also tried to change the capacity from 22pF to 47pF, but it's still happened.

    Do you have any other suggestion?

    Eric

  • Hello Eric, 

    Thank you.

    I have tried with 100K and 400KHz, it's not work for this.

    I assume you are seeing similar failures at 100K and 400K. What is the frequency you have set?

    And we also tried to change the capacity from 22pF to 47pF, but it's still happened.

    Did you try to make the Cap DNI

    Did you try reducing the pull value?

    Do you have a level shifter IC that you can wire and do some testing to identify the issue?

    Regards,

    Sreenivasa

  • Hi

    I assume you are seeing similar failures at 100K and 400K. What is the frequency you have set?

    --> Did you mean clock-frequency in dts file as below?

    &main_i2c1 {
    status = "okay";

    pinctrl-names = "default";
    pinctrl-0 = <&main_i2c1_pins_default>;
    clock-frequency = <100000>;

    s35390a:rtc@30{
    compatible = "sii,s35390a";
    reg = <0x30>;
    };
    };

    Eric

  • Hello Eric, 

    Thank you.

    I assume you are seeing similar failures at 100K and 400K. What is the frequency you have set?

    I was asking about the frequency of the I2C interface used in the application?

    Regards,

    Sreenivasa

  • Hi ,

    In our application, we just use Linux command "hwclock" to get the clock data. We didn't configure the frequency.

    I suppose it's should be the same as the dts we setting.

    But this is execute after boot into OS.

    This problem is happened in about 3 sec when boot into kernel.

    If I misunderstanding, please let me know.

    Thanks.

    Eric

  • Hello Eric, 

    Thank you.

    Did you try to make the Cap DNI

    Did you try reducing the pull value?

    Could you please try the above and updated the results.

    Regards,

    Sreenivasa

  • Hi

    We have tried to Cap DNI and reduced the pull up register, but it still happened.

    Eric

  • Hello Eric, 

    Thank you.

    Do you have a level shifter IC that you can wire and do some testing to identify the issue?

    Could you please capture the I2C interface waveform?

    Regards,

    Sreenivasa

  • Hi ,

    We got the abnormal waveform.

    And below is the normal one.

    Thanks.

    Eric

  • Hi ,

    We got another waveform and it might cause this problem.

    Suppose CLK (yellow) and DAT (red) should be pull up when power on.

    But the data pin seems not correct. 

    If you can give some comment?

    Thanks.

    Eric

  • Hello Eric, 

    Thank you.

    Can you isolate the RTC and check the interface level during power-up.

    When the access is working, what is the level sees after completing the read.

    is the issue happening during power up or during continuous access. After the issue is observed are you able to read the RTC rate in the next attempt.

    Regards,

    Sreenivasa

  • Hi ,

    We reproduce this issue by continuous power up and power off. 

    It might power up about random time, maybe 1, 2, or more seconds and then power off for a short random time.

    And due to RTC have a capacity, we doubt RTC is not power off and maybe in a unknown state when CPU power off in this case.

    So, RTC chip cause data pin not pull up when CPU power on next time.

    For this, I think we need to come out a solution for this. 

    Do you or Ti have any suggestion?

    Thanks.

    Eric

  • Hello Eric, 

    Thank you for the inputs.

    Can you please  look for a level translator with EN controlled from the SoC side.

    Regards,

    Sreenivasa

  • Hello Eric, 

    Can you please  look for a level translator with EN controlled from the SoC side.

    Pls refer below as an examples. You could choose something similar to the below:

    https://www.ti.com/lit/ds/symlink/txs0102.pdf

    Regards,

    Sreenivasa

  • Hi ,

    We doubt this is due to i2c stuck issue.

    We have other project few years ago, and they met the similar situation.

    And they tried to control the i2c SCL and SDA as gpio and after check SCL and SDA as high, then config them for i2c use.

    So, we are trying if any solution for this.

    Hi

    We have found I2C_SYSTEST register in AM65 TRM.

    If you have any example how to use this?

    Or if we can use i2c_generic_scl_recovery in i2c-davinci.c to see if this work?

    Thanks.

    Eric

  • Hello Eric, 

    Thank you.

    Did you try testing with i2C2 or I2C3. I guess these interfaces default to GPIO.

     

    We doubt this is due to i2c stuck issue.

    We have other project few years ago, and they met the similar situation.

    And they tried to control the i2c SCL and SDA as gpio and after check SCL and SDA as high, then config them for i2c use.

    Regards,

    Sreenivasa

  • Hi ,

    Thanks.

    I have checked the GPIO we used. We have used I2C2 and I2C3 pin as normal GPIO for other function.

    The function I mentioned, it seems to set the I2C as normal GPIO and control them to fix this.

    And could you help to check if this can be used in AM65?

    int i2c_generic_scl_recovery(struct i2c_adapter *adap)
    {
    	struct i2c_bus_recovery_info *bri = adap->bus_recovery_info;
    	int i = 0, scl = 1, ret = 0;
    
    	if (bri->prepare_recovery)
    		bri->prepare_recovery(adap);
    	if (bri->pinctrl)
    		pinctrl_select_state(bri->pinctrl, bri->pins_gpio);
    
    	/*
    	 * If we can set SDA, we will always create a STOP to ensure additional
    	 * pulses will do no harm. This is achieved by letting SDA follow SCL
    	 * half a cycle later. Check the 'incomplete_write_byte' fault injector
    	 * for details. Note that we must honour tsu:sto, 4us, but lets use 5us
    	 * here for simplicity.
    	 */
    	bri->set_scl(adap, scl);
    	ndelay(RECOVERY_NDELAY);
    	if (bri->set_sda)
    		bri->set_sda(adap, scl);
    	ndelay(RECOVERY_NDELAY / 2);
    
    	/*
    	 * By this time SCL is high, as we need to give 9 falling-rising edges
    	 */
    	while (i++ < RECOVERY_CLK_CNT * 2) {
    		if (scl) {
    			/* SCL shouldn't be low here */
    			if (!bri->get_scl(adap)) {
    				dev_err(&adap->dev,
    					"SCL is stuck low, exit recovery\n");
    				ret = -EBUSY;
    				break;
    			}
    		}
    
    		scl = !scl;
    		bri->set_scl(adap, scl);
    		/* Creating STOP again, see above */
    		if (scl)  {
    			/* Honour minimum tsu:sto */
    			ndelay(RECOVERY_NDELAY);
    		} else {
    			/* Honour minimum tf and thd:dat */
    			ndelay(RECOVERY_NDELAY / 2);
    		}
    		if (bri->set_sda)
    			bri->set_sda(adap, scl);
    		ndelay(RECOVERY_NDELAY / 2);
    
    		if (scl) {
    			ret = i2c_generic_bus_free(adap);
    			if (ret == 0)
    				break;
    		}
    	}
    
    	/* If we can't check bus status, assume recovery worked */
    	if (ret == -EOPNOTSUPP)
    		ret = 0;
    
    	if (bri->unprepare_recovery)
    		bri->unprepare_recovery(adap);
    	if (bri->pinctrl)
    		pinctrl_select_state(bri->pinctrl, bri->pins_default);
    
    	return ret;
    }
    EXPORT_SYMBOL_GPL(i2c_generic_scl_recovery);


    Thanks.
    Eric
  • Hello Eric, 

    Thank you.

    And could you help to check if this can be used in AM65?

    I have notified Nick to provide his thoughts.

    I am checking internally and will update when i receive additional inputs.

    Regards,

    Sreenivasa

  • Hello Eric,

    That SCL recovery function is used in the AM65x I2C driver https://elixir.bootlin.com/linux/latest/source/drivers/i2c/busses/i2c-omap.c#L1350 when the driver experiences a bus timeout.

    What does that function actually do though? If one of the slave devices is holding the SCL bus low, then the master can send some pulses on the clock signal to hopefully get the slave device to release the SCL bus. You can find more information about that process on the web, like here: https://pebblebay.com/i2c-lock-up-prevention-and-recovery/

    If something else is happening other than "a slave device is holding the SCL bus low", then that SCL recovery function will not do anything.

    Regards,

    Nick

  • Hi ,

    I tried to fix this issue by add below patch, but this issue still existed.

    Do you  have any suggestion for this? Attached the kernel log.

    login as: root
    root@AX-564EB0MB1T:~# dmesg
    [    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
    [    0.000000] Linux version 5.2.60-rt15-yocto-preempt-rt (oe-user@oe-host) (gcc                                              version 9.2.0 (GCC)) #1 SMP PREEMPT RT Sun Dec 10 17:18:36 UTC 2023
    [    0.000000] Machine model: Texas Instruments AM654 Base Board
    [    0.000000] efi: Getting EFI parameters from FDT:
    [    0.000000] efi: UEFI not found.
    [    0.000000] Reserved memory: created DMA memory pool at 0x00000000a0000000, s                                             ize 1 MiB
    [    0.000000] OF: reserved mem: initialized node r5f-dma-memory@a0000000, compa                                             tible id shared-dma-pool
    [    0.000000] Reserved memory: created DMA memory pool at 0x00000000a0100000, s                                             ize 15 MiB
    [    0.000000] OF: reserved mem: initialized node r5f-memory@a0100000, compatibl                                             e id shared-dma-pool
    [    0.000000] Reserved memory: created DMA memory pool at 0x00000000a1000000, s                                             ize 1 MiB
    [    0.000000] OF: reserved mem: initialized node r5f-dma-memory@a1000000, compa                                             tible id shared-dma-pool
    [    0.000000] Reserved memory: created DMA memory pool at 0x00000000a1100000, s                                             ize 15 MiB
    [    0.000000] OF: reserved mem: initialized node r5f-memory@a1100000, compatibl                                             e id shared-dma-pool
    [    0.000000] On node 0 totalpages: 247296
    [    0.000000]   DMA32 zone: 4096 pages used for memmap
    [    0.000000]   DMA32 zone: 0 pages reserved
    [    0.000000]   DMA32 zone: 247296 pages, LIFO batch:63
    [    0.000000] psci: probing for conduit method from DT.
    [    0.000000] psci: PSCIv1.1 detected in firmware.
    [    0.000000] psci: Using standard PSCI v0.2 function IDs
    [    0.000000] psci: Trusted OS migration not required
    [    0.000000] psci: SMC Calling Convention v1.0
    [    0.000000] percpu: Embedded 25 pages/cpu s62400 r8192 d31808 u102400
    [    0.000000] pcpu-alloc: s62400 r8192 d31808 u102400 alloc=25*4096
    [    0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3
    [    0.000000] Detected VIPT I-cache on CPU0
    [    0.000000] CPU features: detected: GIC system register CPU interface
    [    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 243200
    [    0.000000] Kernel command line:  ostree_boot=LABEL=otaboot ostree=/ostree/1                                              ostree_root=LABEL=otaroot console=ttyS2,115200n8,115200  flux=fluxdata isolcpus=                                             1-3
    [    0.000000] Dentry cache hash table entries: 131072 (order: 9, 2097152 bytes)
    [    0.000000] Inode-cache hash table entries: 65536 (order: 7, 524288 bytes)
    [    0.000000] Memory: 937972K/989184K available (7676K kernel code, 1344K rwdat                                             a, 1888K rodata, 832K init, 345K bss, 51212K reserved, 0K cma-reserved)
    [    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
    [    0.000000] ftrace: allocating 27305 entries in 107 pages
    [    0.000000] rcu: Preemptible hierarchical RCU implementation.
    [    0.000000] rcu:     RCU restricting CPUs from NR_CPUS=256 to nr_cpu_ids=4.
    [    0.000000] rcu:     RCU priority boosting: priority 1 delay 500 ms.
    [    0.000000] rcu:     RCU_SOFTIRQ processing moved to rcuc kthreads.
    [    0.000000]  No expedited grace period (rcu_normal_after_boot).
    [    0.000000]  Tasks RCU enabled.
    [    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 100 ji                                             ffies.
    [    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
    [    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
    [    0.000000] GICv3: GIC: Using split EOI/Deactivate mode
    [    0.000000] GICv3: Distributor has no Range Selector support
    [    0.000000] GICv3: no VLPI support, no direct LPI support
    [    0.000000] GICv3: CPU0: found redistributor 0 region 0:0x0000000001880000
    [    0.000000] ITS [mem 0x01820000-0x0182ffff]
    [    0.000000] GIC: enabling workaround for ITS: Socionext Synquacer pre-ITS
    [    0.000000] ITS@0x0000000001820000: Devices Table too large, reduce ids 20->1                                             9
    [    0.000000] ITS@0x0000000001820000: allocated 524288 Devices @be000000 (flat,                                              esz 8, psz 64K, shr 0)
    [    0.000000] ITS: using cache flushing for cmd queue
    [    0.000000] GICv3: using LPI property table @0x00000000a2320000
    [    0.000000] GIC: using cache flushing for LPI property table
    [    0.000000] GICv3: CPU0: using allocated LPI pending table @0x00000000a233000                                             0
    [    0.000000] random: get_random_bytes called from start_kernel+0x318/0x498 wit                                             h crng_init=0
    [    0.000000] arch_timer: cp15 timer(s) running at 200.00MHz (phys).
    [    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles:                                              0x2e2049d3e8, max_idle_ns: 440795210634 ns
    [    0.000000] sched_clock: 56 bits at 200MHz, resolution 5ns, wraps every 43980                                             46511102ns
    [    0.000285] Console: colour dummy device 80x25
    [    0.000323] Calibrating delay loop (skipped), value calculated using timer fr                                             equency.. 400.00 BogoMIPS (lpj=200000)
    [    0.000333] pid_max: default: 32768 minimum: 301
    [    0.000469] LSM: Security Framework initializing
    [    0.000523] Mount-cache hash table entries: 2048 (order: 2, 16384 bytes)
    [    0.000535] Mountpoint-cache hash table entries: 2048 (order: 2, 16384 bytes)
    [    0.008040] ASID allocator initialised with 32768 entries
    [    0.010017] rcu: Hierarchical SRCU implementation.
    [    0.016202] Platform MSI: gic-its@1820000 domain created
    [    0.016346] EFI services will not be available.
    [    0.018105] smp: Bringing up secondary CPUs ...
    [    0.036525] Detected VIPT I-cache on CPU1
    [    0.036561] GICv3: CPU1: found redistributor 1 region 0:0x00000000018a0000
    [    0.036576] GICv3: CPU1: using allocated LPI pending table @0x00000000a234000                                             0
    [    0.036614] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
    [    0.054796] Detected VIPT I-cache on CPU2
    [    0.054840] GICv3: CPU2: found redistributor 100 region 0:0x00000000018c0000
    [    0.054857] GICv3: CPU2: using allocated LPI pending table @0x00000000a235000                                             0
    [    0.054901] CPU2: Booted secondary processor 0x0000000100 [0x410fd034]
    [    0.072821] Detected VIPT I-cache on CPU3
    [    0.072849] GICv3: CPU3: found redistributor 101 region 0:0x00000000018e0000
    [    0.072862] GICv3: CPU3: using allocated LPI pending table @0x00000000a236000                                             0
    [    0.072892] CPU3: Booted secondary processor 0x0000000101 [0x410fd034]
    [    0.073056] smp: Brought up 1 node, 4 CPUs
    [    0.073066] SMP: Total of 4 processors activated.
    [    0.073073] CPU features: detected: 32-bit EL0 Support
    [    0.073080] CPU features: detected: CRC32 instructions
    [    0.073141] CPU: All CPU(s) started at EL2
    [    0.073170] alternatives: patching kernel code
    [    0.074196] devtmpfs: initialized
    [    0.088243] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, ma                                             x_idle_ns: 1911260446275000 ns
    [    0.088269] futex hash table entries: 1024 (order: 5, 131072 bytes)
    [    0.088595] pinctrl core: initialized pinctrl subsystem
    [    0.088940] DMI not present or invalid.
    [    0.089299] NET: Registered protocol family 16
    [    0.090464] DMA: preallocated 256 KiB pool for atomic allocations
    [    0.119116] SCSI subsystem initialized
    [    0.119329] usbcore: registered new interface driver usbfs
    [    0.119383] usbcore: registered new interface driver hub
    [    0.119533] usbcore: registered new device driver usb
    [    0.120106] pps_core: LinuxPPS API ver. 1 registered
    [    0.120110] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giome                                             tti <giometti@linux.it>
    [    0.120124] PTP clock support registered
    [    0.122478] clocksource: Switched to clocksource arch_sys_counter
    [    0.223805] NET: Registered protocol family 2
    [    0.224589] tcp_listen_portaddr_hash hash table entries: 512 (order: 3, 32768                                              bytes)
    [    0.224642] TCP established hash table entries: 8192 (order: 4, 65536 bytes)
    [    0.224745] TCP bind hash table entries: 8192 (order: 6, 458752 bytes)
    [    0.225238] TCP: Hash tables configured (established 8192 bind 8192)
    [    0.225585] UDP hash table entries: 512 (order: 4, 65536 bytes)
    [    0.225687] UDP-Lite hash table entries: 512 (order: 4, 65536 bytes)
    [    0.226056] NET: Registered protocol family 1
    [    0.226352] Trying to unpack rootfs image as initramfs...
    [    1.267885] Freeing initrd memory: 17300K
    [    1.269680] Initialise system trusted keyrings
    [    1.269910] workingset: timestamp_bits=46 max_order=18 bucket_order=0
    [    1.282501] Key type asymmetric registered
    [    1.282512] Asymmetric key parser 'x509' registered
    [    1.282559] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 2                                             49)
    [    1.282565] io scheduler mq-deadline registered
    [    1.282570] io scheduler kyber registered
    [    1.285575] pinctrl-single 4301c000.pinmux: 70 pins, size 280
    [    1.286272] pinctrl-single 11c000.pinmux: 185 pins, size 740
    [    1.286676] pinctrl-single 11c2e8.pinmux: 9 pins, size 36
    [    1.289319] k3-ringacc 2b800000.ringacc: Failed to get MSI domain
    [    1.289446] k3-ringacc 3c000000.ringacc: Failed to get MSI domain
    [    1.290397] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
    [    1.304196] brd: module loaded
    [    1.307001] libphy: Fixed MDIO Bus: probed
    [    1.308025] usbcore: registered new interface driver asix
    [    1.308074] usbcore: registered new interface driver ax88179_178a
    [    1.308105] usbcore: registered new interface driver cdc_ether
    [    1.308141] usbcore: registered new interface driver net1080
    [    1.308173] usbcore: registered new interface driver cdc_subset
    [    1.308204] usbcore: registered new interface driver zaurus
    [    1.308254] usbcore: registered new interface driver cdc_ncm
    [    1.309135] usbcore: registered new interface driver usb-storage
    [    1.309243] usbcore: registered new interface driver cp210x
    [    1.309267] usbserial: USB Serial support registered for cp210x
    [    1.309384] udc-core: couldn't find an available UDC - added [g_serial] to li                                             st of pending drivers
    [    1.309390] i2c /dev entries driver
    [    1.310332] device-mapper: ioctl: 4.40.0-ioctl (2019-01-18) initialised: dm-d                                             evel@redhat.com
    [    1.312078] sdhci: Secure Digital Host Controller Interface driver
    [    1.312082] sdhci: Copyright(c) Pierre Ossman
    [    1.312705] sdhci-pltfm: SDHCI platform and OF driver helper
    [    1.313163] ti-sci bus@100000:bus@28380000:bus@42040000:dmsc: invalid resourc                                             e
    [    1.314741] u32 classifier
    [    1.314748]     Actions configured
    [    1.315535] NET: Registered protocol family 10
    [    1.317796] Segment Routing with IPv6
    [    1.317873] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
    [    1.318561] NET: Registered protocol family 17
    [    1.318717] 9pnet: Installing 9P2000 support
    [    1.319560] registered taskstats version 1
    [    1.319565] Loading compiled-in X.509 certificates
    [    1.328758] Key type encrypted registered
    [    1.332846] k3-ringacc 2b800000.ringacc: Failed to get MSI domain
    [    1.333002] k3-ringacc 3c000000.ringacc: Failed to get MSI domain
    [    1.337382] ti-sci bus@100000:bus@28380000:bus@42040000:dmsc: invalid resourc                                             e
    [    1.337884] ti-sci bus@100000:bus@28380000:bus@42040000:dmsc: ABI: 3.1 (firmw                                             are rev 0x0015 '21.1.1--v2021.01a (Terrific Lla')
    [    1.391216] random: fast init done
    [    1.397731] omap_i2c 2000000.i2c: omap_i2c_probe i2c_generic_scl_recovery
    [    1.397753]  (null): SCL is stuck low, exit recovery
    [    1.398203] omap_i2c 2000000.i2c: bus 2 rev0.12 at 100 kHz
    [    1.398795] omap_i2c 2010000.i2c: omap_i2c_probe i2c_generic_scl_recovery
    [    3.425470] omap_i2c 2010000.i2c: controller timed out
    [    3.425483] rtc-s35390a 3-0030: error resetting chip
    [    3.425975] rtc-s35390a: probe of 3-0030 failed with error -5
    [    3.425995] omap_i2c 2010000.i2c: bus 3 rev0.12 at 100 kHz
    [    3.426742] ti-sci-intr bus@100000:bus@28380000:bus@42040000:interrupt-contro                                             ller2: Interrupt Router 156 domain created
    [    3.426945] ti-sci-intr bus@100000:interrupt-controller0: Interrupt Router 10                                             0 domain created
    [    3.427141] ti-sci-intr bus@100000:navss@30800000:interrupt-controller1: Inte                                             rrupt Router 182 domain created
    [    3.427525] ti-sci-inta 33d00000.interrupt-controller: Interrupt Aggregator d                                             omain -1 created
    [    3.434686] k3-ringacc 2b800000.ringacc: Ring Accelerator probed rings:286, g                                             p-rings[96,160] sci-dev-id:195
    [    3.434700] k3-ringacc 2b800000.ringacc: dma-ring-reset-quirk: disabled
    [    3.434705] k3-ringacc 2b800000.ringacc: RA Proxy rev. 66348100, num_proxies:                                             64
    [    3.452118] k3-ringacc 3c000000.ringacc: Ring Accelerator probed rings:818, g                                             p-rings[304,464] sci-dev-id:187
    [    3.452135] k3-ringacc 3c000000.ringacc: dma-ring-reset-quirk: disabled
    [    3.452140] k3-ringacc 3c000000.ringacc: RA Proxy rev. 66348100, num_proxies:                                             64
    [    3.453086] 40a00000.serial: ttyS1 at MMIO 0x40a00000 (irq = 7, base_baud = 6                                             000000) is a 8250
    [    3.454248] 2800000.serial: ttyS2 at MMIO 0x2800000 (irq = 17, base_baud = 30                                             00000) is a 8250
    [    3.454518] printk: console [ttyS2]: printing thread started
    [    3.454532] printk: console [ttyS2] enabled
    [    3.455588] omap8250 2810000.serial: unable to register 8250 port
    [    3.455602] omap8250 2810000.serial: PM domain pd:147 will not be powered off
    [    3.456394] 2820000.serial: ttyS0 at MMIO 0x2820000 (irq = 19, base_baud = 30                                             00000) is a 8250
    [    3.470168] davinci_mdio 46000f00.mdio: Configuring MDIO in manual mode
    [    3.503470] davinci_mdio 46000f00.mdio: davinci mdio revision 9.7, bus freq 1                                             000000
    [    3.503483] libphy: 46000f00.mdio: probed
    [    3.507746] davinci_mdio 46000f00.mdio: phy[3]: device 46000f00.mdio:03, driv                                             er TI DP83822
    [    3.507798] am65-cpsw-nuss 46000000.ethernet: initializing am65 cpsw nuss ver                                             sion 0x6BA00102, cpsw version 0x6BA80102 Ports: 2 quirks:00000000
    [    3.507847] am65-cpsw-nuss 46000000.ethernet: Failed to request tx dma channe                                             l -517
    [    3.510275] am65-cpts 310d0000.cpts: CPTS ver 0x4e8a010b, freq:200000000, add                                             _val:4 pps:0
    [    3.512411] dwc3 4010000.usb: Failed to get clk 'ref': -2
    [    3.513505] g_serial gadget: Gadget Serial v2.4
    [    3.513514] g_serial gadget: g_serial ready
    [    3.521887] dwc3 4030000.usb: Failed to get clk 'ref': -2
    [    3.523333] clk: failed to reparent clk:130:1 to clk:130:5: -22
    [    3.524732] mmc0: CQHCI version 5.10
    [    3.566474] mmc0: SDHCI controller on 4f80000.sdhci [4f80000.sdhci] using ADM                                             A 64-bit
    [    3.567401] mmc1: CQHCI version 5.10
    [    3.637519] mmc0: Command Queue Engine enabled
    [    3.637535] mmc0: new HS200 MMC card at address 0001
    [    3.639305] mmcblk0: mmc0:0001 8GTF4R 7.28 GiB
    [    3.639692] mmcblk0boot0: mmc0:0001 8GTF4R partition 1 4.00 MiB
    [    3.640041] mmcblk0boot1: mmc0:0001 8GTF4R partition 2 4.00 MiB
    [    3.640371] mmcblk0rpmb: mmc0:0001 8GTF4R partition 3 512 KiB, chardev (247:0                                             )
    [    3.642994]  mmcblk0: p1 p2 < p5 p6 > p3
    [    5.078465] sdhci-am654 4fa0000.sdhci: Power on failed
    [    5.108467] mmc1: SDHCI controller on 4fa0000.sdhci [4fa0000.sdhci] using ADM                                             A 64-bit
    [    5.122977] omap-mailbox 31f80000.mailbox: omap mailbox rev 0x66fc7100
    [    5.123516] omap-mailbox 31f81000.mailbox: omap mailbox rev 0x66fc7100
    [    5.128061] ti-udma 285c0000.dma-controller: Channels: 96 (tchan: 48, rchan:                                              48, gp-rflow: 48)
    [    5.146133] ti-udma 31150000.dma-controller: Channels: 267 (tchan: 119, rchan                                             : 148, gp-rflow: 150)
    [    5.166201] 2810000.serial: ttyS3 at MMIO 0x2810000 (irq = 18, base_baud = 30                                             00000) is a 8250
    [    5.179723] davinci_mdio 46000f00.mdio: Configuring MDIO in manual mode
    [    5.213469] davinci_mdio 46000f00.mdio: davinci mdio revision 9.7, bus freq 1                                             000000
    [    5.213482] libphy: 46000f00.mdio: probed
    [    5.217875] davinci_mdio 46000f00.mdio: phy[3]: device 46000f00.mdio:03, driv                                             er TI DP83822
    [    5.217925] am65-cpsw-nuss 46000000.ethernet: initializing am65 cpsw nuss ver                                             sion 0x6BA00102, cpsw version 0x6BA80102 Ports: 2 quirks:00000000
    [    5.219186] am65-cpsw-nuss 46000000.ethernet: set new flow-id-base 48
    [    5.220009] am65-cpsw-nuss 46000000.ethernet: initialized cpsw ale version 1.                                             4
    [    5.220016] am65-cpsw-nuss 46000000.ethernet: ALE Table size 64
    [    5.221160] am65-cpsw-nuss 46000000.ethernet: CPTS ver 0x4e8a010b, freq:20000                                             0000, add_val:4 pps:0
    [    5.228653] printk: console [netcon0]: printing thread started
    [    5.228680] printk: console [netcon0] enabled
    [    5.228684] netconsole: network logging started
    [    5.228691] hctosys: unable to open rtc device (rtc0)
    [    5.248751] Freeing unused kernel memory: 832K
    [    5.248866] Run /init as init process
    [    5.832856] EXT4-fs (mmcblk0p6): recovery complete
    [    5.832892] EXT4-fs (mmcblk0p6): mounted filesystem with ordered data mode. O                                             pts: (null)
    [    5.865061] EXT4-fs (mmcblk0p5): recovery complete
    [    5.865095] EXT4-fs (mmcblk0p5): mounted filesystem with ordered data mode. O                                             pts: (null)
    [    6.102164] systemd[1]: System time before build time, advancing clock.
    [    6.113909] systemd[1]: systemd 243-51-gfab6f01+ running in system mode. (+PA                                             M -AUDIT -SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP -LIBCRYPTSETUP -GCRYPT -                                             GNUTLS +ACL +XZ -LZ4 -SECCOMP +BLKID -ELFUTILS +KMOD -IDN2 -IDN -PCRE2 default-h                                             ierarchy=hybrid)
    [    6.114560] systemd[1]: Detected architecture arm64.
    [    6.128021] systemd[1]: Set hostname to <AX-564EB0MB1T>.
    [    6.569199] systemd[1]: Unnecessary job for /dev/disk/by-label/otaboot was re                                             moved.
    [    6.569904] systemd[1]: Unnecessary job for /dev/mmcblk0p5 was removed.
    [    6.571147] random: systemd: uninitialized urandom read (16 bytes read)
    [    6.571344] systemd[1]: system-getty.slice: unit configures an IP firewall, b                                             ut the local system does not support BPF/cgroup firewalling.
    [    6.571357] systemd[1]: (This warning is only shown for the first unit using                                              IP firewalling.)
    [    6.575330] systemd[1]: Created slice system-getty.slice.
    [    6.584655] random: systemd: uninitialized urandom read (16 bytes read)
    [    6.586193] systemd[1]: Created slice system-serial\x2dgetty.slice.
    [    6.593620] random: systemd: uninitialized urandom read (16 bytes read)
    [    6.595019] systemd[1]: Created slice User and Session Slice.
    [    6.927567] fuse: init (API version 7.31)
    [    7.013899] EXT4-fs (mmcblk0p6): re-mounted. Opts: (null)
    [    8.466746] davinci_mdio b132400.mdio: Configuring MDIO in manual mode
    [    8.506519] davinci_mdio b132400.mdio: davinci mdio revision 1.7, bus freq 10                                             00000
    [    8.506545] libphy: b132400.mdio: probed
    [    8.589847] davinci_mdio b132400.mdio: phy[1]: device b132400.mdio:01, driver                                              TI DP83867
    [    8.599586] davinci_mdio b232400.mdio: Configuring MDIO in manual mode
    [    8.633493] davinci_mdio b232400.mdio: davinci mdio revision 1.7, bus freq 10                                             00000
    [    8.633517] libphy: b232400.mdio: probed
    [    8.681707] davinci_mdio b232400.mdio: phy[2]: device b232400.mdio:02, driver                                              TI DP83867
    [    8.813097] remoteproc remoteproc0: b034000.pru is available
    [    8.813228] pru-rproc b034000.pru: PRU rproc node /bus@100000/icssg@b000000/p                                             ru@34000 probed successfully
    [    8.816654] remoteproc remoteproc1: b004000.rtu is available
    [    8.816801] pru-rproc b004000.rtu: PRU rproc node /bus@100000/icssg@b000000/r                                             tu@4000 probed successfully
    [    8.819544] pru-rproc b00a000.txpru: IRQ vring not found
    [    8.819555] pru-rproc b00a000.txpru: IRQ kick not found
    [    8.819773] remoteproc remoteproc2: b00a000.txpru is available
    [    8.819876] pru-rproc b00a000.txpru: PRU rproc node /bus@100000/icssg@b000000                                             /txpru@a000 probed successfully
    [    8.824040] remoteproc remoteproc3: b038000.pru is available
    [    8.824178] pru-rproc b038000.pru: PRU rproc node /bus@100000/icssg@b000000/p                                             ru@38000 probed successfully
    [    8.830888] remoteproc remoteproc4: b006000.rtu is available
    [    8.831008] pru-rproc b006000.rtu: PRU rproc node /bus@100000/icssg@b000000/r                                             tu@6000 probed successfully
    [    8.839948] pru-rproc b00c000.txpru: IRQ vring not found
    [    8.839966] pru-rproc b00c000.txpru: IRQ kick not found
    [    8.844732] remoteproc remoteproc5: b00c000.txpru is available
    [    8.844859] pru-rproc b00c000.txpru: PRU rproc node /bus@100000/icssg@b000000                                             /txpru@c000 probed successfully
    [    8.852531] remoteproc remoteproc6: b134000.pru is available
    [    8.852695] pru-rproc b134000.pru: PRU rproc node /bus@100000/icssg@b100000/p                                             ru@34000 probed successfully
    [    8.854980] remoteproc remoteproc7: b104000.rtu is available
    [    8.855084] pru-rproc b104000.rtu: PRU rproc node /bus@100000/icssg@b100000/r                                             tu@4000 probed successfully
    [    8.863758] pru-rproc b10a000.txpru: IRQ vring not found
    [    8.863772] pru-rproc b10a000.txpru: IRQ kick not found
    [    8.863885] remoteproc remoteproc8: b10a000.txpru is available
    [    8.864021] pru-rproc b10a000.txpru: PRU rproc node /bus@100000/icssg@b100000                                             /txpru@a000 probed successfully
    [    8.871921] remoteproc remoteproc9: b138000.pru is available
    [    8.872039] pru-rproc b138000.pru: PRU rproc node /bus@100000/icssg@b100000/p                                             ru@38000 probed successfully
    [    8.874975] remoteproc remoteproc10: b106000.rtu is available
    [    8.875094] pru-rproc b106000.rtu: PRU rproc node /bus@100000/icssg@b100000/r                                             tu@6000 probed successfully
    [    8.879226] pru-rproc b10c000.txpru: IRQ vring not found
    [    8.879240] pru-rproc b10c000.txpru: IRQ kick not found
    [    8.879343] remoteproc remoteproc11: b10c000.txpru is available
    [    8.888551] pru-rproc b10c000.txpru: PRU rproc node /bus@100000/icssg@b100000                                             /txpru@c000 probed successfully
    [    8.890131] remoteproc remoteproc12: b234000.pru is available
    [    8.890239] pru-rproc b234000.pru: PRU rproc node /bus@100000/icssg@b200000/p                                             ru@34000 probed successfully
    [    8.901262] remoteproc remoteproc13: b204000.rtu is available
    [    8.901386] pru-rproc b204000.rtu: PRU rproc node /bus@100000/icssg@b200000/r                                             tu@4000 probed successfully
    [    8.915647] pru-rproc b20a000.txpru: IRQ vring not found
    [    8.915664] pru-rproc b20a000.txpru: IRQ kick not found
    [    8.915806] remoteproc remoteproc14: b20a000.txpru is available
    [    8.915947] pru-rproc b20a000.txpru: PRU rproc node /bus@100000/icssg@b200000                                             /txpru@a000 probed successfully
    [    8.917039] remoteproc remoteproc15: b238000.pru is available
    [    8.917143] pru-rproc b238000.pru: PRU rproc node /bus@100000/icssg@b200000/p                                             ru@38000 probed successfully
    [    8.926736] remoteproc remoteproc16: b206000.rtu is available
    [    8.926894] pru-rproc b206000.rtu: PRU rproc node /bus@100000/icssg@b200000/r                                             tu@6000 probed successfully
    [    8.929312] pru-rproc b20c000.txpru: IRQ vring not found
    [    8.929325] pru-rproc b20c000.txpru: IRQ kick not found
    [    8.929428] remoteproc remoteproc17: b20c000.txpru is available
    [    8.936606] pru-rproc b20c000.txpru: PRU rproc node /bus@100000/icssg@b200000                                             /txpru@c000 probed successfully
    [    9.815278] icssg-prueth pruss1_eth: port 1: using random MAC addr: 8e:26:e0:                                             66:30:ef
    [    9.830340] icssg-prueth pruss1_eth: TI PRU ethernet driver initialized: sing                                             le EMAC mode
    [    9.900732] icssg-prueth pruss2_eth: port 1: using random MAC addr: de:f2:c9:                                             1a:b6:93
    [    9.916515] icssg-prueth pruss2_eth: TI PRU ethernet driver initialized: sing                                             le EMAC mode
    [   10.024108] EXT4-fs (mmcblk0p3): recovery complete
    [   10.024869] EXT4-fs (mmcblk0p3): mounted filesystem with ordered data mode. O                                             pts: (null)
    [   10.422042] systemd-journald[233]: Received client request to flush runtime j                                             ournal.
    [   11.298771] am65-cpsw-nuss 46000000.ethernet EtherCAT: renamed from eth0
    [   11.398798] TI DP83822 46000f00.mdio:03: attached PHY driver [TI DP83822] (mi                                             i_bus:phy_addr=46000f00.mdio:03, irq=POLL)
    [   11.405724] am65-cpsw-nuss 46000000.ethernet EtherCAT: Link is Down
    [   11.466682] icssg-prueth pruss1_eth EthernetX1: renamed from eth1
    [   11.605232] remoteproc remoteproc6: powering up b134000.pru
    [   11.608514] remoteproc remoteproc6: Booting fw image ti-pruss/am65x-sr2-pru0-                                             prueth-fw.elf, size 35544
    [   11.608712] pru-rproc b134000.pru: configured system_events[159-0] = 00000000                                             ,00000000,00000000,00000000,01000000
    [   11.608722] pru-rproc b134000.pru: configured intr_channels = 0x00000001 host                                             _intr = 0x00000004
    [   11.608730] remoteproc remoteproc6: remote processor b134000.pru is now up
    [   11.608761] remoteproc remoteproc7: powering up b104000.rtu
    [   11.609439] remoteproc remoteproc7: Booting fw image ti-pruss/am65x-sr2-rtu0-                                             prueth-fw.elf, size 29080
    [   11.609494] remoteproc remoteproc7: remote processor b104000.rtu is now up
    [   11.609520] remoteproc remoteproc8: powering up b10a000.txpru
    [   11.614548] remoteproc remoteproc8: Booting fw image ti-pruss/am65x-sr2-txpru                                             0-prueth-fw.elf, size 32536
    [   11.614580] remoteproc remoteproc8: remote processor b10a000.txpru is now up
    [   11.627228] TI DP83867 b132400.mdio:01: attached PHY driver [TI DP83867] (mii                                             _bus:phy_addr=b132400.mdio:01, irq=POLL)
    [   11.627401] net EthernetX1: started
    [   11.694030] icssg-prueth pruss2_eth EthernetX2: renamed from eth2
    [   11.826591] remoteproc remoteproc12: powering up b234000.pru
    [   11.826795] remoteproc remoteproc12: Booting fw image ti-pruss/am65x-sr2-pru0                                             -prueth-fw.elf, size 35544
    [   11.826989] pru-rproc b234000.pru: configured system_events[159-0] = 00000000                                             ,00000000,00000000,00000000,01000000
    [   11.826998] pru-rproc b234000.pru: configured intr_channels = 0x00000001 host                                             _intr = 0x00000004
    [   11.827007] remoteproc remoteproc12: remote processor b234000.pru is now up
    [   11.827039] remoteproc remoteproc13: powering up b204000.rtu
    [   11.827194] remoteproc remoteproc13: Booting fw image ti-pruss/am65x-sr2-rtu0                                             -prueth-fw.elf, size 29080
    [   11.827215] remoteproc remoteproc13: remote processor b204000.rtu is now up
    [   11.827237] remoteproc remoteproc14: powering up b20a000.txpru
    [   11.827353] remoteproc remoteproc14: Booting fw image ti-pruss/am65x-sr2-txpr                                             u0-prueth-fw.elf, size 32536
    [   11.827374] remoteproc remoteproc14: remote processor b20a000.txpru is now up
    [   11.842337] TI DP83867 b232400.mdio:02: attached PHY driver [TI DP83867] (mii                                             _bus:phy_addr=b232400.mdio:02, irq=POLL)
    [   11.842529] net EthernetX2: started
    [   11.901550] random: crng init done
    [   11.901565] random: 7 urandom warning(s) missed due to ratelimiting
    [   14.690131] icssg-prueth pruss1_eth EthernetX1: Link is Up - 1Gbps/Full - flo                                             w control off
    [   14.690204] IPv6: ADDRCONF(NETDEV_CHANGE): EthernetX1: link becomes ready
    [   15.970144] icssg-prueth pruss2_eth EthernetX2: Link is Up - 1Gbps/Full - flo                                             w control off
    [   15.970217] IPv6: ADDRCONF(NETDEV_CHANGE): EthernetX2: link becomes ready
    [31832.418125] icssg-prueth pruss1_eth EthernetX1: Link is Down
    [31845.730133] icssg-prueth pruss1_eth EthernetX1: Link is Up - 100Mbps/Half - f                                             low control off
    root@AX-564EB0MB1T:~#
    

    diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
    index 8f6c81e8e083..71f556c05260 100644
    --- a/drivers/i2c/busses/i2c-omap.c
    +++ b/drivers/i2c/busses/i2c-omap.c
    @@ -1502,19 +1502,16 @@ omap_i2c_probe(struct platform_device *pdev)

    /* i2c device drivers may be active on return from add_adapter() */
    adap->nr = pdev->id;
    - r = i2c_add_numbered_adapter(adap);
    + dev_info(omap->dev, "omap_i2c_probe i2c_generic_scl_recovery\n");
    + i2c_generic_scl_recovery(adap);
    +
    + r = i2c_add_numbered_adapter(adap);

    Thanks.

    Eric

  • Hello Eric,

    I am trying to understand your usecase here:

    "We reproduce this issue by continuous power up and power off. 

    It might power up about random time, maybe 1, 2, or more seconds and then power off for a short random time.

    And due to RTC have a capacity, we doubt RTC is not power off and maybe in a unknown state when CPU power off in this case."

    Questions

    1) Is the RTC continuously powered with a separate battery supply? If yes, why are we concerned about an "unknown state"?

    2) How long is "powered off for a short random time"?

    Regards,

    Nick

  • ,

    Let me answer your questions.

    1. Yes, there is a gold capacitor connect with RTC. Just think about a scenario, when CPU power off suddenly during accessing RTC. In such case, CPU is off but RTC does not. RTC might think there is someone tried to send message to it so it keeps at some status. Thus, if CPU reboot next time, RTC probe failed will happen.

    2.The random time might during 0.x ~3 sec.

    Eric