Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

riscv: dts: rename dts for BeagleV Starlight JH7100 #24

Closed
wants to merge 54 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
7df4a91
dt-bindings: usb: cdns,usb3: Fix interrupts order
geertu May 27, 2021
b6e4694
mmc: dw_mmc-pltfm: Remove unused <linux/clk.h>
geertu May 27, 2021
2302a75
riscv: mm: Fix W+X mappings at boot
xhackerustc May 16, 2021
0d8671d
mm: add a signature in struct page
teknoraver Mar 3, 2021
f9193c9
skbuff: add a parameter to __skb_frag_unref
teknoraver Oct 4, 2019
dc06f56
page_pool: Allow drivers to hint on SKB recycling
apalos Oct 4, 2019
0bed5fc
stmmac: recycle buffers
teknoraver May 21, 2021
20f3678
stmmac: use GFP_DMA32
teknoraver May 21, 2021
76ffc62
gpio: starfive-vic: Add StarFive VIC GPIO driver
huanfeng-sf Jan 7, 2021
fcf3721
drivers/tty/serial/8250: update driver for VIC7100
SaminGuo Jan 7, 2021
453d751
drivers/hw_random: Add Starfive VIC Random Number Generator driver
huanfeng-sf Jan 7, 2021
ff732cb
hwmon: (sfctemp) Add Starfive JH7100 temperature sensor
SaminGuo Feb 5, 2021
4ea4f7a
sifive/sifive_l2_cache: Add sifive_l2_flush64_range function
Jan 7, 2021
841ff8c
sifive/sifive_l2_cache: Add Starfive support
Feb 15, 2021
a9e2805
sifive/sifive_l2_cache: Add disabling IRQ option (workaround)
Feb 13, 2021
b71b73f
sifive/sifive_l2_cache: Print a backtrace on out-of-range flushes
geertu May 21, 2021
9c32e9e
drivers/pwm: Add SiFive PWM PTC driver
Jan 7, 2021
e224415
drivers/pwm/pwm-sifive-ptc: Clear PWM CNTR
Mar 15, 2021
80969dd
drivers/dma: Add dw-axi-dmac-starfive driver for VIC7100
Jan 7, 2021
a776666
drivers/i2c: Improve Synopsys DesignWare I2C adapter driver for StarF…
Jan 7, 2021
1586e04
drivers/i2c: Add GPIO configuration for VIC7100.
Mar 13, 2021
e2418d1
net: stmmac: Add dcache flush functions for JH7100
Jan 7, 2021
abe43ef
net: stmmac: Configure gtxclk based on speed
Apr 6, 2021
3d848a5
drivers/mmc/host/dw_mmc: Add dcache flush(VIC7100 ONLY).
Jan 6, 2021
4442499
drivers/usb: Add dcache flush(VIC7100 ONLY)
Jan 8, 2021
cd9bd81
drivers/usb: Don't flush NULL values
stffrdhrn May 21, 2021
9881824
riscv/starfive: Add VIC7100 support
Jan 7, 2021
e7a711e
drivers/video/fbdev and drivers/media/platform: starfive drivers added
jackzhustf Jan 10, 2021
ee35b16
drivers/media and video: update fb driver(flush cache) and cam sensor…
jackzhustf Mar 5, 2021
c179d3f
video: fbdev: starfive: workaround for unavailable pointer of dtb
jackzhustf Mar 16, 2021
5b7437a
video: fbdev: starfive: fix compiler warnings
esmil May 6, 2021
487773d
video: fbdev: starfive: improve error handling
esmil May 6, 2021
f888440
video: fbdev: starfive: fix modpost build error (missing license)
sarnold May 13, 2021
d7781c4
video: fbdev: starfive: fix fb bug about HDMI display
May 15, 2021
54217f2
video: fbdev: starfive: FB_STARFIVE_HDMI_TDA998X depends on DRM_FBDEV…
geertu May 18, 2021
1d075fe
video: fbdev: starfive: Fix frame buffer reserved memory resource con…
geertu May 18, 2021
73edad7
spi: cadence-quadspi: Allow compilation on RISC-V
esmil Apr 27, 2021
41616ec
drivers/dma: Fix VIC7100 dw-axi-dmac-platform driver addition
mike-scott May 1, 2021
53498cf
[HACK] mfd: tps65086: make interrupt line optional
esmil May 3, 2021
1d8c8ef
power: reset: Add TPS65086 restart driver
esmil May 3, 2021
460b4e7
[WIP] dt-bindings: dma: dw-axi-dmac: Increase DMA channel limit to 16
geertu May 27, 2021
6e5931d
riscv: dts: Add JH7100 and BeagleV Starlight support
Jan 22, 2021
d6cc5db
[Not for upstream] Add build instructions
esmil May 5, 2021
ef95a87
dt-bindings: add StarFive Technology Co. Ltd.
pdp7 May 31, 2021
a6d9548
dt-bindings: gpio: add starfive,jh7100-gpio bindings
pdp7 May 31, 2021
58cfdc8
gpio: starfive-jh7100: rename from VIC to JH7100
pdp7 May 30, 2021
1286ba3
gpio: starfive-jh7100: fix checkpatch warnings
pdp7 May 30, 2021
6597905
gpio: starfive-jh7100: add SPDX-License-Identifier
pdp7 May 31, 2021
8590af8
gpio: starfive-jh7100: rename gpio compatible
pdp7 May 30, 2021
d567ae8
riscv: dts: starfive-jh7100: rename gpio compatible
pdp7 May 30, 2021
7ed9759
riscv: dts: starfive-jh7100: add SPDX-License-Identifier
pdp7 May 30, 2021
76e4a97
riscv: dts: starfive-jh7100: remove reg-names from gpio node
pdp7 May 31, 2021
b6f42e2
riscv: dts: rename dts for BeagleV Starlight JH7100
pdp7 May 31, 2021
a39b698
[Not for upstream] update instructions for dtb rename
pdp7 May 31, 2021
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

snps,dma-masters:
description: |
Expand All @@ -71,14 +71,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
65 changes: 65 additions & 0 deletions Documentation/devicetree/bindings/gpio/starfive,jh7100-gpio.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/gpio/starfive,jh7100-gpio.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: StarFive JH7100 GPIO controller

maintainers:
- Huan Feng <huan.feng@starfivetech.com>
- Drew Fustini <drew@beagleboard.org>

properties:
compatible:
items:
- const: starfive,jh7100-gpio

reg:
maxItems: 1

interrupts:
description:
Interrupt mapping, one per GPIO. Maximum 32 GPIOs.
minItems: 1
maxItems: 32

gpio-controller: true

"#gpio-cells":
const: 2

interrupt-controller: true

"#interrupt-cells":
const: 2

required:
- compatible
- reg
- interrupts
- interrupt-controller
- "#interrupt-cells"
- "#gpio-cells"
- gpio-controller

additionalProperties: false

examples:
- |
soc {
#address-cells = <2>;
#size-cells = <2>;

gpio@11910000 {
compatible = "starfive,jh7100-gpio";
reg = <0x0 0x11910000 0x0 0x10000>;
gpio-controller;
#gpio-cells = <2>;
interrupt-controller;
#interrupt-cells = <2>;
interrupts = <32>;
};
};

...
2 changes: 1 addition & 1 deletion Documentation/devicetree/bindings/usb/cdns,usb3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ properties:
interrupts:
minItems: 3
items:
- description: OTG/DRD controller interrupt
- description: XHCI host controller interrupt
- description: Device controller interrupt
- description: OTG/DRD controller interrupt
- description: interrupt used to wake up core, e.g when usbcmd.rs is
cleared by xhci core, this interrupt is optional

Expand Down
2 changes: 2 additions & 0 deletions Documentation/devicetree/bindings/vendor-prefixes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1085,6 +1085,8 @@ patternProperties:
(formerly part of MStar Semiconductor, Inc.)
"^st,.*":
description: STMicroelectronics
"^starfive,.*":
description: StarFive Technology Co. Ltd.
"^starry,.*":
description: Starry Electronic Technology (ShenZhen) Co., LTD
"^startek,.*":
Expand Down
133 changes: 133 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
# Linux kernel for the BeagleV Starlight

## What is this?

The [BeagleV Starlight][bborg] board is a new Linux-capable 64bit RISC-V
development board. It has not shipped yet, but [beta versions][beta] are out to
developers. Consequently the board is not yet supported by upstream Linux. This
tree is meant to collect all the in-development patches for running Linux on
the board.

[bborg]: https://beagleboard.org/beaglev
[beta]: https://github.com/beagleboard/beaglev-starlight

## 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
board using:
```shell
make -j8 ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- starlight_defconfig
```

There is nothing magic about this configuration other than it has all the
drivers enabled that are working for the hardware on the board. 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-beaglev-starlight.dtb
```
These two files should be copied to the boot partition on the SD card. That is
onto the same file system that contains the `extlinux/extlinux.conf`. On the
default Fedora image this is mounted at `/boot`.

Now add the following entry to the `extlinux/extlinux.conf` file:
```
label My New Kernel
kernel /Image
fdt /jh7100-beaglev-starlight.dtb
append earlycon console=ttyS0,115200n8 root=/dev/mmcblk0p2 rootwait stmmac.chain_mode=1
```

This assumes your root file system is at `/dev/mmcblk0p2` which it is on the
default Fedora image. Also if your kernel is very big it might be beneficial to
use the compressed `Image.gz` rather than the uncompressed `Image`.

The `starlight_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

- [x] GPIO
- [x] Serial port
- [x] I2C
- [x] SPI
- [x] MMC / SDIO / SD card
- [x] Random number generator
- [x] Temperature sensor
- [x] Ethernet, though a little flaky and `stmmac.chain_mode=1` needed on the cmdline
- [x] Framebuffer, fbdev driver so not upstreamable
- [ ] Clock tree, statically set up by u-boot
- [ ] Pinctrl/Pinmux, statically set up by u-boot
- [ ] Watchdog
- [ ] USB, USB 2.0 seems to work ok, but USB 3.0 is very flaky / broken
- [ ] Security Engine
- [ ] MIPI-DSI
- [ ] ISP
- [ ] MIPI-CSI
- [ ] Video Decode
- [ ] Video Encode
- [ ] NVDLA
- [ ] NNE50
- [ ] Vision DSP

#### Board

- [x] LED
- [x] PMIC / Reboot
- [x] Ethernet PHY
- [x] HDMI, working with [some screens][hdmi]
- [x] AP6236 Wifi
- [ ] AP6236 Bluetooth
- [ ] GD25LQ256D SPI flash

[hdmi]: https://forum.beagleboard.org/t/hdmi-displays-compatible-list/

## 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 I think of this tree mostly as a collection of patches that will hopefully
mature enough to be submitted upstream. So expect regular rebases.
50 changes: 50 additions & 0 deletions arch/riscv/Kconfig.socs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,56 @@ config SOC_SIFIVE
help
This enables support for SiFive SoC platform hardware.

config SOC_STARFIVE_VIC7100
bool "StarFive VIC7100 SoC"
select SOC_SIFIVE
select OF_RESERVED_MEM
select SIFIVE_L2
select SIFIVE_L2_FLUSH
select DW_AXI_DMAC_STARFIVE
select GPIO_STARFIVE_VIC
select HW_RANDOM_STARFIVE_VIC
help
This enables support for StarFive VIC7100 SoC Platform Hardware.

menu "StarFive VIC7100 SoC Debug Option"
depends on SOC_STARFIVE_VIC7100

config FPGA_GMAC_FLUSH_DDR
bool "VIC7100 SOC GMAC description and packet buffer flush"
depends on SOC_STARFIVE_VIC7100
depends on STMMAC_ETH
default y if SOC_STARFIVE_VIC7100
help
enable VIC7100 GMAC description and packet buffer flush

config MMC_DW_FLUSH_DDR
bool "VIC7100 SOC DW MMC buffer flush"
depends on SOC_STARFIVE_VIC7100
depends on MMC_DW
default y if SOC_STARFIVE_VIC7100
help
enable VIC7100 DW MMC description and data buffer flush

config USB_CDNS3_HOST_FLUSH_DMA
bool "Cadence USB3 host controller flush dma memery"
depends on USB
depends on USB_CDNS3
depends on SOC_STARFIVE_VIC7100
default y if SOC_STARFIVE_VIC7100
help
enable VIC7100 DW USB CDNS3 driver data buffer flush

config SOC_STARFIVE_VIC7100_I2C_GPIO
bool "VIC7100 SOC I2C GPIO init"
depends on I2C_DESIGNWARE_CORE
depends on SOC_STARFIVE_VIC7100
default y if SOC_STARFIVE_VIC7100
help
enable VIC7100 DW I2C GPIO init in Synopsys DesignWare master driver

endmenu

config SOC_VIRT
bool "QEMU Virt Machine"
select CLINT_TIMER if RISCV_M_MODE
Expand Down
2 changes: 1 addition & 1 deletion arch/riscv/boot/dts/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0
subdir-y += sifive
subdir-y += sifive starfive
subdir-$(CONFIG_SOC_CANAAN_K210_DTB_BUILTIN) += canaan
subdir-y += microchip

Expand Down
2 changes: 2 additions & 0 deletions arch/riscv/boot/dts/starfive/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# SPDX-License-Identifier: GPL-2.0
dtb-$(CONFIG_SOC_STARFIVE_VIC7100) += jh7100-beaglev-starlight.dtb
Loading