Skip to content

Commit 886382b

Browse files
ddejeanhauke
authored andcommitted
realtek: add 2500base-x patch sequence.
Adds the SerDes patch sequence for 2500base-x to improve the support of devices with minimal bootloaders (like BootBase). The sequences were imported from [1] for even lanes and [2] for odd lanes. [1] https://github.com/ddejean/dms-1250-oss-release/blob/main/sdk/sdk_rtk_switch/rtk-sdk/src/dal/longan/dal_longan_construct.c#L641 [2] https://github.com/ddejean/dms-1250-oss-release/blob/main/sdk/sdk_rtk_switch/rtk-sdk/src/dal/longan/dal_longan_construct.c#L664 Signed-off-by: Damien Dejean <dam.dejean@gmail.com> Link: openwrt/openwrt#19834 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
1 parent 6bb1b7c commit 886382b

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

target/linux/realtek/files-6.12/drivers/net/phy/rtl83xx-phy.c

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2788,6 +2788,52 @@ static const sds_config rtsds_930x_cfg_10gr_odd[] =
27882788
{0x2B, 0x14, 0x3108}, {0x2D, 0x13, 0x3C87}, {0x2D, 0x14, 0x1808},
27892789
};
27902790

2791+
static const sds_config rtsds_930x_cfg_10g_2500bx_even[] =
2792+
{
2793+
{0x00, 0x0E, 0x3053}, {0x01, 0x14, 0x0100},
2794+
{0x21, 0x03, 0x8206}, {0x21, 0x05, 0x40B0}, {0x21, 0x06, 0x0010}, {0x21, 0x07, 0xF09F},
2795+
{0x21, 0x0C, 0x0007}, {0x21, 0x0D, 0x6009}, {0x21, 0x0E, 0x0000}, {0x21, 0x0F, 0x0008},
2796+
{0x24, 0x00, 0x0668}, {0x24, 0x02, 0xD020}, {0x24, 0x06, 0xC000}, {0x24, 0x0B, 0x1892},
2797+
{0x24, 0x0F, 0xFFDF}, {0x24, 0x12, 0x03C4}, {0x24, 0x13, 0x027F}, {0x24, 0x14, 0x1311},
2798+
{0x24, 0x16, 0x00C9}, {0x24, 0x17, 0xA100}, {0x24, 0x1A, 0x0001}, {0x24, 0x1C, 0x0400},
2799+
{0x25, 0x01, 0x0300}, {0x25, 0x02, 0x1017}, {0x25, 0x03, 0xFFDF}, {0x25, 0x05, 0x7F7C},
2800+
{0x25, 0x07, 0x8100}, {0x25, 0x08, 0x0001}, {0x25, 0x09, 0xFFD4}, {0x25, 0x0A, 0x7C2F},
2801+
{0x25, 0x0E, 0x003F}, {0x25, 0x0F, 0x0121}, {0x25, 0x10, 0x0020}, {0x25, 0x11, 0x8840},
2802+
{0x28, 0x00, 0x0668}, {0x28, 0x02, 0xD020}, {0x28, 0x06, 0xC000}, {0x28, 0x0B, 0x1892},
2803+
{0x28, 0x0F, 0xFFDF}, {0x28, 0x12, 0x01C4}, {0x28, 0x13, 0x027F}, {0x28, 0x14, 0x1311},
2804+
{0x28, 0x16, 0x00C9}, {0x28, 0x17, 0xA100}, {0x28, 0x1A, 0x0001}, {0x28, 0x1C, 0x0400},
2805+
{0x29, 0x01, 0x0300}, {0x29, 0x02, 0x1017}, {0x29, 0x03, 0xFFDF}, {0x29, 0x05, 0x7F7C},
2806+
{0x29, 0x07, 0x8100}, {0x29, 0x08, 0x0001}, {0x29, 0x09, 0xFFD4}, {0x29, 0x0A, 0x7C2F},
2807+
{0x29, 0x0E, 0x003F}, {0x29, 0x0F, 0x0121}, {0x29, 0x10, 0x0020}, {0x29, 0x11, 0x8840},
2808+
{0x2B, 0x13, 0x0050}, {0x2B, 0x18, 0x8E88}, {0x2B, 0x19, 0x4902}, {0x2B, 0x1D, 0x2501},
2809+
{0x2D, 0x13, 0x0050}, {0x2D, 0x18, 0x8E88}, {0x2D, 0x17, 0x4109}, {0x2D, 0x19, 0x4902},
2810+
{0x2D, 0x1C, 0x1109}, {0x2D, 0x1D, 0x2641},
2811+
{0x2F, 0x13, 0x0050}, {0x2F, 0x18, 0x8E88}, {0x2F, 0x19, 0x4902}, {0x2F, 0x1D, 0x66E1},
2812+
};
2813+
2814+
static const sds_config rtsds_930x_cfg_10g_2500bx_odd[] =
2815+
{
2816+
{0x00, 0x0E, 0x3053}, {0x01, 0x14, 0x0100},
2817+
{0x21, 0x03, 0x8206}, {0x21, 0x06, 0x0010}, {0x21, 0x07, 0xF09F}, {0x21, 0x0A, 0x0003},
2818+
{0x21, 0x0B, 0x0005}, {0x21, 0x0C, 0x0007}, {0x21, 0x0D, 0x6009}, {0x21, 0x0E, 0x0000},
2819+
{0x21, 0x0F, 0x0008},
2820+
{0x24, 0x00, 0x0668}, {0x24, 0x02, 0xD020}, {0x24, 0x06, 0xC000}, {0x24, 0x0B, 0x1892},
2821+
{0x24, 0x0F, 0xFFDF}, {0x24, 0x12, 0x03C4}, {0x24, 0x13, 0x027F}, {0x24, 0x14, 0x1311},
2822+
{0x24, 0x16, 0x00C9}, {0x24, 0x17, 0xA100}, {0x24, 0x1A, 0x0001}, {0x24, 0x1C, 0x0400},
2823+
{0x25, 0x00, 0x820F}, {0x25, 0x01, 0x0300}, {0x25, 0x02, 0x1017}, {0x25, 0x03, 0xFFDF},
2824+
{0x25, 0x05, 0x7F7C}, {0x25, 0x07, 0x8100}, {0x25, 0x08, 0x0001}, {0x25, 0x09, 0xFFD4},
2825+
{0x25, 0x0A, 0x7C2F}, {0x25, 0x0E, 0x003F}, {0x25, 0x0F, 0x0121}, {0x25, 0x10, 0x0020},
2826+
{0x25, 0x11, 0x8840},
2827+
{0x28, 0x00, 0x0668}, {0x28, 0x02, 0xD020}, {0x28, 0x06, 0xC000}, {0x28, 0x0B, 0x1892},
2828+
{0x28, 0x0F, 0xFFDF}, {0x28, 0x12, 0x01C4}, {0x28, 0x13, 0x027F}, {0x28, 0x14, 0x1311},
2829+
{0x28, 0x16, 0x00C9}, {0x28, 0x17, 0xA100}, {0x28, 0x1A, 0x0001}, {0x28, 0x1C, 0x0400},
2830+
{0x29, 0x00, 0x820F}, {0x29, 0x01, 0x0300}, {0x29, 0x02, 0x1017}, {0x29, 0x03, 0xFFDF},
2831+
{0x29, 0x05, 0x7F7C}, {0x29, 0x07, 0x8100}, {0x29, 0x08, 0x0001}, {0x29, 0x0A, 0x7C2F},
2832+
{0x29, 0x0E, 0x003F}, {0x29, 0x0F, 0x0121}, {0x29, 0x10, 0x0020}, {0x29, 0x11, 0x8840},
2833+
{0x2B, 0x13, 0x3D87}, {0x2B, 0x14, 0x3108},
2834+
{0x2D, 0x13, 0x3C87}, {0x2D, 0x14, 0x1808},
2835+
};
2836+
27912837
static void rtsds_930x_patch_serdes(int sds, phy_interface_t mode)
27922838
{
27932839
const bool even_sds = ((sds & 1) == 0);
@@ -2807,6 +2853,16 @@ static void rtsds_930x_patch_serdes(int sds, phy_interface_t mode)
28072853
}
28082854
break;
28092855

2856+
case PHY_INTERFACE_MODE_2500BASEX:
2857+
if (even_sds) {
2858+
config = rtsds_930x_cfg_10g_2500bx_even;
2859+
count = ARRAY_SIZE(rtsds_930x_cfg_10g_2500bx_even);
2860+
} else {
2861+
config = rtsds_930x_cfg_10g_2500bx_odd;
2862+
count = ARRAY_SIZE(rtsds_930x_cfg_10g_2500bx_odd);
2863+
}
2864+
break;
2865+
28102866
default:
28112867
pr_warn("%s: unsupported mode %s on serdes %d\n", __func__, phy_modes(mode), sds);
28122868
return;

0 commit comments

Comments
 (0)