From 3db7c017b416e5eea657050131b6323463620c8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fin=20Maa=C3=9F?= Date: Wed, 22 Jan 2025 12:32:08 +0100 Subject: [PATCH] targets: efinix_ti375_c529_dev_kit: be able to use ddr memory on all cpus MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit be able to use ddr memory on all cpus, including those without a seperate memory bus. Signed-off-by: Fin Maaß --- .../targets/efinix_ti375_c529_dev_kit.py | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/litex_boards/targets/efinix_ti375_c529_dev_kit.py b/litex_boards/targets/efinix_ti375_c529_dev_kit.py index aa8ad349..d9464772 100755 --- a/litex_boards/targets/efinix_ti375_c529_dev_kit.py +++ b/litex_boards/targets/efinix_ti375_c529_dev_kit.py @@ -649,13 +649,6 @@ class BaseSoC(SoCCore): Subsignal("resetn", Pins(1)), )] - if hasattr(self.cpu, "add_memory_buses"): - self.cpu.add_memory_buses(address_width = 32, data_width = data_width) - - assert len(self.cpu.memory_buses) == 1 - mbus = self.cpu.memory_buses[0] - self.comb +=mbus.connect(axi_bus) - io = platform.add_iface_ios(ios) self.comb += [ io.ar_valid.eq(axi_bus.ar.valid), @@ -719,12 +712,23 @@ class BaseSoC(SoCCore): self.sync += self.cfg_count.eq(self.cfg_count + (self.cfg_count != 0xFF)) self.sync += self.cfg_state.eq(self.cfg_state | (self.cfg_count == 0xFF)) - # Use DRAM's target0 port as Main Ram. - self.bus.add_region("main_ram", SoCRegion( + soc_region = SoCRegion( origin = 0x4000_0000, size = 0x4000_0000, # 1GB. mode ="rwx", - )) + ) + # Use DRAM's target0 port as Main Ram. + if hasattr(self.cpu, "add_memory_buses"): + self.cpu.add_memory_buses(address_width = 32, data_width = data_width) + + assert len(self.cpu.memory_buses) == 1 + mbus = self.cpu.memory_buses[0] + self.comb +=mbus.connect(axi_bus) + self.bus.add_region("main_ram", soc_region) + else: + axi_lite_bus = axi.AXILiteInterface(data_width=data_width, address_width=axi_bus.address_width) + self.submodules += axi.AXILite2AXI(axi_lite_bus, axi_bus) + self.bus.add_slave("main_ram", axi_lite_bus, soc_region) # Build --------------------------------------------------------------------------------------------