Merge tag 'efi-2020-07-rc6' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
[oweals/u-boot.git] / board / ti / sdp4430 / sdp.c
1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3  * (C) Copyright 2010
4  * Texas Instruments Incorporated, <www.ti.com>
5  * Aneesh V       <aneesh@ti.com>
6  * Steve Sakoman  <steve@sakoman.com>
7  */
8 #include <common.h>
9 #include <init.h>
10 #include <net.h>
11 #include <twl6030.h>
12 #include <asm/arch/sys_proto.h>
13 #include <asm/arch/mmc_host_def.h>
14
15 #include "sdp4430_mux_data.h"
16
17 DECLARE_GLOBAL_DATA_PTR;
18
19 const struct omap_sysinfo sysinfo = {
20         "Board: OMAP4430 SDP\n"
21 };
22
23 /**
24  * @brief board_init
25  *
26  * @return 0
27  */
28 int board_init(void)
29 {
30         gpmc_init();
31
32         gd->bd->bi_boot_params = (0x80000000 + 0x100); /* boot param addr */
33
34         return 0;
35 }
36
37 int board_eth_init(bd_t *bis)
38 {
39         return 0;
40 }
41
42 /**
43  * @brief misc_init_r - Configure SDP board specific configurations
44  * such as power configurations, ethernet initialization as phase2 of
45  * boot sequence
46  *
47  * @return 0
48  */
49 int misc_init_r(void)
50 {
51 #ifdef CONFIG_TWL6030_POWER
52         twl6030_init_battery_charging();
53 #endif
54         return 0;
55 }
56
57 void set_muxconf_regs(void)
58 {
59         do_set_mux((*ctrl)->control_padconf_core_base,
60                    core_padconf_array_essential,
61                    sizeof(core_padconf_array_essential) /
62                    sizeof(struct pad_conf_entry));
63
64         do_set_mux((*ctrl)->control_padconf_wkup_base,
65                    wkup_padconf_array_essential,
66                    sizeof(wkup_padconf_array_essential) /
67                    sizeof(struct pad_conf_entry));
68
69         if ((omap_revision() >= OMAP4460_ES1_0) &&
70                         (omap_revision() < OMAP4470_ES1_0))
71                 do_set_mux((*ctrl)->control_padconf_wkup_base,
72                                  wkup_padconf_array_essential_4460,
73                                  sizeof(wkup_padconf_array_essential_4460) /
74                                  sizeof(struct pad_conf_entry));
75 }
76
77 #if defined(CONFIG_MMC)
78 int board_mmc_init(bd_t *bis)
79 {
80         omap_mmc_init(0, 0, 0, -1, -1);
81         omap_mmc_init(1, 0, 0, -1, -1);
82         return 0;
83 }
84
85 #if !defined(CONFIG_SPL_BUILD)
86 void board_mmc_power_init(void)
87 {
88         twl6030_power_mmc_init(0);
89         twl6030_power_mmc_init(1);
90 }
91 #endif
92 #endif
93
94 /*
95  * get_board_rev() - get board revision
96  */
97 u32 get_board_rev(void)
98 {
99         return 0x20;
100 }