| 640 | } |
| 641 | |
| 642 | void 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 |
| 677 | static void ofw_dts(int argc, char**argv) |
no test coverage detected