Is the openwrt support MT7628?

I'm adapting OpenWrt 22.03.4 to a board with a MT7628 CPU (MediaTek MT7628 ver:1 eco:2).

The board dts as follows:

// SPDX-License-Identifier: GPL-2.0-or-later OR MIT

#include "mt7628an.dtsi"

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>

/ {
        compatible = "strong-board", "mediatek,mt7628an-soc";
        model = "strong-board";

        chosen {
                bootargs = "console=ttyS0,115200";
        };

        memory@0 {
                device_type = "memory";
                reg = <0x0 0x8000000>; // 128MB
                // reg = <0x0 0x10000000>; // 256MB
        };

        watchdog {
                compatible = "linux,wdt-gpio";
                gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
                hw_algo = "toggle";
                hw_margin_ms = <1000>;
                always-running = <1>;
                status = "okay";
        };
};

&spi0 {
        status = "okay";

        flash@0 {
                compatible = "jedec,spi-nor";
                reg = <0>;
                spi-max-frequency = <32000000>;

                partitions {
                        compatible = "fixed-partitions";
                        #address-cells = <1>;
                        #size-cells = <1>;

                        partition@0 {
                                label = "u-boot";
                                reg = <0x0 0x30000>;
                                read-only;
                        };

                        partition@30000 {
                                label = "u-boot-env";
                                reg = <0x30000 0x10000>;
                        };

                        factory: partition@40000 {
                                label = "factory";
                                reg = <0x40000 0x10000>;
                        };

                        partition@50000 {
                                compatible = "denx,uimage";
                                reg = <0x50000 0x1fb0000>;
                                label = "firmware";
                        };
                };
        };
};

After compiling the OpenWrt bin and burning it to the board, the boot output is as follows:

[    0.427588] Creating 4 MTD partitions on "spi0.0":
[    0.432462] 0x000000000000-0x000000030000 : "u-boot"
[    0.440167] 0x000000030000-0x000000040000 : "u-boot-env"
[    0.446815] 0x000000040000-0x000000050000 : "factory"
[    0.454822] 0x000000050000-0x000002000000 : "firmware"
[    0.461355] 2 uimage-fw partitions found on MTD device firmware
[    0.467455] Creating 2 MTD partitions on "firmware":
[    0.472497] 0x000000000000-0x00000020666a : "kernel"
[    0.477559] mtd: partition "kernel" doesn't end on an erase/write block -- force read-only
[    0.488722] 0x00000020666a-0x000001fb0000 : "rootfs"
[    0.493779] mtd: partition "rootfs" doesn't start on an erase/write block boundary -- force read-only
[    0.504356] mtd: setting mtd5 (rootfs) as root device
[    0.510449] 1 squashfs-split partitions found on MTD device rootfs
[    0.516813] 0x000000a00000-0x000001fb0000 : "rootfs_data"
[    0.572408] rt3050-esw 10110000.esw: mediatek esw at 0xb0110000, irq 25 initialized
[    0.580351] mtk_soc_eth 10100000.ethernet: generated random MAC address 06:c3:ad:ad:b5:8b
[    0.589381] mtk_soc_eth 10100000.ethernet eth0: mediatek frame engine at 0xb0100000, irq 5
[    0.599641] NET: Registered protocol family 10
[    0.609528] Segment Routing with IPv6
[    0.613391] NET: Registered protocol family 17
[    0.618056] 8021q: 802.1Q VLAN Support v1.8
[    0.631308] VFS: Mounted root (squashfs filesystem) readonly on device 31:5.
[    0.645771] Freeing unused kernel memory: 1212K
[    0.650367] This architecture does not have kernel memory protection.
[    0.656946] Run /sbin/init as init process

After outputting the Run /sbin/init as init process message, a reboot of the board occurs.

Is there a driver missing? How should I troubleshoot this issue?

The other board can output two more lines above it and it will reboot the board. The output is as follows:

[    0.373046] Creating 4 MTD partitions on "spi0.0":
[    0.377924] 0x000000000000-0x000000030000 : "u-boot"
[    0.386270] 0x000000030000-0x000000040000 : "u-boot-env"
[    0.393074] 0x000000040000-0x000000050000 : "factory"
[    0.401656] 0x000000050000-0x000002000000 : "firmware"
[    0.408308] 2 uimage-fw partitions found on MTD device firmware
[    0.414419] Creating 2 MTD partitions on "firmware":
[    0.419465] 0x000000000000-0x000000230c00 : "kernel"
[    0.424533] mtd: partition "kernel" doesn't end on an erase/write block -- force read-only
[    0.436244] 0x000000230c00-0x000001fb0000 : "rootfs"
[    0.441386] mtd: partition "rootfs" doesn't start on an erase/write block boundary -- force read-only
[    0.452064] mtd: setting mtd5 (rootfs) as root device
[    0.458381] 1 squashfs-split partitions found on MTD device rootfs
[    0.464768] 0x000000500000-0x000001fb0000 : "rootfs_data"
[    0.529000] rt3050-esw 10110000.esw: mediatek esw at 0xb0110000, irq 25 initialized
[    0.536944] mtk_soc_eth 10100000.ethernet: generated random MAC address 0a:e8:19:48:6c:3c
[    0.546026] mtk_soc_eth 10100000.ethernet eth0: mediatek frame engine at 0xb0100000, irq 5
[    0.556668] NET: Registered PF_INET6 protocol family
[    0.567659] Segment Routing with IPv6
[    0.571569] In-situ OAM (IOAM) with IPv6
[    0.575683] NET: Registered PF_PACKET protocol family
[    0.581044] 8021q: 802.1Q VLAN Support v1.8
[    0.595582] VFS: Mounted root (squashfs filesystem) readonly on device 31:5.
[    0.609441] Freeing unused kernel image (initmem) memory: 1212K
[    0.615501] This architecture does not have kernel memory protection.
[    0.622064] Run /sbin/init as init process
[    1.252709] init: Console is alive
[    1.256877] init: - watchdog -

Are there any compilation options that would output more debugging information at startup?

Does it work without the watchdog in the dts? Remove it and try again. Once you've got everything set up as desired you can re-enable and fix the Watchdog.

And there is really no point in porting a previous version of OpenWrt - go with the latest master, contribute your changes and port it back to a stable release.

Use OpenWrt master branch, after removing the dts watchdog and burning into the device, I found that the device rebooted as well, with the complete dts as follows:

// SPDX-License-Identifier: GPL-2.0-or-later OR MIT

#include "mt7628an.dtsi"

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>

/ {
        compatible = "strong-board", "mediatek,mt7628an-soc";

        model = "strong-board";

        chosen {
                bootargs = "console=ttyS0,115200";
        };

        memory@0 {
                device_type = "memory";
                reg = <0x0 0x8000000>; // 128MB
                // reg = <0x0 0x10000000>; // 256MB
        };
};

&spi0 {
        status = "okay";

        flash@0 {
                compatible = "jedec,spi-nor";
                reg = <0>;
                spi-max-frequency = <32000000>;

                partitions {
                        compatible = "fixed-partitions";
                        #address-cells = <1>;
                        #size-cells = <1>;

                        partition@0 {
                                label = "u-boot";
                                reg = <0x0 0x30000>;
                                read-only;
                        };

                        partition@30000 {
                                label = "u-boot-env";
                                reg = <0x30000 0x10000>;
                        };

                        factory: partition@40000 {
                                label = "factory";
                                reg = <0x40000 0x10000>;
                        };

                        partition@50000 {
                                compatible = "denx,uimage";
                                reg = <0x50000 0x0>;
                                label = "firmware";
                        };
                };
        };
};

The serial output message:

[    0.634751] Run /sbin/init as init process
[    1.323262] init: Console is alive
[    1.327415] init: - watchdog -   # When the init message is output, the device reboots

Is there any compilation option for OpenWrt that outputs detailed information?

The CPU used is MT7628 not MT7628AN, using mt7628an.dti Is there a link to this problem?

Because the board has a watchdog on it, the GPIOs are not enabled, causing the watchdog to reboot the board. Adding the GPIO compilation option for the watchdog solves the problem.

The target/linux/ramips/mt76x8/config-5.10 change:

+CONFIG_GPIO_WATCHDOG=y
+CONFIG_GPIO_WATCHDOG_ARCH_INITCALL=y

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.