immortalwrt-VIKINGYFY/target/linux/mpc85xx/image/p1010.mk
Shine be7aa5bda4 mpc85xx: add support for Watchguard Firebox T10-W, T15(-W)
This commit adds support for the Watchguard Firebox models
T10-W, T15 and T15-W.

CPU:      Freescale P1010
RAM:      512MB (T10) / 1024MB (T15)
Flash:    1MB SPI-NOR, 512MB NAND (T10) / 1024MB NAND (T15)
WiFi:     802.11abgn 2T2R AR9582 based Mini-PCIe card (-W models only)
Ethernet: 3x GBE (via AR8033 PHY)
LEDs:     7x hard-wired (6x LAN, 1x Power)
          4x GPIO single-colored (Attn/Status/Mode/Failover)
          1x GPIO dual-colored (2.4/5G WiFi, -W models only)
Serial:   RJ45, Cisco pinout, 115200/8N1
Other:    Battery backed RTC
          Atmel TPM 1.2 chip (unsupported)

Based on 35f6d79, which introduced Watchguard Firebox T10 support.

The T10 and T15 are identical hardware, with the exception of the T15
having twice the flash and RAM size.

The T10-W and T15-W models have their Mini-PCIe slot populated with an ath9
(AR9582) based WiFi card. The slot is either unpopulated or empty for
non-WiFi models. All required drivers are present by default on the mpc85xx
target, so T10/T10-W resp. T15/T15-W can use the same OpenWrt image.

This commit also introduces the zImage loader from 7d768a9 to boot the
kernel. This is required, since the U-Boot version used in these devices
appears to have a hard limit of 16MB for the kernel size it can handle. The
current kernel size is around 17MB, though, due to kernel page alignment
required for memory protection.

Installation (replaces previous instructions for T10):

1. If the U-Boot password is known, proceed with step 2.

   If the U-Boot password is unknown, dump the NOR flash using a SPI
   programmer and patch the unknown password to a known one. You can use
   blocktrron's Python script:

   https://github.com/blocktrron/t10-uboot-patcher/

   This script will patch the password to '1234' (without quotes).

   Alternatively, you can search for the hashed password in the NOR dump
   yourself and overwrite it with a known one. The SHA1 hash is:

   E597301A1D89FF3F6D318DBF4DBA0A5ABC5ECBEA

   Write the patched NOR dump back to the device.

2. Connect the device via serial cable, power it on and interrupt
   the boot process by pressing Ctrl+C. Enter the U-Boot password to access
   the CLI.

3. (Optional) Populate the uboot-env partition by entering:

   saveenv

   This will allow you to use uboot-envtools from within OpenWrt later,
   e.g. to increase the loadable kernel size.

   The default loadable kernel size is 5MB, the compressed kernel size at
   the time of this commit is 3.1MB.

4. Serve the initramfs OpenWrt image from a TFTP server at 10.0.1.13/24,
   connected to eth0 (WAN) of the device. File name must be 'uImage'. Boot
   with:

   tftpboot; bootm;

   Make sure to use the correct image for your device (T10 resp. T15)!

5. After booting, connect to OpenWrt on eth1 (LAN) via SSH. Verify
   that the UBI partiton is mtd7, format it and install the sysupgrade
   image.

   $ cat /proc/mtd
   $ ubiformat /dev/mtd7 -y
   $ sysupgrade -n <path to sysupgrade.bin>

6. The device should now boot OpenWrt from NAND flash. Enjoy.

Back to stock:

Use the vendor recovery procedure.

Stock recovery might also be necessary in case you have accidentally used
the fw_setenv command from within OpenWrt without using saveenv in U-Boot
first.

In order to use the vendor firmware recovery procedure, the NAND partitions
mtd3 to mtd6 must remain intact. Make sure not to overwrite them, or keep
dumps of them for later recovery.

Signed-off-by: Shine <4c.fce2@proton.me>
Link: https://github.com/openwrt/openwrt/pull/16776
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-10 23:48:48 +01:00

122 lines
4.1 KiB
Makefile

DEVICE_VARS += TPLINK_HWID TPLINK_HWREV TPLINK_FLASHLAYOUT TPLINK_HEADER_VERSION
define Build/spi-loader-okli-compile
rm -rf $@.spi-loader-okli
$(CP) spi-loader $@.spi-loader-okli
$(MAKE) -C $@.spi-loader-okli \
CROSS_COMPILE="$(TARGET_CROSS)" CONFIG="$(DEVICE_NAME)"
cp "$@.spi-loader-okli/out/uImage" "$@"
rm -rf $@.spi-loader-okli
endef
define Build/spi-loader-okli
cat $(KDIR)/loader-$(1) "$@" > "$@.new"
mv "$@.new" "$@"
endef
define Device/aerohive_br200-wp
DEVICE_VENDOR := Aerohive
DEVICE_MODEL := BR200-WP
BLOCKSIZE := 128k
KERNEL_NAME := simpleImage.br200-wp
KERNEL := kernel-bin | uImage none
KERNEL_INITRAMFS := kernel-bin | uImage none
KERNEL_ENTRY := 0x1500000
KERNEL_LOADADDR := 0x1500000
KERNEL_SIZE := 8m
IMAGES := fdt.bin sysupgrade.bin
IMAGE/fdt.bin := append-dtb
IMAGE/sysupgrade.bin := append-dtb | pad-to 256k | check-size 256k | \
append-uImage-fakehdr ramdisk | pad-to 256k | check-size 512k | \
append-rootfs | pad-rootfs $$(BLOCKSIZE) | pad-to 41216k | check-size 41216k | \
append-kernel | append-metadata
IMAGE_SIZE = 63m
endef
TARGET_DEVICES += aerohive_br200-wp
define Device/enterasys_ws-ap3715i
DEVICE_VENDOR := Enterasys
DEVICE_MODEL := WS-AP3715i
BLOCKSIZE := 64k
KERNEL_NAME := simpleImage.ws-ap3715i
KERNEL_ENTRY := 0x1500000
KERNEL_LOADADDR := 0x1500000
KERNEL = kernel-bin | lzma | uImage lzma
IMAGES := sysupgrade.bin
IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
endef
TARGET_DEVICES += enterasys_ws-ap3715i
define Device/tplink_tl-wdr4900-v1
DEVICE_VENDOR := TP-Link
DEVICE_MODEL := TL-WDR4900
DEVICE_VARIANT := v1
DEVICE_COMPAT_VERSION := 1.1
DEVICE_COMPAT_MESSAGE := Config cannot be migrated from swconfig to DSA
DEVICE_PACKAGES := kmod-usb-ledtrig-usbport
TPLINK_HEADER_VERSION := 1
TPLINK_HWID := 0x49000001
TPLINK_HWREV := 1
TPLINK_FLASHLAYOUT := 16Mppc
KERNEL_NAME := simpleImage.tl-wdr4900-v1
KERNEL_INITRAMFS :=
KERNEL := kernel-bin | uImage none -M 0x4f4b4c49 | spi-loader-okli $(1)
KERNEL_ENTRY := 0x1500000
KERNEL_LOADADDR := 0x1500000
SUPPORTED_DEVICES += tl-wdr4900-v1
COMPILE := loader-$(1)
COMPILE/loader-$(1) := spi-loader-okli-compile
ARTIFACTS := fdt.bin
ARTIFACT/fdt.bin := append-dtb
IMAGES := factory.bin sysupgrade.bin
IMAGE/sysupgrade.bin := tplink-v1-image sysupgrade | append-metadata
IMAGE/factory.bin := tplink-v1-image factory
endef
TARGET_DEVICES += tplink_tl-wdr4900-v1
define Device/watchguard_firebox-t10
DEVICE_VENDOR := Watchguard
DEVICE_MODEL := Firebox T10
DEVICE_ALT0_VENDOR := Watchguard
DEVICE_ALT0_MODEL := Firebox T10-W
DEVICE_PACKAGES := kmod-rtc-s35390a kmod-eeprom-at24
# This boot loader doesn't reliably boot an uncompressed image,
# therefore resort to gzipping the already compressed zImage
KERNEL = kernel-bin | gzip | fit gzip $(KDIR)/image-$$(DEVICE_DTS).dtb
KERNEL_NAME := zImage.la3000000
KERNEL_ENTRY := 0x3000000
KERNEL_LOADADDR := 0x3000000
IMAGES := sysupgrade.bin
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
endef
TARGET_DEVICES += watchguard_firebox-t10
define Device/watchguard_firebox-t15
DEVICE_VENDOR := Watchguard
DEVICE_MODEL := Firebox T15
DEVICE_ALT0_VENDOR := Watchguard
DEVICE_ALT0_MODEL := Firebox T15-W
DEVICE_PACKAGES := kmod-rtc-s35390a kmod-eeprom-at24
# This boot loader doesn't reliably boot an uncompressed image,
# therefore resort to gzipping the already compressed zImage
KERNEL = kernel-bin | gzip | fit gzip $(KDIR)/image-$$(DEVICE_DTS).dtb
KERNEL_NAME := zImage.la3000000
KERNEL_ENTRY := 0x3000000
KERNEL_LOADADDR := 0x3000000
IMAGES := sysupgrade.bin
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
endef
TARGET_DEVICES += watchguard_firebox-t15
define Device/sophos_red-15w-rev1
DEVICE_VENDOR := Sophos
DEVICE_MODEL := RED 15w
DEVICE_VARIANT := Rev.1
# Original firmware uses a dedicated DTB-partition.
# The bootloader however supports FIT-images.
KERNEL = kernel-bin | gzip | fit gzip $(KDIR)/image-$$(DEVICE_DTS).dtb
IMAGES := sysupgrade.bin
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
endef
TARGET_DEVICES += sophos_red-15w-rev1