Skip to content

Commit d52e5b2

Browse files
lupyuenAlan C. Assis
authored andcommitted
boards/risc-v/eic7700x/starpro64: Add support for PINE64 StarPro64 SBC (ESWIN EIC7700X SoC)
This PR adds support for the PINE64 StarPro64 64-bit RISC-V SBC, based on ESWIN EIC7700X SoC. Most of the code was derived from NuttX for Milk-V Duo S (SOPHGO SG2000). The modified code is explained here: https://lupyuen.github.io/articles/starpro64#appendix-port-nuttx-to-starpro64 Modified Files: boards/Kconfig: Added StarPro64 board New Files in boards/risc-v/eic7700x/starpro64: src/eic7700x_appinit.c: Startup Code include/board.h: StarPro64 Definitions include/board_memorymap.h: Memory Map src/etc/init.d/rc.sysinit, rcS: Startup Script src/.gitignore: Ignore the tmp filesystem scripts/ld.script: Linker Script scripts/Make.defs: StarPro64 Makefile src/Makefile: StarPro64 Makefile Kconfig: StarPro64 Config configs/nsh/defconfig: Build Config for starpro64:nsh Signed-off-by: Lup Yuen Lee <luppy@appkaki.com>
1 parent 21c8ed8 commit d52e5b2

File tree

12 files changed

+718
-0
lines changed

12 files changed

+718
-0
lines changed

boards/Kconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2103,6 +2103,13 @@ config ARCH_BOARD_SG2000_MILKV_DUOS
21032103
This options selects support for NuttX on Milk-V Duo S based
21042104
on SOPHGO SG2000 SoC.
21052105

2106+
config ARCH_BOARD_EIC7700X_STARPRO64
2107+
bool "PINE64 StarPro64"
2108+
depends on ARCH_CHIP_EIC7700X
2109+
---help---
2110+
This options selects support for NuttX on PINE64 StarPro64 based
2111+
on ESWIN EIC7700X SoC.
2112+
21062113
config ARCH_BOARD_S32K118EVB
21072114
bool "NXP S32K118EVB"
21082115
depends on ARCH_CHIP_S32K118
@@ -3546,6 +3553,7 @@ config ARCH_BOARD
35463553
default "canmv230" if ARCH_BOARD_K230_CANMV
35473554
default "ox64" if ARCH_BOARD_BL808_OX64
35483555
default "milkv_duos" if ARCH_BOARD_SG2000_MILKV_DUOS
3556+
default "starpro64" if ARCH_BOARD_EIC7700X_STARPRO64
35493557
default "sabre-6quad" if ARCH_BOARD_SABRE_6QUAD
35503558
default "tc397" if ARCH_BOARD_TC397
35513559
default "qemu-armv7a" if ARCH_BOARD_QEMU_ARMV7A
@@ -4537,6 +4545,9 @@ endif
45374545
if ARCH_BOARD_SG2000_MILKV_DUOS
45384546
source "boards/risc-v/sg2000/milkv_duos/Kconfig"
45394547
endif
4548+
if ARCH_BOARD_EIC7700X_STARPRO64
4549+
source "boards/risc-v/eic7700x/starpro64/Kconfig"
4550+
endif
45404551
if ARCH_BOARD_ESP32C3_DEVKIT
45414552
source "boards/risc-v/esp32c3-legacy/esp32c3-devkit/Kconfig"
45424553
endif

boards/risc-v/eic7700x/starpro64/Kconfig

Whitespace-only changes.
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
#
2+
# This file is autogenerated: PLEASE DO NOT EDIT IT.
3+
#
4+
# You can use "make menuconfig" to make any modifications to the installed .config file.
5+
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
6+
# modifications.
7+
#
8+
# CONFIG_DISABLE_OS_API is not set
9+
# CONFIG_NSH_DISABLE_LOSMART is not set
10+
CONFIG_16550_ADDRWIDTH=0
11+
CONFIG_16550_REGINCR=4
12+
CONFIG_16550_UART0=y
13+
CONFIG_16550_UART0_BASE=0x50900000
14+
CONFIG_16550_UART0_CLOCK=198144000
15+
CONFIG_16550_UART0_IRQ=125
16+
CONFIG_16550_UART0_SERIAL_CONSOLE=y
17+
CONFIG_16550_UART=y
18+
CONFIG_16550_WAIT_LCR=y
19+
CONFIG_ARCH="risc-v"
20+
CONFIG_ARCH_ADDRENV=y
21+
CONFIG_ARCH_BOARD="starpro64"
22+
CONFIG_ARCH_BOARD_EIC7700X_STARPRO64=y
23+
CONFIG_ARCH_CHIP="eic7700x"
24+
CONFIG_ARCH_CHIP_EIC7700X=y
25+
CONFIG_ARCH_DATA_NPAGES=128
26+
CONFIG_ARCH_DATA_VBASE=0xC0100000
27+
CONFIG_ARCH_HEAP_NPAGES=128
28+
CONFIG_ARCH_HEAP_VBASE=0xC0200000
29+
CONFIG_ARCH_INTERRUPTSTACK=2048
30+
CONFIG_ARCH_KERNEL_STACKSIZE=3072
31+
CONFIG_ARCH_PGPOOL_MAPPING=y
32+
CONFIG_ARCH_PGPOOL_PBASE=0x80600000
33+
CONFIG_ARCH_PGPOOL_SIZE=4194304
34+
CONFIG_ARCH_PGPOOL_VBASE=0x80600000
35+
CONFIG_ARCH_RISCV=y
36+
CONFIG_ARCH_STACKDUMP=y
37+
CONFIG_ARCH_TEXT_NPAGES=128
38+
CONFIG_ARCH_TEXT_VBASE=0xC0000000
39+
CONFIG_ARCH_USE_MMU=y
40+
CONFIG_ARCH_USE_MPU=y
41+
CONFIG_ARCH_USE_S_MODE=y
42+
CONFIG_BOARDCTL_ROMDISK=y
43+
CONFIG_BOARD_LATE_INITIALIZE=y
44+
CONFIG_BOARD_LOOPSPERMSEC=1120
45+
CONFIG_BUILD_KERNEL=y
46+
CONFIG_DEBUG_ASSERTIONS=y
47+
CONFIG_DEBUG_ASSERTIONS_EXPRESSION=y
48+
CONFIG_DEBUG_FEATURES=y
49+
CONFIG_DEBUG_FULLOPT=y
50+
CONFIG_DEBUG_SYMBOLS=y
51+
CONFIG_ELF=y
52+
CONFIG_EXAMPLES_HELLO=m
53+
CONFIG_FS_PROCFS=y
54+
CONFIG_FS_ROMFS=y
55+
CONFIG_IDLETHREAD_STACKSIZE=3072
56+
CONFIG_INIT_FILEPATH="/system/bin/init"
57+
CONFIG_INIT_MOUNT=y
58+
CONFIG_INIT_MOUNT_FLAGS=0x1
59+
CONFIG_INIT_MOUNT_TARGET="/system/bin"
60+
CONFIG_INIT_STACKSIZE=3072
61+
CONFIG_INTELHEX_BINARY=y
62+
CONFIG_LIBC_ENVPATH=y
63+
CONFIG_LIBC_EXECFUNCS=y
64+
CONFIG_LIBC_MEMSET_64BIT=y
65+
CONFIG_LIBC_MEMSET_OPTSPEED=y
66+
CONFIG_LIBC_PERROR_STDOUT=y
67+
CONFIG_LIBC_STRERROR=y
68+
CONFIG_MM_PGALLOC=y
69+
CONFIG_NFILE_DESCRIPTORS_PER_BLOCK=6
70+
CONFIG_NSH_ARCHINIT=y
71+
CONFIG_NSH_FILEIOSIZE=512
72+
CONFIG_NSH_FILE_APPS=y
73+
CONFIG_NSH_READLINE=y
74+
CONFIG_PATH_INITIAL="/system/bin"
75+
CONFIG_RAM_SIZE=1048576
76+
CONFIG_RAM_START=0x80200000
77+
CONFIG_RAW_BINARY=y
78+
CONFIG_READLINE_CMD_HISTORY=y
79+
CONFIG_RR_INTERVAL=200
80+
CONFIG_SCHED_HAVE_PARENT=y
81+
CONFIG_SCHED_LPWORK=y
82+
CONFIG_SCHED_WAITPID=y
83+
CONFIG_SERIAL_UART_ARCH_MMIO=y
84+
CONFIG_STACK_COLORATION=y
85+
CONFIG_START_MONTH=12
86+
CONFIG_START_YEAR=2021
87+
CONFIG_SYMTAB_ORDEREDBYNAME=y
88+
CONFIG_SYSTEM_NSH=y
89+
CONFIG_SYSTEM_NSH_PROGNAME="init"
90+
CONFIG_TESTING_GETPRIME=y
91+
CONFIG_TESTING_OSTEST=y
92+
CONFIG_USEC_PER_TICK=1000
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
/****************************************************************************
2+
* boards/risc-v/eic7700x/starpro64/include/board.h
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*
6+
* Licensed to the Apache Software Foundation (ASF) under one or more
7+
* contributor license agreements. See the NOTICE file distributed with
8+
* this work for additional information regarding copyright ownership. The
9+
* ASF licenses this file to you under the Apache License, Version 2.0 (the
10+
* "License"); you may not use this file except in compliance with the
11+
* License. You may obtain a copy of the License at
12+
*
13+
* http://www.apache.org/licenses/LICENSE-2.0
14+
*
15+
* Unless required by applicable law or agreed to in writing, software
16+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
17+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
18+
* License for the specific language governing permissions and limitations
19+
* under the License.
20+
*
21+
****************************************************************************/
22+
23+
#ifndef __BOARDS_RISCV_EIC7700X_STARPRO64_INCLUDE_BOARD_H
24+
#define __BOARDS_RISCV_EIC7700X_STARPRO64_INCLUDE_BOARD_H
25+
26+
/****************************************************************************
27+
* Included Files
28+
****************************************************************************/
29+
30+
#include <nuttx/config.h>
31+
32+
/****************************************************************************
33+
* Pre-processor Definitions
34+
****************************************************************************/
35+
36+
#define LED_STARTED 0 /* N/A */
37+
#define LED_HEAPALLOCATE 1 /* N/A */
38+
#define LED_IRQSENABLED 2 /* N/A */
39+
#define LED_STACKCREATED 3 /* N/A */
40+
#define LED_INIRQ 4 /* N/A */
41+
#define LED_SIGNAL 5 /* N/A */
42+
#define LED_ASSERTION 6 /* N/A */
43+
#define LED_PANIC 7 /* N/A */
44+
#define LED_CPU 8 /* LED */
45+
46+
/****************************************************************************
47+
* Public Types
48+
****************************************************************************/
49+
50+
#ifndef __ASSEMBLY__
51+
52+
/****************************************************************************
53+
* Public Data
54+
****************************************************************************/
55+
56+
#undef EXTERN
57+
#if defined(__cplusplus)
58+
#define EXTERN extern "C"
59+
extern "C"
60+
{
61+
#else
62+
#define EXTERN extern
63+
#endif
64+
65+
/****************************************************************************
66+
* Public Function Prototypes
67+
****************************************************************************/
68+
69+
/****************************************************************************
70+
* Name: eic7700x_boardinitialize
71+
****************************************************************************/
72+
73+
void eic7700x_boardinitialize(void);
74+
75+
#undef EXTERN
76+
#if defined(__cplusplus)
77+
}
78+
#endif
79+
#endif /* __ASSEMBLY__ */
80+
#endif /* __BOARDS_RISCV_EIC7700X_STARPRO64_INCLUDE_BOARD_H */
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
/****************************************************************************
2+
* boards/risc-v/eic7700x/starpro64/include/board_memorymap.h
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*
6+
* Licensed to the Apache Software Foundation (ASF) under one or more
7+
* contributor license agreements. See the NOTICE file distributed with
8+
* this work for additional information regarding copyright ownership. The
9+
* ASF licenses this file to you under the Apache License, Version 2.0 (the
10+
* "License"); you may not use this file except in compliance with the
11+
* License. You may obtain a copy of the License at
12+
*
13+
* http://www.apache.org/licenses/LICENSE-2.0
14+
*
15+
* Unless required by applicable law or agreed to in writing, software
16+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
17+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
18+
* License for the specific language governing permissions and limitations
19+
* under the License.
20+
*
21+
****************************************************************************/
22+
23+
#ifndef __BOARDS_RISCV_EIC7700X_STARPRO64_INCLUDE_BOARD_MEMORYMAP_H
24+
#define __BOARDS_RISCV_EIC7700X_STARPRO64_INCLUDE_BOARD_MEMORYMAP_H
25+
26+
/****************************************************************************
27+
* Included Files
28+
****************************************************************************/
29+
30+
#include <stdint.h>
31+
32+
/****************************************************************************
33+
* Pre-processor Definitions
34+
****************************************************************************/
35+
36+
/* Kernel code memory (RX) */
37+
38+
#define KFLASH_START (uintptr_t)__kflash_start
39+
#define KFLASH_SIZE (uintptr_t)__kflash_size
40+
#define KSRAM_START (uintptr_t)__ksram_start
41+
#define KSRAM_SIZE (uintptr_t)__ksram_size
42+
#define KSRAM_END (uintptr_t)__ksram_end
43+
44+
/* Kernel RAM (RW) */
45+
46+
#define PGPOOL_START (uintptr_t)__pgheap_start
47+
#define PGPOOL_SIZE (uintptr_t)__pgheap_size
48+
49+
/* Page pool (RWX) */
50+
51+
#define PGPOOL_START (uintptr_t)__pgheap_start
52+
#define PGPOOL_SIZE (uintptr_t)__pgheap_size
53+
#define PGPOOL_END (PGPOOL_START + PGPOOL_SIZE)
54+
55+
/* Ramdisk (RW) */
56+
57+
#define RAMDISK_START (uintptr_t)__ramdisk_start
58+
#define RAMDISK_SIZE (uintptr_t)__ramdisk_size
59+
60+
/****************************************************************************
61+
* Public Data
62+
****************************************************************************/
63+
64+
/* Kernel code memory (RX) */
65+
66+
extern uint8_t __kflash_start[];
67+
extern uint8_t __kflash_size[];
68+
69+
/* Kernel RAM (RW) */
70+
71+
extern uint8_t __ksram_start[];
72+
extern uint8_t __ksram_size[];
73+
extern uint8_t __ksram_end[];
74+
75+
/* Page pool (RWX) */
76+
77+
extern uint8_t __pgheap_start[];
78+
extern uint8_t __pgheap_size[];
79+
80+
/* Ramdisk (RW) */
81+
82+
extern uint8_t __ramdisk_start[];
83+
extern uint8_t __ramdisk_size[];
84+
85+
#endif /* __BOARDS_RISCV_EIC7700X_STARPRO64_INCLUDE_BOARD_MEMORYMAP_H */
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
############################################################################
2+
# boards/risc-v/eic7700x/starpro64/scripts/Make.defs
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
# Licensed to the Apache Software Foundation (ASF) under one or more
7+
# contributor license agreements. See the NOTICE file distributed with
8+
# this work for additional information regarding copyright ownership. The
9+
# ASF licenses this file to you under the Apache License, Version 2.0 (the
10+
# "License"); you may not use this file except in compliance with the
11+
# License. You may obtain a copy of the License at
12+
#
13+
# http://www.apache.org/licenses/LICENSE-2.0
14+
#
15+
# Unless required by applicable law or agreed to in writing, software
16+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
17+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
18+
# License for the specific language governing permissions and limitations
19+
# under the License.
20+
#
21+
############################################################################
22+
23+
include $(TOPDIR)/.config
24+
include $(TOPDIR)/tools/Config.mk
25+
include $(TOPDIR)/arch/risc-v/src/common/Toolchain.defs
26+
27+
LDSCRIPT = ld.script
28+
ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)$(LDSCRIPT)
29+
ARCHPICFLAGS = -fpic -msingle-pic-base
30+
31+
CFLAGS := $(ARCHCFLAGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) -pipe
32+
CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS)
33+
CXXFLAGS := $(ARCHCXXFLAGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) -pipe
34+
CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS)
35+
CPPFLAGS := $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS)
36+
AFLAGS += $(CFLAGS) -D__ASSEMBLY__

0 commit comments

Comments
 (0)