diff --git a/litex/soc/integration/soc.py b/litex/soc/integration/soc.py index 2a65d4076..fa5c4aba2 100644 --- a/litex/soc/integration/soc.py +++ b/litex/soc/integration/soc.py @@ -1955,6 +1955,7 @@ class LiteXSoC(SoC): self.bus.add_slave(name=name, slave=spiflash_core.bus, region=spiflash_region) # Constants. + self.add_constant(f"{name}_PHY_FREQUENCY", clk_freq) self.add_constant(f"{name}_MODULE_NAME", module.name) self.add_constant(f"{name}_MODULE_TOTAL_SIZE", module.total_size) self.add_constant(f"{name}_MODULE_PAGE_SIZE", module.page_size) diff --git a/litex/soc/software/liblitespi/spiflash.c b/litex/soc/software/liblitespi/spiflash.c index bbb928d51..53bb936ef 100644 --- a/litex/soc/software/liblitespi/spiflash.c +++ b/litex/soc/software/liblitespi/spiflash.c @@ -57,7 +57,7 @@ int spiflash_freq_init(void) #else - printf("SPI Flash clk configured to %ld MHz\n", CONFIG_CLOCK_FREQUENCY/1000000); + printf("SPI Flash clk configured to %ld MHz\n", SPIFLASH_PHY_FREQUENCY/1000000); #endif