diff options
author | Lokesh Vutla <lokeshvutla@ti.com> | 2015-07-28 14:16:46 +0530 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2015-08-12 20:47:53 -0400 |
commit | 94069301bafb601ff3c61b5d208fba4e3c948efd (patch) | |
tree | 93f67edad9c88cf6ff539e55b365f53ebd519f57 /board/ti | |
parent | 74af583e9f7a255443d8f625c8dce6da7b9703be (diff) | |
download | talos-obmc-uboot-94069301bafb601ff3c61b5d208fba4e3c948efd.tar.gz talos-obmc-uboot-94069301bafb601ff3c61b5d208fba4e3c948efd.zip |
ARM: keystone2: Cleanup init_pll definition
This is just a cosmetic change that makes
the calling of pll init code looks much cleaner.
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Vitaly Andrianov <vitalya@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Diffstat (limited to 'board/ti')
-rw-r--r-- | board/ti/ks2_evm/board_k2e.c | 33 | ||||
-rw-r--r-- | board/ti/ks2_evm/board_k2hk.c | 41 | ||||
-rw-r--r-- | board/ti/ks2_evm/board_k2l.c | 41 |
3 files changed, 74 insertions, 41 deletions
diff --git a/board/ti/ks2_evm/board_k2e.c b/board/ti/ks2_evm/board_k2e.c index 2043759533..e33cc64ea0 100644 --- a/board/ti/ks2_evm/board_k2e.c +++ b/board/ti/ks2_evm/board_k2e.c @@ -59,6 +59,26 @@ s16 divn_val[16] = { static struct pll_init_data pa_pll_config = PASS_PLL_1000; +struct pll_init_data *get_pll_init_data(int pll) +{ + int speed; + struct pll_init_data *data; + + switch (pll) { + case MAIN_PLL: + speed = get_max_dev_speed(); + data = &core_pll_config[speed]; + break; + case PASS_PLL: + data = &pa_pll_config; + break; + default: + data = NULL; + } + + return data; +} + #ifdef CONFIG_DRIVER_TI_KEYSTONE_NET struct eth_priv_t eth_priv_cfg[] = { { @@ -128,24 +148,15 @@ int get_num_eth_ports(void) #if defined(CONFIG_BOARD_EARLY_INIT_F) int board_early_init_f(void) { - int speed; - - speed = get_max_dev_speed(); - init_pll(&core_pll_config[speed]); - - init_pll(&pa_pll_config); + init_plls(); return 0; } #endif #ifdef CONFIG_SPL_BUILD -static struct pll_init_data spl_pll_config[] = { - CORE_PLL_800, -}; - void spl_init_keystone_plls(void) { - init_plls(ARRAY_SIZE(spl_pll_config), spl_pll_config); + init_plls(); } #endif diff --git a/board/ti/ks2_evm/board_k2hk.c b/board/ti/ks2_evm/board_k2hk.c index 6c0a092c96..b9e2b07b8a 100644 --- a/board/ti/ks2_evm/board_k2hk.c +++ b/board/ti/ks2_evm/board_k2hk.c @@ -50,6 +50,30 @@ static struct pll_init_data tetris_pll_config[] = { static struct pll_init_data pa_pll_config = PASS_PLL_983; +struct pll_init_data *get_pll_init_data(int pll) +{ + int speed; + struct pll_init_data *data; + + switch (pll) { + case MAIN_PLL: + speed = get_max_dev_speed(); + data = &core_pll_config[speed]; + break; + case TETRIS_PLL: + speed = get_max_arm_speed(); + data = &tetris_pll_config[speed]; + break; + case PASS_PLL: + data = &pa_pll_config; + break; + default: + data = NULL; + } + + return data; +} + #ifdef CONFIG_DRIVER_TI_KEYSTONE_NET struct eth_priv_t eth_priv_cfg[] = { { @@ -91,28 +115,15 @@ int get_num_eth_ports(void) #ifdef CONFIG_BOARD_EARLY_INIT_F int board_early_init_f(void) { - int speed; - - speed = get_max_dev_speed(); - init_pll(&core_pll_config[speed]); - - init_pll(&pa_pll_config); - - speed = get_max_arm_speed(); - init_pll(&tetris_pll_config[speed]); + init_plls(); return 0; } #endif #ifdef CONFIG_SPL_BUILD -static struct pll_init_data spl_pll_config[] = { - CORE_PLL_799, - TETRIS_PLL_500, -}; - void spl_init_keystone_plls(void) { - init_plls(ARRAY_SIZE(spl_pll_config), spl_pll_config); + init_plls(); } #endif diff --git a/board/ti/ks2_evm/board_k2l.c b/board/ti/ks2_evm/board_k2l.c index d6c0492d76..58a6cbd86e 100644 --- a/board/ti/ks2_evm/board_k2l.c +++ b/board/ti/ks2_evm/board_k2l.c @@ -46,6 +46,30 @@ static struct pll_init_data tetris_pll_config[] = { static struct pll_init_data pa_pll_config = PASS_PLL_983; +struct pll_init_data *get_pll_init_data(int pll) +{ + int speed; + struct pll_init_data *data; + + switch (pll) { + case MAIN_PLL: + speed = get_max_dev_speed(); + data = &core_pll_config[speed]; + break; + case TETRIS_PLL: + speed = get_max_arm_speed(); + data = &tetris_pll_config[speed]; + break; + case PASS_PLL: + data = &pa_pll_config; + break; + default: + data = NULL; + } + + return data; +} + #ifdef CONFIG_DRIVER_TI_KEYSTONE_NET struct eth_priv_t eth_priv_cfg[] = { { @@ -87,28 +111,15 @@ int get_num_eth_ports(void) #ifdef CONFIG_BOARD_EARLY_INIT_F int board_early_init_f(void) { - int speed; - - speed = get_max_dev_speed(); - init_pll(&core_pll_config[speed]); - - init_pll(&pa_pll_config); - - speed = get_max_arm_speed(); - init_pll(&tetris_pll_config[speed]); + init_plls(); return 0; } #endif #ifdef CONFIG_SPL_BUILD -static struct pll_init_data spl_pll_config[] = { - CORE_PLL_799, - TETRIS_PLL_491, -}; - void spl_init_keystone_plls(void) { - init_plls(ARRAY_SIZE(spl_pll_config), spl_pll_config); + init_plls(); } #endif |