blob: e71c53e5ee41121e1bbb6b454a468281536e7f77 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Steve Sakoman1b3dd5d2010-06-08 13:07:46 -07002/*
3 * (C) Copyright 2010
4 * Texas Instruments Incorporated, <www.ti.com>
5 * Aneesh V <aneesh@ti.com>
6 * Steve Sakoman <steve@sakoman.com>
Steve Sakoman1b3dd5d2010-06-08 13:07:46 -07007 */
8#include <common.h>
Balaji T K13c3c502010-11-25 16:22:04 +05309#include <twl6030.h>
Steve Sakoman1b3dd5d2010-06-08 13:07:46 -070010#include <asm/arch/sys_proto.h>
Sukumar Ghorai7d99f692010-09-18 20:59:54 -070011#include <asm/arch/mmc_host_def.h>
Steve Sakoman1b3dd5d2010-06-08 13:07:46 -070012
Aneesh Vf908b632011-07-21 09:10:01 -040013#include "sdp4430_mux_data.h"
Steve Sakoman9bb65b52010-07-15 13:43:10 -070014
Steve Sakoman1b3dd5d2010-06-08 13:07:46 -070015DECLARE_GLOBAL_DATA_PTR;
16
17const struct omap_sysinfo sysinfo = {
18 "Board: OMAP4430 SDP\n"
19};
20
21/**
22 * @brief board_init
23 *
24 * @return 0
25 */
26int board_init(void)
27{
Steve Sakoman9b8ea4e2010-07-15 16:19:16 -040028 gpmc_init();
29
Steve Sakoman1b3dd5d2010-06-08 13:07:46 -070030 gd->bd->bi_boot_params = (0x80000000 + 0x100); /* boot param addr */
31
32 return 0;
33}
34
35int board_eth_init(bd_t *bis)
36{
37 return 0;
38}
39
40/**
41 * @brief misc_init_r - Configure SDP board specific configurations
42 * such as power configurations, ethernet initialization as phase2 of
43 * boot sequence
44 *
45 * @return 0
46 */
47int misc_init_r(void)
48{
Balaji T K13c3c502010-11-25 16:22:04 +053049#ifdef CONFIG_TWL6030_POWER
50 twl6030_init_battery_charging();
51#endif
Steve Sakoman1b3dd5d2010-06-08 13:07:46 -070052 return 0;
53}
Steve Sakoman9bb65b52010-07-15 13:43:10 -070054
Paul Kocialkowskia00b1e52016-02-27 19:18:56 +010055void set_muxconf_regs(void)
Sricharan9310ff72011-11-15 09:49:55 -050056{
Lokesh Vutla37bce592013-05-30 02:54:30 +000057 do_set_mux((*ctrl)->control_padconf_core_base,
58 core_padconf_array_essential,
Sricharan9310ff72011-11-15 09:49:55 -050059 sizeof(core_padconf_array_essential) /
60 sizeof(struct pad_conf_entry));
61
Lokesh Vutla37bce592013-05-30 02:54:30 +000062 do_set_mux((*ctrl)->control_padconf_wkup_base,
63 wkup_padconf_array_essential,
Sricharan9310ff72011-11-15 09:49:55 -050064 sizeof(wkup_padconf_array_essential) /
65 sizeof(struct pad_conf_entry));
66
Taras Kondratiuk2ae10dc2013-08-06 15:18:51 +030067 if ((omap_revision() >= OMAP4460_ES1_0) &&
68 (omap_revision() < OMAP4470_ES1_0))
Lokesh Vutla37bce592013-05-30 02:54:30 +000069 do_set_mux((*ctrl)->control_padconf_wkup_base,
Sricharan9310ff72011-11-15 09:49:55 -050070 wkup_padconf_array_essential_4460,
71 sizeof(wkup_padconf_array_essential_4460) /
72 sizeof(struct pad_conf_entry));
73}
74
Masahiro Yamada0a780172017-05-09 20:31:39 +090075#if defined(CONFIG_MMC)
Sukumar Ghorai7d99f692010-09-18 20:59:54 -070076int board_mmc_init(bd_t *bis)
77{
Nikita Kiryanov4be9dbc2012-12-03 02:19:47 +000078 omap_mmc_init(0, 0, 0, -1, -1);
79 omap_mmc_init(1, 0, 0, -1, -1);
Sukumar Ghorai7d99f692010-09-18 20:59:54 -070080 return 0;
81}
Paul Kocialkowski4bbf2b32016-02-27 19:18:52 +010082
Jean-Jacques Hiblote0e319a2017-02-01 11:39:14 +010083#if !defined(CONFIG_SPL_BUILD)
Paul Kocialkowski4bbf2b32016-02-27 19:18:52 +010084void board_mmc_power_init(void)
85{
86 twl6030_power_mmc_init(0);
87 twl6030_power_mmc_init(1);
88}
Sukumar Ghorai7d99f692010-09-18 20:59:54 -070089#endif
Jean-Jacques Hiblote0e319a2017-02-01 11:39:14 +010090#endif
Sricharan9310ff72011-11-15 09:49:55 -050091
92/*
93 * get_board_rev() - get board revision
94 */
95u32 get_board_rev(void)
96{
97 return 0x20;
98}