targets/simple: map SPI flash

This commit is contained in:
Sebastien Bourdeauducq 2013-11-25 15:08:53 +01:00
parent 5953f901c8
commit 356178e680
1 changed files with 6 additions and 1 deletions

View File

@ -1,6 +1,6 @@
from migen.fhdl.std import * from migen.fhdl.std import *
from misoclib import gpio from misoclib import gpio, spiflash
from misoclib.gensoc import GenSoC, IntegratedBIOS from misoclib.gensoc import GenSoC, IntegratedBIOS
class SimpleSoC(GenSoC, IntegratedBIOS): class SimpleSoC(GenSoC, IntegratedBIOS):
@ -18,5 +18,10 @@ class SimpleSoC(GenSoC, IntegratedBIOS):
self.submodules.leds = gpio.GPIOOut(platform.request("user_led")) self.submodules.leds = gpio.GPIOOut(platform.request("user_led"))
# Map the SPI flash at 0xb0000000 for demo purposes. Later, we'll want to store the BIOS there.
self.submodules.spiflash = spiflash.SpiFlash(platform.request("spiflash2x"),
cmd=0xefef, cmd_width=16, addr_width=24, dummy=4)
self.add_wb_slave(lambda a: a[26:29] == 3, self.spiflash.bus)
def get_default_subtarget(platform): def get_default_subtarget(platform):
return SimpleSoC return SimpleSoC