Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
acdb0a7
riscv: optimized memcpy
teknoraver Sep 29, 2021
4f56e69
riscv: optimized memmove
teknoraver Sep 29, 2021
b7d684a
riscv: optimized memset
teknoraver Sep 29, 2021
fd1728c
riscv: dts: starfive: Group tuples in interrupt properties
geertu Nov 25, 2021
af50b17
RISC-V: Add StarFive JH7100 audio clock node
esmil Nov 20, 2021
ed34f91
RISC-V: Mark StarFive JH7100 as having non-coherent DMAs
esmil Aug 31, 2022
cd57b83
dt-bindings: reset: Add StarFive JH7100 audio reset definitions
esmil Nov 20, 2021
2bb8cc6
dt-bindings: reset: Add starfive,jh7100-audrst bindings
esmil Dec 7, 2021
93372ae
reset: Create subdirectory for StarFive drivers
esmil Nov 20, 2021
aaa947c
reset: starfive: Use 32bit I/O on 32bit registers
esmil Nov 24, 2021
16c11ee
reset: starfive: Add JH7100 audio reset driver
esmil Nov 20, 2021
4b36d8d
RISC-V: Add StarFive JH7100 audio reset node
esmil Nov 20, 2021
9d6f4b8
clk: starfive: jh7100: Keep more clocks alive
esmil Oct 14, 2021
9c553c3
pinctrl: starfive: Reset pinmux settings
esmil Jul 17, 2021
0baa2ca
serial: 8250_dw: Add starfive,jh7100-hsuart compatible
esmil Oct 14, 2021
82c75c2
dt-bindings: hwmon: add starfive,jh7100-temp bindings
esmil Jun 6, 2021
3e7a0f6
hwmon: (sfctemp) Add StarFive JH7100 temperature sensor
esmil Jun 6, 2021
e07f062
watchdog: Add StarFive SI5 watchdog driver
Nov 17, 2021
03c6505
hwrng: Add StarFive JH7100 Random Number Generator driver
huanfeng-sf Jan 7, 2021
d98d4ce
dt-bindings: sifive-l2-cache: Support the StarFive JH7100 SoC
esmil Apr 5, 2022
f7134b9
soc: sifive: l2 cache: Add StarFive JH7100 support
esmil Apr 5, 2022
371269e
soc: sifive: l2 cache: Add non-coherent DMA handling
esmil Jun 12, 2021
fee6ef3
riscv: Implement non-coherent DMA support via SiFive cache flushing
esmil Jun 12, 2021
0a53213
power: reset: tps65086: Allow building as a module
esmil Jul 3, 2022
8dee717
drivers/tty/serial/8250: update driver for JH7100
Jan 7, 2021
674784c
pwm: sifive-ptc: Add SiFive PWM PTC driver
Jan 7, 2021
29ddf10
[WIP] dt-bindings: dma: dw-axi-dmac: Increase DMA channel limit to 16
geertu May 27, 2021
141cca5
dmaengine: dw-axi-dmac: Handle xfer start while non-idle
Nov 17, 2021
e38bd09
dmaengine: dw-axi-dmac: Add StarFive JH7100 support
Nov 17, 2021
1dc68e8
net: phy: motorcomm: Add YT8521 support
WalkerChenL Nov 17, 2021
d461915
net: phy: motorcomm: Add WIP YT8521 wake-on-lan code
WalkerChenL Nov 17, 2021
258d039
net: stmmac: Configure gtxclk based on speed
Apr 6, 2021
3bc4df9
net: stmmac: use GFP_DMA32
teknoraver May 21, 2021
2362784
ASoC: starfive: Add StarFive JH7100 audio drivers
WalkerChenL Nov 17, 2021
61b58ff
drm/starfive: Add StarFive drm driver
Aug 31, 2021
a665e70
[WIP] drm/starfive: Support DRM_FORMAT_XRGB8888
esmil Sep 22, 2021
03c6875
drm/i2c/tda998x: Hardcode register values for Starlight
Aug 31, 2021
3853683
nvdla: add NVDLA driver
farzad64 Sep 21, 2018
6e4df83
spi: cadence-quadspi: Allow compilation on RISC-V
esmil Apr 27, 2021
5568e55
riscv: dts: Add full JH7100, Starlight and VisionFive support
esmil Oct 31, 2021
4ae2dfe
[NOT-FOR-UPSTREAM] riscv: Add StarFive JH7100 Fedora defconfig
tekkamanninja Nov 15, 2021
cfcb617
[NOT-FOR-UPSTREAM] Add build instructions
esmil May 5, 2021
f92412a
drm/starfive: Avoid CamelCase
JoseExposito Oct 12, 2022
f022e51
drm/starfive: Remove extra blank lines
JoseExposito Oct 12, 2022
a0e3cb2
drm/starfive: Prefer u32 over uint32_t
JoseExposito Oct 12, 2022
a8eb352
drm/starfive: Add spaces around operators
JoseExposito Oct 12, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Documentation/devicetree/bindings/dma/snps,dw-axi-dmac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ properties:

dma-channels:
minimum: 1
maximum: 8
maximum: 16

resets:
maxItems: 1
Expand All @@ -79,14 +79,14 @@ properties:
Channel priority specifier associated with the DMA channels.
$ref: /schemas/types.yaml#/definitions/uint32-array
minItems: 1
maxItems: 8
maxItems: 16

snps,block-size:
description: |
Channel block size specifier associated with the DMA channels.
$ref: /schemas/types.yaml#/definitions/uint32-array
minItems: 1
maxItems: 8
maxItems: 16

snps,axi-max-burst-len:
description: |
Expand Down
74 changes: 74 additions & 0 deletions Documentation/devicetree/bindings/hwmon/starfive,jh7100-temp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/hwmon/starfive,jh7100-temp.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: StarFive JH7100 Temperature Sensor

maintainers:
- Emil Renner Berthing <kernel@esmil.dk>

description: |
StarFive Technology Co. JH7100 embedded temperature sensor

properties:
compatible:
enum:
- starfive,jh7100-temp

reg:
maxItems: 1

clocks:
minItems: 2
maxItems: 2

clock-names:
items:
- const: "sense"
- const: "bus"

'#thermal-sensor-cells':
const: 0

interrupts:
maxItems: 1

resets:
minItems: 2
maxItems: 2

reset-names:
items:
- const: "sense"
- const: "bus"

required:
- compatible
- reg
- clocks
- clock-names
- interrupts
- resets
- reset-names

additionalProperties: false

examples:
- |
#include <dt-bindings/clock/starfive-jh7100.h>
#include <dt-bindings/reset/starfive-jh7100.h>

tmon: tmon@124a0000 {
compatible = "starfive,jh7100-temp";
reg = <0x124a0000 0x10000>;
clocks = <&clkgen JH7100_CLK_TEMP_SENSE>,
<&clkgen JH7100_CLK_TEMP_APB>;
clock-names = "sense", "bus";
#thermal-sensor-cells = <0>;
interrupts = <122>;
resets = <&rstgen JH7100_RSTN_TEMP_SENSE>,
<&rstgen JH7100_RSTN_TEMP_APB>;
reset-names = "sense", "bus";
};
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ properties:
$ref: /schemas/types.yaml#/definitions/uint32
enum: [0, 1, 2, 3, 4, 5, 6]

starfive,keep-gpiomux:
description: Keep pinmux for these GPIOs from being reset at boot.
$ref: /schemas/types.yaml#/definitions/uint32-array

required:
- compatible
- reg
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/reset/starfive,jh7100-audrst.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: StarFive JH7100 SoC Audio Reset Controller Device Tree Bindings

maintainers:
- Emil Renner Berthing <kernel@esmil.dk>

properties:
compatible:
enum:
- starfive,jh7100-audrst

reg:
maxItems: 1

"#reset-cells":
const: 1

required:
- compatible
- reg
- "#reset-cells"

additionalProperties: false

examples:
- |
reset-controller@10490000 {
compatible = "starfive,jh7100-audrst";
reg = <0x10490000 0x10000>;
#reset-cells = <1>;
};

...
2 changes: 2 additions & 0 deletions Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ select:
enum:
- sifive,fu540-c000-ccache
- sifive,fu740-c000-ccache
- starfive,jh7100-ccache

required:
- compatible
Expand All @@ -35,6 +36,7 @@ properties:
- enum:
- sifive,fu540-c000-ccache
- sifive,fu740-c000-ccache
- starfive,jh7100-ccache
- const: cache
- items:
- const: microchip,mpfs-ccache
Expand Down
1 change: 1 addition & 0 deletions Documentation/hwmon/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ Hardware Monitoring Kernel Drivers
sch5627
sch5636
scpi-hwmon
sfctemp
sht15
sht21
sht3x
Expand Down
32 changes: 32 additions & 0 deletions Documentation/hwmon/sfctemp.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
.. SPDX-License-Identifier: GPL-2.0

Kernel driver sfctemp
=====================

Supported chips:
- StarFive JH7100

Authors:
- Emil Renner Berthing <kernel@esmil.dk>

Description
-----------

This driver adds support for reading the built-in temperature sensor on the
JH7100 RISC-V SoC by StarFive Technology Co. Ltd.

``sysfs`` interface
-------------------

The temperature sensor can be enabled, disabled and queried via the standard
hwmon interface in sysfs under ``/sys/class/hwmon/hwmonX`` for some value of
``X``:

================ ==== =============================================
Name Perm Description
================ ==== =============================================
temp1_enable RW Enable or disable temperature sensor.
Automatically enabled by the driver,
but may be disabled to save power.
temp1_input RO Temperature reading in milli-degrees Celsius.
================ ==== =============================================
16 changes: 12 additions & 4 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -18435,6 +18435,14 @@ L: netdev@vger.kernel.org
S: Supported
F: drivers/net/ethernet/sfc/

SFCTEMP HWMON DRIVER
M: Emil Renner Berthing <kernel@esmil.dk>
L: linux-hwmon@vger.kernel.org
S: Maintained
F: Documentation/devicetree/bindings/hwmon/starfive,jh7100-temp.yaml
F: Documentation/hwmon/sfctemp.rst
F: drivers/hwmon/sfctemp.c

SFF/SFP/SFP+ MODULE SUPPORT
M: Russell King <linux@armlinux.org.uk>
L: netdev@vger.kernel.org
Expand Down Expand Up @@ -19410,12 +19418,12 @@ F: Documentation/devicetree/bindings/pinctrl/starfive,jh7100-pinctrl.yaml
F: drivers/pinctrl/pinctrl-starfive.c
F: include/dt-bindings/pinctrl/pinctrl-starfive.h

STARFIVE JH7100 RESET CONTROLLER DRIVER
STARFIVE JH7100 RESET CONTROLLER DRIVERS
M: Emil Renner Berthing <kernel@esmil.dk>
S: Maintained
F: Documentation/devicetree/bindings/reset/starfive,jh7100-reset.yaml
F: drivers/reset/reset-starfive-jh7100.c
F: include/dt-bindings/reset/starfive-jh7100.h
F: Documentation/devicetree/bindings/reset/starfive,jh7100-*.yaml
F: drivers/reset/starfive/reset-starfive-jh7100*
F: include/dt-bindings/reset/starfive-jh7100*.h

STATIC BRANCH/CALL
M: Peter Zijlstra <peterz@infradead.org>
Expand Down
154 changes: 154 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
# Linux kernel for StarFive's JH7100 RISC-V SoC

## What is this?

The [JH7100][soc] 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][visionfive]
2) [BeagleV Starlight Beta][starlight]

The VisionFive boards aren't quite shipping yet, but you can already
[register interest][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][beaglev] though.


[visionfive]: https://github.com/starfive-tech/VisionFive
[interest]: http://starfive.mikecrm.com/doQXj99
[forum]: https://forum.rvspace.org/c/visionfive/6
[starlight]: https://github.com/beagleboard/beaglev-starlight
[soc]: https://github.com/starfive-tech/JH7100_Docs
[beaglev]: https://beaglev.org/blog/2021-07-30-the-future-of-beaglev-community

## 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:
```shell
# 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:
```shell
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
```shell
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
```shell
arch/riscv/boot/Image
```
You'll also need the matching device tree at
```shell
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][fedora] 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][fedora].

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.

[fedora]: https://github.com/starfive-tech/Fedora_on_StarFive/

## Status

#### SoC

- [x] Clock tree
- [x] Resets
- [x] Pinctrl/Pinmux
- [x] GPIO
- [x] Serial port
- [x] I2C
- [x] SPI
- [x] MMC / SDIO / SD card
- [x] Random number generator
- [x] Temperature sensor
- [x] Ethernet
- [x] USB, USB 3.0 is broken with `CONFIG_PM=y`
- [x] DRM driver
- [x] NVDLA
- [x] Watchdog
- [x] 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

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

[patchram]: https://github.com/AsteroidOS/brcm-patchram-plus

## 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.
Loading