pelwell Wrote:The attached patches (against rpi-4.0.y) add the overclock ability to the bcm2835-mmc and bcm2835-sdhost drivers.
The mmc driver loads by default, but you can gratuitously use an overlay:
The sdhost driver requires an overlay to select it:
To activate the overclock, use one of the following:
Code:
dtoverlay=mmc,overclock_50=63
dtoverlay=sdhost,overclock_50=63
dtoverlay=sdhost,overclock_50=84
Supplied overclock values will be substituted when the MMC framework requests 50MHz, after rounding down to an (even, in the case of the mmc driver) integer division of 250MHz (or whatever the core clock is, if overclocking). You will get a warning message during bootup showing that the overclock is active:
Code:
rpi22:~ # dmesg | grep Overclock
[ 1.518576] mmc0: Overclocking to 62500000Hz
These are the results from a Rev 1.1 B+ (the mmc driver can't reach 50MHz because of the even-clock-divisor requirement):
Code:
Class 6 NOOBS:
mmc 42 -> hdparm -t=17.52MB/s, dd read=18.2MB/s, dd write=7.0MB/s
sdhost 50 -> hdparm -t=21.22MB/s, dd read=22.1MB/s, dd write=7.0MB/s (read +21%)
mmc 63 -> hdparm -t=25.07MB/s, dd read=26.0MB/s, dd write=7.0MB/s (read +43%)
sdhost 63 -> hdparm -t=25.97MB/s, dd read=27.0MB/s, dd write=7.0MB/s (read +48%)
sdhost 84 -> hdparm -t=32.95MB/s, dd read=34.0MB/s, dd write=7.0MB/s (read +87%)
Sandisk Class 10:
mmc 42 -> hdparm -t=17.83MB/s, dd read=18.6MB/s, dd write=9.7MB/s
sdhost 50 -> hdparm -t=21.27MB/s, dd read=22.1MB/s, dd write=10.0MB/s (read +18%, write +3%)
mmc 63 -> hdparm -t=25.87MB/s, dd read=26.8MB/s, dd write=10.3MB/s (read +44%, write +6%)
sdhost 63 -> hdparm -t=26.02MB/s, dd read=27.0MB/s, dd write=10.3MB/s (read +45%, write +6%)
sdhost 84 -> hdparm -t=33.31MB/s, dd read=34.4MB/s, dd write=10.5MB/s (read +85%, write +8%)
Note that you can confirm the current operating state of the card using:
Code:
cat /sys/kernel/debug/mmc0/ios
Phil
Code:
Overlay config core_freq turbo overclock_50 WRITE READ HDPARM
dtoverlay=mmc 250 0 41.667 Mhz 6.06 MB/s 18.21 MB/s 18.54 MB/s [1]
dtoverlay=mmc,overclock_50=63 250 0 62.500 Mhz 5.95 MB/s 26.47 MB/s 26.58 MB/s
dtoverlay=sdhost 250 0 50.000 Mhz 5.90 MB/s 21.49 MB/s 21.64 MB/s
dtoverlay=sdhost,overclock_50=63 250 0 62.500 Mhz 5.93 MB/s 26.34 MB/s 26.80 MB/s
dtoverlay=sdhost,overclock_50=84 250 0 83.333 MHz 5.98 MB/s 34.00 MB/s 34.87 MB/s
dtoverlay=mmc 250 1 41.667 MHz 6.03 MB/s 18.28 MB/s 18.48 MB/s [1]
dtoverlay=mmc,overclock_50=63 250 1 62.500 MHz 6.01 MB/s 26.61 MB/s 27.15 MB/s
dtoverlay=sdhost 250 1 50.000 MHz 6.03 MB/s 21.50 MB/s 22.00 MB/s
dtoverlay=sdhost,overclock_50=63 250 1 62.500 MHz 6.06 MB/s 26.35 MB/s 27.15 MB/s
dtoverlay=sdhost,overclock_50=84 250 1 83.333 MHz 6.00 MB/s 34.02 MB/s 35.41 MB/s
dtoverlay=mmc 500 0 41.667 MHz 5.89 MB/s 18.21 MB/s 18.32 MB/s
dtoverlay=mmc,overclock_50=63 500 0 62.500 MHz 5.96 MB/s 26.48 MB/s 26.58 MB/s
dtoverlay=mmc,overclock_50=84 500 0 62.500 MHz 5.90 MB/s 26.46 MB/s 26.58 MB/s [2, 3]
dtoverlay=sdhost 500 0 50.000 MHz 5.99 MB/s 11.25 MB/s 11.18 MB/s [4]
dtoverlay=sdhost,overclock_50=63 500 0 62.500 MHz 5.94 MB/s 13.97 MB/s 13.91 MB/s [4]
dtoverlay=sdhost,overclock_50=72 500 0 71.429 MHz 5.96 MB/s 15.89 MB/s 15.79 MB/s [4]
dtoverlay=sdhost,overclock_50=84 500 0 83.333 MHz 6.01 MB/s 18.35 MB/s 18.30 MB/s [4]
dtoverlay=sdhost,overclock_50=100 500 0 100.000 MHz 6.00 MB/s 21.78 MB/s 21.76 MB/s [4]
dtoverlay=mmc 500 1 41.667 MHz 6.11 MB/s 18.31 MB/s 18.48 MB/s [1]
dtoverlay=mmc,overclock_50=63 500 1 62.500 MHz 6.14 MB/s 26.67 MB/s 27.24 MB/s
dtoverlay=mmc,overclock_50=84 500 1 62.500 MHz 6.06 MB/s 26.66 MB/s 27.24 MB/s [2]
dtoverlay=sdhost 500 1 50.000 MHz 6.12 MB/s 21.50 MB/s 22.01 MB/s
dtoverlay=sdhost,overclock_50=63 500 1 62.500 MHz 6.11 MB/s 26.34 MB/s 27.15 MB/s
dtoverlay=sdhost,overclock_50=72 500 1 71.429 MHz 6.05 MB/s 29.69 MB/s 30.82 MB/s
dtoverlay=sdhost,overclock_50=84 500 1 83.333 MHz 6.06 MB/s 34.01 MB/s 35.53 MB/s
dtoverlay=sdhost,overclock_50=100 500 1 100.000 MHz 6.14 MB/s 39.81 MB/s 41.72 MB/s
Observations:Code:
Core mmc sdhost
Freq overclock_50 overclock_50
250 63 63,84
275 63 55,69,92
300 63 60,75,100
325 63 55,65,82,(109)
350 63 59,70,88,(117)
375 63 54,63,75,94
400 63 58,67,80,100
425 63 54,61,71,85,(107)
450 63 57,65,75,90,(113)
475 63 53,60,68,80,95,(119)
500 63 56,63,72,84,100