Merge tag 'ti-v2020.07-rc3' of https://gitlab.denx.de/u-boot/custodians/u-boot-ti
[oweals/u-boot.git] / board / freescale / t4rdb / eth.c
index d220475b5a8a5d2146b18fa016ee7ea809394e18..4c896c8a90d001fdc91e0f331af5b24556cc2d42 100644 (file)
@@ -1,13 +1,14 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright 2014 Freescale Semiconductor, Inc.
  *
  * Chunhe Lan <Chunhe.Lan@freescale.com>
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
 #include <command.h>
+#include <fdt_support.h>
+#include <net.h>
 #include <netdev.h>
 #include <asm/mmu.h>
 #include <asm/processor.h>
@@ -23,7 +24,7 @@
 #include <fsl_mdio.h>
 #include <miiphy.h>
 #include <phy.h>
-#include <asm/fsl_dtsec.h>
+#include <fsl_dtsec.h>
 #include <asm/fsl_serdes.h>
 #include <hwconfig.h>
 
@@ -67,7 +68,7 @@ int board_eth_init(bd_t *bis)
        /* Register the 10G MDIO bus */
        fm_memac_mdio_init(bis, &tgec_mdio_info);
 
-       if (srds_prtcl_s1 == 28) {
+       if ((srds_prtcl_s1 == 28) || (srds_prtcl_s1 == 27)) {
                /* SGMII */
                fm_info_set_phy_address(FM1_DTSEC1, SGMII_PHY_ADDR1);
                fm_info_set_phy_address(FM1_DTSEC2, SGMII_PHY_ADDR2);
@@ -77,6 +78,9 @@ int board_eth_init(bd_t *bis)
                puts("Invalid SerDes1 protocol for T4240RDB\n");
        }
 
+       fm_disable_port(FM1_DTSEC5);
+       fm_disable_port(FM1_DTSEC6);
+
        for (i = FM1_DTSEC1; i < FM1_DTSEC1 + CONFIG_SYS_NUM_FM1_DTSEC; i++) {
                interface = fm_info_get_enet_if(i);
                switch (interface) {
@@ -101,7 +105,7 @@ int board_eth_init(bd_t *bis)
        }
 
 #if (CONFIG_SYS_NUM_FMAN == 2)
-       if (srds_prtcl_s2 == 56) {
+       if ((srds_prtcl_s2 == 56) || (srds_prtcl_s2 == 55)) {
                /* SGMII && XFI */
                fm_info_set_phy_address(FM2_DTSEC1, SGMII_PHY_ADDR5);
                fm_info_set_phy_address(FM2_DTSEC2, SGMII_PHY_ADDR6);
@@ -115,6 +119,8 @@ int board_eth_init(bd_t *bis)
                puts("Invalid SerDes2 protocol for T4240RDB\n");
        }
 
+       fm_disable_port(FM2_DTSEC5);
+       fm_disable_port(FM2_DTSEC6);
        for (i = FM2_DTSEC1; i < FM2_DTSEC1 + CONFIG_SYS_NUM_FM2_DTSEC; i++) {
                interface = fm_info_get_enet_if(i);
                switch (interface) {