Skip to content

Commit

Permalink
Simplify flash memory generation
Browse files Browse the repository at this point in the history
Since MT25Q uses an underlying mapped memory,
theres is no more need for special handling of
`spiflash` memory region.
  • Loading branch information
mateusz-holenko committed Oct 21, 2019
1 parent 3a1f7c8 commit 462df23
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions generate-renode-scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

# those memory regions are handled in a special way
# and should not be generated automatically
non_generated_mem_regions = ['ethmac', 'spiflash', 'csr']
non_generated_mem_regions = ['ethmac', 'csr']

configuration = None

Expand Down Expand Up @@ -241,27 +241,16 @@ def generate_spiflash(peripheral, shadow_base, **kwargs):
string: repl definition of the peripheral
"""

xip_base = int(configuration.mem_regions['spiflash']['address'], 0)
flash_size = int(configuration.mem_regions['spiflash']['size'], 0)

result = """
spi: SPI.LiteX_SPI_Flash @ {{
{}
}}
flash_mem: Memory.MappedMemory @ {{
{}
}}
size: {}
flash: SPI.Micron_MT25Q @ spi
underlyingMemory: flash_mem
mt25q: SPI.Micron_MT25Q @ spi
underlyingMemory: spiflash
""".format(
generate_sysbus_registration(int(peripheral['address'], 0),
shadow_base, skip_braces=True),
generate_sysbus_registration(xip_base, shadow_base, skip_braces=True),
hex(flash_size))

shadow_base, skip_braces=True))
return result


Expand Down

0 comments on commit 462df23

Please sign in to comment.