Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

45 Commits

Folders and files

Repository files navigation

English | 中文

linux-mainline-hisi-9000c

Build scripts, patches, kernel configuration, DTS files and tools for running mainline Linux 6.18 on the HUAWEI Kirin 9000C SBC (codename charlotte, board QHW-100).

The board boots through UEFI. The stock vendor 5.10 kernel (5.10.97-38-9000c) stays the default; the 6.18 image is a separate one-shot test entry.

The verified build configuration, command line and packaging steps are in docs/verified_config_zh.md (Chinese).

What is included

Repository layout

  • patches/: the 6.18 kernel patch series (git am-able, v6.18.66 baseline)
  • defconfig/: the 6.18 kernel configuration used by the build and by CI
  • drivers/: local mirrors of the driver sources added/modified by the series
  • dts/: local mirrors of the board DTS/DTSI used by the series
  • docs/: bring-up notes and build guide
  • firmware/: firmware notes (common GCN GPU sets for CONFIG_EXTRA_FIRMWARE)
  • tools/: on-device helpers (MMIO diagnostic tool)
  • scripts/ci/: non-interactive firmware fetch and kernel build scripts
  • .github/workflows/: CI that builds the same kernel from a clean v6.18.66

Feature status

Feature Vendor 5.10.97 Mainline 6.18 (this repo)
8c12t SMP boot (8 cores / 12 threads) 5.10 6.18
UART console (uart_v500) 5.10 6.18
UFS (HS-G4, 2 lanes) 5.10 6.18
PCIe0 (onboard ASM1064) 5.10 6.18
SATA (AHCI) 5.10 6.18
PCIe1 (external x1 slot) 5.10 6.18
USB 2.0 / 3.0 (dwc3 + xhci) 5.10 6.18
USB Ethernet (RTL8153 / r8152) 5.10 6.18
amdgpu (Oland dGPU on PCIe1) — 6.18
HDMI audio (dGPU HDA) — 6.18
SoC display (vendor DPU/HDMI) 5.10 —
SoC GPU (Mali / hvgr) 5.10 —
Video decode (VDEC) 5.10 —
Video encode (VENC) 5.10 —
CPU frequency (hw_vote) 5.10 6.18
cpuidle (WFI / cluster idle) 5.10 —
Suspend / resume (deep) 5.10 —
Thermal zones 5.10 —
I2C 5.10 —
SPI 5.10 —
GPIO / pinctrl 5.10 —
RTC 5.10 —
PMU (perf) 5.10 —
IOMMU (SMMU) 5.10 —
KVM (arm64 VHE) 5.10 6.18
Namespaces (user / IPC / mount / PID) 5.10 6.18
binder / binderfs 5.10 6.18
Common filesystems 5.10 6.18

5.10 = vendor kernel 5.10.97-38-9000c; 6.18 = upstream v6.18.66 plus this repository's patch series (upstream v6.18.66 alone has no board support); — = no driver or not implemented. The vendor kernel exposes /dev/binder but not binderfs; 6.18 uses binderfs. The vendor kernel has no radeon/amdgpu, so the external card only enumerates on PCIe1 there.

The default 6.18 configuration (defconfig/charlotte_6.18_defconfig) follows the Debian 6.18.12+deb13-arm64 configuration with the board changes below. It selects the HiSilicon SoC platform and retains general-purpose peripheral and filesystem support. It drops DEBUG_INFO / BTF, Rust drivers and module compression to keep the build small and fast. CONFIG_DRM_RADEON is not set, so radeon.ko is not built; SI/CIK ASICs are handled by amdgpu (CONFIG_DRM_AMDGPU_SI / _CIK). CONFIG_DRM_AMD_DC is off because the Oland board uses the legacy DCE path.

CPUFreq goes through the vendor hw_vote block because the SoC has no mainline clock provider; charlotte-hv exposes three policies (little, middle, big). See 中文 for the register map, OPP tables and verification.

Patch sources

All patches are local work for this board, derived from:

  • the live vendor device tree (dtc -I fs -O dts /proc/device-tree), and
  • the HUAWEI phone kernel source drop (HBN-AL00,HBN-AL10,HBN-AL80), in particular platform_source/basicplatform/drivers/{pci,clk,gpio} and drivers/video/fbdev/dkmd;
  • mariobalanica/arm-pcie-gpu-patches: the arm64 external-GPU patch set. The three root causes on PCIe1 (device mappings for MMIO, an alignment fix, and write-combined GTT memory) map to its 0001/0002/0003; see PCIe1 notes.

hi3660/hi3670 code is deliberately not used as a reference: the Kirin 9000C UFS/PCIe/clock blocks are different.

  • 0001: add the QHW-100 (charlotte) board DTS and SoC skeleton
  • 0002: add the uart_v500 serial console driver (interactive console)
  • 0003: add the read-only DSS power probe used during display recon
  • 0004: add HUF S per-core queue support to the mainline UFS core
  • 0005: add the ufshcd-charlotte variant driver
  • 0006: negotiate HS-G4 through the private UniPro window
  • 0007: add the DesignWare PCIe host glue (pcie-charlotte)
  • 0008: give PCIe1 a 64-bit BAR window and inbound dma-ranges
  • 0009: release PCIe1 through the platdrv FF-A secure partition
  • 0010: amdgpu bus mastering + SI VRAM aperture refresh
  • 0011: report the 56 MiB charlotte aperture and force GTT write-combined
  • 0012: keep charlotte user-space VRAM mappings in GTT
  • 0013: add the SI PASID TLB flush callback
  • 0014: use I/O accessors for SI reset magic and UVD messages
  • 0015: restore DCE vblank/pageflip IRQs after a modeset
  • 0016: only unpin the old FB when legacy set_base pinned it
  • 0017: add the charlotte-hv CPUFreq driver and hw_vote/OPP tables
  • 0018: split the PCIe1 windows to match the running board
  • 0019: fold the final amdgpu VRAM/GART/CSB/ring fixes
  • 0020: fix the PCIe1 inbound iATU windows and BAR0 relocation
  • 0021: add hisilicon,dwc3-usb to dwc3-of-simple

GPU firmware

CONFIG_EXTRA_FIRMWARE embeds 253 amdgpu/<codename>_*.bin files (about 17 MiB) covering the common GCN sets: SI (tahiti, pitcairn, verde, hainan), CIK (bonaire, hawaii, kaveri, kabini, mullins), VI (tonga, fiji, topaz, carrizo, stoney), Polaris and Vega, plus Oland. scripts/ci/fetch_firmware.sh collects exactly the configured list from /lib/firmware or from pinned linux-firmware mirrors, so a clean checkout can build the same image. See firmware/README.md.

Known issues / current work

  • The 56 MiB aperture, BAR0 relocation and GTT policy are tuned for the Oland card on this board. Other GCN cards still need their own PCIe window, BAR and power adaptation; see amdgpu notes.
  • CONFIG_DRM_AMD_DC is off for the legacy Oland path. Polaris/Vega cards generally need DC (and AMD_DC_FP) re-enabled for display.
  • DRM fbdev emulation is disabled in the test entry (drm_kms_helper.fbdev_emulation=0): the 4K fbcon BO cannot be pinned inside the 56 MiB window. The compositor still runs at 4K; the boot display console is absent and the serial console is used instead.
  • GDM works after removing the board-specific SoC display compatibility library injected into the greeter's PAM environment; that library conflicts with the AMD dGPU EGL/GBM. The user session is unaffected.
  • Weston with vsync runs at half the monitor refresh on this legacy non-atomic path; vblank_mode=0 removes the limit.
  • GPU DPM works: low = 300/300 MHz, high = 825/1000 MHz, auto ramps under load. amdgpu_pm_info reports 10 kHz units.

Tools

  • tools/charlotte-diag.c: freestanding aarch64 MMIO dump tool (dump, blocks, ranges, find, fill, fbbars, fbinfo)

Getting started

  • Build guide (Ubuntu/Debian on the board): English | 中文
  • UFS bring-up notes: 中文
  • PCIe1 / FF-A / BAR window notes: 中文
  • amdgpu and Oland display notes: 中文
  • scanout BO pin analysis: 中文
  • CPU frequency scaling (hw_vote / OPP / governors): 中文
  • USB Ethernet / network notes: 中文

Build and CI

scripts/ci/fetch_firmware.sh populates the configured firmware list and scripts/ci/build_kernel.sh applies patches/*.patch to a clean v6.18.66, installs defconfig/charlotte_6.18_defconfig, builds Image, hisilicon/charlotte-9000c.dtb and modules, then collects the artifacts. With BUILD_DEB=1 and KERNEL_LOCALVERSION=-charlotte-gxde it also builds the image/headers packages and runs packaging/package-with-desktop-guide.sh to add the PDF guide, desktop autostart, UART console settings and board workarounds.

The GitHub Actions workflow build-hisi-9000c-6.18 runs the same two scripts natively on the GitHub-hosted arm64 runner ubuntu-24.04-arm, and uploads the Image, DTB, System.map, kernel config, a modules tarball and the delivery .deb. See 中文 for the checks and local reproduction.

Safety notes

  • Do not read unpowered display/PCIe MMIO blocks; on a cold 6.18 boot they can trigger a NoC SError and reset the board.

References

  • HUAWEI phone kernel source drop (HBN-AL00,HBN-AL10,HBN-AL80): vendor UFS, kport PCIe, extreme CRG and dkmd display implementations
  • Live vendor device tree of the board (QHW-100)
  • mariobalanica/arm-pcie-gpu-patches: arm64 PCIe GPU bring-up reference
  • linux-firmware for the embedded amdgpu/<codename>_*.bin sets

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors