Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
rkx7-litex-boards
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Reform
rkx7-litex-boards
Commits
1f25a984
Commit
1f25a984
authored
3 years ago
by
Florent Kermarrec
Browse files
Options
Downloads
Patches
Plain Diff
butterstick: Add Ethernet/Etherbone support (UART crossover working over Etherbone).
parent
1f149ece
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
litex_boards/platforms/gsd_butterstick.py
+21
-0
21 additions, 0 deletions
litex_boards/platforms/gsd_butterstick.py
litex_boards/targets/gsd_butterstick.py
+42
-11
42 additions, 11 deletions
litex_boards/targets/gsd_butterstick.py
with
63 additions
and
11 deletions
litex_boards/platforms/gsd_butterstick.py
+
21
−
0
View file @
1f25a984
...
@@ -28,6 +28,27 @@ _io_r1_0 = [
...
@@ -28,6 +28,27 @@ _io_r1_0 = [
# Buttons
# Buttons
(
"
user_btn
"
,
0
,
Pins
(
"
U16
"
),
IOStandard
(
"
SSTL135_I
"
)),
(
"
user_btn
"
,
0
,
Pins
(
"
U16
"
),
IOStandard
(
"
SSTL135_I
"
)),
(
"
user_btn
"
,
1
,
Pins
(
"
T17
"
),
IOStandard
(
"
SSTL135_I
"
)),
(
"
user_btn
"
,
1
,
Pins
(
"
T17
"
),
IOStandard
(
"
SSTL135_I
"
)),
# RGMII Ethernet
(
"
eth_clocks
"
,
0
,
Subsignal
(
"
tx
"
,
Pins
(
"
E15
"
)),
Subsignal
(
"
rx
"
,
Pins
(
"
D11
"
)),
IOStandard
(
"
LVCMOS33
"
),
Misc
(
"
SLEWRATE=FAST
"
),
),
(
"
eth
"
,
0
,
Subsignal
(
"
rst_n
"
,
Pins
(
"
B20
"
)),
Subsignal
(
"
mdio
"
,
Pins
(
"
D16
"
)),
Subsignal
(
"
mdc
"
,
Pins
(
"
A19
"
)),
Subsignal
(
"
rx_data
"
,
Pins
(
"
A16 C17 B17 A17
"
)),
Subsignal
(
"
tx_ctl
"
,
Pins
(
"
D15
"
)),
Subsignal
(
"
rx_ctl
"
,
Pins
(
"
B18
"
)),
Subsignal
(
"
tx_data
"
,
Pins
(
"
C15 B16 A18 B19
"
)),
IOStandard
(
"
LVCMOS33
"
),
Misc
(
"
SLEWRATE=FAST
"
)
),
]
]
# Connectors ---------------------------------------------------------------------------------------
# Connectors ---------------------------------------------------------------------------------------
...
...
This diff is collapsed.
Click to expand it.
litex_boards/targets/gsd_butterstick.py
+
42
−
11
View file @
1f25a984
...
@@ -7,6 +7,11 @@
...
@@ -7,6 +7,11 @@
# Copyright (c) 2021 Greg Davill <greg.davill@gmail.com>
# Copyright (c) 2021 Greg Davill <greg.davill@gmail.com>
# SPDX-License-Identifier: BSD-2-Clause
# SPDX-License-Identifier: BSD-2-Clause
# Build/Use:
# ./gsd_butterstick.py --uart-name=crossover --with-etherbone --csr-csv=csr.csv --build --load
# litex_server --udp
# litex_term bridge
import
os
import
os
import
sys
import
sys
import
argparse
import
argparse
...
@@ -21,6 +26,8 @@ from litex.soc.integration.soc_core import *
...
@@ -21,6 +26,8 @@ from litex.soc.integration.soc_core import *
from
litex.soc.integration.builder
import
*
from
litex.soc.integration.builder
import
*
from
litex.soc.cores.led
import
LedChaser
from
litex.soc.cores.led
import
LedChaser
from
liteeth.phy.ecp5rgmii
import
LiteEthPHYRGMII
# CRG ---------------------------------------------------------------------------------------------
# CRG ---------------------------------------------------------------------------------------------
class
_CRG
(
Module
):
class
_CRG
(
Module
):
...
@@ -51,7 +58,10 @@ class _CRG(Module):
...
@@ -51,7 +58,10 @@ class _CRG(Module):
# BaseSoC ------------------------------------------------------------------------------------------
# BaseSoC ------------------------------------------------------------------------------------------
class
BaseSoC
(
SoCCore
):
class
BaseSoC
(
SoCCore
):
def
__init__
(
self
,
revision
=
"
1.0
"
,
device
=
"
25F
"
,
sys_clk_freq
=
int
(
60e6
),
toolchain
=
"
trellis
"
,
with_led_chaser
=
True
,
**
kwargs
):
def
__init__
(
self
,
revision
=
"
1.0
"
,
device
=
"
25F
"
,
sys_clk_freq
=
int
(
60e6
),
toolchain
=
"
trellis
"
,
with_ethernet
=
False
,
with_etherbone
=
False
,
eth_ip
=
"
192.168.1.50
"
,
eth_dynamic_ip
=
False
,
with_led_chaser
=
True
,
**
kwargs
)
:
platform
=
butterstick
.
Platform
(
revision
=
revision
,
device
=
device
,
toolchain
=
toolchain
)
platform
=
butterstick
.
Platform
(
revision
=
revision
,
device
=
device
,
toolchain
=
toolchain
)
# SoCCore ----------------------------------------------------------------------------------
# SoCCore ----------------------------------------------------------------------------------
...
@@ -63,6 +73,16 @@ class BaseSoC(SoCCore):
...
@@ -63,6 +73,16 @@ class BaseSoC(SoCCore):
# CRG --------------------------------------------------------------------------------------
# CRG --------------------------------------------------------------------------------------
self
.
submodules
.
crg
=
_CRG
(
platform
,
sys_clk_freq
)
self
.
submodules
.
crg
=
_CRG
(
platform
,
sys_clk_freq
)
# Ethernet / Etherbone ---------------------------------------------------------------------
if
with_ethernet
or
with_etherbone
:
self
.
submodules
.
ethphy
=
LiteEthPHYRGMII
(
clock_pads
=
self
.
platform
.
request
(
"
eth_clocks
"
),
pads
=
self
.
platform
.
request
(
"
eth
"
))
if
with_ethernet
:
self
.
add_ethernet
(
phy
=
self
.
ethphy
,
dynamic_ip
=
eth_dynamic_ip
)
if
with_etherbone
:
self
.
add_etherbone
(
phy
=
self
.
ethphy
,
ip_address
=
eth_ip
)
# Leds -------------------------------------------------------------------------------------
# Leds -------------------------------------------------------------------------------------
if
with_led_chaser
:
if
with_led_chaser
:
self
.
comb
+=
platform
.
request
(
"
user_led_color
"
).
eq
(
0b010
)
# Blue.
self
.
comb
+=
platform
.
request
(
"
user_led_color
"
).
eq
(
0b010
)
# Blue.
...
@@ -75,22 +95,33 @@ class BaseSoC(SoCCore):
...
@@ -75,22 +95,33 @@ class BaseSoC(SoCCore):
def
main
():
def
main
():
parser
=
argparse
.
ArgumentParser
(
description
=
"
LiteX SoC on ButterStick
"
)
parser
=
argparse
.
ArgumentParser
(
description
=
"
LiteX SoC on ButterStick
"
)
parser
.
add_argument
(
"
--build
"
,
action
=
"
store_true
"
,
help
=
"
Build bitstream
"
)
parser
.
add_argument
(
"
--build
"
,
action
=
"
store_true
"
,
help
=
"
Build bitstream
"
)
parser
.
add_argument
(
"
--load
"
,
action
=
"
store_true
"
,
help
=
"
Load bitstream
"
)
parser
.
add_argument
(
"
--load
"
,
action
=
"
store_true
"
,
help
=
"
Load bitstream
"
)
parser
.
add_argument
(
"
--toolchain
"
,
default
=
"
trellis
"
,
help
=
"
FPGA use, trellis (default) or diamond
"
)
parser
.
add_argument
(
"
--toolchain
"
,
default
=
"
trellis
"
,
help
=
"
FPGA use, trellis (default) or diamond
"
)
parser
.
add_argument
(
"
--sys-clk-freq
"
,
default
=
60e6
,
help
=
"
System clock frequency (default: 60MHz)
"
)
parser
.
add_argument
(
"
--sys-clk-freq
"
,
default
=
125e6
,
help
=
"
System clock frequency (default: 125MHz)
"
)
parser
.
add_argument
(
"
--revision
"
,
default
=
"
1.0
"
,
help
=
"
Board Revision: 1.0 (default)
"
)
parser
.
add_argument
(
"
--revision
"
,
default
=
"
1.0
"
,
help
=
"
Board Revision: 1.0 (default)
"
)
parser
.
add_argument
(
"
--device
"
,
default
=
"
85F
"
,
help
=
"
ECP5 device (default: 85F)
"
)
parser
.
add_argument
(
"
--device
"
,
default
=
"
85F
"
,
help
=
"
ECP5 device (default: 85F)
"
)
ethopts
=
parser
.
add_mutually_exclusive_group
()
ethopts
.
add_argument
(
"
--with-ethernet
"
,
action
=
"
store_true
"
,
help
=
"
Add Ethernet
"
)
ethopts
.
add_argument
(
"
--with-etherbone
"
,
action
=
"
store_true
"
,
help
=
"
Add EtherBone
"
)
parser
.
add_argument
(
"
--eth-ip
"
,
default
=
"
192.168.1.50
"
,
help
=
"
Ethernet/Etherbone IP address
"
)
parser
.
add_argument
(
"
--eth-dynamic-ip
"
,
action
=
"
store_true
"
,
help
=
"
Enable dynamic Ethernet IP addresses setting
"
)
builder_args
(
parser
)
builder_args
(
parser
)
soc_core_args
(
parser
)
soc_core_args
(
parser
)
trellis_args
(
parser
)
trellis_args
(
parser
)
args
=
parser
.
parse_args
()
args
=
parser
.
parse_args
()
assert
not
(
args
.
with_etherbone
and
args
.
eth_dynamic_ip
)
soc
=
BaseSoC
(
soc
=
BaseSoC
(
toolchain
=
args
.
toolchain
,
toolchain
=
args
.
toolchain
,
revision
=
args
.
revision
,
revision
=
args
.
revision
,
device
=
args
.
device
,
device
=
args
.
device
,
sys_clk_freq
=
int
(
float
(
args
.
sys_clk_freq
)),
sys_clk_freq
=
int
(
float
(
args
.
sys_clk_freq
)),
with_ethernet
=
args
.
with_ethernet
,
with_etherbone
=
args
.
with_etherbone
,
eth_ip
=
args
.
eth_ip
,
eth_dynamic_ip
=
args
.
eth_dynamic_ip
,
**
soc_core_argdict
(
args
))
**
soc_core_argdict
(
args
))
builder
=
Builder
(
soc
,
**
builder_argdict
(
args
))
builder
=
Builder
(
soc
,
**
builder_argdict
(
args
))
builder_kargs
=
trellis_argdict
(
args
)
if
args
.
toolchain
==
"
trellis
"
else
{}
builder_kargs
=
trellis_argdict
(
args
)
if
args
.
toolchain
==
"
trellis
"
else
{}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment