Add support for Cudy RE3000

@mmat was cool guy to donate me this device
It's similar build to WR3000 so 16MB SPI (XM25QH128C) and 256MB RAM but with a single 1Gbit port
Easy to unscrew . To gain access to UART port heatsink must be removed as well.

boot log leave our with disabled console:

F0: 102B 0000
FA: 0000 0000
V0: 0000 0000 [0001]
00: 0000 0000
BP: 2400 0041 [0000]
G0: 1190 0000
EC: 0000 0000 [0000]
T0: 0000 022A [010F]
Jump to BL

NOTICE:  BL2: v2.7(release):09a5dc9712
NOTICE:  BL2: Built : 08:35:35, Feb 22 2023
NOTICE:  WDT: disabled
NOTICE:  EMI: Using DDR3 settings

dump toprgu registers data:
1001c000 | 00000000 0000ffe0 00000000 00000000
1001c010 | 00000fff 00000000 00f00000 00000000
1001c020 | 00000000 00000000 00000000 00000000
1001c030 | 003c0003 003c0003 00000000 00000000
1001c040 | 00000000 00000000 00000000 00000000
1001c050 | 00000000 00000000 00000000 00000000
1001c060 | 00000000 00000000 00000000 00000000
1001c070 | 00000000 00000000 00000000 00000000
1001c080 | 00000000 00000000 00000000 00000000

dump drm registers data:
1001d000 | 00000000 00000000 00000000 00000000
1001d010 | 00000000 00000000 00000000 00000000
1001d020 | 00000000 00000000 00000000 00000000
1001d030 | 00a083f1 000003ff 00100000 00000000
1001d040 | 00000000 00000000 00020303 000000ff
1001d050 | 00000000 00000000 00000000 00000000
1001d060 | 00000002 00000000 00000000 00000000
drm: 500 = 0x8
[DDR Reserve] ddr reserve mode not be enabled yet
DDR RESERVE Success 0
[EMI] ComboMCP not ready, using default setting
BYTE_swap:0
BYTE_swap:0
Window Sum 560, worse bit 1, min window 68
Window Sum 548, worse bit 8, min window 64
Window Sum 338, worse bit 0, min window 40
Window Sum 318, worse bit 9, min window 38
Window Sum 352, worse bit 0, min window 42
Window Sum 326, worse bit 9, min window 38
Window Sum 362, worse bit 3, min window 42
Window Sum 334, worse bit 9, min window 40
Window Sum 376, worse bit 0, min window 46
Window Sum 350, worse bit 9, min window 40
Window Sum 386, worse bit 3, min window 46
Window Sum 358, worse bit 9, min window 42
Window Sum 394, worse bit 0, min window 48
Window Sum 372, worse bit 9, min window 44
Window Sum 376, worse bit 9, min window 44
Window Sum 414, worse bit 4, min window 50
Window Sum 382, worse bit 9, min window 44
Window Sum 420, worse bit 0, min window 52
Window Sum 386, worse bit 8, min window 46
Window Sum 426, worse bit 2, min window 52
NOTICE:  EMI: Detected DRAM size: 256MB
NOTICE:  EMI: complex R/W mem test passed
NOTICE:  CPU: MT7981 (1300MHz)
ERROR:   No Flash Device Matched
ERROR:   spi nor init fail -22
NOTICE:  BL2: Booting BL31
NOTICE:  BL31: v2.7(release):09a5dc9712
NOTICE:  BL31: Built : 08:35:35, Feb 22 2023
NOTICE:  Hello BL31!!!


U-Boot 2022.07-rc3 (Feb 22 2023 - 08:35:35 +0000), Build: jenkins-RE3000-11

CPU:   MediaTek MT7981
Model: mt7981-rfb
DRAM:  256 MiB
Core:  38 devices, 15 uclasses, devicetree: embed
Loading Environment from nowhere... OK
In:    serial@11002000
Out:   serial@11002000
Err:   serial@11002000
Net:
Warning: ethernet@15100000 (eth0) using random MAC address - b6:46:ab:5d:75:d6
eth0: ethernet@15100000

  *** U-Boot Boot Menu ***

      1. Startup system (Default)
      2. Upgrade firmware
      3. Upgrade ATF BL2
      4. Upgrade ATF FIP
      5. Upgrade single image
      6. Load image
      0. U-Boot console


  Press UP/DOWN to move, ENTER to select, ESC/CTRL+C to quit
SF: Detected XM25QH128C with page size 256 Bytes, erase size 4 KiB, total 16 MiB
Reading from 0xf0000 to 0x46000000, size 0x100 ... OK
Reading from 0xf0000 to 0x46000000, size 0x32bdcf ... OK
## Loading kernel from FIT Image at 46000000 ...
   Using 'config-1' configuration
   Trying 'kernel-1' kernel subimage
     Description:  ARM64 OpenWrt Linux-5.4.219
     Type:         Kernel Image
     Compression:  lzma compressed
     Data Start:   0x460000c0
     Data Size:    3306225 Bytes = 3.2 MiB
     Architecture: AArch64
     OS:           Linux
     Load Address: 0x48080000
     Entry Point:  0x48080000
     Hash algo:    crc32
     Hash value:   cc842103
     Hash algo:    sha1
     Hash value:   2a6b9a04a8816b80f626bf5e484546380fe69825
   Verifying Hash Integrity ... crc32+ sha1+ OK
## Loading fdt from FIT Image at 46000000 ...
   Using 'config-1' configuration
   Trying 'fdt-1' fdt subimage
     Description:  ARM64 OpenWrt R36 device tree blob
     Type:         Flat Device Tree
     Compression:  uncompressed
     Data Start:   0x463274e8
     Data Size:    17165 Bytes = 16.8 KiB
     Architecture: AArch64
     Hash algo:    crc32
     Hash value:   c0cabd11
     Hash algo:    sha1
     Hash value:   0cf1bfe19ebb5eb67e0f4378fe0b8a550ad7ef72
   Verifying Hash Integrity ... crc32+ sha1+ OK
   Booting using the fdt blob at 0x463274e8
   Uncompressing Kernel Image
   Loading Device Tree to 000000004f7f1000, end 000000004f7f830c ... OK

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[    0.000000] Linux version 5.4.219 (jenkins@release) (gcc version 8.4.0 (OpenW
rt GCC 8.4.0 1.15.4)) #0 SMP Wed Feb 22 08:35:35 2023
[    0.000000] Machine model: MediaTek MT7981 RFB/R36
[    0.000000] earlycon: uart8250 at MMIO32 0x0000000011002000 (options '')
[    0.000000] printk: bootconsole [uart8250] enabled
[    0.000000] On node 0 totalpages: 64592
[    0.000000]   DMA32 zone: 1024 pages used for memmap
[    0.000000]   DMA32 zone: 0 pages reserved
[    0.000000]   DMA32 zone: 64592 pages, LIFO batch:15
[    0.000000] psci: probing for conduit method from DT.
[    0.000000] psci: PSCIv1.1 detected in firmware.
[    0.000000] psci: Using standard PSCI v0.2 function IDs
[    0.000000] psci: MIGRATE_INFO_TYPE not supported.
[    0.000000] psci: SMC Calling Convention v1.0
[    0.000000] percpu: Embedded 20 pages/cpu s44056 r8192 d29672 u81920
[    0.000000] pcpu-alloc: s44056 r8192 d29672 u81920 alloc=20*4096
[    0.000000] pcpu-alloc: [0] 0 [0] 1
[    0.000000] Detected VIPT I-cache on CPU0
[    0.000000] CPU features: detected: GIC system register CPU interface
[    0.000000] CPU features: kernel page table isolation disabled by kernel conf                                                                             iguration
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 63568
[    0.000000] Kernel command line: console=ttyS0,115200n1 loglevel=8          e                                                                             arlycon=uart8250,mmio32,0x11002000
[    0.000000] Dentry cache hash table entries: 32768 (order: 6, 262144 bytes, l                                                                             inear)
[    0.000000] Inode-cache hash table entries: 16384 (order: 5, 131072 bytes, li                                                                             near)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 230860K/258368K available (6782K kernel code, 444K rwdata                                                                             , 1904K rodata, 448K init, 289K bss, 27508K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] rcu:     CONFIG_RCU_FANOUT set to non-default value of 32.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jif                                                                             fies.
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] GICv3: GIC: Using split EOI/Deactivate mode
[    0.000000] GICv3: 640 SPIs implemented
[    0.000000] GICv3: 0 Extended SPIs implemented
[    0.000000] GICv3: Distributor has no Range Selector support
[    0.000000] GICv3: 16 PPIs implemented
[    0.000000] GICv3: no VLPI support, no direct LPI support
[    0.000000] GICv3: CPU0: found redistributor 0 region 0:0x000000000c080000
[    0.000000] arch_timer: cp15 timer(s) running at 13.00MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles:                                                                              0x2ff89eacb, max_idle_ns: 440795202429 ns
[    0.000003] sched_clock: 56 bits at 13MHz, resolution 76ns, wraps every 43980                                                                             46511101ns
[    0.008175] Calibrating delay loop (skipped), value calculated using timer fr                                                                             equency.. 26.00 BogoMIPS (lpj=52000)
[    0.018494] pid_max: default: 32768 minimum: 301
[    0.023214] Mount-cache hash table entries: 512 (order: 0, 4096 bytes, linear                                                                             )
[    0.030474] Mountpoint-cache hash table entries: 512 (order: 0, 4096 bytes, l                                                                             inear)
[    0.039033] ASID allocator initialised with 65536 entries
[    0.044535] rcu: Hierarchical SRCU implementation.
[    0.049632] smp: Bringing up secondary CPUs ...
[    0.054498] Detected VIPT I-cache on CPU1
[    0.054518] GICv3: CPU1: found redistributor 1 region 0:0x000000000c0a0000
[    0.054540] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
[    0.054601] smp: Brought up 1 node, 2 CPUs
[    0.076212] SMP: Total of 2 processors activated.
[    0.080938] CPU features: detected: 32-bit EL0 Support
[    0.086100] CPU features: detected: CRC32 instructions
[    0.091366] CPU: All CPU(s) started at EL2
[    0.095488] alternatives: patching kernel code
[    0.102086] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, ma                                                                             x_idle_ns: 7645041785100000 ns
[    0.111898] futex hash table entries: 512 (order: 3, 32768 bytes, linear)
[    0.118795] pinctrl core: initialized pinctrl subsystem
[    0.124683] NET: Registered protocol family 16
[    0.129358] DMA: preallocated 256 KiB pool for atomic allocations
[    0.150825] SCSI subsystem initialized
[    0.154746] libata version 3.00 loaded.
[    0.158778] usbcore: registered new interface driver usbfs
[    0.164347] usbcore: registered new interface driver hub
[    0.169724] usbcore: registered new device driver usb
[    0.175558] Bluetooth: Core ver 2.22
[    0.179213] NET: Registered protocol family 31
[    0.183686] Bluetooth: HCI device and connection manager initialized
[    0.190077] Bluetooth: HCI socket layer initialized
[    0.194978] Bluetooth: L2CAP socket layer initialized
[    0.200070] Bluetooth: SCO socket layer initialized
[    0.205188] rbus 18000000.wbsys: PCI host bridge to bus 0000:00
[    0.211146] pci_bus 0000:00: root bus resource [mem 0x18000000-0x18ffffff]
[    0.218057] pci_bus 0000:00: root bus resource [bus 00-ff]
[    0.223569] pci_bus 0000:00: scanning bus
[    0.227608] pci 0000:00:00.0: [14c3:7981] type 00 class 0x000280
[    0.233653] pci 0000:00:00.0: reg 0x10: [mem 0x18000000-0x1800000f 64bit]
[    0.240476] pci 0000:00:00.0: reg 0x18: [mem 0x00000000-0x0000000f]
[    0.246775] pci 0000:00:00.0: reg 0x1c: [mem 0x00000000-0x0000000f]
[    0.253074] pci 0000:00:00.0: reg 0x20: [mem 0x00000000-0x0000000f]
[    0.259373] pci 0000:00:00.0: reg 0x24: [mem 0x00000000-0x0000000f]
[    0.266371] pci_bus 0000:00: fixups for bus
[    0.270580] pci_bus 0000:00: bus scan returning with max=00
[    0.277281] clocksource: Switched to clocksource arch_sys_counter
[    0.283953] thermal_sys: Registered thermal governor 'fair_share'
[    0.283957] thermal_sys: Registered thermal governor 'bang_bang'
[    0.290097] thermal_sys: Registered thermal governor 'step_wise'
[    0.296135] thermal_sys: Registered thermal governor 'user_space'
[    0.302171] thermal_sys: Registered thermal governor 'power_allocator'
[    0.308518] NET: Registered protocol family 2
[    0.319550] IP idents hash table entries: 4096 (order: 3, 32768 bytes, linear                                                                             )
[    0.327070] tcp_listen_portaddr_hash hash table entries: 256 (order: 0, 4096                                                                              bytes, linear)
[    0.335484] TCP established hash table entries: 2048 (order: 2, 16384 bytes,                                                                              linear)
[    0.343286] TCP bind hash table entries: 2048 (order: 3, 32768 bytes, linear)
[    0.350481] TCP: Hash tables configured (established 2048 bind 2048)
[    0.356919] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.363491] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.370578] NET: Registered protocol family 1
[    0.374980] PCI: CLS 0 bytes, default 64
[    0.379632] workingset: timestamp_bits=46 max_order=16 bucket_order=0
[    0.388972] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.394855] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORIT                                                                             Y) (c) 2001-2006 Red Hat, Inc.
[    0.418232] phy phy-usb-phy@11e10000.1: type_sw - reg 0x218, index 0
[    0.433721] Serial: 8250/16550 driver, 3 ports, IRQ sharing disabled
[    0.440784] printk: console [ttyS0] disabled
[    0.465198] 11002000.serial: ttyS0 at MMIO 0x11002000 (irq = 12, base_baud =                                                                              2500000) is a ST16650V2
[    0.474408] printk: console [ttyS0] enabled
[    0.474408] printk: console [ttyS0] enabled
[    0.482767] printk: bootconsole [uart8250] disabled
[    0.482767] printk: bootconsole [uart8250] disabled
[    0.493044] cacheinfo: Unable to detect cache hierarchy for CPU 0
[    0.501403] loop: module loaded
[    0.504652] mediatek,mt2701-ice_debug ice_debug: get dbg_sel clock fail: -2
[    0.511621] mediatek,mt2701-ice_debug: probe of ice_debug failed with error -                                                                             2
[    0.519591] mt7981-pinctrl 11d00000.pinctrl: pin_config_set op failed for pin                                                                              29
[    0.526993] mtk-spi 11009000.spi: Error applying setting, reverse things back
[    0.534773] spi-nor spi0.0: calibration result: 0x2
[    0.539997] spi-nor spi0.0: XM25QH128C (16384 Kbytes)
[    0.545417] 6 fixed-partitions partitions found on MTD device spi0.0
[    0.551774] Creating 6 MTD partitions on "spi0.0":
[    0.556560] 0x000000000000-0x000000040000 : "BL2"
[    0.561794] 0x000000040000-0x000000050000 : "u-boot-env"
[    0.567573] 0x000000050000-0x000000060000 : "Factory"
[    0.573101] 0x000000060000-0x000000070000 : "bdinfo"
[    0.578541] 0x000000070000-0x0000000f0000 : "FIP"
[    0.583722] 0x0000000f0000-0x000001000000 : "firmware"
[    0.589482] 2 fit-fw partitions found on MTD device firmware
[    0.595157] 0x0000000f0000-0x000000420000 : "kernel"
[    0.600589] 0x000000430000-0x000001000000 : "rootfs"
[    0.606013] mtd: device 7 (rootfs) set to be root filesystem
[    0.611716] 1 squashfs-split partitions found on MTD device rootfs
[    0.617910] 0x000000bd0000-0x000001000000 : "rootfs_data"
[    0.624886] [mtk_hw_init] reset_lock:0, force:0
[    0.629455] [mtk_hw_init] execute fe cold reset
[    0.665881] mtk_soc_eth 15100000.ethernet eth0: mediatek frame engine at 0xff                                                                             (...)

enabling OEM dropbear was done the same like in WR3000.

PR is ready for willing testers with access to TTL console

mediatek: filogic: add support for Cudy RE3000 v1 by nicefile · Pull Request #14651 · openwrt/openwrt (github.com)

1 Like

Anything need to know? I have RE3000 and TTL, planning to test. Need to read how to compile openwrt with the changes pending. Any tutorial?

Don't upgrade to newer firmware. It will update the boot process and no longer 2 sec delay and cannot change to OpenWRT. Unfortunately happened to me.

1 Like

Official support is already here both in master as in 23.05.3 branch . I've flashed my unit no problem and everything works .
One thing that some units have u-boot that cannot be stop while booting .
In M3000 PR there is other method to boot initramfs.bin as failed recovery procedure will stop u-boot as well .

  - hold the reset button while powering the router
  - press CTRL-C or wait for the timeout to get to the U-Boot prompt
  - prepare a TFTP server on the network to supply ..-initramfs-kernel.bin
  - use 'tftpboot' in the U-Boot shell to pull the image
  - boot the image using 'bootm'
  - push the ..-sysupgrade to the router using your preferred method
  - perform the upgrade with 'sysupgrade -n'

@delacroix1983 can You test above ?

It works like that.

1 Like