From 151fec4e98ef6ebfb7674c7409cf563dd26a8310 Mon Sep 17 00:00:00 2001 From: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com> Date: Wed, 19 May 2021 17:04:41 +0900 Subject: [PATCH] arch: cxd56xx: Do not re-initialize the console for subcore If the subcore configuration, which is mainly used in the Spresense Arduino environment, is enabled, the serial console has been already initialized by maincore. Then, don't need to re-initialize the UART1 serial driver. --- arch/arm/src/cxd56xx/cxd56_serial.c | 11 +++++++++++ arch/arm/src/cxd56xx/cxd56_start.c | 4 +++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/arch/arm/src/cxd56xx/cxd56_serial.c b/arch/arm/src/cxd56xx/cxd56_serial.c index 6ef147a04e2..4f62145f998 100644 --- a/arch/arm/src/cxd56xx/cxd56_serial.c +++ b/arch/arm/src/cxd56xx/cxd56_serial.c @@ -460,6 +460,17 @@ static int up_setup(FAR struct uart_dev_s *dev) uint32_t lcr; uint32_t cr; +#ifdef CONFIG_CXD56_SUBCORE + if (priv->id == 1) + { + /* In case of SUBCORE, UART1 has been already initialized, + * then we don't need to do anything. + */ + + return OK; + } +#endif + cxd56_uart_setup(priv->id); /* Init HW */ diff --git a/arch/arm/src/cxd56xx/cxd56_start.c b/arch/arm/src/cxd56xx/cxd56_start.c index 0518be6c92e..d85f4848606 100644 --- a/arch/arm/src/cxd56xx/cxd56_start.c +++ b/arch/arm/src/cxd56xx/cxd56_start.c @@ -303,7 +303,9 @@ void __start(void) putreg32(0, CXD56_EXCCONF_BASE + 0); +#ifndef CONFIG_CXD56_SUBCORE cxd56_lowsetup(); +#endif showprogress('A'); /* Clear .bss. We'll do this inline (vs. calling memset) just to be @@ -327,7 +329,7 @@ void __start(void) /* Perform early serial initialization */ -#ifdef USE_EARLYSERIALINIT +#if defined(USE_EARLYSERIALINIT) && !defined(CONFIG_CXD56_SUBCORE) arm_earlyserialinit(); #endif showprogress('E');