No description
Find a file
Emil Renner Berthing 0e15216a6d [NOT-FOR-UPSTREAM] Add build instructions
For convenience this also adds a small visionfive_defconfig and the
firmware needed for the brcmfmac driver along with the signed regulatory
database.

The firmware is from the linux-firmware repo and the regulatory database
from the wireless-regdb Fedora package.

Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Drew Fustini <drew@beagleboard.org>
2023-02-12 23:04:43 +01:00
arch [NOT-FOR-UPSTREAM] Add build instructions 2023-02-12 23:04:43 +01:00
block block-6.2-2023-02-03 2023-02-03 11:35:42 -08:00
certs certs: Fix build error when PKCS#11 URI contains semicolon 2023-01-31 17:53:01 +09:00
crypto This update includes the following changes: 2022-12-14 12:31:09 -08:00
Documentation dt-bindings: net: Add dwmac-starfive bindings 2023-02-12 23:04:43 +01:00
drivers spi: cadence-quadspi: Allow compilation on RISC-V 2023-02-12 23:04:43 +01:00
firmware [NOT-FOR-UPSTREAM] Add build instructions 2023-02-12 23:04:43 +01:00
fs A safeguard to prevent the kernel client from further damaging the 2023-02-03 10:34:07 -08:00
include dt-bindings: reset: Add StarFive JH7110 always-on definitions 2023-02-12 23:04:42 +01:00
init Kbuild fixes for v6.2 (3rd) 2023-01-21 10:56:37 -08:00
io_uring io_uring: always prep_async for drain requests 2023-01-27 06:29:29 -07:00
ipc Non-MM patches for 6.2-rc1. 2022-12-12 17:28:58 -08:00
kernel nvdla: add NVDLA driver 2023-02-12 23:04:43 +01:00
lib - Lock the proper critical section when dealing with perf event context 2023-02-05 11:03:56 -08:00
LICENSES LICENSES: Add the copyleft-next-0.3.1 license 2022-11-08 15:44:01 +01:00
mm 25 hotfixes, mainly for MM. 13 are cc:stable. 2023-02-03 10:01:57 -08:00
net linux-can-fixes-for-6.2-20230202 2023-02-02 11:51:24 -08:00
rust rust: print: avoid evaluating arguments in pr_* macros in unsafe blocks 2023-01-16 00:54:35 +01:00
samples ftrace: Export ftrace_free_filter() to modules 2023-01-24 11:20:58 -05:00
scripts Kbuild fixes for v6.2 (4th) 2023-02-04 11:30:23 -08:00
security tomoyo: Update website link 2023-01-13 23:11:38 +09:00
sound ASoC: starfive: Add StarFive JH7100 audio drivers 2023-02-12 23:04:43 +01:00
tools ARM64: 2023-02-04 11:21:27 -08:00
usr usr/gen_init_cpio.c: remove unnecessary -1 values from int file 2022-10-03 14:21:44 -07:00
virt VFIO fixes for v6.2-rc6 2023-01-23 11:56:07 -08:00
.clang-format iommufd for 6.2 2022-12-14 09:15:43 -08:00
.cocciconfig scripts: add Linux .cocciconfig for coccinelle 2016-07-22 12:13:39 +02:00
.get_maintainer.ignore get_maintainer: add Alan to .get_maintainer.ignore 2022-08-20 15:17:44 -07:00
.gitattributes .gitattributes: use 'dts' diff driver for dts files 2019-12-04 19:44:11 -08:00
.gitignore .gitignore: ignore *.rpm 2022-12-30 17:22:14 +09:00
.mailmap 25 hotfixes, mainly for MM. 13 are cc:stable. 2023-02-03 10:01:57 -08:00
.rustfmt.toml rust: add .rustfmt.toml 2022-09-28 09:02:20 +02:00
COPYING COPYING: state that all contributions really are covered by this file 2020-02-10 13:32:20 -08:00
CREDITS MAINTAINERS: update SCTP maintainers 2023-02-02 11:35:33 -08:00
Kbuild Kbuild updates for v6.1 2022-10-10 12:00:45 -07:00
Kconfig kbuild: ensure full rebuild when the compiler is updated 2020-05-12 13:28:33 +09:00
MAINTAINERS net: stmmac: Add glue layer for StarFive JH71x0 SoCs 2023-02-12 23:04:43 +01:00
Makefile Linux 6.2-rc7 2023-02-05 13:13:28 -08:00
README Drop all 00-INDEX files from Documentation/ 2018-09-09 15:08:58 -06:00
README.md [NOT-FOR-UPSTREAM] Add build instructions 2023-02-12 23:04:43 +01:00

Linux kernel for StarFive's JH7100 RISC-V SoC

What is this?

The JH7100 is a Linux-capable dual-core 64bit RISC-V SoC and this tree is meant to collect all the in-development patches for running Linux on boards using this. So far there are two such boards and both are supported by this tree:

  1. StarFive VisionFive
  2. BeagleV Starlight Beta

The VisionFive boards aren't quite shipping yet, but you can already register interest and ask questions on the forum.

About 300 BeagleV Starlight Beta boards were sent out to developers in April 2021 in preparation for an eventual BeagleV branded board using the updated JH7110 chip. The BeagleBoard organization has since cancelled that project though.

Cross-compiling

Cross-compiling the Linux kernel is surprisingly easy since it doesn't depend on any (target) libraries and most distributions already have packages with a working cross-compiler. We'll also need a few other tools to build everything:

# Debian/Ubuntu
sudo apt-get install libncurses-dev libssl-dev bc flex bison make gcc gcc-riscv64-linux-gnu
# Fedora
sudo dnf install ncurses-devel openssl openssl-devel bc flex bison make gcc gcc-riscv64-linux-gnu
# Archlinux
sudo pacman -S --needed ncurses openssl bc flex bison make gcc riscv64-linux-gnu-gcc

The build system needs to know that we want to cross-compile a kernel for RISC-V by setting ARCH=riscv. It also needs to know the prefix of our cross-compiler using CROSS_COMPILE=riscv64-linux-gnu-. Also let's assume we're building on an 8-core machine so compilation can be greatly sped up by telling make to use all 8 cores with -j8.

First we need to configure the kernel though. Linux has a very extensive configuration system, but you can get a good baseline configuration for the boards using:

make -j8 ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- visionfive_defconfig

There is nothing magic about this configuration other than it has all the drivers enabled that are working for the hardware on the boards. In fact it has very little extra features enabled which is great for compile times, but you are very much encouraged to add additional drivers and configure your kernel further using

make -j8 ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- nconfig

Now compile the whole thing with

make -j8 ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu-

Installing

Once the build has finished the resulting kernel can be found at

arch/riscv/boot/Image

You'll also need the matching device tree at

arch/riscv/boot/dts/starfive/jh7100-starfive-visionfive-v1.dtb

(If you have a Starlight board you should instead be using jh7100-beaglev-starlight.dtb.)

These two files should be copied to the boot partition on the SD card. In the default Fedora image this is /dev/mmcblk0p3 and is mounted at /boot.

Now add the following entry to the grub.cfg file:

menuentry 'My New Kernel' {
    linux /Image earlycon console=ttyS0,115200n8 root=/dev/mmcblk0p4 rootwait
    devicetree /jh7100-starfive-visionfive-v1.dtb
}

This assumes your root file system is at /dev/mmcblk0p4 which it is in the default Fedora image.

The visionfive_defconfig doesn't enable modules, but if you enabled them in your build you'll also need to install them in /lib/modules/ on the root file system. How to do that best is out of scope for this README though.

Status

SoC

  • Clock tree
  • Resets
  • Pinctrl/Pinmux
  • GPIO
  • Serial port
  • I2C
  • SPI
  • MMC / SDIO / SD card
  • Random number generator
  • Temperature sensor
  • Ethernet
  • USB, USB 3.0 is broken with CONFIG_PM=y
  • DRM driver
  • NVDLA
  • Watchdog
  • PWM DAC for sound through the minijack, only 16kHz samplerate for now
  • I2S [WIP]
  • TDM [WIP]
  • MIPI-DSI [WIP]
  • MIPI-CSI [WIP]
  • ISP [WIP]
  • Video Decode [WIP]
  • Video Encode [WIP]
  • QSPI
  • Security Engine
  • NNE50
  • Vision DSP

Board

  • LED
  • PMIC / Reboot
  • Ethernet PHY
  • HDMI
  • AP6236 Wifi
  • AP6236 Bluetooth, with a userspace tool
  • I2C EEPROM (VisionFive only)
  • GD25LQ128DWIG (VisionFive) / GD25LQ256D (Starlight) flash

Contributing

If you're working on cleaning up or upstreaming some of this or adding support for more of the SoC I'd very much like to incorporate it into this tree. Either send a pull request, mail or contact Esmil on IRC/Slack.

Also think of this tree mostly as a collection of patches that will hopefully mature enough to be submitted upstream eventually. So expect regular rebases.