diff options
author | Konstantin Porotchkin <kostap@marvell.com> | 2017-03-29 12:51:02 +0300 |
---|---|---|
committer | Konstantin Porotchkin <kostap@marvell.com> | 2017-08-21 19:44:35 +0300 |
commit | 18153e3917894ecbf6a7f3c27e196e65675bf13d (patch) | |
tree | 87c3db7b29baee6963eab571fe8bede4607a8581 /Makefile | |
parent | 3eda0ce2697e9d90feadaf0168743a13748a8e7d (diff) |
platform: Add support for Marvell A7K/A8K platform to the Makefile
Add support for marvell A7K/A8K platforms to the main Makefile
Add version.mk file for the build release information
Change-Id: I18e5583677f2f4eb077a6af14751345100e7ed68
Signed-off-by: Haim Boot <hayim@marvell.com>
Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
Reviewed-on: http://vgitil04.il.marvell.com:8080/38134
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 92 |
1 files changed, 91 insertions, 1 deletions
@@ -21,6 +21,8 @@ MAKEOVERRIDES = MAKE_HELPERS_DIRECTORY := make_helpers/ include ${MAKE_HELPERS_DIRECTORY}build_macros.mk include ${MAKE_HELPERS_DIRECTORY}build_env.mk +include tools/doimage/doimage.mk +include version.mk ################################################################################ # Default values for build configurations, and their dependencies @@ -36,6 +38,22 @@ include ${MAKE_HELPERS_DIRECTORY}defaults.mk ENABLE_ASSERTIONS := ${DEBUG} ENABLE_PMF := ${ENABLE_RUNTIME_INSTRUMENTATION} PLAT := ${DEFAULT_PLAT} +# Enable compilation for Palladium emulation platform +PALLADIUM := 0 +# Disable LLC in A8K family of SoCs +LLC_DISABLE := 0 +# Make non-trusted image by default +MARVELL_SECURE_BOOT := 0 +# Enable end point only for 7040 PCAC +ifeq ($(PLAT),$(filter $(PLAT),a7040_pcac)) +PCI_EP_SUPPORT := 1 +else +PCI_EP_SUPPORT := 0 +endif + +# Marvell images +BOOT_IMAGE := boot-image.bin +FLASH_IMAGE := flash-image.bin ################################################################################ # Checkpatch script options @@ -99,7 +117,7 @@ endif ifeq (${BUILD_STRING},) BUILD_STRING := $(shell git describe --always --dirty --tags 2> /dev/null) endif -VERSION_STRING := v${VERSION_MAJOR}.${VERSION_MINOR}(${BUILD_TYPE}):${BUILD_STRING} +VERSION_STRING := v${VERSION_MAJOR}.${VERSION_MINOR}(${BUILD_TYPE}):${SUBVERSION}:${BUILD_STRING} # The cert_create tool cannot generate certificates individually, so we use the # target 'certificates' to create them all @@ -423,6 +441,45 @@ endif endif endif +DOIMAGEPATH ?= tools/doimage +DOIMAGETOOL ?= ${DOIMAGEPATH}/doimage + +ifeq ($(findstring a80x0,${PLAT}),) +DOIMAGE_SEC := ${DOIMAGEPATH}/secure/sec_img_7K.cfg +else +DOIMAGE_SEC := ${DOIMAGEPATH}/secure/sec_img_8K.cfg +endif # PLAT == a8K/a7K + +ifeq (${MARVELL_SECURE_BOOT},1) +DOIMAGE_SEC_FLAGS := -c $(DOIMAGE_SEC) +DOIMAGE_LIBS_CHECK = \ + if ! [ -d "/usr/include/mbedtls" ]; then \ + echo "****************************************" >&2; \ + echo "Missing mbedTLS installation! " >&2; \ + echo "Please download it from \"tls.mbed.org\"" >&2; \ + echo "Alternatively on Debian/Ubuntu system install" >&2; \ + echo "\"libmbedtls-dev\" package" >&2; \ + echo "Make sure to use version 2.1.0 or later" >&2; \ + echo "****************************************" >&2; \ + exit 1; \ + else if ! [ -f "/usr/include/libconfig.h" ]; then \ + echo "********************************************************" >&2; \ + echo "Missing Libconfig installation!" >&2; \ + echo "Please download it from \"www.hyperrealm.com/libconfig/\"" >&2; \ + echo "Alternatively on Debian/Ubuntu system install packages" >&2; \ + echo "\"libconfig8\" and \"libconfig8-dev\"" >&2; \ + echo "********************************************************" >&2; \ + exit 1; \ + fi \ + fi +else #MARVELL_SECURE_BOOT +DOIMAGE_LIBS_CHECK = +DOIMAGE_SEC_FLAGS = +endif #MARVELL_SECURE_BOOT + +ROM_BIN_EXT ?= $(BUILD_PLAT)/ble.bin +DOIMAGE_FLAGS += -b $(ROM_BIN_EXT) $(NAND_DOIMAGE_FLAGS) $(DOIMAGE_SEC_FLAGS) + ################################################################################ # Build options checks ################################################################################ @@ -459,6 +516,9 @@ $(eval $(call assert_boolean,ENABLE_SPE_FOR_LOWER_ELS)) $(eval $(call assert_numeric,ARM_ARCH_MAJOR)) $(eval $(call assert_numeric,ARM_ARCH_MINOR)) +$(eval $(call assert_boolean,MARVELL_SECURE_BOOT)) +$(eval $(call assert_boolean,PCI_EP_SUPPORT)) + ################################################################################ # Add definitions to the cpp preprocessor based on the current build options. # This is done after including the platform specific makefile to allow the @@ -512,6 +572,18 @@ ifeq (${ARCH},aarch32) else $(eval $(call add_define,AARCH64)) endif +$(eval $(call add_define,PALLADIUM)) +$(eval $(call add_define,LLC_DISABLE)) +$(eval $(call add_define,PCI_EP_SUPPORT)) + +################################################################################ +# Include BL specific makefiles +################################################################################ + +ifdef BLE_SOURCES +NEED_BLE := yes +include ble/ble.mk +endif ################################################################################ # Build targets @@ -531,6 +603,10 @@ ifeq (${ERROR_DEPRECATED},0) endif # Expand build macros for the different images +ifeq (${NEED_BLE},yes) +$(if ${BLE}, ,$(eval $(call MAKE_BL,e))) +endif + ifeq (${NEED_BL1},yes) $(eval $(call MAKE_BL,1)) endif @@ -584,6 +660,7 @@ clean: $(call SHELL_REMOVE_DIR,${BUILD_PLAT}) ${Q}${MAKE} --no-print-directory -C ${FIPTOOLPATH} clean ${Q}${MAKE} PLAT=${PLAT} --no-print-directory -C ${CRTTOOLPATH} clean + ${Q}${MAKE} PLAT=${PLAT} --no-print-directory -C ${DOIMAGEPATH} clean realclean distclean: @echo " REALCLEAN" @@ -591,6 +668,7 @@ realclean distclean: $(call SHELL_DELETE_ALL, ${CURDIR}/cscope.*) ${Q}${MAKE} --no-print-directory -C ${FIPTOOLPATH} clean ${Q}${MAKE} PLAT=${PLAT} --no-print-directory -C ${CRTTOOLPATH} clean + ${Q}${MAKE} PLAT=${PLAT} --no-print-directory -C ${DOIMAGEPATH} clean checkcodebase: locate-checkpatch @echo " CHECKING STYLE" @@ -655,13 +733,25 @@ ${BUILD_PLAT}/${FWU_FIP_NAME}: ${FWU_FIP_DEPS} ${FIPTOOL} @${ECHO_BLANK_LINE} fiptool: ${FIPTOOL} +ifeq (${CALL_DOIMAGE}, y) +fip: ${BUILD_PLAT}/${FIP_NAME} ${DOIMAGETOOL} ${BUILD_PLAT}/ble.bin + $(shell truncate -s %128K ${BUILD_PLAT}/bl1.bin) + $(shell cat ${BUILD_PLAT}/bl1.bin ${BUILD_PLAT}/${FIP_NAME} > ${BUILD_PLAT}/${BOOT_IMAGE}) + ${DOIMAGETOOL} ${DOIMAGE_FLAGS} ${BUILD_PLAT}/${BOOT_IMAGE} ${BUILD_PLAT}/${FLASH_IMAGE} +else fip: ${BUILD_PLAT}/${FIP_NAME} +endif fwu_fip: ${BUILD_PLAT}/${FWU_FIP_NAME} .PHONY: ${FIPTOOL} ${FIPTOOL}: ${Q}${MAKE} CPPFLAGS="-DVERSION='\"${VERSION_STRING}\"'" --no-print-directory -C ${FIPTOOLPATH} +.PHONY: ${DOIMAGETOOL} +${DOIMAGETOOL}: + @$(DOIMAGE_LIBS_CHECK) + ${Q}${MAKE} --no-print-directory -C ${DOIMAGEPATH} + cscope: @echo " CSCOPE" ${Q}find ${CURDIR} -name "*.[chsS]" > cscope.files |