From patchwork Wed May 20 13:55:02 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 24991 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n4KDw1LP005032 for ; Wed, 20 May 2009 13:58:01 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753217AbZETN56 (ORCPT ); Wed, 20 May 2009 09:57:58 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753352AbZETN56 (ORCPT ); Wed, 20 May 2009 09:57:58 -0400 Received: from wf-out-1314.google.com ([209.85.200.170]:14643 "EHLO wf-out-1314.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753217AbZETN56 (ORCPT ); Wed, 20 May 2009 09:57:58 -0400 Received: by wf-out-1314.google.com with SMTP id 26so150466wfd.4 for ; Wed, 20 May 2009 06:57:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:date:message-id :subject; bh=sansbwDBW8K9NOHww0XMc/tHSACSg7gaZfqMUOdZY4Q=; b=GURUU3O1gynlPqugvtO9RSq/cgeg4W9fTwovJn2SrJ8l9fkzAWnh3+ERJH90OSXNgX kH+y/VgpD/RUMUOf2a+T5CvkPcnVhYa1mJMqsolOp6MCRa0L3yZbMe+g0rSYeVh1ve0u YXCDwPAIhGMhz5kXOmoKtyYxj7np4Gy1bZ5sI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:subject; b=j91Rq2Mu0r5G9Uq7QAG3ja+MyhvzA9s82gg0DrdVYzLooE1uk5VlVOHXJwDlUbauKa fqnwPTItRhC8IyywUaMTkwfPA/6M3HxNyzpARFVWwbRObdCXppoqY6IRqz+MAsd+AuL2 7Cjsq2mO+WpaEcWy+lMnnz0ZeFaBKlQS5J+ts= Received: by 10.142.116.12 with SMTP id o12mr457199wfc.332.1242827879406; Wed, 20 May 2009 06:57:59 -0700 (PDT) Received: from rx1.opensource.se (210.5.32.202.bf.2iij.net [202.32.5.210]) by mx.google.com with ESMTPS id 29sm235534wfg.8.2009.05.20.06.57.57 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 20 May 2009 06:57:58 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Cc: Magnus Damm , lethal@linux-sh.org Date: Wed, 20 May 2009 22:55:02 +0900 Message-Id: <20090520135502.7742.12748.sendpatchset@rx1.opensource.se> Subject: [PATCH] sh: CONFIG_SH_CLK_DISABLE_LEGACY Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org From: Magnus Damm Invert legacy kconfig logic in clkfwk branch. Instead of building clock-cpg.c if CONFIG_SH_CLK_CPG_LEGACY is set, let CONFIG_SH_CLK_DISABLE_LEGACY be no by default and let upgraded processors use select to disable the legacy code. While at it, put clock-cpg.c code in clock.c and wrap it in ifdefs to only build if CONFIG_SH_CLK_DISABLE_LEGACY is set to no. Signed-off-by: Magnus Damm --- arch/sh/Kconfig | 5 +-- arch/sh/kernel/cpu/Makefile | 1 arch/sh/kernel/cpu/clock-cpg.c | 60 --------------------------------------- arch/sh/kernel/cpu/clock.c | 61 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 64 insertions(+), 63 deletions(-) -- 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 --- 0001/arch/sh/Kconfig +++ work/arch/sh/Kconfig 2009-05-20 21:40:26.000000000 +0900 @@ -398,6 +398,7 @@ config CPU_SUBTYPE_SH7785 select CPU_SHX2 select ARCH_SPARSEMEM_ENABLE select SYS_SUPPORTS_NUMA + select SH_CLK_DISABLE_LEGACY config CPU_SUBTYPE_SH7786 bool "Support SH7786 processor" @@ -513,8 +514,8 @@ config SH_PCLK_FREQ This is necessary for determining the reference clock value on platforms lacking an RTC. -config SH_CLK_CPG_LEGACY - def_bool y if !CPU_SUBTYPE_SH7785 +config SH_CLK_DISABLE_LEGACY + def_bool n config SH_CLK_MD int "CPU Mode Pin Setting" --- 0001/arch/sh/kernel/cpu/Makefile +++ work/arch/sh/kernel/cpu/Makefile 2009-05-20 21:39:39.000000000 +0900 @@ -17,6 +17,5 @@ obj-$(CONFIG_ARCH_SHMOBILE) += shmobile/ obj-$(CONFIG_UBC_WAKEUP) += ubc.o obj-$(CONFIG_SH_ADC) += adc.o -obj-$(CONFIG_SH_CLK_CPG_LEGACY) += clock-cpg.o obj-y += irq/ init.o clock.o --- 0001/arch/sh/kernel/cpu/clock-cpg.c +++ /dev/null 2009-05-19 12:17:43.197032281 +0900 @@ -1,60 +0,0 @@ -#include -#include -#include - -static struct clk master_clk = { - .name = "master_clk", - .flags = CLK_ENABLE_ON_INIT, - .rate = CONFIG_SH_PCLK_FREQ, -}; - -static struct clk peripheral_clk = { - .name = "peripheral_clk", - .parent = &master_clk, - .flags = CLK_ENABLE_ON_INIT, -}; - -static struct clk bus_clk = { - .name = "bus_clk", - .parent = &master_clk, - .flags = CLK_ENABLE_ON_INIT, -}; - -static struct clk cpu_clk = { - .name = "cpu_clk", - .parent = &master_clk, - .flags = CLK_ENABLE_ON_INIT, -}; - -/* - * The ordering of these clocks matters, do not change it. - */ -static struct clk *onchip_clocks[] = { - &master_clk, - &peripheral_clk, - &bus_clk, - &cpu_clk, -}; - -int __init __deprecated cpg_clk_init(void) -{ - int i, ret = 0; - - for (i = 0; i < ARRAY_SIZE(onchip_clocks); i++) { - struct clk *clk = onchip_clocks[i]; - arch_init_clk_ops(&clk->ops, i); - if (clk->ops) - ret |= clk_register(clk); - } - - return ret; -} - -/* - * Placeholder for compatability, until the lazy CPUs do this - * on their own. - */ -int __init __weak arch_clk_init(void) -{ - return cpg_clk_init(); -} --- 0001/arch/sh/kernel/cpu/clock.c +++ work/arch/sh/kernel/cpu/clock.c 2009-05-20 21:39:28.000000000 +0900 @@ -585,3 +585,64 @@ err_out: return err; } late_initcall(clk_debugfs_init); + +#ifndef CONFIG_SH_CLK_DISABLE_LEGACY + +static struct clk master_clk = { + .name = "master_clk", + .flags = CLK_ENABLE_ON_INIT, + .rate = CONFIG_SH_PCLK_FREQ, +}; + +static struct clk peripheral_clk = { + .name = "peripheral_clk", + .parent = &master_clk, + .flags = CLK_ENABLE_ON_INIT, +}; + +static struct clk bus_clk = { + .name = "bus_clk", + .parent = &master_clk, + .flags = CLK_ENABLE_ON_INIT, +}; + +static struct clk cpu_clk = { + .name = "cpu_clk", + .parent = &master_clk, + .flags = CLK_ENABLE_ON_INIT, +}; + +/* + * The ordering of these clocks matters, do not change it. + */ +static struct clk *onchip_clocks[] = { + &master_clk, + &peripheral_clk, + &bus_clk, + &cpu_clk, +}; + +int __init __deprecated cpg_clk_init(void) +{ + int i, ret = 0; + + for (i = 0; i < ARRAY_SIZE(onchip_clocks); i++) { + struct clk *clk = onchip_clocks[i]; + arch_init_clk_ops(&clk->ops, i); + if (clk->ops) + ret |= clk_register(clk); + } + + return ret; +} + +/* + * Placeholder for compatability, until the lazy CPUs do this + * on their own. + */ +int __init __weak arch_clk_init(void) +{ + return cpg_clk_init(); +} + +#endif /* CONFIG_SH_CLK_DISABLE_LEGACY */