In v2, it is pretty much impossible to do PCI setup BEFORE the PCI scan is called and device trees are built. Sometimes, however, you need to be able to work on PCI before the scan, e.g. to enable certain functions. I don't want this code in mainboard auto.c -- that's a bad way to go.
See the below comment.
/* we need to do things in this function so that PCI scan will find * them. One problem here is that we can't use ANY of the new device * stuff. This work here precedes all that. * Fundamental problem with linuxbios V2 architecture. * You can't do pci control in the C code without having done a PCI scan. * But in some cases you need to to pci control in the c code before doing * a PCI scan. But you can't use arch/romcc_io.h (the code you need) * because * that has functions with the same name but different type signatures * (e.g. device_t is a struct in C code, and is an unsigned long in * romcc code). * This needs to get fixed. We need low-level pci scans * in the C code. */
I think my fix is to make a copy of romcc_io.h, with different names and type signatures, for use by functions that need to work with PCI before the PCI scan has been done.
comments welcome. I'll do this after lunch unless I hear strong counterarguments that will get me what I need.
Thanks
ron
in V1 I used to call the pci ops directly, e.g.
extern pci_ops pci_direct; pci_direct.read_dword(...);
Presumably this will work in V2 as well.
Greg
At 12:16 PM -0600 30/9/03, ron minnich wrote:
In v2, it is pretty much impossible to do PCI setup BEFORE the PCI scan is called and device trees are built. Sometimes, however, you need to be able to work on PCI before the scan, e.g. to enable certain functions. I don't want this code in mainboard auto.c -- that's a bad way to go.
See the below comment.
/* we need to do things in this function so that PCI scan will find
- them. One problem here is that we can't use ANY of the new device
- stuff. This work here precedes all that.
- Fundamental problem with linuxbios V2 architecture.
- You can't do pci control in the C code without having done a PCI scan.
- But in some cases you need to to pci control in the c code before doing
- a PCI scan. But you can't use arch/romcc_io.h (the code you need)
- because
- that has functions with the same name but different type signatures
- (e.g. device_t is a struct in C code, and is an unsigned long in
- romcc code).
- This needs to get fixed. We need low-level pci scans
- in the C code.
*/
I think my fix is to make a copy of romcc_io.h, with different names and type signatures, for use by functions that need to work with PCI before the PCI scan has been done.
comments welcome. I'll do this after lunch unless I hear strong counterarguments that will get me what I need.
Thanks
ron
Linuxbios mailing list Linuxbios@clustermatic.org http://www.clustermatic.org/mailman/listinfo/linuxbios