How to system flash size and ram

i have a phicom router with 32Mb of space and ram is also higher space value(sorry really forgot about detail about ram) so my problem is that when i flash my router with openwrt it only detect 16mb of flash and some goes for the ram it doesn't detect the hole ram and rom that is present on the board is because of the build for raimps type kernel were written for 16mb flash rom .
so is there a way to make change in kernel file to i can use my extra space.
so do i have to board porting or kernel porting to get my build to detect 32 mb flash

Would you mind telling us which Phicomm router exactly?

yes sure its
mt7621

You are funny :rofl:

2 Likes

The only supported Phicomm with MT7621 is called Phicomm K2P!

According to [1], [2] and [3], this device does have 16 MB flash and 128 MB ram.
I believe this info is correct.
Can you post a picture of your 32 MB flash chip and your bigger ram?

[1] https://openwrt.org/toh/phicomm/phicomm_k2p_ke2p
[2] https://github.com/openwrt/openwrt/blob/master/target/linux/ramips/dts/mt7621_phicomm_k2p.dts
[3] http://www.phicomm.com/cn/en.php/News/detail/cateid/2/id/435.html

At least the last reference should be correct.

Juppin don't shoot the messenger :wink: i am just passing the information exactly how my friend has describe it
this is his word not mine
he say that when he is using breed via UART cable it detect it 32 MB of flash
no please could anyone tell how to increase flash through kernel porting ?

this the screenshot you requested

this the breed web
this is router after flash :-
this is router Ram :-

Sorry, I do not trust a closed source software like breed.
I asked you to post pictures of the chips on the mainboard.

I don't know why Linux shouldn't detect the ram size automatically.
There is a patch for automatic memory detection on mt7621.

If your friend has soldered a bigger flash memory, than this change has to be reflected in the device tree of this device (device tree of K2P is linked in my previous post) to have this additional space available.

1 Like

wait i will send the chip set photo

Ok, so your friend has soldered this flash chip on his K2P?

If you want to increase the usable size for OpenWRT, one has to increase the firmware partition inside the device tree and optional the size definition in the image Makefile.

Can you please also provide the output of the command dmesg?
I think, because the firmware partition is the last partition, it should be possible that it gets increased by the mtd subsystem without modifying the device tree firmware partition definition here.

hi there juppin after applying this patch it still don't show any changes this the output screenshot

so Juppin after look at the link what do i have do in my build to get more space in my flash
and few thing i did understand mtd subsystem
ps :-
i am using v18.06.5 for my build because it does't cause reboot issue

If you've replaced the chips with larger ones you have to modify the dts file and rebuild, or otherwise somehow attach a new "of" (compiled dts) blob to the kernel.

OpenWrt has been moving to the dts model where both the flash and RAM sizes are hard-coded rather than probed and dynamically allocated.

1 Like

This patch is already part of the OpenWRT kernel for mt7621 on master/snapshot and on 19.07, but not on 18.06.
But you got me wrong... This is only for auto detection of the ram size.

As @mk24 said, for a bigger flash, you have to edit the dts file for your K2P.
But I asked you to post the full output of the dmesg command as text after booting up your K2P, because on other targets, I've seen that the partition is automatically increased if there is more flash and if it's the last partition, as it your K2P has.

Change this line:


From:
reg = <0xa0000 0xf60000>;
To:
reg = <0xa0000 0x1f60000>;
And you will use the full 32M of your bigger flash chip.

1 Like

thank you Mk24 i will get down your method and juppin sorry for the late reply i will forward the dmesg log screenshot

Thank you juppin and MK24 for help me out the suggested method did it charm on the router my flash has increase to 32 MB.

the only things is that left is that my ram hasn't increase so do i have to change in dts as well file

this the full dmesg log :-

DRAM: 256MB
Trying to boot firmware from 0x000a0000 in flash bank 0 ...
Reading data into memory ...
U-Boot firmware image header detected.
    Image Name:   MIPS OpenWrt Linux-4.14.151
    Data Size:    1923678 Bytes
    Load Address: 80001000
    Entry Point:  80001000
Uncompressing data (LZMA) ... done.
Flushing cache ... done.
Starting kernel at 0x80001000...
[    0.000000] Linux version 4.14.151 (root@ip-10-200-11-77) (gcc version 7.3.0 (OpenWrt GCC 7.3.0 r7897-9d401013fc)) #0 SMP Tue Nov 5 14:12:18 2019
[    0.000000] SoC Type: MediaTek MT7621 ver:1 eco:3
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 0001992f (MIPS 1004Kc)
[    0.000000] MIPS: machine is Phicomm K2P
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 08000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] VPE topology {2,2} total 4
[    0.000000] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[    0.000000] MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000]   HighMem  empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] random: get_random_bytes called from start_kernel+0x94/0x4a8 with crng_init=0
[    0.000000] percpu: Embedded 14 pages/cpu s26224 r8192 d22928 u57344
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 32512
[    0.000000] Kernel command line: console=ttyS0,57600 rootfstype=squashfs,jffs2
[    0.000000] PID hash table entries: 512 (order: -1, 2048 bytes)
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Writing ErrCtl register=00011410
[    0.000000] Readback ErrCtl register=00011410
[    0.000000] Memory: 123352K/131072K available (4541K kernel code, 233K rwdata, 996K rodata, 232K init, 249K bss, 7720K reserved, 0K cma-reserved, 0K highmem)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] Hierarchical RCU implementation.
[    0.000000] NR_IRQS: 256
[    0.000000] clocksource: GIC: mask: 0xffffffffffffffff max_cycles: 0xcaf478abb4, max_idle_ns: 440795247997 ns
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 4343773742 ns
[    0.000010] sched_clock: 32 bits at 440MHz, resolution 2ns, wraps every 4880645118ns
[    0.015492] Calibrating delay loop... 586.13 BogoMIPS (lpj=2930688)
[    0.087815] pid_max: default: 32768 minimum: 301
[    0.097122] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.110141] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.125826] Hierarchical SRCU implementation.
[    0.135237] smp: Bringing up secondary CPUs ...
[    7.523271] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[    7.523279] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[    7.523290] MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
[    7.523427] CPU1 revision is: 0001992f (MIPS 1004Kc)
[    0.204635] Synchronize counters for CPU 1: done.
[    0.869295] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[    0.869304] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[    0.869312] MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
[    0.869383] CPU2 revision is: 0001992f (MIPS 1004Kc)
[    0.325211] Synchronize counters for CPU 2: done.
[    7.052532] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[    7.052540] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[    7.052547] MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
[    7.052627] CPU3 revision is: 0001992f (MIPS 1004Kc)
[    0.444776] Synchronize counters for CPU 3: done.
[    0.504374] smp: Brought up 1 node, 4 CPUs
[    0.515775] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.535239] futex hash table entries: 1024 (order: 3, 32768 bytes)
[    0.547681] pinctrl core: initialized pinctrl subsystem
[    0.558506] NET: Registered protocol family 16
[    0.577410] pull PCIe RST: RALINK_RSTCTRL = 4000000
[    0.887355] release PCIe RST: RALINK_RSTCTRL = 7000000
[    0.897420] ***** Xtal 40MHz *****
[    0.904153] release PCIe RST: RALINK_RSTCTRL = 7000000
[    0.914356] Port 0 N_FTS = 1b102800
[    0.921258] Port 1 N_FTS = 1b102800
[    0.928183] Port 2 N_FTS = 1b102800
[    2.086517] PCIE0 no card, disable it(RST&CLK)
[    2.095202] PCIE1 no card, disable it(RST&CLK)
[    2.104004] PCIE2 no card, disable it(RST&CLK)
[    2.121233] mt7621_gpio 1e000600.gpio: registering 32 gpios
[    2.132471] mt7621_gpio 1e000600.gpio: registering 32 gpios
[    2.143649] mt7621_gpio 1e000600.gpio: registering 32 gpios
[    2.157273] clocksource: Switched to clocksource GIC
[    2.168860] NET: Registered protocol family 2
[    2.178220] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    2.191963] TCP bind hash table entries: 1024 (order: 1, 8192 bytes)
[    2.204558] TCP: Hash tables configured (established 1024 bind 1024)
[    2.217338] UDP hash table entries: 256 (order: 1, 8192 bytes)
[    2.228830] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[    2.241478] NET: Registered protocol family 1
[    2.487212] 4 CPUs re-calibrate udelay(lpj = 2924544)
[    2.498649] Crashlog allocated RAM at address 0x3f00000
[    2.509300] workingset: timestamp_bits=30 max_order=15 bucket_order=0
[    2.529469] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    2.540950] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    2.562645] random: fast init done
[    2.568395] io scheduler noop registered
[    2.577039] io scheduler deadline registered (default)
[    2.588460] Serial: 8250/16550 driver, 3 ports, IRQ sharing disabled
[    2.602508] console [ttyS0] disabled
[    2.609554] 1e000c00.uartlite: ttyS0 at MMIO 0x1e000c00 (irq = 18, base_baud = 3125000) is a 16550A
[    2.627489] console [ttyS0] enabled
[    2.627489] console [ttyS0] enabled
[    2.641281] bootconsole [early0] disabled
[    2.641281] bootconsole [early0] disabled
[    2.659607] MediaTek Nand driver init, version v2.1 Fix AHB virt2phys error
[    2.673887] spi-mt7621 1e000b00.spi: sys_freq: 50000000
[    2.693938] m25p80 spi0.0: w25q256 (32768 Kbytes)
[    2.703443] 5 fixed-partitions partitions found on MTD device spi0.0
[    2.716091] Creating 5 MTD partitions on "spi0.0":
[    2.725640] 0x000000000000-0x000000030000 : "u-boot"
[    2.736526] 0x000000030000-0x000000040000 : "u-boot-env"
[    2.748008] 0x000000040000-0x000000050000 : "factory"
[    2.758976] 0x000000050000-0x0000000a0000 : "permanent_config"
[    2.771463] 0x0000000a0000-0x000002000000 : "firmware"
[    2.881213] 2 uimage-fw partitions found on MTD device firmware
[    2.893023] 0x0000000a0000-0x000000275a9e : "kernel"
[    2.903813] 0x000000275a9e-0x000002000000 : "rootfs"
[    2.914514] mtd: device 6 (rootfs) set to be root filesystem
[    2.925897] 1 squashfs-split partitions found on MTD device rootfs
[    2.938233] 0x000000b60000-0x000002000000 : "rootfs_data"
[    2.950486] libphy: Fixed MDIO Bus: probed
[    2.977583] mtk_soc_eth 1e100000.ethernet eth0 (uninitialized): port 2 link up
[    2.992053] mtk_soc_eth 1e100000.ethernet eth0 (uninitialized): port 4 link up
[    3.049241] libphy: mdio: probed
[    4.455166] mtk_soc_eth 1e100000.ethernet: loaded mt7530 driver
[    4.467677] mtk_soc_eth 1e100000.ethernet eth0: mediatek frame engine at 0xbe100000, irq 20
[    4.486590] NET: Registered protocol family 10
[    4.496968] Segment Routing with IPv6
[    4.504394] NET: Registered protocol family 17
[    4.513297] 8021q: 802.1Q VLAN Support v1.8
[    4.523832] hctosys: unable to open rtc device (rtc0)
[    4.540696] VFS: Mounted root (squashfs filesystem) readonly on device 31:6.
[    4.555271] Freeing unused kernel memory: 232K
[    4.564169] This architecture does not have kernel memory protection.
[    4.829910] random: crng init done
[    5.234537] init: Console is alive
[    5.241577] init: - watchdog -
[    6.522719] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    6.601220] usbcore: registered new interface driver usbfs
[    6.612291] usbcore: registered new interface driver hub
[    6.623065] usbcore: registered new device driver usb
[    6.659269] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    6.678814] SCSI subsystem initialized
[    6.690299] ehci-platform: EHCI generic platform driver
[    6.703133] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    6.716675] ohci-platform: OHCI generic platform driver
[    6.729158] uhci_hcd: USB Universal Host Controller Interface driver
[    6.750587] xhci-mtk 1e1c0000.xhci: xHCI Host Controller
[    6.761258] xhci-mtk 1e1c0000.xhci: new USB bus registered, assigned bus number 1
[    6.787422] xhci-mtk 1e1c0000.xhci: hcc params 0x01401198 hci version 0x96 quirks 0x0000000000210010
[    6.805695] xhci-mtk 1e1c0000.xhci: irq 19, io mem 0x1e1c0000
[    6.818121] hub 1-0:1.0: USB hub found
[    6.825655] hub 1-0:1.0: 2 ports detected
[    6.834195] xhci-mtk 1e1c0000.xhci: xHCI Host Controller
[    6.844821] xhci-mtk 1e1c0000.xhci: new USB bus registered, assigned bus number 2
[    6.859739] xhci-mtk 1e1c0000.xhci: Host supports USB 3.0  SuperSpeed
[    6.872760] usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
[    6.889675] hub 2-0:1.0: USB hub found
[    6.897200] hub 2-0:1.0: 1 port detected
[    6.910760] usbcore: registered new interface driver usb-storage
[    6.924480] usbcore: registered new interface driver uas
[    6.935500] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    6.967586] init: - preinit -
[    7.347356] usb 1-1: new high-speed USB device number 2 using xhci-mtk
[    7.915598] mtk_soc_eth 1e100000.ethernet: PPE started
[    7.917367] usb 1-2: new high-speed USB device number 3 using xhci-mtk
Press the [f] key and hit [enter] to enter failsafe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
[   11.403631] jffs2: notice: (485) jffs2_build_xattr_subsystem: complete building xattr subsystem, 7 of xdatum (3 unchecked, 4 orphan) and 18 of xref (4 dead, 0 orphan) found.
[   11.436894] mount_root: switching to jffs2 overlay
[   11.497928] overlayfs: upper fs does not support tmpfile.
[   11.523480] urandom-seed: Seeding with /etc/urandom.seed
[   11.643929] mtk_soc_eth 1e100000.ethernet: 0x100 = 0x6060000c, 0x10c = 0x80818
[   11.683396] procd: - early -
[   11.689347] procd: - watchdog -
[   12.447576] procd: - watchdog -
[   12.454258] procd: - ubus -
Failed to connect to ubus
[   12.699821] procd: - init -
Please press Enter to activate this console.
[   13.514310] kmodloader: loading kernel modules from /etc/modules.d/*
[   13.556971] NET: Registered protocol family 38
[   13.574661] Initializing XFRM netlink socket
[   13.585827] NET: Registered protocol family 15
[   13.597821] tun: Universal TUN/TAP device driver, 1.6
[   13.644251] l2tp_core: L2TP core driver, V2.0
[   13.654948] l2tp_netlink: L2TP netlink interface
[   13.666157] l2tp_eth: L2TP ethernet pseudowire support (L2TPv3)
[   13.679553] l2tp_ip: L2TP IP encapsulation support (L2TPv3)
[   13.692266] l2tp_ip6: L2TP IP encapsulation support for IPv6 (L2TPv3)
[   13.711042] gre: GRE over IPv4 demultiplexor driver
[   13.722626] ip_gre: GRE over IPv4 tunneling driver
[   13.738313] ip6_gre: GRE over IPv6 tunneling driver
[   13.755152] ip6_tables: (C) 2000-2006 Netfilter Core Team
[   13.777726] Netfilter messages via NETLINK v0.30.
[   13.791229] ip_set: protocol 6
[   13.844260] u32 classifier
[   13.849773]     input device check on
[   13.857088]     Actions configured
[   13.866609] Mirror/redirect action on
[   13.885288] nf_conntrack version 0.5.0 (2048 buckets, 8192 max)
[   13.906504] usbcore: registered new interface driver cdc_acm
[   13.917863] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[   13.936839] usbcore: registered new interface driver cdc_wdm
[   13.951332] ip_tables: (C) 2000-2006 Netfilter Core Team
[   14.139562] usbcore: registered new interface driver usbserial
[   14.151481] usbcore: registered new interface driver usbserial_generic
[   14.164685] usbserial: USB Serial support registered for generic
[   14.221846] xt_time: kernel timezone is -0000
[   14.234369] usbcore: registered new interface driver cdc_ether
[   14.251253] usbcore: registered new interface driver cdc_ncm
[   14.264106] usbcore: registered new interface driver huawei_cdc_ncm
[   14.292427] PPP generic driver version 2.4.2
[   14.302704] PPP MPPE Compression module registered
[   14.314373] NET: Registered protocol family 24
[   14.324872] PPTP driver version 0.8.5
[   14.339383] qmi_wwan 1-1:1.4: cdc-wdm0: USB WDM device
[   14.352856] qmi_wwan 1-1:1.4 wwan0: register 'qmi_wwan' at usb-1e1c0000.xhci-1, WWAN/QMI device, 02:b3:c1:8d:52:e6
[   14.376372] qmi_wwan 1-2:1.4: cdc-wdm1: USB WDM device
[   14.389678] qmi_wwan 1-2:1.4 wwan1: register 'qmi_wwan' at usb-1e1c0000.xhci-2, WWAN/QMI device, 02:b3:c1:8d:52:e6
[   14.410704] usbcore: registered new interface driver qmi_wwan
[   14.424942] usbcore: registered new interface driver rndis_host
[   14.442944] usbcore: registered new interface driver cdc_mbim
[   14.457584] l2tp_ppp: PPPoL2TP kernel driver, V2.0
[   14.469667] usbcore: registered new interface driver option
[   14.481088] usbserial: USB Serial support registered for GSM modem (1-port)
[   14.495554] option 1-1:1.0: GSM modem (1-port) converter detected
[   14.508202] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB0
[   14.522298] option 1-1:1.1: GSM modem (1-port) converter detected
[   14.534869] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB1
[   14.548922] option 1-1:1.2: GSM modem (1-port) converter detected
[   14.561487] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB2
[   14.575783] option 1-1:1.3: GSM modem (1-port) converter detected
[   14.588511] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB3
[   14.602850] option 1-2:1.0: GSM modem (1-port) converter detected
[   14.615503] usb 1-2: GSM modem (1-port) converter now attached to ttyUSB4
[   14.629503] option 1-2:1.1: GSM modem (1-port) converter detected
[   14.642073] usb 1-2: GSM modem (1-port) converter now attached to ttyUSB5
[   14.656335] option 1-2:1.2: GSM modem (1-port) converter detected
[   14.668931] usb 1-2: GSM modem (1-port) converter now attached to ttyUSB6
[   14.682895] option 1-2:1.3: GSM modem (1-port) converter detected
[   14.695442] usb 1-2: GSM modem (1-port) converter now attached to ttyUSB7
[   14.714841] kmodloader: done loading kernel modules from /etc/modules.d/*
[   23.347527] mtk_soc_eth 1e100000.ethernet: PPE started
[   23.371097] br-lan: port 1(eth0.1) entered blocking state
[   23.381965] br-lan: port 1(eth0.1) entered disabled state
[   23.393403] device eth0.1 entered promiscuous mode
[   23.403013] device eth0 entered promiscuous mode
[   23.417512] br-lan: port 1(eth0.1) entered blocking state
[   23.428360] br-lan: port 1(eth0.1) entered forwarding state
[   23.440042] IPv6: ADDRCONF(NETDEV_UP): br-lan: link is not ready
[   24.347808] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready

ps :- thank again Juppin and Mk24

i know my problem has been solved but i want to know what does 1f6000 mean in blow script change you mentioned ?
reg = <0xa0000 0xf60000>;
To:
reg = <0xa0000 0x1f60000>;

The first value is the start address and the second value is the size of the partition.
Both values are in hexadecimal representation.
The additional 0x1000000 bytes are exactly 16 MB.

Regarding your ram size, this should be solved with a update to 19.07 or to snapshot builds, as there is support for ram size auto detection.
If you want to stay on 18.06, you have to double the value in the device tree.
From:
reg = <0x0 0x8000000>;
To:
reg = <0x0 0x10000000>;
In: