diff --git a/boards/x86_64/intel64/qemu-intel64/configs/nsh/defconfig b/boards/x86_64/intel64/qemu-intel64/configs/nsh/defconfig new file mode 100644 index 00000000000..732bb5aea19 --- /dev/null +++ b/boards/x86_64/intel64/qemu-intel64/configs/nsh/defconfig @@ -0,0 +1,60 @@ +# +# This file is autogenerated: PLEASE DO NOT EDIT IT. +# +# You can use "make menuconfig" to make any modifications to the installed .config file. +# You can then do "make savedefconfig" to generate a new defconfig file that includes your +# modifications. +# +CONFIG_16550_ADDRWIDTH=16 +CONFIG_16550_UART0=y +CONFIG_16550_UART0_BASE=0x3f8 +CONFIG_16550_UART0_CLOCK=1843200 +CONFIG_16550_UART0_IRQ=36 +CONFIG_16550_UART0_RXBUFSIZE=16 +CONFIG_16550_UART0_SERIAL_CONSOLE=y +CONFIG_16550_UART0_TXBUFSIZE=16 +CONFIG_16550_UART=y +CONFIG_ARCH="x86_64" +CONFIG_ARCH_BOARD="qemu-intel64" +CONFIG_ARCH_BOARD_INTEL64_QEMU=y +CONFIG_ARCH_CHIP="intel64" +CONFIG_ARCH_INTEL64_CORE_FREQ_KHZ=2600000 +CONFIG_ARCH_SIZET_LONG=y +CONFIG_ARCH_X86_64=y +CONFIG_BOARD_LOOPSPERMSEC=999 +CONFIG_BOOT_RUNFROMEXTSRAM=y +CONFIG_BUILTIN=y +CONFIG_CLOCK_MONOTONIC=y +CONFIG_CONSOLE_SYSLOG=y +CONFIG_EXAMPLES_HELLO=y +CONFIG_EXAMPLES_HELLO_STACKSIZE=4194304 +CONFIG_FS_PROCFS=y +CONFIG_IDLETHREAD_STACKSIZE=4194304 +CONFIG_MAX_TASKS=64 +CONFIG_NFILE_DESCRIPTORS=32 +CONFIG_NSH_ARCHINIT=y +CONFIG_NSH_BUILTIN_APPS=y +CONFIG_NSH_DISABLE_IFCONFIG=y +CONFIG_NSH_DISABLE_IFUPDOWN=y +CONFIG_PREALLOC_CHILDSTATUS=16 +CONFIG_PRIORITY_INHERITANCE=y +CONFIG_PTHREAD_MUTEX_TYPES=y +CONFIG_PTHREAD_STACK_DEFAULT=4194304 +CONFIG_PTHREAD_STACK_MIN=4194304 +CONFIG_RAM_SIZE=268435456 +CONFIG_SCHED_CHILD_STATUS=y +CONFIG_SCHED_HAVE_PARENT=y +CONFIG_SCHED_TICKLESS=y +CONFIG_SCHED_TICKLESS_ALARM=y +CONFIG_SCHED_TICKLESS_LIMIT_MAX_SLEEP=y +CONFIG_SCHED_WAITPID=y +CONFIG_SDCLONE_DISABLE=y +CONFIG_SIG_DEFAULT=y +CONFIG_START_DAY=3 +CONFIG_START_MONTH=3 +CONFIG_START_YEAR=2011 +CONFIG_SYSTEM_NSH=y +CONFIG_SYSTEM_TIME64=y +CONFIG_USEC_PER_TICK=1 +CONFIG_USERMAIN_STACKSIZE=4194304 +CONFIG_USER_ENTRYPOINT="nsh_main" diff --git a/boards/x86_64/intel64/qemu-intel64/src/Makefile b/boards/x86_64/intel64/qemu-intel64/src/Makefile index 990c43138fb..b8eaed37e30 100644 --- a/boards/x86_64/intel64/qemu-intel64/src/Makefile +++ b/boards/x86_64/intel64/qemu-intel64/src/Makefile @@ -21,7 +21,7 @@ -include $(TOPDIR)/Make.defs ASRCS = -CSRCS = qemu_boot.c qemu_freq.c qemu_net.c +CSRCS = qemu_boot.c qemu_bringup.c qemu_freq.c qemu_net.c ifeq ($(CONFIG_LIB_BOARDCTL),y) CSRCS += qemu_appinit.c diff --git a/boards/x86_64/intel64/qemu-intel64/src/qemu_appinit.c b/boards/x86_64/intel64/qemu-intel64/src/qemu_appinit.c index 50fcb30e601..65fecf34441 100644 --- a/boards/x86_64/intel64/qemu-intel64/src/qemu_appinit.c +++ b/boards/x86_64/intel64/qemu-intel64/src/qemu_appinit.c @@ -26,6 +26,7 @@ #include #include "up_internal.h" +#include "qemu_intel64.h" /**************************************************************************** * Public Functions @@ -56,9 +57,15 @@ * ****************************************************************************/ -#ifdef CONFIG_LIB_BOARDCTL int board_app_initialize(uintptr_t arg) { - return 0; +#ifdef CONFIG_BOARD_LATE_INITIALIZE + /* Board initialization already performed by board_late_initialize() */ + + return OK; +#else + /* Perform board-specific initialization */ + + return qemu_bringup(); +#endif } -#endif /* CONFIG_LIB_BOARDCTL */ diff --git a/boards/x86_64/intel64/qemu-intel64/src/qemu_bringup.c b/boards/x86_64/intel64/qemu-intel64/src/qemu_bringup.c new file mode 100644 index 00000000000..e9e7f0f1b18 --- /dev/null +++ b/boards/x86_64/intel64/qemu-intel64/src/qemu_bringup.c @@ -0,0 +1,61 @@ +/**************************************************************************** + * boards/x86_64/intel64/qemu-intel64/src/qemu_bringup.c + * + * 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 +#include +#include +#include + +#include +#include + +#include "qemu_intel64.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: qemu_bringup + ****************************************************************************/ + +int qemu_bringup(void) +{ + int ret = OK; + +#ifdef CONFIG_FS_PROCFS + /* Mount the procfs file system */ + + ret = mount(NULL, "/proc", "procfs", 0, NULL); + if (ret < 0) + { + serr("ERROR: Failed to mount procfs at %s: %d\n", "/proc", ret); + } +#endif + + return ret; +} diff --git a/boards/x86_64/intel64/qemu-intel64/src/qemu_intel64.h b/boards/x86_64/intel64/qemu-intel64/src/qemu_intel64.h index a400d59975a..d1a10e06405 100644 --- a/boards/x86_64/intel64/qemu-intel64/src/qemu_intel64.h +++ b/boards/x86_64/intel64/qemu-intel64/src/qemu_intel64.h @@ -48,5 +48,7 @@ * Public Function Prototypes ****************************************************************************/ +int qemu_bringup(void); + #endif /* __ASSEMBLY__ */ #endif /* __BOARDS_X86_64_INTEL64_QEMU_SRC_QEMU_INTEL64_H */