3rdparty/lib{hwbase,gfxinit}: Update to latest master
Simplifies our C interface function gma_gfxinit(), due to the following changes: * *libgfxinit* knows about the underlying PCI device now and can probe MMIO addresses by itself. * The framebuffer mapping is now completely handled inside the library where we validate that we neither overflow - the stolen memory, - the GTT address space, the GTT itself nor - the aperture window (i.e. resource2 of the PCI device) that we use to access the framebuffer. Other changes: * Fixes and a quirk for DP training. * Fix for DP-VGA adapters that report an analog display in EDID. * Fixes for Skylake support with coreboot. * DDI Buffer drive-strength configuration for Haswell, Broadwell and Skylake. * `gfx_test` can now be run from X windows (with glitches). * Compatibility with GCC 7 and SPARK GPL 2017. TEST=Booted lenovo/t420 and verified that everything works as usual. Change-Id: I001ba973d864811503410579fd7ad55ab8612759 Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/20606 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
This commit is contained in:
parent
18228168a5
commit
504d1eff4b
|
@ -1 +1 @@
|
||||||
Subproject commit fb4f8ce26a05c2304367c066b806519941658373
|
Subproject commit 3a0e2a08f5489f3bb5c6e9f97b903e6e10c31a6c
|
|
@ -1 +1 @@
|
||||||
Subproject commit 3bf6759dc09d27c06b3533fd536e667356853d3d
|
Subproject commit 66859712e4817288591908d737dbf41ddea31c3a
|
|
@ -39,22 +39,13 @@ GMA: Hook-up in Chipset Initialization
|
||||||
Both configurations described above implement a procedure
|
Both configurations described above implement a procedure
|
||||||
`GMA.gfxinit()`:
|
`GMA.gfxinit()`:
|
||||||
|
|
||||||
procedure gfxinit
|
procedure gfxinit (lightup_ok : out int);
|
||||||
(mmio_base : in word64;
|
|
||||||
linear_fb : in word64;
|
|
||||||
phys_fb : in word32;
|
|
||||||
lightup_ok : out int);
|
|
||||||
|
|
||||||
This procedure is exported as the C function `gma_gfxinit()` as
|
This procedure is exported as the C function `gma_gfxinit()` as
|
||||||
follows:
|
follows:
|
||||||
|
|
||||||
void gma_gfxinit(uint64_t mmio_base, uint64_t linear_fb,
|
void gma_gfxinit(int *lightup_ok);
|
||||||
uint32_t phys_fb, int *lightup_ok);
|
|
||||||
|
|
||||||
* `mmio_base`: the base address of the GMA's MMIO resource
|
|
||||||
* `linear_fb`: the base address of the GMA's GTT window resource
|
|
||||||
* `phys_fb`: the physical address where the framebuffer should be
|
|
||||||
stored (usually the GMA's stolen memory)
|
|
||||||
* `lightup_ok`: returns whether the initialization succeeded `1` or
|
* `lightup_ok`: returns whether the initialization succeeded `1` or
|
||||||
failed `0`. Currently, only the case that no display
|
failed `0`. Currently, only the case that no display
|
||||||
could be found counts as failure. A failure at a la-
|
could be found counts as failure. A failure at a la-
|
||||||
|
|
|
@ -6,11 +6,7 @@ use HW;
|
||||||
package GMA
|
package GMA
|
||||||
is
|
is
|
||||||
|
|
||||||
procedure gfxinit
|
procedure gfxinit (lightup_ok : out Interfaces.C.int);
|
||||||
(mmio_base : in word64;
|
|
||||||
linear_fb : in word64;
|
|
||||||
phys_fb : in word32;
|
|
||||||
lightup_ok : out Interfaces.C.int);
|
|
||||||
pragma Export (C, gfxinit, "gma_gfxinit");
|
pragma Export (C, gfxinit, "gma_gfxinit");
|
||||||
|
|
||||||
----------------------------------------------------------------------------
|
----------------------------------------------------------------------------
|
||||||
|
|
|
@ -50,13 +50,10 @@ is
|
||||||
|
|
||||||
----------------------------------------------------------------------------
|
----------------------------------------------------------------------------
|
||||||
|
|
||||||
procedure gfxinit
|
procedure gfxinit (lightup_ok : out Interfaces.C.int)
|
||||||
(mmio_base : in word64;
|
|
||||||
linear_fb : in word64;
|
|
||||||
phys_fb : in word32;
|
|
||||||
lightup_ok : out Interfaces.C.int)
|
|
||||||
is
|
is
|
||||||
use type pos32;
|
use type pos32;
|
||||||
|
use type word64;
|
||||||
|
|
||||||
ports : Port_List;
|
ports : Port_List;
|
||||||
configs : Pipe_Configs;
|
configs : Pipe_Configs;
|
||||||
|
@ -68,9 +65,7 @@ is
|
||||||
begin
|
begin
|
||||||
lightup_ok := 0;
|
lightup_ok := 0;
|
||||||
|
|
||||||
HW.GFX.GMA.Initialize
|
HW.GFX.GMA.Initialize (Success => success);
|
||||||
(MMIO_Base => mmio_base,
|
|
||||||
Success => success);
|
|
||||||
|
|
||||||
if success then
|
if success then
|
||||||
ports := Mainboard.ports;
|
ports := Mainboard.ports;
|
||||||
|
@ -98,15 +93,19 @@ is
|
||||||
|
|
||||||
HW.GFX.GMA.Dump_Configs (configs);
|
HW.GFX.GMA.Dump_Configs (configs);
|
||||||
|
|
||||||
HW.GFX.GMA.Setup_Default_GTT (fb, phys_fb);
|
HW.GFX.GMA.Setup_Default_FB
|
||||||
HW.GFX.Framebuffer_Filler.Fill (linear_fb, fb);
|
(FB => fb,
|
||||||
|
Clear => true,
|
||||||
|
Success => success);
|
||||||
|
|
||||||
HW.GFX.GMA.Update_Outputs (configs);
|
if success then
|
||||||
|
HW.GFX.GMA.Update_Outputs (configs);
|
||||||
|
|
||||||
linear_fb_addr := linear_fb;
|
HW.GFX.GMA.Map_Linear_FB (linear_fb_addr, fb);
|
||||||
fb_valid := true;
|
fb_valid := linear_fb_addr /= 0;
|
||||||
|
|
||||||
lightup_ok := 1;
|
lightup_ok := (if fb_valid then 1 else 0);
|
||||||
|
end if;
|
||||||
end if;
|
end if;
|
||||||
end if;
|
end if;
|
||||||
end gfxinit;
|
end gfxinit;
|
||||||
|
|
|
@ -14,6 +14,6 @@
|
||||||
#ifndef DRIVERS_INTEL_GMA_LIBGFXINIT_H
|
#ifndef DRIVERS_INTEL_GMA_LIBGFXINIT_H
|
||||||
#define DRIVERS_INTEL_GMA_LIBGFXINIT_H
|
#define DRIVERS_INTEL_GMA_LIBGFXINIT_H
|
||||||
|
|
||||||
void gma_gfxinit(u64 mmio_base, u64 linear_fb, u32 phys_fb, int *success);
|
void gma_gfxinit(int *lightup_ok);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -22,11 +22,7 @@ is
|
||||||
|
|
||||||
----------------------------------------------------------------------------
|
----------------------------------------------------------------------------
|
||||||
|
|
||||||
procedure gfxinit
|
procedure gfxinit (lightup_ok : out Interfaces.C.int)
|
||||||
(mmio_base : in word64;
|
|
||||||
linear_fb : in word64;
|
|
||||||
phys_fb : in word32;
|
|
||||||
lightup_ok : out Interfaces.C.int)
|
|
||||||
is
|
is
|
||||||
ports : Port_List;
|
ports : Port_List;
|
||||||
configs : Pipe_Configs;
|
configs : Pipe_Configs;
|
||||||
|
@ -41,9 +37,7 @@ is
|
||||||
begin
|
begin
|
||||||
lightup_ok := 0;
|
lightup_ok := 0;
|
||||||
|
|
||||||
HW.GFX.GMA.Initialize
|
HW.GFX.GMA.Initialize (Success => success);
|
||||||
(MMIO_Base => mmio_base,
|
|
||||||
Success => success);
|
|
||||||
|
|
||||||
if success then
|
if success then
|
||||||
ports := Mainboard.ports;
|
ports := Mainboard.ports;
|
||||||
|
|
|
@ -456,12 +456,6 @@ static void gma_func0_init(struct device *dev)
|
||||||
{
|
{
|
||||||
int lightup_ok = 0;
|
int lightup_ok = 0;
|
||||||
u32 reg32;
|
u32 reg32;
|
||||||
u64 physbase;
|
|
||||||
const struct resource *const linearfb_res =
|
|
||||||
find_resource(dev, PCI_BASE_ADDRESS_2);
|
|
||||||
|
|
||||||
if (!linearfb_res || !linearfb_res->base)
|
|
||||||
return;
|
|
||||||
|
|
||||||
/* IGD needs to be Bus Master */
|
/* IGD needs to be Bus Master */
|
||||||
reg32 = pci_read_config32(dev, PCI_COMMAND);
|
reg32 = pci_read_config32(dev, PCI_COMMAND);
|
||||||
|
@ -476,9 +470,7 @@ static void gma_func0_init(struct device *dev)
|
||||||
|
|
||||||
if (IS_ENABLED(CONFIG_MAINBOARD_USE_LIBGFXINIT)) {
|
if (IS_ENABLED(CONFIG_MAINBOARD_USE_LIBGFXINIT)) {
|
||||||
printk(BIOS_SPEW, "NATIVE graphics, run native enable\n");
|
printk(BIOS_SPEW, "NATIVE graphics, run native enable\n");
|
||||||
physbase = pci_read_config32(dev, 0x5c) & ~0xf;
|
gma_gfxinit(&lightup_ok);
|
||||||
gma_gfxinit(gtt_res->base, linearfb_res->base,
|
|
||||||
physbase, &lightup_ok);
|
|
||||||
gfx_set_init_done(1);
|
gfx_set_init_done(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1061,8 +1061,7 @@ static void gma_func0_init(struct device *dev)
|
||||||
gtt_res->base);
|
gtt_res->base);
|
||||||
if (IS_ENABLED(CONFIG_MAINBOARD_USE_LIBGFXINIT)) {
|
if (IS_ENABLED(CONFIG_MAINBOARD_USE_LIBGFXINIT)) {
|
||||||
int lightup_ok;
|
int lightup_ok;
|
||||||
gma_gfxinit(gtt_res->base, lfb_res->base,
|
gma_gfxinit(&lightup_ok);
|
||||||
physbase, &lightup_ok);
|
|
||||||
} else {
|
} else {
|
||||||
intel_gma_init(conf, res2mmio(gtt_res, 0, 0),
|
intel_gma_init(conf, res2mmio(gtt_res, 0, 0),
|
||||||
physbase, pio_res->base, lfb_res->base);
|
physbase, pio_res->base, lfb_res->base);
|
||||||
|
|
|
@ -648,8 +648,7 @@ static void gma_func0_init(struct device *dev)
|
||||||
|
|
||||||
int lightup_ok;
|
int lightup_ok;
|
||||||
if (IS_ENABLED(CONFIG_MAINBOARD_USE_LIBGFXINIT)) {
|
if (IS_ENABLED(CONFIG_MAINBOARD_USE_LIBGFXINIT)) {
|
||||||
gma_gfxinit((uintptr_t)mmiobase, graphics_base,
|
gma_gfxinit(&lightup_ok);
|
||||||
physbase, &lightup_ok);
|
|
||||||
} else {
|
} else {
|
||||||
lightup_ok = i915lightup_sandy(&conf->gfx, physbase,
|
lightup_ok = i915lightup_sandy(&conf->gfx, physbase,
|
||||||
iobase, mmiobase, graphics_base);
|
iobase, mmiobase, graphics_base);
|
||||||
|
|
Loading…
Reference in New Issue