@@ -56,7 +56,7 @@ def __init__(self, platform, sys_clk_freq):
5656
5757class BaseSoC (SoCCore ):
5858 def __init__ (self , sys_clk_freq = int (100e6 ), with_ethernet = False , eth_phy = "rgmii" ,
59- with_led_chaser = True , with_pcie = False , ** kwargs ):
59+ with_spi_flash = False , with_led_chaser = True , with_pcie = False , ** kwargs ):
6060 platform = ac701 .Platform ()
6161
6262 # CRG --------------------------------------------------------------------------------------
@@ -75,7 +75,6 @@ def __init__(self, sys_clk_freq=int(100e6), with_ethernet=False, eth_phy="rgmii"
7575 self .add_sdram ("sdram" ,
7676 phy = self .ddrphy ,
7777 module = MT8JTF12864 (sys_clk_freq , "1:4" ),
78- size = 0x40000000 ,
7978 l2_cache_size = kwargs .get ("l2_size" , 8192 )
8079 )
8180
@@ -116,6 +115,12 @@ def __init__(self, sys_clk_freq=int(100e6), with_ethernet=False, eth_phy="rgmii"
116115
117116 self .add_ethernet (phy = self .ethphy )
118117
118+ # SPI Flash --------------------------------------------------------------------------------
119+ if with_spi_flash :
120+ from litespi .modules import N25Q256A
121+ from litespi .opcodes import SpiNorFlashOpCodes as Codes
122+ self .add_spi_flash (mode = "4x" , module = N25Q256A (Codes .READ_1_1_4 ), rate = "1:1" , with_master = True )
123+
119124 # PCIe -------------------------------------------------------------------------------------
120125 if with_pcie :
121126 self .submodules .pcie_phy = S7PCIEPHY (platform , platform .request ("pcie_x4" ),
@@ -134,22 +139,24 @@ def main():
134139 from litex .soc .integration .soc import LiteXSoCArgumentParser
135140 parser = LiteXSoCArgumentParser (description = "LiteX SoC on AC701" )
136141 target_group = parser .add_argument_group (title = "Target options" )
137- target_group .add_argument ("--build" , action = "store_true" , help = "Build bitstream." )
138- target_group .add_argument ("--load" , action = "store_true" , help = "Load bitstream." )
139- target_group .add_argument ("--sys-clk-freq" , default = 100e6 , help = "System clock frequency." )
140- target_group .add_argument ("--with-ethernet" , action = "store_true" , help = "Enable Ethernet support." )
141- target_group .add_argument ("--eth-phy" , default = "rgmii" , help = "Select Ethernet PHY (rgmii or 1000basex)." )
142- target_group .add_argument ("--with-pcie" , action = "store_true" , help = "Enable PCIe support." )
143- target_group .add_argument ("--driver" , action = "store_true" , help = "Generate PCIe driver." )
142+ target_group .add_argument ("--build" , action = "store_true" , help = "Build bitstream." )
143+ target_group .add_argument ("--load" , action = "store_true" , help = "Load bitstream." )
144+ target_group .add_argument ("--sys-clk-freq" , default = 100e6 , help = "System clock frequency." )
145+ target_group .add_argument ("--with-ethernet" , action = "store_true" , help = "Enable Ethernet support." )
146+ target_group .add_argument ("--eth-phy" , default = "rgmii" , help = "Select Ethernet PHY (rgmii or 1000basex)." )
147+ target_group .add_argument ("--with-spi-flash" , action = "store_true" , help = "Enable SPI Flash (MMAPed)." )
148+ target_group .add_argument ("--with-pcie" , action = "store_true" , help = "Enable PCIe support." )
149+ target_group .add_argument ("--driver" , action = "store_true" , help = "Generate PCIe driver." )
144150 builder_args (parser )
145151 soc_core_args (parser )
146152 args = parser .parse_args ()
147153
148154 soc = BaseSoC (
149- sys_clk_freq = int (float (args .sys_clk_freq )),
150- with_ethernet = args .with_ethernet ,
151- eth_phy = args .eth_phy ,
152- with_pcie = args .with_pcie ,
155+ sys_clk_freq = int (float (args .sys_clk_freq )),
156+ with_ethernet = args .with_ethernet ,
157+ eth_phy = args .eth_phy ,
158+ with_spi_flash = args .with_spi_flash ,
159+ with_pcie = args .with_pcie ,
153160 ** soc_core_argdict (args )
154161 )
155162 builder = Builder (soc , ** builder_argdict (args ))
0 commit comments