All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@hp.com>
To: Hollis Blanchard <hollisb@us.ibm.com>
Cc: xen-ppc-devel@lists.xensource.com, xen-devel@lists.xensource.com,
	xen-ia64-devel@lists.xensource.com
Subject: Re: [PATCH] [POWERPC] fix vga.c compilation
Date: Tue, 15 Aug 2006 18:03:45 -0600	[thread overview]
Message-ID: <1155686625.5587.21.camel@lappy> (raw)
In-Reply-To: <2250d38aed3854c626bd.1155683316@basalt.austin.ibm.com>

On Tue, 2006-08-15 at 18:08 -0500, Hollis Blanchard wrote:
> # HG changeset patch
> # User Hollis Blanchard <hollisb@us.ibm.com>
> # Date 1155683306 18000
> # Node ID 2250d38aed3854c626bdc642a91884754f9d12d8
> # Parent  6dcd85ea232e0de5445f325abd0829a0ed6d56a1
> [POWERPC] fix vga.c compilation
> - replace vga_readb/writeb with plain readb/writeb
> - add per-arch vga.c and vga.h
> - make detect_video() a per-arch function
> - stop doing void* arithmetic
> - remove i386 ifdef

   Thanks Hollis.  Keir, here's a patch that applies on top of the one
from Hollis that fixes up ia64 support for VGA console.  Included is a
bug fix in the font setup that accessed the legacy VGA MMIO range as
cacheable memory.  Thanks,

	Alex

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
---

diff -r b7cf184c3008 xen/arch/ia64/xen/domain.c
--- a/xen/arch/ia64/xen/domain.c	Tue Aug 15 17:20:11 2006 -0600
+++ b/xen/arch/ia64/xen/domain.c	Tue Aug 15 17:57:48 2006 -0600
@@ -864,6 +864,7 @@ int construct_dom0(struct domain *d,
 {
 	int i, rc;
 	start_info_t *si;
+	dom0_vga_console_info_t *ci;
 	struct vcpu *v = d->vcpu[0];
 	unsigned long max_pages;
 
@@ -1000,6 +1001,9 @@ int construct_dom0(struct domain *d,
 	//if ( initrd_len != 0 )
 	//    memcpy((void *)vinitrd_start, initrd_start, initrd_len);
 
+	BUILD_BUG_ON(sizeof(start_info_t) + sizeof(dom0_vga_console_info_t) +
+	             sizeof(struct ia64_boot_param) > PAGE_SIZE);
+
 	/* Set up start info area. */
 	d->shared_info->arch.start_info_pfn = pstart_info >> PAGE_SHIFT;
 	start_info_page = assign_new_domain_page(d, pstart_info);
@@ -1034,7 +1038,8 @@ int construct_dom0(struct domain *d,
 	strncpy((char *)si->cmd_line, dom0_command_line, sizeof(si->cmd_line));
 	si->cmd_line[sizeof(si->cmd_line)-1] = 0;
 
-	bp = (struct ia64_boot_param *)(si + 1);
+	bp = (struct ia64_boot_param *)((unsigned char *)si +
+	                                sizeof(start_info_t));
 	bp->command_line = pstart_info + offsetof (start_info_t, cmd_line);
 
 	/* We assume console has reached the last line!  */
@@ -1048,6 +1053,16 @@ int construct_dom0(struct domain *d,
 	             (PAGE_ALIGN(ia64_boot_param->initrd_size) + 4*1024*1024);
 	bp->initrd_size = ia64_boot_param->initrd_size;
 
+	ci = (dom0_vga_console_info_t *)((unsigned char *)si +
+			                 sizeof(start_info_t) +
+	                                 sizeof(struct ia64_boot_param));
+
+	if (fill_console_start_info(ci)) {
+		si->console.dom0.info_off = sizeof(start_info_t) +
+		                            sizeof(struct ia64_boot_param);
+		si->console.dom0.info_size = sizeof(dom0_vga_console_info_t);
+	}
+
 	vcpu_init_regs (v);
 
 	vcpu_regs(v)->r28 = bp_mpa;
diff -r b7cf184c3008 xen/arch/ia64/xen/vga.c
--- a/xen/arch/ia64/xen/vga.c	Tue Aug 15 17:20:11 2006 -0600
+++ b/xen/arch/ia64/xen/vga.c	Tue Aug 15 17:57:48 2006 -0600
@@ -19,9 +19,9 @@
  */
 
 #include <xen/vga.h>
+#include <linux/efi.h>
 
 int detect_vga(void)
 {
-	/* disabled completely for now */
-    return 0;
+    return (efi_mem_type(0xA0000) != EFI_CONVENTIONAL_MEMORY);
 }
diff -r b7cf184c3008 xen/drivers/video/vga.c
--- a/xen/drivers/video/vga.c	Tue Aug 15 17:20:11 2006 -0600
+++ b/xen/drivers/video/vga.c	Tue Aug 15 17:57:48 2006 -0600
@@ -472,7 +472,9 @@ int vga_load_font(const struct font_desc
     {
         unsigned i, j;
         const uint8_t *data = font->data;
-        uint8_t *map = (uint8_t *)__va(0xA0000) + font_slot*2*CHAR_MAP_SIZE;
+        uint8_t *map = (uint8_t *)0xA0000 + font_slot*2*CHAR_MAP_SIZE;
+
+        map = ioremap(map, CHAR_MAP_SIZE);
 
         for ( i = j = 0; i < CHAR_MAP_SIZE; )
         {
diff -r b7cf184c3008 xen/include/asm-ia64/vga.h
--- a/xen/include/asm-ia64/vga.h	Tue Aug 15 17:20:11 2006 -0600
+++ b/xen/include/asm-ia64/vga.h	Tue Aug 15 17:57:48 2006 -0600
@@ -24,10 +24,4 @@
 #define vgabase 0
 #define VGA_OUTW_WRITE
 
-static int detect_vga(void)
-{
-	/* disabled completely for now */
-	return 0;
-}
-
 #endif /* _ASM_VGA_H_ */
diff -r b7cf184c3008 linux-2.6-xen-sparse/arch/ia64/dig/setup.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/linux-2.6-xen-sparse/arch/ia64/dig/setup.c	Tue Aug 15 17:57:48 2006 -0600
@@ -0,0 +1,110 @@
+/*
+ * Platform dependent support for DIG64 platforms.
+ *
+ * Copyright (C) 1999 Intel Corp.
+ * Copyright (C) 1999, 2001 Hewlett-Packard Co
+ * Copyright (C) 1999, 2001, 2003 David Mosberger-Tang <davidm@hpl.hp.com>
+ * Copyright (C) 1999 VA Linux Systems
+ * Copyright (C) 1999 Walt Drummond <drummond@valinux.com>
+ * Copyright (C) 1999 Vijay Chander <vijay@engr.sgi.com>
+ */
+#include <linux/config.h>
+
+#include <linux/init.h>
+#include <linux/delay.h>
+#include <linux/kernel.h>
+#include <linux/kdev_t.h>
+#include <linux/string.h>
+#include <linux/tty.h>
+#include <linux/console.h>
+#include <linux/timex.h>
+#include <linux/sched.h>
+#include <linux/root_dev.h>
+
+#include <asm/io.h>
+#include <asm/machvec.h>
+#include <asm/system.h>
+
+void __init
+dig_setup (char **cmdline_p)
+{
+	unsigned int orig_x, orig_y, num_cols, num_rows, font_height;
+
+	/*
+	 * Default to /dev/sda2.  This assumes that the EFI partition
+	 * is physical disk 1 partition 1 and the Linux root disk is
+	 * physical disk 1 partition 2.
+	 */
+	ROOT_DEV = Root_SDA2;		/* default to second partition on first drive */
+
+#ifdef CONFIG_SMP
+	init_smp_config();
+#endif
+
+	memset(&screen_info, 0, sizeof(screen_info));
+
+	if (!ia64_boot_param->console_info.num_rows
+	    || !ia64_boot_param->console_info.num_cols)
+	{
+		printk(KERN_WARNING "dig_setup: warning: invalid screen-info, guessing 80x25\n");
+		orig_x = 0;
+		orig_y = 0;
+		num_cols = 80;
+		num_rows = 25;
+		font_height = 16;
+	} else {
+		orig_x = ia64_boot_param->console_info.orig_x;
+		orig_y = ia64_boot_param->console_info.orig_y;
+		num_cols = ia64_boot_param->console_info.num_cols;
+		num_rows = ia64_boot_param->console_info.num_rows;
+		font_height = 400 / num_rows;
+	}
+
+	screen_info.orig_x = orig_x;
+	screen_info.orig_y = orig_y;
+	screen_info.orig_video_cols  = num_cols;
+	screen_info.orig_video_lines = num_rows;
+	screen_info.orig_video_points = font_height;
+	screen_info.orig_video_mode = 3;	/* XXX fake */
+	screen_info.orig_video_isVGA = 1;	/* XXX fake */
+	screen_info.orig_video_ega_bx = 3;	/* XXX fake */
+#ifdef CONFIG_XEN
+	if (!is_running_on_xen())
+		return;
+
+	if (xen_start_info->console.dom0.info_size >=
+	    sizeof(struct dom0_vga_console_info)) {
+		const struct dom0_vga_console_info *info =
+		        (struct dom0_vga_console_info *)(
+		                (char *)xen_start_info +
+		                xen_start_info->console.dom0.info_off);
+		screen_info.orig_video_mode = info->txt_mode;
+		screen_info.orig_video_isVGA = info->video_type;
+		screen_info.orig_video_lines = info->video_height;
+		screen_info.orig_video_cols = info->video_width;
+		screen_info.orig_video_points = info->txt_points;
+		screen_info.lfb_width = info->video_width;
+		screen_info.lfb_height = info->video_height;
+		screen_info.lfb_depth = info->lfb_depth;
+		screen_info.lfb_base = info->lfb_base;
+		screen_info.lfb_size = info->lfb_size;
+		screen_info.lfb_linelength = info->lfb_linelen;
+		screen_info.red_size = info->red_size;
+		screen_info.red_pos = info->red_pos;
+		screen_info.green_size = info->green_size;
+		screen_info.green_pos = info->green_pos;
+		screen_info.blue_size = info->blue_size;
+		screen_info.blue_pos = info->blue_pos;
+		screen_info.rsvd_size = info->rsvd_size;
+		screen_info.rsvd_pos = info->rsvd_pos;
+	}
+	screen_info.orig_y = screen_info.orig_video_lines - 1;
+	xen_start_info->console.domU.mfn = 0;
+	xen_start_info->console.domU.evtchn = 0;
+#endif
+}
+
+void __init
+dig_irq_init (void)
+{
+}

  reply	other threads:[~2006-08-16  0:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-15 23:08 [PATCH] [POWERPC] fix vga.c compilation Hollis Blanchard
2006-08-16  0:03 ` Alex Williamson [this message]
2006-08-16  0:30 ` [XenPPC] " Hollis Blanchard
2006-08-16  9:15   ` Keir Fraser
2006-08-16 10:49     ` Keir Fraser
2006-08-16 13:59       ` Alex Williamson
2006-08-16 14:24         ` [Xen-devel] " Keir Fraser
2006-08-16 14:48           ` Re: [XenPPC] " Alex Williamson
2006-08-16 15:35       ` Hollis Blanchard
2006-08-16 15:40         ` [Xen-devel] " Keir Fraser
2006-08-16 16:10           ` Hollis Blanchard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1155686625.5587.21.camel@lappy \
    --to=alex.williamson@hp.com \
    --cc=hollisb@us.ibm.com \
    --cc=xen-devel@lists.xensource.com \
    --cc=xen-ia64-devel@lists.xensource.com \
    --cc=xen-ppc-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.