]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/iodelay-config.git/blobdiff - iodelay-autogen.py
script: kernel: Fix delay format to avoid build error
[glsdk/iodelay-config.git] / iodelay-autogen.py
index 0c36c71d3a062ff0028608bb02452d4678b9a1ad..3e887de13df0cc1efd0fbf0c3edaae5c17e5159e 100755 (executable)
@@ -22,7 +22,8 @@ parser = argparse.ArgumentParser(prog='iodelay-autogen.py',
                'This script refers to the XML data and automatically generates\n' \
                'PAD and DELAY data for the same use case.\n' \
                'Note that only the PADs which are used in the dump are configured.',
                'This script refers to the XML data and automatically generates\n' \
                'PAD and DELAY data for the same use case.\n' \
                'Note that only the PADs which are used in the dump are configured.',
-       epilog='Generate the pad and delay data using pad regdump')
+       epilog='Generate the pad and delay data using pad register dumps. For this,\n' \
+               'Run omapconf dump 0x4a003400 0x4a00380c and save the output')
 
 parser.add_argument('-d', '--debug', dest='debug',
        action='store', type=int, choices=[0, 1, 2], default=0,
 
 parser.add_argument('-d', '--debug', dest='debug',
        action='store', type=int, choices=[0, 1, 2], default=0,
@@ -335,7 +336,7 @@ def pad_dump_gpio(padconf, per_padconf):
 
                offset = addr - 0x4a002000
                gpio_name = xml_pad_get_pin(offset, 14)
 
                offset = addr - 0x4a002000
                gpio_name = xml_pad_get_pin(offset, 14)
-               matchlist = re.match("GPIO(.)_(.)", gpio_name)
+               matchlist = re.match("GPIO(.)_(.*)", gpio_name)
                if (matchlist == None):
                        print "ERR: No GPIO for pad %s" % pad_name
                        continue
                if (matchlist == None):
                        print "ERR: No GPIO for pad %s" % pad_name
                        continue
@@ -428,7 +429,7 @@ def uboot_format_pad_regs(padconf, per_padconf):
        print "};\n"
 
 def uboot_format_delay_regs(delayconf, per_delayconf):
        print "};\n"
 
 def uboot_format_delay_regs(delayconf, per_delayconf):
-       print "\nconst struct iodelay_cfg_entry dra742_iodelay_cfg_array[] = {"
+       manual_del = []
        for i in delayconf:
                (pad_name, pin_name, regname, del_offset, man_name, adel, gdel) = i
 
        for i in delayconf:
                (pad_name, pin_name, regname, del_offset, man_name, adel, gdel) = i
 
@@ -436,7 +437,13 @@ def uboot_format_delay_regs(delayconf, per_delayconf):
                        print "WARN: Skipping MMC delayconf in uboot"
                        continue
 
                        print "WARN: Skipping MMC delayconf in uboot"
                        continue
 
-               print "\t{ 0x%04X, %5d, %5d },\t/* %s */" % (del_offset, adel, gdel, regname)
+               entry = (del_offset, adel, gdel, regname, pin_name, man_name)
+               manual_del.append(entry)
+
+       es_rev = args.revision.replace('.', '_')
+       print "\nconst struct iodelay_cfg_entry dra742_es" + es_rev + "_iodelay_cfg_array[] = {"
+       for entry in sorted(manual_del):
+               print "\t{ 0x%04X, %5d, %5d },\t/* %s : %s - %s */" % entry
        print "};\n"
 
 # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
        print "};\n"
 
 # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
@@ -497,7 +504,7 @@ def linux_format_delay_regs(delayconf, per_delayconf):
                for i in per_delayconf[per]:
                        (pad_name, pin_name, regname, del_offset, mode, adel, gdel) = i
 
                for i in per_delayconf[per]:
                        (pad_name, pin_name, regname, del_offset, mode, adel, gdel) = i
 
-                       print "\t\t\t0x%03X A_DELAY(%d) | G_DELAY(%d)\t/* %s */" % (del_offset, adel, gdel, regname)
+                       print "\t\t\t0x%03X (A_DELAY(%d) | G_DELAY(%d))\t/* %s */" % (del_offset, adel, gdel, regname)
                print "\t\t>;"
                print "\t};"
        print "};\n"
                print "\t\t>;"
                print "\t};"
        print "};\n"