Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
litex-boards
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kestrel Collaboration
Kestrel LiteX
litex-boards
Commits
edb99797
Commit
edb99797
authored
Jan 29, 2021
by
Florent Kermarrec
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
targets/tec0117: minor cleanups.
parent
43d9be08
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
21 deletions
+11
-21
litex_boards/targets/tec0117.py
litex_boards/targets/tec0117.py
+11
-21
No files found.
litex_boards/targets/tec0117.py
View file @
edb99797
...
...
@@ -44,10 +44,7 @@ class BaseSoC(SoCCore):
**
kwargs
)
# CRG --------------------------------------------------------------------------------------
self
.
submodules
.
crg
=
CRG
(
platform
.
request
(
platform
.
default_clk_name
),
~
platform
.
request
(
'rst'
),
)
self
.
submodules
.
crg
=
CRG
(
platform
.
request
(
"clk12"
),
~
platform
.
request
(
"rst"
))
# SPI Flash --------------------------------------------------------------------------------
self
.
add_spi_flash
(
mode
=
"1x"
,
dummy_cycles
=
8
)
...
...
@@ -68,11 +65,10 @@ class BaseSoC(SoCCore):
# Flash --------------------------------------------------------------------------------------------
def
flash
(
offset
,
path
):
from
spiflash.serialflash
import
SerialFlashManager
# Create FTDI <--> SPI Flash proxy bitstream and load it.
platform
=
tec0117
.
Platform
()
flash
=
platform
.
request
(
"spiflash"
,
0
)
bus
=
platform
.
request
(
"spiflash"
,
1
)
flash
=
platform
.
request
(
"spiflash"
,
0
)
bus
=
platform
.
request
(
"spiflash"
,
1
)
module
=
Module
()
module
.
comb
+=
[
flash
.
clk
.
eq
(
bus
.
clk
),
...
...
@@ -80,26 +76,25 @@ def flash(offset, path):
flash
.
mosi
.
eq
(
bus
.
mosi
),
bus
.
miso
.
eq
(
flash
.
miso
),
]
platform
.
build
(
module
)
prog
=
platform
.
create_programmer
()
prog
.
load_bitstream
(
'build/impl/pnr/project.fs'
)
# Flash BIOS through proxy bitstream.
from
spiflash.serialflash
import
SerialFlashManager
dev
=
SerialFlashManager
.
get_flash_device
(
"ftdi://ftdi:2232/2"
)
dev
.
TIMINGS
[
'chip'
]
=
(
4
,
60
)
#
c
hip is too slow
dev
.
TIMINGS
[
'chip'
]
=
(
4
,
60
)
#
C
hip is too slow
print
(
"Erasing flash..."
)
dev
.
erase
(
0
,
-
1
)
with
open
(
path
,
'rb'
)
as
f
:
bios
=
f
.
read
()
print
(
"Programming flash..."
)
dev
.
write
(
offset
,
bios
)
# Build --------------------------------------------------------------------------------------------
def
main
():
parser
=
argparse
.
ArgumentParser
(
description
=
"LiteX SoC on
iCEBreaker
"
)
parser
=
argparse
.
ArgumentParser
(
description
=
"LiteX SoC on
TEC0117
"
)
parser
.
add_argument
(
"--build"
,
action
=
"store_true"
,
help
=
"Build bitstream"
)
parser
.
add_argument
(
"--load"
,
action
=
"store_true"
,
help
=
"Load bitstream"
)
parser
.
add_argument
(
"--bios-flash-offset"
,
default
=
0x00000
,
help
=
"BIOS offset in SPI Flash (0x00000 default)"
)
...
...
@@ -109,7 +104,7 @@ def main():
soc_core_args
(
parser
)
args
=
parser
.
parse_args
()
soc
=
BaseSoC
(
soc
=
BaseSoC
(
bios_flash_offset
=
args
.
bios_flash_offset
,
sys_clk_freq
=
int
(
float
(
args
.
sys_clk_freq
)),
**
soc_core_argdict
(
args
)
...
...
@@ -118,16 +113,11 @@ def main():
builder
.
build
(
run
=
args
.
build
)
if
args
.
flash
:
flash
(
args
.
bios_flash_offset
,
os
.
path
.
join
(
builder
.
software_dir
,
"bios"
,
"bios.bin"
))
flash
(
args
.
bios_flash_offset
,
os
.
path
.
join
(
builder
.
software_dir
,
"bios"
,
"bios.bin"
))
if
args
.
load
:
prog
=
soc
.
platform
.
create_programmer
()
prog
.
load_bitstream
(
os
.
path
.
join
(
builder
.
gateware_dir
,
"impl"
,
"pnr"
,
"project.fs"
),
args
.
flash
)
prog
.
load_bitstream
(
os
.
path
.
join
(
builder
.
gateware_dir
,
"impl"
,
"pnr"
,
"project.fs"
),
args
.
flash
)
if
__name__
==
"__main__"
:
main
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment