From: Maciej Kwapulinski <maciej.kwapulinski@linux.intel.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Arnd Bergmann <arnd@arndb.de>, Jonathan Corbet <corbet@lwn.net>,
Derek Kiernan <derek.kiernan@xilinx.com>,
Dragan Cvetic <dragan.cvetic@xilinx.com>
Cc: linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org,
Maciej Kwapulinski <maciej.kwapulinski@linux.intel.com>,
Tomasz Jankowski <tomasz1.jankowski@intel.com>,
Savo Novakovic <savox.novakovic@intel.com>,
Jianxun Zhang <jianxun.zhang@linux.intel.com>
Subject: [PATCH v1 06/12] gna: add hardware ids
Date: Tue, 16 Feb 2021 17:05:19 +0100 [thread overview]
Message-ID: <20210216160525.5028-7-maciej.kwapulinski@linux.intel.com> (raw)
In-Reply-To: <20210216160525.5028-1-maciej.kwapulinski@linux.intel.com>
From: Tomasz Jankowski <tomasz1.jankowski@intel.com>
Add PCI ids of Intel(R) Gaussian & Neural Accelerator on supported
platforms.
Signed-off-by: Tomasz Jankowski <tomasz1.jankowski@intel.com>
Tested-by: Savo Novakovic <savox.novakovic@intel.com>
Co-developed-by: Jianxun Zhang <jianxun.zhang@linux.intel.com>
Signed-off-by: Jianxun Zhang <jianxun.zhang@linux.intel.com>
Signed-off-by: Maciej Kwapulinski <maciej.kwapulinski@linux.intel.com>
---
drivers/misc/gna/gna_device.c | 76 +++++++++++++++++++++++++++++++++++
drivers/misc/gna/gna_device.h | 2 +
drivers/misc/gna/gna_driver.c | 1 +
3 files changed, 79 insertions(+)
diff --git a/drivers/misc/gna/gna_device.c b/drivers/misc/gna/gna_device.c
index d6a6d3cab570..7031a5d7c16c 100644
--- a/drivers/misc/gna/gna_device.c
+++ b/drivers/misc/gna/gna_device.c
@@ -8,6 +8,82 @@
#include "gna_driver.h"
#include "gna_hw.h"
+#define GNA_DEV_HWID_CNL 0x5A11
+#define GNA_DEV_HWID_EHL 0x4511
+#define GNA_DEV_HWID_GLK 0x3190
+#define GNA_DEV_HWID_ICL 0x8A11
+#define GNA_DEV_HWID_JSL 0x4E11
+#define GNA_DEV_HWID_TGL 0x9A11
+
+#define GNA_FEATURES \
+ .max_hw_mem = 256 * 1024 * 1024, \
+ .num_pagetables = 64, \
+ .num_page_entries = PAGE_SIZE / sizeof(u32), \
+ /* desc_info all in bytes */ \
+ .desc_info = { \
+ .rsvd_size = 256, \
+ .cfg_size = 256, \
+ .desc_size = 784, \
+ .mmu_info = { \
+ .vamax_size = 4, \
+ .rsvd_size = 12, \
+ .pd_size = 4 * 64, \
+ }, \
+ }
+
+#define GNA_GEN1_FEATURES \
+ GNA_FEATURES, \
+ .max_layer_count = 1024
+
+#define GNA_GEN2_FEATURES \
+ GNA_FEATURES, \
+ .max_layer_count = 4096
+
+static const struct gna_drv_info cnl_drv_info = {
+ .hwid = GNA_DEV_HWID_CNL,
+ GNA_GEN1_FEATURES
+};
+
+static const struct gna_drv_info glk_drv_info = {
+ .hwid = GNA_DEV_HWID_GLK,
+ GNA_GEN1_FEATURES
+};
+
+static const struct gna_drv_info ehl_drv_info = {
+ .hwid = GNA_DEV_HWID_EHL,
+ GNA_GEN1_FEATURES
+};
+
+static const struct gna_drv_info icl_drv_info = {
+ .hwid = GNA_DEV_HWID_ICL,
+ GNA_GEN1_FEATURES
+};
+
+static const struct gna_drv_info jsl_drv_info = {
+ .hwid = GNA_DEV_HWID_JSL,
+ GNA_GEN2_FEATURES
+};
+
+static const struct gna_drv_info tgl_drv_info = {
+ .hwid = GNA_DEV_HWID_TGL,
+ GNA_GEN2_FEATURES
+};
+
+#define INTEL_GNA_DEVICE(hwid, info) \
+ { PCI_VDEVICE(INTEL, hwid), (kernel_ulong_t)(info) }
+
+const struct pci_device_id gna_pci_ids[] = {
+ INTEL_GNA_DEVICE(GNA_DEV_HWID_CNL, &cnl_drv_info),
+ INTEL_GNA_DEVICE(GNA_DEV_HWID_EHL, &ehl_drv_info),
+ INTEL_GNA_DEVICE(GNA_DEV_HWID_GLK, &glk_drv_info),
+ INTEL_GNA_DEVICE(GNA_DEV_HWID_ICL, &icl_drv_info),
+ INTEL_GNA_DEVICE(GNA_DEV_HWID_JSL, &jsl_drv_info),
+ INTEL_GNA_DEVICE(GNA_DEV_HWID_TGL, &tgl_drv_info),
+ { }
+};
+
+MODULE_DEVICE_TABLE(pci, gna_pci_ids);
+
static int gna_dev_init(struct gna_private *gna_priv, struct pci_dev *pcidev,
const struct pci_device_id *pci_id)
{
diff --git a/drivers/misc/gna/gna_device.h b/drivers/misc/gna/gna_device.h
index ee234e474d43..22c47f2c03ec 100644
--- a/drivers/misc/gna/gna_device.h
+++ b/drivers/misc/gna/gna_device.h
@@ -56,6 +56,8 @@ struct gna_private {
struct mutex memidr_lock;
};
+extern const struct pci_device_id gna_pci_ids[];
+
int gna_probe(struct pci_dev *dev, const struct pci_device_id *id);
void gna_remove(struct pci_dev *dev);
diff --git a/drivers/misc/gna/gna_driver.c b/drivers/misc/gna/gna_driver.c
index 81f0f003f377..80981c448f3a 100644
--- a/drivers/misc/gna/gna_driver.c
+++ b/drivers/misc/gna/gna_driver.c
@@ -15,6 +15,7 @@ struct class *gna_class;
static struct pci_driver gna_driver = {
.name = GNA_DRV_NAME,
+ .id_table = gna_pci_ids,
.probe = gna_probe,
.remove = gna_remove,
};
--
2.28.0
next prev parent reply other threads:[~2021-02-16 16:13 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-16 16:05 [PATCH v1 00/12] Driver of Intel(R) Gaussian & Neural Accelerator Maciej Kwapulinski
2021-02-16 16:05 ` [PATCH v1 01/12] gna: add driver module Maciej Kwapulinski
2021-02-16 16:54 ` Andy Shevchenko
2021-02-16 17:37 ` Jianxun Zhang
2021-02-19 13:21 ` Maciej Kwapulinski
2021-02-19 14:36 ` Andy Shevchenko
2021-02-26 18:29 ` Maciej Kwapulinski
2021-02-26 21:22 ` Jianxun Zhang
2021-02-27 6:33 ` Greg Kroah-Hartman
2021-03-01 10:18 ` Maciej Kwapulinski
2021-03-01 10:22 ` Greg Kroah-Hartman
2021-03-01 10:36 ` Maciej Kwapulinski
2021-03-01 10:39 ` Maciej Kwapulinski
2021-03-01 10:46 ` Greg Kroah-Hartman
2021-03-01 11:45 ` Maciej Kwapulinski
2021-02-16 17:46 ` Greg Kroah-Hartman
2021-02-17 7:30 ` Maciej Kwapulinski
2021-02-26 12:59 ` Maciej Kwapulinski
2021-02-26 13:03 ` Greg Kroah-Hartman
2021-03-09 18:26 ` Maciej Kwapulinski
2021-02-16 17:48 ` Randy Dunlap
2021-02-16 16:05 ` [PATCH v1 02/12] gna: add component of hardware operation Maciej Kwapulinski
2021-02-16 16:05 ` [PATCH v1 03/12] gna: read hardware info in the driver Maciej Kwapulinski
2021-02-16 16:05 ` [PATCH v1 04/12] gna: add memory handling Maciej Kwapulinski
2021-02-16 16:05 ` [PATCH v1 05/12] gna: initialize mmu Maciej Kwapulinski
2021-02-16 16:05 ` Maciej Kwapulinski [this message]
2021-02-16 16:05 ` [PATCH v1 07/12] gna: add request component Maciej Kwapulinski
2021-02-16 16:05 ` [PATCH v1 08/12] gna: implement scoring Maciej Kwapulinski
2021-02-16 16:05 ` [PATCH v1 09/12] gna: add a work queue to process scoring requests Maciej Kwapulinski
2021-02-16 16:05 ` [PATCH v1 10/12] gna: add interrupt handler Maciej Kwapulinski
2021-02-16 16:05 ` [PATCH v1 11/12] gna: add ioctl handler Maciej Kwapulinski
2021-02-16 16:05 ` [PATCH v1 12/12] gna: add a char device Maciej Kwapulinski
2021-02-16 17:48 ` Greg Kroah-Hartman
2021-02-16 17:28 ` [PATCH v1 00/12] Driver of Intel(R) Gaussian & Neural Accelerator Greg Kroah-Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210216160525.5028-7-maciej.kwapulinski@linux.intel.com \
--to=maciej.kwapulinski@linux.intel.com \
--cc=arnd@arndb.de \
--cc=corbet@lwn.net \
--cc=derek.kiernan@xilinx.com \
--cc=dragan.cvetic@xilinx.com \
--cc=gregkh@linuxfoundation.org \
--cc=jianxun.zhang@linux.intel.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=savox.novakovic@intel.com \
--cc=tomasz1.jankowski@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®