lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210324183610.4574-4-maciej.kwapulinski@linux.intel.com>
Date:   Wed, 24 Mar 2021 19:36:00 +0100
From:   Maciej Kwapulinski <maciej.kwapulinski@...ux.intel.com>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Arnd Bergmann <arnd@...db.de>,
        Jonathan Corbet <corbet@....net>,
        Derek Kiernan <derek.kiernan@...inx.com>,
        Dragan Cvetic <dragan.cvetic@...inx.com>,
        Andy Shevchenko <andy.shevchenko@...il.com>
Cc:     linux-kernel@...r.kernel.org, linux-doc@...r.kernel.org,
        Maciej Kwapulinski <maciej.kwapulinski@...ux.intel.com>,
        Tomasz Jankowski <tomasz1.jankowski@...el.com>,
        Savo Novakovic <savox.novakovic@...el.com>,
        Jianxun Zhang <jianxun.zhang@...ux.intel.com>
Subject: [PATCH v2 03/13] intel_gna: read hardware info in the driver

From: Tomasz Jankowski <tomasz1.jankowski@...el.com>

Get the hardware information from register MMIO_IBUFFS

Signed-off-by: Tomasz Jankowski <tomasz1.jankowski@...el.com>
Tested-by: Savo Novakovic <savox.novakovic@...el.com>
Co-developed-by: Jianxun Zhang <jianxun.zhang@...ux.intel.com>
Signed-off-by: Jianxun Zhang <jianxun.zhang@...ux.intel.com>
Co-developed-by: Maciej Kwapulinski <maciej.kwapulinski@...ux.intel.com>
Signed-off-by: Maciej Kwapulinski <maciej.kwapulinski@...ux.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ