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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Split the transcoder setup out of `Pipe_Setup` into a new package
`Transcoder`. This comes closer to how Intel's manuals describe the
hardware.
Also rework the related constant definitions to make things more
human readable.
Change-Id: Ife0f0d635d87b874d4b713a00ca7a1bec688c672
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/17764
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Intel's manuals became much more clear with the years about what be-
longs to the transcoder and what to the pipe setup.
Although the transcoder is generally tied to a specific pipe, we
keep the naming of transcoder A, B, C which are mapped to the Primary,
Secondary, and Tertiary pipe respectively (with the exception of the
Haswell+ EDP transcoder which can be attached to any pipe).
Change-Id: I722786d318268c51ae2eaba9c108312f139165d8
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/17763
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
We chose the FDI-link settings too early, before we even set the
mode's BPC in case the default for an output should be selected.
This resulted in a too small lane count for the FDI in corner cases.
Change-Id: I12c6465c296bda4b7af116bd5a4c3d2ce593a3ac
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/18115
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
In Initialize(), the state of the graphics hardware is reset to a
known state (i.e. everything is turned off first). That's unnecessary
in the coreboot case where we just came out of reset. Thus, make the
state cleaning optional with a `Clean_State` parameter that defaults
to `False`.
Change-Id: Ifee6ec9e9876fca8a715684718014917a3e35879
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/17758
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Similar to
770fe4a gma: Use framebuffer size as pipe source size
we have to use the unscaled framebuffer size for the plane fetched
from memory.
Change-Id: I76cabdda5656982af2e8ff7cb67d2ad4a14a40a2
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/17748
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Adrian-Ken Rueegsegger <ken@codelabs.ch>
The panel power sequencer sometimes waits very long without an expli-
cable cause. We can however skip waiting for the panel power sequence
if we're already done with the configuration.
This fixes a sporadic, useless delay of about 130ms on the T420.
Change-Id: I27bf9b8bbae8a7447cde7ea4b88231b1707698b3
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/17760
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Before probing the internal panels EDID, we have to wait for the panel
power up delay. To use this time, we enable the panel power before pro-
bing any port and can probe external ports during the delay. On a T420
this saves about 5ms without an external display connected and 15ms
with.
Change-Id: Idce2ebbdb60182c9161e0a92ee4d42ff50c95688
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/17759
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
The GMA package has grown way too big. Move derivation of the internal
configuration into new package `Config_Helpers`, EDID probing into new
package `Display_Probing`.
Change-Id: Ib49ac7b00367be4295d18dba3afd1a0692e0497f
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/17757
Reviewed-by: Adrian-Ken Rueegsegger <ken@codelabs.ch>
Mostly renaming and some type tightening. Move the call to
Configure_FDI_Link() into Fill_Port_Config() as it's part of the
Port_Config.
Also start to document some procedures. The whole high-level con-
figuration is driven by non-obvious software-design choices, and
thus isn't self-explanatory even if you know the hardware.
Change-Id: Ib6a0893333e9359776140ed9de110f54cf36f6e5
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/17756
Reviewed-by: Adrian-Ken Rueegsegger <ken@codelabs.ch>
If an HDMI/DP display is detected, probe the sibling port that shares
physical pins too and bail out if something is detected. This is a
precaution for adapters that expose the pins of a port for both HDMI/
DVI and DP (like some ThinkPad docks). A user might have attached both
by accident and there are rumors of displays that got fried by apply-
ing the wrong signal.
Change-Id: I276ad55a353d60389bc36724d8af37b158ae4599
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/17755
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
DP and HDMI ports share physical pins. We can skip the probing of a
port if the other is already configured.
Change-Id: Iff2dcab969b607be900f8569affee5e1d288caba
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/17754
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>