--- /dev/null
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "ar9344.dtsi"
+#include "ar934x_fortinet_loader.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+ aliases {
+ led-boot = &led_power;
+ led-failsafe = &led_power;
+ led-running = &led_power;
+ led-upgrade = &led_power;
+ };
+
+ chosen {
+ bootargs = "console=ttyS0,9600";
+ };
+
+ keys {
+ compatible = "gpio-keys";
+
+ reset {
+ label = "reset";
+ gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
+ debounce-interval = <60>;
+ linux,code = <KEY_RESTART>;
+ };
+ };
+};
+
+&ref {
+ clock-frequency = <25000000>;
+};
+
+&mdio0 {
+ status = "okay";
+
+ phy0: ethernet-phy@0 {
+ reg = <0>;
+ eee-broken-100tx;
+ eee-broken-1000t;
+ };
+};
+
+ð0 {
+ status = "okay";
+
+ phy-handle = <&phy0>;
+ phy-mode = "rgmii-txid";
+
+ pll-data = <0x02000000 0x00000101 0x00001313>;
+};
+
+&pcie {
+ status = "okay";
+
+ ath9k: wifi@0,0,0 {
+ compatible = "pci168c,0030";
+ reg = <0x0 0 0 0 0>;
+ };
+};
+
+&wmac {
+ status = "okay";
+};
--- /dev/null
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "ar9344_fortinet_ap-dual.dtsi"
+
+/ {
+ compatible = "fortinet,fap-221-b", "qca,ar9344";
+ model = "Fortinet FAP-221-B";
+
+ leds {
+ compatible = "gpio-leds";
+
+ led_power: power_green {
+ label = "green:power";
+ gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
+ default-state = "on";
+ };
+
+ power_amber {
+ label = "amber:power";
+ gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
+ };
+
+ eth_green {
+ label = "green:eth";
+ gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
+ };
+
+ eth_amber {
+ label = "amber:eth";
+ gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
+ };
+
+ wifi5g {
+ label = "green:wifi5g";
+ gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
+ linux,default-trigger = "phy0tpt";
+ };
+
+ wifi2g {
+ label = "amber:wifi2g";
+ gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
+ linux,default-trigger = "phy1tpt";
+ };
+ };
+
+ virtual_flash {
+ devices = <&fwconcat0 &fwconcat1 &fwconcat2>;
+ };
+};
+
+&ath9k {
+ ieee80211-freq-limit = <2402000 2482000>;
+
+ nvmem-cells = <&calibration_pcie>;
+ nvmem-cell-names = "calibration";
+};
+
+&wmac {
+ ieee80211-freq-limit = <2402000 2482000 4900000 5990000>;
+
+ nvmem-cells = <&calibration_wmac>;
+ nvmem-cell-names = "calibration";
+};
+
+&art {
+ compatible = "nvmem-cells";
+
+ calibration_wmac: calibration@1000 {
+ reg = <0x1000 0x440>;
+ };
+
+ calibration_pcie: calibration@5000 {
+ reg = <0x5000 0x440>;
+ };
+};
--- /dev/null
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include <dt-bindings/mtd/partitions/uimage.h>
+
+/ {
+ virtual_flash {
+ compatible = "mtd-concat";
+
+ devices = <&fwconcat0 &fwconcat1>;
+
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ partition@0 {
+ compatible = "openwrt,uimage", "denx,uimage";
+ openwrt,ih-magic = <0x73714f4b>;
+ label = "firmware";
+ reg = <0x0 0x0>;
+ };
+ };
+ };
+};
+
+&spi {
+ status = "okay";
+
+ flash@0 {
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ spi-max-frequency = <40000000>;
+
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x000000 0x040000>;
+ read-only;
+ };
+
+ fwconcat0: partition@40000 {
+ label = "fwconcat0";
+ reg = <0x040000 0x900000>;
+ };
+
+ partition@940000 {
+ label = "loader";
+ reg = <0x940000 0x010000>;
+ };
+
+ fwconcat1: partition@950000 {
+ label = "fwconcat1";
+ reg = <0x950000 0x1a0000>;
+ };
+
+ fwconcat2: partition@af0000 {
+ label = "reserved";
+ reg = <0xaf0000 0x500000>;
+ };
+
+ art: partition@ff0000 {
+ label = "art";
+ reg = <0xff0000 0x010000>;
+ read-only;
+ };
+ };
+ };
+};
engenius,ecb600|\
enterasys,ws-ap3705i|\
extreme-networks,ws-ap3805i|\
+ fortinet,fap-221-b|\
glinet,gl-ar300m-lite|\
glinet,gl-usb150|\
hak5,wifi-pineapple-nano|\
enterasys,ws-ap3705i)
label_mac=$(mtd_get_mac_ascii u-boot-env0 ethaddr)
;;
+ fortinet,fap-221-b)
+ lan_mac=$(mtd_get_mac_text u-boot 0x3ff80 12)
+ label_mac=$lan_mac
+ ;;
hak5,lan-turtle|\
hak5,packet-squirrel)
label_mac=$(mtd_get_mac_binary u-boot 0x1fc00)
[ "$PHYNBR" -eq 1 ] && \
mtd_get_mac_ascii bdcfg "wlanmac" > /sys${DEVPATH}/macaddress
;;
+ fortinet,fap-221-b)
+ macaddr_add "$(mtd_get_mac_text u-boot 0x3ff80 12)" $((PHYNBR*7+1)) > /sys${DEVPATH}/macaddress
+ ;;
iodata,wn-ac1600dgr)
# There is no eeprom data for 5 GHz wlan in "art" partition
# which would allow to patch the macaddress
siemens,ws-ap3610)
ip link set dev eth0 address $(mtd_get_mac_ascii cfg1 ethaddr)
;;
+ fortinet,fap-221-b)
+ ip link set dev eth0 address $(mtd_get_mac_text u-boot 0x3ff80 12)
+ ;;
tplink,deco-s4-v2)
base_mac=$(mtd_get_mac_encrypted_deco $(find_mtd_part config))
ip link set dev eth0 address $base_mac
ROOTFS_FILE="root.squashfs"
platform_do_upgrade_failsafe_datachk "$1"
;;
+ fortinet,fap-221-b)
+ SKIP_HASH="1"
+ ENV_SCRIPT="/dev/null"
+ IMAGE_LIST="tar tzf $1"
+ IMAGE_CMD="tar xzOf $1"
+ KERNEL_PART="loader"
+ ROOTFS_PART="fwconcat0"
+ KERNEL_FILE="uImage-lzma.bin"
+ ROOTFS_FILE="root.squashfs"
+ platform_do_upgrade_failsafe_datachk "$1"
+ ;;
jjplus,ja76pf2)
platform_do_upgrade_redboot_fis "$1" linux
;;
endef
TARGET_DEVICES += extreme-networks_ws-ap3805i
+define Device/fortinet_fap-221-b
+ $(Device/senao_loader_okli)
+ SOC := ar9344
+ DEVICE_VENDOR := Fortinet
+ DEVICE_MODEL := FAP-221-B
+ FACTORY_IMG_NAME := FP221B-9.99-AP-build999-999999-patch99
+ IMAGE_SIZE := 9216k
+ LOADER_FLASH_OFFS := 0x040000
+ IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \
+ append-rootfs | pad-rootfs | \
+ check-size | pad-to $$$$(IMAGE_SIZE) | \
+ append-loader-okli-uimage $(1) | pad-to 10944k | \
+ gzip-filename $$$$(FACTORY_IMG_NAME)
+endef
+TARGET_DEVICES += fortinet_fap-221-b
+
define Device/glinet_6408
$(Device/tplink-8mlzma)
SOC := ar9331