msm: kgsl: split mh and mmu initialization
The MH block should be initialized even if the gpu mmu
is not enabled so that AXI error interrupts will still
be generated.
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
diff --git a/drivers/gpu/msm/z180.c b/drivers/gpu/msm/z180.c
index d56785d..7c0b6cc 100644
--- a/drivers/gpu/msm/z180.c
+++ b/drivers/gpu/msm/z180.c
@@ -134,14 +134,19 @@
.id = KGSL_DEVICE_2D0,
.ver_major = DRIVER_VERSION_MAJOR,
.ver_minor = DRIVER_VERSION_MINOR,
- .mmu = {
- .config = Z180_MMU_CONFIG,
+ .mh = {
+ .mharb = Z180_CFG_MHARB,
+ .mh_intf_cfg1 = 0x00032f07,
+ .mh_intf_cfg2 = 0x004b274f,
/* turn off memory protection unit by setting
acceptable physical address range to include
all pages. */
.mpu_base = 0x00000000,
.mpu_range = 0xFFFFF000,
},
+ .mmu = {
+ .config = Z180_MMU_CONFIG,
+ },
.pwrctrl = {
.regulator_name = "fs_gfx2d0",
.irq_name = KGSL_2D0_IRQ,
@@ -167,14 +172,19 @@
.id = KGSL_DEVICE_2D1,
.ver_major = DRIVER_VERSION_MAJOR,
.ver_minor = DRIVER_VERSION_MINOR,
- .mmu = {
- .config = Z180_MMU_CONFIG,
+ .mh = {
+ .mharb = Z180_CFG_MHARB,
+ .mh_intf_cfg1 = 0x00032f07,
+ .mh_intf_cfg2 = 0x004b274f,
/* turn off memory protection unit by setting
acceptable physical address range to include
all pages. */
.mpu_base = 0x00000000,
.mpu_range = 0xFFFFF000,
},
+ .mmu = {
+ .config = Z180_MMU_CONFIG,
+ },
.pwrctrl = {
.regulator_name = "fs_gfx2d1",
.irq_name = KGSL_2D1_IRQ,
@@ -546,16 +556,11 @@
kgsl_pwrctrl_enable(device);
- /* Set up MH arbiter. MH offsets are considered to be dword
- * based, therefore no down shift. */
- z180_regwrite(device, ADDR_MH_ARBITER_CONFIG, Z180_CFG_MHARB);
-
- z180_regwrite(device, ADDR_MH_CLNT_INTF_CTRL_CONFIG1, 0x00030F27);
- z180_regwrite(device, ADDR_MH_CLNT_INTF_CTRL_CONFIG2, 0x004B274F);
-
/* Set interrupts to 0 to ensure a good state */
z180_regwrite(device, (ADDR_VGC_IRQENABLE >> 2), 0x0);
+ kgsl_mh_start(device);
+
status = kgsl_mmu_start(device);
if (status)
goto error_clk_off;
@@ -755,8 +760,8 @@
if (!in_interrupt())
kgsl_pre_hwaccess(device);
- if ((offsetwords >= ADDR_MH_ARBITER_CONFIG &&
- offsetwords <= ADDR_MH_AXI_HALT_CONTROL) ||
+ if ((offsetwords >= MH_ARBITER_CONFIG &&
+ offsetwords <= MH_AXI_HALT_CONTROL) ||
(offsetwords >= MH_MMU_CONFIG &&
offsetwords <= MH_MMU_MPU_END)) {
_z180_regread_mmu(device, offsetwords, value);
@@ -772,8 +777,8 @@
if (!in_interrupt())
kgsl_pre_hwaccess(device);
- if ((offsetwords >= ADDR_MH_ARBITER_CONFIG &&
- offsetwords <= ADDR_MH_CLNT_INTF_CTRL_CONFIG2) ||
+ if ((offsetwords >= MH_ARBITER_CONFIG &&
+ offsetwords <= MH_CLNT_INTF_CTRL_CONFIG2) ||
(offsetwords >= MH_MMU_CONFIG &&
offsetwords <= MH_MMU_MPU_END)) {
_z180_regwrite_mmu(device, offsetwords, value);