blob: 79270a9e94e2e2e6a1e85b29d2b6c84ff228dd9a [file] [log] [blame]
Steve Sakoman3e76d622010-06-08 13:07:46 -07001/*
2 * (C) Copyright 2010
3 * Texas Instruments Incorporated, <www.ti.com>
4 * Aneesh V <aneesh@ti.com>
5 * Steve Sakoman <steve@sakoman.com>
6 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02007 * SPDX-License-Identifier: GPL-2.0+
Steve Sakoman3e76d622010-06-08 13:07:46 -07008 */
9#include <common.h>
Balaji T K3e664f62010-11-25 16:22:04 +053010#include <twl6030.h>
Steve Sakoman3e76d622010-06-08 13:07:46 -070011#include <asm/arch/sys_proto.h>
Sukumar Ghorai084c4c12010-09-18 20:59:54 -070012#include <asm/arch/mmc_host_def.h>
Steve Sakoman3e76d622010-06-08 13:07:46 -070013
Aneesh V469ec1e2011-07-21 09:10:01 -040014#include "sdp4430_mux_data.h"
Steve Sakoman2ad853c2010-07-15 13:43:10 -070015
Steve Sakoman3e76d622010-06-08 13:07:46 -070016DECLARE_GLOBAL_DATA_PTR;
17
18const struct omap_sysinfo sysinfo = {
19 "Board: OMAP4430 SDP\n"
20};
21
22/**
23 * @brief board_init
24 *
25 * @return 0
26 */
27int board_init(void)
28{
Steve Sakoman27952012010-07-15 16:19:16 -040029 gpmc_init();
30
Steve Sakoman3e76d622010-06-08 13:07:46 -070031 gd->bd->bi_boot_params = (0x80000000 + 0x100); /* boot param addr */
32
33 return 0;
34}
35
36int board_eth_init(bd_t *bis)
37{
38 return 0;
39}
40
41/**
42 * @brief misc_init_r - Configure SDP board specific configurations
43 * such as power configurations, ethernet initialization as phase2 of
44 * boot sequence
45 *
46 * @return 0
47 */
48int misc_init_r(void)
49{
Balaji T K3e664f62010-11-25 16:22:04 +053050#ifdef CONFIG_TWL6030_POWER
51 twl6030_init_battery_charging();
52#endif
Steve Sakoman3e76d622010-06-08 13:07:46 -070053 return 0;
54}
Steve Sakoman2ad853c2010-07-15 13:43:10 -070055
Sricharan508a58f2011-11-15 09:49:55 -050056void set_muxconf_regs_essential(void)
57{
Lokesh Vutla9239f5b2013-05-30 02:54:30 +000058 do_set_mux((*ctrl)->control_padconf_core_base,
59 core_padconf_array_essential,
Sricharan508a58f2011-11-15 09:49:55 -050060 sizeof(core_padconf_array_essential) /
61 sizeof(struct pad_conf_entry));
62
Lokesh Vutla9239f5b2013-05-30 02:54:30 +000063 do_set_mux((*ctrl)->control_padconf_wkup_base,
64 wkup_padconf_array_essential,
Sricharan508a58f2011-11-15 09:49:55 -050065 sizeof(wkup_padconf_array_essential) /
66 sizeof(struct pad_conf_entry));
67
Taras Kondratiuke633ac02013-08-06 15:18:51 +030068 if ((omap_revision() >= OMAP4460_ES1_0) &&
69 (omap_revision() < OMAP4470_ES1_0))
Lokesh Vutla9239f5b2013-05-30 02:54:30 +000070 do_set_mux((*ctrl)->control_padconf_wkup_base,
Sricharan508a58f2011-11-15 09:49:55 -050071 wkup_padconf_array_essential_4460,
72 sizeof(wkup_padconf_array_essential_4460) /
73 sizeof(struct pad_conf_entry));
74}
75
Aneesh V469ec1e2011-07-21 09:10:01 -040076void set_muxconf_regs_non_essential(void)
Steve Sakoman2ad853c2010-07-15 13:43:10 -070077{
Lokesh Vutla9239f5b2013-05-30 02:54:30 +000078 do_set_mux((*ctrl)->control_padconf_core_base,
79 core_padconf_array_non_essential,
Aneesh V469ec1e2011-07-21 09:10:01 -040080 sizeof(core_padconf_array_non_essential) /
Steve Sakoman2ad853c2010-07-15 13:43:10 -070081 sizeof(struct pad_conf_entry));
82
Lokesh Vutla9239f5b2013-05-30 02:54:30 +000083 do_set_mux((*ctrl)->control_padconf_wkup_base,
84 wkup_padconf_array_non_essential,
Aneesh V469ec1e2011-07-21 09:10:01 -040085 sizeof(wkup_padconf_array_non_essential) /
Steve Sakoman2ad853c2010-07-15 13:43:10 -070086 sizeof(struct pad_conf_entry));
Aneesh Vcd5847a2011-11-21 23:39:00 +000087
88 if (omap_revision() < OMAP4460_ES1_0) {
Lokesh Vutla9239f5b2013-05-30 02:54:30 +000089 do_set_mux((*ctrl)->control_padconf_wkup_base,
Aneesh Vcd5847a2011-11-21 23:39:00 +000090 wkup_padconf_array_non_essential_4430,
91 sizeof(wkup_padconf_array_non_essential_4430) /
92 sizeof(struct pad_conf_entry));
93 }
Steve Sakoman2ad853c2010-07-15 13:43:10 -070094}
Sukumar Ghorai084c4c12010-09-18 20:59:54 -070095
Sricharan508a58f2011-11-15 09:49:55 -050096#if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_GENERIC_MMC)
Sukumar Ghorai084c4c12010-09-18 20:59:54 -070097int board_mmc_init(bd_t *bis)
98{
Nikita Kiryanove3913f52012-12-03 02:19:47 +000099 omap_mmc_init(0, 0, 0, -1, -1);
100 omap_mmc_init(1, 0, 0, -1, -1);
Sukumar Ghorai084c4c12010-09-18 20:59:54 -0700101 return 0;
102}
103#endif
Sricharan508a58f2011-11-15 09:49:55 -0500104
105/*
106 * get_board_rev() - get board revision
107 */
108u32 get_board_rev(void)
109{
110 return 0x20;
111}