diff options
| author | Richard Qin <richard.qin.x@gmail.com> | 2026-07-10 11:31:46 +0800 |
|---|---|---|
| committer | Richard Qin <richard.qin.x@gmail.com> | 2026-07-10 11:31:46 +0800 |
| commit | e90b72ec3082588b296956730bd2930cf8d5d671 (patch) | |
| tree | 36ff6916af9b4176ea5a9662219d11e721f0b691 /include/kernel/fdt.h | |
| parent | 1767d390fbf3d0c65389de46caf0b6d43ef3b6ad (diff) | |
| download | lume-e90b72ec3082588b296956730bd2930cf8d5d671.tar.gz lume-e90b72ec3082588b296956730bd2930cf8d5d671.tar.xz | |
refactor: promote new architecture to repository root
Archive the deprecated implementation under lume-legacy, make the new kernel the default root-level build, and update repository entry points without changing kernel behavior.
Diffstat (limited to 'include/kernel/fdt.h')
| -rw-r--r-- | include/kernel/fdt.h | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/include/kernel/fdt.h b/include/kernel/fdt.h deleted file mode 100644 index 89cbae6..0000000 --- a/include/kernel/fdt.h +++ /dev/null @@ -1,45 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -/* - * Copyright (C) 2026 Richard Qin - * LumeOS - FDT Device Discovery - */ - -#pragma once -#include "common/types.h" - -// Single device descriptor (populated from FDT) -struct FdtDevice { - uint64 base_addr; // MMIO base address - uint64 size; // MMIO region size - uint32 irq; // Interrupt number (0 = none) -}; - -// Device registry — populated by fdt_parse(), consumed by drivers -struct DeviceRegistry { - // Memory - uint64 mem_base; - uint64 mem_size; - - // Core platform devices - FdtDevice uart; - FdtDevice plic; - FdtDevice clint; - - // VirtIO devices (multiple possible) - static constexpr int MAX_VIRTIO = 8; - FdtDevice virtio[MAX_VIRTIO]; - int virtio_count; - - // MMIO ranges for kvminit() to map - static constexpr int MAX_MMIO = 16; - struct MmioRegion { - uint64 base; - uint64 size; - } mmio_regions[MAX_MMIO]; - int mmio_count; -}; - -extern DeviceRegistry g_devices; - -// Parse FDT and populate g_devices -void fdt_parse(uint64 dtb); |
