From: Luke Kenneth Casson Leighton Date: Tue, 24 Jul 2018 11:53:22 +0000 (+0100) Subject: make sd bus connection X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5e585897f358b97e1d2fcdca805daddeaa6d2596;p=pinmux.git make sd bus connection --- diff --git a/src/bsv/peripheral_gen/sdmmc.py b/src/bsv/peripheral_gen/sdmmc.py index 74db274..69f2d76 100644 --- a/src/bsv/peripheral_gen/sdmmc.py +++ b/src/bsv/peripheral_gen/sdmmc.py @@ -15,14 +15,21 @@ class sdmmc(PBase): def _mk_connection(self, name=None, count=0): return "sd{0}.slave" - def pinname_in(self, pname): - return "%s_in" % pname - def pinname_out(self, pname): - if pname.startswith('d'): - return "%s_out" % pname - return pname + if pname in ['cmd', 'clk']: + return pname + return '' + + def mk_pincon(self, name, count): + ret = [PBase.mk_pincon(self, name, count)] + # special-case for gpio in, store in a temporary vector + plen = len(self.peripheral.pinspecs) + template = " mkConnection({0}.{1},\n\t\t\t{2}.{1});" + sname = self.peripheral.iname().format(count) + name = self.get_iname(count) + ps = "pinmux.peripheral_side.%s" % sname + n = "{0}".format(name) + for ptype in ['out', 'out_en', 'in']: + ret.append(template.format(ps, ptype, n)) + return '\n'.join(ret) - def pinname_outen(self, pname): - if pname.startswith('d'): - return "%s_outen" % pname