liteeth: Hook up LiteX LiteEth ethernet controller
Currently only generated for Arty. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>pull/212/head
parent
7566f04fe3
commit
8366710217
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,27 @@
|
||||
#!/usr/bin/python3
|
||||
from fusesoc.capi2.generator import Generator
|
||||
import os
|
||||
import sys
|
||||
import pathlib
|
||||
|
||||
class LiteEthGenerator(Generator):
|
||||
def run(self):
|
||||
board = self.config.get('board')
|
||||
|
||||
# Collect a bunch of directory path
|
||||
script_dir = os.path.dirname(sys.argv[0])
|
||||
gen_dir = os.path.join(script_dir, "generated", board)
|
||||
|
||||
print("Adding LiteEth for board... ", board)
|
||||
|
||||
# Add files to fusesoc
|
||||
files = []
|
||||
f = os.path.join(gen_dir, "liteeth_core.v")
|
||||
files.append({f : {'file_type' : 'verilogSource'}})
|
||||
|
||||
self.add_files(files)
|
||||
|
||||
g = LiteEthGenerator()
|
||||
g.run()
|
||||
g.write()
|
||||
|
@ -0,0 +1,15 @@
|
||||
# This file is Copyright (c) 2020 Florent Kermarrec <florent@enjoy-digital.fr>
|
||||
# License: BSD
|
||||
|
||||
# PHY ----------------------------------------------------------------------
|
||||
phy: LiteEthPHYMII
|
||||
vendor: xilinx
|
||||
# Core ---------------------------------------------------------------------
|
||||
clk_freq: 100e6
|
||||
core: wishbone
|
||||
endianness: little
|
||||
|
||||
soc:
|
||||
mem_map:
|
||||
ethmac: 0x00010000
|
||||
csr_data_width: 32
|
@ -0,0 +1,30 @@
|
||||
#!/bin/bash
|
||||
|
||||
TARGETS=arty
|
||||
|
||||
ME=$(realpath $0)
|
||||
echo ME=$ME
|
||||
MY_PATH=$(dirname $ME)
|
||||
echo MYPATH=$MY_PATH
|
||||
PARENT_PATH=$(realpath $MY_PATH/..)
|
||||
echo PARENT=$PARENT_PATH
|
||||
BUILD_PATH=$PARENT_PATH/build
|
||||
mkdir -p $BUILD_PATH
|
||||
GEN_PATH=$PARENT_PATH/generated
|
||||
mkdir -p $GEN_PATH
|
||||
|
||||
for i in $TARGETS
|
||||
do
|
||||
TARGET_BUILD_PATH=$BUILD_PATH/$i
|
||||
TARGET_GEN_PATH=$GEN_PATH/$i
|
||||
rm -rf $TARGET_BUILD_PATH
|
||||
rm -rf $TARGET_GEN_PATH
|
||||
mkdir -p $TARGET_BUILD_PATH
|
||||
mkdir -p $TARGET_GEN_PATH
|
||||
|
||||
echo "Generating $i in $TARGET_BUILD_PATH"
|
||||
liteeth_gen --output-dir=$TARGET_BUILD_PATH $MY_PATH/$i.yml
|
||||
|
||||
cp $TARGET_BUILD_PATH/gateware/liteeth_core.v $TARGET_GEN_PATH/
|
||||
done
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,15 @@
|
||||
CAPI=2:
|
||||
|
||||
name : :microwatt:liteeth:0
|
||||
|
||||
generators:
|
||||
liteeth_gen:
|
||||
interpreter: python3
|
||||
command: fusesoc-add-files.py
|
||||
description: Generate a liteeth ethernet controller
|
||||
usage: |
|
||||
liteeth_gen adds the pre-generated LiteX LiteEth memory controller
|
||||
based on the board type.
|
||||
|
||||
Parameters:
|
||||
board: The board type (arty)
|
Loading…
Reference in New Issue