soc: Don't update CSR alignment when there is no CPU
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 12 May 2020 11:31:23 +0000 (21:31 +1000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 12 May 2020 11:31:23 +0000 (21:31 +1000)
The alignment specified by the standalone core config should
be honored.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
litex/soc/integration/soc.py

index 55bedb6295189acc8e01d68adc3174b7af9e1184..651f450d71697a5c7e91a5d4a7eef4e57cd10991 100644 (file)
@@ -781,7 +781,13 @@ class SoC(Module):
         for n, (origin, size) in enumerate(self.cpu.io_regions.items()):
             self.bus.add_region("io{}".format(n), SoCIORegion(origin=origin, size=size, cached=False))
         self.mem_map.update(self.cpu.mem_map) # FIXME
-        self.csr.update_alignment(self.cpu.data_width)
+
+        # We don't want the CSR alignemnt reduced from 64-bit to 32-bit on
+        # a standalone system with a 64-bit WB and no CPU.
+        # Should we instead only update alignment if the CPU is *bigger*
+        # than the CSR ?
+        if name != "None":
+            self.csr.update_alignment(self.cpu.data_width)
         # Add Bus Masters/CSR/IRQs
         if not isinstance(self.cpu, cpu.CPUNone):
             if reset_address is None: