blob: 3fd973049a87161cadff787976c17b6d9e9d3622 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Steve Sakoman3e76d622010-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 Sakoman3e76d622010-06-08 13:07:46 -07007 */
8#include <common.h>
Simon Glass691d7192020-05-10 11:40:02 -06009#include <init.h>
Simon Glass90526e92020-05-10 11:39:56 -060010#include <net.h>
Balaji T K3e664f62010-11-25 16:22:04 +053011#include <twl6030.h>
Peter Ujfalusi8812ed92020-06-16 11:03:08 +030012#include <serial.h>
Steve Sakoman3e76d622010-06-08 13:07:46 -070013#include <asm/arch/sys_proto.h>
Sukumar Ghorai084c4c12010-09-18 20:59:54 -070014#include <asm/arch/mmc_host_def.h>
Steve Sakoman3e76d622010-06-08 13:07:46 -070015
Aneesh V469ec1e2011-07-21 09:10:01 -040016#include "sdp4430_mux_data.h"
Steve Sakoman2ad853c2010-07-15 13:43:10 -070017
Steve Sakoman3e76d622010-06-08 13:07:46 -070018DECLARE_GLOBAL_DATA_PTR;
19
20const struct omap_sysinfo sysinfo = {
21 "Board: OMAP4430 SDP\n"
22};
23
24/**
25 * @brief board_init
26 *
27 * @return 0
28 */
29int board_init(void)
30{
Steve Sakoman27952012010-07-15 16:19:16 -040031 gpmc_init();
32
Steve Sakoman3e76d622010-06-08 13:07:46 -070033 gd->bd->bi_boot_params = (0x80000000 + 0x100); /* boot param addr */
34
35 return 0;
36}
37
Masahiro Yamadab75d8dc2020-06-26 15:13:33 +090038int board_eth_init(struct bd_info *bis)
Steve Sakoman3e76d622010-06-08 13:07:46 -070039{
40 return 0;
41}
42
43/**
44 * @brief misc_init_r - Configure SDP board specific configurations
45 * such as power configurations, ethernet initialization as phase2 of
46 * boot sequence
47 *
48 * @return 0
49 */
50int misc_init_r(void)
51{
Balaji T K3e664f62010-11-25 16:22:04 +053052#ifdef CONFIG_TWL6030_POWER
53 twl6030_init_battery_charging();
54#endif
Steve Sakoman3e76d622010-06-08 13:07:46 -070055 return 0;
56}
Steve Sakoman2ad853c2010-07-15 13:43:10 -070057
Paul Kocialkowski3ef56e62016-02-27 19:18:56 +010058void set_muxconf_regs(void)
Sricharan508a58f2011-11-15 09:49:55 -050059{
Lokesh Vutla9239f5b2013-05-30 02:54:30 +000060 do_set_mux((*ctrl)->control_padconf_core_base,
61 core_padconf_array_essential,
Sricharan508a58f2011-11-15 09:49:55 -050062 sizeof(core_padconf_array_essential) /
63 sizeof(struct pad_conf_entry));
64
Lokesh Vutla9239f5b2013-05-30 02:54:30 +000065 do_set_mux((*ctrl)->control_padconf_wkup_base,
66 wkup_padconf_array_essential,
Sricharan508a58f2011-11-15 09:49:55 -050067 sizeof(wkup_padconf_array_essential) /
68 sizeof(struct pad_conf_entry));
69
Taras Kondratiuke633ac02013-08-06 15:18:51 +030070 if ((omap_revision() >= OMAP4460_ES1_0) &&
71 (omap_revision() < OMAP4470_ES1_0))
Lokesh Vutla9239f5b2013-05-30 02:54:30 +000072 do_set_mux((*ctrl)->control_padconf_wkup_base,
Sricharan508a58f2011-11-15 09:49:55 -050073 wkup_padconf_array_essential_4460,
74 sizeof(wkup_padconf_array_essential_4460) /
75 sizeof(struct pad_conf_entry));
76}
77
Masahiro Yamada4aa2ba32017-05-09 20:31:39 +090078#if defined(CONFIG_MMC)
Masahiro Yamadab75d8dc2020-06-26 15:13:33 +090079int board_mmc_init(struct bd_info *bis)
Sukumar Ghorai084c4c12010-09-18 20:59:54 -070080{
Nikita Kiryanove3913f52012-12-03 02:19:47 +000081 omap_mmc_init(0, 0, 0, -1, -1);
82 omap_mmc_init(1, 0, 0, -1, -1);
Sukumar Ghorai084c4c12010-09-18 20:59:54 -070083 return 0;
84}
Paul Kocialkowskifbf1b082016-02-27 19:18:52 +010085
Jean-Jacques Hiblotd5abcf92017-02-01 11:39:14 +010086#if !defined(CONFIG_SPL_BUILD)
Paul Kocialkowskifbf1b082016-02-27 19:18:52 +010087void board_mmc_power_init(void)
88{
89 twl6030_power_mmc_init(0);
90 twl6030_power_mmc_init(1);
91}
Sukumar Ghorai084c4c12010-09-18 20:59:54 -070092#endif
Jean-Jacques Hiblotd5abcf92017-02-01 11:39:14 +010093#endif
Sricharan508a58f2011-11-15 09:49:55 -050094
Peter Ujfalusi8812ed92020-06-16 11:03:08 +030095#if defined(CONFIG_SPL_OS_BOOT)
96int spl_start_uboot(void)
97{
98 /* break into full u-boot on 'c' */
99 if (serial_tstc() && serial_getc() == 'c')
100 return 1;
101
102 return 0;
103}
104#endif /* CONFIG_SPL_OS_BOOT */
105
Sricharan508a58f2011-11-15 09:49:55 -0500106/*
107 * get_board_rev() - get board revision
108 */
109u32 get_board_rev(void)
110{
111 return 0x20;
112}