]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/iodelay-config.git/blobdiff - iodelay-autogen.py
script: Correct MMC related warnings in u-boot and kernel
[glsdk/iodelay-config.git] / iodelay-autogen.py
index f1a79ebd9af96d80b573d4ac5f53970f7d75ebbf..21bec3a993b386739d1da39e56fe3b36ba24b52b 100755 (executable)
@@ -47,7 +47,7 @@ parser.add_argument('-p', '--part', dest='part',
 
 parser.add_argument('-m', '--module', dest='module',
        action='store', type=str, default="",
-       help='generate only for this module')
+       help='generate only for modules matching the provided RE')
 
 parser.add_argument('-s', '--strict', dest='strict',
        action='store_true',
@@ -64,6 +64,10 @@ parser.add_argument('-c', '--check', dest='check_xml',
        help='check consistency of the XML files and other data')
 
 args = parser.parse_args()
+
+# Some more knobs for developers, Don't want to expose them to cmd line
+args.resetslew = True
+
 # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
 
 VERSION = "2.4"
@@ -71,11 +75,11 @@ VERSION = "2.4"
 if (args.part == "dra74x" or args.part == "dra75x"):
        XML_PATH = "XMLFiles/DRA75x_DRA74x"
        PART = "DRA75x_DRA74x"
-       PCT_VERSION = "v1.0.9"
+       PCT_VERSION = "v1.0.10"
 elif (args.part == "dra72x"):
        XML_PATH = "XMLFiles/DRA72x"
        PART = "DRA72x"
-       PCT_VERSION = "v1.0.5"
+       PCT_VERSION = "v1.0.6"
 
 pad_data_xml   = XML_PATH + "/CTRL_MODULE_CORE.xml"
 iod_data_xml   = XML_PATH + "/IODELAYCONFIG.xml"
@@ -153,6 +157,17 @@ def xml_pad_get_name(offset):
        else:
                return padlist[0].get("id")
 
+def xml_pad_get_slew(offset):
+       padlist = pad_xml.findall("register[@offset='0x%X']" % offset)
+       if (len(padlist) == 0):
+               return 0x0
+       else:
+               bitlist = padlist[0].findall("bitfield[@begin='19']")
+               if (len(bitlist) == 0):
+                       return 0x0
+               else:
+                       return int(bitlist[0].get("resetval"), 16)
+
 def xml_pad_get_pin(offset, muxmode):
        padlist = pad_xml.findall("register[@offset='0x%X']" % offset)
        if (len(padlist) == 0):
@@ -431,9 +446,6 @@ def uboot_format_pad_regs(padconf, per_padconf):
        for i in padconf:
                (pad_name, pin_name, addr, val, mode, delayinfo) = i
 
-               if (re.match("MMC.*", pin_name) != None):
-                       print "WARN: Skipping MMC padconf in uboot"
-
                muxmode = val & 0xf
                (method, data) = delayinfo
                if (method == "LEGACY"):
@@ -458,10 +470,6 @@ def uboot_format_delay_regs(delayconf, per_delayconf):
        for i in delayconf:
                (pad_name, pin_name, regname, del_offset, man_name, adel, gdel) = i
 
-               if (re.match("MMC.*", pin_name) != None):
-                       print "WARN: Skipping MMC delayconf in uboot"
-                       continue
-
                entry = (del_offset, adel, gdel, regname, pin_name, man_name)
                manual_del.append(entry)
 
@@ -479,8 +487,7 @@ def linux_format_pad_regs(padconf, per_padconf):
        for per in per_padconf:
 
                if (re.match("MMC.*", per) == None):
-                       print "ERR: Only MMC padconf is recommended in kernel"
-                       continue
+                       print "WARN: Only MMC padconf is recommended in kernel"
 
                # Get the mode from the first entry
                (pad_name, pin_name, addr, val, mode, delayinfo) = per_padconf[per][0]
@@ -520,8 +527,7 @@ def linux_format_delay_regs(delayconf, per_delayconf):
        for per in per_delayconf.keys():
 
                if (re.match("MMC.*", per) == None):
-                       print "ERR: Only MMC delayconf is recommended in kernel"
-                       continue
+                       print "WARN: Only MMC delayconf is recommended in kernel"
 
                # Get the mode from the first entry
                (pad_name, pin_name, regname, del_offset, mode, adel, gdel) = per_delayconf[per][0]
@@ -647,9 +653,14 @@ for i in range(0, 260):
        # Find out if the delaymode for this module is already selected
        module = re.match("([^_]+)_.*", pin_name).groups(0)[0]
 
-       if (args.module != "" and args.module != module):
+       if (args.module != "" and re.match("%s" % args.module, module) == None):
                continue
 
+       # It is recommended to keep the reset value of the slewcontrol bit
+       # Find out the reset value from XML and update if required
+       if (args.resetslew):
+               val |= (xml_pad_get_slew(offset) & 0x1) << 19
+
        if (args.debug >= 1):
                print "\nPAD: %s: Addr= 0x%08X Value = 0x%08X \"%s\"" \
                % (pad_name, addr, val, pin_name)