realtek: pcs: rtl930x: carve out common writes
Start deconstructing the patch/config sequences by carving out two specific writes which are common for non-USXGMII and are special because they are not in analog SerDes pages. Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com> Link: https://github.com/openwrt/openwrt/pull/22582 Signed-off-by: Robert Marko <robimarko@gmail.com>
This commit is contained in:
parent
f0665cb06b
commit
0fd1a3840a
@ -2713,7 +2713,7 @@ static int rtpcs_930x_sds_set_polarity(struct rtpcs_serdes *sds,
|
||||
|
||||
static const struct rtpcs_sds_config rtpcs_930x_sds_cfg_10gr_even[] = {
|
||||
/* 1G */
|
||||
{0x00, 0x0E, 0x3053}, {0x01, 0x14, 0x0100}, {0x21, 0x03, 0x8206},
|
||||
{0x21, 0x03, 0x8206},
|
||||
{0x21, 0x05, 0x40B0}, {0x21, 0x06, 0x0010}, {0x21, 0x07, 0xF09F},
|
||||
{0x21, 0x0C, 0x0007}, {0x21, 0x0D, 0x6009}, {0x21, 0x0E, 0x0000},
|
||||
{0x21, 0x0F, 0x0008}, {0x24, 0x00, 0x0668}, {0x24, 0x02, 0xD020},
|
||||
@ -2760,7 +2760,7 @@ static const struct rtpcs_sds_config rtpcs_930x_sds_cfg_10gr_even[] = {
|
||||
|
||||
static const struct rtpcs_sds_config rtpcs_930x_sds_cfg_10gr_odd[] = {
|
||||
/* 1G */
|
||||
{0x00, 0x0E, 0x3053}, {0x01, 0x14, 0x0100}, {0x21, 0x03, 0x8206},
|
||||
{0x21, 0x03, 0x8206},
|
||||
{0x21, 0x06, 0x0010}, {0x21, 0x07, 0xF09F}, {0x21, 0x0A, 0x0003},
|
||||
{0x21, 0x0B, 0x0005}, {0x21, 0x0C, 0x0007}, {0x21, 0x0D, 0x6009},
|
||||
{0x21, 0x0E, 0x0000}, {0x21, 0x0F, 0x0008}, {0x24, 0x00, 0x0668},
|
||||
@ -2801,7 +2801,6 @@ static const struct rtpcs_sds_config rtpcs_930x_sds_cfg_10gr_odd[] = {
|
||||
};
|
||||
|
||||
static const struct rtpcs_sds_config rtpcs_930x_sds_cfg_10g_2500bx_even[] = {
|
||||
{0x00, 0x0E, 0x3053}, {0x01, 0x14, 0x0100},
|
||||
{0x21, 0x03, 0x8206}, {0x21, 0x05, 0x40B0}, {0x21, 0x06, 0x0010}, {0x21, 0x07, 0xF09F},
|
||||
{0x21, 0x0C, 0x0007}, {0x21, 0x0D, 0x6009}, {0x21, 0x0E, 0x0000}, {0x21, 0x0F, 0x0008},
|
||||
{0x24, 0x00, 0x0668}, {0x24, 0x02, 0xD020}, {0x24, 0x06, 0xC000}, {0x24, 0x0B, 0x1892},
|
||||
@ -2823,7 +2822,6 @@ static const struct rtpcs_sds_config rtpcs_930x_sds_cfg_10g_2500bx_even[] = {
|
||||
};
|
||||
|
||||
static const struct rtpcs_sds_config rtpcs_930x_sds_cfg_10g_2500bx_odd[] = {
|
||||
{0x00, 0x0E, 0x3053}, {0x01, 0x14, 0x0100},
|
||||
{0x21, 0x03, 0x8206}, {0x21, 0x06, 0x0010}, {0x21, 0x07, 0xF09F}, {0x21, 0x0A, 0x0003},
|
||||
{0x21, 0x0B, 0x0005}, {0x21, 0x0C, 0x0007}, {0x21, 0x0D, 0x6009}, {0x21, 0x0E, 0x0000},
|
||||
{0x21, 0x0F, 0x0008},
|
||||
@ -2846,7 +2844,6 @@ static const struct rtpcs_sds_config rtpcs_930x_sds_cfg_10g_2500bx_odd[] = {
|
||||
|
||||
static const struct rtpcs_sds_config rtpcs_930x_sds_cfg_xsgmii_even[] =
|
||||
{
|
||||
{0x00, 0x0E, 0x3053},
|
||||
{0x21, 0x03, 0x8206}, {0x21, 0x05, 0x40B0}, {0x21, 0x06, 0x0010}, {0x21, 0x07, 0xF09F},
|
||||
{0x21, 0x0C, 0x0007}, {0x21, 0x0D, 0x6009}, {0x21, 0x0E, 0x0000}, {0x21, 0x0F, 0x0008},
|
||||
{0x2E, 0x00, 0xA668}, {0x2E, 0x02, 0xD020}, {0x2E, 0x06, 0xC000}, {0x2E, 0x0B, 0x1892},
|
||||
@ -2862,7 +2859,6 @@ static const struct rtpcs_sds_config rtpcs_930x_sds_cfg_xsgmii_even[] =
|
||||
|
||||
static const struct rtpcs_sds_config rtpcs_930x_sds_cfg_xsgmii_odd[] =
|
||||
{
|
||||
{0x00, 0x0E, 0x3053},
|
||||
{0x21, 0x03, 0x8206}, {0x21, 0x05, 0x40B0}, {0x21, 0x06, 0x0010}, {0x21, 0x07, 0xF09F},
|
||||
{0x21, 0x0A, 0x0003}, {0x21, 0x0B, 0x0005}, {0x21, 0x0C, 0x0007}, {0x21, 0x0D, 0x6009},
|
||||
{0x21, 0x0E, 0x0000}, {0x21, 0x0F, 0x0008},
|
||||
@ -2919,7 +2915,6 @@ static const struct rtpcs_sds_config rtpcs_930x_sds_cfg_usxgmii_sx_odd[] =
|
||||
|
||||
static const struct rtpcs_sds_config rtpcs_930x_sds_cfg_5g_qsgmii[] =
|
||||
{
|
||||
{0x00, 0x0E, 0x3053},
|
||||
{0x21, 0x00, 0x3C91},{0x21, 0x02, 0xB602},{0x21, 0x07, 0xFA66},{0x21, 0x0A, 0xDF40},
|
||||
{0x2A, 0x02, 0x35A1},{0x2A, 0x03, 0x6960},
|
||||
};
|
||||
@ -2970,6 +2965,16 @@ static int rtpcs_930x_sds_config_hw_mode(struct rtpcs_serdes *sds, enum rtpcs_sd
|
||||
ARRAY_SIZE(rtpcs_930x_sds_cfg_5g_qsgmii));
|
||||
}
|
||||
|
||||
if (hw_mode != RTPCS_SDS_MODE_USXGMII_10GSXGMII &&
|
||||
hw_mode != RTPCS_SDS_MODE_USXGMII_10GQXGMII) {
|
||||
if (is_xsgmii)
|
||||
rtpcs_sds_xsg_write(sds, 0x00, 0x0E, 0x3053);
|
||||
else {
|
||||
rtpcs_sds_write(sds, 0x00, 0x0E, 0x3053);
|
||||
rtpcs_sds_write(sds, 0x01, 0x14, 0x0100);
|
||||
}
|
||||
}
|
||||
|
||||
switch (hw_mode) {
|
||||
case RTPCS_SDS_MODE_1000BASEX:
|
||||
case RTPCS_SDS_MODE_SGMII:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user