Skip to content

Qualcomm Linux Kernel

Shiraz Hashim edited this page Dec 11, 2025 · 7 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 git@github.com: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 git@github.com:qualcomm-linux/kernel.git
cd kernel/
git checkout origin/qcom-next
Get Ramdisk
cd ..
mkdir artifacts
wget -O artifacts/ramdisk.gz http://storage.kernelci.org/images/rootfs/buildroot/buildroot-baseline/20230703.0/arm64/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
Other Configuration Fragments

Few other configuration fragments are maintained to give desired build,

  • arch/arm64/configs/prune.config, removes unwanted ARCHs and other CONFIGs to save build time
  • arch/arm64/configs/qcom.config, enables qcom specific CONFIGs that upstream may not accept
  • kernel/configs/debug.config, reuse generic kernel debug config to produce a debug-able build
cd kernel/

./scripts/kconfig/merge_config.sh -m -O ../kobj arch/arm64/configs/defconfig arch/arm64/configs/prune.config arch/arm64/configs/qcom.config kernel/configs/debug.config
kmake O=../kobj olddefconfig
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                   git@github.com:qualcomm-linux/kernel-topics.git       baseline
tech/bsp/clk               git@github.com:qualcomm-linux/kernel-topics.git       tech/bsp/clk
tech/bsp/interconnect      git@github.com:qualcomm-linux/kernel-topics.git       tech/bsp/interconnect
tech/mem/secure-buffer     git@github.com:qualcomm-linux/kernel-topics.git       tech/mem/secure-buffer
tech/security/firmware-smc git@github.com:qualcomm-linux/kernel-topics.git       tech/security/firmware-smc
tech/bsp/soc-infra         git@github.com:qualcomm-linux/kernel-topics.git       tech/bsp/soc-infra
tech/debug/soc             git@github.com:qualcomm-linux/kernel-topics.git       tech/debug/soc
tech/bsp/pinctrl           git@github.com:qualcomm-linux/kernel-topics.git       tech/bsp/pinctrl
tech/bsp/remoteproc        git@github.com:qualcomm-linux/kernel-topics.git       tech/bsp/remoteproc
tech/bus/peripherals       git@github.com:qualcomm-linux/kernel-topics.git       tech/bus/peripherals
tech/bus/pci/all           git@github.com:qualcomm-linux/kernel-topics.git       tech/bus/pci/all
tech/bus/pci/mhi           git@github.com:qualcomm-linux/kernel-topics.git       tech/bus/pci/mhi
tech/bus/pci/phy           git@github.com:qualcomm-linux/kernel-topics.git       tech/bus/pci/phy
tech/bus/pci/pwrctl        git@github.com:qualcomm-linux/kernel-topics.git       tech/bus/pci/pwrctl
tech/bus/usb/dwc           git@github.com:qualcomm-linux/kernel-topics.git       tech/bus/usb/dwc
tech/bus/usb/gadget        git@github.com:qualcomm-linux/kernel-topics.git       tech/bus/usb/gadget
tech/bus/usb/phy           git@github.com:qualcomm-linux/kernel-topics.git       tech/bus/usb/phy
tech/debug/eud             git@github.com:qualcomm-linux/kernel-topics.git       tech/debug/eud
tech/debug/hwtracing       git@github.com:qualcomm-linux/kernel-topics.git       tech/debug/hwtracing
tech/debug/rdbg            git@github.com:qualcomm-linux/kernel-topics.git       tech/debug/rdbg
tech/pmic/backlight        git@github.com:qualcomm-linux/kernel-topics.git       tech/pmic/backlight
tech/pmic/mfd              git@github.com:qualcomm-linux/kernel-topics.git       tech/pmic/mfd
tech/pmic/misc             git@github.com:qualcomm-linux/kernel-topics.git       tech/pmic/misc
tech/pmic/regulator        git@github.com:qualcomm-linux/kernel-topics.git       tech/pmic/regulator
tech/pmic/supply           git@github.com:qualcomm-linux/kernel-topics.git       tech/pmic/supply
tech/mem/dma-buf           git@github.com:qualcomm-linux/kernel-topics.git       tech/mem/dma-buf
tech/mem/iommu             git@github.com:qualcomm-linux/kernel-topics.git       tech/mem/iommu
tech/mm/audio/all          git@github.com:qualcomm-linux/kernel-topics.git       tech/mm/audio/all
tech/mm/audio/soundwire    git@github.com:qualcomm-linux/kernel-topics.git       tech/mm/audio/soundwire
tech/mm/camss              git@github.com:qualcomm-linux/kernel-topics.git       tech/mm/camss
tech/mm/drm                git@github.com:qualcomm-linux/kernel-topics.git       tech/mm/drm
tech/mm/fastrpc            git@github.com:qualcomm-linux/kernel-topics.git       tech/mm/fastrpc
tech/mm/phy                git@github.com:qualcomm-linux/kernel-topics.git       tech/mm/phy
tech/mm/video              git@github.com:qualcomm-linux/kernel-topics.git       tech/mm/video
tech/mproc/rpmsg           git@github.com:qualcomm-linux/kernel-topics.git       tech/mproc/rpmsg
tech/mproc/qmi             git@github.com:qualcomm-linux/kernel-topics.git       tech/mproc/qmi
tech/net/ath               git@github.com:qualcomm-linux/kernel-topics.git       tech/net/ath
tech/net/eth               git@github.com:qualcomm-linux/kernel-topics.git       tech/net/eth
tech/net/rmnet             git@github.com:qualcomm-linux/kernel-topics.git       tech/net/rmnet
tech/net/qrtr              git@github.com:qualcomm-linux/kernel-topics.git       tech/net/qrtr
tech/net/phy               git@github.com:qualcomm-linux/kernel-topics.git       tech/net/phy
tech/net/bluetooth         git@github.com:qualcomm-linux/kernel-topics.git       tech/net/bluetooth
tech/pm/opp                git@github.com:qualcomm-linux/kernel-topics.git       tech/pm/opp
tech/pm/pmdomain           git@github.com:qualcomm-linux/kernel-topics.git       tech/pm/pmdomain
tech/pm/power              git@github.com:qualcomm-linux/kernel-topics.git       tech/pm/power
tech/pm/thermal            git@github.com:qualcomm-linux/kernel-topics.git       tech/pm/thermal
tech/security/crypto       git@github.com:qualcomm-linux/kernel-topics.git       tech/security/crypto
tech/security/fscrypt      git@github.com:qualcomm-linux/kernel-topics.git       tech/security/fscrypt
tech/security/ice          git@github.com:qualcomm-linux/kernel-topics.git       tech/security/ice
tech/storage/nvmem         git@github.com:qualcomm-linux/kernel-topics.git       tech/storage/nvmem
tech/storage/phy           git@github.com:qualcomm-linux/kernel-topics.git       tech/storage/phy
tech/storage/all           git@github.com:qualcomm-linux/kernel-topics.git       tech/storage/all
tech/virt/gunyah           git@github.com:qualcomm-linux/kernel-topics.git       tech/virt/gunyah
tech/all/workaround        git@github.com:qualcomm-linux/kernel-topics.git       tech/all/workaround
tech/all/documentation     git@github.com:qualcomm-linux/kernel-topics.git       tech/all/documentation
tech/all/dt/qcs6490        git@github.com:qualcomm-linux/kernel-topics.git       tech/all/dt/qcs6490
tech/all/dt/qcs9100        git@github.com:qualcomm-linux/kernel-topics.git       tech/all/dt/qcs9100
tech/all/dt/qcs8300        git@github.com:qualcomm-linux/kernel-topics.git       tech/all/dt/qcs8300
tech/all/dt/qcs615         git@github.com:qualcomm-linux/kernel-topics.git       tech/all/dt/qcs615
tech/all/config            git@github.com: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