Chandan Nath | 77a73fe | 2012-01-09 20:38:59 +0000 | [diff] [blame] | 1 | /* |
| 2 | * boot-common.c |
| 3 | * |
| 4 | * Common bootmode functions for omap based boards |
| 5 | * |
| 6 | * Copyright (C) 2011, Texas Instruments, Incorporated - http://www.ti.com/ |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or |
| 9 | * modify it under the terms of the GNU General Public License as |
| 10 | * published by the Free Software Foundation; either version 2 of |
| 11 | * the License, or (at your option) any later version. |
| 12 | * |
| 13 | * This program is distributed in the hope that it will be useful, |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR /PURPOSE. See the |
| 16 | * GNU General Public License for more details. |
| 17 | */ |
| 18 | |
| 19 | #include <common.h> |
| 20 | #include <asm/omap_common.h> |
| 21 | #include <asm/arch/omap.h> |
| 22 | |
| 23 | /* |
| 24 | * This is used to verify if the configuration header |
| 25 | * was executed by rom code prior to control of transfer |
| 26 | * to the bootloader. SPL is responsible for saving and |
| 27 | * passing the boot_params pointer to the u-boot. |
| 28 | */ |
| 29 | struct omap_boot_parameters boot_params __attribute__ ((section(".data"))); |
| 30 | |
| 31 | #ifdef CONFIG_SPL_BUILD |
| 32 | /* |
| 33 | * We use static variables because global data is not ready yet. |
| 34 | * Initialized data is available in SPL right from the beginning. |
| 35 | * We would not typically need to save these parameters in regular |
| 36 | * U-Boot. This is needed only in SPL at the moment. |
| 37 | */ |
| 38 | u32 omap_bootmode = MMCSD_MODE_FAT; |
| 39 | |
Tom Rini | 0be93ff | 2012-08-13 12:53:23 -0700 | [diff] [blame] | 40 | u32 spl_boot_device(void) |
Chandan Nath | 77a73fe | 2012-01-09 20:38:59 +0000 | [diff] [blame] | 41 | { |
| 42 | return (u32) (boot_params.omap_bootdevice); |
| 43 | } |
| 44 | |
Tom Rini | a76ff95 | 2012-08-14 09:19:44 -0700 | [diff] [blame^] | 45 | u32 spl_boot_mode(void) |
Chandan Nath | 77a73fe | 2012-01-09 20:38:59 +0000 | [diff] [blame] | 46 | { |
| 47 | return omap_bootmode; |
| 48 | } |
| 49 | #endif |