summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2009-06-17 00:30:22 -0600
committerGrant Likely <grant.likely@secretlab.ca>2009-06-17 00:30:22 -0600
commit87c441e54dfcf9f45593ecaf68e7e18ea53d5e13 (patch)
tree6a986caab77412a90ffe8c5d8788bc1216b10ed8 /drivers
parentc155ee10c212254e9cdfe7b3eab4e8c13990c231 (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 'drivers')
-rw-r--r--drivers/ata/pata_mpc52xx.c2
-rw-r--r--drivers/i2c/busses/i2c-mpc.c2
-rw-r--r--drivers/net/fec_mpc52xx.c2
-rw-r--r--drivers/net/fec_mpc52xx_phy.c2
-rw-r--r--drivers/serial/mpc52xx_uart.c5
-rw-r--r--drivers/watchdog/mpc5200_wdt.c2
6 files changed, 7 insertions, 8 deletions
diff --git a/drivers/ata/pata_mpc52xx.c b/drivers/ata/pata_mpc52xx.c
index 68d27bc70d06..2bc2dbe30e8f 100644
--- a/drivers/ata/pata_mpc52xx.c
+++ b/drivers/ata/pata_mpc52xx.c
@@ -694,7 +694,7 @@ mpc52xx_ata_probe(struct of_device *op, const struct of_device_id *match)
struct bcom_task *dmatsk = NULL;
/* Get ipb frequency */
- ipb_freq = mpc52xx_find_ipb_freq(op->node);
+ ipb_freq = mpc5xxx_get_bus_frequency(op->node);
if (!ipb_freq) {
dev_err(&op->dev, "could not determine IPB bus frequency\n");
return -ENODEV;
diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c
index dd778d7ae047..d325e86e3103 100644
--- a/drivers/i2c/busses/i2c-mpc.c
+++ b/drivers/i2c/busses/i2c-mpc.c
@@ -197,7 +197,7 @@ int mpc_i2c_get_fdr_52xx(struct device_node *node, u32 clock, int prescaler)
return -EINVAL;
/* Determine divider value */
- divider = mpc52xx_find_ipb_freq(node) / clock;
+ divider = mpc5xxx_get_bus_frequency(node) / clock;
/*
* We want to choose an FDR/DFSR that generates an I2C bus speed that
diff --git a/drivers/net/fec_mpc52xx.c b/drivers/net/fec_mpc52xx.c
index 8bbe7f617994..5ddf03325d16 100644
--- a/drivers/net/fec_mpc52xx.c
+++ b/drivers/net/fec_mpc52xx.c
@@ -1006,7 +1006,7 @@ mpc52xx_fec_probe(struct of_device *op, const struct of_device_id *match)
priv->phy_addr = FEC5200_PHYADDR_NONE;
priv->speed = 100;
priv->duplex = DUPLEX_HALF;
- priv->phy_speed = ((mpc52xx_find_ipb_freq(op->node) >> 20) / 5) << 1;
+ priv->phy_speed = ((mpc5xxx_get_bus_frequency(op->node) >> 20) / 5) << 1;
/* the 7-wire property means don't use MII mode */
if (of_find_property(op->node, "fsl,7-wire-mode", NULL))
diff --git a/drivers/net/fec_mpc52xx_phy.c b/drivers/net/fec_mpc52xx_phy.c
index dd9bfa42ac34..176e9b8d7101 100644
--- a/drivers/net/fec_mpc52xx_phy.c
+++ b/drivers/net/fec_mpc52xx_phy.c
@@ -120,7 +120,7 @@ static int mpc52xx_fec_mdio_probe(struct of_device *of,
/* set MII speed */
out_be32(&priv->regs->mii_speed,
- ((mpc52xx_find_ipb_freq(of->node) >> 20) / 5) << 1);
+ ((mpc5xxx_get_bus_frequency(of->node) >> 20) / 5) << 1);
err = mdiobus_register(bus);
if (err)
diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c
index b3feb6198d57..abbd146c50d9 100644
--- a/drivers/serial/mpc52xx_uart.c
+++ b/drivers/serial/mpc52xx_uart.c
@@ -76,7 +76,6 @@
#include <linux/of_platform.h>
#include <asm/mpc52xx.h>
-#include <asm/mpc512x.h>
#include <asm/mpc52xx_psc.h>
#if defined(CONFIG_SERIAL_MPC52xx_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
@@ -254,7 +253,7 @@ static unsigned long mpc52xx_getuartclk(void *p)
* but the generic serial code assumes 16
* so return ipb freq / 2
*/
- return mpc52xx_find_ipb_freq(p) / 2;
+ return mpc5xxx_get_bus_frequency(p) / 2;
}
static struct psc_ops mpc52xx_psc_ops = {
@@ -391,7 +390,7 @@ static void mpc512x_psc_cw_restore_ints(struct uart_port *port)
static unsigned long mpc512x_getuartclk(void *p)
{
- return mpc512x_find_ips_freq(p);
+ return mpc5xxx_get_bus_frequency(p);
}
static struct psc_ops mpc512x_psc_ops = {
diff --git a/drivers/watchdog/mpc5200_wdt.c b/drivers/watchdog/mpc5200_wdt.c
index 465fe36adad4..fa9c47ce0ae7 100644
--- a/drivers/watchdog/mpc5200_wdt.c
+++ b/drivers/watchdog/mpc5200_wdt.c
@@ -188,7 +188,7 @@ static int mpc5200_wdt_probe(struct of_device *op,
if (!wdt)
return -ENOMEM;
- wdt->ipb_freq = mpc52xx_find_ipb_freq(op->node);
+ wdt->ipb_freq = mpc5xxx_get_bus_frequency(op->node);
err = of_address_to_resource(op->node, 0, &wdt->mem);
if (err)