OOLITE -V3.2 | Unable to mount rootfs , mediatek board

Hi,

I am trying to flash my OOLITE V3.2 based board which has 64MB RAM and 32 MB RAM,

The default ramdisk image is working fine in
tftp boot to SDRAM as well as tftp boot to flash.

I wish to flash the squashfs image to SPI-NOR Flash - GD25Q256CYIGR
I tried adding its support in spi-nor.c as well but i feel that image is not getting loaded in SPI Flash.

Any help in this would be very helping

U-Boot 1.1.3 (Mar 10 2017 - 15:31:36)

Board: Ralink APSoC DRAM:  64 MB
relocate_code Pointer at: 83fa8000
******************************
Software System Reset Occurred
******************************
flash manufacture id: c8, device id 40 19
Warning: un-recognized chip ID, please update bootloader!
============================================
Ralink UBoot Version: 4.3.0.0
--------------------------------------------
ASIC 7628_MP (Port5<->None)
DRAM component: 512 Mbits DDR, width 16
DRAM bus: 16 bit
Total memory: 64 MBytes
Flash component: SPI Flash
Date:Mar 10 2017  Time:15:31:36
============================================
icache: sets:512, ways:4, linesz:32 ,total:65536
dcache: sets:256, ways:4, linesz:32 ,total:32768

 ##### The CPU freq = 575 MHZ ####
 estimate memory size =64 Mbytes
RESET MT7628 PHY!!!!!!

Catution: ResetButton wasn't pressed or not long enough!
Continuing normal boot...
============================================


Please choose the operation:
   1: Load system code to SDRAM via TFTP.
   2: Load system code then write to Flash via TFTP.
   3: Boot system code via Flash (default).
   4: Entr boot command line interface.
   7: Load Boot Loader code then write to Flash via Serial.
   9: Load Boot Loader code then write to Flash via TFTP.


You choosed 1

 0


1: System Load Linux to SDRAM via TFTP.
 Please Input new ones /or Ctrl-C to discard
        Input device IP (192.168.10.101) ==:192.168.10.101

        Input server IP (192.168.10.100) ==:192.168.10.100

        Input Linux Kernel filename (firmware.bin) ==:firmware.bin


 netboot_common, argc= 3

 NetTxPacket = 0x83FE5380

 NetLoop,call eth_halt !

 NetLoop,call eth_init !
Trying Eth0 (10/100-M)

 Waitting for RX_DMA_BUSY status Start... done


 ETH_STATE_ACTIVE!!
TFTP from server 192.168.10.100; our IP address is 192.168.10.101
Filename 'firmware.bin'.

 TIMEOUT_COUNT=10,Load address: 0x80a00000
Loading: Got ARP REPLY, set server/gtwy eth addr (5c:26:0a:48:8e:4c)
Got it
#################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         ######################################################
done
Bytes transferred = 3932335 (3c00af hex)
NetBootFileXferSize= 003c00af
Automatic boot of image at addr 0x80A00000 ...
## Booting image at 80a00000 ...
   Image Name:   MIPS OpenWrt Linux-4.14.34
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    1453584 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 (vagrant@vagrant-ubuntu-trusty-64) (gcc version 7.3.0 (OpenWrt GCC 7.3.0 r6704-0a2d549)) #0 Fri Jul 27 02:40:53 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 MT7688 ver:1 eco:2
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019655 (MIPS 24KEc)
[    0.000000] MIPS: machine is Oolite-v3.2 16MB
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 04000000 @ 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-0x0000000003ffffff]
[    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: fast init done
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line: console=ttyS0,57600 spi0.0=gd25q256 mtdparts:256k(u-boot)ro,64k(u-boot-env),64k(art)ro,15872k(firmware),7000k(factory)ro,128k(cbackup) 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=0005749e
[    0.000000] Readback ErrCtl register=0005749e
[    0.000000] Memory: 60112K/65536K available (3351K kernel code, 168K rwdata, 812K rodata, 204K init, 208K bss, 5424K 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.087587] pid_max: default: 32768 minimum: 301
[    0.096929] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.109885] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.129874] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.149248] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.161340] pinctrl core: initialized pinctrl subsystem
[    0.172120] NET: Registered protocol family 16
[    0.202987] mt7621_gpio 10000600.gpio: registering 32 gpios
[    0.214197] mt7621_gpio 10000600.gpio: registering 32 gpios
[    0.225303] mt7621_gpio 10000600.gpio: registering 32 gpios
[    0.240056] clocksource: Switched to clocksource MIPS
[    0.251144] NET: Registered protocol family 2
[    0.260552] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.274246] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.286766] TCP: Hash tables configured (established 1024 bind 1024)
[    0.299465] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.310923] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.323541] NET: Registered protocol family 1
[    0.335029] Crashlog allocated RAM at address 0x3f00000
[    0.346667] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[    0.364975] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.376407] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.403817] io scheduler noop registered
[    0.411485] io scheduler deadline registered (default)
[    0.422434] Serial: 8250/16550 driver, 3 ports, IRQ sharing disabled
[    0.436110] console [ttyS0] disabled
[    0.443132] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 28, base_baud = 2500000) is a 16550A
[    0.460959] console [ttyS0] enabled
[    0.460959] console [ttyS0] enabled
[    0.474690] bootconsole [early0] disabled
[    0.474690] bootconsole [early0] disabled
[    0.491028] cacheinfo: Failed to find cpu0 device node
[    0.501227] cacheinfo: Unable to detect cache hierarchy for CPU 0
[    0.514425] libphy: Fixed MDIO Bus: probed
[    0.534718] rt3050-esw 10110000.esw: link changed 0x00
[    0.545727] mtk_soc_eth 10100000.ethernet: generated random MAC address 96:01:16:29:76:b6
[    0.562663] mtk_soc_eth 10100000.ethernet eth0: mediatek frame engine at 0xb0100000, irq 5
[    0.580928] NET: Registered protocol family 10
[    0.593402] Segment Routing with IPv6
[    0.600836] NET: Registered protocol family 17
[    0.609681] 8021q: 802.1Q VLAN Support v1.8
[    0.620649] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[    0.635527] Please append a correct "root=" boot option; here are the available partitions:
[    0.652071] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[    0.669273] Rebooting in 1 seconds..
[04050C09][04050C0C]
DDR Calibration DQS reg = 00008887

Here is my complete .dts file,
This file is read during build but the fields like root=mtd5, root=mtd6 donot point to correct partition

/dts-v1/;

#include "mt7628an.dtsi"

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

/ {
        compatible = "mediatek,oolite-v3.2-16M", "mediatek,mt7628an-soc"; 
        model = "Oolite-v3.2 16MB";

        chosen {
                bootargs = "console=ttyS0,57600 spi0.0=gd25q256 mtdparts:256k(u-boot)ro,64k(u-boot-env),64k(art)ro,15872k(firmware),7000k(factory)ro,128k(cbackup)";
        };

        memory@0 {
                /* DDR size is 64MB */
                device_type = "memory";
                reg = <0x0 0x4000000>;
        };

        gpio-keys-polled {
                compatible = "gpio-keys-polled";
                #address-cells = <1>;
                #size-cells = <0>;
                poll-interval = <20>;

                reset {
                        /* RESET is GPIO38 */
                        label = "reset";
                        gpios = <&gpio1 6 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_RESTART>;
                };
        };

        gpio-leds {
                compatible = "gpio-leds";

                wifi {
                        /* WiFi led is GPIO44, defined in wled_an group */
                        label = "wifi";
                        gpios = <&wgpio 0 GPIO_ACTIVE_HIGH>;
                        default-state = "on";
                };
        };

        wgpio: gpio-wifi {
                compatible = "mediatek,gpio-wifi";
                #address-cells = <1>;
                #size-cells = <0>;
                gpio-controller;
                #gpio-cells = <2>;
        };
};

&pinctrl {
        state_default: pinctrl0 {
                gpio {
                        ralink,group = "gpio";      /* GPIO11 */
                        ralink,function = "gpio";
                };

                perst {
                        ralink,group = "perst";     /* GPIO36 */
                        ralink,function = "gpio";
                };

                refclk {
                        ralink,group = "refclk";    /* GPIO37 */
                        ralink,function = "gpio";
                };

                i2s {
                        ralink,group = "i2s";       /* GPIO0 - GPIO3 */
                        ralink,function = "gpio";
                };

                spis {
                        ralink,group = "spis";      /* GPIO14 - GPIO17 */
                        ralink,function = "gpio";
                };

                wled_kn {
                        ralink,group = "wled_kn";   /* GPIO35 */
                        ralink,function = "gpio";
                };

                wled_an {
                        ralink,group = "wled_an";   /* GPIO44 */
                        ralink,function = "wled_an";
                };

                wdt {
                        ralink,group = "wdt";       /* GPIO38 */
                        ralink,function = "gpio";
                };

                pwm0 {
                        ralink,group = "pwm0";      /* GPIO18 */
                        ralink,function = "gpio";
                };

                pwm1 {
                        ralink,group = "pwm1";      /* GPIO19 */
                        ralink,function = "gpio";
                };

                i2c {
                        ralink,group = "i2c";       /* GPIO4 - GPIO5 */
                        ralink,function = "gpio";
                };

                sdxc {
                        ralink,group = "sdmode";    /* GPIO22 - GPIO29 */
                        ralink,function = "gpio";
                };

                p4led_an {
                        ralink,group = "p4led_an";  /* GPIO39 */
                        ralink,function = "gpio";
                };

                p3led_an {
                        ralink,group = "p3led_an";  /* GPIO40 */
                        ralink,function = "gpio";
                };

                p2led_an {
                        ralink,group = "p2led_an";  /* GPIO41 */
                        ralink,function = "gpio";
                };
        };

};

&spi0 {
        compatible = "ralink,mt76x8-spi";

        pinctrl-names = "default";
        pinctrl-0 = <&spi_pins>, <&spi_cs1_pins>;
        status = "okay";

        gd25q256@0 {
                /* ROM size is 32MB */
                #address-cells = <1>;
                #size-cells = <1>;
                compatible = "jedec,spi-nor";
                reg = <0>;
                linux,modalias = "gd25q256";
                spi-max-frequency = <10000000>;
                m25p,chunked-io = <31>;

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

              	partition@20000 {
						label = "kernel";
						reg = <0x20000 0x160000>;
		        };

				partition@160000 {
						label = "rootfs";
						reg = <0x160000 0x7f0000>;
				};

                factory: partition@40000 {
                        label = "factory";
                        reg = <0x40000 0x10000>;
                        read-only;
                };
				
				partition@7f0000{
						label = "art";
						reg = <0x7f0000 0x800000>;
				};
                
				partition@50000{
                        label = "firmware";
                        reg = <0x20000 0x7f0000>;
                };		

        };

        sx1276@1 {
                compatible = "semtech,sx1276";
                reg = <1>;
                spi-max-frequency = <15000000>;

                dio-list = <0 1 2 3 255 255>;   /* DIO pins from DIO0 to DIO5 are GPIO0 to GPIO3, 255 stands for unused */
                reset = <40>;                   /* RESET pins is GPIO40 */
                ant-sw-lf = <41>;               /* 433MHz antenna control is GPIO41 */
                ant-sw-hf = <39>;               /* 868MHz antenna control is GPIO39 */
        };
};

&ethernet {
        mtd-mac-address = <&factory 0x28>;
};

&wmac {
        status = "okay";    /* wirelss dirver from OpenWRT */
};

&ehci {
        status = "okay";
};

&ohci {
        status = "okay";
};

-You are booting from RAM.... loaded over tftp.
-You are then instructing the kernel ( non-openwrt? ) to find it's root filesystem in the cmdline option mtdparts.... which
-> a) your kernel is not honoring

Explain more about exactly what you did when you "tried adding its support in spi-nor.c".... including sources your working from, modifications done and how you expect to be able to flash assuming SPINor is fully functional.

Hi wulfy,

Thanks for your response,

I tried flashing on SPI Flash as well,
below are the logs for same:

Please choose the operation:
   1: Load system code to SDRAM via TFTP.
   2: Load system code then write to Flash via TFTP.
   3: Boot system code via Flash (default).
   4: Entr boot command line interface.
   7: Load Boot Loader code then write to Flash via Serial.
   9: Load Boot Loader code then write to Flash via TFTP.


You choosed 2

 0


2: System Load Linux Kernel then write to Flash via TFTP.
 Warning!! Erase Linux in Flash then burn new one. Are you sure?(Y/N)
 Please Input new ones /or Ctrl-C to discard
        Input device IP (192.168.10.101) ==:192.168.10.101

        Input server IP (192.168.10.100) ==:192.168.10.100

        Input Linux Kernel filename (firmware.bin) ==:firmware.bin


 netboot_common, argc= 3

 NetTxPacket = 0x83FE5380

 NetLoop,call eth_halt !

 NetLoop,call eth_init !
Trying Eth0 (10/100-M)

 Waitting for RX_DMA_BUSY status Start... done


 ETH_STATE_ACTIVE!!
TFTP from server 192.168.10.100; our IP address is 192.168.10.101
Filename 'firmware.bin'.

 TIMEOUT_COUNT=10,Load address: 0x80100000
Loading: Got ARP REPLY, set server/gtwy eth addr (5c:26:0a:48:8e:4c)
Got it
#################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         ######################################################
done
Bytes transferred = 3932335 (3c00af hex)
NetBootFileXferSize= 003c00af
............................................................
............................................................
.
.
Done!
## Booting image at bc050000 ...
   Image Name:   MIPS OpenWrt Linux-4.14.34
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    1453754 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 (vagrant@vagrant-ubuntu-trusty-64) (gcc version 7.3.0 (OpenWrt GCC 7.3.0 r6704-0a2d549)) #0 Fri Jul 27 02:40:53 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 MT7688 ver:1 eco:2
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019655 (MIPS 24KEc)
[    0.000000] MIPS: machine is Oolite-v3.2 16MB
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 04000000 @ 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-0x0000000003ffffff]
[    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: fast init done
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line: console=ttyS0,57600 root=mtd3 spi0=gd25q256 mtdparts:256k(u-boot)ro,64k(u-boot-env),64k(art)ro,15872k(firmware),7000k(factory)ro,128k(cbackup) 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=0005749e
[    0.000000] Readback ErrCtl register=0005749e
[    0.000000] Memory: 60112K/65536K available (3351K kernel code, 168K rwdata, 812K rodata, 204K init, 208K bss, 5424K 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.096929] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.109884] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.129879] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.149253] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.161345] pinctrl core: initialized pinctrl subsystem
[    0.172125] NET: Registered protocol family 16
[    0.203017] mt7621_gpio 10000600.gpio: registering 32 gpios
[    0.214229] mt7621_gpio 10000600.gpio: registering 32 gpios
[    0.225334] mt7621_gpio 10000600.gpio: registering 32 gpios
[    0.240098] clocksource: Switched to clocksource MIPS
[    0.251186] NET: Registered protocol family 2
[    0.260593] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.274287] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.286807] TCP: Hash tables configured (established 1024 bind 1024)
[    0.299506] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.310962] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.323582] NET: Registered protocol family 1
[    0.335074] Crashlog allocated RAM at address 0x3f00000
[    0.346712] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[    0.365020] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.376452] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.403860] io scheduler noop registered
[    0.411529] io scheduler deadline registered (default)
[    0.422477] Serial: 8250/16550 driver, 3 ports, IRQ sharing disabled
[    0.436152] console [ttyS0] disabled
[    0.443173] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 28, base_baud = 2500000) is a 16550A
[    0.461001] console [ttyS0] enabled
[    0.461001] console [ttyS0] enabled
[    0.474731] bootconsole [early0] disabled
[    0.474731] bootconsole [early0] disabled
[    0.491069] cacheinfo: Failed to find cpu0 device node
[    0.501268] cacheinfo: Unable to detect cache hierarchy for CPU 0
[    0.514464] libphy: Fixed MDIO Bus: probed
[    0.534785] rt3050-esw 10110000.esw: link changed 0x00
[    0.545798] mtk_soc_eth 10100000.ethernet: generated random MAC address 92:0d:22:fb:75:8d
[    0.562735] mtk_soc_eth 10100000.ethernet eth0: mediatek frame engine at 0xb0100000, irq 5
[    0.581000] NET: Registered protocol family 10
[    0.593475] Segment Routing with IPv6
[    0.600908] NET: Registered protocol family 17
[    0.609753] 8021q: 802.1Q VLAN Support v1.8
[    0.620290] VFS: Cannot open root device "mtd3" or unknown-block(0,0): error -2
[    0.634796] Please append a correct "root=" boot option; here are the available partitions:
[    0.651340] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[    0.668544] Rebooting in 1 seconds..
[04060C09][04060C0C]
DDR Calibration DQS reg = 00008987

Please suggest where i am doing a mistake,

For making spi-nor.c changes, i followed this link,

https://patchwork.ozlabs.org/patch/793294/
and this is the code branch i am using,


Please note, if i create a ramdisk image from this branch, it works perfectly fine for oolite board.

Any help would be great

Thanks

Also,

These are the options i have,

How can i use spi command line to load image at a particular address in spi flash:

Environment size: 224/4092 bytes
MT7628 # help

?       - alias for 'help'
arb_erase - erase arbitraly position FLASH memory
bootm   - boot application image from memory
cp      - memory copy
erase   - erase SPI FLASH memory
ew      - erase_write parttition!
go      - start application at address 'addr'
gpio_in - Set gpio to input
gpio_r  - Read gpio status
gpio_w  - Set gpio out
help    - print online help
httpd   - Run httpd!
loadb   - load binary file over serial line (kermit mode)
mac_r   - read mac address!
mac_w   - write mac address!
md      - memory display
mdio   - Ralink PHY register R/W command !!
mm      - memory modify (auto-incrementing)
nm      - memory modify (constant address)
printenv- print environment variables
reset   - Perform RESET of the CPU
rf      - read/write rf register
saveenv - save environment variables to persistent storage
setenv  - set environment variables
sn_r    - read serial number!
sn_w    - write serial number!
spi     - spi command
tftpboot- boot image via network using TFTP protocol
version - print monitor version
write   - write file FLASH memory

And this is my current uboot printenv output:

MT7628 # printenv

bootcmd=tftp
bootdelay=3
baudrate=57600
ethaddr="00:AA:BB:CC:DD:10"
filesize=6af60a
fileaddr=80A00000
ipaddr=192.168.10.101
serverip=192.168.10.100
autostart=no
bootfile=firmware.bin
stdin=serial
stdout=serial
stderr=serial

Environment size: 224/4092 bytes

and these are the spi commands i have

MT7628 # help spi

spi spi usage:
  spi id
  spi sr read
  spi sr write <value>
  spi read <addr> <len>
  spi erase <offs> <len>
  spi write <offs> <hex_str_value>

I would be okay at this stage if i am able to flash it using spi commands as well.

Thanks

you are talking about the minibox 3.2?

using oolite code means you need to get help from oolite..(
gainstrong? )..

otherwise you have to start from here;
https://openwrt.org/toh/hwdata/gainstrong/gainstrong_minibox_v3.2

diving into spi write without firm reason is a recipe for trouble.

1 Like