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: Linux SPI Communication via spidev

Part Number: AM6548

Hello,

I have the AM6548IDK and would like to communicate from Linux userspace as master to a external slave devices via SPI1 Header J20. (SPI)

My plan was to use Linux kernel driver "spidev", which expose a simple SPI-interface to userspace (/dev/spidevX.X), which points to SPI1 Header (J20) on the evaulation board.

My problem: I cannot detect any signal on J20 (SPI1_CS/SPI1_CLK/SPI1MOSI) during writing on "/dev/spidev3.0". I think at some point my configuration is wrong, but I don't know where. Can you help me out please?

This is what I have done so far:

I use Processor SDK Linux 06_02_00_81 and build the linux sd-card image with yocto (arago).

1. Route SPI1_CS0 to Test Header J20 via placing resistor R317

2. Configured linux kernel ti-staging as following

Device Drivers  --->
   [*] SPI support
      <*> User mode SPI device driver support

and

Device Drivers  --->
   [*] SPI support
      [*] McSPI driver for OMAP


3. Created following Pinmux settings for SPI1 master mode Full duplex and add it to arch/arm64/boot/dts/ti/k3-am654-idk.dtso

mcspi1_pins_default: mcspi1_pins_default {
        pinctrl-single,pins = <
            AM65X_IOPAD(0x01d8, PIN_INPUT, 0) /* (AH12) SPI1_CLK */
            AM65X_IOPAD(0x01dc, PIN_INPUT, 0) /* (AE12) SPI1_D0 */
            AM65X_IOPAD(0x01e0, PIN_INPUT, 0) /* (AF12) SPI1_D1 */
            AM65X_IOPAD(0x01d0, PIN_OUTPUT, 0) /* (AD12) SPI1_CS0 */
        >;
    };

4. I changed arch/arm64/boot/dts/ti/k3-am65-main.dtsi as following to register MCSPI1 to kernel driver spidev

1513         main_spi1: spi@2110000 {
1514                 compatible = "ti,am654-mcspi","ti,omap4-mcspi";
1515                 #compatible = "linux,spidev";
1516                 reg = <0x0 0x2110000 0x0 0x400>;
1517                 interrupts = <GIC_SPI 217 IRQ_TYPE_LEVEL_HIGH>;
1518                 clocks = <&k3_clks 138 1>;
1519                 power-domains = <&k3_pds 138 TI_SCI_PD_EXCLUSIVE>;
1520                 #address-cells = <1>;
1521                 #size-cells = <0>;
1522                 assigned-clocks = <&k3_clks 137 1>;
1523                 #assigned-clock-rates = <48000000>;
1524
1525                 spidev@1 {
1526                         spi-max-frequency = <24000000>;
1527                         reg = <0>;
1528                         compatible = "rohm,dh2228fv";
1529                 };
1530         };


I suspect some problems here, because the values are just are best guesses from what I could find here in the wiki/forum.
First of all, I changed the line 1517 to <GIC_SPI 217 IRQ_TYPE_LEVEL_HIGH> since I found following in the TRM:

Is this correct?

Furthmore, lines 1525 to 1529 extend the main_spi1 devicetree-node for spidev. I set reg to 0, since I plan to use SPI1_CS0 to address my SPI slave devices.
However, I'm not sure if this devicetree-configuration is sufficient / correct?


5. Additional informations
This is the dmesg from AM6548IDK:

[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[    0.000000] Linux version 4.19.79-g77dfab56c6 (oe-user@oe-host) (gcc version 8.3.0 (GNU Toolchain for the A-profile Architecture 8.3-2019.03 (arm-rel-8.36))) #1 SMP PREEMPT Wed Jan 15 13:38:26 UTC 2020
[    0.000000] Machine model: Texas Instruments AM654 Base Board
[    0.000000] earlycon: ns16550a0 at MMIO32 0x0000000002800000 (options '')
[    0.000000] bootconsole [ns16550a0] enabled
[    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] cma: Reserved 512 MiB at 0x00000000c0000000
[    0.000000] On node 0 totalpages: 64608
[    0.000000]   DMA32 zone: 32 pages used for memmap
[    0.000000]   DMA32 zone: 0 pages reserved
[    0.000000]   DMA32 zone: 31840 pages, LIFO batch:3
[    0.000000]   Normal zone: 32 pages used for memmap
[    0.000000]   Normal zone: 32768 pages, LIFO batch:3
[    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.1
[    0.000000] random: get_random_bytes called from start_kernel+0x94/0x3e4 with crng_init=0
[    0.000000] percpu: Embedded 2 pages/cpu s48536 r8192 d74344 u131072
[    0.000000] pcpu-alloc: s48536 r8192 d74344 u131072 alloc=2*65536
[    0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3 
[    0.000000] Detected VIPT I-cache on CPU0
[    0.000000] CPU features: enabling workaround for ARM erratum 845719
[    0.000000] Speculative Store Bypass Disable mitigation not required
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 64544
[    0.000000] Kernel command line: console=ttyS2,115200n8 earlycon=ns16550a,mmio32,0x02800000 mtdparts=47040000.spi.0:512k(ospi.tiboot3),2m(ospi.tispl),4m(ospi.u-boot),128k(ospi.env),128k(ospi.env.backup),1m(ospi.sysfw),-@8m(ospi.rootfs) root=PARTUUID=f0a0db55-02 rw rootfstype=ext4 rootwait
[    0.000000] Dentry cache hash table entries: 524288 (order: 6, 4194304 bytes)
[    0.000000] Inode-cache hash table entries: 262144 (order: 5, 2097152 bytes)
[    0.000000] software IO TLB: mapped [mem 0xf9db0000-0xfddb0000] (64MB)
[    0.000000] Memory: 3518720K/4134912K available (8574K kernel code, 804K rwdata, 3136K rodata, 576K init, 640K bss, 91904K reserved, 524288K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] rcu: Preemptible hierarchical RCU implementation.
[    0.000000] rcu: 	RCU restricting CPUs from NR_CPUS=64 to nr_cpu_ids=4.
[    0.000000] 	Tasks RCU enabled.
[    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] ITS [mem 0x01820000-0x0182ffff]
[    0.000000] GIC: enabling workaround for ITS: Socionext Synquacer pre-ITS
[    0.000000] ITS@0x0000000001820000: allocated 1048576 Devices @8c0800000 (flat, esz 8, psz 64K, shr 0)
[    0.000000] ITS: using cache flushing for cmd queue
[    0.000000] GIC: using LPI property table @0x00000008c00c0000
[    0.000000] GICv3: CPU0: found redistributor 0 region 0:0x0000000001880000
[    0.000000] CPU0: using LPI pending table @0x00000008c00d0000
[    0.000000] GIC: using cache flushing for LPI property table
[    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.000006] sched_clock: 56 bits at 200MHz, resolution 5ns, wraps every 4398046511102ns
[    0.008706] Console: colour dummy device 80x25
[    0.013301] Calibrating delay loop (skipped), value calculated using timer frequency.. 400.00 BogoMIPS (lpj=800000)
[    0.023989] pid_max: default: 32768 minimum: 301
[    0.028816] Security Framework initialized
[    0.033078] Mount-cache hash table entries: 8192 (order: 0, 65536 bytes)
[    0.039958] Mountpoint-cache hash table entries: 8192 (order: 0, 65536 bytes)
[    0.071396] ASID allocator initialised with 32768 entries
[    0.084965] rcu: Hierarchical SRCU implementation.
[    0.098060] Platform MSI: gic-its@1820000 domain created
[    0.103838] PCI/MSI: /interconnect@100000/interrupt-controller@1800000/gic-its@1820000 domain created
[    0.121317] smp: Bringing up secondary CPUs ...
[    0.158441] Detected VIPT I-cache on CPU1
[    0.158480] GICv3: CPU1: found redistributor 1 region 0:0x00000000018a0000
[    0.158538] CPU1: using LPI pending table @0x00000008c0330000
[    0.158584] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
[    0.220156] Detected VIPT I-cache on CPU2
[    0.220198] GICv3: CPU2: found redistributor 100 region 0:0x00000000018c0000
[    0.220258] CPU2: using LPI pending table @0x00000008c03c0000
[    0.220309] CPU2: Booted secondary processor 0x0000000100 [0x410fd034]
[    0.252554] Detected VIPT I-cache on CPU3
[    0.252581] GICv3: CPU3: found redistributor 101 region 0:0x00000000018e0000
[    0.252637] CPU3: using LPI pending table @0x00000008c0450000
[    0.252673] CPU3: Booted secondary processor 0x0000000101 [0x410fd034]
[    0.252822] smp: Brought up 1 node, 4 CPUs
[    0.328459] SMP: Total of 4 processors activated.
[    0.333280] CPU features: detected: GIC system register CPU interface
[    0.339890] CPU features: detected: 32-bit EL0 Support
[    0.345611] CPU: All CPU(s) started at EL2
[    0.349844] alternatives: patching kernel code
[    0.355857] devtmpfs: initialized
[    0.371195] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.381200] futex hash table entries: 1024 (order: 0, 65536 bytes)
[    0.388942] pinctrl core: initialized pinctrl subsystem
[    0.395241] NET: Registered protocol family 16
[    0.401030] vdso: 2 pages (1 code @ (____ptrval____), 1 data @ (____ptrval____))
[    0.408618] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[    0.421968] DMA: preallocated 256 KiB pool for atomic allocations
[    0.450575] HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages
[    0.457466] HugeTLB registered 512 MiB page size, pre-allocated 0 pages
[    0.466245] cryptd: max_cpu_qlen set to 1000
[    0.472757] SCSI subsystem initialized
[    0.477279] media: Linux media interface: v0.10
[    0.481956] videodev: Linux video capture interface: v2.00
[    0.487612] pps_core: LinuxPPS API ver. 1 registered
[    0.492697] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.502059] PTP clock support registered
[    0.506099] EDAC MC: Ver: 3.0.0
[    0.510716] Advanced Linux Sound Architecture Driver Initialized.
[    0.517922] clocksource: Switched to clocksource arch_sys_counter
[    0.524384] VFS: Disk quotas dquot_6.6.0
[    0.528498] VFS: Dquot-cache hash table entries: 8192 (order 0, 65536 bytes)
[    0.542901] NET: Registered protocol family 2
[    0.548112] tcp_listen_portaddr_hash hash table entries: 4096 (order: 0, 65536 bytes)
[    0.556267] TCP established hash table entries: 32768 (order: 2, 262144 bytes)
[    0.563962] TCP bind hash table entries: 32768 (order: 3, 524288 bytes)
[    0.571314] TCP: Hash tables configured (established 32768 bind 32768)
[    0.578147] UDP hash table entries: 2048 (order: 0, 65536 bytes)
[    0.584426] UDP-Lite hash table entries: 2048 (order: 0, 65536 bytes)
[    0.591313] NET: Registered protocol family 1
[    0.596419] RPC: Registered named UNIX socket transport module.
[    0.602503] RPC: Registered udp transport module.
[    0.607321] RPC: Registered tcp transport module.
[    0.612143] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.618744] PCI: CLS 0 bytes, default 64
[    0.619920] hw perfevents: enabled with armv8_pmuv3 PMU driver, 7 counters available
[    0.633084] Initialise system trusted keyrings
[    0.637931] workingset: timestamp_bits=46 max_order=16 bucket_order=0
[    0.649858] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.656518] NFS: Registering the id_resolver key type
[    0.661730] Key type id_resolver registered
[    0.666017] Key type id_legacy registered
[    0.670139] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    0.677279] 9p: Installing v9fs 9p2000 file system support
[    0.688052] Key type asymmetric registered
[    0.692266] Asymmetric key parser 'x509' registered
[    0.697324] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 245)
[    0.704907] io scheduler noop registered
[    0.708931] io scheduler deadline registered
[    0.713484] io scheduler cfq registered (default)
[    0.718313] io scheduler mq-deadline registered
[    0.722954] io scheduler kyber registered
[    0.729318] pinctrl-single 4301c000.pinmux: 70 pins, size 280
[    0.735895] pinctrl-single 11c000.pinmux: 185 pins, size 740
[    0.741858] pinctrl-single 11c2e8.pinmux: 9 pins, size 36
[    0.748656] pinctrl-single a40000.timesync_router: 512 pins, size 2048
[    0.765994] Serial: 8250/16550 driver, 10 ports, IRQ sharing enabled
[    0.789226] brd: module loaded
[    0.799864] loop: module loaded
[    0.806487] libphy: Fixed MDIO Bus: probed
[    0.811248] tun: Universal TUN/TAP device driver, 1.6
[    0.817227] igbvf: Intel(R) Gigabit Virtual Function Network Driver - version 2.4.0-k
[    0.825255] igbvf: Copyright (c) 2009 - 2012 Intel Corporation.
[    0.831373] sky2: driver version 1.30
[    0.836695] VFIO - User Level meta-driver version: 0.3
[    0.842862] i2c /dev entries driver
[    0.847841] sdhci: Secure Digital Host Controller Interface driver
[    0.854179] sdhci: Copyright(c) Pierre Ossman
[    0.859201] sdhci-pltfm: SDHCI platform and OF driver helper
[    0.866366] ledtrig-cpu: registered to indicate activity on CPUs
[    0.872623] ti-sci interconnect@100000:interconnect@28380000:interconnect@42040000:dmsc: invalid resource
[    0.884292] optee: probing for conduit method from DT.
[    0.889607] optee: revision 3.7 (5208e5c1)
[    0.889898] optee: initialized driver
[    0.899344] NET: Registered protocol family 17
[    0.904062] 9pnet: Installing 9P2000 support
[    0.908493] Key type dns_resolver registered
[    0.913632] registered taskstats version 1
[    0.917833] Loading compiled-in X.509 certificates
[    0.936126] ti-sci interconnect@100000:interconnect@28380000:interconnect@42040000:dmsc: invalid resource
[    0.946140] ti-sci interconnect@100000:interconnect@28380000:interconnect@42040000:dmsc: ABI: 2.7 (firmware rev 0x0013 '19.9.0-v2019.09 (Terrific Llama')
[    0.980385] random: fast init done
[    1.416404] omap_i2c 42120000.i2c: bus 0 rev0.12 at 400 kHz
[    1.422850] omap_i2c 40b00000.i2c: bus 1 rev0.12 at 100 kHz
[    1.429368] pca953x 2-0041: 2-0041 supply vcc not found, using dummy regulator
[    1.436836] pca953x 2-0041: Linked as a consumer to regulator.0
[    1.466660] pca953x 2-0021: 2-0021 supply vcc not found, using dummy regulator
[    1.474105] pca953x 2-0021: Linked as a consumer to regulator.0
[    1.480839] omap_i2c 2000000.i2c: bus 2 rev0.12 at 400 kHz
[    1.487138] omap_i2c 2010000.i2c: bus 3 rev0.12 at 400 kHz
[    1.493468] omap_i2c 2020000.i2c: bus 4 rev0.12 at 400 kHz
[    1.499761] omap_i2c 2030000.i2c: bus 5 rev0.12 at 100 kHz
[    1.514358] keystone-pcie 5500000.pcie: Linked as a consumer to phy-900000.serdes.0
[    1.522230] keystone-pcie 5500000.pcie: Linked as a consumer to phy-910000.serdes.1
[    1.535301] keystone-pcie 5500000.pcie: host bridge /interconnect@100000/pcie@5500000 ranges:
[    1.544067] keystone-pcie 5500000.pcie:    IO 0x10020000..0x1002ffff -> 0x00000000
[    1.551836] keystone-pcie 5500000.pcie:   MEM 0x10030000..0x17ffffff -> 0x10030000
[    2.559917] keystone-pcie 5500000.pcie: Phy link never came up
[    2.566052] keystone-pcie 5500000.pcie: PCI host bridge to bus 0000:00
[    2.572748] pci_bus 0000:00: root bus resource [bus 00-ff]
[    2.578372] pci_bus 0000:00: root bus resource [io  0x0000-0xffff]
[    2.584705] pci_bus 0000:00: root bus resource [mem 0x10030000-0x17ffffff]
[    2.591777] pci 0000:00:00.0: [104c:b00c] type 01 class 0x060400
[    2.591817] pci 0000:00:00.0: reg 0x38: [mem 0x00000000-0x0000ffff pref]
[    2.591875] pci 0000:00:00.0: supports D1
[    2.591881] pci 0000:00:00.0: PME# supported from D0 D1 D3hot
[    2.600728] pci 0000:00:00.0: BAR 6: assigned [mem 0x10030000-0x1003ffff pref]
[    2.608138] pci 0000:00:00.0: PCI bridge to [bus 01-ff]
[    2.614712] k3-ringacc 2b800000.ringacc: Ring Accelerator probed rings:286, gp-rings[96,160] sci-dev-id:195
[    2.624704] k3-ringacc 2b800000.ringacc: dma-ring-reset-quirk: enabled
[    2.631395] k3-ringacc 2b800000.ringacc: RA Proxy rev. 66344100, num_proxies:64
[    2.639272] k3-ringacc 3c000000.ringacc: Ring Accelerator probed rings:818, gp-rings[304,464] sci-dev-id:187
[    2.649354] k3-ringacc 3c000000.ringacc: dma-ring-reset-quirk: enabled
[    2.656042] k3-ringacc 3c000000.ringacc: RA Proxy rev. 66344100, num_proxies:64
[    2.663855] omap8250 40a00000.serial: PM domain pd:149 will not be powered off
[    2.671591] 40a00000.serial: ttyS1 at MMIO 0x40a00000 (irq = 8, base_baud = 6000000) is a 8250
[    2.681309] 2800000.serial: ttyS2 at MMIO 0x2800000 (irq = 22, base_baud = 3000000) is a 8250
[    2.690095] console [ttyS2] enabled
[    2.697146] bootconsole [ns16550a0] disabled
[    2.706524] 2810000.serial: ttyS3 at MMIO 0x2810000 (irq = 23, base_baud = 3000000) is a 8250
[    2.715742] 2820000.serial: ttyS4 at MMIO 0x2820000 (irq = 24, base_baud = 3000000) is a 8250
[    2.727549] cadence-qspi 47040000.spi: mt35xu512aba (65536 Kbytes)
[    2.733755] 7 cmdlinepart partitions found on MTD device 47040000.spi.0
[    2.740373] Creating 7 MTD partitions on "47040000.spi.0":
[    2.745865] 0x000000000000-0x000000080000 : "ospi.tiboot3"
[    2.752212] 0x000000080000-0x000000280000 : "ospi.tispl"
[    2.758196] 0x000000280000-0x000000680000 : "ospi.u-boot"
[    2.764311] 0x000000680000-0x0000006a0000 : "ospi.env"
[    2.770101] 0x0000006a0000-0x0000006c0000 : "ospi.env.backup"
[    2.776515] 0x0000006c0000-0x0000007c0000 : "ospi.sysfw"
[    2.782483] 0x000000800000-0x000004000000 : "ospi.rootfs"
[    2.994195] cadence-qspi 47040000.spi: Cadence QSPI NOR probe failed -517
[    3.008478] am65-cpsw-nuss 46000000.ethernet: rx-flow-id-base is not set -22
[    3.015618] am65-cpsw-nuss 46000000.ethernet: initializing am65 cpsw nuss version 0x6BA07100, cpsw version 0x6BA80100 Ports: 2
[    3.027152] UDMA has not been proped
[    3.030831] am65-cpsw-nuss 46000000.ethernet: Failed to request tx dma channel -517
[    3.040848] am65-cpts 310d0000.cpts: CPTS ver 0x4e8a2109, freq:200000000, add_val:4 pps:0
[    3.049608] thermal thermal_zone1: failed to read out thermal zone (-22)
[    3.056339] thermal thermal_zone2: failed to read out thermal zone (-22)
[    3.063903] keystone-wdt 40610000.rti: heartbeat 60 sec
[    3.070164] mmc0: Unknown controller version (4). You may experience problems.
[    3.108565] mmc0: SDHCI controller on 4f80000.sdhci [4f80000.sdhci] using ADMA 64-bit
[    3.117254] mmc1: Unknown controller version (4). You may experience problems.
[    3.155655] mmc1: SDHCI controller on 4fa0000.sdhci [4fa0000.sdhci] using ADMA 64-bit
[    3.171677] mmc0: new HS200 MMC card at address 0001
[    3.177816] mmcblk0: mmc0:0001 R1J56L 14.7 GiB 
[    3.183170] mmcblk0boot0: mmc0:0001 R1J56L partition 1 8.00 MiB
[    3.190840] mmcblk0boot1: mmc0:0001 R1J56L partition 2 8.00 MiB
[    3.197170] mmcblk0rpmb: mmc0:0001 R1J56L partition 3 4.00 MiB, chardev (243:0)
[    3.207231] pca953x 0-0039: 0-0039 supply vcc not found, using dummy regulator
[    3.214527] pca953x 0-0039: Linked as a consumer to regulator.0
[    3.243708] omap-mailbox 31f80000.mailbox: omap mailbox rev 0x66fc5900
[    3.250722] omap-mailbox 31f81000.mailbox: omap mailbox rev 0x66fc5900
[    3.258275] ti-udma 285c0000.udmap: Channels: 96 (tchan: 48, echan: 0, rchan: 48, rflow: 96)
[    3.272941] ti-udma 31150000.udmap: Channels: 267 (tchan: 120, echan: 32, rchan: 150, rflow: 300)
[    3.298837] cadence-qspi 47040000.spi: mt35xu512aba (65536 Kbytes)
[    3.305037] 7 cmdlinepart partitions found on MTD device 47040000.spi.0
[    3.311660] Creating 7 MTD partitions on "47040000.spi.0":
[    3.317154] 0x000000000000-0x000000080000 : "ospi.tiboot3"
[    3.323505] 0x000000080000-0x000000280000 : "ospi.tispl"
[    3.329530] 0x000000280000-0x000000680000 : "ospi.u-boot"
[    3.335550] 0x000000680000-0x0000006a0000 : "ospi.env"
[    3.341331] 0x0000006a0000-0x0000006c0000 : "ospi.env.backup"
[    3.347736] 0x0000006c0000-0x0000007c0000 : "ospi.sysfw"
[    3.353689] 0x000000800000-0x000004000000 : "ospi.rootfs"
[    3.367346] m25p80 spi7.0: n25q128a13 (16384 Kbytes)
[    3.373764] am65-cpsw-nuss 46000000.ethernet: rx-flow-id-base is not set -22
[    3.380878] am65-cpsw-nuss 46000000.ethernet: initializing am65 cpsw nuss version 0x6BA07100, cpsw version 0x6BA80100 Ports: 2
[    3.401990] am65-cpsw-nuss 46000000.ethernet: set new flow-id-base 48
[    3.415945] pps pps0: new PPS source ptp1
[    3.420178] am65-cpsw-nuss 46000000.ethernet: CPTS ver 0x4e8a2109, freq:200000000, add_val:4 pps:1
[    3.429159] am65-cpsw-nuss 46000000.ethernet: initialized cpsw ale version 0.4
[    3.436381] am65-cpsw-nuss 46000000.ethernet: ALE Table size 64
[    3.481941] am65-cpsw-nuss 46000000.ethernet: davinci mdio revision 9.7, bus freq 1000000
[    3.490120] libphy: 46000000.ethernet: probed
[    3.498292] input: gpio-keys as /devices/platform/gpio-keys/input/input0
[    3.505270] hctosys: unable to open rtc device (rtc0)
[    3.608892] ALSA device list:
[    3.611881]   No soundcards found.
[    3.615928] Waiting for root device PARTUUID=f0a0db55-02...
[    4.357936] mmc1: Problem switching card into high-speed mode!
[    4.363922] mmc1: new SDHC card at address 0001
[    4.369611] mmcblk1: mmc1:0001 SD 29.1 GiB 
[    4.380573]  mmcblk1: p1 p2
[    9.880932] EXT4-fs (mmcblk1p2): recovery complete
[    9.890443] EXT4-fs (mmcblk1p2): mounted filesystem with ordered data mode. Opts: (null)
[    9.898602] VFS: Mounted root (ext4 filesystem) on device 179:98.
[    9.904817] devtmpfs: mounted
[    9.908076] Freeing unused kernel memory: 576K
[    9.912567] Run /sbin/init as init process
[   10.407635] systemd[1]: System time before build time, advancing clock.
[   10.560712] NET: Registered protocol family 10
[   10.566499] Segment Routing with IPv6
[   10.619290] systemd[1]: systemd 239 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)
[   10.641019] systemd[1]: Detected architecture arm64.
[   10.683236] systemd[1]: Set hostname to <am65xx-evm>.
[   10.700211] random: systemd: uninitialized urandom read (16 bytes read)
[   10.706861] systemd[1]: Initializing machine ID from random generator.
[   10.994237] systemd[1]: File /lib/systemd/system/systemd-journald.service:36 configures an IP firewall (IPAddressDeny=any), but the local system does not support BPF/cgroup based firewalling.
[   11.011293] systemd[1]: Proceeding WITHOUT firewalling in effect! (This warning is only shown for the first loaded unit using IP firewalling.)
[   11.301283] random: systemd: uninitialized urandom read (16 bytes read)
[   11.308476] systemd[1]: Listening on Journal Socket (/dev/log).
[   11.326099] random: systemd: uninitialized urandom read (16 bytes read)
[   11.347359] systemd[1]: Listening on Process Core Dump Socket.
[   11.366456] systemd[1]: Listening on udev Kernel Socket.
[   11.382083] systemd[1]: Reached target Remote File Systems.
[   11.759352] EXT4-fs (mmcblk1p2): re-mounted. Opts: (null)
[   12.000955] systemd-journald[159]: Received request to flush runtime journal from PID 1
[   15.485549] input: gpio-decoder as /devices/platform/gpio-decoder/input/input1
[   15.861573] CAN device driver interface
[   15.887412] m_can 40528000.mcan: m_can device registered (irq=17, version=32)
[   15.936022] m_can 40568000.mcan: m_can device registered (irq=19, version=32)
[   15.997415] k3_r5_rproc interconnect@100000:interconnect@28380000:r5fss@41000000: creating child devices for R5F cores
[   16.061531] platform 41000000.r5f: configured R5F for remoteproc mode
[   16.091534] platform 41000000.r5f: assigned reserved memory node r5f-dma-memory@a0000000
[   16.114694] remoteproc remoteproc0: 41000000.r5f is available
[   16.189775] remoteproc remoteproc0: powering up 41000000.r5f
[   16.195613] remoteproc remoteproc0: Booting fw image am65x-mcu-r5f0_0-fw, size 499704
[   16.211081] platform 41000000.r5f: booting R5F core using boot addr = 0x0
[   16.219183] remoteproc remoteproc0: remote processor 41000000.r5f is now up
[   16.245015] TI DP83867 k3-cpsw-mdio:00: attached PHY driver [TI DP83867] (mii_bus:phy_addr=k3-cpsw-mdio:00, irq=POLL)
[   16.263258] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   16.810066] davinci_mdio b032400.mdio: davinci mdio revision 1.7, bus freq 1000000
[   16.817798] libphy: b032400.mdio: probed
[   16.850722] davinci_mdio b032400.mdio: phy[0]: device b032400.mdio:00, driver TI DP83867
[   16.870006] davinci_mdio b032400.mdio: phy[3]: device b032400.mdio:03, driver TI DP83867
[   17.002060] davinci_mdio b132400.mdio: davinci mdio revision 1.7, bus freq 1000000
[   17.021164] libphy: b132400.mdio: probed
[   17.077691] davinci_mdio b132400.mdio: phy[0]: device b132400.mdio:00, driver TI DP83867
[   17.137416] davinci_mdio b132400.mdio: phy[3]: device b132400.mdio:03, driver TI DP83867
[   17.284448] am65-cpsw-nuss 46000000.ethernet eth0: Link is Down
[   17.299998] davinci_mdio b232400.mdio: davinci mdio revision 1.7, bus freq 1000000
[   17.310851] libphy: b232400.mdio: probed
[   17.400743] davinci_mdio b232400.mdio: phy[0]: device b232400.mdio:00, driver TI DP83867
[   17.408988] davinci_mdio b232400.mdio: phy[3]: device b232400.mdio:03, driver TI DP83867
[   17.458585] remoteproc remoteproc1: b034000.pru is available
[   17.475249] pru-rproc b034000.pru: PRU rproc node pru@b034000 probed successfully
[   17.506371] remoteproc remoteproc2: b004000.rtu is available
[   17.523467] pru-rproc b004000.rtu: PRU rproc node rtu@b004000 probed successfully
[   17.548128] remoteproc remoteproc3: b038000.pru is available
[   17.566568] pru-rproc b038000.pru: PRU rproc node pru@b038000 probed successfully
[   17.603220] remoteproc remoteproc4: b006000.rtu is available
[   17.626994] pru-rproc b006000.rtu: PRU rproc node rtu@b006000 probed successfully
[   17.645760] remoteproc remoteproc5: b134000.pru is available
[   17.656040] pru-rproc b134000.pru: PRU rproc node pru@b134000 probed successfully
[   17.669410] remoteproc remoteproc6: b104000.rtu is available
[   17.678983] pru-rproc b104000.rtu: PRU rproc node rtu@b104000 probed successfully
[   17.691866] remoteproc remoteproc7: b138000.pru is available
[   17.698851] pru-rproc b138000.pru: PRU rproc node pru@b138000 probed successfully
[   17.715040] remoteproc remoteproc8: b106000.rtu is available
[   17.722768] pru-rproc b106000.rtu: PRU rproc node rtu@b106000 probed successfully
[   17.733710] remoteproc remoteproc9: b234000.pru is available
[   17.739866] pru-rproc b234000.pru: PRU rproc node pru@b234000 probed successfully
[   17.749443] remoteproc remoteproc10: b204000.rtu is available
[   17.761266] pru-rproc b204000.rtu: PRU rproc node rtu@b204000 probed successfully
[   17.773467] remoteproc remoteproc11: b238000.pru is available
[   17.780610] pru-rproc b238000.pru: PRU rproc node pru@b238000 probed successfully
[   17.791896] remoteproc remoteproc12: b206000.rtu is available
[   17.797951] pru-rproc b206000.rtu: PRU rproc node rtu@b206000 probed successfully
[   17.830751] dwc3 4010000.usb: Failed to get clk 'ref': -2
[   17.836474] random: crng init done
[   17.839988] random: 7 urandom warning(s) missed due to ratelimiting
[   17.846834] omap_rng 4e10000.trng: Random Number Generator ver. 230b34c
[   17.875962] dwc3 4030000.usb: Failed to get clk 'ref': -2
[   17.909596] OF: graph: no port node found in /interconnect@100000/phy@4110000
[   17.977611] icssg-prueth pruss1_eth: TI PRU ethernet driver initialized: dual EMAC mode
[   18.058368] icssg-prueth pruss0_eth: TI PRU ethernet driver initialized: dual EMAC mode
[   18.126461] icssg-prueth pruss2_eth: TI PRU ethernet driver initialized: dual EMAC mode
[   18.236102] usbcore: registered new interface driver usbfs
[   18.241866] usbcore: registered new interface driver hub
[   18.247602] usbcore: registered new device driver usb
[   18.304618] remoteproc remoteproc7: powering up b138000.pru
[   18.320405] remoteproc remoteproc7: Booting fw image ti-pruss/am65x-pru1-prueth-fw.elf, size 16464
[   18.329624] remoteproc remoteproc7: remote processor b138000.pru is now up
[   18.338132] remoteproc remoteproc8: powering up b106000.rtu
[   18.347190] remoteproc remoteproc8: Booting fw image ti-pruss/am65x-rtu1-prueth-fw.elf, size 15540
[   18.352354] xhci-hcd xhci-hcd.2.auto: xHCI Host Controller
[   18.356525] remoteproc remoteproc8: remote processor b106000.rtu is now up
[   18.364693] xhci-hcd xhci-hcd.2.auto: new USB bus registered, assigned bus number 1
[   18.370155] net eth2: started
[   18.380039] xhci-hcd xhci-hcd.2.auto: hcc params 0x0298fe6d hci version 0x110 quirks 0x0000000000010010
[   18.380654] IPv6: ADDRCONF(NETDEV_UP): eth2: link is not ready
[   18.390693] xhci-hcd xhci-hcd.2.auto: irq 308, io mem 0x04010000
[   18.402301] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 4.19
[   18.410750] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[   18.418081] usb usb1: Product: xHCI Host Controller
[   18.423035] usb usb1: Manufacturer: Linux 4.19.79-g77dfab56c6 xhci-hcd
[   18.429757] usb usb1: SerialNumber: xhci-hcd.2.auto
[   18.435435] hub 1-0:1.0: USB hub found
[   18.439348] hub 1-0:1.0: 1 port detected
[   18.443912] xhci-hcd xhci-hcd.2.auto: xHCI Host Controller
[   18.449481] xhci-hcd xhci-hcd.2.auto: new USB bus registered, assigned bus number 2
[   18.457211] xhci-hcd xhci-hcd.2.auto: Host supports USB 3.0 SuperSpeed
[   18.463871] usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
[   18.472170] usb usb2: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 4.19
[   18.480485] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[   18.487845] usb usb2: Product: xHCI Host Controller
[   18.492812] usb usb2: Manufacturer: Linux 4.19.79-g77dfab56c6 xhci-hcd
[   18.499547] usb usb2: SerialNumber: xhci-hcd.2.auto
[   18.505448] hub 2-0:1.0: USB hub found
[   18.509415] hub 2-0:1.0: 1 port detected
[   18.514326] xhci-hcd xhci-hcd.3.auto: xHCI Host Controller
[   18.519914] xhci-hcd xhci-hcd.3.auto: new USB bus registered, assigned bus number 3
[   18.528479] xhci-hcd xhci-hcd.3.auto: hcc params 0x0298fe6d hci version 0x110 quirks 0x0000000000010010
[   18.538084] xhci-hcd xhci-hcd.3.auto: irq 310, io mem 0x04030000
[   18.544461] remoteproc remoteproc5: powering up b134000.pru
[   18.544541] usb usb3: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 4.19
[   18.558566] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[   18.560128] remoteproc remoteproc5: Booting fw image ti-pruss/am65x-pru0-prueth-fw.elf, size 16464
[   18.565966] usb usb3: Product: xHCI Host Controller
[   18.575348] remoteproc remoteproc5: remote processor b134000.pru is now up
[   18.580063] usb usb3: Manufacturer: Linux 4.19.79-g77dfab56c6 xhci-hcd
[   18.587005] remoteproc remoteproc6: powering up b104000.rtu
[   18.593555] usb usb3: SerialNumber: xhci-hcd.3.auto
[   18.604413] remoteproc remoteproc6: Booting fw image ti-pruss/am65x-rtu0-prueth-fw.elf, size 15540
[   18.605109] hub 3-0:1.0: USB hub found
[   18.615153] remoteproc remoteproc6: remote processor b104000.rtu is now up
[   18.619274] hub 3-0:1.0: 1 port detected
[   18.631269] net eth1: started
[   18.634672] xhci-hcd xhci-hcd.3.auto: xHCI Host Controller
[   18.638131] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
[   18.642544] xhci-hcd xhci-hcd.3.auto: new USB bus registered, assigned bus number 4
[   18.656249] xhci-hcd xhci-hcd.3.auto: Host supports USB 3.0 SuperSpeed
[   18.663242] usb usb4: We don't know the algorithms for LPM for this host, disabling LPM.
[   18.671722] usb usb4: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 4.19
[   18.680065] usb usb4: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[   18.687343] usb usb4: Product: xHCI Host Controller
[   18.692268] usb usb4: Manufacturer: Linux 4.19.79-g77dfab56c6 xhci-hcd
[   18.698844] usb usb4: SerialNumber: xhci-hcd.3.auto
[   18.704517] hub 4-0:1.0: USB hub found
[   18.708373] hub 4-0:1.0: 1 port detected
[   18.721198] remoteproc remoteproc9: powering up b234000.pru
[   18.731473] remoteproc remoteproc9: Booting fw image ti-pruss/am65x-pru0-prueth-fw.elf, size 16464
[   18.740860] remoteproc remoteproc9: remote processor b234000.pru is now up
[   18.747871] remoteproc remoteproc10: powering up b204000.rtu
[   18.754072] remoteproc remoteproc10: Booting fw image ti-pruss/am65x-rtu0-prueth-fw.elf, size 15540
[   18.763187] remoteproc remoteproc10: remote processor b204000.rtu is now up
[   18.771392] net eth5: started
[   18.775310] IPv6: ADDRCONF(NETDEV_UP): eth5: link is not ready
[   18.796507] remoteproc remoteproc11: powering up b238000.pru
[   18.802379] remoteproc remoteproc11: Booting fw image ti-pruss/am65x-pru1-prueth-fw.elf, size 16464
[   18.811514] remoteproc remoteproc11: remote processor b238000.pru is now up
[   18.818532] remoteproc remoteproc12: powering up b206000.rtu
[   18.824373] remoteproc remoteproc12: Booting fw image ti-pruss/am65x-rtu1-prueth-fw.elf, size 15540
[   18.833720] remoteproc remoteproc12: remote processor b206000.rtu is now up
[   18.842168] net eth6: started
[   18.845836] IPv6: ADDRCONF(NETDEV_UP): eth6: link is not ready
[   18.867323] remoteproc remoteproc1: powering up b034000.pru
[   18.873354] remoteproc remoteproc1: Booting fw image ti-pruss/am65x-pru0-prueth-fw.elf, size 16464
[   18.882399] remoteproc remoteproc1: remote processor b034000.pru is now up
[   18.889324] remoteproc remoteproc2: powering up b004000.rtu
[   18.895008] remoteproc remoteproc2: Booting fw image ti-pruss/am65x-rtu0-prueth-fw.elf, size 15540
[   18.904032] remoteproc remoteproc2: remote processor b004000.rtu is now up
[   18.912063] net eth3: started
[   18.915459] IPv6: ADDRCONF(NETDEV_UP): eth3: link is not ready
[   18.934224] remoteproc remoteproc3: powering up b038000.pru
[   18.940161] remoteproc remoteproc3: Booting fw image ti-pruss/am65x-pru1-prueth-fw.elf, size 16464
[   18.949202] remoteproc remoteproc3: remote processor b038000.pru is now up
[   18.956140] remoteproc remoteproc4: powering up b006000.rtu
[   18.961878] remoteproc remoteproc4: Booting fw image ti-pruss/am65x-rtu1-prueth-fw.elf, size 15540
[   18.970960] remoteproc remoteproc4: remote processor b006000.rtu is now up
[   18.979465] net eth4: started
[   18.982898] IPv6: ADDRCONF(NETDEV_UP): eth4: link is not ready
[   20.355302] am65-cpsw-nuss 46000000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
[   20.364041] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

This is how /sys/classes/spi_master looks like:

root@am65xx-evm:/sys/class/spi_master# ls -la
drwxr-xr-x    2 root     root             0 Jan 14 09:37 .
drwxr-xr-x   57 root     root             0 Jan 14 09:37 ..
lrwxrwxrwx    1 root     root             0 Jan 14 09:37 spi0 -> ../../devices/platform/interconnect@100000/interconnect@100000:interconnect@28380000/40300000.spi/spi_master/spi0
lrwxrwxrwx    1 root     root             0 Jan 14 09:37 spi1 -> ../../devices/platform/interconnect@100000/interconnect@100000:interconnect@28380000/40310000.spi/spi_master/spi1
lrwxrwxrwx    1 root     root             0 Jan 14 09:37 spi2 -> ../../devices/platform/interconnect@100000/interconnect@100000:interconnect@28380000/40320000.spi/spi_master/spi2
lrwxrwxrwx    1 root     root             0 Jan 14 09:37 spi3 -> ../../devices/platform/interconnect@100000/2110000.spi/spi_master/spi3
lrwxrwxrwx    1 root     root             0 Jan 14 09:37 spi4 -> ../../devices/platform/interconnect@100000/2120000.spi/spi_master/spi4
lrwxrwxrwx    1 root     root             0 Jan 14 09:37 spi5 -> ../../devices/platform/interconnect@100000/2130000.spi/spi_master/spi5
lrwxrwxrwx    1 root     root             0 Jan 14 09:37 spi6 -> ../../devices/platform/interconnect@100000/2140000.spi/spi_master/spi6
lrwxrwxrwx    1 root     root             0 Jan 14 09:37 spi7 -> ../../devices/platform/interconnect@100000/2100000.spi/spi_master/spi7

Same for /sys/classes/spidev:

root@am65xx-evm:/sys/class/spidev# ls -la
drwxr-xr-x    2 root     root             0 Jan 14 09:37 .
drwxr-xr-x   57 root     root             0 Jan 14 09:37 ..
lrwxrwxrwx    1 root     root             0 Jan 14 09:37 spidev3.0 -> ../../devices/platform/interconnect@100000/2110000.spi/spi_master/spi3/spi3.0/spidev/spidev3.0

For me, it seems fine. It seems spidev3.0 points to 0x2110000 which should be the correct MCSPI1 according TRM:

For writing/testing on /dev/spidev3.0 I installed spitools ( https ://github.com/cpb-/spi-tools)

Writing:
root@am65xx-evm:/sys/class/spidev# echo 1 | spi-pipe -d /dev/spidev3.0
At this point I can see no signals on J20 header!!

Reading status:
root@am65xx-evm:/sys/class/spidev# spi-config -q -d /dev/spidev3.0
/dev/spidev3.0: mode=0, lsb=0, bits=8, speed=24000000, spiready=0

Can someone help me out of here? I've read TRM, User's Guide, Processor SDK Linux, files in linux/Documentation/devicetree/bindings/spi and here in the forum.
I cannot find the missing piece it seems.

Best Regards,
Thomas

  • Thomas,

    a couple of points.

    1. Do not modify one of the included DTS files directly such as k3-am65-main.dtsi, it will make your code un-maintanable. Better, update the top-level dts file and amend the node you want to modify, main_spi1 in this case, through an &k3-am65-main.dtsi { } entry
    2. Do not add invalid properties such as '#compatible = "linux,spidev";' If this was supposed to be a comment, use C-style commenting like // or /*...*/ as per DTS syntax
    3. Looks like you are missing a reference from the main_sp1 node to the associated pinmux declaration such as
      &main_spi1 {
      	pinctrl-names = "default";
      	pinctrl-0 = <&main_spi1_pins_default>;

    4. As for the GIC SPI ("Shared Peripheral Interrupt") associations, unless I am missing something that does look like a potential issue. The AM654 reference manual has another complete overview of the SPI interrupts in Table 9-56. GIC0 SPI Interrupt Map, you can see that this matches the "MCSPI Integration" figure you found, both of which DO NOT match the DTS file. Let me follow up on this internally and report back.

    Regards, Andreas

  • Hello Andreas,

    thank you very much for you response. I picked up your suggestions and revert all my (confusing) changes on the devicetree-files (your point 1,2,3).

    Now, I put all devicetree-modifications into k3-am654-base-board-dts. This is my file now:

    // 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 = &pruss2_emac0;
    		ethernet2 = &pruss2_emac1;
    	};
    
    	chosen {
    		stdout-path = "serial2:115200n8";
    		bootargs = "earlycon=ns16550a,mmio32,0x02800000";
    	};
    
    	memory@80000000 {
    		device_type = "memory";
    		/* 4G RAM */
    		reg = <0x00000000 0x80000000 0x00000000 0x80000000>,
    		      <0x00000008 0x80000000 0x00000000 0x80000000>;
    	};
    
    	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;
    		};
    	};
    
    	gpio-keys {
    		compatible = "gpio-keys";
    		autorepeat;
    		pinctrl-names = "default";
    		pinctrl-0 = <&push_button_pins_default>;
    
    		sw5 {
    			label = "GPIO Key USER1";
    			linux,code = <BTN_0>;
    			gpios = <&wkup_gpio0 24 GPIO_ACTIVE_LOW>;
    		};
    
    		sw6 {
    			label = "GPIO Key USER2";
    			linux,code = <BTN_1>;
    			gpios = <&wkup_gpio0 27 GPIO_ACTIVE_LOW>;
    		};
    	};
    
    	/* Dual Ethernet application node on PRU-ICSSG2 */
    	pruss2_eth {
    		compatible = "ti,am654-icssg-prueth";
    		pinctrl-names = "default";
    		pinctrl-0 = <&icssg2_rgmii_pins_default>;
    		sram = <&msmc_ram>;
    		interrupt-parent = <&main_udmass_inta>;
    
    		prus = <&pru2_0>, <&rtu2_0>, <&pru2_1>, <&rtu2_1>;
    		firmware-name = "ti-pruss/am65x-pru0-prueth-fw.elf",
    				"ti-pruss/am65x-rtu0-prueth-fw.elf",
    				"ti-pruss/am65x-pru1-prueth-fw.elf",
    				"ti-pruss/am65x-rtu1-prueth-fw.elf";
    		mii-g-rt = <&icssg2_mii_g_rt>;
    		mii-rt = <&icssg2_mii_rt>;
    		dma-coherent;
    		dmas = <&main_udmap &icssg2 0 UDMA_DIR_TX>, /* egress slice 0 */
    		       <&main_udmap &icssg2 1 UDMA_DIR_TX>, /* egress slice 0 */
    		       <&main_udmap &icssg2 2 UDMA_DIR_TX>, /* egress slice 0 */
    		       <&main_udmap &icssg2 3 UDMA_DIR_TX>, /* egress slice 0 */
    		       <&main_udmap &icssg2 4 UDMA_DIR_TX>, /* egress slice 1 */
    		       <&main_udmap &icssg2 5 UDMA_DIR_TX>, /* egress slice 1 */
    		       <&main_udmap &icssg2 6 UDMA_DIR_TX>, /* egress slice 1 */
    		       <&main_udmap &icssg2 7 UDMA_DIR_TX>, /* egress slice 1 */
    
    		       <&main_udmap &icssg2 0 UDMA_DIR_RX>, /* ingress slice 0 */
    		       <&main_udmap &icssg2 1 UDMA_DIR_RX>, /* ingress slice 1 */
    		       <&main_udmap &icssg2 2 UDMA_DIR_RX>, /* mgmnt rsp slice 0 */
    		       <&main_udmap &icssg2 3 UDMA_DIR_RX>; /* 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";
    			syscon-rgmii-delay = <&scm_conf 0x4120>;
    			iep = <&icssg2_iep0>;
    			/* Filled in by bootloader */
    			local-mac-address = [00 00 00 00 00 00];
    		};
    
    		pruss2_emac1: ethernet-mii1 {
    			phy-handle = <&pruss2_eth1_phy>;
    			phy-mode = "rgmii-rxid";
    			syscon-rgmii-delay = <&scm_conf 0x4124>;
    			iep = <&icssg2_iep1>;
    			/* Filled in by bootloader */
    			local-mac-address = [00 00 00 00 00 00];
    		};
    	};
    
    };
    
    &wkup_pmx0 {
    	wkup_i2c0_pins_default: wkup-i2c0-pins-default {
    		pinctrl-single,pins = <
    			AM65X_WKUP_IOPAD(0x00e0, PIN_INPUT, 0) /* (AC7) WKUP_I2C0_SCL */
    			AM65X_WKUP_IOPAD(0x00e4, PIN_INPUT, 0) /* (AD6) WKUP_I2C0_SDA */
    		>;
    	};
    
    	push_button_pins_default: push_button__pins_default {
    		pinctrl-single,pins = <
    			AM65X_WKUP_IOPAD(0x0030, PIN_INPUT, 7) /* (R5) WKUP_GPIO0_24 */
    			AM65X_WKUP_IOPAD(0x003c, PIN_INPUT, 7) /* (P2) WKUP_GPIO0_27 */
    		>;
    	};
    
    	mcu_cpsw_pins_default: mcu_cpsw_pins_default {
    		pinctrl-single,pins = <
    			AM65X_WKUP_IOPAD(0x0058, PIN_OUTPUT, 0) /* (N4) MCU_RGMII1_TX_CTL */
    			AM65X_WKUP_IOPAD(0x005c, PIN_INPUT, 0) /* (N5) MCU_RGMII1_RX_CTL */
    			AM65X_WKUP_IOPAD(0x0060, PIN_OUTPUT, 0) /* (M2) MCU_RGMII1_TD3 */
    			AM65X_WKUP_IOPAD(0x0064, PIN_OUTPUT, 0) /* (M3) MCU_RGMII1_TD2 */
    			AM65X_WKUP_IOPAD(0x0068, PIN_OUTPUT, 0) /* (M4) MCU_RGMII1_TD1 */
    			AM65X_WKUP_IOPAD(0x006c, PIN_OUTPUT, 0) /* (M5) MCU_RGMII1_TD0 */
    			AM65X_WKUP_IOPAD(0x0078, PIN_INPUT, 0) /* (L2) MCU_RGMII1_RD3 */
    			AM65X_WKUP_IOPAD(0x007c, PIN_INPUT, 0) /* (L5) MCU_RGMII1_RD2 */
    			AM65X_WKUP_IOPAD(0x0080, PIN_INPUT, 0) /* (M6) MCU_RGMII1_RD1 */
    			AM65X_WKUP_IOPAD(0x0084, PIN_INPUT, 0) /* (L6) MCU_RGMII1_RD0 */
    			AM65X_WKUP_IOPAD(0x0070, PIN_INPUT, 0) /* (N1) MCU_RGMII1_TXC */
    			AM65X_WKUP_IOPAD(0x0074, PIN_INPUT, 0) /* (M1) MCU_RGMII1_RXC */
    		>;
    	};
    
    	mcu_mdio_pins_default: mcu_mdio1_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 */
    		>;
    	};
    
    	wkup_pca554_default: wkup_pca554_default {
    		pinctrl-single,pins = <
    			AM65X_WKUP_IOPAD(0x0034, PIN_INPUT, 7) /* (T1) MCU_OSPI1_CLK.WKUP_GPIO0_25 */
    
    		>;
    	};
    
    	mcu_fss0_ospi0_pins_default: mcu-fss0-ospi0-pins_default {
    		pinctrl-single,pins = <
    			AM65X_WKUP_IOPAD(0x0000, PIN_OUTPUT, 0) /* (V1) MCU_OSPI0_CLK */
    			AM65X_WKUP_IOPAD(0x0008, PIN_INPUT, 0)	 /* (U2) MCU_OSPI0_DQS */
    			AM65X_WKUP_IOPAD(0x000c, PIN_INPUT, 0)  /* (U4) MCU_OSPI0_D0 */
    			AM65X_WKUP_IOPAD(0x0010, PIN_INPUT, 0)  /* (U5) MCU_OSPI0_D1 */
    			AM65X_WKUP_IOPAD(0x0014, PIN_INPUT, 0)  /* (T2) MCU_OSPI0_D2 */
    			AM65X_WKUP_IOPAD(0x0018, PIN_INPUT, 0)  /* (T3) MCU_OSPI0_D3 */
    			AM65X_WKUP_IOPAD(0x001c, PIN_INPUT, 0)  /* (T4) MCU_OSPI0_D4 */
    			AM65X_WKUP_IOPAD(0x0020, PIN_INPUT, 0)  /* (T5) MCU_OSPI0_D5 */
    			AM65X_WKUP_IOPAD(0x0024, PIN_INPUT, 0)  /* (R2) MCU_OSPI0_D6 */
    			AM65X_WKUP_IOPAD(0x0028, PIN_INPUT, 0)  /* (R3) MCU_OSPI0_D7 */
    			AM65X_WKUP_IOPAD(0x002c, PIN_OUTPUT, 0) /* (R4) MCU_OSPI0_CSn0 */
    		>;
    	};
    };
    
    &main_pmx0 {
    	main_uart0_pins_default: main-uart0-pins-default {
    		pinctrl-single,pins = <
    			AM65X_IOPAD(0x01e4, PIN_INPUT, 0)	/* (AF11) UART0_RXD */
    			AM65X_IOPAD(0x01e8, PIN_OUTPUT, 0)	/* (AE11) UART0_TXD */
    			AM65X_IOPAD(0x01ec, PIN_INPUT, 0)	/* (AG11) UART0_CTSn */
    			AM65X_IOPAD(0x01f0, PIN_OUTPUT, 0)	/* (AD11) UART0_RTSn */
    		>;
    	};
    
    	main_i2c2_pins_default: main-i2c2-pins-default {
    		pinctrl-single,pins = <
    			AM65X_IOPAD(0x0074, PIN_INPUT, 5) /* (T27) GPMC0_CSn3.I2C2_SCL */
    			AM65X_IOPAD(0x0070, PIN_INPUT, 5) /* (R25) GPMC0_CSn2.I2C2_SDA */
    		>;
    	};
    
    	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(0x01b4, PIN_INPUT_PULLUP, 0) /* (A23) MMC0_SDCD */
    			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 */
    		>;
    	};
    
    	usb1_pins_default: usb1_pins_default {
    		pinctrl-single,pins = <
    			AM65X_IOPAD(0x02c0, PIN_OUTPUT, 0) /* (AC8) USB1_DRVVBUS */
    		>;
    	};
    
    	main_spi0_pins_default: main-spi0-pins-default {
    		pinctrl-single,pins = <
    			AM65X_IOPAD(0x01c4, PIN_INPUT, 0) /* (AH13) SPI0_CLK */
    			AM65X_IOPAD(0x01c8, PIN_INPUT, 0) /* (AE13) SPI0_D0 */
    			AM65X_IOPAD(0x01cc, PIN_INPUT, 0) /* (AD13) SPI0_D1 */
    			AM65X_IOPAD(0x01bc, PIN_OUTPUT, 0) /* (AG13) SPI0_CS0 */
    		>;
    	};
    
    	mcspi1_pins_default: mcspi1_pins_default {
    	pinctrl-single,pins = <
                AM65X_IOPAD(0x01d8, PIN_INPUT_PULLUP, 0) /* (AH12) SPI1_CLK */
                AM65X_IOPAD(0x01dc, PIN_OUTPUT_PULLUP, 0) /* (AE12) SPI1_D0 */
                AM65X_IOPAD(0x01e0, PIN_INPUT_PULLUP, 0) /* (AF12) SPI1_D1 */
                AM65X_IOPAD(0x01d0, PIN_OUTPUT_PULLUP, 0) /* (AD12) SPI1_CS0 */
             >;
    	};
    
    
    
    	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 */
    		>;
    	};
    
    	icssg2_rgmii_pins_default: icssg2_rgmii_pins_default {
    		pinctrl-single,pins = <
    			AM65X_IOPAD(0x00ac, PIN_INPUT, 2) /* (AH15) PRG2_PRU1_GPO0.PRG2_RGMII2_RD0 */
    			AM65X_IOPAD(0x00b0, PIN_INPUT, 2) /* (AC16) PRG2_PRU1_GPO1.PRG2_RGMII2_RD1 */
    			AM65X_IOPAD(0x00b4, PIN_INPUT, 2) /* (AD17) PRG2_PRU1_GPO2.PRG2_RGMII2_RD2 */
    			AM65X_IOPAD(0x00b8, PIN_INPUT, 2) /* (AH14) PRG2_PRU1_GPO3.PRG2_RGMII2_RD3 */
    			AM65X_IOPAD(0x00cc, PIN_OUTPUT, 2) /* (AD15) PRG2_PRU1_GPO8.PRG2_RGMII2_TD0 */
    			AM65X_IOPAD(0x00d0, PIN_OUTPUT, 2) /* (AF14) PRG2_PRU1_GPO9.PRG2_RGMII2_TD1 */
    			AM65X_IOPAD(0x00d4, PIN_OUTPUT, 2) /* (AC15) PRG2_PRU1_GPO10.PRG2_RGMII2_TD2 */
    			AM65X_IOPAD(0x00d8, PIN_OUTPUT, 2) /* (AD14) PRG2_PRU1_GPO11.PRG2_RGMII2_TD3 */
    			AM65X_IOPAD(0x00dc, PIN_INPUT, 2) /* (AE14) PRG2_PRU1_GPO16.PRG2_RGMII2_TXC */
    			AM65X_IOPAD(0x00c4, PIN_OUTPUT, 2) /* (AC17) PRG2_PRU1_GPO6.PRG2_RGMII2_TX_CTL */
    			AM65X_IOPAD(0x00c0, PIN_INPUT, 2) /* (AG15) PRG2_PRU1_GPO5.PRG2_RGMII2_RXC */
    			AM65X_IOPAD(0x00bc, PIN_INPUT, 2) /* (AG14) PRG2_PRU1_GPO4.PRG2_RGMII2_RX_CTL */
    
    			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_pmx1 {
    	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, 0) /* (B21) I2C1_SCL */
    			AM65X_IOPAD(0x000c, PIN_INPUT, 0) /* (E21) I2C1_SDA */
    		>;
    	};
    
    	ecap0_pins_default: ecap0-pins-default {
    		pinctrl-single,pins = <
    			AM65X_IOPAD(0x0010, PIN_INPUT, 0) /* (D21) ECAP0_IN_APWM_OUT */
    		>;
    	};
    };
    
    &wkup_uart0 {
    	/* Wakeup UART is used by System firmware */
    	status = "disabled";
    };
    
    &main_uart0 {
    	pinctrl-names = "default";
    	pinctrl-0 = <&main_uart0_pins_default>;
    };
    
    &wkup_i2c0 {
    	pinctrl-names = "default";
    	pinctrl-0 = <&wkup_i2c0_pins_default>;
    	clock-frequency = <400000>;
    
    	pca9554: gpio@39 {
    		compatible = "nxp,pca9554";
    		reg = <0x39>;
    		gpio-controller;
    		#gpio-cells = <2>;
    		pinctrl-names = "default";
    		pinctrl-0 = <&wkup_pca554_default>;
    		interrupt-parent = <&wkup_gpio0>;
    		interrupts = <25 IRQ_TYPE_EDGE_FALLING>;
    		interrupt-controller;
    		#interrupt-cells = <2>;
    	};
    };
    
    &main_i2c0 {
    	pinctrl-names = "default";
    	pinctrl-0 = <&main_i2c0_pins_default>;
    	clock-frequency = <400000>;
    
    	pca9555: gpio@21 {
    		compatible = "nxp,pca9555";
    		reg = <0x21>;
    		gpio-controller;
    		#gpio-cells = <2>;
    	};
    };
    
    &main_i2c1 {
    	pinctrl-names = "default";
    	pinctrl-0 = <&main_i2c1_pins_default>;
    	clock-frequency = <400000>;
    };
    
    &main_i2c2 {
    	pinctrl-names = "default";
    	pinctrl-0 = <&main_i2c2_pins_default>;
    	clock-frequency = <400000>;
    };
    
    &mcu_cpsw {
    	pinctrl-names = "default";
    	pinctrl-0 = <&mcu_cpsw_pins_default &mcu_mdio_pins_default>;
    
    	cpts {
    		ti,pps = <3 1>;
    	};
    };
    
    &davinci_mdio {
    	phy0: ethernet-phy@0 {
    		reg = <0>;
    		/* TODO: phy reset: TCA9555RTWR(i2c:0x21)[p04].GPIO_MCU_RGMII_RSTN */
    		ti,rx-internal-delay = <DP83867_RGMIIDCTL_2_00_NS>;
    		ti,fifo-depth = <DP83867_PHYCR_FIFO_DEPTH_4_B_NIB>;
    	};
    };
    
    &cpsw_port1 {
    	phy-mode = "rgmii-rxid";
    	phy-handle = <&phy0>;
    };
    
    &ecap0 {
    	pinctrl-names = "default";
    	pinctrl-0 = <&ecap0_pins_default>;
    };
    
    &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;
    };
    
    &gpu {
    	status = "okay";
    };
    
    &dwc3_1 {
    	status = "okay";
    };
    
    &usb1_phy {
    	status = "okay";
    };
    
    &usb1 {
    	pinctrl-names = "default";
    	pinctrl-0 = <&usb1_pins_default>;
    	dr_mode = "otg";
    };
    
    &dwc3_0 {
    	status = "disabled";
    };
    
    &usb0_phy {
    	status = "disabled";
    };
    
    &main_spi0 {
    	pinctrl-names = "default";
    	pinctrl-0 = <&main_spi0_pins_default>;
    	#address-cells = <1>;
    	#size-cells= <0>;
    	ti,pindir-d0-out-d1-in = <1>;
    
    	flash@0{
    		compatible = "jedec,spi-nor";
    		reg = <0x0>;
    		spi-tx-bus-width = <1>;
    		spi-rx-bus-width = <1>;
    		spi-max-frequency = <48000000>;
    		#address-cells = <1>;
    		#size-cells= <1>;
    	};
    };
    
    &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>;
    	};
    };
    
    &mcu_r5fss0_core0 {
    	memory-region = <&mcu_r5fss0_core0_dma_memory_region>,
    			<&mcu_r5fss0_core0_memory_region>;
    };
    
    &mcu_r5fss0_core1 {
    	memory-region = <&mcu_r5fss0_core1_dma_memory_region>,
    			<&mcu_r5fss0_core1_memory_region>;
    };
    
    &ospi0 {
    	pinctrl-names = "default";
    	pinctrl-0 = <&mcu_fss0_ospi0_pins_default>;
    
    	flash@0{
    		compatible = "jedec,spi-nor";
    		reg = <0x0>;
    		spi-tx-bus-width = <8>;
    		spi-rx-bus-width = <8>;
    		spi-max-frequency = <50000000>;
    		spi-dqs;
    		cdns,tshsl-ns = <60>;
    		cdns,tsd2d-ns = <60>;
    		cdns,tchsh-ns = <60>;
    		cdns,tslch-ns = <60>;
    		cdns,read-delay = <2>;
    		cdns,phy-mode;
    		#address-cells = <1>;
    		#size-cells = <1>;
    	};
    };
    
    &icssg2_mdio {
    	status = "okay";
    	pinctrl-names = "default";
    	pinctrl-0 = <&icssg2_mdio_pins_default>;
    
    	pruss2_eth0_phy: ethernet-phy@0 {
    		reg = <0>;
    		ti,rx-internal-delay = <DP83867_RGMIIDCTL_2_00_NS>;
    		ti,fifo-depth = <DP83867_PHYCR_FIFO_DEPTH_4_B_NIB>;
    	};
    
    	pruss2_eth1_phy: ethernet-phy@3 {
    		reg = <3>;
    		ti,rx-internal-delay = <DP83867_RGMIIDCTL_2_00_NS>;
    		ti,fifo-depth = <DP83867_PHYCR_FIFO_DEPTH_4_B_NIB>;
    	};
    };
    
    #define TS_OFFSET(pa, val)     (0x4+(pa)*4) (0x80000000 | val)
    
    &timesync_router {
    	pinctrl-names = "default";
    	pinctrl-0 = <&mcu_cpts>;
    
    	/* Example of the timesync routing */
    	mcu_cpts: mcu_cpts {
    		pinctrl-single,pins = <
    			/* pps [cpts genf1] in13 -> out25 [cpts hw4_push] */
    			TS_OFFSET(25, 13)
    		>;
    	};
    };
    
    
    &main_spi1 {
    	status = "okay";
    	pinctrl-names ="default";
    	pinctrl-0 = <&mcspi1_pins_default>;
    
    	spidev@0 {
    		status = "okay";
    		spi-max-frequency = <24000000>;
    		reg = <0>;
    		compatible = "rohm,dh2228fv";
    	};
    
    
    };
    

    Now some good and bad news:
    Good: I've got a spi interface /dev/spidev3.0. When I write data on it (for example "echo DEADBEEF > /dev/spidev3.0"), I've got CS and CLK signals on J20 (which looks reasonable). CLK signal is around 24 MHz.

    Ch2 is CS
    Ch3 is CLK
    Ch4 is MOSI

    Bad news: I've got no signal at data line (MOSI). I'm not sure why??

  • Interesting: SPI1_D1 is configured as MOSI and there I got my output data.
    I found this on e2e-thread:

    Adding "ti,pindir-d0-out-d1-in = <1>;" to the main_spi1 node fixes that problem.

    I doubled checked that bit "IS" of MCSPI_CHCONF_1 Register is set, and it is!

    Problem solved, thank you very much. Maybe this will help other community members to enable SPI(dev) on Sitara platform.

  • Hi Thomas,

    Thomas Dorsch said:
    Adding "ti,pindir-d0-out-d1-in = <1>;" to the main_spi1 node fixes that problem.

    I doubled checked that bit "IS" of MCSPI_CHCONF_1 Register is set, and it is!

    Thanks for closing the loop here, much appreciated.

    Also as for the earlier discussion related to GIC shared peripheral interrupt offsets (SPI) in the device tree file, the way they were defined in the DTS tree was actually correct, so no need to change that. If you observe carefully there is an offset of 32 between as how the SPIs are defined in the DTS file, and the way they are described in the device data manual (TRM) for the different peripherals/

    This discrepancy can be explained with the fact that SPI events represent events 32-991 of each A53 core, and the Kernel GIC driver (irq-gic-v3.c) automatically and implicitly adds this offset of 32. So it needs to be left out when defining GIC SPI interrupt offset via dts.

    Regards, Andreas

  • Hi Andreas,

    thank you for the additional information!

    Best regrads,
    Thomas