diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2012-02-28 21:57:50 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-02-29 09:15:09 +0100 |
commit | 9f0749e3eb88f94bfca2f24c77472d29bc18eb28 (patch) | |
tree | e42cc791bd1b501d5640d3db86c34bf1a8559f08 /arch/arm/mach-imx/clock-imx27.c | |
parent | 6b21d18ed50c7d145220b0724ea7f2613abf0f95 (diff) |
ARM i.MX27: Add devicetree support
This patch adds basic devicetree support for i.MX27 based SoCs.
Only the bindings for which drivers exist are added here:
- UART
- fec
- CSPI
- I2C
- watchdog
- gpio
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-imx/clock-imx27.c')
-rw-r--r-- | arch/arm/mach-imx/clock-imx27.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/clock-imx27.c b/arch/arm/mach-imx/clock-imx27.c index 88fe00a146e..01ae3a45bd7 100644 --- a/arch/arm/mach-imx/clock-imx27.c +++ b/arch/arm/mach-imx/clock-imx27.c @@ -22,6 +22,7 @@ #include <linux/io.h> #include <linux/module.h> #include <linux/clkdev.h> +#include <linux/of.h> #include <asm/div64.h> @@ -764,3 +765,20 @@ int __init mx27_clocks_init(unsigned long fref) return 0; } +#ifdef CONFIG_OF +int __init mx27_clocks_init_dt(void) +{ + struct device_node *np; + u32 fref = 26000000; /* default */ + + for_each_compatible_node(np, NULL, "fixed-clock") { + if (!of_device_is_compatible(np, "fsl,imx-osc26m")) + continue; + + if (!of_property_read_u32(np, "clock-frequency", &fref)) + break; + } + + return mx27_clocks_init(fref); +} +#endif |