OpenWrt Forum Archive

Topic: WE826-T-4G reboot problem [SOLVED]

The content of this topic has been archived on 1 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hello community,

I've bought router Router Wifi 4G WE826-T-4G (almost 100psc) on wich The manufacturer made for me one serie with 32MB FLASH.

Describe of my problem.

If I use their OpenWRT, it seems, everything goes fine. (But I dont want their Owrt)

If I use my custom image or the image from buildbot, there is only 16MB usable flash (not solved by changing .dts file) but command reboot does not work. Over serial console I could see just Restarting and router freeze

Do anyone know, what could I change? It is possible somewhere find out an workaround of manufacturer or find, what he did in sources?

Thx

(Last edited by milankocvara on 18 Jun 2016, 09:34)

I don't know the answer, but I think would start with opening the router and look at the flash. There might be some settings in the OpenWrt source code for different types of flash chips (??). Bootloader size and other partitions may also differ (???).

stock OpenWRT

[    0.700000] m25p80 spi32766.0: w25q256 (32768 Kbytes)
[    0.700000] 4 ofpart partitions found on MTD device spi32766.0
[    0.710000] Creating 4 MTD partitions on "spi32766.0":
[    0.710000] 0x000000000000-0x000000030000 : "u-boot"
[    0.720000] 0x000000030000-0x000000040000 : "u-boot-env"
[    0.730000] 0x000000040000-0x000000050000 : "factory"
[    0.740000] 0x000000050000-0x000002000000 : "firmware"
[    0.740000] 0x0000001655a1-0x000002000000 : "rootfs"
[    0.750000] mtd: partition "rootfs" must either start or end on erase block boundary or be smaller than an erase block -- forcing read-only
[    0.760000] mtd: device 4 (rootfs) set to be root filesystem
[    0.770000] mtd: partition "rootfs_data" created automatically, ofs=0x690000, len=0x1970000
[    0.780000] 0x000000690000-0x000002000000 : "rootfs_data"

df -h after mount_root

Filesystem                Size      Used Available Use% Mounted on
rootfs                   25.4M    748.0K     24.7M   3% /
/dev/root                 5.3M      5.3M         0 100% /rom
tmpfs                    61.8M    244.0K     61.5M   0% /tmp
/dev/mtdblock5           25.4M    748.0K     24.7M   3% /overlay
overlayfs:/overlay       25.4M    748.0K     24.7M   3% /
tmpfs                   512.0K         0    512.0K   0% /dev

my image after changing .dts

[    0.824772] spi spi0.0: force spi mode3
[    0.829291] m25p80 spi0.0: w25q256 (32768 Kbytes)
[    0.834130] 4 ofpart partitions found on MTD device spi0.0
[    0.839765] Creating 4 MTD partitions on "spi0.0":
[    0.844668] 0x000000000000-0x000000030000 : "u-boot"
[    0.851518] 0x000000030000-0x000000040000 : "u-boot-env"
[    0.858842] 0x000000040000-0x000000050000 : "factory"
[    0.865836] 0x000000050000-0x000001000000 : "firmware"
[    0.957243] 2 uimage-fw partitions found on MTD device firmware
[    0.963328] 0x000000050000-0x00000019f7fd : "kernel"
[    0.970073] 0x00000019f7fd-0x000001000000 : "rootfs"
[    0.976978] mtd: device 5 (rootfs) set to be root filesystem
[    0.982968] 1 squashfs-split partitions found on MTD device rootfs
[    0.989299] 0x000000810000-0x000001000000 : "rootfs_data"


df -h after mount_root

/dev/root                 6656      6656         0 100% /rom
tmpfs                    62824        56     62768   0% /tmp
tmpfs                    62824        80     62744   0% /tmp/root
tmpfs                      512         0       512   0% /dev
/dev/mtdblock6            8128       368      7760   5% /overlay
overlayfs:/overlay        8128       368      7760   5% /

original (china) received from manufacturer

/dts-v1/;

/include/ "mt7620a.dtsi"

/ {
    compatible = "ralink,we826", "ralink,mt7620a-soc";
    model = "OpenWrt";

    palmbus@10000000 {
        sysc@0 {
            ralink,gpiomux = "i2c", "jtag";
            ralink,uartmux = "gpio";
            ralink,wdtmux = <1>;
        };

        gpio0: gpio@600 {
            status = "okay";
        };
        
        gpio1: gpio@638 {
            status = "okay";
        };

        gpio3: gpio@688 {
            status = "okay";
        };

        spi@b00 {
            status = "okay";

            m25p80@0 {
                #address-cells = <1>;
                #size-cells = <1>;
                compatible = "w25q256";
                reg = <0 0>;
                linux,modalias = "m25p80", "w25q256";
                spi-max-frequency = <10000000>;

                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 {
                    label = "firmware";
                    reg = <0x50000 0xfb0000>;
                };
            };
        };
    };

    ethernet@10100000 {
        mtd-mac-address = <&factory 0x4>;
        ralink,port-map = "llllw";
    };

    pinctrl {
        state_default: pinctrl0 {
            gpio {
                ralink,group ="i2c", "uartf", "wled", "spi refclk";
                ralink,function = "gpio";
            };
                        pa {
                                ralink,group = "pa";
                                ralink,function = "pa";
                        };
        };
    };

    ehci@101c0000 {
        status = "okay";
    };

    ohci@101c1000 {
        status = "okay";
    };

    sdhci@10130000 {
        status = "okay";
    };

    pcie@10140000 {
        status = "okay";
    };

    gpio-leds {
        compatible = "gpio-leds";
        sys {
            label = "we826:sys";
            gpios = <&gpio1 14 1>;
        };
        wlan {
            label = "we826:wlan";
            gpios = <&gpio3 0 1>;
        };
        wps {
            label = "we826:wps";
            gpios = <&gpio1 15 0>;
        };
    };

    gpio-keys-polled {
        compatible = "gpio-keys";
        #address-cells = <1>;
        #size-cells = <0>;
        poll-interval = <20>;
        reset {
            label = "reset";
            gpios = <&gpio0 13 0>;
            linux,code = <0x101>;
        };
    };
};

changes between original .dts from OpenWRT defconfig and my .dts changed after received .dts from manufacturer

29c29
<                        m25p80@0 {
---
>                        en25q128@0 {
32c32
<                                compatible = "w25q256";
---
>                                compatible = "w25q128";
34c34
<                                linux,modalias = "m25p80", "w25q256";
---
>                                linux,modalias = "m25p80";
97c97
<                        gpios = <&gpio1 14 1>;
---
>                        gpios = <&gpio1 14 0>;
116,117c116,117
<                        gpios = <&gpio0 13 0>;
<                        linux,code = <0x101>;
---
>                        gpios = <&gpio0 1 1>;
>                        linux,code = <0x198>;

It's a known problem. For 32MB access spi-controller switch flash into 4byte address mode. Uboot bootloader work only in 3byte address mode but warm reboot don't reset flash back to 3byte address mode. Where exist workaround patch https://patchwork.ozlabs.org/patch/545092.

123serge123 wrote:

It's a known problem. For 32MB access spi-controller switch flash into 4byte address mode. Uboot bootloader work only in 3byte address mode but warm reboot don't reset flash back to 3byte address mode. Where exist workaround patch https://patchwork.ozlabs.org/patch/545092.

Thx a lot. I will try flash new image tomorrow.

I hope, reboot is solved.

What about different size of partitions? Could anyone help to find correct settings of .dts? What is strange for me is

stock openwrt

spi32766.0
and overlay is mtdblock5 25MB

my openwrt

spi0.0 overlay is mtdblock6 and only 8MB

I've tried to understand .dts file, tried make some changes, but without result. One "working" step was, when i've changed partition Firmware size from reg = <0x50000 0xfb0000> to reg = <0x50000 0x1fb0000>. But thats is absolutely different from manufacturers .dts :-/

The discussion might have continued from here.