[openwrt/openwrt] mvebu: add support for Fortinet FortiGate 52E

LEDE Commits lede-commits at lists.infradead.org
Sat May 25 11:05:29 PDT 2024


hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/38d6c99dc06afd23831e5b0d9d4f4c7347eb557c

commit 38d6c99dc06afd23831e5b0d9d4f4c7347eb557c
Author: INAGAKI Hiroshi <musashino.open at gmail.com>
AuthorDate: Wed Mar 8 21:54:14 2023 +0900

    mvebu: add support for Fortinet FortiGate 52E
    
    Fortinet FortiGate 52E (FG-52E) is a UTM, based on Armada 385 (88F6820).
    
    Specification:
    
    - SoC          : Marvell Armada 385 88F6820
    - RAM          : DDR3 2 GiB (4x Micron MT41K512M8DA-107, "D9SGQ")
    - Flash        : SPI-NOR 128 MiB (Macronix MX66L1G45GMI-10G)
    - SSD          : mSATA SSD 64 GB (2x A-DATA XM21E (AXM21ES3-32GM-B))
      - mode       : SATA III 6Gbps
      - power      : 3.3 VDC, 3.1 W (Max.)
    - Ethernet     : 7x 10/100/1000 Mbps
      - LAN 1-5    : Marvell 88E6176
      - WAN 1, 2   : Marvell 88E1512 (2x)
    - LEDs/Keys    : 18x/1x
    - UART         : "CONSOLE" port (RJ-45, RS-232C level)
      - port       : ttyS0
      - settings   : 9600bps 8n1
      - assignment : 1:NC , 2:NC , 3:TXD, 4:GND,
                     5:GND, 6:RXD, 7:NC , 8:NC
      - note       : compatible with Cisco console cable
    - HW Monitoring: nuvoTon NCT7802Y
    - Power        : 12 VDC, 2.5 A
      - plug       : Molex 5557-02R
    
    Flash instruction using initramfs image:
    
     1. Power on FG-52E and interrupt to show bootmenu
     2. Call "[I]: System information." -> "[S]: Set serial port baudrate."
        and set baudrate to 9600 bps
     3. Call "[R]: Review TFTP parameters.", check TFTP parameters and
        connect computer to "Image download port" in the parameters
     4. Prepare TFTP server with the parameters obtained above
     5. Rename OpenWrt initramfs image to "image.out" and put to TFTP
        directory
     6. Call "[T]: Initiate TFTP firmware transfer." to download initramfs
        image from TFTP server
     7. Type "R" key when the following message is showed, to boot initramfs
        image without flashing to spi-nor flash
    
        "Save as Default firmware/Backup firmware/Run image without saving:[D/B/R]?"
    
     8. On initramfs image, backup mtd if needed
    
        minimum:
    
        - "firmware-info"
        - "kernel"
        - "rootfs"
    
     9. On initramfs image, upload sysupgrade image to the device and perform
        sysupgrade
    10. Wait ~200 seconds to complete flashing and rebooting.
        If the device is booted with stock firmware, login to bootmenu and
        call "[B]: Boot with backup firmware and set as default." to set the
        first OS image as default and boot it.
    
    Notes:
    
    - Both colors of Bi-color LEDs on the front panel cannot be turned on at
      the same time.
    
    - "PWR" and "Logo" LEDs are connected to power source directly.
    
    - The following partitions are added for OpenWrt.
      These partitions are contained in "uboot" partition (0x0-0x1fffff) on
      stock firmware.
    
      - "firmware-info"
      - "dtb"
      - "u-boot-env"
      - "board-info"
    
    Image header for bootmenu tftp:
    
      0x0 - 0xf  : ?
     0x10 - 0x2f : Image Name
     0x30 - 0x17f: ?
    0x180 - 0x183: Kernel Offset*
    0x184 - 0x187: Kernel Length*
    0x188 - 0x18b: RootFS Offset (ext2)*
    0x18c - 0x18f: RootFS Length (ext2)*
    0x190 - 0x193: DTB Offset
    0x194 - 0x197: DTB Length
    0x198 - 0x19b: Data Offset (jffs2)
    0x19c - 0x19f: Data Length (jffs2)
    0x1a0 - 0x1ff: ?
    
    *: required for initramfs image
    
    MAC addresses:
    
    (eth0): 90:6C:AC:xx:xx:98 (board-info (OpenWrt), 0xd880 (hex))
    WAN 1 : 90:6C:AC:xx:xx:99
    WAN 2 : 90:6C:AC:xx:xx:9A
    LAN 1 : 90:6C:AC:xx:xx:9B
    LAN 2 : 90:6C:AC:xx:xx:9C
    LAN 3 : 90:6C:AC:xx:xx:9D
    LAN 4 : 90:6C:AC:xx:xx:9E
    LAN 5 : 90:6C:AC:xx:xx:9F
    
    Signed-off-by: INAGAKI Hiroshi <musashino.open at gmail.com>
---
 .../linux/mvebu/cortexa9/base-files/etc/board.d/02_network   |  3 ++-
 .../linux/mvebu/cortexa9/base-files/lib/upgrade/platform.sh  |  3 ++-
 .../arch/arm/boot/dts/marvell/armada-385-fortinet-fg-52e.dts | 12 ++++++++++++
 target/linux/mvebu/image/cortexa9.mk                         |  9 +++++++++
 4 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/target/linux/mvebu/cortexa9/base-files/etc/board.d/02_network b/target/linux/mvebu/cortexa9/base-files/etc/board.d/02_network
index d936f829c6..b3dbce8542 100644
--- a/target/linux/mvebu/cortexa9/base-files/etc/board.d/02_network
+++ b/target/linux/mvebu/cortexa9/base-files/etc/board.d/02_network
@@ -29,7 +29,8 @@ mvebu_setup_interfaces()
 		ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
 		;;
 	fortinet,fg-50e|\
-	fortinet,fg-51e)
+	fortinet,fg-51e|\
+	fortinet,fg-52e)
 		ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 lan5" "eth1 eth2"
 		;;
 	iij,sa-w2)
diff --git a/target/linux/mvebu/cortexa9/base-files/lib/upgrade/platform.sh b/target/linux/mvebu/cortexa9/base-files/lib/upgrade/platform.sh
index 9f645eeb48..bc39ddcf50 100755
--- a/target/linux/mvebu/cortexa9/base-files/lib/upgrade/platform.sh
+++ b/target/linux/mvebu/cortexa9/base-files/lib/upgrade/platform.sh
@@ -54,7 +54,8 @@ platform_do_upgrade() {
 		;;
 	fortinet,fg-30e|\
 	fortinet,fg-50e|\
-	fortinet,fg-51e)
+	fortinet,fg-51e|\
+	fortinet,fg-52e)
 		fortinet_do_upgrade "$1"
 		;;
 	iij,sa-w2)
diff --git a/target/linux/mvebu/files-6.6/arch/arm/boot/dts/marvell/armada-385-fortinet-fg-52e.dts b/target/linux/mvebu/files-6.6/arch/arm/boot/dts/marvell/armada-385-fortinet-fg-52e.dts
new file mode 100644
index 0000000000..bcb0d05627
--- /dev/null
+++ b/target/linux/mvebu/files-6.6/arch/arm/boot/dts/marvell/armada-385-fortinet-fg-52e.dts
@@ -0,0 +1,12 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "armada-385-fortinet-fg-5xe.dtsi"
+
+/ {
+	model = "Fortinet FortiGate 52E";
+	compatible = "fortinet,fg-52e", "marvell,armada385", "marvell,armada380";
+};
+
+&ahci0 {
+	status = "okay";
+};
diff --git a/target/linux/mvebu/image/cortexa9.mk b/target/linux/mvebu/image/cortexa9.mk
index 5319e543e5..00f81dc4fc 100644
--- a/target/linux/mvebu/image/cortexa9.mk
+++ b/target/linux/mvebu/image/cortexa9.mk
@@ -151,6 +151,15 @@ define Device/fortinet_fg-51e
 endef
 TARGET_DEVICES += fortinet_fg-51e
 
+define Device/fortinet_fg-52e
+  $(Device/fortinet)
+  DEVICE_MODEL := FortiGate 52E
+  DEVICE_DTS := armada-385-fortinet-fg-52e
+  KERNEL_INITRAMFS := kernel-bin | append-dtb | fortigate-header | \
+    gzip-filename FGT52E
+endef
+TARGET_DEVICES += fortinet_fg-52e
+
 define Device/globalscale_mirabox
   $(Device/NAND-512K)
   DEVICE_VENDOR := Globalscale




More information about the lede-commits mailing list