openwrt/target/linux/mpc85xx/image/p1010.mk
David Bauer 788a0cf15c mpc85xx: add support for Watchguard Firebox T10
Hardware
--------
SoC:    Freescale P1010
RAM:    512MB
FLASH:  1 MB SPI-NOR
        512 MB NAND
ETH:    3x Gigabite Ethernet (Atheros AR8033)
SERIAL: Cisco RJ-45 (115200 8N1)
RTC:    Battery-Backed RTC (I2C)

Installation
------------

1. Patch U-Boot by dumping the content of the SPI-Flash using a SPI
   programmer. The SHA1 hash for the U-Boot password is currently
   unknown.

   A tool for patching U-Boot is available at
   https://github.com/blocktrron/t10-uboot-patcher/

   You can also patch the unknown password yourself. The SHA1 hash is
   E597301A1D89FF3F6D318DBF4DBA0A5ABC5ECBEA

2. Interrupt the bootmenu by pressing CTRL+C. A password prompt appears.
   The patched password is '1234' (without quotation marks)

3. Download the OpenWrt initramfs image. Copy it to a TFTP server
   reachable at 10.0.1.13/24 and rename it to uImage.

4. Connect the TFTP server to ethernet port 0 of the Watchguard T10.

5. Download and boot the initramfs image by entering "tftpboot; bootm;"
   in U-Boot.

6. After OpenWrt booted, create a UBI volume on the old data partition.
   The "ubi" mtd partition should be mtd7, check this using

   $ cat /proc/mtd

   Create a UBI partition by executing

   $ ubiformat /dev/mtd7 -y

7. Increase the loadable kernel-size of U-Boot by executing

   $ fw_setenv SysAKernSize 800000

8. Transfer the OpenWrt sysupgrade image to the Watchguard T10 using
   scp. Install the image by using sysupgrade:

   $ sysupgrade -n <path-to-sysupgrade>

   Note: The LAN ports of the T10 are 1 & 2 while 0 is WAN. You might
   have to change the ethernet-port.

9. OpenWrt should now boot from the internal NAND. Enjoy.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 35f6d79513)
2023-03-10 00:13:29 +01:00

62 lines
2.0 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/tplink_tl-wdr4900-v1
DEVICE_VENDOR := TP-Link
DEVICE_MODEL := TL-WDR4900
DEVICE_VARIANT := v1
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 := 0x1000000
KERNEL_LOADADDR := 0x1000000
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_PACKAGES := kmod-rtc-s35390a kmod-eeprom-at24
KERNEL = kernel-bin | gzip | fit gzip $(KDIR)/image-$$(DEVICE_DTS).dtb
IMAGES := sysupgrade.bin
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
endef
TARGET_DEVICES += watchguard_firebox-t10
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