Skip to content

Commit

Permalink
SoC/evalsoc: enable include autogen_nuclei_cpu.h which is auto genera…
Browse files Browse the repository at this point in the history
…ted by cpuconfig tool

Signed-off-by: Huaqi Fang <[email protected]>
  • Loading branch information
fanghuaqi committed Jun 5, 2024
1 parent d763cdf commit 0e2b5b3
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 6 deletions.
35 changes: 29 additions & 6 deletions SoC/evalsoc/Common/Include/evalsoc.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@
extern "C" {
#endif

// If you have auto generated cpu configuration files
#ifdef HAS_AUTOGEN_CPUCFG
#include "autogen_nuclei_cpu.h"
#endif

/** @addtogroup Nuclei
* @{
*/
Expand Down Expand Up @@ -474,12 +479,30 @@ typedef struct {
/** @addtogroup Device_Peripheral_peripheralAddr
* @{
*/
/* Peripheral and SRAM base address */
#define QSPI_FLASH_BASE (0x20000000UL) /*!< (FLASH ) Base Address */
#define ONCHIP_ROM_BASE (0x00001000UL) /*!< (ROM ) Base Address */
#define ONCHIP_ILM_BASE (0x80000000UL) /*!< (ILM ) Base Address */
#define ONCHIP_DLM_BASE (0x90000000UL) /*!< (DLM ) Base Address */
#define EVALSOC_PERIPH_BASE (0x10000000UL) /*!< (Peripheral) Base Address */
/* ILM/DLM/FLASHXIP and Peripheral base address */
#ifndef EVALSOC_FLASH_XIP_BASE
#define QSPI_FLASH_BASE (0x20000000UL) /*!< (FLASH ) Base Address */
#else
#define QSPI_FLASH_BASE (EVALSOC_FLASH_XIP_BASE) /*!< (FLASH ) Base Address */
#endif

#ifndef CFG_ILM_BASE_ADDR
#define ONCHIP_ILM_BASE (0x80000000UL) /*!< (ILM ) Base Address */
#else
#define ONCHIP_ILM_BASE (CFG_ILM_BASE_ADDR) /*!< (ILM ) Base Address */
#endif

#ifndef CFG_DLM_BASE_ADDR
#define ONCHIP_DLM_BASE (0x90000000UL) /*!< (DLM ) Base Address */
#else
#define ONCHIP_DLM_BASE (CFG_DLM_BASE_ADDR) /*!< (DLM ) Base Address */
#endif

#ifndef EVALSOC_PERIPS_BASE
#define EVALSOC_PERIPH_BASE (0x10000000UL) /*!< (Peripheral) Base Address */
#else
#define EVALSOC_PERIPH_BASE (EVALSOC_PERIPS_BASE) /*!< (Peripheral) Base Address */
#endif

/* Peripheral memory map */
#define UART0_BASE (EVALSOC_PERIPH_BASE + 0x13000) /*!< (UART0) Base Address */
Expand Down
5 changes: 5 additions & 0 deletions SoC/evalsoc/build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ ifneq ($(SPLITMODE),)
OPENOCD_CMD_ARGS += set SPLITMODE $(SPLITMODE);
endif

# If using generated cpu configs
ifeq ($(CPU_CONFIG_K),1)
COMMON_FLAGS += -DHAS_AUTOGEN_CPUCFG
endif

# If HARTID_OFS is not empty
ifneq ($(HARTID_OFS),)
COMMON_FLAGS += -D__HARTID_OFFSET=$(HARTID_OFS)
Expand Down

0 comments on commit 0e2b5b3

Please sign in to comment.