TP-Link Archer C20 v4 up FLASH, RAM, USB, CPU-freq?

Hello! I work for update device Archer C20 v4. Now, I replaced FLASH 25Q64B to 25Q128FV. For correct identification all memory need to change some files. I edit file /tartget/linux/ramips/image/mt76x8.mk
(I changed two strings)

IMAGE_SIZE := 16064k
TPLINK_FLASHLAYOUT := 16Mmtk

For the second string I copied file /tartget/linux/ramips/dts/mt7628an_tplink_8m.mk, changed name of file to mt7628an_tplink_16m.mk. (Actually, name of file may be any, just wrote it in /tartget/linux/ramips/dts/mt7628an_tplink_archer-c20-v4.dts, first string #include "mt7628an_tplink_8m.dtsi").
In file "mt7628an_tplink_8m.dtsi" need to change strings, which have info about partitions:

partition@0 {
				label = "boot";
				reg = <0x0 0x20000>;
				read-only;
			};
			partition@20000 {
				compatible = "tplink,firmware";
				label = "firmware";
				reg = <0x20000 **0xfb0000**>;
			};
			partition@**fc0000** {
				label = "config";
				reg = <**0xfc0000** 0x10000>;
				read-only;
			};
			factory: partition@**fd0000** {
				label = "factory";
				reg = <0x**fd0000** 0x30000>;
				read-only;

Now, device used all FLASH memory. But, I can't understand one moment. Where is range of memory 0xfb0000 - 0xfc0000? May be need to write

label = "firmware";
reg = <0x20000 **0xfc0000**>;?

After that I changed RAM module M14D5121632A to H5PS1G63EFR-20L, but device not see all RAM. Only 64MB. I tried to found any information about upgrade memory. No results.
Can anyone help to find a solution?
And also, I tried to add USB support. I soldered pins D+ and D- on plate. Added external power 5V. Edited file /tartget/linux/ramips/dts/mt7628an_tplink_archer-c20-v4.dts:

&ehci 
{status = "**okay**";};
&ohci 
{status = "**okay**";};

Also was added packages for USB support: kmod-usb-storage, kmod-fs-ext4, block-mount, kmod-scsi-core. But no one USB device not recognized. No one "/dev/sd*" in system. And I don't know how to solve this problem. May be need to edit some file?
And finnaly, please, tell me, what files need to be edited to change the processor frequency?

You already have hex math wrong there. But differently than you think.
0xfc0000-0xfd0000 is already doublebooked.

It is start - size, not start - end.

Firmware should have size 0xfa0000 in order to end at 0xfc0000.

Hopefully you have also copied the factory and config contents to the new location. Otherwise you may lose proper WiFi.

2 Likes

It just an expirement, my practice for find mistakes for the followings works with other devices. I have full dumps of it device (original fw, openwrt fw 8M,openwrt fw 16M) and "art" range with wifi calibration in other file.
After Your answer I understand my mistakes.
Now, I would like to solve problem with RAM.

Hey, I finished battle with RAM. It just to add string with memory info into file:
/target/linux/ramips/dts/mt76x8an_tplink_archer-c20-v4.dts

memory@0 {
                    device_type = "memory";
                    reg = <0x0 0x8000000>;
            };

Now, device see all 128MB RAM. Need more time for tests.
Problems with usb. Don't know how can to solve problem.
Also search information about cpu freq.


Do you have the flash file if (yes) please send it to me .. for contact abdurrouf.bussiness@gmail.com

hi, can you please describe in detail what you did please :slight_smile: I want to do the same thing as you) please, I beg you, I want to build firmware based on 23.05