Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mpc85xx: TP-Link TL-WDR4900 v1 ~~resurrect~~ and convert to DSA #10850

Merged
merged 2 commits into from Feb 20, 2023

Conversation

CHKDSK88
Copy link
Contributor

@CHKDSK88 CHKDSK88 commented Sep 29, 2022

This patch series bring up to life TP-Link TL-WDR4900 v1.

It was disabled due too big kernel. First patch is complete solution for u-boot patch (like cfe79f2) to allow boot 6MB kernels.

Second patch is simple config refresh.

Last one switch from swconfig to DSA.

@CHKDSK88 CHKDSK88 changed the title mpc85xx: Tl wdr4900 v1 resurrect and convert to DSA mpc85xx: TP-Link TL-WDR4900 v1 resurrect and convert to DSA Sep 29, 2022
@github-actions github-actions bot added kernel pull request/issue with Linux kernel related changes target/mpc85xx pull request/issue for mpc85xx target labels Sep 29, 2022
@Ansuel
Copy link
Member

Ansuel commented Sep 29, 2022

Wow dsa work good?

@CHKDSK88
Copy link
Contributor Author

DSA status response is quite slow:

U-Boot 2010.12-svn19826 (Apr 24 2013 - 20:01:21)

CPU:   P1014, Version: 1.0, (0x80f10110)
Core:  E500, Version: 5.1, (0x80212151)
Clock Configuration:
       CPU0:800  MHz,
       CCB:400  MHz,
       DDR:333.333 MHz (666.667 MT/s data rate) (Asynchronous), IFC:100  MHz
L1:    D-cache 32 kB enabled
       I-cache 32 kB enabled
Board: P1014RDB
SPI:   ready
DRAM:  128 MiB
L2:    256 KB enabled
Using default environment

PCIe1: Root Complex of mini PCIe Slot, x1, regs @ 0xffe0a000
  01:00.0     - 168c:abcd - Network controller
PCIe1: Bus 00 - 01
PCIe2: Root Complex of PCIe Slot, x1, regs @ 0xffe09000
  03:00.0     - 168c:0033 - Network controller
PCIe2: Bus 02 - 03
In:    serial
Out:   serial
Err:   serial
Net:   initialization for Atheros AR8327/AR8328
eTSEC1
auto update firmware: is_auto_upload_firmware = 0!
Autobooting in 1 seconds
SF: Detected S25FL128S_64K with page size 256, total 16 MiB
16384 KiB S25FL128S_64K at 0:0 is now current device
SPI flash read successful
SPI flash read successful
## Booting kernel from Legacy Image at 02000000 ...
   Image Name:   POWERPC OpenWrt Linux-5.15.69
   Image Type:   PowerPC Linux Kernel Image (uncompressed)
   Data Size:    3208000 Bytes = 3.1 MiB
   Load Address: 01000000
   Entry Point:  01000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 03000000
   Booting using the fdt blob at 0x3000000
   Loading Kernel Image ... OK
OK
   Loading Device Tree to 00ffa000, end 00ffffff ... OK
[    0.000000] Memory CAM mapping: 64/64 Mb, residual: 0Mb
[    0.000000] Linux version 5.15.69 (krolik@WBEC678) (powerpc-openwrt-linux-musl-gcc (OpenWrt GCC 11.3.0 r18878+1912-a93dfff10e06) 11.3.0, GNU ld (GNU Binutils) 2.37) #0 Fri Sep 30 06:23:09 2022
[    0.000000] Using Freescale P1014 machine description
[    0.000000] -----------------------------------------------------
[    0.000000] phys_mem_size     = 0x8000000
[    0.000000] dcache_bsize      = 0x20
[    0.000000] icache_bsize      = 0x20
[    0.000000] cpu_features      = 0x0000000010010108
[    0.000000]   possible        = 0x0000000010010108
[    0.000000]   always          = 0x0000000010010108
[    0.000000] cpu_user_features = 0x84e08000 0x08000000
[    0.000000] mmu_features      = 0x00020010
[    0.000000] -----------------------------------------------------
[    0.000000] TL-WDR4900 v1 board from TP-Link
[    0.000000] barrier-nospec: using isync; sync as speculation barrier
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] MMU: Allocated 1088 bytes of context maps for 255 contexts
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 32480
[    0.000000] Kernel command line: console=ttyS0,115200
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes, linear)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Kernel virtual memory layout:
[    0.000000]   * 0xffbdf000..0xfffff000  : fixmap
[    0.000000]   * 0xc9000000..0xffbdf000  : vmalloc & ioremap
[    0.000000] Memory: 54116K/131072K available (7124K kernel code, 664K rwdata, 1468K rodata, 172K init, 233K bss, 76956K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 512, nr_irqs: 512, preallocated irqs: 16
[    0.000000] mpic: Setting up MPIC " OpenPIC  " version 1.2 at ffe40000, max 1 CPUs
[    0.000000] mpic: ISU size: 256, shift: 8, mask: ff
[    0.000000] mpic: Initializing for 256 sources
[    0.000006] clocksource: timebase: mask: 0xffffffffffffffff max_cycles: 0xb88126fc8, max_idle_ns: 440795204701 ns
[    0.000020] clocksource: timebase mult[14000007] shift[24] registered
[    0.000118] pid_max: default: 32768 minimum: 301
[    0.000267] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.000290] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.001578] dyndbg: Ignore empty _ddebug table in a CONFIG_DYNAMIC_DEBUG_CORE build
[    0.003716] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.003750] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[    0.004744] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.005359] thermal_sys: Registered thermal governor 'step_wise'
[    0.010905] Found FSL PCI host bridge at 0x00000000ffe09000. Firmware bus number: 0->255
[    0.010932] PCI host bridge /pcie@ffe09000 (primary) ranges:
[    0.010956]  MEM 0x00000000a0000000..0x00000000bfffffff -> 0x00000000a0000000
[    0.010969]   IO 0x00000000ffc10000..0x00000000ffc1ffff -> 0x0000000000000000
[    0.010999] /pcie@ffe09000: PCICSRBAR @ 0xfff00000
[    0.011013] setup_pci_atmu: end of DRAM 8000000
[    0.011431] Found FSL PCI host bridge at 0x00000000ffe0a000. Firmware bus number: 0->255
[    0.011448] PCI host bridge /pcie@ffe0a000  ranges:
[    0.011469]  MEM 0x0000000080000000..0x000000009fffffff -> 0x0000000080000000
[    0.011482]   IO 0x00000000ffc00000..0x00000000ffc0ffff -> 0x0000000000000000
[    0.011505] /pcie@ffe0a000: PCICSRBAR @ 0xfff00000
[    0.011519] setup_pci_atmu: end of DRAM 8000000
[    0.013346] software IO TLB: tearing down default memory pool
[    0.021795] PCI: Probing PCI hardware
[    0.021941] fsl-pci ffe09000.pcie: PCI host bridge to bus 9000:00
[    0.021963] pci_bus 9000:00: root bus resource [io  0x0000-0xffff]
[    0.021979] pci_bus 9000:00: root bus resource [mem 0xa0000000-0xbfffffff]
[    0.021994] pci_bus 9000:00: root bus resource [bus 00-ff]
[    0.022007] pci_bus 9000:00: busn_res: [bus 00-ff] end is updated to ff
[    0.022059] pci 9000:00:00.0: [1957:012b] type 01 class 0x060400
[    0.022083] pci 9000:00:00.0: reg 0x10: [mem 0xfff00000-0xffffffff]
[    0.022156] pci 9000:00:00.0: supports D1 D2
[    0.022168] pci 9000:00:00.0: PME# supported from D0 D1 D2 D3hot D3cold
[    0.023284] pci 9000:01:00.0: [168c:0033] type 00 class 0x028000
[    0.023323] pci 9000:01:00.0: reg 0x10: [mem 0xa0000000-0xa001ffff 64bit]
[    0.023369] pci 9000:01:00.0: reg 0x30: [mem 0x00000000-0x0000ffff pref]
[    0.023458] pci 9000:01:00.0: supports D1
[    0.023469] pci 9000:01:00.0: PME# supported from D0 D1 D3hot
[    0.050892] pci 9000:00:00.0: PCI bridge to [bus 01-ff]
[    0.050919] pci 9000:00:00.0:   bridge window [mem 0xa0000000-0xa00fffff]
[    0.050940] pci_bus 9000:01: busn_res: [bus 01-ff] end is updated to 01
[    0.050957] pci_bus 9000:00: busn_res: [bus 00-ff] end is updated to 01
[    0.051140] fsl-pci ffe0a000.pcie: PCI host bridge to bus a000:02
[    0.051158] pci_bus a000:02: root bus resource [io  0x20000-0x2ffff] (bus address [0x0000-0xffff])
[    0.051173] pci_bus a000:02: root bus resource [mem 0x80000000-0x9fffffff]
[    0.051186] pci_bus a000:02: root bus resource [bus 02-ff]
[    0.051199] pci_bus a000:02: busn_res: [bus 02-ff] end is updated to ff
[    0.051237] pci a000:02:00.0: [1957:012b] type 01 class 0x060400
[    0.051258] pci a000:02:00.0: reg 0x10: [mem 0xfff00000-0xffffffff]
[    0.051310] pci a000:02:00.0: supports D1 D2
[    0.051322] pci a000:02:00.0: PME# supported from D0 D1 D2 D3hot D3cold
[    0.052246] pci a000:02:00.0: Primary bus is hard wired to 0
[    0.052261] pci a000:02:00.0: bridge configuration invalid ([bus 01-01]), reconfiguring
[    0.052376] pci a000:03:00.0: AR9381 fixup applied
[    0.052391] pci a000:03:00.0: [168c:0030] type 00 class 0x028000
[    0.052421] pci a000:03:00.0: reg 0x10: [mem 0x80000000-0x8001ffff 64bit]
[    0.052466] pci a000:03:00.0: reg 0x30: [mem 0x00000000-0x0000ffff pref]
[    0.052554] pci a000:03:00.0: supports D1
[    0.052565] pci a000:03:00.0: PME# supported from D0 D1 D3hot
[    0.080907] pci a000:02:00.0: PCI bridge to [bus 03-ff]
[    0.080932] pci a000:02:00.0:   bridge window [mem 0x80000000-0x800fffff]
[    0.080954] pci_bus a000:03: busn_res: [bus 03-ff] end is updated to 03
[    0.080970] pci_bus a000:02: busn_res: [bus 02-ff] end is updated to 03
[    0.081073] PCI: Cannot allocate resource region 0 of device 9000:00:00.0, will remap
[    0.081093] PCI: Cannot allocate resource region 0 of device a000:02:00.0, will remap
[    0.081147] pci 9000:00:00.0: BAR 0: no space for [mem size 0x00100000]
[    0.081161] pci 9000:00:00.0: BAR 0: failed to assign [mem size 0x00100000]
[    0.081178] pci 9000:01:00.0: BAR 6: assigned [mem 0xa0020000-0xa002ffff pref]
[    0.081194] pci 9000:00:00.0: PCI bridge to [bus 01]
[    0.081206] pci 9000:00:00.0:   bridge window [io  0x0000-0xffff]
[    0.081219] pci 9000:00:00.0:   bridge window [mem 0xa0000000-0xbfffffff]
[    0.081233] pci_bus 9000:00: Some PCI device resources are unassigned, try booting with pci=realloc
[    0.081244] pci_bus 9000:00: resource 4 [io  0x0000-0xffff]
[    0.081257] pci_bus 9000:00: resource 5 [mem 0xa0000000-0xbfffffff]
[    0.081270] pci_bus 9000:01: resource 0 [io  0x0000-0xffff]
[    0.081282] pci_bus 9000:01: resource 1 [mem 0xa0000000-0xbfffffff]
[    0.081299] pci a000:02:00.0: BAR 0: no space for [mem size 0x00100000]
[    0.081312] pci a000:02:00.0: BAR 0: failed to assign [mem size 0x00100000]
[    0.081327] pci a000:03:00.0: BAR 6: assigned [mem 0x80020000-0x8002ffff pref]
[    0.081341] pci a000:02:00.0: PCI bridge to [bus 03]
[    0.081353] pci a000:02:00.0:   bridge window [io  0x20000-0x2ffff]
[    0.081366] pci a000:02:00.0:   bridge window [mem 0x80000000-0x9fffffff]
[    0.081379] pci_bus a000:02: Some PCI device resources are unassigned, try booting with pci=realloc
[    0.081389] pci_bus a000:02: resource 4 [io  0x20000-0x2ffff]
[    0.081402] pci_bus a000:02: resource 5 [mem 0x80000000-0x9fffffff]
[    0.081415] pci_bus a000:03: resource 0 [io  0x20000-0x2ffff]
[    0.081427] pci_bus a000:03: resource 1 [mem 0x80000000-0x9fffffff]
[    0.085811] EDAC MC: Ver: 3.0.0
[    0.087055] clocksource: Switched to clocksource timebase
[    0.087665] NET: Registered PF_INET protocol family
[    0.087824] IP idents hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.088301] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.088339] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.088355] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.088375] TCP bind hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.088394] TCP: Hash tables configured (established 1024 bind 1024)
[    0.088479] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.088509] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.088696] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.088778] PCI: CLS 32 bytes, default 32
[    0.090461] workingset: timestamp_bits=14 max_order=15 bucket_order=1
[    0.094357] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.094381] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.094975] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 251)
[    0.113313] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[    0.114824] printk: console [ttyS0] disabled
[    0.114880] serial8250.0: ttyS0 at MMIO 0xffe04500 (irq = 42, base_baud = 24999999) is a 16550A
[    1.087157] printk: console [ttyS0] enabled
[    1.092014] printk: console [ttyS0] disabled
[    0.000000] Memory CAM mapping: 64/64 Mb, residual: 0Mb
[    0.000000] Linux version 5.15.69 (krolik@WBEC678) (powerpc-openwrt-linux-musl-gcc (OpenWrt GCC 11.3.0 r18878+1912-a93dfff10e06) 11.3.0, GNU ld (GNU Binutils) 2.37) #0 Fri Sep 30 06:23:09 2022
[    0.000000] Using Freescale P1014 machine description
[    0.000000] -----------------------------------------------------
[    0.000000] phys_mem_size     = 0x8000000
[    0.000000] dcache_bsize      = 0x20
[    0.000000] icache_bsize      = 0x20
[    0.000000] cpu_features      = 0x0000000010010108
[    0.000000]   possible        = 0x0000000010010108
[    0.000000]   always          = 0x0000000010010108
[    0.000000] cpu_user_features = 0x84e08000 0x08000000
[    0.000000] mmu_features      = 0x00020010
[    0.000000] -----------------------------------------------------
[    0.000000] TL-WDR4900 v1 board from TP-Link
[    0.000000] barrier-nospec: using isync; sync as speculation barrier
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] MMU: Allocated 1088 bytes of context maps for 255 contexts
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 32480
[    0.000000] Kernel command line: console=ttyS0,115200
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes, linear)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Kernel virtual memory layout:
[    0.000000]   * 0xffbdf000..0xfffff000  : fixmap
[    0.000000]   * 0xc9000000..0xffbdf000  : vmalloc & ioremap
[    0.000000] Memory: 54116K/131072K available (7124K kernel code, 664K rwdata, 1468K rodata, 172K init, 233K bss, 76956K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 512, nr_irqs: 512, preallocated irqs: 16
[    0.000000] mpic: Setting up MPIC " OpenPIC  " version 1.2 at ffe40000, max 1 CPUs
[    0.000000] mpic: ISU size: 256, shift: 8, mask: ff
[    0.000000] mpic: Initializing for 256 sources
[    0.000006] clocksource: timebase: mask: 0xffffffffffffffff max_cycles: 0xb88126fc8, max_idle_ns: 440795204701 ns
[    0.000020] clocksource: timebase mult[14000007] shift[24] registered
[    0.000118] pid_max: default: 32768 minimum: 301
[    0.000267] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.000290] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.001578] dyndbg: Ignore empty _ddebug table in a CONFIG_DYNAMIC_DEBUG_CORE build
[    0.003716] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.003750] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[    0.004744] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.005359] thermal_sys: Registered thermal governor 'step_wise'
[    0.010905] Found FSL PCI host bridge at 0x00000000ffe09000. Firmware bus number: 0->255
[    0.010932] PCI host bridge /pcie@ffe09000 (primary) ranges:
[    0.010956]  MEM 0x00000000a0000000..0x00000000bfffffff -> 0x00000000a0000000
[    0.010969]   IO 0x00000000ffc10000..0x00000000ffc1ffff -> 0x0000000000000000
[    0.010999] /pcie@ffe09000: PCICSRBAR @ 0xfff00000
[    0.011013] setup_pci_atmu: end of DRAM 8000000
[    0.011431] Found FSL PCI host bridge at 0x00000000ffe0a000. Firmware bus number: 0->255
[    0.011448] PCI host bridge /pcie@ffe0a000  ranges:
[    0.011469]  MEM 0x0000000080000000..0x000000009fffffff -> 0x0000000080000000
[    0.011482]   IO 0x00000000ffc00000..0x00000000ffc0ffff -> 0x0000000000000000
[    0.011505] /pcie@ffe0a000: PCICSRBAR @ 0xfff00000
[    0.011519] setup_pci_atmu: end of DRAM 8000000
[    0.013346] software IO TLB: tearing down default memory pool
[    0.021795] PCI: Probing PCI hardware
[    0.021941] fsl-pci ffe09000.pcie: PCI host bridge to bus 9000:00
[    0.021963] pci_bus 9000:00: root bus resource [io  0x0000-0xffff]
[    0.021979] pci_bus 9000:00: root bus resource [mem 0xa0000000-0xbfffffff]
[    0.021994] pci_bus 9000:00: root bus resource [bus 00-ff]
[    0.022007] pci_bus 9000:00: busn_res: [bus 00-ff] end is updated to ff
[    0.022059] pci 9000:00:00.0: [1957:012b] type 01 class 0x060400
[    0.022083] pci 9000:00:00.0: reg 0x10: [mem 0xfff00000-0xffffffff]
[    0.022156] pci 9000:00:00.0: supports D1 D2
[    0.022168] pci 9000:00:00.0: PME# supported from D0 D1 D2 D3hot D3cold
[    0.023284] pci 9000:01:00.0: [168c:0033] type 00 class 0x028000
[    0.023323] pci 9000:01:00.0: reg 0x10: [mem 0xa0000000-0xa001ffff 64bit]
[    0.023369] pci 9000:01:00.0: reg 0x30: [mem 0x00000000-0x0000ffff pref]
[    0.023458] pci 9000:01:00.0: supports D1
[    0.023469] pci 9000:01:00.0: PME# supported from D0 D1 D3hot
[    0.050892] pci 9000:00:00.0: PCI bridge to [bus 01-ff]
[    0.050919] pci 9000:00:00.0:   bridge window [mem 0xa0000000-0xa00fffff]
[    0.050940] pci_bus 9000:01: busn_res: [bus 01-ff] end is updated to 01
[    0.050957] pci_bus 9000:00: busn_res: [bus 00-ff] end is updated to 01
[    0.051140] fsl-pci ffe0a000.pcie: PCI host bridge to bus a000:02
[    0.051158] pci_bus a000:02: root bus resource [io  0x20000-0x2ffff] (bus address [0x0000-0xffff])
[    0.051173] pci_bus a000:02: root bus resource [mem 0x80000000-0x9fffffff]
[    0.051186] pci_bus a000:02: root bus resource [bus 02-ff]
[    0.051199] pci_bus a000:02: busn_res: [bus 02-ff] end is updated to ff
[    0.051237] pci a000:02:00.0: [1957:012b] type 01 class 0x060400
[    0.051258] pci a000:02:00.0: reg 0x10: [mem 0xfff00000-0xffffffff]
[    0.051310] pci a000:02:00.0: supports D1 D2
[    0.051322] pci a000:02:00.0: PME# supported from D0 D1 D2 D3hot D3cold
[    0.052246] pci a000:02:00.0: Primary bus is hard wired to 0
[    0.052261] pci a000:02:00.0: bridge configuration invalid ([bus 01-01]), reconfiguring
[    0.052376] pci a000:03:00.0: AR9381 fixup applied
[    0.052391] pci a000:03:00.0: [168c:0030] type 00 class 0x028000
[    0.052421] pci a000:03:00.0: reg 0x10: [mem 0x80000000-0x8001ffff 64bit]
[    0.052466] pci a000:03:00.0: reg 0x30: [mem 0x00000000-0x0000ffff pref]
[    0.052554] pci a000:03:00.0: supports D1
[    0.052565] pci a000:03:00.0: PME# supported from D0 D1 D3hot
[    0.080907] pci a000:02:00.0: PCI bridge to [bus 03-ff]
[    0.080932] pci a000:02:00.0:   bridge window [mem 0x80000000-0x800fffff]
[    0.080954] pci_bus a000:03: busn_res: [bus 03-ff] end is updated to 03
[    0.080970] pci_bus a000:02: busn_res: [bus 02-ff] end is updated to 03
[    0.081073] PCI: Cannot allocate resource region 0 of device 9000:00:00.0, will remap
[    0.081093] PCI: Cannot allocate resource region 0 of device a000:02:00.0, will remap
[    0.081147] pci 9000:00:00.0: BAR 0: no space for [mem size 0x00100000]
[    0.081161] pci 9000:00:00.0: BAR 0: failed to assign [mem size 0x00100000]
[    0.081178] pci 9000:01:00.0: BAR 6: assigned [mem 0xa0020000-0xa002ffff pref]
[    0.081194] pci 9000:00:00.0: PCI bridge to [bus 01]
[    0.081206] pci 9000:00:00.0:   bridge window [io  0x0000-0xffff]
[    0.081219] pci 9000:00:00.0:   bridge window [mem 0xa0000000-0xbfffffff]
[    0.081233] pci_bus 9000:00: Some PCI device resources are unassigned, try booting with pci=realloc
[    0.081244] pci_bus 9000:00: resource 4 [io  0x0000-0xffff]
[    0.081257] pci_bus 9000:00: resource 5 [mem 0xa0000000-0xbfffffff]
[    0.081270] pci_bus 9000:01: resource 0 [io  0x0000-0xffff]
[    0.081282] pci_bus 9000:01: resource 1 [mem 0xa0000000-0xbfffffff]
[    0.081299] pci a000:02:00.0: BAR 0: no space for [mem size 0x00100000]
[    0.081312] pci a000:02:00.0: BAR 0: failed to assign [mem size 0x00100000]
[    0.081327] pci a000:03:00.0: BAR 6: assigned [mem 0x80020000-0x8002ffff pref]
[    0.081341] pci a000:02:00.0: PCI bridge to [bus 03]
[    0.081353] pci a000:02:00.0:   bridge window [io  0x20000-0x2ffff]
[    0.081366] pci a000:02:00.0:   bridge window [mem 0x80000000-0x9fffffff]
[    0.081379] pci_bus a000:02: Some PCI device resources are unassigned, try booting with pci=realloc
[    0.081389] pci_bus a000:02: resource 4 [io  0x20000-0x2ffff]
[    0.081402] pci_bus a000:02: resource 5 [mem 0x80000000-0x9fffffff]
[    0.081415] pci_bus a000:03: resource 0 [io  0x20000-0x2ffff]
[    0.081427] pci_bus a000:03: resource 1 [mem 0x80000000-0x9fffffff]
[    0.085811] EDAC MC: Ver: 3.0.0
[    0.087055] clocksource: Switched to clocksource timebase
[    0.087665] NET: Registered PF_INET protocol family
[    0.087824] IP idents hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.088301] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.088339] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.088355] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.088375] TCP bind hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.088394] TCP: Hash tables configured (established 1024 bind 1024)
[    0.088479] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.088509] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.088696] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.088778] PCI: CLS 32 bytes, default 32
[    0.090461] workingset: timestamp_bits=14 max_order=15 bucket_order=1
[    0.094357] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.094381] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.094975] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 251)
[    0.113313] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[    0.114824] printk: console [ttyS0] disabled
[    0.114880] serial8250.0: ttyS0 at MMIO 0xffe04500 (irq = 42, base_baud = 24999999) is a 16550A
[    1.087157] printk: console [ttyS0] enabled
[    1.092014] printk: console [ttyS0] disabled
[    1.096358] ffe04500.serial: ttyS0 at MMIO 0xffe04500 (irq = 42, base_baud = 24999999) is a 16550
[    2.007690] printk: console [ttyS0] enabled
[    2.012646] fsl_espi ffe07000.spi: cs=0, init_csmode=0x100008
[    2.020650] spi-nor spi0.0: s25fl128s1 (16384 Kbytes)
[    2.026074] 5 fixed-partitions partitions found on MTD device spi0.0
[    2.032487] OF: Bad cell count for /soc@ffe00000/spi@7000/flash@0/partitions
[    2.039583] OF: Bad cell count for /soc@ffe00000/spi@7000/flash@0/partitions
[    2.046872] OF: Bad cell count for /soc@ffe00000/spi@7000/flash@0/partitions
[    2.053958] OF: Bad cell count for /soc@ffe00000/spi@7000/flash@0/partitions
[    2.061123] Creating 5 MTD partitions on "spi0.0":
[    2.065920] 0x000000000000-0x000000050000 : "u-boot"
[    2.072332] 0x000000050000-0x000000060000 : "dtb"
[    2.077660] 0x000000060000-0x000000fe0000 : "firmware"
[    2.084200] 2 tplink-fw partitions found on MTD device firmware
[    2.090172] Creating 2 MTD partitions on "firmware":
[    2.095136] 0x000000000000-0x00000030f580 : "kernel"
[    2.100104] mtd: partition "kernel" doesn't end on an erase/write block -- force read-only
[    2.109335] 0x00000030f580-0x000000f80000 : "rootfs"
[    2.114312] mtd: partition "rootfs" doesn't start on an erase/write block boundary -- force read-only
[    2.124065] mtd: device 4 (rootfs) set to be root filesystem
[    2.130204] 1 squashfs-split partitions found on MTD device rootfs
[    2.136397] 0x0000006a0000-0x000000f80000 : "rootfs_data"
[    2.142414] 0x000000fe0000-0x000000ff0000 : "config"
[    2.148636] 0x000000ff0000-0x000001000000 : "caldata"
[    2.156155] fsl_espi ffe07000.spi: irq = 59
[    2.178715] fsl-gianfar soc@ffe00000:ethernet@b0000: enabled errata workarounds, flags: 0x4
[    2.197332] fsl-gianfar soc@ffe00000:ethernet@b0000 eth0: mac: 64:66:b3:de:ef:b5
[    2.204735] fsl-gianfar soc@ffe00000:ethernet@b0000 eth0: Running with NAPI enabled
[    2.212401] fsl-gianfar soc@ffe00000:ethernet@b0000 eth0: RX BD ring size for Q[0]: 256
[    2.220411] fsl-gianfar soc@ffe00000:ethernet@b0000 eth0: TX BD ring size for Q[0]: 256
[    2.228645] ucc_geth_driver: QE UCC Gigabit Ethernet Controller
[    2.234877] mpc-i2c ffe03000.i2c: timeout 1000000 us
[    2.240027] mpc-i2c ffe03100.i2c: timeout 1000000 us
[    2.245196] booke_wdt: powerpc book-e watchdog driver loaded
[    2.250981] Freescale(R) MPC85xx EDAC driver, (C) 2006 Montavista Software
[    2.258669] EDAC PCI0: Giving out device to module MPC85xx_edac controller mpc85xx_pci_err: DEV mpc85xx-pci-edac.0.auto (INTERRUPT)
[    2.270544] MPC85xx_edac acquired irq 16 for PCI Err
[    2.275505] MPC85xx_edac PCI err registered
[    2.279758] EDAC PCI1: Giving out device to module MPC85xx_edac controller mpc85xx_pci_err: DEV mpc85xx-pci-edac.1.auto (INTERRUPT)
[    2.291612] MPC85xx_edac acquired irq 16 for PCI Err
[    2.296573] MPC85xx_edac PCI err registered
[    2.301341] NET: Registered PF_INET6 protocol family
[    2.311022] Segment Routing with IPv6
[    2.314742] In-situ OAM (IOAM) with IPv6
[    2.318760] NET: Registered PF_PACKET protocol family
[    2.323852] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[    2.336990] 8021q: 802.1Q VLAN Support v1.8
[    2.341237] drmem: No dynamic reconfiguration memory found
[    2.429127] device eth0 entered promiscuous mode
[    2.438915] qca8k mdio@ffe24000:10: configuring for fixed/rgmii-id link mode
[    2.449182] qca8k mdio@ffe24000:10: Link is Up - 1Gbps/Full - flow control off
[    2.528223] qca8k mdio@ffe24000:10 wan (uninitialized): PHY [mdio@ffe24000:00] driver [Qualcomm Atheros 8327-B internal PHY] (irq=POLL)
[    2.618232] qca8k mdio@ffe24000:10 lan1 (uninitialized): PHY [mdio@ffe24000:01] driver [Qualcomm Atheros 8327-B internal PHY] (irq=POLL)
[    2.708230] qca8k mdio@ffe24000:10 lan2 (uninitialized): PHY [mdio@ffe24000:02] driver [Qualcomm Atheros 8327-B internal PHY] (irq=POLL)
[    2.798232] qca8k mdio@ffe24000:10 lan3 (uninitialized): PHY [mdio@ffe24000:03] driver [Qualcomm Atheros 8327-B internal PHY] (irq=POLL)
[    2.888231] qca8k mdio@ffe24000:10 lan4 (uninitialized): PHY [mdio@ffe24000:04] driver [Qualcomm Atheros 8327-B internal PHY] (irq=POLL)
[    2.905922] DSA: tree 0 setup
[    2.914339] VFS: Mounted root (squashfs filesystem) readonly on device 31:4.
[    2.921946] Freeing unused kernel image (initmem) memory: 172K
[    2.927810] This architecture does not have kernel memory protection.
[    2.934250] Run /sbin/init as init process
[    3.116117] random: crng init done
[    3.325368] init: Console is alive
[    3.329041] init: - watchdog -
[    4.049419] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    4.100489] usbcore: registered new interface driver usbfs
[    4.106027] usbcore: registered new interface driver hub
[    4.111421] usbcore: registered new device driver usb
[    4.120242] Button Hotplug driver version 0.4.1
[    4.126628] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    4.134120] ehci-fsl: Freescale EHCI Host controller driver
[    4.141003] ehci-platform: EHCI generic platform driver
[    4.147512] fsl-ehci fsl-ehci.0: Freescale On-Chip EHCI Host Controller
[    4.154158] fsl-ehci fsl-ehci.0: new USB bus registered, assigned bus number 1
[    4.171287] fsl-ehci fsl-ehci.0: irq 28, io mem 0xffe22000
[    4.197075] fsl-ehci fsl-ehci.0: USB 2.0 started, EHCI 1.00
[    4.203210] hub 1-0:1.0: USB hub found
[    4.207356] hub 1-0:1.0: 1 port detected
[    4.215075] input: buttons as /devices/platform/buttons/input/input0
[    4.223917] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    4.232212] init: - preinit -
[    4.497092] usb 1-1: new high-speed USB device number 2 using fsl-ehci
[    4.709971] hub 1-1:1.0: USB hub found
[    4.714180] hub 1-1:1.0: 4 ports detected
[    4.869001] fsl-gianfar soc@ffe00000:ethernet@b0000 eth0: Link is Up - 1Gbps/Full - flow control off
[    4.882632] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
Press the [f] key and hit [enter] to enter failsafe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
[    7.081874] jffs2: notice: (855) jffs2_build_xattr_subsystem: complete building xattr subsystem, 26 of xdatum (23 unchecked, 1 orphan) and 34 of xref (1 dead, 0 orphan) found.
[    7.100795] mount_root: switching to jffs2 overlay
[    7.111759] overlayfs: upper fs does not support tmpfile.
[    7.137824] urandom-seed: Seeding with /etc/urandom.seed
[    7.245373] fsl-gianfar soc@ffe00000:ethernet@b0000 eth0: Link is Down
[    7.262709] procd: - early -
[    7.265727] procd: - watchdog -
[    8.220906] procd: - watchdog -
[    8.224428] procd: - ubus -
[    8.292793] procd: - init -
Please press Enter to activate this console.
[    8.895230] kmodloader: loading kernel modules from /etc/modules.d/*
[    9.276255] urngd: v1.0.2 started.
[    9.399869] Loading modules backported from Linux version v5.15.58-0-g7d8048d4e064
[    9.407485] Backport generated by backports.git v5.15.58-1-0-g42a95ce7
[    9.688532] PPP generic driver version 2.4.2
[    9.695292] NET: Registered PF_PPPOX protocol family
[    9.744461] ieee80211 phy0: Atheros AR9300 Rev:4 mem=0xc95a0000, irq=17
[    9.772092] ieee80211 phy1: Atheros AR9300 Rev:3 mem=0xc95e0000, irq=18
[    9.785393] kmodloader: done loading kernel modules from /etc/modules.d/*
[   17.882918] fsl-gianfar soc@ffe00000:ethernet@b0000 eth0: Link is Up - 1Gbps/Full - flow control off
[   17.901128] qca8k mdio@ffe24000:10 lan1: configuring for phy/ link mode
[   17.914327] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   17.937457] br-lan: port 1(lan1) entered blocking state
[   17.942704] br-lan: port 1(lan1) entered disabled state
[   18.279311] qca8k mdio@ffe24000:10 lan1: Link is Up - 1Gbps/Full - flow control rx/tx
[   18.827486] device lan1 entered promiscuous mode
[   27.957399] br-lan: port 1(lan1) entered blocking state
[   27.962656] br-lan: port 1(lan1) entered forwarding state
[   29.507235] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[   30.529543] qca8k mdio@ffe24000:10 lan2: configuring for phy/ link mode
[   30.544282] br-lan: port 2(lan2) entered blocking state
[   30.549569] br-lan: port 2(lan2) entered disabled state
[   31.447623] device lan2 entered promiscuous mode
[   37.719451] qca8k mdio@ffe24000:10 lan3: configuring for phy/ link mode
[   37.727748] br-lan: port 3(lan3) entered blocking state
[   37.732986] br-lan: port 3(lan3) entered disabled state
[   37.829313] qca8k mdio@ffe24000:10 lan3: Link is Up - 1Gbps/Full - flow control off
[   38.817380] device lan3 entered promiscuous mode
[   40.797325] br-lan: port 3(lan3) entered blocking state
[   40.802571] br-lan: port 3(lan3) entered forwarding state
[   44.219455] qca8k mdio@ffe24000:10 lan3: Link is Down
[   45.429453] qca8k mdio@ffe24000:10 lan4: configuring for phy/ link mode
[   45.437322] br-lan: port 3(lan3) entered disabled state
[   45.443315] br-lan: port 4(lan4) entered blocking state
[   45.448587] br-lan: port 4(lan4) entered disabled state
[   46.547379] device lan4 entered promiscuous mode
[   47.319304] qca8k mdio@ffe24000:10 lan3: Link is Up - 1Gbps/Full - flow control off
[   48.967356] br-lan: port 3(lan3) entered blocking state
[   48.972611] br-lan: port 3(lan3) entered forwarding state
[   53.499451] qca8k mdio@ffe24000:10 wan: configuring for phy/ link mode
[   53.627262] qca8k mdio@ffe24000:10 wan: Link is Up - 1Gbps/Full - flow control off
[   53.634870] IPv6: ADDRCONF(NETDEV_CHANGE): wan: link becomes ready
[   65.767851] br-lan: port 3(lan3) entered disabled state
[   65.877301] qca8k mdio@ffe24000:10 lan3: Link is Down
[   70.039299] qca8k mdio@ffe24000:10 lan3: Link is Up - 1Gbps/Full - flow control off
[   70.046990] br-lan: port 3(lan3) entered blocking state
[   70.052239] br-lan: port 3(lan3) entered forwarding state
root@OpenWrt:/# time bridge fdb
64:66:b3:de:ef:b5 dev eth0 self permanent
64:66:b3:de:ef:b6 dev eth0 self permanent
33:33:00:00:00:02 dev eth0 self permanent
01:00:5e:00:00:01 dev eth0 self permanent
33:33:00:00:00:01 dev eth0 self permanent
33:33:ff:de:ef:b5 dev eth0 self permanent
33:33:ff:00:00:00 dev eth0 self permanent
33:33:ff:de:ef:b6 dev eth0 self permanent
33:33:ff:00:0b:02 dev eth0 self permanent
d0:ec:35:2b:a5:0e dev wan vlan 1 self
a0:36:9f:f2:fe:b4 dev wan vlan 1 self
a0:36:9f:f2:fb:88 dev wan vlan 1 self
f4:f2:6d:9c:73:8a dev wan vlan 1 self
64:66:b3:de:ef:b5 dev lan1 offload master br-lan permanent
80:c6:ca:00:35:c2 dev lan3 vlan 1 master br-lan
80:c6:ca:00:35:c2 dev lan3 vlan 100 master br-lan
80:c6:ca:00:35:c2 dev lan3 vlan 1 self
80:c6:ca:00:35:c2 dev lan3 vlan 100 self
33:33:00:00:00:01 dev wlan0 self permanent
33:33:00:00:00:02 dev wlan0 self permanent
33:33:00:00:00:01 dev wlan1 self permanent
33:33:00:00:00:02 dev wlan1 self permanent
33:33:00:00:00:01 dev br-lan self permanent
33:33:00:00:00:02 dev br-lan self permanent
01:00:5e:00:00:01 dev br-lan self permanent
33:33:ff:de:ef:b5 dev br-lan self permanent
33:33:ff:00:00:01 dev br-lan self permanent
33:33:ff:00:00:00 dev br-lan self permanent
33:33:00:01:00:02 dev br-lan self permanent
33:33:00:01:00:03 dev br-lan self permanent
64:66:b3:de:ef:b5 dev br-lan vlan 100 offload master br-lan permanent
64:66:b3:de:ef:b5 dev br-lan vlan 1 offload master br-lan permanent
33:33:00:00:00:01 dev br-lan.1 self permanent
33:33:00:00:00:02 dev br-lan.1 self permanent
01:00:5e:00:00:01 dev br-lan.1 self permanent
33:33:ff:de:ef:b5 dev br-lan.1 self permanent
33:33:ff:00:00:00 dev br-lan.1 self permanent
33:33:00:00:00:01 dev br-lan.100 self permanent
33:33:00:00:00:02 dev br-lan.100 self permanent
01:00:5e:00:00:01 dev br-lan.100 self permanent
33:33:ff:de:ef:b5 dev br-lan.100 self permanent
33:33:ff:00:00:00 dev br-lan.100 self permanent
real    0m 12.10s
user    0m 0.01s
sys     0m 0.00s

But it works. LAN/WAN separation works, vlan filtering works, fdb prints well. Switch forward well. Enough for initial support.

@Ansuel
Copy link
Member

Ansuel commented Sep 30, 2022

@CHKDSK88 god damn even on this target in band doesn't work....
can you check time of ethtool -S lan1 ?

@CHKDSK88
Copy link
Contributor Author

@Ansuel

It's strange. One time was very fast, another 5seconds...

time ethtool -S lan1
NIC statistics:
     tx_packets: 147
     tx_bytes: 22130
     rx_packets: 8
     rx_bytes: 520
     RxBroad: 0
     RxPause: 0
     RxMulti: 0
     RxFcsErr: 0
     RxAlignErr: 0
     RxRunt: 0
     RxFragment: 0
     Rx64Byte: 432345564227567616
     Rx128Byte: 504403158265495552
     Rx256Byte: 0
     Rx512Byte: 0
     Rx1024Byte: 0
     Rx1518Byte: 0
     RxMaxByte: 0
     RxTooLong: 0
     RxGoodByte: 6198078987168645120
     RxBadByte: 0
     RxOverFlow: 0
     Filtered: 0
     TxBroad: 1801439850948198400
     TxPause: 0
     TxMulti: 9007199254740992000
     TxUnderRun: 0
     Tx64Byte: 1224979098644774912
     Tx128Byte: 5404319552844595200
     Tx256Byte: 2954361355555045376
     Tx512Byte: 1945555039024054272
     Tx1024Byte: 0
     Tx1518Byte: 0
     TxMaxByte: 0
     TxOverSize: 0
     TxByte: 14726207831548100608
     TxCollision: 0
     TxAbortCol: 0
     TxMultiCol: 0
     TxSingleCol: 0
     TxExcDefer: 0
     TxDefer: 0
     TxLateCol: 0
real    0m 0.12s
user    0m 0.00s
sys     0m 0.01s
root@OpenWrt:/# time ethtool -S lan2
NIC statistics:
     tx_packets: 0
     tx_bytes: 0
     rx_packets: 0
     rx_bytes: 0
     RxBroad: 0
     RxPause: 0
     RxMulti: 0
     RxFcsErr: 0
     RxAlignErr: 0
     RxRunt: 0
     RxFragment: 0
     Rx64Byte: 0
     Rx128Byte: 0
     Rx256Byte: 0
     Rx512Byte: 0
     Rx1024Byte: 0
     Rx1518Byte: 0
     RxMaxByte: 0
     RxTooLong: 0
     RxGoodByte: 0
     RxBadByte: 0
     RxOverFlow: 0
     Filtered: 0
     TxBroad: 0
     TxPause: 0
     TxMulti: 0
     TxUnderRun: 0
     Tx64Byte: 0
     Tx128Byte: 0
     Tx256Byte: 0
     Tx512Byte: 0
     Tx1024Byte: 0
     Tx1518Byte: 0
     TxMaxByte: 0
     TxOverSize: 0
     TxByte: 0
     TxCollision: 0
     TxAbortCol: 0
     TxMultiCol: 0
     TxSingleCol: 0
     TxExcDefer: 0
     TxDefer: 0
     TxLateCol: 0
real    0m 5.57s
user    0m 0.00s
sys     0m 0.00s
root@OpenWrt:/# time ethtool -S lan3
NIC statistics:
     tx_packets: 109
     tx_bytes: 11156
     rx_packets: 213
     rx_bytes: 23292
     RxBroad: 16
     RxPause: 0
     RxMulti: 100
     RxFcsErr: 0
     RxAlignErr: 0
     RxRunt: 0
     RxFragment: 0
     Rx64Byte: 59
     Rx128Byte: 104
     Rx256Byte: 34
     Rx512Byte: 23
     Rx1024Byte: 0
     Rx1518Byte: 0
     RxMaxByte: 0
     RxTooLong: 0
     RxGoodByte: 28043
     RxBadByte: 0
     RxOverFlow: 0
     Filtered: 2
     TxBroad: 9
     TxPause: 0
     TxMulti: 0
     TxUnderRun: 0
     Tx64Byte: 47
     Tx128Byte: 54
     Tx256Byte: 0
     Tx512Byte: 13
     Tx1024Byte: 0
     Tx1518Byte: 0
     TxMaxByte: 0
     TxOverSize: 0
     TxByte: 12716
     TxCollision: 0
     TxAbortCol: 0
     TxMultiCol: 0
     TxSingleCol: 0
     TxExcDefer: 0
     TxDefer: 0
     TxLateCol: 0
real    0m 5.58s
user    0m 0.00s
sys     0m 0.00s
root@OpenWrt:/# time ethtool -S lan5
Cannot get stats strings information: No such device
Command exited with non-zero status 96
real    0m 0.02s
user    0m 0.00s
sys     0m 0.00s
root@OpenWrt:/# time ethtool -S lan4
NIC statistics:
     tx_packets: 0
     tx_bytes: 0
     rx_packets: 0
     rx_bytes: 0
     RxBroad: 0
     RxPause: 0
     RxMulti: 0
     RxFcsErr: 0
     RxAlignErr: 0
     RxRunt: 0
     RxFragment: 0
     Rx64Byte: 0
     Rx128Byte: 0
     Rx256Byte: 0
     Rx512Byte: 0
     Rx1024Byte: 0
     Rx1518Byte: 0
     RxMaxByte: 0
     RxTooLong: 0
     RxGoodByte: 0
     RxBadByte: 0
     RxOverFlow: 0
     Filtered: 0
     TxBroad: 0
     TxPause: 0
     TxMulti: 0
     TxUnderRun: 0
     Tx64Byte: 0
     Tx128Byte: 0
     Tx256Byte: 0
     Tx512Byte: 0
     Tx1024Byte: 0
     Tx1518Byte: 0
     TxMaxByte: 0
     TxOverSize: 0
     TxByte: 0
     TxCollision: 0
     TxAbortCol: 0
     TxMultiCol: 0
     TxSingleCol: 0
     TxExcDefer: 0
     TxDefer: 0
     TxLateCol: 0
real    0m 5.57s
user    0m 0.00s
sys     0m 0.00s
root@OpenWrt:/# time ethtool -S wan
NIC statistics:
     tx_packets: 274
     tx_bytes: 22094
     rx_packets: 2361
     rx_bytes: 164151
     RxBroad: 70
     RxPause: 0
     RxMulti: 2057
     RxFcsErr: 0
     RxAlignErr: 0
     RxRunt: 0
     RxFragment: 0
     Rx64Byte: 717
     Rx128Byte: 1482
     Rx256Byte: 120
     Rx512Byte: 23
     Rx1024Byte: 22
     Rx1518Byte: 0
     RxMaxByte: 0
     RxTooLong: 0
     RxGoodByte: 207045
     RxBadByte: 0
     RxOverFlow: 0
     Filtered: 0
     TxBroad: 4
     TxPause: 0
     TxMulti: 21
     TxUnderRun: 0
     Tx64Byte: 102
     Tx128Byte: 157
     Tx256Byte: 11
     Tx512Byte: 4
     Tx1024Byte: 0
     Tx1518Byte: 0
     TxMaxByte: 0
     TxOverSize: 0
     TxByte: 24366
     TxCollision: 0
     TxAbortCol: 0
     TxMultiCol: 0
     TxSingleCol: 0
     TxExcDefer: 0
     TxDefer: 0
     TxLateCol: 0
real    0m 5.55s
user    0m 0.00s
sys     0m 0.00s
root@OpenWrt:/# time ethtool -S lan1
NIC statistics:
     tx_packets: 148
     tx_bytes: 22200
     rx_packets: 8
     rx_bytes: 520
     RxBroad: 0
     RxPause: 0
     RxMulti: 0
     RxFcsErr: 0
     RxAlignErr: 0
     RxRunt: 0
     RxFragment: 0
     Rx64Byte: 6
     Rx128Byte: 7
     Rx256Byte: 0
     Rx512Byte: 0
     Rx1024Byte: 0
     Rx1518Byte: 0
     RxMaxByte: 0
     RxTooLong: 0
     RxGoodByte: 1110
     RxBadByte: 0
     RxOverFlow: 0
     Filtered: 0
     TxBroad: 25
     TxPause: 0
     TxMulti: 126
     TxUnderRun: 0
     Tx64Byte: 17
     Tx128Byte: 76
     Tx256Byte: 41
     Tx512Byte: 27
     Tx1024Byte: 0
     Tx1518Byte: 0
     TxMaxByte: 0
     TxOverSize: 0
     TxByte: 24342
     TxCollision: 0
     TxAbortCol: 0
     TxMultiCol: 0
     TxSingleCol: 0
     TxExcDefer: 0
     TxDefer: 0
     TxLateCol: 0
real    0m 5.57s
user    0m 0.00s
sys     0m 0.00s
root@OpenWrt:/#

It looks that first time wrong data was captured...

@Ansuel
Copy link
Member

Ansuel commented Sep 30, 2022

@CHKDSK88 let me give you some context... the switch supports in band method to send and receive mgmt stuff....
If that method fail, there is a timeout and then the legacy mdio one is used... so your 5s is this system getting a timeout.... We should REALLY investigate why the in band method doesn't work since it does correctly work on ipq806x. Wonder if you can help with this.

@CHKDSK88
Copy link
Contributor Author

@Ansuel This Big Endian processor. Could endianess be an issue?

@Ansuel
Copy link
Member

Ansuel commented Sep 30, 2022

@CHKDSK88 YES TOTALLY! the problem is also present on ath79 that is also big endian.... so 99% it's that... the function used are probably not accounting for endianness on building the payload required but you need to help me with this with some tcpdump (full tcpdump without the header stripped)

to check if the payload is wrong should be simple... you can generate a sample packet with the ethtool -S and with the bridge fdb show command.

And take packet from eth0 (or whatever is the cpu port)
(ideally the tcpdump should be run with no traffic so nothing connected)

@CHKDSK88
Copy link
Contributor Author

@Ansuel

root@OpenWrt:/# tcpdump: listening on eth0, link-type NULL (BSD loopback), snapshot length 262144 bytes
root@OpenWrt:/# ethtool -S lan1; killall tcpdump
NIC statistics:
     tx_packets: 241
     tx_bytes: 38092
     rx_packets: 142
     rx_bytes: 25701
     RxBroad: 54
     RxPause: 0
     RxMulti: 4
     RxFcsErr: 0
     RxAlignErr: 0
     RxRunt: 0
     RxFragment: 0
     Rx64Byte: 8
     Rx128Byte: 80
     Rx256Byte: 3
     Rx512Byte: 54
     Rx1024Byte: 1
     Rx1518Byte: 1
     RxMaxByte: 0
     RxTooLong: 0
     RxGoodByte: 28703
     RxBadByte: 0
     RxOverFlow: 0
     Filtered: 0
     TxBroad: 51
     TxPause: 0
     TxMulti: 142
     TxUnderRun: 0
     Tx64Byte: 19
     Tx128Byte: 135
     Tx256Byte: 44
     Tx512Byte: 55
     Tx1024Byte: 1
     Tx1518Byte: 0
     TxMaxByte: 0
     TxOverSize: 0
     TxByte: 40642
     TxCollision: 0
     TxAbortCol: 0
     TxMultiCol: 0
     TxSingleCol: 0
     TxExcDefer: 0
     TxDefer: 0
     TxLateCol: 0
48 packets captured
60 packets received by filter
0 packets dropped by kernel
[1]+  Done                       tcpdump -i eth0 -w /tmp/test

test.zip

Do You see anything suspicious?

strings -td < /tmp/uboot | grep '^ *[0-9]* spiboot=' | \n$\
awk '{print $$$$1}' | \n$\
while read offset; do \n$\
echo -n "spiboot=sf probe 0;sf read 2000000 60200 69f000;" | dd of=/tmp/uboot_patched bs=1 seek=$$$${offset} conv=notrunc \n$\
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we have to patch, I would prefer not to hard-code the bootcmd, but instead, refer to a u-boot variable, and then fw_setenv that variable appropriately. (We would first of course need to make the u-boot env partition variable writable.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This device have only hardcoded envs and no 'saveenv' cmd. Tp-link offen offer u-boot without env partition. How to find in binary if env partition creation is possible?

Copy link

@deividAlfa deividAlfa Oct 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Edit: Environment storage removed, it would erase the MAC address!

I modified and compiled uboot, adding several commands (cmp, cp, echo, nm, mm, mw, test, unzip...).

Openwrt detection can be easily done now by searching the "Openwrt" string at the start of the kernel:

bootcmd=run openwrt_detect

openwrt_detect=run openwrt_str_load;if cmp.b 2000000 2000008 8;then echo Openwrt found;run openwrt_boot; else echo Openwrt not found;run spiboot;fi

spiboot=sf probe 0;sf read 2000000 60200 29f000;sf read 3000000 50000 10000;bootm 2000000 - 3000000

openwrt_boot=sf probe 0;sf read 2000000 60200 69f000;sf read 3000000 50000 10000;bootm 2000000 - 3000000

openwrt_str_load=mw.b 2000000 0 8;mw.b 2000000 4f;mw.b 2000001 70;mw.b 2000002 65;mw.b 2000003 6e;mw.b 2000004 57;mw.b 2000005 72;mw.b 2000006 74;mw.b 2000007 20;sf probe 0;sf read 2000008 60228 8

These commands are already included in the modded uboot and it will work right away.
Modded uboot: wdr4900v1_uboot_mod.tar.gz

It's ready for flashing, ex. following the uboot patch guideline:

opkg update
opkg install kmod-mtd-rw
cd /tmp
wget https://github.com/openwrt/openwrt/files/9690519/wdr4900v1_uboot_mod.tar.gz -O uboot_mod.tar.gz
tar -xzf uboot_mod.tar.gz    

Just in case:

md5sum wdr4900v1_uboot_mod.bin
    9d951e5a02e51c718650c0e5179c61da  wdr4900v1_uboot_mod.bin

Flash:

insmod mtd-rw i_want_a_brick=y
mtd write wdr4900v1_uboot_mod.bin u-boot

Tested here exactly with these commands, everything works.
The last 64KB sector with the MAC/PIN etc is preserved, mtd is smart enough to only erase the required sectors, but better to backup the original in any case!

cat /dev/mtd0 >/tmp/mtd0.bin
cd /www
ln -s /tmp/mtd0.bin
Get the file by browsing http://router_ip/mtd0.bin

Boot log (Ignore the crazy frequencies, I'm running a HW modified wdr4900, not caused by uboot):

U-Boot 2010.12 (Oct 01 2022 - 14:55:41)

CPU:   P1014, Version: 1.0, (0x80f10110)
Core:  E500, Version: 5.1, (0x80212151)
Clock Configuration:
       CPU0:1400 MHz,
       CCB:400  MHz,
       DDR:400  MHz (800 MT/s data rate) (Asynchronous), IFC:100  MHz
L1:    D-cache 32 kB enabled
       I-cache 32 kB enabled
Board: P1014RDB
SPI:   ready
DRAM:  128 MiB
L2:    256 KB enabled
Using default environment

PCIe1: Root Complex of mini PCIe Slot, x1, regs @ 0xffe0a000
  01:00.0     - 168c:abcd - Network controller
PCIe1: Bus 00 - 01
PCIe2: Root Complex of PCIe Slot, x1, regs @ 0xffe09000
  03:00.0     - 168c:0033 - Network controller
PCIe2: Bus 02 - 03
In:    serial
Out:   serial
Err:   serial
Net:   initialization for Atheros AR8327/AR8328
AR8327/AR8328 v1.1 is found!
eTSEC1
Autobooting in 1 seconds
SF: Detected S25FL128S_64K with page size 256, total 16 MiB
16384 KiB S25FL128S_64K at 0:0 is now current device
SPI flash read successful
Total of 8 bytes were the same
Openwrt found
SF: Detected S25FL128S_64K with page size 256, total 16 MiB
16384 KiB S25FL128S_64K at 0:0 is now current device
SPI flash read successful
SPI flash read successful
## Booting kernel from Legacy Image at 02000000 ...
   Image Name:   POWERPC OpenWrt Linux-5.4.154
   Image Type:   PowerPC Linux Kernel Image (uncompressed)
   Data Size:    2546236 Bytes = 2.4 MiB
   Load Address: 01000000
   Entry Point:  01000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 03000000
   Booting using the fdt blob at 0x3000000
   Loading Kernel Image ... OK
OK
   Loading Device Tree to 00ffa000, end 00ffffff ... OK
[    0.000000] Memory CAM mapping: 64/64 Mb, residual: 0Mb
[    0.000000] Linux version 5.4.154 (builder@buildhost) (gcc version 8.4.0 (OpenWrt GCC 8.4.0 r16325-88151b8303)) #0 Sun Oct 24 09:01:35 2021

If anyone wants to compile himself, just replace the file
TL-WDR4900_eu_1.0_GPL/p1010/uboot/u-boot-2010.12/include/configs/P1010RDB.h
With this one P1010RDB.h.tar.gz

If compiling yourself, remember to append the generated uboot image to the boot header:wdr4900v1_uboot_header.tar.gz
Ex.

cat header.bin uboot.bin > wdr4900_uboot.bin

(First time I forgot and hard bricked it, requiring SPI programmer to recover)

Copy link

@deividAlfa deividAlfa Oct 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So if you have any better ideas for the booting, just let me know, after the initial setup mess now it takes just 20 seconds to compile a new uboot :)

Flashed original FW, detection is working:

U-Boot 2010.12 (Oct 01 2022 - 14:55:41)

CPU:   P1014, Version: 1.0, (0x80f10110)
Core:  E500, Version: 5.1, (0x80212151)
Clock Configuration:
       CPU0:1400 MHz,
       CCB:400  MHz,
       DDR:400  MHz (800 MT/s data rate) (Asynchronous), IFC:100  MHz
L1:    D-cache 32 kB enabled
       I-cache 32 kB enabled
Board: P1014RDB
SPI:   ready
DRAM:  128 MiB
L2:    256 KB enabled
Using default environment

PCIe1: Root Complex of mini PCIe Slot, x1, regs @ 0xffe0a000
  01:00.0     - 168c:abcd - Network controller
PCIe1: Bus 00 - 01
PCIe2: Root Complex of PCIe Slot, x1, regs @ 0xffe09000
  03:00.0     - 168c:0033 - Network controller
PCIe2: Bus 02 - 03
In:    serial
Out:   serial
Err:   serial
Net:   initialization for Atheros AR8327/AR8328
AR8327/AR8328 v1.1 is found!
eTSEC1
Autobooting in 1 seconds
SF: Detected S25FL128S_64K with page size 256, total 16 MiB
16384 KiB S25FL128S_64K at 0:0 is now current device
SPI flash read successful
byte at 0x02000000 (0x4f) != byte at 0x02000008 (0x36)
Total of 0 bytes were the same
Openwrt not found
SF: Detected S25FL128S_64K with page size 256, total 16 MiB
16384 KiB S25FL128S_64K at 0:0 is now current device
SPI flash read successful
SPI flash read successful
## Booting kernel from Legacy Image at 02000000 ...
   Image Name:   Linux-2.6.35
   Image Type:   PowerPC Linux Kernel Image (gzip compressed)
   Data Size:    2178207 Bytes = 2.1 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 03000000
   Booting using the fdt blob at 0x3000000
   Uncompressing Kernel Image ... OK
   Loading Device Tree to 00ffa000, end 00ffffff ... OK
Using P1010 RDB machine description
Memory CAM mapping: 64/64 Mb, residual: 0Mb
Linux version 2.6.35 (root@localhost.localdomain) (gcc version 4.5.1 (Sourcery G++ Lite 2010.09-55) ) #1 Wed Apr 24 20:09:29 CST 2013

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi there,

Could you provide a containerized build environment for your U-Boot which uses an OpenWrt build toolchain? For example, here:

chunkeey/u-boot-ap105#2

I think a full U-Boot replacement would be most reasonable if anyone can compile from source.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I meant an OpenWrt compiler toolchain, really*. In the linked PR, I use OpenWrt's mips compiler toolchain.)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, using 32-bit Ubuntu 14 in Virtualbox vm, with the original TP-Link sources including the toolchain.
The original FW boots perfectly with the patched uboot. So the patch method is just fine, no need of custom uboot etc.

@deividAlfa
Copy link

I'll be happy to test and provide feedback, but not having enough time to compile myself, could you upload the image somewhere?

@Ansuel
Copy link
Member

Ansuel commented Oct 1, 2022

@CHKDSK88 Ok yes think we can confirm it's an endianness bug...

The header is correct... problem is in the endianness of the in band payload....
(extra care to the b040 that is the payload for a in band read)
This is a correct packet: mdio command + (40b0)
image

This is you packet: mdio command (i assume also wrong) + (b040)
image

I need to check the code to account for this...

@Ansuel
Copy link
Member

Ansuel commented Oct 2, 2022

@CHKDSK88 can you test this patch? https://gist.github.com/Ansuel/7103d5e97d1bb3c855d85b4851b5d054
i have some concern with the rest of the skb but in theory basic mdio limited to 4 byte should work.
So pls check if with this patch port setup is faster and provide result from ethtool -S and bridge fdb show (they use more than 4 byte so i need to check if that part is correct)

@@ -245,15 +245,17 @@ CONFIG_SPI_MEM=y
CONFIG_SRCU=y
# CONFIG_STRIP_ASM_SYMS is not set
# CONFIG_STX_GP3 is not set
CONFIG_SWCONFIG=y
Copy link
Contributor

@abajk abajk Oct 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that Ocedo Panda also has a built-in switch. Shouldn swconfig remain enabled for the P1020 subtarget?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank You. I forgot commit 'target/linux/mpc85xx/p1020/config-default' file.

@CHKDSK88
Copy link
Contributor Author

CHKDSK88 commented Oct 3, 2022

@CHKDSK88 can you test this patch? https://gist.github.com/Ansuel/7103d5e97d1bb3c855d85b4851b5d054 i have some concern with the rest of the skb but in theory basic mdio limited to 4 byte should work. So pls check if with this patch port setup is faster and provide result from ethtool -S and bridge fdb show (they use more than 4 byte so i need to check if that part is correct)

@Ansuel

It work very fast:

root@OpenWrt:/# time ethtool -S lan1
NIC statistics:
     tx_packets: 18
     tx_bytes: 2432
     rx_packets: 0
     rx_bytes: 0
     RxBroad: 0
     RxPause: 0
     RxMulti: 0
     RxFcsErr: 0
     RxAlignErr: 0
     RxRunt: 0
     RxFragment: 0
     Rx64Byte: 0
     Rx128Byte: 0
     Rx256Byte: 0
     Rx512Byte: 0
     Rx1024Byte: 0
     Rx1518Byte: 0
     RxMaxByte: 0
     RxTooLong: 0
     RxGoodByte: 0
     RxBadByte: 0
     RxOverFlow: 0
     Filtered: 0
     TxBroad: 0
     TxPause: 0
     TxMulti: 576460752303423488
     TxUnderRun: 0
     Tx64Byte: 0
     Tx128Byte: 432345564227567616
     Tx256Byte: 144115188075855872
     Tx512Byte: 0
     Tx1024Byte: 0
     Tx1518Byte: 0
     TxMaxByte: 0
     TxOverSize: 0
     TxByte: 9944792402164187136
     TxCollision: 0
     TxAbortCol: 0
     TxMultiCol: 0
     TxSingleCol: 0
     TxExcDefer: 0
     TxDefer: 0
     TxLateCol: 0
real    0m 0.00s
user    0m 0.00s
sys     0m 0.00s
root@OpenWrt:/#
[   39.371220] fsl-gianfar soc@ffe00000:ethernet@b0000 eth0: Link is Up - 1Gbps/Full - flow control off
[   39.384364] qca8k mdio@ffe24000:10 lan1: configuring for phy/ link mode
[   39.395041] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   39.405131] br-lan: port 1(lan1) entered blocking state
[   39.410426] br-lan: port 1(lan1) entered disabled state
[   39.439374] qca8k mdio@ffe24000:10 lan1: Link is Up - 1Gbps/Full - flow control rx/tx
[   39.448003] device lan1 entered promiscuous mode
[   39.471191] br-lan: port 1(lan1) entered blocking state
[   39.476434] br-lan: port 1(lan1) entered forwarding state
[   39.532923] qca8k mdio@ffe24000:10 lan2: configuring for phy/ link mode
[   39.556591] br-lan: port 2(lan2) entered blocking state
[   39.561871] br-lan: port 2(lan2) entered disabled state
[   39.617955] device lan2 entered promiscuous mode
[   39.645636] qca8k mdio@ffe24000:10 lan3: configuring for phy/ link mode
[   39.653502] qca8k mdio@ffe24000:10 lan3: Link is Up - 1Gbps/Full - flow control off
[   39.670701] br-lan: port 3(lan3) entered blocking state
[   39.675948] br-lan: port 3(lan3) entered disabled state
[   39.718016] device lan3 entered promiscuous mode
[   39.739630] br-lan: port 3(lan3) entered blocking state
[   39.744878] br-lan: port 3(lan3) entered forwarding state
[   39.773531] qca8k mdio@ffe24000:10 lan4: configuring for phy/ link mode
[   39.789853] br-lan: port 4(lan4) entered blocking state
[   39.795100] br-lan: port 4(lan4) entered disabled state
[   39.811136] device lan4 entered promiscuous mode
[   39.851331] qca8k mdio@ffe24000:10 wan: configuring for phy/ link mode
[   39.859000] qca8k mdio@ffe24000:10 wan: Link is Up - 1Gbps/Full - flow control off
[   39.866591] IPv6: ADDRCONF(NETDEV_CHANGE): wan: link becomes ready
[   40.375599] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready

Stats values are wrong. But the answer is instant.

@Ansuel
Copy link
Member

Ansuel commented Oct 3, 2022

Nice! Can you provide a tcpdump with the ethtool call?

Also test time with bridge fdb show
(Will probably give you broken results)

@Ansuel
Copy link
Member

Ansuel commented Oct 3, 2022

@CHKDSK88 here is the patch that should in theory give you correct results
https://gist.github.com/Ansuel/70eb89a00443180fd2ab04c7ea0f2b3c

Check for time bridge fdb show... ethtool if the value are correct and if the switch correctly works...

If everything goes well i would ask you a tested-by tag to I can add it in the patch as I want to push the fix upstream.

@CHKDSK88
Copy link
Contributor Author

CHKDSK88 commented Oct 4, 2022

@Ansuel

tcpdump.zip

@Ansuel
Copy link
Member

Ansuel commented Oct 4, 2022

@CHKDSK88 i need the results with the tcpdump so i can check they correctly match :(

@CHKDSK88
Copy link
Contributor Author

CHKDSK88 commented Oct 4, 2022

@Ansuel

root@OpenWrt:/# ethtool -S lan1; killall tcpdump
NIC statistics:
     tx_packets: 663
     tx_bytes: 132080
     rx_packets: 457
     rx_bytes: 98882
     RxBroad: 43
     RxPause: 0
     RxMulti: 19
     RxFcsErr: 0
     RxAlignErr: 0
     RxRunt: 0
     RxFragment: 0
     Rx64Byte: 11745387828182253568
     Rx128Byte: 1369094286720630784
     Rx256Byte: 0
     Rx512Byte: 1369375761697341440
     Rx1024Byte: 0
     Rx1518Byte: 0
     RxMaxByte: 0
     RxTooLong: 0
     RxGoodByte: 7251359449531547648
     RxBadByte: 0
     RxOverFlow: 0
     Filtered: 0
     TxBroad: 2666130979403333632
     TxPause: 0
     TxMulti: 9583660007044415488
     TxUnderRun: 0
     Tx64Byte: 13618885273168379904
     Tx128Byte: 5836665117072162816
     Tx256Byte: 1657324662872342528
     Tx512Byte: 4323737117252386816
     Tx1024Byte: 0
     Tx1518Byte: 0
     TxMaxByte: 0
     TxOverSize: 0
     TxByte: 7493991978967760896
     TxCollision: 0
     TxAbortCol: 0
     TxMultiCol: 0
     TxSingleCol: 0
     TxExcDefer: 0
     TxDefer: 0
     TxLateCol: 0
4 packets captured
15 packets received by filter
0 packets dropped by kernel
[1]+  Done                       tcpdump -i eth0 -w /tmp/ethtool
root@OpenWrt:/#
root@OpenWrt:/# tcpdump -i eth0 -w /tmp/bridge-fdb &
root@OpenWrt:/# tcpdump: listening on eth0, link-type NULL (BSD loopback), snapshot length 262144 bytes
root@OpenWrt:/# hexdump -C /tmp/bridge-fdb
root@OpenWrt:/# bridge fdb; killall tcpdump
64:66:b3:de:ef:b5 dev eth0 self permanent
64:66:b3:de:ef:b6 dev eth0 self permanent
33:33:00:00:00:02 dev eth0 self permanent
01:00:5e:00:00:01 dev eth0 self permanent
33:33:00:00:00:01 dev eth0 self permanent
33:33:ff:de:ef:b5 dev eth0 self permanent
33:33:ff:de:ef:b6 dev eth0 self permanent
33:33:ff:00:00:00 dev eth0 self permanent
33:33:ff:00:0b:02 dev eth0 self permanent
64:66:b3:de:ef:b5 dev lan1 offload master br-lan permanent
80:c6:ca:00:35:c2 dev lan3 vlan 1 master br-lan
33:33:00:00:00:01 dev wlan0 self permanent
33:33:00:00:00:02 dev wlan0 self permanent
33:33:00:00:00:01 dev wlan1 self permanent
33:33:00:00:00:02 dev wlan1 self permanent
33:33:00:00:00:01 dev br-lan self permanent
33:33:00:00:00:02 dev br-lan self permanent
01:00:5e:00:00:01 dev br-lan self permanent
33:33:ff:de:ef:b5 dev br-lan self permanent
33:33:ff:00:00:01 dev br-lan self permanent
33:33:ff:00:00:00 dev br-lan self permanent
33:33:00:01:00:02 dev br-lan self permanent
33:33:00:01:00:03 dev br-lan self permanent
64:66:b3:de:ef:b5 dev br-lan vlan 100 offload master br-lan permanent
64:66:b3:de:ef:b5 dev br-lan vlan 1 offload master br-lan permanent
33:33:00:00:00:01 dev br-lan.1 self permanent
33:33:00:00:00:02 dev br-lan.1 self permanent
01:00:5e:00:00:01 dev br-lan.1 self permanent
33:33:ff:de:ef:b5 dev br-lan.1 self permanent
33:33:ff:00:00:00 dev br-lan.1 self permanent
33:33:00:00:00:01 dev br-lan.100 self permanent
33:33:00:00:00:02 dev br-lan.100 self permanent
01:00:5e:00:00:01 dev br-lan.100 self permanent
33:33:ff:de:ef:b5 dev br-lan.100 self permanent
33:33:ff:00:00:00 dev br-lan.100 self permanent
11 packets captured
51 packets received by filter
0 packets dropped by kernel
[1]+  Done                       tcpdump -i eth0 -w /tmp/bridge-fdb
root@OpenWrt:/#

tcpdump.zip

Noe with correlated output. :)

@Ansuel
Copy link
Member

Ansuel commented Oct 4, 2022

@CHKDSK88 thanks a lot aaand ethtool is still rip

@Ansuel
Copy link
Member

Ansuel commented Oct 4, 2022

@CHKDSK88 ufff why the tcpdump doesn't have the packet now :( (both zip doesn't have the inband packet)
bridge result looks ok tho... the results are instant right?

@CHKDSK88
Copy link
Contributor Author

CHKDSK88 commented Oct 4, 2022

@Ansuel Both answers are instant.

@Ansuel
Copy link
Member

Ansuel commented Oct 4, 2022

@CHKDSK88 hope it's not too much can you wait a second or 2 between the tcpdump start, ethtool call and then the killall tcpdump? I really need the tcpdump with the ethtool packet to understand wth is wrong.

Anyway everything else works correctly? every port works, no port dropping?

@CHKDSK88
Copy link
Contributor Author

CHKDSK88 commented Oct 5, 2022

@Ansuel
New output:

root@OpenWrt:/# tcpdump -i eth0 -w /tmp/bridge-fdb & sleep 2; time bridge fdb; s
leep 2; killall tcpdump
tcpdump: listening on eth0, link-type NULL (BSD loopback), snapshot length 262144 bytes
64:66:b3:de:ef:b5 dev eth0 self permanent
64:66:b3:de:ef:b6 dev eth0 self permanent
33:33:00:00:00:02 dev eth0 self permanent
01:00:5e:00:00:01 dev eth0 self permanent
33:33:00:00:00:01 dev eth0 self permanent
33:33:ff:de:ef:b5 dev eth0 self permanent
33:33:ff:de:ef:b6 dev eth0 self permanent
33:33:ff:00:00:00 dev eth0 self permanent
33:33:ff:00:0b:02 dev eth0 self permanent
64:66:b3:de:ef:b5 dev lan1 offload master br-lan permanent
80:c6:ca:00:35:c2 dev lan3 vlan 1 master br-lan
33:33:00:00:00:01 dev wlan0 self permanent
33:33:00:00:00:02 dev wlan0 self permanent
33:33:00:00:00:01 dev wlan1 self permanent
33:33:00:00:00:02 dev wlan1 self permanent
33:33:00:00:00:01 dev br-lan self permanent
33:33:00:00:00:02 dev br-lan self permanent
01:00:5e:00:00:01 dev br-lan self permanent
33:33:ff:de:ef:b5 dev br-lan self permanent
33:33:ff:00:00:01 dev br-lan self permanent
33:33:ff:00:00:00 dev br-lan self permanent
33:33:00:01:00:02 dev br-lan self permanent
33:33:00:01:00:03 dev br-lan self permanent
64:66:b3:de:ef:b5 dev br-lan vlan 100 offload master br-lan permanent
64:66:b3:de:ef:b5 dev br-lan vlan 1 offload master br-lan permanent
33:33:00:00:00:01 dev br-lan.1 self permanent
33:33:00:00:00:02 dev br-lan.1 self permanent
01:00:5e:00:00:01 dev br-lan.1 self permanent
33:33:ff:de:ef:b5 dev br-lan.1 self permanent
33:33:ff:00:00:00 dev br-lan.1 self permanent
33:33:00:00:00:01 dev br-lan.100 self permanent
33:33:00:00:00:02 dev br-lan.100 self permanent
01:00:5e:00:00:01 dev br-lan.100 self permanent
33:33:ff:de:ef:b5 dev br-lan.100 self permanent
33:33:ff:00:00:00 dev br-lan.100 self permanent
real    0m 0.00s
user    0m 0.00s
sys     0m 0.00s
44 packets captured
47 packets received by filter
0 packets dropped by kernel
[1]+  Done                       tcpdump -i eth0 -w /tmp/bridge-fdb
root@OpenWrt:/# tcpdump -i eth0 -w /tmp/ethtool & sleep 2; time ethtool -S lan1;
 sleep 2; killall tcpdump
tcpdump: listening on eth0, link-type NULL (BSD loopback), snapshot length 262144 bytes
NIC statistics:
     tx_packets: 5934
     tx_bytes: 691966
     rx_packets: 5563
     rx_bytes: 588278
     RxBroad: 59
     RxPause: 0
     RxMulti: 44
     RxFcsErr: 0
     RxAlignErr: 0
     RxRunt: 0
     RxFragment: 0
     Rx64Byte: 4251960998191169536
     Rx128Byte: 4040291815704756224
     Rx256Byte: 4900197869555810304
     Rx512Byte: 15060881578857070592
     Rx1024Byte: 2595199285272248320
     Rx1518Byte: 9047740447480348672
     RxMaxByte: 0
     RxTooLong: 0
     RxGoodByte: 4958427120599564288
     RxBadByte: 0
     RxOverFlow: 0
     Filtered: 0
     TxBroad: 5908722711110090752
     TxPause: 0
     TxMulti: 3603161176873107456
     TxUnderRun: 0
     Tx64Byte: 7782783106049638400
     Tx128Byte: 1236801047666622464
     Tx256Byte: 3819052484010180608
     Tx512Byte: 432908514180988928
     Tx1024Byte: 0
     Tx1518Byte: 0
     TxMaxByte: 0
     TxOverSize: 0
     TxByte: 4356406906248495104
     TxCollision: 0
     TxAbortCol: 0
     TxMultiCol: 0
     TxSingleCol: 0
     TxExcDefer: 0
     TxDefer: 0
     TxLateCol: 0
real    0m 0.00s
user    0m 0.00s
sys     0m 0.00s
17 packets captured
17 packets received by filter
0 packets dropped by kernel
[1]+  Done                       tcpdump -i eth0 -w /tmp/ethtool
root@OpenWrt:/#

tcpdump.zip

Regular packages (switch forward, to cpu., from cpu) have no loses.

@Ansuel
Copy link
Member

Ansuel commented Oct 5, 2022

@CHKDSK88 NICE the sleep thing made the trick and i have the required packet :D

@Ansuel
Copy link
Member

Ansuel commented Oct 5, 2022

@CHKDSK88 ok this should produce correct ethtool values
https://gist.github.com/Ansuel/35c7ae519a4e171516c28fa61cdfa0db
^ this patch is bugged and doesn't handle vlan in fdb values, my bad i fixed it in the below patch.

https://gist.github.com/Ansuel/d1c45184fd00b5e07fa1e1757d0fa996

@BKPepe
Copy link
Member

BKPepe commented Dec 21, 2022

So far no DHCP issues, but I will keep you updated. Sorry for getting off-topic here!

I'm not sure if it is related, but it was not happening, AFAIK, before the patch series. I tried to unplug the Ethernet cable from the WAN port, we are using Micrel KSZ9031RNXCA, and then I got the following:

Dec 21 16:05:48 turris kernel: [17922.724980] Micrel KSZ9031 Gigabit PHY mdio@ffe24520:07: phy_poll_reset failed: -110

It doesn't want to get up until I reboot the router manually before it, it does not want to be restarted in software. Not sure, if it is related:

[ 1548.091585] rcu: INFO: rcu_sched self-detected stall on CPU
[ 1548.097179] rcu:     1-....: (1 GPs behind) idle=bb3/1/0x40000002 softirq=9058/9068 fqs=3000 
[ 1548.105453]  (t=6002 jiffies g=13349 q=3439)
[ 1548.109723] Task dump for CPU 1:
[ 1548.112947] task:irq/38-mdio@ffe state:R  running task     stack:    0 pid: 3080 ppid:     2 flags:0x00000804
[ 1548.122874] Call Trace:
[ 1548.125315] [c1817b20] [c0063458] sched_show_task+0x198/0x1d4 (unreliable)
[ 1548.132204] [c1817b40] [c00a38cc] rcu_dump_cpu_stacks+0xf0/0x148
[ 1548.138219] [c1817b70] [c00a92b8] rcu_sched_clock_irq+0x6b0/0x948
[ 1548.144321] [c1817bd0] [c00b07c4] update_process_times+0xa8/0xf8
[ 1548.150333] [c1817bf0] [c00c5de8] tick_sched_timer+0x98/0x2f4
[ 1548.156092] [c1817c20] [c00b12e4] __hrtimer_run_queues+0x180/0x28c
[ 1548.162279] [c1817c70] [c00b23b4] hrtimer_interrupt+0x164/0x380
[ 1548.168205] [c1817cc0] [c000a674] timer_interrupt+0x1c8/0x2b0
[ 1548.173964] [c1817d00] [c000138c] Decrementer+0x14c/0x160
[ 1548.179368] --- interrupt: 900 at fsl_pq_mdio_read+0x78/0xb0
[ 1548.185035] NIP:  c067e750 LR: c06696ec CTR: 000002fb
[ 1548.190085] REGS: c1817d10 TRAP: 0900   Not tainted  (5.15.84)
[ 1548.195919] MSR:  02029000 <VEC,CE,EE,ME>  CR: 44000442  XER: 20000000
[ 1548.202465] 
[ 1548.202465] GPR00: c067808c c1817df0 c2d8cda0 c181b000 00000700 0000071b 00000001 f1152520 
[ 1548.202465] GPR08: f1152534 00000001 000002fa c0b8ddbc 44000444 00000000 c005c1cc c37253c0 
[ 1548.202465] GPR16: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 c266b820 
[ 1548.202465] GPR24: c19af364 c0093bb4 00000000 c0093acc c181b558 0000001b 00000007 c181b000 
[ 1548.237429] NIP [c067e750] fsl_pq_mdio_read+0x78/0xb0
[ 1548.242482] LR [c06696ec] mdiobus_read+0x4c/0x9c
[ 1548.247112] --- interrupt: 900
[ 1548.250161] [c1817df0] [02029000] 0x2029000 (unreliable)
[ 1548.255479] [c1817e00] [c0c0e628] 0xc0c0e628
[ 1548.259750] [c1817e20] [c067808c] kszphy_handle_interrupt+0x24/0x88
[ 1548.266023] [c1817e40] [c06608d0] phy_interrupt+0x3c/0x68
[ 1548.271426] [c1817e60] [c0093b00] irq_thread_fn+0x34/0xa0
[ 1548.276841] [c1817e80] [c0093f88] irq_thread+0x174/0x228
[ 1548.282159] [c1817ed0] [c005c30c] kthread+0x140/0x148
[ 1548.287216] [c1817f10] [c001126c] ret_from_kernel_thread+0x5c/0x64
[ 1559.051656] rcu: INFO: rcu_sched detected expedited stalls on CPUs/tasks: { 1-... } 6188 jiffies s: 185 root: 0x2/.
[ 1559.062123] rcu: blocking rcu_node structures (internal RCU debug):
[ 1559.068394] Task dump for CPU 1:
[ 1559.071617] task:irq/38-mdio@ffe state:R  running task     stack:    0 pid: 3080 ppid:     2 flags:0x00000804
[ 1559.081552] Call Trace:
[ 1559.084001] [c1817c40] [eedd2160] 0xeedd2160 (unreliable)
[ 1559.089407] [c1817c50] [c00c304c] clockevents_program_event+0x90/0x1f4
[ 1559.095961] [c1817c70] [c00b23f4] hrtimer_interrupt+0x1a4/0x380
[ 1559.101903] [c1817cc0] [c000a674] timer_interrupt+0x1c8/0x2b0
[ 1559.107661] [c1817d00] [c000138c] Decrementer+0x14c/0x160
[ 1559.113074] [c1817d10] [c19af364] 0xc19af364
[ 1559.117348] [c1817d20] [c003e65c] irq_exit+0x84/0xdc
[ 1559.122336] [c1817d40] [c0000be4] ExternalInput+0x144/0x160
[ 1559.127916] [c1817e30] [c0c0e628] 0xc0c0e628

@Ansuel
Copy link
Member

Ansuel commented Dec 21, 2022 via email

@BKPepe
Copy link
Member

BKPepe commented Dec 21, 2022

Yeah, but the stacktrace I got for the first time, but the spammimg of phy_poll_reset bothers me a lot as the WAN does not want to get UP when it is plugged back. It wants to be restarted to get it working.

@Ansuel
Copy link
Member

Ansuel commented Dec 21, 2022 via email

@BKPepe
Copy link
Member

BKPepe commented Dec 22, 2022

Oh, it is not related to your patch series. I reverted it, compiled it, installed it on the router and it is the same issue with the PHY. Sorry! The patch series is working for the switch as it should so far.

@Ansuel
Copy link
Member

Ansuel commented Dec 22, 2022

btw this is the patch submitted upstream https://patchwork.kernel.org/project/netdevbpf/patch/20221216161721.23863-1-ansuelsmth@gmail.com/

Feel free to add tag to them

@Ansuel
Copy link
Member

Ansuel commented Jan 4, 2023

@BKPepe i merged the related patch in master. I think this is ready and a first user of qca8k?

@PolynomialDivision
Copy link
Member

@BKPepe i merged the related patch in master. I think this is ready and a first user of qca8k?

I can give it a test-run.

@PolynomialDivision
Copy link
Member

@Ansuel You only backported your patch to 5.15 but this commit enables dsa driver also for 5.10? I did not read the whole thread so maybe I miss something.

@Ansuel
Copy link
Member

Ansuel commented Feb 4, 2023

Eh backport to 5.10 is possible but it's a lot of work. Should we really care?

@BKPepe
Copy link
Member

BKPepe commented Feb 4, 2023

Nope.

  • 5.10 works OTB.
  • 5.15 works with Ansuel patch series, but on Turris 1.x routers, we do have some issues with PHY as said above, but we will need to investigate it further what is happening. (not related to Ansuel patch series, though)

@Ansuel
Copy link
Member

Ansuel commented Feb 4, 2023 via email

@PolynomialDivision
Copy link
Member

Tested-by: Nick Hainke <vincent@systemli.org> TP Link WDR4900 v1 (5.15)

It was done by "make kernel_oldconfig" command for 5.10 and 5.15.

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
This patch introduces DSA support for TP-Link TL-WDR4900 v1 switch.
Swconfig driver for QCA8327 switch is removed because this router is
only one device which use Qualcom swconfig switch.

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
Tested-by: Nick Hainke <vincent@systemli.org> # TP Link WDR4900 v1 (5.15)
@Ansuel
Copy link
Member

Ansuel commented Feb 20, 2023

@CHKDSK88 ok to merge?
@BKPepe ?

@BKPepe
Copy link
Member

BKPepe commented Feb 20, 2023

Well, I don't want be the guy, who blocked this PR even though my comment was not addressed:
#10850 (review)

@Ansuel
Copy link
Member

Ansuel commented Feb 20, 2023

@BKPepe that should be autosolved with me rebased this on top of master. Do you have other blocker? Think any qca8k problem was solved

@BKPepe
Copy link
Member

BKPepe commented Feb 20, 2023

Thats not going to be resolved as mine PR was applied to mpc85xx target, but here it is going to be in generic config.

@Ansuel
Copy link
Member

Ansuel commented Feb 20, 2023

@BKPepe oh... well I can fix it if that's the only problem

@BKPepe
Copy link
Member

BKPepe commented Feb 20, 2023

Otherwise, this can go through. 👍 🤞

@Ansuel Ansuel force-pushed the tl-wdr4900_v1_resurrect branch 2 times, most recently from 05747cf to 63efe38 Compare February 20, 2023 15:53
@@ -43,6 +43,7 @@ CONFIG_RPS=y
CONFIG_RWSEM_SPIN_ON_OWNER=y
CONFIG_SMP=y
CONFIG_SPI_GPIO=y
CONFIG_SWCONFIG=y
Copy link
Member

@Ansuel Ansuel Feb 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BKPepe any idea why swconfig is still needed? for b43?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@CHKDSK88
Copy link
Contributor Author

Well, I don't want be the guy, who blocked this PR even though my comment was not addressed: #10850 (review)

Because I still prefer my solution. But this particular patch could be simply rejected.

@Ansuel Ansuel force-pushed the tl-wdr4900_v1_resurrect branch 2 times, most recently from 5a5e5e2 to bfa5e4e Compare February 20, 2023 16:41
@openwrt-bot openwrt-bot merged commit bfa5e4e into openwrt:master Feb 20, 2023
fengmushu pushed a commit to fengmushu/openwrt that referenced this pull request Nov 18, 2023
Signed-off-by: Beginner-Go <70857188+Beginner-Go@users.noreply.github.com>
@InsaneKnight
Copy link
Contributor

InsaneKnight commented Nov 23, 2023

By comparison between 22.03.5 (swconfig) and 23.05.2 (DSA), the bandwidth with an IPoE wan without flow offloading falls from 650Mb/s to 400Mb/s, and bandwidth with software flow offloading falls from 900 to 550. The bandwidth with a PPPoE wan is much poorer (260 vs 400 of ath79, seeing #10224 (comment) ), even with the walkaround in #10224 (comment) .

It seems that the same performance issue preventing ath79 targets from being switched to DSA also hits this target.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kernel pull request/issue with Linux kernel related changes target/mpc85xx pull request/issue for mpc85xx target
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet