Vitaly Andrianov | 7bcf4d6 | 2014-04-04 13:16:53 -0400 | [diff] [blame] | 1 | /* |
| 2 | * common spl init code |
| 3 | * |
| 4 | * (C) Copyright 2012-2014 |
| 5 | * Texas Instruments Incorporated, <www.ti.com> |
| 6 | * |
| 7 | * SPDX-License-Identifier: GPL-2.0+ |
| 8 | */ |
| 9 | #include <common.h> |
| 10 | #include <config.h> |
| 11 | #include <ns16550.h> |
| 12 | #include <malloc.h> |
| 13 | #include <spl.h> |
| 14 | #include <spi_flash.h> |
| 15 | |
| 16 | #include <asm/u-boot.h> |
| 17 | #include <asm/utils.h> |
| 18 | |
| 19 | DECLARE_GLOBAL_DATA_PTR; |
| 20 | |
Khoronzhuk, Ivan | cdbd285 | 2014-07-16 00:59:26 +0300 | [diff] [blame] | 21 | #ifdef CONFIG_K2HK_EVM |
Vitaly Andrianov | 7bcf4d6 | 2014-04-04 13:16:53 -0400 | [diff] [blame] | 22 | static struct pll_init_data spl_pll_config[] = { |
| 23 | CORE_PLL_799, |
| 24 | TETRIS_PLL_500, |
| 25 | }; |
Khoronzhuk, Ivan | cdbd285 | 2014-07-16 00:59:26 +0300 | [diff] [blame] | 26 | #endif |
| 27 | |
| 28 | #ifdef CONFIG_K2E_EVM |
| 29 | static struct pll_init_data spl_pll_config[] = { |
| 30 | CORE_PLL_800, |
| 31 | }; |
| 32 | #endif |
Vitaly Andrianov | 7bcf4d6 | 2014-04-04 13:16:53 -0400 | [diff] [blame] | 33 | |
| 34 | void spl_init_keystone_plls(void) |
| 35 | { |
| 36 | init_plls(ARRAY_SIZE(spl_pll_config), spl_pll_config); |
| 37 | } |
| 38 | |
| 39 | void spl_board_init(void) |
| 40 | { |
| 41 | spl_init_keystone_plls(); |
| 42 | preloader_console_init(); |
| 43 | } |
| 44 | |
| 45 | u32 spl_boot_device(void) |
| 46 | { |
| 47 | #if defined(CONFIG_SPL_SPI_LOAD) |
| 48 | return BOOT_DEVICE_SPI; |
| 49 | #else |
| 50 | puts("Unknown boot device\n"); |
| 51 | hang(); |
| 52 | #endif |
| 53 | } |