|
@@ -72,19 +72,34 @@ static unsigned __init vsmp_patch(u8 type, u16 clobbers, void *ibuf,
|
|
|
|
|
|
}
|
|
|
|
|
|
+static int vsmp = -1;
|
|
|
+
|
|
|
+int is_vsmp_box(void)
|
|
|
+{
|
|
|
+ if (vsmp != -1)
|
|
|
+ return vsmp;
|
|
|
+
|
|
|
+ vsmp = 0;
|
|
|
+ if (!early_pci_allowed())
|
|
|
+ return vsmp;
|
|
|
+
|
|
|
+ /* Check if we are running on a ScaleMP vSMP box */
|
|
|
+ if (read_pci_config(0, 0x1f, 0, PCI_VENDOR_ID) ==
|
|
|
+ (PCI_VENDOR_ID_SCALEMP || (PCI_DEVICE_ID_SCALEMP_VSMP_CTL << 16)))
|
|
|
+ vsmp = 1;
|
|
|
+
|
|
|
+ return vsmp;
|
|
|
+}
|
|
|
+
|
|
|
void __init vsmp_init(void)
|
|
|
{
|
|
|
void *address;
|
|
|
unsigned int cap, ctl, cfg;
|
|
|
|
|
|
- if (!early_pci_allowed())
|
|
|
+ if (!is_vsmp_box())
|
|
|
return;
|
|
|
|
|
|
- /* Check if we are running on a ScaleMP vSMP box */
|
|
|
- if ((read_pci_config_16(0, 0x1f, 0, PCI_VENDOR_ID) !=
|
|
|
- PCI_VENDOR_ID_SCALEMP) ||
|
|
|
- (read_pci_config_16(0, 0x1f, 0, PCI_DEVICE_ID) !=
|
|
|
- PCI_DEVICE_ID_SCALEMP_VSMP_CTL))
|
|
|
+ if (!early_pci_allowed())
|
|
|
return;
|
|
|
|
|
|
/* If we are, use the distinguished irq functions */
|