soc/amd/picasso: Move APCB generation out of picasso

Move APCB generation out of the picasso makefile and into the mainboard
makefile. APCB generation tends to be mainboard specific and does not
belong in the soc makefile.

BUG=b:168099242
TEST=Build mandolin and check for APCB in coreboot binary
     Build and boot ezkinil

Change-Id: Ib85ad94e515f2ffad58aafe06c1f1d4043e9303c
Signed-off-by: Rob Barnes <robbarnes@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/45222
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Reviewed-by: Martin Roth <martinroth@google.com>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Rob Barnes 2020-09-09 13:19:09 -06:00 committed by Aaron Durbin
parent 3992da034f
commit b2545cc3c6
4 changed files with 26 additions and 63 deletions

View File

@ -240,47 +240,12 @@ in an Integration Guide.
## APCB setup ## APCB setup
APCBs are used to provide the PSP with SPD information and optionally a set of APCBs are used to provide the PSP with SPD information and optionally a set of
GPIOs to use for selecting which SPD to load. GPIOs to use for selecting which SPD to load. A list of APCB files should be
specified in `APCB_SOURCES`.
### Prebuilt
The picasso `Makefile` expects APCBs to be located in
`3rdparty/blobs/mainboard/$(MAINBOARDDIR)`. If you have a pre-built binary just
add the following to your mainboard's Makefile.
```
# i.e., 3rdparty/blobs/mainboard/amd/mandolin/APCB_mandolin.bin
APCB_SOURCES = mandolin
```
### Generating APCBs ### Generating APCBs
If you have a template APCB file, the `apcb_edit` tool can be used to inject the If you have a template APCB file, the `apcb_edit` tool can be used to inject the
SPD and GPIOs used to select the correct slot. Entries should match this SPD and GPIOs used to select the correct slot.
pattern `{NAME}_x{1,2}`. There should be a matching SPD hex file in
`SPD_SOURCES_DIR` matching the pattern `{NAME}.spd.hex`.
The `_x{1,2}` suffix denotes single or dual channel. Up to 16 slots can be used.
If a slot is empty, the special empty keyword can be used. This will generate
an APCB with an empty SPD.
```
APCB_SOURCES = hynix-HMA851S6CJR6N-VK_x1 # 0b0000
APCB_SOURCES += hynix-HMAA1GS6CMR6N-VK_x2 # 0b0001
APCB_SOURCES += empty # 0b0010
APCB_SOURCES += samsung-K4A8G165WC-BCWE_x1 # 0b0011
```
#### APCB Board ID GPIO configuration.
The GPIOs determine which memory SPD will be used during boot.
```
# APCB_BOARD_ID_GPIO[0-3] = GPIO_NUMBER GPIO_IO_MUX GPIO_BANK_CTL
# GPIO_NUMBER: FCH GPIO number
# GPIO_IO_MUX: Value write to IOMUX to configure this GPIO
# GPIO_BANK_CTL: Value write to GPIOBankCtl[23:16] to configure this GPIO
APCB_BOARD_ID_GPIO0 = 121 1 0
APCB_BOARD_ID_GPIO1 = 120 1 0
APCB_BOARD_ID_GPIO2 = 131 3 0
APCB_BOARD_ID_GPIO3 = 116 1 0
```
## Footnotes ## Footnotes

View File

@ -10,8 +10,7 @@ ifneq ($(CONFIG_PICASSO_LPC_IOMUX),y)
ramstage-y += emmc_gpio.c ramstage-y += emmc_gpio.c
endif endif
# APCB_mandolin.bin APCB_SOURCES = $(MAINBOARD_BLOBS_DIR)/APCB_mandolin.bin
APCB_SOURCES = mandolin
PHONY+=add_mchp_fw PHONY+=add_mchp_fw
INTERMEDIATE+=add_mchp_fw INTERMEDIATE+=add_mchp_fw

View File

@ -2,3 +2,23 @@
# This directory # This directory
SPD_SOURCES_DIR := src/mainboard/$(MAINBOARDDIR)/spd SPD_SOURCES_DIR := src/mainboard/$(MAINBOARDDIR)/spd
APCB_SOURCES=$(foreach f, $(basename $(SPD_SOURCES)), $(obj)/APCB_$(f).gen)
# APCB binary with magic numbers to be replaced by apcb_edit tool
APCB_MAGIC_BLOB:=$(FIRMWARE_LOCATE)/APCB_magic.bin
$(obj)/APCB_%.gen: $(SPD_SOURCES_DIR)/%.hex \
$(APCB_EDIT_TOOL) \
$(APCB_MAGIC_BLOB)
$(APCB_EDIT_TOOL) \
$(APCB_MAGIC_BLOB) \
$@ \
--hex \
--strip_manufacturer_information \
--spd_0_0 $< \
$(if $(APCB_POPULATE_2ND_CHANNEL), --spd_1_0 $<, ) \
--board_id_gpio0 $(APCB_BOARD_ID_GPIO0) \
--board_id_gpio1 $(APCB_BOARD_ID_GPIO1) \
--board_id_gpio2 $(APCB_BOARD_ID_GPIO2) \
--board_id_gpio3 $(APCB_BOARD_ID_GPIO3)

View File

@ -198,7 +198,7 @@ endif
# #
# type = 0x60 # type = 0x60
PSP_APCB_FILES=$(foreach f, $(basename $(SPD_SOURCES)), $(obj)/APCB_$(f).bin) PSP_APCB_FILES=$(APCB_SOURCES)
# type = 0x61 # type = 0x61
PSP_APOB_BASE=$(CONFIG_PSP_APOB_DRAM_ADDRESS) PSP_APOB_BASE=$(CONFIG_PSP_APOB_DRAM_ADDRESS)
@ -383,28 +383,6 @@ AMDFW_COMMON_ARGS=$(OPT_AMD_PUBKEY_FILE) \
--soc-name "Picasso" \ --soc-name "Picasso" \
--flashsize $(CONFIG_ROM_SIZE) --flashsize $(CONFIG_ROM_SIZE)
# Copy prebuild APCBs if they exist
$(obj)/APCB_%.bin: $(MAINBOARD_BLOBS_DIR)/APCB_%.bin
cp $< $@
# APCB binary with magic numbers to be replaced by apcb_edit tool
APCB_MAGIC_BLOB:=$(FIRMWARE_LOCATE)/APCB_magic.bin
$(obj)/APCB_%.bin: $$(SPD_SOURCES_DIR)/%.hex \
$(APCB_EDIT_TOOL) \
$(APCB_MAGIC_BLOB)
$(APCB_EDIT_TOOL) \
$(APCB_MAGIC_BLOB) \
$@ \
--hex \
--strip_manufacturer_information \
--spd_0_0 $< \
$(if $(APCB_POPULATE_2ND_CHANNEL), --spd_1_0 $<, ) \
--board_id_gpio0 $(APCB_BOARD_ID_GPIO0) \
--board_id_gpio1 $(APCB_BOARD_ID_GPIO1) \
--board_id_gpio2 $(APCB_BOARD_ID_GPIO2) \
--board_id_gpio3 $(APCB_BOARD_ID_GPIO3)
$(obj)/amdfw.rom: $(call strip_quotes, $(CONFIG_AMD_PUBKEY_FILE)) \ $(obj)/amdfw.rom: $(call strip_quotes, $(CONFIG_AMD_PUBKEY_FILE)) \
$(call strip_quotes, $(PSPBTLDR_FILE)) \ $(call strip_quotes, $(PSPBTLDR_FILE)) \
$(call strip_quotes, $(PSPSCUREOS_FILE)) \ $(call strip_quotes, $(PSPSCUREOS_FILE)) \
@ -443,6 +421,7 @@ $(obj)/amdfw.rom: $(call strip_quotes, $(CONFIG_AMD_PUBKEY_FILE)) \
$$(PSP_APCB_FILES) \ $$(PSP_APCB_FILES) \
$(AMDFWTOOL) \ $(AMDFWTOOL) \
$(obj)/fmap.fmd $(obj)/fmap.fmd
$(if $(PSP_APCB_FILES), ,$(error APCB_SOURCES is not set))
rm -f $@ rm -f $@
@printf " AMDFWTOOL $(subst $(obj)/,,$(@))\n" @printf " AMDFWTOOL $(subst $(obj)/,,$(@))\n"
$(AMDFWTOOL) \ $(AMDFWTOOL) \