diff options
author | Andre Przywara <andre.przywara@arm.com> | 2020-03-26 12:11:34 +0000 |
---|---|---|
committer | Andre Przywara <andre.przywara@arm.com> | 2020-05-05 15:36:51 +0100 |
commit | 7ad6d362016a875eaee0d227365b74acd464050b (patch) | |
tree | e0c1cf5fb7b5f5f178fedafe260039fb7b431015 /drivers | |
parent | 658086747dc638e3012a052293e855339d211a95 (diff) | |
download | trusted-firmware-a-7ad6d362016a875eaee0d227365b74acd464050b.tar.gz |
plat/stm32: Use generic fdt_get_reg_props_by_name()
The STM32 platform port parse DT nodes to find base address to
peripherals. It does this by using its own implementation, even though
this functionality is generic and actually widely useful outside of the
STM32 code.
Re-implement fdt_get_reg_props_by_name() on top of the newly introduced
fdt_get_reg_props_by_index() function, and move it to fdt_wrapper.c.
This is removes the assumption that #address-cells and #size-cells are
always one.
Change-Id: I6d584930262c732b6e0356d98aea50b2654f789d
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/st/spi/stm32_qspi.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/st/spi/stm32_qspi.c b/drivers/st/spi/stm32_qspi.c index c5e4ea86e3..ff92796e75 100644 --- a/drivers/st/spi/stm32_qspi.c +++ b/drivers/st/spi/stm32_qspi.c @@ -9,6 +9,7 @@ #include <platform_def.h> #include <common/debug.h> +#include <common/fdt_wrappers.h> #include <drivers/delay_timer.h> #include <drivers/spi_mem.h> #include <drivers/st/stm32_gpio.h> @@ -465,13 +466,13 @@ int stm32_qspi_init(void) return -FDT_ERR_NOTFOUND; } - ret = fdt_get_reg_props_by_name(qspi_node, "qspi", + ret = fdt_get_reg_props_by_name(fdt, qspi_node, "qspi", &stm32_qspi.reg_base, &size); if (ret != 0) { return ret; } - ret = fdt_get_reg_props_by_name(qspi_node, "qspi_mm", + ret = fdt_get_reg_props_by_name(fdt, qspi_node, "qspi_mm", &stm32_qspi.mm_base, &stm32_qspi.mm_size); if (ret != 0) { |