From 9cddcc7fdc9389208d393008ff60c0c9a7d3b341 Mon Sep 17 00:00:00 2001 From: LinJiawei Date: Tue, 12 Jan 2021 22:12:10 +0800 Subject: [PATCH] reduce mem size & opt config 1.reduce mem size in stand alone mode 2.use make xxx XIANGSHAN=1 to align mmio space to XiangShan --- Makefile | 4 ++++ include/device/map.h | 2 -- include/memory/paddr.h | 6 +++++- src/device/device.c | 2 -- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index bb7a6e39..24228420 100644 --- a/Makefile +++ b/Makefile @@ -60,6 +60,10 @@ include Makefile.git .DEFAULT_GOAL = app +ifdef XIANGSHAN + CFLAGS += -DXIANGSHAN=1 +endif + # Compilation flags CC = gcc LD = gcc diff --git a/include/device/map.h b/include/device/map.h index 8fd1527d..f9055a94 100644 --- a/include/device/map.h +++ b/include/device/map.h @@ -5,8 +5,6 @@ typedef void(*io_callback_t)(uint32_t, int, bool); -#define XIANGSHAN - #ifdef XIANGSHAN // SD diff --git a/include/memory/paddr.h b/include/memory/paddr.h index 63f17fea..b27bd906 100644 --- a/include/memory/paddr.h +++ b/include/memory/paddr.h @@ -3,7 +3,11 @@ #include -#define PMEM_SIZE (8 * 1024 * 1024 * 1024UL) +#ifdef _SHARE + #define PMEM_SIZE (8 * 1024 * 1024 * 1024UL) +#else + #define PMEM_SIZE (256 * 1024 * 1024UL) +#endif void init_mem(); diff --git a/src/device/device.c b/src/device/device.c index 1427aa98..653eb339 100644 --- a/src/device/device.c +++ b/src/device/device.c @@ -5,8 +5,6 @@ #include #include -#define XIANGSHAN - void init_alarm(); void init_serial(); void init_uartlite(); -- GitLab