ath79: add support for 8devices Rambutan board
authorAndrey Bondar <a.bondar@8devices.com>
Fri, 26 Jun 2020 08:16:00 +0000 (11:16 +0300)
committerPetr Štetiar <ynezz@true.cz>
Tue, 7 Jul 2020 17:47:24 +0000 (19:47 +0200)
Rambutan is a Wifi module based on QCA9550/9557
http://www.8devices.com/products/rambutan

Specification:

- 720/600/200 MHz (CPU/DDR/AHB)
- 128 MB of DDR2 RAM
- 128 MB of NAND Flash
- 1x 100Mbps Ethernet
- 1x 1000Mbps Ethernet (PHY on dev-kit)
- 1x Wifi radio 2x2 MIMO, dualband 2.4 and 5 GHz
- 2x U.FL connectors on module, chip antennas on dev-kit
- 1x miniPCIe slot
- 2x USB2.0 host
- 2x UART
- SPI, I2C, GPIO

Flash instructions:

Upgrade from ar71xx target:
 sysupgrade -F /tmp/openwrt-ath79-nand-8dev_rambutan-squashfs-sysupgrade.tar
or upgrade from GUI (don't save config)

Use factory image to flash from U-Boot:
 tftpboot 80060000 openwrt-ath79-nand-8dev_rambutan-squashfs-factory.ubi
 nand erase.part ubi
 nand write 80060000 ubi ${filesize}

Signed-off-by: Petr Štetiar <ynezz@true.cz> [copy&pasted missing commit description]
Signed-off-by: Andrey Bondar <a.bondar@8devices.com>
target/linux/ath79/config-4.19
target/linux/ath79/config-5.4
target/linux/ath79/dts/qca9557_8dev_rambutan.dts [new file with mode: 0644]
target/linux/ath79/image/nand.mk
target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom

index 92af6ba970f7ec5de92d8b4a315ba16c99512aac..c1b15301efab3faaefd53a6ce54a25a41ffc0cb3 100644 (file)
@@ -18,6 +18,7 @@ CONFIG_ARCH_USE_BUILTIN_BSWAP=y
 CONFIG_ARCH_USE_QUEUED_RWLOCKS=y
 CONFIG_ARCH_USE_QUEUED_SPINLOCKS=y
 CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
+CONFIG_AT803X_PHY=y
 CONFIG_ATH79=y
 CONFIG_ATH79_WDT=y
 CONFIG_BLK_MQ_PCI=y
index 449f42bba75c43df7686d001f3d8c08163cd7f12..f0679933ae1545a5b45e8541b82056f6a31e14b5 100644 (file)
@@ -23,6 +23,7 @@ CONFIG_ARCH_USE_QUEUED_RWLOCKS=y
 CONFIG_ARCH_USE_QUEUED_SPINLOCKS=y
 CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT=y
 CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
+CONFIG_AT803X_PHY=y
 CONFIG_ATH79=y
 CONFIG_ATH79_WDT=y
 CONFIG_BLK_MQ_PCI=y
diff --git a/target/linux/ath79/dts/qca9557_8dev_rambutan.dts b/target/linux/ath79/dts/qca9557_8dev_rambutan.dts
new file mode 100644 (file)
index 0000000..cf1c00c
--- /dev/null
@@ -0,0 +1,131 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/dts-v1/;
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+#include "qca955x.dtsi"
+
+/ {
+       compatible = "8dev,rambutan", "qca,qca9557";
+       model = "8devices Rambutan";
+
+       keys {
+               compatible = "gpio-keys";
+
+               reset {
+                       label = "reset";
+                       gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_RESTART>;
+                       debounce-interval = <60>;
+               };
+       };
+};
+
+&nand {
+       status = "okay";
+
+       partitions {
+               compatible = "fixed-partitions";
+
+               #address-cells = <1>;
+               #size-cells = <1>;
+
+               partition@0 {
+                       label = "u-boot";
+                       reg = <0x0 0x300000>;
+                       read-only;
+               };
+
+               partition@300000 {
+                       label = "u-boot-env";
+                       reg = <0x300000 0x200000>;
+               };
+
+               art: partition@500000 {
+                       label = "art";
+                       reg = <0x500000 0x100000>;
+                       read-only;
+               };
+
+               partition@600000 {
+                       label = "ubi";
+                       reg = <0x600000 0x7a00000>;
+               };
+       };
+};
+
+&mdio0 {
+       status = "okay";
+
+       phy0: ethernet-phy@0 {
+               reg = <0>;
+               reset-gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
+       };
+};
+
+&mdio1 {
+       status = "okay";
+
+       phy1: ethernet-phy@0 {
+               reg = <0>;
+               reset-gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
+               phy-mode = "sgmii";
+               at803x-override-sgmii-link-check;
+       };
+};
+
+&eth0 {
+       status = "okay";
+
+       mtd-mac-address = <&art 0x0>;
+       phy-mode = "mii";
+       phy-handle = <&phy0>;
+};
+
+&eth1 {
+       status = "okay";
+
+       pll-data = <0x17000000 0x101 0x1313>;
+       phy-handle = <&phy1>;
+       phy-mode = "sgmii";
+       qca955x-sgmii-fixup;
+       mtd-mac-address = <&art 0x6>;
+};
+
+&wmac {
+       status = "okay";
+
+       gpio-controller;
+       mtd-cal-data = <&art 0x1000>;
+};
+
+&pcie0 {
+       status = "okay";
+};
+
+&usb_phy0 {
+       status = "okay";
+};
+
+&usb0 {
+       status = "okay";
+
+       #address-cells = <1>;
+       #size-cells = <0>;
+};
+
+&usb_phy1 {
+       status = "okay";
+};
+
+&usb1 {
+       status = "okay";
+
+       #address-cells = <1>;
+       #size-cells = <0>;
+};
+
+&uart {
+       status = "okay";
+};
index dc06b65371423f89107c596c9f6ae94357959855..240d96729b11c0d8fe9522a184208a691ff5d10c 100644 (file)
@@ -30,6 +30,21 @@ define Build/zyxel-factory
                fi
 endef
 
+define Device/8dev_rambutan
+  SOC := qca9557
+  DEVICE_VENDOR := 8devices
+  DEVICE_MODEL := Rambutan
+  DEVICE_PACKAGES := kmod-usb2
+  BLOCKSIZE := 128k
+  PAGESIZE := 2048
+  KERNEL_SIZE := 4096k
+  KERNEL_IN_UBI := 1
+  IMAGES := factory.bin sysupgrade.tar
+  IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata
+  IMAGE/factory.bin := append-ubi
+endef
+TARGET_DEVICES += 8dev_rambutan
+
 define Device/aerohive_hiveap-121
   SOC := ar9344
   DEVICE_VENDOR := Aerohive
index 355be93ead6dc2baf3f69d8953c7683b76544170..60defa5f8b88f1adef7684311a4616cadc5e1b22 100644 (file)
@@ -9,6 +9,9 @@ board=$(board_name)
 case "$FIRMWARE" in
 "ath9k-eeprom-ahb-18100000.wmac.bin")
        case $board in
+       8dev,rambutan)
+               caldata_extract "caldata" 0x1000 0x800
+               ;;
        netgear,wndr3700-v4|\
        netgear,wndr4300|\
        netgear,wndr4300sw|\