All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] board: nuvoton: Use an event to replace last_stage_init() and fix build error
@ 2024-05-07  9:10 Jim Liu
  2024-05-15 18:51 ` Tom Rini
  0 siblings, 1 reply; 2+ messages in thread
From: Jim Liu @ 2024-05-07  9:10 UTC (permalink / raw
  To: YSCHU, KWLIU, jim.t90615, trini, JJLIU0; +Cc: u-boot

Followed the new style use event to replace last_stage_init().
Fixed build error After replace last_stage_init().
And remove CONFIG_SYS_SKIP_UART_INIT from defconfig,
system will reuse the setting from bootblock
and skip the baud rate setting.

Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
---
 board/nuvoton/arbel_evb/arbel_evb.c | 7 +++++--
 board/nuvoton/common/Makefile       | 2 +-
 board/nuvoton/poleg_evb/poleg_evb.c | 6 +++++-
 configs/arbel_evb_defconfig         | 1 -
 4 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/board/nuvoton/arbel_evb/arbel_evb.c b/board/nuvoton/arbel_evb/arbel_evb.c
index 53c931c3c2..d112329dc1 100644
--- a/board/nuvoton/arbel_evb/arbel_evb.c
+++ b/board/nuvoton/arbel_evb/arbel_evb.c
@@ -5,6 +5,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <event.h>
 #include <asm/io.h>
 #include <asm/arch/gcr.h>
 #include "../common/uart.h"
@@ -95,9 +96,11 @@ int dram_init_banksize(void)
 	return 0;
 }
 
-int last_stage_init(void)
+static int last_stage_init(void)
 {
+#if CONFIG_IS_ENABLED(CONFIG_SYS_SKIP_UART_INIT)
 	board_set_console();
-
+#endif
 	return 0;
 }
+EVENT_SPY_SIMPLE(EVT_LAST_STAGE_INIT, last_stage_init);
diff --git a/board/nuvoton/common/Makefile b/board/nuvoton/common/Makefile
index 8fd83b229b..3ba494e900 100644
--- a/board/nuvoton/common/Makefile
+++ b/board/nuvoton/common/Makefile
@@ -1 +1 @@
-obj-$(CONFIG_SYS_SKIP_UART_INIT)	+= uart.o
+obj-y	+= uart.o
diff --git a/board/nuvoton/poleg_evb/poleg_evb.c b/board/nuvoton/poleg_evb/poleg_evb.c
index e69bca9503..0710f31959 100644
--- a/board/nuvoton/poleg_evb/poleg_evb.c
+++ b/board/nuvoton/poleg_evb/poleg_evb.c
@@ -7,6 +7,7 @@
 #include <common.h>
 #include <dm.h>
 #include <env.h>
+#include <event.h>
 #include <asm/io.h>
 #include <asm/arch/gcr.h>
 #include <asm/mach-types.h>
@@ -49,7 +50,7 @@ int dram_init(void)
 	return 0;
 }
 
-int last_stage_init(void)
+static int last_stage_init(void)
 {
 
 	char value[32];
@@ -69,8 +70,11 @@ int last_stage_init(void)
 		}
 		sprintf(value, "ttyS%d,115200n8", dev->seq_);
 		env_set("console", value);
+#if CONFIG_IS_ENABLED(CONFIG_SYS_SKIP_UART_INIT)
 		board_set_console();
+#endif
 	}
 
 	return 0;
 }
+EVENT_SPY_SIMPLE(EVT_LAST_STAGE_INIT, last_stage_init);
diff --git a/configs/arbel_evb_defconfig b/configs/arbel_evb_defconfig
index 08753aebc0..59652a154e 100644
--- a/configs/arbel_evb_defconfig
+++ b/configs/arbel_evb_defconfig
@@ -14,7 +14,6 @@ CONFIG_DEFAULT_DEVICE_TREE="nuvoton-npcm845-evb"
 CONFIG_DM_RESET=y
 # CONFIG_PSCI_RESET is not set
 CONFIG_ARCH_NPCM8XX=y
-CONFIG_SYS_SKIP_UART_INIT=y
 CONFIG_TARGET_ARBEL_EVB=y
 CONFIG_SYS_LOAD_ADDR=0x06208000
 CONFIG_ENV_ADDR=0x803C0000
-- 
2.25.1


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

* Re: [PATCH v1] board: nuvoton: Use an event to replace last_stage_init() and fix build error
  2024-05-07  9:10 [PATCH v1] board: nuvoton: Use an event to replace last_stage_init() and fix build error Jim Liu
@ 2024-05-15 18:51 ` Tom Rini
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Rini @ 2024-05-15 18:51 UTC (permalink / raw
  To: Jim Liu; +Cc: YSCHU, KWLIU, JJLIU0, u-boot

[-- Attachment #1: Type: text/plain, Size: 1372 bytes --]

On Tue, May 07, 2024 at 05:10:55PM +0800, Jim Liu wrote:

> Followed the new style use event to replace last_stage_init().
> Fixed build error After replace last_stage_init().
> And remove CONFIG_SYS_SKIP_UART_INIT from defconfig,
> system will reuse the setting from bootblock
> and skip the baud rate setting.
> 
> Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
> ---
>  board/nuvoton/arbel_evb/arbel_evb.c | 7 +++++--
>  board/nuvoton/common/Makefile       | 2 +-
>  board/nuvoton/poleg_evb/poleg_evb.c | 6 +++++-
>  configs/arbel_evb_defconfig         | 1 -
>  4 files changed, 11 insertions(+), 5 deletions(-)
> 
> diff --git a/board/nuvoton/arbel_evb/arbel_evb.c b/board/nuvoton/arbel_evb/arbel_evb.c
> index 53c931c3c2..d112329dc1 100644
> --- a/board/nuvoton/arbel_evb/arbel_evb.c
> +++ b/board/nuvoton/arbel_evb/arbel_evb.c
> @@ -5,6 +5,7 @@
>  
>  #include <common.h>
>  #include <dm.h>
> +#include <event.h>
>  #include <asm/io.h>
>  #include <asm/arch/gcr.h>
>  #include "../common/uart.h"
> @@ -95,9 +96,11 @@ int dram_init_banksize(void)
>  	return 0;
>  }
>  
> -int last_stage_init(void)
> +static int last_stage_init(void)
>  {
> +#if CONFIG_IS_ENABLED(CONFIG_SYS_SKIP_UART_INIT)

The CONFIG_IS_ENABLED takes symbols without the CONFIG_ prefix part so
that it will be true for FOO, and SPL_FOO and TPL_FOO.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

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

end of thread, other threads:[~2024-05-15 18:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-07  9:10 [PATCH v1] board: nuvoton: Use an event to replace last_stage_init() and fix build error Jim Liu
2024-05-15 18:51 ` Tom Rini

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.