Skip to content

Conversation

@lsj123lsjlsj
Copy link

net: dsa: add support for reading port MAC addresses from EEPROM

Signed-off-by: SongJun Li <lisongjun@radxa.com>
Signed-off-by: SongJun Li <lisongjun@radxa.com>
Copy link
Member

@RadxaYuntian RadxaYuntian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我感觉怎么又在弄一个新实现,之前不是说有一个基于starfive的eeprom格式么?那个不是已经写过了一个配置mac的实现了

Signed-off-by: SongJun Li <lisongjun@radxa.com>
Copy link
Member

@RadxaYuntian RadxaYuntian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

所以这个local-mac-address/mac-at-eeprom是我们自己加的一个值咯?这个应该很难让第三方系统支持
phy的mac应该可以从uboot配置吧?

}

/* 24c16 uses 1-byte address */
if (offset > 0xff) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

应该还有offset+len > 0xff

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

那这里多加一个if (offset + len - 1 > 0xff)么

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我的意思是最好是看看下面uboot那个实现,用上游支持比较好的接口

goto out_put_np;
}

if (len != ETH_ALEN) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果len的数值是固定的那为什么设备树里面还要写?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里是比如 dts 配置成 local-mac-address = [00 48 54 20 00 ]; 或者 local-mac-address = [00 48 54 20 00 02 03]; 那驱动会检测这个长度

@lsj123lsjlsj
Copy link
Author

所以这个local-mac-address/mac-at-eeprom是我们自己加的一个值咯?这个应该很难让第三方系统支持 phy的mac应该可以从uboot配置吧?

这个是针对交换机芯片的 PORT, u-boot 传递的 mac 地址没法传递给 SWITCH PORT

@RadxaYuntian
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants