1 /* 2 * (C) Copyright 2010 3 * Texas Instruments Incorporated, <www.ti.com> 4 * Aneesh V <aneesh@ti.com> 5 * Steve Sakoman <steve@sakoman.com> 6 * 7 * SPDX-License-Identifier: GPL-2.0+ 8 */ 9 #include <common.h> 10 #include <palmas.h> 11 #include <asm/arch/sys_proto.h> 12 #include <asm/arch/mmc_host_def.h> 13 #include <tca642x.h> 14 15 #include "mux_data.h" 16 17 DECLARE_GLOBAL_DATA_PTR; 18 19 const struct omap_sysinfo sysinfo = { 20 "Board: OMAP5430 EVM\n" 21 }; 22 23 /** 24 * @brief tca642x_init - uEVM default values for the GPIO expander 25 * input reg, output reg, polarity reg, configuration reg 26 */ 27 struct tca642x_bank_info tca642x_init[] = { 28 { .input_reg = 0x00, 29 .output_reg = 0x04, 30 .polarity_reg = 0x00, 31 .configuration_reg = 0x80 }, 32 { .input_reg = 0x00, 33 .output_reg = 0x00, 34 .polarity_reg = 0x00, 35 .configuration_reg = 0xff }, 36 { .input_reg = 0x00, 37 .output_reg = 0x00, 38 .polarity_reg = 0x00, 39 .configuration_reg = 0x40 }, 40 }; 41 42 /** 43 * @brief board_init 44 * 45 * @return 0 46 */ 47 int board_init(void) 48 { 49 gpmc_init(); 50 gd->bd->bi_arch_number = MACH_TYPE_OMAP5_SEVM; 51 gd->bd->bi_boot_params = (0x80000000 + 0x100); /* boot param addr */ 52 53 tca642x_set_inital_state(CONFIG_SYS_I2C_TCA642X_ADDR, tca642x_init); 54 55 return 0; 56 } 57 58 int board_eth_init(bd_t *bis) 59 { 60 return 0; 61 } 62 63 /** 64 * @brief misc_init_r - Configure EVM board specific configurations 65 * such as power configurations, ethernet initialization as phase2 of 66 * boot sequence 67 * 68 * @return 0 69 */ 70 int misc_init_r(void) 71 { 72 #ifdef CONFIG_PALMAS_POWER 73 palmas_init_settings(); 74 #endif 75 return 0; 76 } 77 78 void set_muxconf_regs_essential(void) 79 { 80 do_set_mux((*ctrl)->control_padconf_core_base, 81 core_padconf_array_essential, 82 sizeof(core_padconf_array_essential) / 83 sizeof(struct pad_conf_entry)); 84 85 do_set_mux((*ctrl)->control_padconf_wkup_base, 86 wkup_padconf_array_essential, 87 sizeof(wkup_padconf_array_essential) / 88 sizeof(struct pad_conf_entry)); 89 } 90 91 void set_muxconf_regs_non_essential(void) 92 { 93 do_set_mux((*ctrl)->control_padconf_core_base, 94 core_padconf_array_non_essential, 95 sizeof(core_padconf_array_non_essential) / 96 sizeof(struct pad_conf_entry)); 97 98 do_set_mux((*ctrl)->control_padconf_wkup_base, 99 wkup_padconf_array_non_essential, 100 sizeof(wkup_padconf_array_non_essential) / 101 sizeof(struct pad_conf_entry)); 102 } 103 104 #if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_GENERIC_MMC) 105 int board_mmc_init(bd_t *bis) 106 { 107 omap_mmc_init(0, 0, 0, -1, -1); 108 omap_mmc_init(1, 0, 0, -1, -1); 109 return 0; 110 } 111 #endif 112