arm: mach-k3: Fix config check for FS_LOADER
Subsystems (3)
PATCH 1/1 arm: mach-k3: Fix config check for FS_LOADER
load_firmware() API calls fs-loader APIs and checks for CONFIG_FS_LOADER before calling those APIs. The if check only checks for CONFIG_FS_LOADER but not for CONFIG_SPL_FS_LOADER.
When CONFIG_FS_LOADER is enabled, load_firmware() API calls fs-loader APIs but this is done at SPL stage and at this time FS_LOADER is not built yet as a result we see below build error.
AR spl/boot/built-in.o
LD spl/u-boot-spl
arm-none-linux-gnueabihf-ld.bfd: arch/arm/mach-k3/common.o: in function `load_firmware':/home/danish/workspace/u-boot/arch/arm/mach-k3/common.c:184: undefined reference to `get_fs_loader' arm-none-linux-gnueabihf-ld.bfd:/home/danish/workspace/u-boot/arch/arm/mach-k3/common.c:185: undefined reference to `request_firmware_into_buf'
make[2]: *** [/home/danish/workspace/u-boot/scripts/Makefile.spl:527:
spl/u-boot-spl] Error 1
make[1]: *** [/home/danish/workspace/u-boot/Makefile:2055:
spl/u-boot-spl] Error 2
make[1]: Leaving directory '/home/danish/uboot_images/am64x/r5'
make: *** [Makefile:177: sub-make] Error 2
Fix this by modifying the if check to CONFIG_IS_ENABLED(FS_LOADER) instead of IS_ENABLED(CONFIG_FS_LOADER) as the former will check for the appropriate config option (CONFIG_SPL_FS_LOADER / CONFIG_FS_LOADER) based on the build stage.
--- arch/arm/mach-k3/r5/common.c | 2 +- arch/arm/mach-omap2/boot-common.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-k3/r5/common.c +1 -1
@@ -70,7 +70,7 @@ int load_firmware(char *name_fw, char *name_loadaddr, u32 *loadaddr)char *name =NULL ;int size =0 ; -if (!IS_ENABLED (CONFIG_FS_LOADER )) +if (!CONFIG_IS_ENABLED (FS_LOADER ))return 0 ; *loadaddr =0 ;
arch/arm/mach-omap2/boot-common.c +1 -1
@@ -190,7 +190,7 @@ int load_firmware(char *name_fw, u32 *loadaddr)struct udevice *fsdev;int size =0 ; -if (!IS_ENABLED (CONFIG_FS_LOADER )) +if (!CONFIG_IS_ENABLED (FS_LOADER ))return 0 ;if (!*loadaddr)
Signature · 1 line
2.34.1
PATCH 1/1 arm: mach-k3: Fix config check for FS_LOADER
load_firmware() API calls fs-loader APIs and checks for CONFIG_FS_LOADER before calling those APIs. The if check only checks for CONFIG_FS_LOADER but not for CONFIG_SPL_FS_LOADER.
When CONFIG_FS_LOADER is enabled, load_firmware() API calls fs-loader APIs but this is done at SPL stage and at this time FS_LOADER is not built yet as a result we see below build error.
AR spl/boot/built-in.o
LD spl/u-boot-spl
arm-none-linux-gnueabihf-ld.bfd: arch/arm/mach-k3/common.o: in function `load_firmware':/home/danish/workspace/u-boot/arch/arm/mach-k3/common.c:184: undefined reference to `get_fs_loader' arm-none-linux-gnueabihf-ld.bfd:/home/danish/workspace/u-boot/arch/arm/mach-k3/common.c:185: undefined reference to `request_firmware_into_buf'
make[2]: *** [/home/danish/workspace/u-boot/scripts/Makefile.spl:527:
spl/u-boot-spl] Error 1
make[1]: *** [/home/danish/workspace/u-boot/Makefile:2055:
spl/u-boot-spl] Error 2
make[1]: Leaving directory '/home/danish/uboot_images/am64x/r5'
make: *** [Makefile:177: sub-make] Error 2
Fix this by modifying the if check to CONFIG_IS_ENABLED(FS_LOADER) instead of IS_ENABLED(CONFIG_FS_LOADER) as the former will check for the appropriate config option (CONFIG_SPL_FS_LOADER / CONFIG_FS_LOADER) based on the build stage.
--- arch/arm/mach-k3/r5/common.c | 2 +- arch/arm/mach-omap2/boot-common.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-k3/r5/common.c +1 -1
@@ -70,7 +70,7 @@ int load_firmware(char *name_fw, char *name_loadaddr, u32 *loadaddr)char *name =NULL ;int size =0 ; -if (!IS_ENABLED (CONFIG_FS_LOADER )) +if (!CONFIG_IS_ENABLED (FS_LOADER ))return 0 ; *loadaddr =0 ;
arch/arm/mach-omap2/boot-common.c +1 -1
@@ -190,7 +190,7 @@ int load_firmware(char *name_fw, u32 *loadaddr)struct udevice *fsdev;int size =0 ; -if (!IS_ENABLED (CONFIG_FS_LOADER )) +if (!CONFIG_IS_ENABLED (FS_LOADER ))return 0 ;if (!*loadaddr)
Signature · 1 line
2.34.1
Quoted 53 lines · MD Danish Anwar
load_firmware()API calls fs-loader APIs and checks forCONFIG_FS_LOADERbefore calling those APIs. The if check only checks forCONFIG_FS_LOADERbut not forCONFIG_SPL_FS_LOADER.When
CONFIG_FS_LOADERis enabled,load_firmware()API calls fs-loader APIs but this is done at SPL stage and at this timeFS_LOADERis not built yet as a result we see below build error.AR
spl/boot/built-in.o
LD spl/u-boot-spl
arm-none-linux-gnueabihf-ld.bfd:arch/arm/mach-k3/common.o: in function `load_firmware':/home/danish/workspace/u-boot/arch/arm/mach-k3/common.c:184: undefined reference to `get_fs_loader' arm-none-linux-gnueabihf-ld.bfd:/home/danish/workspace/u-boot/arch/arm/mach-k3/common.c:185: undefined reference to `request_firmware_into_buf'
make[2]: *** [/home/danish/workspace/u-boot/scripts/Makefile.spl:527:
spl/u-boot-spl] Error 1
make[1]: *** [/home/danish/workspace/u-boot/Makefile:2055:
spl/u-boot-spl] Error 2
make[1]: Leaving directory '/home/danish/uboot_images/am64x/r5'
make: *** [Makefile:177: sub-make] Error 2Fix this by modifying the if check to
CONFIG_IS_ENABLED(FS_LOADER)instead ofIS_ENABLED(CONFIG_FS_LOADER)as the former will check for the appropriate config option (CONFIG_SPL_FS_LOADER/CONFIG_FS_LOADER) based on the build stage.Signed-off-by MD Danish Anwar <[email protected]>--- arch/arm/mach-k3/r5/common.c | 2 +- arch/arm/mach-omap2/boot-common.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)arch/arm/mach-k3/r5/common.c +1
-1@@ -70,7 +70,7 @@ int load_firmware(char *name_fw, char *name_loadaddr, u32 *loadaddr)char *name =NULL ;int size =0 ; -if (!IS_ENABLED (CONFIG_FS_LOADER )) +if (!CONFIG_IS_ENABLED (FS_LOADER ))return 0 ; *loadaddr =0 ;arch/arm/mach-omap2/boot-common.c +0
-0
arch/arm/mach-omap2/boot-common.c int load_firmware(char *name_fw, u32 *loadaddr) · line 196
Quoted 8 lines
arch/arm/mach-omap2/boot-common.c +1
-1@@ -190,7 +190,7 @@ int load_firmware(char *name_fw, u32 *loadaddr)struct udevice *fsdev;int size =0 ; -if (!IS_ENABLED (CONFIG_FS_LOADER )) +if (!CONFIG_IS_ENABLED (FS_LOADER ))return 0 ;if (!*loadaddr)
Signature · 2 lines
Regards, Ravi
Quoted 24 lines · MD Danish Anwar
load_firmware()API calls fs-loader APIs and checks forCONFIG_FS_LOADERbefore calling those APIs. The if check only checks forCONFIG_FS_LOADERbut not forCONFIG_SPL_FS_LOADER.When
CONFIG_FS_LOADERis enabled,load_firmware()API calls fs-loader APIs but this is done at SPL stage and at this timeFS_LOADERis not built yet as a result we see below build error.AR
spl/boot/built-in.o
LD spl/u-boot-spl
arm-none-linux-gnueabihf-ld.bfd:arch/arm/mach-k3/common.o: in function `load_firmware':/home/danish/workspace/u-boot/arch/arm/mach-k3/common.c:184: undefined reference to `get_fs_loader' arm-none-linux-gnueabihf-ld.bfd:/home/danish/workspace/u-boot/arch/arm/mach-k3/common.c:185: undefined reference to `request_firmware_into_buf'
make[2]: *** [/home/danish/workspace/u-boot/scripts/Makefile.spl:527:
spl/u-boot-spl] Error 1
make[1]: *** [/home/danish/workspace/u-boot/Makefile:2055:
spl/u-boot-spl] Error 2
make[1]: Leaving directory '/home/danish/uboot_images/am64x/r5'
make: *** [Makefile:177: sub-make] Error 2
Quoted 7 lines
Fix this by modifying the if check to
CONFIG_IS_ENABLED(FS_LOADER)instead ofIS_ENABLED(CONFIG_FS_LOADER)as the former will check for the appropriate config option (CONFIG_SPL_FS_LOADER/CONFIG_FS_LOADER) based on the build stage.Signed-off-by MD Danish Anwar <[email protected]>Acked-by Ravi Gunasekaran <[email protected]>
Applied to u-boot/next, thanks!
Signature · 1 line
Tom