Skip to content

mediatek: add OpenWrt (U-Boot layout) for Cudy WR3000P v1 + add common ATF DDR4 target#21285

Closed
stavultras wants to merge 3 commits intoopenwrt:mainfrom
stavultras:wr3000p-v1-ubootmod
Closed

mediatek: add OpenWrt (U-Boot layout) for Cudy WR3000P v1 + add common ATF DDR4 target#21285
stavultras wants to merge 3 commits intoopenwrt:mainfrom
stavultras:wr3000p-v1-ubootmod

Conversation

@stavultras
Copy link
Copy Markdown
Contributor

This PR adds OpenWrt (U-Boot layout) for the Cudy WR3000P v1 device.

The changes are split into 2 commits:

  1. Add a common Cudy DDR4 ATF target
  2. Add support for the ubootmod flash layout.

This structure allows reuse of the ATF target for other similar Cudy devices with DDR4 RAM.

Since there are some similar devices from Cudy (WR3000H / WR3000P)
this will allow to create OpenWrt U-Boot layout for all of them
using same DDR4 target.

Signed-off-by: Dmitry Mostovoy <stavultras@gmail.com>
@github-actions github-actions bot added core packages pull request/issue for core (in-tree) packages target/mediatek pull request/issue for mediatek target labels Dec 25, 2025
@stavultras stavultras requested a review from fildunsky December 25, 2025 15:14
@stavultras stavultras changed the title mediatek: add OpenWrt (U-Boot layout) for Cudy WR300P v1 + add common ATF DDR4 target mediatek: add OpenWrt (U-Boot layout) for Cudy WR3000P v1 + add common ATF DDR4 target Dec 25, 2025
@stavultras stavultras force-pushed the wr3000p-v1-ubootmod branch 2 times, most recently from 3d2cd50 to 3b50639 Compare December 25, 2025 21:10
@stavultras stavultras force-pushed the wr3000p-v1-ubootmod branch 7 times, most recently from 5991407 to 5ba37de Compare December 28, 2025 19:50
This allows us to use the full size of nand,
which extends ubi size from 64Mb to 122.25Mb.

1. Log in to the device and backup all the partitions,
especially unique "Factory" and "bdata" partitions
from System -> Backup / Flash Firmware -> Save mtdblock contents.
2. Install kmod-mtd-rw to unlock mtd partitions for writing
  apk update && apk add kmod-mtd-rw && insmod mtd-rw i_want_a_brick=1

3. Write new OpenWrt (U-Boot Layout) "BL2" and "FIP":
  mtd -e BL2 write openwrt-mediatek-filogic-cudy_wr3000p-v1-ubootmod-preloader.bin BL2
  mtd -e FIP write openwrt-mediatek-filogic-cudy_wr3000p-v1-ubootmod-bl31-uboot.fip FIP
4. Set static IP on your PC: "192.168.1.254", gateway "192.168.1.1"
5. Serve openwrt-mediatek-filogic-cudy_wr3000p-v1-ubootmod-initramfs-recovery.itb
using TFTP server.
6. Connect Router LAN with PC LAN.
7. Cut off the power and re-engage, wait for TFTP recovery to complete.
8. After OpenWrt initramfs recovery has booted,
clean "/dev/mtd5" ubi partition to utilize maximum of free space:
  ubidetach -p /dev/mtd5; ubiformat /dev/mtd5 -y; ubiattach -p /dev/mtd5
  ubimkvol /dev/ubi0 -n 0 -N ubootenv -s 128KiB
  ubimkvol /dev/ubi0 -n 1 -N ubootenv2 -s 128KiB
4. Perform sysupgrade.

Signed-off-by: Dmitry Mostovoy <stavultras@gmail.com>
@Qtema
Copy link
Copy Markdown

Qtema commented Dec 31, 2025

I have applied this patch and tested it on the Cudy WR3000P v1. The device boots up correctly and works as expected. Thank you for your work!

Signed-off-by: Dmitry Mostovoy <stavultras@gmail.com>
@stavultras stavultras closed this Dec 31, 2025
@stavultras stavultras deleted the wr3000p-v1-ubootmod branch December 31, 2025 08:55
@stavultras
Copy link
Copy Markdown
Contributor Author

Closed in favor of #21339 due to merge conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core packages pull request/issue for core (in-tree) packages target/mediatek pull request/issue for mediatek target

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants