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

Adding SKB recycling patches for improving network performance #11

Closed
wants to merge 45 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
b865eb8
riscv: mm: Fix W+X mappings at boot
xhackerustc May 16, 2021
4482cc4
gpio: starfive-vic: Add StarFive VIC GPIO driver
huanfeng-sf Jan 7, 2021
470b9e4
drivers/tty/serial/8250: update driver for VIC7100
SaminGuo Jan 7, 2021
c9f0285
drivers/hw_random: Add Starfive VIC Random Number Generator driver
huanfeng-sf Jan 7, 2021
57954b0
drivers/hwmon: Add tempsensor hwmon driver for Starfive VIC7100
SaminGuo Feb 5, 2021
e0d5ab4
sifive/sifive_l2_cache: Add sifive_l2_flush64_range function
Jan 7, 2021
19bcf3d
sifive/sifive_l2_cache: Add Starfive support
Feb 15, 2021
61bb425
sifive/sifive_l2_cache: Add disabling IRQ option (workaround)
Feb 13, 2021
76d6038
drivers/pwm: Add SiFive PWM PTC driver
Jan 7, 2021
4d721f1
drivers/pwm/pwm-sifive-ptc: Clear PWM CNTR
Mar 15, 2021
ef5e088
drivers/dma: Add dw-axi-dmac-starfive driver for VIC7100
Jan 7, 2021
8b962ee
drivers/i2c: Improve Synopsys DesignWare I2C adapter driver for StarF…
Jan 7, 2021
e306a79
drivers/i2c: Add GPIO configuration for VIC7100.
Mar 13, 2021
47b391f
net: stmmac: Add dcache flush functions for JH7100
Jan 7, 2021
8fe4519
net: stmmac: Configure gtxclk based on speed
Apr 6, 2021
147b890
drivers/mmc/host/dw_mmc: Add dcache flush(VIC7100 ONLY).
Jan 6, 2021
1ab9c4c
drivers/usb: Add dcache flush(VIC7100 ONLY)
Jan 8, 2021
190a442
riscv/starfive: Add VIC7100 support
Jan 7, 2021
ff76d63
drivers/video/fbdev and drivers/media/platform: starfive drivers added
jackzhustf Jan 10, 2021
eb1c3c7
drivers/media and video: update fb driver(flush cache) and cam sensor…
jackzhustf Mar 5, 2021
7f5c1bd
drivers/video/fbdev/starfive: workaround for unavailable pointer of dtb
jackzhustf Mar 16, 2021
16f27d4
drivers/video/fbdev/starfive: fix compiler warnings
esmil May 6, 2021
cf692db
drivers/video/fbdev/starfive: improve error handling
esmil May 6, 2021
e8d35f2
drivers/video/fbdev/starfive: fix modpost build error (missing license)
sarnold May 13, 2021
bea178f
drivers/video/fbdev/starfive: fix fb bug about HDMI display
May 15, 2021
648003e
spi: cadence-quadspi: Allow compilation on RISC-V
esmil Apr 27, 2021
bf78e42
drivers/dma: Fix VIC7100 dw-axi-dmac-platform driver addition
mike-scott May 1, 2021
8d371cf
[HACK] mfd: tps65086: make interrupt line optional
esmil May 3, 2021
4c01a1e
power: reset: Add TPS65086 restart driver
esmil May 3, 2021
657d4af
riscv: dts: Add JH7100 and BeagleV Starlight support
Jan 22, 2021
584b0f7
[Not for upstream] Add build instructions
esmil May 5, 2021
b582a44
video: fbdev: starfive: FB_STARFIVE_HDMI_TDA998X depends on DRM_FBDEV…
geertu May 18, 2021
feadd18
video: fbdev: starfive: Fix frame buffer reserved memory resource con…
geertu May 18, 2021
dcac28c
starlight_defconfig: Enable hdmi output
esmil May 18, 2021
165818a
starlight_defconfig: Enable USB HID
esmil May 18, 2021
8c0ab46
starlight_defconfig: Disable unneeded CRYPTO_AUTHENC
esmil May 20, 2021
4f0e98e
starlight_defconfig: Disable legacy SBI support
esmil May 20, 2021
4457149
starlight_defconfig: Enable zram support
esmil May 20, 2021
6976247
sifive/sifive_l2_cache: Print a backtrace on out-of-range flushes
geertu May 21, 2021
a22fc12
drivers/usb: Don't flush NULL values
stffrdhrn May 21, 2021
e95c80b
mm: add a signature in struct page
teknoraver Mar 3, 2021
21dcf80
skbuff: add a parameter to __skb_frag_unref
teknoraver Oct 4, 2019
18728cc
page_pool: Allow drivers to hint on SKB recycling
apalos Oct 4, 2019
a4d097a
stmmac: recycle buffers
teknoraver May 21, 2021
99310d6
stmmac: use GFP_DMA32
teknoraver May 21, 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
132 changes: 132 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
# 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-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-starlight.dtb
append earlycon 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
- [ ] 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
- [ ] Framebuffer
- [ ] MIPI-DSI
- [ ] ISP
- [ ] MIPI-CSI
- [ ] Video Decode
- [ ] Video Encode
- [ ] NVDLA
- [ ] NNE50
- [ ] Vision DSP

#### Board

- [x] LED
- [x] PMIC / Reboot
- [x] Ethernet PHY
- [x] AP6236 Wifi
- [ ] AP6236 Bluetooth
- [ ] GD25LQ256D SPI flash
- [ ] HDMI, unknown since framebuffer driver is failing


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