# raspberrypi/linux architecture

> Architecture diagram of the GitHub repository raspberrypi/linux, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/raspberrypi/linux
- Repository: https://github.com/raspberrypi/linux

## Overview

Linux is a general-purpose kernel: its runtime serves user processes and devices through architecture support, core services, filesystems, and drivers. The supplied excerpts show several separate product paths rather than one end-to-end workflow: a USB host issues storage commands; camera code starts and assembles ISP pipelines; and kernel clients use DMA and hardware-engine services. The graph focuses on these evidenced subsystems and other substantial indexed modules. Source excerpts are partial, so relationships not shown directly are omitted.

Main entry points: [`drivers/dma/dmaengine.c`](https://github.com/raspberrypi/linux/blob/rpi-6.18.y/drivers/dma/dmaengine.c) (DMA channel service), [`drivers/staging/media/atomisp/pci/runtime/pipeline/src/pipeline.c`](https://github.com/raspberrypi/linux/blob/rpi-6.18.y/drivers/staging/media/atomisp/pci/runtime/pipeline/src/pipeline.c) (Camera pipeline), [`drivers/usb/gadget/file_storage.c`](https://github.com/raspberrypi/linux/blob/rpi-6.18.y/drivers/usb/gadget/file_storage.c) (File storage gadget), [`drivers/usb/gadget/function/f_mass_storage.c`](https://github.com/raspberrypi/linux/blob/rpi-6.18.y/drivers/usb/gadget/function/f_mass_storage.c) (Mass storage function)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_media["Media and USB"]
  node_file_storage["File storage gadget<br/>[file_storage.c]"]
  node_mass_storage["Mass storage function<br/>[f_mass_storage.c]"]
  node_camera["Camera pipeline<br/>[pipeline.c]"]
  node_pipeline_api["Pipeline interface<br/>[ia_css_pipeline.h]"]
  node_dsp["Audio DSP pipeline<br/>[dsp_pipeline.c]"]
end

subgraph group_compute["Hardware engines"]
  node_crypto_engine["Crypto engine queue<br/>[crypto_engine.c]"]
  node_qat["QAT accelerator engine<br/>[adf_accel_engine.c]"]
  node_qat_device["QAT device model"]
  node_ccp_dma["CCP DMA provider<br/>[ccp-dmaengine.c]"]
  node_ptdma["AMD PTDMA provider<br/>[ptdma-dmaengine.c]"]
  node_i915_engine["i915 GPU engines<br/>[intel_engine_cs.c]"]
  node_xe_engine["Xe GPU engines<br/>[xe_hw_engine.c]"]
end

subgraph group_kernel["Kernel services"]
  node_dma_core["DMA channel service<br/>[dmaengine.c]"]
end

subgraph group_storage["Storage and filesystems"]
  node_romfs["RomFS image access<br/>[storage.c]"]
  node_ocfs_nodes["OCFS2 node manager<br/>[nodemanager.c]"]
end

node_usb_host(("USB host"))
node_storage_backing[("Backing files")]
node_dma_clients(("Kernel DMA clients"))

node_usb_host -->|"issues commands"| node_file_storage
node_usb_host -->|"issues commands"| node_mass_storage
node_file_storage -->|"reads and writes"| node_storage_backing
node_mass_storage -->|"syncs backing"| node_storage_backing
node_camera -->|"uses interface"| node_pipeline_api
node_camera -->|"adds stages"| node_camera
node_dma_clients -.->|"requests channels"| node_dma_core
node_dma_core -.->|"allocates provider channels"| node_ccp_dma
node_dma_core -.->|"allocates provider channels"| node_ptdma
node_qat -->|"uses device model"| node_qat_device

click node_file_storage "https://github.com/raspberrypi/linux/blob/rpi-6.18.y/drivers/usb/gadget/file_storage.c"
click node_mass_storage "https://github.com/raspberrypi/linux/blob/rpi-6.18.y/drivers/usb/gadget/function/f_mass_storage.c"
click node_camera "https://github.com/raspberrypi/linux/blob/rpi-6.18.y/drivers/staging/media/atomisp/pci/runtime/pipeline/src/pipeline.c"
click node_pipeline_api "https://github.com/raspberrypi/linux/blob/rpi-6.18.y/drivers/staging/media/atomisp/pci/runtime/pipeline/interface/ia_css_pipeline.h"
click node_dsp "https://github.com/raspberrypi/linux/blob/rpi-6.18.y/drivers/isdn/mISDN/dsp_pipeline.c"
click node_crypto_engine "https://github.com/raspberrypi/linux/blob/rpi-6.18.y/crypto/crypto_engine.c"
click node_qat "https://github.com/raspberrypi/linux/blob/rpi-6.18.y/drivers/crypto/intel/qat/qat_common/adf_accel_engine.c"
click node_qat_device "https://github.com/raspberrypi/linux/blob/rpi-6.18.y/drivers/crypto/intel/qat/qat_common/adf_accel_devices.h"
click node_dma_core "https://github.com/raspberrypi/linux/blob/rpi-6.18.y/drivers/dma/dmaengine.c"
click node_ccp_dma "https://github.com/raspberrypi/linux/blob/rpi-6.18.y/drivers/crypto/ccp/ccp-dmaengine.c"
click node_ptdma "https://github.com/raspberrypi/linux/blob/rpi-6.18.y/drivers/dma/amd/ptdma/ptdma-dmaengine.c"
click node_i915_engine "https://github.com/raspberrypi/linux/blob/rpi-6.18.y/drivers/gpu/drm/i915/gt/intel_engine_cs.c"
click node_xe_engine "https://github.com/raspberrypi/linux/blob/rpi-6.18.y/drivers/gpu/drm/xe/xe_hw_engine.c"
click node_romfs "https://github.com/raspberrypi/linux/blob/rpi-6.18.y/fs/romfs/storage.c"
click node_ocfs_nodes "https://github.com/raspberrypi/linux/blob/rpi-6.18.y/fs/ocfs2/cluster/nodemanager.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_file_storage,node_mass_storage,node_camera,node_pipeline_api,node_dsp,node_dma_clients toneBlue
class node_crypto_engine,node_qat,node_qat_device,node_ccp_dma,node_ptdma,node_i915_engine,node_xe_engine,node_storage_backing toneAmber
class node_dma_core toneMint
class node_romfs,node_ocfs_nodes toneRose
class node_usb_host toneIndigo
```

## Components

### Media and USB

- [File storage gadget](https://github.com/raspberrypi/linux/blob/rpi-6.18.y/drivers/usb/gadget/file_storage.c): `drivers/usb/gadget/file_storage.c`
- [Mass storage function](https://github.com/raspberrypi/linux/blob/rpi-6.18.y/drivers/usb/gadget/function/f_mass_storage.c): `drivers/usb/gadget/function/f_mass_storage.c`
- [Camera pipeline](https://github.com/raspberrypi/linux/blob/rpi-6.18.y/drivers/staging/media/atomisp/pci/runtime/pipeline/src/pipeline.c): `drivers/staging/media/atomisp/pci/runtime/pipeline/src/pipeline.c`
- [Pipeline interface](https://github.com/raspberrypi/linux/blob/rpi-6.18.y/drivers/staging/media/atomisp/pci/runtime/pipeline/interface/ia_css_pipeline.h): `drivers/staging/media/atomisp/pci/runtime/pipeline/interface/ia_css_pipeline.h`
- [Audio DSP pipeline](https://github.com/raspberrypi/linux/blob/rpi-6.18.y/drivers/isdn/mISDN/dsp_pipeline.c): `drivers/isdn/mISDN/dsp_pipeline.c`

### Hardware engines

- [Crypto engine queue](https://github.com/raspberrypi/linux/blob/rpi-6.18.y/crypto/crypto_engine.c): `crypto/crypto_engine.c`
- [QAT accelerator engine](https://github.com/raspberrypi/linux/blob/rpi-6.18.y/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/raspberrypi/linux/blob/rpi-6.18.y/drivers/crypto/intel/qat/qat_common/adf_accel_devices.h): `drivers/crypto/intel/qat/qat_common/adf_accel_devices.h`
- [CCP DMA provider](https://github.com/raspberrypi/linux/blob/rpi-6.18.y/drivers/crypto/ccp/ccp-dmaengine.c): `drivers/crypto/ccp/ccp-dmaengine.c`
- [AMD PTDMA provider](https://github.com/raspberrypi/linux/blob/rpi-6.18.y/drivers/dma/amd/ptdma/ptdma-dmaengine.c): `drivers/dma/amd/ptdma/ptdma-dmaengine.c`
- [i915 GPU engines](https://github.com/raspberrypi/linux/blob/rpi-6.18.y/drivers/gpu/drm/i915/gt/intel_engine_cs.c): `drivers/gpu/drm/i915/gt/intel_engine_cs.c`
- [Xe GPU engines](https://github.com/raspberrypi/linux/blob/rpi-6.18.y/drivers/gpu/drm/xe/xe_hw_engine.c): `drivers/gpu/drm/xe/xe_hw_engine.c`

### Kernel services

- [DMA channel service](https://github.com/raspberrypi/linux/blob/rpi-6.18.y/drivers/dma/dmaengine.c): `drivers/dma/dmaengine.c`

### Storage and filesystems

- [RomFS image access](https://github.com/raspberrypi/linux/blob/rpi-6.18.y/fs/romfs/storage.c): `fs/romfs/storage.c`
- [OCFS2 node manager](https://github.com/raspberrypi/linux/blob/rpi-6.18.y/fs/ocfs2/cluster/nodemanager.c): `fs/ocfs2/cluster/nodemanager.c`

### Other components

- **USB host**
- **Backing files**
- **Kernel DMA clients**

## Connections

- USB host → File storage gadget: issues commands (evidence: `drivers/usb/gadget/file_storage.c`)
- USB host → Mass storage function: issues commands (evidence: `drivers/usb/gadget/function/f_mass_storage.c`)
- File storage gadget → Backing files: reads and writes (evidence: `drivers/usb/gadget/file_storage.c`)
- Mass storage function → Backing files: syncs backing (evidence: `drivers/usb/gadget/function/f_mass_storage.c`)
- Camera pipeline → Pipeline interface: uses interface (evidence: `drivers/staging/media/atomisp/pci/runtime/pipeline/src/pipeline.c`)
- Camera pipeline → Camera pipeline: adds stages (evidence: `drivers/staging/media/atomisp/pci/runtime/pipeline/src/pipeline.c`)
- Kernel DMA clients → DMA channel service: requests channels
- DMA channel service → CCP DMA provider: allocates provider channels
- DMA channel service → AMD PTDMA provider: allocates provider channels
- QAT accelerator engine → QAT device model: uses device model (evidence: `drivers/crypto/intel/qat/qat_common/adf_accel_engine.c`)
