Commit 2d8865b2 authored by Michal Wajdeczko's avatar Michal Wajdeczko

drm/xe: Move BAR definitions to dedicated file

We should keep all hardware definitions separated from the driver
code. Move LMEM_BAR definition to new regs/xe_bars.h file and also
add there GTTMMADR_BAR definition to avoid using magic 0 resource.
Signed-off-by: default avatarMichal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Matt Roper <matthew.d.roper@intel.com>
Reviewed-by: default avatarMatt Roper <matthew.d.roper@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240530133527.1328-3-michal.wajdeczko@intel.com
parent 2adfc4e0
/* SPDX-License-Identifier: MIT */
/*
* Copyright © 2024 Intel Corporation
*/
#ifndef _XE_BARS_H_
#define _XE_BARS_H_
#define GTTMMADR_BAR 0 /* MMIO + GTT */
#define LMEM_BAR 2 /* VRAM */
#endif
......@@ -12,6 +12,7 @@
#include <drm/drm_managed.h>
#include <drm/xe_drm.h>
#include "regs/xe_bars.h"
#include "regs/xe_engine_regs.h"
#include "regs/xe_gt_regs.h"
#include "regs/xe_regs.h"
......@@ -435,7 +436,7 @@ int xe_mmio_init(struct xe_device *xe)
* registers (0-4MB), reserved space (4MB-8MB) and GGTT (8MB-16MB).
*/
xe->mmio.size = pci_resource_len(pdev, mmio_bar);
xe->mmio.regs = pci_iomap(pdev, mmio_bar, 0);
xe->mmio.regs = pci_iomap(pdev, mmio_bar, GTTMMADR_BAR);
if (xe->mmio.regs == NULL) {
drm_err(&xe->drm, "failed to map registers\n");
return -EIO;
......
......@@ -11,8 +11,6 @@
struct xe_device;
struct xe_reg;
#define LMEM_BAR 2
int xe_mmio_init(struct xe_device *xe);
int xe_mmio_probe_tiles(struct xe_device *xe);
......
......@@ -13,6 +13,7 @@
#include <generated/xe_wa_oob.h>
#include "regs/xe_bars.h"
#include "regs/xe_gt_regs.h"
#include "regs/xe_regs.h"
#include "xe_bo.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment