ipq9574: Update QCA PHY name

This patch updates the QCA PHY names and its references
accordingly.

Change-Id: I5d301fcecc49793387a50487bf2e713a5a9288e8
Signed-off-by: Selvam Sathappan Periakaruppan <speriaka@codeaurora.org>
This commit is contained in:
Selvam Sathappan Periakaruppan 2021-07-19 15:46:15 +05:30
parent e15ff0bab1
commit 5fa59be07c
5 changed files with 75 additions and 75 deletions

View file

@ -161,8 +161,8 @@
switch_mac_mode = <PORT_WRAPPER_PSGMII>;
switch_mac_mode1 = <PORT_WRAPPER_MAX>; /* Unused */
switch_mac_mode2 = <PORT_WRAPPER_USXGMII>;
malibu_gpio = <60>;
malibu_gpio_cnt = <1>;
qca807x_gpio = <60>;
qca807x_gpio_cnt = <1>;
aquantia_gpio = <36>;
aquantia_gpio_cnt = <1>;
aquantia_port = <5>;
@ -171,23 +171,23 @@
port_phyinfo {
port@0 {
phy_address = <16>;
phy_type = <MALIBU_PHY_TYPE>;
phy_type = <QCA807x_PHY_TYPE>;
};
port@1 {
phy_address = <17>;
phy_type = <MALIBU_PHY_TYPE>;
phy_type = <QCA807x_PHY_TYPE>;
};
port@2 {
phy_address = <18>;
phy_type = <MALIBU_PHY_TYPE>;
phy_type = <QCA807x_PHY_TYPE>;
};
port@3 {
phy_address = <19>;
phy_type = <MALIBU_PHY_TYPE>;
phy_type = <QCA807x_PHY_TYPE>;
};
port@4 {
phy_address = <20>;
phy_type = <MALIBU_PHY_TYPE>;
phy_type = <QCA807x_PHY_TYPE>;
};
port@5 {
phy_address = <0>;

View file

@ -164,25 +164,25 @@
aquantia_gpio_cnt = <1>;
aquantia_port = <4 5>;
aquantia_port_cnt = <2>;
malibu_gpio = <60>;
malibu_gpio_cnt = <1>;
qca807x_gpio = <60>;
qca807x_gpio_cnt = <1>;
mdc_mdio_gpio = <38 39>;
port_phyinfo {
port@0 {
phy_address = <16>;
phy_type = <MALIBU_PHY_TYPE>;
phy_type = <QCA807x_PHY_TYPE>;
};
port@1 {
phy_address = <17>;
phy_type = <MALIBU_PHY_TYPE>;
phy_type = <QCA807x_PHY_TYPE>;
};
port@2 {
phy_address = <18>;
phy_type = <MALIBU_PHY_TYPE>;
phy_type = <QCA807x_PHY_TYPE>;
};
port@3 {
phy_address = <19>;
phy_type = <MALIBU_PHY_TYPE>;
phy_type = <QCA807x_PHY_TYPE>;
};
port@4 {
phy_address = <0>;

View file

@ -161,35 +161,35 @@
switch_mac_mode = <PORT_WRAPPER_PSGMII>;
switch_mac_mode1 = <PORT_WRAPPER_USXGMII>;
switch_mac_mode2 = <PORT_WRAPPER_SGMII_PLUS>;
malibu_gpio = <60>;
malibu_gpio_cnt = <1>;
qca807x_gpio = <60>;
qca807x_gpio_cnt = <1>;
aquantia_gpio = <36>;
aquantia_gpio_cnt = <1>;
aquantia_port = <5>;
aquantia_port_cnt = <1>;
napa_gpio = <57>;
napa_gpio_cnt = <1>;
qca808x_gpio = <57>;
qca808x_gpio_cnt = <1>;
mdc_mdio_gpio = <38 39>;
port_phyinfo {
port@0 {
phy_address = <16>;
phy_type = <MALIBU_PHY_TYPE>;
phy_type = <QCA807x_PHY_TYPE>;
};
port@1 {
phy_address = <17>;
phy_type = <MALIBU_PHY_TYPE>;
phy_type = <QCA807x_PHY_TYPE>;
};
port@2 {
phy_address = <18>;
phy_type = <MALIBU_PHY_TYPE>;
phy_type = <QCA807x_PHY_TYPE>;
};
port@3 {
phy_address = <19>;
phy_type = <MALIBU_PHY_TYPE>;
phy_type = <QCA807x_PHY_TYPE>;
};
port@4 {
phy_address = <20>;
phy_type = <MALIBU_PHY_TYPE>;
phy_type = <QCA807x_PHY_TYPE>;
};
port@5 {
phy_address = <8>;
@ -197,7 +197,7 @@
};
port@6 {
phy_address = <28>;
phy_type = <QCA8081_PHY_TYPE>;
phy_type = <QCA808x_PHY_TYPE>;
};
};
};

View file

@ -574,38 +574,38 @@ int get_aquantia_gpio(int aquantia_gpio[2])
return res;
}
int get_napa_gpio(int napa_gpio[2])
int get_qca808x_gpio(int qca808x_gpio[2])
{
int napa_gpio_cnt = -1, node;
int qca808x_gpio_cnt = -1, node;
int res = -1;
node = fdt_path_offset(gd->fdt_blob, "/ess-switch");
if (node >= 0) {
napa_gpio_cnt = fdtdec_get_uint(gd->fdt_blob, node, "napa_gpio_cnt", -1);
if (napa_gpio_cnt >= 1) {
res = fdtdec_get_int_array(gd->fdt_blob, node, "napa_gpio",
(u32 *)napa_gpio, napa_gpio_cnt);
qca808x_gpio_cnt = fdtdec_get_uint(gd->fdt_blob, node, "qca808x_gpio_cnt", -1);
if (qca808x_gpio_cnt >= 1) {
res = fdtdec_get_int_array(gd->fdt_blob, node, "qca808x_gpio",
(u32 *)qca808x_gpio, qca808x_gpio_cnt);
if (res >= 0)
return napa_gpio_cnt;
return qca808x_gpio_cnt;
}
}
return res;
}
int get_malibu_gpio(int malibu_gpio[2])
int get_qca807x_gpio(int qca807x_gpio[2])
{
int malibu_gpio_cnt = -1, node;
int qca807x_gpio_cnt = -1, node;
int res = -1;
node = fdt_path_offset(gd->fdt_blob, "/ess-switch");
if (node >= 0) {
malibu_gpio_cnt = fdtdec_get_uint(gd->fdt_blob, node, "malibu_gpio_cnt", -1);
if (malibu_gpio_cnt >= 1) {
res = fdtdec_get_int_array(gd->fdt_blob, node, "malibu_gpio",
(u32 *)malibu_gpio, malibu_gpio_cnt);
qca807x_gpio_cnt = fdtdec_get_uint(gd->fdt_blob, node, "qca807x_gpio_cnt", -1);
if (qca807x_gpio_cnt >= 1) {
res = fdtdec_get_int_array(gd->fdt_blob, node, "qca807x_gpio",
(u32 *)qca807x_gpio, qca807x_gpio_cnt);
if (res >= 0)
return malibu_gpio_cnt;
return qca807x_gpio_cnt;
}
}
@ -629,35 +629,35 @@ void aquantia_phy_reset_init(void)
}
}
void napa_phy_reset_init(void)
void qca808x_phy_reset_init(void)
{
int napa_gpio[2] = {0}, napa_gpio_cnt, i;
unsigned int *napa_gpio_base;
int qca808x_gpio[2] = {0}, qca808x_gpio_cnt, i;
unsigned int *qca808x_gpio_base;
napa_gpio_cnt = get_napa_gpio(napa_gpio);
if (napa_gpio_cnt >= 1) {
for (i = 0; i < napa_gpio_cnt; i++) {
if (napa_gpio[i] >= 0) {
napa_gpio_base = (unsigned int *)GPIO_CONFIG_ADDR(napa_gpio[i]);
writel(0x203, napa_gpio_base);
gpio_direction_output(napa_gpio[i], 0x0);
qca808x_gpio_cnt = get_qca808x_gpio(qca808x_gpio);
if (qca808x_gpio_cnt >= 1) {
for (i = 0; i < qca808x_gpio_cnt; i++) {
if (qca808x_gpio[i] >= 0) {
qca808x_gpio_base = (unsigned int *)GPIO_CONFIG_ADDR(qca808x_gpio[i]);
writel(0x203, qca808x_gpio_base);
gpio_direction_output(qca808x_gpio[i], 0x0);
}
}
}
}
void malibu_phy_reset_init(void)
void qca807x_phy_reset_init(void)
{
int malibu_gpio[2] = {0}, malibu_gpio_cnt, i;
unsigned int *malibu_gpio_base;
int qca807x_gpio[2] = {0}, qca807x_gpio_cnt, i;
unsigned int *qca807x_gpio_base;
malibu_gpio_cnt = get_malibu_gpio(malibu_gpio);
if (malibu_gpio_cnt >= 1) {
for (i = 0; i < malibu_gpio_cnt; i++) {
if (malibu_gpio[i] >=0) {
malibu_gpio_base = (unsigned int *)GPIO_CONFIG_ADDR(malibu_gpio[i]);
writel(0x203, malibu_gpio_base);
gpio_direction_output(malibu_gpio[i], 0x0);
qca807x_gpio_cnt = get_qca807x_gpio(qca807x_gpio);
if (qca807x_gpio_cnt >= 1) {
for (i = 0; i < qca807x_gpio_cnt; i++) {
if (qca807x_gpio[i] >=0) {
qca807x_gpio_base = (unsigned int *)GPIO_CONFIG_ADDR(qca807x_gpio[i]);
writel(0x203, qca807x_gpio_base);
gpio_direction_output(qca807x_gpio[i], 0x0);
}
}
}
@ -674,25 +674,25 @@ void aquantia_phy_reset_init_done(void)
}
}
void napa_phy_reset_init_done(void)
void qca808x_phy_reset_init_done(void)
{
int napa_gpio[2] = {0}, napa_gpio_cnt, i;
int qca808x_gpio[2] = {0}, qca808x_gpio_cnt, i;
napa_gpio_cnt = get_napa_gpio(napa_gpio);
if (napa_gpio_cnt >= 1) {
for (i = 0; i < napa_gpio_cnt; i++)
gpio_set_value(napa_gpio[i], 0x1);
qca808x_gpio_cnt = get_qca808x_gpio(qca808x_gpio);
if (qca808x_gpio_cnt >= 1) {
for (i = 0; i < qca808x_gpio_cnt; i++)
gpio_set_value(qca808x_gpio[i], 0x1);
}
}
void malibu_phy_reset_init_done(void)
void qca807x_phy_reset_init_done(void)
{
int malibu_gpio[2] = {0}, malibu_gpio_cnt, i;
int qca807x_gpio[2] = {0}, qca807x_gpio_cnt, i;
malibu_gpio_cnt = get_malibu_gpio(malibu_gpio);
if (malibu_gpio_cnt >= 1) {
for (i = 0; i < malibu_gpio_cnt; i++)
gpio_set_value(malibu_gpio[i], 0x1);
qca807x_gpio_cnt = get_qca807x_gpio(qca807x_gpio);
if (qca807x_gpio_cnt >= 1) {
for (i = 0; i < qca807x_gpio_cnt; i++)
gpio_set_value(qca807x_gpio[i], 0x1);
}
}
@ -901,13 +901,13 @@ void eth_clock_enable(void)
set_function_select_as_mdc_mdio();
/* Bring PHY out of RESET */
malibu_phy_reset_init();
qca807x_phy_reset_init();
aquantia_phy_reset_init();
napa_phy_reset_init();
qca808x_phy_reset_init();
mdelay(500);
malibu_phy_reset_init_done();
qca807x_phy_reset_init_done();
aquantia_phy_reset_init_done();
napa_phy_reset_init_done();
qca808x_phy_reset_init_done();
mdelay(500);
}
#endif

View file

@ -39,8 +39,8 @@
#define PORT_WRAPPER_MAX 0xFF
/* ETH PHY Types */
#define MALIBU_PHY_TYPE 0x1
#define QCA8081_PHY_TYPE 0x2
#define QCA807x_PHY_TYPE 0x1
#define QCA808x_PHY_TYPE 0x2
#define AQ_PHY_TYPE 0x3
#define QCA8033_PHY_TYPE 0x4
#define SFP_PHY_TYPE 0x5