linuxboot/boards/winterfell/Makefile.board

63 lines
1.6 KiB
Makefile

#
# Specific targets and things for the OCP Winterfell board
#
# This is responsible for extracting the DXE section from the ROM,
# extracting each of the images from it, and setting the sizes for
# the different firmware images.
#
# Replace just the dxe volume:
# ( echo u860000 6a0000 ; pv build/winterfell/dxe.vol ) > /dev/ttyACM0
# 6.9 MB DXE+Linux ROM, uncompressed
dxe-size := 0x6A0000
#dxe-compress := 0xF00000
dxe-path := $(BUILD)/rom/0x00860000
dxe-files := $(shell awk \
'/^[0-9A-Fa-f]/ {print "$(dxe-path)/"$$1".ffs"}' \
boards/$(BOARD)/image-files.txt \
)
# The Intel firmware has lots of small pieces.
# We replace the DXE recovery image and one of the other
# images with the LinuxBoot one. Potentially we
# can clean up more space.
FVS := \
$(BUILD)/rom/0x00000000.ifd \
$(BUILD)/rom/0x00010000.bin \
$(BUILD)/nvram1.vol \
$(BUILD)/nvram2.vol \
$(BUILD)/rom/0x00840000.bin \
$(BUILD)/dxe.vol \
$(BUILD)/rom/0x00f00000.fv \
# Replace the DxeCore and SmmCore with our own
# and add in the Linux kernel / initrd
$(BUILD)/dxe.vol: \
$(dxe-files) \
$(BUILD)/Linux.ffs \
$(BUILD)/Initrd.ffs \
#
# Compact the NVRAM region. this isn't required, but makes for cleaner images.
#
nvram1-size := 0x20000
nvram2-size := 0x20000
$(BUILD)/nvram1.vol: $(BUILD)/nvram1.ffs
$(BUILD)/nvram2.vol: $(BUILD)/nvram2.ffs
NVRAM_GUID = cef5b9a3-476d-497f-9fdc-e98143e0422c
NVRAM1_FFS = $(BUILD)/rom/0x00800000/$(NVRAM_GUID).ffs
NVRAM2_FFS = $(BUILD)/rom/0x00820000/$(NVRAM_GUID).ffs
$(NVRAM1_FFS) $(NVRAM2_FFS): $(BUILD)/$(BOARD).txt
@true
$(BUILD)/nvram1.ffs: $(NVRAM1_FFS)
./bin/nvram-compact < $< > $@
$(BUILD)/nvram2.ffs: $(NVRAM2_FFS)
./bin/nvram-compact < $< > $@