#!/usr/bin/env python
-# see https://bugs.libre-soc.org/show_bug.cgi?id=303
+# see https://bugs.libre-soc.org/show_bug.cgi?id=304
from spec.base import PinSpec
from spec.ifaceprint import display, display_fns, check_functions
from spec.ifaceprint import display_fixed
-
+from collections import OrderedDict
def pinspec():
- pinbanks = {
- 'A': (16, 4),
- 'B': (16, 4),
- 'C': (16, 4),
- }
+ pinbanks = OrderedDict((
+ ('N', (32, 2)),
+ ('E', (32, 2)),
+ ('S', (32, 2)),
+ ('W', (32, 2)),
+ ))
fixedpins = {
'CTRL_SYS': [
'TEST',
'VDD_GPIOB',
'GND_GPIOB',
]}
+ fixedpins = {}
function_names = {
'PWM': 'PWM (pulse-width modulation)',
'MSPI2': 'SPI (Serial Peripheral Interface) Master 1',
'UART3': 'UART (TX/RX) 2',
'MMC1': 'SD/MMC 1',
'MMC2': 'SD/MMC 2',
- 'LPC1': 'Low Pincount Interface 1',
- 'LPC2': 'Low Pincount Interface 2',
+ #'LPC1': 'Low Pincount Interface 1',
+ #'LPC2': 'Low Pincount Interface 2',
}
ps = PinSpec(pinbanks, fixedpins, function_names)
- ps.gpio("", ('A', 0), 0, 0, 16)
+ ps.vss("", ('N', 0), 0, 0, 1)
+ ps.vdd("", ('N', 1), 0, 0, 1)
+ ps.sdram1("", ('N', 2), 0, 0, 30)
+ ps.vss("", ('N', 30), 0, 0, 1)
+ ps.vdd("", ('N', 31), 0, 0, 1)
+
+ ps.vss("", ('E', 0), 0, 1, 1)
+ ps.sdram2("", ('E', 1), 0, 0, 12)
+ ps.vdd("", ('E', 13), 0, 1, 1)
+ ps.gpio("", ('E', 14), 0, 8, 8)
+ ps.vss("", ('E', 23), 0, 1, 1)
+ ps.jtag("", ('E', 24), 0, 0, 4)
+ ps.vdd("", ('E', 31), 0, 1, 1)
+
+ ps.vss("", ('S', 0), 0, 1, 1)
+ ps.clk("", ('S', 1), 0, 0, 1)
+ ps.rst("", ('S', 2), 0, 0, 1)
+ ps.mspi("0", ('S', 3), 0)
+ ps.uart("0", ('S', 7), 0)
+ ps.vdd("", ('S', 31), 0, 1, 1)
- ps.pwm("", ('B', 0), 0, 0, 2)
- ps.eint("", ('B', 2), 0, 0, 6)
- ps.mspi("2", ('B', 8), 0)
- ps.uart("1", ('B', 12), 0)
- ps.uart("3", ('B', 14), 0)
- ps.i2c("1", ('C', 0), 0)
- ps.i2c("2", ('C', 2), 0)
- ps.lpc("1", ('C', 4), 0)
- ps.lpc("2", ('C', 10), 1)
+ ps.vss("", ('W', 0), 0, 1, 1)
+ ps.pwm("", ('W', 1), 0, 0, 2)
+ ps.eint("", ('W', 3), 0, 0, 3)
+ ps.mspi("1", ('W', 6), 0)
+ ps.sdmmc("0", ('W', 10), 0)
+ ps.vdd("", ('W', 31), 0, 1, 1)
+ #ps.mspi("0", ('W', 8), 0)
+ #ps.mspi("1", ('W', 8), 0)
- #ps.mquadspi("1", ('B', 0), 0)
+ #ps.mquadspi("1", ('S', 0), 0)
# Scenarios below can be spec'd out as either "find first interface"
# by name/number e.g. SPI1, or as "find in bank/mux" which must be
# using "BM:Name". Pins are removed in-order as listed from
# lists (interfaces, EINTs, PWMs) from available pins.
- ls180 = ['ULPI0/8', 'ULPI1', 'MMC1', 'MMC2', 'SD0', 'UART0', 'LPC1',
- 'LPC2',
+ ls180 = ['ULPI0/8', 'ULPI1', 'MMC0', 'MMC2', 'SD0', 'UART0',
'TWI0', 'MSPI0', 'B3:SD1', ]
ls180_eint = []
ls180_pwm = []#['B0:PWM_0']
else:
qpins = ['CK*', 'NSS*']
inout = []
- for i in range(iosize):
- pname = "IO%d*" % i
- qpins.append(pname)
- inout.append(pname)
+ if iosize == 2:
+ qpins += ['MOSI+', 'MISO-']
+ else:
+ for i in range(iosize):
+ pname = "IO%d*" % i
+ qpins.append(pname)
+ inout.append(pname)
return (qpins, inout)
return (buspins, buspins)
-def sdram1(suffix, bank):
+def sdram1(suffix, bank, n_adr=10):
buspins = []
inout = []
- for i in range(8):
- pname = "SDRDQM%d+" % i
+ for i in range(1):
+ pname = "DQM%d+" % i
buspins.append(pname)
for i in range(8):
- pname = "SDRD%d*" % i
+ pname = "D%d*" % i
buspins.append(pname)
inout.append(pname)
- for i in range(12):
- buspins.append("SDRAD%d+" % i)
+ for i in range(n_adr):
+ buspins.append("AD%d+" % i)
for i in range(2):
- buspins.append("SDRBA%d+" % i)
- buspins += ['SDRCLK+', 'SDRCKE+', 'SDRRASn+', 'SDRCASn+', 'SDRWEn+',
- 'SDRCSn0+']
+ buspins.append("BA%d+" % i)
+ buspins += ['CLK+', 'CKE+', 'RASn+', 'CASn+', 'WEn+',
+ 'CSn0+']
return (buspins, inout)
def sdram2(suffix, bank):
buspins = []
inout = []
- for i in range(1, 6):
- buspins.append("SDRCSn%d+" % i)
- for i in range(8, 16):
- pname = "SDRDQM%d*" % i
+ for i in range(10, 13):
+ buspins.append("SDRAD%d+" % i)
+ for i in range(1, 2):
+ pname = "DQM%d*" % i
buspins.append(pname)
for i in range(8, 16):
- pname = "SDRD%d*" % i
+ pname = "D%d*" % i
buspins.append(pname)
inout.append(pname)
return (buspins, inout)
def sdram3(suffix, bank):
buspins = []
inout = []
- for i in range(12, 13):
+ for i in range(1, 6):
+ buspins.append("CSn%d+" % i)
+ for i in range(13, 14):
buspins.append("SDRAD%d+" % i)
- for i in range(8, 64):
+ for i in range(1, 4):
+ pname = "DQM%d*" % i
+ for i in range(8, 32):
pname = "SDRD%d*" % i
buspins.append(pname)
inout.append(pname)
def gpio(suffix, bank):
return (("GPIO%s" % bank, RangePin(prefix=bank, suffix="*")), [])
+def vss(suffix, bank):
+ return (RangePin("-"), [])
+
+def vdd(suffix, bank):
+ return (RangePin("-"), [])
+
+def clk(suffix, bank):
+ return (RangePin("-"), [])
+
+def rst(suffix, bank):
+ return (RangePin("-"), [])
# list functions by name here
('SDR', sdram1),
('SDR', sdram2),
('SDR', sdram3),
+ ('VSS', vss),
+ ('VDD', vdd),
+ ('CLK', clk),
+ ('RST', rst),
('EINT', eint),
('PWM', pwm),
('GPIO', gpio),