Commit Graph

92 Commits

Author SHA1 Message Date
Nico Huber
19729a747b gma hsw+: Revise Has_DDI_D flag
The GFX Programmer's Reference Manuals (PRMs) aren't clear on this but
it's pretty clear from the processor datasheets which SKUs expose which
pins: All U/Y processors lack DDI D.

Change-Id: I84c40b6bc01091de8a512e21354243c74643e0f5
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/20820
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2017-12-12 13:54:25 +00:00
Arthur Heymans
5fd9a31968 gma: Fix decoding the size of Stolen Memory on Gen4
The size of stolen memory needs to be decoded in MiB.

Change-Id: I1ceb9ffd85d6ebb54a0e099e200a5068c34a6251
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/21514
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: Nico Huber <nico.h@gmx.de>
2017-09-18 20:45:31 +00:00
Nico Huber
3b654a0991 gfx_test: Set our own framebuffers up, update README
Use GMA.Setup_Default_FB() to allocate framebuffers in the stolen
memory. To help with setups where we can't unload the i915 driver,
back up and restore the current GTT setup and framebuffer contents.

Also add a wrapper script and update the README.

Change-Id: I10790d35d38b7b211f41b2452f6d2baf17372e31
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/20604
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2017-09-13 16:14:59 +00:00
Nico Huber
42fb2d065d gma: Add procedure to power up legacy VGA block
Calling this is necessary for VGA text mode on at least Skylake, where
the legacy VGA registers are inaccessible otherwise.

Change-Id: I48ba1738bcc7babd4e666e5266f775dcd06b2a3f
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/21323
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Tested-by: Nico Huber <nico.h@gmx.de>
2017-09-04 12:51:16 +00:00
Nico Huber
3a0e2a08f5 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@secunet.com>
Reviewed-on: https://review.coreboot.org/20648
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2017-08-30 15:14:08 +00:00
Nico Huber
8540805c29 gma skl: Prevent race by late timeout check
We initialize the timeout variable before the first event on the other
side (i.e. us sending a request to PCODE). With very slow debug output
sending the request itself might take longer than the timeout period.

Reorder the code to check the timeout condition only after the first
try and thereby make sure that we always try at least twice. Also issue
a debug message in case we timed out.

Change-Id: I8cdeb3e36d7eafbef8a1a8e13670f3f9838a2f38
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/20647
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2017-08-30 15:14:01 +00:00
Nico Huber
234e772f42 dp training: Allow to adjust pre-emphasis during clock recovery
That's not demanded by the spec but there are sinks in the wild that
need it.

Change-Id: Ibef5236ca771e0e02beb4e76650ffb6974657846
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/21216
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2017-08-28 22:09:18 +00:00
Nico Huber
41b18ca031 dp training: Fix channel equalization phase
First, allow updates to voltage swing too during channel equalization.
Spec just says to adjust the settings as requested.

Second, the loop conditions differ from the clock recovery phase. We
have only 6 tries in total but no particular order is enforced.

Change-Id: I4673390d8c0f9a5642702872e5b4ab11f54797c7
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/21215
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2017-08-28 22:09:04 +00:00
Nico Huber
1bc496fc83 gma-display_probing: Only check display type on DVI-I
On DVI-I connectors the DDC is shared between the analog and digital
parts. To decide which path to take we checked the digital input bit
of the EDID. We did this overeagerly for all ports, which broke com-
patibility with DP adapters (the DP realm is very complex and we are
supposed to discover the whole downstream hierarchie, which obviously
would be overkill).

Change-Id: Ifc53e8ab985695e6e4ff1d42659826710a50eae9
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/20135
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2017-08-28 20:12:45 +00:00
Nico Huber
c3f66f6353 gma: Add Map_Linear_FB()
Change-Id: Ia8850256b3a679e3b76567a6e3146e4c3dc38960
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/20609
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2017-08-28 20:11:58 +00:00
Nico Huber
eedde88f43 gma: Check that framebuffer fits stolen memory and aperture
Change-Id: I92bd42e4a838832999a6d6fa795a8015d9896a12
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/20605
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2017-08-28 20:11:55 +00:00
Nico Huber
5374c3ac83 gma: Add Setup_Default_FB()
Add new public procedure Setup_Default_FB() to configure a framebuffer
in stolen memory. The optional parameter `Clear` tells it to clear the
configured framebuffer.

Also remove Setup_Default_GTT() from the public interface.

Change-Id: I6ece4f56bbd34126ef34f0107d5ccdbde8a007ac
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/20603
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2017-08-28 20:11:50 +00:00
Nico Huber
194e57e625 gma: Allow offsets /= 0 in Setup_Default_GTT()
Honor the `Offset` field of the given framebuffer and add preconditions
that ensure we won't overflow the GTT or its target address space.

Change-Id: I6577e98e154610228734baee7674ee54b9a922e8
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/20602
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2017-08-28 20:11:28 +00:00
Nico Huber
bebca13b4d gma: Move a warning justification to spec
Makes us compatible with SPARK 2017.

Change-Id: Ie325b913e329ceb522a320c76f1cccf512e5b79f
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/20170
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-by: Adrian-Ken Rueegsegger <ken@codelabs.ch>
2017-08-28 20:11:16 +00:00
Nico Huber
e015e82aff gma: Fix refined contract of Initialize()
To be compatible with HW.PCI.Dev implementations that do actual register
accesses, we have to account for hardware state updates.

Change-Id: I86e42163d7847f7011bcf9a0ef5c2c7f25b4b1be
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/21207
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-by: Adrian-Ken Rueegsegger <ken@codelabs.ch>
2017-08-28 20:11:13 +00:00
Nico Huber
17d64b6d01 gma: Clear "fence" registers during initialization
These registers are used to mark certain GTT regions as tiled.

Change-Id: Ic2cd61c0c1b42990ed955d7f77a428a2b9dbabd5
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/20601
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2017-08-21 10:56:43 +00:00
Nico Huber
2b6f699218 gma: Add a HW.PCI.Dev for dynamic MMIO setup
Remove `MMIO_Base` option from Initialize() and try to derive it
using libhwbase' PCI mechanism instead.

Change-Id: Iacd4d098954bb96c1c6b40fdfb2636191d9517c7
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/20600
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2017-08-21 10:56:15 +00:00
Nico Huber
b8ae61876b gma: Move GTT constants into GMA.Config
Change-Id: Ie4b017f26b658c1818f90701089ce5d3171e4953
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/20599
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2017-08-21 10:54:09 +00:00
Nico Huber
fda2d6eaef gfx_test: Update to use *libhwbase* new PCI interface
Thereby, move `gfx_test` into HW.GFX.GMA to make package dependencies
easier to handle.

Change-Id: Ie8a1251354b4fff57eef8c4bada8b49aa04ef382
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/20598
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2017-08-21 10:53:25 +00:00
Nico Huber
58afc202b1 gma skl: Add I_boost configuration
Hardcoded to 1 since we don't support Skylake-Y (ULX).

Change-Id: I22fa056531cac18828c867f9c9f5745ec424d38c
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/20168
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2017-07-25 20:23:59 +00:00
Nico Huber
18ff0c13b7 gma skl: Add DDI buffer translations
Change-Id: Ibb058de78f671b94ee788f30342184a8c31a1154
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/20167
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2017-07-25 20:23:19 +00:00
Nico Huber
730f17c6ab gma hsw bdw: Add DDI buffer translations
Change-Id: Ib87be86e2853e6b9df7e19dd9cb80d4f7effefc5
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/20166
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2017-07-25 20:21:27 +00:00
Nico Huber
01b680ff02 gma hsw+: Add boilerplate for DDI buffer translations
Change-Id: I8fcba64a3c663b9eea7fb11088c62ea584d63e04
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/20129
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2017-07-25 20:20:27 +00:00
Nico Huber
247adf39f6 gma hsw+: Add default value for HDMI buffer levels
Add a configuration option to override the default HDMI translation.
It's not exported yet, as we've never seen a non-default value being
used. So this is just to have a common place for the defaults.

Also sets the recommended default value for Broxton as defined in the
PRM.

Change-Id: I59fae0fb4f444d9193a98b6a0edf337ecbba3b62
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/20165
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2017-07-25 20:15:32 +00:00
Nico Huber
0923b795fe gma-connectors: Add Initialize() procedure
Change-Id: I62946152da9a93b881e0b0ea4b2679086ec8e970
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/20128
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
2017-07-25 20:14:32 +00:00
Nico Huber
fb4f8ce26a Add a README describing libgfxinit and the build process
Change-Id: I5728095e224be428d319fac96942df5d6dd85304
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/18793
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Tested-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2017-06-06 17:52:30 +02:00
Nico Huber
1d0abe468b Add linux user-space app gfx_test
This simple program scans all ports and configures pipes for the first
three available displays. It presumes that there is enough framebuffer
mapped for all pipes and fills it with test images.

The only command line parameter ist the path to a PCI-device node in
sysfs. On exit, the hardware is left in the configured state. So the
user has to make sure, that he either can work without the gfx hard-
ware or has another driver to restore a working state.

Change-Id: I2144300589e113e711db7959aa68fa96c3844568
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/18786
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Tested-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2017-06-06 17:52:22 +02:00
Nico Huber
3586101e0b gma: Juggle with types of a precondition
Using the same type (Pos64) as in the actual calculation below, helps
current SPARK Pro to prove absence of overflows (SPARK GPL 2016 still
works too ofc).

Change-Id: Ifde556f9201f3333be0eb8566bf69b7f9df11277
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/18809
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2017-06-03 15:32:09 +02:00
Nico Huber
1c3b9285ce gma broxton: Add final glue
Add new configuration flags for Broxton and hook up its DDI_Phy
implementation in the shared Haswell DDI code. Haswell and Skylake
get DDI_Phy stubs.

Tested (in Linux userspace) on ASRock J3455-ITX which exposes the
following ports:
  o VGA through an active eDP to VGA converter chip
  o HDMI 2.0 through an active DP to HDMI converter chip
  o DVI-D connected to the SoC

Change-Id: If72b228c6a4c45487261e6e7435d281ec2d97f38
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/18426
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2017-06-03 15:24:28 +02:00
Nico Huber
fdd93659e0 gma broxton: Add signal level control for DDI PHYs
Other than for the DDIs of the Core processor series, we don't select
signal levels from a preconfigured set but have to program the indivi-
dual values.

Change-Id: I3ab4d5e2ed47db0d4ce47a17c4a5fb08b5416bc2
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/18425
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2017-06-03 15:24:14 +02:00
Nico Huber
afadcace9e gma broxton: Implement pre-PLL setup for DDI PHYs
Some lane configuration that's supposed to happen before enabling
the display PLL.

Change-Id: I08ec3ac26164061b19d695ab600d6bb9eeadd7ad
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/18424
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2017-06-03 15:23:51 +02:00
Nico Huber
4b0239f549 gma broxton: Fill in port PLL configuration
PLL parameter selection is a much simplified version of what's done in
i915 on Linux. We just assume the error in the resulting clock of a
valid parameter tuple is always small enough. Trying to speak mathe-
matically, since the only calculated parameter M2 is given as a frac-
tion of 2^22, the error should stay below 2^-22.

As the PLLs are tied to specific DDI ports, they won't ever be shared
among ports and the allocation boils down to just configuring the PLL.

Change-Id: I206675506f1dbbb57d65bfdc308de1891ccbf61a
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/18423
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2017-06-03 15:23:33 +02:00
Nico Huber
f6266004f9 gma broxton: Implement DDI PHY power handling
DDI PHYs is a concept common to current Atom processor series. It
seems the PHYs are implemented on the same die as the graphics core
but still need to be configured separately. Based on the assumption
that we start with disabled PHYs and it was always us if they are
enabled, we only have to do a small share of what Linux' i915 does.

v2: Wait for GRC done only if we want to copy its results.

Change-Id: I1e59f80daa08dc64b8c3dff34202ace5dd4c5f73
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/18422
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2017-06-03 15:23:22 +02:00
Nico Huber
408204409b gma broxton: Start off with power domains and CDClk
It's close to the respective code for Skylake but still different
enough for a separate implementation. We start with a default CDClk
of 288MHz which is enough for resolutions up to 2560x1600.

Change-Id: I44364191236f421b2b89c9a019a50713f7c20525
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/18243
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2017-06-03 15:22:31 +02:00
Nico Huber
21da574137 gma: Add config plus stubs for Broxton SoC
Current plan is to support all DDI outputs of Apollo Lake. This
includes one eDP (DDI A) and two fully fledged DDIs (B, C) that can
be either configured to DP 1.2 or HDMI 1.4. MIPI/DSI outputs won't
be supported for now.

Since there doesn't exist any public documentation, the code will be
solely based on analysis of Linux' i915 driver.

Everything is a stub. In the existing code, at least DDI configu-
ration will also have to be adapted.

v2: Escape hash characters in config file

Change-Id: I4a79d4531d238049ba00ab4f03e270e6b58f81ab
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/18421
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2017-06-03 15:19:33 +02:00
Paul Menzel
b83107c60f common/hw-gfx-gma: Remove trailing space in debug output
Looking at the logs in the coreboot board status repository, there is a
trailing space in the debug output. Remove that.

Change-Id: Ib24ebbfa756147c8561df2e9247ed0e2cea29b13
Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-on: https://review.coreboot.org/19563
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: Nico Huber <nico.h@gmx.de>
2017-05-04 15:45:49 +02:00
Nico Huber
799752fd03 configs: Escape hash characters
Change-Id: I5b21d7a5310767ea2fd3aebd81b83044e8eec7f2
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/18785
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com>
Reviewed-by: Martin Roth <martinroth@google.com>
2017-03-28 18:45:09 +02:00
Nico Huber
ac455ad15a gma ddi: Don't try to disable non-existent DDI D
Didn't hurt on Haswell-/Broadwell-U, but did lock up Broxton.

Change-Id: I6a47d0fba8cb6e59d8ace1ab64eed6182769a37b
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/18420
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2017-03-14 11:55:01 +01:00
Nico Huber
bcb2c47c51 gma registers: Add generic Wait() procedure
Add a more generic Wait() procedure that waits for some masked bits of
a register to hold a specific value.

Change-Id: Iafefce3da8907e7edf00c68e7a8b650aa7bcd372
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/18419
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2017-03-14 11:54:47 +01:00
Nico Huber
31a5217d39 gma: Justify some use-visibility warnings
These `use type` statements were required for older compilers
(<= GCC 6.2) but are warned about by newer versions, sigh.

Change-Id: I50d6ea19b5a9e0c7d839f6a9781b6179156ce162
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/18690
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2017-03-12 13:18:03 +01:00
Nico Huber
8fb0f31d7b gma: Do not check for hot-plug events on analog port
The corresponding bits in PCH_ADPA reflect the current state of the
connection and not a change in the state. This was interpreted wrong
since some PRMs state that these bits can be cleared. It seems they
can't be, though. Linux' i915 also doesn't try to clear them and only
interprets their state as presence of a display.

Change-Id: I8e8bfd30937f393e5c411b7d48668a4f5f7b0129
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/18167
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Tested-by: Nico Huber <nico.h@gmx.de>
2017-03-08 22:21:37 +01:00
Nico Huber
4c7356db3b gma: Add option to keep port power after Scan_Ports()
This is useful when we only want to probe for connected displays while
another entity currently controls the outputs.

Also introduce an `All_Ports` list, that can be used when it's unknown
which ports are actually implemented (the default now, when no port
list is provided to `Scan_Ports()`).

Change-Id: I5d8e289a907fe99c673084afbce54da65ba98e9c
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/18123
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2017-03-06 18:53:45 +01:00
Nico Huber
4798c6629c gma: Always clear hot-plug events before enabling a pipe
For cold plugging, we don't wait for a hot-plug event. But, even if we
are not supposed to wait for a hot-plug event, we have to clear any
pending event. Also, a failed DP training can result in another hot-plug
event.

A stale event would be spuriously interpreted as a disconnect, resul-
ting in an infinite loop of cycling the pipe on and off.

Change-Id: I4c7bbe0ac792553c94e928ba0a5eeb822a857f9c
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/18122
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2017-03-06 18:53:24 +01:00
Nico Huber
564103f4cc gma: Rework power handling in Update_Outputs()
We should also reevaluate power settings, when we only disabled pipes
and didn't enable any new outputs.

Change-Id: Ia81454bdeb770359b1d95e02f6f3d75e76584857
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/18121
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2017-03-06 18:51:57 +01:00
Nico Huber
b56b9c5e02 gma: Disable all stale pipes before enabling any new
To support arbitrary configuration changes, we have to disable all
changed pipes first before we enable any new outputs.

Currently if an output moved from one pipe to another we might have
enabled it twice on different pipes.

Change-Id: Ibf601b8b5044aff4dd9e0a9c15cec20db6907aa5
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/18120
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2017-03-06 18:51:03 +01:00
Nico Huber
3be61d4f7e gma: Refactor Hotplug_Detect() interface and usage
Checking for hotplug events should be done before any other work to
reduce load and (spurious) debug output. Therefor, use the simpler
`Port_Type` in the interface of `Hotplug_Detect()` so we don't have to
fill the whole `Port_Cfg` before checking for events.

Also, now that it's possible, factor the disabling of a single output
out of `Update_Outputs()`.

Change-Id: I2a0ba5530c8d511fa95f9cac12297ad428a40d77
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/18119
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2017-03-06 18:50:54 +01:00
Nico Huber
43370ba02a gma: Factor enabling of a single pipe out of Update_Outputs()
To make the flow easier to follow for both, human readers and analysis
tools.

Change-Id: I188fcc28b0b39d64e866b08ebe47737f5f22fd63
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/18118
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2017-03-06 18:50:45 +01:00
Nico Huber
1a712d3110 gma: Drop state tracking of active DP_Links
The only time these settings are referenced is when we are about to
tear down a pipe. But we don't need the current state to do this. On
retraining due to a hotplug event, we start the whole configuration
again for simplicity. So we won't need it on that path either.

Change-Id: I01662e4a4a6150a0b05c57a016171fa3f0e7b93a
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/18117
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2017-03-06 15:03:24 +01:00
Nico Huber
af9cc9e778 dp_info: Refactor debug output for DP settings
Shuffle things around to let the caller decide when to output the
settings. This removes spurious "DP" outputs for FDI configuration
which reuses the DP_Info infrastructure.

Change-Id: I9e6d6946002ef758b6c31f7de797dc6d329cae74
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/18116
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2017-03-06 15:03:12 +01:00
Nico Huber
6e327c9bc1 gma: Get rid of Get_Pipe_Hint()
Now that we call it `Pipe_Index` passing that around makes more sense.

Change-Id: I59460274860dc5d135662aa978acc1603b510eb6
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/17932
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2017-03-06 14:57:44 +01:00