Driver add < static void lpci_set_subsystem(device_t dev, unsigned vendor, unsigned device) < { < pci_write_config32(dev, 0x2c, < ((device & 0xffff) << 16) | (vendor & 0xffff)); < } < < static struct pci_operations lops_pci = { < .set_subsystem = lpci_set_subsystem, < };
-----Original Message----- From: Li-Ta Lo [mailto:ollie@lanl.gov] Sent: Thursday, October 21, 2004 9:31 AM To: Eric W. Biederman Cc: LinuxBIOS Subject: Re: Freebios2 recovery progress...
On Thu, 2004-10-21 at 05:08, Eric W. Biederman wrote:
I have managed to get another chunk of merging and bug fixing done tonight.
I now have pci subsystem vendor and subsystem id's being set on the arima hdama, so the board is now identifiable with lspci.
How did you do that ? Where do you put those IDs ?
Ollie
_______________________________________________ Linuxbios mailing list Linuxbios@clustermatic.org http://www.clustermatic.org/mailman/listinfo/linuxbios
On Thu, 2004-10-21 at 11:23, YhLu wrote:
Are the IDs configurable by config file ?
Ollie
Driver add < static void lpci_set_subsystem(device_t dev, unsigned vendor, unsigned device) < { < pci_write_config32(dev, 0x2c, < ((device & 0xffff) << 16) | (vendor & 0xffff)); < } < < static struct pci_operations lops_pci = { < .set_subsystem = lpci_set_subsystem, < };
-----Original Message----- From: Li-Ta Lo [mailto:ollie@lanl.gov] Sent: Thursday, October 21, 2004 9:31 AM To: Eric W. Biederman Cc: LinuxBIOS Subject: Re: Freebios2 recovery progress...
On Thu, 2004-10-21 at 05:08, Eric W. Biederman wrote:
I have managed to get another chunk of merging and bug fixing done tonight.
I now have pci subsystem vendor and subsystem id's being set on the arima hdama, so the board is now identifiable with lspci.
How did you do that ? Where do you put those IDs ?
Ollie
Linuxbios mailing list Linuxbios@clustermatic.org http://www.clustermatic.org/mailman/listinfo/linuxbios
On Thu, 2004-10-21 at 11:23, YhLu wrote:
Driver add < static void lpci_set_subsystem(device_t dev, unsigned vendor, unsigned device) < { < pci_write_config32(dev, 0x2c, < ((device & 0xffff) << 16) | (vendor & 0xffff)); < } < < static struct pci_operations lops_pci = { < .set_subsystem = lpci_set_subsystem, < };
OOPS, we are doing it with "uses MAINBOARD_SUBSYSTEM_ID" and if I am right every on board device share the same ID. For devices who want its own ID it has to implement the .set_subsystem method. This is really ugly. IMHO, we should treat the subsystem ids as attributes of PCI device and it should be defined in the mainboard config file. It should look like this
device pci 0.0 on vendor 0x1234 device 0x5678 end
or
device pci 0.0 on register "subsystem_vendor_id" = "0x1234" register "subsystem_device_id" = "0x5678" end
and the PCI enumeration code will call the generic pci_set_subsystem() function to set subsystem ID for every PCI device. For those device with subsystem ID unspecified, it is default to zero any.
Ollie
Li-Ta Lo ollie@lanl.gov writes:
On Thu, 2004-10-21 at 11:23, YhLu wrote:
Driver add < static void lpci_set_subsystem(device_t dev, unsigned vendor, unsigned device) < { < pci_write_config32(dev, 0x2c, < ((device & 0xffff) << 16) | (vendor & 0xffff)); < } < < static struct pci_operations lops_pci = { < .set_subsystem = lpci_set_subsystem, < };
OOPS, we are doing it with "uses MAINBOARD_SUBSYSTEM_ID" and if I am right every on board device share the same ID. For devices who want its own ID it has to implement the .set_subsystem method. This is really ugly. IMHO, we should treat the subsystem ids as attributes of PCI device and it should be defined in the mainboard config file. It should look like this
As far as I know there is only one that we need to set. The subsystem id of the motherboard. And we need to set this for all devices.
The .set_subsystem simply exists because there is not a standard way to set that value. The almost generic version is in src/devices/pci_device.c but I can use it only occasionally.
device pci 0.0 on vendor 0x1234 device 0x5678 end
or
device pci 0.0 on register "subsystem_vendor_id" = "0x1234" register "subsystem_device_id" = "0x5678" end
I don't see the benefit of those methods over having an Option if you have exactly 1 subsystem vendor_id+device_id that need to be set.
and the PCI enumeration code will call the generic pci_set_subsystem() function to set subsystem ID for every PCI device.
It does.
For those device with subsystem ID unspecified, it is default to zero any.
Yes.
Eric
* Eric W. Biederman ebiederman@lnxi.com [041021 19:56]:
OOPS, we are doing it with "uses MAINBOARD_SUBSYSTEM_ID" and if I am right every on board device share the same ID. For devices who want its own ID it has to implement the .set_subsystem method. This is really ugly. IMHO, we should treat the subsystem ids as attributes of PCI device and it should be defined in the mainboard config file. It should look like this
As far as I know there is only one that we need to set. The subsystem id of the motherboard. And we need to set this for all devices.
Who needs the subsystem ids?
Stefan
On Thu, 2004-10-21 at 11:56, Eric W. Biederman wrote:
The .set_subsystem simply exists because there is not a standard way to set that value. The almost generic version is in src/devices/pci_device.c but I can use it only occasionally.
device pci 0.0 on vendor 0x1234 device 0x5678 end
or
device pci 0.0 on register "subsystem_vendor_id" = "0x1234" register "subsystem_device_id" = "0x5678" end
I don't see the benefit of those methods over having an Option if you have exactly 1 subsystem vendor_id+device_id that need to be set.
YhLu's intention is to set subsystem ID differently for each devices on the mainboard. It is totally the opposite to what you want and doing.
Ollie