All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 08/21] mips: add a mtmips-specific field to architecture-specific global data
@ 2020-01-17  7:45 Weijie Gao
  2020-01-17 12:19 ` Daniel Schwierzeck
  0 siblings, 1 reply; 2+ messages in thread
From: Weijie Gao @ 2020-01-17  7:45 UTC (permalink / raw)
  To: u-boot

SoCs of mtmips can use different CPU frequencies depending on the HW/SW
configurations. For example mt7628 uses 580MHz clock if the input xtal
frequency is 40MHz, and 575MHz clock if the xtal is 25MHz. Upon cold boot
the CPU uses the xtal frequency directly.

So hardcoding the timer frequency (half of the CPU frequency) in
CONFIG_SYS_MIPS_TIMER_FREQ is not a good idea for this case.

This patch adds a mtmips-specific field timer_freq to arch_global_data.
This field will be used later in mtmips-specific get_tbclk() to provide
accurate timer frequency in different boot stage.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
---
Changes since v1: splitted from another patch.
---
 arch/mips/include/asm/global_data.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/mips/include/asm/global_data.h b/arch/mips/include/asm/global_data.h
index 7b4ad083ba..4c30fab871 100644
--- a/arch/mips/include/asm/global_data.h
+++ b/arch/mips/include/asm/global_data.h
@@ -27,6 +27,9 @@ struct arch_global_data {
 #ifdef CONFIG_MIPS_L2_CACHE
 	unsigned short l2_line_size;
 #endif
+#ifdef CONFIG_ARCH_MTMIPS
+	unsigned long timer_freq;
+#endif
 };
 
 #include <asm-generic/global_data.h>
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH v2 08/21] mips: add a mtmips-specific field to architecture-specific global data
  2020-01-17  7:45 [PATCH v2 08/21] mips: add a mtmips-specific field to architecture-specific global data Weijie Gao
@ 2020-01-17 12:19 ` Daniel Schwierzeck
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Schwierzeck @ 2020-01-17 12:19 UTC (permalink / raw)
  To: u-boot



Am 17.01.20 um 08:45 schrieb Weijie Gao:
> SoCs of mtmips can use different CPU frequencies depending on the HW/SW
> configurations. For example mt7628 uses 580MHz clock if the input xtal
> frequency is 40MHz, and 575MHz clock if the xtal is 25MHz. Upon cold boot
> the CPU uses the xtal frequency directly.
> 
> So hardcoding the timer frequency (half of the CPU frequency) in
> CONFIG_SYS_MIPS_TIMER_FREQ is not a good idea for this case.
> 
> This patch adds a mtmips-specific field timer_freq to arch_global_data.
> This field will be used later in mtmips-specific get_tbclk() to provide
> accurate timer frequency in different boot stage.
> 
> Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
> ---
> Changes since v1: splitted from another patch.
> ---
>  arch/mips/include/asm/global_data.h | 3 +++
>  1 file changed, 3 insertions(+)
> 

Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

-- 
- Daniel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-01-17 12:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-17  7:45 [PATCH v2 08/21] mips: add a mtmips-specific field to architecture-specific global data Weijie Gao
2020-01-17 12:19 ` Daniel Schwierzeck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.