Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Phytium D2000 NetFix

One-shot network driver fix for Phytium D2000 / FT-2000 ARM64 machines running Ubuntu 24.04 (arm64). A self-extracting .run installer that adapts both NICs with a single command — install / uninstall / status.

中文文档 / Chinese README

What it fixes

Hardware Problem Solution
Onboard dual gigabit NICs (SoC DesignWare GMAC, ACPI PHYT0004 / FTGM0001) Stock Ubuntu stmmac driver only matches Device Tree, not ACPI → NICs don't exist Patched dwmac-generic module (ACPI match table + platform params), also fixes the cable-plug-in system hang
WiFi (Realtek RTL8822CE, PCIe 10ec:c82f) In-kernel rtw88 driver misbehaves on Phytium → no WiFi found Realtek vendor closed-source driver rtl88x2ce (same approach as Kylin OS)

Repository layout

phytium-d2000-netfix/
├── README.md                    ← this file (English)
├── README.zh-CN.md              ← 中文文档
├── phytium-d2000-netfix.run     ← use this one (self-extracting installer)
├── build/
│   ├── installer.sh             ← installer source (self-extracting script head)
│   └── build-phytium-netfix-run.sh  ← rebuild script for the .run package
└── payload/
    ├── dwmac/                   ← onboard-NIC patch source (dwmac-generic.c + headers)
    └── rtl88x2ce/               ← WiFi vendor driver source (closed-source, from dkms package)

Dependencies

Runtime (on the target machine = Phytium D2000 + Ubuntu 24.04 arm64)

  • root privileges (required for installation)
  • Kernel headers: apt install linux-headers-$(uname -r)
  • Build toolchain: apt install build-essential (provides make / gcc)
  • WiFi firmware: /lib/firmware/rtw88/rtw8822c_fw.bin (shipped with Ubuntu 24.04, no manual step)

The installer compiles kernel modules on the target machine (no prebuilt binaries), so headers must match the running kernel. Re-run the installer after every kernel upgrade (see Notes).

Build-time (only needed to rebuild the .run package)

  • bash, tar, gzip (stock on Ubuntu)
  • Nothing else special

Usage

chmod +x phytium-d2000-netfix.run

sudo ./phytium-d2000-netfix.run --install     # install (default action)
sudo ./phytium-d2000-netfix.run --status      # show current state
sudo ./phytium-d2000-netfix.run --uninstall   # uninstall, restore stock state
./phytium-d2000-netfix.run --help             # help

Reboot after install — the onboard-NIC module is loaded from the initramfs at boot.

Fresh-install workflow (recommended path)

  1. Install Ubuntu 24.04 Server (arm64)

  2. Get temporary connectivity (USB ethernet adapter or anything), then:

    sudo apt update
    sudo apt install -y build-essential linux-headers-$(uname -r)
  3. Copy phytium-d2000-netfix.run to the machine and run:

    sudo ./phytium-d2000-netfix.run --install
  4. Reboot: sudo reboot

  5. Onboard NIC: works automatically, DHCP (enaphyt4i0 / enaphyt4i1)

  6. WiFi: the installer only ships the driver — it does NOT contain your WiFi password. Edit a netplan file:

    # /etc/netplan/99-wifi.yaml
    network:
      version: 2
      wifis:
        wlp4s0:
          dhcp4: true
          access-points:
            YourSSID:
              password: "YourPassword"
    sudo netplan apply
  7. Verify: ip -br addr — both the onboard NIC and wlp4s0 should have IPs

Notes

Must know

  • initramfs trap: the installer always runs update-initramfs -u. Do NOT skip it — Ubuntu bundles net drivers into the initramfs, and at boot the kernel loads modules from the initrd. Without refreshing it, your replaced module is silently ignored after reboot (classic "the fix doesn't work" rabbit hole).
  • Re-run after every kernel upgrade: apt upgrade overwrites the patched module with the stock one, and the new kernel needs freshly compiled modules. Just run sudo ./phytium-d2000-netfix.run --install again (idempotent).
  • Do NOT hand-edit /etc/modprobe.d/rtw88_blacklist.conf: the installer manages it. Core principle: blacklist only the in-kernel rtw88, NEVER the vendor rtl88x2ce. (Historically, a leftover blacklist entry on rtl88x2ce was the root cause of "WiFi not found".)
  • Random MAC on the onboard NIC: the ACPI tables carry no MAC address, so it changes every boot and DHCP re-assigns an IP. Expected behavior.
  • PHY addresses are pinned: both onboard ports share one pair of RTL8211F PHYs (GMAC0 → addr 0, GMAC1 → addr 7). Don't switch to auto-scan, or both ports will fight over the same PHY.

Uninstall

  • --uninstall restores the stock dwmac-generic module (from the backup taken at first install), removes the vendor driver and the blacklist, and refreshes the initramfs. Reboot to fully revert.
  • First-install backup lives at /lib/modules/<kver>/kernel/drivers/net/ethernet/stmicro/stmmac/dwmac-generic.ko.zst.bak.

Support scope

  • Target: Phytium D2000 / FT-2000 (arm64), Ubuntu 24.04, kernel 6.8 line (verified on 6.8.0-100).
  • Other kernels/distros untested; run --status on the target first.
  • The installer logs to the terminal; compile failures print the error tail (most common cause: kernel headers missing).

Verification

After install:

sudo ./phytium-d2000-netfix.run --status

Expected:

  • dwmac-generic.ko (bare, NOT .ko.zst) present in the stmmac dir → patched
  • rtl88x2ce.ko present in /lib/modules/<kver>/updates/
  • initramfs dwmac copy is a bare .ko (patched), not .ko.zst (stock)
  • lsmod shows both dwmac_generic and rtl88x2ce loaded

Checksum

SHA256 (phytium-d2000-netfix.run) = 0020f52d8e3472cde2baa957e037fa76002e099d1365c433b9d9e04e75260322

License

Component License
payload/dwmac (patch source) GPL-2.0 (derived from Ubuntu kernel source)
payload/rtl88x2ce (vendor driver) Realtek closed-source, © Realtek Corp. — for personal backup / internal use only; public redistribution must follow Realtek's license terms
build/installer.sh, build/build-phytium-netfix-run.sh MIT

If you plan to make this repo public, confirm that redistributing the rtl88x2ce source complies with Realtek's license; a private repo avoids this concern entirely for personal backup use.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages