Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Steve Sakoman | 3e76d62 | 2010-06-08 13:07:46 -0700 | [diff] [blame] | 2 | /* |
| 3 | * (C) Copyright 2010 |
| 4 | * Texas Instruments Incorporated, <www.ti.com> |
| 5 | * Aneesh V <aneesh@ti.com> |
| 6 | * Steve Sakoman <steve@sakoman.com> |
Steve Sakoman | 3e76d62 | 2010-06-08 13:07:46 -0700 | [diff] [blame] | 7 | */ |
| 8 | #include <common.h> |
Balaji T K | 3e664f6 | 2010-11-25 16:22:04 +0530 | [diff] [blame] | 9 | #include <twl6030.h> |
Steve Sakoman | 3e76d62 | 2010-06-08 13:07:46 -0700 | [diff] [blame] | 10 | #include <asm/arch/sys_proto.h> |
Sukumar Ghorai | 084c4c1 | 2010-09-18 20:59:54 -0700 | [diff] [blame] | 11 | #include <asm/arch/mmc_host_def.h> |
Steve Sakoman | 3e76d62 | 2010-06-08 13:07:46 -0700 | [diff] [blame] | 12 | |
Aneesh V | 469ec1e | 2011-07-21 09:10:01 -0400 | [diff] [blame] | 13 | #include "sdp4430_mux_data.h" |
Steve Sakoman | 2ad853c | 2010-07-15 13:43:10 -0700 | [diff] [blame] | 14 | |
Steve Sakoman | 3e76d62 | 2010-06-08 13:07:46 -0700 | [diff] [blame] | 15 | DECLARE_GLOBAL_DATA_PTR; |
| 16 | |
| 17 | const struct omap_sysinfo sysinfo = { |
| 18 | "Board: OMAP4430 SDP\n" |
| 19 | }; |
| 20 | |
| 21 | /** |
| 22 | * @brief board_init |
| 23 | * |
| 24 | * @return 0 |
| 25 | */ |
| 26 | int board_init(void) |
| 27 | { |
Steve Sakoman | 2795201 | 2010-07-15 16:19:16 -0400 | [diff] [blame] | 28 | gpmc_init(); |
| 29 | |
Steve Sakoman | 3e76d62 | 2010-06-08 13:07:46 -0700 | [diff] [blame] | 30 | gd->bd->bi_boot_params = (0x80000000 + 0x100); /* boot param addr */ |
| 31 | |
| 32 | return 0; |
| 33 | } |
| 34 | |
| 35 | int board_eth_init(bd_t *bis) |
| 36 | { |
| 37 | return 0; |
| 38 | } |
| 39 | |
| 40 | /** |
| 41 | * @brief misc_init_r - Configure SDP board specific configurations |
| 42 | * such as power configurations, ethernet initialization as phase2 of |
| 43 | * boot sequence |
| 44 | * |
| 45 | * @return 0 |
| 46 | */ |
| 47 | int misc_init_r(void) |
| 48 | { |
Balaji T K | 3e664f6 | 2010-11-25 16:22:04 +0530 | [diff] [blame] | 49 | #ifdef CONFIG_TWL6030_POWER |
| 50 | twl6030_init_battery_charging(); |
| 51 | #endif |
Steve Sakoman | 3e76d62 | 2010-06-08 13:07:46 -0700 | [diff] [blame] | 52 | return 0; |
| 53 | } |
Steve Sakoman | 2ad853c | 2010-07-15 13:43:10 -0700 | [diff] [blame] | 54 | |
Paul Kocialkowski | 3ef56e6 | 2016-02-27 19:18:56 +0100 | [diff] [blame] | 55 | void set_muxconf_regs(void) |
Sricharan | 508a58f | 2011-11-15 09:49:55 -0500 | [diff] [blame] | 56 | { |
Lokesh Vutla | 9239f5b | 2013-05-30 02:54:30 +0000 | [diff] [blame] | 57 | do_set_mux((*ctrl)->control_padconf_core_base, |
| 58 | core_padconf_array_essential, |
Sricharan | 508a58f | 2011-11-15 09:49:55 -0500 | [diff] [blame] | 59 | sizeof(core_padconf_array_essential) / |
| 60 | sizeof(struct pad_conf_entry)); |
| 61 | |
Lokesh Vutla | 9239f5b | 2013-05-30 02:54:30 +0000 | [diff] [blame] | 62 | do_set_mux((*ctrl)->control_padconf_wkup_base, |
| 63 | wkup_padconf_array_essential, |
Sricharan | 508a58f | 2011-11-15 09:49:55 -0500 | [diff] [blame] | 64 | sizeof(wkup_padconf_array_essential) / |
| 65 | sizeof(struct pad_conf_entry)); |
| 66 | |
Taras Kondratiuk | e633ac0 | 2013-08-06 15:18:51 +0300 | [diff] [blame] | 67 | if ((omap_revision() >= OMAP4460_ES1_0) && |
| 68 | (omap_revision() < OMAP4470_ES1_0)) |
Lokesh Vutla | 9239f5b | 2013-05-30 02:54:30 +0000 | [diff] [blame] | 69 | do_set_mux((*ctrl)->control_padconf_wkup_base, |
Sricharan | 508a58f | 2011-11-15 09:49:55 -0500 | [diff] [blame] | 70 | wkup_padconf_array_essential_4460, |
| 71 | sizeof(wkup_padconf_array_essential_4460) / |
| 72 | sizeof(struct pad_conf_entry)); |
| 73 | } |
| 74 | |
Masahiro Yamada | 4aa2ba3 | 2017-05-09 20:31:39 +0900 | [diff] [blame] | 75 | #if defined(CONFIG_MMC) |
Sukumar Ghorai | 084c4c1 | 2010-09-18 20:59:54 -0700 | [diff] [blame] | 76 | int board_mmc_init(bd_t *bis) |
| 77 | { |
Nikita Kiryanov | e3913f5 | 2012-12-03 02:19:47 +0000 | [diff] [blame] | 78 | omap_mmc_init(0, 0, 0, -1, -1); |
| 79 | omap_mmc_init(1, 0, 0, -1, -1); |
Sukumar Ghorai | 084c4c1 | 2010-09-18 20:59:54 -0700 | [diff] [blame] | 80 | return 0; |
| 81 | } |
Paul Kocialkowski | fbf1b08 | 2016-02-27 19:18:52 +0100 | [diff] [blame] | 82 | |
Jean-Jacques Hiblot | d5abcf9 | 2017-02-01 11:39:14 +0100 | [diff] [blame] | 83 | #if !defined(CONFIG_SPL_BUILD) |
Paul Kocialkowski | fbf1b08 | 2016-02-27 19:18:52 +0100 | [diff] [blame] | 84 | void board_mmc_power_init(void) |
| 85 | { |
| 86 | twl6030_power_mmc_init(0); |
| 87 | twl6030_power_mmc_init(1); |
| 88 | } |
Sukumar Ghorai | 084c4c1 | 2010-09-18 20:59:54 -0700 | [diff] [blame] | 89 | #endif |
Jean-Jacques Hiblot | d5abcf9 | 2017-02-01 11:39:14 +0100 | [diff] [blame] | 90 | #endif |
Sricharan | 508a58f | 2011-11-15 09:49:55 -0500 | [diff] [blame] | 91 | |
| 92 | /* |
| 93 | * get_board_rev() - get board revision |
| 94 | */ |
| 95 | u32 get_board_rev(void) |
| 96 | { |
| 97 | return 0x20; |
| 98 | } |