Set cpu frequency

is it possible to lower the cpu frequency for a clearfog base device?
On your wiki page: https://solidrun.atlassian.net/wiki/spaces/developer/pages/197493392/A388+SOM+Hardware+User+Manual#Multi-Purpose-Pins-(MPP)

you listed those multi purpose pins (MPP) and giving a list of possible cpu settings decoded in hex values,
but where can i set them?

i tried this in u-boot in clearfog.c in function boot_early_init_f:

	u32 val = readl(CONFIG_SAR_REG);	/* SAR - Sample At Reset */
	// set frequency to 1200MHz (0xc -> 0x6)
	val -= 0x6 << SAR_CPU_FREQ_OFFS;
	writel(val, CONFIG_SAR_REG);	/* SAR - Sample At Reset */
	u32 freq = (val & SAR_CPU_FREQ_MASK) >> SAR_CPU_FREQ_OFFS;
	printf("foo 0x%08x\n", freq);
	
	val = readl(CONFIG_SAR_REG);	/* SAR - Sample At Reset */
	freq = (val & SAR_CPU_FREQ_MASK) >> SAR_CPU_FREQ_OFFS;
	printf("bar 0x%08x\n", freq);

but the register seems not writeable, because i get:

BootROM: Image checksum verification PASSED
foo 0x00000006
bar 0x0000000c

Any help is highly appreciated.

Kind regards,
Max

The frequency is set by the hardware sampling the pins after reset and then configuring the clocks accordingly. If you look at the schematics for the base you see that unlike the Pro which has cpu frequency selection brought out as dip switches to configure, the Base uses on board resistors. The only way to configure the default cpu frequency on the Base is by soldering R70-R74 to suite your desired frequency. The resistors are labeled and can be found on the bottom of the board. If you would like to make this modification and have questions please feel free to reach out for detailed instructions.

1 Like