6c987c23f57b78d02a673c98cefde68c9e33ee12
[pinmux.git] / src / spec / ls180.py
1 #!/usr/bin/env python
2 # aardonyx file
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': (16, 4),
12 }
13 fixedpins = {
14 'CTRL_SYS': [
15 'TEST',
16 'JTAG_SEL',
17 'UBOOT_SEL',
18 'NMI#',
19 'RESET#',
20 'CLK24M_IN',
21 'CLK24M_OUT',
22 'PLLTEST',
23 'PLLREGIO',
24 'PLLVP25',
25 'PLLDV',
26 'PLLVREG',
27 'PLLGND',
28 ],
29 'POWER_GPIO': [
30 'VDD_GPIOB',
31 'GND_GPIOB',
32 ]}
33 function_names = {
34 'PWM': 'PWM (pulse-width modulation)',
35 'MSPI2': 'SPI (Serial Peripheral Interface) Master 1',
36 'UART1': 'UART (TX/RX) 1',
37 'UART3': 'UART (TX/RX) 2',
38 }
39
40 ps = PinSpec(pinbanks, fixedpins, function_names)
41
42 ps.gpio("", ('A', 1), 0, 0, 1)
43 ps.gpio("", ('A', 0), 0, 1, 1)
44 ps.gpio("", ('A', 3), 0, 2, 1)
45 ps.gpio("", ('A', 2), 0, 3, 1)
46 ps.gpio("", ('A', 4), 0, 5, 2)
47 ps.gpio("", ('A', 6), 0, 9, 1)
48
49 ps.gpio("", ('A', 7), 0, 13, 1)
50 ps.gpio("", ('A', 8), 0, 10, 1)
51 ps.gpio("", ('A', 9), 0, 12, 1)
52 ps.gpio("", ('A', 10), 0, 11, 1)
53
54 ps.gpio("", ('A', 11), 0, 4, 1)
55 ps.gpio("", ('A', 12), 0, 7, 2)
56 ps.gpio("", ('A', 14), 0, 14, 2)
57
58
59
60
61
62 ps.pwm("", ('A', 2), 2, 0, 1)
63 ps.pwm("", ('A', 4), 2, 1, 3)
64 ps.pwm("", ('A', 8), 2, 4, 1)
65 ps.pwm("", ('A', 10), 2, 5, 1)
66 #ps.pwm("", ('A', 13), 2, 5, 1)
67 ps.mspi("2", ('A', 7), 1)
68 ps.uart("1", ('A', 0), 1)
69 ps.uart("3", ('A', 2), 1)
70
71 #ps.mquadspi("1", ('B', 0), 0)
72
73 # Scenarios below can be spec'd out as either "find first interface"
74 # by name/number e.g. SPI1, or as "find in bank/mux" which must be
75 # spec'd as "BM:Name" where B is bank (A-F), M is Mux (0-3)
76 # EINT and PWM are grouped together, specially, but may still be spec'd
77 # using "BM:Name". Pins are removed in-order as listed from
78 # lists (interfaces, EINTs, PWMs) from available pins.
79
80 ls180 = ['ULPI0/8', 'ULPI1', 'MMC', 'SD0', 'UART0',
81 'TWI0', 'MSPI0', 'B3:SD1', ]
82 ls180_eint = []
83 ls180_pwm = ['B2:PWM_0']
84 descriptions = {
85 'MMC': 'internal (on Card)',
86 'SD0': 'user-facing: internal (on Card), multiplexed with JTAG\n'
87 'and UART2, for debug purposes',
88 'TWI2': 'I2C.\n',
89 'E2:SD1': '',
90 'MSPI1': '',
91 'UART0': '',
92 'B1:LCD/22': '18-bit RGB/TTL LCD',
93 'ULPI0/8': 'user-facing: internal (on Card), USB-OTG ULPI PHY',
94 'ULPI1': 'dual USB2 Host ULPI PHY'
95 }
96
97 ps.add_scenario("Libre-SOC 180nm", ls180, ls180_eint, ls180_pwm,
98 descriptions)
99
100 return ps