blob: 69726eb9ce0f3002c777352d6a68cfafd06b3c40 [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>
Simon Glass401d1c42020-10-30 21:38:53 -060015#include <asm/global_data.h>
Steve Sakoman3e76d622010-06-08 13:07:46 -070016
Aneesh V469ec1e2011-07-21 09:10:01 -040017#include "sdp4430_mux_data.h"
Steve Sakoman2ad853c2010-07-15 13:43:10 -070018
Steve Sakoman3e76d622010-06-08 13:07:46 -070019DECLARE_GLOBAL_DATA_PTR;
20
21const struct omap_sysinfo sysinfo = {
22 "Board: OMAP4430 SDP\n"
23};
24
25/**
26 * @brief board_init
27 *
28 * @return 0
29 */
30int board_init(void)
31{
Steve Sakoman27952012010-07-15 16:19:16 -040032 gpmc_init();
33
Steve Sakoman3e76d622010-06-08 13:07:46 -070034 gd->bd->bi_boot_params = (0x80000000 + 0x100); /* boot param addr */
35
36 return 0;
37}
38
Masahiro Yamadab75d8dc2020-06-26 15:13:33 +090039int board_eth_init(struct bd_info *bis)
Steve Sakoman3e76d622010-06-08 13:07:46 -070040{
41 return 0;
42}
43
44/**
45 * @brief misc_init_r - Configure SDP board specific configurations
46 * such as power configurations, ethernet initialization as phase2 of
47 * boot sequence
48 *
49 * @return 0
50 */
51int misc_init_r(void)
52{
Balaji T K3e664f62010-11-25 16:22:04 +053053#ifdef CONFIG_TWL6030_POWER
54 twl6030_init_battery_charging();
55#endif
Steve Sakoman3e76d622010-06-08 13:07:46 -070056 return 0;
57}
Steve Sakoman2ad853c2010-07-15 13:43:10 -070058
Paul Kocialkowski3ef56e62016-02-27 19:18:56 +010059void set_muxconf_regs(void)
Sricharan508a58f2011-11-15 09:49:55 -050060{
Lokesh Vutla9239f5b2013-05-30 02:54:30 +000061 do_set_mux((*ctrl)->control_padconf_core_base,
62 core_padconf_array_essential,
Sricharan508a58f2011-11-15 09:49:55 -050063 sizeof(core_padconf_array_essential) /
64 sizeof(struct pad_conf_entry));
65
Lokesh Vutla9239f5b2013-05-30 02:54:30 +000066 do_set_mux((*ctrl)->control_padconf_wkup_base,
67 wkup_padconf_array_essential,
Sricharan508a58f2011-11-15 09:49:55 -050068 sizeof(wkup_padconf_array_essential) /
69 sizeof(struct pad_conf_entry));
70
Taras Kondratiuke633ac02013-08-06 15:18:51 +030071 if ((omap_revision() >= OMAP4460_ES1_0) &&
72 (omap_revision() < OMAP4470_ES1_0))
Lokesh Vutla9239f5b2013-05-30 02:54:30 +000073 do_set_mux((*ctrl)->control_padconf_wkup_base,
Sricharan508a58f2011-11-15 09:49:55 -050074 wkup_padconf_array_essential_4460,
75 sizeof(wkup_padconf_array_essential_4460) /
76 sizeof(struct pad_conf_entry));
77}
78
Masahiro Yamada4aa2ba32017-05-09 20:31:39 +090079#if defined(CONFIG_MMC)
Masahiro Yamadab75d8dc2020-06-26 15:13:33 +090080int board_mmc_init(struct bd_info *bis)
Sukumar Ghorai084c4c12010-09-18 20:59:54 -070081{
Nikita Kiryanove3913f52012-12-03 02:19:47 +000082 omap_mmc_init(0, 0, 0, -1, -1);
83 omap_mmc_init(1, 0, 0, -1, -1);
Sukumar Ghorai084c4c12010-09-18 20:59:54 -070084 return 0;
85}
Paul Kocialkowskifbf1b082016-02-27 19:18:52 +010086
Jean-Jacques Hiblotd5abcf92017-02-01 11:39:14 +010087#if !defined(CONFIG_SPL_BUILD)
Paul Kocialkowskifbf1b082016-02-27 19:18:52 +010088void board_mmc_power_init(void)
89{
90 twl6030_power_mmc_init(0);
91 twl6030_power_mmc_init(1);
92}
Sukumar Ghorai084c4c12010-09-18 20:59:54 -070093#endif
Jean-Jacques Hiblotd5abcf92017-02-01 11:39:14 +010094#endif
Sricharan508a58f2011-11-15 09:49:55 -050095
Peter Ujfalusi8812ed92020-06-16 11:03:08 +030096#if defined(CONFIG_SPL_OS_BOOT)
97int spl_start_uboot(void)
98{
99 /* break into full u-boot on 'c' */
100 if (serial_tstc() && serial_getc() == 'c')
101 return 1;
102
103 return 0;
104}
105#endif /* CONFIG_SPL_OS_BOOT */
106
Tom Rini97744622021-08-30 09:16:30 -0400107#ifdef CONFIG_REVISION_TAG
Sricharan508a58f2011-11-15 09:49:55 -0500108/*
109 * get_board_rev() - get board revision
110 */
111u32 get_board_rev(void)
112{
113 return 0x20;
114}
Tom Rini97744622021-08-30 09:16:30 -0400115#endif