Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 87c441e5 authored by Wolfgang Denk's avatar Wolfgang Denk Committed by Grant Likely
Browse files

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: default avatarWolfgang Denk <wd@denx.de>
Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
parent c155ee10
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@
#ifndef __ASSEMBLY__
#include <asm/types.h>
#include <asm/prom.h>
#include <asm/mpc5xxx.h>
#endif /* __ASSEMBLY__ */

#include <linux/suspend.h>
@@ -268,7 +269,6 @@ struct mpc52xx_intr {
#ifndef __ASSEMBLY__

/* mpc52xx_common.c */
extern unsigned int mpc52xx_find_ipb_freq(struct device_node *node);
extern void mpc5200_setup_xlb_arbiter(void);
extern void mpc52xx_declare_of_platform_devices(void);
extern void mpc52xx_map_common_devices(void);
+5 −5
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@
 * Author: John Rigby, <jrigby@freescale.com>, Friday Apr 13 2007
 *
 * Description:
 * MPC5121 Prototypes and definitions
 * MPC5xxx 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
@@ -13,10 +13,10 @@
 *
 */

#ifndef __ASM_POWERPC_MPC512x_H__
#define __ASM_POWERPC_MPC512x_H__
#ifndef __ASM_POWERPC_MPC5xxx_H__
#define __ASM_POWERPC_MPC5xxx_H__

extern unsigned long mpc512x_find_ips_freq(struct device_node *node);
extern unsigned long mpc5xxx_get_bus_frequency(struct device_node *node);

#endif /* __ASM_POWERPC_MPC512x_H__ */
#endif /* __ASM_POWERPC_MPC5xxx_H__ */
+1 −1
Original line number Diff line number Diff line
@@ -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
+0 −1
Original line number Diff line number Diff line
@@ -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__ */
+0 −23
Original line number Diff line number Diff line
@@ -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;
Loading