| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
ifeq ($(CONFIG_SOC_AMD_STONEYRIDGE),y) |
| 34 |
|
| 35 |
subdirs-y += 00670F00 |
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
AGESA_ROOT = $(top)/$(call strip_quotes,$(CONFIG_AGESA_BINARY_PI_VENDORCODE_PATH)) |
| 40 |
|
| 41 |
BINARY_PI_INC = -I$(AGESA_ROOT) |
| 42 |
BINARY_PI_INC += -I$(AGESA_ROOT)/binaryPI |
| 43 |
BINARY_PI_INC += -I$(AGESA_ROOT)/Include |
| 44 |
BINARY_PI_INC += -I$(AGESA_ROOT)/Proc |
| 45 |
BINARY_PI_INC += -I$(AGESA_ROOT)/Proc/Common |
| 46 |
BINARY_PI_INC += -I$(AGESA_ROOT)/Proc/CPU |
| 47 |
BINARY_PI_INC += -I$(AGESA_ROOT)/Proc/CPU/Family |
| 48 |
BINARY_PI_INC += -I$(AGESA_ROOT)/Proc/Fch |
| 49 |
BINARY_PI_INC += -I$(AGESA_ROOT)/Proc/Fch/Common |
| 50 |
|
| 51 |
AGESA_INC = -I$(obj) |
| 52 |
AGESA_INC += $(BINARY_PI_INC) |
| 53 |
|
| 54 |
AGESA_INC += -I$(src)/soc/amd/stoneyridge/include |
| 55 |
AGESA_INC += -I$(src)/soc/amd/common/block/include |
| 56 |
|
| 57 |
AGESA_INC += -I$(src)/arch/x86/include |
| 58 |
AGESA_INC += -I$(src)/include |
| 59 |
AGESA_INC += -I$(src)/commonlib/include |
| 60 |
AGESA_INC += -I$(VBOOT_SOURCE)/firmware/include |
| 61 |
endif |
| 62 |
|
| 63 |
ifeq ($(CONFIG_CPU_AMD_PI_00730F01),y) |
| 64 |
|
| 65 |
|
| 66 |
subdirs-y += 00730F01 |
| 67 |
|
| 68 |
AGESA_ROOT = $(call strip_quotes,$(CONFIG_AGESA_BINARY_PI_VENDORCODE_PATH)) |
| 69 |
|
| 70 |
AGESA_INC = -I$(obj) -I$(src)/vendorcode/amd/include |
| 71 |
|
| 72 |
AGESA_INC += -I$(src)/mainboard/$(MAINBOARDDIR) |
| 73 |
AGESA_INC += -I$(AGESA_ROOT)/binaryPI |
| 74 |
AGESA_INC += -I$(AGESA_ROOT) |
| 75 |
AGESA_INC += -I$(AGESA_ROOT)/Include |
| 76 |
AGESA_INC += -I$(src)/vendorcode/amd/pi |
| 77 |
AGESA_INC += -I$(src)/vendorcode/amd/pi/Lib |
| 78 |
|
| 79 |
AGESA_INC += -I$(AGESA_ROOT)/Proc |
| 80 |
AGESA_INC += -I$(AGESA_ROOT)/Proc/Common |
| 81 |
AGESA_INC += -I$(AGESA_ROOT)/Proc/CPU |
| 82 |
AGESA_INC += -I$(AGESA_ROOT)/Proc/CPU/Family |
| 83 |
AGESA_INC += -I$(AGESA_ROOT)/Proc/CPU/Feature |
| 84 |
AGESA_INC += -I$(AGESA_ROOT)/Proc/Fch |
| 85 |
AGESA_INC += -I$(AGESA_ROOT)/Proc/Fch/Common |
| 86 |
|
| 87 |
AGESA_INC += -I$(src)/northbridge/amd/pi |
| 88 |
AGESA_INC += -I$(src)/southbridge/amd/pi/hudson |
| 89 |
|
| 90 |
AGESA_INC += -I$(src)/arch/x86/include |
| 91 |
AGESA_INC += -I$(src)/include |
| 92 |
AGESA_INC += -I$(src)/commonlib/include |
| 93 |
AGESA_INC += -I$(src)/commonlib/bsd/include |
| 94 |
AGESA_INC += -I$(VBOOT_SOURCE)/firmware/include |
| 95 |
|
| 96 |
AGESA_CFLAGS += -Wno-pragma-pack |
| 97 |
AGESA_CFLAGS += -fno-strict-aliasing -D__LIBAGESA__ |
| 98 |
CFLAGS_x86_32 += $(AGESA_CFLAGS) |
| 99 |
CFLAGS_x86_64 += $(AGESA_CFLAGS) |
| 100 |
|
| 101 |
export AGESA_ROOT := $(AGESA_ROOT) |
| 102 |
export AGESA_INC := $(AGESA_INC) |
| 103 |
export AGESA_CFLAGS := $(AGESA_CFLAGS) |
| 104 |
|
| 105 |
CC_bootblock := $(CC_bootblock) $(AGESA_INC) $(AGESA_CFLAGS) |
| 106 |
CC_romstage := $(CC_romstage) $(AGESA_INC) $(AGESA_CFLAGS) |
| 107 |
CC_postcar:= $(CC_postcar) -I$(src)/southbridge/amd/pi/hudson -I$(AGESA_ROOT)/binaryPI |
| 108 |
CC_ramstage := $(CC_ramstage) $(AGESA_INC) $(AGESA_CFLAGS) |
| 109 |
|
| 110 |
CC_x86_32 := $(CC_x86_32) $(AGESA_INC) $(AGESA_CFLAGS) |
| 111 |
CC_x86_64 := $(CC_x86_64) $(AGESA_INC) $(AGESA_CFLAGS) |
| 112 |
|
| 113 |
|
| 114 |
|
| 115 |
define create_agesa_cp_template |
| 116 |
# $1 AGESA source file |
| 117 |
|
| 118 |
$(agesa_src_path)/$(notdir $1): $1 |
| 119 |
@printf " AGESA Copying $$(notdir $1) => $$(@D)\n" |
| 120 |
if [ ! -r $(agesa_src_path)/$(notdir $1) ]; then \ |
| 121 |
cp -f $1 $$(@D); \ |
| 122 |
fi |
| 123 |
|
| 124 |
$(call src-to-obj,libagesa,$1): $(agesa_src_path)/$(notdir $1) $(obj)/config.h $(src)/include/kconfig.h |
| 125 |
@printf " CC $$(subst $(obj)/,,$$(@))\n" |
| 126 |
$(CC_libagesa) -c -MMD $(CFLAGS_libagesa) $(AGESA_CFLAGS) \ |
| 127 |
$(AGESA_INC) \ |
| 128 |
-include $(src)/include/kconfig.h \ |
| 129 |
-include $(src)/include/rules.h \ |
| 130 |
-include $(src)/commonlib/bsd/include/commonlib/bsd/compiler.h \ |
| 131 |
-o $$@ \ |
| 132 |
$(agesa_src_path)/$(notdir $1) |
| 133 |
|
| 134 |
endef |
| 135 |
|
| 136 |
agesa_raw_files += $(wildcard $(src)/vendorcode/amd/pi/Lib/*.[cS]) |
| 137 |
|
| 138 |
ifeq ($(CONFIG_HUDSON_IMC_FWM),y) |
| 139 |
agesa_raw_files += $(wildcard $(src)/vendorcode/amd/pi/Lib/imc/*.c) |
| 140 |
endif |
| 141 |
|
| 142 |
classes-y += libagesa |
| 143 |
|
| 144 |
ifeq ($(CONFIG_ARCH_ROMSTAGE_X86_32),y) |
| 145 |
$(eval $(call create_class_compiler,libagesa,x86_32)) |
| 146 |
else |
| 147 |
$(eval $(call create_class_compiler,libagesa,x86_64)) |
| 148 |
endif |
| 149 |
|
| 150 |
agesa_src_files := $(strip $(sort $(foreach file,$(strip $(agesa_raw_files)),$(call strip_quotes,$(file))))) |
| 151 |
agesa_output_path := $(obj)/libagesa |
| 152 |
agesa_src_path := $(agesa_output_path) |
| 153 |
agesa_dirs := $(sort $(abspath $(dir $(call src-to-obj,libagesa,$(agesa_src_files))))) |
| 154 |
|
| 155 |
additional-dirs += $(agesa_src_path) $(agesa_dirs) |
| 156 |
|
| 157 |
$(foreach file,$(strip $(agesa_src_files)),$(eval $(call create_agesa_cp_template,$(file)))) |
| 158 |
|
| 159 |
$(agesa_output_path)/libagesa.a: $(call src-to-obj,libagesa,$(agesa_src_files)) |
| 160 |
@printf " AGESA $(subst $(obj)/,,$(@))\n" |
| 161 |
$(AR_libagesa) rcsDT $@ $+ |
| 162 |
|
| 163 |
romstage-libs += $(agesa_output_path)/libagesa.a |
| 164 |
ramstage-libs += $(agesa_output_path)/libagesa.a |
| 165 |
|
| 166 |
|
| 167 |
|
| 168 |
cbfs-files-y += $(CONFIG_AGESA_CBFS_NAME) |
| 169 |
$(CONFIG_AGESA_CBFS_NAME)-file := $(CONFIG_AGESA_BINARY_PI_FILE) |
| 170 |
$(CONFIG_AGESA_CBFS_NAME)-type := raw |
| 171 |
$(CONFIG_AGESA_CBFS_NAME)-position := $(CONFIG_AGESA_BINARY_PI_LOCATION) |
| 172 |
|
| 173 |
endif |