[PATCH] octeon: use fixed layout cell "mac-base" for Cisco vEdge 1000

Christian Svensson blue at cmd.nu
Tue Jul 18 10:37:49 PDT 2023


On Mon, Jul 17, 2023 at 9:00 AM Rafał Miłecki <zajec5 at gmail.com> wrote:
>
> From: Rafał Miłecki <rafal at milecki.pl>
>
> This drops a use of downstream "mac-address-increment".
>
> Cc: Christian Svensson <blue at cmd.nu>
> Cc: Tommy Nevtelen <tommy at nevtelen.com>
> Cc: Viktor Ekmark <viktor at ekmark.se>
> Cc: Daniel Wennberg <github at networkninja.se>
> Signed-off-by: Rafał Miłecki <rafal at milecki.pl>

Tested-by: Christian Svensson <blue at cmd.nu>

> ---
> I didn't have a chance to try "fixed-layout" with "atmel,24c512". This
> is untested.
>
> Can you guys verify if reading MAC still works with this patch, please?
> ---
>  .../cavium-octeon/cn6130_cisco_vedge1000.dts  | 40 +++++++++----------
>  1 file changed, 19 insertions(+), 21 deletions(-)
>
> diff --git a/target/linux/octeon/files/arch/mips/boot/dts/cavium-octeon/cn6130_cisco_vedge1000.dts b/target/linux/octeon/files/arch/mips/boot/dts/cavium-octeon/cn6130_cisco_vedge1000.dts
> index e1f308dd52..4680d6ea14 100644
> --- a/target/linux/octeon/files/arch/mips/boot/dts/cavium-octeon/cn6130_cisco_vedge1000.dts
> +++ b/target/linux/octeon/files/arch/mips/boot/dts/cavium-octeon/cn6130_cisco_vedge1000.dts
> @@ -24,7 +24,7 @@
>                               <0x11800 0xe0002000 0x00 0x08>;
>                         cell-index = <0x00>;
>                         interrupts = <0x00 0x3e 0x01 0x2e>;
> -                       nvmem-cells = <&macaddr_eeprom>;
> +                       nvmem-cells = <&macaddr_eeprom 0>;
>                         nvmem-cell-names = "mac-address";
>                         phy-handle = <&mgmtphy>;
>                 };
> @@ -32,25 +32,22 @@
>                 pip: pip at 11800a0000000 {
>                         interface at 0 {
>                                 ethernet at 0 {
> -                                       nvmem-cells = <&macaddr_eeprom>;
> +                                       nvmem-cells = <&macaddr_eeprom 3>;
>                                         nvmem-cell-names = "mac-address";
> -                                       mac-address-increment = <(3)>;
>                                         label = "lan2";
>                                         /delete-property/ local-mac-address;
>                                 };
>
>                                 ethernet at 1 {
> -                                       nvmem-cells = <&macaddr_eeprom>;
> +                                       nvmem-cells = <&macaddr_eeprom 4>;
>                                         nvmem-cell-names = "mac-address";
> -                                       mac-address-increment = <(4)>;
>                                         label = "lan3";
>                                         /delete-property/ local-mac-address;
>                                 };
>
>                                 ethernet at 2 {
> -                                       nvmem-cells = <&macaddr_eeprom>;
> +                                       nvmem-cells = <&macaddr_eeprom 1>;
>                                         nvmem-cell-names = "mac-address";
> -                                       mac-address-increment = <(1)>;
>                                         label = "lan0";
>                                         /delete-property/ local-mac-address;
>                                 };
> @@ -58,9 +55,8 @@
>                                 ethernet at 3 {
>                                         compatible = "cavium,octeon-3860-pip-port";
>                                         reg = <0x3>;
> -                                       nvmem-cells = <&macaddr_eeprom>;
> +                                       nvmem-cells = <&macaddr_eeprom 2>;
>                                         nvmem-cell-names = "mac-address";
> -                                       mac-address-increment = <(2)>;
>                                         label = "lan1";
>                                 };
>                         };
> @@ -69,36 +65,32 @@
>                                 ethernet at 0 {
>                                         compatible = "cavium,octeon-3860-pip-port";
>                                         reg = <0x0>;
> -                                       nvmem-cells = <&macaddr_eeprom>;
> +                                       nvmem-cells = <&macaddr_eeprom 7>;
>                                         nvmem-cell-names = "mac-address";
> -                                       mac-address-increment = <(7)>;
>                                         label = "lan6";
>                                 };
>
>                                 ethernet at 1 {
>                                         compatible = "cavium,octeon-3860-pip-port";
>                                         reg = <0x1>;
> -                                       nvmem-cells = <&macaddr_eeprom>;
> +                                       nvmem-cells = <&macaddr_eeprom 8>;
>                                         nvmem-cell-names = "mac-address";
> -                                       mac-address-increment = <(8)>;
>                                         label = "lan7";
>                                 };
>
>                                 ethernet at 2 {
>                                         compatible = "cavium,octeon-3860-pip-port";
>                                         reg = <0x2>;
> -                                       nvmem-cells = <&macaddr_eeprom>;
> +                                       nvmem-cells = <&macaddr_eeprom 5>;
>                                         nvmem-cell-names = "mac-address";
> -                                       mac-address-increment = <(5)>;
>                                         label = "lan4";
>                                 };
>
>                                 ethernet at 3 {
>                                         compatible = "cavium,octeon-3860-pip-port";
>                                         reg = <0x3>;
> -                                       nvmem-cells = <&macaddr_eeprom>;
> +                                       nvmem-cells = <&macaddr_eeprom 6>;
>                                         nvmem-cell-names = "mac-address";
> -                                       mac-address-increment = <(6)>;
>                                         label = "lan5";
>                                 };
>                         };
> @@ -135,11 +127,17 @@
>                                 compatible = "atmel,24c512";
>                                 reg = <0x54>;
>                                 pagesize = <0x80>;
> -                               #address-cells = <1>;
> -                               #size-cells = <1>;
>
> -                               macaddr_eeprom: mac-address at 8 {
> -                                       reg = <0x8 6>;
> +                               nvmem-layout {
> +                                       compatible = "fixed-layout";
> +                                       #address-cells = <1>;
> +                                       #size-cells = <1>;
> +
> +                                       macaddr_eeprom: mac-address at 8 {
> +                                               compatible = "mac-base";
> +                                               reg = <0x8 6>;
> +                                               #nvmem-cell-cells = <1>;
> +                                       };
>                                 };
>                         };
>                 };
> --
> 2.35.3
>



More information about the openwrt-devel mailing list