uboot-mediatek: support GL.iNet GL-X3000 and GL-XE3000
authorChris Webb <chris@arachsys.com>
Mon, 10 Jun 2024 08:54:23 +0000 (09:54 +0100)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 22 Sep 2024 21:50:40 +0000 (23:50 +0200)
commit7eda44f53647cb54cb9b2eb13b27417cd0128a37
treee7d06b476e873358793143187e1428ce16a9e3e4
parent105a5790b7131015c083cc3f08c81c3aca2b228a
uboot-mediatek: support GL.iNet GL-X3000 and GL-XE3000

Add u-boot support based on the kernel dts introduced in d1016446 and
the GL-MT6000 u-boot support in fe10f974.

The pcie-mediatek-gen3 kernel driver doesn't like hotplug, so to work in
PCIe mode, the 5G modem on this device needs to be switched on by u-boot
before starting the kernel. Include an init_modem step in the boot_system
action to set the relevant gpios. (The factory bootloader does the same,
using Mediatek SDK-specific gpio_power_clr and gpio_pull_up.)

Ideally the modem would be started using gpio-hog in the device tree, but
this will need to wait until mediatek gpio-hog support is fixed upstream:

  https://lore.kernel.org/u-boot/6ef2583e85eea60560d7776377d662779e7c44e5.1722419839.git.chris@arachsys.com/

The bootloader can be replaced using the built-in web interface of the
factory bootloader. Hold the reset button for five seconds while powering
on the device and it will boot into a recovery http server.

http://192.168.1.1/uboot.html and http://192.168.1.1/bl2.html can then
be used to upload openwrt-mediatek-filogic-glinet_gl-x3000-bl31-uboot.fip
and openwrt-mediatek-filogic-glinet_gl-x3000-preloader.bin respectively.

Alternatively, from a root shell on the running system, unlock the boot
partition with

  echo 0 >/sys/block/mmcblk0boot0/force_ro

then write openwrt-mediatek-filogic-glinet_gl-x3000-bl31-uboot.fip to
/dev/mmcblk0p4 and openwrt-mediatek-filogic-glinet_gl-x3000-preloader.bin
to /dev/mmcblk0boot0.

Signed-off-by: Chris Webb <chris@arachsys.com>
Link: https://github.com/openwrt/openwrt/pull/15645
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
package/boot/uboot-envtools/files/mediatek_filogic
package/boot/uboot-mediatek/Makefile
package/boot/uboot-mediatek/patches/454-add-glinet-x3000.patch [new file with mode: 0644]
target/linux/mediatek/image/filogic.mk