2 * K2E EVM : Board initialization
5 * Texas Instruments Incorporated, <www.ti.com>
7 * SPDX-License-Identifier: GPL-2.0+
11 #include <asm/arch/ddr3.h>
12 #include <asm/arch/hardware.h>
13 #include <asm/ti-common/keystone_net.h>
15 DECLARE_GLOBAL_DATA_PTR
;
17 unsigned int get_external_clk(u32 clk
)
19 unsigned int clk_freq
;
42 static struct pll_init_data core_pll_config
[NUM_SPDS
] = {
43 [SPD800
] = CORE_PLL_800
,
44 [SPD850
] = CORE_PLL_850
,
45 [SPD1000
] = CORE_PLL_1000
,
46 [SPD1250
] = CORE_PLL_1250
,
47 [SPD1350
] = CORE_PLL_1350
,
48 [SPD1400
] = CORE_PLL_1400
,
49 [SPD1500
] = CORE_PLL_1500
,
52 /* DEV and ARM speed definitions as specified in DEVSPEED register */
53 int speeds
[DEVSPEED_NUMSPDS
] = {
69 0, 0, 1, 4, 23, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
72 static struct pll_init_data pa_pll_config
=
75 struct pll_init_data
*get_pll_init_data(int pll
)
78 struct pll_init_data
*data
;
82 speed
= get_max_dev_speed(speeds
);
83 data
= &core_pll_config
[speed
];
86 data
= &pa_pll_config
;
95 #ifdef CONFIG_DRIVER_TI_KEYSTONE_NET
96 struct eth_priv_t eth_priv_cfg
[] = {
98 .int_name
= "K2E_EMAC0",
102 .sgmii_link_type
= SGMII_LINK_MAC_PHY
,
103 .phy_if
= PHY_INTERFACE_MODE_SGMII
,
106 .int_name
= "K2E_EMAC1",
110 .sgmii_link_type
= SGMII_LINK_MAC_PHY
,
111 .phy_if
= PHY_INTERFACE_MODE_SGMII
,
114 .int_name
= "K2E_EMAC2",
118 .sgmii_link_type
= SGMII_LINK_MAC_MAC_FORCED
,
119 .phy_if
= PHY_INTERFACE_MODE_SGMII
,
122 .int_name
= "K2E_EMAC3",
126 .sgmii_link_type
= SGMII_LINK_MAC_MAC_FORCED
,
127 .phy_if
= PHY_INTERFACE_MODE_SGMII
,
130 .int_name
= "K2E_EMAC4",
134 .sgmii_link_type
= SGMII_LINK_MAC_MAC_FORCED
,
135 .phy_if
= PHY_INTERFACE_MODE_SGMII
,
138 .int_name
= "K2E_EMAC5",
142 .sgmii_link_type
= SGMII_LINK_MAC_MAC_FORCED
,
143 .phy_if
= PHY_INTERFACE_MODE_SGMII
,
146 .int_name
= "K2E_EMAC6",
150 .sgmii_link_type
= SGMII_LINK_MAC_MAC_FORCED
,
151 .phy_if
= PHY_INTERFACE_MODE_SGMII
,
154 .int_name
= "K2E_EMAC7",
158 .sgmii_link_type
= SGMII_LINK_MAC_MAC_FORCED
,
159 .phy_if
= PHY_INTERFACE_MODE_SGMII
,
163 int get_num_eth_ports(void)
165 return sizeof(eth_priv_cfg
) / sizeof(struct eth_priv_t
);
169 #if defined(CONFIG_MULTI_DTB_FIT)
170 int board_fit_config_name_match(const char *name
)
172 if (!strcmp(name
, "keystone-k2e-evm"))
179 #if defined(CONFIG_BOARD_EARLY_INIT_F)
180 int board_early_init_f(void)
188 #ifdef CONFIG_SPL_BUILD
189 void spl_init_keystone_plls(void)