From: Simon Glass Date: Mon, 16 Jan 2017 07:04:17 -0700 Subject: [U-Boot] [PATCH v3 52/62] x86: Move turbo_state to global_data In-Reply-To: <20170116140427.29283-1-sjg@chromium.org> References: <20170116140427.29283-1-sjg@chromium.org> Message-ID: <20170116140427.29283-53-sjg@chromium.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de To avoid using BSS in SPL before SDRAM is set up, move this field to global_data. Signed-off-by: Simon Glass --- Changes in v3: None Changes in v2: None arch/x86/cpu/turbo.c | 8 ++++---- arch/x86/include/asm/global_data.h | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/arch/x86/cpu/turbo.c b/arch/x86/cpu/turbo.c index 254d0de0e4b..bbd255efc0a 100644 --- a/arch/x86/cpu/turbo.c +++ b/arch/x86/cpu/turbo.c @@ -12,6 +12,8 @@ #include #include +DECLARE_GLOBAL_DATA_PTR; + #if CONFIG_CPU_INTEL_TURBO_NOT_PACKAGE_SCOPED static inline int get_global_turbo_state(void) { @@ -22,16 +24,14 @@ static inline void set_global_turbo_state(int state) { } #else -static int g_turbo_state = TURBO_UNKNOWN; - static inline int get_global_turbo_state(void) { - return g_turbo_state; + return gd->arch.turbo_state; } static inline void set_global_turbo_state(int state) { - g_turbo_state = state; + gd->arch.turbo_state = state; } #endif diff --git a/arch/x86/include/asm/global_data.h b/arch/x86/include/asm/global_data.h index 43a59a3b0c9..4570bc7a4ad 100644 --- a/arch/x86/include/asm/global_data.h +++ b/arch/x86/include/asm/global_data.h @@ -93,6 +93,7 @@ struct arch_global_data { char *mrc_output; unsigned int mrc_output_len; ulong table; /* Table pointer from previous loader */ + int turbo_state; /* Current turbo state */ struct irq_routing_table *pirq_routing_table; #ifdef CONFIG_SEABIOS u32 high_table_ptr; -- 2.11.0.483.g087da7b7c-goog