diff mbox series

[OpenWrt-Devel,1/1] ramips: mt7621: use higher SPI clock speed on Mikrotik rbm11g and rbm33g

Message ID 20200408173210.3904236-2-t.schramm@manjaro.org
State Changes Requested, archived
Headers show
Series Increase SPI speed on Mikrotik rbm11g and rbm33g | expand

Commit Message

Tobias Schramm April 8, 2020, 5:32 p.m. UTC
Previously the dts were using a value determined by empirical testing,
because of a spi driver/clock bug. The bug was fixed quite some time
ago. 33 MHz is the default clock frequency used by RouterBOOT and thus
safe.

Signed-off-by: Tobias Schramm <t.schramm@manjaro.org>
---
 target/linux/ramips/dts/mt7621_mikrotik_rbm11g.dts | 4 ++--
 target/linux/ramips/dts/mt7621_mikrotik_rbm33g.dts | 7 ++++---
 2 files changed, 6 insertions(+), 5 deletions(-)

Comments

Chuanhong Guo April 9, 2020, 11:07 a.m. UTC | #1
Hi!

On Thu, Apr 9, 2020 at 1:32 AM Tobias Schramm <t.schramm@manjaro.org> wrote:
>
> Previously the dts were using a value determined by empirical testing,
> because of a spi driver/clock bug. The bug was fixed quite some time
> ago. 33 MHz is the default clock frequency used by RouterBOOT and thus
> safe.
>
> Signed-off-by: Tobias Schramm <t.schramm@manjaro.org>
> ---
>  target/linux/ramips/dts/mt7621_mikrotik_rbm11g.dts | 4 ++--
>  target/linux/ramips/dts/mt7621_mikrotik_rbm33g.dts | 7 ++++---
>  2 files changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/target/linux/ramips/dts/mt7621_mikrotik_rbm11g.dts b/target/linux/ramips/dts/mt7621_mikrotik_rbm11g.dts
> index aae899c9a6..b0a31602e3 100644
> --- a/target/linux/ramips/dts/mt7621_mikrotik_rbm11g.dts
> +++ b/target/linux/ramips/dts/mt7621_mikrotik_rbm11g.dts
> @@ -83,8 +83,8 @@
>         w25q128@0 {
>                 compatible = "jedec,spi-nor";
>                 reg = <0>;
> -               // XXX empiric value to obtain actual 10MHz SCK at the chip
> -               spi-max-frequency = <3125000>;
> +               m25p,fast-read;
> +               spi-max-frequency = <33000000>;

m25p,fast-read isn't needed until spi frequency is higher than 50MHz
and it affects performance a bit.
It can be removed here and below.
Tobias Schramm April 9, 2020, 1:08 p.m. UTC | #2
Hi,

>> @@ -83,8 +83,8 @@
>>         w25q128@0 {
>>                 compatible = "jedec,spi-nor";
>>                 reg = <0>;
>> -               // XXX empiric value to obtain actual 10MHz SCK at the chip
>> -               spi-max-frequency = <3125000>;
>> +               m25p,fast-read;
>> +               spi-max-frequency = <33000000>;
> 
> m25p,fast-read isn't needed until spi frequency is higher than 50MHz
> and it affects performance a bit.
> It can be removed here and below.
> 

Ah, snap. Something in the back of my mind told me m25p,fast-read was
required from 25 MHz up. I'll send a v2 with it removed


Thanks,

Tobias
diff mbox series

Patch

diff --git a/target/linux/ramips/dts/mt7621_mikrotik_rbm11g.dts b/target/linux/ramips/dts/mt7621_mikrotik_rbm11g.dts
index aae899c9a6..b0a31602e3 100644
--- a/target/linux/ramips/dts/mt7621_mikrotik_rbm11g.dts
+++ b/target/linux/ramips/dts/mt7621_mikrotik_rbm11g.dts
@@ -83,8 +83,8 @@ 
 	w25q128@0 {
 		compatible = "jedec,spi-nor";
 		reg = <0>;
-		// XXX empiric value to obtain actual 10MHz SCK at the chip
-		spi-max-frequency = <3125000>;
+		m25p,fast-read;
+		spi-max-frequency = <33000000>;
 
 		partitions {
 			compatible = "fixed-partitions";
diff --git a/target/linux/ramips/dts/mt7621_mikrotik_rbm33g.dts b/target/linux/ramips/dts/mt7621_mikrotik_rbm33g.dts
index f7889bd68a..84bdaf06f1 100644
--- a/target/linux/ramips/dts/mt7621_mikrotik_rbm33g.dts
+++ b/target/linux/ramips/dts/mt7621_mikrotik_rbm33g.dts
@@ -93,7 +93,8 @@ 
 	w25q40@0 {
 		compatible = "jedec,spi-nor";
 		reg = <0>;
-		spi-max-frequency = <3125000>;
+		m25p,fast-read;
+		spi-max-frequency = <33000000>;
 
 		partitions {
 			compatible = "fixed-partitions";
@@ -143,8 +144,8 @@ 
 	w25q128@1 {
 		compatible = "jedec,spi-nor";
 		reg = <1>;
-		// XXX empiric value to obtain actual 10MHz SCK at the chip
-		spi-max-frequency = <3125000>;
+		m25p,fast-read;
+		spi-max-frequency = <33000000>;
 
 		partitions {
 			compatible = "fixed-partitions";