Networking support for all TI K2 boards converted to use DM model and
CONFIG_DM_ETH enabled in all corresponding defconfig files, hence drop
unused non DM K2 networking code.
Signed-off-by: Grygorii Strashko
---
arch/arm/include/asm/ti-common/keystone_net.h | 14 --
board/ti/ks2_evm/board.c | 53 -
board/ti/ks2_evm/board.h | 3 -
board/ti/ks2_evm/board_k2e.c | 74 ---
board/ti/ks2_evm/board_k2g.c | 18 --
board/ti/ks2_evm/board_k2hk.c | 42
board/ti/ks2_evm/board_k2l.c | 42
drivers/net/ti/keystone_net.c | 287 +-
8 files changed, 1 insertion(+), 532 deletions(-)
diff --git a/arch/arm/include/asm/ti-common/keystone_net.h
b/arch/arm/include/asm/ti-common/keystone_net.h
index f89e043..bef1867 100644
--- a/arch/arm/include/asm/ti-common/keystone_net.h
+++ b/arch/arm/include/asm/ti-common/keystone_net.h
@@ -242,18 +242,4 @@ struct mdio_regs {
u32 userphysel1;
};
-struct eth_priv_t {
- char int_name[32];
- int rx_flow;
- int phy_addr;
- int slave_port;
- int sgmii_link_type;
- phy_interface_t phy_if;
- struct phy_device *phy_dev;
-};
-
-int keystone2_emac_initialize(struct eth_priv_t *eth_priv);
-void sgmii_serdes_setup_156p25mhz(void);
-void sgmii_serdes_shutdown(void);
-
#endif /* _KEYSTONE_NET_H_ */
diff --git a/board/ti/ks2_evm/board.c b/board/ti/ks2_evm/board.c
index d81c8e6..72709c0 100644
--- a/board/ti/ks2_evm/board.c
+++ b/board/ti/ks2_evm/board.c
@@ -66,59 +66,6 @@ int board_init(void)
return 0;
}
-#ifdef CONFIG_DRIVER_TI_KEYSTONE_NET
-#ifndef CONFIG_DM_ETH
-int get_eth_env_param(char *env_name)
-{
- char *env;
- int res = -1;
-
- env = env_get(env_name);
- if (env)
- res = simple_strtol(env, NULL, 0);
-
- return res;
-}
-
-int board_eth_init(bd_t *bis)
-{
- int j;
- int res;
- int port_num;
- char link_type_name[32];
-
- if (cpu_is_k2g())
- writel(KS2_ETHERNET_RGMII, KS2_ETHERNET_CFG);
-
- /* By default, select PA PLL clock as PA clock source */
-#ifndef CONFIG_SOC_K2G
- if (psc_enable_module(KS2_LPSC_PA))
- return -1;
-#endif
- if (psc_enable_module(KS2_LPSC_CPGMAC))
- return -1;
- if (psc_enable_module(KS2_LPSC_CRYPTO))
- return -1;
-
- if (cpu_is_k2e() || cpu_is_k2l())
- pll_pa_clk_sel();
-
- port_num = get_num_eth_ports();
-
- for (j = 0; j < port_num; j++) {
- sprintf(link_type_name, "sgmii%d_link_type", j);
- res = get_eth_env_param(link_type_name);
- if (res >= 0)
- eth_priv_cfg[j].sgmii_link_type = res;
-
- keystone2_emac_initialize(_priv_cfg[j]);
- }
-
- return 0;
-}
-#endif
-#endif
-
#ifdef CONFIG_SPL_BUILD
void spl_board_init(void)
{
diff --git a/board/ti/ks2_evm/board.h b/board/ti/ks2_evm/board.h
index 250b649..d0cfbf5 100644
--- a/board/ti/ks2_evm/board.h
+++ b/board/ti/ks2_evm/board.h
@@ -12,8 +12,6 @@
#include
#include "../common/board_detect.h"
-extern struct eth_priv_t eth_priv_cfg[];
-
#if defined(CONFIG_TI_I2C_BOARD_DETECT)
static inline int board_is_k2g_gp(void)
{
@@ -38,7 +36,6 @@ static inline int board_is_k2g_ice(void)
}
#endif
-int get_num_eth_ports(void);
void spl_init_keystone_plls(void);
#endif
diff --git a/board/ti/ks2_evm/board_k2e.c b/board/ti/ks2_evm/board_k2e.c
index f86a836..ecd4a42 100644
--- a/board/ti/ks2_evm/board_k2e.c
+++ b/board/ti/ks2_evm/board_k2e.c
@@ -89,80 +89,6 @@ struct pll_init_data *get_pll_init_data(int pll)
return data;
}
-#ifdef CONFIG_DRIVER_TI_KEYSTONE_NET
-struct eth_priv_t eth_priv_cfg[] = {
- {
- .int_name= "K2E_EMAC0",
- .rx_flow = 0,
- .phy_addr= 0,
- .slave_port = 1,
- .sgmii_link_type = SGMII_LINK_MAC_PHY,
- .phy_if = PHY_INTERFACE_MODE_SGMII,
- },
- {
- .int_name= "K2E_EMAC1",
- .rx_flow = 8,
- .phy_addr= 1,
- .slave_port = 2,
- .sgmii_link_type = SGMII_LINK_MAC_PHY,
- .phy_if = PHY_INTERFACE_MODE_SGMII,
- },
- {
- .int_name= "K2E_EMAC2",
- .rx_flow = 16,
- .phy_addr= 2,
- .slave_port = 3,
- .sgmii_link_type = SGMII_LINK_MAC_MAC_FORCED,
- .phy_if = PHY_INTERFACE_MODE_SGMII,
- },
- {
- .int_name= "K2E_EMAC3",
- .rx_flow = 24,
- .phy_addr= 3,
- .slave_port = 4,
- .sgmii_link_type =