From 636ed69fcf2f622c60bc30875e6d966d98a8b1d9 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Tue, 24 Jul 2018 14:16:23 +0100 Subject: [PATCH] add master-only spi and quad-spi --- src/spec/minitest.py | 16 ++++++++-------- src/spec/pinfunctions.py | 17 +++++++++++++++-- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/src/spec/minitest.py b/src/spec/minitest.py index 3d3f86a..ccff41c 100644 --- a/src/spec/minitest.py +++ b/src/spec/minitest.py @@ -41,9 +41,9 @@ def pinspec(): 'SD0': 'SD/MMC 0', 'SD1': 'SD/MMC 1', 'SD2': 'SD/MMC 2', - 'SPI0': 'SPI (Serial Peripheral Interface) 0', - 'SPI1': 'SPI (Serial Peripheral Interface) 1', - 'QSPI': 'Quad SPI (Serial Peripheral Interface) 1', + 'MSPI0': 'SPI (Serial Peripheral Interface) Master 0', + 'MSPI1': 'SPI (Serial Peripheral Interface) Master 1', + 'MQSPI': 'Quad SPI Master 0', 'TWI0': 'I2C 0', 'TWI1': 'I2C 1', 'TWI2': 'I2C 2', @@ -62,8 +62,8 @@ def pinspec(): # Bank A, 0-27 ps.gpio("", ('A', 0), 0, 0, 28) ps.rgbttl("", ('A', 0), 1, limit=22) - ps.spi("0", ('A', 10), 2) - ps.quadspi("", ('A', 4), 2) + ps.mspi("0", ('A', 10), 2) + ps.mquadspi("", ('A', 4), 2) ps.uart("0", ('A', 16), 2) ps.i2c("1", ('A', 18), 2) ps.pwm("", ('A', 21), 2, 0, 3) @@ -76,7 +76,7 @@ def pinspec(): ps.uartfull("0", ('A', 14), 3) ps.uartfull("1", ('A', 18), 3) ps.jtag("", ('A', 24), 2) - ps.spi("1", ('A', 24), 1) + ps.mspi("1", ('A', 24), 1) ps.i2c("0", ('A', 0), 2) ps.uart("1", ('A', 2), 2) ps.uart("2", ('A', 14), 2) @@ -89,7 +89,7 @@ def pinspec(): # lists (interfaces, EINTs, PWMs) from available pins. minitest = ['ULPI0/8', 'ULPI1', 'MMC', 'SD0', 'UART0', - 'TWI0', 'SPI0', 'B3:SD1', ] + 'TWI0', 'MSPI0', 'B3:SD1', ] minitest_eint = ['EINT_0', 'EINT_1', 'EINT_2', 'EINT_3', 'EINT_4'] minitest_pwm = ['B2:PWM_0'] descriptions = { @@ -98,7 +98,7 @@ def pinspec(): 'and UART2, for debug purposes', 'TWI2': 'I2C.\n', 'E2:SD1': '', - 'SPI1': '', + 'MSPI1': '', 'UART0': '', 'B1:LCD/22': '18-bit RGB/TTL LCD', 'ULPI0/8': 'user-facing: internal (on Card), USB-OTG ULPI PHY', diff --git a/src/spec/pinfunctions.py b/src/spec/pinfunctions.py index 985dfd7..0aa4ae8 100644 --- a/src/spec/pinfunctions.py +++ b/src/spec/pinfunctions.py @@ -61,8 +61,11 @@ def sdmmc(suffix, bank): return emmc(suffix, bank, pincount=4) -def nspi(suffix, bank, iosize): - qpins = ['CK*', 'NSS*'] +def nspi(suffix, bank, iosize, masteronly=True): + if masteronly: + qpins = ['CK+', 'NSS+'] + else: + qpins = ['CK*', 'NSS*'] inout = [] for i in range(iosize): pname = "IO%d*" % i @@ -70,6 +73,14 @@ def nspi(suffix, bank, iosize): inout.append(pname) return (qpins, inout) +def mspi(suffix, bank): + return nspi(suffix, bank, 2, masteronly=True) + + +def mquadspi(suffix, bank): + return nspi(suffix, bank, 4, masteronly=True) + + def spi(suffix, bank): return nspi(suffix, bank, 2) @@ -229,6 +240,8 @@ def gpio(suffix, bank): pinspec = (('IIS', i2s), ('MMC', emmc), ('SD', sdmmc), + ('MSPI', mspi), + ('MQSPI', mquadspi), ('SPI', spi), ('QSPI', quadspi), ('TWI', i2c), -- 2.30.2