diff mbox series

[boot-wrapper,1/5] Decouple V2M_SYS config by auto-detect dtb node

Message ID 20210420072438.183086-2-jaxson.han@arm.com (mailing list archive)
State New
Headers show
Series Add Armv8-R AArch64 support | expand

Commit Message

Jaxson Han April 20, 2021, 7:24 a.m. UTC
An auto-detect switch is added to make it an option to enable/disable
'arm,vexpress-sysreg', because not all platforms support this feature.

Signed-off-by: Jaxson Han <jaxson.han@arm.com>
---
 Makefile.am | 2 +-
 platform.c  | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

Comments

Andre Przywara April 26, 2021, 11:30 a.m. UTC | #1
On Tue, 20 Apr 2021 15:24:34 +0800
Jaxson Han <jaxson.han@arm.com> wrote:

Hi,

> An auto-detect switch is added to make it an option to enable/disable
> 'arm,vexpress-sysreg', because not all platforms support this feature.

The change itself is fine, only has the side effect of now printing an
message about the missing node:
No matching devices found at ./findbase.pl line 37.

I will have a look if we can avoid this, or we drop this message in findbase.pl at all.

But for the sake of this patch:

Reviewed-by: Andre Przywara <andre.przywara@arm.com>

Cheers,
Andre

> Signed-off-by: Jaxson Han <jaxson.han@arm.com>
> ---
>  Makefile.am | 2 +-
>  platform.c  | 4 ++++
>  2 files changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/Makefile.am b/Makefile.am
> index af694b7..e131207 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -19,7 +19,7 @@ NR_CPUS         := $(shell echo $(CPU_IDS) | tr ',' ' ' | wc -w)
>  DEFINES		= -DCNTFRQ=$(CNTFRQ)
>  DEFINES		+= -DCPU_IDS=$(CPU_IDS)
>  DEFINES		+= -DNR_CPUS=$(NR_CPUS)
> -DEFINES		+= -DSYSREGS_BASE=$(SYSREGS_BASE)
> +DEFINES		+= $(if $(SYSREGS_BASE), -DSYSREGS_BASE=$(SYSREGS_BASE), )
>  DEFINES		+= -DUART_BASE=$(UART_BASE)
>  DEFINES		+= -DSTACK_SIZE=256
>  
> diff --git a/platform.c b/platform.c
> index a528a55..d11f568 100644
> --- a/platform.c
> +++ b/platform.c
> @@ -23,10 +23,12 @@
>  
>  #define PL011(reg)	((void *)UART_BASE + PL011_##reg)
>  
> +#ifdef SYSREGS_BASE
>  #define V2M_SYS_CFGDATA		0xa0
>  #define V2M_SYS_CFGCTRL		0xa4
>  
>  #define V2M_SYS(reg)	((void *)SYSREGS_BASE + V2M_SYS_##reg)
> +#endif
>  
>  static void print_string(const char *str)
>  {
> @@ -59,6 +61,7 @@ void init_platform(void)
>  
>  	print_string("Boot-wrapper v0.2\r\n\r\n");
>  
> +#ifdef SYSREGS_BASE
>  	/*
>  	 * CLCD output site MB
>  	 */
> @@ -66,4 +69,5 @@ void init_platform(void)
>  	/* START | WRITE | MUXFPGA | SITE_MB */
>  	raw_writel((1 << 31) | (1 << 30) | (7 << 20) | (0 << 16),
>  				V2M_SYS(CFGCTRL));
> +#endif
>  }
Jaxson Han April 28, 2021, 3:23 a.m. UTC | #2
Hi Andre,

> -----Original Message-----
> From: Andre Przywara <andre.przywara@arm.com>
> Sent: Monday, April 26, 2021 7:30 PM
> To: Jaxson Han <Jaxson.Han@arm.com>
> Cc: Mark Rutland <Mark.Rutland@arm.com>; linux-arm-
> kernel@lists.infradead.org; Wei Chen <Wei.Chen@arm.com>
> Subject: Re: [boot-wrapper PATCH 1/5] Decouple V2M_SYS config by auto-
> detect dtb node
> 
> On Tue, 20 Apr 2021 15:24:34 +0800
> Jaxson Han <jaxson.han@arm.com> wrote:
> 
> Hi,
> 
> > An auto-detect switch is added to make it an option to enable/disable
> > 'arm,vexpress-sysreg', because not all platforms support this feature.
> 
> The change itself is fine, only has the side effect of now printing an message
> about the missing node:
> No matching devices found at ./findbase.pl line 37.
> 
> I will have a look if we can avoid this, or we drop this message in findbase.pl
> at all.

Thanks, if you have any suggestions, please let me know:)

> 
> But for the sake of this patch:
> 
> Reviewed-by: Andre Przywara <andre.przywara@arm.com>
> 
> Cheers,
> Andre

Thanks!
Jaxson

> 
> > Signed-off-by: Jaxson Han <jaxson.han@arm.com>
> > ---
> >  Makefile.am | 2 +-
> >  platform.c  | 4 ++++
> >  2 files changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/Makefile.am b/Makefile.am index af694b7..e131207 100644
> > --- a/Makefile.am
> > +++ b/Makefile.am
> > @@ -19,7 +19,7 @@ NR_CPUS         := $(shell echo $(CPU_IDS) | tr ',' ' ' | wc
> -w)
> >  DEFINES		= -DCNTFRQ=$(CNTFRQ)
> >  DEFINES		+= -DCPU_IDS=$(CPU_IDS)
> >  DEFINES		+= -DNR_CPUS=$(NR_CPUS)
> > -DEFINES		+= -DSYSREGS_BASE=$(SYSREGS_BASE)
> > +DEFINES		+= $(if $(SYSREGS_BASE), -
> DSYSREGS_BASE=$(SYSREGS_BASE), )
> >  DEFINES		+= -DUART_BASE=$(UART_BASE)
> >  DEFINES		+= -DSTACK_SIZE=256
> >
> > diff --git a/platform.c b/platform.c
> > index a528a55..d11f568 100644
> > --- a/platform.c
> > +++ b/platform.c
> > @@ -23,10 +23,12 @@
> >
> >  #define PL011(reg)	((void *)UART_BASE + PL011_##reg)
> >
> > +#ifdef SYSREGS_BASE
> >  #define V2M_SYS_CFGDATA		0xa0
> >  #define V2M_SYS_CFGCTRL		0xa4
> >
> >  #define V2M_SYS(reg)	((void *)SYSREGS_BASE + V2M_SYS_##reg)
> > +#endif
> >
> >  static void print_string(const char *str)  { @@ -59,6 +61,7 @@ void
> > init_platform(void)
> >
> >  	print_string("Boot-wrapper v0.2\r\n\r\n");
> >
> > +#ifdef SYSREGS_BASE
> >  	/*
> >  	 * CLCD output site MB
> >  	 */
> > @@ -66,4 +69,5 @@ void init_platform(void)
> >  	/* START | WRITE | MUXFPGA | SITE_MB */
> >  	raw_writel((1 << 31) | (1 << 30) | (7 << 20) | (0 << 16),
> >  				V2M_SYS(CFGCTRL));
> > +#endif
> >  }
Andre Przywara May 10, 2021, 8:30 a.m. UTC | #3
On Wed, 28 Apr 2021 03:23:18 +0000
Jaxson Han <Jaxson.Han@arm.com> wrote:

Hi Jaxson,

> Hi Andre,
> 
> > -----Original Message-----
> > From: Andre Przywara <andre.przywara@arm.com>
> > Sent: Monday, April 26, 2021 7:30 PM
> > To: Jaxson Han <Jaxson.Han@arm.com>
> > Cc: Mark Rutland <Mark.Rutland@arm.com>; linux-arm-
> > kernel@lists.infradead.org; Wei Chen <Wei.Chen@arm.com>
> > Subject: Re: [boot-wrapper PATCH 1/5] Decouple V2M_SYS config by auto-
> > detect dtb node
> > 
> > On Tue, 20 Apr 2021 15:24:34 +0800
> > Jaxson Han <jaxson.han@arm.com> wrote:
> > 
> > Hi,
> >   
> > > An auto-detect switch is added to make it an option to enable/disable
> > > 'arm,vexpress-sysreg', because not all platforms support this feature.  
> > 
> > The change itself is fine, only has the side effect of now printing an message
> > about the missing node:
> > No matching devices found at ./findbase.pl line 37.
> > 
> > I will have a look if we can avoid this, or we drop this message in findbase.pl
> > at all.  
> 
> Thanks, if you have any suggestions, please let me know:)

As Mark suggested, you can just add " 2> /dev/null" at the end of the
findbase.pl call. That allows to do this warning suppression on a
case-by-case base, and is preferred over dropping this message in
general.

Cheers,
Andre

> 
> > 
> > But for the sake of this patch:
> > 
> > Reviewed-by: Andre Przywara <andre.przywara@arm.com>
> > 
> > Cheers,
> > Andre  
> 
> Thanks!
> Jaxson
> 
> >   
> > > Signed-off-by: Jaxson Han <jaxson.han@arm.com>
> > > ---
> > >  Makefile.am | 2 +-
> > >  platform.c  | 4 ++++
> > >  2 files changed, 5 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/Makefile.am b/Makefile.am index af694b7..e131207 100644
> > > --- a/Makefile.am
> > > +++ b/Makefile.am
> > > @@ -19,7 +19,7 @@ NR_CPUS         := $(shell echo $(CPU_IDS) | tr ',' ' ' | wc  
> > -w)  
> > >  DEFINES		= -DCNTFRQ=$(CNTFRQ)
> > >  DEFINES		+= -DCPU_IDS=$(CPU_IDS)
> > >  DEFINES		+= -DNR_CPUS=$(NR_CPUS)
> > > -DEFINES		+= -DSYSREGS_BASE=$(SYSREGS_BASE)
> > > +DEFINES		+= $(if $(SYSREGS_BASE), -  
> > DSYSREGS_BASE=$(SYSREGS_BASE), )  
> > >  DEFINES		+= -DUART_BASE=$(UART_BASE)
> > >  DEFINES		+= -DSTACK_SIZE=256
> > >
> > > diff --git a/platform.c b/platform.c
> > > index a528a55..d11f568 100644
> > > --- a/platform.c
> > > +++ b/platform.c
> > > @@ -23,10 +23,12 @@
> > >
> > >  #define PL011(reg)	((void *)UART_BASE + PL011_##reg)
> > >
> > > +#ifdef SYSREGS_BASE
> > >  #define V2M_SYS_CFGDATA		0xa0
> > >  #define V2M_SYS_CFGCTRL		0xa4
> > >
> > >  #define V2M_SYS(reg)	((void *)SYSREGS_BASE + V2M_SYS_##reg)
> > > +#endif
> > >
> > >  static void print_string(const char *str)  { @@ -59,6 +61,7 @@ void
> > > init_platform(void)
> > >
> > >  	print_string("Boot-wrapper v0.2\r\n\r\n");
> > >
> > > +#ifdef SYSREGS_BASE
> > >  	/*
> > >  	 * CLCD output site MB
> > >  	 */
> > > @@ -66,4 +69,5 @@ void init_platform(void)
> > >  	/* START | WRITE | MUXFPGA | SITE_MB */
> > >  	raw_writel((1 << 31) | (1 << 30) | (7 << 20) | (0 << 16),
> > >  				V2M_SYS(CFGCTRL));
> > > +#endif
> > >  }  
>
Jaxson Han May 10, 2021, 8:45 a.m. UTC | #4
Hi Andre,

> -----Original Message-----
> From: Andre Przywara <andre.przywara@arm.com>
> Sent: Monday, May 10, 2021 4:31 PM
> To: Jaxson Han <Jaxson.Han@arm.com>
> Cc: Mark Rutland <Mark.Rutland@arm.com>; linux-arm-
> kernel@lists.infradead.org; Wei Chen <Wei.Chen@arm.com>
> Subject: Re: [boot-wrapper PATCH 1/5] Decouple V2M_SYS config by auto-
> detect dtb node
> 
> On Wed, 28 Apr 2021 03:23:18 +0000
> Jaxson Han <Jaxson.Han@arm.com> wrote:
> 
> Hi Jaxson,
> 
> > Hi Andre,
> >
> > > -----Original Message-----
> > > From: Andre Przywara <andre.przywara@arm.com>
> > > Sent: Monday, April 26, 2021 7:30 PM
> > > To: Jaxson Han <Jaxson.Han@arm.com>
> > > Cc: Mark Rutland <Mark.Rutland@arm.com>; linux-arm-
> > > kernel@lists.infradead.org; Wei Chen <Wei.Chen@arm.com>
> > > Subject: Re: [boot-wrapper PATCH 1/5] Decouple V2M_SYS config by
> > > auto- detect dtb node
> > >
> > > On Tue, 20 Apr 2021 15:24:34 +0800
> > > Jaxson Han <jaxson.han@arm.com> wrote:
> > >
> > > Hi,
> > >
> > > > An auto-detect switch is added to make it an option to
> > > > enable/disable 'arm,vexpress-sysreg', because not all platforms support
> this feature.
> > >
> > > The change itself is fine, only has the side effect of now printing
> > > an message about the missing node:
> > > No matching devices found at ./findbase.pl line 37.
> > >
> > > I will have a look if we can avoid this, or we drop this message in
> > > findbase.pl at all.
> >
> > Thanks, if you have any suggestions, please let me know:)
> 
> As Mark suggested, you can just add " 2> /dev/null" at the end of the
> findbase.pl call. That allows to do this warning suppression on a case-by-case
> base, and is preferred over dropping this message in general.

Got it, thanks for the information :)

Cheers,
Jaxson

> 
> Cheers,
> Andre
> 
> >
> > >
> > > But for the sake of this patch:
> > >
> > > Reviewed-by: Andre Przywara <andre.przywara@arm.com>
> > >
> > > Cheers,
> > > Andre
> >
> > Thanks!
> > Jaxson
> >
> > >
> > > > Signed-off-by: Jaxson Han <jaxson.han@arm.com>
> > > > ---
> > > >  Makefile.am | 2 +-
> > > >  platform.c  | 4 ++++
> > > >  2 files changed, 5 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/Makefile.am b/Makefile.am index af694b7..e131207
> > > > 100644
> > > > --- a/Makefile.am
> > > > +++ b/Makefile.am
> > > > @@ -19,7 +19,7 @@ NR_CPUS         := $(shell echo $(CPU_IDS) | tr ',' ' ' |
> wc
> > > -w)
> > > >  DEFINES		= -DCNTFRQ=$(CNTFRQ)
> > > >  DEFINES		+= -DCPU_IDS=$(CPU_IDS)
> > > >  DEFINES		+= -DNR_CPUS=$(NR_CPUS)
> > > > -DEFINES		+= -DSYSREGS_BASE=$(SYSREGS_BASE)
> > > > +DEFINES		+= $(if $(SYSREGS_BASE), -
> > > DSYSREGS_BASE=$(SYSREGS_BASE), )
> > > >  DEFINES		+= -DUART_BASE=$(UART_BASE)
> > > >  DEFINES		+= -DSTACK_SIZE=256
> > > >
> > > > diff --git a/platform.c b/platform.c index a528a55..d11f568 100644
> > > > --- a/platform.c
> > > > +++ b/platform.c
> > > > @@ -23,10 +23,12 @@
> > > >
> > > >  #define PL011(reg)	((void *)UART_BASE + PL011_##reg)
> > > >
> > > > +#ifdef SYSREGS_BASE
> > > >  #define V2M_SYS_CFGDATA		0xa0
> > > >  #define V2M_SYS_CFGCTRL		0xa4
> > > >
> > > >  #define V2M_SYS(reg)	((void *)SYSREGS_BASE + V2M_SYS_##reg)
> > > > +#endif
> > > >
> > > >  static void print_string(const char *str)  { @@ -59,6 +61,7 @@
> > > > void
> > > > init_platform(void)
> > > >
> > > >  	print_string("Boot-wrapper v0.2\r\n\r\n");
> > > >
> > > > +#ifdef SYSREGS_BASE
> > > >  	/*
> > > >  	 * CLCD output site MB
> > > >  	 */
> > > > @@ -66,4 +69,5 @@ void init_platform(void)
> > > >  	/* START | WRITE | MUXFPGA | SITE_MB */
> > > >  	raw_writel((1 << 31) | (1 << 30) | (7 << 20) | (0 << 16),
> > > >  				V2M_SYS(CFGCTRL));
> > > > +#endif
> > > >  }
> >
diff mbox series

Patch

diff --git a/Makefile.am b/Makefile.am
index af694b7..e131207 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -19,7 +19,7 @@  NR_CPUS         := $(shell echo $(CPU_IDS) | tr ',' ' ' | wc -w)
 DEFINES		= -DCNTFRQ=$(CNTFRQ)
 DEFINES		+= -DCPU_IDS=$(CPU_IDS)
 DEFINES		+= -DNR_CPUS=$(NR_CPUS)
-DEFINES		+= -DSYSREGS_BASE=$(SYSREGS_BASE)
+DEFINES		+= $(if $(SYSREGS_BASE), -DSYSREGS_BASE=$(SYSREGS_BASE), )
 DEFINES		+= -DUART_BASE=$(UART_BASE)
 DEFINES		+= -DSTACK_SIZE=256
 
diff --git a/platform.c b/platform.c
index a528a55..d11f568 100644
--- a/platform.c
+++ b/platform.c
@@ -23,10 +23,12 @@ 
 
 #define PL011(reg)	((void *)UART_BASE + PL011_##reg)
 
+#ifdef SYSREGS_BASE
 #define V2M_SYS_CFGDATA		0xa0
 #define V2M_SYS_CFGCTRL		0xa4
 
 #define V2M_SYS(reg)	((void *)SYSREGS_BASE + V2M_SYS_##reg)
+#endif
 
 static void print_string(const char *str)
 {
@@ -59,6 +61,7 @@  void init_platform(void)
 
 	print_string("Boot-wrapper v0.2\r\n\r\n");
 
+#ifdef SYSREGS_BASE
 	/*
 	 * CLCD output site MB
 	 */
@@ -66,4 +69,5 @@  void init_platform(void)
 	/* START | WRITE | MUXFPGA | SITE_MB */
 	raw_writel((1 << 31) | (1 << 30) | (7 << 20) | (0 << 16),
 				V2M_SYS(CFGCTRL));
+#endif
 }