Skip to contentSkip to conversation

Add DT USB definitions for SAM9X60, SAMA5D2 and SAMA7

PATCH Superseded Sergiu Moga 3 participants 22 messages Dec 23, 2022 – Jan 4, 2023

Subsystems (4)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover Add DT USB definitions for SAM9X60, SAMA5D2 and SAMA7

This patch series originates from the bigger patch series:
https://lists.denx.de/pipermail/u-boot/2022-December/502865.html

Add the basic DT USB definitions for SAM9X60, SAMA5D2 and SAMA7. The required pinctrl definitions have been added as well as additional definitions for the UTMI related clocks and their relationship with the Reset driver.

Sergiu Moga (6):
ARM: dts: sam9x60: Add OHCI and EHCI DT nodes
dt-bindings: reset: add sama7g5 definitions
dt-bindings: clk: at91: Define additional UTMI related clocks
ARM: dts: at91: sama7: Add USB related DT nodes
ARM: dts: at91: sama5d2_icp: Add pinctrl nodes for USB related DT
nodes
ARM: dts: at91: sama5d27_wlsom1_ek: Add pinctrl nodes for USB DT nodes

 arch/arm/dts/at91-sam9x60_curiosity.dts   | 21 +++++++
 arch/arm/dts/at91-sama5d27_wlsom1_ek.dts  | 25 ++++++++
 arch/arm/dts/at91-sama5d2_icp.dts         | 22 +++++++
 arch/arm/dts/at91-sama7g5ek.dts           | 34 +++++++++++
 arch/arm/dts/sam9x60.dtsi                 | 18 ++++++
 arch/arm/dts/sam9x60ek.dts                | 21 +++++++
 arch/arm/dts/sama7g5.dtsi                 | 73 +++++++++++++++++++++++
 include/dt-bindings/clk/at91.h            |  5 ++
 include/dt-bindings/reset/sama7g5-reset.h | 10 ++++
 9 files changed, 229 insertions(+)
 create mode 100644 include/dt-bindings/reset/sama7g5-reset.h
Signature · 1 line
2.34.1
#1 lore raw

PATCH 1/6 ARM: dts: sam9x60: Add OHCI and EHCI DT nodes

Add the OHCI and EHCI DT nodes for the sam9x60 boards.

---
 arch/arm/dts/at91-sam9x60_curiosity.dts | 21 +++++++++++++++++++++
 arch/arm/dts/sam9x60.dtsi               | 18 ++++++++++++++++++
 arch/arm/dts/sam9x60ek.dts              | 21 +++++++++++++++++++++
 3 files changed, 60 insertions(+)
arch/arm/dts/at91-sam9x60_curiosity.dts +21 -0
index 7c5b6ae2b8..d6ae3d648d 100644
@@ -49,6 +49,13 @@
 						atmel,pins =
 							<AT91_PIOD 14 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP>;
 					};
+
+					usb1 {
+						pinctrl_usb_default: usb_default {
+							atmel,pins = <AT91_PIOD 15 AT91_PERIPH_GPIO AT91_PINCTRL_NONE
+									AT91_PIOD 18 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
+						};
+					};
 			};
 		};
 	};
@@ -89,3 +96,17 @@
 	phy-mode = "rmii";
 	status = "okay";
 };
+
+&usb1 {
+	num-ports = <3>;
+	atmel,vbus-gpio = <0
+			   &pioD 15 GPIO_ACTIVE_HIGH
+			   &pioD 18 GPIO_ACTIVE_HIGH>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_usb_default>;
+	status = "okay";
+};
+
+&usb2 {
+	status = "okay";
+};
arch/arm/dts/sam9x60.dtsi +18 -0
index 17224ef771..e36a540f78 100644
@@ -69,6 +69,24 @@
 		#size-cells = <1>;
 		ranges;
 
+		usb1: ohci@600000 {
+			compatible = "atmel,at91rm9200-ohci", "usb-ohci";
+			reg = <0x00600000 0x100000>;
+			clocks = <&pmc PMC_TYPE_PERIPHERAL 22>, <&pmc PMC_TYPE_PERIPHERAL 22>, <&pmc PMC_TYPE_SYSTEM 21>;
+			clock-names = "ohci_clk", "hclk", "uhpck";
+			status = "disabled";
+		};
+
+		usb2: ehci@700000 {
+			compatible = "atmel,at91sam9g45-ehci", "usb-ehci";
+			reg = <0x00700000 0x100000>;
+			clocks = <&pmc PMC_TYPE_CORE 8>, <&pmc PMC_TYPE_PERIPHERAL 22>;
+			clock-names = "usb_clk", "ehci_clk";
+			assigned-clocks = <&pmc PMC_TYPE_CORE 8>;
+			assigned-clock-rates = <480000000>;
+			status = "disabled";
+		};
+
 		ebi: ebi@10000000 {
 			compatible = "microchip,sam9x60-ebi";
 			#address-cells = <2>;
arch/arm/dts/sam9x60ek.dts +21 -0
index 1a02e2cb79..45e2f4cc40 100644
@@ -139,6 +139,13 @@
 						<AT91_PIOD 14 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP>;
 				};
 
+				usb1 {
+					pinctrl_usb_default: usb_default {
+						atmel,pins = <AT91_PIOD 15 AT91_PERIPH_GPIO AT91_PINCTRL_NONE
+								AT91_PIOD 16 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
+					};
+				};
+
 			};
 		};
 	};
@@ -213,3 +220,17 @@
 	phy-mode = "rmii";
 	status = "okay";
 };
+
+&usb1 {
+	num-ports = <3>;
+	atmel,vbus-gpio = <0
+			   &pioD 15 GPIO_ACTIVE_HIGH
+			   &pioD 16 GPIO_ACTIVE_HIGH>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_usb_default>;
+	status = "okay";
+};
+
+&usb2 {
+	status = "okay";
+};
Signature · 1 line
2.34.1
#2 lore raw

Re: [PATCH 1/6] ARM: dts: sam9x60: Add OHCI and EHCI DT nodes

Quoted 6 lines · Sergiu Moga

Add the OHCI and EHCI DT nodes for the sam9x60 boards.

---
  arch/arm/dts/at91-sam9x60_curiosity.dts | 21 +++++++++++++++++++++
  arch/arm/dts/sam9x60.dtsi               | 18 ++++++++++++++++++

Board and SoC DT changes should be in separate patches.

Quoted 2 lines
  arch/arm/dts/sam9x60ek.dts              | 21 +++++++++++++++++++++
  3 files changed, 60 insertions(+)

[...]

arch/arm/dts/sam9x60.dtsi line 72

Quoted 9 lines
arch/arm/dts/sam9x60.dtsi +1 -0
index 17224ef771..e36a540f78 100644
@@ -69,6 +69,24 @@
  		#size-cells = <1>;
  		ranges;
 
+		usb1: ohci@600000 {

This should be usb@ instead of ohci@ , if you run "make dtbs_check" on this DT in Linux (please do), you would likely get a warning , see Linux Documentation/devicetree/bindings/usb/usb.yaml .

Quoted 6 lines
arch/arm/dts/sam9x60.dtsi +6 -0
+			compatible = "atmel,at91rm9200-ohci", "usb-ohci";
+			reg = <0x00600000 0x100000>;
+			clocks = <&pmc PMC_TYPE_PERIPHERAL 22>, <&pmc PMC_TYPE_PERIPHERAL 22>, <&pmc PMC_TYPE_SYSTEM 21>;
+			clock-names = "ohci_clk", "hclk", "uhpck";
+			status = "disabled";
+		};

[...]

#3 lore raw

Re: [PATCH 1/6] ARM: dts: sam9x60: Add OHCI and EHCI DT nodes

Quoted 24 lines · Marek Vasut
Quoted 6 lines · Sergiu Moga

Add the OHCI and EHCI DT nodes for the sam9x60 boards.

---
  arch/arm/dts/at91-sam9x60_curiosity.dts | 21 +++++++++++++++++++++ arch/arm/dts/sam9x60.dtsi               | 18 ++++++++++++++++++

Board and SoC DT changes should be in separate patches.

Quoted 2 lines

  arch/arm/dts/sam9x60ek.dts              | 21 +++++++++++++++++++++

  3 files changed, 60 insertions(+)

[...]

Quoted 8 lines
arch/arm/dts/sam9x60.dtsi +0 -0
index 17224ef771..e36a540f78 100644
@@ -69,6 +69,24 @@
               #size-cells = <1>;
               ranges;
 
Quoted 5 lines

arch/arm/dts/sam9x60.dtsi line 72

Quoted 1 line
arch/arm/dts/sam9x60.dtsi +1 -0
+             usb1: ohci@600000 {

This should be usb@ instead of ohci@ , if you run "make dtbs_check" on this DT in Linux (please do), you would likely get a warning , see Linux Documentation/devicetree/bindings/usb/usb.yaml .

If in Linux we have ohci@ , then we need to have the same in U-boot. We can accept the change to usb@ , if there is a pending patch in Linux. U-boot is not the place to review the devicetree. The devicetree must be in sync with Linux.

Eugen

Quoted 11 lines
Quoted 8 lines
arch/arm/dts/sam9x60.dtsi +6 -0
+                     compatible = "atmel,at91rm9200-ohci", "usb-ohci";
+                     reg = <0x00600000 0x100000>;
+                     clocks = <&pmc PMC_TYPE_PERIPHERAL 22>, <&pmc 
 PMC_TYPE_PERIPHERAL 22>, <&pmc PMC_TYPE_SYSTEM 21>;
+                     clock-names = "ohci_clk", "hclk", "uhpck";
+                     status = "disabled";
+             };

[...]

#4 lore raw

Re: [PATCH 1/6] ARM: dts: sam9x60: Add OHCI and EHCI DT nodes

Quoted 25 lines · On 1/4/23 08:30, [email protected] wrote:
Quoted 24 lines · Marek Vasut
Quoted 6 lines · Sergiu Moga

Add the OHCI and EHCI DT nodes for the sam9x60 boards.

---
   arch/arm/dts/at91-sam9x60_curiosity.dts | 21 +++++++++++++++++++++
   arch/arm/dts/sam9x60.dtsi               | 18 ++++++++++++++++++

Board and SoC DT changes should be in separate patches.

Quoted 2 lines
   arch/arm/dts/sam9x60ek.dts              | 21 +++++++++++++++++++++
   3 files changed, 60 insertions(+)

[...]

Quoted 8 lines
arch/arm/dts/sam9x60.dtsi +0 -0
index 17224ef771..e36a540f78 100644
@@ -69,6 +69,24 @@
               #size-cells = <1>;
               ranges;
 
Quoted 8 lines
Quoted 5 lines

arch/arm/dts/sam9x60.dtsi line 72

Quoted 1 line
arch/arm/dts/sam9x60.dtsi +1 -0
+             usb1: ohci@600000 {

This should be usb@ instead of ohci@ , if you run "make dtbs_check" on this DT in Linux (please do), you would likely get a warning , see Linux Documentation/devicetree/bindings/usb/usb.yaml .

If in Linux we have ohci@ , then we need to have the same in U-boot.

You should update the Linux DT to usb@ too to avoid dtbs_check warnings.

Quoted 1 line

We can accept the change to usb@ , if there is a pending patch in Linux.

I can make the same argument about Linux, since DTs are OS agnostic. My comment is OS agnostic too and does not apply specifically to U-Boot or Linux, it applies to DT.

Quoted 1 line

U-boot is not the place to review the devicetree.

I strongly disagree with this statement.

What does it matter where the review feedback came from ?
What does matter is that you can improve the DT based on that feedback, if the feedback is valid.

Quoted 1 line

The devicetree must be in sync with Linux.

I agree with this statement.

Please update the Linux DT too.

#5 lore raw

Re: [PATCH 1/6] ARM: dts: sam9x60: Add OHCI and EHCI DT nodes

Quoted 35 lines · Marek Vasut
Quoted 25 lines · On 1/4/23 08:30, [email protected] wrote:
Quoted 24 lines · Marek Vasut
Quoted 6 lines · Sergiu Moga

Add the OHCI and EHCI DT nodes for the sam9x60 boards.

---
   arch/arm/dts/at91-sam9x60_curiosity.dts | 21 +++++++++++++++++++++ arch/arm/dts/sam9x60.dtsi               | 18 ++++++++++++++++++

Board and SoC DT changes should be in separate patches.

Quoted 2 lines

   arch/arm/dts/sam9x60ek.dts              | 21 +++++++++++++++++++++

   3 files changed, 60 insertions(+)

[...]

Quoted 8 lines
arch/arm/dts/sam9x60.dtsi +0 -0
index 17224ef771..e36a540f78 100644
@@ -69,6 +69,24 @@
                #size-cells = <1>;
                ranges;
 
Quoted 8 lines
Quoted 5 lines

arch/arm/dts/sam9x60.dtsi line 72

Quoted 1 line
arch/arm/dts/sam9x60.dtsi +1 -0
+             usb1: ohci@600000 {

This should be usb@ instead of ohci@ , if you run "make dtbs_check" on this DT in Linux (please do), you would likely get a warning , see Linux Documentation/devicetree/bindings/usb/usb.yaml .

If in Linux we have ohci@ , then we need to have the same in U-boot.

Quoted 7 lines

You should update the Linux DT to usb@ too to avoid dtbs_check warnings.

Quoted 1 line

We can accept the change to usb@ , if there is a pending patch in Linux.

I can make the same argument about Linux, since DTs are OS agnostic. My comment is OS agnostic too and does not apply specifically to U-Boot or Linux, it applies to DT.

Definitely you can comment in Linux , for sure.

Quoted 4 lines
Quoted 2 lines

U-boot is not the place to review the devicetree.

I strongly disagree with this statement.

There are a few decisions behind this statement.
First, the fact that we no longer take bindings into Uboot, and rely solely on bindings in Linux. This means the bindings were reviewed and validated in Linux.
Sure there are a few exceptions but not the usual rule. Second, we rely on devicetree kernel.org mailing list to review all the DTs and binding compliance in Linux.
This means that the DT has been validated and checked as ABI in Linux. Hence there is no place to question that in Uboot or any other project. The DT must be the same and ABI across all software that uses the DT. If this was validated and agreed upon in Linux, we can't question that here. So if you disagree with this statement, it's your choice of course.

Quoted 4 lines

What does it matter where the review feedback came from ? What does matter is that you can improve the DT based on that feedback, if the feedback is valid.

I agree with that, but if we want to improve things, we need to patch things either in Linux first, or patch projects together. The fact that you are against some patches while they have the same identical node in Linux, is not a reason to not allow devicetree nodes to be added to Uboot.
DT syncing with Linux is always a must, and that is part of what Sergiu is doing with these patches.

Quoted 6 lines
Quoted 2 lines

The devicetree must be in sync with Linux.

I agree with this statement.

Please update the Linux DT too.

That is one approach but as I said, not a reason to reject a node that is identical with Linux.

#6 lore raw

Re: [PATCH 1/6] ARM: dts: sam9x60: Add OHCI and EHCI DT nodes

Quoted 47 lines · On 1/4/23 11:11, [email protected] wrote:
Quoted 35 lines · Marek Vasut
Quoted 25 lines · On 1/4/23 08:30, [email protected] wrote:
Quoted 24 lines · Marek Vasut
Quoted 6 lines · Sergiu Moga

Add the OHCI and EHCI DT nodes for the sam9x60 boards.

---
    arch/arm/dts/at91-sam9x60_curiosity.dts | 21 +++++++++++++++++++++
    arch/arm/dts/sam9x60.dtsi               | 18 ++++++++++++++++++

Board and SoC DT changes should be in separate patches.

Quoted 2 lines
    arch/arm/dts/sam9x60ek.dts              | 21 +++++++++++++++++++++
    3 files changed, 60 insertions(+)

[...]

Quoted 8 lines
arch/arm/dts/sam9x60.dtsi +0 -0
index 17224ef771..e36a540f78 100644
@@ -69,6 +69,24 @@
                #size-cells = <1>;
                ranges;
 
Quoted 8 lines
Quoted 5 lines

arch/arm/dts/sam9x60.dtsi line 72

Quoted 1 line
arch/arm/dts/sam9x60.dtsi +1 -0
+             usb1: ohci@600000 {

This should be usb@ instead of ohci@ , if you run "make dtbs_check" on this DT in Linux (please do), you would likely get a warning , see Linux Documentation/devicetree/bindings/usb/usb.yaml .

If in Linux we have ohci@ , then we need to have the same in U-boot.

Quoted 7 lines

You should update the Linux DT to usb@ too to avoid dtbs_check warnings.

Quoted 1 line

We can accept the change to usb@ , if there is a pending patch in Linux.

I can make the same argument about Linux, since DTs are OS agnostic. My comment is OS agnostic too and does not apply specifically to U-Boot or Linux, it applies to DT.

Definitely you can comment in Linux , for sure.

Quoted 1 line
Quoted 8 lines
Quoted 3 lines
Quoted 1 line

U-boot is not the place to review the devicetree.

I strongly disagree with this statement.

There are a few decisions behind this statement.
First, the fact that we no longer take bindings into Uboot, and rely solely on bindings in Linux. This means the bindings were reviewed and validated in Linux.

Linux
1e5f532c27371 ("ARM: dts: at91: sam9x60: add device tree for soc and board") which added these ohci@ nodes has been accepted after Linux 14ec072a19ad7 ("dt-bindings: usb: Convert USB HCD generic binding to YAML") was already in place.

Therefore, nobody ran the dtbs_check at that point, which is somewhat understandable, since the dtbs_check at that point was in very early stages.

This however shows the review process is not flawless and subsequent updates may be necessary.

One such update example is Linux:
979813d2ab705 ("ARM: dts: at91: use generic name for reset controller") which does:
- reset_controller: rstc@fffffe00 {
+ reset_controller: reset-controller@fffffe00 {
or another one:
6a743ea387e63 ("ARM: dts: at91: Use the generic "rtc" node name for the rtt IPs")
- rtt: rtt@fffffe20 {
+ rtt: rtc@fffffe20 {
or another one:
4b6140b96dfe4 ("ARM: dts: at91: Use the generic "crypto" node name for the crypto IPs")
- sha: sha@f002c000 {
+ sha: crypto@f002c000 {

Quoted 4 lines

Sure there are a few exceptions but not the usual rule. Second, we rely on devicetree kernel.org mailing list to review all the DTs and binding compliance in Linux.
This means that the DT has been validated and checked as ABI in Linux.

I think the ABI argument does not work, your own engineers would've caused multiple ABI breaks by now, see above.

Quoted 1 line

Hence there is no place to question that in Uboot or any other project.

As you can see above, Linux kernel review process is not perfect and the code is constantly evolving rather than begin set in stone. I believe other projects and their reviewers are no worse than Linux kernel ones, and can provide valid review feedback too.

Quoted 3 lines

The DT must be the same and ABI across all software that uses the DT. If this was validated and agreed upon in Linux, we can't question that here. So if you disagree with this statement, it's your choice of course.

I strongly disagree.

Quoted 11 lines
Quoted 3 lines

What does it matter where the review feedback came from ? What does matter is that you can improve the DT based on that feedback, if the feedback is valid.

I agree with that, but if we want to improve things, we need to patch things either in Linux first, or patch projects together. The fact that you are against some patches while they have the same identical node in Linux, is not a reason to not allow devicetree nodes to be added to Uboot.
DT syncing with Linux is always a must, and that is part of what Sergiu is doing with these patches.

See below.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

The devicetree must be in sync with Linux.

I agree with this statement.

Please update the Linux DT too.

That is one approach but as I said, not a reason to reject a node that is identical with Linux.

Ultimately, I am not the at91 maintainer, so I have no say in this.

I provided review feedback, that the DT checker would warn on the node name, and explained how to deal with it.

Whether the feedback is accepted and the DT is improved , or , the feedback is discarded and the DT checker keeps producing warnings , is not my decision to make.

#7 lore raw

PATCH 2/6 dt-bindings: reset: add sama7g5 definitions

In reply to Sergiu Moga

Upstream linux commit 5994f58977e0.

Add reset bindings for SAMA7G5. At the moment only USB PHYs are included.

---
 include/dt-bindings/reset/sama7g5-reset.h | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 include/dt-bindings/reset/sama7g5-reset.h
include/dt-bindings/reset/sama7g5-reset.h new file +10 -0
new file mode 100644
index 0000000000..2116f41d04
@@ -0,0 +1,10 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
+
+#ifndef __DT_BINDINGS_RESET_SAMA7G5_H
+#define __DT_BINDINGS_RESET_SAMA7G5_H
+
+#define SAMA7G5_RESET_USB_PHY1		4
+#define SAMA7G5_RESET_USB_PHY2		5
+#define SAMA7G5_RESET_USB_PHY3		6
+
+#endif /* __DT_BINDINGS_RESET_SAMA7G5_H */
Signature · 1 line
2.34.1
#8 lore raw

PATCH 3/6 dt-bindings: clk: at91: Define additional UTMI related clocks

In reply to Sergiu Moga

Add definitions for an additional main UTMI clock as well as its respective subclocks.

---
 include/dt-bindings/clk/at91.h | 5 +++++
 1 file changed, 5 insertions(+)
include/dt-bindings/clk/at91.h +5 -0
index e30756b280..386f01cf31 100644
@@ -18,5 +18,10 @@
 #define PMC_TYPE_PERIPHERAL	3
 #define PMC_TYPE_GCK		4
 #define PMC_TYPE_SLOW		5
+#define UTMI			6
+
+#define UTMI1			0
+#define UTMI2			1
+#define UTMI3			2
 
 #endif
Signature · 1 line
2.34.1
#9 lore raw

Re: [PATCH 3/6] dt-bindings: clk: at91: Define additional UTMI related clocks

Quoted 13 lines · Sergiu Moga

Add definitions for an additional main UTMI clock as well as its respective subclocks.

---
  include/dt-bindings/clk/at91.h | 5 +++++
  1 file changed, 5 insertions(+)
include/dt-bindings/clk/at91.h +0 -0
index e30756b280..386f01cf31 100644

include/dt-bindings/clk/at91.h line 25

Quoted 8 lines
include/dt-bindings/clk/at91.h +5 -0
@@ -18,5 +18,10 @@
  #define PMC_TYPE_PERIPHERAL	3
  #define PMC_TYPE_GCK		4
  #define PMC_TYPE_SLOW		5
+#define UTMI			6
+
+#define UTMI1			0
+#define UTMI2			1
+#define UTMI3			2

Why isn't there PMC_TYPE_ prefix in these new macros ?

#10 lore raw

Re: [PATCH 3/6] dt-bindings: clk: at91: Define additional UTMI related clocks

Quoted 9 lines · Marek Vasut
Quoted 8 lines · Sergiu Moga

Add definitions for an additional main UTMI clock as well as its respective subclocks.

---
  include/dt-bindings/clk/at91.h | 5 +++++

  1 file changed, 5 insertions(+)
Quoted 16 lines
Quoted 6 lines
include/dt-bindings/clk/at91.h +0 -0
index e30756b280..386f01cf31 100644

include/dt-bindings/clk/at91.h line 25

Quoted 8 lines
include/dt-bindings/clk/at91.h +5 -0
@@ -18,5 +18,10 @@
   #define PMC_TYPE_PERIPHERAL 3
   #define PMC_TYPE_GCK                4
   #define PMC_TYPE_SLOW               5
+#define UTMI                 6
+
+#define UTMI1                        0
+#define UTMI2                        1
+#define UTMI3                        2

Why isn't there PMC_TYPE_ prefix in these new macros ?

There is no PMC_TYPE_ because it refers to a different block external to the PMC block. PMC feeds the UTMI clock which feeds the UTMI block that contains the three UTMI clocks: the one for port A and the ones meant for port B and C which depend on port A's UTMI clock. There is no control in the PMC for these. The reason why I added UTMI in this file is because it is related to DT clock definitions.

#11 lore raw

Re: [PATCH 3/6] dt-bindings: clk: at91: Define additional UTMI related clocks

Quoted 27 lines · On 1/3/23 12:50, [email protected] wrote:
Quoted 9 lines · Marek Vasut
Quoted 8 lines · Sergiu Moga

Add definitions for an additional main UTMI clock as well as its respective subclocks.

---
   include/dt-bindings/clk/at91.h | 5 +++++
   1 file changed, 5 insertions(+)
Quoted 16 lines
Quoted 6 lines
include/dt-bindings/clk/at91.h +0 -0
index e30756b280..386f01cf31 100644

include/dt-bindings/clk/at91.h line 25

Quoted 8 lines
include/dt-bindings/clk/at91.h +5 -0
@@ -18,5 +18,10 @@
   #define PMC_TYPE_PERIPHERAL 3
   #define PMC_TYPE_GCK                4
   #define PMC_TYPE_SLOW               5
+#define UTMI                 6
+
+#define UTMI1                        0
+#define UTMI2                        1
+#define UTMI3                        2

Why isn't there PMC_TYPE_ prefix in these new macros ?

Quoted 6 lines

There is no PMC_TYPE_ because it refers to a different block external to the PMC block. PMC feeds the UTMI clock which feeds the UTMI block that contains the three UTMI clocks: the one for port A and the ones meant for port B and C which depend on port A's UTMI clock. There is no control in the PMC for these. The reason why I added UTMI in this file is because it is related to DT clock definitions.

Can you come up with different prefix then ?

#12 lore raw

Re: [PATCH 3/6] dt-bindings: clk: at91: Define additional UTMI related clocks

Quoted 28 lines · Marek Vasut
Quoted 27 lines · On 1/3/23 12:50, [email protected] wrote:
Quoted 25 lines · Marek Vasut
Quoted 14 lines · Sergiu Moga

Add definitions for an additional main UTMI clock as well as its respective subclocks.

---
   include/dt-bindings/clk/at91.h | 5 +++++

   1 file changed, 5 insertions(+)
include/dt-bindings/clk/at91.h +0 -0
index e30756b280..386f01cf31 100644

include/dt-bindings/clk/at91.h line 25

Quoted 8 lines
include/dt-bindings/clk/at91.h +5 -0
@@ -18,5 +18,10 @@
    #define PMC_TYPE_PERIPHERAL 3
    #define PMC_TYPE_GCK                4
    #define PMC_TYPE_SLOW               5
+#define UTMI                 6
+
+#define UTMI1                        0
+#define UTMI2                        1
+#define UTMI3                        2

Why isn't there PMC_TYPE_ prefix in these new macros ?

Quoted 8 lines
Quoted 6 lines

There is no PMC_TYPE_ because it refers to a different block external to the PMC block. PMC feeds the UTMI clock which feeds the UTMI block that contains the three UTMI clocks: the one for port A and the ones meant for port B and C which depend on port A's UTMI clock. There is no control in the PMC for these. The reason why I added UTMI in this file is because it is related to DT clock definitions.

Can you come up with different prefix then ?

How about USB_UTMI? :) Would that be fine with you?

#13 lore raw

Re: [PATCH 3/6] dt-bindings: clk: at91: Define additional UTMI related clocks

Quoted 36 lines · On 1/4/23 10:03, [email protected] wrote:
Quoted 35 lines · Marek Vasut
Quoted 33 lines · On 1/3/23 12:50, [email protected] wrote:
Quoted 9 lines · Marek Vasut
Quoted 8 lines · Sergiu Moga

Add definitions for an additional main UTMI clock as well as its respective subclocks.

---
    include/dt-bindings/clk/at91.h | 5 +++++
    1 file changed, 5 insertions(+)
Quoted 16 lines
Quoted 6 lines
include/dt-bindings/clk/at91.h +0 -0
index e30756b280..386f01cf31 100644

include/dt-bindings/clk/at91.h line 25

Quoted 8 lines
include/dt-bindings/clk/at91.h +5 -0
@@ -18,5 +18,10 @@
    #define PMC_TYPE_PERIPHERAL 3
    #define PMC_TYPE_GCK                4
    #define PMC_TYPE_SLOW               5
+#define UTMI                 6
+
+#define UTMI1                        0
+#define UTMI2                        1
+#define UTMI3                        2

Why isn't there PMC_TYPE_ prefix in these new macros ?

There is no PMC_TYPE_ because it refers to a different block external to the PMC block. PMC feeds the UTMI clock which feeds the UTMI block that contains the three UTMI clocks: the one for port A and the ones meant for port B and C which depend on port A's UTMI clock. There is no control in the PMC for these. The reason why I added UTMI in this file is because it is related to DT clock definitions.

Quoted 3 lines
Quoted 1 line

Can you come up with different prefix then ?

How about USB_UTMI? :) Would that be fine with you?

If those clock are within the USB IP block itself, sure.

I assume the PMC_ clock are in some clock IP block.

#14 lore raw

PATCH 4/6 ARM: dts: at91: sama7: Add USB related DT nodes

In reply to Sergiu Moga

Add the USB related DT nodes for the sama7g5ek board.

---
 arch/arm/dts/at91-sama7g5ek.dts | 34 +++++++++++++++
 arch/arm/dts/sama7g5.dtsi       | 73 +++++++++++++++++++++++++++++++++
 2 files changed, 107 insertions(+)
arch/arm/dts/at91-sama7g5ek.dts +34 -0
index 9b247fcaf6..31adc4d3e7 100644
@@ -761,6 +761,11 @@
 		pinmux = <PIN_PB1__SPDIF_TX>;
 		bias-disable;
 	};
+
+	pinctrl_usb_default: usb_default {
+		pinmux = <PIN_PC6__GPIO>;
+		bias-disable;
+	};
 };
 
 &pwm {
@@ -837,6 +842,35 @@
 	status = "okay";
 };
 
+&usb2 {
+	num-ports = <3>;
+	atmel,vbus-gpio = <0
+			   0
+			   &pioA PIN_PC6 GPIO_ACTIVE_HIGH
+			  >;
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_usb_default>;
+	phys = <&usb_phy2>;
+	phy-names = "usb";
+	status = "okay";
+};
+
+&usb3 {
+	status = "okay";
+};
+
+&usb_phy0 {
+	status = "okay";
+};
+
+&usb_phy1 {
+	status = "okay";
+};
+
+&usb_phy2 {
+	status = "okay";
+};
+
 &vddout25 {
 	vin-supply = <&vdd_3v3>;
 	status = "okay";
arch/arm/dts/sama7g5.dtsi +73 -0

97 lines not on this page · raw message

Signature · 1 line
2.34.1
#15 lore raw

Re: [PATCH 4/6] ARM: dts: at91: sama7: Add USB related DT nodes

Quoted 5 lines · Sergiu Moga

Add the USB related DT nodes for the sama7g5ek board.

---
  arch/arm/dts/at91-sama7g5ek.dts | 34 +++++++++++++++

Board DT and SoC DT should be separate patches.

Are these DT changes part of upstream Linux yet ?

Quoted 2 lines
  arch/arm/dts/sama7g5.dtsi       | 73 +++++++++++++++++++++++++++++++++
  2 files changed, 107 insertions(+)

[...]

#16 lore raw

Re: [PATCH 4/6] ARM: dts: at91: sama7: Add USB related DT nodes

Quoted 11 lines · Marek Vasut
Quoted 5 lines · Sergiu Moga

Add the USB related DT nodes for the sama7g5ek board.

---
  arch/arm/dts/at91-sama7g5ek.dts | 34 +++++++++++++++

Board DT and SoC DT should be separate patches.

Are these DT changes part of upstream Linux yet ?

No, but they will be integrated in the future.

Quoted 5 lines
Quoted 2 lines

  arch/arm/dts/sama7g5.dtsi       | 73 +++++++++++++++++++++++++++++++++

  2 files changed, 107 insertions(+)

[...]

#17 lore raw

Re: [PATCH 4/6] ARM: dts: at91: sama7: Add USB related DT nodes

Quoted 8 lines · On 1/3/23 12:53, [email protected] wrote:
Quoted 7 lines · Marek Vasut
Quoted 5 lines · Sergiu Moga

Add the USB related DT nodes for the sama7g5ek board.

---
   arch/arm/dts/at91-sama7g5ek.dts | 34 +++++++++++++++
Quoted 7 lines
Quoted 4 lines

Board DT and SoC DT should be separate patches.

Are these DT changes part of upstream Linux yet ?

No, but they will be integrated in the future.

Were the patches at least posted ?

If not, add the nodes into at91-sama7g5ek-u-boot.dtsi , so it is clear this is temporarily U-Boot specific.

#18 lore raw

Re: [PATCH 4/6] ARM: dts: at91: sama7: Add USB related DT nodes

Quoted 15 lines · Marek Vasut
Quoted 14 lines · On 1/3/23 12:53, [email protected] wrote:
Quoted 11 lines · Marek Vasut
Quoted 5 lines · Sergiu Moga

Add the USB related DT nodes for the sama7g5ek board.

---
   arch/arm/dts/at91-sama7g5ek.dts | 34 +++++++++++++++

Board DT and SoC DT should be separate patches.

Are these DT changes part of upstream Linux yet ?

Quoted 6 lines
Quoted 1 line

No, but they will be integrated in the future.

Were the patches at least posted ?

If not, add the nodes into at91-sama7g5ek-u-boot.dtsi , so it is clear this is temporarily U-Boot specific.

I am sorry, I somehow did not receive these replies before sending v2. Sure thing, I will try moving them there.

#19 lore raw

Re: [PATCH 4/6] ARM: dts: at91: sama7: Add USB related DT nodes

Quoted 18 lines · On 1/3/23 16:53, [email protected] wrote:
Quoted 17 lines · Marek Vasut
Quoted 15 lines · On 1/3/23 12:53, [email protected] wrote:
Quoted 11 lines · Marek Vasut
Quoted 5 lines · Sergiu Moga

Add the USB related DT nodes for the sama7g5ek board.

---
    arch/arm/dts/at91-sama7g5ek.dts | 34 +++++++++++++++

Board DT and SoC DT should be separate patches.

Are these DT changes part of upstream Linux yet ?

No, but they will be integrated in the future.

Quoted 7 lines
Quoted 4 lines

Were the patches at least posted ?

If not, add the nodes into at91-sama7g5ek-u-boot.dtsi , so it is clear this is temporarily U-Boot specific.

I am sorry, I somehow did not receive these replies before sending v2. Sure thing, I will try moving them there.

Yes, I was still in the process of handling V1, just wait a few days before sending Vx of patches to give reviews time to review and comment.

#20 lore raw

PATCH 5/6 ARM: dts: at91: sama5d2_icp: Add pinctrl nodes for USB related DT nodes

In reply to Sergiu Moga

Add the pinctrl subnodes required by the USB related DT nodes.

---
 arch/arm/dts/at91-sama5d2_icp.dts | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
arch/arm/dts/at91-sama5d2_icp.dts +22 -0
index 2dffae9c5c..4f796c6c94 100644
@@ -154,7 +154,29 @@
 						 <PIN_PA13__SDMMC0_CD>;
 					bias-disable;
 				};
+
+				pinctrl_usb_default: usb_default {
+					pinmux = <PIN_PC17__GPIO>;
+					bias-disable;
+				};
+
+				pinctrl_usba_vbus: usba_vbus {
+					pinmux = <PIN_PD23__GPIO>;
+					bias-disable;
+				};
 			};
 		};
 	};
 };
+
+&usb1 {
+	num-ports = <3>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_usb_default>;
+	status = "okay";
+};
+
+&usb2 {
+	phy_type = "hsic";
+	status = "okay";
+};
Signature · 1 line
2.34.1
#21 lore raw

PATCH 6/6 ARM: dts: at91: sama5d27_wlsom1_ek: Add pinctrl nodes for USB DT nodes

In reply to Sergiu Moga

Add the pinctrl nodes required by the USB related DT nodes.

---
 arch/arm/dts/at91-sama5d27_wlsom1_ek.dts | 25 ++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
arch/arm/dts/at91-sama5d27_wlsom1_ek.dts +25 -0
index eec183d5de..6d4b35ea96 100644
@@ -143,7 +143,32 @@
 					pinmux = <PIN_PC9__GPIO>;
 					bias-pull-up;
 				};
+
+				pinctrl_usb_default: usb_default {
+					pinmux = <PIN_PA10__GPIO>;
+					bias-disable;
+				};
+
+				pinctrl_usba_vbus: usba_vbus {
+					pinmux = <PIN_PA16__GPIO>;
+					bias-disable;
+				};
 			};
 		};
 	};
 };
+
+&usb1 {
+	num-ports = <3>;
+	atmel,vbus-gpio = <0
+			   &pioA PIN_PA10 GPIO_ACTIVE_HIGH
+			   0
+			  >;
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_usb_default>;
+	status = "okay";
+};
+
+&usb2 {
+	status = "okay";
+};
Signature · 1 line
2.34.1