diff options
Diffstat (limited to 'sys/include/dev.h')
-rw-r--r-- | sys/include/dev.h | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/sys/include/dev.h b/sys/include/dev.h index b8bfef8..657c04c 100644 --- a/sys/include/dev.h +++ b/sys/include/dev.h @@ -2,7 +2,37 @@ #define _DEV_H #include <libfdt.h> +#include <stdint.h> -void dev_init(struct fdt_header* fdt); +enum { DT_MMUTYPE_SV32, DT_MMUTYPE_SV39, DT_MMUTYPE_SV48 }; + +struct _reg { + fdt64_t address; + fdt64_t size; +}; +/* unflattend device tree */ +struct devicetree { + const char *compat; + const char *model; + int nproc; + /* main cpu, monitor/alternative cores will be ignored for now */ + struct { + short mmu_type; + const char *isa; + unsigned int freq; + } cpu; + struct { + uintptr_t origin; + uintptr_t size; + } memory; + struct { + unsigned int freq; + const char *compat; + int interrupt; + struct _reg reg; + } uart; +}; + +struct devicetree dev_init(struct fdt_header* fdt); #endif /* _DEV_H */ |