ab957b6ae8dc6c596ecf820c6ec3c30d80b449ea
[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 {"gpioa":
52 {
53 "muxconfig": "011000"
54 }
55 }
56 )
57
58 # Bank A, 0-3
59 ps.gpio("", ('A', 0), 0, 0, 3)
60 #ps.uart("", ('A', 0), 1)
61 ps.uart("0", ('A', 0), 1)
62 ps.uart("1", ('A', 2), 1)
63 ps.i2c("0", ('A', 1), 2)
64 ps.i2c("0", ('A', 3), 3, limit=1)
65 #ps.i2c("0", ('A', 1), 2)
66 #ps.i2c("1", ('A', 2), 4)
67
68 microtest = ['UART0', 'TWI0', ]
69 microtest_eint = []
70 microtest_pwm = []
71 descriptions = {
72 'TWI0': 'I2C',
73 'E2:SD1': '',
74 'SPI1': '',
75 'UART0': '',
76 'B1:LCD/22': '18-bit RGB/TTL LCD',
77 'ULPI0/8': 'user-facing: internal (on Card), USB-OTG ULPI PHY',
78 'ULPI1': 'dual USB2 Host ULPI PHY'
79 }
80
81 ps.add_scenario("MicroTest", microtest, microtest_eint, microtest_pwm,
82 descriptions)
83
84 return ps