Hi,
I want to run OpenWRT on a TP-LINK C58HP router, but unfortunately there is no dts file for it. Only C58 existed. They are both the same in hardware, but not the same in partitions. I tried to write a dts file on my own, but when I tried to tftp it to the router, it didn't work. It just returned to TP link's OEM firmware. Down below, the partitions from dmsg and TP link firmware are listed.
1- TP Link update firmware from its website
partition fs-uboot base 0x00000 size 0x10000
partition file-system base 0x10000 size 0x6c0000
partition os-image base 0x6d0000 size 0x110000
partition default-mac base 0x7e0000 size 0x00020
partition pin base 0x7e0020 size 0x00010
partition support-list base 0x7e0030 size 0x0006c
partition rf-test base 0x7e009c size 0x00004
partition soft-version base 0x7e00a0 size 0x00200
partition product-info base 0x7e02a0 size 0x002a0
partition partition-table base 0x7e0540 size 0x00f00
partition device-id base 0x7e1440 size 0x00100
partition profile base 0x7e1540 size 0x00ac0
partition default-config base 0x7e2000 size 0x02000
partition user-config base 0x7e4000 size 0x04000
partition certificate base 0x7e8000 size 0x04000
partition qos-db base 0x7ec000 size 0x04000
partition radio base 0x7f0000 size 0x10000
2- Partitions from dimes
[ 0.680000] 0x000000000000-0x000000010000 : "u-boot"
[ 0.690000] 0x000000010000-0x0000006d0000 : "rootfs"
[ 0.690000] mtd: partition "rootfs" set to be root filesystem
[ 0.700000] mtd: partition "rootfs_data" created automatically, ofs=6D0000, len=0
[ 0.710000] 0x0000006d0000-0x000000800000 : "rootfs_data"
[ 0.710000] 0x0000006d0000-0x0000007e0000 : "kernel"
[ 0.720000] 0x0000007e0000-0x0000007f0000 : "mib0"
[ 0.730000] 0x0000007f0000-0x000000800000 : "art"
[ 0.730000] 0x000000010000-0x0000007e0000 : "firmware"
and the .dts file that I wrote:
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/dts-v1/;
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include "qca9561_tplink_archer-c5x.dtsi"
/ {
compatible = "tplink,archer-c58hp-v1", "qca,qca9561";
model = "TP-Link Archer C58HP v1";
};
&spi {
status = "okay";
num-cs = <1>;
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <25000000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@00000 {
label = "u-boot";
reg = <0x000000 0x010000>;
read-only;
};
partition@6d0000 {
compatible = "denx,uimage";
label = "firmware";
reg = <0x6d0000 0x7d0000>;
};
info: partition@7e0000 {
label = "info";
reg = <0x7e0000 0x010000>;
read-only;
};
art: partition@7f0000 {
label = "art";
reg = <0x7f0000 0x010000>;
read-only;
};
};
};
};
ð0 {
status = "okay";
mtd-mac-address = <&mac 0x8>;
mtd-mac-address-increment = <1>;
};
ð1 {
status = "okay";
mtd-mac-address = <&mac 0x8>;
};
&wmac {
status = "okay";
mtd-cal-data = <&art 0x1000>;
mtd-mac-address = <&mac 0x8>;
};
PS:
If you want the binwalk for OpenWRT image builder firmware and OEM firmware, you can find it down below.
1-openwrt
DECIMAL HEXADECIMAL DESCRIPTION
--------------------------------------------------------------------------------
8455 0x2107 uImage header, header size: 64 bytes, header CRC: 0x22F6460C, created: 2020-01-06 16:47:09, image size: 1595899 bytes, Data Address: 0x80060000, Entry Point: 0x80060000, data CRC: 0x50E1B78, OS: Linux, CPU: MIPS, image type: OS Kernel Image, compression type: lzma, image name: "MIPS OpenWrt Linux-4.14.162"
8519 0x2147 LZMA compressed data, properties: 0x6D, dictionary size: 8388608 bytes, uncompressed size: 5011767 bytes
1604418 0x187B42 Squashfs filesystem, little endian, version 4.0, compression:xz, size: 2644060 bytes, 798 inodes, blocksize: 262144 bytes, created: 2022-10-30 09:57:38
2- OEM
DECIMAL HEXADECIMAL DESCRIPTION
--------------------------------------------------------------------------------
22868 0x5954 U-Boot version string, "U-Boot 1.1.4 (Jul 16 2018 - 07:53:04)"
22916 0x5984 CRC32 polynomial table, big endian
24212 0x5E94 uImage header, header size: 64 bytes, header CRC: 0x3B82BEBC, created: 2018-07-16 11:53:05, image size: 49336 bytes, Data Address: 0x80010000, Entry Point: 0x80010000, data CRC: 0xEC2762DF, OS: Linux, CPU: MIPS, image type: Firmware Image, compression type: lzma, image name: "u-boot image"
24276 0x5ED4 LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 122480 bytes
73613 0x11F8D Squashfs filesystem, little endian, version 4.0, compression:xz, size: 7073610 bytes, 2459 inodes, blocksize: 262144 bytes, created: 2018-07-17 10:20:29
7147224 0x6D0ED8 uImage header, header size: 64 bytes, header CRC: 0xF7AA7417, created: 2018-07-17 10:17:29, image size: 1099598 bytes, Data Address: 0x80060000, Entry Point: 0x80060000, data CRC: 0x2B6BE946, OS: Linux, CPU: MIPS, image type: Multi-File Image, compression type: lzma, image name: "MIPS OpenWrt Linux-3.3.8"
7147296 0x6D0F20 LZMA compressed data, properties: 0x6D, dictionary size: 8388608 bytes, uncompressed size: 3185696 bytes
note1: I just edited the partition part in c58.dts. The rest are unchanged.
note2: the output from image builder was 4.3MB and the firmware in tplink website was 8.7MB.