linux-mips
[Top] [All Lists]

Re: [PATCH] rest of works for migration to GENERIC_TIME

To: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Subject: Re: [PATCH] rest of works for migration to GENERIC_TIME
From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Date: Tue, 24 Oct 2006 17:39:39 +0400
Cc: linux-mips@linux-mips.org, ralf@linux-mips.org
In-reply-to: <20061024.002127.74752850.anemo@mba.ocn.ne.jp>
Organization: MontaVista Software Inc.
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20061023.033407.104640794.anemo@mba.ocn.ne.jp> <20061024.002127.74752850.anemo@mba.ocn.ne.jp>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mozilla/5.0 (X11; U; Linux i686; rv:1.7.2) Gecko/20040803
Hello.

Atsushi Nemoto wrote:

Since we already moved to GENERIC_TIME, we should implement
alternatives of old do_gettimeoffset routines to get sub-jiffies
resolution from gettimeofday().  This patch includes:

Take 2.  Changes from previous patch are:

* Update against current git tree.
* Just fix sb1250_hpt_setup typo.
* Remove hack from jmr3927_hpt_read, bcm1480_hpt_read and add comments.

Subject: [PATCH] rest of works for migration to GENERIC_TIME

Since we already moved to GENERIC_TIME, we should implement
alternatives of old do_gettimeoffset routines to get sub-jiffies
resolution from gettimeofday().  This patch includes:

* MIPS clocksource support (based on works by Manish Lachwani).
* remove unused gettimeoffset routines and related codes.
* remove unised 64bit do_div64_32().
* simplify mips_hpt_init. (no argument needed, __init tag)

   It looks like this change might have broken some code...

* simplify c0_hpt_timer_init. (no need to write to c0_count)
* remove some hpt_init routines.
* mips_hpt_mask variable to specify bitmask of hpt value.
* convert jmr3927_do_gettimeoffset to jmr3927_hpt_read.
* convert ip27_do_gettimeoffset to ip27_hpt_read.
* convert bcm1480_do_gettimeoffset to bcm1480_hpt_read.
* simplify sb1250 hpt functions. (no need to subtract and shift)

Other than board independent part are not tested.  Please test if you
have those platforms.  Thank you.

diff --git a/arch/mips/dec/time.c b/arch/mips/dec/time.c
index 4cf0c06..69e424e 100644
--- a/arch/mips/dec/time.c
+++ b/arch/mips/dec/time.c
@@ -160,11 +160,6 @@ static unsigned int dec_ioasic_hpt_read(
        return ioasic_read(IO_REG_FCTR);
 }
-static void dec_ioasic_hpt_init(unsigned int count)
-{
-       ioasic_write(IO_REG_FCTR, ioasic_read(IO_REG_FCTR) - count);
-}
-
void __init dec_time_init(void)
 {
@@ -174,11 +169,9 @@ void __init dec_time_init(void)
        mips_timer_state = dec_timer_state;
        mips_timer_ack = dec_timer_ack;
- if (!cpu_has_counter && IOASIC) {
+       if (!cpu_has_counter && IOASIC)
                /* For pre-R4k systems we use the I/O ASIC's counter.  */
                mips_hpt_read = dec_ioasic_hpt_read;
-               mips_hpt_init = dec_ioasic_hpt_init;
-       }

   With mips_hpt_init() handler gone, how the initial value is loaded here?

WBR, Sergei

<Prev in Thread] Current Thread [Next in Thread>