Missing Mediatek MT7628 EVB target profile in latest LEDE master

Hi,

We are using MT7628 based SKYLAB EVB , we want to build the latest 17.01.4 LEDE-master from LEDE github for "MediaTek MT7628 EVB" as Target Profile. But we are not able find "MediaTek MT7628 EVB" in make menuconfig as target Profile. Can anybody help in providing the steps to build the image for MT7628 EVB? We were able to build images for MT7628EVB using 17.01.2, 17.01.4 TAG(old commits based on 4.4.7x kernel), but not from 17.01.4 with commit ID 74a0d8c(latest) .

We want to build the latest image out of 17.01.4 (with latest commit) for MediaTek Mt7628 EVB with the latest WiFi drivers .

Thanks,
Sai

(Might want to delete your duplicate thread on this)

In target/linux/ramips/image/mt7628.mk from

commit 23a638ebd1fd7b9a38473efa819c0aaec8870822 (HEAD -> lede-17.01, origin/lede-17.01)
Author: Rafał Miłecki <rafal@milecki.pl>
Date:   Mon Apr 23 15:28:54 2018 +0200
#
# MT7628 Profiles
#

define Device/mt7628
  DTS := MT7628
  BLOCKSIZE := 64k
  IMAGE_SIZE := $(ralink_default_fw_size_4M)
  DEVICE_TITLE := MediaTek MT7628 EVB
  DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport
endef
TARGET_DEVICES += mt7628

MediaTek Ralink MIPS
MT7628 based boards
MediaTek MT7628 EVB

Thanks for the response Jeff.. I added the MT7628 EVB in target/linux/ramips/image/mt76x8.mk file.. after removing the tmp/ folder in source directory.. we are able to see the option in make menuconfig. Any particular reason..that the Mediatek MT7628 EVB TARGET_DEVICES has been removed in recent LEDE? i mean , something related to EVB was not ported?

It's available in the current HEAD of lede-17.01 as shown above. Perhaps you've got some differences from the upstream source.

Like said, the device MT7628 EVB is visible quite normally in 17.01 branch HEAD.
ramips / MT7628 boards / MT7628 EVB
Definition at:

But there may be a problem in the master branch, as the device's image definition is there, but the definition is missing the final TARGET_DEVICES statement:

I guess that it has just been an error in commit 3e36ca4b43 by @ldpinney . That commit combined two image .mk files into one, and it looks like the TARGET_DEVICES statement for just this one device got lost.
https://github.com/openwrt/openwrt/commit/3e36ca4b436510a6e411484db47f7df35ebaf86d#diff-a464c31b29038d747cf4e5e10a05f871

Some ramips specialist might look into it and check the compilation in master.
Simple fix might be:

--- a/target/linux/ramips/image/mt76x8.mk
+++ b/target/linux/ramips/image/mt76x8.mk
@@ -88,6 +88,7 @@ define Device/mt7628
   DEVICE_TITLE := MediaTek MT7628 EVB
   DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport
 endef
+TARGET_DEVICES += mt7628
 
 define Device/omega2
   DTS := OMEGA2

Adding that patch (and removing tmp directory) made the device visible in menuconfig also in master.

  │ ┌─────────────────────────────────────────────────────────────────────┐ │  
  │ │        Target System (MediaTek Ralink MIPS)  --->                   │ │  
  │ │        Subtarget (MT76x8 based boards)  --->                        │ │  
  │ │        Target Profile (MediaTek MT7628 EVB)  --->                   │ │  
  │ │        Target Images  --->                                          │ │

Just saw this on master, so it looks like it's been fixed. Thanks @hnyman

commit d089a5d7734d3a22213105b2af054a86b1af59ab (origin/master, origin/HEAD)
Author: Mathias Kresin <dev@kresin.me>
Date:   Mon Apr 23 19:36:02 2018 +0200

    ramips: create image for mt7628 evb board
    
    The image for the EVB board got lost with the merge of the mt7628 and
    mt7688 subtargets.
    
    Signed-off-by: Mathias Kresin <dev@kresin.me>

diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk
index c0b243c..aeb6faf 100644
--- a/target/linux/ramips/image/mt76x8.mk
+++ b/target/linux/ramips/image/mt76x8.mk
@@ -88,6 +88,7 @@ define Device/mt7628
   DEVICE_TITLE := MediaTek MT7628 EVB
   DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport
 endef
+TARGET_DEVICES += mt7628
 
 define Device/omega2
   DTS := OMEGA2

HI Jeff, hnyman, Pinney,

    We have taken the latest LEDE master from git and able to enable/compile the image for  Mediatek MT7628 EVB . 

We followed the below steps.

git clone https://github.com/lede-project/source.git ( ramips commit to enable support for EVBis the latest )
make menuconfig ( Enable below 3 options)**
MediaTek Ralink MIPS
MT76x8 based boards
MediaTek MT7628 EVB
./scripts/feeds update -a
./scripts/feeds install -a
make

Unfortunately , the kernel failed to mount the rootfs/fail to detect the SPI flash partition and continuously rebooting.

Below are the log messages from MT7628 EVB. Please see that we are missing anything/steps to make LEDE master to run on Mt7628 EVB.

Booting image at bc050000 ...

Image Name: MIPS OpenWrt Linux-4.14.34
Image Type: MIPS Linux Kernel Image (lzma compressed)
Data Size: 1453350 Bytes = 1.4 MB
Load Address: 80000000
Entry Point: 80000000
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
No initrd

Transferring control to Linux (at address 80000000) ...

Giving linux memsize in MB, 64

Starting kernel ...

[ 0.000000] Linux version 4.14.34 (sai@localhost.localdomain) (gcc version 7.3.0 (OpenWrt GCC 7.3.0 r6755-d089a5d)) #0 Mon Apr 23 20:07:22 2018
[ 0.000000] Board has DDR2
[ 0.000000] Analog PMU set to hw control
[ 0.000000] Digital PMU set to hw control
[ 0.000000] SoC Type: MediaTek MT7628AN ver:1 eco:2
[ 0.000000] bootconsole [early0] enabled
[ 0.000000] CPU0 revision is: 00019655 (MIPS 24KEc)
[ 0.000000] MIPS: machine is Mediatek MT7628AN evaluation board
[ 0.000000] Determined physical RAM map:
[ 0.000000] memory: 02000000 @ 00000000 (usable)
[ 0.000000] Initrd not found or empty - disabling initrd
[ 0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[ 0.000000] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[ 0.000000] Zone ranges:
[ 0.000000] Normal [mem 0x0000000000000000-0x0000000001ffffff]
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x0000000000000000-0x0000000001ffffff]
[ 0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000001ffffff]
[ 0.000000] random: get_random_bytes called from start_kernel+0x8c/0x474 with crng_init=0
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 8128
[ 0.000000] Kernel command line: console=ttyS0,57600 rootfstype=squashfs,jffs2
[ 0.000000] PID hash table entries: 128 (order: -3, 512 bytes)
[ 0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.000000] Writing ErrCtl register=0004200e
[ 0.000000] Readback ErrCtl register=0004200e
[ 0.000000] Memory: 27636K/32768K available (3351K kernel code, 168K rwdata, 812K rodata, 204K init, 208K bss, 5132K reserved, 0K cma-reserved)
[ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] NR_IRQS: 256
[ 0.000000] intc: using register map from devicetree
[ 0.000000] CPU Clock: 580MHz
[ 0.000000] timer_probe: no matching timers found
[ 0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 6590553264 ns
[ 0.000012] sched_clock: 32 bits at 290MHz, resolution 3ns, wraps every 7405115902ns
[ 0.015369] Calibrating delay loop... 385.84 BogoMIPS (lpj=1929216)
[ 0.087586] pid_max: default: 32768 minimum: 301
[ 0.096933] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.109891] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.129057] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.148431] futex hash table entries: 256 (order: -1, 3072 bytes)
[ 0.160527] pinctrl core: initialized pinctrl subsystem
[ 0.171313] NET: Registered protocol family 16
[ 0.182473] rt2880-pinmux pinctrl: invalid group "jtag" for function "gpio"
[ 0.196160] rt2880-pinmux pinctrl: error claiming hogs: -22
[ 0.207122] rt2880-pinmux pinctrl: could not claim hogs: -22
[ 0.218448] rt2880-pinmux: probe of pinctrl failed with error -22
[ 0.242329] random: fast init done
[ 0.255327] mt7621_gpio 10000600.gpio: registering 32 gpios
[ 0.266549] mt7621_gpio 10000600.gpio: registering 32 gpios
[ 0.277656] mt7621_gpio 10000600.gpio: registering 32 gpios
[ 0.292331] clocksource: Switched to clocksource MIPS
[ 0.303427] NET: Registered protocol family 2
[ 0.312836] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.326527] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.339049] TCP: Hash tables configured (established 1024 bind 1024)
[ 0.351752] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 0.363210] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 0.375816] NET: Registered protocol family 1
[ 0.387199] Crashlog allocated RAM at address 0x1f00000
[ 0.398844] workingset: timestamp_bits=30 max_order=13 bucket_order=0
[ 0.417112] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 0.428545] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[ 0.455909] io scheduler noop registered
[ 0.463577] io scheduler deadline registered (default)
[ 0.474503] Serial: 8250/16550 driver, 3 ports, IRQ sharing disabled
[ 0.487819] of_serial 10000c00.uartlite: could not find pctldev for node /pinctrl/uartlite, deferring probe
[ 0.507239] cacheinfo: Failed to find cpu0 device node
[ 0.517265] cacheinfo: Unable to detect cache hierarchy for CPU 0
[ 0.529889] spi-mt7621 10000b00.spi: could not find pctldev for node /pinctrl/spi, deferring probe
[ 0.548116] libphy: Fixed MDIO Bus: probed
[ 0.568146] rt3050-esw 10110000.esw: link changed 0x00
[ 0.578987] mtk_soc_eth 10100000.ethernet: generated random MAC address ca:8a:d9:04:b5:cc
[ 0.595801] mtk_soc_eth 10100000.ethernet eth0: mediatek frame engine at 0xb0100000, irq 5
[ 0.613903] NET: Registered protocol family 10
[ 0.626234] Segment Routing with IPv6
[ 0.633515] NET: Registered protocol family 17
[ 0.642202] 8021q: 802.1Q VLAN Support v1.8
[ 0.651092] of_serial 10000c00.uartlite: could not find pctldev for node /pinctrl/uartlite, deferring probe
[ 0.670387] spi-mt7621 10000b00.spi: could not find pctldev for node /pinctrl/spi, deferring probe
[ 0.689184] Warning: unable to open an initial console.
[ 0.700108] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[ 0.714826] Please append a correct "root=" boot option; here are the available partitions:
[ 0.731297] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[ 0.748532] Rebooting in 1 seconds..

Thanks,
Sai

Sorry, but no help from me.
I am not a ramips specialist, but just noticed the obvious mistake in the device definition in the image Makefile.