usbdebug: Make the EHCI debug console work in the bootblock
[coreboot.git] / src / southbridge / amd / pi / hudson / Makefile.inc
blobc7cd757da247ecfb5460cbda1991458442e95e60
1 #*****************************************************************************
3 # Copyright (c) 2012, 2016   Advanced Micro Devices, Inc.
4 #               2013 - 2014, Sage Electronic Engineering, LLC
5 # All rights reserved.
7 # Redistribution and use in source and binary forms, with or without
8 # modification, are permitted provided that the following conditions are met:
9 #     * Redistributions of source code must retain the above copyright
10 #       notice, this list of conditions and the following disclaimer.
11 #     * Redistributions in binary form must reproduce the above copyright
12 #       notice, this list of conditions and the following disclaimer in the
13 #       documentation and/or other materials provided with the distribution.
14 #     * Neither the name of Advanced Micro Devices, Inc. nor the names of
15 #       its contributors may be used to endorse or promote products derived
16 #       from this software without specific prior written permission.
18 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 # DISCLAIMED. IN NO EVENT SHALL ADVANCED MICRO DEVICES, INC. BE LIABLE FOR ANY
22 # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23 # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25 # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 #*****************************************************************************
31 bootblock-$(CONFIG_USBDEBUG) += enable_usbdebug.c
33 romstage-y += early_setup.c
34 romstage-$(CONFIG_USBDEBUG) += enable_usbdebug.c
35 romstage-$(CONFIG_HUDSON_IMC_FWM) += imc.c
36 romstage-y += smbus.c
37 romstage-y += smbus_spd.c
38 romstage-$(CONFIG_HUDSON_UART) += uart.c
40 verstage-y += early_setup.c
41 verstage-y += reset.c
42 verstage-$(CONFIG_HUDSON_UART) += uart.c
44 ramstage-$(CONFIG_USBDEBUG) += enable_usbdebug.c
45 ramstage-$(CONFIG_HAVE_ACPI_TABLES) += fadt.c
46 ramstage-$(CONFIG_SOUTHBRIDGE_AMD_PI_KERN) += gpio.c
47 ramstage-y += hda.c
48 ramstage-y += hudson.c
49 ramstage-y += ide.c
50 ramstage-$(CONFIG_HUDSON_IMC_FWM) += imc.c
51 ramstage-y += lpc.c
52 ramstage-y += pci.c
53 ramstage-y += pcie.c
54 ramstage-y += reset.c
55 ramstage-y += sata.c
56 ramstage-y += sd.c
57 ramstage-y += sm.c
58 ramstage-$(CONFIG_HAVE_SMI_HANDLER) += smi.c
59 ramstage-$(CONFIG_HAVE_SMI_HANDLER) += smi_util.c
60 ramstage-$(CONFIG_HUDSON_UART) += uart.c
61 ramstage-y += usb.c
63 smm-$(CONFIG_HAVE_SMI_HANDLER) += smihandler.c
64 smm-$(CONFIG_HAVE_SMI_HANDLER) += smi_util.c
66 # ROMSIG At ROMBASE + 0x20000:
67 # +-----------+---------------+----------------+------------+
68 # |0x55AA55AA |EC ROM Address |GEC ROM Address |USB3 ROM    |
69 # +-----------+---------------+----------------+------------+
70 # |PSPDIR ADDR|
71 # +-----------+
73 # EC ROM should be 64K aligned.
75 HUDSON_FWM_POSITION=$(call int-add, $(call int-subtract, 0xffffffff $(CONFIG_ROM_SIZE)) 0x20000 1)
78 ifeq ($(CONFIG_HUDSON_PSP), y)
80 ### 0
83 ifeq ($(CONFIG_CPU_AMD_PI_00730F01), y)
84 FIRMWARE_LOCATE=$(dir $(call strip_quotes, $(CONFIG_AMD_PUBKEY_FILE)))
85 FIRMWARE_TYPE=
86 endif
88 ifeq ($(CONFIG_CPU_AMD_PI_00660F01), y)
89 FIRMWARE_LOCATE=$(dir $(call strip_quotes, $(CONFIG_AMD_PUBKEY_FILE)))
90 FIRMWARE_TYPE=CZ
91 endif
93 ###5
94 PUBSIGNEDKEY_FILE=$(top)/$(FIRMWARE_LOCATE)/RtmPubSigned$(FIRMWARE_TYPE).key
95 ###1
96 ifeq ($(CONFIG_CPU_AMD_PI_00730F01), y)
97 PSPBTLDR_FILE=$(top)/$(FIRMWARE_LOCATE)/PspBootLoader$(FIRMWARE_TYPE).Bypass.sbin
98 else ifeq ($(CONFIG_CPU_AMD_PI_00660F01), y)
99 PSPBTLDR_FILE=$(top)/$(FIRMWARE_LOCATE)/PspBootLoader_prod_$(FIRMWARE_TYPE).sbin
100 endif
102 ###3
103 ifeq ($(CONFIG_CPU_AMD_PI_00730F01), y)
104 PSPRCVR_FILE=$(top)/$(FIRMWARE_LOCATE)/PspRecovery$(FIRMWARE_TYPE).sbin
105 else ifeq ($(CONFIG_CPU_AMD_PI_00660F01), y)
106 PSPRCVR_FILE=$(top)/$(FIRMWARE_LOCATE)/PspRecoveryBootLoader_prod_$(FIRMWARE_TYPE).sbin
107 endif
109 ###2
110 ifeq ($(CONFIG_CPU_AMD_PI_00730F01), y)
111 PSPSCUREOS_FILE=$(top)/$(FIRMWARE_LOCATE)/PspSecureOs$(FIRMWARE_TYPE).sbin
112 else ifeq ($(CONFIG_CPU_AMD_PI_00660F01), y)
113 PSPSCUREOS_FILE=$(top)/$(FIRMWARE_LOCATE)/PspSecureOs_prod_$(FIRMWARE_TYPE).csbin
114 endif
116 ###4
117 PSPNVRAM_FILE=$(top)/$(FIRMWARE_LOCATE)/PspNvram$(FIRMWARE_TYPE).bin
119 ###8
120 SMUFWM_FILE=$(top)/$(FIRMWARE_LOCATE)/SmuFirmware$(FIRMWARE_TYPE).sbin
121 SMUFWM_FN_FILE=$(top)/$(FIRMWARE_LOCATE)/SmuFirmware$(FIRMWARE_TYPE)_FN.sbin
123 ###95
124 SMUSCS_FILE=$(top)/$(FIRMWARE_LOCATE)/SmuScs$(FIRMWARE_TYPE).bin
126 ###9
127 PSPSECUREDEBUG_FILE=$(top)/$(FIRMWARE_LOCATE)/PspSecureDebug$(FIRMWARE_TYPE).Key
129 ###12
130 ifeq ($(CONFIG_CPU_AMD_PI_00730F01), y)
131 PSPTRUSTLETS_FILE=$(top)/$(FIRMWARE_LOCATE)/trustlets.bin
132 else ifeq ($(CONFIG_CPU_AMD_PI_00660F01), y)
133 PSPTRUSTLETS_FILE=$(top)/$(FIRMWARE_LOCATE)/PspTrustlets_prod_$(FIRMWARE_TYPE).cbin
134 endif
136 ###13
137 ifeq ($(CONFIG_CPU_AMD_PI_00730F01), y)
138 TRUSTLETKEY_FILE=$(top)/$(FIRMWARE_LOCATE)/Trustlet.tkn.cert
139 else ifeq ($(CONFIG_CPU_AMD_PI_00660F01), y)
140 TRUSTLETKEY_FILE=$(top)/$(FIRMWARE_LOCATE)/TrustletKey_prod_$(FIRMWARE_TYPE).sbin
141 endif
143 ###18
144 ifeq ($(CONFIG_CPU_AMD_PI_00660F01), y)
145 SMUFIRMWARE2_FILE=$(top)/$(FIRMWARE_LOCATE)/SmuFirmware2_prod_$(FIRMWARE_TYPE).sbin
146 endif
148 endif
150 add_opt_prefix=$(if $(call strip_quotes, $(1)), $(2) $(call strip_quotes, $(1)), )
152 OPT_HUDSON_XHCI_FWM_FILE=$(call add_opt_prefix, $(CONFIG_HUDSON_XHCI_FWM_FILE), --xhci)
153 OPT_HUDSON_IMC_FWM_FILE=$(call add_opt_prefix, $(CONFIG_HUDSON_IMC_FWM_FILE), --imc)
154 OPT_HUDSON_GEC_FWM_FILE=$(call add_opt_prefix, $(CONFIG_HUDSON_GEC_FWM_FILEddd), --gec)
156 OPT_AMD_PUBKEY_FILE=$(call add_opt_prefix, $(CONFIG_AMD_PUBKEY_FILE), --pubkey)
157 OPT_PSPBTLDR_FILE=$(call add_opt_prefix, $(PSPBTLDR_FILE), --bootloader)
158 OPT_SMUFWM_FILE=$(call add_opt_prefix, $(SMUFWM_FILE), --smufirmware)
159 OPT_PSPRCVR_FILE=$(call add_opt_prefix, $(PSPRCVR_FILE), --recovery)
160 OPT_PUBSIGNEDKEY_FILE=$(call add_opt_prefix, $(PUBSIGNEDKEY_FILE), --rtmpubkey)
161 OPT_PSPSCUREOS_FILE=$(call add_opt_prefix, $(PSPSCUREOS_FILE), --secureos)
162 OPT_PSPNVRAM_FILE=$(call add_opt_prefix, $(PSPNVRAM_FILE), --nvram)
163 OPT_PSPSECUREDEBUG_FILE=$(call add_opt_prefix, $(PSPSECUREDEBUG_FILE), --securedebug)
164 OPT_PSPTRUSTLETS_FILE=$(call add_opt_prefix, $(PSPTRUSTLETS_FILE), --trustlets)
165 OPT_TRUSTLETKEY_FILE=$(call add_opt_prefix, $(TRUSTLETKEY_FILE), --trustletkey)
166 OPT_SMUFIRMWARE2_FILE=$(call add_opt_prefix, $(SMUFIRMWARE2_FILE), --smufirmware2)
167 OPT_SMUSCS_FILE=$(call add_opt_prefix, $(SMUSCS_FILE), --smuscs)
169 $(obj)/amdfw.rom:       $(call strip_quotes, $(CONFIG_HUDSON_XHCI_FWM_FILE)) \
170                         $(call strip_quotes, $(CONFIG_HUDSON_IMC_FWM_FILE)) \
171                         $(call strip_quotes, $(CONFIG_HUDSON_GEC_FWM_FILE)) \
172                         $(call strip_quotes, $(CONFIG_AMD_PUBKEY_FILE)) \
173                         $(call strip_quotes, $(PUBSIGNEDKEY_FILE)) \
174                         $(call strip_quotes, $(PSPBTLDR_FILE)) \
175                         $(call strip_quotes, $(PSPRCVR_FILE)) \
176                         $(call strip_quotes, $(PSPSCUREOS_FILE)) \
177                         $(call strip_quotes, $(PSPNVRAM_FILE)) \
178                         $(call strip_quotes, $(SMUFWM_FILE)) \
179                         $(call strip_quotes, $(SMUSCS_FILE)) \
180                         $(call strip_quotes, $(PSPSECUREDEBUG_FILE)) \
181                         $(call strip_quotes, $(PSPTRUSTLETS_FILE)) \
182                         $(call strip_quotes, $(TRUSTLETKEY_FILE)) \
183                         $(call strip_quotes, $(SMUFIRMWARE2_FILE)) \
184                         $(call strip_quotes, $(AMD_PUBKEY2_FILE)) \
185                         $(call strip_quotes, $(PUBSIGNEDKEY2_FILE)) \
186                         $(call strip_quotes, $(PSPBTLDR2_FILE)) \
187                         $(call strip_quotes, $(SMUFWM2_FILE)) \
188                         $(call strip_quotes, $(SMUFWM2_FN_FILE)) \
189                         $(call strip_quotes, $(PSPRCVR2_FILE)) \
190                         $(call strip_quotes, $(PSPSCUREOS2_FILE)) \
191                         $(call strip_quotes, $(PSPNVRAM2_FILE)) \
192                         $(call strip_quotes, $(SMUSCS2_FILE)) \
193                         $(call strip_quotes, $(PSPSECUREDEBUG2_FILE)) \
194                         $(call strip_quotes, $(PSPTRUSTLETS2_FILE)) \
195                         $(call strip_quotes, $(TRUSTLETKEY2_FILE)) \
196                         $(call strip_quotes, $(SMUFIRMWARE2_2_FILE)) \
197                         $(call strip_quotes, $(SMUFIRMWARE2_2_FN_FILE)) \
198                         $(AMDFWTOOL)
199         rm -f $@
200         @printf "    AMDFWTOOL  $(subst $(obj)/,,$(@))\n"
201         $(AMDFWTOOL) \
202                 $(OPT_HUDSON_XHCI_FWM_FILE) \
203                 $(OPT_HUDSON_IMC_FWM_FILE) \
204                 $(OPT_HUDSON_GEC_FWM_FILE) \
205                 $(OPT_AMD_PUBKEY_FILE) \
206                 $(OPT_PSPBTLDR_FILE) \
207                 $(OPT_SMUFWM_FILE) \
208                 $(OPT_PSPRCVR_FILE) \
209                 $(OPT_PUBSIGNEDKEY_FILE) \
210                 $(OPT_PSPSCUREOS_FILE) \
211                 $(OPT_PSPNVRAM_FILE) \
212                 $(OPT_PSPSECUREDEBUG_FILE) \
213                 $(OPT_PSPTRUSTLETS_FILE) \
214                 $(OPT_TRUSTLETKEY_FILE) \
215                 $(OPT_SMUFIRMWARE2_FILE) \
216                 $(OPT_SMUSCS_FILE) \
217                 $(OPT_2AMD_PUBKEY_FILE) \
218                 $(OPT_2PSPBTLDR_FILE) \
219                 $(OPT_2SMUFWM_FILE) \
220                 $(OPT_2SMUFWM_FN_FILE) \
221                 $(OPT_2PSPRCVR_FILE) \
222                 $(OPT_2PUBSIGNEDKEY_FILE) \
223                 $(OPT_2PSPSCUREOS_FILE) \
224                 $(OPT_2PSPNVRAM_FILE) \
225                 $(OPT_2PSPSECUREDEBUG_FILE) \
226                 $(OPT_2PSPTRUSTLETS_FILE) \
227                 $(OPT_2TRUSTLETKEY_FILE) \
228                 $(OPT_2SMUFIRMWARE2_FILE) \
229                 $(OPT_2SMUFIRMWARE2_FN_FILE) \
230                 $(OPT_2SMUSCS_FILE) \
231                 --flashsize $(CONFIG_ROM_SIZE) \
232                 --output        $@
234 ifeq ($(CONFIG_AMDFW_OUTSIDE_CBFS),y)
235 PHONY+=add_amdfw
236 INTERMEDIATE+=add_amdfw
238 add_amdfw: $(obj)/coreboot.pre $(obj)/amdfw.rom
239         printf "    DD         Adding AMD Firmware\n"
240         dd if=$(obj)/amdfw.rom \
241                 of=$(obj)/coreboot.pre conv=notrunc bs=1 seek=131072 >/dev/null 2>&1
243 else # ifeq ($(CONFIG_AMDFW_OUTSIDE_CBFS),y)
245 cbfs-files-y += apu/amdfw
246 apu/amdfw-file := $(obj)/amdfw.rom
247 apu/amdfw-position := $(HUDSON_FWM_POSITION)
248 apu/amdfw-type := raw
250 endif # ifeq ($(CONFIG_AMDFW_OUTSIDE_CBFS),y)