hsi: add cloverview probing support
authorLeonard Mai <leonard.mai@intel.com>
Mon, 28 Nov 2011 13:39:43 +0000 (05:39 -0800)
committerbuildbot <buildbot@intel.com>
Tue, 6 Dec 2011 15:05:12 +0000 (07:05 -0800)
BZ: 15576

Cloverview SOC use different PCI Device ID for HSI hence existing Medfield
HSI driver won't be loaded on Cloverview SOC.

This patch add HSI probing support for Cloverview SOC

Change-Id: I58ae53c59b8d0405cf00469dcc48d87eb2774538
Signed-off-by: Leonard D Mai <leonard.mai@intel.com>
Reviewed-by: Pierre Tardy <pierre.tardy@intel.com>
Tested-by: Siva Prasath Ponnusamy <siva.prasath.ponnusamy@intel.com>
Reviewed-on: http://android.intel.com:8080/25445
Reviewed-by: Du, Alek <alek.du@intel.com>
Reviewed-by: Gross, Mark <mark.gross@intel.com>
Tested-by: Seibel, Eric <eric.seibel@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
drivers/hsi/controllers/intel_mid_hsi.c

index f2ab5f8..c07655b 100644 (file)
 #include "hsi_dwahb_dma.h"
 
 #define HSI_MPU_IRQ_NAME       "HSI_CONTROLLER_IRQ"
-#define HSI_MASTER_DMA_ID      0x834   /* PCI id for DWAHB dma */
+#define HSI_PNW_PCI_DEVICE_ID  0x833   /* PCI id for Penwell HSI */
+#define HSI_PNW_MASTER_DMA_ID  0x834   /* PCI id for Penwell DWAHB dma */
+
+#define HSI_CLV_PCI_DEVICE_ID  0x902   /* PCI id for Cloverview HSI */
+#define HSI_CLV_MASTER_DMA_ID  0x903   /* PCI id for Cloverview DWAHB dma */
 
 #define HSI_RESETDONE_TIMEOUT  10      /* 10 ms */
 #define HSI_RESETDONE_RETRIES  20      /* => max 200 ms waiting for reset */
@@ -2963,8 +2967,13 @@ static int hsi_map_resources(struct intel_controller *intel_hsi,
        }
 
        /* Get master DMA info */
-       intel_hsi->dmac = pci_get_device(PCI_VENDOR_ID_INTEL,
-                                        HSI_MASTER_DMA_ID, NULL);
+       if (pdev->device == HSI_PNW_PCI_DEVICE_ID)
+               intel_hsi->dmac = pci_get_device(PCI_VENDOR_ID_INTEL,
+                                               HSI_PNW_MASTER_DMA_ID, NULL);
+       else /* Assuming it's Cloverview */
+               intel_hsi->dmac = pci_get_device(PCI_VENDOR_ID_INTEL,
+                                               HSI_CLV_MASTER_DMA_ID, NULL);
+
        if (!intel_hsi->dmac) {
                err = -EPERM;
                goto no_dmac_device;
@@ -3408,7 +3417,8 @@ static const struct dev_pm_ops intel_mid_hsi_rtpm = {
  * struct pci_ids - PCI IDs handled by the driver (ID of HSI controller)
  */
 static const struct pci_device_id pci_ids[] __devinitdata = {
-       { PCI_VDEVICE(INTEL, 0x833) },  /* HSI */
+       { PCI_VDEVICE(INTEL, HSI_PNW_PCI_DEVICE_ID) },  /* HSI - Penwell */
+       { PCI_VDEVICE(INTEL, HSI_CLV_PCI_DEVICE_ID) },  /* HSI - Cloverview */
        { }
 };