diff --git a/soc/riscv/openisa_rv32m1/soc.h b/soc/riscv/openisa_rv32m1/soc.h index 8a0474a49b9..5a10ff6c31d 100644 --- a/soc/riscv/openisa_rv32m1/soc.h +++ b/soc/riscv/openisa_rv32m1/soc.h @@ -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_ */