Modify

Opened 8 years ago

Closed 7 years ago

#7548 closed defect (fixed)

Clock timing completely out on AR7 (TNETD7200) (DSL-502T Generation II)

Reported by: daniel.hill@… Owned by: florian
Priority: normal Milestone:
Component: kernel Version: Backfire 10.03
Keywords: Cc:

Description

bogoMIPS reports that the CPU is running at 149.50 but the Clock is suppose to be at 211MHz

plus the I set the time at 4am this morning and by 3:21pm the clock is set to 8:03pm

Attachments (2)

openwrt.dmesg (5.6 KB) - added by daniel.hill@… 8 years ago.
dmesg output
990-rtc.patch (1.3 KB) - added by frank@… 7 years ago.

Download all attachments as: .zip

Change History (14)

Changed 8 years ago by daniel.hill@…

dmesg output

comment:1 Changed 8 years ago by florian

  • Owner changed from developers to florian
  • Status changed from new to accepted

I will look at it, thanks for the report.

comment:2 Changed 8 years ago by florian

Can you test the following patch:

diff --git a/arch/mips/ar7/clock.c b/arch/mips/ar7/clock.c
index fc0e715..6a4bc1e 100644
--- a/arch/mips/ar7/clock.c
+++ b/arch/mips/ar7/clock.c
@@ -456,7 +456,7 @@ void clk_put(struct clk *clk)
 }
 EXPORT_SYMBOL(clk_put);
 
-int __init ar7_init_clocks(void)
+void __init ar7_init_clocks(void)
 {
 	switch (ar7_chip_id()) {
 	case AR7_CHIP_7100:
@@ -472,7 +472,4 @@ int __init ar7_init_clocks(void)
 	}
 	/* adjust vbus clock rate */
 	vbus_clk.rate = bus_clk.rate / 2;
-
-	return 0;
 }
-arch_initcall(ar7_init_clocks);
diff --git a/arch/mips/ar7/prom.c b/arch/mips/ar7/prom.c
index 5238579..98872ad 100644
--- a/arch/mips/ar7/prom.c
+++ b/arch/mips/ar7/prom.c
@@ -246,6 +246,8 @@ void __init prom_init(void)
 	ar7_init_cmdline(fw_arg0, (char **)fw_arg1);
 	ar7_init_env((struct env_var *)fw_arg2);
 	console_config();
+
+	ar7_init_clocks();
 }
 
 #define PORT(offset) (KSEG1ADDR(AR7_REGS_UART0 + (offset * 4)))
diff --git a/arch/mips/include/asm/mach-ar7/ar7.h b/arch/mips/include/asm/mach-ar7/ar7.h
index 483ffea..3e63d37 100644
--- a/arch/mips/include/asm/mach-ar7/ar7.h
+++ b/arch/mips/include/asm/mach-ar7/ar7.h
@@ -95,6 +95,8 @@ struct plat_dsl_data {
 
 extern int ar7_cpu_clock, ar7_bus_clock, ar7_dsp_clock;
 
+extern void __init ar7_init_clocks(void);
+
 static inline u16 ar7_chip_id(void)
 {
 	return readl((void *)KSEG1ADDR(AR7_REGS_GPIO + 0x14)) & 0xffff;

This should solve the issue.

comment:3 Changed 7 years ago by frank@…

Seems to work..

root@OpenWrt:/# cat /proc/cpuinfo
system type : TI AR7 (TNETD7200)
processor : 0
cpu model : MIPS 4KEc V4.8
BogoMIPS : 246.27

dmesg
Clocks: Setting CPU clock
Adjusted requested frequency 241000000 to 247296000
Clocks: prediv: 1, postdiv: 1, mul: 7

comment:4 Changed 7 years ago by frank@…

Overclocking (going to make a wiki page for it:
It's overclockable if you follow 35Mhz increments.. The value in clock.c 241000000 is rounded off to 246mhz.. Could be +-9mhz.. Going further selects the 229mhz or 264mhz.. DSL wont synq..
Tested 282mhz for about a year with a heatsink, never problems.. Going higher locked up.
Changing the system bus 125mhz will lock up.

comment:5 Changed 7 years ago by daniel@…

it's daniel.hill@... (new email address)

sorry I haven't tested this, wasn't sent an email about this

so I'll test it soon

comment:6 Changed 7 years ago by daniel@…

OK so question, how do I apply this patch? do i put it in target/linux/ar7/patches-2.6.35/ ?

comment:7 Changed 7 years ago by frank@…

don't know..I manually edited it..
I put it online

comment:8 Changed 7 years ago by frank@…

it worked for me when I put all those lines in a file name 990-rtc.patch in target/linux/ar7/patches-2.6.35... If you didnt change the default kernel.. it uses 2.6.32

Changed 7 years ago by frank@…

comment:9 Changed 7 years ago by daniel@…

I can confirm that the bogomips is reported correctly, I'll see if the clock works fine soon

comment:10 Changed 7 years ago by florian

Thanks for testing the patch, I will commit it after some more testing on my devices.

comment:11 Changed 7 years ago by florian

For some reasons, this does not work on non-tnetd7200 devices, I am having a look at this.

comment:12 Changed 7 years ago by florian

  • Resolution set to fixed
  • Status changed from accepted to closed

Fixed with r23746. It was not safe to use msleep that early in the kernel initialization, and this could only crash tnetd7300-based devices.

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.