aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Dechesne <ndechesne@users.noreply.github.com>2021-04-13 16:39:35 +0200
committerGitHub <noreply@github.com>2021-04-13 16:39:35 +0200
commit3308aeaf24fde21ddde8ccac087211ea3d73155a (patch)
tree37211062f6eab2dc51340d1651a8e05b169b06e8
parenta3117ad80252e83a72fad8fce23cc83148f6d8ec (diff)
parentd6d7f201475236d36bbdf4c5037d2b571aa68ce7 (diff)
downloadmeta-qcom-dunfell.tar.gz
meta-qcom-dunfell.tar.bz2
meta-qcom-dunfell.zip
Merge pull request #299 from lumag/qcom-armv8a-dunfelldunfell
Qcom-armv8a machine implementation for dunfell
-rw-r--r--conf/machine/dragonboard-845c.conf1
-rw-r--r--conf/machine/include/qcom-apq8016.inc3
-rw-r--r--conf/machine/include/qcom-apq8064.inc3
-rw-r--r--conf/machine/include/qcom-apq8096.inc3
-rw-r--r--conf/machine/include/qcom-common.inc2
-rw-r--r--conf/machine/include/qcom-qcs404.inc3
-rw-r--r--conf/machine/include/qcom-sdm845.inc3
-rw-r--r--conf/machine/include/qcom-sm8250.inc3
-rw-r--r--conf/machine/qcom-armv8a.conf47
-rw-r--r--conf/machine/qrb5165-rb5.conf3
-rw-r--r--recipes-bsp/firmware/firmware-qcom-dragonboard410c-bootloader-sdcard_17.09.bb1
-rw-r--r--recipes-bsp/firmware/firmware-qcom-dragonboard410c_1034.2.1.bb7
-rw-r--r--recipes-bsp/firmware/firmware-qcom-dragonboard820c_01700.1.bb7
-rw-r--r--recipes-bsp/firmware/firmware-qcom-dragonboard845c_20190529180356-v4.bb7
-rw-r--r--recipes-bsp/firmware/firmware-qcom-sd-600eval_1.0.bb1
-rw-r--r--recipes-kernel/linux/linux-linaro-qcom.inc10
-rw-r--r--recipes-kernel/linux/linux-linaro-qcomlt_5.10.bb2
-rw-r--r--recipes-kernel/linux/linux-linaro-qcomlt_5.7.bb2
-rw-r--r--recipes-kernel/linux/linux-linaro-qcomlt_5.9.bb2
-rw-r--r--recipes-kernel/linux/linux-qcom-bootimg.inc139
20 files changed, 160 insertions, 89 deletions
diff --git a/conf/machine/dragonboard-845c.conf b/conf/machine/dragonboard-845c.conf
index 8391ef6..e5f0755 100644
--- a/conf/machine/dragonboard-845c.conf
+++ b/conf/machine/dragonboard-845c.conf
@@ -8,6 +8,7 @@ MACHINE_FEATURES = "usbhost usbgadget alsa screen wifi bluetooth ext2"
KERNEL_IMAGETYPE ?= "Image.gz"
KERNEL_DEVICETREE ?= "qcom/sdm845-db845c.dtb"
+KERNEL_CMDLINE_EXTRA ?= "clk_ignore_unused pd_ignore_unused"
SERIAL_CONSOLE ?= "115200 ttyMSM0"
diff --git a/conf/machine/include/qcom-apq8016.inc b/conf/machine/include/qcom-apq8016.inc
index 80e097b..a073ae7 100644
--- a/conf/machine/include/qcom-apq8016.inc
+++ b/conf/machine/include/qcom-apq8016.inc
@@ -9,3 +9,6 @@ MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += " \
MACHINE_EXTRA_RRECOMMENDS += " \
fastrpc \
"
+
+# Android boot image settings
+QCOM_BOOTIMG_PAGE_SIZE = "2048"
diff --git a/conf/machine/include/qcom-apq8064.inc b/conf/machine/include/qcom-apq8064.inc
index 96f880c..af8e87a 100644
--- a/conf/machine/include/qcom-apq8064.inc
+++ b/conf/machine/include/qcom-apq8064.inc
@@ -1,3 +1,6 @@
SOC_FAMILY = "apq8064"
require conf/machine/include/qcom-common.inc
require conf/machine/include/tune-cortexa8.inc
+
+# Android boot image settings
+QCOM_BOOTIMG_PAGE_SIZE = "2048"
diff --git a/conf/machine/include/qcom-apq8096.inc b/conf/machine/include/qcom-apq8096.inc
index 4f62b59..8038091 100644
--- a/conf/machine/include/qcom-apq8096.inc
+++ b/conf/machine/include/qcom-apq8096.inc
@@ -10,6 +10,3 @@ MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += " \
MACHINE_EXTRA_RRECOMMENDS += " \
fastrpc \
"
-
-# Android boot image settings
-QCOM_BOOTIMG_PAGE_SIZE = "4096"
diff --git a/conf/machine/include/qcom-common.inc b/conf/machine/include/qcom-common.inc
index d2434f9..fd86574 100644
--- a/conf/machine/include/qcom-common.inc
+++ b/conf/machine/include/qcom-common.inc
@@ -30,4 +30,4 @@ IMAGE_ROOTFS_ALIGNMENT ?= "4096"
# Android boot image settings
QCOM_BOOTIMG_KERNEL_BASE ?= "0x80000000"
-QCOM_BOOTIMG_PAGE_SIZE ?= "2048"
+QCOM_BOOTIMG_PAGE_SIZE ?= "4096"
diff --git a/conf/machine/include/qcom-qcs404.inc b/conf/machine/include/qcom-qcs404.inc
index eacc03c..90f9acb 100644
--- a/conf/machine/include/qcom-qcs404.inc
+++ b/conf/machine/include/qcom-qcs404.inc
@@ -5,6 +5,3 @@ require conf/machine/include/arm/arch-armv8a.inc
MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += " \
qrtr \
"
-
-# Android boot image settings
-QCOM_BOOTIMG_PAGE_SIZE = "4096"
diff --git a/conf/machine/include/qcom-sdm845.inc b/conf/machine/include/qcom-sdm845.inc
index ab99f39..43dded1 100644
--- a/conf/machine/include/qcom-sdm845.inc
+++ b/conf/machine/include/qcom-sdm845.inc
@@ -12,6 +12,3 @@ MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += " \
MACHINE_EXTRA_RRECOMMENDS += " \
fastrpc \
"
-
-# Android boot image settings
-QCOM_BOOTIMG_PAGE_SIZE = "4096"
diff --git a/conf/machine/include/qcom-sm8250.inc b/conf/machine/include/qcom-sm8250.inc
index b077313..13bcf5b 100644
--- a/conf/machine/include/qcom-sm8250.inc
+++ b/conf/machine/include/qcom-sm8250.inc
@@ -12,6 +12,3 @@ MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += " \
MACHINE_EXTRA_RRECOMMENDS += " \
fastrpc \
"
-
-# Android boot image settings
-QCOM_BOOTIMG_PAGE_SIZE ?= "4096"
diff --git a/conf/machine/qcom-armv8a.conf b/conf/machine/qcom-armv8a.conf
new file mode 100644
index 0000000..58c9719
--- /dev/null
+++ b/conf/machine/qcom-armv8a.conf
@@ -0,0 +1,47 @@
+require conf/machine/include/qcom-common.inc
+require conf/machine/include/arm/arch-armv8a.inc
+
+MACHINE_FEATURES = "usbhost usbgadget alsa screen wifi bluetooth ext2"
+
+# UFS partitions in 820/845/RB5 setup with 4096 logical sector size
+EXTRA_IMAGECMD_ext4 += " -b 4096 "
+
+# Support for dragonboard{410, 820, 845}c, rb5
+KERNEL_IMAGETYPE ?= "Image.gz"
+SERIAL_CONSOLE ?= "115200 ttyMSM0"
+KERNEL_DEVICETREE ?= "qcom/apq8016-sbc.dtb qcom/apq8096-db820c.dtb qcom/sdm845-db845c.dtb qcom/qrb5165-rb5.dtb qcom/sm8250-rb5-dvt.dtb"
+
+QCOM_BOOTIMG_PAGE_SIZE[apq8016-sbc] = "2048"
+QCOM_BOOTIMG_ROOTFS = "/dev/sda1"
+QCOM_BOOTIMG_ROOTFS[apq8016-sbc] = "/dev/mmcblk0p14"
+SD_QCOM_BOOTIMG_ROOTFS[apq8016-sbc] = "/dev/mmcblk1p7"
+KERNEL_CMDLINE_EXTRA[sdm845-db845c] = "clk_ignore_unused pd_ignore_unused"
+
+# Userspace tools
+MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += " \
+ pd-mapper \
+ qrtr \
+ rmtfs \
+ tqftpserv \
+"
+
+MACHINE_EXTRA_RRECOMMENDS += " \
+ fastrpc \
+"
+
+# Modules and firmware for all supported machines
+MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += " \
+ kernel-modules \
+ firmware-qcom-dragonboard410c \
+ firmware-qcom-dragonboard820c \
+ firmware-qcom-dragonboard845c \
+ firmware-qcom-rb5 \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'linux-firmware-ath10k linux-firmware-ath11k linux-firmware-qcom-sdm845-modem wireless-regdb-static', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'linux-firmware-qca linux-firmware-qcom-sdm845-modem', '', d)} \
+ linux-firmware-qcom-sdm845-audio \
+ linux-firmware-qcom-sdm845-compute \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'linux-firmware-qcom-adreno-a3xx linux-firmware-qcom-adreno-a530 linux-firmware-qcom-adreno-a630', '', d)} \
+ linux-firmware-qcom-venus-1.8 \
+ linux-firmware-qcom-venus-4.2 \
+ linux-firmware-qcom-venus-5.2 \
+"
diff --git a/conf/machine/qrb5165-rb5.conf b/conf/machine/qrb5165-rb5.conf
index dc62570..f261075 100644
--- a/conf/machine/qrb5165-rb5.conf
+++ b/conf/machine/qrb5165-rb5.conf
@@ -7,7 +7,8 @@ require conf/machine/include/qcom-sm8250.inc
MACHINE_FEATURES = "usbhost usbgadget alsa screen wifi bluetooth ext2"
KERNEL_IMAGETYPE ?= "Image.gz"
-KERNEL_DEVICETREE ?= "qcom/qrb5165-rb5.dtb"
+KERNEL_DEVICETREE ?= "qcom/qrb5165-rb5.dtb qcom/sm8250-rb5-dvt.dtb"
+KERNEL_CMDLINE_EXTRA ?= "pcie_pme=nomsi"
SERIAL_CONSOLE ?= "115200 ttyMSM0"
diff --git a/recipes-bsp/firmware/firmware-qcom-dragonboard410c-bootloader-sdcard_17.09.bb b/recipes-bsp/firmware/firmware-qcom-dragonboard410c-bootloader-sdcard_17.09.bb
index 61ef441..3adaa37 100644
--- a/recipes-bsp/firmware/firmware-qcom-dragonboard410c-bootloader-sdcard_17.09.bb
+++ b/recipes-bsp/firmware/firmware-qcom-dragonboard410c-bootloader-sdcard_17.09.bb
@@ -9,7 +9,6 @@ SRC_URI = "https://releases.linaro.org/96boards/dragonboard410c/linaro/rescue/17
SRC_URI[md5sum] = "e15da2a623442d66587aea506599fb69"
SRC_URI[sha256sum] = "9885f915ebd4986432340cf1d03b8fd2bfdd97ad6a4a7466200fddbe41cdcf5c"
-COMPATIBLE_MACHINE = "(dragonboard-410c)"
PACKAGE_ARCH = "${MACHINE_ARCH}"
S = "${WORKDIR}"
diff --git a/recipes-bsp/firmware/firmware-qcom-dragonboard410c_1034.2.1.bb b/recipes-bsp/firmware/firmware-qcom-dragonboard410c_1034.2.1.bb
index ecdbed9..7ea3a7d 100644
--- a/recipes-bsp/firmware/firmware-qcom-dragonboard410c_1034.2.1.bb
+++ b/recipes-bsp/firmware/firmware-qcom-dragonboard410c_1034.2.1.bb
@@ -9,7 +9,6 @@ SRC_URI[sha256sum] = "46953b974c5c58c7ca66db414437c0268b033ac9d28127e98d9c4e1a49
DEPENDS += "mtools-native"
-COMPATIBLE_MACHINE = "(dragonboard-410c)"
PACKAGE_ARCH = "${MACHINE_ARCH}"
S = "${WORKDIR}/linux-board-support-package-r${PV}"
@@ -31,7 +30,7 @@ do_install() {
::image/modem.* ::image/mba.mbn ::image/wcnss.* ${D}${nonarch_base_libdir}/firmware/qcom/msm8916
install -d ${D}${sysconfdir}/
- install -m 0644 LICENSE ${D}${sysconfdir}/QCOM-LINUX-BOARD-SUPPORT-LICENSE
+ install -m 0644 LICENSE ${D}${sysconfdir}/QCOM-LINUX-BOARD-SUPPORT-LICENSE-${PN}
}
FILES_${PN} += "/boot/modem_fsg"
@@ -39,7 +38,3 @@ FILES_${PN} += "${nonarch_base_libdir}/firmware/wlan/*"
FILES_${PN} += "${nonarch_base_libdir}/firmware/qcom/msm8916/*"
INSANE_SKIP_${PN} += "arch"
-
-RPROVIDES_${PN} += "linux-firmware-qcom-license"
-RREPLACES_${PN} += "linux-firmware-qcom-license"
-RCONFLICTS_${PN} += "linux-firmware-qcom-license"
diff --git a/recipes-bsp/firmware/firmware-qcom-dragonboard820c_01700.1.bb b/recipes-bsp/firmware/firmware-qcom-dragonboard820c_01700.1.bb
index 952f574..494db0d 100644
--- a/recipes-bsp/firmware/firmware-qcom-dragonboard820c_01700.1.bb
+++ b/recipes-bsp/firmware/firmware-qcom-dragonboard820c_01700.1.bb
@@ -7,7 +7,6 @@ SRC_URI = "https://releases.linaro.org/96boards/dragonboard820c/qualcomm/firmwar
SRC_URI[md5sum] = "587138c5e677342db9a88d5c8747ec6c"
SRC_URI[sha256sum] = "6ee9c461b2b5dd2d3bd705bb5ea3f44b319ecb909b2772f305ce12439e089cd9"
-COMPATIBLE_MACHINE = "(dragonboard-820c)"
PACKAGE_ARCH = "${MACHINE_ARCH}"
S = "${WORKDIR}/linux-board-support-package-r${PV}"
@@ -23,12 +22,8 @@ do_install() {
install -m 0444 ./proprietary-linux/adsp*.* ${D}${nonarch_base_libdir}/firmware/qcom/msm8996/
install -d ${D}${sysconfdir}/
- install -m 0644 LICENSE ${D}${sysconfdir}/QCOM-LINUX-BOARD-SUPPORT-LICENSE
+ install -m 0644 LICENSE ${D}${sysconfdir}/QCOM-LINUX-BOARD-SUPPORT-LICENSE-${PN}
}
FILES_${PN} += "${nonarch_base_libdir}/firmware/*"
INSANE_SKIP_${PN} += "arch"
-
-RPROVIDES_${PN} += "linux-firmware-qcom-license"
-RREPLACES_${PN} += "linux-firmware-qcom-license"
-RCONFLICTS_${PN} += "linux-firmware-qcom-license"
diff --git a/recipes-bsp/firmware/firmware-qcom-dragonboard845c_20190529180356-v4.bb b/recipes-bsp/firmware/firmware-qcom-dragonboard845c_20190529180356-v4.bb
index fbc9187..dd03753 100644
--- a/recipes-bsp/firmware/firmware-qcom-dragonboard845c_20190529180356-v4.bb
+++ b/recipes-bsp/firmware/firmware-qcom-dragonboard845c_20190529180356-v4.bb
@@ -7,7 +7,6 @@ SRC_URI = "https://releases.linaro.org/96boards/dragonboard845c/qualcomm/firmwar
SRC_URI[md5sum] = "ad69855a1275547b16d94a1b5405ac62"
SRC_URI[sha256sum] = "4289d2f2a7124b104d0274879e702aae9b1e50c42eec3747f8584c6744ef65e3"
-COMPATIBLE_MACHINE = "(dragonboard-845c)"
PACKAGE_ARCH = "${MACHINE_ARCH}"
DEPENDS += "qca-swiss-army-knife-native"
inherit python3native
@@ -31,12 +30,8 @@ do_install() {
install -m 0444 ./board-2.bin ${D}${nonarch_base_libdir}/firmware/ath10k/WCN3990/hw1.0/
install -d ${D}${sysconfdir}/
- install -m 0644 LICENSE.qcom.txt ${D}${sysconfdir}/QCOM-LINUX-BOARD-SUPPORT-LICENSE
+ install -m 0644 LICENSE.qcom.txt ${D}${sysconfdir}/QCOM-LINUX-BOARD-SUPPORT-LICENSE-${PN}
}
FILES_${PN} += "${nonarch_base_libdir}/firmware/*"
INSANE_SKIP_${PN} += "arch"
-
-RPROVIDES_${PN} += "linux-firmware-qcom-license"
-RREPLACES_${PN} += "linux-firmware-qcom-license"
-RCONFLICTS_${PN} += "linux-firmware-qcom-license"
diff --git a/recipes-bsp/firmware/firmware-qcom-sd-600eval_1.0.bb b/recipes-bsp/firmware/firmware-qcom-sd-600eval_1.0.bb
index 0a16d46..791f781 100644
--- a/recipes-bsp/firmware/firmware-qcom-sd-600eval_1.0.bb
+++ b/recipes-bsp/firmware/firmware-qcom-sd-600eval_1.0.bb
@@ -7,7 +7,6 @@ SRC_URI = "https://eragon.einfochips.com/pub/media/datasheet/SD_600eval-linux_pr
SRC_URI[md5sum] = "0903e9f656d3cea005ecc8e26f1243b2"
SRC_URI[sha256sum] = "fdffcb2cedc0d0215ee3dec95ce3683a780d9280960d27200379fbe1b21af979"
-COMPATIBLE_MACHINE = "(sd-600eval|dragonboard-600c)"
PACKAGE_ARCH = "${MACHINE_ARCH}"
S = "${WORKDIR}/SD_600eval-linux_proprietary_firmware-v${PV}"
diff --git a/recipes-kernel/linux/linux-linaro-qcom.inc b/recipes-kernel/linux/linux-linaro-qcom.inc
index 21f0ae6..b9e2714 100644
--- a/recipes-kernel/linux/linux-linaro-qcom.inc
+++ b/recipes-kernel/linux/linux-linaro-qcom.inc
@@ -80,13 +80,3 @@ do_configure_prepend() {
yes '' | oe_runmake -C ${S} O=${B} oldconfig
oe_runmake -C ${S} O=${B} savedefconfig && cp ${B}/defconfig ${WORKDIR}/defconfig.saved
}
-
-# append DTB
-do_compile_append() {
- if ! [ -e ${B}/arch/${ARCH}/boot/dts/${KERNEL_DEVICETREE} ] ; then
- oe_runmake ${KERNEL_DEVICETREE}
- fi
- cp arch/${ARCH}/boot/${KERNEL_IMAGETYPE} arch/${ARCH}/boot/${KERNEL_IMAGETYPE}.backup
- cat arch/${ARCH}/boot/${KERNEL_IMAGETYPE}.backup arch/${ARCH}/boot/dts/${KERNEL_DEVICETREE} > arch/${ARCH}/boot/${KERNEL_IMAGETYPE}
- rm -f arch/${ARCH}/boot/${KERNEL_IMAGETYPE}.backup
-}
diff --git a/recipes-kernel/linux/linux-linaro-qcomlt_5.10.bb b/recipes-kernel/linux/linux-linaro-qcomlt_5.10.bb
index 0320f89..57ae852 100644
--- a/recipes-kernel/linux/linux-linaro-qcomlt_5.10.bb
+++ b/recipes-kernel/linux/linux-linaro-qcomlt_5.10.bb
@@ -12,4 +12,4 @@ LOCALVERSION ?= "-linaro-lt-qcom"
SRCBRANCH = "release/qcomlt-5.10"
SRCREV = "6afb1155f01df9871e14e4189d83d31000b308ee"
-COMPATIBLE_MACHINE = "(apq8016|apq8096|sdm845|sm8250)"
+COMPATIBLE_MACHINE = "(qcom)"
diff --git a/recipes-kernel/linux/linux-linaro-qcomlt_5.7.bb b/recipes-kernel/linux/linux-linaro-qcomlt_5.7.bb
index d59db58..88b33be 100644
--- a/recipes-kernel/linux/linux-linaro-qcomlt_5.7.bb
+++ b/recipes-kernel/linux/linux-linaro-qcomlt_5.7.bb
@@ -23,7 +23,7 @@ LOCALVERSION ?= "-linaro-lt-qcom"
SRCBRANCH ?= "release/qcomlt-5.7"
SRCREV ?= "4af49ea41ecf17e5e6243f3ac81dfc2f84d8a3a1"
-COMPATIBLE_MACHINE = "(apq8016|apq8096|sdm845|sm8250)"
+COMPATIBLE_MACHINE = "(qcom)"
# Wifi firmware has a recognizable arch :(
ERROR_QA_remove = "arch"
diff --git a/recipes-kernel/linux/linux-linaro-qcomlt_5.9.bb b/recipes-kernel/linux/linux-linaro-qcomlt_5.9.bb
index a1af3c0..118ff78 100644
--- a/recipes-kernel/linux/linux-linaro-qcomlt_5.9.bb
+++ b/recipes-kernel/linux/linux-linaro-qcomlt_5.9.bb
@@ -15,4 +15,4 @@ SRCREV ?= "b5ff44498a19a685aa10a07ec67e3d12bc95a33a"
SRCBRANCH_sm8250 = "release/rb5/qcomlt-5.9"
SRCREV_sm8250 = "6d5a9a5da79684f69e4c66a7cf9108ab4e77025f"
-COMPATIBLE_MACHINE = "(apq8016|apq8096|sdm845|sm8250)"
+COMPATIBLE_MACHINE = "(qcom)"
diff --git a/recipes-kernel/linux/linux-qcom-bootimg.inc b/recipes-kernel/linux/linux-qcom-bootimg.inc
index 8a8a407..15b3397 100644
--- a/recipes-kernel/linux/linux-qcom-bootimg.inc
+++ b/recipes-kernel/linux/linux-qcom-bootimg.inc
@@ -1,49 +1,104 @@
-DEPENDS += "skales-native"
-
-QCOM_BOOTIMG_ROOTFS ?= "undefined"
-SD_QCOM_BOOTIMG_ROOTFS ?= "undefined"
-
-# set output file names
-BOOT_IMAGE_BASE_NAME = "boot-${KERNEL_IMAGE_NAME}"
-BOOT_IMAGE_SYMLINK_NAME = "boot-${KERNEL_IMAGE_LINK_NAME}"
-SD_BOOT_IMAGE_BASE_NAME = "boot-sd${KERNEL_IMAGE_NAME}"
-SD_BOOT_IMAGE_SYMLINK_NAME = "boot-sd-${KERNEL_IMAGE_LINK_NAME}"
-KERNEL_CMDLINE = "root=${1} rw rootwait console=${ttydev},${baudrate}n8"
-KERNEL_CMDLINE_append_dragonboard-845c = " clk_ignore_unused pd_ignore_unused"
-KERNEL_CMDLINE_append_qrb5165-rb5 = " pcie_pme=nomsi"
-
-# param ${1} partition where rootfs is located
-# param ${2} output boot image file name
-priv_make_image() {
- ${STAGING_BINDIR_NATIVE}/skales/mkbootimg --kernel ${B}/arch/${ARCH}/boot/${KERNEL_IMAGETYPE} \
- --ramdisk ${B}/initrd.img \
- --output ${DEPLOYDIR}/${2}.img \
- --pagesize ${QCOM_BOOTIMG_PAGE_SIZE} \
- --base ${QCOM_BOOTIMG_KERNEL_BASE} \
- --cmdline "${KERNEL_CMDLINE}"
-}
+QIMG_DEPLOYDIR = "${WORKDIR}/qcom_deploy-${PN}"
+
+python do_qcom_img_deploy() {
+ import shutil
+ import subprocess
+
+ subdir = d.getVar("KERNEL_DEPLOYSUBDIR")
+ if subdir is not None:
+ qcom_deploy_dir = os.path.join(d.getVar("QIMG_DEPLOYDIR"), subdir)
+ image_dir = os.path.join(d.getVar("DEPLOY_DIR_IMAGE"), subdir)
+ else:
+ qcom_deploy_dir = d.getVar("QIMG_DEPLOYDIR")
+ image_dir = d.getVar("DEPLOY_DIR_IMAGE")
+
+ B = d.getVar("B")
+ D = d.getVar("D")
+ kernel_output_dir = d.getVar("KERNEL_OUTPUT_DIR")
+ kernel_imagedest = d.getVar("KERNEL_IMAGEDEST")
+ kernel = os.path.join(B, "kernel-dtb")
+ definitrd = os.path.join(B, "initrd.img")
+ mkbootimg = os.path.join(d.getVar("STAGING_BINDIR_NATIVE"), "skales", "mkbootimg")
+ kernel_image_name = d.getVar("KERNEL_IMAGE_NAME")
+ kernel_link_name = d.getVar("KERNEL_IMAGE_LINK_NAME")
+ output_img = os.path.join(qcom_deploy_dir, "boot-%s.img" % (kernel_link_name))
+ output_sd_img = os.path.join(qcom_deploy_dir, "boot-sd-%s.img" % (kernel_link_name))
+
+ arch = d.getVar("ARCH")
+ if arch is "arm":
+ kernel_name = "zImage"
+ elif arch is "arm64":
+ kernel_name = "Image.gz"
+ else:
+ bb.fatal("Unuspported ARCH %s" % arch)
+
+ if os.path.exists(output_img):
+ os.unlink(output_img)
+ if os.path.exists(output_sd_img):
+ os.unlink(output_sd_img)
+
+ with open(definitrd, "w") as f:
+ f.write("This is not an initrd\n")
-do_deploy_append() {
+ for dtbf in d.getVar("KERNEL_DEVICETREE").split():
+ dtb = os.path.basename(dtbf)
+ dtb_name = dtb.rsplit('.', 1)[0]
- tmp="${SERIAL_CONSOLES}"
- baudrate=`echo $tmp | sed 's/\;.*//'`
- ttydev=`echo $tmp | sed -e 's/^[0-9]*\;//' -e 's/\s.*//' -e 's/\;.*//'`
+ def getVarDTB(name):
+ return d.getVarFlag(name, dtb_name) or d.getVar(name)
+
+ def make_image(template, rootfs):
+ output = os.path.join(qcom_deploy_dir, template % (dtb_name, kernel_image_name))
+ output_link = os.path.join(qcom_deploy_dir, template % (dtb_name, kernel_link_name))
+ subprocess.check_call([mkbootimg,
+ "--kernel", kernel,
+ "--ramdisk", definitrd,
+ "--output", output,
+ "--pagesize", getVarDTB("QCOM_BOOTIMG_PAGE_SIZE"),
+ "--base", getVarDTB("QCOM_BOOTIMG_KERNEL_BASE"),
+ "--cmdline", "root=%s rw rootwait %s %s" % (rootfs, consoles, getVarDTB("KERNEL_CMDLINE_EXTRA") or "")])
+ if os.path.exists(output_link):
+ os.unlink(output_link)
+ os.symlink(os.path.basename(output), output_link)
+ return output
+
+ consoles = ' '.join(map(lambda c: "console=%(tty)s,%(rate)sn8" % dict(zip(("rate", "tty"), c.split(';'))), getVarDTB("SERIAL_CONSOLES").split()))
+
+ # prepare kernel image with appended dtb
+ with open(kernel, 'wb') as wfd:
+ with open(os.path.join(kernel_output_dir, kernel_name), 'rb') as rfd:
+ shutil.copyfileobj(rfd, wfd)
+ with open(os.path.join(D, kernel_imagedest, dtb), 'rb') as rfd:
+ shutil.copyfileobj(rfd, wfd)
+
+ rootfs = getVarDTB("QCOM_BOOTIMG_ROOTFS")
+ if not rootfs or rootfs is "":
+ bb.fatal("QCOM_BOOTIMG_ROOTFS is undefined")
+
+ output = make_image("boot-%s-%s.img", rootfs)
+ if not os.path.exists(output_img):
+ os.symlink(os.path.basename(output), output_img)
+
+ sd_rootfs = getVarDTB("SD_QCOM_BOOTIMG_ROOTFS")
+ if sd_rootfs:
+ output = make_image("boot-sd-%s-%s.img", sd_rootfs)
+ if not os.path.exists(output_sd_img):
+ os.symlink(os.path.basename(output), output_sd_img)
+}
- # mkbootimg requires an initrd file, make fake one that will be ignored
- # during boot
- echo "This is not an initrd" > ${B}/initrd.img
+do_qcom_img_deploy[depends] += "skales-native:do_populate_sysroot"
- # don't build bootimg if rootfs partition is not defined
- if [ "${QCOM_BOOTIMG_ROOTFS}" = "undefined" ]; then
- bbfatal "Rootfs partition must be defined"
- fi
+addtask qcom_img_deploy after do_populate_sysroot do_packagedata bundle_initramfs before do_deploy
- priv_make_image ${QCOM_BOOTIMG_ROOTFS} ${BOOT_IMAGE_BASE_NAME}
- ln -sf ${BOOT_IMAGE_BASE_NAME}.img ${DEPLOYDIR}/${BOOT_IMAGE_SYMLINK_NAME}.img
+# Setup sstate, see deploy.bbclass
+SSTATETASKS += "do_qcom_img_deploy"
+do_qcom_img_deploy[sstate-inputdirs] = "${QIMG_DEPLOYDIR}"
+do_qcom_img_deploy[sstate-outputdirs] = "${DEPLOY_DIR_IMAGE}"
- # build sd boot image only for machines supporting it.
- if [ "${SD_QCOM_BOOTIMG_ROOTFS}" != "undefined" ]; then
- priv_make_image ${SD_QCOM_BOOTIMG_ROOTFS} ${SD_BOOT_IMAGE_BASE_NAME}
- ln -sf ${SD_BOOT_IMAGE_BASE_NAME}.img ${DEPLOYDIR}/${SD_BOOT_IMAGE_SYMLINK_NAME}.img
- fi
+python do_qcom_img_deploy_setscene () {
+ sstate_setscene(d)
}
+addtask do_qcom_img_deploy_setscene
+do_qcom_img_deploy[dirs] = "${QIMG_DEPLOYDIR} ${B}"
+do_qcom_img_deploy[cleandirs] = "${QIMG_DEPLOYDIR}"
+do_qcom_img_deploy[stamp-extra-info] = "${MACHINE_ARCH}"