Steve Sakoman | 1b3dd5d | 2010-06-08 13:07:46 -0700 | [diff] [blame] | 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 | * |
Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 7 | * SPDX-License-Identifier: GPL-2.0+ |
Steve Sakoman | 1b3dd5d | 2010-06-08 13:07:46 -0700 | [diff] [blame] | 8 | */ |
| 9 | #include <common.h> |
Balaji T K | 13c3c50 | 2010-11-25 16:22:04 +0530 | [diff] [blame] | 10 | #include <twl6030.h> |
Steve Sakoman | 1b3dd5d | 2010-06-08 13:07:46 -0700 | [diff] [blame] | 11 | #include <asm/arch/sys_proto.h> |
Sukumar Ghorai | 7d99f69 | 2010-09-18 20:59:54 -0700 | [diff] [blame] | 12 | #include <asm/arch/mmc_host_def.h> |
Steve Sakoman | 1b3dd5d | 2010-06-08 13:07:46 -0700 | [diff] [blame] | 13 | |
Aneesh V | f908b63 | 2011-07-21 09:10:01 -0400 | [diff] [blame] | 14 | #include "sdp4430_mux_data.h" |
Steve Sakoman | 9bb65b5 | 2010-07-15 13:43:10 -0700 | [diff] [blame] | 15 | |
Steve Sakoman | 1b3dd5d | 2010-06-08 13:07:46 -0700 | [diff] [blame] | 16 | DECLARE_GLOBAL_DATA_PTR; |
| 17 | |
| 18 | const struct omap_sysinfo sysinfo = { |
| 19 | "Board: OMAP4430 SDP\n" |
| 20 | }; |
| 21 | |
| 22 | /** |
| 23 | * @brief board_init |
| 24 | * |
| 25 | * @return 0 |
| 26 | */ |
| 27 | int board_init(void) |
| 28 | { |
Steve Sakoman | 9b8ea4e | 2010-07-15 16:19:16 -0400 | [diff] [blame] | 29 | gpmc_init(); |
| 30 | |
Steve Sakoman | 1b3dd5d | 2010-06-08 13:07:46 -0700 | [diff] [blame] | 31 | gd->bd->bi_boot_params = (0x80000000 + 0x100); /* boot param addr */ |
| 32 | |
| 33 | return 0; |
| 34 | } |
| 35 | |
| 36 | int 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 | */ |
| 48 | int misc_init_r(void) |
| 49 | { |
Balaji T K | 13c3c50 | 2010-11-25 16:22:04 +0530 | [diff] [blame] | 50 | #ifdef CONFIG_TWL6030_POWER |
| 51 | twl6030_init_battery_charging(); |
| 52 | #endif |
Steve Sakoman | 1b3dd5d | 2010-06-08 13:07:46 -0700 | [diff] [blame] | 53 | return 0; |
| 54 | } |
Steve Sakoman | 9bb65b5 | 2010-07-15 13:43:10 -0700 | [diff] [blame] | 55 | |
Sricharan | 9310ff7 | 2011-11-15 09:49:55 -0500 | [diff] [blame] | 56 | void set_muxconf_regs_essential(void) |
| 57 | { |
Lokesh Vutla | 37bce59 | 2013-05-30 02:54:30 +0000 | [diff] [blame] | 58 | do_set_mux((*ctrl)->control_padconf_core_base, |
| 59 | core_padconf_array_essential, |
Sricharan | 9310ff7 | 2011-11-15 09:49:55 -0500 | [diff] [blame] | 60 | sizeof(core_padconf_array_essential) / |
| 61 | sizeof(struct pad_conf_entry)); |
| 62 | |
Lokesh Vutla | 37bce59 | 2013-05-30 02:54:30 +0000 | [diff] [blame] | 63 | do_set_mux((*ctrl)->control_padconf_wkup_base, |
| 64 | wkup_padconf_array_essential, |
Sricharan | 9310ff7 | 2011-11-15 09:49:55 -0500 | [diff] [blame] | 65 | sizeof(wkup_padconf_array_essential) / |
| 66 | sizeof(struct pad_conf_entry)); |
| 67 | |
Taras Kondratiuk | 2ae10dc | 2013-08-06 15:18:51 +0300 | [diff] [blame] | 68 | if ((omap_revision() >= OMAP4460_ES1_0) && |
| 69 | (omap_revision() < OMAP4470_ES1_0)) |
Lokesh Vutla | 37bce59 | 2013-05-30 02:54:30 +0000 | [diff] [blame] | 70 | do_set_mux((*ctrl)->control_padconf_wkup_base, |
Sricharan | 9310ff7 | 2011-11-15 09:49:55 -0500 | [diff] [blame] | 71 | wkup_padconf_array_essential_4460, |
| 72 | sizeof(wkup_padconf_array_essential_4460) / |
| 73 | sizeof(struct pad_conf_entry)); |
| 74 | } |
| 75 | |
Aneesh V | f908b63 | 2011-07-21 09:10:01 -0400 | [diff] [blame] | 76 | void set_muxconf_regs_non_essential(void) |
Steve Sakoman | 9bb65b5 | 2010-07-15 13:43:10 -0700 | [diff] [blame] | 77 | { |
Lokesh Vutla | 37bce59 | 2013-05-30 02:54:30 +0000 | [diff] [blame] | 78 | do_set_mux((*ctrl)->control_padconf_core_base, |
| 79 | core_padconf_array_non_essential, |
Aneesh V | f908b63 | 2011-07-21 09:10:01 -0400 | [diff] [blame] | 80 | sizeof(core_padconf_array_non_essential) / |
Steve Sakoman | 9bb65b5 | 2010-07-15 13:43:10 -0700 | [diff] [blame] | 81 | sizeof(struct pad_conf_entry)); |
| 82 | |
Lokesh Vutla | 37bce59 | 2013-05-30 02:54:30 +0000 | [diff] [blame] | 83 | do_set_mux((*ctrl)->control_padconf_wkup_base, |
| 84 | wkup_padconf_array_non_essential, |
Aneesh V | f908b63 | 2011-07-21 09:10:01 -0400 | [diff] [blame] | 85 | sizeof(wkup_padconf_array_non_essential) / |
Steve Sakoman | 9bb65b5 | 2010-07-15 13:43:10 -0700 | [diff] [blame] | 86 | sizeof(struct pad_conf_entry)); |
Aneesh V | fb4368d | 2011-11-21 23:39:00 +0000 | [diff] [blame] | 87 | |
| 88 | if (omap_revision() < OMAP4460_ES1_0) { |
Lokesh Vutla | 37bce59 | 2013-05-30 02:54:30 +0000 | [diff] [blame] | 89 | do_set_mux((*ctrl)->control_padconf_wkup_base, |
Aneesh V | fb4368d | 2011-11-21 23:39:00 +0000 | [diff] [blame] | 90 | wkup_padconf_array_non_essential_4430, |
| 91 | sizeof(wkup_padconf_array_non_essential_4430) / |
| 92 | sizeof(struct pad_conf_entry)); |
| 93 | } |
Steve Sakoman | 9bb65b5 | 2010-07-15 13:43:10 -0700 | [diff] [blame] | 94 | } |
Sukumar Ghorai | 7d99f69 | 2010-09-18 20:59:54 -0700 | [diff] [blame] | 95 | |
Sricharan | 9310ff7 | 2011-11-15 09:49:55 -0500 | [diff] [blame] | 96 | #if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_GENERIC_MMC) |
Sukumar Ghorai | 7d99f69 | 2010-09-18 20:59:54 -0700 | [diff] [blame] | 97 | int board_mmc_init(bd_t *bis) |
| 98 | { |
Nikita Kiryanov | 4be9dbc | 2012-12-03 02:19:47 +0000 | [diff] [blame] | 99 | omap_mmc_init(0, 0, 0, -1, -1); |
| 100 | omap_mmc_init(1, 0, 0, -1, -1); |
Sukumar Ghorai | 7d99f69 | 2010-09-18 20:59:54 -0700 | [diff] [blame] | 101 | return 0; |
| 102 | } |
| 103 | #endif |
Sricharan | 9310ff7 | 2011-11-15 09:49:55 -0500 | [diff] [blame] | 104 | |
| 105 | /* |
| 106 | * get_board_rev() - get board revision |
| 107 | */ |
| 108 | u32 get_board_rev(void) |
| 109 | { |
| 110 | return 0x20; |
| 111 | } |