All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] usb: renesas_usbhs: Add RZ/A1 support
@ 2018-01-04 20:01 ` Chris Brandt
  0 siblings, 0 replies; 32+ messages in thread
From: Chris Brandt @ 2018-01-04 20:01 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring, Mark Rutland, Simon Horman
  Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-renesas-soc-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Chris Brandt

This series adds RZ/A1 gadget support to the renesas_usbhs driver.
Basically, it's almost the same HW as the R-Car (and SH) parts.
The only real difference is the some extra registers for the PHY.

This was tested on an RSK board by connecting to a PC as an
Ethernet CDC gadget.

Chris Brandt (3):
  usb: renesas_usbhs: Add support for RZ/A1
  dt-bindings: usb: renesas_usbhs: Add support for RZ/A1
  ARM: dts: r7s72100: add USB device to device tree

 .../devicetree/bindings/usb/renesas_usbhs.txt      |  2 +
 arch/arm/boot/dts/r7s72100.dtsi                    | 20 +++++++++
 drivers/usb/renesas_usbhs/Makefile                 |  2 +-
 drivers/usb/renesas_usbhs/common.c                 | 17 +++++++
 drivers/usb/renesas_usbhs/common.h                 |  6 +++
 drivers/usb/renesas_usbhs/rza.c                    | 52 ++++++++++++++++++++++
 drivers/usb/renesas_usbhs/rza.h                    |  4 ++
 include/linux/usb/renesas_usbhs.h                  |  1 +
 8 files changed, 103 insertions(+), 1 deletion(-)
 create mode 100644 drivers/usb/renesas_usbhs/rza.c
 create mode 100644 drivers/usb/renesas_usbhs/rza.h

-- 
2.15.1


--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 0/3] usb: renesas_usbhs: Add RZ/A1 support
@ 2018-01-04 20:01 ` Chris Brandt
  0 siblings, 0 replies; 32+ messages in thread
From: Chris Brandt @ 2018-01-04 20:01 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring, Mark Rutland, Simon Horman
  Cc: linux-usb, linux-renesas-soc, devicetree, Chris Brandt

This series adds RZ/A1 gadget support to the renesas_usbhs driver.
Basically, it's almost the same HW as the R-Car (and SH) parts.
The only real difference is the some extra registers for the PHY.

This was tested on an RSK board by connecting to a PC as an
Ethernet CDC gadget.

Chris Brandt (3):
  usb: renesas_usbhs: Add support for RZ/A1
  dt-bindings: usb: renesas_usbhs: Add support for RZ/A1
  ARM: dts: r7s72100: add USB device to device tree

 .../devicetree/bindings/usb/renesas_usbhs.txt      |  2 +
 arch/arm/boot/dts/r7s72100.dtsi                    | 20 +++++++++
 drivers/usb/renesas_usbhs/Makefile                 |  2 +-
 drivers/usb/renesas_usbhs/common.c                 | 17 +++++++
 drivers/usb/renesas_usbhs/common.h                 |  6 +++
 drivers/usb/renesas_usbhs/rza.c                    | 52 ++++++++++++++++++++++
 drivers/usb/renesas_usbhs/rza.h                    |  4 ++
 include/linux/usb/renesas_usbhs.h                  |  1 +
 8 files changed, 103 insertions(+), 1 deletion(-)
 create mode 100644 drivers/usb/renesas_usbhs/rza.c
 create mode 100644 drivers/usb/renesas_usbhs/rza.h

-- 
2.15.1

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

* [PATCH 1/3] usb: renesas_usbhs: Add support for RZ/A1
  2018-01-04 20:01 ` Chris Brandt
  (?)
@ 2018-01-04 20:01     ` Chris Brandt
  -1 siblings, 0 replies; 32+ messages in thread
From: Chris Brandt @ 2018-01-04 20:01 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring, Mark Rutland, Simon Horman
  Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-renesas-soc-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Chris Brandt

This patch adds the capability to support RZ/A1 SoCs.

Signed-off-by: Chris Brandt <chris.brandt-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
---
 drivers/usb/renesas_usbhs/Makefile |  2 +-
 drivers/usb/renesas_usbhs/common.c | 17 +++++++++++++
 drivers/usb/renesas_usbhs/common.h |  6 +++++
 drivers/usb/renesas_usbhs/rza.c    | 52 ++++++++++++++++++++++++++++++++++++++
 drivers/usb/renesas_usbhs/rza.h    |  4 +++
 include/linux/usb/renesas_usbhs.h  |  1 +
 6 files changed, 81 insertions(+), 1 deletion(-)
 create mode 100644 drivers/usb/renesas_usbhs/rza.c
 create mode 100644 drivers/usb/renesas_usbhs/rza.h

diff --git a/drivers/usb/renesas_usbhs/Makefile b/drivers/usb/renesas_usbhs/Makefile
index fac147a3ad23..5c5b51bb48ef 100644
--- a/drivers/usb/renesas_usbhs/Makefile
+++ b/drivers/usb/renesas_usbhs/Makefile
@@ -5,7 +5,7 @@
 
 obj-$(CONFIG_USB_RENESAS_USBHS)	+= renesas_usbhs.o
 
-renesas_usbhs-y			:= common.o mod.o pipe.o fifo.o rcar2.o rcar3.o
+renesas_usbhs-y			:= common.o mod.o pipe.o fifo.o rcar2.o rcar3.o rza.o
 
 ifneq ($(CONFIG_USB_RENESAS_USBHS_HCD),)
 	renesas_usbhs-y		+= mod_host.o
diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c
index c5289b3ecf8d..2abefd3d6050 100644
--- a/drivers/usb/renesas_usbhs/common.c
+++ b/drivers/usb/renesas_usbhs/common.c
@@ -17,6 +17,7 @@
 #include "common.h"
 #include "rcar2.h"
 #include "rcar3.h"
+#include "rza.h"
 
 /*
  *		image of renesas_usbhs
@@ -480,6 +481,10 @@ static const struct of_device_id usbhs_of_match[] = {
 		.compatible = "renesas,usbhs-r8a77995",
 		.data = (void *)USBHS_TYPE_RCAR_GEN3_WITH_PLL,
 	},
+	{
+		.compatible = "renesas,usbhs-r7s72100",
+		.data = (void *)USBHS_TYPE_RZA1,
+	},
 	{
 		.compatible = "renesas,rcar-gen2-usbhs",
 		.data = (void *)USBHS_TYPE_RCAR_GEN2,
@@ -488,6 +493,10 @@ static const struct of_device_id usbhs_of_match[] = {
 		.compatible = "renesas,rcar-gen3-usbhs",
 		.data = (void *)USBHS_TYPE_RCAR_GEN3,
 	},
+	{
+		.compatible = "renesas,rza1-usbhs",
+		.data = (void *)USBHS_TYPE_RZA1,
+	},
 	{ },
 };
 MODULE_DEVICE_TABLE(of, usbhs_of_match);
@@ -520,6 +529,11 @@ static struct renesas_usbhs_platform_info *usbhs_parse_dt(struct device *dev)
 		dparam->pipe_size = ARRAY_SIZE(usbhsc_new_pipe);
 	}
 
+	if (dparam->type == USBHS_TYPE_RZA1) {
+		dparam->pipe_configs = usbhsc_new_pipe;
+		dparam->pipe_size = ARRAY_SIZE(usbhsc_new_pipe);
+	}
+
 	return info;
 }
 
@@ -591,6 +605,9 @@ static int usbhs_probe(struct platform_device *pdev)
 				dev_err(&pdev->dev, "no notifier registered\n");
 		}
 		break;
+	case USBHS_TYPE_RZA1:
+		priv->pfunc = usbhs_rza1_ops;
+		break;
 	default:
 		if (!info->platform_callback.get_id) {
 			dev_err(&pdev->dev, "no platform callbacks");
diff --git a/drivers/usb/renesas_usbhs/common.h b/drivers/usb/renesas_usbhs/common.h
index c9747f064601..f619afeae2b8 100644
--- a/drivers/usb/renesas_usbhs/common.h
+++ b/drivers/usb/renesas_usbhs/common.h
@@ -98,6 +98,7 @@ struct usbhs_priv;
 #define D2FIFOCTR	0x00F2	/* for R-Car Gen2 */
 #define D3FIFOSEL	0x00F4	/* for R-Car Gen2 */
 #define D3FIFOCTR	0x00F6	/* for R-Car Gen2 */
+#define SUSPMODE	0x0102	/* for RZ/A */
 
 /* SYSCFG */
 #define SCKE	(1 << 10)	/* USB Module Clock Enable */
@@ -106,6 +107,8 @@ struct usbhs_priv;
 #define DRPD	(1 << 5)	/* D+ Line/D- Line Resistance Control */
 #define DPRPU	(1 << 4)	/* D+ Line Resistance Control */
 #define USBE	(1 << 0)	/* USB Module Operation Enable */
+#define UCKSEL	(1 << 2)	/* Clock Select for RZ/A1 */
+#define UPLLE	(1 << 1)	/* USB PLL Enable for RZ/A1 */
 
 /* DVSTCTR */
 #define EXTLP	(1 << 10)	/* Controls the EXTLP pin output state */
@@ -233,6 +236,9 @@ struct usbhs_priv;
 #define USBSPD_SPEED_FULL	0x2
 #define USBSPD_SPEED_HIGH	0x3
 
+/* SUSPMODE */
+#define SUSPM		(1 << 14)	/* SuspendM Control */
+
 /*
  *		struct
  */
diff --git a/drivers/usb/renesas_usbhs/rza.c b/drivers/usb/renesas_usbhs/rza.c
new file mode 100644
index 000000000000..b76e836d2c3d
--- /dev/null
+++ b/drivers/usb/renesas_usbhs/rza.c
@@ -0,0 +1,52 @@
+// SPDX-License-Identifier: GPL-1.0+
+/*
+ * Renesas USB driver RZ/A initialization and power control
+ *
+ * Copyright (C) 2018 Chris Brandt
+ * Copyright (C) 2018 Renesas Electronics Corporation
+ */
+
+#include <linux/delay.h>
+#include <linux/io.h>
+#include <linux/of_device.h>
+#include "common.h"
+#include "rza.h"
+
+static int usbhs_rza1_hardware_init(struct platform_device *pdev)
+{
+	struct usbhs_priv *priv = usbhs_pdev_to_priv(pdev);
+	struct device_node *usb_x1_clk, *extal_clk;
+	u32 freq_usb = 0, freq_extal = 0;
+
+	/* Input Clock Selection (NOTE: ch0 controls both ch0 and ch1) */
+	usb_x1_clk = of_find_node_by_name(NULL, "usb_x1");
+	extal_clk = of_find_node_by_name(NULL, "extal");
+	of_property_read_u32(usb_x1_clk, "clock-frequency", &freq_usb);
+	of_property_read_u32(extal_clk, "clock-frequency", &freq_extal);
+	if (freq_usb == 0) {
+		if (freq_extal == 12000000) {
+			/* Select 12MHz XTAL */
+			usbhs_bset(priv, SYSCFG, UCKSEL, UCKSEL);
+		} else {
+			dev_err(usbhs_priv_to_dev(priv), "A 48MHz USB clock or 12MHz main clock is required.\n");
+			return -EIO;
+		}
+	}
+
+	/* Enable USB PLL (NOTE: ch0 controls both ch0 and ch1) */
+	usbhs_bset(priv, SYSCFG, UPLLE, UPLLE);
+	udelay(1000);
+	usbhs_bset(priv, SUSPMODE, SUSPM, SUSPM);
+
+	return 0;
+}
+
+static int usbhs_rza_get_id(struct platform_device *pdev)
+{
+	return USBHS_GADGET;
+}
+
+const struct renesas_usbhs_platform_callback usbhs_rza1_ops = {
+	.hardware_init = usbhs_rza1_hardware_init,
+	.get_id = usbhs_rza_get_id,
+};
diff --git a/drivers/usb/renesas_usbhs/rza.h b/drivers/usb/renesas_usbhs/rza.h
new file mode 100644
index 000000000000..ca917ca54f6d
--- /dev/null
+++ b/drivers/usb/renesas_usbhs/rza.h
@@ -0,0 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
+#include "common.h"
+
+extern const struct renesas_usbhs_platform_callback usbhs_rza1_ops;
diff --git a/include/linux/usb/renesas_usbhs.h b/include/linux/usb/renesas_usbhs.h
index 9482735d4ca5..53924f8e840c 100644
--- a/include/linux/usb/renesas_usbhs.h
+++ b/include/linux/usb/renesas_usbhs.h
@@ -195,6 +195,7 @@ struct renesas_usbhs_driver_param {
 #define USBHS_TYPE_RCAR_GEN2		1
 #define USBHS_TYPE_RCAR_GEN3		2
 #define USBHS_TYPE_RCAR_GEN3_WITH_PLL	3
+#define USBHS_TYPE_RZA1			4
 
 /*
  * option:
-- 
2.15.1


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 1/3] usb: renesas_usbhs: Add support for RZ/A1
@ 2018-01-04 20:01     ` Chris Brandt
  0 siblings, 0 replies; 32+ messages in thread
From: Chris Brandt @ 2018-01-04 20:01 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring, Mark Rutland, Simon Horman
  Cc: linux-usb, linux-renesas-soc, devicetree, Chris Brandt

This patch adds the capability to support RZ/A1 SoCs.

Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
---
 drivers/usb/renesas_usbhs/Makefile |  2 +-
 drivers/usb/renesas_usbhs/common.c | 17 +++++++++++++
 drivers/usb/renesas_usbhs/common.h |  6 +++++
 drivers/usb/renesas_usbhs/rza.c    | 52 ++++++++++++++++++++++++++++++++++++++
 drivers/usb/renesas_usbhs/rza.h    |  4 +++
 include/linux/usb/renesas_usbhs.h  |  1 +
 6 files changed, 81 insertions(+), 1 deletion(-)
 create mode 100644 drivers/usb/renesas_usbhs/rza.c
 create mode 100644 drivers/usb/renesas_usbhs/rza.h

diff --git a/drivers/usb/renesas_usbhs/Makefile b/drivers/usb/renesas_usbhs/Makefile
index fac147a3ad23..5c5b51bb48ef 100644
--- a/drivers/usb/renesas_usbhs/Makefile
+++ b/drivers/usb/renesas_usbhs/Makefile
@@ -5,7 +5,7 @@
 
 obj-$(CONFIG_USB_RENESAS_USBHS)	+= renesas_usbhs.o
 
-renesas_usbhs-y			:= common.o mod.o pipe.o fifo.o rcar2.o rcar3.o
+renesas_usbhs-y			:= common.o mod.o pipe.o fifo.o rcar2.o rcar3.o rza.o
 
 ifneq ($(CONFIG_USB_RENESAS_USBHS_HCD),)
 	renesas_usbhs-y		+= mod_host.o
diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c
index c5289b3ecf8d..2abefd3d6050 100644
--- a/drivers/usb/renesas_usbhs/common.c
+++ b/drivers/usb/renesas_usbhs/common.c
@@ -17,6 +17,7 @@
 #include "common.h"
 #include "rcar2.h"
 #include "rcar3.h"
+#include "rza.h"
 
 /*
  *		image of renesas_usbhs
@@ -480,6 +481,10 @@ static const struct of_device_id usbhs_of_match[] = {
 		.compatible = "renesas,usbhs-r8a77995",
 		.data = (void *)USBHS_TYPE_RCAR_GEN3_WITH_PLL,
 	},
+	{
+		.compatible = "renesas,usbhs-r7s72100",
+		.data = (void *)USBHS_TYPE_RZA1,
+	},
 	{
 		.compatible = "renesas,rcar-gen2-usbhs",
 		.data = (void *)USBHS_TYPE_RCAR_GEN2,
@@ -488,6 +493,10 @@ static const struct of_device_id usbhs_of_match[] = {
 		.compatible = "renesas,rcar-gen3-usbhs",
 		.data = (void *)USBHS_TYPE_RCAR_GEN3,
 	},
+	{
+		.compatible = "renesas,rza1-usbhs",
+		.data = (void *)USBHS_TYPE_RZA1,
+	},
 	{ },
 };
 MODULE_DEVICE_TABLE(of, usbhs_of_match);
@@ -520,6 +529,11 @@ static struct renesas_usbhs_platform_info *usbhs_parse_dt(struct device *dev)
 		dparam->pipe_size = ARRAY_SIZE(usbhsc_new_pipe);
 	}
 
+	if (dparam->type == USBHS_TYPE_RZA1) {
+		dparam->pipe_configs = usbhsc_new_pipe;
+		dparam->pipe_size = ARRAY_SIZE(usbhsc_new_pipe);
+	}
+
 	return info;
 }
 
@@ -591,6 +605,9 @@ static int usbhs_probe(struct platform_device *pdev)
 				dev_err(&pdev->dev, "no notifier registered\n");
 		}
 		break;
+	case USBHS_TYPE_RZA1:
+		priv->pfunc = usbhs_rza1_ops;
+		break;
 	default:
 		if (!info->platform_callback.get_id) {
 			dev_err(&pdev->dev, "no platform callbacks");
diff --git a/drivers/usb/renesas_usbhs/common.h b/drivers/usb/renesas_usbhs/common.h
index c9747f064601..f619afeae2b8 100644
--- a/drivers/usb/renesas_usbhs/common.h
+++ b/drivers/usb/renesas_usbhs/common.h
@@ -98,6 +98,7 @@ struct usbhs_priv;
 #define D2FIFOCTR	0x00F2	/* for R-Car Gen2 */
 #define D3FIFOSEL	0x00F4	/* for R-Car Gen2 */
 #define D3FIFOCTR	0x00F6	/* for R-Car Gen2 */
+#define SUSPMODE	0x0102	/* for RZ/A */
 
 /* SYSCFG */
 #define SCKE	(1 << 10)	/* USB Module Clock Enable */
@@ -106,6 +107,8 @@ struct usbhs_priv;
 #define DRPD	(1 << 5)	/* D+ Line/D- Line Resistance Control */
 #define DPRPU	(1 << 4)	/* D+ Line Resistance Control */
 #define USBE	(1 << 0)	/* USB Module Operation Enable */
+#define UCKSEL	(1 << 2)	/* Clock Select for RZ/A1 */
+#define UPLLE	(1 << 1)	/* USB PLL Enable for RZ/A1 */
 
 /* DVSTCTR */
 #define EXTLP	(1 << 10)	/* Controls the EXTLP pin output state */
@@ -233,6 +236,9 @@ struct usbhs_priv;
 #define USBSPD_SPEED_FULL	0x2
 #define USBSPD_SPEED_HIGH	0x3
 
+/* SUSPMODE */
+#define SUSPM		(1 << 14)	/* SuspendM Control */
+
 /*
  *		struct
  */
diff --git a/drivers/usb/renesas_usbhs/rza.c b/drivers/usb/renesas_usbhs/rza.c
new file mode 100644
index 000000000000..b76e836d2c3d
--- /dev/null
+++ b/drivers/usb/renesas_usbhs/rza.c
@@ -0,0 +1,52 @@
+// SPDX-License-Identifier: GPL-1.0+
+/*
+ * Renesas USB driver RZ/A initialization and power control
+ *
+ * Copyright (C) 2018 Chris Brandt
+ * Copyright (C) 2018 Renesas Electronics Corporation
+ */
+
+#include <linux/delay.h>
+#include <linux/io.h>
+#include <linux/of_device.h>
+#include "common.h"
+#include "rza.h"
+
+static int usbhs_rza1_hardware_init(struct platform_device *pdev)
+{
+	struct usbhs_priv *priv = usbhs_pdev_to_priv(pdev);
+	struct device_node *usb_x1_clk, *extal_clk;
+	u32 freq_usb = 0, freq_extal = 0;
+
+	/* Input Clock Selection (NOTE: ch0 controls both ch0 and ch1) */
+	usb_x1_clk = of_find_node_by_name(NULL, "usb_x1");
+	extal_clk = of_find_node_by_name(NULL, "extal");
+	of_property_read_u32(usb_x1_clk, "clock-frequency", &freq_usb);
+	of_property_read_u32(extal_clk, "clock-frequency", &freq_extal);
+	if (freq_usb == 0) {
+		if (freq_extal == 12000000) {
+			/* Select 12MHz XTAL */
+			usbhs_bset(priv, SYSCFG, UCKSEL, UCKSEL);
+		} else {
+			dev_err(usbhs_priv_to_dev(priv), "A 48MHz USB clock or 12MHz main clock is required.\n");
+			return -EIO;
+		}
+	}
+
+	/* Enable USB PLL (NOTE: ch0 controls both ch0 and ch1) */
+	usbhs_bset(priv, SYSCFG, UPLLE, UPLLE);
+	udelay(1000);
+	usbhs_bset(priv, SUSPMODE, SUSPM, SUSPM);
+
+	return 0;
+}
+
+static int usbhs_rza_get_id(struct platform_device *pdev)
+{
+	return USBHS_GADGET;
+}
+
+const struct renesas_usbhs_platform_callback usbhs_rza1_ops = {
+	.hardware_init = usbhs_rza1_hardware_init,
+	.get_id = usbhs_rza_get_id,
+};
diff --git a/drivers/usb/renesas_usbhs/rza.h b/drivers/usb/renesas_usbhs/rza.h
new file mode 100644
index 000000000000..ca917ca54f6d
--- /dev/null
+++ b/drivers/usb/renesas_usbhs/rza.h
@@ -0,0 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
+#include "common.h"
+
+extern const struct renesas_usbhs_platform_callback usbhs_rza1_ops;
diff --git a/include/linux/usb/renesas_usbhs.h b/include/linux/usb/renesas_usbhs.h
index 9482735d4ca5..53924f8e840c 100644
--- a/include/linux/usb/renesas_usbhs.h
+++ b/include/linux/usb/renesas_usbhs.h
@@ -195,6 +195,7 @@ struct renesas_usbhs_driver_param {
 #define USBHS_TYPE_RCAR_GEN2		1
 #define USBHS_TYPE_RCAR_GEN3		2
 #define USBHS_TYPE_RCAR_GEN3_WITH_PLL	3
+#define USBHS_TYPE_RZA1			4
 
 /*
  * option:
-- 
2.15.1



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

* [1/3] usb: renesas_usbhs: Add support for RZ/A1
@ 2018-01-04 20:01     ` Chris Brandt
  0 siblings, 0 replies; 32+ messages in thread
From: Chris Brandt @ 2018-01-04 20:01 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring, Mark Rutland, Simon Horman
  Cc: linux-usb, linux-renesas-soc, devicetree, Chris Brandt

This patch adds the capability to support RZ/A1 SoCs.

Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
---
 drivers/usb/renesas_usbhs/Makefile |  2 +-
 drivers/usb/renesas_usbhs/common.c | 17 +++++++++++++
 drivers/usb/renesas_usbhs/common.h |  6 +++++
 drivers/usb/renesas_usbhs/rza.c    | 52 ++++++++++++++++++++++++++++++++++++++
 drivers/usb/renesas_usbhs/rza.h    |  4 +++
 include/linux/usb/renesas_usbhs.h  |  1 +
 6 files changed, 81 insertions(+), 1 deletion(-)
 create mode 100644 drivers/usb/renesas_usbhs/rza.c
 create mode 100644 drivers/usb/renesas_usbhs/rza.h

diff --git a/drivers/usb/renesas_usbhs/Makefile b/drivers/usb/renesas_usbhs/Makefile
index fac147a3ad23..5c5b51bb48ef 100644
--- a/drivers/usb/renesas_usbhs/Makefile
+++ b/drivers/usb/renesas_usbhs/Makefile
@@ -5,7 +5,7 @@
 
 obj-$(CONFIG_USB_RENESAS_USBHS)	+= renesas_usbhs.o
 
-renesas_usbhs-y			:= common.o mod.o pipe.o fifo.o rcar2.o rcar3.o
+renesas_usbhs-y			:= common.o mod.o pipe.o fifo.o rcar2.o rcar3.o rza.o
 
 ifneq ($(CONFIG_USB_RENESAS_USBHS_HCD),)
 	renesas_usbhs-y		+= mod_host.o
diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c
index c5289b3ecf8d..2abefd3d6050 100644
--- a/drivers/usb/renesas_usbhs/common.c
+++ b/drivers/usb/renesas_usbhs/common.c
@@ -17,6 +17,7 @@
 #include "common.h"
 #include "rcar2.h"
 #include "rcar3.h"
+#include "rza.h"
 
 /*
  *		image of renesas_usbhs
@@ -480,6 +481,10 @@ static const struct of_device_id usbhs_of_match[] = {
 		.compatible = "renesas,usbhs-r8a77995",
 		.data = (void *)USBHS_TYPE_RCAR_GEN3_WITH_PLL,
 	},
+	{
+		.compatible = "renesas,usbhs-r7s72100",
+		.data = (void *)USBHS_TYPE_RZA1,
+	},
 	{
 		.compatible = "renesas,rcar-gen2-usbhs",
 		.data = (void *)USBHS_TYPE_RCAR_GEN2,
@@ -488,6 +493,10 @@ static const struct of_device_id usbhs_of_match[] = {
 		.compatible = "renesas,rcar-gen3-usbhs",
 		.data = (void *)USBHS_TYPE_RCAR_GEN3,
 	},
+	{
+		.compatible = "renesas,rza1-usbhs",
+		.data = (void *)USBHS_TYPE_RZA1,
+	},
 	{ },
 };
 MODULE_DEVICE_TABLE(of, usbhs_of_match);
@@ -520,6 +529,11 @@ static struct renesas_usbhs_platform_info *usbhs_parse_dt(struct device *dev)
 		dparam->pipe_size = ARRAY_SIZE(usbhsc_new_pipe);
 	}
 
+	if (dparam->type == USBHS_TYPE_RZA1) {
+		dparam->pipe_configs = usbhsc_new_pipe;
+		dparam->pipe_size = ARRAY_SIZE(usbhsc_new_pipe);
+	}
+
 	return info;
 }
 
@@ -591,6 +605,9 @@ static int usbhs_probe(struct platform_device *pdev)
 				dev_err(&pdev->dev, "no notifier registered\n");
 		}
 		break;
+	case USBHS_TYPE_RZA1:
+		priv->pfunc = usbhs_rza1_ops;
+		break;
 	default:
 		if (!info->platform_callback.get_id) {
 			dev_err(&pdev->dev, "no platform callbacks");
diff --git a/drivers/usb/renesas_usbhs/common.h b/drivers/usb/renesas_usbhs/common.h
index c9747f064601..f619afeae2b8 100644
--- a/drivers/usb/renesas_usbhs/common.h
+++ b/drivers/usb/renesas_usbhs/common.h
@@ -98,6 +98,7 @@ struct usbhs_priv;
 #define D2FIFOCTR	0x00F2	/* for R-Car Gen2 */
 #define D3FIFOSEL	0x00F4	/* for R-Car Gen2 */
 #define D3FIFOCTR	0x00F6	/* for R-Car Gen2 */
+#define SUSPMODE	0x0102	/* for RZ/A */
 
 /* SYSCFG */
 #define SCKE	(1 << 10)	/* USB Module Clock Enable */
@@ -106,6 +107,8 @@ struct usbhs_priv;
 #define DRPD	(1 << 5)	/* D+ Line/D- Line Resistance Control */
 #define DPRPU	(1 << 4)	/* D+ Line Resistance Control */
 #define USBE	(1 << 0)	/* USB Module Operation Enable */
+#define UCKSEL	(1 << 2)	/* Clock Select for RZ/A1 */
+#define UPLLE	(1 << 1)	/* USB PLL Enable for RZ/A1 */
 
 /* DVSTCTR */
 #define EXTLP	(1 << 10)	/* Controls the EXTLP pin output state */
@@ -233,6 +236,9 @@ struct usbhs_priv;
 #define USBSPD_SPEED_FULL	0x2
 #define USBSPD_SPEED_HIGH	0x3
 
+/* SUSPMODE */
+#define SUSPM		(1 << 14)	/* SuspendM Control */
+
 /*
  *		struct
  */
diff --git a/drivers/usb/renesas_usbhs/rza.c b/drivers/usb/renesas_usbhs/rza.c
new file mode 100644
index 000000000000..b76e836d2c3d
--- /dev/null
+++ b/drivers/usb/renesas_usbhs/rza.c
@@ -0,0 +1,52 @@
+// SPDX-License-Identifier: GPL-1.0+
+/*
+ * Renesas USB driver RZ/A initialization and power control
+ *
+ * Copyright (C) 2018 Chris Brandt
+ * Copyright (C) 2018 Renesas Electronics Corporation
+ */
+
+#include <linux/delay.h>
+#include <linux/io.h>
+#include <linux/of_device.h>
+#include "common.h"
+#include "rza.h"
+
+static int usbhs_rza1_hardware_init(struct platform_device *pdev)
+{
+	struct usbhs_priv *priv = usbhs_pdev_to_priv(pdev);
+	struct device_node *usb_x1_clk, *extal_clk;
+	u32 freq_usb = 0, freq_extal = 0;
+
+	/* Input Clock Selection (NOTE: ch0 controls both ch0 and ch1) */
+	usb_x1_clk = of_find_node_by_name(NULL, "usb_x1");
+	extal_clk = of_find_node_by_name(NULL, "extal");
+	of_property_read_u32(usb_x1_clk, "clock-frequency", &freq_usb);
+	of_property_read_u32(extal_clk, "clock-frequency", &freq_extal);
+	if (freq_usb == 0) {
+		if (freq_extal == 12000000) {
+			/* Select 12MHz XTAL */
+			usbhs_bset(priv, SYSCFG, UCKSEL, UCKSEL);
+		} else {
+			dev_err(usbhs_priv_to_dev(priv), "A 48MHz USB clock or 12MHz main clock is required.\n");
+			return -EIO;
+		}
+	}
+
+	/* Enable USB PLL (NOTE: ch0 controls both ch0 and ch1) */
+	usbhs_bset(priv, SYSCFG, UPLLE, UPLLE);
+	udelay(1000);
+	usbhs_bset(priv, SUSPMODE, SUSPM, SUSPM);
+
+	return 0;
+}
+
+static int usbhs_rza_get_id(struct platform_device *pdev)
+{
+	return USBHS_GADGET;
+}
+
+const struct renesas_usbhs_platform_callback usbhs_rza1_ops = {
+	.hardware_init = usbhs_rza1_hardware_init,
+	.get_id = usbhs_rza_get_id,
+};
diff --git a/drivers/usb/renesas_usbhs/rza.h b/drivers/usb/renesas_usbhs/rza.h
new file mode 100644
index 000000000000..ca917ca54f6d
--- /dev/null
+++ b/drivers/usb/renesas_usbhs/rza.h
@@ -0,0 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
+#include "common.h"
+
+extern const struct renesas_usbhs_platform_callback usbhs_rza1_ops;
diff --git a/include/linux/usb/renesas_usbhs.h b/include/linux/usb/renesas_usbhs.h
index 9482735d4ca5..53924f8e840c 100644
--- a/include/linux/usb/renesas_usbhs.h
+++ b/include/linux/usb/renesas_usbhs.h
@@ -195,6 +195,7 @@ struct renesas_usbhs_driver_param {
 #define USBHS_TYPE_RCAR_GEN2		1
 #define USBHS_TYPE_RCAR_GEN3		2
 #define USBHS_TYPE_RCAR_GEN3_WITH_PLL	3
+#define USBHS_TYPE_RZA1			4
 
 /*
  * option:

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

* [PATCH 2/3] dt-bindings: usb: renesas_usbhs: Add support for RZ/A1
  2018-01-04 20:01 ` Chris Brandt
  (?)
@ 2018-01-04 20:01     ` Chris Brandt
  -1 siblings, 0 replies; 32+ messages in thread
From: Chris Brandt @ 2018-01-04 20:01 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring, Mark Rutland, Simon Horman
  Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-renesas-soc-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Chris Brandt

Document support for RZ/A1 SoCs

Signed-off-by: Chris Brandt <chris.brandt-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
---
 Documentation/devicetree/bindings/usb/renesas_usbhs.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
index 47394ab788e3..d060172f1529 100644
--- a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
+++ b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
@@ -13,8 +13,10 @@ Required properties:
 	- "renesas,usbhs-r8a7795" for r8a7795 (R-Car H3) compatible device
 	- "renesas,usbhs-r8a7796" for r8a7796 (R-Car M3-W) compatible device
 	- "renesas,usbhs-r8a77995" for r8a77995 (R-Car D3) compatible device
+	- "renesas,usbhs-r7s72100" for r7s72100 (RZ/A1) compatible device
 	- "renesas,rcar-gen2-usbhs" for R-Car Gen2 or RZ/G1 compatible devices
 	- "renesas,rcar-gen3-usbhs" for R-Car Gen3 compatible device
+	- "renesas,rza1-usbhs" for RZ/A1 compatible device
 
 	When compatible with the generic version, nodes must list the
 	SoC-specific version corresponding to the platform first followed
-- 
2.15.1


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 2/3] dt-bindings: usb: renesas_usbhs: Add support for RZ/A1
@ 2018-01-04 20:01     ` Chris Brandt
  0 siblings, 0 replies; 32+ messages in thread
From: Chris Brandt @ 2018-01-04 20:01 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring, Mark Rutland, Simon Horman
  Cc: linux-usb, linux-renesas-soc, devicetree, Chris Brandt

Document support for RZ/A1 SoCs

Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
---
 Documentation/devicetree/bindings/usb/renesas_usbhs.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
index 47394ab788e3..d060172f1529 100644
--- a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
+++ b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
@@ -13,8 +13,10 @@ Required properties:
 	- "renesas,usbhs-r8a7795" for r8a7795 (R-Car H3) compatible device
 	- "renesas,usbhs-r8a7796" for r8a7796 (R-Car M3-W) compatible device
 	- "renesas,usbhs-r8a77995" for r8a77995 (R-Car D3) compatible device
+	- "renesas,usbhs-r7s72100" for r7s72100 (RZ/A1) compatible device
 	- "renesas,rcar-gen2-usbhs" for R-Car Gen2 or RZ/G1 compatible devices
 	- "renesas,rcar-gen3-usbhs" for R-Car Gen3 compatible device
+	- "renesas,rza1-usbhs" for RZ/A1 compatible device
 
 	When compatible with the generic version, nodes must list the
 	SoC-specific version corresponding to the platform first followed
-- 
2.15.1



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

* [2/3] dt-bindings: usb: renesas_usbhs: Add support for RZ/A1
@ 2018-01-04 20:01     ` Chris Brandt
  0 siblings, 0 replies; 32+ messages in thread
From: Chris Brandt @ 2018-01-04 20:01 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring, Mark Rutland, Simon Horman
  Cc: linux-usb, linux-renesas-soc, devicetree, Chris Brandt

Document support for RZ/A1 SoCs

Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
---
 Documentation/devicetree/bindings/usb/renesas_usbhs.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
index 47394ab788e3..d060172f1529 100644
--- a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
+++ b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
@@ -13,8 +13,10 @@ Required properties:
 	- "renesas,usbhs-r8a7795" for r8a7795 (R-Car H3) compatible device
 	- "renesas,usbhs-r8a7796" for r8a7796 (R-Car M3-W) compatible device
 	- "renesas,usbhs-r8a77995" for r8a77995 (R-Car D3) compatible device
+	- "renesas,usbhs-r7s72100" for r7s72100 (RZ/A1) compatible device
 	- "renesas,rcar-gen2-usbhs" for R-Car Gen2 or RZ/G1 compatible devices
 	- "renesas,rcar-gen3-usbhs" for R-Car Gen3 compatible device
+	- "renesas,rza1-usbhs" for RZ/A1 compatible device
 
 	When compatible with the generic version, nodes must list the
 	SoC-specific version corresponding to the platform first followed

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

* [PATCH 3/3] ARM: dts: r7s72100: add USB device to device tree
  2018-01-04 20:01 ` Chris Brandt
  (?)
@ 2018-01-04 20:01     ` Chris Brandt
  -1 siblings, 0 replies; 32+ messages in thread
From: Chris Brandt @ 2018-01-04 20:01 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring, Mark Rutland, Simon Horman
  Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-renesas-soc-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Chris Brandt

Add USB device support.

Signed-off-by: Chris Brandt <chris.brandt-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
---
 arch/arm/boot/dts/r7s72100.dtsi | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/arch/arm/boot/dts/r7s72100.dtsi b/arch/arm/boot/dts/r7s72100.dtsi
index ab9645a42eca..eb414e735185 100644
--- a/arch/arm/boot/dts/r7s72100.dtsi
+++ b/arch/arm/boot/dts/r7s72100.dtsi
@@ -667,4 +667,24 @@
 		power-domains = <&cpg_clocks>;
 		status = "disabled";
 	};
+
+	usbhs0: usbhs@e8010000 {
+		compatible = "renesas,usbhs-r7s72100";
+		reg = <0xe8010000 0x1A0>;
+		interrupts = <GIC_SPI (73-32) IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp7_clks R7S72100_CLK_USB0>;
+		renesas,buswait = <4>;
+		power-domains = <&cpg_clocks>;
+		status = "disabled";
+	};
+
+	usbhs1: usbhs@e8207000 {
+		compatible = "renesas,usbhs-r7s72100";
+		reg = <0xe8207000 0x1A0>;
+		interrupts = <GIC_SPI (74-32) IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp7_clks R7S72100_CLK_USB1>;
+		renesas,buswait = <4>;
+		power-domains = <&cpg_clocks>;
+		status = "disabled";
+	};
 };
-- 
2.15.1


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 3/3] ARM: dts: r7s72100: add USB device to device tree
@ 2018-01-04 20:01     ` Chris Brandt
  0 siblings, 0 replies; 32+ messages in thread
From: Chris Brandt @ 2018-01-04 20:01 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring, Mark Rutland, Simon Horman
  Cc: linux-usb, linux-renesas-soc, devicetree, Chris Brandt

Add USB device support.

Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
---
 arch/arm/boot/dts/r7s72100.dtsi | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/arch/arm/boot/dts/r7s72100.dtsi b/arch/arm/boot/dts/r7s72100.dtsi
index ab9645a42eca..eb414e735185 100644
--- a/arch/arm/boot/dts/r7s72100.dtsi
+++ b/arch/arm/boot/dts/r7s72100.dtsi
@@ -667,4 +667,24 @@
 		power-domains = <&cpg_clocks>;
 		status = "disabled";
 	};
+
+	usbhs0: usbhs@e8010000 {
+		compatible = "renesas,usbhs-r7s72100";
+		reg = <0xe8010000 0x1A0>;
+		interrupts = <GIC_SPI (73-32) IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp7_clks R7S72100_CLK_USB0>;
+		renesas,buswait = <4>;
+		power-domains = <&cpg_clocks>;
+		status = "disabled";
+	};
+
+	usbhs1: usbhs@e8207000 {
+		compatible = "renesas,usbhs-r7s72100";
+		reg = <0xe8207000 0x1A0>;
+		interrupts = <GIC_SPI (74-32) IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp7_clks R7S72100_CLK_USB1>;
+		renesas,buswait = <4>;
+		power-domains = <&cpg_clocks>;
+		status = "disabled";
+	};
 };
-- 
2.15.1

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

* [3/3] ARM: dts: r7s72100: add USB device to device tree
@ 2018-01-04 20:01     ` Chris Brandt
  0 siblings, 0 replies; 32+ messages in thread
From: Chris Brandt @ 2018-01-04 20:01 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring, Mark Rutland, Simon Horman
  Cc: linux-usb, linux-renesas-soc, devicetree, Chris Brandt

Add USB device support.

Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
---
 arch/arm/boot/dts/r7s72100.dtsi | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/arch/arm/boot/dts/r7s72100.dtsi b/arch/arm/boot/dts/r7s72100.dtsi
index ab9645a42eca..eb414e735185 100644
--- a/arch/arm/boot/dts/r7s72100.dtsi
+++ b/arch/arm/boot/dts/r7s72100.dtsi
@@ -667,4 +667,24 @@
 		power-domains = <&cpg_clocks>;
 		status = "disabled";
 	};
+
+	usbhs0: usbhs@e8010000 {
+		compatible = "renesas,usbhs-r7s72100";
+		reg = <0xe8010000 0x1A0>;
+		interrupts = <GIC_SPI (73-32) IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp7_clks R7S72100_CLK_USB0>;
+		renesas,buswait = <4>;
+		power-domains = <&cpg_clocks>;
+		status = "disabled";
+	};
+
+	usbhs1: usbhs@e8207000 {
+		compatible = "renesas,usbhs-r7s72100";
+		reg = <0xe8207000 0x1A0>;
+		interrupts = <GIC_SPI (74-32) IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp7_clks R7S72100_CLK_USB1>;
+		renesas,buswait = <4>;
+		power-domains = <&cpg_clocks>;
+		status = "disabled";
+	};
 };

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

* Re: [PATCH 2/3] dt-bindings: usb: renesas_usbhs: Add support for RZ/A1
@ 2018-01-05  8:48       ` Geert Uytterhoeven
  0 siblings, 0 replies; 32+ messages in thread
From: Geert Uytterhoeven @ 2018-01-05  8:48 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Greg Kroah-Hartman, Rob Herring, Mark Rutland, Simon Horman,
	USB list, Linux-Renesas, devicetree

On Thu, Jan 4, 2018 at 9:01 PM, Chris Brandt <chris.brandt@renesas.com> wrote:
> Document support for RZ/A1 SoCs
>
> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* [2/3] dt-bindings: usb: renesas_usbhs: Add support for RZ/A1
@ 2018-01-05  8:48       ` Geert Uytterhoeven
  0 siblings, 0 replies; 32+ messages in thread
From: Geert Uytterhoeven @ 2018-01-05  8:48 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Greg Kroah-Hartman, Rob Herring, Mark Rutland, Simon Horman,
	USB list, Linux-Renesas, devicetree

On Thu, Jan 4, 2018 at 9:01 PM, Chris Brandt <chris.brandt@renesas.com> wrote:
> Document support for RZ/A1 SoCs
>
> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert
---
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 3/3] ARM: dts: r7s72100: add USB device to device tree
@ 2018-01-05  8:53       ` Geert Uytterhoeven
  0 siblings, 0 replies; 32+ messages in thread
From: Geert Uytterhoeven @ 2018-01-05  8:53 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Greg Kroah-Hartman, Rob Herring, Mark Rutland, Simon Horman,
	USB list, Linux-Renesas, devicetree

On Thu, Jan 4, 2018 at 9:01 PM, Chris Brandt <chris.brandt@renesas.com> wrote:
> Add USB device support.
>
> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Minor nits below.

> --- a/arch/arm/boot/dts/r7s72100.dtsi
> +++ b/arch/arm/boot/dts/r7s72100.dtsi
> @@ -667,4 +667,24 @@
>                 power-domains = <&cpg_clocks>;
>                 status = "disabled";
>         };
> +
> +       usbhs0: usbhs@e8010000 {
> +               compatible = "renesas,usbhs-r7s72100";
> +               reg = <0xe8010000 0x1A0>;

0x1a0

> +               interrupts = <GIC_SPI (73-32) IRQ_TYPE_LEVEL_HIGH>;

"41", all other interrupt properties already have the SPI offset subtracted?

> +               clocks = <&mstp7_clks R7S72100_CLK_USB0>;
> +               renesas,buswait = <4>;
> +               power-domains = <&cpg_clocks>;
> +               status = "disabled";
> +       };
> +
> +       usbhs1: usbhs@e8207000 {
> +               compatible = "renesas,usbhs-r7s72100";
> +               reg = <0xe8207000 0x1A0>;

0x1a0

> +               interrupts = <GIC_SPI (74-32) IRQ_TYPE_LEVEL_HIGH>;

"42", all other interrupt properties already have the SPI offset subtracted?

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* [3/3] ARM: dts: r7s72100: add USB device to device tree
@ 2018-01-05  8:53       ` Geert Uytterhoeven
  0 siblings, 0 replies; 32+ messages in thread
From: Geert Uytterhoeven @ 2018-01-05  8:53 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Greg Kroah-Hartman, Rob Herring, Mark Rutland, Simon Horman,
	USB list, Linux-Renesas, devicetree

On Thu, Jan 4, 2018 at 9:01 PM, Chris Brandt <chris.brandt@renesas.com> wrote:
> Add USB device support.
>
> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Minor nits below.

> --- a/arch/arm/boot/dts/r7s72100.dtsi
> +++ b/arch/arm/boot/dts/r7s72100.dtsi
> @@ -667,4 +667,24 @@
>                 power-domains = <&cpg_clocks>;
>                 status = "disabled";
>         };
> +
> +       usbhs0: usbhs@e8010000 {
> +               compatible = "renesas,usbhs-r7s72100";
> +               reg = <0xe8010000 0x1A0>;

0x1a0

> +               interrupts = <GIC_SPI (73-32) IRQ_TYPE_LEVEL_HIGH>;

"41", all other interrupt properties already have the SPI offset subtracted?

> +               clocks = <&mstp7_clks R7S72100_CLK_USB0>;
> +               renesas,buswait = <4>;
> +               power-domains = <&cpg_clocks>;
> +               status = "disabled";
> +       };
> +
> +       usbhs1: usbhs@e8207000 {
> +               compatible = "renesas,usbhs-r7s72100";
> +               reg = <0xe8207000 0x1A0>;

0x1a0

> +               interrupts = <GIC_SPI (74-32) IRQ_TYPE_LEVEL_HIGH>;

"42", all other interrupt properties already have the SPI offset subtracted?

Gr{oetje,eeting}s,

                        Geert
---
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 3/3] ARM: dts: r7s72100: add USB device to device tree
@ 2018-01-05  9:03       ` Sergei Shtylyov
  0 siblings, 0 replies; 32+ messages in thread
From: Sergei Shtylyov @ 2018-01-05  9:03 UTC (permalink / raw)
  To: Chris Brandt, Greg Kroah-Hartman, Rob Herring, Mark Rutland,
	Simon Horman
  Cc: linux-usb, linux-renesas-soc, devicetree

Hello!

On 1/4/2018 11:01 PM, Chris Brandt wrote:

> Add USB device support.
> 
> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
> ---
>   arch/arm/boot/dts/r7s72100.dtsi | 20 ++++++++++++++++++++
>   1 file changed, 20 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/r7s72100.dtsi b/arch/arm/boot/dts/r7s72100.dtsi
> index ab9645a42eca..eb414e735185 100644
> --- a/arch/arm/boot/dts/r7s72100.dtsi
> +++ b/arch/arm/boot/dts/r7s72100.dtsi
> @@ -667,4 +667,24 @@
>   		power-domains = <&cpg_clocks>;
>   		status = "disabled";
>   	};
> +
> +	usbhs0: usbhs@e8010000 {

    The node names should be generic, i.e "usb@e8010000".

> +		compatible = "renesas,usbhs-r7s72100";
> +		reg = <0xe8010000 0x1A0>;

    Lowercase in the hex values, please be consistent...

> +		interrupts = <GIC_SPI (73-32) IRQ_TYPE_LEVEL_HIGH>;
> +		clocks = <&mstp7_clks R7S72100_CLK_USB0>;
> +		renesas,buswait = <4>;
> +		power-domains = <&cpg_clocks>;
> +		status = "disabled";
> +	};
> +
> +	usbhs1: usbhs@e8207000 {
> +		compatible = "renesas,usbhs-r7s72100";
> +		reg = <0xe8207000 0x1A0>;
> +		interrupts = <GIC_SPI (74-32) IRQ_TYPE_LEVEL_HIGH>;
> +		clocks = <&mstp7_clks R7S72100_CLK_USB1>;
> +		renesas,buswait = <4>;
> +		power-domains = <&cpg_clocks>;
> +		status = "disabled";
> +	};
>   };

    The same comments for the 2nd device.

MBR, Sergei

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

* [3/3] ARM: dts: r7s72100: add USB device to device tree
@ 2018-01-05  9:03       ` Sergei Shtylyov
  0 siblings, 0 replies; 32+ messages in thread
From: Sergei Shtylyov @ 2018-01-05  9:03 UTC (permalink / raw)
  To: Chris Brandt, Greg Kroah-Hartman, Rob Herring, Mark Rutland,
	Simon Horman
  Cc: linux-usb, linux-renesas-soc, devicetree

Hello!

On 1/4/2018 11:01 PM, Chris Brandt wrote:

> Add USB device support.
> 
> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
> ---
>   arch/arm/boot/dts/r7s72100.dtsi | 20 ++++++++++++++++++++
>   1 file changed, 20 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/r7s72100.dtsi b/arch/arm/boot/dts/r7s72100.dtsi
> index ab9645a42eca..eb414e735185 100644
> --- a/arch/arm/boot/dts/r7s72100.dtsi
> +++ b/arch/arm/boot/dts/r7s72100.dtsi
> @@ -667,4 +667,24 @@
>   		power-domains = <&cpg_clocks>;
>   		status = "disabled";
>   	};
> +
> +	usbhs0: usbhs@e8010000 {

    The node names should be generic, i.e "usb@e8010000".

> +		compatible = "renesas,usbhs-r7s72100";
> +		reg = <0xe8010000 0x1A0>;

    Lowercase in the hex values, please be consistent...

> +		interrupts = <GIC_SPI (73-32) IRQ_TYPE_LEVEL_HIGH>;
> +		clocks = <&mstp7_clks R7S72100_CLK_USB0>;
> +		renesas,buswait = <4>;
> +		power-domains = <&cpg_clocks>;
> +		status = "disabled";
> +	};
> +
> +	usbhs1: usbhs@e8207000 {
> +		compatible = "renesas,usbhs-r7s72100";
> +		reg = <0xe8207000 0x1A0>;
> +		interrupts = <GIC_SPI (74-32) IRQ_TYPE_LEVEL_HIGH>;
> +		clocks = <&mstp7_clks R7S72100_CLK_USB1>;
> +		renesas,buswait = <4>;
> +		power-domains = <&cpg_clocks>;
> +		status = "disabled";
> +	};
>   };

    The same comments for the 2nd device.

MBR, Sergei
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 3/3] ARM: dts: r7s72100: add USB device to device tree
  2018-01-04 20:01     ` [PATCH 3/3] " Chris Brandt
  (?)
@ 2018-01-05  9:53         ` Simon Horman
  -1 siblings, 0 replies; 32+ messages in thread
From: Simon Horman @ 2018-01-05  9:53 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Greg Kroah-Hartman, Rob Herring, Mark Rutland,
	linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-renesas-soc-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA

On Thu, Jan 04, 2018 at 03:01:50PM -0500, Chris Brandt wrote:
> Add USB device support.
> 
> Signed-off-by: Chris Brandt <chris.brandt-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>

Hi Chris,

it looks like there have been some requests for (minor) changes to this
patch. Please consider addressing those and reposting.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 3/3] ARM: dts: r7s72100: add USB device to device tree
@ 2018-01-05  9:53         ` Simon Horman
  0 siblings, 0 replies; 32+ messages in thread
From: Simon Horman @ 2018-01-05  9:53 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Greg Kroah-Hartman, Rob Herring, Mark Rutland, linux-usb,
	linux-renesas-soc, devicetree

On Thu, Jan 04, 2018 at 03:01:50PM -0500, Chris Brandt wrote:
> Add USB device support.
> 
> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>

Hi Chris,

it looks like there have been some requests for (minor) changes to this
patch. Please consider addressing those and reposting.

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

* [3/3] ARM: dts: r7s72100: add USB device to device tree
@ 2018-01-05  9:53         ` Simon Horman
  0 siblings, 0 replies; 32+ messages in thread
From: Simon Horman @ 2018-01-05  9:53 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Greg Kroah-Hartman, Rob Herring, Mark Rutland, linux-usb,
	linux-renesas-soc, devicetree

On Thu, Jan 04, 2018 at 03:01:50PM -0500, Chris Brandt wrote:
> Add USB device support.
> 
> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>

Hi Chris,

it looks like there have been some requests for (minor) changes to this
patch. Please consider addressing those and reposting.
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* RE: [PATCH 3/3] ARM: dts: r7s72100: add USB device to device tree
  2018-01-05  9:03       ` [3/3] " Sergei Shtylyov
  (?)
@ 2018-01-05 12:42           ` Chris Brandt
  -1 siblings, 0 replies; 32+ messages in thread
From: Chris Brandt @ 2018-01-05 12:42 UTC (permalink / raw)
  To: Sergei Shtylyov, Greg Kroah-Hartman, Rob Herring, Mark Rutland,
	Simon Horman
  Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-renesas-soc-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 1133 bytes --]

On Friday, January 05, 2018, Sergei Shtylyov wrote:
> > +	usbhs0: usbhs@e8010000 {
> 
>     The node names should be generic, i.e "usb@e8010000".
> 
> > +		compatible = "renesas,usbhs-r7s72100";
> > +		reg = <0xe8010000 0x1A0>;
> 
>     Lowercase in the hex values, please be consistent...
> 
> > +		interrupts = <GIC_SPI (73-32) IRQ_TYPE_LEVEL_HIGH>;
> > +		clocks = <&mstp7_clks R7S72100_CLK_USB0>;
> > +		renesas,buswait = <4>;
> > +		power-domains = <&cpg_clocks>;
> > +		status = "disabled";
> > +	};
> > +
> > +	usbhs1: usbhs@e8207000 {
> > +		compatible = "renesas,usbhs-r7s72100";
> > +		reg = <0xe8207000 0x1A0>;
> > +		interrupts = <GIC_SPI (74-32) IRQ_TYPE_LEVEL_HIGH>;
> > +		clocks = <&mstp7_clks R7S72100_CLK_USB1>;
> > +		renesas,buswait = <4>;
> > +		power-domains = <&cpg_clocks>;
> > +		status = "disabled";
> > +	};
> >   };
> 
>     The same comments for the 2nd device.

Thank you for the review.

I'll make the changes and resubmit.

Chris

N‹§²æìr¸›yúèšØb²X¬¶Ç§vØ^–)Þº{.nÇ+‰·zøœzÚÞz)í…æèw*\x1fjg¬±¨\x1e¶‰šŽŠÝ¢j.ïÛ°\½½MŽúgjÌæa×\x02››–' ™©Þ¢¸\f¢·¦j:+v‰¨ŠwèjØm¶Ÿÿ¾\a«‘êçzZ+ƒùšŽŠÝ¢j"ú!¶i

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

* RE: [PATCH 3/3] ARM: dts: r7s72100: add USB device to device tree
@ 2018-01-05 12:42           ` Chris Brandt
  0 siblings, 0 replies; 32+ messages in thread
From: Chris Brandt @ 2018-01-05 12:42 UTC (permalink / raw)
  To: Sergei Shtylyov, Greg Kroah-Hartman, Rob Herring, Mark Rutland,
	Simon Horman
  Cc: linux-usb, linux-renesas-soc, devicetree

On Friday, January 05, 2018, Sergei Shtylyov wrote:
> > +	usbhs0: usbhs@e8010000 {
> 
>     The node names should be generic, i.e "usb@e8010000".
> 
> > +		compatible = "renesas,usbhs-r7s72100";
> > +		reg = <0xe8010000 0x1A0>;
> 
>     Lowercase in the hex values, please be consistent...
> 
> > +		interrupts = <GIC_SPI (73-32) IRQ_TYPE_LEVEL_HIGH>;
> > +		clocks = <&mstp7_clks R7S72100_CLK_USB0>;
> > +		renesas,buswait = <4>;
> > +		power-domains = <&cpg_clocks>;
> > +		status = "disabled";
> > +	};
> > +
> > +	usbhs1: usbhs@e8207000 {
> > +		compatible = "renesas,usbhs-r7s72100";
> > +		reg = <0xe8207000 0x1A0>;
> > +		interrupts = <GIC_SPI (74-32) IRQ_TYPE_LEVEL_HIGH>;
> > +		clocks = <&mstp7_clks R7S72100_CLK_USB1>;
> > +		renesas,buswait = <4>;
> > +		power-domains = <&cpg_clocks>;
> > +		status = "disabled";
> > +	};
> >   };
> 
>     The same comments for the 2nd device.

Thank you for the review.

I'll make the changes and resubmit.

Chris


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

* [3/3] ARM: dts: r7s72100: add USB device to device tree
@ 2018-01-05 12:42           ` Chris Brandt
  0 siblings, 0 replies; 32+ messages in thread
From: Chris Brandt @ 2018-01-05 12:42 UTC (permalink / raw)
  To: Sergei Shtylyov, Greg Kroah-Hartman, Rob Herring, Mark Rutland,
	Simon Horman
  Cc: linux-usb, linux-renesas-soc, devicetree

T24gRnJpZGF5LCBKYW51YXJ5IDA1LCAyMDE4LCBTZXJnZWkgU2h0eWx5b3Ygd3JvdGU6DQo+ID4g
Kwl1c2JoczA6IHVzYmhzQGU4MDEwMDAwIHsNCj4gDQo+ICAgICBUaGUgbm9kZSBuYW1lcyBzaG91
bGQgYmUgZ2VuZXJpYywgaS5lICJ1c2JAZTgwMTAwMDAiLg0KPiANCj4gPiArCQljb21wYXRpYmxl
ID0gInJlbmVzYXMsdXNiaHMtcjdzNzIxMDAiOw0KPiA+ICsJCXJlZyA9IDwweGU4MDEwMDAwIDB4
MUEwPjsNCj4gDQo+ICAgICBMb3dlcmNhc2UgaW4gdGhlIGhleCB2YWx1ZXMsIHBsZWFzZSBiZSBj
b25zaXN0ZW50Li4uDQo+IA0KPiA+ICsJCWludGVycnVwdHMgPSA8R0lDX1NQSSAoNzMtMzIpIElS
UV9UWVBFX0xFVkVMX0hJR0g+Ow0KPiA+ICsJCWNsb2NrcyA9IDwmbXN0cDdfY2xrcyBSN1M3MjEw
MF9DTEtfVVNCMD47DQo+ID4gKwkJcmVuZXNhcyxidXN3YWl0ID0gPDQ+Ow0KPiA+ICsJCXBvd2Vy
LWRvbWFpbnMgPSA8JmNwZ19jbG9ja3M+Ow0KPiA+ICsJCXN0YXR1cyA9ICJkaXNhYmxlZCI7DQo+
ID4gKwl9Ow0KPiA+ICsNCj4gPiArCXVzYmhzMTogdXNiaHNAZTgyMDcwMDAgew0KPiA+ICsJCWNv
bXBhdGlibGUgPSAicmVuZXNhcyx1c2Jocy1yN3M3MjEwMCI7DQo+ID4gKwkJcmVnID0gPDB4ZTgy
MDcwMDAgMHgxQTA+Ow0KPiA+ICsJCWludGVycnVwdHMgPSA8R0lDX1NQSSAoNzQtMzIpIElSUV9U
WVBFX0xFVkVMX0hJR0g+Ow0KPiA+ICsJCWNsb2NrcyA9IDwmbXN0cDdfY2xrcyBSN1M3MjEwMF9D
TEtfVVNCMT47DQo+ID4gKwkJcmVuZXNhcyxidXN3YWl0ID0gPDQ+Ow0KPiA+ICsJCXBvd2VyLWRv
bWFpbnMgPSA8JmNwZ19jbG9ja3M+Ow0KPiA+ICsJCXN0YXR1cyA9ICJkaXNhYmxlZCI7DQo+ID4g
Kwl9Ow0KPiA+ICAgfTsNCj4gDQo+ICAgICBUaGUgc2FtZSBjb21tZW50cyBmb3IgdGhlIDJuZCBk
ZXZpY2UuDQoNClRoYW5rIHlvdSBmb3IgdGhlIHJldmlldy4NCg0KSSdsbCBtYWtlIHRoZSBjaGFu
Z2VzIGFuZCByZXN1Ym1pdC4NCg0KQ2hyaXMNCg0K
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* RE: [PATCH 3/3] ARM: dts: r7s72100: add USB device to device tree
  2018-01-05  8:53       ` [3/3] " Geert Uytterhoeven
  (?)
@ 2018-01-05 12:54           ` Chris Brandt
  -1 siblings, 0 replies; 32+ messages in thread
From: Chris Brandt @ 2018-01-05 12:54 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Greg Kroah-Hartman, Rob Herring, Mark Rutland, Simon Horman,
	USB list, Linux-Renesas, devicetree-u79uwXL29TY76Z2rM5mHXA

Hi Geert,

Thanks for the review.

On Friday, January 05, 2018, Geert Uytterhoeven wrote:
> > +               interrupts = <GIC_SPI (73-32) IRQ_TYPE_LEVEL_HIGH>;
> 
> "41", all other interrupt properties already have the SPI offset
> subtracted?

The actual HW vector number in the hardware manual is '73'.
As you know, you need to subtract 32 for the number you use in the 
device tree.
But then...the number goes back to '73' when you look at it in 
/proc/interrupts.

So it was confusing to people on what number you needed to use.

Therefore in the RZ/A1 BSP, I was doing (xx-32) so at least people could
see the relationship between what's in the hardware manual and what 
gets put into the device tree.

So, if doing (73-32) looks wrong, I can change it back to '41' for the 
upstream version.


Any opinions????


Chris

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

* RE: [PATCH 3/3] ARM: dts: r7s72100: add USB device to device tree
@ 2018-01-05 12:54           ` Chris Brandt
  0 siblings, 0 replies; 32+ messages in thread
From: Chris Brandt @ 2018-01-05 12:54 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Greg Kroah-Hartman, Rob Herring, Mark Rutland, Simon Horman,
	USB list, Linux-Renesas, devicetree

Hi Geert,

Thanks for the review.

On Friday, January 05, 2018, Geert Uytterhoeven wrote:
> > +               interrupts = <GIC_SPI (73-32) IRQ_TYPE_LEVEL_HIGH>;
> 
> "41", all other interrupt properties already have the SPI offset
> subtracted?

The actual HW vector number in the hardware manual is '73'.
As you know, you need to subtract 32 for the number you use in the 
device tree.
But then...the number goes back to '73' when you look at it in 
/proc/interrupts.

So it was confusing to people on what number you needed to use.

Therefore in the RZ/A1 BSP, I was doing (xx-32) so at least people could
see the relationship between what's in the hardware manual and what 
gets put into the device tree.

So, if doing (73-32) looks wrong, I can change it back to '41' for the 
upstream version.


Any opinions????


Chris

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

* [3/3] ARM: dts: r7s72100: add USB device to device tree
@ 2018-01-05 12:54           ` Chris Brandt
  0 siblings, 0 replies; 32+ messages in thread
From: Chris Brandt @ 2018-01-05 12:54 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Greg Kroah-Hartman, Rob Herring, Mark Rutland, Simon Horman,
	USB list, Linux-Renesas, devicetree

Hi Geert,

Thanks for the review.

On Friday, January 05, 2018, Geert Uytterhoeven wrote:
> > +               interrupts = <GIC_SPI (73-32) IRQ_TYPE_LEVEL_HIGH>;
> 
> "41", all other interrupt properties already have the SPI offset
> subtracted?

The actual HW vector number in the hardware manual is '73'.
As you know, you need to subtract 32 for the number you use in the 
device tree.
But then...the number goes back to '73' when you look at it in 
/proc/interrupts.

So it was confusing to people on what number you needed to use.

Therefore in the RZ/A1 BSP, I was doing (xx-32) so at least people could
see the relationship between what's in the hardware manual and what 
gets put into the device tree.

So, if doing (73-32) looks wrong, I can change it back to '41' for the 
upstream version.


Any opinions????


Chris

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

* Re: [PATCH 3/3] ARM: dts: r7s72100: add USB device to device tree
  2018-01-05 12:54           ` [PATCH 3/3] " Chris Brandt
  (?)
@ 2018-01-05 13:03               ` Geert Uytterhoeven
  -1 siblings, 0 replies; 32+ messages in thread
From: Geert Uytterhoeven @ 2018-01-05 13:03 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Greg Kroah-Hartman, Rob Herring, Mark Rutland, Simon Horman,
	USB list, Linux-Renesas, devicetree-u79uwXL29TY76Z2rM5mHXA

Hi Chris,

On Fri, Jan 5, 2018 at 1:54 PM, Chris Brandt <Chris.Brandt-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org> wrote:
> On Friday, January 05, 2018, Geert Uytterhoeven wrote:
>> > +               interrupts = <GIC_SPI (73-32) IRQ_TYPE_LEVEL_HIGH>;
>>
>> "41", all other interrupt properties already have the SPI offset
>> subtracted?
>
> The actual HW vector number in the hardware manual is '73'.
> As you know, you need to subtract 32 for the number you use in the
> device tree.
> But then...the number goes back to '73' when you look at it in
> /proc/interrupts.

Having an identical number in /proc/interrupts is a coincidence.
These numbers are virtual, and may change even across reboots.

> So it was confusing to people on what number you needed to use.
>
> Therefore in the RZ/A1 BSP, I was doing (xx-32) so at least people could
> see the relationship between what's in the hardware manual and what
> gets put into the device tree.
>
> So, if doing (73-32) looks wrong, I can change it back to '41' for the
> upstream version.
>
> Any opinions????

Not really, except that no single .dts(i) file seems to have "- 32".

Note that e.g. the R-Car Gen3 manuals do list both "interrupt ID"
and "SGI, PPI, or SPI No" in the documentation for INTC-AP.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 3/3] ARM: dts: r7s72100: add USB device to device tree
@ 2018-01-05 13:03               ` Geert Uytterhoeven
  0 siblings, 0 replies; 32+ messages in thread
From: Geert Uytterhoeven @ 2018-01-05 13:03 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Greg Kroah-Hartman, Rob Herring, Mark Rutland, Simon Horman,
	USB list, Linux-Renesas, devicetree

Hi Chris,

On Fri, Jan 5, 2018 at 1:54 PM, Chris Brandt <Chris.Brandt@renesas.com> wrote:
> On Friday, January 05, 2018, Geert Uytterhoeven wrote:
>> > +               interrupts = <GIC_SPI (73-32) IRQ_TYPE_LEVEL_HIGH>;
>>
>> "41", all other interrupt properties already have the SPI offset
>> subtracted?
>
> The actual HW vector number in the hardware manual is '73'.
> As you know, you need to subtract 32 for the number you use in the
> device tree.
> But then...the number goes back to '73' when you look at it in
> /proc/interrupts.

Having an identical number in /proc/interrupts is a coincidence.
These numbers are virtual, and may change even across reboots.

> So it was confusing to people on what number you needed to use.
>
> Therefore in the RZ/A1 BSP, I was doing (xx-32) so at least people could
> see the relationship between what's in the hardware manual and what
> gets put into the device tree.
>
> So, if doing (73-32) looks wrong, I can change it back to '41' for the
> upstream version.
>
> Any opinions????

Not really, except that no single .dts(i) file seems to have "- 32".

Note that e.g. the R-Car Gen3 manuals do list both "interrupt ID"
and "SGI, PPI, or SPI No" in the documentation for INTC-AP.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* [3/3] ARM: dts: r7s72100: add USB device to device tree
@ 2018-01-05 13:03               ` Geert Uytterhoeven
  0 siblings, 0 replies; 32+ messages in thread
From: Geert Uytterhoeven @ 2018-01-05 13:03 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Greg Kroah-Hartman, Rob Herring, Mark Rutland, Simon Horman,
	USB list, Linux-Renesas, devicetree

Hi Chris,

On Fri, Jan 5, 2018 at 1:54 PM, Chris Brandt <Chris.Brandt@renesas.com> wrote:
> On Friday, January 05, 2018, Geert Uytterhoeven wrote:
>> > +               interrupts = <GIC_SPI (73-32) IRQ_TYPE_LEVEL_HIGH>;
>>
>> "41", all other interrupt properties already have the SPI offset
>> subtracted?
>
> The actual HW vector number in the hardware manual is '73'.
> As you know, you need to subtract 32 for the number you use in the
> device tree.
> But then...the number goes back to '73' when you look at it in
> /proc/interrupts.

Having an identical number in /proc/interrupts is a coincidence.
These numbers are virtual, and may change even across reboots.

> So it was confusing to people on what number you needed to use.
>
> Therefore in the RZ/A1 BSP, I was doing (xx-32) so at least people could
> see the relationship between what's in the hardware manual and what
> gets put into the device tree.
>
> So, if doing (73-32) looks wrong, I can change it back to '41' for the
> upstream version.
>
> Any opinions????

Not really, except that no single .dts(i) file seems to have "- 32".

Note that e.g. the R-Car Gen3 manuals do list both "interrupt ID"
and "SGI, PPI, or SPI No" in the documentation for INTC-AP.

Gr{oetje,eeting}s,

                        Geert
---
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* RE: [PATCH 3/3] ARM: dts: r7s72100: add USB device to device tree
  2018-01-05 13:03               ` [PATCH 3/3] " Geert Uytterhoeven
  (?)
@ 2018-01-05 13:24                   ` Chris Brandt
  -1 siblings, 0 replies; 32+ messages in thread
From: Chris Brandt @ 2018-01-05 13:24 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Greg Kroah-Hartman, Rob Herring, Mark Rutland, Simon Horman,
	USB list, Linux-Renesas, devicetree-u79uwXL29TY76Z2rM5mHXA

Hi Geert,

On Friday, January 05, 2018, Geert Uytterhoeven wrote:
> > But then...the number goes back to '73' when you look at it in
> > /proc/interrupts.
> 
> Having an identical number in /proc/interrupts is a coincidence.
> These numbers are virtual, and may change even across reboots.

I'm not talking about the id number (the 1st column). I'm talking 
about the 4th column.

$ uname -rs
Linux 4.15.0-rc5-00008-g366d22ea091b
$ cat /proc/interrupts
           CPU0
 17:       2365     GIC-0 135 Edge      ostm
 18:          0     GIC-0 230 Level     e8008000.serial:rx err
 19:         45     GIC-0 231 Level     e8008000.serial:rx full
 20:        194     GIC-0 232 Level     e8008000.serial:tx empty
 21:          0     GIC-0 229 Level     e8008000.serial:break
 24:          0     GIC-0 189 Level     riic-tend
 25:          0     GIC-0 190 Edge      riic-rdrf
 26:          0     GIC-0 191 Edge      riic-tdre
 27:          0     GIC-0 192 Level     riic-stop
 29:          0     GIC-0 194 Level     riic-nack
 32:        160     GIC-0 213 Level     riic-tend
 33:        160     GIC-0 214 Edge      riic-rdrf
 34:        480     GIC-0 215 Edge      riic-tdre
 35:        240     GIC-0 216 Level     riic-stop
 37:          0     GIC-0 218 Level     riic-nack
 40:          0     GIC-0 139 Level     fcff0000.timer
 42:          0     GIC-0 305 Level     e804e800.sd
 43:         52     GIC-0 306 Level     e804e800.sd
 44:          0     GIC-0 307 Level     e804e800.sd
 45:          0     GIC-0 308 Edge      sh-rtc period
 46:          0     GIC-0 309 Edge      sh-rtc carry
 47:          0     GIC-0 310 Edge      sh-rtc alarm
 48:          0     GIC-0  73 Level     e8010000.usbhs
Err:          0


> > Any opinions????
> 
> Not really, except that no single .dts(i) file seems to have "- 32".

Then I can be a pioneer of new software!!  ;)


I'll just change it back to a single number when I upstream code just to
be consistent.


Thanks,
Chris


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

* RE: [PATCH 3/3] ARM: dts: r7s72100: add USB device to device tree
@ 2018-01-05 13:24                   ` Chris Brandt
  0 siblings, 0 replies; 32+ messages in thread
From: Chris Brandt @ 2018-01-05 13:24 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Greg Kroah-Hartman, Rob Herring, Mark Rutland, Simon Horman,
	USB list, Linux-Renesas, devicetree

Hi Geert,

On Friday, January 05, 2018, Geert Uytterhoeven wrote:
> > But then...the number goes back to '73' when you look at it in
> > /proc/interrupts.
> 
> Having an identical number in /proc/interrupts is a coincidence.
> These numbers are virtual, and may change even across reboots.

I'm not talking about the id number (the 1st column). I'm talking 
about the 4th column.

$ uname -rs
Linux 4.15.0-rc5-00008-g366d22ea091b
$ cat /proc/interrupts
           CPU0
 17:       2365     GIC-0 135 Edge      ostm
 18:          0     GIC-0 230 Level     e8008000.serial:rx err
 19:         45     GIC-0 231 Level     e8008000.serial:rx full
 20:        194     GIC-0 232 Level     e8008000.serial:tx empty
 21:          0     GIC-0 229 Level     e8008000.serial:break
 24:          0     GIC-0 189 Level     riic-tend
 25:          0     GIC-0 190 Edge      riic-rdrf
 26:          0     GIC-0 191 Edge      riic-tdre
 27:          0     GIC-0 192 Level     riic-stop
 29:          0     GIC-0 194 Level     riic-nack
 32:        160     GIC-0 213 Level     riic-tend
 33:        160     GIC-0 214 Edge      riic-rdrf
 34:        480     GIC-0 215 Edge      riic-tdre
 35:        240     GIC-0 216 Level     riic-stop
 37:          0     GIC-0 218 Level     riic-nack
 40:          0     GIC-0 139 Level     fcff0000.timer
 42:          0     GIC-0 305 Level     e804e800.sd
 43:         52     GIC-0 306 Level     e804e800.sd
 44:          0     GIC-0 307 Level     e804e800.sd
 45:          0     GIC-0 308 Edge      sh-rtc period
 46:          0     GIC-0 309 Edge      sh-rtc carry
 47:          0     GIC-0 310 Edge      sh-rtc alarm
 48:          0     GIC-0  73 Level     e8010000.usbhs
Err:          0


> > Any opinions????
> 
> Not really, except that no single .dts(i) file seems to have "- 32".

Then I can be a pioneer of new software!!  ;)


I'll just change it back to a single number when I upstream code just to
be consistent.


Thanks,
Chris


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

* [3/3] ARM: dts: r7s72100: add USB device to device tree
@ 2018-01-05 13:24                   ` Chris Brandt
  0 siblings, 0 replies; 32+ messages in thread
From: Chris Brandt @ 2018-01-05 13:24 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Greg Kroah-Hartman, Rob Herring, Mark Rutland, Simon Horman,
	USB list, Linux-Renesas, devicetree

Hi Geert,

On Friday, January 05, 2018, Geert Uytterhoeven wrote:
> > But then...the number goes back to '73' when you look at it in
> > /proc/interrupts.
> 
> Having an identical number in /proc/interrupts is a coincidence.
> These numbers are virtual, and may change even across reboots.

I'm not talking about the id number (the 1st column). I'm talking 
about the 4th column.

$ uname -rs
Linux 4.15.0-rc5-00008-g366d22ea091b
$ cat /proc/interrupts
           CPU0
 17:       2365     GIC-0 135 Edge      ostm
 18:          0     GIC-0 230 Level     e8008000.serial:rx err
 19:         45     GIC-0 231 Level     e8008000.serial:rx full
 20:        194     GIC-0 232 Level     e8008000.serial:tx empty
 21:          0     GIC-0 229 Level     e8008000.serial:break
 24:          0     GIC-0 189 Level     riic-tend
 25:          0     GIC-0 190 Edge      riic-rdrf
 26:          0     GIC-0 191 Edge      riic-tdre
 27:          0     GIC-0 192 Level     riic-stop
 29:          0     GIC-0 194 Level     riic-nack
 32:        160     GIC-0 213 Level     riic-tend
 33:        160     GIC-0 214 Edge      riic-rdrf
 34:        480     GIC-0 215 Edge      riic-tdre
 35:        240     GIC-0 216 Level     riic-stop
 37:          0     GIC-0 218 Level     riic-nack
 40:          0     GIC-0 139 Level     fcff0000.timer
 42:          0     GIC-0 305 Level     e804e800.sd
 43:         52     GIC-0 306 Level     e804e800.sd
 44:          0     GIC-0 307 Level     e804e800.sd
 45:          0     GIC-0 308 Edge      sh-rtc period
 46:          0     GIC-0 309 Edge      sh-rtc carry
 47:          0     GIC-0 310 Edge      sh-rtc alarm
 48:          0     GIC-0  73 Level     e8010000.usbhs
Err:          0


> > Any opinions????
> 
> Not really, except that no single .dts(i) file seems to have "- 32".

Then I can be a pioneer of new software!!  ;)


I'll just change it back to a single number when I upstream code just to
be consistent.


Thanks,
Chris

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

end of thread, other threads:[~2018-01-05 13:24 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-04 20:01 [PATCH 0/3] usb: renesas_usbhs: Add RZ/A1 support Chris Brandt
2018-01-04 20:01 ` Chris Brandt
     [not found] ` <20180104200150.11352-1-chris.brandt-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
2018-01-04 20:01   ` [PATCH 1/3] usb: renesas_usbhs: Add support for RZ/A1 Chris Brandt
2018-01-04 20:01     ` [1/3] " Chris Brandt
2018-01-04 20:01     ` [PATCH 1/3] " Chris Brandt
2018-01-04 20:01   ` [PATCH 2/3] dt-bindings: " Chris Brandt
2018-01-04 20:01     ` [2/3] " Chris Brandt
2018-01-04 20:01     ` [PATCH 2/3] " Chris Brandt
2018-01-05  8:48     ` Geert Uytterhoeven
2018-01-05  8:48       ` [2/3] " Geert Uytterhoeven
2018-01-04 20:01   ` [PATCH 3/3] ARM: dts: r7s72100: add USB device to device tree Chris Brandt
2018-01-04 20:01     ` [3/3] " Chris Brandt
2018-01-04 20:01     ` [PATCH 3/3] " Chris Brandt
2018-01-05  8:53     ` Geert Uytterhoeven
2018-01-05  8:53       ` [3/3] " Geert Uytterhoeven
     [not found]       ` <CAMuHMdWmoi3D9-XGXjefCsB2SgNjAH_G6uteSaTiWAN_krXhng-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-05 12:54         ` [PATCH 3/3] " Chris Brandt
2018-01-05 12:54           ` [3/3] " Chris Brandt
2018-01-05 12:54           ` [PATCH 3/3] " Chris Brandt
     [not found]           ` <SG2PR06MB11653DA8D7101215AECE3B698A1C0-ESzmfEwOt/xoAsOJh7vwSm0DtJ1/0DrXvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-01-05 13:03             ` Geert Uytterhoeven
2018-01-05 13:03               ` [3/3] " Geert Uytterhoeven
2018-01-05 13:03               ` [PATCH 3/3] " Geert Uytterhoeven
     [not found]               ` <CAMuHMdVq6FcCE0G5c3fm-GvAfORyNy9zwO5j-Ph-4oTN9+wsvQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-05 13:24                 ` Chris Brandt
2018-01-05 13:24                   ` [3/3] " Chris Brandt
2018-01-05 13:24                   ` [PATCH 3/3] " Chris Brandt
2018-01-05  9:03     ` Sergei Shtylyov
2018-01-05  9:03       ` [3/3] " Sergei Shtylyov
     [not found]       ` <c6eac313-2d2d-70c8-16bb-ddb860fb7aa1-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
2018-01-05 12:42         ` [PATCH 3/3] " Chris Brandt
2018-01-05 12:42           ` [3/3] " Chris Brandt
2018-01-05 12:42           ` [PATCH 3/3] " Chris Brandt
     [not found]     ` <20180104200150.11352-4-chris.brandt-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
2018-01-05  9:53       ` Simon Horman
2018-01-05  9:53         ` [3/3] " Simon Horman
2018-01-05  9:53         ` [PATCH 3/3] " Simon Horman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.