soc: arm: replace DT_CPU_CLOCK_FREQUENCY with new dt macros

Replace DT_CPU_CLOCK_FREQUENCY with a PATH based reference to cpu@0
(DT_PATH(cpus, cpu_0)) and than getting the clock_frequency property:

DT_CPU_CLOCK_FREQUENCY -> DT_PROP(DT_PATH(cpus, cpu_0), clock_frequency)

This lets us remove DT_CPU_CLOCK_FREQUENCY from dts_fixup.h.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
Kumar Gala 2020-04-22 07:06:40 -05:00 committed by Kumar Gala
commit 8b6acb5e91
13 changed files with 14 additions and 36 deletions

View file

@ -37,6 +37,8 @@ struct spi_cc13xx_cc26xx_data {
#endif
};
#define CPU_FREQ DT_PROP(DT_PATH(cpus, cpu_0), clock_frequency)
static inline struct spi_cc13xx_cc26xx_data *get_dev_data(struct device *dev)
{
return dev->driver_data;
@ -91,7 +93,7 @@ static int spi_cc13xx_cc26xx_configure(struct device *dev,
return -EINVAL;
}
if (2 * config->frequency > DT_CPU_CLOCK_FREQUENCY) {
if (2 * config->frequency > CPU_FREQ) {
LOG_ERR("Frequency greater than supported in master mode");
return -EINVAL;
}
@ -121,7 +123,7 @@ static int spi_cc13xx_cc26xx_configure(struct device *dev,
SSIDisable(cfg->base);
/* Configure SSI */
SSIConfigSetExpClk(cfg->base, DT_CPU_CLOCK_FREQUENCY, prot,
SSIConfigSetExpClk(cfg->base, CPU_FREQ, prot,
SSI_MODE_MASTER, config->frequency, 8);
if (SPI_MODE_GET(config->operation) & SPI_MODE_LOOP) {