3 from spec
.interfaces
import Pinouts
5 from spec
.ifaceprint
import display
, display_fns
, check_functions
6 from spec
.ifaceprint
import display_fixed
14 pkeys
= sorted(pinbanks
.keys())
20 pinouts
= Pinouts(bankspec
)
23 pinouts
.gpio("", ('B', 0), "B", 0, 28, 0)
24 pinouts
.rgbttl("0", ('B', 0), "B", 1)
25 pinouts
.spi("1", ('B', 12), "B", 2)
26 pinouts
.quadspi("", ('B', 4), "B", 2)
27 pinouts
.uart("3", ('B', 16), "B", 2)
28 pinouts
.i2c("3", ('B', 18), "B", 2)
29 #pinouts.pwm("", ('B', 9), "B", 0, 1, mux=2)
30 pinouts
.pwm("", ('B', 20), "B", 1, 2, mux
=2)
31 pinouts
.sdmmc("1", ('B', 22), "B", 2)
32 pinouts
.eint("", ('B', 0), "B", 0, 4, mux
=3)
33 pinouts
.flexbus2("", ('B', 4), "B", 3)
34 pinouts
.i2c("1", ('B', 0), "B", 2)
35 pinouts
.uart("2", ('B', 2), "B", 2)
36 pinouts
.uart("4", ('B', 10), "B", 2)
39 print ("""# Pinouts (PinMux)
40 auto-generated by [[pinouts.py]]
46 print ("\n# Pinouts (Fixed function)\n")
69 fixedpins
= display_fixed(fixedpins
, len(pinouts
))
71 print ("""# Functions (PinMux)
73 auto-generated by [[pinouts.py]]
76 function_names
= {'EINT': 'External Interrupt',
77 'FB': 'MC68k FlexBus',
79 'JTAG1': 'JTAG (same as JTAG2, JTAG_SEL=LOW)',
80 'JTAG2': 'JTAG (same as JTAG1, JTAG_SEL=HIGH)',
81 'LCD': '24-pin RGB/TTL LCD',
82 'RG': 'RGMII Ethernet',
83 'MMC': 'eMMC 1/2/4/8 pin',
84 'PWM': 'PWM (pulse-width modulation)',
88 'SPI1': 'SPI (Serial Peripheral Interface) 1',
89 'SPI2': 'SPI (Serial Peripheral Interface) 2',
90 'QSPI': 'Quad SPI (Serial Peripheral Interface) 1',
94 'UARTQ0': 'UART (TX/RX/CTS/RTS) 0',
95 'UARTQ1': 'UART (TX/RX/CTS/RTS) 1',
96 'UART2': 'UART (TX/RX) 2',
97 'UART3': 'UART (TX/RX) 3',
98 'UART4': 'UART (TX/RX) 4',
99 'ULPI1': 'ULPI (USB Low Pin-count) 1',
100 'ULPI2': 'ULPI (USB Low Pin-count) 2',
101 'ULPI3': 'ULPI (USB Low Pin-count) 3',
104 fns
= display_fns(bankspec
, pinouts
, function_names
)
107 # Scenarios below can be spec'd out as either "find first interface"
108 # by name/number e.g. SPI1, or as "find in bank/mux" which must be
109 # spec'd as "BM:Name" where B is bank (A-F), M is Mux (0-3)
110 # EINT and PWM are grouped together, specially, but may still be spec'd
111 # using "BM:Name". Pins are removed in-order as listed from
112 # lists (interfaces, EINTs, PWMs) from available pins.
114 # EOMA68 scenario. not totally complete (some GPIO needed for PMIC)
115 # One interface to be connected to the MCU to give RTC and boot/dbg
116 # VBUS_EN, OTG_ID etc. are all not included below, there is plenty
119 eoma68
= ['B1:LCD/22', 'ULPI1/8', 'ULPI2', 'MMC', 'SD1', 'UART3',
120 'TWI3', 'SPI2', 'E2:SD2', ]
121 eoma68_eint
= ['EINT_0', 'EINT_1', 'EINT_2', 'EINT_3']
122 eoma68_pwm
= ['D1:PWM_2']
124 'MMC': 'internal (on Card)',
125 'SD1': 'user-facing: internal (on Card), multiplexed with JTAG1\n'
126 'and UART2, for debug purposes',
127 'TWI3': 'EOMA68-compliance: must be entirely free of devices.\n'
128 'Address 0x51 used (externally) for EOMA68 EEPROM Id',
129 'E2:SD2': 'EOMA68-compliance',
130 'SPI2': 'EOMA68-compliance',
131 'UART3': 'EOMA68-compliance',
132 'B1:LCD/22': 'EOMA68-compliance, 18-bit RGB/TTL LCD',
133 'ULPI1/8': 'user-facing: internal (on Card), USB-OTG ULPI PHY',
134 'ULPI2': 'EOMA68-compliance: dual USB2 Host ULPI PHY'
137 unused_pins
= check_functions("EOMA68", bankspec
, fns
, pinouts
,
138 eoma68
, eoma68_eint
, eoma68_pwm
,
142 print ("""# Reference Datasheets
144 datasheets and pinout links
145 * <http://datasheets.chipdb.org/AMD/8018x/80186/amd-80186.pdf>
146 * <http://hands.com/~lkcl/eoma/shenzen/frida/FRD144A2701.pdf>
147 * <http://pinouts.ru/Memory/sdcard_pinout.shtml>
148 * p8 <http://www.onfi.org/~/media/onfi/specs/onfi_2_0_gold.pdf?la=en>
149 * <https://www.heyrick.co.uk/blog/files/datasheets/dm9000aep.pdf>
150 * <http://cache.freescale.com/files/microcontrollers/doc/app_note/AN4393.pdf>
151 * <https://www.nxp.com/docs/en/data-sheet/MCF54418.pdf>
152 * ULPI OTG PHY, ST <http://www.st.com/en/interfaces-and-transceivers/stulpi01a.html>
153 * ULPI OTG PHY, TI TUSB1210 <http://ti.com/product/TUSB1210/>
156 return pinouts
, bankspec
, pinbanks
, fixedpins