diff --git a/boards/arm/stm32f1/stm32f103-minimum/src/CMakeLists.txt b/boards/arm/stm32f1/stm32f103-minimum/src/CMakeLists.txt index 20cf6395910..98249b1b9fc 100644 --- a/boards/arm/stm32f1/stm32f103-minimum/src/CMakeLists.txt +++ b/boards/arm/stm32f1/stm32f103-minimum/src/CMakeLists.txt @@ -22,10 +22,6 @@ set(SRCS stm32_boot.c stm32_bringup.c stm32_spi.c) -if(CONFIG_BOARDCTL_RESET) - list(APPEND SRCS stm32_reset.c) -endif() - if(CONFIG_ARCH_BUTTONS) list(APPEND SRCS stm32_buttons.c) endif() diff --git a/boards/arm/stm32f1/stm32f103-minimum/src/Make.defs b/boards/arm/stm32f1/stm32f103-minimum/src/Make.defs index c704b2c3564..b65b48862a1 100644 --- a/boards/arm/stm32f1/stm32f103-minimum/src/Make.defs +++ b/boards/arm/stm32f1/stm32f103-minimum/src/Make.defs @@ -24,10 +24,6 @@ include $(TOPDIR)/Make.defs CSRCS = stm32_boot.c stm32_bringup.c stm32_spi.c -ifeq ($(CONFIG_BOARDCTL_RESET),y) - CSRCS += stm32_reset.c -endif - ifeq ($(CONFIG_ARCH_BUTTONS),y) CSRCS += stm32_buttons.c endif diff --git a/boards/arm/stm32f1/stm32f103-minimum/src/stm32_reset.c b/boards/arm/stm32f1/stm32f103-minimum/src/stm32_reset.c deleted file mode 100644 index 886ca544518..00000000000 --- a/boards/arm/stm32f1/stm32f103-minimum/src/stm32_reset.c +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************************** - * boards/arm/stm32f1/stm32f103-minimum/src/stm32_reset.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 - -#include -#include - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: board_reset - * - * Description: - * Reset board. Support for this function is required by board-level - * logic if CONFIG_BOARDCTL_RESET is selected. - * - * Input Parameters: - * status - Status information provided with the reset event. This - * meaning of this status information is board-specific. If not - * used by a board, the value zero may be provided in calls to - * board_reset(). - * - * Returned Value: - * If this function returns, then it was not possible to power-off the - * board due to some constraints. The return value int this case is a - * board-specific reason for the failure to shutdown. - * - ****************************************************************************/ - -int board_reset(int status) -{ -#ifdef CONFIG_STM32_DFU - /* TODO handle reboot to bootloader */ - -#endif - - up_systemreset(); - return 0; -} diff --git a/boards/arm/stm32f4/nucleo-f429zi/src/CMakeLists.txt b/boards/arm/stm32f4/nucleo-f429zi/src/CMakeLists.txt index 1f6f30ca92b..3977def05e6 100644 --- a/boards/arm/stm32f4/nucleo-f429zi/src/CMakeLists.txt +++ b/boards/arm/stm32f4/nucleo-f429zi/src/CMakeLists.txt @@ -60,14 +60,6 @@ if(CONFIG_STM32_BBSRAM) list(APPEND SRCS stm32_bbsram.c) endif() -if(CONFIG_BOARDCTL_RESET) - list(APPEND SRCS stm32_reset.c) -endif() - -if(CONFIG_STM32_ROMFS) - list(APPEND SRCS stm32_romfs_initialize.c) -endif() - target_sources(board PRIVATE ${SRCS}) set_property(GLOBAL PROPERTY LD_SCRIPT "${NUTTX_BOARD_DIR}/scripts/ld.script") diff --git a/boards/arm/stm32f4/nucleo-f429zi/src/Make.defs b/boards/arm/stm32f4/nucleo-f429zi/src/Make.defs index 22ef4de2cdd..b5de1a7ff7e 100644 --- a/boards/arm/stm32f4/nucleo-f429zi/src/Make.defs +++ b/boards/arm/stm32f4/nucleo-f429zi/src/Make.defs @@ -62,14 +62,6 @@ ifeq ($(CONFIG_STM32_BBSRAM),y) CSRCS += stm32_bbsram.c endif -ifeq ($(CONFIG_BOARDCTL_RESET),y) -CSRCS += stm32_reset.c -endif - -ifeq ($(CONFIG_STM32_ROMFS),y) -CSRCS += stm32_romfs_initialize.c -endif - DEPPATH += --dep-path board VPATH += :board CFLAGS += ${INCDIR_PREFIX}$(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src$(DELIM)board$(DELIM)board diff --git a/boards/arm/stm32f4/nucleo-f429zi/src/stm32_reset.c b/boards/arm/stm32f4/nucleo-f429zi/src/stm32_reset.c deleted file mode 100644 index c17caaa874e..00000000000 --- a/boards/arm/stm32f4/nucleo-f429zi/src/stm32_reset.c +++ /dev/null @@ -1,64 +0,0 @@ -/**************************************************************************** - * boards/arm/stm32f4/nucleo-f429zi/src/stm32_reset.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 - -#include -#include - -#ifdef CONFIG_BOARDCTL_RESET - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: board_reset - * - * Description: - * Reset board. Support for this function is required by board-level - * logic if CONFIG_BOARDCTL_RESET is selected. - * - * Input Parameters: - * status - Status information provided with the reset event. This - * meaning of this status information is board-specific. If not - * used by a board, the value zero may be provided in calls to - * board_reset(). - * - * Returned Value: - * If this function returns, then it was not possible to power-off the - * board due to some constraints. The return value int this case is a - * board-specific reason for the failure to shutdown. - * - ****************************************************************************/ - -int board_reset(int status) -{ - up_systemreset(); - return 0; -} - -#endif /* CONFIG_BOARDCTL_RESET */ diff --git a/boards/arm/stm32f4/nucleo-f429zi/src/stm32_romfs_initialize.c b/boards/arm/stm32f4/nucleo-f429zi/src/stm32_romfs_initialize.c deleted file mode 100644 index 8eaaf58c73d..00000000000 --- a/boards/arm/stm32f4/nucleo-f429zi/src/stm32_romfs_initialize.c +++ /dev/null @@ -1,141 +0,0 @@ -/**************************************************************************** - * boards/arm/stm32f4/nucleo-f429zi/src/stm32_romfs_initialize.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. - * - ****************************************************************************/ - -/* This file provides contents of an optional ROMFS volume, mounted at boot */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include "stm32_romfs.h" - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#ifndef CONFIG_STM32_ROMFS -# error "CONFIG_STM32_ROMFS must be defined" -#else - -#ifndef CONFIG_STM32_ROMFS_IMAGEFILE -# error "CONFIG_STM32_ROMFS_IMAGEFILE must be defined" -#endif - -#ifndef CONFIG_STM32_ROMFS_DEV_MINOR -# error "CONFIG_STM32_ROMFS_DEV_MINOR must be defined" -#endif - -#ifndef CONFIG_STM32_ROMFS_MOUNTPOINT -# error "CONFIG_STM32_ROMFS_MOUNTPOINT must be defined" -#endif - -#define NSECTORS(size) (((size) + ROMFS_SECTOR_SIZE - 1)/ROMFS_SECTOR_SIZE) - -#define STR2(m) #m -#define STR(m) STR2(m) - -#define MKMOUNT_DEVNAME(m) "/dev/ram" STR(m) -#define MOUNT_DEVNAME MKMOUNT_DEVNAME(CONFIG_STM32_ROMFS_DEV_MINOR) - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -__asm__ ( - " .section .rodata, \"a\" \n" - " .balign 16 \n" - " .globl romfs_data_begin \n" - "romfs_data_begin: \n" - " .incbin " STR(CONFIG_STM32_ROMFS_IMAGEFILE)"\n" - " .balign " STR(ROMFS_SECTOR_SIZE) "\n" - " .globl romfs_data_end \n" - "romfs_data_end: \n" - ); - -extern const uint8_t romfs_data_begin[]; -extern const uint8_t romfs_data_end[]; - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: stm32_romfs_initialize - * - * Description: - * Registers the aboveincluded binary file as block device. - * Then mounts the block device as ROMFS filesystems. - * - * Returned Value: - * Zero (OK) on success, a negated errno value on error. - * - * Assumptions/Limitations: - * Memory addresses [romfs_data_begin .. romfs_data_end) should contain - * ROMFS volume data, as included in the assembly snippet above (l. 84). - * - ****************************************************************************/ - -int stm32_romfs_initialize(void) -{ - size_t romfs_data_len; - int ret; - - /* Create a ROM disk for the /etc filesystem */ - - romfs_data_len = romfs_data_end - romfs_data_begin; - - ret = romdisk_register(CONFIG_STM32_ROMFS_DEV_MINOR, romfs_data_begin, - NSECTORS(romfs_data_len), ROMFS_SECTOR_SIZE); - if (ret < 0) - { - ferr("ERROR: romdisk_register failed: %d\n", -ret); - return ret; - } - - /* Mount the file system */ - - finfo("Mounting ROMFS filesystem at target=%s with source=%s\n", - CONFIG_STM32_ROMFS_MOUNTPOINT, MOUNT_DEVNAME); - - ret = nx_mount(MOUNT_DEVNAME, CONFIG_STM32_ROMFS_MOUNTPOINT, - "romfs", MS_RDONLY, NULL); - if (ret < 0) - { - ferr("ERROR: nx_mount(%s,%s,romfs) failed: %d\n", - MOUNT_DEVNAME, CONFIG_STM32_ROMFS_MOUNTPOINT, ret); - return ret; - } - - return OK; -} - -#endif /* CONFIG_STM32_ROMFS */ diff --git a/boards/arm/stm32f4/nucleo-f446re/Kconfig b/boards/arm/stm32f4/nucleo-f446re/Kconfig index 1e2e8b8e8b7..1007c8b5315 100644 --- a/boards/arm/stm32f4/nucleo-f446re/Kconfig +++ b/boards/arm/stm32f4/nucleo-f446re/Kconfig @@ -30,26 +30,4 @@ config NUCLEO_F446RE_AJOY_MINBUTTONS minimal set: SELECT (joystick down), FIRE (BUTTON B), and JUMP (BUTTON A). -config STM32_ROMFS - bool "Automount baked-in ROMFS image" - default n - depends on FS_ROMFS - ---help--- - Select STM32_ROMFS_IMAGEFILE, STM32_ROMFS_DEV_MINOR, STM32_ROMFS_MOUNTPOINT - -config STM32_ROMFS_DEV_MINOR - int "Minor for the block device backing the data" - depends on STM32_ROMFS - default 64 - -config STM32_ROMFS_MOUNTPOINT - string "Mountpoint of the custom romfs image" - depends on STM32_ROMFS - default "/rom" - -config STM32_ROMFS_IMAGEFILE - string "ROMFS image file to include into build" - depends on STM32_ROMFS - default "../../../rom.img" - endif # ARCH_BOARD_NUCLEO_F446RE diff --git a/boards/arm/stm32f4/nucleo-f446re/src/CMakeLists.txt b/boards/arm/stm32f4/nucleo-f446re/src/CMakeLists.txt index 25458b16ff5..610cad1a6c0 100644 --- a/boards/arm/stm32f4/nucleo-f446re/src/CMakeLists.txt +++ b/boards/arm/stm32f4/nucleo-f446re/src/CMakeLists.txt @@ -70,10 +70,6 @@ if(CONFIG_BOARD_STM32_IHM08M1) list(APPEND SRCS stm32_foc_ihm08m1.c) endif() -if(CONFIG_STM32_ROMFS) - list(APPEND SRCS stm32_romfs_initialize.c) -endif() - target_sources(board PRIVATE ${SRCS}) set_property(GLOBAL PROPERTY LD_SCRIPT "${NUTTX_BOARD_DIR}/scripts/f446re.ld") diff --git a/boards/arm/stm32f4/nucleo-f446re/src/Make.defs b/boards/arm/stm32f4/nucleo-f446re/src/Make.defs index f861a66574e..f4f9c4ec5ce 100644 --- a/boards/arm/stm32f4/nucleo-f446re/src/Make.defs +++ b/boards/arm/stm32f4/nucleo-f446re/src/Make.defs @@ -72,10 +72,6 @@ ifeq ($(CONFIG_BOARD_STM32_IHM08M1),y) CSRCS += stm32_foc_ihm08m1.c endif -ifeq ($(CONFIG_STM32_ROMFS),y) -CSRCS += stm32_romfs_initialize.c -endif - DEPPATH += --dep-path board VPATH += :board CFLAGS += ${INCDIR_PREFIX}$(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src$(DELIM)board$(DELIM)board diff --git a/boards/arm/stm32f4/nucleo-f446re/src/stm32_bringup.c b/boards/arm/stm32f4/nucleo-f446re/src/stm32_bringup.c index 94dd44f5839..13cf8656c7c 100644 --- a/boards/arm/stm32f4/nucleo-f446re/src/stm32_bringup.c +++ b/boards/arm/stm32f4/nucleo-f446re/src/stm32_bringup.c @@ -64,7 +64,9 @@ # include #endif -#include "stm32_romfs.h" +#ifdef CONFIG_STM32_ROMFS +# include "stm32_romfs.h" +#endif #include "nucleo-f446re.h" /**************************************************************************** diff --git a/boards/arm/stm32f4/nucleo-f446re/src/stm32_romfs.h b/boards/arm/stm32f4/nucleo-f446re/src/stm32_romfs.h deleted file mode 100644 index fa4e75ddadd..00000000000 --- a/boards/arm/stm32f4/nucleo-f446re/src/stm32_romfs.h +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** - * boards/arm/stm32f4/nucleo-f446re/src/stm32_romfs.h - * - * 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. - * - ****************************************************************************/ - -#ifndef __BOARDS_ARM_STM32_NUCLEO_F446RE_SRC_STM32_ROMFS_H -#define __BOARDS_ARM_STM32_NUCLEO_F446RE_SRC_STM32_ROMFS_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#ifdef CONFIG_STM32_ROMFS - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#define ROMFS_SECTOR_SIZE 64 - -/**************************************************************************** - * Public Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Name: stm32_romfs_initialize - * - * Description: - * Registers built-in ROMFS image as block device and mounts it. - * - * Returned Value: - * Zero (OK) on success, a negated errno value on error. - * - * Assumptions/Limitations: - * Memory addresses [romfs_data_begin .. romfs_data_begin) should contain - * ROMFS volume data, as included in the assembly snippet above (l. 84). - * - ****************************************************************************/ - -int stm32_romfs_initialize(void); - -#endif /* CONFIG_STM32_ROMFS */ - -#endif /* __BOARDS_ARM_STM32_NUCLEO_F446RE_SRC_STM32_ROMFS_H */ diff --git a/boards/arm/stm32f4/nucleo-f446re/src/stm32_romfs_initialize.c b/boards/arm/stm32f4/nucleo-f446re/src/stm32_romfs_initialize.c deleted file mode 100644 index f1fe6d08062..00000000000 --- a/boards/arm/stm32f4/nucleo-f446re/src/stm32_romfs_initialize.c +++ /dev/null @@ -1,141 +0,0 @@ -/**************************************************************************** - * boards/arm/stm32f4/nucleo-f446re/src/stm32_romfs_initialize.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. - * - ****************************************************************************/ - -/* This file provides contents of an optional ROMFS volume, mounted at boot */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include "stm32_romfs.h" - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#ifndef CONFIG_STM32_ROMFS -# error "CONFIG_STM32_ROMFS must be defined" -#else - -#ifndef CONFIG_STM32_ROMFS_IMAGEFILE -# error "CONFIG_STM32_ROMFS_IMAGEFILE must be defined" -#endif - -#ifndef CONFIG_STM32_ROMFS_DEV_MINOR -# error "CONFIG_STM32_ROMFS_DEV_MINOR must be defined" -#endif - -#ifndef CONFIG_STM32_ROMFS_MOUNTPOINT -# error "CONFIG_STM32_ROMFS_MOUNTPOINT must be defined" -#endif - -#define NSECTORS(size) (((size) + ROMFS_SECTOR_SIZE - 1)/ROMFS_SECTOR_SIZE) - -#define STR2(m) #m -#define STR(m) STR2(m) - -#define MKMOUNT_DEVNAME(m) "/dev/ram" STR(m) -#define MOUNT_DEVNAME MKMOUNT_DEVNAME(CONFIG_STM32_ROMFS_DEV_MINOR) - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -__asm__ ( - " .section .rodata, \"a\" \n" - " .balign 16 \n" - " .globl romfs_data_begin \n" - "romfs_data_begin: \n" - " .incbin " STR(CONFIG_STM32_ROMFS_IMAGEFILE)"\n" - " .balign " STR(ROMFS_SECTOR_SIZE) "\n" - " .globl romfs_data_end \n" - "romfs_data_end: \n" - ); - -extern const uint8_t romfs_data_begin[]; -extern const uint8_t romfs_data_end[]; - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: stm32_romfs_initialize - * - * Description: - * Registers the aboveincluded binary file as block device. - * Then mounts the block device as ROMFS filesystems. - * - * Returned Value: - * Zero (OK) on success, a negated errno value on error. - * - * Assumptions/Limitations: - * Memory addresses [&romfs_data_begin .. &romfs_data_begin) should contain - * ROMFS volume data, as included in the assembly snippet above (l. 84). - * - ****************************************************************************/ - -int stm32_romfs_initialize(void) -{ - uintptr_t romfs_data_len; - int ret; - - /* Create a ROM disk for the /etc filesystem */ - - romfs_data_len = (uintptr_t)romfs_data_end - (uintptr_t)romfs_data_begin; - - ret = romdisk_register(CONFIG_STM32_ROMFS_DEV_MINOR, romfs_data_begin, - NSECTORS(romfs_data_len), ROMFS_SECTOR_SIZE); - if (ret < 0) - { - ferr("ERROR: romdisk_register failed: %d\n", -ret); - return ret; - } - - /* Mount the file system */ - - finfo("Mounting ROMFS filesystem at target=%s with source=%s\n", - CONFIG_STM32_ROMFS_MOUNTPOINT, MOUNT_DEVNAME); - - ret = nx_mount(MOUNT_DEVNAME, CONFIG_STM32_ROMFS_MOUNTPOINT, - "romfs", MS_RDONLY, NULL); - if (ret < 0) - { - ferr("ERROR: nx_mount(%s,%s,romfs) failed: %d\n", - MOUNT_DEVNAME, CONFIG_STM32_ROMFS_MOUNTPOINT, ret); - return ret; - } - - return OK; -} - -#endif /* CONFIG_STM32_ROMFS */ diff --git a/boards/arm/stm32f4/omnibusf4/Kconfig b/boards/arm/stm32f4/omnibusf4/Kconfig index ba690b48333..bb0e7ff53b9 100644 --- a/boards/arm/stm32f4/omnibusf4/Kconfig +++ b/boards/arm/stm32f4/omnibusf4/Kconfig @@ -5,26 +5,4 @@ if ARCH_BOARD_OMNIBUSF4 -config STM32_ROMFS - bool "Automount baked-in ROMFS image" - default n - depends on FS_ROMFS - ---help--- - Select STM32_ROMFS_IMAGEFILE, STM32_ROMFS_DEV_MINOR, STM32_ROMFS_MOUNTPOINT - -config STM32_ROMFS_DEV_MINOR - int "Minor for the block device backing the data" - depends on STM32_ROMFS - default 64 - -config STM32_ROMFS_MOUNTPOINT - string "Mountpoint of the custom romfs image" - depends on STM32_ROMFS - default "/rom" - -config STM32_ROMFS_IMAGEFILE - string "ROMFS image file to include into build" - depends on STM32_ROMFS - default "../../../rom.img" - endif diff --git a/boards/arm/stm32f4/omnibusf4/src/CMakeLists.txt b/boards/arm/stm32f4/omnibusf4/src/CMakeLists.txt index 531c7feb5d6..e7c271fa8e3 100644 --- a/boards/arm/stm32f4/omnibusf4/src/CMakeLists.txt +++ b/boards/arm/stm32f4/omnibusf4/src/CMakeLists.txt @@ -62,10 +62,6 @@ if(CONFIG_TIMER) list(APPEND SRCS stm32_timer.c) endif() -if(CONFIG_STM32_ROMFS) - list(APPEND SRCS stm32_romfs_initialize.c) -endif() - if(CONFIG_BOARDCTL_UNIQUEID) list(APPEND SRCS stm32_uid.c) endif() diff --git a/boards/arm/stm32f4/omnibusf4/src/Make.defs b/boards/arm/stm32f4/omnibusf4/src/Make.defs index b0c74f55cde..8cea316c75d 100644 --- a/boards/arm/stm32f4/omnibusf4/src/Make.defs +++ b/boards/arm/stm32f4/omnibusf4/src/Make.defs @@ -63,10 +63,6 @@ ifeq ($(CONFIG_TIMER),y) CSRCS += stm32_timer.c endif -ifeq ($(CONFIG_STM32_ROMFS),y) -CSRCS += stm32_romfs_initialize.c -endif - ifeq ($(CONFIG_BOARDCTL_UNIQUEID),y) CSRCS += stm32_uid.c endif diff --git a/boards/arm/stm32f4/omnibusf4/src/stm32_bringup.c b/boards/arm/stm32f4/omnibusf4/src/stm32_bringup.c index 59aa712f47f..a8d3e5d7a4a 100644 --- a/boards/arm/stm32f4/omnibusf4/src/stm32_bringup.c +++ b/boards/arm/stm32f4/omnibusf4/src/stm32_bringup.c @@ -38,7 +38,9 @@ #endif #include "stm32.h" -#include "stm32_romfs.h" +#ifdef CONFIG_STM32_ROMFS +# include "stm32_romfs.h" +#endif #ifdef CONFIG_STM32_OTGFS # include "stm32_usbhost.h" diff --git a/boards/arm/stm32f4/omnibusf4/src/stm32_romfs.h b/boards/arm/stm32f4/omnibusf4/src/stm32_romfs.h deleted file mode 100644 index b1376c031e7..00000000000 --- a/boards/arm/stm32f4/omnibusf4/src/stm32_romfs.h +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** - * boards/arm/stm32f4/omnibusf4/src/stm32_romfs.h - * - * SPDX-License-Identifier: BSD-3-Clause - * SPDX-FileCopyrightText: 2017 Tomasz Wozniak. All rights reserved. - * SPDX-FileContributor: Tomasz Wozniak - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************/ - -#ifndef __BOARDS_ARM_STM32_OMNIBUSF4_SRC_STM32_ROMFS_H -#define __BOARDS_ARM_STM32_OMNIBUSF4_SRC_STM32_ROMFS_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#ifdef CONFIG_STM32_ROMFS - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#define ROMFS_SECTOR_SIZE 64 - -/**************************************************************************** - * Public Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Name: stm32_romfs_initialize - * - * Description: - * Registers built-in ROMFS image as block device and mounts it. - * - * Returned Value: - * Zero (OK) on success, a negated errno value on error. - * - * Assumptions/Limitations: - * Memory addresses [romfs_data_begin .. romfs_data_end) should contain - * ROMFS volume data, as included in the assembly snippet above (l. 84). - * - ****************************************************************************/ - -int stm32_romfs_initialize(void); - -#endif /* CONFIG_STM32_ROMFS */ - -#endif /* __BOARDS_ARM_STM32_OMNIBUSF4_SRC_STM32_ROMFS_H */ diff --git a/boards/arm/stm32f4/omnibusf4/src/stm32_romfs_initialize.c b/boards/arm/stm32f4/omnibusf4/src/stm32_romfs_initialize.c deleted file mode 100644 index 8c5d8069a95..00000000000 --- a/boards/arm/stm32f4/omnibusf4/src/stm32_romfs_initialize.c +++ /dev/null @@ -1,153 +0,0 @@ -/**************************************************************************** - * boards/arm/stm32f4/omnibusf4/src/stm32_romfs_initialize.c - * - * SPDX-License-Identifier: BSD-3-Clause - * SPDX-FileCopyrightText: 2017 Tomasz Wozniak. All rights reserved. - * SPDX-FileContributor: Tomasz Wozniak - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include "stm32_romfs.h" - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#ifndef CONFIG_STM32_ROMFS -# error "CONFIG_STM32_ROMFS must be defined" -#else - -#ifndef CONFIG_STM32_ROMFS_IMAGEFILE -# error "CONFIG_STM32_ROMFS_IMAGEFILE must be defined" -#endif - -#ifndef CONFIG_STM32_ROMFS_DEV_MINOR -# error "CONFIG_STM32_ROMFS_DEV_MINOR must be defined" -#endif - -#ifndef CONFIG_STM32_ROMFS_MOUNTPOINT -# error "CONFIG_STM32_ROMFS_MOUNTPOINT must be defined" -#endif - -#define NSECTORS(size) (((size) + ROMFS_SECTOR_SIZE - 1)/ROMFS_SECTOR_SIZE) - -#define STR2(m) #m -#define STR(m) STR2(m) - -#define MKMOUNT_DEVNAME(m) "/dev/ram" STR(m) -#define MOUNT_DEVNAME MKMOUNT_DEVNAME(CONFIG_STM32_ROMFS_DEV_MINOR) - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -__asm__ ( - ".section .rodata, \"a\"\n" - ".balign 16\n" - ".globl romfs_data_begin\n" -"romfs_data_begin:\n" - ".incbin " STR(CONFIG_STM32_ROMFS_IMAGEFILE) "\n"\ - \ - ".balign " STR(ROMFS_SECTOR_SIZE) "\n" - ".globl romfs_data_end\n" -"romfs_data_end:\n"); - -extern const uint8_t romfs_data_begin[]; -extern const uint8_t romfs_data_end[]; - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: stm32_romfs_initialize - * - * Description: - * Registers the aboveincluded binary file as block device. - * Then mounts the block device as ROMFS filesystems. - * - * Returned Value: - * Zero (OK) on success, a negated errno value on error. - * - * Assumptions/Limitations: - * Memory addresses [romfs_data_begin .. romfs_data_end) should contain - * ROMFS volume data, as included in the assembly snippet above (l. 84). - * - ****************************************************************************/ - -int stm32_romfs_initialize(void) -{ - size_t romfs_data_len - int ret; - - /* Create a ROM disk for the /etc filesystem */ - - romfs_data_len = romfs_data_end - romfs_data_begin; - - ret = romdisk_register(CONFIG_STM32_ROMFS_DEV_MINOR, romfs_data_begin, - NSECTORS(romfs_data_len), ROMFS_SECTOR_SIZE); - if (ret < 0) - { - ferr("ERROR: romdisk_register failed: %d\n", -ret); - return ret; - } - - /* Mount the file system */ - - finfo("Mounting ROMFS filesystem at target=%s with source=%s\n", - CONFIG_STM32_ROMFS_MOUNTPOINT, MOUNT_DEVNAME); - - ret = nx_mount(MOUNT_DEVNAME, CONFIG_STM32_ROMFS_MOUNTPOINT, - "romfs", MS_RDONLY, NULL); - if (ret < 0) - { - ferr("ERROR: nx_mount(%s,%s,romfs) failed: %d\n", - MOUNT_DEVNAME, CONFIG_STM32_ROMFS_MOUNTPOINT, ret); - return ret; - } - - return OK; -} - -#endif /* CONFIG_STM32_ROMFS */ diff --git a/boards/arm/stm32f4/stm32f401rc-rs485/configs/telnetd/defconfig b/boards/arm/stm32f4/stm32f401rc-rs485/configs/telnetd/defconfig index 303875d809f..b29a0ff7459 100644 --- a/boards/arm/stm32f4/stm32f401rc-rs485/configs/telnetd/defconfig +++ b/boards/arm/stm32f4/stm32f401rc-rs485/configs/telnetd/defconfig @@ -11,6 +11,7 @@ # CONFIG_SYSTEM_TELNETD is not set CONFIG_ARCH="arm" CONFIG_ARCH_BOARD="stm32f401rc-rs485" +CONFIG_ARCH_BOARD_COMMON=y CONFIG_ARCH_BOARD_STM32F401RC_RS485=y CONFIG_ARCH_BUTTONS=y CONFIG_ARCH_CHIP="stm32f4" diff --git a/boards/arm/stm32f4/stm32f401rc-rs485/src/CMakeLists.txt b/boards/arm/stm32f4/stm32f401rc-rs485/src/CMakeLists.txt index 64b46b4813d..968d1e9dd92 100644 --- a/boards/arm/stm32f4/stm32f401rc-rs485/src/CMakeLists.txt +++ b/boards/arm/stm32f4/stm32f401rc-rs485/src/CMakeLists.txt @@ -30,10 +30,6 @@ if(CONFIG_USERLED) list(APPEND SRCS stm32_userleds.c) endif() -if(CONFIG_BOARDCTL_RESET) - list(APPEND SRCS stm32_reset.c) -endif() - if(CONFIG_ARCH_BUTTONS) list(APPEND SRCS stm32_buttons.c) endif() diff --git a/boards/arm/stm32f4/stm32f401rc-rs485/src/Make.defs b/boards/arm/stm32f4/stm32f401rc-rs485/src/Make.defs index 04f89e99e4f..cc672de33d2 100644 --- a/boards/arm/stm32f4/stm32f401rc-rs485/src/Make.defs +++ b/boards/arm/stm32f4/stm32f401rc-rs485/src/Make.defs @@ -41,10 +41,6 @@ ifeq ($(CONFIG_USERLED),y) CSRCS += stm32_userleds.c endif -ifeq ($(CONFIG_BOARDCTL_RESET),y) -CSRCS += stm32_reset.c -endif - ifeq ($(CONFIG_ARCH_BUTTONS),y) CSRCS += stm32_buttons.c endif diff --git a/boards/arm/stm32f4/stm32f401rc-rs485/src/stm32_reset.c b/boards/arm/stm32f4/stm32f401rc-rs485/src/stm32_reset.c deleted file mode 100644 index 5e243092980..00000000000 --- a/boards/arm/stm32f4/stm32f401rc-rs485/src/stm32_reset.c +++ /dev/null @@ -1,64 +0,0 @@ -/**************************************************************************** - * boards/arm/stm32f4/stm32f401rc-rs485/src/stm32_reset.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 - -#include -#include - -#ifdef CONFIG_BOARDCTL_RESET - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: board_reset - * - * Description: - * Reset board. Support for this function is required by board-level - * logic if CONFIG_BOARDCTL_RESET is selected. - * - * Input Parameters: - * status - Status information provided with the reset event. This - * meaning of this status information is board-specific. If not - * used by a board, the value zero may be provided in calls to - * board_reset(). - * - * Returned Value: - * If this function returns, then it was not possible to power-off the - * board due to some constraints. The return value int this case is a - * board-specific reason for the failure to shutdown. - * - ****************************************************************************/ - -int board_reset(int status) -{ - up_systemreset(); - return 0; -} - -#endif /* CONFIG_BOARDCTL_RESET */ diff --git a/boards/arm/stm32f4/stm32f4discovery/Kconfig b/boards/arm/stm32f4/stm32f4discovery/Kconfig index 084ab04bc12..8dfe3c0fc79 100644 --- a/boards/arm/stm32f4/stm32f4discovery/Kconfig +++ b/boards/arm/stm32f4/stm32f4discovery/Kconfig @@ -12,28 +12,6 @@ config STM32F4DISBB Select if you are using the STM32F4DIS-BB base board with the STM32F4Discovery. -config STM32_ROMFS - bool "Automount baked-in ROMFS image" - default n - depends on FS_ROMFS - ---help--- - Select STM32_ROMFS_IMAGEFILE, STM32_ROMFS_DEV_MINOR, STM32_ROMFS_MOUNTPOINT - -config STM32_ROMFS_DEV_MINOR - int "Minor for the block device backing the data" - depends on STM32_ROMFS - default 64 - -config STM32_ROMFS_MOUNTPOINT - string "Mountpoint of the custom romfs image" - depends on STM32_ROMFS - default "/rom" - -config STM32_ROMFS_IMAGEFILE - string "ROMFS image file to include into build" - depends on STM32_ROMFS - default "../../../../../rom.img" - config STM32F4DISCO_USBHOST_STACKSIZE int "USB host waiter stack size" default 1024 diff --git a/boards/arm/stm32f4/stm32f4discovery/configs/adb/defconfig b/boards/arm/stm32f4/stm32f4discovery/configs/adb/defconfig index 493408723d3..3edc5168225 100644 --- a/boards/arm/stm32f4/stm32f4discovery/configs/adb/defconfig +++ b/boards/arm/stm32f4/stm32f4discovery/configs/adb/defconfig @@ -13,6 +13,7 @@ CONFIG_ADBD_SHELL_SERVICE=y CONFIG_ADBD_USB_SERVER=y CONFIG_ARCH="arm" CONFIG_ARCH_BOARD="stm32f4discovery" +CONFIG_ARCH_BOARD_COMMON=y CONFIG_ARCH_BOARD_STM32F4_DISCOVERY=y CONFIG_ARCH_BUTTONS=y CONFIG_ARCH_CHIP="stm32f4" diff --git a/boards/arm/stm32f4/stm32f4discovery/configs/composite/defconfig b/boards/arm/stm32f4/stm32f4discovery/configs/composite/defconfig index 51f162f19cf..6125b59ae15 100644 --- a/boards/arm/stm32f4/stm32f4discovery/configs/composite/defconfig +++ b/boards/arm/stm32f4/stm32f4discovery/configs/composite/defconfig @@ -12,6 +12,7 @@ CONFIG_ALLOW_BSD_COMPONENTS=y CONFIG_ARCH="arm" CONFIG_ARCH_BOARD="stm32f4discovery" +CONFIG_ARCH_BOARD_COMMON=y CONFIG_ARCH_BOARD_STM32F4_DISCOVERY=y CONFIG_ARCH_BUTTONS=y CONFIG_ARCH_CHIP="stm32f4" diff --git a/boards/arm/stm32f4/stm32f4discovery/configs/mmcsdspi/defconfig b/boards/arm/stm32f4/stm32f4discovery/configs/mmcsdspi/defconfig index 905b47c6c4e..91350175be5 100644 --- a/boards/arm/stm32f4/stm32f4discovery/configs/mmcsdspi/defconfig +++ b/boards/arm/stm32f4/stm32f4discovery/configs/mmcsdspi/defconfig @@ -14,6 +14,7 @@ # CONFIG_STM32_CCMEXCLUDE is not set CONFIG_ARCH="arm" CONFIG_ARCH_BOARD="stm32f4discovery" +CONFIG_ARCH_BOARD_COMMON=y CONFIG_ARCH_BOARD_STM32F4_DISCOVERY=y CONFIG_ARCH_BUTTONS=y CONFIG_ARCH_CHIP="stm32f4" diff --git a/boards/arm/stm32f4/stm32f4discovery/configs/netnsh/defconfig b/boards/arm/stm32f4/stm32f4discovery/configs/netnsh/defconfig index e18237614b4..e7e4cc4c095 100644 --- a/boards/arm/stm32f4/stm32f4discovery/configs/netnsh/defconfig +++ b/boards/arm/stm32f4/stm32f4discovery/configs/netnsh/defconfig @@ -12,6 +12,7 @@ # CONFIG_NSH_CMDOPT_HEXDUMP is not set CONFIG_ARCH="arm" CONFIG_ARCH_BOARD="stm32f4discovery" +CONFIG_ARCH_BOARD_COMMON=y CONFIG_ARCH_BOARD_STM32F4_DISCOVERY=y CONFIG_ARCH_BUTTONS=y CONFIG_ARCH_CHIP="stm32f4" diff --git a/boards/arm/stm32f4/stm32f4discovery/configs/rndis/defconfig b/boards/arm/stm32f4/stm32f4discovery/configs/rndis/defconfig index dafce58d612..f57a05ca6c5 100644 --- a/boards/arm/stm32f4/stm32f4discovery/configs/rndis/defconfig +++ b/boards/arm/stm32f4/stm32f4discovery/configs/rndis/defconfig @@ -11,6 +11,7 @@ CONFIG_ALLOW_BSD_COMPONENTS=y CONFIG_ARCH="arm" CONFIG_ARCH_BOARD="stm32f4discovery" +CONFIG_ARCH_BOARD_COMMON=y CONFIG_ARCH_BOARD_STM32F4_DISCOVERY=y CONFIG_ARCH_BUTTONS=y CONFIG_ARCH_CHIP="stm32f4" diff --git a/boards/arm/stm32f4/stm32f4discovery/configs/wifi/defconfig b/boards/arm/stm32f4/stm32f4discovery/configs/wifi/defconfig index 673265e3c77..73a18bd96ac 100644 --- a/boards/arm/stm32f4/stm32f4discovery/configs/wifi/defconfig +++ b/boards/arm/stm32f4/stm32f4discovery/configs/wifi/defconfig @@ -13,6 +13,7 @@ # CONFIG_SPI_CALLBACK is not set CONFIG_ARCH="arm" CONFIG_ARCH_BOARD="stm32f4discovery" +CONFIG_ARCH_BOARD_COMMON=y CONFIG_ARCH_BOARD_STM32F4_DISCOVERY=y CONFIG_ARCH_BUTTONS=y CONFIG_ARCH_CHIP="stm32f4" diff --git a/boards/arm/stm32f4/stm32f4discovery/src/CMakeLists.txt b/boards/arm/stm32f4/stm32f4discovery/src/CMakeLists.txt index f65fa366811..36cebfbb8cf 100644 --- a/boards/arm/stm32f4/stm32f4discovery/src/CMakeLists.txt +++ b/boards/arm/stm32f4/stm32f4discovery/src/CMakeLists.txt @@ -92,10 +92,6 @@ if(CONFIG_PWM) list(APPEND SRCS stm32_pwm.c) endif() -if(CONFIG_BOARDCTL_RESET) - list(APPEND SRCS stm32_reset.c) -endif() - if(CONFIG_ARCH_CUSTOM_PMINIT) list(APPEND SRCS stm32_pm.c) endif() @@ -138,10 +134,6 @@ if(CONFIG_STM32_HCIUART) endif() endif() -if(CONFIG_STM32_ROMFS) - list(APPEND SRCS stm32_romfs_initialize.c) -endif() - if(CONFIG_BOARDCTL_UNIQUEID) list(APPEND SRCS stm32_uid.c) endif() diff --git a/boards/arm/stm32f4/stm32f4discovery/src/Make.defs b/boards/arm/stm32f4/stm32f4discovery/src/Make.defs index bb7e1b04123..78fe9c2a0af 100644 --- a/boards/arm/stm32f4/stm32f4discovery/src/Make.defs +++ b/boards/arm/stm32f4/stm32f4discovery/src/Make.defs @@ -98,10 +98,6 @@ ifeq ($(CONFIG_CAPTURE),y) CSRCS += stm32_capture.c endif -ifeq ($(CONFIG_BOARDCTL_RESET),y) -CSRCS += stm32_reset.c -endif - ifeq ($(CONFIG_ARCH_CUSTOM_PMINIT),y) CSRCS += stm32_pm.c endif @@ -148,10 +144,6 @@ CSRCS += stm32_hciuart.c endif endif -ifeq ($(CONFIG_STM32_ROMFS),y) -CSRCS += stm32_romfs_initialize.c -endif - ifeq ($(CONFIG_BOARDCTL_UNIQUEID),y) CSRCS += stm32_uid.c endif diff --git a/boards/arm/stm32f4/stm32f4discovery/src/stm32_bringup.c b/boards/arm/stm32f4/stm32f4discovery/src/stm32_bringup.c index a9ea083a706..16d4cbc15f2 100644 --- a/boards/arm/stm32f4/stm32f4discovery/src/stm32_bringup.c +++ b/boards/arm/stm32f4/stm32f4discovery/src/stm32_bringup.c @@ -39,7 +39,9 @@ #endif #include "stm32.h" -#include "stm32_romfs.h" +#ifdef CONFIG_STM32_ROMFS +# include "stm32_romfs.h" +#endif #ifdef CONFIG_STM32_OTGFS # include "stm32_usbhost.h" diff --git a/boards/arm/stm32f4/stm32f4discovery/src/stm32_reset.c b/boards/arm/stm32f4/stm32f4discovery/src/stm32_reset.c deleted file mode 100644 index 8381b158e68..00000000000 --- a/boards/arm/stm32f4/stm32f4discovery/src/stm32_reset.c +++ /dev/null @@ -1,64 +0,0 @@ -/**************************************************************************** - * boards/arm/stm32f4/stm32f4discovery/src/stm32_reset.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 - -#include -#include - -#ifdef CONFIG_BOARDCTL_RESET - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: board_reset - * - * Description: - * Reset board. Support for this function is required by board-level - * logic if CONFIG_BOARDCTL_RESET is selected. - * - * Input Parameters: - * status - Status information provided with the reset event. This - * meaning of this status information is board-specific. If not - * used by a board, the value zero may be provided in calls to - * board_reset(). - * - * Returned Value: - * If this function returns, then it was not possible to power-off the - * board due to some constraints. The return value int this case is a - * board-specific reason for the failure to shutdown. - * - ****************************************************************************/ - -int board_reset(int status) -{ - up_systemreset(); - return 0; -} - -#endif /* CONFIG_BOARDCTL_RESET */ diff --git a/boards/arm/stm32f4/stm32f4discovery/src/stm32_romfs.h b/boards/arm/stm32f4/stm32f4discovery/src/stm32_romfs.h deleted file mode 100644 index 7cfb268ae3d..00000000000 --- a/boards/arm/stm32f4/stm32f4discovery/src/stm32_romfs.h +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** - * boards/arm/stm32f4/stm32f4discovery/src/stm32_romfs.h - * - * SPDX-License-Identifier: BSD-3-Clause - * SPDX-FileCopyrightText: 2017 Tomasz Wozniak. All rights reserved. - * SPDX-FileContributor: Tomasz Wozniak - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************/ - -#ifndef __BOARDS_ARM_STM32_STM32F4DISCOVERY_SRC_STM32_ROMFS_H -#define __BOARDS_ARM_STM32_STM32F4DISCOVERY_SRC_STM32_ROMFS_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#ifdef CONFIG_STM32_ROMFS - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#define ROMFS_SECTOR_SIZE 64 - -/**************************************************************************** - * Public Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Name: stm32_romfs_initialize - * - * Description: - * Registers built-in ROMFS image as block device and mounts it. - * - * Returned Value: - * Zero (OK) on success, a negated errno value on error. - * - * Assumptions/Limitations: - * Memory addresses [romfs_data_begin .. romfs_data_end) should contain - * ROMFS volume data, as included in the assembly snippet above (l. 84). - * - ****************************************************************************/ - -int stm32_romfs_initialize(void); - -#endif /* CONFIG_STM32_ROMFS */ - -#endif /* __BOARDS_ARM_STM32_STM32F4DISCOVERY_SRC_STM32_ROMFS_H */ diff --git a/boards/arm/stm32f4/stm32f4discovery/src/stm32_romfs_initialize.c b/boards/arm/stm32f4/stm32f4discovery/src/stm32_romfs_initialize.c deleted file mode 100644 index 2814a9eb8e1..00000000000 --- a/boards/arm/stm32f4/stm32f4discovery/src/stm32_romfs_initialize.c +++ /dev/null @@ -1,154 +0,0 @@ -/**************************************************************************** - * boards/arm/stm32f4/stm32f4discovery/src/stm32_romfs_initialize.c - * This file provides contents of an optional ROMFS volume, mounted at boot. - * - * SPDX-License-Identifier: BSD-3-Clause - * SPDX-FileCopyrightText: 2017 Tomasz Wozniak. All rights reserved. - * SPDX-FileContributor: Tomasz Wozniak - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include "stm32_romfs.h" - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#ifndef CONFIG_STM32_ROMFS -# error "CONFIG_STM32_ROMFS must be defined" -#else - -#ifndef CONFIG_STM32_ROMFS_IMAGEFILE -# error "CONFIG_STM32_ROMFS_IMAGEFILE must be defined" -#endif - -#ifndef CONFIG_STM32_ROMFS_DEV_MINOR -# error "CONFIG_STM32_ROMFS_DEV_MINOR must be defined" -#endif - -#ifndef CONFIG_STM32_ROMFS_MOUNTPOINT -# error "CONFIG_STM32_ROMFS_MOUNTPOINT must be defined" -#endif - -#define NSECTORS(size) (((size) + ROMFS_SECTOR_SIZE - 1)/ROMFS_SECTOR_SIZE) - -#define STR2(m) #m -#define STR(m) STR2(m) - -#define MKMOUNT_DEVNAME(m) "/dev/ram" STR(m) -#define MOUNT_DEVNAME MKMOUNT_DEVNAME(CONFIG_STM32_ROMFS_DEV_MINOR) - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -__asm__ ( - ".section .rodata, \"a\"\n" - ".balign 16\n" - ".globl romfs_data_begin\n" -"romfs_data_begin:\n" - ".incbin " STR(CONFIG_STM32_ROMFS_IMAGEFILE) "\n"\ - \ - ".balign " STR(ROMFS_SECTOR_SIZE) "\n" - ".globl romfs_data_end\n" -"romfs_data_end:\n"); - -extern const uint8_t romfs_data_begin[]; -extern const uint8_t romfs_data_end[]; - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: stm32_romfs_initialize - * - * Description: - * Registers the aboveincluded binary file as block device. - * Then mounts the block device as ROMFS filesystems. - * - * Returned Value: - * Zero (OK) on success, a negated errno value on error. - * - * Assumptions/Limitations: - * Memory addresses [romfs_data_begin .. romfs_data_end) should contain - * ROMFS volume data, as included in the assembly snippet above (l. 84). - * - ****************************************************************************/ - -int stm32_romfs_initialize(void) -{ - size_t romfs_data_len; - int ret; - - /* Create a ROM disk for the /etc filesystem */ - - romfs_data_len = romfs_data_end - romfs_data_begin; - - ret = romdisk_register(CONFIG_STM32_ROMFS_DEV_MINOR, romfs_data_begin, - NSECTORS(romfs_data_len), ROMFS_SECTOR_SIZE); - if (ret < 0) - { - ferr("ERROR: romdisk_register failed: %d\n", -ret); - return ret; - } - - /* Mount the file system */ - - finfo("Mounting ROMFS filesystem at target=%s with source=%s\n", - CONFIG_STM32_ROMFS_MOUNTPOINT, MOUNT_DEVNAME); - - ret = nx_mount(MOUNT_DEVNAME, CONFIG_STM32_ROMFS_MOUNTPOINT, - "romfs", MS_RDONLY, NULL); - if (ret < 0) - { - ferr("ERROR: nx_mount(%s,%s,romfs) failed: %d\n", - MOUNT_DEVNAME, CONFIG_STM32_ROMFS_MOUNTPOINT, ret); - return ret; - } - - return OK; -} - -#endif /* CONFIG_STM32_ROMFS */