From patchwork Mon Mar 23 01:39:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ola Jeppsson X-Patchwork-Id: 6068541 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8B6E5BF90F for ; Mon, 23 Mar 2015 01:42:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B21202021B for ; Mon, 23 Mar 2015 01:42:17 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B493320218 for ; Mon, 23 Mar 2015 01:42:16 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YZrLd-0002Bp-Bo; Mon, 23 Mar 2015 01:40:09 +0000 Received: from mail-lb0-f171.google.com ([209.85.217.171]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YZrLY-0001BP-O8 for linux-arm-kernel@lists.infradead.org; Mon, 23 Mar 2015 01:40:05 +0000 Received: by lbbrr9 with SMTP id rr9so44228227lbb.0 for ; Sun, 22 Mar 2015 18:39:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:content-type:content-transfer-encoding; bh=Kj2b7ZF/7z2aDcKpTrUkTGjdn+lzygiwioEASQiSqyQ=; b=EPs7vlA9KB1v/JO3GtSqpaPyTj4d9yth9Pd1c766rOJDjipfeTNSV1pJa1Cnuy5g3x c8BBhyf4YkGq3ft4+1/BYmBxVuoi+kbC3cl4pqpm7wgH+IR7Wcb0+9nfJ06/IpU98c0L 9ZE62F8ljKjgRo7xEzEzjoyPJ2Bi0iMzjx6DCHowXsO7uFKNZgctYsoM0WtlQScpLhip sCWhw4mx0ZSiKUVY9uCRuFQyJQFnbQvTqJpFnEoQb1LD7eBn+Q1D5v7CExxeW34MwHSi QcKlFs7sElFQYc8sOaQ8LdXL6YzGW+IjA9u8bCuV11FOSIzTnlfrtjNwgZF106j7S+M8 JS1w== X-Gm-Message-State: ALoCoQm/T8KXCQzRUnhXFGW7fJ0NOG501Njq0k7nT2HHTPqKs3u2fkp0plJEIB/QhB9aTbBFNojx X-Received: by 10.152.6.34 with SMTP id x2mr74835392lax.47.1427074781962; Sun, 22 Mar 2015 18:39:41 -0700 (PDT) Received: from [192.168.0.143] (tulip.olf.sgsnet.se. [46.239.120.142]) by mx.google.com with ESMTPSA id yt9sm1736856lab.44.2015.03.22.18.39.39 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 22 Mar 2015 18:39:41 -0700 (PDT) Message-ID: <550F6EDA.30709@adapteva.com> Date: Mon, 23 Mar 2015 02:39:38 +0100 From: Ola Jeppsson User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Michal Simek Subject: [PATCH v2] arm: zynq: Fix system clock with multi_v7_defconfig X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150322_184004_985188_EEA468EC X-CRM114-Status: GOOD ( 11.59 ) X-Spam-Score: -0.7 (/) Cc: linux-arm-kernel@lists.infradead.org, =?windows-1252?Q?Andreas_F=E4rber?= , =?windows-1252?Q?S=F6ren_Brinkmann?= X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP As mentioned in this commit: arm: zynq: Don't use arm_global_timer with cpufreq 61f1fc7e9258a169ac8afb5ddf657a181e60d052 arm_global_timer depends on the CPU frequency. With cpufreq altering the CPU frequency arm_global_timer will not maintain a stable time base. So arm_global_timer must not be the clocksource when cpufreq is enabled. The above commit tries to solve this at build time by only selecting CONFIG_ARM_GLOBAL_TIMER if CONFIG_CPU_FREQ is disabled. This is not always sufficient because other machs can also enable CONFIG_ARM_GLOBAL_TIMER. Therefore: If built with CONFIG_CPU_FREQ and CONFIG_ARM_GLOBAL_TIMER, disable (on Zynq) the arm_global_timer devicetree node at boot before clock sources are initialized. This ensures that arm_global_timer will not be selected clocksource. Signed-off-by: Ola Jeppsson --- arch/arm/mach-zynq/common.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/arch/arm/mach-zynq/common.c b/arch/arm/mach-zynq/common.c index c887196..a4666d4 100644 --- a/arch/arm/mach-zynq/common.c +++ b/arch/arm/mach-zynq/common.c @@ -148,10 +148,36 @@ out: platform_device_register_full(&devinfo); } +#if defined(CONFIG_CPU_FREQ) && defined(CONFIG_ARM_GLOBAL_TIMER) +static struct property zynq_disable_arm_global_timer_prop = { + .name = "status", + .length = sizeof("disabled"), + .value = "disabled" +}; + +static void __init zynq_disable_arm_global_timer(void) +{ + struct device_node *np; + + np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-global-timer"); + if (!np) + return; + + pr_info("%s: disabling arm_global_timer node\n", __func__); + + if (of_update_property(np, &zynq_disable_arm_global_timer_prop)) + pr_warn("%s: could not disable arm_global_timer node\n", + __func__); +} +#endif + static void __init zynq_timer_init(void) { zynq_early_slcr_init(); +#if defined(CONFIG_CPU_FREQ) && defined(CONFIG_ARM_GLOBAL_TIMER) + zynq_disable_arm_global_timer(); +#endif zynq_clock_init(); of_clk_init(NULL); clocksource_of_init();