pinspecs now take mux width
[pinmux.git] / src / spec / microtest.py
1 #!/usr/bin/env python
2
3 from spec.base import PinSpec
4
5 from spec.ifaceprint import display, display_fns, check_functions
6 from spec.ifaceprint import display_fixed
7
8
9 def pinspec():
10 pinbanks = {
11 'A': (3, 4),
12 }
13 fixedpins = {
14 'CTRL_SYS': [
15 'NMI#',
16 'RESET#',
17 ],
18 'POWER_GPIO': [
19 'VDD_GPIOA',
20 'GND_GPIOA',
21 ]}
22 function_names = {'EINT': 'External Interrupt',
23 'FB': 'MC68k FlexBus',
24 'IIS': 'I2S Audio',
25 'JTAG0': 'JTAG (same as JTAG1, JTAG_SEL=LOW)',
26 'JTAG1': 'JTAG (same as JTAG0, JTAG_SEL=HIGH)',
27 'LCD': '24-pin RGB/TTL LCD',
28 'RG': 'RGMII Ethernet',
29 'MMC': 'eMMC 1/2/4/8 pin',
30 'PWM': 'PWM (pulse-width modulation)',
31 'SD0': 'SD/MMC 0',
32 'SD1': 'SD/MMC 1',
33 'SD2': 'SD/MMC 2',
34 'SPI0': 'SPI (Serial Peripheral Interface) 0',
35 'SPI1': 'SPI (Serial Peripheral Interface) 1',
36 'QSPI': 'Quad SPI (Serial Peripheral Interface) 1',
37 'TWI0': 'I2C 0',
38 'TWI1': 'I2C 1',
39 'TWI2': 'I2C 2',
40 'QUART0': 'UART (TX/RX/CTS/RTS) 0',
41 'QUART1': 'UART (TX/RX/CTS/RTS) 1',
42 'UART0': 'UART (TX/RX) 0',
43 'UART1': 'UART (TX/RX) 1',
44 'UART2': 'UART (TX/RX) 2',
45 'ULPI0': 'ULPI (USB Low Pin-count) 0',
46 'ULPI1': 'ULPI (USB Low Pin-count) 1',
47 'ULPI2': 'ULPI (USB Low Pin-count) 2',
48 }
49
50 ps = PinSpec(pinbanks, fixedpins, function_names)
51
52 # Bank A, 0-3
53 ps.gpio("", ('A', 0), 0, 0, 3)
54 ps.uart("", ('A', 0), 1)
55 #ps.uart("0", ('A', 0), 1)
56 #ps.uart("1", ('A', 2), 1)
57 ps.i2c("", ('A', 1), 2)
58 ps.i2c("", ('A', 0), 3, limit=1)
59 #ps.i2c("0", ('A', 1), 2)
60 #ps.i2c("1", ('A', 2), 4)
61
62 microtest = ['UART', 'TWI', ]
63 microtest_eint = []
64 microtest_pwm = []
65 descriptions = {
66 'TWI0': 'I2C',
67 'E2:SD1': '',
68 'SPI1': '',
69 'UART0': '',
70 'B1:LCD/22': '18-bit RGB/TTL LCD',
71 'ULPI0/8': 'user-facing: internal (on Card), USB-OTG ULPI PHY',
72 'ULPI1': 'dual USB2 Host ULPI PHY'
73 }
74
75 ps.add_scenario("MicroTest", microtest, microtest_eint, microtest_pwm,
76 descriptions)
77
78 return ps