linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Porting RapidIO from ppc arch to powerpc arch in support of MPC8641D
@ 2007-05-22 19:38 Phil Terry
  2007-05-22 20:08 ` Segher Boessenkool
                   ` (3 more replies)
  0 siblings, 4 replies; 26+ messages in thread
From: Phil Terry @ 2007-05-22 19:38 UTC (permalink / raw)
  To: linuxppc-dev

Guys n Gals,

I'm new to this list so I hope this isn't the wrong place to be asking
these questions.

I'm using the MPC8641D in a Serial RapidIO backplane chassis design.

My last foray into kernel development (privately in an embedded company)
was back in 2.6.9 to 2.6.11 days for a MPC8540 so be gentle with me if
I've missed something in the intervening kernels. I've tried to catch up
as best I can with the archives.

So I thought it would be a simple task of taking Matt Porter's ppc rio
stuff and porting it to powerpc but then I discovered this dts/open
firmware thingy...

So I want to explain an overview of what I intend to do for this port
and if anyone can either tell me where its already been done (yippee),
tell me I'm on the right track (ok) or tell me I'm on the wrong track
(bad) that would be great.

So I'm taking the boot/dts/mpc8641_hpcn.dts and producing a new
mpc8641D_umem.dts with the following addition to the soc.

srio@c0000 {
                device_type = "srio";
                compatible = "86xx,85xx";
		reg = <c0000 20000>;
		law = <400000000 e00000000>;
		dbells = <0 ffff>;
		mboxs = <0 4>;
                interrupt-parent = <&mpic>;
                interrupts = <30 1 31 1 32 1 35 1 36 1 37 1 38 1>;
              };

where law is the 36-bit start/end address of the law for rapidio (yes I
do want to use 36-bit addressing as well but thats another story),
dbells is the range of doorbells to use and mboxs is the range of
mailboxes.

Then I can copy the old ppc/kernel/rio.c to powerpc/kernel/rio.c and
change...

void platform_rio_init(void)
{
	struct device_node *np;
	if ( (np = of_find_compatible_node(np, "srio", "86xx")) != NULL ) {
		mpc86xx_rio_setup(np);
	}
	else {
		printk(KERN_INFO "RIO: No platform_rio_init() present in dts\n");
	}
}

with mpc86xx_rio_setup being the old mpc85xx_rio_setup from
ppc/syslib/ppc85xx_rio.c modified to extract the laws, doorbell
resources, mailboxes etc, from the of_get_property instead of
hard-coding them.

/* void mpc86xx_rio_setup(int law_start, int law_size) */

void mpc86xx_rio_setup(struct device_node *np)
{
	...

	/*port->iores.start = law_start;*/
        port->iores.start = of_get_number(of_get_propert(np,"laws"));
	
	...
	/* mpc86xx_rio_doorbell_init(port); */
	mpc86xx_rio_doorbell_init(np,port);

}
etc, etc.

Then I should pass np into the various setup routines as above so that
they can find the interrupts, etc.

Is this the right kind of flavor or have I misunderstood how the dtb
stuff is supposed to integrate with the susbsys_initcall stuff. I'm
assuming we are supposed to do away with all the CONFIG_RAPIDIO,
CONFIG_MPCxyz etc so that the kernel is driven by the dtb?

Any pointers gratefully accepted.

Cheers
Phil

btw how to I get the dtc to accept 36-bit numbers as above for laws?
and am I allowed to invent properties like this or is there some keeper
of the property names who I should genuflect before?

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2007-05-24 11:28 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-22 19:38 Porting RapidIO from ppc arch to powerpc arch in support of MPC8641D Phil Terry
2007-05-22 20:08 ` Segher Boessenkool
2007-05-22 20:09 ` Timur Tabi
2007-05-22 23:05 ` Arnd Bergmann
2007-05-24  6:48   ` Porting RapidIO from ppc arch to powerpc arch in support ofMPC8641D Zhang Wei-r63237
2007-05-24  9:19     ` Arnd Bergmann
2007-05-24  9:44       ` Zhang Wei-r63237
2007-05-24 11:27         ` Arnd Bergmann
2007-05-23 13:26 ` Porting RapidIO from ppc arch to powerpc arch in support of MPC8641D Zhang Wei-r63237
2007-05-23 13:32   ` Mark A. Greer
2007-05-23 14:03     ` Zhang Wei-r63237
2007-05-23 15:42       ` Phil Terry
2007-05-23 15:53       ` Mark A. Greer
2007-05-23 15:54       ` Phil Terry
2007-05-23 14:21   ` Kumar Gala
2007-05-23 15:37     ` Phil Terry
2007-05-23 16:05       ` Segher Boessenkool
2007-05-23 16:20         ` Phil Terry
2007-05-23 16:20           ` Kumar Gala
2007-05-23 16:43             ` Phil Terry
2007-05-23 23:17               ` Segher Boessenkool
2007-05-23 23:05           ` Segher Boessenkool
2007-05-24  7:31       ` Porting RapidIO from ppc arch to powerpc arch in support ofMPC8641D Zhang Wei-r63237
2007-05-23 16:00     ` Porting RapidIO from ppc arch to powerpc arch in support of MPC8641D Segher Boessenkool
2007-05-23 16:13       ` Phil Terry
2007-05-24  0:52     ` David Gibson

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).