3 from spec
.base
import PinSpec
5 from spec
.ifaceprint
import display
, display_fns
, check_functions
6 from spec
.ifaceprint
import display_fixed
35 function_names
= {'EINT': 'External Interrupt',
36 'FB': 'MC68k FlexBus',
38 'JTAG': 'JTAG (JTAG_SEL=HI/LO)',
39 'LCD': '24-pin RGB/TTL LCD',
40 'RG': 'RGMII Ethernet',
41 'MMC': 'eMMC 1/2/4/8 pin',
42 'PWM': 'PWM (pulse-width modulation)',
46 'MSPI0': 'SPI (Serial Peripheral Interface) Master 0',
47 'MSPI1': 'SPI (Serial Peripheral Interface) Master 1',
48 'MQSPI': 'Quad SPI Master 0',
52 'QUART0': 'UART (TX/RX/CTS/RTS) 0',
53 'QUART1': 'UART (TX/RX/CTS/RTS) 1',
54 'UART0': 'UART (TX/RX) 0',
55 'UART1': 'UART (TX/RX) 1',
56 'UART2': 'UART (TX/RX) 2',
57 'ULPI0': 'ULPI (USB Low Pin-count) 0',
58 'ULPI1': 'ULPI (USB Low Pin-count) 1',
59 'ULPI2': 'ULPI (USB Low Pin-count) 2',
62 ps
= PinSpec(pinbanks
, fixedpins
, function_names
,
63 ['lcd', 'jtag', 'fb' ])
66 ps
.gpio("", ('A', 0), 0, 0, 28)
67 ps
.rgbttl("", ('A', 0), 1, limit
=22)
68 ps
.mspi("0", ('A', 10), 2)
69 ps
.mquadspi("", ('A', 4), 2)
70 ps
.uart("0", ('A', 16), 2)
71 ps
.i2c("1", ('A', 18), 2)
72 ps
.pwm("", ('A', 21), 2, 0, 3)
73 ps
.sdmmc("0", ('A', 22), 3)
74 ps
.eint("", ('A', 0), 3, 0, 4)
75 ps
.eint("", ('A', 20), 2, 4, 1)
76 ps
.eint("", ('A', 23), 1, 5, 1)
77 ps
.sdmmc("1", ('A', 4), 3)
78 ps
.jtag("", ('A', 10), 3)
79 ps
.uartfull("0", ('A', 14), 3)
80 ps
.uartfull("1", ('A', 18), 3)
81 ps
.jtag("", ('A', 24), 2)
82 ps
.mspi("1", ('A', 24), 1)
83 ps
.i2c("0", ('A', 0), 2)
84 ps
.uart("1", ('A', 2), 2)
85 ps
.uart("2", ('A', 14), 2)
87 # see comment in spec.interfaces.PinGen, this is complicated.
89 #'FB_TS': ('FB_ALE', 2), # commented out for now
90 'FB_CS2': ('FB_BWE2', 2),
91 'FB_AD0': ('FB_BWE2', 3),
92 'FB_CS3': ('FB_BWE3', 2),
93 'FB_AD1': ('FB_BWE3', 3),
94 'FB_TBST': ('FB_OE', 2),
95 'FB_TSIZ0': ('FB_BWE0', 2),
96 'FB_TSIZ1': ('FB_BWE1', 2),
98 ps
.gpio("", ('B', 0), 0, 0, 18)
99 ps
.flexbus1("", ('B', 0), 1, spec
=flexspec
)
101 ps
.gpio("", ('C', 0), 0, 0, 24)
102 ps
.flexbus2("", ('C', 0), 1)
104 # Scenarios below can be spec'd out as either "find first interface"
105 # by name/number e.g. SPI1, or as "find in bank/mux" which must be
106 # spec'd as "BM:Name" where B is bank (A-F), M is Mux (0-3)
107 # EINT and PWM are grouped together, specially, but may still be spec'd
108 # using "BM:Name". Pins are removed in-order as listed from
109 # lists (interfaces, EINTs, PWMs) from available pins.
111 i_class
= ['ULPI0/8', 'ULPI1', 'MMC', 'SD0', 'UART0',
112 'TWI0', 'MSPI0', 'B3:SD1', ]
113 i_class_eint
= ['EINT_0', 'EINT_1', 'EINT_2', 'EINT_3', 'EINT_4']
114 i_class_pwm
= ['B2:PWM_0']
116 'MMC': 'internal (on Card)',
117 'SD0': 'user-facing: internal (on Card), multiplexed with JTAG\n'
118 'and UART2, for debug purposes',
123 'B1:LCD/22': '18-bit RGB/TTL LCD',
124 'ULPI0/8': 'user-facing: internal (on Card), USB-OTG ULPI PHY',
125 'ULPI1': 'dual USB2 Host ULPI PHY'
128 ps
.add_scenario("I-Class", i_class
, i_class_eint
, i_class_pwm
,