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

rename defconfig for beaglev starlight #20

Closed
wants to merge 63 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
f5397c3
riscv: mm: add _PAGE_LEAF macro
sunnanyong Apr 30, 2021
141682f
riscv: mm: make pmd_bad() check leaf condition
sunnanyong Apr 30, 2021
c3b2d67
riscv: mm: add param stride for __sbi_tlb_flush_range
sunnanyong Apr 30, 2021
e88b333
riscv: mm: add THP support on 64-bit
sunnanyong Apr 30, 2021
3332f41
riscv: mremap speedup - enable HAVE_MOVE_PUD and HAVE_MOVE_PMD
xhackerustc Apr 16, 2021
8f3e136
riscv: mm: Remove setup_zero_page()
May 7, 2021
db75674
riscv: enable generic PCI resource mapping
semihalf-kardach-stanislaw Apr 12, 2021
f842f5f
riscv: Move setup_bootmem into paging_init
May 10, 2021
50bae95
riscv: mm: Drop redundant _sdata and _edata declaration
May 14, 2021
8237c52
riscv: Optimize switch_mm by passing "cpu" to flush_icache_deferred()
xhackerustc May 11, 2021
37a7a2a
riscv: Turn has_fpu into a static key if FPU=y
xhackerustc May 12, 2021
8c9f494
riscv: kprobes: Remove redundant kprobe_step_ctx
xhackerustc Apr 18, 2021
3df952a
riscv: Add __init section marker to some functions again
xhackerustc May 16, 2021
0106235
riscv: mm: init: Consolidate vars, functions
xhackerustc May 16, 2021
7fa865f
riscv: TRANSPARENT_HUGEPAGE: depends on MMU
rddunlap May 25, 2021
cba43c3
riscv: Use global mappings for kernel pages
guoren83 May 26, 2021
91d02ad
Merge remote-tracking branch 'riscv/for-next' into starlight
esmil Jun 6, 2021
b594590
dt-bindings: usb: cdns,usb3: Fix interrupts order
geertu May 27, 2021
6535d6f
mmc: dw_mmc-pltfm: Remove unused <linux/clk.h>
geertu May 27, 2021
c54debc
dt-bindings: add StarFive Technology Co. Ltd.
pdp7 May 31, 2021
2c23db8
[WIP] dt-bindings: clock: starfive: Add preliminary JH7100 bindings
geertu Jun 1, 2021
e0369ea
[WIP] dt-bindings: clock: starfive: Add preliminary JH7100 Clock Defi…
geertu Jun 1, 2021
09a73a6
[WIP] clk: starfive: Add preliminary JH7100 Clock Generator Driver
geertu Jun 1, 2021
0fa6dd2
dt-bindings: gpio: add starfive,jh7100-gpio bindings
pdp7 May 31, 2021
02c6953
gpio: starfive-jh7100: Add StarFive JH7100 GPIO driver
huanfeng-sf Jan 7, 2021
173bb4d
[WIP] dt-bindings: dma: dw-axi-dmac: Increase DMA channel limit to 16
geertu May 27, 2021
3cdd633
drivers/tty/serial/8250: update driver for VIC7100
SaminGuo Jan 7, 2021
9220cd3
drivers/hw_random: Add Starfive VIC Random Number Generator driver
huanfeng-sf Jan 7, 2021
e51061c
dt-bindings: hwmon: add starfive,jh7100-temp bindings
esmil Jun 6, 2021
057ab45
hwmon: (sfctemp) Add StarFive JH7100 temperature sensor
esmil Jun 6, 2021
45f9d2b
sifive/sifive_l2_cache: Add sifive_l2_flush64_range function
Jan 7, 2021
f1c032d
sifive/sifive_l2_cache: Add Starfive support
Feb 15, 2021
cfa6ef6
sifive/sifive_l2_cache: Add disabling IRQ option (workaround)
Feb 13, 2021
e6cca64
sifive/sifive_l2_cache: Print a backtrace on out-of-range flushes
geertu May 21, 2021
d313c5c
drivers/pwm: Add SiFive PWM PTC driver
Jan 7, 2021
338e5ed
drivers/pwm/pwm-sifive-ptc: Clear PWM CNTR
Mar 15, 2021
1911a8a
drivers/dma: Add dw-axi-dmac-starfive driver for VIC7100
Jan 7, 2021
62a62eb
drivers/dma: Fix VIC7100 dw-axi-dmac-platform driver addition
mike-scott May 1, 2021
2eab704
drivers/i2c: Improve Synopsys DesignWare I2C adapter driver for StarF…
Jan 7, 2021
0914fe9
drivers/i2c: Add GPIO configuration for VIC7100.
Mar 13, 2021
f4d8984
net: stmmac: use GFP_DMA32
teknoraver May 21, 2021
d4c4044
net: stmmac: Add dcache flush functions for JH7100
Jan 7, 2021
3511b5e
net: stmmac: Configure gtxclk based on speed
Apr 6, 2021
f97d4ab
drivers/mmc/host/dw_mmc: Add dcache flush(VIC7100 ONLY).
Jan 6, 2021
920613f
drivers/usb: Add dcache flush(VIC7100 ONLY)
Jan 8, 2021
84ee4f5
riscv/starfive: Add VIC7100 support
Jan 7, 2021
b4e9da5
drivers/video/fbdev and drivers/media/platform: starfive drivers added
jackzhustf Jan 10, 2021
e84355d
drivers/media and video: update fb driver(flush cache) and cam sensor…
jackzhustf Mar 5, 2021
3fe9608
video: fbdev: starfive: workaround for unavailable pointer of dtb
jackzhustf Mar 16, 2021
e5f2664
video: fbdev: starfive: fix compiler warnings
esmil May 6, 2021
f41510d
video: fbdev: starfive: improve error handling
esmil May 6, 2021
4707f1e
video: fbdev: starfive: fix modpost build error (missing license)
sarnold May 13, 2021
c4840af
video: fbdev: starfive: fix fb bug about HDMI display
May 15, 2021
ff2c534
video: fbdev: starfive: FB_STARFIVE_HDMI_TDA998X depends on DRM_FBDEV…
geertu May 18, 2021
f4ea901
video: fbdev: starfive: Fix frame buffer reserved memory resource con…
geertu May 18, 2021
1494f04
spi: cadence-quadspi: Allow compilation on RISC-V
esmil Apr 27, 2021
560bb03
[HACK] mfd: tps65086: make interrupt line optional
esmil May 3, 2021
66a1c63
power: reset: Add TPS65086 restart driver
esmil May 3, 2021
56a41a1
riscv: dts: Add JH7100 and BeagleV Starlight support
Jan 22, 2021
83dba1f
[Not for upstream] Add build instructions
esmil May 5, 2021
b1c8c15
riscv: configs: rename beaglev starlight defconfig
pdp7 Jun 8, 2021
0af286b
[Not for upstream] update build instructions
pdp7 Jun 8, 2021
ad0a1f8
riscv: configs: change LOCALVERSION for beaglev starlight
pdp7 Jun 8, 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/clock/starfive,jh7100-clkgen.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: StarFive JH7100 Clock Generator

maintainers:
- FIXME <someone@starfivetech.com>
- Geert Uytterhoeven <geert@linux-m68k.org>

properties:
compatible:
const: starfive,jh7100-clkgen

reg:
maxItems: 1

clocks:
items:
- description: Main clock source (default 25 MHz)
- description: Application-specific clock source (12-27 MHz)

clock-names:
items:
- const: osc0
- const: osc1

'#clock-cells':
const: 1
description:
See <dt-bindings/clock/starfive-jh7100-clkgen.h> for valid indices.

required:
- compatible
- reg
- clocks
- clock-names
- '#clock-cells'

additionalProperties: false

examples:
- |
clkgen: clock-controller@11800000 {
compatible = "starfive,jh7100-clkgen";
reg = <0x11800000 0x10000>;
clocks = <&osc0_clk>, <&osc1_clk>;
clock-names = "osc0", "osc1";
#clock-cells = <1>;
};
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
60 changes: 60 additions & 0 deletions Documentation/devicetree/bindings/gpio/starfive,jh7100-gpio.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# 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:
- |
gpio@11910000 {
compatible = "starfive,jh7100-gpio";
reg = <0x11910000 0x10000>;
gpio-controller;
#gpio-cells = <2>;
interrupt-controller;
#interrupt-cells = <2>;
interrupts = <32>;
};

...
43 changes: 43 additions & 0 deletions Documentation/devicetree/bindings/hwmon/starfive,jh7100-temp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# 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

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

interrupts:
maxItems: 1

required:
- compatible
- reg
- interrupts

additionalProperties: false

examples:
- |
tmon: tmon@124a0000 {
compatible = "starfive,jh7100-temp";
reg = <0x124a0000 0x10000>;
#thermal-sensor-cells = <0>;
interrupts = <122>;
};
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- beaglev_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 `beaglev_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, WIP clock driver
- [ ] 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.
3 changes: 3 additions & 0 deletions arch/riscv/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ config RISCV
select HAVE_KPROBES
select HAVE_KPROBES_ON_FTRACE
select HAVE_KRETPROBES
select HAVE_MOVE_PMD
select HAVE_MOVE_PUD
select HAVE_PCI
select HAVE_PERF_EVENTS
select HAVE_PERF_REGS
Expand All @@ -104,6 +106,7 @@ config RISCV
select SYSCTL_EXCEPTION_TRACE
select THREAD_INFO_IN_TASK
select UACCESS_MEMCPY if !MMU
select HAVE_ARCH_TRANSPARENT_HUGEPAGE if 64BIT && MMU

config ARCH_MMAP_RND_BITS_MIN
default 18 if 64BIT
Expand Down
Loading