Full feature Linux kernel - which one to use?


(xbgmsharp) #1

Hello,

Which kernel should i use to have all hardware feature available in BPI-R2. I will use my BPI-R2 as my main switch, router, wifi AP and nas. I can’t use 4.4 as my ISP require a vlan on the WAN to run pppoe over fiber. As it is my main gateway, i would rather take advantage of the hardware nat.

4.4

  • no vlan support
  • no hardware nat
  • no dsa

4.14

  • no 2GMAC
  • no hdmi
  • no sound

(Frank W.) #2

kernel 4.9 have hwnat, second gmac, port-separation and vlan, but no hdmi

i have created a 4.9-patched branch in my github-repo (4.14) with the patches from bpi-r2-lede… compile that and you should have above features (need to copy config and build-script from main branch)

i had created the branch to understand how the patches work in the target-files (hard to read patches alone) for porting them to 4.14

btw. the bpi-r2 have no sound-module…

updated the feature-overview (added 4.9-patched) http://www.fw-web.de/dokuwiki/doku.php?id=en:bpi-r2:kernel#overview


(xbgmsharp) #3

Great looking at 4.9_patched. there seem to have hw qos as well. Should i enable DSA_MT7530? or is it irelevant to do hnat and hswitch.


(Frank W.) #4

by default ists enabled…i don’t know if you can disable it


(xbgmsharp) #5

It was not selecting in 4.9_patched.


(Frank W.) #6

you have copied defconfig from main and used it? there were patches for mt7530.c too


(xbgmsharp) #7

copy deconf and build from main, then run build importconfig then build config to adjust my settings.

  • Disable XFS
  • Disable NFSD_V3, NFS_V3
  • Disable most Ethernet driver support except mediatek
  • Enable MediaTek MT7623 hardware NAT support, NET_MEDIATEK_HNAT
  • Enable MediaTek MT7623 hardware QoS support, NET_MEDIATEK_HW_QOS
  • Enable Switch (and switch-ish) device support, NET_SWITCHDEV
  • Enable Distributed Switch Architecture, NET_DSA

and now compiling…


(xbgmsharp) #8

Some warnings To be fare i’m good with any LTS kernel as long as i have all feature. Latest better. Let see with 4.9

  LD      drivers/misc/mediatek/connectivity/common/built-in.o
drivers/misc/mediatek/connectivity/wlan/Makefile:6: include gen2
drivers/misc/mediatek/connectivity/wlan/gen2/Makefile:220: y
  CC      drivers/misc/mediatek/connectivity/wlan/gen2/common/dump.o
  CC      drivers/misc/mediatek/connectivity/wlan/gen2/common/wlan_lib.o
  CC      drivers/misc/mediatek/connectivity/wlan/gen2/common/wlan_oid.o
  CC      drivers/misc/mediatek/connectivity/wlan/gen2/common/wlan_bow.o
  CC      drivers/misc/mediatek/connectivity/wlan/gen2/common/debug.o
  CC      drivers/misc/mediatek/connectivity/wlan/gen2/common/wlan_p2p.o

and

  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
  LD      drivers/net/ethernet/mediatek/mtk_hnat/built-in.o
  CC [M]  drivers/net/ethernet/mediatek/mtk_hnat/hnat.o
  CC [M]  drivers/net/ethernet/mediatek/mtk_hnat/hnat_nf_hook.o
  CC [M]  drivers/net/ethernet/mediatek/mtk_hnat/hnat_debugfs.o
  LD [M]  drivers/net/ethernet/mediatek/mtk_hnat/mtkhnat.o

BTW when i boot on 4.4 i have the following boot line. seem like there a audio and video support. Not critical at the moment, the ultimate goal is to output audio via a bt speaker.

[    9.480768] mediatek-drm 14000000.dispsys: bound 14007000.ovl (ops mtk_disp_ovl_component_ops)
[    9.489364] mediatek-drm 14000000.dispsys: bound 14008000.rdma (ops mtk_disp_rdma_component_ops)
[    9.498115] mediatek-drm 14000000.dispsys: bound 14012000.rdma (ops mtk_disp_rdma_component_ops)
[    9.506889] mediatek-drm 14000000.dispsys: bound 14014000.dpi (ops mtk_dpi_component_ops)
[    9.515080] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[    9.521651] [drm] No driver support for vblank timestamp query.
[    9.527647] mediatek-drm 14000000.dispsys: No connectors reported connected with modes
[    9.535535] [drm] Cannot find any crtc or sizes - going 1024x768
[    9.553197] Console: switching to colour frame buffer device 128x48
[    9.569126] mediatek-drm 14000000.dispsys: fb0:  frame buffer device
[    9.622890] vgp1: disabling
[    9.625781] vcamaf: disabling
[    9.629221] ALSA device list:
[    9.632260]   #0: mt7623-wm8960-card

(xbgmsharp) #9

don;t compile

  MODPOST vmlinux.o
  GEN     .version
  CHK     include/generated/compile.h
  UPD     include/generated/compile.h
  CC      init/version.o
  LD      init/built-in.o
drivers/built-in.o: In function `mtk_wcn_consys_stp_btif_tx':
/home/xbgmsharp/BPI-R2-4.14/drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/stp_btif.c:155: undefined reference to `mtk_wcn_btif_write'
/home/xbgmsharp/BPI-R2-4.14/drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/stp_btif.c:170: undefined reference to `mtk_wcn_btif_write'
drivers/built-in.o: In function `mtk_wcn_consys_stp_btif_open':
/home/xbgmsharp/BPI-R2-4.14/drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/stp_btif.c:81: undefined reference to `mtk_wcn_btif_open'
drivers/built-in.o: In function `mtk_wcn_consys_stp_btif_close':
/home/xbgmsharp/BPI-R2-4.14/drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/stp_btif.c:101: undefined reference to `mtk_wcn_btif_close'
drivers/built-in.o: In function `mtk_wcn_consys_stp_btif_rx_cb_register':
/home/xbgmsharp/BPI-R2-4.14/drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/stp_btif.c:121: undefined reference to `mtk_wcn_btif_rx_cb_register'
drivers/built-in.o: In function `mtk_wcn_consys_stp_btif_wakeup':
/home/xbgmsharp/BPI-R2-4.14/drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/stp_btif.c:204: undefined reference to `mtk_wcn_btif_wakeup_consys'
drivers/built-in.o: In function `mtk_wcn_consys_stp_btif_dpidle_ctrl':
/home/xbgmsharp/BPI-R2-4.14/drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/stp_btif.c:224: undefined reference to `mtk_wcn_btif_dpidle_ctrl'
drivers/built-in.o: In function `mtk_wcn_consys_stp_btif_lpbk_ctrl':
/home/xbgmsharp/BPI-R2-4.14/drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/stp_btif.c:239: undefined reference to `mtk_wcn_btif_loopback_ctrl'
drivers/built-in.o: In function `mtk_wcn_consys_stp_btif_logger_ctrl':
/home/xbgmsharp/BPI-R2-4.14/drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/stp_btif.c:259: undefined reference to `mtk_wcn_btif_dbg_ctrl'
drivers/built-in.o: In function `mtk_wcn_consys_stp_btif_parser_wmt_evt':
/home/xbgmsharp/BPI-R2-4.14/drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/stp_btif.c:277: undefined reference to `mtk_wcn_btif_parser_wmt_evt'
drivers/built-in.o: In function `is_btif_rxd_be_blocked':
/home/xbgmsharp/BPI-R2-4.14/drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/stp_dbg.c:489: undefined reference to `mtk_btif_rxd_be_blocked_flag_get'
Makefile:972: recipe for target 'vmlinux' failed
make: *** [vmlinux] Error 1

(xbgmsharp) #10

default config for 4_9patched does not compiled.

$ ./build.sh
Build Kernel
Cleanup Kernel Build
scripts/kconfig/conf  --silentoldconfig Kconfig
  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  CHK     include/generated/bounds.h
  CHK     include/generated/timeconst.h
  CHK     include/generated/asm-offsets.h
  CALL    scripts/checksyscalls.sh
  CHK     include/generated/compile.h
  GZIP    kernel/config_data.gz
  CHK     kernel/config_data.h
  UPD     kernel/config_data.h
  CC [M]  kernel/configs.o
drivers/misc/mediatek/connectivity/wlan/Makefile:6: include gen2
drivers/misc/mediatek/connectivity/wlan/gen2/Makefile:220: y
  LD      drivers/net/built-in.o
  LD      drivers/built-in.o
  CC      net/core/flow_dissector.o
net/core/flow_dissector.c: In function '__skb_flow_dissect':
net/core/flow_dissector.c:137:18: error: 'struct net_device' has no member named 'dsa_ptr'; did you mean 'dn_ptr'?
    ops = skb->dev->dsa_ptr->tag_ops;
                  ^~
scripts/Makefile.build:293: recipe for target 'net/core/flow_dissector.o' failed
make[2]: *** [net/core/flow_dissector.o] Error 1
scripts/Makefile.build:544: recipe for target 'net/core' failed
make[1]: *** [net/core] Error 2
Makefile:991: recipe for target 'net' failed
make: *** [net] Error 2

(Frank W.) #11

Mtk-btif set? I had added some default options to kconfig in 4.14

Also i remember that in any makefile a platform-option is neede that i had changed to fixed mt7623 (the only folder that exists)…

That gave strange errors if not set

You can also try original lede-config: https://github.com/garywangcn/bpi-r2_lede/blob/bpi-r2-on-lede-v1/target/linux/mediatek/config-4.9 this should work without changing code…


(xbgmsharp) #12

if lede project and banana-pi (mediatek) are compatible with kernel 4.14 should not be working?

I try the original lede-config: https://github.com/garywangcn/bpi-r2_lede/blob/bpi-r2-on-lede-v1/target/linux/mediatek/config-4.91 , the config need adjustment as per output below.

$ ./build.sh config
scripts/kconfig/mconf  Kconfig
.config:69:warning: override: CMDLINE_EXTEND changes choice state
.config:606:warning: override: reassigning to symbol USE_OF
.config:607:warning: override: reassigning to symbol ATAGS
.config:609:warning: override: reassigning to symbol ZBOOT_ROM_TEXT
.config:610:warning: override: reassigning to symbol ZBOOT_ROM_BSS
.config:611:warning: override: reassigning to symbol ARM_APPENDED_DTB
.config:612:warning: override: reassigning to symbol ARM_ATAG_DTB_COMPAT
.config:615:warning: override: reassigning to symbol CMDLINE
.config:616:warning: override: reassigning to symbol CMDLINE_FROM_BOOTLOADER
.config:616:warning: override: CMDLINE_FROM_BOOTLOADER changes choice state
.config:617:warning: override: reassigning to symbol CMDLINE_EXTEND
.config:622:warning: override: reassigning to symbol AUTO_ZRELADDR
warning: (MTK_COMBO_WIFI && GELIC_WIRELESS && PCMCIA_RAYCS && PCMCIA_WL3501 && ATMEL && PCMCIA_ATMEL && AIRO && AIRO_CS && IPW2100 && IPW2200 && LIBIPW && HOSTAP && HERMES && PRISM54 && LIBERTAS && USB_ZD1201 && PRISM2_USB && RTL8192U && R8712U && R8188EU && KS7010 && RTL8192E) selects WIRELESS_EXT which has unmet direct dependencies (NET && WIRELESS)
warning: (MTK_COMBO_WIFI && PCMCIA_RAYCS && ATMEL && AIRO && AIRO_CS && IPW2100 && IPW2200 && HOSTAP && HERMES && PRISM54 && USB_ZD1201 && PRISM2_USB && RTL8192U && R8712U && R8188EU && KS7010 && RTL8192E) selects WEXT_PRIV which has unmet direct dependencies (NET && WIRELESS)
configuration written to .config

*** End of the configuration.
*** Execute 'make' to start the build or try 'make help'.

(Frank W.) #13

Wifi-driver is modified by me to do not run in issues like the mtk-btif…wifi-driver needs it so i set it by default. The original repos set btif in config…

First ignore this warnings,compile and look for errors…i don’t want to change 4.9 because some patches (also 2gmac) will be ported to 4.14


(xbgmsharp) #14

I was able to compile the kernel 4.9, i used the config of kernel 4.14. Before the kernel crash i was able to see the 2gmac. the kernel crash on CPU detection.

Not sure where to go from here. Maybe a DTC error?

  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
[    1.068767] libphy: mdio: probed
[    1.072009] mtk_soc_eth 1b100000.ethernet: generated random MAC address ba:65:9c:31:1c:38
[    1.080683] mtk_soc_eth 1b100000.ethernet: connected mac 0 to PHY at fixed-0:00 [uid=00000000, driver=Generic PHY]
[    1.091571] mtk_soc_eth 1b100000.ethernet eth0: mediatek frame engine at 0xe1120000, irq 211
[    1.100008] mtk_soc_eth 1b100000.ethernet: generated random MAC address 56:a0:66:87:77:cf
[    1.108477] mtk_soc_eth 1b100000.ethernet: connected mac 1 to PHY at fixed-0:01 [uid=00000000, driver=Generic PHY]
[    1.119307] mtk_soc_eth 1b100000.ethernet eth1: mediatek frame engine at 0xe1120000, irq 211

CPU crash

[    1.403586] Unable to handle kernel NULL pointer dereference at virtual address 00000000
[    1.403591] pgd = c0004000
[    1.403596] [00000000] *pgd=00000000
[    1.403606] Internal error: Oops: 5 [#1] SMP ARM
[    1.403612] Modules linked in:
[    1.403620] CPU: 3 PID: 1 Comm: swapper/0 Not tainted 4.9.44-4.9_patched-00010-g4cfbf51244aa-dirty #15
[    1.403622] Hardware name: Mediatek Cortex-A7 (Device Tree)
[    1.403626] task: de8e8000 task.stack: de8e2000
[    1.403638] PC is at clk_hw_round_rate+0x28/0x54
[    1.403644] LR is at divider_round_rate+0x1b4/0x550
[    1.403650] pc : [<c0412da4>]    lr : [<c0418c1c>]    psr: 60000013
[    1.403650] sp : de8e3a68  ip : de8e3a98  fp : de8e3a94
[    1.403653] r10: 00000000  r9 : de83c380  r8 : 00000000
[    1.403656] r7 : 00000100  r6 : 02ee0000  r5 : 02ee0000  r4 : 00000000
[    1.403660] r3 : de883d80  r2 : de8e3a74  r1 : de8e3a70  r0 : 00000000
[    1.403665] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
[    1.403669] Control: 10c5387d  Table: 8000406a  DAC: 00000051
[    1.403673] Process swapper/0 (pid: 1, stack limit = 0xde8e2218)
[    1.403676] Stack: (0xde8e3a68 to 0xde8e4000)

(Frank W.) #15

Does the stacktrace go further?

Maybe set loglevel in cmdline to 7


(xbgmsharp) #16

yes it does go further

[    1.403586] Unable to handle kernel NULL pointer dereference at virtual address 00000000
[    1.403591] pgd = c0004000
[    1.403596] [00000000] *pgd=00000000
[    1.403606] Internal error: Oops: 5 [#1] SMP ARM
[    1.403612] Modules linked in:
[    1.403620] CPU: 3 PID: 1 Comm: swapper/0 Not tainted 4.9.44-4.9_patched-00010-g4cfbf51244aa-dirty #15
[    1.403622] Hardware name: Mediatek Cortex-A7 (Device Tree)
[    1.403626] task: de8e8000 task.stack: de8e2000
[    1.403638] PC is at clk_hw_round_rate+0x28/0x54
[    1.403644] LR is at divider_round_rate+0x1b4/0x550
[    1.403650] pc : [<c0412da4>]    lr : [<c0418c1c>]    psr: 60000013
[    1.403650] sp : de8e3a68  ip : de8e3a98  fp : de8e3a94
[    1.403653] r10: 00000000  r9 : de83c380  r8 : 00000000
[    1.403656] r7 : 00000100  r6 : 02ee0000  r5 : 02ee0000  r4 : 00000000
[    1.403660] r3 : de883d80  r2 : de8e3a74  r1 : de8e3a70  r0 : 00000000
[    1.403665] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
[    1.403669] Control: 10c5387d  Table: 8000406a  DAC: 00000051
[    1.403673] Process swapper/0 (pid: 1, stack limit = 0xde8e2218)
[    1.403676] Stack: (0xde8e3a68 to 0xde8e4000)
[    1.403684] 3a60:                   c0414850 c03a789c de88b200 c0af2db0 de8e3a9c de8e3a88
[    1.403692] 3a80: 02ee0000 00000001 de8e3afc de8e3a98 c0418c1c c0412d88 c0414850 00000008
[    1.403700] 3aa0: 00000000 de8e3b58 00000000 00000057 00000000 c0414834 de884fc0 c0af2db0
[    1.403707] 3ac0: 00000000 de8e3ad0 c0414878 c0414834 de83c700 00000000 de8e3b58 02ee0000
[    1.403715] 3ae0: de883500 de8e3bfc de83c380 00000006 de8e3b24 de8e3b00 c04191fc c0418a74
[    1.403722] 3b00: 00000008 00000000 00000000 de8e3b4c 02ee0000 de883500 de8e3b3c de8e3b28
[    1.403730] 3b20: c0412d14 c0419164 00000004 de883d80 de8e3b8c de8e3b40 c0414abc c0412ca8
[    1.403738] 3b40: de8e3b94 00000000 c02476a8 02ee0000 00000000 ffffffff 00000000 00000000
[    1.403745] 3b60: de8e3b8c de884540 de8e3bfc de8e3bfc 00000000 00000000 c0966d2c 05dc0000
[    1.403753] 3b80: de8e3b9c de8e3b90 c0414bf8 c04149e0 de8e3bdc de8e3ba0 c041a6b4 c0414be8
[    1.403761] 3ba0: c0969380 dea7df00 de8e3be8 de8e3cd0 c06e8458 c041a640 de8e3bfc 02ee0000
[    1.403769] 3bc0: 00000100 00000000 c0966d2c 05dc0000 de8e3bf4 de8e3be0 c0412cf4 c041a64c
[    1.403777] 3be0: de883480 02ee0000 de8e3c24 de8e3bf8 c0412dbc c0412ca8 c03a89dc 02ee0000
[    1.403785] 3c00: 00000000 ffffffff 05dc0000 de83d540 02ee0000 00000001 de8e3c8c de8e3c28
[    1.403792] 3c20: c0418c1c c0412d88 de8e3c54 00000008 00000000 de8e3cc0 00000000 00000057
[    1.403799] 3c40: 00000000 c0419084 de8851c0 de8e3c58 00000000 c0418fc4 00000000 00000008
[    1.403807] 3c60: 00000000 de883e80 de8e3cc0 de883500 c0419158 dea91200 c0966d2c c0d5f83c
[    1.403815] 3c80: de8e3cb4 de8e3c90 c04191fc c0418a74 00000008 00000000 de883e80 02ee0000
[    1.403822] 3ca0: de883500 c0419158 de8e3d04 de8e3cb8 c0414e68 c0419164 de883f80 de83c380
[    1.403830] 3cc0: 05dc0000 00000000 ffffffff c0412ddc de883800 c0415540 de883e80 a0000013
[    1.403838] 3ce0: de883e80 02ee0000 02ee0000 02ee0000 dea91200 c0966d2c de8e3d24 de8e3d08
[    1.403846] 3d00: c0416f30 c0414c94 dd8ef800 02ee0000 dd8edd10 02ee0000 de8e3d3c de8e3d28
[    1.403853] 3d20: c0417000 c0416ee0 dd98ac10 00000000 de8e3d64 de8e3d40 c072ed50 c0416fdc
[    1.403861] 3d40: de8e3d64 de8e3d50 dd8edd10 dd8edd10 dea91210 dd98ac10 de8e3d8c de8e3d68
[    1.403868] 3d60: c072f4f4 c072ec24 dd8edd10 00000000 dea91210 dd98ac10 dd8edd10 00000000
[    1.403876] 3d80: de8e3dc4 de8e3d90 c072eab8 c072f4e0 00000000 00000000 dd8edd10 c0e7761c
[    1.403884] 3da0: dea91210 00000000 c0e7761c fffffdfb c0e7761c 00000000 de8e3de4 de8e3dc8
[    1.403892] 3dc0: c04afc30 c072e764 c0ef836c dea91210 c0e92ab0 00000000 de8e3e14 de8e3de8
[    1.403899] 3de0: c04ada18 c04afbdc de8e3e14 de8e3df8 dea91210 dea91244 c0e7761c c0e929d8
[    1.403907] 3e00: 00000000 00000007 de8e3e34 de8e3e18 c04add18 c04ad7d8 00000000 c0e7761c
[    1.403914] 3e20: c04adc0c c0e929d8 de8e3e5c de8e3e38 c04ab510 c04adc18 de99925c dea80334
[    1.403922] 3e40: dd8edc38 c0e7761c dd8edc00 c0e53400 de8e3e6c de8e3e60 c04ad0ec c04ab4a4
[    1.403930] 3e60: de8e3e9c de8e3e70 c04acb6c c04ad0cc c0b6667c c0d5f834 de8e3e9c c0e7761c
[    1.403938] 3e80: ffffe000 c0ebc000 c0d5f834 00000000 de8e3eb4 de8e3ea0 c04ae850 c04ac9b8
[    1.403945] 3ea0: c0d3f4a4 ffffe000 de8e3ec4 de8e3eb8 c04afb7c c04ae7d4 de8e3ed4 de8e3ec8
[    1.403953] 3ec0: c0d3f4c0 c04afb38 de8e3f4c de8e3ed8 c0101c28 c0d3f4b0 c0bbd680 e07fcdae
[    1.403961] 3ee0: de8e3f4c de8e3ef0 c0148600 c014849c 00000000 c016b7cc c0abd8b8 c0abd0a8
[    1.403968] 3f00: c0acee24 00000006 00000006 c0e904e8 00000000 c0bbd680 c0b4f910 00000000
[    1.403976] 3f20: c0d5f818 c0bbd680 c0ebc000 c0bbd680 c0d8e20c c0ebc000 c0d5f834 c0ebc000
[    1.403984] 3f40: de8e3f94 de8e3f50 c0d00eac c0101be0 00000006 00000006 00000000 c0d00630
[    1.403991] 3f60: c0d00630 000000bd c08ac250 00000000 c08ac250 00000000 00000000 00000000
[    1.403999] 3f80: 00000000 00000000 de8e3fac de8e3f98 c08ac268 c0d00d4c 00000000 c08ac250
[    1.404006] 3fa0: 00000000 de8e3fb0 c0108ef8 c08ac25c 00000000 00000000 00000000 00000000
[    1.404013] 3fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[    1.404020] 3fe0: 00000000 00000000 00000000 00000000 00000013 00000000 ffffffff ffffffff
[    1.404041] [<c0412da4>] (clk_hw_round_rate) from [<c0418c1c>] (divider_round_rate+0x1b4/0x550)
[    1.404052] [<c0418c1c>] (divider_round_rate) from [<c04191fc>] (clk_divider_round_rate+0xa4/0xc4)
[    1.404061] [<c04191fc>] (clk_divider_round_rate) from [<c0412d14>] (clk_core_round_rate_nolock+0x78/0xb0)
[    1.404073] [<c0412d14>] (clk_core_round_rate_nolock) from [<c0414abc>] (clk_mux_determine_rate_flags+0xe8/0x208)
[    1.404084] [<c0414abc>] (clk_mux_determine_rate_flags) from [<c0414bf8>] (__clk_mux_determine_rate+0x1c/0x20)
[    1.404095] [<c0414bf8>] (__clk_mux_determine_rate) from [<c041a6b4>] (clk_composite_determine_rate+0x74/0x1f4)
[    1.404105] [<c041a6b4>] (clk_composite_determine_rate) from [<c0412cf4>] (clk_core_round_rate_nolock+0x58/0xb0)
[    1.404115] [<c0412cf4>] (clk_core_round_rate_nolock) from [<c0412dbc>] (clk_hw_round_rate+0x40/0x54)
[    1.404124] [<c0412dbc>] (clk_hw_round_rate) from [<c0418c1c>] (divider_round_rate+0x1b4/0x550)
[    1.404132] [<c0418c1c>] (divider_round_rate) from [<c04191fc>] (clk_divider_round_rate+0xa4/0xc4)
[    1.404142] [<c04191fc>] (clk_divider_round_rate) from [<c0414e68>] (clk_calc_new_rates+0x1e0/0x2d0)
[    1.404153] [<c0414e68>] (clk_calc_new_rates) from [<c0416f30>] (clk_core_set_rate_nolock+0x5c/0xfc)
[    1.404164] [<c0416f30>] (clk_core_set_rate_nolock) from [<c0417000>] (clk_set_rate+0x30/0x40)
[    1.404176] [<c0417000>] (clk_set_rate) from [<c072ed50>] (mt2701_turn_on_a1sys_clock+0x138/0x254)
[    1.404187] [<c072ed50>] (mt2701_turn_on_a1sys_clock) from [<c072f4f4>] (mt2701_afe_enable_clock+0x20/0x150)
[    1.404197] [<c072f4f4>] (mt2701_afe_enable_clock) from [<c072eab8>] (mt2701_afe_pcm_dev_probe+0x360/0x3a0)
[    1.404207] [<c072eab8>] (mt2701_afe_pcm_dev_probe) from [<c04afc30>] (platform_drv_probe+0x60/0xc0)
[    1.404220] [<c04afc30>] (platform_drv_probe) from [<c04ada18>] (driver_probe_device+0x24c/0x440)
[    1.404231] [<c04ada18>] (driver_probe_device) from [<c04add18>] (__driver_attach+0x10c/0x128)
[    1.404242] [<c04add18>] (__driver_attach) from [<c04ab510>] (bus_for_each_dev+0x78/0xac)
[    1.404253] [<c04ab510>] (bus_for_each_dev) from [<c04ad0ec>] (driver_attach+0x2c/0x30)
[    1.404263] [<c04ad0ec>] (driver_attach) from [<c04acb6c>] (bus_add_driver+0x1c0/0x280)
[    1.404273] [<c04acb6c>] (bus_add_driver) from [<c04ae850>] (driver_register+0x88/0x104)
[    1.404283] [<c04ae850>] (driver_register) from [<c04afb7c>] (__platform_driver_register+0x50/0x58)
[    1.404295] [<c04afb7c>] (__platform_driver_register) from [<c0d3f4c0>] (mt2701_afe_pcm_driver_init+0x1c/0x20)
[    1.404307] [<c0d3f4c0>] (mt2701_afe_pcm_driver_init) from [<c0101c28>] (do_one_initcall+0x54/0x17c)
[    1.404320] [<c0101c28>] (do_one_initcall) from [<c0d00eac>] (kernel_init_freeable+0x16c/0x200)
[    1.404331] [<c0d00eac>] (kernel_init_freeable) from [<c08ac268>] (kernel_init+0x18/0x124)
[    1.404342] [<c08ac268>] (kernel_init) from [<c0108ef8>] (ret_from_fork+0x14/0x3c)
[    1.404351] Code: e1a04000 e1a05001 e24b2020 e24b1024 (e5900000) 
[    1.404368] ---[ end trace f4e1ec0e767dc090 ]---
[    1.404390] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
[    1.404390] 
[    1.404399] CPU2: stopping
[    1.404407] CPU: 2 PID: 0 Comm: swapper/2 Tainted: G      D         4.9.44-4.9_patched-00010-g4cfbf51244aa-dirty #15
[    1.404409] Hardware name: Mediatek Cortex-A7 (Device Tree)
[    1.404425] [<c011315c>] (unwind_backtrace) from [<c010d784>] (show_stack+0x20/0x24)
[    1.404436] [<c010d784>] (show_stack) from [<c039ebd8>] (dump_stack+0x90/0xa4)
[    1.404447] [<c039ebd8>] (dump_stack) from [<c01112cc>] (handle_IPI+0x2a8/0x2c8)
[    1.404456] [<c01112cc>] (handle_IPI) from [<c01014fc>] (gic_handle_irq+0x98/0x9c)
[    1.404464] [<c01014fc>] (gic_handle_irq) from [<c010e3cc>] (__irq_svc+0x6c/0x90)
[    1.404467] Exception stack(0xde959f58 to 0xde959fa0)
[    1.404472] 9f40:                                                       00000000 00000000
[    1.404480] 9f60: 0000030a c011f600 de958000 c0e0302c 00000004 c0e03090 c0e1c450 c0abead4
[    1.404487] 9f80: 00000001 de959fb4 de959fb8 de959fa8 c01099d8 c01099dc 60000013 ffffffff
[    1.404497] [<c010e3cc>] (__irq_svc) from [<c01099dc>] (arch_cpu_idle+0x48/0x4c)
[    1.404507] [<c01099dc>] (arch_cpu_idle) from [<c08b0d20>] (default_idle_call+0x30/0x3c)
[    1.404519] [<c08b0d20>] (default_idle_call) from [<c016c64c>] (cpu_startup_entry+0xe8/0x158)
[    1.404530] [<c016c64c>] (cpu_startup_entry) from [<c0110d90>] (secondary_start_kernel+0x16c/0x18c)
[    1.404539] [<c0110d90>] (secondary_start_kernel) from [<801018ec>] (0x801018ec)
[    1.404544] CPU1: stopping
[    1.404551] CPU: 1 PID: 0 Comm: swapper/1 Tainted: G      D         4.9.44-4.9_patched-00010-g4cfbf51244aa-dirty #15
[    1.404553] Hardware name: Mediatek Cortex-A7 (Device Tree)
[    1.404566] [<c011315c>] (unwind_backtrace) from [<c010d784>] (show_stack+0x20/0x24)
[    1.404575] [<c010d784>] (show_stack) from [<c039ebd8>] (dump_stack+0x90/0xa4)
[    1.404584] [<c039ebd8>] (dump_stack) from [<c01112cc>] (handle_IPI+0x2a8/0x2c8)
[    1.404592] [<c01112cc>] (handle_IPI) from [<c01014fc>] (gic_handle_irq+0x98/0x9c)
[    1.404601] [<c01014fc>] (gic_handle_irq) from [<c010e3cc>] (__irq_svc+0x6c/0x90)
[    1.404604] Exception stack(0xde957f58 to 0xde957fa0)
[    1.404608] 7f40:                                                       00000000 00000000
[    1.404616] 7f60: 00000cd6 c011f600 de956000 c0e0302c 00000002 c0e03090 c0e1c450 c0abead4
[    1.404624] 7f80: 00000001 de957fb4 de957fb8 de957fa8 c01099d8 c01099dc 60000013 ffffffff
[    1.404633] [<c010e3cc>] (__irq_svc) from [<c01099dc>] (arch_cpu_idle+0x48/0x4c)
[    1.404642] [<c01099dc>] (arch_cpu_idle) from [<c08b0d20>] (default_idle_call+0x30/0x3c)
[    1.404652] [<c08b0d20>] (default_idle_call) from [<c016c64c>] (cpu_startup_entry+0xe8/0x158)
[    1.404663] [<c016c64c>] (cpu_startup_entry) from [<c0110d90>] (secondary_start_kernel+0x16c/0x18c)
[    1.404670] [<c0110d90>] (secondary_start_kernel) from [<801018ec>] (0x801018ec)

(xbgmsharp) #17

Still unable booting from Kernel 4.9 from LEDE.

Build kernel 4.9

  CC      drivers/misc/mediatek/connectivity/common/common_detect/drv_init/conn_drv_init.o
  CC      drivers/misc/mediatek/connectivity/common/common_detect/drv_init/common_drv_init.o
  CC      drivers/misc/mediatek/connectivity/common/common_detect/drv_init/bluetooth_drv_init.o
  CC      drivers/misc/mediatek/connectivity/common/common_detect/drv_init/gps_drv_init.o
  CC      drivers/misc/mediatek/connectivity/common/common_detect/drv_init/fm_drv_init.o
  CC      drivers/misc/mediatek/connectivity/common/common_detect/drv_init/wlan_drv_init.o
  LD      drivers/misc/mediatek/connectivity/common/common_detect/drv_init/built-in.o
  LD      drivers/misc/mediatek/connectivity/common/common_detect/built-in.o
scripts/Makefile.build:44: drivers/misc/mediatek/connectivity/common/conn_soc/Makefile: No such file or directory
make[6]: *** No rule to make target 'drivers/misc/mediatek/connectivity/common/conn_soc/Makefile'.  Stop.
scripts/Makefile.build:544: recipe for target 'drivers/misc/mediatek/connectivity/common/conn_soc' failed
make[5]: *** [drivers/misc/mediatek/connectivity/common/conn_soc] Error 2
scripts/Makefile.build:544: recipe for target 'drivers/misc/mediatek/connectivity/common' failed
scripts/Makefile.build:544: recipe for target 'drivers/misc/mediatek/connectivity' failed
scripts/Makefile.build:544: recipe for target 'drivers/misc/mediatek' failed
scripts/Makefile.build:544: recipe for target 'drivers/misc' failed
Makefile:991: recipe for target 'drivers' failed
make[4]: *** [drivers/misc/mediatek/connectivity/common] Error 2
make[3]: *** [drivers/misc/mediatek/connectivity] Error 2
make[2]: *** [drivers/misc/mediatek] Error 2
make[1]: *** [drivers/misc] Error 2
make: *** [drivers] Error 2

Check file not present

$ ll drivers/misc/mediatek/connectivity/common/conn_soc/
total 16
drwxr-xr-x 3 francois francois 4096 Mar  9 21:12 core
drwxr-xr-x 2 francois francois 4096 Mar  9 16:56 include
drwxr-xr-x 5 francois francois 4096 Mar  9 21:12 linux
drwxr-xr-x 3 francois francois 4096 Mar  9 21:12 mt7623

Check file not present

$ ll drivers/misc/mediatek/connectivity/common/conn_soc/Makefile
ls: cannot access 'drivers/misc/mediatek/connectivity/common/conn_soc/Makefile': No such file or directory

Download the Makefile from 4.14

$ wget https://raw.githubusercontent.com/frank-w/BPI-R2-4.14/3c59d016ddda3f81cc4c16c277c52f4423fee5d4/drivers/misc/mediatek/connectivity/common/conn_soc/Makefile -O drivers/misc/mediatek/connectivity/common/conn_soc/Makefile

re-run build

$ ./build.sh 
...
  LD      drivers/misc/mediatek/connectivity/common/built-in.o
drivers/misc/mediatek/connectivity/wlan/Makefile:6: include gen2
drivers/misc/mediatek/connectivity/wlan/gen2/Makefile:220: y
...
  CC [M]  drivers/net/dsa/mt7530.o
  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
...
  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):   DTC     arch/arm/boot/dts/mt7623-eMMC.dtb
"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/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 181 modules
WARNING: modpost: Found 1 section mismatch(es).
To see full details build your kernel with:
'make CONFIG_DEBUG_SECTION_MISMATCH=y'

(xbgmsharp) #18

Can the banana team work on a fully feature and operational kernel to be use on any Linux distribution.


(Frank W.) #19

did the last build work except the warning?


(xbgmsharp) #20

Same boot issue on CPU detection, i do believe it is coming from the dtb. I was able to compile with the warning mention the kernel 4.9 but i can’t boot on kernel 4.9.

  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):   DTC     arch/arm/boot/dts/mt7623-eMMC.dtb
"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/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 181 modules
WARNING: modpost: Found 1 section mismatch(es).
To see full details build your kernel with:
'make CONFIG_DEBUG_SECTION_MISMATCH=y'