blob: a5b35040453060bd22a0295a269c5121c7b6241f [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>
Simon Glass97589732020-05-10 11:40:02 -06009#include <init.h>
Simon Glass274e0b02020-05-10 11:39:56 -060010#include <net.h>
Balaji T K13c3c502010-11-25 16:22:04 +053011#include <twl6030.h>
Steve Sakoman1b3dd5d2010-06-08 13:07:46 -070012#include <asm/arch/sys_proto.h>
Sukumar Ghorai7d99f692010-09-18 20:59:54 -070013#include <asm/arch/mmc_host_def.h>
Steve Sakoman1b3dd5d2010-06-08 13:07:46 -070014
Aneesh Vf908b632011-07-21 09:10:01 -040015#include "sdp4430_mux_data.h"
Steve Sakoman9bb65b52010-07-15 13:43:10 -070016
Steve Sakoman1b3dd5d2010-06-08 13:07:46 -070017DECLARE_GLOBAL_DATA_PTR;
18
19const struct omap_sysinfo sysinfo = {
20 "Board: OMAP4430 SDP\n"
21};
22
23/**
24 * @brief board_init
25 *
26 * @return 0
27 */
28int board_init(void)
29{
Steve Sakoman9b8ea4e2010-07-15 16:19:16 -040030 gpmc_init();
31
Steve Sakoman1b3dd5d2010-06-08 13:07:46 -070032 gd->bd->bi_boot_params = (0x80000000 + 0x100); /* boot param addr */
33
34 return 0;
35}
36
37int 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 */
49int misc_init_r(void)
50{
Balaji T K13c3c502010-11-25 16:22:04 +053051#ifdef CONFIG_TWL6030_POWER
52 twl6030_init_battery_charging();
53#endif
Steve Sakoman1b3dd5d2010-06-08 13:07:46 -070054 return 0;
55}
Steve Sakoman9bb65b52010-07-15 13:43:10 -070056
Paul Kocialkowskia00b1e52016-02-27 19:18:56 +010057void set_muxconf_regs(void)
Sricharan9310ff72011-11-15 09:49:55 -050058{
Lokesh Vutla37bce592013-05-30 02:54:30 +000059 do_set_mux((*ctrl)->control_padconf_core_base,
60 core_padconf_array_essential,
Sricharan9310ff72011-11-15 09:49:55 -050061 sizeof(core_padconf_array_essential) /
62 sizeof(struct pad_conf_entry));
63
Lokesh Vutla37bce592013-05-30 02:54:30 +000064 do_set_mux((*ctrl)->control_padconf_wkup_base,
65 wkup_padconf_array_essential,
Sricharan9310ff72011-11-15 09:49:55 -050066 sizeof(wkup_padconf_array_essential) /
67 sizeof(struct pad_conf_entry));
68
Taras Kondratiuk2ae10dc2013-08-06 15:18:51 +030069 if ((omap_revision() >= OMAP4460_ES1_0) &&
70 (omap_revision() < OMAP4470_ES1_0))
Lokesh Vutla37bce592013-05-30 02:54:30 +000071 do_set_mux((*ctrl)->control_padconf_wkup_base,
Sricharan9310ff72011-11-15 09:49:55 -050072 wkup_padconf_array_essential_4460,
73 sizeof(wkup_padconf_array_essential_4460) /
74 sizeof(struct pad_conf_entry));
75}
76
Masahiro Yamada0a780172017-05-09 20:31:39 +090077#if defined(CONFIG_MMC)
Sukumar Ghorai7d99f692010-09-18 20:59:54 -070078int board_mmc_init(bd_t *bis)
79{
Nikita Kiryanov4be9dbc2012-12-03 02:19:47 +000080 omap_mmc_init(0, 0, 0, -1, -1);
81 omap_mmc_init(1, 0, 0, -1, -1);
Sukumar Ghorai7d99f692010-09-18 20:59:54 -070082 return 0;
83}
Paul Kocialkowski4bbf2b32016-02-27 19:18:52 +010084
Jean-Jacques Hiblote0e319a2017-02-01 11:39:14 +010085#if !defined(CONFIG_SPL_BUILD)
Paul Kocialkowski4bbf2b32016-02-27 19:18:52 +010086void board_mmc_power_init(void)
87{
88 twl6030_power_mmc_init(0);
89 twl6030_power_mmc_init(1);
90}
Sukumar Ghorai7d99f692010-09-18 20:59:54 -070091#endif
Jean-Jacques Hiblote0e319a2017-02-01 11:39:14 +010092#endif
Sricharan9310ff72011-11-15 09:49:55 -050093
94/*
95 * get_board_rev() - get board revision
96 */
97u32 get_board_rev(void)
98{
99 return 0x20;
100}