Adding Support for Verizon CR1000A

eh i guess rt9301 is the main blocker... @olliver from 1 to 10 how much do you think it's possible to support the switch in this configuration?

Check the @spol-eff 's posts above - he did some digging into userspace tools from OEM firmware.

saddly if the solution will be accept having a precompiled userspace bin from an OEM firmware to make the switch work... then i'm pretty negative about it...

I don't think we would need to resort to this. My understanding is we can just issue the same set of commands in our own way. Switch is already reporting itself as up as dp5_syn. Hopefully just some initialization would be needed to at least make it working as dumb switch

@Ansuel long term or short term?

Short term, 1%; I suppose if you can run the supplied blob it would be okay.

Longerm, 99% :slight_smile: I'm (re)writing the I2C driver right now, with using regmap that allows for either MMIO (register based) or SPI access. I don't have any hardware, so that'll be a thing.

The biggest problem however regardless (to keep up with motiviation etc) is getting rtl93xx based merge requests merged. Having a tree with 250 patches is getting tiresome and demotiviating in continuing to work on it :stuck_out_tongue:

But shouldn't be a huge problem, as long as we keep moving forward.

my biggest concern is not being able to emulate what the userspace thing does
resulting in never being able to setup the switch

From where I'm sitting, I don't see an issue generally. We drive the switch chip the same way, just over SPI. The only scare is, the 'undocumented bits'. E.g. what if the blob sends some initit junk that we have no idea about, that's not obvious. That'll be needing some reverse engineering. But I'd be supprised if they made it that complex.

meanwhile this is my updated understanding of how everything is connected. Folks, let me know if something is off here:

i: IPQ8072A
r: RTL3901\nlan/dp5_syn
a1: AQR113c\nwan10g/dp6_syn
a2: AQR113c\nlan10G
r1: RTL8221B\nlan2.5G
r2: RTL8221B\nlan2.5G
w2: QCN5054
w5: QCN6024
w6: QCN9024
m: MXL3711\nmoca 2.5

i -> w2: ahb
i -> w5: ahb
i -> w6: PCI-E#1
i -> r: SPI\n/dev/spi32765.0 {style: {stroke-dash: 3}}
i -> r: USXGMII\n(external CPU mode)
i -> a1: USXGMII
r -> a2: port 8
r -> m: ?
r -> r1: port 20
r -> r2: port 24

on another note: trying to enable SPI buses: OEM has 2

[    8.120175] spi_qup 78b5000.spi: IN:block:16, fifo:64, OUT:block:16, fifo:64
[    8.122236] spi_qup 78b9000.spi: IN:block:16, fifo:64, OUT:block:16, fifo:64

but OpenWrt's .dtsi has only one described. @robimarko: why?

I think we need the seconds one (spi@4 below seem to be the rtl3901?) but, when added under it crashes

[ 0.072151] WARNING: CPU: 1 PID: 1 at gic_irq_domain_translate+0xa0/0x110
[ 0.072173] Modules linked in:
[ 0.072185] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 5.15.108 #0
[ 0.072197] Hardware name: Verizon CR1000A (DT)
[ 0.072205] pstate: 20400005 (nzCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[ 0.072217] pc : gic_irq_domain_translate+0xa0/0x110
[ 0.072228] lr : irq_create_fwspec_mapping+0x54/0x350
[ 0.072243] sp : ffffffc0094eb980
[ 0.072249] x29: ffffffc0094eb980 x28: 0000000000000000 x27: ffffff80030d3840
[ 0.072268] x26: 0000000000000001 x25: 0000000000000000 x24: ffffff8003055810
[ 0.072286] x23: ffffff80030d3840 x22: ffffff807fc31298 x21: ffffff80030d3840
[ 0.072303] x20: ffffffc0094eb9d0 x19: ffffff8002820000 x18: 0000000000000002
[ 0.072321] x17: 746e756f63206573 x16: 75662064696c6176 x15: ffffffffffffffff
[ 0.072339] x14: ffffffffff000000 x13: ffffffffffffffff x12: 0000000000000003
[ 0.072356] x11: 0000000000000028 x10: 0101010101010101 x9 : ffffffffffffffff
[ 0.072374] x8 : ffffffc0094ebae0 x7 : 0000000000000000 x6 : 0000000000802369
[ 0.072391] x5 : ffffffc0087c6248 x4 : 0000000000000003 x3 : ffffffc0094eb9b0
[ 0.072408] x2 : ffffffc0094eb9b8 x1 : ffffffc0094eb9d0 x0 : 0000000000000000
[ 0.072426] Call trace:
[ 0.072433] gic_irq_domain_translate+0xa0/0x110
[ 0.072445] irq_create_of_mapping+0x58/0x64
[ 0.072457] of_irq_get+0x64/0xa4
[ 0.072469] of_irq_to_resource+0x24/0xcc
[ 0.072480] of_irq_to_resource_table+0x50/0x80
[ 0.072490] of_device_alloc+0x148/0x190
[ 0.072504] of_platform_device_create_pdata+0x60/0xf4
[ 0.072516] of_platform_bus_create+0xec/0x334
[ 0.072529] of_platform_bus_create+0x134/0x334
[ 0.072541] of_platform_populate+0x50/0xcc
[ 0.072553] of_platform_default_populate_init+0xa8/0xc8
[ 0.072568] do_one_initcall+0x50/0x1c0
[ 0.072579] kernel_init_freeable+0x234/0x29c
[ 0.072592] kernel_init+0x24/0x120
[ 0.072606] ret_from_fork+0x10/0x20
[ 0.072629] ---[ end trace 7b1fbf61a9e3be49 ]---

&soc {
     spi@78b9000 {
			compatible = "qcom,spi-qup-v2.2.1";
			#address-cells = <0x01>;
			#size-cells = <0x00>;
			reg = <0x78b9000 0x600>;
			interrupts = <0x00 0x12b 0x00>;
			spi-max-frequency = <0x2faf080>;
			clocks = <0x0b 0x5e 0x0b 0x54>;
			clock-names = "core\0iface";
			dmas = <0x0e 0x14 0x0e 0x15>;
			dma-names = "tx\0rx";
			status = "ok";
			pinctrl-0 = <0x11>;
			pinctrl-names = "default";

			spi@4 {
				compatible = "qca,spidev";
				reg = <0x00>;
				spi-max-frequency = <0xb71b00>;
			};
		};
    };
};
[    0.022171] OF: /soc/spi@78b9000: could not find phandle 94
....
[    3.316874] spi_qup 78b9000.spi: deferred probe timeout, ignoring dependency
[    3.424590] spi_qup 78b9000.spi: deferred probe timeout, ignoring dependency

Its rather simple, because the downstream kernel doesn't have the node so I had no idea where the bus actually is, there should actually be 5 SPI buses and 5 I2C buses.

Copy/pasting decompiled nodes won't work, all of the phandle references will be broken obviously.

Can you post the whole stock DTS in order to configure the pinctrl?

ok, understood.

realized that later too by looking at the .dtsi tlmm section

Here are the links (old ones are dead :frowning: )

there are 3 spi busses (one disabled and without pinctrls.. half defined?)
and 2 i2c busses there.

What's the best course of actions here? Are you gonna add those to .dtsi?

Yeah, I will add the bus you need to DTSI and send it upstream.
Pinctrl will obviously be set in your device DTS.

1 Like

Don't we want to add them all? Not only one?

Why?

There isnt really a point of adding untested stuff.

Can you try picking:

And then obviously you need to set the pinctrl in the board DTS as well.

To reduce the amount of investigative work for other devices? I could see the reason to probably keep it separate, like in '-experimental.dtsi' or something, but have all those pieces of info scattered across forums is just a waste imo.

Re commit: will try in few hours.

ok. thanks for patch; 2nd spi works too now

[    2.546771] spi_qup 78b5000.spi: IN:block:16, fifo:64, OUT:block:16, fifo:64
[    2.549583] spi_qup 78b9000.spi: IN:block:16, fifo:64, OUT:block:16, fifo:64

Awesome, will send it upstream as well.

Soo.. while I'm digging into how to talk to switch over SPI which might take some time.

Here is the current boot log:

[ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[ 0.000000] Linux version 5.15.108 (techsage@tech) (aarch64-openwrt-linux-musl-gcc (OpenWrt GCC 12.2.0 r22645-4378992888) 12.2.0, GNU ld (GNU Binutils) 2.40.0) #0 SMP Tue Apr 25 11:46:03 2023
[ 0.000000] Machine model: Verizon CR1000A
[ 0.000000] Zone ranges:
[ 0.000000] DMA [mem 0x0000000040000000-0x00000000bfffffff]
[ 0.000000] DMA32 empty
[ 0.000000] Normal empty
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x0000000040000000-0x0000000040ffffff]
[ 0.000000] node 0: [mem 0x0000000041000000-0x000000004a3fffff]
[ 0.000000] node 0: [mem 0x000000004a400000-0x00000000510fffff]
[ 0.000000] node 0: [mem 0x0000000051100000-0x00000000bfffffff]
[ 0.000000] Initmem setup node 0 [mem 0x0000000040000000-0x00000000bfffffff]
[ 0.000000] psci: probing for conduit method from DT.
[ 0.000000] psci: PSCIv1.0 detected in firmware.
[ 0.000000] psci: Using standard PSCI v0.2 function IDs
[ 0.000000] psci: MIGRATE_INFO_TYPE not supported.
[ 0.000000] psci: SMC Calling Convention v1.0
[ 0.000000] percpu: Embedded 17 pages/cpu s30360 r8192 d31080 u69632
[ 0.000000] pcpu-alloc: s30360 r8192 d31080 u69632 alloc=174096
[ 0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3
[ 0.000000] Detected VIPT I-cache on CPU0
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 516096
[ 0.000000] Kernel command line: console=ttyMSM0,115200n8 vmalloc=900M cnss2.bdf_pci0=0xa4 root=PARTUUID=58c07d06-405e-c6a7-9c0f-a2fdf0ecb70f gpt rootwait
[ 0.000000] Unknown kernel command line parameters "vmalloc=900M", will be passed to user space.
[ 0.000000] Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes, linear)
[ 0.000000] Inode-cache hash table entries: 131072 (order: 8, 1048576 bytes, linear)
[ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[ 0.000000] Memory: 1907596K/2097152K available (7424K kernel code, 842K rwdata, 2044K rodata, 10560K init, 271K bss, 189556K reserved, 0K cma-reserved)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[ 0.000000] rcu: Hierarchical RCU implementation.
[ 0.000000] Tracing variant of Tasks RCU enabled.
[ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[ 0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[ 0.000000] Root IRQ handler: gic_handle_irq
[ 0.000000] GICv2m: range[mem 0x0b00a000-0x0b00affc], SPI[448:479]
[ 0.000000] arch_timer: cp15 and mmio timer(s) running at 19.20MHz (virt/virt).
[ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x46d987e47, max_idle_ns: 440795202767 ns
[ 0.000001] sched_clock: 56 bits at 19MHz, resolution 52ns, wraps every 4398046511078ns
[ 0.000115] Calibrating delay loop (skipped), value calculated using timer frequency.. 38.40 BogoMIPS (lpj=192000)
[ 0.000132] pid_max: default: 32768 minimum: 301
[ 0.000285] Mount-cache hash table entries: 4096 (order: 3, 32768 bytes, linear)
[ 0.000305] Mountpoint-cache hash table entries: 4096 (order: 3, 32768 bytes, linear)
[ 0.001894] rcu: Hierarchical SRCU implementation.
[ 0.002070] dyndbg: Ignore empty _ddebug table in a CONFIG_DYNAMIC_DEBUG_CORE build
[ 0.002584] smp: Bringing up secondary CPUs ...
[ 0.003174] Detected VIPT I-cache on CPU1
[ 0.003238] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
[ 0.003852] Detected VIPT I-cache on CPU2
[ 0.003891] CPU2: Booted secondary processor 0x0000000002 [0x410fd034]
[ 0.004468] Detected VIPT I-cache on CPU3
[ 0.004505] CPU3: Booted secondary processor 0x0000000003 [0x410fd034]
[ 0.004570] smp: Brought up 1 node, 4 CPUs
[ 0.004597] SMP: Total of 4 processors activated.
[ 0.004604] CPU features: detected: 32-bit EL0 Support
[ 0.004611] CPU features: detected: CRC32 instructions
[ 0.004663] CPU features: emulated: Privileged Access Never (PAN) using TTBR0_EL1 switching
[ 0.004673] CPU: All CPU(s) started at EL1
[ 0.004694] alternatives: patching kernel code
[ 0.012117] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.012152] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
[ 0.012298] pinctrl core: initialized pinctrl subsystem
[ 0.013301] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[ 0.013791] DMA: preallocated 256 KiB GFP_KERNEL pool for atomic allocations
[ 0.013853] DMA: preallocated 256 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations
[ 0.013907] DMA: preallocated 256 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations
[ 0.014236] thermal_sys: Registered thermal governor 'step_wise'
[ 0.015676] cpuidle: using governor menu
[ 0.015900] ASID allocator initialised with 65536 entries
[ 0.071249] qcom,cpr4-apss-regulator b018000.cpr4-ctrl: CPR valid fuse count: 4
[ 0.079532] SCSI subsystem initialized
[ 0.079715] usbcore: registered new interface driver usbfs
[ 0.079756] usbcore: registered new interface driver hub
[ 0.079795] usbcore: registered new device driver usb
[ 0.080184] qcom_scm: convention: smc arm 64
[ 0.081386] clocksource: Switched to clocksource arch_sys_counter
[ 0.082081] NET: Registered PF_INET protocol family
[ 0.082237] IP idents hash table entries: 32768 (order: 6, 262144 bytes, linear)
[ 0.083673] tcp_listen_portaddr_hash hash table entries: 1024 (order: 2, 16384 bytes, linear)
[ 0.083717] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[ 0.083734] TCP established hash table entries: 16384 (order: 5, 131072 bytes, linear)
[ 0.083895] TCP bind hash table entries: 16384 (order: 6, 262144 bytes, linear)
[ 0.084182] TCP: Hash tables configured (established 16384 bind 16384)
[ 0.084273] UDP hash table entries: 1024 (order: 3, 32768 bytes, linear)
[ 0.084340] UDP-Lite hash table entries: 1024 (order: 3, 32768 bytes, linear)
[ 0.084539] NET: Registered PF_UNIX/PF_LOCAL protocol family
[ 0.084572] PCI: CLS 0 bytes, default 64
[ 0.104578] workingset: timestamp_bits=46 max_order=19 bucket_order=0
[ 0.108257] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 0.108285] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[ 0.111166] qcom-qmp-phy 58000.phy: supply vdda-phy not found, using dummy regulator
[ 0.111350] qcom-qmp-phy 58000.phy: supply vdda-pll not found, using dummy regulator
[ 0.112465] qcom-qmp-phy 58000.phy: Registered Qcom-QMP phy
[ 0.112767] qcom-qmp-phy 78000.phy: supply vdda-phy not found, using dummy regulator
[ 0.112898] qcom-qmp-phy 78000.phy: supply vdda-pll not found, using dummy regulator
[ 0.113829] qcom-qmp-phy 78000.phy: Registered Qcom-QMP phy
[ 0.114963] qcom-qmp-phy 84000.phy: Registered Qcom-QMP phy
[ 0.116010] qcom-qmp-phy 8e000.phy: Registered Qcom-QMP phy
[ 0.116868] qcom-qusb2-phy 59000.phy: supply vdda-pll not found, using dummy regulator
[ 0.117003] qcom-qusb2-phy 59000.phy: supply vdda-phy-dpdm not found, using dummy regulator
[ 0.117170] qcom-qusb2-phy 59000.phy: Registered Qcom-QUSB2 phy
[ 0.117341] qcom-qusb2-phy 79000.phy: supply vdda-pll not found, using dummy regulator
[ 0.117451] qcom-qusb2-phy 79000.phy: supply vdda-phy-dpdm not found, using dummy regulator
[ 0.117589] qcom-qusb2-phy 79000.phy: Registered Qcom-QUSB2 phy
[ 0.119653] qcom-pcie 10000000.pci: host bridge /soc/pci@10000000 ranges:
[ 0.119729] qcom-pcie 10000000.pci: IO 0x0010200000..0x001020ffff -> 0x0010200000
[ 0.119757] qcom-pcie 10000000.pci: MEM 0x0010220000..0x001fffffff -> 0x0010220000
[ 0.178938] qcom-pcie 10000000.pci: Read DBI address failed
[ 0.293014] qcom-pcie 10000000.pci: iATU unroll: disabled
[ 0.293043] qcom-pcie 10000000.pci: Detected iATU regions: 32 outbound, 8 inbound
[ 1.291522] qcom-pcie 10000000.pci: Phy link never came up
[ 1.291718] qcom-pcie 10000000.pci: PCI host bridge to bus 0001:00
[ 1.291735] pci_bus 0001:00: root bus resource [bus 00-ff]
[ 1.291751] pci_bus 0001:00: root bus resource [io 0x0000-0xffff] (bus address [0x10200000-0x1020ffff])
[ 1.291764] pci_bus 0001:00: root bus resource [mem 0x10220000-0x1fffffff]
[ 1.291806] pci 0001:00:00.0: [17cb:0302] type 01 class 0x060400
[ 1.291833] pci 0001:00:00.0: reg 0x10: [mem 0x00000000-0x00000fff]
[ 1.291909] pci 0001:00:00.0: PME# supported from D0 D3hot D3cold
[ 1.297450] pci 0001:00:00.0: BAR 0: assigned [mem 0x10220000-0x10220fff]
[ 1.297477] pci 0001:00:00.0: PCI bridge to [bus 01-ff]
[ 1.299357] pcieport 0001:00:00.0: PME: Signaling with IRQ 87
[ 1.299676] pcieport 0001:00:00.0: AER: enabled with IRQ 87
[ 1.300401] qcom-pcie 20000000.pci: host bridge /soc/pci@20000000 ranges:
[ 1.300457] qcom-pcie 20000000.pci: IO 0x0020200000..0x002020ffff -> 0x0020200000
[ 1.300485] qcom-pcie 20000000.pci: MEM 0x0020220000..0x002fffffff -> 0x0020220000
[ 1.422946] qcom-pcie 20000000.pci: iATU unroll: enabled
[ 1.422960] qcom-pcie 20000000.pci: Detected iATU regions: 8 outbound, 8 inbound
[ 1.523023] qcom-pcie 20000000.pci: Link up
[ 1.523156] qcom-pcie 20000000.pci: PCI host bridge to bus 0000:00
[ 1.523169] pci_bus 0000:00: root bus resource [bus 00-ff]
[ 1.523185] pci_bus 0000:00: root bus resource [io 0x10000-0x1ffff] (bus address [0x20200000-0x2020ffff])
[ 1.523198] pci_bus 0000:00: root bus resource [mem 0x20220000-0x2fffffff]
[ 1.523237] pci 0000:00:00.0: [17cb:1002] type 01 class 0x060400
[ 1.523261] pci 0000:00:00.0: reg 0x10: [mem 0x00000000-0x00000fff]
[ 1.523334] pci 0000:00:00.0: PME# supported from D0 D3hot D3cold
[ 1.526442] pci 0000:01:00.0: [17cb:1104] type 00 class 0x028000
[ 1.526545] pci 0000:01:00.0: reg 0x10: [mem 0x00000000-0x001fffff 64bit]
[ 1.527059] pci 0000:01:00.0: PME# supported from D0 D3hot D3cold
[ 1.527201] pci 0000:01:00.0: 7.876 Gb/s available PCIe bandwidth, limited by 8.0 GT/s PCIe x1 link at 0000:00:00.0 (capable of 15.752 Gb/s with 8.0 GT/s PCIe x2 link)
[ 1.530045] pci 0000:00:00.0: BAR 8: assigned [mem 0x20400000-0x205fffff]
[ 1.530067] pci 0000:00:00.0: BAR 9: assigned [mem 0x20600000-0x207fffff 64bit pref]
[ 1.530082] pci 0000:00:00.0: BAR 0: assigned [mem 0x20220000-0x20220fff]
[ 1.530096] pci 0000:00:00.0: BAR 7: assigned [io 0x10000-0x10fff]
[ 1.530112] pci 0000:01:00.0: BAR 0: assigned [mem 0x20400000-0x205fffff 64bit]
[ 1.530166] pci 0000:00:00.0: PCI bridge to [bus 01-ff]
[ 1.530178] pci 0000:00:00.0: bridge window [io 0x10000-0x10fff]
[ 1.530190] pci 0000:00:00.0: bridge window [mem 0x20400000-0x205fffff]
[ 1.530202] pci 0000:00:00.0: bridge window [mem 0x20600000-0x207fffff 64bit pref]
[ 1.531598] pcieport 0000:00:00.0: PME: Signaling with IRQ 88
[ 1.531902] pcieport 0000:00:00.0: AER: enabled with IRQ 88
[ 1.534905] bam-dma-engine 704000.dma-controller: num-channels unspecified in dt
[ 1.534929] bam-dma-engine 704000.dma-controller: num-ees unspecified in dt
[ 1.538293] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[ 1.538773] msm_serial 78b3000.serial: msm_serial: detected port #0
[ 1.538804] msm_serial 78b3000.serial: uartclk = 3686400
[ 1.538846] 78b3000.serial: ttyMSM0 at MMIO 0x78b3000 (irq = 24, base_baud = 230400) is a MSM
[ 1.538873] msm_serial: console setup on port #0
[ 2.542857] printk: console [ttyMSM0] enabled
[ 2.547975] msm_serial: driver initialized
[ 2.555717] loop: module loaded
[ 2.556716] spi_qup 78b5000.spi: IN:block:16, fifo:64, OUT:block:16, fifo:64
[ 2.559528] spi_qup 78b9000.spi: IN:block:16, fifo:64, OUT:block:16, fifo:64
[ 2.567044] spmi spmi-0: PMIC arbiter version v2 (0x20010000)
[ 2.576076] s1: supplied by regulator-dummy
[ 2.578964] s2: supplied by regulator-dummy
[ 2.582968] vdd_s3: supplied by regulator-dummy
[ 2.587224] vdd_s4: supplied by regulator-dummy
[ 2.591772] s5: supplied by regulator-dummy
[ 2.596120] l1: supplied by regulator-dummy
[ 2.600286] l2: supplied by regulator-dummy
[ 2.604486] l3: supplied by regulator-dummy
[ 2.608613] l4: supplied by regulator-dummy
[ 2.612800] l5: supplied by regulator-dummy
[ 2.616970] l6: supplied by regulator-dummy
[ 2.621120] l7: supplied by regulator-dummy
[ 2.625306] l8: supplied by regulator-dummy
[ 2.629473] l9: supplied by regulator-dummy
[ 2.633744] l11: supplied by regulator-dummy
[ 2.637792] l12: supplied by regulator-dummy
[ 2.642333] l13: supplied by regulator-dummy
[ 2.660208] mdio_bus 90000.mdio-1: MDIO device at address 0 is missing.
[ 2.719557] i2c_dev: i2c /dev entries driver
[ 2.724318] sdhci: Secure Digital Host Controller Interface driver
[ 2.724364] sdhci: Copyright(c) Pierre Ossman
[ 2.729400] sdhci-pltfm: SDHCI platform and OF driver helper
[ 2.737661] remoteproc remoteproc0: releasing cd00000.q6v5_wcss
[ 2.741925] NET: Registered PF_INET6 protocol family
[ 2.746092] Segment Routing with IPv6
[ 2.750441] In-situ OAM (IOAM) with IPv6
[ 2.754087] NET: Registered PF_PACKET protocol family
[ 2.758004] 8021q: 802.1Q VLAN Support v1.8
[ 2.766672] mmc0: SDHCI controller on 7824900.mmc [7824900.mmc] using ADMA 64-bit
[ 2.778339] qcom,cpr4-apss-regulator b018000.cpr4-ctrl: CPR valid fuse count: 4
[ 2.778633] cpr4_ipq807x_apss_read_fuse_data: apc_corner: speed bin = 0
[ 2.784500] cpr4_ipq807x_apss_read_fuse_data: apc_corner: CPR fusing revision = 1
[ 2.791064] cpr4_ipq807x_apss_read_fuse_data: apc_corner: CPR misc fuse value = 0
[ 2.798735] cpr4_ipq807x_apss_read_fuse_data: apc_corner: Voltage boost fuse config = 0 boost = disable
[ 2.806234] cpr3_mem_acc_init: apc: not using memory accelerator regulator
[ 2.815375] cpr4_ipq807x_apss_calculate_open_loop_voltages: apc_corner: fused SVS: open-loop= 704000 uV
[ 2.822326] cpr4_ipq807x_apss_calculate_open_loop_voltages: apc_corner: fused NOM: open-loop= 824000 uV
[ 2.832306] cpr4_ipq807x_apss_calculate_open_loop_voltages: apc_corner: fused TURBO: open-loop= 888000 uV
[ 2.842115] cpr4_ipq807x_apss_calculate_open_loop_voltages: apc_corner: fused STURBO: open-loop= 992000 uV
[ 2.851971] cpr4_ipq807x_apss_calculate_target_quotients: apc_corner: fused SVS: quot[ 7]= 720, quot_offset[ 7]= 0
[ 2.861736] cpr4_ipq807x_apss_calculate_target_quotients: apc_corner: fused NOM: quot[ 7]= 950, quot_offset[ 7]= 230
[ 2.872586] cpr4_ipq807x_apss_calculate_target_quotients: apc_corner: fused TURBO: quot[ 7]=1058, quot_offset[ 7]= 105
[ 2.883524] cpr4_ipq807x_apss_calculate_target_quotients: apc_corner: fused STURBO: quot[ 7]=1243, quot_offset[ 7]= 185
[ 2.894589] cpr3_regulator_init_ctrl: apc: Default CPR mode = closed-loop
[ 2.897090] cpufreq: cpufreq_online: CPU0: Running at unlisted initial frequency: 19200 KHz, changing to: 1017600 KHz
[ 2.913200] remoteproc remoteproc0: cd00000.q6v5_wcss is available
[ 2.926887] Freeing unused kernel memory: 10560K
[ 2.994619] mmc0: new HS400 MMC card at address 0001
[ 2.995086] mmcblk0: mmc0:0001 004GA0 3.69 GiB
[ 2.999806] GPT:Primary header thinks Alt. header is not at the end of the disk.
[ 3.002955] GPT:7634943 != 7733247
[ 3.002996] Run /init as init process
[ 3.010534] GPT:Alternate GPT header not at the end of the disk.
[ 3.013758] with arguments:
[ 3.017484] GPT:7634943 != 7733247
[ 3.017484] /init
[ 3.017486] with environment:
[ 3.023559] GPT: Use GNU Parted to correct GPT errors.
[ 3.023561] HOME=/
[ 3.026771] TERM=linux
[ 3.026772] vmalloc=900M
[ 3.026800] mmcblk0: p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 p13 p14 p15 p16 p17 p18 p19 p20 p21 p22 p23 p24 p25 p26 p27 p28 p29
[ 3.033630] mmcblk0boot0: mmc0:0001 004GA0 2.00 MiB
[ 3.044376] mmcblk0boot1: mmc0:0001 004GA0 2.00 MiB
[ 3.048889] mmcblk0rpmb: mmc0:0001 004GA0 512 KiB, chardev (247:0)
[ 3.173125] init: Console is alive
[ 3.173253] init: - watchdog -
[ 3.180626] kmodloader: loading kernel modules from /etc/modules-boot.d/

[ 3.182911] hwmon hwmon0: temp1_input not attached to any thermal zone
[ 3.207772] ssdk_switch_device_num_init[1335]:INFO:ess-switch dts node number: 1
[ 3.207869] ssdk_dt_get_switch_node[1124]:INFO:ess-switch DT exist!
[ 3.214261] ssdk_dt_parse_access_mode[999]:INFO:switch_access_mode: local bus
[ 3.220232] ssdk_dt_parse_access_mode[1012]:INFO:switchreg_base_addr: 0x3a000000
[ 3.227531] ssdk_dt_parse_access_mode[1013]:INFO:switchreg_size: 0x1000000
[ 3.234993] ssdk_dt_parse_mac_mode[327]:INFO:mac mode = 0x0
[ 3.241674] ssdk_dt_parse_mac_mode[336]:INFO:mac mode1 = 0xe
[ 3.247140] ssdk_dt_parse_mac_mode[345]:INFO:mac mode2 = 0xd
[ 3.253055] ssdk_dt_parse_port_bmp[899]:INFO:port_bmp doesn't exist!
[ 3.258709] ssdk_dt_parse_uniphy[364]:INFO:ess-uniphy DT exist!
[ 3.265297] ssdk_plat_init[1692]:INFO:ssdk_plat_init start
[ 3.402531] ssdk_gcc_clock_init[1275]:INFO:SSDK gcc clock init successfully!
[ 3.403453] aquantia_phy_api_ops_init[2241]:INFO:qca probe aquantia phy driver succeeded!
[ 3.409250] sfp_phy_init[229]:INFO:sfp phy init for port 0x20!
[ 3.423030] sfp_phy_probe[68]:INFO:sfp phy is probed!
[ 3.423120] regi_init[3953]:INFO:Initializing HPPE!!
[ 3.661402] ssdk_ppe_reset_init[1535]:INFO:ppe reset successfully!
[ 3.665009] qca_hppe_portctrl_hw_init[126]:INFO:Hawkeye PPE port initializing
[ 4.383433] adpt_hppe_port_mux_mac_type_set[2787]:WARN:port 1 need not to configure mux and mac type
[ 4.383468] adpt_hppe_port_mux_mac_type_set[2787]:WARN:port 2 need not to configure mux and mac type
[ 4.391648] adpt_hppe_port_mux_mac_type_set[2787]:WARN:port 3 need not to configure mux and mac type
[ 4.400747] adpt_hppe_port_mux_mac_type_set[2787]:WARN:port 4 need not to configure mux and mac type
[ 5.081432] ssdk_switch_register[2017]:INFO:Chip version 0x1500
[ 5.081466] qca_link_polling_select[1487]:INFO:link-polling-required node does not exist
[ 5.086155] ssdk_switch_register[2043]:INFO:polling is selected
[ 5.094502] regi_init[3957]:INFO:Initializing HPPE Done!!
[ 5.100223] ssdk_genl_init[211]:INFO:ssdk genl family register success.
[ 5.105700] regi_init[4020]:INFO:qca-ssdk module init succeeded!
[ 5.114587] EDMA ver 1 hw init
[ 5.118573] EDMA HW Reset completed succesfully
[ 5.121250] Num rings - TxDesc:1 (23-23) TxCmpl:1 (7-7)
[ 5.125666] RxDesc:1 (15-15) RxFill:1 (7-7)
[ 5.131201] GMAC5(ffffff80036218c0) Invalid MAC@ - using 5a:bc:1d:da:b7:ad
[ 5.135776] lan: Registered netdev lan(qcom-id:5)
[ 5.142132] GMAC6(ffffff80036228c0) Invalid MAC@ - using 72:1f:91:99:81:af
[ 5.146902] Aquantia AQR113C 90000.mdio-1:08: FW 5.6, Build 7, Provisioning 1
[ 5.158938] Aquantia AQR113C 90000.mdio-1:08: attached PHY driver (mii_bus:phy_addr=90000.mdio-1:08, irq=POLL)
[ 5.161283] nss-dp 3a007000.dp6-syn wan: Registered netdev wan(qcom-id:6)
[ 5.170723] **********************************************************
[ 5.177497] * NSS Data Plane driver
[ 5.183895] **********************************************************
[ 5.197988] xhci-hcd xhci-hcd.1.auto: xHCI Host Controller
[ 5.198036] xhci-hcd xhci-hcd.1.auto: new USB bus registered, assigned bus number 1
[ 5.202544] xhci-hcd xhci-hcd.1.auto: hcc params 0x0220fe65 hci version 0x110 quirks 0x0000000002010010
[ 5.209959] xhci-hcd xhci-hcd.1.auto: irq 96, io mem 0x08a00000
[ 5.219380] xhci-hcd xhci-hcd.1.auto: xHCI Host Controller
[ 5.225207] xhci-hcd xhci-hcd.1.auto: new USB bus registered, assigned bus number 2
[ 5.230760] xhci-hcd xhci-hcd.1.auto: Host supports USB 3.0 SuperSpeed
[ 5.238781] hub 1-0:1.0: USB hub found
[ 5.244961] hub 1-0:1.0: 1 port detected
[ 5.248942] usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
[ 5.253019] hub 2-0:1.0: USB hub found
[ 5.260802] hub 2-0:1.0: 1 port detected
[ 5.264644] xhci-hcd xhci-hcd.2.auto: xHCI Host Controller
[ 5.268437] xhci-hcd xhci-hcd.2.auto: new USB bus registered, assigned bus number 3
[ 5.273882] xhci-hcd xhci-hcd.2.auto: hcc params 0x0220fe65 hci version 0x110 quirks 0x0000000002010010
[ 5.281315] xhci-hcd xhci-hcd.2.auto: irq 97, io mem 0x08c00000
[ 5.290733] xhci-hcd xhci-hcd.2.auto: xHCI Host Controller
[ 5.296561] xhci-hcd xhci-hcd.2.auto: new USB bus registered, assigned bus number 4
[ 5.302119] xhci-hcd xhci-hcd.2.auto: Host supports USB 3.0 SuperSpeed
[ 5.310056] hub 3-0:1.0: USB hub found
[ 5.316288] hub 3-0:1.0: 1 port detected
[ 5.320260] usb usb4: We don't know the algorithms for LPM for this host, disabling LPM.
[ 5.324328] hub 4-0:1.0: USB hub found
[ 5.332222] hub 4-0:1.0: 1 port detected
[ 5.338610] usbcore: registered new interface driver usb-storage
[ 5.340659] usbcore: registered new interface driver uas
[ 5.346038] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[ 5.352438] init: - preinit -
[ 5.415290] random: jshn: uninitialized urandom read (4 bytes read)
[ 5.431211] random: jshn: uninitialized urandom read (4 bytes read)
[ 5.439197] random: jshn: uninitialized urandom read (4 bytes read)
[ 6.431431] usb 4-1: new SuperSpeed USB device number 2 using xhci-hcd
[ 6.462744] random: procd: uninitialized urandom read (4 bytes read)
[ 6.462902] usb-storage 4-1:1.0: USB Mass Storage device detected
[ 6.468437] scsi host0: usb-storage 4-1:1.0
[ 7.511881] scsi 0:0:0:0: Direct-Access SanDisk Extreme 0001 PQ: 0 ANSI: 6
[ 7.512704] sd 0:0:0:0: [sda] 125045424 512-byte logical blocks: (64.0 GB/59.6 GiB)
[ 7.513318] procd: - early -
[ 7.526574] procd: - watchdog -
[ 7.529679] sd 0:0:0:0: [sda] Write Protect is off
[ 7.532454] sd 0:0:0:0: [sda] Mode Sense: 53 00 00 08
[ 7.532808] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[ 7.542939] sda: sda1
[ 7.548302] sd 0:0:0:0: [sda] Attached SCSI removable disk
[ 8.052857] procd: - watchdog -
[ 8.053155] procd: - ubus -
[ 8.057288] random: ubusd: uninitialized urandom read (4 bytes read)
[ 8.104612] random: ubusd: uninitialized urandom read (4 bytes read)
[ 8.104774] random: ubusd: uninitialized urandom read (4 bytes read)
[ 8.110945] procd: - init -
[ 8.197665] urngd: v1.0.2 started.
[ 8.211132] random: crng init done
[ 8.211163] random: 26 urandom warning(s) missed due to ratelimiting
[ 8.213021] kmodloader: loading kernel modules from /etc/modules.d/*
[ 8.245456] Loading modules backported from Linux version v6.1.24-0-g0102425ac76b
[ 8.245493] Backport generated by backports.git v5.15.92-1-44-gd6ea70fafd36
[ 8.256624] NET: Registered PF_QIPCRTR protocol family
[ 8.279741] PPP generic driver version 2.4.2
[ 8.280320] NET: Registered PF_PPPOX protocol family
[ 8.288295] ath11k c000000.wifi: ipq8074 hw2.0
[ 8.288328] ath11k c000000.wifi: FW memory mode: 0
[ 8.292508] remoteproc remoteproc0: powering up cd00000.q6v5_wcss
[ 8.297116] remoteproc remoteproc0: Booting fw image IPQ8074/q6_fw.mdt, size 668
[ 8.648078] remoteproc remoteproc0: remote processor cd00000.q6v5_wcss is now up
[ 8.649758] ath11k_pci 0000:01:00.0: BAR 0: assigned [mem 0x20400000-0x205fffff 64bit]
[ 8.654628] ath11k_pci 0000:01:00.0: enabling device (0000 -> 0002)
[ 8.662636] ath11k_pci 0000:01:00.0: MSI vectors: 16
[ 8.668448] ath11k_pci 0000:01:00.0: qcn9074 hw1.0
[ 8.673645] ath11k_pci 0000:01:00.0: FW memory mode: 2
[ 8.835148] mhi mhi0: Requested to power ON
[ 8.835353] mhi mhi0: Power on setup success
[ 8.875117] ath11k c000000.wifi: qmi ignore invalid mem req type 3
[ 8.881577] ath11k c000000.wifi: chip_id 0x0 chip_family 0x0 board_id 0xff soc_id 0xffffffff
[ 8.881608] ath11k c000000.wifi: fw_version 0x290c84a5 fw_build_timestamp 2023-03-25 07:34 fw_build_id WLAN.HK.2.9.0.1-01385-QCAHKSWPL_SILICONZ-1
[ 8.941453] mhi mhi0: Wait for device to enter SBL or Mission mode
[ 8.996662] kmodloader: done loading kernel modules from /etc/modules.d/*
[ 9.011663] ath11k_pci 0000:01:00.0: chip_id 0x0 chip_family 0x0 board_id 0xff soc_id 0xffffffff
[ 9.011713] ath11k_pci 0000:01:00.0: fw_version 0x290c8569 fw_build_timestamp 2023-03-25 06:50 fw_build_id
[ 9.223214] ath11k c000000.wifi: htt event 48 not handled
[ 9.475573] ath11k_pci 0000:01:00.0: htt event 48 not handled
[ 9.484464] ------------[ cut here ]------------
[ 9.484499] WARNING: CPU: 1 PID: 65 at wiphy_register+0xe0/0x720 [cfg80211]
[ 9.488153] Modules linked in: pppoe ppp_async nft_fib_inet nf_flow_table_ipv6 nf_flow_table_ipv4 nf_flow_table_inet ath11k_pci ath11k_ahb ath11k pppox ppp_generic nft_reject_ipv6 nft_reject_ipv4 nft_reject_inet nft_reject nft_redir nft_quota nft_objref nft_numgen nft_nat nft_masq nft_log nft_limit nft_hash nft_flow_offload nft_fib_ipv6 nft_fib_ipv4 nft_fib nft_ct nft_counter nft_chain_nat nf_tables nf_nat nf_flow_table nf_conntrack mac80211 cfg80211 slhc qrtr_smd qrtr_mhi qrtr qmi_helpers nfnetlink nf_reject_ipv6 nf_reject_ipv4 nf_log_syslog nf_defrag_ipv6 nf_defrag_ipv4 mhi mdio_netlink libcrc32c crc_ccitt compat seqiv jitterentropy_rng drbg michael_mic hmac cmac uas usb_storage leds_gpio xhci_plat_hcd xhci_pci xhci_hcd dwc3 dwc3_qcom qca_nss_dp qca_ssdk gpio_button_hotplug ext4 mbcache jbd2 aquantia hwmon crc32c_generic
[ 9.545517] CPU: 1 PID: 65 Comm: kworker/u8:2 Not tainted 5.15.108 #0
[ 9.567751] Hardware name: Verizon CR1000A (DT)
[ 9.574262] Workqueue: ath11k_qmi_driver_event ath11k_qmi_deinit_service [ath11k]
[ 9.578608] pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[ 9.586242] pc : wiphy_register+0xe0/0x720 [cfg80211]
[ 9.593010] lr : ieee80211_register_hw+0x8a0/0xb20 [mac80211]
[ 9.598220] sp : ffffffc009823b10
[ 9.603943] x29: ffffffc009823b10 x28: 0000000000000080 x27: 0000000000000000
[ 9.607250] x26: 0000000000000000 x25: 0000000000000000 x24: 0000000000000000
[ 9.614368] x23: 0000000000000006 x22: 0000000000000000 x21: 0000000000000006
[ 9.621486] x20: ffffff8011758000 x19: ffffff80117583a0 x18: 0000000000000014
[ 9.628604] x17: 000000005dcc0927 x16: 0000000033607f8c x15: 0000000056edefd7
[ 9.635721] x14: 000000007e68fbb9 x13: 00000000569b4796 x12: 00000000ffffffbd
[ 9.642841] x11: 0000000000000208 x10: 00000000fffffdf7 x9 : ffffffc000b02240
[ 9.649959] x8 : ffffff80117584d8 x7 : 000000007fffffff x6 : 000000000000008c
[ 9.657076] x5 : 0000000000000006 x4 : 0000000000000010 x3 : ffffff8015073184
[ 9.664195] x2 : ffffff8015073184 x1 : 0000000000000000 x0 : 0000000000000000
[ 9.671313] Call trace:
[ 9.678422] wiphy_register+0xe0/0x720 [cfg80211]
[ 9.680683] ieee80211_register_hw+0x8a0/0xb20 [mac80211]
[ 9.685545] ath11k_mac_register+0x820/0xd70 [ath11k]
[ 9.690927] ath11k_core_qmi_firmware_ready+0x1f4/0x5b0 [ath11k]
[ 9.695963] ath11k_qmi_deinit_service+0xf8c/0x1940 [ath11k]
[ 9.702038] process_one_work+0x218/0x3c4
[ 9.707678] worker_thread+0x74/0x4cc
[ 9.711583] kthread+0x120/0x130
[ 9.715229] ret_from_fork+0x10/0x20
[ 9.718528] ---[ end trace 502d533f9bbc5863 ]---
[ 9.722257] ath11k_pci 0000:01:00.0: ieee80211 registration failed: -22
[ 9.726701] ath11k_pci 0000:01:00.0: failed register the radio with mac80211: -22
[ 9.748089] ath11k_pci 0000:01:00.0: failed to create pdev core: -22
[ 13.728534] br-lan: port 1(lan) entered blocking state
[ 13.728574] br-lan: port 1(lan) entered disabled state
[ 13.732842] device lan entered promiscuous mode
[ 14.791499] br-lan: port 1(lan) entered blocking state
[ 14.791545] br-lan: port 1(lan) entered forwarding state
[ 14.795824] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[ 17.912085] nss-dp 3a007000.dp6-syn wan: PHY Link up speed: 1000
[ 17.912153] IPv6: ADDRCONF(NETDEV_CHANGE): wan: link becomes ready
[ 20.311663] ath11k_pci 0000:01:00.0: failed to wait wlan mode request (mode 4): -110
[ 20.311706] ath11k_pci 0000:01:00.0: qmi failed to send wlan mode off: -110
[ 33.111433] l11: disabling

Notable issues i see are those:

[    1.291458] qcom-pcie 10000000.pci: Phy link never came up
...
[    1.527164] pci 0000:01:00.0: 7.876 Gb/s available PCIe bandwidth, limited by 8.0 GT/s PCIe x1 link at 0000:00:00.0 (capable of 15.752 Gb/s with 8.0 GT/s PCIe x2 link)
...
[    1.534874] bam-dma-engine 704000.dma-controller: num-channels unspecified in dt
[    1.534898] bam-dma-engine 704000.dma-controller: num-ees unspecified in dt
...
[    2.660240] mdio_bus 90000.mdio-1: MDIO device at address 0 is missing.
...
[    2.997205] GPT: Use GNU Parted to correct GPT errors.
...
[    3.152082] hwmon hwmon0: temp1_input not attached to any thermal zone
...
[    4.333388] adpt_hppe_port_mux_mac_type_set[2787]:WARN:port 1 need not to configure mux and mac type
[    4.333423] adpt_hppe_port_mux_mac_type_set[2787]:WARN:port 2 need not to configure mux and mac type
[    4.341603] adpt_hppe_port_mux_mac_type_set[2787]:WARN:port 3 need not to configure mux and mac type
[    4.350701] adpt_hppe_port_mux_mac_type_set[2787]:WARN:port 4 need not to configure mux and mac type
...
[    5.199338] usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.

Any hints on how to fix those are appreciated

You need to add a spidev in DTS and then there are userspace tools or directly from the kernel.

get a powerstrip with a switch on it :wink:

So one thing I'd name differently is to also put the SDS numbers there (far more important than just the port numbers). So a1 is actually unknown which SDS it uses, The shell script should be able to tell us that; or dumping the reg-config at the worst.

https://svanheule.net/switches/rtl93xx#section9301 I have listed what I know of the possible SDS, the mapping SDS -> port tells us a lot generally. My guess, its either SDS5, maybe SDS7 (which seems like a SDS we can configure as USGMII). Can you already see if the CPU port is 'port 28' on the switch? (config scripts), as that would confirm that (ish).

what you call 'port 8' thus is SDS2. port 24 is SDS4. What throws is me off though is port20. because SDS3 is a 10gbit port; that means when using an octal PHY, we'd get port 16 - 23. Since we are only using a quarter of the bandwidth, I would think port 16 thus.

As for the SPI bus, would be good to know which bus it is exactly (32765 sounds like a generated number). Bus4 sounds plausible though?

There's reasons to do and not do it. having them all defined in the DTS as 'status = disabled' has my preference; but it also requires to at least know it actually works :slight_smile: if you have development hardware, that's easy-ish; as you can just poke the pins to see if it works.

But adding noise to the DTS, without verification is much nastier :slight_smile: 'bu a_guy said there's an 4th SPI bus, but it's not working :stuck_out_tongue:

https://www.kernel.org/doc/html/latest/spi/spidev.html is a good article, but while i2cdev is nicely usable, the spidev maintainer didn't want to support this, so some hacking is needed (using a known compatible for example which exposes spidev). Then compile the userspace app (which actually lives in the kernel tree) as your basic. Making it accept input (address) and dump output would be a good start to debug stuff :slight_smile: