11
11
import argparse
12
12
import sys
13
13
14
+ import migen
14
15
from migen import *
15
16
16
17
from litex .build .generic_platform import *
17
18
from litex .build .lattice import LatticePlatform
18
- from litex_boards .platforms import ulx3s as ulx3s_platform
19
- from litex_boards .targets import ulx3s
19
+ from litex_boards .platforms import radiona_ulx3s as ulx3s_platform
20
+ from litex_boards .targets import radiona_ulx3s
21
+ from litex .gen import *
20
22
21
23
#--------------------------------------------------------------------------------------------------------
22
24
23
25
# Add wifi_en pin to ULX3S platform (to activate / deactivate ESP32)
24
26
# Quick-and-dirty hack: replace Platform constructor and add the missing pin
27
+ # --> Not needed anymore, it is there (called "wifi_gpio0")
28
+ #
29
+ #def new_platform_init(self, device="LFE5U-45F", revision="2.0", toolchain="trellis", **kwargs):
30
+ # assert device in ["LFE5U-12F", "LFE5U-25F", "LFE5U-45F", "LFE5U-85F"]
31
+ # assert revision in ["1.7", "2.0"]
32
+ # _io = ulx3s_platform._io_common + \
33
+ # {"1.7": ulx3s_platform._io_1_7, "2.0": ulx3s_platform._io_2_0}[revision] + \
34
+ # [("wifi_en", 0, Pins("F1"), IOStandard("LVCMOS33"), Misc("PULLMODE=UP"), Misc("DRIVE=4"))]
35
+ # LatticePlatform.__init__(self, device + "-6BG381C", _io, toolchain=toolchain, **kwargs)
36
+ #
37
+ #ulx3s_platform.Platform.__init__ = new_platform_init
25
38
26
- def new_platform_init (self , device = "LFE5U-45F" , revision = "2.0" , toolchain = "trellis" , ** kwargs ):
27
- assert device in ["LFE5U-12F" , "LFE5U-25F" , "LFE5U-45F" , "LFE5U-85F" ]
28
- assert revision in ["1.7" , "2.0" ]
29
- _io = ulx3s_platform ._io_common + \
30
- {"1.7" : ulx3s_platform ._io_1_7 , "2.0" : ulx3s_platform ._io_2_0 }[revision ] + \
31
- [("wifi_en" , 0 , Pins ("F1" ), IOStandard ("LVCMOS33" ), Misc ("PULLMODE=UP" ), Misc ("DRIVE=4" ))]
32
- LatticePlatform .__init__ (self , device + "-6BG381C" , _io , toolchain = toolchain , ** kwargs )
33
-
34
- ulx3s_platform .Platform .__init__ = new_platform_init
35
39
36
40
#--------------------------------------------------------------------------------------------------------
37
41
@@ -46,7 +50,7 @@ def new_platform_init(self, device="LFE5U-45F", revision="2.0", toolchain="trell
46
50
class ESP32 (Module , AutoCSR ):
47
51
def __init__ (self , platform ):
48
52
self ._enable = CSRStorage ()
49
- self .comb += platform .request ("wifi_en " ).eq (self ._enable .storage )
53
+ self .comb += platform .request ("wifi_gpio0 " ).eq (self ._enable .storage ) # HERE: "wifi_en"
50
54
51
55
# Blitter -----------------------------------------------------------------------------------------------
52
56
# For now, it just has fast memory fill
@@ -62,13 +66,13 @@ def __init__(self,port): # for instance, port = soc.sdram.crossbar.get_port()
62
66
63
67
# BaseSoC -----------------------------------------------------------------------------------------------
64
68
65
- class BaseSoC (ulx3s .BaseSoC ):
69
+ class BaseSoC (radiona_ulx3s .BaseSoC ):
66
70
def __init__ (self , device = "LFE5U-45F" , revision = "2.0" , toolchain = "trellis" ,
67
71
sys_clk_freq = int (50e6 ), sdram_module_cls = "MT48LC16M16" , sdram_rate = "1:1" ,
68
72
with_led_chaser = True , with_video_terminal = False , with_video_framebuffer = False ,
69
73
with_spi_flash = False , ** kwargs ):
70
74
71
- ulx3s .BaseSoC .__init__ (
75
+ radiona_ulx3s .BaseSoC .__init__ (
72
76
self , device , revision , toolchain , sys_clk_freq , sdram_module_cls , sdram_rate ,
73
77
with_led_chaser , with_video_terminal , with_video_framebuffer , with_spi_flash ,
74
78
** kwargs )
@@ -119,6 +123,7 @@ def main():
119
123
** soc_core_argdict (args ))
120
124
121
125
soc .add_spi_sdcard (with_tristate = True )
126
+ # soc.add_spi_sdcard()
122
127
if args .with_oled :
123
128
soc .add_oled ()
124
129
0 commit comments