-include Rules.make MAKE_JOBS ?= 1 all: linux arm-benchmarks am-sysinfo oprofile-example linux-dtbs cryptodev sysfw-image jailhouse ti-img-rogue-driver oob-demo u-boot-spl-j7 ti-img-encode-decode clean: linux_clean arm-benchmarks_clean am-sysinfo_clean oprofile-example_clean linux-dtbs_clean cryptodev_clean sysfw-image_clean jailhouse_clean ti-img-rogue-driver_clean oob-demo_clean u-boot-spl-j7_clean ti-img-encode-decode_clean install: linux_install arm-benchmarks_install am-sysinfo_install oprofile-example_install linux-dtbs_install cryptodev_install sysfw-image_install jailhouse_install ti-img-rogue-driver_install oob-demo_install u-boot-spl-j7_install ti-img-encode-decode_install # Kernel build targets linux: linux-dtbs @echo ================================= @echo Building the Linux Kernel @echo ================================= $(MAKE) -C $(LINUXKERNEL_INSTALL_DIR) ARCH=arm64 CROSS_COMPILE=$(CROSS_COMPILE) $(DEFCONFIG) $(MAKE) -j $(MAKE_JOBS) -C $(LINUXKERNEL_INSTALL_DIR) ARCH=arm64 CROSS_COMPILE=$(CROSS_COMPILE) Image $(MAKE) -j $(MAKE_JOBS) -C $(LINUXKERNEL_INSTALL_DIR) ARCH=arm64 CROSS_COMPILE=$(CROSS_COMPILE) modules linux_install: linux-dtbs_install @echo =================================== @echo Installing the Linux Kernel @echo =================================== @if [ ! -d $(DESTDIR) ] ; then \ echo "The extracted target filesystem directory doesn't exist."; \ echo "Please run setup.sh in the SDK's root directory and then try again."; \ exit 1; \ fi install -d $(DESTDIR)/boot install $(LINUXKERNEL_INSTALL_DIR)/arch/arm64/boot/Image $(DESTDIR)/boot install $(LINUXKERNEL_INSTALL_DIR)/vmlinux $(DESTDIR)/boot install $(LINUXKERNEL_INSTALL_DIR)/System.map $(DESTDIR)/boot $(MAKE) -C $(LINUXKERNEL_INSTALL_DIR) ARCH=arm64 CROSS_COMPILE=$(CROSS_COMPILE) INSTALL_MOD_PATH=$(DESTDIR) INSTALL_MOD_STRIP=$(INSTALL_MOD_STRIP) modules_install linux_clean: @echo ================================= @echo Cleaning the Linux Kernel @echo ================================= $(MAKE) -C $(LINUXKERNEL_INSTALL_DIR) ARCH=arm64 CROSS_COMPILE=$(CROSS_COMPILE) mrproper # arm-benchmarks build targets arm-benchmarks: @echo ============================= @echo Building ARM Benchmarks @echo ============================= @cd example-applications; cd `find . -maxdepth 1 -type d -name "*arm-benchmarks*"`; make CC="$(CC)" arm-benchmarks_clean: @echo ============================= @echo Cleaning ARM Benchmarks @echo ============================= @cd example-applications; cd `find . -maxdepth 1 -type d -name "*arm-benchmarks*"`; make clean arm-benchmarks_install: @echo ============================================== @echo Installing ARM Benchmarks - Release version @echo ============================================== @cd example-applications; cd `find . -maxdepth 1 -type d -name "*arm-benchmarks*"`; make install arm-benchmarks_install_debug: @echo ============================================ @echo Installing ARM Benchmarks - Debug Version @echo ============================================ @cd example-applications; cd `find . -maxdepth 1 -type d -name "*arm-benchmarks*"`; make install_debug # am-sysinfo build targets am-sysinfo: @echo ============================= @echo Building AM Sysinfo @echo ============================= @cd example-applications; cd `find . -maxdepth 1 -type d -name "*am-sysinfo*"`; make CC="$(CC)" am-sysinfo_clean: @echo ============================= @echo Cleaning AM Sysinfo @echo ============================= @cd example-applications; cd `find . -maxdepth 1 -type d -name "*am-sysinfo*"`; make clean am-sysinfo_install: @echo =============================================== @echo Installing AM Sysinfo - Release version @echo =============================================== @cd example-applications; cd `find . -maxdepth 1 -type d -name "*am-sysinfo*"`; make install am-sysinfo_install_debug: @echo ============================================= @echo Installing AM Sysinfo - Debug version @echo ============================================= @cd example-applications; cd `find . -maxdepth 1 -type d -name "*am-sysinfo*"`; make install_debug # oprofile-example build targets oprofile-example: @echo ============================= @echo Building OProfile Example @echo ============================= @cd example-applications; cd `find . -maxdepth 1 -type d -name "*oprofile-example*"`; make CC="$(CC)" oprofile-example_clean: @echo ============================= @echo Cleaning OProfile Example @echo ============================= @cd example-applications; cd `find . -maxdepth 1 -type d -name "*oprofile-example*"`; make clean oprofile-example_install: @echo ============================================= @echo Installing OProfile Example - Debug version @echo ============================================= @cd example-applications; cd `find . -maxdepth 1 -type d -name "*oprofile-example*"`; make install # Kernel DTB build targets linux-dtbs: @echo ===================================== @echo Building the Linux Kernel DTBs @echo ===================================== $(MAKE) -C $(LINUXKERNEL_INSTALL_DIR) ARCH=arm64 CROSS_COMPILE=$(CROSS_COMPILE) $(DEFCONFIG) @for DTB in ti/k3-j721e-common-proc-board.dtb ti/k3-j721e-proc-board-tps65917.dtb ti/k3-j721e-common-proc-board-infotainment.dtbo ti/k3-j721e-pcie-backplane.dtbo ti/k3-j721e-common-proc-board-jailhouse.dtbo ti/k3-j721e-vision-apps.dtbo ti/k3-j721e-pcie-backplane.dtbo ; do \ $(MAKE) -j $(MAKE_JOBS) -C $(LINUXKERNEL_INSTALL_DIR) ARCH=arm64 CROSS_COMPILE=$(CROSS_COMPILE) $$DTB; \ done linux-dtbs_install: @echo ======================================= @echo Installing the Linux Kernel DTBs @echo ======================================= @if [ ! -d $(DESTDIR) ] ; then \ echo "The extracted target filesystem directory doesn't exist."; \ echo "Please run setup.sh in the SDK's root directory and then try again."; \ exit 1; \ fi install -d $(DESTDIR)/boot @for DTB in ti/k3-j721e-common-proc-board.dtb ti/k3-j721e-proc-board-tps65917.dtb ti/k3-j721e-common-proc-board-infotainment.dtbo ti/k3-j721e-pcie-backplane.dtbo ti/k3-j721e-common-proc-board-jailhouse.dtbo ti/k3-j721e-vision-apps.dtbo ti/k3-j721e-pcie-backplane.dtbo ; do \ install -m 0644 $(LINUXKERNEL_INSTALL_DIR)/arch/arm64/boot/dts/$$DTB $(DESTDIR)/boot/; \ done linux-dtbs_clean: @echo ======================================= @echo Cleaning the Linux Kernel DTBs @echo ======================================= @echo "Nothing to do" cryptodev: linux @echo ================================ @echo Building cryptodev-linux @echo ================================ @cd board-support/extra-drivers; \ cd `find . -maxdepth 1 -type d -name "cryptodev*"`; \ make ARCH=arm64 KERNEL_DIR=$(LINUXKERNEL_INSTALL_DIR) cryptodev_clean: @echo ================================ @echo Cleaning cryptodev-linux @echo ================================ @cd board-support/extra-drivers; \ cd `find . -maxdepth 1 -type d -name "cryptodev*"`; \ make ARCH=arm64 KERNEL_DIR=$(LINUXKERNEL_INSTALL_DIR) clean cryptodev_install: @echo ================================ @echo Installing cryptodev-linux @echo ================================ @if [ ! -d $(DESTDIR) ] ; then \ echo "The extracted target filesystem directory doesn't exist."; \ echo "Please run setup.sh in the SDK's root directory and then try again."; \ exit 1; \ fi @cd board-support/extra-drivers; \ cd `find . -maxdepth 1 -type d -name "cryptodev*"`; \ make ARCH=arm64 KERNEL_DIR=$(LINUXKERNEL_INSTALL_DIR) INSTALL_MOD_PATH=$(DESTDIR) PREFIX=$(SDK_PATH_TARGET) INSTALL_MOD_STRIP=$(INSTALL_MOD_STRIP) install # Define the following to support multple platforms PLATFORM_TYPE_$(PLATFORM) = gp PLATFORM_TYPE_am65xx-hs-evm = hs PLATFORM_TYPE_j7-hs-evm = hs PLATFORM_TYPE = $(PLATFORM_TYPE_$(PLATFORM)) SYSFW_CONFIG = evm SYSFW_SOC_$(PLATFORM) = NULL SYSFW_SOC_am65xx-evm = am65x SYSFW_SOC_am65xx-hs-evm = am65x SYSFW_SOC_j7-evm = j721e SYSFW_SOC_j7-hs-evm = j721e SYSFW_SOC_j7200-evm = j7200 SYSFW_SOC = $(SYSFW_SOC_$(PLATFORM)) SYSFW_PREFIX_$(PLATFORM) = NULL SYSFW_PREFIX_am65xx-evm = ti-sci-firmware SYSFW_PREFIX_am65xx-hs-evm = ti-sci-firmware SYSFW_PREFIX_j7-evm = ti-fs-firmware SYSFW_PREFIX_j7-hs-evm = ti-fs-firmware SYSFW_PREFIX_j7200-evm = ti-fs-firmware SYSFW_PREFIX = $(SYSFW_PREFIX_$(PLATFORM)) ifeq ($(SYSFW_SOC),j7200) SYSFW_BASE = tiboot3 else SYSFW_BASE = $(SYSFW_PREFIX)-$(SYSFW_SOC)-$(PLATFORM_TYPE) endif SYSFW_MAKEARGS_common = SYSFW_DL_URL="" SYSFW_HS_DL_URL="" SYSFW_HS_INNER_CERT_DL_URL="" \ SYSFW_PATH=$(TI_SDK_PATH)/board-support/prebuilt-images/$(SYSFW_BASE).bin \ SOC=$(SYSFW_SOC) CONFIG=$(SYSFW_CONFIG) SYSFW_MAKEARGS_gp = SYSFW_MAKEARGS_hs = HS=1 SYSFW_HS_PATH=$(TI_SDK_PATH)/board-support/prebuilt-images/$(SYSFW_BASE)-enc.bin \ SYSFW_HS_INNER_CERT_PATH=$(TI_SDK_PATH)/board-support/prebuilt-images/$(SYSFW_BASE)-cert.bin SYSFW_MAKEARGS = $(SYSFW_MAKEARGS_common) $(SYSFW_MAKEARGS_$(PLATFORM_TYPE)) # Depend on linux-dtbs for the dtc utility sysfw-image: linux-dtbs @echo ============================= @echo Building SYSFW Image @echo ============================= @cd board-support; cd `find . -maxdepth 1 -type d -name "*k3-image*"`; \ make $(SYSFW_MAKEARGS) CROSS_COMPILE=$(CROSS_COMPILE_ARMV7) PATH=$(PATH):$(LINUXKERNEL_INSTALL_DIR)/scripts/dtc SOC=$(SYSFW_SOC) sysfw-image_clean: @echo ============================= @echo Cleaning SYSFW Image @echo ============================= @cd board-support; cd `find . -maxdepth 1 -type d -name "*k3-image*"`; make clean SOC=$(SYSFW_SOC) sysfw-image_install: @echo ============================= @echo Installing SYSFW Image @echo ============================= @echo "Nothing to do" # jailhouse module JH_ARCH = "arm64" JH_PLATFORM = "k3" jailhouse_config: @echo ===================================== @echo Configuring jailhouse @echo ===================================== @cd board-support/extra-drivers; \ cd `find . -maxdepth 1 -name "jailhouse*" -type d`; \ echo "#define CONFIG_TRACE_ERROR 1" >> include/jailhouse/config.h jailhouse: linux jailhouse_config @echo ===================================== @echo Building jailhouse @echo ===================================== @cd board-support/extra-drivers; \ cd `find . -maxdepth 1 -name "jailhouse*" -type d`; \ make ARCH=$(JH_ARCH) KDIR=${LINUXKERNEL_INSTALL_DIR} jailhouse_clean: @echo ===================================== @echo Cleaning jailhouse @echo ===================================== @cd board-support/extra-drivers; \ cd `find . -maxdepth 1 -name "jailhouse*" -type d`; \ make ARCH=$(JH_ARCH) KDIR=${LINUXKERNEL_INSTALL_DIR} clean jailhouse_distclean: jailhouse_clean @echo ===================================== @echo Distclean jailhouse @echo ===================================== @cd board-support/extra-drivers; \ cd `find . -maxdepth 1 -name "jailhouse*" -type d`; \ rm -vf ./hypervisor/include/jailhouse/config.h jailhouse_install: @echo ================================ @echo Installing jailhouse @echo ================================ @cd board-support/extra-drivers; \ cd `find . -maxdepth 1 -name "jailhouse*" -type d`; \ make ARCH=$(JH_ARCH) KDIR=${LINUXKERNEL_INSTALL_DIR} DESTDIR=$(DESTDIR) INSTALL_MOD_STRIP=$(INSTALL_MOD_STRIP) prefix=/usr install # ti-img-rogue-driver ti-img-rogue-driver: linux @echo ===================================== @echo Building ti-img-rogue-driver @echo ===================================== @cd board-support/extra-drivers; \ cd `find . -maxdepth 1 -type d -name "ti-img-rogue-driver*" -type d`; \ make ARCH=arm64 KERNELDIR=${LINUXKERNEL_INSTALL_DIR} RGX_BVNC="22.104.208.318" BUILD=release PVR_BUILD_DIR=j721e_linux WINDOW_SYSTEM=wayland ti-img-rogue-driver_clean: @echo ==================================== @echo Cleaning ti-img-rogue-driver @echo ==================================== @cd board-support/extra-drivers; \ cd `find . -maxdepth 1 -type d -name "ti-img-rogue-driver*" -type d`; \ make ARCH=arm64 KERNELDIR=${LINUXKERNEL_INSTALL_DIR} RGX_BVNC="22.104.208.318" BUILD=release PVR_BUILD_DIR=j721e_linux WINDOW_SYSTEM=wayland clean ti-img-rogue-driver_install: @echo ==================================== @echo Installing ti-img-rogue-driver @echo ==================================== @cd board-support/extra-drivers; \ cd `find . -maxdepth 1 -type d -name "ti-img-rogue-driver*" -type d`; \ cd binary_j721e_linux_wayland_release/target_aarch64/kbuild; \ make -C ${LINUXKERNEL_INSTALL_DIR} INSTALL_MOD_PATH=${DESTDIR} INSTALL_MOD_STRIP=${INSTALL_MOD_STRIP} M=`pwd` modules_install oob-demo: oob-demo_clean: oob-demo_install: @echo ============================= @echo Updating oob-demo wallpaper @echo ============================= sed -i 's%background-image.*%background-image=/usr/share/demo/j7-evm-p0-wallpaper.jpg%' $(DESTDIR)/etc/weston.ini # u-boot build targets u-boot-spl-j7: u-boot u-boot-spl-j7_clean: u-boot_clean u-boot-spl-j7_install: u-boot_install UBOOT_SYSFW=$(TI_SDK_PATH)/board-support/prebuilt-images/sysfw.bin ifeq ($(PLATFORM),j7-evm) UBOOT_A72_BUILD_DIR=$(TI_SDK_PATH)/board-support/u-boot_build/a72 UBOOT_R5_BUILD_DIR=$(TI_SDK_PATH)/board-support/u-boot_build/r5 UBOOT_ATF=$(TI_SDK_PATH)/board-support/prebuilt-images/bl31.bin UBOOT_TEE=$(TI_SDK_PATH)/board-support/prebuilt-images/bl32.bin #UBOOT_DM=$(TI_SDK_PATH)/board-support/prebuilt-images/ipc_echo_testb_mcu1_0_release_strip.xer5f #UBOOT_DM=/home/ketaki/Downloads/UART_j721e_evm_mcu1_0TestApp_release_strip.xer5f UBOOT_DM=/home/ketaki/ti-processor-sdk-rtos-j721e-evm-07_03_00_07/pdk_jacinto_07_03_00_29/packages/ti/binary/UART_TestApp/bin/j721e_evm/UART_j721e_evm_mcu1_0TestApp_release_strip.xer5f else UBOOT_A72_BUILD_DIR=$(TI_SDK_PATH)/board-support/u-boot_hs_build/a72 UBOOT_R5_BUILD_DIR=$(TI_SDK_PATH)/board-support/u-boot_hs_build/r5 UBOOT_ATF=$(TI_SDK_PATH)/board-support/prebuilt-images/bl31.bin.signed UBOOT_TEE=$(TI_SDK_PATH)/board-support/prebuilt-images/bl32.bin.signed UBOOT_DM=$(TI_SDK_PATH)/board-support/prebuilt-images/ipc_echo_testb_mcu1_0_release_strip.xer5f.signed endif u-boot: u-boot-a72 u-boot-r5 u-boot_clean: u-boot-a72_clean u-boot-r5_clean u-boot-a72: @echo =================================== @echo Building U-boot for A72 @echo =================================== $(MAKE) -j $(MAKE_JOBS) -C $(TI_SDK_PATH)/board-support/u-boot-* CROSS_COMPILE=$(CROSS_COMPILE) \ $(UBOOT_MACHINE) O=$(UBOOT_A72_BUILD_DIR) $(MAKE) -j $(MAKE_JOBS) -C $(TI_SDK_PATH)/board-support/u-boot-* CROSS_COMPILE=$(CROSS_COMPILE) \ CONFIG_MKIMAGE_DTC_PATH=$(UBOOT_A72_BUILD_DIR)/scripts/dtc/dtc \ ATF=$(UBOOT_ATF) TEE=$(UBOOT_TEE) DM=$(UBOOT_DM) \ O=$(UBOOT_A72_BUILD_DIR) u-boot-a72_clean: @echo =================================== @echo Cleaining U-boot for A72 @echo =================================== $(MAKE) -C $(TI_SDK_PATH)/board-support/u-boot-* CROSS_COMPILE=$(CROSS_COMPILE) \ O=$(UBOOT_A72_BUILD_DIR) distclean @rm -rf $(UBOOT_A72_BUILD_DIR) u-boot-r5: @echo =================================== @echo Building U-boot for R5 @echo =================================== $(MAKE) -j $(MAKE_JOBS) -C $(TI_SDK_PATH)/board-support/u-boot-* CROSS_COMPILE=$(CROSS_COMPILE_ARMV7) \ $(UBOOT_MACHINE_R5) O=$(UBOOT_R5_BUILD_DIR) $(MAKE) -j $(MAKE_JOBS) -C $(TI_SDK_PATH)/board-support/u-boot-* CROSS_COMPILE=$(CROSS_COMPILE_ARMV7) \ O=$(UBOOT_R5_BUILD_DIR) u-boot-r5_clean: @echo =================================== @echo Cleaining U-boot for R5 @echo =================================== $(MAKE) -C $(TI_SDK_PATH)/board-support/u-boot-* CROSS_COMPILE=$(CROSS_COMPILE_ARMV7) \ O=$(UBOOT_R5_BUILD_DIR) distclean @rm -rf $(UBOOT_R5_BUILD_DIR) u-boot_install: @echo =================================== @echo Installing U-boot @echo =================================== @echo "Nothing to do" # ti-img-encode-decode ti-img-encode-decode: linux @echo ===================================== @echo Building ti-img-encode-decode @echo ===================================== @cd board-support/extra-drivers; \ cd `find . -maxdepth 1 -type d -name "ti-img-encode-decode*" -type d`; \ cd linux/decoder; \ make ARCH=arm64 KPATH=${LINUXKERNEL_INSTALL_DIR} all; \ cd ../encoder; \ make ARCH=arm64 KPATH=${LINUXKERNEL_INSTALL_DIR} all ti-img-encode-decode_clean: @echo ==================================== @echo Cleaning ti-img-encode-decode @echo ==================================== @cd board-support/extra-drivers; \ cd `find . -maxdepth 1 -type d -name "ti-img-encode-decode*" -type d`; \ cd linux/decoder; \ make ARCH=arm64 KPATH=${LINUXKERNEL_INSTALL_DIR} clean; \ cd ../encoder; \ make ARCH=arm64 KPATH=${LINUXKERNEL_INSTALL_DIR} clean ti-img-encode-decode_install: @echo ==================================== @echo Installing ti-img-encode-decode @echo ==================================== @cd board-support/extra-drivers; \ cd `find . -maxdepth 1 -type d -name "ti-img-encode-decode*" -type d`; \ cd linux/decoder; \ make -C ${LINUXKERNEL_INSTALL_DIR} INSTALL_MOD_PATH=${DESTDIR} INSTALL_MOD_STRIP=${INSTALL_MOD_STRIP} M=`pwd` modules_install; \ cd ../encoder; \ make -C ${LINUXKERNEL_INSTALL_DIR} INSTALL_MOD_PATH=${DESTDIR} INSTALL_MOD_STRIP=${INSTALL_MOD_STRIP} M=`pwd` modules_install