- dm video cosmetic style fix
 - bochs: remove the x86 limitation
 - correct kconfig text for PCI default FB size
 - kconfig: drop the superfluous PCI dependency
 - set up default FB size for Bochs
This commit is contained in:
Tom Rini
2023-08-01 10:17:49 -04:00
5 changed files with 29 additions and 29 deletions

View File

@@ -64,8 +64,9 @@ config BACKLIGHT
config VIDEO_PCI_DEFAULT_FB_SIZE
hex "Default framebuffer size to use if no drivers request it"
default 0x1000000 if X86 && PCI
default 0 if !(X86 && PCI)
default 0x1000000 if X86
default 0x800000 if !X86 && VIDEO_BOCHS
default 0 if !X86 && !VIDEO_BOCHS
help
Generally, video drivers request the amount of memory they need for
the frame buffer when they are bound, by setting the size field in
@@ -77,7 +78,7 @@ config VIDEO_PCI_DEFAULT_FB_SIZE
devices to have a framebuffer allocated by U-Boot.
Note: the framebuffer needs to be large enough to store all pixels at
maximum resolution. For example, at 1920 x 1200 with 32 bits per
maximum resolution. For example, at 2560 x 1600 with 32 bits per
pixel, 2560 * 1600 * 32 / 8 = 0xfa0000 bytes are needed.
config VIDEO_COPY
@@ -280,7 +281,6 @@ config VIDCONSOLE_AS_NAME
config VIDEO_BOCHS
bool "Enable Bochs video emulation for QEMU"
depends on X86
help
Enable this to use the Bochs video support provided in the QEMU
emulator. This appears as a PCI device which U-Boot can set up to
@@ -1037,8 +1037,9 @@ config SPL_SYS_WHITE_ON_BLACK
config SPL_VIDEO_PCI_DEFAULT_FB_SIZE
hex "Default framebuffer size to use if no drivers request it at SPL"
default 0x1000000 if X86 && PCI
default 0 if !(X86 && PCI)
default 0x1000000 if X86
default 0x800000 if !X86 && VIDEO_BOCHS
default 0 if !X86 && !VIDEO_BOCHS
help
Generally, video drivers request the amount of memory they need for
the frame buffer when they are bound, by setting the size field in
@@ -1050,7 +1051,7 @@ config SPL_VIDEO_PCI_DEFAULT_FB_SIZE
devices to have a framebuffer allocated by U-Boot.
Note: the framebuffer needs to be large enough to store all pixels at
maximum resolution. For example, at 1920 x 1200 with 32 bits per
maximum resolution. For example, at 2560 x 1600 with 32 bits per
pixel, 2560 * 1600 * 32 / 8 = 0xfa0000 bytes are needed.
config SPL_CONSOLE_SCROLL_LINES

View File

@@ -11,7 +11,6 @@
#include <pci.h>
#include <video.h>
#include <asm/io.h>
#include <asm/mtrr.h>
#include <linux/sizes.h>
#include "bochs.h"
@@ -28,9 +27,9 @@ static int bochs_read(void *mmio, int index)
return readw(mmio + MMIO_BASE + index * 2);
}
static void bochs_vga_write(int index, uint8_t val)
static void bochs_vga_write(void *mmio, int index, uint8_t val)
{
outb(val, VGA_INDEX);
writeb(val, mmio + VGA_BASE + index);
}
static int bochs_init_fb(struct udevice *dev)
@@ -79,7 +78,8 @@ static int bochs_init_fb(struct udevice *dev)
bochs_write(mmio, INDEX_Y_OFFSET, 0);
bochs_write(mmio, INDEX_ENABLE, ENABLED | LFB_ENABLED);
bochs_vga_write(0, 0x20); /* disable blanking */
/* disable blanking */
bochs_vga_write(mmio, VGA_ATT_W - VGA_INDEX, VGA_AR_ENABLE_DISPLAY);
plat->base = fb;
@@ -101,8 +101,8 @@ static int bochs_video_bind(struct udevice *dev)
{
struct video_uc_plat *uc_plat = dev_get_uclass_plat(dev);
/* Set the maximum supported resolution */
uc_plat->size = 2560 * 1600 * 4;
/* Set the frame buffer size per configuration */
uc_plat->size = xsize * ysize * 32 / 8;
log_debug("%s: Frame buffer size %x\n", __func__, uc_plat->size);
return 0;

View File

@@ -6,10 +6,10 @@
#ifndef __BOCHS_H
#define __BOCHS_H
#define VGA_INDEX 0x3c0
#define VGA_INDEX 0x3c0
#define IOPORT_INDEX 0x01ce
#define IOPORT_DATA 0x01cf
#define VGA_ATT_W 0x3c0
#define VGA_AR_ENABLE_DISPLAY 0x20
enum {
INDEX_ID,
@@ -31,6 +31,7 @@ enum {
#define LFB_ENABLED BIT(6)
#define NOCLEARMEM BIT(7)
#define VGA_BASE 0x400
#define MMIO_BASE 0x500
#endif

View File

@@ -901,18 +901,10 @@ static int tidss_drv_probe(struct udevice *dev)
static int tidss_drv_remove(struct udevice *dev)
{
u32 val;
int ret;
struct tidss_drv_priv *priv = dev_get_priv(dev);
if (CONFIG_IS_ENABLED(VIDEO_REMOVE)) {
struct tidss_drv_priv *priv = dev_get_priv(dev);
priv->base_common = dev_remap_addr_index(dev, 0);
REG_FLD_MOD(priv, DSS_SYSCONFIG, 1, 1, 1);
/* Wait for reset to complete */
ret = readl_poll_timeout(priv->base_common + DSS_SYSSTATUS,
val, val & 1, 5000);
if (ret) {
dev_warn(priv->dev, "failed to reset priv\n");
return ret;
VP_REG_FLD_MOD(priv, 0, DSS_VP_CONTROL, 0, 0, 0);
}
return 0;
}
@@ -939,5 +931,9 @@ U_BOOT_DRIVER(tidss_drv) = {
.probe = tidss_drv_probe,
.remove = tidss_drv_remove,
.priv_auto = sizeof(struct tidss_drv_priv),
#if CONFIG_IS_ENABLED(VIDEO_REMOVE)
.flags = DM_FLAG_OS_PREPARE,
#else
.flags = DM_FLAG_OS_PREPARE | DM_FLAG_LEAVE_PD_ON,
#endif
};

View File

@@ -626,10 +626,12 @@ static int video_post_bind(struct udevice *dev)
addr = uc_priv->video_ptr;
size = alloc_fb(dev, &addr);
if (addr < gd->video_bottom) {
/* Device tree node may need the 'bootph-all' or
/*
* Device tree node may need the 'bootph-all' or
* 'bootph-some-ram' tag
*/
printf("Video device '%s' cannot allocate frame buffer memory -ensure the device is set up before relocation\n",
printf("Video device '%s' cannot allocate frame buffer memory "
"- ensure the device is set up before relocation\n",
dev->name);
return -ENOSPC;
}