Full feature Linux kernel - which one to use?

it seems no problem with CPU-detection but there is a nullpointer dereference near mt2701_afe_pcm_driver_init

but this is new to me (only comes up in 4.9 and not from any patch)

do you use now 4.9-config from lede-repo?

i hoped that this kernel works better (but was only created for comparision and not tested), because there are not modifications by me…only the official patches from garys lede-repo

it seems that we need to wait for vendors help ;(

had added config (based on 4.9 from lede)+buildscript to 4.9-branch

can compile, but get the dtc warnings

  DTC     arch/arm/boot/dts/mt7623-evb.dtb
Warning (reg_format): "reg" property in /mt7530@0 has invalid length (4 bytes) (#address-cells == 2, #size-cells == 2)
  DTC     arch/arm/boot/dts/mt7623-eMMC.dtb
Warning (reg_format): "reg" property in /switch has invalid length (4 bytes) (#address-cells == 2, #size-cells == 2)
  DTC     arch/arm/boot/dts/mt7623-NAND.dtb
  DTC     arch/arm/boot/dts/mt7623-NAND-ePHY.dtb
  DTC     arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dtb
Warning (reg_format): "reg" property in /mt7530@0 has invalid length (4 bytes) (#address-cells == 2, #size-cells == 2)
Warning (reg_format): "reg" property in /switch has invalid length (4 bytes) (#address-cells == 2, #size-cells == 2)

same issue, glad you can reproduce it. Can you boot on kernel 4.9?

currently it stops after

Starting kernel ...

uart2 is enabled in dts and no other so that this is not the problem…

added pinmux for uart2, but still hang after loading kernel

after adding serial-drivers i get boot-output :wink:

[    2.884457] VFS: Cannot open root device "mmcblk0p2" or unknown-block(179,2)9
[    2.892415] Please append a correct "root=" boot option; here are the availa:
[    2.900766] b300         7634944 mmcblk0 [    2.904585]  driver: mmcblk      
[    2.907366] b318             512 mmcblk0rpmb [    2.911513]  (driver?)       
[    2.913861] b310            4096 mmcblk0boot1 [    2.918121]  (driver?)      
[    2.920471] b308            4096 mmcblk0boot0 [    2.924717]  (driver?)      
[    2.927066] b320        30375936 mmcblk1 [    2.930869]  driver: mmcblk      
[    2.933647]   b321          262144 mmcblk1p1 000ed6cd-01[    2.938764]       
[    2.940251]   b322         7270400 mmcblk1p2 000ed6cd-02[    2.945357]       
[    2.946844] Kernel panic - not syncing: VFS: Unable to mount root fs on unkn)

so i have to swap mmc0/1

hanging now on

/sbin/init: /lib/arm-linux-gnueabihf/libc.so.6: version `LIBPAM_1.0' not found )
/sbin/init: /lib/arm-linux-gnueabihf/libc.so.6: version `LIBKMOD_5' not found ()

kernel 4.9 compiled and booting

had some trouble because “make mt7623n_evb_fwu_defconfig” did not import arch/arm/configs/mt7623n_evb_fwu_defconfig…now making manual copy and this works…

Linux bpi-r2 4.9.44-bpi-r2+ #153 SMP Mon Mar 19 19:05:03 CET 2018 armv7l        
[18:54] root@bpi-r2:~# ip a                                                     
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group defau1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00                       
    inet 127.0.0.1/8 scope host lo                                              
       valid_lft forever preferred_lft forever                                  
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP g0
    link/ether 12:5a:b1:db:d9:c5 brd ff:ff:ff:ff:ff:ff                          
3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qle0
    link/ether 4a:b5:c9:5a:a5:7a brd ff:ff:ff:ff:ff:ff          

i miss the lan/wan-Ports…maybe some additional driver is missing (had used my config from 4.14)…

added hnat and got compile error…fixed…now the section mismatch

WARNING: drivers/net/ethernet/mediatek/mtk_hnat/mtkhnat.o(.text+0x628): Section mismatch in reference from the function hnat_probe() to the function .init.text:hnat_init_debugfs()
The function hnat_probe() references
the function __init hnat_init_debugfs().
This is often because hnat_probe lacks a __init 
annotation or the annotation of hnat_init_debugfs is wrong.

Great so you are able to compile kernel 4.9 and boot! We should have all lede kernel feature. For port-separation, you are missing the DSA driver to see multiple lan0-3 nic. However is it need? All lan nic you should act as hardware swicth with gmac eth0, or i am miss-understanding?

Can you confirm, you have both hwnat, hwqos, vlan, enable?

  • Enable MediaTek MT7623 Gigabit ethernet support, NET_MEDIATEK_SOC
  • Enable MediaTek MT7623 hardware NAT support, NET_MEDIATEK_HNAT
  • Enable MediaTek MT7623 hardware QoS support, NET_MEDIATEK_HW_QOS

As mention we need a kernel will all feature advertise in the website

  • switch
  • router
  • vlan
  • wifi AP
  • nas

mhm…added dsa-driver, but still no lan/wan (only eth0/eth1)

but hnat is loadable

[19:11] root@bpi-r2:~# modprobe mtkhnat                                         
[19:11] root@bpi-r2:~# lsmod                                                    
Module                  Size  Used by                                           
mtkhnat                14617  0

NET_DSA_MT7530 seems to be needed…

The module for the dsa is call mt7530 in kernel 4.14.

  • eth1 should act as wan?
  • eth0 should act as a lan physical switch?
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP g0
    link/ether 22:ef:ec:35:57:71 brd ff:ff:ff:ff:ff:ff                          
    inet6 fe80::20ef:ecff:fe35:5771/64 scope link                               
       valid_lft forever preferred_lft forever                                  
3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qle0
    link/ether 9e:55:02:d6:1f:dc brd ff:ff:ff:ff:ff:ff                          
4: wan@eth1: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc noop state DOWN group 0
    link/ether 9e:55:02:d6:1f:dc brd ff:ff:ff:ff:ff:ff                          
5: lan0@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state 0
    link/ether 08:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff                          
    inet 192.168.0.11/24 brd 192.168.0.255 scope global lan0                    
       valid_lft forever preferred_lft forever                                  
6: lan1@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state 0
    link/ether 08:00:00:00:00:01 brd ff:ff:ff:ff:ff:ff                          
    inet 192.168.1.10/24 brd 192.168.1.255 scope global lan1                    
       valid_lft forever preferred_lft forever                                  
7: lan2@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group defaul0
    link/ether 22:ef:ec:35:57:71 brd ff:ff:ff:ff:ff:ff                          
8: lan3@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group defaul0
    link/ether 22:ef:ec:35:57:71 brd ff:ff:ff:ff:ff:ff

that is great! you made it! DSA is fine on 4.9 lede. I got a merge conflict while update your repo, have to re-download the all kernel. Can you test the vlan?

currently i have no time to make further tests…

I run some test on kernel 4.4.120 using your repo.

For clarification, without DSA driver you don’t see any of the LAN/WAN interface, however the system does act as a physical on eth0, so need to bridge. Or i am missing something?

I got the 2 gmac

[    3.766296] mtk_eth_soc 1b100000.ethernet: generated random MAC address da:ce:d2:f9:b4:78
[    3.774770] mtk_eth_soc 1b100000.ethernet: connected mac 0 to PHY at fixed-0:00 [uid=00000000, driver=Generic PHY]
[    3.785654] mtk_eth_soc 1b100000.ethernet eth0: mediatek frame engine at 0xe32c0000, irq 71
[    3.793998] mtk_eth_soc 1b100000.ethernet: generated random MAC address 3e:38:12:1d:2d:14
[    3.802430] mtk_eth_soc 1b100000.ethernet: connected mac 1 to PHY at fixed-0:01 [uid=00000000, driver=Generic PHY]
[    3.813229] mtk_eth_soc 1b100000.ethernet eth1: mediatek frame engine at 0xe32c0000, irq 71

also I found something not present in other kerne 49 and 4.14, MTK AHCI SATA support, AHCI_MTK However my SATA drive are detected but no device…

[    1.730721] ata1: SATA max UDMA/133 abar m512@0x60000000 port 0x60000100 irq 63
[    1.737996] ata2: SATA max UDMA/133 abar m512@0x60000000 port 0x60000180 irq 63
...
[    2.310571] ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
[    2.311326] ata1.00: ATA-10: INTEL SSDSC2KW480H6,  LSF036C, max UDMA/133
[    2.311331] ata1.00: 937703088 sectors, multi 16: LBA48 NCQ (depth 31/32), AA
[    2.311859] ata1.00: configured for UDMA/133
[    2.326174] scsi 0:0:0:0: Direct-Access     ATA      INTEL SSDSC2KW48 036C PQ: 0 ANSI: 5
...
[    2.870576] ata2: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
[    2.877458] ata2.00: ATA-10: INTEL SSDSC2KW480H6,  LSF036C, max UDMA/133
[    2.884135] ata2.00: 937703088 sectors, multi 16: LBA48 NCQ (depth 31/32), AA
[    2.891747] ata2.00: configured for UDMA/133
[    2.896486] scsi 1:0:0:0: Direct-Access     ATA      INTEL SSDSC2KW48 036C PQ: 0 ANSI: 5

/proc/interrupts

# cat /proc/interrupts 
           CPU0       CPU1       CPU2       CPU3       
 16:      14046      88889     102829       8222       GIC  29 Edge      arch_timer
 17:          0          0          0          0       GIC  30 Edge      arch_timer
 20:          0          0          0          0  MT_SYSIRQ 112 Level     mtk_timer
 23:          0          0          0          0  MT_SYSIRQ  88 Edge      mtk-wdt
 24:          0          0          0          0  MT_SYSIRQ  78 Level     1100a000.spi
 25:          0          0          0          0  MT_SYSIRQ 115 Level     mt-pmic-pwrap
 26:          4          0          0          0  MT_SYSIRQ 182 Level     hdmi hpd
 27:          0          0          0          0  MT_SYSIRQ 106 Level     10205000.mmsys_iommu
 31:       7323          0          0          0  MT_SYSIRQ  53 Level     serial
 35:          0          0          0          0  MT_SYSIRQ  44 Level     i2c-mt65xx
 36:         29          0          0          0  MT_SYSIRQ  45 Level     i2c-mt65xx
 37:          0          0          0          0  MT_SYSIRQ  46 Level     i2c-mt65xx
 42:          0          0          0          0  MT_SYSIRQ  32 Level     musb-hdrc.1.auto
 43:          0          0          0          0  MT_SYSIRQ 104 Level     afe-isr
 44:          0          0          0          0  MT_SYSIRQ 132 Level     asys-isr
 45:         52          0          0          0  MT_SYSIRQ  40 Level     11240000.mmc
 46:       7483          0          0          0  MT_SYSIRQ  39 Level     11230000.mmc
 47:          0          0          0          0  MT_SYSIRQ 170 Level     Mali_GP
 48:          0          0          0          0  MT_SYSIRQ 171 Level     Mali_GP_MMU
 49:          0          0          0          0  MT_SYSIRQ 172 Level     Mali_PP0
 50:          0          0          0          0  MT_SYSIRQ 173 Level     Mali_PP0_MMU
 51:          0          0          0          0  MT_SYSIRQ 174 Level     Mali_PP1
 52:          0          0          0          0  MT_SYSIRQ 175 Level     Mali_PP1_MMU
 53:          0          0          0          0  MT_SYSIRQ 176 Level     Mali_PP2
 54:          0          0          0          0  MT_SYSIRQ 177 Level     Mali_PP2_MMU
 55:          0          0          0          0  MT_SYSIRQ 180 Level     Mali_PP_Broadcast
 56:          0          0          0          0  MT_SYSIRQ 153 Level     14007000.ovl
 57:          0          0          0          0  MT_SYSIRQ 152 Level     14008000.rdma
 62:          0          0          0          0  MT_SYSIRQ 164 Level     14012000.rdma
 63:         18          0          0          0  MT_SYSIRQ 194 Level     0000:01:00.0
 69:          0          0          0          0  MT_SYSIRQ 196 Level     xhci-hcd:usb1
 70:          0          0          0          0  MT_SYSIRQ 197 Level     xhci-hcd:usb3
 72:       2216          0          0          0  MT_SYSIRQ 199 Level     1b100000.ethernet
 73:       4385          0          0          0  MT_SYSIRQ 198 Level     1b100000.ethernet
 74:          0          0          0          0  MT_SYSIRQ  82 Level     mtk-aes
 75:          0          0          0          0  MT_SYSIRQ  83 Level     mtk-aes
 76:          0          0          0          0  MT_SYSIRQ  84 Level     mtk-sha
 77:          0          0          0          0  MT_SYSIRQ  91 Level     mtk-sha
 79:          0          0          0          0  MT_SYSIRQ  87 Level     mtk-ir
 97:         10          0          0          0   mt-eint  17 Edge      gsw
106:          0          0          0          0   mt-eint  26 Level     USB_IDDIG
226:          0          0          0          0   mt-eint 146 Edge      11240000.mmc cd
230:          0          0          0          0   mt-eint 150 Level     mt6397-pmic
IPI0:          0          1          1          1  CPU wakeup interrupts
IPI1:          0          0          0          0  Timer broadcast interrupts
IPI2:       4417       4267       1491       1578  Rescheduling interrupts
IPI3:          5          6          5          5  Function call interrupts
IPI4:          3          0          0          2  Single function call interrupts
IPI5:          0          0          0          0  CPU stop interrupts
IPI6:          7          1          0          0  IRQ work interrupts
IPI7:          0          0          0          0  completion interrupts
Err:          0

Re-compile kernel 4.9 form your repository, and i still can’t boot, kernel panic. Seem like my config is wrong.

[    1.315091] Unable to handle kernel NULL pointer dereference at virtual address 00000000
[    1.323174] pgd = c0004000
[    1.325880] [00000000] *pgd=00000000
[    1.329445] Internal error: Oops: 5 [#1] SMP ARM
[    1.334033] Modules linked in:
[    1.337076] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.9.44-00022-g1cff8763e07a #1
[    1.344688] Hardware name: Mediatek Cortex-A7 (Device Tree)
[    1.350224] task: de8e8000 task.stack: de8e2000
[    1.354733] PC is at clk_hw_round_rate+0x28/0x54
[    1.359322] LR is at divider_round_rate+0x1b4/0x550
[    1.364170] pc : [<c0412da4>]    lr : [<c0418c1c>]    psr: 60000013
[    1.364170] sp : de8e3a68  ip : de8e3a98  fp : de8e3a94
[    1.375578] r10: 00000000  r9 : de83c380  r8 : 00000000
[    1.380769] r7 : 00000100  r6 : 02ee0000  r5 : 02ee0000  r4 : 00000000
[    1.387253] r3 : de883d80  r2 : de8e3a74  r1 : de8e3a70  r0 : 00000000
[    1.393739] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
[    1.400827] Control: 10c5387d  Table: 8000406a  DAC: 00000051
[    1.406535] Process swapper/0 (pid: 1, stack limit = 0xde8e2218)
[    1.412502] Stack: (0xde8e3a68 to 0xde8e4000)

hi xbgmsharp

We will support Kernel 4.14 in next release, both 2GMAC and HDMI will supported. but no plan to support sound(I2S) yet.

Thanks Gary

Do you use my buil.sh to import config?

make xxx_defconfig does not work with 4.9…i have no clue why…if i cp the defconfig to .config it works

Thanks for the info, when is the next release? I don’t care much about the Kernel version, however i am looking to have all feature working properly. It can be 4.14, .4.9, 4.4 but need support for:

  • switch
  • router
  • vlan
  • wifi AP
  • nas

This time i try your config on kernel4.9, same compiling warning but it does boot :wink:

  CC      drivers/net/ethernet/mediatek/mtk_eth_soc.o
drivers/net/ethernet/mediatek/mtk_eth_soc.c: In function 'mtk_start_xmit':
drivers/net/ethernet/mediatek/mtk_eth_soc.c:677:9: warning: 'fport' may be used uninitialized in this function [-Wmaybe-uninitialized]
   fport |= 0x4 << TX_DMA_FPORT_SHIFT;
          
drivers/net/ethernet/mediatek/mtk_eth_soc.c:668:26: note: 'fport' was declared here
  u32 txd3 = 0, txd4 = 0, fport;
                          ^~~~~
  LD      drivers/net/ethernet/mediatek/built-in.o
  CC [M]  drivers/net/ethernet/mediatek/mtk_hnat/hnat_nf_hook.o
  LD [M]  drivers/net/ethernet/mediatek/mtk_hnat/mtkhnat.o
WARNING: drivers/net/ethernet/mediatek/mtk_hnat/mtkhnat.o(.text+0x604): Section mismatch in reference from the function hnat_probe() to the function .init.text:hnat_init_debugfs()
The function hnat_probe() references
the function __init hnat_init_debugfs().
This is often because hnat_probe lacks a __init 
annotation or the annotation of hnat_init_debugfs is wrong.

  LD      drivers/net/ethernet/built-in.o

I have a the 2Gmac, DSA, HWnat,

[    1.143585] mtk_soc_eth 1b100000.ethernet: generated random MAC address 32:89:df:c5:ff:5b
[    1.151752] of_get_named_gpiod_flags: can't parse 'link-gpios' property of node '/ethernet@1b100000/mac@0/fixed-link[0]'
[    1.163244] mtk_soc_eth 1b100000.ethernet: connected mac 0 to PHY at fixed-0:00 [uid=00000000, driver=Generic PHY]
[    1.174112] mtk_soc_eth 1b100000.ethernet eth0: mediatek frame engine at 0xe10a0000, irq 211
[    1.182559] mtk_soc_eth 1b100000.ethernet: generated random MAC address 62:29:88:68:89:ef
[    1.190717] of_get_named_gpiod_flags: can't parse 'link-gpios' property of node '/ethernet@1b100000/mac@1/fixed-link[0]'
[    1.201860] mtk_soc_eth 1b100000.ethernet: connected mac 1 to PHY at fixed-0:01 [uid=00000000, driver=Generic PHY]
[    1.212648] mtk_soc_eth 1b100000.ethernet eth1: mediatek frame engine at 0xe10a0000, irq 211
...
[    2.401186] Generic PHY dsa-0.0:00: attached PHY driver [Generic PHY] (mii_bus:phy_addr=dsa-0.0:00, irq=-1)
[    2.411564] Generic PHY dsa-0.0:01: attached PHY driver [Generic PHY] (mii_bus:phy_addr=dsa-0.0:01, irq=-1)
[    2.421922] Generic PHY dsa-0.0:02: attached PHY driver [Generic PHY] (mii_bus:phy_addr=dsa-0.0:02, irq=-1)
[    2.432279] Generic PHY dsa-0.0:03: attached PHY driver [Generic PHY] (mii_bus:phy_addr=dsa-0.0:03, irq=-1)
[    2.442626] Generic PHY dsa-0.0:04: attached PHY driver [Generic PHY] (mii_bus:phy_addr=dsa-0.0:04, irq=-1)

The udev rule don’t assing a MAC by gmac as both as detected as KERNELS=="1b100000.ethernet" I wonder how should the MAC be assign, same for lan0-3 and eth0 then a second MAC for eth1 and wan? Should i bridge all lan0-3 or only eth0? Also as i will vtag the wan traffic, should i use eth1 or WAN nic? How to get the best network performance?

you only work with lanx/wan…don’t bridge/tag ethx

Manage to have kernel 4.9 with hwnat, second gmac, port-separation and vlan. There is some compilation warning but it does work. Will give feedback on performance.

    OBJCOPY arch/arm/boot/zImage
  Kernel: arch/arm/boot/zImage is ready
  DTC     arch/arm/boot/dts/mt2701-evb.dtb
  DTC     arch/arm/boot/dts/mt6580-evbp1.dtb
  DTC     arch/arm/boot/dts/mt6589-aquaris5.dtb
  DTC     arch/arm/boot/dts/mt6592-evb.dtb
  DTC     arch/arm/boot/dts/mt7623-evb.dtb
Warning (reg_format): "reg" property in /mt7530@0 has invalid length (4 bytes) (#address-cells == 2, #size-cells == 2)
  DTC     arch/arm/boot/dts/mt7623-eMMC.dtb
Warning (reg_format): "reg" property in /switch has invalid length (4 bytes) (#address-cells == 2, #size-cells == 2)
  DTC     arch/arm/boot/dts/mt7623-NAND.dtb
  DTC     arch/arm/boot/dts/mt7623-NAND-ePHY.dtb
  DTC     arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dtb
Warning (reg_format): "reg" property in /mt7530@0 has invalid length (4 bytes) (#address-cells == 2, #size-cells == 2)
Warning (reg_format): "reg" property in /switch has invalid length (4 bytes) (#address-cells == 2, #size-cells == 2)
  DTC     arch/arm/boot/dts/mt8127-moose.dtb
  DTC     arch/arm/boot/dts/mt8135-evbp1.dtb
drivers/misc/mediatek/connectivity/wlan/Makefile:6: include gen2
drivers/misc/mediatek/connectivity/wlan/gen2/Makefile:220: y
  Building modules, stage 2.
  MODPOST 110 modules
WARNING: drivers/net/ethernet/mediatek/mtk_hnat/mtkhnat.o(.text+0x604): Section mismatch in reference from the function hnat_probe() to the function .init.text:hnat_init_debugfs()
The function hnat_probe() references
the function __init hnat_init_debugfs().
This is often because hnat_probe lacks a __init 
annotation or the annotation of hnat_init_debugfs is wrong.