Added the comments of bringup() under gd32fxxx.h, modified the compilation options of the makefile, and modified the execution logic of the board_late_initialize(), which is consistent with the stm32 series.

This commit is contained in:
GC2020 2024-01-30 21:04:09 +08:00 committed by Xiang Xiao
parent 95de7b8420
commit 6308a53274
12 changed files with 87 additions and 75 deletions

View File

@ -22,15 +22,16 @@ include $(TOPDIR)/Make.defs
CSRCS = gd32f4xx_boot.c
ifeq ($(CONFIG_BOARDCTL),y)
CSRCS += gd32f4xx_appinit.c
endif
# ifeq ($(CONFIG_BOARDCTL),y)
# CSRCS += gd32f4xx_appinit.c gd32f4xx_bringup.c
# else ifeq ($(CONFIG_BOARD_LATE_INITIALIZE),y)
# CSRCS += gd32f4xx_bringup.c
# CSRCS += gd32f4xx_appinit.c
# endif
ifeq ($(CONFIG_BOARDCTL),y)
CSRCS += gd32f4xx_appinit.c gd32f4xx_bringup.c
else ifeq ($(CONFIG_BOARD_LATE_INITIALIZE),y)
CSRCS += gd32f4xx_bringup.c
endif
ifeq ($(CONFIG_ARCH_LEDS),y)
CSRCS += gd32f4xx_autoleds.c
else

View File

@ -180,6 +180,26 @@
#ifndef __ASSEMBLY__
/****************************************************************************
* Name: gd32_bringup
*
* Description:
* Perform architecture specific initialization
*
* CONFIG_BOARDCTL=y:
* If CONFIG_NSH_ARCHINIT=y:
* Called from the NSH library (or other application)
* Otherwise, assumed to be called from some other application.
*
* Otherwise CONFIG_BOARD_LATE_INITIALIZE=y:
* Called from board_late_initialize().
*
* Otherwise, bad news: Never called
*
****************************************************************************/
int gd32_bringup(void);
/****************************************************************************
* Name: gd32_spidev_initialize
*

View File

@ -78,13 +78,8 @@ void gd32_boardinitialize(void)
#ifdef CONFIG_BOARD_LATE_INITIALIZE
void board_late_initialize(void)
{
#if defined(CONFIG_NSH_LIBRARY) && !defined(CONFIG_BOARDCTL)
/* Perform NSH initialization here instead of from the NSH. This
* alternative NSH initialization is necessary when NSH is ran in
* user-space but the initialization function must run in kernel space.
*/
/* Perform board-specific initialization */
board_app_initialize(0);
#endif
gd32_bringup();
}
#endif

View File

@ -35,7 +35,6 @@
#include <nuttx/mtd/mtd.h>
#include <nuttx/fs/fs.h>
#include <nuttx/fs/nxffs.h>
#include <nuttx/fs/rpmsgfs.h>
#include <nuttx/spi/spi_transfer.h>
#include <nuttx/rc/dummy.h>
@ -194,17 +193,6 @@ int gd32_bringup(void)
}
#endif
#ifdef CONFIG_FS_PROCFS
/* Mount the procfs file system */
ret = nx_mount(NULL, GD32_PROCFS_MOUNTPOINT, "procfs", 0, NULL);
if (ret < 0)
{
syslog(LOG_ERR, "ERROR: Failed to mount procfs at %s: %d\n",
GD32_PROCFS_MOUNTPOINT, ret);
}
#endif
#ifdef CONFIG_GD32F4_ROMFS
/* Mount the romfs partition */

View File

@ -22,15 +22,16 @@ include $(TOPDIR)/Make.defs
CSRCS = gd32f4xx_boot.c
ifeq ($(CONFIG_BOARDCTL),y)
CSRCS += gd32f4xx_appinit.c
endif
# ifeq ($(CONFIG_BOARDCTL),y)
# CSRCS += gd32f4xx_appinit.c gd32f4xx_bringup.c
# else ifeq ($(CONFIG_BOARD_LATE_INITIALIZE),y)
# CSRCS += gd32f4xx_bringup.c
# CSRCS += gd32f4xx_appinit.c
# endif
ifeq ($(CONFIG_BOARDCTL),y)
CSRCS += gd32f4xx_appinit.c gd32f4xx_bringup.c
else ifeq ($(CONFIG_BOARD_LATE_INITIALIZE),y)
CSRCS += gd32f4xx_bringup.c
endif
ifeq ($(CONFIG_ARCH_LEDS),y)
CSRCS += gd32f4xx_autoleds.c
else

View File

@ -180,6 +180,26 @@
#ifndef __ASSEMBLY__
/****************************************************************************
* Name: gd32_bringup
*
* Description:
* Perform architecture specific initialization
*
* CONFIG_BOARDCTL=y:
* If CONFIG_NSH_ARCHINITIALIZE=y:
* Called from the NSH library (or other application)
* Otherwise, assumed to be called from some other application.
*
* Otherwise CONFIG_BOARD_LATE_INITIALIZE=y:
* Called from board_late_initialize().
*
* Otherwise, bad news: Never called
*
****************************************************************************/
int gd32_bringup(void);
/****************************************************************************
* Name: gd32_spidev_initialize
*

View File

@ -78,13 +78,8 @@ void gd32_boardinitialize(void)
#ifdef CONFIG_BOARD_LATE_INITIALIZE
void board_late_initialize(void)
{
#if defined(CONFIG_NSH_LIBRARY) && !defined(CONFIG_BOARDCTL)
/* Perform NSH initialization here instead of from the NSH. This
* alternative NSH initialization is necessary when NSH is ran in
* user-space but the initialization function must run in kernel space.
*/
/* Perform board-specific initialization */
board_app_initialize(0);
#endif
gd32_bringup();
}
#endif

View File

@ -35,7 +35,6 @@
#include <nuttx/mtd/mtd.h>
#include <nuttx/fs/fs.h>
#include <nuttx/fs/nxffs.h>
#include <nuttx/fs/rpmsgfs.h>
#include <nuttx/spi/spi_transfer.h>
#include <nuttx/rc/dummy.h>
@ -194,17 +193,6 @@ int gd32_bringup(void)
}
#endif
#ifdef CONFIG_FS_PROCFS
/* Mount the procfs file system */
ret = nx_mount(NULL, GD32_PROCFS_MOUNTPOINT, "procfs", 0, NULL);
if (ret < 0)
{
syslog(LOG_ERR, "ERROR: Failed to mount procfs at %s: %d\n",
GD32_PROCFS_MOUNTPOINT, ret);
}
#endif
#ifdef CONFIG_GD32F4_ROMFS
/* Mount the romfs partition */

View File

@ -22,15 +22,16 @@ include $(TOPDIR)/Make.defs
CSRCS = gd32f4xx_boot.c
ifeq ($(CONFIG_BOARDCTL),y)
CSRCS += gd32f4xx_appinit.c
endif
# ifeq ($(CONFIG_BOARDCTL),y)
# CSRCS += gd32f4xx_appinit.c gd32f4xx_bringup.c
# else ifeq ($(CONFIG_BOARD_LATE_INITIALIZE),y)
# CSRCS += gd32f4xx_bringup.c
# CSRCS += gd32f4xx_appinit.c
# endif
ifeq ($(CONFIG_BOARDCTL),y)
CSRCS += gd32f4xx_appinit.c gd32f4xx_bringup.c
else ifeq ($(CONFIG_BOARD_LATE_INITIALIZE),y)
CSRCS += gd32f4xx_bringup.c
endif
ifeq ($(CONFIG_ARCH_LEDS),y)
CSRCS += gd32f4xx_autoleds.c
else

View File

@ -180,6 +180,26 @@
#ifndef __ASSEMBLY__
/****************************************************************************
* Name: gd32_bringup
*
* Description:
* Perform architecture specific initialization
*
* CONFIG_BOARDCTL=y:
* If CONFIG_NSH_ARCHINITIALIZE=y:
* Called from the NSH library (or other application)
* Otherwise, assumed to be called from some other application.
*
* Otherwise CONFIG_BOARD_LATE_INITIALIZE=y:
* Called from board_late_initialize().
*
* Otherwise, bad news: Never called
*
****************************************************************************/
int gd32_bringup(void);
/****************************************************************************
* Name: gd32_spidev_initialize
*

View File

@ -78,13 +78,8 @@ void gd32_boardinitialize(void)
#ifdef CONFIG_BOARD_LATE_INITIALIZE
void board_late_initialize(void)
{
#if defined(CONFIG_NSH_LIBRARY) && !defined(CONFIG_BOARDCTL)
/* Perform NSH initialization here instead of from the NSH. This
* alternative NSH initialization is necessary when NSH is ran in
* user-space but the initialization function must run in kernel space.
*/
/* Perform board-specific initialization */
board_app_initialize(0);
#endif
gd32_bringup();
}
#endif

View File

@ -35,7 +35,6 @@
#include <nuttx/mtd/mtd.h>
#include <nuttx/fs/fs.h>
#include <nuttx/fs/nxffs.h>
#include <nuttx/fs/rpmsgfs.h>
#include <nuttx/spi/spi_transfer.h>
#include <nuttx/rc/dummy.h>
@ -194,17 +193,6 @@ int gd32_bringup(void)
}
#endif
#ifdef CONFIG_FS_PROCFS
/* Mount the procfs file system */
ret = nx_mount(NULL, GD32_PROCFS_MOUNTPOINT, "procfs", 0, NULL);
if (ret < 0)
{
syslog(LOG_ERR, "ERROR: Failed to mount procfs at %s: %d\n",
GD32_PROCFS_MOUNTPOINT, ret);
}
#endif
#ifdef CONFIG_GD32F4_ROMFS
/* Mount the romfs partition */