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