]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - arch/x86/cpu/ivybridge/gma.c
update to 2015.04-rc1
[karo-tx-uboot.git] / arch / x86 / cpu / ivybridge / gma.c
index 3d7f740273fb29ff96b9751478e466e4e4dd5fff..6cf9654e02a872d327e6c3b5f7a5a0e09dae3033 100644 (file)
 #include <fdtdec.h>
 #include <pci_rom.h>
 #include <asm/io.h>
+#include <asm/mtrr.h>
 #include <asm/pci.h>
 #include <asm/arch/pch.h>
 #include <asm/arch/sandybridge.h>
+#include <linux/kconfig.h>
 
 struct gt_powermeter {
        u16 reg;
@@ -730,7 +732,11 @@ static int int15_handler(void)
 int gma_func0_init(pci_dev_t dev, struct pci_controller *hose,
                   const void *blob, int node)
 {
+#ifdef CONFIG_VIDEO
+       ulong start;
+#endif
        void *gtt_bar;
+       ulong base;
        u32 reg32;
        int ret;
 
@@ -739,14 +745,22 @@ int gma_func0_init(pci_dev_t dev, struct pci_controller *hose,
        reg32 |= PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY | PCI_COMMAND_IO;
        pci_write_config32(dev, PCI_COMMAND, reg32);
 
+       /* Use write-combining for the graphics memory, 256MB */
+       base = pci_read_bar32(hose, dev, 2);
+       mtrr_add_request(MTRR_TYPE_WRCOMB, base, 256 << 20);
+       mtrr_commit(true);
+
        gtt_bar = (void *)pci_read_bar32(pci_bus_to_hose(0), dev, 0);
        debug("GT bar %p\n", gtt_bar);
        ret = gma_pm_init_pre_vbios(gtt_bar);
        if (ret)
                return ret;
 
+#ifdef CONFIG_VIDEO
+       start = get_timer(0);
        ret = pci_run_vga_bios(dev, int15_handler, false);
-
+       debug("BIOS ran in %lums\n", get_timer(start));
+#endif
        /* Post VBIOS init */
        ret = gma_pm_init_post_vbios(gtt_bar, blob, node);
        if (ret)