Displaying 20 results from an estimated 45 matches for "nvkm_device_ctor".
2020 Apr 28
3
[PATCH v3 1/3] device: rework mmio mapping code to get rid of second map
...------------
1 file changed, 15 insertions(+), 12 deletions(-)
diff --git a/drm/nouveau/nvkm/engine/device/base.c b/drm/nouveau/nvkm/engine/device/base.c
index 8ebbe1656..37589f365 100644
--- a/drm/nouveau/nvkm/engine/device/base.c
+++ b/drm/nouveau/nvkm/engine/device/base.c
@@ -2935,7 +2935,7 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
struct nvkm_subdev *subdev;
u64 mmio_base, mmio_size;
u32 boot0, strap;
- void __iomem *map;
+ void __iomem *map = NULL;
int ret = -EEXIST, i;
unsigned chipset;
@@ -2961,12 +2961,17 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
mmio_base...
2020 Oct 05
2
[PATCH] device: return error for unknown chipsets
Previously the code relied on device->pri to be NULL and to fail probing
later. We really should just return an error inside nvkm_device_ctor for
unsupported GPUs.
Fixes: 24d5ff40a732 ("drm/nouveau/device: rework mmio mapping code to get rid of second map")
Signed-off-by: Karol Herbst <kherbst at redhat.com>
Cc: dann frazier <dann.frazier at canonical.com>
---
drm/nouveau/nvkm/engine/device/base.c | 1 +
1 file c...
2020 Apr 17
2
[PATCH 1/3] device: use the correct mmio size when mapping
...ce/base.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drm/nouveau/nvkm/engine/device/base.c b/drm/nouveau/nvkm/engine/device/base.c
index 8ebbe1656..17676c75a 100644
--- a/drm/nouveau/nvkm/engine/device/base.c
+++ b/drm/nouveau/nvkm/engine/device/base.c
@@ -2963,7 +2963,7 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
/* identify the chipset, and determine classes of subdev/engines */
if (detect) {
- map = ioremap(mmio_base, 0x102000);
+ map = ioremap(mmio_base, mmio_size);
if (ret = -ENOMEM, map == NULL)
goto done;
--
2.25.2
2020 Apr 17
2
[PATCH v2 1/3] device: use the correct mmio size when mapping
...ce/base.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drm/nouveau/nvkm/engine/device/base.c b/drm/nouveau/nvkm/engine/device/base.c
index 8ebbe1656..17676c75a 100644
--- a/drm/nouveau/nvkm/engine/device/base.c
+++ b/drm/nouveau/nvkm/engine/device/base.c
@@ -2963,7 +2963,7 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
/* identify the chipset, and determine classes of subdev/engines */
if (detect) {
- map = ioremap(mmio_base, 0x102000);
+ map = ioremap(mmio_base, mmio_size);
if (ret = -ENOMEM, map == NULL)
goto done;
--
2.25.2
2020 Oct 06
1
[PATCH] device: return error for unknown chipsets
On Mon, Oct 05, 2020 at 03:52:30PM +0200, Karol Herbst wrote:
> Previously the code relied on device->pri to be NULL and to fail probing
> later. We really should just return an error inside nvkm_device_ctor for
> unsupported GPUs.
>
> Fixes: 24d5ff40a732 ("drm/nouveau/device: rework mmio mapping code to get rid of second map")
> Signed-off-by: Karol Herbst <kherbst at redhat.com>
> Cc: dann frazier <dann.frazier at canonical.com>
Thanks Karol! Got rid of the Oops...
2020 Oct 06
1
[PATCH] device: return error for unknown chipsets
...M dann frazier <dann.frazier at canonical.com> wrote:
> >
> > On Mon, Oct 05, 2020 at 03:52:30PM +0200, Karol Herbst wrote:
> > > Previously the code relied on device->pri to be NULL and to fail probing
> > > later. We really should just return an error inside nvkm_device_ctor for
> > > unsupported GPUs.
> > >
> > > Fixes: 24d5ff40a732 ("drm/nouveau/device: rework mmio mapping code to get rid of second map")
> > > Signed-off-by: Karol Herbst <kherbst at redhat.com>
> > > Cc: dann frazier <dann.frazier at can...
2020 Oct 13
3
[PATCH] drm/nouveau/device: fix changing endianess code to work on older GPUs
...01000001);
+ nvkm_rd32(device, 0x000000);
+ if (nvkm_rd32(device, 0x000004) != (big_endian ? 0x01000001 : 0x00000000))
+ return !big_endian; /* Assume GPU is LE on any unexpected read-back. */
+ }
+
+ /* CPU/GPU endianness should (hopefully) match. */
return true;
}
@@ -2987,14 +3004,10 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
if (detect) {
/* switch mmio to cpu's native endianness */
if (!nvkm_device_endianness(device)) {
- nvkm_wr32(device, 0x000004, 0x01000001);
- nvkm_rd32(device, 0x000000);
- if (!nvkm_device_endianness(device)) {
- nvdev_error(device,
-...
2016 Dec 12
2
[PATCH] drm/nouveau: fix unknown chipset for GTX 1060
...ce[1] = gp104_ce_new,
+ .ce[2] = gp104_ce_new,
+ .ce[3] = gp104_ce_new,
+ .disp = gp104_disp_new,
+ .dma = gf119_dma_new,
+ .fifo = gp100_fifo_new,
+};
+
static int
nvkm_device_event_ctor(struct nvkm_object *object, void *data, u32 size,
struct nvkm_notify *notify)
@@ -2644,6 +2672,7 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
case 0x12b: device->chip = &nv12b_chipset; break;
case 0x130: device->chip = &nv130_chipset; break;
case 0x134: device->chip = &nv134_chipset; break;
+ case 0x136: device->chip = &nv136_chipset; break;
default:
nvdev_...
2020 Apr 28
0
[PATCH v3 2/3] device: detect if changing endianness failed
...ice_del(struct nvkm_device **pdevice)
}
}
+static inline bool
+nvkm_device_endianness(void __iomem *pri)
+{
+ u32 boot1 = ioread32_native(pri + 0x000004) & 0x01000001;
+#ifdef __BIG_ENDIAN
+ if (!boot1)
+ return false;
+#else
+ if (boot1)
+ return false;
+#endif
+ return true;
+}
+
int
nvkm_device_ctor(const struct nvkm_device_func *func,
const struct nvkm_device_quirk *quirk,
@@ -2973,13 +2987,15 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
/* identify the chipset, and determine classes of subdev/engines */
if (detect) {
/* switch mmio to cpu's native endianness */
-#i...
2020 Oct 06
0
[PATCH] device: return error for unknown chipsets
...ct 6, 2020 at 6:43 PM dann frazier <dann.frazier at canonical.com> wrote:
>
> On Mon, Oct 05, 2020 at 03:52:30PM +0200, Karol Herbst wrote:
> > Previously the code relied on device->pri to be NULL and to fail probing
> > later. We really should just return an error inside nvkm_device_ctor for
> > unsupported GPUs.
> >
> > Fixes: 24d5ff40a732 ("drm/nouveau/device: rework mmio mapping code to get rid of second map")
> > Signed-off-by: Karol Herbst <kherbst at redhat.com>
> > Cc: dann frazier <dann.frazier at canonical.com>
>
>...
2024 Jun 18
1
[PATCH 2/2] [v5] drm/nouveau: expose GSP-RM logging buffers via debugfs
.... It just wraps one struct inside another.
Should I add this to struct nvkm_device_func? And then do something like this in pci.c:
static struct nvif_logs gsp_logs;
static const struct nvkm_device_func
nvkm_device_pci_func = {
...
.nvif_logs = &gsp_logs,
};
So nvkm_device_pci_new() calls nvkm_device_ctor(). nvkm_device_ctor() then calls the .ctor() for every subdevice via NVKM_LAYOUT_ONCE() and NVKM_LAYOUT_INST(). This is where I get lost, because I don't see how I make sure only the GSP constructor tries to initialize gsp_logs.
+#ifdef CONFIG_DEBUG_FS
+/**
+ * gsp_logs - list of GSP deb...
2017 Feb 14
1
[PATCH] drm/nouveau/core: recognise GP107 chipset
...ce[1] = gp104_ce_new,
+ .ce[2] = gp104_ce_new,
+ .ce[3] = gp104_ce_new,
+ .disp = gp104_disp_new,
+ .dma = gf119_dma_new,
+ .fifo = gp100_fifo_new,
+};
+
static int
nvkm_device_event_ctor(struct nvkm_object *object, void *data, u32 size,
struct nvkm_notify *notify)
@@ -2673,6 +2701,7 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
case 0x130: device->chip = &nv130_chipset; break;
case 0x134: device->chip = &nv134_chipset; break;
case 0x136: device->chip = &nv136_chipset; break;
+ case 0x137: device->chip = &nv137_chipset; break;
default:
nvdev_...
2015 Oct 07
2
Chipset & Family
...device/base.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drm/nouveau/nvkm/engine/device/base.c b/drm/nouveau/nvkm/engine/device/base.c
index bbc9824..932a29a 100644
--- a/drm/nouveau/nvkm/engine/device/base.c
+++ b/drm/nouveau/nvkm/engine/device/base.c
@@ -2467,7 +2467,7 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
goto done;
}
- nvdev_info(device, "NVIDIA %s (%08x)\n",
+ nvdev_info(device, "GPU NVIDIA Chipset: %s (%08x)\n",
device->chip->name, boot0);
/* determine frequency of timing crystal */
--
2.6.0
2016 Dec 12
0
[PATCH] drm/nouveau: fix unknown chipset for GTX 1060
...; + .ce[3] = gp104_ce_new,
> + .disp = gp104_disp_new,
> + .dma = gf119_dma_new,
> + .fifo = gp100_fifo_new,
> +};
> +
> static int
> nvkm_device_event_ctor(struct nvkm_object *object, void *data, u32 size,
> struct nvkm_notify *notify)
> @@ -2644,6 +2672,7 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
> case 0x12b: device->chip = &nv12b_chipset; break;
> case 0x130: device->chip = &nv130_chipset; break;
> case 0x134: device->chip = &nv134_chipset; break;
> + case 0x136: device->chip = &nv136_chipset; break;
&g...
2017 Feb 14
0
[PATCH] drm/nouveau/core: recognise GP107 chipset
...+ .disp = gp104_disp_new,
> + .dma = gf119_dma_new,
> + .fifo = gp100_fifo_new,
> +};
> +
> static int
> nvkm_device_event_ctor(struct nvkm_object *object, void *data, u32 size,
> struct nvkm_notify *notify)
> @@ -2673,6 +2701,7 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
> case 0x130: device->chip = &nv130_chipset; break;
> case 0x134: device->chip = &nv134_chipset; break;
> case 0x136: device->chip = &nv136_chipset; break;
> + case 0x...
2017 Jul 03
0
[PATCH] initial support (display-only) for GP108
...02_ce_new,
+ .ce[1] = gp102_ce_new,
+ .ce[2] = gp102_ce_new,
+ .ce[3] = gp102_ce_new,
+ .disp = gp102_disp_new,
+ .dma = gf119_dma_new,
+ .fifo = gp100_fifo_new,
+};
+
+static const struct nvkm_device_chip
nv13b_chipset = {
.name = "GP10B",
.bar = gk20a_bar_new,
@@ -2782,6 +2811,7 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
case 0x134: device->chip = &nv134_chipset; break;
case 0x136: device->chip = &nv136_chipset; break;
case 0x137: device->chip = &nv137_chipset; break;
+ case 0x138: device->chip = &nv138_chipset; break;
case 0x13b: device-...
2020 Oct 13
0
[PATCH] drm/nouveau/device: fix changing endianess code to work on older GPUs
...) != (big_endian ? 0x01000001 : 0x00000000))
> + return !big_endian; /* Assume GPU is LE on any unexpected read-back. */
> + }
> +
> + /* CPU/GPU endianness should (hopefully) match. */
> return true;
> }
>
> @@ -2987,14 +3004,10 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
> if (detect) {
> /* switch mmio to cpu's native endianness */
> if (!nvkm_device_endianness(device)) {
> - nvkm_wr32(device, 0x000004, 0x01000001);
> - nvkm_r...
2016 Oct 06
6
[PATCH v5 0/3] drm/nouveau: set DMA mask before mapping scratch page
This v4 is now a 3 piece series (since v4), after Alexandre pointed out that
both GF 100 and NV50 are affected by the same issue, and that a related issue
has been solved already for Tegra in commit 9d0394c6bed5
("drm/nouveau/instmem/gk20a: set DMA mask early").
The issue that this series addresses is the fact that the Nouveau driver
invokes the DMA API before setting the DMA mask. In
2019 May 23
0
[PATCH 5.0 087/139] PCI: Reset Lenovo ThinkPad P50 nvgpu at boot if necessary
...eset_lenovo_thinkpad_p50_nvgpu(struct pci_dev *pdev)
+{
+ void __iomem *map;
+ int ret;
+
+ if (pdev->subsystem_vendor != PCI_VENDOR_ID_LENOVO ||
+ pdev->subsystem_device != 0x222e ||
+ !pdev->reset_fn)
+ return;
+
+ if (pci_enable_device_mem(pdev))
+ return;
+
+ /*
+ * Based on nvkm_device_ctor() in
+ * drivers/gpu/drm/nouveau/nvkm/engine/device/base.c
+ */
+ map = pci_iomap(pdev, 0, 0x23000);
+ if (!map) {
+ pci_err(pdev, "Can't map MMIO space\n");
+ goto out_disable;
+ }
+
+ /*
+ * Make sure the GPU looks like it's been POSTed before resetting
+ * it.
+ */
+ if...
2019 May 23
0
[PATCH 5.1 096/122] PCI: Reset Lenovo ThinkPad P50 nvgpu at boot if necessary
...eset_lenovo_thinkpad_p50_nvgpu(struct pci_dev *pdev)
+{
+ void __iomem *map;
+ int ret;
+
+ if (pdev->subsystem_vendor != PCI_VENDOR_ID_LENOVO ||
+ pdev->subsystem_device != 0x222e ||
+ !pdev->reset_fn)
+ return;
+
+ if (pci_enable_device_mem(pdev))
+ return;
+
+ /*
+ * Based on nvkm_device_ctor() in
+ * drivers/gpu/drm/nouveau/nvkm/engine/device/base.c
+ */
+ map = pci_iomap(pdev, 0, 0x23000);
+ if (!map) {
+ pci_err(pdev, "Can't map MMIO space\n");
+ goto out_disable;
+ }
+
+ /*
+ * Make sure the GPU looks like it's been POSTed before resetting
+ * it.
+ */
+ if...