xref: /openbmc/u-boot/board/ti/dra7xx/evm.c (revision 1a4596601fd395f3afb8f82f3f840c5e00bdd57a)
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  * SPDX-License-Identifier:	GPL-2.0+
12  */
13 #include <common.h>
14 #include <palmas.h>
15 #include <asm/arch/sys_proto.h>
16 #include <asm/arch/mmc_host_def.h>
17 
18 #include "mux_data.h"
19 
20 #ifdef CONFIG_USB_EHCI
21 #include <usb.h>
22 #include <asm/arch/ehci.h>
23 #include <asm/ehci-omap.h>
24 #endif
25 
26 DECLARE_GLOBAL_DATA_PTR;
27 
28 const struct omap_sysinfo sysinfo = {
29 	"Board: DRA7xx\n"
30 };
31 
32 /**
33  * @brief board_init
34  *
35  * @return 0
36  */
37 int board_init(void)
38 {
39 	gpmc_init();
40 	gd->bd->bi_boot_params = (0x80000000 + 0x100); /* boot param addr */
41 
42 	return 0;
43 }
44 
45 int board_eth_init(bd_t *bis)
46 {
47 	return 0;
48 }
49 
50 /**
51  * @brief misc_init_r - Configure EVM board specific configurations
52  * such as power configurations, ethernet initialization as phase2 of
53  * boot sequence
54  *
55  * @return 0
56  */
57 int misc_init_r(void)
58 {
59 	return 0;
60 }
61 
62 static void do_set_mux32(u32 base,
63 			 struct pad_conf_entry const *array, int size)
64 {
65 	int i;
66 	struct pad_conf_entry *pad = (struct pad_conf_entry *)array;
67 
68 	for (i = 0; i < size; i++, pad++)
69 		writel(pad->val, base + pad->offset);
70 }
71 
72 void set_muxconf_regs_essential(void)
73 {
74 	do_set_mux32((*ctrl)->control_padconf_core_base,
75 		     core_padconf_array_essential,
76 		     sizeof(core_padconf_array_essential) /
77 		     sizeof(struct pad_conf_entry));
78 }
79 
80 #if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_GENERIC_MMC)
81 int board_mmc_init(bd_t *bis)
82 {
83 	omap_mmc_init(0, 0, 0, -1, -1);
84 	omap_mmc_init(1, 0, 0, -1, -1);
85 	return 0;
86 }
87 #endif
88