linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] Add support for a series of MikroTik CRS3xx switches
@ 2020-07-24 10:38 Luka Kovacic
  2020-07-24 10:38 ` [PATCH 1/4] arm: mvebu: dts: Add CRS326-24G-2S board Luka Kovacic
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Luka Kovacic @ 2020-07-24 10:38 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel
  Cc: jason, andrew, gregory.clement, sebastian.hesselbarth, Luka Kovacic

These patches add support for a series of MikroTik CRS3xx switches
based on the Marvell Prestera 98DX3236 switch chip.

Namely, support is added for:
 -  MikroTik CRS305-1G-4S+ (including the Bit variant)
 -  MikroTik CRS326-24G-2S+ (including the Bit variant)
 -  MikroTik CRS328-4C-20S-4S+ (including the Bit variant)

The Bit board variant is added for each of the boards.
These boards were modified to use a bigger Macronix flash.

Currently only basic board support is added, but the support will
be extended in a new patchset.

Luka Kovacic (4):
  arm: mvebu: dts: Add CRS326-24G-2S board
  arm: mvebu: dts: Add CRS305-1G-4S board
  arm: mvebu: dts: Add CRS328-4C-20S-4S board
  MAINTAINERS: Add an entry for MikroTik CRS3xx 98DX3236 boards

 MAINTAINERS                                   |  11 ++
 arch/arm/boot/dts/Makefile                    |   6 +
 .../boot/dts/armada-xp-crs305-1g-4s-bit.dts   |  43 ++++++++
 arch/arm/boot/dts/armada-xp-crs305-1g-4s.dts  |  17 +++
 arch/arm/boot/dts/armada-xp-crs305-1g-4s.dtsi | 104 ++++++++++++++++++
 .../boot/dts/armada-xp-crs326-24g-2s-bit.dts  |  43 ++++++++
 arch/arm/boot/dts/armada-xp-crs326-24g-2s.dts |  17 +++
 .../arm/boot/dts/armada-xp-crs326-24g-2s.dtsi | 104 ++++++++++++++++++
 .../dts/armada-xp-crs328-4c-20s-4s-bit.dts    |  43 ++++++++
 .../boot/dts/armada-xp-crs328-4c-20s-4s.dts   |  17 +++
 .../boot/dts/armada-xp-crs328-4c-20s-4s.dtsi  | 104 ++++++++++++++++++
 11 files changed, 509 insertions(+)
 create mode 100644 arch/arm/boot/dts/armada-xp-crs305-1g-4s-bit.dts
 create mode 100644 arch/arm/boot/dts/armada-xp-crs305-1g-4s.dts
 create mode 100644 arch/arm/boot/dts/armada-xp-crs305-1g-4s.dtsi
 create mode 100644 arch/arm/boot/dts/armada-xp-crs326-24g-2s-bit.dts
 create mode 100644 arch/arm/boot/dts/armada-xp-crs326-24g-2s.dts
 create mode 100644 arch/arm/boot/dts/armada-xp-crs326-24g-2s.dtsi
 create mode 100644 arch/arm/boot/dts/armada-xp-crs328-4c-20s-4s-bit.dts
 create mode 100644 arch/arm/boot/dts/armada-xp-crs328-4c-20s-4s.dts
 create mode 100644 arch/arm/boot/dts/armada-xp-crs328-4c-20s-4s.dtsi

-- 
2.26.2


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/4] arm: mvebu: dts: Add CRS326-24G-2S board
  2020-07-24 10:38 [PATCH 0/4] Add support for a series of MikroTik CRS3xx switches Luka Kovacic
@ 2020-07-24 10:38 ` Luka Kovacic
  2020-07-24 14:53   ` Andrew Lunn
  2020-07-24 10:38 ` [PATCH 2/4] arm: mvebu: dts: Add CRS305-1G-4S board Luka Kovacic
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: Luka Kovacic @ 2020-07-24 10:38 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel
  Cc: jason, andrew, gregory.clement, sebastian.hesselbarth,
	Luka Kovacic, Luka Perkov, Jakov Petrina

MikroTik CRS326-24G-2S board has a switch chip with an integrated
Marvell Prestera 98DX3236 CPU.

This commit includes two board variants, namely the factory
default one and a Bit variant. The Bit variant has a
bigger Macronix flash.

This device tree includes basic Linux support.

Signed-off-by: Luka Kovacic <luka.kovacic@sartura.hr>
Cc: Luka Perkov <luka.perkov@sartura.hr>
Cc: Jakov Petrina <jakov.petrina@sartura.hr>
---
 arch/arm/boot/dts/Makefile                    |   2 +
 .../boot/dts/armada-xp-crs326-24g-2s-bit.dts  |  43 ++++++++
 arch/arm/boot/dts/armada-xp-crs326-24g-2s.dts |  17 +++
 .../arm/boot/dts/armada-xp-crs326-24g-2s.dtsi | 104 ++++++++++++++++++
 4 files changed, 166 insertions(+)
 create mode 100644 arch/arm/boot/dts/armada-xp-crs326-24g-2s-bit.dts
 create mode 100644 arch/arm/boot/dts/armada-xp-crs326-24g-2s.dts
 create mode 100644 arch/arm/boot/dts/armada-xp-crs326-24g-2s.dtsi

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index e6a1cac0bfc7..8627a38c4100 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -1312,6 +1312,8 @@ dtb-$(CONFIG_MACH_ARMADA_39X) += \
 	armada-398-db.dtb
 dtb-$(CONFIG_MACH_ARMADA_XP) += \
 	armada-xp-axpwifiap.dtb \
+	armada-xp-crs326-24g-2s.dtb \
+	armada-xp-crs326-24g-2s-bit.dtb \
 	armada-xp-db.dtb \
 	armada-xp-db-dxbc2.dtb \
 	armada-xp-db-xc3-24g4xg.dtb \
diff --git a/arch/arm/boot/dts/armada-xp-crs326-24g-2s-bit.dts b/arch/arm/boot/dts/armada-xp-crs326-24g-2s-bit.dts
new file mode 100644
index 000000000000..21f442afab1f
--- /dev/null
+++ b/arch/arm/boot/dts/armada-xp-crs326-24g-2s-bit.dts
@@ -0,0 +1,43 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Device Tree file for MikroTik CRS326-24G-2S+ Bit board
+ *
+ * Copyright (C) 2020 Sartura Ltd.
+ * Author: Luka Kovacic <luka.kovacic@sartura.hr>
+ */
+
+#include "armada-xp-crs326-24g-2s.dtsi"
+
+/ {
+	model = "MikroTik CRS326-24G-2S+ Bit";
+};
+
+&spi0 {
+	status = "okay";
+
+	spi-flash@0 {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		compatible = "jedec,spi-nor";
+		reg = <0>; /* Chip select 0 */
+		spi-max-frequency = <108000000>;
+		m25p,fast-read;
+
+		partition@u-boot {
+			reg = <0x00000000 0x001f0000>;
+			label = "u-boot";
+		};
+		partition@u-boot-env {
+			reg = <0x001f0000 0x00010000>;
+			label = "u-boot-env";
+		};
+		partition@ubi1 {
+			reg = <0x00200000 0x03f00000>;
+			label = "ubi1";
+		};
+		partition@ubi2 {
+			reg = <0x04100000 0x03f00000>;
+			label = "ubi2";
+		};
+	};
+};
diff --git a/arch/arm/boot/dts/armada-xp-crs326-24g-2s.dts b/arch/arm/boot/dts/armada-xp-crs326-24g-2s.dts
new file mode 100644
index 000000000000..83aef43f66d5
--- /dev/null
+++ b/arch/arm/boot/dts/armada-xp-crs326-24g-2s.dts
@@ -0,0 +1,17 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Device Tree file for MikroTik CRS326-24G-2S+ board
+ *
+ * Copyright (C) 2020 Sartura Ltd.
+ * Author: Luka Kovacic <luka.kovacic@sartura.hr>
+ */
+
+#include "armada-xp-crs326-24g-2s.dtsi"
+
+/ {
+	model = "MikroTik CRS326-24G-2S+";
+};
+
+&spi0 {
+	status = "okay";
+};
diff --git a/arch/arm/boot/dts/armada-xp-crs326-24g-2s.dtsi b/arch/arm/boot/dts/armada-xp-crs326-24g-2s.dtsi
new file mode 100644
index 000000000000..f3e1a25ca5f2
--- /dev/null
+++ b/arch/arm/boot/dts/armada-xp-crs326-24g-2s.dtsi
@@ -0,0 +1,104 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Device Tree file for CRS326-24G-2S board
+ *
+ * Copyright (C) 2016 Allied Telesis Labs
+ * Copyright (C) 2020 Sartura Ltd.
+ *
+ * Based on armada-xp-db.dts
+ *
+ * Note: this Device Tree assumes that the bootloader has remapped the
+ * internal registers to 0xf1000000 (instead of the default
+ * 0xd0000000). The 0xf1000000 is the default used by the recent,
+ * DT-capable, U-Boot bootloaders provided by Marvell. Some earlier
+ * boards were delivered with an older version of the bootloader that
+ * left internal registers mapped at 0xd0000000. If you are in this
+ * situation, you should either update your bootloader (preferred
+ * solution) or the below Device Tree should be adjusted.
+ */
+
+/dts-v1/;
+#include "armada-xp-98dx3236.dtsi"
+
+/ {
+	model = "CRS326-24G-2S+";
+	compatible = "mikrotik,crs326-24g-2s", "marvell,armadaxp-98dx3236", "marvell,armada-370-xp";
+
+	chosen {
+		bootargs = "console=ttyS0,115200 earlyprintk";
+	};
+
+	memory {
+		device_type = "memory";
+		reg = <0 0x00000000 0 0x20000000>; /* 512 MB */
+	};
+};
+
+&L2 {
+	arm,parity-enable;
+	marvell,ecc-enable;
+};
+
+&devbus_bootcs {
+	status = "okay";
+
+	/* Device Bus parameters are required */
+
+	/* Read parameters */
+	devbus,bus-width    = <16>;
+	devbus,turn-off-ps  = <60000>;
+	devbus,badr-skew-ps = <0>;
+	devbus,acc-first-ps = <124000>;
+	devbus,acc-next-ps  = <248000>;
+	devbus,rd-setup-ps  = <0>;
+	devbus,rd-hold-ps   = <0>;
+
+	/* Write parameters */
+	devbus,sync-enable = <0>;
+	devbus,wr-high-ps  = <60000>;
+	devbus,wr-low-ps   = <60000>;
+	devbus,ale-wr-ps   = <60000>;
+};
+
+&uart0 {
+	status = "okay";
+};
+
+&uart1 {
+	status = "okay";
+};
+
+&i2c0 {
+	clock-frequency = <100000>;
+	status = "okay";
+};
+
+&usb0 {
+	status = "okay";
+};
+
+&spi0 {
+	status = "okay";
+
+	spi-flash@0 {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		compatible = "jedec,spi-nor";
+		reg = <0>; /* Chip select 0 */
+		spi-max-frequency = <108000000>;
+		m25p,fast-read;
+
+		partition@u-boot {
+			reg = <0x00000000 0x001f0000>;
+			label = "u-boot";
+		};
+		partition@u-boot-env {
+			reg = <0x001f0000 0x00010000>;
+			label = "u-boot-env";
+		};
+		partition@ubi1 {
+			reg = <0x00200000 0x00e00000>;
+			label = "ubi1";
+		};
+	};
+};
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/4] arm: mvebu: dts: Add CRS305-1G-4S board
  2020-07-24 10:38 [PATCH 0/4] Add support for a series of MikroTik CRS3xx switches Luka Kovacic
  2020-07-24 10:38 ` [PATCH 1/4] arm: mvebu: dts: Add CRS326-24G-2S board Luka Kovacic
@ 2020-07-24 10:38 ` Luka Kovacic
  2020-07-24 14:54   ` Andrew Lunn
  2020-07-24 10:38 ` [PATCH 3/4] arm: mvebu: dts: Add CRS328-4C-20S-4S board Luka Kovacic
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: Luka Kovacic @ 2020-07-24 10:38 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel
  Cc: jason, andrew, gregory.clement, sebastian.hesselbarth,
	Luka Kovacic, Luka Perkov, Jakov Petrina

MikroTik CRS305-1G-4S board has a switch chip with an integrated
Marvell Prestera 98DX3236 CPU.

This commit includes two board variants, namely the factory
default one and a Bit variant. The Bit variant has a
bigger Macronix flash.

This device tree includes basic Linux support.

Signed-off-by: Luka Kovacic <luka.kovacic@sartura.hr>
Cc: Luka Perkov <luka.perkov@sartura.hr>
Cc: Jakov Petrina <jakov.petrina@sartura.hr>
---
 arch/arm/boot/dts/Makefile                    |   2 +
 .../boot/dts/armada-xp-crs305-1g-4s-bit.dts   |  43 ++++++++
 arch/arm/boot/dts/armada-xp-crs305-1g-4s.dts  |  17 +++
 arch/arm/boot/dts/armada-xp-crs305-1g-4s.dtsi | 104 ++++++++++++++++++
 4 files changed, 166 insertions(+)
 create mode 100644 arch/arm/boot/dts/armada-xp-crs305-1g-4s-bit.dts
 create mode 100644 arch/arm/boot/dts/armada-xp-crs305-1g-4s.dts
 create mode 100644 arch/arm/boot/dts/armada-xp-crs305-1g-4s.dtsi

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 8627a38c4100..f3ac0fb7f244 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -1312,6 +1312,8 @@ dtb-$(CONFIG_MACH_ARMADA_39X) += \
 	armada-398-db.dtb
 dtb-$(CONFIG_MACH_ARMADA_XP) += \
 	armada-xp-axpwifiap.dtb \
+	armada-xp-crs305-1g-4s.dtb \
+	armada-xp-crs305-1g-4s-bit.dtb \
 	armada-xp-crs326-24g-2s.dtb \
 	armada-xp-crs326-24g-2s-bit.dtb \
 	armada-xp-db.dtb \
diff --git a/arch/arm/boot/dts/armada-xp-crs305-1g-4s-bit.dts b/arch/arm/boot/dts/armada-xp-crs305-1g-4s-bit.dts
new file mode 100644
index 000000000000..a022c68dc943
--- /dev/null
+++ b/arch/arm/boot/dts/armada-xp-crs305-1g-4s-bit.dts
@@ -0,0 +1,43 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Device Tree file for MikroTik CRS305-1G-4S+ Bit board
+ *
+ * Copyright (C) 2020 Sartura Ltd.
+ * Author: Luka Kovacic <luka.kovacic@sartura.hr>
+ */
+
+#include "armada-xp-crs305-1g-4s.dtsi"
+
+/ {
+	model = "MikroTik CRS305-1G-4S+ Bit";
+};
+
+&spi0 {
+	status = "okay";
+
+	spi-flash@0 {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		compatible = "jedec,spi-nor";
+		reg = <0>; /* Chip select 0 */
+		spi-max-frequency = <108000000>;
+		m25p,fast-read;
+
+		partition@u-boot {
+			reg = <0x00000000 0x001f0000>;
+			label = "u-boot";
+		};
+		partition@u-boot-env {
+			reg = <0x001f0000 0x00010000>;
+			label = "u-boot-env";
+		};
+		partition@ubi1 {
+			reg = <0x00200000 0x03f00000>;
+			label = "ubi1";
+		};
+		partition@ubi2 {
+			reg = <0x04100000 0x03f00000>;
+			label = "ubi2";
+		};
+	};
+};
diff --git a/arch/arm/boot/dts/armada-xp-crs305-1g-4s.dts b/arch/arm/boot/dts/armada-xp-crs305-1g-4s.dts
new file mode 100644
index 000000000000..010b83b54212
--- /dev/null
+++ b/arch/arm/boot/dts/armada-xp-crs305-1g-4s.dts
@@ -0,0 +1,17 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Device Tree file for MikroTik CRS305-1G-4S+ board
+ *
+ * Copyright (C) 2020 Sartura Ltd.
+ * Author: Luka Kovacic <luka.kovacic@sartura.hr>
+ */
+
+#include "armada-xp-crs305-1g-4s.dtsi"
+
+/ {
+	model = "MikroTik CRS305-1G-4S+";
+};
+
+&spi0 {
+	status = "okay";
+};
diff --git a/arch/arm/boot/dts/armada-xp-crs305-1g-4s.dtsi b/arch/arm/boot/dts/armada-xp-crs305-1g-4s.dtsi
new file mode 100644
index 000000000000..32fb21b2bf6a
--- /dev/null
+++ b/arch/arm/boot/dts/armada-xp-crs305-1g-4s.dtsi
@@ -0,0 +1,104 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Device Tree file for CRS305-1G-4S board
+ *
+ * Copyright (C) 2016 Allied Telesis Labs
+ * Copyright (C) 2020 Sartura Ltd.
+ *
+ * Based on armada-xp-db.dts
+ *
+ * Note: this Device Tree assumes that the bootloader has remapped the
+ * internal registers to 0xf1000000 (instead of the default
+ * 0xd0000000). The 0xf1000000 is the default used by the recent,
+ * DT-capable, U-Boot bootloaders provided by Marvell. Some earlier
+ * boards were delivered with an older version of the bootloader that
+ * left internal registers mapped at 0xd0000000. If you are in this
+ * situation, you should either update your bootloader (preferred
+ * solution) or the below Device Tree should be adjusted.
+ */
+
+/dts-v1/;
+#include "armada-xp-98dx3236.dtsi"
+
+/ {
+	model = "CRS305-1G-4S+";
+	compatible = "mikrotik,crs305-1g-4s", "marvell,armadaxp-98dx3236", "marvell,armada-370-xp";
+
+	chosen {
+		bootargs = "console=ttyS0,115200 earlyprintk";
+	};
+
+	memory {
+		device_type = "memory";
+		reg = <0 0x00000000 0 0x20000000>; /* 512 MB */
+	};
+};
+
+&L2 {
+	arm,parity-enable;
+	marvell,ecc-enable;
+};
+
+&devbus_bootcs {
+	status = "okay";
+
+	/* Device Bus parameters are required */
+
+	/* Read parameters */
+	devbus,bus-width    = <16>;
+	devbus,turn-off-ps  = <60000>;
+	devbus,badr-skew-ps = <0>;
+	devbus,acc-first-ps = <124000>;
+	devbus,acc-next-ps  = <248000>;
+	devbus,rd-setup-ps  = <0>;
+	devbus,rd-hold-ps   = <0>;
+
+	/* Write parameters */
+	devbus,sync-enable = <0>;
+	devbus,wr-high-ps  = <60000>;
+	devbus,wr-low-ps   = <60000>;
+	devbus,ale-wr-ps   = <60000>;
+};
+
+&uart0 {
+	status = "okay";
+};
+
+&uart1 {
+	status = "okay";
+};
+
+&i2c0 {
+	clock-frequency = <100000>;
+	status = "okay";
+};
+
+&usb0 {
+	status = "okay";
+};
+
+&spi0 {
+	status = "okay";
+
+	spi-flash@0 {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		compatible = "jedec,spi-nor";
+		reg = <0>; /* Chip select 0 */
+		spi-max-frequency = <108000000>;
+		m25p,fast-read;
+
+		partition@u-boot {
+			reg = <0x00000000 0x001f0000>;
+			label = "u-boot";
+		};
+		partition@u-boot-env {
+			reg = <0x001f0000 0x00010000>;
+			label = "u-boot-env";
+		};
+		partition@ubi1 {
+			reg = <0x00200000 0x00e00000>;
+			label = "ubi1";
+		};
+	};
+};
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 3/4] arm: mvebu: dts: Add CRS328-4C-20S-4S board
  2020-07-24 10:38 [PATCH 0/4] Add support for a series of MikroTik CRS3xx switches Luka Kovacic
  2020-07-24 10:38 ` [PATCH 1/4] arm: mvebu: dts: Add CRS326-24G-2S board Luka Kovacic
  2020-07-24 10:38 ` [PATCH 2/4] arm: mvebu: dts: Add CRS305-1G-4S board Luka Kovacic
@ 2020-07-24 10:38 ` Luka Kovacic
  2020-07-24 14:56   ` Andrew Lunn
  2020-07-24 10:38 ` [PATCH 4/4] MAINTAINERS: Add an entry for MikroTik CRS3xx 98DX3236 boards Luka Kovacic
  2020-09-23 14:38 ` [PATCH 0/4] Add support for a series of MikroTik CRS3xx switches Gregory CLEMENT
  4 siblings, 1 reply; 10+ messages in thread
From: Luka Kovacic @ 2020-07-24 10:38 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel
  Cc: jason, andrew, gregory.clement, sebastian.hesselbarth,
	Luka Kovacic, Luka Perkov, Jakov Petrina

MikroTik CRS328-4C-20S-4S board has a switch chip with an integrated
Marvell Prestera 98DX3236 CPU.

This commit includes two board variants, namely the factory
default one and a Bit variant. The Bit variant has a
bigger Macronix flash.

This device tree includes basic Linux support.

Signed-off-by: Luka Kovacic <luka.kovacic@sartura.hr>
Cc: Luka Perkov <luka.perkov@sartura.hr>
Cc: Jakov Petrina <jakov.petrina@sartura.hr>
---
 arch/arm/boot/dts/Makefile                    |   2 +
 .../dts/armada-xp-crs328-4c-20s-4s-bit.dts    |  43 ++++++++
 .../boot/dts/armada-xp-crs328-4c-20s-4s.dts   |  17 +++
 .../boot/dts/armada-xp-crs328-4c-20s-4s.dtsi  | 104 ++++++++++++++++++
 4 files changed, 166 insertions(+)
 create mode 100644 arch/arm/boot/dts/armada-xp-crs328-4c-20s-4s-bit.dts
 create mode 100644 arch/arm/boot/dts/armada-xp-crs328-4c-20s-4s.dts
 create mode 100644 arch/arm/boot/dts/armada-xp-crs328-4c-20s-4s.dtsi

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index f3ac0fb7f244..c30bfa9678b1 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -1316,6 +1316,8 @@ dtb-$(CONFIG_MACH_ARMADA_XP) += \
 	armada-xp-crs305-1g-4s-bit.dtb \
 	armada-xp-crs326-24g-2s.dtb \
 	armada-xp-crs326-24g-2s-bit.dtb \
+	armada-xp-crs328-4c-20s-4s.dtb \
+	armada-xp-crs328-4c-20s-4s-bit.dtb \
 	armada-xp-db.dtb \
 	armada-xp-db-dxbc2.dtb \
 	armada-xp-db-xc3-24g4xg.dtb \
diff --git a/arch/arm/boot/dts/armada-xp-crs328-4c-20s-4s-bit.dts b/arch/arm/boot/dts/armada-xp-crs328-4c-20s-4s-bit.dts
new file mode 100644
index 000000000000..e05aee6cdc04
--- /dev/null
+++ b/arch/arm/boot/dts/armada-xp-crs328-4c-20s-4s-bit.dts
@@ -0,0 +1,43 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Device Tree file for MikroTik CRS328-4C-20S-4S+ Bit board
+ *
+ * Copyright (C) 2020 Sartura Ltd.
+ * Author: Luka Kovacic <luka.kovacic@sartura.hr>
+ */
+
+#include "armada-xp-crs328-4c-20s-4s.dtsi"
+
+/ {
+	model = "MikroTik CRS328-4C-20S-4S+ Bit";
+};
+
+&spi0 {
+	status = "okay";
+
+	spi-flash@0 {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		compatible = "jedec,spi-nor";
+		reg = <0>; /* Chip select 0 */
+		spi-max-frequency = <108000000>;
+		m25p,fast-read;
+
+		partition@u-boot {
+			reg = <0x00000000 0x001f0000>;
+			label = "u-boot";
+		};
+		partition@u-boot-env {
+			reg = <0x001f0000 0x00010000>;
+			label = "u-boot-env";
+		};
+		partition@ubi1 {
+			reg = <0x00200000 0x03f00000>;
+			label = "ubi1";
+		};
+		partition@ubi2 {
+			reg = <0x04100000 0x03f00000>;
+			label = "ubi2";
+		};
+	};
+};
diff --git a/arch/arm/boot/dts/armada-xp-crs328-4c-20s-4s.dts b/arch/arm/boot/dts/armada-xp-crs328-4c-20s-4s.dts
new file mode 100644
index 000000000000..665757f6e18e
--- /dev/null
+++ b/arch/arm/boot/dts/armada-xp-crs328-4c-20s-4s.dts
@@ -0,0 +1,17 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Device Tree file for MikroTik CRS328-4C-20S-4S+ board
+ *
+ * Copyright (C) 2020 Sartura Ltd.
+ * Author: Luka Kovacic <luka.kovacic@sartura.hr>
+ */
+
+#include "armada-xp-crs328-4c-20s-4s.dtsi"
+
+/ {
+	model = "MikroTik CRS328-4C-20S-4S+";
+};
+
+&spi0 {
+	status = "okay";
+};
diff --git a/arch/arm/boot/dts/armada-xp-crs328-4c-20s-4s.dtsi b/arch/arm/boot/dts/armada-xp-crs328-4c-20s-4s.dtsi
new file mode 100644
index 000000000000..c8b1355ce15e
--- /dev/null
+++ b/arch/arm/boot/dts/armada-xp-crs328-4c-20s-4s.dtsi
@@ -0,0 +1,104 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Device Tree file for CRS328-4C-20S-4S+ board
+ *
+ * Copyright (C) 2016 Allied Telesis Labs
+ * Copyright (C) 2020 Sartura Ltd.
+ *
+ * Based on armada-xp-db.dts
+ *
+ * Note: this Device Tree assumes that the bootloader has remapped the
+ * internal registers to 0xf1000000 (instead of the default
+ * 0xd0000000). The 0xf1000000 is the default used by the recent,
+ * DT-capable, U-Boot bootloaders provided by Marvell. Some earlier
+ * boards were delivered with an older version of the bootloader that
+ * left internal registers mapped at 0xd0000000. If you are in this
+ * situation, you should either update your bootloader (preferred
+ * solution) or the below Device Tree should be adjusted.
+ */
+
+/dts-v1/;
+#include "armada-xp-98dx3236.dtsi"
+
+/ {
+	model = "CRS328-4C-20S-4S+";
+	compatible = "mikrotik,crs328-4c-20s-4s", "marvell,armadaxp-98dx3236", "marvell,armada-370-xp";
+
+	chosen {
+		bootargs = "console=ttyS0,115200 earlyprintk";
+	};
+
+	memory {
+		device_type = "memory";
+		reg = <0 0x00000000 0 0x20000000>; /* 512 MB */
+	};
+};
+
+&L2 {
+	arm,parity-enable;
+	marvell,ecc-enable;
+};
+
+&devbus_bootcs {
+	status = "okay";
+
+	/* Device Bus parameters are required */
+
+	/* Read parameters */
+	devbus,bus-width    = <16>;
+	devbus,turn-off-ps  = <60000>;
+	devbus,badr-skew-ps = <0>;
+	devbus,acc-first-ps = <124000>;
+	devbus,acc-next-ps  = <248000>;
+	devbus,rd-setup-ps  = <0>;
+	devbus,rd-hold-ps   = <0>;
+
+	/* Write parameters */
+	devbus,sync-enable = <0>;
+	devbus,wr-high-ps  = <60000>;
+	devbus,wr-low-ps   = <60000>;
+	devbus,ale-wr-ps   = <60000>;
+};
+
+&uart0 {
+	status = "okay";
+};
+
+&uart1 {
+	status = "okay";
+};
+
+&i2c0 {
+	clock-frequency = <100000>;
+	status = "okay";
+};
+
+&usb0 {
+	status = "okay";
+};
+
+&spi0 {
+	status = "okay";
+
+	spi-flash@0 {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		compatible = "jedec,spi-nor";
+		reg = <0>; /* Chip select 0 */
+		spi-max-frequency = <108000000>;
+		m25p,fast-read;
+
+		partition@u-boot {
+			reg = <0x00000000 0x001f0000>;
+			label = "u-boot";
+		};
+		partition@u-boot-env {
+			reg = <0x001f0000 0x00010000>;
+			label = "u-boot-env";
+		};
+		partition@ubi1 {
+			reg = <0x00200000 0x00e00000>;
+			label = "ubi1";
+		};
+	};
+};
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 4/4] MAINTAINERS: Add an entry for MikroTik CRS3xx 98DX3236 boards
  2020-07-24 10:38 [PATCH 0/4] Add support for a series of MikroTik CRS3xx switches Luka Kovacic
                   ` (2 preceding siblings ...)
  2020-07-24 10:38 ` [PATCH 3/4] arm: mvebu: dts: Add CRS328-4C-20S-4S board Luka Kovacic
@ 2020-07-24 10:38 ` Luka Kovacic
  2020-07-24 14:56   ` Andrew Lunn
  2020-09-23 14:38 ` [PATCH 0/4] Add support for a series of MikroTik CRS3xx switches Gregory CLEMENT
  4 siblings, 1 reply; 10+ messages in thread
From: Luka Kovacic @ 2020-07-24 10:38 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel
  Cc: jason, andrew, gregory.clement, sebastian.hesselbarth,
	Luka Kovacic, Luka Perkov, Jakov Petrina

An entry is added for MikroTik CRS3xx 98DX3236 based switches.

Signed-off-by: Luka Kovacic <luka.kovacic@sartura.hr>
Cc: Luka Perkov <luka.perkov@sartura.hr>
Cc: Jakov Petrina <jakov.petrina@sartura.hr>
---
 MAINTAINERS | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index d53db30d1365..9da194a33b7a 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -11402,6 +11402,17 @@ M:	Oliver Neukum <oliver@neukum.org>
 S:	Maintained
 F:	drivers/usb/image/microtek.*
 
+MIKROTIK CRS3XX 98DX3236 BOARD SUPPORT
+M:	Luka Kovacic <luka.kovacic@sartura.hr>
+M:	Luka Perkov <luka.perkov@sartura.hr>
+S:	Maintained
+F:	arch/arm/boot/dts/armada-xp-crs305-1g-4s-bit.dts
+F:	arch/arm/boot/dts/armada-xp-crs305-1g-4s.dts
+F:	arch/arm/boot/dts/armada-xp-crs326-24g-2s-bit.dts
+F:	arch/arm/boot/dts/armada-xp-crs326-24g-2s.dts
+F:	arch/arm/boot/dts/armada-xp-crs328-4c-20s-4s-bit.dts
+F:	arch/arm/boot/dts/armada-xp-crs328-4c-20s-4s.dts
+
 MIPS
 M:	Thomas Bogendoerfer <tsbogend@alpha.franken.de>
 L:	linux-mips@vger.kernel.org
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/4] arm: mvebu: dts: Add CRS326-24G-2S board
  2020-07-24 10:38 ` [PATCH 1/4] arm: mvebu: dts: Add CRS326-24G-2S board Luka Kovacic
@ 2020-07-24 14:53   ` Andrew Lunn
  0 siblings, 0 replies; 10+ messages in thread
From: Andrew Lunn @ 2020-07-24 14:53 UTC (permalink / raw)
  To: Luka Kovacic
  Cc: linux-arm-kernel, linux-kernel, jason, gregory.clement,
	sebastian.hesselbarth, Luka Perkov, Jakov Petrina

On Fri, Jul 24, 2020 at 12:38:37PM +0200, Luka Kovacic wrote:
> MikroTik CRS326-24G-2S board has a switch chip with an integrated
> Marvell Prestera 98DX3236 CPU.
> 
> This commit includes two board variants, namely the factory
> default one and a Bit variant. The Bit variant has a
> bigger Macronix flash.
> 
> This device tree includes basic Linux support.
> 
> Signed-off-by: Luka Kovacic <luka.kovacic@sartura.hr>
> Cc: Luka Perkov <luka.perkov@sartura.hr>
> Cc: Jakov Petrina <jakov.petrina@sartura.hr>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/4] arm: mvebu: dts: Add CRS305-1G-4S board
  2020-07-24 10:38 ` [PATCH 2/4] arm: mvebu: dts: Add CRS305-1G-4S board Luka Kovacic
@ 2020-07-24 14:54   ` Andrew Lunn
  0 siblings, 0 replies; 10+ messages in thread
From: Andrew Lunn @ 2020-07-24 14:54 UTC (permalink / raw)
  To: Luka Kovacic
  Cc: linux-arm-kernel, linux-kernel, jason, gregory.clement,
	sebastian.hesselbarth, Luka Perkov, Jakov Petrina

On Fri, Jul 24, 2020 at 12:38:38PM +0200, Luka Kovacic wrote:
> MikroTik CRS305-1G-4S board has a switch chip with an integrated
> Marvell Prestera 98DX3236 CPU.
> 
> This commit includes two board variants, namely the factory
> default one and a Bit variant. The Bit variant has a
> bigger Macronix flash.
> 
> This device tree includes basic Linux support.
> 
> Signed-off-by: Luka Kovacic <luka.kovacic@sartura.hr>
> Cc: Luka Perkov <luka.perkov@sartura.hr>
> Cc: Jakov Petrina <jakov.petrina@sartura.hr>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 3/4] arm: mvebu: dts: Add CRS328-4C-20S-4S board
  2020-07-24 10:38 ` [PATCH 3/4] arm: mvebu: dts: Add CRS328-4C-20S-4S board Luka Kovacic
@ 2020-07-24 14:56   ` Andrew Lunn
  0 siblings, 0 replies; 10+ messages in thread
From: Andrew Lunn @ 2020-07-24 14:56 UTC (permalink / raw)
  To: Luka Kovacic
  Cc: linux-arm-kernel, linux-kernel, jason, gregory.clement,
	sebastian.hesselbarth, Luka Perkov, Jakov Petrina

On Fri, Jul 24, 2020 at 12:38:39PM +0200, Luka Kovacic wrote:
> MikroTik CRS328-4C-20S-4S board has a switch chip with an integrated
> Marvell Prestera 98DX3236 CPU.
> 
> This commit includes two board variants, namely the factory
> default one and a Bit variant. The Bit variant has a
> bigger Macronix flash.
> 
> This device tree includes basic Linux support.
> 
> Signed-off-by: Luka Kovacic <luka.kovacic@sartura.hr>
> Cc: Luka Perkov <luka.perkov@sartura.hr>
> Cc: Jakov Petrina <jakov.petrina@sartura.hr>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 4/4] MAINTAINERS: Add an entry for MikroTik CRS3xx 98DX3236 boards
  2020-07-24 10:38 ` [PATCH 4/4] MAINTAINERS: Add an entry for MikroTik CRS3xx 98DX3236 boards Luka Kovacic
@ 2020-07-24 14:56   ` Andrew Lunn
  0 siblings, 0 replies; 10+ messages in thread
From: Andrew Lunn @ 2020-07-24 14:56 UTC (permalink / raw)
  To: Luka Kovacic
  Cc: linux-arm-kernel, linux-kernel, jason, gregory.clement,
	sebastian.hesselbarth, Luka Perkov, Jakov Petrina

On Fri, Jul 24, 2020 at 12:38:40PM +0200, Luka Kovacic wrote:
> An entry is added for MikroTik CRS3xx 98DX3236 based switches.
> 
> Signed-off-by: Luka Kovacic <luka.kovacic@sartura.hr>
> Cc: Luka Perkov <luka.perkov@sartura.hr>
> Cc: Jakov Petrina <jakov.petrina@sartura.hr>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/4] Add support for a series of MikroTik CRS3xx switches
  2020-07-24 10:38 [PATCH 0/4] Add support for a series of MikroTik CRS3xx switches Luka Kovacic
                   ` (3 preceding siblings ...)
  2020-07-24 10:38 ` [PATCH 4/4] MAINTAINERS: Add an entry for MikroTik CRS3xx 98DX3236 boards Luka Kovacic
@ 2020-09-23 14:38 ` Gregory CLEMENT
  4 siblings, 0 replies; 10+ messages in thread
From: Gregory CLEMENT @ 2020-09-23 14:38 UTC (permalink / raw)
  To: Luka Kovacic, linux-arm-kernel, linux-kernel
  Cc: jason, andrew, sebastian.hesselbarth, Luka Kovacic

Hi Luka,

> These patches add support for a series of MikroTik CRS3xx switches
> based on the Marvell Prestera 98DX3236 switch chip.
>
> Namely, support is added for:
>  -  MikroTik CRS305-1G-4S+ (including the Bit variant)
>  -  MikroTik CRS326-24G-2S+ (including the Bit variant)
>  -  MikroTik CRS328-4C-20S-4S+ (including the Bit variant)
>
> The Bit board variant is added for each of the boards.
> These boards were modified to use a bigger Macronix flash.
>
> Currently only basic board support is added, but the support will
> be extended in a new patchset.
>
> Luka Kovacic (4):
>   arm: mvebu: dts: Add CRS326-24G-2S board
>   arm: mvebu: dts: Add CRS305-1G-4S board
>   arm: mvebu: dts: Add CRS328-4C-20S-4S board

These 3 patches have been applied on mvebu/dt

>   MAINTAINERS: Add an entry for MikroTik CRS3xx 98DX3236 boards

and this one on mvebu/arm

Thanks,

Gregory
>
>  MAINTAINERS                                   |  11 ++
>  arch/arm/boot/dts/Makefile                    |   6 +
>  .../boot/dts/armada-xp-crs305-1g-4s-bit.dts   |  43 ++++++++
>  arch/arm/boot/dts/armada-xp-crs305-1g-4s.dts  |  17 +++
>  arch/arm/boot/dts/armada-xp-crs305-1g-4s.dtsi | 104 ++++++++++++++++++
>  .../boot/dts/armada-xp-crs326-24g-2s-bit.dts  |  43 ++++++++
>  arch/arm/boot/dts/armada-xp-crs326-24g-2s.dts |  17 +++
>  .../arm/boot/dts/armada-xp-crs326-24g-2s.dtsi | 104 ++++++++++++++++++
>  .../dts/armada-xp-crs328-4c-20s-4s-bit.dts    |  43 ++++++++
>  .../boot/dts/armada-xp-crs328-4c-20s-4s.dts   |  17 +++
>  .../boot/dts/armada-xp-crs328-4c-20s-4s.dtsi  | 104 ++++++++++++++++++
>  11 files changed, 509 insertions(+)
>  create mode 100644 arch/arm/boot/dts/armada-xp-crs305-1g-4s-bit.dts
>  create mode 100644 arch/arm/boot/dts/armada-xp-crs305-1g-4s.dts
>  create mode 100644 arch/arm/boot/dts/armada-xp-crs305-1g-4s.dtsi
>  create mode 100644 arch/arm/boot/dts/armada-xp-crs326-24g-2s-bit.dts
>  create mode 100644 arch/arm/boot/dts/armada-xp-crs326-24g-2s.dts
>  create mode 100644 arch/arm/boot/dts/armada-xp-crs326-24g-2s.dtsi
>  create mode 100644 arch/arm/boot/dts/armada-xp-crs328-4c-20s-4s-bit.dts
>  create mode 100644 arch/arm/boot/dts/armada-xp-crs328-4c-20s-4s.dts
>  create mode 100644 arch/arm/boot/dts/armada-xp-crs328-4c-20s-4s.dtsi
>
> -- 
> 2.26.2
>

-- 
Gregory Clement, Bootlin
Embedded Linux and Kernel engineering
http://bootlin.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-09-23 14:40 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-24 10:38 [PATCH 0/4] Add support for a series of MikroTik CRS3xx switches Luka Kovacic
2020-07-24 10:38 ` [PATCH 1/4] arm: mvebu: dts: Add CRS326-24G-2S board Luka Kovacic
2020-07-24 14:53   ` Andrew Lunn
2020-07-24 10:38 ` [PATCH 2/4] arm: mvebu: dts: Add CRS305-1G-4S board Luka Kovacic
2020-07-24 14:54   ` Andrew Lunn
2020-07-24 10:38 ` [PATCH 3/4] arm: mvebu: dts: Add CRS328-4C-20S-4S board Luka Kovacic
2020-07-24 14:56   ` Andrew Lunn
2020-07-24 10:38 ` [PATCH 4/4] MAINTAINERS: Add an entry for MikroTik CRS3xx 98DX3236 boards Luka Kovacic
2020-07-24 14:56   ` Andrew Lunn
2020-09-23 14:38 ` [PATCH 0/4] Add support for a series of MikroTik CRS3xx switches Gregory CLEMENT

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).