aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKoby Elbaz <[email protected]>2023-10-05 11:06:14 -0400
committerRodrigo Vivi <[email protected]>2023-12-21 11:42:58 -0500
commit399a13323f0d148bf00eff7e9156efe8a97063c0 (patch)
treeafc886a34432bcbb3481ce2b13cc5ec4ea33e8b1
parente814389ff180514001df424f48645cf30f4a2a1e (diff)
drm/xe: add 28-bit address support in struct xe_reg
Xe driver currently supports 22-bit addresses for MMIO access. Future platforms will have additional MMIO extension with larger address spaces, and to access them, the driver will have to support wider address representation. Please note that while the XE_REG macro is used for MMIO access, XE_REG_EXT macro will be used for MMIO-extension access. Signed-off-by: Koby Elbaz <[email protected]> Reviewed-by: Ofir Bitton <[email protected]> Reviewed-by: Moti Haimovski <[email protected]> Signed-off-by: Rodrigo Vivi <[email protected]>
-rw-r--r--drivers/gpu/drm/xe/regs/xe_reg_defs.h16
-rw-r--r--drivers/gpu/drm/xe/xe_device_types.h13
2 files changed, 28 insertions, 1 deletions
diff --git a/drivers/gpu/drm/xe/regs/xe_reg_defs.h b/drivers/gpu/drm/xe/regs/xe_reg_defs.h
index 478787c75e29..5078a9e69859 100644
--- a/drivers/gpu/drm/xe/regs/xe_reg_defs.h
+++ b/drivers/gpu/drm/xe/regs/xe_reg_defs.h
@@ -19,7 +19,7 @@ struct xe_reg {
union {
struct {
/** @addr: address */
- u32 addr:22;
+ u32 addr:28;
/**
* @masked: register is "masked", with upper 16bits used
* to identify the bits that are updated on the lower
@@ -35,6 +35,10 @@ struct xe_reg {
* value can inspect it.
*/
u32 mcr:1;
+ /**
+ * @ext: access MMIO extension space for current register.
+ */
+ u32 ext:1;
};
/** @raw: Raw value with both address and options */
u32 raw;
@@ -85,6 +89,16 @@ struct xe_reg_mcr {
#define XE_REG(r_, ...) ((const struct xe_reg)XE_REG_INITIALIZER(r_, ##__VA_ARGS__))
/**
+ * XE_REG_EXT - Create a struct xe_reg from extension offset and additional
+ * flags
+ * @r_: Register extension offset
+ * @...: Additional options like access mode. See struct xe_reg for available
+ * options.
+ */
+#define XE_REG_EXT(r_, ...) \
+ ((const struct xe_reg)XE_REG_INITIALIZER(r_, ##__VA_ARGS__, .ext = 1))
+
+/**
* XE_REG_MCR - Create a struct xe_reg_mcr from offset and additional flags
* @r_: Register offset
* @...: Additional options like access mode. See struct xe_reg for available
diff --git a/drivers/gpu/drm/xe/xe_device_types.h b/drivers/gpu/drm/xe/xe_device_types.h
index dd52d112d58f..f7c7d44a6465 100644
--- a/drivers/gpu/drm/xe/xe_device_types.h
+++ b/drivers/gpu/drm/xe/xe_device_types.h
@@ -140,6 +140,19 @@ struct xe_tile {
void *regs;
} mmio;
+ /**
+ * @mmio_ext: MMIO-extension info for a tile.
+ *
+ * Each tile has its own additional 256MB (28-bit) MMIO-extension space.
+ */
+ struct {
+ /** @size: size of tile's additional MMIO-extension space */
+ size_t size;
+
+ /** @regs: pointer to tile's additional MMIO-extension space */
+ void *regs;
+ } mmio_ext;
+
/** @mem: memory management info for tile */
struct {
/**