OpenWrt Forum Archive

Topic: upgrade ram and flash

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

I have upgrade ram to 128Mb and flash to 8Mb on my asus N15. All working as with original hardware. Where I need to correct parameters in sources for new values?

[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 02000000 @ 08000000 (usable)
[    0.000000] Wasting 1048576 bytes for tracking 32768 unused pages
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x08000000-0x09ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x08000000-0x09ffffff]
[    0.000000] On node 0 totalpages: 8192

I think that OpenWRT expects the bootloader to have already set up the SoC's RAM controller to map all installed RAM flat into memory space.

To change the flash size usually you would redefine the partitioning in the model's .dts file in the source code.

(Last edited by mk24 on 13 Jan 2015, 00:44)

I make change in RT-N15.dts in last partition description:

cfi@1f000000 {
        compatible = "cfi-flash";
        reg = <0x1f000000 0x800000>;

        bank-width = <2>;
        device-width = <2>;
        #address-cells = <1>;
        #size-cells = <1>;

        partition@0 {
            label = "uboot";
            reg = <0x0 0x30000>;
            read-only;
        };
        partition@30000 {
            label = "uboot-env";
            reg = <0x30000 0x10000>;
            read-only;
        };
        factory: partition@40000 {
            label = "factory";
            reg = <0x40000 0x10000>;
            read-only;
        };
        partition@50000 {
            label = "firmware";
            reg = <0x50000 0x7b0000>;
        };
    };

But in kernel log the partition stay old size:

[    0.450000] 1f000000.cfi: Found 1 x16 devices at 0x0 in 16-bit bank. Manufacturer ID 0x0000c2 Chip ID 0x0022cb
[    0.470000] Amd/Fujitsu Extended Query Table at 0x0040
[    0.480000]   Amd/Fujitsu Extended Query version 1.1.
[    0.490000] number of CFI chips: 1
[    0.500000] 4 ofpart partitions found on MTD device 1f000000.cfi
[    0.510000] Creating 4 MTD partitions on "1f000000.cfi":
[    0.520000] 0x000000000000-0x000000030000 : "uboot"
[    0.530000] 0x000000030000-0x000000040000 : "uboot-env"
[    0.550000] 0x000000040000-0x000000050000 : "factory"
[    0.560000] 0x000000050000-0x000000400000 : "firmware"
[    0.580000] 2 uimage-fw partitions found on MTD device firmware
[    0.590000] 0x000000050000-0x000000150edd : "kernel"
[    0.600000] mtd: partition "kernel" must either start or end on erase block boundary or be smaller than an erase block -- forcing read-only
[    0.630000] 0x000000150edd-0x000000400000 : "rootfs"
[    0.640000] mtd: partition "rootfs" must either start or end on erase block boundary or be smaller than an erase block -- forcing read-only
[    0.670000] mtd: device 5 (rootfs) set to be root filesystem
[    0.680000] 1 squashfs-split partitions found on MTD device rootfs
[    0.690000] 0x000000360000-0x000000400000 : "rootfs_data"

Ram size stay as old size. But PCB have routed all neded pins in RAMs and Flash chips.

OK. I compiled with partition@50000 { label = "firmware";  reg = <0x50000 0x7b0000>;  }; and flash is erased after I tried programm old saved config. The kernel log had file system errors.
Now I try reprogram flash by serial. The RT2880 has internal ROM, but I have not datasheet and don't know how it's can be activated. I think, in factory blank  flash programed by serial with activated internal ROM. On PCB is not any test points for its, only absent resistors (pcb jumpers).
Anybody has any information, how activate internal ROM on RT2880 ???

Where is Uboot sources for config and compile for rt28880 asus n15?

_Cyber_ wrote:

Where is Uboot sources for config and compile for rt28880 asus n15?

Go get Ralink SDK 4.1.1.0 , there is include uboot source in one package , but maximum ram option only 512 mb / 64MB.

last sdk Ralink 4.2.0.0 https://yadi.sk/d/cOBl0ABEeCq6g
But I don't understand flash layout for 8Mb

@echo "Flash layout:"
    @echo " +-----------------------+-------+------+---+--------------------+"
    @echo " |   KERNEL PartII       | Uboot |UsrCfg| RF| Kernel PartI       |"
    @echo " +-----------------------+-------+------+---+--------------------+"
    @echo " |<------0x400000------->|<----$(UBOOT_SIZE)----->|<----$(KERNEL_FIRST_PART)---->|" 

and for 4Mb

@echo "Flash layout:"
    @echo " +-----------+--------+--------+-----------------------------+"
    @echo " | Uboot     | UsrCfg |  RF    |   Linux Kernel Image        |"
    @echo " +-----------+--------+--------+-----------------------------+"
    @echo " |<--------$(UBOOT_SIZE)------------>|<-------$(KERNEL_SIZE)------------>|" 

How make linux kernel image for 8Mb by openwrt?

This is my kernel log of Nexx WT3020 upgrade flash from 8MB to 16MB

[    0.360000] bootconsole [early0] disabled
[    0.360000] bootconsole [early0] disabled
[    0.380000] m25p80 spi32766.0: w25q128 (16384 Kbytes)
[    0.380000] 4 ofpart partitions found on MTD device spi32766.0
[    0.400000] Creating 4 MTD partitions on "spi32766.0":
[    0.400000] 0x000000000000-0x000000030000 : "u-boot"
[    0.420000] 0x000000030000-0x000000040000 : "u-boot-env"
[    0.430000] 0x000000040000-0x000000050000 : "factory"
[    0.440000] 0x000000050000-0x000001000000 : "firmware"
[    0.500000] 2 uimage-fw partitions found on MTD device firmware
[    0.520000] 0x000000050000-0x00000015dafa : "kernel"
[    0.520000] mtd: partition "kernel" must either start or end on erase block boundary or be smaller than an erase block -- forcing read-only
[    0.550000] 0x00000015dafa-0x000001000000 : "rootfs"
[    0.560000] mtd: partition "rootfs" must either start or end on erase block boundary or be smaller than an erase block -- forcing read-only
[    0.590000] mtd: device 5 (rootfs) set to be root filesystem
[    0.590000] 1 squashfs-split partitions found on MTD device rootfs
[    0.610000] 0x0000005c0000-0x000001000000 : "rootfs_data"

"df" command

root@OpenWrt:/# df
Filesystem           1K-blocks      Used Available Use% Mounted on
rootfs                   10496       408     10088   4% /
/dev/root                 4608      4608         0 100% /rom
tmpfs                    30844        60     30784   0% /tmp
/dev/mtdblock6           10496       408     10088   4% /overlay
overlayfs:/overlay       10496       408     10088   4% /
tmpfs                      512         0       512   0% /dev

My diff against svn

Index: target/linux/ramips/image/Makefile
===================================================================
--- target/linux/ramips/image/Makefile    (revision 44078)
+++ target/linux/ramips/image/Makefile    (working copy)
@@ -197,7 +197,7 @@
 BuildFirmware/Tplink/squashfs=$(call BuildFirmware/OF/tplink,$(1),$(2),$(3),$(4))
 BuildFirmware/Tplink/initramfs=$(call BuildFirmware/OF/tplink/initramfs,$(1),$(2),$(3),$(4))
 
-ralink_default_fw_size_16M=16121856
+ralink_default_fw_size_16M=16449536
 BuildFirmware/Default16M/squashfs=$(call BuildFirmware/OF,$(1),$(2),$(3),$(ralink_default_fw_size_16M),$(4))
 BuildFirmware/Default16M/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3),$(4))
 
@@ -213,10 +213,12 @@
 define BuildFirmware/DefaultDualSize/squashfs
     $(call BuildFirmware/Default4M/$(1),$(1),$(2)-4M,$(3)-4M)
     $(call BuildFirmware/Default8M/$(1),$(1),$(2)-8M,$(3)-8M)
+    $(call BuildFirmware/Default16M/$(1),$(1),$(2)-16M,$(3)-16M)
 endef
 define BuildFirmware/DefaultDualSize/initramfs
     $(call BuildFirmware/OF/initramfs,$(1),$(2)-4M,$(3)-4M)
     $(call BuildFirmware/OF/initramfs,$(1),$(2)-8M,$(3)-8M)
+    $(call BuildFirmware/OF/initramfs,$(1),$(2)-16M,$(3)-16M)
 endef
 
 # Some boards need a special header inside the uImage to make them bootable
@@ -328,6 +330,16 @@
 endef
 BuildFirmware/Poray8M/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3))
 
+define BuildFirmware/Poray16M/squashfs
+    $(call BuildFirmware/Default16M/$(1),$(1),$(2),$(3))
+    if [ -e "$(call sysupname,$(1),$(2))" ]; then \
+        mkporayfw -B $(3) -F 16M \
+            -f $(call sysupname,$(1),$(2)) \
+            -o $(call imgname,$(1),$(2))-factory.bin; \
+    fi
+endef
+BuildFirmware/Poray16M/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3))
+
 define BuildFirmware/PorayDualSize/squashfs
     $(call BuildFirmware/DefaultDualSize/$(1),$(1),$(2),$(3))
     if [ -e "$(call sysupname,$(1),$(2)-4M)" ]; then \
@@ -340,6 +352,11 @@
             -f $(call sysupname,$(1),$(2)-8M) \
             -o $(call imgname,$(1),$(2)-8M)-factory.bin; \
     fi
+    if [ -e "$(call sysupname,$(1),$(2)-16M)" ]; then \
+        mkporayfw -B $(3) -F 16M \
+            -f $(call sysupname,$(1),$(2)-16M) \
+            -o $(call imgname,$(1),$(2)-16M)-factory.bin; \
+    fi
 endef
 BuildFirmware/PorayDualSize/initramfs=$(call BuildFirmware/DefaultDualSize/initramfs,$(1),$(2),$(3))
 

Index: tools/firmware-utils/src/mkporayfw.c
===================================================================
--- tools/firmware-utils/src/mkporayfw.c    (revision 44078)
+++ tools/firmware-utils/src/mkporayfw.c    (working copy)
@@ -136,6 +136,9 @@
         .id        = "8M",
         .fw_max_len    = 0x7c0000,
     }, {
+        .id        = "16M",
+        .fw_max_len    = 0xfc0000,
+    }, {
         /* terminating entry */
     }
 };
@@ -232,6 +235,11 @@
                 .layout_id      = "8M",
                 .key            = KEY_NEXX_2,
         }, {
+         .id             = "WT3020",
+                .hw_id          = HWID_NEXX_WT3020,
+                .layout_id      = "16M",
+                .key            = KEY_NEXX_2,
+        }, {
 

OK, I have compiled uboot from sdk 4.2.0.0 with 128Mb RAM and 4Mb flash. Looks like good https://yadi.sk/d/xVtu5kUDeH7nX
But how I can restore, if uboot will be wrong? JTAG is not present in asus n15. Serial not working if uboot wrong. Internal ROM is not started or I don't know how.

(Last edited by _Cyber_ on 27 Jan 2015, 19:11)

The discussion might have continued from here.