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

Function ofw_node_dump_dts

components/drivers/ofw/ofw.c:512–640  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

510}
511
512static void ofw_node_dump_dts(struct rt_ofw_node *np, rt_bool_t sibling_too)
513{
514 int depth = 0;
515 struct rt_ofw_prop *prop;
516 struct rt_ofw_node *org_np = np;
517
518 while (np)
519 {
520 dts_put_depth(depth);
521 rt_kputs(np->full_name);
522 rt_kputs(" {\n");
523
524 prop = np->props;
525
526 /* Print prop start */
527 ++depth;
528
529 while (prop)
530 {
531 dts_put_depth(depth);
532
533 rt_kputs(prop->name);
534
535 /* Have value? */
536 if (prop->length > 0)
537 {
538 int length = prop->length;
539 void *value = prop->value;
540
541 rt_kputs(" = ");
542
543 if (dts_test_string_list(value, length))
544 {
545 /* String list */
546 char *str = value;
547
548 do {
549 rt_kputs("\"");
550 rt_kputs(str);
551 rt_kputs("\", ");
552
553 str += rt_strlen(str) + 1;
554
555 } while (str < (char *)value + length);
556
557 rt_kputs("\b\b");
558 }
559 else if ((length % 4) == 0)
560 {
561 /* u32 data in <?> */
562 fdt32_t *cell = value;
563
564 rt_kputs("<");
565
566 length /= 4;
567
568 for (int i = 0; i < length; ++i)
569 {

Callers 1

rt_ofw_node_dump_dtsFunction · 0.85

Calls 6

dts_put_depthFunction · 0.85
rt_kputsFunction · 0.85
dts_test_string_listFunction · 0.85
rt_strlenFunction · 0.85
rt_kprintfFunction · 0.85
fdt32_to_cpuFunction · 0.50

Tested by

no test coverage detected