Subject: Re: Rapidio interface in recent kernels

From: Alex Dubov <[email-masked]>
Date: Thu, 26 Jun 2008 23:36:51 -0700 (PDT)

--- On Thu, 6/26/08, Kumar Gala <[email-masked]> wrote:

> From: Kumar Gala <[email-masked]>
> Subject: Re: Rapidio interface in recent kernels
> To: [email-masked]
> Cc: [email-masked]
> Date: Thursday, June 26, 2008, 6:35 AM
> On Jun 25, 2008, at 11:33 PM, Alex Dubov wrote:
> 
> > Greetings.
> >
> > I was trying to make use of rapidio on recent (2.6.25)
> kernel (I  
> > have a 8548
> > cpu). However, it seems that changes to the powerpc
> arch had broken  
> > it.
> >
> > Therefore, the question: is there an anticipated fix
> or I'm on my  
> > own here?
> 
> Is there a compile error?  if so please post it.
> 
> - k

I'm using 2.6.25.8, but I think it's the same for all 2.6.25 kernels.
I set: ARCH=powerpc, CROSS_COMPILE=powerpc-linux-gnuspe-
The cpu is Freescale 8548, so "Processor Type" is Freescale 85xx

First, there's no Kconfig entry for rapidio, as it seems stuck in the
ppc subtree, with bad guarding condition (around line 1097 in
arch/ppc/Kconfig), so I just copied it into arch/powerpc/Kconfig (without
the conditional for now).

And now for the build errors:
Stage 1:
arch/powerpc/kernel/rio.c:17:21: error: asm/rio.h: No such file or 
directory

Stage 2 (after fixing stage 1):
arch/powerpc/sysdev/fsl_rio.c: In function ârio_open_outb_mboxâ:
arch/powerpc/sysdev/fsl_rio.c:455: error: âMPC85xx_IRQ_RIO_TXâ undeclared 
(first use in this function)
arch/powerpc/sysdev/fsl_rio.c:455: error: (Each undeclared identifier is 
reported only once
arch/powerpc/sysdev/fsl_rio.c:455: error: for each function it appears in.)
arch/powerpc/sysdev/fsl_rio.c: In function ârio_close_outb_mboxâ:
arch/powerpc/sysdev/fsl_rio.c:510: error: âMPC85xx_IRQ_RIO_TXâ undeclared 
(first use in this function)
arch/powerpc/sysdev/fsl_rio.c: In function ârio_open_inb_mboxâ:
arch/powerpc/sysdev/fsl_rio.c:600: error: âMPC85xx_IRQ_RIO_RXâ undeclared 
(first use in this function)
arch/powerpc/sysdev/fsl_rio.c: In function ârio_close_inb_mboxâ:
arch/powerpc/sysdev/fsl_rio.c:647: error: âMPC85xx_IRQ_RIO_RXâ undeclared 
(first use in this function)
arch/powerpc/sysdev/fsl_rio.c: In function âmpc85xx_rio_doorbell_initâ:
arch/powerpc/sysdev/fsl_rio.c:838: error: âMPC85xx_IRQ_RIO_BELLâ undeclared (first use in this function)
arch/powerpc/sysdev/fsl_rio.c: In function âmpc85xx_rio_setupâ:
arch/powerpc/sysdev/fsl_rio.c:916: error: âCCSRBARâ undeclared (first use 
in this function)

And the worst thing is - those macros are defined using old style ppc
register defines and I don't have a nearest idea how to fix it on a new 
style kernel (for one - CCSRBAR is replaced with some runtime thingie).