[PATCH] ramips: replace "mac-address-ascii" with "mac-base"

Mikhail Zhilkin csharper2005 at gmail.com
Fri Jul 14 11:36:14 PDT 2023


On 7/14/2023 4:11 PM, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal at milecki.pl>
> 
> With upstream accepted "mac-base" binding there is no need for a
> downstream "mac-address-ascii" workaround anymore.
> 
> Signed-off-by: Rafał Miłecki <rafal at milecki.pl>
> ---
>  .../dts/mt7621_raisecom_msg1500-x-00.dts      | 32 ++++++++++-------
>  .../ramips/dts/mt7621_tplink_ec330-g5u-v1.dts | 34 +++++++++++--------
>  2 files changed, 40 insertions(+), 26 deletions(-)
> 
> diff --git a/target/linux/ramips/dts/mt7621_raisecom_msg1500-x-00.dts b/target/linux/ramips/dts/mt7621_raisecom_msg1500-x-00.dts
> index 5d713c0098..07297df083 100644
> --- a/target/linux/ramips/dts/mt7621_raisecom_msg1500-x-00.dts
> +++ b/target/linux/ramips/dts/mt7621_raisecom_msg1500-x-00.dts
> @@ -82,15 +82,23 @@
>  			read-only;
>  
>  			compatible = "nvmem-cells";
> -			#address-cells = <1>;
> -			#size-cells = <1>;
> -
> -			macaddr_config_8014: macaddr at 8014 {
> -				reg = <0x8014 0x11>;
> -			};
>  
> -			macaddr_config_8036: macaddr at 8036 {
> -				reg = <0x8036 0x11>;
> +			nvmem-layout {
> +				compatible = "fixed-layout";
> +				#address-cells = <1>;
> +				#size-cells = <1>;
> +
> +				macaddr_config_8014: macaddr at 8014 {
> +					compatible = "mac-base";
> +					reg = <0x8014 0x11>;
> +					#nvmem-cell-cells = <1>;
> +				};
> +
> +				macaddr_config_8036: macaddr at 8036 {
> +					compatible = "mac-base";
> +					reg = <0x8036 0x11>;
> +					#nvmem-cell-cells = <1>;
> +				};
>  			};
>  		};
>  
> @@ -137,8 +145,8 @@
>  };
>  
>  &gmac0 {
> -	nvmem-cells = <&macaddr_config_8014>;
> -	nvmem-cell-names = "mac-address-ascii";
> +	nvmem-cells = <&macaddr_config_8014 0>;
> +	nvmem-cell-names = "mac-address";
>  };
>  
>  &gmac1 {
> @@ -146,8 +154,8 @@
>  	label = "wan";
>  	phy-handle = <&ethphy4>;
>  
> -	nvmem-cells = <&macaddr_config_8036>;
> -	nvmem-cell-names = "mac-address-ascii";
> +	nvmem-cells = <&macaddr_config_8036 0>;
> +	nvmem-cell-names = "mac-address";
>  };
>  
>  &mdio {
> diff --git a/target/linux/ramips/dts/mt7621_tplink_ec330-g5u-v1.dts b/target/linux/ramips/dts/mt7621_tplink_ec330-g5u-v1.dts
> index 6c9cc40701..537b6f70a7 100644
> --- a/target/linux/ramips/dts/mt7621_tplink_ec330-g5u-v1.dts
> +++ b/target/linux/ramips/dts/mt7621_tplink_ec330-g5u-v1.dts
> @@ -230,12 +230,20 @@
>  			read-only;
>  
>  			compatible = "nvmem-cells";
> -			#address-cells = <1>;
> -			#size-cells = <1>;
>  
> -			macaddr_factory_165: macaddr at 165 {
> -				reg = <0x165 0x11>;
> +			nvmem-layout {
> +				compatible = "fixed-layout";
> +				#address-cells = <1>;
> +				#size-cells = <1>;
> +
> +				macaddr_factory_165: macaddr at 165 {
> +					compatible = "mac-base";
> +					reg = <0x165 0x11>;
> +					#nvmem-cell-cells = <1>;
> +				};
>  			};
> +
> +
>  		};
>  
>  		partition at 0_wholeflash {
> @@ -257,8 +265,8 @@
>  		mediatek,mtd-eeprom = <&factory 0x8000>;
>  		ieee80211-freq-limit = <2400000 2500000>;
>  
> -		nvmem-cells = <&macaddr_factory_165>;
> -		nvmem-cell-names = "mac-address-ascii";
> +		nvmem-cells = <&macaddr_factory_165 0>;
> +		nvmem-cell-names = "mac-address";
>  	};
>  };
>  
> @@ -269,15 +277,14 @@
>  		mediatek,mtd-eeprom = <&factory 0x14000>;
>  		ieee80211-freq-limit = <5000000 6000000>;
>  
> -		nvmem-cells = <&macaddr_factory_165>;
> -		nvmem-cell-names = "mac-address-ascii";
> -		mac-address-increment = <(2)>;
> +		nvmem-cells = <&macaddr_factory_165 2>;
> +		nvmem-cell-names = "mac-address";
>  	};
>  };
>  
>  &gmac0 {
> -	nvmem-cells = <&macaddr_factory_165>;
> -	nvmem-cell-names = "mac-address-ascii";
> +	nvmem-cells = <&macaddr_factory_165 0>;
> +	nvmem-cell-names = "mac-address";
>  };
>  
>  &gmac1 {
> @@ -285,9 +292,8 @@
>  	label = "wan";
>  	phy-handle = <&ethphy0>;
>  
> -	nvmem-cells = <&macaddr_factory_165>;
> -	nvmem-cell-names = "mac-address-ascii";
> -	mac-address-increment = <(1)>;
> +	nvmem-cells = <&macaddr_factory_165 1>;
> +	nvmem-cell-names = "mac-address";
>  };
>  
>  &mdio {


[TP-Link EC330-G5u v1 - OK]
Tested-by: Mikhail Zhilkin <csharper2005 at gmail.com>

-- 
Best regards,
Mikhail



More information about the openwrt-devel mailing list