mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 17:36:20 +03:00
gpu: nvgpu: add internal chip SKUs for PG189
When flashing OBE ROM on PG189 with an internal chip SKU, it ends up enumerating with unsupported device id. Since VBIOS update will be done automatically in PDK, we want to detect such boards, and throw a warning. Use upper bits of driver_data to define some flags for pci device. Added PCI_DEVICE_F_INTERNAL_CHIP_SKU for boards with internal chip SKUs. Allow enumeration of PG189 boards with internal chip SKUs 0x1eae and 0x1eaf, but throw a warning. Bug 2569674 Change-Id: I0261a85139be5e58029f25fcb289f54dfd7c35b3 Signed-off-by: Thomas Fleury <tfleury@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2103831 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman <alexw@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
82ce44d882
commit
b65485c5b4
@@ -254,6 +254,7 @@ static struct gk20a_platform nvgpu_pci_device[] = {
|
|||||||
.unified_memory = false,
|
.unified_memory = false,
|
||||||
},
|
},
|
||||||
{ /* 0x1eba, 0x1efa, 0x1ebb, 0x1efb */
|
{ /* 0x1eba, 0x1efa, 0x1ebb, 0x1efb */
|
||||||
|
/* 0x1eae, 0x1eaf (internal chip SKUs) */
|
||||||
/* ptimer src frequency in hz */
|
/* ptimer src frequency in hz */
|
||||||
.ptimer_src_freq = 31250000,
|
.ptimer_src_freq = 31250000,
|
||||||
|
|
||||||
@@ -292,6 +293,11 @@ static struct gk20a_platform nvgpu_pci_device[] = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define PCI_DEVICE_INDEX(driver_data) ((driver_data) & 0x0000FFFFU)
|
||||||
|
#define PCI_DEVICE_FLAGS(driver_data) ((driver_data) & 0xFFFF0000U)
|
||||||
|
|
||||||
|
#define PCI_DEVICE_F_INTERNAL_CHIP_SKU BIT(31)
|
||||||
|
|
||||||
static struct pci_device_id nvgpu_pci_table[] = {
|
static struct pci_device_id nvgpu_pci_table[] = {
|
||||||
{
|
{
|
||||||
PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, 0x1db1),
|
PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, 0x1db1),
|
||||||
@@ -347,6 +353,19 @@ static struct pci_device_id nvgpu_pci_table[] = {
|
|||||||
.class_mask = 0xff << 16,
|
.class_mask = 0xff << 16,
|
||||||
.driver_data = 5,
|
.driver_data = 5,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, 0x1eae),
|
||||||
|
.class = PCI_BASE_CLASS_DISPLAY << 16,
|
||||||
|
.class_mask = 0xff << 16,
|
||||||
|
.driver_data = 5 | PCI_DEVICE_F_INTERNAL_CHIP_SKU,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, 0x1eaf),
|
||||||
|
.class = PCI_BASE_CLASS_DISPLAY << 16,
|
||||||
|
.class_mask = 0xff << 16,
|
||||||
|
.driver_data = 5 | PCI_DEVICE_F_INTERNAL_CHIP_SKU,
|
||||||
|
},
|
||||||
|
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -525,9 +544,11 @@ static int nvgpu_pci_probe(struct pci_dev *pdev,
|
|||||||
int err;
|
int err;
|
||||||
char nodefmt[64];
|
char nodefmt[64];
|
||||||
struct device_node *np;
|
struct device_node *np;
|
||||||
|
u32 device_index = PCI_DEVICE_INDEX(pent->driver_data);
|
||||||
|
u32 device_flags = PCI_DEVICE_FLAGS(pent->driver_data);
|
||||||
|
|
||||||
/* make sure driver_data is a sane index */
|
/* make sure driver_data is a sane index */
|
||||||
if (pent->driver_data >= sizeof(nvgpu_pci_device) /
|
if (device_index >= sizeof(nvgpu_pci_device) /
|
||||||
sizeof(nvgpu_pci_device[0])) {
|
sizeof(nvgpu_pci_device[0])) {
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
@@ -559,7 +580,7 @@ static int nvgpu_pci_probe(struct pci_dev *pdev,
|
|||||||
|
|
||||||
/* copy detected device data to allocated platform space*/
|
/* copy detected device data to allocated platform space*/
|
||||||
nvgpu_memcpy((u8 *)platform,
|
nvgpu_memcpy((u8 *)platform,
|
||||||
(u8 *)&nvgpu_pci_device[pent->driver_data],
|
(u8 *)&nvgpu_pci_device[device_index],
|
||||||
sizeof(struct gk20a_platform));
|
sizeof(struct gk20a_platform));
|
||||||
|
|
||||||
pci_set_drvdata(pdev, platform);
|
pci_set_drvdata(pdev, platform);
|
||||||
@@ -589,6 +610,12 @@ static int nvgpu_pci_probe(struct pci_dev *pdev,
|
|||||||
g->pci_class = (pdev->class >> 8) & 0xFFFFU; // we only want base/sub
|
g->pci_class = (pdev->class >> 8) & 0xFFFFU; // we only want base/sub
|
||||||
g->pci_revision = pdev->revision;
|
g->pci_revision = pdev->revision;
|
||||||
|
|
||||||
|
if ((device_flags & PCI_DEVICE_F_INTERNAL_CHIP_SKU) != 0U) {
|
||||||
|
nvgpu_err(g, "internal chip SKU %08x detected",
|
||||||
|
g->pci_device_id);
|
||||||
|
nvgpu_err(g, "replace board, or use at your own risks");
|
||||||
|
}
|
||||||
|
|
||||||
g->ina3221_dcb_index = platform->ina3221_dcb_index;
|
g->ina3221_dcb_index = platform->ina3221_dcb_index;
|
||||||
g->ina3221_i2c_address = platform->ina3221_i2c_address;
|
g->ina3221_i2c_address = platform->ina3221_i2c_address;
|
||||||
g->ina3221_i2c_port = platform->ina3221_i2c_port;
|
g->ina3221_i2c_port = platform->ina3221_i2c_port;
|
||||||
|
|||||||
Reference in New Issue
Block a user