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>
This commit is contained in:
parent
0d9483a25c
commit
443ffe509c
@ -291,7 +291,6 @@ void board_debug_uart_init(void)
|
|||||||
|
|
||||||
static const struct udevice_id broadwell_syscon_ids[] = {
|
static const struct udevice_id broadwell_syscon_ids[] = {
|
||||||
{ .compatible = "intel,me", .data = X86_SYSCON_ME },
|
{ .compatible = "intel,me", .data = X86_SYSCON_ME },
|
||||||
{ .compatible = "intel,gma", .data = X86_SYSCON_GMA },
|
|
||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -9,10 +9,8 @@
|
|||||||
#include <common.h>
|
#include <common.h>
|
||||||
#include <bios_emul.h>
|
#include <bios_emul.h>
|
||||||
#include <dm.h>
|
#include <dm.h>
|
||||||
#include <pci_rom.h>
|
|
||||||
#include <vbe.h>
|
#include <vbe.h>
|
||||||
#include <video.h>
|
#include <video.h>
|
||||||
#include <video_fb.h>
|
|
||||||
#include <asm/cpu.h>
|
#include <asm/cpu.h>
|
||||||
#include <asm/intel_regs.h>
|
#include <asm/intel_regs.h>
|
||||||
#include <asm/io.h>
|
#include <asm/io.h>
|
||||||
@ -20,11 +18,9 @@
|
|||||||
#include <asm/arch/cpu.h>
|
#include <asm/arch/cpu.h>
|
||||||
#include <asm/arch/iomap.h>
|
#include <asm/arch/iomap.h>
|
||||||
#include <asm/arch/pch.h>
|
#include <asm/arch/pch.h>
|
||||||
#include <linux/log2.h>
|
|
||||||
#include "i915_reg.h"
|
#include "i915_reg.h"
|
||||||
|
|
||||||
struct broadwell_igd_priv {
|
struct broadwell_igd_priv {
|
||||||
GraphicDevice ctfb;
|
|
||||||
u8 *regs;
|
u8 *regs;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -664,10 +660,7 @@ static int broadwell_igd_probe(struct udevice *dev)
|
|||||||
{
|
{
|
||||||
struct video_uc_platdata *plat = dev_get_uclass_platdata(dev);
|
struct video_uc_platdata *plat = dev_get_uclass_platdata(dev);
|
||||||
struct video_priv *uc_priv = dev_get_uclass_priv(dev);
|
struct video_priv *uc_priv = dev_get_uclass_priv(dev);
|
||||||
struct broadwell_igd_priv *priv = dev_get_priv(dev);
|
|
||||||
bool is_broadwell;
|
bool is_broadwell;
|
||||||
GraphicDevice *gdev = &priv->ctfb;
|
|
||||||
int bits_per_pixel;
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!ll_boot_init()) {
|
if (!ll_boot_init()) {
|
||||||
@ -683,13 +676,9 @@ static int broadwell_igd_probe(struct udevice *dev)
|
|||||||
debug("%s: is_broadwell=%d\n", __func__, is_broadwell);
|
debug("%s: is_broadwell=%d\n", __func__, is_broadwell);
|
||||||
ret = igd_pre_init(dev, is_broadwell);
|
ret = igd_pre_init(dev, is_broadwell);
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
ret = dm_pci_run_vga_bios(dev, broadwell_igd_int15_handler,
|
ret = vbe_setup_video(dev, broadwell_igd_int15_handler);
|
||||||
PCI_ROM_USE_NATIVE |
|
if (ret)
|
||||||
PCI_ROM_ALLOW_FALLBACK);
|
debug("failed to run video BIOS: %d\n", ret);
|
||||||
if (ret) {
|
|
||||||
printf("failed to run video BIOS: %d\n", ret);
|
|
||||||
ret = -EIO;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (!ret)
|
if (!ret)
|
||||||
ret = igd_post_init(dev, is_broadwell);
|
ret = igd_post_init(dev, is_broadwell);
|
||||||
@ -697,13 +686,8 @@ static int broadwell_igd_probe(struct udevice *dev)
|
|||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
if (vbe_get_video_info(gdev)) {
|
/* Use write-combining for the graphics memory, 256MB */
|
||||||
printf("No video mode configured\n");
|
ret = mtrr_add_request(MTRR_TYPE_WRCOMB, plat->base, 256 << 20);
|
||||||
return -ENXIO;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Use write-through for the graphics memory, 256MB */
|
|
||||||
ret = mtrr_add_request(MTRR_TYPE_WRTHROUGH, gdev->pciBase, 256 << 20);
|
|
||||||
if (!ret)
|
if (!ret)
|
||||||
ret = mtrr_commit(true);
|
ret = mtrr_commit(true);
|
||||||
if (ret && ret != -ENOSYS) {
|
if (ret && ret != -ENOSYS) {
|
||||||
@ -711,17 +695,8 @@ static int broadwell_igd_probe(struct udevice *dev)
|
|||||||
ret);
|
ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
bits_per_pixel = gdev->gdfBytesPP * 8;
|
debug("fb=%lx, size %x, display size=%d %d %d\n", plat->base,
|
||||||
sprintf(gdev->modeIdent, "%dx%dx%d", gdev->winSizeX, gdev->winSizeY,
|
plat->size, uc_priv->xsize, uc_priv->ysize, uc_priv->bpix);
|
||||||
bits_per_pixel);
|
|
||||||
printf("%s\n", gdev->modeIdent);
|
|
||||||
uc_priv->xsize = gdev->winSizeX;
|
|
||||||
uc_priv->ysize = gdev->winSizeY;
|
|
||||||
uc_priv->bpix = ilog2(bits_per_pixel);
|
|
||||||
plat->base = gdev->pciBase;
|
|
||||||
plat->size = gdev->memSize;
|
|
||||||
debug("fb=%x, size %x, display size=%d %d %d\n", gdev->pciBase,
|
|
||||||
gdev->memSize, uc_priv->xsize, uc_priv->ysize, uc_priv->bpix);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user