From: Tomasz Jankowski <tomasz1.jankow...@intel.com>

Get the hardware information from register MMIO_IBUFFS

Signed-off-by: Tomasz Jankowski <tomasz1.jankow...@intel.com>
Tested-by: Savo Novakovic <savox.novako...@intel.com>
Co-developed-by: Jianxun Zhang <jianxun.zh...@linux.intel.com>
Signed-off-by: Jianxun Zhang <jianxun.zh...@linux.intel.com>
Co-developed-by: Maciej Kwapulinski <maciej.kwapulin...@linux.intel.com>
Signed-off-by: Maciej Kwapulinski <maciej.kwapulin...@linux.intel.com>
---
 drivers/misc/intel/gna/gna_device.c | 5 +++++
 drivers/misc/intel/gna/gna_device.h | 5 +++++
 2 files changed, 10 insertions(+)

diff --git a/drivers/misc/intel/gna/gna_device.c 
b/drivers/misc/intel/gna/gna_device.c
index 431113297879..6bac481b2247 100644
--- a/drivers/misc/intel/gna/gna_device.c
+++ b/drivers/misc/intel/gna/gna_device.c
@@ -12,12 +12,17 @@
 static void gna_dev_init(struct gna_private *gna_priv, struct pci_dev *pcidev,
                        const struct pci_device_id *pci_id)
 {
+       u32 bld_reg;
+
        pci_set_drvdata(pcidev, gna_priv);
 
        gna_priv->parent = &pcidev->dev;
        gna_priv->pdev = pcidev;
        gna_priv->info = *(struct gna_drv_info *)pci_id->driver_data;
        gna_priv->drv_priv = &gna_drv_priv;
+
+       bld_reg = gna_reg_read(gna_priv->bar0_base, GNA_MMIO_IBUFFS);
+       gna_priv->hw_info.in_buf_s = bld_reg & GENMASK(7, 0);
 }
 
 int gna_probe(struct pci_dev *pcidev, const struct pci_device_id *pci_id)
diff --git a/drivers/misc/intel/gna/gna_device.h 
b/drivers/misc/intel/gna/gna_device.h
index 39dc03d53feb..7704eeda90f6 100644
--- a/drivers/misc/intel/gna/gna_device.h
+++ b/drivers/misc/intel/gna/gna_device.h
@@ -23,6 +23,10 @@ struct gna_drv_info {
        struct gna_desc_info desc_info;
 };
 
+struct gna_hw_info {
+       u8 in_buf_s;
+};
+
 struct gna_private {
        struct gna_driver_private *drv_priv;
 
@@ -33,6 +37,7 @@ struct gna_private {
        /* device related resources */
        void __iomem *bar0_base;
        struct gna_drv_info info;
+       struct gna_hw_info hw_info;
 };
 
 int gna_probe(struct pci_dev *dev, const struct pci_device_id *id);
-- 
2.28.0

Reply via email to