summaryrefslogtreecommitdiffstats
path: root/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees.inc
blob: 77d0081280fafff1875f9f8c4c3ca0d6bb72796f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
SUMMARY = "Xilinx's hardware device trees required for QEMU"
HOMEPAGE = "https://github.com/xilinx/qemu-devicetrees/"
LICENSE = "BSD-3-Clause"
DEPENDS += "dtc-native"

inherit deploy

LIC_FILES_CHKSUM = "file://Makefile;beginline=1;endline=27;md5=7348b6cbcae69912cb1dee68d6c68d99"

PV .= "+git"

REPO ?= "git://github.com/Xilinx/qemu-devicetrees.git;protocol=https"

BRANCHARG = "${@['nobranch=1', 'branch=${BRANCH}'][d.getVar('BRANCH', True) != '']}"
SRC_URI = "${REPO};${BRANCHARG}"

SRC_URI += "file://0001-versal-Reorder-serial-ports.patch"
SRC_URI += "file://0001-versal-net-Reorder-serial-port.patch"

S = "${WORKDIR}/git"

# Don't do anything for target or native
do_install() {
	:
}

# Nativesdk bundle the device trees for the SDK
do_install:class-nativesdk() {
	# single-arch dtbs
	for DTS_FILE in ${S}/LATEST/SINGLE_ARCH/*.dtb; do
		install -Dm 0644 $DTS_FILE ${D}/${base_prefix}/qemu-hw-devicetrees/$(basename $DTS_FILE .dtb).dtb
	done

	# multi-arch dtbs
	for DTS_FILE in ${S}/LATEST/MULTI_ARCH/*.dtb; do
		install -Dm 0644 $DTS_FILE ${D}/${base_prefix}/qemu-hw-devicetrees/multiarch/$(basename $DTS_FILE .dtb).dtb
	done
}

do_deploy:class-native() {
	# single-arch dtbs
	for DTS_FILE in ${S}/LATEST/SINGLE_ARCH/*.dtb; do
		install -Dm 0644 $DTS_FILE ${DEPLOYDIR}/qemu-hw-devicetrees/$(basename $DTS_FILE .dtb).dtb
	done

	# multi-arch dtbs
	for DTS_FILE in ${S}/LATEST/MULTI_ARCH/*.dtb; do
		install -Dm 0644 $DTS_FILE ${DEPLOYDIR}/qemu-hw-devicetrees/multiarch/$(basename $DTS_FILE .dtb).dtb
	done
}

# Disable deploy in nativesdk!
do_deploy() {
	:
}

FILES:${PN}:class-nativesdk = "${base_prefix}/qemu-hw-devicetrees"

addtask deploy after do_install before do_build

COMPATIBLE_HOST:class-target = "none"
BBCLASSEXTEND = "native nativesdk"