[coreboot-gerrit] Change in libgfxinit[master]: gma skl: Disable DDI clocks on reset path

Nico Huber (Code Review) gerrit at coreboot.org
Wed Jul 19 14:47:40 CEST 2017


Nico Huber has uploaded this change for review. ( https://review.coreboot.org/20648


Change subject: gma skl: Disable DDI clocks on reset path
......................................................................

gma skl: Disable DDI clocks on reset path

After reset DPLL_CTRL2 is initialized to 0. Which means some clock
disable bits are not set and might cause some hassle later. Set them
and close the related TODO.

Change-Id: I1a470dff55e317e8119906b3e397f6f2314abcbd
Signed-off-by: Nico Huber <nico.huber at secunet.com>
---
M TODO
M common/haswell_shared/hw-gfx-gma-connectors-ddi.adb
M common/haswell_shared/hw-gfx-gma-connectors-ddi.ads
M common/haswell_shared/hw-gfx-gma-connectors.adb
M common/hw-gfx-gma-connectors.ads
M common/hw-gfx-gma.adb
M common/ironlake/hw-gfx-gma-connectors.adb
7 files changed, 31 insertions(+), 3 deletions(-)



  git pull ssh://review.coreboot.org:29418/libgfxinit refs/changes/48/20648/1

diff --git a/TODO b/TODO
index 505d2db..a122c82 100644
--- a/TODO
+++ b/TODO
@@ -4,6 +4,4 @@
 
 low	LVDS	8bit colors, data format???
 
-medium  SKL     check if DPLL_CTRL2 really defaults to `Clock Off` => 0
-
 medium  gfxtest take care of our own framebuffer mapping
diff --git a/common/haswell_shared/hw-gfx-gma-connectors-ddi.adb b/common/haswell_shared/hw-gfx-gma-connectors-ddi.adb
index 0fc4ad9..fa62a98 100644
--- a/common/haswell_shared/hw-gfx-gma-connectors-ddi.adb
+++ b/common/haswell_shared/hw-gfx-gma-connectors-ddi.adb
@@ -747,4 +747,18 @@
       end if;
    end Off;
 
+   ----------------------------------------------------------------------------
+
+   procedure Post_Reset_Off
+   is
+      Clocks_Off : Word32 := 0;
+   begin
+      if not Config.Has_Per_DDI_Clock_Sel and not Config.Has_DDI_PHYs then
+         for Port in Digital_Port loop
+            Clocks_Off := Clocks_Off or DPLL_CTRL2_DDIx_CLOCK_OFF (Port);
+         end loop;
+         Registers.Set_Mask (Registers.DPLL_CTRL2, Clocks_Off);
+      end if;
+   end Post_Reset_Off;
+
 end HW.GFX.GMA.Connectors.DDI;
diff --git a/common/haswell_shared/hw-gfx-gma-connectors-ddi.ads b/common/haswell_shared/hw-gfx-gma-connectors-ddi.ads
index 4ccd995..ec1fce2 100644
--- a/common/haswell_shared/hw-gfx-gma-connectors-ddi.ads
+++ b/common/haswell_shared/hw-gfx-gma-connectors-ddi.ads
@@ -28,6 +28,8 @@
 
    procedure Off (Port : Digital_Port);
 
+   procedure Post_Reset_Off;
+
 private
    type Buf_Trans_Range is range 0 .. 19;
    type Buf_Trans_Array is array (Buf_Trans_Range) of Word32;
diff --git a/common/haswell_shared/hw-gfx-gma-connectors.adb b/common/haswell_shared/hw-gfx-gma-connectors.adb
index f5e2e01..e2a69cd 100644
--- a/common/haswell_shared/hw-gfx-gma-connectors.adb
+++ b/common/haswell_shared/hw-gfx-gma-connectors.adb
@@ -97,4 +97,12 @@
       end if;
    end Post_All_Off;
 
+   ----------------------------------------------------------------------------
+
+   procedure Post_Reset_Off
+   is
+   begin
+      DDI.Post_Reset_Off;
+   end Post_Reset_Off;
+
 end HW.GFX.GMA.Connectors;
diff --git a/common/hw-gfx-gma-connectors.ads b/common/hw-gfx-gma-connectors.ads
index 30a382f..c68267c 100644
--- a/common/hw-gfx-gma-connectors.ads
+++ b/common/hw-gfx-gma-connectors.ads
@@ -39,4 +39,6 @@
    procedure Pre_All_Off;
    procedure Post_All_Off;
 
+   procedure Post_Reset_Off;
+
 end HW.GFX.GMA.Connectors;
diff --git a/common/hw-gfx-gma.adb b/common/hw-gfx-gma.adb
index 53369f3..919e6d6 100644
--- a/common/hw-gfx-gma.adb
+++ b/common/hw-gfx-gma.adb
@@ -372,8 +372,10 @@
          Power_And_Clocks.Post_All_Off;
       else
          -- According to PRMs, VGA plane is the only thing
-         -- that's enabled by default after reset.
+         -- that's enabled by default after reset...
          Display_Controller.Legacy_VGA_Off;
+         -- ... along with some DDI port bits since Skylake.
+         Connectors.Post_Reset_Off;
       end if;
 
       -------------------- Now restart from a clean state ---------------------
diff --git a/common/ironlake/hw-gfx-gma-connectors.adb b/common/ironlake/hw-gfx-gma-connectors.adb
index 8ae47fd..479e842 100644
--- a/common/ironlake/hw-gfx-gma-connectors.adb
+++ b/common/ironlake/hw-gfx-gma-connectors.adb
@@ -182,4 +182,6 @@
       end loop;
    end Post_All_Off;
 
+   procedure Post_Reset_Off is null;
+
 end HW.GFX.GMA.Connectors;

-- 
To view, visit https://review.coreboot.org/20648
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-Project: libgfxinit
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1a470dff55e317e8119906b3e397f6f2314abcbd
Gerrit-Change-Number: 20648
Gerrit-PatchSet: 1
Gerrit-Owner: Nico Huber <nico.h at gmx.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20170719/619fdaeb/attachment.html>


More information about the coreboot-gerrit mailing list