This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 78dfefa4cc0a1aba32b0dd8463d359f423fa7b86
Author: Justin Hammond <[email protected]>
AuthorDate: Sun Aug 16 18:02:44 2026 +0800

    boards/risc-v/eic7700x: Adopt the common board layout.
    
    The port had one board directory holding one board, with everything in it
    whether it described the SoC or the PCB.  A second EIC7700X board follows,
    so this adopts the common-plus-board layout NuttX provides, as mpfs uses.
    
    boards/risc-v/eic7700x/common holds what is true of the SoC: the boot path
    that mounts the RAM disk and /proc before calling the board's own bring
    up, the linker script, the start up scripts and the image builder.
    ARCH_CHIP_EIC7700X selects ARCH_BOARD_COMMON, so the symlinks the build
    makes always point at code that compiles.
    
    The board directory keeps what is a fact about the PCB: its own board.h
    and board_memorymap.h, since the include fallback is all or nothing, a
    bring up that owns the order its devices register in, and a board_config.h
    declaring what that bring up may call.
    
    The image builder moves to common/tools and derives its output name from
    the configuration.  It computes the padding between the kernel and the RAM
    disk from _ebss rather than assuming 64 KiB, which fails once BSS grows
    past it: the disk lands below _ebss and the BSS clear zeroes it before
    anything searches for it.
    
    The StarPro64 configuration gains what the port now needs: four harts,
    960 MiB of RAM, a larger task stack, a backtrace on assert, the system log
    in RAM for dmesg, and ELF applications, for which ARCH_CHIP_EIC7700X now
    selects ARCH_HAVE_ELF_EXECUTABLE.
    
    board.h loses its LED definitions.  CONFIG_ARCH_LEDS is not set, nothing
    implements board_autoled_on(), and the indices they gave named no LED.
    
    The documentation pages gain the tags the template asks for.
    
    Assisted-by: Claude:claude-opus-5
    Signed-off-by: Justin Hammond <[email protected]>
---
 .gitignore                                         |   1 +
 .../risc-v/eic7700x/boards/starpro64/index.rst     |  19 ++--
 Documentation/platforms/risc-v/eic7700x/index.rst  |   2 +
 arch/risc-v/Kconfig                                |   2 +
 boards/Kconfig                                     |  14 +++
 boards/risc-v/eic7700x/common/.gitignore           |   2 +
 .../eic7700x/{starpro64/src => common}/Makefile    |   8 +-
 .../src => common}/etc/init.d/rc.sysinit           |   0
 .../{starpro64/src => common}/etc/init.d/rcS       |   0
 .../{starpro64 => common}/scripts/Make.defs        |   4 +-
 .../{starpro64 => common}/scripts/ld.script        |  31 +++++-
 .../src/Makefile => common/src/Make.defs}          |  12 ++-
 .../src/eic7700x_boot.c}                           |  10 +-
 boards/risc-v/eic7700x/common/tools/mkimage.sh     | 112 +++++++++++++++++++++
 .../eic7700x/starpro64/configs/nsh/defconfig       |  34 ++++++-
 boards/risc-v/eic7700x/starpro64/include/board.h   |  10 --
 .../eic7700x/starpro64/include/board_memorymap.h   |   5 -
 .../eic7700x/starpro64/src/{Makefile => Make.defs} |  12 +--
 .../{include/board.h => src/board_config.h}        |  55 ++--------
 .../{include/board.h => src/eic7700x_bringup.c}    |  56 +++--------
 20 files changed, 252 insertions(+), 137 deletions(-)

diff --git a/.gitignore b/.gitignore
index 688611b4197..1a330bdd34e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -61,6 +61,7 @@ etctmp/
 /cscope.*
 /defconfig
 /defconfig.tmp.bak
+/Image-*
 /Make.defs
 /nuttx
 /nuttx32
diff --git a/Documentation/platforms/risc-v/eic7700x/boards/starpro64/index.rst 
b/Documentation/platforms/risc-v/eic7700x/boards/starpro64/index.rst
index 8e856423164..532a2664ade 100644
--- a/Documentation/platforms/risc-v/eic7700x/boards/starpro64/index.rst
+++ b/Documentation/platforms/risc-v/eic7700x/boards/starpro64/index.rst
@@ -2,6 +2,8 @@
 PINE64 StarPro64
 ================
 
+.. tags:: chip:eic7700x, arch:risc-v, vendor:pine64, experimental
+
 `PINE64 StarPro64 <https://lupyuen.github.io/articles/starpro64>`_
 is a RISC-V Single-Board Computer based on the ESWIN EIC7700X RISC-V SoC
 with Quad-Core 64-bit RISC-V CPU, 32 GB LPDDR5 RAM and 100 Mbps Ethernet.
@@ -89,16 +91,21 @@ This produces the NuttX Kernel ``nuttx.bin``.  Next, build 
the NuttX Apps Filesy
    $ tools/mkimport.sh -z -x ../nuttx/nuttx-export-*.tar.gz
    $ make import
    $ popd
-   $ genromfs -f initrd -d ../apps/bin -V "NuttXBootVol"
-
-This generates the Initial RAM Disk ``initrd``.
 
-Package the NuttX Kernel and Initial RAM Disk into a NuttX Image:
+Package the NuttX Kernel and the applications into a NuttX Image:
 
 .. code:: console
 
-   $ head -c 65536 /dev/zero >/tmp/nuttx.pad
-   $ cat nuttx.bin /tmp/nuttx.pad initrd >Image-starpro64
+   $ boards/risc-v/eic7700x/common/tools/mkimage.sh
+
+The image is the kernel, then padding, then a RAM disk holding the
+applications.  Use the script rather than padding by hand.  The RAM disk is
+found at run time by searching memory for its header, and that search runs
+after BSS has been cleared, so the disk has to start above ``_ebss`` or it
+is zeroed before anything looks for it.  The script reads ``_ebss`` from the
+kernel and pads to suit; a fixed pad works only until BSS grows past it, and
+when it does the board hangs during start up with nothing on the console at
+all, because the failure happens before there is a console to report it.
 
 The NuttX Image ``Image-starpro64`` will be copied to the TFTP Server in the 
next step.
 
diff --git a/Documentation/platforms/risc-v/eic7700x/index.rst 
b/Documentation/platforms/risc-v/eic7700x/index.rst
index e54ac50a581..6fa44ebc45c 100644
--- a/Documentation/platforms/risc-v/eic7700x/index.rst
+++ b/Documentation/platforms/risc-v/eic7700x/index.rst
@@ -2,6 +2,8 @@
 ESWIN EIC7700X
 ==============
 
+.. tags:: chip:eic7700x, arch:risc-v, vendor:eswin
+
 `ESWIN EIC7700X <https://www.eswincomputing.com/en/products/index/36.html>`_ 
is a 64-bit RISC-V SoC with 4 RISC-V Cores:
 
 - **Processors:** 4 x RV64GC 1.4 GHz 64-bit RISC-V Cores
diff --git a/arch/risc-v/Kconfig b/arch/risc-v/Kconfig
index 1c0c54b3e25..6ce72af7af7 100644
--- a/arch/risc-v/Kconfig
+++ b/arch/risc-v/Kconfig
@@ -437,6 +437,8 @@ config ARCH_CHIP_SG2000
 
 config ARCH_CHIP_EIC7700X
        bool "ESWIN EIC7700X"
+       select ARCH_BOARD_COMMON
+       select ARCH_HAVE_ELF_EXECUTABLE
        select ARCH_RV64
        select ARCH_RV_ISA_M
        select ARCH_RV_ISA_A
diff --git a/boards/Kconfig b/boards/Kconfig
index d169832406c..03d3c64674e 100644
--- a/boards/Kconfig
+++ b/boards/Kconfig
@@ -2414,6 +2414,20 @@ config ARCH_BOARD_EIC7700X_STARPRO64
                This options selects support for NuttX on PINE64 StarPro64 based
                on ESWIN EIC7700X SoC.
 
+               UART0 is the console.  There is no USB serial bridge on the
+               board, so it comes out level shifted to 3.3V on the 40 pin GPIO
+               header, transmit on pin 8 and receive on pin 10, which is where
+               a Raspberry Pi puts them too.
+
+               UART1 carries the Bluetooth HCI of the on board AIC8800D80 WiFi
+               and Bluetooth combo, CTS and RTS included.
+
+               Nothing else here is a UART, in spite of the UART map on sheet 3
+               of the schematic.  That table came from ESWIN's reference design
+               and does not describe this board: GPIO62, which is the UART2_TX
+               pad, drives the system state LED, GPIO63 is unconnected, the
+               UART3 pads carry I2C8, and the UART4 pads go nowhere.
+
 config ARCH_BOARD_S32K118EVB
        bool "NXP S32K118EVB"
        depends on ARCH_CHIP_S32K118
diff --git a/boards/risc-v/eic7700x/common/.gitignore 
b/boards/risc-v/eic7700x/common/.gitignore
new file mode 100644
index 00000000000..cc92d189b53
--- /dev/null
+++ b/boards/risc-v/eic7700x/common/.gitignore
@@ -0,0 +1,2 @@
+etctmp
+etctmp.c
diff --git a/boards/risc-v/eic7700x/starpro64/src/Makefile 
b/boards/risc-v/eic7700x/common/Makefile
similarity index 88%
copy from boards/risc-v/eic7700x/starpro64/src/Makefile
copy to boards/risc-v/eic7700x/common/Makefile
index 4c1536de06f..e93815e065b 100644
--- a/boards/risc-v/eic7700x/starpro64/src/Makefile
+++ b/boards/risc-v/eic7700x/common/Makefile
@@ -1,5 +1,5 @@
 ############################################################################
-# boards/risc-v/eic7700x/starpro64/src/Makefile
+# boards/risc-v/eic7700x/common/Makefile
 #
 # SPDX-License-Identifier: Apache-2.0
 #
@@ -22,8 +22,10 @@
 
 include $(TOPDIR)/Make.defs
 
-RCSRCS = etc/init.d/rc.sysinit etc/init.d/rcS
+include board/Make.defs
+include src/Make.defs
 
-CSRCS = eic7700x_boardinit.c
+DEPPATH += --dep-path board
+DEPPATH += --dep-path src
 
 include $(TOPDIR)/boards/Board.mk
diff --git a/boards/risc-v/eic7700x/starpro64/src/etc/init.d/rc.sysinit 
b/boards/risc-v/eic7700x/common/etc/init.d/rc.sysinit
similarity index 100%
rename from boards/risc-v/eic7700x/starpro64/src/etc/init.d/rc.sysinit
rename to boards/risc-v/eic7700x/common/etc/init.d/rc.sysinit
diff --git a/boards/risc-v/eic7700x/starpro64/src/etc/init.d/rcS 
b/boards/risc-v/eic7700x/common/etc/init.d/rcS
similarity index 100%
rename from boards/risc-v/eic7700x/starpro64/src/etc/init.d/rcS
rename to boards/risc-v/eic7700x/common/etc/init.d/rcS
diff --git a/boards/risc-v/eic7700x/starpro64/scripts/Make.defs 
b/boards/risc-v/eic7700x/common/scripts/Make.defs
similarity index 93%
rename from boards/risc-v/eic7700x/starpro64/scripts/Make.defs
rename to boards/risc-v/eic7700x/common/scripts/Make.defs
index d885c4a4f99..21cc6cdeffc 100644
--- a/boards/risc-v/eic7700x/starpro64/scripts/Make.defs
+++ b/boards/risc-v/eic7700x/common/scripts/Make.defs
@@ -1,5 +1,5 @@
 ############################################################################
-# boards/risc-v/eic7700x/starpro64/scripts/Make.defs
+# boards/risc-v/eic7700x/common/scripts/Make.defs
 #
 # SPDX-License-Identifier: Apache-2.0
 #
@@ -25,7 +25,7 @@ include $(TOPDIR)/tools/Config.mk
 include $(TOPDIR)/arch/risc-v/src/common/Toolchain.defs
 
 LDSCRIPT = ld.script
-ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)$(LDSCRIPT)
+ARCHSCRIPT += $(call FINDSCRIPT,$(LDSCRIPT))
 
 CFLAGS := $(ARCHCFLAGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) 
$(ARCHDEFINES) $(EXTRAFLAGS) -pipe
 CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS)
diff --git a/boards/risc-v/eic7700x/starpro64/scripts/ld.script 
b/boards/risc-v/eic7700x/common/scripts/ld.script
similarity index 75%
rename from boards/risc-v/eic7700x/starpro64/scripts/ld.script
rename to boards/risc-v/eic7700x/common/scripts/ld.script
index b4e6a8fb91b..795d4805dcb 100644
--- a/boards/risc-v/eic7700x/starpro64/scripts/ld.script
+++ b/boards/risc-v/eic7700x/common/scripts/ld.script
@@ -20,12 +20,26 @@
  *
  ****************************************************************************/
 
+/* The SoC has 16 GiB of LPDDR5 and this describes 960 MiB of it, which is as
+ * much as the design can currently use.  Three things decide that:
+ *
+ *   - The kernel's RAM mapping hangs off a single 512 entry L2 page table at
+ *     L1 index 2, so it reaches 0x80000000 to 0xc0000000 and no further.
+ *   - The page pool cannot exceed 65535 pages, because the granule allocator
+ *     behind mm_pgalloc() counts them in a uint16_t.  At 4 KiB that is just
+ *     under 256 MiB.
+ *   - Nothing yet allocates enough for the rest to be worth mapping.
+ *
+ * Every boundary is 2 MiB aligned because everything except kflash is mapped
+ * with 2 MiB pages.  480 of the 512 L2 entries are used.
+ */
+
 MEMORY
 {
     kflash (rx) : ORIGIN = 0x80200000, LENGTH = 2048K   /* w/ cache */
-    ksram (rwx) : ORIGIN = 0x80400000, LENGTH = 2048K   /* w/ cache */
-    pgram (rwx) : ORIGIN = 0x80600000, LENGTH = 4096K   /* w/ cache */
-    ramdisk (rwx) : ORIGIN = 0x80A00000, LENGTH = 16M   /* w/ cache */
+    ksram (rwx) : ORIGIN = 0x80400000, LENGTH = 640M    /* w/ cache */
+    pgram (rwx) : ORIGIN = 0xA8400000, LENGTH = 254M    /* w/ cache */
+    ramdisk (rwx) : ORIGIN = 0xB8200000, LENGTH = 64M   /* w/ cache */
 }
 
 OUTPUT_ARCH("riscv")
@@ -38,10 +52,17 @@ __ksram_start = ORIGIN(ksram);
 __ksram_size = LENGTH(ksram);
 __ksram_end = ORIGIN(ksram) + LENGTH(ksram);
 
-/* Page heap */
+/* Page heap.
+ *
+ * This is pgram and nothing else.  The RAM disk must not be part of it: the
+ * page allocator hands its pages out to user address environments, and there
+ * is nothing anywhere in NuttX that holds a region back from it, so a pool
+ * that covers the RAM disk is a pool that eventually returns pages of the
+ * mounted file system.
+ */
 
 __pgheap_start = ORIGIN(pgram);
-__pgheap_size = LENGTH(pgram) + LENGTH(ramdisk);
+__pgheap_size = LENGTH(pgram);
 
 /* Application ramdisk */
 
diff --git a/boards/risc-v/eic7700x/starpro64/src/Makefile 
b/boards/risc-v/eic7700x/common/src/Make.defs
similarity index 79%
copy from boards/risc-v/eic7700x/starpro64/src/Makefile
copy to boards/risc-v/eic7700x/common/src/Make.defs
index 4c1536de06f..08696495e1b 100644
--- a/boards/risc-v/eic7700x/starpro64/src/Makefile
+++ b/boards/risc-v/eic7700x/common/src/Make.defs
@@ -1,5 +1,5 @@
 ############################################################################
-# boards/risc-v/eic7700x/starpro64/src/Makefile
+# boards/risc-v/eic7700x/common/src/Make.defs
 #
 # SPDX-License-Identifier: Apache-2.0
 #
@@ -20,10 +20,14 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+ifeq ($(CONFIG_ARCH_BOARD_COMMON),y)
+
+CSRCS += eic7700x_boot.c
 
 RCSRCS = etc/init.d/rc.sysinit etc/init.d/rcS
 
-CSRCS = eic7700x_boardinit.c
+DEPPATH += --dep-path src
+VPATH += :src
+CFLAGS += 
${INCDIR_PREFIX}$(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src$(DELIM)board$(DELIM)src
 
-include $(TOPDIR)/boards/Board.mk
+endif
diff --git a/boards/risc-v/eic7700x/starpro64/src/eic7700x_boardinit.c 
b/boards/risc-v/eic7700x/common/src/eic7700x_boot.c
similarity index 96%
rename from boards/risc-v/eic7700x/starpro64/src/eic7700x_boardinit.c
rename to boards/risc-v/eic7700x/common/src/eic7700x_boot.c
index a712fd760d6..9788924113b 100644
--- a/boards/risc-v/eic7700x/starpro64/src/eic7700x_boardinit.c
+++ b/boards/risc-v/eic7700x/common/src/eic7700x_boot.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * boards/risc-v/eic7700x/starpro64/src/eic7700x_boardinit.c
+ * boards/risc-v/eic7700x/common/src/eic7700x_boot.c
  *
  * SPDX-License-Identifier: Apache-2.0
  *
@@ -37,6 +37,8 @@
 #include <sys/boardctl.h>
 #include <arch/board/board_memorymap.h>
 
+#include "board_config.h"
+
 /****************************************************************************
  * Pre-processor Definitions
  ****************************************************************************/
@@ -118,8 +120,10 @@ void board_late_initialize(void)
 
   mount_ramdisk();
 
-  /* Perform board-specific initialization */
-
   mount(NULL, "/proc", "procfs", 0, NULL);
+
+  /* Devices whose presence or order is this board's business */
+
+  eic7700x_bringup();
 }
 #endif /* CONFIG_BOARD_LATE_INITIALIZE */
diff --git a/boards/risc-v/eic7700x/common/tools/mkimage.sh 
b/boards/risc-v/eic7700x/common/tools/mkimage.sh
new file mode 100755
index 00000000000..fdea867eb01
--- /dev/null
+++ b/boards/risc-v/eic7700x/common/tools/mkimage.sh
@@ -0,0 +1,112 @@
+#!/usr/bin/env bash
+############################################################################
+# boards/risc-v/eic7700x/common/tools/mkimage.sh
+#
+# 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.
+#
+############################################################################
+#
+# Build the bootable image: the kernel, then padding, then the RAM disk.
+#
+# The padding is computed rather than fixed, and that is the whole point of
+# this script.  The RAM disk is appended to the kernel and found at run time
+# by searching memory for its header, and that search happens after BSS has
+# been cleared.  So the disk has to start above _ebss or it is zeroed before
+# anything looks for it.  A fixed pad works only until BSS grows past it,
+# and when it does the failure is a panic before the console exists, which
+# looks like a board that hangs with no output at all.  The kernel's own
+# sanity check compares against the idle stack top, which sits below BSS
+# rather than above it, so it does not catch this either.
+#
+# Usage:
+#   mkimage.sh [-o output] [-a apps-dir] [-n nm-tool] [-l load-addr]
+#
+# The default output name is Image-<board>, taken from the configuration,
+# so each board's image names itself.
+#
+# Run from the nuttx directory after "make" and after the apps have been
+# built and installed into their bin directory.
+
+set -e
+
+APPSDIR="../apps"
+BOARD=$(sed -n 's/^CONFIG_ARCH_BOARD="\(.*\)"$/\1/p' .config 2>/dev/null)
+OUTPUT="Image-${BOARD:-eic7700x}"
+NM="${CROSSDEV:-riscv-none-elf-}nm"
+LOADADDR="0x80200000"
+MARGIN=$((64 * 1024))
+
+usage()
+{
+  sed -n '25,43p' "$0"
+  echo
+  echo "  -o  output image             (default: $OUTPUT)"
+  echo "  -a  apps directory           (default: $APPSDIR)"
+  echo "  -n  nm for the target        (default: $NM)"
+  echo "  -l  kernel load address      (default: $LOADADDR)"
+  exit 1
+}
+
+while getopts "o:a:n:l:h" opt; do
+  case $opt in
+    o) OUTPUT="$OPTARG" ;;
+    a) APPSDIR="$OPTARG" ;;
+    n) NM="$OPTARG" ;;
+    l) LOADADDR="$OPTARG" ;;
+    *) usage ;;
+  esac
+done
+
+if [ ! -f nuttx ] || [ ! -f nuttx.bin ]; then
+  echo "mkimage: run this from the nuttx directory after make" >&2
+  exit 1
+fi
+
+if [ ! -d "$APPSDIR/bin" ]; then
+  echo "mkimage: no $APPSDIR/bin; build and install the apps first" >&2
+  exit 1
+fi
+
+# Where BSS ends, which is the earliest the RAM disk may start.
+
+EBSS=$("$NM" nuttx | awk '/ _ebss$/ { print $1 }')
+if [ -z "$EBSS" ]; then
+  echo "mkimage: no _ebss in nuttx; is $NM right for this target?" >&2
+  exit 1
+fi
+
+TMPDIR_="$(mktemp -d)"
+trap 'rm -rf "$TMPDIR_"' EXIT
+
+genromfs -f "$TMPDIR_/initrd" -d "$APPSDIR/bin" -V "NuttXBootVol"
+
+# Pad so that the disk lands past the end of BSS, with a margin.  wc -c is
+# used rather than stat, whose flags differ between GNU and BSD.
+
+BINSZ=$(wc -c < nuttx.bin)
+NEED=$(( 0x$EBSS - LOADADDR + MARGIN ))
+PAD=$(( NEED - BINSZ ))
+if [ "$PAD" -lt 0 ]; then
+  PAD=0
+fi
+
+head -c "$PAD" /dev/zero > "$TMPDIR_/pad"
+cat nuttx.bin "$TMPDIR_/pad" "$TMPDIR_/initrd" > "$OUTPUT"
+
+printf '%s: _ebss 0x%s, kernel %s, pad %s, disk at %s\n' \
+       "$OUTPUT" "$EBSS" "$BINSZ" "$PAD" "$(( BINSZ + PAD ))"
diff --git a/boards/risc-v/eic7700x/starpro64/configs/nsh/defconfig 
b/boards/risc-v/eic7700x/starpro64/configs/nsh/defconfig
index 6bbcba05f1f..b7e11be2a6a 100644
--- a/boards/risc-v/eic7700x/starpro64/configs/nsh/defconfig
+++ b/boards/risc-v/eic7700x/starpro64/configs/nsh/defconfig
@@ -14,11 +14,16 @@ CONFIG_16550_UART0_BASE=0x50900000
 CONFIG_16550_UART0_CLOCK=198144000
 CONFIG_16550_UART0_IRQ=125
 CONFIG_16550_UART0_SERIAL_CONSOLE=y
+CONFIG_16550_UART1=y
+CONFIG_16550_UART1_BASE=0x50910000
+CONFIG_16550_UART1_CLOCK=198144000
+CONFIG_16550_UART1_IRQ=126
 CONFIG_16550_UART=y
 CONFIG_16550_WAIT_LCR=y
 CONFIG_ARCH="risc-v"
 CONFIG_ARCH_ADDRENV=y
 CONFIG_ARCH_BOARD="starpro64"
+CONFIG_ARCH_BOARD_COMMON=y
 CONFIG_ARCH_BOARD_EIC7700X_STARPRO64=y
 CONFIG_ARCH_CHIP="eic7700x"
 CONFIG_ARCH_CHIP_EIC7700X=y
@@ -29,9 +34,9 @@ CONFIG_ARCH_HEAP_VBASE=0xC0200000
 CONFIG_ARCH_INTERRUPTSTACK=2048
 CONFIG_ARCH_KERNEL_STACKSIZE=3072
 CONFIG_ARCH_PGPOOL_MAPPING=y
-CONFIG_ARCH_PGPOOL_PBASE=0x80600000
-CONFIG_ARCH_PGPOOL_SIZE=4194304
-CONFIG_ARCH_PGPOOL_VBASE=0x80600000
+CONFIG_ARCH_PGPOOL_PBASE=0xA8400000
+CONFIG_ARCH_PGPOOL_SIZE=266338304
+CONFIG_ARCH_PGPOOL_VBASE=0xA8400000
 CONFIG_ARCH_RISCV=y
 CONFIG_ARCH_STACKDUMP=y
 CONFIG_ARCH_TEXT_NPAGES=128
@@ -39,15 +44,23 @@ CONFIG_ARCH_TEXT_VBASE=0xC0000000
 CONFIG_ARCH_USE_MMU=y
 CONFIG_ARCH_USE_MPU=y
 CONFIG_ARCH_USE_S_MODE=y
+CONFIG_BINFMT_ELF_EXECUTABLE=y
 CONFIG_BOARDCTL_ROMDISK=y
 CONFIG_BOARD_LOOPSPERMSEC=1120
 CONFIG_BUILD_KERNEL=y
 CONFIG_DEBUG_ASSERTIONS=y
 CONFIG_DEBUG_ASSERTIONS_EXPRESSION=y
 CONFIG_DEBUG_FEATURES=y
+CONFIG_DEBUG_FS=y
+CONFIG_DEBUG_FS_ERROR=y
 CONFIG_DEBUG_FULLOPT=y
+CONFIG_DEBUG_MM=y
+CONFIG_DEBUG_MM_ERROR=y
+CONFIG_DEBUG_SCHED=y
 CONFIG_DEBUG_SYMBOLS=y
+CONFIG_DEFAULT_TASK_STACKSIZE=8192
 CONFIG_ELF=y
+CONFIG_ELF_STACKSIZE=2048
 CONFIG_EXAMPLES_HELLO=m
 CONFIG_FS_PROCFS=y
 CONFIG_FS_ROMFS=y
@@ -56,8 +69,8 @@ CONFIG_INIT_FILEPATH="/system/bin/init"
 CONFIG_INIT_MOUNT=y
 CONFIG_INIT_MOUNT_FLAGS=0x1
 CONFIG_INIT_MOUNT_TARGET="/system/bin"
-CONFIG_INIT_STACKSIZE=3072
 CONFIG_INTELHEX_BINARY=y
+CONFIG_IRQ_WORK_STACKSIZE=2048
 CONFIG_LIBC_ENVPATH=y
 CONFIG_LIBC_EXECFUNCS=y
 CONFIG_LIBC_MEMSET_64BIT=y
@@ -70,21 +83,32 @@ CONFIG_NSH_FILEIOSIZE=512
 CONFIG_NSH_FILE_APPS=y
 CONFIG_NSH_READLINE=y
 CONFIG_PATH_INITIAL="/system/bin"
-CONFIG_RAM_SIZE=1048576
+CONFIG_POSIX_SPAWN_DEFAULT_STACKSIZE=2048
+CONFIG_RAMLOG=y
+CONFIG_RAMLOG_BUFSIZE=32768
+CONFIG_RAMLOG_SYSLOG=y
+CONFIG_RAM_SIZE=1006632960
 CONFIG_RAM_START=0x80200000
 CONFIG_RAW_BINARY=y
 CONFIG_READLINE_CMD_HISTORY=y
 CONFIG_RR_INTERVAL=200
+CONFIG_SCHED_BACKTRACE=y
+CONFIG_SCHED_CPULOAD_SYSCLK=y
 CONFIG_SCHED_HAVE_PARENT=y
 CONFIG_SCHED_LPWORK=y
 CONFIG_SCHED_WAITPID=y
 CONFIG_SERIAL_UART_ARCH_MMIO=y
+CONFIG_SMP=y
+CONFIG_STACKCHECK_MARGIN=128
 CONFIG_STACK_COLORATION=y
 CONFIG_START_MONTH=12
 CONFIG_START_YEAR=2021
 CONFIG_SYMTAB_ORDEREDBYNAME=y
+CONFIG_SYSLOG_DEFAULT=y
+CONFIG_SYSLOG_MAX_CHANNELS=2
 CONFIG_SYSTEM_NSH=y
 CONFIG_SYSTEM_NSH_PROGNAME="init"
 CONFIG_TESTING_GETPRIME=y
 CONFIG_TESTING_OSTEST=y
+CONFIG_TESTING_SMP=y
 CONFIG_USEC_PER_TICK=1000
diff --git a/boards/risc-v/eic7700x/starpro64/include/board.h 
b/boards/risc-v/eic7700x/starpro64/include/board.h
index dda5f476555..89b9b1bc724 100644
--- a/boards/risc-v/eic7700x/starpro64/include/board.h
+++ b/boards/risc-v/eic7700x/starpro64/include/board.h
@@ -33,16 +33,6 @@
  * Pre-processor Definitions
  ****************************************************************************/
 
-#define LED_STARTED       0  /* N/A */
-#define LED_HEAPALLOCATE  1  /* N/A */
-#define LED_IRQSENABLED   2  /* N/A */
-#define LED_STACKCREATED  3  /* N/A */
-#define LED_INIRQ         4  /* N/A */
-#define LED_SIGNAL        5  /* N/A */
-#define LED_ASSERTION     6  /* N/A */
-#define LED_PANIC         7  /* N/A */
-#define LED_CPU           8  /* LED */
-
 /****************************************************************************
  * Public Types
  ****************************************************************************/
diff --git a/boards/risc-v/eic7700x/starpro64/include/board_memorymap.h 
b/boards/risc-v/eic7700x/starpro64/include/board_memorymap.h
index 8bb29963a5e..d53b6bf4c02 100644
--- a/boards/risc-v/eic7700x/starpro64/include/board_memorymap.h
+++ b/boards/risc-v/eic7700x/starpro64/include/board_memorymap.h
@@ -41,11 +41,6 @@
 #define KSRAM_SIZE      (uintptr_t)__ksram_size
 #define KSRAM_END       (uintptr_t)__ksram_end
 
-/* Kernel RAM (RW) */
-
-#define PGPOOL_START    (uintptr_t)__pgheap_start
-#define PGPOOL_SIZE     (uintptr_t)__pgheap_size
-
 /* Page pool (RWX) */
 
 #define PGPOOL_START    (uintptr_t)__pgheap_start
diff --git a/boards/risc-v/eic7700x/starpro64/src/Makefile 
b/boards/risc-v/eic7700x/starpro64/src/Make.defs
similarity index 81%
rename from boards/risc-v/eic7700x/starpro64/src/Makefile
rename to boards/risc-v/eic7700x/starpro64/src/Make.defs
index 4c1536de06f..f1ff3c6c693 100644
--- a/boards/risc-v/eic7700x/starpro64/src/Makefile
+++ b/boards/risc-v/eic7700x/starpro64/src/Make.defs
@@ -1,5 +1,5 @@
 ############################################################################
-# boards/risc-v/eic7700x/starpro64/src/Makefile
+# boards/risc-v/eic7700x/starpro64/src/Make.defs
 #
 # SPDX-License-Identifier: Apache-2.0
 #
@@ -20,10 +20,8 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+CSRCS = eic7700x_bringup.c
 
-RCSRCS = etc/init.d/rc.sysinit etc/init.d/rcS
-
-CSRCS = eic7700x_boardinit.c
-
-include $(TOPDIR)/boards/Board.mk
+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/risc-v/eic7700x/starpro64/include/board.h 
b/boards/risc-v/eic7700x/starpro64/src/board_config.h
similarity index 52%
copy from boards/risc-v/eic7700x/starpro64/include/board.h
copy to boards/risc-v/eic7700x/starpro64/src/board_config.h
index dda5f476555..b110bb7bf5e 100644
--- a/boards/risc-v/eic7700x/starpro64/include/board.h
+++ b/boards/risc-v/eic7700x/starpro64/src/board_config.h
@@ -1,5 +1,5 @@
 /****************************************************************************
- * boards/risc-v/eic7700x/starpro64/include/board.h
+ * boards/risc-v/eic7700x/starpro64/src/board_config.h
  *
  * SPDX-License-Identifier: Apache-2.0
  *
@@ -20,8 +20,8 @@
  *
  ****************************************************************************/
 
-#ifndef __BOARDS_RISCV_EIC7700X_STARPRO64_INCLUDE_BOARD_H
-#define __BOARDS_RISCV_EIC7700X_STARPRO64_INCLUDE_BOARD_H
+#ifndef __BOARDS_RISCV_EIC7700X_STARPRO64_SRC_BOARD_CONFIG_H
+#define __BOARDS_RISCV_EIC7700X_STARPRO64_SRC_BOARD_CONFIG_H
 
 /****************************************************************************
  * Included Files
@@ -29,52 +29,19 @@
 
 #include <nuttx/config.h>
 
-/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
-
-#define LED_STARTED       0  /* N/A */
-#define LED_HEAPALLOCATE  1  /* N/A */
-#define LED_IRQSENABLED   2  /* N/A */
-#define LED_STACKCREATED  3  /* N/A */
-#define LED_INIRQ         4  /* N/A */
-#define LED_SIGNAL        5  /* N/A */
-#define LED_ASSERTION     6  /* N/A */
-#define LED_PANIC         7  /* N/A */
-#define LED_CPU           8  /* LED */
-
-/****************************************************************************
- * Public Types
- ****************************************************************************/
-
-#ifndef __ASSEMBLY__
-
-/****************************************************************************
- * Public Data
- ****************************************************************************/
-
-#undef EXTERN
-#if defined(__cplusplus)
-#define EXTERN extern "C"
-extern "C"
-{
-#else
-#define EXTERN extern
-#endif
-
 /****************************************************************************
  * Public Function Prototypes
  ****************************************************************************/
 
 /****************************************************************************
- * Name: eic7700x_boardinitialize
+ * Name: eic7700x_bringup
+ *
+ * Description:
+ *   Bring up this board's devices, in this board's order.  Called from the
+ *   common layer's board_late_initialize().
+ *
  ****************************************************************************/
 
-void eic7700x_boardinitialize(void);
+int eic7700x_bringup(void);
 
-#undef EXTERN
-#if defined(__cplusplus)
-}
-#endif
-#endif /* __ASSEMBLY__ */
-#endif /* __BOARDS_RISCV_EIC7700X_STARPRO64_INCLUDE_BOARD_H */
+#endif /* __BOARDS_RISCV_EIC7700X_STARPRO64_SRC_BOARD_CONFIG_H */
diff --git a/boards/risc-v/eic7700x/starpro64/include/board.h 
b/boards/risc-v/eic7700x/starpro64/src/eic7700x_bringup.c
similarity index 51%
copy from boards/risc-v/eic7700x/starpro64/include/board.h
copy to boards/risc-v/eic7700x/starpro64/src/eic7700x_bringup.c
index dda5f476555..a22f826a4c0 100644
--- a/boards/risc-v/eic7700x/starpro64/include/board.h
+++ b/boards/risc-v/eic7700x/starpro64/src/eic7700x_bringup.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * boards/risc-v/eic7700x/starpro64/include/board.h
+ * boards/risc-v/eic7700x/starpro64/src/eic7700x_bringup.c
  *
  * SPDX-License-Identifier: Apache-2.0
  *
@@ -20,61 +20,31 @@
  *
  ****************************************************************************/
 
-#ifndef __BOARDS_RISCV_EIC7700X_STARPRO64_INCLUDE_BOARD_H
-#define __BOARDS_RISCV_EIC7700X_STARPRO64_INCLUDE_BOARD_H
-
 /****************************************************************************
  * Included Files
  ****************************************************************************/
 
 #include <nuttx/config.h>
 
-/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
+#include <sys/types.h>
 
-#define LED_STARTED       0  /* N/A */
-#define LED_HEAPALLOCATE  1  /* N/A */
-#define LED_IRQSENABLED   2  /* N/A */
-#define LED_STACKCREATED  3  /* N/A */
-#define LED_INIRQ         4  /* N/A */
-#define LED_SIGNAL        5  /* N/A */
-#define LED_ASSERTION     6  /* N/A */
-#define LED_PANIC         7  /* N/A */
-#define LED_CPU           8  /* LED */
+#include "board_config.h"
 
 /****************************************************************************
- * Public Types
+ * Public Functions
  ****************************************************************************/
 
-#ifndef __ASSEMBLY__
-
 /****************************************************************************
- * Public Data
+ * Name: eic7700x_bringup
+ *
+ * Description:
+ *   Bring up this board's devices, in this board's order.  Device drivers
+ *   register here as the port grows; the common layer owns everything that
+ *   is true of the SoC rather than of this board.
+ *
  ****************************************************************************/
 
-#undef EXTERN
-#if defined(__cplusplus)
-#define EXTERN extern "C"
-extern "C"
+int eic7700x_bringup(void)
 {
-#else
-#define EXTERN extern
-#endif
-
-/****************************************************************************
- * Public Function Prototypes
- ****************************************************************************/
-
-/****************************************************************************
- * Name: eic7700x_boardinitialize
- ****************************************************************************/
-
-void eic7700x_boardinitialize(void);
-
-#undef EXTERN
-#if defined(__cplusplus)
+  return OK;
 }
-#endif
-#endif /* __ASSEMBLY__ */
-#endif /* __BOARDS_RISCV_EIC7700X_STARPRO64_INCLUDE_BOARD_H */

Reply via email to