commit
5ebd27d860
@ -1,156 +0,0 @@ |
||||
/*
|
||||
* From Coreboot file of the same name |
||||
* |
||||
* Copyright (C) 2012 Chromium OS Authors |
||||
* |
||||
* SPDX-License-Identifier: GPL-2.0 |
||||
*/ |
||||
|
||||
/* mailbox 0: header */ |
||||
__packed struct opregion_header { |
||||
u8 signature[16]; |
||||
u32 size; |
||||
u32 version; |
||||
u8 sbios_version[32]; |
||||
u8 vbios_version[16]; |
||||
u8 driver_version[16]; |
||||
u32 mailboxes; |
||||
u8 reserved[164]; |
||||
}; |
||||
|
||||
#define IGD_OPREGION_SIGNATURE "IntelGraphicsMem" |
||||
#define IGD_OPREGION_VERSION 2 |
||||
|
||||
#define IGD_MBOX1 (1 << 0) |
||||
#define IGD_MBOX2 (1 << 1) |
||||
#define IGD_MBOX3 (1 << 2) |
||||
#define IGD_MBOX4 (1 << 3) |
||||
#define IGD_MBOX5 (1 << 4) |
||||
|
||||
#define MAILBOXES_MOBILE (IGD_MBOX1 | IGD_MBOX2 | IGD_MBOX3 | \ |
||||
IGD_MBOX4 | IGD_MBOX5) |
||||
#define MAILBOXES_DESKTOP (IGD_MBOX2 | IGD_MBOX4) |
||||
|
||||
#define SBIOS_VERSION_SIZE 32 |
||||
|
||||
/* mailbox 1: public acpi methods */ |
||||
__packed struct opregion_mailbox1 { |
||||
u32 drdy; |
||||
u32 csts; |
||||
u32 cevt; |
||||
u8 reserved1[20]; |
||||
u32 didl[8]; |
||||
u32 cpdl[8]; |
||||
u32 cadl[8]; |
||||
u32 nadl[8]; |
||||
u32 aslp; |
||||
u32 tidx; |
||||
u32 chpd; |
||||
u32 clid; |
||||
u32 cdck; |
||||
u32 sxsw; |
||||
u32 evts; |
||||
u32 cnot; |
||||
u32 nrdy; |
||||
u8 reserved2[60]; |
||||
}; |
||||
|
||||
/* mailbox 2: software sci interface */ |
||||
__packed struct opregion_mailbox2 { |
||||
u32 scic; |
||||
u32 parm; |
||||
u32 dslp; |
||||
u8 reserved[244]; |
||||
}; |
||||
|
||||
/* mailbox 3: power conservation */ |
||||
__packed struct opregion_mailbox3 { |
||||
u32 ardy; |
||||
u32 aslc; |
||||
u32 tche; |
||||
u32 alsi; |
||||
u32 bclp; |
||||
u32 pfit; |
||||
u32 cblv; |
||||
u16 bclm[20]; |
||||
u32 cpfm; |
||||
u32 epfm; |
||||
u8 plut[74]; |
||||
u32 pfmb; |
||||
u32 ccdv; |
||||
u32 pcft; |
||||
u8 reserved[94]; |
||||
}; |
||||
|
||||
#define IGD_BACKLIGHT_BRIGHTNESS 0xff |
||||
#define IGD_INITIAL_BRIGHTNESS 0x64 |
||||
|
||||
#define IGD_FIELD_VALID (1 << 31) |
||||
#define IGD_WORD_FIELD_VALID (1 << 15) |
||||
#define IGD_PFIT_STRETCH 6 |
||||
|
||||
/* mailbox 4: vbt */ |
||||
__packed struct { |
||||
u8 gvd1[7168]; |
||||
} opregion_vbt_t; |
||||
|
||||
/* IGD OpRegion */ |
||||
__packed struct igd_opregion { |
||||
opregion_header_t header; |
||||
opregion_mailbox1_t mailbox1; |
||||
opregion_mailbox2_t mailbox2; |
||||
opregion_mailbox3_t mailbox3; |
||||
opregion_vbt_t vbt; |
||||
}; |
||||
|
||||
/* Intel Video BIOS (Option ROM) */ |
||||
__packed struct optionrom_header { |
||||
u16 signature; |
||||
u8 size; |
||||
u8 reserved[21]; |
||||
u16 pcir_offset; |
||||
u16 vbt_offset; |
||||
}; |
||||
|
||||
#define OPROM_SIGNATURE 0xaa55 |
||||
|
||||
__packed struct optionrom_pcir { |
||||
u32 signature; |
||||
u16 vendor; |
||||
u16 device; |
||||
u16 reserved1; |
||||
u16 length; |
||||
u8 revision; |
||||
u8 classcode[3]; |
||||
u16 imagelength; |
||||
u16 coderevision; |
||||
u8 codetype; |
||||
u8 indicator; |
||||
u16 reserved2; |
||||
}; |
||||
|
||||
__packed struct optionrom_vbt { |
||||
u8 hdr_signature[20]; |
||||
u16 hdr_version; |
||||
u16 hdr_size; |
||||
u16 hdr_vbt_size; |
||||
u8 hdr_vbt_checksum; |
||||
u8 hdr_reserved; |
||||
u32 hdr_vbt_datablock; |
||||
u32 hdr_aim[4]; |
||||
u8 datahdr_signature[16]; |
||||
u16 datahdr_version; |
||||
u16 datahdr_size; |
||||
u16 datahdr_datablocksize; |
||||
u8 coreblock_id; |
||||
u16 coreblock_size; |
||||
u16 coreblock_biossize; |
||||
u8 coreblock_biostype; |
||||
u8 coreblock_releasestatus; |
||||
u8 coreblock_hwsupported; |
||||
u8 coreblock_integratedhw; |
||||
u8 coreblock_biosbuild[4]; |
||||
u8 coreblock_biossignon[155]; |
||||
}; |
||||
|
||||
#define VBT_SIGNATURE 0x54425624 |
@ -0,0 +1,5 @@ |
||||
/ { |
||||
coreboot-fb { |
||||
compatible = "coreboot-fb"; |
||||
}; |
||||
}; |
@ -1,12 +0,0 @@ |
||||
/*
|
||||
* Copyright (C) 2014 Google, Inc |
||||
* |
||||
* SPDX-License-Identifier: GPL-2.0+ |
||||
*/ |
||||
|
||||
#ifndef _ASM_ARCH_BD82X6X_H |
||||
#define _ASM_ARCH_BD82X6X_H |
||||
|
||||
int gma_func0_init(struct udevice *dev); |
||||
|
||||
#endif |
@ -0,0 +1,23 @@ |
||||
------------------------------ |
||||
U-Boot console UART selection: |
||||
------------------------------ |
||||
|
||||
The U-Boot port for this congatec board currently supports two different |
||||
configurations (defconfig files). The only difference is the UART that |
||||
is used as the U-Boot console UART. The default defconfig file: |
||||
|
||||
conga-qeval20-qa3-e3845_defconfig |
||||
|
||||
provides this console on the UART0 which is provided via a Winbond |
||||
Super-IO chip connected on the congatec Qseven 2.0 evaluation carrier |
||||
board (conga-QEVAL). This UART is the one provided with a SubD9 |
||||
connector on the mainboard (the low one). The 2nd defconfig file: |
||||
|
||||
conga-qeval20-qa3-e3845-internal-uart_defconfig |
||||
|
||||
provides the U-Boot console on the BayTrail internal legacy UART, |
||||
which is routed from the QSeven SoM to the X300 connector on the |
||||
baseboard. Here is called COM2. The baseboard already provides the |
||||
RS232 level shifters. So a TTL-USB UART adapter does not work in |
||||
this case. The signals need to get connected directly to the |
||||
RS232 level signals of the PC UART via some adapter cable. |
@ -0,0 +1,79 @@ |
||||
/*
|
||||
* Copyright (C) 2016, Bin Meng <bmeng.cn@gmail.com> |
||||
* |
||||
* SPDX-License-Identifier: GPL-2.0+ |
||||
*/ |
||||
|
||||
#include <common.h> |
||||
#include <dm.h> |
||||
#include <vbe.h> |
||||
#include <video.h> |
||||
#include <asm/arch/sysinfo.h> |
||||
|
||||
static int save_vesa_mode(struct cb_framebuffer *fb, |
||||
struct vesa_mode_info *vesa) |
||||
{ |
||||
/*
|
||||
* If there is no framebuffer structure, bail out and keep |
||||
* running on the serial console. |
||||
*/ |
||||
if (!fb) |
||||
return -ENXIO; |
||||
|
||||
vesa->x_resolution = fb->x_resolution; |
||||
vesa->y_resolution = fb->y_resolution; |
||||
vesa->bits_per_pixel = fb->bits_per_pixel; |
||||
vesa->bytes_per_scanline = fb->bytes_per_line; |
||||
vesa->phys_base_ptr = fb->physical_address; |
||||
vesa->red_mask_size = fb->red_mask_size; |
||||
vesa->red_mask_pos = fb->red_mask_pos; |
||||
vesa->green_mask_size = fb->green_mask_size; |
||||
vesa->green_mask_pos = fb->green_mask_pos; |
||||
vesa->blue_mask_size = fb->blue_mask_size; |
||||
vesa->blue_mask_pos = fb->blue_mask_pos; |
||||
vesa->reserved_mask_size = fb->reserved_mask_size; |
||||
vesa->reserved_mask_pos = fb->reserved_mask_pos; |
||||
|
||||
return 0; |
||||
} |
||||
|
||||
static int coreboot_video_probe(struct udevice *dev) |
||||
{ |
||||
struct video_uc_platdata *plat = dev_get_uclass_platdata(dev); |
||||
struct video_priv *uc_priv = dev_get_uclass_priv(dev); |
||||
struct cb_framebuffer *fb = lib_sysinfo.framebuffer; |
||||
struct vesa_mode_info *vesa = &mode_info.vesa; |
||||
int ret; |
||||
|
||||
printf("Video: "); |
||||
|
||||
/* Initialize vesa_mode_info structure */ |
||||
ret = save_vesa_mode(fb, vesa); |
||||
if (ret) |
||||
goto err; |
||||
|
||||
ret = vbe_setup_video_priv(vesa, uc_priv, plat); |
||||
if (ret) |
||||
goto err; |
||||
|
||||
printf("%dx%dx%d\n", uc_priv->xsize, uc_priv->ysize, |
||||
vesa->bits_per_pixel); |
||||
|
||||
return 0; |
||||
|
||||
err: |
||||
printf("No video mode configured in coreboot!\n"); |
||||
return ret; |
||||
} |
||||
|
||||
static const struct udevice_id coreboot_video_ids[] = { |
||||
{ .compatible = "coreboot-fb" }, |
||||
{ } |
||||
}; |
||||
|
||||
U_BOOT_DRIVER(coreboot_video) = { |
||||
.name = "coreboot_video", |
||||
.id = UCLASS_VIDEO, |
||||
.of_match = coreboot_video_ids, |
||||
.probe = coreboot_video_probe, |
||||
}; |
@ -1,108 +0,0 @@ |
||||
/*
|
||||
* coreboot Framebuffer driver. |
||||
* |
||||
* Copyright (C) 2011 The Chromium OS authors |
||||
* |
||||
* SPDX-License-Identifier: GPL-2.0+ |
||||
*/ |
||||
|
||||
#include <common.h> |
||||
#include <asm/arch/sysinfo.h> |
||||
#include <vbe.h> |
||||
#include <video_fb.h> |
||||
#include "videomodes.h" |
||||
|
||||
/*
|
||||
* The Graphic Device |
||||
*/ |
||||
GraphicDevice ctfb; |
||||
|
||||
static void save_vesa_mode(void) |
||||
{ |
||||
struct vesa_mode_info *vesa = &mode_info.vesa; |
||||
struct cb_framebuffer *fb = lib_sysinfo.framebuffer; |
||||
|
||||
vesa->x_resolution = fb->x_resolution; |
||||
vesa->y_resolution = fb->y_resolution; |
||||
vesa->bits_per_pixel = fb->bits_per_pixel; |
||||
vesa->bytes_per_scanline = fb->bytes_per_line; |
||||
vesa->phys_base_ptr = fb->physical_address; |
||||
vesa->red_mask_size = fb->red_mask_size; |
||||
vesa->red_mask_pos = fb->red_mask_pos; |
||||
vesa->green_mask_size = fb->green_mask_size; |
||||
vesa->green_mask_pos = fb->green_mask_pos; |
||||
vesa->blue_mask_size = fb->blue_mask_size; |
||||
vesa->blue_mask_pos = fb->blue_mask_pos; |
||||
vesa->reserved_mask_size = fb->reserved_mask_size; |
||||
vesa->reserved_mask_pos = fb->reserved_mask_pos; |
||||
} |
||||
|
||||
static int parse_coreboot_table_fb(GraphicDevice *gdev) |
||||
{ |
||||
struct cb_framebuffer *fb = lib_sysinfo.framebuffer; |
||||
|
||||
/* If there is no framebuffer structure, bail out and keep
|
||||
* running on the serial console. |
||||
*/ |
||||
if (!fb) |
||||
return 0; |
||||
|
||||
gdev->winSizeX = fb->x_resolution; |
||||
gdev->winSizeY = fb->y_resolution; |
||||
|
||||
gdev->plnSizeX = fb->x_resolution; |
||||
gdev->plnSizeY = fb->y_resolution; |
||||
|
||||
gdev->gdfBytesPP = fb->bits_per_pixel / 8; |
||||
|
||||
switch (fb->bits_per_pixel) { |
||||
case 24: |
||||
gdev->gdfIndex = GDF_32BIT_X888RGB; |
||||
break; |
||||
case 16: |
||||
gdev->gdfIndex = GDF_16BIT_565RGB; |
||||
break; |
||||
default: |
||||
gdev->gdfIndex = GDF__8BIT_INDEX; |
||||
break; |
||||
} |
||||
|
||||
gdev->isaBase = CONFIG_SYS_ISA_IO_BASE_ADDRESS; |
||||
gdev->pciBase = (unsigned int)fb->physical_address; |
||||
|
||||
gdev->frameAdrs = (unsigned int)fb->physical_address; |
||||
gdev->memSize = fb->bytes_per_line * fb->y_resolution; |
||||
|
||||
gdev->vprBase = (unsigned int)fb->physical_address; |
||||
gdev->cprBase = (unsigned int)fb->physical_address; |
||||
|
||||
return 1; |
||||
} |
||||
|
||||
void *video_hw_init(void) |
||||
{ |
||||
GraphicDevice *gdev = &ctfb; |
||||
int bits_per_pixel; |
||||
|
||||
printf("Video: "); |
||||
|
||||
if (!parse_coreboot_table_fb(gdev)) { |
||||
printf("No video mode configured in coreboot!\n"); |
||||
return NULL; |
||||
} |
||||
|
||||
bits_per_pixel = gdev->gdfBytesPP * 8; |
||||
|
||||
/* fill in Graphic device struct */ |
||||
sprintf(gdev->modeIdent, "%dx%dx%d", gdev->winSizeX, gdev->winSizeY, |
||||
bits_per_pixel); |
||||
printf("%s\n", gdev->modeIdent); |
||||
|
||||
memset((void *)gdev->pciBase, 0, |
||||
gdev->winSizeX * gdev->winSizeY * gdev->gdfBytesPP); |
||||
|
||||
/* Initialize vesa_mode_info structure */ |
||||
save_vesa_mode(); |
||||
|
||||
return (void *)gdev; |
||||
} |
@ -0,0 +1,34 @@ |
||||
/*
|
||||
* Copyright (C) 2016, Bin Meng <bmeng.cn@gmail.com> |
||||
* |
||||
* SPDX-License-Identifier: GPL-2.0+ |
||||
*/ |
||||
|
||||
#include <common.h> |
||||
#include <dm.h> |
||||
#include <pci.h> |
||||
#include <vbe.h> |
||||
|
||||
static int vesa_video_probe(struct udevice *dev) |
||||
{ |
||||
return vbe_setup_video(dev, NULL); |
||||
} |
||||
|
||||
static const struct udevice_id vesa_video_ids[] = { |
||||
{ .compatible = "vesa-fb" }, |
||||
{ } |
||||
}; |
||||
|
||||
U_BOOT_DRIVER(vesa_video) = { |
||||
.name = "vesa_video", |
||||
.id = UCLASS_VIDEO, |
||||
.of_match = vesa_video_ids, |
||||
.probe = vesa_video_probe, |
||||
}; |
||||
|
||||
static struct pci_device_id vesa_video_supported[] = { |
||||
{ PCI_DEVICE_CLASS(PCI_CLASS_DISPLAY_VGA << 8, ~0) }, |
||||
{ }, |
||||
}; |
||||
|
||||
U_BOOT_PCI_DEVICE(vesa_video, vesa_video_supported); |
@ -1,63 +0,0 @@ |
||||
/*
|
||||
* VESA frame buffer driver |
||||
* |
||||
* Copyright (C) 2014 Google, Inc |
||||
* |
||||
* SPDX-License-Identifier: GPL-2.0+ |
||||
*/ |
||||
|
||||
#include <common.h> |
||||
#include <pci_rom.h> |
||||
#include <video_fb.h> |
||||
#include <vbe.h> |
||||
|
||||
/*
|
||||
* The Graphic Device |
||||
*/ |
||||
GraphicDevice ctfb; |
||||
|
||||
void *video_hw_init(void) |
||||
{ |
||||
GraphicDevice *gdev = &ctfb; |
||||
struct udevice *dev; |
||||
int bits_per_pixel; |
||||
int ret; |
||||
|
||||
printf("Video: "); |
||||
if (!ll_boot_init()) { |
||||
/*
|
||||
* If we are running from EFI or coreboot, this driver can't |
||||
* work. |
||||
*/ |
||||
printf("Not available (previous bootloader prevents it)\n"); |
||||
return NULL; |
||||
} |
||||
if (vbe_get_video_info(gdev)) { |
||||
ret = dm_pci_find_class(PCI_CLASS_DISPLAY_VGA << 8, 0, &dev); |
||||
if (ret) { |
||||
printf("no card detected\n"); |
||||
return NULL; |
||||
} |
||||
bootstage_start(BOOTSTAGE_ID_ACCUM_LCD, "vesa display"); |
||||
ret = dm_pci_run_vga_bios(dev, NULL, PCI_ROM_USE_NATIVE | |
||||
PCI_ROM_ALLOW_FALLBACK); |
||||
bootstage_accum(BOOTSTAGE_ID_ACCUM_LCD); |
||||
if (ret) { |
||||
printf("failed to run video BIOS: %d\n", ret); |
||||
return NULL; |
||||
} |
||||
} |
||||
|
||||
if (vbe_get_video_info(gdev)) { |
||||
printf("No video mode configured\n"); |
||||
return NULL; |
||||
} |
||||
|
||||
bits_per_pixel = gdev->gdfBytesPP * 8; |
||||
sprintf(gdev->modeIdent, "%dx%dx%d", gdev->winSizeX, gdev->winSizeY, |
||||
bits_per_pixel); |
||||
printf("%s\n", gdev->modeIdent); |
||||
debug("Frame buffer at %x\n", gdev->pciBase); |
||||
|
||||
return (void *)gdev; |
||||
} |
Loading…
Reference in new issue