1 /* 2 * Copyright (c) 2017 Jean-Paul Etienne <fractalclone@gmail.com> 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 /** 8 * @file SoC configuration macros for the SiFive Freedom processor 9 */ 10 11 #ifndef __RISCV_SIFIVE_FREEDOM_U500_SOC_H_ 12 #define __RISCV_SIFIVE_FREEDOM_U500_SOC_H_ 13 14 /* 15 * On FE310 and FU540, peripherals such as SPI, UART, I2C and PWM are clocked 16 * by TLCLK, which is derived from CORECLK. 17 */ 18 #define SIFIVE_TLCLK_BASE_FREQUENCY \ 19 DT_PROP_BY_PHANDLE_IDX(DT_NODELABEL(tlclk), clocks, 0, clock_frequency) 20 #define SIFIVE_TLCLK_DIVIDER DT_PROP(DT_NODELABEL(tlclk), clock_div) 21 #define SIFIVE_PERIPHERAL_CLOCK_FREQUENCY \ 22 (SIFIVE_TLCLK_BASE_FREQUENCY / SIFIVE_TLCLK_DIVIDER) 23 24 #endif /* __RISCV_SIFIVE_FREEDOM_U500_SOC_H_ */ 25