Merge pull request #12 from sifive/priv-1.10

Merge priv-1.10 support to master
This commit is contained in:
Palmer Dabbelt 2017-11-08 16:56:06 -08:00 committed by GitHub
commit 9a44dcdb1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 159 additions and 2265 deletions

10
.gitmodules vendored
View File

@ -1,12 +1,18 @@
[submodule "linux"]
path = linux
url = https://github.com/sifive/riscv-linux.git
url = https://github.com/riscv/riscv-linux.git
[submodule "buildroot"]
path = buildroot
url = https://github.com/sifive/buildroot.git
[submodule "riscv-pk"]
path = riscv-pk
url = https://github.com/sifive/riscv-pk.git
url = https://github.com/riscv/riscv-pk.git
[submodule "riscv-gnu-toolchain"]
path = riscv-gnu-toolchain
url = https://github.com/riscv/riscv-gnu-toolchain.git
[submodule "riscv-isa-sim"]
path = riscv-isa-sim
url = https://github.com/riscv/riscv-isa-sim.git
[submodule "riscv-fesvr"]
path = riscv-fesvr
url = https://github.com/riscv/riscv-fesvr.git

25
.travis.yml Normal file
View File

@ -0,0 +1,25 @@
addons:
apt:
packages:
- autoconf
- automake
- autotools-dev
- bc
- bison
- build-essential
- curl
- flex
- gawk
- gperf
- libgmp-dev
- libmpc-dev
- libmpfr-dev
- libtool
- patchutils
- texinfo
before_install:
- export MAKEFLAGS="-j3"
install: true
script:
- true
# - (make > /dev/null) || (make -j1 && exit 1)

View File

@ -20,8 +20,6 @@ sysroot := $(wrkdir)/sysroot
linux_srcdir := $(srcdir)/linux
linux_wrkdir := $(wrkdir)/linux
linux_defconfig := $(confdir)/linux_defconfig
linux_release := linux-4.6.2.tar.xz
linux_url := ftp://ftp.kernel.org/pub/linux/kernel/v4.x
vmlinux := $(linux_wrkdir)/vmlinux
vmlinux_stripped := $(linux_wrkdir)/vmlinux-stripped
@ -32,6 +30,14 @@ bbl := $(pk_wrkdir)/bbl
bin := $(wrkdir)/bbl.bin
hex := $(wrkdir)/bbl.hex
fesvr_srcdir := $(srcdir)/riscv-fesvr
fesvr_wrkdir := $(wrkdir)/riscv-fesvr
libfesvr := $(fesvr_wrkdir)/prefix/lib/libfesvr.so
spike_srcdir := $(srcdir)/riscv-isa-sim
spike_wrkdir := $(wrkdir)/riscv-isa-sim
spike := $(spike_wrkdir)/prefix/bin/spike
target := riscv64-unknown-linux-gnu
.PHONY: all
@ -45,6 +51,7 @@ $(toolchain_dest)/bin/$(target)-gcc: $(toolchain_srcdir)
mkdir -p $(toolchain_wrkdir)
cd $(toolchain_wrkdir); $(toolchain_srcdir)/configure --prefix=$(toolchain_dest)
$(MAKE) -C $(toolchain_wrkdir) linux
sed 's/^#define LINUX_VERSION_CODE.*/#define LINUX_VERSION_CODE 263682/' -i $(toolchain_dest)/sysroot/usr/include/linux/version.h
$(buildroot_tar): $(buildroot_srcdir) $(RISCV)/bin/$(target)-gcc
$(MAKE) -C $< RISCV=$(RISCV) PATH=$(PATH) O=$(buildroot_wrkdir) riscv64_defconfig
@ -59,13 +66,9 @@ $(sysroot_stamp): $(buildroot_tar)
tar -xpf $< -C $(sysroot) --exclude ./dev --exclude ./usr/share/locale
touch $@
$(linux_release):
curl -O $(linux_url)/$(linux_release)
$(linux_wrkdir)/.config: $(linux_defconfig) $(linux_srcdir) $(linux_release)
$(linux_wrkdir)/.config: $(linux_defconfig) $(linux_srcdir)
mkdir -p $(dir $@)
cp -p $< $@
cd $(linux_srcdir); tar --strip-components=1 -xJf ../$(linux_release); git checkout .gitignore arch/.gitignore
$(MAKE) -C $(linux_srcdir) O=$(linux_wrkdir) ARCH=riscv olddefconfig
$(vmlinux): $(linux_srcdir) $(linux_wrkdir)/.config $(sysroot_stamp)
@ -88,8 +91,10 @@ $(bbl): $(pk_srcdir) $(vmlinux_stripped)
mkdir -p $(pk_wrkdir)
cd $(pk_wrkdir) && $</configure \
--host=$(target) \
--with-payload=$(vmlinux_stripped)
$(MAKE) -C $(pk_wrkdir)
--with-payload=$(vmlinux_stripped) \
--enable-logo \
--with-logo=$(abspath conf/sifive_logo.txt)
CFLAGS="-mabi=lp64d -march=rv64imafdc" $(MAKE) -C $(pk_wrkdir)
$(bin): $(bbl)
$(target)-objcopy -S -O binary --change-addresses -0x80000000 $< $@
@ -97,6 +102,27 @@ $(bin): $(bbl)
$(hex): $(bin)
xxd -c1 -p $< > $@
$(libfesvr): $(fesvr_srcdir)
rm -rf $(fesvr_wrkdir)
mkdir -p $(fesvr_wrkdir)
mkdir -p $(dir $@)
cd $(fesvr_wrkdir) && $</configure \
--prefix=$(dir $(abspath $(dir $@)))
$(MAKE) -C $(fesvr_wrkdir)
$(MAKE) -C $(fesvr_wrkdir) install
touch -c $@
$(spike): $(spike_srcdir) $(libfesvr)
rm -rf $(spike_wrkdir)
mkdir -p $(spike_wrkdir)
mkdir -p $(dir $@)
cd $(spike_wrkdir) && $</configure \
--prefix=$(dir $(abspath $(dir $@))) \
--with-fesvr=$(dir $(abspath $(dir $(libfesvr))))
$(MAKE) -C $(spike_wrkdir)
$(MAKE) -C $(spike_wrkdir) install
touch -c $@
.PHONY: sysroot vmlinux bbl
sysroot: $(sysroot)
vmlinux: $(vmlinux)
@ -105,3 +131,7 @@ bbl: $(bbl)
.PHONY: clean
clean:
rm -rf -- $(wrkdir) $(toolchain_dest)
.PHONY: sim
sim: $(spike) $(bbl)
$(spike) -p4 $(bbl)

@ -1 +1 @@
Subproject commit 0fd471394450a4dfde0f21a7f7abe51be5800a3f
Subproject commit 672f627ce0fe9720b4a193fb9bd583518a990882

View File

@ -1,3 +1,4 @@
CONFIG_SMP=y
# CONFIG_COMPACTION is not set
CONFIG_HZ_100=y
CONFIG_CROSS_COMPILE="riscv64-unknown-linux-gnu-"
@ -37,7 +38,7 @@ CONFIG_DEVTMPFS_MOUNT=y
# CONFIG_HWMON is not set
# CONFIG_USB_SUPPORT is not set
# CONFIG_IOMMU_SUPPORT is not set
CONFIG_EXT2_FS=y
CONFIG_EXT3_FS=y
# CONFIG_FILE_LOCKING is not set
# CONFIG_DNOTIFY is not set
# CONFIG_INOTIFY_USER is not set
@ -52,6 +53,7 @@ CONFIG_DEBUG_SECTION_MISMATCH=y
CONFIG_CMDLINE_BOOL=y
CONFIG_CMDLINE="earlyprintk"
CONFIG_FRAME_POINTER=y
CONFIG_STACKTRACE=y
# CONFIG_CRYPTO_ANSI_CPRNG is not set
# CONFIG_CRYPTO_HW is not set
CONFIG_PCI=y
@ -69,7 +71,7 @@ CONFIG_NET_CORE=y
CONFIG_ETHERNET=y
CONFIG_NET_VENDOR_INTEL=y
CONFIG_E1000E=y
CONFIG_PCIE_XILINX_RV=y
CONFIG_PCIE_XILINX=y
CONFIG_R8169=y
CONFIG_SCSI=y
CONFIG_SCSI_DMA=y

File diff suppressed because it is too large Load Diff

26
conf/sifive_logo.txt Normal file
View File

@ -0,0 +1,26 @@
SIFIVE, INC.
5555555555555555555555555
5555 5555
5555 5555
5555 5555
5555 5555555555555555555555
5555 555555555555555555555555
5555 5555
5555 5555
5555 5555
5555555555555555555555555555 55555
55555 555555555 55555
55555 55555 55555
55555 5 55555
55555 55555
55555 55555
55555 55555
55555 55555
55555 55555
555555555
55555
5
SiFive RISC-V Coreplex

2
linux

@ -1 +1 @@
Subproject commit 1bbe5704f17d4923bf9e414f02ee5326350e1fc5
Subproject commit 160fa8470d0f78b1571c04da8b9af50ac05be378

1
riscv-fesvr Submodule

@ -0,0 +1 @@
Subproject commit f683e01542acf60e50774d061bcb396b628e3e67

@ -1 +1 @@
Subproject commit 72ea34e9dc40cdab33d79789e410a9bc295911f6
Subproject commit b4dae89f85bf882852c6186b1284df11065bfcd9

1
riscv-isa-sim Submodule

@ -0,0 +1 @@
Subproject commit 092b464c06d2eba580b95a3ac7013449cb2687e4

@ -1 +1 @@
Subproject commit 423f0b6c3b2f0360a5ceebfae5ee75c61ba7b6ee
Subproject commit 57740d97cdec928c372d8e752c04a691418cbfa1