Skip to contentSkip to conversation

MIPS: ralink: mt7628a.dtsi: Add I2C controller DT node

PATCH In review Stefan Roese 3 participants 7 messages Aug 12, 2019 – Oct 7, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v4 1/4 MIPS: ralink: mt7628a.dtsi: Add I2C controller DT node

This patch adds the I2C controller description to the MT7628A dtsi file.

Cc Paul Burton <[email protected]>
Cc Harvey Hunt <[email protected]>
Cc John Crispin <[email protected]>

---
v4:
- No change

v3:
- No change (I2C controller driver is now available in mainline)

v2:
- Use Harvey's new email address (not at imgtec)
- Use correct linux-mips list address

 arch/mips/boot/dts/ralink/mt7628a.dtsi | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
arch/mips/boot/dts/ralink/mt7628a.dtsi +16 -0
index 61f8621e88b3..742bcc1dc2e0 100644
@@ -199,6 +199,22 @@
 			status = "disabled";
 		};
 
+		i2c: i2c@900 {
+			compatible = "mediatek,mt7621-i2c";
+			reg = <0x900 0x100>;
+
+			pinctrl-names = "default";
+			pinctrl-0 = <&pinmux_i2c_i2c>;
+
+			resets = <&resetc 16>;
+			reset-names = "i2c";
+
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			status = "disabled";
+		};
+
 		uart0: uartlite@c00 {
 			compatible = "ns16550a";
 			reg = <0xc00 0x100>;
Signature · 1 line
2.22.0
#1 lore raw

PATCH v4 2/4 dt-bindings: mips: Add missing mt7688a-soc compatible

This patch adds the "ralink,mt7688a-soc" compatible to the ralink DT bindings documentation. This compatible is already used by some MIPS boards (e.g. omega2p.dts) but not yet documented. It will also be used by the upcoming "GARDENA smart Gateway" support.

---
v4:
- New patch

 Documentation/devicetree/bindings/mips/ralink.txt | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/mips/ralink.txt +1 -0
index a16e8d7fe56c..3341945b51d9 100644
@@ -16,3 +16,4 @@ value must be one of the following values:
   ralink,mt7620a-soc
   ralink,mt7620n-soc
   ralink,mt7628a-soc
+  ralink,mt7688a-soc
Signature · 1 line
2.22.0
maintainer Reviewed-by on v4 2/4
#2 lore raw

Re: [PATCH 2/4 v4] dt-bindings: mips: Add missing mt7688a-soc compatible

Quoted 9 lines · Stefan Roese

This patch adds the "ralink,mt7688a-soc" compatible to the ralink DT bindings documentation. This compatible is already used by some MIPS boards (e.g. omega2p.dts) but not yet documented. It will also be used by the upcoming "GARDENA smart Gateway" support.

Quoted 7 lines

---
v4:
- New patch

 Documentation/devicetree/bindings/mips/ralink.txt | 1 +
 1 file changed, 1 insertion(+)
#3 lore raw

PATCH v4 3/4 dt-bindings: mips: Add gardena vendor prefix and board description

In reply to Stefan Roese

This patch adds the vendor prefix for gardena and a short description including the compatible string for the "GARDENA smart Gateway" based on the MT7688 SoC.

---
v4:
- Move board description into ralink.txt instead of creating a gardena board file (Rob)
- Slightly changed board compatible

v3:
- New patch

 Documentation/devicetree/bindings/mips/ralink.txt   | 13 +++++++++++++
 .../devicetree/bindings/vendor-prefixes.yaml        |  2 ++
 2 files changed, 15 insertions(+)
Documentation/devicetree/bindings/mips/ralink.txt +13 -0
index 3341945b51d9..8cc0ab41578c 100644
@@ -17,3 +17,16 @@ value must be one of the following values:
   ralink,mt7620n-soc
   ralink,mt7628a-soc
   ralink,mt7688a-soc
+
+2. Boards
+
+GARDENA smart Gateway (MT7688)
+
+This board is based on the MediaTek MT7688 and equipped with 128 MiB
+of DDR and 8 MiB of flash (SPI NOR) and additional 128MiB SPI NAND
+storage.
+
+------------------------------
+Required root node properties:
+- compatible = "gardena,smart-gateway-mt7688", "ralink,mt7688a-soc",
+		"ralink,mt7628a-soc";
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
index 6992bbbbffab..73166adfd4ad 100644
@@ -337,6 +337,8 @@ patternProperties:
     description: Freescale Semiconductor
   "^fujitsu,.*":
     description: Fujitsu Ltd.
+  "^gardena,.*":
+    description: GARDENA GmbH
   "^gateworks,.*":
     description: Gateworks Corporation
   "^gcw,.*":
Signature · 1 line
2.22.0
maintainer Reviewed-by on v4 3/4
#4 lore raw

Re: [PATCH 3/4 v4] dt-bindings: mips: Add gardena vendor prefix and board description

Quoted 14 lines · Stefan Roese

This patch adds the vendor prefix for gardena and a short description including the compatible string for the "GARDENA smart Gateway" based on the MT7688 SoC.

---
v4:
- Move board description into ralink.txt instead of creating a gardena board file (Rob)
- Slightly changed board compatible

Quoted 7 lines

v3:
- New patch

 Documentation/devicetree/bindings/mips/ralink.txt   | 13 +++++++++++++
 .../devicetree/bindings/vendor-prefixes.yaml        |  2 ++
 2 files changed, 15 insertions(+)
#5 lore raw

PATCH v4 4/4 MIPS: ralink: Add GARDENA smart Gateway MT7688 board

In reply to Stefan Roese

This patch adds support for the GARDENA smart Gateway, which is based on the MediaTek MT7688 SoC. It is equipped with 128 MiB of DDR and 8 MiB of flash (SPI NOR) and additional 128MiB SPI NAND storage.

Cc Paul Burton <[email protected]>
Cc Harvey Hunt <[email protected]>
Cc John Crispin <[email protected]>

---
v4:
- Added "ralink,mt7688a-soc" to compatible for the used SoC

v3:
- No change (bindings documentation added in separate patch)

v2:
- Use Harvey's new email address (not at imgtec)
- Use correct linux-mips list address

 .../ralink/gardena_smart_gateway_mt7688.dts   | 197 ++++++++++++++++++
 1 file changed, 197 insertions(+)
 create mode 100644 arch/mips/boot/dts/ralink/gardena_smart_gateway_mt7688.dts
arch/mips/boot/dts/ralink/gardena_smart_gateway_mt7688.dts new file +197 -0
new file mode 100644
index 000000000000..aa5caaa31104
@@ -0,0 +1,197 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2019 Stefan Roese <[email protected]>
+ */
+
+/dts-v1/;
+
+/include/ "mt7628a.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+	compatible = "gardena,smart-gateway-mt7688", "ralink,mt7688a-soc",
+		     "ralink,mt7628a-soc";
+	model = "GARDENA smart Gateway (MT7688)";
+
+	memory@0 {
+		device_type = "memory";
+		reg = <0x0 0x8000000>;
+	};
+
+	gpio-keys {
+		compatible = "gpio-keys";
+
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinmux_gpio_gpio>;	/* GPIO11 */
+
+		user_btn1 {
+			label = "USER_BTN1";
+			gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
+			linux,code =<KEY_PROG1> ;
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinmux_pwm0_gpio>,	/* GPIO18 */
+			    <&pinmux_pwm1_gpio>,	/* GPIO19 */
+			    <&pinmux_sdmode_gpio>,	/* GPIO22..29 */
+			    <&pinmux_p0led_an_gpio>;	/* GPIO43 */
+		/*
+		 * <&pinmux_i2s_gpio> (covers GPIO0..3) is needed here as
+		 * well for GPIO3. But this is already claimed for uart1
+		 * (see below). So we can't include it in this LED node.
+		 */
+
+		power_blue {
+			label = "smartgw:power:blue";
+			gpios = <&gpio 18 GPIO_ACTIVE_HIGH>;
+			default-state = "off";
+		};
+
+		power_green {
+			label = "smartgw:power:green";
+			gpios = <&gpio 19 GPIO_ACTIVE_HIGH>;
+			default-state = "off";
+		};
+
+		power_red {
+			label = "smartgw:power:red";
+			gpios = <&gpio 22 GPIO_ACTIVE_HIGH>;
+			default-state = "off";
+		};
+
+		radio_blue {
+			label = "smartgw:radio:blue";
+			gpios = <&gpio 23 GPIO_ACTIVE_HIGH>;
+			default-state = "off";
+		};
+
+		radio_green {
+			label = "smartgw:radio:green";
+			gpios = <&gpio 24 GPIO_ACTIVE_HIGH>;
+			default-state = "off";
+		};
+
+		radio_red {
+			label = "smartgw:radio:red";
+			gpios = <&gpio 25 GPIO_ACTIVE_HIGH>;
+			default-state = "off";
+		};
+
+		internet_blue {
+			label = "smartgw:internet:blue";
+			gpios = <&gpio 26 GPIO_ACTIVE_HIGH>;
+			default-state = "off";
+		};
+
+		internet_green {
+			label = "smartgw:internet:green";
+			gpios = <&gpio 27 GPIO_ACTIVE_HIGH>;
+			default-state = "off";
+		};
+
+		internet_red {
+			label = "smartgw:internet:red";
+			gpios = <&gpio 28 GPIO_ACTIVE_HIGH>;
+			default-state = "off";
+		};
+
+		ethernet_link {
+			label = "smartgw:eth:link";
+			gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "netdev";
+		};
+
+		ethernet_activity {
+			label = "smartgw:eth:act";
+			gpios = <&gpio 43 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "netdev";
+		};
+	};
+
+	aliases {
+		serial0 = &uart0;
+	};
+};
+
+&i2c {
+	status = "okay";
+};
+
+&spi {
+	status = "okay";
+
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinmux_spi_spi>, <&pinmux_spi_cs1_cs>;
+
+	m25p80@0 {
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <40000000>;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition@0 {
+				label = "uboot";
+				reg = <0x0 0xa0000>;
+				read-only;
+			};
+
+			partition@a0000 {
+				label = "uboot_env0";
+				reg = <0xa0000 0x10000>;
+			};
+
+			partition@b0000 {
+				label = "uboot_env1";
+				reg = <0xb0000 0x10000>;
+			};
+
+			factory: partition@c0000 {
+				label = "factory";
+				reg = <0xc0000 0x10000>;
+				read-only;
+			};
+		};
+	};
+
+	nand_flash@1 {
+		compatible = "spi-nand";
+		linux,mtd-name = "gd5f";
+		reg = <1>;
+		spi-max-frequency = <40000000>;
+	};
+};
+
+&uart1 {
+	status = "okay";
+
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinmux_i2s_gpio>;		/* GPIO0..3 */
+
+	rts-gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
+	cts-gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
+};
+
+&uart2 {
+	status = "okay";
+
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinmux_p2led_an_gpio>,	/* GPIO41 */
+		    <&pinmux_p3led_an_gpio>;	/* GPIO40 */
+
+	rts-gpios = <&gpio 40 GPIO_ACTIVE_LOW>;
+	cts-gpios = <&gpio 41 GPIO_ACTIVE_LOW>;
+};
+
+&watchdog {
+	status = "okay";
+};
Signature · 1 line
2.22.0
#6 lore raw
In reply to Stefan Roese

Hello,

Quoted 1 line · Stefan Roese

This patch adds the I2C controller description to the MT7628A dtsi file.

Series applied to mips-next.

Quoted 23 lines

MIPS: ralink: mt7628a.dtsi: Add I2C controller DT node
commit cd5f9e4fd879
https://git.kernel.org/mips/c/cd5f9e4fd879

dt-bindings: mips: Add missing mt7688a-soc compatible
commit cf892abfab77
https://git.kernel.org/mips/c/cf892abfab77

dt-bindings: mips: Add gardena vendor prefix and board description
commit 4ce8a03c4176
https://git.kernel.org/mips/c/4ce8a03c4176

Quoted 6 lines

MIPS: ralink: Add GARDENA smart Gateway MT7688 board
commit 376357aca715
https://git.kernel.org/mips/c/376357aca715

Thanks,
Paul

[ This message was auto-generated; if you believe anything is incorrect
then please email [email protected] to report it. ]