diff options
author | Wolfgang Denk <wd@denx.de> | 2009-06-17 02:30:22 -0400 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2009-06-17 02:30:22 -0400 |
commit | 87c441e54dfcf9f45593ecaf68e7e18ea53d5e13 (patch) | |
tree | 6a986caab77412a90ffe8c5d8788bc1216b10ed8 /arch/powerpc/platforms/52xx | |
parent | c155ee10c212254e9cdfe7b3eab4e8c13990c231 (diff) |
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/52xx')
-rw-r--r-- | arch/powerpc/platforms/52xx/mpc52xx_common.c | 32 |
1 files changed, 1 insertions, 31 deletions
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_common.c b/arch/powerpc/platforms/52xx/mpc52xx_common.c index 8e3dd5a0f228..a46bad0c2339 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); | |||
47 | static struct mpc52xx_gpt __iomem *mpc52xx_wdt; | 47 | static struct mpc52xx_gpt __iomem *mpc52xx_wdt; |
48 | static struct mpc52xx_cdm __iomem *mpc52xx_cdm; | 48 | static struct mpc52xx_cdm __iomem *mpc52xx_cdm; |
49 | 49 | ||
50 | /** | ||
51 | * mpc52xx_find_ipb_freq - Find the IPB bus frequency for a device | ||
52 | * @node: device node | ||
53 | * | ||
54 | * Returns IPB bus frequency, or 0 if the bus frequency cannot be found. | ||
55 | */ | ||
56 | unsigned int | ||
57 | mpc52xx_find_ipb_freq(struct device_node *node) | ||
58 | { | ||
59 | struct device_node *np; | ||
60 | const unsigned int *p_ipb_freq = NULL; | ||
61 | |||
62 | of_node_get(node); | ||
63 | while (node) { | ||
64 | p_ipb_freq = of_get_property(node, "bus-frequency", NULL); | ||
65 | if (p_ipb_freq) | ||
66 | break; | ||
67 | |||
68 | np = of_get_parent(node); | ||
69 | of_node_put(node); | ||
70 | node = np; | ||
71 | } | ||
72 | if (node) | ||
73 | of_node_put(node); | ||
74 | |||
75 | return p_ipb_freq ? *p_ipb_freq : 0; | ||
76 | } | ||
77 | EXPORT_SYMBOL(mpc52xx_find_ipb_freq); | ||
78 | |||
79 | |||
80 | /* | 50 | /* |
81 | * Configure the XLB arbiter settings to match what Linux expects. | 51 | * Configure the XLB arbiter settings to match what Linux expects. |
82 | */ | 52 | */ |
@@ -221,7 +191,7 @@ unsigned int mpc52xx_get_xtal_freq(struct device_node *node) | |||
221 | if (!mpc52xx_cdm) | 191 | if (!mpc52xx_cdm) |
222 | return 0; | 192 | return 0; |
223 | 193 | ||
224 | freq = mpc52xx_find_ipb_freq(node); | 194 | freq = mpc5xxx_get_bus_frequency(node); |
225 | if (!freq) | 195 | if (!freq) |
226 | return 0; | 196 | return 0; |
227 | 197 | ||