drm/xe: add 28-bit address support in struct xe_reg
authorKoby Elbaz <kelbaz@habana.ai>
Thu, 5 Oct 2023 15:06:14 +0000 (11:06 -0400)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Thu, 21 Dec 2023 16:42:58 +0000 (11:42 -0500)
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 <kelbaz@habana.ai>
Reviewed-by: Ofir Bitton <obitton@habana.ai>
Reviewed-by: Moti Haimovski <mhaimovski@habana.ai>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/xe/regs/xe_reg_defs.h
drivers/gpu/drm/xe/xe_device_types.h

index 478787c..5078a9e 100644 (file)
@@ -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;
@@ -84,6 +88,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
index dd52d11..f7c7d44 100644 (file)
@@ -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 {
                /**