OpenWrt Forum Archive

Topic: Openwrt support for Sitecom WLR-8100

The content of this topic has been archived between 6 Jul 2014 and 23 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

looks like this patch doesn't work with AA. even after manually modify the Makefile. anyone succeeded?

(Last edited by vubvub on 5 Sep 2013, 08:54)

the usb 3.0 controller is up and run now. I put the binary on box:
https://app.box.com/s/m26jngsa5bhyfrr3cggo

the 5ghz still doesn't work. if anyone can donate a ko for 5ghz, i can try if it works on 8100.

(Last edited by vubvub on 10 Sep 2013, 15:30)

Please help, if anyone has any idea about the following:
/usr/lib/lua/luci/dispatcher.lua:448: Failed to execute cbi dispatcher target for entry '/admin/system/leds'.
The called action terminated with an exception:
/usr/lib/lua/luci/model/cbi/admin_system/leds.lua:55: attempt to index local 'triggers' (a nil value)
stack traceback:
    [C]: in function 'assert'
    /usr/lib/lua/luci/dispatcher.lua:448: in function 'dispatch'
    /usr/lib/lua/luci/dispatcher.lua:195: in function </usr/lib/lua/luci/dispatcher.lua:194>

I see it every time when I press the "LED Configuration" on the webgui.
It doesn't happen before. I didn't change anything related to this part.

Would you please edit the wiki and add serial pinout ?
Every USB/TTL Adapter is colored differently
What is the pinout of your adapter / colour of wires ?

(Last edited by zloop on 10 Sep 2013, 21:08)

thanks for reminding me. I will make a colour layout

map is added

vubvub wrote:
zloop wrote:

I think the following should enable ath10k but I get only a Kernel Oops on TP-Link with supposedly "rare" AR1A hardware

1. enable ath10k
in your trunk folder there is package/kernel/mac80211/Makefile

Patch it with the ath10k enable patch from the mailing list:
https://lists.openwrt.org/pipermail/openwrt-devel/2013-August/021105.html

2. update mac80211 (compat-wireless) to backports (same project new name)

PKG_VERSION:=20130802
PKG_RELEASE:=1
PKG_SOURCE_URL:=http://www.kernel.org/pub/linux/kernel/projects/backports/2013/08/02
PKG_SHA1SUM:=d8ca2b9405ec81c171470f60f526d10e841e74ebc526b1938350ea8f9871084e

PKG_SOURCE:=backports-$(PKG_VERSION).tar.bz2
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/backports-$(PKG_VERSION)
PKG_BUILD_PARALLEL:=1

and a line with "echo" in Build/prepare to the new name (backports instead of compat)

3. refresh patches of mac80211
(see OpenWrt wiki: http://wiki.openwrt.org/doc/devel/patches )

make prepare
make package/kernel/mac80211/prepare V=s QUILT=1
cd build_dir/target .../linux.../backports-20130802/
quilt series
# delete 2 large pending work patches - less fixes for other wireless drivers 
# but you want to test ath10k anyway
quilt delete 300- ...

# repeat / use following 3 commands until all patches are working or 
# delete some patches for drivers not used in your image
quilt push
quilt refresh
# remove an applied patch
quilt pop

4. maybe integrate hw revision test
patch from ath10k mailing list: http://lists.infradead.org/pipermail/ath10k/2013-August/000279.html

# if you are at the end of quilt series - name patch f. ex. 900-ath10k_hw_id.patch
quilt import <path>/900-ath10k_hw_id.patch
# patch is in patches dir
quilt push
quilt refresh

5. update packages: atm you only have a modified build_dir

# in openwrt buildroot
make package/kernel/mac80211/update

After that you should build your image.
atm you have to manually load the kernel modules (insmod ath10k_core, insmod ath10k_pci )

Thanks zloop. But now I am trying to do it in attitude adjustment instead of trunk. there is no such structures like package/kernel/mac80211. is it still possible to port ath10k? I also want to include the ath10k in the kernel like ath9k, any suggestions?

HI, Dude,

I have some progress now, but it seems the url is not correct? Looks it is corruptted.

Download failed.
--2013-09-12 09:21:05--  http://downloads.openwrt.org/sources/BACKPORTS-20130802.tar.bz2
Resolving downloads.openwrt.org... 78.24.191.177
Connecting to downloads.openwrt.org|78.24.191.177|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2013-09-12 09:21:05 ERROR 404: Not Found.

Download failed.
No more mirrors to try - giving up.
make[2]: *** [/home/crazybee/openwrt/adjust/dl/BACKPORTS-20130802.tar.bz2] Error 2
make[2]: Leaving directory `/home/crazybee/openwrt/adjust/package/mac80211'
make[1]: *** [package/mac80211/prepare] Error 2
make[1]: Leaving directory `/home/crazybee/openwrt/adjust'
make: *** [package/mac80211/prepare] Error 2

sorry it is the stupid capitalization
now it works

hi, zloop, did you succeed?
now i am stuck at this after make

build_dir/linux-ar71xx_generic/backports-20130802/drivers/net/wireless/ath/ath9k/antenna.c:708:20: error: 'struct ath_rx_status' has no member named 'rs_rssi_ctl0'

even after I added the mac.h in the header , still showing the same.

(Last edited by vubvub on 12 Sep 2013, 10:33)

Good news! Both 5ghz and usb3.0 are now supported.
i put the firmware on:
https://app.box.com/s/redpq6c4um2j8schyx5a
however, although it is working now, THE INTERFERENCE IS VERY BIG. I think it is because of this:

ath10k_pci 0000:01:00.0: BAR 0: assigned [mem 0x12000000-0x121fffff 64bit]
[   31.770000] PCI: Enabling device 0000:01:00.0 (0000 -> 0002)
[   31.770000] ath10k: MSI-X didn't succeed (-1), trying MSI
[   31.780000] ath10k: MSI didn't succeed (-1), trying legacy INTR
[   31.800000] ath10k: legacy interrupt handling
[   31.890000] ath10k: Hardware name qca988x hw2.0 version 0x4100016c
[   33.360000] ath10k: UART prints disabled
[   33.360000] ath10k: HTC Service HTT Data does not allocate target credits
[   33.370000] ath10k: firmware 1.0.0.636 booted

Anyone has any idea about this MSI configuration?

you will have to switch on the wifi either through webgui(192.168.1.1) or /etc/config/wireless
I included a sample wireless config there, but I think you will need to change it to your mac address to let it work.

Just interested: what is actual usb3 read/write speed in this device?

eximido wrote:

Just interested: what is actual usb3 read/write speed in this device?

I tried to test it with dd. but the dd of my kernel 3.3.8 doesn't show tx rate. Maybe you can suggest some tool in opwrt to test. I will be very happy to try.

if anyone knows how to set the ht mode to standard ac mode. Because now i only see 20mhz and 40mhz. I checked the information on the wiki about the htmode settings. I don't see any support yet on how to make 80mhz and 160mhz work.
It will be nice if anyone can help on this issue.

vubvub wrote:
eximido wrote:

Just interested: what is actual usb3 read/write speed in this device?

I tried to test it with dd. but the dd of my kernel 3.3.8 doesn't show tx rate. Maybe you can suggest some tool in opwrt to test. I will be very happy to try.

Yes, dd in busybox is very limited in functionality, but you can install coreutils-dd package with full-featured dd utility.
Another option: use dd from busybox with time utility to measure elapsed time.

eximido wrote:

Just interested: what is actual usb3 read/write speed in this device?

USB 3.0 speed on factory firmware is around 20MB/s (USB3 stick capable of 100/40 MB/s).
see wiki page

@vubvub

- Can you please post your uboot environment (printenv) it seems you have different hw (?)


That router got some strange partitions:

bootargs=console=ttyS0,115200 root=31:02 rootfstype=squashfs,jffs2 init=/sbin/init mtdparts=ath-nor0:192k(u-boot),64k(u-boot-env),2752k(rootfs),1408k(uImage),64k(NVRAM),64k(ART)

16MB Flash and such a small rootfs ?
I think factory firmware has a small root fs and then uses the flash to load more apps that are located at different flash locations

I am still tinkering with original firmware - trying to backup art/nvram via uboot.

For uboot commandline you have to press "4". (that command was delisted like "2" )

This unit probably supports other boot methods too:

iminfo  - print header information for application image
nfs    - boot image via network using NFS protocol
rarpboot- boot image via network using RARP/TFTP protocol
tftpboot- boot image via network using TFTP protocol

(some commands from uboot help)

i think it is related with my mtdlayout settings as i mentioned in my previous post
ap136_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),14080k(rootfs),64k(mib0),64k(art)ro,15488k@0x40000(firmware)

my feeling is that the factory fw doesn't make full use of the 16Mb flash

I managed to create my own image and flash it with (hidden) option 2 in uboot

cat /proc/cmdline
 board=WLR8100 console=ttyS0,115200 mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),14080k(rootfs),192k(unknown)ro,64k(art)ro,384k(unknown2)ro,15488k@0x40000(firmware),16384k@00000(readonly)ro rootfstype=squashfs,jffs2 noinitrd

i created other entries for debug/testing/see how buildsystem works
and there is some other strange stuff in the last partitions (atheros labels / text in the middle of eraseblocks - maybe ART ?)
and NVRAM like entries but these are not used by original sitecom firmware i think

additionally i found some differences between fw ver1.0 + fw ver1.2
(in FW ver1.2 "-SENAO TECHNOLOGIES INC.-" "tag" in flashrom occurs only 1 time instead of 3 )
obviously thats gone after flashing openwrt



Question
80211ac radio works but only at 6MBit/s  . How is speed at your end ?

Maybe its because early ath10k status in trunk ... i already did backports to a newer version some time ago but havent had time to include that yet.

USB3 support seems to load/build ok but havent tested USB stuff yet

root@OpenWrt:~# lspci
00:00.0 USB controller: Etron Technology, Inc. EJ168 USB 3.0 Host Controller (rev 01)
01:00.0 Network controller: Qualcomm Atheros QCA988x 802.11ac Wireless Network Adapter

I think I'll post some RFC patches to the mailing list tomorrow - i haven't figured out all necessary steps yet (mainly how to detect watermark in firmware - factory fw is in strange(?) dlf format - maybe only XORed but didnt test that)

(Last edited by zloop on 4 Oct 2013, 18:52)

.... i cannot get the switch to work - only WAN port

patches so far:
- add USB3 support , remove file : target/linux/generic/patches-3.10/811-pci_disable_usb_common_quirks.patch

diff --git a/package/kernel/linux/modules/usb.mk b/package/kernel/linux/modules/usb.mk
index 1614419..91e766c 100644
--- a/package/kernel/linux/modules/usb.mk
+++ b/package/kernel/linux/modules/usb.mk
@@ -1092,3 +1092,21 @@ define KernelPackage/usbmon/description
 endef
 
 $(eval $(call KernelPackage,usbmon))
+
+
+define KernelPackage/usb3
+  TITLE:=Support for USB3 controllers
+  KCONFIG:= \
+    CONFIG_USB_XHCI \
+    CONFIG_USB_XHCI_HCD \
+    CONFIG_USB_XHCI_HCD_DEBUGGING=y
+  FILES:=$(LINUX_DIR)/drivers/usb/host/xhci-hcd.ko
+  AUTOLOAD:=$(call AutoLoad,50,xhci-hcd,1)
+  $(call AddDepends/usb)
+endef
+
+define KernelPackage/usb3/description
+ Kernel support for USB USB3 controllers
+endef
+
+$(eval $(call KernelPackage,usb3,1))

- add WLR-8100

diff --git a/target/linux/ar71xx/patches-3.10/629-MIPS-ath79-add-sc-wlr8100-support.patch b/target/linux/ar71xx/patches-3.10/629-MIPS-ath79-add-sc-wlr8100-support.patch
new file mode 100644
index 0000000..f1ee24a
--- /dev/null
+++ b/target/linux/ar71xx/patches-3.10/629-MIPS-ath79-add-sc-wlr8100-support.patch
@@ -0,0 +1,39 @@
+--- a/arch/mips/ath79/Kconfig
++++ b/arch/mips/ath79/Kconfig
+@@ -194,6 +194,16 @@ config ATH79_MACH_WLAE_AG300N
+     select ATH79_DEV_LEDS_GPIO
+     select ATH79_DEV_M25P80
+
++config ATH79_MACH_WLR8100
++    bool "Sitecom WLR-8100 board support"
++    select SOC_QCA955X
++    select ATH79_DEV_ETH
++    select ATH79_DEV_GPIO_BUTTONS
++    select ATH79_DEV_LEDS_GPIO
++    select ATH79_DEV_SPI
++    select ATH79_DEV_USB
++    select ATH79_DEV_WMAC
++
+ config ATH79_MACH_WZR_HP_AG300H
+     bool "Buffalo WZR-HP-AG300H board support"
+     select SOC_AR71XX
+--- a/arch/mips/ath79/machtypes.h
++++ b/arch/mips/ath79/machtypes.h
+@@ -127,6 +127,7 @@ enum ath79_mach_type {
+     ATH79_MACH_WHR_HP_G300N,    /* Buffalo WHR-HP-G300N */
+     ATH79_MACH_WHR_HP_GN,        /* Buffalo WHR-HP-GN */
+     ATH79_MACH_WLAE_AG300N,        /* Buffalo WLAE-AG300N */
++    ATH79_MACH_WLR8100,        /* SITECOM WLR-8100 */
+     ATH79_MACH_WNDAP360,        /* NETGEAR WNDAP360 */
+     ATH79_MACH_WNDR3700,        /* NETGEAR WNDR3700/WNDR3800/WNDRMAC */
+     ATH79_MACH_WNDR4300,        /* NETGEAR WNDR4300 */
+--- a/arch/mips/ath79/Makefile
++++ b/arch/mips/ath79/Makefile
+@@ -103,6 +103,7 @@ obj-$(CONFIG_ATH79_MACH_UBNT)        += mach-u
+ obj-$(CONFIG_ATH79_MACH_UBNT_XM)    += mach-ubnt-xm.o
+ obj-$(CONFIG_ATH79_MACH_WHR_HP_G300N)    += mach-whr-hp-g300n.o
+ obj-$(CONFIG_ATH79_MACH_WLAE_AG300N)    += mach-wlae-ag300n.o
++obj-$(CONFIG_ATH79_MACH_WLR8100)    += mach-wlr8100.o
+ obj-$(CONFIG_ATH79_MACH_WNDAP360)    += mach-wndap360.o
+ obj-$(CONFIG_ATH79_MACH_WNDR3700)    += mach-wndr3700.o
+ obj-$(CONFIG_ATH79_MACH_WNDR4300)    += mach-wndr4300.o

missing/ Issues
- mach-wlr8100.c modifications (simple c/p AP136-010 only works on wan)
- drivers/net/phy/ar8216.c modifications (linked image already has modifications regarding that)

# 8337 = 0x13 because of uboot msg "athrs17_reg_init QCA8337 ID=1302" ? , what about init code?
enum {
    AR8XXX_VER_AR8216 = 0x01,
    AR8XXX_VER_AR8236 = 0x03,
    AR8XXX_VER_AR8316 = 0x10,
    AR8XXX_VER_AR8327 = 0x12,
};

- MAC data (use either uboot env or nvram backup)

[    0.080000] ar71xx: using random MAC address for eth0
[    0.280000] ar71xx: using random MAC address for eth1

offset of nvram(?)/u-boot-env are / see wiki entry of wlr-8100 for printenv

0030000: 912e 9863 626f 6f74 6172 6773 3d63 6f6e  ...cbootargs=con
0f90000: bded a553 626f 6f74 6172 6773 3d63 6f6e  ...Sbootargs=con

- ART offset :
in original firmware there is atheros stuff (so offset 1000 and offset 2000 on different partitions/or one quite large partition)

#offset in original fw v1.0
0f92000: 0202 0002 6f12 3456 2441 7468 6572 6f73  ....o.4V$Atheros
0ff1000: 0202 0002 6f12 3456 2441 7468 6572 6f73  ....o.4V$Atheros

- USB3 with xhci produces errors on mounting a stick:

[  122.130000] xhci_hcd 0000:00:00.0: xHCI host not responding to stop endpoint command.
[  122.130000] xhci_hcd 0000:00:00.0: Assuming host is dying, halting host.
[  122.140000] xhci_hcd 0000:00:00.0: HC died; cleaning up
[  122.150000] usb 4-1: USB disconnect, device number 2
[  122.150000] sd 0:0:0:0: Device offlined - not ready after error recovery

The linked image is using etxhci_hcd driver.

Message to mailing list was blocked because of spam - therefore i am posting some code/dumps here:

1. for research:

factory FW 1.0 includes uboot, uboot-env (be aware of S/N, MAC etc)
if someone wants to look for firmware magic / boundaries etc...
https://mega.co.nz/#!UsdWmajA!atnXolwjPg8bYsLHIgv-rxImDVJz5uy1FXIH4FDaxIw
SHA1SUM should be: 7299a94c81ac881c97c045075286956a3fa805cb

2. machine file

according to ap136-010, only WAN works with that ... AR8337N switch support is missing, init code etc
too

diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-wlr8100.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-wlr8100.c
new file mode 100644
index 0000000..8eecc0e
--- /dev/null
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-wlr8100.c
@@ -0,0 +1,222 @@
+/*
+ * Sitecom X8 AC1750 WLR-8100 board support
+ *
+ * Based on the Qualcomm Atheros AP135/AP136 reference board support code
+ * Copyright (c) 2012 Qualcomm Atheros
+ * Copyright (c) 2012-2013 Gabor Juhos <juhosg@openwrt.org>
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ */
+
+#include <linux/platform_device.h>
+#include <linux/ar8216_platform.h>
+
+#include <asm/mach-ath79/ar71xx_regs.h>
+
+#include "common.h"
+#include "pci.h"
+#include "dev-ap9x-pci.h"
+#include "dev-gpio-buttons.h"
+#include "dev-eth.h"
+#include "dev-leds-gpio.h"
+#include "dev-m25p80.h"
+#include "dev-usb.h"
+#include "dev-wmac.h"
+#include "machtypes.h"
+
+#define WLR8100_GPIO_LED_USB        4
+#define WLR8100_GPIO_LED_WLAN_5G    12
+#define WLR8100_GPIO_LED_WLAN_2G    13
+#define WLR8100_GPIO_LED_STATUS_RED    14
+#define WLR8100_GPIO_LED_WPS_RED    15
+#define WLR8100_GPIO_LED_STATUS_AMBER    19
+#define WLR8100_GPIO_LED_WPS_GREEN    20
+
+#define WLR8100_GPIO_BTN_WPS        16
+#define WLR8100_GPIO_BTN_RFKILL        21
+
+#define WLR8100_KEYS_POLL_INTERVAL    20    /* msecs */
+#define WLR8100_KEYS_DEBOUNCE_INTERVAL    (3 * WLR8100_KEYS_POLL_INTERVAL)
+
+#define WLR8100_MAC0_OFFSET        0
+#define WLR8100_MAC1_OFFSET        6
+#define WLR8100_WMAC_CALDATA_OFFSET    0x1000
+#define WLR8100_PCIE_CALDATA_OFFSET    0x5000
+
+static struct gpio_led wlr8100_leds_gpio[] __initdata = {
+    {
+        .name        = "wlr8100:amber:status",
+        .gpio        = WLR8100_GPIO_LED_STATUS_AMBER,
+        .active_low    = 1,
+    },
+    {
+        .name        = "wlr8100:red:status",
+        .gpio        = WLR8100_GPIO_LED_STATUS_RED,
+        .active_low    = 1,
+    },
+    {
+        .name        = "wlr8100:green:wps",
+        .gpio        = WLR8100_GPIO_LED_WPS_GREEN,
+        .active_low    = 1,
+    },
+    {
+        .name        = "wlr8100:red:wps",
+        .gpio        = WLR8100_GPIO_LED_WPS_RED,
+        .active_low    = 1,
+    },
+    {
+        .name        = "wlr8100:red:wlan-2g",
+        .gpio        = WLR8100_GPIO_LED_WLAN_2G,
+        .active_low    = 1,
+    },
+    {
+        .name        = "wlr8100:red:usb",
+        .gpio        = WLR8100_GPIO_LED_USB,
+        .active_low    = 1,
+    }
+};
+
+static struct gpio_keys_button wlr8100_gpio_keys[] __initdata = {
+    {
+        .desc        = "WPS button",
+        .type        = EV_KEY,
+        .code        = KEY_WPS_BUTTON,
+        .debounce_interval = WLR8100_KEYS_DEBOUNCE_INTERVAL,
+        .gpio        = WLR8100_GPIO_BTN_WPS,
+        .active_low    = 1,
+    },
+    {
+        .desc        = "RFKILL button",
+        .type        = EV_KEY,
+        .code        = KEY_RFKILL,
+        .debounce_interval = WLR8100_KEYS_DEBOUNCE_INTERVAL,
+        .gpio        = WLR8100_GPIO_BTN_RFKILL,
+        .active_low    = 1,
+    },
+};
+
+static struct ar8327_pad_cfg wlr8100_ar8327_pad0_cfg;
+static struct ar8327_pad_cfg wlr8100_ar8327_pad6_cfg;
+
+static struct ar8327_platform_data wlr8100_ar8327_data = {
+    .pad0_cfg = &wlr8100_ar8327_pad0_cfg,
+    .pad6_cfg = &wlr8100_ar8327_pad6_cfg,
+    .port0_cfg = {
+        .force_link = 1,
+        .speed = AR8327_PORT_SPEED_1000,
+        .duplex = 1,
+        .txpause = 1,
+        .rxpause = 1,
+    },
+    .port6_cfg = {
+        .force_link = 1,
+        .speed = AR8327_PORT_SPEED_1000,
+        .duplex = 1,
+        .txpause = 1,
+        .rxpause = 1,
+    },
+};
+
+static struct mdio_board_info wlr8100_mdio0_info[] = {
+    {
+        .bus_id = "ag71xx-mdio.0",
+        .phy_addr = 0,
+        .platform_data = &wlr8100_ar8327_data,
+    },
+};
+
+static void __init wlr8100_gmac_setup(void)
+{
+    void __iomem *base;
+    u32 t;
+
+    base = ioremap(QCA955X_GMAC_BASE, QCA955X_GMAC_SIZE);
+
+    t = __raw_readl(base + QCA955X_GMAC_REG_ETH_CFG);
+
+    t &= ~(QCA955X_ETH_CFG_RGMII_EN | QCA955X_ETH_CFG_GE0_SGMII);
+    t |= QCA955X_ETH_CFG_RGMII_EN;
+
+    __raw_writel(t, base + QCA955X_GMAC_REG_ETH_CFG);
+
+    iounmap(base);
+}
+
+static void __init wlr8100_common_setup(void)
+{
+    u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
+
+    ath79_register_m25p80(NULL);
+
+    ath79_register_leds_gpio(-1, ARRAY_SIZE(wlr8100_leds_gpio),
+                 wlr8100_leds_gpio);
+    ath79_register_gpio_keys_polled(-1, WLR8100_KEYS_POLL_INTERVAL,
+                    ARRAY_SIZE(wlr8100_gpio_keys),
+                    wlr8100_gpio_keys);
+
+    ath79_register_usb();
+
+    ath79_register_wmac(art + WLR8100_WMAC_CALDATA_OFFSET, NULL);
+
+    wlr8100_gmac_setup();
+
+    ath79_register_mdio(0, 0x0);
+
+    ath79_init_mac(ath79_eth0_data.mac_addr, art + WLR8100_MAC0_OFFSET, 0);
+
+    mdiobus_register_board_info(wlr8100_mdio0_info,
+                    ARRAY_SIZE(wlr8100_mdio0_info));
+
+    /* GMAC0 is connected to the RMGII interface */
+    ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
+    ath79_eth0_data.phy_mask = BIT(0);
+    ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
+
+    ath79_register_eth(0);
+
+    /* GMAC1 is connected tot eh SGMII interface */
+    ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_SGMII;
+    ath79_eth1_data.speed = SPEED_1000;
+    ath79_eth1_data.duplex = DUPLEX_FULL;
+
+    ath79_register_eth(1);
+}
+
+static void __init wlr8100_010_setup(void)
+{
+    u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
+
+    /* GMAC0 of the AR8337 switch is connected to GMAC0 via RGMII */
+    wlr8100_ar8327_pad0_cfg.mode = AR8327_PAD_MAC_RGMII;
+    wlr8100_ar8327_pad0_cfg.txclk_delay_en = true;
+    wlr8100_ar8327_pad0_cfg.rxclk_delay_en = true;
+    wlr8100_ar8327_pad0_cfg.txclk_delay_sel = AR8327_CLK_DELAY_SEL1;
+    wlr8100_ar8327_pad0_cfg.rxclk_delay_sel = AR8327_CLK_DELAY_SEL2;
+
+    /* GMAC6 of the AR8337 switch is connected to GMAC1 via SGMII */
+    wlr8100_ar8327_pad6_cfg.mode = AR8327_PAD_MAC_SGMII;
+    wlr8100_ar8327_pad6_cfg.rxclk_delay_en = true;
+    wlr8100_ar8327_pad6_cfg.rxclk_delay_sel = AR8327_CLK_DELAY_SEL0;
+
+    ath79_eth0_pll_data.pll_1000 = 0xa6000000;
+    ath79_eth1_pll_data.pll_1000 = 0x03000101;
+
+    wlr8100_common_setup();
+    ap91_pci_init(art + WLR8100_PCIE_CALDATA_OFFSET, NULL);
+}
+
+MIPS_MACHINE(ATH79_MACH_WLR8100, "WLR8100",
+         "Sitecom WLR-8100",
+         wlr8100_010_setup);
+

3. Image creation and user space

diff --git a/target/linux/ar71xx/generic/profiles/sitecom.mk b/target/linux/ar71xx/generic/profiles/sitecom.mk
new file mode 100644
index 0000000..6451e64
--- /dev/null
+++ b/target/linux/ar71xx/generic/profiles/sitecom.mk
@@ -0,0 +1,16 @@
+#
+# Copyright (C) 2009-2013 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+define Profile/WLR8100
+        NAME:=Sitecom WLR-8100
+        PACKAGES:=kmod-usb-core kmod-usb2 kmod-ledtrig-usbdev kmod-usb3 usbutils pciutils ss mtr ip tcpdump-mini xxd
+endef
+
+define Profile/WLR8100/Description
+        Package set optimized for the Sitecom WLR-8100
+endef
+
+$(eval $(call Profile,WLR8100))
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index 1b276c5..5bb7f8b 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -193,6 +193,7 @@ ubntxm_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7552k(firmware
 uap_pro_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1536k(kernel),14208k(rootfs),256k(cfg)ro,64k(EEPROM)ro,15744k@0x50000(firmware)
 ubdev_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7488k(firmware),64k(certs),256k(cfg)ro,64k(EEPROM)ro
 whrhpg300n_mtdlayout=mtdparts=spi0.0:248k(u-boot)ro,8k(u-boot-env)ro,3712k(firmware),64k(art)ro
+wlr8100_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),14080k(rootfs),192k(unknown)ro,64k(art)ro,384k(unknown2)ro,15488k@0x40000(firmware),16384k@00000(readonly)ro
 wndap360_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1728k(kernel),6016k(rootfs),64k(nvram)ro,64k(art)ro,7744k@0x50000(firmware)
 wnr2200_mtdlayout=mtdparts=spi0.0:320k(u-boot)ro,128k(u-boot-env)ro,7680k(firmware),64k(art)ro
 wnr2000v3_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,3712k(firmware),64k(art)ro
@@ -815,6 +816,7 @@ $(eval $(call SingleProfile,AthLzma,64k,EWDORINAP,ew-dorin,EW-DORIN,ttyATH0,1152
 $(eval $(call SingleProfile,AthLzma,64k,EWDORINRT,ew-dorin-router,EW-DORIN-ROUTER,ttyATH0,115200,$$(ew-dorin_mtdlayout_4M),65536,2752512,KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,HORNETUBx2,hornet-ub-x2,HORNET-UB,ttyATH0,115200,$$(alfa_mtdlayout_16M),65536,16318464,KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,PB92,pb92,PB92,ttyS0,115200,$$(pb92_mtdlayout),917504,2818048,KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,WLR8100,wlr8100,WLR8100,ttyS0,115200,$$(wlr8100_mtdlayout),1441792,12320768,KRuImage))
 
 $(eval $(call SingleProfile,CameoAP91,64kraw,DIR600A1,dir-600-a1,DIR-600-A1,ttyS0,115200,"AP91-AR7240-RT-090223-00"))
 $(eval $(call SingleProfile,CameoAP91,64kraw,DIR601A1,dir-601-a1,DIR-600-A1,ttyS0,115200,"AP91-AR7240-RT-090223-02"))
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 3962aa2..a4a8408 100755
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -188,6 +188,9 @@ get_status_led() {
     zcn-1523h-2 | zcn-1523h-5)
         status_led="zcn-1523h:amber:init"
         ;;
+    wlr8100)
+        status_led="sitecom:amber:status"
+        ;;
     esac
 }
 
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
index 3d6ab29..d953ed7 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -29,7 +29,8 @@ ap132)
     ucidef_add_switch_vlan "switch0" "2" "0t 1"
     ;;
 
-ap136-010)
+ap136-010 |\
+wlr8100)
     ucidef_set_interfaces_lan_wan "eth0" "eth1"
     ucidef_add_switch "switch0" "1" "1"
     ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4"
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 06786e7..633fae1 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -573,6 +573,9 @@ ar71xx_board_detect() {
     "8devices Carambola2"*)
         name="carambola2"
         ;;
+    *"Sitecom WLR-8100")
+        name="wlr8100"
+        ;;
     esac
 
     case "$machine" in
diff --git a/target/linux/ar71xx/config-3.10 b/target/linux/ar71xx/config-3.10
index f88d008..661c693 100644
--- a/target/linux/ar71xx/config-3.10
+++ b/target/linux/ar71xx/config-3.10
@@ -88,6 +88,7 @@ CONFIG_ATH79_MACH_UBNT=y
 CONFIG_ATH79_MACH_UBNT_XM=y
 CONFIG_ATH79_MACH_WHR_HP_G300N=y
 CONFIG_ATH79_MACH_WLAE_AG300N=y
+CONFIG_ATH79_MACH_WLR8100=y
 CONFIG_ATH79_MACH_WNDAP360=y
 CONFIG_ATH79_MACH_WNDR3700=y
 CONFIG_ATH79_MACH_WNDR4300=y

Nice experiment zloop. If it is possible could you send me those patches or share them on the wiki, so everyone can try it also. My solution for the 8337 driver is to redirect it to 8327, since these two are quite similar.
Didn't make the patch for it. But I put ar8216.c, ar8216.h for sharing, it will be nice if you can make the patches.
https://app.box.com/s/ws6t249llo7uu6sc75mr

the ar8261.c and ar8261.h are only for AA12.09. For trunk, I didn't succeed. Could anyone can help porting this to trunk?

zloop wrote:
# 8337 = 0x13 because of uboot msg "athrs17_reg_init QCA8337 ID=1302" ? , what about init code?
enum {
    AR8XXX_VER_AR8216 = 0x01,
    AR8XXX_VER_AR8236 = 0x03,
    AR8XXX_VER_AR8316 = 0x10,
    AR8XXX_VER_AR8327 = 0x12,
};

here's example of qca8334. works only on AA

--- a/drivers/net/phy/ar8216.c
+++ b/drivers/net/phy/ar8216.c
@@ -52,6 +52,7 @@ enum {
     AR8XXX_VER_AR8236 = 0x03,
     AR8XXX_VER_AR8316 = 0x10,
     AR8XXX_VER_AR8327 = 0x12,
+    AR8XXX_VER_QCA8334 = 0x13,
 };
 
 struct ar8xxx_mib_desc {
@@ -226,7 +227,7 @@ static inline bool chip_is_ar8316(struct
 
 static inline bool chip_is_ar8327(struct ar8216_priv *priv)
 {
-    return priv->chip_ver == AR8XXX_VER_AR8327;
+    return priv->chip_ver == AR8XXX_VER_AR8327 || priv->chip_ver == AR8XXX_VER_QCA8334;
 }
 
 static inline void
@@ -1675,6 +1676,7 @@ ar8216_id_chip(struct ar8216_priv *priv)
         priv->chip = &ar8316_chip;
         break;
     case AR8XXX_VER_AR8327:
+    case AR8XXX_VER_QCA8334:
         priv->mii_lo_first = true;
         priv->chip = &ar8327_chip;
         break;

trunk's phy driver structure is little bit different from AA.