# chainsx/openwrt-sunxi-aiot architecture

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

- Interactive diagram: https://gitdiagram.com/chainsx/openwrt-sunxi-aiot
- Repository: https://github.com/chainsx/openwrt-sunxi-aiot

## Overview

OpenWrt is an embedded Linux operating system and customization framework: users select packages and configure a writable system, with opkg managing installed packages. The README describes firmware building, but build machinery is outside this runtime map. The tree and excerpts show selected networking, authentication, display, storage, and accelerator components—not the complete OS or package-manager implementation. Edges are limited to README statements and source-index or excerpt references; unsampled subsystem wiring is omitted.

Main entry points: [`package/network/services/ead/src/ead-client.c`](https://github.com/chainsx/openwrt-sunxi-aiot/blob/openwrt-24.10/package/network/services/ead/src/ead-client.c) (EAD client), [`package/network/services/ead/src/tinysrp/t_client.c`](https://github.com/chainsx/openwrt-sunxi-aiot/blob/openwrt-24.10/package/network/services/ead/src/tinysrp/t_client.c) (SRP authentication), [`package/kernel/lantiq/ltq-adsl-mei/src/drv_mei_cpe.c`](https://github.com/chainsx/openwrt-sunxi-aiot/blob/openwrt-24.10/package/kernel/lantiq/ltq-adsl-mei/src/drv_mei_cpe.c) (DSL MEI driver), [`target/linux/allwinner/files/bsp/drivers/net/wireless/uwe5622/unisocwcn/pcie/edma_engine.c`](https://github.com/chainsx/openwrt-sunxi-aiot/blob/openwrt-24.10/target/linux/allwinner/files/bsp/drivers/net/wireless/uwe5622/unisocwcn/pcie/edma_engine.c) (PCIe EDMA)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_system["System and packages"]
  node_installed["Installed system"]
  node_opkg["opkg manager"]
end

subgraph group_network["Networking"]
  node_mei["DSL MEI driver<br/>[drv_mei_cpe.c]"]
  node_mei_interface["MEI interface"]
  node_edma["PCIe EDMA<br/>[edma_engine.c]"]
  node_edma_header["EDMA definitions<br/>[edma_engine.h]"]
  node_wireless_dispatch["Wireless dispatcher"]
end

subgraph group_hardware["Hardware support"]
  node_eink_display["E-ink pipeline<br/>[pipeline_mgr.c]"]
  node_eink_update["E-ink updates"]
  node_npu_api["GPU and NPU API<br/>[gc_hal_engine.h]"]
end

subgraph group_security["Security and storage"]
  node_ead_client["EAD client<br/>[ead-client.c]"]
  node_srp_client["SRP authentication<br/>[t_client.c]"]
  node_srp_types["SRP client types<br/>[t_client.h]"]
  node_ead_password["Password hashing<br/>[pw_encrypt_md5.c]"]
  node_mtd["Flash management<br/>[mtd.c]"]
  node_secure_storage["Secure storage<br/>[secure_storage.c]"]
end

node_user(("OpenWrt user"))

node_user -->|"customizes"| node_installed
node_installed -->|"manages packages"| node_opkg
node_mei -->|"uses interface"| node_mei_interface
node_edma -->|"uses definitions"| node_edma_header
node_ead_client -->|"uses authentication"| node_srp_client
node_ead_client -->|"imports"| node_ead_password
node_srp_client -->|"implements types"| node_srp_types

click node_mei "https://github.com/chainsx/openwrt-sunxi-aiot/blob/openwrt-24.10/package/kernel/lantiq/ltq-adsl-mei/src/drv_mei_cpe.c"
click node_mei_interface "https://github.com/chainsx/openwrt-sunxi-aiot/blob/openwrt-24.10/package/kernel/lantiq/ltq-adsl-mei/src/ifxmips_mei_interface.h"
click node_edma "https://github.com/chainsx/openwrt-sunxi-aiot/blob/openwrt-24.10/target/linux/allwinner/files/bsp/drivers/net/wireless/uwe5622/unisocwcn/pcie/edma_engine.c"
click node_edma_header "https://github.com/chainsx/openwrt-sunxi-aiot/blob/openwrt-24.10/target/linux/allwinner/files/bsp/drivers/net/wireless/uwe5622/unisocwcn/pcie/edma_engine.h"
click node_wireless_dispatch "https://github.com/chainsx/openwrt-sunxi-aiot/blob/openwrt-24.10/target/linux/allwinner/files/bsp/drivers/net/wireless/rtl8852bs/phl/phl_cmd_dispatch_engine.c"
click node_ead_client "https://github.com/chainsx/openwrt-sunxi-aiot/blob/openwrt-24.10/package/network/services/ead/src/ead-client.c"
click node_srp_client "https://github.com/chainsx/openwrt-sunxi-aiot/blob/openwrt-24.10/package/network/services/ead/src/tinysrp/t_client.c"
click node_srp_types "https://github.com/chainsx/openwrt-sunxi-aiot/blob/openwrt-24.10/package/network/services/ead/src/tinysrp/t_client.h"
click node_ead_password "https://github.com/chainsx/openwrt-sunxi-aiot/blob/openwrt-24.10/package/network/services/ead/src/pw_encrypt_md5.c"
click node_mtd "https://github.com/chainsx/openwrt-sunxi-aiot/blob/openwrt-24.10/package/system/mtd/src/mtd.c"
click node_secure_storage "https://github.com/chainsx/openwrt-sunxi-aiot/blob/openwrt-24.10/target/linux/allwinner/files/bsp/drivers/secure_storage/secure_storage.c"
click node_eink_display "https://github.com/chainsx/openwrt-sunxi-aiot/blob/openwrt-24.10/target/linux/allwinner/files/bsp/drivers/video/sunxi/disp2/eink200/pipeline_mgr.c"
click node_eink_update "https://github.com/chainsx/openwrt-sunxi-aiot/blob/openwrt-24.10/target/linux/allwinner/files/bsp/drivers/video/sunxi/disp2/disp/de/eink_pipeline_manager.c"
click node_npu_api "https://github.com/chainsx/openwrt-sunxi-aiot/blob/openwrt-24.10/target/linux/allwinner/files/bsp/drivers/npu/aw_nna_galcore/inc/gc_hal_engine.h"

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_installed,node_opkg,node_user toneBlue
class node_mei,node_mei_interface,node_edma,node_edma_header,node_wireless_dispatch toneAmber
class node_eink_display,node_eink_update,node_npu_api toneMint
class node_ead_client,node_srp_client,node_srp_types,node_ead_password,node_mtd,node_secure_storage toneRose
```

## Components

### System and packages

- **Installed system**
- **opkg manager**

### Networking

- [DSL MEI driver](https://github.com/chainsx/openwrt-sunxi-aiot/blob/openwrt-24.10/package/kernel/lantiq/ltq-adsl-mei/src/drv_mei_cpe.c): `package/kernel/lantiq/ltq-adsl-mei/src/drv_mei_cpe.c`
- [MEI interface](https://github.com/chainsx/openwrt-sunxi-aiot/blob/openwrt-24.10/package/kernel/lantiq/ltq-adsl-mei/src/ifxmips_mei_interface.h): `package/kernel/lantiq/ltq-adsl-mei/src/ifxmips_mei_interface.h`
- [PCIe EDMA](https://github.com/chainsx/openwrt-sunxi-aiot/blob/openwrt-24.10/target/linux/allwinner/files/bsp/drivers/net/wireless/uwe5622/unisocwcn/pcie/edma_engine.c): `target/linux/allwinner/files/bsp/drivers/net/wireless/uwe5622/unisocwcn/pcie/edma_engine.c`
- [EDMA definitions](https://github.com/chainsx/openwrt-sunxi-aiot/blob/openwrt-24.10/target/linux/allwinner/files/bsp/drivers/net/wireless/uwe5622/unisocwcn/pcie/edma_engine.h): `target/linux/allwinner/files/bsp/drivers/net/wireless/uwe5622/unisocwcn/pcie/edma_engine.h`
- [Wireless dispatcher](https://github.com/chainsx/openwrt-sunxi-aiot/blob/openwrt-24.10/target/linux/allwinner/files/bsp/drivers/net/wireless/rtl8852bs/phl/phl_cmd_dispatch_engine.c): `target/linux/allwinner/files/bsp/drivers/net/wireless/rtl8852bs/phl/phl_cmd_dispatch_engine.c`

### Hardware support

- [E-ink pipeline](https://github.com/chainsx/openwrt-sunxi-aiot/blob/openwrt-24.10/target/linux/allwinner/files/bsp/drivers/video/sunxi/disp2/eink200/pipeline_mgr.c): `target/linux/allwinner/files/bsp/drivers/video/sunxi/disp2/eink200/pipeline_mgr.c`
- [E-ink updates](https://github.com/chainsx/openwrt-sunxi-aiot/blob/openwrt-24.10/target/linux/allwinner/files/bsp/drivers/video/sunxi/disp2/disp/de/eink_pipeline_manager.c): `target/linux/allwinner/files/bsp/drivers/video/sunxi/disp2/disp/de/eink_pipeline_manager.c`
- [GPU and NPU API](https://github.com/chainsx/openwrt-sunxi-aiot/blob/openwrt-24.10/target/linux/allwinner/files/bsp/drivers/npu/aw_nna_galcore/inc/gc_hal_engine.h): `target/linux/allwinner/files/bsp/drivers/npu/aw_nna_galcore/inc/gc_hal_engine.h`

### Security and storage

- [EAD client](https://github.com/chainsx/openwrt-sunxi-aiot/blob/openwrt-24.10/package/network/services/ead/src/ead-client.c): `package/network/services/ead/src/ead-client.c`
- [SRP authentication](https://github.com/chainsx/openwrt-sunxi-aiot/blob/openwrt-24.10/package/network/services/ead/src/tinysrp/t_client.c): `package/network/services/ead/src/tinysrp/t_client.c`
- [SRP client types](https://github.com/chainsx/openwrt-sunxi-aiot/blob/openwrt-24.10/package/network/services/ead/src/tinysrp/t_client.h): `package/network/services/ead/src/tinysrp/t_client.h`
- [Password hashing](https://github.com/chainsx/openwrt-sunxi-aiot/blob/openwrt-24.10/package/network/services/ead/src/pw_encrypt_md5.c): `package/network/services/ead/src/pw_encrypt_md5.c`
- [Flash management](https://github.com/chainsx/openwrt-sunxi-aiot/blob/openwrt-24.10/package/system/mtd/src/mtd.c): `package/system/mtd/src/mtd.c`
- [Secure storage](https://github.com/chainsx/openwrt-sunxi-aiot/blob/openwrt-24.10/target/linux/allwinner/files/bsp/drivers/secure_storage/secure_storage.c): `target/linux/allwinner/files/bsp/drivers/secure_storage/secure_storage.c`

### Other components

- **OpenWrt user**

## Connections

- OpenWrt user → Installed system: customizes
- Installed system → opkg manager: manages packages
- DSL MEI driver → MEI interface: uses interface (evidence: `package/kernel/lantiq/ltq-adsl-mei/src/drv_mei_cpe.c`)
- PCIe EDMA → EDMA definitions: uses definitions (evidence: `target/linux/allwinner/files/bsp/drivers/net/wireless/uwe5622/unisocwcn/pcie/edma_engine.c`)
- EAD client → SRP authentication: uses authentication (evidence: `package/network/services/ead/src/tinysrp/t_client.c`)
- EAD client → Password hashing: imports (evidence: `package/network/services/ead/src/ead-client.c`)
- SRP authentication → SRP client types: implements types (evidence: `package/network/services/ead/src/tinysrp/t_client.c`)
