Help required- Adding support for MDM9607

I need some help and direction in supporting a new platform on OpenWRT.
I had ported MT7621 based router in the past and it's now part of standard OpenWRT build. However, I have very limited experience in porting a new platform on OpenWRT.

There are number of modules available on MDM9207 based chipset. One such module is Quectel EC20. They have made the linux kernel source code and bootloader code available under what they call OpenLinux. There is a company called Teltonika which also use EC20 has already made their own port and they have also made their code available on their downloads page.
I downloaded Teltonika's source code and I am able to build the code. However, it appears that Teltonika has drastically changed the flash layout for their own purpose. This has become a hurdle in getting Teltonika's GPL version working on bare EC20 modules.
I tried to contact their customer support but they don't have any answer on how to install the code on off-the-shelf EC20 modules. Their answer is that the files generated from the build will work with their hardware.
I have already done some work on the differences between flash layout of Teltonika's hardware and Quectel's hardware.

Quectel's SDK (Not OpenWRT based) generates following files:
mdm9607-perf-boot.img
mdm9607-perf-sysfs.ubi
usrdata.ubi
usrdata.ubifs

Teltonika's SDK (OpenWRT based) generates following files:
openwrt-mdm9x07-trb1422-squashfs-dynamic.bin
trb14x-aboot.mbn

I connected to Linux shell on both hardware and tried to see the flash layout-

Quectel EC20 Module:
/ # cat /proc/mtd 
dev:    size   erasesize  name
mtd0: 00280000 00040000 "sbl"
mtd1: 00280000 00040000 "mibib"
mtd2: 01600000 00040000 "efs2"
mtd3: 00500000 00040000 "sys_rev"
mtd4: 00300000 00040000 "rawdata"
mtd5: 00140000 00040000 "tz"
mtd6: 00180000 00040000 "rpm"
mtd7: 00140000 00040000 "aboot"
mtd8: 00900000 00040000 "boot"
mtd9: 00900000 00040000 "recovery"
mtd10: 00640000 00040000 "image_back"
mtd11: 00e00000 00040000 "recoveryfs_b"
mtd12: 01080000 00040000 "scrub"
mtd13: 03c00000 00040000 "modem"
mtd14: 00140000 00040000 "misc"
mtd15: 01e00000 00040000 "recoveryfs"
mtd16: 03800000 00040000 "qdsp6sw_b"
mtd17: 07c40000 00040000 "usr_data"
mtd18: 03a00000 00040000 "sys_back"
mtd19: 058c0000 00040000 "system"


Teltonika 

root@Teltonika-TRB140:/proc# cat /proc/mtd 
dev:	size   erasesize  name
mtd0: 00140000 00020000 "sbl"
mtd1: 00140000 00020000 "mibib"
mtd2: 01600000 00020000 "efs2"
mtd3: 00300000 00020000 "rawdata"
mtd4: 00140000 00020000 "tz"
mtd5: 00140000 00020000 "rpm"
mtd6: 00140000 00020000 "aboot"
mtd7: 00140000 00020000 "mnf_info"
mtd8: 00140000 00020000 "boot_config"
mtd9: 00900000 00020000 "boot_a"
mtd10: 00900000 00020000 "boot_b"
mtd11: 03c00000 00020000 "modem"
mtd12: 07740000 00020000 "rootfs_a"
mtd13: 07740000 00020000 "rootfs_b"
mtd14: 0a1c0000 00020000 "storage"

The device boots into fastboot mode where I can flash on the partitions as required. However, given the differences in the files generated by SDK's, I need help in how to get the Teltonika's OpenWRT based files work on Quectel EC20 module.

Thanks in advance.

1 Like

It's not just about OpenWrt support. These platforms currently lack upstream kernel support.
So the ideal approach would be first include support for that in kernel and then backport it to OpenWrt (other way is also possible but someone would need to maintain that over time and do alignments whenever kernel version gets changed - we prefer to avoid that).

That is more or less 3 to 6 months of full-time work (without access to a good documentation!) and only for the basic SOC stuff (many things are common in QCA SOC, between MDM, MSM, IPQ, Snapdragon, etc.).

You might want to look at:

You can change flash layout by patching 0:mibib partition
But it is not yet clear what needs to be done with the SBL and how to force it to load ABOOT