+void plat_validate_config(void)
+{
+ gp2x_soc_t soc;
+
+ soc = soc_detect();
+ if (soc != SOCID_MMSP2)
+ PicoOpt &= ~POPT_EXT_FM;
+ if (soc != SOCID_POLLUX)
+ currentConfig.EmuOpt &= ~EOPT_WIZ_TEAR_FIX;
+
+ if (currentConfig.gamma < 10 || currentConfig.gamma > 300)
+ currentConfig.gamma = 100;
+
+ if (currentConfig.CPUclock < 10 || currentConfig.CPUclock > 1024)
+ currentConfig.CPUclock = default_cpu_clock;
+}
+
+void plat_early_init(void)
+{
+ gp2x_soc_t soc;
+
+ soc = soc_detect();
+ switch (soc)
+ {
+ case SOCID_MMSP2:
+ default_cpu_clock = 200;
+ break;
+ case SOCID_POLLUX:
+ strcpy(cpu_clk_name, "Wiz CPU clock");
+ default_cpu_clock = 533;
+ break;
+ default:
+ printf("could not recognize SoC, running in dummy mode.\n");
+ break;
+ }
+}
+