1d2f18c27SAneesh V /* 2d2f18c27SAneesh V * (C) Copyright 2010 3d2f18c27SAneesh V * Texas Instruments, <www.ti.com> 4d2f18c27SAneesh V * 5d2f18c27SAneesh V * Aneesh V <aneesh@ti.com> 6d2f18c27SAneesh V * 7d2f18c27SAneesh V * See file CREDITS for list of people who contributed to this 8d2f18c27SAneesh V * project. 9d2f18c27SAneesh V * 10d2f18c27SAneesh V * This program is free software; you can redistribute it and/or 11d2f18c27SAneesh V * modify it under the terms of the GNU General Public License as 12d2f18c27SAneesh V * published by the Free Software Foundation; either version 2 of 13d2f18c27SAneesh V * the License, or (at your option) any later version. 14d2f18c27SAneesh V * 15d2f18c27SAneesh V * This program is distributed in the hope that it will be useful, 16d2f18c27SAneesh V * but WITHOUT ANY WARRANTY; without even the implied warranty of 17d2f18c27SAneesh V * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18d2f18c27SAneesh V * GNU General Public License for more details. 19d2f18c27SAneesh V * 20d2f18c27SAneesh V * You should have received a copy of the GNU General Public License 21d2f18c27SAneesh V * along with this program; if not, write to the Free Software 22d2f18c27SAneesh V * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 23d2f18c27SAneesh V * MA 02111-1307 USA 24d2f18c27SAneesh V */ 25d2f18c27SAneesh V #ifndef _OMAP_COMMON_H_ 26d2f18c27SAneesh V #define _OMAP_COMMON_H_ 27d2f18c27SAneesh V 283776801dSAneesh V /* Max value for DPLL multiplier M */ 293776801dSAneesh V #define OMAP_DPLL_MAX_N 127 303776801dSAneesh V 31d2f18c27SAneesh V /* HW Init Context */ 32d2f18c27SAneesh V #define OMAP_INIT_CONTEXT_SPL 0 33d2f18c27SAneesh V #define OMAP_INIT_CONTEXT_UBOOT_FROM_NOR 1 34d2f18c27SAneesh V #define OMAP_INIT_CONTEXT_UBOOT_AFTER_SPL 2 35d2f18c27SAneesh V #define OMAP_INIT_CONTEXT_UBOOT_AFTER_CH 3 36d2f18c27SAneesh V 37bcae7211SAneesh V void preloader_console_init(void); 38bcae7211SAneesh V 398cf686e1SAneesh V /* Boot device */ 40*bb085b87SSimon Schwarz #ifdef CONFIG_OMAP44XX /* OMAP4 */ 418cf686e1SAneesh V #define BOOT_DEVICE_NONE 0 428cf686e1SAneesh V #define BOOT_DEVICE_XIP 1 438cf686e1SAneesh V #define BOOT_DEVICE_XIPWAIT 2 448cf686e1SAneesh V #define BOOT_DEVICE_NAND 3 458cf686e1SAneesh V #define BOOT_DEVICE_ONE_NAND 4 468cf686e1SAneesh V #define BOOT_DEVICE_MMC1 5 478cf686e1SAneesh V #define BOOT_DEVICE_MMC2 6 48*bb085b87SSimon Schwarz #elif CONFIG_OMAP34XX /* OMAP3 */ 49*bb085b87SSimon Schwarz #define BOOT_DEVICE_NONE 0 50*bb085b87SSimon Schwarz #define BOOT_DEVICE_XIP 1 51*bb085b87SSimon Schwarz #define BOOT_DEVICE_NAND 2 52*bb085b87SSimon Schwarz #define BOOT_DEVICE_ONE_NAND 3 53*bb085b87SSimon Schwarz #define BOOT_DEVICE_MMC2 5 /*emmc*/ 54*bb085b87SSimon Schwarz #define BOOT_DEVICE_MMC1 6 55*bb085b87SSimon Schwarz #define BOOT_DEVICE_XIPWAIT 7 56*bb085b87SSimon Schwarz #endif 578cf686e1SAneesh V 588cf686e1SAneesh V /* Boot type */ 598cf686e1SAneesh V #define MMCSD_MODE_UNDEFINED 0 608cf686e1SAneesh V #define MMCSD_MODE_RAW 1 618cf686e1SAneesh V #define MMCSD_MODE_FAT 2 62*bb085b87SSimon Schwarz #define NAND_MODE_HW_ECC 3 63*bb085b87SSimon Schwarz 64*bb085b87SSimon Schwarz struct spl_image_info { 65*bb085b87SSimon Schwarz const char *name; 66*bb085b87SSimon Schwarz u8 os; 67*bb085b87SSimon Schwarz u32 load_addr; 68*bb085b87SSimon Schwarz u32 entry_point; 69*bb085b87SSimon Schwarz u32 size; 70*bb085b87SSimon Schwarz }; 71*bb085b87SSimon Schwarz 72*bb085b87SSimon Schwarz extern struct spl_image_info spl_image; 738cf686e1SAneesh V 748cf686e1SAneesh V u32 omap_boot_device(void); 758cf686e1SAneesh V u32 omap_boot_mode(void); 768cf686e1SAneesh V 77*bb085b87SSimon Schwarz 78*bb085b87SSimon Schwarz /* SPL common function s*/ 79*bb085b87SSimon Schwarz void spl_parse_image_header(const struct image_header *header); 80*bb085b87SSimon Schwarz 81*bb085b87SSimon Schwarz /* NAND SPL functions */ 82*bb085b87SSimon Schwarz void spl_nand_load_image(void); 83*bb085b87SSimon Schwarz 84*bb085b87SSimon Schwarz /* MMC SPL functions */ 85*bb085b87SSimon Schwarz void spl_mmc_load_image(void); 86*bb085b87SSimon Schwarz 87d2f18c27SAneesh V #endif /* _OMAP_COMMON_H_ */ 88