Mikrotik RB953GS + Openwrt 18.06

I've tried to make Openwrt 18.06 working on Mikrotik RB953GS.
So far ethernet ports, wireless and first pcie are working, nand is detected and firmware can be installed using common Mikrotik procedure (i.e. boot from initframs and sysupgrade from tmp).
But I cannot make working SFP and find GPIO for USB control (to make second pci work).
Looking for someone who can shed some light on this.
Current code changes against openwrt 18.06 branch:

diff --git a/target/linux/ar71xx/base-files/etc/board.d/02_network b/target/linux/ar71xx/base-files/etc/board.d/02_network
index 87b8dba..f06dacf 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/02_network
+++ b/target/linux/ar71xx/base-files/etc/board.d/02_network
@@ -207,6 +207,7 @@ ar71xx_setup_interfaces()
 	rb-750gl|\
 	rb-751g|\
 	rb-951g-2hnd|\
+	rb-953gs-5hnt|\
 	rb-962uigs-5hact2hnt|\
 	wlr8100|\
 	wzr-hp-g450h)
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 4eb2abb..a7b3c9a 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -374,6 +374,7 @@ get_status_led() {
 	rb-941-2nd|\
 	rb-951ui-2nd|\
 	rb-952ui-5ac2nd|\
+	rb-953gs-5hnt|\
 	rb-962uigs-5hact2hnt|\
 	rb-lhg-5nd|\
 	rb-map-2nd|\
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 3af2eee..00a919b 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -1082,6 +1082,9 @@ ar71xx_board_detect() {
 	*"RouterBOARD 952Ui-5ac2nD")
 		name="rb-952ui-5ac2nd"
 		;;
+	*"RouterBOARD 953GS-5HnT")
+		name="rb-953gs-5hnt"
+		;;
 	*"RouterBOARD 962UiGS-5HacT2HnT")
 		name="rb-962uigs-5hact2hnt"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
old mode 100755
new mode 100644
index ca1270b..61b5707
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -556,6 +556,7 @@ platform_check_image() {
 	rb-921gs-5hpacd-r2|\
 	rb-951g-2hnd|\
 	rb-951ui-2hnd|\
+	rb-953gs-5hnt|\
 	rb-2011l|\
 	rb-2011il|\
 	rb-2011ils|\
@@ -858,6 +859,7 @@ platform_do_upgrade() {
 	rb-921gs-5hpacd-r2|\
 	rb-951g-2hnd|\
 	rb-951ui-2hnd|\
+	rb-953gs-5hnt|\
 	rb-2011il|\
 	rb-2011ils|\
 	rb-2011l|\
diff --git a/target/linux/ar71xx/config-4.9 b/target/linux/ar71xx/config-4.9
index 8aa0b41..eccb3ac 100644
--- a/target/linux/ar71xx/config-4.9
+++ b/target/linux/ar71xx/config-4.9
@@ -175,6 +175,7 @@ CONFIG_ATH79=y
 # CONFIG_ATH79_MACH_RB91X is not set
 # CONFIG_ATH79_MACH_RB922 is not set
 # CONFIG_ATH79_MACH_RB95X is not set
+# CONFIG_ATH79_MACH_RB953GS is not set
 # CONFIG_ATH79_MACH_RBSPI is not set
 # CONFIG_ATH79_MACH_RBSXTLITE is not set
 # CONFIG_ATH79_MACH_RE355 is not set
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
index e7655b3..40474f7 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
+++ b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
@@ -1127,6 +1127,18 @@ config ATH79_MACH_RB95X
 	select ATH79_DEV_USB
 	select ATH79_ROUTERBOOT
 
+config ATH79_MACH_RB953GS
+	bool "MikroTik RouterBOARD 953GS support"
+	select SOC_QCA955X
+	select ATH79_DEV_ETH
+	select ATH79_DEV_GPIO_BUTTONS
+	select ATH79_DEV_LEDS_GPIO
+	select ATH79_DEV_NFC
+	select ATH79_DEV_SPI
+	select ATH79_DEV_USB
+	select ATH79_DEV_WMAC
+	select ATH79_ROUTERBOOT
+
 config ATH79_MACH_RB2011
 	bool "MikroTik RouterBOARD 2011 support"
 	select SOC_AR934X
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Makefile b/target/linux/ar71xx/files/arch/mips/ath79/Makefile
index 8800a7d..b874317 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/Makefile
+++ b/target/linux/ar71xx/files/arch/mips/ath79/Makefile
@@ -187,6 +187,7 @@ obj-$(CONFIG_ATH79_MACH_RB91X)			+= mach-rb91x.o
 obj-$(CONFIG_ATH79_MACH_RB922)			+= mach-rb922.o
 obj-$(CONFIG_ATH79_MACH_RB941)			+= mach-rb941.o
 obj-$(CONFIG_ATH79_MACH_RB95X)			+= mach-rb95x.o
+obj-$(CONFIG_ATH79_MACH_RB953GS)		+= mach-rb953.o
 obj-$(CONFIG_ATH79_MACH_RBSPI)			+= mach-rbspi.o
 obj-$(CONFIG_ATH79_MACH_RBSXTLITE)		+= mach-rbsxtlite.o
 obj-$(CONFIG_ATH79_MACH_RE355)			+= mach-re450.o
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb953.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb953.c
new file mode 100644
index 0000000..4f03c72
--- /dev/null
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb953.c
@@ -0,0 +1,321 @@
+/*
+ *  MikroTik RouterBOARD 953GS support
+ *
+ *  Copyright (C) 2018 Alexander Rumyankov <alex@rumyankovs.com>
+ *  Copyright (C) 2015 Gabor Juhos <juhosg@openwrt.org>
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ */
+
+#include <linux/phy.h>
+#include <linux/delay.h>
+#include <linux/platform_device.h>
+#include <linux/ath9k_platform.h>
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/nand.h>
+#include <linux/mtd/partitions.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/flash.h>
+#include <linux/routerboot.h>
+#include <linux/gpio.h>
+#include <linux/ar8216_platform.h>
+#include <linux/platform_data/phy-at803x.h>
+#include <linux/version.h>
+
+#include <asm/prom.h>
+#include <asm/mach-ath79/ath79.h>
+#include <asm/mach-ath79/ar71xx_regs.h>
+
+#include "common.h"
+#include "dev-gpio-buttons.h"
+#include "dev-eth.h"
+#include "dev-leds-gpio.h"
+#include "dev-m25p80.h"
+#include "dev-nfc.h"
+#include "dev-usb.h"
+#include "dev-spi.h"
+#include "dev-wmac.h"
+#include "machtypes.h"
+#include "pci.h"
+#include "routerboot.h"
+
+#define RB953GS_GPIO_NAND_NCE	23
+#define RB953GS_WMAC_CALDATA_OFFSET	0x1000
+
+#define RB_ROUTERBOOT_OFFSET	0x0000
+#define RB_ROUTERBOOT_MIN_SIZE	0xb000
+#define RB_HARD_CFG_SIZE	0x1000
+#define RB_BIOS_OFFSET		0xd000
+#define RB_BIOS_SIZE		0x1000
+#define RB_SOFT_CFG_OFFSET	0xf000
+#define RB_SOFT_CFG_SIZE	0x1000
+
+static struct mtd_partition rb953gs_spi_partitions[] = {
+	{
+		.name		= "routerboot",
+		.offset		= RB_ROUTERBOOT_OFFSET,
+		.mask_flags	= MTD_WRITEABLE,
+	}, {
+		.name		= "hard_config",
+		.size		= RB_HARD_CFG_SIZE,
+		.mask_flags	= MTD_WRITEABLE,
+	}, {
+		.name		= "bios",
+		.offset		= RB_BIOS_OFFSET,
+		.size		= RB_BIOS_SIZE,
+		.mask_flags	= MTD_WRITEABLE,
+	}, {
+		.name		= "soft_config",
+		.size		= RB_SOFT_CFG_SIZE,
+	}
+};
+
+static struct flash_platform_data rb953gs_spi_flash_data = {
+	.parts		= rb953gs_spi_partitions,
+	.nr_parts	= ARRAY_SIZE(rb953gs_spi_partitions),
+};
+
+static void __init rb953gs_init_partitions(const struct rb_info *info)
+{
+	rb953gs_spi_partitions[0].size = info->hard_cfg_offs;
+	rb953gs_spi_partitions[1].offset = info->hard_cfg_offs;
+	rb953gs_spi_partitions[3].offset = info->soft_cfg_offs;
+}
+
+static const struct ar8327_led_info rb953gs_leds_ar8327[] = {
+		AR8327_LED_INFO(PHY0_0, HW, "rb:green:port1"),
+		AR8327_LED_INFO(PHY1_0, HW, "rb:green:port2"),
+		AR8327_LED_INFO(PHY2_0, HW, "rb:green:port3"),
+		AR8327_LED_INFO(PHY3_0, HW, "rb:green:port4"),
+		AR8327_LED_INFO(PHY4_0, HW, "rb:green:port5"),
+};
+
+static struct ar8327_pad_cfg rb953gs_ar8327_pad0_cfg = {
+		.mode = AR8327_PAD_MAC_RGMII,
+		.txclk_delay_en = true,
+		.rxclk_delay_en = true,
+		.txclk_delay_sel = AR8327_CLK_DELAY_SEL1,
+		.rxclk_delay_sel = AR8327_CLK_DELAY_SEL2,
+		.mac06_exchange_dis = true,
+};
+
+static struct ar8327_pad_cfg rb953gs_ar8327_pad6_cfg = {
+		/* Use SGMII interface for GMAC6 of the AR8337 switch */
+		.mode = AR8327_PAD_MAC_SGMII,
+		.rxclk_delay_en = true,
+		.rxclk_delay_sel = AR8327_CLK_DELAY_SEL0,
+};
+
+static struct ar8327_led_cfg rb953gs_ar8327_led_cfg = {
+		.led_ctrl0 = 0xc737c737,
+		.led_ctrl1 = 0x00000000,
+		.led_ctrl2 = 0x00000000,
+		.led_ctrl3 = 0x0030c300,
+		.open_drain = false,
+};
+
+static struct ar8327_platform_data rb953gs_ar8327_data = {
+		.pad0_cfg = &rb953gs_ar8327_pad0_cfg,
+		.pad6_cfg = &rb953gs_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,
+		},
+		.led_cfg = &rb953gs_ar8327_led_cfg,
+		.num_leds = ARRAY_SIZE(rb953gs_leds_ar8327),
+		.leds = rb953gs_leds_ar8327,
+};
+
+static struct mdio_board_info rb953gs_mdio0_info[] = {
+		{
+				.bus_id = "ag71xx-mdio.0",
+				.phy_addr = 0,
+				.platform_data = &rb953gs_ar8327_data,
+		},
+};
+
+static void rb953gs_nand_select_chip(int chip_no)
+{
+	switch (chip_no) {
+	case 0:
+		gpio_set_value(RB953GS_GPIO_NAND_NCE, 0);
+		break;
+	default:
+		gpio_set_value(RB953GS_GPIO_NAND_NCE, 1);
+		break;
+	}
+	ndelay(500);
+}
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0)
+static struct nand_ecclayout rb953gs_nand_ecclayout = {
+	.eccbytes	= 6,
+	.eccpos		= { 8, 9, 10, 13, 14, 15 },
+	.oobavail	= 9,
+	.oobfree	= { { 0, 4 }, { 6, 2 }, { 11, 2 }, { 4, 1 } }
+};
+
+#else
+
+static int rb953gs_ooblayout_ecc(struct mtd_info *mtd, int section,
+				 struct mtd_oob_region *oobregion)
+{
+	switch (section) {
+	case 0:
+		oobregion->offset = 8;
+		oobregion->length = 3;
+		return 0;
+	case 1:
+		oobregion->offset = 13;
+		oobregion->length = 3;
+		return 0;
+	default:
+		return -ERANGE;
+	}
+}
+
+static int rb953gs_ooblayout_free(struct mtd_info *mtd, int section,
+				  struct mtd_oob_region *oobregion)
+{
+	switch (section) {
+	case 0:
+		oobregion->offset = 0;
+		oobregion->length = 4;
+		return 0;
+	case 1:
+		oobregion->offset = 4;
+		oobregion->length = 1;
+		return 0;
+	case 2:
+		oobregion->offset = 6;
+		oobregion->length = 2;
+		return 0;
+	case 3:
+		oobregion->offset = 11;
+		oobregion->length = 2;
+		return 0;
+	default:
+		return -ERANGE;
+	}
+}
+
+static const struct mtd_ooblayout_ops rb953gs_nand_ecclayout_ops = {
+	.ecc = rb953gs_ooblayout_ecc,
+	.free = rb953gs_ooblayout_free,
+};
+#endif /* < 4.6 */
+
+static int rb953gs_nand_scan_fixup(struct mtd_info *mtd)
+{
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0)
+	struct nand_chip *chip = mtd->priv;
+#else
+	struct nand_chip *chip = mtd_to_nand(mtd);
+#endif /* < 4.6.0 */
+
+	if (mtd->writesize == 512) {
+		/*
+		 * Use the OLD Yaffs-1 OOB layout, otherwise RouterBoot
+		 * will not be able to find the kernel that we load.
+		 */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0)
+		chip->ecc.layout = &rb953gs_nand_ecclayout;
+#else
+		mtd_set_ooblayout(mtd, &rb953gs_nand_ecclayout_ops);
+#endif
+	}
+
+	chip->options = NAND_NO_SUBPAGE_WRITE;
+
+	return 0;
+}
+
+static struct mtd_partition rb953gs_nand_partitions[] = {
+	{
+		.name	= "booter",
+		.offset	= 0,
+		.size	= (256 * 1024),
+		.mask_flags = MTD_WRITEABLE,
+	},
+	{
+		.name	= "kernel",
+		.offset	= (256 * 1024),
+		.size	= (4 * 1024 * 1024) - (256 * 1024),
+	},
+	{
+		.name	= "ubi",
+		.offset	= MTDPART_OFS_NXTBLK,
+		.size	= MTDPART_SIZ_FULL,
+	},
+};
+
+static void __init rb953gs_nand_init(void)
+{
+	gpio_request_one(RB953GS_GPIO_NAND_NCE, GPIOF_OUT_INIT_HIGH, "NAND nCE");
+
+	ath79_nfc_set_scan_fixup(rb953gs_nand_scan_fixup);
+	ath79_nfc_set_parts(rb953gs_nand_partitions,
+			    ARRAY_SIZE(rb953gs_nand_partitions));
+	ath79_nfc_set_select_chip(rb953gs_nand_select_chip);
+	ath79_nfc_set_swap_dma(true);
+	ath79_register_nfc();
+}
+
+static void __init rb953gs_setup(void)
+{
+	const struct rb_info *info;
+	char *art_buf;
+	u8 wlan_mac[ETH_ALEN];
+
+
+	info = rb_init_info((void *) KSEG1ADDR(0x1f000000), 0x10000);
+	if (!info)
+		return;
+
+	art_buf = rb_get_wlan_data();
+	if (art_buf == NULL)
+		return;
+
+	rb953gs_init_partitions(info);
+
+	ath79_register_m25p80(&rb953gs_spi_flash_data);
+
+	rb953gs_nand_init();
+
+	ath79_register_mdio(0, 0x0);
+
+	mdiobus_register_board_info(rb953gs_mdio0_info,
+				    ARRAY_SIZE(rb953gs_mdio0_info));
+
+	ath79_setup_qca955x_eth_cfg(QCA955X_ETH_CFG_RGMII_EN);
+
+	ath79_eth0_pll_data.pll_1000 = 0x82000101;
+    ath79_eth0_pll_data.pll_100 = 0x80000101;
+    ath79_eth0_pll_data.pll_10 = 0x80001313;
+
+	ath79_init_mac(ath79_eth0_data.mac_addr, ath79_mac_base, 0);
+	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);
+
+	ath79_init_mac(wlan_mac, ath79_mac_base, 5);
+	ath79_register_wmac(art_buf + 0x1000, wlan_mac);
+
+    ath79_register_pci();
+	ath79_register_usb();
+}
+
+MIPS_MACHINE(ATH79_MACH_RB_953GS, "953gs", "MikroTik RouterBOARD 953GS-5HnT", rb953gs_setup);
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
index 390ec0b..189529d 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
+++ b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
@@ -217,6 +217,7 @@ enum ath79_mach_type {
 	ATH79_MACH_RB_951G,			/* Mikrotik RouterBOARD 951G */
 	ATH79_MACH_RB_951U,			/* Mikrotik RouterBOARD 951Ui-2HnD */
 	ATH79_MACH_RB_952,			/* MikroTik RouterBOARD 951Ui-2nD / 952Ui-5ac2nD */
+	ATH79_MACH_RB_953GS,			/* Mikrotik RouterBOARD 953GS-5HnT-RP */
 	ATH79_MACH_RB_962,			/* MikroTik RouterBOARD 962UiGS-5HacT2HnT */
 	ATH79_MACH_RB_CAP,			/* Mikrotik RouterBOARD cAP2nD */
 	ATH79_MACH_RB_LHG5,			/* Mikrotik RouterBOARD LHG5 */
diff --git a/target/linux/ar71xx/image/mikrotik.mk b/target/linux/ar71xx/image/mikrotik.mk
index dc0066d..a2d3465 100644
--- a/target/linux/ar71xx/image/mikrotik.mk
+++ b/target/linux/ar71xx/image/mikrotik.mk
@@ -29,7 +29,7 @@ define Device/nand-large-ac
   DEVICE_TITLE := MikroTik RouterBoard (>= 128 MB NAND, 802.11ac)
   DEVICE_PACKAGES += kmod-ath10k ath10k-firmware-qca988x
   KERNEL := kernel-bin | kernel2minor -s 2048 -e -c
-  SUPPORTED_DEVICES := rb-921gs-5hpacd-r2
+  SUPPORTED_DEVICES := rb-921gs-5hpacd-r2 rb-953gs-5hnt
 endef
 TARGET_DEVICES += nand-large-ac
 
diff --git a/target/linux/ar71xx/mikrotik/config-default b/target/linux/ar71xx/mikrotik/config-default
index e324e4c..7cc4602 100644
--- a/target/linux/ar71xx/mikrotik/config-default
+++ b/target/linux/ar71xx/mikrotik/config-default
@@ -13,6 +13,7 @@ CONFIG_ATH79_MACH_RB750=y
 CONFIG_ATH79_MACH_RB91X=y
 CONFIG_ATH79_MACH_RB922=y
 CONFIG_ATH79_MACH_RB95X=y
+CONFIG_ATH79_MACH_RB953GS=y
 CONFIG_ATH79_MACH_RBSPI=y
 CONFIG_ATH79_MACH_RBSXTLITE=y
 CONFIG_ATH79_PCI_ATH9K_FIXUP=y

Hello!
Is there any progress? I have 953GS-5HnT and would like to test.
I adapted the patch to today's trunk, build, loaded image into memory via the bootloader, configured /etc/setup/network, got a working switch, LAN, WAN (VLAN 1 and 2), Wi-Fi, USB.
But you also need SFP, mini-PCIe (for SIM7600E LTE module). 8(

2019-01-23 14:43:07 SFP2 now work!

Is there any news?
I have worked 1 PCIe (USB LTE), 1 SFP (eth1 CPU), MTU up to 4072 (with strange error(?) patch in net/ethernet/eth.c).

Hi, no progress yet :frowning: I've device on hand, but still have no success with second PCI and SFP ports.
Could you please share your patches for SFP1 and SFP2 to move the progress a bit farther?

I was only talking about SFP2. Only one. No progress for more.

Allow jumbo frame patch (for kernel tree):

---
--- a/net/ethernet/eth.c        2019-03-18 11:24:15.652850885 +0300
+++ b/net/ethernet/eth.c        2019-03-18 11:32:03.284519214 +0300
@@ -381,7 +381,7 @@
        dev->min_header_len     = ETH_HLEN;
        dev->mtu                = ETH_DATA_LEN;
        dev->min_mtu            = ETH_MIN_MTU;
-       dev->max_mtu            = ETH_DATA_LEN;
+       dev->max_mtu            = ETH_MAX_MTU;
        dev->addr_len           = ETH_ALEN;
        dev->tx_queue_len       = DEFAULT_TX_QUEUE_LEN;
        dev->flags              = IFF_BROADCAST|IFF_MULTICAST;

Strange code in the kernel because ETH_DATA_LEN is set to 1500 bytes.
Version of the patch with my changes:

diff -rNu a/target/linux/ar71xx/base-files/etc/board.d/02_network b/target/linux/ar71xx/base-files/etc/board.d/02_network
--- a/target/linux/ar71xx/base-files/etc/board.d/02_network     2019-03-04 14:54:30.183245586 +0300
+++ b/target/linux/ar71xx/base-files/etc/board.d/02_network     2019-03-04 14:54:54.398808563 +0300
@@ -207,6 +207,7 @@
        rb-750gl|\
        rb-751g|\
        rb-951g-2hnd|\
+       rb-953gs-5hnt|\
        rb-962uigs-5hact2hnt|\
        wlr8100|\
        wzr-hp-g450h)
diff -rNu a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
--- a/target/linux/ar71xx/base-files/etc/diag.sh        2019-03-04 14:54:30.183245586 +0300
+++ b/target/linux/ar71xx/base-files/etc/diag.sh        2019-03-04 14:54:54.398808563 +0300
@@ -377,6 +377,7 @@
        rb-941-2nd|\
        rb-951ui-2nd|\
        rb-952ui-5ac2nd|\
+       rb-953gs-5hnt|\
        rb-962uigs-5hact2hnt|\
        rb-lhg-5nd|\
        rb-map-2nd|\
diff -rNu a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh      2019-03-04 14:54:30.183245586 +0300
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh      2019-03-04 14:54:54.402808490 +0300
@@ -1107,6 +1107,9 @@
        *"RouterBOARD 952Ui-5ac2nD")
                name="rb-952ui-5ac2nd"
                ;;
+       *"RouterBOARD 953GS-5HnT")
+               name="rb-953gs-5hnt"
+               ;;
        *"RouterBOARD 962UiGS-5HacT2HnT")
                name="rb-962uigs-5hact2hnt"
                ;;
diff -rNu a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh    2019-03-04 14:54:30.183245586 +0300
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh    2019-03-04 14:54:54.402808490 +0300
@@ -559,6 +559,7 @@
        rb-921gs-5hpacd-r2|\
        rb-951g-2hnd|\
        rb-951ui-2hnd|\
+       rb-953gs-5hnt|\
        rb-2011l|\
        rb-2011il|\
        rb-2011ils|\
@@ -878,6 +879,7 @@
        rb-921gs-5hpacd-r2|\
        rb-951g-2hnd|\
        rb-951ui-2hnd|\
+       rb-953gs-5hnt|\
        rb-2011il|\
        rb-2011ils|\
        rb-2011l|\
diff -rNu a/target/linux/ar71xx/config-4.14 b/target/linux/ar71xx/config-4.14
--- a/target/linux/ar71xx/config-4.14   2019-03-04 14:54:30.183245586 +0300
+++ b/target/linux/ar71xx/config-4.14   2019-03-04 14:54:54.402808490 +0300
@@ -178,6 +178,7 @@
 # CONFIG_ATH79_MACH_RB91X is not set
 # CONFIG_ATH79_MACH_RB922 is not set
 # CONFIG_ATH79_MACH_RB95X is not set
+# CONFIG_ATH79_MACH_RB953GS is not set
 # CONFIG_ATH79_MACH_RBSPI is not set
 # CONFIG_ATH79_MACH_RBSXTLITE is not set
 # CONFIG_ATH79_MACH_RE355 is not set
diff -rNu a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
--- a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt 2019-03-04 14:54:30.183245586 +0300
+++ b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt 2019-03-04 14:54:54.402808490 +0300
@@ -1150,6 +1150,18 @@
        select ATH79_DEV_USB
        select ATH79_ROUTERBOOT
 
+config ATH79_MACH_RB953GS
+       bool "MikroTik RouterBOARD 953GS support"
+       select SOC_QCA955X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_NFC
+       select ATH79_DEV_SPI
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+       select ATH79_ROUTERBOOT
+
 config ATH79_MACH_RB2011
        bool "MikroTik RouterBOARD 2011 support"
        select SOC_AR934X
diff -rNu a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb953.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb953.c
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb953.c    1970-01-01 03:00:00.000000000 +0300
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb953.c    2019-01-24 19:10:23.265044826 +0300
@@ -0,0 +1,385 @@
+/*
+ *  MikroTik RouterBOARD 953GS support
+ *
+ *  Copyright (C) 2018 Alexander Rumyankov <alex@rumyankovs.com>
+ *  Copyright (C) 2015 Gabor Juhos <juhosg@openwrt.org>
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ */
+
+#include <linux/version.h>
+#include <linux/phy.h>
+#include <linux/delay.h>
+#include <linux/platform_device.h>
+#include <linux/ath9k_platform.h>
+#include <linux/mtd/mtd.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,14,0)
+#include <linux/mtd/nand.h>
+#else
+#include <linux/mtd/rawnand.h>
+#endif
+#include <linux/mtd/partitions.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/flash.h>
+#include <linux/routerboot.h>
+#include <linux/gpio.h>
+#include <linux/ar8216_platform.h>
+#include <linux/platform_data/phy-at803x.h>
+
+#include <asm/prom.h>
+#include <asm/mach-ath79/ath79.h>
+#include <asm/mach-ath79/ar71xx_regs.h>
+
+#include "common.h"
+#include "dev-gpio-buttons.h"
+#include "dev-eth.h"
+#include "dev-leds-gpio.h"
+#include "dev-m25p80.h"
+#include "dev-nfc.h"
+#include "dev-usb.h"
+#include "dev-spi.h"
+#include "dev-wmac.h"
+#include "machtypes.h"
+#include "pci.h"
+#include "routerboot.h"
+
+#define RB953GS_GPIO_NAND_NCE  23
+#define RB953GS_GPIO_SFP_LOS   21
+#define RB953GS_WMAC_CALDATA_OFFSET    0x1000
+
+#define RB_ROUTERBOOT_OFFSET   0x0000
+#define RB_ROUTERBOOT_MIN_SIZE 0xb000
+#define RB_HARD_CFG_SIZE       0x1000
+#define RB_BIOS_OFFSET         0xd000
+#define RB_BIOS_SIZE           0x1000
+#define RB_SOFT_CFG_OFFSET     0xf000
+#define RB_SOFT_CFG_SIZE       0x1000
+
+#define RB953GS_FLAG_SFP         BIT(0)
+
+static struct mtd_partition rb953gs_spi_partitions[] = {
+       {
+               .name           = "routerboot",
+               .offset         = RB_ROUTERBOOT_OFFSET,
+               .mask_flags     = MTD_WRITEABLE,
+       }, {
+               .name           = "hard_config",
+               .size           = RB_HARD_CFG_SIZE,
+               .mask_flags     = MTD_WRITEABLE,
+       }, {
+               .name           = "bios",
+               .offset         = RB_BIOS_OFFSET,
+               .size           = RB_BIOS_SIZE,
+               .mask_flags     = MTD_WRITEABLE,
+       }, {
+               .name           = "soft_config",
+               .size           = RB_SOFT_CFG_SIZE,
+       }
+};
+
+static struct flash_platform_data rb953gs_spi_flash_data = {
+       .parts          = rb953gs_spi_partitions,
+       .nr_parts       = ARRAY_SIZE(rb953gs_spi_partitions),
+};
+
+static void __init rb953gs_init_partitions(const struct rb_info *info)
+{
+       rb953gs_spi_partitions[0].size = info->hard_cfg_offs;
+       rb953gs_spi_partitions[1].offset = info->hard_cfg_offs;
+       rb953gs_spi_partitions[3].offset = info->soft_cfg_offs;
+}
+
+static const struct ar8327_led_info rb953gs_leds_ar8327[] = {
+               AR8327_LED_INFO(PHY0_0, HW, "rb:green:port1"),
+               AR8327_LED_INFO(PHY1_0, HW, "rb:green:port2"),
+               AR8327_LED_INFO(PHY2_0, HW, "rb:green:port3"),
+               AR8327_LED_INFO(PHY3_0, HW, "rb:green:port4"),
+               AR8327_LED_INFO(PHY4_0, HW, "rb:green:port5"),
+};
+
+static struct ar8327_pad_cfg rb953gs_ar8327_pad0_cfg = {
+               .mode = AR8327_PAD_MAC_RGMII,
+               .txclk_delay_en = true,
+               .rxclk_delay_en = true,
+//             .sgmii_delay_en = true,
+               .txclk_delay_sel = AR8327_CLK_DELAY_SEL1,
+               .rxclk_delay_sel = AR8327_CLK_DELAY_SEL2,
+               .mac06_exchange_dis = true,
+};
+
+static struct ar8327_pad_cfg rb953gs_ar8327_pad5_cfg = {
+               /* Use SGMII interface for GMAC5 of the AR8337 switch */
+               .mode = AR8327_PAD_MAC2MAC_GMII,
+               .rxclk_delay_en = true,
+               .rxclk_delay_sel = AR8327_CLK_DELAY_SEL0,
+};
+static struct ar8327_pad_cfg rb953gs_ar8327_pad6_cfg = {
+               /* Use SGMII interface for GMAC6 of the AR8337 switch */
+               .mode = AR8327_PAD_MAC_SGMII,
+               .rxclk_delay_en = true,
+               .rxclk_delay_sel = AR8327_CLK_DELAY_SEL0,
+};
+static struct ar8327_sgmii_cfg rb953gs_ar8327_sgmii_cfg;
+
+static struct ar8327_led_cfg rb953gs_ar8327_led_cfg = {
+               .led_ctrl0 = 0xc737c737,
+               .led_ctrl1 = 0x00000000,
+               .led_ctrl2 = 0x00000000,
+               .led_ctrl3 = 0x0030c300,
+               .open_drain = false,
+};
+
+static struct ar8327_platform_data rb953gs_ar8327_data = {
+               .pad0_cfg = &rb953gs_ar8327_pad0_cfg,
+               .pad5_cfg = &rb953gs_ar8327_pad5_cfg,
+               .pad6_cfg = &rb953gs_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,
+               },
+               .led_cfg = &rb953gs_ar8327_led_cfg,
+               .num_leds = ARRAY_SIZE(rb953gs_leds_ar8327),
+               .leds = rb953gs_leds_ar8327,
+};
+
+static struct mdio_board_info rb953gs_mdio0_info[] = {
+               {
+                               .bus_id = "ag71xx-mdio.0",
+                               .mdio_addr = 0,
+                               .platform_data = &rb953gs_ar8327_data,
+               },
+};
+
+static void rb953gs_nand_select_chip(int chip_no)
+{
+       switch (chip_no) {
+       case 0:
+               gpio_set_value(RB953GS_GPIO_NAND_NCE, 0);
+               break;
+       default:
+               gpio_set_value(RB953GS_GPIO_NAND_NCE, 1);
+               break;
+       }
+       ndelay(500);
+}
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0)
+static struct nand_ecclayout rb953gs_nand_ecclayout = {
+       .eccbytes       = 6,
+       .eccpos         = { 8, 9, 10, 13, 14, 15 },
+       .oobavail       = 9,
+       .oobfree        = { { 0, 4 }, { 6, 2 }, { 11, 2 }, { 4, 1 } }
+};
+
+#else
+
+static int rb953gs_ooblayout_ecc(struct mtd_info *mtd, int section,
+                                struct mtd_oob_region *oobregion)
+{
+       switch (section) {
+       case 0:
+               oobregion->offset = 8;
+               oobregion->length = 3;
+               return 0;
+       case 1:
+               oobregion->offset = 13;
+               oobregion->length = 3;
+               return 0;
+       default:
+               return -ERANGE;
+       }
+}
+
+static int rb953gs_ooblayout_free(struct mtd_info *mtd, int section,
+                                 struct mtd_oob_region *oobregion)
+{
+       switch (section) {
+       case 0:
+               oobregion->offset = 0;
+               oobregion->length = 4;
+               return 0;
+       case 1:
+               oobregion->offset = 4;
+               oobregion->length = 1;
+               return 0;
+       case 2:
+               oobregion->offset = 6;
+               oobregion->length = 2;
+               return 0;
+       case 3:
+               oobregion->offset = 11;
+               oobregion->length = 2;
+               return 0;
+       default:
+               return -ERANGE;
+       }
+}
+
+static const struct mtd_ooblayout_ops rb953gs_nand_ecclayout_ops = {
+       .ecc = rb953gs_ooblayout_ecc,
+       .free = rb953gs_ooblayout_free,
+};
+#endif /* < 4.6 */
+
+static int rb953gs_nand_scan_fixup(struct mtd_info *mtd)
+{
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0)
+       struct nand_chip *chip = mtd->priv;
+#else
+       struct nand_chip *chip = mtd_to_nand(mtd);
+#endif /* < 4.6.0 */
+
+       if (mtd->writesize == 512) {
+               /*
+                * Use the OLD Yaffs-1 OOB layout, otherwise RouterBoot
+                * will not be able to find the kernel that we load.
+                */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0)
+               chip->ecc.layout = &rb953gs_nand_ecclayout;
+#else
+               mtd_set_ooblayout(mtd, &rb953gs_nand_ecclayout_ops);
+#endif
+       }
+
+       chip->options = NAND_NO_SUBPAGE_WRITE;
+
+       return 0;
+}
+
+static struct mtd_partition rb953gs_nand_partitions[] = {
+       {
+               .name   = "booter",
+               .offset = 0,
+               .size   = (256 * 1024),
+               .mask_flags = MTD_WRITEABLE,
+       },
+       {
+               .name   = "kernel",
+               .offset = (256 * 1024),
+               .size   = (4 * 1024 * 1024) - (256 * 1024),
+       },
+       {
+               .name   = "ubi",
+               .offset = MTDPART_OFS_NXTBLK,
+               .size   = MTDPART_SIZ_FULL,
+       },
+};
+
+static void __init rb953gs_nand_init(void)
+{
+       gpio_request_one(RB953GS_GPIO_NAND_NCE, GPIOF_OUT_INIT_HIGH, "NAND nCE");
+
+       ath79_nfc_set_scan_fixup(rb953gs_nand_scan_fixup);
+       ath79_nfc_set_parts(rb953gs_nand_partitions,
+                           ARRAY_SIZE(rb953gs_nand_partitions));
+       ath79_nfc_set_select_chip(rb953gs_nand_select_chip);
+       ath79_nfc_set_swap_dma(true);
+       ath79_register_nfc();
+}
+
+static int rb953gs_get_port_link(unsigned port)
+{
+       if (port != 6)
+               return -EINVAL;
+
+       /* The Loss of signal line is active low */
+       return !gpio_get_value(RB953GS_GPIO_SFP_LOS);
+}
+
+static void __init rb953gs_sfp_init(void)
+{
+       gpio_request_one(RB953GS_GPIO_SFP_LOS, GPIOF_IN, "SFP LOS");
+
+       rb953gs_ar8327_pad5_cfg.mode = AR8327_PAD_MAC_RGMII;
+       rb953gs_ar8327_pad6_cfg.mode = AR8327_PAD_MAC_SGMII;
+
+       rb953gs_ar8327_data.pad5_cfg = &rb953gs_ar8327_pad5_cfg;
+       rb953gs_ar8327_data.pad6_cfg = &rb953gs_ar8327_pad6_cfg;
+
+       //rb953gs_ar8327_sgmii_cfg.sgmii_ctrl = 0xc70167d0;
+       rb953gs_ar8327_sgmii_cfg.serdes_aen = true;
+
+       rb953gs_ar8327_data.sgmii_cfg = &rb953gs_ar8327_sgmii_cfg;
+
+       rb953gs_ar8327_data.port6_cfg.force_link = 1;
+       rb953gs_ar8327_data.port6_cfg.speed = AR8327_PORT_SPEED_1000;
+       rb953gs_ar8327_data.port6_cfg.duplex = 1;
+
+       rb953gs_ar8327_data.get_port_link = rb953gs_get_port_link;
+}
+
+static void __init rb953gs_setup(void)
+{
+       const struct rb_info *info;
+       char *art_buf;
+       u8 wlan_mac[ETH_ALEN];
+
+
+       info = rb_init_info((void *) KSEG1ADDR(0x1f000000), 0x10000);
+       if (!info)
+               return;
+
+       art_buf = rb_get_wlan_data();
+       if (art_buf == NULL)
+               return;
+
+       rb953gs_init_partitions(info);
+
+       ath79_register_m25p80(&rb953gs_spi_flash_data);
+
+       rb953gs_nand_init();
+
+       ath79_register_mdio(0, 0x0);
+
+       mdiobus_register_board_info(rb953gs_mdio0_info,
+                                   ARRAY_SIZE(rb953gs_mdio0_info));
+
+       ath79_setup_qca955x_eth_cfg(QCA955X_ETH_CFG_RGMII_EN);
+
+       ath79_eth0_pll_data.pll_1000 = 0x82000101;
+       ath79_eth0_pll_data.pll_100 = 0x80000101;
+       ath79_eth0_pll_data.pll_10 = 0x80001313;
+//     ath79_eth0_pll_data.pll_1000 = 0x56000000;
+
+
+       ath79_eth1_pll_data.pll_1000 = 0x03000101;
+
+
+       /* GMAC0 is connected to an ar8327 switch */
+       ath79_init_mac(ath79_eth0_data.mac_addr, ath79_mac_base, 0);
+       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);
+
+       /* GMAC6 of the AR8327 switch is connected to GMAC0 via RGMII */
+        ath79_init_mac(ath79_eth1_data.mac_addr, ath79_mac_base, 5);
+        ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
+        ath79_eth1_data.speed = SPEED_1000;
+        ath79_eth1_data.duplex = DUPLEX_FULL;
+
+        ath79_register_eth(1);
+
+
+
+       ath79_init_mac(wlan_mac, ath79_mac_base, 5);
+       ath79_register_wmac(art_buf + 0x1000, wlan_mac);
+
+       ath79_register_pci();
+       rb953gs_sfp_init();
+       ath79_register_usb();
+}
+
+MIPS_MACHINE(ATH79_MACH_RB_953GS, "953gs", "MikroTik RouterBOARD 953GS-5HnT", rb953gs_setup);
diff -rNu a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
--- a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h     2019-03-04 14:54:30.195245369 +0300
+++ b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h     2019-03-04 14:54:54.402808490 +0300
@@ -221,6 +221,7 @@
        ATH79_MACH_RB_951G,                     /* Mikrotik RouterBOARD 951G */
        ATH79_MACH_RB_951U,                     /* Mikrotik RouterBOARD 951Ui-2HnD */
        ATH79_MACH_RB_952,                      /* MikroTik RouterBOARD 951Ui-2nD / 952Ui-5ac2nD */
+       ATH79_MACH_RB_953GS,                    /* Mikrotik RouterBOARD 953GS-5HnT-RP */
        ATH79_MACH_RB_962,                      /* MikroTik RouterBOARD 962UiGS-5HacT2HnT */
        ATH79_MACH_RB_CAP,                      /* Mikrotik RouterBOARD cAP2nD */
        ATH79_MACH_RB_LHG5,                     /* Mikrotik RouterBOARD LHG5 */
diff -rNu a/target/linux/ar71xx/files/arch/mips/ath79/Makefile b/target/linux/ar71xx/files/arch/mips/ath79/Makefile
--- a/target/linux/ar71xx/files/arch/mips/ath79/Makefile        2019-03-04 14:54:30.183245586 +0300
+++ b/target/linux/ar71xx/files/arch/mips/ath79/Makefile        2019-03-04 14:54:54.402808490 +0300
@@ -189,6 +189,7 @@
 obj-$(CONFIG_ATH79_MACH_RB922)                 += mach-rb922.o
 obj-$(CONFIG_ATH79_MACH_RB941)                 += mach-rb941.o
 obj-$(CONFIG_ATH79_MACH_RB95X)                 += mach-rb95x.o
+obj-$(CONFIG_ATH79_MACH_RB953GS)               += mach-rb953.o
 obj-$(CONFIG_ATH79_MACH_RBSPI)                 += mach-rbspi.o
 obj-$(CONFIG_ATH79_MACH_RBSXTLITE)             += mach-rbsxtlite.o
 obj-$(CONFIG_ATH79_MACH_RE355)                 += mach-re450.o
diff -rNu a/target/linux/ar71xx/image/mikrotik.mk b/target/linux/ar71xx/image/mikrotik.mk
--- a/target/linux/ar71xx/image/mikrotik.mk     2019-03-04 14:54:30.199245297 +0300
+++ b/target/linux/ar71xx/image/mikrotik.mk     2019-03-04 14:55:22.314304660 +0300
@@ -36,7 +36,7 @@
   MIKROTIK_CHUNKSIZE := 2048
   DEVICE_TITLE := MikroTik RouterBoard (>= 128 MB NAND, 802.11ac)
   DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct
-  SUPPORTED_DEVICES := rb-921gs-5hpacd-r2
+  SUPPORTED_DEVICES := rb-921gs-5hpacd-r2 rb-953gs-5hnt
 endef
 TARGET_DEVICES += nand-large-ac
 
diff -rNu a/target/linux/ar71xx/mikrotik/config-default b/target/linux/ar71xx/mikrotik/config-default
--- a/target/linux/ar71xx/mikrotik/config-default       2019-03-04 14:54:30.199245297 +0300
+++ b/target/linux/ar71xx/mikrotik/config-default       2019-03-04 14:54:54.402808490 +0300
@@ -13,6 +13,7 @@
 CONFIG_ATH79_MACH_RB91X=y
 CONFIG_ATH79_MACH_RB922=y
 CONFIG_ATH79_MACH_RB95X=y
+CONFIG_ATH79_MACH_RB953GS=y
 CONFIG_ATH79_MACH_RBSPI=y
 CONFIG_ATH79_MACH_RBSXTLITE=y
 CONFIG_ATH79_PCI_ATH9K_FIXUP=y

With the trunk change, small patch edits may be required.

Now I have 1 SFP, switch, PCIe LTE card, Jumbo frame.
It looks like one SFP is connected to the switch since all RGMII are busy (SFP2 and switch) but I am unable to initialize it. You may need to power on via GPIO.

All this is used for L3 VPN + BGP + L2TPv3 + NETNS (network namespaces).

1 Like

Thanks for the SFP init.
Yes, the SFP cage 1 connected to the switch.

As I wrote.

It may be necessary to power on the SFP using GPIO or initialize the switch port, but I have not found a solution yet. But the second worker SFP would be useful.

They are commonly using one the AR8327 LED pins to power SFP port.
You can check out the RB3011 thread for it

1 Like

YES!
Thanks for the tip! Changed only one bit — and now both SFP work!

root@953GS-5HnT:~# swconfig dev switch0 show | grep link
        link: port:0 link:up speed:1000baseT full-duplex txflow rxflow 
        link: port:1 link:down
        link: port:2 link:up speed:1000baseT full-duplex txflow rxflow eee100 eee1000 auto
        link: port:3 link:down
        link: port:4 link:down
        link: port:5 link:down
        link: port:6 link:up speed:1000baseT full-duplex txflow rxflow

Changes in target/linux/ar71xx/files/arch/mips/ath79/mach-rb953.c:

--- a   2019-03-19 13:34:26.443880443 +0300
+++ b   2019-04-29 16:52:59.803341006 +0300
@@ -130,7 +130,7 @@
                .led_ctrl0 = 0xc737c737,
                .led_ctrl1 = 0x00000000,
                .led_ctrl2 = 0x00000000,
-               .led_ctrl3 = 0x0030c300,
+               .led_ctrl3 = 0x0230c300,
                .open_drain = false,
 };

Awesome, so it was just missing power then.

It remains only to make the correct indication of the SFP LED and the second mini-PCIe.

My native language is Russian. / Мой родной язык — русский. :slight_smile:

Great! For the second PCI - it shares power with USB port, so we need to figure out GPIO to turn it off/on. I've found that RB912UAG and RB953GS have partially shared USB port and miniPCIe slot.
For RB912UAG the way to enable miniPCI is:

# Make GPIO available in Linux
echo "52" > /sys/class/gpio/export

# Power-off USB port.
echo "0" > /sys/class/gpio/gpio52/value

So we can try do the same.

P.S.:
My native language is Russian as well :slight_smile:

could you please share /etc/config/network btw?

Changed:

config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config interface 'lan'
        option type 'bridge'
        option ifname 'eth0.1'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'

config switch
        option name 'switch0'
        option reset '1'
        option enable_vlan '1'

config switch_vlan
        option device 'switch0'
        option vlan '1'
        option vid '1'
        option ports '0t 2 3 4 5'

config switch_vlan
        option device 'switch0'
        option vlan '2'
        option ports '0t 1'
        option vid '2'

config interface 'LTE'
        option proto 'qmi'
        option device '/dev/cdc-wdm0'
        option delegate '0'
        option apn 'apn.here'
        option auth 'none'

Eth1 removed from config

I guess I jumped the gun and took wishful thinking. 8(
With the bit mask change, the power is really supplied, the SFP works, the external switch sees a link (I use Cisco GLC-T 1000BASE-T SFP module and managed gigabit switch), but on the internal switch the port does not up, which is even seen in my message (port 0 — CPU, port 6 — connected to SFP2). Of course, no data is transmitted. :frowning:
And there is no led control near SFP (rb:green:port4 and rb:green:port5 are not switch on via /sys).

I'm sorry to be so hasty.
I really wanted to believe it myself.

Are there any other developers interested?

Is there still someone else?