aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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.conf49
-rw-r--r--conf/machine/qrb5165-rb5.conf1
-rw-r--r--recipes-kernel/linux/linux-linaro-qcom.inc20
-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.inc155
15 files changed, 162 insertions, 90 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 da6ff9f..d197ca6 100644
--- a/conf/machine/include/qcom-sdm845.inc
+++ b/conf/machine/include/qcom-sdm845.inc
@@ -13,6 +13,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 fbdd7cb..c557147 100644
--- a/conf/machine/include/qcom-sm8250.inc
+++ b/conf/machine/include/qcom-sm8250.inc
@@ -13,6 +13,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..c171c27
--- /dev/null
+++ b/conf/machine/qcom-armv8a.conf
@@ -0,0 +1,49 @@
+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"
+QCOM_BOOTIMG_ROOTFS[qrb5165-rb5] = "PARTLABEL=userdata"
+QCOM_BOOTIMG_ROOTFS[sm8250-rb5-dvt] = "PARTLABEL=userdata"
+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 bbb00ab..d78d2e4 100644
--- a/conf/machine/qrb5165-rb5.conf
+++ b/conf/machine/qrb5165-rb5.conf
@@ -8,6 +8,7 @@ MACHINE_FEATURES = "usbhost usbgadget alsa screen wifi bluetooth ext2"
KERNEL_IMAGETYPE ?= "Image.gz"
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-kernel/linux/linux-linaro-qcom.inc b/recipes-kernel/linux/linux-linaro-qcom.inc
index 1719ff3..b9e2714 100644
--- a/recipes-kernel/linux/linux-linaro-qcom.inc
+++ b/recipes-kernel/linux/linux-linaro-qcom.inc
@@ -80,23 +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_deploy_append() {
- for dtbf in ${KERNEL_DEVICETREE}; do
- dtb=`normalize_dtb "$dtbf"`
- dtb_ext=${dtb##*.}
- dtb_base_name=`basename $dtb .$dtb_ext`
- install -d $deployDir
- install -m 0644 ${D}/${KERNEL_IMAGEDEST}/$dtb_base_name.$dtb_ext $deployDir/$dtb_base_name-${KERNEL_DTB_NAME}.$dtb_ext
- for type in ${KERNEL_IMAGETYPE_FOR_MAKE}; do
- if [ "$type" = "Image.gz" ] ; then
- cat ${deployDir}/$type \
- $deployDir/$dtb_base_name-${KERNEL_DTB_NAME}.$dtb_ext \
- > $deployDir/$type-$dtb_base_name-${KERNEL_DTB_NAME}.$dtb_ext.bin
- ln -sf $type-$dtb_base_name-${KERNEL_DTB_NAME}.$dtb_ext.bin \
- $deployDir/$type-$dtb_base_name-${KERNEL_DTB_LINK_NAME}.$dtb_ext.bin
- fi
- done
- done
-}
diff --git a/recipes-kernel/linux/linux-linaro-qcomlt_5.10.bb b/recipes-kernel/linux/linux-linaro-qcomlt_5.10.bb
index 7e5af38..01a4502 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 = "9ab492e76768cd1bd9f2da52004ed537c8b329f3"
-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 cfa0cf5..15b3397 100644
--- a/recipes-kernel/linux/linux-qcom-bootimg.inc
+++ b/recipes-kernel/linux/linux-qcom-bootimg.inc
@@ -1,57 +1,104 @@
-DEPENDS += "skales-native"
-
-QCOM_BOOTIMG_ROOTFS ?= "undefined"
-SD_QCOM_BOOTIMG_ROOTFS ?= "undefined"
-
-# set output file names
-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
-# param ${3} kernel imagename
-priv_make_image() {
- ${STAGING_BINDIR_NATIVE}/skales/mkbootimg --kernel ${3} \
- --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")
+
+ for dtbf in d.getVar("KERNEL_DEVICETREE").split():
+ dtb = os.path.basename(dtbf)
+ dtb_name = dtb.rsplit('.', 1)[0]
+
+ 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)
}
-do_deploy_append() {
-
- tmp="${SERIAL_CONSOLES}"
- baudrate=`echo $tmp | sed 's/\;.*//'`
- ttydev=`echo $tmp | sed -e 's/^[0-9]*\;//' -e 's/\s.*//' -e 's/\;.*//'`
-
- # mkbootimg requires an initrd file, make fake one that will be ignored
- # during boot
- echo "This is not an initrd" > ${B}/initrd.img
-
- # don't build bootimg if rootfs partition is not defined
- if [ "${QCOM_BOOTIMG_ROOTFS}" = "undefined" ]; then
- bbfatal "Rootfs partition must be defined"
- fi
-
- for dtbf in ${KERNEL_DEVICETREE}; do
- dtb=`normalize_dtb "$dtbf"`
- dtb_ext=${dtb##*.}
- dtb_base_name=`basename $dtb .$dtb_ext`
- priv_make_image ${QCOM_BOOTIMG_ROOTFS} boot-$dtb_base_name-${KERNEL_IMAGE_NAME} ${deployDir}/Image.gz-$dtb_base_name-${KERNEL_DTB_NAME}.$dtb_ext.bin
- ln -sf boot-${dtb_base_name}-${KERNEL_IMAGE_NAME}.img ${DEPLOYDIR}/boot-${dtb_base_name}-${KERNEL_IMAGE_LINK_NAME}.img
- if [ ! -h ${DEPLOYDIR}/boot-${KERNEL_IMAGE_LINK_NAME}.img ]; then
- ln -sf boot-${dtb_base_name}-${KERNEL_IMAGE_NAME}.img ${DEPLOYDIR}/boot-${KERNEL_IMAGE_LINK_NAME}.img
- fi
-
- # build sd boot image only for machines supporting it.
- if [ "${SD_QCOM_BOOTIMG_ROOTFS}" != "undefined" ]; then
- priv_make_image ${SD_QCOM_BOOTIMG_ROOTFS} boot-sd-$dtb_base_name-${KERNEL_IMAGE_NAME} ${deployDir}/Image.gz-$dtb_base_name-${KERNEL_DTB_NAME}.$dtb_ext.bin
- ln -sf boot-sd-${dtb_base_name}-${KERNEL_IMAGE_NAME}.img ${DEPLOYDIR}/boot-sd-${dtb_base_name}-${KERNEL_IMAGE_LINK_NAME}.img
- if [ ! -h ${DEPLOYDIR}/boot-sd-${KERNEL_IMAGE_LINK_NAME}.img ]; then
- ln -sf boot-sd-${dtb_base_name}-${KERNEL_IMAGE_NAME}.img ${DEPLOYDIR}/boot-sd-${KERNEL_IMAGE_LINK_NAME}.img
- fi
- fi
- done
+do_qcom_img_deploy[depends] += "skales-native:do_populate_sysroot"
+
+addtask qcom_img_deploy after do_populate_sysroot do_packagedata bundle_initramfs before do_deploy
+
+# 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}"
+
+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}"