From ea8ea07a40b90fbdb332430aff2e24a75b1da83a Mon Sep 17 00:00:00 2001 From: Pepijn de Vos Date: Fri, 16 Aug 2024 14:52:08 +0200 Subject: [PATCH] WIP: make boards Gowin boards work with Apicula --- litex_boards/platforms/sipeed_tang_nano_9k.py | 2 +- litex_boards/targets/sipeed_tang_nano_20k.py | 3 ++- litex_boards/targets/sipeed_tang_nano_9k.py | 4 +++- litex_boards/targets/sipeed_tang_primer_20k.py | 4 +++- litex_boards/targets/sipeed_tang_primer_25k.py | 3 ++- 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/litex_boards/platforms/sipeed_tang_nano_9k.py b/litex_boards/platforms/sipeed_tang_nano_9k.py index eefc0f12f..52ca4a201 100644 --- a/litex_boards/platforms/sipeed_tang_nano_9k.py +++ b/litex_boards/platforms/sipeed_tang_nano_9k.py @@ -99,7 +99,7 @@ class Platform(GowinPlatform): default_clk_period = 1e9/27e6 def __init__(self, toolchain="gowin"): - GowinPlatform.__init__(self, "GW1NR-LV9QN88PC6/I5", _io, _connectors, toolchain=toolchain, devicename="GW1NR-9C") + GowinPlatform.__init__(self, "GW1NR-LV9QN88PC6/I5", _io, _connectors, toolchain=toolchain, devicename="GW1N-9C") self.toolchain.options["use_mspi_as_gpio"] = 1 def create_programmer(self, kit="openfpgaloader"): diff --git a/litex_boards/targets/sipeed_tang_nano_20k.py b/litex_boards/targets/sipeed_tang_nano_20k.py index 87980f162..f798032bb 100755 --- a/litex_boards/targets/sipeed_tang_nano_20k.py +++ b/litex_boards/targets/sipeed_tang_nano_20k.py @@ -57,9 +57,10 @@ def __init__(self, sys_clk_freq=48e6, with_led_chaser = True, with_rgb_led = False, with_buttons = True, + toolchain = "gowin", **kwargs): - platform = sipeed_tang_nano_20k.Platform(toolchain="gowin") + platform = sipeed_tang_nano_20k.Platform(toolchain=toolchain) # CRG -------------------------------------------------------------------------------------- self.crg = _CRG(platform, sys_clk_freq) diff --git a/litex_boards/targets/sipeed_tang_nano_9k.py b/litex_boards/targets/sipeed_tang_nano_9k.py index 28d5f5a3f..61857a875 100755 --- a/litex_boards/targets/sipeed_tang_nano_9k.py +++ b/litex_boards/targets/sipeed_tang_nano_9k.py @@ -62,8 +62,9 @@ class BaseSoC(SoCCore): def __init__(self, sys_clk_freq=27e6, bios_flash_offset=0x0, with_led_chaser = True, with_video_terminal = False, + toolchain = "gowin", **kwargs): - platform = sipeed_tang_nano_9k.Platform() + platform = sipeed_tang_nano_9k.Platform(toolchain=toolchain) # CRG -------------------------------------------------------------------------------------- self.crg = _CRG(platform, sys_clk_freq, with_video_pll=with_video_terminal) @@ -141,6 +142,7 @@ def main(): args = parser.parse_args() soc = BaseSoC( + toolchain = args.toolchain, sys_clk_freq = args.sys_clk_freq, bios_flash_offset = int(args.bios_flash_offset, 0), with_video_terminal = args.with_video_terminal, diff --git a/litex_boards/targets/sipeed_tang_primer_20k.py b/litex_boards/targets/sipeed_tang_primer_20k.py index b0316b082..7924be76f 100755 --- a/litex_boards/targets/sipeed_tang_primer_20k.py +++ b/litex_boards/targets/sipeed_tang_primer_20k.py @@ -106,11 +106,12 @@ def __init__(self, sys_clk_freq=48e6, eth_ip = "192.168.1.50", eth_dynamic_ip = False, dock = "standard", + toolchain = "gowin", **kwargs): assert dock in ["standard", "lite"] - platform = sipeed_tang_primer_20k.Platform(dock, toolchain="gowin") + platform = sipeed_tang_primer_20k.Platform(dock, toolchain=toolchain) if dock == "lite": with_led_chaser = False # No leds on core board nor on dock lite. @@ -208,6 +209,7 @@ def main(): args = parser.parse_args() soc = BaseSoC( + toolchain = args.toolchain, sys_clk_freq = args.sys_clk_freq, with_spi_flash = args.with_spi_flash, with_video_terminal = args.with_video_terminal, diff --git a/litex_boards/targets/sipeed_tang_primer_25k.py b/litex_boards/targets/sipeed_tang_primer_25k.py index acbf32b57..4ae64050b 100755 --- a/litex_boards/targets/sipeed_tang_primer_25k.py +++ b/litex_boards/targets/sipeed_tang_primer_25k.py @@ -53,9 +53,10 @@ def __init__(self, sys_clk_freq=50e6, with_spi_flash = False, with_led_chaser = True, with_buttons = True, + toolchain = "gowin", **kwargs): - platform = sipeed_tang_primer_25k.Platform(toolchain="gowin") + platform = sipeed_tang_primer_25k.Platform(toolchain=toolchain) # CRG -------------------------------------------------------------------------------------- self.crg = _CRG(platform, sys_clk_freq)