Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Steve Sakoman | 1ad2158 | 2010-06-08 13:07:46 -0700 | [diff] [blame] | 2 | /* |
| 3 | * |
Sricharan | 9310ff7 | 2011-11-15 09:49:55 -0500 | [diff] [blame] | 4 | * Common functions for OMAP4/5 based boards |
Steve Sakoman | 1ad2158 | 2010-06-08 13:07:46 -0700 | [diff] [blame] | 5 | * |
| 6 | * (C) Copyright 2010 |
| 7 | * Texas Instruments, <www.ti.com> |
| 8 | * |
| 9 | * Author : |
| 10 | * Aneesh V <aneesh@ti.com> |
| 11 | * Steve Sakoman <steve@sakoman.com> |
Steve Sakoman | 1ad2158 | 2010-06-08 13:07:46 -0700 | [diff] [blame] | 12 | */ |
| 13 | #include <common.h> |
Lokesh Vutla | ac8bd3c | 2017-05-05 13:45:27 +0530 | [diff] [blame] | 14 | #include <debug_uart.h> |
Simon Glass | fc55736 | 2022-03-04 08:43:05 -0700 | [diff] [blame] | 15 | #include <event.h> |
Jean-Jacques Hiblot | 651201b | 2018-12-07 14:50:55 +0100 | [diff] [blame] | 16 | #include <fdtdec.h> |
Simon Glass | 9758973 | 2020-05-10 11:40:02 -0600 | [diff] [blame] | 17 | #include <init.h> |
Tom Rini | 28591df | 2012-08-13 12:03:19 -0700 | [diff] [blame] | 18 | #include <spl.h> |
Steve Sakoman | 1ad2158 | 2010-06-08 13:07:46 -0700 | [diff] [blame] | 19 | #include <asm/arch/sys_proto.h> |
Simon Glass | 3ba929a | 2020-10-30 21:38:53 -0600 | [diff] [blame] | 20 | #include <asm/global_data.h> |
Alexey Brodkin | 267d8e2 | 2014-02-26 17:47:58 +0400 | [diff] [blame] | 21 | #include <linux/sizes.h> |
Sricharan | 62a8650 | 2011-11-15 09:50:00 -0500 | [diff] [blame] | 22 | #include <asm/emif.h> |
SRICHARAN R | fb6aa1f | 2013-02-04 04:22:00 +0000 | [diff] [blame] | 23 | #include <asm/omap_common.h> |
Lokesh Vutla | 2804963 | 2013-02-12 01:33:45 +0000 | [diff] [blame] | 24 | #include <linux/compiler.h> |
R Sricharan | 06396c1 | 2013-03-04 20:04:45 +0000 | [diff] [blame] | 25 | #include <asm/system.h> |
Jean-Jacques Hiblot | 651201b | 2018-12-07 14:50:55 +0100 | [diff] [blame] | 26 | #include <dm/root.h> |
R Sricharan | 06396c1 | 2013-03-04 20:04:45 +0000 | [diff] [blame] | 27 | |
Nishanth Menon | 4e5dd66 | 2010-11-19 11:19:40 -0500 | [diff] [blame] | 28 | DECLARE_GLOBAL_DATA_PTR; |
| 29 | |
Aneesh V | f908b63 | 2011-07-21 09:10:01 -0400 | [diff] [blame] | 30 | void do_set_mux(u32 base, struct pad_conf_entry const *array, int size) |
| 31 | { |
| 32 | int i; |
| 33 | struct pad_conf_entry *pad = (struct pad_conf_entry *) array; |
| 34 | |
| 35 | for (i = 0; i < size; i++, pad++) |
| 36 | writew(pad->val, base + pad->offset); |
| 37 | } |
| 38 | |
Aneesh V | f908b63 | 2011-07-21 09:10:01 -0400 | [diff] [blame] | 39 | static void set_mux_conf_regs(void) |
| 40 | { |
Sricharan | 9310ff7 | 2011-11-15 09:49:55 -0500 | [diff] [blame] | 41 | switch (omap_hw_init_context()) { |
Aneesh V | f908b63 | 2011-07-21 09:10:01 -0400 | [diff] [blame] | 42 | case OMAP_INIT_CONTEXT_SPL: |
Paul Kocialkowski | a00b1e5 | 2016-02-27 19:18:56 +0100 | [diff] [blame] | 43 | set_muxconf_regs(); |
Aneesh V | f908b63 | 2011-07-21 09:10:01 -0400 | [diff] [blame] | 44 | break; |
| 45 | case OMAP_INIT_CONTEXT_UBOOT_AFTER_SPL: |
Aneesh V | f908b63 | 2011-07-21 09:10:01 -0400 | [diff] [blame] | 46 | break; |
| 47 | case OMAP_INIT_CONTEXT_UBOOT_FROM_NOR: |
| 48 | case OMAP_INIT_CONTEXT_UBOOT_AFTER_CH: |
Paul Kocialkowski | a00b1e5 | 2016-02-27 19:18:56 +0100 | [diff] [blame] | 49 | set_muxconf_regs(); |
Aneesh V | f908b63 | 2011-07-21 09:10:01 -0400 | [diff] [blame] | 50 | break; |
| 51 | } |
| 52 | } |
| 53 | |
Sricharan | 9310ff7 | 2011-11-15 09:49:55 -0500 | [diff] [blame] | 54 | u32 cortex_rev(void) |
Aneesh V | 162ced3 | 2011-07-21 09:10:04 -0400 | [diff] [blame] | 55 | { |
| 56 | |
| 57 | unsigned int rev; |
| 58 | |
| 59 | /* Read Main ID Register (MIDR) */ |
| 60 | asm ("mrc p15, 0, %0, c0, c0, 0" : "=r" (rev)); |
| 61 | |
| 62 | return rev; |
| 63 | } |
| 64 | |
Tom Rini | 01b2dd9 | 2013-05-31 10:44:23 -0400 | [diff] [blame] | 65 | static void omap_rev_string(void) |
Aneesh V | 162ced3 | 2011-07-21 09:10:04 -0400 | [diff] [blame] | 66 | { |
Sricharan | 9310ff7 | 2011-11-15 09:49:55 -0500 | [diff] [blame] | 67 | u32 omap_rev = omap_revision(); |
Lokesh Vutla | 43c296f | 2013-02-12 21:29:03 +0000 | [diff] [blame] | 68 | u32 soc_variant = (omap_rev & 0xF0000000) >> 28; |
Sricharan | 9310ff7 | 2011-11-15 09:49:55 -0500 | [diff] [blame] | 69 | u32 omap_variant = (omap_rev & 0xFFFF0000) >> 16; |
| 70 | u32 major_rev = (omap_rev & 0x00000F00) >> 8; |
| 71 | u32 minor_rev = (omap_rev & 0x000000F0) >> 4; |
Aneesh V | 162ced3 | 2011-07-21 09:10:04 -0400 | [diff] [blame] | 72 | |
Lokesh Vutla | 69483e6 | 2017-12-29 11:47:51 +0530 | [diff] [blame] | 73 | const char *sec_s, *package = NULL; |
Daniel Allred | fd684b2 | 2016-05-19 19:10:52 -0500 | [diff] [blame] | 74 | |
| 75 | switch (get_device_type()) { |
| 76 | case TST_DEVICE: |
| 77 | sec_s = "TST"; |
| 78 | break; |
| 79 | case EMU_DEVICE: |
| 80 | sec_s = "EMU"; |
| 81 | break; |
| 82 | case HS_DEVICE: |
| 83 | sec_s = "HS"; |
| 84 | break; |
| 85 | case GP_DEVICE: |
| 86 | sec_s = "GP"; |
| 87 | break; |
| 88 | default: |
| 89 | sec_s = "?"; |
| 90 | } |
| 91 | |
Lokesh Vutla | 69483e6 | 2017-12-29 11:47:51 +0530 | [diff] [blame] | 92 | #if defined(CONFIG_DRA7XX) |
| 93 | if (is_dra76x()) { |
| 94 | switch (omap_rev & 0xF) { |
| 95 | case DRA762_ABZ_PACKAGE: |
| 96 | package = "ABZ"; |
| 97 | break; |
| 98 | case DRA762_ACD_PACKAGE: |
| 99 | default: |
| 100 | package = "ACD"; |
| 101 | break; |
| 102 | } |
| 103 | } |
| 104 | #endif |
| 105 | |
Lokesh Vutla | 43c296f | 2013-02-12 21:29:03 +0000 | [diff] [blame] | 106 | if (soc_variant) |
| 107 | printf("OMAP"); |
| 108 | else |
| 109 | printf("DRA"); |
Lokesh Vutla | 69483e6 | 2017-12-29 11:47:51 +0530 | [diff] [blame] | 110 | printf("%x-%s ES%x.%x", omap_variant, sec_s, major_rev, minor_rev); |
| 111 | if (package) |
| 112 | printf(" %s package\n", package); |
| 113 | else |
| 114 | puts("\n"); |
Aneesh V | 162ced3 | 2011-07-21 09:10:04 -0400 | [diff] [blame] | 115 | } |
| 116 | |
Sricharan | 308fe92 | 2011-11-15 09:50:03 -0500 | [diff] [blame] | 117 | #ifdef CONFIG_SPL_BUILD |
Tom Rini | fe3b0c7 | 2012-08-13 11:37:56 -0700 | [diff] [blame] | 118 | void spl_display_print(void) |
| 119 | { |
| 120 | omap_rev_string(); |
| 121 | } |
Sricharan | 308fe92 | 2011-11-15 09:50:03 -0500 | [diff] [blame] | 122 | #endif |
| 123 | |
Lokesh Vutla | 2804963 | 2013-02-12 01:33:45 +0000 | [diff] [blame] | 124 | void __weak srcomp_enable(void) |
| 125 | { |
SRICHARAN R | 4af1988 | 2013-04-24 00:41:23 +0000 | [diff] [blame] | 126 | } |
| 127 | |
Kipisz, Steven | 4466dfb | 2016-02-24 12:30:57 -0600 | [diff] [blame] | 128 | /** |
| 129 | * do_board_detect() - Detect board description |
| 130 | * |
| 131 | * Function to detect board description. This is expected to be |
| 132 | * overridden in the SoC family board file where desired. |
| 133 | */ |
| 134 | void __weak do_board_detect(void) |
| 135 | { |
| 136 | } |
| 137 | |
Keerthy | 35740ec | 2016-05-24 11:45:05 +0530 | [diff] [blame] | 138 | /** |
| 139 | * vcores_init() - Assign omap_vcores based on board |
| 140 | * |
| 141 | * Function to pick the vcores based on board. This is expected to be |
| 142 | * overridden in the SoC family board file where desired. |
| 143 | */ |
| 144 | void __weak vcores_init(void) |
| 145 | { |
| 146 | } |
| 147 | |
Lokesh Vutla | e8534d2 | 2016-03-07 14:49:54 +0530 | [diff] [blame] | 148 | void s_init(void) |
| 149 | { |
| 150 | } |
| 151 | |
| 152 | /** |
Lokesh Vutla | 69483e6 | 2017-12-29 11:47:51 +0530 | [diff] [blame] | 153 | * init_package_revision() - Initialize package revision |
| 154 | * |
| 155 | * Function to get the pacakage information. This is expected to be |
| 156 | * overridden in the SoC family file where desired. |
| 157 | */ |
| 158 | void __weak init_package_revision(void) |
| 159 | { |
| 160 | } |
| 161 | |
| 162 | /** |
Lokesh Vutla | e8534d2 | 2016-03-07 14:49:54 +0530 | [diff] [blame] | 163 | * early_system_init - Does Early system initialization. |
| 164 | * |
| 165 | * Does early system init of watchdog, muxing, andclocks |
Aneesh V | f908b63 | 2011-07-21 09:10:01 -0400 | [diff] [blame] | 166 | * Watchdog disable is done always. For the rest what gets done |
Lokesh Vutla | e8534d2 | 2016-03-07 14:49:54 +0530 | [diff] [blame] | 167 | * depends on the boot mode in which this function is executed when |
| 168 | * 1. SPL running from SRAM |
| 169 | * 2. U-Boot running from FLASH |
| 170 | * 3. U-Boot loaded to SDRAM by SPL |
| 171 | * 4. U-Boot loaded to SDRAM by ROM code using the |
Aneesh V | f908b63 | 2011-07-21 09:10:01 -0400 | [diff] [blame] | 172 | * Configuration Header feature |
| 173 | * Please have a look at the respective functions to see what gets |
| 174 | * done in each of these cases |
| 175 | * This function is called with SRAM stack. |
Steve Sakoman | 1ad2158 | 2010-06-08 13:07:46 -0700 | [diff] [blame] | 176 | */ |
Simon Glass | b8357c1 | 2023-08-21 21:16:56 -0600 | [diff] [blame] | 177 | int early_system_init(void) |
Steve Sakoman | 1ad2158 | 2010-06-08 13:07:46 -0700 | [diff] [blame] | 178 | { |
Jean-Jacques Hiblot | 651201b | 2018-12-07 14:50:55 +0100 | [diff] [blame] | 179 | #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_MULTI_DTB_FIT) |
| 180 | int ret; |
| 181 | int rescan; |
| 182 | #endif |
Sricharan | 9310ff7 | 2011-11-15 09:49:55 -0500 | [diff] [blame] | 183 | init_omap_revision(); |
SRICHARAN R | fb6aa1f | 2013-02-04 04:22:00 +0000 | [diff] [blame] | 184 | hw_data_init(); |
Lokesh Vutla | 69483e6 | 2017-12-29 11:47:51 +0530 | [diff] [blame] | 185 | init_package_revision(); |
SRICHARAN R | fb6aa1f | 2013-02-04 04:22:00 +0000 | [diff] [blame] | 186 | |
Lokesh Vutla | ba87377 | 2012-05-29 19:26:43 +0000 | [diff] [blame] | 187 | #ifdef CONFIG_SPL_BUILD |
Lokesh Vutla | e38b45a | 2016-07-12 14:47:41 +0530 | [diff] [blame] | 188 | if (warm_reset()) |
Lokesh Vutla | ba87377 | 2012-05-29 19:26:43 +0000 | [diff] [blame] | 189 | force_emif_self_refresh(); |
| 190 | #endif |
Steve Sakoman | 1ad2158 | 2010-06-08 13:07:46 -0700 | [diff] [blame] | 191 | watchdog_init(); |
Aneesh V | f908b63 | 2011-07-21 09:10:01 -0400 | [diff] [blame] | 192 | set_mux_conf_regs(); |
Aneesh V | b8e60b9 | 2011-07-21 09:10:21 -0400 | [diff] [blame] | 193 | #ifdef CONFIG_SPL_BUILD |
Lokesh Vutla | 2804963 | 2013-02-12 01:33:45 +0000 | [diff] [blame] | 194 | srcomp_enable(); |
Aneesh V | b35f7cb | 2011-09-08 11:05:56 -0400 | [diff] [blame] | 195 | do_io_settings(); |
Aneesh V | b8e60b9 | 2011-07-21 09:10:21 -0400 | [diff] [blame] | 196 | #endif |
Kipisz, Steven | ebe86dc | 2016-02-24 12:30:52 -0600 | [diff] [blame] | 197 | setup_early_clocks(); |
Jean-Jacques Hiblot | 651201b | 2018-12-07 14:50:55 +0100 | [diff] [blame] | 198 | |
Lokesh Vutla | ca23da1 | 2017-06-27 13:50:56 +0530 | [diff] [blame] | 199 | #ifdef CONFIG_SPL_BUILD |
| 200 | /* |
| 201 | * Save the boot parameters passed from romcode. |
| 202 | * We cannot delay the saving further than this, |
| 203 | * to prevent overwrites. |
| 204 | */ |
| 205 | save_omap_boot_params(); |
Jean-Jacques Hiblot | a68ca9e | 2017-09-15 12:57:33 +0200 | [diff] [blame] | 206 | spl_early_init(); |
| 207 | #endif |
Jean-Jacques Hiblot | 3a502f6 | 2018-12-07 14:50:45 +0100 | [diff] [blame] | 208 | do_board_detect(); |
| 209 | |
Jean-Jacques Hiblot | 651201b | 2018-12-07 14:50:55 +0100 | [diff] [blame] | 210 | #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_MULTI_DTB_FIT) |
| 211 | /* |
| 212 | * Board detection has been done. |
| 213 | * Let us see if another dtb wouldn't be a better match |
| 214 | * for our board |
| 215 | */ |
| 216 | ret = fdtdec_resetup(&rescan); |
| 217 | if (!ret && rescan) { |
| 218 | dm_uninit(); |
| 219 | dm_init_and_scan(true); |
| 220 | } |
| 221 | #endif |
| 222 | |
Keerthy | 35740ec | 2016-05-24 11:45:05 +0530 | [diff] [blame] | 223 | vcores_init(); |
Lokesh Vutla | ac8bd3c | 2017-05-05 13:45:27 +0530 | [diff] [blame] | 224 | #ifdef CONFIG_DEBUG_UART_OMAP |
| 225 | debug_uart_init(); |
| 226 | #endif |
Aneesh V | 0d2628b | 2011-07-21 09:10:07 -0400 | [diff] [blame] | 227 | prcm_init(); |
Simon Glass | b8357c1 | 2023-08-21 21:16:56 -0600 | [diff] [blame] | 228 | |
| 229 | return 0; |
Simon Glass | 0c078ea | 2015-03-03 08:03:02 -0700 | [diff] [blame] | 230 | } |
| 231 | |
Aneesh V | b8e60b9 | 2011-07-21 09:10:21 -0400 | [diff] [blame] | 232 | #ifdef CONFIG_SPL_BUILD |
Simon Glass | 0c078ea | 2015-03-03 08:03:02 -0700 | [diff] [blame] | 233 | void board_init_f(ulong dummy) |
| 234 | { |
Lokesh Vutla | e8534d2 | 2016-03-07 14:49:54 +0530 | [diff] [blame] | 235 | early_system_init(); |
Lokesh Vutla | be86f0e | 2014-08-04 19:42:24 +0530 | [diff] [blame] | 236 | #ifdef CONFIG_BOARD_EARLY_INIT_F |
| 237 | board_early_init_f(); |
| 238 | #endif |
Aneesh V | b8e60b9 | 2011-07-21 09:10:21 -0400 | [diff] [blame] | 239 | /* For regular u-boot sdram_init() is called from dram_init() */ |
| 240 | sdram_init(); |
Lokesh Vutla | bed46ef | 2017-04-18 17:27:24 +0530 | [diff] [blame] | 241 | gd->ram_size = omap_sdram_size(); |
Steve Sakoman | 1ad2158 | 2010-06-08 13:07:46 -0700 | [diff] [blame] | 242 | } |
Simon Glass | 0c078ea | 2015-03-03 08:03:02 -0700 | [diff] [blame] | 243 | #endif |
Steve Sakoman | 1ad2158 | 2010-06-08 13:07:46 -0700 | [diff] [blame] | 244 | |
Simon Glass | b8357c1 | 2023-08-21 21:16:56 -0600 | [diff] [blame] | 245 | EVENT_SPY_SIMPLE(EVT_DM_POST_INIT_F, early_system_init); |
Lokesh Vutla | e8534d2 | 2016-03-07 14:49:54 +0530 | [diff] [blame] | 246 | |
Steve Sakoman | 1ad2158 | 2010-06-08 13:07:46 -0700 | [diff] [blame] | 247 | /* |
| 248 | * Routine: wait_for_command_complete |
| 249 | * Description: Wait for posting to finish on watchdog |
| 250 | */ |
| 251 | void wait_for_command_complete(struct watchdog *wd_base) |
| 252 | { |
| 253 | int pending = 1; |
| 254 | do { |
| 255 | pending = readl(&wd_base->wwps); |
| 256 | } while (pending); |
| 257 | } |
| 258 | |
| 259 | /* |
| 260 | * Routine: watchdog_init |
| 261 | * Description: Shut down watch dogs |
| 262 | */ |
| 263 | void watchdog_init(void) |
| 264 | { |
| 265 | struct watchdog *wd2_base = (struct watchdog *)WDT2_BASE; |
| 266 | |
| 267 | writel(WD_UNLOCK1, &wd2_base->wspr); |
| 268 | wait_for_command_complete(wd2_base); |
| 269 | writel(WD_UNLOCK2, &wd2_base->wspr); |
| 270 | } |
| 271 | |
Aneesh V | 04bd2b9 | 2010-09-12 10:32:55 +0530 | [diff] [blame] | 272 | |
| 273 | /* |
| 274 | * This function finds the SDRAM size available in the system |
| 275 | * based on DMM section configurations |
| 276 | * This is needed because the size of memory installed may be |
| 277 | * different on different versions of the board |
| 278 | */ |
Sricharan | 9310ff7 | 2011-11-15 09:49:55 -0500 | [diff] [blame] | 279 | u32 omap_sdram_size(void) |
Aneesh V | 04bd2b9 | 2010-09-12 10:32:55 +0530 | [diff] [blame] | 280 | { |
SRICHARAN R | 015be79 | 2012-05-17 00:12:06 +0000 | [diff] [blame] | 281 | u32 section, i, valid; |
| 282 | u64 sdram_start = 0, sdram_end = 0, addr, |
Lokesh Vutla | e45d3bb | 2014-05-12 13:49:33 +0530 | [diff] [blame] | 283 | size, total_size = 0, trap_size = 0, trap_start = 0; |
Sricharan | 62a8650 | 2011-11-15 09:50:00 -0500 | [diff] [blame] | 284 | |
Aneesh V | 04bd2b9 | 2010-09-12 10:32:55 +0530 | [diff] [blame] | 285 | for (i = 0; i < 4; i++) { |
Sricharan | 62a8650 | 2011-11-15 09:50:00 -0500 | [diff] [blame] | 286 | section = __raw_readl(DMM_BASE + i*4); |
SRICHARAN R | 015be79 | 2012-05-17 00:12:06 +0000 | [diff] [blame] | 287 | valid = (section & EMIF_SDRC_ADDRSPC_MASK) >> |
| 288 | (EMIF_SDRC_ADDRSPC_SHIFT); |
Sricharan | 62a8650 | 2011-11-15 09:50:00 -0500 | [diff] [blame] | 289 | addr = section & EMIF_SYS_ADDR_MASK; |
SRICHARAN R | 015be79 | 2012-05-17 00:12:06 +0000 | [diff] [blame] | 290 | |
Aneesh V | 04bd2b9 | 2010-09-12 10:32:55 +0530 | [diff] [blame] | 291 | /* See if the address is valid */ |
Tom Rini | 72f3600 | 2014-05-16 13:02:24 -0400 | [diff] [blame] | 292 | if ((addr >= TI_ARMV7_DRAM_ADDR_SPACE_START) && |
| 293 | (addr < TI_ARMV7_DRAM_ADDR_SPACE_END)) { |
Sricharan | 62a8650 | 2011-11-15 09:50:00 -0500 | [diff] [blame] | 294 | size = ((section & EMIF_SYS_SIZE_MASK) >> |
| 295 | EMIF_SYS_SIZE_SHIFT); |
| 296 | size = 1 << size; |
| 297 | size *= SZ_16M; |
SRICHARAN R | 015be79 | 2012-05-17 00:12:06 +0000 | [diff] [blame] | 298 | |
| 299 | if (valid != DMM_SDRC_ADDR_SPC_INVALID) { |
| 300 | if (!sdram_start || (addr < sdram_start)) |
| 301 | sdram_start = addr; |
| 302 | if (!sdram_end || ((addr + size) > sdram_end)) |
| 303 | sdram_end = addr + size; |
| 304 | } else { |
| 305 | trap_size = size; |
Lokesh Vutla | e45d3bb | 2014-05-12 13:49:33 +0530 | [diff] [blame] | 306 | trap_start = addr; |
SRICHARAN R | 015be79 | 2012-05-17 00:12:06 +0000 | [diff] [blame] | 307 | } |
Aneesh V | 04bd2b9 | 2010-09-12 10:32:55 +0530 | [diff] [blame] | 308 | } |
| 309 | } |
Lokesh Vutla | e45d3bb | 2014-05-12 13:49:33 +0530 | [diff] [blame] | 310 | |
| 311 | if ((trap_start >= sdram_start) && (trap_start < sdram_end)) |
| 312 | total_size = (sdram_end - sdram_start) - (trap_size); |
| 313 | else |
| 314 | total_size = sdram_end - sdram_start; |
Sricharan | 62a8650 | 2011-11-15 09:50:00 -0500 | [diff] [blame] | 315 | |
Aneesh V | 04bd2b9 | 2010-09-12 10:32:55 +0530 | [diff] [blame] | 316 | return total_size; |
| 317 | } |
| 318 | |
| 319 | |
Steve Sakoman | 1ad2158 | 2010-06-08 13:07:46 -0700 | [diff] [blame] | 320 | /* |
| 321 | * Routine: dram_init |
| 322 | * Description: sets uboots idea of sdram size |
| 323 | */ |
| 324 | int dram_init(void) |
| 325 | { |
Aneesh V | cc56558 | 2011-07-21 09:10:09 -0400 | [diff] [blame] | 326 | sdram_init(); |
Sricharan | 9310ff7 | 2011-11-15 09:49:55 -0500 | [diff] [blame] | 327 | gd->ram_size = omap_sdram_size(); |
Steve Sakoman | 1ad2158 | 2010-06-08 13:07:46 -0700 | [diff] [blame] | 328 | return 0; |
| 329 | } |
| 330 | |
| 331 | /* |
| 332 | * Print board information |
| 333 | */ |
| 334 | int checkboard(void) |
| 335 | { |
| 336 | puts(sysinfo.board_string); |
| 337 | return 0; |
| 338 | } |
| 339 | |
Masahiro Yamada | 81a689e | 2014-02-13 18:30:26 +0900 | [diff] [blame] | 340 | #if defined(CONFIG_DISPLAY_CPUINFO) |
Sricharan | 9310ff7 | 2011-11-15 09:49:55 -0500 | [diff] [blame] | 341 | /* |
| 342 | * Print CPU information |
| 343 | */ |
| 344 | int print_cpuinfo(void) |
Aneesh V | e3405bd | 2011-06-16 23:30:52 +0000 | [diff] [blame] | 345 | { |
Andreas Müller | 0cda7a4 | 2012-01-04 15:26:24 +0000 | [diff] [blame] | 346 | puts("CPU : "); |
| 347 | omap_rev_string(); |
Sricharan | 9310ff7 | 2011-11-15 09:49:55 -0500 | [diff] [blame] | 348 | |
| 349 | return 0; |
| 350 | } |
Masahiro Yamada | 81a689e | 2014-02-13 18:30:26 +0900 | [diff] [blame] | 351 | #endif |