Commit 7ad2cc7964d37f3a444a0472bbccda487d51c7f6

Authored by Peter Korsgaard
Committed by Tom Rini
1 parent b6144dfce9

spl_mmc: add Falcon mode support for FAT variant

If Falcon mode support is enabled (and the system isn't directed into
booting u-boot), it will instead try to load kernel from
CONFIG_SPL_FAT_LOAD_KERNEL_NAME file and kernel argument parameters from
CONFIG_SPL_FAT_LOAD_ARGS_NAME, both from the same partition as u-boot.

Signed-off-by: Peter Korsgaard <peter.korsgaard@barco.com>

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

... ... @@ -2938,6 +2938,14 @@
2938 2938 CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME
2939 2939 Filename to read to load U-Boot when reading from FAT
2940 2940  
  2941 + CONFIG_SPL_FAT_LOAD_KERNEL_NAME
  2942 + Filename to read to load kernel uImage when reading
  2943 + from FAT (for Falcon mode)
  2944 +
  2945 + CONFIG_SPL_FAT_LOAD_ARGS_NAME
  2946 + Filename to read to load kernel argument parameters
  2947 + when reading from FAT (for Falcon mode)
  2948 +
2941 2949 CONFIG_SPL_MPC83XX_WAIT_FOR_NAND
2942 2950 Set this for NAND SPL on PPC mpc83xx targets, so that
2943 2951 start.S waits for the rest of the SPL to load before
common/spl/spl_mmc.c
... ... @@ -91,8 +91,26 @@
91 91  
92 92 return (err <= 0);
93 93 }
  94 +
  95 +#ifdef CONFIG_SPL_OS_BOOT
  96 +static int mmc_load_image_fat_os(struct mmc *mmc)
  97 +{
  98 + int err;
  99 +
  100 + err = file_fat_read(CONFIG_SPL_FAT_LOAD_ARGS_NAME,
  101 + (void *)CONFIG_SYS_SPL_ARGS_ADDR, 0);
  102 + if (err <= 0) {
  103 + printf("spl: error reading image %s, err - %d\n",
  104 + CONFIG_SPL_FAT_LOAD_ARGS_NAME, err);
  105 + return -1;
  106 + }
  107 +
  108 + return mmc_load_image_fat(mmc, CONFIG_SPL_FAT_LOAD_KERNEL_NAME);
  109 +}
94 110 #endif
95 111  
  112 +#endif
  113 +
96 114 void spl_mmc_load_image(void)
97 115 {
98 116 struct mmc *mmc;
... ... @@ -128,6 +146,9 @@
128 146 hang();
129 147 }
130 148  
  149 +#ifdef CONFIG_SPL_OS_BOOT
  150 + if (spl_start_uboot() || mmc_load_image_fat_os(mmc))
  151 +#endif
131 152 err = mmc_load_image_fat(mmc, CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME);
132 153 #endif
133 154 } else {