* Re: [PULL REQUEST v2] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
@ 2012-03-05 21:41 Andrew Lunn
2012-03-05 22:25 ` Jason
0 siblings, 1 reply; 13+ messages in thread
From: Andrew Lunn @ 2012-03-05 21:41 UTC (permalink / raw)
To: jason-NLaQJdtUoK4Be96aLqz0jA
Cc: nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
> > If the drivers want to use it, I think it has to be orion_find_tclk for
> > drivers that are shared between multiple plat-orion platforms.
>
> That's pretty much all of them :-)
>
> I'll rename it and move it to plat-orion/common.c. This'll be fun.
Hi Jason
Maybe it is time to stop and consider a moment....
We have overlapping work going on. My adoption of Mike's generic clk
framework overlaps a lot with your DT tclk problems. If you introduce
orion_find_tclk() into all the drivers, we are probably going to rip
it all out again once my patches go in. Plus we are going to have
horrible merging conflicts between your code and my code
It seems more logical to get the clk code in first, then work on DT.
Could you task swap for a while? Maybe look at converting MPP to
pinmux and then add DT bindings for that. No tclk needed :-)
Andrew
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PULL REQUEST v2] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt 2012-03-05 21:41 [PULL REQUEST v2] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt Andrew Lunn @ 2012-03-05 22:25 ` Jason 0 siblings, 0 replies; 13+ messages in thread From: Jason @ 2012-03-05 22:25 UTC (permalink / raw) To: nicolas.pitre, grant.likely, devicetree-discuss, linux-arm-kernel On Mon, Mar 05, 2012 at 10:41:26PM +0100, Andrew Lunn wrote: > > > If the drivers want to use it, I think it has to be orion_find_tclk for > > > drivers that are shared between multiple plat-orion platforms. > > > > That's pretty much all of them :-) > > > > I'll rename it and move it to plat-orion/common.c. This'll be fun. This is old, see Nico's reply and my response. > We have overlapping work going on. My adoption of Mike's generic clk > framework overlaps a lot with your DT tclk problems. If you introduce > orion_find_tclk() into all the drivers, we are probably going to rip > it all out again once my patches go in. Plus we are going to have > horrible merging conflicts between your code and my code I'd love to deconflict but I haven't seen your RFC patches, yet. thx, Jason. ^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 0/5 v2] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt @ 2012-03-02 17:50 Jason Cooper 2012-03-02 17:50 ` [PATCH 5/5 v2] ARM: kirkwood: convert orion-wdt " Jason Cooper 0 siblings, 1 reply; 13+ messages in thread From: Jason Cooper @ 2012-03-02 17:50 UTC (permalink / raw) To: arnd-r2nGTMty4D4, grant.likely-s3s/WqlpOiPyB63q8FvJNQ Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Jason Cooper, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r This series begins the process of converting all of the drivers initialized from kirkwood_init() to devicetree. The first patch converts an off-SoC driver (spi) to device tree and moves flash partition definitions to the device tree. This was previously it's own submission, but I've included it here since I want this series to match the subsequent pull request against arm-soc/kirkwood/board. The second patch cleans up kirkwood_init() by moving a flag setting to it's appropriate location. This will help later when converting the audio driver. Next, I pull the functionality of kirkwood_init() into kirkwood_dt_init() in board-dt.c This way, as drivers are converted, their init calls can be removed from kirkwood_dt_init() and non-fdt users won't be affected (they call kirkwood_init()). Last, I converted the two easiest drivers, rtc and wdt. The xor and crypto drivers remain for a later patch series. Jason Cooper (5): ARM: kirkwood: covert orion-spi to fdt. ARM: kirkwood: move var setting to correct location. ARM: kirkwood: fdt: absorb kirkwood_init() ARM: kirkwood: convert rtc-mv to fdt. ARM: kirkwood: convert orion-wdt to fdt. arch/arm/boot/dts/kirkwood-dreamplug.dts | 34 +++++++++++++++ arch/arm/boot/dts/kirkwood.dtsi | 12 +++++ arch/arm/mach-kirkwood/board-dt.c | 67 +++++++++++------------------ arch/arm/mach-kirkwood/common.c | 21 +++++++-- arch/arm/mach-kirkwood/common.h | 6 +++ drivers/rtc/rtc-mv.c | 7 +++ drivers/spi/spi-orion.c | 37 +++++++++++++++-- drivers/watchdog/orion_wdt.c | 48 ++++++++++++++++----- 8 files changed, 170 insertions(+), 62 deletions(-) -- 1.7.3.4 ^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 5/5 v2] ARM: kirkwood: convert orion-wdt to fdt. 2012-03-02 17:50 [PATCH 0/5 " Jason Cooper @ 2012-03-02 17:50 ` Jason Cooper 2012-03-02 18:32 ` Arnd Bergmann 0 siblings, 1 reply; 13+ messages in thread From: Jason Cooper @ 2012-03-02 17:50 UTC (permalink / raw) To: arnd, grant.likely; +Cc: devicetree-discuss, Jason Cooper, linux-arm-kernel Converted register address to a variable so that it could be set from fdt. Also, pull clock frequency from fdt and clean up failure logic a bit. Same as rtc-mv, this device is used in all kirkwood boards. So, it is placed in kirkwood.dtsi. Signed-off-by: Jason Cooper <jason@lakedaemon.net> --- Changes since v1: - use of_match_ptr() arch/arm/boot/dts/kirkwood.dtsi | 6 ++++ arch/arm/mach-kirkwood/board-dt.c | 1 - arch/arm/mach-kirkwood/common.c | 2 +- arch/arm/mach-kirkwood/common.h | 1 - drivers/watchdog/orion_wdt.c | 48 +++++++++++++++++++++++++++--------- 5 files changed, 43 insertions(+), 15 deletions(-) diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi index 5fb185c..bf28424 100644 --- a/arch/arm/boot/dts/kirkwood.dtsi +++ b/arch/arm/boot/dts/kirkwood.dtsi @@ -8,5 +8,11 @@ reg = <0xf1010300 0x1f>; interrupts = <53>; }; + + wdt@fed20300 { + compatible = "marvell,orion-wdt"; + reg = <0xfed20300 0x28>; + clock-frequency = <200000000>; + }; }; diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c index 6e18338..fb03318 100644 --- a/arch/arm/mach-kirkwood/board-dt.c +++ b/arch/arm/mach-kirkwood/board-dt.c @@ -134,7 +134,6 @@ static void __init kirkwood_dt_init(void) #endif /* internal devices that every board has */ - kirkwood_wdt_init(); kirkwood_xor0_init(); kirkwood_xor1_init(); kirkwood_crypto_init(); diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c index 0c0375f..35dc40b 100644 --- a/arch/arm/mach-kirkwood/common.c +++ b/arch/arm/mach-kirkwood/common.c @@ -303,7 +303,7 @@ void __init kirkwood_xor1_init(void) /***************************************************************************** * Watchdog ****************************************************************************/ -void __init kirkwood_wdt_init(void) +static void __init kirkwood_wdt_init(void) { orion_wdt_init(kirkwood_tclk); } diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h index ca08826..ac4b2fb 100644 --- a/arch/arm/mach-kirkwood/common.h +++ b/arch/arm/mach-kirkwood/common.h @@ -53,7 +53,6 @@ void kirkwood_restart(char, const char *); char *kirkwood_id(void); void kirkwood_l2_init(void); -void kirkwood_wdt_init(void); void kirkwood_xor0_init(void); void kirkwood_xor1_init(void); void kirkwood_crypto_init(void); diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c index 4ad78f8..8704b98 100644 --- a/drivers/watchdog/orion_wdt.c +++ b/drivers/watchdog/orion_wdt.c @@ -17,6 +17,8 @@ #include <linux/fs.h> #include <linux/miscdevice.h> #include <linux/platform_device.h> +#include <linux/of_address.h> +#include <linux/of.h> #include <linux/watchdog.h> #include <linux/init.h> #include <linux/uaccess.h> @@ -28,9 +30,9 @@ /* * Watchdog timer block registers. */ -#define TIMER_CTRL (TIMER_VIRT_BASE + 0x0000) +#define TIMER_CTRL 0x0000 #define WDT_EN 0x0010 -#define WDT_VAL (TIMER_VIRT_BASE + 0x0024) +#define WDT_VAL 0x0024 #define WDT_MAX_CYCLE_COUNT 0xffffffff #define WDT_IN_USE 0 @@ -40,6 +42,7 @@ static int nowayout = WATCHDOG_NOWAYOUT; static int heartbeat = -1; /* module parameter (seconds) */ static unsigned int wdt_max_duration; /* (seconds) */ static unsigned int wdt_tclk; +static void __iomem *wdt_reg; static unsigned long wdt_status; static DEFINE_SPINLOCK(wdt_lock); @@ -48,7 +51,7 @@ static void orion_wdt_ping(void) spin_lock(&wdt_lock); /* Reload watchdog duration */ - writel(wdt_tclk * heartbeat, WDT_VAL); + writel(wdt_tclk * heartbeat, wdt_reg + WDT_VAL); spin_unlock(&wdt_lock); } @@ -60,7 +63,7 @@ static void orion_wdt_enable(void) spin_lock(&wdt_lock); /* Set watchdog duration */ - writel(wdt_tclk * heartbeat, WDT_VAL); + writel(wdt_tclk * heartbeat, wdt_reg + WDT_VAL); /* Clear watchdog timer interrupt */ reg = readl(BRIDGE_CAUSE); @@ -68,9 +71,9 @@ static void orion_wdt_enable(void) writel(reg, BRIDGE_CAUSE); /* Enable watchdog timer */ - reg = readl(TIMER_CTRL); + reg = readl(wdt_reg + TIMER_CTRL); reg |= WDT_EN; - writel(reg, TIMER_CTRL); + writel(reg, wdt_reg + TIMER_CTRL); /* Enable reset on watchdog */ reg = readl(RSTOUTn_MASK); @@ -92,9 +95,9 @@ static void orion_wdt_disable(void) writel(reg, RSTOUTn_MASK); /* Disable watchdog timer */ - reg = readl(TIMER_CTRL); + reg = readl(wdt_reg + TIMER_CTRL); reg &= ~WDT_EN; - writel(reg, TIMER_CTRL); + writel(reg, wdt_reg + TIMER_CTRL); spin_unlock(&wdt_lock); } @@ -102,7 +105,7 @@ static void orion_wdt_disable(void) static int orion_wdt_get_timeleft(int *time_left) { spin_lock(&wdt_lock); - *time_left = readl(WDT_VAL) / wdt_tclk; + *time_left = readl(wdt_reg + WDT_VAL) / wdt_tclk; spin_unlock(&wdt_lock); return 0; } @@ -236,15 +239,30 @@ static struct miscdevice orion_wdt_miscdev = { static int __devinit orion_wdt_probe(struct platform_device *pdev) { struct orion_wdt_platform_data *pdata = pdev->dev.platform_data; + struct device_node *np = pdev->dev.of_node; + struct resource res; int ret; - if (pdata) { + if (pdata) wdt_tclk = pdata->tclk; - } else { - printk(KERN_ERR "Orion Watchdog misses platform data\n"); + + of_property_read_u32(np, "clock-frequency", &wdt_tclk); + + if (!wdt_tclk) { + printk(KERN_ERR "Orion Watchdog can't get clock freq\n"); return -ENODEV; } + wdt_reg = (void __iomem *)TIMER_VIRT_BASE; + + ret = of_address_to_resource(np, 0, &res); + if (ret) { + printk(KERN_ERR "invalid address\n"); + return ret; + } + + wdt_reg = ioremap(res.start, res.end - res.start); + if (orion_wdt_miscdev.parent) return -EBUSY; orion_wdt_miscdev.parent = &pdev->dev; @@ -284,6 +302,11 @@ static void orion_wdt_shutdown(struct platform_device *pdev) orion_wdt_disable(); } +static struct of_device_id orion_wdt_of_match_table[] = { + { .compatible = "marvell,orion-wdt", }, + {}, +}; + static struct platform_driver orion_wdt_driver = { .probe = orion_wdt_probe, .remove = __devexit_p(orion_wdt_remove), @@ -291,6 +314,7 @@ static struct platform_driver orion_wdt_driver = { .driver = { .owner = THIS_MODULE, .name = "orion_wdt", + .of_match_table = of_match_ptr(orion_wdt_of_match_table), }, }; -- 1.7.3.4 ^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH 5/5 v2] ARM: kirkwood: convert orion-wdt to fdt. @ 2012-03-02 18:32 ` Arnd Bergmann [not found] ` <201203021832.34901.arnd-r2nGTMty4D4@public.gmane.org> 0 siblings, 1 reply; 13+ messages in thread From: Arnd Bergmann @ 2012-03-02 18:32 UTC (permalink / raw) To: Jason Cooper Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r On Friday 02 March 2012, Jason Cooper wrote: > + wdt_reg = (void __iomem *)TIMER_VIRT_BASE; > + > + ret = of_address_to_resource(np, 0, &res); > + if (ret) { > + printk(KERN_ERR "invalid address\n"); > + return ret; > + } > + > + wdt_reg = ioremap(res.start, res.end - res.start); > + This will break non-dt uses because you overwrite the wdt_reg value. As I commented before, I think the best approach would be to provide a hardcoded resource for the device in the legacy case and just use platform_get_resource() to get the resource and ioremap it in either case. of_address_to_resource() works only for the DT case, while platform_get_resource() works in either case. You need to add something like 8<--- diff --git a/arch/arm/plat-orion/common.c b/arch/arm/plat-orion/common.c index 089899a..d16f43f 100644 --- a/arch/arm/plat-orion/common.c +++ b/arch/arm/plat-orion/common.c @@ -568,13 +568,17 @@ void __init orion_spi_1_init(unsigned long mapbase, ****************************************************************************/ static struct orion_wdt_platform_data orion_wdt_data; +static struct resource orion_wdt_resource = + DEFINE_RES_MEM(TIMER_PHYS_BASE, 0x28); + static struct platform_device orion_wdt_device = { .name = "orion_wdt", .id = -1, .dev = { .platform_data = &orion_wdt_data, }, - .num_resources = 0, + .resources = &orion_wdt_resource, + .num_resources = 1, }; void __init orion_wdt_init(unsigned long tclk) ---->8 and an appropriate definition for TIMER_PHYS_BASE. Arnd ^ permalink raw reply related [flat|nested] 13+ messages in thread
[parent not found: <201203021832.34901.arnd-r2nGTMty4D4@public.gmane.org>]
* [PULL REQUEST v2] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt [not found] ` <201203021832.34901.arnd-r2nGTMty4D4@public.gmane.org> @ 2012-03-02 20:00 ` Jason [not found] ` <20120302200034.GQ11986-u4khhh1J0LxI1Ri9qeTfzeTW4wlIGRCZ@public.gmane.org> 0 siblings, 1 reply; 13+ messages in thread From: Jason @ 2012-03-02 20:00 UTC (permalink / raw) To: Arnd Bergmann Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r The following changes since commit 759a45185ac0e4dfaf8bbfcb390ec73aca4b7a34: ARM: kirkwood: convert uart0 to devicetree. (2012-02-27 16:21:44 +0000) are available in the git repository at: git://git.infradead.org/users/jcooper/linux-kirkwood.git kirkwood_dt_test Jason Cooper (5): ARM: kirkwood: covert orion-spi to fdt. ARM: kirkwood: move var setting to correct location. ARM: kirkwood: fdt: absorb kirkwood_init() ARM: kirkwood: convert rtc-mv to fdt. ARM: kirkwood: convert orion-wdt to fdt. arch/arm/boot/dts/kirkwood-dreamplug.dts | 34 +++++++++++++++ arch/arm/boot/dts/kirkwood.dtsi | 12 +++++ arch/arm/mach-kirkwood/board-dt.c | 67 +++++++++++------------------ arch/arm/mach-kirkwood/common.c | 21 +++++++-- arch/arm/mach-kirkwood/common.h | 6 +++ arch/arm/plat-orion/common.c | 7 +++- drivers/rtc/rtc-mv.c | 7 +++ drivers/spi/spi-orion.c | 37 +++++++++++++++-- drivers/watchdog/orion_wdt.c | 46 +++++++++++++++----- 9 files changed, 174 insertions(+), 63 deletions(-) ^ permalink raw reply [flat|nested] 13+ messages in thread
[parent not found: <20120302200034.GQ11986-u4khhh1J0LxI1Ri9qeTfzeTW4wlIGRCZ@public.gmane.org>]
* Re: [PULL REQUEST v2] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt [not found] ` <20120302200034.GQ11986-u4khhh1J0LxI1Ri9qeTfzeTW4wlIGRCZ@public.gmane.org> @ 2012-03-02 20:35 ` Arnd Bergmann [not found] ` <201203022035.44672.arnd-r2nGTMty4D4@public.gmane.org> 0 siblings, 1 reply; 13+ messages in thread From: Arnd Bergmann @ 2012-03-02 20:35 UTC (permalink / raw) To: Jason Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r On Friday 02 March 2012, Jason wrote: > The following changes since commit 759a45185ac0e4dfaf8bbfcb390ec73aca4b7a34: > > ARM: kirkwood: convert uart0 to devicetree. (2012-02-27 16:21:44 +0000) > > are available in the git repository at: > git://git.infradead.org/users/jcooper/linux-kirkwood.git kirkwood_dt_test > Applied to next/dt branch. Thanks, Arnd ^ permalink raw reply [flat|nested] 13+ messages in thread
[parent not found: <201203022035.44672.arnd-r2nGTMty4D4@public.gmane.org>]
* Re: [PULL REQUEST v2] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt [not found] ` <201203022035.44672.arnd-r2nGTMty4D4@public.gmane.org> @ 2012-03-02 21:18 ` Arnd Bergmann [not found] ` <201203022118.05796.arnd-r2nGTMty4D4@public.gmane.org> 0 siblings, 1 reply; 13+ messages in thread From: Arnd Bergmann @ 2012-03-02 21:18 UTC (permalink / raw) To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Jason, Nicolas Pitre On Friday 02 March 2012, Arnd Bergmann wrote: > On Friday 02 March 2012, Jason wrote: > > The following changes since commit 759a45185ac0e4dfaf8bbfcb390ec73aca4b7a34: > > > > ARM: kirkwood: convert uart0 to devicetree. (2012-02-27 16:21:44 +0000) > > > > are available in the git repository at: > > git://git.infradead.org/users/jcooper/linux-kirkwood.git kirkwood_dt_test > > > > Applied to next/dt branch. On second thought, I should probably wait for the maintainer to comment as well ;-) Nico, does this look ok to you? Arnd ^ permalink raw reply [flat|nested] 13+ messages in thread
[parent not found: <201203022118.05796.arnd-r2nGTMty4D4@public.gmane.org>]
* Re: [PULL REQUEST v2] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt [not found] ` <201203022118.05796.arnd-r2nGTMty4D4@public.gmane.org> @ 2012-03-05 18:49 ` Nicolas Pitre [not found] ` <alpine.LFD.2.02.1203051344130.31242-QuJgVwGFrdf/9pzu0YdTqQ@public.gmane.org> 0 siblings, 1 reply; 13+ messages in thread From: Nicolas Pitre @ 2012-03-05 18:49 UTC (permalink / raw) To: Arnd Bergmann Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Jason, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r On Fri, 2 Mar 2012, Arnd Bergmann wrote: > On Friday 02 March 2012, Arnd Bergmann wrote: > > On Friday 02 March 2012, Jason wrote: > > > The following changes since commit 759a45185ac0e4dfaf8bbfcb390ec73aca4b7a34: > > > > > > ARM: kirkwood: convert uart0 to devicetree. (2012-02-27 16:21:44 +0000) > > > > > > are available in the git repository at: > > > git://git.infradead.org/users/jcooper/linux-kirkwood.git kirkwood_dt_test > > > > > > > Applied to next/dt branch. > > On second thought, I should probably wait for the maintainer to comment > as well ;-) > > Nico, does this look ok to you? The clock frequency part being hardcoded to 200000 in the common .dtsi file looks wrong. The clock may differ, and it used to (and should) be probed at run time, please see kirkwood_find_tclk(). Nicolas ^ permalink raw reply [flat|nested] 13+ messages in thread
[parent not found: <alpine.LFD.2.02.1203051344130.31242-QuJgVwGFrdf/9pzu0YdTqQ@public.gmane.org>]
* Re: [PULL REQUEST v2] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt [not found] ` <alpine.LFD.2.02.1203051344130.31242-QuJgVwGFrdf/9pzu0YdTqQ@public.gmane.org> @ 2012-03-05 19:15 ` Jason [not found] ` <20120305191546.GK5050-u4khhh1J0LxI1Ri9qeTfzeTW4wlIGRCZ@public.gmane.org> 0 siblings, 1 reply; 13+ messages in thread From: Jason @ 2012-03-05 19:15 UTC (permalink / raw) To: Nicolas Pitre Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r On Mon, Mar 05, 2012 at 01:49:35PM -0500, Nicolas Pitre wrote: > On Fri, 2 Mar 2012, Arnd Bergmann wrote: > > > On Friday 02 March 2012, Arnd Bergmann wrote: > > > On Friday 02 March 2012, Jason wrote: > > > > The following changes since commit 759a45185ac0e4dfaf8bbfcb390ec73aca4b7a34: > > > > > > > > ARM: kirkwood: convert uart0 to devicetree. (2012-02-27 16:21:44 +0000) > > > > > > > > are available in the git repository at: > > > > git://git.infradead.org/users/jcooper/linux-kirkwood.git kirkwood_dt_test > > > > > > > > > > Applied to next/dt branch. > > > > On second thought, I should probably wait for the maintainer to comment > > as well ;-) > > > > Nico, does this look ok to you? > > The clock frequency part being hardcoded to 200000 in the common .dtsi > file looks wrong. The clock may differ, and it used to (and should) be > probed at run time, please see kirkwood_find_tclk(). So, should I EXPORT_SYMBOL_GPL(kirkwood_find_tclk); and have each driver call it? One alternate idea I had was to have kirkwood-dreamplug.dts root hold tclk: clock-frequency = <200000000>; and then have the drivers ask for it. afaict, tclk is constant per board. I'm fine with either way, but I'd rather have it in the dt. thx, Jason. ^ permalink raw reply [flat|nested] 13+ messages in thread
[parent not found: <20120305191546.GK5050-u4khhh1J0LxI1Ri9qeTfzeTW4wlIGRCZ@public.gmane.org>]
* Re: [PULL REQUEST v2] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt [not found] ` <20120305191546.GK5050-u4khhh1J0LxI1Ri9qeTfzeTW4wlIGRCZ@public.gmane.org> @ 2012-03-05 20:16 ` Arnd Bergmann [not found] ` <201203052016.26949.arnd-r2nGTMty4D4@public.gmane.org> 0 siblings, 1 reply; 13+ messages in thread From: Arnd Bergmann @ 2012-03-05 20:16 UTC (permalink / raw) To: Jason Cc: Nicolas Pitre, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r On Monday 05 March 2012, Jason wrote: > > > > The clock frequency part being hardcoded to 200000 in the common .dtsi > > file looks wrong. The clock may differ, and it used to (and should) be > > probed at run time, please see kirkwood_find_tclk(). > > So, should I EXPORT_SYMBOL_GPL(kirkwood_find_tclk); and have each driver > call it? If the drivers want to use it, I think it has to be orion_find_tclk for drivers that are shared between multiple plat-orion platforms. > One alternate idea I had was to have kirkwood-dreamplug.dts root hold > > tclk: clock-frequency = <200000000>; > > and then have the drivers ask for it. afaict, tclk is constant per > board. > > I'm fine with either way, but I'd rather have it in the dt. IMHO it's best to leave any such hacks out of the device tree for now, until we have the proper clk bindings in place for kirkwood, and then we can just use those. Arnd ^ permalink raw reply [flat|nested] 13+ messages in thread
[parent not found: <201203052016.26949.arnd-r2nGTMty4D4@public.gmane.org>]
* Re: [PULL REQUEST v2] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt [not found] ` <201203052016.26949.arnd-r2nGTMty4D4@public.gmane.org> @ 2012-03-05 20:29 ` Jason [not found] ` <20120305202941.GN5050-u4khhh1J0LxI1Ri9qeTfzeTW4wlIGRCZ@public.gmane.org> 0 siblings, 1 reply; 13+ messages in thread From: Jason @ 2012-03-05 20:29 UTC (permalink / raw) To: Arnd Bergmann Cc: Nicolas Pitre, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r On Mon, Mar 05, 2012 at 08:16:26PM +0000, Arnd Bergmann wrote: > On Monday 05 March 2012, Jason wrote: > > > > > > The clock frequency part being hardcoded to 200000 in the common .dtsi > > > file looks wrong. The clock may differ, and it used to (and should) be > > > probed at run time, please see kirkwood_find_tclk(). > > > > So, should I EXPORT_SYMBOL_GPL(kirkwood_find_tclk); and have each driver > > call it? > > If the drivers want to use it, I think it has to be orion_find_tclk for > drivers that are shared between multiple plat-orion platforms. That's pretty much all of them :-) I'll rename it and move it to plat-orion/common.c. This'll be fun. > > One alternate idea I had was to have kirkwood-dreamplug.dts root hold > > > > tclk: clock-frequency = <200000000>; > > > > and then have the drivers ask for it. afaict, tclk is constant per > > board. > > > > I'm fine with either way, but I'd rather have it in the dt. > > IMHO it's best to leave any such hacks out of the device tree for > now, until we have the proper clk bindings in place for kirkwood, > and then we can just use those. Ok. thx, Jason. ^ permalink raw reply [flat|nested] 13+ messages in thread
[parent not found: <20120305202941.GN5050-u4khhh1J0LxI1Ri9qeTfzeTW4wlIGRCZ@public.gmane.org>]
* Re: [PULL REQUEST v2] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt [not found] ` <20120305202941.GN5050-u4khhh1J0LxI1Ri9qeTfzeTW4wlIGRCZ@public.gmane.org> @ 2012-03-05 20:43 ` Nicolas Pitre [not found] ` <alpine.LFD.2.02.1203051542190.31242-QuJgVwGFrdf/9pzu0YdTqQ@public.gmane.org> 0 siblings, 1 reply; 13+ messages in thread From: Nicolas Pitre @ 2012-03-05 20:43 UTC (permalink / raw) To: Jason Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r On Mon, 5 Mar 2012, Jason wrote: > On Mon, Mar 05, 2012 at 08:16:26PM +0000, Arnd Bergmann wrote: > > On Monday 05 March 2012, Jason wrote: > > > > > > > > The clock frequency part being hardcoded to 200000 in the common .dtsi > > > > file looks wrong. The clock may differ, and it used to (and should) be > > > > probed at run time, please see kirkwood_find_tclk(). > > > > > > So, should I EXPORT_SYMBOL_GPL(kirkwood_find_tclk); and have each driver > > > call it? > > > > If the drivers want to use it, I think it has to be orion_find_tclk for > > drivers that are shared between multiple plat-orion platforms. > > That's pretty much all of them :-) > > I'll rename it and move it to plat-orion/common.c. This'll be fun. No no... This is not a function which is generic at all. The _result_ i.e. core clock frequency value is a generic thing, not the method to determine it. Nicolas ^ permalink raw reply [flat|nested] 13+ messages in thread
[parent not found: <alpine.LFD.2.02.1203051542190.31242-QuJgVwGFrdf/9pzu0YdTqQ@public.gmane.org>]
* Re: [PULL REQUEST v2] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt [not found] ` <alpine.LFD.2.02.1203051542190.31242-QuJgVwGFrdf/9pzu0YdTqQ@public.gmane.org> @ 2012-03-05 21:17 ` Jason [not found] ` <20120305211737.GO5050-u4khhh1J0LxI1Ri9qeTfzeTW4wlIGRCZ@public.gmane.org> 0 siblings, 1 reply; 13+ messages in thread From: Jason @ 2012-03-05 21:17 UTC (permalink / raw) To: Nicolas Pitre Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r On Mon, Mar 05, 2012 at 03:43:42PM -0500, Nicolas Pitre wrote: > On Mon, 5 Mar 2012, Jason wrote: > > > On Mon, Mar 05, 2012 at 08:16:26PM +0000, Arnd Bergmann wrote: > > > On Monday 05 March 2012, Jason wrote: > > > > > > > > > > The clock frequency part being hardcoded to 200000 in the common .dtsi > > > > > file looks wrong. The clock may differ, and it used to (and should) be > > > > > probed at run time, please see kirkwood_find_tclk(). > > > > > > > > So, should I EXPORT_SYMBOL_GPL(kirkwood_find_tclk); and have each driver > > > > call it? > > > > > > If the drivers want to use it, I think it has to be orion_find_tclk for > > > drivers that are shared between multiple plat-orion platforms. > > > > That's pretty much all of them :-) > > > > I'll rename it and move it to plat-orion/common.c. This'll be fun. > > No no... This is not a function which is generic at all. The _result_ > i.e. core clock frequency value is a generic thing, not the method to > determine it. How about this? Export a global variable, orion_tclk, and a function to read it. Then, make sure each sub arch sets the global. Does this sound viable until common clk lands? thx, Jason. btw - when I received your email I was in the middle of convincing myself that I could hack together a common orion_find_tclk(). It was rapidly becoming a bad idea. :-) ^ permalink raw reply [flat|nested] 13+ messages in thread
[parent not found: <20120305211737.GO5050-u4khhh1J0LxI1Ri9qeTfzeTW4wlIGRCZ@public.gmane.org>]
* Re: [PULL REQUEST v2] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt [not found] ` <20120305211737.GO5050-u4khhh1J0LxI1Ri9qeTfzeTW4wlIGRCZ@public.gmane.org> @ 2012-03-05 21:27 ` Nicolas Pitre [not found] ` <alpine.LFD.2.02.1203051626370.31242-QuJgVwGFrdf/9pzu0YdTqQ@public.gmane.org> 0 siblings, 1 reply; 13+ messages in thread From: Nicolas Pitre @ 2012-03-05 21:27 UTC (permalink / raw) To: Jason Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r On Mon, 5 Mar 2012, Jason wrote: > On Mon, Mar 05, 2012 at 03:43:42PM -0500, Nicolas Pitre wrote: > > On Mon, 5 Mar 2012, Jason wrote: > > > > > On Mon, Mar 05, 2012 at 08:16:26PM +0000, Arnd Bergmann wrote: > > > > On Monday 05 March 2012, Jason wrote: > > > > > > > > > > > > The clock frequency part being hardcoded to 200000 in the common .dtsi > > > > > > file looks wrong. The clock may differ, and it used to (and should) be > > > > > > probed at run time, please see kirkwood_find_tclk(). > > > > > > > > > > So, should I EXPORT_SYMBOL_GPL(kirkwood_find_tclk); and have each driver > > > > > call it? > > > > > > > > If the drivers want to use it, I think it has to be orion_find_tclk for > > > > drivers that are shared between multiple plat-orion platforms. > > > > > > That's pretty much all of them :-) > > > > > > I'll rename it and move it to plat-orion/common.c. This'll be fun. > > > > No no... This is not a function which is generic at all. The _result_ > > i.e. core clock frequency value is a generic thing, not the method to > > determine it. > > How about this? Export a global variable, orion_tclk, and a function to > read it. Then, make sure each sub arch sets the global. Does this > sound viable until common clk lands? Yep, looks fine. Nicolas ^ permalink raw reply [flat|nested] 13+ messages in thread
[parent not found: <alpine.LFD.2.02.1203051626370.31242-QuJgVwGFrdf/9pzu0YdTqQ@public.gmane.org>]
* Re: [PULL REQUEST v2] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt [not found] ` <alpine.LFD.2.02.1203051626370.31242-QuJgVwGFrdf/9pzu0YdTqQ@public.gmane.org> @ 2012-03-06 14:29 ` Jason 0 siblings, 0 replies; 13+ messages in thread From: Jason @ 2012-03-06 14:29 UTC (permalink / raw) To: Nicolas Pitre Cc: andrew-g2DYL2Zd6BY, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r On Mon, Mar 05, 2012 at 04:27:27PM -0500, Nicolas Pitre wrote: > On Mon, 5 Mar 2012, Jason wrote: > > > On Mon, Mar 05, 2012 at 03:43:42PM -0500, Nicolas Pitre wrote: > > > On Mon, 5 Mar 2012, Jason wrote: > > > > > > > On Mon, Mar 05, 2012 at 08:16:26PM +0000, Arnd Bergmann wrote: > > > > > On Monday 05 March 2012, Jason wrote: > > > > > > > > > > > > > > The clock frequency part being hardcoded to 200000 in the common .dtsi > > > > > > > file looks wrong. The clock may differ, and it used to (and should) be > > > > > > > probed at run time, please see kirkwood_find_tclk(). > > > > > > > > > > > > So, should I EXPORT_SYMBOL_GPL(kirkwood_find_tclk); and have each driver > > > > > > call it? > > > > > > > > > > If the drivers want to use it, I think it has to be orion_find_tclk for > > > > > drivers that are shared between multiple plat-orion platforms. > > > > > > > > That's pretty much all of them :-) > > > > > > > > I'll rename it and move it to plat-orion/common.c. This'll be fun. > > > > > > No no... This is not a function which is generic at all. The _result_ > > > i.e. core clock frequency value is a generic thing, not the method to > > > determine it. > > > > How about this? Export a global variable, orion_tclk, and a function to > > read it. Then, make sure each sub arch sets the global. Does this > > sound viable until common clk lands? > > Yep, looks fine. I just got a first look at Andrew's patches for using the generic clk across plat/orion. There's a lot of good stuff in there. I'll start building my series on top of his (and obviously Mike's clk series). thx, Jason. ^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2012-03-06 14:29 UTC | newest] Thread overview: 13+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2012-03-05 21:41 [PULL REQUEST v2] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt Andrew Lunn 2012-03-05 22:25 ` Jason -- strict thread matches above, loose matches on Subject: below -- 2012-03-02 17:50 [PATCH 0/5 " Jason Cooper 2012-03-02 17:50 ` [PATCH 5/5 v2] ARM: kirkwood: convert orion-wdt " Jason Cooper 2012-03-02 18:32 ` Arnd Bergmann [not found] ` <201203021832.34901.arnd-r2nGTMty4D4@public.gmane.org> 2012-03-02 20:00 ` [PULL REQUEST v2] ARM: kirkwood: fdt: convert kirkwood init funcs " Jason [not found] ` <20120302200034.GQ11986-u4khhh1J0LxI1Ri9qeTfzeTW4wlIGRCZ@public.gmane.org> 2012-03-02 20:35 ` Arnd Bergmann [not found] ` <201203022035.44672.arnd-r2nGTMty4D4@public.gmane.org> 2012-03-02 21:18 ` Arnd Bergmann [not found] ` <201203022118.05796.arnd-r2nGTMty4D4@public.gmane.org> 2012-03-05 18:49 ` Nicolas Pitre [not found] ` <alpine.LFD.2.02.1203051344130.31242-QuJgVwGFrdf/9pzu0YdTqQ@public.gmane.org> 2012-03-05 19:15 ` Jason [not found] ` <20120305191546.GK5050-u4khhh1J0LxI1Ri9qeTfzeTW4wlIGRCZ@public.gmane.org> 2012-03-05 20:16 ` Arnd Bergmann [not found] ` <201203052016.26949.arnd-r2nGTMty4D4@public.gmane.org> 2012-03-05 20:29 ` Jason [not found] ` <20120305202941.GN5050-u4khhh1J0LxI1Ri9qeTfzeTW4wlIGRCZ@public.gmane.org> 2012-03-05 20:43 ` Nicolas Pitre [not found] ` <alpine.LFD.2.02.1203051542190.31242-QuJgVwGFrdf/9pzu0YdTqQ@public.gmane.org> 2012-03-05 21:17 ` Jason [not found] ` <20120305211737.GO5050-u4khhh1J0LxI1Ri9qeTfzeTW4wlIGRCZ@public.gmane.org> 2012-03-05 21:27 ` Nicolas Pitre [not found] ` <alpine.LFD.2.02.1203051626370.31242-QuJgVwGFrdf/9pzu0YdTqQ@public.gmane.org> 2012-03-06 14:29 ` Jason
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).