ipq807x: Enabled napa and aquantia phy in DB-hk02

Change-Id: Iadaffde34e3af45905535423cb20ea71d0081644
Signed-off-by: Sham Muthayyan <smuthayy@codeaurora.org>
This commit is contained in:
Sham Muthayyan 2018-09-03 20:57:06 +05:30 committed by Gerrit - the friendly Code Review server
parent 7fb1dc8e4c
commit cc660eb4c7
5 changed files with 68 additions and 20 deletions

View file

@ -29,8 +29,38 @@
ess-switch {
switch_mac_mode = <0x0>;
switch_mac_mode1 = <0x2>;
switch_mac_mode2 = <0x1>;
8033_port = <5>;
switch_mac_mode2 = <0x6>;
napa_gpio = <26>;
napa_gpio_cnt = <1>;
aquantia_port = <4>;
aquantia_gpio = <44>;
port_phyinfo {
port@0 {
phy_address = <0>;
phy_type = <1>;
};
port@1 {
phy_address = <1>;
phy_type = <1>;
};
port@2 {
phy_address = <2>;
phy_type = <1>;
};
port@3 {
phy_address = <3>;
phy_type = <1>;
};
port@4 {
phy_address = <15>;
phy_type = <3>;
};
port@5 {
phy_address = <28>;
phy_type = <2>;
};
};
};
};

View file

@ -204,7 +204,7 @@ int ipq_qca_aquantia_phy_init(struct phy_ops **ops, u32 phy_id)
static int do_load_fw(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
unsigned int phy_addr=0x7;
unsigned int phy_addr = AQU_PHY_ADDR;
int node, aquantia_port;
if (argc > 2)
@ -213,11 +213,6 @@ static int do_load_fw(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
if (argc == 2)
phy_addr = simple_strtoul(argv[1], NULL, 16);
if (phy_addr != AQU_PHY_ADDR) {
printf("Phy address is not correct: use 0x7\n");
return 0;
}
node = fdt_path_offset(gd->fdt_blob, "/ess-switch");
if (node < 0) {
printf("Error: ess-switch not specified in dts");

View file

@ -961,9 +961,12 @@ static int ipq807x_eth_init(struct eth_device *eth_dev, bd_t *this)
break;
case FAL_SPEED_100:
mac_speed = 0x1;
if (i == aquantia_port)
speed_clock1 = 0x109;
else if (i == port_8033)
if (i == aquantia_port) {
if (i == 4)
speed_clock1 = 0x309;
else
speed_clock1 = 0x109;
} else if (i == port_8033)
speed_clock1 = 0x309;
else
speed_clock1 = 0x101;
@ -981,9 +984,12 @@ static int ipq807x_eth_init(struct eth_device *eth_dev, bd_t *this)
break;
case FAL_SPEED_1000:
mac_speed = 0x2;
if (i == aquantia_port)
speed_clock1 = 0x104;
else if (i == port_8033)
if (i == aquantia_port) {
if (i == 4)
speed_clock1 = 0x304;
else
speed_clock1 = 0x104;
} else if (i == port_8033)
speed_clock1 = 0x301;
else
speed_clock1 = 0x101;
@ -1015,20 +1021,36 @@ static int ipq807x_eth_init(struct eth_device *eth_dev, bd_t *this)
else if (i == 5)
speed_clock1 = 0x101;
set_sgmii_mode(i, 0);
speed_clock2 = 0x0;
}
if (phy_info[i]->phy_type == AQ_PHY_TYPE) {
mac_speed = 0x4;
if (i == 4) {
speed_clock1 = 0x301;
speed_clock2 = 0x3;
} else if (i == 5) {
speed_clock1 = 0x107;
speed_clock2 = 0x0;
}
}
} else {
speed_clock1 = 0x107;
mac_speed = 0x4;
speed_clock2 = 0x0;
}
speed_clock2 = 0x0;
printf ("eth%d PHY%d %s Speed :%d %s duplex\n",
priv->mac_unit, i, lstatus[status], speed,
dp[duplex]);
break;
case FAL_SPEED_5000:
mac_speed = 0x5;
speed_clock1 = 0x103;
speed_clock2 = 0x0;
if (i == 4) {
speed_clock1 = 0x301;
speed_clock2 = 0x1;
} else {
speed_clock1 = 0x103;
speed_clock2 = 0x0;
}
printf ("eth%d PHY%d %s Speed :%d %s duplex\n",
priv->mac_unit, i, lstatus[status], speed,
dp[duplex]);
@ -1814,8 +1836,8 @@ int ipq807x_edma_init(void *edma_board_cfg)
phy_chip_id2 = ipq_mdio_read(phy_addr, QCA_PHY_ID2, NULL);
phy_chip_id = (phy_chip_id1 << 16) | phy_chip_id2;
if (phy_id == aquantia_port) {
phy_chip_id1 = ipq_mdio_read(0x7, (1<<30) |(1<<16) | QCA_PHY_ID1, NULL);
phy_chip_id2 = ipq_mdio_read(0x7, (1<<30) |(1<<16) | QCA_PHY_ID2, NULL);
phy_chip_id1 = ipq_mdio_read(phy_addr, (1<<30) |(1<<16) | QCA_PHY_ID1, NULL);
phy_chip_id2 = ipq_mdio_read(phy_addr, (1<<30) |(1<<16) | QCA_PHY_ID2, NULL);
phy_chip_id = (phy_chip_id1 << 16) | phy_chip_id2;
}
switch(phy_chip_id) {

View file

@ -297,7 +297,7 @@ void ipq807x_uxsgmii_speed_set(int port, int speed, int duplex,
/* Setting the speed only for PORT5 and PORT6 */
if (port == (PORT5 - PPE_UNIPHY_INSTANCE1))
uniphy_index = PPE_UNIPHY_INSTANCE1;
if (port == (PORT6 - PPE_UNIPHY_INSTANCE1))
else if (port == (PORT6 - PPE_UNIPHY_INSTANCE1))
uniphy_index = PPE_UNIPHY_INSTANCE2;
else
return;

View file

@ -97,6 +97,7 @@ enum port_wrapper_cfg {
enum phy_mode {
MALIBU_PHY_TYPE = 1,
QCA8081_PHY_TYPE = 2,
AQ_PHY_TYPE = 3,
};
typedef struct {