From 97e4311fca73d064d17065e7844699aa777cb157 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Tue, 8 Jan 2019 01:20:56 +0100 Subject: mpc85xx: add support for Sophos RED 15w Rev.1 Hardware ======== CPU: Freescale P1010 PowerPC RAM: 128M DDR3 NAND: 128MiB ETH: RTL8211F SGMII PHY RTL8367B 5-port RGMII switch (not connected to SoC - unmanaged) WiFi: SparkLan WPEA-121N - Atheros AR9382 2T2R abgn USB: 1x USB 2.0 LED: System, Router, Internet, Tunnel controllable LAN1-4, WAN, Power non-controllable BTN: None Installation ============ 1. Power on the device while attached to the Console port. 2. Halt the U-Boot by pressing Enter when prompted. 3. Set the correct bootcmd for booting OpenWRT: > setenv bootargs_owrt "setenv bootargs console=ttyS0,115200" > setenv bootcmd "run bootargs_owrt; nand read 0x1000000 0x300000 0x800000; bootm 0x1000000;" > saveenv 5. Rename OpenWRT initramfs image to 'kernel.bin' and place it in a TFTP server root-directory served on 192.168.1.2/24. Connect your computer to one of the LAN-ports. 4. Boot OpenWRT initramfs image with > run bootargs_owrt; tftpboot 0x1000000 192.168.1.2:kernel.bin; bootm 0x1000000; 6. (Optional) Make a Backup of 'sophos-os1', 'sophos-os2' and 'sophos-data' in case you ever want to go back to the vendor firmware. 7. Create Ubi Volume on mtd4 by executing > ubiformat /dev/mtd4 -y 8. Transfer OpenWRT sysupgrade image to the device via SCP and install it with > sysupgrade -n Back to Stock ============= If you want to go back to the stock firmware, here is the bootcmd of the vendor firmware: > setenv bootargs console=ttyS0,115200 root=/dev/mtdblock5; nand read 0xc00000 0x00300000 0x100000; nand read 0x1000000 0x00400000 0x00800000; bootm 0x1000000 - 0xc00000 Set it via 'setenv' from the U-Boot shell and don't forget to save it using 'saveenv'! After this, boot the OpenWRT initramfs image just like you would for installation. Write back the three vendor partitions using mtd. Reboot the device afterwards. Signed-off-by: David Bauer [refresh and reorder patches] Signed-off-by: Christian Lamparter --- target/linux/mpc85xx/base-files/etc/diag.sh | 3 +++ .../etc/hotplug.d/ieee80211/10-fix-wifi-mac | 20 ++++++++++++++++++++ .../linux/mpc85xx/base-files/lib/upgrade/platform.sh | 13 ++++++++++++- 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 target/linux/mpc85xx/base-files/etc/hotplug.d/ieee80211/10-fix-wifi-mac (limited to 'target/linux/mpc85xx/base-files') diff --git a/target/linux/mpc85xx/base-files/etc/diag.sh b/target/linux/mpc85xx/base-files/etc/diag.sh index 3d56d14b08..e344d4b756 100644 --- a/target/linux/mpc85xx/base-files/etc/diag.sh +++ b/target/linux/mpc85xx/base-files/etc/diag.sh @@ -9,6 +9,9 @@ get_status_led() { aerohive,hiveap-330) status_led="hiveap-330:green:tricolor0" ;; + sophos,red-15w-rev1) + status_led="red-15w-rev1:green:system" + ;; tplink,tl-wdr4900-v1) status_led="tp-link:blue:system" ;; diff --git a/target/linux/mpc85xx/base-files/etc/hotplug.d/ieee80211/10-fix-wifi-mac b/target/linux/mpc85xx/base-files/etc/hotplug.d/ieee80211/10-fix-wifi-mac new file mode 100644 index 0000000000..3092cebfc9 --- /dev/null +++ b/target/linux/mpc85xx/base-files/etc/hotplug.d/ieee80211/10-fix-wifi-mac @@ -0,0 +1,20 @@ +#!/bin/ash + +[ "$ACTION" == "add" ] || exit 0 + +PHYNBR=${DEVPATH##*/phy} + +[ -n $PHYNBR ] || exit 0 + +. /lib/functions.sh +. /lib/functions/system.sh + +board=$(board_name) + +case "$board" in +sophos,red-15w-rev1) + echo $(mtd_get_mac_ascii u-boot-env ethaddr) > /sys${DEVPATH}/macaddress + ;; +*) + ;; +esac diff --git a/target/linux/mpc85xx/base-files/lib/upgrade/platform.sh b/target/linux/mpc85xx/base-files/lib/upgrade/platform.sh index 1108b3fd6e..9f49d0ddce 100755 --- a/target/linux/mpc85xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/mpc85xx/base-files/lib/upgrade/platform.sh @@ -9,4 +9,15 @@ platform_check_image() { return 0 } -# use default for platform_do_upgrade() +platform_do_upgrade() { + local board=$(board_name) + + case "$board" in + sophos,red-15w-rev1) + nand_do_upgrade "$ARGV" + ;; + *) + default_do_upgrade "$ARGV" + ;; + esac +} -- cgit v1.2.3