Imagination Technologies PowerVR DRM driver
Subsystems (6)
v3 cover Imagination Technologies PowerVR DRM driver
This patch series adds the initial DRM driver for Imagination Technologies PowerVR GPUs, starting with those based on our Rogue architecture. It's worth pointing out that this is a new driver, written from the ground up, rather than a refactored version of our existing downstream driver (pvrsrvkm).
This new DRM driver supports:
- GEM shmem allocations
- dma-buf / PRIME
- Per-context userspace managed virtual address space
- DRM sync objects (binary and timeline)
- Power management suspend / resume
- GPU job submission (geometry, fragment, compute, transfer)
- META firmware processor
- MIPS firmware processor
- GPU hang detection
Currently our main focus is on our GX6250, AXE-1-16M and BXS-4-64 GPUs. Testing so far has been done using an Acer Chromebook R13 (GX6250 GPU) and a TI SK-AM62 board (AXE-1-16M GPU). Firmware for the GX6250 and AXE-1-16M can be found here:
https://gitlab.freedesktop.org/frankbinns/linux-firmware/-/tree/powervr
A Vulkan driver that works with our downstream kernel driver has already been merged into Mesa [1][2]. Support for this new DRM driver is being maintained in a draft merge request [3], with the branch located here:
https://gitlab.freedesktop.org/frankbinns/mesa/-/tree/powervr-winsys
Job stream formats are documented at:
https://gitlab.freedesktop.org/mesa/mesa/-/blob/73fe6db819d951c02ce57eefcbd9b31b85900f33/src/imagination/csbgen/rogue_kmd_stream.xml
The Vulkan driver is progressing towards Vulkan 1.0. We're code complete, and are working towards passing conformance. The current combination of this kernel driver with the Mesa Vulkan driver achieves 71.8% conformance.
The code in this patch series, along with some of its history, can also be found here:
https://gitlab.freedesktop.org/frankbinns/powervr/-/tree/powervr-next
This patch series has dependencies on a number of patches not yet merged. They are listed below :
maple_tree: split up MA_STATE() macro:https://lists.freedesktop.org/archives/dri-devel/2023-June/407927.html
drm: manager to keep track of GPUs VA mappings: https://lists.freedesktop.org/archives/dri-devel/2023-June/407928.html
drm/sched: Convert drm scheduler to use a work queue rather than kthread: https://lists.freedesktop.org/archives/dri-devel/2023-April/398458.html
drm/sched: Move schedule policy to scheduler / entity: https://lists.freedesktop.org/archives/dri-devel/2023-April/398461.html
drm/sched: Add DRM_SCHED_POLICY_SINGLE_ENTITY scheduling policy: https://lists.freedesktop.org/archives/dri-devel/2023-April/398460.html
drm/sched: Start run wq before TDR in drm_sched_start: https://lists.freedesktop.org/archives/dri-devel/2023-April/398462.html
drm/sched: Submit job before starting TDR: https://lists.freedesktop.org/archives/dri-devel/2023-April/398466.html
drm/sched: Add helper to set TDR timeout: https://lists.freedesktop.org/archives/dri-devel/2023-April/398464.html
drm: fix drmm_mutex_init(): https://lists.freedesktop.org/archives/dri-devel/2023-May/404863.html
drm/sched: Make sure we wait for all dependencies in kill_jobs_cb(): https://lists.freedesktop.org/archives/dri-devel/2023-June/408901.html
drm/sched: Call drm_sched_fence_set_parent() from drm_sched_fence_scheduled(): https://lists.freedesktop.org/archives/dri-devel/2023-June/408904.html
[1] https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15243
[2] https://gitlab.freedesktop.org/mesa/mesa/-/tree/main/src/imagination/vulkan
[3] https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15507
v3:
* Use drm_sched for scheduling
* Use GPU VA manager
* Use runtime PM
* Use drm_gem_shmem
* GPU watchdog and device loss handling
v2:
* Redesigned and simplified UAPI based on RFC feedback from XDC 2022
* Support for transfer and partial render jobs
* Support for timeline sync objects
RFC v1: https://lists.freedesktop.org/archives/dri-devel/2022-August/367814.html
RFC v2: https://lists.freedesktop.org/archives/dri-devel/2023-April/400149.html
Matt Coster (1):
sizes.h: Add entries between 32G and 64T
Sarah Walker (16):
dt-bindings: gpu: Add Imagination Technologies PowerVR GPU drm/imagination/uapi: Add PowerVR driver UAPI drm/imagination: Add skeleton PowerVR driver drm/imagination: Get GPU resources
drm/imagination: Add GPU register and FWIF headers drm/imagination: Add GPU ID parsing and firmware loading drm/imagination: Add GEM and VM related code drm/imagination: Implement power management drm/imagination: Implement firmware infrastructure and META FW support drm/imagination: Implement MIPS firmware processor and MMU support drm/imagination: Implement free list and HWRT create and destroy
ioctls
drm/imagination: Implement context creation/destruction ioctls drm/imagination: Implement job submission and scheduling drm/imagination: Add firmware trace to debugfs drm/imagination: Add driver documentation
arm64: dts: ti: k3-am62-main: Add GPU device node [DO NOT MERGE]
.../devicetree/bindings/gpu/img,powervr.yaml | 71 + Documentation/gpu/drivers.rst | 2 + Documentation/gpu/imagination/index.rst | 14 + Documentation/gpu/imagination/uapi.rst | 174 + .../gpu/imagination/virtual_memory.rst | 462 ++ MAINTAINERS | 10 + arch/arm64/boot/dts/ti/k3-am62-main.dtsi | 13 + drivers/gpu/drm/Kconfig | 2 + drivers/gpu/drm/Makefile | 1 + drivers/gpu/drm/imagination/Kconfig | 15 + drivers/gpu/drm/imagination/Makefile | 33 + drivers/gpu/drm/imagination/pvr_ccb.c | 660 ++ drivers/gpu/drm/imagination/pvr_ccb.h | 62 + drivers/gpu/drm/imagination/pvr_cccb.c | 230 + drivers/gpu/drm/imagination/pvr_cccb.h | 102 + drivers/gpu/drm/imagination/pvr_context.c | 450 ++ drivers/gpu/drm/imagination/pvr_context.h | 190 + drivers/gpu/drm/imagination/pvr_debugfs.c | 53 + drivers/gpu/drm/imagination/pvr_debugfs.h | 29 + drivers/gpu/drm/imagination/pvr_device.c | 761 ++ drivers/gpu/drm/imagination/pvr_device.h | 795 +++ drivers/gpu/drm/imagination/pvr_device_info.c | 223 + drivers/gpu/drm/imagination/pvr_device_info.h | 133 + drivers/gpu/drm/imagination/pvr_drv.c | 1520 ++++ drivers/gpu/drm/imagination/pvr_drv.h | 130 + drivers/gpu/drm/imagination/pvr_free_list.c | 577 ++ drivers/gpu/drm/imagination/pvr_free_list.h | 185 + drivers/gpu/drm/imagination/pvr_fw.c | 1388 ++++ drivers/gpu/drm/imagination/pvr_fw.h | 425 ++ drivers/gpu/drm/imagination/pvr_fw_info.h | 115 + drivers/gpu/drm/imagination/pvr_fw_meta.c | 610 ++ drivers/gpu/drm/imagination/pvr_fw_meta.h | 14 + drivers/gpu/drm/imagination/pvr_fw_mips.c | 280 + drivers/gpu/drm/imagination/pvr_fw_mips.h | 38 + .../gpu/drm/imagination/pvr_fw_startstop.c | 280 + .../gpu/drm/imagination/pvr_fw_startstop.h | 13 + drivers/gpu/drm/imagination/pvr_fw_trace.c | 490 ++ drivers/gpu/drm/imagination/pvr_fw_trace.h | 78 + drivers/gpu/drm/imagination/pvr_gem.c | 397 ++ drivers/gpu/drm/imagination/pvr_gem.h | 201 + drivers/gpu/drm/imagination/pvr_hwrt.c | 559 ++ drivers/gpu/drm/imagination/pvr_hwrt.h | 163 + drivers/gpu/drm/imagination/pvr_job.c | 834 +++ drivers/gpu/drm/imagination/pvr_job.h | 147 + drivers/gpu/drm/imagination/pvr_params.c | 147 + drivers/gpu/drm/imagination/pvr_params.h | 72 + drivers/gpu/drm/imagination/pvr_power.c | 332 + drivers/gpu/drm/imagination/pvr_power.h | 41 + drivers/gpu/drm/imagination/pvr_queue.c | 1203 ++++ drivers/gpu/drm/imagination/pvr_queue.h | 157 + .../gpu/drm/imagination/pvr_rogue_cr_defs.h | 6193 +++++++++++++++++ .../imagination/pvr_rogue_cr_defs_client.h | 159 + drivers/gpu/drm/imagination/pvr_rogue_defs.h | 179 + drivers/gpu/drm/imagination/pvr_rogue_fwif.h | 2208 ++++++ .../drm/imagination/pvr_rogue_fwif_check.h | 491 ++ .../drm/imagination/pvr_rogue_fwif_client.h | 369 + .../imagination/pvr_rogue_fwif_client_check.h | 133 + .../drm/imagination/pvr_rogue_fwif_common.h | 60 + .../pvr_rogue_fwif_resetframework.h | 28 + .../gpu/drm/imagination/pvr_rogue_fwif_sf.h | 1648 +++++ .../drm/imagination/pvr_rogue_fwif_shared.h | 258 + .../imagination/pvr_rogue_fwif_shared_check.h | 108 + .../drm/imagination/pvr_rogue_fwif_stream.h | 78 + .../drm/imagination/pvr_rogue_heap_config.h | 113 + drivers/gpu/drm/imagination/pvr_rogue_meta.h | 356 + drivers/gpu/drm/imagination/pvr_rogue_mips.h | 335 + .../drm/imagination/pvr_rogue_mips_check.h | 58 + .../gpu/drm/imagination/pvr_rogue_mmu_defs.h | 136 + drivers/gpu/drm/imagination/pvr_stream.c | 309 + drivers/gpu/drm/imagination/pvr_stream.h | 75 + drivers/gpu/drm/imagination/pvr_stream_defs.c | 351 + drivers/gpu/drm/imagination/pvr_stream_defs.h | 16 + drivers/gpu/drm/imagination/pvr_vm.c | 3417 +++++++++ drivers/gpu/drm/imagination/pvr_vm.h | 99 + drivers/gpu/drm/imagination/pvr_vm_mips.c | 222 + drivers/gpu/drm/imagination/pvr_vm_mips.h | 22 + include/linux/sizes.h | 9 + include/uapi/drm/pvr_drm.h | 1333 ++++ 78 files changed, 33644 insertions(+) create mode 100644 Documentation/devicetree/bindings/gpu/img,powervr.yaml create mode 100644 Documentation/gpu/imagination/index.rst create mode 100644 Documentation/gpu/imagination/uapi.rst create mode 100644 Documentation/gpu/imagination/virtual_memory.rst create mode 100644 drivers/gpu/drm/imagination/Kconfig create mode 100644 drivers/gpu/drm/imagination/Makefile create mode 100644 drivers/gpu/drm/imagination/pvr_ccb.c create mode 100644 drivers/gpu/drm/imagination/pvr_ccb.h create mode 100644 drivers/gpu/drm/imagination/pvr_cccb.c create mode 100644 drivers/gpu/drm/imagination/pvr_cccb.h create mode 100644 drivers/gpu/drm/imagination/pvr_context.c create mode 100644 drivers/gpu/drm/imagination/pvr_context.h create mode 100644 drivers/gpu/drm/imagination/pvr_debugfs.c create mode 100644 drivers/gpu/drm/imagination/pvr_debugfs.h create mode 100644 drivers/gpu/drm/imagination/pvr_device.c create mode 100644 drivers/gpu/drm/imagination/pvr_device.h create mode 100644 drivers/gpu/drm/imagination/pvr_device_info.c create mode 100644 drivers/gpu/drm/imagination/pvr_device_info.h create mode 100644 drivers/gpu/drm/imagination/pvr_drv.c create mode 100644 drivers/gpu/drm/imagination/pvr_drv.h create mode 100644 drivers/gpu/drm/imagination/pvr_free_list.c create mode 100644 drivers/gpu/drm/imagination/pvr_free_list.h create mode 100644 drivers/gpu/drm/imagination/pvr_fw.c create mode 100644 drivers/gpu/drm/imagination/pvr_fw.h create mode 100644 drivers/gpu/drm/imagination/pvr_fw_info.h create mode 100644 drivers/gpu/drm/imagination/pvr_fw_meta.c create mode 100644 drivers/gpu/drm/imagination/pvr_fw_meta.h create mode 100644 drivers/gpu/drm/imagination/pvr_fw_mips.c create mode 100644 drivers/gpu/drm/imagination/pvr_fw_mips.h create mode 100644 drivers/gpu/drm/imagination/pvr_fw_startstop.c create mode 100644 drivers/gpu/drm/imagination/pvr_fw_startstop.h create mode 100644 drivers/gpu/drm/imagination/pvr_fw_trace.c create mode 100644 drivers/gpu/drm/imagination/pvr_fw_trace.h create mode 100644 drivers/gpu/drm/imagination/pvr_gem.c create mode 100644 drivers/gpu/drm/imagination/pvr_gem.h create mode 100644 drivers/gpu/drm/imagination/pvr_hwrt.c create mode 100644 drivers/gpu/drm/imagination/pvr_hwrt.h create mode 100644 drivers/gpu/drm/imagination/pvr_job.c create mode 100644 drivers/gpu/drm/imagination/pvr_job.h create mode 100644 drivers/gpu/drm/imagination/pvr_params.c create mode 100644 drivers/gpu/drm/imagination/pvr_params.h create mode 100644 drivers/gpu/drm/imagination/pvr_power.c create mode 100644 drivers/gpu/drm/imagination/pvr_power.h create mode 100644 drivers/gpu/drm/imagination/pvr_queue.c create mode 100644 drivers/gpu/drm/imagination/pvr_queue.h create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_cr_defs.h create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_cr_defs_client.h create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_defs.h create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_fwif.h create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_fwif_check.h create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_fwif_client.h create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_fwif_client_check.h create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_fwif_common.h create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_fwif_resetframework.h create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_fwif_sf.h create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_fwif_shared.h create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_fwif_shared_check.h create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_fwif_stream.h create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_heap_config.h create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_meta.h create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_mips.h create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_mips_check.h create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_mmu_defs.h create mode 100644 drivers/gpu/drm/imagination/pvr_stream.c create mode 100644 drivers/gpu/drm/imagination/pvr_stream.h create mode 100644 drivers/gpu/drm/imagination/pvr_stream_defs.c create mode 100644 drivers/gpu/drm/imagination/pvr_stream_defs.h create mode 100644 drivers/gpu/drm/imagination/pvr_vm.c create mode 100644 drivers/gpu/drm/imagination/pvr_vm.h create mode 100644 drivers/gpu/drm/imagination/pvr_vm_mips.c create mode 100644 drivers/gpu/drm/imagination/pvr_vm_mips.h create mode 100644 include/uapi/drm/pvr_drm.h
Signature · 1 line
2.40.1
PATCH v3 1/17 sizes.h: Add entries between 32G and 64T
From: Matt Coster <[email protected]>
--- include/linux/sizes.h | 9 +++++++++ 1 file changed, 9 insertions(+)
include/linux/sizes.h +9 -0
@@ -47,8 +47,17 @@#define SZ_8G _AC(0x200000000, ULL)#define SZ_16G _AC(0x400000000, ULL)#define SZ_32G _AC(0x800000000, ULL) +#define SZ_64G _AC(0x1000000000, ULL) +#define SZ_128G _AC(0x2000000000, ULL) +#define SZ_256G _AC(0x4000000000, ULL) +#define SZ_512G _AC(0x8000000000, ULL)#define SZ_1T _AC(0x10000000000, ULL) +#define SZ_2T _AC(0x20000000000, ULL) +#define SZ_4T _AC(0x40000000000, ULL) +#define SZ_8T _AC(0x80000000000, ULL) +#define SZ_16T _AC(0x100000000000, ULL) +#define SZ_32T _AC(0x200000000000, ULL)#define SZ_64T _AC(0x400000000000, ULL)#endif /* __LINUX_SIZES_H__ */
Signature · 1 line
2.40.1
Re: [PATCH v3 01/17] sizes.h: Add entries between 32G and 64T
Quoted 3 lines · Sarah Walker
From: Matt Coster <[email protected]>
Signed-off-by Matt Coster <[email protected]>
Looks useful.
Yours,
Linus Walleij
Re: [PATCH v3 01/17] sizes.h: Add entries between 32G and 64T
Hi Linus,
Quoted 8 lines · Linus Walleij
Quoted 3 lines · Sarah Walker
From: Matt Coster <[email protected]>
Signed-off-by Matt Coster <[email protected]>Looks useful.
Reviewed-by Linus Walleij <[email protected]>
Thank you for the review!
Frank
Quoted 3 lines
Yours,
Linus Walleij
PATCH v3 2/17 dt-bindings: gpu: Add Imagination Technologies PowerVR GPU
In reply to Sarah WalkerAdd the device tree binding documentation for the Series AXE GPU used in TI AM62 SoCs.
--- .../devicetree/bindings/gpu/img,powervr.yaml | 71 +++++++++++++++++++ MAINTAINERS | 7 ++ 2 files changed, 78 insertions(+) create mode 100644 Documentation/devicetree/bindings/gpu/img,powervr.yaml
Documentation/devicetree/bindings/gpu/img,powervr.yaml new file +71 -0
@@ -0,0 +1,71 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +# Copyright (c) 2022 Imagination Technologies Ltd. +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/gpu/img,powervr.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Imagination Technologies PowerVR GPU + +maintainers: + - Sarah Walker <[email protected]> + +properties: + compatible: + oneOf: + - items: + - enum: + - ti,am62-gpu + - const: img,powervr-seriesaxe + + reg: + maxItems: 1 + + clocks: + minItems: 1 + maxItems: 3 + + clock-names: + items: + - const: core + - const: mem + - const: sys + minItems: 1 + + interrupts: + items: + - description: GPU interrupt + + interrupt-names: + items: + - const: gpu + + power-domains: + maxItems: 1 + + power-supply: true + +required: + - compatible + - reg + - clocks + - clock-names + - interrupts + - interrupt-names + +additionalProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/irq.h> + #include <dt-bindings/interrupt-controller/arm-gic.h> + + gpu: gpu@fd00000 { + compatible = "ti,am62-gpu", "img,powervr-seriesaxe"; + reg = <0x0fd00000 0x20000>; + power-domains = <&some_pds 187>; + clocks = <&k3_clks 187 0>; + clock-names = "core"; + interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "gpu"; + };
MAINTAINERS +7 -0
@@ -10084,6 +10084,13 @@ IMGTEC IR DECODER DRIVER S: Orphan F: drivers/media/rc/img-ir/ +IMGTEC POWERVR DRM DRIVER +M: Frank Binns <[email protected]> +M: Sarah Walker <[email protected]> +M: Donald Robson <[email protected]> +S: Supported +F: Documentation/devicetree/bindings/gpu/img,powervr.yaml + IMON SOUNDGRAPH USB IR RECEIVER M: Sean Young <[email protected]> L: [email protected]
Signature · 1 line
2.40.1
Re: [PATCH v3 02/17] dt-bindings: gpu: Add Imagination Technologies PowerVR GPU
Quoted 21 lines · Sarah Walker
Add the device tree binding documentation for the Series AXE GPU used in TI AM62 SoCs.
Signed-off-by Sarah Walker <[email protected]>--- .../devicetree/bindings/gpu/img,powervr.yaml | 71 +++++++++++++++++++ MAINTAINERS | 7 ++ 2 files changed, 78 insertions(+)create mode 100644
Documentation/devicetree/bindings/gpu/img,powervr.yamlDocumentation/devicetree/bindings/gpu/img,powervr.yaml new file +5
-0@@ -0,0 +1,71 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +# Copyright (c) 2022 Imagination Technologies Ltd. +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/gpu/img,powervr.yaml#
Documentation/devicetree/bindings/gpu/img,powervr.yaml line 15
Quoted 10 lines
Documentation/devicetree/bindings/gpu/img,powervr.yaml new file +10
-0+$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Imagination Technologies PowerVR GPU + +maintainers: + - Sarah Walker <[email protected]> + +properties: + compatible: + oneOf:
oneOf shouldn't be needed, you can just do the enum followed by const.
Quoted 21 lines
Documentation/devicetree/bindings/gpu/img,powervr.yaml new file +21
-0+ - items: + - enum: + - ti,am62-gpu + - const: img,powervr-seriesaxe + + reg: + maxItems: 1 + + clocks: + minItems: 1 + maxItems: 3 + + clock-names: + items: + - const: core + - const: mem + - const: sys + minItems: 1 + + interrupts: + items:
Documentation/devicetree/bindings/gpu/img,powervr.yaml line 46
Quoted 10 lines
Documentation/devicetree/bindings/gpu/img,powervr.yaml new file +10
-0+ - description: GPU interrupt + + interrupt-names: + items: + - const: gpu + + power-domains: + maxItems: 1 + + power-supply: true
Why do you need power-supply?
Andrew
Quoted 43 lines
Documentation/devicetree/bindings/gpu/img,powervr.yaml new file +25
-0+ +required: + - compatible + - reg + - clocks + - clock-names + - interrupts + - interrupt-names + +additionalProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/irq.h> + #include <dt-bindings/interrupt-controller/arm-gic.h> + + gpu: gpu@fd00000 { + compatible = "ti,am62-gpu", "img,powervr-seriesaxe"; + reg = <0x0fd00000 0x20000>; + power-domains = <&some_pds 187>; + clocks = <&k3_clks 187 0>; + clock-names = "core"; + interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "gpu"; + };MAINTAINERS +7
-0@@ -10084,6 +10084,13 @@ IMGTEC IR DECODER DRIVER S: Orphan F: drivers/media/rc/img-ir/ +IMGTEC POWERVR DRM DRIVER +M: Frank Binns <[email protected]> +M: Sarah Walker <[email protected]> +M: Donald Robson <[email protected]> +S: Supported +F: Documentation/devicetree/bindings/gpu/img,powervr.yaml + IMON SOUNDGRAPH USB IR RECEIVER M: Sean Young <[email protected]> L: [email protected]
Re: [PATCH v3 02/17] dt-bindings: gpu: Add Imagination Technologies PowerVR GPU
Hi Andrew,
Thank you for your feedback (comments below).
Quoted 26 lines · Andrew Davis
Quoted 25 lines · Sarah Walker
Add the device tree binding documentation for the Series AXE GPU used in TI AM62 SoCs.
Signed-off-by Sarah Walker <[email protected]>--- .../devicetree/bindings/gpu/img,powervr.yaml | 71 +++++++++++++++++++ MAINTAINERS | 7 ++ 2 files changed, 78 insertions(+)create mode 100644
Documentation/devicetree/bindings/gpu/img,powervr.yamlDocumentation/devicetree/bindings/gpu/img,powervr.yaml new file +9
-0@@ -0,0 +1,71 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +# Copyright (c) 2022 Imagination Technologies Ltd. +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/gpu/img,powervr.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Imagination Technologies PowerVR GPU +
Quoted 8 lines
Documentation/devicetree/bindings/gpu/img,powervr.yaml line 15
Quoted 6 lines
Documentation/devicetree/bindings/gpu/img,powervr.yaml new file +6
-0+maintainers: + - Sarah Walker <[email protected]> + +properties: + compatible: + oneOf:oneOf shouldn't be needed, you can just do the enum followed by const.
Sure, we'll make this change.
Quoted 26 lines
Quoted 26 lines
Documentation/devicetree/bindings/gpu/img,powervr.yaml new file +25
-0+ - items: + - enum: + - ti,am62-gpu + - const: img,powervr-seriesaxe + + reg: + maxItems: 1 + + clocks: + minItems: 1 + maxItems: 3 + + clock-names: + items: + - const: core + - const: mem + - const: sys + minItems: 1 + + interrupts: + items: + - description: GPU interrupt + + interrupt-names: + items:
Quoted 8 lines
Documentation/devicetree/bindings/gpu/img,powervr.yaml line 46
Quoted 6 lines
Documentation/devicetree/bindings/gpu/img,powervr.yaml new file +6
-0+ - const: gpu + + power-domains: + maxItems: 1 + + power-supply: trueWhy do you need power-supply?
We don't need this, so will remove it in the next iteration.
Thanks
Frank
Quoted 46 lines
Andrew
Quoted 43 lines
Documentation/devicetree/bindings/gpu/img,powervr.yaml new file +25
-0+ +required: + - compatible + - reg + - clocks + - clock-names + - interrupts + - interrupt-names + +additionalProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/irq.h> + #include <dt-bindings/interrupt-controller/arm-gic.h> + + gpu: gpu@fd00000 { + compatible = "ti,am62-gpu", "img,powervr-seriesaxe"; + reg = <0x0fd00000 0x20000>; + power-domains = <&some_pds 187>; + clocks = <&k3_clks 187 0>; + clock-names = "core"; + interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "gpu"; + };MAINTAINERS +7
-0@@ -10084,6 +10084,13 @@ IMGTEC IR DECODER DRIVER S: Orphan F: drivers/media/rc/img-ir/ +IMGTEC POWERVR DRM DRIVER +M: Frank Binns <[email protected]> +M: Sarah Walker <[email protected]> +M: Donald Robson <[email protected]> +S: Supported +F: Documentation/devicetree/bindings/gpu/img,powervr.yaml + IMON SOUNDGRAPH USB IR RECEIVER M: Sean Young <[email protected]> L: [email protected]
Re: [PATCH v3 02/17] dt-bindings: gpu: Add Imagination Technologies PowerVR GPU
In reply to Sarah WalkerQuoted 3 lines · Sarah Walker
Add the device tree binding documentation for the Series AXE GPU used in TI AM62 SoCs.
I don't see improvements. That's a NAK :(
This is a friendly reminder during the review process.
It seems my previous comments were not fully addressed. Maybe my feedback got lost between the quotes, maybe you just forgot to apply it. Please go back to the previous discussion and either implement all requested changes or keep discussing them.
Thank you.
Best regards,
Krzysztof
Re: [PATCH v3 02/17] dt-bindings: gpu: Add Imagination Technologies PowerVR GPU
Hi Krzysztof,
Quoted 5 lines · Krzysztof Kozlowski
Quoted 3 lines · Sarah Walker
Add the device tree binding documentation for the Series AXE GPU used in TI AM62 SoCs.
Quoted 9 lines
I don't see improvements. That's a NAK :(
This is a friendly reminder during the review process.
It seems my previous comments were not fully addressed. Maybe my feedback got lost between the quotes, maybe you just forgot to apply it. Please go back to the previous discussion and either implement all requested changes or keep discussing them.
Apologies for not including a change log for this patch and for not highlighting that we'd made changes in this area in the covering letter as well. This was an oversight on our part.
The change log for this patch is as follows:
* Added commit message description
* Dropped quotes from $id and $schema
* Dropped reg minItems
* Dropped _clk suffixes from clock-names
* Dropped operating-points-v2 property
* Added missing additionalProperties:false
* Removed stray blank line at end of file
We'll be sure to include this information going forwards.
We've also run 'make dt_binding_check' and there are no reported issues that we can see.
As far as I'm aware, this should cover all your feedback on the previous version of the patch. Of course, we may have missed something or unintentionally introduced more issues. We'd really appreciate if you can highlight anything else that needs fixing and we'll make sure we address it in the next iteration and/or respond to individual points where necessary.
Thank you for your feedback so far.
Best regards,
Frank
Quoted 5 lines
Thank you.
Best regards,
Krzysztof
Rob Herring
maintainerRe: [PATCH v3 02/17] dt-bindings: gpu: Add Imagination Technologies PowerVR GPU
In reply to Sarah WalkerQuoted 10 lines · Sarah Walker
Add the device tree binding documentation for the Series AXE GPU used in TI AM62 SoCs.
Signed-off-by Sarah Walker <[email protected]>--- .../devicetree/bindings/gpu/img,powervr.yaml | 71 +++++++++++++++++++ MAINTAINERS | 7 ++ 2 files changed, 78 insertions(+) create mode 100644 Documentation/devicetree/bindings/gpu/img,powervr.yaml
Please use get_maintainers.pl and send your patches to the correct people and lists or they won't get reviewed.
Rob
Re: [PATCH v3 02/17] dt-bindings: gpu: Add Imagination Technologies PowerVR GPU
Hi Rob,
Quoted 11 lines · Rob Herring
Quoted 9 lines · Sarah Walker
Add the device tree binding documentation for the Series AXE GPU used in TI AM62 SoCs.
Signed-off-by Sarah Walker <[email protected]>--- .../devicetree/bindings/gpu/img,powervr.yaml | 71 +++++++++++++++++++ MAINTAINERS | 7 ++ 2 files changed, 78 insertions(+) create mode 100644 Documentation/devicetree/bindings/gpu/img,powervr.yaml
Quoted 2 lines
Please use get_maintainers.pl and send your patches to the correct people and lists or they won't get reviewed.
Thank you for pointing this out. We'll make sure we do this for the next iteration of the patches.
Thanks
Frank
Quoted 2 lines
Rob
Re: [PATCH v3 02/17] dt-bindings: gpu: Add Imagination Technologies PowerVR GPU
In reply to Sarah WalkerHi Sarah,
thanks for your patch!
Documentation/devicetree/bindings/gpu/img,powervr.yaml line 19
Quoted 12 lines · Sarah Walker
Add the device tree binding documentation for the Series AXE GPU used in TI AM62 SoCs.
Signed-off-by Sarah Walker <[email protected]>Documentation/devicetree/bindings/gpu/img,powervr.yaml new file +7
-0+properties: + compatible: + oneOf: + - items: + - enum: + - ti,am62-gpu + - const: img,powervr-seriesaxe
I don't see why you need to restrict the bindings to just the stuff you happen to
be writing Linux drivers for right now.
Add all of them!
There is this out-of-tree binding:
https://github.com/openpvrsgx-devgroup/linux_openpvrsgx/commit/0ddd308a78926782b8a72f75c74b91417ceb9779
With these two on top:
https://github.com/openpvrsgx-devgroup/linux_openpvrsgx/commit/053346e1933932815066f16ebf6e6bda45d67548
https://github.com/openpvrsgx-devgroup/linux_openpvrsgx/commit/1cb62c4cdcad096d438ee7d1d51f6001998acee3
They are indeed out-of-tree, but H. Nikolaus is a well-known and respected contributor to the kernel, and I'm pretty sure he would be contributing these upstream if he had the time and incentive.
To me it seems much more like you should talk to Nikolaus about submitting these patches initially, and then add Rogue support with patches on top of it. It could be a nice series with just DT bindings.
I see that your binding uses a power domain rather than a regulator (sgx-supply) for power and that is probably a better approach but other than that the openpvrsgx binding looks more complete and to the point?
It will also help them to get these bindings settled so they can merge all of the DTS patches adding the SGX block to misc platforms in the kernel upstream so they can focus their work on the actual driver.
When I look at the PowerVR wikipedia page:
https://en.wikipedia.org/wiki/PowerVR
there is no correspondence between the product names there and "img,powervr-seriesaxe" as used here.
I think you need to explain if these are internal product names or what is going on, and what the relationship is to the marketing names, it could be part of the description simply, so that people know what string to use somewhat intuitively. Maybe all the strings in the out-of-tree documentation are just wrong because internal code names need to be used?
Yours,
Linus Walleij
Rob Herring
maintainerRe: [PATCH v3 02/17] dt-bindings: gpu: Add Imagination Technologies PowerVR GPU
Quoted 29 lines · Linus Walleij
Hi Sarah,
thanks for your patch!
Documentation/devicetree/bindings/gpu/img,powervr.yaml line 19
Quoted 12 lines · Sarah Walker
Add the device tree binding documentation for the Series AXE GPU used in TI AM62 SoCs.
Signed-off-by Sarah Walker <[email protected]>Documentation/devicetree/bindings/gpu/img,powervr.yaml new file +7
-0+properties: + compatible: + oneOf: + - items: + - enum: + - ti,am62-gpu + - const: img,powervr-seriesaxeI don't see why you need to restrict the bindings to just the stuff you happen to
be writing Linux drivers for right now.Add all of them!
There is this out-of-tree binding:
https://github.com/openpvrsgx-devgroup/linux_openpvrsgx/commit/0ddd308a78926782b8a72f75c74b91417ceb9779
Quoted 7 lines
With these two on top:
https://github.com/openpvrsgx-devgroup/linux_openpvrsgx/commit/053346e1933932815066f16ebf6e6bda45d67548
https://github.com/openpvrsgx-devgroup/linux_openpvrsgx/commit/1cb62c4cdcad096d438ee7d1d51f6001998acee3They are indeed out-of-tree, but H. Nikolaus is a well-known and respected contributor to the kernel, and I'm pretty sure he would be contributing these upstream if he had the time and incentive.
He did try[1].
Rob
Re: [PATCH v3 02/17] dt-bindings: gpu: Add Imagination Technologies PowerVR GPU
In reply to Linus WalleijHi Linus,
Quoted 18 lines · Linus Walleij
Hi Sarah,
thanks for your patch!
Documentation/devicetree/bindings/gpu/img,powervr.yaml line 19
Quoted 11 lines · Sarah Walker
Add the device tree binding documentation for the Series AXE GPU used in TI AM62 SoCs.
Signed-off-by Sarah Walker <[email protected]>Documentation/devicetree/bindings/gpu/img,powervr.yaml new file +7
-0+properties: + compatible: + oneOf: + - items: + - enum: + - ti,am62-gpu + - const: img,powervr-seriesaxe
Quoted 5 lines
I don't see why you need to restrict the bindings to just the stuff you happen to
be writing Linux drivers for right now.Add all of them!
The main thinking here was to start off with a single simple case (TI AM62) to support the initial driver upstreaming rather than trying to cover too many things at once. This can then be built upon for other GPUs. So, for example, we can extend the bindings to add a second power domain for those that need it, such as the GPU in the Mediatek MT8173. The benefit of this approach is that the bindings, dts and code changes can all be reviewed together so that all the context is present.
Quoted 29 lines
There is this out-of-tree binding:
https://github.com/openpvrsgx-devgroup/linux_openpvrsgx/commit/0ddd308a78926782b8a72f75c74b91417ceb9779With these two on top:
https://github.com/openpvrsgx-devgroup/linux_openpvrsgx/commit/053346e1933932815066f16ebf6e6bda45d67548
https://github.com/openpvrsgx-devgroup/linux_openpvrsgx/commit/1cb62c4cdcad096d438ee7d1d51f6001998acee3They are indeed out-of-tree, but H. Nikolaus is a well-known and respected contributor to the kernel, and I'm pretty sure he would be contributing these upstream if he had the time and incentive.
To me it seems much more like you should talk to Nikolaus about submitting these patches initially, and then add Rogue support with patches on top of it. It could be a nice series with just DT bindings.
I see that your binding uses a power domain rather than a regulator (sgx-supply) for power and that is probably a better approach but other than that the openpvrsgx binding looks more complete and to the point?
It will also help them to get these bindings settled so they can merge all of the DTS patches adding the SGX block to misc platforms in the kernel upstream so they can focus their work on the actual driver.
When I look at the PowerVR wikipedia page:
https://en.wikipedia.org/wiki/PowerVR
there is no correspondence between the product names there and "img,powervr-seriesaxe" as used here.
Quoted 5 lines
I think you need to explain if these are internal product names or what is going on, and what the relationship is to the marketing names, it could be part of the description simply, so that people know what string to use somewhat intuitively. Maybe all the strings in the out-of-tree documentation are just wrong because internal code names need to be used?
It's been quite some time since we originally wrote these bindings, so we'll need to go back and check why we settled on "powervr-seriesaxe", but I suspect it was just a case of us normalising the naming across different series.
Thanks
Frank
Quoted 3 lines
Yours,
Linus Walleij
Re: [PATCH v3 02/17] dt-bindings: gpu: Add Imagination Technologies PowerVR GPU
Quoted 15 lines · Frank Binns
Quoted 9 lines
Documentation/devicetree/bindings/gpu/img,powervr.yaml line 19
Quoted 8 lines
Signed-off-by Sarah Walker <[email protected]>Documentation/devicetree/bindings/gpu/img,powervr.yaml new file +7
-0+properties: + compatible: + oneOf: + - items: + - enum: + - ti,am62-gpu + - const: img,powervr-seriesaxeQuoted 5 lines
I don't see why you need to restrict the bindings to just the stuff you happen to
be writing Linux drivers for right now.Add all of them!
Quoted 7 lines
The main thinking here was to start off with a single simple case (TI AM62) to support the initial driver upstreaming rather than trying to cover too many things at once. This can then be built upon for other GPUs. So, for example, we can extend the bindings to add a second power domain for those that need it, such as the GPU in the Mediatek MT8173. The benefit of this approach is that the bindings, dts and code changes can all be reviewed together so that all the context is present.
I understand that you want to scale down the problem so it becomes easier.
However the reverse can also be said: by removing the other platforms you may end up with one way street bindings that are really hard to augment to accomodate for the other family members later on.
But as long as H. Nikolaus is involved in the review I suppose he will be able to point out obvious cases, and I expect that you read through the old thread:
https://lore.kernel.org/all/[email protected]/
Yours,
Linus Walleij
PATCH v3 3/17 drm/imagination/uapi: Add PowerVR driver UAPI
In reply to Sarah WalkerAdd the UAPI implementation for the PowerVR driver.
--- MAINTAINERS | 1 + include/uapi/drm/pvr_drm.h | 1333 ++++++++++++++++++++++++++++++++++++ 2 files changed, 1334 insertions(+) create mode 100644 include/uapi/drm/pvr_drm.h
MAINTAINERS +1 -0
@@ -10090,6 +10090,7 @@ M: Sarah Walker <[email protected]> M: Donald Robson <[email protected]> S: Supported F: Documentation/devicetree/bindings/gpu/img,powervr.yaml +F: include/uapi/drm/pvr_drm.h IMON SOUNDGRAPH USB IR RECEIVER M: Sean Young <[email protected]>
include/uapi/drm/pvr_drm.h new file +1333 -0
1,333 lines not on this page · raw message
Signature · 1 line
2.40.1
PATCH v3 4/17 drm/imagination: Add skeleton PowerVR driver
In reply to Sarah WalkerThis adds the basic skeleton of the driver. The driver registers itself with DRM on probe. Ioctl handlers are currently implemented as stubs.
--- MAINTAINERS | 1 + drivers/gpu/drm/Kconfig | 2 + drivers/gpu/drm/Makefile | 1 + drivers/gpu/drm/imagination/Kconfig | 15 + drivers/gpu/drm/imagination/Makefile | 9 + drivers/gpu/drm/imagination/pvr_device.h | 169 ++++++++ drivers/gpu/drm/imagination/pvr_drv.c | 530 +++++++++++++++++++++++ drivers/gpu/drm/imagination/pvr_drv.h | 22 + 8 files changed, 749 insertions(+) create mode 100644 drivers/gpu/drm/imagination/Kconfig create mode 100644 drivers/gpu/drm/imagination/Makefile create mode 100644 drivers/gpu/drm/imagination/pvr_device.h create mode 100644 drivers/gpu/drm/imagination/pvr_drv.c create mode 100644 drivers/gpu/drm/imagination/pvr_drv.h
MAINTAINERS +1 -0
@@ -10090,6 +10090,7 @@ M: Sarah Walker <[email protected]> M: Donald Robson <[email protected]> S: Supported F: Documentation/devicetree/bindings/gpu/img,powervr.yaml +F: drivers/gpu/drm/imagination/ F: include/uapi/drm/pvr_drm.h IMON SOUNDGRAPH USB IR RECEIVER
drivers/gpu/drm/Kconfig +2 -0
@@ -365,6 +365,8 @@ source "drivers/gpu/drm/solomon/Kconfig" source "drivers/gpu/drm/sprd/Kconfig" +source "drivers/gpu/drm/imagination/Kconfig" + config DRM_HYPERV tristate "DRM Support for Hyper-V synthetic video device" depends on DRM && PCI && MMU && HYPERV
drivers/gpu/drm/Makefile +1 -0
@@ -195,3 +195,4 @@ obj-y += gud/ obj-$(CONFIG_DRM_HYPERV) += hyperv/ obj-y += solomon/ obj-$(CONFIG_DRM_SPRD) += sprd/ +obj-$(CONFIG_DRM_POWERVR) += imagination/
drivers/gpu/drm/imagination/Kconfig new file +15 -0
@@ -0,0 +1,15 @@ +# SPDX-License-Identifier: GPL-2.0 OR MIT +# Copyright (c) 2022 Imagination Technologies Ltd. + +config DRM_POWERVR + tristate "Imagination Technologies PowerVR Graphics" + depends on ARM64 + depends on DRM + select DRM_GEM_SHMEM_HELPER + select DRM_SCHED + select FW_LOADER + help + Choose this option if you have a system that has an Imagination + Technologies PowerVR Rogue GPU. + + If "M" is selected, the module will be called powervr.
drivers/gpu/drm/imagination/Makefile new file +9 -0
@@ -0,0 +1,9 @@ +# SPDX-License-Identifier: GPL-2.0 OR MIT +# Copyright (c) 2022 Imagination Technologies Ltd. + +subdir-ccflags-y := -I$(srctree)/$(src) + +powervr-y := \ + pvr_drv.o \ + +obj-$(CONFIG_DRM_POWERVR) += powervr.o
drivers/gpu/drm/imagination/pvr_device.h new file +169 -0
169 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_drv.c new file +530 -0
530 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_drv.h new file +22 -0
@@ -0,0 +1,22 @@ +/* SPDX-License-Identifier: GPL-2.0 OR MIT */ +/* Copyright (c) 2022 Imagination Technologies Ltd. */ + +#ifndef PVR_DRV_H +#define PVR_DRV_H + +#include "linux/compiler_attributes.h" +#include <uapi/drm/pvr_drm.h> + +#define PVR_DRIVER_NAME "powervr" +#define PVR_DRIVER_DESC "Imagination PowerVR Graphics" +#define PVR_DRIVER_DATE "20220211" + +/* +* Driver interface version: +* - 1.0: Initial interface +*/ +#define PVR_DRIVER_MAJOR 1 +#define PVR_DRIVER_MINOR 0 +#define PVR_DRIVER_PATCHLEVEL 0 + +#endif /* PVR_DRV_H */
Signature · 1 line
2.40.1
Re: [PATCH v3 04/17] drm/imagination: Add skeleton PowerVR driver
Hi,
[I just noticed I dropped the Cc list, resending]
Thanks for contributing this driver, it's awesome to see it moving forward.
And congrats on the documentation too, it's not often we see a driver that well documented on its v3.
I've stripped some parts of the patch that weren't relevant to my review.
drivers/gpu/drm/imagination/pvr_device.h line 61
Quoted 5 lines · Sarah Walker
drivers/gpu/drm/imagination/pvr_device.h new file +5
-0+static __always_inline struct pvr_device * +to_pvr_device (struct drm_device *drm_dev) +{ + return container_of(drm_dev, struct pvr_device, base); +}
For that kind of helpers, we're slowly transitioning to using a macro and container_of_const. This allows to work with const-ness context.
drivers/gpu/drm/imagination/pvr_drv.c line 481
Quoted 11 lines
drivers/gpu/drm/imagination/pvr_drv.c new file +11
-0+static int +pvr_probe (struct platform_device *plat_dev) +{ +struct pvr_device *pvr_dev; +struct drm_device *drm_dev; +int err; + + pvr_dev =devm_drm_dev_alloc (&plat_dev->dev, &pvr_drm_driver, + struct pvr_device, base); +if (IS_ERR (pvr_dev)) { + err =IS_ERR (pvr_dev);
PTR_ERR?
Quoted 1 line
+ goto
err_out;
The general pattern here is to return directly here, it's simpler to follow.
drivers/gpu/drm/imagination/pvr_drv.c line 490
Quoted 8 lines
drivers/gpu/drm/imagination/pvr_drv.c new file +8
-0+ } + drm_dev = &pvr_dev->base; + +platform_set_drvdata (plat_dev, drm_dev); + + err =drm_dev_register (drm_dev,0 ); +if (err) + goto err_out;
I guess it would be simpler here too, but I think you're going to move things around anyway?
drivers/gpu/drm/imagination/pvr_drv.c line 510
Quoted 3 lines
drivers/gpu/drm/imagination/pvr_drv.c new file +3
-0+static const struct of_device_id dt_match[] = { + { .compatible ="ti,am62-gpu" , .data =NULL }, + { .compatible ="img,powervr-seriesaxe" , .data =NULL },
Do you really need both? The binding you documented requires both to be there, so I think you can either match on the more specific one (and extend that list when needed) or match the more generic one and be done with it once and for all. Having both is redundant.
Quoted 10 lines
drivers/gpu/drm/imagination/pvr_drv.c new file +10
-0+ {} +}; +MODULE_DEVICE_TABLE (of, dt_match); + +static struct platform_driver pvr_driver = { + .probe = pvr_probe, + .remove = pvr_remove, + .driver = { + .name =PVR_DRIVER_NAME , + .of_match_table = dt_match,
drivers/gpu/drm/imagination/pvr_drv.c line 530
Quoted 10 lines
drivers/gpu/drm/imagination/pvr_drv.c new file +10
-0+ }, +}; +module_platform_driver (pvr_driver); + +MODULE_AUTHOR ("Imagination Technologies Ltd." ); +MODULE_DESCRIPTION (PVR_DRIVER_DESC ); +MODULE_LICENSE ("Dual MIT/GPL" ); +MODULE_IMPORT_NS (DMA_BUF ); +MODULE_FIRMWARE ("powervr/rogue_4.40.2.51_v1.fw" ); +MODULE_FIRMWARE ("powervr/rogue_33.15.11.3_v1.fw" );
That one should probably be moved to the firmware patch?
Quoted 7 lines
drivers/gpu/drm/imagination/pvr_drv.h new file +1
-0@@ -0,0 +1,22 @@ +/* SPDX-License-Identifier: GPL-2.0 OR MIT */
drivers/gpu/drm/imagination/pvr_drv.h line 11
Quoted 10 lines
drivers/gpu/drm/imagination/pvr_drv.h new file +10
-0+/* Copyright (c) 2022 Imagination Technologies Ltd. */ + +#ifndef PVR_DRV_H +#define PVR_DRV_H + +#include "linux/compiler_attributes.h" +#include <uapi/drm/pvr_drm.h> + +#define PVR_DRIVER_NAME "powervr" +#define PVR_DRIVER_DESC "Imagination PowerVR Graphics"
Do you intend to support the SGX and Rogue GPUs with this driver? If not, mentioning the generation/architecture name somewhere would be nice.
Maxime
Re: [PATCH v3 04/17] drm/imagination: Add skeleton PowerVR driver
Hi Maxime,
Thank you for your feedback (comments below).
Quoted 14 lines · Maxime Ripard
Hi,
[I just noticed I dropped the Cc list, resending]
Thanks for contributing this driver, it's awesome to see it moving forward.
And congrats on the documentation too, it's not often we see a driver that well documented on its v3.
I've stripped some parts of the patch that weren't relevant to my review.
On Tue, Jun 13, 2023 at 03:47:47PM +0100, Sarah Walker wrote:
Quoted 8 lines
drivers/gpu/drm/imagination/pvr_device.h line 61
Quoted 5 lines
drivers/gpu/drm/imagination/pvr_device.h new file +5
-0+static __always_inline struct pvr_device * +to_pvr_device (struct drm_device *drm_dev) +{ + return container_of(drm_dev, struct pvr_device, base); +}For that kind of helpers, we're slowly transitioning to using a macro and
container_of_const. This allows to work with const-ness context.
Ack
Quoted 14 lines
drivers/gpu/drm/imagination/pvr_drv.c line 481
Quoted 12 lines
drivers/gpu/drm/imagination/pvr_drv.c new file +11
-0+static int +pvr_probe (struct platform_device *plat_dev) +{ +struct pvr_device *pvr_dev; +struct drm_device *drm_dev; +int err; + + pvr_dev =devm_drm_dev_alloc (&plat_dev->dev, &pvr_drm_driver, + struct pvr_device, base); +if (IS_ERR (pvr_dev)) { + err =IS_ERR (pvr_dev);
PTR_ERR?
Good catch :)
Quoted 5 lines
Quoted 2 lines
+ goto
err_out;The general pattern here is to return directly here, it's simpler to follow.
Ack
Quoted 13 lines
drivers/gpu/drm/imagination/pvr_drv.c line 490
Quoted 9 lines
drivers/gpu/drm/imagination/pvr_drv.c new file +8
-0+ } + drm_dev = &pvr_dev->base; + +platform_set_drvdata (plat_dev, drm_dev); + + err =drm_dev_register (drm_dev,0 ); +if (err) + goto err_out;I guess it would be simpler here too, but I think you're going to move things around anyway?
Quoted 8 lines
drivers/gpu/drm/imagination/pvr_drv.c line 510
Quoted 3 lines
drivers/gpu/drm/imagination/pvr_drv.c new file +3
-0+static const struct of_device_id dt_match[] = { + { .compatible ="ti,am62-gpu" , .data =NULL }, + { .compatible ="img,powervr-seriesaxe" , .data =NULL },Do you really need both? The binding you documented requires both to be there, so I think you can either match on the more specific one (and extend that list when needed) or match the more generic one and be done with it once and for all. Having both is redundant.
We'll drop the more specific one in the next version.
Quoted 15 lines
Quoted 15 lines
drivers/gpu/drm/imagination/pvr_drv.c new file +14
-0+ {} +}; +MODULE_DEVICE_TABLE (of, dt_match); + +static struct platform_driver pvr_driver = { + .probe = pvr_probe, + .remove = pvr_remove, + .driver = { + .name =PVR_DRIVER_NAME , + .of_match_table = dt_match, + }, +}; +module_platform_driver (pvr_driver); +
Quoted 8 lines
drivers/gpu/drm/imagination/pvr_drv.c line 530
Quoted 6 lines
drivers/gpu/drm/imagination/pvr_drv.c new file +6
-0+MODULE_AUTHOR ("Imagination Technologies Ltd." ); +MODULE_DESCRIPTION (PVR_DRIVER_DESC ); +MODULE_LICENSE ("Dual MIT/GPL" ); +MODULE_IMPORT_NS (DMA_BUF ); +MODULE_FIRMWARE ("powervr/rogue_4.40.2.51_v1.fw" ); +MODULE_FIRMWARE ("powervr/rogue_33.15.11.3_v1.fw" );That one should probably be moved to the firmware patch?
Ack
Quoted 14 lines
Quoted 14 lines
drivers/gpu/drm/imagination/pvr_drv.h new file +7
-0@@ -0,0 +1,22 @@ +/* SPDX-License-Identifier: GPL-2.0 OR MIT */ +/* Copyright (c) 2022 Imagination Technologies Ltd. */ + +#ifndef PVR_DRV_H +#define PVR_DRV_H + +#include "linux/compiler_attributes.h"
Quoted 8 lines
drivers/gpu/drm/imagination/pvr_drv.h line 11
Quoted 4 lines
drivers/gpu/drm/imagination/pvr_drv.h new file +4
-0+#include <uapi/drm/pvr_drm.h> + +#define PVR_DRIVER_NAME "powervr" +#define PVR_DRIVER_DESC "Imagination PowerVR Graphics"Do you intend to support the SGX and Rogue GPUs with this driver? If not, mentioning the generation/architecture name somewhere would be nice.
We don't currently have any plans to support SGX ourselves, so we'll update this, and any other places, to clarify things.
Thanks
Frank
Quoted 2 lines
Maxime
PATCH v3 5/17 drm/imagination: Get GPU resources
In reply to Sarah WalkerAcquire clock, regulator and register resources, and enable/map as appropriate.
--- drivers/gpu/drm/imagination/Makefile | 1 + drivers/gpu/drm/imagination/pvr_device.c | 271 +++++++++++++++++++++++ drivers/gpu/drm/imagination/pvr_device.h | 214 ++++++++++++++++++ drivers/gpu/drm/imagination/pvr_drv.c | 11 +- 4 files changed, 496 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/drm/imagination/pvr_device.c
drivers/gpu/drm/imagination/Makefile +1 -0
@@ -4,6 +4,7 @@ subdir-ccflags-y := -I$(srctree)/$(src) powervr-y := \ + pvr_device.o \ pvr_drv.o \ obj-$(CONFIG_DRM_POWERVR) += powervr.o
drivers/gpu/drm/imagination/pvr_device.c new file +271 -0
271 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_device.h +214 -0
235 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_drv.c +10 -1
@@ -485,12 +485,19 @@ pvr_probe(struct platform_device *plat_dev)platform_set_drvdata (plat_dev, drm_dev); - err =drm_dev_register (drm_dev,0 ); + err =pvr_device_init (pvr_dev);if (err) goto err_out; + err =drm_dev_register (drm_dev,0 ); +if (err) + goto err_device_fini; +return 0 ; +err_device_fini: +pvr_device_fini (pvr_dev); + err_out:return err; }
@@ -499,8 +506,10 @@ static int pvr_remove(struct platform_device *plat_dev) {struct drm_device *drm_dev =platform_get_drvdata (plat_dev); +struct pvr_device *pvr_dev =to_pvr_device (drm_dev);drm_dev_unregister (drm_dev); +pvr_device_fini (pvr_dev);return 0 ; }
Signature · 1 line
2.40.1
Re: [PATCH v3 05/17] drm/imagination: Get GPU resources
Quoted 93 lines · Sarah Walker
Acquire clock, regulator and register resources, and enable/map as appropriate.
Signed-off-by Sarah Walker <[email protected]>--- drivers/gpu/drm/imagination/Makefile | 1 + drivers/gpu/drm/imagination/pvr_device.c | 271 +++++++++++++++++++++++ drivers/gpu/drm/imagination/pvr_device.h | 214 ++++++++++++++++++ drivers/gpu/drm/imagination/pvr_drv.c | 11 +- 4 files changed, 496 insertions(+), 1 deletion(-)create mode 100644
drivers/gpu/drm/imagination/pvr_device.cdrivers/gpu/drm/imagination/Makefile +1
-0@@ -4,6 +4,7 @@ subdir-ccflags-y := -I$(srctree)/$(src) powervr-y := \ + pvr_device.o \ pvr_drv.o \ obj-$(CONFIG_DRM_POWERVR) += powervr.odrivers/gpu/drm/imagination/pvr_device.c new file +63
-0@@ -0,0 +1,271 @@ +// SPDX-License-Identifier: GPL-2.0 OR MIT +/* Copyright (c) 2022 Imagination Technologies Ltd. */ + +#include "pvr_device.h" + +#include <drm/drm_print.h> + +#include <linux/clk.h> +#include <linux/compiler_attributes.h> +#include <linux/compiler_types.h> +#include <linux/dma-mapping.h> +#include <linux/err.h> +#include <linux/gfp.h> +#include <linux/platform_device.h> +#include <linux/regulator/consumer.h> +#include <linux/slab.h> +#include <linux/stddef.h> +#include <linux/types.h> + +/** +* pvr_device_reg_init() - Initialize kernel access to a PowerVR device's +* control registers. +* @pvr_dev: Target PowerVR device. +* +* Sets struct pvr_device->regs. +* +* This method of mapping the device control registers into memory ensures that +* they are unmapped when the driver is detached (i.e. no explicit cleanup is +* required). +* +* Return: +* * 0 on success, or +* * Any error returned by devm_platform_ioremap_resource(). +*/ +static int +pvr_device_reg_init (struct pvr_device *pvr_dev) +{ +struct drm_device *drm_dev =from_pvr_device (pvr_dev); +struct platform_device *plat_dev =to_platform_device (drm_dev->dev); +struct resource *regs_resource; +void __iomem *regs; +int err; + + pvr_dev->regs_resource =NULL ; + pvr_dev->regs =NULL ; + + regs =devm_platform_get_and_ioremap_resource (plat_dev,0 , ®s_resource); +if (IS_ERR (regs)) { + err =PTR_ERR (regs); +drm_err (drm_dev,"failed to ioremap gpu registers (err=%d)\n" , + err); +return err; + } + + pvr_dev->regs = regs; + pvr_dev->regs_resource = regs_resource; + +return 0 ; +} + +/** +* pvr_device_reg_fini() - Deinitialize kernel access to a PowerVR device's +* control registers.
drivers/gpu/drm/imagination/pvr_device.c line 73
Quoted 10 lines
drivers/gpu/drm/imagination/pvr_device.c new file +10
-0+* @pvr_dev: Target PowerVR device. +* +* This is essentially a no-op, since pvr_device_reg_init() already ensures that +* struct pvr_device->regs is unmapped when the device is detached. This +* function just sets struct pvr_device->regs to %NULL. +*/ +static __always_inline void +pvr_device_reg_fini (struct pvr_device *pvr_dev) +{ + pvr_dev->regs =NULL ;
This function isn't needed, kinda defeats the purpose of using devm_*() if you go an manually have no-op functions to unwind it..
Quoted 24 lines
drivers/gpu/drm/imagination/pvr_device.c new file +24
-0+} + +/** +* pvr_device_clk_init() - Initialize clocks required by a PowerVR device +* @pvr_dev: Target PowerVR device. +* +* Sets struct pvr_device->core_clk, struct pvr_device->sys_clk and +* struct pvr_device->mem_clk. +* +* Three clocks are required by the PowerVR device: core, sys and mem. On +* return, this function guarantees that the clocks are in one of the following +* states: +* +* * All successfully initialized, +* * Core errored, sys and mem uninitialized, +* * Core deinitialized, sys errored, mem uninitialized, or +* * Core and sys deinitialized, mem errored. +* +* Return: +* * 0 on success, +* * Any error returned by devm_clk_get(), or +* * Any error returned by clk_prepare_enable(). +*/ +static int pvr_device_clk_init (struct pvr_device *pvr_dev)
drivers/gpu/drm/imagination/pvr_device.c line 107
Quoted 10 lines
drivers/gpu/drm/imagination/pvr_device.c new file +10
-0+{ +struct drm_device *drm_dev =from_pvr_device (pvr_dev); +struct clk *core_clk; +struct clk *sys_clk; +struct clk *mem_clk; +int err; + + pvr_dev->core_clk =NULL ; + pvr_dev->sys_clk =NULL ; + pvr_dev->mem_clk =NULL ;
You could NULL these out on the error path, but is that even needed, looks like if this functions fails we bail on the whole init where this is all deallocated (plus NULL'd out again in that path).
Quoted 46 lines
drivers/gpu/drm/imagination/pvr_device.c new file +46
-0+ + core_clk =devm_clk_get (drm_dev->dev,"core" ); +if (IS_ERR (core_clk)) { + err =PTR_ERR (core_clk); +drm_err (drm_dev,"failed to get core clock (err=%d)\n" , err); + goto err_out; + } + + sys_clk =devm_clk_get (drm_dev->dev,"sys" ); +if (IS_ERR (sys_clk)) + sys_clk =NULL ; + + mem_clk =devm_clk_get (drm_dev->dev,"mem" ); +if (IS_ERR (mem_clk)) + mem_clk =NULL ; + + err =clk_prepare (core_clk); +if (err) + goto err_out; + +if (sys_clk) { + err =clk_prepare (sys_clk); +if (err) + goto err_deinit_core_clk; + } + +if (mem_clk) { + err =clk_prepare (mem_clk); +if (err) + goto err_deinit_sys_clk; + } + + pvr_dev->core_clk = core_clk; + pvr_dev->sys_clk = sys_clk; + pvr_dev->mem_clk = mem_clk; + +return 0 ; + +err_deinit_sys_clk: +if (sys_clk) +clk_disable_unprepare (sys_clk); +err_deinit_core_clk: +clk_disable_unprepare (core_clk); +err_out: +return err; +}
drivers/gpu/drm/imagination/pvr_device.c line 163
Quoted 10 lines
drivers/gpu/drm/imagination/pvr_device.c new file +10
-0+ +/** +* pvr_device_clk_fini() - Deinitialize clocks required by a PowerVR device +* @pvr_dev: Target PowerVR device. +*/ +static void +pvr_device_clk_fini (struct pvr_device *pvr_dev) +{ +if (pvr_dev->mem_clk) +clk_unprepare (pvr_dev->mem_clk);
Using devm_clk_get_(optional)_prepared() in the init function above might allow these to be unprepaired for you, in that case this function also can be dropped.
Quoted 21 lines
drivers/gpu/drm/imagination/pvr_device.c new file +21
-0+if (pvr_dev->sys_clk) +clk_unprepare (pvr_dev->sys_clk); +clk_unprepare (pvr_dev->core_clk); + + pvr_dev->core_clk =NULL ; + pvr_dev->sys_clk =NULL ; + pvr_dev->mem_clk =NULL ; +} + +/** +* pvr_device_regulator_init() - Initialise regulator required by a PowerVR device +* @pvr_dev: Target PowerVR device. +* +* The regulator is not a required devicetree property. If it is not present then this function will +* succeed, but &pvr_device->regulator will be %NULL. +* +* Returns: +* * 0 on success, or +* * Any error returned by devm_regulator_get(). +*/ +static int
drivers/gpu/drm/imagination/pvr_device.c line 194
Quoted 10 lines
drivers/gpu/drm/imagination/pvr_device.c new file +10
-0+pvr_device_regulator_init(struct pvr_device *pvr_dev) +{ +struct drm_device *drm_dev =from_pvr_device (pvr_dev); +struct regulator *regulator; +int err; + + regulator =devm_regulator_get (drm_dev->dev,"power" ); +if (IS_ERR (regulator)) { + err =PTR_ERR (regulator); +/* Regulator is not required, so ENODEV is allowed here. */
There is devm_regulator_get_optional(), might be what you want here.
Also using dev_err_probe() would check for probe defer here.
Quoted 149 lines
drivers/gpu/drm/imagination/pvr_device.c new file +77
-0+if (err != -ENODEV ) + goto err_out; + regulator =NULL ; + } + + pvr_dev->regulator = regulator; + +return 0 ; + +err_out: +return err; +} + +/** +* pvr_device_init() - Initialize a PowerVR device +* @pvr_dev: Target PowerVR device. +* +* If this function returns successfully, the device will have been fully +* initialized. Otherwise, any parts of the device initialized before an error +* occurs will be de-initialized before returning. +* +* NOTE: The initialization steps currently taken are the bare minimum required +* to read from the control registers. The device is unlikely to function +* until further initialization steps are added. [This note should be +* removed when that happens.] +* +* Return: +* * 0 on success, +* * Any error returned by pvr_device_reg_init(), +* * Any error returned by pvr_device_clk_init(), or +* * Any error returned by pvr_device_gpu_init(). +*/ +int +pvr_device_init (struct pvr_device *pvr_dev) +{ +int err; + +/* Enable and initialize clocks required for the device to operate. */ + err =pvr_device_clk_init (pvr_dev); +if (err) + goto err_out; + + err =pvr_device_regulator_init (pvr_dev); +if (err) + goto err_device_clk_fini; + +/* Map the control registers into memory. */ + err =pvr_device_reg_init (pvr_dev); +if (err) + goto err_device_reg_fini; + +return 0 ; + +err_device_reg_fini: +pvr_device_reg_fini (pvr_dev); + +err_device_clk_fini: +pvr_device_clk_fini (pvr_dev); + +err_out: +return err; +} + +/** +* pvr_device_fini() - Deinitialize a PowerVR device +* @pvr_dev: Target PowerVR device. +*/ +void +pvr_device_fini (struct pvr_device *pvr_dev) +{ +/* +* Deinitialization stages are performed in reverse order compared to +* the initialization stages in pvr_device_init(). +*/ +pvr_device_reg_fini (pvr_dev); +pvr_device_clk_fini (pvr_dev); +}drivers/gpu/drm/imagination/pvr_device.h +47
-0@@ -11,9 +11,25 @@#include <linux/bits.h> #include <linux/compiler_attributes.h> #include <linux/compiler_types.h> +#include <linux/io.h> +#include <linux/iopoll.h> #include <linux/kernel.h> +#include <linux/math.h> +#include <linux/mutex.h> +#include <linux/timer.h> #include <linux/types.h> #include <linux/wait.h> +#include <linux/workqueue.h> +#include <linux/xarray.h> + +/* Forward declaration from <linux/clk.h>. */ +struct clk ; + +/* Forward declaration from <linux/firmware.h>. */ +struct firmware ; + +/* Forward declaration from <linux/regulator/consumer.h>. */ +struct regulator ;/** * struct pvr_device - powervr-specific wrapper for &struct drm_device @@ -26,6 +42,29 @@ struct pvr_device {* from_pvr_device(). */ struct drm_device base; + +/** @regs_resource: Resource representing device control registers. */ +struct resource *regs_resource; + +/** +* @regs: Device control registers. +* +* These are mapped into memory when the device is initialized; that +* location is where this pointer points. +*/ +void __iomem *regs; + +/** @core_clk: General core clock. */ +struct clk *core_clk; + +/** @sys_clk: System bus clock. */ +struct clk *sys_clk; + +/** @mem_clk: Memory clock. */ +struct clk *mem_clk; + +/** @regulator: Power regulator. */ +struct regulator *regulator; };/** @@ -72,6 +111,181 @@ to_pvr_file(struct drm_file *file)return file->driver_priv; } +int pvr_device_init (struct pvr_device *pvr_dev); +void pvr_device_fini (struct pvr_device *pvr_dev); + +int +pvr_device_clk_core_get_freq (struct pvr_device *pvr_dev,u32 *freq_out); + +/** +* PVR_CR_READ32() - Read a 32-bit register from a PowerVR device
drivers/gpu/drm/imagination/pvr_device.h to_pvr_file(struct drm_file *file) · line 131
Quoted 10 lines
drivers/gpu/drm/imagination/pvr_device.h +10
-0+* @pvr_dev: Target PowerVR device. +* @reg: Target register. +* +* This macro is a wrapper around pvr_cr_read32(). It applies ROGUE_CR_ prefix +* to the provided @reg name, making it behave comparably to the +* PVR_CR_FIELD_GET() macro. +* +* Return: The value of the requested register. +*/ +#define PVR_CR_READ32 (pvr_dev, reg) pvr_cr_read32(pvr_dev, ROGUE_CR_##reg)
Not a huge fan of all these oneline functions/macros, does this really add anyhing? All it does IMHO is add two levels of indirection we have to track back though to figure out what it actually is doing, when calling ioread32() directly would have been just as clean and more obvious.
Andrew
Quoted 196 lines
drivers/gpu/drm/imagination/pvr_device.h +157
-0+ +/** +* PVR_CR_READ64() - Read a 64-bit register from a PowerVR device +* @pvr_dev: Target PowerVR device. +* @reg: Target register. +* +* This macro is a wrapper around pvr_cr_read64(). It applies ROGUE_CR_ prefix +* to the provided @reg name, making it behave comparably to the +* PVR_CR_FIELD_GET() macro. +* +* Return: The value of the requested register. +*/ +#define PVR_CR_READ64 (pvr_dev, reg) pvr_cr_read64(pvr_dev, ROGUE_CR_##reg) + +/** +* PVR_CR_WRITE32() - Write to a 32-bit register in a PowerVR device +* @pvr_dev: Target PowerVR device. +* @reg: Target register. +* @val: Value to write. +* +* This macro is a wrapper around pvr_cr_write32(). It applies ROGUE_CR_ +* prefix to the provided @reg name, making it behave comparably to the +* PVR_CR_FIELD_GET() macro. +*/ +#define PVR_CR_WRITE32 (pvr_dev, reg, val) \ + pvr_cr_write32(pvr_dev, ROGUE_CR_##reg, val) + +/** +* PVR_CR_WRITE64() - Write to a 64-bit register in a PowerVR device +* @pvr_dev: Target PowerVR device. +* @reg: Target register. +* @val: Value to write. +* +* This macro is a wrapper around pvr_cr_write64(). It applies ROGUE_CR_ +* prefix to the provided @reg name, making it behave comparably to the +* PVR_CR_FIELD_GET() macro. +*/ +#define PVR_CR_WRITE64 (pvr_dev, reg, val) \ + pvr_cr_write64(pvr_dev, ROGUE_CR_##reg, val) + +/** +* PVR_CR_FIELD_GET() - Extract a single field from a PowerVR control register +* @val: Value of the target register. +* @field: Field specifier, as defined in "pvr_rogue_cr_defs.h". +* +* Return: The extracted field. +*/ +#define PVR_CR_FIELD_GET (val, field) FIELD_GET(~ROGUE_CR_##field##_CLRMSK, val) + +/** +* pvr_cr_read32() - Read a 32-bit register from a PowerVR device +* @pvr_dev: Target PowerVR device. +* @reg: Target register. +* +* The wrapper macro PVR_CR_READ32() may be used instead to simplify the +* selection of @reg. +* +* Return: The value of the requested register. +*/ +static __always_inline u32 +pvr_cr_read32 (struct pvr_device *pvr_dev,u32 reg) +{ +return ioread32 (pvr_dev->regs + reg); +} + +/** +* pvr_cr_read64() - Read a 64-bit register from a PowerVR device +* @pvr_dev: Target PowerVR device. +* @reg: Target register. +* +* The wrapper macro PVR_CR_READ64() may be used instead to simplify the +* selection of @reg. +* +* Return: The value of the requested register. +*/ +static __always_inline u64 +pvr_cr_read64 (struct pvr_device *pvr_dev,u32 reg) +{ +return ioread64 (pvr_dev->regs + reg); +} + +/** +* pvr_cr_write32() - Write to a 32-bit register in a PowerVR device +* @pvr_dev: Target PowerVR device. +* @reg: Target register. +* @val: Value to write. +* +* The wrapper macro PVR_CR_WRITE32() may be used instead to simplify the +* selection of @reg. +*/ +static __always_inline void +pvr_cr_write32 (struct pvr_device *pvr_dev,u32 reg,u32 val) +{ +iowrite32 (val, pvr_dev->regs + reg); +} + +/** +* pvr_cr_write64() - Write to a 64-bit register in a PowerVR device +* @pvr_dev: Target PowerVR device. +* @reg: Target register. +* @val: Value to write. +* +* The wrapper macro PVR_CR_WRITE64() may be used instead to simplify the +* selection of @reg. +*/ +static __always_inline void +pvr_cr_write64 (struct pvr_device *pvr_dev,u32 reg,u64 val) +{ +iowrite64 (val, pvr_dev->regs + reg); +} + +/** +* pvr_cr_poll_reg32() - Wait for a 32-bit register to match a given value by +* polling +* @pvr_dev: Target PowerVR device. +* @reg_addr: Address of register. +* @reg_value: Expected register value (after masking). +* @reg_mask: Mask of bits valid for comparison with @reg_value. +* @timeout_usec: Timeout length, in us. +* +* Returns: +* * 0 on success, or +* * -%ETIMEDOUT on timeout. +*/ +static __always_inline int +pvr_cr_poll_reg32 (struct pvr_device *pvr_dev,u32 reg_addr,u32 reg_value, +u32 reg_mask,u64 timeout_usec) +{ +u32 value; + +return readl_poll_timeout (pvr_dev->regs + reg_addr, value, + (value & reg_mask) == reg_value,0 , timeout_usec); +} + +/** +* pvr_cr_poll_reg64() - Wait for a 64-bit register to match a given value by +* polling +* @pvr_dev: Target PowerVR device. +* @reg_addr: Address of register. +* @reg_value: Expected register value (after masking). +* @reg_mask: Mask of bits valid for comparison with @reg_value. +* @timeout_usec: Timeout length, in us. +* +* Returns: +* * 0 on success, or +* * -%ETIMEDOUT on timeout. +*/ +static __always_inline int +pvr_cr_poll_reg64 (struct pvr_device *pvr_dev,u32 reg_addr,u64 reg_value, +u64 reg_mask,u64 timeout_usec) +{ +u64 value; + +return readq_poll_timeout (pvr_dev->regs + reg_addr, value, + (value & reg_mask) == reg_value,0 , timeout_usec); +} +/** * DOC: IOCTL validation helpers * drivers/gpu/drm/imagination/pvr_drv.c +10
-1@@ -485,12 +485,19 @@ pvr_probe(struct platform_device *plat_dev)platform_set_drvdata (plat_dev, drm_dev); - err =drm_dev_register (drm_dev,0 ); + err =pvr_device_init (pvr_dev);if (err) goto err_out; + err =drm_dev_register (drm_dev,0 ); +if (err) + goto err_device_fini; +return 0 ; +err_device_fini: +pvr_device_fini (pvr_dev); + err_out:return err; }@@ -499,8 +506,10 @@ static int pvr_remove(struct platform_device *plat_dev) {struct drm_device *drm_dev =platform_get_drvdata (plat_dev); +struct pvr_device *pvr_dev =to_pvr_device (drm_dev);drm_dev_unregister (drm_dev); +pvr_device_fini (pvr_dev);return 0 ; }
Re: [PATCH v3 05/17] drm/imagination: Get GPU resources
Hi Andrew,
Quoted 99 lines · Andrew Davis
Quoted 98 lines · Sarah Walker
Acquire clock, regulator and register resources, and enable/map as appropriate.
Signed-off-by Sarah Walker <[email protected]>--- drivers/gpu/drm/imagination/Makefile | 1 + drivers/gpu/drm/imagination/pvr_device.c | 271 +++++++++++++++++++++++ drivers/gpu/drm/imagination/pvr_device.h | 214 ++++++++++++++++++ drivers/gpu/drm/imagination/pvr_drv.c | 11 +- 4 files changed, 496 insertions(+), 1 deletion(-)create mode 100644
drivers/gpu/drm/imagination/pvr_device.cdrivers/gpu/drm/imagination/Makefile +1
-0@@ -4,6 +4,7 @@ subdir-ccflags-y := -I$(srctree)/$(src) powervr-y := \ + pvr_device.o \ pvr_drv.o \ obj-$(CONFIG_DRM_POWERVR) += powervr.odrivers/gpu/drm/imagination/pvr_device.c new file +68
-0@@ -0,0 +1,271 @@ +// SPDX-License-Identifier: GPL-2.0 OR MIT +/* Copyright (c) 2022 Imagination Technologies Ltd. */ + +#include "pvr_device.h" + +#include <drm/drm_print.h> + +#include <linux/clk.h> +#include <linux/compiler_attributes.h> +#include <linux/compiler_types.h> +#include <linux/dma-mapping.h> +#include <linux/err.h> +#include <linux/gfp.h> +#include <linux/platform_device.h> +#include <linux/regulator/consumer.h> +#include <linux/slab.h> +#include <linux/stddef.h> +#include <linux/types.h> + +/** +* pvr_device_reg_init() - Initialize kernel access to a PowerVR device's +* control registers. +* @pvr_dev: Target PowerVR device. +* +* Sets struct pvr_device->regs. +* +* This method of mapping the device control registers into memory ensures that +* they are unmapped when the driver is detached (i.e. no explicit cleanup is +* required). +* +* Return: +* * 0 on success, or +* * Any error returned by devm_platform_ioremap_resource(). +*/ +static int +pvr_device_reg_init (struct pvr_device *pvr_dev) +{ +struct drm_device *drm_dev =from_pvr_device (pvr_dev); +struct platform_device *plat_dev =to_platform_device (drm_dev->dev); +struct resource *regs_resource; +void __iomem *regs; +int err; + + pvr_dev->regs_resource =NULL ; + pvr_dev->regs =NULL ; + + regs =devm_platform_get_and_ioremap_resource (plat_dev,0 , ®s_resource); +if (IS_ERR (regs)) { + err =PTR_ERR (regs); +drm_err (drm_dev,"failed to ioremap gpu registers (err=%d)\n" , + err); +return err; + } + + pvr_dev->regs = regs; + pvr_dev->regs_resource = regs_resource; + +return 0 ; +} + +/** +* pvr_device_reg_fini() - Deinitialize kernel access to a PowerVR device's +* control registers. +* @pvr_dev: Target PowerVR device. +* +* This is essentially a no-op, since pvr_device_reg_init() already ensures that +* struct pvr_device->regs is unmapped when the device is detached. This +* function just sets struct pvr_device->regs to %NULL.
Quoted 8 lines
drivers/gpu/drm/imagination/pvr_device.c line 73
Quoted 5 lines
drivers/gpu/drm/imagination/pvr_device.c new file +5
-0+*/ +static __always_inline void +pvr_device_reg_fini (struct pvr_device *pvr_dev) +{ + pvr_dev->regs =NULL ;This function isn't needed, kinda defeats the purpose of using devm_*() if you go an manually have no-op functions to unwind it..
Thank you for the suggestions. We'll fix this, as well as your other suggestions below.
Thanks
Frank
Quoted 499 lines
Quoted 25 lines
drivers/gpu/drm/imagination/pvr_device.c new file +24
-0+} + +/** +* pvr_device_clk_init() - Initialize clocks required by a PowerVR device +* @pvr_dev: Target PowerVR device. +* +* Sets struct pvr_device->core_clk, struct pvr_device->sys_clk and +* struct pvr_device->mem_clk. +* +* Three clocks are required by the PowerVR device: core, sys and mem. On +* return, this function guarantees that the clocks are in one of the following +* states: +* +* * All successfully initialized, +* * Core errored, sys and mem uninitialized, +* * Core deinitialized, sys errored, mem uninitialized, or +* * Core and sys deinitialized, mem errored. +* +* Return: +* * 0 on success, +* * Any error returned by devm_clk_get(), or +* * Any error returned by clk_prepare_enable(). +*/ +static int pvr_device_clk_init (struct pvr_device *pvr_dev)drivers/gpu/drm/imagination/pvr_device.c line 107
Quoted 10 lines
drivers/gpu/drm/imagination/pvr_device.c new file +10
-0+{ +struct drm_device *drm_dev =from_pvr_device (pvr_dev); +struct clk *core_clk; +struct clk *sys_clk; +struct clk *mem_clk; +int err; + + pvr_dev->core_clk =NULL ; + pvr_dev->sys_clk =NULL ; + pvr_dev->mem_clk =NULL ;You could NULL these out on the error path, but is that even needed, looks like if this functions fails we bail on the whole init where this is all deallocated (plus NULL'd out again in that path).
Quoted 46 lines
drivers/gpu/drm/imagination/pvr_device.c new file +46
-0+ + core_clk =devm_clk_get (drm_dev->dev,"core" ); +if (IS_ERR (core_clk)) { + err =PTR_ERR (core_clk); +drm_err (drm_dev,"failed to get core clock (err=%d)\n" , err); + goto err_out; + } + + sys_clk =devm_clk_get (drm_dev->dev,"sys" ); +if (IS_ERR (sys_clk)) + sys_clk =NULL ; + + mem_clk =devm_clk_get (drm_dev->dev,"mem" ); +if (IS_ERR (mem_clk)) + mem_clk =NULL ; + + err =clk_prepare (core_clk); +if (err) + goto err_out; + +if (sys_clk) { + err =clk_prepare (sys_clk); +if (err) + goto err_deinit_core_clk; + } + +if (mem_clk) { + err =clk_prepare (mem_clk); +if (err) + goto err_deinit_sys_clk; + } + + pvr_dev->core_clk = core_clk; + pvr_dev->sys_clk = sys_clk; + pvr_dev->mem_clk = mem_clk; + +return 0 ; + +err_deinit_sys_clk: +if (sys_clk) +clk_disable_unprepare (sys_clk); +err_deinit_core_clk: +clk_disable_unprepare (core_clk); +err_out: +return err; +}drivers/gpu/drm/imagination/pvr_device.c line 163
Quoted 10 lines
drivers/gpu/drm/imagination/pvr_device.c new file +10
-0+ +/** +* pvr_device_clk_fini() - Deinitialize clocks required by a PowerVR device +* @pvr_dev: Target PowerVR device. +*/ +static void +pvr_device_clk_fini (struct pvr_device *pvr_dev) +{ +if (pvr_dev->mem_clk) +clk_unprepare (pvr_dev->mem_clk);Using devm_clk_get_(optional)_prepared() in the init function above might allow these to be unprepaired for you, in that case this function also can be dropped.
Quoted 21 lines
drivers/gpu/drm/imagination/pvr_device.c new file +21
-0+if (pvr_dev->sys_clk) +clk_unprepare (pvr_dev->sys_clk); +clk_unprepare (pvr_dev->core_clk); + + pvr_dev->core_clk =NULL ; + pvr_dev->sys_clk =NULL ; + pvr_dev->mem_clk =NULL ; +} + +/** +* pvr_device_regulator_init() - Initialise regulator required by a PowerVR device +* @pvr_dev: Target PowerVR device. +* +* The regulator is not a required devicetree property. If it is not present then this function will +* succeed, but &pvr_device->regulator will be %NULL. +* +* Returns: +* * 0 on success, or +* * Any error returned by devm_regulator_get(). +*/ +static intdrivers/gpu/drm/imagination/pvr_device.c line 194
Quoted 10 lines
drivers/gpu/drm/imagination/pvr_device.c new file +10
-0+pvr_device_regulator_init(struct pvr_device *pvr_dev) +{ +struct drm_device *drm_dev =from_pvr_device (pvr_dev); +struct regulator *regulator; +int err; + + regulator =devm_regulator_get (drm_dev->dev,"power" ); +if (IS_ERR (regulator)) { + err =PTR_ERR (regulator); +/* Regulator is not required, so ENODEV is allowed here. */ There is
devm_regulator_get_optional(), might be what you want here.Also using
dev_err_probe()would check for probe defer here.Quoted 149 lines
drivers/gpu/drm/imagination/pvr_device.c new file +77
-0+if (err != -ENODEV ) + goto err_out; + regulator =NULL ; + } + + pvr_dev->regulator = regulator; + +return 0 ; + +err_out: +return err; +} + +/** +* pvr_device_init() - Initialize a PowerVR device +* @pvr_dev: Target PowerVR device. +* +* If this function returns successfully, the device will have been fully +* initialized. Otherwise, any parts of the device initialized before an error +* occurs will be de-initialized before returning. +* +* NOTE: The initialization steps currently taken are the bare minimum required +* to read from the control registers. The device is unlikely to function +* until further initialization steps are added. [This note should be +* removed when that happens.] +* +* Return: +* * 0 on success, +* * Any error returned by pvr_device_reg_init(), +* * Any error returned by pvr_device_clk_init(), or +* * Any error returned by pvr_device_gpu_init(). +*/ +int +pvr_device_init (struct pvr_device *pvr_dev) +{ +int err; + +/* Enable and initialize clocks required for the device to operate. */ + err =pvr_device_clk_init (pvr_dev); +if (err) + goto err_out; + + err =pvr_device_regulator_init (pvr_dev); +if (err) + goto err_device_clk_fini; + +/* Map the control registers into memory. */ + err =pvr_device_reg_init (pvr_dev); +if (err) + goto err_device_reg_fini; + +return 0 ; + +err_device_reg_fini: +pvr_device_reg_fini (pvr_dev); + +err_device_clk_fini: +pvr_device_clk_fini (pvr_dev); + +err_out: +return err; +} + +/** +* pvr_device_fini() - Deinitialize a PowerVR device +* @pvr_dev: Target PowerVR device. +*/ +void +pvr_device_fini (struct pvr_device *pvr_dev) +{ +/* +* Deinitialization stages are performed in reverse order compared to +* the initialization stages in pvr_device_init(). +*/ +pvr_device_reg_fini (pvr_dev); +pvr_device_clk_fini (pvr_dev); +}drivers/gpu/drm/imagination/pvr_device.h +47
-0@@ -11,9 +11,25 @@#include <linux/bits.h> #include <linux/compiler_attributes.h> #include <linux/compiler_types.h> +#include <linux/io.h> +#include <linux/iopoll.h> #include <linux/kernel.h> +#include <linux/math.h> +#include <linux/mutex.h> +#include <linux/timer.h> #include <linux/types.h> #include <linux/wait.h> +#include <linux/workqueue.h> +#include <linux/xarray.h> + +/* Forward declaration from <linux/clk.h>. */ +struct clk ; + +/* Forward declaration from <linux/firmware.h>. */ +struct firmware ; + +/* Forward declaration from <linux/regulator/consumer.h>. */ +struct regulator ;/** * struct pvr_device - powervr-specific wrapper for &struct drm_device @@ -26,6 +42,29 @@ struct pvr_device {* from_pvr_device(). */ struct drm_device base; + +/** @regs_resource: Resource representing device control registers. */ +struct resource *regs_resource; + +/** +* @regs: Device control registers. +* +* These are mapped into memory when the device is initialized; that +* location is where this pointer points. +*/ +void __iomem *regs; + +/** @core_clk: General core clock. */ +struct clk *core_clk; + +/** @sys_clk: System bus clock. */ +struct clk *sys_clk; + +/** @mem_clk: Memory clock. */ +struct clk *mem_clk; + +/** @regulator: Power regulator. */ +struct regulator *regulator; };/** @@ -72,6 +111,181 @@ to_pvr_file(struct drm_file *file)return file->driver_priv; } +int pvr_device_init (struct pvr_device *pvr_dev); +void pvr_device_fini (struct pvr_device *pvr_dev); + +int +pvr_device_clk_core_get_freq (struct pvr_device *pvr_dev,u32 *freq_out); + +/** +* PVR_CR_READ32() - Read a 32-bit register from a PowerVR device drivers/gpu/drm/imagination/pvr_device.h to_pvr_file(struct drm_file *file) · line 131
Quoted 10 lines
drivers/gpu/drm/imagination/pvr_device.h +10
-0+* @pvr_dev: Target PowerVR device. +* @reg: Target register. +* +* This macro is a wrapper around pvr_cr_read32(). It applies ROGUE_CR_ prefix +* to the provided @reg name, making it behave comparably to the +* PVR_CR_FIELD_GET() macro. +* +* Return: The value of the requested register. +*/ +#define PVR_CR_READ32 (pvr_dev, reg) pvr_cr_read32(pvr_dev, ROGUE_CR_##reg)Not a huge fan of all these oneline functions/macros, does this really add anyhing? All it does IMHO is add two levels of indirection we have to track back though to figure out what it actually is doing, when calling
ioread32()directly would have been just as clean and more obvious.Andrew
Quoted 196 lines
drivers/gpu/drm/imagination/pvr_device.h +157
-0+ +/** +* PVR_CR_READ64() - Read a 64-bit register from a PowerVR device +* @pvr_dev: Target PowerVR device. +* @reg: Target register. +* +* This macro is a wrapper around pvr_cr_read64(). It applies ROGUE_CR_ prefix +* to the provided @reg name, making it behave comparably to the +* PVR_CR_FIELD_GET() macro. +* +* Return: The value of the requested register. +*/ +#define PVR_CR_READ64 (pvr_dev, reg) pvr_cr_read64(pvr_dev, ROGUE_CR_##reg) + +/** +* PVR_CR_WRITE32() - Write to a 32-bit register in a PowerVR device +* @pvr_dev: Target PowerVR device. +* @reg: Target register. +* @val: Value to write. +* +* This macro is a wrapper around pvr_cr_write32(). It applies ROGUE_CR_ +* prefix to the provided @reg name, making it behave comparably to the +* PVR_CR_FIELD_GET() macro. +*/ +#define PVR_CR_WRITE32 (pvr_dev, reg, val) \ + pvr_cr_write32(pvr_dev, ROGUE_CR_##reg, val) + +/** +* PVR_CR_WRITE64() - Write to a 64-bit register in a PowerVR device +* @pvr_dev: Target PowerVR device. +* @reg: Target register. +* @val: Value to write. +* +* This macro is a wrapper around pvr_cr_write64(). It applies ROGUE_CR_ +* prefix to the provided @reg name, making it behave comparably to the +* PVR_CR_FIELD_GET() macro. +*/ +#define PVR_CR_WRITE64 (pvr_dev, reg, val) \ + pvr_cr_write64(pvr_dev, ROGUE_CR_##reg, val) + +/** +* PVR_CR_FIELD_GET() - Extract a single field from a PowerVR control register +* @val: Value of the target register. +* @field: Field specifier, as defined in "pvr_rogue_cr_defs.h". +* +* Return: The extracted field. +*/ +#define PVR_CR_FIELD_GET (val, field) FIELD_GET(~ROGUE_CR_##field##_CLRMSK, val) + +/** +* pvr_cr_read32() - Read a 32-bit register from a PowerVR device +* @pvr_dev: Target PowerVR device. +* @reg: Target register. +* +* The wrapper macro PVR_CR_READ32() may be used instead to simplify the +* selection of @reg. +* +* Return: The value of the requested register. +*/ +static __always_inline u32 +pvr_cr_read32 (struct pvr_device *pvr_dev,u32 reg) +{ +return ioread32 (pvr_dev->regs + reg); +} + +/** +* pvr_cr_read64() - Read a 64-bit register from a PowerVR device +* @pvr_dev: Target PowerVR device. +* @reg: Target register. +* +* The wrapper macro PVR_CR_READ64() may be used instead to simplify the +* selection of @reg. +* +* Return: The value of the requested register. +*/ +static __always_inline u64 +pvr_cr_read64 (struct pvr_device *pvr_dev,u32 reg) +{ +return ioread64 (pvr_dev->regs + reg); +} + +/** +* pvr_cr_write32() - Write to a 32-bit register in a PowerVR device +* @pvr_dev: Target PowerVR device. +* @reg: Target register. +* @val: Value to write. +* +* The wrapper macro PVR_CR_WRITE32() may be used instead to simplify the +* selection of @reg. +*/ +static __always_inline void +pvr_cr_write32 (struct pvr_device *pvr_dev,u32 reg,u32 val) +{ +iowrite32 (val, pvr_dev->regs + reg); +} + +/** +* pvr_cr_write64() - Write to a 64-bit register in a PowerVR device +* @pvr_dev: Target PowerVR device. +* @reg: Target register. +* @val: Value to write. +* +* The wrapper macro PVR_CR_WRITE64() may be used instead to simplify the +* selection of @reg. +*/ +static __always_inline void +pvr_cr_write64 (struct pvr_device *pvr_dev,u32 reg,u64 val) +{ +iowrite64 (val, pvr_dev->regs + reg); +} + +/** +* pvr_cr_poll_reg32() - Wait for a 32-bit register to match a given value by +* polling +* @pvr_dev: Target PowerVR device. +* @reg_addr: Address of register. +* @reg_value: Expected register value (after masking). +* @reg_mask: Mask of bits valid for comparison with @reg_value. +* @timeout_usec: Timeout length, in us. +* +* Returns: +* * 0 on success, or +* * -%ETIMEDOUT on timeout. +*/ +static __always_inline int +pvr_cr_poll_reg32 (struct pvr_device *pvr_dev,u32 reg_addr,u32 reg_value, +u32 reg_mask,u64 timeout_usec) +{ +u32 value; + +return readl_poll_timeout (pvr_dev->regs + reg_addr, value, + (value & reg_mask) == reg_value,0 , timeout_usec); +} + +/** +* pvr_cr_poll_reg64() - Wait for a 64-bit register to match a given value by +* polling +* @pvr_dev: Target PowerVR device. +* @reg_addr: Address of register. +* @reg_value: Expected register value (after masking). +* @reg_mask: Mask of bits valid for comparison with @reg_value. +* @timeout_usec: Timeout length, in us. +* +* Returns: +* * 0 on success, or +* * -%ETIMEDOUT on timeout. +*/ +static __always_inline int +pvr_cr_poll_reg64 (struct pvr_device *pvr_dev,u32 reg_addr,u64 reg_value, +u64 reg_mask,u64 timeout_usec) +{ +u64 value; + +return readq_poll_timeout (pvr_dev->regs + reg_addr, value, + (value & reg_mask) == reg_value,0 , timeout_usec); +} +/** * DOC: IOCTL validation helpers * drivers/gpu/drm/imagination/pvr_drv.c +10
-1@@ -485,12 +485,19 @@ pvr_probe(struct platform_device *plat_dev)platform_set_drvdata (plat_dev, drm_dev); - err =drm_dev_register (drm_dev,0 ); + err =pvr_device_init (pvr_dev);if (err) goto err_out; + err =drm_dev_register (drm_dev,0 ); +if (err) + goto err_device_fini; +return 0 ; +err_device_fini: +pvr_device_fini (pvr_dev); + err_out:return err; }@@ -499,8 +506,10 @@ static int pvr_remove(struct platform_device *plat_dev) {struct drm_device *drm_dev =platform_get_drvdata (plat_dev); +struct pvr_device *pvr_dev =to_pvr_device (drm_dev);drm_dev_unregister (drm_dev); +pvr_device_fini (pvr_dev);return 0 ; }
Re: [PATCH v3 05/17] drm/imagination: Get GPU resources
In reply to Sarah WalkerQuoted 76 lines · Sarah Walker
Acquire clock, regulator and register resources, and enable/map as appropriate.
Signed-off-by Sarah Walker <[email protected]>--- drivers/gpu/drm/imagination/Makefile | 1 + drivers/gpu/drm/imagination/pvr_device.c | 271 +++++++++++++++++++++++ drivers/gpu/drm/imagination/pvr_device.h | 214 ++++++++++++++++++ drivers/gpu/drm/imagination/pvr_drv.c | 11 +- 4 files changed, 496 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/drm/imagination/pvr_device.cdrivers/gpu/drm/imagination/Makefile +1
-0@@ -4,6 +4,7 @@ subdir-ccflags-y := -I$(srctree)/$(src) powervr-y := \ + pvr_device.o \ pvr_drv.o \ obj-$(CONFIG_DRM_POWERVR) += powervr.odrivers/gpu/drm/imagination/pvr_device.c new file +46
-0@@ -0,0 +1,271 @@ +// SPDX-License-Identifier: GPL-2.0 OR MIT +/* Copyright (c) 2022 Imagination Technologies Ltd. */ + +#include "pvr_device.h" + +#include <drm/drm_print.h> + +#include <linux/clk.h> +#include <linux/compiler_attributes.h> +#include <linux/compiler_types.h> +#include <linux/dma-mapping.h> +#include <linux/err.h> +#include <linux/gfp.h> +#include <linux/platform_device.h> +#include <linux/regulator/consumer.h> +#include <linux/slab.h> +#include <linux/stddef.h> +#include <linux/types.h> + +/** +* pvr_device_reg_init() - Initialize kernel access to a PowerVR device's +* control registers. +* @pvr_dev: Target PowerVR device. +* +* Sets struct pvr_device->regs. +* +* This method of mapping the device control registers into memory ensures that +* they are unmapped when the driver is detached (i.e. no explicit cleanup is +* required). +* +* Return: +* * 0 on success, or +* * Any error returned by devm_platform_ioremap_resource(). +*/ +static int +pvr_device_reg_init (struct pvr_device *pvr_dev) +{ +struct drm_device *drm_dev =from_pvr_device (pvr_dev); +struct platform_device *plat_dev =to_platform_device (drm_dev->dev); +struct resource *regs_resource; +void __iomem *regs; +int err; + + pvr_dev->regs_resource =NULL ; + pvr_dev->regs =NULL ; +
drivers/gpu/drm/imagination/pvr_device.c line 56
Quoted 10 lines
drivers/gpu/drm/imagination/pvr_device.c new file +10
-0+ regs =devm_platform_get_and_ioremap_resource (plat_dev,0 , ®s_resource); +if (IS_ERR (regs)) { + err =PTR_ERR (regs); +drm_err (drm_dev,"failed to ioremap gpu registers (err=%d)\n" , + err); +return err; + } + + pvr_dev->regs = regs; + pvr_dev->regs_resource = regs_resource;
Do you actually need the resources somewhere?
Quoted 7 lines
drivers/gpu/drm/imagination/pvr_device.c new file +7
-0+ +return 0 ; +} + +/** +* pvr_device_reg_fini() - Deinitialize kernel access to a PowerVR device's +* control registers.
drivers/gpu/drm/imagination/pvr_device.c line 73
Quoted 10 lines
drivers/gpu/drm/imagination/pvr_device.c new file +10
-0+* @pvr_dev: Target PowerVR device. +* +* This is essentially a no-op, since pvr_device_reg_init() already ensures that +* struct pvr_device->regs is unmapped when the device is detached. This +* function just sets struct pvr_device->regs to %NULL. +*/ +static __always_inline void +pvr_device_reg_fini (struct pvr_device *pvr_dev) +{ + pvr_dev->regs =NULL ;
But if you do, I guess clearing the regs_resource pointer would be nice too.
Quoted 39 lines
drivers/gpu/drm/imagination/pvr_device.c new file +39
-0+} + +/** +* pvr_device_clk_init() - Initialize clocks required by a PowerVR device +* @pvr_dev: Target PowerVR device. +* +* Sets struct pvr_device->core_clk, struct pvr_device->sys_clk and +* struct pvr_device->mem_clk. +* +* Three clocks are required by the PowerVR device: core, sys and mem. On +* return, this function guarantees that the clocks are in one of the following +* states: +* +* * All successfully initialized, +* * Core errored, sys and mem uninitialized, +* * Core deinitialized, sys errored, mem uninitialized, or +* * Core and sys deinitialized, mem errored. +* +* Return: +* * 0 on success, +* * Any error returned by devm_clk_get(), or +* * Any error returned by clk_prepare_enable(). +*/ +static int pvr_device_clk_init (struct pvr_device *pvr_dev) +{ +struct drm_device *drm_dev =from_pvr_device (pvr_dev); +struct clk *core_clk; +struct clk *sys_clk; +struct clk *mem_clk; +int err; + + pvr_dev->core_clk =NULL ; + pvr_dev->sys_clk =NULL ; + pvr_dev->mem_clk =NULL ; + + core_clk =devm_clk_get (drm_dev->dev,"core" ); +if (IS_ERR (core_clk)) { + err =PTR_ERR (core_clk); +drm_err (drm_dev,"failed to get core clock (err=%d)\n" , err);
drivers/gpu/drm/imagination/pvr_device.c line 122
Quoted 10 lines
drivers/gpu/drm/imagination/pvr_device.c new file +10
-0+ goto err_out; + } + + sys_clk =devm_clk_get (drm_dev->dev,"sys" ); +if (IS_ERR (sys_clk)) + sys_clk =NULL ; + + mem_clk =devm_clk_get (drm_dev->dev,"mem" ); +if (IS_ERR (mem_clk)) + mem_clk =NULL ;
If those two are optionals, you can use devm_clk_get_optional. This has the advantage of only ignoring the case where the clock isn't there, but not the other error conditions.
drivers/gpu/drm/imagination/pvr_device.c line 129
Quoted 7 lines
drivers/gpu/drm/imagination/pvr_device.c new file +7
-0+ + err =clk_prepare (core_clk); +if (err) + goto err_out; + +if (sys_clk) { + err =clk_prepare (sys_clk);
It's valid to call clk_prepare(NULL), which will be a nop. I think you can remove the check on the null pointer.
Also do you need to split prepare and enable? The usual reason to do so is that prepare can sleep and thus can't be called in an atomic context, but enable can. I can't think of a case where that would happen for a GPU though, so you should probably do both at once?
You should also consider using the devm variants there like devm_clk_get_optional_prepared and similar, depending on how you address the comments above. This will greatly simplify your exit / cleanup path.
Quoted 11 lines
drivers/gpu/drm/imagination/pvr_device.c new file +11
-0+if (err) + goto err_deinit_core_clk; + } + +if (mem_clk) { + err =clk_prepare (mem_clk); +if (err) + goto err_deinit_sys_clk; + } + + pvr_dev->core_clk = core_clk;
drivers/gpu/drm/imagination/pvr_device.c line 150
Quoted 10 lines
drivers/gpu/drm/imagination/pvr_device.c new file +10
-0+ pvr_dev->sys_clk = sys_clk; + pvr_dev->mem_clk = mem_clk; + +return 0 ; + +err_deinit_sys_clk: +if (sys_clk) +clk_disable_unprepare (sys_clk); +err_deinit_core_clk: +clk_disable_unprepare (core_clk);
Since the clocks haven't been enabled yet, this will create an enable count imbalance.
Quoted 14 lines
drivers/gpu/drm/imagination/pvr_device.c new file +14
-0+/** +* pvr_device_regulator_init() - Initialise regulator required by a PowerVR device +* @pvr_dev: Target PowerVR device. +* +* The regulator is not a required devicetree property. If it is not present then this function will +* succeed, but &pvr_device->regulator will be %NULL. +* +* Returns: +* * 0 on success, or +* * Any error returned by devm_regulator_get(). +*/ +static int +pvr_device_regulator_init (struct pvr_device *pvr_dev) +{
drivers/gpu/drm/imagination/pvr_device.c line 196
Quoted 10 lines
drivers/gpu/drm/imagination/pvr_device.c new file +10
-0+struct drm_device *drm_dev =from_pvr_device (pvr_dev); +struct regulator *regulator; +int err; + + regulator =devm_regulator_get (drm_dev->dev,"power" ); +if (IS_ERR (regulator)) { + err =PTR_ERR (regulator); +/* Regulator is not required, so ENODEV is allowed here. */ +if (err != -ENODEV ) + goto err_out;
This is what regulator_get_optional does :)
Quoted 32 lines
drivers/gpu/drm/imagination/pvr_device.c new file +32
-0+/** +* pvr_device_init() - Initialize a PowerVR device +* @pvr_dev: Target PowerVR device. +* +* If this function returns successfully, the device will have been fully +* initialized. Otherwise, any parts of the device initialized before an error +* occurs will be de-initialized before returning. +* +* NOTE: The initialization steps currently taken are the bare minimum required +* to read from the control registers. The device is unlikely to function +* until further initialization steps are added. [This note should be +* removed when that happens.] +* +* Return: +* * 0 on success, +* * Any error returned by pvr_device_reg_init(), +* * Any error returned by pvr_device_clk_init(), or +* * Any error returned by pvr_device_gpu_init(). +*/ +int +pvr_device_init (struct pvr_device *pvr_dev) +{ +int err; + +/* Enable and initialize clocks required for the device to operate. */ + err =pvr_device_clk_init (pvr_dev); +if (err) + goto err_out; + + err =pvr_device_regulator_init (pvr_dev); +if (err) + goto err_device_clk_fini;
drivers/gpu/drm/imagination/pvr_device.c line 249
Quoted 10 lines
drivers/gpu/drm/imagination/pvr_device.c new file +10
-0+ +/* Map the control registers into memory. */ + err =pvr_device_reg_init (pvr_dev); +if (err) + goto err_device_reg_fini; + +return 0 ; + +err_device_reg_fini: +pvr_device_reg_fini (pvr_dev);
I think you got that one wrong, I don't think you should call pvr_device_reg_fini if pvr_device_reg_init failed?
But switching to devm will solve this too.
Quoted 16 lines
drivers/gpu/drm/imagination/pvr_device.c new file +10
-0/** * struct pvr_device - powervr-specific wrapper for &struct drm_device @@ -26,6 +42,29 @@ struct pvr_device {* from_pvr_device(). */ struct drm_device base; + +/** @regs_resource: Resource representing device control registers. */ +struct resource *regs_resource; + +/** +* @regs: Device control registers. +* +* These are mapped into memory when the device is initialized; that +* location is where this pointer points. +*/
drivers/gpu/drm/imagination/pvr_device.c struct pvr_device { · line 64
Quoted 10 lines
drivers/gpu/drm/imagination/pvr_device.c new file +10
-0+void __iomem *regs; + +/** @core_clk: General core clock. */ +struct clk *core_clk; + +/** @sys_clk: System bus clock. */ +struct clk *sys_clk; + +/** @mem_clk: Memory clock. */ +struct clk *mem_clk;
It's not really a review but more of a suggestion: the semantics around the clocks vary from one vendor to another, so having a bit more context here in what those clocks are used for by the hardware and how we should use them in the driver would be great.
Quoted 6 lines
drivers/gpu/drm/imagination/pvr_device.c new file +2
-0+/** @regulator: Power regulator. */ +struct regulator *regulator; };/**
drivers/gpu/drm/imagination/pvr_device.c to_pvr_file(struct drm_file *file) · line 118
Quoted 8 lines
drivers/gpu/drm/imagination/pvr_device.c new file +5
-0@@ -72,6 +111,181 @@ to_pvr_file(struct drm_file *file)return file->driver_priv; } +int pvr_device_init (struct pvr_device *pvr_dev); +void pvr_device_fini (struct pvr_device *pvr_dev); + +int +pvr_device_clk_core_get_freq (struct pvr_device *pvr_dev,u32 *freq_out);
Do we really need a wrapper around clk_get_rate(pvr_dev->core_clk) ?
Also, this function is defined in patch 7.
Quoted 26 lines
drivers/gpu/drm/imagination/pvr_drv.c +8
-1@@ -485,12 +485,19 @@ pvr_probe(struct platform_device *plat_dev)platform_set_drvdata (plat_dev, drm_dev); - err =drm_dev_register (drm_dev,0 ); + err =pvr_device_init (pvr_dev);if (err) goto err_out; + err =drm_dev_register (drm_dev,0 ); +if (err) + goto err_device_fini; +return 0 ; +err_device_fini: +pvr_device_fini (pvr_dev); + err_out:return err; }
drivers/gpu/drm/imagination/pvr_drv.c static int · line 515
Quoted 10 lines
drivers/gpu/drm/imagination/pvr_drv.c +2
-0@@ -499,8 +506,10 @@ static int pvr_remove(struct platform_device *plat_dev) {struct drm_device *drm_dev =platform_get_drvdata (plat_dev); +struct pvr_device *pvr_dev =to_pvr_device (drm_dev);drm_dev_unregister (drm_dev); +pvr_device_fini (pvr_dev);return 0 ; }
There's one gotcha you'll need to consider: DRM devices are unregistered and freed not when the device goes away but when the last (userspace) application closed its file descriptor.
This means that you have an undefined window during which devm will have run (and thus cleaned up the resources) but the driver is still live and can still get called.
So you need to protect all device resources access (registers, clocks and regulator in your case I guess?) by calls to drm_dev_enter/drm_dev_exit and use drm_dev_unplug instead of drm_dev_unregister.
Maxime
Re: [PATCH v3 05/17] drm/imagination: Get GPU resources
Hi Maxime,
Quoted 81 lines · Maxime Ripard
Quoted 80 lines · Sarah Walker
Acquire clock, regulator and register resources, and enable/map as appropriate.
Signed-off-by Sarah Walker <[email protected]>--- drivers/gpu/drm/imagination/Makefile | 1 + drivers/gpu/drm/imagination/pvr_device.c | 271 +++++++++++++++++++++++ drivers/gpu/drm/imagination/pvr_device.h | 214 ++++++++++++++++++ drivers/gpu/drm/imagination/pvr_drv.c | 11 +- 4 files changed, 496 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/drm/imagination/pvr_device.cdrivers/gpu/drm/imagination/Makefile +1
-0@@ -4,6 +4,7 @@ subdir-ccflags-y := -I$(srctree)/$(src) powervr-y := \ + pvr_device.o \ pvr_drv.o \ obj-$(CONFIG_DRM_POWERVR) += powervr.odrivers/gpu/drm/imagination/pvr_device.c new file +50
-0@@ -0,0 +1,271 @@ +// SPDX-License-Identifier: GPL-2.0 OR MIT +/* Copyright (c) 2022 Imagination Technologies Ltd. */ + +#include "pvr_device.h" + +#include <drm/drm_print.h> + +#include <linux/clk.h> +#include <linux/compiler_attributes.h> +#include <linux/compiler_types.h> +#include <linux/dma-mapping.h> +#include <linux/err.h> +#include <linux/gfp.h> +#include <linux/platform_device.h> +#include <linux/regulator/consumer.h> +#include <linux/slab.h> +#include <linux/stddef.h> +#include <linux/types.h> + +/** +* pvr_device_reg_init() - Initialize kernel access to a PowerVR device's +* control registers. +* @pvr_dev: Target PowerVR device. +* +* Sets struct pvr_device->regs. +* +* This method of mapping the device control registers into memory ensures that +* they are unmapped when the driver is detached (i.e. no explicit cleanup is +* required). +* +* Return: +* * 0 on success, or +* * Any error returned by devm_platform_ioremap_resource(). +*/ +static int +pvr_device_reg_init (struct pvr_device *pvr_dev) +{ +struct drm_device *drm_dev =from_pvr_device (pvr_dev); +struct platform_device *plat_dev =to_platform_device (drm_dev->dev); +struct resource *regs_resource; +void __iomem *regs; +int err; + + pvr_dev->regs_resource =NULL ; + pvr_dev->regs =NULL ; + + regs =devm_platform_get_and_ioremap_resource (plat_dev,0 , ®s_resource); +if (IS_ERR (regs)) { + err =PTR_ERR (regs); + drm_err(drm_dev, "failed to ioremap gpu registers (err=%d)\n",
Quoted 8 lines
drivers/gpu/drm/imagination/pvr_device.c line 56
Quoted 6 lines
drivers/gpu/drm/imagination/pvr_device.c new file +6
-0+ err); +return err; + } + + pvr_dev->regs = regs; + pvr_dev->regs_resource = regs_resource;Do you actually need the resources somewhere?
This is needed when setting up the boot data for the MIPS firmware processor in patch 11 (drm/imagination: Implement MIPS firmware processor and MMU support). We'll move it to that patch instead.
Quoted 12 lines
Quoted 12 lines
drivers/gpu/drm/imagination/pvr_device.c new file +11
-0+ +return 0 ; +} + +/** +* pvr_device_reg_fini() - Deinitialize kernel access to a PowerVR device's +* control registers. +* @pvr_dev: Target PowerVR device. +* +* This is essentially a no-op, since pvr_device_reg_init() already ensures that +* struct pvr_device->regs is unmapped when the device is detached. This
Quoted 8 lines
drivers/gpu/drm/imagination/pvr_device.c line 73
Quoted 6 lines
drivers/gpu/drm/imagination/pvr_device.c new file +6
-0+* function just sets struct pvr_device->regs to %NULL. +*/ +static __always_inline void +pvr_device_reg_fini (struct pvr_device *pvr_dev) +{ + pvr_dev->regs =NULL ;But if you do, I guess clearing the
regs_resourcepointer would be nice too.
pvr_device_reg_fini() will be gone in the next version.
Quoted 46 lines
Quoted 46 lines
drivers/gpu/drm/imagination/pvr_device.c new file +45
-0+} + +/** +* pvr_device_clk_init() - Initialize clocks required by a PowerVR device +* @pvr_dev: Target PowerVR device. +* +* Sets struct pvr_device->core_clk, struct pvr_device->sys_clk and +* struct pvr_device->mem_clk. +* +* Three clocks are required by the PowerVR device: core, sys and mem. On +* return, this function guarantees that the clocks are in one of the following +* states: +* +* * All successfully initialized, +* * Core errored, sys and mem uninitialized, +* * Core deinitialized, sys errored, mem uninitialized, or +* * Core and sys deinitialized, mem errored. +* +* Return: +* * 0 on success, +* * Any error returned by devm_clk_get(), or +* * Any error returned by clk_prepare_enable(). +*/ +static int pvr_device_clk_init (struct pvr_device *pvr_dev) +{ +struct drm_device *drm_dev =from_pvr_device (pvr_dev); +struct clk *core_clk; +struct clk *sys_clk; +struct clk *mem_clk; +int err; + + pvr_dev->core_clk =NULL ; + pvr_dev->sys_clk =NULL ; + pvr_dev->mem_clk =NULL ; + + core_clk =devm_clk_get (drm_dev->dev,"core" ); +if (IS_ERR (core_clk)) { + err =PTR_ERR (core_clk); +drm_err (drm_dev,"failed to get core clock (err=%d)\n" , err); + goto err_out; + } + + sys_clk =devm_clk_get (drm_dev->dev,"sys" ); +if (IS_ERR (sys_clk)) + sys_clk =NULL ;
Quoted 8 lines
drivers/gpu/drm/imagination/pvr_device.c line 122
Quoted 4 lines
drivers/gpu/drm/imagination/pvr_device.c new file +4
-0+ + mem_clk =devm_clk_get (drm_dev->dev,"mem" ); +if (IS_ERR (mem_clk)) + mem_clk =NULL ;If those two are optionals, you can use
devm_clk_get_optional. This has the advantage of only ignoring the case where the clock isn't there, but not the other error conditions.
Ack
Quoted 11 lines
drivers/gpu/drm/imagination/pvr_device.c line 129
Quoted 8 lines
drivers/gpu/drm/imagination/pvr_device.c new file +7
-0+ + err =clk_prepare (core_clk); +if (err) + goto err_out; + +if (sys_clk) { + err =clk_prepare (sys_clk);It's valid to call
clk_prepare(NULL), which will be a nop. I think you can remove the check on the null pointer.
Ack
Quoted 5 lines
Also do you need to split prepare and enable? The usual reason to do so is that prepare can sleep and thus can't be called in an atomic context, but enable can. I can't think of a case where that would happen for a GPU though, so you should probably do both at once?
No, we don't need the split, so we'll fix this.
Quoted 4 lines
You should also consider using the devm variants there like
devm_clk_get_optional_preparedand similar, depending on how you address the comments above. This will greatly simplify your exit / cleanup path.
Ack
Quoted 17 lines
Quoted 17 lines
drivers/gpu/drm/imagination/pvr_device.c new file +16
-0+if (err) + goto err_deinit_core_clk; + } + +if (mem_clk) { + err =clk_prepare (mem_clk); +if (err) + goto err_deinit_sys_clk; + } + + pvr_dev->core_clk = core_clk; + pvr_dev->sys_clk = sys_clk; + pvr_dev->mem_clk = mem_clk; + +return 0 ; +
Quoted 8 lines
drivers/gpu/drm/imagination/pvr_device.c line 150
Quoted 5 lines
drivers/gpu/drm/imagination/pvr_device.c new file +5
-0+err_deinit_sys_clk: +if (sys_clk) +clk_disable_unprepare (sys_clk); +err_deinit_core_clk: +clk_disable_unprepare (core_clk);Since the clocks haven't been enabled yet, this will create an enable count imbalance.
Ack
Quoted 19 lines
Quoted 19 lines
drivers/gpu/drm/imagination/pvr_device.c new file +18
-0+/** +* pvr_device_regulator_init() - Initialise regulator required by a PowerVR device +* @pvr_dev: Target PowerVR device. +* +* The regulator is not a required devicetree property. If it is not present then this function will +* succeed, but &pvr_device->regulator will be %NULL. +* +* Returns: +* * 0 on success, or +* * Any error returned by devm_regulator_get(). +*/ +static int +pvr_device_regulator_init (struct pvr_device *pvr_dev) +{ +struct drm_device *drm_dev =from_pvr_device (pvr_dev); +struct regulator *regulator; +int err; +
Quoted 8 lines
drivers/gpu/drm/imagination/pvr_device.c line 196
Quoted 6 lines
drivers/gpu/drm/imagination/pvr_device.c new file +6
-0+ regulator =devm_regulator_get (drm_dev->dev,"power" ); +if (IS_ERR (regulator)) { + err =PTR_ERR (regulator); +/* Regulator is not required, so ENODEV is allowed here. */ +if (err != -ENODEV ) + goto err_out;This is what
regulator_get_optionaldoes :)
Thanks for point it out :)
Quoted 47 lines
Quoted 33 lines
drivers/gpu/drm/imagination/pvr_device.c new file +32
-0+/** +* pvr_device_init() - Initialize a PowerVR device +* @pvr_dev: Target PowerVR device. +* +* If this function returns successfully, the device will have been fully +* initialized. Otherwise, any parts of the device initialized before an error +* occurs will be de-initialized before returning. +* +* NOTE: The initialization steps currently taken are the bare minimum required +* to read from the control registers. The device is unlikely to function +* until further initialization steps are added. [This note should be +* removed when that happens.] +* +* Return: +* * 0 on success, +* * Any error returned by pvr_device_reg_init(), +* * Any error returned by pvr_device_clk_init(), or +* * Any error returned by pvr_device_gpu_init(). +*/ +int +pvr_device_init (struct pvr_device *pvr_dev) +{ +int err; + +/* Enable and initialize clocks required for the device to operate. */ + err =pvr_device_clk_init (pvr_dev); +if (err) + goto err_out; + + err =pvr_device_regulator_init (pvr_dev); +if (err) + goto err_device_clk_fini;drivers/gpu/drm/imagination/pvr_device.c line 249
Quoted 10 lines
drivers/gpu/drm/imagination/pvr_device.c new file +10
-0+ +/* Map the control registers into memory. */ + err =pvr_device_reg_init (pvr_dev); +if (err) + goto err_device_reg_fini; + +return 0 ; + +err_device_reg_fini: +pvr_device_reg_fini (pvr_dev);I think you got that one wrong, I don't think you should call
pvr_device_reg_finiifpvr_device_reg_initfailed?
Quoted 1 line
But switching to devm will solve this too.
Ack
Quoted 24 lines
Quoted 24 lines
drivers/gpu/drm/imagination/pvr_device.c new file +17
-0/** * struct pvr_device - powervr-specific wrapper for &struct drm_device @@ -26,6 +42,29 @@ struct pvr_device {* from_pvr_device(). */ struct drm_device base; + +/** @regs_resource: Resource representing device control registers. */ +struct resource *regs_resource; + +/** +* @regs: Device control registers. +* +* These are mapped into memory when the device is initialized; that +* location is where this pointer points. +*/ +void __iomem *regs; + +/** @core_clk: General core clock. */ +struct clk *core_clk; + +/** @sys_clk: System bus clock. */ +struct clk *sys_clk;
Quoted 8 lines
drivers/gpu/drm/imagination/pvr_device.c struct pvr_device { · line 64
Quoted 3 lines
drivers/gpu/drm/imagination/pvr_device.c new file +3
-0+ +/** @mem_clk: Memory clock. */ +struct clk *mem_clk;It's not really a review but more of a suggestion: the semantics around the clocks vary from one vendor to another, so having a bit more context here in what those clocks are used for by the hardware and how we should use them in the driver would be great.
We'll flesh this out a bit more in the next version.
Quoted 10 lines
Quoted 10 lines
drivers/gpu/drm/imagination/pvr_device.c new file +2
-0+/** @regulator: Power regulator. */ +struct regulator *regulator; };/** @@ -72,6 +111,181 @@ to_pvr_file(struct drm_file *file)return file->driver_priv; }
Quoted 7 lines
drivers/gpu/drm/imagination/pvr_device.c to_pvr_file(struct drm_file *file) · line 118
Quoted 5 lines
drivers/gpu/drm/imagination/pvr_device.c new file +5
-0+int pvr_device_init (struct pvr_device *pvr_dev); +void pvr_device_fini (struct pvr_device *pvr_dev); + +int +pvr_device_clk_core_get_freq (struct pvr_device *pvr_dev,u32 *freq_out);Do we really need a wrapper around
clk_get_rate(pvr_dev->core_clk)?
No, we'll drop this.
Quoted 44 lines
Also, this function is defined in patch 7.
Quoted 26 lines
drivers/gpu/drm/imagination/pvr_drv.c +8
-1@@ -485,12 +485,19 @@ pvr_probe(struct platform_device *plat_dev)platform_set_drvdata (plat_dev, drm_dev); - err =drm_dev_register (drm_dev,0 ); + err =pvr_device_init (pvr_dev);if (err) goto err_out; + err =drm_dev_register (drm_dev,0 ); +if (err) + goto err_device_fini; +return 0 ; +err_device_fini: +pvr_device_fini (pvr_dev); + err_out:return err; }drivers/gpu/drm/imagination/pvr_drv.c static int · line 515
Quoted 10 lines
drivers/gpu/drm/imagination/pvr_drv.c +2
-0@@ -499,8 +506,10 @@ static int pvr_remove(struct platform_device *plat_dev) {struct drm_device *drm_dev =platform_get_drvdata (plat_dev); +struct pvr_device *pvr_dev =to_pvr_device (drm_dev);drm_dev_unregister (drm_dev); +pvr_device_fini (pvr_dev);return 0 ; }There's one gotcha you'll need to consider: DRM devices are unregistered and freed not when the device goes away but when the last (userspace) application closed its file descriptor.
Quoted 8 lines
This means that you have an undefined window during which devm will have run (and thus cleaned up the resources) but the driver is still live and can still get called.
So you need to protect all device resources access (registers, clocks and regulator in your case I guess?) by calls to drm_dev_enter/drm_dev_exit and use
drm_dev_unpluginstead ofdrm_dev_unregister.
Thanks for highlighting this. We'll make sure we use these functions in the next version.
Thanks
Frank
Quoted 2 lines
Maxime
PATCH v3 6/17 drm/imagination: Add GPU register and FWIF headers
In reply to Sarah Walker--- .../gpu/drm/imagination/pvr_rogue_cr_defs.h | 6193 +++++++++++++++++ .../imagination/pvr_rogue_cr_defs_client.h | 159 + drivers/gpu/drm/imagination/pvr_rogue_defs.h | 179 + drivers/gpu/drm/imagination/pvr_rogue_fwif.h | 2208 ++++++ .../drm/imagination/pvr_rogue_fwif_check.h | 491 ++ .../drm/imagination/pvr_rogue_fwif_client.h | 369 + .../imagination/pvr_rogue_fwif_client_check.h | 133 + .../drm/imagination/pvr_rogue_fwif_common.h | 60 + .../pvr_rogue_fwif_resetframework.h | 28 + .../gpu/drm/imagination/pvr_rogue_fwif_sf.h | 1648 +++++ .../drm/imagination/pvr_rogue_fwif_shared.h | 258 + .../imagination/pvr_rogue_fwif_shared_check.h | 108 + .../drm/imagination/pvr_rogue_fwif_stream.h | 78 + .../drm/imagination/pvr_rogue_heap_config.h | 113 + drivers/gpu/drm/imagination/pvr_rogue_meta.h | 356 + drivers/gpu/drm/imagination/pvr_rogue_mips.h | 335 + .../drm/imagination/pvr_rogue_mips_check.h | 58 + .../gpu/drm/imagination/pvr_rogue_mmu_defs.h | 136 + 18 files changed, 12910 insertions(+) create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_cr_defs.h create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_cr_defs_client.h create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_defs.h create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_fwif.h create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_fwif_check.h create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_fwif_client.h create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_fwif_client_check.h create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_fwif_common.h create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_fwif_resetframework.h create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_fwif_sf.h create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_fwif_shared.h create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_fwif_shared_check.h create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_fwif_stream.h create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_heap_config.h create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_meta.h create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_mips.h create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_mips_check.h create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_mmu_defs.h
drivers/gpu/drm/imagination/pvr_rogue_cr_defs.h new file +6193 -0
@@ -0,0 +1,6193 @@ +/* SPDX-License-Identifier: GPL-2.0 OR MIT */ +/* Copyright (c) 2022 Imagination Technologies Ltd. */ + +/* *** Autogenerated C -- do not edit *** */ + +#ifndef PVR_ROGUE_CR_DEFS_H +#define PVR_ROGUE_CR_DEFS_H + +/* clang-format off */ + +#define ROGUE_CR_DEFS_REVISION 1 + +/* Register ROGUE_CR_RASTERISATION_INDIRECT */ +#define ROGUE_CR_RASTERISATION_INDIRECT 0x8238U +#define ROGUE_CR_RASTERISATION_INDIRECT_MASKFULL 0x000000000000000FULL +#define ROGUE_CR_RASTERISATION_INDIRECT_ADDRESS_SHIFT 0U +#define ROGUE_CR_RASTERISATION_INDIRECT_ADDRESS_CLRMSK 0xFFFFFFF0U + +/* Register ROGUE_CR_PBE_INDIRECT */ +#define ROGUE_CR_PBE_INDIRECT 0x83E0U +#define ROGUE_CR_PBE_INDIRECT_MASKFULL 0x000000000000000FULL +#define ROGUE_CR_PBE_INDIRECT_ADDRESS_SHIFT 0U +#define ROGUE_CR_PBE_INDIRECT_ADDRESS_CLRMSK 0xFFFFFFF0U + +/* Register ROGUE_CR_PBE_PERF_INDIRECT */ +#define ROGUE_CR_PBE_PERF_INDIRECT 0x83D8U +#define ROGUE_CR_PBE_PERF_INDIRECT_MASKFULL 0x000000000000000FULL +#define ROGUE_CR_PBE_PERF_INDIRECT_ADDRESS_SHIFT 0U +#define ROGUE_CR_PBE_PERF_INDIRECT_ADDRESS_CLRMSK 0xFFFFFFF0U + +/* Register ROGUE_CR_TPU_PERF_INDIRECT */ +#define ROGUE_CR_TPU_PERF_INDIRECT 0x83F0U +#define ROGUE_CR_TPU_PERF_INDIRECT_MASKFULL 0x0000000000000007ULL +#define ROGUE_CR_TPU_PERF_INDIRECT_ADDRESS_SHIFT 0U +#define ROGUE_CR_TPU_PERF_INDIRECT_ADDRESS_CLRMSK 0xFFFFFFF8U + +/* Register ROGUE_CR_RASTERISATION_PERF_INDIRECT */ +#define ROGUE_CR_RASTERISATION_PERF_INDIRECT 0x8318U +#define ROGUE_CR_RASTERISATION_PERF_INDIRECT_MASKFULL 0x000000000000000FULL +#define ROGUE_CR_RASTERISATION_PERF_INDIRECT_ADDRESS_SHIFT 0U +#define ROGUE_CR_RASTERISATION_PERF_INDIRECT_ADDRESS_CLRMSK 0xFFFFFFF0U + +/* Register ROGUE_CR_TPU_MCU_L0_PERF_INDIRECT */ +#define ROGUE_CR_TPU_MCU_L0_PERF_INDIRECT 0x8028U +#define ROGUE_CR_TPU_MCU_L0_PERF_INDIRECT_MASKFULL 0x0000000000000007ULL +#define ROGUE_CR_TPU_MCU_L0_PERF_INDIRECT_ADDRESS_SHIFT 0U +#define ROGUE_CR_TPU_MCU_L0_PERF_INDIRECT_ADDRESS_CLRMSK 0xFFFFFFF8U + +/* Register ROGUE_CR_USC_PERF_INDIRECT */ +#define ROGUE_CR_USC_PERF_INDIRECT 0x8030U +#define ROGUE_CR_USC_PERF_INDIRECT_MASKFULL 0x000000000000000FULL +#define ROGUE_CR_USC_PERF_INDIRECT_ADDRESS_SHIFT 0U +#define ROGUE_CR_USC_PERF_INDIRECT_ADDRESS_CLRMSK 0xFFFFFFF0U + +/* Register ROGUE_CR_BLACKPEARL_INDIRECT */ +#define ROGUE_CR_BLACKPEARL_INDIRECT 0x8388U +#define ROGUE_CR_BLACKPEARL_INDIRECT_MASKFULL 0x0000000000000003ULL +#define ROGUE_CR_BLACKPEARL_INDIRECT_ADDRESS_SHIFT 0U +#define ROGUE_CR_BLACKPEARL_INDIRECT_ADDRESS_CLRMSK 0xFFFFFFFCU + +/* Register ROGUE_CR_BLACKPEARL_PERF_INDIRECT */ +#define ROGUE_CR_BLACKPEARL_PERF_INDIRECT 0x83F8U +#define ROGUE_CR_BLACKPEARL_PERF_INDIRECT_MASKFULL 0x0000000000000003ULL +#define ROGUE_CR_BLACKPEARL_PERF_INDIRECT_ADDRESS_SHIFT 0U +#define ROGUE_CR_BLACKPEARL_PERF_INDIRECT_ADDRESS_CLRMSK 0xFFFFFFFCU + +/* Register ROGUE_CR_TEXAS3_PERF_INDIRECT */ +#define ROGUE_CR_TEXAS3_PERF_INDIRECT 0x83D0U +#define ROGUE_CR_TEXAS3_PERF_INDIRECT_MASKFULL 0x0000000000000007ULL +#define ROGUE_CR_TEXAS3_PERF_INDIRECT_ADDRESS_SHIFT 0U +#define ROGUE_CR_TEXAS3_PERF_INDIRECT_ADDRESS_CLRMSK 0xFFFFFFF8U + +/* Register ROGUE_CR_TEXAS_PERF_INDIRECT */ +#define ROGUE_CR_TEXAS_PERF_INDIRECT 0x8288U +#define ROGUE_CR_TEXAS_PERF_INDIRECT_MASKFULL 0x0000000000000003ULL +#define ROGUE_CR_TEXAS_PERF_INDIRECT_ADDRESS_SHIFT 0U +#define ROGUE_CR_TEXAS_PERF_INDIRECT_ADDRESS_CLRMSK 0xFFFFFFFCU + +/* Register ROGUE_CR_BX_TU_PERF_INDIRECT */ +#define ROGUE_CR_BX_TU_PERF_INDIRECT 0xC900U +#define ROGUE_CR_BX_TU_PERF_INDIRECT_MASKFULL 0x0000000000000003ULL +#define ROGUE_CR_BX_TU_PERF_INDIRECT_ADDRESS_SHIFT 0U +#define ROGUE_CR_BX_TU_PERF_INDIRECT_ADDRESS_CLRMSK 0xFFFFFFFCU + +/* Register ROGUE_CR_CLK_CTRL */ +#define ROGUE_CR_CLK_CTRL 0x0000U +#define ROGUE_CR_CLK_CTRL__PBE2_XE__MASKFULL 0xFFFFFF003F3FFFFFULL +#define ROGUE_CR_CLK_CTRL__S7_TOP__MASKFULL 0xCFCF03000F3F3F0FULL +#define ROGUE_CR_CLK_CTRL_MASKFULL 0xFFFFFF003F3FFFFFULL +#define ROGUE_CR_CLK_CTRL_BIF_TEXAS_SHIFT 62U +#define ROGUE_CR_CLK_CTRL_BIF_TEXAS_CLRMSK 0x3FFFFFFFFFFFFFFFULL +#define ROGUE_CR_CLK_CTRL_BIF_TEXAS_OFF 0x0000000000000000ULL +#define ROGUE_CR_CLK_CTRL_BIF_TEXAS_ON 0x4000000000000000ULL +#define ROGUE_CR_CLK_CTRL_BIF_TEXAS_AUTO 0x8000000000000000ULL +#define ROGUE_CR_CLK_CTRL_IPP_SHIFT 60U +#define ROGUE_CR_CLK_CTRL_IPP_CLRMSK 0xCFFFFFFFFFFFFFFFULL +#define ROGUE_CR_CLK_CTRL_IPP_OFF 0x0000000000000000ULL +#define ROGUE_CR_CLK_CTRL_IPP_ON 0x1000000000000000ULL +#define ROGUE_CR_CLK_CTRL_IPP_AUTO 0x2000000000000000ULL +#define ROGUE_CR_CLK_CTRL_FBC_SHIFT 58U +#define ROGUE_CR_CLK_CTRL_FBC_CLRMSK 0xF3FFFFFFFFFFFFFFULL +#define ROGUE_CR_CLK_CTRL_FBC_OFF 0x0000000000000000ULL +#define ROGUE_CR_CLK_CTRL_FBC_ON 0x0400000000000000ULL +#define ROGUE_CR_CLK_CTRL_FBC_AUTO 0x0800000000000000ULL +#define ROGUE_CR_CLK_CTRL_FBDC_SHIFT 56U +#define ROGUE_CR_CLK_CTRL_FBDC_CLRMSK 0xFCFFFFFFFFFFFFFFULL +#define ROGUE_CR_CLK_CTRL_FBDC_OFF 0x0000000000000000ULL +#define ROGUE_CR_CLK_CTRL_FBDC_ON 0x0100000000000000ULL +#define ROGUE_CR_CLK_CTRL_FBDC_AUTO 0x0200000000000000ULL +#define ROGUE_CR_CLK_CTRL_FB_TLCACHE_SHIFT 54U +#define ROGUE_CR_CLK_CTRL_FB_TLCACHE_CLRMSK 0xFF3FFFFFFFFFFFFFULL +#define ROGUE_CR_CLK_CTRL_FB_TLCACHE_OFF 0x0000000000000000ULL +#define ROGUE_CR_CLK_CTRL_FB_TLCACHE_ON 0x0040000000000000ULL +#define ROGUE_CR_CLK_CTRL_FB_TLCACHE_AUTO 0x0080000000000000ULL +#define ROGUE_CR_CLK_CTRL_USCS_SHIFT 52U +#define ROGUE_CR_CLK_CTRL_USCS_CLRMSK 0xFFCFFFFFFFFFFFFFULL +#define ROGUE_CR_CLK_CTRL_USCS_OFF 0x0000000000000000ULL +#define ROGUE_CR_CLK_CTRL_USCS_ON 0x0010000000000000ULL +#define ROGUE_CR_CLK_CTRL_USCS_AUTO 0x0020000000000000ULL +#define ROGUE_CR_CLK_CTRL_PBE_SHIFT 50U +#define ROGUE_CR_CLK_CTRL_PBE_CLRMSK 0xFFF3FFFFFFFFFFFFULL +#define ROGUE_CR_CLK_CTRL_PBE_OFF 0x0000000000000000ULL +#define ROGUE_CR_CLK_CTRL_PBE_ON 0x0004000000000000ULL +#define ROGUE_CR_CLK_CTRL_PBE_AUTO 0x0008000000000000ULL +#define ROGUE_CR_CLK_CTRL_MCU_L1_SHIFT 48U +#define ROGUE_CR_CLK_CTRL_MCU_L1_CLRMSK 0xFFFCFFFFFFFFFFFFULL +#define ROGUE_CR_CLK_CTRL_MCU_L1_OFF 0x0000000000000000ULL +#define ROGUE_CR_CLK_CTRL_MCU_L1_ON 0x0001000000000000ULL +#define ROGUE_CR_CLK_CTRL_MCU_L1_AUTO 0x0002000000000000ULL +#define ROGUE_CR_CLK_CTRL_CDM_SHIFT 46U +#define ROGUE_CR_CLK_CTRL_CDM_CLRMSK 0xFFFF3FFFFFFFFFFFULL +#define ROGUE_CR_CLK_CTRL_CDM_OFF 0x0000000000000000ULL +#define ROGUE_CR_CLK_CTRL_CDM_ON 0x0000400000000000ULL +#define ROGUE_CR_CLK_CTRL_CDM_AUTO 0x0000800000000000ULL +#define ROGUE_CR_CLK_CTRL_SIDEKICK_SHIFT 44U +#define ROGUE_CR_CLK_CTRL_SIDEKICK_CLRMSK 0xFFFFCFFFFFFFFFFFULL +#define ROGUE_CR_CLK_CTRL_SIDEKICK_OFF 0x0000000000000000ULL +#define ROGUE_CR_CLK_CTRL_SIDEKICK_ON 0x0000100000000000ULL +#define ROGUE_CR_CLK_CTRL_SIDEKICK_AUTO 0x0000200000000000ULL +#define ROGUE_CR_CLK_CTRL_BIF_SIDEKICK_SHIFT 42U +#define ROGUE_CR_CLK_CTRL_BIF_SIDEKICK_CLRMSK 0xFFFFF3FFFFFFFFFFULL +#define ROGUE_CR_CLK_CTRL_BIF_SIDEKICK_OFF 0x0000000000000000ULL +#define ROGUE_CR_CLK_CTRL_BIF_SIDEKICK_ON 0x0000040000000000ULL +#define ROGUE_CR_CLK_CTRL_BIF_SIDEKICK_AUTO 0x0000080000000000ULL +#define ROGUE_CR_CLK_CTRL_BIF_SHIFT 40U +#define ROGUE_CR_CLK_CTRL_BIF_CLRMSK 0xFFFFFCFFFFFFFFFFULL +#define ROGUE_CR_CLK_CTRL_BIF_OFF 0x0000000000000000ULL +#define ROGUE_CR_CLK_CTRL_BIF_ON 0x0000010000000000ULL +#define ROGUE_CR_CLK_CTRL_BIF_AUTO 0x0000020000000000ULL +#define ROGUE_CR_CLK_CTRL_TPU_MCU_DEMUX_SHIFT 28U +#define ROGUE_CR_CLK_CTRL_TPU_MCU_DEMUX_CLRMSK 0xFFFFFFFFCFFFFFFFULL +#define ROGUE_CR_CLK_CTRL_TPU_MCU_DEMUX_OFF 0x0000000000000000ULL +#define ROGUE_CR_CLK_CTRL_TPU_MCU_DEMUX_ON 0x0000000010000000ULL +#define ROGUE_CR_CLK_CTRL_TPU_MCU_DEMUX_AUTO 0x0000000020000000ULL +#define ROGUE_CR_CLK_CTRL_MCU_L0_SHIFT 26U +#define ROGUE_CR_CLK_CTRL_MCU_L0_CLRMSK 0xFFFFFFFFF3FFFFFFULL +#define ROGUE_CR_CLK_CTRL_MCU_L0_OFF 0x0000000000000000ULL +#define ROGUE_CR_CLK_CTRL_MCU_L0_ON 0x0000000004000000ULL +#define ROGUE_CR_CLK_CTRL_MCU_L0_AUTO 0x0000000008000000ULL +#define ROGUE_CR_CLK_CTRL_TPU_SHIFT 24U +#define ROGUE_CR_CLK_CTRL_TPU_CLRMSK 0xFFFFFFFFFCFFFFFFULL +#define ROGUE_CR_CLK_CTRL_TPU_OFF 0x0000000000000000ULL +#define ROGUE_CR_CLK_CTRL_TPU_ON 0x0000000001000000ULL +#define ROGUE_CR_CLK_CTRL_TPU_AUTO 0x0000000002000000ULL +#define ROGUE_CR_CLK_CTRL_USC_SHIFT 20U +#define ROGUE_CR_CLK_CTRL_USC_CLRMSK 0xFFFFFFFFFFCFFFFFULL +#define ROGUE_CR_CLK_CTRL_USC_OFF 0x0000000000000000ULL +#define ROGUE_CR_CLK_CTRL_USC_ON 0x0000000000100000ULL +#define ROGUE_CR_CLK_CTRL_USC_AUTO 0x0000000000200000ULL +#define ROGUE_CR_CLK_CTRL_TLA_SHIFT 18U +#define ROGUE_CR_CLK_CTRL_TLA_CLRMSK 0xFFFFFFFFFFF3FFFFULL +#define ROGUE_CR_CLK_CTRL_TLA_OFF 0x0000000000000000ULL +#define ROGUE_CR_CLK_CTRL_TLA_ON 0x0000000000040000ULL +#define ROGUE_CR_CLK_CTRL_TLA_AUTO 0x0000000000080000ULL +#define ROGUE_CR_CLK_CTRL_SLC_SHIFT 16U +#define ROGUE_CR_CLK_CTRL_SLC_CLRMSK 0xFFFFFFFFFFFCFFFFULL +#define ROGUE_CR_CLK_CTRL_SLC_OFF 0x0000000000000000ULL +#define ROGUE_CR_CLK_CTRL_SLC_ON 0x0000000000010000ULL +#define ROGUE_CR_CLK_CTRL_SLC_AUTO 0x0000000000020000ULL +#define ROGUE_CR_CLK_CTRL_UVS_SHIFT 14U +#define ROGUE_CR_CLK_CTRL_UVS_CLRMSK 0xFFFFFFFFFFFF3FFFULL +#define ROGUE_CR_CLK_CTRL_UVS_OFF 0x0000000000000000ULL +#define ROGUE_CR_CLK_CTRL_UVS_ON 0x0000000000004000ULL +#define ROGUE_CR_CLK_CTRL_UVS_AUTO 0x0000000000008000ULL +#define ROGUE_CR_CLK_CTRL_PDS_SHIFT 12U +#define ROGUE_CR_CLK_CTRL_PDS_CLRMSK 0xFFFFFFFFFFFFCFFFULL +#define ROGUE_CR_CLK_CTRL_PDS_OFF 0x0000000000000000ULL +#define ROGUE_CR_CLK_CTRL_PDS_ON 0x0000000000001000ULL +#define ROGUE_CR_CLK_CTRL_PDS_AUTO 0x0000000000002000ULL +#define ROGUE_CR_CLK_CTRL_VDM_SHIFT 10U +#define ROGUE_CR_CLK_CTRL_VDM_CLRMSK 0xFFFFFFFFFFFFF3FFULL +#define ROGUE_CR_CLK_CTRL_VDM_OFF 0x0000000000000000ULL +#define ROGUE_CR_CLK_CTRL_VDM_ON 0x0000000000000400ULL +#define ROGUE_CR_CLK_CTRL_VDM_AUTO 0x0000000000000800ULL +#define ROGUE_CR_CLK_CTRL_PM_SHIFT 8U +#define ROGUE_CR_CLK_CTRL_PM_CLRMSK 0xFFFFFFFFFFFFFCFFULL +#define ROGUE_CR_CLK_CTRL_PM_OFF 0x0000000000000000ULL +#define ROGUE_CR_CLK_CTRL_PM_ON 0x0000000000000100ULL +#define ROGUE_CR_CLK_CTRL_PM_AUTO 0x0000000000000200ULL +#define ROGUE_CR_CLK_CTRL_GPP_SHIFT 6U +#define ROGUE_CR_CLK_CTRL_GPP_CLRMSK 0xFFFFFFFFFFFFFF3FULL +#define ROGUE_CR_CLK_CTRL_GPP_OFF 0x0000000000000000ULL +#define ROGUE_CR_CLK_CTRL_GPP_ON 0x0000000000000040ULL +#define ROGUE_CR_CLK_CTRL_GPP_AUTO 0x0000000000000080ULL +#define ROGUE_CR_CLK_CTRL_TE_SHIFT 4U +#define ROGUE_CR_CLK_CTRL_TE_CLRMSK 0xFFFFFFFFFFFFFFCFULL +#define ROGUE_CR_CLK_CTRL_TE_OFF 0x0000000000000000ULL +#define ROGUE_CR_CLK_CTRL_TE_ON 0x0000000000000010ULL +#define ROGUE_CR_CLK_CTRL_TE_AUTO 0x0000000000000020ULL +#define ROGUE_CR_CLK_CTRL_TSP_SHIFT 2U +#define ROGUE_CR_CLK_CTRL_TSP_CLRMSK 0xFFFFFFFFFFFFFFF3ULL +#define ROGUE_CR_CLK_CTRL_TSP_OFF 0x0000000000000000ULL +#define ROGUE_CR_CLK_CTRL_TSP_ON 0x0000000000000004ULL +#define ROGUE_CR_CLK_CTRL_TSP_AUTO 0x0000000000000008ULL +#define ROGUE_CR_CLK_CTRL_ISP_SHIFT 0U +#define ROGUE_CR_CLK_CTRL_ISP_CLRMSK 0xFFFFFFFFFFFFFFFCULL +#define ROGUE_CR_CLK_CTRL_ISP_OFF 0x0000000000000000ULL +#define ROGUE_CR_CLK_CTRL_ISP_ON 0x0000000000000001ULL +#define ROGUE_CR_CLK_CTRL_ISP_AUTO 0x0000000000000002ULL + +/* Register ROGUE_CR_CLK_STATUS */ +#define ROGUE_CR_CLK_STATUS 0x0008U +#define ROGUE_CR_CLK_STATUS__PBE2_XE__MASKFULL 0x00000001FFF077FFULL +#define ROGUE_CR_CLK_STATUS__S7_TOP__MASKFULL 0x00000001B3101773ULL +#define ROGUE_CR_CLK_STATUS_MASKFULL 0x00000001FFF077FFULL +#define ROGUE_CR_CLK_STATUS_MCU_FBTC_SHIFT 32U +#define ROGUE_CR_CLK_STATUS_MCU_FBTC_CLRMSK 0xFFFFFFFEFFFFFFFFULL +#define ROGUE_CR_CLK_STATUS_MCU_FBTC_GATED 0x0000000000000000ULL +#define ROGUE_CR_CLK_STATUS_MCU_FBTC_RUNNING 0x0000000100000000ULL +#define ROGUE_CR_CLK_STATUS_BIF_TEXAS_SHIFT 31U +#define ROGUE_CR_CLK_STATUS_BIF_TEXAS_CLRMSK 0xFFFFFFFF7FFFFFFFULL +#define ROGUE_CR_CLK_STATUS_BIF_TEXAS_GATED 0x0000000000000000ULL +#define ROGUE_CR_CLK_STATUS_BIF_TEXAS_RUNNING 0x0000000080000000ULL +#define ROGUE_CR_CLK_STATUS_IPP_SHIFT 30U +#define ROGUE_CR_CLK_STATUS_IPP_CLRMSK 0xFFFFFFFFBFFFFFFFULL +#define ROGUE_CR_CLK_STATUS_IPP_GATED 0x0000000000000000ULL +#define ROGUE_CR_CLK_STATUS_IPP_RUNNING 0x0000000040000000ULL +#define ROGUE_CR_CLK_STATUS_FBC_SHIFT 29U +#define ROGUE_CR_CLK_STATUS_FBC_CLRMSK 0xFFFFFFFFDFFFFFFFULL +#define ROGUE_CR_CLK_STATUS_FBC_GATED 0x0000000000000000ULL +#define ROGUE_CR_CLK_STATUS_FBC_RUNNING 0x0000000020000000ULL +#define ROGUE_CR_CLK_STATUS_FBDC_SHIFT 28U +#define ROGUE_CR_CLK_STATUS_FBDC_CLRMSK 0xFFFFFFFFEFFFFFFFULL +#define ROGUE_CR_CLK_STATUS_FBDC_GATED 0x0000000000000000ULL +#define ROGUE_CR_CLK_STATUS_FBDC_RUNNING 0x0000000010000000ULL +#define ROGUE_CR_CLK_STATUS_FB_TLCACHE_SHIFT 27U +#define ROGUE_CR_CLK_STATUS_FB_TLCACHE_CLRMSK 0xFFFFFFFFF7FFFFFFULL +#define ROGUE_CR_CLK_STATUS_FB_TLCACHE_GATED 0x0000000000000000ULL +#define ROGUE_CR_CLK_STATUS_FB_TLCACHE_RUNNING 0x0000000008000000ULL +#define ROGUE_CR_CLK_STATUS_USCS_SHIFT 26U +#define ROGUE_CR_CLK_STATUS_USCS_CLRMSK 0xFFFFFFFFFBFFFFFFULL +#define ROGUE_CR_CLK_STATUS_USCS_GATED 0x0000000000000000ULL +#define ROGUE_CR_CLK_STATUS_USCS_RUNNING 0x0000000004000000ULL +#define ROGUE_CR_CLK_STATUS_PBE_SHIFT 25U +#define ROGUE_CR_CLK_STATUS_PBE_CLRMSK 0xFFFFFFFFFDFFFFFFULL +#define ROGUE_CR_CLK_STATUS_PBE_GATED 0x0000000000000000ULL +#define ROGUE_CR_CLK_STATUS_PBE_RUNNING 0x0000000002000000ULL +#define ROGUE_CR_CLK_STATUS_MCU_L1_SHIFT 24U +#define ROGUE_CR_CLK_STATUS_MCU_L1_CLRMSK 0xFFFFFFFFFEFFFFFFULL +#define ROGUE_CR_CLK_STATUS_MCU_L1_GATED 0x0000000000000000ULL +#define ROGUE_CR_CLK_STATUS_MCU_L1_RUNNING 0x0000000001000000ULL +#define ROGUE_CR_CLK_STATUS_CDM_SHIFT 23U +#define ROGUE_CR_CLK_STATUS_CDM_CLRMSK 0xFFFFFFFFFF7FFFFFULL +#define ROGUE_CR_CLK_STATUS_CDM_GATED 0x0000000000000000ULL +#define ROGUE_CR_CLK_STATUS_CDM_RUNNING 0x0000000000800000ULL +#define ROGUE_CR_CLK_STATUS_SIDEKICK_SHIFT 22U +#define ROGUE_CR_CLK_STATUS_SIDEKICK_CLRMSK 0xFFFFFFFFFFBFFFFFULL +#define ROGUE_CR_CLK_STATUS_SIDEKICK_GATED 0x0000000000000000ULL +#define ROGUE_CR_CLK_STATUS_SIDEKICK_RUNNING 0x0000000000400000ULL +#define ROGUE_CR_CLK_STATUS_BIF_SIDEKICK_SHIFT 21U +#define ROGUE_CR_CLK_STATUS_BIF_SIDEKICK_CLRMSK 0xFFFFFFFFFFDFFFFFULL +#define ROGUE_CR_CLK_STATUS_BIF_SIDEKICK_GATED 0x0000000000000000ULL +#define ROGUE_CR_CLK_STATUS_BIF_SIDEKICK_RUNNING 0x0000000000200000ULL +#define ROGUE_CR_CLK_STATUS_BIF_SHIFT 20U +#define ROGUE_CR_CLK_STATUS_BIF_CLRMSK 0xFFFFFFFFFFEFFFFFULL +#define ROGUE_CR_CLK_STATUS_BIF_GATED 0x0000000000000000ULL +#define ROGUE_CR_CLK_STATUS_BIF_RUNNING 0x0000000000100000ULL +#define ROGUE_CR_CLK_STATUS_TPU_MCU_DEMUX_SHIFT 14U +#define ROGUE_CR_CLK_STATUS_TPU_MCU_DEMUX_CLRMSK 0xFFFFFFFFFFFFBFFFULL +#define ROGUE_CR_CLK_STATUS_TPU_MCU_DEMUX_GATED 0x0000000000000000ULL +#define ROGUE_CR_CLK_STATUS_TPU_MCU_DEMUX_RUNNING 0x0000000000004000ULL +#define ROGUE_CR_CLK_STATUS_MCU_L0_SHIFT 13U +#define ROGUE_CR_CLK_STATUS_MCU_L0_CLRMSK 0xFFFFFFFFFFFFDFFFULL +#define ROGUE_CR_CLK_STATUS_MCU_L0_GATED 0x0000000000000000ULL +#define ROGUE_CR_CLK_STATUS_MCU_L0_RUNNING 0x0000000000002000ULL +#define ROGUE_CR_CLK_STATUS_TPU_SHIFT 12U +#define ROGUE_CR_CLK_STATUS_TPU_CLRMSK 0xFFFFFFFFFFFFEFFFULL +#define ROGUE_CR_CLK_STATUS_TPU_GATED 0x0000000000000000ULL +#define ROGUE_CR_CLK_STATUS_TPU_RUNNING 0x0000000000001000ULL +#define ROGUE_CR_CLK_STATUS_USC_SHIFT 10U +#define ROGUE_CR_CLK_STATUS_USC_CLRMSK 0xFFFFFFFFFFFFFBFFULL +#define ROGUE_CR_CLK_STATUS_USC_GATED 0x0000000000000000ULL +#define ROGUE_CR_CLK_STATUS_USC_RUNNING 0x0000000000000400ULL +#define ROGUE_CR_CLK_STATUS_TLA_SHIFT 9U +#define ROGUE_CR_CLK_STATUS_TLA_CLRMSK 0xFFFFFFFFFFFFFDFFULL +#define ROGUE_CR_CLK_STATUS_TLA_GATED 0x0000000000000000ULL +#define ROGUE_CR_CLK_STATUS_TLA_RUNNING 0x0000000000000200ULL +#define ROGUE_CR_CLK_STATUS_SLC_SHIFT 8U +#define ROGUE_CR_CLK_STATUS_SLC_CLRMSK 0xFFFFFFFFFFFFFEFFULL +#define ROGUE_CR_CLK_STATUS_SLC_GATED 0x0000000000000000ULL +#define ROGUE_CR_CLK_STATUS_SLC_RUNNING 0x0000000000000100ULL +#define ROGUE_CR_CLK_STATUS_UVS_SHIFT 7U +#define ROGUE_CR_CLK_STATUS_UVS_CLRMSK 0xFFFFFFFFFFFFFF7FULL +#define ROGUE_CR_CLK_STATUS_UVS_GATED 0x0000000000000000ULL +#define ROGUE_CR_CLK_STATUS_UVS_RUNNING 0x0000000000000080ULL +#define ROGUE_CR_CLK_STATUS_PDS_SHIFT 6U +#define ROGUE_CR_CLK_STATUS_PDS_CLRMSK 0xFFFFFFFFFFFFFFBFULL +#define ROGUE_CR_CLK_STATUS_PDS_GATED 0x0000000000000000ULL +#define ROGUE_CR_CLK_STATUS_PDS_RUNNING 0x0000000000000040ULL +#define ROGUE_CR_CLK_STATUS_VDM_SHIFT 5U +#define ROGUE_CR_CLK_STATUS_VDM_CLRMSK 0xFFFFFFFFFFFFFFDFULL +#define ROGUE_CR_CLK_STATUS_VDM_GATED 0x0000000000000000ULL +#define ROGUE_CR_CLK_STATUS_VDM_RUNNING 0x0000000000000020ULL +#define ROGUE_CR_CLK_STATUS_PM_SHIFT 4U +#define ROGUE_CR_CLK_STATUS_PM_CLRMSK 0xFFFFFFFFFFFFFFEFULL +#define ROGUE_CR_CLK_STATUS_PM_GATED 0x0000000000000000ULL +#define ROGUE_CR_CLK_STATUS_PM_RUNNING 0x0000000000000010ULL +#define ROGUE_CR_CLK_STATUS_GPP_SHIFT 3U +#define ROGUE_CR_CLK_STATUS_GPP_CLRMSK 0xFFFFFFFFFFFFFFF7ULL +#define ROGUE_CR_CLK_STATUS_GPP_GATED 0x0000000000000000ULL +#define ROGUE_CR_CLK_STATUS_GPP_RUNNING 0x0000000000000008ULL +#define ROGUE_CR_CLK_STATUS_TE_SHIFT 2U +#define ROGUE_CR_CLK_STATUS_TE_CLRMSK 0xFFFFFFFFFFFFFFFBULL +#define ROGUE_CR_CLK_STATUS_TE_GATED 0x0000000000000000ULL +#define ROGUE_CR_CLK_STATUS_TE_RUNNING 0x0000000000000004ULL +#define ROGUE_CR_CLK_STATUS_TSP_SHIFT 1U +#define ROGUE_CR_CLK_STATUS_TSP_CLRMSK 0xFFFFFFFFFFFFFFFDULL +#define ROGUE_CR_CLK_STATUS_TSP_GATED 0x0000000000000000ULL +#define ROGUE_CR_CLK_STATUS_TSP_RUNNING 0x0000000000000002ULL +#define ROGUE_CR_CLK_STATUS_ISP_SHIFT 0U +#define ROGUE_CR_CLK_STATUS_ISP_CLRMSK 0xFFFFFFFFFFFFFFFEULL +#define ROGUE_CR_CLK_STATUS_ISP_GATED 0x0000000000000000ULL +#define ROGUE_CR_CLK_STATUS_ISP_RUNNING 0x0000000000000001ULL + +/* Register ROGUE_CR_CORE_ID */ +#define ROGUE_CR_CORE_ID__PBVNC 0x0020U +#define ROGUE_CR_CORE_ID__PBVNC__MASKFULL 0xFFFFFFFFFFFFFFFFULL +#define ROGUE_CR_CORE_ID__PBVNC__BRANCH_ID_SHIFT 48U +#define ROGUE_CR_CORE_ID__PBVNC__BRANCH_ID_CLRMSK 0x0000FFFFFFFFFFFFULL +#define ROGUE_CR_CORE_ID__PBVNC__VERSION_ID_SHIFT 32U +#define ROGUE_CR_CORE_ID__PBVNC__VERSION_ID_CLRMSK 0xFFFF0000FFFFFFFFULL +#define ROGUE_CR_CORE_ID__PBVNC__NUMBER_OF_SCALABLE_UNITS_SHIFT 16U +#define ROGUE_CR_CORE_ID__PBVNC__NUMBER_OF_SCALABLE_UNITS_CLRMSK 0xFFFFFFFF0000FFFFULL +#define ROGUE_CR_CORE_ID__PBVNC__CONFIG_ID_SHIFT 0U +#define ROGUE_CR_CORE_ID__PBVNC__CONFIG_ID_CLRMSK 0xFFFFFFFFFFFF0000ULL + +/* Register ROGUE_CR_CORE_ID */ +#define ROGUE_CR_CORE_ID 0x0018U +#define ROGUE_CR_CORE_ID_MASKFULL 0x00000000FFFFFFFFULL +#define ROGUE_CR_CORE_ID_ID_SHIFT 16U +#define ROGUE_CR_CORE_ID_ID_CLRMSK 0x0000FFFFU +#define ROGUE_CR_CORE_ID_CONFIG_SHIFT 0U +#define ROGUE_CR_CORE_ID_CONFIG_CLRMSK 0xFFFF0000U + +/* Register ROGUE_CR_CORE_REVISION */ +#define ROGUE_CR_CORE_REVISION 0x0020U +#define ROGUE_CR_CORE_REVISION_MASKFULL 0x00000000FFFFFFFFULL +#define ROGUE_CR_CORE_REVISION_DESIGNER_SHIFT 24U +#define ROGUE_CR_CORE_REVISION_DESIGNER_CLRMSK 0x00FFFFFFU +#define ROGUE_CR_CORE_REVISION_MAJOR_SHIFT 16U +#define ROGUE_CR_CORE_REVISION_MAJOR_CLRMSK 0xFF00FFFFU +#define ROGUE_CR_CORE_REVISION_MINOR_SHIFT 8U +#define ROGUE_CR_CORE_REVISION_MINOR_CLRMSK 0xFFFF00FFU +#define ROGUE_CR_CORE_REVISION_MAINTENANCE_SHIFT 0U +#define ROGUE_CR_CORE_REVISION_MAINTENANCE_CLRMSK 0xFFFFFF00U + +/* Register ROGUE_CR_DESIGNER_REV_FIELD1 */ +#define ROGUE_CR_DESIGNER_REV_FIELD1 0x0028U +#define ROGUE_CR_DESIGNER_REV_FIELD1_MASKFULL 0x00000000FFFFFFFFULL +#define ROGUE_CR_DESIGNER_REV_FIELD1_DESIGNER_REV_FIELD1_SHIFT 0U +#define ROGUE_CR_DESIGNER_REV_FIELD1_DESIGNER_REV_FIELD1_CLRMSK 0x00000000U + +/* Register ROGUE_CR_DESIGNER_REV_FIELD2 */ +#define ROGUE_CR_DESIGNER_REV_FIELD2 0x0030U +#define ROGUE_CR_DESIGNER_REV_FIELD2_MASKFULL 0x00000000FFFFFFFFULL +#define ROGUE_CR_DESIGNER_REV_FIELD2_DESIGNER_REV_FIELD2_SHIFT 0U +#define ROGUE_CR_DESIGNER_REV_FIELD2_DESIGNER_REV_FIELD2_CLRMSK 0x00000000U + +/* Register ROGUE_CR_CHANGESET_NUMBER */ +#define ROGUE_CR_CHANGESET_NUMBER 0x0040U +#define ROGUE_CR_CHANGESET_NUMBER_MASKFULL 0xFFFFFFFFFFFFFFFFULL +#define ROGUE_CR_CHANGESET_NUMBER_CHANGESET_NUMBER_SHIFT 0U +#define ROGUE_CR_CHANGESET_NUMBER_CHANGESET_NUMBER_CLRMSK 0x0000000000000000ULL + +/* Register ROGUE_CR_CLK_XTPLUS_CTRL */ +#define ROGUE_CR_CLK_XTPLUS_CTRL 0x0080U +#define ROGUE_CR_CLK_XTPLUS_CTRL_MASKFULL 0x0000003FFFFF0000ULL +#define ROGUE_CR_CLK_XTPLUS_CTRL_TDM_SHIFT 36U +#define ROGUE_CR_CLK_XTPLUS_CTRL_TDM_CLRMSK 0xFFFFFFCFFFFFFFFFULL +#define ROGUE_CR_CLK_XTPLUS_CTRL_TDM_OFF 0x0000000000000000ULL +#define ROGUE_CR_CLK_XTPLUS_CTRL_TDM_ON 0x0000001000000000ULL +#define ROGUE_CR_CLK_XTPLUS_CTRL_TDM_AUTO 0x0000002000000000ULL +#define ROGUE_CR_CLK_XTPLUS_CTRL_ASTC_SHIFT 34U +#define ROGUE_CR_CLK_XTPLUS_CTRL_ASTC_CLRMSK 0xFFFFFFF3FFFFFFFFULL +#define ROGUE_CR_CLK_XTPLUS_CTRL_ASTC_OFF 0x0000000000000000ULL +#define ROGUE_CR_CLK_XTPLUS_CTRL_ASTC_ON 0x0000000400000000ULL +#define ROGUE_CR_CLK_XTPLUS_CTRL_ASTC_AUTO 0x0000000800000000ULL +#define ROGUE_CR_CLK_XTPLUS_CTRL_IPF_SHIFT 32U +#define ROGUE_CR_CLK_XTPLUS_CTRL_IPF_CLRMSK 0xFFFFFFFCFFFFFFFFULL +#define ROGUE_CR_CLK_XTPLUS_CTRL_IPF_OFF 0x0000000000000000ULL +#define ROGUE_CR_CLK_XTPLUS_CTRL_IPF_ON 0x0000000100000000ULL +#define ROGUE_CR_CLK_XTPLUS_CTRL_IPF_AUTO 0x0000000200000000ULL +#define ROGUE_CR_CLK_XTPLUS_CTRL_COMPUTE_SHIFT 30U +#define ROGUE_CR_CLK_XTPLUS_CTRL_COMPUTE_CLRMSK 0xFFFFFFFF3FFFFFFFULL +#define ROGUE_CR_CLK_XTPLUS_CTRL_COMPUTE_OFF 0x0000000000000000ULL +#define ROGUE_CR_CLK_XTPLUS_CTRL_COMPUTE_ON 0x0000000040000000ULL +#define ROGUE_CR_CLK_XTPLUS_CTRL_COMPUTE_AUTO 0x0000000080000000ULL +#define ROGUE_CR_CLK_XTPLUS_CTRL_PIXEL_SHIFT 28U +#define ROGUE_CR_CLK_XTPLUS_CTRL_PIXEL_CLRMSK 0xFFFFFFFFCFFFFFFFULL +#define ROGUE_CR_CLK_XTPLUS_CTRL_PIXEL_OFF 0x0000000000000000ULL +#define ROGUE_CR_CLK_XTPLUS_CTRL_PIXEL_ON 0x0000000010000000ULL +#define ROGUE_CR_CLK_XTPLUS_CTRL_PIXEL_AUTO 0x0000000020000000ULL +#define ROGUE_CR_CLK_XTPLUS_CTRL_VERTEX_SHIFT 26U +#define ROGUE_CR_CLK_XTPLUS_CTRL_VERTEX_CLRMSK 0xFFFFFFFFF3FFFFFFULL +#define ROGUE_CR_CLK_XTPLUS_CTRL_VERTEX_OFF 0x0000000000000000ULL +#define ROGUE_CR_CLK_XTPLUS_CTRL_VERTEX_ON 0x0000000004000000ULL +#define ROGUE_CR_CLK_XTPLUS_CTRL_VERTEX_AUTO 0x0000000008000000ULL +#define ROGUE_CR_CLK_XTPLUS_CTRL_USCPS_SHIFT 24U +#define ROGUE_CR_CLK_XTPLUS_CTRL_USCPS_CLRMSK 0xFFFFFFFFFCFFFFFFULL +#define ROGUE_CR_CLK_XTPLUS_CTRL_USCPS_OFF 0x0000000000000000ULL +#define ROGUE_CR_CLK_XTPLUS_CTRL_USCPS_ON 0x0000000001000000ULL +#define ROGUE_CR_CLK_XTPLUS_CTRL_USCPS_AUTO 0x0000000002000000ULL +#define ROGUE_CR_CLK_XTPLUS_CTRL_PDS_SHARED_SHIFT 22U +#define ROGUE_CR_CLK_XTPLUS_CTRL_PDS_SHARED_CLRMSK 0xFFFFFFFFFF3FFFFFULL +#define ROGUE_CR_CLK_XTPLUS_CTRL_PDS_SHARED_OFF 0x0000000000000000ULL +#define ROGUE_CR_CLK_XTPLUS_CTRL_PDS_SHARED_ON 0x0000000000400000ULL +#define ROGUE_CR_CLK_XTPLUS_CTRL_PDS_SHARED_AUTO 0x0000000000800000ULL +#define ROGUE_CR_CLK_XTPLUS_CTRL_BIF_BLACKPEARL_SHIFT 20U +#define ROGUE_CR_CLK_XTPLUS_CTRL_BIF_BLACKPEARL_CLRMSK 0xFFFFFFFFFFCFFFFFULL +#define ROGUE_CR_CLK_XTPLUS_CTRL_BIF_BLACKPEARL_OFF 0x0000000000000000ULL +#define ROGUE_CR_CLK_XTPLUS_CTRL_BIF_BLACKPEARL_ON 0x0000000000100000ULL +#define ROGUE_CR_CLK_XTPLUS_CTRL_BIF_BLACKPEARL_AUTO 0x0000000000200000ULL +#define ROGUE_CR_CLK_XTPLUS_CTRL_USC_SHARED_SHIFT 18U +#define ROGUE_CR_CLK_XTPLUS_CTRL_USC_SHARED_CLRMSK 0xFFFFFFFFFFF3FFFFULL +#define ROGUE_CR_CLK_XTPLUS_CTRL_USC_SHARED_OFF 0x0000000000000000ULL +#define ROGUE_CR_CLK_XTPLUS_CTRL_USC_SHARED_ON 0x0000000000040000ULL +#define ROGUE_CR_CLK_XTPLUS_CTRL_USC_SHARED_AUTO 0x0000000000080000ULL +#define ROGUE_CR_CLK_XTPLUS_CTRL_GEOMETRY_SHIFT 16U +#define ROGUE_CR_CLK_XTPLUS_CTRL_GEOMETRY_CLRMSK 0xFFFFFFFFFFFCFFFFULL +#define ROGUE_CR_CLK_XTPLUS_CTRL_GEOMETRY_OFF 0x0000000000000000ULL +#define ROGUE_CR_CLK_XTPLUS_CTRL_GEOMETRY_ON 0x0000000000010000ULL +#define ROGUE_CR_CLK_XTPLUS_CTRL_GEOMETRY_AUTO 0x0000000000020000ULL + +/* Register ROGUE_CR_CLK_XTPLUS_STATUS */ +#define ROGUE_CR_CLK_XTPLUS_STATUS 0x0088U +#define ROGUE_CR_CLK_XTPLUS_STATUS_MASKFULL 0x00000000000007FFULL +#define ROGUE_CR_CLK_XTPLUS_STATUS_TDM_SHIFT 10U +#define ROGUE_CR_CLK_XTPLUS_STATUS_TDM_CLRMSK 0xFFFFFFFFFFFFFBFFULL +#define ROGUE_CR_CLK_XTPLUS_STATUS_TDM_GATED 0x0000000000000000ULL +#define ROGUE_CR_CLK_XTPLUS_STATUS_TDM_RUNNING 0x0000000000000400ULL +#define ROGUE_CR_CLK_XTPLUS_STATUS_IPF_SHIFT 9U +#define ROGUE_CR_CLK_XTPLUS_STATUS_IPF_CLRMSK 0xFFFFFFFFFFFFFDFFULL +#define ROGUE_CR_CLK_XTPLUS_STATUS_IPF_GATED 0x0000000000000000ULL +#define ROGUE_CR_CLK_XTPLUS_STATUS_IPF_RUNNING 0x0000000000000200ULL +#define ROGUE_CR_CLK_XTPLUS_STATUS_COMPUTE_SHIFT 8U +#define ROGUE_CR_CLK_XTPLUS_STATUS_COMPUTE_CLRMSK 0xFFFFFFFFFFFFFEFFULL +#define ROGUE_CR_CLK_XTPLUS_STATUS_COMPUTE_GATED 0x0000000000000000ULL +#define ROGUE_CR_CLK_XTPLUS_STATUS_COMPUTE_RUNNING 0x0000000000000100ULL +#define ROGUE_CR_CLK_XTPLUS_STATUS_ASTC_SHIFT 7U +#define ROGUE_CR_CLK_XTPLUS_STATUS_ASTC_CLRMSK 0xFFFFFFFFFFFFFF7FULL +#define ROGUE_CR_CLK_XTPLUS_STATUS_ASTC_GATED 0x0000000000000000ULL +#define ROGUE_CR_CLK_XTPLUS_STATUS_ASTC_RUNNING 0x0000000000000080ULL +#define ROGUE_CR_CLK_XTPLUS_STATUS_PIXEL_SHIFT 6U +#define ROGUE_CR_CLK_XTPLUS_STATUS_PIXEL_CLRMSK 0xFFFFFFFFFFFFFFBFULL +#define ROGUE_CR_CLK_XTPLUS_STATUS_PIXEL_GATED 0x0000000000000000ULL +#define ROGUE_CR_CLK_XTPLUS_STATUS_PIXEL_RUNNING 0x0000000000000040ULL +#define ROGUE_CR_CLK_XTPLUS_STATUS_VERTEX_SHIFT 5U +#define ROGUE_CR_CLK_XTPLUS_STATUS_VERTEX_CLRMSK 0xFFFFFFFFFFFFFFDFULL +#define ROGUE_CR_CLK_XTPLUS_STATUS_VERTEX_GATED 0x0000000000000000ULL +#define ROGUE_CR_CLK_XTPLUS_STATUS_VERTEX_RUNNING 0x0000000000000020ULL +#define ROGUE_CR_CLK_XTPLUS_STATUS_USCPS_SHIFT 4U +#define ROGUE_CR_CLK_XTPLUS_STATUS_USCPS_CLRMSK 0xFFFFFFFFFFFFFFEFULL +#define ROGUE_CR_CLK_XTPLUS_STATUS_USCPS_GATED 0x0000000000000000ULL +#define ROGUE_CR_CLK_XTPLUS_STATUS_USCPS_RUNNING 0x0000000000000010ULL +#define ROGUE_CR_CLK_XTPLUS_STATUS_PDS_SHARED_SHIFT 3U +#define ROGUE_CR_CLK_XTPLUS_STATUS_PDS_SHARED_CLRMSK 0xFFFFFFFFFFFFFFF7ULL +#define ROGUE_CR_CLK_XTPLUS_STATUS_PDS_SHARED_GATED 0x0000000000000000ULL +#define ROGUE_CR_CLK_XTPLUS_STATUS_PDS_SHARED_RUNNING 0x0000000000000008ULL +#define ROGUE_CR_CLK_XTPLUS_STATUS_BIF_BLACKPEARL_SHIFT 2U +#define ROGUE_CR_CLK_XTPLUS_STATUS_BIF_BLACKPEARL_CLRMSK 0xFFFFFFFFFFFFFFFBULL +#define ROGUE_CR_CLK_XTPLUS_STATUS_BIF_BLACKPEARL_GATED 0x0000000000000000ULL +#define ROGUE_CR_CLK_XTPLUS_STATUS_BIF_BLACKPEARL_RUNNING 0x0000000000000004ULL +#define ROGUE_CR_CLK_XTPLUS_STATUS_USC_SHARED_SHIFT 1U +#define ROGUE_CR_CLK_XTPLUS_STATUS_USC_SHARED_CLRMSK 0xFFFFFFFFFFFFFFFDULL +#define ROGUE_CR_CLK_XTPLUS_STATUS_USC_SHARED_GATED 0x0000000000000000ULL +#define ROGUE_CR_CLK_XTPLUS_STATUS_USC_SHARED_RUNNING 0x0000000000000002ULL +#define ROGUE_CR_CLK_XTPLUS_STATUS_GEOMETRY_SHIFT 0U +#define ROGUE_CR_CLK_XTPLUS_STATUS_GEOMETRY_CLRMSK 0xFFFFFFFFFFFFFFFEULL +#define ROGUE_CR_CLK_XTPLUS_STATUS_GEOMETRY_GATED 0x0000000000000000ULL +#define ROGUE_CR_CLK_XTPLUS_STATUS_GEOMETRY_RUNNING 0x0000000000000001ULL + +/* Register ROGUE_CR_SOFT_RESET */ +#define ROGUE_CR_SOFT_RESET 0x0100U +#define ROGUE_CR_SOFT_RESET__PBE2_XE__MASKFULL 0xFFEFFFFFFFFFFC3DULL +#define ROGUE_CR_SOFT_RESET_MASKFULL 0x00E7FFFFFFFFFC3DULL +#define ROGUE_CR_SOFT_RESET_PHANTOM3_CORE_SHIFT 63U +#define ROGUE_CR_SOFT_RESET_PHANTOM3_CORE_CLRMSK 0x7FFFFFFFFFFFFFFFULL +#define ROGUE_CR_SOFT_RESET_PHANTOM3_CORE_EN 0x8000000000000000ULL +#define ROGUE_CR_SOFT_RESET_PHANTOM2_CORE_SHIFT 62U +#define ROGUE_CR_SOFT_RESET_PHANTOM2_CORE_CLRMSK 0xBFFFFFFFFFFFFFFFULL +#define ROGUE_CR_SOFT_RESET_PHANTOM2_CORE_EN 0x4000000000000000ULL +#define ROGUE_CR_SOFT_RESET_BERNADO2_CORE_SHIFT 61U +#define ROGUE_CR_SOFT_RESET_BERNADO2_CORE_CLRMSK 0xDFFFFFFFFFFFFFFFULL +#define ROGUE_CR_SOFT_RESET_BERNADO2_CORE_EN 0x2000000000000000ULL +#define ROGUE_CR_SOFT_RESET_JONES_CORE_SHIFT 60U +#define ROGUE_CR_SOFT_RESET_JONES_CORE_CLRMSK 0xEFFFFFFFFFFFFFFFULL +#define ROGUE_CR_SOFT_RESET_JONES_CORE_EN 0x1000000000000000ULL +#define ROGUE_CR_SOFT_RESET_TILING_CORE_SHIFT 59U +#define ROGUE_CR_SOFT_RESET_TILING_CORE_CLRMSK 0xF7FFFFFFFFFFFFFFULL +#define ROGUE_CR_SOFT_RESET_TILING_CORE_EN 0x0800000000000000ULL +#define ROGUE_CR_SOFT_RESET_TE3_SHIFT 58U +#define ROGUE_CR_SOFT_RESET_TE3_CLRMSK 0xFBFFFFFFFFFFFFFFULL +#define ROGUE_CR_SOFT_RESET_TE3_EN 0x0400000000000000ULL +#define ROGUE_CR_SOFT_RESET_VCE_SHIFT 57U +#define ROGUE_CR_SOFT_RESET_VCE_CLRMSK 0xFDFFFFFFFFFFFFFFULL +#define ROGUE_CR_SOFT_RESET_VCE_EN 0x0200000000000000ULL +#define ROGUE_CR_SOFT_RESET_VBS_SHIFT 56U +#define ROGUE_CR_SOFT_RESET_VBS_CLRMSK 0xFEFFFFFFFFFFFFFFULL +#define ROGUE_CR_SOFT_RESET_VBS_EN 0x0100000000000000ULL +#define ROGUE_CR_SOFT_RESET_DPX1_CORE_SHIFT 55U +#define ROGUE_CR_SOFT_RESET_DPX1_CORE_CLRMSK 0xFF7FFFFFFFFFFFFFULL +#define ROGUE_CR_SOFT_RESET_DPX1_CORE_EN 0x0080000000000000ULL +#define ROGUE_CR_SOFT_RESET_DPX0_CORE_SHIFT 54U +#define ROGUE_CR_SOFT_RESET_DPX0_CORE_CLRMSK 0xFFBFFFFFFFFFFFFFULL +#define ROGUE_CR_SOFT_RESET_DPX0_CORE_EN 0x0040000000000000ULL +#define ROGUE_CR_SOFT_RESET_FBA_SHIFT 53U +#define ROGUE_CR_SOFT_RESET_FBA_CLRMSK 0xFFDFFFFFFFFFFFFFULL +#define ROGUE_CR_SOFT_RESET_FBA_EN 0x0020000000000000ULL +#define ROGUE_CR_SOFT_RESET_FB_CDC_SHIFT 51U +#define ROGUE_CR_SOFT_RESET_FB_CDC_CLRMSK 0xFFF7FFFFFFFFFFFFULL +#define ROGUE_CR_SOFT_RESET_FB_CDC_EN 0x0008000000000000ULL +#define ROGUE_CR_SOFT_RESET_SH_SHIFT 50U +#define ROGUE_CR_SOFT_RESET_SH_CLRMSK 0xFFFBFFFFFFFFFFFFULL +#define ROGUE_CR_SOFT_RESET_SH_EN 0x0004000000000000ULL +#define ROGUE_CR_SOFT_RESET_VRDM_SHIFT 49U +#define ROGUE_CR_SOFT_RESET_VRDM_CLRMSK 0xFFFDFFFFFFFFFFFFULL +#define ROGUE_CR_SOFT_RESET_VRDM_EN 0x0002000000000000ULL +#define ROGUE_CR_SOFT_RESET_MCU_FBTC_SHIFT 48U +#define ROGUE_CR_SOFT_RESET_MCU_FBTC_CLRMSK 0xFFFEFFFFFFFFFFFFULL +#define ROGUE_CR_SOFT_RESET_MCU_FBTC_EN 0x0001000000000000ULL +#define ROGUE_CR_SOFT_RESET_PHANTOM1_CORE_SHIFT 47U +#define ROGUE_CR_SOFT_RESET_PHANTOM1_CORE_CLRMSK 0xFFFF7FFFFFFFFFFFULL +#define ROGUE_CR_SOFT_RESET_PHANTOM1_CORE_EN 0x0000800000000000ULL +#define ROGUE_CR_SOFT_RESET_PHANTOM0_CORE_SHIFT 46U +#define ROGUE_CR_SOFT_RESET_PHANTOM0_CORE_CLRMSK 0xFFFFBFFFFFFFFFFFULL +#define ROGUE_CR_SOFT_RESET_PHANTOM0_CORE_EN 0x0000400000000000ULL +#define ROGUE_CR_SOFT_RESET_BERNADO1_CORE_SHIFT 45U +#define ROGUE_CR_SOFT_RESET_BERNADO1_CORE_CLRMSK 0xFFFFDFFFFFFFFFFFULL +#define ROGUE_CR_SOFT_RESET_BERNADO1_CORE_EN 0x0000200000000000ULL +#define ROGUE_CR_SOFT_RESET_BERNADO0_CORE_SHIFT 44U +#define ROGUE_CR_SOFT_RESET_BERNADO0_CORE_CLRMSK 0xFFFFEFFFFFFFFFFFULL +#define ROGUE_CR_SOFT_RESET_BERNADO0_CORE_EN 0x0000100000000000ULL +#define ROGUE_CR_SOFT_RESET_IPP_SHIFT 43U +#define ROGUE_CR_SOFT_RESET_IPP_CLRMSK 0xFFFFF7FFFFFFFFFFULL +#define ROGUE_CR_SOFT_RESET_IPP_EN 0x0000080000000000ULL +#define ROGUE_CR_SOFT_RESET_BIF_TEXAS_SHIFT 42U +#define ROGUE_CR_SOFT_RESET_BIF_TEXAS_CLRMSK 0xFFFFFBFFFFFFFFFFULL +#define ROGUE_CR_SOFT_RESET_BIF_TEXAS_EN 0x0000040000000000ULL +#define ROGUE_CR_SOFT_RESET_TORNADO_CORE_SHIFT 41U +#define ROGUE_CR_SOFT_RESET_TORNADO_CORE_CLRMSK 0xFFFFFDFFFFFFFFFFULL +#define ROGUE_CR_SOFT_RESET_TORNADO_CORE_EN 0x0000020000000000ULL +#define ROGUE_CR_SOFT_RESET_DUST_H_CORE_SHIFT 40U +#define ROGUE_CR_SOFT_RESET_DUST_H_CORE_CLRMSK 0xFFFFFEFFFFFFFFFFULL +#define ROGUE_CR_SOFT_RESET_DUST_H_CORE_EN 0x0000010000000000ULL +#define ROGUE_CR_SOFT_RESET_DUST_G_CORE_SHIFT 39U +#define ROGUE_CR_SOFT_RESET_DUST_G_CORE_CLRMSK 0xFFFFFF7FFFFFFFFFULL +#define ROGUE_CR_SOFT_RESET_DUST_G_CORE_EN 0x0000008000000000ULL +#define ROGUE_CR_SOFT_RESET_DUST_F_CORE_SHIFT 38U +#define ROGUE_CR_SOFT_RESET_DUST_F_CORE_CLRMSK 0xFFFFFFBFFFFFFFFFULL +#define ROGUE_CR_SOFT_RESET_DUST_F_CORE_EN 0x0000004000000000ULL +#define ROGUE_CR_SOFT_RESET_DUST_E_CORE_SHIFT 37U +#define ROGUE_CR_SOFT_RESET_DUST_E_CORE_CLRMSK 0xFFFFFFDFFFFFFFFFULL +#define ROGUE_CR_SOFT_RESET_DUST_E_CORE_EN 0x0000002000000000ULL +#define ROGUE_CR_SOFT_RESET_DUST_D_CORE_SHIFT 36U +#define ROGUE_CR_SOFT_RESET_DUST_D_CORE_CLRMSK 0xFFFFFFEFFFFFFFFFULL +#define ROGUE_CR_SOFT_RESET_DUST_D_CORE_EN 0x0000001000000000ULL +#define ROGUE_CR_SOFT_RESET_DUST_C_CORE_SHIFT 35U +#define ROGUE_CR_SOFT_RESET_DUST_C_CORE_CLRMSK 0xFFFFFFF7FFFFFFFFULL +#define ROGUE_CR_SOFT_RESET_DUST_C_CORE_EN 0x0000000800000000ULL +#define ROGUE_CR_SOFT_RESET_MMU_SHIFT 34U +#define ROGUE_CR_SOFT_RESET_MMU_CLRMSK 0xFFFFFFFBFFFFFFFFULL +#define ROGUE_CR_SOFT_RESET_MMU_EN 0x0000000400000000ULL +#define ROGUE_CR_SOFT_RESET_BIF1_SHIFT 33U +#define ROGUE_CR_SOFT_RESET_BIF1_CLRMSK 0xFFFFFFFDFFFFFFFFULL +#define ROGUE_CR_SOFT_RESET_BIF1_EN 0x0000000200000000ULL +#define ROGUE_CR_SOFT_RESET_GARTEN_SHIFT 32U +#define ROGUE_CR_SOFT_RESET_GARTEN_CLRMSK 0xFFFFFFFEFFFFFFFFULL +#define ROGUE_CR_SOFT_RESET_GARTEN_EN 0x0000000100000000ULL +#define ROGUE_CR_SOFT_RESET_CPU_SHIFT 32U +#define ROGUE_CR_SOFT_RESET_CPU_CLRMSK 0xFFFFFFFEFFFFFFFFULL +#define ROGUE_CR_SOFT_RESET_CPU_EN 0x0000000100000000ULL +#define ROGUE_CR_SOFT_RESET_RASCAL_CORE_SHIFT 31U +#define ROGUE_CR_SOFT_RESET_RASCAL_CORE_CLRMSK 0xFFFFFFFF7FFFFFFFULL +#define ROGUE_CR_SOFT_RESET_RASCAL_CORE_EN 0x0000000080000000ULL +#define ROGUE_CR_SOFT_RESET_DUST_B_CORE_SHIFT 30U +#define ROGUE_CR_SOFT_RESET_DUST_B_CORE_CLRMSK 0xFFFFFFFFBFFFFFFFULL +#define ROGUE_CR_SOFT_RESET_DUST_B_CORE_EN 0x0000000040000000ULL +#define ROGUE_CR_SOFT_RESET_DUST_A_CORE_SHIFT 29U +#define ROGUE_CR_SOFT_RESET_DUST_A_CORE_CLRMSK 0xFFFFFFFFDFFFFFFFULL +#define ROGUE_CR_SOFT_RESET_DUST_A_CORE_EN 0x0000000020000000ULL +#define ROGUE_CR_SOFT_RESET_FB_TLCACHE_SHIFT 28U +#define ROGUE_CR_SOFT_RESET_FB_TLCACHE_CLRMSK 0xFFFFFFFFEFFFFFFFULL +#define ROGUE_CR_SOFT_RESET_FB_TLCACHE_EN 0x0000000010000000ULL +#define ROGUE_CR_SOFT_RESET_SLC_SHIFT 27U +#define ROGUE_CR_SOFT_RESET_SLC_CLRMSK 0xFFFFFFFFF7FFFFFFULL +#define ROGUE_CR_SOFT_RESET_SLC_EN 0x0000000008000000ULL +#define ROGUE_CR_SOFT_RESET_TLA_SHIFT 26U +#define ROGUE_CR_SOFT_RESET_TLA_CLRMSK 0xFFFFFFFFFBFFFFFFULL +#define ROGUE_CR_SOFT_RESET_TLA_EN 0x0000000004000000ULL +#define ROGUE_CR_SOFT_RESET_UVS_SHIFT 25U +#define ROGUE_CR_SOFT_RESET_UVS_CLRMSK 0xFFFFFFFFFDFFFFFFULL +#define ROGUE_CR_SOFT_RESET_UVS_EN 0x0000000002000000ULL +#define ROGUE_CR_SOFT_RESET_TE_SHIFT 24U +#define ROGUE_CR_SOFT_RESET_TE_CLRMSK 0xFFFFFFFFFEFFFFFFULL +#define ROGUE_CR_SOFT_RESET_TE_EN 0x0000000001000000ULL +#define ROGUE_CR_SOFT_RESET_GPP_SHIFT 23U +#define ROGUE_CR_SOFT_RESET_GPP_CLRMSK 0xFFFFFFFFFF7FFFFFULL +#define ROGUE_CR_SOFT_RESET_GPP_EN 0x0000000000800000ULL +#define ROGUE_CR_SOFT_RESET_FBDC_SHIFT 22U +#define ROGUE_CR_SOFT_RESET_FBDC_CLRMSK 0xFFFFFFFFFFBFFFFFULL +#define ROGUE_CR_SOFT_RESET_FBDC_EN 0x0000000000400000ULL +#define ROGUE_CR_SOFT_RESET_FBC_SHIFT 21U +#define ROGUE_CR_SOFT_RESET_FBC_CLRMSK 0xFFFFFFFFFFDFFFFFULL +#define ROGUE_CR_SOFT_RESET_FBC_EN 0x0000000000200000ULL +#define ROGUE_CR_SOFT_RESET_PM_SHIFT 20U +#define ROGUE_CR_SOFT_RESET_PM_CLRMSK 0xFFFFFFFFFFEFFFFFULL +#define ROGUE_CR_SOFT_RESET_PM_EN 0x0000000000100000ULL +#define ROGUE_CR_SOFT_RESET_PBE_SHIFT 19U +#define ROGUE_CR_SOFT_RESET_PBE_CLRMSK 0xFFFFFFFFFFF7FFFFULL +#define ROGUE_CR_SOFT_RESET_PBE_EN 0x0000000000080000ULL +#define ROGUE_CR_SOFT_RESET_USC_SHARED_SHIFT 18U +#define ROGUE_CR_SOFT_RESET_USC_SHARED_CLRMSK 0xFFFFFFFFFFFBFFFFULL +#define ROGUE_CR_SOFT_RESET_USC_SHARED_EN 0x0000000000040000ULL +#define ROGUE_CR_SOFT_RESET_MCU_L1_SHIFT 17U +#define ROGUE_CR_SOFT_RESET_MCU_L1_CLRMSK 0xFFFFFFFFFFFDFFFFULL +#define ROGUE_CR_SOFT_RESET_MCU_L1_EN 0x0000000000020000ULL +#define ROGUE_CR_SOFT_RESET_BIF_SHIFT 16U +#define ROGUE_CR_SOFT_RESET_BIF_CLRMSK 0xFFFFFFFFFFFEFFFFULL +#define ROGUE_CR_SOFT_RESET_BIF_EN 0x0000000000010000ULL +#define ROGUE_CR_SOFT_RESET_CDM_SHIFT 15U +#define ROGUE_CR_SOFT_RESET_CDM_CLRMSK 0xFFFFFFFFFFFF7FFFULL +#define ROGUE_CR_SOFT_RESET_CDM_EN 0x0000000000008000ULL +#define ROGUE_CR_SOFT_RESET_VDM_SHIFT 14U +#define ROGUE_CR_SOFT_RESET_VDM_CLRMSK 0xFFFFFFFFFFFFBFFFULL +#define ROGUE_CR_SOFT_RESET_VDM_EN 0x0000000000004000ULL +#define ROGUE_CR_SOFT_RESET_TESS_SHIFT 13U +#define ROGUE_CR_SOFT_RESET_TESS_CLRMSK 0xFFFFFFFFFFFFDFFFULL +#define ROGUE_CR_SOFT_RESET_TESS_EN 0x0000000000002000ULL +#define ROGUE_CR_SOFT_RESET_PDS_SHIFT 12U +#define ROGUE_CR_SOFT_RESET_PDS_CLRMSK 0xFFFFFFFFFFFFEFFFULL +#define ROGUE_CR_SOFT_RESET_PDS_EN 0x0000000000001000ULL +#define ROGUE_CR_SOFT_RESET_ISP_SHIFT 11U +#define ROGUE_CR_SOFT_RESET_ISP_CLRMSK 0xFFFFFFFFFFFFF7FFULL +#define ROGUE_CR_SOFT_RESET_ISP_EN 0x0000000000000800ULL +#define ROGUE_CR_SOFT_RESET_TSP_SHIFT 10U +#define ROGUE_CR_SOFT_RESET_TSP_CLRMSK 0xFFFFFFFFFFFFFBFFULL +#define ROGUE_CR_SOFT_RESET_TSP_EN 0x0000000000000400ULL +#define ROGUE_CR_SOFT_RESET_SYSARB_SHIFT 5U +#define ROGUE_CR_SOFT_RESET_SYSARB_CLRMSK 0xFFFFFFFFFFFFFFDFULL +#define ROGUE_CR_SOFT_RESET_SYSARB_EN 0x0000000000000020ULL +#define ROGUE_CR_SOFT_RESET_TPU_MCU_DEMUX_SHIFT 4U +#define ROGUE_CR_SOFT_RESET_TPU_MCU_DEMUX_CLRMSK 0xFFFFFFFFFFFFFFEFULL +#define ROGUE_CR_SOFT_RESET_TPU_MCU_DEMUX_EN 0x0000000000000010ULL +#define ROGUE_CR_SOFT_RESET_MCU_L0_SHIFT 3U +#define ROGUE_CR_SOFT_RESET_MCU_L0_CLRMSK 0xFFFFFFFFFFFFFFF7ULL +#define ROGUE_CR_SOFT_RESET_MCU_L0_EN 0x0000000000000008ULL +#define ROGUE_CR_SOFT_RESET_TPU_SHIFT 2U +#define ROGUE_CR_SOFT_RESET_TPU_CLRMSK 0xFFFFFFFFFFFFFFFBULL +#define ROGUE_CR_SOFT_RESET_TPU_EN 0x0000000000000004ULL +#define ROGUE_CR_SOFT_RESET_USC_SHIFT 0U +#define ROGUE_CR_SOFT_RESET_USC_CLRMSK 0xFFFFFFFFFFFFFFFEULL +#define ROGUE_CR_SOFT_RESET_USC_EN 0x0000000000000001ULL + +/* Register ROGUE_CR_SOFT_RESET2 */ +#define ROGUE_CR_SOFT_RESET2 0x0108U +#define ROGUE_CR_SOFT_RESET2_MASKFULL 0x00000000001FFFFFULL +#define ROGUE_CR_SOFT_RESET2_SPFILTER_SHIFT 12U +#define ROGUE_CR_SOFT_RESET2_SPFILTER_CLRMSK 0xFFE00FFFU +#define ROGUE_CR_SOFT_RESET2_TDM_SHIFT 11U +#define ROGUE_CR_SOFT_RESET2_TDM_CLRMSK 0xFFFFF7FFU +#define ROGUE_CR_SOFT_RESET2_TDM_EN 0x00000800U +#define ROGUE_CR_SOFT_RESET2_ASTC_SHIFT 10U +#define ROGUE_CR_SOFT_RESET2_ASTC_CLRMSK 0xFFFFFBFFU +#define ROGUE_CR_SOFT_RESET2_ASTC_EN 0x00000400U +#define ROGUE_CR_SOFT_RESET2_BLACKPEARL_SHIFT 9U +#define ROGUE_CR_SOFT_RESET2_BLACKPEARL_CLRMSK 0xFFFFFDFFU +#define ROGUE_CR_SOFT_RESET2_BLACKPEARL_EN 0x00000200U +#define ROGUE_CR_SOFT_RESET2_USCPS_SHIFT 8U +#define ROGUE_CR_SOFT_RESET2_USCPS_CLRMSK 0xFFFFFEFFU +#define ROGUE_CR_SOFT_RESET2_USCPS_EN 0x00000100U +#define ROGUE_CR_SOFT_RESET2_IPF_SHIFT 7U +#define ROGUE_CR_SOFT_RESET2_IPF_CLRMSK 0xFFFFFF7FU +#define ROGUE_CR_SOFT_RESET2_IPF_EN 0x00000080U +#define ROGUE_CR_SOFT_RESET2_GEOMETRY_SHIFT 6U +#define ROGUE_CR_SOFT_RESET2_GEOMETRY_CLRMSK 0xFFFFFFBFU +#define ROGUE_CR_SOFT_RESET2_GEOMETRY_EN 0x00000040U +#define ROGUE_CR_SOFT_RESET2_USC_SHARED_SHIFT 5U +#define ROGUE_CR_SOFT_RESET2_USC_SHARED_CLRMSK 0xFFFFFFDFU +#define ROGUE_CR_SOFT_RESET2_USC_SHARED_EN 0x00000020U +#define ROGUE_CR_SOFT_RESET2_PDS_SHARED_SHIFT 4U +#define ROGUE_CR_SOFT_RESET2_PDS_SHARED_CLRMSK 0xFFFFFFEFU +#define ROGUE_CR_SOFT_RESET2_PDS_SHARED_EN 0x00000010U +#define ROGUE_CR_SOFT_RESET2_BIF_BLACKPEARL_SHIFT 3U +#define ROGUE_CR_SOFT_RESET2_BIF_BLACKPEARL_CLRMSK 0xFFFFFFF7U +#define ROGUE_CR_SOFT_RESET2_BIF_BLACKPEARL_EN 0x00000008U +#define ROGUE_CR_SOFT_RESET2_PIXEL_SHIFT 2U +#define ROGUE_CR_SOFT_RESET2_PIXEL_CLRMSK 0xFFFFFFFBU +#define ROGUE_CR_SOFT_RESET2_PIXEL_EN 0x00000004U +#define ROGUE_CR_SOFT_RESET2_CDM_SHIFT 1U +#define ROGUE_CR_SOFT_RESET2_CDM_CLRMSK 0xFFFFFFFDU +#define ROGUE_CR_SOFT_RESET2_CDM_EN 0x00000002U +#define ROGUE_CR_SOFT_RESET2_VERTEX_SHIFT 0U +#define ROGUE_CR_SOFT_RESET2_VERTEX_CLRMSK 0xFFFFFFFEU +#define ROGUE_CR_SOFT_RESET2_VERTEX_EN 0x00000001U + +/* Register ROGUE_CR_EVENT_STATUS */ +#define ROGUE_CR_EVENT_STATUS 0x0130U +#define ROGUE_CR_EVENT_STATUS__ROGUEXE__MASKFULL 0x00000000E01DFFFFULL +#define ROGUE_CR_EVENT_STATUS__SIGNALS__MASKFULL 0x00000000E007FFFFULL +#define ROGUE_CR_EVENT_STATUS_MASKFULL 0x00000000FFFFFFFFULL +#define ROGUE_CR_EVENT_STATUS_TDM_FENCE_FINISHED_SHIFT 31U +#define ROGUE_CR_EVENT_STATUS_TDM_FENCE_FINISHED_CLRMSK 0x7FFFFFFFU +#define ROGUE_CR_EVENT_STATUS_TDM_FENCE_FINISHED_EN 0x80000000U +#define ROGUE_CR_EVENT_STATUS_TDM_BUFFER_STALL_SHIFT 30U +#define ROGUE_CR_EVENT_STATUS_TDM_BUFFER_STALL_CLRMSK 0xBFFFFFFFU +#define ROGUE_CR_EVENT_STATUS_TDM_BUFFER_STALL_EN 0x40000000U +#define ROGUE_CR_EVENT_STATUS_COMPUTE_SIGNAL_FAILURE_SHIFT 29U +#define ROGUE_CR_EVENT_STATUS_COMPUTE_SIGNAL_FAILURE_CLRMSK 0xDFFFFFFFU +#define ROGUE_CR_EVENT_STATUS_COMPUTE_SIGNAL_FAILURE_EN 0x20000000U +#define ROGUE_CR_EVENT_STATUS_DPX_OUT_OF_MEMORY_SHIFT 28U +#define ROGUE_CR_EVENT_STATUS_DPX_OUT_OF_MEMORY_CLRMSK 0xEFFFFFFFU +#define ROGUE_CR_EVENT_STATUS_DPX_OUT_OF_MEMORY_EN 0x10000000U +#define ROGUE_CR_EVENT_STATUS_DPX_MMU_PAGE_FAULT_SHIFT 27U +#define ROGUE_CR_EVENT_STATUS_DPX_MMU_PAGE_FAULT_CLRMSK 0xF7FFFFFFU +#define ROGUE_CR_EVENT_STATUS_DPX_MMU_PAGE_FAULT_EN 0x08000000U +#define ROGUE_CR_EVENT_STATUS_RPM_OUT_OF_MEMORY_SHIFT 26U +#define ROGUE_CR_EVENT_STATUS_RPM_OUT_OF_MEMORY_CLRMSK 0xFBFFFFFFU +#define ROGUE_CR_EVENT_STATUS_RPM_OUT_OF_MEMORY_EN 0x04000000U +#define ROGUE_CR_EVENT_STATUS_FBA_FC3_FINISHED_SHIFT 25U +#define ROGUE_CR_EVENT_STATUS_FBA_FC3_FINISHED_CLRMSK 0xFDFFFFFFU +#define ROGUE_CR_EVENT_STATUS_FBA_FC3_FINISHED_EN 0x02000000U +#define ROGUE_CR_EVENT_STATUS_FBA_FC2_FINISHED_SHIFT 24U +#define ROGUE_CR_EVENT_STATUS_FBA_FC2_FINISHED_CLRMSK 0xFEFFFFFFU +#define ROGUE_CR_EVENT_STATUS_FBA_FC2_FINISHED_EN 0x01000000U +#define ROGUE_CR_EVENT_STATUS_FBA_FC1_FINISHED_SHIFT 23U +#define ROGUE_CR_EVENT_STATUS_FBA_FC1_FINISHED_CLRMSK 0xFF7FFFFFU +#define ROGUE_CR_EVENT_STATUS_FBA_FC1_FINISHED_EN 0x00800000U +#define ROGUE_CR_EVENT_STATUS_FBA_FC0_FINISHED_SHIFT 22U +#define ROGUE_CR_EVENT_STATUS_FBA_FC0_FINISHED_CLRMSK 0xFFBFFFFFU +#define ROGUE_CR_EVENT_STATUS_FBA_FC0_FINISHED_EN 0x00400000U +#define ROGUE_CR_EVENT_STATUS_RDM_FC3_FINISHED_SHIFT 21U +#define ROGUE_CR_EVENT_STATUS_RDM_FC3_FINISHED_CLRMSK 0xFFDFFFFFU +#define ROGUE_CR_EVENT_STATUS_RDM_FC3_FINISHED_EN 0x00200000U +#define ROGUE_CR_EVENT_STATUS_RDM_FC2_FINISHED_SHIFT 20U +#define ROGUE_CR_EVENT_STATUS_RDM_FC2_FINISHED_CLRMSK 0xFFEFFFFFU +#define ROGUE_CR_EVENT_STATUS_RDM_FC2_FINISHED_EN 0x00100000U +#define ROGUE_CR_EVENT_STATUS_SAFETY_SHIFT 20U +#define ROGUE_CR_EVENT_STATUS_SAFETY_CLRMSK 0xFFEFFFFFU +#define ROGUE_CR_EVENT_STATUS_SAFETY_EN 0x00100000U +#define ROGUE_CR_EVENT_STATUS_RDM_FC1_FINISHED_SHIFT 19U +#define ROGUE_CR_EVENT_STATUS_RDM_FC1_FINISHED_CLRMSK 0xFFF7FFFFU +#define ROGUE_CR_EVENT_STATUS_RDM_FC1_FINISHED_EN 0x00080000U +#define ROGUE_CR_EVENT_STATUS_SLAVE_REQ_SHIFT 19U +#define ROGUE_CR_EVENT_STATUS_SLAVE_REQ_CLRMSK 0xFFF7FFFFU +#define ROGUE_CR_EVENT_STATUS_SLAVE_REQ_EN 0x00080000U +#define ROGUE_CR_EVENT_STATUS_RDM_FC0_FINISHED_SHIFT 18U +#define ROGUE_CR_EVENT_STATUS_RDM_FC0_FINISHED_CLRMSK 0xFFFBFFFFU +#define ROGUE_CR_EVENT_STATUS_RDM_FC0_FINISHED_EN 0x00040000U +#define ROGUE_CR_EVENT_STATUS_TDM_CONTEXT_STORE_FINISHED_SHIFT 18U +#define ROGUE_CR_EVENT_STATUS_TDM_CONTEXT_STORE_FINISHED_CLRMSK 0xFFFBFFFFU +#define ROGUE_CR_EVENT_STATUS_TDM_CONTEXT_STORE_FINISHED_EN 0x00040000U +#define ROGUE_CR_EVENT_STATUS_SHG_FINISHED_SHIFT 17U +#define ROGUE_CR_EVENT_STATUS_SHG_FINISHED_CLRMSK 0xFFFDFFFFU +#define ROGUE_CR_EVENT_STATUS_SHG_FINISHED_EN 0x00020000U +#define ROGUE_CR_EVENT_STATUS_SPFILTER_SIGNAL_UPDATE_SHIFT 17U +#define ROGUE_CR_EVENT_STATUS_SPFILTER_SIGNAL_UPDATE_CLRMSK 0xFFFDFFFFU +#define ROGUE_CR_EVENT_STATUS_SPFILTER_SIGNAL_UPDATE_EN 0x00020000U +#define ROGUE_CR_EVENT_STATUS_COMPUTE_BUFFER_STALL_SHIFT 16U +#define ROGUE_CR_EVENT_STATUS_COMPUTE_BUFFER_STALL_CLRMSK 0xFFFEFFFFU +#define ROGUE_CR_EVENT_STATUS_COMPUTE_BUFFER_STALL_EN 0x00010000U +#define ROGUE_CR_EVENT_STATUS_USC_TRIGGER_SHIFT 15U +#define ROGUE_CR_EVENT_STATUS_USC_TRIGGER_CLRMSK 0xFFFF7FFFU +#define ROGUE_CR_EVENT_STATUS_USC_TRIGGER_EN 0x00008000U +#define ROGUE_CR_EVENT_STATUS_ZLS_FINISHED_SHIFT 14U +#define ROGUE_CR_EVENT_STATUS_ZLS_FINISHED_CLRMSK 0xFFFFBFFFU +#define ROGUE_CR_EVENT_STATUS_ZLS_FINISHED_EN 0x00004000U +#define ROGUE_CR_EVENT_STATUS_GPIO_ACK_SHIFT 13U +#define ROGUE_CR_EVENT_STATUS_GPIO_ACK_CLRMSK 0xFFFFDFFFU +#define ROGUE_CR_EVENT_STATUS_GPIO_ACK_EN 0x00002000U +#define ROGUE_CR_EVENT_STATUS_GPIO_REQ_SHIFT 12U +#define ROGUE_CR_EVENT_STATUS_GPIO_REQ_CLRMSK 0xFFFFEFFFU +#define ROGUE_CR_EVENT_STATUS_GPIO_REQ_EN 0x00001000U +#define ROGUE_CR_EVENT_STATUS_POWER_ABORT_SHIFT 11U +#define ROGUE_CR_EVENT_STATUS_POWER_ABORT_CLRMSK 0xFFFFF7FFU +#define ROGUE_CR_EVENT_STATUS_POWER_ABORT_EN 0x00000800U +#define ROGUE_CR_EVENT_STATUS_POWER_COMPLETE_SHIFT 10U +#define ROGUE_CR_EVENT_STATUS_POWER_COMPLETE_CLRMSK 0xFFFFFBFFU +#define ROGUE_CR_EVENT_STATUS_POWER_COMPLETE_EN 0x00000400U +#define ROGUE_CR_EVENT_STATUS_MMU_PAGE_FAULT_SHIFT 9U +#define ROGUE_CR_EVENT_STATUS_MMU_PAGE_FAULT_CLRMSK 0xFFFFFDFFU +#define ROGUE_CR_EVENT_STATUS_MMU_PAGE_FAULT_EN 0x00000200U +#define ROGUE_CR_EVENT_STATUS_PM_3D_MEM_FREE_SHIFT 8U +#define ROGUE_CR_EVENT_STATUS_PM_3D_MEM_FREE_CLRMSK 0xFFFFFEFFU +#define ROGUE_CR_EVENT_STATUS_PM_3D_MEM_FREE_EN 0x00000100U +#define ROGUE_CR_EVENT_STATUS_PM_OUT_OF_MEMORY_SHIFT 7U +#define ROGUE_CR_EVENT_STATUS_PM_OUT_OF_MEMORY_CLRMSK 0xFFFFFF7FU +#define ROGUE_CR_EVENT_STATUS_PM_OUT_OF_MEMORY_EN 0x00000080U +#define ROGUE_CR_EVENT_STATUS_TA_TERMINATE_SHIFT 6U +#define ROGUE_CR_EVENT_STATUS_TA_TERMINATE_CLRMSK 0xFFFFFFBFU +#define ROGUE_CR_EVENT_STATUS_TA_TERMINATE_EN 0x00000040U +#define ROGUE_CR_EVENT_STATUS_TA_FINISHED_SHIFT 5U +#define ROGUE_CR_EVENT_STATUS_TA_FINISHED_CLRMSK 0xFFFFFFDFU +#define ROGUE_CR_EVENT_STATUS_TA_FINISHED_EN 0x00000020U +#define ROGUE_CR_EVENT_STATUS_ISP_END_MACROTILE_SHIFT 4U +#define ROGUE_CR_EVENT_STATUS_ISP_END_MACROTILE_CLRMSK 0xFFFFFFEFU +#define ROGUE_CR_EVENT_STATUS_ISP_END_MACROTILE_EN 0x00000010U +#define ROGUE_CR_EVENT_STATUS_PIXELBE_END_RENDER_SHIFT 3U +#define ROGUE_CR_EVENT_STATUS_PIXELBE_END_RENDER_CLRMSK 0xFFFFFFF7U +#define ROGUE_CR_EVENT_STATUS_PIXELBE_END_RENDER_EN 0x00000008U +#define ROGUE_CR_EVENT_STATUS_COMPUTE_FINISHED_SHIFT 2U +#define ROGUE_CR_EVENT_STATUS_COMPUTE_FINISHED_CLRMSK 0xFFFFFFFBU +#define ROGUE_CR_EVENT_STATUS_COMPUTE_FINISHED_EN 0x00000004U +#define ROGUE_CR_EVENT_STATUS_KERNEL_FINISHED_SHIFT 1U +#define ROGUE_CR_EVENT_STATUS_KERNEL_FINISHED_CLRMSK 0xFFFFFFFDU +#define ROGUE_CR_EVENT_STATUS_KERNEL_FINISHED_EN 0x00000002U +#define ROGUE_CR_EVENT_STATUS_TLA_COMPLETE_SHIFT 0U +#define ROGUE_CR_EVENT_STATUS_TLA_COMPLETE_CLRMSK 0xFFFFFFFEU +#define ROGUE_CR_EVENT_STATUS_TLA_COMPLETE_EN 0x00000001U + +/* Register ROGUE_CR_TIMER */ +#define ROGUE_CR_TIMER 0x0160U +#define ROGUE_CR_TIMER_MASKFULL 0x8000FFFFFFFFFFFFULL +#define ROGUE_CR_TIMER_BIT31_SHIFT 63U +#define ROGUE_CR_TIMER_BIT31_CLRMSK 0x7FFFFFFFFFFFFFFFULL +#define ROGUE_CR_TIMER_BIT31_EN 0x8000000000000000ULL +#define ROGUE_CR_TIMER_VALUE_SHIFT 0U +#define ROGUE_CR_TIMER_VALUE_CLRMSK 0xFFFF000000000000ULL + +/* Register ROGUE_CR_TLA_STATUS */ +#define ROGUE_CR_TLA_STATUS 0x0178U +#define ROGUE_CR_TLA_STATUS_MASKFULL 0xFFFFFFFFFFFFFFFFULL +#define ROGUE_CR_TLA_STATUS_BLIT_COUNT_SHIFT 39U +#define ROGUE_CR_TLA_STATUS_BLIT_COUNT_CLRMSK 0x0000007FFFFFFFFFULL +#define ROGUE_CR_TLA_STATUS_REQUEST_SHIFT 7U +#define ROGUE_CR_TLA_STATUS_REQUEST_CLRMSK 0xFFFFFF800000007FULL +#define ROGUE_CR_TLA_STATUS_FIFO_FULLNESS_SHIFT 1U +#define ROGUE_CR_TLA_STATUS_FIFO_FULLNESS_CLRMSK 0xFFFFFFFFFFFFFF81ULL +#define ROGUE_CR_TLA_STATUS_BUSY_SHIFT 0U +#define ROGUE_CR_TLA_STATUS_BUSY_CLRMSK 0xFFFFFFFFFFFFFFFEULL +#define ROGUE_CR_TLA_STATUS_BUSY_EN 0x0000000000000001ULL + +/* Register ROGUE_CR_PM_PARTIAL_RENDER_ENABLE */ +#define ROGUE_CR_PM_PARTIAL_RENDER_ENABLE 0x0338U +#define ROGUE_CR_PM_PARTIAL_RENDER_ENABLE_MASKFULL 0x0000000000000001ULL +#define ROGUE_CR_PM_PARTIAL_RENDER_ENABLE_OP_SHIFT 0U +#define ROGUE_CR_PM_PARTIAL_RENDER_ENABLE_OP_CLRMSK 0xFFFFFFFEU +#define ROGUE_CR_PM_PARTIAL_RENDER_ENABLE_OP_EN 0x00000001U + +/* Register ROGUE_CR_SIDEKICK_IDLE */ +#define ROGUE_CR_SIDEKICK_IDLE 0x03C8U +#define ROGUE_CR_SIDEKICK_IDLE_MASKFULL 0x000000000000007FULL +#define ROGUE_CR_SIDEKICK_IDLE_FB_CDC_SHIFT 6U +#define ROGUE_CR_SIDEKICK_IDLE_FB_CDC_CLRMSK 0xFFFFFFBFU +#define ROGUE_CR_SIDEKICK_IDLE_FB_CDC_EN 0x00000040U +#define ROGUE_CR_SIDEKICK_IDLE_MMU_SHIFT 5U +#define ROGUE_CR_SIDEKICK_IDLE_MMU_CLRMSK 0xFFFFFFDFU +#define ROGUE_CR_SIDEKICK_IDLE_MMU_EN 0x00000020U +#define ROGUE_CR_SIDEKICK_IDLE_BIF128_SHIFT 4U +#define ROGUE_CR_SIDEKICK_IDLE_BIF128_CLRMSK 0xFFFFFFEFU +#define ROGUE_CR_SIDEKICK_IDLE_BIF128_EN 0x00000010U +#define ROGUE_CR_SIDEKICK_IDLE_TLA_SHIFT 3U +#define ROGUE_CR_SIDEKICK_IDLE_TLA_CLRMSK 0xFFFFFFF7U +#define ROGUE_CR_SIDEKICK_IDLE_TLA_EN 0x00000008U +#define ROGUE_CR_SIDEKICK_IDLE_GARTEN_SHIFT 2U +#define ROGUE_CR_SIDEKICK_IDLE_GARTEN_CLRMSK 0xFFFFFFFBU +#define ROGUE_CR_SIDEKICK_IDLE_GARTEN_EN 0x00000004U +#define ROGUE_CR_SIDEKICK_IDLE_HOSTIF_SHIFT 1U +#define ROGUE_CR_SIDEKICK_IDLE_HOSTIF_CLRMSK 0xFFFFFFFDU +#define ROGUE_CR_SIDEKICK_IDLE_HOSTIF_EN 0x00000002U +#define ROGUE_CR_SIDEKICK_IDLE_SOCIF_SHIFT 0U +#define ROGUE_CR_SIDEKICK_IDLE_SOCIF_CLRMSK 0xFFFFFFFEU +#define ROGUE_CR_SIDEKICK_IDLE_SOCIF_EN 0x00000001U + +/* Register ROGUE_CR_MARS_IDLE */ +#define ROGUE_CR_MARS_IDLE 0x08F8U +#define ROGUE_CR_MARS_IDLE_MASKFULL 0x0000000000000007ULL +#define ROGUE_CR_MARS_IDLE_MH_SYSARB0_SHIFT 2U +#define ROGUE_CR_MARS_IDLE_MH_SYSARB0_CLRMSK 0xFFFFFFFBU +#define ROGUE_CR_MARS_IDLE_MH_SYSARB0_EN 0x00000004U +#define ROGUE_CR_MARS_IDLE_CPU_SHIFT 1U +#define ROGUE_CR_MARS_IDLE_CPU_CLRMSK 0xFFFFFFFDU +#define ROGUE_CR_MARS_IDLE_CPU_EN 0x00000002U +#define ROGUE_CR_MARS_IDLE_SOCIF_SHIFT 0U +#define ROGUE_CR_MARS_IDLE_SOCIF_CLRMSK 0xFFFFFFFEU +#define ROGUE_CR_MARS_IDLE_SOCIF_EN 0x00000001U + +/* Register ROGUE_CR_VDM_CONTEXT_STORE_STATUS */ +#define ROGUE_CR_VDM_CONTEXT_STORE_STATUS 0x0430U +#define ROGUE_CR_VDM_CONTEXT_STORE_STATUS_MASKFULL 0x00000000000000F3ULL +#define ROGUE_CR_VDM_CONTEXT_STORE_STATUS_LAST_PIPE_SHIFT 4U +#define ROGUE_CR_VDM_CONTEXT_STORE_STATUS_LAST_PIPE_CLRMSK 0xFFFFFF0FU +#define ROGUE_CR_VDM_CONTEXT_STORE_STATUS_NEED_RESUME_SHIFT 1U +#define ROGUE_CR_VDM_CONTEXT_STORE_STATUS_NEED_RESUME_CLRMSK 0xFFFFFFFDU +#define ROGUE_CR_VDM_CONTEXT_STORE_STATUS_NEED_RESUME_EN 0x00000002U +#define ROGUE_CR_VDM_CONTEXT_STORE_STATUS_COMPLETE_SHIFT 0U +#define ROGUE_CR_VDM_CONTEXT_STORE_STATUS_COMPLETE_CLRMSK 0xFFFFFFFEU +#define ROGUE_CR_VDM_CONTEXT_STORE_STATUS_COMPLETE_EN 0x00000001U + +/* Register ROGUE_CR_VDM_CONTEXT_STORE_TASK0 */ +#define ROGUE_CR_VDM_CONTEXT_STORE_TASK0 0x0438U +#define ROGUE_CR_VDM_CONTEXT_STORE_TASK0_MASKFULL 0xFFFFFFFFFFFFFFFFULL +#define ROGUE_CR_VDM_CONTEXT_STORE_TASK0_PDS_STATE1_SHIFT 32U +#define ROGUE_CR_VDM_CONTEXT_STORE_TASK0_PDS_STATE1_CLRMSK 0x00000000FFFFFFFFULL +#define ROGUE_CR_VDM_CONTEXT_STORE_TASK0_PDS_STATE0_SHIFT 0U +#define ROGUE_CR_VDM_CONTEXT_STORE_TASK0_PDS_STATE0_CLRMSK 0xFFFFFFFF00000000ULL + +/* Register ROGUE_CR_VDM_CONTEXT_STORE_TASK1 */ +#define ROGUE_CR_VDM_CONTEXT_STORE_TASK1 0x0440U +#define ROGUE_CR_VDM_CONTEXT_STORE_TASK1_MASKFULL 0x00000000FFFFFFFFULL +#define ROGUE_CR_VDM_CONTEXT_STORE_TASK1_PDS_STATE2_SHIFT 0U +#define ROGUE_CR_VDM_CONTEXT_STORE_TASK1_PDS_STATE2_CLRMSK 0x00000000U + +/* Register ROGUE_CR_VDM_CONTEXT_STORE_TASK2 */ +#define ROGUE_CR_VDM_CONTEXT_STORE_TASK2 0x0448U +#define ROGUE_CR_VDM_CONTEXT_STORE_TASK2_MASKFULL 0xFFFFFFFFFFFFFFFFULL +#define ROGUE_CR_VDM_CONTEXT_STORE_TASK2_STREAM_OUT2_SHIFT 32U +#define ROGUE_CR_VDM_CONTEXT_STORE_TASK2_STREAM_OUT2_CLRMSK 0x00000000FFFFFFFFULL +#define ROGUE_CR_VDM_CONTEXT_STORE_TASK2_STREAM_OUT1_SHIFT 0U +#define ROGUE_CR_VDM_CONTEXT_STORE_TASK2_STREAM_OUT1_CLRMSK 0xFFFFFFFF00000000ULL + +/* Register ROGUE_CR_VDM_CONTEXT_RESUME_TASK0 */ +#define ROGUE_CR_VDM_CONTEXT_RESUME_TASK0 0x0450U +#define ROGUE_CR_VDM_CONTEXT_RESUME_TASK0_MASKFULL 0xFFFFFFFFFFFFFFFFULL +#define ROGUE_CR_VDM_CONTEXT_RESUME_TASK0_PDS_STATE1_SHIFT 32U +#define ROGUE_CR_VDM_CONTEXT_RESUME_TASK0_PDS_STATE1_CLRMSK 0x00000000FFFFFFFFULL +#define ROGUE_CR_VDM_CONTEXT_RESUME_TASK0_PDS_STATE0_SHIFT 0U +#define ROGUE_CR_VDM_CONTEXT_RESUME_TASK0_PDS_STATE0_CLRMSK 0xFFFFFFFF00000000ULL + +/* Register ROGUE_CR_VDM_CONTEXT_RESUME_TASK1 */ +#define ROGUE_CR_VDM_CONTEXT_RESUME_TASK1 0x0458U +#define ROGUE_CR_VDM_CONTEXT_RESUME_TASK1_MASKFULL 0x00000000FFFFFFFFULL +#define ROGUE_CR_VDM_CONTEXT_RESUME_TASK1_PDS_STATE2_SHIFT 0U +#define ROGUE_CR_VDM_CONTEXT_RESUME_TASK1_PDS_STATE2_CLRMSK 0x00000000U + +/* Register ROGUE_CR_VDM_CONTEXT_RESUME_TASK2 */ +#define ROGUE_CR_VDM_CONTEXT_RESUME_TASK2 0x0460U +#define ROGUE_CR_VDM_CONTEXT_RESUME_TASK2_MASKFULL 0xFFFFFFFFFFFFFFFFULL +#define ROGUE_CR_VDM_CONTEXT_RESUME_TASK2_STREAM_OUT2_SHIFT 32U +#define ROGUE_CR_VDM_CONTEXT_RESUME_TASK2_STREAM_OUT2_CLRMSK 0x00000000FFFFFFFFULL +#define ROGUE_CR_VDM_CONTEXT_RESUME_TASK2_STREAM_OUT1_SHIFT 0U +#define ROGUE_CR_VDM_CONTEXT_RESUME_TASK2_STREAM_OUT1_CLRMSK 0xFFFFFFFF00000000ULL + +/* Register ROGUE_CR_CDM_CONTEXT_STORE_STATUS */ +#define ROGUE_CR_CDM_CONTEXT_STORE_STATUS 0x04A0U +#define ROGUE_CR_CDM_CONTEXT_STORE_STATUS_MASKFULL 0x0000000000000003ULL +#define ROGUE_CR_CDM_CONTEXT_STORE_STATUS_NEED_RESUME_SHIFT 1U +#define ROGUE_CR_CDM_CONTEXT_STORE_STATUS_NEED_RESUME_CLRMSK 0xFFFFFFFDU +#define ROGUE_CR_CDM_CONTEXT_STORE_STATUS_NEED_RESUME_EN 0x00000002U +#define ROGUE_CR_CDM_CONTEXT_STORE_STATUS_COMPLETE_SHIFT 0U +#define ROGUE_CR_CDM_CONTEXT_STORE_STATUS_COMPLETE_CLRMSK 0xFFFFFFFEU +#define ROGUE_CR_CDM_CONTEXT_STORE_STATUS_COMPLETE_EN 0x00000001U + +/* Register ROGUE_CR_CDM_CONTEXT_PDS0 */ +#define ROGUE_CR_CDM_CONTEXT_PDS0 0x04A8U +#define ROGUE_CR_CDM_CONTEXT_PDS0_MASKFULL 0xFFFFFFF0FFFFFFF0ULL +#define ROGUE_CR_CDM_CONTEXT_PDS0_DATA_ADDR_SHIFT 36U +#define ROGUE_CR_CDM_CONTEXT_PDS0_DATA_ADDR_CLRMSK 0x0000000FFFFFFFFFULL +#define ROGUE_CR_CDM_CONTEXT_PDS0_DATA_ADDR_ALIGNSHIFT 4U +#define ROGUE_CR_CDM_CONTEXT_PDS0_DATA_ADDR_ALIGNSIZE 16U +#define ROGUE_CR_CDM_CONTEXT_PDS0_CODE_ADDR_SHIFT 4U +#define ROGUE_CR_CDM_CONTEXT_PDS0_CODE_ADDR_CLRMSK 0xFFFFFFFF0000000FULL +#define ROGUE_CR_CDM_CONTEXT_PDS0_CODE_ADDR_ALIGNSHIFT 4U +#define ROGUE_CR_CDM_CONTEXT_PDS0_CODE_ADDR_ALIGNSIZE 16U + +/* Register ROGUE_CR_CDM_CONTEXT_PDS1 */ +#define ROGUE_CR_CDM_CONTEXT_PDS1 0x04B0U +#define ROGUE_CR_CDM_CONTEXT_PDS1__TEMPSIZE8__MASKFULL 0x000000007FFFFFFFULL +#define ROGUE_CR_CDM_CONTEXT_PDS1_MASKFULL 0x000000003FFFFFFFULL +#define ROGUE_CR_CDM_CONTEXT_PDS1__TEMPSIZE8__PDS_SEQ_DEP_SHIFT 30U +#define ROGUE_CR_CDM_CONTEXT_PDS1__TEMPSIZE8__PDS_SEQ_DEP_CLRMSK 0xBFFFFFFFU +#define ROGUE_CR_CDM_CONTEXT_PDS1__TEMPSIZE8__PDS_SEQ_DEP_EN 0x40000000U +#define ROGUE_CR_CDM_CONTEXT_PDS1_PDS_SEQ_DEP_SHIFT 29U +#define ROGUE_CR_CDM_CONTEXT_PDS1_PDS_SEQ_DEP_CLRMSK 0xDFFFFFFFU +#define ROGUE_CR_CDM_CONTEXT_PDS1_PDS_SEQ_DEP_EN 0x20000000U +#define ROGUE_CR_CDM_CONTEXT_PDS1__TEMPSIZE8__USC_SEQ_DEP_SHIFT 29U +#define ROGUE_CR_CDM_CONTEXT_PDS1__TEMPSIZE8__USC_SEQ_DEP_CLRMSK 0xDFFFFFFFU +#define ROGUE_CR_CDM_CONTEXT_PDS1__TEMPSIZE8__USC_SEQ_DEP_EN 0x20000000U +#define ROGUE_CR_CDM_CONTEXT_PDS1_USC_SEQ_DEP_SHIFT 28U +#define ROGUE_CR_CDM_CONTEXT_PDS1_USC_SEQ_DEP_CLRMSK 0xEFFFFFFFU +#define ROGUE_CR_CDM_CONTEXT_PDS1_USC_SEQ_DEP_EN 0x10000000U +#define ROGUE_CR_CDM_CONTEXT_PDS1__TEMPSIZE8__TARGET_SHIFT 28U +#define ROGUE_CR_CDM_CONTEXT_PDS1__TEMPSIZE8__TARGET_CLRMSK 0xEFFFFFFFU +#define ROGUE_CR_CDM_CONTEXT_PDS1__TEMPSIZE8__TARGET_EN 0x10000000U +#define ROGUE_CR_CDM_CONTEXT_PDS1_TARGET_SHIFT 27U +#define ROGUE_CR_CDM_CONTEXT_PDS1_TARGET_CLRMSK 0xF7FFFFFFU +#define ROGUE_CR_CDM_CONTEXT_PDS1_TARGET_EN 0x08000000U +#define ROGUE_CR_CDM_CONTEXT_PDS1__TEMPSIZE8__UNIFIED_SIZE_SHIFT 22U +#define ROGUE_CR_CDM_CONTEXT_PDS1__TEMPSIZE8__UNIFIED_SIZE_CLRMSK 0xF03FFFFFU +#define ROGUE_CR_CDM_CONTEXT_PDS1_UNIFIED_SIZE_SHIFT 21U +#define ROGUE_CR_CDM_CONTEXT_PDS1_UNIFIED_SIZE_CLRMSK 0xF81FFFFFU +#define ROGUE_CR_CDM_CONTEXT_PDS1__TEMPSIZE8__COMMON_SHARED_SHIFT 21U +#define ROGUE_CR_CDM_CONTEXT_PDS1__TEMPSIZE8__COMMON_SHARED_CLRMSK 0xFFDFFFFFU +#define ROGUE_CR_CDM_CONTEXT_PDS1__TEMPSIZE8__COMMON_SHARED_EN 0x00200000U +#define ROGUE_CR_CDM_CONTEXT_PDS1_COMMON_SHARED_SHIFT 20U +#define ROGUE_CR_CDM_CONTEXT_PDS1_COMMON_SHARED_CLRMSK 0xFFEFFFFFU +#define ROGUE_CR_CDM_CONTEXT_PDS1_COMMON_SHARED_EN 0x00100000U +#define ROGUE_CR_CDM_CONTEXT_PDS1__TEMPSIZE8__COMMON_SIZE_SHIFT 12U +#define ROGUE_CR_CDM_CONTEXT_PDS1__TEMPSIZE8__COMMON_SIZE_CLRMSK 0xFFE00FFFU +#define ROGUE_CR_CDM_CONTEXT_PDS1_COMMON_SIZE_SHIFT 11U +#define ROGUE_CR_CDM_CONTEXT_PDS1_COMMON_SIZE_CLRMSK 0xFFF007FFU +#define ROGUE_CR_CDM_CONTEXT_PDS1_TEMP_SIZE_SHIFT 7U +#define ROGUE_CR_CDM_CONTEXT_PDS1_TEMP_SIZE_CLRMSK 0xFFFFF87FU +#define ROGUE_CR_CDM_CONTEXT_PDS1__TEMPSIZE8__TEMP_SIZE_SHIFT 7U +#define ROGUE_CR_CDM_CONTEXT_PDS1__TEMPSIZE8__TEMP_SIZE_CLRMSK 0xFFFFF07FU +#define ROGUE_CR_CDM_CONTEXT_PDS1_DATA_SIZE_SHIFT 1U +#define ROGUE_CR_CDM_CONTEXT_PDS1_DATA_SIZE_CLRMSK 0xFFFFFF81U +#define ROGUE_CR_CDM_CONTEXT_PDS1_FENCE_SHIFT 0U +#define ROGUE_CR_CDM_CONTEXT_PDS1_FENCE_CLRMSK 0xFFFFFFFEU +#define ROGUE_CR_CDM_CONTEXT_PDS1_FENCE_EN 0x00000001U + +/* Register ROGUE_CR_CDM_TERMINATE_PDS */ +#define ROGUE_CR_CDM_TERMINATE_PDS 0x04B8U +#define ROGUE_CR_CDM_TERMINATE_PDS_MASKFULL 0xFFFFFFF0FFFFFFF0ULL +#define ROGUE_CR_CDM_TERMINATE_PDS_DATA_ADDR_SHIFT 36U +#define ROGUE_CR_CDM_TERMINATE_PDS_DATA_ADDR_CLRMSK 0x0000000FFFFFFFFFULL +#define ROGUE_CR_CDM_TERMINATE_PDS_DATA_ADDR_ALIGNSHIFT 4U +#define ROGUE_CR_CDM_TERMINATE_PDS_DATA_ADDR_ALIGNSIZE 16U +#define ROGUE_CR_CDM_TERMINATE_PDS_CODE_ADDR_SHIFT 4U +#define ROGUE_CR_CDM_TERMINATE_PDS_CODE_ADDR_CLRMSK 0xFFFFFFFF0000000FULL +#define ROGUE_CR_CDM_TERMINATE_PDS_CODE_ADDR_ALIGNSHIFT 4U +#define ROGUE_CR_CDM_TERMINATE_PDS_CODE_ADDR_ALIGNSIZE 16U + +/* Register ROGUE_CR_CDM_TERMINATE_PDS1 */ +#define ROGUE_CR_CDM_TERMINATE_PDS1 0x04C0U +#define ROGUE_CR_CDM_TERMINATE_PDS1__TEMPSIZE8__MASKFULL 0x000000007FFFFFFFULL +#define ROGUE_CR_CDM_TERMINATE_PDS1_MASKFULL 0x000000003FFFFFFFULL +#define ROGUE_CR_CDM_TERMINATE_PDS1__TEMPSIZE8__PDS_SEQ_DEP_SHIFT 30U +#define ROGUE_CR_CDM_TERMINATE_PDS1__TEMPSIZE8__PDS_SEQ_DEP_CLRMSK 0xBFFFFFFFU +#define ROGUE_CR_CDM_TERMINATE_PDS1__TEMPSIZE8__PDS_SEQ_DEP_EN 0x40000000U +#define ROGUE_CR_CDM_TERMINATE_PDS1_PDS_SEQ_DEP_SHIFT 29U +#define ROGUE_CR_CDM_TERMINATE_PDS1_PDS_SEQ_DEP_CLRMSK 0xDFFFFFFFU +#define ROGUE_CR_CDM_TERMINATE_PDS1_PDS_SEQ_DEP_EN 0x20000000U +#define ROGUE_CR_CDM_TERMINATE_PDS1__TEMPSIZE8__USC_SEQ_DEP_SHIFT 29U +#define ROGUE_CR_CDM_TERMINATE_PDS1__TEMPSIZE8__USC_SEQ_DEP_CLRMSK 0xDFFFFFFFU +#define ROGUE_CR_CDM_TERMINATE_PDS1__TEMPSIZE8__USC_SEQ_DEP_EN 0x20000000U +#define ROGUE_CR_CDM_TERMINATE_PDS1_USC_SEQ_DEP_SHIFT 28U +#define ROGUE_CR_CDM_TERMINATE_PDS1_USC_SEQ_DEP_CLRMSK 0xEFFFFFFFU +#define ROGUE_CR_CDM_TERMINATE_PDS1_USC_SEQ_DEP_EN 0x10000000U +#define ROGUE_CR_CDM_TERMINATE_PDS1__TEMPSIZE8__TARGET_SHIFT 28U +#define ROGUE_CR_CDM_TERMINATE_PDS1__TEMPSIZE8__TARGET_CLRMSK 0xEFFFFFFFU +#define ROGUE_CR_CDM_TERMINATE_PDS1__TEMPSIZE8__TARGET_EN 0x10000000U +#define ROGUE_CR_CDM_TERMINATE_PDS1_TARGET_SHIFT 27U +#define ROGUE_CR_CDM_TERMINATE_PDS1_TARGET_CLRMSK 0xF7FFFFFFU +#define ROGUE_CR_CDM_TERMINATE_PDS1_TARGET_EN 0x08000000U +#define ROGUE_CR_CDM_TERMINATE_PDS1__TEMPSIZE8__UNIFIED_SIZE_SHIFT 22U +#define ROGUE_CR_CDM_TERMINATE_PDS1__TEMPSIZE8__UNIFIED_SIZE_CLRMSK 0xF03FFFFFU +#define ROGUE_CR_CDM_TERMINATE_PDS1_UNIFIED_SIZE_SHIFT 21U +#define ROGUE_CR_CDM_TERMINATE_PDS1_UNIFIED_SIZE_CLRMSK 0xF81FFFFFU +#define ROGUE_CR_CDM_TERMINATE_PDS1__TEMPSIZE8__COMMON_SHARED_SHIFT 21U +#define ROGUE_CR_CDM_TERMINATE_PDS1__TEMPSIZE8__COMMON_SHARED_CLRMSK 0xFFDFFFFFU +#define ROGUE_CR_CDM_TERMINATE_PDS1__TEMPSIZE8__COMMON_SHARED_EN 0x00200000U +#define ROGUE_CR_CDM_TERMINATE_PDS1_COMMON_SHARED_SHIFT 20U +#define ROGUE_CR_CDM_TERMINATE_PDS1_COMMON_SHARED_CLRMSK 0xFFEFFFFFU +#define ROGUE_CR_CDM_TERMINATE_PDS1_COMMON_SHARED_EN 0x00100000U +#define ROGUE_CR_CDM_TERMINATE_PDS1__TEMPSIZE8__COMMON_SIZE_SHIFT 12U +#define ROGUE_CR_CDM_TERMINATE_PDS1__TEMPSIZE8__COMMON_SIZE_CLRMSK 0xFFE00FFFU +#define ROGUE_CR_CDM_TERMINATE_PDS1_COMMON_SIZE_SHIFT 11U +#define ROGUE_CR_CDM_TERMINATE_PDS1_COMMON_SIZE_CLRMSK 0xFFF007FFU +#define ROGUE_CR_CDM_TERMINATE_PDS1_TEMP_SIZE_SHIFT 7U +#define ROGUE_CR_CDM_TERMINATE_PDS1_TEMP_SIZE_CLRMSK 0xFFFFF87FU +#define ROGUE_CR_CDM_TERMINATE_PDS1__TEMPSIZE8__TEMP_SIZE_SHIFT 7U +#define ROGUE_CR_CDM_TERMINATE_PDS1__TEMPSIZE8__TEMP_SIZE_CLRMSK 0xFFFFF07FU +#define ROGUE_CR_CDM_TERMINATE_PDS1_DATA_SIZE_SHIFT 1U +#define ROGUE_CR_CDM_TERMINATE_PDS1_DATA_SIZE_CLRMSK 0xFFFFFF81U +#define ROGUE_CR_CDM_TERMINATE_PDS1_FENCE_SHIFT 0U +#define ROGUE_CR_CDM_TERMINATE_PDS1_FENCE_CLRMSK 0xFFFFFFFEU +#define ROGUE_CR_CDM_TERMINATE_PDS1_FENCE_EN 0x00000001U + +/* Register ROGUE_CR_CDM_CONTEXT_LOAD_PDS0 */ +#define ROGUE_CR_CDM_CONTEXT_LOAD_PDS0 0x04D8U +#define ROGUE_CR_CDM_CONTEXT_LOAD_PDS0_MASKFULL 0xFFFFFFF0FFFFFFF0ULL +#define ROGUE_CR_CDM_CONTEXT_LOAD_PDS0_DATA_ADDR_SHIFT 36U +#define ROGUE_CR_CDM_CONTEXT_LOAD_PDS0_DATA_ADDR_CLRMSK 0x0000000FFFFFFFFFULL +#define ROGUE_CR_CDM_CONTEXT_LOAD_PDS0_DATA_ADDR_ALIGNSHIFT 4U +#define ROGUE_CR_CDM_CONTEXT_LOAD_PDS0_DATA_ADDR_ALIGNSIZE 16U +#define ROGUE_CR_CDM_CONTEXT_LOAD_PDS0_CODE_ADDR_SHIFT 4U +#define ROGUE_CR_CDM_CONTEXT_LOAD_PDS0_CODE_ADDR_CLRMSK 0xFFFFFFFF0000000FULL +#define ROGUE_CR_CDM_CONTEXT_LOAD_PDS0_CODE_ADDR_ALIGNSHIFT 4U +#define ROGUE_CR_CDM_CONTEXT_LOAD_PDS0_CODE_ADDR_ALIGNSIZE 16U + +/* Register ROGUE_CR_CDM_CONTEXT_LOAD_PDS1 */ +#define ROGUE_CR_CDM_CONTEXT_LOAD_PDS1 0x04E0U +#define ROGUE_CR_CDM_CONTEXT_LOAD_PDS1__TEMPSIZE8__MASKFULL 0x000000007FFFFFFFULL +#define ROGUE_CR_CDM_CONTEXT_LOAD_PDS1_MASKFULL 0x000000003FFFFFFFULL +#define ROGUE_CR_CDM_CONTEXT_LOAD_PDS1__TEMPSIZE8__PDS_SEQ_DEP_SHIFT 30U +#define ROGUE_CR_CDM_CONTEXT_LOAD_PDS1__TEMPSIZE8__PDS_SEQ_DEP_CLRMSK 0xBFFFFFFFU +#define ROGUE_CR_CDM_CONTEXT_LOAD_PDS1__TEMPSIZE8__PDS_SEQ_DEP_EN 0x40000000U +#define ROGUE_CR_CDM_CONTEXT_LOAD_PDS1_PDS_SEQ_DEP_SHIFT 29U +#define ROGUE_CR_CDM_CONTEXT_LOAD_PDS1_PDS_SEQ_DEP_CLRMSK 0xDFFFFFFFU +#define ROGUE_CR_CDM_CONTEXT_LOAD_PDS1_PDS_SEQ_DEP_EN 0x20000000U +#define ROGUE_CR_CDM_CONTEXT_LOAD_PDS1__TEMPSIZE8__USC_SEQ_DEP_SHIFT 29U +#define ROGUE_CR_CDM_CONTEXT_LOAD_PDS1__TEMPSIZE8__USC_SEQ_DEP_CLRMSK 0xDFFFFFFFU +#define ROGUE_CR_CDM_CONTEXT_LOAD_PDS1__TEMPSIZE8__USC_SEQ_DEP_EN 0x20000000U +#define ROGUE_CR_CDM_CONTEXT_LOAD_PDS1_USC_SEQ_DEP_SHIFT 28U +#define ROGUE_CR_CDM_CONTEXT_LOAD_PDS1_USC_SEQ_DEP_CLRMSK 0xEFFFFFFFU +#define ROGUE_CR_CDM_CONTEXT_LOAD_PDS1_USC_SEQ_DEP_EN 0x10000000U +#define ROGUE_CR_CDM_CONTEXT_LOAD_PDS1__TEMPSIZE8__TARGET_SHIFT 28U +#define ROGUE_CR_CDM_CONTEXT_LOAD_PDS1__TEMPSIZE8__TARGET_CLRMSK 0xEFFFFFFFU +#define ROGUE_CR_CDM_CONTEXT_LOAD_PDS1__TEMPSIZE8__TARGET_EN 0x10000000U +#define ROGUE_CR_CDM_CONTEXT_LOAD_PDS1_TARGET_SHIFT 27U +#define ROGUE_CR_CDM_CONTEXT_LOAD_PDS1_TARGET_CLRMSK 0xF7FFFFFFU +#define ROGUE_CR_CDM_CONTEXT_LOAD_PDS1_TARGET_EN 0x08000000U +#define ROGUE_CR_CDM_CONTEXT_LOAD_PDS1__TEMPSIZE8__UNIFIED_SIZE_SHIFT 22U +#define ROGUE_CR_CDM_CONTEXT_LOAD_PDS1__TEMPSIZE8__UNIFIED_SIZE_CLRMSK 0xF03FFFFFU +#define ROGUE_CR_CDM_CONTEXT_LOAD_PDS1_UNIFIED_SIZE_SHIFT 21U +#define ROGUE_CR_CDM_CONTEXT_LOAD_PDS1_UNIFIED_SIZE_CLRMSK 0xF81FFFFFU +#define ROGUE_CR_CDM_CONTEXT_LOAD_PDS1__TEMPSIZE8__COMMON_SHARED_SHIFT 21U +#define ROGUE_CR_CDM_CONTEXT_LOAD_PDS1__TEMPSIZE8__COMMON_SHARED_CLRMSK 0xFFDFFFFFU +#define ROGUE_CR_CDM_CONTEXT_LOAD_PDS1__TEMPSIZE8__COMMON_SHARED_EN 0x00200000U +#define ROGUE_CR_CDM_CONTEXT_LOAD_PDS1_COMMON_SHARED_SHIFT 20U +#define ROGUE_CR_CDM_CONTEXT_LOAD_PDS1_COMMON_SHARED_CLRMSK 0xFFEFFFFFU +#define ROGUE_CR_CDM_CONTEXT_LOAD_PDS1_COMMON_SHARED_EN 0x00100000U +#define ROGUE_CR_CDM_CONTEXT_LOAD_PDS1__TEMPSIZE8__COMMON_SIZE_SHIFT 12U +#define ROGUE_CR_CDM_CONTEXT_LOAD_PDS1__TEMPSIZE8__COMMON_SIZE_CLRMSK 0xFFE00FFFU +#define ROGUE_CR_CDM_CONTEXT_LOAD_PDS1_COMMON_SIZE_SHIFT 11U +#define ROGUE_CR_CDM_CONTEXT_LOAD_PDS1_COMMON_SIZE_CLRMSK 0xFFF007FFU +#define ROGUE_CR_CDM_CONTEXT_LOAD_PDS1_TEMP_SIZE_SHIFT 7U +#define ROGUE_CR_CDM_CONTEXT_LOAD_PDS1_TEMP_SIZE_CLRMSK 0xFFFFF87FU +#define ROGUE_CR_CDM_CONTEXT_LOAD_PDS1__TEMPSIZE8__TEMP_SIZE_SHIFT 7U +#define ROGUE_CR_CDM_CONTEXT_LOAD_PDS1__TEMPSIZE8__TEMP_SIZE_CLRMSK 0xFFFFF07FU +#define ROGUE_CR_CDM_CONTEXT_LOAD_PDS1_DATA_SIZE_SHIFT 1U +#define ROGUE_CR_CDM_CONTEXT_LOAD_PDS1_DATA_SIZE_CLRMSK 0xFFFFFF81U +#define ROGUE_CR_CDM_CONTEXT_LOAD_PDS1_FENCE_SHIFT 0U +#define ROGUE_CR_CDM_CONTEXT_LOAD_PDS1_FENCE_CLRMSK 0xFFFFFFFEU +#define ROGUE_CR_CDM_CONTEXT_LOAD_PDS1_FENCE_EN 0x00000001U + +/* Register ROGUE_CR_MIPS_WRAPPER_CONFIG */ +#define ROGUE_CR_MIPS_WRAPPER_CONFIG 0x0810U +#define ROGUE_CR_MIPS_WRAPPER_CONFIG_MASKFULL 0x000001030F01FFFFULL +#define ROGUE_CR_MIPS_WRAPPER_CONFIG_FW_IDLE_ENABLE_SHIFT 40U +#define ROGUE_CR_MIPS_WRAPPER_CONFIG_FW_IDLE_ENABLE_CLRMSK 0xFFFFFEFFFFFFFFFFULL +#define ROGUE_CR_MIPS_WRAPPER_CONFIG_FW_IDLE_ENABLE_EN 0x0000010000000000ULL +#define ROGUE_CR_MIPS_WRAPPER_CONFIG_DISABLE_BOOT_SHIFT 33U +#define ROGUE_CR_MIPS_WRAPPER_CONFIG_DISABLE_BOOT_CLRMSK 0xFFFFFFFDFFFFFFFFULL +#define ROGUE_CR_MIPS_WRAPPER_CONFIG_DISABLE_BOOT_EN 0x0000000200000000ULL +#define ROGUE_CR_MIPS_WRAPPER_CONFIG_L2_CACHE_OFF_SHIFT 32U +#define ROGUE_CR_MIPS_WRAPPER_CONFIG_L2_CACHE_OFF_CLRMSK 0xFFFFFFFEFFFFFFFFULL +#define ROGUE_CR_MIPS_WRAPPER_CONFIG_L2_CACHE_OFF_EN 0x0000000100000000ULL +#define ROGUE_CR_MIPS_WRAPPER_CONFIG_OS_ID_SHIFT 25U +#define ROGUE_CR_MIPS_WRAPPER_CONFIG_OS_ID_CLRMSK 0xFFFFFFFFF1FFFFFFULL +#define ROGUE_CR_MIPS_WRAPPER_CONFIG_TRUSTED_SHIFT 24U +#define ROGUE_CR_MIPS_WRAPPER_CONFIG_TRUSTED_CLRMSK 0xFFFFFFFFFEFFFFFFULL +#define ROGUE_CR_MIPS_WRAPPER_CONFIG_TRUSTED_EN 0x0000000001000000ULL +#define ROGUE_CR_MIPS_WRAPPER_CONFIG_BOOT_ISA_MODE_SHIFT 16U +#define ROGUE_CR_MIPS_WRAPPER_CONFIG_BOOT_ISA_MODE_CLRMSK 0xFFFFFFFFFFFEFFFFULL +#define ROGUE_CR_MIPS_WRAPPER_CONFIG_BOOT_ISA_MODE_MIPS32 0x0000000000000000ULL +#define ROGUE_CR_MIPS_WRAPPER_CONFIG_BOOT_ISA_MODE_MICROMIPS 0x0000000000010000ULL +#define ROGUE_CR_MIPS_WRAPPER_CONFIG_REGBANK_BASE_ADDR_SHIFT 0U +#define ROGUE_CR_MIPS_WRAPPER_CONFIG_REGBANK_BASE_ADDR_CLRMSK 0xFFFFFFFFFFFF0000ULL + +/* Register ROGUE_CR_MIPS_ADDR_REMAP1_CONFIG1 */ +#define ROGUE_CR_MIPS_ADDR_REMAP1_CONFIG1 0x0818U +#define ROGUE_CR_MIPS_ADDR_REMAP1_CONFIG1_MASKFULL 0x00000000FFFFF001ULL +#define ROGUE_CR_MIPS_ADDR_REMAP1_CONFIG1_BASE_ADDR_IN_SHIFT 12U +#define ROGUE_CR_MIPS_ADDR_REMAP1_CONFIG1_BASE_ADDR_IN_CLRMSK 0xFFFFFFFF00000FFFULL +#define ROGUE_CR_MIPS_ADDR_REMAP1_CONFIG1_MODE_ENABLE_SHIFT 0U +#define ROGUE_CR_MIPS_ADDR_REMAP1_CONFIG1_MODE_ENABLE_CLRMSK 0xFFFFFFFFFFFFFFFEULL +#define ROGUE_CR_MIPS_ADDR_REMAP1_CONFIG1_MODE_ENABLE_EN 0x0000000000000001ULL + +/* Register ROGUE_CR_MIPS_ADDR_REMAP1_CONFIG2 */ +#define ROGUE_CR_MIPS_ADDR_REMAP1_CONFIG2 0x0820U +#define ROGUE_CR_MIPS_ADDR_REMAP1_CONFIG2_MASKFULL 0x000000FFFFFFF1FFULL +#define ROGUE_CR_MIPS_ADDR_REMAP1_CONFIG2_ADDR_OUT_SHIFT 12U +#define ROGUE_CR_MIPS_ADDR_REMAP1_CONFIG2_ADDR_OUT_CLRMSK 0xFFFFFF0000000FFFULL +#define ROGUE_CR_MIPS_ADDR_REMAP1_CONFIG2_OS_ID_SHIFT 6U +#define ROGUE_CR_MIPS_ADDR_REMAP1_CONFIG2_OS_ID_CLRMSK 0xFFFFFFFFFFFFFE3FULL +#define ROGUE_CR_MIPS_ADDR_REMAP1_CONFIG2_TRUSTED_SHIFT 5U +#define ROGUE_CR_MIPS_ADDR_REMAP1_CONFIG2_TRUSTED_CLRMSK 0xFFFFFFFFFFFFFFDFULL +#define ROGUE_CR_MIPS_ADDR_REMAP1_CONFIG2_TRUSTED_EN 0x0000000000000020ULL +#define ROGUE_CR_MIPS_ADDR_REMAP1_CONFIG2_REGION_SIZE_POW2_SHIFT 0U +#define ROGUE_CR_MIPS_ADDR_REMAP1_CONFIG2_REGION_SIZE_POW2_CLRMSK 0xFFFFFFFFFFFFFFE0ULL + +/* Register ROGUE_CR_MIPS_ADDR_REMAP2_CONFIG1 */ +#define ROGUE_CR_MIPS_ADDR_REMAP2_CONFIG1 0x0828U +#define ROGUE_CR_MIPS_ADDR_REMAP2_CONFIG1_MASKFULL 0x00000000FFFFF001ULL +#define ROGUE_CR_MIPS_ADDR_REMAP2_CONFIG1_BASE_ADDR_IN_SHIFT 12U +#define ROGUE_CR_MIPS_ADDR_REMAP2_CONFIG1_BASE_ADDR_IN_CLRMSK 0xFFFFFFFF00000FFFULL +#define ROGUE_CR_MIPS_ADDR_REMAP2_CONFIG1_MODE_ENABLE_SHIFT 0U +#define ROGUE_CR_MIPS_ADDR_REMAP2_CONFIG1_MODE_ENABLE_CLRMSK 0xFFFFFFFFFFFFFFFEULL +#define ROGUE_CR_MIPS_ADDR_REMAP2_CONFIG1_MODE_ENABLE_EN 0x0000000000000001ULL + +/* Register ROGUE_CR_MIPS_ADDR_REMAP2_CONFIG2 */ +#define ROGUE_CR_MIPS_ADDR_REMAP2_CONFIG2 0x0830U +#define ROGUE_CR_MIPS_ADDR_REMAP2_CONFIG2_MASKFULL 0x000000FFFFFFF1FFULL +#define ROGUE_CR_MIPS_ADDR_REMAP2_CONFIG2_ADDR_OUT_SHIFT 12U +#define ROGUE_CR_MIPS_ADDR_REMAP2_CONFIG2_ADDR_OUT_CLRMSK 0xFFFFFF0000000FFFULL +#define ROGUE_CR_MIPS_ADDR_REMAP2_CONFIG2_OS_ID_SHIFT 6U +#define ROGUE_CR_MIPS_ADDR_REMAP2_CONFIG2_OS_ID_CLRMSK 0xFFFFFFFFFFFFFE3FULL +#define ROGUE_CR_MIPS_ADDR_REMAP2_CONFIG2_TRUSTED_SHIFT 5U +#define ROGUE_CR_MIPS_ADDR_REMAP2_CONFIG2_TRUSTED_CLRMSK 0xFFFFFFFFFFFFFFDFULL +#define ROGUE_CR_MIPS_ADDR_REMAP2_CONFIG2_TRUSTED_EN 0x0000000000000020ULL +#define ROGUE_CR_MIPS_ADDR_REMAP2_CONFIG2_REGION_SIZE_POW2_SHIFT 0U +#define ROGUE_CR_MIPS_ADDR_REMAP2_CONFIG2_REGION_SIZE_POW2_CLRMSK 0xFFFFFFFFFFFFFFE0ULL + +/* Register ROGUE_CR_MIPS_ADDR_REMAP3_CONFIG1 */ +#define ROGUE_CR_MIPS_ADDR_REMAP3_CONFIG1 0x0838U +#define ROGUE_CR_MIPS_ADDR_REMAP3_CONFIG1_MASKFULL 0x00000000FFFFF001ULL +#define ROGUE_CR_MIPS_ADDR_REMAP3_CONFIG1_BASE_ADDR_IN_SHIFT 12U +#define ROGUE_CR_MIPS_ADDR_REMAP3_CONFIG1_BASE_ADDR_IN_CLRMSK 0xFFFFFFFF00000FFFULL +#define ROGUE_CR_MIPS_ADDR_REMAP3_CONFIG1_MODE_ENABLE_SHIFT 0U +#define ROGUE_CR_MIPS_ADDR_REMAP3_CONFIG1_MODE_ENABLE_CLRMSK 0xFFFFFFFFFFFFFFFEULL +#define ROGUE_CR_MIPS_ADDR_REMAP3_CONFIG1_MODE_ENABLE_EN 0x0000000000000001ULL + +/* Register ROGUE_CR_MIPS_ADDR_REMAP3_CONFIG2 */ +#define ROGUE_CR_MIPS_ADDR_REMAP3_CONFIG2 0x0840U +#define ROGUE_CR_MIPS_ADDR_REMAP3_CONFIG2_MASKFULL 0x000000FFFFFFF1FFULL +#define ROGUE_CR_MIPS_ADDR_REMAP3_CONFIG2_ADDR_OUT_SHIFT 12U +#define ROGUE_CR_MIPS_ADDR_REMAP3_CONFIG2_ADDR_OUT_CLRMSK 0xFFFFFF0000000FFFULL +#define ROGUE_CR_MIPS_ADDR_REMAP3_CONFIG2_OS_ID_SHIFT 6U +#define ROGUE_CR_MIPS_ADDR_REMAP3_CONFIG2_OS_ID_CLRMSK 0xFFFFFFFFFFFFFE3FULL +#define ROGUE_CR_MIPS_ADDR_REMAP3_CONFIG2_TRUSTED_SHIFT 5U +#define ROGUE_CR_MIPS_ADDR_REMAP3_CONFIG2_TRUSTED_CLRMSK 0xFFFFFFFFFFFFFFDFULL +#define ROGUE_CR_MIPS_ADDR_REMAP3_CONFIG2_TRUSTED_EN 0x0000000000000020ULL +#define ROGUE_CR_MIPS_ADDR_REMAP3_CONFIG2_REGION_SIZE_POW2_SHIFT 0U +#define ROGUE_CR_MIPS_ADDR_REMAP3_CONFIG2_REGION_SIZE_POW2_CLRMSK 0xFFFFFFFFFFFFFFE0ULL + +/* Register ROGUE_CR_MIPS_ADDR_REMAP4_CONFIG1 */ +#define ROGUE_CR_MIPS_ADDR_REMAP4_CONFIG1 0x0848U +#define ROGUE_CR_MIPS_ADDR_REMAP4_CONFIG1_MASKFULL 0x00000000FFFFF001ULL +#define ROGUE_CR_MIPS_ADDR_REMAP4_CONFIG1_BASE_ADDR_IN_SHIFT 12U +#define ROGUE_CR_MIPS_ADDR_REMAP4_CONFIG1_BASE_ADDR_IN_CLRMSK 0xFFFFFFFF00000FFFULL +#define ROGUE_CR_MIPS_ADDR_REMAP4_CONFIG1_MODE_ENABLE_SHIFT 0U +#define ROGUE_CR_MIPS_ADDR_REMAP4_CONFIG1_MODE_ENABLE_CLRMSK 0xFFFFFFFFFFFFFFFEULL +#define ROGUE_CR_MIPS_ADDR_REMAP4_CONFIG1_MODE_ENABLE_EN 0x0000000000000001ULL + +/* Register ROGUE_CR_MIPS_ADDR_REMAP4_CONFIG2 */ +#define ROGUE_CR_MIPS_ADDR_REMAP4_CONFIG2 0x0850U +#define ROGUE_CR_MIPS_ADDR_REMAP4_CONFIG2_MASKFULL 0x000000FFFFFFF1FFULL +#define ROGUE_CR_MIPS_ADDR_REMAP4_CONFIG2_ADDR_OUT_SHIFT 12U +#define ROGUE_CR_MIPS_ADDR_REMAP4_CONFIG2_ADDR_OUT_CLRMSK 0xFFFFFF0000000FFFULL +#define ROGUE_CR_MIPS_ADDR_REMAP4_CONFIG2_OS_ID_SHIFT 6U +#define ROGUE_CR_MIPS_ADDR_REMAP4_CONFIG2_OS_ID_CLRMSK 0xFFFFFFFFFFFFFE3FULL +#define ROGUE_CR_MIPS_ADDR_REMAP4_CONFIG2_TRUSTED_SHIFT 5U +#define ROGUE_CR_MIPS_ADDR_REMAP4_CONFIG2_TRUSTED_CLRMSK 0xFFFFFFFFFFFFFFDFULL +#define ROGUE_CR_MIPS_ADDR_REMAP4_CONFIG2_TRUSTED_EN 0x0000000000000020ULL +#define ROGUE_CR_MIPS_ADDR_REMAP4_CONFIG2_REGION_SIZE_POW2_SHIFT 0U +#define ROGUE_CR_MIPS_ADDR_REMAP4_CONFIG2_REGION_SIZE_POW2_CLRMSK 0xFFFFFFFFFFFFFFE0ULL + +/* Register ROGUE_CR_MIPS_ADDR_REMAP5_CONFIG1 */ +#define ROGUE_CR_MIPS_ADDR_REMAP5_CONFIG1 0x0858U +#define ROGUE_CR_MIPS_ADDR_REMAP5_CONFIG1_MASKFULL 0x00000000FFFFF001ULL +#define ROGUE_CR_MIPS_ADDR_REMAP5_CONFIG1_BASE_ADDR_IN_SHIFT 12U +#define ROGUE_CR_MIPS_ADDR_REMAP5_CONFIG1_BASE_ADDR_IN_CLRMSK 0xFFFFFFFF00000FFFULL +#define ROGUE_CR_MIPS_ADDR_REMAP5_CONFIG1_MODE_ENABLE_SHIFT 0U +#define ROGUE_CR_MIPS_ADDR_REMAP5_CONFIG1_MODE_ENABLE_CLRMSK 0xFFFFFFFFFFFFFFFEULL +#define ROGUE_CR_MIPS_ADDR_REMAP5_CONFIG1_MODE_ENABLE_EN 0x0000000000000001ULL + +/* Register ROGUE_CR_MIPS_ADDR_REMAP5_CONFIG2 */ +#define ROGUE_CR_MIPS_ADDR_REMAP5_CONFIG2 0x0860U +#define ROGUE_CR_MIPS_ADDR_REMAP5_CONFIG2_MASKFULL 0x000000FFFFFFF1FFULL +#define ROGUE_CR_MIPS_ADDR_REMAP5_CONFIG2_ADDR_OUT_SHIFT 12U +#define ROGUE_CR_MIPS_ADDR_REMAP5_CONFIG2_ADDR_OUT_CLRMSK 0xFFFFFF0000000FFFULL +#define ROGUE_CR_MIPS_ADDR_REMAP5_CONFIG2_OS_ID_SHIFT 6U +#define ROGUE_CR_MIPS_ADDR_REMAP5_CONFIG2_OS_ID_CLRMSK 0xFFFFFFFFFFFFFE3FULL +#define ROGUE_CR_MIPS_ADDR_REMAP5_CONFIG2_TRUSTED_SHIFT 5U +#define ROGUE_CR_MIPS_ADDR_REMAP5_CONFIG2_TRUSTED_CLRMSK 0xFFFFFFFFFFFFFFDFULL +#define ROGUE_CR_MIPS_ADDR_REMAP5_CONFIG2_TRUSTED_EN 0x0000000000000020ULL +#define ROGUE_CR_MIPS_ADDR_REMAP5_CONFIG2_REGION_SIZE_POW2_SHIFT 0U +#define ROGUE_CR_MIPS_ADDR_REMAP5_CONFIG2_REGION_SIZE_POW2_CLRMSK 0xFFFFFFFFFFFFFFE0ULL + +/* Register ROGUE_CR_MIPS_ADDR_REMAP_UNMAPPED_STATUS */ +#define ROGUE_CR_MIPS_ADDR_REMAP_UNMAPPED_STATUS 0x0868U +#define ROGUE_CR_MIPS_ADDR_REMAP_UNMAPPED_STATUS_MASKFULL 0x00000001FFFFFFFFULL +#define ROGUE_CR_MIPS_ADDR_REMAP_UNMAPPED_STATUS_EVENT_SHIFT 32U +#define ROGUE_CR_MIPS_ADDR_REMAP_UNMAPPED_STATUS_EVENT_CLRMSK 0xFFFFFFFEFFFFFFFFULL +#define ROGUE_CR_MIPS_ADDR_REMAP_UNMAPPED_STATUS_EVENT_EN 0x0000000100000000ULL +#define ROGUE_CR_MIPS_ADDR_REMAP_UNMAPPED_STATUS_ADDRESS_SHIFT 0U +#define ROGUE_CR_MIPS_ADDR_REMAP_UNMAPPED_STATUS_ADDRESS_CLRMSK 0xFFFFFFFF00000000ULL + +/* Register ROGUE_CR_MIPS_ADDR_REMAP_UNMAPPED_CLEAR */ +#define ROGUE_CR_MIPS_ADDR_REMAP_UNMAPPED_CLEAR 0x0870U +#define ROGUE_CR_MIPS_ADDR_REMAP_UNMAPPED_CLEAR_MASKFULL 0x0000000000000001ULL +#define ROGUE_CR_MIPS_ADDR_REMAP_UNMAPPED_CLEAR_EVENT_SHIFT 0U +#define ROGUE_CR_MIPS_ADDR_REMAP_UNMAPPED_CLEAR_EVENT_CLRMSK 0xFFFFFFFEU +#define ROGUE_CR_MIPS_ADDR_REMAP_UNMAPPED_CLEAR_EVENT_EN 0x00000001U + +/* Register ROGUE_CR_MIPS_ADDR_REMAP_RANGE_CONFIG */ +#define ROGUE_CR_MIPS_ADDR_REMAP_RANGE_CONFIG 0x0878U +#define ROGUE_CR_MIPS_ADDR_REMAP_RANGE_CONFIG_MASKFULL 0xFFFFFFF7FFFFFFBFULL +#define ROGUE_CR_MIPS_ADDR_REMAP_RANGE_CONFIG_ADDR_OUT_SHIFT 36U +#define ROGUE_CR_MIPS_ADDR_REMAP_RANGE_CONFIG_ADDR_OUT_CLRMSK 0x0000000FFFFFFFFFULL +#define ROGUE_CR_MIPS_ADDR_REMAP_RANGE_CONFIG_OS_ID_SHIFT 32U +#define ROGUE_CR_MIPS_ADDR_REMAP_RANGE_CONFIG_OS_ID_CLRMSK 0xFFFFFFF8FFFFFFFFULL +#define ROGUE_CR_MIPS_ADDR_REMAP_RANGE_CONFIG_BASE_ADDR_IN_SHIFT 12U +#define ROGUE_CR_MIPS_ADDR_REMAP_RANGE_CONFIG_BASE_ADDR_IN_CLRMSK 0xFFFFFFFF00000FFFULL +#define ROGUE_CR_MIPS_ADDR_REMAP_RANGE_CONFIG_TRUSTED_SHIFT 11U +#define ROGUE_CR_MIPS_ADDR_REMAP_RANGE_CONFIG_TRUSTED_CLRMSK 0xFFFFFFFFFFFFF7FFULL +#define ROGUE_CR_MIPS_ADDR_REMAP_RANGE_CONFIG_TRUSTED_EN 0x0000000000000800ULL +#define ROGUE_CR_MIPS_ADDR_REMAP_RANGE_CONFIG_REGION_SIZE_SHIFT 7U +#define ROGUE_CR_MIPS_ADDR_REMAP_RANGE_CONFIG_REGION_SIZE_CLRMSK 0xFFFFFFFFFFFFF87FULL +#define ROGUE_CR_MIPS_ADDR_REMAP_RANGE_CONFIG_REGION_SIZE_4KB 0x0000000000000000ULL +#define ROGUE_CR_MIPS_ADDR_REMAP_RANGE_CONFIG_REGION_SIZE_16KB 0x0000000000000080ULL +#define ROGUE_CR_MIPS_ADDR_REMAP_RANGE_CONFIG_REGION_SIZE_64KB 0x0000000000000100ULL +#define ROGUE_CR_MIPS_ADDR_REMAP_RANGE_CONFIG_REGION_SIZE_256KB 0x0000000000000180ULL +#define ROGUE_CR_MIPS_ADDR_REMAP_RANGE_CONFIG_REGION_SIZE_1MB 0x0000000000000200ULL +#define ROGUE_CR_MIPS_ADDR_REMAP_RANGE_CONFIG_REGION_SIZE_4MB 0x0000000000000280ULL +#define ROGUE_CR_MIPS_ADDR_REMAP_RANGE_CONFIG_REGION_SIZE_16MB 0x0000000000000300ULL +#define ROGUE_CR_MIPS_ADDR_REMAP_RANGE_CONFIG_REGION_SIZE_64MB 0x0000000000000380ULL +#define ROGUE_CR_MIPS_ADDR_REMAP_RANGE_CONFIG_REGION_SIZE_256MB 0x0000000000000400ULL +#define ROGUE_CR_MIPS_ADDR_REMAP_RANGE_CONFIG_ENTRY_SHIFT 1U +#define ROGUE_CR_MIPS_ADDR_REMAP_RANGE_CONFIG_ENTRY_CLRMSK 0xFFFFFFFFFFFFFFC1ULL +#define ROGUE_CR_MIPS_ADDR_REMAP_RANGE_CONFIG_MODE_ENABLE_SHIFT 0U +#define ROGUE_CR_MIPS_ADDR_REMAP_RANGE_CONFIG_MODE_ENABLE_CLRMSK 0xFFFFFFFFFFFFFFFEULL +#define ROGUE_CR_MIPS_ADDR_REMAP_RANGE_CONFIG_MODE_ENABLE_EN 0x0000000000000001ULL + +/* Register ROGUE_CR_MIPS_ADDR_REMAP_RANGE_READ */ +#define ROGUE_CR_MIPS_ADDR_REMAP_RANGE_READ 0x0880U +#define ROGUE_CR_MIPS_ADDR_REMAP_RANGE_READ_MASKFULL 0x000000000000003FULL +#define ROGUE_CR_MIPS_ADDR_REMAP_RANGE_READ_ENTRY_SHIFT 1U +#define ROGUE_CR_MIPS_ADDR_REMAP_RANGE_READ_ENTRY_CLRMSK 0xFFFFFFC1U +#define ROGUE_CR_MIPS_ADDR_REMAP_RANGE_READ_REQUEST_SHIFT 0U +#define ROGUE_CR_MIPS_ADDR_REMAP_RANGE_READ_REQUEST_CLRMSK 0xFFFFFFFEU +#define ROGUE_CR_MIPS_ADDR_REMAP_RANGE_READ_REQUEST_EN 0x00000001U + +/* Register ROGUE_CR_MIPS_ADDR_REMAP_RANGE_DATA */ +#define ROGUE_CR_MIPS_ADDR_REMAP_RANGE_DATA 0x0888U +#define ROGUE_CR_MIPS_ADDR_REMAP_RANGE_DATA_MASKFULL 0xFFFFFFF7FFFFFF81ULL +#define ROGUE_CR_MIPS_ADDR_REMAP_RANGE_DATA_ADDR_OUT_SHIFT 36U +#define ROGUE_CR_MIPS_ADDR_REMAP_RANGE_DATA_ADDR_OUT_CLRMSK 0x0000000FFFFFFFFFULL +#define ROGUE_CR_MIPS_ADDR_REMAP_RANGE_DATA_OS_ID_SHIFT 32U +#define ROGUE_CR_MIPS_ADDR_REMAP_RANGE_DATA_OS_ID_CLRMSK 0xFFFFFFF8FFFFFFFFULL +#define ROGUE_CR_MIPS_ADDR_REMAP_RANGE_DATA_BASE_ADDR_IN_SHIFT 12U +#define ROGUE_CR_MIPS_ADDR_REMAP_RANGE_DATA_BASE_ADDR_IN_CLRMSK 0xFFFFFFFF00000FFFULL +#define ROGUE_CR_MIPS_ADDR_REMAP_RANGE_DATA_TRUSTED_SHIFT 11U +#define ROGUE_CR_MIPS_ADDR_REMAP_RANGE_DATA_TRUSTED_CLRMSK 0xFFFFFFFFFFFFF7FFULL +#define ROGUE_CR_MIPS_ADDR_REMAP_RANGE_DATA_TRUSTED_EN 0x0000000000000800ULL +#define ROGUE_CR_MIPS_ADDR_REMAP_RANGE_DATA_REGION_SIZE_SHIFT 7U +#define ROGUE_CR_MIPS_ADDR_REMAP_RANGE_DATA_REGION_SIZE_CLRMSK 0xFFFFFFFFFFFFF87FULL +#define ROGUE_CR_MIPS_ADDR_REMAP_RANGE_DATA_MODE_ENABLE_SHIFT 0U +#define ROGUE_CR_MIPS_ADDR_REMAP_RANGE_DATA_MODE_ENABLE_CLRMSK 0xFFFFFFFFFFFFFFFEULL +#define ROGUE_CR_MIPS_ADDR_REMAP_RANGE_DATA_MODE_ENABLE_EN 0x0000000000000001ULL + +/* Register ROGUE_CR_MIPS_WRAPPER_IRQ_ENABLE */ +#define ROGUE_CR_MIPS_WRAPPER_IRQ_ENABLE 0x08A0U +#define ROGUE_CR_MIPS_WRAPPER_IRQ_ENABLE_MASKFULL 0x0000000000000001ULL +#define ROGUE_CR_MIPS_WRAPPER_IRQ_ENABLE_EVENT_SHIFT 0U +#define ROGUE_CR_MIPS_WRAPPER_IRQ_ENABLE_EVENT_CLRMSK 0xFFFFFFFEU +#define ROGUE_CR_MIPS_WRAPPER_IRQ_ENABLE_EVENT_EN 0x00000001U + +/* Register ROGUE_CR_MIPS_WRAPPER_IRQ_STATUS */ +#define ROGUE_CR_MIPS_WRAPPER_IRQ_STATUS 0x08A8U +#define ROGUE_CR_MIPS_WRAPPER_IRQ_STATUS_MASKFULL 0x0000000000000001ULL +#define ROGUE_CR_MIPS_WRAPPER_IRQ_STATUS_EVENT_SHIFT 0U +#define ROGUE_CR_MIPS_WRAPPER_IRQ_STATUS_EVENT_CLRMSK 0xFFFFFFFEU +#define ROGUE_CR_MIPS_WRAPPER_IRQ_STATUS_EVENT_EN 0x00000001U + +/* Register ROGUE_CR_MIPS_WRAPPER_IRQ_CLEAR */ +#define ROGUE_CR_MIPS_WRAPPER_IRQ_CLEAR 0x08B0U +#define ROGUE_CR_MIPS_WRAPPER_IRQ_CLEAR_MASKFULL 0x0000000000000001ULL +#define ROGUE_CR_MIPS_WRAPPER_IRQ_CLEAR_EVENT_SHIFT 0U +#define ROGUE_CR_MIPS_WRAPPER_IRQ_CLEAR_EVENT_CLRMSK 0xFFFFFFFEU +#define ROGUE_CR_MIPS_WRAPPER_IRQ_CLEAR_EVENT_EN 0x00000001U + +/* Register ROGUE_CR_MIPS_WRAPPER_NMI_ENABLE */ +#define ROGUE_CR_MIPS_WRAPPER_NMI_ENABLE 0x08B8U +#define ROGUE_CR_MIPS_WRAPPER_NMI_ENABLE_MASKFULL 0x0000000000000001ULL +#define ROGUE_CR_MIPS_WRAPPER_NMI_ENABLE_EVENT_SHIFT 0U +#define ROGUE_CR_MIPS_WRAPPER_NMI_ENABLE_EVENT_CLRMSK 0xFFFFFFFEU +#define ROGUE_CR_MIPS_WRAPPER_NMI_ENABLE_EVENT_EN 0x00000001U + +/* Register ROGUE_CR_MIPS_WRAPPER_NMI_EVENT */ +#define ROGUE_CR_MIPS_WRAPPER_NMI_EVENT 0x08C0U +#define ROGUE_CR_MIPS_WRAPPER_NMI_EVENT_MASKFULL 0x0000000000000001ULL +#define ROGUE_CR_MIPS_WRAPPER_NMI_EVENT_TRIGGER_SHIFT 0U +#define ROGUE_CR_MIPS_WRAPPER_NMI_EVENT_TRIGGER_CLRMSK 0xFFFFFFFEU +#define ROGUE_CR_MIPS_WRAPPER_NMI_EVENT_TRIGGER_EN 0x00000001U + +/* Register ROGUE_CR_MIPS_DEBUG_CONFIG */ +#define ROGUE_CR_MIPS_DEBUG_CONFIG 0x08C8U +#define ROGUE_CR_MIPS_DEBUG_CONFIG_MASKFULL 0x0000000000000001ULL +#define ROGUE_CR_MIPS_DEBUG_CONFIG_DISABLE_PROBE_DEBUG_SHIFT 0U +#define ROGUE_CR_MIPS_DEBUG_CONFIG_DISABLE_PROBE_DEBUG_CLRMSK 0xFFFFFFFEU +#define ROGUE_CR_MIPS_DEBUG_CONFIG_DISABLE_PROBE_DEBUG_EN 0x00000001U + +/* Register ROGUE_CR_MIPS_EXCEPTION_STATUS */ +#define ROGUE_CR_MIPS_EXCEPTION_STATUS 0x08D0U +#define ROGUE_CR_MIPS_EXCEPTION_STATUS_MASKFULL 0x000000000000003FULL +#define ROGUE_CR_MIPS_EXCEPTION_STATUS_SI_SLEEP_SHIFT 5U +#define ROGUE_CR_MIPS_EXCEPTION_STATUS_SI_SLEEP_CLRMSK 0xFFFFFFDFU +#define ROGUE_CR_MIPS_EXCEPTION_STATUS_SI_SLEEP_EN 0x00000020U +#define ROGUE_CR_MIPS_EXCEPTION_STATUS_SI_NMI_TAKEN_SHIFT 4U +#define ROGUE_CR_MIPS_EXCEPTION_STATUS_SI_NMI_TAKEN_CLRMSK 0xFFFFFFEFU +#define ROGUE_CR_MIPS_EXCEPTION_STATUS_SI_NMI_TAKEN_EN 0x00000010U +#define ROGUE_CR_MIPS_EXCEPTION_STATUS_SI_NEST_EXL_SHIFT 3U +#define ROGUE_CR_MIPS_EXCEPTION_STATUS_SI_NEST_EXL_CLRMSK 0xFFFFFFF7U +#define ROGUE_CR_MIPS_EXCEPTION_STATUS_SI_NEST_EXL_EN 0x00000008U +#define ROGUE_CR_MIPS_EXCEPTION_STATUS_SI_NEST_ERL_SHIFT 2U +#define ROGUE_CR_MIPS_EXCEPTION_STATUS_SI_NEST_ERL_CLRMSK 0xFFFFFFFBU +#define ROGUE_CR_MIPS_EXCEPTION_STATUS_SI_NEST_ERL_EN 0x00000004U +#define ROGUE_CR_MIPS_EXCEPTION_STATUS_SI_EXL_SHIFT 1U +#define ROGUE_CR_MIPS_EXCEPTION_STATUS_SI_EXL_CLRMSK 0xFFFFFFFDU +#define ROGUE_CR_MIPS_EXCEPTION_STATUS_SI_EXL_EN 0x00000002U +#define ROGUE_CR_MIPS_EXCEPTION_STATUS_SI_ERL_SHIFT 0U +#define ROGUE_CR_MIPS_EXCEPTION_STATUS_SI_ERL_CLRMSK 0xFFFFFFFEU +#define ROGUE_CR_MIPS_EXCEPTION_STATUS_SI_ERL_EN 0x00000001U + +/* Register ROGUE_CR_MIPS_WRAPPER_STATUS */ +#define ROGUE_CR_MIPS_WRAPPER_STATUS 0x08E8U +#define ROGUE_CR_MIPS_WRAPPER_STATUS_MASKFULL 0x00000000000000FFULL +#define ROGUE_CR_MIPS_WRAPPER_STATUS_OUTSTANDING_REQUESTS_SHIFT 0U +#define ROGUE_CR_MIPS_WRAPPER_STATUS_OUTSTANDING_REQUESTS_CLRMSK 0xFFFFFF00U + +/* Register ROGUE_CR_XPU_BROADCAST */ +#define ROGUE_CR_XPU_BROADCAST 0x0890U +#define ROGUE_CR_XPU_BROADCAST_MASKFULL 0x00000000000001FFULL +#define ROGUE_CR_XPU_BROADCAST_MASK_SHIFT 0U +#define ROGUE_CR_XPU_BROADCAST_MASK_CLRMSK 0xFFFFFE00U + +/* Register ROGUE_CR_META_SP_MSLVDATAX */ +#define ROGUE_CR_META_SP_MSLVDATAX 0x0A00U +#define ROGUE_CR_META_SP_MSLVDATAX_MASKFULL 0x00000000FFFFFFFFULL +#define ROGUE_CR_META_SP_MSLVDATAX_MSLVDATAX_SHIFT 0U +#define ROGUE_CR_META_SP_MSLVDATAX_MSLVDATAX_CLRMSK 0x00000000U + +/* Register ROGUE_CR_META_SP_MSLVDATAT */ +#define ROGUE_CR_META_SP_MSLVDATAT 0x0A08U +#define ROGUE_CR_META_SP_MSLVDATAT_MASKFULL 0x00000000FFFFFFFFULL +#define ROGUE_CR_META_SP_MSLVDATAT_MSLVDATAT_SHIFT 0U +#define ROGUE_CR_META_SP_MSLVDATAT_MSLVDATAT_CLRMSK 0x00000000U + +/* Register ROGUE_CR_META_SP_MSLVCTRL0 */ +#define ROGUE_CR_META_SP_MSLVCTRL0 0x0A10U +#define ROGUE_CR_META_SP_MSLVCTRL0_MASKFULL 0x00000000FFFFFFFFULL +#define ROGUE_CR_META_SP_MSLVCTRL0_ADDR_SHIFT 2U +#define ROGUE_CR_META_SP_MSLVCTRL0_ADDR_CLRMSK 0x00000003U +#define ROGUE_CR_META_SP_MSLVCTRL0_AUTOINCR_SHIFT 1U +#define ROGUE_CR_META_SP_MSLVCTRL0_AUTOINCR_CLRMSK 0xFFFFFFFDU +#define ROGUE_CR_META_SP_MSLVCTRL0_AUTOINCR_EN 0x00000002U +#define ROGUE_CR_META_SP_MSLVCTRL0_RD_SHIFT 0U +#define ROGUE_CR_META_SP_MSLVCTRL0_RD_CLRMSK 0xFFFFFFFEU +#define ROGUE_CR_META_SP_MSLVCTRL0_RD_EN 0x00000001U + +/* Register ROGUE_CR_META_SP_MSLVCTRL1 */ +#define ROGUE_CR_META_SP_MSLVCTRL1 0x0A18U +#define ROGUE_CR_META_SP_MSLVCTRL1_MASKFULL 0x00000000F7F4003FULL +#define ROGUE_CR_META_SP_MSLVCTRL1_DEFERRTHREAD_SHIFT 30U +#define ROGUE_CR_META_SP_MSLVCTRL1_DEFERRTHREAD_CLRMSK 0x3FFFFFFFU +#define ROGUE_CR_META_SP_MSLVCTRL1_LOCK2_INTERLOCK_SHIFT 29U +#define ROGUE_CR_META_SP_MSLVCTRL1_LOCK2_INTERLOCK_CLRMSK 0xDFFFFFFFU +#define ROGUE_CR_META_SP_MSLVCTRL1_LOCK2_INTERLOCK_EN 0x20000000U +#define ROGUE_CR_META_SP_MSLVCTRL1_ATOMIC_INTERLOCK_SHIFT 28U +#define ROGUE_CR_META_SP_MSLVCTRL1_ATOMIC_INTERLOCK_CLRMSK 0xEFFFFFFFU +#define ROGUE_CR_META_SP_MSLVCTRL1_ATOMIC_INTERLOCK_EN 0x10000000U +#define ROGUE_CR_META_SP_MSLVCTRL1_GBLPORT_IDLE_SHIFT 26U +#define ROGUE_CR_META_SP_MSLVCTRL1_GBLPORT_IDLE_CLRMSK 0xFBFFFFFFU +#define ROGUE_CR_META_SP_MSLVCTRL1_GBLPORT_IDLE_EN 0x04000000U +#define ROGUE_CR_META_SP_MSLVCTRL1_COREMEM_IDLE_SHIFT 25U +#define ROGUE_CR_META_SP_MSLVCTRL1_COREMEM_IDLE_CLRMSK 0xFDFFFFFFU +#define ROGUE_CR_META_SP_MSLVCTRL1_COREMEM_IDLE_EN 0x02000000U +#define ROGUE_CR_META_SP_MSLVCTRL1_READY_SHIFT 24U +#define ROGUE_CR_META_SP_MSLVCTRL1_READY_CLRMSK 0xFEFFFFFFU +#define ROGUE_CR_META_SP_MSLVCTRL1_READY_EN 0x01000000U +#define ROGUE_CR_META_SP_MSLVCTRL1_DEFERRID_SHIFT 21U +#define ROGUE_CR_META_SP_MSLVCTRL1_DEFERRID_CLRMSK 0xFF1FFFFFU +#define ROGUE_CR_META_SP_MSLVCTRL1_DEFERR_SHIFT 20U +#define ROGUE_CR_META_SP_MSLVCTRL1_DEFERR_CLRMSK 0xFFEFFFFFU +#define ROGUE_CR_META_SP_MSLVCTRL1_DEFERR_EN 0x00100000U +#define ROGUE_CR_META_SP_MSLVCTRL1_WR_ACTIVE_SHIFT 18U +#define ROGUE_CR_META_SP_MSLVCTRL1_WR_ACTIVE_CLRMSK 0xFFFBFFFFU +#define ROGUE_CR_META_SP_MSLVCTRL1_WR_ACTIVE_EN 0x00040000U +#define ROGUE_CR_META_SP_MSLVCTRL1_THREAD_SHIFT 4U +#define ROGUE_CR_META_SP_MSLVCTRL1_THREAD_CLRMSK 0xFFFFFFCFU +#define ROGUE_CR_META_SP_MSLVCTRL1_TRANS_SIZE_SHIFT 2U +#define ROGUE_CR_META_SP_MSLVCTRL1_TRANS_SIZE_CLRMSK 0xFFFFFFF3U +#define ROGUE_CR_META_SP_MSLVCTRL1_BYTE_ROUND_SHIFT 0U +#define ROGUE_CR_META_SP_MSLVCTRL1_BYTE_ROUND_CLRMSK 0xFFFFFFFCU + +/* Register ROGUE_CR_META_SP_MSLVHANDSHKE */ +#define ROGUE_CR_META_SP_MSLVHANDSHKE 0x0A50U +#define ROGUE_CR_META_SP_MSLVHANDSHKE_MASKFULL 0x000000000000000FULL +#define ROGUE_CR_META_SP_MSLVHANDSHKE_INPUT_SHIFT 2U +#define ROGUE_CR_META_SP_MSLVHANDSHKE_INPUT_CLRMSK 0xFFFFFFF3U +#define ROGUE_CR_META_SP_MSLVHANDSHKE_OUTPUT_SHIFT 0U +#define ROGUE_CR_META_SP_MSLVHANDSHKE_OUTPUT_CLRMSK 0xFFFFFFFCU + +/* Register ROGUE_CR_META_SP_MSLVT0KICK */ +#define ROGUE_CR_META_SP_MSLVT0KICK 0x0A80U +#define ROGUE_CR_META_SP_MSLVT0KICK_MASKFULL 0x000000000000FFFFULL +#define ROGUE_CR_META_SP_MSLVT0KICK_MSLVT0KICK_SHIFT 0U +#define ROGUE_CR_META_SP_MSLVT0KICK_MSLVT0KICK_CLRMSK 0xFFFF0000U + +/* Register ROGUE_CR_META_SP_MSLVT0KICKI */ +#define ROGUE_CR_META_SP_MSLVT0KICKI 0x0A88U +#define ROGUE_CR_META_SP_MSLVT0KICKI_MASKFULL 0x000000000000FFFFULL +#define ROGUE_CR_META_SP_MSLVT0KICKI_MSLVT0KICKI_SHIFT 0U +#define ROGUE_CR_META_SP_MSLVT0KICKI_MSLVT0KICKI_CLRMSK 0xFFFF0000U + +/* Register ROGUE_CR_META_SP_MSLVT1KICK */ +#define ROGUE_CR_META_SP_MSLVT1KICK 0x0A90U +#define ROGUE_CR_META_SP_MSLVT1KICK_MASKFULL 0x000000000000FFFFULL +#define ROGUE_CR_META_SP_MSLVT1KICK_MSLVT1KICK_SHIFT 0U +#define ROGUE_CR_META_SP_MSLVT1KICK_MSLVT1KICK_CLRMSK 0xFFFF0000U + +/* Register ROGUE_CR_META_SP_MSLVT1KICKI */ +#define ROGUE_CR_META_SP_MSLVT1KICKI 0x0A98U +#define ROGUE_CR_META_SP_MSLVT1KICKI_MASKFULL 0x000000000000FFFFULL +#define ROGUE_CR_META_SP_MSLVT1KICKI_MSLVT1KICKI_SHIFT 0U +#define ROGUE_CR_META_SP_MSLVT1KICKI_MSLVT1KICKI_CLRMSK 0xFFFF0000U + +/* Register ROGUE_CR_META_SP_MSLVT2KICK */ +#define ROGUE_CR_META_SP_MSLVT2KICK 0x0AA0U +#define ROGUE_CR_META_SP_MSLVT2KICK_MASKFULL 0x000000000000FFFFULL +#define ROGUE_CR_META_SP_MSLVT2KICK_MSLVT2KICK_SHIFT 0U +#define ROGUE_CR_META_SP_MSLVT2KICK_MSLVT2KICK_CLRMSK 0xFFFF0000U + +/* Register ROGUE_CR_META_SP_MSLVT2KICKI */ +#define ROGUE_CR_META_SP_MSLVT2KICKI 0x0AA8U +#define ROGUE_CR_META_SP_MSLVT2KICKI_MASKFULL 0x000000000000FFFFULL +#define ROGUE_CR_META_SP_MSLVT2KICKI_MSLVT2KICKI_SHIFT 0U +#define ROGUE_CR_META_SP_MSLVT2KICKI_MSLVT2KICKI_CLRMSK 0xFFFF0000U + +/* Register ROGUE_CR_META_SP_MSLVT3KICK */ +#define ROGUE_CR_META_SP_MSLVT3KICK 0x0AB0U +#define ROGUE_CR_META_SP_MSLVT3KICK_MASKFULL 0x000000000000FFFFULL +#define ROGUE_CR_META_SP_MSLVT3KICK_MSLVT3KICK_SHIFT 0U +#define ROGUE_CR_META_SP_MSLVT3KICK_MSLVT3KICK_CLRMSK 0xFFFF0000U + +/* Register ROGUE_CR_META_SP_MSLVT3KICKI */ +#define ROGUE_CR_META_SP_MSLVT3KICKI 0x0AB8U +#define ROGUE_CR_META_SP_MSLVT3KICKI_MASKFULL 0x000000000000FFFFULL +#define ROGUE_CR_META_SP_MSLVT3KICKI_MSLVT3KICKI_SHIFT 0U +#define ROGUE_CR_META_SP_MSLVT3KICKI_MSLVT3KICKI_CLRMSK 0xFFFF0000U + +/* Register ROGUE_CR_META_SP_MSLVRST */ +#define ROGUE_CR_META_SP_MSLVRST 0x0AC0U +#define ROGUE_CR_META_SP_MSLVRST_MASKFULL 0x0000000000000001ULL +#define ROGUE_CR_META_SP_MSLVRST_SOFTRESET_SHIFT 0U +#define ROGUE_CR_META_SP_MSLVRST_SOFTRESET_CLRMSK 0xFFFFFFFEU +#define ROGUE_CR_META_SP_MSLVRST_SOFTRESET_EN 0x00000001U + +/* Register ROGUE_CR_META_SP_MSLVIRQSTATUS */ +#define ROGUE_CR_META_SP_MSLVIRQSTATUS 0x0AC8U +#define ROGUE_CR_META_SP_MSLVIRQSTATUS_MASKFULL 0x000000000000000CULL +#define ROGUE_CR_META_SP_MSLVIRQSTATUS_TRIGVECT3_SHIFT 3U +#define ROGUE_CR_META_SP_MSLVIRQSTATUS_TRIGVECT3_CLRMSK 0xFFFFFFF7U +#define ROGUE_CR_META_SP_MSLVIRQSTATUS_TRIGVECT3_EN 0x00000008U +#define ROGUE_CR_META_SP_MSLVIRQSTATUS_TRIGVECT2_SHIFT 2U +#define ROGUE_CR_META_SP_MSLVIRQSTATUS_TRIGVECT2_CLRMSK 0xFFFFFFFBU +#define ROGUE_CR_META_SP_MSLVIRQSTATUS_TRIGVECT2_EN 0x00000004U + +/* Register ROGUE_CR_META_SP_MSLVIRQENABLE */ +#define ROGUE_CR_META_SP_MSLVIRQENABLE 0x0AD0U +#define ROGUE_CR_META_SP_MSLVIRQENABLE_MASKFULL 0x000000000000000CULL +#define ROGUE_CR_META_SP_MSLVIRQENABLE_EVENT1_SHIFT 3U +#define ROGUE_CR_META_SP_MSLVIRQENABLE_EVENT1_CLRMSK 0xFFFFFFF7U +#define ROGUE_CR_META_SP_MSLVIRQENABLE_EVENT1_EN 0x00000008U +#define ROGUE_CR_META_SP_MSLVIRQENABLE_EVENT0_SHIFT 2U +#define ROGUE_CR_META_SP_MSLVIRQENABLE_EVENT0_CLRMSK 0xFFFFFFFBU +#define ROGUE_CR_META_SP_MSLVIRQENABLE_EVENT0_EN 0x00000004U + +/* Register ROGUE_CR_META_SP_MSLVIRQLEVEL */ +#define ROGUE_CR_META_SP_MSLVIRQLEVEL 0x0AD8U +#define ROGUE_CR_META_SP_MSLVIRQLEVEL_MASKFULL 0x0000000000000001ULL +#define ROGUE_CR_META_SP_MSLVIRQLEVEL_MODE_SHIFT 0U +#define ROGUE_CR_META_SP_MSLVIRQLEVEL_MODE_CLRMSK 0xFFFFFFFEU +#define ROGUE_CR_META_SP_MSLVIRQLEVEL_MODE_EN 0x00000001U + +/* Register ROGUE_CR_MTS_SCHEDULE */ +#define ROGUE_CR_MTS_SCHEDULE 0x0B00U +#define ROGUE_CR_MTS_SCHEDULE_MASKFULL 0x00000000000001FFULL +#define ROGUE_CR_MTS_SCHEDULE_HOST_SHIFT 8U +#define ROGUE_CR_MTS_SCHEDULE_HOST_CLRMSK 0xFFFFFEFFU +#define ROGUE_CR_MTS_SCHEDULE_HOST_BG_TIMER 0x00000000U +#define ROGUE_CR_MTS_SCHEDULE_HOST_HOST 0x00000100U +#define ROGUE_CR_MTS_SCHEDULE_PRIORITY_SHIFT 6U +#define ROGUE_CR_MTS_SCHEDULE_PRIORITY_CLRMSK 0xFFFFFF3FU +#define ROGUE_CR_MTS_SCHEDULE_PRIORITY_PRT0 0x00000000U +#define ROGUE_CR_MTS_SCHEDULE_PRIORITY_PRT1 0x00000040U +#define ROGUE_CR_MTS_SCHEDULE_PRIORITY_PRT2 0x00000080U +#define ROGUE_CR_MTS_SCHEDULE_PRIORITY_PRT3 0x000000C0U +#define ROGUE_CR_MTS_SCHEDULE_CONTEXT_SHIFT 5U +#define ROGUE_CR_MTS_SCHEDULE_CONTEXT_CLRMSK 0xFFFFFFDFU +#define ROGUE_CR_MTS_SCHEDULE_CONTEXT_BGCTX 0x00000000U +#define ROGUE_CR_MTS_SCHEDULE_CONTEXT_INTCTX 0x00000020U +#define ROGUE_CR_MTS_SCHEDULE_TASK_SHIFT 4U +#define ROGUE_CR_MTS_SCHEDULE_TASK_CLRMSK 0xFFFFFFEFU +#define ROGUE_CR_MTS_SCHEDULE_TASK_NON_COUNTED 0x00000000U +#define ROGUE_CR_MTS_SCHEDULE_TASK_COUNTED 0x00000010U +#define ROGUE_CR_MTS_SCHEDULE_DM_SHIFT 0U +#define ROGUE_CR_MTS_SCHEDULE_DM_CLRMSK 0xFFFFFFF0U +#define ROGUE_CR_MTS_SCHEDULE_DM_DM0 0x00000000U +#define ROGUE_CR_MTS_SCHEDULE_DM_DM1 0x00000001U +#define ROGUE_CR_MTS_SCHEDULE_DM_DM2 0x00000002U +#define ROGUE_CR_MTS_SCHEDULE_DM_DM3 0x00000003U +#define ROGUE_CR_MTS_SCHEDULE_DM_DM4 0x00000004U +#define ROGUE_CR_MTS_SCHEDULE_DM_DM5 0x00000005U +#define ROGUE_CR_MTS_SCHEDULE_DM_DM6 0x00000006U +#define ROGUE_CR_MTS_SCHEDULE_DM_DM7 0x00000007U +#define ROGUE_CR_MTS_SCHEDULE_DM_DM_ALL 0x0000000FU + +/* Register ROGUE_CR_MTS_SCHEDULE1 */ +#define ROGUE_CR_MTS_SCHEDULE1 0x10B00U +#define ROGUE_CR_MTS_SCHEDULE1_MASKFULL 0x00000000000001FFULL +#define ROGUE_CR_MTS_SCHEDULE1_HOST_SHIFT 8U +#define ROGUE_CR_MTS_SCHEDULE1_HOST_CLRMSK 0xFFFFFEFFU +#define ROGUE_CR_MTS_SCHEDULE1_HOST_BG_TIMER 0x00000000U +#define ROGUE_CR_MTS_SCHEDULE1_HOST_HOST 0x00000100U +#define ROGUE_CR_MTS_SCHEDULE1_PRIORITY_SHIFT 6U +#define ROGUE_CR_MTS_SCHEDULE1_PRIORITY_CLRMSK 0xFFFFFF3FU +#define ROGUE_CR_MTS_SCHEDULE1_PRIORITY_PRT0 0x00000000U +#define ROGUE_CR_MTS_SCHEDULE1_PRIORITY_PRT1 0x00000040U +#define ROGUE_CR_MTS_SCHEDULE1_PRIORITY_PRT2 0x00000080U +#define ROGUE_CR_MTS_SCHEDULE1_PRIORITY_PRT3 0x000000C0U +#define ROGUE_CR_MTS_SCHEDULE1_CONTEXT_SHIFT 5U +#define ROGUE_CR_MTS_SCHEDULE1_CONTEXT_CLRMSK 0xFFFFFFDFU +#define ROGUE_CR_MTS_SCHEDULE1_CONTEXT_BGCTX 0x00000000U +#define ROGUE_CR_MTS_SCHEDULE1_CONTEXT_INTCTX 0x00000020U +#define ROGUE_CR_MTS_SCHEDULE1_TASK_SHIFT 4U +#define ROGUE_CR_MTS_SCHEDULE1_TASK_CLRMSK 0xFFFFFFEFU +#define ROGUE_CR_MTS_SCHEDULE1_TASK_NON_COUNTED 0x00000000U +#define ROGUE_CR_MTS_SCHEDULE1_TASK_COUNTED 0x00000010U +#define ROGUE_CR_MTS_SCHEDULE1_DM_SHIFT 0U +#define ROGUE_CR_MTS_SCHEDULE1_DM_CLRMSK 0xFFFFFFF0U +#define ROGUE_CR_MTS_SCHEDULE1_DM_DM0 0x00000000U +#define ROGUE_CR_MTS_SCHEDULE1_DM_DM1 0x00000001U +#define ROGUE_CR_MTS_SCHEDULE1_DM_DM2 0x00000002U +#define ROGUE_CR_MTS_SCHEDULE1_DM_DM3 0x00000003U +#define ROGUE_CR_MTS_SCHEDULE1_DM_DM4 0x00000004U +#define ROGUE_CR_MTS_SCHEDULE1_DM_DM5 0x00000005U +#define ROGUE_CR_MTS_SCHEDULE1_DM_DM6 0x00000006U +#define ROGUE_CR_MTS_SCHEDULE1_DM_DM7 0x00000007U +#define ROGUE_CR_MTS_SCHEDULE1_DM_DM_ALL 0x0000000FU + +/* Register ROGUE_CR_MTS_SCHEDULE2 */ +#define ROGUE_CR_MTS_SCHEDULE2 0x20B00U +#define ROGUE_CR_MTS_SCHEDULE2_MASKFULL 0x00000000000001FFULL +#define ROGUE_CR_MTS_SCHEDULE2_HOST_SHIFT 8U +#define ROGUE_CR_MTS_SCHEDULE2_HOST_CLRMSK 0xFFFFFEFFU +#define ROGUE_CR_MTS_SCHEDULE2_HOST_BG_TIMER 0x00000000U +#define ROGUE_CR_MTS_SCHEDULE2_HOST_HOST 0x00000100U +#define ROGUE_CR_MTS_SCHEDULE2_PRIORITY_SHIFT 6U +#define ROGUE_CR_MTS_SCHEDULE2_PRIORITY_CLRMSK 0xFFFFFF3FU +#define ROGUE_CR_MTS_SCHEDULE2_PRIORITY_PRT0 0x00000000U +#define ROGUE_CR_MTS_SCHEDULE2_PRIORITY_PRT1 0x00000040U +#define ROGUE_CR_MTS_SCHEDULE2_PRIORITY_PRT2 0x00000080U +#define ROGUE_CR_MTS_SCHEDULE2_PRIORITY_PRT3 0x000000C0U +#define ROGUE_CR_MTS_SCHEDULE2_CONTEXT_SHIFT 5U +#define ROGUE_CR_MTS_SCHEDULE2_CONTEXT_CLRMSK 0xFFFFFFDFU +#define ROGUE_CR_MTS_SCHEDULE2_CONTEXT_BGCTX 0x00000000U +#define ROGUE_CR_MTS_SCHEDULE2_CONTEXT_INTCTX 0x00000020U +#define ROGUE_CR_MTS_SCHEDULE2_TASK_SHIFT 4U +#define ROGUE_CR_MTS_SCHEDULE2_TASK_CLRMSK 0xFFFFFFEFU +#define ROGUE_CR_MTS_SCHEDULE2_TASK_NON_COUNTED 0x00000000U +#define ROGUE_CR_MTS_SCHEDULE2_TASK_COUNTED 0x00000010U +#define ROGUE_CR_MTS_SCHEDULE2_DM_SHIFT 0U +#define ROGUE_CR_MTS_SCHEDULE2_DM_CLRMSK 0xFFFFFFF0U +#define ROGUE_CR_MTS_SCHEDULE2_DM_DM0 0x00000000U +#define ROGUE_CR_MTS_SCHEDULE2_DM_DM1 0x00000001U +#define ROGUE_CR_MTS_SCHEDULE2_DM_DM2 0x00000002U +#define ROGUE_CR_MTS_SCHEDULE2_DM_DM3 0x00000003U +#define ROGUE_CR_MTS_SCHEDULE2_DM_DM4 0x00000004U +#define ROGUE_CR_MTS_SCHEDULE2_DM_DM5 0x00000005U +#define ROGUE_CR_MTS_SCHEDULE2_DM_DM6 0x00000006U +#define ROGUE_CR_MTS_SCHEDULE2_DM_DM7 0x00000007U +#define ROGUE_CR_MTS_SCHEDULE2_DM_DM_ALL 0x0000000FU + +/* Register ROGUE_CR_MTS_SCHEDULE3 */ +#define ROGUE_CR_MTS_SCHEDULE3 0x30B00U +#define ROGUE_CR_MTS_SCHEDULE3_MASKFULL 0x00000000000001FFULL +#define ROGUE_CR_MTS_SCHEDULE3_HOST_SHIFT 8U +#define ROGUE_CR_MTS_SCHEDULE3_HOST_CLRMSK 0xFFFFFEFFU +#define ROGUE_CR_MTS_SCHEDULE3_HOST_BG_TIMER 0x00000000U +#define ROGUE_CR_MTS_SCHEDULE3_HOST_HOST 0x00000100U +#define ROGUE_CR_MTS_SCHEDULE3_PRIORITY_SHIFT 6U +#define ROGUE_CR_MTS_SCHEDULE3_PRIORITY_CLRMSK 0xFFFFFF3FU +#define ROGUE_CR_MTS_SCHEDULE3_PRIORITY_PRT0 0x00000000U +#define ROGUE_CR_MTS_SCHEDULE3_PRIORITY_PRT1 0x00000040U +#define ROGUE_CR_MTS_SCHEDULE3_PRIORITY_PRT2 0x00000080U +#define ROGUE_CR_MTS_SCHEDULE3_PRIORITY_PRT3 0x000000C0U +#define ROGUE_CR_MTS_SCHEDULE3_CONTEXT_SHIFT 5U +#define ROGUE_CR_MTS_SCHEDULE3_CONTEXT_CLRMSK 0xFFFFFFDFU +#define ROGUE_CR_MTS_SCHEDULE3_CONTEXT_BGCTX 0x00000000U +#define ROGUE_CR_MTS_SCHEDULE3_CONTEXT_INTCTX 0x00000020U +#define ROGUE_CR_MTS_SCHEDULE3_TASK_SHIFT 4U +#define ROGUE_CR_MTS_SCHEDULE3_TASK_CLRMSK 0xFFFFFFEFU +#define ROGUE_CR_MTS_SCHEDULE3_TASK_NON_COUNTED 0x00000000U +#define ROGUE_CR_MTS_SCHEDULE3_TASK_COUNTED 0x00000010U +#define ROGUE_CR_MTS_SCHEDULE3_DM_SHIFT 0U +#define ROGUE_CR_MTS_SCHEDULE3_DM_CLRMSK 0xFFFFFFF0U +#define ROGUE_CR_MTS_SCHEDULE3_DM_DM0 0x00000000U +#define ROGUE_CR_MTS_SCHEDULE3_DM_DM1 0x00000001U +#define ROGUE_CR_MTS_SCHEDULE3_DM_DM2 0x00000002U +#define ROGUE_CR_MTS_SCHEDULE3_DM_DM3 0x00000003U +#define ROGUE_CR_MTS_SCHEDULE3_DM_DM4 0x00000004U +#define ROGUE_CR_MTS_SCHEDULE3_DM_DM5 0x00000005U +#define ROGUE_CR_MTS_SCHEDULE3_DM_DM6 0x00000006U +#define ROGUE_CR_MTS_SCHEDULE3_DM_DM7 0x00000007U +#define ROGUE_CR_MTS_SCHEDULE3_DM_DM_ALL 0x0000000FU + +/* Register ROGUE_CR_MTS_SCHEDULE4 */ +#define ROGUE_CR_MTS_SCHEDULE4 0x40B00U +#define ROGUE_CR_MTS_SCHEDULE4_MASKFULL 0x00000000000001FFULL +#define ROGUE_CR_MTS_SCHEDULE4_HOST_SHIFT 8U +#define ROGUE_CR_MTS_SCHEDULE4_HOST_CLRMSK 0xFFFFFEFFU +#define ROGUE_CR_MTS_SCHEDULE4_HOST_BG_TIMER 0x00000000U +#define ROGUE_CR_MTS_SCHEDULE4_HOST_HOST 0x00000100U +#define ROGUE_CR_MTS_SCHEDULE4_PRIORITY_SHIFT 6U +#define ROGUE_CR_MTS_SCHEDULE4_PRIORITY_CLRMSK 0xFFFFFF3FU +#define ROGUE_CR_MTS_SCHEDULE4_PRIORITY_PRT0 0x00000000U +#define ROGUE_CR_MTS_SCHEDULE4_PRIORITY_PRT1 0x00000040U +#define ROGUE_CR_MTS_SCHEDULE4_PRIORITY_PRT2 0x00000080U +#define ROGUE_CR_MTS_SCHEDULE4_PRIORITY_PRT3 0x000000C0U +#define ROGUE_CR_MTS_SCHEDULE4_CONTEXT_SHIFT 5U +#define ROGUE_CR_MTS_SCHEDULE4_CONTEXT_CLRMSK 0xFFFFFFDFU +#define ROGUE_CR_MTS_SCHEDULE4_CONTEXT_BGCTX 0x00000000U +#define ROGUE_CR_MTS_SCHEDULE4_CONTEXT_INTCTX 0x00000020U +#define ROGUE_CR_MTS_SCHEDULE4_TASK_SHIFT 4U +#define ROGUE_CR_MTS_SCHEDULE4_TASK_CLRMSK 0xFFFFFFEFU +#define ROGUE_CR_MTS_SCHEDULE4_TASK_NON_COUNTED 0x00000000U +#define ROGUE_CR_MTS_SCHEDULE4_TASK_COUNTED 0x00000010U +#define ROGUE_CR_MTS_SCHEDULE4_DM_SHIFT 0U +#define ROGUE_CR_MTS_SCHEDULE4_DM_CLRMSK 0xFFFFFFF0U +#define ROGUE_CR_MTS_SCHEDULE4_DM_DM0 0x00000000U +#define ROGUE_CR_MTS_SCHEDULE4_DM_DM1 0x00000001U +#define ROGUE_CR_MTS_SCHEDULE4_DM_DM2 0x00000002U +#define ROGUE_CR_MTS_SCHEDULE4_DM_DM3 0x00000003U +#define ROGUE_CR_MTS_SCHEDULE4_DM_DM4 0x00000004U +#define ROGUE_CR_MTS_SCHEDULE4_DM_DM5 0x00000005U +#define ROGUE_CR_MTS_SCHEDULE4_DM_DM6 0x00000006U +#define ROGUE_CR_MTS_SCHEDULE4_DM_DM7 0x00000007U +#define ROGUE_CR_MTS_SCHEDULE4_DM_DM_ALL 0x0000000FU + +/* Register ROGUE_CR_MTS_SCHEDULE5 */ +#define ROGUE_CR_MTS_SCHEDULE5 0x50B00U +#define ROGUE_CR_MTS_SCHEDULE5_MASKFULL 0x00000000000001FFULL +#define ROGUE_CR_MTS_SCHEDULE5_HOST_SHIFT 8U +#define ROGUE_CR_MTS_SCHEDULE5_HOST_CLRMSK 0xFFFFFEFFU +#define ROGUE_CR_MTS_SCHEDULE5_HOST_BG_TIMER 0x00000000U +#define ROGUE_CR_MTS_SCHEDULE5_HOST_HOST 0x00000100U +#define ROGUE_CR_MTS_SCHEDULE5_PRIORITY_SHIFT 6U +#define ROGUE_CR_MTS_SCHEDULE5_PRIORITY_CLRMSK 0xFFFFFF3FU +#define ROGUE_CR_MTS_SCHEDULE5_PRIORITY_PRT0 0x00000000U +#define ROGUE_CR_MTS_SCHEDULE5_PRIORITY_PRT1 0x00000040U +#define ROGUE_CR_MTS_SCHEDULE5_PRIORITY_PRT2 0x00000080U +#define ROGUE_CR_MTS_SCHEDULE5_PRIORITY_PRT3 0x000000C0U +#define ROGUE_CR_MTS_SCHEDULE5_CONTEXT_SHIFT 5U +#define ROGUE_CR_MTS_SCHEDULE5_CONTEXT_CLRMSK 0xFFFFFFDFU +#define ROGUE_CR_MTS_SCHEDULE5_CONTEXT_BGCTX 0x00000000U +#define ROGUE_CR_MTS_SCHEDULE5_CONTEXT_INTCTX 0x00000020U +#define ROGUE_CR_MTS_SCHEDULE5_TASK_SHIFT 4U +#define ROGUE_CR_MTS_SCHEDULE5_TASK_CLRMSK 0xFFFFFFEFU +#define ROGUE_CR_MTS_SCHEDULE5_TASK_NON_COUNTED 0x00000000U +#define ROGUE_CR_MTS_SCHEDULE5_TASK_COUNTED 0x00000010U +#define ROGUE_CR_MTS_SCHEDULE5_DM_SHIFT 0U +#define ROGUE_CR_MTS_SCHEDULE5_DM_CLRMSK 0xFFFFFFF0U +#define ROGUE_CR_MTS_SCHEDULE5_DM_DM0 0x00000000U +#define ROGUE_CR_MTS_SCHEDULE5_DM_DM1 0x00000001U +#define ROGUE_CR_MTS_SCHEDULE5_DM_DM2 0x00000002U +#define ROGUE_CR_MTS_SCHEDULE5_DM_DM3 0x00000003U +#define ROGUE_CR_MTS_SCHEDULE5_DM_DM4 0x00000004U +#define ROGUE_CR_MTS_SCHEDULE5_DM_DM5 0x00000005U +#define ROGUE_CR_MTS_SCHEDULE5_DM_DM6 0x00000006U +#define ROGUE_CR_MTS_SCHEDULE5_DM_DM7 0x00000007U +#define ROGUE_CR_MTS_SCHEDULE5_DM_DM_ALL 0x0000000FU + +/* Register ROGUE_CR_MTS_SCHEDULE6 */ +#define ROGUE_CR_MTS_SCHEDULE6 0x60B00U +#define ROGUE_CR_MTS_SCHEDULE6_MASKFULL 0x00000000000001FFULL +#define ROGUE_CR_MTS_SCHEDULE6_HOST_SHIFT 8U +#define ROGUE_CR_MTS_SCHEDULE6_HOST_CLRMSK 0xFFFFFEFFU +#define ROGUE_CR_MTS_SCHEDULE6_HOST_BG_TIMER 0x00000000U +#define ROGUE_CR_MTS_SCHEDULE6_HOST_HOST 0x00000100U +#define ROGUE_CR_MTS_SCHEDULE6_PRIORITY_SHIFT 6U +#define ROGUE_CR_MTS_SCHEDULE6_PRIORITY_CLRMSK 0xFFFFFF3FU +#define ROGUE_CR_MTS_SCHEDULE6_PRIORITY_PRT0 0x00000000U +#define ROGUE_CR_MTS_SCHEDULE6_PRIORITY_PRT1 0x00000040U +#define ROGUE_CR_MTS_SCHEDULE6_PRIORITY_PRT2 0x00000080U +#define ROGUE_CR_MTS_SCHEDULE6_PRIORITY_PRT3 0x000000C0U +#define ROGUE_CR_MTS_SCHEDULE6_CONTEXT_SHIFT 5U +#define ROGUE_CR_MTS_SCHEDULE6_CONTEXT_CLRMSK 0xFFFFFFDFU +#define ROGUE_CR_MTS_SCHEDULE6_CONTEXT_BGCTX 0x00000000U +#define ROGUE_CR_MTS_SCHEDULE6_CONTEXT_INTCTX 0x00000020U +#define ROGUE_CR_MTS_SCHEDULE6_TASK_SHIFT 4U +#define ROGUE_CR_MTS_SCHEDULE6_TASK_CLRMSK 0xFFFFFFEFU +#define ROGUE_CR_MTS_SCHEDULE6_TASK_NON_COUNTED 0x00000000U +#define ROGUE_CR_MTS_SCHEDULE6_TASK_COUNTED 0x00000010U +#define ROGUE_CR_MTS_SCHEDULE6_DM_SHIFT 0U +#define ROGUE_CR_MTS_SCHEDULE6_DM_CLRMSK 0xFFFFFFF0U +#define ROGUE_CR_MTS_SCHEDULE6_DM_DM0 0x00000000U +#define ROGUE_CR_MTS_SCHEDULE6_DM_DM1 0x00000001U +#define ROGUE_CR_MTS_SCHEDULE6_DM_DM2 0x00000002U +#define ROGUE_CR_MTS_SCHEDULE6_DM_DM3 0x00000003U +#define ROGUE_CR_MTS_SCHEDULE6_DM_DM4 0x00000004U +#define ROGUE_CR_MTS_SCHEDULE6_DM_DM5 0x00000005U +#define ROGUE_CR_MTS_SCHEDULE6_DM_DM6 0x00000006U +#define ROGUE_CR_MTS_SCHEDULE6_DM_DM7 0x00000007U +#define ROGUE_CR_MTS_SCHEDULE6_DM_DM_ALL 0x0000000FU + +/* Register ROGUE_CR_MTS_SCHEDULE7 */ +#define ROGUE_CR_MTS_SCHEDULE7 0x70B00U +#define ROGUE_CR_MTS_SCHEDULE7_MASKFULL 0x00000000000001FFULL +#define ROGUE_CR_MTS_SCHEDULE7_HOST_SHIFT 8U +#define ROGUE_CR_MTS_SCHEDULE7_HOST_CLRMSK 0xFFFFFEFFU +#define ROGUE_CR_MTS_SCHEDULE7_HOST_BG_TIMER 0x00000000U +#define ROGUE_CR_MTS_SCHEDULE7_HOST_HOST 0x00000100U +#define ROGUE_CR_MTS_SCHEDULE7_PRIORITY_SHIFT 6U +#define ROGUE_CR_MTS_SCHEDULE7_PRIORITY_CLRMSK 0xFFFFFF3FU +#define ROGUE_CR_MTS_SCHEDULE7_PRIORITY_PRT0 0x00000000U +#define ROGUE_CR_MTS_SCHEDULE7_PRIORITY_PRT1 0x00000040U +#define ROGUE_CR_MTS_SCHEDULE7_PRIORITY_PRT2 0x00000080U +#define ROGUE_CR_MTS_SCHEDULE7_PRIORITY_PRT3 0x000000C0U +#define ROGUE_CR_MTS_SCHEDULE7_CONTEXT_SHIFT 5U +#define ROGUE_CR_MTS_SCHEDULE7_CONTEXT_CLRMSK 0xFFFFFFDFU +#define ROGUE_CR_MTS_SCHEDULE7_CONTEXT_BGCTX 0x00000000U +#define ROGUE_CR_MTS_SCHEDULE7_CONTEXT_INTCTX 0x00000020U +#define ROGUE_CR_MTS_SCHEDULE7_TASK_SHIFT 4U +#define ROGUE_CR_MTS_SCHEDULE7_TASK_CLRMSK 0xFFFFFFEFU +#define ROGUE_CR_MTS_SCHEDULE7_TASK_NON_COUNTED 0x00000000U +#define ROGUE_CR_MTS_SCHEDULE7_TASK_COUNTED 0x00000010U +#define ROGUE_CR_MTS_SCHEDULE7_DM_SHIFT 0U +#define ROGUE_CR_MTS_SCHEDULE7_DM_CLRMSK 0xFFFFFFF0U +#define ROGUE_CR_MTS_SCHEDULE7_DM_DM0 0x00000000U +#define ROGUE_CR_MTS_SCHEDULE7_DM_DM1 0x00000001U +#define ROGUE_CR_MTS_SCHEDULE7_DM_DM2 0x00000002U +#define ROGUE_CR_MTS_SCHEDULE7_DM_DM3 0x00000003U +#define ROGUE_CR_MTS_SCHEDULE7_DM_DM4 0x00000004U +#define ROGUE_CR_MTS_SCHEDULE7_DM_DM5 0x00000005U +#define ROGUE_CR_MTS_SCHEDULE7_DM_DM6 0x00000006U +#define ROGUE_CR_MTS_SCHEDULE7_DM_DM7 0x00000007U +#define ROGUE_CR_MTS_SCHEDULE7_DM_DM_ALL 0x0000000FU + +/* Register ROGUE_CR_MTS_BGCTX_THREAD0_DM_ASSOC */ +#define ROGUE_CR_MTS_BGCTX_THREAD0_DM_ASSOC 0x0B30U +#define ROGUE_CR_MTS_BGCTX_THREAD0_DM_ASSOC_MASKFULL 0x000000000000FFFFULL +#define ROGUE_CR_MTS_BGCTX_THREAD0_DM_ASSOC_DM_ASSOC_SHIFT 0U +#define ROGUE_CR_MTS_BGCTX_THREAD0_DM_ASSOC_DM_ASSOC_CLRMSK 0xFFFF0000U + +/* Register ROGUE_CR_MTS_BGCTX_THREAD1_DM_ASSOC */ +#define ROGUE_CR_MTS_BGCTX_THREAD1_DM_ASSOC 0x0B38U +#define ROGUE_CR_MTS_BGCTX_THREAD1_DM_ASSOC_MASKFULL 0x000000000000FFFFULL +#define ROGUE_CR_MTS_BGCTX_THREAD1_DM_ASSOC_DM_ASSOC_SHIFT 0U +#define ROGUE_CR_MTS_BGCTX_THREAD1_DM_ASSOC_DM_ASSOC_CLRMSK 0xFFFF0000U + +/* Register ROGUE_CR_MTS_INTCTX_THREAD0_DM_ASSOC */ +#define ROGUE_CR_MTS_INTCTX_THREAD0_DM_ASSOC 0x0B40U +#define ROGUE_CR_MTS_INTCTX_THREAD0_DM_ASSOC_MASKFULL 0x000000000000FFFFULL +#define ROGUE_CR_MTS_INTCTX_THREAD0_DM_ASSOC_DM_ASSOC_SHIFT 0U +#define ROGUE_CR_MTS_INTCTX_THREAD0_DM_ASSOC_DM_ASSOC_CLRMSK 0xFFFF0000U + +/* Register ROGUE_CR_MTS_INTCTX_THREAD1_DM_ASSOC */ +#define ROGUE_CR_MTS_INTCTX_THREAD1_DM_ASSOC 0x0B48U +#define ROGUE_CR_MTS_INTCTX_THREAD1_DM_ASSOC_MASKFULL 0x000000000000FFFFULL +#define ROGUE_CR_MTS_INTCTX_THREAD1_DM_ASSOC_DM_ASSOC_SHIFT 0U +#define ROGUE_CR_MTS_INTCTX_THREAD1_DM_ASSOC_DM_ASSOC_CLRMSK 0xFFFF0000U + +/* Register ROGUE_CR_MTS_GARTEN_WRAPPER_CONFIG */ +#define ROGUE_CR_MTS_GARTEN_WRAPPER_CONFIG 0x0B50U +#define ROGUE_CR_MTS_GARTEN_WRAPPER_CONFIG__S7_TOP__MASKFULL 0x000FF0FFFFFFF701ULL +#define ROGUE_CR_MTS_GARTEN_WRAPPER_CONFIG_MASKFULL 0x0000FFFFFFFFF001ULL +#define ROGUE_CR_MTS_GARTEN_WRAPPER_CONFIG_FENCE_PC_BASE_SHIFT 44U +#define ROGUE_CR_MTS_GARTEN_WRAPPER_CONFIG_FENCE_PC_BASE_CLRMSK 0xFFFF0FFFFFFFFFFFULL +#define ROGUE_CR_MTS_GARTEN_WRAPPER_CONFIG__S7_TOP__FENCE_PC_BASE_SHIFT 44U +#define ROGUE_CR_MTS_GARTEN_WRAPPER_CONFIG__S7_TOP__FENCE_PC_BASE_CLRMSK 0xFFF00FFFFFFFFFFFULL +#define ROGUE_CR_MTS_GARTEN_WRAPPER_CONFIG_FENCE_DM_SHIFT 40U +#define ROGUE_CR_MTS_GARTEN_WRAPPER_CONFIG_FENCE_DM_CLRMSK 0xFFFFF0FFFFFFFFFFULL +#define ROGUE_CR_MTS_GARTEN_WRAPPER_CONFIG_FENCE_ADDR_SHIFT 12U +#define ROGUE_CR_MTS_GARTEN_WRAPPER_CONFIG_FENCE_ADDR_CLRMSK 0xFFFFFF0000000FFFULL +#define ROGUE_CR_MTS_GARTEN_WRAPPER_CONFIG_FENCE_PERSISTENCE_SHIFT 9U +#define ROGUE_CR_MTS_GARTEN_WRAPPER_CONFIG_FENCE_PERSISTENCE_CLRMSK 0xFFFFFFFFFFFFF9FFULL +#define ROGUE_CR_MTS_GARTEN_WRAPPER_CONFIG_FENCE_SLC_COHERENT_SHIFT 8U +#define ROGUE_CR_MTS_GARTEN_WRAPPER_CONFIG_FENCE_SLC_COHERENT_CLRMSK 0xFFFFFFFFFFFFFEFFULL +#define ROGUE_CR_MTS_GARTEN_WRAPPER_CONFIG_FENCE_SLC_COHERENT_EN 0x0000000000000100ULL +#define ROGUE_CR_MTS_GARTEN_WRAPPER_CONFIG_IDLE_CTRL_SHIFT 0U +#define ROGUE_CR_MTS_GARTEN_WRAPPER_CONFIG_IDLE_CTRL_CLRMSK 0xFFFFFFFFFFFFFFFEULL +#define ROGUE_CR_MTS_GARTEN_WRAPPER_CONFIG_IDLE_CTRL_META 0x0000000000000000ULL +#define ROGUE_CR_MTS_GARTEN_WRAPPER_CONFIG_IDLE_CTRL_MTS 0x0000000000000001ULL + +/* Register ROGUE_CR_MTS_DM0_INTERRUPT_ENABLE */ +#define ROGUE_CR_MTS_DM0_INTERRUPT_ENABLE 0x0B58U +#define ROGUE_CR_MTS_DM0_INTERRUPT_ENABLE_MASKFULL 0x00000000FFFFFFFFULL +#define ROGUE_CR_MTS_DM0_INTERRUPT_ENABLE_INT_ENABLE_SHIFT 0U +#define ROGUE_CR_MTS_DM0_INTERRUPT_ENABLE_INT_ENABLE_CLRMSK 0x00000000U + +/* Register ROGUE_CR_MTS_DM1_INTERRUPT_ENABLE */ +#define ROGUE_CR_MTS_DM1_INTERRUPT_ENABLE 0x0B60U +#define ROGUE_CR_MTS_DM1_INTERRUPT_ENABLE_MASKFULL 0x00000000FFFFFFFFULL +#define ROGUE_CR_MTS_DM1_INTERRUPT_ENABLE_INT_ENABLE_SHIFT 0U +#define ROGUE_CR_MTS_DM1_INTERRUPT_ENABLE_INT_ENABLE_CLRMSK 0x00000000U + +/* Register ROGUE_CR_MTS_DM2_INTERRUPT_ENABLE */ +#define ROGUE_CR_MTS_DM2_INTERRUPT_ENABLE 0x0B68U +#define ROGUE_CR_MTS_DM2_INTERRUPT_ENABLE_MASKFULL 0x00000000FFFFFFFFULL +#define ROGUE_CR_MTS_DM2_INTERRUPT_ENABLE_INT_ENABLE_SHIFT 0U +#define ROGUE_CR_MTS_DM2_INTERRUPT_ENABLE_INT_ENABLE_CLRMSK 0x00000000U + +/* Register ROGUE_CR_MTS_DM3_INTERRUPT_ENABLE */ +#define ROGUE_CR_MTS_DM3_INTERRUPT_ENABLE 0x0B70U +#define ROGUE_CR_MTS_DM3_INTERRUPT_ENABLE_MASKFULL 0x00000000FFFFFFFFULL +#define ROGUE_CR_MTS_DM3_INTERRUPT_ENABLE_INT_ENABLE_SHIFT 0U +#define ROGUE_CR_MTS_DM3_INTERRUPT_ENABLE_INT_ENABLE_CLRMSK 0x00000000U + +/* Register ROGUE_CR_MTS_DM4_INTERRUPT_ENABLE */ +#define ROGUE_CR_MTS_DM4_INTERRUPT_ENABLE 0x0B78U +#define ROGUE_CR_MTS_DM4_INTERRUPT_ENABLE_MASKFULL 0x00000000FFFFFFFFULL +#define ROGUE_CR_MTS_DM4_INTERRUPT_ENABLE_INT_ENABLE_SHIFT 0U +#define ROGUE_CR_MTS_DM4_INTERRUPT_ENABLE_INT_ENABLE_CLRMSK 0x00000000U + +/* Register ROGUE_CR_MTS_DM5_INTERRUPT_ENABLE */ +#define ROGUE_CR_MTS_DM5_INTERRUPT_ENABLE 0x0B80U +#define ROGUE_CR_MTS_DM5_INTERRUPT_ENABLE_MASKFULL 0x00000000FFFFFFFFULL +#define ROGUE_CR_MTS_DM5_INTERRUPT_ENABLE_INT_ENABLE_SHIFT 0U +#define ROGUE_CR_MTS_DM5_INTERRUPT_ENABLE_INT_ENABLE_CLRMSK 0x00000000U + +/* Register ROGUE_CR_MTS_INTCTX */ +#define ROGUE_CR_MTS_INTCTX 0x0B98U +#define ROGUE_CR_MTS_INTCTX_MASKFULL 0x000000003FFFFFFFULL +#define ROGUE_CR_MTS_INTCTX_DM_HOST_SCHEDULE_SHIFT 22U +#define ROGUE_CR_MTS_INTCTX_DM_HOST_SCHEDULE_CLRMSK 0xC03FFFFFU +#define ROGUE_CR_MTS_INTCTX_DM_PTR_SHIFT 18U +#define ROGUE_CR_MTS_INTCTX_DM_PTR_CLRMSK 0xFFC3FFFFU +#define ROGUE_CR_MTS_INTCTX_THREAD_ACTIVE_SHIFT 16U +#define ROGUE_CR_MTS_INTCTX_THREAD_ACTIVE_CLRMSK 0xFFFCFFFFU +#define ROGUE_CR_MTS_INTCTX_DM_TIMER_SCHEDULE_SHIFT 8U +#define ROGUE_CR_MTS_INTCTX_DM_TIMER_SCHEDULE_CLRMSK 0xFFFF00FFU +#define ROGUE_CR_MTS_INTCTX_DM_INTERRUPT_SCHEDULE_SHIFT 0U +#define ROGUE_CR_MTS_INTCTX_DM_INTERRUPT_SCHEDULE_CLRMSK 0xFFFFFF00U + +/* Register ROGUE_CR_MTS_BGCTX */ +#define ROGUE_CR_MTS_BGCTX 0x0BA0U +#define ROGUE_CR_MTS_BGCTX_MASKFULL 0x0000000000003FFFULL +#define ROGUE_CR_MTS_BGCTX_DM_PTR_SHIFT 10U +#define ROGUE_CR_MTS_BGCTX_DM_PTR_CLRMSK 0xFFFFC3FFU +#define ROGUE_CR_MTS_BGCTX_THREAD_ACTIVE_SHIFT 8U +#define ROGUE_CR_MTS_BGCTX_THREAD_ACTIVE_CLRMSK 0xFFFFFCFFU +#define ROGUE_CR_MTS_BGCTX_DM_NONCOUNTED_SCHEDULE_SHIFT 0U +#define ROGUE_CR_MTS_BGCTX_DM_NONCOUNTED_SCHEDULE_CLRMSK 0xFFFFFF00U + +/* Register ROGUE_CR_MTS_BGCTX_COUNTED_SCHEDULE */ +#define ROGUE_CR_MTS_BGCTX_COUNTED_SCHEDULE 0x0BA8U +#define ROGUE_CR_MTS_BGCTX_COUNTED_SCHEDULE_MASKFULL 0xFFFFFFFFFFFFFFFFULL +#define ROGUE_CR_MTS_BGCTX_COUNTED_SCHEDULE_DM7_SHIFT 56U +#define ROGUE_CR_MTS_BGCTX_COUNTED_SCHEDULE_DM7_CLRMSK 0x00FFFFFFFFFFFFFFULL +#define ROGUE_CR_MTS_BGCTX_COUNTED_SCHEDULE_DM6_SHIFT 48U +#define ROGUE_CR_MTS_BGCTX_COUNTED_SCHEDULE_DM6_CLRMSK 0xFF00FFFFFFFFFFFFULL +#define ROGUE_CR_MTS_BGCTX_COUNTED_SCHEDULE_DM5_SHIFT 40U +#define ROGUE_CR_MTS_BGCTX_COUNTED_SCHEDULE_DM5_CLRMSK 0xFFFF00FFFFFFFFFFULL +#define ROGUE_CR_MTS_BGCTX_COUNTED_SCHEDULE_DM4_SHIFT 32U +#define ROGUE_CR_MTS_BGCTX_COUNTED_SCHEDULE_DM4_CLRMSK 0xFFFFFF00FFFFFFFFULL +#define ROGUE_CR_MTS_BGCTX_COUNTED_SCHEDULE_DM3_SHIFT 24U +#define ROGUE_CR_MTS_BGCTX_COUNTED_SCHEDULE_DM3_CLRMSK 0xFFFFFFFF00FFFFFFULL +#define ROGUE_CR_MTS_BGCTX_COUNTED_SCHEDULE_DM2_SHIFT 16U +#define ROGUE_CR_MTS_BGCTX_COUNTED_SCHEDULE_DM2_CLRMSK 0xFFFFFFFFFF00FFFFULL +#define ROGUE_CR_MTS_BGCTX_COUNTED_SCHEDULE_DM1_SHIFT 8U +#define ROGUE_CR_MTS_BGCTX_COUNTED_SCHEDULE_DM1_CLRMSK 0xFFFFFFFFFFFF00FFULL +#define ROGUE_CR_MTS_BGCTX_COUNTED_SCHEDULE_DM0_SHIFT 0U +#define ROGUE_CR_MTS_BGCTX_COUNTED_SCHEDULE_DM0_CLRMSK 0xFFFFFFFFFFFFFF00ULL + +/* Register ROGUE_CR_MTS_GPU_INT_STATUS */ +#define ROGUE_CR_MTS_GPU_INT_STATUS 0x0BB0U +#define ROGUE_CR_MTS_GPU_INT_STATUS_MASKFULL 0x00000000FFFFFFFFULL +#define ROGUE_CR_MTS_GPU_INT_STATUS_STATUS_SHIFT 0U +#define ROGUE_CR_MTS_GPU_INT_STATUS_STATUS_CLRMSK 0x00000000U + +/* Register ROGUE_CR_MTS_SCHEDULE_ENABLE */ +#define ROGUE_CR_MTS_SCHEDULE_ENABLE 0x0BC8U +#define ROGUE_CR_MTS_SCHEDULE_ENABLE_MASKFULL 0x00000000000000FFULL +#define ROGUE_CR_MTS_SCHEDULE_ENABLE_MASK_SHIFT 0U +#define ROGUE_CR_MTS_SCHEDULE_ENABLE_MASK_CLRMSK 0xFFFFFF00U + +/* Register ROGUE_CR_IRQ_OS0_EVENT_STATUS */ +#define ROGUE_CR_IRQ_OS0_EVENT_STATUS 0x0BD8U +#define ROGUE_CR_IRQ_OS0_EVENT_STATUS_MASKFULL 0x0000000000000001ULL +#define ROGUE_CR_IRQ_OS0_EVENT_STATUS_SOURCE_SHIFT 0U +#define ROGUE_CR_IRQ_OS0_EVENT_STATUS_SOURCE_CLRMSK 0xFFFFFFFEU +#define ROGUE_CR_IRQ_OS0_EVENT_STATUS_SOURCE_EN 0x00000001U + +/* Register ROGUE_CR_IRQ_OS0_EVENT_CLEAR */ +#define ROGUE_CR_IRQ_OS0_EVENT_CLEAR 0x0BE8U +#define ROGUE_CR_IRQ_OS0_EVENT_CLEAR_MASKFULL 0x0000000000000001ULL +#define ROGUE_CR_IRQ_OS0_EVENT_CLEAR_SOURCE_SHIFT 0U +#define ROGUE_CR_IRQ_OS0_EVENT_CLEAR_SOURCE_CLRMSK 0xFFFFFFFEU +#define ROGUE_CR_IRQ_OS0_EVENT_CLEAR_SOURCE_EN 0x00000001U + +/* Register ROGUE_CR_IRQ_OS1_EVENT_STATUS */ +#define ROGUE_CR_IRQ_OS1_EVENT_STATUS 0x10BD8U +#define ROGUE_CR_IRQ_OS1_EVENT_STATUS_MASKFULL 0x0000000000000001ULL +#define ROGUE_CR_IRQ_OS1_EVENT_STATUS_SOURCE_SHIFT 0U +#define ROGUE_CR_IRQ_OS1_EVENT_STATUS_SOURCE_CLRMSK 0xFFFFFFFEU +#define ROGUE_CR_IRQ_OS1_EVENT_STATUS_SOURCE_EN 0x00000001U + +/* Register ROGUE_CR_IRQ_OS1_EVENT_CLEAR */ +#define ROGUE_CR_IRQ_OS1_EVENT_CLEAR 0x10BE8U +#define ROGUE_CR_IRQ_OS1_EVENT_CLEAR_MASKFULL 0x0000000000000001ULL +#define ROGUE_CR_IRQ_OS1_EVENT_CLEAR_SOURCE_SHIFT 0U +#define ROGUE_CR_IRQ_OS1_EVENT_CLEAR_SOURCE_CLRMSK 0xFFFFFFFEU +#define ROGUE_CR_IRQ_OS1_EVENT_CLEAR_SOURCE_EN 0x00000001U + +/* Register ROGUE_CR_IRQ_OS2_EVENT_STATUS */ +#define ROGUE_CR_IRQ_OS2_EVENT_STATUS 0x20BD8U +#define ROGUE_CR_IRQ_OS2_EVENT_STATUS_MASKFULL 0x0000000000000001ULL +#define ROGUE_CR_IRQ_OS2_EVENT_STATUS_SOURCE_SHIFT 0U +#define ROGUE_CR_IRQ_OS2_EVENT_STATUS_SOURCE_CLRMSK 0xFFFFFFFEU +#define ROGUE_CR_IRQ_OS2_EVENT_STATUS_SOURCE_EN 0x00000001U + +/* Register ROGUE_CR_IRQ_OS2_EVENT_CLEAR */ +#define ROGUE_CR_IRQ_OS2_EVENT_CLEAR 0x20BE8U +#define ROGUE_CR_IRQ_OS2_EVENT_CLEAR_MASKFULL 0x0000000000000001ULL +#define ROGUE_CR_IRQ_OS2_EVENT_CLEAR_SOURCE_SHIFT 0U +#define ROGUE_CR_IRQ_OS2_EVENT_CLEAR_SOURCE_CLRMSK 0xFFFFFFFEU +#define ROGUE_CR_IRQ_OS2_EVENT_CLEAR_SOURCE_EN 0x00000001U + +/* Register ROGUE_CR_IRQ_OS3_EVENT_STATUS */ +#define ROGUE_CR_IRQ_OS3_EVENT_STATUS 0x30BD8U +#define ROGUE_CR_IRQ_OS3_EVENT_STATUS_MASKFULL 0x0000000000000001ULL +#define ROGUE_CR_IRQ_OS3_EVENT_STATUS_SOURCE_SHIFT 0U +#define ROGUE_CR_IRQ_OS3_EVENT_STATUS_SOURCE_CLRMSK 0xFFFFFFFEU +#define ROGUE_CR_IRQ_OS3_EVENT_STATUS_SOURCE_EN 0x00000001U + +/* Register ROGUE_CR_IRQ_OS3_EVENT_CLEAR */ +#define ROGUE_CR_IRQ_OS3_EVENT_CLEAR 0x30BE8U +#define ROGUE_CR_IRQ_OS3_EVENT_CLEAR_MASKFULL 0x0000000000000001ULL +#define ROGUE_CR_IRQ_OS3_EVENT_CLEAR_SOURCE_SHIFT 0U +#define ROGUE_CR_IRQ_OS3_EVENT_CLEAR_SOURCE_CLRMSK 0xFFFFFFFEU +#define ROGUE_CR_IRQ_OS3_EVENT_CLEAR_SOURCE_EN 0x00000001U + +/* Register ROGUE_CR_IRQ_OS4_EVENT_STATUS */ +#define ROGUE_CR_IRQ_OS4_EVENT_STATUS 0x40BD8U +#define ROGUE_CR_IRQ_OS4_EVENT_STATUS_MASKFULL 0x0000000000000001ULL +#define ROGUE_CR_IRQ_OS4_EVENT_STATUS_SOURCE_SHIFT 0U +#define ROGUE_CR_IRQ_OS4_EVENT_STATUS_SOURCE_CLRMSK 0xFFFFFFFEU +#define ROGUE_CR_IRQ_OS4_EVENT_STATUS_SOURCE_EN 0x00000001U + +/* Register ROGUE_CR_IRQ_OS4_EVENT_CLEAR */ +#define ROGUE_CR_IRQ_OS4_EVENT_CLEAR 0x40BE8U +#define ROGUE_CR_IRQ_OS4_EVENT_CLEAR_MASKFULL 0x0000000000000001ULL +#define ROGUE_CR_IRQ_OS4_EVENT_CLEAR_SOURCE_SHIFT 0U +#define ROGUE_CR_IRQ_OS4_EVENT_CLEAR_SOURCE_CLRMSK 0xFFFFFFFEU +#define ROGUE_CR_IRQ_OS4_EVENT_CLEAR_SOURCE_EN 0x00000001U + +/* Register ROGUE_CR_IRQ_OS5_EVENT_STATUS */ +#define ROGUE_CR_IRQ_OS5_EVENT_STATUS 0x50BD8U +#define ROGUE_CR_IRQ_OS5_EVENT_STATUS_MASKFULL 0x0000000000000001ULL +#define ROGUE_CR_IRQ_OS5_EVENT_STATUS_SOURCE_SHIFT 0U +#define ROGUE_CR_IRQ_OS5_EVENT_STATUS_SOURCE_CLRMSK 0xFFFFFFFEU +#define ROGUE_CR_IRQ_OS5_EVENT_STATUS_SOURCE_EN 0x00000001U + +/* Register ROGUE_CR_IRQ_OS5_EVENT_CLEAR */ +#define ROGUE_CR_IRQ_OS5_EVENT_CLEAR 0x50BE8U +#define ROGUE_CR_IRQ_OS5_EVENT_CLEAR_MASKFULL 0x0000000000000001ULL +#define ROGUE_CR_IRQ_OS5_EVENT_CLEAR_SOURCE_SHIFT 0U +#define ROGUE_CR_IRQ_OS5_EVENT_CLEAR_SOURCE_CLRMSK 0xFFFFFFFEU +#define ROGUE_CR_IRQ_OS5_EVENT_CLEAR_SOURCE_EN 0x00000001U + +/* Register ROGUE_CR_IRQ_OS6_EVENT_STATUS */ +#define ROGUE_CR_IRQ_OS6_EVENT_STATUS 0x60BD8U +#define ROGUE_CR_IRQ_OS6_EVENT_STATUS_MASKFULL 0x0000000000000001ULL +#define ROGUE_CR_IRQ_OS6_EVENT_STATUS_SOURCE_SHIFT 0U +#define ROGUE_CR_IRQ_OS6_EVENT_STATUS_SOURCE_CLRMSK 0xFFFFFFFEU +#define ROGUE_CR_IRQ_OS6_EVENT_STATUS_SOURCE_EN 0x00000001U + +/* Register ROGUE_CR_IRQ_OS6_EVENT_CLEAR */ +#define ROGUE_CR_IRQ_OS6_EVENT_CLEAR 0x60BE8U +#define ROGUE_CR_IRQ_OS6_EVENT_CLEAR_MASKFULL 0x0000000000000001ULL +#define ROGUE_CR_IRQ_OS6_EVENT_CLEAR_SOURCE_SHIFT 0U +#define ROGUE_CR_IRQ_OS6_EVENT_CLEAR_SOURCE_CLRMSK 0xFFFFFFFEU +#define ROGUE_CR_IRQ_OS6_EVENT_CLEAR_SOURCE_EN 0x00000001U + +/* Register ROGUE_CR_IRQ_OS7_EVENT_STATUS */ +#define ROGUE_CR_IRQ_OS7_EVENT_STATUS 0x70BD8U +#define ROGUE_CR_IRQ_OS7_EVENT_STATUS_MASKFULL 0x0000000000000001ULL +#define ROGUE_CR_IRQ_OS7_EVENT_STATUS_SOURCE_SHIFT 0U +#define ROGUE_CR_IRQ_OS7_EVENT_STATUS_SOURCE_CLRMSK 0xFFFFFFFEU +#define ROGUE_CR_IRQ_OS7_EVENT_STATUS_SOURCE_EN 0x00000001U + +/* Register ROGUE_CR_IRQ_OS7_EVENT_CLEAR */ +#define ROGUE_CR_IRQ_OS7_EVENT_CLEAR 0x70BE8U +#define ROGUE_CR_IRQ_OS7_EVENT_CLEAR_MASKFULL 0x0000000000000001ULL +#define ROGUE_CR_IRQ_OS7_EVENT_CLEAR_SOURCE_SHIFT 0U +#define ROGUE_CR_IRQ_OS7_EVENT_CLEAR_SOURCE_CLRMSK 0xFFFFFFFEU +#define ROGUE_CR_IRQ_OS7_EVENT_CLEAR_SOURCE_EN 0x00000001U + +/* Register ROGUE_CR_META_BOOT */ +#define ROGUE_CR_META_BOOT 0x0BF8U +#define ROGUE_CR_META_BOOT_MASKFULL 0x0000000000000001ULL +#define ROGUE_CR_META_BOOT_MODE_SHIFT 0U +#define ROGUE_CR_META_BOOT_MODE_CLRMSK 0xFFFFFFFEU +#define ROGUE_CR_META_BOOT_MODE_EN 0x00000001U + +/* Register ROGUE_CR_GARTEN_SLC */ +#define ROGUE_CR_GARTEN_SLC 0x0BB8U +#define ROGUE_CR_GARTEN_SLC_MASKFULL 0x0000000000000001ULL +#define ROGUE_CR_GARTEN_SLC_FORCE_COHERENCY_SHIFT 0U +#define ROGUE_CR_GARTEN_SLC_FORCE_COHERENCY_CLRMSK 0xFFFFFFFEU +#define ROGUE_CR_GARTEN_SLC_FORCE_COHERENCY_EN 0x00000001U + +/* Register ROGUE_CR_PPP */ +#define ROGUE_CR_PPP 0x0CD0U +#define ROGUE_CR_PPP_MASKFULL 0x00000000FFFFFFFFULL +#define ROGUE_CR_PPP_CHECKSUM_SHIFT 0U +#define ROGUE_CR_PPP_CHECKSUM_CLRMSK 0x00000000U + +#define ROGUE_CR_ISP_RENDER_DIR_TYPE_MASK 0x00000003U +/* Top-left to bottom-right */ +#define ROGUE_CR_ISP_RENDER_DIR_TYPE_TL2BR 0x00000000U +/* Top-right to bottom-left */ +#define ROGUE_CR_ISP_RENDER_DIR_TYPE_TR2BL 0x00000001U +/* Bottom-left to top-right */ +#define ROGUE_CR_ISP_RENDER_DIR_TYPE_BL2TR 0x00000002U +/* Bottom-right to top-left */ +#define ROGUE_CR_ISP_RENDER_DIR_TYPE_BR2TL 0x00000003U + +#define ROGUE_CR_ISP_RENDER_MODE_TYPE_MASK 0x00000003U +/* Normal render */ +#define ROGUE_CR_ISP_RENDER_MODE_TYPE_NORM 0x00000000U +/* Fast 2D render */ +#define ROGUE_CR_ISP_RENDER_MODE_TYPE_FAST_2D 0x00000002U +/* Fast scale render */ +#define ROGUE_CR_ISP_RENDER_MODE_TYPE_FAST_SCALE 0x00000003U + +/* Register ROGUE_CR_ISP_RENDER */ +#define ROGUE_CR_ISP_RENDER 0x0F08U +#define ROGUE_CR_ISP_RENDER_MASKFULL 0x00000000000001FFULL +#define ROGUE_CR_ISP_RENDER_FAST_RENDER_FORCE_PROTECT_SHIFT 8U +#define ROGUE_CR_ISP_RENDER_FAST_RENDER_FORCE_PROTECT_CLRMSK 0xFFFFFEFFU +#define ROGUE_CR_ISP_RENDER_FAST_RENDER_FORCE_PROTECT_EN 0x00000100U +#define ROGUE_CR_ISP_RENDER_PROCESS_PROTECTED_TILES_SHIFT 7U +#define ROGUE_CR_ISP_RENDER_PROCESS_PROTECTED_TILES_CLRMSK 0xFFFFFF7FU +#define ROGUE_CR_ISP_RENDER_PROCESS_PROTECTED_TILES_EN 0x00000080U +#define ROGUE_CR_ISP_RENDER_PROCESS_UNPROTECTED_TILES_SHIFT 6U +#define ROGUE_CR_ISP_RENDER_PROCESS_UNPROTECTED_TILES_CLRMSK 0xFFFFFFBFU +#define ROGUE_CR_ISP_RENDER_PROCESS_UNPROTECTED_TILES_EN 0x00000040U +#define ROGUE_CR_ISP_RENDER_DISABLE_EOMT_SHIFT 5U +#define ROGUE_CR_ISP_RENDER_DISABLE_EOMT_CLRMSK 0xFFFFFFDFU +#define ROGUE_CR_ISP_RENDER_DISABLE_EOMT_EN 0x00000020U +#define ROGUE_CR_ISP_RENDER_RESUME_SHIFT 4U +#define ROGUE_CR_ISP_RENDER_RESUME_CLRMSK 0xFFFFFFEFU +#define ROGUE_CR_ISP_RENDER_RESUME_EN 0x00000010U +#define ROGUE_CR_ISP_RENDER_DIR_SHIFT 2U +#define ROGUE_CR_ISP_RENDER_DIR_CLRMSK 0xFFFFFFF3U +#define ROGUE_CR_ISP_RENDER_DIR_TL2BR 0x00000000U +#define ROGUE_CR_ISP_RENDER_DIR_TR2BL 0x00000004U +#define ROGUE_CR_ISP_RENDER_DIR_BL2TR 0x00000008U +#define ROGUE_CR_ISP_RENDER_DIR_BR2TL 0x0000000CU +#define ROGUE_CR_ISP_RENDER_MODE_SHIFT 0U +#define ROGUE_CR_ISP_RENDER_MODE_CLRMSK 0xFFFFFFFCU +#define ROGUE_CR_ISP_RENDER_MODE_NORM 0x00000000U +#define ROGUE_CR_ISP_RENDER_MODE_FAST_2D 0x00000002U +#define ROGUE_CR_ISP_RENDER_MODE_FAST_SCALE 0x00000003U + +/* Register ROGUE_CR_ISP_CTL */ +#define ROGUE_CR_ISP_CTL 0x0F38U +#define ROGUE_CR_ISP_CTL_MASKFULL 0x00000000FFFFF3FFULL +#define ROGUE_CR_ISP_CTL_SKIP_INIT_HDRS_SHIFT 31U +#define ROGUE_CR_ISP_CTL_SKIP_INIT_HDRS_CLRMSK 0x7FFFFFFFU +#define ROGUE_CR_ISP_CTL_SKIP_INIT_HDRS_EN 0x80000000U +#define ROGUE_CR_ISP_CTL_LINE_STYLE_SHIFT 30U +#define ROGUE_CR_ISP_CTL_LINE_STYLE_CLRMSK 0xBFFFFFFFU +#define ROGUE_CR_ISP_CTL_LINE_STYLE_EN 0x40000000U +#define ROGUE_CR_ISP_CTL_LINE_STYLE_PIX_SHIFT 29U +#define ROGUE_CR_ISP_CTL_LINE_STYLE_PIX_CLRMSK 0xDFFFFFFFU +#define ROGUE_CR_ISP_CTL_LINE_STYLE_PIX_EN 0x20000000U +#define ROGUE_CR_ISP_CTL_PAIR_TILES_VERT_SHIFT 28U +#define ROGUE_CR_ISP_CTL_PAIR_TILES_VERT_CLRMSK 0xEFFFFFFFU +#define ROGUE_CR_ISP_CTL_PAIR_TILES_VERT_EN 0x10000000U +#define ROGUE_CR_ISP_CTL_PAIR_TILES_SHIFT 27U +#define ROGUE_CR_ISP_CTL_PAIR_TILES_CLRMSK 0xF7FFFFFFU +#define ROGUE_CR_ISP_CTL_PAIR_TILES_EN 0x08000000U +#define ROGUE_CR_ISP_CTL_CREQ_BUF_EN_SHIFT 26U +#define ROGUE_CR_ISP_CTL_CREQ_BUF_EN_CLRMSK 0xFBFFFFFFU +#define ROGUE_CR_ISP_CTL_CREQ_BUF_EN_EN 0x04000000U +#define ROGUE_CR_ISP_CTL_TILE_AGE_EN_SHIFT 25U +#define ROGUE_CR_ISP_CTL_TILE_AGE_EN_CLRMSK 0xFDFFFFFFU +#define ROGUE_CR_ISP_CTL_TILE_AGE_EN_EN 0x02000000U +#define ROGUE_CR_ISP_CTL_ISP_SAMPLE_POS_MODE_SHIFT 23U +#define ROGUE_CR_ISP_CTL_ISP_SAMPLE_POS_MODE_CLRMSK 0xFE7FFFFFU +#define ROGUE_CR_ISP_CTL_ISP_SAMPLE_POS_MODE_DX9 0x00000000U +#define ROGUE_CR_ISP_CTL_ISP_SAMPLE_POS_MODE_DX10 0x00800000U +#define ROGUE_CR_ISP_CTL_ISP_SAMPLE_POS_MODE_OGL 0x01000000U +#define ROGUE_CR_ISP_CTL_NUM_TILES_PER_USC_SHIFT 21U +#define ROGUE_CR_ISP_CTL_NUM_TILES_PER_USC_CLRMSK 0xFF9FFFFFU +#define ROGUE_CR_ISP_CTL_DBIAS_IS_INT_SHIFT 20U +#define ROGUE_CR_ISP_CTL_DBIAS_IS_INT_CLRMSK 0xFFEFFFFFU +#define ROGUE_CR_ISP_CTL_DBIAS_IS_INT_EN 0x00100000U +#define ROGUE_CR_ISP_CTL_OVERLAP_CHECK_MODE_SHIFT 19U +#define ROGUE_CR_ISP_CTL_OVERLAP_CHECK_MODE_CLRMSK 0xFFF7FFFFU +#define ROGUE_CR_ISP_CTL_OVERLAP_CHECK_MODE_EN 0x00080000U +#define ROGUE_CR_ISP_CTL_PT_UPFRONT_DEPTH_DISABLE_SHIFT 18U +#define ROGUE_CR_ISP_CTL_PT_UPFRONT_DEPTH_DISABLE_CLRMSK 0xFFFBFFFFU +#define ROGUE_CR_ISP_CTL_PT_UPFRONT_DEPTH_DISABLE_EN 0x00040000U +#define ROGUE_CR_ISP_CTL_PROCESS_EMPTY_TILES_SHIFT 17U +#define ROGUE_CR_ISP_CTL_PROCESS_EMPTY_TILES_CLRMSK 0xFFFDFFFFU +#define ROGUE_CR_ISP_CTL_PROCESS_EMPTY_TILES_EN 0x00020000U +#define ROGUE_CR_ISP_CTL_SAMPLE_POS_SHIFT 16U +#define ROGUE_CR_ISP_CTL_SAMPLE_POS_CLRMSK 0xFFFEFFFFU +#define ROGUE_CR_ISP_CTL_SAMPLE_POS_EN 0x00010000U +#define ROGUE_CR_ISP_CTL_PIPE_ENABLE_SHIFT 12U +#define ROGUE_CR_ISP_CTL_PIPE_ENABLE_CLRMSK 0xFFFF0FFFU +#define ROGUE_CR_ISP_CTL_PIPE_ENABLE_PIPE_ONE 0x00000000U +#define ROGUE_CR_ISP_CTL_PIPE_ENABLE_PIPE_TWO 0x00001000U +#define ROGUE_CR_ISP_CTL_PIPE_ENABLE_PIPE_THREE 0x00002000U +#define ROGUE_CR_ISP_CTL_PIPE_ENABLE_PIPE_FOUR 0x00003000U +#define ROGUE_CR_ISP_CTL_PIPE_ENABLE_PIPE_FIVE 0x00004000U +#define ROGUE_CR_ISP_CTL_PIPE_ENABLE_PIPE_SIX 0x00005000U +#define ROGUE_CR_ISP_CTL_PIPE_ENABLE_PIPE_SEVEN 0x00006000U +#define ROGUE_CR_ISP_CTL_PIPE_ENABLE_PIPE_EIGHT 0x00007000U +#define ROGUE_CR_ISP_CTL_PIPE_ENABLE_PIPE_NINE 0x00008000U +#define ROGUE_CR_ISP_CTL_PIPE_ENABLE_PIPE_TEN 0x00009000U +#define ROGUE_CR_ISP_CTL_PIPE_ENABLE_PIPE_ELEVEN 0x0000A000U +#define ROGUE_CR_ISP_CTL_PIPE_ENABLE_PIPE_TWELVE 0x0000B000U +#define ROGUE_CR_ISP_CTL_PIPE_ENABLE_PIPE_THIRTEEN 0x0000C000U +#define ROGUE_CR_ISP_CTL_PIPE_ENABLE_PIPE_FOURTEEN 0x0000D000U +#define ROGUE_CR_ISP_CTL_PIPE_ENABLE_PIPE_FIFTEEN 0x0000E000U +#define ROGUE_CR_ISP_CTL_PIPE_ENABLE_PIPE_SIXTEEN 0x0000F000U +#define ROGUE_CR_ISP_CTL_VALID_ID_SHIFT 4U +#define ROGUE_CR_ISP_CTL_VALID_ID_CLRMSK 0xFFFFFC0FU +#define ROGUE_CR_ISP_CTL_UPASS_START_SHIFT 0U +#define ROGUE_CR_ISP_CTL_UPASS_START_CLRMSK 0xFFFFFFF0U + +/* Register ROGUE_CR_ISP_STATUS */ +#define ROGUE_CR_ISP_STATUS 0x1038U +#define ROGUE_CR_ISP_STATUS_MASKFULL 0x0000000000000007ULL +#define ROGUE_CR_ISP_STATUS_SPLIT_MAX_SHIFT 2U +#define ROGUE_CR_ISP_STATUS_SPLIT_MAX_CLRMSK 0xFFFFFFFBU +#define ROGUE_CR_ISP_STATUS_SPLIT_MAX_EN 0x00000004U +#define ROGUE_CR_ISP_STATUS_ACTIVE_SHIFT 1U +#define ROGUE_CR_ISP_STATUS_ACTIVE_CLRMSK 0xFFFFFFFDU +#define ROGUE_CR_ISP_STATUS_ACTIVE_EN 0x00000002U +#define ROGUE_CR_ISP_STATUS_EOR_SHIFT 0U +#define ROGUE_CR_ISP_STATUS_EOR_CLRMSK 0xFFFFFFFEU +#define ROGUE_CR_ISP_STATUS_EOR_EN 0x00000001U + +/* Register group: ROGUE_CR_ISP_XTP_RESUME, with 64 repeats */ +#define ROGUE_CR_ISP_XTP_RESUME_REPEATCOUNT 64U +/* Register ROGUE_CR_ISP_XTP_RESUME0 */ +#define ROGUE_CR_ISP_XTP_RESUME0 0x3A00U +#define ROGUE_CR_ISP_XTP_RESUME0_MASKFULL 0x00000000003FF3FFULL +#define ROGUE_CR_ISP_XTP_RESUME0_TILE_X_SHIFT 12U +#define ROGUE_CR_ISP_XTP_RESUME0_TILE_X_CLRMSK 0xFFC00FFFU +#define ROGUE_CR_ISP_XTP_RESUME0_TILE_Y_SHIFT 0U +#define ROGUE_CR_ISP_XTP_RESUME0_TILE_Y_CLRMSK 0xFFFFFC00U + +/* Register group: ROGUE_CR_ISP_XTP_STORE, with 32 repeats */ +#define ROGUE_CR_ISP_XTP_STORE_REPEATCOUNT 32U +/* Register ROGUE_CR_ISP_XTP_STORE0 */ +#define ROGUE_CR_ISP_XTP_STORE0 0x3C00U +#define ROGUE_CR_ISP_XTP_STORE0_MASKFULL 0x000000007F3FF3FFULL +#define ROGUE_CR_ISP_XTP_STORE0_ACTIVE_SHIFT 30U +#define ROGUE_CR_ISP_XTP_STORE0_ACTIVE_CLRMSK 0xBFFFFFFFU +#define ROGUE_CR_ISP_XTP_STORE0_ACTIVE_EN 0x40000000U +#define ROGUE_CR_ISP_XTP_STORE0_EOR_SHIFT 29U +#define ROGUE_CR_ISP_XTP_STORE0_EOR_CLRMSK 0xDFFFFFFFU +#define ROGUE_CR_ISP_XTP_STORE0_EOR_EN 0x20000000U +#define ROGUE_CR_ISP_XTP_STORE0_TILE_LAST_SHIFT 28U +#define ROGUE_CR_ISP_XTP_STORE0_TILE_LAST_CLRMSK 0xEFFFFFFFU +#define ROGUE_CR_ISP_XTP_STORE0_TILE_LAST_EN 0x10000000U +#define ROGUE_CR_ISP_XTP_STORE0_MT_SHIFT 24U +#define ROGUE_CR_ISP_XTP_STORE0_MT_CLRMSK 0xF0FFFFFFU +#define ROGUE_CR_ISP_XTP_STORE0_TILE_X_SHIFT 12U +#define ROGUE_CR_ISP_XTP_STORE0_TILE_X_CLRMSK 0xFFC00FFFU +#define ROGUE_CR_ISP_XTP_STORE0_TILE_Y_SHIFT 0U +#define ROGUE_CR_ISP_XTP_STORE0_TILE_Y_CLRMSK 0xFFFFFC00U + +/* Register group: ROGUE_CR_BIF_CAT_BASE, with 8 repeats */ +#define ROGUE_CR_BIF_CAT_BASE_REPEATCOUNT 8U +/* Register ROGUE_CR_BIF_CAT_BASE0 */ +#define ROGUE_CR_BIF_CAT_BASE0 0x1200U +#define ROGUE_CR_BIF_CAT_BASE0_MASKFULL 0x000000FFFFFFF000ULL +#define ROGUE_CR_BIF_CAT_BASE0_ADDR_SHIFT 12U +#define ROGUE_CR_BIF_CAT_BASE0_ADDR_CLRMSK 0xFFFFFF0000000FFFULL +#define ROGUE_CR_BIF_CAT_BASE0_ADDR_ALIGNSHIFT 12U +#define ROGUE_CR_BIF_CAT_BASE0_ADDR_ALIGNSIZE 4096U + +/* Register ROGUE_CR_BIF_CAT_BASE1 */ +#define ROGUE_CR_BIF_CAT_BASE1 0x1208U +#define ROGUE_CR_BIF_CAT_BASE1_MASKFULL 0x000000FFFFFFF000ULL +#define ROGUE_CR_BIF_CAT_BASE1_ADDR_SHIFT 12U +#define ROGUE_CR_BIF_CAT_BASE1_ADDR_CLRMSK 0xFFFFFF0000000FFFULL +#define ROGUE_CR_BIF_CAT_BASE1_ADDR_ALIGNSHIFT 12U +#define ROGUE_CR_BIF_CAT_BASE1_ADDR_ALIGNSIZE 4096U + +/* Register ROGUE_CR_BIF_CAT_BASE2 */ +#define ROGUE_CR_BIF_CAT_BASE2 0x1210U +#define ROGUE_CR_BIF_CAT_BASE2_MASKFULL 0x000000FFFFFFF000ULL +#define ROGUE_CR_BIF_CAT_BASE2_ADDR_SHIFT 12U +#define ROGUE_CR_BIF_CAT_BASE2_ADDR_CLRMSK 0xFFFFFF0000000FFFULL +#define ROGUE_CR_BIF_CAT_BASE2_ADDR_ALIGNSHIFT 12U +#define ROGUE_CR_BIF_CAT_BASE2_ADDR_ALIGNSIZE 4096U + +/* Register ROGUE_CR_BIF_CAT_BASE3 */ +#define ROGUE_CR_BIF_CAT_BASE3 0x1218U +#define ROGUE_CR_BIF_CAT_BASE3_MASKFULL 0x000000FFFFFFF000ULL +#define ROGUE_CR_BIF_CAT_BASE3_ADDR_SHIFT 12U +#define ROGUE_CR_BIF_CAT_BASE3_ADDR_CLRMSK 0xFFFFFF0000000FFFULL +#define ROGUE_CR_BIF_CAT_BASE3_ADDR_ALIGNSHIFT 12U +#define ROGUE_CR_BIF_CAT_BASE3_ADDR_ALIGNSIZE 4096U + +/* Register ROGUE_CR_BIF_CAT_BASE4 */ +#define ROGUE_CR_BIF_CAT_BASE4 0x1220U +#define ROGUE_CR_BIF_CAT_BASE4_MASKFULL 0x000000FFFFFFF000ULL +#define ROGUE_CR_BIF_CAT_BASE4_ADDR_SHIFT 12U +#define ROGUE_CR_BIF_CAT_BASE4_ADDR_CLRMSK 0xFFFFFF0000000FFFULL +#define ROGUE_CR_BIF_CAT_BASE4_ADDR_ALIGNSHIFT 12U +#define ROGUE_CR_BIF_CAT_BASE4_ADDR_ALIGNSIZE 4096U + +/* Register ROGUE_CR_BIF_CAT_BASE5 */ +#define ROGUE_CR_BIF_CAT_BASE5 0x1228U +#define ROGUE_CR_BIF_CAT_BASE5_MASKFULL 0x000000FFFFFFF000ULL +#define ROGUE_CR_BIF_CAT_BASE5_ADDR_SHIFT 12U +#define ROGUE_CR_BIF_CAT_BASE5_ADDR_CLRMSK 0xFFFFFF0000000FFFULL +#define ROGUE_CR_BIF_CAT_BASE5_ADDR_ALIGNSHIFT 12U +#define ROGUE_CR_BIF_CAT_BASE5_ADDR_ALIGNSIZE 4096U + +/* Register ROGUE_CR_BIF_CAT_BASE6 */ +#define ROGUE_CR_BIF_CAT_BASE6 0x1230U +#define ROGUE_CR_BIF_CAT_BASE6_MASKFULL 0x000000FFFFFFF000ULL +#define ROGUE_CR_BIF_CAT_BASE6_ADDR_SHIFT 12U +#define ROGUE_CR_BIF_CAT_BASE6_ADDR_CLRMSK 0xFFFFFF0000000FFFULL +#define ROGUE_CR_BIF_CAT_BASE6_ADDR_ALIGNSHIFT 12U +#define ROGUE_CR_BIF_CAT_BASE6_ADDR_ALIGNSIZE 4096U + +/* Register ROGUE_CR_BIF_CAT_BASE7 */ +#define ROGUE_CR_BIF_CAT_BASE7 0x1238U +#define ROGUE_CR_BIF_CAT_BASE7_MASKFULL 0x000000FFFFFFF000ULL +#define ROGUE_CR_BIF_CAT_BASE7_ADDR_SHIFT 12U +#define ROGUE_CR_BIF_CAT_BASE7_ADDR_CLRMSK 0xFFFFFF0000000FFFULL +#define ROGUE_CR_BIF_CAT_BASE7_ADDR_ALIGNSHIFT 12U +#define ROGUE_CR_BIF_CAT_BASE7_ADDR_ALIGNSIZE 4096U + +/* Register ROGUE_CR_BIF_CAT_BASE_INDEX */ +#define ROGUE_CR_BIF_CAT_BASE_INDEX 0x1240U +#define ROGUE_CR_BIF_CAT_BASE_INDEX_MASKFULL 0x00070707073F0707ULL +#define ROGUE_CR_BIF_CAT_BASE_INDEX_RVTX_SHIFT 48U +#define ROGUE_CR_BIF_CAT_BASE_INDEX_RVTX_CLRMSK 0xFFF8FFFFFFFFFFFFULL +#define ROGUE_CR_BIF_CAT_BASE_INDEX_RAY_SHIFT 40U +#define ROGUE_CR_BIF_CAT_BASE_INDEX_RAY_CLRMSK 0xFFFFF8FFFFFFFFFFULL +#define ROGUE_CR_BIF_CAT_BASE_INDEX_HOST_SHIFT 32U +#define ROGUE_CR_BIF_CAT_BASE_INDEX_HOST_CLRMSK 0xFFFFFFF8FFFFFFFFULL +#define ROGUE_CR_BIF_CAT_BASE_INDEX_TLA_SHIFT 24U +#define ROGUE_CR_BIF_CAT_BASE_INDEX_TLA_CLRMSK 0xFFFFFFFFF8FFFFFFULL +#define ROGUE_CR_BIF_CAT_BASE_INDEX_TDM_SHIFT 19U +#define ROGUE_CR_BIF_CAT_BASE_INDEX_TDM_CLRMSK 0xFFFFFFFFFFC7FFFFULL +#define ROGUE_CR_BIF_CAT_BASE_INDEX_CDM_SHIFT 16U +#define ROGUE_CR_BIF_CAT_BASE_INDEX_CDM_CLRMSK 0xFFFFFFFFFFF8FFFFULL +#define ROGUE_CR_BIF_CAT_BASE_INDEX_PIXEL_SHIFT 8U +#define ROGUE_CR_BIF_CAT_BASE_INDEX_PIXEL_CLRMSK 0xFFFFFFFFFFFFF8FFULL +#define ROGUE_CR_BIF_CAT_BASE_INDEX_TA_SHIFT 0U +#define ROGUE_CR_BIF_CAT_BASE_INDEX_TA_CLRMSK 0xFFFFFFFFFFFFFFF8ULL + +/* Register ROGUE_CR_BIF_PM_CAT_BASE_VCE0 */ +#define ROGUE_CR_BIF_PM_CAT_BASE_VCE0 0x1248U +#define ROGUE_CR_BIF_PM_CAT_BASE_VCE0_MASKFULL 0x0FFFFFFFFFFFF003ULL +#define ROGUE_CR_BIF_PM_CAT_BASE_VCE0_INIT_PAGE_SHIFT 40U +#define ROGUE_CR_BIF_PM_CAT_BASE_VCE0_INIT_PAGE_CLRMSK 0xF00000FFFFFFFFFFULL +#define ROGUE_CR_BIF_PM_CAT_BASE_VCE0_ADDR_SHIFT 12U +#define ROGUE_CR_BIF_PM_CAT_BASE_VCE0_ADDR_CLRMSK 0xFFFFFF0000000FFFULL +#define ROGUE_CR_BIF_PM_CAT_BASE_VCE0_WRAP_SHIFT 1U +#define ROGUE_CR_BIF_PM_CAT_BASE_VCE0_WRAP_CLRMSK 0xFFFFFFFFFFFFFFFDULL +#define ROGUE_CR_BIF_PM_CAT_BASE_VCE0_WRAP_EN 0x0000000000000002ULL +#define ROGUE_CR_BIF_PM_CAT_BASE_VCE0_VALID_SHIFT 0U +#define ROGUE_CR_BIF_PM_CAT_BASE_VCE0_VALID_CLRMSK 0xFFFFFFFFFFFFFFFEULL +#define ROGUE_CR_BIF_PM_CAT_BASE_VCE0_VALID_EN 0x0000000000000001ULL + +/* Register ROGUE_CR_BIF_PM_CAT_BASE_TE0 */ +#define ROGUE_CR_BIF_PM_CAT_BASE_TE0 0x1250U +#define ROGUE_CR_BIF_PM_CAT_BASE_TE0_MASKFULL 0x0FFFFFFFFFFFF003ULL +#define ROGUE_CR_BIF_PM_CAT_BASE_TE0_INIT_PAGE_SHIFT 40U +#define ROGUE_CR_BIF_PM_CAT_BASE_TE0_INIT_PAGE_CLRMSK 0xF00000FFFFFFFFFFULL +#define ROGUE_CR_BIF_PM_CAT_BASE_TE0_ADDR_SHIFT 12U +#define ROGUE_CR_BIF_PM_CAT_BASE_TE0_ADDR_CLRMSK 0xFFFFFF0000000FFFULL +#define ROGUE_CR_BIF_PM_CAT_BASE_TE0_WRAP_SHIFT 1U +#define ROGUE_CR_BIF_PM_CAT_BASE_TE0_WRAP_CLRMSK 0xFFFFFFFFFFFFFFFDULL +#define ROGUE_CR_BIF_PM_CAT_BASE_TE0_WRAP_EN 0x0000000000000002ULL +#define ROGUE_CR_BIF_PM_CAT_BASE_TE0_VALID_SHIFT 0U +#define ROGUE_CR_BIF_PM_CAT_BASE_TE0_VALID_CLRMSK 0xFFFFFFFFFFFFFFFEULL +#define ROGUE_CR_BIF_PM_CAT_BASE_TE0_VALID_EN 0x0000000000000001ULL + +/* Register ROGUE_CR_BIF_PM_CAT_BASE_ALIST0 */ +#define ROGUE_CR_BIF_PM_CAT_BASE_ALIST0 0x1260U +#define ROGUE_CR_BIF_PM_CAT_BASE_ALIST0_MASKFULL 0x0FFFFFFFFFFFF003ULL +#define ROGUE_CR_BIF_PM_CAT_BASE_ALIST0_INIT_PAGE_SHIFT 40U +#define ROGUE_CR_BIF_PM_CAT_BASE_ALIST0_INIT_PAGE_CLRMSK 0xF00000FFFFFFFFFFULL +#define ROGUE_CR_BIF_PM_CAT_BASE_ALIST0_ADDR_SHIFT 12U +#define ROGUE_CR_BIF_PM_CAT_BASE_ALIST0_ADDR_CLRMSK 0xFFFFFF0000000FFFULL +#define ROGUE_CR_BIF_PM_CAT_BASE_ALIST0_WRAP_SHIFT 1U +#define ROGUE_CR_BIF_PM_CAT_BASE_ALIST0_WRAP_CLRMSK 0xFFFFFFFFFFFFFFFDULL +#define ROGUE_CR_BIF_PM_CAT_BASE_ALIST0_WRAP_EN 0x0000000000000002ULL +#define ROGUE_CR_BIF_PM_CAT_BASE_ALIST0_VALID_SHIFT 0U +#define ROGUE_CR_BIF_PM_CAT_BASE_ALIST0_VALID_CLRMSK 0xFFFFFFFFFFFFFFFEULL +#define ROGUE_CR_BIF_PM_CAT_BASE_ALIST0_VALID_EN 0x0000000000000001ULL + +/* Register ROGUE_CR_BIF_PM_CAT_BASE_VCE1 */ +#define ROGUE_CR_BIF_PM_CAT_BASE_VCE1 0x1268U +#define ROGUE_CR_BIF_PM_CAT_BASE_VCE1_MASKFULL 0x0FFFFFFFFFFFF003ULL +#define ROGUE_CR_BIF_PM_CAT_BASE_VCE1_INIT_PAGE_SHIFT 40U +#define ROGUE_CR_BIF_PM_CAT_BASE_VCE1_INIT_PAGE_CLRMSK 0xF00000FFFFFFFFFFULL +#define ROGUE_CR_BIF_PM_CAT_BASE_VCE1_ADDR_SHIFT 12U +#define ROGUE_CR_BIF_PM_CAT_BASE_VCE1_ADDR_CLRMSK 0xFFFFFF0000000FFFULL +#define ROGUE_CR_BIF_PM_CAT_BASE_VCE1_WRAP_SHIFT 1U +#define ROGUE_CR_BIF_PM_CAT_BASE_VCE1_WRAP_CLRMSK 0xFFFFFFFFFFFFFFFDULL +#define ROGUE_CR_BIF_PM_CAT_BASE_VCE1_WRAP_EN 0x0000000000000002ULL +#define ROGUE_CR_BIF_PM_CAT_BASE_VCE1_VALID_SHIFT 0U +#define ROGUE_CR_BIF_PM_CAT_BASE_VCE1_VALID_CLRMSK 0xFFFFFFFFFFFFFFFEULL +#define ROGUE_CR_BIF_PM_CAT_BASE_VCE1_VALID_EN 0x0000000000000001ULL + +/* Register ROGUE_CR_BIF_PM_CAT_BASE_TE1 */ +#define ROGUE_CR_BIF_PM_CAT_BASE_TE1 0x1270U +#define ROGUE_CR_BIF_PM_CAT_BASE_TE1_MASKFULL 0x0FFFFFFFFFFFF003ULL +#define ROGUE_CR_BIF_PM_CAT_BASE_TE1_INIT_PAGE_SHIFT 40U +#define ROGUE_CR_BIF_PM_CAT_BASE_TE1_INIT_PAGE_CLRMSK 0xF00000FFFFFFFFFFULL +#define ROGUE_CR_BIF_PM_CAT_BASE_TE1_ADDR_SHIFT 12U +#define ROGUE_CR_BIF_PM_CAT_BASE_TE1_ADDR_CLRMSK 0xFFFFFF0000000FFFULL +#define ROGUE_CR_BIF_PM_CAT_BASE_TE1_WRAP_SHIFT 1U +#define ROGUE_CR_BIF_PM_CAT_BASE_TE1_WRAP_CLRMSK 0xFFFFFFFFFFFFFFFDULL +#define ROGUE_CR_BIF_PM_CAT_BASE_TE1_WRAP_EN 0x0000000000000002ULL +#define ROGUE_CR_BIF_PM_CAT_BASE_TE1_VALID_SHIFT 0U +#define ROGUE_CR_BIF_PM_CAT_BASE_TE1_VALID_CLRMSK 0xFFFFFFFFFFFFFFFEULL +#define ROGUE_CR_BIF_PM_CAT_BASE_TE1_VALID_EN 0x0000000000000001ULL + +/* Register ROGUE_CR_BIF_PM_CAT_BASE_ALIST1 */ +#define ROGUE_CR_BIF_PM_CAT_BASE_ALIST1 0x1280U +#define ROGUE_CR_BIF_PM_CAT_BASE_ALIST1_MASKFULL 0x0FFFFFFFFFFFF003ULL +#define ROGUE_CR_BIF_PM_CAT_BASE_ALIST1_INIT_PAGE_SHIFT 40U +#define ROGUE_CR_BIF_PM_CAT_BASE_ALIST1_INIT_PAGE_CLRMSK 0xF00000FFFFFFFFFFULL +#define ROGUE_CR_BIF_PM_CAT_BASE_ALIST1_ADDR_SHIFT 12U +#define ROGUE_CR_BIF_PM_CAT_BASE_ALIST1_ADDR_CLRMSK 0xFFFFFF0000000FFFULL +#define ROGUE_CR_BIF_PM_CAT_BASE_ALIST1_WRAP_SHIFT 1U +#define ROGUE_CR_BIF_PM_CAT_BASE_ALIST1_WRAP_CLRMSK 0xFFFFFFFFFFFFFFFDULL +#define ROGUE_CR_BIF_PM_CAT_BASE_ALIST1_WRAP_EN 0x0000000000000002ULL +#define ROGUE_CR_BIF_PM_CAT_BASE_ALIST1_VALID_SHIFT 0U +#define ROGUE_CR_BIF_PM_CAT_BASE_ALIST1_VALID_CLRMSK 0xFFFFFFFFFFFFFFFEULL +#define ROGUE_CR_BIF_PM_CAT_BASE_ALIST1_VALID_EN 0x0000000000000001ULL + +/* Register ROGUE_CR_BIF_MMU_ENTRY_STATUS */ +#define ROGUE_CR_BIF_MMU_ENTRY_STATUS 0x1288U +#define ROGUE_CR_BIF_MMU_ENTRY_STATUS_MASKFULL 0x000000FFFFFFF0F3ULL +#define ROGUE_CR_BIF_MMU_ENTRY_STATUS_ADDRESS_SHIFT 12U +#define ROGUE_CR_BIF_MMU_ENTRY_STATUS_ADDRESS_CLRMSK 0xFFFFFF0000000FFFULL +#define ROGUE_CR_BIF_MMU_ENTRY_STATUS_CAT_BASE_SHIFT 4U +#define ROGUE_CR_BIF_MMU_ENTRY_STATUS_CAT_BASE_CLRMSK 0xFFFFFFFFFFFFFF0FULL +#define ROGUE_CR_BIF_MMU_ENTRY_STATUS_DATA_TYPE_SHIFT 0U +#define ROGUE_CR_BIF_MMU_ENTRY_STATUS_DATA_TYPE_CLRMSK 0xFFFFFFFFFFFFFFFCULL + +/* Register ROGUE_CR_BIF_MMU_ENTRY */ +#define ROGUE_CR_BIF_MMU_ENTRY 0x1290U +#define ROGUE_CR_BIF_MMU_ENTRY_MASKFULL 0x0000000000000003ULL +#define ROGUE_CR_BIF_MMU_ENTRY_ENABLE_SHIFT 1U +#define ROGUE_CR_BIF_MMU_ENTRY_ENABLE_CLRMSK 0xFFFFFFFDU +#define ROGUE_CR_BIF_MMU_ENTRY_ENABLE_EN 0x00000002U +#define ROGUE_CR_BIF_MMU_ENTRY_PENDING_SHIFT 0U +#define ROGUE_CR_BIF_MMU_ENTRY_PENDING_CLRMSK 0xFFFFFFFEU +#define ROGUE_CR_BIF_MMU_ENTRY_PENDING_EN 0x00000001U + +/* Register ROGUE_CR_BIF_CTRL_INVAL */ +#define ROGUE_CR_BIF_CTRL_INVAL 0x12A0U +#define ROGUE_CR_BIF_CTRL_INVAL_MASKFULL 0x000000000000000FULL +#define ROGUE_CR_BIF_CTRL_INVAL_TLB1_SHIFT 3U +#define ROGUE_CR_BIF_CTRL_INVAL_TLB1_CLRMSK 0xFFFFFFF7U +#define ROGUE_CR_BIF_CTRL_INVAL_TLB1_EN 0x00000008U +#define ROGUE_CR_BIF_CTRL_INVAL_PC_SHIFT 2U +#define ROGUE_CR_BIF_CTRL_INVAL_PC_CLRMSK 0xFFFFFFFBU +#define ROGUE_CR_BIF_CTRL_INVAL_PC_EN 0x00000004U +#define ROGUE_CR_BIF_CTRL_INVAL_PD_SHIFT 1U +#define ROGUE_CR_BIF_CTRL_INVAL_PD_CLRMSK 0xFFFFFFFDU +#define ROGUE_CR_BIF_CTRL_INVAL_PD_EN 0x00000002U +#define ROGUE_CR_BIF_CTRL_INVAL_PT_SHIFT 0U +#define ROGUE_CR_BIF_CTRL_INVAL_PT_CLRMSK 0xFFFFFFFEU +#define ROGUE_CR_BIF_CTRL_INVAL_PT_EN 0x00000001U + +/* Register ROGUE_CR_BIF_CTRL */ +#define ROGUE_CR_BIF_CTRL 0x12A8U +#define ROGUE_CR_BIF_CTRL__XE_MEM__MASKFULL 0x000000000000033FULL +#define ROGUE_CR_BIF_CTRL_MASKFULL 0x00000000000000FFULL +#define ROGUE_CR_BIF_CTRL_PAUSE_MMU_CPU_SHIFT 9U +#define ROGUE_CR_BIF_CTRL_PAUSE_MMU_CPU_CLRMSK 0xFFFFFDFFU +#define ROGUE_CR_BIF_CTRL_PAUSE_MMU_CPU_EN 0x00000200U +#define ROGUE_CR_BIF_CTRL_PAUSE_MMU_BIF4_SHIFT 8U +#define ROGUE_CR_BIF_CTRL_PAUSE_MMU_BIF4_CLRMSK 0xFFFFFEFFU +#define ROGUE_CR_BIF_CTRL_PAUSE_MMU_BIF4_EN 0x00000100U +#define ROGUE_CR_BIF_CTRL_ENABLE_MMU_QUEUE_BYPASS_SHIFT 7U +#define ROGUE_CR_BIF_CTRL_ENABLE_MMU_QUEUE_BYPASS_CLRMSK 0xFFFFFF7FU +#define ROGUE_CR_BIF_CTRL_ENABLE_MMU_QUEUE_BYPASS_EN 0x00000080U +#define ROGUE_CR_BIF_CTRL_ENABLE_MMU_AUTO_PREFETCH_SHIFT 6U +#define ROGUE_CR_BIF_CTRL_ENABLE_MMU_AUTO_PREFETCH_CLRMSK 0xFFFFFFBFU +#define ROGUE_CR_BIF_CTRL_ENABLE_MMU_AUTO_PREFETCH_EN 0x00000040U +#define ROGUE_CR_BIF_CTRL_PAUSE_MMU_BIF3_SHIFT 5U +#define ROGUE_CR_BIF_CTRL_PAUSE_MMU_BIF3_CLRMSK 0xFFFFFFDFU +#define ROGUE_CR_BIF_CTRL_PAUSE_MMU_BIF3_EN 0x00000020U +#define ROGUE_CR_BIF_CTRL_PAUSE_MMU_BIF2_SHIFT 4U +#define ROGUE_CR_BIF_CTRL_PAUSE_MMU_BIF2_CLRMSK 0xFFFFFFEFU +#define ROGUE_CR_BIF_CTRL_PAUSE_MMU_BIF2_EN 0x00000010U +#define ROGUE_CR_BIF_CTRL_PAUSE_BIF1_SHIFT 3U +#define ROGUE_CR_BIF_CTRL_PAUSE_BIF1_CLRMSK 0xFFFFFFF7U +#define ROGUE_CR_BIF_CTRL_PAUSE_BIF1_EN 0x00000008U +#define ROGUE_CR_BIF_CTRL_PAUSE_MMU_PM_SHIFT 2U +#define ROGUE_CR_BIF_CTRL_PAUSE_MMU_PM_CLRMSK 0xFFFFFFFBU +#define ROGUE_CR_BIF_CTRL_PAUSE_MMU_PM_EN 0x00000004U +#define ROGUE_CR_BIF_CTRL_PAUSE_MMU_BIF1_SHIFT 1U +#define ROGUE_CR_BIF_CTRL_PAUSE_MMU_BIF1_CLRMSK 0xFFFFFFFDU +#define ROGUE_CR_BIF_CTRL_PAUSE_MMU_BIF1_EN 0x00000002U +#define ROGUE_CR_BIF_CTRL_PAUSE_MMU_BIF0_SHIFT 0U +#define ROGUE_CR_BIF_CTRL_PAUSE_MMU_BIF0_CLRMSK 0xFFFFFFFEU +#define ROGUE_CR_BIF_CTRL_PAUSE_MMU_BIF0_EN 0x00000001U + +/* Register ROGUE_CR_BIF_FAULT_BANK0_MMU_STATUS */ +#define ROGUE_CR_BIF_FAULT_BANK0_MMU_STATUS 0x12B0U +#define ROGUE_CR_BIF_FAULT_BANK0_MMU_STATUS_MASKFULL 0x000000000000F775ULL +#define ROGUE_CR_BIF_FAULT_BANK0_MMU_STATUS_CAT_BASE_SHIFT 12U +#define ROGUE_CR_BIF_FAULT_BANK0_MMU_STATUS_CAT_BASE_CLRMSK 0xFFFF0FFFU +#define ROGUE_CR_BIF_FAULT_BANK0_MMU_STATUS_PAGE_SIZE_SHIFT 8U +#define ROGUE_CR_BIF_FAULT_BANK0_MMU_STATUS_PAGE_SIZE_CLRMSK 0xFFFFF8FFU +#define ROGUE_CR_BIF_FAULT_BANK0_MMU_STATUS_DATA_TYPE_SHIFT 5U +#define ROGUE_CR_BIF_FAULT_BANK0_MMU_STATUS_DATA_TYPE_CLRMSK 0xFFFFFF9FU +#define ROGUE_CR_BIF_FAULT_BANK0_MMU_STATUS_FAULT_RO_SHIFT 4U +#define ROGUE_CR_BIF_FAULT_BANK0_MMU_STATUS_FAULT_RO_CLRMSK 0xFFFFFFEFU +#define ROGUE_CR_BIF_FAULT_BANK0_MMU_STATUS_FAULT_RO_EN 0x00000010U +#define ROGUE_CR_BIF_FAULT_BANK0_MMU_STATUS_FAULT_PM_META_RO_SHIFT 2U +#define ROGUE_CR_BIF_FAULT_BANK0_MMU_STATUS_FAULT_PM_META_RO_CLRMSK 0xFFFFFFFBU +#define ROGUE_CR_BIF_FAULT_BANK0_MMU_STATUS_FAULT_PM_META_RO_EN 0x00000004U +#define ROGUE_CR_BIF_FAULT_BANK0_MMU_STATUS_FAULT_SHIFT 0U +#define ROGUE_CR_BIF_FAULT_BANK0_MMU_STATUS_FAULT_CLRMSK 0xFFFFFFFEU +#define ROGUE_CR_BIF_FAULT_BANK0_MMU_STATUS_FAULT_EN 0x00000001U + +/* Register ROGUE_CR_BIF_FAULT_BANK0_REQ_STATUS */ +#define ROGUE_CR_BIF_FAULT_BANK0_REQ_STATUS 0x12B8U +#define ROGUE_CR_BIF_FAULT_BANK0_REQ_STATUS__XE_MEM__MASKFULL 0x001FFFFFFFFFFFF0ULL +#define ROGUE_CR_BIF_FAULT_BANK0_REQ_STATUS_MASKFULL 0x0007FFFFFFFFFFF0ULL +#define ROGUE_CR_BIF_FAULT_BANK0_REQ_STATUS__XE_MEM__RNW_SHIFT 52U +#define ROGUE_CR_BIF_FAULT_BANK0_REQ_STATUS__XE_MEM__RNW_CLRMSK 0xFFEFFFFFFFFFFFFFULL +#define ROGUE_CR_BIF_FAULT_BANK0_REQ_STATUS__XE_MEM__RNW_EN 0x0010000000000000ULL +#define ROGUE_CR_BIF_FAULT_BANK0_REQ_STATUS_RNW_SHIFT 50U +#define ROGUE_CR_BIF_FAULT_BANK0_REQ_STATUS_RNW_CLRMSK 0xFFFBFFFFFFFFFFFFULL +#define ROGUE_CR_BIF_FAULT_BANK0_REQ_STATUS_RNW_EN 0x0004000000000000ULL +#define ROGUE_CR_BIF_FAULT_BANK0_REQ_STATUS__XE_MEM__TAG_SB_SHIFT 46U +#define ROGUE_CR_BIF_FAULT_BANK0_REQ_STATUS__XE_MEM__TAG_SB_CLRMSK 0xFFF03FFFFFFFFFFFULL +#define ROGUE_CR_BIF_FAULT_BANK0_REQ_STATUS_TAG_SB_SHIFT 44U +#define ROGUE_CR_BIF_FAULT_BANK0_REQ_STATUS_TAG_SB_CLRMSK 0xFFFC0FFFFFFFFFFFULL +#define ROGUE_CR_BIF_FAULT_BANK0_REQ_STATUS_TAG_ID_SHIFT 40U +#define ROGUE_CR_BIF_FAULT_BANK0_REQ_STATUS_TAG_ID_CLRMSK 0xFFFFF0FFFFFFFFFFULL +#define ROGUE_CR_BIF_FAULT_BANK0_REQ_STATUS__XE_MEM__TAG_ID_SHIFT 40U +#define ROGUE_CR_BIF_FAULT_BANK0_REQ_STATUS__XE_MEM__TAG_ID_CLRMSK 0xFFFFC0FFFFFFFFFFULL +#define ROGUE_CR_BIF_FAULT_BANK0_REQ_STATUS_ADDRESS_SHIFT 4U +#define ROGUE_CR_BIF_FAULT_BANK0_REQ_STATUS_ADDRESS_CLRMSK 0xFFFFFF000000000FULL +#define ROGUE_CR_BIF_FAULT_BANK0_REQ_STATUS_ADDRESS_ALIGNSHIFT 4U +#define ROGUE_CR_BIF_FAULT_BANK0_REQ_STATUS_ADDRESS_ALIGNSIZE 16U + +/* Register ROGUE_CR_BIF_FAULT_BANK1_MMU_STATUS */ +#define ROGUE_CR_BIF_FAULT_BANK1_MMU_STATUS 0x12C0U +#define ROGUE_CR_BIF_FAULT_BANK1_MMU_STATUS_MASKFULL 0x000000000000F775ULL +#define ROGUE_CR_BIF_FAULT_BANK1_MMU_STATUS_CAT_BASE_SHIFT 12U +#define ROGUE_CR_BIF_FAULT_BANK1_MMU_STATUS_CAT_BASE_CLRMSK 0xFFFF0FFFU +#define ROGUE_CR_BIF_FAULT_BANK1_MMU_STATUS_PAGE_SIZE_SHIFT 8U +#define ROGUE_CR_BIF_FAULT_BANK1_MMU_STATUS_PAGE_SIZE_CLRMSK 0xFFFFF8FFU +#define ROGUE_CR_BIF_FAULT_BANK1_MMU_STATUS_DATA_TYPE_SHIFT 5U +#define ROGUE_CR_BIF_FAULT_BANK1_MMU_STATUS_DATA_TYPE_CLRMSK 0xFFFFFF9FU +#define ROGUE_CR_BIF_FAULT_BANK1_MMU_STATUS_FAULT_RO_SHIFT 4U +#define ROGUE_CR_BIF_FAULT_BANK1_MMU_STATUS_FAULT_RO_CLRMSK 0xFFFFFFEFU +#define ROGUE_CR_BIF_FAULT_BANK1_MMU_STATUS_FAULT_RO_EN 0x00000010U +#define ROGUE_CR_BIF_FAULT_BANK1_MMU_STATUS_FAULT_PM_META_RO_SHIFT 2U +#define ROGUE_CR_BIF_FAULT_BANK1_MMU_STATUS_FAULT_PM_META_RO_CLRMSK 0xFFFFFFFBU +#define ROGUE_CR_BIF_FAULT_BANK1_MMU_STATUS_FAULT_PM_META_RO_EN 0x00000004U +#define ROGUE_CR_BIF_FAULT_BANK1_MMU_STATUS_FAULT_SHIFT 0U +#define ROGUE_CR_BIF_FAULT_BANK1_MMU_STATUS_FAULT_CLRMSK 0xFFFFFFFEU +#define ROGUE_CR_BIF_FAULT_BANK1_MMU_STATUS_FAULT_EN 0x00000001U + +/* Register ROGUE_CR_BIF_FAULT_BANK1_REQ_STATUS */ +#define ROGUE_CR_BIF_FAULT_BANK1_REQ_STATUS 0x12C8U +#define ROGUE_CR_BIF_FAULT_BANK1_REQ_STATUS_MASKFULL 0x0007FFFFFFFFFFF0ULL +#define ROGUE_CR_BIF_FAULT_BANK1_REQ_STATUS_RNW_SHIFT 50U +#define ROGUE_CR_BIF_FAULT_BANK1_REQ_STATUS_RNW_CLRMSK 0xFFFBFFFFFFFFFFFFULL +#define ROGUE_CR_BIF_FAULT_BANK1_REQ_STATUS_RNW_EN 0x0004000000000000ULL +#define ROGUE_CR_BIF_FAULT_BANK1_REQ_STATUS_TAG_SB_SHIFT 44U +#define ROGUE_CR_BIF_FAULT_BANK1_REQ_STATUS_TAG_SB_CLRMSK 0xFFFC0FFFFFFFFFFFULL +#define ROGUE_CR_BIF_FAULT_BANK1_REQ_STATUS_TAG_ID_SHIFT 40U +#define ROGUE_CR_BIF_FAULT_BANK1_REQ_STATUS_TAG_ID_CLRMSK 0xFFFFF0FFFFFFFFFFULL +#define ROGUE_CR_BIF_FAULT_BANK1_REQ_STATUS_ADDRESS_SHIFT 4U +#define ROGUE_CR_BIF_FAULT_BANK1_REQ_STATUS_ADDRESS_CLRMSK 0xFFFFFF000000000FULL +#define ROGUE_CR_BIF_FAULT_BANK1_REQ_STATUS_ADDRESS_ALIGNSHIFT 4U +#define ROGUE_CR_BIF_FAULT_BANK1_REQ_STATUS_ADDRESS_ALIGNSIZE 16U + +/* Register ROGUE_CR_BIF_MMU_STATUS */ +#define ROGUE_CR_BIF_MMU_STATUS 0x12D0U +#define ROGUE_CR_BIF_MMU_STATUS__XE_MEM__MASKFULL 0x000000001FFFFFF7ULL +#define ROGUE_CR_BIF_MMU_STATUS_MASKFULL 0x000000001FFFFFF7ULL +#define ROGUE_CR_BIF_MMU_STATUS_PM_FAULT_SHIFT 28U +#define ROGUE_CR_BIF_MMU_STATUS_PM_FAULT_CLRMSK 0xEFFFFFFFU +#define ROGUE_CR_BIF_MMU_STATUS_PM_FAULT_EN 0x10000000U +#define ROGUE_CR_BIF_MMU_STATUS_PC_DATA_SHIFT 20U +#define ROGUE_CR_BIF_MMU_STATUS_PC_DATA_CLRMSK 0xF00FFFFFU +#define ROGUE_CR_BIF_MMU_STATUS_PD_DATA_SHIFT 12U +#define ROGUE_CR_BIF_MMU_STATUS_PD_DATA_CLRMSK 0xFFF00FFFU +#define ROGUE_CR_BIF_MMU_STATUS_PT_DATA_SHIFT 4U +#define ROGUE_CR_BIF_MMU_STATUS_PT_DATA_CLRMSK 0xFFFFF00FU +#define ROGUE_CR_BIF_MMU_STATUS_STALLED_SHIFT 2U +#define ROGUE_CR_BIF_MMU_STATUS_STALLED_CLRMSK 0xFFFFFFFBU +#define ROGUE_CR_BIF_MMU_STATUS_STALLED_EN 0x00000004U +#define ROGUE_CR_BIF_MMU_STATUS_PAUSED_SHIFT 1U +#define ROGUE_CR_BIF_MMU_STATUS_PAUSED_CLRMSK 0xFFFFFFFDU +#define ROGUE_CR_BIF_MMU_STATUS_PAUSED_EN 0x00000002U +#define ROGUE_CR_BIF_MMU_STATUS_BUSY_SHIFT 0U +#define ROGUE_CR_BIF_MMU_STATUS_BUSY_CLRMSK 0xFFFFFFFEU +#define ROGUE_CR_BIF_MMU_STATUS_BUSY_EN 0x00000001U + +/* Register group: ROGUE_CR_BIF_TILING_CFG, with 8 repeats */ +#define ROGUE_CR_BIF_TILING_CFG_REPEATCOUNT 8U +/* Register ROGUE_CR_BIF_TILING_CFG0 */ +#define ROGUE_CR_BIF_TILING_CFG0 0x12D8U +#define ROGUE_CR_BIF_TILING_CFG0_MASKFULL 0xFFFFFFFF0FFFFFFFULL +#define ROGUE_CR_BIF_TILING_CFG0_XSTRIDE_SHIFT 61U +#define ROGUE_CR_BIF_TILING_CFG0_XSTRIDE_CLRMSK 0x1FFFFFFFFFFFFFFFULL +#define ROGUE_CR_BIF_TILING_CFG0_ENABLE_SHIFT 60U +#define ROGUE_CR_BIF_TILING_CFG0_ENABLE_CLRMSK 0xEFFFFFFFFFFFFFFFULL +#define ROGUE_CR_BIF_TILING_CFG0_ENABLE_EN 0x1000000000000000ULL +#define ROGUE_CR_BIF_TILING_CFG0_MAX_ADDRESS_SHIFT 32U +#define ROGUE_CR_BIF_TILING_CFG0_MAX_ADDRESS_CLRMSK 0xF0000000FFFFFFFFULL +#define ROGUE_CR_BIF_TILING_CFG0_MAX_ADDRESS_ALIGNSHIFT 12U +#define ROGUE_CR_BIF_TILING_CFG0_MAX_ADDRESS_ALIGNSIZE 4096U +#define ROGUE_CR_BIF_TILING_CFG0_MIN_ADDRESS_SHIFT 0U +#define ROGUE_CR_BIF_TILING_CFG0_MIN_ADDRESS_CLRMSK 0xFFFFFFFFF0000000ULL +#define ROGUE_CR_BIF_TILING_CFG0_MIN_ADDRESS_ALIGNSHIFT 12U +#define ROGUE_CR_BIF_TILING_CFG0_MIN_ADDRESS_ALIGNSIZE 4096U + +/* Register ROGUE_CR_BIF_TILING_CFG1 */ +#define ROGUE_CR_BIF_TILING_CFG1 0x12E0U +#define ROGUE_CR_BIF_TILING_CFG1_MASKFULL 0xFFFFFFFF0FFFFFFFULL +#define ROGUE_CR_BIF_TILING_CFG1_XSTRIDE_SHIFT 61U +#define ROGUE_CR_BIF_TILING_CFG1_XSTRIDE_CLRMSK 0x1FFFFFFFFFFFFFFFULL +#define ROGUE_CR_BIF_TILING_CFG1_ENABLE_SHIFT 60U +#define ROGUE_CR_BIF_TILING_CFG1_ENABLE_CLRMSK 0xEFFFFFFFFFFFFFFFULL +#define ROGUE_CR_BIF_TILING_CFG1_ENABLE_EN 0x1000000000000000ULL +#define ROGUE_CR_BIF_TILING_CFG1_MAX_ADDRESS_SHIFT 32U +#define ROGUE_CR_BIF_TILING_CFG1_MAX_ADDRESS_CLRMSK 0xF0000000FFFFFFFFULL +#define ROGUE_CR_BIF_TILING_CFG1_MAX_ADDRESS_ALIGNSHIFT 12U +#define ROGUE_CR_BIF_TILING_CFG1_MAX_ADDRESS_ALIGNSIZE 4096U +#define ROGUE_CR_BIF_TILING_CFG1_MIN_ADDRESS_SHIFT 0U +#define ROGUE_CR_BIF_TILING_CFG1_MIN_ADDRESS_CLRMSK 0xFFFFFFFFF0000000ULL +#define ROGUE_CR_BIF_TILING_CFG1_MIN_ADDRESS_ALIGNSHIFT 12U +#define ROGUE_CR_BIF_TILING_CFG1_MIN_ADDRESS_ALIGNSIZE 4096U + +/* Register ROGUE_CR_BIF_TILING_CFG2 */ +#define ROGUE_CR_BIF_TILING_CFG2 0x12E8U +#define ROGUE_CR_BIF_TILING_CFG2_MASKFULL 0xFFFFFFFF0FFFFFFFULL +#define ROGUE_CR_BIF_TILING_CFG2_XSTRIDE_SHIFT 61U +#define ROGUE_CR_BIF_TILING_CFG2_XSTRIDE_CLRMSK 0x1FFFFFFFFFFFFFFFULL +#define ROGUE_CR_BIF_TILING_CFG2_ENABLE_SHIFT 60U +#define ROGUE_CR_BIF_TILING_CFG2_ENABLE_CLRMSK 0xEFFFFFFFFFFFFFFFULL +#define ROGUE_CR_BIF_TILING_CFG2_ENABLE_EN 0x1000000000000000ULL +#define ROGUE_CR_BIF_TILING_CFG2_MAX_ADDRESS_SHIFT 32U +#define ROGUE_CR_BIF_TILING_CFG2_MAX_ADDRESS_CLRMSK 0xF0000000FFFFFFFFULL +#define ROGUE_CR_BIF_TILING_CFG2_MAX_ADDRESS_ALIGNSHIFT 12U +#define ROGUE_CR_BIF_TILING_CFG2_MAX_ADDRESS_ALIGNSIZE 4096U +#define ROGUE_CR_BIF_TILING_CFG2_MIN_ADDRESS_SHIFT 0U +#define ROGUE_CR_BIF_TILING_CFG2_MIN_ADDRESS_CLRMSK 0xFFFFFFFFF0000000ULL +#define ROGUE_CR_BIF_TILING_CFG2_MIN_ADDRESS_ALIGNSHIFT 12U +#define ROGUE_CR_BIF_TILING_CFG2_MIN_ADDRESS_ALIGNSIZE 4096U + +/* Register ROGUE_CR_BIF_TILING_CFG3 */ +#define ROGUE_CR_BIF_TILING_CFG3 0x12F0U +#define ROGUE_CR_BIF_TILING_CFG3_MASKFULL 0xFFFFFFFF0FFFFFFFULL +#define ROGUE_CR_BIF_TILING_CFG3_XSTRIDE_SHIFT 61U +#define ROGUE_CR_BIF_TILING_CFG3_XSTRIDE_CLRMSK 0x1FFFFFFFFFFFFFFFULL +#define ROGUE_CR_BIF_TILING_CFG3_ENABLE_SHIFT 60U +#define ROGUE_CR_BIF_TILING_CFG3_ENABLE_CLRMSK 0xEFFFFFFFFFFFFFFFULL +#define ROGUE_CR_BIF_TILING_CFG3_ENABLE_EN 0x1000000000000000ULL +#define ROGUE_CR_BIF_TILING_CFG3_MAX_ADDRESS_SHIFT 32U +#define ROGUE_CR_BIF_TILING_CFG3_MAX_ADDRESS_CLRMSK 0xF0000000FFFFFFFFULL +#define ROGUE_CR_BIF_TILING_CFG3_MAX_ADDRESS_ALIGNSHIFT 12U +#define ROGUE_CR_BIF_TILING_CFG3_MAX_ADDRESS_ALIGNSIZE 4096U +#define ROGUE_CR_BIF_TILING_CFG3_MIN_ADDRESS_SHIFT 0U +#define ROGUE_CR_BIF_TILING_CFG3_MIN_ADDRESS_CLRMSK 0xFFFFFFFFF0000000ULL +#define ROGUE_CR_BIF_TILING_CFG3_MIN_ADDRESS_ALIGNSHIFT 12U +#define ROGUE_CR_BIF_TILING_CFG3_MIN_ADDRESS_ALIGNSIZE 4096U + +/* Register ROGUE_CR_BIF_TILING_CFG4 */ +#define ROGUE_CR_BIF_TILING_CFG4 0x12F8U +#define ROGUE_CR_BIF_TILING_CFG4_MASKFULL 0xFFFFFFFF0FFFFFFFULL +#define ROGUE_CR_BIF_TILING_CFG4_XSTRIDE_SHIFT 61U +#define ROGUE_CR_BIF_TILING_CFG4_XSTRIDE_CLRMSK 0x1FFFFFFFFFFFFFFFULL +#define ROGUE_CR_BIF_TILING_CFG4_ENABLE_SHIFT 60U +#define ROGUE_CR_BIF_TILING_CFG4_ENABLE_CLRMSK 0xEFFFFFFFFFFFFFFFULL +#define ROGUE_CR_BIF_TILING_CFG4_ENABLE_EN 0x1000000000000000ULL +#define ROGUE_CR_BIF_TILING_CFG4_MAX_ADDRESS_SHIFT 32U +#define ROGUE_CR_BIF_TILING_CFG4_MAX_ADDRESS_CLRMSK 0xF0000000FFFFFFFFULL +#define ROGUE_CR_BIF_TILING_CFG4_MAX_ADDRESS_ALIGNSHIFT 12U +#define ROGUE_CR_BIF_TILING_CFG4_MAX_ADDRESS_ALIGNSIZE 4096U +#define ROGUE_CR_BIF_TILING_CFG4_MIN_ADDRESS_SHIFT 0U +#define ROGUE_CR_BIF_TILING_CFG4_MIN_ADDRESS_CLRMSK 0xFFFFFFFFF0000000ULL +#define ROGUE_CR_BIF_TILING_CFG4_MIN_ADDRESS_ALIGNSHIFT 12U +#define ROGUE_CR_BIF_TILING_CFG4_MIN_ADDRESS_ALIGNSIZE 4096U + +/* Register ROGUE_CR_BIF_TILING_CFG5 */ +#define ROGUE_CR_BIF_TILING_CFG5 0x1300U +#define ROGUE_CR_BIF_TILING_CFG5_MASKFULL 0xFFFFFFFF0FFFFFFFULL +#define ROGUE_CR_BIF_TILING_CFG5_XSTRIDE_SHIFT 61U +#define ROGUE_CR_BIF_TILING_CFG5_XSTRIDE_CLRMSK 0x1FFFFFFFFFFFFFFFULL +#define ROGUE_CR_BIF_TILING_CFG5_ENABLE_SHIFT 60U +#define ROGUE_CR_BIF_TILING_CFG5_ENABLE_CLRMSK 0xEFFFFFFFFFFFFFFFULL +#define ROGUE_CR_BIF_TILING_CFG5_ENABLE_EN 0x1000000000000000ULL +#define ROGUE_CR_BIF_TILING_CFG5_MAX_ADDRESS_SHIFT 32U +#define ROGUE_CR_BIF_TILING_CFG5_MAX_ADDRESS_CLRMSK 0xF0000000FFFFFFFFULL +#define ROGUE_CR_BIF_TILING_CFG5_MAX_ADDRESS_ALIGNSHIFT 12U +#define ROGUE_CR_BIF_TILING_CFG5_MAX_ADDRESS_ALIGNSIZE 4096U +#define ROGUE_CR_BIF_TILING_CFG5_MIN_ADDRESS_SHIFT 0U +#define ROGUE_CR_BIF_TILING_CFG5_MIN_ADDRESS_CLRMSK 0xFFFFFFFFF0000000ULL +#define ROGUE_CR_BIF_TILING_CFG5_MIN_ADDRESS_ALIGNSHIFT 12U +#define ROGUE_CR_BIF_TILING_CFG5_MIN_ADDRESS_ALIGNSIZE 4096U + +/* Register ROGUE_CR_BIF_TILING_CFG6 */ +#define ROGUE_CR_BIF_TILING_CFG6 0x1308U +#define ROGUE_CR_BIF_TILING_CFG6_MASKFULL 0xFFFFFFFF0FFFFFFFULL +#define ROGUE_CR_BIF_TILING_CFG6_XSTRIDE_SHIFT 61U +#define ROGUE_CR_BIF_TILING_CFG6_XSTRIDE_CLRMSK 0x1FFFFFFFFFFFFFFFULL +#define ROGUE_CR_BIF_TILING_CFG6_ENABLE_SHIFT 60U +#define ROGUE_CR_BIF_TILING_CFG6_ENABLE_CLRMSK 0xEFFFFFFFFFFFFFFFULL +#define ROGUE_CR_BIF_TILING_CFG6_ENABLE_EN 0x1000000000000000ULL +#define ROGUE_CR_BIF_TILING_CFG6_MAX_ADDRESS_SHIFT 32U +#define ROGUE_CR_BIF_TILING_CFG6_MAX_ADDRESS_CLRMSK 0xF0000000FFFFFFFFULL +#define ROGUE_CR_BIF_TILING_CFG6_MAX_ADDRESS_ALIGNSHIFT 12U +#define ROGUE_CR_BIF_TILING_CFG6_MAX_ADDRESS_ALIGNSIZE 4096U +#define ROGUE_CR_BIF_TILING_CFG6_MIN_ADDRESS_SHIFT 0U +#define ROGUE_CR_BIF_TILING_CFG6_MIN_ADDRESS_CLRMSK 0xFFFFFFFFF0000000ULL +#define ROGUE_CR_BIF_TILING_CFG6_MIN_ADDRESS_ALIGNSHIFT 12U +#define ROGUE_CR_BIF_TILING_CFG6_MIN_ADDRESS_ALIGNSIZE 4096U + +/* Register ROGUE_CR_BIF_TILING_CFG7 */ +#define ROGUE_CR_BIF_TILING_CFG7 0x1310U +#define ROGUE_CR_BIF_TILING_CFG7_MASKFULL 0xFFFFFFFF0FFFFFFFULL +#define ROGUE_CR_BIF_TILING_CFG7_XSTRIDE_SHIFT 61U +#define ROGUE_CR_BIF_TILING_CFG7_XSTRIDE_CLRMSK 0x1FFFFFFFFFFFFFFFULL +#define ROGUE_CR_BIF_TILING_CFG7_ENABLE_SHIFT 60U +#define ROGUE_CR_BIF_TILING_CFG7_ENABLE_CLRMSK 0xEFFFFFFFFFFFFFFFULL +#define ROGUE_CR_BIF_TILING_CFG7_ENABLE_EN 0x1000000000000000ULL +#define ROGUE_CR_BIF_TILING_CFG7_MAX_ADDRESS_SHIFT 32U +#define ROGUE_CR_BIF_TILING_CFG7_MAX_ADDRESS_CLRMSK 0xF0000000FFFFFFFFULL +#define ROGUE_CR_BIF_TILING_CFG7_MAX_ADDRESS_ALIGNSHIFT 12U +#define ROGUE_CR_BIF_TILING_CFG7_MAX_ADDRESS_ALIGNSIZE 4096U +#define ROGUE_CR_BIF_TILING_CFG7_MIN_ADDRESS_SHIFT 0U +#define ROGUE_CR_BIF_TILING_CFG7_MIN_ADDRESS_CLRMSK 0xFFFFFFFFF0000000ULL +#define ROGUE_CR_BIF_TILING_CFG7_MIN_ADDRESS_ALIGNSHIFT 12U +#define ROGUE_CR_BIF_TILING_CFG7_MIN_ADDRESS_ALIGNSIZE 4096U + +/* Register ROGUE_CR_BIF_READS_EXT_STATUS */ +#define ROGUE_CR_BIF_READS_EXT_STATUS 0x1320U +#define ROGUE_CR_BIF_READS_EXT_STATUS_MASKFULL 0x000000000FFFFFFFULL +#define ROGUE_CR_BIF_READS_EXT_STATUS_MMU_SHIFT 16U +#define ROGUE_CR_BIF_READS_EXT_STATUS_MMU_CLRMSK 0xF000FFFFU +#define ROGUE_CR_BIF_READS_EXT_STATUS_BANK1_SHIFT 0U +#define ROGUE_CR_BIF_READS_EXT_STATUS_BANK1_CLRMSK 0xFFFF0000U + +/* Register ROGUE_CR_BIF_READS_INT_STATUS */ +#define ROGUE_CR_BIF_READS_INT_STATUS 0x1328U +#define ROGUE_CR_BIF_READS_INT_STATUS_MASKFULL 0x0000000007FFFFFFULL +#define ROGUE_CR_BIF_READS_INT_STATUS_MMU_SHIFT 16U +#define ROGUE_CR_BIF_READS_INT_STATUS_MMU_CLRMSK 0xF800FFFFU +#define ROGUE_CR_BIF_READS_INT_STATUS_BANK1_SHIFT 0U +#define ROGUE_CR_BIF_READS_INT_STATUS_BANK1_CLRMSK 0xFFFF0000U + +/* Register ROGUE_CR_BIFPM_READS_INT_STATUS */ +#define ROGUE_CR_BIFPM_READS_INT_STATUS 0x1330U +#define ROGUE_CR_BIFPM_READS_INT_STATUS_MASKFULL 0x000000000000FFFFULL +#define ROGUE_CR_BIFPM_READS_INT_STATUS_BANK0_SHIFT 0U +#define ROGUE_CR_BIFPM_READS_INT_STATUS_BANK0_CLRMSK 0xFFFF0000U + +/* Register ROGUE_CR_BIFPM_READS_EXT_STATUS */ +#define ROGUE_CR_BIFPM_READS_EXT_STATUS 0x1338U +#define ROGUE_CR_BIFPM_READS_EXT_STATUS_MASKFULL 0x000000000000FFFFULL +#define ROGUE_CR_BIFPM_READS_EXT_STATUS_BANK0_SHIFT 0U +#define ROGUE_CR_BIFPM_READS_EXT_STATUS_BANK0_CLRMSK 0xFFFF0000U + +/* Register ROGUE_CR_BIFPM_STATUS_MMU */ +#define ROGUE_CR_BIFPM_STATUS_MMU 0x1350U +#define ROGUE_CR_BIFPM_STATUS_MMU_MASKFULL 0x00000000000000FFULL +#define ROGUE_CR_BIFPM_STATUS_MMU_REQUESTS_SHIFT 0U +#define ROGUE_CR_BIFPM_STATUS_MMU_REQUESTS_CLRMSK 0xFFFFFF00U + +/* Register ROGUE_CR_BIF_STATUS_MMU */ +#define ROGUE_CR_BIF_STATUS_MMU 0x1358U +#define ROGUE_CR_BIF_STATUS_MMU_MASKFULL 0x00000000000000FFULL +#define ROGUE_CR_BIF_STATUS_MMU_REQUESTS_SHIFT 0U +#define ROGUE_CR_BIF_STATUS_MMU_REQUESTS_CLRMSK 0xFFFFFF00U + +/* Register ROGUE_CR_BIF_FAULT_READ */ +#define ROGUE_CR_BIF_FAULT_READ 0x13E0U +#define ROGUE_CR_BIF_FAULT_READ_MASKFULL 0x000000FFFFFFFFF0ULL +#define ROGUE_CR_BIF_FAULT_READ_ADDRESS_SHIFT 4U +#define ROGUE_CR_BIF_FAULT_READ_ADDRESS_CLRMSK 0xFFFFFF000000000FULL +#define ROGUE_CR_BIF_FAULT_READ_ADDRESS_ALIGNSHIFT 4U +#define ROGUE_CR_BIF_FAULT_READ_ADDRESS_ALIGNSIZE 16U + +/* Register ROGUE_CR_TEXAS_BIF_FAULT_BANK0_MMU_STATUS */ +#define ROGUE_CR_TEXAS_BIF_FAULT_BANK0_MMU_STATUS 0x1430U +#define ROGUE_CR_TEXAS_BIF_FAULT_BANK0_MMU_STATUS_MASKFULL 0x000000000000F775ULL +#define ROGUE_CR_TEXAS_BIF_FAULT_BANK0_MMU_STATUS_CAT_BASE_SHIFT 12U +#define ROGUE_CR_TEXAS_BIF_FAULT_BANK0_MMU_STATUS_CAT_BASE_CLRMSK 0xFFFF0FFFU +#define ROGUE_CR_TEXAS_BIF_FAULT_BANK0_MMU_STATUS_PAGE_SIZE_SHIFT 8U +#define ROGUE_CR_TEXAS_BIF_FAULT_BANK0_MMU_STATUS_PAGE_SIZE_CLRMSK 0xFFFFF8FFU +#define ROGUE_CR_TEXAS_BIF_FAULT_BANK0_MMU_STATUS_DATA_TYPE_SHIFT 5U +#define ROGUE_CR_TEXAS_BIF_FAULT_BANK0_MMU_STATUS_DATA_TYPE_CLRMSK 0xFFFFFF9FU +#define ROGUE_CR_TEXAS_BIF_FAULT_BANK0_MMU_STATUS_FAULT_RO_SHIFT 4U +#define ROGUE_CR_TEXAS_BIF_FAULT_BANK0_MMU_STATUS_FAULT_RO_CLRMSK 0xFFFFFFEFU +#define ROGUE_CR_TEXAS_BIF_FAULT_BANK0_MMU_STATUS_FAULT_RO_EN 0x00000010U +#define ROGUE_CR_TEXAS_BIF_FAULT_BANK0_MMU_STATUS_FAULT_PM_META_RO_SHIFT 2U +#define ROGUE_CR_TEXAS_BIF_FAULT_BANK0_MMU_STATUS_FAULT_PM_META_RO_CLRMSK 0xFFFFFFFBU +#define ROGUE_CR_TEXAS_BIF_FAULT_BANK0_MMU_STATUS_FAULT_PM_META_RO_EN 0x00000004U +#define ROGUE_CR_TEXAS_BIF_FAULT_BANK0_MMU_STATUS_FAULT_SHIFT 0U +#define ROGUE_CR_TEXAS_BIF_FAULT_BANK0_MMU_STATUS_FAULT_CLRMSK 0xFFFFFFFEU +#define ROGUE_CR_TEXAS_BIF_FAULT_BANK0_MMU_STATUS_FAULT_EN 0x00000001U + +/* Register ROGUE_CR_TEXAS_BIF_FAULT_BANK0_REQ_STATUS */ +#define ROGUE_CR_TEXAS_BIF_FAULT_BANK0_REQ_STATUS 0x1438U +#define ROGUE_CR_TEXAS_BIF_FAULT_BANK0_REQ_STATUS_MASKFULL 0x0007FFFFFFFFFFF0ULL +#define ROGUE_CR_TEXAS_BIF_FAULT_BANK0_REQ_STATUS_RNW_SHIFT 50U +#define ROGUE_CR_TEXAS_BIF_FAULT_BANK0_REQ_STATUS_RNW_CLRMSK 0xFFFBFFFFFFFFFFFFULL +#define ROGUE_CR_TEXAS_BIF_FAULT_BANK0_REQ_STATUS_RNW_EN 0x0004000000000000ULL +#define ROGUE_CR_TEXAS_BIF_FAULT_BANK0_REQ_STATUS_TAG_SB_SHIFT 44U +#define ROGUE_CR_TEXAS_BIF_FAULT_BANK0_REQ_STATUS_TAG_SB_CLRMSK 0xFFFC0FFFFFFFFFFFULL +#define ROGUE_CR_TEXAS_BIF_FAULT_BANK0_REQ_STATUS_TAG_ID_SHIFT 40U +#define ROGUE_CR_TEXAS_BIF_FAULT_BANK0_REQ_STATUS_TAG_ID_CLRMSK 0xFFFFF0FFFFFFFFFFULL +#define ROGUE_CR_TEXAS_BIF_FAULT_BANK0_REQ_STATUS_ADDRESS_SHIFT 4U +#define ROGUE_CR_TEXAS_BIF_FAULT_BANK0_REQ_STATUS_ADDRESS_CLRMSK 0xFFFFFF000000000FULL +#define ROGUE_CR_TEXAS_BIF_FAULT_BANK0_REQ_STATUS_ADDRESS_ALIGNSHIFT 4U +#define ROGUE_CR_TEXAS_BIF_FAULT_BANK0_REQ_STATUS_ADDRESS_ALIGNSIZE 16U + +/* Register ROGUE_CR_MCU_FENCE */ +#define ROGUE_CR_MCU_FENCE 0x1740U +#define ROGUE_CR_MCU_FENCE_MASKFULL 0x000007FFFFFFFFE0ULL +#define ROGUE_CR_MCU_FENCE_DM_SHIFT 40U +#define ROGUE_CR_MCU_FENCE_DM_CLRMSK 0xFFFFF8FFFFFFFFFFULL +#define ROGUE_CR_MCU_FENCE_DM_VERTEX 0x0000000000000000ULL +#define ROGUE_CR_MCU_FENCE_DM_PIXEL 0x0000010000000000ULL +#define ROGUE_CR_MCU_FENCE_DM_COMPUTE 0x0000020000000000ULL +#define ROGUE_CR_MCU_FENCE_DM_RAY_VERTEX 0x0000030000000000ULL +#define ROGUE_CR_MCU_FENCE_DM_RAY 0x0000040000000000ULL +#define ROGUE_CR_MCU_FENCE_DM_FASTRENDER 0x0000050000000000ULL +#define ROGUE_CR_MCU_FENCE_ADDR_SHIFT 5U +#define ROGUE_CR_MCU_FENCE_ADDR_CLRMSK 0xFFFFFF000000001FULL +#define ROGUE_CR_MCU_FENCE_ADDR_ALIGNSHIFT 5U +#define ROGUE_CR_MCU_FENCE_ADDR_ALIGNSIZE 32U + +/* Register group: ROGUE_CR_SCRATCH, with 16 repeats */ +#define ROGUE_CR_SCRATCH_REPEATCOUNT 16U +/* Register ROGUE_CR_SCRATCH0 */ +#define ROGUE_CR_SCRATCH0 0x1A00U +#define ROGUE_CR_SCRATCH0_MASKFULL 0x00000000FFFFFFFFULL +#define ROGUE_CR_SCRATCH0_DATA_SHIFT 0U +#define ROGUE_CR_SCRATCH0_DATA_CLRMSK 0x00000000U + +/* Register ROGUE_CR_SCRATCH1 */ +#define ROGUE_CR_SCRATCH1 0x1A08U +#define ROGUE_CR_SCRATCH1_MASKFULL 0x00000000FFFFFFFFULL +#define ROGUE_CR_SCRATCH1_DATA_SHIFT 0U +#define ROGUE_CR_SCRATCH1_DATA_CLRMSK 0x00000000U + +/* Register ROGUE_CR_SCRATCH2 */ +#define ROGUE_CR_SCRATCH2 0x1A10U +#define ROGUE_CR_SCRATCH2_MASKFULL 0x00000000FFFFFFFFULL +#define ROGUE_CR_SCRATCH2_DATA_SHIFT 0U +#define ROGUE_CR_SCRATCH2_DATA_CLRMSK 0x00000000U + +/* Register ROGUE_CR_SCRATCH3 */ +#define ROGUE_CR_SCRATCH3 0x1A18U +#define ROGUE_CR_SCRATCH3_MASKFULL 0x00000000FFFFFFFFULL +#define ROGUE_CR_SCRATCH3_DATA_SHIFT 0U +#define ROGUE_CR_SCRATCH3_DATA_CLRMSK 0x00000000U + +/* Register ROGUE_CR_SCRATCH4 */ +#define ROGUE_CR_SCRATCH4 0x1A20U +#define ROGUE_CR_SCRATCH4_MASKFULL 0x00000000FFFFFFFFULL +#define ROGUE_CR_SCRATCH4_DATA_SHIFT 0U +#define ROGUE_CR_SCRATCH4_DATA_CLRMSK 0x00000000U + +/* Register ROGUE_CR_SCRATCH5 */ +#define ROGUE_CR_SCRATCH5 0x1A28U +#define ROGUE_CR_SCRATCH5_MASKFULL 0x00000000FFFFFFFFULL +#define ROGUE_CR_SCRATCH5_DATA_SHIFT 0U +#define ROGUE_CR_SCRATCH5_DATA_CLRMSK 0x00000000U + +/* Register ROGUE_CR_SCRATCH6 */ +#define ROGUE_CR_SCRATCH6 0x1A30U +#define ROGUE_CR_SCRATCH6_MASKFULL 0x00000000FFFFFFFFULL +#define ROGUE_CR_SCRATCH6_DATA_SHIFT 0U +#define ROGUE_CR_SCRATCH6_DATA_CLRMSK 0x00000000U + +/* Register ROGUE_CR_SCRATCH7 */ +#define ROGUE_CR_SCRATCH7 0x1A38U +#define ROGUE_CR_SCRATCH7_MASKFULL 0x00000000FFFFFFFFULL +#define ROGUE_CR_SCRATCH7_DATA_SHIFT 0U +#define ROGUE_CR_SCRATCH7_DATA_CLRMSK 0x00000000U + +/* Register ROGUE_CR_SCRATCH8 */ +#define ROGUE_CR_SCRATCH8 0x1A40U +#define ROGUE_CR_SCRATCH8_MASKFULL 0x00000000FFFFFFFFULL +#define ROGUE_CR_SCRATCH8_DATA_SHIFT 0U +#define ROGUE_CR_SCRATCH8_DATA_CLRMSK 0x00000000U + +/* Register ROGUE_CR_SCRATCH9 */ +#define ROGUE_CR_SCRATCH9 0x1A48U +#define ROGUE_CR_SCRATCH9_MASKFULL 0x00000000FFFFFFFFULL +#define ROGUE_CR_SCRATCH9_DATA_SHIFT 0U +#define ROGUE_CR_SCRATCH9_DATA_CLRMSK 0x00000000U + +/* Register ROGUE_CR_SCRATCH10 */ +#define ROGUE_CR_SCRATCH10 0x1A50U +#define ROGUE_CR_SCRATCH10_MASKFULL 0x00000000FFFFFFFFULL +#define ROGUE_CR_SCRATCH10_DATA_SHIFT 0U +#define ROGUE_CR_SCRATCH10_DATA_CLRMSK 0x00000000U + +/* Register ROGUE_CR_SCRATCH11 */ +#define ROGUE_CR_SCRATCH11 0x1A58U +#define ROGUE_CR_SCRATCH11_MASKFULL 0x00000000FFFFFFFFULL +#define ROGUE_CR_SCRATCH11_DATA_SHIFT 0U +#define ROGUE_CR_SCRATCH11_DATA_CLRMSK 0x00000000U + +/* Register ROGUE_CR_SCRATCH12 */ +#define ROGUE_CR_SCRATCH12 0x1A60U +#define ROGUE_CR_SCRATCH12_MASKFULL 0x00000000FFFFFFFFULL +#define ROGUE_CR_SCRATCH12_DATA_SHIFT 0U +#define ROGUE_CR_SCRATCH12_DATA_CLRMSK 0x00000000U + +/* Register ROGUE_CR_SCRATCH13 */ +#define ROGUE_CR_SCRATCH13 0x1A68U +#define ROGUE_CR_SCRATCH13_MASKFULL 0x00000000FFFFFFFFULL +#define ROGUE_CR_SCRATCH13_DATA_SHIFT 0U +#define ROGUE_CR_SCRATCH13_DATA_CLRMSK 0x00000000U + +/* Register ROGUE_CR_SCRATCH14 */ +#define ROGUE_CR_SCRATCH14 0x1A70U +#define ROGUE_CR_SCRATCH14_MASKFULL 0x00000000FFFFFFFFULL +#define ROGUE_CR_SCRATCH14_DATA_SHIFT 0U +#define ROGUE_CR_SCRATCH14_DATA_CLRMSK 0x00000000U + +/* Register ROGUE_CR_SCRATCH15 */ +#define ROGUE_CR_SCRATCH15 0x1A78U +#define ROGUE_CR_SCRATCH15_MASKFULL 0x00000000FFFFFFFFULL +#define ROGUE_CR_SCRATCH15_DATA_SHIFT 0U +#define ROGUE_CR_SCRATCH15_DATA_CLRMSK 0x00000000U + +/* Register group: ROGUE_CR_OS0_SCRATCH, with 2 repeats */ +#define ROGUE_CR_OS0_SCRATCH_REPEATCOUNT 2U +/* Register ROGUE_CR_OS0_SCRATCH0 */ +#define ROGUE_CR_OS0_SCRATCH0 0x1A80U +#define ROGUE_CR_OS0_SCRATCH0_MASKFULL 0x00000000FFFFFFFFULL +#define ROGUE_CR_OS0_SCRATCH0_DATA_SHIFT 0U +#define ROGUE_CR_OS0_SCRATCH0_DATA_CLRMSK 0x00000000U + +/* Register ROGUE_CR_OS0_SCRATCH1 */ +#define ROGUE_CR_OS0_SCRATCH1 0x1A88U +#define ROGUE_CR_OS0_SCRATCH1_MASKFULL 0x00000000FFFFFFFFULL +#define ROGUE_CR_OS0_SCRATCH1_DATA_SHIFT 0U +#define ROGUE_CR_OS0_SCRATCH1_DATA_CLRMSK 0x00000000U + +/* Register ROGUE_CR_OS0_SCRATCH2 */ +#define ROGUE_CR_OS0_SCRATCH2 0x1A90U +#define ROGUE_CR_OS0_SCRATCH2_MASKFULL 0x00000000000000FFULL +#define ROGUE_CR_OS0_SCRATCH2_DATA_SHIFT 0U +#define ROGUE_CR_OS0_SCRATCH2_DATA_CLRMSK 0xFFFFFF00U + +/* Register ROGUE_CR_OS0_SCRATCH3 */ +#define ROGUE_CR_OS0_SCRATCH3 0x1A98U +#define ROGUE_CR_OS0_SCRATCH3_MASKFULL 0x00000000000000FFULL +#define ROGUE_CR_OS0_SCRATCH3_DATA_SHIFT 0U +#define ROGUE_CR_OS0_SCRATCH3_DATA_CLRMSK 0xFFFFFF00U + +/* Register group: ROGUE_CR_OS1_SCRATCH, with 2 repeats */ +#define ROGUE_CR_OS1_SCRATCH_REPEATCOUNT 2U +/* Register ROGUE_CR_OS1_SCRATCH0 */ +#define ROGUE_CR_OS1_SCRATCH0 0x11A80U +#define ROGUE_CR_OS1_SCRATCH0_MASKFULL 0x00000000FFFFFFFFULL +#define ROGUE_CR_OS1_SCRATCH0_DATA_SHIFT 0U +#define ROGUE_CR_OS1_SCRATCH0_DATA_CLRMSK 0x00000000U + +/* Register ROGUE_CR_OS1_SCRATCH1 */ +#define ROGUE_CR_OS1_SCRATCH1 0x11A88U +#define ROGUE_CR_OS1_SCRATCH1_MASKFULL 0x00000000FFFFFFFFULL +#define ROGUE_CR_OS1_SCRATCH1_DATA_SHIFT 0U +#define ROGUE_CR_OS1_SCRATCH1_DATA_CLRMSK 0x00000000U + +/* Register ROGUE_CR_OS1_SCRATCH2 */ +#define ROGUE_CR_OS1_SCRATCH2 0x11A90U +#define ROGUE_CR_OS1_SCRATCH2_MASKFULL 0x00000000000000FFULL +#define ROGUE_CR_OS1_SCRATCH2_DATA_SHIFT 0U +#define ROGUE_CR_OS1_SCRATCH2_DATA_CLRMSK 0xFFFFFF00U + +/* Register ROGUE_CR_OS1_SCRATCH3 */ +#define ROGUE_CR_OS1_SCRATCH3 0x11A98U +#define ROGUE_CR_OS1_SCRATCH3_MASKFULL 0x00000000000000FFULL +#define ROGUE_CR_OS1_SCRATCH3_DATA_SHIFT 0U +#define ROGUE_CR_OS1_SCRATCH3_DATA_CLRMSK 0xFFFFFF00U + +/* Register group: ROGUE_CR_OS2_SCRATCH, with 2 repeats */ +#define ROGUE_CR_OS2_SCRATCH_REPEATCOUNT 2U +/* Register ROGUE_CR_OS2_SCRATCH0 */ +#define ROGUE_CR_OS2_SCRATCH0 0x21A80U +#define ROGUE_CR_OS2_SCRATCH0_MASKFULL 0x00000000FFFFFFFFULL +#define ROGUE_CR_OS2_SCRATCH0_DATA_SHIFT 0U +#define ROGUE_CR_OS2_SCRATCH0_DATA_CLRMSK 0x00000000U + +/* Register ROGUE_CR_OS2_SCRATCH1 */ +#define ROGUE_CR_OS2_SCRATCH1 0x21A88U +#define ROGUE_CR_OS2_SCRATCH1_MASKFULL 0x00000000FFFFFFFFULL +#define ROGUE_CR_OS2_SCRATCH1_DATA_SHIFT 0U
Lines of this file are not shown. View the raw message.
drivers/gpu/drm/imagination/pvr_rogue_cr_defs_client.h new file +159 -0
159 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_rogue_defs.h new file +179 -0
179 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_rogue_fwif.h new file +2208 -0
2,208 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_rogue_fwif_check.h new file +491 -0
491 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_rogue_fwif_client.h new file +369 -0
369 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_rogue_fwif_client_check.h new file +133 -0
133 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_rogue_fwif_common.h new file +60 -0
60 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_rogue_fwif_resetframework.h new file +28 -0
Lines of this file are not shown. View the raw message.
drivers/gpu/drm/imagination/pvr_rogue_fwif_sf.h new file +1648 -0
1,648 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_rogue_fwif_shared.h new file +258 -0
258 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_rogue_fwif_shared_check.h new file +108 -0
108 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_rogue_fwif_stream.h new file +78 -0
78 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_rogue_heap_config.h new file +113 -0
113 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_rogue_meta.h new file +356 -0
356 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_rogue_mips.h new file +335 -0
335 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_rogue_mips_check.h new file +58 -0
58 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_rogue_mmu_defs.h new file +136 -0
136 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.40.1
Part of the diff is not shown here. View the raw message.
PATCH v3 7/17 drm/imagination: Add GPU ID parsing and firmware loading
In reply to Sarah WalkerRead the GPU ID register at probe time and select the correct features/quirks/enhancements. Use the GPU ID to form the firmware file name and load the firmware.
The features/quirks/enhancements arrays are currently hardcoded in the driver for the supported GPUs. We are looking at moving this information to the firmware image.
--- drivers/gpu/drm/imagination/Makefile | 1 + drivers/gpu/drm/imagination/pvr_device.c | 359 ++++++++++++ drivers/gpu/drm/imagination/pvr_device.h | 221 +++++++ drivers/gpu/drm/imagination/pvr_device_info.c | 223 +++++++ drivers/gpu/drm/imagination/pvr_device_info.h | 133 +++++ drivers/gpu/drm/imagination/pvr_drv.c | 553 +++++++++++++++++- drivers/gpu/drm/imagination/pvr_drv.h | 108 ++++ drivers/gpu/drm/imagination/pvr_fw.h | 20 + 8 files changed, 1617 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/drm/imagination/pvr_device_info.c create mode 100644 drivers/gpu/drm/imagination/pvr_device_info.h create mode 100644 drivers/gpu/drm/imagination/pvr_fw.h
drivers/gpu/drm/imagination/Makefile +1 -0
@@ -5,6 +5,7 @@ subdir-ccflags-y := -I$(srctree)/$(src) powervr-y := \ pvr_device.o \ + pvr_device_info.o \ pvr_drv.o \ obj-$(CONFIG_DRM_POWERVR) += powervr.o
drivers/gpu/drm/imagination/pvr_device.c +359 -0
397 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_device.h +221 -0
275 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_device_info.c new file +223 -0
223 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_device_info.h new file +133 -0
133 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_drv.c +552 -1
577 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_drv.h +108 -0
112 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_fw.h new file +20 -0
@@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: GPL-2.0 OR MIT */ +/* Copyright (c) 2022 Imagination Technologies Ltd. */ + +#ifndef PVR_FW_H +#define PVR_FW_H + +#include <linux/firmware.h> + +struct pvr_fw_device { +/** @firmware: Handle to the firmware loaded into the device. */ +const struct firmware *firmware; + +/* +* @processor_type: FW processor type for this device. Must be one of +* %PVR_FW_PROCESSOR_TYPE_*. +*/ +u16 processor_type; +}; + +#endif /* PVR_FW_H */
Signature · 1 line
2.40.1
Re: [PATCH v3 07/17] drm/imagination: Add GPU ID parsing and firmware loading
Quoted 4 lines · Sarah Walker
Read the GPU ID register at probe time and select the correct features/quirks/enhancements. Use the GPU ID to form the firmware file name and load the firmware.
I have a Rogue 6250 variant, but the BVNC is returning a slightly different revision than the firmware that's currently available, and the older firmware for the vendor driver doesn't work with this new code.
Linux responds with Unsupported BVNC: 4.45.2.58. From what I can tell, the closest available firmware is 4.40.2.51.
Will there be more firmware variants in the future or will there be some options to build the firmware somehow?
adam
Quoted 1,823 lines
The features/quirks/enhancements arrays are currently hardcoded in the driver for the supported GPUs. We are looking at moving this information to the firmware image.
Signed-off-by Sarah Walker <[email protected]>--- drivers/gpu/drm/imagination/Makefile | 1 + drivers/gpu/drm/imagination/pvr_device.c | 359 ++++++++++++ drivers/gpu/drm/imagination/pvr_device.h | 221 +++++++ drivers/gpu/drm/imagination/pvr_device_info.c | 223 +++++++ drivers/gpu/drm/imagination/pvr_device_info.h | 133 +++++ drivers/gpu/drm/imagination/pvr_drv.c | 553 +++++++++++++++++- drivers/gpu/drm/imagination/pvr_drv.h | 108 ++++ drivers/gpu/drm/imagination/pvr_fw.h | 20 + 8 files changed, 1617 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/drm/imagination/pvr_device_info.c create mode 100644 drivers/gpu/drm/imagination/pvr_device_info.h create mode 100644 drivers/gpu/drm/imagination/pvr_fw.hdrivers/gpu/drm/imagination/Makefile +1
-0@@ -5,6 +5,7 @@ subdir-ccflags-y := -I$(srctree)/$(src) powervr-y := \ pvr_device.o \ + pvr_device_info.o \ pvr_drv.o \ obj-$(CONFIG_DRM_POWERVR) += powervr.odrivers/gpu/drm/imagination/pvr_device.c +359
-0@@ -2,20 +2,32 @@/* Copyright (c) 2022 Imagination Technologies Ltd. */ #include "pvr_device.h" +#include "pvr_device_info.h" + +#include "pvr_fw.h" +#include "pvr_rogue_cr_defs.h" #include <drm/drm_print.h> +#include <linux/bitfield.h> #include <linux/clk.h> #include <linux/compiler_attributes.h> #include <linux/compiler_types.h> #include <linux/dma-mapping.h> #include <linux/err.h> +#include <linux/firmware.h> #include <linux/gfp.h> +#include <linux/interrupt.h> #include <linux/platform_device.h> +#include <linux/pm_runtime.h> #include <linux/regulator/consumer.h> #include <linux/slab.h> #include <linux/stddef.h> #include <linux/types.h> +#include <linux/workqueue.h> + +/* Major number for the supported version of the firmware. */ +#define PVR_FW_VERSION_MAJOR 1/** * pvr_device_reg_init() - Initialize kernel access to a PowerVR device's @@ -205,6 +217,246 @@ pvr_device_regulator_init(struct pvr_device *pvr_dev)return err; } +/** +* pvr_device_clk_core_get_freq - Get current PowerVR device core clock frequency +* @pvr_dev: Target PowerVR device. +* @freq_out: Pointer to location to store core clock frequency in Hz. +* +* Returns: +* * 0 on success, or +* * -%EINVAL if frequency can not be determined. +*/ +int +pvr_device_clk_core_get_freq (struct pvr_device *pvr_dev,u32 *freq_out) +{ +u32 freq =clk_get_rate (pvr_dev->core_clk); + +if (!freq) +return -EINVAL ; + + *freq_out = freq; +return 0 ; +} + +/** +* pvr_build_firmware_filename() - Construct a PowerVR firmware filename +* @pvr_dev: Target PowerVR device. +* @base: First part of the filename. +* @major: Major version number. +* +* A PowerVR firmware filename consists of three parts separated by underscores +* (``'_'``) along with a '.fw' file suffix. The first part is the exact value +* of @base, the second part is the hardware version string derived from @pvr_fw +* and the final part is the firmware version number constructed from @major with +* a 'v' prefix, e.g. powervr/rogue_4.40.2.51_v1.fw. +* +* The returned string will have been slab allocated and must be freed with +* kfree(). +* +* Return: +* * The constructed filename on success, or +* * Any error returned by kasprintf(). +*/ +static char * +pvr_build_firmware_filename (struct pvr_device *pvr_dev,const char *base, +u8 major) +{ +struct pvr_gpu_id *gpu_id = &pvr_dev->gpu_id; + +return kasprintf (GFP_KERNEL ,"%s_%d.%d.%d.%d_v%d.fw" , base, gpu_id->b, + gpu_id->v, gpu_id->n, gpu_id->c, major); +} + +/** +* pvr_request_firmware() - Load firmware for a PowerVR device +* @pvr_dev: Target PowerVR device. +* +* See pvr_build_firmware_filename() for details on firmware file naming. +* +* Return: +* * 0 on success, +* * Any error returned by pvr_build_firmware_filename(), or +* * Any error returned by request_firmware(). +*/ +static int +pvr_request_firmware (struct pvr_device *pvr_dev) +{ +struct drm_device *drm_dev = &pvr_dev->base; +char *filename; +const struct firmware *fw; +int err; + + filename =pvr_build_firmware_filename (pvr_dev,"powervr/rogue" , +PVR_FW_VERSION_MAJOR ); +if (IS_ERR (filename)) +return PTR_ERR (filename); + +/* +* This function takes a copy of &filename, meaning we can free our +* instance before returning. +*/ + err =request_firmware (&fw, filename, pvr_dev->base.dev); +if (err) { +drm_err (drm_dev,"failed to load firmware %s (err=%d)\n" , + filename, err); + goto err_free_filename; + } + +drm_info (drm_dev,"loaded firmware %s\n" , filename); +kfree (filename); + + pvr_dev->fw_dev.firmware = fw; + +return 0 ; + +err_free_filename: +kfree (filename); + +return err; +} + +/** +* pvr_load_gpu_id() - Load a PowerVR device's GPU ID (BVNC) from control registers. +* +* Sets struct pvr_dev.gpu_id. +* +* @pvr_dev: Target PowerVR device. +*/ +static void +pvr_load_gpu_id (struct pvr_device *pvr_dev) +{ +struct pvr_gpu_id *gpu_id = &pvr_dev->gpu_id; +u64 bvnc; + +/* +* Try reading the BVNC using the newer (cleaner) method first. If the +* B value is zero, fall back to the older method. +*/ + bvnc =PVR_CR_READ64 (pvr_dev,CORE_ID__PBVNC ); + + gpu_id->b =PVR_CR_FIELD_GET (bvnc,CORE_ID__PBVNC__BRANCH_ID ); +if (gpu_id->b !=0 ) { + gpu_id->v =PVR_CR_FIELD_GET (bvnc,CORE_ID__PBVNC__VERSION_ID ); + gpu_id->n =PVR_CR_FIELD_GET (bvnc,CORE_ID__PBVNC__NUMBER_OF_SCALABLE_UNITS ); + gpu_id->c =PVR_CR_FIELD_GET (bvnc,CORE_ID__PBVNC__CONFIG_ID ); + }else { +u32 core_rev =PVR_CR_READ32 (pvr_dev,CORE_REVISION ); +u32 core_id =PVR_CR_READ32 (pvr_dev,CORE_ID ); +u16 core_id_config =PVR_CR_FIELD_GET (core_id,CORE_ID_CONFIG ); + + gpu_id->b =PVR_CR_FIELD_GET (core_rev,CORE_REVISION_MAJOR ); + gpu_id->v =PVR_CR_FIELD_GET (core_rev,CORE_REVISION_MINOR ); + gpu_id->n =FIELD_GET (0xFF00 , core_id_config); + gpu_id->c =FIELD_GET (0x00FF , core_id_config); + } +} + +/** +* pvr_set_dma_info() - Set PowerVR device DMA information +* @pvr_dev: Target PowerVR device. +* +* Sets the DMA mask and max segment size for the PowerVR device. +* +* Return: +* * 0 on success, +* * Any error returned by PVR_FEATURE_VALUE(), or +* * Any error returned by dma_set_mask(). +*/ + +static int +pvr_set_dma_info (struct pvr_device *pvr_dev) +{ +struct drm_device *drm_dev =from_pvr_device (pvr_dev); +u16 phys_bus_width; +int err; + + err =PVR_FEATURE_VALUE (pvr_dev, phys_bus_width, &phys_bus_width); +if (err) { +drm_err (drm_dev,"Failed to get device physical bus width\n" ); +return err; + } + +/* +* See the comment on &pvr_drm_driver.prime_fd_to_handle for an +* explanation of the dma_set_mask function and dma_set_max_seg_size +* calls below. +*/ + err =dma_set_mask (drm_dev->dev,DMA_BIT_MASK (phys_bus_width)); +if (err) { +drm_err (drm_dev,"Failed to set DMA mask (err=%d)\n" , err); +return err; + } + +dma_set_max_seg_size (drm_dev->dev,UINT_MAX ); + +return 0 ; +} + +/** +* pvr_device_gpu_init() - GPU-specific initialization for a PowerVR device +* @pvr_dev: Target PowerVR device. +* +* The following steps are taken to ensure the device is ready: +* +* 1. Read the hardware version information from control registers, +* 2. Initialise the hardware feature information, +* 3. Setup the device DMA information, +* 4. Setup the device-scoped memory context, and +* 5. Load firmware into the device. +* +* Return: +* * 0 on success, +* * -%ENODEV if the GPU is not supported, +* * Any error returned by pvr_set_dma_info(), +* * Any error returned by pvr_memory_context_init(), or +* * Any error returned by pvr_request_firmware(). +*/ +static int +pvr_device_gpu_init (struct pvr_device *pvr_dev) +{ +int err; + +pvr_load_gpu_id (pvr_dev); + + err =pvr_device_info_init (pvr_dev); +if (err) + goto err_out; + +if (PVR_HAS_FEATURE (pvr_dev, meta)) { + pvr_dev->fw_dev.processor_type =PVR_FW_PROCESSOR_TYPE_META ; + }else if (PVR_HAS_FEATURE (pvr_dev, mips)) { + pvr_dev->fw_dev.processor_type =PVR_FW_PROCESSOR_TYPE_MIPS ; + }else if (PVR_HAS_FEATURE (pvr_dev, riscv_fw_processor)) { + pvr_dev->fw_dev.processor_type =PVR_FW_PROCESSOR_TYPE_RISCV ; + }else { + err = -EINVAL ; + goto err_out; + } + + err =pvr_set_dma_info (pvr_dev); +if (err) + goto err_out; + + err =pvr_request_firmware (pvr_dev); +if (err) + goto err_out; + +return 0 ; + +err_out: +return err; +} + +/** +* pvr_device_gpu_fini() - GPU-specific deinitialization for a PowerVR device +* @pvr_dev: Target PowerVR device. +*/ +static void +pvr_device_gpu_fini (struct pvr_device *pvr_dev) +{ +release_firmware (pvr_dev->fw_dev.firmware); +} +/** * pvr_device_init() - Initialize a PowerVR device * @pvr_dev: Target PowerVR device. @@ -240,6 +492,11 @@ pvr_device_init(struct pvr_device *pvr_dev)/* Map the control registers into memory. */ err =pvr_device_reg_init (pvr_dev); +if (err) + goto err_device_clk_fini; + +/* Perform GPU-specific initialization steps. */ + err =pvr_device_gpu_init (pvr_dev);if (err) goto err_device_reg_fini;@@ -266,6 +523,108 @@ pvr_device_fini(struct pvr_device *pvr_dev)* Deinitialization stages are performed in reverse order compared to * the initialization stages in pvr_device_init(). */ +pvr_device_gpu_fini (pvr_dev);pvr_device_reg_fini (pvr_dev);pvr_device_clk_fini (pvr_dev); } + +bool +pvr_device_has_uapi_quirk (struct pvr_device *pvr_dev,u32 quirk) +{ +switch (quirk) { +case 47217 : +return PVR_HAS_QUIRK (pvr_dev,47217 ); +case 48545 : +return PVR_HAS_QUIRK (pvr_dev,48545 ); +case 49927 : +return PVR_HAS_QUIRK (pvr_dev,49927 ); +case 51764 : +return PVR_HAS_QUIRK (pvr_dev,51764 ); +case 62269 : +return PVR_HAS_QUIRK (pvr_dev,62269 ); +default : +return false; + }; +} + +bool +pvr_device_has_uapi_enhancement (struct pvr_device *pvr_dev,u32 enhancement) +{ +switch (enhancement) { +case 35421 : +return PVR_HAS_ENHANCEMENT (pvr_dev,35421 ); +case 42064 : +return PVR_HAS_ENHANCEMENT (pvr_dev,42064 ); +default : +return false; + }; +} + +/** +* pvr_device_has_feature() - Look up device feature based on feature definition +* @pvr_dev: Device pointer. +* @feature: Feature to look up. Should be one of %PVR_FEATURE_*. +* +* Returns: +* * %true if feature is present on device, or +* * %false if feature is not present on device. +*/ +bool +pvr_device_has_feature (struct pvr_device *pvr_dev,u32 feature) +{ +switch (feature) { +case PVR_FEATURE_CLUSTER_GROUPING : +return PVR_HAS_FEATURE (pvr_dev, cluster_grouping); + +case PVR_FEATURE_COMPUTE_MORTON_CAPABLE : +return PVR_HAS_FEATURE (pvr_dev, compute_morton_capable); + +case PVR_FEATURE_FB_CDC_V4 : +return PVR_HAS_FEATURE (pvr_dev, fb_cdc_v4); + +case PVR_FEATURE_GPU_MULTICORE_SUPPORT : +return PVR_HAS_FEATURE (pvr_dev, gpu_multicore_support); + +case PVR_FEATURE_ISP_ZLS_D24_S8_PACKING_OGL_MODE : +return PVR_HAS_FEATURE (pvr_dev, isp_zls_d24_s8_packing_ogl_mode); + +case PVR_FEATURE_S7_TOP_INFRASTRUCTURE : +return PVR_HAS_FEATURE (pvr_dev, s7_top_infrastructure); + +case PVR_FEATURE_TESSELLATION : +return PVR_HAS_FEATURE (pvr_dev, tessellation); + +case PVR_FEATURE_TPU_DM_GLOBAL_REGISTERS : +return PVR_HAS_FEATURE (pvr_dev, tpu_dm_global_registers); + +case PVR_FEATURE_VDM_DRAWINDIRECT : +return PVR_HAS_FEATURE (pvr_dev, vdm_drawindirect); + +case PVR_FEATURE_VDM_OBJECT_LEVEL_LLS : +return PVR_HAS_FEATURE (pvr_dev, vdm_object_level_lls); + +case PVR_FEATURE_ZLS_SUBTILE : +return PVR_HAS_FEATURE (pvr_dev, zls_subtile); + +/* Derived features. */ +case PVR_FEATURE_CDM_USER_MODE_QUEUE : { +u8 cdm_control_stream_format =0 ; + +PVR_FEATURE_VALUE (pvr_dev, cdm_control_stream_format, &cdm_control_stream_format); +return (cdm_control_stream_format >=2 && cdm_control_stream_format <=4 ); + } + +case PVR_FEATURE_REQUIRES_FB_CDC_ZLS_SETUP : +if (PVR_HAS_FEATURE (pvr_dev, fbcdc_algorithm)) { +u8 fbcdc_algorithm =0 ; + +PVR_FEATURE_VALUE (pvr_dev, fbcdc_algorithm, &fbcdc_algorithm); +return (fbcdc_algorithm <3 ||PVR_HAS_FEATURE (pvr_dev, fb_cdc_v4)); + } +return false; + +default : +WARN (true,"Looking up undefined feature %u\n" , feature); +return false; + } +}drivers/gpu/drm/imagination/pvr_device.h +221
-0@@ -4,6 +4,9 @@#ifndef PVR_DEVICE_H #define PVR_DEVICE_H +#include "pvr_device_info.h" +#include "pvr_fw.h" +#include <drm/drm_device.h> #include <drm/drm_file.h> #include <drm/drm_mm.h> @@ -31,6 +34,26 @@ struct firmware;/* Forward declaration from <linux/regulator/consumer.h>. */ struct regulator ; +/** +* struct pvr_gpu_id - Hardware GPU ID information for a PowerVR device +* @b: Branch ID. +* @v: Version ID. +* @n: Number of scalable units. +* @c: Config ID. +*/ +struct pvr_gpu_id { +u16 b, v, n, c; +}; + +/** +* struct pvr_fw_version - Firmware version information +* @major: Major version number. +* @minor: Minor version number. +*/ +struct pvr_fw_version { +u16 major, minor; +}; +/** * struct pvr_device - powervr-specific wrapper for &struct drm_device */ @@ -43,6 +66,35 @@ struct pvr_device {*/ struct drm_device base; +/** @gpu_id: GPU ID detected at runtime. */ +struct pvr_gpu_id gpu_id; + +/** +* @features: Hardware feature information. +* +* Do not access this member directly, instead use PVR_HAS_FEATURE() +* or PVR_FEATURE_VALUE() macros. +*/ +struct pvr_device_features features; + +/** +* @quirks: Hardware quirk information. +* +* Do not access this member directly, instead use PVR_HAS_QUIRK(). +*/ +struct pvr_device_quirks quirks; + +/** +* @enhancements: Hardware enhancement information. +* +* Do not access this member directly, instead use +* PVR_HAS_ENHANCEMENT(). +*/ +struct pvr_device_enhancements enhancements; + +/** @fw_version: Firmware version detected at runtime. */ +struct pvr_fw_version fw_version; +/** @regs_resource: Resource representing device control registers. */ struct resource *regs_resource;@@ -65,6 +117,9 @@ struct pvr_device {/** @regulator: Power regulator. */ struct regulator *regulator; + +/** @fw_dev: Firmware related data. */ +struct pvr_fw_device fw_dev; };/** @@ -85,8 +140,79 @@ struct pvr_file {* to_pvr_device(). */ struct pvr_device *pvr_dev; + }; +/** +* PVR_HAS_FEATURE() - Tests whether a PowerVR device has a given feature +* @pvr_dev: [IN] Target PowerVR device. +* @feature: [IN] Hardware feature name. +* +* Feature names are derived from those found in &struct pvr_device_features by +* dropping the 'has_' prefix, which is applied by this macro. +* +* Return: +* * true if the named feature is present in the hardware +* * false if the named feature is not present in the hardware +*/ +#define PVR_HAS_FEATURE (pvr_dev, feature) ((pvr_dev)->features.has_##feature) + +/** +* PVR_FEATURE_VALUE() - Gets a PowerVR device feature value +* @pvr_dev: [IN] Target PowerVR device. +* @feature: [IN] Feature name. +* @value_out: [OUT] Feature value. +* +* This macro will get a feature value for those features that have values. +* If the feature is not present, nothing will be stored to @value_out. +* +* Feature names are derived from those found in &struct pvr_device_features by +* dropping the 'has_' prefix. +* +* Return: +* * 0 on success, or +* * -%EINVAL if the named feature is not present in the hardware +*/ +#define PVR_FEATURE_VALUE (pvr_dev, feature, value_out) \ + ({ \ + struct pvr_device *_pvr_dev = pvr_dev; \ + int _ret = -EINVAL; \ + if (_pvr_dev->features.has_##feature) { \ + *(value_out) = _pvr_dev->features.feature; \ + _ret = 0; \ + } \ + _ret; \ + }) + +/** +* PVR_HAS_QUIRK() - Tests whether a physical device has a given quirk +* @pvr_dev: [IN] Target PowerVR device. +* @quirk: [IN] Hardware quirk name. +* +* Quirk numbers are derived from those found in #pvr_device_quirks by +* dropping the 'has_brn' prefix, which is applied by this macro. +* +* Returns +* * true if the quirk is present in the hardware, or +* * false if the quirk is not present in the hardware. +*/ +#define PVR_HAS_QUIRK (pvr_dev, quirk) ((pvr_dev)->quirks.has_brn##quirk) + +/** +* PVR_HAS_ENHANCEMENT() - Tests whether a physical device has a given +* enhancement +* @pvr_dev: [IN] Target PowerVR device. +* @enhancement: [IN] Hardware enhancement name. +* +* Enhancement numbers are derived from those found in #pvr_device_enhancements +* by dropping the 'has_ern' prefix, which is applied by this macro. +* +* Returns +* * true if the enhancement is present in the hardware, or +* * false if the enhancement is not present in the hardware. +*/ +#define PVR_HAS_ENHANCEMENT (pvr_dev, enhancement) ((pvr_dev)->enhancements.has_ern##enhancement) + static __always_inline struct drm_device *from_pvr_device (struct pvr_device *pvr_dev) {@@ -111,12 +237,80 @@ to_pvr_file(struct drm_file *file)return file->driver_priv; } +/** +* PVR_PACKED_BVNC() - Packs B, V, N and C values into a 64-bit unsigned integer +* @b: Branch ID. +* @v: Version ID. +* @n: Number of scalable units. +* @c: Config ID. +* +* The packed layout is as follows: +* +* +--------+--------+--------+-------+ +* | 63..48 | 47..32 | 31..16 | 15..0 | +* +========+========+========+=======+ +* | B | V | N | C | +* +--------+--------+--------+-------+ +* +* pvr_gpu_id_to_packed_bvnc() should be used instead of this macro when a +* &struct pvr_gpu_id is available in order to ensure proper type checking. +* +* Return: Packed BVNC. +*/ +/* clang-format off */ +#define PVR_PACKED_BVNC (b, v, n, c) \ + ((((u64)(b) & GENMASK_ULL(15, 0)) << 48) | \ + (((u64)(v) & GENMASK_ULL(15, 0)) << 32) | \ + (((u64)(n) & GENMASK_ULL(15, 0)) << 16) | \ + (((u64)(c) & GENMASK_ULL(15, 0)) << 0)) +/* clang-format on */ + +/** +* pvr_gpu_id_to_packed_bvnc() - Packs B, V, N and C values into a 64-bit +* unsigned integer +* @gpu_id: GPU ID. +* +* The packed layout is as follows: +* +* +--------+--------+--------+-------+ +* | 63..48 | 47..32 | 31..16 | 15..0 | +* +========+========+========+=======+ +* | B | V | N | C | +* +--------+--------+--------+-------+ +* +* This should be used in preference to PVR_PACKED_BVNC() when a &struct +* pvr_gpu_id is available in order to ensure proper type checking. +* +* Return: Packed BVNC. +*/ +static __always_inline u64 +pvr_gpu_id_to_packed_bvnc (struct pvr_gpu_id *gpu_id) +{ +return PVR_PACKED_BVNC (gpu_id->b, gpu_id->v, gpu_id->n, gpu_id->c); +} + +static __always_inline void +packed_bvnc_to_pvr_gpu_id (u64 bvnc,struct pvr_gpu_id *gpu_id) +{ + gpu_id->b = (bvnc &GENMASK_ULL (63 ,48 )) >>48 ; + gpu_id->v = (bvnc &GENMASK_ULL (47 ,32 )) >>32 ; + gpu_id->n = (bvnc &GENMASK_ULL (31 ,16 )) >>16 ; + gpu_id->c = bvnc &GENMASK_ULL (15 ,0 ); +} +int pvr_device_init (struct pvr_device *pvr_dev);void pvr_device_fini (struct pvr_device *pvr_dev);int pvr_device_clk_core_get_freq (struct pvr_device *pvr_dev,u32 *freq_out); +bool +pvr_device_has_uapi_quirk (struct pvr_device *pvr_dev,u32 quirk); +bool +pvr_device_has_uapi_enhancement (struct pvr_device *pvr_dev,u32 enhancement); +bool +pvr_device_has_feature (struct pvr_device *pvr_dev,u32 feature); +/** * PVR_CR_READ32() - Read a 32-bit register from a PowerVR device * @pvr_dev: Target PowerVR device. @@ -286,6 +480,29 @@ pvr_cr_poll_reg64(struct pvr_device *pvr_dev, u32 reg_addr, u64 reg_value, (value & reg_mask) == reg_value, 0, timeout_usec); } +/** +* pvr_round_up_to_cacheline_size() - Round up a provided size to be cacheline +* aligned +* @pvr_dev: Target PowerVR device. +* @size: Initial size, in bytes. +* +* Returns: +* * Size aligned to cacheline size. +*/ +static __always_inline size_t +pvr_round_up_to_cacheline_size (struct pvr_device *pvr_dev,size_t size) +{ +u16 slc_cacheline_size_in_bits =0 ; +u16 slc_cacheline_size_in_bytes; + +WARN_ON (!PVR_HAS_FEATURE (pvr_dev, slc_cache_line_size_in_bits)); +PVR_FEATURE_VALUE (pvr_dev, slc_cache_line_size_in_bits, + &slc_cacheline_size_in_bits); + slc_cacheline_size_in_bytes = slc_cacheline_size_in_bits /8 ; + +return round_up (size, slc_cacheline_size_in_bytes); +} +/** * DOC: IOCTL validation helpers * @@ -380,4 +597,8 @@ pvr_ioctl_union_padding_check(void *instance, size_t union_offset, __union_size, __member_size); \ }) +#define PVR_FW_PROCESSOR_TYPE_META 0 +#define PVR_FW_PROCESSOR_TYPE_MIPS 1 +#define PVR_FW_PROCESSOR_TYPE_RISCV 2 +#endif /* PVR_DEVICE_H */ drivers/gpu/drm/imagination/pvr_device_info.c new file +223
-0@@ -0,0 +1,223 @@ +// SPDX-License-Identifier: GPL-2.0 OR MIT +/* Copyright (c) 2022 Imagination Technologies Ltd. */ + +#include "pvr_device.h" +#include "pvr_device_info.h" + +#include <drm/drm_print.h> + +#include <linux/types.h> + +static const struct pvr_device_features pvr_device_4_V_2_51 = { + .has_cdm_control_stream_format = true, + .has_cluster_grouping = true, + .has_common_store_size_in_dwords = true, + .has_compute = true, + .has_compute_morton_capable = true, + .has_compute_overlap = true, + .has_fbcdc_algorithm = true, + .has_isp_max_tiles_in_flight = true, + .has_isp_samples_per_pixel = true, + .has_max_partitions = true, + .has_meta = true, + .has_meta_coremem_size = true, + .has_num_clusters = true, + .has_num_isp_ipp_pipes = true, + .has_num_raster_pipes = true, + .has_phys_bus_width = true, + .has_slc_cache_line_size_in_bits = true, + .has_tile_size_x = true, + .has_tile_size_y = true, + .has_usc_min_output_registers_per_pix = true, + .has_virtual_address_space_bits = true, + .has_xt_top_infrastructure = true, + .has_zls_subtile = true, + + .cdm_control_stream_format =1 , + .common_store_size_in_dwords =1280U *4U *4U , + .fbcdc_algorithm =2 , + .isp_max_tiles_in_flight =4 , + .isp_samples_per_pixel =2 , + .max_partitions =8 , + .meta = true, + .meta_coremem_size =32 , + .num_clusters =2 , + .num_isp_ipp_pipes =8 , + .num_raster_pipes =1 , + .phys_bus_width =40 , + .slc_cache_line_size_in_bits =512 , + .tile_size_x =32 , + .tile_size_y =32 , + .usc_min_output_registers_per_pix =2 , + .virtual_address_space_bits =40 , +}; + +static const struct pvr_device_quirks pvr_device_quirks_4_40_2_51 = { + .has_brn44079 = true, + .has_brn48492 = true, + .has_brn48545 = true, + .has_brn49927 = true, + .has_brn51764 = true, + .has_brn52354 = true, + .has_brn62269 = true, + .has_brn63142 = true, + .has_brn66011 = true, +}; + +static const struct pvr_device_enhancements pvr_device_enhancements_4_40_2_51 = { + .has_ern35421 = true, + .has_ern38020 = true, + .has_ern38748 = true, + .has_ern42064 = true, +}; + +static const struct pvr_device_features pvr_device_33_V_11_3 = { + .has_cdm_control_stream_format = true, + .has_common_store_size_in_dwords = true, + .has_compute = true, + .has_isp_max_tiles_in_flight = true, + .has_isp_samples_per_pixel = true, + .has_max_partitions = true, + .has_mips = true, + .has_num_clusters = true, + .has_num_isp_ipp_pipes = true, + .has_num_raster_pipes = true, + .has_phys_bus_width = true, + .has_roguexe = true, + .has_simple_internal_parameter_format = true, + .has_slc_cache_line_size_in_bits = true, + .has_sys_bus_secure_reset = true, + .has_tile_size_x = true, + .has_tile_size_y = true, + .has_usc_min_output_registers_per_pix = true, + .has_virtual_address_space_bits = true, + .has_xe_memory_hierarchy = true, + + .cdm_control_stream_format =1 , + .common_store_size_in_dwords =512U *4U *4U , + .isp_max_tiles_in_flight =1 , + .isp_samples_per_pixel =1 , + .max_partitions =4 , + .mips = true, + .num_clusters =1 , + .num_isp_ipp_pipes =1 , + .num_raster_pipes =1 , + .phys_bus_width =36 , + .simple_internal_parameter_format =2 , + .slc_cache_line_size_in_bits =512 , + .tile_size_x =16 , + .tile_size_y =16 , + .usc_min_output_registers_per_pix =1 , + .virtual_address_space_bits =40 , +}; + +static const struct pvr_device_quirks pvr_device_quirks_33_15_11_3 = { + .has_brn63553 = true, +}; + +static const struct pvr_device_enhancements pvr_device_enhancements_33_15_11_3 = { + .has_ern35421 = true, + .has_ern38748 = true, +}; + +static const struct pvr_device_features pvr_device_36_V_104_796 = { + .has_cdm_control_stream_format = true, + .has_common_store_size_in_dwords = true, + .has_compute = true, + .has_compute_overlap = true, + .has_fbcdc_algorithm = true, + .has_gpu_multicore_support = true, + .has_isp_max_tiles_in_flight = true, + .has_isp_samples_per_pixel = true, + .has_max_partitions = true, + .has_num_clusters = true, + .has_num_isp_ipp_pipes = true, + .has_num_raster_pipes = true, + .has_phys_bus_width = true, + .has_riscv_fw_processor = true, + .has_roguexe = true, + .has_simple_internal_parameter_format = true, + .has_slc_cache_line_size_in_bits = true, + .has_sys_bus_secure_reset = true, + .has_tile_size_x = true, + .has_tile_size_y = true, + .has_tpu_dm_global_registers = true, + .has_usc_min_output_registers_per_pix = true, + .has_virtual_address_space_bits = true, + .has_xe_memory_hierarchy = true, + .has_xpu_max_slaves = true, + + .cdm_control_stream_format =1 , + .common_store_size_in_dwords =1344U *4U *4U , + .fbcdc_algorithm =50 , + .isp_max_tiles_in_flight =6 , + .isp_samples_per_pixel =4 , + .max_partitions =16 , + .num_clusters =1 , + .num_isp_ipp_pipes =6 , + .num_raster_pipes =1 , + .phys_bus_width =36 , + .riscv_fw_processor = true, + .simple_internal_parameter_format =2 , + .slc_cache_line_size_in_bits =512 , + .tile_size_x =16 , + .tile_size_y =16 , + .usc_min_output_registers_per_pix =2 , + .virtual_address_space_bits =40 , + .xpu_max_slaves =3 , +}; + +static const struct pvr_device_quirks pvr_device_quirks_36_53_104_796 = { + .has_brn44079 = true, +}; + +static const struct pvr_device_enhancements pvr_device_enhancements_36_53_104_796 = { + .has_ern35421 = true, + .has_ern38748 = true, +}; + +/** +* pvr_device_info_init() - Initialize a PowerVR device's hardware features and quirks +* @pvr_dev: Target PowerVR device. +* +* This function relies on &pvr_dev.gpu_id having already been initialized. If +* PowerVR device version is supported then sets &pvr_dev.features and &pvr_dev.quirks. +* +* Return: +* * 0 on success, or +* * -%ENODEV if the device is not supported. +*/ +int +pvr_device_info_init (struct pvr_device *pvr_dev) +{ +struct drm_device *drm_dev =from_pvr_device (pvr_dev); +struct pvr_gpu_id *gpu_id = &pvr_dev->gpu_id; +const u64 bvnc =pvr_gpu_id_to_packed_bvnc (gpu_id); + +/* +* This macro results in a "Macros with multiple statements should be +* enclosed in a do - while loop" checkpatch error. However, following +* this advice would make the macro look a bit odd and isn't necessary +* in this particular case, as the macro has a very specific use and a +* very limited lifetime. The error can therefore be ignored. +*/ +#define CASE_PACKED_BVNC_DEVICE_INFO (b, v, n, c) \ + case PVR_PACKED_BVNC(b, v, n, c): \ + pvr_dev->features = pvr_device_##b##_V_##n##_##c; \ + pvr_dev->quirks = pvr_device_quirks_##b##_##v##_##n##_##c; \ + pvr_dev->enhancements = pvr_device_enhancements_##b##_##v##_##n##_##c; \ + return 0 + +switch (bvnc) { +CASE_PACKED_BVNC_DEVICE_INFO (4 ,40 ,2 ,51 ); +CASE_PACKED_BVNC_DEVICE_INFO (33 ,15 ,11 ,3 ); +CASE_PACKED_BVNC_DEVICE_INFO (36 ,53 ,104 ,796 ); + } + +#undef CASE_PACKED_BVNC_DEVICE_INFO + +drm_warn (drm_dev,"Unsupported BVNC: %u.%u.%u.%u\n" , gpu_id->b, + gpu_id->v, gpu_id->n, gpu_id->c); + +return -ENODEV ; +}drivers/gpu/drm/imagination/pvr_device_info.h new file +133
-0@@ -0,0 +1,133 @@ +/* SPDX-License-Identifier: GPL-2.0 OR MIT */ +/* Copyright (c) 2022 Imagination Technologies Ltd. */ + +#ifndef PVR_DEVICE_INFO_H +#define PVR_DEVICE_INFO_H + +#include <linux/types.h> + +struct pvr_device ; + +/* +* struct pvr_device_features - Hardware feature information +*/ +struct pvr_device_features { +bool has_cdm_control_stream_format :1 ; +bool has_cluster_grouping :1 ; +bool has_common_store_size_in_dwords :1 ; +bool has_compute :1 ; +bool has_compute_morton_capable :1 ; +bool has_compute_overlap :1 ; +bool has_fb_cdc_v4 :1 ; +bool has_fbcdc_algorithm :1 ; +bool has_gpu_multicore_support :1 ; +bool has_isp_max_tiles_in_flight :1 ; +bool has_isp_samples_per_pixel :1 ; +bool has_isp_zls_d24_s8_packing_ogl_mode :1 ; +bool has_max_partitions :1 ; +bool has_meta :1 ; +bool has_meta_coremem_size :1 ; +bool has_mips :1 ; +bool has_num_clusters :1 ; +bool has_num_isp_ipp_pipes :1 ; +bool has_num_raster_pipes :1 ; +bool has_phys_bus_width :1 ; +bool has_riscv_fw_processor :1 ; +bool has_roguexe :1 ; +bool has_s7_top_infrastructure :1 ; +bool has_simple_internal_parameter_format :1 ; +bool has_slc_cache_line_size_in_bits :1 ; +bool has_sys_bus_secure_reset :1 ; +bool has_tessellation :1 ; +bool has_tile_size_x :1 ; +bool has_tile_size_y :1 ; +bool has_tpu_dm_global_registers :1 ; +bool has_usc_min_output_registers_per_pix :1 ; +bool has_vdm_drawindirect :1 ; +bool has_vdm_object_level_lls :1 ; +bool has_virtual_address_space_bits :1 ; +bool has_xe_memory_hierarchy :1 ; +bool has_xpu_max_slaves :1 ; +bool has_xt_top_infrastructure :1 ; +bool has_zls_subtile :1 ; + +u8 cdm_control_stream_format; +u32 common_store_size_in_dwords; +u8 fbcdc_algorithm; +u16 isp_max_tiles_in_flight; +bool isp_samples_per_pixel; +u16 max_partitions; +bool meta; +u32 meta_coremem_size; +bool mips; +u16 num_clusters; +u8 num_isp_ipp_pipes; +u8 num_raster_pipes; +u16 phys_bus_width; +bool riscv_fw_processor; +u32 simple_internal_parameter_format; +u16 slc_cache_line_size_in_bits; +u16 tile_size_x; +u16 tile_size_y; +u16 usc_min_output_registers_per_pix; +u16 virtual_address_space_bits; +u8 xpu_max_slaves; +}; + +/* +* struct pvr_device_quirks - Hardware quirk information +*/ +struct pvr_device_quirks { +bool has_brn44079 :1 ; +bool has_brn47217 :1 ; +bool has_brn48492 :1 ; +bool has_brn48545 :1 ; +bool has_brn49927 :1 ; +bool has_brn51764 :1 ; +bool has_brn52354 :1 ; +bool has_brn62269 :1 ; +bool has_brn63142 :1 ; +bool has_brn63553 :1 ; +bool has_brn66011 :1 ; +}; + +/* +* struct pvr_device_enhancements - Hardware enhancement information +*/ +struct pvr_device_enhancements { +bool has_ern35421 :1 ; +bool has_ern38020 :1 ; +bool has_ern38748 :1 ; +bool has_ern42064 :1 ; +}; + +int pvr_device_info_init (struct pvr_device *pvr_dev); + +/* +* Meta cores +* +* These are the values for the 'meta' feature when the feature is present +* (as per &struct pvr_device_features)/ +*/ +#define PVR_META_MTP218 (1) +#define PVR_META_MTP219 (2) +#define PVR_META_LTP218 (3) +#define PVR_META_LTP217 (4) + +enum { +PVR_FEATURE_CDM_USER_MODE_QUEUE , +PVR_FEATURE_CLUSTER_GROUPING , +PVR_FEATURE_COMPUTE_MORTON_CAPABLE , +PVR_FEATURE_FB_CDC_V4 , +PVR_FEATURE_GPU_MULTICORE_SUPPORT , +PVR_FEATURE_ISP_ZLS_D24_S8_PACKING_OGL_MODE , +PVR_FEATURE_REQUIRES_FB_CDC_ZLS_SETUP , +PVR_FEATURE_S7_TOP_INFRASTRUCTURE , +PVR_FEATURE_TESSELLATION , +PVR_FEATURE_TPU_DM_GLOBAL_REGISTERS , +PVR_FEATURE_VDM_DRAWINDIRECT , +PVR_FEATURE_VDM_OBJECT_LEVEL_LLS , +PVR_FEATURE_ZLS_SUBTILE , +}; + +#endif /* PVR_DEVICE_INFO_H */ drivers/gpu/drm/imagination/pvr_drv.c +552
-1@@ -3,6 +3,9 @@#include "pvr_device.h" #include "pvr_drv.h" +#include "pvr_rogue_defs.h" +#include "pvr_rogue_fwif_client.h" +#include "pvr_rogue_fwif_shared.h" #include <uapi/drm/pvr_drm.h> @@ -88,6 +91,422 @@ pvr_ioctl_get_bo_mmap_offset(__always_unused struct drm_device *drm_dev,return -ENOTTY ; } +static __always_inline u64 +pvr_fw_version_packed (u32 major,u32 minor) +{ +return ((u64 )major <<32 ) | minor; +} + +static u32 +rogue_get_common_store_partition_space_size (struct pvr_device *pvr_dev) +{ +u32 max_partitions =0 ; +u32 tile_size_x =0 ; +u32 tile_size_y =0 ; + +PVR_FEATURE_VALUE (pvr_dev, tile_size_x, &tile_size_x); +PVR_FEATURE_VALUE (pvr_dev, tile_size_y, &tile_size_y); +PVR_FEATURE_VALUE (pvr_dev, max_partitions, &max_partitions); + +if (tile_size_x ==16 && tile_size_y ==16 ) { +u32 usc_min_output_registers_per_pix =0 ; + +PVR_FEATURE_VALUE (pvr_dev, usc_min_output_registers_per_pix, + &usc_min_output_registers_per_pix); + +return tile_size_x * tile_size_y * max_partitions * + usc_min_output_registers_per_pix; + } + +return max_partitions *1024 ; +} + +static u32 +rogue_get_common_store_alloc_region_size (struct pvr_device *pvr_dev) +{ +u32 common_store_size_in_dwords =512 *4 *4 ; +u32 alloc_region_size; + +PVR_FEATURE_VALUE (pvr_dev, common_store_size_in_dwords, &common_store_size_in_dwords); + + alloc_region_size = common_store_size_in_dwords - (256U *4U ) - +rogue_get_common_store_partition_space_size (pvr_dev); + +if (PVR_HAS_QUIRK (pvr_dev,44079 )) { +u32 common_store_split_point = (768U *4U *4U ); + +return min (common_store_split_point - (256U *4U ), alloc_region_size); + } + +return alloc_region_size; +} + +static inline u32 +rogue_get_num_phantoms (struct pvr_device *pvr_dev) +{ +u32 num_clusters =1 ; + +PVR_FEATURE_VALUE (pvr_dev, num_clusters, &num_clusters); + +return ROGUE_REQ_NUM_PHANTOMS (num_clusters); +} + +static inline u32 +rogue_get_max_coeffs (struct pvr_device *pvr_dev) +{ +u32 max_coeff_additional_portion =ROGUE_MAX_VERTEX_SHARED_REGISTERS ; +u32 pending_allocation_shared_regs =2U *1024U ; +u32 pending_allocation_coeff_regs =0U ; +u32 num_phantoms =rogue_get_num_phantoms (pvr_dev); +u32 tiles_in_flight =0 ; +u32 max_coeff_pixel_portion; + +PVR_FEATURE_VALUE (pvr_dev, isp_max_tiles_in_flight, &tiles_in_flight); + max_coeff_pixel_portion =DIV_ROUND_UP (tiles_in_flight, num_phantoms); + max_coeff_pixel_portion *=ROGUE_MAX_PIXEL_SHARED_REGISTERS ; + +/* +* Compute tasks on cores with BRN48492 and without compute overlap may lock +* up without two additional lines of coeffs. +*/ +if (PVR_HAS_QUIRK (pvr_dev,48492 ) && !PVR_HAS_FEATURE (pvr_dev, compute_overlap)) + pending_allocation_coeff_regs =2U *1024U ; + +if (PVR_HAS_ENHANCEMENT (pvr_dev,38748 )) + pending_allocation_shared_regs =0 ; + +if (PVR_HAS_ENHANCEMENT (pvr_dev,38020 )) + max_coeff_additional_portion +=ROGUE_MAX_COMPUTE_SHARED_REGISTERS ; + +return rogue_get_common_store_alloc_region_size (pvr_dev) + pending_allocation_coeff_regs - + (max_coeff_pixel_portion + max_coeff_additional_portion + + pending_allocation_shared_regs); +} + +static inline u32 +rogue_get_cdm_max_local_mem_size_regs (struct pvr_device *pvr_dev) +{ +u32 available_coeffs_in_dwords =rogue_get_max_coeffs (pvr_dev); + +if (PVR_HAS_QUIRK (pvr_dev,48492 ) &&PVR_HAS_FEATURE (pvr_dev, roguexe) && + !PVR_HAS_FEATURE (pvr_dev, compute_overlap)) { +/* Driver must not use the 2 reserved lines. */ + available_coeffs_in_dwords -=ROGUE_CSRM_LINE_SIZE_IN_DWORDS *2 ; + } + +/* +* The maximum amount of local memory available to a kernel is the minimum +* of the total number of coefficient registers available and the max common +* store allocation size which can be made by the CDM. +* +* If any coeff lines are reserved for tessellation or pixel then we need to +* subtract those too. +*/ +return min (available_coeffs_in_dwords, (u32 )ROGUE_MAX_PER_KERNEL_LOCAL_MEM_SIZE_REGS ); +} + +/** +* pvr_dev_query_gpu_info_get() +* @pvr_dev: Device pointer. +* @args: [IN] Device query arguments containing a pointer to a userspace +* struct drm_pvr_dev_query_gpu_info. +* +* If the query object pointer is NULL, the size field is updated with the +* expected size of the query object. +* +* Returns: +* * 0 on success, or if size is requested using a NULL pointer, or +* * -%E2BIG if the indicated length of the allocation is less than is +* required to contain the copied data, or +* * -%EFAULT if local memory could not be copied to userspace. +*/ +static int +pvr_dev_query_gpu_info_get (struct pvr_device *pvr_dev, +struct drm_pvr_ioctl_dev_query_args *args) +{ +struct drm_pvr_dev_query_gpu_info gpu_info = {0 }; +int err; + +if (!args->pointer) { + args->size =sizeof (struct drm_pvr_dev_query_gpu_info ); +return 0 ; + } + + gpu_info.gpu_id = +pvr_gpu_id_to_packed_bvnc (&pvr_dev->gpu_id); + gpu_info.num_phantoms =rogue_get_num_phantoms (pvr_dev); + + err =PVR_UOBJ_SET (args->pointer, args->size, gpu_info); +if (err <0 ) +return err; + +if (args->size >sizeof (gpu_info)) + args->size =sizeof (gpu_info); +return 0 ; +} + +/** +* pvr_dev_query_runtime_info_get() +* @pvr_dev: Device pointer. +* @args: [IN] Device query arguments containing a pointer to a userspace +* struct drm_pvr_dev_query_runtime_info. +* +* If the query object pointer is NULL, the size field is updated with the +* expected size of the query object. +* +* Returns: +* * 0 on success, or if size is requested using a NULL pointer, or +* * -%E2BIG if the indicated length of the allocation is less than is +* required to contain the copied data, or +* * -%EFAULT if local memory could not be copied to userspace. +*/ +static int +pvr_dev_query_runtime_info_get (struct pvr_device *pvr_dev, +struct drm_pvr_ioctl_dev_query_args *args) +{ +struct drm_pvr_dev_query_runtime_info runtime_info = {0 }; +int err; + +if (!args->pointer) { + args->size =sizeof (struct drm_pvr_dev_query_runtime_info ); +return 0 ; + } + + runtime_info.free_list_min_pages =0 ;/* FIXME */ + runtime_info.free_list_max_pages = +ROGUE_PM_MAX_FREELIST_SIZE /ROGUE_PM_PAGE_SIZE ; + runtime_info.common_store_alloc_region_size = +rogue_get_common_store_alloc_region_size (pvr_dev); + runtime_info.common_store_partition_space_size = +rogue_get_common_store_partition_space_size (pvr_dev); + runtime_info.max_coeffs =rogue_get_max_coeffs (pvr_dev); + runtime_info.cdm_max_local_mem_size_regs = +rogue_get_cdm_max_local_mem_size_regs (pvr_dev); + + err =PVR_UOBJ_SET (args->pointer, args->size, runtime_info); +if (err <0 ) +return err; + +if (args->size >sizeof (runtime_info)) + args->size =sizeof (runtime_info); +return 0 ; +} + +/** +* pvr_dev_query_hwrt_info_get() +* @pvr_dev: Device pointer. +* @args: [IN] Device query arguments containing a pointer to a userspace +* struct drm_pvr_dev_query_hwrt_info. +* +* If the query object pointer is NULL, the size field is updated with the +* expected size of the query object. +* +* Returns: +* * 0 on success, or if size is requested using a NULL pointer, or +* * -%E2BIG if the indicated length of the allocation is less than is +* required to contain the copied data, or +* * -%EFAULT if local memory could not be copied to userspace. +*/ +static int +pvr_dev_query_hwrt_info_get (struct pvr_device *pvr_dev, +struct drm_pvr_ioctl_dev_query_args *args) +{ +struct drm_pvr_dev_query_hwrt_info hwrt_info = {0 }; +int err; + +if (!args->pointer) { + args->size =sizeof (struct drm_pvr_dev_query_hwrt_info ); +return 0 ; + } + + hwrt_info.num_geomdatas =ROGUE_FWIF_NUM_GEOMDATAS ; + hwrt_info.num_rtdatas =ROGUE_FWIF_NUM_RTDATAS ; + hwrt_info.num_freelists =ROGUE_FWIF_NUM_RTDATA_FREELISTS ; + + err =PVR_UOBJ_SET (args->pointer, args->size, hwrt_info); +if (err <0 ) +return err; + +if (args->size >sizeof (hwrt_info)) + args->size =sizeof (hwrt_info); +return 0 ; +} + +/** +* pvr_dev_query_quirks_get() - Unpack array of quirks at the address given +* in a struct drm_pvr_dev_query_quirks, or gets the amount of space required +* for it. +* @pvr_dev: Device pointer. +* @args: [IN] Device query arguments containing a pointer to a userspace +* struct drm_pvr_dev_query_query_quirks. +* +* If the query object pointer is NULL, the size field is updated with the +* expected size of the query object. +* If the userspace pointer in the query object is NULL, or the count is +* short, no data is copied. +* The count field will be updated to that copied, or if either pointer is +* NULL, that which would have been copied. +* The size field in the query object will be updated to the size copied. +* +* Returns: +* * 0 on success, or if size/count is requested using a NULL pointer, or +* * -%EINVAL if args contained non-zero reserved fields, or +* * -%E2BIG if the indicated length of the allocation is less than is +* required to contain the copied data, or +* * -%EFAULT if local memory could not be copied to userspace. +*/ +static int +pvr_dev_query_quirks_get (struct pvr_device *pvr_dev, +struct drm_pvr_ioctl_dev_query_args *args) +{ +/* +* @FIXME - hardcoding of numbers here is intended as an +* intermediate step so the UAPI can be fixed, but requires a +* a refactor in the future to store them in a more appropriate +* location +*/ +static const u32 umd_quirks_musthave[] = { +47217 , +49927 , +62269 , + }; +static const u32 umd_quirks[] = { +48545 , +51764 , + }; +struct drm_pvr_dev_query_quirks query; +u32 out[ARRAY_SIZE (umd_quirks_musthave) +ARRAY_SIZE (umd_quirks)]; +size_t out_musthave_count =0 ; +size_t out_count =0 ; +int err; + +if (!args->pointer) { + args->size =sizeof (struct drm_pvr_dev_query_quirks ); +return 0 ; + } + + err =PVR_UOBJ_GET (query, args->size, args->pointer); + +if (err <0 ) +return err; +if (query._padding_c) +return -EINVAL ; + +for (int i =0 ; i <ARRAY_SIZE (umd_quirks_musthave); i++) { +if (pvr_device_has_uapi_quirk (pvr_dev, umd_quirks_musthave[i])) { + out[out_count++] = umd_quirks_musthave[i]; + out_musthave_count++; + } + } + +for (int i =0 ; i <ARRAY_SIZE (umd_quirks); i++) { +if (pvr_device_has_uapi_quirk (pvr_dev, umd_quirks[i])) + out[out_count++] = umd_quirks[i]; + } + +if (!query.quirks) + goto copy_out; +if (query.count < out_count) +return -E2BIG ; + +if (copy_to_user (u64_to_user_ptr (query.quirks), out, + out_count *sizeof (u32))) { +return -EFAULT ; + } + + query.musthave_count = out_musthave_count; + +copy_out: + query.count = out_count; + err =PVR_UOBJ_SET (args->pointer, args->size, query); +if (err <0 ) +return err; + + args->size =sizeof (query); +return 0 ; +} + +/** +* pvr_dev_query_enhancements_get() - Unpack array of enhancements at the +* address given in a struct drm_pvr_dev_query_enhancements, or gets the amount +* of space required for it. +* @pvr_dev: Device pointer. +* @args: [IN] Device query arguments containing a pointer to a userspace +* struct drm_pvr_dev_query_enhancements. +* +* If the query object pointer is NULL, the size field is updated with the +* expected size of the query object. +* If the userspace pointer in the query object is NULL, or the count is +* short, no data is copied. +* The count field will be updated to that copied, or if either pointer is +* NULL, that which would have been copied. +* The size field in the query object will be updated to the size copied. +* +* Returns: +* * 0 on success, or if size/count is requested using a NULL pointer, or +* * -%EINVAL if args contained non-zero reserved fields, or +* * -%E2BIG if the indicated length of the allocation is less than is +* required to contain the copied data, or +* * -%EFAULT if local memory could not be copied to userspace. +*/ +static int +pvr_dev_query_enhancements_get (struct pvr_device *pvr_dev, +struct drm_pvr_ioctl_dev_query_args *args) +{ +/* +* @FIXME - hardcoding of numbers here is intended as an +* intermediate step so the UAPI can be fixed, but requires a +* a refactor in the future to store them in a more appropriate +* location +*/ +const u32 umd_enhancements[] = { +35421 , +42064 , + }; +struct drm_pvr_dev_query_enhancements query; +u32 out[ARRAY_SIZE (umd_enhancements)]; +size_t out_idx =0 ; +int err; + +if (!args->pointer) { + args->size =sizeof (struct drm_pvr_dev_query_enhancements ); +return 0 ; + } + + err =PVR_UOBJ_GET (query, args->size, args->pointer); + +if (err <0 ) +return err; +if (query._padding_a) +return -EINVAL ; +if (query._padding_c) +return -EINVAL ; + +for (int i =0 ; i <ARRAY_SIZE (umd_enhancements); i++) { +if (pvr_device_has_uapi_enhancement (pvr_dev, umd_enhancements[i])) + out[out_idx++] = umd_enhancements[i]; + } + +if (!query.enhancements) + goto copy_out; +if (query.count < out_idx) +return -E2BIG ; + +if (copy_to_user (u64_to_user_ptr (query.enhancements), out, + out_idx *sizeof (u32))) { +return -EFAULT ; + } + +copy_out: + query.count = out_idx; + err =PVR_UOBJ_SET (args->pointer, args->size, query); +if (err <0 ) +return err; + + args->size =sizeof (query); +return 0 ; +} +/** * pvr_ioctl_dev_query() - IOCTL to copy information about a device * @drm_dev: [IN] DRM device. @@ -112,7 +531,33 @@ static int pvr_ioctl_dev_query(struct drm_device *drm_dev, void *raw_args, struct drm_file *file) { - return -ENOTTY; + struct pvr_device *pvr_dev = to_pvr_device(drm_dev); +struct drm_pvr_ioctl_dev_query_args *args = raw_args; + +switch ((enum drm_pvr_dev_query )args->type) { +case DRM_PVR_DEV_QUERY_GPU_INFO_GET : +return pvr_dev_query_gpu_info_get (pvr_dev, args); + +case DRM_PVR_DEV_QUERY_RUNTIME_INFO_GET : +return pvr_dev_query_runtime_info_get (pvr_dev, args); + +case DRM_PVR_DEV_QUERY_HWRT_INFO_GET : +return pvr_dev_query_hwrt_info_get (pvr_dev, args); + +case DRM_PVR_DEV_QUERY_QUIRKS_GET : +return pvr_dev_query_quirks_get (pvr_dev, args); + +case DRM_PVR_DEV_QUERY_ENHANCEMENTS_GET : +return pvr_dev_query_enhancements_get (pvr_dev, args); + +case DRM_PVR_DEV_QUERY_HEAP_INFO_GET : +return -EINVAL ; + +case DRM_PVR_DEV_QUERY_STATIC_DATA_AREAS_GET : +return -EINVAL ; + } + +return -EINVAL ; }/** @@ -350,6 +795,112 @@ pvr_ioctl_submit_jobs(struct drm_device *drm_dev, void *raw_args,return -ENOTTY ; } +int +pvr_get_uobj (u64 usr_ptr,u32 usr_stride,u32 min_stride,u32 obj_size,void *out) +{ +if (usr_stride < min_stride) +return -EINVAL ; + +return copy_struct_from_user (out, obj_size,u64_to_user_ptr (usr_ptr), usr_stride); +} + +int +pvr_set_uobj (u64 usr_ptr,u32 usr_stride,u32 min_stride,u32 obj_size,const void *in) +{ +if (usr_stride < min_stride) +return -EINVAL ; + +if (copy_to_user (u64_to_user_ptr (usr_ptr), in,min_t (u32, usr_stride, obj_size))) +return -EFAULT ; + +if (usr_stride > obj_size && +clear_user (u64_to_user_ptr (usr_ptr + obj_size), usr_stride - obj_size)) { +return -EFAULT ; + } + +return 0 ; +} + +int +pvr_get_uobj_array (const struct drm_pvr_obj_array *in,u32 min_stride,u32 obj_size,void **out) +{ +int ret =0 ; +void *out_alloc; + +if (in->stride < min_stride) +return -EINVAL ; + +if (!in->count) +return 0 ; + + out_alloc =kvmalloc_array (in->count, obj_size,GFP_KERNEL ); +if (!out_alloc) +return -ENOMEM ; + +if (obj_size == in->stride) { +if (copy_from_user (out_alloc,u64_to_user_ptr (in->array), + (unsigned long )obj_size * in->count)) + ret = -EFAULT ; + }else { +void __user *in_ptr =u64_to_user_ptr (in->array); +void *out_ptr = out_alloc; + +for (u32 i =0 ; i < in->count; i++) { + ret =copy_struct_from_user (out_ptr, obj_size, in_ptr, in->stride); +if (ret) +break ; + + out_ptr += obj_size; + in_ptr += in->stride; + } + } + +if (ret) { +kvfree (out_alloc); +return ret; + } + + *out = out_alloc; +return 0 ; +} + +int +pvr_set_uobj_array (const struct drm_pvr_obj_array *out,u32 min_stride,u32 obj_size, +const void *in) +{ +if (out->stride < min_stride) +return -EINVAL ; + +if (!out->count) +return 0 ; + +if (obj_size == out->stride) { +if (copy_to_user (u64_to_user_ptr (out->array), in, + (unsigned long )obj_size * out->count)) +return -EFAULT ; + }else { +u32 cpy_elem_size =min_t (u32, out->stride, obj_size); +void __user *out_ptr =u64_to_user_ptr (out->array); +const void *in_ptr = in; + +for (u32 i =0 ; i < out->count; i++) { +if (copy_to_user (out_ptr, in_ptr, cpy_elem_size)) +return -EFAULT ; + + out_ptr += obj_size; + in_ptr += out->stride; + } + +if (out->stride > obj_size && +clear_user (u64_to_user_ptr (out->array + obj_size), + out->stride - obj_size)) { +return -EFAULT ; + } + } + +return 0 ; +} +#define DRM_PVR_IOCTL (_name, _func, _flags) \ DRM_IOCTL_DEF_DRV(PVR_##_name, pvr_ioctl_##_func, _flags)drivers/gpu/drm/imagination/pvr_drv.h +108
-0@@ -19,4 +19,112 @@#define PVR_DRIVER_MINOR 0#define PVR_DRIVER_PATCHLEVEL 0 +int pvr_get_uobj (u64 usr_ptr,u32 usr_size,u32 min_size,u32 obj_size,void *out); +int pvr_set_uobj (u64 usr_ptr,u32 usr_size,u32 min_size,u32 obj_size,const void *in); +int pvr_get_uobj_array (const struct drm_pvr_obj_array *in,u32 min_stride,u32 obj_size, +void **out); +int pvr_set_uobj_array (const struct drm_pvr_obj_array *out,u32 min_stride,u32 obj_size, +const void *in); + +#define PVR_UOBJ_MIN_SIZE_INTERNAL (_typename, _last_mandatory_field) \ + (offsetof(_typename, _last_mandatory_field) + \ + sizeof(((_typename *)NULL)->_last_mandatory_field)) + +/* NOLINTBEGIN(bugprone-macro-parentheses) */ +#define PVR_UOBJ_DECL (_typename, _last_mandatory_field) \ + , _typename : PVR_UOBJ_MIN_SIZE_INTERNAL(_typename, _last_mandatory_field) +/* NOLINTEND(bugprone-macro-parentheses) */ + +/** +* DOC: PVR user objects. +* +* Macros used to aid copying structured and array data to and from +* userspace. Objects can differ in size, provided the minimum size +* allowed is specified (using the last mandatory field in the struct). +* All types used with PVR_UOBJ_GET/SET macros must be listed here under +* PVR_UOBJ_MIN_SIZE, with the last mandatory struct field specified. +*/ + +/** +* PVR_UOBJ_MIN_SIZE() - Fetch the minimum copy size of a compatible type object. +* @_obj_name: The name of the object. Cannot be a typename - this is deduced. +* +* This cannot fail. Using the macro with an incompatible type will result in a +* compiler error. +* +* To add compatibility for a type, list it within the macro in an orderly +* fashion. The second argument is the name of the last mandatory field of the +* struct type, which is used to calculate the size. See also PVR_UOBJ_DECL(). +* +* Return: The minimum copy size. +*/ +#define PVR_UOBJ_MIN_SIZE (_obj_name) _Generic(_obj_name \ + PVR_UOBJ_DECL(struct drm_pvr_job, hwrt) \ + PVR_UOBJ_DECL(struct drm_pvr_sync_op, value) \ + PVR_UOBJ_DECL(struct drm_pvr_dev_query_gpu_info, num_phantoms) \ + PVR_UOBJ_DECL(struct drm_pvr_dev_query_runtime_info, cdm_max_local_mem_size_regs) \ + PVR_UOBJ_DECL(struct drm_pvr_dev_query_hwrt_info, _padding_4) \ + PVR_UOBJ_DECL(struct drm_pvr_dev_query_quirks, _padding_c) \ + PVR_UOBJ_DECL(struct drm_pvr_dev_query_enhancements, _padding_c) \ + PVR_UOBJ_DECL(struct drm_pvr_heap, page_size_log2) \ + PVR_UOBJ_DECL(struct drm_pvr_dev_query_heap_info, heaps) \ + PVR_UOBJ_DECL(struct drm_pvr_static_data_area, offset) \ + PVR_UOBJ_DECL(struct drm_pvr_dev_query_static_data_areas, static_data_areas) \ + ) + +/** +* PVR_UOBJ_GET() - Copies from _src_usr_ptr to &_dest_obj. +* @_dest_obj: The destination container object in kernel space. +* @_usr_size: The size of the source container in user space. +* @_src_usr_ptr: __u64 raw pointer to the source container in user space. +* +* Return: Error code. See pvr_get_uobj(). +*/ +#define PVR_UOBJ_GET (_dest_obj, _usr_size, _src_usr_ptr) \ + pvr_get_uobj(_src_usr_ptr, _usr_size, \ + PVR_UOBJ_MIN_SIZE(_dest_obj), \ + sizeof(_dest_obj), &(_dest_obj)) + +/** +* PVR_UOBJ_SET() - Copies from &_src_obj to _dest_usr_ptr. +* @_dest_usr_ptr: __u64 raw pointer to the destination container in user space. +* @_usr_size: The size of the destination container in user space. +* @_src_obj: The source container object in kernel space. +* +* Return: Error code. See pvr_set_uobj(). +*/ +#define PVR_UOBJ_SET (_dest_usr_ptr, _usr_size, _src_obj) \ + pvr_set_uobj(_dest_usr_ptr, _usr_size, \ + PVR_UOBJ_MIN_SIZE(_src_obj), \ + sizeof(_src_obj), &(_src_obj)) + +/** +* PVR_UOBJ_GET_ARRAY() - Copies from @_src_drm_pvr_obj_array.array to +* alloced memory and returns a pointer in _dest_array. +* @_dest_array: The destination C array object in kernel space. +* @_src_drm_pvr_obj_array: The &struct drm_pvr_obj_array containing a __u64 raw +* pointer to the source C array in user space and the size of each array +* element in user space (the 'stride'). +* +* Return: Error code. See pvr_get_uobj_array(). +*/ +#define PVR_UOBJ_GET_ARRAY (_dest_array, _src_drm_pvr_obj_array) \ + pvr_get_uobj_array(_src_drm_pvr_obj_array, \ + PVR_UOBJ_MIN_SIZE((_dest_array)[0]), \ + sizeof((_dest_array)[0]), (void **)&(_dest_array)) + +/** +* PVR_UOBJ_SET_ARRAY() - Copies from _src_array to @_dest_drm_pvr_obj_array.array. +* @_dest_drm_pvr_obj_array: The &struct drm_pvr_obj_array containing a __u64 raw +* pointer to the destination C array in user space and the size of each array +* element in user space (the 'stride'). +* @_src_array: The source C array object in kernel space. +* +* Return: Error code. See pvr_set_uobj_array(). +*/ +#define PVR_UOBJ_SET_ARRAY (_dest_drm_pvr_obj_array, _src_array) \ + pvr_set_uobj_array(_dest_drm_pvr_obj_array, \ + PVR_UOBJ_MIN_SIZE((_src_array)[0]), \ + sizeof((_src_array)[0]), _src_array) +#endif /* PVR_DRV_H */ drivers/gpu/drm/imagination/pvr_fw.h new file +20
-1@@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: GPL-2.0 OR MIT */ +/* Copyright (c) 2022 Imagination Technologies Ltd. */ + +#ifndef PVR_FW_H +#define PVR_FW_H + +#include <linux/firmware.h> + +struct pvr_fw_device { +/** @firmware: Handle to the firmware loaded into the device. */ +const struct firmware *firmware; + +/* +* @processor_type: FW processor type for this device. Must be one of +* %PVR_FW_PROCESSOR_TYPE_*. +*/ +u16 processor_type; +}; + +#endif /* PVR_FW_H */ --2.40.1
Re: [PATCH v3 07/17] drm/imagination: Add GPU ID parsing and firmware loading
Hi Adam,
Quoted 10 lines · Adam Ford
Quoted 3 lines · Sarah Walker
Read the GPU ID register at probe time and select the correct features/quirks/enhancements. Use the GPU ID to form the firmware file name and load the firmware.
I have a Rogue 6250 variant, but the BVNC is returning a slightly different revision than the firmware that's currently available, and the older firmware for the vendor driver doesn't work with this new code.
Quoted 5 lines
Linux responds with Unsupported BVNC: 4.45.2.58. From what I can tell, the closest available firmware is 4.40.2.51.
Will there be more firmware variants in the future or will there be some options to build the firmware somehow?
We don't plan to support the SoC vendor provided firmware binaries as this will mean having to deal with many different versions of the firmware and its interface. Specifically, the interface can change in backwards incompatible ways between releases, it changes based on the hardware feature set & bugs and it's split across userspace & the kernel. This makes these SoC provided firmware binaries very difficult to support in this new driver.
As an alternative, we'll be releasing firmware binaries as we add support for more Rogue GPUs. We'll also release binaries upon request, in case others in the community want to work on support in the meantime - we're just getting things set up for this at the moment.
Thanks
Frank
Quoted 1,828 lines
adam
Quoted 1,822 lines
The features/quirks/enhancements arrays are currently hardcoded in the driver for the supported GPUs. We are looking at moving this information to the firmware image.
Signed-off-by Sarah Walker <[email protected]>--- drivers/gpu/drm/imagination/Makefile | 1 + drivers/gpu/drm/imagination/pvr_device.c | 359 ++++++++++++ drivers/gpu/drm/imagination/pvr_device.h | 221 +++++++ drivers/gpu/drm/imagination/pvr_device_info.c | 223 +++++++ drivers/gpu/drm/imagination/pvr_device_info.h | 133 +++++ drivers/gpu/drm/imagination/pvr_drv.c | 553 +++++++++++++++++- drivers/gpu/drm/imagination/pvr_drv.h | 108 ++++ drivers/gpu/drm/imagination/pvr_fw.h | 20 + 8 files changed, 1617 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/drm/imagination/pvr_device_info.c create mode 100644 drivers/gpu/drm/imagination/pvr_device_info.h create mode 100644 drivers/gpu/drm/imagination/pvr_fw.hdrivers/gpu/drm/imagination/Makefile +1
-0@@ -5,6 +5,7 @@ subdir-ccflags-y := -I$(srctree)/$(src) powervr-y := \ pvr_device.o \ + pvr_device_info.o \ pvr_drv.o \ obj-$(CONFIG_DRM_POWERVR) += powervr.odrivers/gpu/drm/imagination/pvr_device.c +359
-0@@ -2,20 +2,32 @@/* Copyright (c) 2022 Imagination Technologies Ltd. */ #include "pvr_device.h" +#include "pvr_device_info.h" + +#include "pvr_fw.h" +#include "pvr_rogue_cr_defs.h" #include <drm/drm_print.h> +#include <linux/bitfield.h> #include <linux/clk.h> #include <linux/compiler_attributes.h> #include <linux/compiler_types.h> #include <linux/dma-mapping.h> #include <linux/err.h> +#include <linux/firmware.h> #include <linux/gfp.h> +#include <linux/interrupt.h> #include <linux/platform_device.h> +#include <linux/pm_runtime.h> #include <linux/regulator/consumer.h> #include <linux/slab.h> #include <linux/stddef.h> #include <linux/types.h> +#include <linux/workqueue.h> + +/* Major number for the supported version of the firmware. */ +#define PVR_FW_VERSION_MAJOR 1/** * pvr_device_reg_init() - Initialize kernel access to a PowerVR device's @@ -205,6 +217,246 @@ pvr_device_regulator_init(struct pvr_device *pvr_dev)return err; } +/** +* pvr_device_clk_core_get_freq - Get current PowerVR device core clock frequency +* @pvr_dev: Target PowerVR device. +* @freq_out: Pointer to location to store core clock frequency in Hz. +* +* Returns: +* * 0 on success, or +* * -%EINVAL if frequency can not be determined. +*/ +int +pvr_device_clk_core_get_freq (struct pvr_device *pvr_dev,u32 *freq_out) +{ +u32 freq =clk_get_rate (pvr_dev->core_clk); + +if (!freq) +return -EINVAL ; + + *freq_out = freq; +return 0 ; +} + +/** +* pvr_build_firmware_filename() - Construct a PowerVR firmware filename +* @pvr_dev: Target PowerVR device. +* @base: First part of the filename. +* @major: Major version number. +* +* A PowerVR firmware filename consists of three parts separated by underscores +* (``'_'``) along with a '.fw' file suffix. The first part is the exact value +* of @base, the second part is the hardware version string derived from @pvr_fw +* and the final part is the firmware version number constructed from @major with +* a 'v' prefix, e.g. powervr/rogue_4.40.2.51_v1.fw. +* +* The returned string will have been slab allocated and must be freed with +* kfree(). +* +* Return: +* * The constructed filename on success, or +* * Any error returned by kasprintf(). +*/ +static char * +pvr_build_firmware_filename (struct pvr_device *pvr_dev,const char *base, +u8 major) +{ +struct pvr_gpu_id *gpu_id = &pvr_dev->gpu_id; + +return kasprintf (GFP_KERNEL ,"%s_%d.%d.%d.%d_v%d.fw" , base, gpu_id->b, + gpu_id->v, gpu_id->n, gpu_id->c, major); +} + +/** +* pvr_request_firmware() - Load firmware for a PowerVR device +* @pvr_dev: Target PowerVR device. +* +* See pvr_build_firmware_filename() for details on firmware file naming. +* +* Return: +* * 0 on success, +* * Any error returned by pvr_build_firmware_filename(), or +* * Any error returned by request_firmware(). +*/ +static int +pvr_request_firmware (struct pvr_device *pvr_dev) +{ +struct drm_device *drm_dev = &pvr_dev->base; +char *filename; +const struct firmware *fw; +int err; + + filename =pvr_build_firmware_filename (pvr_dev,"powervr/rogue" , +PVR_FW_VERSION_MAJOR ); +if (IS_ERR (filename)) +return PTR_ERR (filename); + +/* +* This function takes a copy of &filename, meaning we can free our +* instance before returning. +*/ + err =request_firmware (&fw, filename, pvr_dev->base.dev); +if (err) { +drm_err (drm_dev,"failed to load firmware %s (err=%d)\n" , + filename, err); + goto err_free_filename; + } + +drm_info (drm_dev,"loaded firmware %s\n" , filename); +kfree (filename); + + pvr_dev->fw_dev.firmware = fw; + +return 0 ; + +err_free_filename: +kfree (filename); + +return err; +} + +/** +* pvr_load_gpu_id() - Load a PowerVR device's GPU ID (BVNC) from control registers. +* +* Sets struct pvr_dev.gpu_id. +* +* @pvr_dev: Target PowerVR device. +*/ +static void +pvr_load_gpu_id (struct pvr_device *pvr_dev) +{ +struct pvr_gpu_id *gpu_id = &pvr_dev->gpu_id; +u64 bvnc; + +/* +* Try reading the BVNC using the newer (cleaner) method first. If the +* B value is zero, fall back to the older method. +*/ + bvnc =PVR_CR_READ64 (pvr_dev,CORE_ID__PBVNC ); + + gpu_id->b =PVR_CR_FIELD_GET (bvnc,CORE_ID__PBVNC__BRANCH_ID ); +if (gpu_id->b !=0 ) { + gpu_id->v =PVR_CR_FIELD_GET (bvnc,CORE_ID__PBVNC__VERSION_ID ); + gpu_id->n =PVR_CR_FIELD_GET (bvnc,CORE_ID__PBVNC__NUMBER_OF_SCALABLE_UNITS ); + gpu_id->c =PVR_CR_FIELD_GET (bvnc,CORE_ID__PBVNC__CONFIG_ID ); + }else { +u32 core_rev =PVR_CR_READ32 (pvr_dev,CORE_REVISION ); +u32 core_id =PVR_CR_READ32 (pvr_dev,CORE_ID ); +u16 core_id_config =PVR_CR_FIELD_GET (core_id,CORE_ID_CONFIG ); + + gpu_id->b =PVR_CR_FIELD_GET (core_rev,CORE_REVISION_MAJOR ); + gpu_id->v =PVR_CR_FIELD_GET (core_rev,CORE_REVISION_MINOR ); + gpu_id->n =FIELD_GET (0xFF00 , core_id_config); + gpu_id->c =FIELD_GET (0x00FF , core_id_config); + } +} + +/** +* pvr_set_dma_info() - Set PowerVR device DMA information +* @pvr_dev: Target PowerVR device. +* +* Sets the DMA mask and max segment size for the PowerVR device. +* +* Return: +* * 0 on success, +* * Any error returned by PVR_FEATURE_VALUE(), or +* * Any error returned by dma_set_mask(). +*/ + +static int +pvr_set_dma_info (struct pvr_device *pvr_dev) +{ +struct drm_device *drm_dev =from_pvr_device (pvr_dev); +u16 phys_bus_width; +int err; + + err =PVR_FEATURE_VALUE (pvr_dev, phys_bus_width, &phys_bus_width); +if (err) { +drm_err (drm_dev,"Failed to get device physical bus width\n" ); +return err; + } + +/* +* See the comment on &pvr_drm_driver.prime_fd_to_handle for an +* explanation of the dma_set_mask function and dma_set_max_seg_size +* calls below. +*/ + err =dma_set_mask (drm_dev->dev,DMA_BIT_MASK (phys_bus_width)); +if (err) { +drm_err (drm_dev,"Failed to set DMA mask (err=%d)\n" , err); +return err; + } + +dma_set_max_seg_size (drm_dev->dev,UINT_MAX ); + +return 0 ; +} + +/** +* pvr_device_gpu_init() - GPU-specific initialization for a PowerVR device +* @pvr_dev: Target PowerVR device. +* +* The following steps are taken to ensure the device is ready: +* +* 1. Read the hardware version information from control registers, +* 2. Initialise the hardware feature information, +* 3. Setup the device DMA information, +* 4. Setup the device-scoped memory context, and +* 5. Load firmware into the device. +* +* Return: +* * 0 on success, +* * -%ENODEV if the GPU is not supported, +* * Any error returned by pvr_set_dma_info(), +* * Any error returned by pvr_memory_context_init(), or +* * Any error returned by pvr_request_firmware(). +*/ +static int +pvr_device_gpu_init (struct pvr_device *pvr_dev) +{ +int err; + +pvr_load_gpu_id (pvr_dev); + + err =pvr_device_info_init (pvr_dev); +if (err) + goto err_out; + +if (PVR_HAS_FEATURE (pvr_dev, meta)) { + pvr_dev->fw_dev.processor_type =PVR_FW_PROCESSOR_TYPE_META ; + }else if (PVR_HAS_FEATURE (pvr_dev, mips)) { + pvr_dev->fw_dev.processor_type =PVR_FW_PROCESSOR_TYPE_MIPS ; + }else if (PVR_HAS_FEATURE (pvr_dev, riscv_fw_processor)) { + pvr_dev->fw_dev.processor_type =PVR_FW_PROCESSOR_TYPE_RISCV ; + }else { + err = -EINVAL ; + goto err_out; + } + + err =pvr_set_dma_info (pvr_dev); +if (err) + goto err_out; + + err =pvr_request_firmware (pvr_dev); +if (err) + goto err_out; + +return 0 ; + +err_out: +return err; +} + +/** +* pvr_device_gpu_fini() - GPU-specific deinitialization for a PowerVR device +* @pvr_dev: Target PowerVR device. +*/ +static void +pvr_device_gpu_fini (struct pvr_device *pvr_dev) +{ +release_firmware (pvr_dev->fw_dev.firmware); +} +/** * pvr_device_init() - Initialize a PowerVR device * @pvr_dev: Target PowerVR device. @@ -240,6 +492,11 @@ pvr_device_init(struct pvr_device *pvr_dev)/* Map the control registers into memory. */ err =pvr_device_reg_init (pvr_dev); +if (err) + goto err_device_clk_fini; + +/* Perform GPU-specific initialization steps. */ + err =pvr_device_gpu_init (pvr_dev);if (err) goto err_device_reg_fini;@@ -266,6 +523,108 @@ pvr_device_fini(struct pvr_device *pvr_dev)* Deinitialization stages are performed in reverse order compared to * the initialization stages in pvr_device_init(). */ +pvr_device_gpu_fini (pvr_dev);pvr_device_reg_fini (pvr_dev);pvr_device_clk_fini (pvr_dev); } + +bool +pvr_device_has_uapi_quirk (struct pvr_device *pvr_dev,u32 quirk) +{ +switch (quirk) { +case 47217 : +return PVR_HAS_QUIRK (pvr_dev,47217 ); +case 48545 : +return PVR_HAS_QUIRK (pvr_dev,48545 ); +case 49927 : +return PVR_HAS_QUIRK (pvr_dev,49927 ); +case 51764 : +return PVR_HAS_QUIRK (pvr_dev,51764 ); +case 62269 : +return PVR_HAS_QUIRK (pvr_dev,62269 ); +default : +return false; + }; +} + +bool +pvr_device_has_uapi_enhancement (struct pvr_device *pvr_dev,u32 enhancement) +{ +switch (enhancement) { +case 35421 : +return PVR_HAS_ENHANCEMENT (pvr_dev,35421 ); +case 42064 : +return PVR_HAS_ENHANCEMENT (pvr_dev,42064 ); +default : +return false; + }; +} + +/** +* pvr_device_has_feature() - Look up device feature based on feature definition +* @pvr_dev: Device pointer. +* @feature: Feature to look up. Should be one of %PVR_FEATURE_*. +* +* Returns: +* * %true if feature is present on device, or +* * %false if feature is not present on device. +*/ +bool +pvr_device_has_feature (struct pvr_device *pvr_dev,u32 feature) +{ +switch (feature) { +case PVR_FEATURE_CLUSTER_GROUPING : +return PVR_HAS_FEATURE (pvr_dev, cluster_grouping); + +case PVR_FEATURE_COMPUTE_MORTON_CAPABLE : +return PVR_HAS_FEATURE (pvr_dev, compute_morton_capable); + +case PVR_FEATURE_FB_CDC_V4 : +return PVR_HAS_FEATURE (pvr_dev, fb_cdc_v4); + +case PVR_FEATURE_GPU_MULTICORE_SUPPORT : +return PVR_HAS_FEATURE (pvr_dev, gpu_multicore_support); + +case PVR_FEATURE_ISP_ZLS_D24_S8_PACKING_OGL_MODE : +return PVR_HAS_FEATURE (pvr_dev, isp_zls_d24_s8_packing_ogl_mode); + +case PVR_FEATURE_S7_TOP_INFRASTRUCTURE : +return PVR_HAS_FEATURE (pvr_dev, s7_top_infrastructure); + +case PVR_FEATURE_TESSELLATION : +return PVR_HAS_FEATURE (pvr_dev, tessellation); + +case PVR_FEATURE_TPU_DM_GLOBAL_REGISTERS : +return PVR_HAS_FEATURE (pvr_dev, tpu_dm_global_registers); + +case PVR_FEATURE_VDM_DRAWINDIRECT : +return PVR_HAS_FEATURE (pvr_dev, vdm_drawindirect); + +case PVR_FEATURE_VDM_OBJECT_LEVEL_LLS : +return PVR_HAS_FEATURE (pvr_dev, vdm_object_level_lls); + +case PVR_FEATURE_ZLS_SUBTILE : +return PVR_HAS_FEATURE (pvr_dev, zls_subtile); + +/* Derived features. */ +case PVR_FEATURE_CDM_USER_MODE_QUEUE : { +u8 cdm_control_stream_format =0 ; + +PVR_FEATURE_VALUE (pvr_dev, cdm_control_stream_format, &cdm_control_stream_format); +return (cdm_control_stream_format >=2 && cdm_control_stream_format <=4 ); + } + +case PVR_FEATURE_REQUIRES_FB_CDC_ZLS_SETUP : +if (PVR_HAS_FEATURE (pvr_dev, fbcdc_algorithm)) { +u8 fbcdc_algorithm =0 ; + +PVR_FEATURE_VALUE (pvr_dev, fbcdc_algorithm, &fbcdc_algorithm); +return (fbcdc_algorithm <3 ||PVR_HAS_FEATURE (pvr_dev, fb_cdc_v4)); + } +return false; + +default : +WARN (true,"Looking up undefined feature %u\n" , feature); +return false; + } +}drivers/gpu/drm/imagination/pvr_device.h +221
-0@@ -4,6 +4,9 @@#ifndef PVR_DEVICE_H #define PVR_DEVICE_H +#include "pvr_device_info.h" +#include "pvr_fw.h" +#include <drm/drm_device.h> #include <drm/drm_file.h> #include <drm/drm_mm.h> @@ -31,6 +34,26 @@ struct firmware;/* Forward declaration from <linux/regulator/consumer.h>. */ struct regulator ; +/** +* struct pvr_gpu_id - Hardware GPU ID information for a PowerVR device +* @b: Branch ID. +* @v: Version ID. +* @n: Number of scalable units. +* @c: Config ID. +*/ +struct pvr_gpu_id { +u16 b, v, n, c; +}; + +/** +* struct pvr_fw_version - Firmware version information +* @major: Major version number. +* @minor: Minor version number. +*/ +struct pvr_fw_version { +u16 major, minor; +}; +/** * struct pvr_device - powervr-specific wrapper for &struct drm_device */ @@ -43,6 +66,35 @@ struct pvr_device {*/ struct drm_device base; +/** @gpu_id: GPU ID detected at runtime. */ +struct pvr_gpu_id gpu_id; + +/** +* @features: Hardware feature information. +* +* Do not access this member directly, instead use PVR_HAS_FEATURE() +* or PVR_FEATURE_VALUE() macros. +*/ +struct pvr_device_features features; + +/** +* @quirks: Hardware quirk information. +* +* Do not access this member directly, instead use PVR_HAS_QUIRK(). +*/ +struct pvr_device_quirks quirks; + +/** +* @enhancements: Hardware enhancement information. +* +* Do not access this member directly, instead use +* PVR_HAS_ENHANCEMENT(). +*/ +struct pvr_device_enhancements enhancements; + +/** @fw_version: Firmware version detected at runtime. */ +struct pvr_fw_version fw_version; +/** @regs_resource: Resource representing device control registers. */ struct resource *regs_resource;@@ -65,6 +117,9 @@ struct pvr_device {/** @regulator: Power regulator. */ struct regulator *regulator; + +/** @fw_dev: Firmware related data. */ +struct pvr_fw_device fw_dev; };/** @@ -85,8 +140,79 @@ struct pvr_file {* to_pvr_device(). */ struct pvr_device *pvr_dev; + }; +/** +* PVR_HAS_FEATURE() - Tests whether a PowerVR device has a given feature +* @pvr_dev: [IN] Target PowerVR device. +* @feature: [IN] Hardware feature name. +* +* Feature names are derived from those found in &struct pvr_device_features by +* dropping the 'has_' prefix, which is applied by this macro. +* +* Return: +* * true if the named feature is present in the hardware +* * false if the named feature is not present in the hardware +*/ +#define PVR_HAS_FEATURE (pvr_dev, feature) ((pvr_dev)->features.has_##feature) + +/** +* PVR_FEATURE_VALUE() - Gets a PowerVR device feature value +* @pvr_dev: [IN] Target PowerVR device. +* @feature: [IN] Feature name. +* @value_out: [OUT] Feature value. +* +* This macro will get a feature value for those features that have values. +* If the feature is not present, nothing will be stored to @value_out. +* +* Feature names are derived from those found in &struct pvr_device_features by +* dropping the 'has_' prefix. +* +* Return: +* * 0 on success, or +* * -%EINVAL if the named feature is not present in the hardware +*/ +#define PVR_FEATURE_VALUE (pvr_dev, feature, value_out) \ + ({ \ + struct pvr_device *_pvr_dev = pvr_dev; \ + int _ret = -EINVAL; \ + if (_pvr_dev->features.has_##feature) { \ + *(value_out) = _pvr_dev->features.feature; \ + _ret = 0; \ + } \ + _ret; \ + }) + +/** +* PVR_HAS_QUIRK() - Tests whether a physical device has a given quirk +* @pvr_dev: [IN] Target PowerVR device. +* @quirk: [IN] Hardware quirk name. +* +* Quirk numbers are derived from those found in #pvr_device_quirks by +* dropping the 'has_brn' prefix, which is applied by this macro. +* +* Returns +* * true if the quirk is present in the hardware, or +* * false if the quirk is not present in the hardware. +*/ +#define PVR_HAS_QUIRK (pvr_dev, quirk) ((pvr_dev)->quirks.has_brn##quirk) + +/** +* PVR_HAS_ENHANCEMENT() - Tests whether a physical device has a given +* enhancement +* @pvr_dev: [IN] Target PowerVR device. +* @enhancement: [IN] Hardware enhancement name. +* +* Enhancement numbers are derived from those found in #pvr_device_enhancements +* by dropping the 'has_ern' prefix, which is applied by this macro. +* +* Returns +* * true if the enhancement is present in the hardware, or +* * false if the enhancement is not present in the hardware. +*/ +#define PVR_HAS_ENHANCEMENT (pvr_dev, enhancement) ((pvr_dev)->enhancements.has_ern##enhancement) + static __always_inline struct drm_device *from_pvr_device (struct pvr_device *pvr_dev) {@@ -111,12 +237,80 @@ to_pvr_file(struct drm_file *file)return file->driver_priv; } +/** +* PVR_PACKED_BVNC() - Packs B, V, N and C values into a 64-bit unsigned integer +* @b: Branch ID. +* @v: Version ID. +* @n: Number of scalable units. +* @c: Config ID. +* +* The packed layout is as follows: +* +* +--------+--------+--------+-------+ +* | 63..48 | 47..32 | 31..16 | 15..0 | +* +========+========+========+=======+ +* | B | V | N | C | +* +--------+--------+--------+-------+ +* +* pvr_gpu_id_to_packed_bvnc() should be used instead of this macro when a +* &struct pvr_gpu_id is available in order to ensure proper type checking. +* +* Return: Packed BVNC. +*/ +/* clang-format off */ +#define PVR_PACKED_BVNC (b, v, n, c) \ + ((((u64)(b) & GENMASK_ULL(15, 0)) << 48) | \ + (((u64)(v) & GENMASK_ULL(15, 0)) << 32) | \ + (((u64)(n) & GENMASK_ULL(15, 0)) << 16) | \ + (((u64)(c) & GENMASK_ULL(15, 0)) << 0)) +/* clang-format on */ + +/** +* pvr_gpu_id_to_packed_bvnc() - Packs B, V, N and C values into a 64-bit +* unsigned integer +* @gpu_id: GPU ID. +* +* The packed layout is as follows: +* +* +--------+--------+--------+-------+ +* | 63..48 | 47..32 | 31..16 | 15..0 | +* +========+========+========+=======+ +* | B | V | N | C | +* +--------+--------+--------+-------+ +* +* This should be used in preference to PVR_PACKED_BVNC() when a &struct +* pvr_gpu_id is available in order to ensure proper type checking. +* +* Return: Packed BVNC. +*/ +static __always_inline u64 +pvr_gpu_id_to_packed_bvnc (struct pvr_gpu_id *gpu_id) +{ +return PVR_PACKED_BVNC (gpu_id->b, gpu_id->v, gpu_id->n, gpu_id->c); +} + +static __always_inline void +packed_bvnc_to_pvr_gpu_id (u64 bvnc,struct pvr_gpu_id *gpu_id) +{ + gpu_id->b = (bvnc &GENMASK_ULL (63 ,48 )) >>48 ; + gpu_id->v = (bvnc &GENMASK_ULL (47 ,32 )) >>32 ; + gpu_id->n = (bvnc &GENMASK_ULL (31 ,16 )) >>16 ; + gpu_id->c = bvnc &GENMASK_ULL (15 ,0 ); +} +int pvr_device_init (struct pvr_device *pvr_dev);void pvr_device_fini (struct pvr_device *pvr_dev);int pvr_device_clk_core_get_freq (struct pvr_device *pvr_dev,u32 *freq_out); +bool +pvr_device_has_uapi_quirk (struct pvr_device *pvr_dev,u32 quirk); +bool +pvr_device_has_uapi_enhancement (struct pvr_device *pvr_dev,u32 enhancement); +bool +pvr_device_has_feature (struct pvr_device *pvr_dev,u32 feature); +/** * PVR_CR_READ32() - Read a 32-bit register from a PowerVR device * @pvr_dev: Target PowerVR device. @@ -286,6 +480,29 @@ pvr_cr_poll_reg64(struct pvr_device *pvr_dev, u32 reg_addr, u64 reg_value, (value & reg_mask) == reg_value, 0, timeout_usec); } +/** +* pvr_round_up_to_cacheline_size() - Round up a provided size to be cacheline +* aligned +* @pvr_dev: Target PowerVR device. +* @size: Initial size, in bytes. +* +* Returns: +* * Size aligned to cacheline size. +*/ +static __always_inline size_t +pvr_round_up_to_cacheline_size (struct pvr_device *pvr_dev,size_t size) +{ +u16 slc_cacheline_size_in_bits =0 ; +u16 slc_cacheline_size_in_bytes; + +WARN_ON (!PVR_HAS_FEATURE (pvr_dev, slc_cache_line_size_in_bits)); +PVR_FEATURE_VALUE (pvr_dev, slc_cache_line_size_in_bits, + &slc_cacheline_size_in_bits); + slc_cacheline_size_in_bytes = slc_cacheline_size_in_bits /8 ; + +return round_up (size, slc_cacheline_size_in_bytes); +} +/** * DOC: IOCTL validation helpers * @@ -380,4 +597,8 @@ pvr_ioctl_union_padding_check(void *instance, size_t union_offset, __union_size, __member_size); \ }) +#define PVR_FW_PROCESSOR_TYPE_META 0 +#define PVR_FW_PROCESSOR_TYPE_MIPS 1 +#define PVR_FW_PROCESSOR_TYPE_RISCV 2 +#endif /* PVR_DEVICE_H */ drivers/gpu/drm/imagination/pvr_device_info.c new file +223
-0@@ -0,0 +1,223 @@ +// SPDX-License-Identifier: GPL-2.0 OR MIT +/* Copyright (c) 2022 Imagination Technologies Ltd. */ + +#include "pvr_device.h" +#include "pvr_device_info.h" + +#include <drm/drm_print.h> + +#include <linux/types.h> + +static const struct pvr_device_features pvr_device_4_V_2_51 = { + .has_cdm_control_stream_format = true, + .has_cluster_grouping = true, + .has_common_store_size_in_dwords = true, + .has_compute = true, + .has_compute_morton_capable = true, + .has_compute_overlap = true, + .has_fbcdc_algorithm = true, + .has_isp_max_tiles_in_flight = true, + .has_isp_samples_per_pixel = true, + .has_max_partitions = true, + .has_meta = true, + .has_meta_coremem_size = true, + .has_num_clusters = true, + .has_num_isp_ipp_pipes = true, + .has_num_raster_pipes = true, + .has_phys_bus_width = true, + .has_slc_cache_line_size_in_bits = true, + .has_tile_size_x = true, + .has_tile_size_y = true, + .has_usc_min_output_registers_per_pix = true, + .has_virtual_address_space_bits = true, + .has_xt_top_infrastructure = true, + .has_zls_subtile = true, + + .cdm_control_stream_format =1 , + .common_store_size_in_dwords =1280U *4U *4U , + .fbcdc_algorithm =2 , + .isp_max_tiles_in_flight =4 , + .isp_samples_per_pixel =2 , + .max_partitions =8 , + .meta = true, + .meta_coremem_size =32 , + .num_clusters =2 , + .num_isp_ipp_pipes =8 , + .num_raster_pipes =1 , + .phys_bus_width =40 , + .slc_cache_line_size_in_bits =512 , + .tile_size_x =32 , + .tile_size_y =32 , + .usc_min_output_registers_per_pix =2 , + .virtual_address_space_bits =40 , +}; + +static const struct pvr_device_quirks pvr_device_quirks_4_40_2_51 = { + .has_brn44079 = true, + .has_brn48492 = true, + .has_brn48545 = true, + .has_brn49927 = true, + .has_brn51764 = true, + .has_brn52354 = true, + .has_brn62269 = true, + .has_brn63142 = true, + .has_brn66011 = true, +}; + +static const struct pvr_device_enhancements pvr_device_enhancements_4_40_2_51 = { + .has_ern35421 = true, + .has_ern38020 = true, + .has_ern38748 = true, + .has_ern42064 = true, +}; + +static const struct pvr_device_features pvr_device_33_V_11_3 = { + .has_cdm_control_stream_format = true, + .has_common_store_size_in_dwords = true, + .has_compute = true, + .has_isp_max_tiles_in_flight = true, + .has_isp_samples_per_pixel = true, + .has_max_partitions = true, + .has_mips = true, + .has_num_clusters = true, + .has_num_isp_ipp_pipes = true, + .has_num_raster_pipes = true, + .has_phys_bus_width = true, + .has_roguexe = true, + .has_simple_internal_parameter_format = true, + .has_slc_cache_line_size_in_bits = true, + .has_sys_bus_secure_reset = true, + .has_tile_size_x = true, + .has_tile_size_y = true, + .has_usc_min_output_registers_per_pix = true, + .has_virtual_address_space_bits = true, + .has_xe_memory_hierarchy = true, + + .cdm_control_stream_format =1 , + .common_store_size_in_dwords =512U *4U *4U , + .isp_max_tiles_in_flight =1 , + .isp_samples_per_pixel =1 , + .max_partitions =4 , + .mips = true, + .num_clusters =1 , + .num_isp_ipp_pipes =1 , + .num_raster_pipes =1 , + .phys_bus_width =36 , + .simple_internal_parameter_format =2 , + .slc_cache_line_size_in_bits =512 , + .tile_size_x =16 , + .tile_size_y =16 , + .usc_min_output_registers_per_pix =1 , + .virtual_address_space_bits =40 , +}; + +static const struct pvr_device_quirks pvr_device_quirks_33_15_11_3 = { + .has_brn63553 = true, +}; + +static const struct pvr_device_enhancements pvr_device_enhancements_33_15_11_3 = { + .has_ern35421 = true, + .has_ern38748 = true, +}; + +static const struct pvr_device_features pvr_device_36_V_104_796 = { + .has_cdm_control_stream_format = true, + .has_common_store_size_in_dwords = true, + .has_compute = true, + .has_compute_overlap = true, + .has_fbcdc_algorithm = true, + .has_gpu_multicore_support = true, + .has_isp_max_tiles_in_flight = true, + .has_isp_samples_per_pixel = true, + .has_max_partitions = true, + .has_num_clusters = true, + .has_num_isp_ipp_pipes = true, + .has_num_raster_pipes = true, + .has_phys_bus_width = true, + .has_riscv_fw_processor = true, + .has_roguexe = true, + .has_simple_internal_parameter_format = true, + .has_slc_cache_line_size_in_bits = true, + .has_sys_bus_secure_reset = true, + .has_tile_size_x = true, + .has_tile_size_y = true, + .has_tpu_dm_global_registers = true, + .has_usc_min_output_registers_per_pix = true, + .has_virtual_address_space_bits = true, + .has_xe_memory_hierarchy = true, + .has_xpu_max_slaves = true, + + .cdm_control_stream_format =1 , + .common_store_size_in_dwords =1344U *4U *4U , + .fbcdc_algorithm =50 , + .isp_max_tiles_in_flight =6 , + .isp_samples_per_pixel =4 , + .max_partitions =16 , + .num_clusters =1 , + .num_isp_ipp_pipes =6 , + .num_raster_pipes =1 , + .phys_bus_width =36 , + .riscv_fw_processor = true, + .simple_internal_parameter_format =2 , + .slc_cache_line_size_in_bits =512 , + .tile_size_x =16 , + .tile_size_y =16 , + .usc_min_output_registers_per_pix =2 , + .virtual_address_space_bits =40 , + .xpu_max_slaves =3 , +}; + +static const struct pvr_device_quirks pvr_device_quirks_36_53_104_796 = { + .has_brn44079 = true, +}; + +static const struct pvr_device_enhancements pvr_device_enhancements_36_53_104_796 = { + .has_ern35421 = true, + .has_ern38748 = true, +}; + +/** +* pvr_device_info_init() - Initialize a PowerVR device's hardware features and quirks +* @pvr_dev: Target PowerVR device. +* +* This function relies on &pvr_dev.gpu_id having already been initialized. If +* PowerVR device version is supported then sets &pvr_dev.features and &pvr_dev.quirks. +* +* Return: +* * 0 on success, or +* * -%ENODEV if the device is not supported. +*/ +int +pvr_device_info_init (struct pvr_device *pvr_dev) +{ +struct drm_device *drm_dev =from_pvr_device (pvr_dev); +struct pvr_gpu_id *gpu_id = &pvr_dev->gpu_id; +const u64 bvnc =pvr_gpu_id_to_packed_bvnc (gpu_id); + +/* +* This macro results in a "Macros with multiple statements should be +* enclosed in a do - while loop" checkpatch error. However, following +* this advice would make the macro look a bit odd and isn't necessary +* in this particular case, as the macro has a very specific use and a +* very limited lifetime. The error can therefore be ignored. +*/ +#define CASE_PACKED_BVNC_DEVICE_INFO (b, v, n, c) \ + case PVR_PACKED_BVNC(b, v, n, c): \ + pvr_dev->features = pvr_device_##b##_V_##n##_##c; \ + pvr_dev->quirks = pvr_device_quirks_##b##_##v##_##n##_##c; \ + pvr_dev->enhancements = pvr_device_enhancements_##b##_##v##_##n##_##c; \ + return 0 + +switch (bvnc) { +CASE_PACKED_BVNC_DEVICE_INFO (4 ,40 ,2 ,51 ); +CASE_PACKED_BVNC_DEVICE_INFO (33 ,15 ,11 ,3 ); +CASE_PACKED_BVNC_DEVICE_INFO (36 ,53 ,104 ,796 ); + } + +#undef CASE_PACKED_BVNC_DEVICE_INFO + +drm_warn (drm_dev,"Unsupported BVNC: %u.%u.%u.%u\n" , gpu_id->b, + gpu_id->v, gpu_id->n, gpu_id->c); + +return -ENODEV ; +}drivers/gpu/drm/imagination/pvr_device_info.h new file +133
-0@@ -0,0 +1,133 @@ +/* SPDX-License-Identifier: GPL-2.0 OR MIT */ +/* Copyright (c) 2022 Imagination Technologies Ltd. */ + +#ifndef PVR_DEVICE_INFO_H +#define PVR_DEVICE_INFO_H + +#include <linux/types.h> + +struct pvr_device ; + +/* +* struct pvr_device_features - Hardware feature information +*/ +struct pvr_device_features { +bool has_cdm_control_stream_format :1 ; +bool has_cluster_grouping :1 ; +bool has_common_store_size_in_dwords :1 ; +bool has_compute :1 ; +bool has_compute_morton_capable :1 ; +bool has_compute_overlap :1 ; +bool has_fb_cdc_v4 :1 ; +bool has_fbcdc_algorithm :1 ; +bool has_gpu_multicore_support :1 ; +bool has_isp_max_tiles_in_flight :1 ; +bool has_isp_samples_per_pixel :1 ; +bool has_isp_zls_d24_s8_packing_ogl_mode :1 ; +bool has_max_partitions :1 ; +bool has_meta :1 ; +bool has_meta_coremem_size :1 ; +bool has_mips :1 ; +bool has_num_clusters :1 ; +bool has_num_isp_ipp_pipes :1 ; +bool has_num_raster_pipes :1 ; +bool has_phys_bus_width :1 ; +bool has_riscv_fw_processor :1 ; +bool has_roguexe :1 ; +bool has_s7_top_infrastructure :1 ; +bool has_simple_internal_parameter_format :1 ; +bool has_slc_cache_line_size_in_bits :1 ; +bool has_sys_bus_secure_reset :1 ; +bool has_tessellation :1 ; +bool has_tile_size_x :1 ; +bool has_tile_size_y :1 ; +bool has_tpu_dm_global_registers :1 ; +bool has_usc_min_output_registers_per_pix :1 ; +bool has_vdm_drawindirect :1 ; +bool has_vdm_object_level_lls :1 ; +bool has_virtual_address_space_bits :1 ; +bool has_xe_memory_hierarchy :1 ; +bool has_xpu_max_slaves :1 ; +bool has_xt_top_infrastructure :1 ; +bool has_zls_subtile :1 ; + +u8 cdm_control_stream_format; +u32 common_store_size_in_dwords; +u8 fbcdc_algorithm; +u16 isp_max_tiles_in_flight; +bool isp_samples_per_pixel; +u16 max_partitions; +bool meta; +u32 meta_coremem_size; +bool mips; +u16 num_clusters; +u8 num_isp_ipp_pipes; +u8 num_raster_pipes; +u16 phys_bus_width; +bool riscv_fw_processor; +u32 simple_internal_parameter_format; +u16 slc_cache_line_size_in_bits; +u16 tile_size_x; +u16 tile_size_y; +u16 usc_min_output_registers_per_pix; +u16 virtual_address_space_bits; +u8 xpu_max_slaves; +}; + +/* +* struct pvr_device_quirks - Hardware quirk information +*/ +struct pvr_device_quirks { +bool has_brn44079 :1 ; +bool has_brn47217 :1 ; +bool has_brn48492 :1 ; +bool has_brn48545 :1 ; +bool has_brn49927 :1 ; +bool has_brn51764 :1 ; +bool has_brn52354 :1 ; +bool has_brn62269 :1 ; +bool has_brn63142 :1 ; +bool has_brn63553 :1 ; +bool has_brn66011 :1 ; +}; + +/* +* struct pvr_device_enhancements - Hardware enhancement information +*/ +struct pvr_device_enhancements { +bool has_ern35421 :1 ; +bool has_ern38020 :1 ; +bool has_ern38748 :1 ; +bool has_ern42064 :1 ; +}; + +int pvr_device_info_init (struct pvr_device *pvr_dev); + +/* +* Meta cores +* +* These are the values for the 'meta' feature when the feature is present +* (as per &struct pvr_device_features)/ +*/ +#define PVR_META_MTP218 (1) +#define PVR_META_MTP219 (2) +#define PVR_META_LTP218 (3) +#define PVR_META_LTP217 (4) + +enum { +PVR_FEATURE_CDM_USER_MODE_QUEUE , +PVR_FEATURE_CLUSTER_GROUPING , +PVR_FEATURE_COMPUTE_MORTON_CAPABLE , +PVR_FEATURE_FB_CDC_V4 , +PVR_FEATURE_GPU_MULTICORE_SUPPORT , +PVR_FEATURE_ISP_ZLS_D24_S8_PACKING_OGL_MODE , +PVR_FEATURE_REQUIRES_FB_CDC_ZLS_SETUP , +PVR_FEATURE_S7_TOP_INFRASTRUCTURE , +PVR_FEATURE_TESSELLATION , +PVR_FEATURE_TPU_DM_GLOBAL_REGISTERS , +PVR_FEATURE_VDM_DRAWINDIRECT , +PVR_FEATURE_VDM_OBJECT_LEVEL_LLS , +PVR_FEATURE_ZLS_SUBTILE , +}; + +#endif /* PVR_DEVICE_INFO_H */ drivers/gpu/drm/imagination/pvr_drv.c +552
-1@@ -3,6 +3,9 @@#include "pvr_device.h" #include "pvr_drv.h" +#include "pvr_rogue_defs.h" +#include "pvr_rogue_fwif_client.h" +#include "pvr_rogue_fwif_shared.h" #include <uapi/drm/pvr_drm.h> @@ -88,6 +91,422 @@ pvr_ioctl_get_bo_mmap_offset(__always_unused struct drm_device *drm_dev,return -ENOTTY ; } +static __always_inline u64 +pvr_fw_version_packed (u32 major,u32 minor) +{ +return ((u64 )major <<32 ) | minor; +} + +static u32 +rogue_get_common_store_partition_space_size (struct pvr_device *pvr_dev) +{ +u32 max_partitions =0 ; +u32 tile_size_x =0 ; +u32 tile_size_y =0 ; + +PVR_FEATURE_VALUE (pvr_dev, tile_size_x, &tile_size_x); +PVR_FEATURE_VALUE (pvr_dev, tile_size_y, &tile_size_y); +PVR_FEATURE_VALUE (pvr_dev, max_partitions, &max_partitions); + +if (tile_size_x ==16 && tile_size_y ==16 ) { +u32 usc_min_output_registers_per_pix =0 ; + +PVR_FEATURE_VALUE (pvr_dev, usc_min_output_registers_per_pix, + &usc_min_output_registers_per_pix); + +return tile_size_x * tile_size_y * max_partitions * + usc_min_output_registers_per_pix; + } + +return max_partitions *1024 ; +} + +static u32 +rogue_get_common_store_alloc_region_size (struct pvr_device *pvr_dev) +{ +u32 common_store_size_in_dwords =512 *4 *4 ; +u32 alloc_region_size; + +PVR_FEATURE_VALUE (pvr_dev, common_store_size_in_dwords, &common_store_size_in_dwords); + + alloc_region_size = common_store_size_in_dwords - (256U *4U ) - +rogue_get_common_store_partition_space_size (pvr_dev); + +if (PVR_HAS_QUIRK (pvr_dev,44079 )) { +u32 common_store_split_point = (768U *4U *4U ); + +return min (common_store_split_point - (256U *4U ), alloc_region_size); + } + +return alloc_region_size; +} + +static inline u32 +rogue_get_num_phantoms (struct pvr_device *pvr_dev) +{ +u32 num_clusters =1 ; + +PVR_FEATURE_VALUE (pvr_dev, num_clusters, &num_clusters); + +return ROGUE_REQ_NUM_PHANTOMS (num_clusters); +} + +static inline u32 +rogue_get_max_coeffs (struct pvr_device *pvr_dev) +{ +u32 max_coeff_additional_portion =ROGUE_MAX_VERTEX_SHARED_REGISTERS ; +u32 pending_allocation_shared_regs =2U *1024U ; +u32 pending_allocation_coeff_regs =0U ; +u32 num_phantoms =rogue_get_num_phantoms (pvr_dev); +u32 tiles_in_flight =0 ; +u32 max_coeff_pixel_portion; + +PVR_FEATURE_VALUE (pvr_dev, isp_max_tiles_in_flight, &tiles_in_flight); + max_coeff_pixel_portion =DIV_ROUND_UP (tiles_in_flight, num_phantoms); + max_coeff_pixel_portion *=ROGUE_MAX_PIXEL_SHARED_REGISTERS ; + +/* +* Compute tasks on cores with BRN48492 and without compute overlap may lock +* up without two additional lines of coeffs. +*/ +if (PVR_HAS_QUIRK (pvr_dev,48492 ) && !PVR_HAS_FEATURE (pvr_dev, compute_overlap)) + pending_allocation_coeff_regs =2U *1024U ; + +if (PVR_HAS_ENHANCEMENT (pvr_dev,38748 )) + pending_allocation_shared_regs =0 ; + +if (PVR_HAS_ENHANCEMENT (pvr_dev,38020 )) + max_coeff_additional_portion +=ROGUE_MAX_COMPUTE_SHARED_REGISTERS ; + +return rogue_get_common_store_alloc_region_size (pvr_dev) + pending_allocation_coeff_regs - + (max_coeff_pixel_portion + max_coeff_additional_portion + + pending_allocation_shared_regs); +} + +static inline u32 +rogue_get_cdm_max_local_mem_size_regs (struct pvr_device *pvr_dev) +{ +u32 available_coeffs_in_dwords =rogue_get_max_coeffs (pvr_dev); + +if (PVR_HAS_QUIRK (pvr_dev,48492 ) &&PVR_HAS_FEATURE (pvr_dev, roguexe) && + !PVR_HAS_FEATURE (pvr_dev, compute_overlap)) { +/* Driver must not use the 2 reserved lines. */ + available_coeffs_in_dwords -=ROGUE_CSRM_LINE_SIZE_IN_DWORDS *2 ; + } + +/* +* The maximum amount of local memory available to a kernel is the minimum +* of the total number of coefficient registers available and the max common +* store allocation size which can be made by the CDM. +* +* If any coeff lines are reserved for tessellation or pixel then we need to +* subtract those too. +*/ +return min (available_coeffs_in_dwords, (u32 )ROGUE_MAX_PER_KERNEL_LOCAL_MEM_SIZE_REGS ); +} + +/** +* pvr_dev_query_gpu_info_get() +* @pvr_dev: Device pointer. +* @args: [IN] Device query arguments containing a pointer to a userspace +* struct drm_pvr_dev_query_gpu_info. +* +* If the query object pointer is NULL, the size field is updated with the +* expected size of the query object. +* +* Returns: +* * 0 on success, or if size is requested using a NULL pointer, or +* * -%E2BIG if the indicated length of the allocation is less than is +* required to contain the copied data, or +* * -%EFAULT if local memory could not be copied to userspace. +*/ +static int +pvr_dev_query_gpu_info_get (struct pvr_device *pvr_dev, +struct drm_pvr_ioctl_dev_query_args *args) +{ +struct drm_pvr_dev_query_gpu_info gpu_info = {0 }; +int err; + +if (!args->pointer) { + args->size =sizeof (struct drm_pvr_dev_query_gpu_info ); +return 0 ; + } + + gpu_info.gpu_id = +pvr_gpu_id_to_packed_bvnc (&pvr_dev->gpu_id); + gpu_info.num_phantoms =rogue_get_num_phantoms (pvr_dev); + + err =PVR_UOBJ_SET (args->pointer, args->size, gpu_info); +if (err <0 ) +return err; + +if (args->size >sizeof (gpu_info)) + args->size =sizeof (gpu_info); +return 0 ; +} + +/** +* pvr_dev_query_runtime_info_get() +* @pvr_dev: Device pointer. +* @args: [IN] Device query arguments containing a pointer to a userspace +* struct drm_pvr_dev_query_runtime_info. +* +* If the query object pointer is NULL, the size field is updated with the +* expected size of the query object. +* +* Returns: +* * 0 on success, or if size is requested using a NULL pointer, or +* * -%E2BIG if the indicated length of the allocation is less than is +* required to contain the copied data, or +* * -%EFAULT if local memory could not be copied to userspace. +*/ +static int +pvr_dev_query_runtime_info_get (struct pvr_device *pvr_dev, +struct drm_pvr_ioctl_dev_query_args *args) +{ +struct drm_pvr_dev_query_runtime_info runtime_info = {0 }; +int err; + +if (!args->pointer) { + args->size =sizeof (struct drm_pvr_dev_query_runtime_info ); +return 0 ; + } + + runtime_info.free_list_min_pages =0 ;/* FIXME */ + runtime_info.free_list_max_pages = +ROGUE_PM_MAX_FREELIST_SIZE /ROGUE_PM_PAGE_SIZE ; + runtime_info.common_store_alloc_region_size = +rogue_get_common_store_alloc_region_size (pvr_dev); + runtime_info.common_store_partition_space_size = +rogue_get_common_store_partition_space_size (pvr_dev); + runtime_info.max_coeffs =rogue_get_max_coeffs (pvr_dev); + runtime_info.cdm_max_local_mem_size_regs = +rogue_get_cdm_max_local_mem_size_regs (pvr_dev); + + err =PVR_UOBJ_SET (args->pointer, args->size, runtime_info); +if (err <0 ) +return err; + +if (args->size >sizeof (runtime_info)) + args->size =sizeof (runtime_info); +return 0 ; +} + +/** +* pvr_dev_query_hwrt_info_get() +* @pvr_dev: Device pointer. +* @args: [IN] Device query arguments containing a pointer to a userspace +* struct drm_pvr_dev_query_hwrt_info. +* +* If the query object pointer is NULL, the size field is updated with the +* expected size of the query object. +* +* Returns: +* * 0 on success, or if size is requested using a NULL pointer, or +* * -%E2BIG if the indicated length of the allocation is less than is +* required to contain the copied data, or +* * -%EFAULT if local memory could not be copied to userspace. +*/ +static int +pvr_dev_query_hwrt_info_get (struct pvr_device *pvr_dev, +struct drm_pvr_ioctl_dev_query_args *args) +{ +struct drm_pvr_dev_query_hwrt_info hwrt_info = {0 }; +int err; + +if (!args->pointer) { + args->size =sizeof (struct drm_pvr_dev_query_hwrt_info ); +return 0 ; + } + + hwrt_info.num_geomdatas =ROGUE_FWIF_NUM_GEOMDATAS ; + hwrt_info.num_rtdatas =ROGUE_FWIF_NUM_RTDATAS ; + hwrt_info.num_freelists =ROGUE_FWIF_NUM_RTDATA_FREELISTS ; + + err =PVR_UOBJ_SET (args->pointer, args->size, hwrt_info); +if (err <0 ) +return err; + +if (args->size >sizeof (hwrt_info)) + args->size =sizeof (hwrt_info); +return 0 ; +} + +/** +* pvr_dev_query_quirks_get() - Unpack array of quirks at the address given +* in a struct drm_pvr_dev_query_quirks, or gets the amount of space required +* for it. +* @pvr_dev: Device pointer. +* @args: [IN] Device query arguments containing a pointer to a userspace +* struct drm_pvr_dev_query_query_quirks. +* +* If the query object pointer is NULL, the size field is updated with the +* expected size of the query object. +* If the userspace pointer in the query object is NULL, or the count is +* short, no data is copied. +* The count field will be updated to that copied, or if either pointer is +* NULL, that which would have been copied. +* The size field in the query object will be updated to the size copied. +* +* Returns: +* * 0 on success, or if size/count is requested using a NULL pointer, or +* * -%EINVAL if args contained non-zero reserved fields, or +* * -%E2BIG if the indicated length of the allocation is less than is +* required to contain the copied data, or +* * -%EFAULT if local memory could not be copied to userspace. +*/ +static int +pvr_dev_query_quirks_get (struct pvr_device *pvr_dev, +struct drm_pvr_ioctl_dev_query_args *args) +{ +/* +* @FIXME - hardcoding of numbers here is intended as an +* intermediate step so the UAPI can be fixed, but requires a +* a refactor in the future to store them in a more appropriate +* location +*/ +static const u32 umd_quirks_musthave[] = { +47217 , +49927 , +62269 , + }; +static const u32 umd_quirks[] = { +48545 , +51764 , + }; +struct drm_pvr_dev_query_quirks query; +u32 out[ARRAY_SIZE (umd_quirks_musthave) +ARRAY_SIZE (umd_quirks)]; +size_t out_musthave_count =0 ; +size_t out_count =0 ; +int err; + +if (!args->pointer) { + args->size =sizeof (struct drm_pvr_dev_query_quirks ); +return 0 ; + } + + err =PVR_UOBJ_GET (query, args->size, args->pointer); + +if (err <0 ) +return err; +if (query._padding_c) +return -EINVAL ; + +for (int i =0 ; i <ARRAY_SIZE (umd_quirks_musthave); i++) { +if (pvr_device_has_uapi_quirk (pvr_dev, umd_quirks_musthave[i])) { + out[out_count++] = umd_quirks_musthave[i]; + out_musthave_count++; + } + } + +for (int i =0 ; i <ARRAY_SIZE (umd_quirks); i++) { +if (pvr_device_has_uapi_quirk (pvr_dev, umd_quirks[i])) + out[out_count++] = umd_quirks[i]; + } + +if (!query.quirks) + goto copy_out; +if (query.count < out_count) +return -E2BIG ; + +if (copy_to_user (u64_to_user_ptr (query.quirks), out, + out_count *sizeof (u32))) { +return -EFAULT ; + } + + query.musthave_count = out_musthave_count; + +copy_out: + query.count = out_count; + err =PVR_UOBJ_SET (args->pointer, args->size, query); +if (err <0 ) +return err; + + args->size =sizeof (query); +return 0 ; +} + +/** +* pvr_dev_query_enhancements_get() - Unpack array of enhancements at the +* address given in a struct drm_pvr_dev_query_enhancements, or gets the amount +* of space required for it. +* @pvr_dev: Device pointer. +* @args: [IN] Device query arguments containing a pointer to a userspace +* struct drm_pvr_dev_query_enhancements. +* +* If the query object pointer is NULL, the size field is updated with the +* expected size of the query object. +* If the userspace pointer in the query object is NULL, or the count is +* short, no data is copied. +* The count field will be updated to that copied, or if either pointer is +* NULL, that which would have been copied. +* The size field in the query object will be updated to the size copied. +* +* Returns: +* * 0 on success, or if size/count is requested using a NULL pointer, or +* * -%EINVAL if args contained non-zero reserved fields, or +* * -%E2BIG if the indicated length of the allocation is less than is +* required to contain the copied data, or +* * -%EFAULT if local memory could not be copied to userspace. +*/ +static int +pvr_dev_query_enhancements_get (struct pvr_device *pvr_dev, +struct drm_pvr_ioctl_dev_query_args *args) +{ +/* +* @FIXME - hardcoding of numbers here is intended as an +* intermediate step so the UAPI can be fixed, but requires a +* a refactor in the future to store them in a more appropriate +* location +*/ +const u32 umd_enhancements[] = { +35421 , +42064 , + }; +struct drm_pvr_dev_query_enhancements query; +u32 out[ARRAY_SIZE (umd_enhancements)]; +size_t out_idx =0 ; +int err; + +if (!args->pointer) { + args->size =sizeof (struct drm_pvr_dev_query_enhancements ); +return 0 ; + } + + err =PVR_UOBJ_GET (query, args->size, args->pointer); + +if (err <0 ) +return err; +if (query._padding_a) +return -EINVAL ; +if (query._padding_c) +return -EINVAL ; + +for (int i =0 ; i <ARRAY_SIZE (umd_enhancements); i++) { +if (pvr_device_has_uapi_enhancement (pvr_dev, umd_enhancements[i])) + out[out_idx++] = umd_enhancements[i]; + } + +if (!query.enhancements) + goto copy_out; +if (query.count < out_idx) +return -E2BIG ; + +if (copy_to_user (u64_to_user_ptr (query.enhancements), out, + out_idx *sizeof (u32))) { +return -EFAULT ; + } + +copy_out: + query.count = out_idx; + err =PVR_UOBJ_SET (args->pointer, args->size, query); +if (err <0 ) +return err; + + args->size =sizeof (query); +return 0 ; +} +/** * pvr_ioctl_dev_query() - IOCTL to copy information about a device * @drm_dev: [IN] DRM device. @@ -112,7 +531,33 @@ static int pvr_ioctl_dev_query(struct drm_device *drm_dev, void *raw_args, struct drm_file *file) { - return -ENOTTY; + struct pvr_device *pvr_dev = to_pvr_device(drm_dev); +struct drm_pvr_ioctl_dev_query_args *args = raw_args; + +switch ((enum drm_pvr_dev_query )args->type) { +case DRM_PVR_DEV_QUERY_GPU_INFO_GET : +return pvr_dev_query_gpu_info_get (pvr_dev, args); + +case DRM_PVR_DEV_QUERY_RUNTIME_INFO_GET : +return pvr_dev_query_runtime_info_get (pvr_dev, args); + +case DRM_PVR_DEV_QUERY_HWRT_INFO_GET : +return pvr_dev_query_hwrt_info_get (pvr_dev, args); + +case DRM_PVR_DEV_QUERY_QUIRKS_GET : +return pvr_dev_query_quirks_get (pvr_dev, args); + +case DRM_PVR_DEV_QUERY_ENHANCEMENTS_GET : +return pvr_dev_query_enhancements_get (pvr_dev, args); + +case DRM_PVR_DEV_QUERY_HEAP_INFO_GET : +return -EINVAL ; + +case DRM_PVR_DEV_QUERY_STATIC_DATA_AREAS_GET : +return -EINVAL ; + } + +return -EINVAL ; }/** @@ -350,6 +795,112 @@ pvr_ioctl_submit_jobs(struct drm_device *drm_dev, void *raw_args,return -ENOTTY ; } +int +pvr_get_uobj (u64 usr_ptr,u32 usr_stride,u32 min_stride,u32 obj_size,void *out) +{ +if (usr_stride < min_stride) +return -EINVAL ; + +return copy_struct_from_user (out, obj_size,u64_to_user_ptr (usr_ptr), usr_stride); +} + +int +pvr_set_uobj (u64 usr_ptr,u32 usr_stride,u32 min_stride,u32 obj_size,const void *in) +{ +if (usr_stride < min_stride) +return -EINVAL ; + +if (copy_to_user (u64_to_user_ptr (usr_ptr), in,min_t (u32, usr_stride, obj_size))) +return -EFAULT ; + +if (usr_stride > obj_size && +clear_user (u64_to_user_ptr (usr_ptr + obj_size), usr_stride - obj_size)) { +return -EFAULT ; + } + +return 0 ; +} + +int +pvr_get_uobj_array (const struct drm_pvr_obj_array *in,u32 min_stride,u32 obj_size,void **out) +{ +int ret =0 ; +void *out_alloc; + +if (in->stride < min_stride) +return -EINVAL ; + +if (!in->count) +return 0 ; + + out_alloc =kvmalloc_array (in->count, obj_size,GFP_KERNEL ); +if (!out_alloc) +return -ENOMEM ; + +if (obj_size == in->stride) { +if (copy_from_user (out_alloc,u64_to_user_ptr (in->array), + (unsigned long )obj_size * in->count)) + ret = -EFAULT ; + }else { +void __user *in_ptr =u64_to_user_ptr (in->array); +void *out_ptr = out_alloc; + +for (u32 i =0 ; i < in->count; i++) { + ret =copy_struct_from_user (out_ptr, obj_size, in_ptr, in->stride); +if (ret) +break ; + + out_ptr += obj_size; + in_ptr += in->stride; + } + } + +if (ret) { +kvfree (out_alloc); +return ret; + } + + *out = out_alloc; +return 0 ; +} + +int +pvr_set_uobj_array (const struct drm_pvr_obj_array *out,u32 min_stride,u32 obj_size, +const void *in) +{ +if (out->stride < min_stride) +return -EINVAL ; + +if (!out->count) +return 0 ; + +if (obj_size == out->stride) { +if (copy_to_user (u64_to_user_ptr (out->array), in, + (unsigned long )obj_size * out->count)) +return -EFAULT ; + }else { +u32 cpy_elem_size =min_t (u32, out->stride, obj_size); +void __user *out_ptr =u64_to_user_ptr (out->array); +const void *in_ptr = in; + +for (u32 i =0 ; i < out->count; i++) { +if (copy_to_user (out_ptr, in_ptr, cpy_elem_size)) +return -EFAULT ; + + out_ptr += obj_size; + in_ptr += out->stride; + } + +if (out->stride > obj_size && +clear_user (u64_to_user_ptr (out->array + obj_size), + out->stride - obj_size)) { +return -EFAULT ; + } + } + +return 0 ; +} +#define DRM_PVR_IOCTL (_name, _func, _flags) \ DRM_IOCTL_DEF_DRV(PVR_##_name, pvr_ioctl_##_func, _flags)drivers/gpu/drm/imagination/pvr_drv.h +108
-0@@ -19,4 +19,112 @@#define PVR_DRIVER_MINOR 0#define PVR_DRIVER_PATCHLEVEL 0 +int pvr_get_uobj (u64 usr_ptr,u32 usr_size,u32 min_size,u32 obj_size,void *out); +int pvr_set_uobj (u64 usr_ptr,u32 usr_size,u32 min_size,u32 obj_size,const void *in); +int pvr_get_uobj_array (const struct drm_pvr_obj_array *in,u32 min_stride,u32 obj_size, +void **out); +int pvr_set_uobj_array (const struct drm_pvr_obj_array *out,u32 min_stride,u32 obj_size, +const void *in); + +#define PVR_UOBJ_MIN_SIZE_INTERNAL (_typename, _last_mandatory_field) \ + (offsetof(_typename, _last_mandatory_field) + \ + sizeof(((_typename *)NULL)->_last_mandatory_field)) + +/* NOLINTBEGIN(bugprone-macro-parentheses) */ +#define PVR_UOBJ_DECL (_typename, _last_mandatory_field) \ + , _typename : PVR_UOBJ_MIN_SIZE_INTERNAL(_typename, _last_mandatory_field) +/* NOLINTEND(bugprone-macro-parentheses) */ + +/** +* DOC: PVR user objects. +* +* Macros used to aid copying structured and array data to and from +* userspace. Objects can differ in size, provided the minimum size +* allowed is specified (using the last mandatory field in the struct). +* All types used with PVR_UOBJ_GET/SET macros must be listed here under +* PVR_UOBJ_MIN_SIZE, with the last mandatory struct field specified. +*/ + +/** +* PVR_UOBJ_MIN_SIZE() - Fetch the minimum copy size of a compatible type object. +* @_obj_name: The name of the object. Cannot be a typename - this is deduced. +* +* This cannot fail. Using the macro with an incompatible type will result in a +* compiler error. +* +* To add compatibility for a type, list it within the macro in an orderly +* fashion. The second argument is the name of the last mandatory field of the +* struct type, which is used to calculate the size. See also PVR_UOBJ_DECL(). +* +* Return: The minimum copy size. +*/ +#define PVR_UOBJ_MIN_SIZE (_obj_name) _Generic(_obj_name \ + PVR_UOBJ_DECL(struct drm_pvr_job, hwrt) \ + PVR_UOBJ_DECL(struct drm_pvr_sync_op, value) \ + PVR_UOBJ_DECL(struct drm_pvr_dev_query_gpu_info, num_phantoms) \ + PVR_UOBJ_DECL(struct drm_pvr_dev_query_runtime_info, cdm_max_local_mem_size_regs) \ + PVR_UOBJ_DECL(struct drm_pvr_dev_query_hwrt_info, _padding_4) \ + PVR_UOBJ_DECL(struct drm_pvr_dev_query_quirks, _padding_c) \ + PVR_UOBJ_DECL(struct drm_pvr_dev_query_enhancements, _padding_c) \ + PVR_UOBJ_DECL(struct drm_pvr_heap, page_size_log2) \ + PVR_UOBJ_DECL(struct drm_pvr_dev_query_heap_info, heaps) \ + PVR_UOBJ_DECL(struct drm_pvr_static_data_area, offset) \ + PVR_UOBJ_DECL(struct drm_pvr_dev_query_static_data_areas, static_data_areas) \ + ) + +/** +* PVR_UOBJ_GET() - Copies from _src_usr_ptr to &_dest_obj. +* @_dest_obj: The destination container object in kernel space. +* @_usr_size: The size of the source container in user space. +* @_src_usr_ptr: __u64 raw pointer to the source container in user space. +* +* Return: Error code. See pvr_get_uobj(). +*/ +#define PVR_UOBJ_GET (_dest_obj, _usr_size, _src_usr_ptr) \ + pvr_get_uobj(_src_usr_ptr, _usr_size, \ + PVR_UOBJ_MIN_SIZE(_dest_obj), \ + sizeof(_dest_obj), &(_dest_obj)) + +/** +* PVR_UOBJ_SET() - Copies from &_src_obj to _dest_usr_ptr. +* @_dest_usr_ptr: __u64 raw pointer to the destination container in user space. +* @_usr_size: The size of the destination container in user space. +* @_src_obj: The source container object in kernel space. +* +* Return: Error code. See pvr_set_uobj(). +*/ +#define PVR_UOBJ_SET (_dest_usr_ptr, _usr_size, _src_obj) \ + pvr_set_uobj(_dest_usr_ptr, _usr_size, \ + PVR_UOBJ_MIN_SIZE(_src_obj), \ + sizeof(_src_obj), &(_src_obj)) + +/** +* PVR_UOBJ_GET_ARRAY() - Copies from @_src_drm_pvr_obj_array.array to +* alloced memory and returns a pointer in _dest_array. +* @_dest_array: The destination C array object in kernel space. +* @_src_drm_pvr_obj_array: The &struct drm_pvr_obj_array containing a __u64 raw +* pointer to the source C array in user space and the size of each array +* element in user space (the 'stride'). +* +* Return: Error code. See pvr_get_uobj_array(). +*/ +#define PVR_UOBJ_GET_ARRAY (_dest_array, _src_drm_pvr_obj_array) \ + pvr_get_uobj_array(_src_drm_pvr_obj_array, \ + PVR_UOBJ_MIN_SIZE((_dest_array)[0]), \ + sizeof((_dest_array)[0]), (void **)&(_dest_array)) + +/** +* PVR_UOBJ_SET_ARRAY() - Copies from _src_array to @_dest_drm_pvr_obj_array.array. +* @_dest_drm_pvr_obj_array: The &struct drm_pvr_obj_array containing a __u64 raw +* pointer to the destination C array in user space and the size of each array +* element in user space (the 'stride'). +* @_src_array: The source C array object in kernel space. +* +* Return: Error code. See pvr_set_uobj_array(). +*/ +#define PVR_UOBJ_SET_ARRAY (_dest_drm_pvr_obj_array, _src_array) \ + pvr_set_uobj_array(_dest_drm_pvr_obj_array, \ + PVR_UOBJ_MIN_SIZE((_src_array)[0]), \ + sizeof((_src_array)[0]), _src_array) +#endif /* PVR_DRV_H */ drivers/gpu/drm/imagination/pvr_fw.h new file +20
-1@@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: GPL-2.0 OR MIT */ +/* Copyright (c) 2022 Imagination Technologies Ltd. */ + +#ifndef PVR_FW_H +#define PVR_FW_H + +#include <linux/firmware.h> + +struct pvr_fw_device { +/** @firmware: Handle to the firmware loaded into the device. */ +const struct firmware *firmware; + +/* +* @processor_type: FW processor type for this device. Must be one of +* %PVR_FW_PROCESSOR_TYPE_*. +*/ +u16 processor_type; +}; + +#endif /* PVR_FW_H */ --2.40.1
Re: [PATCH v3 07/17] drm/imagination: Add GPU ID parsing and firmware loading
Quoted 20 lines · Frank Binns
Hi Adam,
Quoted 10 lines · Adam Ford
Quoted 3 lines · Sarah Walker
Read the GPU ID register at probe time and select the correct features/quirks/enhancements. Use the GPU ID to form the firmware file name and load the firmware.
I have a Rogue 6250 variant, but the BVNC is returning a slightly different revision than the firmware that's currently available, and the older firmware for the vendor driver doesn't work with this new code.
Quoted 5 lines
Linux responds with Unsupported BVNC: 4.45.2.58. From what I can tell, the closest available firmware is 4.40.2.51.
Will there be more firmware variants in the future or will there be some options to build the firmware somehow?
Quoted 6 lines
We don't plan to support the SoC vendor provided firmware binaries as this will mean having to deal with many different versions of the firmware and its interface. Specifically, the interface can change in backwards incompatible ways between releases, it changes based on the hardware feature set & bugs and it's split across userspace & the kernel. This makes these SoC provided firmware binaries very difficult to support in this new driver.
Thanks for the response.
That makes sense. I would hope that various SoC vendors would jump on the bandwagon to work with your group to get their hardware supported.
Quoted 5 lines
As an alternative, we'll be releasing firmware binaries as we add support for more Rogue GPUs. We'll also release binaries upon request, in case others in the community want to work on support in the meantime - we're just getting things set up for this at the moment.
The Mesa side of things appears to be missing some documentation, and the power VR stuff still appears listed as experimental. Is there some documentation somewhere that would explain to someone how to go about porting the Rogue 6250 to a different hardware variant of the 6250? I don't really know the difference between BVNC of 4.45.2.58 and 4.40.2.51, but I can't imagine they are drastically different.
adam
Quoted 1,832 lines
Thanks
FrankQuoted 1,828 lines
adam
Quoted 1,822 lines
The features/quirks/enhancements arrays are currently hardcoded in the driver for the supported GPUs. We are looking at moving this information to the firmware image.
Signed-off-by Sarah Walker <[email protected]>--- drivers/gpu/drm/imagination/Makefile | 1 + drivers/gpu/drm/imagination/pvr_device.c | 359 ++++++++++++ drivers/gpu/drm/imagination/pvr_device.h | 221 +++++++ drivers/gpu/drm/imagination/pvr_device_info.c | 223 +++++++ drivers/gpu/drm/imagination/pvr_device_info.h | 133 +++++ drivers/gpu/drm/imagination/pvr_drv.c | 553 +++++++++++++++++- drivers/gpu/drm/imagination/pvr_drv.h | 108 ++++ drivers/gpu/drm/imagination/pvr_fw.h | 20 + 8 files changed, 1617 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/drm/imagination/pvr_device_info.c create mode 100644 drivers/gpu/drm/imagination/pvr_device_info.h create mode 100644 drivers/gpu/drm/imagination/pvr_fw.hdrivers/gpu/drm/imagination/Makefile +1
-0@@ -5,6 +5,7 @@ subdir-ccflags-y := -I$(srctree)/$(src) powervr-y := \ pvr_device.o \ + pvr_device_info.o \ pvr_drv.o \ obj-$(CONFIG_DRM_POWERVR) += powervr.odrivers/gpu/drm/imagination/pvr_device.c +359
-0@@ -2,20 +2,32 @@/* Copyright (c) 2022 Imagination Technologies Ltd. */ #include "pvr_device.h" +#include "pvr_device_info.h" + +#include "pvr_fw.h" +#include "pvr_rogue_cr_defs.h" #include <drm/drm_print.h> +#include <linux/bitfield.h> #include <linux/clk.h> #include <linux/compiler_attributes.h> #include <linux/compiler_types.h> #include <linux/dma-mapping.h> #include <linux/err.h> +#include <linux/firmware.h> #include <linux/gfp.h> +#include <linux/interrupt.h> #include <linux/platform_device.h> +#include <linux/pm_runtime.h> #include <linux/regulator/consumer.h> #include <linux/slab.h> #include <linux/stddef.h> #include <linux/types.h> +#include <linux/workqueue.h> + +/* Major number for the supported version of the firmware. */ +#define PVR_FW_VERSION_MAJOR 1/** * pvr_device_reg_init() - Initialize kernel access to a PowerVR device's @@ -205,6 +217,246 @@ pvr_device_regulator_init(struct pvr_device *pvr_dev)return err; } +/** +* pvr_device_clk_core_get_freq - Get current PowerVR device core clock frequency +* @pvr_dev: Target PowerVR device. +* @freq_out: Pointer to location to store core clock frequency in Hz. +* +* Returns: +* * 0 on success, or +* * -%EINVAL if frequency can not be determined. +*/ +int +pvr_device_clk_core_get_freq (struct pvr_device *pvr_dev,u32 *freq_out) +{ +u32 freq =clk_get_rate (pvr_dev->core_clk); + +if (!freq) +return -EINVAL ; + + *freq_out = freq; +return 0 ; +} + +/** +* pvr_build_firmware_filename() - Construct a PowerVR firmware filename +* @pvr_dev: Target PowerVR device. +* @base: First part of the filename. +* @major: Major version number. +* +* A PowerVR firmware filename consists of three parts separated by underscores +* (``'_'``) along with a '.fw' file suffix. The first part is the exact value +* of @base, the second part is the hardware version string derived from @pvr_fw +* and the final part is the firmware version number constructed from @major with +* a 'v' prefix, e.g. powervr/rogue_4.40.2.51_v1.fw. +* +* The returned string will have been slab allocated and must be freed with +* kfree(). +* +* Return: +* * The constructed filename on success, or +* * Any error returned by kasprintf(). +*/ +static char * +pvr_build_firmware_filename (struct pvr_device *pvr_dev,const char *base, +u8 major) +{ +struct pvr_gpu_id *gpu_id = &pvr_dev->gpu_id; + +return kasprintf (GFP_KERNEL ,"%s_%d.%d.%d.%d_v%d.fw" , base, gpu_id->b, + gpu_id->v, gpu_id->n, gpu_id->c, major); +} + +/** +* pvr_request_firmware() - Load firmware for a PowerVR device +* @pvr_dev: Target PowerVR device. +* +* See pvr_build_firmware_filename() for details on firmware file naming. +* +* Return: +* * 0 on success, +* * Any error returned by pvr_build_firmware_filename(), or +* * Any error returned by request_firmware(). +*/ +static int +pvr_request_firmware (struct pvr_device *pvr_dev) +{ +struct drm_device *drm_dev = &pvr_dev->base; +char *filename; +const struct firmware *fw; +int err; + + filename =pvr_build_firmware_filename (pvr_dev,"powervr/rogue" , +PVR_FW_VERSION_MAJOR ); +if (IS_ERR (filename)) +return PTR_ERR (filename); + +/* +* This function takes a copy of &filename, meaning we can free our +* instance before returning. +*/ + err =request_firmware (&fw, filename, pvr_dev->base.dev); +if (err) { +drm_err (drm_dev,"failed to load firmware %s (err=%d)\n" , + filename, err); + goto err_free_filename; + } + +drm_info (drm_dev,"loaded firmware %s\n" , filename); +kfree (filename); + + pvr_dev->fw_dev.firmware = fw; + +return 0 ; + +err_free_filename: +kfree (filename); + +return err; +} + +/** +* pvr_load_gpu_id() - Load a PowerVR device's GPU ID (BVNC) from control registers. +* +* Sets struct pvr_dev.gpu_id. +* +* @pvr_dev: Target PowerVR device. +*/ +static void +pvr_load_gpu_id (struct pvr_device *pvr_dev) +{ +struct pvr_gpu_id *gpu_id = &pvr_dev->gpu_id; +u64 bvnc; + +/* +* Try reading the BVNC using the newer (cleaner) method first. If the +* B value is zero, fall back to the older method. +*/ + bvnc =PVR_CR_READ64 (pvr_dev,CORE_ID__PBVNC ); + + gpu_id->b =PVR_CR_FIELD_GET (bvnc,CORE_ID__PBVNC__BRANCH_ID ); +if (gpu_id->b !=0 ) { + gpu_id->v =PVR_CR_FIELD_GET (bvnc,CORE_ID__PBVNC__VERSION_ID ); + gpu_id->n =PVR_CR_FIELD_GET (bvnc,CORE_ID__PBVNC__NUMBER_OF_SCALABLE_UNITS ); + gpu_id->c =PVR_CR_FIELD_GET (bvnc,CORE_ID__PBVNC__CONFIG_ID ); + }else { +u32 core_rev =PVR_CR_READ32 (pvr_dev,CORE_REVISION ); +u32 core_id =PVR_CR_READ32 (pvr_dev,CORE_ID ); +u16 core_id_config =PVR_CR_FIELD_GET (core_id,CORE_ID_CONFIG ); + + gpu_id->b =PVR_CR_FIELD_GET (core_rev,CORE_REVISION_MAJOR ); + gpu_id->v =PVR_CR_FIELD_GET (core_rev,CORE_REVISION_MINOR ); + gpu_id->n =FIELD_GET (0xFF00 , core_id_config); + gpu_id->c =FIELD_GET (0x00FF , core_id_config); + } +} + +/** +* pvr_set_dma_info() - Set PowerVR device DMA information +* @pvr_dev: Target PowerVR device. +* +* Sets the DMA mask and max segment size for the PowerVR device. +* +* Return: +* * 0 on success, +* * Any error returned by PVR_FEATURE_VALUE(), or +* * Any error returned by dma_set_mask(). +*/ + +static int +pvr_set_dma_info (struct pvr_device *pvr_dev) +{ +struct drm_device *drm_dev =from_pvr_device (pvr_dev); +u16 phys_bus_width; +int err; + + err =PVR_FEATURE_VALUE (pvr_dev, phys_bus_width, &phys_bus_width); +if (err) { +drm_err (drm_dev,"Failed to get device physical bus width\n" ); +return err; + } + +/* +* See the comment on &pvr_drm_driver.prime_fd_to_handle for an +* explanation of the dma_set_mask function and dma_set_max_seg_size +* calls below. +*/ + err =dma_set_mask (drm_dev->dev,DMA_BIT_MASK (phys_bus_width)); +if (err) { +drm_err (drm_dev,"Failed to set DMA mask (err=%d)\n" , err); +return err; + } + +dma_set_max_seg_size (drm_dev->dev,UINT_MAX ); + +return 0 ; +} + +/** +* pvr_device_gpu_init() - GPU-specific initialization for a PowerVR device +* @pvr_dev: Target PowerVR device. +* +* The following steps are taken to ensure the device is ready: +* +* 1. Read the hardware version information from control registers, +* 2. Initialise the hardware feature information, +* 3. Setup the device DMA information, +* 4. Setup the device-scoped memory context, and +* 5. Load firmware into the device. +* +* Return: +* * 0 on success, +* * -%ENODEV if the GPU is not supported, +* * Any error returned by pvr_set_dma_info(), +* * Any error returned by pvr_memory_context_init(), or +* * Any error returned by pvr_request_firmware(). +*/ +static int +pvr_device_gpu_init (struct pvr_device *pvr_dev) +{ +int err; + +pvr_load_gpu_id (pvr_dev); + + err =pvr_device_info_init (pvr_dev); +if (err) + goto err_out; + +if (PVR_HAS_FEATURE (pvr_dev, meta)) { + pvr_dev->fw_dev.processor_type =PVR_FW_PROCESSOR_TYPE_META ; + }else if (PVR_HAS_FEATURE (pvr_dev, mips)) { + pvr_dev->fw_dev.processor_type =PVR_FW_PROCESSOR_TYPE_MIPS ; + }else if (PVR_HAS_FEATURE (pvr_dev, riscv_fw_processor)) { + pvr_dev->fw_dev.processor_type =PVR_FW_PROCESSOR_TYPE_RISCV ; + }else { + err = -EINVAL ; + goto err_out; + } + + err =pvr_set_dma_info (pvr_dev); +if (err) + goto err_out; + + err =pvr_request_firmware (pvr_dev); +if (err) + goto err_out; + +return 0 ; + +err_out: +return err; +} + +/** +* pvr_device_gpu_fini() - GPU-specific deinitialization for a PowerVR device +* @pvr_dev: Target PowerVR device. +*/ +static void +pvr_device_gpu_fini (struct pvr_device *pvr_dev) +{ +release_firmware (pvr_dev->fw_dev.firmware); +} +/** * pvr_device_init() - Initialize a PowerVR device * @pvr_dev: Target PowerVR device. @@ -240,6 +492,11 @@ pvr_device_init(struct pvr_device *pvr_dev)/* Map the control registers into memory. */ err =pvr_device_reg_init (pvr_dev); +if (err) + goto err_device_clk_fini; + +/* Perform GPU-specific initialization steps. */ + err =pvr_device_gpu_init (pvr_dev);if (err) goto err_device_reg_fini;@@ -266,6 +523,108 @@ pvr_device_fini(struct pvr_device *pvr_dev)* Deinitialization stages are performed in reverse order compared to * the initialization stages in pvr_device_init(). */ +pvr_device_gpu_fini (pvr_dev);pvr_device_reg_fini (pvr_dev);pvr_device_clk_fini (pvr_dev); } + +bool +pvr_device_has_uapi_quirk (struct pvr_device *pvr_dev,u32 quirk) +{ +switch (quirk) { +case 47217 : +return PVR_HAS_QUIRK (pvr_dev,47217 ); +case 48545 : +return PVR_HAS_QUIRK (pvr_dev,48545 ); +case 49927 : +return PVR_HAS_QUIRK (pvr_dev,49927 ); +case 51764 : +return PVR_HAS_QUIRK (pvr_dev,51764 ); +case 62269 : +return PVR_HAS_QUIRK (pvr_dev,62269 ); +default : +return false; + }; +} + +bool +pvr_device_has_uapi_enhancement (struct pvr_device *pvr_dev,u32 enhancement) +{ +switch (enhancement) { +case 35421 : +return PVR_HAS_ENHANCEMENT (pvr_dev,35421 ); +case 42064 : +return PVR_HAS_ENHANCEMENT (pvr_dev,42064 ); +default : +return false; + }; +} + +/** +* pvr_device_has_feature() - Look up device feature based on feature definition +* @pvr_dev: Device pointer. +* @feature: Feature to look up. Should be one of %PVR_FEATURE_*. +* +* Returns: +* * %true if feature is present on device, or +* * %false if feature is not present on device. +*/ +bool +pvr_device_has_feature (struct pvr_device *pvr_dev,u32 feature) +{ +switch (feature) { +case PVR_FEATURE_CLUSTER_GROUPING : +return PVR_HAS_FEATURE (pvr_dev, cluster_grouping); + +case PVR_FEATURE_COMPUTE_MORTON_CAPABLE : +return PVR_HAS_FEATURE (pvr_dev, compute_morton_capable); + +case PVR_FEATURE_FB_CDC_V4 : +return PVR_HAS_FEATURE (pvr_dev, fb_cdc_v4); + +case PVR_FEATURE_GPU_MULTICORE_SUPPORT : +return PVR_HAS_FEATURE (pvr_dev, gpu_multicore_support); + +case PVR_FEATURE_ISP_ZLS_D24_S8_PACKING_OGL_MODE : +return PVR_HAS_FEATURE (pvr_dev, isp_zls_d24_s8_packing_ogl_mode); + +case PVR_FEATURE_S7_TOP_INFRASTRUCTURE : +return PVR_HAS_FEATURE (pvr_dev, s7_top_infrastructure); + +case PVR_FEATURE_TESSELLATION : +return PVR_HAS_FEATURE (pvr_dev, tessellation); + +case PVR_FEATURE_TPU_DM_GLOBAL_REGISTERS : +return PVR_HAS_FEATURE (pvr_dev, tpu_dm_global_registers); + +case PVR_FEATURE_VDM_DRAWINDIRECT : +return PVR_HAS_FEATURE (pvr_dev, vdm_drawindirect); + +case PVR_FEATURE_VDM_OBJECT_LEVEL_LLS : +return PVR_HAS_FEATURE (pvr_dev, vdm_object_level_lls); + +case PVR_FEATURE_ZLS_SUBTILE : +return PVR_HAS_FEATURE (pvr_dev, zls_subtile); + +/* Derived features. */ +case PVR_FEATURE_CDM_USER_MODE_QUEUE : { +u8 cdm_control_stream_format =0 ; + +PVR_FEATURE_VALUE (pvr_dev, cdm_control_stream_format, &cdm_control_stream_format); +return (cdm_control_stream_format >=2 && cdm_control_stream_format <=4 ); + } + +case PVR_FEATURE_REQUIRES_FB_CDC_ZLS_SETUP : +if (PVR_HAS_FEATURE (pvr_dev, fbcdc_algorithm)) { +u8 fbcdc_algorithm =0 ; + +PVR_FEATURE_VALUE (pvr_dev, fbcdc_algorithm, &fbcdc_algorithm); +return (fbcdc_algorithm <3 ||PVR_HAS_FEATURE (pvr_dev, fb_cdc_v4)); + } +return false; + +default : +WARN (true,"Looking up undefined feature %u\n" , feature); +return false; + } +}drivers/gpu/drm/imagination/pvr_device.h +221
-0@@ -4,6 +4,9 @@#ifndef PVR_DEVICE_H #define PVR_DEVICE_H +#include "pvr_device_info.h" +#include "pvr_fw.h" +#include <drm/drm_device.h> #include <drm/drm_file.h> #include <drm/drm_mm.h> @@ -31,6 +34,26 @@ struct firmware;/* Forward declaration from <linux/regulator/consumer.h>. */ struct regulator ; +/** +* struct pvr_gpu_id - Hardware GPU ID information for a PowerVR device +* @b: Branch ID. +* @v: Version ID. +* @n: Number of scalable units. +* @c: Config ID. +*/ +struct pvr_gpu_id { +u16 b, v, n, c; +}; + +/** +* struct pvr_fw_version - Firmware version information +* @major: Major version number. +* @minor: Minor version number. +*/ +struct pvr_fw_version { +u16 major, minor; +}; +/** * struct pvr_device - powervr-specific wrapper for &struct drm_device */ @@ -43,6 +66,35 @@ struct pvr_device {*/ struct drm_device base; +/** @gpu_id: GPU ID detected at runtime. */ +struct pvr_gpu_id gpu_id; + +/** +* @features: Hardware feature information. +* +* Do not access this member directly, instead use PVR_HAS_FEATURE() +* or PVR_FEATURE_VALUE() macros. +*/ +struct pvr_device_features features; + +/** +* @quirks: Hardware quirk information. +* +* Do not access this member directly, instead use PVR_HAS_QUIRK(). +*/ +struct pvr_device_quirks quirks; + +/** +* @enhancements: Hardware enhancement information. +* +* Do not access this member directly, instead use +* PVR_HAS_ENHANCEMENT(). +*/ +struct pvr_device_enhancements enhancements; + +/** @fw_version: Firmware version detected at runtime. */ +struct pvr_fw_version fw_version; +/** @regs_resource: Resource representing device control registers. */ struct resource *regs_resource;@@ -65,6 +117,9 @@ struct pvr_device {/** @regulator: Power regulator. */ struct regulator *regulator; + +/** @fw_dev: Firmware related data. */ +struct pvr_fw_device fw_dev; };/** @@ -85,8 +140,79 @@ struct pvr_file {* to_pvr_device(). */ struct pvr_device *pvr_dev; + }; +/** +* PVR_HAS_FEATURE() - Tests whether a PowerVR device has a given feature +* @pvr_dev: [IN] Target PowerVR device. +* @feature: [IN] Hardware feature name. +* +* Feature names are derived from those found in &struct pvr_device_features by +* dropping the 'has_' prefix, which is applied by this macro. +* +* Return: +* * true if the named feature is present in the hardware +* * false if the named feature is not present in the hardware +*/ +#define PVR_HAS_FEATURE (pvr_dev, feature) ((pvr_dev)->features.has_##feature) + +/** +* PVR_FEATURE_VALUE() - Gets a PowerVR device feature value +* @pvr_dev: [IN] Target PowerVR device. +* @feature: [IN] Feature name. +* @value_out: [OUT] Feature value. +* +* This macro will get a feature value for those features that have values. +* If the feature is not present, nothing will be stored to @value_out. +* +* Feature names are derived from those found in &struct pvr_device_features by +* dropping the 'has_' prefix. +* +* Return: +* * 0 on success, or +* * -%EINVAL if the named feature is not present in the hardware +*/ +#define PVR_FEATURE_VALUE (pvr_dev, feature, value_out) \ + ({ \ + struct pvr_device *_pvr_dev = pvr_dev; \ + int _ret = -EINVAL; \ + if (_pvr_dev->features.has_##feature) { \ + *(value_out) = _pvr_dev->features.feature; \ + _ret = 0; \ + } \ + _ret; \ + }) + +/** +* PVR_HAS_QUIRK() - Tests whether a physical device has a given quirk +* @pvr_dev: [IN] Target PowerVR device. +* @quirk: [IN] Hardware quirk name. +* +* Quirk numbers are derived from those found in #pvr_device_quirks by +* dropping the 'has_brn' prefix, which is applied by this macro. +* +* Returns +* * true if the quirk is present in the hardware, or +* * false if the quirk is not present in the hardware. +*/ +#define PVR_HAS_QUIRK (pvr_dev, quirk) ((pvr_dev)->quirks.has_brn##quirk) + +/** +* PVR_HAS_ENHANCEMENT() - Tests whether a physical device has a given +* enhancement +* @pvr_dev: [IN] Target PowerVR device. +* @enhancement: [IN] Hardware enhancement name. +* +* Enhancement numbers are derived from those found in #pvr_device_enhancements +* by dropping the 'has_ern' prefix, which is applied by this macro. +* +* Returns +* * true if the enhancement is present in the hardware, or +* * false if the enhancement is not present in the hardware. +*/ +#define PVR_HAS_ENHANCEMENT (pvr_dev, enhancement) ((pvr_dev)->enhancements.has_ern##enhancement) + static __always_inline struct drm_device *from_pvr_device (struct pvr_device *pvr_dev) {@@ -111,12 +237,80 @@ to_pvr_file(struct drm_file *file)return file->driver_priv; } +/** +* PVR_PACKED_BVNC() - Packs B, V, N and C values into a 64-bit unsigned integer +* @b: Branch ID. +* @v: Version ID. +* @n: Number of scalable units. +* @c: Config ID. +* +* The packed layout is as follows: +* +* +--------+--------+--------+-------+ +* | 63..48 | 47..32 | 31..16 | 15..0 | +* +========+========+========+=======+ +* | B | V | N | C | +* +--------+--------+--------+-------+ +* +* pvr_gpu_id_to_packed_bvnc() should be used instead of this macro when a +* &struct pvr_gpu_id is available in order to ensure proper type checking. +* +* Return: Packed BVNC. +*/ +/* clang-format off */ +#define PVR_PACKED_BVNC (b, v, n, c) \ + ((((u64)(b) & GENMASK_ULL(15, 0)) << 48) | \ + (((u64)(v) & GENMASK_ULL(15, 0)) << 32) | \ + (((u64)(n) & GENMASK_ULL(15, 0)) << 16) | \ + (((u64)(c) & GENMASK_ULL(15, 0)) << 0)) +/* clang-format on */ + +/** +* pvr_gpu_id_to_packed_bvnc() - Packs B, V, N and C values into a 64-bit +* unsigned integer +* @gpu_id: GPU ID. +* +* The packed layout is as follows: +* +* +--------+--------+--------+-------+ +* | 63..48 | 47..32 | 31..16 | 15..0 | +* +========+========+========+=======+ +* | B | V | N | C | +* +--------+--------+--------+-------+ +* +* This should be used in preference to PVR_PACKED_BVNC() when a &struct +* pvr_gpu_id is available in order to ensure proper type checking. +* +* Return: Packed BVNC. +*/ +static __always_inline u64 +pvr_gpu_id_to_packed_bvnc (struct pvr_gpu_id *gpu_id) +{ +return PVR_PACKED_BVNC (gpu_id->b, gpu_id->v, gpu_id->n, gpu_id->c); +} + +static __always_inline void +packed_bvnc_to_pvr_gpu_id (u64 bvnc,struct pvr_gpu_id *gpu_id) +{ + gpu_id->b = (bvnc &GENMASK_ULL (63 ,48 )) >>48 ; + gpu_id->v = (bvnc &GENMASK_ULL (47 ,32 )) >>32 ; + gpu_id->n = (bvnc &GENMASK_ULL (31 ,16 )) >>16 ; + gpu_id->c = bvnc &GENMASK_ULL (15 ,0 ); +} +int pvr_device_init (struct pvr_device *pvr_dev);void pvr_device_fini (struct pvr_device *pvr_dev);int pvr_device_clk_core_get_freq (struct pvr_device *pvr_dev,u32 *freq_out); +bool +pvr_device_has_uapi_quirk (struct pvr_device *pvr_dev,u32 quirk); +bool +pvr_device_has_uapi_enhancement (struct pvr_device *pvr_dev,u32 enhancement); +bool +pvr_device_has_feature (struct pvr_device *pvr_dev,u32 feature); +/** * PVR_CR_READ32() - Read a 32-bit register from a PowerVR device * @pvr_dev: Target PowerVR device. @@ -286,6 +480,29 @@ pvr_cr_poll_reg64(struct pvr_device *pvr_dev, u32 reg_addr, u64 reg_value, (value & reg_mask) == reg_value, 0, timeout_usec); } +/** +* pvr_round_up_to_cacheline_size() - Round up a provided size to be cacheline +* aligned +* @pvr_dev: Target PowerVR device. +* @size: Initial size, in bytes. +* +* Returns: +* * Size aligned to cacheline size. +*/ +static __always_inline size_t +pvr_round_up_to_cacheline_size (struct pvr_device *pvr_dev,size_t size) +{ +u16 slc_cacheline_size_in_bits =0 ; +u16 slc_cacheline_size_in_bytes; + +WARN_ON (!PVR_HAS_FEATURE (pvr_dev, slc_cache_line_size_in_bits)); +PVR_FEATURE_VALUE (pvr_dev, slc_cache_line_size_in_bits, + &slc_cacheline_size_in_bits); + slc_cacheline_size_in_bytes = slc_cacheline_size_in_bits /8 ; + +return round_up (size, slc_cacheline_size_in_bytes); +} +/** * DOC: IOCTL validation helpers * @@ -380,4 +597,8 @@ pvr_ioctl_union_padding_check(void *instance, size_t union_offset, __union_size, __member_size); \ }) +#define PVR_FW_PROCESSOR_TYPE_META 0 +#define PVR_FW_PROCESSOR_TYPE_MIPS 1 +#define PVR_FW_PROCESSOR_TYPE_RISCV 2 +#endif /* PVR_DEVICE_H */ drivers/gpu/drm/imagination/pvr_device_info.c new file +223
-0@@ -0,0 +1,223 @@ +// SPDX-License-Identifier: GPL-2.0 OR MIT +/* Copyright (c) 2022 Imagination Technologies Ltd. */ + +#include "pvr_device.h" +#include "pvr_device_info.h" + +#include <drm/drm_print.h> + +#include <linux/types.h> + +static const struct pvr_device_features pvr_device_4_V_2_51 = { + .has_cdm_control_stream_format = true, + .has_cluster_grouping = true, + .has_common_store_size_in_dwords = true, + .has_compute = true, + .has_compute_morton_capable = true, + .has_compute_overlap = true, + .has_fbcdc_algorithm = true, + .has_isp_max_tiles_in_flight = true, + .has_isp_samples_per_pixel = true, + .has_max_partitions = true, + .has_meta = true, + .has_meta_coremem_size = true, + .has_num_clusters = true, + .has_num_isp_ipp_pipes = true, + .has_num_raster_pipes = true, + .has_phys_bus_width = true, + .has_slc_cache_line_size_in_bits = true, + .has_tile_size_x = true, + .has_tile_size_y = true, + .has_usc_min_output_registers_per_pix = true, + .has_virtual_address_space_bits = true, + .has_xt_top_infrastructure = true, + .has_zls_subtile = true, + + .cdm_control_stream_format =1 , + .common_store_size_in_dwords =1280U *4U *4U , + .fbcdc_algorithm =2 , + .isp_max_tiles_in_flight =4 , + .isp_samples_per_pixel =2 , + .max_partitions =8 , + .meta = true, + .meta_coremem_size =32 , + .num_clusters =2 , + .num_isp_ipp_pipes =8 , + .num_raster_pipes =1 , + .phys_bus_width =40 , + .slc_cache_line_size_in_bits =512 , + .tile_size_x =32 , + .tile_size_y =32 , + .usc_min_output_registers_per_pix =2 , + .virtual_address_space_bits =40 , +}; + +static const struct pvr_device_quirks pvr_device_quirks_4_40_2_51 = { + .has_brn44079 = true, + .has_brn48492 = true, + .has_brn48545 = true, + .has_brn49927 = true, + .has_brn51764 = true, + .has_brn52354 = true, + .has_brn62269 = true, + .has_brn63142 = true, + .has_brn66011 = true, +}; + +static const struct pvr_device_enhancements pvr_device_enhancements_4_40_2_51 = { + .has_ern35421 = true, + .has_ern38020 = true, + .has_ern38748 = true, + .has_ern42064 = true, +}; + +static const struct pvr_device_features pvr_device_33_V_11_3 = { + .has_cdm_control_stream_format = true, + .has_common_store_size_in_dwords = true, + .has_compute = true, + .has_isp_max_tiles_in_flight = true, + .has_isp_samples_per_pixel = true, + .has_max_partitions = true, + .has_mips = true, + .has_num_clusters = true, + .has_num_isp_ipp_pipes = true, + .has_num_raster_pipes = true, + .has_phys_bus_width = true, + .has_roguexe = true, + .has_simple_internal_parameter_format = true, + .has_slc_cache_line_size_in_bits = true, + .has_sys_bus_secure_reset = true, + .has_tile_size_x = true, + .has_tile_size_y = true, + .has_usc_min_output_registers_per_pix = true, + .has_virtual_address_space_bits = true, + .has_xe_memory_hierarchy = true, + + .cdm_control_stream_format =1 , + .common_store_size_in_dwords =512U *4U *4U , + .isp_max_tiles_in_flight =1 , + .isp_samples_per_pixel =1 , + .max_partitions =4 , + .mips = true, + .num_clusters =1 , + .num_isp_ipp_pipes =1 , + .num_raster_pipes =1 , + .phys_bus_width =36 , + .simple_internal_parameter_format =2 , + .slc_cache_line_size_in_bits =512 , + .tile_size_x =16 , + .tile_size_y =16 , + .usc_min_output_registers_per_pix =1 , + .virtual_address_space_bits =40 , +}; + +static const struct pvr_device_quirks pvr_device_quirks_33_15_11_3 = { + .has_brn63553 = true, +}; + +static const struct pvr_device_enhancements pvr_device_enhancements_33_15_11_3 = { + .has_ern35421 = true, + .has_ern38748 = true, +}; + +static const struct pvr_device_features pvr_device_36_V_104_796 = { + .has_cdm_control_stream_format = true, + .has_common_store_size_in_dwords = true, + .has_compute = true, + .has_compute_overlap = true, + .has_fbcdc_algorithm = true, + .has_gpu_multicore_support = true, + .has_isp_max_tiles_in_flight = true, + .has_isp_samples_per_pixel = true, + .has_max_partitions = true, + .has_num_clusters = true, + .has_num_isp_ipp_pipes = true, + .has_num_raster_pipes = true, + .has_phys_bus_width = true, + .has_riscv_fw_processor = true, + .has_roguexe = true, + .has_simple_internal_parameter_format = true, + .has_slc_cache_line_size_in_bits = true, + .has_sys_bus_secure_reset = true, + .has_tile_size_x = true, + .has_tile_size_y = true, + .has_tpu_dm_global_registers = true, + .has_usc_min_output_registers_per_pix = true, + .has_virtual_address_space_bits = true, + .has_xe_memory_hierarchy = true, + .has_xpu_max_slaves = true, + + .cdm_control_stream_format =1 , + .common_store_size_in_dwords =1344U *4U *4U , + .fbcdc_algorithm =50 , + .isp_max_tiles_in_flight =6 , + .isp_samples_per_pixel =4 , + .max_partitions =16 , + .num_clusters =1 , + .num_isp_ipp_pipes =6 , + .num_raster_pipes =1 , + .phys_bus_width =36 , + .riscv_fw_processor = true, + .simple_internal_parameter_format =2 , + .slc_cache_line_size_in_bits =512 , + .tile_size_x =16 , + .tile_size_y =16 , + .usc_min_output_registers_per_pix =2 , + .virtual_address_space_bits =40 , + .xpu_max_slaves =3 , +}; + +static const struct pvr_device_quirks pvr_device_quirks_36_53_104_796 = { + .has_brn44079 = true, +}; + +static const struct pvr_device_enhancements pvr_device_enhancements_36_53_104_796 = { + .has_ern35421 = true, + .has_ern38748 = true, +}; + +/** +* pvr_device_info_init() - Initialize a PowerVR device's hardware features and quirks +* @pvr_dev: Target PowerVR device. +* +* This function relies on &pvr_dev.gpu_id having already been initialized. If +* PowerVR device version is supported then sets &pvr_dev.features and &pvr_dev.quirks. +* +* Return: +* * 0 on success, or +* * -%ENODEV if the device is not supported. +*/ +int +pvr_device_info_init (struct pvr_device *pvr_dev) +{ +struct drm_device *drm_dev =from_pvr_device (pvr_dev); +struct pvr_gpu_id *gpu_id = &pvr_dev->gpu_id; +const u64 bvnc =pvr_gpu_id_to_packed_bvnc (gpu_id); + +/* +* This macro results in a "Macros with multiple statements should be +* enclosed in a do - while loop" checkpatch error. However, following +* this advice would make the macro look a bit odd and isn't necessary +* in this particular case, as the macro has a very specific use and a +* very limited lifetime. The error can therefore be ignored. +*/ +#define CASE_PACKED_BVNC_DEVICE_INFO (b, v, n, c) \ + case PVR_PACKED_BVNC(b, v, n, c): \ + pvr_dev->features = pvr_device_##b##_V_##n##_##c; \ + pvr_dev->quirks = pvr_device_quirks_##b##_##v##_##n##_##c; \ + pvr_dev->enhancements = pvr_device_enhancements_##b##_##v##_##n##_##c; \ + return 0 + +switch (bvnc) { +CASE_PACKED_BVNC_DEVICE_INFO (4 ,40 ,2 ,51 ); +CASE_PACKED_BVNC_DEVICE_INFO (33 ,15 ,11 ,3 ); +CASE_PACKED_BVNC_DEVICE_INFO (36 ,53 ,104 ,796 ); + } + +#undef CASE_PACKED_BVNC_DEVICE_INFO + +drm_warn (drm_dev,"Unsupported BVNC: %u.%u.%u.%u\n" , gpu_id->b, + gpu_id->v, gpu_id->n, gpu_id->c); + +return -ENODEV ; +}drivers/gpu/drm/imagination/pvr_device_info.h new file +133
-0@@ -0,0 +1,133 @@ +/* SPDX-License-Identifier: GPL-2.0 OR MIT */ +/* Copyright (c) 2022 Imagination Technologies Ltd. */ + +#ifndef PVR_DEVICE_INFO_H +#define PVR_DEVICE_INFO_H + +#include <linux/types.h> + +struct pvr_device ; + +/* +* struct pvr_device_features - Hardware feature information +*/ +struct pvr_device_features { +bool has_cdm_control_stream_format :1 ; +bool has_cluster_grouping :1 ; +bool has_common_store_size_in_dwords :1 ; +bool has_compute :1 ; +bool has_compute_morton_capable :1 ; +bool has_compute_overlap :1 ; +bool has_fb_cdc_v4 :1 ; +bool has_fbcdc_algorithm :1 ; +bool has_gpu_multicore_support :1 ; +bool has_isp_max_tiles_in_flight :1 ; +bool has_isp_samples_per_pixel :1 ; +bool has_isp_zls_d24_s8_packing_ogl_mode :1 ; +bool has_max_partitions :1 ; +bool has_meta :1 ; +bool has_meta_coremem_size :1 ; +bool has_mips :1 ; +bool has_num_clusters :1 ; +bool has_num_isp_ipp_pipes :1 ; +bool has_num_raster_pipes :1 ; +bool has_phys_bus_width :1 ; +bool has_riscv_fw_processor :1 ; +bool has_roguexe :1 ; +bool has_s7_top_infrastructure :1 ; +bool has_simple_internal_parameter_format :1 ; +bool has_slc_cache_line_size_in_bits :1 ; +bool has_sys_bus_secure_reset :1 ; +bool has_tessellation :1 ; +bool has_tile_size_x :1 ; +bool has_tile_size_y :1 ; +bool has_tpu_dm_global_registers :1 ; +bool has_usc_min_output_registers_per_pix :1 ; +bool has_vdm_drawindirect :1 ; +bool has_vdm_object_level_lls :1 ; +bool has_virtual_address_space_bits :1 ; +bool has_xe_memory_hierarchy :1 ; +bool has_xpu_max_slaves :1 ; +bool has_xt_top_infrastructure :1 ; +bool has_zls_subtile :1 ; + +u8 cdm_control_stream_format; +u32 common_store_size_in_dwords; +u8 fbcdc_algorithm; +u16 isp_max_tiles_in_flight; +bool isp_samples_per_pixel; +u16 max_partitions; +bool meta; +u32 meta_coremem_size; +bool mips; +u16 num_clusters; +u8 num_isp_ipp_pipes; +u8 num_raster_pipes; +u16 phys_bus_width; +bool riscv_fw_processor; +u32 simple_internal_parameter_format; +u16 slc_cache_line_size_in_bits; +u16 tile_size_x; +u16 tile_size_y; +u16 usc_min_output_registers_per_pix; +u16 virtual_address_space_bits; +u8 xpu_max_slaves; +}; + +/* +* struct pvr_device_quirks - Hardware quirk information +*/ +struct pvr_device_quirks { +bool has_brn44079 :1 ; +bool has_brn47217 :1 ; +bool has_brn48492 :1 ; +bool has_brn48545 :1 ; +bool has_brn49927 :1 ; +bool has_brn51764 :1 ; +bool has_brn52354 :1 ; +bool has_brn62269 :1 ; +bool has_brn63142 :1 ; +bool has_brn63553 :1 ; +bool has_brn66011 :1 ; +}; + +/* +* struct pvr_device_enhancements - Hardware enhancement information +*/ +struct pvr_device_enhancements { +bool has_ern35421 :1 ; +bool has_ern38020 :1 ; +bool has_ern38748 :1 ; +bool has_ern42064 :1 ; +}; + +int pvr_device_info_init (struct pvr_device *pvr_dev); + +/* +* Meta cores +* +* These are the values for the 'meta' feature when the feature is present +* (as per &struct pvr_device_features)/ +*/ +#define PVR_META_MTP218 (1) +#define PVR_META_MTP219 (2) +#define PVR_META_LTP218 (3) +#define PVR_META_LTP217 (4) + +enum { +PVR_FEATURE_CDM_USER_MODE_QUEUE , +PVR_FEATURE_CLUSTER_GROUPING , +PVR_FEATURE_COMPUTE_MORTON_CAPABLE , +PVR_FEATURE_FB_CDC_V4 , +PVR_FEATURE_GPU_MULTICORE_SUPPORT , +PVR_FEATURE_ISP_ZLS_D24_S8_PACKING_OGL_MODE , +PVR_FEATURE_REQUIRES_FB_CDC_ZLS_SETUP , +PVR_FEATURE_S7_TOP_INFRASTRUCTURE , +PVR_FEATURE_TESSELLATION , +PVR_FEATURE_TPU_DM_GLOBAL_REGISTERS , +PVR_FEATURE_VDM_DRAWINDIRECT , +PVR_FEATURE_VDM_OBJECT_LEVEL_LLS , +PVR_FEATURE_ZLS_SUBTILE , +}; + +#endif /* PVR_DEVICE_INFO_H */ drivers/gpu/drm/imagination/pvr_drv.c +552
-1@@ -3,6 +3,9 @@#include "pvr_device.h" #include "pvr_drv.h" +#include "pvr_rogue_defs.h" +#include "pvr_rogue_fwif_client.h" +#include "pvr_rogue_fwif_shared.h" #include <uapi/drm/pvr_drm.h> @@ -88,6 +91,422 @@ pvr_ioctl_get_bo_mmap_offset(__always_unused struct drm_device *drm_dev,return -ENOTTY ; } +static __always_inline u64 +pvr_fw_version_packed (u32 major,u32 minor) +{ +return ((u64 )major <<32 ) | minor; +} + +static u32 +rogue_get_common_store_partition_space_size (struct pvr_device *pvr_dev) +{ +u32 max_partitions =0 ; +u32 tile_size_x =0 ; +u32 tile_size_y =0 ; + +PVR_FEATURE_VALUE (pvr_dev, tile_size_x, &tile_size_x); +PVR_FEATURE_VALUE (pvr_dev, tile_size_y, &tile_size_y); +PVR_FEATURE_VALUE (pvr_dev, max_partitions, &max_partitions); + +if (tile_size_x ==16 && tile_size_y ==16 ) { +u32 usc_min_output_registers_per_pix =0 ; + +PVR_FEATURE_VALUE (pvr_dev, usc_min_output_registers_per_pix, + &usc_min_output_registers_per_pix); + +return tile_size_x * tile_size_y * max_partitions * + usc_min_output_registers_per_pix; + } + +return max_partitions *1024 ; +} + +static u32 +rogue_get_common_store_alloc_region_size (struct pvr_device *pvr_dev) +{ +u32 common_store_size_in_dwords =512 *4 *4 ; +u32 alloc_region_size; + +PVR_FEATURE_VALUE (pvr_dev, common_store_size_in_dwords, &common_store_size_in_dwords); + + alloc_region_size = common_store_size_in_dwords - (256U *4U ) - +rogue_get_common_store_partition_space_size (pvr_dev); + +if (PVR_HAS_QUIRK (pvr_dev,44079 )) { +u32 common_store_split_point = (768U *4U *4U ); + +return min (common_store_split_point - (256U *4U ), alloc_region_size); + } + +return alloc_region_size; +} + +static inline u32 +rogue_get_num_phantoms (struct pvr_device *pvr_dev) +{ +u32 num_clusters =1 ; + +PVR_FEATURE_VALUE (pvr_dev, num_clusters, &num_clusters); + +return ROGUE_REQ_NUM_PHANTOMS (num_clusters); +} + +static inline u32 +rogue_get_max_coeffs (struct pvr_device *pvr_dev) +{ +u32 max_coeff_additional_portion =ROGUE_MAX_VERTEX_SHARED_REGISTERS ; +u32 pending_allocation_shared_regs =2U *1024U ; +u32 pending_allocation_coeff_regs =0U ; +u32 num_phantoms =rogue_get_num_phantoms (pvr_dev); +u32 tiles_in_flight =0 ; +u32 max_coeff_pixel_portion; + +PVR_FEATURE_VALUE (pvr_dev, isp_max_tiles_in_flight, &tiles_in_flight); + max_coeff_pixel_portion =DIV_ROUND_UP (tiles_in_flight, num_phantoms); + max_coeff_pixel_portion *=ROGUE_MAX_PIXEL_SHARED_REGISTERS ; + +/* +* Compute tasks on cores with BRN48492 and without compute overlap may lock +* up without two additional lines of coeffs. +*/ +if (PVR_HAS_QUIRK (pvr_dev,48492 ) && !PVR_HAS_FEATURE (pvr_dev, compute_overlap)) + pending_allocation_coeff_regs =2U *1024U ; + +if (PVR_HAS_ENHANCEMENT (pvr_dev,38748 )) + pending_allocation_shared_regs =0 ; + +if (PVR_HAS_ENHANCEMENT (pvr_dev,38020 )) + max_coeff_additional_portion +=ROGUE_MAX_COMPUTE_SHARED_REGISTERS ; + +return rogue_get_common_store_alloc_region_size (pvr_dev) + pending_allocation_coeff_regs - + (max_coeff_pixel_portion + max_coeff_additional_portion + + pending_allocation_shared_regs); +} + +static inline u32 +rogue_get_cdm_max_local_mem_size_regs (struct pvr_device *pvr_dev) +{ +u32 available_coeffs_in_dwords =rogue_get_max_coeffs (pvr_dev); + +if (PVR_HAS_QUIRK (pvr_dev,48492 ) &&PVR_HAS_FEATURE (pvr_dev, roguexe) && + !PVR_HAS_FEATURE (pvr_dev, compute_overlap)) { +/* Driver must not use the 2 reserved lines. */ + available_coeffs_in_dwords -=ROGUE_CSRM_LINE_SIZE_IN_DWORDS *2 ; + } + +/* +* The maximum amount of local memory available to a kernel is the minimum +* of the total number of coefficient registers available and the max common +* store allocation size which can be made by the CDM. +* +* If any coeff lines are reserved for tessellation or pixel then we need to +* subtract those too. +*/ +return min (available_coeffs_in_dwords, (u32 )ROGUE_MAX_PER_KERNEL_LOCAL_MEM_SIZE_REGS ); +} + +/** +* pvr_dev_query_gpu_info_get() +* @pvr_dev: Device pointer. +* @args: [IN] Device query arguments containing a pointer to a userspace +* struct drm_pvr_dev_query_gpu_info. +* +* If the query object pointer is NULL, the size field is updated with the +* expected size of the query object. +* +* Returns: +* * 0 on success, or if size is requested using a NULL pointer, or +* * -%E2BIG if the indicated length of the allocation is less than is +* required to contain the copied data, or +* * -%EFAULT if local memory could not be copied to userspace. +*/ +static int +pvr_dev_query_gpu_info_get (struct pvr_device *pvr_dev, +struct drm_pvr_ioctl_dev_query_args *args) +{ +struct drm_pvr_dev_query_gpu_info gpu_info = {0 }; +int err; + +if (!args->pointer) { + args->size =sizeof (struct drm_pvr_dev_query_gpu_info ); +return 0 ; + } + + gpu_info.gpu_id = +pvr_gpu_id_to_packed_bvnc (&pvr_dev->gpu_id); + gpu_info.num_phantoms =rogue_get_num_phantoms (pvr_dev); + + err =PVR_UOBJ_SET (args->pointer, args->size, gpu_info); +if (err <0 ) +return err; + +if (args->size >sizeof (gpu_info)) + args->size =sizeof (gpu_info); +return 0 ; +} + +/** +* pvr_dev_query_runtime_info_get() +* @pvr_dev: Device pointer. +* @args: [IN] Device query arguments containing a pointer to a userspace +* struct drm_pvr_dev_query_runtime_info. +* +* If the query object pointer is NULL, the size field is updated with the +* expected size of the query object. +* +* Returns: +* * 0 on success, or if size is requested using a NULL pointer, or +* * -%E2BIG if the indicated length of the allocation is less than is +* required to contain the copied data, or +* * -%EFAULT if local memory could not be copied to userspace. +*/ +static int +pvr_dev_query_runtime_info_get (struct pvr_device *pvr_dev, +struct drm_pvr_ioctl_dev_query_args *args) +{ +struct drm_pvr_dev_query_runtime_info runtime_info = {0 }; +int err; + +if (!args->pointer) { + args->size =sizeof (struct drm_pvr_dev_query_runtime_info ); +return 0 ; + } + + runtime_info.free_list_min_pages =0 ;/* FIXME */ + runtime_info.free_list_max_pages = +ROGUE_PM_MAX_FREELIST_SIZE /ROGUE_PM_PAGE_SIZE ; + runtime_info.common_store_alloc_region_size = +rogue_get_common_store_alloc_region_size (pvr_dev); + runtime_info.common_store_partition_space_size = +rogue_get_common_store_partition_space_size (pvr_dev); + runtime_info.max_coeffs =rogue_get_max_coeffs (pvr_dev); + runtime_info.cdm_max_local_mem_size_regs = +rogue_get_cdm_max_local_mem_size_regs (pvr_dev); + + err =PVR_UOBJ_SET (args->pointer, args->size, runtime_info); +if (err <0 ) +return err; + +if (args->size >sizeof (runtime_info)) + args->size =sizeof (runtime_info); +return 0 ; +} + +/** +* pvr_dev_query_hwrt_info_get() +* @pvr_dev: Device pointer. +* @args: [IN] Device query arguments containing a pointer to a userspace +* struct drm_pvr_dev_query_hwrt_info. +* +* If the query object pointer is NULL, the size field is updated with the +* expected size of the query object. +* +* Returns: +* * 0 on success, or if size is requested using a NULL pointer, or +* * -%E2BIG if the indicated length of the allocation is less than is +* required to contain the copied data, or +* * -%EFAULT if local memory could not be copied to userspace. +*/ +static int +pvr_dev_query_hwrt_info_get (struct pvr_device *pvr_dev, +struct drm_pvr_ioctl_dev_query_args *args) +{ +struct drm_pvr_dev_query_hwrt_info hwrt_info = {0 }; +int err; + +if (!args->pointer) { + args->size =sizeof (struct drm_pvr_dev_query_hwrt_info ); +return 0 ; + } + + hwrt_info.num_geomdatas =ROGUE_FWIF_NUM_GEOMDATAS ; + hwrt_info.num_rtdatas =ROGUE_FWIF_NUM_RTDATAS ; + hwrt_info.num_freelists =ROGUE_FWIF_NUM_RTDATA_FREELISTS ; + + err =PVR_UOBJ_SET (args->pointer, args->size, hwrt_info); +if (err <0 ) +return err; + +if (args->size >sizeof (hwrt_info)) + args->size =sizeof (hwrt_info); +return 0 ; +} + +/** +* pvr_dev_query_quirks_get() - Unpack array of quirks at the address given +* in a struct drm_pvr_dev_query_quirks, or gets the amount of space required +* for it. +* @pvr_dev: Device pointer. +* @args: [IN] Device query arguments containing a pointer to a userspace +* struct drm_pvr_dev_query_query_quirks. +* +* If the query object pointer is NULL, the size field is updated with the +* expected size of the query object. +* If the userspace pointer in the query object is NULL, or the count is +* short, no data is copied. +* The count field will be updated to that copied, or if either pointer is +* NULL, that which would have been copied. +* The size field in the query object will be updated to the size copied. +* +* Returns: +* * 0 on success, or if size/count is requested using a NULL pointer, or +* * -%EINVAL if args contained non-zero reserved fields, or +* * -%E2BIG if the indicated length of the allocation is less than is +* required to contain the copied data, or +* * -%EFAULT if local memory could not be copied to userspace. +*/ +static int +pvr_dev_query_quirks_get (struct pvr_device *pvr_dev, +struct drm_pvr_ioctl_dev_query_args *args) +{ +/* +* @FIXME - hardcoding of numbers here is intended as an +* intermediate step so the UAPI can be fixed, but requires a +* a refactor in the future to store them in a more appropriate +* location +*/ +static const u32 umd_quirks_musthave[] = { +47217 , +49927 , +62269 , + }; +static const u32 umd_quirks[] = { +48545 , +51764 , + }; +struct drm_pvr_dev_query_quirks query; +u32 out[ARRAY_SIZE (umd_quirks_musthave) +ARRAY_SIZE (umd_quirks)]; +size_t out_musthave_count =0 ; +size_t out_count =0 ; +int err; + +if (!args->pointer) { + args->size =sizeof (struct drm_pvr_dev_query_quirks ); +return 0 ; + } + + err =PVR_UOBJ_GET (query, args->size, args->pointer); + +if (err <0 ) +return err; +if (query._padding_c) +return -EINVAL ; + +for (int i =0 ; i <ARRAY_SIZE (umd_quirks_musthave); i++) { +if (pvr_device_has_uapi_quirk (pvr_dev, umd_quirks_musthave[i])) { + out[out_count++] = umd_quirks_musthave[i]; + out_musthave_count++; + } + } + +for (int i =0 ; i <ARRAY_SIZE (umd_quirks); i++) { +if (pvr_device_has_uapi_quirk (pvr_dev, umd_quirks[i])) + out[out_count++] = umd_quirks[i]; + } + +if (!query.quirks) + goto copy_out; +if (query.count < out_count) +return -E2BIG ; + +if (copy_to_user (u64_to_user_ptr (query.quirks), out, + out_count *sizeof (u32))) { +return -EFAULT ; + } + + query.musthave_count = out_musthave_count; + +copy_out: + query.count = out_count; + err =PVR_UOBJ_SET (args->pointer, args->size, query); +if (err <0 ) +return err; + + args->size =sizeof (query); +return 0 ; +} + +/** +* pvr_dev_query_enhancements_get() - Unpack array of enhancements at the +* address given in a struct drm_pvr_dev_query_enhancements, or gets the amount +* of space required for it. +* @pvr_dev: Device pointer. +* @args: [IN] Device query arguments containing a pointer to a userspace +* struct drm_pvr_dev_query_enhancements. +* +* If the query object pointer is NULL, the size field is updated with the +* expected size of the query object. +* If the userspace pointer in the query object is NULL, or the count is +* short, no data is copied. +* The count field will be updated to that copied, or if either pointer is +* NULL, that which would have been copied. +* The size field in the query object will be updated to the size copied. +* +* Returns: +* * 0 on success, or if size/count is requested using a NULL pointer, or +* * -%EINVAL if args contained non-zero reserved fields, or +* * -%E2BIG if the indicated length of the allocation is less than is +* required to contain the copied data, or +* * -%EFAULT if local memory could not be copied to userspace. +*/ +static int +pvr_dev_query_enhancements_get (struct pvr_device *pvr_dev, +struct drm_pvr_ioctl_dev_query_args *args) +{ +/* +* @FIXME - hardcoding of numbers here is intended as an +* intermediate step so the UAPI can be fixed, but requires a +* a refactor in the future to store them in a more appropriate +* location +*/ +const u32 umd_enhancements[] = { +35421 , +42064 , + }; +struct drm_pvr_dev_query_enhancements query; +u32 out[ARRAY_SIZE (umd_enhancements)]; +size_t out_idx =0 ; +int err; + +if (!args->pointer) { + args->size =sizeof (struct drm_pvr_dev_query_enhancements ); +return 0 ; + } + + err =PVR_UOBJ_GET (query, args->size, args->pointer); + +if (err <0 ) +return err; +if (query._padding_a) +return -EINVAL ; +if (query._padding_c) +return -EINVAL ; + +for (int i =0 ; i <ARRAY_SIZE (umd_enhancements); i++) { +if (pvr_device_has_uapi_enhancement (pvr_dev, umd_enhancements[i])) + out[out_idx++] = umd_enhancements[i]; + } + +if (!query.enhancements) + goto copy_out; +if (query.count < out_idx) +return -E2BIG ; + +if (copy_to_user (u64_to_user_ptr (query.enhancements), out, + out_idx *sizeof (u32))) { +return -EFAULT ; + } + +copy_out: + query.count = out_idx; + err =PVR_UOBJ_SET (args->pointer, args->size, query); +if (err <0 ) +return err; + + args->size =sizeof (query); +return 0 ; +} +/** * pvr_ioctl_dev_query() - IOCTL to copy information about a device * @drm_dev: [IN] DRM device. @@ -112,7 +531,33 @@ static int pvr_ioctl_dev_query(struct drm_device *drm_dev, void *raw_args, struct drm_file *file) { - return -ENOTTY; + struct pvr_device *pvr_dev = to_pvr_device(drm_dev); +struct drm_pvr_ioctl_dev_query_args *args = raw_args; + +switch ((enum drm_pvr_dev_query )args->type) { +case DRM_PVR_DEV_QUERY_GPU_INFO_GET : +return pvr_dev_query_gpu_info_get (pvr_dev, args); + +case DRM_PVR_DEV_QUERY_RUNTIME_INFO_GET : +return pvr_dev_query_runtime_info_get (pvr_dev, args); + +case DRM_PVR_DEV_QUERY_HWRT_INFO_GET : +return pvr_dev_query_hwrt_info_get (pvr_dev, args); + +case DRM_PVR_DEV_QUERY_QUIRKS_GET : +return pvr_dev_query_quirks_get (pvr_dev, args); + +case DRM_PVR_DEV_QUERY_ENHANCEMENTS_GET : +return pvr_dev_query_enhancements_get (pvr_dev, args); + +case DRM_PVR_DEV_QUERY_HEAP_INFO_GET : +return -EINVAL ; + +case DRM_PVR_DEV_QUERY_STATIC_DATA_AREAS_GET : +return -EINVAL ; + } + +return -EINVAL ; }/** @@ -350,6 +795,112 @@ pvr_ioctl_submit_jobs(struct drm_device *drm_dev, void *raw_args,return -ENOTTY ; } +int +pvr_get_uobj (u64 usr_ptr,u32 usr_stride,u32 min_stride,u32 obj_size,void *out) +{ +if (usr_stride < min_stride) +return -EINVAL ; + +return copy_struct_from_user (out, obj_size,u64_to_user_ptr (usr_ptr), usr_stride); +} + +int +pvr_set_uobj (u64 usr_ptr,u32 usr_stride,u32 min_stride,u32 obj_size,const void *in) +{ +if (usr_stride < min_stride) +return -EINVAL ; + +if (copy_to_user (u64_to_user_ptr (usr_ptr), in,min_t (u32, usr_stride, obj_size))) +return -EFAULT ; + +if (usr_stride > obj_size && +clear_user (u64_to_user_ptr (usr_ptr + obj_size), usr_stride - obj_size)) { +return -EFAULT ; + } + +return 0 ; +} + +int +pvr_get_uobj_array (const struct drm_pvr_obj_array *in,u32 min_stride,u32 obj_size,void **out) +{ +int ret =0 ; +void *out_alloc; + +if (in->stride < min_stride) +return -EINVAL ; + +if (!in->count) +return 0 ; + + out_alloc =kvmalloc_array (in->count, obj_size,GFP_KERNEL ); +if (!out_alloc) +return -ENOMEM ; + +if (obj_size == in->stride) { +if (copy_from_user (out_alloc,u64_to_user_ptr (in->array), + (unsigned long )obj_size * in->count)) + ret = -EFAULT ; + }else { +void __user *in_ptr =u64_to_user_ptr (in->array); +void *out_ptr = out_alloc; + +for (u32 i =0 ; i < in->count; i++) { + ret =copy_struct_from_user (out_ptr, obj_size, in_ptr, in->stride); +if (ret) +break ; + + out_ptr += obj_size; + in_ptr += in->stride; + } + } + +if (ret) { +kvfree (out_alloc); +return ret; + } + + *out = out_alloc; +return 0 ; +} + +int +pvr_set_uobj_array (const struct drm_pvr_obj_array *out,u32 min_stride,u32 obj_size, +const void *in) +{ +if (out->stride < min_stride) +return -EINVAL ; + +if (!out->count) +return 0 ; + +if (obj_size == out->stride) { +if (copy_to_user (u64_to_user_ptr (out->array), in, + (unsigned long )obj_size * out->count)) +return -EFAULT ; + }else { +u32 cpy_elem_size =min_t (u32, out->stride, obj_size); +void __user *out_ptr =u64_to_user_ptr (out->array); +const void *in_ptr = in; + +for (u32 i =0 ; i < out->count; i++) { +if (copy_to_user (out_ptr, in_ptr, cpy_elem_size)) +return -EFAULT ; + + out_ptr += obj_size; + in_ptr += out->stride; + } + +if (out->stride > obj_size && +clear_user (u64_to_user_ptr (out->array + obj_size), + out->stride - obj_size)) { +return -EFAULT ; + } + } + +return 0 ; +} +#define DRM_PVR_IOCTL (_name, _func, _flags) \ DRM_IOCTL_DEF_DRV(PVR_##_name, pvr_ioctl_##_func, _flags)drivers/gpu/drm/imagination/pvr_drv.h +108
-0@@ -19,4 +19,112 @@#define PVR_DRIVER_MINOR 0#define PVR_DRIVER_PATCHLEVEL 0 +int pvr_get_uobj (u64 usr_ptr,u32 usr_size,u32 min_size,u32 obj_size,void *out); +int pvr_set_uobj (u64 usr_ptr,u32 usr_size,u32 min_size,u32 obj_size,const void *in); +int pvr_get_uobj_array (const struct drm_pvr_obj_array *in,u32 min_stride,u32 obj_size, +void **out); +int pvr_set_uobj_array (const struct drm_pvr_obj_array *out,u32 min_stride,u32 obj_size, +const void *in); + +#define PVR_UOBJ_MIN_SIZE_INTERNAL (_typename, _last_mandatory_field) \ + (offsetof(_typename, _last_mandatory_field) + \ + sizeof(((_typename *)NULL)->_last_mandatory_field)) + +/* NOLINTBEGIN(bugprone-macro-parentheses) */ +#define PVR_UOBJ_DECL (_typename, _last_mandatory_field) \ + , _typename : PVR_UOBJ_MIN_SIZE_INTERNAL(_typename, _last_mandatory_field) +/* NOLINTEND(bugprone-macro-parentheses) */ + +/** +* DOC: PVR user objects. +* +* Macros used to aid copying structured and array data to and from +* userspace. Objects can differ in size, provided the minimum size +* allowed is specified (using the last mandatory field in the struct). +* All types used with PVR_UOBJ_GET/SET macros must be listed here under +* PVR_UOBJ_MIN_SIZE, with the last mandatory struct field specified. +*/ + +/** +* PVR_UOBJ_MIN_SIZE() - Fetch the minimum copy size of a compatible type object. +* @_obj_name: The name of the object. Cannot be a typename - this is deduced. +* +* This cannot fail. Using the macro with an incompatible type will result in a +* compiler error. +* +* To add compatibility for a type, list it within the macro in an orderly +* fashion. The second argument is the name of the last mandatory field of the +* struct type, which is used to calculate the size. See also PVR_UOBJ_DECL(). +* +* Return: The minimum copy size. +*/ +#define PVR_UOBJ_MIN_SIZE (_obj_name) _Generic(_obj_name \ + PVR_UOBJ_DECL(struct drm_pvr_job, hwrt) \ + PVR_UOBJ_DECL(struct drm_pvr_sync_op, value) \ + PVR_UOBJ_DECL(struct drm_pvr_dev_query_gpu_info, num_phantoms) \ + PVR_UOBJ_DECL(struct drm_pvr_dev_query_runtime_info, cdm_max_local_mem_size_regs) \ + PVR_UOBJ_DECL(struct drm_pvr_dev_query_hwrt_info, _padding_4) \ + PVR_UOBJ_DECL(struct drm_pvr_dev_query_quirks, _padding_c) \ + PVR_UOBJ_DECL(struct drm_pvr_dev_query_enhancements, _padding_c) \ + PVR_UOBJ_DECL(struct drm_pvr_heap, page_size_log2) \ + PVR_UOBJ_DECL(struct drm_pvr_dev_query_heap_info, heaps) \ + PVR_UOBJ_DECL(struct drm_pvr_static_data_area, offset) \ + PVR_UOBJ_DECL(struct drm_pvr_dev_query_static_data_areas, static_data_areas) \ + ) + +/** +* PVR_UOBJ_GET() - Copies from _src_usr_ptr to &_dest_obj. +* @_dest_obj: The destination container object in kernel space. +* @_usr_size: The size of the source container in user space. +* @_src_usr_ptr: __u64 raw pointer to the source container in user space. +* +* Return: Error code. See pvr_get_uobj(). +*/ +#define PVR_UOBJ_GET (_dest_obj, _usr_size, _src_usr_ptr) \ + pvr_get_uobj(_src_usr_ptr, _usr_size, \ + PVR_UOBJ_MIN_SIZE(_dest_obj), \ + sizeof(_dest_obj), &(_dest_obj)) + +/** +* PVR_UOBJ_SET() - Copies from &_src_obj to _dest_usr_ptr. +* @_dest_usr_ptr: __u64 raw pointer to the destination container in user space. +* @_usr_size: The size of the destination container in user space. +* @_src_obj: The source container object in kernel space. +* +* Return: Error code. See pvr_set_uobj(). +*/ +#define PVR_UOBJ_SET (_dest_usr_ptr, _usr_size, _src_obj) \ + pvr_set_uobj(_dest_usr_ptr, _usr_size, \ + PVR_UOBJ_MIN_SIZE(_src_obj), \ + sizeof(_src_obj), &(_src_obj)) + +/** +* PVR_UOBJ_GET_ARRAY() - Copies from @_src_drm_pvr_obj_array.array to +* alloced memory and returns a pointer in _dest_array. +* @_dest_array: The destination C array object in kernel space. +* @_src_drm_pvr_obj_array: The &struct drm_pvr_obj_array containing a __u64 raw +* pointer to the source C array in user space and the size of each array +* element in user space (the 'stride'). +* +* Return: Error code. See pvr_get_uobj_array(). +*/ +#define PVR_UOBJ_GET_ARRAY (_dest_array, _src_drm_pvr_obj_array) \ + pvr_get_uobj_array(_src_drm_pvr_obj_array, \ + PVR_UOBJ_MIN_SIZE((_dest_array)[0]), \ + sizeof((_dest_array)[0]), (void **)&(_dest_array)) + +/** +* PVR_UOBJ_SET_ARRAY() - Copies from _src_array to @_dest_drm_pvr_obj_array.array. +* @_dest_drm_pvr_obj_array: The &struct drm_pvr_obj_array containing a __u64 raw +* pointer to the destination C array in user space and the size of each array +* element in user space (the 'stride'). +* @_src_array: The source C array object in kernel space. +* +* Return: Error code. See pvr_set_uobj_array(). +*/ +#define PVR_UOBJ_SET_ARRAY (_dest_drm_pvr_obj_array, _src_array) \ + pvr_set_uobj_array(_dest_drm_pvr_obj_array, \ + PVR_UOBJ_MIN_SIZE((_src_array)[0]), \ + sizeof((_src_array)[0]), _src_array) +#endif /* PVR_DRV_H */ drivers/gpu/drm/imagination/pvr_fw.h new file +20
-1@@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: GPL-2.0 OR MIT */ +/* Copyright (c) 2022 Imagination Technologies Ltd. */ + +#ifndef PVR_FW_H +#define PVR_FW_H + +#include <linux/firmware.h> + +struct pvr_fw_device { +/** @firmware: Handle to the firmware loaded into the device. */ +const struct firmware *firmware; + +/* +* @processor_type: FW processor type for this device. Must be one of +* %PVR_FW_PROCESSOR_TYPE_*. +*/ +u16 processor_type; +}; + +#endif /* PVR_FW_H */ --2.40.1
Re: Re: [PATCH v3 07/17] drm/imagination: Add GPU ID parsing and firmware loading
Quoted 36 lines · Adam Ford
Quoted 19 lines · Frank Binns
Hi Adam,
Quoted 10 lines · Adam Ford
Quoted 3 lines · Sarah Walker
Read the GPU ID register at probe time and select the correct features/quirks/enhancements. Use the GPU ID to form the firmware file name and load the firmware.
I have a Rogue 6250 variant, but the BVNC is returning a slightly different revision than the firmware that's currently available, and the older firmware for the vendor driver doesn't work with this new code.
Quoted 5 lines
Linux responds with Unsupported BVNC: 4.45.2.58. From what I can tell, the closest available firmware is 4.40.2.51.
Will there be more firmware variants in the future or will there be some options to build the firmware somehow?
Quoted 6 lines
We don't plan to support the SoC vendor provided firmware binaries as this will mean having to deal with many different versions of the firmware and its interface. Specifically, the interface can change in backwards incompatible ways between releases, it changes based on the hardware feature set & bugs and it's split across userspace & the kernel. This makes these SoC provided firmware binaries very difficult to support in this new driver.
Thanks for the response.
That makes sense. I would hope that various SoC vendors would jump on the bandwagon to work with your group to get their hardware supported.
Quoted 4 lines
As an alternative, we'll be releasing firmware binaries as we add support for more Rogue GPUs. We'll also release binaries upon request, in case others in the community want to work on support in the meantime - we're just getting things set up for this at the moment.
Quoted 6 lines
The Mesa side of things appears to be missing some documentation, and the power VR stuff still appears listed as experimental. Is there some documentation somewhere that would explain to someone how to go about porting the Rogue 6250 to a different hardware variant of the 6250? I don't really know the difference between BVNC of 4.45.2.58 and 4.40.2.51, but I can't imagine they are drastically different.
One thing I forgot to mention is that, alongside the firmware binaries, we'll also provide the corresponding device info, e.g. for Mesa:
https://gitlab.freedesktop.org/mesa/mesa/-/blob/e714b35301a33145399f8939ca864ffd14b49de9/src/imagination/common/pvr_device_info.c#L32-125
We don't have any specific porting documentation, but we did just send out a Mesa MR adding some initial (basic) documentation:
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23992
In terms of differences between the two GX6250 variants, it doesn't seem that there's anything feature-wise that will require any driver changes that are specific to the 4.45.2.58 variant (the different firmware should in theory be sufficient). There are still some driver changes required, however.
Assuming the SoC you're interested in is already well supported upstream and the clocks, power controllers, etc needed by the GPU are also already supported then the following changes will be required at a minimum:
1. A GPU node will need adding to the device tree source file for your specific board
2. The compatible string for the GPU node will need adding to the list of supported devices in the kernel driver (grep for "dt_match" in the driver code)
3. The device info we provide alongside the firmware binary will need adding to the kernel driver and Mesa
4. The compatible string for the GPU and display controller device tree nodes will need adding to the Vulkan driver (grep for "pvr_drm_configs" in the Mesa code to see existing examples)
Hopefully that covers everything, but no doubt I missed something!
With respect to the experimental status of the driver, I think there are three things that need to happen before we can drop this tag. Firstly, the kernel driver needs to be merged to the kernel. Secondly, we need to pass Khronos conformance on at least one of the devices we support (our current focus is on the AXE-1-16M). Finally, we need to upstream all our Mesa changes. This is something that we've been chipping away at, but we do have a big backlog in our public branch [1]. I expect it's going to be quite some time until all of this work is complete.
While so much code is sitting in downstream branches I think it's going to be somewhat painful for people to meaningfully contribute to the driver itself. Effort is probably best spent on getting the other drivers, which the GPU driver depends on, upstream for the platform(s) you're interested in.
Just to say that I'm by no means trying to put you off from contributing, but simply trying to warn you that until the driver is out of its experimental state, a lot of things are going to be in flux and the development process is currently a lot more complicated.
It's also worth highlighting that we're a small team tackling a very large job! We're doing our best to do things in the proper way and to lay good foundations for the future. We're also learning along the way, so please bear with us :-)
Thanks
Frank
[1] https://gitlab.freedesktop.org/frankbinns/mesa/-/commits/powervr-mesa-next/
Re: [PATCH v3 07/17] drm/imagination: Add GPU ID parsing and firmware loading
Quoted 88 lines · Frank Binns
Quoted 36 lines · Adam Ford
Quoted 19 lines · Frank Binns
Hi Adam,
Quoted 10 lines · Adam Ford
Quoted 3 lines · Sarah Walker
Read the GPU ID register at probe time and select the correct features/quirks/enhancements. Use the GPU ID to form the firmware file name and load the firmware.
I have a Rogue 6250 variant, but the BVNC is returning a slightly different revision than the firmware that's currently available, and the older firmware for the vendor driver doesn't work with this new code.
Quoted 5 lines
Linux responds with Unsupported BVNC: 4.45.2.58. From what I can tell, the closest available firmware is 4.40.2.51.
Will there be more firmware variants in the future or will there be some options to build the firmware somehow?
Quoted 6 lines
We don't plan to support the SoC vendor provided firmware binaries as this will mean having to deal with many different versions of the firmware and its interface. Specifically, the interface can change in backwards incompatible ways between releases, it changes based on the hardware feature set & bugs and it's split across userspace & the kernel. This makes these SoC provided firmware binaries very difficult to support in this new driver.
Thanks for the response.
That makes sense. I would hope that various SoC vendors would jump on the bandwagon to work with your group to get their hardware supported.
Quoted 4 lines
As an alternative, we'll be releasing firmware binaries as we add support for more Rogue GPUs. We'll also release binaries upon request, in case others in the community want to work on support in the meantime - we're just getting things set up for this at the moment.
Quoted 6 lines
The Mesa side of things appears to be missing some documentation, and the power VR stuff still appears listed as experimental. Is there some documentation somewhere that would explain to someone how to go about porting the Rogue 6250 to a different hardware variant of the 6250? I don't really know the difference between BVNC of 4.45.2.58 and 4.40.2.51, but I can't imagine they are drastically different.
One thing I forgot to mention is that, alongside the firmware binaries, we'll also provide the corresponding device info, e.g. for Mesa:
https://gitlab.freedesktop.org/mesa/mesa/-/blob/e714b35301a33145399f8939ca864ffd14b49de9/src/imagination/common/pvr_device_info.c#L32-125We don't have any specific porting documentation, but we did just send out a Mesa MR adding some initial (basic) documentation:
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23992In terms of differences between the two GX6250 variants, it doesn't seem that there's anything feature-wise that will require any driver changes that are specific to the 4.45.2.58 variant (the different firmware should in theory be sufficient). There are still some driver changes required, however.
Assuming the SoC you're interested in is already well supported upstream and the clocks, power controllers, etc needed by the GPU are also already supported then the following changes will be required at a minimum:
1. A GPU node will need adding to the device tree source file for your specific board
2. The compatible string for the GPU node will need adding to the list of supported devices in the kernel driver (grep for "dt_match" in the driver code)
3. The device info we provide alongside the firmware binary will need adding to the kernel driver and Mesa
4. The compatible string for the GPU and display controller device tree nodes will need adding to the Vulkan driver (grep for "pvr_drm_configs" in the Mesa code to see existing examples)Hopefully that covers everything, but no doubt I missed something!
With respect to the experimental status of the driver, I think there are three things that need to happen before we can drop this tag. Firstly, the kernel driver needs to be merged to the kernel. Secondly, we need to pass Khronos conformance on at least one of the devices we support (our current focus is on the AXE-1-16M). Finally, we need to upstream all our Mesa changes. This is something that we've been chipping away at, but we do have a big backlog in our public branch [1]. I expect it's going to be quite some time until all of this work is complete.
While so much code is sitting in downstream branches I think it's going to be somewhat painful for people to meaningfully contribute to the driver itself. Effort is probably best spent on getting the other drivers, which the GPU driver depends on, upstream for the platform(s) you're interested in.
Quoted 8 lines
Just to say that I'm by no means trying to put you off from contributing, but simply trying to warn you that until the driver is out of its experimental state, a lot of things are going to be in flux and the development process is currently a lot more complicated.
It's also worth highlighting that we're a small team tackling a very large job! We're doing our best to do things in the proper way and to lay good foundations for the future. We're also learning along the way, so please bear with us :-)
Last year I spent considerable amount of time trying to bring this up on R-Car M3-W, but that all failed due to unavailable firmware for this GPU revision. The GPU is also GX6250 , so supporting it should be basically trivial, considering how the R-Car Gen3 upstream support is all there and the driver already supports GX6250 .
Would it be possible for imgtec to provide suitable firmware for this GX6250 revision, so the bring up effort could be resumed ?
I think that would also yield a couple more reviewers of this driver, since without a suitable firmware, the kernel driver and user space stack can not be tested, so there is no point in reviewing or even merging such untestable code.
PATCH v3 8/17 drm/imagination: Add GEM and VM related code
In reply to Sarah WalkerAdd a GEM implementation based on drm_gem_shmem, and support code for the PowerVR GPU MMU. The GPU VA manager is used for address space management.
This patch depends on :maple_tree: split up MA_STATE() macro: https://lists.freedesktop.org/archives/dri-devel/2023-June/407927.html
drm: manager to keep track of GPUs VA mappings: https://lists.freedesktop.org/archives/dri-devel/2023-June/407928.html
--- drivers/gpu/drm/imagination/Makefile | 2 + drivers/gpu/drm/imagination/pvr_device.c | 15 +- drivers/gpu/drm/imagination/pvr_device.h | 17 + drivers/gpu/drm/imagination/pvr_drv.c | 261 +- drivers/gpu/drm/imagination/pvr_gem.c | 397 +++ drivers/gpu/drm/imagination/pvr_gem.h | 201 ++ drivers/gpu/drm/imagination/pvr_vm.c | 3386 ++++++++++++++++++++++ drivers/gpu/drm/imagination/pvr_vm.h | 99 + 8 files changed, 4371 insertions(+), 7 deletions(-) create mode 100644 drivers/gpu/drm/imagination/pvr_gem.c create mode 100644 drivers/gpu/drm/imagination/pvr_gem.h create mode 100644 drivers/gpu/drm/imagination/pvr_vm.c create mode 100644 drivers/gpu/drm/imagination/pvr_vm.h
drivers/gpu/drm/imagination/Makefile +2 -0
@@ -7,5 +7,7 @@ powervr-y := \ pvr_device.o \ pvr_device_info.o \ pvr_drv.o \ + pvr_gem.o \ + pvr_vm.o obj-$(CONFIG_DRM_POWERVR) += powervr.o
drivers/gpu/drm/imagination/pvr_device.c +14 -1
@@ -6,6 +6,7 @@#include "pvr_fw.h" #include "pvr_rogue_cr_defs.h" +#include "pvr_vm.h" #include <drm/drm_print.h>
@@ -437,12 +438,22 @@ pvr_device_gpu_init(struct pvr_device *pvr_dev)if (err) goto err_out; + pvr_dev->kernel_vm_ctx =pvr_vm_create_context (pvr_dev, false); +if (IS_ERR (pvr_dev->kernel_vm_ctx)) { + err =PTR_ERR (pvr_dev->kernel_vm_ctx); + goto err_out; + } + err =pvr_request_firmware (pvr_dev);if (err) - goto err_out; + goto err_vm_ctx_put;return 0 ; +err_vm_ctx_put: +pvr_vm_context_put (pvr_dev->kernel_vm_ctx); + pvr_dev->kernel_vm_ctx =NULL ; + err_out:return err; }
@@ -455,6 +466,8 @@ static void pvr_device_gpu_fini(struct pvr_device *pvr_dev) {release_firmware (pvr_dev->fw_dev.firmware); +WARN_ON (!pvr_vm_context_put (pvr_dev->kernel_vm_ctx)); + pvr_dev->kernel_vm_ctx =NULL ; }/**
drivers/gpu/drm/imagination/pvr_device.h +17 -0
@@ -118,6 +118,16 @@ struct pvr_device {/** @regulator: Power regulator. */ struct regulator *regulator; +/** +* @kernel_vm_ctx: Virtual memory context used for kernel mappings. +* +* This is used for mappings in the firmware address region when a META firmware processor +* is in use. +* +* When a MIPS firmware processor is in use, this will be %NULL. +*/ +struct pvr_vm_context *kernel_vm_ctx; +/** @fw_dev: Firmware related data. */ struct pvr_fw_device fw_dev; };
@@ -141,6 +151,13 @@ struct pvr_file {*/ struct pvr_device *pvr_dev; +/** +* @vm_ctx_handles: Array of VM contexts belonging to this file. Array +* members are of type "struct pvr_vm_context *". +* +* This array is used to allocate handles returned to userspace. +*/ +struct xarray vm_ctx_handles; };/**
drivers/gpu/drm/imagination/pvr_drv.c +255 -6
324 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_gem.c new file +397 -0
397 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_gem.h new file +201 -0
201 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_vm.c new file +3386 -0
2,004 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_vm.h new file +99 -0
99 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.40.1
Part of the diff is not shown here. View the raw message.
PATCH v3 9/17 drm/imagination: Implement power management
In reply to Sarah WalkerAdd power management to the driver, using runtime pm. The power off sequence depends on firmware commands which are not implemented in this patch.
--- drivers/gpu/drm/imagination/Makefile | 1 + drivers/gpu/drm/imagination/pvr_device.c | 20 +- drivers/gpu/drm/imagination/pvr_device.h | 17 ++ drivers/gpu/drm/imagination/pvr_drv.c | 35 +++- drivers/gpu/drm/imagination/pvr_power.c | 239 +++++++++++++++++++++++ drivers/gpu/drm/imagination/pvr_power.h | 41 ++++ 6 files changed, 351 insertions(+), 2 deletions(-) create mode 100644 drivers/gpu/drm/imagination/pvr_power.c create mode 100644 drivers/gpu/drm/imagination/pvr_power.h
drivers/gpu/drm/imagination/Makefile +1 -0
@@ -8,6 +8,7 @@ powervr-y := \ pvr_device_info.o \ pvr_drv.o \ pvr_gem.o \ + pvr_power.o \ pvr_vm.o obj-$(CONFIG_DRM_POWERVR) += powervr.o
drivers/gpu/drm/imagination/pvr_device.c +19 -1
@@ -5,6 +5,7 @@#include "pvr_device_info.h" #include "pvr_fw.h" +#include "pvr_power.h" #include "pvr_rogue_cr_defs.h" #include "pvr_vm.h"
@@ -492,6 +493,8 @@ pvr_device_gpu_fini(struct pvr_device *pvr_dev)int pvr_device_init (struct pvr_device *pvr_dev) { +struct drm_device *drm_dev =from_pvr_device (pvr_dev); +struct device *dev = drm_dev->dev;int err;/* Enable and initialize clocks required for the device to operate. */
@@ -503,21 +506,31 @@ pvr_device_init(struct pvr_device *pvr_dev)if (err) goto err_device_clk_fini; +/* Explicitly power the GPU so we can access control registers before the FW is booted. */ + err =pm_runtime_resume_and_get (dev); +if (err) + goto err_device_clk_fini; +/* Map the control registers into memory. */ err =pvr_device_reg_init (pvr_dev);if (err) - goto err_device_clk_fini; + goto err_pm_runtime_put;/* Perform GPU-specific initialization steps. */ err =pvr_device_gpu_init (pvr_dev);if (err) goto err_device_reg_fini; +pm_runtime_put_autosuspend (dev); +return 0 ; err_device_reg_fini:pvr_device_reg_fini (pvr_dev); +err_pm_runtime_put: +pm_runtime_put_sync_suspend (dev); + err_device_clk_fini:pvr_device_clk_fini (pvr_dev);
@@ -532,12 +545,17 @@ pvr_device_init(struct pvr_device *pvr_dev)void pvr_device_fini (struct pvr_device *pvr_dev) { +struct drm_device *drm_dev =from_pvr_device (pvr_dev); +struct device *dev = drm_dev->dev; +/* * Deinitialization stages are performed in reverse order compared to * the initialization stages in pvr_device_init(). */ +pm_runtime_get_sync (dev);pvr_device_gpu_fini (pvr_dev);pvr_device_reg_fini (pvr_dev); +pm_runtime_put_sync_suspend (dev);pvr_device_clk_fini (pvr_dev); }
drivers/gpu/drm/imagination/pvr_device.h +17 -0
@@ -118,6 +118,9 @@ struct pvr_device {/** @regulator: Power regulator. */ struct regulator *regulator; +/** @irq_wq: Workqueue for actions triggered off the IRQ handler. */ +struct workqueue_struct *irq_wq; +/** * @kernel_vm_ctx: Virtual memory context used for kernel mappings. *
@@ -130,6 +133,20 @@ struct pvr_device {/** @fw_dev: Firmware related data. */ struct pvr_fw_device fw_dev; + +struct { +/** @work: Work item for watchdog callback. */ +struct delayed_work work; + +/** @old_kccb_cmds_executed: KCCB command execution count at last watchdog poll. */ +u32 old_kccb_cmds_executed; + +/** @kccb_stall_count: Number of watchdog polls KCCB has been stalled for. */ +u32 kccb_stall_count; + } watchdog; + +/** @lost: %true if the device has been lost. */ +bool lost; };/**
drivers/gpu/drm/imagination/pvr_drv.c +34 -1
@@ -4,6 +4,7 @@#include "pvr_device.h" #include "pvr_drv.h" #include "pvr_gem.h" +#include "pvr_power.h" #include "pvr_rogue_defs.h" #include "pvr_rogue_fwif_client.h" #include "pvr_rogue_fwif_shared.h"
@@ -73,6 +74,9 @@ pvr_ioctl_create_bo(struct drm_device *drm_dev, void *raw_args,int err; +if (pvr_dev->lost) +return -EIO ; +/* All padding fields must be zeroed. */ if (args->_padding_c !=0 )return -EINVAL ;
@@ -159,11 +163,15 @@ pvr_ioctl_get_bo_mmap_offset(__always_unused struct drm_device *drm_dev, void *raw_args, struct drm_file *file) { struct drm_pvr_ioctl_get_bo_mmap_offset_args *args = raw_args; +struct pvr_device *pvr_dev =to_pvr_device (drm_dev);struct pvr_file *pvr_file =to_pvr_file (file);struct pvr_gem_object *pvr_obj;struct drm_gem_object *gem_obj;int ret; +if (pvr_dev->lost) +return -EIO ; +/* All padding fields must be zeroed. */ if (args->_padding_4 !=0 )return -EINVAL ;
@@ -647,6 +655,9 @@ pvr_ioctl_dev_query(struct drm_device *drm_dev, void *raw_args,struct pvr_device *pvr_dev =to_pvr_device (drm_dev);struct drm_pvr_ioctl_dev_query_args *args = raw_args; +if (pvr_dev->lost) +return -EIO ; +switch ((enum drm_pvr_dev_query )args->type) {case DRM_PVR_DEV_QUERY_GPU_INFO_GET :return pvr_dev_query_gpu_info_get (pvr_dev, args);
@@ -813,10 +824,14 @@ pvr_ioctl_create_vm_context(struct drm_device *drm_dev, void *raw_args, struct drm_file *file) {struct drm_pvr_ioctl_create_vm_context_args *args = raw_args; +struct pvr_device *pvr_dev =to_pvr_device (drm_dev);struct pvr_file *pvr_file =to_pvr_file (file);struct pvr_vm_context *vm_ctx;int err; +if (pvr_dev->lost) +return -EIO ; +if (args->_padding_4)return -EINVAL ;
@@ -911,6 +926,9 @@ pvr_ioctl_vm_map(struct drm_device *drm_dev, void *raw_args,u64 offset_plus_size;int err; +if (pvr_dev->lost) +return -EIO ; +/* Initial validation of args. */ if (args->_padding_14)return -EINVAL ;
@@ -1285,9 +1303,15 @@ pvr_probe(struct platform_device *plat_dev)platform_set_drvdata (plat_dev, drm_dev); +devm_pm_runtime_enable (&plat_dev->dev); + +pm_runtime_set_autosuspend_delay (&plat_dev->dev,50 ); +pm_runtime_use_autosuspend (&plat_dev->dev); +pvr_power_init (pvr_dev); + err =pvr_device_init (pvr_dev);if (err) - goto err_out; + goto err_power_fini; err =drm_dev_register (drm_dev,0 );if (err)
@@ -1298,6 +1322,9 @@ pvr_probe(struct platform_device *plat_dev) err_device_fini:pvr_device_fini (pvr_dev); +err_power_fini: +pvr_power_fini (pvr_dev); + err_out:return err; }
@@ -1310,6 +1337,7 @@ pvr_remove(struct platform_device *plat_dev)drm_dev_unregister (drm_dev);pvr_device_fini (pvr_dev); +pvr_power_fini (pvr_dev);return 0 ; }
@@ -1321,11 +1349,16 @@ static const struct of_device_id dt_match[] = { };MODULE_DEVICE_TABLE (of, dt_match); +static const struct dev_pm_ops pvr_pm_ops = { +SET_RUNTIME_PM_OPS (pvr_power_device_suspend, pvr_power_device_resume, pvr_power_device_idle) +}; +static struct platform_driver pvr_driver = { .probe = pvr_probe, .remove = pvr_remove, .driver = { .name =PVR_DRIVER_NAME , + .pm = &pvr_pm_ops, .of_match_table = dt_match, }, };
drivers/gpu/drm/imagination/pvr_power.c new file +239 -0
239 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_power.h new file +41 -0
41 lines not on this page · raw message
Signature · 1 line
2.40.1
Re: [PATCH v3 09/17] drm/imagination: Implement power management
Quoted 12 lines · Sarah Walker
drivers/gpu/drm/imagination/pvr_device.c +5
-0@@ -503,21 +506,31 @@ pvr_device_init(struct pvr_device *pvr_dev)if (err) goto err_device_clk_fini; +/* Explicitly power the GPU so we can access control registers before the FW is booted. */ + err =pm_runtime_resume_and_get (dev); +if (err) + goto err_device_clk_fini; +/* Map the control registers into memory. */ err =pvr_device_reg_init (pvr_dev);if (err)
drivers/gpu/drm/imagination/pvr_device.c pvr_device_init(struct pvr_device *pvr_dev) · line 525
Quoted 10 lines
drivers/gpu/drm/imagination/pvr_device.c +3
-1- goto err_device_clk_fini; + goto err_pm_runtime_put;/* Perform GPU-specific initialization steps. */ err =pvr_device_gpu_init (pvr_dev);if (err) goto err_device_reg_fini; +pm_runtime_put_autosuspend (dev); +
You probably can use pm_runtime_put here
Quoted 4 lines
drivers/gpu/drm/imagination/pvr_device.c +0
-0@@ -532,12 +545,17 @@ pvr_device_init(struct pvr_device *pvr_dev)void pvr_device_fini (struct pvr_device *pvr_dev) {
drivers/gpu/drm/imagination/pvr_device.c pvr_device_init(struct pvr_device *pvr_dev) · line 557
Quoted 10 lines
drivers/gpu/drm/imagination/pvr_device.c +4
-0+struct drm_device *drm_dev =from_pvr_device (pvr_dev); +struct device *dev = drm_dev->dev; +/* * Deinitialization stages are performed in reverse order compared to * the initialization stages in pvr_device_init(). */ +pm_runtime_get_sync (dev);pvr_device_gpu_fini (pvr_dev);pvr_device_reg_fini (pvr_dev);
AFAIK gpu_fini releases the firmware and reg_fini drops the register mapping address, I don't think you need the device powered up for that.
Quoted 8 lines
drivers/gpu/drm/imagination/pvr_device.h +4
-0@@ -130,6 +133,20 @@ struct pvr_device {/** @fw_dev: Firmware related data. */ struct pvr_fw_device fw_dev; + +struct { +/** @work: Work item for watchdog callback. */ +struct delayed_work work;
drivers/gpu/drm/imagination/pvr_device.h struct pvr_device { · line 149
Quoted 10 lines
drivers/gpu/drm/imagination/pvr_device.h +10
-0+ +/** @old_kccb_cmds_executed: KCCB command execution count at last watchdog poll. */ +u32 old_kccb_cmds_executed; + +/** @kccb_stall_count: Number of watchdog polls KCCB has been stalled for. */ +u32 kccb_stall_count; + } watchdog; + +/** @lost: %true if the device has been lost. */ +bool lost;
The device being "lost" isn't clear to me. Does it mean it's unresponsive or stuck somehow?
drivers/gpu/drm/imagination/pvr_drv.c pvr_probe(struct platform_device *plat_dev) · line 1310
Quoted 9 lines
drivers/gpu/drm/imagination/pvr_drv.c +5
-0@@ -1285,9 +1303,15 @@ pvr_probe(struct platform_device *plat_dev)platform_set_drvdata (plat_dev, drm_dev); +devm_pm_runtime_enable (&plat_dev->dev); + +pm_runtime_set_autosuspend_delay (&plat_dev->dev,50 ); +pm_runtime_use_autosuspend (&plat_dev->dev); +pvr_power_init (pvr_dev);
The name threw me off a bit. It doesn't look like it's power related but you init the watchdog timer?
I can't really tell from that patch, but if it's not done in a later patch you'll probably need a call to sprinkle your driver with a few _mark_last_busy calls (at least in the job submission path?)
Maxime
Re: [PATCH v3 09/17] drm/imagination: Implement power management
Hi Maxime,
Quoted 21 lines · Maxime Ripard
Quoted 20 lines · Sarah Walker
drivers/gpu/drm/imagination/pvr_device.c +6
-1@@ -503,21 +506,31 @@ pvr_device_init(struct pvr_device *pvr_dev)if (err) goto err_device_clk_fini; +/* Explicitly power the GPU so we can access control registers before the FW is booted. */ + err =pm_runtime_resume_and_get (dev); +if (err) + goto err_device_clk_fini; +/* Map the control registers into memory. */ err =pvr_device_reg_init (pvr_dev);if (err) - goto err_device_clk_fini; + goto err_pm_runtime_put;/* Perform GPU-specific initialization steps. */ err =pvr_device_gpu_init (pvr_dev);if (err) goto err_device_reg_fini;
Quoted 4 lines
Review pvr_device_init(struct pvr_device *pvr_dev) · line 525
Quoted 2 lines
(quoted diff) +2
-0+ pm_runtime_put_autosuspend(dev); +You probably can use
pm_runtime_puthere
Ack
Quoted 10 lines
Quoted 10 lines
drivers/gpu/drm/imagination/pvr_device.c +3
-0@@ -532,12 +545,17 @@ pvr_device_init(struct pvr_device *pvr_dev)void pvr_device_fini (struct pvr_device *pvr_dev) { +struct drm_device *drm_dev =from_pvr_device (pvr_dev); +struct device *dev = drm_dev->dev; +/* * Deinitialization stages are performed in reverse order compared to
Quoted 8 lines
drivers/gpu/drm/imagination/pvr_device.c pvr_device_init(struct pvr_device *pvr_dev) · line 557
Quoted 5 lines
drivers/gpu/drm/imagination/pvr_device.c +1
-0* the initialization stages in pvr_device_init(). */ +pm_runtime_get_sync (dev);pvr_device_gpu_fini (pvr_dev);pvr_device_reg_fini (pvr_dev);AFAIK
gpu_finireleases the firmware andreg_finidrops the register mapping address, I don't think you need the device powered up for that.
Very true, we'll fix that :)
Quoted 14 lines
Quoted 14 lines
drivers/gpu/drm/imagination/pvr_device.h +9
-0@@ -130,6 +133,20 @@ struct pvr_device {/** @fw_dev: Firmware related data. */ struct pvr_fw_device fw_dev; + +struct { +/** @work: Work item for watchdog callback. */ +struct delayed_work work; + +/** @old_kccb_cmds_executed: KCCB command execution count at last watchdog poll. */ +u32 old_kccb_cmds_executed; + +/** @kccb_stall_count: Number of watchdog polls KCCB has been stalled for. */
Quoted 8 lines
drivers/gpu/drm/imagination/pvr_device.h struct pvr_device { · line 149
Quoted 5 lines
drivers/gpu/drm/imagination/pvr_device.h +5
-0+u32 kccb_stall_count; + } watchdog; + +/** @lost: %true if the device has been lost. */ +bool lost;The device being "lost" isn't clear to me. Does it mean it's unresponsive or stuck somehow?
The former. For example, this will be set when the firmware has become unresponsive and hard resetting the GPU doesn't resolve this. We'll update the docs to clarify.
Quoted 5 lines
Quoted 5 lines
drivers/gpu/drm/imagination/pvr_drv.c +0
-0@@ -1285,9 +1303,15 @@ pvr_probe(struct platform_device *plat_dev)platform_set_drvdata (plat_dev, drm_dev);
Quoted 8 lines
drivers/gpu/drm/imagination/pvr_drv.c pvr_probe(struct platform_device *plat_dev) · line 1310
Quoted 5 lines
drivers/gpu/drm/imagination/pvr_drv.c +5
-0+devm_pm_runtime_enable (&plat_dev->dev); + +pm_runtime_set_autosuspend_delay (&plat_dev->dev,50 ); +pm_runtime_use_autosuspend (&plat_dev->dev); +pvr_power_init (pvr_dev);The name threw me off a bit. It doesn't look like it's power related but you init the watchdog timer?
Yup, we'll update the name to reflect its real purpose.
Quoted 4 lines
I can't really tell from that patch, but if it's not done in a later patch you'll probably need a call to sprinkle your driver with a few
_mark_last_busycalls (at least in the job submission path?)
We weren't doing this before so we'll add some calls in.
Thanks
Frank
Quoted 2 lines
Maxime
PATCH v3 10/17 drm/imagination: Implement firmware infrastructure and META FW support
In reply to Sarah WalkerThe infrastructure includes parsing of the firmware image, initialising FW-side structures, handling the kernel and firmware command ringbuffers and starting & stopping the firmware processor.
This patch also adds the necessary support code for the META firmware processor.
This patch depends on:
drm: fix drmm_mutex_init(): https://lists.freedesktop.org/archives/dri-devel/2023-May/404863.html
--- drivers/gpu/drm/imagination/Makefile | 5 + drivers/gpu/drm/imagination/pvr_ccb.c | 637 ++++++++ drivers/gpu/drm/imagination/pvr_ccb.h | 62 + drivers/gpu/drm/imagination/pvr_device.c | 89 +- drivers/gpu/drm/imagination/pvr_device.h | 56 + drivers/gpu/drm/imagination/pvr_fw.c | 1386 +++++++++++++++++ drivers/gpu/drm/imagination/pvr_fw.h | 409 ++++- drivers/gpu/drm/imagination/pvr_fw_info.h | 115 ++ drivers/gpu/drm/imagination/pvr_fw_meta.c | 610 ++++++++ drivers/gpu/drm/imagination/pvr_fw_meta.h | 14 + .../gpu/drm/imagination/pvr_fw_startstop.c | 280 ++++ .../gpu/drm/imagination/pvr_fw_startstop.h | 13 + drivers/gpu/drm/imagination/pvr_fw_trace.c | 99 ++ drivers/gpu/drm/imagination/pvr_fw_trace.h | 78 + drivers/gpu/drm/imagination/pvr_power.c | 94 +- drivers/gpu/drm/imagination/pvr_vm.c | 45 +- 16 files changed, 3973 insertions(+), 19 deletions(-) create mode 100644 drivers/gpu/drm/imagination/pvr_ccb.c create mode 100644 drivers/gpu/drm/imagination/pvr_ccb.h create mode 100644 drivers/gpu/drm/imagination/pvr_fw.c create mode 100644 drivers/gpu/drm/imagination/pvr_fw_info.h create mode 100644 drivers/gpu/drm/imagination/pvr_fw_meta.c create mode 100644 drivers/gpu/drm/imagination/pvr_fw_meta.h create mode 100644 drivers/gpu/drm/imagination/pvr_fw_startstop.c create mode 100644 drivers/gpu/drm/imagination/pvr_fw_startstop.h create mode 100644 drivers/gpu/drm/imagination/pvr_fw_trace.c create mode 100644 drivers/gpu/drm/imagination/pvr_fw_trace.h
drivers/gpu/drm/imagination/Makefile +5 -0
@@ -4,9 +4,14 @@ subdir-ccflags-y := -I$(srctree)/$(src) powervr-y := \ + pvr_ccb.o \ pvr_device.o \ pvr_device_info.o \ pvr_drv.o \ + pvr_fw.o \ + pvr_fw_meta.o \ + pvr_fw_startstop.o \ + pvr_fw_trace.o \ pvr_gem.o \ pvr_power.o \ pvr_vm.o
drivers/gpu/drm/imagination/pvr_ccb.c new file +637 -0
637 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_ccb.h new file +62 -0
62 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_device.c +88 -1
129 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_device.h +56 -0
77 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_fw.c new file +1386 -0
1,386 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_fw.h +407 -2
424 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_fw_info.h new file +115 -0
115 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_fw_meta.c new file +610 -0
156 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_fw_meta.h new file +14 -0
Lines of this file are not shown. View the raw message.
drivers/gpu/drm/imagination/pvr_fw_startstop.c new file +280 -0
280 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_fw_startstop.h new file +13 -0
Lines of this file are not shown. View the raw message.
drivers/gpu/drm/imagination/pvr_fw_trace.c new file +99 -0
99 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_fw_trace.h new file +78 -0
78 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_power.c +85 -9
94 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_vm.c +38 -7
45 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.40.1
Part of the diff is not shown here. View the raw message.
PATCH v3 11/17 drm/imagination: Implement MIPS firmware processor and MMU support
In reply to Sarah WalkerAdd support for the MIPS firmware processor, used in the Series AXE GPU. The MIPS firmware processor uses a separate MMU to the rest of the GPU, so this patch adds support for that as well.
--- drivers/gpu/drm/imagination/Makefile | 4 +- drivers/gpu/drm/imagination/pvr_fw.c | 2 + drivers/gpu/drm/imagination/pvr_fw_mips.c | 280 ++++++++++++++++++++++ drivers/gpu/drm/imagination/pvr_fw_mips.h | 38 +++ drivers/gpu/drm/imagination/pvr_vm_mips.c | 222 +++++++++++++++++ drivers/gpu/drm/imagination/pvr_vm_mips.h | 22 ++ 6 files changed, 567 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/drm/imagination/pvr_fw_mips.c create mode 100644 drivers/gpu/drm/imagination/pvr_fw_mips.h create mode 100644 drivers/gpu/drm/imagination/pvr_vm_mips.c create mode 100644 drivers/gpu/drm/imagination/pvr_vm_mips.h
drivers/gpu/drm/imagination/Makefile +3 -1
@@ -10,10 +10,12 @@ powervr-y := \ pvr_drv.o \ pvr_fw.o \ pvr_fw_meta.o \ + pvr_fw_mips.o \ pvr_fw_startstop.o \ pvr_fw_trace.o \ pvr_gem.o \ pvr_power.o \ - pvr_vm.o + pvr_vm.o \ + pvr_vm_mips.o obj-$(CONFIG_DRM_POWERVR) += powervr.o
drivers/gpu/drm/imagination/pvr_fw.c +2 -0
@@ -842,6 +842,8 @@ pvr_fw_init(struct pvr_device *pvr_dev)if (fw_dev->processor_type ==PVR_FW_PROCESSOR_TYPE_META ) { fw_dev->funcs = &pvr_fw_funcs_meta; + }else if (fw_dev->processor_type ==PVR_FW_PROCESSOR_TYPE_MIPS ) { + fw_dev->funcs = &pvr_fw_funcs_mips; }else { err = -EINVAL ; goto err_out;
drivers/gpu/drm/imagination/pvr_fw_mips.c new file +280 -0
280 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_fw_mips.h new file +38 -0
@@ -0,0 +1,38 @@ +/* SPDX-License-Identifier: GPL-2.0 OR MIT */ +/* Copyright (c) 2022 Imagination Technologies Ltd. */ + +#ifndef PVR_FW_MIPS_H +#define PVR_FW_MIPS_H + +#include <linux/types.h> + +/* Forward declaration from pvr_gem.h. */ +struct pvr_gem_object ; + +/** +* struct pvr_fw_mips_data - MIPS-specific data +*/ +struct pvr_fw_mips_data { +/** @pt_obj: Object representing MIPS pagetable. */ +struct pvr_gem_object *pt_obj; + +/** @pt: Pointer to CPU mapping of MIPS pagetable. */ +u32 *pt; + +/** @boot_code_dma_addr: DMA address of MIPS boot code. */ +dma_addr_t boot_code_dma_addr; + +/** @boot_data_dma_addr: DMA address of MIPS boot data. */ +dma_addr_t boot_data_dma_addr; + +/** @exception_code_dma_addr: DMA address of MIPS exception code. */ +dma_addr_t exception_code_dma_addr; + +/** @cache_policy: Cache policy for this processor. */ +u32 cache_policy; + +/** @pfn_mask: PFN mask for MIPS pagetable. */ +u32 pfn_mask; +}; + +#endif /* PVR_FW_MIPS_H */
drivers/gpu/drm/imagination/pvr_vm_mips.c new file +222 -0
222 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_vm_mips.h new file +22 -0
@@ -0,0 +1,22 @@ +/* SPDX-License-Identifier: GPL-2.0 OR MIT */ +/* Copyright (c) 2022 Imagination Technologies Ltd. */ + +#ifndef PVR_VM_MIPS_H +#define PVR_VM_MIPS_H + +/* Forward declaration from pvr_device.h. */ +struct pvr_device ; + +/* Forward declaration from pvr_gem.h. */ +struct pvr_fw_object ; + +int +pvr_vm_mips_init (struct pvr_device *pvr_dev); +void +pvr_vm_mips_fini (struct pvr_device *pvr_dev); +int +pvr_vm_mips_map (struct pvr_device *pvr_dev,struct pvr_fw_object *fw_obj); +void +pvr_vm_mips_unmap (struct pvr_device *pvr_dev,struct pvr_fw_object *fw_obj); + +#endif /* PVR_VM_MIPS_H */
Signature · 1 line
2.40.1
PATCH v3 12/17 drm/imagination: Implement free list and HWRT create and destroy ioctls
In reply to Sarah WalkerImplement ioctls to create and destroy free lists and HWRT datasets. Free lists are used for GPU-side memory allocation during geometry processing. HWRT datasets are the FW-side structures representing render targets.
--- drivers/gpu/drm/imagination/Makefile | 2 + drivers/gpu/drm/imagination/pvr_ccb.c | 23 + drivers/gpu/drm/imagination/pvr_device.h | 24 + drivers/gpu/drm/imagination/pvr_drv.c | 104 +++- drivers/gpu/drm/imagination/pvr_free_list.c | 577 ++++++++++++++++++++ drivers/gpu/drm/imagination/pvr_free_list.h | 185 +++++++ drivers/gpu/drm/imagination/pvr_hwrt.c | 559 +++++++++++++++++++ drivers/gpu/drm/imagination/pvr_hwrt.h | 163 ++++++ 8 files changed, 1633 insertions(+), 4 deletions(-) create mode 100644 drivers/gpu/drm/imagination/pvr_free_list.c create mode 100644 drivers/gpu/drm/imagination/pvr_free_list.h create mode 100644 drivers/gpu/drm/imagination/pvr_hwrt.c create mode 100644 drivers/gpu/drm/imagination/pvr_hwrt.h
drivers/gpu/drm/imagination/Makefile +2 -0
@@ -8,12 +8,14 @@ powervr-y := \ pvr_device.o \ pvr_device_info.o \ pvr_drv.o \ + pvr_free_list.o \ pvr_fw.o \ pvr_fw_meta.o \ pvr_fw_mips.o \ pvr_fw_startstop.o \ pvr_fw_trace.o \ pvr_gem.o \ + pvr_hwrt.o \ pvr_power.o \ pvr_vm.o \ pvr_vm_mips.o
drivers/gpu/drm/imagination/pvr_ccb.c +23 -0
@@ -4,6 +4,7 @@#include "pvr_ccb.h" #include "pvr_device.h" #include "pvr_drv.h" +#include "pvr_free_list.h" #include "pvr_fw.h" #include "pvr_gem.h" #include "pvr_power.h"
@@ -127,6 +128,28 @@ process_fwccb_command(struct pvr_device *pvr_dev, struct rogue_fwif_fwccb_cmd *cWARN_ON (pvr_power_reset (pvr_dev));break ; +case ROGUE_FWIF_FWCCB_CMD_FREELISTS_RECONSTRUCTION : { +struct rogue_fwif_fwccb_cmd_freelists_reconstruction_data *data = + &cmd->cmd_data.cmd_freelists_reconstruction; +struct rogue_fwif_kccb_cmd resp_cmd; +struct rogue_fwif_freelists_reconstruction_data *resp_data = + &resp_cmd.cmd_data.free_lists_reconstruction_data; +u32 i; + +for (i =0 ; i < data->freelist_count; i++) +pvr_free_list_reconstruct (pvr_dev, data->freelist_ids[i]); + + resp_cmd.cmd_type =ROGUE_FWIF_KCCB_CMD_FREELISTS_RECONSTRUCTION_UPDATE ; + resp_cmd.kccb_flags =0 ; + resp_data->freelist_count = data->freelist_count; + +memcpy (resp_data->freelist_ids, data->freelist_ids, + data->freelist_count *sizeof (resp_data->freelist_ids[0 ])); + +WARN_ON (pvr_kccb_send_cmd (pvr_dev, &resp_cmd,NULL )); +break ; + } +default :drm_info (from_pvr_device (pvr_dev),"Received unknown FWCCB command %x\n" , cmd->cmd_type);
drivers/gpu/drm/imagination/pvr_device.h +24 -0
@@ -144,6 +144,14 @@ struct pvr_device {/** @fw_dev: Firmware related data. */ struct pvr_fw_device fw_dev; +/** +* @free_list_ids: Array of free lists belonging to this device. Array members +* are of type "struct pvr_free_list *". +* +* This array is used to allocate IDs used by the firmware. +*/ +struct xarray free_list_ids; +struct {/** @work: Work item for watchdog callback. */ struct delayed_work work;
@@ -224,6 +232,22 @@ struct pvr_file {*/ struct pvr_device *pvr_dev; +/** +* @free_list_handles: Array of free lists belonging to this file. Array +* members are of type "struct pvr_free_list *". +* +* This array is used to allocate handles returned to userspace. +*/ +struct xarray free_list_handles; + +/** +* @hwrt_handles: Array of HWRT datasets belonging to this file. Array +* members are of type "struct pvr_hwrt_dataset *". +* +* This array is used to allocate handles returned to userspace. +*/ +struct xarray hwrt_handles; +/** * @vm_ctx_handles: Array of VM contexts belonging to this file. Array * members are of type "struct pvr_vm_context *".
drivers/gpu/drm/imagination/pvr_drv.c +100 -4
159 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_free_list.c new file +577 -0
577 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_free_list.h new file +185 -0
185 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_hwrt.c new file +559 -0
559 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_hwrt.h new file +163 -0
163 lines not on this page · raw message
Signature · 1 line
2.40.1
PATCH v3 13/17 drm/imagination: Implement context creation/destruction ioctls
In reply to Sarah WalkerImplement ioctls for the creation and destruction of contexts. Contexts are used for job submission and each is associated with a particular job type.
--- drivers/gpu/drm/imagination/Makefile | 4 + drivers/gpu/drm/imagination/pvr_cccb.c | 230 ++++++++++++ drivers/gpu/drm/imagination/pvr_cccb.h | 102 ++++++ drivers/gpu/drm/imagination/pvr_context.c | 327 ++++++++++++++++++ drivers/gpu/drm/imagination/pvr_context.h | 155 +++++++++ drivers/gpu/drm/imagination/pvr_device.h | 21 ++ drivers/gpu/drm/imagination/pvr_drv.c | 26 +- drivers/gpu/drm/imagination/pvr_stream.c | 309 +++++++++++++++++ drivers/gpu/drm/imagination/pvr_stream.h | 75 ++++ drivers/gpu/drm/imagination/pvr_stream_defs.c | 125 +++++++ drivers/gpu/drm/imagination/pvr_stream_defs.h | 16 + 11 files changed, 1388 insertions(+), 2 deletions(-) create mode 100644 drivers/gpu/drm/imagination/pvr_cccb.c create mode 100644 drivers/gpu/drm/imagination/pvr_cccb.h create mode 100644 drivers/gpu/drm/imagination/pvr_context.c create mode 100644 drivers/gpu/drm/imagination/pvr_context.h create mode 100644 drivers/gpu/drm/imagination/pvr_stream.c create mode 100644 drivers/gpu/drm/imagination/pvr_stream.h create mode 100644 drivers/gpu/drm/imagination/pvr_stream_defs.c create mode 100644 drivers/gpu/drm/imagination/pvr_stream_defs.h
drivers/gpu/drm/imagination/Makefile +4 -0
@@ -5,6 +5,8 @@ subdir-ccflags-y := -I$(srctree)/$(src) powervr-y := \ pvr_ccb.o \ + pvr_cccb.o \ + pvr_context.o \ pvr_device.o \ pvr_device_info.o \ pvr_drv.o \
@@ -17,6 +19,8 @@ powervr-y := \ pvr_gem.o \ pvr_hwrt.o \ pvr_power.o \ + pvr_stream.o \ + pvr_stream_defs.o \ pvr_vm.o \ pvr_vm_mips.o
drivers/gpu/drm/imagination/pvr_cccb.c new file +230 -0
230 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_cccb.h new file +102 -0
102 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_context.c new file +327 -0
327 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_context.h new file +155 -0
155 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_device.h +21 -0
@@ -7,6 +7,8 @@#include "pvr_ccb.h" #include "pvr_device_info.h" #include "pvr_fw.h" +#include "pvr_rogue_fwif_stream.h" +#include "pvr_stream.h" #include <drm/drm_device.h> #include <drm/drm_file.h>
@@ -144,6 +146,17 @@ struct pvr_device {/** @fw_dev: Firmware related data. */ struct pvr_fw_device fw_dev; +/** @stream_musthave_quirks: Bit array of "must-have" quirks for stream commands. */ +u32 stream_musthave_quirks[PVR_STREAM_TYPE_MAX ][PVR_STREAM_EXTHDR_TYPE_MAX ]; + +/** +* @ctx_ids: Array of contexts belonging to this device. Array members +* are of type "struct pvr_context *". +* +* This array is used to allocate IDs used by the firmware. +*/ +struct xarray ctx_ids; +/** * @free_list_ids: Array of free lists belonging to this device. Array members * are of type "struct pvr_free_list *".
@@ -232,6 +245,14 @@ struct pvr_file {*/ struct pvr_device *pvr_dev; +/** +* @ctx_handles: Array of contexts belonging to this file. Array members +* are of type "struct pvr_context *". +* +* This array is used to allocate handles returned to userspace. +*/ +struct xarray ctx_handles; +/** * @free_list_handles: Array of free lists belonging to this file. Array * members are of type "struct pvr_free_list *".
drivers/gpu/drm/imagination/pvr_drv.c +24 -2
@@ -1,6 +1,7 @@// SPDX-License-Identifier: GPL-2.0 OR MIT /* Copyright (c) 2022 Imagination Technologies Ltd. */ +#include "pvr_context.h" #include "pvr_device.h" #include "pvr_drv.h" #include "pvr_free_list.h"
@@ -705,7 +706,14 @@ static int pvr_ioctl_create_context(struct drm_device *drm_dev, void *raw_args, struct drm_file *file) { - return -ENOTTY; + struct drm_pvr_ioctl_create_context_args *args = raw_args; +struct pvr_device *pvr_dev =to_pvr_device (drm_dev); +struct pvr_file *pvr_file = file->driver_priv; + +if (pvr_dev->lost) +return -EIO ; + +return pvr_context_create (pvr_file, args); }/**
@@ -725,7 +733,13 @@ static int pvr_ioctl_destroy_context(struct drm_device *drm_dev, void *raw_args, struct drm_file *file) { - return -ENOTTY; + struct drm_pvr_ioctl_destroy_context_args *args = raw_args; +struct pvr_file *pvr_file = file->driver_priv; + +if (args->_padding_4) +return -EINVAL ; + +return pvr_context_destroy (pvr_file, args->handle); }/**
@@ -1301,6 +1315,7 @@ pvr_drm_driver_open(struct drm_device *drm_dev, struct drm_file *file)*/ pvr_file->pvr_dev = pvr_dev; +xa_init_flags (&pvr_file->ctx_handles,XA_FLAGS_ALLOC1 );xa_init_flags (&pvr_file->free_list_handles,XA_FLAGS_ALLOC1 );xa_init_flags (&pvr_file->hwrt_handles,XA_FLAGS_ALLOC1 );xa_init_flags (&pvr_file->vm_ctx_handles,XA_FLAGS_ALLOC1 );
@@ -1333,6 +1348,9 @@ pvr_drm_driver_postclose(__always_unused struct drm_device *drm_dev, {struct pvr_file *pvr_file =to_pvr_file (file); +/* Kill remaining contexts. */ +pvr_destroy_contexts_for_file (pvr_file); +/* Drop references on any remaining objects. */ pvr_destroy_free_lists_for_file (pvr_file);pvr_destroy_hwrt_datasets_for_file (pvr_file);
@@ -1392,6 +1410,7 @@ pvr_probe(struct platform_device *plat_dev) drm_dev = &pvr_dev->base;platform_set_drvdata (plat_dev, drm_dev); +pvr_context_device_init (pvr_dev);devm_pm_runtime_enable (&plat_dev->dev);
@@ -1417,6 +1436,8 @@ pvr_probe(struct platform_device *plat_dev) err_power_fini:pvr_power_fini (pvr_dev); +pvr_context_device_fini (pvr_dev); + err_out:return err; }
@@ -1434,6 +1455,7 @@ pvr_remove(struct platform_device *plat_dev)drm_dev_unregister (drm_dev);pvr_device_fini (pvr_dev);pvr_power_fini (pvr_dev); +pvr_context_device_fini (pvr_dev);return 0 ; }
drivers/gpu/drm/imagination/pvr_stream.c new file +309 -0
309 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_stream.h new file +75 -0
75 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_stream_defs.c new file +125 -0
125 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_stream_defs.h new file +16 -0
@@ -0,0 +1,16 @@ +/* SPDX-License-Identifier: GPL-2.0 OR MIT */ +/* Copyright (c) 2022 Imagination Technologies Ltd. */ + +#ifndef PVR_STREAM_DEFS_H +#define PVR_STREAM_DEFS_H + +#include "pvr_stream.h" + +extern const struct pvr_stream_cmd_defs pvr_cmd_geom_stream; +extern const struct pvr_stream_cmd_defs pvr_cmd_frag_stream; +extern const struct pvr_stream_cmd_defs pvr_cmd_compute_stream; +extern const struct pvr_stream_cmd_defs pvr_cmd_transfer_stream; +extern const struct pvr_stream_cmd_defs pvr_static_render_context_state_stream; +extern const struct pvr_stream_cmd_defs pvr_static_compute_context_state_stream; + +#endif /* PVR_STREAM_DEFS_H */
Signature · 1 line
2.40.1
PATCH v3 14/17 drm/imagination: Implement job submission and scheduling
In reply to Sarah WalkerImplement job submission ioctl. Job scheduling is implemented using drm_sched.
Jobs are submitted in a stream format. This is intended to allow the UAPI data format to be independent of the actual FWIF structures in use, which vary depending on the GPU in use.
The stream formats are documented at:
https://gitlab.freedesktop.org/mesa/mesa/-/blob/73fe6db819d951c02ce57eefcbd9b31b85900f33/src/imagination/csbgen/rogue_kmd_stream.xml
This patch depends on:
drm/sched: Convert drm scheduler to use a work queue rather than kthread: https://lists.freedesktop.org/archives/dri-devel/2023-April/398458.html
drm/sched: Move schedule policy to scheduler / entity: https://lists.freedesktop.org/archives/dri-devel/2023-April/398461.html
drm/sched: Add DRM_SCHED_POLICY_SINGLE_ENTITY scheduling policy: https://lists.freedesktop.org/archives/dri-devel/2023-April/398460.html
drm/sched: Start run wq before TDR in drm_sched_start: https://lists.freedesktop.org/archives/dri-devel/2023-April/398462.html
drm/sched: Submit job before starting TDR: https://lists.freedesktop.org/archives/dri-devel/2023-April/398466.html
drm/sched: Add helper to set TDR timeout: https://lists.freedesktop.org/archives/dri-devel/2023-April/398464.html
drm: fix drmm_mutex_init(): https://lists.freedesktop.org/archives/dri-devel/2023-May/404863.html
drm/sched: Make sure we wait for all dependencies in kill_jobs_cb(): https://lists.freedesktop.org/archives/dri-devel/2023-June/408901.html
drm/sched: Call drm_sched_fence_set_parent() from drm_sched_fence_scheduled(): https://lists.freedesktop.org/archives/dri-devel/2023-June/408904.html
--- drivers/gpu/drm/imagination/Makefile | 2 + drivers/gpu/drm/imagination/pvr_context.c | 127 +- drivers/gpu/drm/imagination/pvr_context.h | 35 + drivers/gpu/drm/imagination/pvr_device.c | 4 + drivers/gpu/drm/imagination/pvr_device.h | 46 + drivers/gpu/drm/imagination/pvr_drv.c | 34 +- drivers/gpu/drm/imagination/pvr_job.c | 834 ++++++++++++ drivers/gpu/drm/imagination/pvr_job.h | 147 ++ drivers/gpu/drm/imagination/pvr_power.c | 17 + drivers/gpu/drm/imagination/pvr_queue.c | 1203 +++++++++++++++++ drivers/gpu/drm/imagination/pvr_queue.h | 157 +++ drivers/gpu/drm/imagination/pvr_stream.c | 2 +- drivers/gpu/drm/imagination/pvr_stream_defs.c | 226 ++++ 13 files changed, 2827 insertions(+), 7 deletions(-) create mode 100644 drivers/gpu/drm/imagination/pvr_job.c create mode 100644 drivers/gpu/drm/imagination/pvr_job.h create mode 100644 drivers/gpu/drm/imagination/pvr_queue.c create mode 100644 drivers/gpu/drm/imagination/pvr_queue.h
drivers/gpu/drm/imagination/Makefile +2 -0
@@ -18,7 +18,9 @@ powervr-y := \ pvr_fw_trace.o \ pvr_gem.o \ pvr_hwrt.o \ + pvr_job.o \ pvr_power.o \ + pvr_queue.o \ pvr_stream.o \ pvr_stream_defs.o \ pvr_vm.o \
drivers/gpu/drm/imagination/pvr_context.c +125 -2
172 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_context.h +35 -0
@@ -15,6 +15,7 @@#include "pvr_cccb.h" #include "pvr_device.h" +#include "pvr_queue.h" /* Forward declaration from pvr_gem.h. */ struct pvr_fw_object ;
@@ -52,8 +53,42 @@ struct pvr_context {/** @ctx_id: FW context ID. */ u32 ctx_id; + +/** @queues: Union containg all kind of queues. */ +union { +struct { +/** @geometry: Geometry queue. */ +struct pvr_queue *geometry; + +/** @fragment: Fragment queue. */ +struct pvr_queue *fragment; + }; + +/** @compute: Compute queue. */ +struct pvr_queue *compute; + +/** @compute: Transfer queue. */ +struct pvr_queue *transfer; + } queues; }; +static __always_inline struct pvr_queue * +pvr_context_get_queue_for_job (struct pvr_context *ctx,enum drm_pvr_job_type type) +{ +switch (type) { +case DRM_PVR_JOB_TYPE_GEOMETRY : +return ctx->type ==DRM_PVR_CTX_TYPE_RENDER ? ctx->queues.geometry :NULL ; +case DRM_PVR_JOB_TYPE_FRAGMENT : +return ctx->type ==DRM_PVR_CTX_TYPE_RENDER ? ctx->queues.fragment :NULL ; +case DRM_PVR_JOB_TYPE_COMPUTE : +return ctx->type ==DRM_PVR_CTX_TYPE_COMPUTE ? ctx->queues.compute :NULL ; +case DRM_PVR_JOB_TYPE_TRANSFER_FRAG : +return ctx->type ==DRM_PVR_CTX_TYPE_TRANSFER_FRAG ? ctx->queues.transfer :NULL ; + } + +return NULL ; +} +/** * pvr_context_get() - Take additional reference on context. * @ctx: Context pointer.
drivers/gpu/drm/imagination/pvr_device.c +4 -0
@@ -7,6 +7,7 @@#include "pvr_fw.h" #include "pvr_power.h" #include "pvr_rogue_cr_defs.h" +#include "pvr_stream.h" #include "pvr_vm.h" #include <drm/drm_print.h>
@@ -252,6 +253,7 @@ static irqreturn_t pvr_meta_irq_handler(int irq, void *data)queue_work (pvr_dev->irq_wq, &pvr_dev->fwccb_work);wake_up (&pvr_dev->kccb.rtn_q);queue_work (pvr_dev->irq_wq, &pvr_dev->kccb.work); +queue_work (pvr_dev->irq_wq, &pvr_dev->queues.work); }return IRQ_HANDLED ;
@@ -506,6 +508,8 @@ pvr_device_gpu_init(struct pvr_device *pvr_dev) goto err_out; } +pvr_stream_create_musthave_masks (pvr_dev); + err =pvr_set_dma_info (pvr_dev);if (err) goto err_out;
drivers/gpu/drm/imagination/pvr_device.h +46 -0
70 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_drv.c +30 -4
@@ -7,6 +7,7 @@#include "pvr_free_list.h" #include "pvr_gem.h" #include "pvr_hwrt.h" +#include "pvr_job.h" #include "pvr_power.h" #include "pvr_rogue_defs.h" #include "pvr_rogue_fwif_client.h"
@@ -31,6 +32,8 @@#include <linux/of_device.h> #include <linux/of_platform.h> #include <linux/platform_device.h> +#include <linux/pm_runtime.h> +#include <linux/xarray.h> /** * DOC: PowerVR Graphics Driver
@@ -396,7 +399,8 @@ pvr_dev_query_runtime_info_get(struct pvr_device *pvr_dev,return 0 ; } - runtime_info.free_list_min_pages =0 ;/* FIXME */ + runtime_info.free_list_min_pages = +pvr_get_free_list_min_pages (pvr_dev); runtime_info.free_list_max_pages =ROGUE_PM_MAX_FREELIST_SIZE /ROGUE_PM_PAGE_SIZE ; runtime_info.common_store_alloc_region_size =
@@ -678,10 +682,10 @@ pvr_ioctl_dev_query(struct drm_device *drm_dev, void *raw_args,return pvr_dev_query_enhancements_get (pvr_dev, args);case DRM_PVR_DEV_QUERY_HEAP_INFO_GET : -return -EINVAL ; +return pvr_heap_info_get (pvr_dev, args);case DRM_PVR_DEV_QUERY_STATIC_DATA_AREAS_GET : -return -EINVAL ; +return pvr_static_data_areas_get (pvr_dev, args); }return -EINVAL ;
@@ -1140,7 +1144,14 @@ static int pvr_ioctl_submit_jobs(struct drm_device *drm_dev, void *raw_args, struct drm_file *file) { - return -ENOTTY; + struct drm_pvr_ioctl_submit_jobs_args *args = raw_args; +struct pvr_device *pvr_dev =to_pvr_device (drm_dev); +struct pvr_file *pvr_file =to_pvr_file (file); + +if (pvr_dev->lost) +return -EIO ; + +return pvr_submit_jobs (pvr_dev, pvr_file, args); }int
@@ -1320,6 +1331,8 @@ pvr_drm_driver_open(struct drm_device *drm_dev, struct drm_file *file)xa_init_flags (&pvr_file->hwrt_handles,XA_FLAGS_ALLOC1 );xa_init_flags (&pvr_file->vm_ctx_handles,XA_FLAGS_ALLOC1 ); +mutex_init (&pvr_file->submit_lock); +/* * Store reference to powervr-specific file private data in DRM file * private data.
@@ -1356,6 +1369,8 @@ pvr_drm_driver_postclose(__always_unused struct drm_device *drm_dev,pvr_destroy_hwrt_datasets_for_file (pvr_file);pvr_destroy_vm_contexts_for_file (pvr_file); +mutex_destroy (&pvr_file->submit_lock); +kfree (pvr_file); file->driver_priv =NULL ; }
@@ -1412,6 +1427,10 @@ pvr_probe(struct platform_device *plat_dev)platform_set_drvdata (plat_dev, drm_dev);pvr_context_device_init (pvr_dev); + err =pvr_queue_device_init (pvr_dev); +if (err) + goto err_context_fini; +devm_pm_runtime_enable (&plat_dev->dev);pm_runtime_set_autosuspend_delay (&plat_dev->dev,50 );
@@ -1427,6 +1446,7 @@ pvr_probe(struct platform_device *plat_dev) goto err_device_fini;xa_init_flags (&pvr_dev->free_list_ids,XA_FLAGS_ALLOC1 ); +xa_init_flags (&pvr_dev->job_ids,XA_FLAGS_ALLOC1 );return 0 ;
@@ -1436,6 +1456,9 @@ pvr_probe(struct platform_device *plat_dev) err_power_fini:pvr_power_fini (pvr_dev); +pvr_queue_device_fini (pvr_dev); + +err_context_fini:pvr_context_device_fini (pvr_dev); err_out:
@@ -1448,13 +1471,16 @@ pvr_remove(struct platform_device *plat_dev)struct drm_device *drm_dev =platform_get_drvdata (plat_dev);struct pvr_device *pvr_dev =to_pvr_device (drm_dev); +WARN_ON (!xa_empty (&pvr_dev->job_ids));WARN_ON (!xa_empty (&pvr_dev->free_list_ids)); +xa_destroy (&pvr_dev->job_ids);xa_destroy (&pvr_dev->free_list_ids);drm_dev_unregister (drm_dev);pvr_device_fini (pvr_dev);pvr_power_fini (pvr_dev); +pvr_queue_device_fini (pvr_dev);pvr_context_device_fini (pvr_dev);return 0 ;
drivers/gpu/drm/imagination/pvr_job.c new file +834 -0
834 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_job.h new file +147 -0
147 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_power.c +17 -0
@@ -150,6 +150,23 @@ pvr_watchdog_kccb_stalled(struct pvr_device *pvr_dev)*/ if (pvr_dev->watchdog.kccb_stall_count ==2 )return true; + }else if (pvr_dev->watchdog.old_kccb_cmds_executed == kccb_cmds_executed) { +bool has_active_contexts; + +mutex_lock (&pvr_dev->queues.lock); + has_active_contexts =list_empty (&pvr_dev->queues.active); +mutex_unlock (&pvr_dev->queues.lock); + +if (has_active_contexts) { +/* Send a HEALTH_CHECK command so we can verify FW is still alive. */ +struct rogue_fwif_kccb_cmd health_check_cmd; + + health_check_cmd.cmd_type =ROGUE_FWIF_KCCB_CMD_HEALTH_CHECK ; + +pvr_kccb_send_cmd_powered (pvr_dev, &health_check_cmd,NULL ); + } + + pvr_dev->watchdog.kccb_stall_count =0 ; }else { pvr_dev->watchdog.old_kccb_cmds_executed = kccb_cmds_executed; pvr_dev->watchdog.kccb_stall_count =0 ;
drivers/gpu/drm/imagination/pvr_queue.c new file +1203 -0
1,203 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_queue.h new file +157 -0
157 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_stream.c +1 -1
@@ -210,7 +210,7 @@ pvr_stream_process_ext_stream(struct pvr_device *pvr_dev,* @cmd_defs: Stream definition. * @stream: Pointer to command stream. * @stream_size: Size of command stream, in bytes. -* @job: Pointer to job in which to store address of FW structure. +* @dest_out: Pointer to destination buffer. * * Caller is responsible for freeing the output structure. *
drivers/gpu/drm/imagination/pvr_stream_defs.c +226 -0
197 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.40.1
Part of the diff is not shown here. View the raw message.
PATCH v3 15/17 drm/imagination: Add firmware trace to debugfs
In reply to Sarah WalkerFirmware trace is exposed at /sys/debug/dri/<dev_nr>/pvr_fw/trace_0. Trace is enabled via the group mask at /sys/debug/dri/<dev_nr>/pvr_params/fw_trace_mask.
--- drivers/gpu/drm/imagination/Makefile | 4 + drivers/gpu/drm/imagination/pvr_debugfs.c | 53 +++ drivers/gpu/drm/imagination/pvr_debugfs.h | 29 ++ drivers/gpu/drm/imagination/pvr_device.c | 9 + drivers/gpu/drm/imagination/pvr_device.h | 10 + drivers/gpu/drm/imagination/pvr_drv.c | 4 + drivers/gpu/drm/imagination/pvr_fw_trace.c | 393 ++++++++++++++++++++- drivers/gpu/drm/imagination/pvr_params.c | 147 ++++++++ drivers/gpu/drm/imagination/pvr_params.h | 72 ++++ 9 files changed, 720 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/drm/imagination/pvr_debugfs.c create mode 100644 drivers/gpu/drm/imagination/pvr_debugfs.h create mode 100644 drivers/gpu/drm/imagination/pvr_params.c create mode 100644 drivers/gpu/drm/imagination/pvr_params.h
drivers/gpu/drm/imagination/Makefile +4 -0
@@ -19,6 +19,7 @@ powervr-y := \ pvr_gem.o \ pvr_hwrt.o \ pvr_job.o \ + pvr_params.o \ pvr_power.o \ pvr_queue.o \ pvr_stream.o \
@@ -26,4 +27,7 @@ powervr-y := \ pvr_vm.o \ pvr_vm_mips.o +powervr-$(CONFIG_DEBUG_FS) += \ + pvr_debugfs.o + obj-$(CONFIG_DRM_POWERVR) += powervr.o
drivers/gpu/drm/imagination/pvr_debugfs.c new file +53 -0
53 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_debugfs.h new file +29 -0
@@ -0,0 +1,29 @@ +/* SPDX-License-Identifier: GPL-2.0 OR MIT */ +/* Copyright (c) 2022 Imagination Technologies Ltd. */ + +#ifndef PVR_DEBUGFS_H +#define PVR_DEBUGFS_H + +/* Forward declaration from <drm/drm_drv.h>. */ +struct drm_minor ; + +#if defined(CONFIG_DEBUG_FS ) +/* Forward declaration from "pvr_device.h". */ +struct pvr_device ; + +/* Forward declaration from <linux/dcache.h>. */ +struct dentry ; + +struct pvr_debugfs_entry { +const char *name; +void (*init)(struct pvr_device *pvr_dev,struct dentry *dir); +}; + +void pvr_debugfs_init (struct drm_minor *minor); +#else /* defined(CONFIG_DEBUG_FS) */ +#include <linux/compiler_attributes.h> + +static __always_inline void pvr_debugfs_init(struct drm_minor *minor) {} +#endif /* defined(CONFIG_DEBUG_FS) */ + +#endif /* PVR_DEBUGFS_H */
drivers/gpu/drm/imagination/pvr_device.c +9 -0
@@ -5,6 +5,7 @@#include "pvr_device_info.h" #include "pvr_fw.h" +#include "pvr_params.h" #include "pvr_power.h" #include "pvr_rogue_cr_defs.h" #include "pvr_stream.h"
@@ -580,6 +581,14 @@ pvr_device_init(struct pvr_device *pvr_dev)struct device *dev = drm_dev->dev;int err; +/* +* Setup device parameters. We do this first in case other steps +* depend on them. +*/ + err =pvr_device_params_init (&pvr_dev->params); +if (err) +return err; +/* Enable and initialize clocks required for the device to operate. */ err =pvr_device_clk_init (pvr_dev);if (err)
drivers/gpu/drm/imagination/pvr_device.h +10 -0
@@ -7,6 +7,7 @@#include "pvr_ccb.h" #include "pvr_device_info.h" #include "pvr_fw.h" +#include "pvr_params.h" #include "pvr_rogue_fwif_stream.h" #include "pvr_stream.h"
@@ -146,6 +147,15 @@ struct pvr_device {/** @fw_dev: Firmware related data. */ struct pvr_fw_device fw_dev; +/** +* @params: Device-specific parameters. +* +* The values of these parameters are initialized from the +* defaults specified as module parameters. They may be +* modified at runtime via debugfs (if enabled). +*/ +struct pvr_device_params params; +/** @stream_musthave_quirks: Bit array of "must-have" quirks for stream commands. */ u32 stream_musthave_quirks[PVR_STREAM_TYPE_MAX ][PVR_STREAM_EXTHDR_TYPE_MAX ];
drivers/gpu/drm/imagination/pvr_drv.c +4 -0
@@ -2,6 +2,7 @@/* Copyright (c) 2022 Imagination Technologies Ltd. */ #include "pvr_context.h" +#include "pvr_debugfs.h" #include "pvr_device.h" #include "pvr_drv.h" #include "pvr_free_list.h"
@@ -1385,6 +1386,9 @@ static struct drm_driver pvr_drm_driver = { .ioctls = pvr_drm_driver_ioctls, .num_ioctls = ARRAY_SIZE(pvr_drm_driver_ioctls), .fops = &pvr_drm_driver_fops, +#if defined(CONFIG_DEBUG_FS) + .debugfs_init = pvr_debugfs_init, +#endif .name = PVR_DRIVER_NAME, .desc = PVR_DRIVER_DESC,
drivers/gpu/drm/imagination/pvr_fw_trace.c +392 -1
402 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_params.c new file +147 -0
147 lines not on this page · raw message
drivers/gpu/drm/imagination/pvr_params.h new file +72 -0
72 lines not on this page · raw message
Signature · 1 line
2.40.1
PATCH v3 16/17 drm/imagination: Add driver documentation
In reply to Sarah WalkerAdd documentation for the UAPI and for the virtual memory design.
--- Documentation/gpu/drivers.rst | 2 + Documentation/gpu/imagination/index.rst | 14 + Documentation/gpu/imagination/uapi.rst | 174 +++++++ .../gpu/imagination/virtual_memory.rst | 462 ++++++++++++++++++ MAINTAINERS | 1 + 5 files changed, 653 insertions(+) create mode 100644 Documentation/gpu/imagination/index.rst create mode 100644 Documentation/gpu/imagination/uapi.rst create mode 100644 Documentation/gpu/imagination/virtual_memory.rst
Documentation/gpu/drivers.rst +2 -0
@@ -3,9 +3,11 @@ GPU Driver Documentation ======================== .. toctree:: + :maxdepth: 3 amdgpu/index i915 + imagination/index mcde meson pl111
Documentation/gpu/imagination/index.rst new file +14 -0
@@ -0,0 +1,14 @@ +======================================= +drm/imagination PowerVR Graphics Driver +======================================= + +.. kernel-doc:: drivers/gpu/drm/imagination/pvr_drv.c + :doc: PowerVR Graphics Driver + +Contents +======== +.. toctree:: + :maxdepth: 2 + + uapi + virtual_memory
Documentation/gpu/imagination/uapi.rst new file +174 -0
174 lines not on this page · raw message
Documentation/gpu/imagination/virtual_memory.rst new file +462 -0
462 lines not on this page · raw message
MAINTAINERS +1 -0
@@ -10090,6 +10090,7 @@ M: Sarah Walker <[email protected]> M: Donald Robson <[email protected]> S: Supported F: Documentation/devicetree/bindings/gpu/img,powervr.yaml +F: Documentation/gpu/imagination/ F: drivers/gpu/drm/imagination/ F: include/uapi/drm/pvr_drm.h
Signature · 1 line
2.40.1
Quoted 5 lines · Sarah Walker
This patch series adds the initial DRM driver for Imagination Technologies PowerVR GPUs, starting with those based on our Rogue architecture. It's worth pointing out that this is a new driver, written from the ground up, rather than a refactored version of our existing downstream driver (pvrsrvkm).
...
Quoted 17 lines
maple_tree: split upMA_STATE()macro:https://lists.freedesktop.org/archives/dri-devel/2023-June/407927.html
drm: manager to keep track of GPUs VA mappings: https://lists.freedesktop.org/archives/dri-devel/2023-June/407928.html
drm/sched: Convert drm scheduler to use a work queue rather than kthread: https://lists.freedesktop.org/archives/dri-devel/2023-April/398458.html
drm/sched: Move schedule policy to scheduler / entity: https://lists.freedesktop.org/archives/dri-devel/2023-April/398461.html
drm/sched: AddDRM_SCHED_POLICY_SINGLE_ENTITYscheduling policy: https://lists.freedesktop.org/archives/dri-devel/2023-April/398460.html
drm/sched: Start run wq before TDR indrm_sched_start: https://lists.freedesktop.org/archives/dri-devel/2023-April/398462.html
drm/sched: Submit job before starting TDR: https://lists.freedesktop.org/archives/dri-devel/2023-April/398466.html
drm/sched: Add helper to set TDR timeout: https://lists.freedesktop.org/archives/dri-devel/2023-April/398464.html
drm: fixdrmm_mutex_init(): https://lists.freedesktop.org/archives/dri-devel/2023-May/404863.html
drm/sched: Make sure we wait for all dependencies inkill_jobs_cb(): https://lists.freedesktop.org/archives/dri-devel/2023-June/408901.html
drm/sched: Calldrm_sched_fence_set_parent()fromdrm_sched_fence_scheduled(): https://lists.freedesktop.org/archives/dri-devel/2023-June/408904.html[1] https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15243
[2] https://gitlab.freedesktop.org/mesa/mesa/-/tree/main/src/imagination/vulkan
[3] https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15507
Quoted 6 lines
v3:
* Usedrm_schedfor scheduling
* Use GPU VA manager
* Use runtime PM
* Usedrm_gem_shmem
* GPU watchdog and device loss handling
No changes in the bindings? So you decided to just ignore the comments?
Sorry, that's not a good approach. Implement all the comments or respond to them.
Best regards,
Krzysztof
PATCH v3 17/17 arm64: dts: ti: k3-am62-main: Add GPU device node [DO NOT MERGE]
In reply to Sarah WalkerAdd the Series AXE GPU node to the AM62 device tree.
--- arch/arm64/boot/dts/ti/k3-am62-main.dtsi | 13 +++++++++++++ 1 file changed, 13 insertions(+)
arch/arm64/boot/dts/ti/k3-am62-main.dtsi +13 -0
@@ -892,4 +892,17 @@ mcasp2: audio-controller@2b20000 { power-domains = <&k3_pds 192 TI_SCI_PD_EXCLUSIVE>; status = "disabled"; }; + + gpu: gpu@fd00000 { + compatible = "ti,am62-gpu", "img,powervr-seriesaxe"; + reg = <0 0x0fd00000 0 0x20000>; + power-domains = <&k3_pds 187 TI_SCI_PD_EXCLUSIVE>; + clocks = <&k3_clks 187 0>; + clock-names = "core"; + interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "gpu"; + #cooling-cells = <2>; + #cooling-min-level = <0>; + #cooling-max-level = <3>; + }; };
Signature · 1 line
2.40.1
Hi Sarah,
thanks for starting this long awaited work!
Quoted 4 lines · Sarah Walker
This patch series adds the initial DRM driver for Imagination Technologies PowerVR GPUs, starting with those based on our Rogue architecture. It's worth pointing out that this is a new driver, written from the ground up, rather than a refactored version of our existing downstream driver (pvrsrvkm).
This seems to be a fairly good starting point, a bit of trade-off between latest-and-greatest
and recent enough devices that need aftermarket support.
I assume you are aware of the community existing around Series 5 (should be the immediate
predecessor to Rogue?):
https://github.com/openpvrsgx-devgroup/linux_openpvrsgx
I don't know how active those people are these days, but I can see that a branch was updated for v6.4-rc3 just three weeks ago.
https://github.com/openpvrsgx-devgroup/linux_openpvrsgx/tree/pvrsrvkm-6.4-rc3
I think it would be good for community building to make sure that you get these people involved in reviewing, especially neutral stuff like device tree bindings but also to make sure no architectural choices are done that will make it hard to retrofit a proper driver for the older engines if this community decide to work
on it.
Specifically I would ask that the DT bindings include all old and new PowerVR hardware in one go, unless they have very specific hardware definition needs, which I doubt.
Also I think they could use your help to get the proper firmware for the older hardware licensed properly from Imagination and included into linux-firmware so they do not need to ship files on the side.
Yours,
Linus Walleij