ipq806x: add Support for ASRock G10
authorChristian Lamparter <chunkeey@gmail.com>
Fri, 11 Oct 2019 22:49:15 +0000 (00:49 +0200)
committerChristian Lamparter <chunkeey@gmail.com>
Tue, 9 Jun 2020 22:33:33 +0000 (00:33 +0200)
The ASRock G10 is a 2.4/5 GHz band 11ac "Gaming" router,
based on Qualcomm IPQ8064.

Specifications:

SoC: Qualcomm IPQ8064
CPU: Dual-Core A15 @ (384 - 1,400 MHz, 2C2T)
DRAM: 512 MiB (~467 MiB available)
NAND: 128 MB (Micron MT29F1G08ABBEAH4)
WLAN0: 4T4R 5 GHz Wlan (QCA9980)
WLAN1: 4T4R 2.4 GHz Wlan (QCA9980)
ETH:    5x 10/100/1000 Mbps Ethernet (QCA8337)
INPUT:  Reset Button, WPS 2.4G and WPS 5G Button
LEDS:   1 mulicolor status LED
USB:    2x USB 3.0 Type-A
POWER:  12VDC/3A AC Adapter + dedicated Power Switch
UART:   Setting is 115200-8-N-1. 1x4 .1" unpopulated header
on the PCB (J6 - very tiny silkscreen next to TX).
        Pinout: 1. 3v3 (Square - best skipped!), 2. RX, 3. GND, 4. TX

WARNING: The serial port needs a TTL/RS-232 3.3v level converter!
 (Depending on the serial adapter RX and TX might need to
  be swappped).

Note about the IR-Remote:
There's a 8-Bit MCU (SONIX SN8F25E21SG) which is controlling the
IR-Remote and is fed by the IR-Photodiode. The SoC can talk to
the device via I2C. The vendor's GPL archive comes with the source
of the inteface driver for this as a (character driver), the main
control software is however a blob.

Installation Instructions:
This requires a TFTP-Server and disassembly of the G10 Router and
some soldering to gain access to the serial/UART which is needed
for booting and flashing (as well as debricking or reverting back
to stock).

 0. Power off the router and disconnect it.
 1. Open up the case
    Remove the phillips screws hidden behind each of the two
    rubber feet on the bottom of the device. They are located on
    the opposite side of the sticker on the bottom.

    Next, remove the HDMI-Dongle from its slot and remove the
    third and last phillips screw inside the HDMI-Dongle compartment.

    Then use a slim, preferably dull kitchen knife to pry apart the
    two plastic clips at the top (Tip: You can see these clips from
    inside the HDMI-Dongle compartment. The big LED lightpipe on
    the top makes for an excellent entry point, be careful though to
    not stab through. The PCB with the LEDs is directly beneath.

    Once the plastic clips are loose, you can apply your "force"
    and pry open up the remaining clips (they are sturdy).

 2. Solder/Connect the UART
    Any common USB<->UART converter with RX,GND and TX will do.
    See Warning above. Don't connect a straight RS232 or 5V one!
    This can kill your SoC and/or the power-rail of the board.

 3. Connect G10 via Ethernet-cable to your network and prepare your PC
    Download the initramfs image and rename it to g10.bin
    Setup a TFTP-Server on your PC (listening on 192.168.1.2) and
    place the g10.bin into the TFTP server's root directory.

 4. Start the G10 by toggling the power button and enter UBoot Prompt

    Watch the bootlog and hit a key once it says "Hit any key to stop autoboot:"

 5. Prepare UBoot environment for OpenWrt image

    Enter the following into the (IPQ)# shell

    # setenv mtdids nand0=nand0
    # setenv mtdparts mtdparts=nand0:48m@0x1340000(ubi)
    # setenv bootargs console=ttyMSM0,115200n8
    # setenv loadkernel 'ubi read 44000000 kernel && bootm'
    # setenv bootmain 'ubi part ubi && run loadkernel'
    # setenv bootwrt 'run bootmain || dhcp'
    # setenv bootcmd 'run bootwrt'
    # saveenv

    The 'saveenv' will commit the changes to the flash (permanently).

    If there's a need to revert back to the stock firmware,
    these changes will make them work again:

    # setenv bootargs console=ttyHSL1,115200n8
    # setenv bootcmd bootipq
    # saveenv

 6. Boot the temporary ramdisk image

    # setenv ipaddr 192.168.1.1
    # setenv serverip 192.168.1.2
    # tftpboot 44000000 g10.bin
    # bootm

 7. Wait for your router's status LED to stop blinking rapidly
    and just glow a steady green.

 8. Connect via your PC to the OpenWrt running in RAM

    The default IPv4-Address of your router will be 192.168.1.1.
    Download the G10's sysupgrade.bin and rename it to
    openwrt-sysupgrade.bin which then you need to copy to your
    router's temporary directory (/tmp)

    # scp openwrt-sysupgrade.bin root@192.168.1.1:/tmp

    use ssh from your PC into your router as root.

    # ssh root@192.168.1.1

    Now is the last time you can make a backup of the original
    "kernel", "ubi_rootfs" and "ubi_rootfs_data" volumes and
    copy them over to your PC.

    to do the final install do:

    # sysupgade -v openwrt-sysupgrade.bin

    - This will will automatically reboot the router -

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
package/firmware/ipq-wifi/Makefile
package/firmware/ipq-wifi/board-asrock_g10.qca9980.bin [new file with mode: 0644]
target/linux/ipq806x/base-files/etc/board.d/02_network
target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
target/linux/ipq806x/base-files/lib/preinit/05_set_iface_mac_ipq806x.sh [new file with mode: 0644]
target/linux/ipq806x/base-files/lib/upgrade/asrock.sh [new file with mode: 0644]
target/linux/ipq806x/base-files/lib/upgrade/platform.sh
target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-g10.dts [new file with mode: 0644]
target/linux/ipq806x/image/Makefile
target/linux/ipq806x/patches-4.19/0069-arm-boot-add-dts-files.patch

index c86645e253637629b0d3abe4f2b7cee671d5325f..bda5775bffb1ee122b70a117db6af581b15e64d6 100644 (file)
@@ -27,6 +27,7 @@ endef
 ALLWIFIBOARDS:= \
        8dev_habanero-dvk \
        aruba_ap-303 \
+       asrock_g10 \
        avm_fritzrepeater-1200 \
        cellc_rtl30vw \
        dlink_dap2610 \
@@ -44,7 +45,7 @@ define Package/ipq-wifi-default
   SUBMENU:=ath10k Board-Specific Overrides
   SECTION:=firmware
   CATEGORY:=Firmware
-  DEPENDS:=@TARGET_ipq40xx
+  DEPENDS:=@(TARGET_ipq40xx||TARGET_ipq806x)
   TITLE:=Custom Board
 endef
 
@@ -58,10 +59,12 @@ define ipq-wifi-install-one
     $(call ipq-wifi-install-one-to,$(1),$(2),QCA4019/hw1.0),\
   $(if $(filter $(suffix $(1)),.QCA9888 .qca9888),\
     $(call ipq-wifi-install-one-to,$(1),$(2),QCA9888/hw2.0),\
+  $(if $(filter $(suffix $(1)),.QCA9980 .qca9980),\
+    $(call ipq-wifi-install-one-to,$(1),$(2),QCA9980/hw2.0),\
   $(if $(filter $(suffix $(1)),.QCA9984 .qca9984),\
     $(call ipq-wifi-install-one-to,$(1),$(2),QCA9984/hw1.0),\
     $(error Unrecognized board-file suffix '$(suffix $(1))' for '$(1)')\
-  )))
+  ))))
 
 endef
 # Blank line required at end of above define due to foreach context
@@ -99,6 +102,7 @@ endef
 
 $(eval $(call generate-ipq-wifi-package,8dev_habanero-dvk,8devices Habanero DVK))
 $(eval $(call generate-ipq-wifi-package,aruba_ap-303,Aruba AP-303))
+$(eval $(call generate-ipq-wifi-package,asrock_g10,ASRock G10))
 $(eval $(call generate-ipq-wifi-package,avm_fritzrepeater-1200,AVM FRITZRepeater 1200))
 $(eval $(call generate-ipq-wifi-package,cellc_rtl30vw, Cell C RTL30VW))
 $(eval $(call generate-ipq-wifi-package,dlink_dap2610,D-Link DAP-2610))
diff --git a/package/firmware/ipq-wifi/board-asrock_g10.qca9980.bin b/package/firmware/ipq-wifi/board-asrock_g10.qca9980.bin
new file mode 100644 (file)
index 0000000..606fef7
Binary files /dev/null and b/package/firmware/ipq-wifi/board-asrock_g10.qca9980.bin differ
index a2fffd1e5aea2a50b0f6b40edd8ab41282f8c15a..c100b2e28ad1e88d492f7bc6851f62db9e55e58c 100755 (executable)
@@ -12,6 +12,11 @@ board_config_update
 board=$(board_name)
 
 case "$board" in
+asrock,g10 |\
+nec,wg2600hp)
+       ucidef_add_switch "switch0" \
+               "2:lan" "3:lan" "4:lan" "5:lan" "6@eth1" "1:wan" "0@eth0"
+       ;;
 buffalo,wxr-2533dhp |\
 compex,wpq864 |\
 netgear,d7800 |\
@@ -34,10 +39,6 @@ linksys,ea8500)
        ucidef_set_interface_macaddr "lan" "$hw_mac_addr"
        ucidef_set_interface_macaddr "wan" "$hw_mac_addr"
        ;;
-nec,wg2600hp)
-       ucidef_add_switch "switch0" \
-               "2:lan" "3:lan" "4:lan" "5:lan" "6@eth1" "1:wan" "0@eth0"
-       ;;
 netgear,r7800 |\
 tplink,c2600)
        ucidef_add_switch "switch0" \
index bb505d642fee300f5c1cab40df9919d7a453345c..ff393728ca4e9c882c958d65ce56f93048ab15f8 100644 (file)
@@ -9,6 +9,9 @@ board=$(board_name)
 case "$FIRMWARE" in
 "ath10k/pre-cal-pci-0000:01:00.0.bin")
        case $board in
+       asrock,g10)
+               ath10kcal_extract "ART" 0x1000 0x2f20
+               ;;
        buffalo,wxr-2533dhp)
                caldata_extract "ART" 0x1000 0x2f20
                ath10k_patch_mac $(mtd_get_mac_binary ART 0x1e)
@@ -43,6 +46,9 @@ case "$FIRMWARE" in
        ;;
 "ath10k/pre-cal-pci-0001:01:00.0.bin")
        case $board in
+       asrock,g10)
+               ath10kcal_extract "ART" 0x5000 0x2f20
+               ;;
        buffalo,wxr-2533dhp)
                caldata_extract "ART" 0x5000 0x2f20
                ath10k_patch_mac $(mtd_get_mac_binary ART 0x18)
diff --git a/target/linux/ipq806x/base-files/lib/preinit/05_set_iface_mac_ipq806x.sh b/target/linux/ipq806x/base-files/lib/preinit/05_set_iface_mac_ipq806x.sh
new file mode 100644 (file)
index 0000000..621e783
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+. /lib/functions.sh
+
+preinit_set_mac_address() {
+       case $(board_name) in
+       asrock,g10)
+               lan_mac=$(mtd_get_mac_ascii hwconfig HW.LAN.MAC.Address)
+               wan_mac=$(mtd_get_mac_ascii hwconfig HW.WAN.MAC.Address)
+               ip link set dev eth0 address "${lan_mac}"
+               ip link set dev eth1 address "${wan_mac}"
+               ;;
+       esac
+}
+
+boot_hook_add preinit_main preinit_set_mac_address
diff --git a/target/linux/ipq806x/base-files/lib/upgrade/asrock.sh b/target/linux/ipq806x/base-files/lib/upgrade/asrock.sh
new file mode 100644 (file)
index 0000000..11abcad
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+. /lib/functions.sh
+
+# It seems like ASRock tried to implement a failover firmware
+# but the partitions are empty. Otherwise we could just share
+# this portion with the buffalo.sh script.
+
+asrock_upgrade_prepare_ubi() {
+       local ubidev="$( nand_find_ubi ubi )"
+
+       # Just delete these partitions if present and use
+       # OpenWrt's standard names for those.
+       ubirmvol /dev/$ubidev -N ubi_rootfs &> /dev/null || true
+       ubirmvol /dev/$ubidev -N ubi_rootfs_data &> /dev/null || true
+}
index 2be25f4a9c9d5a03f1a99d7a461a0a674eab4aea..113d775c06a88591d24f0ff249d3258fcfef6cc6 100644 (file)
@@ -10,6 +10,10 @@ platform_check_image() {
 
 platform_do_upgrade() {
        case "$(board_name)" in
+       asrock,g10)
+               asrock_upgrade_prepare_ubi
+               nand_do_upgrade "$1"
+               ;;
        buffalo,wxr-2533dhp)
                buffalo_upgrade_prepare_ubi
                CI_ROOTPART="ubi_rootfs"
diff --git a/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-g10.dts b/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-g10.dts
new file mode 100644 (file)
index 0000000..beefeb4
--- /dev/null
@@ -0,0 +1,468 @@
+// SPDX-License-Identifier: GPL-2.0
+#include "qcom-ipq8064-v1.0.dtsi"
+
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/soc/qcom,tcsr.h>
+
+/ {
+       compatible = "asrock,g10", "qcom,ipq8064";
+       model = "ASRock G10";
+
+       aliases {
+               mdio-gpio0 = &mdio0;
+               serial0 = &gsbi4_serial;
+               ethernet0 = &gmac1;
+               ethernet1 = &gmac0;
+
+               led-boot = &led_blue;
+               led-failsafe = &led_fail;
+               led-running = &led_blue;
+               led-upgrade = &led_blue;
+       };
+
+       reserved-memory {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges;
+
+               rsvd@41200000 {
+                       reg = <0x41200000 0x300000>;
+                       no-map;
+               };
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       soc {
+               rpm@108000 {
+                       pinctrl-0 = <&rpm_pins>;
+                       pinctrl-names = "default";
+               };
+
+               nand@1ac00000 {
+                       status = "okay";
+
+                       pinctrl-0 = <&nand_pins>;
+                       pinctrl-names = "default";
+
+                       nand0@0 {
+                               compatible = "qcom,nandcs";
+
+                               reg = <0>;
+
+                               nand-ecc-strength = <4>;
+                               nand-bus-width = <8>;
+                               nand-ecc-step-size = <512>;
+
+                               partitions {
+                                       compatible = "fixed-partitions";
+                                       #address-cells = <1>;
+                                       #size-cells = <1>;
+
+                                       partition@0 {
+                                               label = "SBL1";
+                                               reg = <0x0000000 0x0040000>;
+                                               read-only;
+                                       };
+
+                                       partition@40000 {
+                                               label = "MIBIB";
+                                               reg = <0x0040000 0x0140000>;
+                                               read-only;
+                                       };
+
+                                       partition@180000 {
+                                               label = "SBL2";
+                                               reg = <0x0180000 0x0140000>;
+                                               read-only;
+                                       };
+
+                                       partition@2c0000 {
+                                               label = "SBL3";
+                                               reg = <0x02c0000 0x0280000>;
+                                               read-only;
+                                       };
+
+                                       partition@540000 {
+                                               label = "DDRCONFIG";
+                                               reg = <0x0540000 0x0120000>;
+                                               read-only;
+                                       };
+
+                                       partition@660000 {
+                                               label = "SSD";
+                                               reg = <0x0660000 0x0120000>;
+                                               read-only;
+                                       };
+
+                                       partition@780000 {
+                                               label = "TZ";
+                                               reg = <0x0780000 0x0280000>;
+                                               read-only;
+                                       };
+
+                                       partition@a00000 {
+                                               label = "RPM";
+                                               reg = <0x0a00000 0x0280000>;
+                                               read-only;
+                                       };
+
+                                       partition@c80000 {
+                                               label = "APPSBL";
+                                               reg = <0x0c80000 0x0500000>;
+                                               read-only;
+                                       };
+
+                                       partition@1180000 {
+                                               label = "APPSBLENV";
+                                               reg = <0x1180000 0x0080000>;
+                                               read-only;
+                                       };
+
+                                       partition@1200000 {
+                                               label = "ART";
+                                               reg = <0x1200000 0x0140000>;
+                                               read-only;
+                                       };
+
+                                       partition@1340000 {
+                                               label = "ubi";
+                                               reg = <0x1340000 0x3000000>;
+                                       };
+
+                                       partition@4340000 {
+                                               label = "BOOTCONFIG";
+                                               reg = <0x4340000 0x0060000>;
+                                               read-only;
+                                       };
+
+                                       partition@43a0000 {
+                                               label = "APPSBL1";
+                                               reg = <0x43a0000 0x0500000>;
+                                               read-only;
+                                       };
+
+                                       partition@48a0000 {
+                                               label = "ubi1";
+                                               reg = <0x48a0000 0x3000000>;
+                                       };
+
+                                       partition@78a0000 {
+                                               label = "hwconfig";
+                                               reg = <0x78a0000 0x0040000>;
+                                               read-only;
+                                       };
+
+                                       partition@7e80000 {
+                                               label = "nvram";
+                                               reg = <0x78e0000 0x0040000>;
+                                               read-only;
+                                       };
+                               };
+                       };
+               };
+       };
+
+       mdio0: mdio {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               compatible = "virtual,mdio-gpio";
+
+               pinctrl-0 = <&mdio0_pins>;
+               pinctrl-names = "default";
+
+               gpios = <&qcom_pinmux 1 GPIO_ACTIVE_HIGH>,
+                       <&qcom_pinmux 0 GPIO_ACTIVE_HIGH>;
+
+               ethernet-phy@0 {
+                       reg = <0>;
+                       qca,ar8327-initvals = <
+                               0x00004 0x7600000   /* PAD0_MODE */
+                               0x00008 0x1000000   /* PAD5_MODE */
+                               0x0000c 0x80        /* PAD6_MODE */
+                               0x000e4 0x6a545     /* MAC_POWER_SEL */
+                               0x000e0 0xc74164de  /* SGMII_CTRL */
+                               0x0007c 0x4e        /* PORT0_STATUS */
+                               0x00094 0x4e        /* PORT6_STATUS */
+                               >;
+               };
+
+               ethernet-phy@4 {
+                       reg = <4>;
+               };
+       };
+
+       leds {
+               compatible = "gpio-leds";
+
+               pinctrl-0 = <&led_pins>;
+               pinctrl-names = "default";
+
+               /*
+                * this is a bit misleading. Because there are about seven
+                * multicolor LEDs connected all wired together in parallel.
+                */
+
+               led_yellow: yellow {
+                       label = "g10:yellow:status";
+                       gpios = <&qcom_pinmux 8 GPIO_ACTIVE_HIGH>;
+               };
+
+               led_fail: fail {
+                       label = "g10:amber:status";
+                       gpios = <&qcom_pinmux 7 GPIO_ACTIVE_HIGH>;
+               };
+
+               led_blue: blue {
+                       label = "g10:blue:status";
+                       gpios = <&qcom_pinmux 9 GPIO_ACTIVE_HIGH>;
+               };
+
+               /*
+                * LED is declared in vendors boardfile but it's not
+                * working and the manual doesn't mention anything
+                * about the LED being white.
+
+               white {
+                       label = "g10:white:status";
+                       gpios = <&qcom_pinmux 26 GPIO_ACTIVE_HIGH>;
+               };
+               */
+       };
+
+       i2c-gpio {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               compatible = "i2c-gpio";
+                gpios = <&qcom_pinmux 53 GPIO_ACTIVE_HIGH>, /* sda */
+                       <&qcom_pinmux 54 GPIO_ACTIVE_HIGH>; /* scl */
+                i2c-gpio,delay-us = <5>;
+               i2c-gpio,scl-output-only;
+
+               mcu@50 {
+                       reg = <0x50>;
+                       compatible = "sonix,sn8f25e21";
+               };
+       };
+
+       keys {
+               compatible = "gpio-keys";
+
+               pinctrl-0 = <&button_pins>;
+               pinctrl-names = "default";
+
+               ir-remote {
+                       label = "ir-remote";
+                       gpios = <&qcom_pinmux 15 GPIO_ACTIVE_LOW>;
+                       linux,code = <BTN_0>;
+               };
+
+               reset {
+                       label = "reset";
+                       gpios = <&qcom_pinmux 16 GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_RESTART>;
+               };
+
+               wps5g {
+                       label = "reset";
+                       gpios = <&qcom_pinmux 64 GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_WPS_BUTTON>;
+               };
+
+               wps2g {
+                       label = "reset";
+                       gpios = <&qcom_pinmux 65 GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_WPS_BUTTON>;
+               };
+       };
+};
+
+&adm_dma {
+       status = "okay";
+};
+
+&gmac1 {
+       status = "okay";
+
+       pinctrl-0 = <&rgmii2_pins>;
+       pinctrl-names = "default";
+
+       phy-mode = "rgmii";
+       qcom,id = <1>;
+
+       fixed-link {
+               speed = <1000>;
+               full-duplex;
+       };
+};
+
+&gmac2 {
+       status = "okay";
+
+       phy-mode = "sgmii";
+       qcom,id = <2>;
+
+       fixed-link {
+               speed = <1000>;
+               full-duplex;
+       };
+};
+
+&gsbi4 {
+       status = "okay";
+       qcom,mode = <GSBI_PROT_I2C_UART>;
+};
+
+&gsbi4_serial {
+       status = "okay";
+
+       pinctrl-0 = <&uart0_pins>;
+       pinctrl-names = "default";
+};
+
+&ss_phy_0 {            /* USB3 port 0 SS phy */
+       rx_eq = <2>;
+       tx_deamp_3_5db = <32>;
+       mpll = <160>;
+};
+
+&ss_phy_1 {            /* USB3 port 1 SS phy */
+       rx_eq = <2>;
+       tx_deamp_3_5db = <32>;
+       mpll = <160>;
+};
+
+&pcie0 {
+       status = "okay";
+
+       bridge@0,0 {
+               reg = <0x00000000 0 0 0 0>;
+               #address-cells = <3>;
+               #size-cells = <2>;
+               ranges;
+
+               wifi5g: wifi@1,0 {
+                       reg = <0x00010000 0 0 0 0>;
+                       compatible = "qcom,ath10k";
+                       qcom,ath10k-calibration-variant = "ASRock-G10";
+               };
+       };
+};
+
+&pcie1 {
+       status = "okay";
+
+       bridge@0,0 {
+               reg = <0x00000000 0 0 0 0>;
+               #address-cells = <3>;
+               #size-cells = <2>;
+               ranges;
+
+               wifi2g: wifi@1,0 {
+                       reg = <0x00010000 0 0 0 0>;
+                       compatible = "qcom,ath10k";
+                       qcom,ath10k-calibration-variant = "ASRock-G10";
+               };
+       };
+};
+
+&qcom_pinmux {
+       led_pins: led_pins {
+               mux {
+                       pins = "gpio7", "gpio8", "gpio9", "gpio26";
+                       function = "gpio";
+                       drive-strength = <2>;
+                       bias-pull-up;
+               };
+       };
+
+       button_pins: button_pins {
+               mux {
+                       pins = "gpio15", "gpio16", "gpio64", "gpio65";
+                       function = "gpio";
+                       drive-strength = <2>;
+                       bias-pull-up;
+               };
+       };
+
+       rpm_pins: rpm_pins {
+               mux {
+                       pins = "gpio12", "gpio13";
+                       function = "gsbi4";
+                       drive-strength = <10>;
+                       bias-disable;
+               };
+       };
+
+       uart0_pins: uart0_pins {
+               mux {
+                       pins = "gpio10", "gpio11";
+                       function = "gsbi4";
+                       drive-strength = <10>;
+                       bias-disable;
+               };
+       };
+
+       nand_pins: nand_pins {
+               mux {
+                       pins = "gpio34", "gpio35", "gpio36", "gpio37",
+                              "gpio38", "gpio39", "gpio40", "gpio41",
+                              "gpio42", "gpio43", "gpio44", "gpio45",
+                              "gpio46", "gpio47";
+                       function = "nand";
+                       drive-strength = <10>;
+                       bias-disable;
+               };
+
+               pullups {
+                       pins = "gpio39";
+                       bias-pull-up;
+               };
+
+               hold {
+                       pins = "gpio40", "gpio41", "gpio42", "gpio43",
+                              "gpio44", "gpio45", "gpio46", "gpio47";
+                       bias-bus-hold;
+               };
+       };
+
+       mdio0_pins: mdio0_pins {
+               mux {
+                       pins = "gpio0", "gpio1";
+                       function = "gpio";
+                       drive-strength = <8>;
+                       bias-disable;
+               };
+       };
+
+       rgmii2_pins: rgmii2_pins {
+               mux {
+                       pins = "gpio27", "gpio28", "gpio29", "gpio30",
+                              "gpio31", "gpio32", "gpio51", "gpio52",
+                              "gpio59", "gpio60", "gpio61", "gpio62";
+                       function = "rgmii2";
+                       drive-strength = <8>;
+                       bias-disable;
+               };
+       };
+};
+
+&usb3_0 {
+       status = "okay";
+};
+
+
+&usb3_1 {
+       status = "okay";
+};
+
+&tcsr {
+       qcom,usb-ctrl-select = <TCSR_USB_SELECT_USB3_DUAL>;
+};
+
+/delete-node/ &pcie2_pins;
+/delete-node/ &pcie2;
index 6ea66d064dbfe96ad36ac31089db6652ac697aa0..e32543692faa347c292ce1bc4ee32406bf90501e 100644 (file)
@@ -81,6 +81,20 @@ define Device/ZyXELImage
        IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-to $$$$(BLOCKSIZE) | sysupgrade-tar rootfs=$$$$@ | append-metadata
 endef
 
+define Device/asrock_g10
+       $(call Device/FitImage)
+       $(call Device/UbiFit)
+       DEVICE_VENDOR := ASRock
+       DEVICE_MODEL := G10
+       BLOCKSIZE := 128k
+       PAGESIZE := 2048
+       DEVICE_DTS := qcom-ipq8064-g10
+       DEVICE_PACKAGES := kmod-i2c-core kmod-i2c-gpio kmod-hwmon-lm75 \
+                          ath10k-firmware-qca99x0-ct ipq-wifi-asrock_g10
+       IMAGES := sysupgrade.bin
+endef
+TARGET_DEVICES += asrock_g10
+
 define Device/buffalo_wxr-2533dhp
        $(call Device/LegacyImage)
        SOC := qcom-ipq8064
index 77ce4c424519c399888589d7548fbc43cbe94a20..bfa1c9ac81bd12af95a94ed49349412d71b03f8f 100644 (file)
@@ -10,7 +10,7 @@ Signed-off-by: John Crispin <john@phrozen.org>
 
 --- a/arch/arm/boot/dts/Makefile
 +++ b/arch/arm/boot/dts/Makefile
-@@ -791,6 +791,18 @@ dtb-$(CONFIG_ARCH_QCOM) += \
+@@ -791,6 +791,19 @@ dtb-$(CONFIG_ARCH_QCOM) += \
        qcom-ipq4019-ap.dk07.1-c1.dtb \
        qcom-ipq4019-ap.dk07.1-c2.dtb \
        qcom-ipq8064-ap148.dtb \
@@ -19,6 +19,7 @@ Signed-off-by: John Crispin <john@phrozen.org>
 +      qcom-ipq8064-db149.dtb \
 +      qcom-ipq8064-ap161.dtb \
 +      qcom-ipq8064-ea8500.dtb \
++      qcom-ipq8064-g10.dtb \
 +      qcom-ipq8064-r7500.dtb \
 +      qcom-ipq8064-r7500v2.dtb \
 +      qcom-ipq8064-wg2600hp.dtb \