Skip to content

Commit 3a899c2

Browse files
TonyHan11ehristev
authored andcommitted
config: add configuration for loading images with MMU/Cache enabled
Enable this feature by config MMU and CACHES to y (default n) Signed-off-by: Tony Han <[email protected]>
1 parent a1918a1 commit 3a899c2

File tree

4 files changed

+24
-0
lines changed

4 files changed

+24
-0
lines changed

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,10 @@ TOP_OF_MEMORY:=$(strip $(subst ",,$(CONFIG_TOP_OF_MEMORY)))
178178
# CRYSTAL is UNUSED
179179
CRYSTAL:=$(strip $(subst ",,$(CONFIG_CRYSTAL)))
180180

181+
ifeq ($(CONFIG_MMU), y)
182+
MMU_TABLE_BASE_ADDR := $(strip $(subst ",,$(CONFIG_MMU_TABLE_BASE_ADDR)))
183+
endif
184+
181185
# driver definitions
182186
SPI_CLK:=$(strip $(subst ",,$(CONFIG_SPI_CLK)))
183187
SPI_BOOT:=$(strip $(subst ",,$(CONFIG_SPI_BOOT)))

driver/Config.in.driver

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,4 +123,20 @@ config CPU_HAS_DWDT
123123
default n
124124

125125
source "driver/Config.in.memory"
126+
127+
config MMU
128+
bool "Load software with MMU enabled"
129+
depends on LOAD_SW && (SAM9X60 || SAMA5D2 || SAMA5D3X || SAMA5D4)
130+
default n
131+
132+
config MMU_TABLE_BASE_ADDR
133+
string "Base address (16KB aligned) for MMU Translation Table, occupies 16K bytes memory"
134+
depends on MMU
135+
default "0x20000000"
136+
137+
config CACHES
138+
bool "Load software with caches enabled"
139+
depends on MMU
140+
default n
141+
126142
source "driver/Config.in.nvm"

driver/driver.mk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,6 @@ COBJS-$(CONFIG_REDIRECT_ALL_INTS_AIC) += $(DRIVERS_SRC)/at91_aicredir.o
108108
COBJS-$(CONFIG_FLEXCOM) += $(DRIVERS_SRC)/at91_flexcom.o
109109

110110
COBJS-$(CONFIG_SFRBU) += $(DRIVERS_SRC)/sfrbu.o
111+
112+
COBJS-$(CONFIG_CACHES) += $(DRIVERS_SRC)/l1cache.o
113+
COBJS-$(CONFIG_MMU) += $(DRIVERS_SRC)/mmu.o

toplevel_cpp.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
CPPFLAGS += \
66
-DIMG_ADDRESS=$(IMG_ADDRESS) \
77
-DIMG_SIZE=$(IMG_SIZE) \
8+
-DMMU_TABLE_BASE_ADDR=$(MMU_TABLE_BASE_ADDR) \
89
-DJUMP_ADDR=$(JUMP_ADDR) \
910
-DOF_OFFSET=$(OF_OFFSET) \
1011
-DOF_ADDRESS=$(OF_ADDRESS) \

0 commit comments

Comments
 (0)