MCPcopy Index your code
hub / github.com/cloud-hypervisor/cloud-hypervisor / create_timer_node

Function create_timer_node

arch/src/aarch64/fdt.rs:723–749  ·  view source on GitHub ↗
(fdt: &mut FdtWriter)

Source from the content-addressed store, hash-verified

721}
722
723fn create_timer_node(fdt: &mut FdtWriter) -> FdtWriterResult<()> {
724 // See
725 // https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bindings/timer/arm%2Carch_timer.yaml
726 // These are fixed interrupt numbers for the timer device.
727 let irqs = [
728 AARCH64_ARCH_TIMER_PHYS_SECURE_IRQ,
729 AARCH64_ARCH_TIMER_PHYS_NONSECURE_IRQ,
730 AARCH64_ARCH_TIMER_VIRT_IRQ,
731 AARCH64_ARCH_TIMER_HYP_IRQ,
732 ];
733 let compatible = "arm,armv8-timer";
734
735 let mut timer_reg_cells: Vec<u32> = Vec::new();
736 for &irq in irqs.iter() {
737 timer_reg_cells.push(GIC_FDT_IRQ_TYPE_PPI);
738 timer_reg_cells.push(irq);
739 timer_reg_cells.push(IRQ_TYPE_LEVEL_HI);
740 }
741
742 let timer_node = fdt.begin_node("timer")?;
743 fdt.property_string("compatible", compatible)?;
744 fdt.property_null("always-on")?;
745 fdt.property_array_u32("interrupts", &timer_reg_cells)?;
746 fdt.end_node(timer_node)?;
747
748 Ok(())
749}
750
751fn create_psci_node(fdt: &mut FdtWriter) -> FdtWriterResult<()> {
752 let compatible = "arm,psci-0.2";

Callers 1

create_fdtFunction · 0.85

Calls 3

newFunction · 0.85
iterMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected