Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qmtech_wukong: how do I add SPI? #511

Open
e-yes opened this issue Jun 30, 2023 · 1 comment
Open

qmtech_wukong: how do I add SPI? #511

e-yes opened this issue Jun 30, 2023 · 1 comment

Comments

@e-yes
Copy link

e-yes commented Jun 30, 2023

I am trying to add SPI support to Qmtech Wukong (v2) gateware. I modified platform file as following:

--- a/litex_boards/platforms/qmtech_wukong.py
+++ b/litex_boards/platforms/qmtech_wukong.py
@@ -145,6 +145,13 @@ _io_common = [
         Subsignal("hdp",     Pins("A3"), IOStandard("LVCMOS33")),
         Subsignal("cec",     Pins("B1"), IOStandard("LVCMOS33")),
     ),
+
+    ("spi", 0,
+        Subsignal("miso", Pins("AB26"), IOStandard("LVCMOS33")),
+        Subsignal("mosi", Pins("AC26"), IOStandard("LVCMOS33")),
+        Subsignal("clk",  Pins("AB24"), IOStandard("LVCMOS33")),
+        Subsignal("cs_n", Pins("AC24"), IOStandard("LVCMOS33"))
+    )
 ]
 
 # Connectors ---------------------------------------------------------------------------------------
@@ -152,7 +159,7 @@ _io_common = [
 _connectors = [
     ("j10", "D5 G5 G7 G8 E5 E6 D6 G6"),
     ("j11", "H4 F4 A4 A5 J4 G4 B4 B5"),
-    ("j12", "AB26 AC26 AB24 AC24 AA24 AB25 AA22 AA23",
+    ("j12", "AA24 AB25 AA22 AA23",
             " Y25 AA25  W25  Y26  Y22  Y23  W21  Y21",
             " V26  W26  U25  U26  V24  W24  V23  W23",
             " V18  W18  U22  V22  U21  V21  T20  U20",

and I use this command for compilation:

python3 -m litex_boards.targets.qmtech_wukong --board-version 2 --cpu-type vexriscv_smp --cpu-variant linux --with-video-framebuffer --with-sdcard --with-ethernet --csr-json csr.json --build

I don't see anything related to spi in generated csr.json. Do I miss some command line flasgs or maybe I have to add some more modifications to platform/target files?
I want to use spidev or psx_joypad drivers. In the worst case I can add dummy spi-flash or spi-sdcard, but I believe there should be the right way to achieve what I want.

@e-yes
Copy link
Author

e-yes commented Jul 1, 2023

Well, --with-spi-sdcard works as a workaround (gateware), but litespi is not functional.
What branch in litex-hub/linux I have to try?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants