<p dir="ltr">Will do. Awesome. </p>
<div class="gmail_quote">On 29 Apr 2016 19:30, "John Crispin" <<a href="mailto:john@phrozen.org">john@phrozen.org</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
please drop the mt76 part from the patch it is already merged in the<br>
mt76 tree on github and will hit trunk soon.<br>
<br>
also patch does not apply as shown below.<br>
<br>
        John<br>
<br>
../patchwork 615343<br>
--2016-04-28 09:07:34--  <a href="http://patchwork.ozlabs.org/patch/615343/mbox/" rel="noreferrer" target="_blank">http://patchwork.ozlabs.org/patch/615343/mbox/</a><br>
Resolving <a href="http://patchwork.ozlabs.org" rel="noreferrer" target="_blank">patchwork.ozlabs.org</a> (<a href="http://patchwork.ozlabs.org" rel="noreferrer" target="_blank">patchwork.ozlabs.org</a>)... 103.22.144.67<br>
Connecting to <a href="http://patchwork.ozlabs.org" rel="noreferrer" target="_blank">patchwork.ozlabs.org</a><br>
(<a href="http://patchwork.ozlabs.org" rel="noreferrer" target="_blank">patchwork.ozlabs.org</a>)|103.22.144.67|:80... connected.<br>
HTTP request sent, awaiting response... 200 OK<br>
Length: unspecified [text/plain]<br>
Saving to: `615343.patch'<br>
<br>
    [  <=><br>
            ] 14,542      31.0K/s   in 0.5s<br>
<br>
2016-04-28 09:07:36 (31.0 KB/s) - `615343.patch' saved [14542]<br>
<br>
Applying: ramips: Add support for SamKnows Whitebox 8<br>
fatal: corrupt patch at line 22<br>
Repository lacks necessary blobs to fall back on 3-way merge.<br>
Cannot fall back to three-way merge.<br>
Patch failed at 0001 ramips: Add support for SamKnows Whitebox 8<br>
When you have resolved this problem run "git am --resolved".<br>
If you would prefer to skip this patch, instead run "git am --skip".<br>
To restore the original branch and stop patching run "git am --abort".<br>
applying 615343 FAILED<br>
<br>
<br>
<br>
<br>
On 26/04/2016 23:47, Andrew Yong wrote:<br>
> PATCHv1:<br>
> This patch adds support for the SamKnows version 8.0 Whitebox, built<br>
> around the MT7621 platform. 2.4GHz appears to be working, albeit<br>
> poorly; 5GHz not working yet.<br>
><br>
> PATCHv2:<br>
> - Fixed LED name in DTS.<br>
><br>
> PATCHv3:<br>
>  DTS: Syntax error fixed, LEDs and buttons mapped correctly now<br>
> - diag.sh updated to blink WPS LED on boot<br>
> - 2.4GHz wifi is working but txpower is stuck at 0, DTS ROM offset<br>
> matches SamKnows firmware<br>
> - 5GHz wifi not working, DTS pcie1,0 matches SamKnows firmware<br>
><br>
> PATCHv4:<br>
> - I didn't commit some fixes in PATCHv3, that's fixed now<br>
><br>
> PATCHv5:<br>
> - Added preinit hook to reset SamKnows Whitebox 8 u-boot boot counter<br>
> to prevent soft brick by booting into nonexistent backup partition<br>
> - Broke 2.4GHz WiFi but 5GHz sorta works (swapped pcie0/1 in DTS,<br>
> needs further investigation, effective txpower is still 0)<br>
> - Experimenting on wifi but that'll be a future patch, board boots fine now.<br>
><br>
> PATCHv6:<br>
> - Used init script to reset bootcount, preinit is too early to use fw-setenv<br>
><br>
> PATCHv7:<br>
> - Added model to sysupgrade. Tested thoroughly in general and I'm happy with this. Sorry for the many revisions.<br>
><br>
> PATCHv8:<br>
> - Added SamKnows recovery partition to partition table, in case someone specifically wants to send their bootloader to it<br>
> - Fixed Wi-Fi by patching MT7602EN device ID (shows up as 7612) into mt76 kernel module (verified that signal strength on both bands is good, tested AP and STA modes<br>
><br>
> PATCHv9:<br>
> - Fixed LAN MAC address EEPROM offset<br>
> - Fixed mt76 patch whitespace issues<br>
> - Renamed mt76 patch to mt7602en to accurately reflect the physical chip it's supporting<br>
><br>
> Author: Andrew Yong <<a href="mailto:me@ndoo.sg">me@ndoo.sg</a>><br>
> Date:   Wed Apr 27 05:40:26 2016 +0800<br>
><br>
>     Initial support for SamKnows Whitebox 8<br>
><br>
>     Signed-off-by: Andrew Yong <<a href="mailto:me@ndoo.sg">me@ndoo.sg</a>><br>
><br>
> diff --git a/000-mt7602en.patch b/000-mt7602en.patch<br>
> new file mode 100644<br>
> index 0000000..e357bbb<br>
> --- /dev/null<br>
> +++ b/000-mt7602en.patch<br>
> @@ -0,0 +1,10 @@<br>
> +--- a/mt76x2_pci.c<br>
> ++++ b/mt76x2_pci.c<br>
> +@@ -20,6 +20,7 @@<br>
> +<br>
> + static const struct pci_device_id mt76pci_device_table[] = {<br>
> +       { PCI_DEVICE(0x14c3, 0x7662) },<br>
> ++      { PCI_DEVICE(0x14c3, 0x7612) },<br>
> +       { },<br>
> + };<br>
> +<br>
> diff --git a/package/boot/uboot-envtools/files/ramips b/package/boot/uboot-envtools/files/ramips<br>
> index a759bcc..9ad5974 100644<br>
> --- a/package/boot/uboot-envtools/files/ramips<br>
> +++ b/package/boot/uboot-envtools/files/ramips<br>
> @@ -24,7 +24,8 @@ linkits7688d | \<br>
>  wsr-600 | \<br>
>  wsr-1166 | \<br>
>  br6425 | \<br>
> -miwifi-nano)<br>
> +miwifi-nano | \<br>
> +sk-wb8)<br>
>         ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"<br>
>         ;;<br>
>  esac<br>
> diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds b/target/linux/ramips/base-files/etc/board.d/01_leds<br>
> index aeaab33..a47eacf 100755<br>
> --- a/target/linux/ramips/base-files/etc/board.d/01_leds<br>
> +++ b/target/linux/ramips/base-files/etc/board.d/01_leds<br>
> @@ -243,6 +243,9 @@ rt-n14u)<br>
>         set_wifi_led "$board:blue:air"<br>
>         set_usb_led "$board:blue:usb"<br>
>         ;;<br>
> +sk-wb8)<br>
> +       set_usb_led "$board:green:usb"<br>
> +       ;;<br>
>  tiny-ac)<br>
>         set_wifi_led "$board:orange:wifi"<br>
>         set_usb_led "$board:green:usb"<br>
> diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network<br>
> index c6c740f..4bc1d6e 100755<br>
> --- a/target/linux/ramips/base-files/etc/board.d/02_network<br>
> +++ b/target/linux/ramips/base-files/etc/board.d/02_network<br>
> @@ -77,6 +77,7 @@ ramips_setup_interfaces()<br>
>         pbr-m1|\<br>
>         psg1208|\<br>
>         sap-g3200u3|\<br>
> +       sk-wb8|\<br>
>         wf-2881|\<br>
>         whr-300hp2|\<br>
>         whr-600d|\<br>
> @@ -313,6 +314,9 @@ ramips_setup_macs()<br>
>                 lan_mac=$(macaddr_setbit_la "$lan_mac")<br>
>                 wan_mac=$(mtd_get_mac_binary factory 32772)<br>
>                 ;;<br>
> +       sk-wb8)<br>
> +               wan_mac=$(mtd_get_mac_binary factory 57344)<br>
> +               ;;<br>
>         tew-691gr)<br>
>                 lan_mac=$(cat /sys/class/net/eth0/address)<br>
>                 wan_mac=$(macaddr_add "$lan_mac" 3)<br>
> diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh<br>
> index 20ff8ff..e98226d 100644<br>
> --- a/target/linux/ramips/base-files/etc/diag.sh<br>
> +++ b/target/linux/ramips/base-files/etc/diag.sh<br>
> @@ -78,6 +78,7 @@ get_status_led() {<br>
>                 ;;<br>
>         awapn2403|\<br>
>         dir-645|\<br>
> +       sk-wb8|\<br>
>         wrh-300cr)<br>
>                 status_led="$board:green:wps"<br>
>                 ;;<br>
> diff --git a/target/linux/ramips/base-files/etc/init.d/bootcount b/target/linux/ramips/base-files/etc/init.d/bootcount<br>
> new file mode 100755<br>
> index 0000000..b93e3c9<br>
> --- /dev/null<br>
> +++ b/target/linux/ramips/base-files/etc/init.d/bootcount<br>
> @@ -0,0 +1,11 @@<br>
> +#!/bin/sh /etc/rc.common<br>
> +. /lib/ramips.sh<br>
> +<br>
> +START=99<br>
> +<br>
> +start() {<br>
> +       local board=$(ramips_board_name)<br>
> +       if [ $board = "sk-wb8" ]; then<br>
> +               fw_setenv bootcount 0<br>
> +       fi<br>
> +}<br>
> diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh<br>
> index 2c669c5..f89e52d 100755<br>
> --- a/target/linux/ramips/base-files/lib/ramips.sh<br>
> +++ b/target/linux/ramips/base-files/lib/ramips.sh<br>
> @@ -373,6 +373,9 @@ ramips_board_detect() {<br>
>         *"RUT5XX")<br>
>                 name="rut5xx"<br>
>                 ;;<br>
> +       *"SamKnows Whitebox 8")<br>
> +               name="sk-wb8"<br>
> +               ;;<br>
>         *"SAP-G3200U3")<br>
>                 name="sap-g3200u3"<br>
>                 ;;<br>
> diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh<br>
> index 2b24030..4e5cb07 100755<br>
> --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh<br>
> +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh<br>
> @@ -111,6 +111,7 @@ platform_check_image() {<br>
>         rt-n56u|\<br>
>         rut5xx|\<br>
>         sap-g3200u3|\<br>
> +       sk-wb8|\<br>
>         sl-r7205|\<br>
>         tew-691gr|\<br>
>         tew-692gr|\<br>
> diff --git a/target/linux/ramips/dts/SK-WB8.dts b/target/linux/ramips/dts/SK-WB8.dts<br>
> new file mode 100644<br>
> index 0000000..350cb4a<br>
> --- /dev/null<br>
> +++ b/target/linux/ramips/dts/SK-WB8.dts<br>
> @@ -0,0 +1,127 @@<br>
> +/dts-v1/;<br>
> +<br>
> +#include "mt7621.dtsi"<br>
> +<br>
> +/ {<br>
> +       compatible = "mediatek,mt7621-eval-board", "mediatek,mt7621-soc";<br>
> +       model = "SamKnows Whitebox 8";<br>
> +<br>
> +       memory@0 {<br>
> +               device_type = "memory";<br>
> +               reg = <0x0 0x8000000>;<br>
> +       };<br>
> +<br>
> +       chosen {<br>
> +               bootargs = "console=ttyS0,57600";<br>
> +       };<br>
> +<br>
> +       palmbus@1E000000 {<br>
> +               spi@b00 {<br>
> +                       status = "okay";<br>
> +<br>
> +                       m25p80@0 {<br>
> +                               #address-cells = <1>;<br>
> +                               #size-cells = <1>;<br>
> +                               compatible = "mx25l6405d";<br>
> +                               reg = <0 0>;<br>
> +                               linux,modalias = "m25p80";<br>
> +                               spi-max-frequency = <10000000>;<br>
> +<br>
> +                               partition@0 {<br>
> +                                       label = "u-boot";<br>
> +                                       reg = <0x0 0x30000>;<br>
> +                                       read-only;<br>
> +                               };<br>
> +<br>
> +                               partition@30000 {<br>
> +                                       label = "u-boot-env";<br>
> +                                       reg = <0x30000 0x10000>;<br>
> +                               };<br>
> +<br>
> +                               factory: partition@40000 {<br>
> +                                       label = "factory";<br>
> +                                       reg = <0x40000 0x10000>;<br>
> +                                       read-only;<br>
> +                               };<br>
> +<br>
> +                               partition@50000 {<br>
> +                                       label = "firmware";<br>
> +                                       reg = <0x50000 0x7b0000>;<br>
> +                               };<br>
> +<br>
> +                               partition@e30000 {<br>
> +                                       label = "recovery";<br>
> +                                       reg = <0xe30000 0x1d0000>;<br>
> +                               };<br>
> +<br>
> +                       };<br>
> +               };<br>
> +       };<br>
> +<br>
> +       pcie@1e140000 {<br>
> +               status = "okay";<br>
> +<br>
> +               pcie0 {<br>
> +                       mt76@0,0 {<br>
> +                               reg = <0x0000 0 0 0 0>;<br>
> +                               device_type = "pci";<br>
> +                               mediatek,mtd-eeprom = <&factory 0x8000>;<br>
> +                               mediatek,2ghz = <0>;<br>
> +                       };<br>
> +               };<br>
> +<br>
> +               pcie1 {<br>
> +                       mt76@1,0 {<br>
> +                               reg = <0x0000 0 0 0 0>;<br>
> +                               device_type = "pci";<br>
> +                               mediatek,mtd-eeprom = <&factory 0x0000>;<br>
> +                               mediatek,5ghz = <0>;<br>
> +                       };<br>
> +               };<br>
> +       };<br>
> +<br>
> +       ethernet@1e100000 {<br>
> +               mtd-mac-address = <&factory 0xe000>;<br>
> +       };<br>
> +<br>
> +       gpio-leds {<br>
> +               compatible = "gpio-leds";<br>
> +<br>
> +               wps {<br>
> +                       label = "sk-wb8:green:wps";<br>
> +                       gpios = <&gpio1 14 1>;<br>
> +               };<br>
> +<br>
> +               usb {<br>
> +                       label = "sk-wb8:green:usb";<br>
> +                       gpios = <&gpio1 15 1>;<br>
> +               };<br>
> +       };<br>
> +<br>
> +       gpio-keys-polled {<br>
> +               compatible = "gpio-keys-polled";<br>
> +               #address-cells = <1>;<br>
> +               #size-cells = <0>;<br>
> +               poll-interval = <20>;<br>
> +               wps {<br>
> +                       label = "wps";<br>
> +                       gpios = <&gpio1 11 1>;<br>
> +                       linux,code = <0x211>;<br>
> +               };<br>
> +               reset {<br>
> +                       label = "reset";<br>
> +                       gpios = <&gpio1 9 1>;<br>
> +                       linux,code = <0x198>;<br>
> +               };<br>
> +       };<br>
> +<br>
> +       pinctrl {<br>
> +               state_default: pinctrl0 {<br>
> +                       gpio {<br>
> +                               ralink,group = "i2c", "uart2", "uart3", "rgmii2", "sdhci";<br>
> +                               ralink,function = "gpio";<br>
> +                       };<br>
> +               };<br>
> +       };<br>
> +<br>
> +};<br>
> diff --git a/target/linux/ramips/image/<a href="http://mt7621.mk" rel="noreferrer" target="_blank">mt7621.mk</a> b/target/linux/ramips/image/<a href="http://mt7621.mk" rel="noreferrer" target="_blank">mt7621.mk</a><br>
> index 1b8d3da..a09f4ab 100644<br>
> --- a/target/linux/ramips/image/<a href="http://mt7621.mk" rel="noreferrer" target="_blank">mt7621.mk</a><br>
> +++ b/target/linux/ramips/image/<a href="http://mt7621.mk" rel="noreferrer" target="_blank">mt7621.mk</a><br>
> @@ -138,6 +138,12 @@ define Device/ubnt-erx<br>
>  endef<br>
>  TARGET_DEVICES += ubnt-erx<br>
><br>
> +define Device/sk-wb8<br>
> +  DTS := SK-WB8<br>
> +  IMAGE_SIZE := $(ralink_default_fw_size_16M)<br>
> +endef<br>
> +TARGET_DEVICES += sk-wb8<br>
> +<br>
>  # FIXME: is this still needed?<br>
>  define Image/Prepare<br>
>  #define Build/Compile<br>
> diff --git a/target/linux/ramips/mt7621/profiles/<a href="http://sk-wb8.mk" rel="noreferrer" target="_blank">sk-wb8.mk</a> b/target/linux/ramips/mt7621/profiles/<a href="http://sk-wb8.mk" rel="noreferrer" target="_blank">sk-wb8.mk</a><br>
> new file mode 100644<br>
> index 0000000..aa2e45e<br>
> --- /dev/null<br>
> +++ b/target/linux/ramips/mt7621/profiles/<a href="http://sk-wb8.mk" rel="noreferrer" target="_blank">sk-wb8.mk</a><br>
> @@ -0,0 +1,18 @@<br>
> +#<br>
> +# Copyright (C) 2016 OpenWrt.org<br>
> +#<br>
> +# This is free software, licensed under the GNU General Public License v2.<br>
> +# See /LICENSE for more information.<br>
> +#<br>
> +<br>
> +define Profile/SK-WB8<br>
> +       NAME:=SamKnows Whitebox 8<br>
> +       PACKAGES:=\<br>
> +               kmod-usb-core kmod-usb3 \<br>
> +               kmod-ledtrig-usbdev uboot-envtools<br>
> +endef<br>
> +<br>
> +define Profile/SK-WB8/Description<br>
> +       Package set compatible with the SamKnows Whitebox 8.<br>
> +endef<br>
> +$(eval $(call Profile,SK-WB8))<br>
> _______________________________________________<br>
> openwrt-devel mailing list<br>
> <a href="mailto:openwrt-devel@lists.openwrt.org">openwrt-devel@lists.openwrt.org</a><br>
> <a href="https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel" rel="noreferrer" target="_blank">https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel</a><br>
><br>
</blockquote></div>