From e671238f39f4ffcc7e5f74fb4c6eb1a5c7a3cbb0 Mon Sep 17 00:00:00 2001 From: Alignof Date: Wed, 10 Sep 2025 16:22:56 +0900 Subject: [PATCH 01/28] [wip][add] add `map_all_device_region` --- hikami_core/src/lib.rs | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/hikami_core/src/lib.rs b/hikami_core/src/lib.rs index bf73c67..9c4c45e 100644 --- a/hikami_core/src/lib.rs +++ b/hikami_core/src/lib.rs @@ -24,8 +24,10 @@ use spin::Mutex; use device::Devices; use guest::Guest; use memmap::constant::MAX_HART_NUM; -use memmap::page_table::sv39x4::FIRST_LV_PAGE_TABLE_LEN; -use memmap::{GuestPhysicalAddress, HostPhysicalAddress, page_table, page_table::PageTableEntry}; +use memmap::page_table::{PteFlag, sv39x4::FIRST_LV_PAGE_TABLE_LEN}; +use memmap::{ + GuestPhysicalAddress, HostPhysicalAddress, MemoryMap, page_table, page_table::PageTableEntry, +}; /// Singleton for this hypervisor. pub static mut HYPERVISOR_DATA: Mutex> = Mutex::new(OnceCell::new()); @@ -53,6 +55,8 @@ impl HypervisorData { // init page table page_table::sv39x4::initialize_page_table(root_page_table_addr); + Self::map_all_device_region(root_page_table_addr, device_tree); + HypervisorData { // fix to zero for now // @@ -64,6 +68,27 @@ impl HypervisorData { } } + /// Map all regions for memory mapped divices. + fn map_all_device_region(root_page_table_addr: HostPhysicalAddress, device_tree: Fdt) { + use PteFlag::{Accessed, Dirty, Exec, Read, User, Valid, Write}; + const G_STAGE_PTE_FLAGS: &[PteFlag; 7] = &[Dirty, Accessed, Read, Write, Exec, User, Valid]; + + let dram_start = device_tree + .find_node("/memory") + .unwrap() + .reg() + .unwrap() + .next() + .expect("couldn't get memory region") + .starting_address as usize; + let all_memory_map = [MemoryMap::new( + GuestPhysicalAddress(0x0)..GuestPhysicalAddress(dram_start), + HostPhysicalAddress(0x0)..HostPhysicalAddress(dram_start), + G_STAGE_PTE_FLAGS, + )]; + page_table::sv39x4::generate_page_table(root_page_table_addr, &all_memory_map); + } + /// Return Device objects. /// /// # Panics From d1c44d42da17ce0e8f91865491e70a674cf3ea47 Mon Sep 17 00:00:00 2001 From: Alignof Date: Wed, 10 Sep 2025 16:51:31 +0900 Subject: [PATCH 02/28] [wip][update] remove `create_page_table_for_other_devices` --- hikami_core/src/device.rs | 36 ------------------------------------ 1 file changed, 36 deletions(-) diff --git a/hikami_core/src/device.rs b/hikami_core/src/device.rs index f026a4c..402f040 100644 --- a/hikami_core/src/device.rs +++ b/hikami_core/src/device.rs @@ -241,36 +241,6 @@ pub struct OtherMmioDevice { pub register_map_regions: Vec, } -/// Create page table for `OtherMmioDevice` -fn create_page_table_for_other_devices( - root_page_table_addr: HostPhysicalAddress, - memory_regions: &[MemoryRegion], - node_name: &str, -) { - for map in memory_regions { - crate::println!( - "[Other MMIO Device Map] {}: {:#x}..{:#x}", - node_name, - map.starting_address as usize, - map.starting_address as usize + map.size.unwrap(), - ) - } - let memory_maps: Vec = memory_regions - .iter() - .cloned() - .map(|mut region| { - if region.starting_address as usize % PAGE_SIZE == 0 { - MemoryMap::from(region) - } else { - region.starting_address = - ((region.starting_address as usize) & !(PAGE_SIZE - 1)) as *const u8; - MemoryMap::from(region) - } - }) - .collect(); - page_table::sv39x4::generate_page_table(root_page_table_addr, &memory_maps); -} - /// Manage devices sush as uart, plic, etc... /// /// `memory_map` has memory region data of each devices. @@ -399,12 +369,6 @@ impl Devices { let register_map_regions: Vec = node.reg().unwrap().collect(); - create_page_table_for_other_devices( - root_page_table_addr, - ®ister_map_regions, - node.name, - ); - other_devices.push(OtherMmioDevice { name: node.name.to_string(), register_map_regions, From 95eb45a4ccc90b4d56caf14d5313de3ac8ccdef9 Mon Sep 17 00:00:00 2001 From: Alignof Date: Wed, 10 Sep 2025 16:54:32 +0900 Subject: [PATCH 03/28] [wip][update] remove `create_page_table` from `Device::new` --- hikami_core/src/device.rs | 9 ++------- hikami_core/src/device/aclint/mswi.rs | 2 ++ hikami_core/src/device/aclint/mtimer.rs | 2 -- hikami_core/src/device/axi_sdc.rs | 4 ++-- hikami_core/src/device/clint.rs | 2 -- hikami_core/src/device/pci.rs | 3 --- hikami_core/src/device/plic.rs | 2 +- hikami_core/src/device/uart.rs | 2 -- hikami_core/src/device/virtio.rs | 6 ------ 9 files changed, 7 insertions(+), 25 deletions(-) diff --git a/hikami_core/src/device.rs b/hikami_core/src/device.rs index 402f040..0552258 100644 --- a/hikami_core/src/device.rs +++ b/hikami_core/src/device.rs @@ -327,8 +327,7 @@ impl Devices { pci.as_ref().map(|x| x.name()).unwrap_or(""), axi_sdc.as_ref().map(|x| x.name()).unwrap_or(""), ]); - let other_mmio_devices = - Self::get_other_mmio_devices(root_page_table_addr, &device_tree, &exclude_list); + let other_mmio_devices = Self::get_other_mmio_devices(&device_tree, &exclude_list); Devices { uart, @@ -342,11 +341,7 @@ impl Devices { } } - fn get_other_mmio_devices( - root_page_table_addr: HostPhysicalAddress, - device_tree: &Fdt, - exclude_list: &[&str], - ) -> Vec { + fn get_other_mmio_devices(device_tree: &Fdt, exclude_list: &[&str]) -> Vec { let mut other_devices = Vec::new(); if let Some(soc) = device_tree.find_node("/soc") { for node in soc.children() { diff --git a/hikami_core/src/device/aclint/mswi.rs b/hikami_core/src/device/aclint/mswi.rs index 0e38a57..35c1913 100644 --- a/hikami_core/src/device/aclint/mswi.rs +++ b/hikami_core/src/device/aclint/mswi.rs @@ -98,6 +98,8 @@ impl MmioDevice for Mswi { let clint_node = device_tree.find_compatible(compatibles)?; let register_map_regions: Vec = clint_node.reg().unwrap().collect(); + // TODO: unmap + Some(Mswi { name: clint_node.name.to_string(), register_map_regions, diff --git a/hikami_core/src/device/aclint/mtimer.rs b/hikami_core/src/device/aclint/mtimer.rs index 311ce27..5a72aa0 100644 --- a/hikami_core/src/device/aclint/mtimer.rs +++ b/hikami_core/src/device/aclint/mtimer.rs @@ -28,8 +28,6 @@ impl MmioDevice for Mtimer { let clint_node = device_tree.find_compatible(compatibles)?; let register_map_regions: Vec = clint_node.reg().unwrap().collect(); - Self::create_page_table(root_page_table_addr, ®ister_map_regions, clint_node.name); - Some(Mtimer { name: clint_node.name.to_string(), register_map_regions, diff --git a/hikami_core/src/device/axi_sdc.rs b/hikami_core/src/device/axi_sdc.rs index 8bc64ec..8ec715e 100644 --- a/hikami_core/src/device/axi_sdc.rs +++ b/hikami_core/src/device/axi_sdc.rs @@ -132,8 +132,8 @@ impl MmioDevice for Mmc { let mmc_node = device_tree.find_compatible(compatibles)?; let register_map_region = mmc_node.reg().unwrap().next().unwrap(); - if cfg!(feature = "identity_map") { - Self::create_page_table(root_page_table_addr, &[register_map_region], mmc_node.name); + if cfg!(not(feature = "identity_map")) { + // TODO: unmap } Some(Mmc { diff --git a/hikami_core/src/device/clint.rs b/hikami_core/src/device/clint.rs index 857b412..f761c41 100644 --- a/hikami_core/src/device/clint.rs +++ b/hikami_core/src/device/clint.rs @@ -27,8 +27,6 @@ impl MmioDevice for Clint { let clint_node = device_tree.find_compatible(compatibles)?; let register_map_regions: Vec = clint_node.reg().unwrap().collect(); - Self::create_page_table(root_page_table_addr, ®ister_map_regions, clint_node.name); - Some(Clint { name: clint_node.name.to_string(), register_map_regions, diff --git a/hikami_core/src/device/pci.rs b/hikami_core/src/device/pci.rs index 19c4793..c4b2d47 100644 --- a/hikami_core/src/device/pci.rs +++ b/hikami_core/src/device/pci.rs @@ -294,9 +294,6 @@ impl MmioDevice for Pci { let pci_addr_space = PciAddressSpace::new(device_tree, compatibles); let pci_devices = PciDevices::new(device_tree, base_address, &pci_addr_space); - // map Pci's register map - Self::create_page_table(root_page_table_addr, ®ister_map_regions, pci_node.name); - let memory_maps = vec![ // 32 bit reserved memory map MemoryMap::new( diff --git a/hikami_core/src/device/plic.rs b/hikami_core/src/device/plic.rs index d4187ac..936d652 100644 --- a/hikami_core/src/device/plic.rs +++ b/hikami_core/src/device/plic.rs @@ -267,7 +267,7 @@ impl MmioDevice for Plic { let plic_node = device_tree.find_compatible(compatibles)?; let register_map_regions: Vec = plic_node.reg().unwrap().collect(); - Self::create_page_table(root_page_table_addr, ®ister_map_regions, plic_node.name); + // TODO: unmap Some(Plic { name: plic_node.name.to_string(), diff --git a/hikami_core/src/device/uart.rs b/hikami_core/src/device/uart.rs index 5ad40ea..1902234 100644 --- a/hikami_core/src/device/uart.rs +++ b/hikami_core/src/device/uart.rs @@ -50,8 +50,6 @@ impl MmioDevice for Uart { }); let register_map_regions: Vec = uart_node.reg().unwrap().collect(); - Self::create_page_table(root_page_table_addr, ®ister_map_regions, uart_node.name); - UART_ADDR .lock() .get_or_init(|| HostPhysicalAddress(register_map_regions[0].starting_address as usize)); diff --git a/hikami_core/src/device/virtio.rs b/hikami_core/src/device/virtio.rs index 43dd2e4..835c466 100644 --- a/hikami_core/src/device/virtio.rs +++ b/hikami_core/src/device/virtio.rs @@ -50,12 +50,6 @@ impl VirtIo { pub fn new_with_node(root_page_table_addr: HostPhysicalAddress, virtio_node: &FdtNode) -> Self { let register_map_regions: Vec = virtio_node.reg().unwrap().collect(); - Self::create_page_table( - root_page_table_addr, - ®ister_map_regions, - virtio_node.name, - ); - VirtIo { name: virtio_node.name.to_string(), register_map_regions, From bda752cac8c2beb81a4f4a9bf0f5b9ba78f0ca39 Mon Sep 17 00:00:00 2001 From: Alignof Date: Wed, 10 Sep 2025 17:58:55 +0900 Subject: [PATCH 04/28] [wip][add] add `invalidate_address_range` --- hikami_core/src/memmap/page_table.rs | 2 + hikami_core/src/memmap/page_table/sv39x4.rs | 177 +++++++++++++++++++- 2 files changed, 178 insertions(+), 1 deletion(-) diff --git a/hikami_core/src/memmap/page_table.rs b/hikami_core/src/memmap/page_table.rs index f378ab6..002a1e4 100644 --- a/hikami_core/src/memmap/page_table.rs +++ b/hikami_core/src/memmap/page_table.rs @@ -25,6 +25,8 @@ pub enum TransAddrError { InvalidEntry, /// Cannot reach leaf entry. NoLeafEntry, + /// Unsupported page size. + UnsupportedPageSize, } /// Page table level. diff --git a/hikami_core/src/memmap/page_table/sv39x4.rs b/hikami_core/src/memmap/page_table/sv39x4.rs index 45292b6..cf7c829 100644 --- a/hikami_core/src/memmap/page_table/sv39x4.rs +++ b/hikami_core/src/memmap/page_table/sv39x4.rs @@ -1,4 +1,4 @@ -//! Sv39x4: Page-Based 39-bit Virtual-Memory System **in G-stage**. +//! Sv39x4: Page-Based 39-bit Virtual-Memory System **in G-stage**. //! For guest physical address translation. //! //! [The RISC-V Instruction Set Manual: Volume II Version 20240411](https://github.com/riscv/riscv-isa-manual/releases/download/20240411/priv-isa-asciidoc.pdf) p.151 @@ -12,6 +12,7 @@ use crate::memmap::{GuestPhysicalAddress, HostPhysicalAddress, MemoryMap}; use alloc::boxed::Box; use alloc::vec::Vec; +use core::ops::Range; use core::slice::from_raw_parts_mut; /// First page table size @@ -398,3 +399,177 @@ pub fn update_page_flags( "Update failed: page table walk did not end on a leaf PTE", )) } + +/// Splits a superpage leaf PTE into a table of smaller pages. +/// +/// This function is called when a part of a large page (1GB or 2MB) needs to be +/// unmapped. It replaces the single large leaf PTE with a pointer to a new, +/// next-level page table. This new table is then populated with leaf PTEs for +/// smaller pages that collectively map the same physical address range as the +/// original superpage. +/// +/// # Arguments +/// * `pte` - A mutable reference to the superpage leaf PTE to be split. +/// * `level` - The page table level of the superpage PTE (e.g., Lv1GB, Lv2MB). +/// +/// # Returns +/// * `Ok(())` on success. +/// * `Err` if memory for the new page table cannot be allocated or if an attempt +/// is made to split an unsplittable page (e.g., 4KB). +fn split_superpage( + pte: &mut PageTableEntry, + level: PageTableLevel, +) -> Result<(), (TransAddrError, &'static str)> { + if !matches!(level, PageTableLevel::Lv1GB | PageTableLevel::Lv2MB) { + // Only 1GB and 2MB pages can be split. + return Err(( + TransAddrError::UnsupportedPageSize, + "Attempted to split an unsplittable page level", + )); + } + + // Get original mapping info from the superpage PTE. + let original_flags = (pte.0 & 0x3ff) as u8; + let original_hpa_base = HostPhysicalAddress(pte.entire_ppn() as usize * PAGE_SIZE); + + // Allocate a new, zeroed page table for the next level down. + let next_level_table = Box::new(PageTableMemory([PageTableEntry::default(); PAGE_TABLE_LEN])); + let next_level_table_addr: PageTableAddress = Box::into_raw(next_level_table).into(); + + // Get a mutable slice to the new table to populate it. + let next_level_page_table: &mut [PageTableEntry] = + unsafe { from_raw_parts_mut(next_level_table_addr.to_pte_ptr(), PAGE_TABLE_LEN) }; + + // Determine the size of the smaller pages we are creating. + let next_level_page_size = match level { + PageTableLevel::Lv1GB => PageTableLevel::Lv2MB.size(), + PageTableLevel::Lv2MB => PageTableLevel::Lv4KB.size(), + _ => unreachable!(), + }; + + // Populate the new page table with leaf entries that map the original region. + for i in 0..PAGE_TABLE_LEN { + let hpa_offset = i * next_level_page_size; + let next_hpa = original_hpa_base + hpa_offset; + + // Create a new leaf PTE with the original permissions. + next_level_page_table[i] = PageTableEntry::new(next_hpa.page_number(), original_flags); + } + + // Atomically update the original PTE to be a pointer to the new table. + // The flags are now just 'Valid' because it's an intermediate PTE. + *pte = PageTableEntry::new(next_level_table_addr.page_number(), PteFlag::Valid as u8); + + Ok(()) +} + +/// Invalidates the G-stage page table entries for a given range of Guest Physical Addresses. +/// +/// This function walks the page table for each part of the specified range +/// and sets the corresponding leaf PTE to 0, effectively unmapping it. +/// If a superpage (1GB or 2MB) covering part of the range is encountered, and the +/// invalidation range is smaller than the superpage, the superpage is split into +/// smaller pages. The process is then restarted for the same address to traverse +/// down the newly created page table structure. +/// +/// # Arguments +/// * `gpa_range` - A `core::ops::Range` to be invalidated. +/// +/// # Returns +/// * `Ok(())` on success. +/// * An `Err` with `TransAddrError` and a descriptive message if the page table +/// structure is invalid (e.g., a walk completes without finding a leaf PTE). +/// +/// # Panics +/// This function will panic if the current `hgatp` register's mode is not `Sv39x4`. +#[allow(clippy::cast_possible_truncation)] +pub fn invalidate_address_range( + gpa_range: Range, +) -> Result<(), (TransAddrError, &'static str)> { + let hgatp = hgatp::read(); + assert!(matches!(hgatp.mode(), hgatp::Mode::Sv39x4)); + let root_page_table_addr = PageTableAddress(hgatp.ppn() << 12); + + let mut current_gpa = gpa_range.start; + + // Loop until we have processed the entire invalidation range. + 'main: while current_gpa < gpa_range.end { + let mut page_table_addr = root_page_table_addr; + + // Walk the page table for the current address. + for level in [ + PageTableLevel::Lv1GB, + PageTableLevel::Lv2MB, + PageTableLevel::Lv4KB, + ] { + let page_table = match level { + PageTableLevel::Lv256TB | PageTableLevel::Lv512GB => unreachable!(), + PageTableLevel::Lv1GB => unsafe { + from_raw_parts_mut(page_table_addr.to_pte_ptr(), FIRST_LV_PAGE_TABLE_LEN) + }, + _ => unsafe { from_raw_parts_mut(page_table_addr.to_pte_ptr(), PAGE_TABLE_LEN) }, + }; + + let vpn = current_gpa.vpn(level as usize); + + // Handle out-of-bounds addresses for the current table level. + if vpn >= page_table.len() { + let page_size = level.size(); + current_gpa = + GuestPhysicalAddress((current_gpa.raw() & !(page_size - 1)) + page_size); + continue 'main; + } + + let pte = &mut page_table[vpn]; + + if pte.is_invalid() { + // This region is already unmapped. Skip past the area this PTE would cover. + let page_size = level.size(); + current_gpa = + GuestPhysicalAddress((current_gpa.raw() & !(page_size - 1)) + page_size); + continue 'main; + } + + if pte.is_leaf() { + let page_size = level.size(); + let page_start_gpa = GuestPhysicalAddress(current_gpa.raw() & !(page_size - 1)); + + // Case 1: The entire page is fully contained within the invalidation range. + // We can invalidate the whole PTE and advance past it. + if gpa_range.start <= page_start_gpa + && (page_start_gpa + page_size) <= gpa_range.end + { + *pte = PageTableEntry(0); + current_gpa = page_start_gpa + page_size; + continue 'main; + } + + // Case 2: The invalidation range partially overlaps or is smaller than the page. + if level == PageTableLevel::Lv4KB { + // Smallest unit. Since current_gpa is in the invalidation range, + // we invalidate this page. + *pte = PageTableEntry(0); + current_gpa = page_start_gpa + page_size; + continue 'main; + } + + // It's a superpage that needs to be split. + split_superpage(pte, level)?; + // After splitting, do not advance current_gpa. Restart the walk from the root + // for the same address, which will now descend into the newly created table. + continue 'main; + } + + // Not a leaf, so descend to the next level table. + page_table_addr = PageTableAddress(pte.entire_ppn() as usize * PAGE_SIZE); + } + + // If the for loop completes without finding a leaf or breaking, it's an error. + return Err(( + TransAddrError::NoLeafEntry, + "Invalid page table structure: walk did not resolve to a leaf", + )); + } + + Ok(()) +} From 9e4ca6164f8c87f70d8784e7d39947f77ab78c40 Mon Sep 17 00:00:00 2001 From: Alignof Date: Wed, 10 Sep 2025 23:34:13 +0900 Subject: [PATCH 05/28] [add] add `MmioDevice::invalidate_page_table` --- hikami_core/src/device.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hikami_core/src/device.rs b/hikami_core/src/device.rs index 0552258..fdb113b 100644 --- a/hikami_core/src/device.rs +++ b/hikami_core/src/device.rs @@ -226,6 +226,13 @@ pub trait MmioDevice { page_table::sv39x4::generate_page_table(root_page_table_addr, &memory_maps); } + /// Invalidate page table + /// + /// This method is disabled by default (only use for emulation). + fn invalidate_page_table(_memory_regions: &[MemoryRegion], node_name: &str) { + unreachable!("unreachable code: {}::invalidate_page_table", node_name); + } + /// Return device tree node name fn name(&self) -> &str; } From 0c99cf9b1b0453b8d496ae9e0b7bee4a3fdac602 Mon Sep 17 00:00:00 2001 From: Alignof Date: Fri, 12 Sep 2025 00:23:32 +0900 Subject: [PATCH 06/28] [add] add error message to `handle_virtual_inst` in the extension_manager --- extension_manager/src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/extension_manager/src/lib.rs b/extension_manager/src/lib.rs index 56b50bb..2dce9b9 100644 --- a/extension_manager/src/lib.rs +++ b/extension_manager/src/lib.rs @@ -21,6 +21,7 @@ pub fn handle_virtual_inst(_input: TokenStream) -> TokenStream { OpcodeKind::Zicsr(_) => { let csr_num = fault_inst.rs2.unwrap() as u16; #(#csr_field_arms)* + unimplemented!("unhandled CSRs: {csr_num:#x}"); } _ => unreachable!(), } From 2c7d13290ff249a88e7faae232eaf465877efb56 Mon Sep 17 00:00:00 2001 From: Alignof Date: Fri, 12 Sep 2025 00:24:20 +0900 Subject: [PATCH 07/28] [!][update] handle senvcfg exception --- src/trap/exception/instruction_handler.rs | 59 ++++++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/src/trap/exception/instruction_handler.rs b/src/trap/exception/instruction_handler.rs index fcb5d0c..cf60858 100644 --- a/src/trap/exception/instruction_handler.rs +++ b/src/trap/exception/instruction_handler.rs @@ -7,7 +7,8 @@ use super::hs_forward_exception; use hikami_core::HYPERVISOR_DATA; use hikami_core::emulate_extension::EmulateExtension; -use raki::{Instruction, OpcodeKind}; +use core::arch::asm; +use raki::{Instruction, OpcodeKind, ZicsrOpcode}; use riscv::register::{sepc, stval}; extension_manager::import_global_variables!(); @@ -50,6 +51,62 @@ pub fn virtual_instruction() { ); }); + // emulate CSR set + match fault_inst.rs2.unwrap() { + // senvcfg + 0x10a => { + let mut context = unsafe { HYPERVISOR_DATA.lock() } + .get() + .unwrap() + .guest() + .context; + + let mut csr: u64; + unsafe { + asm!("csrr {0}, senvcfg", out(reg) csr); + } + + let new_csr = match fault_inst.opc { + OpcodeKind::Zicsr(ZicsrOpcode::CSRRW) => { + let rs1 = context.xreg(fault_inst.rs1.unwrap()); + rs1 + } + OpcodeKind::Zicsr(ZicsrOpcode::CSRRS) => { + let rs1 = context.xreg(fault_inst.rs1.unwrap()); + csr | rs1 + } + OpcodeKind::Zicsr(ZicsrOpcode::CSRRC) => { + let rs1 = context.xreg(fault_inst.rs1.unwrap()); + csr & !rs1 + } + OpcodeKind::Zicsr(ZicsrOpcode::CSRRWI) => { + let imm = fault_inst.imm.unwrap() as u64; + imm + } + OpcodeKind::Zicsr(ZicsrOpcode::CSRRSI) => { + let imm = fault_inst.imm.unwrap() as u64; + csr | imm + } + OpcodeKind::Zicsr(ZicsrOpcode::CSRRCI) => { + let imm = fault_inst.imm.unwrap() as u64; + csr & !imm + } + _ => unreachable!(), + }; + + // commit result + unsafe { + asm!("csrw senvcfg, {0}", in(reg) new_csr); + } + context.set_xreg(fault_inst.rd.unwrap(), csr); + + context.update_sepc_by_inst(&fault_inst); + + return; + } + _ => (), + } + // emulate CSR set extension_manager::handle_virtual_inst!(); } From 58c5536b1a517635600f8810a8cbcc9fbfe4db51 Mon Sep 17 00:00:00 2001 From: Alignof Date: Fri, 12 Sep 2025 00:25:40 +0900 Subject: [PATCH 08/28] [refactor] fix cargo clippy warings --- src/trap/exception/instruction_handler.rs | 87 ++++++++++------------- 1 file changed, 39 insertions(+), 48 deletions(-) diff --git a/src/trap/exception/instruction_handler.rs b/src/trap/exception/instruction_handler.rs index cf60858..2233f0e 100644 --- a/src/trap/exception/instruction_handler.rs +++ b/src/trap/exception/instruction_handler.rs @@ -52,59 +52,50 @@ pub fn virtual_instruction() { }); // emulate CSR set - match fault_inst.rs2.unwrap() { - // senvcfg - 0x10a => { - let mut context = unsafe { HYPERVISOR_DATA.lock() } - .get() - .unwrap() - .guest() - .context; + if fault_inst.rs2.unwrap() == 0x10a { + let mut context = unsafe { HYPERVISOR_DATA.lock() } + .get() + .unwrap() + .guest() + .context; - let mut csr: u64; - unsafe { - asm!("csrr {0}, senvcfg", out(reg) csr); - } - - let new_csr = match fault_inst.opc { - OpcodeKind::Zicsr(ZicsrOpcode::CSRRW) => { - let rs1 = context.xreg(fault_inst.rs1.unwrap()); - rs1 - } - OpcodeKind::Zicsr(ZicsrOpcode::CSRRS) => { - let rs1 = context.xreg(fault_inst.rs1.unwrap()); - csr | rs1 - } - OpcodeKind::Zicsr(ZicsrOpcode::CSRRC) => { - let rs1 = context.xreg(fault_inst.rs1.unwrap()); - csr & !rs1 - } - OpcodeKind::Zicsr(ZicsrOpcode::CSRRWI) => { - let imm = fault_inst.imm.unwrap() as u64; - imm - } - OpcodeKind::Zicsr(ZicsrOpcode::CSRRSI) => { - let imm = fault_inst.imm.unwrap() as u64; - csr | imm - } - OpcodeKind::Zicsr(ZicsrOpcode::CSRRCI) => { - let imm = fault_inst.imm.unwrap() as u64; - csr & !imm - } - _ => unreachable!(), - }; + let mut csr: u64; + unsafe { + asm!("csrr {0}, senvcfg", out(reg) csr); + } - // commit result - unsafe { - asm!("csrw senvcfg, {0}", in(reg) new_csr); + #[allow(clippy::cast_sign_loss)] + let new_csr = match fault_inst.opc { + OpcodeKind::Zicsr(ZicsrOpcode::CSRRW) => context.xreg(fault_inst.rs1.unwrap()), + OpcodeKind::Zicsr(ZicsrOpcode::CSRRS) => { + let rs1 = context.xreg(fault_inst.rs1.unwrap()); + csr | rs1 } - context.set_xreg(fault_inst.rd.unwrap(), csr); - - context.update_sepc_by_inst(&fault_inst); + OpcodeKind::Zicsr(ZicsrOpcode::CSRRC) => { + let rs1 = context.xreg(fault_inst.rs1.unwrap()); + csr & !rs1 + } + OpcodeKind::Zicsr(ZicsrOpcode::CSRRWI) => fault_inst.imm.unwrap() as u64, + OpcodeKind::Zicsr(ZicsrOpcode::CSRRSI) => { + let imm = fault_inst.imm.unwrap() as u64; + csr | imm + } + OpcodeKind::Zicsr(ZicsrOpcode::CSRRCI) => { + let imm = fault_inst.imm.unwrap() as u64; + csr & !imm + } + _ => unreachable!(), + }; - return; + // commit result + unsafe { + asm!("csrw senvcfg, {0}", in(reg) new_csr); } - _ => (), + context.set_xreg(fault_inst.rd.unwrap(), csr); + + context.update_sepc_by_inst(&fault_inst); + + return; } // emulate CSR set From 47cef8422fa44073eff6c29b09b6606b1207ce7f Mon Sep 17 00:00:00 2001 From: Alignof Date: Fri, 12 Sep 2025 03:10:06 +0900 Subject: [PATCH 09/28] [!][update] implement `invalidate_page_table` to each devices --- hikami_core/src/device/aclint/mswi.rs | 22 ++++++++++++++++++++- hikami_core/src/device/axi_sdc.rs | 22 ++++++++++++++++++++- hikami_core/src/device/pci.rs | 28 +++++++++++++++++++++++---- hikami_core/src/device/plic.rs | 20 +++++++++++++++++++ hikami_core/src/lib.rs | 8 ++++++++ 5 files changed, 94 insertions(+), 6 deletions(-) diff --git a/hikami_core/src/device/aclint/mswi.rs b/hikami_core/src/device/aclint/mswi.rs index 35c1913..387616a 100644 --- a/hikami_core/src/device/aclint/mswi.rs +++ b/hikami_core/src/device/aclint/mswi.rs @@ -4,7 +4,7 @@ //! It has an IPI register (MSIP) for each HART connected to the MSWI device. use super::super::{DeviceEmulateError, MmioDevice}; -use crate::memmap::HostPhysicalAddress; +use crate::memmap::{GuestPhysicalAddress, HostPhysicalAddress, page_table}; use alloc::string::{String, ToString}; use alloc::vec::Vec; @@ -99,6 +99,7 @@ impl MmioDevice for Mswi { let register_map_regions: Vec = clint_node.reg().unwrap().collect(); // TODO: unmap + Self::invalidate_page_table(®ister_map_regions, clint_node.name); Some(Mswi { name: clint_node.name.to_string(), @@ -106,6 +107,25 @@ impl MmioDevice for Mswi { }) } + /// Invalidate page table + fn invalidate_page_table(memory_regions: &[MemoryRegion], node_name: &str) { + for map in memory_regions { + // invalidate memory map to emulate plic registers. + let invalidate_range = GuestPhysicalAddress(map.starting_address as usize) + ..GuestPhysicalAddress(map.starting_address as usize + map.size.unwrap()); + + crate::println!( + "[Device Unmap] {}: {:#x}..{:#x}", + node_name, + invalidate_range.start.raw(), + invalidate_range.end.raw() + ); + + page_table::sv39x4::invalidate_address_range(invalidate_range) + .expect("failed to invalidate plic registers range"); + } + } + fn name(&self) -> &str { &self.name } diff --git a/hikami_core/src/device/axi_sdc.rs b/hikami_core/src/device/axi_sdc.rs index 8ec715e..8707927 100644 --- a/hikami_core/src/device/axi_sdc.rs +++ b/hikami_core/src/device/axi_sdc.rs @@ -5,7 +5,7 @@ mod register; use super::{DeviceEmulateError, DmaHostBuffer, EmulateDevice, MmioDevice}; -use crate::memmap::page_table::{constants::PAGE_SIZE, g_stage_trans_addr}; +use crate::memmap::page_table::{self, constants::PAGE_SIZE, g_stage_trans_addr}; use crate::memmap::{GuestPhysicalAddress, HostPhysicalAddress}; use register::SdcRegisters; @@ -134,6 +134,7 @@ impl MmioDevice for Mmc { if cfg!(not(feature = "identity_map")) { // TODO: unmap + Self::invalidate_page_table(&[register_map_region], mmc_node.name); } Some(Mmc { @@ -145,6 +146,25 @@ impl MmioDevice for Mmc { }) } + /// Invalidate page table + fn invalidate_page_table(memory_regions: &[MemoryRegion], node_name: &str) { + for map in memory_regions { + // invalidate memory map to emulate plic registers. + let invalidate_range = GuestPhysicalAddress(map.starting_address as usize) + ..GuestPhysicalAddress(map.starting_address as usize + map.size.unwrap()); + + crate::println!( + "[Device Unmap] {}: {:#x}..{:#x}", + node_name, + invalidate_range.start.raw(), + invalidate_range.end.raw() + ); + + page_table::sv39x4::invalidate_address_range(invalidate_range) + .expect("failed to invalidate plic registers range"); + } + } + fn name(&self) -> &str { &self.name } diff --git a/hikami_core/src/device/pci.rs b/hikami_core/src/device/pci.rs index c4b2d47..bd91e27 100644 --- a/hikami_core/src/device/pci.rs +++ b/hikami_core/src/device/pci.rs @@ -311,10 +311,30 @@ impl MmioDevice for Pci { ), ]; - // map PCI device's register map field - if cfg!(feature = "identity_map") { - // mapping whole memory mapped register region of block divices. - page_table::sv39x4::generate_page_table(root_page_table_addr, &memory_maps); + // map PCI device's register map field if identity_map *disabled*. + if cfg!(not(feature = "identity_map")) { + crate::println!( + "[Device Unmap] pci: {:#x?}", + pci_addr_space.bit32_memory_space.start.raw() + ..pci_addr_space.bit32_memory_space.end.raw(), + ); + crate::println!( + "[Device Unmap] pci: {:#x?}", + pci_addr_space.bit64_memory_space.start.raw() + ..pci_addr_space.bit64_memory_space.end.raw(), + ); + + // unmapping whole memory mapped register region of block divices for emulation. + page_table::sv39x4::invalidate_address_range( + GuestPhysicalAddress(pci_addr_space.bit32_memory_space.start.raw()) + ..GuestPhysicalAddress(pci_addr_space.bit32_memory_space.end.raw()), + ) + .expect("failed to invalidate pci memory map field"); + page_table::sv39x4::invalidate_address_range( + GuestPhysicalAddress(pci_addr_space.bit64_memory_space.start.raw()) + ..GuestPhysicalAddress(pci_addr_space.bit64_memory_space.end.raw()), + ) + .expect("failed to invalidate pci memory map field"); } // Initialize IOMMU diff --git a/hikami_core/src/device/plic.rs b/hikami_core/src/device/plic.rs index 936d652..9b5ec1c 100644 --- a/hikami_core/src/device/plic.rs +++ b/hikami_core/src/device/plic.rs @@ -268,6 +268,7 @@ impl MmioDevice for Plic { let register_map_regions: Vec = plic_node.reg().unwrap().collect(); // TODO: unmap + Self::invalidate_page_table(®ister_map_regions, plic_node.name); Some(Plic { name: plic_node.name.to_string(), @@ -305,6 +306,25 @@ impl MmioDevice for Plic { page_table::sv39x4::generate_page_table(root_page_table_addr, &memory_maps); } + /// Invalidate page table + fn invalidate_page_table(memory_regions: &[MemoryRegion], node_name: &str) { + for map in memory_regions { + // invalidate memory map to emulate plic registers. + let invalidate_range = GuestPhysicalAddress(map.starting_address as usize + ENABLE_BASE) + ..GuestPhysicalAddress(map.starting_address as usize + map.size.unwrap()); + + crate::println!( + "[Device Unmap] {}: {:#x}..{:#x}", + node_name, + invalidate_range.start.raw(), + invalidate_range.end.raw() + ); + + page_table::sv39x4::invalidate_address_range(invalidate_range) + .expect("failed to invalidate plic registers range"); + } + } + fn name(&self) -> &str { &self.name } diff --git a/hikami_core/src/lib.rs b/hikami_core/src/lib.rs index 9c4c45e..e9b8665 100644 --- a/hikami_core/src/lib.rs +++ b/hikami_core/src/lib.rs @@ -81,6 +81,14 @@ impl HypervisorData { .next() .expect("couldn't get memory region") .starting_address as usize; + + crate::println!( + "map memory mapped device region Mapping {:#x} bytes to GPA [{:#x} - {:#x}]", + dram_start, + 0, + dram_start + ); + let all_memory_map = [MemoryMap::new( GuestPhysicalAddress(0x0)..GuestPhysicalAddress(dram_start), HostPhysicalAddress(0x0)..HostPhysicalAddress(dram_start), From 316f5d83d39b7daedcc6b24fd6b11e087819b4fd Mon Sep 17 00:00:00 2001 From: Alignof Date: Sun, 14 Sep 2025 16:04:52 +0900 Subject: [PATCH 10/28] [!][fix] fix `split_memory_maps` --- hikami_core/src/memmap/page_table/sv39x4.rs | 38 ++++++--------------- 1 file changed, 10 insertions(+), 28 deletions(-) diff --git a/hikami_core/src/memmap/page_table/sv39x4.rs b/hikami_core/src/memmap/page_table/sv39x4.rs index cf7c829..c7c0592 100644 --- a/hikami_core/src/memmap/page_table/sv39x4.rs +++ b/hikami_core/src/memmap/page_table/sv39x4.rs @@ -89,11 +89,16 @@ fn split_memory_maps(memmaps: &[MemoryMap]) -> Vec { let mut current_virt = memmap.virt.start; let mut current_phys = memmap.phys.start; + assert!(memmap.virt.start % 0x1000 == 0); + assert!(memmap.phys.start % 0x1000 == 0); + assert!(memmap.virt.end % 0x1000 == 0); + assert!(memmap.phys.end % 0x1000 == 0); + while current_virt < memmap.virt.end { let remaining_len = memmap.virt.end.raw() - current_virt.raw(); // Determine the largest possible page size for the current address - let (page_level, page_size) = if remaining_len >= PageTableLevel::Lv1GB.size() + let (_page_level, page_size) = if remaining_len >= PageTableLevel::Lv1GB.size() && current_virt % PageTableLevel::Lv1GB.size() == 0 && current_phys % PageTableLevel::Lv1GB.size() == 0 { @@ -107,37 +112,14 @@ fn split_memory_maps(memmaps: &[MemoryMap]) -> Vec { (PageTableLevel::Lv4KB, PageTableLevel::Lv4KB.size()) }; - // Calculate the next alignment boundary for the chosen page size - let next_align_boundary = (current_virt.raw() + page_size) & !(page_size - 1); - - // Determine the size of the current chunk to map - let chunk_end_virt = - core::cmp::min(memmap.virt.end, GuestPhysicalAddress(next_align_boundary)); - let chunk_size = chunk_end_virt.raw() - current_virt.raw(); - - let map_size = if page_level != PageTableLevel::Lv4KB { - // For superpages, find the largest aligned chunk possible - let end_of_aligned_chunk = memmap.virt.end.raw() & !(page_size - 1); - if current_virt.raw() < end_of_aligned_chunk { - end_of_aligned_chunk - current_virt.raw() - } else { - page_size - } - } else { - // For 4KB pages, just align to the next superpage boundary - chunk_size - }; - - let final_chunk_size = core::cmp::min(map_size, remaining_len); - split_maps.push(MemoryMap::new( - current_virt..current_virt + final_chunk_size, - current_phys..current_phys + final_chunk_size, + current_virt..current_virt + page_size, + current_phys..current_phys + page_size, &memmap.flags_as_array(), )); - current_virt = current_virt + final_chunk_size; - current_phys = current_phys + final_chunk_size; + current_virt = current_virt + page_size; + current_phys = current_phys + page_size; } } split_maps From ac03a6ced5da855281575768f2e8ffe5a56c26b0 Mon Sep 17 00:00:00 2001 From: Alignof Date: Sun, 14 Sep 2025 16:57:17 +0900 Subject: [PATCH 11/28] [!][update] revert guest.dts --- guest_image/guest.dts | 1192 ++++++++++++++++------------------------- 1 file changed, 450 insertions(+), 742 deletions(-) diff --git a/guest_image/guest.dts b/guest_image/guest.dts index 3e6ea70..c8a6bc2 100644 --- a/guest_image/guest.dts +++ b/guest_image/guest.dts @@ -6,312 +6,6 @@ compatible = "sifive,hifive-unmatched-a00", "sifive,fu740-c000", "sifive,fu740", "eswin,eic7700"; model = "Milk-V Megrez"; - opp-table-d0@cpu { - compatible = "operating-points-v2"; - opp-shared; - phandle = <0x04>; - - opp-24000000 { - opp-hz = <0x00 0x16e3600>; - opp-microvolt = "", "\f5"; - clock-latency-ns = <0x11170>; - }; - - opp-100000000 { - opp-hz = <0x00 0x5f5e100>; - opp-microvolt = "", "\f5"; - clock-latency-ns = <0x11170>; - }; - - opp-200000000 { - opp-hz = <0x00 0xbebc200>; - opp-microvolt = "", "\f5"; - clock-latency-ns = <0x11170>; - }; - - opp-400000000 { - opp-hz = <0x00 0x17d78400>; - opp-microvolt = "", "\f5"; - clock-latency-ns = <0x11170>; - }; - - opp-500000000 { - opp-hz = <0x00 0x1dcd6500>; - opp-microvolt = "", "\f5"; - clock-latency-ns = <0x11170>; - }; - - opp-600000000 { - opp-hz = <0x00 0x23c34600>; - opp-microvolt = "", "\f5"; - clock-latency-ns = <0x11170>; - }; - - opp-700000000 { - opp-hz = <0x00 0x29b92700>; - opp-microvolt = "", "\f5"; - clock-latency-ns = <0x11170>; - }; - - opp-800000000 { - opp-hz = <0x00 0x2faf0800>; - opp-microvolt = "", "\f5"; - clock-latency-ns = <0x11170>; - }; - - opp-900000000 { - opp-hz = <0x00 0x35a4e900>; - opp-microvolt = "", "\f5"; - clock-latency-ns = <0x11170>; - }; - - opp-1000000000 { - opp-hz = <0x00 0x3b9aca00>; - opp-microvolt = "", "\f5"; - clock-latency-ns = <0x11170>; - }; - - opp-1200000000 { - opp-hz = <0x00 0x47868c00>; - opp-microvolt = "", "\f5"; - clock-latency-ns = <0x11170>; - }; - - opp-1300000000 { - opp-hz = <0x00 0x4d7c6d00>; - opp-microvolt = "", "\f5"; - clock-latency-ns = <0x11170>; - }; - - opp-1400000000 { - opp-hz = <0x00 0x53724e00>; - opp-microvolt = "", "\f5"; - clock-latency-ns = <0x11170>; - }; - - opp-1500000000 { - opp-hz = <0x00 0x59682f00>; - opp-microvolt = <0xdbba0>; - clock-latency-ns = <0x11170>; - }; - - opp-1600000000 { - opp-hz = <0x00 0x5f5e1000>; - opp-microvolt = <0xdbba0>; - clock-latency-ns = <0x11170>; - }; - - opp-1700000000 { - opp-hz = <0x00 0x6553f100>; - opp-microvolt = <0xdbba0>; - clock-latency-ns = <0x11170>; - }; - - opp-1800000000 { - opp-hz = <0x00 0x6b49d200>; - opp-microvolt = <0xdbba0>; - clock-latency-ns = <0x11170>; - }; - }; - - opp-table-d1@cpu { - compatible = "operating-points-v2"; - opp-shared; - - opp-24000000 { - opp-hz = <0x00 0x16e3600>; - opp-microvolt = "", "\f5"; - clock-latency-ns = <0x11170>; - }; - - opp-100000000 { - opp-hz = <0x00 0x5f5e100>; - opp-microvolt = "", "\f5"; - clock-latency-ns = <0x11170>; - }; - - opp-200000000 { - opp-hz = <0x00 0xbebc200>; - opp-microvolt = "", "\f5"; - clock-latency-ns = <0x11170>; - }; - - opp-400000000 { - opp-hz = <0x00 0x17d78400>; - opp-microvolt = "", "\f5"; - clock-latency-ns = <0x11170>; - }; - - opp-500000000 { - opp-hz = <0x00 0x1dcd6500>; - opp-microvolt = "", "\f5"; - clock-latency-ns = <0x11170>; - }; - - opp-600000000 { - opp-hz = <0x00 0x23c34600>; - opp-microvolt = "", "\f5"; - clock-latency-ns = <0x11170>; - }; - - opp-700000000 { - opp-hz = <0x00 0x29b92700>; - opp-microvolt = "", "\f5"; - clock-latency-ns = <0x11170>; - }; - - opp-800000000 { - opp-hz = <0x00 0x2faf0800>; - opp-microvolt = "", "\f5"; - clock-latency-ns = <0x11170>; - }; - - opp-900000000 { - opp-hz = <0x00 0x35a4e900>; - opp-microvolt = "", "\f5"; - clock-latency-ns = <0x11170>; - }; - - opp-1000000000 { - opp-hz = <0x00 0x3b9aca00>; - opp-microvolt = "", "\f5"; - clock-latency-ns = <0x11170>; - }; - - opp-1200000000 { - opp-hz = <0x00 0x47868c00>; - opp-microvolt = "", "\f5"; - clock-latency-ns = <0x11170>; - }; - - opp-1300000000 { - opp-hz = <0x00 0x4d7c6d00>; - opp-microvolt = "", "\f5"; - clock-latency-ns = <0x11170>; - }; - - opp-1400000000 { - opp-hz = <0x00 0x53724e00>; - opp-microvolt = "", "\f5"; - clock-latency-ns = <0x11170>; - }; - }; - - opp-table@dsp { - compatible = "operating-points-v2"; - phandle = <0x22>; - - opp@520000000 { - opp-hz = <0x00 0x1efe9200>; - opp-microvolt = "", "\f5"; - }; - - opp@1040000000 { - opp-hz = <0x00 0x3dfd2400>; - opp-microvolt = "", "\f5"; - }; - }; - - opp-table@npu { - compatible = "operating-points-v2"; - phandle = <0x1f>; - - opp@1040000000 { - opp-hz = <0x00 0x3dfd2400>; - opp-microvolt = <0xdbba0>; - }; - - opp@1500000000 { - opp-hz = <0x00 0x59682f00>; - opp-microvolt = <0x100590>; - }; - }; - - opp-table@g2d { - compatible = "operating-points-v2"; - phandle = <0x28>; - - opp@260000000 { - opp-hz = <0x00 0xf7f4900>; - opp-microvolt = "", "\f5"; - }; - - opp@520000000 { - opp-hz = <0x00 0x1efe9200>; - opp-microvolt = "", "\f5"; - }; - - opp@693333334 { - opp-hz = <0x00 0x29536d56>; - opp-microvolt = "", "\f5"; - }; - - opp@1040000000 { - opp-hz = <0x00 0x3dfd2400>; - opp-microvolt = "", "\f5"; - }; - }; - - opp-table@vi { - compatible = "operating-points-v2"; - phandle = <0x47>; - - opp@800000000 { - opp-hz = <0x00 0x2faf0800>; - opp-microvolt = "", "\f5"; - }; - - opp@400000000 { - opp-hz = <0x00 0x17d78400>; - opp-microvolt = "", "\f5"; - }; - - opp@200000000 { - opp-hz = <0x00 0xbebc200>; - opp-microvolt = "", "\f5"; - }; - }; - - opp-table@venc { - compatible = "operating-points-v2"; - phandle = <0x2e>; - - opp@800000000 { - opp-hz = <0x00 0x2faf0800>; - opp-microvolt = "", "\f5"; - }; - - opp@400000000 { - opp-hz = <0x00 0x17d78400>; - opp-microvolt = "", "\f5"; - }; - - opp@200000000 { - opp-hz = <0x00 0xbebc200>; - opp-microvolt = "", "\f5"; - }; - }; - - opp-table@vdec { - compatible = "operating-points-v2"; - phandle = <0x2d>; - - opp@800000000 { - opp-hz = <0x00 0x2faf0800>; - opp-microvolt = "", "\f5"; - }; - - opp@400000000 { - opp-hz = <0x00 0x17d78400>; - opp-microvolt = "", "\f5"; - }; - - opp@200000000 { - opp-hz = <0x00 0xbebc200>; - opp-microvolt = "", "\f5"; - }; - }; - cpus { #address-cells = <0x01>; #size-cells = <0x00>; @@ -369,6 +63,7 @@ #cooling-cells = <0x02>; dynamic-power-coefficient = <0x144>; cpu-idle-states = <0x05>; + phandle = <0x4a>; interrupt-controller { #interrupt-cells = <0x01>; @@ -419,6 +114,7 @@ #cooling-cells = <0x02>; dynamic-power-coefficient = <0x144>; cpu-idle-states = <0x05>; + phandle = <0x4b>; interrupt-controller { #interrupt-cells = <0x01>; @@ -468,6 +164,7 @@ #cooling-cells = <0x02>; dynamic-power-coefficient = <0x144>; cpu-idle-states = <0x05>; + phandle = <0x4c>; interrupt-controller { #interrupt-cells = <0x01>; @@ -517,6 +214,7 @@ #cooling-cells = <0x02>; dynamic-power-coefficient = <0x144>; cpu-idle-states = <0x05>; + phandle = <0x4d>; interrupt-controller { #interrupt-cells = <0x01>; @@ -528,6 +226,15 @@ */ }; + memory@90000000 { + compatible = "sifive,axi4-mem-port", "sifive,axi4-port", "sifive,mem-port"; + device_type = "memory"; + reg = <0x00 0x90000000 0x00 0x20000000>; + sifive,port-width-bytes = <0x20>; + numa-node-id = <0x00>; + phandle = <0x14>; + }; + soc { #address-cells = <0x02>; #size-cells = <0x02>; @@ -539,9 +246,7 @@ riscv,event-to-mhpmcounters = <0x01 0x01 0x01 0x02 0x02 0x02 0x04 0x06 0x1f8 0x10009 0x10009 0x1f8 0x10019 0x10019 0x1f8 0x10021 0x10021 0x1f8>; riscv,event-to-mhpmevent = <0x04 0x00 0x202 0x05 0x00 0x4000 0x06 0x00 0x2001 0x10009 0x00 0x102 0x10019 0x00 0x1002 0x10021 0x00 0x802>; compatible = "riscv,pmu0", "riscv,pmu"; - // interrupts-extended = <0x0c 0x0d 0x0d 0x0d 0x0e 0x0d 0x0f 0x0d>; - interrupts-extended = <0x0c 0x0d>; - numa-node-id = <0x00>; + interrupts-extended = <0x0c 0x0d 0x0d 0x0d 0x0e 0x0d 0x0f 0x0d>; }; authentication-controller { @@ -595,7 +300,6 @@ interrupts = <0x205>; reg = <0x00 0x1700000 0x00 0x1000>; reg-names = "control"; - numa-node-id = <0x00>; phandle = <0x02>; }; @@ -605,7 +309,6 @@ interrupts = <0x206>; reg = <0x00 0x1701000 0x00 0x1000>; reg-names = "control"; - numa-node-id = <0x00>; phandle = <0x07>; }; @@ -615,7 +318,6 @@ interrupts = <0x207>; reg = <0x00 0x1702000 0x00 0x1000>; reg-names = "control"; - numa-node-id = <0x00>; phandle = <0x09>; }; @@ -625,13 +327,10 @@ interrupts = <0x208>; reg = <0x00 0x1703000 0x00 0x1000>; reg-names = "control"; - numa-node-id = <0x00>; phandle = <0x0b>; }; cache-controller@2010000 { - #address-cells = <0x02>; - #size-cells = <0x02>; cache-block-size = <0x40>; cache-level = <0x03>; cache-sets = <0x1000>; @@ -640,6 +339,7 @@ compatible = "sifive,ccache1", "cache", "sifive,fu740-c000-ccache"; interrupt-parent = <0x10>; interrupts = <0x01 0x03 0x04 0x02>; + next-level-cache = <0x11 0x12 0x13 0x14>; reg = <0x00 0x2010000 0x00 0x4000 0x00 0x8000000 0x00 0x400000>; reg-names = "control", "sideband"; sifive,a-mshr-count = <0x3c>; @@ -648,13 +348,7 @@ sifive,max-master-id = <0x0d>; sifive,perfmon-counters = <0x06>; numa-node-id = <0x00>; - ranges; - phandle = <0x11>; - - zero-device@1a000000 { - compatible = "l3,zero-device"; - reg = <0x00 0x1a000000 0x00 0x400000>; - }; + phandle = <0x15>; }; debug-controller@0 { @@ -672,14 +366,14 @@ error-device@10003000 { compatible = "sifive,error0"; reg = <0x00 0x10003000 0x00 0x1000>; + phandle = <0x11>; }; interrupt-controller@c000000 { #interrupt-cells = <0x01>; compatible = "sifive,plic-1.0.0"; interrupt-controller; - //interrupts-extended = <0x0c 0xffffffff 0x0c 0x09 0x0d 0xffffffff 0x0d 0x09 0x0e 0xffffffff 0x0e 0x09 0x0f 0xffffffff 0x0f 0x09>; - interrupts-extended = <0x0c 0xffffffff 0x0c 0x09>; + interrupts-extended = <0x0c 0xffffffff 0x0c 0x09 0x0d 0xffffffff 0x0d 0x09 0x0e 0xffffffff 0x0e 0x09 0x0f 0xffffffff 0x0f 0x09>; reg = <0x00 0xc000000 0x00 0x4000000>; reg-names = "control"; riscv,max-priority = <0x07>; @@ -703,12 +397,11 @@ cache-size = <0x40000>; cache-unified; compatible = "sifive,pL2Cache0", "cache"; - next-level-cache = <0x11>; + next-level-cache = <0x15>; reg = <0x00 0x104000 0x00 0x4000>; reg-names = "control"; sifive,ecc-granularity = <0x10>; sifive,perfmon-counters = <0x06>; - numa-node-id = <0x00>; phandle = <0x01>; }; @@ -719,12 +412,11 @@ cache-size = <0x40000>; cache-unified; compatible = "sifive,pL2Cache0", "cache"; - next-level-cache = <0x11>; + next-level-cache = <0x15>; reg = <0x00 0x108000 0x00 0x4000>; reg-names = "control"; sifive,ecc-granularity = <0x10>; sifive,perfmon-counters = <0x06>; - numa-node-id = <0x00>; phandle = <0x06>; }; @@ -735,12 +427,11 @@ cache-size = <0x40000>; cache-unified; compatible = "sifive,pL2Cache0", "cache"; - next-level-cache = <0x11>; + next-level-cache = <0x15>; reg = <0x00 0x10c000 0x00 0x4000>; reg-names = "control"; sifive,ecc-granularity = <0x10>; sifive,perfmon-counters = <0x06>; - numa-node-id = <0x00>; phandle = <0x08>; }; @@ -751,23 +442,24 @@ cache-size = <0x40000>; cache-unified; compatible = "sifive,pL2Cache0", "cache"; - next-level-cache = <0x11>; + next-level-cache = <0x15>; reg = <0x00 0x110000 0x00 0x4000>; reg-names = "control"; sifive,ecc-granularity = <0x10>; sifive,perfmon-counters = <0x06>; - numa-node-id = <0x00>; phandle = <0x0a>; }; rom@1a000000 { compatible = "ucbbar,cacheable-zero0"; reg = <0x00 0x1a000000 0x00 0x400000>; + phandle = <0x12>; }; rom@3a000000 { compatible = "ucbbar,cacheable-zero0"; reg = <0x00 0x3a000000 0x00 0x400000>; + phandle = <0x13>; }; subsystem_pbus_clock { @@ -839,7 +531,6 @@ reg-io-width = <0x04>; numa-node-id = <0x00>; status = "okay"; - phandle = <0x27>; }; serial@0x50910000 { @@ -851,7 +542,7 @@ reg-shift = <0x02>; reg-io-width = <0x04>; numa-node-id = <0x00>; - status = "disabled"; + status = "okay"; }; serial@0x50920000 { @@ -863,7 +554,7 @@ reg-shift = <0x02>; reg-io-width = <0x04>; numa-node-id = <0x00>; - status = "disabled"; + status = "okay"; }; serial@0x50930000 { @@ -890,20 +581,19 @@ status = "disabled"; }; - /* scu_sys_con@0x51810000 { compatible = "eswin,win2030-scu-sys-con", "syscon", "simple-mfd"; #syscon-cells = <0x02>; #size-cells = <0x02>; reg = <0x00 0x51810000 0x00 0x8000>; numa-node-id = <0x00>; - phandle = <0x13>; + phandle = <0x17>; noc@51810324 { compatible = "eswin,win2030-noc-wdt"; interrupt-parent = <0x10>; interrupts = <0x188 0x189 0x18a 0x18b 0x18c 0x18d 0x18e 0x18f 0x190 0x191 0x192 0x193 0x194 0x195 0x196 0x197 0x198 0x199 0x19a 0x19b 0x19c 0x19d 0x19e 0x19f 0x1a0 0x1a1 0x1a2 0x1a3 0x1a4 0x1a5 0x1a6 0x1a7 0x1a8 0x1a9 0x1aa>; - eswin,syscrg_csr = <0x12 0x100 0xffff>; + eswin,syscrg_csr = <0x16 0x100 0xffff>; status = "okay"; }; }; @@ -912,63 +602,58 @@ compatible = "eswin,win2030-sys-crg", "syscon", "simple-mfd"; reg = <0x00 0x51828000 0x00 0x80000>; numa-node-id = <0x00>; - phandle = <0x12>; + phandle = <0x16>; reset-controller { compatible = "eswin,win2030-reset"; #reset-cells = <0x02>; - numa-node-id = <0x00>; status = "okay"; - phandle = <0x14>; + phandle = <0x18>; }; clock-controller { compatible = "eswin,win2030-clock"; #clock-cells = <0x01>; - numa-node-id = <0x00>; status = "okay"; force-1_8ghz; phandle = <0x03>; }; }; - */ hfclk { #clock-cells = <0x00>; compatible = "fixed-clock"; clock-frequency = <0xbebc200>; clock-output-names = "hfclk"; - numa-node-id = <0x00>; }; hsp_sp_top_csr@0x50440000 { compatible = "eswin,win2030-hsp-sp-csr", "syscon"; - numa-node-id = <0x00>; #size-cells = <0x02>; reg = <0x00 0x50440000 0x00 0x2000>; - phandle = <0x16>; + phandle = <0x1a>; }; iommu@50c00000 { compatible = "arm,smmu-v3"; reg = <0x00 0x50c00000 0x00 0x100000>; - eswin,syscfg = <0x13 0x3fc>; + eswin,syscfg = <0x17 0x3fc>; interrupt-parent = <0x10>; interrupts = <0x164 0x168 0x165 0x166>; interrupt-names = "eventq", "gerror", "priq", "cmdq-sync"; #iommu-cells = <0x01>; - resets = <0x14 0x05 0x01 0x14 0x05 0x02 0x14 0x05 0x10 0x14 0x05 0x20 0x14 0x05 0x40 0x14 0x05 0x80 0x14 0x05 0x100 0x14 0x05 0x200 0x14 0x05 0x400 0x14 0x05 0x800>; + resets = <0x18 0x05 0x01 0x18 0x05 0x02 0x18 0x05 0x10 0x18 0x05 0x20 0x18 0x05 0x40 0x18 0x05 0x80 0x18 0x05 0x100 0x18 0x05 0x200 0x18 0x05 0x400 0x18 0x05 0x800>; reset-names = "axi_rst", "cfg_rst", "tbu0_rst", "tbu1_rst", "tbu2_rst", "tbu3_rst", "tbu4_rst", "tbu5_rst", "tbu6_rst", "tbu7_rst"; - status = "disabled"; + status = "okay"; numa-node-id = <0x00>; dma-noncoherent; - phandle = <0x15>; + phandle = <0x19>; }; pmu@50c02000 { compatible = "arm,smmu-v3-pmcg"; reg = <0x00 0x50c02000 0x00 0x1000 0x00 0x50c22000 0x00 0x1000>; - eswin,syscfg = <0x13 0x3fc>; + eswin,syscfg = <0x17 0x3fc>; interrupt-parent = <0x10>; interrupts = <0x16b>; status = "disabled"; @@ -980,7 +665,7 @@ compatible = "riscv,dev-foo-a"; #size-cells = <0x02>; dma-ranges = <0x00 0x20000000 0x00 0xc0000000 0x00 0x40000000>; - // iommus = <0x15 0x1c>; + iommus = <0x19 0x1c>; tbus = <0xf00>; status = "okay"; numa-node-id = <0x00>; @@ -994,7 +679,7 @@ #power-domain-cells = <0x01>; reg = <0x00 0x51808000 0x00 0x8000>; numa-node-id = <0x00>; - status = "disabled"; + status = "okay"; win2030-pmu-controller-port@0 { compatible = "eswin,win2030-pmu-controller-port"; @@ -1087,15 +772,41 @@ }; }; + dma-controller-hsp@0x50430000 { + compatible = "eswin,eic770x-axi-dma"; + reg = <0x00 0x50430000 0x00 0x10000>; + interrupt-parent = <0x10>; + interrupts = <0x39>; + #dma-cells = <0x02>; + clocks = <0x03 0x2b2 0x03 0x2b3>; + clock-names = "core-clk", "cfgr-clk"; + resets = <0x18 0x07 0x4000 0x18 0x07 0x100000>; + reset-names = "arst", "prst"; + dma-channels = <0x0c>; + snps,dma-masters = <0x01>; + snps,priority = <0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0a 0x0b>; + snps,data-width = <0x02>; + snps,block-size = <0x80000 0x80000 0x80000 0x80000 0x80000 0x80000 0x80000 0x80000 0x80000 0x80000 0x80000 0x80000>; + snps,axi-max-burst-len = <0x10>; + snps,max-msize = <0x40>; + iommus = <0x19 0x01>; + tbus = <0x02>; + eswin,hsp_sp_csr = <0x1a 0x104c>; + eswin,syscfg = <0x17 0x3004 0x370>; + numa-node-id = <0x00>; + dma-noncoherent; + status = "okay"; + }; + dma-controller-aon@0x518c0000 { compatible = "eswin,eic770x-axi-dma"; reg = <0x00 0x518c0000 0x00 0x10000>; interrupt-parent = <0x10>; interrupts = <0x121>; - #dma-cells = <0x03>; + #dma-cells = <0x02>; clocks = <0x03 0x266 0x03 0x264>; clock-names = "core-clk", "cfgr-clk"; - resets = <0x14 0x27 0x01 0x14 0x27 0x02>; + resets = <0x18 0x27 0x01 0x18 0x27 0x02>; reset-names = "arst", "prst"; dma-channels = <0x10>; snps,dma-masters = <0x02>; @@ -1103,43 +814,16 @@ snps,data-width = <0x03>; snps,block-size = <0x80000 0x80000 0x80000 0x80000 0x80000 0x80000 0x80000 0x80000 0x80000 0x80000 0x80000 0x80000 0x80000 0x80000 0x80000 0x80000>; snps,axi-max-burst-len = <0x20>; - snps,max-msize = <0x40>; #size-cells = <0x02>; #address-cells = <0x02>; dma-ranges = <0x00 0x80000000 0x00 0x80000000 0x100 0x00>; - // iommus = <0x15 0x1a>; + iommus = <0x19 0x1a>; tbus = <0x04>; - eswin,syscfg = <0x13 0x3004 0x370>; - numa-node-id = <0x00>; - dma-noncoherent; - status = "okay"; - phandle = <0x35>; - }; - - dma-controller-hsp@0x50430000 { - compatible = "eswin,eic770x-axi-dma"; - reg = <0x00 0x50430000 0x00 0x10000>; - interrupt-parent = <0x10>; - interrupts = <0x39>; - #dma-cells = <0x03>; - clocks = <0x03 0x2b2 0x03 0x2b3>; - clock-names = "core-clk", "cfgr-clk"; - resets = <0x14 0x07 0x4000 0x14 0x07 0x100000>; - reset-names = "arst", "prst"; - dma-channels = <0x0c>; - snps,dma-masters = <0x01>; - snps,priority = <0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0a 0x0b>; - snps,data-width = <0x02>; - snps,block-size = <0x80000 0x80000 0x80000 0x80000 0x80000 0x80000 0x80000 0x80000 0x80000 0x80000 0x80000 0x80000>; - snps,axi-max-burst-len = <0x10>; - snps,max-msize = <0x40>; - // iommus = <0x15 0x01>; - tbus = <0x02>; - eswin,hsp_sp_csr = <0x16 0x104c>; - eswin,syscfg = <0x13 0x3004 0x370>; + eswin,syscfg = <0x17 0x3004 0x370>; numa-node-id = <0x00>; dma-noncoherent; status = "okay"; + phandle = <0x31>; }; ethernet@50400000 { @@ -1154,29 +838,25 @@ status = "okay"; clocks = <0x03 0x226 0x03 0x227 0x03 0x228>; clock-names = "app", "stmmaceth", "tx"; - resets = <0x14 0x07 0x4000000>; + resets = <0x18 0x07 0x4000000>; reset-names = "ethrst"; tbus = <0x02>; dma-noncoherent; - eswin,hsp_sp_csr = <0x16 0x1030 0x100 0x108>; - eswin,syscrg_csr = <0x12 0x148 0x14c>; - eswin,dly_hsp_reg = <0x114 0x118 0x11c>; - snps,axi-config = <0x17>; + eswin,hsp_sp_csr = <0x1a 0x1030 0x100 0x108>; + eswin,syscrg_csr = <0x16 0x148 0x14c>; + snps,axi-config = <0x1b>; pinctrl-names = "default"; - pinctrl-0 = <0x18>; - rst-gpios = <0x19 0x1e 0x01>; - eswin,rgmiisel = <0x1a 0x290 0x03>; + pinctrl-0 = <0x1c>; + rst-gpios = <0x1d 0x1e 0x01>; + eswin,rgmiisel = <0x1e 0x290 0x03>; eswin,led-cfgs = <0x6100 0xa40 0x420>; - dly-param-1000m = <0x23232323 0x800c8023 0xc0c0c0c>; - dly-param-100m = <0x50505050 0x803f8050 0x3f3f3f3f>; - dly-param-10m = <0x00 0x00 0x00>; stmmac-axi-config { snps,blen = <0x00 0x00 0x00 0x00 0x10 0x08 0x04>; snps,rd_osr_lmt = <0x02>; snps,wr_osr_lmt = <0x02>; snps,lpi_en = <0x00>; - phandle = <0x17>; + phandle = <0x1b>; }; }; @@ -1192,29 +872,25 @@ status = "okay"; clocks = <0x03 0x226 0x03 0x227 0x03 0x229>; clock-names = "app", "stmmaceth", "tx"; - resets = <0x14 0x07 0x2000000>; + resets = <0x18 0x07 0x2000000>; reset-names = "ethrst"; tbus = <0x02>; dma-noncoherent; - eswin,hsp_sp_csr = <0x16 0x1034 0x200 0x208>; - eswin,syscrg_csr = <0x12 0x148 0x14c>; - eswin,dly_hsp_reg = <0x214 0x218 0x21c>; - snps,axi-config = <0x1b>; + eswin,hsp_sp_csr = <0x1a 0x1034 0x200 0x208>; + eswin,syscrg_csr = <0x16 0x148 0x14c>; + snps,axi-config = <0x1f>; pinctrl-names = "default"; - pinctrl-0 = <0x1c>; - rst-gpios = <0x1d 0x10 0x01>; - eswin,rgmiisel = <0x1a 0x294 0x03>; + pinctrl-0 = <0x20>; + rst-gpios = <0x21 0x10 0x01>; + eswin,rgmiisel = <0x1e 0x294 0x03>; eswin,led-cfgs = <0x6100 0xa40 0x420>; - dly-param-1000m = <0x25252525 0x80268025 0x26262626>; - dly-param-100m = <0x48484848 0x80588048 0x58585858>; - dly-param-10m = <0x00 0x00 0x00>; stmmac-axi-config { snps,blen = <0x00 0x00 0x00 0x00 0x10 0x08 0x04>; snps,rd_osr_lmt = <0x02>; snps,wr_osr_lmt = <0x02>; snps,lpi_en = <0x00>; - phandle = <0x1b>; + phandle = <0x1f>; }; }; @@ -1223,7 +899,6 @@ #address-cells = <0x02>; #size-cells = <0x02>; ranges; - numa-node-id = <0x00>; d0_cfg_noc { compatible = "eswin,win2030-noc"; @@ -1231,7 +906,6 @@ #size-cells = <0x02>; ranges; reg = <0x00 0x52060000 0x00 0x4000>; - numa-node-id = <0x00>; interrupts = <0x1be>; interrupt-names = "error"; interrupt-parent = <0x10>; @@ -1308,7 +982,6 @@ }; }; - /* ErrorLogger3 { compatible = "eswin,win2030,register"; offset,length = <0x20 0x20>; @@ -1322,7 +995,6 @@ aperture-idx,aperture-base = <0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x51600000 0x00 0x00 0x00 0x00 0x00 0x01 0x00 0x71600000 0x00 0x00 0x00 0x01 0x00 0x00 0x00 0x51800000 0x00 0x00 0x00 0x01 0x00 0x01 0x00 0x71800000 0x00 0x00 0x00 0x01 0x00 0x02 0x00 0x00 0x00 0x00 0x00 0x01 0x00 0x03 0x00 0x00 0x00 0x00 0x00 0x02 0x00 0x00 0x00 0x52300000 0x00 0x00 0x00 0x02 0x00 0x01 0x00 0x72300000 0x00 0x00 0x00 0x03 0x00 0x00 0x00 0x53000000 0x00 0x00 0x00 0x03 0x00 0x01 0x00 0x73000000 0x00 0x00 0x00 0x04 0x00 0x00 0x00 0x52380000 0x00 0x00 0x00 0x04 0x00 0x01 0x00 0x72380000 0x00 0x00 0x00 0x05 0x00 0x00 0x00 0x53800000 0x00 0x00 0x00 0x05 0x00 0x01 0x00 0x73800000 0x00 0x00 0x00 0x06 0x00 0x00 0x00 0x52200000 0x00 0x00 0x00 0x06 0x00 0x01 0x00 0x72200000 0x00 0x00 0x00 0x07 0x00 0x00 0x00 0x51400000 0x00 0x00 0x00 0x07 0x00 0x01 0x00 0x71400000 0x00 0x00 0x00 0x08 0x00 0x00 0x00 0x50400000 0x00 0x00 0x00 0x08 0x00 0x01 0x00 0x70400000 0x00 0x00 0x00 0x09 0x00 0x00 0x00 0x50800000 0x00 0x00 0x00 0x09 0x00 0x01 0x00 0x70800000 0x00 0x00 0x00 0x0a 0x00 0x00 0x00 0x50900000 0x00 0x00 0x00 0x0a 0x00 0x01 0x00 0x70900000 0x00 0x00 0x00 0x0b 0x00 0x00 0x00 0x50a00000 0x00 0x00 0x00 0x0b 0x00 0x01 0x00 0x70a00000 0x00 0x00 0x00 0x0c 0x00 0x00 0x00 0x50b00000 0x00 0x00 0x00 0x0c 0x00 0x01 0x00 0x70b00000 0x00 0x00 0x00 0x0d 0x00 0x00 0x00 0x52100000 0x00 0x00 0x00 0x0d 0x00 0x01 0x00 0x72100000 0x00 0x00 0x00 0x0e 0x00 0x00 0x00 0x51c00000 0x00 0x00 0x00 0x0e 0x00 0x01 0x00 0x71c00000 0x00 0x00 0x00 0x0f 0x00 0x00 0x00 0x50000000 0x00 0x00 0x00 0x0f 0x00 0x01 0x00 0x70000000 0x00 0x00 0x00 0x10 0x00 0x00 0x00 0x54000000 0x00 0x00 0x00 0x10 0x00 0x01 0x00 0x74000000 0x00 0x00 0x00 0x11 0x00 0x00 0x00 0x52060000 0x00 0x00 0x00 0x11 0x00 0x01 0x00 0x72060000 0x00 0x00 0x00 0x12 0x00 0x00 0x00 0x50c00000 0x00 0x00 0x00 0x12 0x00 0x01 0x00 0x70c00000 0x00 0x00 0x00 0x13 0x00 0x00 0x00 0x50100000 0x00 0x00 0x00 0x13 0x00 0x01 0x00 0x70100000 0x00 0x00 0x00 0x14 0x00 0x00 0x00 0x51000000 0x00 0x00 0x00 0x14 0x00 0x01 0x00 0x71000000 0x00 0x00 0x00 0x15 0x00 0x00 0x00 0x50200000 0x00 0x00 0x00 0x15 0x00 0x01 0x00 0x70200000>; }; }; - */ ErrorLogger5 { compatible = "eswin,win2030,register"; @@ -1342,7 +1014,6 @@ #address-cells = <0x02>; #size-cells = <0x02>; ranges; - numa-node-id = <0x00>; reg = <0x00 0x52081400 0x00 0x4000>; interrupts = <0x1b9>; interrupt-names = "error"; @@ -1527,7 +1198,6 @@ #address-cells = <0x02>; #size-cells = <0x02>; ranges; - numa-node-id = <0x00>; reg = <0x00 0x52002c00 0x00 0x4000>; interrupts = <0x1af>; interrupt-names = "error"; @@ -1824,7 +1494,6 @@ #address-cells = <0x02>; #size-cells = <0x02>; ranges; - numa-node-id = <0x00>; reg = <0x00 0x52021400 0x00 0x4000>; interrupts = <0x1c6>; interrupt-names = "error"; @@ -2022,7 +1691,6 @@ #address-cells = <0x02>; #size-cells = <0x02>; ranges; - numa-node-id = <0x00>; reg = <0x00 0x52041400 0x00 0x4000>; interrupts = <0x1c0>; interrupt-names = "error"; @@ -2215,38 +1883,35 @@ interrupts = <0x183 0x10>; #size-cells = <0x02>; dma-ranges = <0x01 0x00 0x00 0xc0000000 0x1ff 0x00>; - // iommus = <0x15 0x04>; + iommus = <0x19 0x04>; tbus = <0x05>; dsp-avail-num = <0x01>; spram-size = <0x400000>; - npu_mbox = <0x1e>; - clocks = <0x03 0x236 0x03 0x237 0x03 0x23c 0x03 0x23a 0x03 0x23d 0x03 0x26 0x03 0x25 0x03 0x0b 0x03 0x07 0x03 0x238 0x03 0x0d>; - clock-names = "aclk", "cfg_clk", "core_clk", "clk_npu_llc_aclk", "e31_core_clk", "mux_u_npu_core_3mux1_gfree", "mux_u_npu_llclk_3mux1_gfree", "fixed_rate_clk_spll2_fout2", "fixed_rate_clk_spll1_fout1", "clk_clk_npu_llc_src0", "fixed_rate_clk_vpll_fout1"; - resets = <0x14 0x06 0x08>; + npu_mbox = <0x22>; + clocks = <0x03 0x236 0x03 0x237 0x03 0x23c 0x03 0x23d>; + clock-names = "aclk", "cfg_clk", "core_clk", "e31_core_clk"; + resets = <0x18 0x06 0x08>; reset-names = "e31_core"; - operating-points-v2 = <0x1f>; numa-node-id = <0x00>; firmware-name = "eic7700_die0_e31_fw"; dma-noncoherent; #cooling-cells = <0x02>; dynamic-power-coefficient = <0x00>; status = "okay"; - npu-supply = <0x20>; - apply_npu_1G_freq; + phandle = <0x4e>; }; llc@51c00000 { compatible = "eswin,llc"; reg = <0x00 0x51c00000 0x00 0x400000>; - eswin,syscfg = <0x13 0x324>; - eswin,syscrg_csr = <0x12>; + eswin,syscfg = <0x17 0x324>; + eswin,syscrg_csr = <0x16>; clocks = <0x03 0x236 0x03 0x237 0x03 0x23a 0x03 0x23c 0x03 0x26 0x03 0x0b 0x03 0x07>; clock-names = "aclk", "cfg_clk", "llc_clk", "core_clk", "mux_u_npu_core_3mux1_gfree", "fixed_rate_clk_spll2_fout2", "fixed_rate_clk_spll1_fout1"; - resets = <0x14 0x06 0x01 0x14 0x06 0x02 0x14 0x06 0x04 0x14 0x06 0x40>; + resets = <0x18 0x06 0x01 0x18 0x06 0x02 0x18 0x06 0x04 0x18 0x06 0x40>; reset-names = "axi", "cfg", "core", "llc"; numa-node-id = <0x00>; - spram-region = <0x21>; - npu-supply = <0x20>; + spram-region = <0x23>; apply_npu_high_freq; }; @@ -2255,12 +1920,11 @@ #size-cells = <0x02>; reg = <0x00 0x52280400 0x00 0x10000 0x00 0x51810000 0x00 0x8000>; ranges; - numa-node-id = <0x00>; dma-ranges = <0x00 0x30000000 0x00 0xc0000000 0x00 0xce000000>; compatible = "es-dsp-subsys", "simple-bus"; clocks = <0x03 0x210 0x03 0x20f>; clock-names = "cfg_clk", "aclk"; - resets = <0x14 0x02 0x01 0x14 0x02 0x02 0x14 0x02 0x04 0x14 0x02 0x10 0x14 0x02 0x20 0x14 0x02 0x40 0x14 0x02 0x80>; + resets = <0x18 0x02 0x01 0x18 0x02 0x02 0x18 0x02 0x04 0x18 0x02 0x10 0x18 0x02 0x20 0x18 0x02 0x40 0x18 0x02 0x80>; reset-names = "axi", "cfg", "div4", "div_0", "div_1", "div_2", "div_3"; status = "okay"; @@ -2271,15 +1935,14 @@ ranges = <0x28000000 0x00 0x5b000000 0x8000 0x28100000 0x00 0x5b100000 0x20000 0x28120000 0x00 0x5b120000 0x20000>; clocks = <0x03 0x2a8>; clock-names = "aclk"; - operating-points-v2 = <0x22>; - dsp_mbox = <0x23>; + dsp_mbox = <0x24>; device-irq = <0x0b 0x50a90000 0x20 0x50a80000 0x01 0x50a40000>; device-uart = <0x50900000>; device-irq-mode = <0x01>; host-irq-mode = <0x01>; firmware-name = "eic7700_dsp_fw"; process-id = <0x00>; - // iommus = <0x15 0x12>; + iommus = <0x19 0x12>; tbus = <0x70>; dma-noncoherent; numa-node-id = <0x00>; @@ -2297,15 +1960,14 @@ ranges = <0x28000000 0x00 0x5b008000 0x8000 0x28100000 0x00 0x5b140000 0x20000 0x28120000 0x00 0x5b160000 0x20000>; clocks = <0x03 0x2a9>; clock-names = "aclk"; - operating-points-v2 = <0x22>; - dsp_mbox = <0x24>; + dsp_mbox = <0x25>; device-irq = <0x0d 0x50ab0000 0x40 0x50aa0000 0x01 0x50a40000>; device-uart = <0x50900000>; device-irq-mode = <0x01>; host-irq-mode = <0x01>; firmware-name = "eic7700_dsp_fw"; process-id = <0x01>; - // iommus = <0x15 0x13>; + iommus = <0x19 0x13>; tbus = <0x71>; dma-noncoherent; numa-node-id = <0x00>; @@ -2323,15 +1985,14 @@ ranges = <0x28000000 0x00 0x5b010000 0x8000 0x28100000 0x00 0x5b180000 0x20000 0x28120000 0x00 0x5b1a0000 0x20000>; clocks = <0x03 0x2aa>; clock-names = "aclk"; - operating-points-v2 = <0x22>; - dsp_mbox = <0x25>; + dsp_mbox = <0x26>; device-irq = <0x0f 0x50ad0000 0x80 0x50ac0000 0x01 0x50a40000>; device-uart = <0x50900000>; device-irq-mode = <0x01>; host-irq-mode = <0x01>; firmware-name = "eic7700_dsp_fw"; process-id = <0x02>; - // iommus = <0x15 0x14>; + iommus = <0x19 0x14>; tbus = <0x72>; dma-noncoherent; numa-node-id = <0x00>; @@ -2349,15 +2010,14 @@ ranges = <0x28000000 0x00 0x5b018000 0x8000 0x28100000 0x00 0x5b1c0000 0x20000 0x28120000 0x00 0x5b1e0000 0x20000>; clocks = <0x03 0x2ab>; clock-names = "aclk"; - operating-points-v2 = <0x22>; - dsp_mbox = <0x26>; + dsp_mbox = <0x27>; device-irq = <0x11 0x50af0000 0x100 0x50ae0000 0x01 0x50a40000>; device-uart = <0x50900000>; device-irq-mode = <0x01>; host-irq-mode = <0x01>; firmware-name = "eic7700_dsp_fw"; process-id = <0x03>; - // iommus = <0x15 0x15>; + iommus = <0x19 0x15>; tbus = <0x73>; dma-noncoherent; numa-node-id = <0x00>; @@ -2367,34 +2027,13 @@ dsp@0 { }; }; - - sofdsp@4 { - #sound-dai-cells = <0x01>; - #address-cells = <0x02>; - #size-cells = <0x02>; - compatible = "eswin,sof-dsp"; - reg = <0x00 0x5b018000 0x00 0x8000 0x00 0x5b1c0000 0x00 0x40000>; - mbox-names = "dsp-mbox"; - mboxes = <0x26 0x00>; - clocks = <0x03 0x2ab>; - clock-names = "aclk"; - process-id = <0x03>; - // iommus = <0x15 0x15>; - tbus = <0x73>; - dma-noncoherent; - mailbox-dsp-to-u84-addr = <0x50af0000>; - mailbox-u84-to-dsp-addr = <0x50ae0000>; - dsp-uart = <0x27>; - device-uart-mutex = <0x51820000>; - numa-node-id = <0x00>; - }; }; g2d@50140000 { compatible = "eswin,galcore_d0"; clocks = <0x03 0x254 0x03 0x255 0x03 0x25a 0x03 0x25b 0x03 0x25c 0x03 0x25d 0x03 0x2b1>; clock-names = "vc_aclk", "vc_cfg", "g2d_cfg", "g2d_st2", "g2d_clk", "g2d_aclk", "mon_pclk"; - resets = <0x14 0x16 0x02 0x14 0x16 0x01 0x14 0x16 0x04 0x14 0x1b 0x01 0x14 0x1b 0x02 0x14 0x1b 0x04>; + resets = <0x18 0x16 0x02 0x18 0x16 0x01 0x18 0x16 0x04 0x18 0x1b 0x01 0x18 0x1b 0x02 0x18 0x1b 0x04>; reset-names = "axi", "cfg", "moncfg", "g2d_core", "g2d_cfg", "g2d_axi"; reg = <0x00 0x50140000 0x00 0x40000 0x00 0x50180000 0x00 0x40000>; reg-names = "core_2d", "core_2d1"; @@ -2406,7 +2045,6 @@ contiguous-size = <0xa00000>; recovery = <0x00>; dma-noncoherent; - operating-points-v2 = <0x28>; numa-node-id = <0x00>; status = "okay"; }; @@ -2418,15 +2056,15 @@ reg = <0x00 0x51400000 0x00 0xfffff>; clocks = <0x03 0x20b 0x03 0x20c 0x03 0x20d>; clock-names = "aclk", "gray_clk", "cfg_clk"; - resets = <0x14 0x01 0x01 0x14 0x01 0x02 0x14 0x01 0x04 0x14 0x01 0x08 0x14 0x01 0x10>; + resets = <0x18 0x01 0x01 0x18 0x01 0x02 0x18 0x01 0x04 0x18 0x01 0x08 0x18 0x01 0x10>; reset-names = "axi", "cfg", "gray", "jones", "spu"; interrupt-parent = <0x10>; interrupts = <0x0f>; dma-noncoherent; - numa-node-id = <0x00>; #cooling-cells = <0x02>; dynamic-power-coefficient = <0x00>; status = "okay"; + phandle = <0x4f>; }; sata@0x50420000 { @@ -2436,19 +2074,19 @@ interrupt-names = "intrq", "msi", "pme"; interrupts = <0x3a 0x3b 0x3c>; ports-implemented = <0x01>; - resets = <0x14 0x07 0x8000000>; + resets = <0x18 0x07 0x8000000>; reset-names = "apb"; #size-cells = <0x02>; - // iommus = <0x15 0x0e>; + iommus = <0x19 0x0e>; tbus = <0x02>; dma-ranges = <0x00 0x00 0x00 0xc0000000 0x200 0x00>; - eswin,hsp_sp_csr = <0x16 0x1050>; - eswin,syscrg_csr = <0x12 0x41c>; + eswin,hsp_sp_csr = <0x1a 0x1050>; + eswin,syscrg_csr = <0x16 0x41c>; numa-node-id = <0x00>; dma-noncoherent; status = "okay"; pinctrl-names = "default"; - pinctrl-0 = <0x29>; + pinctrl-0 = <0x28>; }; pcie@0x54000000 { @@ -2456,7 +2094,7 @@ clocks = <0x03 0x232 0x03 0x233 0x03 0x234 0x03 0x235>; clock-names = "pcie_aclk", "pcie_cfg_clk", "pcie_cr_clk", "pcie_aux_clk"; reset-names = "pcie_cfg", "pcie_powerup", "pcie_pwren"; - resets = <0x14 0x08 0x01 0x14 0x08 0x02 0x14 0x08 0x04>; + resets = <0x18 0x08 0x01 0x18 0x08 0x02 0x18 0x08 0x04>; #address-cells = <0x03>; #size-cells = <0x02>; #interrupt-cells = <0x01>; @@ -2471,8 +2109,8 @@ interrupt-parent = <0x10>; interrupt-map-mask = <0x00 0x00 0x00 0x07>; interrupt-map = <0x00 0x00 0x00 0x01 0x10 0xb3 0x00 0x00 0x00 0x02 0x10 0xb4 0x00 0x00 0x00 0x03 0x10 0xb5 0x00 0x00 0x00 0x04 0x10 0xb6>; - // iommus = <0x15 0xfe0000>; - // iommu-map = <0x00 0x15 0xff0000 0xffffff>; + iommus = <0x19 0xfe0000>; + iommu-map = <0x00 0x19 0xff0000 0xffffff>; tbus = <0x03>; status = "okay"; numa-node-id = <0x00>; @@ -2489,7 +2127,7 @@ clock-names = "clk"; interrupt-parent = <0x10>; interrupts = <0x5b>; - resets = <0x14 0x10 0x01>; + resets = <0x18 0x10 0x01>; reset-names = "spi"; numa-node-id = <0x00>; status = "okay"; @@ -2525,13 +2163,13 @@ clock-names = "clk"; interrupt-parent = <0x10>; interrupts = <0x5c>; - resets = <0x14 0x10 0x02>; + resets = <0x18 0x10 0x02>; reset-names = "spi"; numa-node-id = <0x00>; status = "disabled"; dma-noncoherent; pinctrl-names = "default"; - pinctrl-0 = <0x2a>; + pinctrl-0 = <0x29>; num-cs = <0x02>; spi-flash@0 { @@ -2560,15 +2198,14 @@ #size-cells = <0x00>; clocks = <0x03 0x205 0x03 0x204>; clock-names = "cfg_clk", "clk"; - resets = <0x14 0x24 0x02>; + resets = <0x18 0x24 0x02>; reset-names = "rst"; spi-max-frequency = "", "I>"; reg-io-width = <0x04>; - numa-node-id = <0x00>; status = "okay"; num-cs = <0x01>; - cs-gpios = <0x2b 0x00 0x01>; - wp-gpios = <0x2b 0x04 0x01>; + cs-gpios = <0x2a 0x00 0x01>; + wp-gpios = <0x2a 0x04 0x01>; spi-flash@0 { compatible = "winbond,w25q128jw", "jedec,spi-nor"; @@ -2591,7 +2228,7 @@ clock-names = "clk_xin", "clk_ahb"; clock-output-names = "emmc_cardclock"; #clock-cells = <0x00>; - resets = <0x14 0x07 0x40 0x14 0x07 0x08 0x14 0x07 0x80000 0x14 0x07 0x800000>; + resets = <0x18 0x07 0x40 0x18 0x07 0x08 0x18 0x07 0x80000 0x18 0x07 0x800000>; reset-names = "txrx_rst", "phy_rst", "prstn", "arstn"; core-clk-reg = <0x51828160>; disable-cqe-dcmd; @@ -2600,11 +2237,11 @@ mmc-hs400-1_8v; max-frequency = <0xbebc200>; #size-cells = <0x02>; - // iommus = <0x15 0x0f>; + iommus = <0x19 0x0f>; tbus = <0x02>; dma-ranges = <0x00 0x00 0x00 0xc0000000 0x01 0x00>; - eswin,hsp_sp_csr = <0x16 0x1038 0x508 0x50c>; - eswin,syscrg_csr = <0x12 0x160 0x148 0x14c>; + eswin,hsp_sp_csr = <0x1a 0x1038 0x508 0x50c>; + eswin,syscrg_csr = <0x16 0x160 0x148 0x14c>; status = "okay"; numa-node-id = <0x00>; dma-noncoherent; @@ -2613,7 +2250,7 @@ enable-cmd-pullup; enable-data-pullup; pinctrl-names = "default"; - pinctrl-0 = <0x2c>; + pinctrl-0 = <0x2b>; no-sdio; no-sd; }; @@ -2627,17 +2264,17 @@ clock-names = "clk_xin", "clk_ahb", "clk_spll2_fout3", "clk_mux1_1"; clock-output-names = "sdio0_cardclock"; #clock-cells = <0x00>; - resets = <0x14 0x07 0x80 0x14 0x07 0x10 0x14 0x07 0x40000 0x14 0x07 0x400000>; + resets = <0x18 0x07 0x80 0x18 0x07 0x10 0x18 0x07 0x40000 0x18 0x07 0x400000>; reset-names = "txrx_rst", "phy_rst", "prstn", "arstn"; clock-frequency = <0xc65d400>; max-frequency = <0xc65d400>; #address-cells = <0x01>; #size-cells = <0x00>; dma-ranges = <0x00 0x20000000 0x00 0xc0000000 0x00 0x40000000>; - // iommus = <0x15 0x10>; + iommus = <0x19 0x10>; tbus = <0x02>; - eswin,hsp_sp_csr = <0x16 0x103c 0x608 0x60c>; - eswin,syscrg_csr = <0x12 0x164 0x148 0x14c>; + eswin,hsp_sp_csr = <0x1a 0x103c 0x608 0x60c>; + eswin,syscrg_csr = <0x16 0x164 0x148 0x14c>; bus-width = <0x04>; sdio-id = <0x00>; numa-node-id = <0x00>; @@ -2662,17 +2299,17 @@ clock-names = "clk_xin", "clk_ahb", "clk_spll2_fout3", "clk_mux1_1"; clock-output-names = "sdio1_cardclock"; #clock-cells = <0x00>; - resets = <0x14 0x07 0x100 0x14 0x07 0x20 0x14 0x07 0x20000 0x14 0x07 0x200000>; + resets = <0x18 0x07 0x100 0x18 0x07 0x20 0x18 0x07 0x20000 0x18 0x07 0x200000>; reset-names = "txrx_rst", "phy_rst", "prstn", "arstn"; clock-frequency = <0xc65d400>; max-frequency = <0xc65d400>; #address-cells = <0x01>; #size-cells = <0x00>; dma-ranges = <0x00 0x20000000 0x00 0xc0000000 0x00 0x40000000>; - // iommus = <0x15 0x11>; + iommus = <0x19 0x11>; tbus = <0x02>; - eswin,hsp_sp_csr = <0x16 0x1040 0x708 0x70c>; - eswin,syscrg_csr = <0x12 0x168 0x148 0x14c>; + eswin,hsp_sp_csr = <0x1a 0x1040 0x708 0x70c>; + eswin,syscrg_csr = <0x16 0x168 0x148 0x14c>; bus-width = <0x04>; sdio-id = <0x01>; numa-node-id = <0x00>; @@ -2692,17 +2329,16 @@ compatible = "eswin,video-decoder0"; clocks = <0x03 0x254 0x03 0x255 0x03 0x257 0x03 0x259 0x03 0x2e 0x03 0x04 0x03 0x0a 0x03 0x2ae 0x03 0x2b0 0x03 0x2b1>; clock-names = "aclk", "cfg_clk", "jd_clk", "vd_clk", "vc_mux", "spll0_fout1", "spll2_fout1", "jd_pclk", "vd_pclk", "mon_pclk"; - resets = <0x14 0x16 0x02 0x14 0x16 0x01 0x14 0x16 0x04 0x14 0x17 0x01 0x14 0x17 0x02 0x14 0x19 0x01 0x14 0x19 0x02>; + resets = <0x18 0x16 0x02 0x18 0x16 0x01 0x18 0x16 0x04 0x18 0x17 0x01 0x18 0x17 0x02 0x18 0x19 0x01 0x18 0x19 0x02>; reset-names = "axi", "cfg", "moncfg", "jd_cfg", "jd_axi", "vd_cfg", "vd_axi"; - eswin,syscfg = <0x13 0x00 0x04>; - operating-points-v2 = <0x2d>; + eswin,syscfg = <0x17 0x00 0x04>; vcmd-core = <0x00 0x6c>; axife-core = <0x200 0x100>; vdec-core = <0x800 0xc00>; interrupt-parent = <0x10>; #size-cells = <0x02>; dma-ranges = <0x00 0x00 0x00 0x80000000 0x200 0x00>; - // iommus = <0x15 0x02>; + iommus = <0x19 0x02>; vccsr-reg = <0x00 0x501c0000 0x00 0x1000>; numa-node-id = <0x00>; tbus = <0x10 0x13>; @@ -2726,17 +2362,16 @@ compatible = "eswin,video-encoder0"; clocks = <0x03 0x254 0x03 0x255 0x03 0x256 0x03 0x258 0x03 0x2e 0x03 0x04 0x03 0x0a 0x03 0x2ad 0x03 0x2af 0x03 0x2b1>; clock-names = "aclk", "cfg_clk", "je_clk", "ve_clk", "vc_mux", "spll0_fout1", "spll2_fout1", "je_pclk", "ve_pclk", "mon_pclk"; - resets = <0x14 0x16 0x02 0x14 0x16 0x01 0x14 0x16 0x04 0x14 0x18 0x01 0x14 0x18 0x02 0x14 0x1a 0x02 0x14 0x1a 0x01>; + resets = <0x18 0x16 0x02 0x18 0x16 0x01 0x18 0x16 0x04 0x18 0x18 0x01 0x18 0x18 0x02 0x18 0x1a 0x02 0x18 0x1a 0x01>; reset-names = "axi", "cfg", "moncfg", "je_cfg", "je_axi", "ve_cfg", "ve_axi"; - eswin,syscfg = <0x13 0x00 0x04>; - operating-points-v2 = <0x2e>; + eswin,syscfg = <0x17 0x00 0x04>; vcmd-core = <0x00 0x6c>; axife-core = <0x2000 0x7d0>; venc-core = <0x1000 0x87c>; interrupt-parent = <0x10>; #size-cells = <0x02>; dma-ranges = <0x00 0x00 0x00 0x80000000 0x200 0x00>; - // iommus = <0x15 0x03>; + iommus = <0x19 0x03>; vccsr-reg = <0x00 0x501c0000 0x00 0x1000>; numa-node-id = <0x00>; dma-noncoherent; @@ -2765,14 +2400,13 @@ #mbox-cells = <0x01>; clocks = <0x03 0x27e 0x03 0x27f>; clock-names = "pclk_mailbox_host", "pclk_mailbox_device"; - resets = <0x14 0x0c 0x01 0x14 0x0c 0x02>; + resets = <0x18 0x0c 0x01 0x18 0x0c 0x02>; reset-names = "rst", "rst_device"; lock-bit = <0x01>; irq-bit = <0x02>; - numa-node-id = <0x00>; dma-noncoherent; status = "okay"; - phandle = <0x2f>; + phandle = <0x2c>; }; mbox@50a20000 { @@ -2783,14 +2417,13 @@ #mbox-cells = <0x01>; clocks = <0x03 0x280 0x03 0x281>; clock-names = "pclk_mailbox_host", "pclk_mailbox_device"; - resets = <0x14 0x0c 0x04 0x14 0x0c 0x08>; + resets = <0x18 0x0c 0x04 0x18 0x0c 0x08>; reset-names = "rst", "rst_device"; lock-bit = <0x01>; irq-bit = <0x04>; - numa-node-id = <0x00>; dma-noncoherent; status = "okay"; - phandle = <0x30>; + phandle = <0x2d>; }; mbox@50a40000 { @@ -2801,14 +2434,13 @@ #mbox-cells = <0x01>; clocks = <0x03 0x282 0x03 0x283>; clock-names = "pclk_mailbox_host", "pclk_mailbox_device"; - resets = <0x14 0x0c 0x10 0x14 0x0c 0x20>; + resets = <0x18 0x0c 0x10 0x18 0x0c 0x20>; reset-names = "rst", "rst_device"; lock-bit = <0x01>; irq-bit = <0x08>; - numa-node-id = <0x00>; dma-noncoherent; status = "okay"; - phandle = <0x1e>; + phandle = <0x22>; }; mbox@50a60000 { @@ -2819,11 +2451,10 @@ #mbox-cells = <0x01>; clocks = <0x03 0x284 0x03 0x285>; clock-names = "pclk_mailbox_host", "pclk_mailbox_device"; - resets = <0x14 0x0c 0x40 0x14 0x0c 0x80>; + resets = <0x18 0x0c 0x40 0x18 0x0c 0x80>; reset-names = "rst", "rst_device"; lock-bit = <0x01>; irq-bit = <0x10>; - numa-node-id = <0x00>; dma-noncoherent; status = "okay"; }; @@ -2836,14 +2467,13 @@ #mbox-cells = <0x01>; clocks = <0x03 0x286 0x03 0x287>; clock-names = "pclk_mailbox_host", "pclk_mailbox_device"; - resets = <0x14 0x0c 0x100 0x14 0x0c 0x200>; + resets = <0x18 0x0c 0x100 0x18 0x0c 0x200>; reset-names = "rst", "rst_device"; lock-bit = <0x01>; irq-bit = <0x20>; - numa-node-id = <0x00>; dma-noncoherent; status = "okay"; - phandle = <0x23>; + phandle = <0x24>; }; mbox@50aa0000 { @@ -2854,14 +2484,13 @@ #mbox-cells = <0x01>; clocks = <0x03 0x288 0x03 0x289>; clock-names = "pclk_mailbox_host", "pclk_mailbox_device"; - resets = <0x14 0x0c 0x400 0x14 0x0c 0x800>; + resets = <0x18 0x0c 0x400 0x18 0x0c 0x800>; reset-names = "rst", "rst_device"; lock-bit = <0x01>; irq-bit = <0x40>; - numa-node-id = <0x00>; dma-noncoherent; status = "okay"; - phandle = <0x24>; + phandle = <0x25>; }; mbox@50ac0000 { @@ -2872,14 +2501,13 @@ #mbox-cells = <0x01>; clocks = <0x03 0x28a 0x03 0x28b>; clock-names = "pclk_mailbox_host", "pclk_mailbox_device"; - resets = <0x14 0x0c 0x1000 0x14 0x0c 0x2000>; + resets = <0x18 0x0c 0x1000 0x18 0x0c 0x2000>; reset-names = "rst", "rst_device"; lock-bit = <0x01>; irq-bit = <0x80>; - numa-node-id = <0x00>; dma-noncoherent; status = "okay"; - phandle = <0x25>; + phandle = <0x26>; }; mbox@50ae0000 { @@ -2890,24 +2518,23 @@ #mbox-cells = <0x01>; clocks = <0x03 0x28c 0x03 0x28d>; clock-names = "pclk_mailbox_host", "pclk_mailbox_device"; - resets = <0x14 0x0c 0x4000 0x14 0x0c 0x8000>; + resets = <0x18 0x0c 0x4000 0x18 0x0c 0x8000>; reset-names = "rst", "rst_device"; lock-bit = <0x01>; irq-bit = <0x100>; - numa-node-id = <0x00>; dma-noncoherent; status = "okay"; - phandle = <0x26>; + phandle = <0x27>; }; ipc@0 { compatible = "eswin,win2030-ipc"; #size-cells = <0x02>; dma-ranges = <0x00 0x80000000 0x00 0xc0000000 0x00 0x80000000>; - // iommus = <0x15 0x18 0x15 0x18>; + iommus = <0x19 0x18 0x19 0x18>; tbus = <0x04>; - eswin,syscfg = <0x13 0x1004 0x00 0x13 0x4004 0x00>; - mboxes = <0x2f 0x00>; + eswin,syscfg = <0x17 0x1004 0x00 0x17 0x4004 0x00>; + mboxes = <0x2c 0x00>; mbox-names = "u84_scpu"; numa-node-id = <0x00>; dma-noncoherent; @@ -2919,13 +2546,13 @@ clocks = <0x03 0x209 0x03 0x20a>; clock-names = "core_clk", "bus_clk"; reset-names = "core_rst", "bus_rst", "dbg_rst"; - resets = <0x14 0x15 0x01 0x14 0x15 0x02 0x14 0x15 0x04>; + resets = <0x18 0x15 0x01 0x18 0x15 0x02 0x18 0x15 0x04>; #size-cells = <0x02>; dma-ranges = <0x00 0xb0000000 0x00 0xc0000000 0x00 0x50000000>; - // iommus = <0x15 0x19>; - eswin,syscfg = <0x13 0x2004 0x00>; + iommus = <0x19 0x19>; + eswin,syscfg = <0x17 0x2004 0x00>; tbus = <0x04>; - mboxes = <0x30 0x00>; + mboxes = <0x2d 0x00>; mbox-names = "u84_lpcpu"; numa-node-id = <0x00>; status = "okay"; @@ -2936,7 +2563,7 @@ compatible = "eswin,eswin-pvt-cpu"; clocks = <0x03 0x25f>; clock-names = "pvt_clk"; - resets = <0x14 0x0b 0x01>; + resets = <0x18 0x0b 0x01>; reset-names = "pvt_rst"; #address-cells = <0x01>; #size-cells = <0x00>; @@ -2946,15 +2573,14 @@ #thermal-sensor-cells = <0x00>; status = "okay"; label = "pvt0"; - numa-node-id = <0x00>; - phandle = <0x4c>; + phandle = <0x48>; }; pvt@0x52360000 { compatible = "eswin,eswin-pvt-ddr"; clocks = <0x03 0x260>; clock-names = "pvt_clk"; - resets = <0x14 0x0b 0x02>; + resets = <0x18 0x0b 0x02>; reset-names = "pvt_rst"; #address-cells = <0x01>; #size-cells = <0x00>; @@ -2963,7 +2589,6 @@ interrupt-parent = <0x10>; status = "okay"; label = "pvt1"; - numa-node-id = <0x00>; }; fan_control@50b50000 { @@ -2971,19 +2596,18 @@ reg = <0x00 0x50b50000 0x00 0x10000>; clocks = <0x03 0x2a7>; clock-names = "pclk"; - resets = <0x14 0x0a 0x01>; + resets = <0x18 0x0a 0x01>; reset-names = "fan_rst"; interrupt-parent = <0x10>; interrupt-names = "fanirq"; interrupts = <0x162>; pulses-per-revolution = <0x02>; pwm-minimum-period = <0x3e8>; - pwms = <0x31 0x00 0x186a0>; + pwms = <0x2e 0x00 0x186a0>; pinctrl-names = "default"; - pinctrl-0 = <0x32 0x33>; + pinctrl-0 = <0x2f>; status = "okay"; label = "fan_control"; - numa-node-id = <0x00>; eswin,pwm_inverted; }; @@ -2992,14 +2616,13 @@ clock-frequency = <0x186a0>; clocks = <0x03 0x28e>; clock-names = "pclk"; - resets = <0x14 0x09 0x01>; + resets = <0x18 0x09 0x01>; reset-names = "rst"; #address-cells = <0x01>; #size-cells = <0x00>; reg = <0x00 0x50950000 0x00 0x8000>; interrupts = <0x69>; interrupt-parent = <0x10>; - numa-node-id = <0x00>; status = "okay"; es8388-0@10 { @@ -3011,8 +2634,8 @@ endpoint { system-clock-frequency = <0xbb8000>; - remote-endpoint = <0x34>; - phandle = <0x37>; + remote-endpoint = <0x30>; + phandle = <0x34>; }; }; }; @@ -3023,14 +2646,13 @@ clock-frequency = <0x186a0>; clocks = <0x03 0x28f>; clock-names = "pclk"; - resets = <0x14 0x09 0x02>; + resets = <0x18 0x09 0x02>; reset-names = "rst"; #address-cells = <0x01>; #size-cells = <0x00>; reg = <0x00 0x50960000 0x00 0x10000>; interrupts = <0x6a>; interrupt-parent = <0x10>; - numa-node-id = <0x00>; status = "okay"; es5430@f { @@ -3050,7 +2672,6 @@ regulator-max-microamp = <0x2625a00>; regulator-ov-protection-microvolt = <0x10c8e0>; regulator-always-on; - phandle = <0x20>; }; }; }; @@ -3061,14 +2682,13 @@ clock-frequency = <0x186a0>; clocks = <0x03 0x290>; clock-names = "pclk"; - resets = <0x14 0x09 0x04>; + resets = <0x18 0x09 0x04>; reset-names = "rst"; #address-cells = <0x01>; #size-cells = <0x00>; reg = <0x00 0x50970000 0x00 0x8000>; interrupts = <0x6b>; interrupt-parent = <0x10>; - numa-node-id = <0x00>; status = "disabled"; }; @@ -3077,14 +2697,13 @@ clock-frequency = <0x186a0>; clocks = <0x03 0x291>; clock-names = "pclk"; - resets = <0x14 0x09 0x08>; + resets = <0x18 0x09 0x08>; reset-names = "rst"; #address-cells = <0x01>; #size-cells = <0x00>; reg = <0x00 0x50980000 0x00 0x8000>; interrupts = <0x6c>; interrupt-parent = <0x10>; - numa-node-id = <0x00>; status = "okay"; }; @@ -3093,14 +2712,13 @@ clock-frequency = <0x186a0>; clocks = <0x03 0x292>; clock-names = "pclk"; - resets = <0x14 0x09 0x10>; + resets = <0x18 0x09 0x10>; reset-names = "rst"; #address-cells = <0x01>; #size-cells = <0x00>; reg = <0x00 0x50990000 0x00 0x8000>; interrupts = <0x6d>; interrupt-parent = <0x10>; - numa-node-id = <0x00>; status = "disabled"; }; @@ -3109,14 +2727,13 @@ clock-frequency = <0x186a0>; clocks = <0x03 0x293>; clock-names = "pclk"; - resets = <0x14 0x09 0x20>; + resets = <0x18 0x09 0x20>; reset-names = "rst"; #address-cells = <0x01>; #size-cells = <0x00>; reg = <0x00 0x509a0000 0x00 0x8000>; interrupts = <0x6e>; interrupt-parent = <0x10>; - numa-node-id = <0x00>; status = "disabled"; }; @@ -3125,14 +2742,13 @@ clock-frequency = <0x186a0>; clocks = <0x03 0x294>; clock-names = "pclk"; - resets = <0x14 0x09 0x40>; + resets = <0x18 0x09 0x40>; reset-names = "rst"; #address-cells = <0x01>; #size-cells = <0x00>; reg = <0x00 0x509b0000 0x00 0x8000>; interrupts = <0x6f>; interrupt-parent = <0x10>; - numa-node-id = <0x00>; status = "disabled"; }; @@ -3141,14 +2757,13 @@ clock-frequency = <0x186a0>; clocks = <0x03 0x295>; clock-names = "pclk"; - resets = <0x14 0x09 0x80>; + resets = <0x18 0x09 0x80>; reset-names = "rst"; #address-cells = <0x01>; #size-cells = <0x00>; reg = <0x00 0x509c0000 0x00 0x8000>; interrupts = <0x70>; interrupt-parent = <0x10>; - numa-node-id = <0x00>; status = "disabled"; }; @@ -3157,14 +2772,13 @@ clock-frequency = <0x186a0>; clocks = <0x03 0x296>; clock-names = "pclk"; - resets = <0x14 0x09 0x100>; + resets = <0x18 0x09 0x100>; reset-names = "rst"; #address-cells = <0x01>; #size-cells = <0x00>; reg = <0x00 0x509d0000 0x00 0x8000>; interrupts = <0x71>; interrupt-parent = <0x10>; - numa-node-id = <0x00>; status = "okay"; gpio@20 { @@ -3189,14 +2803,13 @@ clock-frequency = <0x186a0>; clocks = <0x03 0x297>; clock-names = "pclk"; - resets = <0x14 0x09 0x200>; + resets = <0x18 0x09 0x200>; reset-names = "rst"; #address-cells = <0x01>; #size-cells = <0x00>; reg = <0x00 0x509e0000 0x00 0x8000>; interrupts = <0x72>; interrupt-parent = <0x10>; - numa-node-id = <0x00>; status = "disabled"; }; @@ -3205,19 +2818,18 @@ clock-frequency = <0x186a0>; clocks = <0x03 0x29f>; clock-names = "pclk"; - resets = <0x14 0x26 0x01>; + resets = <0x18 0x26 0x01>; reset-names = "rst"; #address-cells = <0x01>; #size-cells = <0x00>; reg = <0x00 0x51830000 0x00 0x8000>; interrupts = <0x122>; interrupt-parent = <0x10>; - eswin,i2c_dma = <0x35>; + eswin,i2c_dma = <0x31>; dma-names = "rx", "tx"; - dmas = <0x35 0x0a 0x29 0xff 0x35 0x0b 0x2a 0xff>; - numa-node-id = <0x00>; + dmas = <0x31 0x29 0xff 0x31 0x2a 0xff>; status = "okay"; - eswin,syscfg = <0x13 0x3c0 0x10>; + eswin,syscfg = <0x17 0x3c0 0x10>; rtc@51 { compatible = "nxp,pcf8563"; @@ -3235,14 +2847,13 @@ clock-frequency = <0x186a0>; clocks = <0x03 0x2a0>; clock-names = "pclk"; - resets = <0x14 0x25 0x01>; + resets = <0x18 0x25 0x01>; reset-names = "rst"; #address-cells = <0x01>; #size-cells = <0x00>; reg = <0x00 0x51838000 0x00 0x8000>; interrupts = <0x123>; interrupt-parent = <0x10>; - numa-node-id = <0x00>; status = "okay"; i2c-sda-hold-time-ns = <0x40>; @@ -3282,12 +2893,11 @@ pinctrl@0x51600080 { compatible = "eswin,eic7x-pinctrl", "syscon"; reg = <0x00 0x51600080 0x00 0x1fff80>; - numa-node-id = <0x00>; status = "okay"; - phandle = <0x1a>; + phandle = <0x1e>; pwm0-default { - phandle = <0x33>; + phandle = <0x32>; mux { groups = "pwm0_group"; @@ -3296,7 +2906,7 @@ }; fan_tach-default { - phandle = <0x32>; + phandle = <0x2f>; mux { groups = "fan_tach_group"; @@ -3633,7 +3243,7 @@ }; spi2-default { - phandle = <0x2a>; + phandle = <0x29>; mux1 { groups = "spi2_clk_group"; @@ -3678,7 +3288,7 @@ }; sata_act_led-default { - phandle = <0x29>; + phandle = <0x28>; mux { groups = "sata_act_led_group"; @@ -3693,7 +3303,7 @@ }; emmc_led_control-default { - phandle = <0x2c>; + phandle = <0x2b>; mux { groups = "emmc_led_control_group"; @@ -3834,7 +3444,7 @@ }; gpio5-default { - phandle = <0x41>; + phandle = <0x3e>; mux { groups = "gpio5_group"; @@ -3849,7 +3459,7 @@ }; gpio6-default { - phandle = <0x50>; + phandle = <0x53>; mux { groups = "gpio6_group"; @@ -3966,7 +3576,7 @@ }; gpio16-default { - phandle = <0x1c>; + phandle = <0x20>; mux { groups = "gpio16_group"; @@ -4064,12 +3674,6 @@ groups = "gpio23_group"; function = "gpio23_func"; }; - - conf { - groups = "gpio23_group"; - input-enable = <0x01>; - bias-pull-down = <0x01>; - }; }; gpio24-default { @@ -4741,7 +4345,7 @@ }; gpio94-default { - phandle = <0x18>; + phandle = <0x1c>; mux { groups = "gpio94_group"; @@ -4858,7 +4462,7 @@ }; gpio107-default { - phandle = <0x4d>; + phandle = <0x50>; mux { groups = "gpio107_group"; @@ -4873,7 +4477,7 @@ }; gpio108-default { - phandle = <0x4e>; + phandle = <0x51>; mux { groups = "gpio108_group"; @@ -4888,7 +4492,7 @@ }; gpio109-default { - phandle = <0x4f>; + phandle = <0x52>; mux { groups = "gpio109_group"; @@ -4917,7 +4521,7 @@ }; gpio111-default { - phandle = <0x42>; + phandle = <0x3f>; mux { groups = "gpio111_group"; @@ -5025,7 +4629,6 @@ #size-cells = <0x00>; compatible = "snps,dw-apb-gpio"; reg = <0x00 0x51600000 0x00 0x80>; - numa-node-id = <0x00>; status = "okay"; gpio-port@0 { @@ -5038,7 +4641,7 @@ interrupt-controller; #interrupt-cells = <0x02>; interrupts = <0x12f 0x130 0x131 0x132 0x133 0x134 0x135 0x136 0x137 0x138 0x139 0x13a 0x13b 0x13c 0x13d 0x13e 0x13f 0x140 0x141 0x142 0x143 0x144 0x145 0x146 0x147 0x148 0x149 0x14a 0x14b 0x14c 0x14d 0x14e>; - phandle = <0x1d>; + phandle = <0x21>; }; gpio-port@1 { @@ -5055,7 +4658,7 @@ #gpio-cells = <0x02>; ngpios = <0x20>; reg = <0x02>; - phandle = <0x19>; + phandle = <0x1d>; }; gpio-port@3 { @@ -5064,7 +4667,7 @@ #gpio-cells = <0x02>; ngpios = <0x10>; reg = <0x03>; - phandle = <0x2b>; + phandle = <0x2a>; }; }; @@ -5075,11 +4678,12 @@ clock-names = "pclk"; clocks = <0x03 0x2a6>; clock-frequency = <0xbebc200>; - resets = <0x14 0x0f 0x01>; + resets = <0x18 0x0f 0x01>; reset-names = "rst"; + pinctrl-names = "default"; + pinctrl-0 = <0x32>; status = "okay"; - numa-node-id = <0x00>; - phandle = <0x31>; + phandle = <0x2e>; }; watchdog@0x50800000 { @@ -5087,12 +4691,11 @@ reg = <0x00 0x50800000 0x00 0x4000>; clocks = <0x03 0x298>; clock-names = "pclk"; - resets = <0x14 0x11 0x01>; + resets = <0x18 0x11 0x01>; reset-names = "rst"; interrupts = <0x57>; interrupt-parent = <0x10>; status = "disabled"; - numa-node-id = <0x00>; }; watchdog@0x50804000 { @@ -5100,12 +4703,11 @@ reg = <0x00 0x50804000 0x00 0x4000>; clocks = <0x03 0x299>; clock-names = "pclk"; - resets = <0x14 0x11 0x02>; + resets = <0x18 0x11 0x02>; reset-names = "rst"; interrupts = <0x58>; interrupt-parent = <0x10>; status = "disabled"; - numa-node-id = <0x00>; }; watchdog@0x50808000 { @@ -5113,12 +4715,11 @@ reg = <0x00 0x50808000 0x00 0x4000>; clocks = <0x03 0x29a>; clock-names = "pclk"; - resets = <0x14 0x11 0x04>; + resets = <0x18 0x11 0x04>; reset-names = "rst"; interrupts = <0x59>; interrupt-parent = <0x10>; status = "disabled"; - numa-node-id = <0x00>; }; watchdog@0x5080c000 { @@ -5126,12 +4727,11 @@ reg = <0x00 0x5080c000 0x00 0x4000>; clocks = <0x03 0x29b>; clock-names = "pclk"; - resets = <0x14 0x11 0x08>; + resets = <0x18 0x11 0x08>; reset-names = "rst"; interrupts = <0x5a>; interrupt-parent = <0x10>; status = "disabled"; - numa-node-id = <0x00>; }; timer@0x51840000 { @@ -5140,12 +4740,11 @@ #size-cells = <0x02>; reg = <0x00 0x51840000 0x00 0x8000>; perf_count = <0x07>; - numa-node-id = <0x00>; interrupt-parent = <0x10>; interrupts = <0x159>; clock-names = "pclk", "timer_aclk"; clocks = <0x03 0x26c 0x03 0x268>; - resets = <0x14 0x30 0x01 0x14 0x30 0x02 0x14 0x30 0x04 0x14 0x30 0x08 0x14 0x30 0x10 0x14 0x30 0x20 0x14 0x30 0x40 0x14 0x30 0x80 0x14 0x30 0x100>; + resets = <0x18 0x30 0x01 0x18 0x30 0x02 0x18 0x30 0x04 0x18 0x30 0x08 0x18 0x30 0x10 0x18 0x30 0x20 0x18 0x30 0x40 0x18 0x30 0x80 0x18 0x30 0x100>; reset-names = "trst0", "trst1", "trst2", "trst3", "trst4", "trst5", "trst6", "trst7", "prst"; status = "okay"; }; @@ -5155,12 +4754,11 @@ #address-cells = <0x02>; #size-cells = <0x02>; reg = <0x00 0x51848000 0x00 0x8000>; - numa-node-id = <0x00>; interrupt-parent = <0x10>; interrupts = <0x15a>; clock-names = "pclk", "timer_aclk"; clocks = <0x03 0x26d 0x03 0x269>; - resets = <0x14 0x31 0x01 0x14 0x31 0x02 0x14 0x31 0x04 0x14 0x31 0x08 0x14 0x31 0x10 0x14 0x31 0x20 0x14 0x31 0x40 0x14 0x31 0x80 0x14 0x31 0x100>; + resets = <0x18 0x31 0x01 0x18 0x31 0x02 0x18 0x31 0x04 0x18 0x31 0x08 0x18 0x31 0x10 0x18 0x31 0x20 0x18 0x31 0x40 0x18 0x31 0x80 0x18 0x31 0x100>; reset-names = "trst0", "trst1", "trst2", "trst3", "trst4", "trst5", "trst6", "trst7", "prst"; status = "okay"; }; @@ -5170,12 +4768,11 @@ #address-cells = <0x02>; #size-cells = <0x02>; reg = <0x00 0x51850000 0x00 0x8000>; - numa-node-id = <0x00>; interrupt-parent = <0x10>; interrupts = <0x15b>; clock-names = "pclk", "timer_aclk"; clocks = <0x03 0x26e 0x03 0x26a>; - resets = <0x14 0x32 0x01 0x14 0x32 0x02 0x14 0x32 0x04 0x14 0x32 0x08 0x14 0x32 0x10 0x14 0x32 0x20 0x14 0x32 0x40 0x14 0x32 0x80 0x14 0x32 0x100>; + resets = <0x18 0x32 0x01 0x18 0x32 0x02 0x18 0x32 0x04 0x18 0x32 0x08 0x18 0x32 0x10 0x18 0x32 0x20 0x18 0x32 0x40 0x18 0x32 0x80 0x18 0x32 0x100>; reset-names = "trst0", "trst1", "trst2", "trst3", "trst4", "trst5", "trst6", "trst7", "prst"; status = "okay"; }; @@ -5185,12 +4782,11 @@ #address-cells = <0x02>; #size-cells = <0x02>; reg = <0x00 0x51858000 0x00 0x8000>; - numa-node-id = <0x00>; interrupt-parent = <0x10>; interrupts = <0x15c>; clock-names = "pclk", "timer_aclk", "timer3_clk8"; clocks = <0x03 0x26f 0x03 0x26b 0x03 0x270>; - resets = <0x14 0x33 0x01 0x14 0x33 0x02 0x14 0x33 0x04 0x14 0x33 0x08 0x14 0x33 0x10 0x14 0x33 0x20 0x14 0x33 0x40 0x14 0x33 0x80 0x14 0x33 0x100>; + resets = <0x18 0x33 0x01 0x18 0x33 0x02 0x18 0x33 0x04 0x18 0x33 0x08 0x18 0x33 0x10 0x18 0x33 0x20 0x18 0x33 0x40 0x18 0x33 0x80 0x18 0x33 0x100>; reset-names = "trst0", "trst1", "trst2", "trst3", "trst4", "trst5", "trst6", "trst7", "prst"; status = "okay"; }; @@ -5198,124 +4794,111 @@ rtc@51818000 { compatible = "eswin,win2030-rtc"; reg = <0x00 0x51818000 0x00 0x400>; - eswin,syscfg = <0x13 0x3c0>; + eswin,syscfg = <0x17 0x3c0>; interrupt-parent = <0x10>; interrupts = <0x124>; clocks = <0x03 0x272>; clock-names = "rtcclk"; clock-frequency = <0x3d09>; - resets = <0x14 0x34 0x01>; + resets = <0x18 0x34 0x01>; reset-names = "rtcrst"; status = "okay"; - numa-node-id = <0x00>; }; i2s0@50200000 { compatible = "snps,i2s"; - clocks = <0x03 0x250 0x03 0x10>; - clock-names = "mclk", "apll"; + clocks = <0x03 0x250>; + clock-names = "mclk"; #address-cells = <0x01>; #size-cells = <0x00>; #sound-dai-cells = <0x00>; reg = <0x00 0x50200000 0x00 0x10000>; dma-names = "rx", "tx"; - dmas = <0x35 0x04 0x04 0x00 0x35 0x05 0x05 0x00>; - vo_mclk_sel,syscrg = <0x12 0x1bc>; - resets = <0x14 0x22 0x01 0x14 0x22 0x02 0x14 0x21 0x02>; + dmas = <0x31 0x04 0x00 0x31 0x05 0x00>; + vo_mclk_sel,syscrg = <0x16 0x1bc>; + resets = <0x18 0x22 0x01 0x18 0x22 0x02 0x18 0x21 0x02>; reset-names = "i2srst", "i2sprst", "voprst"; dma-noncoherent; - numa-node-id = <0x00>; status = "okay"; port { - phandle = <0x39>; + phandle = <0x36>; endpoint { - remote-endpoint = <0x36>; + remote-endpoint = <0x33>; dai-format = "i2s"; - phandle = <0x45>; + phandle = <0x42>; }; }; }; i2s1@50210000 { compatible = "snps,i2s"; - clocks = <0x03 0x250 0x03 0x10>; - clock-names = "mclk", "apll"; + clocks = <0x03 0x250>; + clock-names = "mclk"; #address-cells = <0x01>; #size-cells = <0x00>; #sound-dai-cells = <0x00>; reg = <0x00 0x50210000 0x00 0x10000>; dma-names = "rx", "tx"; - dmas = <0x35 0x06 0x02 0x01 0x35 0x07 0x03 0x01>; - vo_mclk_sel,syscrg = <0x12 0x1bc>; - resets = <0x14 0x22 0x01 0x14 0x22 0x02 0x14 0x21 0x02>; + dmas = <0x31 0x02 0x01 0x31 0x03 0x01>; + vo_mclk_sel,syscrg = <0x16 0x1bc>; + resets = <0x18 0x22 0x01 0x18 0x22 0x02 0x18 0x21 0x02>; reset-names = "i2srst", "i2sprst", "voprst"; dma-noncoherent; - numa-node-id = <0x00>; status = "okay"; port { - phandle = <0x38>; + phandle = <0x35>; endpoint { - remote-endpoint = <0x37>; + remote-endpoint = <0x34>; dai-format = "i2s"; - phandle = <0x34>; + phandle = <0x30>; }; }; }; i2s2@50220000 { compatible = "snps,i2s"; - clocks = <0x03 0x250 0x03 0x10>; - clock-names = "mclk", "apll"; + clocks = <0x03 0x250>; + clock-names = "mclk"; #address-cells = <0x01>; #size-cells = <0x00>; #sound-dai-cells = <0x00>; reg = <0x00 0x50220000 0x00 0x10000>; dma-names = "rx", "tx"; - dmas = <0x35 0x08 0x00 0x02 0x35 0x09 0x01 0x02>; - vo_mclk_sel,syscrg = <0x12 0x1bc>; - resets = <0x14 0x22 0x01 0x14 0x22 0x02 0x14 0x21 0x02>; + dmas = <0x31 0x00 0x02 0x31 0x01 0x02>; + vo_mclk_sel,syscrg = <0x16 0x1bc>; + resets = <0x18 0x22 0x01 0x18 0x22 0x02 0x18 0x21 0x02>; reset-names = "i2srst", "i2sprst", "voprst"; dma-noncoherent; - numa-node-id = <0x00>; status = "disabled"; }; - soundcard { - compatible = "simple-audio-card"; - simple-audio-card,name = "Eswin sound card"; - numa-node-id = <0x00>; - }; - graphcard0 { compatible = "audio-graph-card"; - numa-node-id = <0x00>; status = "okay"; label = "Analog Audio-0"; - dais = <0x38>; + dais = <0x35>; }; graphcard1 { compatible = "audio-graph-card"; - numa-node-id = <0x00>; status = "okay"; label = "HDMI Audio"; - dais = <0x39>; + dais = <0x36>; }; graphcard2 { compatible = "audio-graph-card"; - numa-node-id = <0x00>; status = "disabled"; }; display-subsystem@0 { compatible = "eswin,display-subsystem"; + ports = <0x37>; numa-node-id = <0x00>; - ports = <0x3a>; dma-noncoherent; status = "okay"; }; @@ -5323,7 +4906,6 @@ dvb-subsystem { compatible = "amlogic,dvb_widgets"; status = "disabled"; - numa-node-id = <0x00>; }; display_control@502c0000 { @@ -5331,9 +4913,9 @@ reg = <0x00 0x502c0000 0x00 0x100 0x00 0x502c0180 0x00 0x700 0x00 0x502c1400 0x00 0x1400>; interrupt-parent = <0x10>; interrupts = <0xee>; - clocks = <0x03 0x24d 0x03 0x24f 0x03 0x24c 0x03 0x04 0x03 0x2a 0x03 0x2b 0x03 0x0b 0x03 0x0d>; - clock-names = "cfg_clk", "pix_clk", "axi_clk", "spll0_fout1", "vo_mux", "pix_mux", "spll2_fout2", "vpll_fout1"; - resets = <0x14 0x23 0x01 0x14 0x23 0x02 0x14 0x23 0x04 0x14 0x23 0x08>; + clocks = <0x03 0x24d 0x03 0x24f 0x03 0x24c 0x03 0x04 0x03 0x2a>; + clock-names = "cfg_clk", "pix_clk", "axi_clk", "spll0_fout1", "vo_mux"; + resets = <0x18 0x23 0x01 0x18 0x23 0x02 0x18 0x23 0x04 0x18 0x23 0x08>; reset-names = "vo_arst", "vo_prst", "dc_arst", "dc_prst"; dma-noncoherent; numa-node-id = <0x00>; @@ -5342,24 +4924,24 @@ port { #address-cells = <0x01>; #size-cells = <0x00>; - phandle = <0x3a>; + phandle = <0x37>; endpoint@0 { reg = <0x00>; - remote-endpoint = <0x3b>; - phandle = <0x3f>; + remote-endpoint = <0x38>; + phandle = <0x3c>; }; endpoint@1 { reg = <0x01>; - remote-endpoint = <0x3c>; - phandle = <0x3e>; + remote-endpoint = <0x39>; + phandle = <0x3b>; }; endpoint@2 { reg = <0x02>; - remote-endpoint = <0x3d>; - phandle = <0x44>; + remote-endpoint = <0x3a>; + phandle = <0x41>; }; }; }; @@ -5373,8 +4955,8 @@ port { endpoint { - remote-endpoint = <0x3e>; - phandle = <0x3c>; + remote-endpoint = <0x3b>; + phandle = <0x39>; }; }; }; @@ -5392,7 +4974,7 @@ reg = <0x00 0x50270000 0x00 0x10000>; clocks = <0x03 0x201>; clock-names = "pclk"; - resets = <0x14 0x21 0x01>; + resets = <0x18 0x21 0x01>; reset-names = "phyrstn"; numa-node-id = <0x00>; status = "okay"; @@ -5407,8 +4989,8 @@ reg = <0x00>; endpoint { - remote-endpoint = <0x3f>; - phandle = <0x3b>; + remote-endpoint = <0x3c>; + phandle = <0x38>; }; }; @@ -5418,8 +5000,8 @@ reg = <0x01>; endpoint { - remote-endpoint = <0x40>; - phandle = <0x43>; + remote-endpoint = <0x3d>; + phandle = <0x40>; }; }; }; @@ -5431,15 +5013,15 @@ dsi,lanes = <0x04>; status = "okay"; pinctrl-names = "default"; - pinctrl-0 = <0x41 0x42>; - backlight0-gpios = <0x1d 0x05 0x00>; - rst-gpios = <0x2b 0x0f 0x00>; + pinctrl-0 = <0x3e 0x3f>; + backlight0-gpios = <0x21 0x05 0x00>; + rst-gpios = <0x2a 0x0f 0x00>; port { endpoint { - remote-endpoint = <0x43>; - phandle = <0x40>; + remote-endpoint = <0x40>; + phandle = <0x3d>; }; }; }; @@ -5450,7 +5032,6 @@ reg = <0x00 0x502c0000 0x00 0x10000>; interrupt-parent = <0x10>; interrupts = <0xee>; - numa-node-id = <0x00>; status = "disabled"; }; @@ -5466,7 +5047,7 @@ ddc-i2c-scl-high-time-ns = <0x1264>; ddc-i2c-scl-low-time-ns = <0x1334>; #sound-dai-cells = <0x00>; - resets = <0x14 0x21 0x08 0x14 0x21 0x10 0x14 0x21 0x20>; + resets = <0x18 0x21 0x08 0x18 0x21 0x10 0x18 0x21 0x20>; reset-names = "prstn", "phyrstn", "rstn"; numa-node-id = <0x00>; status = "okay"; @@ -5479,8 +5060,8 @@ reg = <0x00>; endpoint@0 { - remote-endpoint = <0x44>; - phandle = <0x3d>; + remote-endpoint = <0x41>; + phandle = <0x3a>; }; }; @@ -5489,8 +5070,8 @@ endpoint@1 { system-clock-frequency = <0xbb8000>; - remote-endpoint = <0x45>; - phandle = <0x36>; + remote-endpoint = <0x42>; + phandle = <0x33>; }; }; }; @@ -5514,11 +5095,10 @@ #size-cells = <0x02>; clocks = <0x03 0x10e 0x03 0x221 0x03 0x222>; clock-names = "suspend", "aclk", "cfg_clk"; - eswin,hsp_sp_csr = <0x16 0x800 0x808 0x83c 0x840>; - resets = <0x14 0x07 0x8000>; + eswin,hsp_sp_csr = <0x1a 0x800 0x808 0x83c 0x840>; + resets = <0x18 0x07 0x8000>; reset-names = "vaux"; ranges; - numa-node-id = <0x00>; status = "okay"; dwc3@50480000 { @@ -5532,8 +5112,8 @@ dr_mode = "host"; phy_type = "utmi"; maximum-speed = "super-speed"; - // iommus = <0x15 0x0a>; - eswin,hsp_sp_csr = <0x16 0x1044>; + iommus = <0x19 0x0a>; + eswin,hsp_sp_csr = <0x1a 0x1044>; dma-ranges = <0x00 0x00 0x00 0xc0000000 0x200 0x00>; snps,dis_enblslpm_quirk; snps,dis-u2-freeclk-exists-quirk; @@ -5553,11 +5133,10 @@ #size-cells = <0x02>; clocks = <0x03 0x10f 0x03 0x221 0x03 0x222>; clock-names = "suspend", "aclk", "cfg_clk"; - eswin,hsp_sp_csr = <0x16 0x900 0x908 0x93c 0x940>; - resets = <0x14 0x07 0x10000>; + eswin,hsp_sp_csr = <0x1a 0x900 0x908 0x93c 0x940>; + resets = <0x18 0x07 0x10000>; reset-names = "vaux"; ranges; - numa-node-id = <0x00>; status = "okay"; dwc3@50490000 { @@ -5571,8 +5150,8 @@ dr_mode = "host"; phy_type = "utmi"; maximum-speed = "super-speed"; - // iommus = <0x15 0x0b>; - eswin,hsp_sp_csr = <0x16 0x1048>; + iommus = <0x19 0x0b>; + eswin,hsp_sp_csr = <0x1a 0x1048>; dma-ranges = <0x00 0x00 0x00 0xc0000000 0x200 0x00>; snps,dis_enblslpm_quirk; snps,dis-u2-freeclk-exists-quirk; @@ -5590,16 +5169,14 @@ compatible = "esw,vi-common-csr", "syscon"; clocks = <0x03 0x23f 0x03 0x241 0x03 0x243 0x03 0x240 0x03 0x24b 0x03 0x24a 0x03 0x244 0x03 0x245 0x03 0x246 0x03 0x247 0x03 0x248 0x03 0x249 0x03 0x27 0x03 0x28 0x03 0x29 0x03 0x04 0x03 0x0d>; clock-names = "aclk", "cfg_clk", "isp_aclk", "dvp_clk", "phy_cfg", "phy_escclk", "sht0", "sht1", "sht2", "sht3", "sht4", "sht5", "aclk_mux", "dvp_mux", "isp_mux", "spll0_fout1", "vpll_fout1"; - resets = <0x14 0x1c 0x01 0x14 0x1c 0x02 0x14 0x1e 0x01 0x14 0x1f 0x01 0x14 0x1d 0x01 0x14 0x20 0x01 0x14 0x20 0x02 0x14 0x20 0x04 0x14 0x20 0x08 0x14 0x20 0x10 0x14 0x20 0x20>; + resets = <0x18 0x1c 0x01 0x18 0x1c 0x02 0x18 0x1e 0x01 0x18 0x1f 0x01 0x18 0x1d 0x01 0x18 0x20 0x01 0x18 0x20 0x02 0x18 0x20 0x04 0x18 0x20 0x08 0x18 0x20 0x10 0x18 0x20 0x20>; reset-names = "axi", "cfg", "isp0", "isp1", "dvp", "sht0", "sht1", "sht2", "sht3", "sht4", "sht5"; interrupt-parent = <0x10>; interrupts = <0x170 0x171 0x172 0x173 0x174 0x175 0x176 0x177>; id = <0x00>; #size-cells = <0x02>; reg = <0x00 0x51030000 0x00 0x10000>; - numa-node-id = <0x00>; - tbus = <0x00>; - phandle = <0x46>; + phandle = <0x43>; }; isp@0x51000000 { @@ -5610,9 +5187,9 @@ id = <0x00>; #size-cells = <0x02>; dma-ranges = <0x00 0x20000000 0x00 0x80000000 0x00 0x40000000>; - // iommus = <0x15 0x06>; + iommus = <0x19 0x06>; tbus = <0x00>; - eswin,vi_top_csr = <0x46 0x1000>; + eswin,vi_top_csr = <0x43 0x1000>; numa-node-id = <0x00>; dma-noncoherent; status = "okay"; @@ -5626,9 +5203,9 @@ id = <0x01>; #size-cells = <0x02>; dma-ranges = <0x00 0x20000000 0x00 0x80000000 0x00 0x40000000>; - // iommus = <0x15 0x06>; + iommus = <0x19 0x06>; tbus = <0x00>; - eswin,vi_top_csr = <0x46 0x1004>; + eswin,vi_top_csr = <0x43 0x1004>; numa-node-id = <0x00>; dma-noncoherent; status = "okay"; @@ -5638,16 +5215,15 @@ compatible = "eswin,dewarp"; clocks = <0x03 0x23f 0x03 0x241 0x03 0x242 0x03 0x27 0x03 0x54 0x03 0x04 0x03 0x0d>; clock-names = "aclk", "cfg_clk", "dw_aclk", "aclk_mux", "dw_mux", "spll0_fout1", "vpll_fout1"; - resets = <0x14 0x1c 0x01 0x14 0x1c 0x02 0x14 0x1c 0x04>; + resets = <0x18 0x1c 0x01 0x18 0x1c 0x02 0x18 0x1c 0x04>; reset-names = "axi", "cfg", "dwe"; - operating-points-v2 = <0x47>; interrupt-parent = <0x10>; interrupts = <0x1a 0x19>; #size-cells = <0x02>; dma-ranges = <0x00 0x20000000 0x00 0x80000000 0x00 0x40000000>; - // iommus = <0x15 0x08>; + iommus = <0x19 0x08>; tbus = <0x00>; - eswin,vi_top_csr = <0x46 0x1008>; + eswin,vi_top_csr = <0x43 0x1008>; reg = <0x00 0x51020000 0x00 0xc00 0x00 0x51020c00 0x00 0x120>; numa-node-id = <0x00>; dma-noncoherent; @@ -5680,8 +5256,8 @@ endpoint@0 { reg = <0x00>; bus-type = <0x04>; - remote-endpoint = <0x48>; - phandle = <0x4a>; + remote-endpoint = <0x44>; + phandle = <0x46>; }; }; }; @@ -5701,8 +5277,8 @@ endpoint@0 { reg = <0x00>; bus-type = <0x04>; - remote-endpoint = <0x49>; - phandle = <0x4b>; + remote-endpoint = <0x45>; + phandle = <0x47>; }; }; }; @@ -5731,8 +5307,8 @@ bus-type = <0x04>; clock-lanes = <0x00>; data-lanes = <0x01 0x02>; - remote-endpoint = <0x4a>; - phandle = <0x48>; + remote-endpoint = <0x46>; + phandle = <0x44>; }; }; }; @@ -5759,8 +5335,8 @@ endpoint { bus-type = <0x04>; - remote-endpoint = <0x4b>; - phandle = <0x49>; + remote-endpoint = <0x47>; + phandle = <0x45>; }; }; }; @@ -5771,7 +5347,7 @@ #size-cells = <0x02>; ranges; dma-ranges = <0x00 0x80000000 0x00 0xc0000000 0x00 0x80000000>; - // iommus = <0x15 0x18>; + iommus = <0x19 0x18>; tbus = <0xf00>; numa-node-id = <0x00>; status = "disabled"; @@ -5811,24 +5387,163 @@ }; }; + opp-table0 { + compatible = "operating-points-v2"; + opp-shared; + phandle = <0x04>; + + opp-24000000 { + opp-hz = <0x00 0x16e3600>; + opp-microvolt = "", "\f5"; + clock-latency-ns = <0x11170>; + }; + + opp-100000000 { + opp-hz = <0x00 0x5f5e100>; + opp-microvolt = "", "\f5"; + clock-latency-ns = <0x11170>; + }; + + opp-200000000 { + opp-hz = <0x00 0xbebc200>; + opp-microvolt = "", "\f5"; + clock-latency-ns = <0x11170>; + }; + + opp-400000000 { + opp-hz = <0x00 0x17d78400>; + opp-microvolt = "", "\f5"; + clock-latency-ns = <0x11170>; + }; + + opp-500000000 { + opp-hz = <0x00 0x1dcd6500>; + opp-microvolt = "", "\f5"; + clock-latency-ns = <0x11170>; + }; + + opp-600000000 { + opp-hz = <0x00 0x23c34600>; + opp-microvolt = "", "\f5"; + clock-latency-ns = <0x11170>; + }; + + opp-700000000 { + opp-hz = <0x00 0x29b92700>; + opp-microvolt = "", "\f5"; + clock-latency-ns = <0x11170>; + }; + + opp-800000000 { + opp-hz = <0x00 0x2faf0800>; + opp-microvolt = "", "\f5"; + clock-latency-ns = <0x11170>; + }; + + opp-900000000 { + opp-hz = <0x00 0x35a4e900>; + opp-microvolt = "", "\f5"; + clock-latency-ns = <0x11170>; + }; + + opp-1000000000 { + opp-hz = <0x00 0x3b9aca00>; + opp-microvolt = "", "\f5"; + clock-latency-ns = <0x11170>; + }; + + opp-1200000000 { + opp-hz = <0x00 0x47868c00>; + opp-microvolt = "", "\f5"; + clock-latency-ns = <0x11170>; + }; + + opp-1300000000 { + opp-hz = <0x00 0x4d7c6d00>; + opp-microvolt = "", "\f5"; + clock-latency-ns = <0x11170>; + }; + + opp-1400000000 { + opp-hz = <0x00 0x53724e00>; + opp-microvolt = "", "\f5"; + clock-latency-ns = <0x11170>; + }; + + opp-1500000000 { + opp-hz = <0x00 0x59682f00>; + opp-microvolt = <0xdbba0>; + clock-latency-ns = <0x11170>; + }; + + opp-1600000000 { + opp-hz = <0x00 0x5f5e1000>; + opp-microvolt = <0xdbba0>; + clock-latency-ns = <0x11170>; + }; + + opp-1700000000 { + opp-hz = <0x00 0x6553f100>; + opp-microvolt = <0xdbba0>; + clock-latency-ns = <0x11170>; + }; + + opp-1800000000 { + opp-hz = <0x00 0x6b49d200>; + opp-microvolt = <0xdbba0>; + clock-latency-ns = <0x11170>; + }; + }; + thermal-zones { thermal0 { polling-delay-passive = <0x1f4>; polling-delay = <0x1388>; sustainable-power = <0x4b0>; - thermal-sensors = <0x4c>; + thermal-sensors = <0x48>; trips { + trip-point0 { + temperature = <0xea60>; + hysteresis = <0x3e8>; + type = "passive"; + }; + + trip-point1 { + temperature = <0x11170>; + hysteresis = <0x3e8>; + type = "passive"; + phandle = <0x49>; + }; + trip-point2 { - temperature = <0x19a28>; + temperature = <0x1adb0>; hysteresis = <0x00>; type = "critical"; }; }; cooling-maps { + + map0 { + trip = <0x49>; + contribution = <0x400>; + cooling-device = <0x4a 0xffffffff 0xffffffff 0x4b 0xffffffff 0xffffffff 0x4c 0xffffffff 0xffffffff 0x4d 0xffffffff 0xffffffff>; + }; + + map1 { + trip = <0x49>; + contribution = <0x400>; + cooling-device = <0x4e 0xffffffff 0xffffffff>; + }; + + map2 { + trip = <0x49>; + contribution = <0x400>; + cooling-device = <0x4f 0xffffffff 0xffffffff>; + }; }; }; }; @@ -5843,30 +5558,22 @@ chosen { stdout-path = "serial0:115200n8"; - + bootargs = "console=ttyS0,115200 root=PARTUUID=b0f77ad6-36cd-4a99-a8c0-31d73649aa09 rootfstype=ext4 rootwait rw earlycon initcall_debug loglevel=8 debug earlyprintk=sbi selinux=0 LANG=en_US.UTF-8 single "; - linux,initrd-start = <0x0 0xafae2000>; - linux,initrd-end = <0x0 0xaffffe22>; - + linux,initrd-start = <0x0 0xad1b3000>; + linux,initrd-end = <0x0 0xaffff286>; + domain-config { compatible = "opensbi,domain,config"; system-suspend-test; }; }; - memory@90000000 { - device_type = "memory"; - reg = <0x00 0x90000000 0x00 0x20000000>; - numa-node-id = <0x00>; - }; - - /* memory@59000000 { device_type = "memory"; reg = <0x00 0x59000000 0x00 0x400000>; numa-node-id = <0x00>; }; - */ reserved-memory { #address-cells = <0x02>; @@ -5876,16 +5583,16 @@ linux,cma { compatible = "shared-dma-pool"; reusable; - size = <0x00 0x20000000>; + size = <0x00 0x10000000>; alignment = <0x00 0x1000>; - alloc-ranges = <0x00 0x80000000 0x04 0x00>; + alloc-ranges = <0x00 0x90000000 0x00 0x20000000>; linux,cma-default; }; sprammemory@59000000 { no-map; reg = <0x00 0x59000000 0x00 0x400000>; - phandle = <0x21>; + phandle = <0x23>; }; g2d_4GB_boundary_reserved_4k { @@ -5905,7 +5612,7 @@ mmz_nid_0_part_0 { compatible = "eswin-reserve-memory"; - reg = <0x03 0x00 0x01 0x1000>; + reg = <0x03 0x00 0x01 0x80000000>; no-map; }; }; @@ -5913,28 +5620,28 @@ leds { compatible = "gpio-leds"; pinctrl-names = "default"; - pinctrl-0 = <0x4d 0x4e 0x4f>; + pinctrl-0 = <0x50 0x51 0x52>; gpio-107 { - gpios = <0x2b 0x0b 0x00>; + gpios = <0x2a 0x0b 0x00>; label = "power"; linux,default-trigger = "default-on"; }; gpio-108 { - gpios = <0x2b 0x0c 0x01>; + gpios = <0x2a 0x0c 0x01>; label = "heartbeat"; linux,default-trigger = "heartbeat"; }; gpio-109 { - gpios = <0x2b 0x0d 0x00>; + gpios = <0x2a 0x0d 0x00>; label = "gpio-109"; linux,default-trigger = "default-off"; }; gpio-110 { - gpios = <0x2b 0x0e 0x00>; + gpios = <0x2a 0x0e 0x00>; label = "gpio-109"; linux,default-trigger = "default-off"; }; @@ -5947,8 +5654,9 @@ label = "OK"; linux,code = <0x160>; pinctrl-names = "default"; - pinctrl-0 = <0x50>; - gpios = <0x1d 0x06 0x01>; + pinctrl-0 = <0x53>; + gpios = <0x21 0x06 0x01>; }; }; }; + From 340fb1a901a628b2ca0e43cdaf89bcb62aecc6f0 Mon Sep 17 00:00:00 2001 From: Alignof Date: Sun, 14 Sep 2025 18:03:55 +0900 Subject: [PATCH 12/28] [!][wip][update] map all memory region --- hikami_core/src/lib.rs | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/hikami_core/src/lib.rs b/hikami_core/src/lib.rs index e9b8665..1646237 100644 --- a/hikami_core/src/lib.rs +++ b/hikami_core/src/lib.rs @@ -89,11 +89,22 @@ impl HypervisorData { dram_start ); - let all_memory_map = [MemoryMap::new( - GuestPhysicalAddress(0x0)..GuestPhysicalAddress(dram_start), - HostPhysicalAddress(0x0)..HostPhysicalAddress(dram_start), - G_STAGE_PTE_FLAGS, - )]; + // TODO: avoid hard coding the address. + // 0x0 .. 0x8000_0000 + // 0x8000_0000 .. 0x9000_0000 + // 0xb000_0000 .. 0x4_0000_0000 + let all_memory_map = [ + MemoryMap::new( + GuestPhysicalAddress(0x0)..GuestPhysicalAddress(dram_start), + HostPhysicalAddress(0x0)..HostPhysicalAddress(dram_start), + G_STAGE_PTE_FLAGS, + ), + MemoryMap::new( + GuestPhysicalAddress(0xc000_0000)..GuestPhysicalAddress(0x480000000), + HostPhysicalAddress(0xc000_0000)..HostPhysicalAddress(0x480000000), + G_STAGE_PTE_FLAGS, + ), + ]; page_table::sv39x4::generate_page_table(root_page_table_addr, &all_memory_map); } From 84e2da7da82f282c9b5ffc37b81514668ade71d2 Mon Sep 17 00:00:00 2001 From: Alignof Date: Sun, 14 Sep 2025 18:19:23 +0900 Subject: [PATCH 13/28] [rebase] fix cma size in device tree --- guest_image/guest.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guest_image/guest.dts b/guest_image/guest.dts index c8a6bc2..ce6a299 100644 --- a/guest_image/guest.dts +++ b/guest_image/guest.dts @@ -5583,7 +5583,7 @@ linux,cma { compatible = "shared-dma-pool"; reusable; - size = <0x00 0x10000000>; + size = <0x00 0x2000000>; // 32MB alignment = <0x00 0x1000>; alloc-ranges = <0x00 0x90000000 0x00 0x20000000>; linux,cma-default; From e7a238ed00ddf26b08c95132d8c946d1f4aeb04a Mon Sep 17 00:00:00 2001 From: Alignof Date: Mon, 15 Sep 2025 01:40:33 +0900 Subject: [PATCH 14/28] [fix] fix interrupts-extended in device tree --- guest_image/guest.dts | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/guest_image/guest.dts b/guest_image/guest.dts index ce6a299..119dc1d 100644 --- a/guest_image/guest.dts +++ b/guest_image/guest.dts @@ -246,7 +246,12 @@ riscv,event-to-mhpmcounters = <0x01 0x01 0x01 0x02 0x02 0x02 0x04 0x06 0x1f8 0x10009 0x10009 0x1f8 0x10019 0x10019 0x1f8 0x10021 0x10021 0x1f8>; riscv,event-to-mhpmevent = <0x04 0x00 0x202 0x05 0x00 0x4000 0x06 0x00 0x2001 0x10009 0x00 0x102 0x10019 0x00 0x1002 0x10021 0x00 0x802>; compatible = "riscv,pmu0", "riscv,pmu"; - interrupts-extended = <0x0c 0x0d 0x0d 0x0d 0x0e 0x0d 0x0f 0x0d>; + interrupts-extended = < + 0x0c 0x0d + // 0x0d 0x0d + // 0x0e 0x0d + // 0x0f 0x0d + >; }; authentication-controller { @@ -373,7 +378,12 @@ #interrupt-cells = <0x01>; compatible = "sifive,plic-1.0.0"; interrupt-controller; - interrupts-extended = <0x0c 0xffffffff 0x0c 0x09 0x0d 0xffffffff 0x0d 0x09 0x0e 0xffffffff 0x0e 0x09 0x0f 0xffffffff 0x0f 0x09>; + interrupts-extended = < + 0x0c 0xffffffff 0x0c 0x09 + // 0x0d 0xffffffff 0x0d 0x09 + // 0x0e 0xffffffff 0x0e 0x09 + // 0x0f 0xffffffff 0x0f 0x09 + >; reg = <0x00 0xc000000 0x00 0x4000000>; reg-names = "control"; riscv,max-priority = <0x07>; @@ -5559,7 +5569,7 @@ chosen { stdout-path = "serial0:115200n8"; - bootargs = "console=ttyS0,115200 root=PARTUUID=b0f77ad6-36cd-4a99-a8c0-31d73649aa09 rootfstype=ext4 rootwait rw earlycon initcall_debug loglevel=8 debug earlyprintk=sbi selinux=0 LANG=en_US.UTF-8 single "; + bootargs = "console=ttyS0,115200 root=PARTUUID=b0f77ad6-36cd-4a99-a8c0-31d73649aa09 rootfstype=ext4 rootwait rw earlycon loglevel=8 debug earlyprintk=sbi selinux=0 LANG=en_US.UTF-8 single "; linux,initrd-start = <0x0 0xad1b3000>; linux,initrd-end = <0x0 0xaffff286>; From 2927ed034c82e980c861e8758907f9b5f6c6542f Mon Sep 17 00:00:00 2001 From: Alignof Date: Mon, 15 Sep 2025 02:45:17 +0900 Subject: [PATCH 15/28] [!][wip][update] change guest mamory size (512MB -> 2GB) --- guest_image/guest.dts | 10 +++++----- hikami_core/src/lib.rs | 4 ++-- hikami_core/src/memmap/constant.rs | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/guest_image/guest.dts b/guest_image/guest.dts index 119dc1d..5d45109 100644 --- a/guest_image/guest.dts +++ b/guest_image/guest.dts @@ -229,7 +229,7 @@ memory@90000000 { compatible = "sifive,axi4-mem-port", "sifive,axi4-port", "sifive,mem-port"; device_type = "memory"; - reg = <0x00 0x90000000 0x00 0x20000000>; + reg = <0x00 0x90000000 0x00 0x80000000>; sifive,port-width-bytes = <0x20>; numa-node-id = <0x00>; phandle = <0x14>; @@ -5570,8 +5570,8 @@ stdout-path = "serial0:115200n8"; bootargs = "console=ttyS0,115200 root=PARTUUID=b0f77ad6-36cd-4a99-a8c0-31d73649aa09 rootfstype=ext4 rootwait rw earlycon loglevel=8 debug earlyprintk=sbi selinux=0 LANG=en_US.UTF-8 single "; - linux,initrd-start = <0x0 0xad1b3000>; - linux,initrd-end = <0x0 0xaffff286>; + linux,initrd-start = <0x01 0x0d1b3000>; + linux,initrd-end = <0x01 0x0ffff286>; domain-config { compatible = "opensbi,domain,config"; @@ -5593,9 +5593,9 @@ linux,cma { compatible = "shared-dma-pool"; reusable; - size = <0x00 0x2000000>; // 32MB + size = <0x00 0x8000000>; // 128MB alignment = <0x00 0x1000>; - alloc-ranges = <0x00 0x90000000 0x00 0x20000000>; + alloc-ranges = <0x00 0x90000000 0x00 0x80000000>; linux,cma-default; }; diff --git a/hikami_core/src/lib.rs b/hikami_core/src/lib.rs index 1646237..83d9c99 100644 --- a/hikami_core/src/lib.rs +++ b/hikami_core/src/lib.rs @@ -100,8 +100,8 @@ impl HypervisorData { G_STAGE_PTE_FLAGS, ), MemoryMap::new( - GuestPhysicalAddress(0xc000_0000)..GuestPhysicalAddress(0x480000000), - HostPhysicalAddress(0xc000_0000)..HostPhysicalAddress(0x480000000), + GuestPhysicalAddress(0x1_1000_0000)..GuestPhysicalAddress(0x480000000), + HostPhysicalAddress(0x1_1000_0000)..HostPhysicalAddress(0x480000000), G_STAGE_PTE_FLAGS, ), ]; diff --git a/hikami_core/src/memmap/constant.rs b/hikami_core/src/memmap/constant.rs index 2c5957e..ce57907 100644 --- a/hikami_core/src/memmap/constant.rs +++ b/hikami_core/src/memmap/constant.rs @@ -27,7 +27,7 @@ pub mod guest_memory { pub const DRAM_BASE: GuestPhysicalAddress = GuestPhysicalAddress(super::DRAM_BASE + 0x1000_0000); /// Dram memory space per HART. - pub const DRAM_SIZE_PER_GUEST: usize = 512 * 1024 * 1024; // 512 MB = 0x2000_0000 + pub const DRAM_SIZE_PER_GUEST: usize = 2 * 1024 * 1024 * 1024; // 2 GB = 0x8000_0000 /// Guest DTB space size pub const GUEST_DTB_REGION_SIZE: usize = 0x26000; } From 052a1faf69a5de888a10b39e7692a5ece13257d5 Mon Sep 17 00:00:00 2001 From: Alignof Date: Wed, 17 Sep 2025 16:09:57 +0900 Subject: [PATCH 16/28] [update] update device tree based on 2025-0423 img --- guest_image/guest.dts | 1265 +++++++++++++++++++++++++++-------------- 1 file changed, 823 insertions(+), 442 deletions(-) diff --git a/guest_image/guest.dts b/guest_image/guest.dts index 5d45109..0681e5f 100644 --- a/guest_image/guest.dts +++ b/guest_image/guest.dts @@ -1,11 +1,339 @@ /dts-v1/; +// copy from 2025-0423/dtbs/linux-image-6.6.87-win2030/eswin/eic7700-milkv-megrez.dtb + / { #address-cells = <0x02>; #size-cells = <0x02>; compatible = "sifive,hifive-unmatched-a00", "sifive,fu740-c000", "sifive,fu740", "eswin,eic7700"; model = "Milk-V Megrez"; + opp-table-d0@cpu { + compatible = "operating-points-v2"; + opp-shared; + phandle = <0x04>; + + opp-24000000 { + opp-hz = <0x00 0x16e3600>; + opp-microvolt = "", "\f5"; + clock-latency-ns = <0x11170>; + }; + + opp-100000000 { + opp-hz = <0x00 0x5f5e100>; + opp-microvolt = "", "\f5"; + clock-latency-ns = <0x11170>; + }; + + opp-200000000 { + opp-hz = <0x00 0xbebc200>; + opp-microvolt = "", "\f5"; + clock-latency-ns = <0x11170>; + }; + + opp-400000000 { + opp-hz = <0x00 0x17d78400>; + opp-microvolt = "", "\f5"; + clock-latency-ns = <0x11170>; + }; + + opp-500000000 { + opp-hz = <0x00 0x1dcd6500>; + opp-microvolt = "", "\f5"; + clock-latency-ns = <0x11170>; + }; + + opp-600000000 { + opp-hz = <0x00 0x23c34600>; + opp-microvolt = "", "\f5"; + clock-latency-ns = <0x11170>; + }; + + opp-700000000 { + opp-hz = <0x00 0x29b92700>; + opp-microvolt = "", "\f5"; + clock-latency-ns = <0x11170>; + }; + + opp-800000000 { + opp-hz = <0x00 0x2faf0800>; + opp-microvolt = "", "\f5"; + clock-latency-ns = <0x11170>; + }; + + opp-900000000 { + opp-hz = <0x00 0x35a4e900>; + opp-microvolt = "", "\f5"; + clock-latency-ns = <0x11170>; + }; + + opp-1000000000 { + opp-hz = <0x00 0x3b9aca00>; + opp-microvolt = "", "\f5"; + clock-latency-ns = <0x11170>; + }; + + opp-1200000000 { + opp-hz = <0x00 0x47868c00>; + opp-microvolt = "", "\f5"; + clock-latency-ns = <0x11170>; + }; + + opp-1300000000 { + opp-hz = <0x00 0x4d7c6d00>; + opp-microvolt = "", "\f5"; + clock-latency-ns = <0x11170>; + }; + + opp-1400000000 { + opp-hz = <0x00 0x53724e00>; + opp-microvolt = "", "\f5"; + clock-latency-ns = <0x11170>; + }; + + opp-1500000000 { + opp-hz = <0x00 0x59682f00>; + opp-microvolt = <0xdbba0>; + clock-latency-ns = <0x11170>; + }; + + opp-1600000000 { + opp-hz = <0x00 0x5f5e1000>; + opp-microvolt = <0xdbba0>; + clock-latency-ns = <0x11170>; + }; + + opp-1700000000 { + opp-hz = <0x00 0x6553f100>; + opp-microvolt = <0xdbba0>; + clock-latency-ns = <0x11170>; + }; + + opp-1800000000 { + opp-hz = <0x00 0x6b49d200>; + opp-microvolt = <0xdbba0>; + clock-latency-ns = <0x11170>; + }; + }; + + opp-table-d1@cpu { + compatible = "operating-points-v2"; + opp-shared; + + opp-24000000 { + opp-hz = <0x00 0x16e3600>; + opp-microvolt = "", "\f5"; + clock-latency-ns = <0x11170>; + }; + + opp-100000000 { + opp-hz = <0x00 0x5f5e100>; + opp-microvolt = "", "\f5"; + clock-latency-ns = <0x11170>; + }; + + opp-200000000 { + opp-hz = <0x00 0xbebc200>; + opp-microvolt = "", "\f5"; + clock-latency-ns = <0x11170>; + }; + + opp-400000000 { + opp-hz = <0x00 0x17d78400>; + opp-microvolt = "", "\f5"; + clock-latency-ns = <0x11170>; + }; + + opp-500000000 { + opp-hz = <0x00 0x1dcd6500>; + opp-microvolt = "", "\f5"; + clock-latency-ns = <0x11170>; + }; + + opp-600000000 { + opp-hz = <0x00 0x23c34600>; + opp-microvolt = "", "\f5"; + clock-latency-ns = <0x11170>; + }; + + opp-700000000 { + opp-hz = <0x00 0x29b92700>; + opp-microvolt = "", "\f5"; + clock-latency-ns = <0x11170>; + }; + + opp-800000000 { + opp-hz = <0x00 0x2faf0800>; + opp-microvolt = "", "\f5"; + clock-latency-ns = <0x11170>; + }; + + opp-900000000 { + opp-hz = <0x00 0x35a4e900>; + opp-microvolt = "", "\f5"; + clock-latency-ns = <0x11170>; + }; + + opp-1000000000 { + opp-hz = <0x00 0x3b9aca00>; + opp-microvolt = "", "\f5"; + clock-latency-ns = <0x11170>; + }; + + opp-1200000000 { + opp-hz = <0x00 0x47868c00>; + opp-microvolt = "", "\f5"; + clock-latency-ns = <0x11170>; + }; + + opp-1300000000 { + opp-hz = <0x00 0x4d7c6d00>; + opp-microvolt = "", "\f5"; + clock-latency-ns = <0x11170>; + }; + + opp-1400000000 { + opp-hz = <0x00 0x53724e00>; + opp-microvolt = "", "\f5"; + clock-latency-ns = <0x11170>; + }; + }; + + opp-table@dsp { + compatible = "operating-points-v2"; + phandle = <0x22>; + + opp@520000000 { + opp-hz = <0x00 0x1efe9200>; + opp-microvolt = "", "\f5"; + }; + + opp@1040000000 { + opp-hz = <0x00 0x3dfd2400>; + opp-microvolt = "", "\f5"; + }; + }; + + opp-table@npu { + compatible = "operating-points-v2"; + phandle = <0x1f>; + + opp@1040000000 { + opp-hz = <0x00 0x3dfd2400>; + opp-microvolt = <0xdbba0>; + }; + + opp@1500000000 { + opp-hz = <0x00 0x59682f00>; + opp-microvolt = <0x100590>; + }; + }; + + opp-table@g2d { + compatible = "operating-points-v2"; + phandle = <0x28>; + + opp@260000000 { + opp-hz = <0x00 0xf7f4900>; + opp-microvolt = "", "\f5"; + }; + + opp@520000000 { + opp-hz = <0x00 0x1efe9200>; + opp-microvolt = "", "\f5"; + }; + + opp@693333334 { + opp-hz = <0x00 0x29536d56>; + opp-microvolt = "", "\f5"; + }; + + opp@1040000000 { + opp-hz = <0x00 0x3dfd2400>; + opp-microvolt = "", "\f5"; + }; + }; + + opp-table@gpu { + compatible = "operating-points-v2"; + phandle = <0x29>; + + opp@200000000 { + opp-hz = <0x00 0xbebc200>; + opp-microvolt = "", "\f5"; + }; + + opp@400000000 { + opp-hz = <0x00 0x17d78400>; + opp-microvolt = "", "\f5"; + }; + + opp@800000000 { + opp-hz = <0x00 0x2faf0800>; + opp-microvolt = "", "\f5"; + }; + }; + + opp-table@vi { + compatible = "operating-points-v2"; + phandle = <0x48>; + + opp@800000000 { + opp-hz = <0x00 0x2faf0800>; + opp-microvolt = "", "\f5"; + }; + + opp@400000000 { + opp-hz = <0x00 0x17d78400>; + opp-microvolt = "", "\f5"; + }; + + opp@200000000 { + opp-hz = <0x00 0xbebc200>; + opp-microvolt = "", "\f5"; + }; + }; + + opp-table@venc { + compatible = "operating-points-v2"; + phandle = <0x2f>; + + opp@800000000 { + opp-hz = <0x00 0x2faf0800>; + opp-microvolt = "", "\f5"; + }; + + opp@400000000 { + opp-hz = <0x00 0x17d78400>; + opp-microvolt = "", "\f5"; + }; + + opp@200000000 { + opp-hz = <0x00 0xbebc200>; + opp-microvolt = "", "\f5"; + }; + }; + + opp-table@vdec { + compatible = "operating-points-v2"; + phandle = <0x2e>; + + opp@800000000 { + opp-hz = <0x00 0x2faf0800>; + opp-microvolt = "", "\f5"; + }; + + opp@400000000 { + opp-hz = <0x00 0x17d78400>; + opp-microvolt = "", "\f5"; + }; + + opp@200000000 { + opp-hz = <0x00 0xbebc200>; + opp-microvolt = "", "\f5"; + }; + }; + cpus { #address-cells = <0x01>; #size-cells = <0x00>; @@ -61,9 +389,9 @@ clocks = <0x03 0x1f4>; operating-points-v2 = <0x04>; #cooling-cells = <0x02>; - dynamic-power-coefficient = <0x144>; + dynamic-power-coefficient = <0x320>; cpu-idle-states = <0x05>; - phandle = <0x4a>; + phandle = <0x4f>; interrupt-controller { #interrupt-cells = <0x01>; @@ -112,9 +440,9 @@ clocks = <0x03 0x1f5>; operating-points-v2 = <0x04>; #cooling-cells = <0x02>; - dynamic-power-coefficient = <0x144>; + dynamic-power-coefficient = <0x320>; cpu-idle-states = <0x05>; - phandle = <0x4b>; + phandle = <0x50>; interrupt-controller { #interrupt-cells = <0x01>; @@ -162,9 +490,9 @@ clocks = <0x03 0x1f6>; operating-points-v2 = <0x04>; #cooling-cells = <0x02>; - dynamic-power-coefficient = <0x144>; + dynamic-power-coefficient = <0x320>; cpu-idle-states = <0x05>; - phandle = <0x4c>; + phandle = <0x51>; interrupt-controller { #interrupt-cells = <0x01>; @@ -212,9 +540,9 @@ clocks = <0x03 0x1f7>; operating-points-v2 = <0x04>; #cooling-cells = <0x02>; - dynamic-power-coefficient = <0x144>; + dynamic-power-coefficient = <0x320>; cpu-idle-states = <0x05>; - phandle = <0x4d>; + phandle = <0x52>; interrupt-controller { #interrupt-cells = <0x01>; @@ -226,15 +554,6 @@ */ }; - memory@90000000 { - compatible = "sifive,axi4-mem-port", "sifive,axi4-port", "sifive,mem-port"; - device_type = "memory"; - reg = <0x00 0x90000000 0x00 0x80000000>; - sifive,port-width-bytes = <0x20>; - numa-node-id = <0x00>; - phandle = <0x14>; - }; - soc { #address-cells = <0x02>; #size-cells = <0x02>; @@ -252,6 +571,7 @@ // 0x0e 0x0d // 0x0f 0x0d >; + numa-node-id = <0x00>; }; authentication-controller { @@ -305,6 +625,7 @@ interrupts = <0x205>; reg = <0x00 0x1700000 0x00 0x1000>; reg-names = "control"; + numa-node-id = <0x00>; phandle = <0x02>; }; @@ -314,6 +635,7 @@ interrupts = <0x206>; reg = <0x00 0x1701000 0x00 0x1000>; reg-names = "control"; + numa-node-id = <0x00>; phandle = <0x07>; }; @@ -323,6 +645,7 @@ interrupts = <0x207>; reg = <0x00 0x1702000 0x00 0x1000>; reg-names = "control"; + numa-node-id = <0x00>; phandle = <0x09>; }; @@ -332,10 +655,13 @@ interrupts = <0x208>; reg = <0x00 0x1703000 0x00 0x1000>; reg-names = "control"; + numa-node-id = <0x00>; phandle = <0x0b>; }; cache-controller@2010000 { + #address-cells = <0x02>; + #size-cells = <0x02>; cache-block-size = <0x40>; cache-level = <0x03>; cache-sets = <0x1000>; @@ -344,7 +670,6 @@ compatible = "sifive,ccache1", "cache", "sifive,fu740-c000-ccache"; interrupt-parent = <0x10>; interrupts = <0x01 0x03 0x04 0x02>; - next-level-cache = <0x11 0x12 0x13 0x14>; reg = <0x00 0x2010000 0x00 0x4000 0x00 0x8000000 0x00 0x400000>; reg-names = "control", "sideband"; sifive,a-mshr-count = <0x3c>; @@ -353,7 +678,13 @@ sifive,max-master-id = <0x0d>; sifive,perfmon-counters = <0x06>; numa-node-id = <0x00>; - phandle = <0x15>; + ranges; + phandle = <0x11>; + + zero-device@1a000000 { + compatible = "l3,zero-device"; + reg = <0x00 0x1a000000 0x00 0x400000>; + }; }; debug-controller@0 { @@ -371,7 +702,6 @@ error-device@10003000 { compatible = "sifive,error0"; reg = <0x00 0x10003000 0x00 0x1000>; - phandle = <0x11>; }; interrupt-controller@c000000 { @@ -379,10 +709,14 @@ compatible = "sifive,plic-1.0.0"; interrupt-controller; interrupts-extended = < - 0x0c 0xffffffff 0x0c 0x09 - // 0x0d 0xffffffff 0x0d 0x09 - // 0x0e 0xffffffff 0x0e 0x09 - // 0x0f 0xffffffff 0x0f 0x09 + 0x0c 0xffffffff + 0x0c 0x09 + // 0x0d 0xffffffff + // 0x0d 0x09 + // 0x0e 0xffffffff + // 0x0e 0x09 + // 0x0f 0xffffffff + // 0x0f 0x09 >; reg = <0x00 0xc000000 0x00 0x4000000>; reg-names = "control"; @@ -407,11 +741,12 @@ cache-size = <0x40000>; cache-unified; compatible = "sifive,pL2Cache0", "cache"; - next-level-cache = <0x15>; + next-level-cache = <0x11>; reg = <0x00 0x104000 0x00 0x4000>; reg-names = "control"; sifive,ecc-granularity = <0x10>; sifive,perfmon-counters = <0x06>; + numa-node-id = <0x00>; phandle = <0x01>; }; @@ -422,11 +757,12 @@ cache-size = <0x40000>; cache-unified; compatible = "sifive,pL2Cache0", "cache"; - next-level-cache = <0x15>; + next-level-cache = <0x11>; reg = <0x00 0x108000 0x00 0x4000>; reg-names = "control"; sifive,ecc-granularity = <0x10>; sifive,perfmon-counters = <0x06>; + numa-node-id = <0x00>; phandle = <0x06>; }; @@ -437,11 +773,12 @@ cache-size = <0x40000>; cache-unified; compatible = "sifive,pL2Cache0", "cache"; - next-level-cache = <0x15>; + next-level-cache = <0x11>; reg = <0x00 0x10c000 0x00 0x4000>; reg-names = "control"; sifive,ecc-granularity = <0x10>; sifive,perfmon-counters = <0x06>; + numa-node-id = <0x00>; phandle = <0x08>; }; @@ -452,24 +789,23 @@ cache-size = <0x40000>; cache-unified; compatible = "sifive,pL2Cache0", "cache"; - next-level-cache = <0x15>; + next-level-cache = <0x11>; reg = <0x00 0x110000 0x00 0x4000>; reg-names = "control"; sifive,ecc-granularity = <0x10>; sifive,perfmon-counters = <0x06>; + numa-node-id = <0x00>; phandle = <0x0a>; }; rom@1a000000 { compatible = "ucbbar,cacheable-zero0"; reg = <0x00 0x1a000000 0x00 0x400000>; - phandle = <0x12>; }; rom@3a000000 { compatible = "ucbbar,cacheable-zero0"; reg = <0x00 0x3a000000 0x00 0x400000>; - phandle = <0x13>; }; subsystem_pbus_clock { @@ -541,6 +877,7 @@ reg-io-width = <0x04>; numa-node-id = <0x00>; status = "okay"; + phandle = <0x27>; }; serial@0x50910000 { @@ -597,33 +934,35 @@ #size-cells = <0x02>; reg = <0x00 0x51810000 0x00 0x8000>; numa-node-id = <0x00>; - phandle = <0x17>; + phandle = <0x13>; noc@51810324 { compatible = "eswin,win2030-noc-wdt"; interrupt-parent = <0x10>; interrupts = <0x188 0x189 0x18a 0x18b 0x18c 0x18d 0x18e 0x18f 0x190 0x191 0x192 0x193 0x194 0x195 0x196 0x197 0x198 0x199 0x19a 0x19b 0x19c 0x19d 0x19e 0x19f 0x1a0 0x1a1 0x1a2 0x1a3 0x1a4 0x1a5 0x1a6 0x1a7 0x1a8 0x1a9 0x1aa>; - eswin,syscrg_csr = <0x16 0x100 0xffff>; + eswin,syscrg_csr = <0x12 0x100 0xffff>; status = "okay"; }; }; sys-crg@51828000 { - compatible = "eswin,win2030-sys-crg", "syscon", "simple-mfd"; + compatible = "syscon", "simple-mfd"; reg = <0x00 0x51828000 0x00 0x80000>; numa-node-id = <0x00>; - phandle = <0x16>; + phandle = <0x12>; reset-controller { - compatible = "eswin,win2030-reset"; + compatible = "eswin,eic7700-reset"; #reset-cells = <0x02>; + numa-node-id = <0x00>; status = "okay"; - phandle = <0x18>; + phandle = <0x14>; }; clock-controller { - compatible = "eswin,win2030-clock"; + compatible = "eswin,eic7700-clock"; #clock-cells = <0x01>; + numa-node-id = <0x00>; status = "okay"; force-1_8ghz; phandle = <0x03>; @@ -635,35 +974,37 @@ compatible = "fixed-clock"; clock-frequency = <0xbebc200>; clock-output-names = "hfclk"; + numa-node-id = <0x00>; }; hsp_sp_top_csr@0x50440000 { compatible = "eswin,win2030-hsp-sp-csr", "syscon"; + numa-node-id = <0x00>; #size-cells = <0x02>; reg = <0x00 0x50440000 0x00 0x2000>; - phandle = <0x1a>; + phandle = <0x16>; }; iommu@50c00000 { compatible = "arm,smmu-v3"; reg = <0x00 0x50c00000 0x00 0x100000>; - eswin,syscfg = <0x17 0x3fc>; + eswin,syscfg = <0x13 0x3fc>; interrupt-parent = <0x10>; interrupts = <0x164 0x168 0x165 0x166>; interrupt-names = "eventq", "gerror", "priq", "cmdq-sync"; #iommu-cells = <0x01>; - resets = <0x18 0x05 0x01 0x18 0x05 0x02 0x18 0x05 0x10 0x18 0x05 0x20 0x18 0x05 0x40 0x18 0x05 0x80 0x18 0x05 0x100 0x18 0x05 0x200 0x18 0x05 0x400 0x18 0x05 0x800>; + resets = <0x14 0x05 0x01 0x14 0x05 0x02 0x14 0x05 0x10 0x14 0x05 0x20 0x14 0x05 0x40 0x14 0x05 0x80 0x14 0x05 0x100 0x14 0x05 0x200 0x14 0x05 0x400 0x14 0x05 0x800>; reset-names = "axi_rst", "cfg_rst", "tbu0_rst", "tbu1_rst", "tbu2_rst", "tbu3_rst", "tbu4_rst", "tbu5_rst", "tbu6_rst", "tbu7_rst"; status = "okay"; numa-node-id = <0x00>; dma-noncoherent; - phandle = <0x19>; + phandle = <0x15>; }; pmu@50c02000 { compatible = "arm,smmu-v3-pmcg"; reg = <0x00 0x50c02000 0x00 0x1000 0x00 0x50c22000 0x00 0x1000>; - eswin,syscfg = <0x17 0x3fc>; + eswin,syscfg = <0x13 0x3fc>; interrupt-parent = <0x10>; interrupts = <0x16b>; status = "disabled"; @@ -675,7 +1016,7 @@ compatible = "riscv,dev-foo-a"; #size-cells = <0x02>; dma-ranges = <0x00 0x20000000 0x00 0xc0000000 0x00 0x40000000>; - iommus = <0x19 0x1c>; + iommus = <0x15 0x1c>; tbus = <0xf00>; status = "okay"; numa-node-id = <0x00>; @@ -782,41 +1123,15 @@ }; }; - dma-controller-hsp@0x50430000 { - compatible = "eswin,eic770x-axi-dma"; - reg = <0x00 0x50430000 0x00 0x10000>; - interrupt-parent = <0x10>; - interrupts = <0x39>; - #dma-cells = <0x02>; - clocks = <0x03 0x2b2 0x03 0x2b3>; - clock-names = "core-clk", "cfgr-clk"; - resets = <0x18 0x07 0x4000 0x18 0x07 0x100000>; - reset-names = "arst", "prst"; - dma-channels = <0x0c>; - snps,dma-masters = <0x01>; - snps,priority = <0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0a 0x0b>; - snps,data-width = <0x02>; - snps,block-size = <0x80000 0x80000 0x80000 0x80000 0x80000 0x80000 0x80000 0x80000 0x80000 0x80000 0x80000 0x80000>; - snps,axi-max-burst-len = <0x10>; - snps,max-msize = <0x40>; - iommus = <0x19 0x01>; - tbus = <0x02>; - eswin,hsp_sp_csr = <0x1a 0x104c>; - eswin,syscfg = <0x17 0x3004 0x370>; - numa-node-id = <0x00>; - dma-noncoherent; - status = "okay"; - }; - dma-controller-aon@0x518c0000 { compatible = "eswin,eic770x-axi-dma"; reg = <0x00 0x518c0000 0x00 0x10000>; interrupt-parent = <0x10>; interrupts = <0x121>; - #dma-cells = <0x02>; + #dma-cells = <0x03>; clocks = <0x03 0x266 0x03 0x264>; clock-names = "core-clk", "cfgr-clk"; - resets = <0x18 0x27 0x01 0x18 0x27 0x02>; + resets = <0x14 0x27 0x01 0x14 0x27 0x02>; reset-names = "arst", "prst"; dma-channels = <0x10>; snps,dma-masters = <0x02>; @@ -824,16 +1139,43 @@ snps,data-width = <0x03>; snps,block-size = <0x80000 0x80000 0x80000 0x80000 0x80000 0x80000 0x80000 0x80000 0x80000 0x80000 0x80000 0x80000 0x80000 0x80000 0x80000 0x80000>; snps,axi-max-burst-len = <0x20>; + snps,max-msize = <0x40>; #size-cells = <0x02>; #address-cells = <0x02>; dma-ranges = <0x00 0x80000000 0x00 0x80000000 0x100 0x00>; - iommus = <0x19 0x1a>; + iommus = <0x15 0x1a>; tbus = <0x04>; - eswin,syscfg = <0x17 0x3004 0x370>; + eswin,syscfg = <0x13 0x3004 0x370>; + numa-node-id = <0x00>; + dma-noncoherent; + status = "okay"; + phandle = <0x36>; + }; + + dma-controller-hsp@0x50430000 { + compatible = "eswin,eic770x-axi-dma"; + reg = <0x00 0x50430000 0x00 0x10000>; + interrupt-parent = <0x10>; + interrupts = <0x39>; + #dma-cells = <0x03>; + clocks = <0x03 0x2b2 0x03 0x2b3>; + clock-names = "core-clk", "cfgr-clk"; + resets = <0x14 0x07 0x4000 0x14 0x07 0x100000>; + reset-names = "arst", "prst"; + dma-channels = <0x0c>; + snps,dma-masters = <0x01>; + snps,priority = <0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0a 0x0b>; + snps,data-width = <0x02>; + snps,block-size = <0x80000 0x80000 0x80000 0x80000 0x80000 0x80000 0x80000 0x80000 0x80000 0x80000 0x80000 0x80000>; + snps,axi-max-burst-len = <0x10>; + snps,max-msize = <0x40>; + iommus = <0x15 0x01>; + tbus = <0x02>; + eswin,hsp_sp_csr = <0x16 0x104c>; + eswin,syscfg = <0x13 0x3004 0x370>; numa-node-id = <0x00>; dma-noncoherent; status = "okay"; - phandle = <0x31>; }; ethernet@50400000 { @@ -842,31 +1184,35 @@ interrupt-parent = <0x10>; interrupt-names = "macirq"; interrupts = <0x3d>; - phy-mode = "rgmii"; + phy-mode = "rgmii-txid"; numa-node-id = <0x00>; id = <0x00>; status = "okay"; clocks = <0x03 0x226 0x03 0x227 0x03 0x228>; clock-names = "app", "stmmaceth", "tx"; - resets = <0x18 0x07 0x4000000>; + resets = <0x14 0x07 0x4000000>; reset-names = "ethrst"; tbus = <0x02>; dma-noncoherent; - eswin,hsp_sp_csr = <0x1a 0x1030 0x100 0x108>; - eswin,syscrg_csr = <0x16 0x148 0x14c>; - snps,axi-config = <0x1b>; + eswin,hsp_sp_csr = <0x16 0x1030 0x100 0x108>; + eswin,syscrg_csr = <0x12 0x148 0x14c>; + eswin,dly_hsp_reg = <0x114 0x118 0x11c>; + snps,axi-config = <0x17>; pinctrl-names = "default"; - pinctrl-0 = <0x1c>; - rst-gpios = <0x1d 0x1e 0x01>; - eswin,rgmiisel = <0x1e 0x290 0x03>; + pinctrl-0 = <0x18>; + rst-gpios = <0x19 0x1e 0x01>; + eswin,rgmiisel = <0x1a 0x290 0x03>; eswin,led-cfgs = <0x6100 0xa40 0x420>; + dly-param-1000m = <0x23232323 0x800c8023 0xc0c0c0c>; + dly-param-100m = <0x50505050 0x803f8050 0x3f3f3f3f>; + dly-param-10m = <0x00 0x00 0x00>; stmmac-axi-config { snps,blen = <0x00 0x00 0x00 0x00 0x10 0x08 0x04>; snps,rd_osr_lmt = <0x02>; snps,wr_osr_lmt = <0x02>; snps,lpi_en = <0x00>; - phandle = <0x1b>; + phandle = <0x17>; }; }; @@ -876,31 +1222,35 @@ interrupt-parent = <0x10>; interrupt-names = "macirq"; interrupts = <0x46>; - phy-mode = "rgmii"; + phy-mode = "rgmii-txid"; numa-node-id = <0x00>; id = <0x01>; status = "okay"; clocks = <0x03 0x226 0x03 0x227 0x03 0x229>; clock-names = "app", "stmmaceth", "tx"; - resets = <0x18 0x07 0x2000000>; + resets = <0x14 0x07 0x2000000>; reset-names = "ethrst"; tbus = <0x02>; dma-noncoherent; - eswin,hsp_sp_csr = <0x1a 0x1034 0x200 0x208>; - eswin,syscrg_csr = <0x16 0x148 0x14c>; - snps,axi-config = <0x1f>; + eswin,hsp_sp_csr = <0x16 0x1034 0x200 0x208>; + eswin,syscrg_csr = <0x12 0x148 0x14c>; + eswin,dly_hsp_reg = <0x214 0x218 0x21c>; + snps,axi-config = <0x1b>; pinctrl-names = "default"; - pinctrl-0 = <0x20>; - rst-gpios = <0x21 0x10 0x01>; - eswin,rgmiisel = <0x1e 0x294 0x03>; + pinctrl-0 = <0x1c>; + rst-gpios = <0x1d 0x10 0x01>; + eswin,rgmiisel = <0x1a 0x294 0x03>; eswin,led-cfgs = <0x6100 0xa40 0x420>; + dly-param-1000m = <0x25252525 0x80268025 0x26262626>; + dly-param-100m = <0x48484848 0x80588048 0x58585858>; + dly-param-10m = <0x00 0x00 0x00>; stmmac-axi-config { snps,blen = <0x00 0x00 0x00 0x00 0x10 0x08 0x04>; snps,rd_osr_lmt = <0x02>; snps,wr_osr_lmt = <0x02>; snps,lpi_en = <0x00>; - phandle = <0x1f>; + phandle = <0x1b>; }; }; @@ -909,6 +1259,7 @@ #address-cells = <0x02>; #size-cells = <0x02>; ranges; + numa-node-id = <0x00>; d0_cfg_noc { compatible = "eswin,win2030-noc"; @@ -916,6 +1267,7 @@ #size-cells = <0x02>; ranges; reg = <0x00 0x52060000 0x00 0x4000>; + numa-node-id = <0x00>; interrupts = <0x1be>; interrupt-names = "error"; interrupt-parent = <0x10>; @@ -1024,6 +1376,7 @@ #address-cells = <0x02>; #size-cells = <0x02>; ranges; + numa-node-id = <0x00>; reg = <0x00 0x52081400 0x00 0x4000>; interrupts = <0x1b9>; interrupt-names = "error"; @@ -1208,6 +1561,7 @@ #address-cells = <0x02>; #size-cells = <0x02>; ranges; + numa-node-id = <0x00>; reg = <0x00 0x52002c00 0x00 0x4000>; interrupts = <0x1af>; interrupt-names = "error"; @@ -1504,6 +1858,7 @@ #address-cells = <0x02>; #size-cells = <0x02>; ranges; + numa-node-id = <0x00>; reg = <0x00 0x52021400 0x00 0x4000>; interrupts = <0x1c6>; interrupt-names = "error"; @@ -1701,6 +2056,7 @@ #address-cells = <0x02>; #size-cells = <0x02>; ranges; + numa-node-id = <0x00>; reg = <0x00 0x52041400 0x00 0x4000>; interrupts = <0x1c0>; interrupt-names = "error"; @@ -1893,35 +2249,39 @@ interrupts = <0x183 0x10>; #size-cells = <0x02>; dma-ranges = <0x01 0x00 0x00 0xc0000000 0x1ff 0x00>; - iommus = <0x19 0x04>; + iommus = <0x15 0x04>; tbus = <0x05>; dsp-avail-num = <0x01>; spram-size = <0x400000>; - npu_mbox = <0x22>; - clocks = <0x03 0x236 0x03 0x237 0x03 0x23c 0x03 0x23d>; - clock-names = "aclk", "cfg_clk", "core_clk", "e31_core_clk"; - resets = <0x18 0x06 0x08>; + npu_mbox = <0x1e>; + clocks = <0x03 0x236 0x03 0x237 0x03 0x23c 0x03 0x23a 0x03 0x23d 0x03 0x26 0x03 0x25 0x03 0x0b 0x03 0x07 0x03 0x238 0x03 0x0d>; + clock-names = "aclk", "cfg_clk", "core_clk", "clk_npu_llc_aclk", "e31_core_clk", "mux_u_npu_core_3mux1_gfree", "mux_u_npu_llclk_3mux1_gfree", "fixed_rate_clk_spll2_fout2", "fixed_rate_clk_spll1_fout1", "clk_clk_npu_llc_src0", "fixed_rate_clk_vpll_fout1"; + resets = <0x14 0x06 0x08>; reset-names = "e31_core"; + operating-points-v2 = <0x1f>; + #cooling-cells = <0x02>; + dynamic-power-coefficient = <0x3e80>; numa-node-id = <0x00>; firmware-name = "eic7700_die0_e31_fw"; dma-noncoherent; - #cooling-cells = <0x02>; - dynamic-power-coefficient = <0x00>; status = "okay"; - phandle = <0x4e>; + npu-supply = <0x20>; + apply_npu_1G_freq; + phandle = <0x53>; }; llc@51c00000 { compatible = "eswin,llc"; reg = <0x00 0x51c00000 0x00 0x400000>; - eswin,syscfg = <0x17 0x324>; - eswin,syscrg_csr = <0x16>; + eswin,syscfg = <0x13 0x324>; + eswin,syscrg_csr = <0x12>; clocks = <0x03 0x236 0x03 0x237 0x03 0x23a 0x03 0x23c 0x03 0x26 0x03 0x0b 0x03 0x07>; clock-names = "aclk", "cfg_clk", "llc_clk", "core_clk", "mux_u_npu_core_3mux1_gfree", "fixed_rate_clk_spll2_fout2", "fixed_rate_clk_spll1_fout1"; - resets = <0x18 0x06 0x01 0x18 0x06 0x02 0x18 0x06 0x04 0x18 0x06 0x40>; + resets = <0x14 0x06 0x01 0x14 0x06 0x02 0x14 0x06 0x04 0x14 0x06 0x40>; reset-names = "axi", "cfg", "core", "llc"; numa-node-id = <0x00>; - spram-region = <0x23>; + spram-region = <0x21>; + npu-supply = <0x20>; apply_npu_high_freq; }; @@ -1930,11 +2290,12 @@ #size-cells = <0x02>; reg = <0x00 0x52280400 0x00 0x10000 0x00 0x51810000 0x00 0x8000>; ranges; + numa-node-id = <0x00>; dma-ranges = <0x00 0x30000000 0x00 0xc0000000 0x00 0xce000000>; compatible = "es-dsp-subsys", "simple-bus"; clocks = <0x03 0x210 0x03 0x20f>; clock-names = "cfg_clk", "aclk"; - resets = <0x18 0x02 0x01 0x18 0x02 0x02 0x18 0x02 0x04 0x18 0x02 0x10 0x18 0x02 0x20 0x18 0x02 0x40 0x18 0x02 0x80>; + resets = <0x14 0x02 0x01 0x14 0x02 0x02 0x14 0x02 0x04 0x14 0x02 0x10 0x14 0x02 0x20 0x14 0x02 0x40 0x14 0x02 0x80>; reset-names = "axi", "cfg", "div4", "div_0", "div_1", "div_2", "div_3"; status = "okay"; @@ -1945,19 +2306,23 @@ ranges = <0x28000000 0x00 0x5b000000 0x8000 0x28100000 0x00 0x5b100000 0x20000 0x28120000 0x00 0x5b120000 0x20000>; clocks = <0x03 0x2a8>; clock-names = "aclk"; - dsp_mbox = <0x24>; + operating-points-v2 = <0x22>; + #cooling-cells = <0x02>; + dynamic-power-coefficient = <0x3e8>; + dsp_mbox = <0x23>; device-irq = <0x0b 0x50a90000 0x20 0x50a80000 0x01 0x50a40000>; device-uart = <0x50900000>; device-irq-mode = <0x01>; host-irq-mode = <0x01>; firmware-name = "eic7700_dsp_fw"; process-id = <0x00>; - iommus = <0x19 0x12>; + iommus = <0x15 0x12>; tbus = <0x70>; dma-noncoherent; numa-node-id = <0x00>; aux-e31-dtim = <0x5a110000>; status = "okay"; + phandle = <0x54>; dsp@0 { }; @@ -1970,19 +2335,23 @@ ranges = <0x28000000 0x00 0x5b008000 0x8000 0x28100000 0x00 0x5b140000 0x20000 0x28120000 0x00 0x5b160000 0x20000>; clocks = <0x03 0x2a9>; clock-names = "aclk"; - dsp_mbox = <0x25>; + operating-points-v2 = <0x22>; + #cooling-cells = <0x02>; + dynamic-power-coefficient = <0x3e8>; + dsp_mbox = <0x24>; device-irq = <0x0d 0x50ab0000 0x40 0x50aa0000 0x01 0x50a40000>; device-uart = <0x50900000>; device-irq-mode = <0x01>; host-irq-mode = <0x01>; firmware-name = "eic7700_dsp_fw"; process-id = <0x01>; - iommus = <0x19 0x13>; + iommus = <0x15 0x13>; tbus = <0x71>; dma-noncoherent; numa-node-id = <0x00>; aux-e31-dtim = <0x5a110000>; status = "okay"; + phandle = <0x55>; dsp@0 { }; @@ -1995,19 +2364,23 @@ ranges = <0x28000000 0x00 0x5b010000 0x8000 0x28100000 0x00 0x5b180000 0x20000 0x28120000 0x00 0x5b1a0000 0x20000>; clocks = <0x03 0x2aa>; clock-names = "aclk"; - dsp_mbox = <0x26>; + operating-points-v2 = <0x22>; + #cooling-cells = <0x02>; + dynamic-power-coefficient = <0x3e8>; + dsp_mbox = <0x25>; device-irq = <0x0f 0x50ad0000 0x80 0x50ac0000 0x01 0x50a40000>; device-uart = <0x50900000>; device-irq-mode = <0x01>; host-irq-mode = <0x01>; firmware-name = "eic7700_dsp_fw"; process-id = <0x02>; - iommus = <0x19 0x14>; + iommus = <0x15 0x14>; tbus = <0x72>; dma-noncoherent; numa-node-id = <0x00>; aux-e31-dtim = <0x5a110000>; status = "okay"; + phandle = <0x56>; dsp@0 { }; @@ -2020,30 +2393,55 @@ ranges = <0x28000000 0x00 0x5b018000 0x8000 0x28100000 0x00 0x5b1c0000 0x20000 0x28120000 0x00 0x5b1e0000 0x20000>; clocks = <0x03 0x2ab>; clock-names = "aclk"; - dsp_mbox = <0x27>; + operating-points-v2 = <0x22>; + #cooling-cells = <0x02>; + dynamic-power-coefficient = <0x3e8>; + dsp_mbox = <0x26>; device-irq = <0x11 0x50af0000 0x100 0x50ae0000 0x01 0x50a40000>; device-uart = <0x50900000>; device-irq-mode = <0x01>; host-irq-mode = <0x01>; firmware-name = "eic7700_dsp_fw"; process-id = <0x03>; - iommus = <0x19 0x15>; + iommus = <0x15 0x15>; tbus = <0x73>; dma-noncoherent; numa-node-id = <0x00>; aux-e31-dtim = <0x5a110000>; status = "okay"; + phandle = <0x57>; dsp@0 { }; }; + + sofdsp@4 { + #sound-dai-cells = <0x01>; + #address-cells = <0x02>; + #size-cells = <0x02>; + compatible = "eswin,sof-dsp"; + reg = <0x00 0x5b018000 0x00 0x8000 0x00 0x5b1c0000 0x00 0x40000>; + mbox-names = "dsp-mbox"; + mboxes = <0x26 0x00>; + clocks = <0x03 0x2ab>; + clock-names = "aclk"; + process-id = <0x03>; + iommus = <0x15 0x15>; + tbus = <0x73>; + dma-noncoherent; + mailbox-dsp-to-u84-addr = <0x50af0000>; + mailbox-u84-to-dsp-addr = <0x50ae0000>; + dsp-uart = <0x27>; + device-uart-mutex = <0x51820000>; + numa-node-id = <0x00>; + }; }; g2d@50140000 { compatible = "eswin,galcore_d0"; clocks = <0x03 0x254 0x03 0x255 0x03 0x25a 0x03 0x25b 0x03 0x25c 0x03 0x25d 0x03 0x2b1>; clock-names = "vc_aclk", "vc_cfg", "g2d_cfg", "g2d_st2", "g2d_clk", "g2d_aclk", "mon_pclk"; - resets = <0x18 0x16 0x02 0x18 0x16 0x01 0x18 0x16 0x04 0x18 0x1b 0x01 0x18 0x1b 0x02 0x18 0x1b 0x04>; + resets = <0x14 0x16 0x02 0x14 0x16 0x01 0x14 0x16 0x04 0x14 0x1b 0x01 0x14 0x1b 0x02 0x14 0x1b 0x04>; reset-names = "axi", "cfg", "moncfg", "g2d_core", "g2d_cfg", "g2d_axi"; reg = <0x00 0x50140000 0x00 0x40000 0x00 0x50180000 0x00 0x40000>; reg-names = "core_2d", "core_2d1"; @@ -2055,6 +2453,9 @@ contiguous-size = <0xa00000>; recovery = <0x00>; dma-noncoherent; + operating-points-v2 = <0x28>; + #cooling-cells = <0x02>; + dynamic-power-coefficient = <0x3e8>; numa-node-id = <0x00>; status = "okay"; }; @@ -2066,15 +2467,17 @@ reg = <0x00 0x51400000 0x00 0xfffff>; clocks = <0x03 0x20b 0x03 0x20c 0x03 0x20d>; clock-names = "aclk", "gray_clk", "cfg_clk"; - resets = <0x18 0x01 0x01 0x18 0x01 0x02 0x18 0x01 0x04 0x18 0x01 0x08 0x18 0x01 0x10>; + resets = <0x14 0x01 0x01 0x14 0x01 0x02 0x14 0x01 0x04 0x14 0x01 0x08 0x14 0x01 0x10>; reset-names = "axi", "cfg", "gray", "jones", "spu"; interrupt-parent = <0x10>; interrupts = <0x0f>; dma-noncoherent; + numa-node-id = <0x00>; + operating-points-v2 = <0x29>; #cooling-cells = <0x02>; - dynamic-power-coefficient = <0x00>; + dynamic-power-coefficient = <0xfa0>; status = "okay"; - phandle = <0x4f>; + phandle = <0x58>; }; sata@0x50420000 { @@ -2084,19 +2487,19 @@ interrupt-names = "intrq", "msi", "pme"; interrupts = <0x3a 0x3b 0x3c>; ports-implemented = <0x01>; - resets = <0x18 0x07 0x8000000>; + resets = <0x14 0x07 0x8000000>; reset-names = "apb"; #size-cells = <0x02>; - iommus = <0x19 0x0e>; + iommus = <0x15 0x0e>; tbus = <0x02>; dma-ranges = <0x00 0x00 0x00 0xc0000000 0x200 0x00>; - eswin,hsp_sp_csr = <0x1a 0x1050>; - eswin,syscrg_csr = <0x16 0x41c>; + eswin,hsp_sp_csr = <0x16 0x1050>; + eswin,syscrg_csr = <0x12 0x41c>; numa-node-id = <0x00>; dma-noncoherent; status = "okay"; pinctrl-names = "default"; - pinctrl-0 = <0x28>; + pinctrl-0 = <0x2a>; }; pcie@0x54000000 { @@ -2104,7 +2507,7 @@ clocks = <0x03 0x232 0x03 0x233 0x03 0x234 0x03 0x235>; clock-names = "pcie_aclk", "pcie_cfg_clk", "pcie_cr_clk", "pcie_aux_clk"; reset-names = "pcie_cfg", "pcie_powerup", "pcie_pwren"; - resets = <0x18 0x08 0x01 0x18 0x08 0x02 0x18 0x08 0x04>; + resets = <0x14 0x08 0x01 0x14 0x08 0x02 0x14 0x08 0x04>; #address-cells = <0x03>; #size-cells = <0x02>; #interrupt-cells = <0x01>; @@ -2119,8 +2522,8 @@ interrupt-parent = <0x10>; interrupt-map-mask = <0x00 0x00 0x00 0x07>; interrupt-map = <0x00 0x00 0x00 0x01 0x10 0xb3 0x00 0x00 0x00 0x02 0x10 0xb4 0x00 0x00 0x00 0x03 0x10 0xb5 0x00 0x00 0x00 0x04 0x10 0xb6>; - iommus = <0x19 0xfe0000>; - iommu-map = <0x00 0x19 0xff0000 0xffffff>; + iommus = <0x15 0xfe0000>; + iommu-map = <0x00 0x15 0xff0000 0xffffff>; tbus = <0x03>; status = "okay"; numa-node-id = <0x00>; @@ -2137,7 +2540,7 @@ clock-names = "clk"; interrupt-parent = <0x10>; interrupts = <0x5b>; - resets = <0x18 0x10 0x01>; + resets = <0x14 0x10 0x01>; reset-names = "spi"; numa-node-id = <0x00>; status = "okay"; @@ -2173,13 +2576,13 @@ clock-names = "clk"; interrupt-parent = <0x10>; interrupts = <0x5c>; - resets = <0x18 0x10 0x02>; + resets = <0x14 0x10 0x02>; reset-names = "spi"; numa-node-id = <0x00>; status = "disabled"; dma-noncoherent; pinctrl-names = "default"; - pinctrl-0 = <0x29>; + pinctrl-0 = <0x2b>; num-cs = <0x02>; spi-flash@0 { @@ -2208,14 +2611,15 @@ #size-cells = <0x00>; clocks = <0x03 0x205 0x03 0x204>; clock-names = "cfg_clk", "clk"; - resets = <0x18 0x24 0x02>; + resets = <0x14 0x24 0x02>; reset-names = "rst"; spi-max-frequency = "", "I>"; reg-io-width = <0x04>; + numa-node-id = <0x00>; status = "okay"; num-cs = <0x01>; - cs-gpios = <0x2a 0x00 0x01>; - wp-gpios = <0x2a 0x04 0x01>; + cs-gpios = <0x2c 0x00 0x01>; + wp-gpios = <0x2c 0x04 0x01>; spi-flash@0 { compatible = "winbond,w25q128jw", "jedec,spi-nor"; @@ -2238,7 +2642,7 @@ clock-names = "clk_xin", "clk_ahb"; clock-output-names = "emmc_cardclock"; #clock-cells = <0x00>; - resets = <0x18 0x07 0x40 0x18 0x07 0x08 0x18 0x07 0x80000 0x18 0x07 0x800000>; + resets = <0x14 0x07 0x40 0x14 0x07 0x08 0x14 0x07 0x80000 0x14 0x07 0x800000>; reset-names = "txrx_rst", "phy_rst", "prstn", "arstn"; core-clk-reg = <0x51828160>; disable-cqe-dcmd; @@ -2247,11 +2651,11 @@ mmc-hs400-1_8v; max-frequency = <0xbebc200>; #size-cells = <0x02>; - iommus = <0x19 0x0f>; + iommus = <0x15 0x0f>; tbus = <0x02>; dma-ranges = <0x00 0x00 0x00 0xc0000000 0x01 0x00>; - eswin,hsp_sp_csr = <0x1a 0x1038 0x508 0x50c>; - eswin,syscrg_csr = <0x16 0x160 0x148 0x14c>; + eswin,hsp_sp_csr = <0x16 0x1038 0x508 0x50c>; + eswin,syscrg_csr = <0x12 0x160 0x148 0x14c>; status = "okay"; numa-node-id = <0x00>; dma-noncoherent; @@ -2260,7 +2664,7 @@ enable-cmd-pullup; enable-data-pullup; pinctrl-names = "default"; - pinctrl-0 = <0x2b>; + pinctrl-0 = <0x2d>; no-sdio; no-sd; }; @@ -2274,17 +2678,17 @@ clock-names = "clk_xin", "clk_ahb", "clk_spll2_fout3", "clk_mux1_1"; clock-output-names = "sdio0_cardclock"; #clock-cells = <0x00>; - resets = <0x18 0x07 0x80 0x18 0x07 0x10 0x18 0x07 0x40000 0x18 0x07 0x400000>; + resets = <0x14 0x07 0x80 0x14 0x07 0x10 0x14 0x07 0x40000 0x14 0x07 0x400000>; reset-names = "txrx_rst", "phy_rst", "prstn", "arstn"; clock-frequency = <0xc65d400>; max-frequency = <0xc65d400>; #address-cells = <0x01>; #size-cells = <0x00>; dma-ranges = <0x00 0x20000000 0x00 0xc0000000 0x00 0x40000000>; - iommus = <0x19 0x10>; + iommus = <0x15 0x10>; tbus = <0x02>; - eswin,hsp_sp_csr = <0x1a 0x103c 0x608 0x60c>; - eswin,syscrg_csr = <0x16 0x164 0x148 0x14c>; + eswin,hsp_sp_csr = <0x16 0x103c 0x608 0x60c>; + eswin,syscrg_csr = <0x12 0x164 0x148 0x14c>; bus-width = <0x04>; sdio-id = <0x00>; numa-node-id = <0x00>; @@ -2309,17 +2713,17 @@ clock-names = "clk_xin", "clk_ahb", "clk_spll2_fout3", "clk_mux1_1"; clock-output-names = "sdio1_cardclock"; #clock-cells = <0x00>; - resets = <0x18 0x07 0x100 0x18 0x07 0x20 0x18 0x07 0x20000 0x18 0x07 0x200000>; + resets = <0x14 0x07 0x100 0x14 0x07 0x20 0x14 0x07 0x20000 0x14 0x07 0x200000>; reset-names = "txrx_rst", "phy_rst", "prstn", "arstn"; clock-frequency = <0xc65d400>; max-frequency = <0xc65d400>; #address-cells = <0x01>; #size-cells = <0x00>; dma-ranges = <0x00 0x20000000 0x00 0xc0000000 0x00 0x40000000>; - iommus = <0x19 0x11>; + iommus = <0x15 0x11>; tbus = <0x02>; - eswin,hsp_sp_csr = <0x1a 0x1040 0x708 0x70c>; - eswin,syscrg_csr = <0x16 0x168 0x148 0x14c>; + eswin,hsp_sp_csr = <0x16 0x1040 0x708 0x70c>; + eswin,syscrg_csr = <0x12 0x168 0x148 0x14c>; bus-width = <0x04>; sdio-id = <0x01>; numa-node-id = <0x00>; @@ -2339,16 +2743,19 @@ compatible = "eswin,video-decoder0"; clocks = <0x03 0x254 0x03 0x255 0x03 0x257 0x03 0x259 0x03 0x2e 0x03 0x04 0x03 0x0a 0x03 0x2ae 0x03 0x2b0 0x03 0x2b1>; clock-names = "aclk", "cfg_clk", "jd_clk", "vd_clk", "vc_mux", "spll0_fout1", "spll2_fout1", "jd_pclk", "vd_pclk", "mon_pclk"; - resets = <0x18 0x16 0x02 0x18 0x16 0x01 0x18 0x16 0x04 0x18 0x17 0x01 0x18 0x17 0x02 0x18 0x19 0x01 0x18 0x19 0x02>; + resets = <0x14 0x16 0x02 0x14 0x16 0x01 0x14 0x16 0x04 0x14 0x17 0x01 0x14 0x17 0x02 0x14 0x19 0x01 0x14 0x19 0x02>; reset-names = "axi", "cfg", "moncfg", "jd_cfg", "jd_axi", "vd_cfg", "vd_axi"; - eswin,syscfg = <0x17 0x00 0x04>; + eswin,syscfg = <0x13 0x00 0x04>; + operating-points-v2 = <0x2e>; + #cooling-cells = <0x02>; + dynamic-power-coefficient = <0x3e8>; vcmd-core = <0x00 0x6c>; axife-core = <0x200 0x100>; vdec-core = <0x800 0xc00>; interrupt-parent = <0x10>; #size-cells = <0x02>; dma-ranges = <0x00 0x00 0x00 0x80000000 0x200 0x00>; - iommus = <0x19 0x02>; + iommus = <0x15 0x02>; vccsr-reg = <0x00 0x501c0000 0x00 0x1000>; numa-node-id = <0x00>; tbus = <0x10 0x13>; @@ -2372,16 +2779,19 @@ compatible = "eswin,video-encoder0"; clocks = <0x03 0x254 0x03 0x255 0x03 0x256 0x03 0x258 0x03 0x2e 0x03 0x04 0x03 0x0a 0x03 0x2ad 0x03 0x2af 0x03 0x2b1>; clock-names = "aclk", "cfg_clk", "je_clk", "ve_clk", "vc_mux", "spll0_fout1", "spll2_fout1", "je_pclk", "ve_pclk", "mon_pclk"; - resets = <0x18 0x16 0x02 0x18 0x16 0x01 0x18 0x16 0x04 0x18 0x18 0x01 0x18 0x18 0x02 0x18 0x1a 0x02 0x18 0x1a 0x01>; + resets = <0x14 0x16 0x02 0x14 0x16 0x01 0x14 0x16 0x04 0x14 0x18 0x01 0x14 0x18 0x02 0x14 0x1a 0x02 0x14 0x1a 0x01>; reset-names = "axi", "cfg", "moncfg", "je_cfg", "je_axi", "ve_cfg", "ve_axi"; - eswin,syscfg = <0x17 0x00 0x04>; + eswin,syscfg = <0x13 0x00 0x04>; + operating-points-v2 = <0x2f>; + #cooling-cells = <0x02>; + dynamic-power-coefficient = <0x3e8>; vcmd-core = <0x00 0x6c>; axife-core = <0x2000 0x7d0>; venc-core = <0x1000 0x87c>; interrupt-parent = <0x10>; #size-cells = <0x02>; dma-ranges = <0x00 0x00 0x00 0x80000000 0x200 0x00>; - iommus = <0x19 0x03>; + iommus = <0x15 0x03>; vccsr-reg = <0x00 0x501c0000 0x00 0x1000>; numa-node-id = <0x00>; dma-noncoherent; @@ -2410,13 +2820,14 @@ #mbox-cells = <0x01>; clocks = <0x03 0x27e 0x03 0x27f>; clock-names = "pclk_mailbox_host", "pclk_mailbox_device"; - resets = <0x18 0x0c 0x01 0x18 0x0c 0x02>; + resets = <0x14 0x0c 0x01 0x14 0x0c 0x02>; reset-names = "rst", "rst_device"; lock-bit = <0x01>; irq-bit = <0x02>; + numa-node-id = <0x00>; dma-noncoherent; status = "okay"; - phandle = <0x2c>; + phandle = <0x30>; }; mbox@50a20000 { @@ -2427,13 +2838,14 @@ #mbox-cells = <0x01>; clocks = <0x03 0x280 0x03 0x281>; clock-names = "pclk_mailbox_host", "pclk_mailbox_device"; - resets = <0x18 0x0c 0x04 0x18 0x0c 0x08>; + resets = <0x14 0x0c 0x04 0x14 0x0c 0x08>; reset-names = "rst", "rst_device"; lock-bit = <0x01>; irq-bit = <0x04>; + numa-node-id = <0x00>; dma-noncoherent; status = "okay"; - phandle = <0x2d>; + phandle = <0x31>; }; mbox@50a40000 { @@ -2444,13 +2856,14 @@ #mbox-cells = <0x01>; clocks = <0x03 0x282 0x03 0x283>; clock-names = "pclk_mailbox_host", "pclk_mailbox_device"; - resets = <0x18 0x0c 0x10 0x18 0x0c 0x20>; + resets = <0x14 0x0c 0x10 0x14 0x0c 0x20>; reset-names = "rst", "rst_device"; lock-bit = <0x01>; irq-bit = <0x08>; + numa-node-id = <0x00>; dma-noncoherent; status = "okay"; - phandle = <0x22>; + phandle = <0x1e>; }; mbox@50a60000 { @@ -2461,10 +2874,11 @@ #mbox-cells = <0x01>; clocks = <0x03 0x284 0x03 0x285>; clock-names = "pclk_mailbox_host", "pclk_mailbox_device"; - resets = <0x18 0x0c 0x40 0x18 0x0c 0x80>; + resets = <0x14 0x0c 0x40 0x14 0x0c 0x80>; reset-names = "rst", "rst_device"; lock-bit = <0x01>; irq-bit = <0x10>; + numa-node-id = <0x00>; dma-noncoherent; status = "okay"; }; @@ -2477,13 +2891,14 @@ #mbox-cells = <0x01>; clocks = <0x03 0x286 0x03 0x287>; clock-names = "pclk_mailbox_host", "pclk_mailbox_device"; - resets = <0x18 0x0c 0x100 0x18 0x0c 0x200>; + resets = <0x14 0x0c 0x100 0x14 0x0c 0x200>; reset-names = "rst", "rst_device"; lock-bit = <0x01>; irq-bit = <0x20>; + numa-node-id = <0x00>; dma-noncoherent; status = "okay"; - phandle = <0x24>; + phandle = <0x23>; }; mbox@50aa0000 { @@ -2494,13 +2909,14 @@ #mbox-cells = <0x01>; clocks = <0x03 0x288 0x03 0x289>; clock-names = "pclk_mailbox_host", "pclk_mailbox_device"; - resets = <0x18 0x0c 0x400 0x18 0x0c 0x800>; + resets = <0x14 0x0c 0x400 0x14 0x0c 0x800>; reset-names = "rst", "rst_device"; lock-bit = <0x01>; irq-bit = <0x40>; + numa-node-id = <0x00>; dma-noncoherent; status = "okay"; - phandle = <0x25>; + phandle = <0x24>; }; mbox@50ac0000 { @@ -2511,13 +2927,14 @@ #mbox-cells = <0x01>; clocks = <0x03 0x28a 0x03 0x28b>; clock-names = "pclk_mailbox_host", "pclk_mailbox_device"; - resets = <0x18 0x0c 0x1000 0x18 0x0c 0x2000>; + resets = <0x14 0x0c 0x1000 0x14 0x0c 0x2000>; reset-names = "rst", "rst_device"; lock-bit = <0x01>; irq-bit = <0x80>; + numa-node-id = <0x00>; dma-noncoherent; status = "okay"; - phandle = <0x26>; + phandle = <0x25>; }; mbox@50ae0000 { @@ -2528,23 +2945,24 @@ #mbox-cells = <0x01>; clocks = <0x03 0x28c 0x03 0x28d>; clock-names = "pclk_mailbox_host", "pclk_mailbox_device"; - resets = <0x18 0x0c 0x4000 0x18 0x0c 0x8000>; + resets = <0x14 0x0c 0x4000 0x14 0x0c 0x8000>; reset-names = "rst", "rst_device"; lock-bit = <0x01>; irq-bit = <0x100>; + numa-node-id = <0x00>; dma-noncoherent; status = "okay"; - phandle = <0x27>; + phandle = <0x26>; }; ipc@0 { compatible = "eswin,win2030-ipc"; #size-cells = <0x02>; dma-ranges = <0x00 0x80000000 0x00 0xc0000000 0x00 0x80000000>; - iommus = <0x19 0x18 0x19 0x18>; + iommus = <0x15 0x18 0x15 0x18>; tbus = <0x04>; - eswin,syscfg = <0x17 0x1004 0x00 0x17 0x4004 0x00>; - mboxes = <0x2c 0x00>; + eswin,syscfg = <0x13 0x1004 0x00 0x13 0x4004 0x00>; + mboxes = <0x30 0x00>; mbox-names = "u84_scpu"; numa-node-id = <0x00>; dma-noncoherent; @@ -2556,13 +2974,13 @@ clocks = <0x03 0x209 0x03 0x20a>; clock-names = "core_clk", "bus_clk"; reset-names = "core_rst", "bus_rst", "dbg_rst"; - resets = <0x18 0x15 0x01 0x18 0x15 0x02 0x18 0x15 0x04>; + resets = <0x14 0x15 0x01 0x14 0x15 0x02 0x14 0x15 0x04>; #size-cells = <0x02>; dma-ranges = <0x00 0xb0000000 0x00 0xc0000000 0x00 0x50000000>; - iommus = <0x19 0x19>; - eswin,syscfg = <0x17 0x2004 0x00>; + iommus = <0x15 0x19>; + eswin,syscfg = <0x13 0x2004 0x00>; tbus = <0x04>; - mboxes = <0x2d 0x00>; + mboxes = <0x31 0x00>; mbox-names = "u84_lpcpu"; numa-node-id = <0x00>; status = "okay"; @@ -2573,7 +2991,7 @@ compatible = "eswin,eswin-pvt-cpu"; clocks = <0x03 0x25f>; clock-names = "pvt_clk"; - resets = <0x18 0x0b 0x01>; + resets = <0x14 0x0b 0x01>; reset-names = "pvt_rst"; #address-cells = <0x01>; #size-cells = <0x00>; @@ -2583,14 +3001,15 @@ #thermal-sensor-cells = <0x00>; status = "okay"; label = "pvt0"; - phandle = <0x48>; + numa-node-id = <0x00>; + phandle = <0x4d>; }; pvt@0x52360000 { compatible = "eswin,eswin-pvt-ddr"; clocks = <0x03 0x260>; clock-names = "pvt_clk"; - resets = <0x18 0x0b 0x02>; + resets = <0x14 0x0b 0x02>; reset-names = "pvt_rst"; #address-cells = <0x01>; #size-cells = <0x00>; @@ -2599,6 +3018,7 @@ interrupt-parent = <0x10>; status = "okay"; label = "pvt1"; + numa-node-id = <0x00>; }; fan_control@50b50000 { @@ -2606,18 +3026,19 @@ reg = <0x00 0x50b50000 0x00 0x10000>; clocks = <0x03 0x2a7>; clock-names = "pclk"; - resets = <0x18 0x0a 0x01>; + resets = <0x14 0x0a 0x01>; reset-names = "fan_rst"; interrupt-parent = <0x10>; interrupt-names = "fanirq"; interrupts = <0x162>; pulses-per-revolution = <0x02>; pwm-minimum-period = <0x3e8>; - pwms = <0x2e 0x00 0x186a0>; + pwms = <0x32 0x00 0x186a0 0x00>; pinctrl-names = "default"; - pinctrl-0 = <0x2f>; + pinctrl-0 = <0x33 0x34>; status = "okay"; label = "fan_control"; + numa-node-id = <0x00>; eswin,pwm_inverted; }; @@ -2626,13 +3047,14 @@ clock-frequency = <0x186a0>; clocks = <0x03 0x28e>; clock-names = "pclk"; - resets = <0x18 0x09 0x01>; + resets = <0x14 0x09 0x01>; reset-names = "rst"; #address-cells = <0x01>; #size-cells = <0x00>; reg = <0x00 0x50950000 0x00 0x8000>; interrupts = <0x69>; interrupt-parent = <0x10>; + numa-node-id = <0x00>; status = "okay"; es8388-0@10 { @@ -2644,8 +3066,8 @@ endpoint { system-clock-frequency = <0xbb8000>; - remote-endpoint = <0x30>; - phandle = <0x34>; + remote-endpoint = <0x35>; + phandle = <0x38>; }; }; }; @@ -2656,13 +3078,14 @@ clock-frequency = <0x186a0>; clocks = <0x03 0x28f>; clock-names = "pclk"; - resets = <0x18 0x09 0x02>; + resets = <0x14 0x09 0x02>; reset-names = "rst"; #address-cells = <0x01>; #size-cells = <0x00>; reg = <0x00 0x50960000 0x00 0x10000>; interrupts = <0x6a>; interrupt-parent = <0x10>; + numa-node-id = <0x00>; status = "okay"; es5430@f { @@ -2682,6 +3105,7 @@ regulator-max-microamp = <0x2625a00>; regulator-ov-protection-microvolt = <0x10c8e0>; regulator-always-on; + phandle = <0x20>; }; }; }; @@ -2692,13 +3116,14 @@ clock-frequency = <0x186a0>; clocks = <0x03 0x290>; clock-names = "pclk"; - resets = <0x18 0x09 0x04>; + resets = <0x14 0x09 0x04>; reset-names = "rst"; #address-cells = <0x01>; #size-cells = <0x00>; reg = <0x00 0x50970000 0x00 0x8000>; interrupts = <0x6b>; interrupt-parent = <0x10>; + numa-node-id = <0x00>; status = "disabled"; }; @@ -2707,13 +3132,14 @@ clock-frequency = <0x186a0>; clocks = <0x03 0x291>; clock-names = "pclk"; - resets = <0x18 0x09 0x08>; + resets = <0x14 0x09 0x08>; reset-names = "rst"; #address-cells = <0x01>; #size-cells = <0x00>; reg = <0x00 0x50980000 0x00 0x8000>; interrupts = <0x6c>; interrupt-parent = <0x10>; + numa-node-id = <0x00>; status = "okay"; }; @@ -2722,13 +3148,14 @@ clock-frequency = <0x186a0>; clocks = <0x03 0x292>; clock-names = "pclk"; - resets = <0x18 0x09 0x10>; + resets = <0x14 0x09 0x10>; reset-names = "rst"; #address-cells = <0x01>; #size-cells = <0x00>; reg = <0x00 0x50990000 0x00 0x8000>; interrupts = <0x6d>; interrupt-parent = <0x10>; + numa-node-id = <0x00>; status = "disabled"; }; @@ -2737,13 +3164,14 @@ clock-frequency = <0x186a0>; clocks = <0x03 0x293>; clock-names = "pclk"; - resets = <0x18 0x09 0x20>; + resets = <0x14 0x09 0x20>; reset-names = "rst"; #address-cells = <0x01>; #size-cells = <0x00>; reg = <0x00 0x509a0000 0x00 0x8000>; interrupts = <0x6e>; interrupt-parent = <0x10>; + numa-node-id = <0x00>; status = "disabled"; }; @@ -2752,13 +3180,14 @@ clock-frequency = <0x186a0>; clocks = <0x03 0x294>; clock-names = "pclk"; - resets = <0x18 0x09 0x40>; + resets = <0x14 0x09 0x40>; reset-names = "rst"; #address-cells = <0x01>; #size-cells = <0x00>; reg = <0x00 0x509b0000 0x00 0x8000>; interrupts = <0x6f>; interrupt-parent = <0x10>; + numa-node-id = <0x00>; status = "disabled"; }; @@ -2767,13 +3196,14 @@ clock-frequency = <0x186a0>; clocks = <0x03 0x295>; clock-names = "pclk"; - resets = <0x18 0x09 0x80>; + resets = <0x14 0x09 0x80>; reset-names = "rst"; #address-cells = <0x01>; #size-cells = <0x00>; reg = <0x00 0x509c0000 0x00 0x8000>; interrupts = <0x70>; interrupt-parent = <0x10>; + numa-node-id = <0x00>; status = "disabled"; }; @@ -2782,13 +3212,14 @@ clock-frequency = <0x186a0>; clocks = <0x03 0x296>; clock-names = "pclk"; - resets = <0x18 0x09 0x100>; + resets = <0x14 0x09 0x100>; reset-names = "rst"; #address-cells = <0x01>; #size-cells = <0x00>; reg = <0x00 0x509d0000 0x00 0x8000>; interrupts = <0x71>; interrupt-parent = <0x10>; + numa-node-id = <0x00>; status = "okay"; gpio@20 { @@ -2813,13 +3244,14 @@ clock-frequency = <0x186a0>; clocks = <0x03 0x297>; clock-names = "pclk"; - resets = <0x18 0x09 0x200>; + resets = <0x14 0x09 0x200>; reset-names = "rst"; #address-cells = <0x01>; #size-cells = <0x00>; reg = <0x00 0x509e0000 0x00 0x8000>; interrupts = <0x72>; interrupt-parent = <0x10>; + numa-node-id = <0x00>; status = "disabled"; }; @@ -2828,18 +3260,19 @@ clock-frequency = <0x186a0>; clocks = <0x03 0x29f>; clock-names = "pclk"; - resets = <0x18 0x26 0x01>; + resets = <0x14 0x26 0x01>; reset-names = "rst"; #address-cells = <0x01>; #size-cells = <0x00>; reg = <0x00 0x51830000 0x00 0x8000>; interrupts = <0x122>; interrupt-parent = <0x10>; - eswin,i2c_dma = <0x31>; + eswin,i2c_dma = <0x36>; dma-names = "rx", "tx"; - dmas = <0x31 0x29 0xff 0x31 0x2a 0xff>; + dmas = <0x36 0x0a 0x29 0xff 0x36 0x0b 0x2a 0xff>; + numa-node-id = <0x00>; status = "okay"; - eswin,syscfg = <0x17 0x3c0 0x10>; + eswin,syscfg = <0x13 0x3c0 0x10>; rtc@51 { compatible = "nxp,pcf8563"; @@ -2857,13 +3290,14 @@ clock-frequency = <0x186a0>; clocks = <0x03 0x2a0>; clock-names = "pclk"; - resets = <0x18 0x25 0x01>; + resets = <0x14 0x25 0x01>; reset-names = "rst"; #address-cells = <0x01>; #size-cells = <0x00>; reg = <0x00 0x51838000 0x00 0x8000>; interrupts = <0x123>; interrupt-parent = <0x10>; + numa-node-id = <0x00>; status = "okay"; i2c-sda-hold-time-ns = <0x40>; @@ -2903,11 +3337,12 @@ pinctrl@0x51600080 { compatible = "eswin,eic7x-pinctrl", "syscon"; reg = <0x00 0x51600080 0x00 0x1fff80>; + numa-node-id = <0x00>; status = "okay"; - phandle = <0x1e>; + phandle = <0x1a>; pwm0-default { - phandle = <0x32>; + phandle = <0x34>; mux { groups = "pwm0_group"; @@ -2916,7 +3351,7 @@ }; fan_tach-default { - phandle = <0x2f>; + phandle = <0x33>; mux { groups = "fan_tach_group"; @@ -3253,7 +3688,7 @@ }; spi2-default { - phandle = <0x29>; + phandle = <0x2b>; mux1 { groups = "spi2_clk_group"; @@ -3298,7 +3733,7 @@ }; sata_act_led-default { - phandle = <0x28>; + phandle = <0x2a>; mux { groups = "sata_act_led_group"; @@ -3313,7 +3748,7 @@ }; emmc_led_control-default { - phandle = <0x2b>; + phandle = <0x2d>; mux { groups = "emmc_led_control_group"; @@ -3454,7 +3889,7 @@ }; gpio5-default { - phandle = <0x3e>; + phandle = <0x42>; mux { groups = "gpio5_group"; @@ -3469,7 +3904,7 @@ }; gpio6-default { - phandle = <0x53>; + phandle = <0x5c>; mux { groups = "gpio6_group"; @@ -3586,7 +4021,7 @@ }; gpio16-default { - phandle = <0x20>; + phandle = <0x1c>; mux { groups = "gpio16_group"; @@ -3684,6 +4119,12 @@ groups = "gpio23_group"; function = "gpio23_func"; }; + + conf { + groups = "gpio23_group"; + input-enable = <0x01>; + bias-pull-down = <0x01>; + }; }; gpio24-default { @@ -4012,6 +4453,12 @@ groups = "gpio55_group"; function = "gpio55_func"; }; + + conf { + groups = "gpio55_group"; + input-enable = <0x01>; + bias-pull-down = <0x01>; + }; }; gpio56-default { @@ -4355,7 +4802,7 @@ }; gpio94-default { - phandle = <0x1c>; + phandle = <0x18>; mux { groups = "gpio94_group"; @@ -4472,7 +4919,7 @@ }; gpio107-default { - phandle = <0x50>; + phandle = <0x59>; mux { groups = "gpio107_group"; @@ -4487,7 +4934,7 @@ }; gpio108-default { - phandle = <0x51>; + phandle = <0x5a>; mux { groups = "gpio108_group"; @@ -4502,7 +4949,7 @@ }; gpio109-default { - phandle = <0x52>; + phandle = <0x5b>; mux { groups = "gpio109_group"; @@ -4531,7 +4978,7 @@ }; gpio111-default { - phandle = <0x3f>; + phandle = <0x43>; mux { groups = "gpio111_group"; @@ -4639,6 +5086,7 @@ #size-cells = <0x00>; compatible = "snps,dw-apb-gpio"; reg = <0x00 0x51600000 0x00 0x80>; + numa-node-id = <0x00>; status = "okay"; gpio-port@0 { @@ -4651,7 +5099,7 @@ interrupt-controller; #interrupt-cells = <0x02>; interrupts = <0x12f 0x130 0x131 0x132 0x133 0x134 0x135 0x136 0x137 0x138 0x139 0x13a 0x13b 0x13c 0x13d 0x13e 0x13f 0x140 0x141 0x142 0x143 0x144 0x145 0x146 0x147 0x148 0x149 0x14a 0x14b 0x14c 0x14d 0x14e>; - phandle = <0x21>; + phandle = <0x1d>; }; gpio-port@1 { @@ -4668,7 +5116,7 @@ #gpio-cells = <0x02>; ngpios = <0x20>; reg = <0x02>; - phandle = <0x1d>; + phandle = <0x19>; }; gpio-port@3 { @@ -4677,23 +5125,22 @@ #gpio-cells = <0x02>; ngpios = <0x10>; reg = <0x03>; - phandle = <0x2a>; + phandle = <0x2c>; }; }; pwm@0x50818000 { compatible = "eswin,pwm-eswin"; - #pwm-cells = <0x02>; + #pwm-cells = <0x03>; reg = <0x00 0x50818000 0x00 0x4000>; clock-names = "pclk"; clocks = <0x03 0x2a6>; clock-frequency = <0xbebc200>; - resets = <0x18 0x0f 0x01>; + resets = <0x14 0x0f 0x01>; reset-names = "rst"; - pinctrl-names = "default"; - pinctrl-0 = <0x32>; status = "okay"; - phandle = <0x2e>; + numa-node-id = <0x00>; + phandle = <0x32>; }; watchdog@0x50800000 { @@ -4701,11 +5148,12 @@ reg = <0x00 0x50800000 0x00 0x4000>; clocks = <0x03 0x298>; clock-names = "pclk"; - resets = <0x18 0x11 0x01>; + resets = <0x14 0x11 0x01>; reset-names = "rst"; interrupts = <0x57>; interrupt-parent = <0x10>; status = "disabled"; + numa-node-id = <0x00>; }; watchdog@0x50804000 { @@ -4713,11 +5161,12 @@ reg = <0x00 0x50804000 0x00 0x4000>; clocks = <0x03 0x299>; clock-names = "pclk"; - resets = <0x18 0x11 0x02>; + resets = <0x14 0x11 0x02>; reset-names = "rst"; interrupts = <0x58>; interrupt-parent = <0x10>; status = "disabled"; + numa-node-id = <0x00>; }; watchdog@0x50808000 { @@ -4725,11 +5174,12 @@ reg = <0x00 0x50808000 0x00 0x4000>; clocks = <0x03 0x29a>; clock-names = "pclk"; - resets = <0x18 0x11 0x04>; + resets = <0x14 0x11 0x04>; reset-names = "rst"; interrupts = <0x59>; interrupt-parent = <0x10>; status = "disabled"; + numa-node-id = <0x00>; }; watchdog@0x5080c000 { @@ -4737,11 +5187,12 @@ reg = <0x00 0x5080c000 0x00 0x4000>; clocks = <0x03 0x29b>; clock-names = "pclk"; - resets = <0x18 0x11 0x08>; + resets = <0x14 0x11 0x08>; reset-names = "rst"; interrupts = <0x5a>; interrupt-parent = <0x10>; status = "disabled"; + numa-node-id = <0x00>; }; timer@0x51840000 { @@ -4750,11 +5201,12 @@ #size-cells = <0x02>; reg = <0x00 0x51840000 0x00 0x8000>; perf_count = <0x07>; + numa-node-id = <0x00>; interrupt-parent = <0x10>; interrupts = <0x159>; clock-names = "pclk", "timer_aclk"; clocks = <0x03 0x26c 0x03 0x268>; - resets = <0x18 0x30 0x01 0x18 0x30 0x02 0x18 0x30 0x04 0x18 0x30 0x08 0x18 0x30 0x10 0x18 0x30 0x20 0x18 0x30 0x40 0x18 0x30 0x80 0x18 0x30 0x100>; + resets = <0x14 0x30 0x01 0x14 0x30 0x02 0x14 0x30 0x04 0x14 0x30 0x08 0x14 0x30 0x10 0x14 0x30 0x20 0x14 0x30 0x40 0x14 0x30 0x80 0x14 0x30 0x100>; reset-names = "trst0", "trst1", "trst2", "trst3", "trst4", "trst5", "trst6", "trst7", "prst"; status = "okay"; }; @@ -4764,11 +5216,12 @@ #address-cells = <0x02>; #size-cells = <0x02>; reg = <0x00 0x51848000 0x00 0x8000>; + numa-node-id = <0x00>; interrupt-parent = <0x10>; interrupts = <0x15a>; clock-names = "pclk", "timer_aclk"; clocks = <0x03 0x26d 0x03 0x269>; - resets = <0x18 0x31 0x01 0x18 0x31 0x02 0x18 0x31 0x04 0x18 0x31 0x08 0x18 0x31 0x10 0x18 0x31 0x20 0x18 0x31 0x40 0x18 0x31 0x80 0x18 0x31 0x100>; + resets = <0x14 0x31 0x01 0x14 0x31 0x02 0x14 0x31 0x04 0x14 0x31 0x08 0x14 0x31 0x10 0x14 0x31 0x20 0x14 0x31 0x40 0x14 0x31 0x80 0x14 0x31 0x100>; reset-names = "trst0", "trst1", "trst2", "trst3", "trst4", "trst5", "trst6", "trst7", "prst"; status = "okay"; }; @@ -4778,11 +5231,12 @@ #address-cells = <0x02>; #size-cells = <0x02>; reg = <0x00 0x51850000 0x00 0x8000>; + numa-node-id = <0x00>; interrupt-parent = <0x10>; interrupts = <0x15b>; clock-names = "pclk", "timer_aclk"; clocks = <0x03 0x26e 0x03 0x26a>; - resets = <0x18 0x32 0x01 0x18 0x32 0x02 0x18 0x32 0x04 0x18 0x32 0x08 0x18 0x32 0x10 0x18 0x32 0x20 0x18 0x32 0x40 0x18 0x32 0x80 0x18 0x32 0x100>; + resets = <0x14 0x32 0x01 0x14 0x32 0x02 0x14 0x32 0x04 0x14 0x32 0x08 0x14 0x32 0x10 0x14 0x32 0x20 0x14 0x32 0x40 0x14 0x32 0x80 0x14 0x32 0x100>; reset-names = "trst0", "trst1", "trst2", "trst3", "trst4", "trst5", "trst6", "trst7", "prst"; status = "okay"; }; @@ -4792,11 +5246,12 @@ #address-cells = <0x02>; #size-cells = <0x02>; reg = <0x00 0x51858000 0x00 0x8000>; + numa-node-id = <0x00>; interrupt-parent = <0x10>; interrupts = <0x15c>; clock-names = "pclk", "timer_aclk", "timer3_clk8"; clocks = <0x03 0x26f 0x03 0x26b 0x03 0x270>; - resets = <0x18 0x33 0x01 0x18 0x33 0x02 0x18 0x33 0x04 0x18 0x33 0x08 0x18 0x33 0x10 0x18 0x33 0x20 0x18 0x33 0x40 0x18 0x33 0x80 0x18 0x33 0x100>; + resets = <0x14 0x33 0x01 0x14 0x33 0x02 0x14 0x33 0x04 0x14 0x33 0x08 0x14 0x33 0x10 0x14 0x33 0x20 0x14 0x33 0x40 0x14 0x33 0x80 0x14 0x33 0x100>; reset-names = "trst0", "trst1", "trst2", "trst3", "trst4", "trst5", "trst6", "trst7", "prst"; status = "okay"; }; @@ -4804,111 +5259,124 @@ rtc@51818000 { compatible = "eswin,win2030-rtc"; reg = <0x00 0x51818000 0x00 0x400>; - eswin,syscfg = <0x17 0x3c0>; + eswin,syscfg = <0x13 0x3c0>; interrupt-parent = <0x10>; interrupts = <0x124>; clocks = <0x03 0x272>; clock-names = "rtcclk"; clock-frequency = <0x3d09>; - resets = <0x18 0x34 0x01>; + resets = <0x14 0x34 0x01>; reset-names = "rtcrst"; status = "okay"; + numa-node-id = <0x00>; }; i2s0@50200000 { compatible = "snps,i2s"; - clocks = <0x03 0x250>; - clock-names = "mclk"; + clocks = <0x03 0x250 0x03 0x10>; + clock-names = "mclk", "apll"; #address-cells = <0x01>; #size-cells = <0x00>; #sound-dai-cells = <0x00>; reg = <0x00 0x50200000 0x00 0x10000>; dma-names = "rx", "tx"; - dmas = <0x31 0x04 0x00 0x31 0x05 0x00>; - vo_mclk_sel,syscrg = <0x16 0x1bc>; - resets = <0x18 0x22 0x01 0x18 0x22 0x02 0x18 0x21 0x02>; + dmas = <0x36 0x04 0x04 0x00 0x36 0x05 0x05 0x00>; + vo_mclk_sel,syscrg = <0x12 0x1bc>; + resets = <0x14 0x22 0x01 0x14 0x22 0x02 0x14 0x21 0x02>; reset-names = "i2srst", "i2sprst", "voprst"; dma-noncoherent; + numa-node-id = <0x00>; status = "okay"; port { - phandle = <0x36>; + phandle = <0x3a>; endpoint { - remote-endpoint = <0x33>; + remote-endpoint = <0x37>; dai-format = "i2s"; - phandle = <0x42>; + phandle = <0x46>; }; }; }; i2s1@50210000 { compatible = "snps,i2s"; - clocks = <0x03 0x250>; - clock-names = "mclk"; + clocks = <0x03 0x250 0x03 0x10>; + clock-names = "mclk", "apll"; #address-cells = <0x01>; #size-cells = <0x00>; #sound-dai-cells = <0x00>; reg = <0x00 0x50210000 0x00 0x10000>; dma-names = "rx", "tx"; - dmas = <0x31 0x02 0x01 0x31 0x03 0x01>; - vo_mclk_sel,syscrg = <0x16 0x1bc>; - resets = <0x18 0x22 0x01 0x18 0x22 0x02 0x18 0x21 0x02>; + dmas = <0x36 0x06 0x02 0x01 0x36 0x07 0x03 0x01>; + vo_mclk_sel,syscrg = <0x12 0x1bc>; + resets = <0x14 0x22 0x01 0x14 0x22 0x02 0x14 0x21 0x02>; reset-names = "i2srst", "i2sprst", "voprst"; dma-noncoherent; + numa-node-id = <0x00>; status = "okay"; port { - phandle = <0x35>; + phandle = <0x39>; endpoint { - remote-endpoint = <0x34>; + remote-endpoint = <0x38>; dai-format = "i2s"; - phandle = <0x30>; + phandle = <0x35>; }; }; }; i2s2@50220000 { compatible = "snps,i2s"; - clocks = <0x03 0x250>; - clock-names = "mclk"; + clocks = <0x03 0x250 0x03 0x10>; + clock-names = "mclk", "apll"; #address-cells = <0x01>; #size-cells = <0x00>; #sound-dai-cells = <0x00>; reg = <0x00 0x50220000 0x00 0x10000>; dma-names = "rx", "tx"; - dmas = <0x31 0x00 0x02 0x31 0x01 0x02>; - vo_mclk_sel,syscrg = <0x16 0x1bc>; - resets = <0x18 0x22 0x01 0x18 0x22 0x02 0x18 0x21 0x02>; + dmas = <0x36 0x08 0x00 0x02 0x36 0x09 0x01 0x02>; + vo_mclk_sel,syscrg = <0x12 0x1bc>; + resets = <0x14 0x22 0x01 0x14 0x22 0x02 0x14 0x21 0x02>; reset-names = "i2srst", "i2sprst", "voprst"; dma-noncoherent; + numa-node-id = <0x00>; status = "disabled"; }; + soundcard { + compatible = "simple-audio-card"; + simple-audio-card,name = "Eswin sound card"; + numa-node-id = <0x00>; + }; + graphcard0 { compatible = "audio-graph-card"; + numa-node-id = <0x00>; status = "okay"; label = "Analog Audio-0"; - dais = <0x35>; + dais = <0x39>; }; graphcard1 { compatible = "audio-graph-card"; + numa-node-id = <0x00>; status = "okay"; label = "HDMI Audio"; - dais = <0x36>; + dais = <0x3a>; }; graphcard2 { compatible = "audio-graph-card"; + numa-node-id = <0x00>; status = "disabled"; }; display-subsystem@0 { compatible = "eswin,display-subsystem"; - ports = <0x37>; numa-node-id = <0x00>; + ports = <0x3b>; dma-noncoherent; status = "okay"; }; @@ -4916,6 +5384,7 @@ dvb-subsystem { compatible = "amlogic,dvb_widgets"; status = "disabled"; + numa-node-id = <0x00>; }; display_control@502c0000 { @@ -4923,9 +5392,9 @@ reg = <0x00 0x502c0000 0x00 0x100 0x00 0x502c0180 0x00 0x700 0x00 0x502c1400 0x00 0x1400>; interrupt-parent = <0x10>; interrupts = <0xee>; - clocks = <0x03 0x24d 0x03 0x24f 0x03 0x24c 0x03 0x04 0x03 0x2a>; - clock-names = "cfg_clk", "pix_clk", "axi_clk", "spll0_fout1", "vo_mux"; - resets = <0x18 0x23 0x01 0x18 0x23 0x02 0x18 0x23 0x04 0x18 0x23 0x08>; + clocks = <0x03 0x24d 0x03 0x24f 0x03 0x24c 0x03 0x04 0x03 0x2a 0x03 0x2b 0x03 0x0b 0x03 0x0d>; + clock-names = "cfg_clk", "pix_clk", "axi_clk", "spll0_fout1", "vo_mux", "pix_mux", "spll2_fout2", "vpll_fout1"; + resets = <0x14 0x23 0x01 0x14 0x23 0x02 0x14 0x23 0x04 0x14 0x23 0x08>; reset-names = "vo_arst", "vo_prst", "dc_arst", "dc_prst"; dma-noncoherent; numa-node-id = <0x00>; @@ -4934,24 +5403,24 @@ port { #address-cells = <0x01>; #size-cells = <0x00>; - phandle = <0x37>; + phandle = <0x3b>; endpoint@0 { reg = <0x00>; - remote-endpoint = <0x38>; - phandle = <0x3c>; + remote-endpoint = <0x3c>; + phandle = <0x40>; }; endpoint@1 { reg = <0x01>; - remote-endpoint = <0x39>; - phandle = <0x3b>; + remote-endpoint = <0x3d>; + phandle = <0x3f>; }; endpoint@2 { reg = <0x02>; - remote-endpoint = <0x3a>; - phandle = <0x41>; + remote-endpoint = <0x3e>; + phandle = <0x45>; }; }; }; @@ -4965,8 +5434,8 @@ port { endpoint { - remote-endpoint = <0x3b>; - phandle = <0x39>; + remote-endpoint = <0x3f>; + phandle = <0x3d>; }; }; }; @@ -4984,7 +5453,7 @@ reg = <0x00 0x50270000 0x00 0x10000>; clocks = <0x03 0x201>; clock-names = "pclk"; - resets = <0x18 0x21 0x01>; + resets = <0x14 0x21 0x01>; reset-names = "phyrstn"; numa-node-id = <0x00>; status = "okay"; @@ -4999,8 +5468,8 @@ reg = <0x00>; endpoint { - remote-endpoint = <0x3c>; - phandle = <0x38>; + remote-endpoint = <0x40>; + phandle = <0x3c>; }; }; @@ -5010,8 +5479,8 @@ reg = <0x01>; endpoint { - remote-endpoint = <0x3d>; - phandle = <0x40>; + remote-endpoint = <0x41>; + phandle = <0x44>; }; }; }; @@ -5023,15 +5492,15 @@ dsi,lanes = <0x04>; status = "okay"; pinctrl-names = "default"; - pinctrl-0 = <0x3e 0x3f>; - backlight0-gpios = <0x21 0x05 0x00>; - rst-gpios = <0x2a 0x0f 0x00>; + pinctrl-0 = <0x42 0x43>; + backlight0-gpios = <0x1d 0x05 0x00>; + rst-gpios = <0x2c 0x0f 0x00>; port { endpoint { - remote-endpoint = <0x40>; - phandle = <0x3d>; + remote-endpoint = <0x44>; + phandle = <0x41>; }; }; }; @@ -5042,6 +5511,7 @@ reg = <0x00 0x502c0000 0x00 0x10000>; interrupt-parent = <0x10>; interrupts = <0xee>; + numa-node-id = <0x00>; status = "disabled"; }; @@ -5057,7 +5527,7 @@ ddc-i2c-scl-high-time-ns = <0x1264>; ddc-i2c-scl-low-time-ns = <0x1334>; #sound-dai-cells = <0x00>; - resets = <0x18 0x21 0x08 0x18 0x21 0x10 0x18 0x21 0x20>; + resets = <0x14 0x21 0x08 0x14 0x21 0x10 0x14 0x21 0x20>; reset-names = "prstn", "phyrstn", "rstn"; numa-node-id = <0x00>; status = "okay"; @@ -5070,8 +5540,8 @@ reg = <0x00>; endpoint@0 { - remote-endpoint = <0x41>; - phandle = <0x3a>; + remote-endpoint = <0x45>; + phandle = <0x3e>; }; }; @@ -5080,8 +5550,8 @@ endpoint@1 { system-clock-frequency = <0xbb8000>; - remote-endpoint = <0x42>; - phandle = <0x33>; + remote-endpoint = <0x46>; + phandle = <0x37>; }; }; }; @@ -5105,10 +5575,11 @@ #size-cells = <0x02>; clocks = <0x03 0x10e 0x03 0x221 0x03 0x222>; clock-names = "suspend", "aclk", "cfg_clk"; - eswin,hsp_sp_csr = <0x1a 0x800 0x808 0x83c 0x840>; - resets = <0x18 0x07 0x8000>; + eswin,hsp_sp_csr = <0x16 0x800 0x808 0x83c 0x840>; + resets = <0x14 0x07 0x8000>; reset-names = "vaux"; ranges; + numa-node-id = <0x00>; status = "okay"; dwc3@50480000 { @@ -5122,8 +5593,8 @@ dr_mode = "host"; phy_type = "utmi"; maximum-speed = "super-speed"; - iommus = <0x19 0x0a>; - eswin,hsp_sp_csr = <0x1a 0x1044>; + iommus = <0x15 0x0a>; + eswin,hsp_sp_csr = <0x16 0x1044>; dma-ranges = <0x00 0x00 0x00 0xc0000000 0x200 0x00>; snps,dis_enblslpm_quirk; snps,dis-u2-freeclk-exists-quirk; @@ -5143,10 +5614,11 @@ #size-cells = <0x02>; clocks = <0x03 0x10f 0x03 0x221 0x03 0x222>; clock-names = "suspend", "aclk", "cfg_clk"; - eswin,hsp_sp_csr = <0x1a 0x900 0x908 0x93c 0x940>; - resets = <0x18 0x07 0x10000>; + eswin,hsp_sp_csr = <0x16 0x900 0x908 0x93c 0x940>; + resets = <0x14 0x07 0x10000>; reset-names = "vaux"; ranges; + numa-node-id = <0x00>; status = "okay"; dwc3@50490000 { @@ -5160,8 +5632,8 @@ dr_mode = "host"; phy_type = "utmi"; maximum-speed = "super-speed"; - iommus = <0x19 0x0b>; - eswin,hsp_sp_csr = <0x1a 0x1048>; + iommus = <0x15 0x0b>; + eswin,hsp_sp_csr = <0x16 0x1048>; dma-ranges = <0x00 0x00 0x00 0xc0000000 0x200 0x00>; snps,dis_enblslpm_quirk; snps,dis-u2-freeclk-exists-quirk; @@ -5179,14 +5651,16 @@ compatible = "esw,vi-common-csr", "syscon"; clocks = <0x03 0x23f 0x03 0x241 0x03 0x243 0x03 0x240 0x03 0x24b 0x03 0x24a 0x03 0x244 0x03 0x245 0x03 0x246 0x03 0x247 0x03 0x248 0x03 0x249 0x03 0x27 0x03 0x28 0x03 0x29 0x03 0x04 0x03 0x0d>; clock-names = "aclk", "cfg_clk", "isp_aclk", "dvp_clk", "phy_cfg", "phy_escclk", "sht0", "sht1", "sht2", "sht3", "sht4", "sht5", "aclk_mux", "dvp_mux", "isp_mux", "spll0_fout1", "vpll_fout1"; - resets = <0x18 0x1c 0x01 0x18 0x1c 0x02 0x18 0x1e 0x01 0x18 0x1f 0x01 0x18 0x1d 0x01 0x18 0x20 0x01 0x18 0x20 0x02 0x18 0x20 0x04 0x18 0x20 0x08 0x18 0x20 0x10 0x18 0x20 0x20>; + resets = <0x14 0x1c 0x01 0x14 0x1c 0x02 0x14 0x1e 0x01 0x14 0x1f 0x01 0x14 0x1d 0x01 0x14 0x20 0x01 0x14 0x20 0x02 0x14 0x20 0x04 0x14 0x20 0x08 0x14 0x20 0x10 0x14 0x20 0x20>; reset-names = "axi", "cfg", "isp0", "isp1", "dvp", "sht0", "sht1", "sht2", "sht3", "sht4", "sht5"; interrupt-parent = <0x10>; interrupts = <0x170 0x171 0x172 0x173 0x174 0x175 0x176 0x177>; id = <0x00>; #size-cells = <0x02>; reg = <0x00 0x51030000 0x00 0x10000>; - phandle = <0x43>; + numa-node-id = <0x00>; + tbus = <0x00>; + phandle = <0x47>; }; isp@0x51000000 { @@ -5197,9 +5671,9 @@ id = <0x00>; #size-cells = <0x02>; dma-ranges = <0x00 0x20000000 0x00 0x80000000 0x00 0x40000000>; - iommus = <0x19 0x06>; + iommus = <0x15 0x06>; tbus = <0x00>; - eswin,vi_top_csr = <0x43 0x1000>; + eswin,vi_top_csr = <0x47 0x1000>; numa-node-id = <0x00>; dma-noncoherent; status = "okay"; @@ -5213,9 +5687,9 @@ id = <0x01>; #size-cells = <0x02>; dma-ranges = <0x00 0x20000000 0x00 0x80000000 0x00 0x40000000>; - iommus = <0x19 0x06>; + iommus = <0x15 0x06>; tbus = <0x00>; - eswin,vi_top_csr = <0x43 0x1004>; + eswin,vi_top_csr = <0x47 0x1004>; numa-node-id = <0x00>; dma-noncoherent; status = "okay"; @@ -5225,15 +5699,18 @@ compatible = "eswin,dewarp"; clocks = <0x03 0x23f 0x03 0x241 0x03 0x242 0x03 0x27 0x03 0x54 0x03 0x04 0x03 0x0d>; clock-names = "aclk", "cfg_clk", "dw_aclk", "aclk_mux", "dw_mux", "spll0_fout1", "vpll_fout1"; - resets = <0x18 0x1c 0x01 0x18 0x1c 0x02 0x18 0x1c 0x04>; + resets = <0x14 0x1c 0x01 0x14 0x1c 0x02 0x14 0x1c 0x04>; reset-names = "axi", "cfg", "dwe"; + operating-points-v2 = <0x48>; + #cooling-cells = <0x02>; + dynamic-power-coefficient = <0x3e8>; interrupt-parent = <0x10>; interrupts = <0x1a 0x19>; #size-cells = <0x02>; dma-ranges = <0x00 0x20000000 0x00 0x80000000 0x00 0x40000000>; - iommus = <0x19 0x08>; + iommus = <0x15 0x08>; tbus = <0x00>; - eswin,vi_top_csr = <0x43 0x1008>; + eswin,vi_top_csr = <0x47 0x1008>; reg = <0x00 0x51020000 0x00 0xc00 0x00 0x51020c00 0x00 0x120>; numa-node-id = <0x00>; dma-noncoherent; @@ -5266,8 +5743,8 @@ endpoint@0 { reg = <0x00>; bus-type = <0x04>; - remote-endpoint = <0x44>; - phandle = <0x46>; + remote-endpoint = <0x49>; + phandle = <0x4b>; }; }; }; @@ -5287,8 +5764,8 @@ endpoint@0 { reg = <0x00>; bus-type = <0x04>; - remote-endpoint = <0x45>; - phandle = <0x47>; + remote-endpoint = <0x4a>; + phandle = <0x4c>; }; }; }; @@ -5317,8 +5794,8 @@ bus-type = <0x04>; clock-lanes = <0x00>; data-lanes = <0x01 0x02>; - remote-endpoint = <0x46>; - phandle = <0x44>; + remote-endpoint = <0x4b>; + phandle = <0x49>; }; }; }; @@ -5345,8 +5822,8 @@ endpoint { bus-type = <0x04>; - remote-endpoint = <0x47>; - phandle = <0x45>; + remote-endpoint = <0x4c>; + phandle = <0x4a>; }; }; }; @@ -5357,7 +5834,7 @@ #size-cells = <0x02>; ranges; dma-ranges = <0x00 0x80000000 0x00 0xc0000000 0x00 0x80000000>; - iommus = <0x19 0x18>; + iommus = <0x15 0x18>; tbus = <0xf00>; numa-node-id = <0x00>; status = "disabled"; @@ -5397,139 +5874,31 @@ }; }; - opp-table0 { - compatible = "operating-points-v2"; - opp-shared; - phandle = <0x04>; - - opp-24000000 { - opp-hz = <0x00 0x16e3600>; - opp-microvolt = "", "\f5"; - clock-latency-ns = <0x11170>; - }; - - opp-100000000 { - opp-hz = <0x00 0x5f5e100>; - opp-microvolt = "", "\f5"; - clock-latency-ns = <0x11170>; - }; - - opp-200000000 { - opp-hz = <0x00 0xbebc200>; - opp-microvolt = "", "\f5"; - clock-latency-ns = <0x11170>; - }; - - opp-400000000 { - opp-hz = <0x00 0x17d78400>; - opp-microvolt = "", "\f5"; - clock-latency-ns = <0x11170>; - }; - - opp-500000000 { - opp-hz = <0x00 0x1dcd6500>; - opp-microvolt = "", "\f5"; - clock-latency-ns = <0x11170>; - }; - - opp-600000000 { - opp-hz = <0x00 0x23c34600>; - opp-microvolt = "", "\f5"; - clock-latency-ns = <0x11170>; - }; - - opp-700000000 { - opp-hz = <0x00 0x29b92700>; - opp-microvolt = "", "\f5"; - clock-latency-ns = <0x11170>; - }; - - opp-800000000 { - opp-hz = <0x00 0x2faf0800>; - opp-microvolt = "", "\f5"; - clock-latency-ns = <0x11170>; - }; - - opp-900000000 { - opp-hz = <0x00 0x35a4e900>; - opp-microvolt = "", "\f5"; - clock-latency-ns = <0x11170>; - }; - - opp-1000000000 { - opp-hz = <0x00 0x3b9aca00>; - opp-microvolt = "", "\f5"; - clock-latency-ns = <0x11170>; - }; - - opp-1200000000 { - opp-hz = <0x00 0x47868c00>; - opp-microvolt = "", "\f5"; - clock-latency-ns = <0x11170>; - }; - - opp-1300000000 { - opp-hz = <0x00 0x4d7c6d00>; - opp-microvolt = "", "\f5"; - clock-latency-ns = <0x11170>; - }; - - opp-1400000000 { - opp-hz = <0x00 0x53724e00>; - opp-microvolt = "", "\f5"; - clock-latency-ns = <0x11170>; - }; - - opp-1500000000 { - opp-hz = <0x00 0x59682f00>; - opp-microvolt = <0xdbba0>; - clock-latency-ns = <0x11170>; - }; - - opp-1600000000 { - opp-hz = <0x00 0x5f5e1000>; - opp-microvolt = <0xdbba0>; - clock-latency-ns = <0x11170>; - }; - - opp-1700000000 { - opp-hz = <0x00 0x6553f100>; - opp-microvolt = <0xdbba0>; - clock-latency-ns = <0x11170>; - }; - - opp-1800000000 { - opp-hz = <0x00 0x6b49d200>; - opp-microvolt = <0xdbba0>; - clock-latency-ns = <0x11170>; - }; - }; - thermal-zones { thermal0 { - polling-delay-passive = <0x1f4>; - polling-delay = <0x1388>; - sustainable-power = <0x4b0>; - thermal-sensors = <0x48>; + polling-delay-passive = <0x64>; + polling-delay = <0x3e8>; + sustainable-power = <0x7530>; + thermal-sensors = <0x4d>; trips { trip-point0 { - temperature = <0xea60>; + temperature = <0x15f90>; hysteresis = <0x3e8>; type = "passive"; }; trip-point1 { - temperature = <0x11170>; + temperature = <0x186a0>; hysteresis = <0x3e8>; type = "passive"; - phandle = <0x49>; + phandle = <0x4e>; }; trip-point2 { - temperature = <0x1adb0>; + temperature = <0x19a28>; hysteresis = <0x00>; type = "critical"; }; @@ -5538,21 +5907,27 @@ cooling-maps { map0 { - trip = <0x49>; + trip = <0x4e>; contribution = <0x400>; - cooling-device = <0x4a 0xffffffff 0xffffffff 0x4b 0xffffffff 0xffffffff 0x4c 0xffffffff 0xffffffff 0x4d 0xffffffff 0xffffffff>; + cooling-device = <0x4f 0x00 0x0a 0x50 0x00 0x0a 0x51 0x00 0x0a 0x52 0x00 0x0a>; }; map1 { - trip = <0x49>; - contribution = <0x400>; - cooling-device = <0x4e 0xffffffff 0xffffffff>; + trip = <0x4e>; + contribution = <0x1000>; + cooling-device = <0x53 0xffffffff 0xffffffff>; }; map2 { - trip = <0x49>; + trip = <0x4e>; contribution = <0x400>; - cooling-device = <0x4f 0xffffffff 0xffffffff>; + cooling-device = <0x54 0xffffffff 0xffffffff 0x55 0xffffffff 0xffffffff 0x56 0xffffffff 0xffffffff 0x57 0xffffffff 0xffffffff>; + }; + + map3 { + trip = <0x4e>; + contribution = <0x400>; + cooling-device = <0x58 0xffffffff 0xffffffff>; }; }; }; @@ -5568,17 +5943,23 @@ chosen { stdout-path = "serial0:115200n8"; - - bootargs = "console=ttyS0,115200 root=PARTUUID=b0f77ad6-36cd-4a99-a8c0-31d73649aa09 rootfstype=ext4 rootwait rw earlycon loglevel=8 debug earlyprintk=sbi selinux=0 LANG=en_US.UTF-8 single "; - linux,initrd-start = <0x01 0x0d1b3000>; - linux,initrd-end = <0x01 0x0ffff286>; - + + bootargs = "append root=PARTUUID=b0f77ad6-36cd-4a99-a8c0-31d73649aa09 console=ttyS0,115200 root=PARTUUID=b0f77ad6-36cd-4a99-a8c0-31d73649aa09 rootfstype=ext4 rootwait rw earlycon selinux=0 LANG=en_US.UTF-8"; + linux,initrd-start = <0x01 0x0c450000>; + linux,initrd-end = <0x01 0x0ffff0f3>; + domain-config { compatible = "opensbi,domain,config"; system-suspend-test; }; }; + memory@90000000 { + device_type = "memory"; + reg = <0x00 0x90000000 0x00 0x80000000>; + numa-node-id = <0x00>; + }; + memory@59000000 { device_type = "memory"; reg = <0x00 0x59000000 0x00 0x400000>; @@ -5593,16 +5974,16 @@ linux,cma { compatible = "shared-dma-pool"; reusable; - size = <0x00 0x8000000>; // 128MB + size = <0x00 0x8000000>; // 128MB alignment = <0x00 0x1000>; - alloc-ranges = <0x00 0x90000000 0x00 0x80000000>; + alloc-ranges = <0x00 0x90000000 0x00 0x80000000>; linux,cma-default; }; sprammemory@59000000 { no-map; reg = <0x00 0x59000000 0x00 0x400000>; - phandle = <0x23>; + phandle = <0x21>; }; g2d_4GB_boundary_reserved_4k { @@ -5630,28 +6011,28 @@ leds { compatible = "gpio-leds"; pinctrl-names = "default"; - pinctrl-0 = <0x50 0x51 0x52>; + pinctrl-0 = <0x59 0x5a 0x5b>; gpio-107 { - gpios = <0x2a 0x0b 0x00>; + gpios = <0x2c 0x0b 0x00>; label = "power"; linux,default-trigger = "default-on"; }; gpio-108 { - gpios = <0x2a 0x0c 0x01>; + gpios = <0x2c 0x0c 0x01>; label = "heartbeat"; linux,default-trigger = "heartbeat"; }; gpio-109 { - gpios = <0x2a 0x0d 0x00>; + gpios = <0x2c 0x0d 0x00>; label = "gpio-109"; linux,default-trigger = "default-off"; }; gpio-110 { - gpios = <0x2a 0x0e 0x00>; + gpios = <0x2c 0x0e 0x00>; label = "gpio-109"; linux,default-trigger = "default-off"; }; @@ -5664,8 +6045,8 @@ label = "OK"; linux,code = <0x160>; pinctrl-names = "default"; - pinctrl-0 = <0x53>; - gpios = <0x21 0x06 0x01>; + pinctrl-0 = <0x5c>; + gpios = <0x1d 0x06 0x01>; }; }; }; From b8974ae69159580db3ff55dec6be9ceb2923fab3 Mon Sep 17 00:00:00 2001 From: Alignof Date: Thu, 18 Sep 2025 02:10:31 +0900 Subject: [PATCH 17/28] [!][fix] add mapping for axi4-sys-port --- hikami_core/src/lib.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/hikami_core/src/lib.rs b/hikami_core/src/lib.rs index 83d9c99..f072edc 100644 --- a/hikami_core/src/lib.rs +++ b/hikami_core/src/lib.rs @@ -100,8 +100,13 @@ impl HypervisorData { G_STAGE_PTE_FLAGS, ), MemoryMap::new( - GuestPhysicalAddress(0x1_1000_0000)..GuestPhysicalAddress(0x480000000), - HostPhysicalAddress(0x1_1000_0000)..HostPhysicalAddress(0x480000000), + GuestPhysicalAddress(0x1_1000_0000)..GuestPhysicalAddress(0x4_8000_0000), + HostPhysicalAddress(0x1_1000_0000)..HostPhysicalAddress(0x4_8000_0000), + G_STAGE_PTE_FLAGS, + ), + MemoryMap::new( + GuestPhysicalAddress(0x80_0000_0000)..GuestPhysicalAddress(0x180_0000_0000), + HostPhysicalAddress(0x80_0000_0000)..HostPhysicalAddress(0x180_0000_0000), G_STAGE_PTE_FLAGS, ), ]; From a5468baacfcaf9245eae89ccd7479e5ef233290b Mon Sep 17 00:00:00 2001 From: Alignof Date: Thu, 18 Sep 2025 18:31:06 +0900 Subject: [PATCH 18/28] [update] change device tree parameters with actual parameters --- guest_image/guest.dts | 56 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 52 insertions(+), 4 deletions(-) diff --git a/guest_image/guest.dts b/guest_image/guest.dts index 0681e5f..ddcba4e 100644 --- a/guest_image/guest.dts +++ b/guest_image/guest.dts @@ -1179,6 +1179,7 @@ }; ethernet@50400000 { + local-mac-address = [4a db f3 67 92 fe]; compatible = "eswin,win2030-qos-eth"; reg = <0x00 0x50400000 0x00 0x10000>; interrupt-parent = <0x10>; @@ -2515,7 +2516,10 @@ reg-names = "dbi", "config", "mgmt"; device_type = "pci"; bus-range = <0x00 0xff>; - ranges = <0x81000000 0x00 0x40800000 0x00 0x40800000 0x00 0x800000 0x82000000 0x00 0x41000000 0x00 0x41000000 0x00 0xf000000 0xc3000000 0x80 0x00 0x80 0x00 0x02 0x00>; + ranges = < + 0x81000000 0x00 0x40800000 0x00 0x40800000 0x00 0x800000 + 0x82000000 0x00 0x41000000 0x00 0x41000000 0x00 0xf000000 + 0xc3000000 0x80 0x00 0x80 0x00 0x02 0x00>; num-lanes = <0x04>; interrupts = <0xdc 0xb3 0xb4 0xb5 0xb6 0xb7 0xb8 0xb9 0xba>; interrupt-names = "msi", "inta", "intb", "intc", "intd"; @@ -5942,11 +5946,13 @@ }; chosen { - stdout-path = "serial0:115200n8"; - - bootargs = "append root=PARTUUID=b0f77ad6-36cd-4a99-a8c0-31d73649aa09 console=ttyS0,115200 root=PARTUUID=b0f77ad6-36cd-4a99-a8c0-31d73649aa09 rootfstype=ext4 rootwait rw earlycon selinux=0 LANG=en_US.UTF-8"; linux,initrd-start = <0x01 0x0c450000>; linux,initrd-end = <0x01 0x0ffff0f3>; + boot-hartid = <0x00>; + u-boot,version = "2024.01-g5414c4be"; + bootargs = "root=PARTUUID=b0f77ad6-36cd-4a99-a8c0-31d73649aa09 console=ttyS0,115200 loglevel=8 debug root=PARTUUID=b0f77ad6-36cd-4a99-a8c0-31d73649aa09 rootfstype=ext4 rootwait rw earlycon selinux=0 LANG=en_US.UTF-8"; + + stdout-path = "serial0:115200n8"; domain-config { compatible = "opensbi,domain,config"; @@ -5971,6 +5977,48 @@ #size-cells = <0x02>; ranges; + lpcpures@dfff0000 { + no-map; + reg = <0x00 0xdfff0000 0x00 0x10000>; + phandle = <0x60>; + }; + + region@e0000000 { + no-map; + reg = <0x00 0xe0000000 0x00 0x1000000>; + phandle = <0x5f>; + }; + + mmode_resv1@10,0 { + no-map; + reg = <0x10 0x00 0x00 0x400000>; + phandle = <0x5e>; + }; + + mmode_resv0@80000000 { + no-map; + reg = <0x00 0x80000000 0x00 0x80000>; + phandle = <0x5d>; + }; + + hyprvisor_resv0@83000000 { + no-map; + reg = <0x00 0x83000000 0x00 0xd000000>; + phandle = <0x61>; + }; + + hyprvisor_resv1@d0000000 { + no-map; + reg = <0x00 0xd0000000 0x00 0x8000000>; + phandle = <0x62>; + }; + + hyprvisor_resv2@f0000000 { + no-map; + reg = <0x00 0xf0000000 0x00 0x800000>; + phandle = <0x63>; + }; + linux,cma { compatible = "shared-dma-pool"; reusable; From 381d295fbae6d155ba2cdff8c52a0efd7fe8089b Mon Sep 17 00:00:00 2001 From: Alignof Date: Thu, 18 Sep 2025 20:23:02 +0900 Subject: [PATCH 19/28] [!][update] update memory layout of the hikami --- guest_image/guest.dts | 12 ++++++------ hikami_core/src/lib.rs | 8 ++++---- hikami_core/src/memmap/constant.rs | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/guest_image/guest.dts b/guest_image/guest.dts index ddcba4e..be726c5 100644 --- a/guest_image/guest.dts +++ b/guest_image/guest.dts @@ -5946,8 +5946,8 @@ }; chosen { - linux,initrd-start = <0x01 0x0c450000>; - linux,initrd-end = <0x01 0x0ffff0f3>; + linux,initrd-start = <0x01 0x7c450000>; + linux,initrd-end = <0x01 0x7ffff0f3>; boot-hartid = <0x00>; u-boot,version = "2024.01-g5414c4be"; bootargs = "root=PARTUUID=b0f77ad6-36cd-4a99-a8c0-31d73649aa09 console=ttyS0,115200 loglevel=8 debug root=PARTUUID=b0f77ad6-36cd-4a99-a8c0-31d73649aa09 rootfstype=ext4 rootwait rw earlycon selinux=0 LANG=en_US.UTF-8"; @@ -5960,9 +5960,9 @@ }; }; - memory@90000000 { + memory@100000000 { device_type = "memory"; - reg = <0x00 0x90000000 0x00 0x80000000>; + reg = <0x01 0x00000000 0x00 0x80000000>; numa-node-id = <0x00>; }; @@ -6022,9 +6022,9 @@ linux,cma { compatible = "shared-dma-pool"; reusable; - size = <0x00 0x8000000>; // 128MB + size = <0x00 0x20000000>; // 512MB alignment = <0x00 0x1000>; - alloc-ranges = <0x00 0x90000000 0x00 0x80000000>; + alloc-ranges = <0x01 0x00000000 0x00 0x80000000>; linux,cma-default; }; diff --git a/hikami_core/src/lib.rs b/hikami_core/src/lib.rs index f072edc..d7e2999 100644 --- a/hikami_core/src/lib.rs +++ b/hikami_core/src/lib.rs @@ -100,13 +100,13 @@ impl HypervisorData { G_STAGE_PTE_FLAGS, ), MemoryMap::new( - GuestPhysicalAddress(0x1_1000_0000)..GuestPhysicalAddress(0x4_8000_0000), - HostPhysicalAddress(0x1_1000_0000)..HostPhysicalAddress(0x4_8000_0000), + GuestPhysicalAddress(0x1_8000_0000)..GuestPhysicalAddress(0x4_8000_0000), + HostPhysicalAddress(0x1_8000_0000)..HostPhysicalAddress(0x4_8000_0000), G_STAGE_PTE_FLAGS, ), MemoryMap::new( - GuestPhysicalAddress(0x80_0000_0000)..GuestPhysicalAddress(0x180_0000_0000), - HostPhysicalAddress(0x80_0000_0000)..HostPhysicalAddress(0x180_0000_0000), + GuestPhysicalAddress(0x80_0000_0000)..GuestPhysicalAddress(0x200_0000_0000), + HostPhysicalAddress(0x80_0000_0000)..HostPhysicalAddress(0x200_0000_0000), G_STAGE_PTE_FLAGS, ), ]; diff --git a/hikami_core/src/memmap/constant.rs b/hikami_core/src/memmap/constant.rs index ce57907..283ec81 100644 --- a/hikami_core/src/memmap/constant.rs +++ b/hikami_core/src/memmap/constant.rs @@ -25,7 +25,7 @@ pub mod guest_memory { /// /// It starts from as high as `DRAM_SIZE_PER_GUEST` to distinguish from HPA. pub const DRAM_BASE: GuestPhysicalAddress = - GuestPhysicalAddress(super::DRAM_BASE + 0x1000_0000); + GuestPhysicalAddress(super::DRAM_BASE + 0x8000_0000); /// Dram memory space per HART. pub const DRAM_SIZE_PER_GUEST: usize = 2 * 1024 * 1024 * 1024; // 2 GB = 0x8000_0000 /// Guest DTB space size From 9b69d4d31523a73c739662637ca8ac514c5a9d07 Mon Sep 17 00:00:00 2001 From: Alignof Date: Sat, 20 Sep 2025 17:16:16 +0900 Subject: [PATCH 20/28] [update] update memory map --- .cargo/config.toml | 5 +---- guest_image/guest.dts | 9 +++++---- hikami_core/src/lib.rs | 4 ++-- hikami_core/src/memmap/constant.rs | 2 +- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index 9c756f9..092f3db 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -35,10 +35,7 @@ qemu-system-riscv64 # runner = "../../qemu/build/qemu-system-riscv64 -S -gdb tcp::10000 -d int,in_asm,cpu_reset,mmu,page,guest_errors -machine virt -bios none -nographic -m 2G -initrd vmlinux_debug -drive file=rootfs.img,format=raw,id=hd0,if=none -device virtio-blk-pci,drive=hd0,iommu_platform=true,disable-legacy=on -append root=/dev/vda,rw,console=ttyS0 -device riscv-iommu-pci -kernel" # memo: maintenance packet Qqemu.PhyMemMode:1 -rustflags = [ - "-C", "link-arg=-Tmemory.x", - "-C", "target-feature=+h", -] +rustflags = ["-C", "link-arg=-Tmemory.x", "-C", "target-feature=+h"] [build] target = "riscv64imac-unknown-none-elf" diff --git a/guest_image/guest.dts b/guest_image/guest.dts index be726c5..9e19fa4 100644 --- a/guest_image/guest.dts +++ b/guest_image/guest.dts @@ -2,6 +2,7 @@ // copy from 2025-0423/dtbs/linux-image-6.6.87-win2030/eswin/eic7700-milkv-megrez.dtb +/memreserve/ 0x000000010c450000 0x0000000003baf0f3; / { #address-cells = <0x02>; #size-cells = <0x02>; @@ -5946,8 +5947,8 @@ }; chosen { - linux,initrd-start = <0x01 0x7c450000>; - linux,initrd-end = <0x01 0x7ffff0f3>; + linux,initrd-start = <0x01 0x0c450000>; + linux,initrd-end = <0x01 0x0ffff0f3>; boot-hartid = <0x00>; u-boot,version = "2024.01-g5414c4be"; bootargs = "root=PARTUUID=b0f77ad6-36cd-4a99-a8c0-31d73649aa09 console=ttyS0,115200 loglevel=8 debug root=PARTUUID=b0f77ad6-36cd-4a99-a8c0-31d73649aa09 rootfstype=ext4 rootwait rw earlycon selinux=0 LANG=en_US.UTF-8"; @@ -5960,9 +5961,9 @@ }; }; - memory@100000000 { + memory@90000000 { device_type = "memory"; - reg = <0x01 0x00000000 0x00 0x80000000>; + reg = <0x00 0x90000000 0x00 0x80000000>; numa-node-id = <0x00>; }; diff --git a/hikami_core/src/lib.rs b/hikami_core/src/lib.rs index d7e2999..4b1fa83 100644 --- a/hikami_core/src/lib.rs +++ b/hikami_core/src/lib.rs @@ -100,8 +100,8 @@ impl HypervisorData { G_STAGE_PTE_FLAGS, ), MemoryMap::new( - GuestPhysicalAddress(0x1_8000_0000)..GuestPhysicalAddress(0x4_8000_0000), - HostPhysicalAddress(0x1_8000_0000)..HostPhysicalAddress(0x4_8000_0000), + GuestPhysicalAddress(0x1_1000_0000)..GuestPhysicalAddress(0x4_8000_0000), + HostPhysicalAddress(0x1_1000_0000)..HostPhysicalAddress(0x4_8000_0000), G_STAGE_PTE_FLAGS, ), MemoryMap::new( diff --git a/hikami_core/src/memmap/constant.rs b/hikami_core/src/memmap/constant.rs index 283ec81..ce57907 100644 --- a/hikami_core/src/memmap/constant.rs +++ b/hikami_core/src/memmap/constant.rs @@ -25,7 +25,7 @@ pub mod guest_memory { /// /// It starts from as high as `DRAM_SIZE_PER_GUEST` to distinguish from HPA. pub const DRAM_BASE: GuestPhysicalAddress = - GuestPhysicalAddress(super::DRAM_BASE + 0x8000_0000); + GuestPhysicalAddress(super::DRAM_BASE + 0x1000_0000); /// Dram memory space per HART. pub const DRAM_SIZE_PER_GUEST: usize = 2 * 1024 * 1024 * 1024; // 2 GB = 0x8000_0000 /// Guest DTB space size From 8dd59820d2562755105b45b9ae483d8e3f57ce25 Mon Sep 17 00:00:00 2001 From: Alignof Date: Mon, 22 Sep 2025 02:39:22 +0900 Subject: [PATCH 21/28] [update] disable cooling-maps of cpu1-3 in device tree --- guest_image/guest.dts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/guest_image/guest.dts b/guest_image/guest.dts index 9e19fa4..c8ddd82 100644 --- a/guest_image/guest.dts +++ b/guest_image/guest.dts @@ -5914,7 +5914,12 @@ map0 { trip = <0x4e>; contribution = <0x400>; - cooling-device = <0x4f 0x00 0x0a 0x50 0x00 0x0a 0x51 0x00 0x0a 0x52 0x00 0x0a>; + cooling-device = < + 0x4f 0x00 0x0a + // 0x50 0x00 0x0a + // 0x51 0x00 0x0a + // 0x52 0x00 0x0a + >; }; map1 { From 65d7abe299037a64c397e94f470d051941c794af Mon Sep 17 00:00:00 2001 From: Alignof Date: Mon, 22 Sep 2025 02:40:06 +0900 Subject: [PATCH 22/28] [fix] fix linux,cma range in device tree --- guest_image/guest.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guest_image/guest.dts b/guest_image/guest.dts index c8ddd82..3bfad87 100644 --- a/guest_image/guest.dts +++ b/guest_image/guest.dts @@ -6030,7 +6030,7 @@ reusable; size = <0x00 0x20000000>; // 512MB alignment = <0x00 0x1000>; - alloc-ranges = <0x01 0x00000000 0x00 0x80000000>; + alloc-ranges = <0x00 0x90000000 0x00 0x80000000>; linux,cma-default; }; From 3aa28434cd5df749962f852a259d35e7828a20c1 Mon Sep 17 00:00:00 2001 From: Alignof Date: Mon, 22 Sep 2025 14:56:33 +0900 Subject: [PATCH 23/28] [!][wip][update] it works on megrez if hart id matches --- guest_image/guest.dts | 15 ++++++++------- hikami_core/src/lib.rs | 13 +++++++++---- hikami_core/src/memmap/constant.rs | 2 +- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/guest_image/guest.dts b/guest_image/guest.dts index 3bfad87..7f1fe0c 100644 --- a/guest_image/guest.dts +++ b/guest_image/guest.dts @@ -2,7 +2,7 @@ // copy from 2025-0423/dtbs/linux-image-6.6.87-win2030/eswin/eic7700-milkv-megrez.dtb -/memreserve/ 0x000000010c450000 0x0000000003baf0f3; +/memreserve/ 0x000000017c450000 0x0000000003baf0f3; / { #address-cells = <0x02>; #size-cells = <0x02>; @@ -5952,11 +5952,12 @@ }; chosen { - linux,initrd-start = <0x01 0x0c450000>; - linux,initrd-end = <0x01 0x0ffff0f3>; + linux,initrd-start = <0x01 0x7c450000>; + linux,initrd-end = <0x01 0x7ffff0f3>; boot-hartid = <0x00>; u-boot,version = "2024.01-g5414c4be"; - bootargs = "root=PARTUUID=b0f77ad6-36cd-4a99-a8c0-31d73649aa09 console=ttyS0,115200 loglevel=8 debug root=PARTUUID=b0f77ad6-36cd-4a99-a8c0-31d73649aa09 rootfstype=ext4 rootwait rw earlycon selinux=0 LANG=en_US.UTF-8"; + bootargs = "root=PARTUUID=b0f77ad6-36cd-4a99-a8c0-31d73649aa09 console=ttyS0,115200 loglevel=8 debug root=PARTUUID=b0f77ad6-36cd-4a99-a8c0-31d73649aa09 rootfstype=ext4 rootwait rw earlycon selinux=0 LANG=en_US.UTF-8 mem=debug dyndbg=\"file drivers/scsi* +p; file drivers/usb/storage/* +p; file drivers/usb/dwc3/* +p\" trace_event=scsi:scsi_dispatch_cmd_start,scsi:scsi_cmd_error,scsi:scsi_eh_wakeup"; + // bootargs = "root=PARTUUID=b0f77ad6-36cd-4a99-a8c0-31d73649aa09 console=ttyS0,115200 initcall_debug loglevel=8 debug root=PARTUUID=b0f77ad6-36cd-4a99-a8c0-31d73649aa09 rootfstype=ext4 rootwait rw earlycon selinux=0 LANG=en_US.UTF-8 dyndbg=\"file drivers/usb/dwc3/* +p\""; stdout-path = "serial0:115200n8"; @@ -5966,9 +5967,9 @@ }; }; - memory@90000000 { + memory@80000000 { device_type = "memory"; - reg = <0x00 0x90000000 0x00 0x80000000>; + reg = <0x00 0x80000000 0x04 0x00000000>; numa-node-id = <0x00>; }; @@ -6030,7 +6031,7 @@ reusable; size = <0x00 0x20000000>; // 512MB alignment = <0x00 0x1000>; - alloc-ranges = <0x00 0x90000000 0x00 0x80000000>; + alloc-ranges = <0x01 0x00000000 0x00 0x80000000>; linux,cma-default; }; diff --git a/hikami_core/src/lib.rs b/hikami_core/src/lib.rs index 4b1fa83..86f2ce5 100644 --- a/hikami_core/src/lib.rs +++ b/hikami_core/src/lib.rs @@ -100,13 +100,18 @@ impl HypervisorData { G_STAGE_PTE_FLAGS, ), MemoryMap::new( - GuestPhysicalAddress(0x1_1000_0000)..GuestPhysicalAddress(0x4_8000_0000), - HostPhysicalAddress(0x1_1000_0000)..HostPhysicalAddress(0x4_8000_0000), + GuestPhysicalAddress(0x8008_0000)..GuestPhysicalAddress(0x9000_0000), + HostPhysicalAddress(0x8008_0000)..HostPhysicalAddress(0x9000_0000), G_STAGE_PTE_FLAGS, ), MemoryMap::new( - GuestPhysicalAddress(0x80_0000_0000)..GuestPhysicalAddress(0x200_0000_0000), - HostPhysicalAddress(0x80_0000_0000)..HostPhysicalAddress(0x200_0000_0000), + GuestPhysicalAddress(0x1_8000_0000)..GuestPhysicalAddress(0x4_8000_0000), + HostPhysicalAddress(0x1_8000_0000)..HostPhysicalAddress(0x4_8000_0000), + G_STAGE_PTE_FLAGS, + ), + MemoryMap::new( + GuestPhysicalAddress(0x80_0000_0000)..GuestPhysicalAddress(0x100_0000_0000), + HostPhysicalAddress(0x80_0000_0000)..HostPhysicalAddress(0x100_0000_0000), G_STAGE_PTE_FLAGS, ), ]; diff --git a/hikami_core/src/memmap/constant.rs b/hikami_core/src/memmap/constant.rs index ce57907..283ec81 100644 --- a/hikami_core/src/memmap/constant.rs +++ b/hikami_core/src/memmap/constant.rs @@ -25,7 +25,7 @@ pub mod guest_memory { /// /// It starts from as high as `DRAM_SIZE_PER_GUEST` to distinguish from HPA. pub const DRAM_BASE: GuestPhysicalAddress = - GuestPhysicalAddress(super::DRAM_BASE + 0x1000_0000); + GuestPhysicalAddress(super::DRAM_BASE + 0x8000_0000); /// Dram memory space per HART. pub const DRAM_SIZE_PER_GUEST: usize = 2 * 1024 * 1024 * 1024; // 2 GB = 0x8000_0000 /// Guest DTB space size From dc50ffbdf2ae4befe423feebbe92a069144f0b42 Mon Sep 17 00:00:00 2001 From: Alignof Date: Mon, 22 Sep 2025 21:38:57 +0900 Subject: [PATCH 24/28] [fix] return corresponding exception code in `hs_forward_exception` --- src/trap/exception.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/trap/exception.rs b/src/trap/exception.rs index 751f385..ecb4620 100644 --- a/src/trap/exception.rs +++ b/src/trap/exception.rs @@ -33,7 +33,12 @@ pub extern "C" fn hs_forward_exception() { "csrw vscause, {scause}", "csrw vstval, {stval}", sepc = in(reg) context.sepc(), - scause = in(reg) scause::read().bits(), + scause = in(reg) match scause::read().bits() { + 20 => 1, // Instruction access fault + 21 => 5, // Load access fault + 23 => 7, // Store/AMO access fault + _ => unimplemented!(), + }, stval = in(reg) stval::read(), ); From 46d79747c88534e54450a2fb585b7940163d9fda Mon Sep 17 00:00:00 2001 From: Alignof Date: Mon, 22 Sep 2025 21:52:37 +0900 Subject: [PATCH 25/28] [add] add debug code for a hypervisor level exception --- src/trap/exception.rs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/trap/exception.rs b/src/trap/exception.rs index ecb4620..47751dc 100644 --- a/src/trap/exception.rs +++ b/src/trap/exception.rs @@ -89,6 +89,32 @@ fn update_sepc_by_inst_type(is_compressed: bool, context: &mut guest::context::C /// Trap handler for exception #[allow(clippy::cast_possible_truncation, clippy::module_name_repetitions)] pub fn trap_exception(exception_cause: Exception) -> ! { + if cfg!(feature = "debug_log") { + if scause::read().bits() != 0xa { + use hikami_core::memmap::page_table::g_stage_trans_addr; + use hikami_core::memmap::{GuestPhysicalAddress, HostPhysicalAddress}; + let htval = htval::read().bits(); + + if !(0xc00_0000..0x1000_0000).contains(&(htval << 2)) { + let scause = scause::read().bits(); + let stval = stval::read(); + let sepc = riscv::register::sepc::read(); + let htval_hpa = g_stage_trans_addr(GuestPhysicalAddress(htval << 2)) + .ok() + .map(|x| x.raw()); + let htinst = hikami_core::h_extension::csrs::htinst::read().bits(); + + hikami_core::debugln!("!!! EXCEPTION CAUGHT !!!"); + hikami_core::debugln!("sepc: {:#x}", sepc); + hikami_core::debugln!("scause: {:#x}", scause); + hikami_core::debugln!("stval: {:#x}", stval); + hikami_core::debugln!("htval << 2: {:#x}", htval << 2); + hikami_core::debugln!("htval(hpa): {:#x?}", htval_hpa); + hikami_core::debugln!("htinst: {:#x}", htinst); + } + } + } + match exception_cause { Exception::IllegalInstruction => instruction_handler::illegal_instruction(), Exception::SupervisorEnvCall => panic!("SupervisorEnvCall should be handled by M-mode"), From 2019a5d58e720689fba311707f9ed006100cf2a8 Mon Sep 17 00:00:00 2001 From: Alignof Date: Tue, 23 Sep 2025 14:20:05 +0900 Subject: [PATCH 26/28] [fix] apply `cargo clippy --fix` --- hikami_core/src/device.rs | 2 +- src/trap/exception.rs | 40 +++++++++++++++++++-------------------- 2 files changed, 20 insertions(+), 22 deletions(-) diff --git a/hikami_core/src/device.rs b/hikami_core/src/device.rs index fdb113b..d61c089 100644 --- a/hikami_core/src/device.rs +++ b/hikami_core/src/device.rs @@ -365,7 +365,7 @@ impl Devices { } // skip if it isn't memory mapped device. - if !node.reg().is_some() { + if node.reg().is_none() { continue; } diff --git a/src/trap/exception.rs b/src/trap/exception.rs index 47751dc..166eb63 100644 --- a/src/trap/exception.rs +++ b/src/trap/exception.rs @@ -89,29 +89,27 @@ fn update_sepc_by_inst_type(is_compressed: bool, context: &mut guest::context::C /// Trap handler for exception #[allow(clippy::cast_possible_truncation, clippy::module_name_repetitions)] pub fn trap_exception(exception_cause: Exception) -> ! { - if cfg!(feature = "debug_log") { - if scause::read().bits() != 0xa { - use hikami_core::memmap::page_table::g_stage_trans_addr; - use hikami_core::memmap::{GuestPhysicalAddress, HostPhysicalAddress}; - let htval = htval::read().bits(); + if cfg!(feature = "debug_log") && scause::read().bits() != 0xa { + use hikami_core::memmap::page_table::g_stage_trans_addr; + use hikami_core::memmap::{GuestPhysicalAddress, HostPhysicalAddress}; + let htval = htval::read().bits(); - if !(0xc00_0000..0x1000_0000).contains(&(htval << 2)) { - let scause = scause::read().bits(); - let stval = stval::read(); - let sepc = riscv::register::sepc::read(); - let htval_hpa = g_stage_trans_addr(GuestPhysicalAddress(htval << 2)) - .ok() - .map(|x| x.raw()); - let htinst = hikami_core::h_extension::csrs::htinst::read().bits(); + if !(0xc00_0000..0x1000_0000).contains(&(htval << 2)) { + let scause = scause::read().bits(); + let stval = stval::read(); + let sepc = riscv::register::sepc::read(); + let htval_hpa = g_stage_trans_addr(GuestPhysicalAddress(htval << 2)) + .ok() + .map(HostPhysicalAddress::raw); + let htinst = hikami_core::h_extension::csrs::htinst::read().bits(); - hikami_core::debugln!("!!! EXCEPTION CAUGHT !!!"); - hikami_core::debugln!("sepc: {:#x}", sepc); - hikami_core::debugln!("scause: {:#x}", scause); - hikami_core::debugln!("stval: {:#x}", stval); - hikami_core::debugln!("htval << 2: {:#x}", htval << 2); - hikami_core::debugln!("htval(hpa): {:#x?}", htval_hpa); - hikami_core::debugln!("htinst: {:#x}", htinst); - } + hikami_core::debugln!("!!! EXCEPTION CAUGHT !!!"); + hikami_core::debugln!("sepc: {:#x}", sepc); + hikami_core::debugln!("scause: {:#x}", scause); + hikami_core::debugln!("stval: {:#x}", stval); + hikami_core::debugln!("htval << 2: {:#x}", htval << 2); + hikami_core::debugln!("htval(hpa): {:#x?}", htval_hpa); + hikami_core::debugln!("htinst: {:#x}", htinst); } } From f7cd63a8234b99ed182816a6b38f2d9ac886dec5 Mon Sep 17 00:00:00 2001 From: Alignof Date: Tue, 23 Sep 2025 14:30:18 +0900 Subject: [PATCH 27/28] [fix] fix cargo clippy warnings --- hikami_core/src/memmap/page_table/sv39x4.rs | 8 ++++++-- src/trap/exception.rs | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/hikami_core/src/memmap/page_table/sv39x4.rs b/hikami_core/src/memmap/page_table/sv39x4.rs index c7c0592..aa3be3f 100644 --- a/hikami_core/src/memmap/page_table/sv39x4.rs +++ b/hikami_core/src/memmap/page_table/sv39x4.rs @@ -430,12 +430,16 @@ fn split_superpage( }; // Populate the new page table with leaf entries that map the original region. - for i in 0..PAGE_TABLE_LEN { + for (i, next_level_pte) in next_level_page_table + .iter_mut() + .enumerate() + .take(PAGE_TABLE_LEN) + { let hpa_offset = i * next_level_page_size; let next_hpa = original_hpa_base + hpa_offset; // Create a new leaf PTE with the original permissions. - next_level_page_table[i] = PageTableEntry::new(next_hpa.page_number(), original_flags); + *next_level_pte = PageTableEntry::new(next_hpa.page_number(), original_flags); } // Atomically update the original PTE to be a pointer to the new table. diff --git a/src/trap/exception.rs b/src/trap/exception.rs index 166eb63..b87c801 100644 --- a/src/trap/exception.rs +++ b/src/trap/exception.rs @@ -89,6 +89,7 @@ fn update_sepc_by_inst_type(is_compressed: bool, context: &mut guest::context::C /// Trap handler for exception #[allow(clippy::cast_possible_truncation, clippy::module_name_repetitions)] pub fn trap_exception(exception_cause: Exception) -> ! { + #[allow(unused_variables)] if cfg!(feature = "debug_log") && scause::read().bits() != 0xa { use hikami_core::memmap::page_table::g_stage_trans_addr; use hikami_core::memmap::{GuestPhysicalAddress, HostPhysicalAddress}; From fe3d0de138c4e9c5ac9c20d31950914b7a5ee011 Mon Sep 17 00:00:00 2001 From: Alignof Date: Tue, 23 Sep 2025 14:47:14 +0900 Subject: [PATCH 28/28] [refactor] allow unused argument in `MmioDevice::root_page_table_addr` --- hikami_core/src/device.rs | 1 + hikami_core/src/device/aclint/mtimer.rs | 4 +++- hikami_core/src/device/axi_sdc.rs | 2 +- hikami_core/src/device/clint.rs | 4 +++- hikami_core/src/device/pci.rs | 7 ++++++- hikami_core/src/device/plic.rs | 2 +- hikami_core/src/device/uart.rs | 2 +- hikami_core/src/device/virtio.rs | 8 +++++++- 8 files changed, 23 insertions(+), 7 deletions(-) diff --git a/hikami_core/src/device.rs b/hikami_core/src/device.rs index d61c089..8a9e860 100644 --- a/hikami_core/src/device.rs +++ b/hikami_core/src/device.rs @@ -276,6 +276,7 @@ pub struct Devices { /// Axi SD card pub axi_sdc: Option, + #[allow(dead_code)] /// Other mmio devices other_mmio_devices: Vec, } diff --git a/hikami_core/src/device/aclint/mtimer.rs b/hikami_core/src/device/aclint/mtimer.rs index 5a72aa0..a38fceb 100644 --- a/hikami_core/src/device/aclint/mtimer.rs +++ b/hikami_core/src/device/aclint/mtimer.rs @@ -16,12 +16,14 @@ use fdt::{Fdt, standard_nodes::MemoryRegion}; pub struct Mtimer { /// Device tree name name: String, + + #[allow(dead_code)] /// Memory maps for memory mapped register. register_map_regions: Vec, } impl MmioDevice for Mtimer { fn try_new( - root_page_table_addr: HostPhysicalAddress, + _root_page_table_addr: HostPhysicalAddress, device_tree: &Fdt, compatibles: &[&str], ) -> Option { diff --git a/hikami_core/src/device/axi_sdc.rs b/hikami_core/src/device/axi_sdc.rs index 8707927..c2b15d5 100644 --- a/hikami_core/src/device/axi_sdc.rs +++ b/hikami_core/src/device/axi_sdc.rs @@ -125,7 +125,7 @@ impl EmulateDevice for Mmc { impl MmioDevice for Mmc { fn try_new( - root_page_table_addr: HostPhysicalAddress, + _root_page_table_addr: HostPhysicalAddress, device_tree: &Fdt, compatibles: &[&str], ) -> Option { diff --git a/hikami_core/src/device/clint.rs b/hikami_core/src/device/clint.rs index f761c41..8c8edcb 100644 --- a/hikami_core/src/device/clint.rs +++ b/hikami_core/src/device/clint.rs @@ -14,13 +14,15 @@ use fdt::{Fdt, standard_nodes::MemoryRegion}; pub struct Clint { /// Device tree name name: String, + + #[allow(dead_code)] /// Memory maps for memory mapped register. register_map_regions: Vec, } impl MmioDevice for Clint { fn try_new( - root_page_table_addr: HostPhysicalAddress, + _root_page_table_addr: HostPhysicalAddress, device_tree: &Fdt, compatibles: &[&str], ) -> Option { diff --git a/hikami_core/src/device/pci.rs b/hikami_core/src/device/pci.rs index bd91e27..1458d16 100644 --- a/hikami_core/src/device/pci.rs +++ b/hikami_core/src/device/pci.rs @@ -259,12 +259,17 @@ impl PciAddressSpace { pub struct Pci { /// Device tree name name: String, + + #[allow(dead_code)] /// Memory maps for pci register. register_map_regions: Vec, + /// PCI address space manager _pci_addr_space: PciAddressSpace, + /// Memory maps for pci devices memory_maps: Vec, + /// PCI devices pub pci_devices: PciDevices, } @@ -281,7 +286,7 @@ impl Pci { impl MmioDevice for Pci { fn try_new( - root_page_table_addr: HostPhysicalAddress, + _root_page_table_addr: HostPhysicalAddress, device_tree: &Fdt, compatibles: &[&str], ) -> Option { diff --git a/hikami_core/src/device/plic.rs b/hikami_core/src/device/plic.rs index 9b5ec1c..88250b4 100644 --- a/hikami_core/src/device/plic.rs +++ b/hikami_core/src/device/plic.rs @@ -260,7 +260,7 @@ impl Plic { impl MmioDevice for Plic { #[allow(clippy::cast_ptr_alignment)] fn try_new( - root_page_table_addr: HostPhysicalAddress, + _root_page_table_addr: HostPhysicalAddress, device_tree: &Fdt, compatibles: &[&str], ) -> Option { diff --git a/hikami_core/src/device/uart.rs b/hikami_core/src/device/uart.rs index 1902234..afab354 100644 --- a/hikami_core/src/device/uart.rs +++ b/hikami_core/src/device/uart.rs @@ -39,7 +39,7 @@ impl Uart { impl MmioDevice for Uart { fn try_new( - root_page_table_addr: HostPhysicalAddress, + _root_page_table_addr: HostPhysicalAddress, device_tree: &Fdt, compatibles: &[&str], ) -> Option { diff --git a/hikami_core/src/device/virtio.rs b/hikami_core/src/device/virtio.rs index 835c466..9b5478b 100644 --- a/hikami_core/src/device/virtio.rs +++ b/hikami_core/src/device/virtio.rs @@ -39,15 +39,21 @@ impl VirtIoList { pub struct VirtIo { /// Device tree name name: String, + + #[allow(dead_code)] /// Memory maps for memory mapped register. register_map_regions: Vec, + /// Interrupt Reqeust bit. irq: u8, } impl VirtIo { /// Create self with fdt node - pub fn new_with_node(root_page_table_addr: HostPhysicalAddress, virtio_node: &FdtNode) -> Self { + pub fn new_with_node( + _root_page_table_addr: HostPhysicalAddress, + virtio_node: &FdtNode, + ) -> Self { let register_map_regions: Vec = virtio_node.reg().unwrap().collect(); VirtIo {