linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: John Rigby <jrigby@freescale.com>
To: linuxppc-dev@ozlabs.org
Subject: [PATCH 6/7] Add mpc512x_find_ips_freq
Date: Tue,  8 Jan 2008 09:01:32 -0700	[thread overview]
Message-ID: <1199808093-15929-7-git-send-email-jrigby@freescale.com> (raw)
In-Reply-To: <1199808093-15929-6-git-send-email-jrigby@freescale.com>

Added mpc512x_find_ips_freq needed by the following
serial driver patch.  It is basically a renamed
mpc512x_find_ipd_freq from 52xx.

Signed-off-by: John Rigby <jrigby@freescale.com>
---
 arch/powerpc/platforms/512x/mpc5121_ads.c |   28 ++++++++++++++++++++++++++++
 include/asm-powerpc/mpc512x.h             |   22 ++++++++++++++++++++++
 2 files changed, 50 insertions(+), 0 deletions(-)
 create mode 100644 include/asm-powerpc/mpc512x.h

diff --git a/arch/powerpc/platforms/512x/mpc5121_ads.c b/arch/powerpc/platforms/512x/mpc5121_ads.c
index a860bf0..2f4cfee 100644
--- a/arch/powerpc/platforms/512x/mpc5121_ads.c
+++ b/arch/powerpc/platforms/512x/mpc5121_ads.c
@@ -36,6 +36,34 @@
 #include <asm/time.h>
 #include <asm/of_platform.h>
 
+/**
+ * 	mpc512x_find_ips_freq - Find the IPB bus frequency for a device
+ * 	@node:	device node
+ *
+ * 	Returns IPS bus frequency, or 0 if the bus frequency cannot be found.
+ */
+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;
+}
+
 static void __init mpc5121_ads_setup_arch(void)
 {
 	if (ppc_md.progress)
diff --git a/include/asm-powerpc/mpc512x.h b/include/asm-powerpc/mpc512x.h
new file mode 100644
index 0000000..c48a165
--- /dev/null
+++ b/include/asm-powerpc/mpc512x.h
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2007 Freescale Semiconductor, Inc. All rights reserved.
+ *
+ * Author: John Rigby, <jrigby@freescale.com>, Friday Apr 13 2007
+ *
+ * Description:
+ * MPC5121 Prototypes and definitions
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ */
+
+#ifndef __ASM_POWERPC_MPC512x_H__
+#define __ASM_POWERPC_MPC512x_H__
+
+extern unsigned long mpc512x_find_ips_freq(struct device_node *node);
+
+#endif /* __ASM_POWERPC_MPC512x_H__ */
+
-- 
1.5.3.5.726.g41a7a

  reply	other threads:[~2008-01-08 16:01 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-08 16:01 [PATCH 0/7] mpc5121 support John Rigby
2008-01-08 16:01 ` [PATCH 1/7] mpc5121: Add IPIC config option John Rigby
2008-01-08 16:01   ` [PATCH 2/7] Add mpc512x ipic support John Rigby
2008-01-08 16:01     ` [PATCH 3/7] Basic Freescale MPC512x support John Rigby
2008-01-08 16:01       ` [PATCH 4/7] Device tree for MPC5121 ADS John Rigby
2008-01-08 16:01         ` [PATCH 5/7] Separate MPC52xx PSC FIFO registers from rest of PSC John Rigby
2008-01-08 16:01           ` John Rigby [this message]
2008-01-08 16:01             ` [PATCH 7/7] Add MPC512x PSC serial driver John Rigby
2008-01-08 17:32               ` Grant Likely
2008-01-08 17:47                 ` John Rigby
2008-01-08 20:16                   ` Grant Likely
2008-01-09  3:16               ` Stephen Rothwell
2008-01-09  6:06                 ` Stephen Rothwell
2008-01-08 17:27             ` [PATCH 6/7] Add mpc512x_find_ips_freq Grant Likely
2008-01-08 18:15             ` Arnd Bergmann
2008-01-08 17:26           ` [PATCH 5/7] Separate MPC52xx PSC FIFO registers from rest of PSC Grant Likely
2008-01-08 17:25         ` [PATCH 4/7] Device tree for MPC5121 ADS Grant Likely
2008-01-08 19:22         ` Scott Wood
2008-01-10  2:18         ` David Gibson
2008-01-08 17:19       ` [PATCH 3/7] Basic Freescale MPC512x support Grant Likely
2008-01-08 17:55         ` Scott Wood
2008-01-08 17:56           ` Grant Likely
2008-01-08 19:25             ` Scott Wood
2008-01-08 20:37               ` Generic desktop/server/laptop lable is confusing [Was Re: [PATCH 3/7] Basic Freescale MPC512x support] John Rigby
2008-01-08 21:40                 ` Grant Likely
2008-01-08 21:46                   ` Scott Wood
2008-01-08 17:40       ` [PATCH 3/7] Basic Freescale MPC512x support Olof Johansson
2008-01-08 17:44         ` Jon Loeliger
2008-01-08 18:01         ` John Rigby
2008-01-08 18:13         ` Arnd Bergmann
2008-01-08 18:16         ` John Rigby
2008-01-08 18:07       ` Arnd Bergmann
2008-01-08 18:25         ` John Rigby
2008-01-09  2:36       ` Stephen Rothwell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1199808093-15929-7-git-send-email-jrigby@freescale.com \
    --to=jrigby@freescale.com \
    --cc=linuxppc-dev@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).