From patchwork Thu Mar 7 19:00:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 2233411 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id A6DBF3FCF6 for ; Thu, 7 Mar 2013 19:00:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932366Ab3CGTA2 (ORCPT ); Thu, 7 Mar 2013 14:00:28 -0500 Received: from moutng.kundenserver.de ([212.227.17.8]:57510 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755963Ab3CGTA1 (ORCPT ); Thu, 7 Mar 2013 14:00:27 -0500 Received: from axis700.grange (dslb-178-001-151-034.pools.arcor-ip.net [178.1.151.34]) by mrelayeu.kundenserver.de (node=mreu2) with ESMTP (Nemesis) id 0MErMM-1Tyoks4BwY-00FWdW; Thu, 07 Mar 2013 20:00:25 +0100 Received: by axis700.grange (Postfix, from userid 1000) id 9871240BB4; Thu, 7 Mar 2013 20:00:24 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by axis700.grange (Postfix) with ESMTP id 94C3640BB3; Thu, 7 Mar 2013 20:00:24 +0100 (CET) Date: Thu, 7 Mar 2013 20:00:24 +0100 (CET) From: Guennadi Liakhovetski X-X-Sender: lyakh@axis700.grange To: Magnus Damm cc: Simon Horman , Linux-SH Subject: Re: SDHI and MMCIF with kzm9g-reference In-Reply-To: Message-ID: References: <20130301110802.GB24364@verge.net.au> <20130301122805.GD24364@verge.net.au> <20130304130035.GA31626@verge.net.au> MIME-Version: 1.0 X-Provags-ID: V02:K0:e1YLLA8xkgUPhw7XVHMKa5ERph+3jiVh9bnMN/LjLa9 7u6jMkLlmB1CMD9rXKMgBBOG+fkBwEARABAXWHENW4O+9csbnz lC3Z8ghlQ/I2YSulaLafJNrzorIRnZL6Z8LZldmcavbE18FGki z6jJqK3VuaHuSZm4J/lvoabx/o5x7hnyT9WVIAcfR6LOWsTa3P qQzu8QsaKLLUtkxROKEUOxW6qRR88rUJKz4zvIFj/pC14FCuDm XpldCzMm69kuQ0PURcc4ImMQpjMn2zYfd8EqEthwZkr25uEMjz euel4ZHiRCGo/oOOiHo9FwSZCD7ethfDxGtNFXKcxQJiL5u6bX u3djz91CXVo7Ur1snvqyRDkhvEBgnK4nAAmorSqYRr6DuXUNm1 LKtKC9sgiL3Mw== Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org Hi Magnus On Mon, 4 Mar 2013, Magnus Damm wrote: > On Mon, Mar 4, 2013 at 10:40 PM, Guennadi Liakhovetski > wrote: > > On Mon, 4 Mar 2013, Simon Horman wrote: > >> On Mon, Mar 04, 2013 at 09:55:56PM +0900, Magnus Damm wrote: > >> > On Fri, Mar 1, 2013 at 9:28 PM, Simon Horman wrote: > >> > > The reason that the code is like it is and not the way it would be > >> > > with the patch below (errors aside), is because Magnus specifically > >> > > asked for no early devices or early timers. > >> > > >> > Thanks for making sure that we're not enabling early timers when it is > >> > unclear if we really need to. > >> > >> Thanks for reviewing the situation. > >> > >> > Would it be possible for you to check if the timer drivers (CMT, TMU) > >> > get probe():d before the MMC drivers? > >> > >> My analysis is that the clock sources are probed after MMCIF and SDHI. > > > > Related to this: the problem with TWD on kzm9g with DT was, that CMT was > > initialised too late too. The TWD driver should be initialised before the > > secondary CPU is brought up. It is performing a calibration, and if CMT > > isn't initialised by then, the calibration never ends... So, my "local > > hack" to just enable TWD on kzm9g-reference to test CPUFreq interaction > > was to use early timers too. > > Uhm, if shmobile_setup_delay() is used then the delay calculation will > be bypassed. Not sure which state the code was in when you tried > though. > > So the shmobile_setup_delay() function should work for both boot and > secondary cpus. Keep in mind that configurations with both local > timers (TWD) and broad cast timer needs to work. Let me reply to this with a pseudo patch-series:-) Based on topic/all+next of today (tip commit a7dba2b "Merge branch 'topic/intc-external-irq' into topic/all+next") with 3 my hack-patches to bring kzm9g-reference up with a network, a naive way of adding a TWD clock like Once again: follow-up patches 1 and 2 are not for the mainline. Patch 3 might actually make be good - provided we get a confirmation, that twd frequency on sh73a0 is indeed fixed Z clock / 4. Thanks Guennadi --- Guennadi Liakhovetski, Ph.D. Freelance Open-Source Software Developer http://www.open-technology.de/ -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/mach-shmobile/board-kzm9g-reference.c b/arch/arm/mach-shmobile/board-kzm9g-reference.c index 81d44d8..8253493 100644 --- a/arch/arm/mach-shmobile/board-kzm9g-reference.c +++ b/arch/arm/mach-shmobile/board-kzm9g-reference.c @@ -132,6 +132,14 @@ static void __init kzm_init(void) #endif } +void sh73a0_register_twd(void); + +static __init void kzm9g_init_time(void) +{ + shmobile_timer_init(); + sh73a0_register_twd(); +} + static const char *kzm9g_boards_compat_dt[] __initdata = { "renesas,kzm9g-reference", NULL, @@ -144,6 +152,6 @@ DT_MACHINE_START(KZM9G_DT, "kzm9g-reference") .nr_irqs = NR_IRQS_LEGACY, .init_irq = sh73a0_init_irq_intc_dt, .init_machine = kzm_init, - .init_time = shmobile_timer_init, + .init_time = kzm9g_init_time, .dt_compat = kzm9g_boards_compat_dt, MACHINE_END locks up with no console output. To actually boot and get the twd running I have to do diff --git a/arch/arm/mach-shmobile/board-kzm9g-reference.c b/arch/arm/mach-shmobile/board-kzm9g-reference.c index 81d44d8..3eaaab6 100644 --- a/arch/arm/mach-shmobile/board-kzm9g-reference.c +++ b/arch/arm/mach-shmobile/board-kzm9g-reference.c @@ -140,10 +140,10 @@ static const char *kzm9g_boards_compat_dt[] __initdata = { DT_MACHINE_START(KZM9G_DT, "kzm9g-reference") .smp = smp_ops(sh73a0_smp_ops), .map_io = sh73a0_map_io, - .init_early = sh73a0_init_delay, + .init_early = sh73a0_add_early_devices, .nr_irqs = NR_IRQS_LEGACY, .init_irq = sh73a0_init_irq_intc_dt, .init_machine = kzm_init, - .init_time = shmobile_timer_init, + .init_time = sh73a0_earlytimer_init, .dt_compat = kzm9g_boards_compat_dt, MACHINE_END