[PATCH] fsl_spi_init: Support non-QE processors

Peter Korsgaard jacmet at sunsite.dk
Sun Oct 7 06:06:40 EST 2007


>>>>> "Kumar" == Kumar Gala <galak at kernel.crashing.org> writes:

 Kumar> On Oct 3, 2007, at 11:01 PM, Stephen Rothwell wrote:

 >> On Wed, 03 Oct 2007 17:43:50 +0200 Peter Korsgaard
 >> <jacmet at sunsite.dk> wrote:
 >>> 
 >>> @@ -1220,14 +1220,17 @@ int __init fsl_spi_init(struct
 >>> spi_board_info *board_infos,
 >>> {
 >>> struct device_node *np;
 >>> unsigned int i;
 >>> -	const u32 *sysclk;
 >>> +	const u32 *qe_sysclk = 0, *soc_sysclk = 0;
 >> 
 >> Please use NULL when referring to pointers.

 Kumar> Peter, any chance of getting a respin.  I'd like this to go
 Kumar> into 2.6.24.

Certainly. Sorry for the delay, I have been offline for 2 days
building my house ..
---
fsl_spi_init: Support non-QE processors

On non-QE processors (mpc831x/mpc834x) the SPI clock is the SoC clock.

Signed-off-by: Peter Korsgaard <jacmet at sunsite.dk>
---
 arch/powerpc/sysdev/fsl_soc.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c
index be5e0bd..3ace747 100644
--- a/arch/powerpc/sysdev/fsl_soc.c
+++ b/arch/powerpc/sysdev/fsl_soc.c
@@ -1222,8 +1222,12 @@ int __init fsl_spi_init(struct spi_board_info *board_infos,
 	unsigned int i;
 	const u32 *sysclk;
 
+	/* SPI controller is either clocked from QE or SoC clock */
 	np = of_find_node_by_type(NULL, "qe");
 	if (!np)
+		np = of_find_node_by_type(NULL, "soc");
+
+	if (!np)
 		return -ENODEV;
 
 	sysclk = of_get_property(np, "bus-frequency", NULL);
-- 
1.5.3.2

-- 
Bye, Peter Korsgaard



More information about the Linuxppc-dev mailing list