Allow to specify 256k platforms

This commit is contained in:
Philippe Teuwen 2020-11-05 02:32:41 +01:00
parent d500d1d6e9
commit c549478ca5
2 changed files with 14 additions and 0 deletions

View file

@ -133,6 +133,10 @@ ifeq (,$(PLATFORM_DEFS_INFO_STANDALONE))
PLATFORM_DEFS_INFO_STANDALONE = No standalone mode selected
endif
ifeq ($(PLATFORM_SIZE),)
PLATFORM_SIZE=512
endif
PLATFORM_CHANGED=false
ifneq ($(PLATFORM), $(CACHED_PLATFORM))
PLATFORM_CHANGED=true
@ -145,6 +149,7 @@ endif
export PLATFORM
export PLATFORM_EXTRAS
export PLATFORM_EXTRAS_INFO
export PLATFORM_SIZE
export PLTNAME
export PLATFORM_DEFS
export PLATFORM_DEFS_INFO
@ -154,6 +159,7 @@ export PLATFORM_CHANGED
$(info ===================================================================)
$(info Platform name: $(PLTNAME))
$(info PLATFORM: $(PLATFORM))
$(info PLATFORM_SIZE: $(PLATFORM_SIZE))
$(info Platform extras: $(PLATFORM_EXTRAS_INFO))
$(info Included options: $(PLATFORM_DEFS_INFO))
$(info Standalone mode: $(PLATFORM_DEFS_INFO_STANDALONE))

View file

@ -6,10 +6,18 @@ ifneq (,$(FWTAG))
else
INSTALLFWTAG = $(notdir $(INSTALLFW))
endif
FWMAXSIZE = $(shell echo $$(($(PLATFORM_SIZE)*1024)))
BINS = bootrom.bin fullimage.bin $(INSTALLFW)
all: $(BINS)
@FWSIZE=$$(stat -c "%s" $(INSTALLFW));\
if [ $$FWSIZE -gt $(FWMAXSIZE) ]; then \
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"; \
echo "ERROR: Firmware image too large for your platform! $$FWSIZE > $(FWMAXSIZE)"; \
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"; \
exit 1; \
fi
bootrom.bin: ../bootrom/obj/bootrom.elf
$(info [=] GEN $@)