Commit 516d7a0a authored by Nick Elsmore's avatar Nick Elsmore

board: omap5_pyra: detect boot device and set mmcdev

parent f2a0e4c4
......@@ -6,6 +6,7 @@
#include <common.h>
#include <palmas.h>
#include <asm/arch/omap.h>
#include <spl.h>
#include <asm/arch/sys_proto.h>
#include <asm/arch/mmc_host_def.h>
#include <tca642x.h>
......@@ -158,7 +159,6 @@ int board_init(void)
#if defined(CONFIG_TCA642X)
tca642x_set_inital_state(CONFIG_SYS_I2C_TCA642X_ADDR, tca642x_init);
#endif
return 0;
}
......@@ -335,8 +335,31 @@ static void set_fdtfile(void)
main_rev / 10,
main_rev % 10);
int ret = setenv("fdtfile", fdtfile);
printf("setenv: %d\n", ret);
setenv("fdtfile", fdtfile);
}
static void set_mmcdev(void)
{
u32 boot_params = *((u32 *) OMAP_SRAM_SCRATCH_BOOT_PARAMS);
struct omap_boot_parameters *omap_boot_params;
u32 boot_device;
omap_boot_params = (struct omap_boot_parameters *) boot_params;
boot_device = omap_boot_params->boot_device;
switch (boot_device) {
case BOOT_DEVICE_MMC1:
printf("BOOTDEV: SD Left\n");
setenv("mmcdev", "0");
break;
case BOOT_DEVICE_MMC2_2:
printf("BOOTDEV: eMMC/uSD\n");
setenv("mmcdev", "1");
break;
default:
printf("BOOTDEV: Unknown\n");
break;
}
}
/**
......@@ -356,6 +379,7 @@ int misc_init_r(void)
omap_die_id_usbethaddr();
set_fdtfile();
set_mmcdev();
return 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment