From c34740c39c4747c0472dec67ae09dffa1336eed1 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Tue, 27 Mar 2018 15:56:41 +0100 Subject: [PATCH] big autopep8 whitespace cleanup, not run before on pinmux spec code --- src/spec/__init__.py | 4 +- src/spec/c_class.py | 67 +++++----- src/spec/gen.py | 7 +- src/spec/ifaceprint.py | 22 ++-- src/spec/interfaces.py | 41 ++++-- src/spec/m_class.py | 283 +++++++++++++++++++++-------------------- 6 files changed, 226 insertions(+), 198 deletions(-) diff --git a/src/spec/__init__.py b/src/spec/__init__.py index 3a0a257..9ec2d15 100644 --- a/src/spec/__init__.py +++ b/src/spec/__init__.py @@ -4,6 +4,4 @@ from gen import specgen modules = {'m_class': m_class, 'c_class': c_class - } - - + } diff --git a/src/spec/c_class.py b/src/spec/c_class.py index 49128e9..e5f913b 100644 --- a/src/spec/c_class.py +++ b/src/spec/c_class.py @@ -8,6 +8,7 @@ from interfaces import pinmerge from ifaceprint import display, display_fns, check_functions from ifaceprint import display_fixed + def pinspec(): pinouts = {} @@ -18,7 +19,7 @@ def pinspec(): 'E': 16, 'F': 48, 'G': 24, - } + } bankspec = {} pkeys = pinbanks.keys() pkeys.sort() @@ -101,43 +102,43 @@ def pinspec(): print fixedpins = { - 'CTRL_SYS': + 'CTRL_SYS': [ - 'TEST', 'BOOT_SEL', - 'NMI#', 'RESET#', - 'CLK24M_IN', 'CLK24M_OUT', - 'CLK32K_IN', 'CLK32K_OUT', - 'PLLTEST', 'PLLREGIO', 'PLLVP25', - 'PLLDV', 'PLLVREG', 'PLLGND', - ], - - 'POWER_CPU': + 'TEST', 'BOOT_SEL', + 'NMI#', 'RESET#', + 'CLK24M_IN', 'CLK24M_OUT', + 'CLK32K_IN', 'CLK32K_OUT', + 'PLLTEST', 'PLLREGIO', 'PLLVP25', + 'PLLDV', 'PLLVREG', 'PLLGND', + ], + + 'POWER_CPU': ['VDD0_CPU', 'VDD1_CPU', 'VDD2_CPU', 'VDD3_CPU', 'VDD4_CPU', 'VDD5_CPU', 'GND0_CPU', 'GND1_CPU', 'GND2_CPU', 'GND3_CPU', 'GND4_CPU', 'GND5_CPU', - ], + ], - 'POWER_DLL': - ['VDD0_DLL', 'VDD1_DLL', 'VDD2_DLL', - 'GND0_DLL', 'GND1_DLL', 'GND2_DLL', - ], + 'POWER_DLL': + ['VDD0_DLL', 'VDD1_DLL', 'VDD2_DLL', + 'GND0_DLL', 'GND1_DLL', 'GND2_DLL', + ], - 'POWER_INT': - ['VDD0_INT', 'VDD1_INT', 'VDD2_INT', 'VDD3_INT', 'VDD4_INT', - 'VDD5_INT', 'VDD6_INT', 'VDD7_INT', 'VDD8_INT', 'VDD9_INT', - 'GND0_INT', 'GND1_INT', 'GND2_INT', 'GND3_INT', 'GND4_INT', - 'GND5_INT', 'GND6_INT', 'GND7_INT', 'GND8_INT', 'GND9_INT', - ], + 'POWER_INT': + ['VDD0_INT', 'VDD1_INT', 'VDD2_INT', 'VDD3_INT', 'VDD4_INT', + 'VDD5_INT', 'VDD6_INT', 'VDD7_INT', 'VDD8_INT', 'VDD9_INT', + 'GND0_INT', 'GND1_INT', 'GND2_INT', 'GND3_INT', 'GND4_INT', + 'GND5_INT', 'GND6_INT', 'GND7_INT', 'GND8_INT', 'GND9_INT', + ], - 'POWER_GPIO': + 'POWER_GPIO': ['VDD_GPIOA', 'VDD_GPIOB', 'VDD_GPIOC', 'VDD_GPIOD', 'VDD_GPIOE', 'VDD_GPIOF', 'VDD_GPIOG', 'GND_GPIOA', 'GND_GPIOB', 'GND_GPIOC', 'GND_GPIOD', 'GND_GPIOE', 'GND_GPIOF', 'GND_GPIOG', - ] + ] - } + } display_fixed(fixedpins, len(pinouts)) @@ -178,8 +179,8 @@ def pinspec(): 'ULPI1': 'ULPI (USB Low Pin-count) 1', 'ULPI2': 'ULPI (USB Low Pin-count) 2', 'ULPI3': 'ULPI (USB Low Pin-count) 3', - } - + } + fns = display_fns(bankspec, pinouts, function_names) print @@ -190,21 +191,21 @@ def pinspec(): # using "BM:Name". Pins are removed in-order as listed from # lists (interfaces, EINTs, PWMs) from available pins. - # Robotics scenario. + # Robotics scenario. - robotics = ['FB', 'RG', 'ULPI0/8', + robotics = ['FB', 'RG', 'ULPI0/8', 'SD0', - 'JTAG0', 'E1:UART0', - 'D1:SPI0', 'E1:TWI0'] + 'JTAG0', 'E1:UART0', + 'D1:SPI0', 'E1:TWI0'] robotics_pwm = [] for i in range(32): robotics_pwm.append('PWM_%d' % i) robotics_eint = ['EINT24', 'EINT25', 'EINT26', 'EINT27', - 'EINT20', 'EINT21', 'EINT22', 'EINT23'] + 'EINT20', 'EINT21', 'EINT22', 'EINT23'] robotics_eint = [] unused_pins = check_functions("Robotics", bankspec, fns, pinouts, - robotics, robotics_eint, robotics_pwm) + robotics, robotics_eint, robotics_pwm) print "# Reference Datasheets" print diff --git a/src/spec/gen.py b/src/spec/gen.py index 7fb4186..3c66f34 100644 --- a/src/spec/gen.py +++ b/src/spec/gen.py @@ -2,6 +2,7 @@ import os import os.path from spec.interfaces import Pinouts + def specgen(pth, pinouts, bankspec, fixedpins): """ generates a specification of pinouts (tsv files) for reading in by pinmux @@ -15,9 +16,9 @@ def specgen(pth, pinouts, bankspec, fixedpins): for k in pinouts.fnspec.keys(): s = pinouts.fnspec[k] f.write("%s\t%d\n" % (k.lower(), len(s))) - s0 = s[s.keys()[0]] # hack, take first + s0 = s[s.keys()[0]] # hack, take first with open(os.path.join(pth, '%s.txt' % k.lower()), 'w') as g: - if len(s0.pingroup) == 1: # only one function, grouped higher up + if len(s0.pingroup) == 1: # only one function, grouped higher for ks in s.keys(): # grouped by interface k = "%s_%s" % (s[ks].fname, s[ks].suffix) k_ = k.lower() @@ -41,7 +42,7 @@ def specgen(pth, pinouts, bankspec, fixedpins): with open(os.path.join(pth, 'pinmap.txt'), 'w') as g: for k in pks: res = [str(k)] - # append pin mux + # append pin mux for midx in range(muxsz): if pinouts[k].has_key(midx): fname = pinouts[k][midx][0] diff --git a/src/spec/ifaceprint.py b/src/spec/ifaceprint.py index 6737eac..d8008c7 100644 --- a/src/spec/ifaceprint.py +++ b/src/spec/ifaceprint.py @@ -2,6 +2,7 @@ from copy import deepcopy + def display(pins): print "| Pin | Mux0 | Mux1 | Mux2 | Mux3 |" print "| --- | ----------- | ----------- | ----------- | ----------- |" @@ -18,6 +19,7 @@ def display(pins): res += " %s %-9s |" % (bank, name) print res + def fnsplit(f): a = '' n = 0 @@ -33,6 +35,7 @@ def fnsplit(f): f = f[1:] return a, int(f) if f else None + def fnsort(f1, f2): a1, n1 = fnsplit(f1) a2, n2 = fnsplit(f2) @@ -40,17 +43,19 @@ def fnsort(f1, f2): if x != 0: return x return cmp(n1, n2) - + + def find_fn(fname, names): for n in names: if fname.startswith(n): return n + def display_fns(bankspec, pins, function_names): fn_names = function_names.keys() fns = {} for (pin, pdata) in pins.items(): - for mux in range(1,4): # skip GPIO for now + for mux in range(1, 4): # skip GPIO for now if not pdata.has_key(mux): continue name, bank = pdata[mux] @@ -80,6 +85,7 @@ def display_fns(bankspec, pins, function_names): return fns + def check_functions(title, bankspec, fns, pins, required, eint, pwm, descriptions=None): fns = deepcopy(fns) @@ -90,7 +96,6 @@ def check_functions(title, bankspec, fns, pins, required, eint, pwm, print "# Pinmap for %s" % title print - for name in required: print "## %s" % name print @@ -115,7 +120,7 @@ def check_functions(title, bankspec, fns, pins, required, eint, pwm, name = name[0] found = set() fnidx = fns.keys() - #fnidx.sort(fnsort) + # fnidx.sort(fnsort) pinfound = {} for fname in fnidx: if not fname.startswith(name): @@ -154,7 +159,7 @@ def check_functions(title, bankspec, fns, pins, required, eint, pwm, continue gpios.append(name) gpios.sort() - + if gpios: print "## GPIO" print @@ -184,11 +189,12 @@ def check_functions(title, bankspec, fns, pins, required, eint, pwm, print if descriptions and descriptions.has_key('GPIO'): print descriptions['GPIO'] - print + print display(pins) print - return pins # unused + return pins # unused + def display_group(bankspec, title, todisplay, fns, pins, descriptions): print "## %s" % title @@ -224,6 +230,7 @@ def display_group(bankspec, title, todisplay, fns, pins, descriptions): print "* %s %d %s%d/%d %s" % (fname, pin_, bank, pin, mux, desc) print + def display_fixed(fixed, offs): fkeys = fixed.keys() @@ -251,4 +258,3 @@ def display_fixed(fixed, offs): if linecount != 0: print print - diff --git a/src/spec/interfaces.py b/src/spec/interfaces.py index b917e8f..0f8e1da 100644 --- a/src/spec/interfaces.py +++ b/src/spec/interfaces.py @@ -1,5 +1,6 @@ #!/usr/bin/env python + class Pinouts(object): def __init__(self): self.pins = {} @@ -39,7 +40,7 @@ class Pinouts(object): class Pins(object): def __init__(self, fname, pingroup, bankspec, suffix, offs, bank, mux, - spec=None, limit=None, origsuffix=None): + spec=None, limit=None, origsuffix=None): # function type can be in, out or inout, represented by - + * # strip function type out of each pin name @@ -66,7 +67,7 @@ class Pins(object): # create consistent name suffixes pingroup = namesuffix(fname, suffix, pingroup) - suffix = '' # hack + suffix = '' # hack res = {} names = {} @@ -107,11 +108,12 @@ class Pins(object): def i2s(bankspec, suffix, offs, bank, mux=1, spec=None, limit=None): i2spins = ['MCK+', 'BCK+', 'LRCK+', 'DI-', 'DO+'] - #for i in range(4): + # for i in range(4): # i2spins.append("DO%d+" % i) return Pins('IIS', i2spins, bankspec, suffix, offs, bank, mux, spec, limit, origsuffix=suffix) + def emmc(bankspec, suffix, offs, bank, mux=1, spec=None): emmcpins = ['CMD+', 'CLK+'] for i in range(8): @@ -119,8 +121,9 @@ def emmc(bankspec, suffix, offs, bank, mux=1, spec=None): return Pins('MMC', emmcpins, bankspec, suffix, offs, bank, mux, spec, origsuffix=suffix) + def sdmmc(bankspec, suffix, offs, bank, mux=1, spec=None, - start=None, limit=None): + start=None, limit=None): sdmmcpins = ['CMD+', 'CLK+'] for i in range(4): sdmmcpins.append("D%d*" % i) @@ -128,31 +131,37 @@ def sdmmc(bankspec, suffix, offs, bank, mux=1, spec=None, return Pins('SD', sdmmcpins, bankspec, suffix, offs, bank, mux, spec, origsuffix=suffix) + def spi(bankspec, suffix, offs, bank, mux=1, spec=None): spipins = ['CLK*', 'NSS*', 'MOSI*', 'MISO*'] return Pins('SPI', spipins, bankspec, suffix, offs, bank, mux, spec, origsuffix=suffix) + def quadspi(bankspec, suffix, offs, bank, mux=1, spec=None, limit=None): spipins = ['CK*', 'NSS*', 'IO0*', 'IO1*', 'IO2*', 'IO3*'] return Pins('QSPI', spipins, bankspec, suffix, offs, bank, mux, spec, limit, origsuffix=suffix) + def i2c(bankspec, suffix, offs, bank, mux=1, spec=None): spipins = ['SDA*', 'SCL*'] return Pins('TWI', spipins, bankspec, suffix, offs, bank, mux, spec, origsuffix=suffix) + def jtag(bankspec, suffix, offs, bank, mux=1, spec=None): jtagpins = ['MS+', 'DI-', 'DO+', 'CK+'] return Pins('JTAG', jtagpins, bankspec, suffix, offs, bank, mux, spec, origsuffix=suffix) + def uart(bankspec, suffix, offs, bank, mux=1, spec=None): uartpins = ['TX+', 'RX-'] return Pins('UART', uartpins, bankspec, suffix, offs, bank, mux, spec, origsuffix=suffix) + def namesuffix(name, suffix, namelist): names = [] for n in namelist: @@ -162,6 +171,7 @@ def namesuffix(name, suffix, namelist): names.append("%s_%s" % (name, suffix)) return names + def ulpi(bankspec, suffix, offs, bank, mux=1, spec=None): ulpipins = ['CK+', 'DIR+', 'STP+', 'NXT+'] for i in range(8): @@ -169,11 +179,13 @@ def ulpi(bankspec, suffix, offs, bank, mux=1, spec=None): return Pins('ULPI', ulpipins, bankspec, suffix, offs, bank, mux, spec, origsuffix=suffix) + def uartfull(bankspec, suffix, offs, bank, mux=1, spec=None): uartpins = ['TX+', 'RX-', 'CTS-', 'RTS+'] return Pins('UARTQ', uartpins, bankspec, suffix, offs, bank, mux, spec, origsuffix=suffix) + def rgbttl(bankspec, suffix, offs, bank, mux=1, spec=None): ttlpins = ['CK+', 'DE+', 'HS+', 'VS+'] for i in range(24): @@ -181,6 +193,7 @@ def rgbttl(bankspec, suffix, offs, bank, mux=1, spec=None): return Pins('LCD', ttlpins, bankspec, suffix, offs, bank, mux, spec, origsuffix=suffix) + def rgmii(bankspec, suffix, offs, bank, mux=1, spec=None): buspins = [] for i in range(4): @@ -194,6 +207,7 @@ def rgmii(bankspec, suffix, offs, bank, mux=1, spec=None): return Pins('RG', buspins, bankspec, suffix, offs, bank, mux, spec, origsuffix=suffix) + def flexbus1(bankspec, suffix, offs, bank, mux=1, spec=None, limit=None): buspins = [] for i in range(8): @@ -205,18 +219,20 @@ def flexbus1(bankspec, suffix, offs, bank, mux=1, spec=None, limit=None): 'TSIZ0', 'TSIZ1'] for i in range(4): buspins.append("BWE%d" % i) - for i in range(2,6): + for i in range(2, 6): buspins.append("CS%d+" % i) return Pins('FB', buspins, bankspec, suffix, offs, bank, mux, spec, limit, origsuffix=suffix) + def flexbus2(bankspec, suffix, offs, bank, mux=1, spec=None, limit=None): buspins = [] - for i in range(8,32): + for i in range(8, 32): buspins.append("AD%d*" % i) return Pins('FB', buspins, bankspec, suffix, offs, bank, mux, spec, limit, origsuffix=suffix) + def sdram1(bankspec, suffix, offs, bank, mux=1, spec=None): buspins = [] for i in range(16): @@ -236,15 +252,17 @@ def sdram1(bankspec, suffix, offs, bank, mux=1, spec=None): return Pins('SDR', buspins, bankspec, suffix, offs, bank, mux, spec, origsuffix=suffix) + def sdram2(bankspec, suffix, offs, bank, mux=1, spec=None, limit=None): buspins = [] - for i in range(3,6): + for i in range(3, 6): buspins.append("SDRCS%d#+" % i) - for i in range(8,32): + for i in range(8, 32): buspins.append("SDRDQ%d*" % i) return Pins('SDR', buspins, bankspec, suffix, offs, bank, mux, spec, limit, origsuffix=suffix) + def mcu8080(bankspec, suffix, offs, bank, mux=1, spec=None): buspins = [] for i in range(8): @@ -260,6 +278,7 @@ def mcu8080(bankspec, suffix, offs, bank, mux=1, spec=None): return Pins('MCU', buspins, bankspec, suffix, offs, bank, mux, spec, origsuffix=suffix) + def _pinbank(bankspec, prefix, suffix, offs, bank, gpiooffs, gpionum=1, mux=1, spec=None): gpiopins = [] @@ -268,6 +287,7 @@ def _pinbank(bankspec, prefix, suffix, offs, bank, gpiooffs, gpionum=1, mux=1, return Pins('GPIO', gpiopins, bankspec, suffix, offs, bank, mux, spec, origsuffix=suffix) + def eint(bankspec, suffix, offs, bank, gpiooffs, gpionum=1, mux=1, spec=None): gpiopins = [] for i in range(gpiooffs, gpiooffs+gpionum): @@ -275,14 +295,17 @@ def eint(bankspec, suffix, offs, bank, gpiooffs, gpionum=1, mux=1, spec=None): return Pins('EINT', gpiopins, bankspec, suffix, offs, bank, mux, spec, origsuffix=suffix) + def pwm(bankspec, suffix, offs, bank, mux=1, spec=None): return Pins('PWM', ['+', ], bankspec, suffix, offs, bank, mux, spec, origsuffix=suffix) + def gpio(bankspec, suffix, offs, bank, gpiooffs, gpionum=1, mux=1, spec=None): return _pinbank(bankspec, "GPIO", suffix, offs, bank, gpiooffs, gpionum, mux=0, spec=None) + def pinmerge(pins, fn): # hack, store the function specs in the pins dict fname = fn.fname @@ -303,9 +326,7 @@ def pinmerge(pins, fn): specname = fname + bank pins.fnspec[fname][specname] = fn - # merge actual pins for (pinidx, v) in fn.pins.items(): print "pinidx", pinidx pins.update(pinidx, v) - diff --git a/src/spec/m_class.py b/src/spec/m_class.py index 768177b..a9c09a8 100644 --- a/src/spec/m_class.py +++ b/src/spec/m_class.py @@ -9,6 +9,7 @@ from interfaces import pinmerge, Pinouts from ifaceprint import display, display_fns, check_functions from ifaceprint import display_fixed + def pinspec(): pinouts = Pinouts() @@ -19,7 +20,7 @@ def pinspec(): 'E': 24, 'F': 10, 'G': 32, - } + } bankspec = {} pkeys = pinbanks.keys() pkeys.sort() @@ -154,7 +155,7 @@ def pinspec(): print fixedpins = { - 'DDR3': + 'DDR3': ['SDQ0', 'SDQ1', 'SDQ2', 'SDQ3', 'SDQ4', 'SDQ5', 'SDQ6', 'SDQ7', 'SDQ8', 'SDQ9', 'SDQ10', 'SDQ11', 'SDQ12', 'SDQ13', 'SDQ14', 'SDQ15', 'SDQ16', 'SDQ17', 'SDQ18', 'SDQ19', 'SDQ20', 'SDQ21', 'SDQ22', 'SDQ23', @@ -172,51 +173,51 @@ def pinspec(): 'SZQ', 'SRST', 'SDBG0', 'SDBG1', 'ADBG', 'ODT0', 'ODT1' - ], + ], - 'CTRL_SYS': + 'CTRL_SYS': [ - 'TEST', 'JTAG_SEL', 'UBOOT_SEL', - 'NMI#', 'RESET#', - 'CLK24M_IN', 'CLK24M_OUT', - 'PLLTEST', 'PLLREGIO', 'PLLVP25', - 'PLLDV', 'PLLVREG', 'PLLGND', - ], - - 'POWER_DRAM': - ['VCC0_DRAM', 'VCC1_DRAM', 'VCC2_DRAM', 'VCC3_DRAM', 'VCC4_DRAM', - 'VCC5_DRAM', 'VCC6_DRAM', 'VCC7_DRAM', 'VCC8_DRAM', 'VCC9_DRAM', - 'GND0_DRAM', 'GND1_DRAM', 'GND2_DRAM', 'GND3_DRAM', 'GND4_DRAM', - 'GND5_DRAM', 'GND6_DRAM', 'GND7_DRAM', 'GND8_DRAM', 'GND9_DRAM', + 'TEST', 'JTAG_SEL', 'UBOOT_SEL', + 'NMI#', 'RESET#', + 'CLK24M_IN', 'CLK24M_OUT', + 'PLLTEST', 'PLLREGIO', 'PLLVP25', + 'PLLDV', 'PLLVREG', 'PLLGND', ], - 'POWER_CPU': + 'POWER_DRAM': + ['VCC0_DRAM', 'VCC1_DRAM', 'VCC2_DRAM', 'VCC3_DRAM', 'VCC4_DRAM', + 'VCC5_DRAM', 'VCC6_DRAM', 'VCC7_DRAM', 'VCC8_DRAM', 'VCC9_DRAM', + 'GND0_DRAM', 'GND1_DRAM', 'GND2_DRAM', 'GND3_DRAM', 'GND4_DRAM', + 'GND5_DRAM', 'GND6_DRAM', 'GND7_DRAM', 'GND8_DRAM', 'GND9_DRAM', + ], + + 'POWER_CPU': ['VDD0_CPU', 'VDD1_CPU', 'VDD2_CPU', 'VDD3_CPU', 'VDD4_CPU', 'VDD5_CPU', 'GND0_CPU', 'GND1_CPU', 'GND2_CPU', 'GND3_CPU', 'GND4_CPU', 'GND5_CPU', - ], + ], - 'POWER_DLL': - ['VDD0_DLL', 'VDD1_DLL', 'VDD2_DLL', - 'GND0_DLL', 'GND1_DLL', 'GND2_DLL', - ], + 'POWER_DLL': + ['VDD0_DLL', 'VDD1_DLL', 'VDD2_DLL', + 'GND0_DLL', 'GND1_DLL', 'GND2_DLL', + ], - 'POWER_INT': - ['VDD0_INT', 'VDD1_INT', 'VDD2_INT', 'VDD3_INT', 'VDD4_INT', - 'VDD5_INT', 'VDD6_INT', 'VDD7_INT', 'VDD8_INT', 'VDD9_INT', - 'GND0_INT', 'GND1_INT', 'GND2_INT', 'GND3_INT', 'GND4_INT', - 'GND5_INT', 'GND6_INT', 'GND7_INT', 'GND8_INT', 'GND9_INT', - ], + 'POWER_INT': + ['VDD0_INT', 'VDD1_INT', 'VDD2_INT', 'VDD3_INT', 'VDD4_INT', + 'VDD5_INT', 'VDD6_INT', 'VDD7_INT', 'VDD8_INT', 'VDD9_INT', + 'GND0_INT', 'GND1_INT', 'GND2_INT', 'GND3_INT', 'GND4_INT', + 'GND5_INT', 'GND6_INT', 'GND7_INT', 'GND8_INT', 'GND9_INT', + ], - 'POWER_GPIO': + 'POWER_GPIO': ['VDD_GPIOA', 'VDD_GPIOB', 'VDD_GPIOC', 'VDD_GPIOD', 'VDD_GPIOE', 'VDD_GPIOF', 'VDD_GPIOG', 'GND_GPIOA', 'GND_GPIOB', 'GND_GPIOC', - 'GND_GPIOD', 'GND_GPIOE', 'GND_GPIOF', + 'GND_GPIOD', 'GND_GPIOE', 'GND_GPIOF', 'GND_GPIOG', - ] + ] - } + } display_fixed(fixedpins, len(pinouts)) @@ -251,8 +252,8 @@ def pinspec(): 'ULPI1': 'ULPI (USB Low Pin-count) 1', 'ULPI2': 'ULPI (USB Low Pin-count) 2', 'ULPI3': 'ULPI (USB Low Pin-count) 3', - } - + } + fns = display_fns(bankspec, pinouts, function_names) print @@ -269,26 +270,26 @@ def pinspec(): # of spare GPIO. eoma68 = ['B1:LCD/22', 'ULPI1/8', 'ULPI2', 'MMC', 'SD1', 'UART3', - 'TWI3', 'SPI2', 'E2:SD2',] + 'TWI3', 'SPI2', 'E2:SD2', ] eoma68_eint = ['EINT_16', 'EINT_17', 'EINT_18', 'EINT_19'] eoma68_pwm = ['D1:PWM_2'] descriptions = { - 'MMC': 'internal (on Card)', - 'SD1': 'user-facing: internal (on Card), multiplexed with JTAG1\n' - 'and UART2, for debug purposes', - 'TWI3': 'EOMA68-compliance: must be entirely free of devices.\n' - 'Address 0x51 used (externally) for EOMA68 EEPROM Id', - 'E2:SD2': 'EOMA68-compliance', - 'SPI2': 'EOMA68-compliance', - 'UART3': 'EOMA68-compliance', - 'B1:LCD/22': 'EOMA68-compliance, 18-bit RGB/TTL LCD', - 'ULPI1/8': 'user-facing: internal (on Card), USB-OTG ULPI PHY', - 'ULPI2': 'EOMA68-compliance: dual USB2 Host ULPI PHY' + 'MMC': 'internal (on Card)', + 'SD1': 'user-facing: internal (on Card), multiplexed with JTAG1\n' + 'and UART2, for debug purposes', + 'TWI3': 'EOMA68-compliance: must be entirely free of devices.\n' + 'Address 0x51 used (externally) for EOMA68 EEPROM Id', + 'E2:SD2': 'EOMA68-compliance', + 'SPI2': 'EOMA68-compliance', + 'UART3': 'EOMA68-compliance', + 'B1:LCD/22': 'EOMA68-compliance, 18-bit RGB/TTL LCD', + 'ULPI1/8': 'user-facing: internal (on Card), USB-OTG ULPI PHY', + 'ULPI2': 'EOMA68-compliance: dual USB2 Host ULPI PHY' } unused_pins = check_functions("EOMA68", bankspec, fns, pinouts, - eoma68, eoma68_eint, eoma68_pwm, - descriptions) + eoma68, eoma68_eint, eoma68_pwm, + descriptions) # Industrial scenario. not totally complete (some GPIO needed for PMIC) # One interface to be connected to the MCU to give RTC, boot/dbg, @@ -300,15 +301,15 @@ def pinspec(): # QSPI could be used in 1-bit (MOSI/MISO) mode (freeing up 2 more). industrial = ['D1:FB/17', 'E1:FB/8', 'B1:LCD/22', 'ULPI1/8', 'ULPI2/8', - 'MMC', 'B2:SD1', - 'JTAG1', 'A3:UART2', 'E2:UART1', 'C3:UART0', - 'F2:TWI1', 'D2:TWI2', 'D2:TWI3', 'SPI2', 'QSPI', 'F2:SD3'] + 'MMC', 'B2:SD1', + 'JTAG1', 'A3:UART2', 'E2:UART1', 'C3:UART0', + 'F2:TWI1', 'D2:TWI2', 'D2:TWI3', 'SPI2', 'QSPI', 'F2:SD3'] industrial_pwm = ['F2:PWM_0', 'F2:PWM_1', 'D1:PWM_2'] industrial_eint = ['EINT_24', 'EINT_25', 'EINT_26', 'EINT_27', 'EINT_20', 'EINT_21', 'EINT_22', 'EINT_23'] unused_pins = check_functions("Industrial", bankspec, fns, pinouts, - industrial, industrial_eint, industrial_pwm) + industrial, industrial_eint, industrial_pwm) # Industrial scenario, using an SPI-based LCD instead of RGB/TTL # not totally complete (some GPIO needed for PMIC) @@ -319,58 +320,58 @@ def pinspec(): # also possibility of freeing up FlexBus CS# with a little reorg. industrial = ['D1:FB/17', 'E1:FB/8', 'B2:SPI1', 'ULPI1/8', 'ULPI2/8', - 'MMC', 'B2:SD1', - 'JTAG1', - 'A3:UART2', 'E2:UART1', 'C3:UART0', 'B2:UART4', 'B2:UART3', - 'F2:TWI1', 'D2:TWI2', 'D2:TWI3', 'SPI2', 'QSPI', 'F2:SD3'] + 'MMC', 'B2:SD1', + 'JTAG1', + 'A3:UART2', 'E2:UART1', 'C3:UART0', 'B2:UART4', 'B2:UART3', + 'F2:TWI1', 'D2:TWI2', 'D2:TWI3', 'SPI2', 'QSPI', 'F2:SD3'] industrial_pwm = ['F2:PWM_0', 'F2:PWM_1', 'D1:PWM_2'] industrial_eint = ['EINT_24', 'EINT_25', 'EINT_26', 'EINT_27', 'EINT_20', 'EINT_21', 'EINT_22', 'EINT_23'] ind_descriptions = { - 'B2:SPI1': 'Used for 320x240 or 640x480 etc. SPI-based LCD.\n' - 'Frees up large numbers of GPIO from RGB/TTL bank' + 'B2:SPI1': 'Used for 320x240 or 640x480 etc. SPI-based LCD.\n' + 'Frees up large numbers of GPIO from RGB/TTL bank' } unused_pins = check_functions("Industrial with SPI-LCD", - bankspec, fns, pinouts, - industrial, industrial_eint, industrial_pwm, - ind_descriptions) + bankspec, fns, pinouts, + industrial, industrial_eint, industrial_pwm, + ind_descriptions) # Smartphone / Tablet - basically the same thing tablet = ['B1:LCD/22', 'ULPI1/8', 'ULPI2/8', - 'MMC', 'SD1', - 'F1:IIS', # I2C Audio - 'TWI2', # I2C Audio - 'E2:UART1', # WIFI/BT - 'E2:SD2', # WIFI - 'C3:UART0', # GPS - 'D2:UART3', - 'D2:UART4', + 'MMC', 'SD1', + 'F1:IIS', # I2C Audio + 'TWI2', # I2C Audio + 'E2:UART1', # WIFI/BT + 'E2:SD2', # WIFI + 'C3:UART0', # GPS + 'D2:UART3', + 'D2:UART4', 'D3:TWI1', 'D2:TWI3', 'SPI2', 'QSPI'] - tablet_pwm = ['F2:PWM_0', # LCD_BACKLIGHT + tablet_pwm = ['F2:PWM_0', # LCD_BACKLIGHT 'F2:PWM_1', 'D1:PWM_2'] - tablet_eint = ['EINT_24', # BT_HOST_WAKE - 'EINT_25', # WIFI_HOST_WAKE - 'EINT_26', # CTP_INT - 'EINT_27', # GSENSOR_INT - 'EINT_8', # GPS_INT - 'EINT_7', # TILT_SENSOR_INT - 'EINT_22', # COMPASS_INT - 'EINT_23', # MCU_INT - 'EINT_16', # PMIC_INT - 'EINT_17', # PWR_BUTTON_INT - 'EINT_30', # OTG_ID - 'EINT_31', - ] + tablet_eint = ['EINT_24', # BT_HOST_WAKE + 'EINT_25', # WIFI_HOST_WAKE + 'EINT_26', # CTP_INT + 'EINT_27', # GSENSOR_INT + 'EINT_8', # GPS_INT + 'EINT_7', # TILT_SENSOR_INT + 'EINT_22', # COMPASS_INT + 'EINT_23', # MCU_INT + 'EINT_16', # PMIC_INT + 'EINT_17', # PWR_BUTTON_INT + 'EINT_30', # OTG_ID + 'EINT_31', + ] descriptions = { 'B1:LCD/22': - 'RGB/TTL LCD, 800x480 or use SN75LVDS83b for up to 1440x900', + 'RGB/TTL LCD, 800x480 or use SN75LVDS83b for up to 1440x900', 'MMC': 'eMMC: main internal storage', 'ULPI1/8': 'USB-OTG, connect to ULPI OTG PHY (for charging)\n' 'as well as USB Host or USB Device', 'ULPI2/8': 'USB2 Host, connect to ULPI PHY w/and 4-port USB2 Hub\n' - 'for example GL850G or FE1.1. ' - 'Connects to 2/3/4G/LTE Modem, 2x USB-Camera (VC0345)', + 'for example GL850G or FE1.1. ' + 'Connects to 2/3/4G/LTE Modem, 2x USB-Camera (VC0345)', 'SD1': 'internal, multiplexed with JTAG1\n' 'and UART2, for debug purposes', 'F1:IIS': 'I2C Audio, connect to AC97 Audio IC', @@ -412,35 +413,35 @@ def pinspec(): 'EINT_31': 'Spare?', } unused_pins = check_functions("Smartphone / Tablet", - bankspec, fns, pinouts, - tablet, tablet_eint, tablet_pwm, - descriptions) + bankspec, fns, pinouts, + tablet, tablet_eint, tablet_pwm, + descriptions) # Laptop laptop = ['D1:FB/17', 'E1:FB/8', 'B1:LCD/22', 'ULPI1/8', 'ULPI2/8', - 'MMC', 'SD1', - 'F1:IIS', # I2C Audio - 'TWI2', # I2C Audio - 'E2:UART1', # WIFI/BT - 'E2:SD3', # WIFI + 'MMC', 'SD1', + 'F1:IIS', # I2C Audio + 'TWI2', # I2C Audio + 'E2:UART1', # WIFI/BT + 'E2:SD3', # WIFI 'D2:TWI3', 'QSPI'] - laptop_pwm = ['F2:PWM_0', # LCD_BACKLIGHT - ] - laptop_eint = ['EINT_20', # BT_HOST_WAKE - 'EINT_21', # WIFI_HOST_WAKE - 'EINT_9', # MCU_INT - 'EINT_31', # PMIC_INT - ] + laptop_pwm = ['F2:PWM_0', # LCD_BACKLIGHT + ] + laptop_eint = ['EINT_20', # BT_HOST_WAKE + 'EINT_21', # WIFI_HOST_WAKE + 'EINT_9', # MCU_INT + 'EINT_31', # PMIC_INT + ] descriptions = { 'D1:FB/17': 'FlexBus. Connect to DM9000 or AX99896A MCU-style Bus\n' '10/100 Ethernet PHY.', 'E1:FB/8': 'FlexBus bus bits 8-15, needed to make a 16-bit bus width', 'B1:LCD/22': - 'RGB/TTL LCD, use SN75LVDS83b for LVDS or SSD2828 for MIPI,\n' - 'or a Chrontel CH7039, CH7038, CH7034 or CH7018 for dual\n' - 'display output (eDP/LVDS and HDMI/VGA) ' - 'conversion.', + 'RGB/TTL LCD, use SN75LVDS83b for LVDS or SSD2828 for MIPI,\n' + 'or a Chrontel CH7039, CH7038, CH7034 or CH7018 for dual\n' + 'display output (eDP/LVDS and HDMI/VGA) ' + 'conversion.', 'MMC': 'eMMC: main internal storage', 'ULPI1/8': 'USB-OTG, connect to ULPI OTG PHY (for charging)\n' 'as well as USB Host or USB Device', @@ -468,46 +469,46 @@ def pinspec(): 'EINT_31': 'PMIC_INT', } unused_pins = check_functions("Laptop / Netbook", - bankspec, fns, pinouts, - laptop, laptop_eint, laptop_pwm, - descriptions) + bankspec, fns, pinouts, + laptop, laptop_eint, laptop_pwm, + descriptions) # IoT iot = ['B1:LCD', 'ULPI2/8', 'ULPI1/8', - 'MMC', 'SD1', - 'F1:IIS', # I2C Audio - #'TWI2', # I2C Audio - 'C3:UART0', # HSPA UART - 'E2:UART1', # BT UART - 'C2:SPI2', # HSPI SPI - 'E2:SD3', # WIFI - 'D3:TWI1', # sensors CTP, - 'D2:TWI3', 'QSPI'] - iot_pwm = ['F2:PWM_0', # LCD_BACKLIGHT - ] - iot_eint = [ 'EINT_5', # 'HSPA_MST_RDY', - 'EINT_6', # 'HSPA_SL_RDY', - 'EINT_7', # 'HSPA_RING', - 'EINT_8', # 'WL_PMU_EN', - 'EINT_9', # HSPA_GPIO1 - 'EINT_10', # IR_DT - 'EINT_11', # 'BT_PCM_CLK', - 'EINT_12', # 'BT_PCM_DIN', - 'EINT_13', # 'BT_PCM_SYNC', - 'EINT_14', # 'BT_PCM_DOUT', - 'EINT_16', # 'USB_DRVVBUS', - 'EINT_17', # 'USB_VBUSDET', - 'EINT_21', # 'USB_ID', - 'EINT_30', # 'CTP_INT', - 'EINT_31', # 'SD_DET#', + 'MMC', 'SD1', + 'F1:IIS', # I2C Audio + #'TWI2', # I2C Audio + 'C3:UART0', # HSPA UART + 'E2:UART1', # BT UART + 'C2:SPI2', # HSPI SPI + 'E2:SD3', # WIFI + 'D3:TWI1', # sensors CTP, + 'D2:TWI3', 'QSPI'] + iot_pwm = ['F2:PWM_0', # LCD_BACKLIGHT + ] + iot_eint = ['EINT_5', # 'HSPA_MST_RDY', + 'EINT_6', # 'HSPA_SL_RDY', + 'EINT_7', # 'HSPA_RING', + 'EINT_8', # 'WL_PMU_EN', + 'EINT_9', # HSPA_GPIO1 + 'EINT_10', # IR_DT + 'EINT_11', # 'BT_PCM_CLK', + 'EINT_12', # 'BT_PCM_DIN', + 'EINT_13', # 'BT_PCM_SYNC', + 'EINT_14', # 'BT_PCM_DOUT', + 'EINT_16', # 'USB_DRVVBUS', + 'EINT_17', # 'USB_VBUSDET', + 'EINT_21', # 'USB_ID', + 'EINT_30', # 'CTP_INT', + 'EINT_31', # 'SD_DET#', ] descriptions = { 'B1:LCD': - 'RGB/TTL LCD, use SN75LVDS83b for LVDS or SSD2828 for MIPI,\n' - 'or a Chrontel CH7039, CH7038, CH7034 or CH7018 for dual\n' - 'display output (eDP/LVDS and HDMI/VGA) ' - 'conversion.', + 'RGB/TTL LCD, use SN75LVDS83b for LVDS or SSD2828 for MIPI,\n' + 'or a Chrontel CH7039, CH7038, CH7034 or CH7018 for dual\n' + 'display output (eDP/LVDS and HDMI/VGA) ' + 'conversion.', 'MMC': 'eMMC: main internal storage', 'F1:IIS': 'I2C Audio, connect to AC97 Audio IC', 'ULPI2/8': 'USB-OTG, connect to ULPI OTG PHY (for charging)\n' @@ -561,9 +562,9 @@ def pinspec(): 'EINT_31': 'SD_DETN', } unused_pins = check_functions("IoT", - bankspec, fns, pinouts, - iot, iot_eint, iot_pwm, - descriptions) + bankspec, fns, pinouts, + iot, iot_eint, iot_pwm, + descriptions) print "# Reference Datasheets" print -- 2.30.2