Commit 53940a50797d4287af1c998a251170ef65927533

Authored by Tim Harvey
Committed by Stefano Babic
1 parent 0d1ea05210

imx: ventana: config: enable Falcon mode

Falcon mode entails the SPL booting the OS directly instead of U-Boot.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>

Showing 2 changed files with 36 additions and 0 deletions Side-by-side Diff

board/gateworks/gw_ventana/gw_ventana_spl.c
... ... @@ -14,6 +14,7 @@
14 14 #include <asm/imx-common/boot_mode.h>
15 15 #include <asm/imx-common/iomux-v3.h>
16 16 #include <asm/imx-common/mxc_i2c.h>
  17 +#include <environment.h>
17 18 #include <spl.h>
18 19  
19 20 #include "gsc.h"
... ... @@ -555,6 +556,25 @@
555 556 /* PMIC init */
556 557 setup_pmic();
557 558 }
  559 +
  560 +#ifdef CONFIG_SPL_OS_BOOT
  561 +/* return 1 if we wish to boot to uboot vs os (falcon mode) */
  562 +int spl_start_uboot(void)
  563 +{
  564 + int ret = 1;
  565 +
  566 + debug("%s\n", __func__);
  567 +#ifdef CONFIG_SPL_ENV_SUPPORT
  568 + env_init();
  569 + env_relocate_spec();
  570 + debug("boot_os=%s\n", getenv("boot_os"));
  571 + if (getenv_yesno("boot_os") == 1)
  572 + ret = 0;
  573 +#endif
  574 + debug("%s booting %s\n", __func__, ret ? "uboot" : "linux");
  575 + return ret;
  576 +}
  577 +#endif
558 578  
559 579 void reset_cpu(ulong addr)
560 580 {
include/configs/gw_ventana.h
... ... @@ -17,6 +17,22 @@
17 17 /* Location in NAND to read U-Boot from */
18 18 #define CONFIG_SYS_NAND_U_BOOT_OFFS (14 * SZ_1M)
19 19  
  20 +/* Falcon Mode */
  21 +#define CONFIG_CMD_SPL
  22 +#define CONFIG_SPL_OS_BOOT
  23 +#define CONFIG_SPL_ENV_SUPPORT
  24 +#define CONFIG_SYS_SPL_ARGS_ADDR 0x18000000
  25 +#define CONFIG_CMD_SPL_WRITE_SIZE (128 * SZ_1K)
  26 +
  27 +/* Falcon Mode - NAND support: args@17MB kernel@18MB */
  28 +#define CONFIG_CMD_SPL_NAND_OFS (17 * SZ_1M)
  29 +#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS (18 * SZ_1M)
  30 +
  31 +/* Falcon Mode - MMC support: args@1MB kernel@2MB */
  32 +#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR 0x800 /* 1MB */
  33 +#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS (CONFIG_CMD_SPL_WRITE_SIZE / 512)
  34 +#define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR 0x1000 /* 2MB */
  35 +
20 36 #include "imx6_spl.h" /* common IMX6 SPL configuration */
21 37 #include "mx6_common.h"
22 38 #define CONFIG_MX6