diff --git a/boards/arm/gd32f4/gd32f450zk-eval/src/Makefile b/boards/arm/gd32f4/gd32f450zk-eval/src/Makefile index 227eef9f65..ffe587ebd6 100644 --- a/boards/arm/gd32f4/gd32f450zk-eval/src/Makefile +++ b/boards/arm/gd32f4/gd32f450zk-eval/src/Makefile @@ -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 diff --git a/boards/arm/gd32f4/gd32f450zk-eval/src/gd32f450z_eval.h b/boards/arm/gd32f4/gd32f450zk-eval/src/gd32f450z_eval.h index 02f8f7d651..f078889805 100644 --- a/boards/arm/gd32f4/gd32f450zk-eval/src/gd32f450z_eval.h +++ b/boards/arm/gd32f4/gd32f450zk-eval/src/gd32f450z_eval.h @@ -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 * diff --git a/boards/arm/gd32f4/gd32f450zk-eval/src/gd32f4xx_boot.c b/boards/arm/gd32f4/gd32f450zk-eval/src/gd32f4xx_boot.c index 1a36b5aaa1..dd3b25f99f 100644 --- a/boards/arm/gd32f4/gd32f450zk-eval/src/gd32f4xx_boot.c +++ b/boards/arm/gd32f4/gd32f450zk-eval/src/gd32f4xx_boot.c @@ -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 diff --git a/boards/arm/gd32f4/gd32f450zk-eval/src/gd32f4xx_bringup.c b/boards/arm/gd32f4/gd32f450zk-eval/src/gd32f4xx_bringup.c index 13b713bd86..b645891b82 100644 --- a/boards/arm/gd32f4/gd32f450zk-eval/src/gd32f4xx_bringup.c +++ b/boards/arm/gd32f4/gd32f450zk-eval/src/gd32f4xx_bringup.c @@ -35,7 +35,6 @@ #include #include #include -#include #include #include @@ -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 */ diff --git a/boards/arm/gd32f4/gd32f470ik-eval/src/Makefile b/boards/arm/gd32f4/gd32f470ik-eval/src/Makefile index 0d28f25545..32355d720c 100644 --- a/boards/arm/gd32f4/gd32f470ik-eval/src/Makefile +++ b/boards/arm/gd32f4/gd32f470ik-eval/src/Makefile @@ -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 diff --git a/boards/arm/gd32f4/gd32f470ik-eval/src/gd32f470i_eval.h b/boards/arm/gd32f4/gd32f470ik-eval/src/gd32f470i_eval.h index b6cd49c957..bb57a07953 100644 --- a/boards/arm/gd32f4/gd32f470ik-eval/src/gd32f470i_eval.h +++ b/boards/arm/gd32f4/gd32f470ik-eval/src/gd32f470i_eval.h @@ -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 * diff --git a/boards/arm/gd32f4/gd32f470ik-eval/src/gd32f4xx_boot.c b/boards/arm/gd32f4/gd32f470ik-eval/src/gd32f4xx_boot.c index 6500db7179..c89990a51e 100644 --- a/boards/arm/gd32f4/gd32f470ik-eval/src/gd32f4xx_boot.c +++ b/boards/arm/gd32f4/gd32f470ik-eval/src/gd32f4xx_boot.c @@ -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 diff --git a/boards/arm/gd32f4/gd32f470ik-eval/src/gd32f4xx_bringup.c b/boards/arm/gd32f4/gd32f470ik-eval/src/gd32f4xx_bringup.c index 83a70fbd66..0bf2fd30e8 100644 --- a/boards/arm/gd32f4/gd32f470ik-eval/src/gd32f4xx_bringup.c +++ b/boards/arm/gd32f4/gd32f470ik-eval/src/gd32f4xx_bringup.c @@ -35,7 +35,6 @@ #include #include #include -#include #include #include @@ -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 */ diff --git a/boards/arm/gd32f4/gd32f470zk-eval/src/Makefile b/boards/arm/gd32f4/gd32f470zk-eval/src/Makefile index d7600631ea..af1afed207 100644 --- a/boards/arm/gd32f4/gd32f470zk-eval/src/Makefile +++ b/boards/arm/gd32f4/gd32f470zk-eval/src/Makefile @@ -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 diff --git a/boards/arm/gd32f4/gd32f470zk-eval/src/gd32f470z_eval.h b/boards/arm/gd32f4/gd32f470zk-eval/src/gd32f470z_eval.h index 77f772f29b..a9fc5d06b9 100644 --- a/boards/arm/gd32f4/gd32f470zk-eval/src/gd32f470z_eval.h +++ b/boards/arm/gd32f4/gd32f470zk-eval/src/gd32f470z_eval.h @@ -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 * diff --git a/boards/arm/gd32f4/gd32f470zk-eval/src/gd32f4xx_boot.c b/boards/arm/gd32f4/gd32f470zk-eval/src/gd32f4xx_boot.c index 055d98cdcd..53b6ea21a5 100644 --- a/boards/arm/gd32f4/gd32f470zk-eval/src/gd32f4xx_boot.c +++ b/boards/arm/gd32f4/gd32f470zk-eval/src/gd32f4xx_boot.c @@ -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 diff --git a/boards/arm/gd32f4/gd32f470zk-eval/src/gd32f4xx_bringup.c b/boards/arm/gd32f4/gd32f470zk-eval/src/gd32f4xx_bringup.c index d4df0016b5..87e624853f 100644 --- a/boards/arm/gd32f4/gd32f470zk-eval/src/gd32f4xx_bringup.c +++ b/boards/arm/gd32f4/gd32f470zk-eval/src/gd32f4xx_bringup.c @@ -35,7 +35,6 @@ #include #include #include -#include #include #include @@ -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 */