Skip to content

Commit 9c11bb8

Browse files
committed
Initial commit
0 parents  commit 9c11bb8

File tree

5 files changed

+206
-0
lines changed

5 files changed

+206
-0
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# MiSTer FPGA Overclock Scripts
2+
3+
Works in conjunction with the [MiSTer FPGA Overclock Kernel](https://github.com/coolbho3k/Linux-Kernel_MiSTer/releases/) to overclock or underclock your MiSTer system.
4+
5+
## Warning
6+
- Active cooling or very good passive cooling required!
7+
- Overclock/underclock at your own risk!
8+
- These scripts are licensed under GPLv3, so they come with no warranty.
9+
10+
## How to use
11+
Copy all the scripts to the `Scripts` directory on your SD card.
12+
13+
The kernel driver's default behavior is to keep the MiSTer at 800 MHz (stock) until you run one of these scripts.
14+
15+
- Run `set_cpu_max_1200.sh` to set max clock speed to 1.2 GHz
16+
- Run `set_cpu_max_1000.sh` to set max clock speed to 1.0 GHz
17+
- Run `set_cpu_max_800.sh` to set max clock speed to 800 MHz (stock)
18+
- Run `set_cpu_max_400.sh` to set max clock speed to 400MHz

set_cpu_max_1000.sh

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/bin/bash
2+
3+
# This program is free software: you can redistribute it and/or modify
4+
# it under the terms of the GNU General Public License as published by
5+
# the Free Software Foundation, either version 3 of the License, or
6+
# (at your option) any later version.
7+
8+
# This program is distributed in the hope that it will be useful,
9+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
# GNU General Public License for more details.
12+
13+
# You should have received a copy of the GNU General Public License
14+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
15+
16+
if [ ! -f "/media/fat/MiSTer" ];
17+
then
18+
echo "This script must be run"
19+
echo "on a MiSTer system."
20+
exit 1
21+
fi
22+
23+
if [ ! -f "/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq" ];
24+
then
25+
echo "This script must be run"
26+
echo "on a kernel with cpufreq driver."
27+
exit 1
28+
fi
29+
30+
echo "Warning: Active cooling required!"
31+
echo "Warning: Overclock/underclock at your own risk!"
32+
echo "This script comes with no warranty"
33+
echo "Press UP to proceed, press DOWN to abort"
34+
35+
for (( ; ; )); do
36+
read -r -s -N 1 -t 1 key
37+
if [[ "${key}" == "A" ]]; then
38+
break
39+
elif [[ "${key}" == "B" ]]; then
40+
echo "Aborted script"
41+
exit 1
42+
break
43+
fi
44+
done
45+
46+
echo "1000000" > "/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq"
47+
echo "Max CPU frequency set to 1000 MHz"

set_cpu_max_1200.sh

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/bin/bash
2+
3+
# This program is free software: you can redistribute it and/or modify
4+
# it under the terms of the GNU General Public License as published by
5+
# the Free Software Foundation, either version 3 of the License, or
6+
# (at your option) any later version.
7+
8+
# This program is distributed in the hope that it will be useful,
9+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
# GNU General Public License for more details.
12+
13+
# You should have received a copy of the GNU General Public License
14+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
15+
16+
if [ ! -f "/media/fat/MiSTer" ];
17+
then
18+
echo "This script must be run"
19+
echo "on a MiSTer system."
20+
exit 1
21+
fi
22+
23+
if [ ! -f "/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq" ];
24+
then
25+
echo "This script must be run"
26+
echo "on a kernel with cpufreq driver."
27+
exit 1
28+
fi
29+
30+
echo "Warning: Active cooling required!"
31+
echo "Warning: Overclock/underclock at your own risk!"
32+
echo "This script comes with no warranty"
33+
echo "Press UP to proceed, press DOWN to abort"
34+
35+
for (( ; ; )); do
36+
read -r -s -N 1 -t 1 key
37+
if [[ "${key}" == "A" ]]; then
38+
break
39+
elif [[ "${key}" == "B" ]]; then
40+
echo "Aborted script"
41+
exit 1
42+
break
43+
fi
44+
done
45+
46+
echo "1200000" > "/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq"
47+
echo "Max CPU frequency set to 1200 MHz"

set_cpu_max_400.sh

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/bin/bash
2+
3+
# This program is free software: you can redistribute it and/or modify
4+
# it under the terms of the GNU General Public License as published by
5+
# the Free Software Foundation, either version 3 of the License, or
6+
# (at your option) any later version.
7+
8+
# This program is distributed in the hope that it will be useful,
9+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
# GNU General Public License for more details.
12+
13+
# You should have received a copy of the GNU General Public License
14+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
15+
16+
if [ ! -f "/media/fat/MiSTer" ];
17+
then
18+
echo "This script must be run"
19+
echo "on a MiSTer system."
20+
exit 1
21+
fi
22+
23+
if [ ! -f "/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq" ];
24+
then
25+
echo "This script must be run"
26+
echo "on a kernel with cpufreq driver."
27+
exit 1
28+
fi
29+
30+
echo "Warning: Active cooling required!"
31+
echo "Warning: Overclock/underclock at your own risk!"
32+
echo "This script comes with no warranty"
33+
echo "Press UP to proceed, press DOWN to abort"
34+
35+
for (( ; ; )); do
36+
read -r -s -N 1 -t 1 key
37+
if [[ "${key}" == "A" ]]; then
38+
break
39+
elif [[ "${key}" == "B" ]]; then
40+
echo "Aborted script"
41+
exit 1
42+
break
43+
fi
44+
done
45+
46+
echo "400000" > "/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq"
47+
echo "Max CPU frequency set to 400 MHz"

set_cpu_max_800.sh

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/bin/bash
2+
3+
# This program is free software: you can redistribute it and/or modify
4+
# it under the terms of the GNU General Public License as published by
5+
# the Free Software Foundation, either version 3 of the License, or
6+
# (at your option) any later version.
7+
8+
# This program is distributed in the hope that it will be useful,
9+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
# GNU General Public License for more details.
12+
13+
# You should have received a copy of the GNU General Public License
14+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
15+
16+
if [ ! -f "/media/fat/MiSTer" ];
17+
then
18+
echo "This script must be run"
19+
echo "on a MiSTer system."
20+
exit 1
21+
fi
22+
23+
if [ ! -f "/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq" ];
24+
then
25+
echo "This script must be run"
26+
echo "on a kernel with cpufreq driver."
27+
exit 1
28+
fi
29+
30+
echo "Warning: Active cooling required!"
31+
echo "Warning: Overclock/underclock at your own risk!"
32+
echo "This script comes with no warranty"
33+
echo "Press UP to proceed, press DOWN to abort"
34+
35+
for (( ; ; )); do
36+
read -r -s -N 1 -t 1 key
37+
if [[ "${key}" == "A" ]]; then
38+
break
39+
elif [[ "${key}" == "B" ]]; then
40+
echo "Aborted script"
41+
exit 1
42+
break
43+
fi
44+
done
45+
46+
echo "800000" > "/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq"
47+
echo "Max CPU frequency set to 800 MHz"

0 commit comments

Comments
 (0)