Re: [boot-wrapper PATCH v3 1/8] Decouple V2M_SYS config by auto-detect dtb node
From: Mark Rutland <mark.rutland@arm.com>
Date: 2021-07-22 10:44:00
On Tue, May 25, 2021 at 02:25:02PM +0800, Jaxson Han wrote:
An auto-detect switch is added to make it an option to enable/disable 'arm,vexpress-sysreg', because not all platforms support this feature. But the auto-detection generates the side-effect of printing a warning message about the missing node: No matching devices found at ./findbase.pl line 37. In this case, to drop the warning message, add "2> /dev/null" at the end of the findbase.pl call. Signed-off-by: Jaxson Han <redacted> Reviewed-by: Andre Przywara <andre.przywara@arm.com>
This looks good to me; I'll apply it shortly. Thanks, Mark.
quoted hunk ↗ jump to hunk
--- Makefile.am | 4 ++-- platform.c | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-)diff --git a/Makefile.am b/Makefile.am index af694b7..ef6b793 100644 --- a/Makefile.am +++ b/Makefile.am@@ -10,7 +10,7 @@ # VE PHYS_OFFSET := $(shell perl -I $(top_srcdir) $(top_srcdir)/findmem.pl $(KERNEL_DTB)) UART_BASE := $(shell perl -I $(top_srcdir) $(top_srcdir)/findbase.pl $(KERNEL_DTB) 0 'arm,pl011') -SYSREGS_BASE := $(shell perl -I $(top_srcdir) $(top_srcdir)/findbase.pl $(KERNEL_DTB) 0 'arm,vexpress-sysreg') +SYSREGS_BASE := $(shell perl -I $(top_srcdir) $(top_srcdir)/findbase.pl $(KERNEL_DTB) 0 'arm,vexpress-sysreg' 2> /dev/null) CNTFRQ := 0x01800000 # 24Mhz CPU_IDS := $(shell perl -I $(top_srcdir) $(top_srcdir)/findcpuids.pl $(KERNEL_DTB))@@ -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=256diff --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 }-- 2.25.1
_______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel