From patchwork Mon Jul 9 12:06:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Machek X-Patchwork-Id: 1172661 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 9142940B18 for ; Mon, 9 Jul 2012 12:13:01 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SoCl7-0002A0-25; Mon, 09 Jul 2012 12:08:09 +0000 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SoCjj-00024d-O6 for linux-arm-kernel@lists.infradead.org; Mon, 09 Jul 2012 12:06:45 +0000 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id A7DD8F0649; Mon, 9 Jul 2012 14:06:13 +0200 (CEST) Date: Mon, 9 Jul 2012 14:06:11 +0200 From: Pavel Machek To: Rob Herring Subject: Re: [RFC PATCHv1 1/2] ARM: socfpga: initial support for Altera's SOCFPGA platform. Message-ID: <20120709120611.GD12130@elf.ucw.cz> References: <1340805007-3313-1-git-send-email-dinguyen@altera.com> <1340805007-3313-2-git-send-email-dinguyen@altera.com> <4FF483D2.70000@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <4FF483D2.70000@gmail.com> X-Warning: Reading this can be dangerous to your mental health. User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Note: CRM114 invocation failed X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [195.113.26.193 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: linux-arm-kernel@lists.infradead.org, cytan@altera.com, linux@arm.linux.org.uk, wd@denx.de, dinguyen@altera.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Hi! [Oops, I missed few review comments; hard to see in all the quoted material.] > > +static inline void cpu_leave_lowpower(void) > > +{ > > + unsigned int v; > > + > > + asm volatile("mrc p15, 0, %0, c1, c0, 0\n" > > + " orr %0, %0, %1\n" > > + " mcr p15, 0, %0, c1, c0, 0\n" > > + " mrc p15, 0, %0, c1, c0, 1\n" > > + " orr %0, %0, #0x20\n" > > + " mcr p15, 0, %0, c1, c0, 1\n" > > + : "=&r" (v) > > + : "Ir" (CR_C) > > + : "cc"); > > +} > > + > > +static inline void platform_do_lowpower(unsigned int cpu, int *spurious) > > +{ > > + /* > > + * there is no power-control hardware on this platform, so all > > + * we can do is put the core into WFI; this is safe as the calling > > + * code will have already disabled interrupts > > Is this true or just copied from ARM Ltd platforms? No idea, probably copied. Dinh? But I guess it makes sense to just use the "WFI" for initial merge. > > +++ b/arch/arm/mach-socfpga/localtimer.c > > @@ -0,0 +1,34 @@ > > +/* > > + * Copyright (C) 2012 Altera Corporation > > + * Copyright (C) 2002 ARM Ltd. > > + * All Rights Reserved > > + * > > + * This program is free software; you can redistribute it and/or modify > > + * it under the terms of the GNU General Public License version 2 as > > + * published by the Free Software Foundation. > > + */ > > +#include > > +#include > > +#include > > +#include > > +#include > > + > > +#include > > + > > +/* > > + * Setup the local clock events for a CPU. > > + */ > > +int __cpuinit socfpga_local_timer_setup(struct clock_event_device *evt) > > +{ > > + struct device_node *np; > > + > > + np = of_find_compatible_node(NULL, NULL, "arm,smp-twd"); > > This compatible string is wrong (it changed). See the documentation. OK, I updated the string (like below), but... should this code be needed at all? Core should call this itself and socfpga_local_timer_setup does not seem to be called at all...? Pavel diff --git a/arch/arm/mach-socfpga/localtimer.c b/arch/arm/mach-socfpga/localtimer.c index 4aa9221..a616488 100644 --- a/arch/arm/mach-socfpga/localtimer.c +++ b/arch/arm/mach-socfpga/localtimer.c @@ -22,7 +22,7 @@ int __cpuinit socfpga_local_timer_setup(struct clock_event_device *evt) { struct device_node *np; - np = of_find_compatible_node(NULL, NULL, "arm,smp-twd"); + np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-twd-timer"); if (!twd_base) { twd_base = of_iomap(np, 0); WARN_ON(!twd_base);