diff -Naur a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
--- a/arch/arm/boot/dts/Makefile	2019-09-10 12:32:22.000000000 +0300
+++ b/arch/arm/boot/dts/Makefile	2019-09-09 14:49:56.000000000 +0300
@@ -598,6 +598,7 @@
 	orion5x-lacie-ethernet-disk-mini-v2.dtb \
 	orion5x-linkstation-lsgl.dtb \
 	orion5x-linkstation-lswtgl.dtb \
+	orion5x-linksys-wrt350n-v2.dtb \
 	orion5x-lswsgl.dtb \
 	orion5x-maxtor-shared-storage-2.dtb \
 	orion5x-netgear-wnr854t.dtb \
diff -Naur a/arch/arm/boot/dts/orion5x-linksys-wrt350n-v2.dts b/arch/arm/boot/dts/orion5x-linksys-wrt350n-v2.dts
--- a/arch/arm/boot/dts/orion5x-linksys-wrt350n-v2.dts	1970-01-01 03:00:00.000000000 +0300
+++ b/arch/arm/boot/dts/orion5x-linksys-wrt350n-v2.dts	2019-10-02 19:18:38.066520820 +0300
@@ -0,0 +1,304 @@
+/*
+ * Copyright (C) 2019 <ValCher1961> for OpenWRT
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2. This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+/dts-v1/;
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+#include "orion5x-mv88f5181.dtsi"
+
+/ {
+	model = "Linksys WRT350N v2";
+	compatible = "linksys,wrt350n-v2", "marvell,orion5x-88f5181",
+		     "marvell,orion5x";
+	aliases {
+		serial0 = &uart0;
+	};
+
+	memory {
+		reg = <0x00000000 0x2000000>; /* 32 MB */
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
+
+	soc {
+		ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000
+			  MBUS_ID(0x09, 0x00) 0 0xf2200000 0x800
+			  MBUS_ID(0x01, 0x0f) 0 0xf4000000 0x800000>;
+	};
+
+	gpio-keys {
+		compatible = "gpio-keys";
+		pinctrl-0 = <&pmx_reset_button &pmx_wps_button>;
+		pinctrl-names = "default";
+
+		reset {
+			label = "Reset Button";
+			linux,code = <KEY_RESTART>;
+			gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
+		};
+
+		wps {
+			label = "WPS Button";
+			linux,code = <KEY_WPS_BUTTON>;
+			gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
+		};
+
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+		pinctrl-0 = <	&pmx_power_green_led
+				&pmx_power_orange_led
+				&pmx_security_led
+				&pmx_usb_led
+				&pmx_wireless_led>;
+
+		pinctrl-names = "default";
+
+		led@0 {
+			label = "wrt350nv2:green:power";
+			gpios = <&gpio0 0 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "default-on";
+		};
+
+		led@1 {
+			label = "wrt350nv2:green:security";
+			gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
+		};
+
+		led@2 {
+			label = "wrt350nv2:orange:power";
+			gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
+		};
+
+		led@3 {
+			label = "wrt350nv2:green:usb";
+			gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "usbport";
+		};
+
+		led@4 {
+			label = "wrt350nv2:green:wireless";
+			gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "phy0tpt";
+		};
+	};
+};
+
+&devbus_bootcs {
+	status = "okay";
+
+	devbus,keep-config;
+
+	flash@0 {
+		compatible = "cfi-flash";
+		reg = <0 0x800000>;
+		bank-width = <1>;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition@0 {
+				label = "kernel";
+				reg = <0x0 0x760000>;
+			};
+			partition@1a0000 {
+				label = "rootfs";
+				reg = <0x1a0000 0x5c0000>;
+			};
+
+			partition@760000 {
+				label = "lang";
+				reg = <0x760000 0x40000>;
+			};
+
+			partition@7a0000 {
+				label = "nvram";
+				reg = <0x7a0000 0x20000>;
+			};
+
+			partition@7c0000 {
+				label = "uboot";
+				reg = <0x7c0000 0x40000>;
+				read-only;
+			};
+
+			partition@7a0000 {
+				label = "eRcOmM_do_not_touch";
+				reg = <0x750000 0x10000>;
+			};
+
+			partition@7c0000 {
+				label = "image";
+				reg = <0x0 0x750000>;
+				read-only;
+			};
+		};
+	};
+};
+
+&mdio {
+	status = "okay";
+
+	switch: switch@0 {
+		compatible = "marvell,mv88e6085";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		reg = <0>;
+		dsa,member = <0 0>;
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			port@0 {
+				reg = <0>;
+				label = "lan2";
+				phy-handle = <&lan2phy>;
+			};
+
+			port@1 {
+				reg = <1>;
+				label = "lan1";
+				phy-handle = <&lan1phy>;
+			};
+
+			port@2 {
+				reg = <2>;
+				label = "wan";
+				phy-handle = <&wanphy>;
+			};
+
+			port@3 {
+				reg = <3>;
+				label = "cpu";
+				ethernet = <&ethport>;
+
+				fixed-link {
+					speed = <1000>;
+					full-duplex;
+				};
+			};
+
+			port@5 {
+				reg = <5>;
+				label = "lan3";
+				phy-handle = <&lan3phy>;
+			};
+
+			port@7 {
+				reg = <7>;
+				label = "lan4";
+				phy-handle = <&lan4phy>;
+			};
+		};
+
+		mdio {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			lan2phy: ethernet-phy@0 {
+				compatible = "ethernet-phy-id0141.0cb0";
+				reg = <0>;
+				phy-mode = "sgmii";
+				marvell,reg-init = <3 16 0 0xf 3 17 0 0x10>;
+			};
+
+			lan1phy: ethernet-phy@1 {
+				compatible = "ethernet-phy-id0141.0cb0";
+				reg = <1>;
+				phy-mode = "sgmii";
+				marvell,reg-init = <3 16 0 0xf 3 17 0 0x10>;
+			};
+
+			wanphy: ethernet-phy@2 {
+				compatible = "ethernet-phy-id0141.0cb0";
+				reg = <2>;
+				phy-mode = "sgmii";
+				 marvell,reg-init = <3 16 0 0xf 3 17 0 0x10>;
+			};
+
+			lan3phy: ethernet-phy@5 {
+				compatible = "ethernet-phy-id0141.0cb0";
+				reg = <5>;
+				phy-mode = "sgmii";
+				marvell,reg-init = <3 16 0 0xf 3 17 0 0x10>;
+			};
+
+			lan4phy: ethernet-phy@7 {
+				compatible = "ethernet-phy-id0141.0cb0";
+				reg = <7>;
+				phy-mode = "sgmii";
+				marvell,reg-init = <3 16 0 0xf 3 17 0 0x10>;
+			};
+		};
+	};
+};
+
+&eth {
+	status = "okay";
+	phy-mode = "rgmii";
+
+	ethernet-port@0 {
+		/* Hardwired to DSA switch */
+		speed = <1000>;
+		full-duplex;
+	};
+};
+
+&pinctrl {
+	pinctrl-0 = <&pmx_pci_gpios>;
+	pinctrl-names = "default";
+
+	pmx_power_green_led: power-green-led {
+		marvell,pins = "mpp0";
+		marvell,function = "gpio";
+	};
+
+	pmx_security_led: security-led {
+		marvell,pins = "mpp1";
+		marvell,function = "gpio";
+	};
+
+	pmx_wps_button: wps-button {
+		marvell,pins = "mpp2";
+		marvell,function = "gpio";
+	};
+
+	pmx_reset_button: reset-button {
+		marvell,pins = "mpp3";
+		marvell,function = "gpio";
+	};
+
+	pmx_power_orange_led: power-orange-led {
+		marvell,pins = "mpp5";
+		marvell,function = "gpio";
+	};
+
+	pmx_usb_led: usb-led {
+		marvell,pins = "mpp6";
+		marvell,function = "gpio";
+	};
+
+	pmx_wireless_led: wireless-led {
+		marvell,pins = "mpp7";
+		marvell,function = "gpio";
+	};
+
+	pmx_pci_gpios: pci-gpios {
+		marvell,pins = "mpp4";
+		marvell,function = "gpio";
+	};
+};
+
+&uart0 {
+	status = "okay";
+};
+
+&ehci0 {
+	status = "okay";
+};
+
+&i2c {
+	status = "okay";
+};
diff -Naur a/arch/arm/mach-orion5x/Kconfig b/arch/arm/mach-orion5x/Kconfig
--- a/arch/arm/mach-orion5x/Kconfig	2019-09-10 12:32:22.000000000 +0300
+++ b/arch/arm/mach-orion5x/Kconfig	2019-09-10 19:41:57.000000000 +0300
@@ -111,6 +111,7 @@
 
 config MACH_WRT350N_V2
 	bool "Linksys WRT350N v2"
+	select ARCH_ORION5X_DT
 	help
 	  Say 'Y' here if you want your kernel to support the
 	  Linksys WRT350N v2 platform.
diff -Naur a/arch/arm/mach-orion5x/wrt350n-v2-setup.c b/arch/arm/mach-orion5x/wrt350n-v2-setup.c
--- a/arch/arm/mach-orion5x/wrt350n-v2-setup.c	2019-09-10 12:32:22.000000000 +0300
+++ b/arch/arm/mach-orion5x/wrt350n-v2-setup.c	2019-09-13 22:31:59.000000000 +0300
@@ -5,222 +5,22 @@
  * License version 2.  This program is licensed "as is" without any
  * warranty of any kind, whether express or implied.
  */
-#include <linux/gpio.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
 #include <linux/pci.h>
 #include <linux/irq.h>
-#include <linux/delay.h>
-#include <linux/mtd/physmap.h>
-#include <linux/mv643xx_eth.h>
-#include <linux/ethtool.h>
-#include <linux/leds.h>
-#include <linux/gpio_keys.h>
-#include <linux/input.h>
-#include <net/dsa.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/pci.h>
+#include <linux/gpio.h>
 #include "orion5x.h"
+#include "bridge-regs.h"
 #include "common.h"
-#include "mpp.h"
-
-/*
- * LEDs attached to GPIO
- */
-static struct gpio_led wrt350n_v2_led_pins[] = {
-	{
-		.name		= "wrt350nv2:green:power",
-		.gpio		= 0,
-		.active_low	= 1,
-	}, {
-		.name		= "wrt350nv2:green:security",
-		.gpio		= 1,
-		.active_low	= 1,
-	}, {
-		.name		= "wrt350nv2:orange:power",
-		.gpio		= 5,
-		.active_low	= 1,
-	}, {
-		.name		= "wrt350nv2:green:usb",
-		.gpio		= 6,
-		.active_low	= 1,
-	}, {
-		.name		= "wrt350nv2:green:wireless",
-		.gpio		= 7,
-		.active_low	= 1,
-	},
-};
-
-static struct gpio_led_platform_data wrt350n_v2_led_data = {
-	.leds		= wrt350n_v2_led_pins,
-	.num_leds	= ARRAY_SIZE(wrt350n_v2_led_pins),
-};
-
-static struct platform_device wrt350n_v2_leds = {
-	.name	= "leds-gpio",
-	.id	= -1,
-	.dev	= {
-		.platform_data	= &wrt350n_v2_led_data,
-	},
-};
-
-/*
- * Buttons attached to GPIO
- */
-static struct gpio_keys_button wrt350n_v2_buttons[] = {
-	{
-		.code		= KEY_RESTART,
-		.gpio		= 3,
-		.desc		= "Reset Button",
-		.active_low	= 1,
-	}, {
-		.code		= KEY_WPS_BUTTON,
-		.gpio		= 2,
-		.desc		= "WPS Button",
-		.active_low	= 1,
-	},
-};
-
-static struct gpio_keys_platform_data wrt350n_v2_button_data = {
-	.buttons	= wrt350n_v2_buttons,
-	.nbuttons	= ARRAY_SIZE(wrt350n_v2_buttons),
-};
-
-static struct platform_device wrt350n_v2_button_device = {
-	.name		= "gpio-keys",
-	.id		= -1,
-	.num_resources	= 0,
-	.dev		= {
-		.platform_data	= &wrt350n_v2_button_data,
-	},
-};
 
 /*
- * General setup
+ * PCI bus setup
  */
-static unsigned int wrt350n_v2_mpp_modes[] __initdata = {
-	MPP0_GPIO,		/* Power LED green (0=on) */
-	MPP1_GPIO,		/* Security LED (0=on) */
-	MPP2_GPIO,		/* Internal Button (0=on) */
-	MPP3_GPIO,		/* Reset Button (0=on) */
-	MPP4_GPIO,		/* PCI int */
-	MPP5_GPIO,		/* Power LED orange (0=on) */
-	MPP6_GPIO,		/* USB LED (0=on) */
-	MPP7_GPIO,		/* Wireless LED (0=on) */
-	MPP8_UNUSED,		/* ??? */
-	MPP9_GIGE,		/* GE_RXERR */
-	MPP10_UNUSED,		/* ??? */
-	MPP11_UNUSED,		/* ??? */
-	MPP12_GIGE,		/* GE_TXD[4] */
-	MPP13_GIGE,		/* GE_TXD[5] */
-	MPP14_GIGE,		/* GE_TXD[6] */
-	MPP15_GIGE,		/* GE_TXD[7] */
-	MPP16_GIGE,		/* GE_RXD[4] */
-	MPP17_GIGE,		/* GE_RXD[5] */
-	MPP18_GIGE,		/* GE_RXD[6] */
-	MPP19_GIGE,		/* GE_RXD[7] */
-	0,
-};
-
-/*
- * 8M NOR flash Device bus boot chip select
- */
-#define WRT350N_V2_NOR_BOOT_BASE	0xf4000000
-#define WRT350N_V2_NOR_BOOT_SIZE	SZ_8M
-
-static struct mtd_partition wrt350n_v2_nor_flash_partitions[] = {
-	{
-		.name		= "kernel",
-		.offset		= 0x00000000,
-		.size		= 0x00760000,
-	}, {
-		.name		= "rootfs",
-		.offset		= 0x001a0000,
-		.size		= 0x005c0000,
-	}, {
-		.name		= "lang",
-		.offset		= 0x00760000,
-		.size		= 0x00040000,
-	}, {
-		.name		= "nvram",
-		.offset		= 0x007a0000,
-		.size		= 0x00020000,
-	}, {
-		.name		= "u-boot",
-		.offset		= 0x007c0000,
-		.size		= 0x00040000,
-	},
-};
-
-static struct physmap_flash_data wrt350n_v2_nor_flash_data = {
-	.width		= 1,
-	.parts		= wrt350n_v2_nor_flash_partitions,
-	.nr_parts	= ARRAY_SIZE(wrt350n_v2_nor_flash_partitions),
-};
-
-static struct resource wrt350n_v2_nor_flash_resource = {
-	.flags		= IORESOURCE_MEM,
-	.start		= WRT350N_V2_NOR_BOOT_BASE,
-	.end		= WRT350N_V2_NOR_BOOT_BASE + WRT350N_V2_NOR_BOOT_SIZE - 1,
-};
-
-static struct platform_device wrt350n_v2_nor_flash = {
-	.name			= "physmap-flash",
-	.id			= 0,
-	.dev		= {
-		.platform_data	= &wrt350n_v2_nor_flash_data,
-	},
-	.num_resources		= 1,
-	.resource		= &wrt350n_v2_nor_flash_resource,
-};
-
-static struct mv643xx_eth_platform_data wrt350n_v2_eth_data = {
-	.phy_addr	= MV643XX_ETH_PHY_NONE,
-	.speed		= SPEED_1000,
-	.duplex		= DUPLEX_FULL,
-};
-
-static struct dsa_chip_data wrt350n_v2_switch_chip_data = {
-	.port_names[0]	= "lan2",
-	.port_names[1]	= "lan1",
-	.port_names[2]	= "wan",
-	.port_names[3]	= "cpu",
-	.port_names[5]	= "lan3",
-	.port_names[7]	= "lan4",
-};
-
-static struct dsa_platform_data __initdata wrt350n_v2_switch_plat_data = {
-	.nr_chips	= 1,
-	.chip		= &wrt350n_v2_switch_chip_data,
-};
-
-static void __init wrt350n_v2_init(void)
-{
-	/*
-	 * Setup basic Orion functions. Need to be called early.
-	 */
-	orion5x_init();
-
-	orion5x_mpp_conf(wrt350n_v2_mpp_modes);
-
-	/*
-	 * Configure peripherals.
-	 */
-	orion5x_ehci0_init();
-	orion5x_eth_init(&wrt350n_v2_eth_data);
-	orion5x_eth_switch_init(&wrt350n_v2_switch_plat_data);
-	orion5x_uart0_init();
-
-	mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
-				    ORION_MBUS_DEVBUS_BOOT_ATTR,
-				    WRT350N_V2_NOR_BOOT_BASE,
-				    WRT350N_V2_NOR_BOOT_SIZE);
-	platform_device_register(&wrt350n_v2_nor_flash);
-	platform_device_register(&wrt350n_v2_leds);
-	platform_device_register(&wrt350n_v2_button_device);
-}
 
 static int __init wrt350n_v2_pci_map_irq(const struct pci_dev *dev, u8 slot,
 	u8 pin)
@@ -257,17 +57,5 @@
 
 	return 0;
 }
-subsys_initcall(wrt350n_v2_pci_init);
 
-MACHINE_START(WRT350N_V2, "Linksys WRT350N v2")
-	/* Maintainer: Lennert Buytenhek <buytenh@marvell.com> */
-	.atag_offset	= 0x100,
-	.nr_irqs	= ORION5X_NR_IRQS,
-	.init_machine	= wrt350n_v2_init,
-	.map_io		= orion5x_map_io,
-	.init_early	= orion5x_init_early,
-	.init_irq	= orion5x_init_irq,
-	.init_time	= orion5x_timer_init,
-	.fixup		= tag_fixup_mem32,
-	.restart	= orion5x_restart,
-MACHINE_END
+subsys_initcall(wrt350n_v2_pci_init);
