Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Steve Sakoman | 1b3dd5d | 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 | 1b3dd5d | 2010-06-08 13:07:46 -0700 | [diff] [blame] | 7 | */ |
| 8 | #include <common.h> |
Simon Glass | 9758973 | 2020-05-10 11:40:02 -0600 | [diff] [blame] | 9 | #include <init.h> |
Simon Glass | 274e0b0 | 2020-05-10 11:39:56 -0600 | [diff] [blame] | 10 | #include <net.h> |
Balaji T K | 13c3c50 | 2010-11-25 16:22:04 +0530 | [diff] [blame] | 11 | #include <twl6030.h> |
Peter Ujfalusi | 532c0b5 | 2020-06-16 11:03:08 +0300 | [diff] [blame] | 12 | #include <serial.h> |
Steve Sakoman | 1b3dd5d | 2010-06-08 13:07:46 -0700 | [diff] [blame] | 13 | #include <asm/arch/sys_proto.h> |
Sukumar Ghorai | 7d99f69 | 2010-09-18 20:59:54 -0700 | [diff] [blame] | 14 | #include <asm/arch/mmc_host_def.h> |
Steve Sakoman | 1b3dd5d | 2010-06-08 13:07:46 -0700 | [diff] [blame] | 15 | |
Aneesh V | f908b63 | 2011-07-21 09:10:01 -0400 | [diff] [blame] | 16 | #include "sdp4430_mux_data.h" |
Steve Sakoman | 9bb65b5 | 2010-07-15 13:43:10 -0700 | [diff] [blame] | 17 | |
Steve Sakoman | 1b3dd5d | 2010-06-08 13:07:46 -0700 | [diff] [blame] | 18 | DECLARE_GLOBAL_DATA_PTR; |
| 19 | |
| 20 | const struct omap_sysinfo sysinfo = { |
| 21 | "Board: OMAP4430 SDP\n" |
| 22 | }; |
| 23 | |
| 24 | /** |
| 25 | * @brief board_init |
| 26 | * |
| 27 | * @return 0 |
| 28 | */ |
| 29 | int board_init(void) |
| 30 | { |
Steve Sakoman | 9b8ea4e | 2010-07-15 16:19:16 -0400 | [diff] [blame] | 31 | gpmc_init(); |
| 32 | |
Steve Sakoman | 1b3dd5d | 2010-06-08 13:07:46 -0700 | [diff] [blame] | 33 | gd->bd->bi_boot_params = (0x80000000 + 0x100); /* boot param addr */ |
| 34 | |
| 35 | return 0; |
| 36 | } |
| 37 | |
Masahiro Yamada | f7ed78b | 2020-06-26 15:13:33 +0900 | [diff] [blame^] | 38 | int board_eth_init(struct bd_info *bis) |
Steve Sakoman | 1b3dd5d | 2010-06-08 13:07:46 -0700 | [diff] [blame] | 39 | { |
| 40 | return 0; |
| 41 | } |
| 42 | |
| 43 | /** |
| 44 | * @brief misc_init_r - Configure SDP board specific configurations |
| 45 | * such as power configurations, ethernet initialization as phase2 of |
| 46 | * boot sequence |
| 47 | * |
| 48 | * @return 0 |
| 49 | */ |
| 50 | int misc_init_r(void) |
| 51 | { |
Balaji T K | 13c3c50 | 2010-11-25 16:22:04 +0530 | [diff] [blame] | 52 | #ifdef CONFIG_TWL6030_POWER |
| 53 | twl6030_init_battery_charging(); |
| 54 | #endif |
Steve Sakoman | 1b3dd5d | 2010-06-08 13:07:46 -0700 | [diff] [blame] | 55 | return 0; |
| 56 | } |
Steve Sakoman | 9bb65b5 | 2010-07-15 13:43:10 -0700 | [diff] [blame] | 57 | |
Paul Kocialkowski | a00b1e5 | 2016-02-27 19:18:56 +0100 | [diff] [blame] | 58 | void set_muxconf_regs(void) |
Sricharan | 9310ff7 | 2011-11-15 09:49:55 -0500 | [diff] [blame] | 59 | { |
Lokesh Vutla | 37bce59 | 2013-05-30 02:54:30 +0000 | [diff] [blame] | 60 | do_set_mux((*ctrl)->control_padconf_core_base, |
| 61 | core_padconf_array_essential, |
Sricharan | 9310ff7 | 2011-11-15 09:49:55 -0500 | [diff] [blame] | 62 | sizeof(core_padconf_array_essential) / |
| 63 | sizeof(struct pad_conf_entry)); |
| 64 | |
Lokesh Vutla | 37bce59 | 2013-05-30 02:54:30 +0000 | [diff] [blame] | 65 | do_set_mux((*ctrl)->control_padconf_wkup_base, |
| 66 | wkup_padconf_array_essential, |
Sricharan | 9310ff7 | 2011-11-15 09:49:55 -0500 | [diff] [blame] | 67 | sizeof(wkup_padconf_array_essential) / |
| 68 | sizeof(struct pad_conf_entry)); |
| 69 | |
Taras Kondratiuk | 2ae10dc | 2013-08-06 15:18:51 +0300 | [diff] [blame] | 70 | if ((omap_revision() >= OMAP4460_ES1_0) && |
| 71 | (omap_revision() < OMAP4470_ES1_0)) |
Lokesh Vutla | 37bce59 | 2013-05-30 02:54:30 +0000 | [diff] [blame] | 72 | do_set_mux((*ctrl)->control_padconf_wkup_base, |
Sricharan | 9310ff7 | 2011-11-15 09:49:55 -0500 | [diff] [blame] | 73 | wkup_padconf_array_essential_4460, |
| 74 | sizeof(wkup_padconf_array_essential_4460) / |
| 75 | sizeof(struct pad_conf_entry)); |
| 76 | } |
| 77 | |
Masahiro Yamada | 0a78017 | 2017-05-09 20:31:39 +0900 | [diff] [blame] | 78 | #if defined(CONFIG_MMC) |
Masahiro Yamada | f7ed78b | 2020-06-26 15:13:33 +0900 | [diff] [blame^] | 79 | int board_mmc_init(struct bd_info *bis) |
Sukumar Ghorai | 7d99f69 | 2010-09-18 20:59:54 -0700 | [diff] [blame] | 80 | { |
Nikita Kiryanov | 4be9dbc | 2012-12-03 02:19:47 +0000 | [diff] [blame] | 81 | omap_mmc_init(0, 0, 0, -1, -1); |
| 82 | omap_mmc_init(1, 0, 0, -1, -1); |
Sukumar Ghorai | 7d99f69 | 2010-09-18 20:59:54 -0700 | [diff] [blame] | 83 | return 0; |
| 84 | } |
Paul Kocialkowski | 4bbf2b3 | 2016-02-27 19:18:52 +0100 | [diff] [blame] | 85 | |
Jean-Jacques Hiblot | e0e319a | 2017-02-01 11:39:14 +0100 | [diff] [blame] | 86 | #if !defined(CONFIG_SPL_BUILD) |
Paul Kocialkowski | 4bbf2b3 | 2016-02-27 19:18:52 +0100 | [diff] [blame] | 87 | void board_mmc_power_init(void) |
| 88 | { |
| 89 | twl6030_power_mmc_init(0); |
| 90 | twl6030_power_mmc_init(1); |
| 91 | } |
Sukumar Ghorai | 7d99f69 | 2010-09-18 20:59:54 -0700 | [diff] [blame] | 92 | #endif |
Jean-Jacques Hiblot | e0e319a | 2017-02-01 11:39:14 +0100 | [diff] [blame] | 93 | #endif |
Sricharan | 9310ff7 | 2011-11-15 09:49:55 -0500 | [diff] [blame] | 94 | |
Peter Ujfalusi | 532c0b5 | 2020-06-16 11:03:08 +0300 | [diff] [blame] | 95 | #if defined(CONFIG_SPL_OS_BOOT) |
| 96 | int spl_start_uboot(void) |
| 97 | { |
| 98 | /* break into full u-boot on 'c' */ |
| 99 | if (serial_tstc() && serial_getc() == 'c') |
| 100 | return 1; |
| 101 | |
| 102 | return 0; |
| 103 | } |
| 104 | #endif /* CONFIG_SPL_OS_BOOT */ |
| 105 | |
Sricharan | 9310ff7 | 2011-11-15 09:49:55 -0500 | [diff] [blame] | 106 | /* |
| 107 | * get_board_rev() - get board revision |
| 108 | */ |
| 109 | u32 get_board_rev(void) |
| 110 | { |
| 111 | return 0x20; |
| 112 | } |