Lines Matching +full:input +full:- +full:depth
1 // SPDX-License-Identifier: GPL-2.0
3 * fdtdump.c - Contributed by Pantelis Antoniou <pantelis.antoniou AT gmail.com>
17 #define ALIGN(x, a) (((x) + ((a) - 1)) & ~((a) - 1))
19 #define GET_CELL(p) (p += 4, *((const uint32_t *)(p-4)))
36 i < (len - 4) ? " " : ""); in print_data()
41 printf("%02x%s", *p++, i < len - 1 ? " " : ""); in print_data()
49 uint32_t off_mem_rsvmap = fdt32_to_cpu(bph->off_mem_rsvmap); in dump_blob()
50 uint32_t off_dt = fdt32_to_cpu(bph->off_dt_struct); in dump_blob()
51 uint32_t off_str = fdt32_to_cpu(bph->off_dt_strings); in dump_blob()
56 uint32_t version = fdt32_to_cpu(bph->version); in dump_blob()
57 uint32_t totalsize = fdt32_to_cpu(bph->totalsize); in dump_blob()
60 int depth, sz, shift; in dump_blob() local
64 depth = 0; in dump_blob()
67 printf("/dts-v1/;\n"); in dump_blob()
68 printf("// magic:\t\t0x%x\n", fdt32_to_cpu(bph->magic)); in dump_blob()
75 fdt32_to_cpu(bph->last_comp_version)); in dump_blob()
78 fdt32_to_cpu(bph->boot_cpuid_phys)); in dump_blob()
82 fdt32_to_cpu(bph->size_dt_strings)); in dump_blob()
85 fdt32_to_cpu(bph->size_dt_struct)); in dump_blob()
101 /* printf("tag: 0x%08x (%d)\n", tag, p - p_struct); */ in dump_blob()
110 printf("%*s%s {\n", depth * shift, "", s); in dump_blob()
112 depth++; in dump_blob()
117 depth--; in dump_blob()
119 printf("%*s};\n", depth * shift, ""); in dump_blob()
124 printf("%*s// [NOP]\n", depth * shift, ""); in dump_blob()
129 fprintf(stderr, "%*s ** Unknown tag 0x%08x\n", depth * shift, "", tag); in dump_blob()
140 printf("%*s%s", depth * shift, "", s); in dump_blob()
152 fprintf(stderr, "supply input filename\n"); in main()