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

Function create_rtc_node

arch/src/aarch64/fdt.rs:804–825  ·  view source on GitHub ↗
(
    fdt: &mut FdtWriter,
    dev_info: &T,
)

Source from the content-addressed store, hash-verified

802}
803
804fn create_rtc_node<T: DeviceInfoForFdt + Clone + Debug>(
805 fdt: &mut FdtWriter,
806 dev_info: &T,
807) -> FdtWriterResult<()> {
808 let compatible = b"arm,pl031\0arm,primecell\0";
809 let rtc_reg_prop = [dev_info.addr(), dev_info.length()];
810 let irq = [
811 GIC_FDT_IRQ_TYPE_SPI,
812 dev_info.irq() - IRQ_BASE,
813 IRQ_TYPE_LEVEL_HI,
814 ];
815
816 let rtc_node = fdt.begin_node(&format!("rtc@{:x}", dev_info.addr()))?;
817 fdt.property("compatible", compatible)?;
818 fdt.property_array_u64("reg", &rtc_reg_prop)?;
819 fdt.property_array_u32("interrupts", &irq)?;
820 fdt.property_u32("clocks", CLOCK_PHANDLE)?;
821 fdt.property_string("clock-names", "apb_pclk")?;
822 fdt.end_node(rtc_node)?;
823
824 Ok(())
825}
826
827fn create_gpio_node<T: DeviceInfoForFdt + Clone + Debug>(
828 fdt: &mut FdtWriter,

Callers 1

create_devices_nodeFunction · 0.85

Calls 3

addrMethod · 0.45
lengthMethod · 0.45
irqMethod · 0.45

Tested by

no test coverage detected