- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1.1k
add PICO_USE_FASTEST_SUPPORTED_CLOCK, and support vreg setting and SYS_CLOCK_MHZ=200 for rp2040 #2285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…S_CLOCK_MHZ=200 for rp2040 .
| IMO  | 
| There are a couple of small tweaks needed to stop  diff --git a/src/rp2040/hardware_regs/include/hardware/platform_defs.h b/src/rp2040/hardware_regs/include/hardware/platform_defs.h
index e1d368e..9566e1f 100644
--- a/src/rp2040/hardware_regs/include/hardware/platform_defs.h
+++ b/src/rp2040/hardware_regs/include/hardware/platform_defs.h
@@ -69,6 +69,9 @@
 #define SYS_CLK_HZ ((SYS_CLK_MHZ) * _u(1000000))
 #else
 // PICO_CONFIG: PICO_USE_FASTEST_SUPPORTED_CLOCK, Use the fastest officially supported clock by default, type=bool, default=0, group=hardware_base
+#ifndef PICO_USE_FASTEST_SUPPORTED_CLOCK
+#define PICO_USE_FASTEST_SUPPORTED_CLOCK 0
+#endif
 #if PICO_USE_FASTEST_SUPPORTED_CLOCK
 #define SYS_CLK_HZ _u(200000000)
 #else
diff --git a/src/rp2_common/hardware_clocks/include/hardware/clocks.h b/src/rp2_common/hardware_clocks/include/hardware/clocks.h
index 217bb7d..1a598cf 100644
--- a/src/rp2_common/hardware_clocks/include/hardware/clocks.h
+++ b/src/rp2_common/hardware_clocks/include/hardware/clocks.h
@@ -225,6 +225,10 @@ extern "C" {
 #ifndef PLL_SYS_POSTDIV2
 #define PLL_SYS_POSTDIV2                    1
 #endif
+#else
+#ifndef SYS_CLK_VREG_VOLTAGE_AUTO_ADJUST
+#define SYS_CLK_VREG_VOLTAGE_AUTO_ADJUST 0
+#endif
 #endif // PICO_RP2040 && SYS_CLK_KHZ == 200000 && XOSC_KHZ == 12000 && PLL_COMMON_REFDIV == 1
 
 #if !defined(PLL_SYS_VCO_FREQ_HZ) || !defined(PLL_SYS_POSTDIV1) || !defined(PLL_SYS_POSTDIV2) | 
| 
 It is the minimum voltage for the requested sys_clock; i.e. its value is dependent on the sys clock you choose, and the clock setup will increase the current voltage if it is less than this | 
…S_CLOCK_MHZ=200 for rp2040 (raspberrypi#2285)
Also adds
vreg_get_voltage()