forked from M-Labs/artiq
1
0
Fork 0

kc705: add SPI bus for memory card

This will be useful for SPI unit tests using a SD card as victim.
This commit is contained in:
mntng 2017-07-12 00:27:44 +08:00 committed by Sébastien Bourdeauducq
parent 298ceafd92
commit 40ca951750
4 changed files with 42 additions and 17 deletions

View File

@ -137,6 +137,13 @@ device_db = {
"class": "SPIMaster",
"arguments": {"channel": 23}
},
"spi_mmc": {
"type": "local",
"module": "artiq.coredevice.spi",
"class": "SPIMaster",
"arguments": {"channel": 26}
},
"dac0": {
"type": "local",
@ -149,20 +156,20 @@ device_db = {
"type": "local",
"module": "artiq.coredevice.dds",
"class": "DDSChannelAD9914",
"arguments": {"bus_channel": 26, "channel": 0},
"arguments": {"bus_channel": 27, "channel": 0},
"comment": "Comments work in DDS panel as well"
},
"dds1": {
"type": "local",
"module": "artiq.coredevice.dds",
"class": "DDSChannelAD9914",
"arguments": {"bus_channel": 26, "channel": 1}
"arguments": {"bus_channel": 27, "channel": 1}
},
"dds2": {
"type": "local",
"module": "artiq.coredevice.dds",
"class": "DDSChannelAD9914",
"arguments": {"bus_channel": 26, "channel": 2}
"arguments": {"bus_channel": 27, "channel": 2}
},
"qc_q1_0": {

View File

@ -97,6 +97,16 @@ _ams101_dac = [
)
]
_sdcard_spi_33 = [
("sdcard_spi_33", 0,
Subsignal("miso", Pins("AC20")),
Subsignal("clk", Pins("AB23")),
Subsignal("mosi", Pins("AB22")),
Subsignal("cs_n", Pins("AC21")),
IOStandard("LVCMOS33")
)
]
class _NIST_Ions(MiniSoC, AMPSoC):
mem_map = {
@ -131,6 +141,7 @@ class _NIST_Ions(MiniSoC, AMPSoC):
self.platform.add_extension(_sma33_io)
self.platform.add_extension(_ams101_dac)
self.platform.add_extension(_sdcard_spi_33)
i2c = self.platform.request("i2c")
self.submodules.i2c = gpio.GPIOTristate([i2c.scl, i2c.sda])
@ -220,7 +231,12 @@ class NIST_CLOCK(_NIST_Ions):
self.submodules += phy
rtio_channels.append(rtio.Channel.from_phy(
phy, ofifo_depth=128, ififo_depth=128))
phy = spi.SPIMaster(platform.request("sdcard_spi_33", 0))
self.submodules += phy
rtio_channels.append(rtio.Channel.from_phy(
phy, ofifo_depth=4, ififo_depth=4))
phy = dds.AD9914(platform.request("dds"), 11, onehot=True)
self.submodules += phy
rtio_channels.append(rtio.Channel.from_phy(phy,

View File

@ -14,7 +14,7 @@ requirements:
run:
- python >=3.5.3,<3.6
- setuptools 33.1.1
- migen 0.5.dev py_112+gitd8b55c7
- migen 0.5.dev py_117+gite826cb9
- misoc 0.6.dev py_22+gite205c2ea
- jesd204b 0.3
- binutils-or1k-linux >=2.27

View File

@ -71,19 +71,21 @@ With the CLOCK hardware, the TTL lines are mapped as follows:
The board has RTIO SPI buses mapped as follows:
+--------------+-------------+-------------+-----------+------------+
| RTIO channel | CS_N | MOSI | MISO | CLK |
+==============+=============+=============+===========+============+
| 22 | AMS101_CS_N | AMS101_MOSI | | AMS101_CLK |
+--------------+-------------+-------------+-----------+------------+
| 23 | SPI0_CS_N | SPI0_MOSI | SPI0_MISO | SPI0_CLK |
+--------------+-------------+-------------+-----------+------------+
| 24 | SPI1_CS_N | SPI1_MOSI | SPI1_MISO | SPI1_CLK |
+--------------+-------------+-------------+-----------+------------+
| 25 | SPI2_CS_N | SPI2_MOSI | SPI2_MISO | SPI2_CLK |
+--------------+-------------+-------------+-----------+------------+
+--------------+--------------+--------------+--------------+------------+
| RTIO channel | CS_N | MOSI | MISO | CLK |
+==============+==============+==============+==============+============+
| 22 | AMS101_CS_N | AMS101_MOSI | | AMS101_CLK |
+--------------+--------------+--------------+--------------+------------+
| 23 | SPI0_CS_N | SPI0_MOSI | SPI0_MISO | SPI0_CLK |
+--------------+--------------+--------------+--------------+------------+
| 24 | SPI1_CS_N | SPI1_MOSI | SPI1_MISO | SPI1_CLK |
+--------------+--------------+--------------+--------------+------------+
| 25 | SPI2_CS_N | SPI2_MOSI | SPI2_MISO | SPI2_CLK |
+--------------+--------------+--------------+--------------+------------+
| 26 | MMC_SPI_CS_N | MMC_SPI_MOSI | MMC_SPI_MISO | MMC_SPI_CLK|
+--------------+--------------+--------------+--------------+------------+
The DDS bus is on channel 26.
The DDS bus is on channel 27.
NIST QC2