X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=arch%2Farm%2Fmach-omap2%2Fboot-common.c;h=26245aa1694e47283c2acdeac8e322ed06fe1b76;hb=dfd6d3a9d471baf8d0f2d543398b0aad5545d297;hp=7ae3d8041c48ee61c3c332e79004217537a34936;hpb=04770e6e917b0f766a9496e3f37bcdf2ebb1beb4;p=oweals%2Fu-boot.git diff --git a/arch/arm/mach-omap2/boot-common.c b/arch/arm/mach-omap2/boot-common.c index 7ae3d8041c..26245aa169 100644 --- a/arch/arm/mach-omap2/boot-common.c +++ b/arch/arm/mach-omap2/boot-common.c @@ -10,6 +10,7 @@ #include #include +#include #include #include #include @@ -64,6 +65,23 @@ void save_omap_boot_params(void) */ if (boot_device == BOOT_DEVICE_QSPI_4) boot_device = BOOT_DEVICE_SPI; +#endif +#ifdef CONFIG_TI816X + /* + * On PG2.0 and later TI816x the values we get when booting are not the + * same as on PG1.0, which is what the defines are based on. Update + * them as needed. + */ + if (get_cpu_rev() != 1) { + if (boot_device == 0x05) { + omap_boot_params->boot_device = BOOT_DEVICE_NAND; + boot_device = BOOT_DEVICE_NAND; + } + if (boot_device == 0x08) { + omap_boot_params->boot_device = BOOT_DEVICE_MMC1; + boot_device = BOOT_DEVICE_MMC1; + } + } #endif /* * When booting from peripheral booting, the boot device is not usable @@ -178,13 +196,6 @@ u32 spl_boot_mode(const u32 boot_device) void spl_board_init(void) { - /* - * Save the boot parameters passed from romcode. - * We cannot delay the saving further than this, - * to prevent overwrites. - */ - save_omap_boot_params(); - /* Prepare console output */ preloader_console_init(); @@ -205,21 +216,6 @@ void spl_board_init(void) #endif } -__weak int board_mmc_init(bd_t *bis) -{ - switch (spl_boot_device()) { - case BOOT_DEVICE_MMC1: - omap_mmc_init(0, 0, 0, -1, -1); - break; - case BOOT_DEVICE_MMC2: - case BOOT_DEVICE_MMC2_2: - omap_mmc_init(0, 0, 0, -1, -1); - omap_mmc_init(1, 0, 0, -1, -1); - break; - } - return 0; -} - void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image) { typedef void __noreturn (*image_entry_noargs_t)(u32 *); @@ -245,8 +241,8 @@ void arch_preboot_os(void) int fb_set_reboot_flag(void) { printf("Setting reboot to fastboot flag ...\n"); - setenv("dofastboot", "1"); - saveenv(); + env_set("dofastboot", "1"); + env_save(); return 0; } #endif