Commit 443ffe509c7bedca440fbd37e3853895c8fe31f2
Committed by
Bin Meng
1 parent
0d9483a25c
Exists in
v2017.01-smarct4x
and in
25 other branches
dm: x86: Move samus to use new driver model support
Update the samus driver to avoid the direct call to the video BIOS setup. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Showing 2 changed files with 7 additions and 33 deletions Side-by-side Diff
arch/x86/cpu/broadwell/sdram.c
drivers/video/broadwell_igd.c
... | ... | @@ -9,10 +9,8 @@ |
9 | 9 | #include <common.h> |
10 | 10 | #include <bios_emul.h> |
11 | 11 | #include <dm.h> |
12 | -#include <pci_rom.h> | |
13 | 12 | #include <vbe.h> |
14 | 13 | #include <video.h> |
15 | -#include <video_fb.h> | |
16 | 14 | #include <asm/cpu.h> |
17 | 15 | #include <asm/intel_regs.h> |
18 | 16 | #include <asm/io.h> |
19 | 17 | |
... | ... | @@ -20,11 +18,9 @@ |
20 | 18 | #include <asm/arch/cpu.h> |
21 | 19 | #include <asm/arch/iomap.h> |
22 | 20 | #include <asm/arch/pch.h> |
23 | -#include <linux/log2.h> | |
24 | 21 | #include "i915_reg.h" |
25 | 22 | |
26 | 23 | struct broadwell_igd_priv { |
27 | - GraphicDevice ctfb; | |
28 | 24 | u8 *regs; |
29 | 25 | }; |
30 | 26 | |
31 | 27 | |
... | ... | @@ -664,10 +660,7 @@ |
664 | 660 | { |
665 | 661 | struct video_uc_platdata *plat = dev_get_uclass_platdata(dev); |
666 | 662 | struct video_priv *uc_priv = dev_get_uclass_priv(dev); |
667 | - struct broadwell_igd_priv *priv = dev_get_priv(dev); | |
668 | 663 | bool is_broadwell; |
669 | - GraphicDevice *gdev = &priv->ctfb; | |
670 | - int bits_per_pixel; | |
671 | 664 | int ret; |
672 | 665 | |
673 | 666 | if (!ll_boot_init()) { |
... | ... | @@ -683,13 +676,9 @@ |
683 | 676 | debug("%s: is_broadwell=%d\n", __func__, is_broadwell); |
684 | 677 | ret = igd_pre_init(dev, is_broadwell); |
685 | 678 | if (!ret) { |
686 | - ret = dm_pci_run_vga_bios(dev, broadwell_igd_int15_handler, | |
687 | - PCI_ROM_USE_NATIVE | | |
688 | - PCI_ROM_ALLOW_FALLBACK); | |
689 | - if (ret) { | |
690 | - printf("failed to run video BIOS: %d\n", ret); | |
691 | - ret = -EIO; | |
692 | - } | |
679 | + ret = vbe_setup_video(dev, broadwell_igd_int15_handler); | |
680 | + if (ret) | |
681 | + debug("failed to run video BIOS: %d\n", ret); | |
693 | 682 | } |
694 | 683 | if (!ret) |
695 | 684 | ret = igd_post_init(dev, is_broadwell); |
... | ... | @@ -697,13 +686,8 @@ |
697 | 686 | if (ret) |
698 | 687 | return ret; |
699 | 688 | |
700 | - if (vbe_get_video_info(gdev)) { | |
701 | - printf("No video mode configured\n"); | |
702 | - return -ENXIO; | |
703 | - } | |
704 | - | |
705 | - /* Use write-through for the graphics memory, 256MB */ | |
706 | - ret = mtrr_add_request(MTRR_TYPE_WRTHROUGH, gdev->pciBase, 256 << 20); | |
689 | + /* Use write-combining for the graphics memory, 256MB */ | |
690 | + ret = mtrr_add_request(MTRR_TYPE_WRCOMB, plat->base, 256 << 20); | |
707 | 691 | if (!ret) |
708 | 692 | ret = mtrr_commit(true); |
709 | 693 | if (ret && ret != -ENOSYS) { |
... | ... | @@ -711,17 +695,8 @@ |
711 | 695 | ret); |
712 | 696 | } |
713 | 697 | |
714 | - bits_per_pixel = gdev->gdfBytesPP * 8; | |
715 | - sprintf(gdev->modeIdent, "%dx%dx%d", gdev->winSizeX, gdev->winSizeY, | |
716 | - bits_per_pixel); | |
717 | - printf("%s\n", gdev->modeIdent); | |
718 | - uc_priv->xsize = gdev->winSizeX; | |
719 | - uc_priv->ysize = gdev->winSizeY; | |
720 | - uc_priv->bpix = ilog2(bits_per_pixel); | |
721 | - plat->base = gdev->pciBase; | |
722 | - plat->size = gdev->memSize; | |
723 | - debug("fb=%x, size %x, display size=%d %d %d\n", gdev->pciBase, | |
724 | - gdev->memSize, uc_priv->xsize, uc_priv->ysize, uc_priv->bpix); | |
698 | + debug("fb=%lx, size %x, display size=%d %d %d\n", plat->base, | |
699 | + plat->size, uc_priv->xsize, uc_priv->ysize, uc_priv->bpix); | |
725 | 700 | |
726 | 701 | return 0; |
727 | 702 | } |