Differences between revisions 1 and 11 (spanning 10 versions)
Revision 1 as of 2018-04-11 00:30:43
Size: 4912
Editor: JeffMoe
Comment: Initial template copy
Revision 11 as of 2018-04-11 21:57:14
Size: 9585
Editor: JeffMoe
Comment: try 1.45GHz
Deletions are marked like this. Additions are marked like this.
Line 20: Line 20:
 * '''Generic !SubModel''', 13.3", 2.13 GHz Intel Core 2 Duo, 2GB DDR3 SDRAM, 128 GB SDD, NVIDIA !GeForce 9400M  * '''SiFive !HiFive Unleased''', 0" screen, 1GHz RISC-V (riscv64), 8GB SDRAM, 4 gig mini-sd.
Line 26: Line 26:
||Boot Standard Kernel: || {OK} ||
|| LAN network card (Generic Ethernet): || {OK} ||
|| Detect CD/DVD (Generic DVD+RW) : || {OK
} ||
|| Detect hard drives: || {OK} ||
## If Xorg doesn't work at all (not even with vesa driver), then move Xorg line here.
||Boot Standard Kernel: || {-} ||
|| LAN network card (Generic Ethernet): || {-} ||
|| Detect hard drives: || {-} ||
|| Xorg   || {-} ||
Line 32: Line 31:
|| CPU Frequency Scaling || {OK} ||
|| Hibernation || [?] ||
|| Sleep / Suspend || [?] ||
|| Xorg || {i} ||
|| - OpenGL || X-( ||
|| - Resize-and-Rotate(randr) || [?] ||
|| Switch to External Screen || [?] ||
|| Mouse || ||
|| - Built-in (Trackpoint) || [-] ||
|| - Built-in (Touchpad) || {OK} ||
|| Modem || [-] ||
|| Wireless/Wifi || X-( ||
|| Keyboard's Hotkeys || [?] ||
|| CPU Frequency Scaling || {-} ||
|| Hibernation || [-] ||
|| Sleep / Suspend || [-] ||
Line 51: Line 41:
Debian on the HiFive is very new. There are no public images available yet.

See: [[RISC-V]]
Line 55: Line 49:
= Configuration =

== Display ==
= Installing Debian on HiFive =
The easiest way at present to run Debian binaries on a HiFive is to boot the official SiFive image with a Debian install on the second partition and chroot into it. From there Debian's apt, ssh, apache, etc. can be run. A Debian chroot can be created with debootstrap or multistrap, each with some caveats. Multistrap leaves more of the system to configure. Debootstrap at present requires a version of qemu that is newer than what is in sid.

== Creating a chroot with multistrap ==
{{{
apt install multistrap debian-ports-archive-keyring

cat >/tmp/multistrap-riscv64.conf <<EOF
[General]
arch=riscv64
aptsources=Unstable Unreleased Sid-main
bootstrap=Unstable Unreleased Sid-main

[Sid-main]
source=http://deb.debian.org/debian
suite=unstable
omitdebsrc=true
keyring=debian-archive-keyring
packages=XXX

[Unstable]
source=http://deb.debian.org/debian-ports
suite=unstable
omitdebsrc=true
keyring=debian-ports-archive-keyring
packages=XXX

[Unreleased]
source=http://deb.debian.org/debian-ports
suite=unreleased
omitdebsrc=true
packages=XXX
EOF

multistrap -d /tmp/riscv64-chroot -f /tmp/multistrap-riscv64.conf
}}}

That will make a chroot you can copy to the second partition of the mini-sd card. Then boot that up, log in as root/sifive. By default, the image does DHCP and starts ssh.

{{{
mount /dev/mmcblk0p2 /mnt
chroot /mnt
cat /etc/debian_version

mount proc -t proc /proc
}}}

You may have to do this to clean up the package system:

{{{
export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true
export LC_ALL=C LANGUAGE=C LANG=C
/var/lib/dpkg/info/dash.preinst install
dpkg --configure -a
# Make sure all is ok
apt -f install
}}}

== Building a Kernel ==
The stock kernel from SiFive won't boot Debian as it is missing a few modules. A kernel from SiFive's git repo can be built which will (mostly) boot Debian. Run this to build a kernel and bootloader under Debian Stretch. (Buster and Sid had build issues for me.) This is a big download (multi gig) and takes a long time to compile. It is much faster to re-build ccache is installed.

There is a Linux kernel config draft available here:

http://paste.debian.net/1019771/

{{{
# Install build dependencies:

apt install build-essential ccache gawk texinfo bison flex libmpfr-dev libgmp-dev libmpc-dev zlib1g-dev bc unzip libssl-dev python wget gdisk libncurses5-dev

# Set up ccache. Not necessary, but makes re-builds much faster.
echo 'PATH=/usr/lib/ccache:$PATH' >> ~/.bashrc
. ~/.bashrc
ccache -M 2G

git clone https://github.com/sifive/freedom-u-sdk.git

cd freedom-u-sdk
git submodule update --init --recursive
make
}}}

Install this image on the mini SD card. Change /dev/sdXXX to your mini SD card (see `dmesg | tail` after inserting for device name). Note, be sure to get the right device name as this will overwrite data.

{{{
sudo make DISK=/dev/sdXXX format-boot-loader
}}}

Then take the mini-sd card, insert it in HiFive, power on and it will boot (no need to change default jumper settings). This will be a minimal non-Debian busybox system. Login is root/sifive.

=== Configuring kernel ===

How to configure the kernel using SiFive's SDK, cloned in the steps above.

{{{
make linux-menuconfig
make
# Then install on mini-sd:
sudo make DISK=/dev/sdXXX format-boot-loader
}}}

Ya, that's it. :)

Configure options to enable to get Debian going:

FUSE -- not needed necessarily, but needed for sshfs which can be faster than the slow sd card.

NFS -- Same as FUSE.

If you are going to boot the Busybox system, use this:
{{{
CONFIG_CMDLINE="earlyprintk"
}}}

If you have a Debian system on the second partition, use the following. The rootdelay is so the mmc has time to start up to be used as a root device. It may need just 2 seconds or so.
{{{
CONFIG_CMDLINE="earlyprintk root=/dev/mmcblk0p2 rootdelay=5
}}}

You can change this to set a local version to keep track of your kernel revisions:

CONFIG_LOCALVERSION="-99foobar"

One problem is systemd doesn't spawn a login terminal.... There's a few that systemd requires, this isn't the full list:

CONFIG_CGROUPS=y
CONFIG_AUTOFS4_FS=y
CONFIG_POSIX_MQUEUE=y

If you are booting Debian, not the Busybox system, you can disable:

CONFIG_BLK_DEV_INITRD

CONFIG_SYSVIPC=y
CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y

This is the ethernet card and enabled by default:

CONFIG_MACB=y

==== systemd kernel needs ====
Information about modules needed to get systemd going can be found here:

https://cgit.freedesktop.org/systemd/systemd/tree/README

The Fedora kernel also has some pointers:

https://raw.githubusercontent.com/rwmjones/fedora-riscv-kernel/master/config

= Info =
Other info...

== Console ==
Line 63: Line 208:
== Audio == There is no display output hardware on the HiFive. Use minicom to connect via USB serial port. Settings 115200 baud, 8N1, no hardware/software flow control.
{{{
minicom -D /dev/ttyUSB1
}}}

== Keyboard, Video, Mouse ==
Line 67: Line 217:
== Mouse == There is no USB or PS/2, so no keyboard or mouse. Video output is serial console.
Line 73: Line 223:
== WiFi == The units default to running at 1GHz. Units that shipped via Crowdsupply can run up to 1.5GHz:

{{{
echo 1500000000 > /sys/devices/platform/soc/10000000.prci/rate
}}}

If that locks your system you can tell as the 4 LEDs by the USB power will be unlit. You can try a lower frequency:

{{{
echo 1450000000 > /sys/devices/platform/soc/10000000.prci/rate
}}}

== Network ==
Ethernet Cadence GEM.

There is no wifi.
Line 78: Line 243:
== lspci ==
## Paste the output of "lspci -nn" here, within some {{{ }}} brackets. Optionally, attach "lscpi -vnn"
##(lspci -nn missing)
~-{{{
lspci -nn

}}}-~

== lsusb ==
## Uncomment and Paste the output of one of the three lines (within some {{{ }}}} brackets)
## (lsusb missing)
## lsusb
## lsusb -v | grep -E '\<(Bus|iProduct|bDeviceClass|bDeviceProtocol)' 2>/dev/null
{{{
lsusb -v | grep -E '\<(Bus|iProduct|bDeviceClass|bDeviceProtocol)' 2>/dev/null
}}}
Line 111: Line 260:
[[RISC-V]]

DebianOn is an effort to document how to install, configure and use Debian on some specific hardware. Therefore potential buyers would know if that hardware is supported and owners would know how get the best out of that hardware.

The purpose is not to duplicate the Debian Official Documentation, but to document how to install Debian on some specific hardware.

If you need help to get Debian running on your hardware, please have a look at our user support channels where you may find specific channels (mailing list, IRC channel) dedicated to certain types of hardware.

Translation(s): none

Models covered
Generic Computer

  • ?SiFive HiFive Unleased, 0" screen, 1GHz RISC-V (riscv64), 8GB SDRAM, 4 gig mini-sd.

Overall Status

Core Components

[ATTACH]

Boot Standard Kernel:

{-}

LAN network card (Generic Ethernet):

{-}

Detect hard drives:

{-}

Xorg

{-}

Extra Features

CPU Frequency Scaling

{-}

Hibernation

[-]

Sleep / Suspend

[-]

Legend :
{OK} = OK ; {X} Unsupported(No Driver) ; /!\ = Error (Couldn't get it working); [?] Unknown, Not Test ; [-] Not-applicable
{i} = Configuration Required; X-( = Only works with a non-free driver and or firmware

Important Note

Debian on the ?HiFive is very new. There are no public images available yet.

See: RISC-V

Installing Debian on HiFive

The easiest way at present to run Debian binaries on a ?HiFive is to boot the official ?SiFive image with a Debian install on the second partition and chroot into it. From there Debian's apt, ssh, apache, etc. can be run. A Debian chroot can be created with debootstrap or multistrap, each with some caveats. Multistrap leaves more of the system to configure. Debootstrap at present requires a version of qemu that is newer than what is in sid.

Creating a chroot with multistrap

apt install multistrap debian-ports-archive-keyring

cat >/tmp/multistrap-riscv64.conf <<EOF
[General]
arch=riscv64
aptsources=Unstable Unreleased Sid-main
bootstrap=Unstable Unreleased Sid-main

[Sid-main]
source=http://deb.debian.org/debian
suite=unstable
omitdebsrc=true
keyring=debian-archive-keyring
packages=XXX

[Unstable]
source=http://deb.debian.org/debian-ports
suite=unstable
omitdebsrc=true
keyring=debian-ports-archive-keyring
packages=XXX

[Unreleased]
source=http://deb.debian.org/debian-ports
suite=unreleased
omitdebsrc=true
packages=XXX
EOF

multistrap -d /tmp/riscv64-chroot -f /tmp/multistrap-riscv64.conf

That will make a chroot you can copy to the second partition of the mini-sd card. Then boot that up, log in as root/sifive. By default, the image does DHCP and starts ssh.

mount /dev/mmcblk0p2 /mnt
chroot /mnt
cat /etc/debian_version

mount proc -t proc /proc

You may have to do this to clean up the package system:

export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true
export LC_ALL=C LANGUAGE=C LANG=C
/var/lib/dpkg/info/dash.preinst install
dpkg --configure -a
# Make sure all is ok
apt -f install

Building a Kernel

The stock kernel from ?SiFive won't boot Debian as it is missing a few modules. A kernel from ?SiFive's git repo can be built which will (mostly) boot Debian. Run this to build a kernel and bootloader under Debian Stretch. (Buster and Sid had build issues for me.) This is a big download (multi gig) and takes a long time to compile. It is much faster to re-build ccache is installed.

There is a Linux kernel config draft available here:

http://paste.debian.net/1019771/

# Install build dependencies:

apt install build-essential ccache gawk texinfo bison flex libmpfr-dev libgmp-dev libmpc-dev zlib1g-dev bc unzip libssl-dev python wget gdisk libncurses5-dev

# Set up ccache. Not necessary, but makes re-builds much faster.
echo 'PATH=/usr/lib/ccache:$PATH' >> ~/.bashrc
. ~/.bashrc
ccache -M 2G

git clone https://github.com/sifive/freedom-u-sdk.git

cd freedom-u-sdk
git submodule update --init --recursive
make

Install this image on the mini SD card. Change /dev/sdXXX to your mini SD card (see dmesg | tail after inserting for device name). Note, be sure to get the right device name as this will overwrite data.

sudo make DISK=/dev/sdXXX format-boot-loader

Then take the mini-sd card, insert it in ?HiFive, power on and it will boot (no need to change default jumper settings). This will be a minimal non-Debian busybox system. Login is root/sifive.

Configuring kernel

How to configure the kernel using ?SiFive's SDK, cloned in the steps above.

make linux-menuconfig
make
# Then install on mini-sd:
sudo make DISK=/dev/sdXXX format-boot-loader

Ya, that's it. :)

Configure options to enable to get Debian going:

FUSE -- not needed necessarily, but needed for sshfs which can be faster than the slow sd card.

NFS -- Same as FUSE.

If you are going to boot the Busybox system, use this:

CONFIG_CMDLINE="earlyprintk"

If you have a Debian system on the second partition, use the following. The rootdelay is so the mmc has time to start up to be used as a root device. It may need just 2 seconds or so.

CONFIG_CMDLINE="earlyprintk root=/dev/mmcblk0p2 rootdelay=5 

You can change this to set a local version to keep track of your kernel revisions:

CONFIG_LOCALVERSION="-99foobar"

One problem is systemd doesn't spawn a login terminal.... There's a few that systemd requires, this isn't the full list:

CONFIG_CGROUPS=y CONFIG_AUTOFS4_FS=y CONFIG_POSIX_MQUEUE=y

If you are booting Debian, not the Busybox system, you can disable:

CONFIG_BLK_DEV_INITRD

CONFIG_SYSVIPC=y CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y

This is the ethernet card and enabled by default:

CONFIG_MACB=y

systemd kernel needs

Information about modules needed to get systemd going can be found here:

https://cgit.freedesktop.org/systemd/systemd/tree/README

The Fedora kernel also has some pointers:

https://raw.githubusercontent.com/rwmjones/fedora-riscv-kernel/master/config

Info

Other info...

Console

There is no display output hardware on the ?HiFive. Use minicom to connect via USB serial port. Settings 115200 baud, 8N1, no hardware/software flow control.

minicom -D /dev/ttyUSB1

Keyboard, Video, Mouse

There is no USB or PS/2, so no keyboard or mouse. Video output is serial console.

Power Management

The units default to running at 1GHz. Units that shipped via Crowdsupply can run up to 1.5GHz:

echo 1500000000 > /sys/devices/platform/soc/10000000.prci/rate

If that locks your system you can tell as the 4 LEDs by the USB power will be unlit. You can try a lower frequency:

echo 1450000000 > /sys/devices/platform/soc/10000000.prci/rate

Network

Ethernet Cadence GEM.

There is no wifi.

System Summary

Resources

Attachments

Some configuration files and sample outputs.

  • [get | view] (2018-04-12 00:16:37, 5.0 KB) [[attachment:linux-config-hifive.txt]]
 All files | Selected Files: delete move to page copy to page

RISC-V

Credits



CategoryDebianOn CategoryDebianOn