From d9cf64b8b5d1b3812d72d099338e5b0a902da3f8 Mon Sep 17 00:00:00 2001 From: Tom Keddie Date: Wed, 5 Jun 2019 11:14:32 -0700 Subject: [PATCH] Update @mithro fomu platform defs from @xobs foboot and try to make them all match the litex style a little more --- litex/boards/platforms/fomu_evt.py | 40 +++++++++++++-------------- litex/boards/platforms/fomu_hacker.py | 35 ++++++++++++----------- 2 files changed, 38 insertions(+), 37 deletions(-) diff --git a/litex/boards/platforms/fomu_evt.py b/litex/boards/platforms/fomu_evt.py index 7b19ace..35a5cd5 100644 --- a/litex/boards/platforms/fomu_evt.py +++ b/litex/boards/platforms/fomu_evt.py @@ -4,24 +4,17 @@ from litex.build.lattice.programmer import IceStormProgrammer _io = [ + ("rgb_led_n", 0, + Subsignal("r", Pins("40")), + Subsignal("g", Pins("39")), + Subsignal("b", Pins("41")), + IOStandard("LVCMOS33"), + ), + # alias blue led ("user_led_n", 0, Pins("41"), IOStandard("LVCMOS33")), - # Color-specific aliases - ("user_ledb_n", 0, Pins("41"), IOStandard("LVCMOS33")), - ("user_ledr_n", 0, Pins("40"), IOStandard("LVCMOS33")), - ("user_ledg_n", 0, Pins("39"), IOStandard("LVCMOS33")), ("user_btn_n", 0, Pins("42"), IOStandard("LVCMOS33")), ("user_btn_n", 1, Pins("38"), IOStandard("LVCMOS33")), - ("user_pad_n", 0, Pins("48"), IOStandard("LVCMOS33")), - ("user_pad_n", 1, Pins("47"), IOStandard("LVCMOS33")), - ("user_pad_n", 2, Pins("46"), IOStandard("LVCMOS33")), - ("user_pad_n", 3, Pins("45"), IOStandard("LVCMOS33")), - - ("pmod_n", 0, Pins("25"), IOStandard("LVCMOS33")), - ("pmod_n", 1, Pins("26"), IOStandard("LVCMOS33")), - ("pmod_n", 2, Pins("27"), IOStandard("LVCMOS33")), # These two pins are - ("pmod_n", 3, Pins("28"), IOStandard("LVCMOS33")), # swapped somehow. - ("serial", 0, Subsignal("rx", Pins("21")), Subsignal("tx", Pins("13"), Misc("PULLUP")), @@ -32,15 +25,16 @@ _io = [ Subsignal("d_p", Pins("34")), Subsignal("d_n", Pins("37")), Subsignal("pullup", Pins("35")), + Subsignal("pulldown", Pins("36")), IOStandard("LVCMOS33") ), ("spiflash", 0, - Subsignal("cs_n", Pins("16"), IOStandard("LVCMOS33")), - Subsignal("clk", Pins("15"), IOStandard("LVCMOS33")), - Subsignal("miso", Pins("17"), IOStandard("LVCMOS33")), - Subsignal("mosi", Pins("14"), IOStandard("LVCMOS33")), - Subsignal("wp", Pins("18"), IOStandard("LVCMOS33")), + Subsignal("cs_n", Pins("16"), IOStandard("LVCMOS33")), + Subsignal("clk", Pins("15"), IOStandard("LVCMOS33")), + Subsignal("miso", Pins("17"), IOStandard("LVCMOS33")), + Subsignal("mosi", Pins("14"), IOStandard("LVCMOS33")), + Subsignal("wp", Pins("18"), IOStandard("LVCMOS33")), Subsignal("hold", Pins("19"), IOStandard("LVCMOS33")), ), @@ -50,10 +44,14 @@ _io = [ Subsignal("dq", Pins("14 17 19 18"), IOStandard("LVCMOS33")), ), - ("clk48", 0, Pins("44"), IOStandard("LVCMOS33")) + ("clk48", 0, Pins("44"), IOStandard("LVCMOS33")), ] -_connectors = [] +_connectors = [ + ("touch_pins", "48 47 46 45"), + ("pmoda_n", "28 27 26 23"), + ("pmodb_n", "48 47 46 45"), +] class Platform(LatticePlatform): diff --git a/litex/boards/platforms/fomu_hacker.py b/litex/boards/platforms/fomu_hacker.py index 2e59478..dff3e65 100644 --- a/litex/boards/platforms/fomu_hacker.py +++ b/litex/boards/platforms/fomu_hacker.py @@ -4,13 +4,24 @@ from litex.build.lattice.programmer import IceStormProgrammer _io = [ + ("serial", 0, + Subsignal("rx", Pins("C3")), + Subsignal("tx", Pins("B3"), Misc("PULLUP")), + IOStandard("LVCMOS33") + ), ("rgb_led", 0, Subsignal("r", Pins("C5")), Subsignal("g", Pins("B5")), Subsignal("b", Pins("A5")), IOStandard("LVCMOS33") ), + # alias blue led + ("user_led_n", 0, Pins("A5"), IOStandard("LVCMOS33")), + ("user_touch_n", 0, Pins("F4"), IOStandard("LVCMOS33")), + ("user_touch_n", 1, Pins("E5"), IOStandard("LVCMOS33")), + ("user_touch_n", 2, Pins("E4"), IOStandard("LVCMOS33")), + ("user_touch_n", 3, Pins("F2"), IOStandard("LVCMOS33")), ("usb", 0, Subsignal("d_p", Pins("A4")), @@ -30,10 +41,14 @@ _io = [ Subsignal("clk", Pins("D1"), IOStandard("LVCMOS33")), Subsignal("mosi", Pins("F1"), IOStandard("LVCMOS33")), Subsignal("miso", Pins("E1"), IOStandard("LVCMOS33")), + Subsignal("wp", Pins("A1"), IOStandard("LVCMOS33")), + Subsignal("hold", Pins("B1"), IOStandard("LVCMOS33")), + ), + ("spiflash4x", 0, + Subsignal("cs_n", Pins("C1"), IOStandard("LVCMOS33")), + Subsignal("clk", Pins("D1"), IOStandard("LVCMOS33")), + Subsignal("dq", Pins("E1 F1 A1 B1"), IOStandard("LVCMOS33")), ), -] - -spiflash = [ ] _connectors = [ @@ -42,19 +57,7 @@ _connectors = [ # Pin 2 - E5 # Pin 3 - E4 # Pin 4 - F2 - Near notch on bottom - ("pins", "F4 E5 E4 F2"), -] - -# The ICE40UP5K-B-EVN does not use the provided FT2232H chip to provide a -# UART port. One must use their own USB-to-serial cable instead to get a UART. -# Using the second 6-pin PMOD port. Follows Digilent PMOD Specification Type 4, -# so e.g. PMOD USBUART can be used. -pins_serial = [ - ("serial", 0, - Subsignal("rx", Pins("pins:1")), - Subsignal("tx", Pins("pins:2")), - IOStandard("LVCMOS33"), - ), + ("touch_pins", "F4 E5 E4 F2"), ] class Platform(LatticePlatform):