Skip to content

Qualcomm Linux Kernel

Shiraz Hashim edited this page Jun 30, 2025 · 5 revisions

Kernel Repository

Qualcomm kernel repository hosts Qualcomm Linux kernel branches that support Qualcomm targets.

Kernel Branches

  • qcom-next, is the mainline branch that follows each -rc release of upstream kernel
  • qcom-next-staging, that helps prepare qcom-next

Related Repositories

Repository Details
kernel-topics QLI Mainline kernel topic branches repository based on upstream kernel
kernel-config QLI Mainline kernel topic branch config repository that enumerates all topic branches to be used for qcom-next
kmake-image Open Docker image for building kernel
kernel-checkers Kernel checker project to run premerge (public) checks on kernel changes
automerge automerge tool to merge & prepare qcom-next from kernel topic branches

qcom-next workflow

kernel changes are actually developed on topic branches that belong to kernel-topics repository. These topic branches are pulled into qcom-next to setup Qualcomm Linux kernel mainline.

At each upstream kernel release,

  • qcom-next-staging resets to latest upstream released -rc
  • Each topic branch is pulled onto the new -rc base and a PR is raised to qcom-next-staging
  • Once qcom-next-staging tests are clear, it is pushed to qcom-next

All development and corresponding PRs are raised on corresponding topic branches of kernel-topics repository.

Sync & Build

You would need setup docker that can help build and package kernel images to flash on to the target. The following example captures how to fetch and build efi and dtb bins of the upstream Linux Kernel for QCS6490 Rb3Gen2.

Setup Environment & Fetch Dependencies

Setup Docker
git clone [email protected]:qualcomm-linux/kmake-image.git
cd kmake-image
docker build -t kmake-image .
Setup Aliases
alias kmake-image-run='docker run -it --rm --user $(id -u):$(id -g) --workdir="$PWD" -v "$(dirname $PWD)":"$(dirname $PWD)" kmake-image'
alias kmake='kmake-image-run make'
Get Kernel Source
cd ..
git clone [email protected]:qualcomm-linux/kernel.git
cd kernel/
git checkout origin/qcom-next
Get Ramdisk
cd ..
mkdir artifacts
wget -O artifacts/ramdisk.gz https://snapshots.linaro.org/member-builds/qcomlt/testimages/arm64/1379/initramfs-test-image-qemuarm64-20230321073831-1379.rootfs.cpio.gz
Get systemd-boot binaries
wget -O artifacts/systemd-boot-efi.deb http://ports.ubuntu.com/pool/universe/s/systemd/systemd-boot-efi_255.4-1ubuntu8_arm64.deb
dpkg-deb -xv artifacts/systemd-boot-efi.deb artifacts/systemd

Build Kernel

Build using Upstream defconfig

One can use 'arch/arm64/defconfig' to configure kernel and build using below instructions:

cd kernel/
kmake O=../kobj defconfig
kmake O=../kobj -j$(nproc)
kmake O=../kobj -j$(nproc) dir-pkg INSTALL_MOD_STRIP=1
Build Reduced Configuration

One can use 'arch/arm64/configs/prune.config' with base 'arch/arm64/configs/defconfig' to remove other architectures and build for Qualcomm targets with a reduced build size.

cd kernel/
kmake O=../kobj defconfig prune.config
kmake O=../kobj -j$(nproc)
kmake O=../kobj -j$(nproc) dir-pkg INSTALL_MOD_STRIP=1

Package DLKMs into ramdisk

(cd ../kobj/tar-install ; find lib/modules | cpio -o -H newc -R +0:+0 | gzip -9 >> ../../artifacts/ramdisk.gz)

Generate efi.bin for boot/ESP partition

cd ..
kmake-image-run generate_boot_bins.sh efi --ramdisk artifacts/ramdisk.gz \
		--systemd-boot artifacts/systemd/usr/lib/systemd/boot/efi/systemd-bootaa64.efi \
		--stub artifacts/systemd/usr/lib/systemd/boot/efi/linuxaa64.efi.stub \
		--linux kobj/arch/arm64/boot/Image \
		--cmdline "${CMDLINE}" \
		--output images

Generate dtb.bin for targets supporting devicetree

kmake-image-run generate_boot_bins.sh dtb --input kobj/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dtb \
		--output images

The resulting efi.bin and dtb.bin are gathered in images directory and is ready to be booted on a QCS6490 RB3Gen2.

Flash the binaries & Boot

fastboot flash efi images/efi.bin
fastboot flash dtb_a images/dtb.bin
fastboot reboot

Topic Branches

Topic branches can be dynamically added based on need. Request to add/delete/update topic branches can be made to kernel-config repository.

Raise a change in qcom-next.conf for such requests. Current list of topic branches that qcom-next.conf contains:

baseline                   [email protected]:qualcomm-linux/kernel-topics.git       baseline
tech/bsp/clk               [email protected]:qualcomm-linux/kernel-topics.git       tech/bsp/clk
tech/bsp/interconnect      [email protected]:qualcomm-linux/kernel-topics.git       tech/bsp/interconnect
tech/mem/secure-buffer     [email protected]:qualcomm-linux/kernel-topics.git       tech/mem/secure-buffer
tech/security/firmware-smc [email protected]:qualcomm-linux/kernel-topics.git       tech/security/firmware-smc
tech/bsp/soc-infra         [email protected]:qualcomm-linux/kernel-topics.git       tech/bsp/soc-infra
tech/debug/soc             [email protected]:qualcomm-linux/kernel-topics.git       tech/debug/soc
tech/bsp/pinctrl           [email protected]:qualcomm-linux/kernel-topics.git       tech/bsp/pinctrl
tech/bsp/remoteproc        [email protected]:qualcomm-linux/kernel-topics.git       tech/bsp/remoteproc
tech/bus/peripherals       [email protected]:qualcomm-linux/kernel-topics.git       tech/bus/peripherals
tech/bus/pci/all           [email protected]:qualcomm-linux/kernel-topics.git       tech/bus/pci/all
tech/bus/pci/mhi           [email protected]:qualcomm-linux/kernel-topics.git       tech/bus/pci/mhi
tech/bus/pci/phy           [email protected]:qualcomm-linux/kernel-topics.git       tech/bus/pci/phy
tech/bus/pci/pwrctl        [email protected]:qualcomm-linux/kernel-topics.git       tech/bus/pci/pwrctl
tech/bus/usb/dwc           [email protected]:qualcomm-linux/kernel-topics.git       tech/bus/usb/dwc
tech/bus/usb/gadget        [email protected]:qualcomm-linux/kernel-topics.git       tech/bus/usb/gadget
tech/bus/usb/phy           [email protected]:qualcomm-linux/kernel-topics.git       tech/bus/usb/phy
tech/debug/eud             [email protected]:qualcomm-linux/kernel-topics.git       tech/debug/eud
tech/debug/hwtracing       [email protected]:qualcomm-linux/kernel-topics.git       tech/debug/hwtracing
tech/debug/rdbg            [email protected]:qualcomm-linux/kernel-topics.git       tech/debug/rdbg
tech/pmic/backlight        [email protected]:qualcomm-linux/kernel-topics.git       tech/pmic/backlight
tech/pmic/mfd              [email protected]:qualcomm-linux/kernel-topics.git       tech/pmic/mfd
tech/pmic/misc             [email protected]:qualcomm-linux/kernel-topics.git       tech/pmic/misc
tech/pmic/regulator        [email protected]:qualcomm-linux/kernel-topics.git       tech/pmic/regulator
tech/pmic/supply           [email protected]:qualcomm-linux/kernel-topics.git       tech/pmic/supply
tech/mem/dma-buf           [email protected]:qualcomm-linux/kernel-topics.git       tech/mem/dma-buf
tech/mem/iommu             [email protected]:qualcomm-linux/kernel-topics.git       tech/mem/iommu
tech/mm/audio/all          [email protected]:qualcomm-linux/kernel-topics.git       tech/mm/audio/all
tech/mm/audio/soundwire    [email protected]:qualcomm-linux/kernel-topics.git       tech/mm/audio/soundwire
tech/mm/camss              [email protected]:qualcomm-linux/kernel-topics.git       tech/mm/camss
tech/mm/drm                [email protected]:qualcomm-linux/kernel-topics.git       tech/mm/drm
tech/mm/fastrpc            [email protected]:qualcomm-linux/kernel-topics.git       tech/mm/fastrpc
tech/mm/phy                [email protected]:qualcomm-linux/kernel-topics.git       tech/mm/phy
tech/mm/video              [email protected]:qualcomm-linux/kernel-topics.git       tech/mm/video
tech/mproc/rpmsg           [email protected]:qualcomm-linux/kernel-topics.git       tech/mproc/rpmsg
tech/mproc/qmi             [email protected]:qualcomm-linux/kernel-topics.git       tech/mproc/qmi
tech/net/ath               [email protected]:qualcomm-linux/kernel-topics.git       tech/net/ath
tech/net/eth               [email protected]:qualcomm-linux/kernel-topics.git       tech/net/eth
tech/net/rmnet             [email protected]:qualcomm-linux/kernel-topics.git       tech/net/rmnet
tech/net/qrtr              [email protected]:qualcomm-linux/kernel-topics.git       tech/net/qrtr
tech/net/phy               [email protected]:qualcomm-linux/kernel-topics.git       tech/net/phy
tech/net/bluetooth         [email protected]:qualcomm-linux/kernel-topics.git       tech/net/bluetooth
tech/pm/opp                [email protected]:qualcomm-linux/kernel-topics.git       tech/pm/opp
tech/pm/pmdomain           [email protected]:qualcomm-linux/kernel-topics.git       tech/pm/pmdomain
tech/pm/power              [email protected]:qualcomm-linux/kernel-topics.git       tech/pm/power
tech/pm/thermal            [email protected]:qualcomm-linux/kernel-topics.git       tech/pm/thermal
tech/security/crypto       [email protected]:qualcomm-linux/kernel-topics.git       tech/security/crypto
tech/security/fscrypt      [email protected]:qualcomm-linux/kernel-topics.git       tech/security/fscrypt
tech/security/ice          [email protected]:qualcomm-linux/kernel-topics.git       tech/security/ice
tech/storage/nvmem         [email protected]:qualcomm-linux/kernel-topics.git       tech/storage/nvmem
tech/storage/phy           [email protected]:qualcomm-linux/kernel-topics.git       tech/storage/phy
tech/storage/all           [email protected]:qualcomm-linux/kernel-topics.git       tech/storage/all
tech/virt/gunyah           [email protected]:qualcomm-linux/kernel-topics.git       tech/virt/gunyah
tech/all/workaround        [email protected]:qualcomm-linux/kernel-topics.git       tech/all/workaround
tech/all/documentation     [email protected]:qualcomm-linux/kernel-topics.git       tech/all/documentation
tech/all/dt/qcs6490        [email protected]:qualcomm-linux/kernel-topics.git       tech/all/dt/qcs6490
tech/all/dt/qcs9100        [email protected]:qualcomm-linux/kernel-topics.git       tech/all/dt/qcs9100
tech/all/dt/qcs8300        [email protected]:qualcomm-linux/kernel-topics.git       tech/all/dt/qcs8300
tech/all/dt/qcs615         [email protected]:qualcomm-linux/kernel-topics.git       tech/all/dt/qcs615
tech/all/config            [email protected]:qualcomm-linux/kernel-topics.git       tech/all/config

Topic Branch Workflow

Open kernel development is centered around topic branches. Each topic branch holds rebased patch-set that is aligned to upstream and to be consumed by qcom-next. Topic branches are rebased on to kernel.org master -rc tag as and when required. Primarily when,

  • maintainer need to update/revise patchset with latest upstream submissions
  • topic branch conflicts on merge with kernel.org master tip

All development and patch submission happens on topic branches using github PR workflow.

Contributing to Topic Branches

All kernel changes expected to be upstream'ed. Submit the patch to Linux kernel community before brining it to 'Qualcomm Kernel'. After which one can raise a PR with that change on corresponding topic branch.

Patch Policy to be Followed

  • All patch should be tagged with one of the prefixes in the subject line

    TAG Details
    FROMLIST Patch picked from Linux Kernel mailing list
    FROMGIT Patch picked from maintained kernel repository
    UPSTREAM Patch picked from upstream kernel repository
  • All patches would have 'Link:' tag in commit log to point to lore archive source

  • Patches are revised as upstream submissions progress