Skip to contentSkip to conversation

question from linuxppc group

DISCUSSION Jim Potter 5 participants 5 messages Sep 25, 2001

lore
Share & tools
lore

Jim Potter

author
#0 lore raw

We have a host bridge (plus PIC, mem ctlr, etc.) that is essentially identical
for ppc and mips. Where is the best place to put the code since we don't want to
duplicate it for both architectures?

--
Sincerely,

Jim Potter
45th Parallel Processing
[email protected]

"It is rather for us to be here dedicated to the great task remaining before us -- that from these honored dead we take increased devotion to that cause for which they gave the last full measure of devotion -- that we here highly resolve that these dead shall not have died in vain, that this nation under God shall have a new birth of freedom, and that government of the people, by the people, for the people shall not perish from the earth.

A. Lincoln, Gettysburg, 1863

ln -sf /dev/null /osama/bin/laden

#1 lore raw
Quoted 5 lines

We have a host bridge (plus PIC, mem ctlr, etc.) that is essentially identical
for ppc and mips. Where is the best place to put the code since we don't want to
duplicate it for both architectures?

Well, most of the PCI & interrupt frameworks are mostly arch specific. I can't tell for MIPS, but the way you setup a PCI host bridge on PPC was written by me and Paulus without looking at MIPS.

I don't think there is real need to have common code here. Maybe some common definitions (register defs for example) could go into a linux/*.h file.

Ben.

#2 lore raw
Quoted 4 lines

Well, most of the PCI & interrupt frameworks are mostly arch specific. I can't tell for MIPS, but the way you setup a PCI host bridge on PPC was written by me and Paulus without looking at MIPS.

We toke the ideas from the PPC people and applied to the mips tree. Same for the time code.

#3 lore raw
In reply to Jim Potter
Quoted 9 lines · Benjamin Herrenschmidt
Quoted 5 lines

We have a host bridge (plus PIC, mem ctlr, etc.) that is essentially identical
for ppc and mips. Where is the best place to put the code since we don't want to
duplicate it for both architectures?

Well, most of the PCI & interrupt frameworks are mostly arch specific. I can't tell for MIPS, but the way you setup a PCI host bridge on PPC was written by me and Paulus without looking at MIPS.

Well, MIPS has been looking at us a bit I know. Also, the patch that Mark/Matt did uses the pci_auto stuff for setting up the bridges (iirc thats what that code is for anyhow :)) and MIPS has been using that as well of late, tho their gt64120 bits don't look like they use it right now.

Quoted 3 lines

I don't think there is real need to have common code here. Maybe some common definitions (register defs for example) could go into a linux/*.h file.

If nothing else, yeah. And all of the drivers into drivers/.

Signature · 2 lines
Tom Rini (TR1265)
http://gate.crashing.org/~trini/
#4 lore raw
In reply to Jim Potter
Quoted 6 lines · Jim Potter

We have a host bridge (plus PIC, mem ctlr, etc.) that is essentially identical
for ppc and mips. Where is the best place to put the code since we don't want to
duplicate it for both architectures?

A common practice is to create a pseudo-arch directory, let's called it 'shared' or 'common' and under it a directory for each component that is shared. We can now have symbolic links for s shared file:

	arch/[mips|ppc]/pic.c -> arch/shared/pic-mippc.c

Or, for a shared subsystem 'pic1234'

	arch/[mips|ppc]/pic -> arch/shared/pic-mippc

One can even look at more similar archs and have

	arch/[mips|ppc]/pic -> arch/shared/mippc/pic
	arch/[mips|ppc]/mem -> arch/shared/mippc/mem

--
Eyal Lebedinsky ([email protected]) <http://samba.anu.edu.au/eyal/>