add memory map configs
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 2 Aug 2018 08:52:15 +0000 (09:52 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 2 Aug 2018 08:52:15 +0000 (09:52 +0100)
src/ifacebase.py
src/spec/i_class.py

index e4a80ec7ee8f79de7a6ce25da123ffb88e56ebaf..86d7030b1490350229ca5a7dd3fad967a419bcaf 100644 (file)
@@ -69,6 +69,7 @@ class InterfacesBase(UserDict):
                 ln = ln.split("\t")
                 name = ln[0]  # will have uart
                 count = int(ln[1])  # will have count of uart
+
                 # spec looks like this:
                 """
                 [{'name': 'sda', 'outen': True},
@@ -91,7 +92,21 @@ class InterfacesBase(UserDict):
                 else:
                     iface = ikls(name, spec, ganged, count == 1)
                     self.ifaceadd(name, count, iface)
+                cfgs = self.getconfigs(name, count)
+                iface.configs = cfgs
+                print name, count, cfgs
+        exit(0)
 
+    def getconfigs(self, fname, count):
+        cfgs = []
+        for i in range(count):
+            if count == 1:
+                name = fname
+            else:
+                name = "%s%d" % (fname, i)
+            cfgs.append(self.configs.get(name, {}))
+        return cfgs
+            
     def getifacetype(self, fname):
         # finds the interface type, e.g sd_d0 returns "inout"
         for iface in self.values():
index cee50e1e31e86b8dde228ef18b2f47ff54d9d9ad..e33c1fa86eafbf3e49466bf82a421ca1809402c3 100644 (file)
@@ -61,10 +61,15 @@ def pinspec():
                       }
 
     ps = PinSpec(pinbanks, fixedpins, function_names,
-                 {'lcd': {'bus': 'fastbus'},
+                 {'lcd': {'bus': 'fastbus',
+                          'mmap': [['Cfg', 0x20000, 10]
+                                  ]},
                   'jtag': {'bus': 'fastbus'},
                   'fb': {'bus': 'fastbus'},
-                  'sdr': {'bus': 'fastbus'}
+                  'sdr': {'bus': 'fastbus',
+                          'mmap': [['Mem', 0x50000000, 0x400000],
+                                   ['Cfg', 0x21000, 12]
+                                  ]},
                  })
 
     # Bank A, 0-27