use deforest::{ blob::{node::NamedRange, Cursor}, prop_value, DeserializeNode, }; #[derive(Default, DeserializeNode)] struct RootNode<'dtb> { address_cells: prop_value::AddressCells, size_cells: prop_value::SizeCells, model: &'dtb str, compatible: prop_value::Strings<'dtb>, serial_number: Option<&'dtb str>, chassis_type: Option<&'dtb str>, #[dt(child)] aliases: Option, #[dt(children)] memory: NamedRange<'dtb>, #[dt(child)] reserved_memory: Option>, #[dt(child)] chosen: Option>, #[dt(child)] cpus: Option>, } #[derive(Default, DeserializeNode)] struct MemoryNode<'dtb> { device_type: Option, reg: Option>, initial_mapped_area: Option, hotpluggable: bool, } #[derive(Default, DeserializeNode)] struct ReservedMemoryNode<'dtb> { address_cells: prop_value::AddressCells, size_cells: prop_value::SizeCells, ranges: &'dtb [u32], } #[derive(Default, DeserializeNode)] struct ReservedMemoryChild<'dtb> { reg: Option>, size: Option<&'dtb [u32]>, alignment: Option<&'dtb [u32]>, alloc_ranges: Option<&'dtb [u32]>, compatible: Option>, no_map: bool, reusable: bool, } #[derive(Default, DeserializeNode)] struct ChosenNode<'dtb> { bootargs: Option<&'dtb str>, stdout_path: Option<&'dtb str>, stdin_path: Option<&'dtb str>, } #[derive(Default, DeserializeNode)] struct CpusNode<'dtb> { address_cells: prop_value::AddressCells, size_cells: prop_value::SizeCells, #[dt(children)] cpu: NamedRange<'dtb>, } #[derive(Default, DeserializeNode)] struct CpuNode<'dtb> { device_type: Option, reg: Option>, clock_frequency: prop_value::SmallU64, timebase_frequency: prop_value::SmallU64, status: Option<&'dtb str>, enable_method: Option>, cpu_release_addr: Option, // // power ISA properties // power_isa_version: Option<&'dtb str>, // cache_op_block_size: Option, // reservation_granule_size: Option, // mmu_type: Option<&'dtb str>, // // power ISA translate look-aside buffer properties // tlb_split: bool, // tlb_size: Option, // tlb_sets: Option, // d_tlb_size: Option, // d_tlb_sets: Option, // i_tlb_size: Option, // i_tlb_sets: Option, // // power ISA cache properties // cache_unified: bool, // cache_size: Option, // cache_sets: Option, // cache_block_size: Option, // cache_line_size: Option, // i_cache_size: Option, // i_cache_sets: Option, // i_cache_block_size: Option, // i_cache_line_size: Option, // d_cache_size: Option, // d_cache_sets: Option, // d_cache_block_size: Option, // d_cache_line_size: Option, // next_level_cache: Option, } // #[derive(Default, DeserializeNode)] // struct MlAndSharedCacheNode<'dtb> { // compatible: &'dtb str, // cache_level: u32, // }