mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-21 06:31:31 +00:00
mx6qsabre{sd,auto}: Add boot mode select
Adds support for 'bmode' command which let user to choose where to boot from; this allows U-Boot to load system from another storage without messing with jumpers. Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
This commit is contained in:
parent
60bb462148
commit
85449dbd4b
3 changed files with 42 additions and 0 deletions
|
@ -26,6 +26,7 @@
|
||||||
#include <asm/errno.h>
|
#include <asm/errno.h>
|
||||||
#include <asm/gpio.h>
|
#include <asm/gpio.h>
|
||||||
#include <asm/imx-common/iomux-v3.h>
|
#include <asm/imx-common/iomux-v3.h>
|
||||||
|
#include <asm/imx-common/boot_mode.h>
|
||||||
#include <mmc.h>
|
#include <mmc.h>
|
||||||
#include <fsl_esdhc.h>
|
#include <fsl_esdhc.h>
|
||||||
#include <miiphy.h>
|
#include <miiphy.h>
|
||||||
|
@ -216,6 +217,23 @@ int board_init(void)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_CMD_BMODE
|
||||||
|
static const struct boot_mode board_boot_modes[] = {
|
||||||
|
/* 4 bit bus width */
|
||||||
|
{"mmc0", MAKE_CFGVAL(0x40, 0x30, 0x00, 0x00)},
|
||||||
|
{NULL, 0},
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int board_late_init(void)
|
||||||
|
{
|
||||||
|
#ifdef CONFIG_CMD_BMODE
|
||||||
|
add_board_boot_modes(board_boot_modes);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int checkboard(void)
|
int checkboard(void)
|
||||||
{
|
{
|
||||||
int rev = mx6sabre_rev();
|
int rev = mx6sabre_rev();
|
||||||
|
|
|
@ -26,10 +26,12 @@
|
||||||
#include <asm/errno.h>
|
#include <asm/errno.h>
|
||||||
#include <asm/gpio.h>
|
#include <asm/gpio.h>
|
||||||
#include <asm/imx-common/iomux-v3.h>
|
#include <asm/imx-common/iomux-v3.h>
|
||||||
|
#include <asm/imx-common/boot_mode.h>
|
||||||
#include <mmc.h>
|
#include <mmc.h>
|
||||||
#include <fsl_esdhc.h>
|
#include <fsl_esdhc.h>
|
||||||
#include <miiphy.h>
|
#include <miiphy.h>
|
||||||
#include <netdev.h>
|
#include <netdev.h>
|
||||||
|
|
||||||
DECLARE_GLOBAL_DATA_PTR;
|
DECLARE_GLOBAL_DATA_PTR;
|
||||||
|
|
||||||
#define UART_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_PUE | \
|
#define UART_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_PUE | \
|
||||||
|
@ -272,6 +274,26 @@ int board_init(void)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_CMD_BMODE
|
||||||
|
static const struct boot_mode board_boot_modes[] = {
|
||||||
|
/* 4 bit bus width */
|
||||||
|
{"sd2", MAKE_CFGVAL(0x40, 0x28, 0x00, 0x00)},
|
||||||
|
{"sd3", MAKE_CFGVAL(0x40, 0x30, 0x00, 0x00)},
|
||||||
|
/* 8 bit bus width */
|
||||||
|
{"emmc", MAKE_CFGVAL(0x40, 0x38, 0x00, 0x00)},
|
||||||
|
{NULL, 0},
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int board_late_init(void)
|
||||||
|
{
|
||||||
|
#ifdef CONFIG_CMD_BMODE
|
||||||
|
add_board_boot_modes(board_boot_modes);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int checkboard(void)
|
int checkboard(void)
|
||||||
{
|
{
|
||||||
puts("Board: MX6Q-SabreSD\n");
|
puts("Board: MX6Q-SabreSD\n");
|
||||||
|
|
|
@ -36,6 +36,7 @@
|
||||||
#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 2 * 1024 * 1024)
|
#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 2 * 1024 * 1024)
|
||||||
|
|
||||||
#define CONFIG_BOARD_EARLY_INIT_F
|
#define CONFIG_BOARD_EARLY_INIT_F
|
||||||
|
#define CONFIG_BOARD_LATE_INIT
|
||||||
#define CONFIG_MXC_GPIO
|
#define CONFIG_MXC_GPIO
|
||||||
|
|
||||||
#define CONFIG_MXC_UART
|
#define CONFIG_MXC_UART
|
||||||
|
@ -75,6 +76,7 @@
|
||||||
/* Command definition */
|
/* Command definition */
|
||||||
#include <config_cmd_default.h>
|
#include <config_cmd_default.h>
|
||||||
|
|
||||||
|
#define CONFIG_CMD_BMODE
|
||||||
#define CONFIG_CMD_BOOTZ
|
#define CONFIG_CMD_BOOTZ
|
||||||
#undef CONFIG_CMD_IMLS
|
#undef CONFIG_CMD_IMLS
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue