BPI-R2 + OpenWRT latest trunk + mt7615e board not working

Is anything in /proc? Maybe you need to mount this first…

mount proc /proc -t proc

Too late, im already recompile toolchain. After few hours of building i try again.

When kernel starts with initramfs the /proc is normally populated. In other cases i cant check it because kernel runs without rootfs and i cant reach any controlled console. In new instance of git clone the behavior is same - not mounting any rootfs. If initrams presented in the image - it runs, but not external rootfs. Now i trying compile kernel without initramfs supporting and without ‘splitting firmware to kernel+squashfs’ ability. But I leave feature ‘use ROOTFS mtd partition for root filesystem’ in it place. Now compilation in progress.

No luck. Kernel still not load any rootfs.

I make another instance of git clone. I just select target banana pi r2, make defconfig and in make kernel_menuconfig set properly block2mtd bootargs. In kernl 5.4 openwrt is automatically finding rootfs and data partitions from one big MTD partition ‘firmware’. This feature working perfect, but WHY KERNEL NOT MOUNT FOUNDED ROOTFS?! I guess in the kernel no VFS to serve for mounting enything? Where i can get help with it? There is bootlog…

MMC read: dev # 1, block # 4096, count 24576 ... 24576 blocks read: OK
bootm flag=0, states=70f
## Booting kernel from Legacy Image at 84000000 ...
   Image Name:   ARM OpenWrt Linux-5.4.33
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3004094 Bytes = 2.9 MiB
   Load Address: 80008000
   Entry Point:  80008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 5.4.33 (andrey@andrey-notebook) (gcc version 8.4.0 (OpenWrt GCC 8.4.0 r13023-8d9c1087e4)) #0 SMP PREEMPT Sun Apr 19 14:45:40 2020
[    0.000000] CPU: ARMv7 Processor [410fc073] revision 3 (ARMv7), cr=10c5387d
[    0.000000] CPU: div instructions available: patching division code
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt: Machine model: Bananapi BPI-R2
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] percpu: Embedded 15 pages/cpu s30220 r8192 d23028 u61440
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 522559
[    0.000000] Kernel command line: earlyprintk console=ttyS2,115200 rootfstype=squashfs,jffs2 block2mtd.block2mtd=/dev/mmcblk1,65536,SD,5 mtdparts=SD:512k(mbr)ro,512k(uboot)ro,512k(config)ro,512k(factory)ro,128M(firmware)
[    0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes, linear)
[    0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 2066872K/2097148K available (7168K kernel code, 209K rwdata, 1616K rodata, 1024K init, 233K bss, 30276K reserved, 0K cma-reserved, 1310716K highmem)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] rcu: Preemptible hierarchical RCU implementation.
[    0.000000]  Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] random: get_random_bytes called from start_kernel+0x2f8/0x4a0 with crng_init=0
[    0.000000] arch_timer: cp15 timer(s) running at 13.00MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x2ff89eacb, max_idle_ns: 440795202429 ns
[    0.000006] sched_clock: 56 bits at 13MHz, resolution 76ns, wraps every 4398046511101ns
[    0.000016] Switching to timer-based delay loop, resolution 76ns
[    0.000159] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 147020034397 ns
[    0.000174] sched_clock: 32 bits at 13MHz, resolution 76ns, wraps every 165191050201ns
[    0.000444] Calibrating delay loop (skipped), value calculated using timer frequency.. 26.00 BogoMIPS (lpj=130000)
[    0.000458] pid_max: default: 32768 minimum: 301
[    0.000610] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes, linear)
[    0.000626] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes, linear)
[    0.001388] CPU: Testing write buffer coherency: ok
[    0.060037] Setting up static identity map for 0x80100000 - 0x80100060
[    0.080030] rcu: Hierarchical SRCU implementation.
[    0.120085] smp: Bringing up secondary CPUs ...
[    0.360532] smp: Brought up 1 node, 4 CPUs
[    0.360545] SMP: Total of 4 processors activated (104.00 BogoMIPS).
[    0.360551] CPU: All CPU(s) started in SVC mode.
[    0.370527] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 3
[    0.370888] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.370908] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
[    0.371128] pinctrl core: initialized pinctrl subsystem
[    0.371862] NET: Registered protocol family 16
[    0.372134] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.372960] No ATAGs?
[    0.471995] usbcore: registered new interface driver usbfs
[    0.472057] usbcore: registered new interface driver hub
[    0.472129] usbcore: registered new device driver usb
[    0.473456] clocksource: Switched to clocksource arch_sys_counter
[    0.474194] thermal_sys: Registered thermal governor 'step_wise'
[    0.474589] NET: Registered protocol family 2
[    0.475038] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
[    0.475070] TCP established hash table entries: 8192 (order: 3, 32768 bytes, linear)
[    0.475140] TCP bind hash table entries: 8192 (order: 4, 65536 bytes, linear)
[    0.475252] TCP: Hash tables configured (established 8192 bind 8192)
[    0.475353] UDP hash table entries: 512 (order: 2, 16384 bytes, linear)
[    0.475403] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes, linear)
[    0.475633] NET: Registered protocol family 1
[    0.475666] PCI: CLS 0 bytes, default 64
[    0.476751] workingset: timestamp_bits=14 max_order=19 bucket_order=5
[    0.481927] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.481940] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.516870] bounce: pool size: 64 pages
[    0.532590] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    0.553730] 11002000.serial: ttyS0 at MMIO 0x11002000 (irq = 199, base_baud = 1625000) is a ST16650V2
[    0.574326] 11003000.serial: ttyS1 at MMIO 0x11003000 (irq = 200, base_baud = 1625000) is a ST16650V2
[    0.594863] 11004000.serial: ttyS2 at MMIO 0x11004000 (irq = 201, base_baud = 1625000) is a ST16650V2
[    1.049961] printk: console [ttyS2] enabled
[    1.054714] mtk_rng 1020f000.rng: registered RNG driver
[    1.054855] random: fast init done
[    1.063571] random: crng init done
[    1.063995] loop: module loaded
[    1.070959] mt6323-regulator mt6323-regulator: Chip ID = 0x2023
[    1.086622] libphy: Fixed MDIO Bus: probed
[    1.113842] libphy: mdio: probed
[    1.117611] mtk_soc_eth 1b100000.ethernet: generated random MAC address 3e:04:63:80:da:ad
[    1.126253] mtk_soc_eth 1b100000.ethernet eth0: mediatek frame engine at 0xf08e0000, irq 213
[    1.135834] xhci-mtk 1a1c0000.usb: xHCI Host Controller
[    1.141077] xhci-mtk 1a1c0000.usb: new USB bus registered, assigned bus number 1
[    1.151561] xhci-mtk 1a1c0000.usb: hcc params 0x01401198 hci version 0x96 quirks 0x0000000000210010
[    1.160730] xhci-mtk 1a1c0000.usb: irq 210, io mem 0x1a1c0000
[    1.167191] hub 1-0:1.0: USB hub found
[    1.170970] hub 1-0:1.0: 1 port detected
[    1.175236] xhci-mtk 1a1c0000.usb: xHCI Host Controller
[    1.180466] xhci-mtk 1a1c0000.usb: new USB bus registered, assigned bus number 2
[    1.187882] xhci-mtk 1a1c0000.usb: Host supports USB 3.0 SuperSpeed
[    1.194221] usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
[    1.202743] hub 2-0:1.0: USB hub found
[    1.206534] hub 2-0:1.0: 1 port detected
[    1.211267] xhci-mtk 1a240000.usb: xHCI Host Controller
[    1.216530] xhci-mtk 1a240000.usb: new USB bus registered, assigned bus number 3
[    1.226950] xhci-mtk 1a240000.usb: hcc params 0x01401198 hci version 0x96 quirks 0x0000000000210010
[    1.236064] xhci-mtk 1a240000.usb: irq 211, io mem 0x1a240000
[    1.242462] hub 3-0:1.0: USB hub found
[    1.246259] hub 3-0:1.0: 1 port detected
[    1.250486] xhci-mtk 1a240000.usb: xHCI Host Controller
[    1.255733] xhci-mtk 1a240000.usb: new USB bus registered, assigned bus number 4
[    1.263129] xhci-mtk 1a240000.usb: Host supports USB 3.0 SuperSpeed
[    1.269465] usb usb4: We don't know the algorithms for LPM for this host, disabling LPM.
[    1.277998] hub 4-0:1.0: USB hub found
[    1.281772] hub 4-0:1.0: 1 port detected
[    1.286313] i2c /dev entries driver
[    1.291301] mtk-thermal 1100b000.thermal: Device not calibrated, using default calibration values
[    1.300970] mtk-wdt 10007000.watchdog: Watchdog enabled (timeout=31 sec, nowayout=0)
[    1.309199] cpu cpu0: dummy supplies not allowed for exclusive requests
[    1.317313] sdhci: Secure Digital Host Controller Interface driver
[    1.323513] sdhci: Copyright(c) Pierre Ossman
[    1.354137] mtk-msdc 11240000.mmc: Got CD GPIO
[    1.384619] sdhci-pltfm: SDHCI platform and OF driver helper
[    1.397742] NET: Registered protocol family 10
[    1.402998] Segment Routing with IPv6
[    1.406894] NET: Registered protocol family 17
[    1.411617] 8021q: 802.1Q VLAN Support v1.8
[    1.416040] ThumbEE CPU extension supported.
[    1.420331] Registering SWP/SWPB emulation handler
[    1.442073] mmc0: new high speed MMC card at address 0001
[    1.448709] mmcblk0: mmc0:0001 8GTF4R 0 B 
[    1.453572] mmcblk0boot0: mmc0:0001 8GTF4R partition 1 4.00 MiB
[    1.453653] mtk-pcie 1a140000.pcie: host bridge /pcie@1a140000 ranges:
[    1.460195] mmcblk0boot1: mmc0:0001 8GTF4R partition 2 4.00 MiB
[    1.466064] mtk-pcie 1a140000.pcie:    IO 0x1a160000..0x1a16ffff -> 0x1a160000
[    1.472614] mmcblk0gp0: mmc0:0001 8GTF4R partition 4 3.64 GiB
[    1.479220] mtk-pcie 1a140000.pcie:   MEM 0x60000000..0x6fffffff -> 0x60000000
[    1.485104] mmcblk0rpmb: mmc0:0001 8GTF4R partition 3 512 KiB, chardev (250:0)
[    1.499436] mmc1: host does not support reading read-only switch, assuming write-enable
[    1.509769] mmc1: new high speed SDHC card at address 0002
[    1.516085] mmcblk1: mmc1:0002 N/A   7.44 GiB 
[    1.520657]  mmcblk0gp0: p1
[    1.536140] mtk-pcie 1a140000.pcie: PCI host bridge to bus 0000:00
[    1.542324] pci_bus 0000:00: root bus resource [bus 00-ff]
[    1.547826] pci_bus 0000:00: root bus resource [io  0x0000-0xffff] (bus address [0x1a160000-0x1a16ffff])
[    1.557306] pci_bus 0000:00: root bus resource [mem 0x60000000-0x6fffffff]
[    1.564211] pci 0000:00:00.0: [14c3:0801] type 01 class 0x060400
[    1.570234] pci 0000:00:00.0: reg 0x14: [mem 0x00000000-0x0000ffff]
[    1.576563] pci 0000:00:00.0: supports D1
[    1.580565] pci 0000:00:00.0: PME# supported from D0 D1 D3hot
[    1.586604] pci 0000:00:01.0: [14c3:0801] type 01 class 0x060400
[    1.592622] pci 0000:00:01.0: reg 0x14: [mem 0x00000000-0x0000ffff]
[    1.598948] pci 0000:00:01.0: supports D1
[    1.602951] pci 0000:00:01.0: PME# supported from D0 D1 D3hot
[    1.610295] PCI: bus0: Fast back to back transfers disabled
[    1.615880] pci 0000:00:00.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[    1.623890] pci 0000:00:01.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[    1.632008] pci 0000:01:00.0: [168c:0030] type 00 class 0x028000
[    1.638056] pci 0000:01:00.0: reg 0x10: [mem 0x00000000-0x0001ffff 64bit]
[    1.644885] pci 0000:01:00.0: reg 0x30: [mem 0x00000000-0x0000ffff pref]
[    1.651665] pci 0000:01:00.0: supports D1 D2
[    1.655938] pci 0000:01:00.0: PME# supported from D0 D1 D2 D3hot D3cold
[    1.664173] PCI: bus1: Fast back to back transfers disabled
[    1.669742] pci_bus 0000:01: busn_res: [bus 01-ff] end is updated to 01
[    1.676480] pci 0000:02:00.0: [1b21:0611] type 00 class 0x010185
[    1.682502] pci 0000:02:00.0: reg 0x10: initial BAR value 0x00000000 invalid
[    1.689554] pci 0000:02:00.0: reg 0x10: [io  size 0x0008]
[    1.694961] pci 0000:02:00.0: reg 0x14: initial BAR value 0x00000000 invalid
[    1.702001] pci 0000:02:00.0: reg 0x14: [io  size 0x0004]
[    1.707407] pci 0000:02:00.0: reg 0x18: initial BAR value 0x00000000 invalid
[    1.714456] pci 0000:02:00.0: reg 0x18: [io  size 0x0008]
[    1.719853] pci 0000:02:00.0: reg 0x1c: initial BAR value 0x00000000 invalid
[    1.726902] pci 0000:02:00.0: reg 0x1c: [io  size 0x0004]
[    1.732299] pci 0000:02:00.0: reg 0x20: initial BAR value 0x00000000 invalid
[    1.739348] pci 0000:02:00.0: reg 0x20: [io  size 0x0010]
[    1.744755] pci 0000:02:00.0: reg 0x24: [mem 0x00000000-0x000001ff]
[    1.751020] pci 0000:02:00.0: reg 0x30: [mem 0x00000000-0x0000ffff pref]
[    1.759353] PCI: bus2: Fast back to back transfers disabled
[    1.764932] pci_bus 0000:02: busn_res: [bus 02-ff] end is updated to 02
[    1.771563] pci 0000:00:00.0: BAR 8: assigned [mem 0x60000000-0x600fffff]
[    1.778356] pci 0000:00:00.0: BAR 9: assigned [mem 0x60100000-0x601fffff pref]
[    1.785581] pci 0000:00:01.0: BAR 8: assigned [mem 0x60200000-0x602fffff]
[    1.792362] pci 0000:00:01.0: BAR 9: assigned [mem 0x60300000-0x603fffff pref]
[    1.799589] pci 0000:00:00.0: BAR 1: assigned [mem 0x60400000-0x6040ffff]
[    1.806386] pci 0000:00:01.0: BAR 1: assigned [mem 0x60410000-0x6041ffff]
[    1.813169] pci 0000:00:01.0: BAR 7: assigned [io  0x1000-0x1fff]
[    1.819269] pci 0000:01:00.0: BAR 0: assigned [mem 0x60000000-0x6001ffff 64bit]
[    1.826599] pci 0000:01:00.0: BAR 6: assigned [mem 0x60100000-0x6010ffff pref]
[    1.833825] pci 0000:00:00.0: PCI bridge to [bus 01]
[    1.838786] pci 0000:00:00.0:   bridge window [mem 0x60000000-0x600fffff]
[    1.845575] pci 0000:00:00.0:   bridge window [mem 0x60100000-0x601fffff pref]
[    1.852796] pci 0000:02:00.0: BAR 6: assigned [mem 0x60300000-0x6030ffff pref]
[    1.860022] pci 0000:02:00.0: BAR 5: assigned [mem 0x60200000-0x602001ff]
[    1.866814] pci 0000:02:00.0: BAR 4: assigned [io  0x1000-0x100f]
[    1.872904] pci 0000:02:00.0: BAR 0: assigned [io  0x1010-0x1017]
[    1.879005] pci 0000:02:00.0: BAR 2: assigned [io  0x1018-0x101f]
[    1.885103] pci 0000:02:00.0: BAR 1: assigned [io  0x1020-0x1023]
[    1.891193] pci 0000:02:00.0: BAR 3: assigned [io  0x1024-0x1027]
[    1.897293] pci 0000:00:01.0: PCI bridge to [bus 02]
[    1.902251] pci 0000:00:01.0:   bridge window [io  0x1000-0x1fff]
[    1.908347] pci 0000:00:01.0:   bridge window [mem 0x60200000-0x602fffff]
[    1.915138] pci 0000:00:01.0:   bridge window [mem 0x60300000-0x603fffff pref]
[    1.922516] pcieport 0000:00:00.0: enabling device (0140 -> 0142)
[    1.928763] pcieport 0000:00:00.0: PME: Signaling with IRQ 224
[    1.934834] pcieport 0000:00:00.0: AER: enabled with IRQ 224
[    1.940730] pcieport 0000:00:01.0: enabling device (0140 -> 0143)
[    1.946955] pcieport 0000:00:01.0: PME: Signaling with IRQ 225
[    1.952987] pcieport 0000:00:01.0: AER: enabled with IRQ 225
[    2.113636] libphy: dsa slave smi: probed
[    2.117891] mt7530 mdio-bus:00 wan (uninitialized): PHY [dsa-0.0:00] driver [Generic PHY]
[    2.126791] mt7530 mdio-bus:00 lan0 (uninitialized): PHY [dsa-0.0:01] driver [Generic PHY]
[    2.135707] mt7530 mdio-bus:00 lan1 (uninitialized): PHY [dsa-0.0:02] driver [Generic PHY]
[    2.144582] mt7530 mdio-bus:00 lan2 (uninitialized): PHY [dsa-0.0:03] driver [Generic PHY]
[    2.153417] mt7530 mdio-bus:00 lan3 (uninitialized): PHY [dsa-0.0:04] driver [Generic PHY]
[    2.162507] mt7530 mdio-bus:00: configuring for fixed/trgmii link mode
[    2.172103] mt7530 mdio-bus:00: Link is Up - 1Gbps/Full - flow control off
[    2.172660] DSA: tree 0 setup
[    2.182493] 5 cmdlinepart partitions found on MTD device SD
[    2.188077] Creating 5 MTD partitions on "SD":
[    2.192518] 0x000000000000-0x000000080000 : "mbr"
[    2.197989] 0x000000080000-0x000000100000 : "uboot"
[    2.203378] 0x000000100000-0x000000180000 : "config"
[    2.208895] 0x000000180000-0x000000200000 : "factory"
[    2.214487] 0x000000200000-0x000008200000 : "firmware"
[    4.462606] 2 uimage-fw partitions found on MTD device firmware
[    4.468562] 0x000000200000-0x0000004dd6fe : "kernel"
[    4.474207] 0x0000004dd6fe-0x000008200000 : "rootfs"
[    4.479685] mtd: device 6 (rootfs) set to be root filesystem
[    4.485380] 1 squashfs-split partitions found on MTD device rootfs
[    4.491555] 0x000000680000-0x000008200000 : "rootfs_data"
[    4.497501] block2mtd: mtd0: [SD] erase_size = 64KiB [65536]
[    4.503308] hctosys: unable to open rtc device (rtc0)
[   35.033526] vusb: disabling
[   35.036326] vmc: disabling
[   35.039031] vmch: disabling
[   35.041824] vgp1: disabling
[   35.044668] vcamaf: disabling

Now i cant compile firmware at all.

drivers/net/ethernet/mediatek/mtk_eth_soc.c:70:5: error: conflicting types for 'mtk_m32'
 u32 mtk_m32(struct mtk_eth *eth, u32 mask, u32 set, unsigned reg)
     ^~~~~~~
In file included from drivers/net/ethernet/mediatek/mtk_eth_soc.c:25:
drivers/net/ethernet/mediatek/mtk_eth_soc.h:964:6: note: previous declaration of 'mtk_m32' was here
 void mtk_m32(struct mtk_eth *eth, u32 clear, u32 set, unsigned reg);
      ^~~~~~~
make[9]: *** [scripts/Makefile.build:266: drivers/net/ethernet/mediatek/mtk_eth_soc.o] Error 1
make[8]: *** [scripts/Makefile.build:500: drivers/net/ethernet/mediatek] Error 2
make[7]: *** [scripts/Makefile.build:500: drivers/net/ethernet] Error 2
make[7]: *** Waiting for unfinished jobs....
.
.
.
make[6]: *** [scripts/Makefile.build:500: drivers/net] Error 2
make[6]: *** Waiting for unfinished jobs....
.
.
.
make[5]: *** [Makefile:1692: drivers] Error 2
make[5]: *** Waiting for unfinished jobs....
.
.
.
make[5]: Leaving directory '/home/andrey/eMMC/banana-pi/openwrt/build_dir/target-arm_cortex-    a7+neon-vfpv4_musl_eabi/linux-mediatek_mt7623/linux-5.4.35'
make[4]: *** [Makefile:19: /home/andrey/eMMC/banana-pi/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-mediatek_mt7623/linux-5.4.35/.image] Error 2
make[4]: Leaving directory '/home/andrey/eMMC/banana-pi/openwrt/target/linux/mediatek'
make[3]: *** [Makefile:13: install] Error 2
make[3]: Leaving directory '/home/andrey/eMMC/banana-pi/openwrt/target/linux'
time: target/linux/install#179.14#30.07#58.04
make[2]: *** [target/Makefile:25: target/linux/install] Error 2
make[2]: Leaving directory '/home/andrey/eMMC/banana-pi/openwrt'
make[1]: *** [target/Makefile:19: /home/andrey/eMMC/banana-pi/openwrt/staging_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/stamp/.target_install] Error 2
make[1]: Leaving directory '/home/andrey/eMMC/banana-pi/openwrt'
make: *** [/home/andrey/eMMC/banana-pi/openwrt/include/toplevel.mk:220: world] Ошибка 2

What im do wrong?

I got the same. Looks like some bug in one of patch. Comment whole function

u32 mtk_m32(struct mtk_eth *eth, u32 mask, u32 set, unsigned reg)

In file drivers/net/ethernet/mediatek/mtk_eth_soc.c:70

I guess you cannot comment out the function…

You have different return-types and one parameter differs.

First look in c-file if mask or clear is used and the if a return-statement is used (use u32 instead of void in header file)

I mannually edited this file

> 32 mtk_r32(struct mtk_eth *eth, unsigned reg)
{
	return __raw_readl(eth->base + reg);
}

/*u32 mtk_m32(struct mtk_eth *eth, u32 mask, u32 set, unsigned reg)
{
	u32 val;

	val = mtk_r32(eth, reg);
	val &= ~mask;
	val |= set;
	mtk_w32(eth, val, reg);
	return reg;
}*/

void mtk_m32(struct mtk_eth *eth, u32 clear, u32 set, unsigned reg)
{
	u32 val;

	spin_lock(&eth->page_lock);
	val = __raw_readl(eth->base + reg);
	val &= ~clear;
	val |= set;
	__raw_writel(val, eth->base + reg);
	spin_unlock(&eth->page_lock);
}

and it worked

PS. :slight_smile: How to correct paste code here on forum?

You mean it compiles…i guess your current code does not work because the function sets options needed for initialization

Right way is to fix different declaration between h and c file

Select code while editing and press <> button

How openwrt kernel knows where the rootfs is? I cant change uboot bootargs env, i specify kernel command line in kernel_menuconfig, overraiding uboot commandline. My commandline is

earlyprintk console=ttyS2,115200n8 block2mtd.block2mtd=/dev/mmcblk1,65536,SD,5 mtdparts=SD:512k(mbr)ro,512k(uboot)ro,512k(config)ro,512k(factory)ro,128M(firmware) rootfstype=squashfs,jffs2

Also, i leave checked in kernel_menuconfig openwrt-specified mtd parsers. And they normally works, parse ‘firmware’ to ‘kernel’, ‘rootfs’ and ‘rootfs_data’ mtd partitions. But kernel still not mount rootfs, without any errors or attempts. I lurk about openwrt kernel boot process, about openwrt mtd parsers, and about generic kernel boot process, and not understand what im doing wrong. Where in kernel_menuconfig option for make console output more messages for debugging?

Hello, I’m trying not to spend ages figuring out how to make OpenWrt trunk work fine with bpi-r2. There are people that managed to make it work (https://www.openmptcprouter.com/). This project works with with an ext4 rootfs and there are working images with 5.4 kernel too (https://www.openmptcprouter.com/release/develop/5.4/bpi-r2/targets/mediatek/mt7623/). You just need to play a little with the config as it is a project to use bpi-r2 to merge 2 or more upstream internet connection (ex. fibre optic and LTE): you need to revert the LAN port to act as WAN and the WAN Switch to act as LAN as in a normal router. The problem is the mt7615e driver included in <5.4 linux kernel that is still not working as expected. The TX Power is stuck to 6dBm and there is no way to increase it.(https://patchwork.kernel.org/patch/11358235/).

But i need manually selected packages. Like an ISCSI targe, or torrent client, or i2p daemon, etc. Theats why i spend time to build my own firmware. Befor bpi-r2 i use miwifi3g router and make openwrt firmwares without any trubles.

Reading comments and patch code it looks like that txpower reporting is broken in a first place (mphy->txpower_cur is no longer updated when txpower is set in mt7615_mcu_set_txpower_sku() leaving value in mphy->txpower_cur stale and non-representative of the real txpower level.

I know that most probably you hadn’t but have to ask just in case: have you had a chance to check real transmit power using some kind of a professional WiFi analyzer gear? Without measuring of a real mwatts emitted from the antennas it is impossible to tell if the problem is in broken power reporting or broken txpower setup.

have you tried applying the Patch you’ve linked?

Hello Alexey, I have no such material.at home, I use regular devices to test the signal. I bought some good Antenna (8dBi), I have auxiliary power. The wifi signal drops dead 4-5 meters away from the router. I have associated the poor signal to the transmission power but maybe I’m wrong; as you say, there are other factors: but I’m not expert enough to diagnose.

1 Like

I have tried the patch on your 4.19 and 5.4 kernel versions. But it report for a conflict (while applying the patch) and I’m not expert enough to look into the code and find a solution. If you think you can do something I will try to reproduce the error and post some logs here in the forum

No need to worry about not being and expert - most of us here are not :slight_smile:.

You wrote that signal drops dead in like 4-5 meters away from the router. May I ask you to elaborate a bit on the test setup you have?

I guess you had been using R2 running some OpenWRT-derived OS build as a userspace, mt7651e as a WiFi Access Point and your custom-built kernel as - you guessed it - kernel :smiley:. Then you’ve been using some other device as a WiFi client connecting to the R2 AP. Am I right?

If so - it would be interesting to get more details on:

  1. What was the client device and what software was it using?
  2. What configuration settings were used on R2 AP side, i.e. WiFi standard, band, channel, channel width, e.t.c.
  3. Were there any kernel/wifi driver combinations you had tested which were not experiencing wifi signal drops to nothing at 4-5 meters distance?
  4. What about trying to test with another client device - in my experience there were situations when my Android-based phone was working perfectly while iPad was loosing signal all the time, with the fix found by trial and error being moving to another channel and disabling HT-40.

I understand you have a lot of question, there are a lot of variables in my reported problem. Let’s start with the HW: I have bpi-r2 and mt7615 (PCIe) from sinovip (recent purchases). + 4 8dBi antennaes Client Devices are Xiaomi Android low cost, iPhone 7 and Samsung Tablet

I managed to have mt7615 driver loaded and operational in the following OS config:

  1. Debian + 5.4.22 from frank-w (https://github.com/frank-w/BPI-R2-4.14/releases/tag/CI-BUILD-20200225_203315-c075525e6)

  2. Openwrt 19.07.2 stock bin + kmod.mt7615e. Just a few tests as it is a non persistent OS and it is very painful

  3. OpenMPTCPRouter.com 0.55 beta 2 with 5.4.22 kernel + kmod mt7615e

For all tests I have used mt7615 in AP mode with Hostapd

The tests with config 1 (Debian) I have no track of the parameter matrix, but I have tested all combinations of N and AC mode at different frequencies. All working fine but with a very poor range.

The tests with config 3 (openmptcp router) are still on-going. if you have some suggestion on how to test and which config, I’m available to contribute (I’m using netgear wi-fi analyzer to measure the signal levels)… The tx power is stuck to 6dBm but all modes (N and AC) are working at all allowed frequencies: range is still poor (radius of 4-5 meters before disconnection).

@adiz, thanks for detailed info on this, looks good and reasonable.

Just to make sure: from where does this number come from? Netgear wi-fi analyzer running on XIaomi device? Or from OpenMPTCP/OpenWRT web gui or command line?

What is strange is the fact that range is the same level bad on all allowed frequencies. My expectations would be that 2.4GHz band should provide a better coverage when transmitting at some defined power level compared to 5GHz.

Nevertheless you confirm that the range/coverage is poor for you which means that there are issues with driver :frowning:. Unfortunately I’m not able to help you with this by doing my own tests as I don’t have bpi-mt7615e board and chances are low that I will get one soon - at the moment they only do offer EMS shipment to my country which costs the same as a wifi module itself and I’m refusing to pay that much for shipment at the same time I get stuff from other AliExpress sellers shipped at a fraction of EMS cost.

As a general suggestion on debugging this one I’d say that you’d need to find at least one software combination that works fine and provides you with a good wifi coverage. My approach would be to use some well established userland like debian 10 or 11 and couple it with self-built kernels based on @frank-w kernel repo. Giving https://backports.wiki.kernel.org/index.php/Releases a try is also a good idea. Main goal here would be to find a working baseline and then it would be possible to use git bisect or similar technique to determine the change where txpower gone wrong.