diff mbox series

[net-next,v6,11/13] net: dsa: realtek: rtl8365mb: add RTL8367RB-VB support

Message ID 20220128060509.13800-12-luizluca@gmail.com (mailing list archive)
State Accepted
Commit 84a10aecdcc013b390547d0b84c75eefb84bf828
Delegated to: Netdev Maintainers
Headers show
Series net: dsa: realtek: MDIO interface and RTL8367S,RTL8367RB-VB | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Series has a cover letter
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers success CCed 8 of 8 maintainers
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 20 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Luiz Angelo Daros de Luca Jan. 28, 2022, 6:05 a.m. UTC
RTL8367RB-VB is a 5+2 port 10/100/1000M Ethernet switch.
It is similar to RTL8367S but in this version, both
external interfaces are RGMII.

Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
---
 drivers/net/dsa/realtek/rtl8365mb.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Arınç ÜNAL Jan. 28, 2022, 9:44 a.m. UTC | #1
On 28/01/2022 09:05, Luiz Angelo Daros de Luca wrote:
> RTL8367RB-VB is a 5+2 port 10/100/1000M Ethernet switch.
> It is similar to RTL8367S but in this version, both
> external interfaces are RGMII.
> 
> Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
> ---
>   drivers/net/dsa/realtek/rtl8365mb.c | 8 ++++++++
>   1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/net/dsa/realtek/rtl8365mb.c b/drivers/net/dsa/realtek/rtl8365mb.c
> index 6974decf5ebe..174496e4d736 100644
> --- a/drivers/net/dsa/realtek/rtl8365mb.c
> +++ b/drivers/net/dsa/realtek/rtl8365mb.c
> @@ -108,6 +108,9 @@
>   #define RTL8365MB_CHIP_ID_8367S		0x6367
>   #define RTL8365MB_CHIP_VER_8367S	0x00A0
>   
> +#define RTL8365MB_CHIP_ID_8367RB	0x6367
> +#define RTL8365MB_CHIP_VER_8367RB	0x0020
> +
>   /* Family-specific data and limits */
>   #define RTL8365MB_PHYADDRMAX		7
>   #define RTL8365MB_NUM_PHYREGS		32
> @@ -1979,6 +1982,11 @@ static int rtl8365mb_detect(struct realtek_priv *priv)
>   				 "found an RTL8365MB-VC switch (ver=0x%04x)\n",
>   				 chip_ver);
>   			break;
> +		case RTL8365MB_CHIP_VER_8367RB:
> +			dev_info(priv->dev,
> +				 "found an RTL8367RB-VB switch (ver=0x%04x)\n",
> +				 chip_ver);
> +			break;
>   		case RTL8365MB_CHIP_VER_8367S:
>   			dev_info(priv->dev,
>   				 "found an RTL8367S switch (ver=0x%04x)\n",

You should mention the support for this chip model on kconfig like on 
"net: dsa: realtek: rtl8365mb: add RTL8367S support".

Don't you also need to match the "realtek,rtl8367rb" compatible string 
to rtl8365mb_variant on SMI and MDIO drivers?

Arınç
Luiz Angelo Daros de Luca Jan. 28, 2022, 3:57 p.m. UTC | #2
>
> You should mention the support for this chip model on kconfig like on
> "net: dsa: realtek: rtl8365mb: add RTL8367S support".
>
> Don't you also need to match the "realtek,rtl8367rb" compatible string
> to rtl8365mb_variant on SMI and MDIO drivers?

Yes Arinç. You are right. Thanks. The driver will work "as is" using
any of existing compatible strings but I'll send a patch to fix that
after Documentation is updated.

> Arınç
diff mbox series

Patch

diff --git a/drivers/net/dsa/realtek/rtl8365mb.c b/drivers/net/dsa/realtek/rtl8365mb.c
index 6974decf5ebe..174496e4d736 100644
--- a/drivers/net/dsa/realtek/rtl8365mb.c
+++ b/drivers/net/dsa/realtek/rtl8365mb.c
@@ -108,6 +108,9 @@ 
 #define RTL8365MB_CHIP_ID_8367S		0x6367
 #define RTL8365MB_CHIP_VER_8367S	0x00A0
 
+#define RTL8365MB_CHIP_ID_8367RB	0x6367
+#define RTL8365MB_CHIP_VER_8367RB	0x0020
+
 /* Family-specific data and limits */
 #define RTL8365MB_PHYADDRMAX		7
 #define RTL8365MB_NUM_PHYREGS		32
@@ -1979,6 +1982,11 @@  static int rtl8365mb_detect(struct realtek_priv *priv)
 				 "found an RTL8365MB-VC switch (ver=0x%04x)\n",
 				 chip_ver);
 			break;
+		case RTL8365MB_CHIP_VER_8367RB:
+			dev_info(priv->dev,
+				 "found an RTL8367RB-VB switch (ver=0x%04x)\n",
+				 chip_ver);
+			break;
 		case RTL8365MB_CHIP_VER_8367S:
 			dev_info(priv->dev,
 				 "found an RTL8367S switch (ver=0x%04x)\n",