aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/52xx
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-03-20 01:27:57 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-03-20 01:27:57 -0400
commit77ecfe8d427f554fabbf258e9d789f1d4c3afd63 (patch)
tree67061a5f384312854e5c114434a047c35b38b6b0 /arch/powerpc/platforms/52xx
parent8d73f102d9606fe217a9577a437f84b9fed6d45d (diff)
parenta7e1cf0c517d44db8e871a86b2cf7ea7e7d06a4b (diff)
Merge commit 'gcl/next' into next
Diffstat (limited to 'arch/powerpc/platforms/52xx')
-rw-r--r--arch/powerpc/platforms/52xx/Kconfig1
-rw-r--r--arch/powerpc/platforms/52xx/mpc5200_simple.c3
-rw-r--r--arch/powerpc/platforms/52xx/mpc52xx_common.c37
-rw-r--r--arch/powerpc/platforms/52xx/mpc52xx_gpt.c39
4 files changed, 40 insertions, 40 deletions
diff --git a/arch/powerpc/platforms/52xx/Kconfig b/arch/powerpc/platforms/52xx/Kconfig
index e0b9454ae691..8b8e9560a315 100644
--- a/arch/powerpc/platforms/52xx/Kconfig
+++ b/arch/powerpc/platforms/52xx/Kconfig
@@ -24,6 +24,7 @@ config PPC_MPC5200_SIMPLE
24 are: 24 are:
25 intercontrol,digsy-mtc 25 intercontrol,digsy-mtc
26 phytec,pcm030 26 phytec,pcm030
27 phytec,pcm032
27 promess,motionpro 28 promess,motionpro
28 schindler,cm5200 29 schindler,cm5200
29 tqc,tqm5200 30 tqc,tqm5200
diff --git a/arch/powerpc/platforms/52xx/mpc5200_simple.c b/arch/powerpc/platforms/52xx/mpc5200_simple.c
index d5e1471e51f7..c31e5b534f0a 100644
--- a/arch/powerpc/platforms/52xx/mpc5200_simple.c
+++ b/arch/powerpc/platforms/52xx/mpc5200_simple.c
@@ -51,8 +51,9 @@ static void __init mpc5200_simple_setup_arch(void)
51/* list of the supported boards */ 51/* list of the supported boards */
52static char *board[] __initdata = { 52static char *board[] __initdata = {
53 "intercontrol,digsy-mtc", 53 "intercontrol,digsy-mtc",
54 "promess,motionpro",
55 "phytec,pcm030", 54 "phytec,pcm030",
55 "phytec,pcm032",
56 "promess,motionpro",
56 "schindler,cm5200", 57 "schindler,cm5200",
57 "tqc,tqm5200", 58 "tqc,tqm5200",
58 NULL 59 NULL
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_common.c b/arch/powerpc/platforms/52xx/mpc52xx_common.c
index e9d2cf632eeb..8e3dd5a0f228 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_common.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_common.c
@@ -206,6 +206,43 @@ int mpc52xx_set_psc_clkdiv(int psc_id, int clkdiv)
206EXPORT_SYMBOL(mpc52xx_set_psc_clkdiv); 206EXPORT_SYMBOL(mpc52xx_set_psc_clkdiv);
207 207
208/** 208/**
209 * mpc52xx_get_xtal_freq - Get SYS_XTAL_IN frequency for a device
210 *
211 * @node: device node
212 *
213 * Returns the frequency of the external oscillator clock connected
214 * to the SYS_XTAL_IN pin, or 0 if it cannot be determined.
215 */
216unsigned int mpc52xx_get_xtal_freq(struct device_node *node)
217{
218 u32 val;
219 unsigned int freq;
220
221 if (!mpc52xx_cdm)
222 return 0;
223
224 freq = mpc52xx_find_ipb_freq(node);
225 if (!freq)
226 return 0;
227
228 if (in_8(&mpc52xx_cdm->ipb_clk_sel) & 0x1)
229 freq *= 2;
230
231 val = in_be32(&mpc52xx_cdm->rstcfg);
232 if (val & (1 << 5))
233 freq *= 8;
234 else
235 freq *= 4;
236 if (val & (1 << 6))
237 freq /= 12;
238 else
239 freq /= 16;
240
241 return freq;
242}
243EXPORT_SYMBOL(mpc52xx_get_xtal_freq);
244
245/**
209 * mpc52xx_restart: ppc_md->restart hook for mpc5200 using the watchdog timer 246 * mpc52xx_restart: ppc_md->restart hook for mpc5200 using the watchdog timer
210 */ 247 */
211void 248void
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_gpt.c b/arch/powerpc/platforms/52xx/mpc52xx_gpt.c
index cb038dc67a85..bfbcd418e690 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_gpt.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_gpt.c
@@ -335,44 +335,6 @@ static void
335mpc52xx_gpt_gpio_setup(struct mpc52xx_gpt_priv *p, struct device_node *np) { } 335mpc52xx_gpt_gpio_setup(struct mpc52xx_gpt_priv *p, struct device_node *np) { }
336#endif /* defined(CONFIG_GPIOLIB) */ 336#endif /* defined(CONFIG_GPIOLIB) */
337 337
338/***********************************************************************
339 * SYSFS attributes
340 */
341#if defined(CONFIG_SYSFS)
342static ssize_t mpc52xx_gpt_show_regs(struct device *dev,
343 struct device_attribute *attr, char *buf)
344{
345 struct mpc52xx_gpt_priv *gpt = dev_get_drvdata(dev);
346 int i, len = 0;
347 u32 __iomem *regs = (void __iomem *) gpt->regs;
348
349 for (i = 0; i < 4; i++)
350 len += sprintf(buf + len, "%.8x ", in_be32(regs + i));
351 len += sprintf(buf + len, "\n");
352
353 return len;
354}
355
356static struct device_attribute mpc52xx_gpt_attrib[] = {
357 __ATTR(regs, S_IRUGO | S_IWUSR, mpc52xx_gpt_show_regs, NULL),
358};
359
360static void mpc52xx_gpt_create_attribs(struct mpc52xx_gpt_priv *gpt)
361{
362 int i, err = 0;
363
364 for (i = 0; i < ARRAY_SIZE(mpc52xx_gpt_attrib); i++) {
365 err = device_create_file(gpt->dev, &mpc52xx_gpt_attrib[i]);
366 if (err)
367 dev_err(gpt->dev, "error creating attribute %i\n", i);
368 }
369
370}
371
372#else /* defined(CONFIG_SYSFS) */
373static void mpc52xx_gpt_create_attribs(struct mpc52xx_gpt_priv *) { return 0; }
374#endif /* defined(CONFIG_SYSFS) */
375
376/* --------------------------------------------------------------------- 338/* ---------------------------------------------------------------------
377 * of_platform bus binding code 339 * of_platform bus binding code
378 */ 340 */
@@ -395,7 +357,6 @@ static int __devinit mpc52xx_gpt_probe(struct of_device *ofdev,
395 357
396 dev_set_drvdata(&ofdev->dev, gpt); 358 dev_set_drvdata(&ofdev->dev, gpt);
397 359
398 mpc52xx_gpt_create_attribs(gpt);
399 mpc52xx_gpt_gpio_setup(gpt, ofdev->node); 360 mpc52xx_gpt_gpio_setup(gpt, ofdev->node);
400 mpc52xx_gpt_irq_setup(gpt, ofdev->node); 361 mpc52xx_gpt_irq_setup(gpt, ofdev->node);
401 362