2 * K2G EVM : Board initialization
5 * Texas Instruments Incorporated, <www.ti.com>
7 * SPDX-License-Identifier: GPL-2.0+
10 #include <asm/arch/clock.h>
11 #include <asm/ti-common/keystone_net.h>
12 #include <asm/arch/psc_defs.h>
13 #include <asm/arch/mmc_host_def.h>
16 #define SYS_CLK 24000000
18 unsigned int external_clk
[ext_clk_count
] = {
21 [tetris_clk
] = SYS_CLK
,
22 [ddr3a_clk
] = SYS_CLK
,
26 static struct pll_init_data main_pll_config
= {MAIN_PLL
, 100, 1, 4};
27 static struct pll_init_data tetris_pll_config
= {TETRIS_PLL
, 100, 1, 4};
28 static struct pll_init_data uart_pll_config
= {UART_PLL
, 64, 1, 4};
29 static struct pll_init_data nss_pll_config
= {NSS_PLL
, 250, 3, 2};
30 static struct pll_init_data ddr3_pll_config
= {DDR3A_PLL
, 250, 3, 10};
32 struct pll_init_data
*get_pll_init_data(int pll
)
34 struct pll_init_data
*data
= NULL
;
38 data
= &main_pll_config
;
41 data
= &tetris_pll_config
;
44 data
= &nss_pll_config
;
47 data
= &uart_pll_config
;
50 data
= &ddr3_pll_config
;
60 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
63 #if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_GENERIC_MMC)
64 int board_mmc_init(bd_t
*bis
)
66 if (psc_enable_module(KS2_LPSC_MMC
)) {
67 printf("%s module enabled failed\n", __func__
);
71 omap_mmc_init(0, 0, 0, -1, -1);
72 omap_mmc_init(1, 0, 0, -1, -1);
77 #ifdef CONFIG_BOARD_EARLY_INIT_F
78 int board_early_init_f(void)
84 /* deassert FLASH_HOLD */
85 clrbits_le32(K2G_GPIO1_BANK2_BASE
+ K2G_GPIO_DIR_OFFSET
,
87 setbits_le32(K2G_GPIO1_BANK2_BASE
+ K2G_GPIO_SETDATA_OFFSET
,
94 #ifdef CONFIG_SPL_BUILD
95 void spl_init_keystone_plls(void)
101 #ifdef CONFIG_DRIVER_TI_KEYSTONE_NET
102 struct eth_priv_t eth_priv_cfg
[] = {
104 .int_name
= "K2G_EMAC",
108 .sgmii_link_type
= SGMII_LINK_MAC_PHY
,
109 .phy_if
= PHY_INTERFACE_MODE_RGMII
,
113 int get_num_eth_ports(void)
115 return sizeof(eth_priv_cfg
) / sizeof(struct eth_priv_t
);