diff options
Diffstat (limited to 'bsps/arm/raspberrypi/start/bspstart.c')
-rw-r--r-- | bsps/arm/raspberrypi/start/bspstart.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/bsps/arm/raspberrypi/start/bspstart.c b/bsps/arm/raspberrypi/start/bspstart.c index 6ff286f840..49896e4d47 100644 --- a/bsps/arm/raspberrypi/start/bspstart.c +++ b/bsps/arm/raspberrypi/start/bspstart.c @@ -24,6 +24,8 @@ #include <bsp/raspberrypi.h> #include <bsp/vc.h> +#include <libfdt.h> + static const struct { uint32_t code; const char* label; @@ -86,6 +88,19 @@ static const char* rpi_mem[] = #define NUMOF(_s) (sizeof(_s) / sizeof(_s[0])) +void *raspberrypi_get_reg_of_node(const void *fdt, int node) +{ + int len; + const uint32_t *val; + + val = fdt_getprop(fdt, node, "reg", &len); + if (val == NULL || len < 4) { + return NULL; + } + + return (BUS_TO_PHY((void *) fdt32_to_cpu(val[0]))); +} + void bsp_start(void) { bcm2835_get_board_spec_entries spec = { 0 }; |