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.

AM4372: spi0 is not working in linux 5.10

Part Number: AM4372

hi all

in our custom board based on am4372, we have a spi0 interface to rtc.  in uboot 2022.01 which I ported spi0 interface is working fine . but in linux is was not working. why diagnosing I found the PRCM_CLKCTRL the value is 00300000. that means it is disabled.

why it is so?

I have made the status=okay for spi0 in dts.

there is absolutely no problem with pinmux or hardware as it tested on uboot

also I have notices while booting for some module ti,sysc probe fails with error -16.

I think both are related issue.

can anybody throw light on this?

  • Hi Supriyo,

    Can you please attach the full Linux boot log?

  • => md 0x44df8d00 1
    44df8d00: 00000002 ...

    .
    => run netboot
    link up on port 0, speed 100, full duplex
    Using ethernet@4a100000 device
    TFTP from server 192.168.100.1; our IP address is 192.168.100.19
    Filename 'uImage'.
    Load address: 0x82000000
    Loading: ################################################## 5.8 MiB
    2 MiB/s
    done
    Bytes transferred = 6040320 (5c2b00 hex)
    link up on port 0, speed 100, full duplex
    Using ethernet@4a100000 device
    TFTP from server 192.168.100.1; our IP address is 192.168.100.19
    Filename 'rootfs.cpio.uboot'.
    Load address: 0x84000000
    Loading: ################################################## 4 MiB
    2 MiB/s
    done
    Bytes transferred = 4234652 (409d9c hex)
    link up on port 0, speed 100, full duplex
    Using ethernet@4a100000 device
    TFTP from server 192.168.100.1; our IP address is 192.168.100.19
    Filename 'am437x-ecrtu100.dtb'.
    Load address: 0x87000000
    Loading: ################################################## 67.4 KiB
    2 MiB/s
    done
    Bytes transferred = 69012 (10d94 hex)
    ## Booting kernel from Legacy Image at 82000000 ...
    Image Name: Linux-5.10.131-rt72
    Image Type: ARM Linux Kernel Image (uncompressed)
    Data Size: 6040256 Bytes = 5.8 MiB
    Load Address: 82000000
    Entry Point: 82000000
    Verifying Checksum ... OK
    ## Loading init Ramdisk from Legacy Image at 84000000 ...
    Image Name:
    Image Type: ARM Linux RAMDisk Image (uncompressed)
    Data Size: 4234588 Bytes = 4 MiB
    Load Address: 00000000
    Entry Point: 00000000
    Verifying Checksum ... OK
    ## Flattened Device Tree blob at 87000000
    Booting using the fdt blob at 0x87000000
    Loading Kernel Image
    Loading Ramdisk to 8db17000, end 8df20d5c ... OK
    Loading Device Tree to 8db03000, end 8db16d93 ... OK

    Starting kernel ...

    [ 0.000000] Booting Linux on physical CPU 0x0
    [ 0.000000] Linux version 5.10.131-rt72 (linuxplc@localhost.localdomain) (arm-linux-gnueabihf-gcc (Linaro GCC 7.3-2018.05) 7.3.1 20180425 [linaro-7.3-2018.05 revision d29120a424ecfbc167ef90065c0eeb7f91977701], GNU ld (Linaro_Binutils-2018.05) 2.28.2.20170706) #137 SMP Wed Jan 25 17:50:37 IST 2023
    [ 0.000000] CPU: ARMv7 Processor [412fc09a] revision 10 (ARMv7), cr=10c5387d
    [ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
    [ 0.000000] OF: fdt: Machine model: ECRT100
    [ 0.000000] Memory policy: Data cache writeback
    [ 0.000000] cma: Reserved 16 MiB at 0x8f000000
    [ 0.000000] Zone ranges:
    [ 0.000000] Normal [mem 0x0000000080000000-0x000000008fffffff]
    [ 0.000000] HighMem empty
    [ 0.000000] Movable zone start for each node
    [ 0.000000] Early memory node ranges
    [ 0.000000] node 0: [mem 0x0000000080000000-0x000000008fffffff]
    [ 0.000000] Initmem setup node 0 [mem 0x0000000080000000-0x000000008fffffff]
    [ 0.000000] CPU: All CPU(s) started in SVC mode.
    [ 0.000000] AM437x ES1.2 (neon)
    [ 0.000000] percpu: Embedded 16 pages/cpu s33420 r8192 d23924 u65536
    [ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 64960
    [ 0.000000] Kernel command line: console=ttyS0,115200n8 root=/dev/ram0 rw uio_pdrv_genirq.of_id=generic-uio
    [ 0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes, linear)
    [ 0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes, linear)
    [ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
    [ 0.000000] Memory: 224124K/262144K available (9216K kernel code, 1034K rwdata, 2100K rodata, 1024K init, 272K bss, 21636K reserved, 16384K cma-reserved, 0K highmem)
    [ 0.000000] rcu: Hierarchical RCU implementation.
    [ 0.000000] rcu: RCU event tracing is enabled.
    [ 0.000000] rcu: RCU restricting CPUs from NR_CPUS=2 to nr_cpu_ids=1.
    [ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
    [ 0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
    [ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
    [ 0.000000] L2C: platform modifies aux control register: 0x0e030000 -> 0x3e430000
    [ 0.000000] L2C: DT/platform modifies aux control register: 0x0e030000 -> 0x3e430000
    [ 0.000000] L2C-310 enabling early BRESP for Cortex-A9
    [ 0.000000] OMAP L2C310: ROM does not support power control setting
    [ 0.000000] L2C-310 dynamic clock gating disabled, standby mode disabled
    [ 0.000000] L2C-310 cache controller enabled, 16 ways, 256 kB
    [ 0.000000] L2C-310: CACHE_ID 0x410000c9, AUX_CTRL 0x4e430000
    [ 0.000000] TI gptimer clocksource: always-on /ocp@44000000/interconnect@44c00000/segment@200000/target-module@31000
    [ 0.000002] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
    [ 0.000034] clocksource: dmtimer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
    [ 0.000213] OMAP clocksource: 32k_counter at 32768 Hz
    [ 0.000224] clocksource: 32k_counter: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 58327039986419 ns
    [ 0.000626] TI gptimer clockevent: 24000000 Hz at /ocp@44000000/interconnect@48000000/segment@0/target-module@40000
    [ 0.002768] Console: colour dummy device 80x30
    [ 0.002895] Calibrating delay loop... 1594.16 BogoMIPS (lpj=7970816)
    [ 0.077202] pid_max: default: 32768 minimum: 301
    [ 0.077441] LSM: Security Framework initializing
    [ 0.077607] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
    [ 0.077646] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
    [ 0.079578] CPU: Testing write buffer coherency: ok
    [ 0.079734] CPU0: Spectre v2: using BPIALL workaround
    [ 0.080533] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
    [ 0.082294] Setting up static identity map for 0x80100000 - 0x80100078
    [ 0.082684] rcu: Hierarchical SRCU implementation.
    [ 0.083703] smp: Bringing up secondary CPUs ...
    [ 0.083716] smp: Brought up 1 node, 1 CPU
    [ 0.083728] SMP: Total of 1 processors activated (1594.16 BogoMIPS).
    [ 0.083744] CPU: All CPU(s) started in SVC mode.
    [ 0.084945] devtmpfs: initialized
    [ 0.103893] VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
    [ 0.104588] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
    [ 0.104644] futex hash table entries: 256 (order: 2, 16384 bytes, linear)
    [ 0.107120] pinctrl core: initialized pinctrl subsystem
    [ 0.110854] NET: Registered protocol family 16
    [ 0.115593] DMA: preallocated 256 KiB pool for atomic coherent allocations
    [ 0.127036] audit: initializing netlink subsys (disabled)
    [ 0.129411] thermal_sys: Registered thermal governor 'fair_share'
    [ 0.129436] thermal_sys: Registered thermal governor 'step_wise'
    [ 0.129443] thermal_sys: Registered thermal governor 'user_space'
    [ 0.130099] cpuidle: using governor menu
    [ 0.846886] audit: type=2000 audit(0.130:1): state=initialized audit_enabled=0 res=1
    [ 0.858293] No ATAGs?
    [ 0.858471] hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.
    [ 0.858487] hw-breakpoint: maximum watchpoint size is 4 bytes.
    [ 0.880824] Kprobes globally optimized
    [ 0.895660] iommu: Default domain type: Translated
    [ 0.899188] SCSI subsystem initialized
    [ 0.901497] pps_core: LinuxPPS API ver. 1 registered
    [ 0.901512] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
    [ 0.901554] PTP clock support registered
    [ 0.903701] clocksource: Switched to clocksource dmtimer
    [ 1.701553] VFS: Disk quotas dquot_6.6.0
    [ 1.701744] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
    [ 1.716264] NET: Registered protocol family 2
    [ 1.716852] IP idents hash table entries: 4096 (order: 3, 32768 bytes, linear)
    [ 1.718311] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
    [ 1.718428] TCP established hash table entries: 2048 (order: 1, 8192 bytes, linear)
    [ 1.718487] TCP bind hash table entries: 2048 (order: 2, 16384 bytes, linear)
    [ 1.718576] TCP: Hash tables configured (established 2048 bind 2048)
    [ 1.718926] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
    [ 1.719006] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
    [ 1.719389] NET: Registered protocol family 1
    [ 1.721398] RPC: Registered named UNIX socket transport module.
    [ 1.721424] RPC: Registered udp transport module.
    [ 1.721430] RPC: Registered tcp transport module.
    [ 1.721435] RPC: Registered tcp NFSv4.1 backchannel transport module.
    [ 1.722610] Trying to unpack rootfs image as initramfs...
    [ 2.152285] Freeing initrd memory: 4136K
    [ 2.155999] Initialise system trusted keyrings
    [ 2.157080] workingset: timestamp_bits=14 max_order=16 bucket_order=2
    [ 2.159411] NFS: Registering the id_resolver key type
    [ 2.159520] Key type id_resolver registered
    [ 2.159528] Key type id_legacy registered
    [ 2.159626] jffs2: version 2.2. (NAND) (SUMMARY) © 2001-2006 Red Hat, Inc.
    [ 2.160269] Key type asymmetric registered
    [ 2.160287] Asymmetric key parser 'x509' registered
    [ 2.160315] io scheduler mq-deadline registered
    [ 2.160325] io scheduler kyber registered
    [ 2.287107] OMAP GPIO hardware version 0.1
    [ 2.380323] ti-sysc: probe of 44e31000.target-module failed with error -16
    [ 2.394418] l4-rtc-clkctrl:0000:0: failed to enable
    [ 2.394673] ti-sysc: probe of 44e3e074.target-module failed with error -16
    [ 2.428721] ti-sysc: probe of 48040000.target-module failed with error -16
    [ 2.533285] debugfs: Directory '49000000.dma' with parent 'dmaengine' already present!
    [ 2.533344] edma 49000000.dma: TI EDMA DMA engine driver
    [ 2.550159] pinctrl-single 44e10800.pinmux: 199 pins, size 796
    [ 2.557056] Serial: 8250/16550 driver, 6 ports, IRQ sharing enabled
    [ 2.562061] omap8250 44e09000.serial: No clock speed specified: using default: 48000000
    [ 2.563105] printk: console [ttyS0] disabled
    [ 2.563365] 44e09000.serial: ttyS0 at MMIO 0x44e09000 (irq = 65, base_baud = 3000000) is a 8250
    [ 2.563513] printk: console [ttyS0] enabled
    [ 2.565558] omap8250 48022000.serial: No clock speed specified: using default: 48000000
    [ 2.566844] 48022000.serial: ttyS1 at MMIO 0x48022000 (irq = 69, base_baud = 3000000) is a 8250
    [ 2.568271] omap8250 481a6000.serial: No clock speed specified: using default: 48000000
    [ 2.569469] 481a6000.serial: ttyS3 at MMIO 0x481a6000 (irq = 73, base_baud = 3000000) is a 8250
    [ 2.597745] brd: module loaded
    [ 2.619419] loop: module loaded
    [ 2.622755] mtdoops: mtd device (mtddev=name/number) must be supplied
    [ 2.693786] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6, bus freq 1000000
    [ 2.722703] davinci_mdio 4a101000.mdio: phy[2]: device 4a101000.mdio:02, driver Microsemi GE VSC8502 SyncE
    [ 2.722728] davinci_mdio 4a101000.mdio: phy[3]: device 4a101000.mdio:03, driver Microsemi GE VSC8502 SyncE
    [ 2.724768] cpsw-switch 4a100000.switch: initialized cpsw ale version 1.4
    [ 2.724798] cpsw-switch 4a100000.switch: ALE Table size 1024
    [ 2.725562] cpsw-switch 4a100000.switch: cpts: overflow check period 500 (jiffies)
    [ 2.725594] cpsw-switch 4a100000.switch: CPTS: ref_clk_freq:250000000 calc_mult:2147483648 calc_shift:29 error:0 nsec/sec
    [ 2.725762] cpsw-switch 4a100000.switch: Detected MACID = 48:70:1e:d7:6c:bf
    [ 2.725860] cpsw-switch 4a100000.switch: Detected MACID = 48:70:1e:d7:6c:c1
    [ 2.729248] cpsw-switch 4a100000.switch: initialized (regs 0x4a100000, pool size 256) hw_ver:0019010F 1.15 (0)
    [ 2.729937] i2c /dev entries driver
    [ 2.732992] cpuidle: enable-method property 'ti,am4372' found operations
    [ 2.734745] sdhci: Secure Digital Host Controller Interface driver
    [ 2.734764] sdhci: Copyright(c) Pierre Ossman
    [ 2.735733] sdhci-pltfm: SDHCI platform and OF driver helper
    [ 2.738095] sdhci-omap 48060000.mmc: supply vqmmc not found, using dummy regulator
    [ 2.741078] ledtrig-cpu: registered to indicate activity on CPUs
    [ 2.743145] Initializing XFRM netlink socket
    [ 2.743457] NET: Registered protocol family 10
    [ 2.746390] Segment Routing with IPv6
    [ 2.746542] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
    [ 2.747857] NET: Registered protocol family 17
    [ 2.747921] NET: Registered protocol family 15
    [ 2.748128] Key type dns_resolver registered
    [ 2.749213] oprofile: no performance counters
    [ 2.749464] oprofile: using timer interrupt.
    [ 2.749684] ThumbEE CPU extension supported.
    [ 2.749717] Registering SWP/SWPB emulation handler
    [ 2.750721] omap_voltage_late_init: Voltage driver support not added
    [ 2.750754] sr_dev_init: No voltage domain specified for smartreflex0. Cannot initialize
    [ 2.750764] sr_dev_init: No voltage domain specified for smartreflex1. Cannot initialize
    [ 2.751170] SmartReflex Class3 initialized
    [ 2.752538] printk: console [ttyS0]: printing thread started
    [ 2.752701] Loading compiled-in X.509 certificates
    [ 2.791877] omap-gpmc 50000000.gpmc: GPMC revision 6.0
    [ 2.791936] gpmc_mem_init: disabling cs 0 mapped at 0x0-0x1000000
    [ 2.792742] mmc0: SDHCI controller on 48060000.mmc [48060000.mmc] using External DMA
    [ 2.800125] physmap-flash 8000000.nor: physmap platform flash device: [mem 0x08000000-0x0fffffff]
    [ 2.800323] 8000000.nor: Found 1 x16 devices at 0x0 in 16-bit bank. Manufacturer ID 0x000001 Chip ID 0x002801
    [ 3.848064] Support for command set 0002 not present
    [ 3.848122] gen_probe: No supported Vendor Command Set found
    [ 3.848152] physmap-flash 8000000.nor: map_probe failed
    [ 3.855877] physmap-flash 12000000.misc: physmap platform flash device: [mem 0x12000000-0x12ffffff]
    [ 3.868593] physmap-flash 12000000.misc: map_probe failed
    [ 3.874472] omap_i2c 44e0b000.i2c: bus 0 rev0.12 at 100 kHz
    [ 3.885520] omap_reset_deassert: timedout waiting for per:1
    [ 3.885817] ti-sysc: probe of 54426000.target-module failed with error -110
    [ 3.896885] omap_reset_deassert: timedout waiting for gfx:0
    [ 3.897268] ti-sysc: probe of 5600fe00.target-module failed with error -110
    [ 3.905895] l4-rtc-clkctrl:0000:0: failed to disable
    [ 3.913300] Freeing unused kernel memory: 1024K
    [ 3.993968] Run /init as init process
    Creating mount point for flash in /mnt/flash
    mount: mounting /dev/mtdblock0 on /mnt/flash/ failed: No such fi[ 4.191634] MTD: Couldn't look up '/dev/mtdblock0': -2
    le or directory
    [ 4.212714] cpsw-switch 4a100000.switch: starting ndev. mode: dual_mac
    [ 4.399636] Microsemi GE VSC8502 SyncE 4a101000.mdio:02: attached PHY driver [Microsemi GE VSC8502 SyncE] (mii_bus:phy_addr=4a101000.mdio:02, irq=POLL)
    [ 4.436072] cpsw-switch 4a100000.switch: starting ndev. mode: dual_mac
    [ 4.609642] Microsemi GE VSC8502 SyncE 4a101000.mdio:03: attached PHY driver [Microsemi GE VSC8502 SyncE] (mii_bus:phy_addr=4a101000.mdio:03, irq=POLL)

    Welcome to ECRTU
    ecrtu100 login:

    # devmem 0x44df8d00 32
    0x00030000

    I have highlighted the ti-sysc fail lines.

    Also see value at 0x44df8d00 is indicating SPI0 disabled whereas in uboot it was enabled.

    In my dts i have written

    &spi0 {
    status = "okay";
    pinctrl-names = "default";
    pinctrl-0 = <&myspi0_pins_default>;
    dmas = <&edma 16 0
    &edma 17 0>;
    dma-names = "tx0", "rx0";

    };

  • May I expect some comment please?

  • May I expect some comment please?

  • Hi Supriyo,

    I added 'status="okay";' in my evm kernel dts, but I seem the same, PRCM_SPI_CLKCTRL shows the SPI clock is not enabled. I will look into it and keep you posted.