mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-04-15 23:57:46 +07:00
i5k_amb: support Intel 5400 chipset
Minor rework to support the Intel 5400 chipset. Signed-off-by: Darrick J. Wong <djwong@us.ibm.com> Cc: "Mark M. Hoffman" <mhoffman@lightlink.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
ca68d0ac16
commit
b8fdaf5a05
@ -111,6 +111,7 @@ struct i5k_amb_data {
|
|||||||
void __iomem *amb_mmio;
|
void __iomem *amb_mmio;
|
||||||
struct i5k_device_attribute *attrs;
|
struct i5k_device_attribute *attrs;
|
||||||
unsigned int num_attrs;
|
unsigned int num_attrs;
|
||||||
|
unsigned long chipset_id;
|
||||||
};
|
};
|
||||||
|
|
||||||
static ssize_t show_name(struct device *dev, struct device_attribute *devattr,
|
static ssize_t show_name(struct device *dev, struct device_attribute *devattr,
|
||||||
@ -382,7 +383,8 @@ static int __devinit i5k_amb_add(void)
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int __devinit i5k_find_amb_registers(struct i5k_amb_data *data)
|
static int __devinit i5k_find_amb_registers(struct i5k_amb_data *data,
|
||||||
|
unsigned long devid)
|
||||||
{
|
{
|
||||||
struct pci_dev *pcidev;
|
struct pci_dev *pcidev;
|
||||||
u32 val32;
|
u32 val32;
|
||||||
@ -390,7 +392,7 @@ static int __devinit i5k_find_amb_registers(struct i5k_amb_data *data)
|
|||||||
|
|
||||||
/* Find AMB register memory space */
|
/* Find AMB register memory space */
|
||||||
pcidev = pci_get_device(PCI_VENDOR_ID_INTEL,
|
pcidev = pci_get_device(PCI_VENDOR_ID_INTEL,
|
||||||
PCI_DEVICE_ID_INTEL_5000_ERR,
|
devid,
|
||||||
NULL);
|
NULL);
|
||||||
if (!pcidev)
|
if (!pcidev)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
@ -409,6 +411,8 @@ static int __devinit i5k_find_amb_registers(struct i5k_amb_data *data)
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
data->chipset_id = devid;
|
||||||
|
|
||||||
res = 0;
|
res = 0;
|
||||||
out:
|
out:
|
||||||
pci_dev_put(pcidev);
|
pci_dev_put(pcidev);
|
||||||
@ -441,10 +445,30 @@ static int __devinit i5k_channel_probe(u16 *amb_present, unsigned long dev_id)
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static unsigned long i5k_channel_pci_id(struct i5k_amb_data *data,
|
||||||
|
unsigned long channel)
|
||||||
|
{
|
||||||
|
switch (data->chipset_id) {
|
||||||
|
case PCI_DEVICE_ID_INTEL_5000_ERR:
|
||||||
|
return PCI_DEVICE_ID_INTEL_5000_FBD0 + channel;
|
||||||
|
case PCI_DEVICE_ID_INTEL_5400_ERR:
|
||||||
|
return PCI_DEVICE_ID_INTEL_5400_FBD0 + channel;
|
||||||
|
default:
|
||||||
|
BUG();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static unsigned long chipset_ids[] = {
|
||||||
|
PCI_DEVICE_ID_INTEL_5000_ERR,
|
||||||
|
PCI_DEVICE_ID_INTEL_5400_ERR,
|
||||||
|
0
|
||||||
|
};
|
||||||
|
|
||||||
static int __devinit i5k_amb_probe(struct platform_device *pdev)
|
static int __devinit i5k_amb_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct i5k_amb_data *data;
|
struct i5k_amb_data *data;
|
||||||
struct resource *reso;
|
struct resource *reso;
|
||||||
|
int i;
|
||||||
int res = -ENODEV;
|
int res = -ENODEV;
|
||||||
|
|
||||||
data = kzalloc(sizeof(*data), GFP_KERNEL);
|
data = kzalloc(sizeof(*data), GFP_KERNEL);
|
||||||
@ -452,19 +476,24 @@ static int __devinit i5k_amb_probe(struct platform_device *pdev)
|
|||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
/* Figure out where the AMB registers live */
|
/* Figure out where the AMB registers live */
|
||||||
res = i5k_find_amb_registers(data);
|
i = 0;
|
||||||
|
do {
|
||||||
|
res = i5k_find_amb_registers(data, chipset_ids[i]);
|
||||||
|
i++;
|
||||||
|
} while (res && chipset_ids[i]);
|
||||||
|
|
||||||
if (res)
|
if (res)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
/* Copy the DIMM presence map for the first two channels */
|
/* Copy the DIMM presence map for the first two channels */
|
||||||
res = i5k_channel_probe(&data->amb_present[0],
|
res = i5k_channel_probe(&data->amb_present[0],
|
||||||
PCI_DEVICE_ID_INTEL_5000_FBD0);
|
i5k_channel_pci_id(data, 0));
|
||||||
if (res)
|
if (res)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
/* Copy the DIMM presence map for the optional second two channels */
|
/* Copy the DIMM presence map for the optional second two channels */
|
||||||
i5k_channel_probe(&data->amb_present[2],
|
i5k_channel_probe(&data->amb_present[2],
|
||||||
PCI_DEVICE_ID_INTEL_5000_FBD1);
|
i5k_channel_pci_id(data, 1));
|
||||||
|
|
||||||
/* Set up resource regions */
|
/* Set up resource regions */
|
||||||
reso = request_mem_region(data->amb_base, data->amb_len, DRVNAME);
|
reso = request_mem_region(data->amb_base, data->amb_len, DRVNAME);
|
||||||
|
@ -2383,6 +2383,9 @@
|
|||||||
#define PCI_DEVICE_ID_INTEL_ICH10_4 0x3a30
|
#define PCI_DEVICE_ID_INTEL_ICH10_4 0x3a30
|
||||||
#define PCI_DEVICE_ID_INTEL_ICH10_5 0x3a60
|
#define PCI_DEVICE_ID_INTEL_ICH10_5 0x3a60
|
||||||
#define PCI_DEVICE_ID_INTEL_IOAT_SNB 0x402f
|
#define PCI_DEVICE_ID_INTEL_IOAT_SNB 0x402f
|
||||||
|
#define PCI_DEVICE_ID_INTEL_5400_ERR 0x4030
|
||||||
|
#define PCI_DEVICE_ID_INTEL_5400_FBD0 0x4035
|
||||||
|
#define PCI_DEVICE_ID_INTEL_5400_FBD1 0x4036
|
||||||
#define PCI_DEVICE_ID_INTEL_IOAT_SCNB 0x65ff
|
#define PCI_DEVICE_ID_INTEL_IOAT_SCNB 0x65ff
|
||||||
#define PCI_DEVICE_ID_INTEL_TOLAPAI_0 0x5031
|
#define PCI_DEVICE_ID_INTEL_TOLAPAI_0 0x5031
|
||||||
#define PCI_DEVICE_ID_INTEL_TOLAPAI_1 0x5032
|
#define PCI_DEVICE_ID_INTEL_TOLAPAI_1 0x5032
|
||||||
|
Loading…
Reference in New Issue
Block a user