From 0c1fa7f4a8666b4ac89c5486f6f349777c2bd318 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Wed, 7 Aug 2019 09:04:31 +0200 Subject: [PATCH] partner/platform/fomu: cleaup, make it similar to others platforms --- litex_boards/partner/platforms/fomu_evt.py | 35 ++++++-------- litex_boards/partner/platforms/fomu_hacker.py | 47 ++++++------------- litex_boards/partner/platforms/fomu_pvt.py | 45 +++++++----------- 3 files changed, 47 insertions(+), 80 deletions(-) diff --git a/litex_boards/partner/platforms/fomu_evt.py b/litex_boards/partner/platforms/fomu_evt.py index 2b5288b..9836e79 100644 --- a/litex_boards/partner/platforms/fomu_evt.py +++ b/litex_boards/partner/platforms/fomu_evt.py @@ -2,25 +2,29 @@ # This file is Copyright (c) 2019 Sean Cross # License: BSD -# fomu evt board from from crowd funding -# design files at https://github.com/im-tomu/fomu-hardware/tree/evt/hardware/pcb -# +# Fomu EVT board: +# - Crowd Supply campaign: https://www.crowdsupply.com/sutajio-kosagi/fomu +# - Design files: https://github.com/im-tomu/fomu-hardware/tree/evt/hardware/pcb + from litex.build.generic_platform import * from litex.build.lattice import LatticePlatform from litex.build.lattice.programmer import IceStormProgrammer +# IOs ---------------------------------------------------------------------------------------------- _io = [ + ("clk48", 0, Pins("44"), IOStandard("LVCMOS33")), + + ("user_led_n", 0, Pins("41"), IOStandard("LVCMOS33")), ("rgb_led", 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")), - ("user_btn_n", 0, Pins("42"), IOStandard("LVCMOS33")), - ("user_btn_n", 1, Pins("38"), IOStandard("LVCMOS33")), + + ("user_btn_n", 0, Pins("42"), IOStandard("LVCMOS33")), + ("user_btn_n", 1, Pins("38"), IOStandard("LVCMOS33")), ("serial", 0, Subsignal("rx", Pins("21")), @@ -51,33 +55,24 @@ _io = [ Subsignal("dq", Pins("14 17 19 18"), 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"), ] +# Platform ----------------------------------------------------------------------------------------- class Platform(LatticePlatform): default_clk_name = "clk48" default_clk_period = 1e9/48e6 - gateware_size = 0x20000 - - # FIXME: Create a "spi flash module" object in the same way we have SDRAM - spiflash_model = "n25q32" - spiflash_read_dummy_bits = 8 - spiflash_clock_div = 2 - spiflash_total_size = int((16/8)*1024*1024) # 16Mbit - spiflash_page_size = 256 - spiflash_sector_size = 0x10000 - def __init__(self): - LatticePlatform.__init__(self, "ice40-up5k-sg48", _io, _connectors, - toolchain="icestorm") + LatticePlatform.__init__(self, "ice40-up5k-sg48", _io, _connectors, toolchain="icestorm") def create_programmer(self): return IceStormProgrammer() diff --git a/litex_boards/partner/platforms/fomu_hacker.py b/litex_boards/partner/platforms/fomu_hacker.py index a8dbc4c..52173ba 100644 --- a/litex_boards/partner/platforms/fomu_hacker.py +++ b/litex_boards/partner/platforms/fomu_hacker.py @@ -1,29 +1,30 @@ # This file is Copyright (c) 2019 Tom Keddie # License: BSD -# fomu hacker board -# schematic at https://github.com/im-tomu/fomu-hardware/tree/master/hacker/releases/v0.0-19-g154fecc -# +# Fomu Hacker board: +# - Design files: https://github.com/im-tomu/fomu-hardware/tree/master/hacker/releases/v0.0-19-g154fecc from litex.build.generic_platform import * from litex.build.lattice import LatticePlatform from litex.build.lattice.programmer import IceStormProgrammer +# IOs ---------------------------------------------------------------------------------------------- _io = [ + ("clk48", 0, Pins("F5"), IOStandard("LVCMOS33")), + + ("user_led_n", 0, Pins("A5"), 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")), + ("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")), @@ -32,12 +33,6 @@ _io = [ IOStandard("LVCMOS33") ), - ("clk48", 0, Pins("F5"), IOStandard("LVCMOS33")), - - # Adesto AT25SF161 - 16-Mbit - 2 megabyte - # Supports SPI Modes 0 and 3 - # Supports Dual and Quad Output Read - # ("spiflash", 0, Subsignal("cs_n", Pins("C1"), IOStandard("LVCMOS33")), Subsignal("clk", Pins("D1"), IOStandard("LVCMOS33")), @@ -46,32 +41,20 @@ _io = [ ), ] +# Connectors --------------------------------------------------------------------------------------- + _connectors = [ - # Pins - # Pin 1 - F4 - Outside full square - # Pin 2 - E5 - # Pin 3 - E4 - # Pin 4 - F2 - Near notch on bottom ("touch_pins", "F4 E5 E4 F2"), ] +# Platform ----------------------------------------------------------------------------------------- + class Platform(LatticePlatform): default_clk_name = "clk48" default_clk_period = 1e9/48e6 - gateware_size = 0x20000 - - # FIXME: Create a "spi flash module" object in the same way we have SDRAM - spiflash_model = "n25q32" - spiflash_read_dummy_bits = 8 - spiflash_clock_div = 2 - spiflash_total_size = int((16/8)*1024*1024) # 16Mbit, 1megabytes - spiflash_page_size = 256 - spiflash_sector_size = 0x10000 - def __init__(self): - LatticePlatform.__init__( - self, "ice40-up5k-uwg30", _io, _connectors, toolchain="icestorm") + LatticePlatform.__init__(self, "ice40-up5k-uwg30", _io, _connectors, toolchain="icestorm") def create_programmer(self): return IceStormProgrammer() diff --git a/litex_boards/partner/platforms/fomu_pvt.py b/litex_boards/partner/platforms/fomu_pvt.py index 84b8568..9ef5516 100644 --- a/litex_boards/partner/platforms/fomu_pvt.py +++ b/litex_boards/partner/platforms/fomu_pvt.py @@ -1,24 +1,31 @@ # This file is Copyright (c) 2019 Tom Keddie # License: BSD -# fomu pvt board from crowd funding -# design files at https://github.com/im-tomu/fomu-hardware/tree/pvt/hardware/pcb -# +# Fomu PVT board: +# - Crowd Supply campaign: https://www.crowdsupply.com/sutajio-kosagi/fomu +# - Design files: https://github.com/im-tomu/fomu-hardware/tree/pvt/hardware/pcb from litex.build.generic_platform import * from litex.build.lattice import LatticePlatform from litex.build.lattice.programmer import IceStormProgrammer +# IOs ---------------------------------------------------------------------------------------------- _io = [ + ("clk48", 0, Pins("F4"), IOStandard("LVCMOS33")), + + ("user_led_n", 0, Pins("A5"), 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("E4"), IOStandard("LVCMOS33")), + ("user_touch_n", 1, Pins("D5"), IOStandard("LVCMOS33")), + ("user_touch_n", 2, Pins("E5"), IOStandard("LVCMOS33")), + ("user_touch_n", 3, Pins("F5"), IOStandard("LVCMOS33")), ("usb", 0, Subsignal("d_p", Pins("A1")), @@ -27,12 +34,6 @@ _io = [ IOStandard("LVCMOS33") ), - ("clk48", 0, Pins("F4"), IOStandard("LVCMOS33")), - - # Adesto AT25SF161 - 16-Mbit - 2 megabyte - # Supports SPI Modes 0 and 3 - # Supports Dual and Quad Output Read - # ("spiflash", 0, Subsignal("cs_n", Pins("C1"), IOStandard("LVCMOS33")), Subsignal("clk", Pins("D1"), IOStandard("LVCMOS33")), @@ -48,32 +49,20 @@ _io = [ ), ] +# Connectors --------------------------------------------------------------------------------------- + _connectors = [ - # Pins - # Pin 1 - # Pin 2 - # Pin 3 - # Pin 4 ("touch_pins", "E4 D5 E5 F5"), ] +# Platform ----------------------------------------------------------------------------------------- + class Platform(LatticePlatform): default_clk_name = "clk48" default_clk_period = 1e9/48e6 - gateware_size = 0x20000 - - # FIXME: Create a "spi flash module" object in the same way we have SDRAM - spiflash_model = "n25q32" - spiflash_read_dummy_bits = 8 - spiflash_clock_div = 2 - spiflash_total_size = int((16/8)*1024*1024) # 16Mbit, 1megabytes - spiflash_page_size = 256 - spiflash_sector_size = 0x10000 - def __init__(self): - LatticePlatform.__init__( - self, "ice40-up5k-uwg30", _io, _connectors, toolchain="icestorm") + LatticePlatform.__init__(self, "ice40-up5k-uwg30", _io, _connectors, toolchain="icestorm") def create_programmer(self): return IceStormProgrammer()