From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Lunn Subject: Re: [PATCH 5/5] arm: mvebu: Added SMP support for Armada XP Date: Mon, 22 Oct 2012 20:45:37 +0200 Message-ID: <20121022184537.GN21046@lunn.ch> References: <1350925368-24243-1-git-send-email-gregory.clement@free-electrons.com> <1350925368-24243-6-git-send-email-gregory.clement@free-electrons.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1350925368-24243-6-git-send-email-gregory.clement@free-electrons.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: Gregory CLEMENT Cc: Lior Amsalem , Andrew Lunn , Ike Pan , Will Deacon , Nadav Haklai , Ian Molton , David Marlin , Yehuda Yitschak , Jani Monoses , Russell King , Tawfik Bayouk , Dan Frazier , Eran Ben-Avi , Li Li , Leif Lindholm , Sebastian Hesselbarth , Jason Cooper , Arnd Bergmann , Jon Masters , devicetree-discuss@lists.ozlabs.org, Rob Herring , Ben Dooks , Mike Turquette , linux-arm-kernel@lists.infradead.or List-Id: devicetree@vger.kernel.org Hi Gregory > +void __init set_secondary_cpus_clock(void) > +{ > + int cpu; > + unsigned long rate; > + struct clk *cpu_clk = NULL; > + struct device_node *np = NULL; > + > + cpu = smp_processor_id(); > + np = of_find_node_by_type(np, "cpu"); > + np = NULL; > + while ((np = of_find_node_by_type(np, "cpu"))) { > + const u32 *reg; > + int len; > + reg = of_get_property(np, "reg", &len); > + if (!reg || len != 4) { > + pr_err("%s missing reg property\n", np->full_name); > + continue; > + } > + if (be32_to_cpup(reg) == cpu) { > + cpu_clk = of_clk_get(np, 0); > + break; > + } > + } > + WARN_ON(IS_ERR(cpu_clk)); > + rate = clk_get_rate(cpu_clk); > + > + /* set all the other CPU clk to the same rate than the boot CPU */ > + np = NULL; > + while ((np = of_find_node_by_type(np, "cpu"))) { > + const u32 *reg; > + int len; > + reg = of_get_property(np, "reg", &len); > + if (!reg || len != 4) { > + pr_err("%s missing reg property\n", np->full_name); > + continue; > + } > + if (be32_to_cpup(reg) != cpu) { > + cpu_clk = of_clk_get(np, 0); > + clk_set_rate(cpu_clk, rate); > + } Maybe its hiding somewhere, but where is the clk_prepare_enable() for this cpu_clk clock? Andrew From mboxrd@z Thu Jan 1 00:00:00 1970 From: andrew@lunn.ch (Andrew Lunn) Date: Mon, 22 Oct 2012 20:45:37 +0200 Subject: [PATCH 5/5] arm: mvebu: Added SMP support for Armada XP In-Reply-To: <1350925368-24243-6-git-send-email-gregory.clement@free-electrons.com> References: <1350925368-24243-1-git-send-email-gregory.clement@free-electrons.com> <1350925368-24243-6-git-send-email-gregory.clement@free-electrons.com> Message-ID: <20121022184537.GN21046@lunn.ch> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hi Gregory > +void __init set_secondary_cpus_clock(void) > +{ > + int cpu; > + unsigned long rate; > + struct clk *cpu_clk = NULL; > + struct device_node *np = NULL; > + > + cpu = smp_processor_id(); > + np = of_find_node_by_type(np, "cpu"); > + np = NULL; > + while ((np = of_find_node_by_type(np, "cpu"))) { > + const u32 *reg; > + int len; > + reg = of_get_property(np, "reg", &len); > + if (!reg || len != 4) { > + pr_err("%s missing reg property\n", np->full_name); > + continue; > + } > + if (be32_to_cpup(reg) == cpu) { > + cpu_clk = of_clk_get(np, 0); > + break; > + } > + } > + WARN_ON(IS_ERR(cpu_clk)); > + rate = clk_get_rate(cpu_clk); > + > + /* set all the other CPU clk to the same rate than the boot CPU */ > + np = NULL; > + while ((np = of_find_node_by_type(np, "cpu"))) { > + const u32 *reg; > + int len; > + reg = of_get_property(np, "reg", &len); > + if (!reg || len != 4) { > + pr_err("%s missing reg property\n", np->full_name); > + continue; > + } > + if (be32_to_cpup(reg) != cpu) { > + cpu_clk = of_clk_get(np, 0); > + clk_set_rate(cpu_clk, rate); > + } Maybe its hiding somewhere, but where is the clk_prepare_enable() for this cpu_clk clock? Andrew