Re: [PATCH] bsps/zynqmp: Fix and update device trees

2022-12-05 Thread Chris Johns
On 6/12/2022 5:04 pm, Kinsey Moore wrote:
> On 12/5/2022 9:48 PM, Chris Johns wrote:
>> I am still seeing issues with this change. The interface is `cgem0` and not
>> `cgem3`. I have confirmed I have the same RTEMS hash in the build. Is there
>> anything I need to set up to have the FDT be seem by libbsd?
> 
> Seeing the first interface to come up as cgem0 is what I observe with this 
> patch
> on the ZCU102, but I do get DHCP. I haven't yet worked out a way around the
> change in behavior for interface numbering. It may need to complete the probe
> and reject the attach. I'll have the person with the TE0802 double check this
> tomorrow.

Ah yes it is working for me. I hd altered the config to reference cgem3 and
needed to change it back.

I am fine with cgem0 being selected and used.

> The output you've shared with me thus far indicates that the device tree is
> being read and used and there should be no additional actions to take for it 
> to
> be utilized.

Great.

The patch looks good. Please push.

Thanks
chris
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH] bsps/zynqmp: Fix and update device trees

2022-12-05 Thread Kinsey Moore

On 12/5/2022 9:48 PM, Chris Johns wrote:

I am still seeing issues with this change. The interface is `cgem0` and not
`cgem3`. I have confirmed I have the same RTEMS hash in the build. Is there
anything I need to set up to have the FDT be seem by libbsd?


Seeing the first interface to come up as cgem0 is what I observe with 
this patch on the ZCU102, but I do get DHCP. I haven't yet worked out a 
way around the change in behavior for interface numbering. It may need 
to complete the probe and reject the attach. I'll have the person with 
the TE0802 double check this tomorrow.


The output you've shared with me thus far indicates that the device tree 
is being read and used and there should be no additional actions to take 
for it to be utilized.



Kinsey

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH] bsps/zynqmp: Fix and update device trees

2022-12-05 Thread Chris Johns
I am still seeing issues with this change. The interface is `cgem0` and not
`cgem3`. I have confirmed I have the same RTEMS hash in the build. Is there
anything I need to set up to have the FDT be seem by libbsd?

Chris

On 6/12/2022 10:27 am, Kinsey Moore wrote:
> Add ref-clock-num identifiers to the device tree to ensure that
> interfaces use the correct clocks even when some are not used due to
> unconnected MII busses. This also adjusts the default ZynqMP PHY
> attachment to RGMII-ID which was the default before device trees were
> introduced.
> ---
>  bsps/aarch64/xilinx-zynqmp/fdt/cfc400x.dts   |   4 +
>  bsps/aarch64/xilinx-zynqmp/fdt/cfc400x_dtb.c | 132 ++-
>  bsps/aarch64/xilinx-zynqmp/fdt/zynqmp.dts|  12 +-
>  bsps/aarch64/xilinx-zynqmp/fdt/zynqmp_dtb.c  | 104 ---
>  4 files changed, 137 insertions(+), 115 deletions(-)
> 
> diff --git a/bsps/aarch64/xilinx-zynqmp/fdt/cfc400x.dts 
> b/bsps/aarch64/xilinx-zynqmp/fdt/cfc400x.dts
> index 763a668a5c..05647e0848 100644
> --- a/bsps/aarch64/xilinx-zynqmp/fdt/cfc400x.dts
> +++ b/bsps/aarch64/xilinx-zynqmp/fdt/cfc400x.dts
> @@ -62,6 +62,7 @@
>   interrupts = <0x00 0x39 0x04>;
>   reg = <0x00 0xff0b 0x00 0x1000>;
>   phy-mode = "sgmii";
> + ref-clock-num = <0>;
>   };
>  
>   ethernet@ff0c {
> @@ -71,6 +72,7 @@
>   interrupts = <0x00 0x3b 0x04>;
>   reg = <0x00 0xff0c 0x00 0x1000>;
>   phy-mode = "sgmii";
> + ref-clock-num = <1>;
>   };
>  
>   ethernet@ff0d {
> @@ -80,6 +82,7 @@
>   interrupts = <0x00 0x3d 0x04>;
>   reg = <0x00 0xff0d 0x00 0x1000>;
>   phy-mode = "sgmii";
> + ref-clock-num = <2>;
>   };
>  
>   ethernet@ff0e {
> @@ -89,6 +92,7 @@
>   interrupts = <0x00 0x3f 0x04>;
>   reg = <0x00 0xff0e 0x00 0x1000>;
>   phy-mode = "sgmii";
> + ref-clock-num = <3>;
>   };
>  
>   serial@800a {
> diff --git a/bsps/aarch64/xilinx-zynqmp/fdt/cfc400x_dtb.c 
> b/bsps/aarch64/xilinx-zynqmp/fdt/cfc400x_dtb.c
> index 2d0078678e..7a45b4f7dd 100644
> --- a/bsps/aarch64/xilinx-zynqmp/fdt/cfc400x_dtb.c
> +++ b/bsps/aarch64/xilinx-zynqmp/fdt/cfc400x_dtb.c
> @@ -1,8 +1,8 @@
>  unsigned char zynqmp_dtb[] = {
> -  0xd0, 0x0d, 0xfe, 0xed, 0x00, 0x00, 0x05, 0xa3, 0x00, 0x00, 0x00, 0x38,
> -  0x00, 0x00, 0x04, 0xd0, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x11,
> -  0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd3,
> -  0x00, 0x00, 0x04, 0x98, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> +  0xd0, 0x0d, 0xfe, 0xed, 0x00, 0x00, 0x05, 0xf1, 0x00, 0x00, 0x00, 0x38,
> +  0x00, 0x00, 0x05, 0x10, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x11,
> +  0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe1,
> +  0x00, 0x00, 0x04, 0xd8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
>0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04,
>0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03,
> @@ -39,33 +39,37 @@ unsigned char zynqmp_dtb[] = {
>0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00, 0xff, 0x0b, 0x00, 0x00,
>0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x03,
>0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x82, 0x73, 0x67, 0x6d, 0x69,
> -  0x69, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01,
> -  0x65, 0x74, 0x68, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x40, 0x66, 0x66, 0x30,
> -  0x63, 0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
> -  0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x1b, 0x63, 0x64, 0x6e, 0x73,
> -  0x2c, 0x67, 0x65, 0x6d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
> -  0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x5f, 0x6f, 0x6b, 0x61, 0x79,
> -  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04,
> -  0x00, 0x00, 0x00, 0x66, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03,
> -  0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x00,
> -  0x00, 0x00, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x03,
> -  0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00,
> -  0xff, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00,
> -  0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x82,
> -  0x73, 0x67, 0x6d, 0x69, 0x69, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
> +  0x69, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04,
> +  0x00, 0x00, 0x00, 0x8b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
>0x00, 0x00, 0x00, 0x01, 0x65, 0x74, 0x68, 0x65, 0x72, 0x6e, 0x65, 

[PATCH] bsps/zynqmp: Fix and update device trees

2022-12-05 Thread Kinsey Moore
Add ref-clock-num identifiers to the device tree to ensure that
interfaces use the correct clocks even when some are not used due to
unconnected MII busses. This also adjusts the default ZynqMP PHY
attachment to RGMII-ID which was the default before device trees were
introduced.
---
 bsps/aarch64/xilinx-zynqmp/fdt/cfc400x.dts   |   4 +
 bsps/aarch64/xilinx-zynqmp/fdt/cfc400x_dtb.c | 132 ++-
 bsps/aarch64/xilinx-zynqmp/fdt/zynqmp.dts|  12 +-
 bsps/aarch64/xilinx-zynqmp/fdt/zynqmp_dtb.c  | 104 ---
 4 files changed, 137 insertions(+), 115 deletions(-)

diff --git a/bsps/aarch64/xilinx-zynqmp/fdt/cfc400x.dts 
b/bsps/aarch64/xilinx-zynqmp/fdt/cfc400x.dts
index 763a668a5c..05647e0848 100644
--- a/bsps/aarch64/xilinx-zynqmp/fdt/cfc400x.dts
+++ b/bsps/aarch64/xilinx-zynqmp/fdt/cfc400x.dts
@@ -62,6 +62,7 @@
interrupts = <0x00 0x39 0x04>;
reg = <0x00 0xff0b 0x00 0x1000>;
phy-mode = "sgmii";
+   ref-clock-num = <0>;
};
 
ethernet@ff0c {
@@ -71,6 +72,7 @@
interrupts = <0x00 0x3b 0x04>;
reg = <0x00 0xff0c 0x00 0x1000>;
phy-mode = "sgmii";
+   ref-clock-num = <1>;
};
 
ethernet@ff0d {
@@ -80,6 +82,7 @@
interrupts = <0x00 0x3d 0x04>;
reg = <0x00 0xff0d 0x00 0x1000>;
phy-mode = "sgmii";
+   ref-clock-num = <2>;
};
 
ethernet@ff0e {
@@ -89,6 +92,7 @@
interrupts = <0x00 0x3f 0x04>;
reg = <0x00 0xff0e 0x00 0x1000>;
phy-mode = "sgmii";
+   ref-clock-num = <3>;
};
 
serial@800a {
diff --git a/bsps/aarch64/xilinx-zynqmp/fdt/cfc400x_dtb.c 
b/bsps/aarch64/xilinx-zynqmp/fdt/cfc400x_dtb.c
index 2d0078678e..7a45b4f7dd 100644
--- a/bsps/aarch64/xilinx-zynqmp/fdt/cfc400x_dtb.c
+++ b/bsps/aarch64/xilinx-zynqmp/fdt/cfc400x_dtb.c
@@ -1,8 +1,8 @@
 unsigned char zynqmp_dtb[] = {
-  0xd0, 0x0d, 0xfe, 0xed, 0x00, 0x00, 0x05, 0xa3, 0x00, 0x00, 0x00, 0x38,
-  0x00, 0x00, 0x04, 0xd0, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x11,
-  0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd3,
-  0x00, 0x00, 0x04, 0x98, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0xd0, 0x0d, 0xfe, 0xed, 0x00, 0x00, 0x05, 0xf1, 0x00, 0x00, 0x00, 0x38,
+  0x00, 0x00, 0x05, 0x10, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x11,
+  0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe1,
+  0x00, 0x00, 0x04, 0xd8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03,
@@ -39,33 +39,37 @@ unsigned char zynqmp_dtb[] = {
   0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00, 0xff, 0x0b, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x03,
   0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x82, 0x73, 0x67, 0x6d, 0x69,
-  0x69, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01,
-  0x65, 0x74, 0x68, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x40, 0x66, 0x66, 0x30,
-  0x63, 0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
-  0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x1b, 0x63, 0x64, 0x6e, 0x73,
-  0x2c, 0x67, 0x65, 0x6d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
-  0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x5f, 0x6f, 0x6b, 0x61, 0x79,
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04,
-  0x00, 0x00, 0x00, 0x66, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03,
-  0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x00,
-  0x00, 0x00, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x03,
-  0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00,
-  0xff, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00,
-  0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x82,
-  0x73, 0x67, 0x6d, 0x69, 0x69, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
+  0x69, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04,
+  0x00, 0x00, 0x00, 0x8b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
   0x00, 0x00, 0x00, 0x01, 0x65, 0x74, 0x68, 0x65, 0x72, 0x6e, 0x65, 0x74,
-  0x40, 0x66, 0x66, 0x30, 0x64, 0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00,
+  0x40, 0x66, 0x66, 0x30, 0x63, 0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x1b,
   0x63, 0x64, 0x6e, 0x73, 0x2c, 0x67, 0x65, 0x6d, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x5f,
   0x6f,