# dracen-w/mt6768-kernel architecture

> Architecture diagram of the GitHub repository dracen-w/mt6768-kernel, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dracen-w/mt6768-kernel
- Repository: https://github.com/dracen-w/mt6768-kernel

## Overview

This is a Linux kernel source tree; the README identifies supported phone variants, but the supplied tree and excerpts do not show their device-specific implementation. The principal user-to-result path is therefore only broadly identifiable: kernel clients request services from subsystem code, which interacts with hardware or storage and reports completion. The graph maps representative sampled subsystems and documented relationships, not a complete phone boot or runtime path. Several indexed modules are unrelated to the README’s device list; unsampled implementation details and their connections are omitted.

Main entry points: [`drivers/dma/amd/ptdma/ptdma-dmaengine.c`](https://github.com/dracen-w/mt6768-kernel/blob/6.18-fit-migration/drivers/dma/amd/ptdma/ptdma-dmaengine.c) (PTDMA driver), [`drivers/gpu/drm/i915/gt/intel_engine_cs.c`](https://github.com/dracen-w/mt6768-kernel/blob/6.18-fit-migration/drivers/gpu/drm/i915/gt/intel_engine_cs.c) (i915 engine control), [`drivers/usb/gadget/function/f_mass_storage.c`](https://github.com/dracen-w/mt6768-kernel/blob/6.18-fit-migration/drivers/usb/gadget/function/f_mass_storage.c) (USB mass storage), [`drivers/dma/dmaengine.h`](https://github.com/dracen-w/mt6768-kernel/blob/6.18-fit-migration/drivers/dma/dmaengine.h) (DMA API definitions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_crypto["Crypto and DMA"]
  node_crypto_engine["Crypto engine queue<br/>[crypto_engine.c]"]
  node_ccp_dma["CCP DMA driver<br/>[ccp-dmaengine.c]"]
  node_ccp_dev["CCP device definitions<br/>[ccp-dev.h]"]
  node_qat_engine["QAT engine setup<br/>[adf_accel_engine.c]"]
  node_qat_devices["QAT device model"]
  node_pt_dma["PTDMA driver<br/>[ptdma-dmaengine.c]"]
  node_pt_header["PTDMA definitions<br/>[ptdma.h]"]
  node_ae4_header["AE4 definitions<br/>[ae4dma.h]"]
  node_dma_api["DMA API<br/>[dmaengine.c]"]
  node_dma_header["DMA API definitions<br/>[dmaengine.h]"]
end

subgraph group_graphics["Graphics and media"]
  node_i915_engine["i915 engine control<br/>[intel_engine_cs.c]"]
  node_i915_context["i915 context definitions<br/>[i915_gem_context.h]"]
  node_i915_internal["i915 GEM definitions"]
  node_xe_engine["Xe engine control<br/>[xe_hw_engine.c]"]
  node_atom_pipeline["AtomISP pipeline<br/>[pipeline.c]"]
  node_atom_interface["AtomISP pipeline interface<br/>[ia_css_pipeline.h]"]
end

subgraph group_storage["Storage and filesystem"]
  node_mass_storage["USB mass storage<br/>[f_mass_storage.c]"]
  node_mass_header["Mass storage definitions<br/>[f_mass_storage.h]"]
  node_storage_common["Storage common definitions<br/>[storage_common.h]"]
  node_legacy_gadget["Legacy USB gadget<br/>[mass_storage.c]"]
  node_romfs["RomFS storage access<br/>[storage.c]"]
end

subgraph group_kernel["Kernel services"]
  node_dsp_pipeline["mISDN DSP pipeline<br/>[dsp_pipeline.c]"]
  node_phone_variants["Documented phone variants"]
end

node_client(("Kernel client"))
node_phone_support(("Supported devices"))

node_client -.->|"queues requests"| node_crypto_engine
node_client -.->|"requests DMA"| node_dma_api
node_client -.->|"submits GPU work"| node_i915_engine
node_client -.->|"submits GPU work"| node_xe_engine
node_client -.->|"starts imaging"| node_atom_pipeline
node_client -.->|"uses USB storage"| node_mass_storage
node_ccp_dma -->|"uses definitions"| node_ccp_dev
node_ccp_dma -->|"uses DMA API"| node_dma_header
node_pt_dma -->|"uses definitions"| node_pt_header
node_pt_dma -->|"uses definitions"| node_ae4_header
node_pt_dma -->|"uses DMA API"| node_dma_header
node_dma_api -->|"uses definitions"| node_dma_header
node_qat_engine -->|"uses device model"| node_qat_devices
node_i915_engine -->|"uses context API"| node_i915_context
node_i915_engine -->|"uses GEM definitions"| node_i915_internal
node_xe_engine -.->|"not connected"| node_phone_variants
node_atom_pipeline -->|"uses interface"| node_atom_interface
node_mass_storage -->|"uses definitions"| node_mass_header
node_mass_storage -->|"uses common definitions"| node_storage_common
node_legacy_gadget -->|"uses function API"| node_mass_header
node_phone_support -->|"supports variants"| node_phone_variants

click node_crypto_engine "https://github.com/dracen-w/mt6768-kernel/blob/6.18-fit-migration/crypto/crypto_engine.c"
click node_ccp_dma "https://github.com/dracen-w/mt6768-kernel/blob/6.18-fit-migration/drivers/crypto/ccp/ccp-dmaengine.c"
click node_ccp_dev "https://github.com/dracen-w/mt6768-kernel/blob/6.18-fit-migration/drivers/crypto/ccp/ccp-dev.h"
click node_qat_engine "https://github.com/dracen-w/mt6768-kernel/blob/6.18-fit-migration/drivers/crypto/intel/qat/qat_common/adf_accel_engine.c"
click node_qat_devices "https://github.com/dracen-w/mt6768-kernel/blob/6.18-fit-migration/drivers/crypto/intel/qat/qat_common/adf_accel_devices.h"
click node_pt_dma "https://github.com/dracen-w/mt6768-kernel/blob/6.18-fit-migration/drivers/dma/amd/ptdma/ptdma-dmaengine.c"
click node_pt_header "https://github.com/dracen-w/mt6768-kernel/blob/6.18-fit-migration/drivers/dma/amd/ptdma/ptdma.h"
click node_ae4_header "https://github.com/dracen-w/mt6768-kernel/blob/6.18-fit-migration/drivers/dma/amd/ae4dma/ae4dma.h"
click node_dma_api "https://github.com/dracen-w/mt6768-kernel/blob/6.18-fit-migration/drivers/dma/dmaengine.c"
click node_dma_header "https://github.com/dracen-w/mt6768-kernel/blob/6.18-fit-migration/drivers/dma/dmaengine.h"
click node_i915_engine "https://github.com/dracen-w/mt6768-kernel/blob/6.18-fit-migration/drivers/gpu/drm/i915/gt/intel_engine_cs.c"
click node_i915_context "https://github.com/dracen-w/mt6768-kernel/blob/6.18-fit-migration/drivers/gpu/drm/i915/gem/i915_gem_context.h"
click node_i915_internal "https://github.com/dracen-w/mt6768-kernel/blob/6.18-fit-migration/drivers/gpu/drm/i915/gem/i915_gem_internal.h"
click node_xe_engine "https://github.com/dracen-w/mt6768-kernel/blob/6.18-fit-migration/drivers/gpu/drm/xe/xe_hw_engine.c"
click node_atom_pipeline "https://github.com/dracen-w/mt6768-kernel/blob/6.18-fit-migration/drivers/staging/media/atomisp/pci/runtime/pipeline/src/pipeline.c"
click node_atom_interface "https://github.com/dracen-w/mt6768-kernel/blob/6.18-fit-migration/drivers/staging/media/atomisp/pci/runtime/pipeline/interface/ia_css_pipeline.h"
click node_mass_storage "https://github.com/dracen-w/mt6768-kernel/blob/6.18-fit-migration/drivers/usb/gadget/function/f_mass_storage.c"
click node_mass_header "https://github.com/dracen-w/mt6768-kernel/blob/6.18-fit-migration/drivers/usb/gadget/function/f_mass_storage.h"
click node_storage_common "https://github.com/dracen-w/mt6768-kernel/blob/6.18-fit-migration/drivers/usb/gadget/function/storage_common.h"
click node_legacy_gadget "https://github.com/dracen-w/mt6768-kernel/blob/6.18-fit-migration/drivers/usb/gadget/legacy/mass_storage.c"
click node_romfs "https://github.com/dracen-w/mt6768-kernel/blob/6.18-fit-migration/fs/romfs/storage.c"
click node_dsp_pipeline "https://github.com/dracen-w/mt6768-kernel/blob/6.18-fit-migration/drivers/isdn/mISDN/dsp_pipeline.c"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_crypto_engine,node_ccp_dma,node_ccp_dev,node_qat_engine,node_qat_devices,node_pt_dma,node_pt_header,node_ae4_header,node_dma_api,node_dma_header,node_client toneBlue
class node_i915_engine,node_i915_context,node_i915_internal,node_xe_engine,node_atom_pipeline,node_atom_interface toneAmber
class node_mass_storage,node_mass_header,node_storage_common,node_legacy_gadget,node_romfs toneMint
class node_dsp_pipeline,node_phone_variants toneRose
class node_phone_support toneIndigo
```

## Components

### Crypto and DMA

- [Crypto engine queue](https://github.com/dracen-w/mt6768-kernel/blob/6.18-fit-migration/crypto/crypto_engine.c): `crypto/crypto_engine.c`
- [CCP DMA driver](https://github.com/dracen-w/mt6768-kernel/blob/6.18-fit-migration/drivers/crypto/ccp/ccp-dmaengine.c): `drivers/crypto/ccp/ccp-dmaengine.c`
- [CCP device definitions](https://github.com/dracen-w/mt6768-kernel/blob/6.18-fit-migration/drivers/crypto/ccp/ccp-dev.h): `drivers/crypto/ccp/ccp-dev.h`
- [QAT engine setup](https://github.com/dracen-w/mt6768-kernel/blob/6.18-fit-migration/drivers/crypto/intel/qat/qat_common/adf_accel_engine.c): `drivers/crypto/intel/qat/qat_common/adf_accel_engine.c`
- [QAT device model](https://github.com/dracen-w/mt6768-kernel/blob/6.18-fit-migration/drivers/crypto/intel/qat/qat_common/adf_accel_devices.h): `drivers/crypto/intel/qat/qat_common/adf_accel_devices.h`
- [PTDMA driver](https://github.com/dracen-w/mt6768-kernel/blob/6.18-fit-migration/drivers/dma/amd/ptdma/ptdma-dmaengine.c): `drivers/dma/amd/ptdma/ptdma-dmaengine.c`
- [PTDMA definitions](https://github.com/dracen-w/mt6768-kernel/blob/6.18-fit-migration/drivers/dma/amd/ptdma/ptdma.h): `drivers/dma/amd/ptdma/ptdma.h`
- [AE4 definitions](https://github.com/dracen-w/mt6768-kernel/blob/6.18-fit-migration/drivers/dma/amd/ae4dma/ae4dma.h): `drivers/dma/amd/ae4dma/ae4dma.h`
- [DMA API](https://github.com/dracen-w/mt6768-kernel/blob/6.18-fit-migration/drivers/dma/dmaengine.c): `drivers/dma/dmaengine.c`
- [DMA API definitions](https://github.com/dracen-w/mt6768-kernel/blob/6.18-fit-migration/drivers/dma/dmaengine.h): `drivers/dma/dmaengine.h`

### Graphics and media

- [i915 engine control](https://github.com/dracen-w/mt6768-kernel/blob/6.18-fit-migration/drivers/gpu/drm/i915/gt/intel_engine_cs.c): `drivers/gpu/drm/i915/gt/intel_engine_cs.c`
- [i915 context definitions](https://github.com/dracen-w/mt6768-kernel/blob/6.18-fit-migration/drivers/gpu/drm/i915/gem/i915_gem_context.h): `drivers/gpu/drm/i915/gem/i915_gem_context.h`
- [i915 GEM definitions](https://github.com/dracen-w/mt6768-kernel/blob/6.18-fit-migration/drivers/gpu/drm/i915/gem/i915_gem_internal.h): `drivers/gpu/drm/i915/gem/i915_gem_internal.h`
- [Xe engine control](https://github.com/dracen-w/mt6768-kernel/blob/6.18-fit-migration/drivers/gpu/drm/xe/xe_hw_engine.c): `drivers/gpu/drm/xe/xe_hw_engine.c`
- [AtomISP pipeline](https://github.com/dracen-w/mt6768-kernel/blob/6.18-fit-migration/drivers/staging/media/atomisp/pci/runtime/pipeline/src/pipeline.c): `drivers/staging/media/atomisp/pci/runtime/pipeline/src/pipeline.c`
- [AtomISP pipeline interface](https://github.com/dracen-w/mt6768-kernel/blob/6.18-fit-migration/drivers/staging/media/atomisp/pci/runtime/pipeline/interface/ia_css_pipeline.h): `drivers/staging/media/atomisp/pci/runtime/pipeline/interface/ia_css_pipeline.h`

### Storage and filesystem

- [USB mass storage](https://github.com/dracen-w/mt6768-kernel/blob/6.18-fit-migration/drivers/usb/gadget/function/f_mass_storage.c): `drivers/usb/gadget/function/f_mass_storage.c`
- [Mass storage definitions](https://github.com/dracen-w/mt6768-kernel/blob/6.18-fit-migration/drivers/usb/gadget/function/f_mass_storage.h): `drivers/usb/gadget/function/f_mass_storage.h`
- [Storage common definitions](https://github.com/dracen-w/mt6768-kernel/blob/6.18-fit-migration/drivers/usb/gadget/function/storage_common.h): `drivers/usb/gadget/function/storage_common.h`
- [Legacy USB gadget](https://github.com/dracen-w/mt6768-kernel/blob/6.18-fit-migration/drivers/usb/gadget/legacy/mass_storage.c): `drivers/usb/gadget/legacy/mass_storage.c`
- [RomFS storage access](https://github.com/dracen-w/mt6768-kernel/blob/6.18-fit-migration/fs/romfs/storage.c): `fs/romfs/storage.c`

### Kernel services

- [mISDN DSP pipeline](https://github.com/dracen-w/mt6768-kernel/blob/6.18-fit-migration/drivers/isdn/mISDN/dsp_pipeline.c): `drivers/isdn/mISDN/dsp_pipeline.c`
- **Documented phone variants**

### Other components

- **Kernel client**
- **Supported devices**

## Connections

- Kernel client → Crypto engine queue: queues requests
- Kernel client → DMA API: requests DMA
- Kernel client → i915 engine control: submits GPU work
- Kernel client → Xe engine control: submits GPU work
- Kernel client → AtomISP pipeline: starts imaging
- Kernel client → USB mass storage: uses USB storage
- CCP DMA driver → CCP device definitions: uses definitions (evidence: `drivers/crypto/ccp/ccp-dmaengine.c`)
- CCP DMA driver → DMA API definitions: uses DMA API (evidence: `drivers/crypto/ccp/ccp-dmaengine.c`)
- PTDMA driver → PTDMA definitions: uses definitions (evidence: `drivers/dma/amd/ptdma/ptdma-dmaengine.c`)
- PTDMA driver → AE4 definitions: uses definitions (evidence: `drivers/dma/amd/ptdma/ptdma-dmaengine.c`)
- PTDMA driver → DMA API definitions: uses DMA API (evidence: `drivers/dma/amd/ptdma/ptdma-dmaengine.c`)
- DMA API → DMA API definitions: uses definitions (evidence: `drivers/dma/dmaengine.c`)
- QAT engine setup → QAT device model: uses device model (evidence: `drivers/crypto/intel/qat/qat_common/adf_accel_engine.c`)
- i915 engine control → i915 context definitions: uses context API (evidence: `drivers/gpu/drm/i915/gt/intel_engine_cs.c`)
- i915 engine control → i915 GEM definitions: uses GEM definitions (evidence: `drivers/gpu/drm/i915/gt/intel_engine_cs.c`)
- Xe engine control → Documented phone variants: not connected
- AtomISP pipeline → AtomISP pipeline interface: uses interface (evidence: `drivers/staging/media/atomisp/pci/runtime/pipeline/src/pipeline.c`)
- USB mass storage → Mass storage definitions: uses definitions (evidence: `drivers/usb/gadget/function/f_mass_storage.c`)
- USB mass storage → Storage common definitions: uses common definitions (evidence: `drivers/usb/gadget/function/f_mass_storage.c`)
- Legacy USB gadget → Mass storage definitions: uses function API (evidence: `drivers/usb/gadget/legacy/mass_storage.c`)
- Supported devices → Documented phone variants: supports variants (evidence: `README`)
