soc: riscv: openisa_rv32m1: Add helper to get clock_ip_name from dts

Add a helper macro that will go from a DT_DRV_INST number and return the
clock_ip_name value for that instance.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
Kumar Gala 2020-04-02 11:59:08 -05:00 committed by Kumar Gala
commit 977cd7b588

View file

@ -108,4 +108,9 @@ void soc_interrupt_init(void);
#define RISCV_RAM_SIZE KB(CONFIG_SRAM_SIZE)
#define RISCV_RAM_BASE CONFIG_SRAM_BASE_ADDRESS
/* helper macro to convert from a DT_INST to HAL clock_ip_name */
#define INST_DT_CLOCK_IP_NAME(n) \
MAKE_PCC_REGADDR(DT_REG_ADDR(DT_INST_PHANDLE(n, clocks)), \
DT_INST_CLOCKS_CELL(n, name))
#endif /* SOC_RISCV32_OPENISA_RV32M1_SOC_H_ */