From fe9fd6b88869cecf0965087d67ce64b1aac95233 Mon Sep 17 00:00:00 2001
From: Dimitry Shapovalov <dimitry.shapovalov@belden.com>
Date: Tue, 30 May 2023 13:09:47 +0200
Subject: [PATCH] fix phy support for falcon board

adjust the devicetree to get the phys up and running
---
 .../boot/dts/marvell/cn9130-bldn-mbv.dts      | 17 +++++-----
 .../boot/dts/marvell/cn9131-bldn-mbv.dts      | 31 +++++--------------
 2 files changed, 17 insertions(+), 31 deletions(-)

diff --git a/arch/arm64/boot/dts/marvell/cn9130-bldn-mbv.dts b/arch/arm64/boot/dts/marvell/cn9130-bldn-mbv.dts
index 8be9c2cc1330..da6289571083 100644
--- a/arch/arm64/boot/dts/marvell/cn9130-bldn-mbv.dts
+++ b/arch/arm64/boot/dts/marvell/cn9130-bldn-mbv.dts
@@ -98,7 +98,7 @@ cp0_sfp_eth0: sfp-eth@0 {
 		compatible = "sff,sfp";
 		i2c-bus = <&i2c_sfp0>;
 		mod-def0-gpio = <&cp0_gpio1 27 GPIO_ACTIVE_LOW>; //MPP27
-		//maximum-power-milliwatt = <2000>;
+		maximum-power-milliwatt = <2000>;
 		pinctrl-names = "default";
 		pinctrl-0 = <&sfp_cp0_eth0_present_pins>;
 	};
@@ -175,7 +175,7 @@ rtc: rtc@68 {
                 /*connected to rtc DS1339U-33+*/
         };
         i2c-switch@73 {
-                compatible = "nxp,pca9544";
+                compatible = "nxp,pca9543";
                 reg = <0x73>;
                 #address-cells = <1>;
                 #size-cell = <0>;
@@ -248,11 +248,7 @@ &cp0_eth0 {
 	managed = "in-band-status";
 
 	/* for SFP direct connectivity */
-//      sfp = <&cp0_sfp_eth0>;
-
-        /* MBV-A BCM PHY  | MBV-B VSC Microchip PHY */
-//      phy = <&cp0_sfi_phy8>; //address 0x01000
-
+        sfp = <&cp0_sfp_eth0>;
 };
 
 /* SRDS #3 - SGMII 1GE on carrier board */
@@ -305,6 +301,13 @@ spi-flash@0 {
 		reg = <0x0>;
 		spi-max-frequency = <10000000>;
 	};
+        spi-cpld@1 {
+                compatible = "rohm,dh2228fv";
+                reg = <0x1>;
+                #address-cells = <1>;
+                #size-cells = <0>;
+                spi-max-frequency = <10000000>;
+       };
 };
 
 &cp0_syscon0 {
diff --git a/arch/arm64/boot/dts/marvell/cn9131-bldn-mbv.dts b/arch/arm64/boot/dts/marvell/cn9131-bldn-mbv.dts
index 43ef7e6cb92f..0bfd2c8cb0b4 100644
--- a/arch/arm64/boot/dts/marvell/cn9131-bldn-mbv.dts
+++ b/arch/arm64/boot/dts/marvell/cn9131-bldn-mbv.dts
@@ -42,7 +42,7 @@ cp1_usb3_0_phy1: cp1_usb3_phy@1 {
 	};
 	cp1_sfp_eth0: sfp_eth0{
 		compatible = "sff,sfp";
-	//	i2c-bus = <&i2c_sfp1>;
+		i2c-bus = <&i2c_sfp1>;
                 mod-def0-gpio = <&cp1_gpio2 18 GPIO_ACTIVE_LOW>; //MPP50
                 maximum-power-milliwatt = <2000>;
                 pinctrl-0 = <&sfp_cp1_present_pins>; 
@@ -104,10 +104,7 @@ &cp1_eth0 {
         managed = "in-band-status";
 
 	/* for SFP direct connectivity */
-//	sfp = <&cp1_sfp_eth0>;
-        
-	/* MBV-A BCM PHY  | MBV-B VSC Microchip PHY */
-	phy = <&cp1_sfi_phy9>; //address 0x01001
+	sfp = <&cp1_sfp_eth0>;
 };
 
 /* SRDS #3 - NC */
@@ -142,25 +139,14 @@ &cp1_gpio2 {
 	status = "okay";
 };
 
-&cp1_xmdio {
-        status = "okay";
- 	pinctrl-0 = <&cp1_xmdio_pins>;
-        cp0_sfi_phy8: ethernet-phy@8 {
-                reg = <8>;
-        };
-        cp1_sfi_phy9: ethernet-phy@9 {
-                reg = <9>;
-        };
-};
-
 &cp1_mdio {
         status = "okay";
         pinctrl-0 = <&cp1_mdio_pins>;
         cp0_vsc_phy18: ethernet-phy@18 {
-                reg = <18>;
+                reg = <0x18>;
         };
         cp0_vsc_phy19: ethernet-phy@19 {
-                reg = <19>;
+                reg = <0x19>;
         };
 
 };
@@ -237,18 +223,15 @@ cp1_uart1_pins: cp1-uart1-pins-1 {
 
 /*************** definitions of addresses for cp0 eth ports ************/
 
-&cp0_eth0 {
-        status = "okay";
-        phy = <&cp0_sfi_phy8>; //address 0x01000
-};
-
 &cp0_eth1 {
         status = "okay";
         phy = <&cp0_vsc_phy18>; //address 0x0011000
+        managed = "auto";
 };
 
 &cp0_eth2 {
         status = "okay";
         phy = <&cp0_vsc_phy19>; //address 0x0011001
+        managed = "auto";
 };
-                                                   
+                                                   
\ No newline at end of file
