From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from az33egw01.freescale.net (az33egw01.freescale.net [192.88.158.102]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "az33egw01.freescale.net", Issuer "Thawte Premium Server CA" (verified OK)) by ozlabs.org (Postfix) with ESMTP id C531CDE1E4 for ; Fri, 22 Feb 2008 07:06:36 +1100 (EST) Message-ID: <47BDD9E2.5050007@freescale.com> Date: Thu, 21 Feb 2008 14:06:58 -0600 From: Scott Wood MIME-Version: 1.0 To: avorontsov@ru.mvista.com Subject: Re: [PATCH] [POWERPC] 8xx: timebase frequency should not depend on bus-frequency References: <20080221194508.GA12896@localhost.localdomain> <47BDD587.9060206@freescale.com> <20080221195918.GA14636@localhost.localdomain> In-Reply-To: <20080221195918.GA14636@localhost.localdomain> Content-Type: text/plain; charset=UTF-8; format=flowed Cc: linuxppc-dev@ozlabs.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Anton Vorontsov wrote: > On Thu, Feb 21, 2008 at 01:48:23PM -0600, Scott Wood wrote: >> Anton Vorontsov wrote: >>> diff --git a/arch/powerpc/platforms/8xx/m8xx_setup.c >>> b/arch/powerpc/platforms/8xx/m8xx_setup.c >>> index 184f998..0d9f75c 100644 >>> --- a/arch/powerpc/platforms/8xx/m8xx_setup.c >>> +++ b/arch/powerpc/platforms/8xx/m8xx_setup.c >>> @@ -111,17 +111,12 @@ void __init mpc8xx_calibrate_decr(void) >>> >>> /* Processor frequency is MHz. >>> */ >>> - ppc_tb_freq = 50000000; >>> - if (!get_freq("bus-frequency", &ppc_tb_freq)) { >>> - printk(KERN_ERR "WARNING: Estimating decrementer frequency " >>> - "(not found)\n"); >>> - } >>> - ppc_tb_freq /= 16; >>> ppc_proc_freq = 50000000; >>> if (!get_freq("clock-frequency", &ppc_proc_freq)) >>> printk(KERN_ERR "WARNING: Estimating processor frequency " >>> "(not found)\n"); >>> >>> + ppc_tb_freq = ppc_proc_freq / 16; >> Shouldn't we just use the timebase-frequency property? > > Nope. Most u-boots currently do not setup timebase-frequency, and if > they are setting it up, they're doing it wrong, in sense that Linux > overwrites timebase setup (yeah, in this regard MPC8xx is special). Current u-boots don't support device trees at all on 8xx. The most recent 8xx FDT patch I saw called get_tbclk() to fill in timebase-frequency; does get_tbclk() not work? Obviously, when booting with a cuImage we can't use u-boot's value, since it's not in the bd_t. In that case, we should fix the wrapper's calculation of the timebase frequency. -Scott