xref: /openbmc/u-boot/board/ti/dra7xx/evm.c (revision 68fbc0e6)
1 /*
2  * (C) Copyright 2013
3  * Texas Instruments Incorporated, <www.ti.com>
4  *
5  * Lokesh Vutla <lokeshvutla@ti.com>
6  *
7  * Based on previous work by:
8  * Aneesh V       <aneesh@ti.com>
9  * Steve Sakoman  <steve@sakoman.com>
10  *
11  * See file CREDITS for list of people who contributed to this
12  * project.
13  *
14  * This program is free software; you can redistribute it and/or
15  * modify it under the terms of the GNU General Public License as
16  * published by the Free Software Foundation; either version 2 of
17  * the License, or (at your option) any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  * GNU General Public License for more details.
23  *
24  * You should have received a copy of the GNU General Public License
25  * along with this program; if not, write to the Free Software
26  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
27  * MA 02111-1307 USA
28  */
29 #include <common.h>
30 #include <twl6035.h>
31 #include <asm/arch/sys_proto.h>
32 #include <asm/arch/mmc_host_def.h>
33 
34 #include "mux_data.h"
35 
36 #ifdef CONFIG_USB_EHCI
37 #include <usb.h>
38 #include <asm/arch/ehci.h>
39 #include <asm/ehci-omap.h>
40 #endif
41 
42 DECLARE_GLOBAL_DATA_PTR;
43 
44 const struct omap_sysinfo sysinfo = {
45 	"Board: DRA7xx\n"
46 };
47 
48 /**
49  * @brief board_init
50  *
51  * @return 0
52  */
53 int board_init(void)
54 {
55 	gpmc_init();
56 	gd->bd->bi_boot_params = (0x80000000 + 0x100); /* boot param addr */
57 
58 	return 0;
59 }
60 
61 int board_eth_init(bd_t *bis)
62 {
63 	return 0;
64 }
65 
66 /**
67  * @brief misc_init_r - Configure EVM board specific configurations
68  * such as power configurations, ethernet initialization as phase2 of
69  * boot sequence
70  *
71  * @return 0
72  */
73 int misc_init_r(void)
74 {
75 	return 0;
76 }
77 
78 static void do_set_mux32(u32 base,
79 			 struct pad_conf_entry const *array, int size)
80 {
81 	int i;
82 	struct pad_conf_entry *pad = (struct pad_conf_entry *)array;
83 
84 	for (i = 0; i < size; i++, pad++)
85 		writel(pad->val, base + pad->offset);
86 }
87 
88 void set_muxconf_regs_essential(void)
89 {
90 	do_set_mux32((*ctrl)->control_padconf_core_base,
91 		     core_padconf_array_essential,
92 		     sizeof(core_padconf_array_essential) /
93 		     sizeof(struct pad_conf_entry));
94 }
95 
96 #if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_GENERIC_MMC)
97 int board_mmc_init(bd_t *bis)
98 {
99 	omap_mmc_init(0, 0, 0, -1, -1);
100 	omap_mmc_init(1, 0, 0, -1, -1);
101 	return 0;
102 }
103 #endif
104