gma: Make PCI config access mandatory
We always have access to the PCI device now. So we can drop the old
`Check_Platform ()` that relied on the MMIO space only. Some paths
also get simplified, as we don't need the `PCI_Usable` flag anymore.
Change-Id: I29f2d79484eae2f84b8547e52869d8f6246024a0
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.sourcearcade.org/c/libgfxinit/+/537
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Thomas Heijligen <src@posteo.de>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
diff --git a/common/i945/hw-gfx-gma-power_and_clocks.adb b/common/i945/hw-gfx-gma-power_and_clocks.adb
index 23d5476..2f6404a 100644
--- a/common/i945/hw-gfx-gma-power_and_clocks.adb
+++ b/common/i945/hw-gfx-gma-power_and_clocks.adb
@@ -49,28 +49,19 @@
GC_DISPLAY_CLOCK_320_MHZ : constant Word16 := 4 * 2 ** 4;
GCFGC : Word16;
- Tmp_Clk : Frequency_Type := 200_000_000;
begin
if Config.GMCH_I945GM then
- if PCI_Usable then
- PCI_Read16 (GCFGC, 16#f0#);
- if (GCFGC and GC_LOW_FREQUENCY_ENABLE) /= 0 then
- Tmp_Clk := 133_333_333;
- elsif (GCFGC and GC_DISPLAY_CLOCK_MASK) = GC_DISPLAY_CLOCK_320_MHZ then
- Tmp_Clk := 320_000_000;
- else
- Tmp_Clk := 200_000_000;
- end if;
+ PCI_Read16 (GCFGC, 16#f0#);
+ if (GCFGC and GC_LOW_FREQUENCY_ENABLE) /= 0 then
+ CDClk := 133_333_333;
+ elsif (GCFGC and GC_DISPLAY_CLOCK_MASK) = GC_DISPLAY_CLOCK_320_MHZ then
+ CDClk := 320_000_000;
+ else
+ CDClk := 200_000_000;
end if;
else
-- i945G desktop: fixed 400 MHz
- Tmp_Clk := 400_000_000;
- end if;
-
- if Tmp_Clk in Config.CDClk_Range then
- CDClk := Tmp_Clk;
- else
- CDClk := 200_000_000;
+ CDClk := 400_000_000;
end if;
end Get_CDClk;