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> |
Simon Glass | 691d719 | 2020-05-10 11:40:02 -0600 | [diff] [blame] | 9 | #include <init.h> |
Simon Glass | 90526e9 | 2020-05-10 11:39:56 -0600 | [diff] [blame] | 10 | #include <net.h> |
Balaji T K | 3e664f6 | 2010-11-25 16:22:04 +0530 | [diff] [blame] | 11 | #include <twl6030.h> |
Peter Ujfalusi | 8812ed9 | 2020-06-16 11:03:08 +0300 | [diff] [blame] | 12 | #include <serial.h> |
Steve Sakoman | 3e76d62 | 2010-06-08 13:07:46 -0700 | [diff] [blame] | 13 | #include <asm/arch/sys_proto.h> |
Sukumar Ghorai | 084c4c1 | 2010-09-18 20:59:54 -0700 | [diff] [blame] | 14 | #include <asm/arch/mmc_host_def.h> |
Simon Glass | 401d1c4 | 2020-10-30 21:38:53 -0600 | [diff] [blame] | 15 | #include <asm/global_data.h> |
Steve Sakoman | 3e76d62 | 2010-06-08 13:07:46 -0700 | [diff] [blame] | 16 | |
Aneesh V | 469ec1e | 2011-07-21 09:10:01 -0400 | [diff] [blame] | 17 | #include "sdp4430_mux_data.h" |
Steve Sakoman | 2ad853c | 2010-07-15 13:43:10 -0700 | [diff] [blame] | 18 | |
Steve Sakoman | 3e76d62 | 2010-06-08 13:07:46 -0700 | [diff] [blame] | 19 | DECLARE_GLOBAL_DATA_PTR; |
| 20 | |
| 21 | const struct omap_sysinfo sysinfo = { |
| 22 | "Board: OMAP4430 SDP\n" |
| 23 | }; |
| 24 | |
| 25 | /** |
| 26 | * @brief board_init |
| 27 | * |
Heinrich Schuchardt | 185f812 | 2022-01-19 18:05:50 +0100 | [diff] [blame] | 28 | * Return: 0 |
Steve Sakoman | 3e76d62 | 2010-06-08 13:07:46 -0700 | [diff] [blame] | 29 | */ |
| 30 | int board_init(void) |
| 31 | { |
Steve Sakoman | 2795201 | 2010-07-15 16:19:16 -0400 | [diff] [blame] | 32 | gpmc_init(); |
| 33 | |
Steve Sakoman | 3e76d62 | 2010-06-08 13:07:46 -0700 | [diff] [blame] | 34 | gd->bd->bi_boot_params = (0x80000000 + 0x100); /* boot param addr */ |
| 35 | |
| 36 | return 0; |
| 37 | } |
| 38 | |
Masahiro Yamada | b75d8dc | 2020-06-26 15:13:33 +0900 | [diff] [blame] | 39 | int board_eth_init(struct bd_info *bis) |
Steve Sakoman | 3e76d62 | 2010-06-08 13:07:46 -0700 | [diff] [blame] | 40 | { |
| 41 | return 0; |
| 42 | } |
| 43 | |
| 44 | /** |
| 45 | * @brief misc_init_r - Configure SDP board specific configurations |
| 46 | * such as power configurations, ethernet initialization as phase2 of |
| 47 | * boot sequence |
| 48 | * |
Heinrich Schuchardt | 185f812 | 2022-01-19 18:05:50 +0100 | [diff] [blame] | 49 | * Return: 0 |
Steve Sakoman | 3e76d62 | 2010-06-08 13:07:46 -0700 | [diff] [blame] | 50 | */ |
| 51 | int misc_init_r(void) |
| 52 | { |
Balaji T K | 3e664f6 | 2010-11-25 16:22:04 +0530 | [diff] [blame] | 53 | #ifdef CONFIG_TWL6030_POWER |
| 54 | twl6030_init_battery_charging(); |
| 55 | #endif |
Steve Sakoman | 3e76d62 | 2010-06-08 13:07:46 -0700 | [diff] [blame] | 56 | return 0; |
| 57 | } |
Steve Sakoman | 2ad853c | 2010-07-15 13:43:10 -0700 | [diff] [blame] | 58 | |
Paul Kocialkowski | 3ef56e6 | 2016-02-27 19:18:56 +0100 | [diff] [blame] | 59 | void set_muxconf_regs(void) |
Sricharan | 508a58f | 2011-11-15 09:49:55 -0500 | [diff] [blame] | 60 | { |
Lokesh Vutla | 9239f5b | 2013-05-30 02:54:30 +0000 | [diff] [blame] | 61 | do_set_mux((*ctrl)->control_padconf_core_base, |
| 62 | core_padconf_array_essential, |
Sricharan | 508a58f | 2011-11-15 09:49:55 -0500 | [diff] [blame] | 63 | sizeof(core_padconf_array_essential) / |
| 64 | sizeof(struct pad_conf_entry)); |
| 65 | |
Lokesh Vutla | 9239f5b | 2013-05-30 02:54:30 +0000 | [diff] [blame] | 66 | do_set_mux((*ctrl)->control_padconf_wkup_base, |
| 67 | wkup_padconf_array_essential, |
Sricharan | 508a58f | 2011-11-15 09:49:55 -0500 | [diff] [blame] | 68 | sizeof(wkup_padconf_array_essential) / |
| 69 | sizeof(struct pad_conf_entry)); |
| 70 | |
Taras Kondratiuk | e633ac0 | 2013-08-06 15:18:51 +0300 | [diff] [blame] | 71 | if ((omap_revision() >= OMAP4460_ES1_0) && |
| 72 | (omap_revision() < OMAP4470_ES1_0)) |
Lokesh Vutla | 9239f5b | 2013-05-30 02:54:30 +0000 | [diff] [blame] | 73 | do_set_mux((*ctrl)->control_padconf_wkup_base, |
Sricharan | 508a58f | 2011-11-15 09:49:55 -0500 | [diff] [blame] | 74 | wkup_padconf_array_essential_4460, |
| 75 | sizeof(wkup_padconf_array_essential_4460) / |
| 76 | sizeof(struct pad_conf_entry)); |
| 77 | } |
| 78 | |
Masahiro Yamada | 4aa2ba3 | 2017-05-09 20:31:39 +0900 | [diff] [blame] | 79 | #if defined(CONFIG_MMC) |
Masahiro Yamada | b75d8dc | 2020-06-26 15:13:33 +0900 | [diff] [blame] | 80 | int board_mmc_init(struct bd_info *bis) |
Sukumar Ghorai | 084c4c1 | 2010-09-18 20:59:54 -0700 | [diff] [blame] | 81 | { |
Nikita Kiryanov | e3913f5 | 2012-12-03 02:19:47 +0000 | [diff] [blame] | 82 | omap_mmc_init(0, 0, 0, -1, -1); |
| 83 | omap_mmc_init(1, 0, 0, -1, -1); |
Sukumar Ghorai | 084c4c1 | 2010-09-18 20:59:54 -0700 | [diff] [blame] | 84 | return 0; |
| 85 | } |
Paul Kocialkowski | fbf1b08 | 2016-02-27 19:18:52 +0100 | [diff] [blame] | 86 | |
Jean-Jacques Hiblot | d5abcf9 | 2017-02-01 11:39:14 +0100 | [diff] [blame] | 87 | #if !defined(CONFIG_SPL_BUILD) |
Paul Kocialkowski | fbf1b08 | 2016-02-27 19:18:52 +0100 | [diff] [blame] | 88 | void board_mmc_power_init(void) |
| 89 | { |
| 90 | twl6030_power_mmc_init(0); |
| 91 | twl6030_power_mmc_init(1); |
| 92 | } |
Sukumar Ghorai | 084c4c1 | 2010-09-18 20:59:54 -0700 | [diff] [blame] | 93 | #endif |
Jean-Jacques Hiblot | d5abcf9 | 2017-02-01 11:39:14 +0100 | [diff] [blame] | 94 | #endif |
Sricharan | 508a58f | 2011-11-15 09:49:55 -0500 | [diff] [blame] | 95 | |
Peter Ujfalusi | 8812ed9 | 2020-06-16 11:03:08 +0300 | [diff] [blame] | 96 | #if defined(CONFIG_SPL_OS_BOOT) |
| 97 | int spl_start_uboot(void) |
| 98 | { |
| 99 | /* break into full u-boot on 'c' */ |
| 100 | if (serial_tstc() && serial_getc() == 'c') |
| 101 | return 1; |
| 102 | |
| 103 | return 0; |
| 104 | } |
| 105 | #endif /* CONFIG_SPL_OS_BOOT */ |
| 106 | |
Tom Rini | 9774462 | 2021-08-30 09:16:30 -0400 | [diff] [blame] | 107 | #ifdef CONFIG_REVISION_TAG |
Sricharan | 508a58f | 2011-11-15 09:49:55 -0500 | [diff] [blame] | 108 | /* |
| 109 | * get_board_rev() - get board revision |
| 110 | */ |
| 111 | u32 get_board_rev(void) |
| 112 | { |
| 113 | return 0x20; |
| 114 | } |
Tom Rini | 9774462 | 2021-08-30 09:16:30 -0400 | [diff] [blame] | 115 | #endif |