Skip to contentSkip to conversation

mips: add a mtmips-specific field to architecture-specific global data

PATCH Superseded Weijie Gao 3 participants 3 messages Jan 21, 2020 – Feb 10, 2020 MIPS

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Weijie Gao

author
#0 lore raw

PATCH v3 8/20 mips: add a mtmips-specific field to architecture-specific global data

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.

---
Changes since v2: none

---
 arch/mips/include/asm/global_data.h | 3 +++
 1 file changed, 3 insertions(+)
arch/mips/include/asm/global_data.h +3 -0
index 7b4ad083ba..4c30fab871 100644
@@ -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>
Signature · 1 line
2.17.1
#1 lore raw

PATCH v3 8/20 mips: add a mtmips-specific field to architecture-specific global data

Quoted 8 lines · 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.

Quoted 8 lines

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.

---
Changes since v2: none

Thanks,
Stefan

#2 lore raw

PATCH v3 8/20 mips: add a mtmips-specific field to architecture-specific global data

In reply to Weijie Gao

Am 21.01.20 um 09:18 schrieb Weijie Gao:

Quoted 12 lines

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.

Quoted 8 lines

---
Changes since v2: none

---
 arch/mips/include/asm/global_data.h | 3 +++
 1 file changed, 3 insertions(+)

applied to u-boot-mips, thanks.

Signature · 1 line
- Daniel