MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / rt_ofw_node_dump_dts

Function rt_ofw_node_dump_dts

components/drivers/ofw/ofw.c:642–674  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

640}
641
642void rt_ofw_node_dump_dts(struct rt_ofw_node *np, rt_bool_t sibling_too)
643{
644 if (np)
645 {
646 if (!rt_strcmp(np->name, "/"))
647 {
648 struct fdt_info *header = (struct fdt_info *)np->name;
649 struct fdt_reserve_entry *rsvmap = header->rsvmap;
650
651 /*
652 * Shall be present to identify the file as a version 1 DTS
653 * (dts files without this tag will be treated by dtc
654 * as being in the obsolete version 0, which uses
655 * a different format for integers in addition to
656 * other small but incompatible changes).
657 */
658 rt_kprintf("/dts-v1/;\n\n");
659
660 for (int i = header->rsvmap_nr - 1; i >= 0; --i)
661 {
662 rt_kprintf("/memreserve/\t%p %p;\n",
663 ofw_static_cast(rt_size_t, fdt64_to_cpu(rsvmap->address)),
664 ofw_static_cast(rt_size_t, fdt64_to_cpu(rsvmap->size)));
665
666 ++rsvmap;
667 }
668
669 rt_kputs(np->name);
670 }
671
672 ofw_node_dump_dts(np, sibling_too);
673 }
674}
675
676#ifdef RT_USING_MSH
677static void ofw_dts(int argc, char**argv)

Callers 1

ofw_dtsFunction · 0.85

Calls 5

rt_strcmpFunction · 0.85
rt_kprintfFunction · 0.85
rt_kputsFunction · 0.85
ofw_node_dump_dtsFunction · 0.85
fdt64_to_cpuFunction · 0.50

Tested by

no test coverage detected