Skip to content

Commit

Permalink
Copy and rename Ox64 to DuoS
Browse files Browse the repository at this point in the history
  • Loading branch information
lupyuen committed Jun 16, 2024
1 parent f70c3e7 commit 8225b76
Show file tree
Hide file tree
Showing 11 changed files with 680 additions and 0 deletions.
Empty file.
86 changes: 86 additions & 0 deletions boards/risc-v/sg2000/duos/configs/nsh/defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
#
# 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_DISABLE_OS_API is not set
# CONFIG_NSH_DISABLE_LOSMART is not set
# CONFIG_STANDARD_SERIAL is not set
CONFIG_ARCH="risc-v"
CONFIG_ARCH_ADDRENV=y
CONFIG_ARCH_BOARD="duos"
CONFIG_ARCH_BOARD_SG2000_DUOS=y
CONFIG_ARCH_CHIP="sg2000"
CONFIG_ARCH_CHIP_SG2000=y
CONFIG_ARCH_DATA_NPAGES=128
CONFIG_ARCH_DATA_VBASE=0x80100000
CONFIG_ARCH_HEAP_NPAGES=128
CONFIG_ARCH_HEAP_VBASE=0x80200000
CONFIG_ARCH_INTERRUPTSTACK=2048
CONFIG_ARCH_KERNEL_STACKSIZE=3072
CONFIG_ARCH_PGPOOL_MAPPING=y
CONFIG_ARCH_PGPOOL_PBASE=0x50600000
CONFIG_ARCH_PGPOOL_SIZE=4194304
CONFIG_ARCH_PGPOOL_VBASE=0x50600000
CONFIG_ARCH_RISCV=y
CONFIG_ARCH_STACKDUMP=y
CONFIG_ARCH_TEXT_NPAGES=128
CONFIG_ARCH_TEXT_VBASE=0x80000000
CONFIG_ARCH_USE_MMU=y
CONFIG_ARCH_USE_MPU=y
CONFIG_ARCH_USE_S_MODE=y
CONFIG_SG2000_UART3=y
CONFIG_BOARDCTL_ROMDISK=y
CONFIG_BOARD_LATE_INITIALIZE=y
CONFIG_BOARD_LOOPSPERMSEC=1120
CONFIG_BUILD_KERNEL=y
CONFIG_DEBUG_ASSERTIONS=y
CONFIG_DEBUG_ASSERTIONS_EXPRESSION=y
CONFIG_DEBUG_FEATURES=y
CONFIG_DEBUG_FULLOPT=y
CONFIG_DEBUG_SYMBOLS=y
CONFIG_DEV_ZERO=y
CONFIG_ELF=y
CONFIG_EXAMPLES_HELLO=m
CONFIG_FS_PROCFS=y
CONFIG_FS_ROMFS=y
CONFIG_IDLETHREAD_STACKSIZE=3072
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_LIBC_ENVPATH=y
CONFIG_LIBC_EXECFUNCS=y
CONFIG_LIBC_PERROR_STDOUT=y
CONFIG_LIBC_STRERROR=y
CONFIG_MEMSET_64BIT=y
CONFIG_MEMSET_OPTSPEED=y
CONFIG_MM_PGALLOC=y
CONFIG_NFILE_DESCRIPTORS_PER_BLOCK=6
CONFIG_NSH_ARCHINIT=y
CONFIG_NSH_FILEIOSIZE=512
CONFIG_NSH_FILE_APPS=y
CONFIG_NSH_READLINE=y
CONFIG_PATH_INITIAL="/system/bin"
CONFIG_RAM_SIZE=1048576
CONFIG_RAM_START=0x50200000
CONFIG_READLINE_CMD_HISTORY=y
CONFIG_RR_INTERVAL=200
CONFIG_SCHED_HAVE_PARENT=y
CONFIG_SCHED_LPWORK=y
CONFIG_SCHED_WAITPID=y
CONFIG_STACK_COLORATION=y
CONFIG_START_MONTH=12
CONFIG_START_YEAR=2021
CONFIG_SYMTAB_ORDEREDBYNAME=y
CONFIG_SYSTEM_NSH=y
CONFIG_SYSTEM_NSH_PROGNAME="init"
CONFIG_TESTING_GETPRIME=y
CONFIG_TESTING_OSTEST=y
CONFIG_UART3_BAUD=2000000
CONFIG_UART3_SERIAL_CONSOLE=y
CONFIG_USEC_PER_TICK=1000
78 changes: 78 additions & 0 deletions boards/risc-v/sg2000/duos/include/board.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
/****************************************************************************
* boards/risc-v/sg2000/duos/include/board.h
*
* 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_RISCV_SG2000_DUOS_INCLUDE_BOARD_H
#define __BOARDS_RISCV_SG2000_DUOS_INCLUDE_BOARD_H

/****************************************************************************
* Included Files
****************************************************************************/

#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: sg2000_boardinitialize
****************************************************************************/

void sg2000_boardinitialize(void);

#undef EXTERN
#if defined(__cplusplus)
}
#endif
#endif /* __ASSEMBLY__ */
#endif /* __BOARDS_RISCV_SG2000_DUOS_INCLUDE_BOARD_H */
88 changes: 88 additions & 0 deletions boards/risc-v/sg2000/duos/include/board_memorymap.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
/****************************************************************************
* boards/risc-v/sg2000/duos/include/board_memorymap.h
*
* 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_RISCV_SG2000_DUOS_INCLUDE_BOARD_MEMORYMAP_H
#define __BOARDS_RISCV_SG2000_DUOS_INCLUDE_BOARD_MEMORYMAP_H

/****************************************************************************
* Included Files
****************************************************************************/

#include <stdint.h>

/****************************************************************************
* Pre-processor Definitions
****************************************************************************/

/* DDR start address */

#define SG2000_DDR_BASE (0x50200000)
#define SG2000_DDR_SIZE (0x03e00000)

/* Kernel code memory (RX) */

#define KFLASH_START (uintptr_t)__kflash_start
#define KFLASH_SIZE (uintptr_t)__kflash_size
#define KSRAM_START (uintptr_t)__ksram_start
#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
#define PGPOOL_SIZE (uintptr_t)__pgheap_size
#define PGPOOL_END (PGPOOL_START + PGPOOL_SIZE)

/* Ramdisk (RW) */

#define RAMDISK_START (uintptr_t)__ramdisk_start
#define RAMDISK_SIZE (uintptr_t)__ramdisk_size

/****************************************************************************
* Public Data
****************************************************************************/

/* Kernel code memory (RX) */

extern uint8_t __kflash_start[];
extern uint8_t __kflash_size[];

/* Kernel RAM (RW) */

extern uint8_t __ksram_start[];
extern uint8_t __ksram_size[];
extern uint8_t __ksram_end[];

/* Page pool (RWX) */

extern uint8_t __pgheap_start[];
extern uint8_t __pgheap_size[];

/* Ramdisk (RW) */

extern uint8_t __ramdisk_start[];
extern uint8_t __ramdisk_size[];

#endif /* __BOARDS_RISCV_SG2000_DUOS_INCLUDE_BOARD_MEMORYMAP_H */
43 changes: 43 additions & 0 deletions boards/risc-v/sg2000/duos/scripts/Make.defs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
############################################################################
# boards/risc-v/sg2000/duos/scripts/Make.defs
#
# 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.
#
############################################################################

include $(TOPDIR)/.config
include $(TOPDIR)/tools/Config.mk
include $(TOPDIR)/arch/risc-v/src/common/Toolchain.defs

LDSCRIPT = ld.script
ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)$(LDSCRIPT)
ARCHPICFLAGS = -fpic -msingle-pic-base

CFLAGS := $(ARCHCFLAGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) -pipe
CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS)
CXXFLAGS := $(ARCHCXXFLAGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) -pipe
CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS)
CPPFLAGS := $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS)
AFLAGS += $(CFLAGS) -D__ASSEMBLY__

# ELF module definitions

CELFFLAGS = $(CFLAGS)
CXXELFFLAGS = $(CXXFLAGS)

LDELFFLAGS = --oformat elf64-littleriscv
LDELFFLAGS += -r -e main
LDELFFLAGS += -T $(call CONVERT_PATH,$(TOPDIR)/binfmt/libelf/gnu-elf.ld)
Loading

0 comments on commit 8225b76

Please sign in to comment.