[PATCH 0/2] USB: host: ehci-atmel: Enable HSIC port on SAMA5D2

STALE1859d

7 messages, 4 authors, 2021-09-13 · open the first message on its own page

[PATCH 0/2] USB: host: ehci-atmel: Enable HSIC port on SAMA5D2

From: <cristian.birsan@microchip.com>
Date: 2021-09-10 16:39:05

From: Cristian Birsan <cristian.birsan@microchip.com>

On SAMA5D2 SoCs, Port C of USB Host contains a High-Speed Inter-Chip (HSIC)
transceiver. It can be used for USB chip-to-chip interconnect with a 2-signal
(strobe, data) synchronous serial interface using 240 MHz DDR signaling.

External cables, connectors, and hot plug & play are not supported.

This patch series enables this feature.

Cristian Birsan (2):
  dt-bindings: usb: atmel: add USB PHY type property
  USB: host: ehci-atmel: Add support for HSIC phy

 Documentation/devicetree/bindings/usb/atmel-usb.txt | 4 ++++
 drivers/usb/host/ehci-atmel.c                       | 8 ++++++++
 2 files changed, 12 insertions(+)

-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

[PATCH 1/2] dt-bindings: usb: atmel: add USB PHY type property

From: <cristian.birsan@microchip.com>
Date: 2021-09-10 16:39:07

From: Cristian Birsan <cristian.birsan@microchip.com>

Add USB PHY type property for controllers with HSIC support.

Signed-off-by: Cristian Birsan <cristian.birsan@microchip.com>
---
 Documentation/devicetree/bindings/usb/atmel-usb.txt | 4 ++++
 1 file changed, 4 insertions(+)
diff --git a/Documentation/devicetree/bindings/usb/atmel-usb.txt b/Documentation/devicetree/bindings/usb/atmel-usb.txt
index a4002624ba14..f512f0290728 100644
--- a/Documentation/devicetree/bindings/usb/atmel-usb.txt
+++ b/Documentation/devicetree/bindings/usb/atmel-usb.txt
@@ -39,6 +39,10 @@ Required properties:
 		"ehci_clk" for the peripheral clock
 		"usb_clk" for the UTMI clock
 
+Optional properties:
+ - phy_type : For multi port host USB controllers, should be one of
+   "utmi", or "hsic".
+
 usb1: ehci@800000 {
 	compatible = "atmel,at91sam9g45-ehci", "usb-ehci";
 	reg = <0x00800000 0x100000>;
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

[PATCH 2/2] USB: host: ehci-atmel: Add support for HSIC phy

From: <cristian.birsan@microchip.com>
Date: 2021-09-10 16:39:15

From: Cristian Birsan <cristian.birsan@microchip.com>

Add support for USB Host High Speed Port HSIC phy.

Signed-off-by: Cristian Birsan <cristian.birsan@microchip.com>
---
 drivers/usb/host/ehci-atmel.c | 8 ++++++++
 1 file changed, 8 insertions(+)
diff --git a/drivers/usb/host/ehci-atmel.c b/drivers/usb/host/ehci-atmel.c
index e893467d659c..05d41fd65f25 100644
--- a/drivers/usb/host/ehci-atmel.c
+++ b/drivers/usb/host/ehci-atmel.c
@@ -18,6 +18,8 @@
 #include <linux/platform_device.h>
 #include <linux/usb.h>
 #include <linux/usb/hcd.h>
+#include <linux/usb/phy.h>
+#include <linux/usb/of.h>
 
 #include "ehci.h"
 
@@ -25,6 +27,9 @@
 
 static const char hcd_name[] = "ehci-atmel";
 
+#define EHCI_INSNREG(index)			((index) * 4 + 0x90)
+#define EHCI_INSNREG08_HSIC_EN			BIT(2)
+
 /* interface and function clocks */
 #define hcd_to_atmel_ehci_priv(h) \
 	((struct atmel_ehci_priv *)hcd_to_ehci(h)->priv)
@@ -154,6 +159,9 @@ static int ehci_atmel_drv_probe(struct platform_device *pdev)
 		goto fail_add_hcd;
 	device_wakeup_enable(hcd->self.controller);
 
+	if (of_usb_get_phy_mode(pdev->dev.of_node) == USBPHY_INTERFACE_MODE_HSIC)
+		writel(EHCI_INSNREG08_HSIC_EN, hcd->regs + EHCI_INSNREG(8));
+
 	return retval;
 
 fail_add_hcd:
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

Re: [PATCH 1/2] dt-bindings: usb: atmel: add USB PHY type property

From: Sergei Shtylyov <hidden>
Date: 2021-09-10 19:07:33

Hello!

On 9/10/21 7:38 PM, cristian.birsan@microchip.com wrote:
quoted hunk
From: Cristian Birsan <cristian.birsan@microchip.com>

Add USB PHY type property for controllers with HSIC support.

Signed-off-by: Cristian Birsan <cristian.birsan@microchip.com>
---
 Documentation/devicetree/bindings/usb/atmel-usb.txt | 4 ++++
 1 file changed, 4 insertions(+)
diff --git a/Documentation/devicetree/bindings/usb/atmel-usb.txt b/Documentation/devicetree/bindings/usb/atmel-usb.txt
index a4002624ba14..f512f0290728 100644
--- a/Documentation/devicetree/bindings/usb/atmel-usb.txt
+++ b/Documentation/devicetree/bindings/usb/atmel-usb.txt
@@ -39,6 +39,10 @@ Required properties:
 		"ehci_clk" for the peripheral clock
 		"usb_clk" for the UTMI clock
 
+Optional properties:
+ - phy_type : For multi port host USB controllers, should be one of
   Hyphens are preferred to underscores in the property names.
quoted hunk
+   "utmi", or "hsic".
+
 usb1: ehci@800000 {
 	compatible = "atmel,at91sam9g45-ehci", "usb-ehci";
 	reg = <0x00800000 0x100000>;
MBR, Sergei

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

Re: [PATCH 2/2] USB: host: ehci-atmel: Add support for HSIC phy

From: Alan Stern <stern@rowland.harvard.edu>
Date: 2021-09-10 20:49:05

On Fri, Sep 10, 2021 at 07:38:42PM +0300, cristian.birsan@microchip.com wrote:
From: Cristian Birsan <cristian.birsan@microchip.com>

Add support for USB Host High Speed Port HSIC phy.

Signed-off-by: Cristian Birsan <cristian.birsan@microchip.com>
---
Acked-by: Alan Stern <stern@rowland.harvard.edu>
quoted hunk
 drivers/usb/host/ehci-atmel.c | 8 ++++++++
 1 file changed, 8 insertions(+)
diff --git a/drivers/usb/host/ehci-atmel.c b/drivers/usb/host/ehci-atmel.c
index e893467d659c..05d41fd65f25 100644
--- a/drivers/usb/host/ehci-atmel.c
+++ b/drivers/usb/host/ehci-atmel.c
@@ -18,6 +18,8 @@
 #include <linux/platform_device.h>
 #include <linux/usb.h>
 #include <linux/usb/hcd.h>
+#include <linux/usb/phy.h>
+#include <linux/usb/of.h>
 
 #include "ehci.h"
 
@@ -25,6 +27,9 @@
 
 static const char hcd_name[] = "ehci-atmel";
 
+#define EHCI_INSNREG(index)			((index) * 4 + 0x90)
+#define EHCI_INSNREG08_HSIC_EN			BIT(2)
+
 /* interface and function clocks */
 #define hcd_to_atmel_ehci_priv(h) \
 	((struct atmel_ehci_priv *)hcd_to_ehci(h)->priv)
@@ -154,6 +159,9 @@ static int ehci_atmel_drv_probe(struct platform_device *pdev)
 		goto fail_add_hcd;
 	device_wakeup_enable(hcd->self.controller);
 
+	if (of_usb_get_phy_mode(pdev->dev.of_node) == USBPHY_INTERFACE_MODE_HSIC)
+		writel(EHCI_INSNREG08_HSIC_EN, hcd->regs + EHCI_INSNREG(8));
+
 	return retval;
 
 fail_add_hcd:
-- 
2.25.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

Re: [PATCH 2/2] USB: host: ehci-atmel: Add support for HSIC phy

From: Alexander Dahl <hidden>
Date: 2021-09-13 11:39:36

Hello Christian,

Am Freitag, 10. September 2021, 18:38:42 CEST schrieb 
cristian.birsan@microchip.com:
quoted hunk
From: Cristian Birsan <cristian.birsan@microchip.com>

Add support for USB Host High Speed Port HSIC phy.

Signed-off-by: Cristian Birsan <cristian.birsan@microchip.com>
---
 drivers/usb/host/ehci-atmel.c | 8 ++++++++
 1 file changed, 8 insertions(+)
diff --git a/drivers/usb/host/ehci-atmel.c b/drivers/usb/host/ehci-atmel.c
index e893467d659c..05d41fd65f25 100644
--- a/drivers/usb/host/ehci-atmel.c
+++ b/drivers/usb/host/ehci-atmel.c
@@ -18,6 +18,8 @@
 #include <linux/platform_device.h>
 #include <linux/usb.h>
 #include <linux/usb/hcd.h>
+#include <linux/usb/phy.h>
+#include <linux/usb/of.h>

 #include "ehci.h"
@@ -25,6 +27,9 @@

 static const char hcd_name[] = "ehci-atmel";

+#define EHCI_INSNREG(index)			((index) * 4 + 0x90)
+#define EHCI_INSNREG08_HSIC_EN			BIT(2)
+
 /* interface and function clocks */
 #define hcd_to_atmel_ehci_priv(h) \
 	((struct atmel_ehci_priv *)hcd_to_ehci(h)->priv)
@@ -154,6 +159,9 @@ static int ehci_atmel_drv_probe(struct platform_device
*pdev) goto fail_add_hcd;
 	device_wakeup_enable(hcd->self.controller);

+	if (of_usb_get_phy_mode(pdev->dev.of_node) == USBPHY_INTERFACE_MODE_HSIC)
+		writel(EHCI_INSNREG08_HSIC_EN, hcd->regs + EHCI_INSNREG(8));
+
 	return retval;

 fail_add_hcd:
Tested-by: Alexander Dahl <redacted>

Greets
Alex




_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

Re: [PATCH 1/2] dt-bindings: usb: atmel: add USB PHY type property

From: <Cristian.Birsan@microchip.com>
Date: 2021-09-13 16:39:04

Hi Sergei,

On 9/10/21 10:07 PM, Sergei Shtylyov wrote:
EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

Hello!

On 9/10/21 7:38 PM, cristian.birsan@microchip.com wrote:
quoted
From: Cristian Birsan <cristian.birsan@microchip.com>

Add USB PHY type property for controllers with HSIC support.

Signed-off-by: Cristian Birsan <cristian.birsan@microchip.com>
---
 Documentation/devicetree/bindings/usb/atmel-usb.txt | 4 ++++
 1 file changed, 4 insertions(+)
diff --git a/Documentation/devicetree/bindings/usb/atmel-usb.txt b/Documentation/devicetree/bindings/usb/atmel-usb.txt
index a4002624ba14..f512f0290728 100644
--- a/Documentation/devicetree/bindings/usb/atmel-usb.txt
+++ b/Documentation/devicetree/bindings/usb/atmel-usb.txt
@@ -39,6 +39,10 @@ Required properties:
              "ehci_clk" for the peripheral clock
              "usb_clk" for the UTMI clock

+Optional properties:
+ - phy_type : For multi port host USB controllers, should be one of
   Hyphens are preferred to underscores in the property names.
Thank you for looking at my patch.

The property is used with underscore in several places, including Generic USB Controller Device Tree Bindings:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/usb/usb.yaml?h=v5.15-rc1#n33

I preferred to used the same pattern and not add a slightly different property string for the same thing.
quoted
+   "utmi", or "hsic".
+
 usb1: ehci@800000 {
      compatible = "atmel,at91sam9g45-ehci", "usb-ehci";
      reg = <0x00800000 0x100000>;
MBR, Sergei
Kind regards,
Cristian
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help