armv7: Add 'bootblock' build class.

For ARM platform, the bootblock may need more C source files to initialize
UART / SPI for loading romstage. To preventing making complex and implicit
dependency by using #include inside bootblock.c, we should add a new build class
"bootblock".

Also #ifdef __BOOT_BLOCK__ can be used to detect if the source is being compiled
for boot block.

For x86, the bootblock is limited to fewer assembly files so it's not using this
class. (Some files shared by x86 and arm in top level or lib are also changed
but nothing should be changed in x86 build process.)

Change-Id: Ia81bccc366d2082397d133d9245f7ecb33b8bc8b
Signed-off-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-on: http://review.coreboot.org/2252
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Tested-by: build bot (Jenkins)
This commit is contained in:
Hung-Te Lin
2013-02-01 01:09:24 +08:00
committed by Ronald G. Minnich
parent e876819975
commit fe18792a08
9 changed files with 30 additions and 68 deletions

View File

@@ -58,7 +58,7 @@ subdirs-y += site-local
#######################################################################
# Add source classes and their build options
classes-y := ramstage romstage smm cpu_microcode
classes-y := ramstage romstage bootblock smm cpu_microcode
#######################################################################
# Helper functions for ramstage postprocess
@@ -111,6 +111,9 @@ $(error Your current configuration requires binary-only components, but you did
endif
endif
bootblock-c-ccopts:=-D__BOOT_BLOCK__
bootblock-S-ccopts:=-D__BOOT_BLOCK__
smm-c-ccopts:=-D__SMM__
smm-S-ccopts:=-D__SMM__
@@ -121,6 +124,7 @@ endif
ramstage-c-deps:=$$(OPTION_TABLE_H)
romstage-c-deps:=$$(OPTION_TABLE_H)
bootblock-c-deps:=$$(OPTION_TABLE_H)
#######################################################################
# Add handler to compile ACPI's ASL
@@ -286,6 +290,10 @@ $(obj)/%.romstage.o $(abspath $(obj))/%.romstage.o: $(obj)/%.c $(obj)/config.h $
@printf " CC $(subst $(obj)/,,$(@))\n"
$(CC) -MMD -D__PRE_RAM__ $(CFLAGS) -c -o $@ $<
$(obj)/%.bootblock.o $(abspath $(obj))/%.bootblock.o: $(obj)/%.c $(obj)/config.h $(OPTION_TABLE_H)
@printf " CC $(subst $(obj)/,,$(@))\n"
$(CC) -MMD -D__BOOT_BLOCK__ $(CFLAGS) -c -o $@ $<
#######################################################################
# Clean up rules
clean-abuild: