[rpi] rpi3 should use the same cpufreq logic as rpi2, not rpi-b
RPi3 cpufreq is more like that on RPi2. Setting arm frequency above min (say, "sysctl hw.cpufreq.arm_freq=600000001") turns on turbo mode, and the firmware automatically raises voltage, sets frequency to max 1200MHz, and throttle when overheat, etc. Swap if/else parts and use SOC_BCM2835 def so RPi3 can share the same cpufreq logic as RPi2, instead of falling to that for RPi. Submitted by: Jia-Shiun Li <jiashiun@gmail.com> MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D9640
This commit is contained in:
parent
36ff307bd8
commit
f1f425aea0
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=314672
@ -66,16 +66,16 @@ __FBSDID("$FreeBSD$");
|
||||
#define HZ2MHZ(freq) ((freq) / (1000 * 1000))
|
||||
#define MHZ2HZ(freq) ((freq) * (1000 * 1000))
|
||||
|
||||
#ifdef SOC_BCM2836
|
||||
#define OFFSET2MVOLT(val) (((val) / 1000))
|
||||
#define MVOLT2OFFSET(val) (((val) * 1000))
|
||||
#define DEFAULT_ARM_FREQUENCY 600
|
||||
#define DEFAULT_LOWEST_FREQ 600
|
||||
#else
|
||||
#ifdef SOC_BCM2835
|
||||
#define OFFSET2MVOLT(val) (1200 + ((val) * 25))
|
||||
#define MVOLT2OFFSET(val) (((val) - 1200) / 25)
|
||||
#define DEFAULT_ARM_FREQUENCY 700
|
||||
#define DEFAULT_LOWEST_FREQ 300
|
||||
#else
|
||||
#define OFFSET2MVOLT(val) (((val) / 1000))
|
||||
#define MVOLT2OFFSET(val) (((val) * 1000))
|
||||
#define DEFAULT_ARM_FREQUENCY 600
|
||||
#define DEFAULT_LOWEST_FREQ 600
|
||||
#endif
|
||||
#define DEFAULT_CORE_FREQUENCY 250
|
||||
#define DEFAULT_SDRAM_FREQUENCY 400
|
||||
@ -1544,7 +1544,20 @@ bcm2835_cpufreq_make_freq_list(device_t dev, struct cf_setting *sets,
|
||||
if (min_freq > cpufreq_lowest_freq)
|
||||
min_freq = cpufreq_lowest_freq;
|
||||
|
||||
#ifdef SOC_BCM2836
|
||||
#ifdef SOC_BCM2835
|
||||
/* from freq to min_freq */
|
||||
for (idx = 0; idx < *count && freq >= min_freq; idx++) {
|
||||
if (freq > sc->arm_min_freq)
|
||||
volts = sc->max_voltage_core;
|
||||
else
|
||||
volts = sc->min_voltage_core;
|
||||
sets[idx].freq = freq;
|
||||
sets[idx].volts = volts;
|
||||
sets[idx].lat = TRANSITION_LATENCY;
|
||||
sets[idx].dev = dev;
|
||||
freq -= MHZSTEP;
|
||||
}
|
||||
#else
|
||||
/* XXX RPi2 have only 900/600MHz */
|
||||
idx = 0;
|
||||
volts = sc->min_voltage_core;
|
||||
@ -1560,19 +1573,6 @@ bcm2835_cpufreq_make_freq_list(device_t dev, struct cf_setting *sets,
|
||||
sets[idx].dev = dev;
|
||||
idx++;
|
||||
}
|
||||
#else
|
||||
/* from freq to min_freq */
|
||||
for (idx = 0; idx < *count && freq >= min_freq; idx++) {
|
||||
if (freq > sc->arm_min_freq)
|
||||
volts = sc->max_voltage_core;
|
||||
else
|
||||
volts = sc->min_voltage_core;
|
||||
sets[idx].freq = freq;
|
||||
sets[idx].volts = volts;
|
||||
sets[idx].lat = TRANSITION_LATENCY;
|
||||
sets[idx].dev = dev;
|
||||
freq -= MHZSTEP;
|
||||
}
|
||||
#endif
|
||||
*count = idx;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user