@@ -26,6 +26,8 @@
#include <fsl_dtsec.h>
#include <asm/fsl_serdes.h>
+extern u8 get_hw_revision(void);
+
int board_eth_init(struct bd_info *bis)
{
#if defined(CONFIG_FMAN_ENET)
@@ -34,6 +36,7 @@ int board_eth_init(struct bd_info *bis)
struct memac_mdio_info tgec_mdio_info;
struct mii_dev *dev;
ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
+ int aq_phy_id_1, aq_phy_id_2;
u32 srds_s1;
srds_s1 = in_be32(&gur->rcwsr[4]) &
@@ -59,13 +62,22 @@ int board_eth_init(struct bd_info *bis)
fm_info_set_phy_address(FM1_DTSEC3, RGMII_PHY1_ADDR);
fm_info_set_phy_address(FM1_DTSEC4, RGMII_PHY2_ADDR);
+ /* The AQR PHY addresses differ between board revisions */
+ if (get_hw_revision() == 'C') {
+ aq_phy_id_1 = FM1_10GEC3_PHY_ADDR;
+ aq_phy_id_2 = FM1_10GEC4_PHY_ADDR;
+ } else {
+ aq_phy_id_1 = AQR113C_PHY_ADDR1;
+ aq_phy_id_2 = AQR113C_PHY_ADDR2;
+ }
+
switch (srds_s1) {
case 0x66:
case 0x6b:
fm_info_set_phy_address(FM1_10GEC1, CORTINA_PHY_ADDR1);
fm_info_set_phy_address(FM1_10GEC2, CORTINA_PHY_ADDR2);
- fm_info_set_phy_address(FM1_10GEC3, FM1_10GEC3_PHY_ADDR);
- fm_info_set_phy_address(FM1_10GEC4, FM1_10GEC4_PHY_ADDR);
+ fm_info_set_phy_address(FM1_10GEC3, aq_phy_id_1);
+ fm_info_set_phy_address(FM1_10GEC4, aq_phy_id_2);
break;
default:
printf("SerDes1 protocol 0x%x is not supported on T208xRDB\n",
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0+ */
/*
* Copyright 2014 Freescale Semiconductor, Inc.
- * Copyright 2020 NXP
+ * Copyright 2020-2021 NXP
*/
/*
@@ -537,8 +537,10 @@ unsigned long get_board_ddr_clk(void);
#define RGMII_PHY2_ADDR 0x02
#define CORTINA_PHY_ADDR1 0x0c /* Cortina CS4315 */
#define CORTINA_PHY_ADDR2 0x0d
-#define FM1_10GEC3_PHY_ADDR 0x00 /* Aquantia AQ1202 10G Base-T */
-#define FM1_10GEC4_PHY_ADDR 0x01
+#define FM1_10GEC3_PHY_ADDR 0x00 /* Aquantia AQ1202 10G Base-T used */
+#define FM1_10GEC4_PHY_ADDR 0x01 /* by board revision C */
+#define AQR113C_PHY_ADDR1 0x00 /* Aquantia AQR113C 10G Base-T used */
+#define AQR113C_PHY_ADDR2 0x08 /* by board revisions D and up. */
#endif
#ifdef CONFIG_FMAN_ENET