* Add a custom U-Boot target for k3 as there are multiple differences
  from previous machines:
  - Two U-Boot images. One for A53, one for R5.
  - Each U-Boot image is combined into a fitImage with other images
   (e.g. ATF, OPTEE, SYSFW).
* Also make additions to the Rules.make as the R5 uses the armv7
  toolchain while the A53 uses the armv8 toolchain.

Signed-off-by: Jacob Stiffler <[email protected]>
---
 .../ti-tisdk-makefile/k3/Makefile_u-boot-spl       | 61 ++++++++++++++++++++++
 .../ti-tisdk-makefile/ti-tisdk-makefile_1.0.bb     |  9 ++++
 2 files changed, 70 insertions(+)
 create mode 100644 
meta-arago-distro/recipes-tisdk/ti-tisdk-makefile/ti-tisdk-makefile/k3/Makefile_u-boot-spl

diff --git 
a/meta-arago-distro/recipes-tisdk/ti-tisdk-makefile/ti-tisdk-makefile/k3/Makefile_u-boot-spl
 
b/meta-arago-distro/recipes-tisdk/ti-tisdk-makefile/ti-tisdk-makefile/k3/Makefile_u-boot-spl
new file mode 100644
index 0000000..7a0ec22
--- /dev/null
+++ 
b/meta-arago-distro/recipes-tisdk/ti-tisdk-makefile/ti-tisdk-makefile/k3/Makefile_u-boot-spl
@@ -0,0 +1,61 @@
+
+# u-boot build targets
+u-boot-spl: u-boot
+u-boot-spl_clean: u-boot_clean
+u-boot-spl_install: u-boot_install
+
+UBOOT_A53_BUILD_DIR=$(TI_SDK_PATH)/board-support/u-boot_build/a53
+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_SYSFW=$(TI_SDK_PATH)/board-support/prebuilt-images/sysfw.bin
+
+u-boot: u-boot-a53 u-boot-r5
+u-boot_clean: u-boot-a53_clean u-boot-r5_clean
+
+u-boot-a53:
+       @echo ===================================
+       @echo    Building U-boot for A53
+       @echo ===================================
+       $(MAKE) -j $(MAKE_JOBS) -C $(TI_SDK_PATH)/board-support/u-boot-* 
CROSS_COMPILE=$(CROSS_COMPILE) \
+                $(UBOOT_MACHINE) O=$(UBOOT_A53_BUILD_DIR)
+       $(MAKE) -j $(MAKE_JOBS) -C $(TI_SDK_PATH)/board-support/u-boot-* 
CROSS_COMPILE=$(CROSS_COMPILE) \
+               CONFIG_MKIMAGE_DTC_PATH=$(UBOOT_A53_BUILD_DIR)/scripts/dtc/dtc \
+               ATF=$(UBOOT_ATF) TEE=$(UBOOT_TEE) \
+               O=$(UBOOT_A53_BUILD_DIR)
+
+u-boot-a53_clean:
+       @echo ===================================
+       @echo    Cleaining U-boot for A53
+       @echo ===================================
+       $(MAKE) -C $(TI_SDK_PATH)/board-support/u-boot-* 
CROSS_COMPILE=$(CROSS_COMPILE) \
+               O=$(UBOOT_A53_BUILD_DIR) distclean
+       @rm -rf $(UBOOT_A53_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) \
+               CONFIG_MKIMAGE_DTC_PATH=$(UBOOT_R5_BUILD_DIR)/scripts/dtc/dtc \
+               SYSFW=$(UBOOT_SYSFW) \
+               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"
+
diff --git 
a/meta-arago-distro/recipes-tisdk/ti-tisdk-makefile/ti-tisdk-makefile_1.0.bb 
b/meta-arago-distro/recipes-tisdk/ti-tisdk-makefile/ti-tisdk-makefile_1.0.bb
index f296ffa..75a9392 100644
--- a/meta-arago-distro/recipes-tisdk/ti-tisdk-makefile/ti-tisdk-makefile_1.0.bb
+++ b/meta-arago-distro/recipes-tisdk/ti-tisdk-makefile/ti-tisdk-makefile_1.0.bb
@@ -282,6 +282,15 @@ do_install () {
 
 }
 
+do_install_append_k3() {
+    cat >> ${D}/Rules.make << __EOF__
+
+# Add CROSS_COMPILE and UBOOT_MACHINE for the R5
+export 
CROSS_COMPILE_ARMV7=\$(LINUX_DEVKIT_PATH)/sysroots/${SDKMACHINE}-arago-linux/usr/bin/arm-linux-gnueabihf-
+UBOOT_MACHINE_R5=am65x_evm_r5_defconfig
+__EOF__
+}
+
 PACKAGE_ARCH = "${MACHINE_ARCH}"
 
 FILES_${PN} = "/*"
-- 
2.7.4

_______________________________________________
meta-arago mailing list
[email protected]
http://arago-project.org/cgi-bin/mailman/listinfo/meta-arago

Reply via email to