From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755178AbcEYQCk (ORCPT ); Wed, 25 May 2016 12:02:40 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:6929 "EHLO mailapp01.imgtec.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752794AbcEYQCj (ORCPT ); Wed, 25 May 2016 12:02:39 -0400 Subject: Re: [PATCH 03/11] MIPS: pic32mzda: fix getting timer clock rate. To: Purna Chandra Mandal , References: <1463461560-9629-1-git-send-email-purna.mandal@microchip.com> <1463461560-9629-3-git-send-email-purna.mandal@microchip.com> CC: , Ralf Baechle , Joshua Henderson , Joshua Henderson From: Harvey Hunt Message-ID: <062abb47-931c-c47f-bcc1-1642db0c0def@imgtec.com> Date: Wed, 25 May 2016 17:02:35 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <1463461560-9629-3-git-send-email-purna.mandal@microchip.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [192.168.154.26] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Purna, On 17/05/16 06:05, Purna Chandra Mandal wrote: > PIC32 clock driver is now implemented as platform driver instead of > as part of of_clk_init(). It meants all the clock modules are available > quite late in the boot sequence. So request for CPU clock by clk_get_sys() > and clk_get_rate() to find c0_timer rate fails. > > To fix this use PIC32 specific early clock functions implemented for early > console support. > > Signed-off-by: Purna Chandra Mandal > > --- > Note: Please pull this complete series through the MIPS tree. > > --- > > arch/mips/pic32/pic32mzda/time.c | 13 ++++--------- > 1 file changed, 4 insertions(+), 9 deletions(-) > > diff --git a/arch/mips/pic32/pic32mzda/time.c b/arch/mips/pic32/pic32mzda/time.c > index ca6a62b..62a0a78 100644 > --- a/arch/mips/pic32/pic32mzda/time.c > +++ b/arch/mips/pic32/pic32mzda/time.c > @@ -11,13 +11,12 @@ > * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License > * for more details. > */ > -#include > #include > #include > #include > +#include > #include > #include > -#include > > #include > > @@ -58,16 +57,12 @@ unsigned int get_c0_compare_int(void) > > void __init plat_time_init(void) > { > - struct clk *clk; > + unsigned long rate = pic32_get_pbclk(7); pic32_get_pbclk() is defined in arch/mips/pic32/pic32mzda/early_clk.c. When CONFIG_EARLY_PRINTK isn't set, early_clk.c isn't compiled and so a linker error occurs. Maybe it's best to always build the early_clk.c file, or perhaps there is a better place to put pic32_get_pbclk()? Thanks, Harvey