summaryrefslogtreecommitdiff
path: root/src/southbridge/amd/agesa
diff options
context:
space:
mode:
authorZheng Bao <fishbaozi@gmail.com>2015-11-17 22:58:55 +0800
committerZheng Bao <zheng.bao@amd.com>2015-11-19 04:12:25 +0100
commitc64f21c02e187fc00654f568dcf13d09147f7fb0 (patch)
tree95a1a00814f8ec2da0a9f3f0a2f0e50093eef195 /src/southbridge/amd/agesa
parent9c7ff7bc154ff66d2c86e83c349d59a145bfbedd (diff)
AMD Hudson: Use amdfwtool to integrate firmwares.
Change-Id: Ie17a744b6ef4e5405b3dfcecc1deb6462220ec60 Signed-off-by: Zheng Bao <fishbaozi@gmail.com> Reviewed-on: http://review.coreboot.org/12435 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth <martinroth@google.com>
Diffstat (limited to 'src/southbridge/amd/agesa')
-rw-r--r--src/southbridge/amd/agesa/hudson/Makefile.inc102
1 files changed, 24 insertions, 78 deletions
diff --git a/src/southbridge/amd/agesa/hudson/Makefile.inc b/src/southbridge/amd/agesa/hudson/Makefile.inc
index 9e42cf2089..e638c39cff 100644
--- a/src/southbridge/amd/agesa/hudson/Makefile.inc
+++ b/src/southbridge/amd/agesa/hudson/Makefile.inc
@@ -39,84 +39,6 @@ HUDSON_FWM_POS_CALC=$(call int-add, $(call int-subtract, 0xffffffff $(call int-m
HUDSON_FWM_POSITION=$(shell printf %u $(CONFIG_HUDSON_FWM_POSITION))
HUDSON_FWM_INSIDE_CBFS=$(call int-lt, $(CBFS_BASE_ADDRESS) $(HUDSON_FWM_POSITION))
-#assume the cbfs header is less than 128 bytes.
-ROMSIG_SIZE=16
-ifeq ($(CONFIG_HUDSON_XHCI_FWM), y)
-HUDSON_XHCI_POSITION=$(call int-add,$(HUDSON_FWM_POSITION) $(ROMSIG_SIZE) 128)
-XHCI_FWM_SIZE=$(call file-size,$(CONFIG_HUDSON_XHCI_FWM_FILE))
-else
-HUDSON_XHCI_POSITION=0
-XHCI_FWM_SIZE=0
-endif
-
-ifeq ($(CONFIG_HUDSON_GEC_FWM), y)
-HUDSON_GEC_POSITION=$(call int-add,$(HUDSON_FWM_POSITION) $(ROMSIG_SIZE) 128 \
- $(XHCI_FWM_SIZE) 128)
-GEC_FWM_SIZE=$(call file-size,$(CONFIG_HUDSON_GEC_FWM_FILE))
-else
-HUDSON_GEC_POSITION=0
-GEC_FWM_SIZE=0
-endif
-
-ifeq ($(CONFIG_HUDSON_IMC_FWM), y)
-HUDSON_IMC_POSITION=$(call int-align,\
- $(call int-add,\
- $(HUDSON_FWM_POSITION) $(ROMSIG_SIZE) 128 $(XHCI_FWM_SIZE)\
- 128 $(GEC_FWM_SIZE) 128),\
- 65536)
-else
-HUDSON_IMC_POSITION=0
-endif
-
-$(obj)/coreboot_hudson_romsig.bin: $(call strip_quotes, $(CONFIG_HUDSON_XHCI_FWM_FILE)) \
- $(call strip_quotes, $(CONFIG_HUDSON_IMC_FWM_FILE)) \
- $(call strip_quotes, $(CONFIG_HUDSON_GEC_FWM_FILE)) \
- $(obj)/config.h
- echo " Hudson FW $@"
- for fwm in 1437226410 \
- $(HUDSON_IMC_POSITION) \
- $(HUDSON_GEC_POSITION) \
- $(HUDSON_XHCI_POSITION) ; do \
- echo $$fwm | LC_ALL=C awk '{printf ("%c%c%c%c", $$1 % 256, int($$1/256) % 256, int($$1/65536) % 256, int($$1/16777216));}'; \
- done > $@
-
-ifeq ($(CONFIG_HUDSON_FWM), y)
-ifneq ($(HUDSON_FWM_POS_CALC), $(HUDSON_FWM_POSITION))
-$(warning ##### WARNING: CONFIG_HUDSON_FWM_POSITION does not match calculated firmware position $(HUDSON_FWM_POS_CALC) != $(HUDSON_FWM_POSITION) ##### )
-endif
-ifneq ($(HUDSON_FWM_INSIDE_CBFS), 1)
-$(warning ##### WARNING: CONFIG_HUDSON_FWM_POSITION ($(HUDSON_FWM_POSITION)) is outside of CBFS area ($(CBFS_BASE_ADDRESS) to 4294967295) ##### )
-endif
-cbfs-files-y += hudson/fwm
-hudson/fwm-file := $(obj)/coreboot_hudson_romsig.bin
-hudson/fwm-position := $(HUDSON_FWM_POSITION)
-hudson/fwm-type := raw
-endif
-
-ifeq ($(CONFIG_HUDSON_XHCI_FWM), y)
-cbfs-files-y += hudson/xhci
-hudson/xhci-file := $(call strip_quotes, $(CONFIG_HUDSON_XHCI_FWM_FILE))
-hudson/xhci-position := $(HUDSON_XHCI_POSITION)
-hudson/xhci-type := raw
-hudson/xhci-required := Hudson XHCI firmware (available in coreboot/3rdparty/blobs if enabled)
-endif
-
-ifeq ($(CONFIG_HUDSON_IMC_FWM), y)
-cbfs-files-y += hudson/imc
-hudson/imc-file := $(call strip_quotes, $(CONFIG_HUDSON_IMC_FWM_FILE))
-hudson/imc-position := $(HUDSON_IMC_POSITION)
-hudson/imc-type := raw
-hudson/imc-required := Hudson IMC Firmware (available in coreboot/3rdparty/blobs if enabled)
-endif
-
-ifeq ($(CONFIG_HUDSON_GEC_FWM), y)
-cbfs-files-y += hudson/gec
-hudson/gec-file := $(call strip_quotes, $(CONFIG_HUDSON_GEC_FWM_FILE))
-hudson/gec-position := $(HUDSON_GEC_POSITION)
-hudson/gec-type := raw
-hudson/gec-required := Hudson Gigabit Ethernet Controller Firmware (Contact your AMD representative)
-endif
-
ifdef CONFIG_HUDSON_AHCI_ROM
stripped_ahci_rom_id = $(call strip_quotes,$(CONFIG_AHCI_ROM_ID))
cbfs-files-y += pci$(stripped_ahci_rom_id).rom
@@ -124,3 +46,27 @@ pci$(stripped_ahci_rom_id).rom-file := $(call strip_quotes,$(CONFIG_AHCI_ROM_FIL
pci$(stripped_ahci_rom_id).rom-type := optionrom
pci$(stripped_ahci_rom_id).rom-required := Hudson AHCI Option ROM (Contact your AMD representative)
endif
+
+add_opt_prefix=$(if $(call strip_quotes, $(1)), $(2) $(call strip_quotes, $(1)), )
+
+OPT_HUDSON_XHCI_FWM_FILE=$(call add_opt_prefix, $(CONFIG_HUDSON_XHCI_FWM_FILE), --xhci)
+OPT_HUDSON_IMC_FWM_FILE=$(call add_opt_prefix, $(CONFIG_HUDSON_IMC_FWM_FILE), --imc)
+OPT_HUDSON_GEC_FWM_FILE=$(call add_opt_prefix, $(CONFIG_HUDSON_GEC_FWM_FILEddd), --gec)
+
+$(obj)/amdfw.rom: $(call strip_quotes, $(CONFIG_HUDSON_XHCI_FWM_FILE)) \
+ $(call strip_quotes, $(CONFIG_HUDSON_IMC_FWM_FILE)) \
+ $(call strip_quotes, $(CONFIG_HUDSON_GEC_FWM_FILE)) \
+ $(AMDFWTOOL)
+ rm -f $@
+ echo " AMDFWTOOL $@"
+ $(AMDFWTOOL) \
+ $(OPT_HUDSON_XHCI_FWM_FILE) \
+ $(OPT_HUDSON_IMC_FWM_FILE) \
+ $(OPT_HUDSON_GEC_FWM_FILE) \
+ --output $@
+
+cbfs-files-y += apu/amdfw
+apu/amdfw-file := $(obj)/amdfw.rom
+apu/amdfw-position := $(HUDSON_FWM_POSITION)
+apu/amdfw-type := raw
+