Skip to contentSkip to conversation

machine: k3.inc: add new SOC family definition for K3

PATCH New Denys Dmytriyenko 1 participant 5 messages Jun 17, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/5 machine: k3.inc: add new SOC family definition for K3

The AM654 SoC is a lead device of the K3 Multicore SoC architecture platform, targeted for broad market and industrial control with aim to meet the complex processing needs of modern embedded products.

See AM65x Technical Reference Manual (SPRUID7, April 2018) for further details: http://www.ti.com/lit/pdf/spruid7

---
 conf/machine/include/k3.inc | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 conf/machine/include/k3.inc
conf/machine/include/k3.inc new file +32 -0
new file mode 100644
index 0000000..96699db
@@ -0,0 +1,32 @@
+require conf/machine/include/ti-soc.inc
+SOC_FAMILY_append = ":k3"
+
+require conf/machine/include/arm/arch-arm64.inc
+
+# Increase this everytime you change something in the kernel
+MACHINE_KERNEL_PR = "r0"
+
+PREFERRED_PROVIDER_virtual/kernel = "linux-ti-staging"
+PREFERRED_PROVIDER_virtual/bootloader = "u-boot-ti-staging"
+PREFERRED_PROVIDER_u-boot = "u-boot-ti-staging"
+
+KERNEL_IMAGETYPE = "Image"
+KERNEL_IMAGETYPES = "Image vmlinux.gz"
+
+UBOOT_ARCH = "arm"
+UBOOT_ENTRYPOINT = "0x80008000"
+UBOOT_LOADADDRESS = "0x80008000"
+
+EXTRA_IMAGEDEPENDS += " \
+    virtual/bootloader \
+"
+
+MACHINE_GUI_CLASS = "smallscreen"
+
+# Use the expected value of the ubifs filesystem's volume name in the kernel
+# and u-boot.
+UBI_VOLNAME = "rootfs"
+
+# List common SoC features, may need to add touchscreen for specific machines
+MACHINE_FEATURES = "kernel26 apm usbgadget usbhost vfat ext2 screen alsa ethernet pci"
+# Not ready yet - sgx dsp mmip
Signature · 1 line
2.7.4
#1 lore raw

PATCH 2/5 machine: am65xx-evm.conf: add machine definition for AM65xx platform

The AM654 SoC is a lead device of the K3 Multicore SoC architecture platform, targeted for broad market and industrial control with aim to meet the complex processing needs of modern embedded products.

See AM65x Technical Reference Manual (SPRUID7, April 2018) for further details: http://www.ti.com/lit/pdf/spruid7

---
 conf/machine/am65xx-evm.conf | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 conf/machine/am65xx-evm.conf
conf/machine/am65xx-evm.conf new file +24 -0
new file mode 100644
index 0000000..6b3bdec
@@ -0,0 +1,24 @@
+#@TYPE: Machine
+#@NAME: AM65xx EVM
+#@DESCRIPTION: Machine configuration for the TI AM65xx EVM
+
+require conf/machine/include/k3.inc
+
+MACHINE_FEATURES += "touchscreen"
+
+IMAGE_FSTYPES += "tar.xz cpio cpio.xz wic.xz"
+
+SERIAL_CONSOLE = "115200 ttyS2"
+
+KERNEL_DEVICETREE = "ti/k3-am654-base-board.dtb"
+
+UBOOT_MACHINE = "am65x_evm_a53_defconfig"
+
+OPTEEMACHINE = "k3"
+OPTEEFLAVOR = "am65x"
+OPTEEOUTPUTMACHINE = "k3"
+
+WKS_FILE = "sdimage-bootpart.wks"
+IMAGE_BOOT_FILES = "u-boot.img"
+
+do_image_wic[depends] += "mtools-native:do_populate_sysroot dosfstools-native:do_populate_sysroot"
Signature · 1 line
2.7.4
#2 lore raw

PATCH 3/5 arm-trusted-firmware: add version 1.5 of ATF with K3 support

In reply to Denys Dmytriyenko
---
 .../arm-trusted-firmware_1.5.bb                    | 61 ++++++++++++++++++++++
 1 file changed, 61 insertions(+)
 create mode 100644 recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_1.5.bb
recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_1.5.bb new file +61 -0
new file mode 100644
index 0000000..5a7fd21
@@ -0,0 +1,61 @@
+SUMMARY = "ARM Trusted Firmware"
+DESCRIPTION = "ARM Trusted Firmware provides a reference implementation of \
+Secure World software for ARMv8-A, including Exception Level 3 (EL3) software. \
+It provides implementations of various ARM interface standards such as the \
+Power State Coordination Interface (PSCI), Trusted Board Boot Requirements \
+(TBBR) and Secure monitor code."
+HOMEPAGE = "http://infocenter.arm.com/help/topic/com.arm.doc.dui0928e/CJHIDGJF.html"
+
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://license.rst;md5=e927e02bca647e14efd87e9e914b2443"
+
+inherit deploy
+
+DEPENDS += "dtc-native"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+S = "${WORKDIR}/git"
+
+PV_append = "+git${SRCPV}"
+
+BRANCH = "ti-atf"
+SRC_URI = "git://git.ti.com/atf/arm-trusted-firmware.git;branch=${BRANCH}"
+
+SRCREV ?= "5a0daebab6bf72b27cc74151d4e596247f804e44"
+
+# Make ATF "aware" of OPTEE, no build dependency
+PACKAGECONFIG[optee] = "SPD=opteed"
+
+COMPATIBLE_MACHINE = "k3"
+ATFPLATFORM_k3 = "k3"
+ATFBOARD_k3 = "generic"
+
+PACKAGECONFIG_k3 = "optee"
+
+CFLAGS[unexport] = "1"
+LDFLAGS[unexport] = "1"
+AS[unexport] = "1"
+LD[unexport] = "1"
+
+do_configure[noexec] = "1"
+
+EXTRA_OEMAKE = 'CROSS_COMPILE="${TARGET_PREFIX}" PLAT="${ATFPLATFORM}" TARGET_BOARD="${ATFBOARD}" ${PACKAGECONFIG_CONFARGS}'
+
+do_compile() {
+	oe_runmake all
+}
+
+do_install() {
+	install -d ${D}/boot
+	install -m 0644 ${S}/build/${ATFPLATFORM}/${ATFBOARD}/release/bl31.bin ${D}/boot/
+}
+
+do_deploy() {
+	install -d ${DEPLOYDIR}
+	install -m 0644 ${S}/build/${ATFPLATFORM}/${ATFBOARD}/release/bl31.bin ${DEPLOYDIR}/
+}
+addtask deploy before do_build after do_compile
+
+FILES_${PN} = "/boot"
+SYSROOT_DIRS += "/boot"
Signature · 1 line
2.7.4
#3 lore raw

PATCH 4/5 linux-ti-staging: add defconfigs for K3 SOC family

In reply to Denys Dmytriyenko
---
 recipes-kernel/linux/linux-ti-staging-4.14/k3/defconfig         | 1 +
 recipes-kernel/linux/linux-ti-staging-systest-4.14/k3/defconfig | 1 +
 2 files changed, 2 insertions(+)
 create mode 100644 recipes-kernel/linux/linux-ti-staging-4.14/k3/defconfig
 create mode 100644 recipes-kernel/linux/linux-ti-staging-systest-4.14/k3/defconfig
recipes-kernel/linux/linux-ti-staging-4.14/k3/defconfig new file +1 -0
new file mode 100644
index 0000000..b9bc613
@@ -0,0 +1 @@
+use-tisdk-config=ti_sdk_arm64_release
recipes-kernel/linux/linux-ti-staging-systest-4.14/k3/defconfig new file +1 -0
new file mode 100644
index 0000000..56cf930
@@ -0,0 +1 @@
+use-tisdk-config=ti_sdk_arm64_debug
Signature · 1 line
2.7.4
#4 lore raw

PATCH 5/5 u-boot-ti-staging: add handling of K3 and AM65x on A53 side

In reply to Denys Dmytriyenko

Handle dependencies on ATF and OPTEE via PACKAGECONFIGs.

---
 recipes-bsp/u-boot/u-boot-ti-staging_2018.01.bb |  6 +++---
 recipes-bsp/u-boot/u-boot-ti.inc                | 27 +++++++++++++++++++++++++
 2 files changed, 30 insertions(+), 3 deletions(-)
recipes-bsp/u-boot/u-boot-ti-staging_2018.01.bb +3 -3
index 14b5e4d..8f79fe5 100644
@@ -1,7 +1,7 @@
 require u-boot-ti.inc
 
-PR = "r10"
+PR = "r11"
 
-BRANCH = "ti-u-boot-2018.01"
+BRANCH = "ti-u-boot-2018.01-next"
 
-SRCREV = "3c49934f57ead2da6b6a0a2345d576ba2735687c"
+SRCREV = "6e9cffd6e111df6f9122b4a77c71112981feb9d3"
recipes-bsp/u-boot/u-boot-ti.inc +27 -0
index 666d7ae..4fd3529 100644
@@ -29,6 +29,12 @@ PV_append = "+git${SRCPV}"
 # u-boot needs devtree compiler to parse dts files
 DEPENDS += "dtc-native bc-native lzop-native"
 
+PACKAGECONFIG[atf] = "ATF=${STAGING_DIR_HOST}/boot/bl31.bin,,arm-trusted-firmware"
+PACKAGECONFIG[optee] = "TEE=${STAGING_DIR_HOST}/boot/bl32.bin,,optee-os"
+
+# optee-os is not a direct dependency, do not enable optee by default
+PACKAGECONFIG_append_k3 = " atf"
+
 PROVIDES += "u-boot"
 PKG_${PN} = "u-boot"
 PKG_${PN}-dev = "u-boot-dev"
@@ -47,10 +53,12 @@ SPL_BINARY_k2hk-hs-evm = ""
 SPL_BINARY_k2g-hs-evm = ""
 SPL_BINARY_k2l-hs-evm = ""
 SPL_BINARY_omapl138 = ""
+SPL_BINARY_k3 = "tispl.bin"
 
 # SPL (Second Program Loader) to be loaded over UART
 SPL_UART_BINARY = "u-boot-spl.bin"
 SPL_UART_BINARY_keystone = ""
+SPL_UART_BINARY_k3 = ""
 
 SPL_UART_IMAGE ?= "${SPL_UART_BINARY}-${MACHINE}-${PV}-${PR}"
 SPL_UART_SYMLINK ?= "${SPL_UART_BINARY}-${MACHINE}"
@@ -99,6 +107,25 @@ UBOOT_HS_2ND_BINARY = "u-boot-spl_HS_2ND"
 UBOOT_HS_2ND_IMAGE = "u-boot-spl_HS_2ND-${MACHINE}-${PV}-${PR}"
 UBOOT_HS_2ND_SYMLINK = "u-boot-spl_HS_2ND-${MACHINE}"
 
+do_compile_k3 () {
+	if [ "${@bb.utils.filter('DISTRO_FEATURES', 'ld-is-gold', d)}" ]; then
+		sed -i 's/$(CROSS_COMPILE)ld$/$(CROSS_COMPILE)ld.bfd/g' ${S}/config.mk
+	fi
+
+	unset LDFLAGS
+	unset CFLAGS
+	unset CPPFLAGS
+
+	if [ ! -e ${B}/.scmversion -a ! -e ${S}/.scmversion ]
+	then
+		echo ${UBOOT_LOCALVERSION} > ${B}/.scmversion
+		echo ${UBOOT_LOCALVERSION} > ${S}/.scmversion
+	fi
+
+	oe_runmake -C ${S} O=${B} ${UBOOT_MACHINE}
+	oe_runmake -C ${S} O=${B} ${PACKAGECONFIG_CONFARGS} ${UBOOT_MAKE_TARGET}
+}
+
 do_install_append () {
 	if [ -n "${UBOOT_CONFIG}" ]
 	then
Signature · 1 line
2.7.4