arm64: add arm64_serialinit/arm64_earlyserialinit

Summary:

   add arm64_serialinit/arm64_earlyserialinit function prototype
to arm64_internal.h as common function for arm64 based chip.
   Testing with ostest in SP and SMP

Signed-off-by: qinwei1 <qinwei1@xiaomi.com>
This commit is contained in:
qinwei1 2023-03-04 23:34:06 +08:00 committed by Xiang Xiao
parent a3badd26a0
commit e3f0f86514
10 changed files with 38 additions and 71 deletions

View File

@ -118,7 +118,7 @@ void arm64_chip_boot(void)
* driver.
*/
a64_earlyserialinit();
arm64_earlyserialinit();
#endif
}

View File

@ -589,7 +589,7 @@ static struct uart_dev_s g_uart1port =
***************************************************************************/
/***************************************************************************
* Name: a64_earlyserialinit
* Name: arm64_earlyserialinit
*
* Description:
* Performs the low level UART initialization early in
@ -601,7 +601,7 @@ static struct uart_dev_s g_uart1port =
*
***************************************************************************/
void a64_earlyserialinit(void)
void arm64_earlyserialinit(void)
{
/* NOTE: This function assumes that low level hardware configuration
* -- including all clocking and pin configuration -- was performed

View File

@ -57,19 +57,5 @@
* Public Function Prototypes
****************************************************************************/
/****************************************************************************
* Name: a64_earlyserialinit
*
* Description:
* Performs the low level UART initialization early in debug so that the
* serial console will be available during bootup. This must be called
* before arm64_serialinit.
*
****************************************************************************/
#ifdef USE_EARLYSERIALINIT
void a64_earlyserialinit(void);
#endif
#endif /* __ASSEMBLY__ */
#endif /* __ARCH_ARM64_SRC_A64_A64_SERIAL_H */

View File

@ -290,10 +290,35 @@ uint64_t * arm64_syscall_switch(uint64_t *regs);
int arm64_syscall(uint64_t *regs);
#ifdef USE_SERIALDRIVER
/****************************************************************************
* Name: arm64_serialinit
*
* Description:
* Register serial console and serial ports. This assumes
* that arm64_earlyserialinit was called previously.
*
****************************************************************************/
void arm64_serialinit(void);
#endif
#ifdef USE_EARLYSERIALINIT
/****************************************************************************
* Name: arm64_earlyserialinit
*
* Description:
* Performs the low level UART initialization early in debug so that the
* serial console will be available during bootup. This must be called
* before arm64_serialinit.
*
* Note:
* This function assumes that low level hardware configuration
* including all clocking and pin configuration -- was performed
* earlier in the boot sequence(eg bootloader).
*
****************************************************************************/
void arm64_earlyserialinit(void);
#endif

View File

@ -200,6 +200,6 @@ void arm64_chip_boot(void)
* driver.
*/
fvp_earlyserialinit();
arm64_earlyserialinit();
#endif
}

View File

@ -781,22 +781,15 @@ static struct uart_dev_s g_uart1port =
***************************************************************************/
/***************************************************************************
* Name: qemu_earlyserialinit
* Name: arm64_earlyserialinit
*
* Description:
* Performs the low level UART initialization early in
* debug so that the serial console will be available
* during bootup. This must be called before arm_serialinit.
* see arm64_internal.h
*
***************************************************************************/
void fvp_earlyserialinit(void)
void arm64_earlyserialinit(void)
{
/* NOTE: This function assumes that low level hardware configuration
* -- including all clocking and pin configuration -- was performed by the
* function imx8_lowsetup() earlier in the boot sequence.
*/
/* Enable the console UART. The other UARTs will be initialized if and
* when they are first opened.
*/
@ -834,8 +827,7 @@ int up_putc(int ch)
* Name: arm64_serialinit
*
* Description:
* Register serial console and serial ports. This assumes
* that imx_earlyserialinit was called previously.
* see arm64_internal.h
*
***************************************************************************/

View File

@ -64,19 +64,5 @@
* Public Function Prototypes
****************************************************************************/
/****************************************************************************
* Name: fvp_earlyserialinit
*
* Description:
* Performs the low level UART initialization early in debug so that the
* serial console will be available during bootup. This must be called
* before arm_serialinit.
*
****************************************************************************/
#ifdef USE_EARLYSERIALINIT
void fvp_earlyserialinit(void);
#endif
#endif /* __ASSEMBLY__ */
#endif /* __ARCH_ARM64_SRC_FVP_V8R_SERIAL_PL011_H */

View File

@ -173,6 +173,6 @@ void arm64_chip_boot(void)
* driver.
*/
qemu_earlyserialinit();
arm64_earlyserialinit();
#endif
}

View File

@ -786,22 +786,15 @@ static struct uart_dev_s g_uart1port =
***************************************************************************/
/***************************************************************************
* Name: qemu_earlyserialinit
* Name: arm64_earlyserialinit
*
* Description:
* Performs the low level UART initialization early in
* debug so that the serial console will be available
* during bootup. This must be called before arm_serialinit.
* see arm64_internal.h
*
***************************************************************************/
void qemu_earlyserialinit(void)
void arm64_earlyserialinit(void)
{
/* NOTE: This function assumes that low level hardware configuration
* -- including all clocking and pin configuration -- was performed by the
* function imx8_lowsetup() earlier in the boot sequence.
*/
/* Enable the console UART. The other UARTs will be initialized if and
* when they are first opened.
*/
@ -839,8 +832,7 @@ int up_putc(int ch)
* Name: arm64_serialinit
*
* Description:
* Register serial console and serial ports. This assumes
* that imx_earlyserialinit was called previously.
* see arm64_internal.h
*
***************************************************************************/

View File

@ -57,19 +57,5 @@
* Public Function Prototypes
****************************************************************************/
/****************************************************************************
* Name: qemu_earlyserialinit
*
* Description:
* Performs the low level UART initialization early in debug so that the
* serial console will be available during bootup. This must be called
* before arm_serialinit.
*
****************************************************************************/
#ifdef USE_EARLYSERIALINIT
void qemu_earlyserialinit(void);
#endif
#endif /* __ASSEMBLY__ */
#endif /* __ARCH_ARM64_SRC_QEMU_QEMU_SERIAL_H */