[OpenWrt-Devel] [RFC 0/9] Using the mainline mtk-eth-soc driver for MT7621
Bjørn Mork
bjorn at mork.no
Mon Oct 15 09:59:58 EDT 2018
Bjørn Mork <bjorn at mork.no> writes:
> John Crispin <john at phrozen.org> writes:
>
>> have you seen my staging tree ?
>> https://git.openwrt.org/?p=openwrt/staging/blogic.git;a=shortlog;h=refs/heads/mt7621_dsa
>
> No, I hadn't. Thanks for the pointer. Will look at it now
I've now tried to build this with the WAP6805, but I'm afraid I can't
get the second gmac to work. Probably something I did wrong with the
DTS... DSA and eth0 seems to work fine.
This is your mt7621_dsa branc with my attempt to use it on the WAP6805
on top: https://github.com/bmork/LEDE/tree/blogic-mt7621-mainline-eth
Boot log, with failing attempt to use eth1:
[ 0.000000] Linux version 4.14.61 (bjorn at canardo) (gcc version 7.3.0 (OpenWrt GCC 7.3.0 r6690-cd7878e69dc9)) #0 SMP Mon Oct 15 11:57:33 2018
[ 0.000000] SoC Type: MediaTek MT7621 ver:1 eco:3
[ 0.000000] bootconsole [early0] enabled
[ 0.000000] CPU0 revision is: 0001992f (MIPS 1004Kc)
[ 0.000000] MIPS: machine is ZyXEL WAP6805
[ 0.000000] Determined physical RAM map:
[ 0.000000] memory: 04000000 @ 00000000 (usable)
[ 0.000000] Initrd not found or empty - disabling initrd
[ 0.000000] VPE topology {2} total 2
[ 0.000000] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[ 0.000000] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[ 0.000000] MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
[ 0.000000] Zone ranges:
[ 0.000000] Normal [mem 0x0000000000000000-0x0000000003ffffff]
[ 0.000000] HighMem empty
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x0000000000000000-0x0000000003ffffff]
[ 0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000003ffffff]
[ 0.000000] random: get_random_bytes called from start_kernel+0x90/0x4a4 with crng_init=0
[ 0.000000] percpu: Embedded 14 pages/cpu @81090000 s26192 r8192 d22960 u57344
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 16256
[ 0.000000] Kernel command line: console=ttyS0,57600 rootfstype=squashfs,jffs2
[ 0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
[ 0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[ 0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.000000] Writing ErrCtl register=0001164a
[ 0.000000] Readback ErrCtl register=0001164a
[ 0.000000] Memory: 58324K/65536K available (4573K kernel code, 214K rwdata, 1084K rodata, 260K init, 284K bss, 7212K reserved, 0K cma-reserved, 0K highmem)
[ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[ 0.000000] Hierarchical RCU implementation.
[ 0.000000] RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
[ 0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
[ 0.000000] NR_IRQS: 256
[ 0.000000] clocksource: GIC: mask: 0xffffffffffffffff max_cycles: 0xcaf478abb4, max_idle_ns: 440795247997 ns
[ 0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 4343773742 ns
[ 0.000009] sched_clock: 32 bits at 440MHz, resolution 2ns, wraps every 4880645118ns
[ 0.015493] Calibrating delay loop... 586.13 BogoMIPS (lpj=2930688)
[ 0.087794] pid_max: default: 32768 minimum: 301
[ 0.097092] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.110108] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.125717] Hierarchical SRCU implementation.
[ 0.136751] smp: Bringing up secondary CPUs ...
[ 0.149955] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[ 0.149963] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[ 0.149974] MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
[ 0.150122] CPU1 revision is: 0001992f (MIPS 1004Kc)
[ 0.205824] Synchronize counters for CPU 1: done.
[ 0.265496] smp: Brought up 1 node, 2 CPUs
[ 0.277227] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.296702] futex hash table entries: 512 (order: 2, 16384 bytes)
[ 0.308929] pinctrl core: initialized pinctrl subsystem
[ 0.320656] NET: Registered protocol family 16
[ 0.340951] pull PCIe RST: RALINK_RSTCTRL = 0
[ 0.649952] release PCIe RST: RALINK_RSTCTRL = 7000000
[ 0.660019] ***** Xtal 40MHz *****
[ 0.666746] release PCIe RST: RALINK_RSTCTRL = 7000000
[ 0.676955] Port 0 N_FTS = 1b102800
[ 0.683853] Port 1 N_FTS = 1b102800
[ 0.690781] Port 2 N_FTS = 1b102800
[ 1.849206] PCIE1 no card, disable it(RST&CLK)
[ 1.857893] PCIE2 no card, disable it(RST&CLK)
[ 1.866693] -> 21007f2
[ 1.871541] PCIE0 enabled
[ 1.876726] PCI host bridge /pcie at 1e140000 ranges:
[ 1.886249] MEM 0x0000000060000000..0x000000006fffffff
[ 1.896613] IO 0x000000001e160000..0x000000001e16ffff
[ 1.906971] PCI coherence region base: 0xbfbf8000, mask/settings: 0x60000000
[ 1.933546] mt7621_gpio 1e000600.gpio: registering 32 gpios
[ 1.944851] mt7621_gpio 1e000600.gpio: registering 32 gpios
[ 1.956081] mt7621_gpio 1e000600.gpio: registering 32 gpios
[ 1.968660] PCI host bridge to bus 0000:00
[ 1.976694] pci_bus 0000:00: root bus resource [mem 0x60000000-0x6fffffff]
[ 1.990343] pci_bus 0000:00: root bus resource [io 0xffffffff]
[ 2.002078] pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]
[ 2.015559] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[ 2.031804] pci 0000:00:00.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[ 2.048331] pci 0000:00:00.0: BAR 0: no space for [mem size 0x80000000]
[ 2.061351] pci 0000:00:00.0: BAR 0: failed to assign [mem size 0x80000000]
[ 2.075179] pci 0000:00:00.0: BAR 8: assigned [mem 0x60000000-0x600fffff]
[ 2.088653] pci 0000:00:00.0: BAR 1: assigned [mem 0x60100000-0x6010ffff]
[ 2.102137] pci 0000:01:00.0: BAR 0: assigned [mem 0x60000000-0x600fffff]
[ 2.115617] pci 0000:00:00.0: PCI bridge to [bus 01]
[ 2.125442] pci 0000:00:00.0: bridge window [mem 0x60000000-0x600fffff]
[ 2.140543] clocksource: Switched to clocksource GIC
[ 2.152105] NET: Registered protocol family 2
[ 2.161585] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[ 2.175325] TCP bind hash table entries: 1024 (order: 1, 8192 bytes)
[ 2.187926] TCP: Hash tables configured (established 1024 bind 1024)
[ 2.200664] UDP hash table entries: 256 (order: 1, 8192 bytes)
[ 2.212170] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[ 2.224839] NET: Registered protocol family 1
[ 2.470500] 4 CPUs re-calibrate udelay(lpj = 2924544)
[ 2.481798] Crashlog allocated RAM at address 0x3f00000
[ 2.492635] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[ 2.514307] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 2.525843] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[ 2.549358] io scheduler noop registered
[ 2.557036] io scheduler deadline registered (default)
[ 2.569152] Serial: 8250/16550 driver, 3 ports, IRQ sharing disabled
[ 2.583242] console [ttyS0] disabled
[ 2.590259] 1e000c00.uartlite: ttyS0 at MMIO 0x1e000c00 (irq = 14, base_baud = 3125000) is a 16550A
[ 2.608298] console [ttyS0] enabled
[ 2.608298] console [ttyS0] enabled
[ 2.622022] bootconsole [early0] disabled
[ 2.622022] bootconsole [early0] disabled
[ 2.638724] cacheinfo: Unable to detect cache hierarchy for CPU 0
[ 2.651776] MediaTek Nand driver init, version v2.1 Fix AHB virt2phys error
[ 2.665820] Enable NFI Clock
[ 2.671555] # MTK NAND # : Use HW ECC
[ 2.678848] Device found in MTK table, ID: 1f1, EXT_ID: 801d01
[ 2.690455] Support this Device in MTK table! 1f1
[ 2.700169] [NAND]select ecc bit:4, sparesize :64 spare_per_sector=16
[ 2.713039] nand: device found, Manufacturer ID: 0x01, Chip ID: 0xf1
[ 2.725682] nand: AMD/Spansion NAND 128MiB 3,3V 8-bit
[ 2.735733] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
[ 2.750817] Scanning device for bad blocks
[ 3.048548] 9 fixed-partitions partitions found on MTD device MT7621-NAND
[ 3.062061] Creating 9 MTD partitions on "MT7621-NAND":
[ 3.072466] 0x000000000000-0x000000100000 : "Bootloader"
[ 3.084267] 0x000000100000-0x000000200000 : "MRD"
[ 3.094785] 0x000000200000-0x000000300000 : "Factory"
[ 3.105940] 0x000000300000-0x000000400000 : "Config"
[ 3.116943] 0x000000400000-0x000002400000 : "firmware"
[ 3.581855] 2 uimage-fw partitions found on MTD device firmware
[ 3.593665] 0x000000400000-0x000000800000 : "kernel"
[ 3.604717] 0x000000800000-0x000002400000 : "ubi"
[ 3.615420] 0x000002400000-0x000004400000 : "Kernel2"
[ 3.626882] 0x000004400000-0x000004500000 : "Private"
[ 3.638082] 0x000004500000-0x000005500000 : "Log"
[ 3.648736] 0x000005500000-0x000008000000 : "App"
[ 3.659601] [mtk_nand] probe successfully!
[ 3.668497] Signature matched and data read!
[ 3.676992] load_fact_bbt success 1023
[ 3.685736] libphy: Fixed MDIO Bus: probed
[ 3.730549] MT7621: GE2: Pininit
[ 3.736988] MTK_GDMA_FWD_CFG: 0, 544276480
[ 3.745138] MTK_GDMA_FWD_CFG: 1, 544276480
[ 3.753304] mtk_soc_eth 1e100000.ethernet: chip id = 7621
[ 3.764061] mtk_soc_eth 1e100000.ethernet: mtk_add_mac
[ 3.774333] mtk_soc_eth 1e100000.ethernet: mtk_add_mac done
[ 3.785430] mtk_soc_eth 1e100000.ethernet: mtk_add_mac
[ 3.795671] mtk_soc_eth 1e100000.ethernet: mtk_add_mac done
[ 3.807023] libphy: mdio: probed
[ 3.814796] mtk_soc_eth 1e100000.ethernet: connected mac 0 to PHY at fixed-0:00 [uid=00000000, driver=Generic PHY]
[ 3.836317] mtk_soc_eth 1e100000.ethernet eth0: mediatek frame engine at 0xbe100000, irq 15
[ 3.853782] mtk_soc_eth 1e100000.ethernet: connected mac 1 to PHY at fixed-0:01 [uid=00000000, driver=Generic PHY]
[ 3.875257] mtk_soc_eth 1e100000.ethernet eth1: mediatek frame engine at 0xbe100000, irq 15
[ 3.893875] random: fast init done
[ 3.894557] NET: Registered protocol family 10
[ 3.896907] Segment Routing with IPv6
[ 3.897031] NET: Registered protocol family 17
[ 3.897588] 8021q: 802.1Q VLAN Support v1.8
[ 3.900770] DSA: switch 0 0 parsed
[ 3.900793] DSA: tree 0 parsed
[ 4.870626] mtk_soc_eth 1e100000.ethernet eth1: rx pause enabled, tx pause enabled
[ 4.870634] mtk_soc_eth 1e100000.ethernet eth0: rx pause enabled, tx pause enabled
[ 4.870653] mtk_phy_link_adjust: 0, 105e33b
[ 4.909076] mtk_phy_link_adjust: 1, 105e33b
[ 5.730890] libphy: dsa slave smi: probed
[ 5.770566] Generic PHY dsa-0.0:00: attached PHY driver [Generic PHY] (mii_bus:phy_addr=dsa-0.0:00, irq=POLL)
[ 5.830554] Generic PHY dsa-0.0:01: attached PHY driver [Generic PHY] (mii_bus:phy_addr=dsa-0.0:01, irq=POLL)
[ 5.890554] Generic PHY dsa-0.0:02: attached PHY driver [Generic PHY] (mii_bus:phy_addr=dsa-0.0:02, irq=POLL)
[ 5.950554] Generic PHY dsa-0.0:03: attached PHY driver [Generic PHY] (mii_bus:phy_addr=dsa-0.0:03, irq=POLL)
[ 5.972592] UBI: auto-attach mtd6
[ 5.979205] ubi0: attaching mtd6
[ 6.053168] UBI: EOF marker found, PEBs from 58 will be erased
[ 6.065019] ubi0: scanning is finished
[ 6.111778] ubi0: volume 1 ("rootfs_data") re-sized from 9 to 144 LEBs
[ 6.125732] ubi0: attached mtd6 (name "ubi", size 28 MiB)
[ 6.136520] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[ 6.150207] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[ 6.163725] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
[ 6.177582] ubi0: good PEBs: 224, bad PEBs: 0, corrupted PEBs: 0
[ 6.189533] ubi0: user volume: 2, internal volumes: 1, max. volumes count: 128
[ 6.203909] ubi0: max/mean erase counter: 1/0, WL threshold: 4096, image sequence number: 1643424424
[ 6.222088] ubi0: available PEBs: 0, total reserved PEBs: 224, PEBs reserved for bad PEB handling: 20
[ 6.240464] ubi0: background thread "ubi_bgt0d" started, PID 396
[ 6.242434] block ubiblock0_0: created from ubi0:0(rootfs)
[ 6.242446] ubiblock: device ubiblock0_0 (rootfs) set to be root filesystem
[ 6.242467] hctosys: unable to open rtc device (rtc0)
[ 6.305864] VFS: Mounted root (squashfs filesystem) readonly on device 254:0.
[ 6.320984] Freeing unused kernel memory: 260K
[ 6.329836] This architecture does not have kernel memory protection.
[ 6.926057] init: Console is alive
[ 6.933192] init: - watchdog -
[ 7.589472] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[ 7.689170] usbcore: registered new interface driver usbfs
[ 7.700252] usbcore: registered new interface driver hub
[ 7.710992] usbcore: registered new device driver usb
[ 7.735257] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[ 7.750945] init: - preinit -
[ 8.620693] IPv6: ADDRCONF(NETDEV_UP): lan0: link is not ready
[ 8.645278] random: procd: uninitialized urandom read (4 bytes read)
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
[ 9.840561] mt7530 switch at 0 lan0: Link is Down
[ 11.822218] UBIFS (ubi0:1): default file-system created
[ 11.834107] UBIFS (ubi0:1): background thread "ubifs_bgt0_1" started, PID 473
[ 11.947379] UBIFS (ubi0:1): UBIFS: mounted UBI device 0, volume 1, name "rootfs_data"
[ 11.963006] UBIFS (ubi0:1): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
[ 11.982757] UBIFS (ubi0:1): FS size: 17014784 bytes (16 MiB, 134 LEBs), journal size 1015809 bytes (0 MiB, 7 LEBs)
[ 12.003378] UBIFS (ubi0:1): reserved for root: 803650 bytes (784 KiB)
[ 12.016215] UBIFS (ubi0:1): media format: w4/r0 (latest is w5/r0), UUID 065D734F-7CDE-4197-A7C1-56AE43FAAC23, small LPT model
[ 12.041954] mount_root: overlay filesystem has not been fully initialized yet
[ 12.056855] mount_root: switching to ubifs overlay
[ 12.085378] urandom-seed: Seed file not found (/etc/urandom.seed)
[ 12.347762] procd: - early -
[ 12.353663] procd: - watchdog -
[ 13.020710] procd: - watchdog -
[ 13.027289] procd: - ubus -
[ 13.093359] random: ubusd: uninitialized urandom read (4 bytes read)
[ 13.106890] random: ubusd: uninitialized urandom read (4 bytes read)
[ 13.120046] random: ubusd: uninitialized urandom read (4 bytes read)
[ 13.133620] procd: - init -
Please press Enter to activate this console.
[ 13.429847] kmodloader: loading kernel modules from /etc/modules.d/*
[ 13.446761] ip6_tables: (C) 2000-2006 Netfilter Core Team
[ 13.787813] Loading modules backported from Linux version v4.18-rc7-0-gacb1872577b3
[ 13.803124] Backport generated by backports.git v4.14-rc2-1-71-g39f4ec76
[ 13.818511] ip_tables: (C) 2000-2006 Netfilter Core Team
[ 14.145390] nf_conntrack version 0.5.0 (1024 buckets, 4096 max)
[ 14.358655] xt_time: kernel timezone is -0000
[ 14.588024] bus=0x1, slot = 0x0, irq=0xff
[ 14.596099] PCI: Enabling device 0000:00:00.0 (0004 -> 0006)
[ 14.607542] mt7603e 0000:01:00.0: ASIC revision: 76030010
[ 14.684569] mt7603e 0000:01:00.0: Firmware Version: ap_pcie
[ 14.695703] mt7603e 0000:01:00.0: Build Time: 20160107100755
[ 14.740548] firmware init done
[ 14.936146] PPP generic driver version 2.4.2
[ 14.948267] NET: Registered protocol family 24
[ 14.962142] kmodloader: done loading kernel modules from /etc/modules.d/*
[ 16.167329] urandom_read: 5 callbacks suppressed
[ 16.167342] random: jshn: uninitialized urandom read (4 bytes read)
[ 23.171865] mtk_soc_eth 1e100000.ethernet eth0: rx pause enabled, tx pause enabled
[ 23.186993] mtk_phy_link_adjust: 0, 105e33b
[ 23.422099] br-lan: port 1(lan0) entered blocking state
[ 23.432608] br-lan: port 1(lan0) entered disabled state
[ 23.500740] device lan0 entered promiscuous mode
[ 23.509945] device eth0 entered promiscuous mode
[ 23.641328] IPv6: ADDRCONF(NETDEV_UP): br-lan: link is not ready
[ 23.892294] br-lan: port 2(lan1) entered blocking state
[ 23.902811] br-lan: port 2(lan1) entered disabled state
[ 24.040604] device lan1 entered promiscuous mode
[ 24.431933] br-lan: port 3(lan2) entered blocking state
[ 24.442392] br-lan: port 3(lan2) entered disabled state
[ 24.670573] device lan2 entered promiscuous mode
[ 25.062164] br-lan: port 4(lan3) entered blocking state
[ 25.072679] br-lan: port 4(lan3) entered disabled state
[ 25.370585] device lan3 entered promiscuous mode
[ 25.680667] mt7530 switch at 0 lan1: Link is Down
[ 26.300584] mt7530 switch at 0 lan2: Link is Down
[ 26.700664] mt7530 switch at 0 lan3: Link is Down
[ 30.060634] br-lan: port 4(lan3) entered blocking state
[ 30.071087] br-lan: port 4(lan3) entered forwarding state
[ 30.100576] mt7530 switch at 0 lan3: Link is Up - 1Gbps/Full - flow control rx/tx
[ 30.260595] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
root at OpenWrt:/# io -w -4 0x1e110008 0x9000c
root at OpenWrt:/# echo 1 > /sys/class/gpio/gpio16/value
root at OpenWrt:/# ifconfig eth1 1.1.1.1 netmask 255.255.255.0 up
root at OpenWrt:/# ping 1.1.1.2 -c 3
PING 1.1.1.2 (1.1.1.2): 56 data bytes
--- 1.1.1.2 ping statistics ---
3 packets transmitted, 0 packets received, 100% packet loss
root at OpenWrt:/# ifconfig eth1
eth1 Link encap:Ethernet HWaddr 60:31:97:66:16:11
inet addr:1.1.1.1 Bcast:1.1.1.255 Mask:255.255.255.0
inet6 addr: fe80::6231:97ff:fe66:1611/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:13 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:1238 (1.2 KiB)
Interrupt:15
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list