Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
bb3945a
riscv: add ARCH_DMA_MINALIGN support
Aug 7, 2021
edcc56e
riscv: optimized memcpy
teknoraver Sep 29, 2021
ab6f606
riscv: optimized memmove
teknoraver Sep 29, 2021
eb2c9d6
riscv: optimized memset
teknoraver Sep 29, 2021
e703f92
riscv: dts: starfive: Group tuples in interrupt properties
geertu Nov 25, 2021
9b60ac8
riscv: dts: starfive: correct number of external interrupts
kettenis Jun 6, 2022
2822e5c
RISC-V: Add StarFive JH7100 audio clock node
esmil Nov 20, 2021
d14939a
dt-bindings: reset: Add StarFive JH7100 audio reset definitions
esmil Nov 20, 2021
c312448
dt-bindings: reset: Add starfive,jh7100-audrst bindings
esmil Dec 7, 2021
dbe6e8e
reset: Create subdirectory for StarFive drivers
esmil Nov 20, 2021
fb6a913
reset: starfive: Use 32bit I/O on 32bit registers
esmil Nov 24, 2021
642cf0d
reset: starfive: Add JH7100 audio reset driver
esmil Nov 20, 2021
2ad48f8
RISC-V: Add StarFive JH7100 audio reset node
esmil Nov 20, 2021
25fc503
clk: starfive: jh7100: Keep more clocks alive
esmil Oct 14, 2021
a09b77c
pinctrl: starfive: Serialize pinconf_generic calls
jianlonghuang May 18, 2022
c15315d
pinctrl: starfive: Reset pinmux settings
esmil Jul 17, 2021
cb36751
serial: 8250_dw: Add starfive,jh7100-hsuart compatible
esmil Oct 14, 2021
0bf57de
dt-bindings: hwmon: add starfive,jh7100-temp bindings
esmil Jun 6, 2021
1cf3c35
hwmon: (sfctemp) Add StarFive JH7100 temperature sensor
esmil Jun 6, 2021
e2454f3
watchdog: Add StarFive SI5 watchdog driver
Nov 17, 2021
6676781
hwrng: Add StarFive JH7100 Random Number Generator driver
huanfeng-sf Jan 7, 2021
c6e0ca8
dt-bindings: sifive-l2-cache: Support the StarFive JH7100 SoC
esmil Apr 5, 2022
d94a29c
soc: sifive: l2 cache: Convert to platform driver
esmil Nov 7, 2021
75f75d5
soc: sifive: l2 cache: Add StarFive JH7100 support
esmil Apr 5, 2022
a4285a1
soc: sifive: l2 cache: Add non-coherent DMA handling
esmil Jun 12, 2021
42dc203
RISC-V: Add non-coherent DMA support
esmil Jun 12, 2021
dc08c23
power: reset: tps65086: Allow building as a module
esmil Jul 3, 2022
8364e1d
drivers/tty/serial/8250: update driver for JH7100
Jan 7, 2021
5d11ef9
pwm: sifive-ptc: Add SiFive PWM PTC driver
Jan 7, 2021
3a70d82
[WIP] dt-bindings: dma: dw-axi-dmac: Increase DMA channel limit to 16
geertu May 27, 2021
436784a
dmaengine: dw-axi-dmac: Handle xfer start while non-idle
Nov 17, 2021
9ebd713
dmaengine: dw-axi-dmac: Add StarFive JH7100 support
Nov 17, 2021
2396093
net: phy: motorcomm: Add YT8521 support
WalkerChenL Nov 17, 2021
f671da9
net: phy: motorcomm: Add WIP YT8521 wake-on-lan code
WalkerChenL Nov 17, 2021
b443964
net: stmmac: Configure gtxclk based on speed
Apr 6, 2021
877a1c1
net: stmmac: use GFP_DMA32
teknoraver May 21, 2021
ead5a50
ASoC: starfive: Add StarFive JH7100 audio drivers
WalkerChenL Nov 17, 2021
797695f
drm/starfive: Add StarFive drm driver
Aug 31, 2021
f5e3714
[WIP] drm/starfive: Support DRM_FORMAT_XRGB8888
esmil Sep 22, 2021
cf57f4c
drm/i2c/tda998x: Hardcode register values for Starlight
Aug 31, 2021
db4fa8c
nvdla: add NVDLA driver
farzad64 Sep 21, 2018
54cdfbe
spi: cadence-quadspi: Allow compilation on RISC-V
esmil Apr 27, 2021
92f2e78
riscv: dts: Add full JH7100, Starlight and VisionFive support
esmil Oct 31, 2021
37b8597
[NOT-FOR-UPSTREAM] riscv: Add StarFive JH7100 Fedora defconfig
tekkamanninja Nov 15, 2021
4333f32
[NOT-FOR-UPSTREAM] Add build instructions
esmil May 5, 2021
8cfab50
drm/starfive: Fix improper SPDX comment style
JoseExposito Sep 5, 2022
04760d0
drm/starfive: Document mutex
JoseExposito Sep 5, 2022
61e606c
drm/starfive: drv: Remove commented code
JoseExposito Sep 5, 2022
c99f055
drm/starfive: crtc: Identation issues
JoseExposito Sep 7, 2022
d9bbd66
drm/starfive: encoder: Blank line issues
JoseExposito Sep 7, 2022
6de5f84
drm/starfive: Fix typo in LCDC_BACKGROUND
JoseExposito Sep 7, 2022
5f80adc
drm/starfive: Fix open parenthesis alignment
JoseExposito Sep 7, 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 @@ -51,7 +51,7 @@ properties:

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

resets:
maxItems: 1
Expand All @@ -74,14 +74,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 @@ -27,6 +27,7 @@ select:
enum:
- sifive,fu540-c000-ccache
- sifive,fu740-c000-ccache
- starfive,jh7100-ccache

required:
- compatible
Expand All @@ -37,6 +38,7 @@ properties:
- enum:
- sifive,fu540-c000-ccache
- sifive,fu740-c000-ccache
- starfive,jh7100-ccache
- const: cache

cache-block-size:
Expand Down
1 change: 1 addition & 0 deletions Documentation/hwmon/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,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 @@ -18153,6 +18153,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 @@ -19119,12 +19127,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