summaryrefslogtreecommitdiff
path: root/sys/dev/dev_init.c
blob: fc708533eab810e1a321a68fbb3fd7ea7cacd0da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <dev.h>
#include <libfdt.h>
#include <sbi.h>
#include <stdio.h>
#include <string.h>
#include <stdint.h>

void
dev_init(struct fdt_header *fdt)
{
	if (fdt_check_header(fdt) == 0) 
		printf("[dev_init] valid fdt at %p\n", fdt);
	else
		printf("[dev_init] error: fdt_check_header()\n");

	int offset = fdt_next_node(fdt, offset, 0);
	do {
		printf("[dev_init] found %s\n", fdt_get_name(fdt, offset, NULL));
		offset = fdt_next_node(fdt, offset, 0);
	} while (offset != -FDT_ERR_NOTFOUND);
}