2021-09-10 16:40:01

by Cristian Birsan

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

From: Cristian Birsan <[email protected]>

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


2021-09-10 16:41:00

by Cristian Birsan

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

From: Cristian Birsan <[email protected]>

Add USB PHY type property for controllers with HSIC support.

Signed-off-by: Cristian Birsan <[email protected]>
---
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

2021-09-10 16:41:48

by Cristian Birsan

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

From: Cristian Birsan <[email protected]>

Add support for USB Host High Speed Port HSIC phy.

Signed-off-by: Cristian Birsan <[email protected]>
---
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

2021-09-10 19:09:40

by Sergei Shtylyov

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

Hello!

On 9/10/21 7:38 PM, [email protected] wrote:

> From: Cristian Birsan <[email protected]>
>
> Add USB PHY type property for controllers with HSIC support.
>
> Signed-off-by: Cristian Birsan <[email protected]>
> ---
> 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.

> + "utmi", or "hsic".
> +
> usb1: ehci@800000 {
> compatible = "atmel,at91sam9g45-ehci", "usb-ehci";
> reg = <0x00800000 0x100000>;

MBR, Sergei

2021-09-10 20:50:45

by Alan Stern

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

On Fri, Sep 10, 2021 at 07:38:42PM +0300, [email protected] wrote:
> From: Cristian Birsan <[email protected]>
>
> Add support for USB Host High Speed Port HSIC phy.
>
> Signed-off-by: Cristian Birsan <[email protected]>
> ---

Acked-by: Alan Stern <[email protected]>

> 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
>

2021-09-13 11:44:51

by Alexander Dahl

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

Hello Christian,

Am Freitag, 10. September 2021, 18:38:42 CEST schrieb
[email protected]:
> From: Cristian Birsan <[email protected]>
>
> Add support for USB Host High Speed Port HSIC phy.
>
> Signed-off-by: Cristian Birsan <[email protected]>
> ---
> 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 <[email protected]>

Greets
Alex