diff options
author | Wolfgang Denk <wd@denx.de> | 2009-06-17 00:30:22 -0600 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2009-06-17 00:30:22 -0600 |
commit | 87c441e54dfcf9f45593ecaf68e7e18ea53d5e13 (patch) | |
tree | 6a986caab77412a90ffe8c5d8788bc1216b10ed8 /arch/powerpc/platforms | |
parent | c155ee10c212254e9cdfe7b3eab4e8c13990c231 (diff) | |
download | kernel-crypto-87c441e54dfcf9f45593ecaf68e7e18ea53d5e13.tar.gz kernel-crypto-87c441e54dfcf9f45593ecaf68e7e18ea53d5e13.tar.xz kernel-crypto-87c441e54dfcf9f45593ecaf68e7e18ea53d5e13.zip |
powerpc/5xxx: Add common mpc5xxx_get_bus_frequency() function
So far, MPC512x used mpc512x_find_ips_freq() to get the bus frequency,
while MPC52xx used mpc52xx_find_ipb_freq(). Despite the different
clock names (IPS vs. IPB) the code was identical.
Use common code for both processor families.
Signed-off-by: Wolfgang Denk <wd@denx.de>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'arch/powerpc/platforms')
-rw-r--r-- | arch/powerpc/platforms/512x/clock.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/512x/mpc512x.h | 1 | ||||
-rw-r--r-- | arch/powerpc/platforms/512x/mpc512x_shared.c | 23 | ||||
-rw-r--r-- | arch/powerpc/platforms/52xx/mpc52xx_common.c | 32 |
4 files changed, 2 insertions, 56 deletions
diff --git a/arch/powerpc/platforms/512x/clock.c b/arch/powerpc/platforms/512x/clock.c index 1bcff94eb92..f4c4c6f807d 100644 --- a/arch/powerpc/platforms/512x/clock.c +++ b/arch/powerpc/platforms/512x/clock.c @@ -24,7 +24,7 @@ #include <linux/io.h> #include <linux/of_platform.h> -#include <asm/mpc512x.h> +#include <asm/mpc5xxx.h> #include <asm/clk_interface.h> #undef CLK_DEBUG diff --git a/arch/powerpc/platforms/512x/mpc512x.h b/arch/powerpc/platforms/512x/mpc512x.h index 9c03693cb00..22a5352407e 100644 --- a/arch/powerpc/platforms/512x/mpc512x.h +++ b/arch/powerpc/platforms/512x/mpc512x.h @@ -11,7 +11,6 @@ #ifndef __MPC512X_H__ #define __MPC512X_H__ -extern unsigned long mpc512x_find_ips_freq(struct device_node *node); extern void __init mpc512x_init_IRQ(void); void __init mpc512x_declare_of_platform_devices(void); #endif /* __MPC512X_H__ */ diff --git a/arch/powerpc/platforms/512x/mpc512x_shared.c b/arch/powerpc/platforms/512x/mpc512x_shared.c index d8cd579f319..434d683df5a 100644 --- a/arch/powerpc/platforms/512x/mpc512x_shared.c +++ b/arch/powerpc/platforms/512x/mpc512x_shared.c @@ -24,29 +24,6 @@ #include "mpc512x.h" -unsigned long -mpc512x_find_ips_freq(struct device_node *node) -{ - struct device_node *np; - const unsigned int *p_ips_freq = NULL; - - of_node_get(node); - while (node) { - p_ips_freq = of_get_property(node, "bus-frequency", NULL); - if (p_ips_freq) - break; - - np = of_get_parent(node); - of_node_put(node); - node = np; - } - if (node) - of_node_put(node); - - return p_ips_freq ? *p_ips_freq : 0; -} -EXPORT_SYMBOL(mpc512x_find_ips_freq); - void __init mpc512x_init_IRQ(void) { struct device_node *np; diff --git a/arch/powerpc/platforms/52xx/mpc52xx_common.c b/arch/powerpc/platforms/52xx/mpc52xx_common.c index 8e3dd5a0f22..a46bad0c233 100644 --- a/arch/powerpc/platforms/52xx/mpc52xx_common.c +++ b/arch/powerpc/platforms/52xx/mpc52xx_common.c @@ -47,36 +47,6 @@ static DEFINE_SPINLOCK(mpc52xx_lock); static struct mpc52xx_gpt __iomem *mpc52xx_wdt; static struct mpc52xx_cdm __iomem *mpc52xx_cdm; -/** - * mpc52xx_find_ipb_freq - Find the IPB bus frequency for a device - * @node: device node - * - * Returns IPB bus frequency, or 0 if the bus frequency cannot be found. - */ -unsigned int -mpc52xx_find_ipb_freq(struct device_node *node) -{ - struct device_node *np; - const unsigned int *p_ipb_freq = NULL; - - of_node_get(node); - while (node) { - p_ipb_freq = of_get_property(node, "bus-frequency", NULL); - if (p_ipb_freq) - break; - - np = of_get_parent(node); - of_node_put(node); - node = np; - } - if (node) - of_node_put(node); - - return p_ipb_freq ? *p_ipb_freq : 0; -} -EXPORT_SYMBOL(mpc52xx_find_ipb_freq); - - /* * Configure the XLB arbiter settings to match what Linux expects. */ @@ -221,7 +191,7 @@ unsigned int mpc52xx_get_xtal_freq(struct device_node *node) if (!mpc52xx_cdm) return 0; - freq = mpc52xx_find_ipb_freq(node); + freq = mpc5xxx_get_bus_frequency(node); if (!freq) return 0; |