All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] riscv: ae350: Use #if defined instead of CONFIG_IS_ENABLED
@ 2021-10-27  8:59 Leo Yu-Chi Liang
       [not found] ` <HK0PR03MB2994A2BC40279DC7AF913DE2C18A9@HK0PR03MB2994.apcprd03.prod.outlook.com>
  2021-11-01  6:04 ` Bin Meng
  0 siblings, 2 replies; 6+ messages in thread
From: Leo Yu-Chi Liang @ 2021-10-27  8:59 UTC (permalink / raw)
  To: rick, ycliang; +Cc: u-boot

According to ./include/linux/kconfig.h,
CONFIG_IS_ENABLED(OF_BOARD) expands to 0
when CONFIG_SPL_BUILD is defined because
there is no CONFIG_SPL_OF_BOARD.

Use #if defined instead.

Signed-off-by: Leo Yu-Chi Liang <ycliang@andestech.com>
---
 board/AndesTech/ax25-ae350/ax25-ae350.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/board/AndesTech/ax25-ae350/ax25-ae350.c b/board/AndesTech/ax25-ae350/ax25-ae350.c
index b28894ed46..58bf236497 100644
--- a/board/AndesTech/ax25-ae350/ax25-ae350.c
+++ b/board/AndesTech/ax25-ae350/ax25-ae350.c
@@ -56,9 +56,9 @@ ulong board_flash_get_legacy(ulong base, int banknum, flash_info_t *info)
 
 void *board_fdt_blob_setup(void)
 {
-#if CONFIG_IS_ENABLED(OF_BOARD)
+#if defined(CONFIG_OF_BOARD)
 	return (void *)(ulong)gd->arch.firmware_fdt_addr;
-#elif CONFIG_IS_ENABLED(OF_SEPARATE)
+#elif defined(CONFIG_OF_SEPARATE)
 	return (void *)CONFIG_SYS_FDT_BASE;
 #else
 	return NULL;
-- 
2.17.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] riscv: ae350: Use #if defined instead of CONFIG_IS_ENABLED
       [not found] ` <HK0PR03MB2994A2BC40279DC7AF913DE2C18A9@HK0PR03MB2994.apcprd03.prod.outlook.com>
@ 2021-11-01  5:41   ` Rick Chen
  0 siblings, 0 replies; 6+ messages in thread
From: Rick Chen @ 2021-11-01  5:41 UTC (permalink / raw)
  To: Leo Liang; +Cc: U-Boot Mailing List, rick

> From: Leo Yu-Chi Liang(梁育齊) <ycliang@andestech.com>
> Sent: Wednesday, October 27, 2021 4:59 PM
> To: Rick Jian-Zhi Chen(陳建志) <rick@andestech.com>; Leo Yu-Chi Liang(梁育齊) <ycliang@andestech.com>
> Cc: u-boot@lists.denx.de
> Subject: [PATCH] riscv: ae350: Use #if defined instead of CONFIG_IS_ENABLED
>
> According to ./include/linux/kconfig.h,
> CONFIG_IS_ENABLED(OF_BOARD) expands to 0 when CONFIG_SPL_BUILD is defined because there is no CONFIG_SPL_OF_BOARD.
>
> Use #if defined instead.
>
> Signed-off-by: Leo Yu-Chi Liang <ycliang@andestech.com>
> ---
>  board/AndesTech/ax25-ae350/ax25-ae350.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Rick Chen <rick@andestech.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] riscv: ae350: Use #if defined instead of CONFIG_IS_ENABLED
  2021-10-27  8:59 [PATCH] riscv: ae350: Use #if defined instead of CONFIG_IS_ENABLED Leo Yu-Chi Liang
       [not found] ` <HK0PR03MB2994A2BC40279DC7AF913DE2C18A9@HK0PR03MB2994.apcprd03.prod.outlook.com>
@ 2021-11-01  6:04 ` Bin Meng
  2021-11-01  7:49   ` Leo Liang
  1 sibling, 1 reply; 6+ messages in thread
From: Bin Meng @ 2021-11-01  6:04 UTC (permalink / raw)
  To: Leo Yu-Chi Liang; +Cc: Rick Chen, U-Boot Mailing List

Hi Leo,

On Wed, Oct 27, 2021 at 4:59 PM Leo Yu-Chi Liang <ycliang@andestech.com> wrote:
>
> According to ./include/linux/kconfig.h,
> CONFIG_IS_ENABLED(OF_BOARD) expands to 0
> when CONFIG_SPL_BUILD is defined because
> there is no CONFIG_SPL_OF_BOARD.

Why is the change?

>
> Use #if defined instead.
>
> Signed-off-by: Leo Yu-Chi Liang <ycliang@andestech.com>
> ---
>  board/AndesTech/ax25-ae350/ax25-ae350.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>

Regards,
Bin

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] riscv: ae350: Use #if defined instead of CONFIG_IS_ENABLED
  2021-11-01  6:04 ` Bin Meng
@ 2021-11-01  7:49   ` Leo Liang
  2021-11-01  8:37     ` Bin Meng
  0 siblings, 1 reply; 6+ messages in thread
From: Leo Liang @ 2021-11-01  7:49 UTC (permalink / raw)
  To: Bin Meng; +Cc: Rick Chen, U-Boot Mailing List

Hi Bin,
On Mon, Nov 01, 2021 at 02:04:48PM +0800, Bin Meng wrote:
> Hi Leo,
> 
> On Wed, Oct 27, 2021 at 4:59 PM Leo Yu-Chi Liang <ycliang@andestech.com> wrote:
> >
> > According to ./include/linux/kconfig.h,
> > CONFIG_IS_ENABLED(OF_BOARD) expands to 0
> > when CONFIG_SPL_BUILD is defined because
> > there is no CONFIG_SPL_OF_BOARD.
> 
> Why is the change?
> 

The original code was

void *board_fdt_blob_setup(void)
{
#if CONFIG_IS_ENABLED(OF_BOARD)
 	return (void *)(ulong)gd->arch.firmware_fdt_addr;
#elif CONFIG_IS_ENABLED(OF_SEPARATE)
 	return (void *)CONFIG_SYS_FDT_BASE;
#else
 	return NULL;
}

But the "return (void *)(ulong)gd->arch.firmware_fdt_addr;" does not get
compiled even if OF_BOARD is selected when building
ae350_*_spl_*_defconfig, thus this patch.

The reason is because ./include/linux/kconfig.h states
"CONFIG_IS_ENABLED(FOO) expands to 1 if CONFIG_SPL_BUILD is defined
and CONFIG_SPL_FOO is set to 'y'". 
However, we don't have CONFIG_SPL_OF_BOARD, so
CONFIG_IS_ENABLED(OF_BOARD) only expands to 0.

Best regards,
Leo

> >
> > Use #if defined instead.
> >
> > Signed-off-by: Leo Yu-Chi Liang <ycliang@andestech.com>
> > ---
> >  board/AndesTech/ax25-ae350/ax25-ae350.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> 
> Regards,
> Bin

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] riscv: ae350: Use #if defined instead of CONFIG_IS_ENABLED
  2021-11-01  7:49   ` Leo Liang
@ 2021-11-01  8:37     ` Bin Meng
  2021-11-01  8:56       ` Leo Liang
  0 siblings, 1 reply; 6+ messages in thread
From: Bin Meng @ 2021-11-01  8:37 UTC (permalink / raw)
  To: Leo Liang; +Cc: Rick Chen, U-Boot Mailing List

Hi Leo,

On Mon, Nov 1, 2021 at 3:49 PM Leo Liang <ycliang@andestech.com> wrote:
>
> Hi Bin,
> On Mon, Nov 01, 2021 at 02:04:48PM +0800, Bin Meng wrote:
> > Hi Leo,
> >
> > On Wed, Oct 27, 2021 at 4:59 PM Leo Yu-Chi Liang <ycliang@andestech.com> wrote:
> > >
> > > According to ./include/linux/kconfig.h,
> > > CONFIG_IS_ENABLED(OF_BOARD) expands to 0
> > > when CONFIG_SPL_BUILD is defined because
> > > there is no CONFIG_SPL_OF_BOARD.
> >
> > Why is the change?
> >
>
> The original code was
>
> void *board_fdt_blob_setup(void)
> {
> #if CONFIG_IS_ENABLED(OF_BOARD)
>         return (void *)(ulong)gd->arch.firmware_fdt_addr;
> #elif CONFIG_IS_ENABLED(OF_SEPARATE)
>         return (void *)CONFIG_SYS_FDT_BASE;
> #else
>         return NULL;
> }
>
> But the "return (void *)(ulong)gd->arch.firmware_fdt_addr;" does not get
> compiled even if OF_BOARD is selected when building
> ae350_*_spl_*_defconfig, thus this patch.
>
> The reason is because ./include/linux/kconfig.h states
> "CONFIG_IS_ENABLED(FOO) expands to 1 if CONFIG_SPL_BUILD is defined
> and CONFIG_SPL_FOO is set to 'y'".
> However, we don't have CONFIG_SPL_OF_BOARD, so
> CONFIG_IS_ENABLED(OF_BOARD) only expands to 0.
>

Thanks!

Please add:

Fixes: 2e8d2f88439d ("riscv: Remove OF_PRIOR_STAGE from RISC-V boards")
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

Regards,
Bin

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] riscv: ae350: Use #if defined instead of CONFIG_IS_ENABLED
  2021-11-01  8:37     ` Bin Meng
@ 2021-11-01  8:56       ` Leo Liang
  0 siblings, 0 replies; 6+ messages in thread
From: Leo Liang @ 2021-11-01  8:56 UTC (permalink / raw)
  To: Bin Meng; +Cc: Rick Chen, U-Boot Mailing List

On Mon, Nov 01, 2021 at 04:37:32PM +0800, Bin Meng wrote:
> Hi Leo,
> 
> On Mon, Nov 1, 2021 at 3:49 PM Leo Liang <ycliang@andestech.com> wrote:
> >
> > Hi Bin,
> > On Mon, Nov 01, 2021 at 02:04:48PM +0800, Bin Meng wrote:
> > > Hi Leo,
> > >
> > > On Wed, Oct 27, 2021 at 4:59 PM Leo Yu-Chi Liang <ycliang@andestech.com> wrote:
> > > >
> > > > According to ./include/linux/kconfig.h,
> > > > CONFIG_IS_ENABLED(OF_BOARD) expands to 0
> > > > when CONFIG_SPL_BUILD is defined because
> > > > there is no CONFIG_SPL_OF_BOARD.
> > >
> > > Why is the change?
> > >
> >
> > The original code was
> >
> > void *board_fdt_blob_setup(void)
> > {
> > #if CONFIG_IS_ENABLED(OF_BOARD)
> >         return (void *)(ulong)gd->arch.firmware_fdt_addr;
> > #elif CONFIG_IS_ENABLED(OF_SEPARATE)
> >         return (void *)CONFIG_SYS_FDT_BASE;
> > #else
> >         return NULL;
> > }
> >
> > But the "return (void *)(ulong)gd->arch.firmware_fdt_addr;" does not get
> > compiled even if OF_BOARD is selected when building
> > ae350_*_spl_*_defconfig, thus this patch.
> >
> > The reason is because ./include/linux/kconfig.h states
> > "CONFIG_IS_ENABLED(FOO) expands to 1 if CONFIG_SPL_BUILD is defined
> > and CONFIG_SPL_FOO is set to 'y'".
> > However, we don't have CONFIG_SPL_OF_BOARD, so
> > CONFIG_IS_ENABLED(OF_BOARD) only expands to 0.
> >
> 
> Thanks!
> 
> Please add:
> 
> Fixes: 2e8d2f88439d ("riscv: Remove OF_PRIOR_STAGE from RISC-V boards")
> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
> 
Will do. Thanks!

Best regards,
Leo

> Regards,
> Bin

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-11-01  8:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-27  8:59 [PATCH] riscv: ae350: Use #if defined instead of CONFIG_IS_ENABLED Leo Yu-Chi Liang
     [not found] ` <HK0PR03MB2994A2BC40279DC7AF913DE2C18A9@HK0PR03MB2994.apcprd03.prod.outlook.com>
2021-11-01  5:41   ` Rick Chen
2021-11-01  6:04 ` Bin Meng
2021-11-01  7:49   ` Leo Liang
2021-11-01  8:37     ` Bin Meng
2021-11-01  8:56       ` Leo Liang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.