]> git.ipfire.org Git - people/ms/u-boot.git/blame - board/ti/sdp4430/sdp.c
Add GPL-2.0+ SPDX-License-Identifier to source files
[people/ms/u-boot.git] / board / ti / sdp4430 / sdp.c
CommitLineData
3e76d62a
SS
1/*
2 * (C) Copyright 2010
3 * Texas Instruments Incorporated, <www.ti.com>
4 * Aneesh V <aneesh@ti.com>
5 * Steve Sakoman <steve@sakoman.com>
6 *
1a459660 7 * SPDX-License-Identifier: GPL-2.0+
3e76d62a
SS
8 */
9#include <common.h>
3e664f6d 10#include <twl6030.h>
3e76d62a 11#include <asm/arch/sys_proto.h>
084c4c1b 12#include <asm/arch/mmc_host_def.h>
3e76d62a 13
469ec1e3 14#include "sdp4430_mux_data.h"
2ad853c3 15
3e76d62a
SS
16DECLARE_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{
27952014
SS
29 gpmc_init();
30
3e76d62a
SS
31 gd->bd->bi_arch_number = MACH_TYPE_OMAP_4430SDP;
32 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{
3e664f6d
B
51#ifdef CONFIG_TWL6030_POWER
52 twl6030_init_battery_charging();
53#endif
3e76d62a
SS
54 return 0;
55}
2ad853c3 56
508a58fa
S
57void set_muxconf_regs_essential(void)
58{
9239f5b6
LV
59 do_set_mux((*ctrl)->control_padconf_core_base,
60 core_padconf_array_essential,
508a58fa
S
61 sizeof(core_padconf_array_essential) /
62 sizeof(struct pad_conf_entry));
63
9239f5b6
LV
64 do_set_mux((*ctrl)->control_padconf_wkup_base,
65 wkup_padconf_array_essential,
508a58fa
S
66 sizeof(wkup_padconf_array_essential) /
67 sizeof(struct pad_conf_entry));
68
69 if (omap_revision() >= OMAP4460_ES1_0)
9239f5b6 70 do_set_mux((*ctrl)->control_padconf_wkup_base,
508a58fa
S
71 wkup_padconf_array_essential_4460,
72 sizeof(wkup_padconf_array_essential_4460) /
73 sizeof(struct pad_conf_entry));
74}
75
469ec1e3 76void set_muxconf_regs_non_essential(void)
2ad853c3 77{
9239f5b6
LV
78 do_set_mux((*ctrl)->control_padconf_core_base,
79 core_padconf_array_non_essential,
469ec1e3 80 sizeof(core_padconf_array_non_essential) /
2ad853c3
SS
81 sizeof(struct pad_conf_entry));
82
9239f5b6
LV
83 do_set_mux((*ctrl)->control_padconf_wkup_base,
84 wkup_padconf_array_non_essential,
469ec1e3 85 sizeof(wkup_padconf_array_non_essential) /
2ad853c3 86 sizeof(struct pad_conf_entry));
cd5847ac
A
87
88 if (omap_revision() < OMAP4460_ES1_0) {
9239f5b6 89 do_set_mux((*ctrl)->control_padconf_wkup_base,
cd5847ac
A
90 wkup_padconf_array_non_essential_4430,
91 sizeof(wkup_padconf_array_non_essential_4430) /
92 sizeof(struct pad_conf_entry));
93 }
2ad853c3 94}
084c4c1b 95
508a58fa 96#if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_GENERIC_MMC)
084c4c1b
SG
97int board_mmc_init(bd_t *bis)
98{
e3913f56
NK
99 omap_mmc_init(0, 0, 0, -1, -1);
100 omap_mmc_init(1, 0, 0, -1, -1);
084c4c1b
SG
101 return 0;
102}
103#endif
508a58fa
S
104
105/*
106 * get_board_rev() - get board revision
107 */
108u32 get_board_rev(void)
109{
110 return 0x20;
111}