* [PATCH] arm: mach-k3: Fix config check for FS_LOADER
@ 2024-03-14 14:33 MD Danish Anwar
2024-03-14 14:33 ` MD Danish Anwar
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: MD Danish Anwar @ 2024-03-14 14:33 UTC (permalink / raw)
To: Nishanth Menon, MD Danish Anwar, Igor Opaniuk, Andrew Davis,
Tom Rini
Cc: u-boot, srk, Vignesh Raghavendra, r-gunasekaran, Roger Quadros
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.
Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
---
arch/arm/mach-k3/r5/common.c | 2 +-
arch/arm/mach-omap2/boot-common.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-k3/r5/common.c b/arch/arm/mach-k3/r5/common.c
index 7309573a3f..c02f8d3309 100644
--- a/arch/arm/mach-k3/r5/common.c
+++ b/arch/arm/mach-k3/r5/common.c
@@ -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;
diff --git a/arch/arm/mach-omap2/boot-common.c b/arch/arm/mach-omap2/boot-common.c
index 57917da25c..aa0ab13d5f 100644
--- a/arch/arm/mach-omap2/boot-common.c
+++ b/arch/arm/mach-omap2/boot-common.c
@@ -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)
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] arm: mach-k3: Fix config check for FS_LOADER
2024-03-14 14:33 [PATCH] arm: mach-k3: Fix config check for FS_LOADER MD Danish Anwar
@ 2024-03-14 14:33 ` MD Danish Anwar
2024-03-18 9:12 ` Ravi Gunasekaran
2024-03-20 12:42 ` Tom Rini
2 siblings, 0 replies; 4+ messages in thread
From: MD Danish Anwar @ 2024-03-14 14:33 UTC (permalink / raw)
To: Nishanth Menon, MD Danish Anwar, Igor Opaniuk, Andrew Davis,
Tom Rini
Cc: u-boot, srk, Vignesh Raghavendra, r-gunasekaran, Roger Quadros
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.
Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
---
arch/arm/mach-k3/r5/common.c | 2 +-
arch/arm/mach-omap2/boot-common.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-k3/r5/common.c b/arch/arm/mach-k3/r5/common.c
index 7309573a3f..c02f8d3309 100644
--- a/arch/arm/mach-k3/r5/common.c
+++ b/arch/arm/mach-k3/r5/common.c
@@ -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;
diff --git a/arch/arm/mach-omap2/boot-common.c b/arch/arm/mach-omap2/boot-common.c
index 57917da25c..aa0ab13d5f 100644
--- a/arch/arm/mach-omap2/boot-common.c
+++ b/arch/arm/mach-omap2/boot-common.c
@@ -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)
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] arm: mach-k3: Fix config check for FS_LOADER
2024-03-14 14:33 [PATCH] arm: mach-k3: Fix config check for FS_LOADER MD Danish Anwar
2024-03-14 14:33 ` MD Danish Anwar
@ 2024-03-18 9:12 ` Ravi Gunasekaran
2024-03-20 12:42 ` Tom Rini
2 siblings, 0 replies; 4+ messages in thread
From: Ravi Gunasekaran @ 2024-03-18 9:12 UTC (permalink / raw)
To: MD Danish Anwar, Nishanth Menon, Igor Opaniuk, Andrew Davis,
Tom Rini
Cc: u-boot, srk, Vignesh Raghavendra, Roger Quadros, Ravi Gunasekaran
On 3/14/24 8:03 PM, MD Danish Anwar wrote:
> 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.
>
> Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
> ---
> arch/arm/mach-k3/r5/common.c | 2 +-
> arch/arm/mach-omap2/boot-common.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-k3/r5/common.c b/arch/arm/mach-k3/r5/common.c
> index 7309573a3f..c02f8d3309 100644
> --- a/arch/arm/mach-k3/r5/common.c
> +++ b/arch/arm/mach-k3/r5/common.c
> @@ -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;
> diff --git a/arch/arm/mach-omap2/boot-common.c b/arch/arm/mach-omap2/boot-common.c
> index 57917da25c..aa0ab13d5f 100644
> --- a/arch/arm/mach-omap2/boot-common.c
> +++ b/arch/arm/mach-omap2/boot-common.c
> @@ -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)
Acked-by: Ravi Gunasekaran <r-gunasekaran@ti.com>
--
Regards,
Ravi
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] arm: mach-k3: Fix config check for FS_LOADER
2024-03-14 14:33 [PATCH] arm: mach-k3: Fix config check for FS_LOADER MD Danish Anwar
2024-03-14 14:33 ` MD Danish Anwar
2024-03-18 9:12 ` Ravi Gunasekaran
@ 2024-03-20 12:42 ` Tom Rini
2 siblings, 0 replies; 4+ messages in thread
From: Tom Rini @ 2024-03-20 12:42 UTC (permalink / raw)
To: MD Danish Anwar
Cc: Nishanth Menon, Igor Opaniuk, Andrew Davis, u-boot, srk,
Vignesh Raghavendra, r-gunasekaran, Roger Quadros
[-- Attachment #1: Type: text/plain, Size: 1588 bytes --]
On Thu, Mar 14, 2024 at 08:03:10PM +0530, MD Danish Anwar wrote:
> 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.
>
> Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
> Acked-by: Ravi Gunasekaran <r-gunasekaran@ti.com>
Applied to u-boot/next, thanks!
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-03-20 12:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-14 14:33 [PATCH] arm: mach-k3: Fix config check for FS_LOADER MD Danish Anwar
2024-03-14 14:33 ` MD Danish Anwar
2024-03-18 9:12 ` Ravi Gunasekaran
2024-03-20 12:42 ` Tom Rini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox