Work in Progress Kernel for ZTE zx297520v3

Hi,

In the past weeks I had some fun poking at my unused D-Link DWR932-M router and build an upstream kernel for it, with the hope of one day running OpenWrt on it. The result can be found at

It is a 6.18-based kernel that can boot on my device and probably other ZTE zx297520v3 based chips. it is not a full OpenWrt build, and a lot more work is needed to make OpenWrt useful on these devices. But it is good enough that I'd like to show it to the community.

Here are some forum threads that have discussed these devices in the past:

My git repository contains a Readme that describes how to build and run this kernel. The tricky part is that you need to get root access on the existing firmware and access to the boot loader. I highly recommend that you get an external flash programmer to recover in case you accidentally break boot. I got my device stuck on starting U-Boot a few times and needed to access the NAND chip directly to get it working again.

I have only tested it on my D-Link DWR932-M. If you try it on other devices I'd be curious about your results. My preferred place is in the bug tracker of my gitlab respository, but I'll also keep an eye on this forum thread.

I can confirm this boots on my Tecno TR118 using the loader from https://github.com/zx297520v3-mainline/zx297520v3-loader :slight_smile: :slight_smile: :slight_smile:

If anybody with a device with this SoC is interested in looking along, be sure to drop a message!

Here are some initial instructions that should help to join along with testing.

  1. Download https://limewire.com/d/hY7it#8NYyO3ZdWH
  2. Get the Linux branch from https://gitlab.com/stefandoesinger/zx297520-kernel/ and follow the instructions for building, you should end up with arch/arm/boot/zImage
  3. Combine zImage with a dtb: cat arch/arm/boot/zImage arch/arm/boot/dts/zte/dlink-dwr-932m.dtb > bootable
  4. Get u-boot from https://github.com/zx297520v3-mainline/u-boot-mainline and build with fastboot support:
    make ARCH=arm CROSS_COMPILE=arm-none-eabi- zx297520v3_defconfig
    make ARCH=arm CROSS_COMPILE=arm-none-eabi- -j16
  5. Get the loader https://github.com/zx297520v3-mainline/zx297520v3-loader and run it like this: sudo -E cargo r --release -- ../tloader.bin ../u-boot.bin (update paths to both files accordingly)
  6. Now connect your ZX29 device via USB. Depending on your device, you might need to short two pins according to these instructions: https://www.mywifi.bond/articles/80
    The tool should indicate it successfully sent both payloads across.
  7. Make sure you have fastboot installed (part of the Android SDK, but also in various distro repos)
  8. Push the image over with: sudo fastboot stage bootable
  9. Run the image with sudo fastboot oem run:"bootz 0x21000000"

This will boot the new Linux image on the device. It is strongly recommended that you have a UART connected. On the Tecno TR118 the UART is next to the USB mini connector. The pins are TX (data from the device) GROUND and RX (data to the device) at 1.8 volt. You should get a shell on the UART and possibly working CDC ethernet across USB.