Sricharan | 508a58f | 2011-11-15 09:49:55 -0500 | [diff] [blame] | 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 | * |
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 7 | * SPDX-License-Identifier: GPL-2.0+ |
Sricharan | 508a58f | 2011-11-15 09:49:55 -0500 | [diff] [blame] | 8 | */ |
| 9 | #include <common.h> |
Nishanth Menon | cb19910 | 2013-03-26 05:20:54 +0000 | [diff] [blame] | 10 | #include <palmas.h> |
Sricharan | 508a58f | 2011-11-15 09:49:55 -0500 | [diff] [blame] | 11 | #include <asm/arch/sys_proto.h> |
| 12 | #include <asm/arch/mmc_host_def.h> |
Dan Murphy | fdce7b6 | 2013-07-11 13:10:28 -0500 | [diff] [blame] | 13 | #include <tca642x.h> |
Sricharan | 508a58f | 2011-11-15 09:49:55 -0500 | [diff] [blame] | 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 | /** |
Dan Murphy | fdce7b6 | 2013-07-11 13:10:28 -0500 | [diff] [blame] | 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 | /** |
Sricharan | 508a58f | 2011-11-15 09:49:55 -0500 | [diff] [blame] | 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 | |
Dan Murphy | fdce7b6 | 2013-07-11 13:10:28 -0500 | [diff] [blame] | 53 | tca642x_set_inital_state(CONFIG_SYS_I2C_TCA642X_ADDR, tca642x_init); |
| 54 | |
Sricharan | 508a58f | 2011-11-15 09:49:55 -0500 | [diff] [blame] | 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 | { |
Nishanth Menon | cb19910 | 2013-03-26 05:20:54 +0000 | [diff] [blame] | 72 | #ifdef CONFIG_PALMAS_POWER |
Nishanth Menon | 1273388 | 2013-03-26 05:20:55 +0000 | [diff] [blame] | 73 | palmas_init_settings(); |
Sricharan | 508a58f | 2011-11-15 09:49:55 -0500 | [diff] [blame] | 74 | #endif |
| 75 | return 0; |
| 76 | } |
| 77 | |
| 78 | void set_muxconf_regs_essential(void) |
| 79 | { |
Lokesh Vutla | 9239f5b | 2013-05-30 02:54:30 +0000 | [diff] [blame] | 80 | do_set_mux((*ctrl)->control_padconf_core_base, |
| 81 | core_padconf_array_essential, |
Sricharan | 508a58f | 2011-11-15 09:49:55 -0500 | [diff] [blame] | 82 | sizeof(core_padconf_array_essential) / |
| 83 | sizeof(struct pad_conf_entry)); |
| 84 | |
Lokesh Vutla | 9239f5b | 2013-05-30 02:54:30 +0000 | [diff] [blame] | 85 | do_set_mux((*ctrl)->control_padconf_wkup_base, |
| 86 | wkup_padconf_array_essential, |
Sricharan | 508a58f | 2011-11-15 09:49:55 -0500 | [diff] [blame] | 87 | sizeof(wkup_padconf_array_essential) / |
| 88 | sizeof(struct pad_conf_entry)); |
| 89 | } |
| 90 | |
| 91 | void set_muxconf_regs_non_essential(void) |
| 92 | { |
Lokesh Vutla | 9239f5b | 2013-05-30 02:54:30 +0000 | [diff] [blame] | 93 | do_set_mux((*ctrl)->control_padconf_core_base, |
| 94 | core_padconf_array_non_essential, |
Sricharan | 508a58f | 2011-11-15 09:49:55 -0500 | [diff] [blame] | 95 | sizeof(core_padconf_array_non_essential) / |
| 96 | sizeof(struct pad_conf_entry)); |
| 97 | |
Lokesh Vutla | 9239f5b | 2013-05-30 02:54:30 +0000 | [diff] [blame] | 98 | do_set_mux((*ctrl)->control_padconf_wkup_base, |
| 99 | wkup_padconf_array_non_essential, |
Sricharan | 508a58f | 2011-11-15 09:49:55 -0500 | [diff] [blame] | 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 | { |
Nikita Kiryanov | e3913f5 | 2012-12-03 02:19:47 +0000 | [diff] [blame] | 107 | omap_mmc_init(0, 0, 0, -1, -1); |
| 108 | omap_mmc_init(1, 0, 0, -1, -1); |
Sricharan | 508a58f | 2011-11-15 09:49:55 -0500 | [diff] [blame] | 109 | return 0; |
| 110 | } |
| 111 | #endif |