From d78dbd6935ebb99d705baef5851266db1aaad128 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Tue, 20 Feb 2024 14:23:54 +0100 Subject: [PATCH] soc/add_spi_flash: Revert PHY_FREQUENCY definition and use in BIOS. --- litex/soc/integration/soc.py | 1 + litex/soc/software/liblitespi/spiflash.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) 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