Skip to content

Commit

Permalink
overlays-11-add-rk3308bs(:1)
Browse files Browse the repository at this point in the history
Original-Subject: [ARCHEOLOGY] Rockpis wifi fixes (#4008)
> X-Git-Archeology: > recovered message: > * RockPI-S board has no video I/O
> X-Git-Archeology: > recovered message: > * udev rule to fix MAC address of iface based on UUID
> X-Git-Archeology: > recovered message: > Deals with WiFi chip lacking any EEPROM to store its unique Ethernet MAC address
> X-Git-Archeology: > recovered message: > Generic mechanism -- could be utilized for other boards having similar issues
> X-Git-Archeology: > recovered message: > * Handy Device Tree overlays for the RockPI S
> X-Git-Archeology: > recovered message: > Use armbian-add-overlay to install these
> X-Git-Archeology: > recovered message: > Reduce CPU voltage for the RK3308 B-S
> X-Git-Archeology: > recovered message: > Option to overclock RK3308 B-S to 1.3Ghz
> X-Git-Archeology: > recovered message: > Increase SDIO clock rate from 1Mhz to 10Mhz
> X-Git-Archeology: > recovered message: > This increases WiFi throughput from 300K bytes/s to 2.4M bytes/s
> X-Git-Archeology: > recovered message: > * corrected comment
> X-Git-Archeology: > recovered message: > * No longer repeat standard opp's in this dts
> X-Git-Archeology: > recovered message: > Require that the standard bs dts already be installed
> X-Git-Archeology: > recovered message: > * User README for adding RockPI-S board variant specific dts overlays
> X-Git-Archeology: > recovered message: > * "enabled" --> "okay"
> X-Git-Archeology: > recovered message: > * added mention of sdnand.dts, fixed typo
> X-Git-Archeology: > recovered message: > * added p2p0 to interfaces whose MAC address should be "fixed"
> X-Git-Archeology: > recovered message: > * RK3308 CPU serial number in nvmem replaces UUID for derivation of fixed MAC addr
> X-Git-Archeology: > recovered message: > Restored use of install utility
> X-Git-Archeology: > recovered message: > * Use RK3308 specific CPU serial number
> X-Git-Archeology: > recovered message: > rather than rootfs UUID
> X-Git-Archeology: > recovered message: > * remove generic fixMACaddress
> X-Git-Archeology: > recovered message: > * Install fixMACaddr file-by-file via install utility
> X-Git-Archeology: > recovered message: > * Drive SDIO bus signals faster
> X-Git-Archeology: > recovered message: > setting RK3308_SOC_CON0_VCCIO3 reduces signal rise/fall times to WiFi SDIO chip
> X-Git-Archeology: > recovered message: > from 30ns to 5ns.
> X-Git-Archeology: > recovered message: > This odd fix forward ported from legacy kernel.
> X-Git-Archeology: > recovered message: > Allows Rock Pi-S WiFi to operate at full speed.
> X-Git-Archeology: > recovered message: > * Set RK3308 I/O voltage domains before SDIO initializes
> X-Git-Archeology: > recovered message: > This patch moves responibility form the io-domain to the pinctrl driver because
> X-Git-Archeology: > recovered message: > the io-domain driver is probed after the SDIO devices are discovered.
> X-Git-Archeology: > recovered message: > This was causing multiple SDIO I/O failures during boot.
> X-Git-Archeology: > recovered message: > A new pinctrl property is added:
> X-Git-Archeology: > recovered message: > io-1v8-domains
> X-Git-Archeology: > recovered message: > is a u32 interpreted as a bit mask where each set bit corresponds to
> X-Git-Archeology: > recovered message: > a 1.8V I/O domain (as opposed to the default of 3.3V for I/O)
> X-Git-Archeology: > recovered message: > The mask is writted to the RK3308_SOC_CON0 GRF register
> X-Git-Archeology: > recovered message: > (once) when the pinctrl driver starts
> X-Git-Archeology: > recovered message: > The default mask is 0x10 where only I/O domain 4 runs at 1.8V
> X-Git-Archeology: > recovered message: > This is necessary for the RockPI-S to run the SDIO clock at high (50Mhz) speed
> X-Git-Archeology: > recovered message: > * align whitespace
> X-Git-Archeology: > recovered message: > * factored rk3308bs overlays out up sdio speedup patch
> X-Git-Archeology: > recovered message: > * factored dts for RK3308 iodomains and pinctrl patches out of speedup patch
> X-Git-Archeology: > recovered message: > * remains of sdio speedup patch merely add iodomains support for rk3308
> X-Git-Archeology: > recovered message: > * factored rockpis dts modification out from rk3308 io voltage domains
> X-Git-Archeology: > recovered message: > replaced rk3308 support from iodomains with
> X-Git-Archeology: > recovered message: > new io-voltage-domains property added to pinctrl
> X-Git-Archeology: > recovered message: > io-voltage-domains specific to rk3308 for now, others SOCs may be added later.
> X-Git-Archeology: > recovered message: > * add sequence numbering to names of rk3308 patches
> X-Git-Archeology: > recovered message: > * corrected tab alignment
> X-Git-Archeology: - Revision d3a3afe3850861ceaeb44f3631251c764a28cd43: armbian/build@d3a3afe
> X-Git-Archeology:   Date: Thu, 13 Oct 2022 18:34:43 +0200
> X-Git-Archeology:   From: brentr <brent@mbari.org>
> X-Git-Archeology:   Subject: Rockpis wifi fixes (#4008)
> X-Git-Archeology:
> X-Git-Archeology: - Revision 6765f734cc4a22aeaa9f99a3ad28c8c322de26f6: armbian/build@6765f73
> X-Git-Archeology:   Date: Tue, 25 Oct 2022 11:26:51 +0200
> X-Git-Archeology:   From: Igor Pecovnik <igorpecovnik@users.noreply.github.com>
> X-Git-Archeology:   Subject: Bump rockchip64 edge to 6.0.y (#4337)
> X-Git-Archeology:
> X-Git-Archeology: - Revision 92f1a22d76b987afa7ba555d5b509adc51d689e7: armbian/build@92f1a22
> X-Git-Archeology:   Date: Fri, 16 Dec 2022 13:38:13 +0100
> X-Git-Archeology:   From: Igor Pecovnik <igorpecovnik@users.noreply.github.com>
> X-Git-Archeology:   Subject: Re-add rockchip64 6.0 patches (#4575)
> X-Git-Archeology:
> X-Git-Archeology: - Revision 34ae84fac5d0b66a1ab2d1e51534b7beb13ef245: armbian/build@34ae84f
> X-Git-Archeology:   Date: Fri, 05 May 2023 14:22:00 +0200
> X-Git-Archeology:   From: amazingfate <liujianfeng1994@gmail.com>
> X-Git-Archeology:   Subject: bump rockchip64 edge to v6.3
> X-Git-Archeology:
X-Armbian: Patch-File: overlays-11-add-rk3308bs
X-Armbian: Patch-File-Counter: 1
X-Armbian: Patch-Rel-Directory: patch/kernel/archive/rockchip64-6.3
X-Armbian: Patch-Type: kernel
X-Armbian: Patch-Root-Type: core
X-Armbian: Patch-Sub-Type: common
X-Armbian: Original-Subject: [ARCHEOLOGY] Rockpis wifi fixes (#4008)
  • Loading branch information
brentr authored and Armbian AutoPatcher committed Oct 13, 2022
1 parent 94bc393 commit 7db8b31
Show file tree
Hide file tree
Showing 7 changed files with 152 additions and 1 deletion.
6 changes: 5 additions & 1 deletion arch/arm64/boot/dts/rockchip/overlay/Makefile
Expand Up @@ -19,7 +19,11 @@ dtbo-$(CONFIG_ARCH_ROCKCHIP) += \
rockchip-rk3318-box-wlan-ext.dtbo \
rockchip-rk3318-box-wlan-ap6330.dtbo \
rockchip-rk3318-box-cpu-hs.dtbo \
rockchip-rk3318-box-emmc-hs200.dtbo
rockchip-rk3318-box-emmc-hs200.dtbo \
rk3308-bs.dtbo rk3308-bs@1.3ghz.dtbo \
rk3308-sdio@10mhz.dtbo rk3308-sdio@4mhz.dtbo \
rk3308-emmc.dtbo


scr-$(CONFIG_ARCH_ROCKCHIP) += \
rockchip-fixup.scr
Expand Down
41 changes: 41 additions & 0 deletions arch/arm64/boot/dts/rockchip/overlay/README.rockchip-overlays
Expand Up @@ -10,6 +10,10 @@ rockchip (Rockchip)

- i2c7, i2c8, pcie-gen2, spi-spidev, uart4, w1-gpio

for RK3308 (Rock PI-S)

- rk3308bs rk3308bs-1.3ghz sdio-10mhz sdio-4mhz emmc

### Overlay details:

### i2c7
Expand Down Expand Up @@ -166,3 +170,40 @@ wifi + bt chip and clones.
### rk3318-box-cpu-hs

Enable additional cpu "high-speed" bins up to 1.3ghz

**********************************
Details for Rock Pi-S overlays (7 Oct 2022):

V1.3 of the RockPi-S uses a the B-S variant of the RK3308 that is optimized
for lower core voltages than the older chips on the V1.2 and V1.1 boards.
All V1.3 boards should apply the
### rk3308-bs
overlay to lower the core voltages to reduce power consumption.
This also enables operation at 1.1Ghz.

Optionally, V1.3 boards may add the
### rk3308-bs@1.3ghz
to overclock the B-S CPU to 1.3Ghz.
Add the rk3308bs-rock-pi-s-1.3Ghz overlay *after adding* rockchip-rk3308bs

===========
Install the following overlays only on older (unpatched) mainline kernels:

Older mainline kernels disable the Rock Pi S built-in SDNAND (EMMC)
### rk3308-emmc
enables your SDNAND chip. It is OK to install for boards that lack the SDNAND.

The legacy 4.4 and this mainline kernel drive the SDIO clock at 50Mhz to provide
maximum WiFi throughput. However...

Older versions of the Mainline kernel drive the SDIO clock at only 1Mhz
This reduces WiFi throughput to < 500kB/s !

### rk3308-sdio@10mhz
increases the SDIO clock to 10Mhz, providing about 2.4MB/s WiFi throughput.

### rk3308-sdio@4mhz
increases the SDIO clock to only 4Mhz, providing about 1MB/s WiFi throughput.
use this only if 10Mhz SDIO clock is unstable

Note that older mainline kernels cannot drive the SDIO clock faster than 10Mhz.
39 changes: 39 additions & 0 deletions arch/arm64/boot/dts/rockchip/overlay/rk3308-bs.dts
@@ -0,0 +1,39 @@
//Adjustments for Rockchip RK3308-BS suffix SOC
//https://dl.radxa.com/rockpis/docs/sw/RK3308B-S&RK3308H-S_Software_Compatibility_Introduction_V1.0.0_20211016.pdf

/dts-v1/;
/plugin/;

/ {
fragment@0 {
target = <&cpu0_opp_table>;
__overlay__ {
opp-408000000 {
opp-hz = /bits/ 64 <408000000>;
opp-microvolt = <850000 850000 1200000>;
clock-latency-ns = <40000>;
opp-suspend;
};
opp-600000000 {
opp-hz = /bits/ 64 <600000000>;
opp-microvolt = <900000 900000 1200000>;
clock-latency-ns = <40000>;
};
opp-816000000 {
opp-hz = /bits/ 64 <816000000>;
opp-microvolt = <1000000 1000000 1200000>;
clock-latency-ns = <40000>;
};
opp-1008000000 {
opp-hz = /bits/ 64 <1008000000>;
opp-microvolt = <1125000 1125000 1200000>;
clock-latency-ns = <40000>;
};
opp-1104000000 {
opp-hz = /bits/ 64 <1104000000>;
opp-microvolt = <1200000 1200000 1200000>;
clock-latency-ns = <40000>;
};
};
};
};
26 changes: 26 additions & 0 deletions arch/arm64/boot/dts/rockchip/overlay/rk3308-bs@1.3ghz.dts
@@ -0,0 +1,26 @@
//Overclock the Rockchip RK3308-BS suffix SOC to 1.3 Ghz
// assumes rk3308bs-rock-pi-s.dts overlay has already been added

/dts-v1/;
/plugin/;

/ {
fragment@0 {
target = <&cpu0_opp_table>;
__overlay__ {
//the following are unsupported, overclocked operating points
opp-1200000000 {
opp-hz = /bits/ 64 <1200000000>;
opp-microvolt = <1200000 1200000 1200000>;
clock-latency-ns = <40000>;
status = "okay";
};
opp-1296000000 {
opp-hz = /bits/ 64 <1296000000>;
opp-microvolt = <1200000 1200000 1200000>;
clock-latency-ns = <40000>;
status = "okay";
};
};
};
};
13 changes: 13 additions & 0 deletions arch/arm64/boot/dts/rockchip/overlay/rk3308-emmc.dts
@@ -0,0 +1,13 @@
//For RockPI-S: enable SDnand chip

/dts-v1/;
/plugin/;

/ {
fragment@0 {
target = <&emmc>;
__overlay__ {
status = "okay";
};
};
};
14 changes: 14 additions & 0 deletions arch/arm64/boot/dts/rockchip/overlay/rk3308-sdio@10mhz.dts
@@ -0,0 +1,14 @@
//For RockPI-S: Increase SDIO Max Frequency from 1Mhz to 10Mhz
//Increases RTL8723-BS WiFi's throughput from 300KB/s to 2.4MB/s

/dts-v1/;
/plugin/;

/ {
fragment@0 {
target = <&sdio>;
__overlay__ {
max-frequency = <10000000>;
};
};
};
14 changes: 14 additions & 0 deletions arch/arm64/boot/dts/rockchip/overlay/rk3308-sdio@4mhz.dts
@@ -0,0 +1,14 @@
//For RockPI-S: Increase SDIO Max Frequency from 1Mhz to 4Mhz
//Increases RTL8723-BS WiFi's throughput from 300KB/s to 1MB/s

/dts-v1/;
/plugin/;

/ {
fragment@0 {
target = <&sdio>;
__overlay__ {
max-frequency = <4000000>;
};
};
};

0 comments on commit 7db8b31

Please sign in to comment.