boards/arm64: Replace board_app_initialize

Replaced board_app_initialize logic with board_late_initialize.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
This commit is contained in:
Matteo Golin
2026-02-18 19:41:43 -05:00
committed by Xiang Xiao
parent 46182069c8
commit d0ee99a8a9
33 changed files with 35 additions and 909 deletions
@@ -22,7 +22,7 @@
set(SRCS a527_boardinit.c a527_bringup.c)
if(CONFIG_BOARDCTL)
list(APPEND SRCS a527_appinit.c a527_power.c)
list(APPEND SRCS a527_power.c)
endif()
target_sources(board PRIVATE ${SRCS})
-4
View File
@@ -24,8 +24,4 @@ include $(TOPDIR)/Make.defs
CSRCS = a527_boardinit.c a527_bringup.c
ifeq ($(CONFIG_BOARDCTL),y)
CSRCS += a527_appinit.c a527_power.c
endif
include $(TOPDIR)/boards/Board.mk
@@ -1,75 +0,0 @@
/****************************************************************************
* boards/arm64/a527/avaota-a1/src/a527_appinit.c
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <nuttx/board.h>
#include "avaota-a1.h"
#ifdef CONFIG_BOARDCTL
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: board_app_initialize
*
* Description:
* Perform application specific initialization. This function is never
* called directly from application code, but only indirectly via the
* (non-standard) boardctl() interface using the command BOARDIOC_INIT.
*
* Input Parameters:
* arg - The boardctl() argument is passed to the board_app_initialize()
* implementation without modification. The argument has no
* meaning to NuttX; the meaning of the argument is a contract
* between the board-specific initialization logic and the
* matching application logic. The value could be such things as a
* mode enumeration value, a set of DIP switch switch settings, a
* pointer to configuration data read from a file or serial FLASH,
* or whatever you would like to do with it. Every implementation
* should accept zero/NULL as a default configuration.
*
* Returned Value:
* Zero (OK) is returned on success; a negated errno value is returned on
* any failure to indicate the nature of the failure.
*
****************************************************************************/
int board_app_initialize(uintptr_t arg)
{
UNUSED(arg);
#ifndef CONFIG_BOARD_LATE_INITIALIZE
/* Perform board initialization */
return a527_bringup();
#else
return OK;
#endif
}
#endif /* CONFIG_BOARDCTL */
@@ -23,7 +23,6 @@
set(SRCS pinephone_boardinit.c pinephone_bringup.c pinephone_pmic.c)
if(CONFIG_BOARDCTL)
list(APPEND SRCS pinephone_appinit.c)
if(CONFIG_BOARDCTL_RESET)
list(APPEND SRCS pinephone_reset.c)
endif()
-3
View File
@@ -24,12 +24,9 @@ include $(TOPDIR)/Make.defs
CSRCS = pinephone_boardinit.c pinephone_bringup.c pinephone_pmic.c
ifeq ($(CONFIG_BOARDCTL),y)
CSRCS += pinephone_appinit.c
ifeq ($(CONFIG_BOARDCTL_RESET),y)
CSRCS += pinephone_reset.c
endif
endif
ifeq ($(CONFIG_ARCH_LEDS),y)
CSRCS += pinephone_autoleds.c
@@ -1,75 +0,0 @@
/****************************************************************************
* boards/arm64/a64/pinephone/src/pinephone_appinit.c
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <nuttx/board.h>
#include "pinephone.h"
#ifdef CONFIG_BOARDCTL
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: board_app_initialize
*
* Description:
* Perform application specific initialization. This function is never
* called directly from application code, but only indirectly via the
* (non-standard) boardctl() interface using the command BOARDIOC_INIT.
*
* Input Parameters:
* arg - The boardctl() argument is passed to the board_app_initialize()
* implementation without modification. The argument has no
* meaning to NuttX; the meaning of the argument is a contract
* between the board-specific initialization logic and the
* matching application logic. The value could be such things as a
* mode enumeration value, a set of DIP switch switch settings, a
* pointer to configuration data read from a file or serial FLASH,
* or whatever you would like to do with it. Every implementation
* should accept zero/NULL as a default configuration.
*
* Returned Value:
* Zero (OK) is returned on success; a negated errno value is returned on
* any failure to indicate the nature of the failure.
*
****************************************************************************/
int board_app_initialize(uintptr_t arg)
{
UNUSED(arg);
#ifndef CONFIG_BOARD_LATE_INITIALIZE
/* Perform board initialization */
return pinephone_bringup();
#else
return OK;
#endif
}
#endif /* CONFIG_BOARDCTL */
@@ -24,10 +24,6 @@ if(CONFIG_ARCH_LEDS)
list(APPEND SRCS rpi4b_autoleds.c)
endif()
if(CONFIG_BOARDCTL)
list(APPEND SRCS rpi4b_appinit.c)
endif()
if(CONFIG_DEV_GPIO)
list(APPEND SRCS rpi4b_gpio.c)
endif()
@@ -26,10 +26,6 @@ ifeq ($(CONFIG_ARCH_LEDS),y)
CSRCS += rpi4b_autoleds.c
endif
ifeq ($(CONFIG_BOARDCTL),y)
CSRCS += rpi4b_appinit.c
endif
ifeq ($(CONFIG_DEV_GPIO),y)
CSRCS += rpi4b_gpio.c
endif
@@ -1,101 +0,0 @@
/****************************************************************************
* boards/arm64/bcm2711/raspberrypi-4b/src/rpi4b_appinit.c
*
* Author: Matteo Golin <matteo.golin@gmail.com>
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <nuttx/debug.h>
#include <sys/types.h>
#include <nuttx/board.h>
#include <nuttx/fs/fs.h>
#include "rpi4b.h"
#include <arch/board/board.h>
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: board_app_initialize
*
* Description:
* Perform application specific initialization. This function is never
* called directly from application code, but only indirectly via the
* (non-standard) boardctl() interface using the command BOARDIOC_INIT.
*
* Input Parameters:
* arg - The boardctl() argument is passed to the board_app_initialize()
* implementation without modification. The argument has no
* meaning to NuttX; the meaning of the argument is a contract
* between the board-specific initialization logic and the
* matching application logic. The value could be such things as a
* mode enumeration value, a set of DIP switch switch settings, a
* pointer to configuration data read from a file or serial FLASH,
* or whatever you would like to do with it. Every implementation
* should accept zero/NULL as a default configuration.
*
* Returned Value:
* Zero (OK) is returned on success; a negated errno value is returned on
* any failure to indicate the nature of the failure.
*
****************************************************************************/
int board_app_initialize(uintptr_t arg)
{
UNUSED(arg);
int ret = OK;
#ifdef CONFIG_FS_PROCFS
/* Mount the proc file system */
ret = nx_mount(NULL, "/proc", "procfs", 0, NULL);
if (ret < 0)
{
syslog(LOG_ERR, "ERROR: Failed to mount procfs at /proc: %d\n", ret);
}
#endif
#ifndef CONFIG_BOARD_LATE_INITIALIZE
/* Perform board initialization */
ret = rpi4b_bringup();
#endif
#ifdef CONFIG_RPI4B_MOUNT_BOOT
/* Mount SD card file system (currently just the boot (first) partition).
* Assumes /dev/mmcsd0 exists, but if it doesn't it will fail gracefully.
*/
ret = nx_mount("/dev/mmcsd0", "/sd", "vfat", 0, NULL);
if (ret < 0)
{
syslog(LOG_ERR, "Could not mount SD card FAT partition: %d\n", ret);
}
#endif
return ret;
}
@@ -27,8 +27,12 @@
#include <nuttx/config.h>
#include <stdint.h>
#include <sys/types.h>
#include <syslog.h>
#include <nuttx/board.h>
#include <nuttx/fs/fs.h>
#include <arch/board/board.h>
#include "rpi4b.h"
@@ -104,8 +108,32 @@ void bcm2711_board_initialize(void)
#ifdef CONFIG_BOARD_LATE_INITIALIZE
void board_late_initialize(void)
{
int ret = 0;
#ifdef CONFIG_FS_PROCFS
/* Mount the proc file system */
ret = nx_mount(NULL, "/proc", "procfs", 0, NULL);
if (ret < 0)
{
syslog(LOG_ERR, "ERROR: Failed to mount procfs at /proc: %d\n", ret);
}
#endif
/* Perform board initialization */
rpi4b_bringup();
ret = rpi4b_bringup();
#ifdef CONFIG_RPI4B_MOUNT_BOOT
/* Mount SD card file system (currently just the boot (first) partition).
* Assumes /dev/mmcsd0 exists, but if it doesn't it will fail gracefully.
*/
ret = nx_mount("/dev/mmcsd0", "/sd", "vfat", 0, NULL);
if (ret < 0)
{
syslog(LOG_ERR, "Could not mount SD card FAT partition: %d\n", ret);
}
#endif
}
#endif /* CONFIG_BOARD_LATE_INITIALIZE */
@@ -21,8 +21,4 @@
# ##############################################################################
set(SRCS fvp_boardinit.c fvp_bringup.c)
if(CONFIG_BOARDCTL)
list(APPEND SRCS fvp_appinit.c)
endif()
target_sources(board PRIVATE ${SRCS})
@@ -24,8 +24,4 @@ include $(TOPDIR)/Make.defs
CSRCS = fvp_boardinit.c fvp_bringup.c
ifeq ($(CONFIG_BOARDCTL),y)
CSRCS += fvp_appinit.c
endif
include $(TOPDIR)/boards/Board.mk
@@ -1,75 +0,0 @@
/****************************************************************************
* boards/arm64/fvp-v8r/fvp-armv8r/src/fvp_appinit.c
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <nuttx/board.h>
#include "fvp-armv8r.h"
#ifdef CONFIG_BOARDCTL
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: board_app_initialize
*
* Description:
* Perform application specific initialization. This function is never
* called directly from application code, but only indirectly via the
* (non-standard) boardctl() interface using the command BOARDIOC_INIT.
*
* Input Parameters:
* arg - The boardctl() argument is passed to the board_app_initialize()
* implementation without modification. The argument has no
* meaning to NuttX; the meaning of the argument is a contract
* between the board-specific initialization logic and the
* matching application logic. The value could be such things as a
* mode enumeration value, a set of DIP switch switch settings, a
* pointer to configuration data read from a file or serial FLASH,
* or whatever you would like to do with it. Every implementation
* should accept zero/NULL as a default configuration.
*
* Returned Value:
* Zero (OK) is returned on success; a negated errno value is returned on
* any failure to indicate the nature of the failure.
*
****************************************************************************/
int board_app_initialize(uintptr_t arg)
{
UNUSED(arg);
#ifndef CONFIG_BOARD_LATE_INITIALIZE
/* Perform board initialization */
return fvp_bringup();
#else
return OK;
#endif
}
#endif /* CONFIG_BOARDCTL */
@@ -22,10 +22,6 @@
set(SRCS imx8_boardinit.c imx8_bringup.c)
if(CONFIG_BOARDCTL)
list(APPEND SRCS imx8_appinit.c)
endif()
target_sources(board PRIVATE ${SRCS})
set_property(GLOBAL PROPERTY LD_SCRIPT "${NUTTX_BOARD_DIR}/scripts/dramboot.ld")
@@ -24,8 +24,4 @@ include $(TOPDIR)/Make.defs
CSRCS = imx8_boardinit.c imx8_bringup.c
ifeq ($(CONFIG_BOARDCTL),y)
CSRCS += imx8_appinit.c
endif
include $(TOPDIR)/boards/Board.mk
@@ -1,78 +0,0 @@
/****************************************************************************
* boards/arm64/imx8/imx8qm-mek/src/imx8_appinit.c
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <nuttx/board.h>
#include "imx8qm-mek.h"
#ifdef CONFIG_BOARDCTL
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: board_app_initialize
*
* Description:
* Perform application specific initialization. This function is never
* called directly from application code, but only indirectly via the
* (non-standard) boardctl() interface using the command BOARDIOC_INIT.
*
* Input Parameters:
* arg - The boardctl() argument is passed to the board_app_initialize()
* implementation without modification. The argument has no
* meaning to NuttX; the meaning of the argument is a contract
* between the board-specific initialization logic and the
* matching application logic. The value could be such things as a
* mode enumeration value, a set of DIP switch switch settings, a
* pointer to configuration data read from a file or serial FLASH,
* or whatever you would like to do with it. Every implementation
* should accept zero/NULL as a default configuration.
*
* Returned Value:
* Zero (OK) is returned on success; a negated errno value is returned on
* any failure to indicate the nature of the failure.
*
****************************************************************************/
int board_app_initialize(uintptr_t arg)
{
UNUSED(arg);
#ifndef CONFIG_BOARD_LATE_INITIALIZE
/* Perform board initialization */
return imx8_bringup();
#else
return OK;
#endif
}
#endif /* CONFIG_BOARDCTL */
-4
View File
@@ -24,10 +24,6 @@ include $(TOPDIR)/Make.defs
CSRCS = imx9_boardinit.c imx9_bringup.c
ifeq ($(CONFIG_BOARDCTL),y)
CSRCS += imx9_appinit.c
endif
ifeq ($(CONFIG_PWM),y)
CSRCS += imx9_pwm.c
endif
@@ -1,78 +0,0 @@
/****************************************************************************
* boards/arm64/imx9/imx93-evk/src/imx9_appinit.c
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <nuttx/board.h>
#include "imx93-evk.h"
#ifdef CONFIG_BOARDCTL
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: board_app_initialize
*
* Description:
* Perform application specific initialization. This function is never
* called directly from application code, but only indirectly via the
* (non-standard) boardctl() interface using the command BOARDIOC_INIT.
*
* Input Parameters:
* arg - The boardctl() argument is passed to the board_app_initialize()
* implementation without modification. The argument has no
* meaning to NuttX; the meaning of the argument is a contract
* between the board-specific initialization logic and the
* matching application logic. The value could be such things as a
* mode enumeration value, a set of DIP switch switch settings, a
* pointer to configuration data read from a file or serial FLASH,
* or whatever you would like to do with it. Every implementation
* should accept zero/NULL as a default configuration.
*
* Returned Value:
* Zero (OK) is returned on success; a negated errno value is returned on
* any failure to indicate the nature of the failure.
*
****************************************************************************/
int board_app_initialize(uintptr_t arg)
{
UNUSED(arg);
#ifndef CONFIG_BOARD_LATE_INITIALIZE
/* Perform board initialization */
return imx9_bringup();
#else
return OK;
#endif
}
#endif /* CONFIG_BOARDCTL */
@@ -16,7 +16,6 @@ CONFIG_ARCH_EARLY_PRINT=y
CONFIG_ARCH_INTERRUPTSTACK=4096
CONFIG_ARCH_USE_MMU=y
CONFIG_BOARDCTL_RESET=y
CONFIG_BOARD_LATE_INITIALIZE=y
CONFIG_BOARD_LOOPSPERMSEC=241712
CONFIG_BUILTIN=y
CONFIG_DEBUG_ASSERTIONS=y
@@ -22,11 +22,8 @@
set(SRCS imx9_boardinit.c imx9_bringup.c)
if(CONFIG_BOARDCTL)
list(APPEND SRCS imx9_appinit.c)
if(CONFIG_BOARDCTL_RESET)
list(APPEND SRCS imx9_reset.c)
endif()
if(CONFIG_BOARDCTL_RESET)
list(APPEND SRCS imx9_reset.c)
endif()
if(CONFIG_IMX9_USDHC)
@@ -24,12 +24,9 @@ include $(TOPDIR)/Make.defs
CSRCS = imx9_boardinit.c imx9_bringup.c
ifeq ($(CONFIG_BOARDCTL),y)
CSRCS += imx9_appinit.c
ifeq ($(CONFIG_BOARDCTL_RESET),y)
CSRCS += imx9_reset.c
endif
endif
ifeq ($(CONFIG_IMX9_USDHC),y)
CSRCS += imx9_usdhc.c
@@ -1,78 +0,0 @@
/****************************************************************************
* boards/arm64/imx9/imx95-a55-evk/src/imx9_appinit.c
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <nuttx/board.h>
#include "imx95-evk.h"
#ifdef CONFIG_BOARDCTL
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: board_app_initialize
*
* Description:
* Perform application specific initialization. This function is never
* called directly from application code, but only indirectly via the
* (non-standard) boardctl() interface using the command BOARDIOC_INIT.
*
* Input Parameters:
* arg - The boardctl() argument is passed to the board_app_initialize()
* implementation without modification. The argument has no
* meaning to NuttX; the meaning of the argument is a contract
* between the board-specific initialization logic and the
* matching application logic. The value could be such things as a
* mode enumeration value, a set of DIP switch switch settings, a
* pointer to configuration data read from a file or serial FLASH,
* or whatever you would like to do with it. Every implementation
* should accept zero/NULL as a default configuration.
*
* Returned Value:
* Zero (OK) is returned on success; a negated errno value is returned on
* any failure to indicate the nature of the failure.
*
****************************************************************************/
int board_app_initialize(uintptr_t arg)
{
UNUSED(arg);
#ifndef CONFIG_BOARD_LATE_INITIALIZE
/* Perform board initialization */
return imx9_bringup();
#else
return OK;
#endif
}
#endif /* CONFIG_BOARDCTL */
@@ -22,7 +22,7 @@
set(SRCS qemu_boardinit.c qemu_bringup.c)
if(CONFIG_BOARDCTL)
list(APPEND SRCS qemu_appinit.c qemu_power.c)
list(APPEND SRCS qemu_power.c)
endif()
if(CONFIG_LIBC_FDT)
+1 -1
View File
@@ -25,7 +25,7 @@ include $(TOPDIR)/Make.defs
CSRCS = qemu_boardinit.c qemu_bringup.c
ifeq ($(CONFIG_BOARDCTL),y)
CSRCS += qemu_appinit.c qemu_power.c
CSRCS += qemu_power.c
endif
ifeq ($(CONFIG_LIBC_FDT),y)
@@ -1,78 +0,0 @@
/****************************************************************************
* boards/arm64/qemu/qemu-armv8a/src/qemu_appinit.c
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <nuttx/board.h>
#include "qemu-armv8a.h"
#ifdef CONFIG_BOARDCTL
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: board_app_initialize
*
* Description:
* Perform application specific initialization. This function is never
* called directly from application code, but only indirectly via the
* (non-standard) boardctl() interface using the command BOARDIOC_INIT.
*
* Input Parameters:
* arg - The boardctl() argument is passed to the board_app_initialize()
* implementation without modification. The argument has no
* meaning to NuttX; the meaning of the argument is a contract
* between the board-specific initialization logic and the
* matching application logic. The value could be such things as a
* mode enumeration value, a set of DIP switch switch settings, a
* pointer to configuration data read from a file or serial FLASH,
* or whatever you would like to do with it. Every implementation
* should accept zero/NULL as a default configuration.
*
* Returned Value:
* Zero (OK) is returned on success; a negated errno value is returned on
* any failure to indicate the nature of the failure.
*
****************************************************************************/
int board_app_initialize(uintptr_t arg)
{
UNUSED(arg);
#ifndef CONFIG_BOARD_LATE_INITIALIZE
/* Perform board initialization */
return qemu_bringup();
#else
return OK;
#endif
}
#endif /* CONFIG_BOARDCTL */
@@ -23,7 +23,6 @@
include $(TOPDIR)/Make.defs
CSRCS = nanopi_m4_boardinit.c
CSRCS += nanopi_m4_appinit.c
ifeq ($(CONFIG_ETC_ROMFS),y)
RCSRCS = etc/init.d/rc.sysinit etc/init.d/rcS
@@ -1,66 +0,0 @@
/****************************************************************************
* boards/arm64/rk3399/nanopi_m4/src/nanopi_m4_appinit.c
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <nuttx/board.h>
#include "nanopi_m4.h"
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: board_app_initialize
*
* Description:
* Perform application specific initialization. This function is never
* called directly from application code, but only indirectly via the
* (non-standard) boardctl() interface using the command BOARDIOC_INIT.
*
* Input Parameters:
* arg - The boardctl() argument is passed to the board_app_initialize()
* implementation without modification. The argument has no
* meaning to NuttX; the meaning of the argument is a contract
* between the board-specific initialization logic and the
* matching application logic. The value could be such things as a
* mode enumeration value, a set of DIP switch switch settings, a
* pointer to configuration data read from a file or serial FLASH,
* or whatever you would like to do with it. Every implementation
* should accept zero/NULL as a default configuration.
*
* Returned Value:
* Zero (OK) is returned on success; a negated errno value is returned on
* any failure to indicate the nature of the failure.
*
****************************************************************************/
int board_app_initialize(uintptr_t arg)
{
/* Perform board initialization */
return OK;
}
@@ -101,6 +101,5 @@ void rk3399_board_initialize(void)
#ifdef CONFIG_BOARD_LATE_INITIALIZE
void board_late_initialize(void)
{
/* Perform board initialization */
}
#endif /* CONFIG_BOARD_LATE_INITIALIZE */
@@ -23,7 +23,6 @@
set(SRCS pinephonepro_boardinit.c pinephonepro_bringup.c)
if(CONFIG_BOARDCTL)
list(APPEND SRCS pinephonepro_appinit.c)
if(CONFIG_BOARDCTL_RESET)
list(APPEND SRCS pinephonepro_reset.c)
endif()
@@ -24,11 +24,8 @@ include $(TOPDIR)/Make.defs
CSRCS = pinephonepro_boardinit.c pinephonepro_bringup.c
ifeq ($(CONFIG_BOARDCTL),y)
CSRCS += pinephonepro_appinit.c
ifeq ($(CONFIG_BOARDCTL_RESET),y)
CSRCS += pinephonepro_reset.c
endif
endif
include $(TOPDIR)/boards/Board.mk
@@ -1,75 +0,0 @@
/****************************************************************************
* boards/arm64/rk3399/pinephonepro/src/pinephonepro_appinit.c
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <nuttx/board.h>
#include "pinephonepro.h"
#ifdef CONFIG_BOARDCTL
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: board_app_initialize
*
* Description:
* Perform application specific initialization. This function is never
* called directly from application code, but only indirectly via the
* (non-standard) boardctl() interface using the command BOARDIOC_INIT.
*
* Input Parameters:
* arg - The boardctl() argument is passed to the board_app_initialize()
* implementation without modification. The argument has no
* meaning to NuttX; the meaning of the argument is a contract
* between the board-specific initialization logic and the
* matching application logic. The value could be such things as a
* mode enumeration value, a set of DIP switch switch settings, a
* pointer to configuration data read from a file or serial FLASH,
* or whatever you would like to do with it. Every implementation
* should accept zero/NULL as a default configuration.
*
* Returned Value:
* Zero (OK) is returned on success; a negated errno value is returned on
* any failure to indicate the nature of the failure.
*
****************************************************************************/
int board_app_initialize(uintptr_t arg)
{
UNUSED(arg);
#ifndef CONFIG_BOARD_LATE_INITIALIZE
/* Perform board initialization */
return pinephonepro_bringup();
#else
return OK;
#endif
}
#endif /* CONFIG_BOARDCTL */
+1 -3
View File
@@ -23,12 +23,10 @@
include $(TOPDIR)/Make.defs
CSRCS = zcu111_boardinit.c zcu111_bringup.c
ifeq ($(CONFIG_BOARDCTL),y)
CSRCS += zcu111_appinit.c
ifeq ($(CONFIG_BOARDCTL_RESET),y)
CSRCS += zcu111_reset.c
endif
endif
ifeq ($(CONFIG_ARCH_LEDS),y)
CSRCS += zcu111_autoleds.c
@@ -1,72 +0,0 @@
/****************************************************************************
* boards/arm64/zynq-mpsoc/zcu111/src/zcu111_appinit.c
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <nuttx/board.h>
#include "zcu111.h"
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: board_app_initialize
*
* Description:
* Perform application specific initialization. This function is never
* called directly from application code, but only indirectly via the
* (non-standard) boardctl() interface using the command BOARDIOC_INIT.
*
* Input Parameters:
* arg - The boardctl() argument is passed to the board_app_initialize()
* implementation without modification. The argument has no
* meaning to NuttX; the meaning of the argument is a contract
* between the board-specific initialization logic and the
* matching application logic. The value could be such things as a
* mode enumeration value, a set of DIP switch switch settings, a
* pointer to configuration data read from a file or serial FLASH,
* or whatever you would like to do with it. Every implementation
* should accept zero/NULL as a default configuration.
*
* Returned Value:
* Zero (OK) is returned on success; a negated errno value is returned on
* any failure to indicate the nature of the failure.
*
****************************************************************************/
int board_app_initialize(uintptr_t arg)
{
#ifdef CONFIG_BOARD_LATE_INITIALIZE
/* Board initialization already performed by board_late_initialize() */
return OK;
#else
/* Perform board-specific initialization */
return zcu111_bringup();
#endif
}