blob: 2c00648470fe5728d3ef1b24aca6e7f457df3dd4 [file] [log] [blame]
Sricharan508a58f2011-11-15 09:49:55 -05001/*
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 Denk1a459662013-07-08 09:37:19 +02007 * SPDX-License-Identifier: GPL-2.0+
Sricharan508a58f2011-11-15 09:49:55 -05008 */
9#include <common.h>
Nishanth Menoncb199102013-03-26 05:20:54 +000010#include <palmas.h>
Sricharan508a58f2011-11-15 09:49:55 -050011#include <asm/arch/sys_proto.h>
12#include <asm/arch/mmc_host_def.h>
Dan Murphyfdce7b62013-07-11 13:10:28 -050013#include <tca642x.h>
Sricharan508a58f2011-11-15 09:49:55 -050014
15#include "mux_data.h"
16
17DECLARE_GLOBAL_DATA_PTR;
18
19const struct omap_sysinfo sysinfo = {
20 "Board: OMAP5430 EVM\n"
21};
22
23/**
Dan Murphyfdce7b62013-07-11 13:10:28 -050024 * @brief tca642x_init - uEVM default values for the GPIO expander
25 * input reg, output reg, polarity reg, configuration reg
26 */
27struct 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/**
Sricharan508a58f2011-11-15 09:49:55 -050043 * @brief board_init
44 *
45 * @return 0
46 */
47int 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 Murphyfdce7b62013-07-11 13:10:28 -050053 tca642x_set_inital_state(CONFIG_SYS_I2C_TCA642X_ADDR, tca642x_init);
54
Sricharan508a58f2011-11-15 09:49:55 -050055 return 0;
56}
57
58int 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 */
70int misc_init_r(void)
71{
Nishanth Menoncb199102013-03-26 05:20:54 +000072#ifdef CONFIG_PALMAS_POWER
Nishanth Menon12733882013-03-26 05:20:55 +000073 palmas_init_settings();
Sricharan508a58f2011-11-15 09:49:55 -050074#endif
75 return 0;
76}
77
78void set_muxconf_regs_essential(void)
79{
Lokesh Vutla9239f5b2013-05-30 02:54:30 +000080 do_set_mux((*ctrl)->control_padconf_core_base,
81 core_padconf_array_essential,
Sricharan508a58f2011-11-15 09:49:55 -050082 sizeof(core_padconf_array_essential) /
83 sizeof(struct pad_conf_entry));
84
Lokesh Vutla9239f5b2013-05-30 02:54:30 +000085 do_set_mux((*ctrl)->control_padconf_wkup_base,
86 wkup_padconf_array_essential,
Sricharan508a58f2011-11-15 09:49:55 -050087 sizeof(wkup_padconf_array_essential) /
88 sizeof(struct pad_conf_entry));
89}
90
91void set_muxconf_regs_non_essential(void)
92{
Lokesh Vutla9239f5b2013-05-30 02:54:30 +000093 do_set_mux((*ctrl)->control_padconf_core_base,
94 core_padconf_array_non_essential,
Sricharan508a58f2011-11-15 09:49:55 -050095 sizeof(core_padconf_array_non_essential) /
96 sizeof(struct pad_conf_entry));
97
Lokesh Vutla9239f5b2013-05-30 02:54:30 +000098 do_set_mux((*ctrl)->control_padconf_wkup_base,
99 wkup_padconf_array_non_essential,
Sricharan508a58f2011-11-15 09:49:55 -0500100 sizeof(wkup_padconf_array_non_essential) /
101 sizeof(struct pad_conf_entry));
102}
103
104#if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_GENERIC_MMC)
105int board_mmc_init(bd_t *bis)
106{
Nikita Kiryanove3913f52012-12-03 02:19:47 +0000107 omap_mmc_init(0, 0, 0, -1, -1);
108 omap_mmc_init(1, 0, 0, -1, -1);
Sricharan508a58f2011-11-15 09:49:55 -0500109 return 0;
110}
111#endif