stinger1
Posts: 6
Joined: Sun Jan 24, 2021 4:02 pm

PCIe link down for TBS6984 Sat card

Sun Jan 24, 2021 4:20 pm

Hi,

i am currently trying to get a TBS 6984 sat card to run using the cm4 and the new io board
https://www.linuxtv.org/wiki/index.php/TBS6984

In my final attempt i am now also using using a pcie (mining) raiser and powering the pi + satcard +raiser card using a ATX powersupply
https://www.amazon.de/lzn-Bergbau-Exten ... 078TDYL6B/

To exclude hardware faults i tested also using a 1gbit pcie network card which operates fine and shows in lspci/dmesg

Unfortunatelly after multiple attemps with various kernels up to 5.10, i cannot get the card to show using lspci,
During dmesg i constantly get "link down"

i also tested increasing the timeout in pcie-brcmstb.c but also with very high timeout (5s) i only get pci link down.

i tested some "range" in the device tree, i found in older forum posts but also that did not bring me any further. (and i have no idea what exactly i am changing there)

can somebody please tell me what else i can try since i am out of ideas....

thanks br stinger


changes to pcie-brcmstb.c

Code: Select all

-       for (i = 0; i < 100 && !brcm_pcie_link_up(pcie); i += 5)
+       for (i = 0; i < 5000 && !brcm_pcie_link_up(pcie); i += 5)
lspci from ubuntu x86

Code: Select all

02:00.0 Multimedia controller: Philips Semiconductors SAA7160 (rev 02)
        Subsystem: Device 6984:0013
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Latency: 0, Cache Line Size: 64 bytes
        Interrupt: pin A routed to IRQ 16
        Region 0: Memory at f7600000 (64-bit, non-prefetchable) [size=1M]
        Capabilities: [40] MSI: Enable- Count=1/32 Maskable- 64bit+
                Address: 0000000000000000  Data: 0000
        Capabilities: [50] Express (v1) Endpoint, MSI 00
                DevCap: MaxPayload 128 bytes, PhantFunc 0, Latency L0s <256ns, L1 <1us
                        ExtTag- AttnBtn- AttnInd- PwrInd- RBE- FLReset- SlotPowerLimit 25.000W
                DevCtl: Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
                        RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop+
                        MaxPayload 128 bytes, MaxReadReq 128 bytes
                DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr- TransPend-
                LnkCap: Port #1, Speed 2.5GT/s, Width x1, ASPM L0s L1, Exit Latency L0s <4us, L1 <64us
                        ClockPM- Surprise- LLActRep- BwNot- ASPMOptComp-
                LnkCtl: ASPM Disabled; RCB 128 bytes Disabled- CommClk-
                        ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
                LnkSta: Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk- DLActive- BWMgmt- ABWMgmt-
        Capabilities: [74] Power Management version 2
                Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0+,D1+,D2+,D3hot-,D3cold-)
                Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
        Capabilities: [80] Vendor Specific Information: Len=50 <?>
        Capabilities: [100 v1] Vendor Specific Information: ID=0000 Rev=0 Len=088 <?>
        Kernel driver in use: SAA716x Budget
        Kernel modules: saa716x_tbs_dvb
dmesg from pi

Code: Select all

[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd083]
[    0.000000] Linux version 5.10.6-v8+ (francesco@osboxes) (aarch64-linux-gnu-gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #3 SMP PREEMPT Thu Jan 14 09:47:48 EST 2021
[    0.000000] Machine model: Raspberry Pi Compute Module 4 Rev 1.0
[    0.000000] efi: UEFI not found.
[    0.000000] Reserved memory: created CMA memory pool at 0x000000001ec00000, size 256 MiB
[    0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
[    0.000000] Zone ranges:
[    0.000000]   DMA      [mem 0x0000000000000000-0x000000003fffffff]
[    0.000000]   DMA32    [mem 0x0000000040000000-0x00000000ffffffff]
[    0.000000]   Normal   [mem 0x0000000100000000-0x00000001ffffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x000000003b3fffff]
[    0.000000]   node   0: [mem 0x0000000040000000-0x00000000fbffffff]
[    0.000000]   node   0: [mem 0x0000000100000000-0x00000001ffffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x00000001ffffffff]
[    0.000000] On node 0 totalpages: 2061312
[    0.000000]   DMA zone: 3792 pages used for memmap
[    0.000000]   DMA zone: 0 pages reserved
[    0.000000]   DMA zone: 242688 pages, LIFO batch:63
[    0.000000]   DMA32 zone: 12288 pages used for memmap
[    0.000000]   DMA32 zone: 770048 pages, LIFO batch:63
[    0.000000]   Normal zone: 16384 pages used for memmap
[    0.000000]   Normal zone: 1048576 pages, LIFO batch:63
[    0.000000] percpu: Embedded 32 pages/cpu s91224 r8192 d31656 u131072
[    0.000000] pcpu-alloc: s91224 r8192 d31656 u131072 alloc=32*4096
[    0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3 
[    0.000000] Detected PIPT I-cache on CPU0
[    0.000000] CPU features: detected: Spectre-v2
[    0.000000] CPU features: detected: Spectre-v4
[    0.000000] CPU features: detected: ARM errata 1165522, 1319367, or 1530923
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 2028848
[    0.000000] Kernel command line: coherent_pool=1M 8250.nr_uarts=0 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1  smsc95xx.macaddr=DC:A6:32:F2:E6:94 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000  console=ttyS0,115200 console=tty1 root=PARTUUID=e933b6e4-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
[    0.000000] Kernel parameter elevator= does not have any effect anymore.
               Please use sysfs to set IO scheduler for individual devices.
[    0.000000] Dentry cache hash table entries: 1048576 (order: 11, 8388608 bytes, linear)
[    0.000000] Inode-cache hash table entries: 524288 (order: 10, 4194304 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] software IO TLB: mapped [mem 0x0000000037400000-0x000000003b400000] (64MB)
[    0.000000] Memory: 7735052K/8245248K available (10944K kernel code, 1910K rwdata, 3916K rodata, 3648K init, 1240K bss, 248052K reserved, 262144K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] ftrace: allocating 36038 entries in 141 pages
[    0.000000] ftrace: allocated 141 pages with 4 groups
[    0.000000] rcu: Preemptible hierarchical RCU implementation.
[    0.000000] rcu: 	RCU event tracing is enabled.
[    0.000000] rcu: 	RCU restricting CPUs from NR_CPUS=256 to nr_cpu_ids=4.
[    0.000000] 	Trampoline variant of Tasks RCU enabled.
[    0.000000] 	Rude variant of Tasks RCU enabled.
[    0.000000] 	Tracing variant of Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] GIC: Using split EOI/Deactivate mode
[    0.000000] random: get_random_bytes called from start_kernel+0x3b8/0x57c with crng_init=0
[    0.000000] arch_timer: cp15 timer(s) running at 54.00MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0xc743ce346, max_idle_ns: 440795203123 ns
[    0.000006] sched_clock: 56 bits at 54MHz, resolution 18ns, wraps every 4398046511102ns
[    0.000255] Console: colour dummy device 80x25
[    0.000801] printk: console [tty1] enabled
[    0.000864] Calibrating delay loop (skipped), value calculated using timer frequency.. 108.00 BogoMIPS (lpj=216000)
[    0.000905] pid_max: default: 32768 minimum: 301
[    0.001052] LSM: Security Framework initializing
[    0.001333] Mount-cache hash table entries: 16384 (order: 5, 131072 bytes, linear)
[    0.001458] Mountpoint-cache hash table entries: 16384 (order: 5, 131072 bytes, linear)
[    0.002814] Disabling memory control group subsystem
[    0.004638] rcu: Hierarchical SRCU implementation.
[    0.005662] EFI services will not be available.
[    0.006158] smp: Bringing up secondary CPUs ...
[    0.007153] Detected PIPT I-cache on CPU1
[    0.007229] CPU1: Booted secondary processor 0x0000000001 [0x410fd083]
[    0.008429] Detected PIPT I-cache on CPU2
[    0.008476] CPU2: Booted secondary processor 0x0000000002 [0x410fd083]
[    0.009511] Detected PIPT I-cache on CPU3
[    0.009558] CPU3: Booted secondary processor 0x0000000003 [0x410fd083]
[    0.009705] smp: Brought up 1 node, 4 CPUs
[    0.009791] SMP: Total of 4 processors activated.
[    0.009815] CPU features: detected: 32-bit EL0 Support
[    0.009837] CPU features: detected: CRC32 instructions
[    0.009859] CPU features: detected: 32-bit EL1 Support
[    0.044277] CPU: All CPU(s) started at EL2
[    0.044355] alternatives: patching kernel code
[    0.046333] devtmpfs: initialized
[    0.056882] Enabled cp15_barrier support
[    0.056945] Enabled setend support
[    0.057719] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.057765] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
[    0.065040] pinctrl core: initialized pinctrl subsystem
[    0.065844] DMI not present or invalid.
[    0.066222] NET: Registered protocol family 16
[    0.069346] DMA: preallocated 1024 KiB GFP_KERNEL pool for atomic allocations
[    0.069622] DMA: preallocated 1024 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations
[    0.070540] DMA: preallocated 1024 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations
[    0.070649] audit: initializing netlink subsys (disabled)
[    0.070998] audit: type=2000 audit(0.068:1): state=initialized audit_enabled=0 res=1
[    0.071503] thermal_sys: Registered thermal governor 'step_wise'
[    0.071969] cpuidle: using governor menu
[    0.072322] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[    0.072507] ASID allocator initialised with 65536 entries
[    0.072639] Serial: AMBA PL011 UART driver
[    0.101599] bcm2835-mbox fe00b880.mailbox: mailbox enabled
[    0.108345] raspberrypi-firmware soc:firmware: Attached to firmware from 2021-01-08T14:31:16, variant start
[    0.112363] raspberrypi-firmware soc:firmware: Firmware hash is 194a85abd768c7334bbadc3f1911c10a7d18ed14
[    0.145422] bcm2835-dma fe007000.dma: DMA legacy API manager, dmachans=0x1
[    0.149247] vgaarb: loaded
[    0.149686] SCSI subsystem initialized
[    0.149903] usbcore: registered new interface driver usbfs
[    0.149970] usbcore: registered new interface driver hub
[    0.150104] usbcore: registered new device driver usb
[    0.150413] usb_phy_generic phy: supply vcc not found, using dummy regulator
[    0.152169] clocksource: Switched to clocksource arch_sys_counter
[    1.168740] VFS: Disk quotas dquot_6.6.0
[    1.168859] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[    1.169071] FS-Cache: Loaded
[    1.169333] CacheFiles: Loaded
[    1.180039] NET: Registered protocol family 2
[    1.181253] tcp_listen_portaddr_hash hash table entries: 4096 (order: 4, 65536 bytes, linear)
[    1.181352] TCP established hash table entries: 65536 (order: 7, 524288 bytes, linear)
[    1.181832] TCP bind hash table entries: 65536 (order: 8, 1048576 bytes, linear)
[    1.182624] TCP: Hash tables configured (established 65536 bind 65536)
[    1.182949] UDP hash table entries: 4096 (order: 5, 131072 bytes, linear)
[    1.183107] UDP-Lite hash table entries: 4096 (order: 5, 131072 bytes, linear)
[    1.183550] NET: Registered protocol family 1
[    1.184659] RPC: Registered named UNIX socket transport module.
[    1.184688] RPC: Registered udp transport module.
[    1.184708] RPC: Registered tcp transport module.
[    1.184728] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    1.184760] PCI: CLS 0 bytes, default 64
[    1.186985] hw perfevents: enabled with armv8_cortex_a72 PMU driver, 7 counters available
[    1.187288] kvm [1]: IPA Size Limit: 44 bits
[    1.188480] kvm [1]: vgic interrupt IRQ9
[    1.188768] kvm [1]: Hyp mode initialized successfully
[    1.190997] Initialise system trusted keyrings
[    1.191342] workingset: timestamp_bits=46 max_order=21 bucket_order=0
[    1.197637] zbud: loaded
[    1.199336] FS-Cache: Netfs 'nfs' registered for caching
[    1.200020] NFS: Registering the id_resolver key type
[    1.200088] Key type id_resolver registered
[    1.200111] Key type id_legacy registered
[    1.200272] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    1.201369] Key type asymmetric registered
[    1.201395] Asymmetric key parser 'x509' registered
[    1.201452] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 249)
[    1.201756] io scheduler mq-deadline registered
[    1.201782] io scheduler kyber registered
[    1.205912] gpio-507 (ant1): hogged as output/high
[    1.207333] gpio-511 (ant2): hogged as output/low
[    1.208590] brcm-pcie fd500000.pcie: host bridge /scb/pcie@7d500000 ranges:
[    1.208632] brcm-pcie fd500000.pcie:   No bus range found for /scb/pcie@7d500000, using [bus 00-ff]
[    1.208716] brcm-pcie fd500000.pcie:      MEM 0x0600000000..0x063fffffff -> 0x00c0000000
[    1.208806] brcm-pcie fd500000.pcie:   IB MEM 0x0000000000..0x01ffffffff -> 0x0400000000
[   17.212186] brcm-pcie fd500000.pcie: link down
[   17.218775] iproc-rng200 fe104000.rng: hwrng registered
[   17.219111] vc-mem: phys_addr:0x00000000 mem_base=0x3ec00000 mem_size:0x40000000(1024 MiB)
[   17.219963] gpiomem-bcm2835 fe200000.gpiomem: Initialised: Registers at 0xfe200000
[   17.220430] cacheinfo: Unable to detect cache hierarchy for CPU 0

fruitoftheloom
Posts: 27225
Joined: Tue Mar 25, 2014 12:40 pm

Re: PCIe link down for TBS6984 Sat card

Sun Jan 24, 2021 7:27 pm

stinger1 wrote:
Sun Jan 24, 2021 4:20 pm
Hi,

i am currently trying to get a TBS 6984 sat card to run using the cm4 and the new io board
https://www.linuxtv.org/wiki/index.php/TBS6984

In my final attempt i am now also using using a pcie (mining) raiser and powering the pi + satcard +raiser card using a ATX powersupply
https://www.amazon.de/lzn-Bergbau-Exten ... 078TDYL6B/

To exclude hardware faults i tested also using a 1gbit pcie network card which operates fine and shows in lspci/dmesg

Unfortunatelly after multiple attemps with various kernels up to 5.10, i cannot get the card to show using lspci,
During dmesg i constantly get "link down"

i also tested increasing the timeout in pcie-brcmstb.c but also with very high timeout (5s) i only get pci link down.

i tested some "range" in the device tree, i found in older forum posts but also that did not bring me any further. (and i have no idea what exactly i am changing there)

can somebody please tell me what else i can try since i am out of ideas....

thanks br stinger


changes to pcie-brcmstb.c

Code: Select all

-       for (i = 0; i < 100 && !brcm_pcie_link_up(pcie); i += 5)
+       for (i = 0; i < 5000 && !brcm_pcie_link_up(pcie); i += 5)
lspci from ubuntu x86

Code: Select all

02:00.0 Multimedia controller: Philips Semiconductors SAA7160 (rev 02)
        Subsystem: Device 6984:0013
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Latency: 0, Cache Line Size: 64 bytes
        Interrupt: pin A routed to IRQ 16
        Region 0: Memory at f7600000 (64-bit, non-prefetchable) [size=1M]
        Capabilities: [40] MSI: Enable- Count=1/32 Maskable- 64bit+
                Address: 0000000000000000  Data: 0000
        Capabilities: [50] Express (v1) Endpoint, MSI 00
                DevCap: MaxPayload 128 bytes, PhantFunc 0, Latency L0s <256ns, L1 <1us
                        ExtTag- AttnBtn- AttnInd- PwrInd- RBE- FLReset- SlotPowerLimit 25.000W
                DevCtl: Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
                        RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop+
                        MaxPayload 128 bytes, MaxReadReq 128 bytes
                DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr- TransPend-
                LnkCap: Port #1, Speed 2.5GT/s, Width x1, ASPM L0s L1, Exit Latency L0s <4us, L1 <64us
                        ClockPM- Surprise- LLActRep- BwNot- ASPMOptComp-
                LnkCtl: ASPM Disabled; RCB 128 bytes Disabled- CommClk-
                        ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
                LnkSta: Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk- DLActive- BWMgmt- ABWMgmt-
        Capabilities: [74] Power Management version 2
                Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0+,D1+,D2+,D3hot-,D3cold-)
                Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
        Capabilities: [80] Vendor Specific Information: Len=50 <?>
        Capabilities: [100 v1] Vendor Specific Information: ID=0000 Rev=0 Len=088 <?>
        Kernel driver in use: SAA716x Budget
        Kernel modules: saa716x_tbs_dvb
dmesg from pi

Code: Select all

[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd083]
[    0.000000] Linux version 5.10.6-v8+ (francesco@osboxes) (aarch64-linux-gnu-gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #3 SMP PREEMPT Thu Jan 14 09:47:48 EST 2021
[    0.000000] Machine model: Raspberry Pi Compute Module 4 Rev 1.0
[    0.000000] efi: UEFI not found.
[    0.000000] Reserved memory: created CMA memory pool at 0x000000001ec00000, size 256 MiB
[    0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
[    0.000000] Zone ranges:
[    0.000000]   DMA      [mem 0x0000000000000000-0x000000003fffffff]
[    0.000000]   DMA32    [mem 0x0000000040000000-0x00000000ffffffff]
[    0.000000]   Normal   [mem 0x0000000100000000-0x00000001ffffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x000000003b3fffff]
[    0.000000]   node   0: [mem 0x0000000040000000-0x00000000fbffffff]
[    0.000000]   node   0: [mem 0x0000000100000000-0x00000001ffffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x00000001ffffffff]
[    0.000000] On node 0 totalpages: 2061312
[    0.000000]   DMA zone: 3792 pages used for memmap
[    0.000000]   DMA zone: 0 pages reserved
[    0.000000]   DMA zone: 242688 pages, LIFO batch:63
[    0.000000]   DMA32 zone: 12288 pages used for memmap
[    0.000000]   DMA32 zone: 770048 pages, LIFO batch:63
[    0.000000]   Normal zone: 16384 pages used for memmap
[    0.000000]   Normal zone: 1048576 pages, LIFO batch:63
[    0.000000] percpu: Embedded 32 pages/cpu s91224 r8192 d31656 u131072
[    0.000000] pcpu-alloc: s91224 r8192 d31656 u131072 alloc=32*4096
[    0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3 
[    0.000000] Detected PIPT I-cache on CPU0
[    0.000000] CPU features: detected: Spectre-v2
[    0.000000] CPU features: detected: Spectre-v4
[    0.000000] CPU features: detected: ARM errata 1165522, 1319367, or 1530923
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 2028848
[    0.000000] Kernel command line: coherent_pool=1M 8250.nr_uarts=0 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1  smsc95xx.macaddr=DC:A6:32:F2:E6:94 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000  console=ttyS0,115200 console=tty1 root=PARTUUID=e933b6e4-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
[    0.000000] Kernel parameter elevator= does not have any effect anymore.
               Please use sysfs to set IO scheduler for individual devices.
[    0.000000] Dentry cache hash table entries: 1048576 (order: 11, 8388608 bytes, linear)
[    0.000000] Inode-cache hash table entries: 524288 (order: 10, 4194304 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] software IO TLB: mapped [mem 0x0000000037400000-0x000000003b400000] (64MB)
[    0.000000] Memory: 7735052K/8245248K available (10944K kernel code, 1910K rwdata, 3916K rodata, 3648K init, 1240K bss, 248052K reserved, 262144K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] ftrace: allocating 36038 entries in 141 pages
[    0.000000] ftrace: allocated 141 pages with 4 groups
[    0.000000] rcu: Preemptible hierarchical RCU implementation.
[    0.000000] rcu: 	RCU event tracing is enabled.
[    0.000000] rcu: 	RCU restricting CPUs from NR_CPUS=256 to nr_cpu_ids=4.
[    0.000000] 	Trampoline variant of Tasks RCU enabled.
[    0.000000] 	Rude variant of Tasks RCU enabled.
[    0.000000] 	Tracing variant of Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] GIC: Using split EOI/Deactivate mode
[    0.000000] random: get_random_bytes called from start_kernel+0x3b8/0x57c with crng_init=0
[    0.000000] arch_timer: cp15 timer(s) running at 54.00MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0xc743ce346, max_idle_ns: 440795203123 ns
[    0.000006] sched_clock: 56 bits at 54MHz, resolution 18ns, wraps every 4398046511102ns
[    0.000255] Console: colour dummy device 80x25
[    0.000801] printk: console [tty1] enabled
[    0.000864] Calibrating delay loop (skipped), value calculated using timer frequency.. 108.00 BogoMIPS (lpj=216000)
[    0.000905] pid_max: default: 32768 minimum: 301
[    0.001052] LSM: Security Framework initializing
[    0.001333] Mount-cache hash table entries: 16384 (order: 5, 131072 bytes, linear)
[    0.001458] Mountpoint-cache hash table entries: 16384 (order: 5, 131072 bytes, linear)
[    0.002814] Disabling memory control group subsystem
[    0.004638] rcu: Hierarchical SRCU implementation.
[    0.005662] EFI services will not be available.
[    0.006158] smp: Bringing up secondary CPUs ...
[    0.007153] Detected PIPT I-cache on CPU1
[    0.007229] CPU1: Booted secondary processor 0x0000000001 [0x410fd083]
[    0.008429] Detected PIPT I-cache on CPU2
[    0.008476] CPU2: Booted secondary processor 0x0000000002 [0x410fd083]
[    0.009511] Detected PIPT I-cache on CPU3
[    0.009558] CPU3: Booted secondary processor 0x0000000003 [0x410fd083]
[    0.009705] smp: Brought up 1 node, 4 CPUs
[    0.009791] SMP: Total of 4 processors activated.
[    0.009815] CPU features: detected: 32-bit EL0 Support
[    0.009837] CPU features: detected: CRC32 instructions
[    0.009859] CPU features: detected: 32-bit EL1 Support
[    0.044277] CPU: All CPU(s) started at EL2
[    0.044355] alternatives: patching kernel code
[    0.046333] devtmpfs: initialized
[    0.056882] Enabled cp15_barrier support
[    0.056945] Enabled setend support
[    0.057719] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.057765] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
[    0.065040] pinctrl core: initialized pinctrl subsystem
[    0.065844] DMI not present or invalid.
[    0.066222] NET: Registered protocol family 16
[    0.069346] DMA: preallocated 1024 KiB GFP_KERNEL pool for atomic allocations
[    0.069622] DMA: preallocated 1024 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations
[    0.070540] DMA: preallocated 1024 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations
[    0.070649] audit: initializing netlink subsys (disabled)
[    0.070998] audit: type=2000 audit(0.068:1): state=initialized audit_enabled=0 res=1
[    0.071503] thermal_sys: Registered thermal governor 'step_wise'
[    0.071969] cpuidle: using governor menu
[    0.072322] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[    0.072507] ASID allocator initialised with 65536 entries
[    0.072639] Serial: AMBA PL011 UART driver
[    0.101599] bcm2835-mbox fe00b880.mailbox: mailbox enabled
[    0.108345] raspberrypi-firmware soc:firmware: Attached to firmware from 2021-01-08T14:31:16, variant start
[    0.112363] raspberrypi-firmware soc:firmware: Firmware hash is 194a85abd768c7334bbadc3f1911c10a7d18ed14
[    0.145422] bcm2835-dma fe007000.dma: DMA legacy API manager, dmachans=0x1
[    0.149247] vgaarb: loaded
[    0.149686] SCSI subsystem initialized
[    0.149903] usbcore: registered new interface driver usbfs
[    0.149970] usbcore: registered new interface driver hub
[    0.150104] usbcore: registered new device driver usb
[    0.150413] usb_phy_generic phy: supply vcc not found, using dummy regulator
[    0.152169] clocksource: Switched to clocksource arch_sys_counter
[    1.168740] VFS: Disk quotas dquot_6.6.0
[    1.168859] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[    1.169071] FS-Cache: Loaded
[    1.169333] CacheFiles: Loaded
[    1.180039] NET: Registered protocol family 2
[    1.181253] tcp_listen_portaddr_hash hash table entries: 4096 (order: 4, 65536 bytes, linear)
[    1.181352] TCP established hash table entries: 65536 (order: 7, 524288 bytes, linear)
[    1.181832] TCP bind hash table entries: 65536 (order: 8, 1048576 bytes, linear)
[    1.182624] TCP: Hash tables configured (established 65536 bind 65536)
[    1.182949] UDP hash table entries: 4096 (order: 5, 131072 bytes, linear)
[    1.183107] UDP-Lite hash table entries: 4096 (order: 5, 131072 bytes, linear)
[    1.183550] NET: Registered protocol family 1
[    1.184659] RPC: Registered named UNIX socket transport module.
[    1.184688] RPC: Registered udp transport module.
[    1.184708] RPC: Registered tcp transport module.
[    1.184728] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    1.184760] PCI: CLS 0 bytes, default 64
[    1.186985] hw perfevents: enabled with armv8_cortex_a72 PMU driver, 7 counters available
[    1.187288] kvm [1]: IPA Size Limit: 44 bits
[    1.188480] kvm [1]: vgic interrupt IRQ9
[    1.188768] kvm [1]: Hyp mode initialized successfully
[    1.190997] Initialise system trusted keyrings
[    1.191342] workingset: timestamp_bits=46 max_order=21 bucket_order=0
[    1.197637] zbud: loaded
[    1.199336] FS-Cache: Netfs 'nfs' registered for caching
[    1.200020] NFS: Registering the id_resolver key type
[    1.200088] Key type id_resolver registered
[    1.200111] Key type id_legacy registered
[    1.200272] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    1.201369] Key type asymmetric registered
[    1.201395] Asymmetric key parser 'x509' registered
[    1.201452] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 249)
[    1.201756] io scheduler mq-deadline registered
[    1.201782] io scheduler kyber registered
[    1.205912] gpio-507 (ant1): hogged as output/high
[    1.207333] gpio-511 (ant2): hogged as output/low
[    1.208590] brcm-pcie fd500000.pcie: host bridge /scb/pcie@7d500000 ranges:
[    1.208632] brcm-pcie fd500000.pcie:   No bus range found for /scb/pcie@7d500000, using [bus 00-ff]
[    1.208716] brcm-pcie fd500000.pcie:      MEM 0x0600000000..0x063fffffff -> 0x00c0000000
[    1.208806] brcm-pcie fd500000.pcie:   IB MEM 0x0000000000..0x01ffffffff -> 0x0400000000
[   17.212186] brcm-pcie fd500000.pcie: link down
[   17.218775] iproc-rng200 fe104000.rng: hwrng registered
[   17.219111] vc-mem: phys_addr:0x00000000 mem_base=0x3ec00000 mem_size:0x40000000(1024 MiB)
[   17.219963] gpiomem-bcm2835 fe200000.gpiomem: Initialised: Registers at 0xfe200000
[   17.220430] cacheinfo: Unable to detect cache hierarchy for CPU 0

JGeerling has undertaken some configuration of PCIe Cards:

https://pipci.jeffgeerling.com/
Take what I advise as advice not the utopian holy grail, and it is gratis !!

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 13533
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: PCIe link down for TBS6984 Sat card

Sun Jan 24, 2021 8:42 pm

Presumably you've provided power to the card through the 6pin ATX power connector, as well as connecting it to the PCI-e interface.

PCIe is supposed to be hotpluggable, and certainly when I've accidentally knocked out a card and pushed it back in again the system has done the right thing. You could try connecting your card after the Pi has booted to see if it then wakes up.

There should be nothing strange about the Pi when it comes to simple enumeration of PCIe devices.

PS I'm guessing you're stinger151 on Github who posted here, and I replied to.
Software Engineer at Raspberry Pi Ltd. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

stinger1
Posts: 6
Joined: Sun Jan 24, 2021 4:02 pm

Re: PCIe link down for TBS6984 Sat card

Mon Jan 25, 2021 9:46 am

@6by9 yes i am, i thought this is a more appropiate place to get help

i cannot confirm the hotplug theory, my testing network card does not show up if i hotplug it (neither to the 6pin powered raiser nor directly to the cm4 io board pcie)

the hardware setup is as follows atm

ATX power supply -> 6pin power to pcie raiser card
-> 6pin power to tbs card
-> 4 pin floppy to cm4 io board

i also tested the tbs card without the 6pin power in a regular x86 pc and can confirm the card does show up in lspci -vvv and then fails tuning to a channel

i compared the lspci differences between the 2 cards (NIC and SAT)

NIC:
Region 0: Memory at 600000000 (32-bit, non-prefetchable) [disabled] [size=128K]
Region 1: Memory at 600020000 (32-bit, non-prefetchable) [disabled] [size=128K]
SAT:
Region 0: Memory at f7600000 (64-bit, non-prefetchable) [size=1M]

NIC:
SlotPowerLimit 0.000W

SAT:
SlotPowerLimit 25.000W

might this be a problem?
i would think the raiser card should solve the power limit, but maybe the 1mb memory size?
can somebody suggest a range i can set in the dts file or does this not matter at this stage of the boot process (so only after pcie link is up)

stinger1
Posts: 6
Joined: Sun Jan 24, 2021 4:02 pm

Re: PCIe link down for TBS6984 Sat card

Mon Jan 25, 2021 11:54 am

hi,

i added a debug line to the brcm_pcie_link_up function in pcie-brcmstb.c#694 printing the states of the variables

for the TBS card i get constanly without any change over the full loop (~4seconds at the moment):

val:0x8f dla:0x0 plu:0x0

for the NIC it starts as
val:0x80 dla:0x0 plu:0x0
and after some microseconds it jumps to
val:0xb0 dla:0x1 plu:0x1

i am no expert on the bitmask here but maybe someone is :)

thanks for the help

stinger1
Posts: 6
Joined: Sun Jan 24, 2021 4:02 pm

Re: PCIe link down for TBS6984 Sat card

Mon Jan 25, 2021 3:03 pm

eureka!

i think i found it, for some reason the pcie->gen is set to 0

for testing i hardcoded it to 1 and sure enough, the card shows up and is visible in lspci finaly!

if there is something i can help to debug why this variable is set to 0 for this specific card i am happy to help!

Code: Select all

[    1.208988] brcm-pcie fd500000.pcie: host bridge /scb/pcie@7d500000 ranges:
[    1.209029] brcm-pcie fd500000.pcie:   No bus range found for /scb/pcie@7d500000, using [bus 00-ff]
[    1.209113] brcm-pcie fd500000.pcie:      MEM 0x0600000000..0x063fffffff -> 0x00c0000000
[    1.209203] brcm-pcie fd500000.pcie:   IB MEM 0x0000000000..0x01ffffffff -> 0x0400000000
[    1.209752] brcm-pcie fd500000.pcie: pcie->gen:0
[    1.209781] brcm-pcie fd500000.pcie: val:0x8f dla:0x0 plu:0x0
[    1.224344] brcm-pcie fd500000.pcie: val:0x8f dla:0x0 plu:0x0
[    1.240333] brcm-pcie fd500000.pcie: val:0xbf dla:0x1 plu:0x1
[    1.240359] brcm-pcie fd500000.pcie: val:0xbf dla:0x1 plu:0x1
[    1.242460] brcm-pcie fd500000.pcie: link up, 2.5 GT/s PCIe x1 (SSC)
[    1.242844] brcm-pcie fd500000.pcie: PCI host bridge to bus 0000:00
[    1.242875] pci_bus 0000:00: root bus resource [bus 00-ff]
[    1.242903] pci_bus 0000:00: root bus resource [mem 0x600000000-0x63fffffff] (bus address [0xc0000000-0xffffffff])
[    1.242998] pci 0000:00:00.0: [14e4:2711] type 01 class 0x060400
[    1.243243] pci 0000:00:00.0: PME# supported from D0 D3hot
[    1.246731] pci 0000:00:00.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[    1.246985] pci 0000:01:00.0: [1131:7160] type 00 class 0x048000
[    1.247067] pci 0000:01:00.0: reg 0x10: [mem 0x00000000-0x000fffff 64bit]
[    1.247357] pci 0000:01:00.0: supports D1 D2
[    1.247381] pci 0000:01:00.0: PME# supported from D0 D1 D2
[    1.247627] pci 0000:01:00.0: disabling ASPM on pre-1.1 PCIe device.  You can enable it with 'pcie_aspm=force'
[    1.250716] pci_bus 0000:01: busn_res: [bus 01-ff] end is updated to 01
[    1.250769] pci 0000:00:00.0: BAR 8: assigned [mem 0x600000000-0x6000fffff]
[    1.250802] pci 0000:01:00.0: BAR 0: assigned [mem 0x600000000-0x6000fffff 64bit]
[    1.250856] pci 0000:00:00.0: PCI bridge to [bus 01]
[    1.250888] pci 0000:00:00.0:   bridge window [mem 0x600000000-0x6000fffff]

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 13533
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: PCIe link down for TBS6984 Sat card

Mon Jan 25, 2021 4:17 pm

(struct brcm_pcie *pcie)->gen is 0, or some other gen variable?

(struct brcm_pcie *pcie)->gen appears to be set from https://github.com/raspberrypi/linux/bl ... tb.c#L1269, via of_pci_get_max_link_speed.
If "max-link-speed" isn't set in the DT, then you'll end up with a gen of 0.

The older text binding for brcm,stb-pcie differs from the yaml binding. The text version includes max-link-speed, but the yaml one doesn't. Our dt files don't have it.
It is listed as an optional property, so one would have hoped that a value of 0 would do something sensible.
Software Engineer at Raspberry Pi Ltd. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

stinger1
Posts: 6
Joined: Sun Jan 24, 2021 4:02 pm

Re: PCIe link down for TBS6984 Sat card

Mon Jan 25, 2021 6:56 pm

hi,

The struct pci->gen is 0 because the return of of_pci_get_max_link_speed is -22

Here my "fix" that makes the card work: (returns 1 instead of 0 if the ret is < 0)

changes:

Code: Select all

diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c
index 840f264f7a9b..da3f80f62baa 100644
--- a/drivers/pci/controller/pcie-brcmstb.c
+++ b/drivers/pci/controller/pcie-brcmstb.c
@@ -951,6 +951,8 @@ static int brcm_pcie_setup(struct brcm_pcie *pcie)
        tmp &= ~PCIE_MISC_RC_BAR3_CONFIG_LO_SIZE_MASK;
        writel(tmp, base + PCIE_MISC_RC_BAR3_CONFIG_LO);

+       dev_info(dev, "pcie->gen:%u\n",
+                 pcie->gen);
        if (pcie->gen)
                brcm_pcie_set_gen(pcie, pcie->gen);

@@ -1266,7 +1268,10 @@ static int brcm_pcie_probe(struct platform_device *pdev)
                return PTR_ERR(pcie->clk);

        ret = of_pci_get_max_link_speed(np);
-       pcie->gen = (ret < 0) ? 0 : ret;
+       dev_info(pcie->dev, "of_pci_get_max_link_speed:%d\n",
+                 ret);
+
+       pcie->gen = (ret < 0) ? 1 : ret;

        pcie->ssc = of_property_read_bool(np, "brcm,enable-ssc");
        pcie->l1ss = of_property_read_bool(np, "brcm,enable-l1ss");

Code: Select all

[    1.237591] brcm-pcie fd500000.pcie: host bridge /scb/pcie@7d500000 ranges:
[    1.237693] brcm-pcie fd500000.pcie:   No bus range found for /scb/pcie@7d500000, using [bus 00-ff]
[    1.237849] brcm-pcie fd500000.pcie:      MEM 0x0600000000..0x063fffffff -> 0x00c0000000
[    1.238005] brcm-pcie fd500000.pcie:   IB MEM 0x0000000000..0x01ffffffff -> 0x0400000000
[    1.238157] brcm-pcie fd500000.pcie: of_pci_get_max_link_speed:-22
[    1.238702] brcm-pcie fd500000.pcie: pcie->gen:1
[    1.270232] brcm-pcie fd500000.pcie: link up, 2.5 GT/s PCIe x1 (SSC)
[    1.270667] brcm-pcie fd500000.pcie: PCI host bridge to bus 0000:00

I will try to understand the device tree links you mentioned and how this can happen only with one card but not with the other?

stinger1
Posts: 6
Joined: Sun Jan 24, 2021 4:02 pm

[solved] Re: PCIe link down for TBS6984 Sat card

Tue Jan 26, 2021 8:22 pm

in fact you are right this is all that is needed,

why one card works and the other one not is a mistery to me, but ok i dont have to understand everything :)

anyway i could get the card to stream and work correctly

thanks for the help

diff --git a/arch/arm/boot/dts/bcm2711-rpi-cm4.dts b/arch/arm/boot/dts/bcm2711-rpi-cm4.dts
index 7ab0aba5f1a3..edeef159ff3d 100644
--- a/arch/arm/boot/dts/bcm2711-rpi-cm4.dts
+++ b/arch/arm/boot/dts/bcm2711-rpi-cm4.dts
@@ -544,6 +544,7 @@ __overrides__ {

&pcie0 {
brcm,enable-l1ss;
+ max-link-speed = <1>;
};

&sdhost {

ziporah
Posts: 5
Joined: Sat Feb 06, 2021 6:26 pm

Re: PCIe link down for TBS6984 Sat card

Mon Feb 08, 2021 8:13 pm

Hey Stinger1

can you tell me which driver you are using and how you build it for your cm4?
I borrowed my brothers TBS ( the same number as yours ) card and would love to test if it works on my cm4

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 13533
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: PCIe link down for TBS6984 Sat card

Sun Mar 14, 2021 7:51 pm

Just a quick thanks to Stinger1 as I've just tried a TBS6284 quad DVB-T2 card and it was reporting "link down". It rang bells and a quick search came back to this thread.
The same solution works for that card too - not too unsurprising as they both use the SAA7160 PCIe bridge chip.
Software Engineer at Raspberry Pi Ltd. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 13533
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: PCIe link down for TBS6984 Sat card

Sun Mar 14, 2021 7:52 pm

ziporah wrote:
Mon Feb 08, 2021 8:13 pm
Hey Stinger1

can you tell me which driver you are using and how you build it for your cm4?
I borrowed my brothers TBS ( the same number as yours ) card and would love to test if it works on my cm4
You probably need to look at https://github.com/tbsdtv/linux_media/wiki.
TBS have elected to not upstream their drivers, so you have to build them out of tree.
Software Engineer at Raspberry Pi Ltd. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

livs
Posts: 4
Joined: Fri Oct 25, 2013 9:38 am
Location: Valcea, Romania

Re: PCIe link down for TBS6984 Sat card

Sat Sep 11, 2021 5:59 am

Hi,

I try to make working a TBS card (dvb-c TBS 6221) with Libreelec and I have pcie link down.
I did find this topic, but as I am a total noob, please guide me what I have to do to.
My understanding is it is required to patch bcm2711-rpi-cm4.dts.
How to do that?
Is any file already patched available?

Thank you

Return to “Compute Module”