Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753190AbdHNQMm (ORCPT ); Mon, 14 Aug 2017 12:12:42 -0400 Received: from smtprelay.synopsys.com ([198.182.47.9]:52419 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753113AbdHNQMe (ORCPT ); Mon, 14 Aug 2017 12:12:34 -0400 From: Eugeniy Paltsev To: linux-snps-arc@lists.infradead.org Cc: linux-kernel@vger.kernel.org, Vineet Gupta , Alexey Brodkin , Rob Herring , Mark Rutland , devicetree@vger.kernel.org, Eugeniy Paltsev Subject: [PATCH 5/5] ARC: AXS103: use cpu-freq param instead of /cpu_card/core_clk Date: Mon, 14 Aug 2017 19:12:13 +0300 Message-Id: <20170814161213.17522-6-Eugeniy.Paltsev@synopsys.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170814161213.17522-1-Eugeniy.Paltsev@synopsys.com> References: <20170814161213.17522-1-Eugeniy.Paltsev@synopsys.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1807 Lines: 48 Use cpu's node "cpu-freq" param instead of platform-specific "/cpu_card/core_clk" as it works only if we use fixed-clock for cpu clocking. Signed-off-by: Eugeniy Paltsev --- arch/arc/plat-axs10x/axs10x.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/arch/arc/plat-axs10x/axs10x.c b/arch/arc/plat-axs10x/axs10x.c index 98d07b7..75118fdc 100644 --- a/arch/arc/plat-axs10x/axs10x.c +++ b/arch/arc/plat-axs10x/axs10x.c @@ -337,20 +337,16 @@ union pll_reg { static void __init axs103_early_init(void) { - /* - * TODO: use cpu node "cpu-freq" param instead of platform-specific - * "/cpu_card/core_clk" as it works only if we use fixed-clock for cpu. - */ - int offset = fdt_path_offset(initial_boot_params, "/cpu_card/core_clk"); + int offset = fdt_path_offset(initial_boot_params, "/cpus/cpu@0"); const struct fdt_property *prop = fdt_get_property(initial_boot_params, offset, - "clock-frequency", + "cpu-freq", NULL); u32 freq = be32_to_cpu(*(u32*)(prop->data)) / 1000000, orig = freq; /* * AXS103 configurations for SMP/QUAD configurations share device tree - * which defaults to 90 MHz. However recent failures of Quad config + * which defaults to 100 MHz. However recent failures of Quad config * revealed P&R timing violations so clamp it down to safe 50 MHz * Instead of duplicating defconfig/DT for SMP/QUAD, add a small hack * @@ -367,7 +363,7 @@ static void __init axs103_early_init(void) if (freq != orig ) { freq = cpu_to_be32(freq * 1000000); fdt_setprop_inplace(initial_boot_params, offset, - "clock-frequency", &freq, sizeof(freq)); + "cpu-freq", &freq, sizeof(freq)); } /* Memory maps already config in pre-bootloader */ -- 2.9.3