Commit 894d376542139c4a8c42c840808f038644b3a2a2

Authored by Ye Li
1 parent cad69cc0f5

MLK-20945-5 imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 675cc6031033fbe5e7d8cfe01ebe1dedfd6c1b96)

Showing 1 changed file with 12 additions and 0 deletions Side-by-side Diff

arch/arm/mach-imx/imx8/cpu.c
... ... @@ -29,6 +29,7 @@
29 29 #include <asm/setup.h>
30 30 #include <asm/arch/lpcg.h>
31 31 #include <asm/mach-imx/imx_vservice.h>
  32 +#include <spl.h>
32 33  
33 34 DECLARE_GLOBAL_DATA_PTR;
34 35  
... ... @@ -1956,5 +1957,16 @@
1956 1957 return 0;
1957 1958  
1958 1959 return -ENODEV;
  1960 +}
  1961 +
  1962 +void board_boot_order(u32 *spl_boot_list)
  1963 +{
  1964 + spl_boot_list[0] = spl_boot_device();
  1965 +
  1966 + if (spl_boot_list[0] == BOOT_DEVICE_SPI) {
  1967 + /* Check whether we own the flexspi0, if not, use NOR boot */
  1968 + if (!check_owned_resource(SC_R_FSPI_0))
  1969 + spl_boot_list[0] = BOOT_DEVICE_NOR;
  1970 + }
1959 1971 }