11# Makefile Variable SOC
22# # SOC Supported:
3- # # demosoc: Nuclei Demo SoC used for evaluation
43# # evalsoc: Nuclei Evaluation SoC
54SOC ?= evalsoc
65
@@ -69,7 +68,7 @@ RVPATH := $(RISCV)/bin:$(PATH)
6968platform_dts := $(confdir ) /nuclei_$(ISA ) .dts
7069platform_preproc_dts := $(wrkdir ) /nuclei_$(ISA ) .dts.preprocessed
7170platform_dtb := $(wrkdir ) /nuclei_$(ISA ) .dtb
72- platform_sim_dts := $(confdir ) /nuclei_$(ISA ) _sim .dts
71+ platform_sim_dts := $(confdir ) /nuclei_$(ISA ) .dts
7372platform_preproc_sim_dts := $(wrkdir ) /nuclei_$(ISA ) _sim.dts.preprocessed
7473platform_sim_dtb := $(wrkdir ) /nuclei_$(ISA ) _sim.dtb
7574
@@ -224,18 +223,14 @@ help:
224223 @echo " - cleanopensbi : clean opensbi workspace"
225224 @echo " - backup : backup generated prebuilt images into $( backupdir) folder, you need to input backup message when this target is triggered"
226225 @echo " - snapshot : snapshot linux sdk source code into $( snapshotdir) folder, this snapshot zip files will not contain any vcs control files"
227- ifeq ($(SOC ) ,demosoc)
228226 @echo " - preboot : If you run sim target before, and want to change to bootimages target, run this to prepare environment"
229- @echo "- presim : If you run bootimages target before, and want to change to sim target, run this to prepare environment"
230- @echo "- sim : run opensbi + linux payload in simulation using xl_spike"
231- endif
227+ @echo " - presim : deprecated, If you run bootimages target before, and want to change to sim target, run this to prepare environment"
228+ @echo " - sim : deprecated, run opensbi + linux payload in simulation using xl_spike"
232229 @echo " "
233230 @echo " Main targets used frequently depending on your user case"
234231 @echo " If you want to run linux on development board, please run preboot, freeloader, bootimages targets"
235- ifeq ($(SOC ) ,demosoc)
236- @echo "If you want to run linux in simulation, please run presim, sim targets"
232+ @echo " Deprecated: If you want to run linux in simulation using xlspike, please run presim, sim targets"
237233 @echo " Deprecated: The xl-spike support will be deprecated in future release"
238- endif
239234
240235
241236$(target_gcc ) : buildroot_initramfs_sysroot
@@ -308,7 +303,6 @@ $(vmlinux_stripped): $(vmlinux)
308303$(vmlinux_bin ) : $(vmlinux )
309304 PATH=$(RVPATH ) $(target ) -objcopy -O binary $< $@
310305
311- ifeq ($(SOC ) ,demosoc)
312306$(vmlinux_sim ) : $(linux_wrkdir ) /.config
313307 $(MAKE ) -C $(linux_srcdir ) O=$(linux_wrkdir ) \
314308 CONFIG_INITRAMFS_SOURCE=" $( confdir) /initramfs.txt $( buildroot_initramfs_sysroot) " \
@@ -322,7 +316,6 @@ $(vmlinux_sim): $(linux_wrkdir)/.config
322316
323317$(vmlinux_sim_bin ) : $(vmlinux_sim )
324318 PATH=$(RVPATH ) $(target ) -objcopy -O binary $< $@
325- endif
326319
327320.PHONY : linux-menuconfig gen-dts gen-simdts
328321linux-menuconfig : $(linux_wrkdir ) /.config
@@ -340,7 +333,7 @@ $(platform_preproc_sim_dts): gen-simdts
340333 echo " Platform sim preprocessed dts located in $( platform_preproc_sim_dts) , processed with defines $( DTS_DEFINES) "
341334
342335gen-simdts : $(platform_sim_dts ) $(target_gcc )
343- $(target_gcc ) -E -nostdinc -undef -x assembler-with-cpp $(DTS_DEFINES ) $(platform_sim_dts ) -o $(platform_preproc_sim_dts )
336+ $(target_gcc ) -E -nostdinc -undef -x assembler-with-cpp $(DTS_DEFINES ) -DSIMULATION=2 $(platform_sim_dts ) -o $(platform_preproc_sim_dts )
344337
345338$(platform_dtb ) : $(platform_preproc_dts ) $(target_gcc )
346339 dtc -O dtb -o $(platform_dtb ) $(platform_preproc_dts )
@@ -358,7 +351,7 @@ opensbi: $(target_gcc) $(opensbi_plat_deps)
358351 $(MAKE ) -C $(opensbi_srcdir ) O=$(opensbi_wrkdir ) CROSS_COMPILE=$(CROSS_COMPILE ) \
359352 PLATFORM_RISCV_ABI=$(ABI ) PLATFORM_RISCV_ISA=$(ISA ) PLATFORM=nuclei/$(SOC )
360353
361- ifeq ( $( SOC ) ,demosoc)
354+ # internal usage for xlspike, deprecated
362355$(opensbi_payload ) : $(opensbi_srcdir ) $(vmlinux_sim_bin ) $(platform_sim_dtb ) $(opensbi_plat_deps )
363356 rm -rf $(opensbi_wrkdir )
364357 mkdir -p $(opensbi_wrkdir )
@@ -367,7 +360,6 @@ $(opensbi_payload): $(opensbi_srcdir) $(vmlinux_sim_bin) $(platform_sim_dtb) $(o
367360 $(MAKE ) -C $(opensbi_srcdir ) O=$(opensbi_wrkdir ) CROSS_COMPILE=$(CROSS_COMPILE ) \
368361 PLATFORM_RISCV_ABI=$(ABI ) PLATFORM_RISCV_ISA=$(ISA ) PLATFORM=nuclei/$(SOC ) \
369362 FW_PAYLOAD_PATH=$(vmlinux_sim_bin ) FW_FDT_PATH=$(platform_sim_dtb )
370- endif
371363
372364$(buildroot_initramfs_sysroot ) : $(buildroot_initramfs_sysroot_stamp )
373365
@@ -542,16 +534,15 @@ preboot: prepare
542534prepare :
543535 rm -rf $(vmlinux_bin ) $(vmlinux ) $(linux_image ) $(vmlinux_sim_bin ) $(vmlinux_sim )
544536
545- ifeq ($(SOC ) ,demosoc)
546537.PHONY : sim opensbi_sim presim
547538
548539# If you change your make target from bootimages to sim, you need to run presim first
549540presim : prepare
550541opensbi_sim : $(opensbi_payload )
551542
543+ # Deprecated, internal usage for xlspike
552544sim : $(opensbi_payload )
553545 $(xlspike ) --isa=$(ISA ) $(opensbi_payload )
554- endif
555546
556547.PHONY : gendisk run_qemu
557548
@@ -564,8 +555,6 @@ $(qemu_disk): $(boot_zip)
564555 cd $(boot_wrkdir ) && mformat -F -h 64 -s 32 -t $$(($(DISK_SIZE ) -1 ) ) :: -i $(qemu_disk ) || rm -f $(qemu_disk )
565556 cd $(boot_wrkdir ) && mcopy -i $(qemu_disk ) boot.scr kernel.dtb uImage.lz4 uInitrd.lz4 :: || rm -f $(qemu_disk )
566557
567- # workaround for demosoc: need to change TIMERCLK_FREQ for conf/demosoc/*.dts to 10000000
568- # limited feature for simulation demosoc is supported, don't expect full feature of demosoc
569558run_qemu : $(qemu_disk ) $(freeloader_elf )
570559 @echo " Run on qemu for simulation"
571560 $(qemu ) $(QEMU_MACHINE_OPTS ) -cpu nuclei-$(CORE ) ,ext=$(ARCH_EXT ) -bios $(freeloader_elf ) -nographic -drive file=$(qemu_disk ) ,if=sd,format=raw
0 commit comments