Skip to contentSkip to conversation

video: support for VGA hoses on alpha TITAN, TSUNAMI systems (ES45, DS25)

PATCH In review Steve Langasek 4 participants 8 messages Nov 2, 2006 – Nov 11, 2006

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 video: support for VGA hoses on alpha TITAN, TSUNAMI systems (ES45, DS25)

From: Jay Estabrook <[email protected]>

Add working support for VGA hoses on Alpha, which is required in order to use a VGA console on TITAN- and TSUNAMI-class Alpha systems. This also generalizes support for non-standard VGA offsets on Alpha to cover the Marvel class of alphas without special-casing. Includes recognizing an additional model of TITAN-class Alpha.

Tested successfully on an ES45 and a DS25 with a vanilla 2.6.18 kernel, also tested on an LX164 with the Debian 2.6.18 kernel with no regressions. Included in Alpha Core distribution for some time.

arch/alpha/Kconfig +12 -0
diff -uNr source/arch/alpha/Kconfig source-es45/arch/alpha/Kconfig
@@ -469,6 +469,11 @@
 	depends on ALPHA_GENERIC || ALPHA_PC164
 	default y
 
+config VGA_HOSE
+	bool "VGA on arbitrary hose"
+	depends on ALPHA_GENERIC || ALPHA_TITAN || ALPHA_MARVEL || ALPHA_TSUNAMI
+	default y
+
 config ALPHA_SRM
 	bool "Use SRM as bootloader" if ALPHA_CABRIOLET || ALPHA_AVANTI_CH || ALPHA_EB64P || ALPHA_PC164 || ALPHA_TAKARA || ALPHA_EB164 || ALPHA_ALCOR || ALPHA_MIATA || ALPHA_LX164 || ALPHA_SX164 || ALPHA_NAUTILUS || ALPHA_NONAME
 	default y if ALPHA_JENSEN || ALPHA_MIKASA || ALPHA_SABLE || ALPHA_LYNX || ALPHA_NORITAKE || ALPHA_DP264 || ALPHA_RAWHIDE || ALPHA_EIGER || ALPHA_WILDFIRE || ALPHA_TITAN || ALPHA_SHARK || ALPHA_MARVEL
@@ -626,6 +631,13 @@
 
 source "drivers/Kconfig"
 
+# DUMMY_CONSOLE may be defined in drivers/video/console/Kconfig
+# but we also need it if VGA_HOSE is set
+config DUMMY_CONSOLE
+	bool
+	depends on VGA_HOSE
+	default y
+
 source "fs/Kconfig"
 
 source "arch/alpha/oprofile/Kconfig"
arch/alpha/kernel/alpha_ksyms.c +4 -0
diff -uNr source/arch/alpha/kernel/alpha_ksyms.c source-es45/arch/alpha/kernel/alpha_ksyms.c
@@ -206,3 +206,7 @@
 EXPORT_SYMBOL(irongate_ioremap);
 EXPORT_SYMBOL(irongate_iounmap);
 #endif
+
+#ifdef CONFIG_VGA_HOSE
+EXPORT_SYMBOL(pci_vga_hose);
+#endif
arch/alpha/kernel/console.c +8 -14
diff -uNr source/arch/alpha/kernel/console.c source-es45/arch/alpha/kernel/console.c
@@ -12,13 +12,11 @@
 #include <asm/vga.h>
 #include <asm/machvec.h>
 
+#include "pci_impl.h"
+
 #ifdef CONFIG_VGA_HOSE
 
-/*
- * Externally-visible vga hose bases
- */
-unsigned long __vga_hose_io_base = 0;	/* base for default hose */
-unsigned long __vga_hose_mem_base = 0;	/* base for default hose */
+struct pci_controller *pci_vga_hose = NULL;
 
 static struct pci_controller * __init 
 default_vga_hose_select(struct pci_controller *h1, struct pci_controller *h2)
@@ -32,10 +31,7 @@
 void __init 
 set_vga_hose(struct pci_controller *hose)
 {
-	if (hose) {
-		__vga_hose_io_base = hose->io_space->start;
-		__vga_hose_mem_base = hose->mem_space->start;
-	}
+	pci_vga_hose = hose;
 }
 
 void __init 
@@ -44,18 +40,17 @@
 	struct pci_controller *hose = NULL;
 	struct pci_dev *dev = NULL;
 
+	/* Default the select function */
 	if (!sel_func) sel_func = (void *)default_vga_hose_select;
 
+	/* Find the console VGA device */
 	for(dev=NULL; (dev=pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, dev));) {
 		if (!hose) hose = dev->sysdata;
 		else hose = sel_func(hose, dev->sysdata);
 	}
 
-	/* Did we already inititialize the correct one? */
-	if (conswitchp == &vga_con &&
-	    __vga_hose_io_base == hose->io_space->start &&
-	    __vga_hose_mem_base == hose->mem_space->start)
-		return;
+	/* Did we already initialize the correct one? Is there one? */
+	if (!hose || (conswitchp == &vga_con && pci_vga_hose == hose)) return;
 
 	/* Set the VGA hose and init the new console */
 	set_vga_hose(hose);
arch/alpha/kernel/core_marvel.c +4 -13
diff -uNr source/arch/alpha/kernel/core_marvel.c source-es45/arch/alpha/kernel/core_marvel.c
@@ -684,9 +684,6 @@
 /*
  * IO map support.
  */
-
-#define __marvel_is_mem_vga(a)	(((a) >= 0xa0000) && ((a) <= 0xc0000))
-
 void __iomem *
 marvel_ioremap(unsigned long addr, unsigned long size)
 {
@@ -698,13 +695,9 @@
 	unsigned long pfn;
 
 	/*
-	 * Adjust the addr.
+	 * Adjust the address.
 	 */ 
-#ifdef CONFIG_VGA_HOSE
-	if (pci_vga_hose && __marvel_is_mem_vga(addr)) {
-		addr += pci_vga_hose->mem_space->start;
-	}
-#endif
+	FIXUP_MEMADDR_VGA(addr);
 
 	/*
 	 * Find the hose.
@@ -781,7 +774,7 @@
 		return (void __iomem *) vaddr;
 	}
 
-	return NULL;
+	return (void __iomem *) NULL;
 }
 
 void
@@ -803,8 +796,6 @@
 		return (addr & 0xFF000000UL) == 0;
 }
 
-#define __marvel_is_port_vga(a)	\
-  (((a) >= 0x3b0) && ((a) < 0x3e0) && ((a) != 0x3b3) && ((a) != 0x3d3))
 #define __marvel_is_port_kbd(a)	(((a) == 0x60) || ((a) == 0x64))
 #define __marvel_is_port_rtc(a)	(((a) == 0x70) || ((a) == 0x71))
 
@@ -813,7 +804,7 @@
 	if (__marvel_is_port_rtc (addr) || __marvel_is_port_kbd(addr))
 		;
 #ifdef CONFIG_VGA_HOSE
-	else if (__marvel_is_port_vga (addr) && pci_vga_hose)
+	else if (__is_port_vga (addr) && pci_vga_hose)
 		addr += pci_vga_hose->io_space->start;
 #endif
 	else
arch/alpha/kernel/core_titan.c +63 -47

241 lines not on this page · raw message

arch/alpha/kernel/core_tsunami.c +29 -0
diff -uNr source/arch/alpha/kernel/core_tsunami.c source-es45/arch/alpha/kernel/core_tsunami.c
@@ -349,6 +349,32 @@
 	tsunami_pci_tbi(hose, 0, -1);
 }
 
+static void __init
+tsunami_init_vga_hose(void)
+{
+#ifdef CONFIG_VGA_HOSE
+	u64 *pu64 = (u64 *)((u64)hwrpb + hwrpb->ctbt_offset);
+
+	if (pu64[7] == 3) {	/* TERM_TYPE == graphics */
+		struct pci_controller *hose;
+		int h = (pu64[30] >> 24) & 0xff;	/* console hose # */
+
+		/*
+		 * Our hose numbering does NOT match the console's, so find
+		 * the right one...
+		 */
+		for (hose = hose_head; hose; hose = hose->next) {
+			if (hose->index == h) break;
+		}
+
+		if (hose) {
+			printk("Console graphics on hose %d\n", h);
+			pci_vga_hose = hose;
+		}
+	}
+#endif /* CONFIG_VGA_HOSE */
+}
+
 void __init
 tsunami_init_arch(void)
 {
@@ -393,6 +419,9 @@
 	tsunami_init_one_pchip(TSUNAMI_pchip0, 0);
 	if (TSUNAMI_cchip->csc.csr & 1L<<14)
 		tsunami_init_one_pchip(TSUNAMI_pchip1, 1);
+
+	/* Check for graphic console location (if any).  */
+	tsunami_init_vga_hose();
 }
 
 static void
arch/alpha/kernel/proto.h +5 -0
diff -uNr source/arch/alpha/kernel/proto.h source-es45/arch/alpha/kernel/proto.h
@@ -106,6 +106,11 @@
 extern unsigned long wildfire_node_mem_start(int);
 extern unsigned long wildfire_node_mem_size(int);
 
+/* console.c */
+#ifdef CONFIG_VGA_HOSE
+  extern void locate_and_init_vga(void *(*)(void *, void *));
+#endif
+
 /* setup.c */
 extern unsigned long srm_hae;
 extern int boot_cpuid;
arch/alpha/kernel/setup.c +3 -2
diff -uNr source/arch/alpha/kernel/setup.c source-es45/arch/alpha/kernel/setup.c
@@ -787,9 +787,9 @@
 static int rawhide_indices[] = {0,0,0,1,1,2,2,3,3,4,4};
 
 static char titan_names[][16] = {
-	"DEFAULT", "Privateer", "Falcon", "Granite"
+	"DEFAULT", "Privateer", "Falcon", "Granite", "HyperBrick2"
 };
-static int titan_indices[] = {0,1,2,2,3};
+static int titan_indices[] = {0,1,2,2,3,4};
 
 static char tsunami_names[][16] = {
 	"0", "DP264", "Warhol", "Windjammer", "Monet", "Clipper",
@@ -891,6 +891,7 @@
 		&privateer_mv,		/* privateer */
 		&titan_mv,		/* falcon    */
 		&privateer_mv,		/* granite   */
+		&titan_mv,		/* hyperbrick2 */
 	};
 
 	static struct alpha_machine_vector *tsunami_vecs[]  __initdata =
arch/alpha/kernel/sys_dp264.c +16 -1
diff -uNr source/arch/alpha/kernel/sys_dp264.c source-es45/arch/alpha/kernel/sys_dp264.c
@@ -543,6 +543,9 @@
 {
 	common_init_pci();
 	SMC669_Init(0);
+#ifdef CONFIG_VGA_HOSE
+	locate_and_init_vga(NULL);
+#endif
 }
 
 static void __init
@@ -551,6 +554,18 @@
 	common_init_pci();
 	SMC669_Init(1);
 	es1888_init();
+#ifdef CONFIG_VGA_HOSE
+	locate_and_init_vga(NULL);
+#endif
+}
+
+static void __init
+clipper_init_pci(void)
+{
+	common_init_pci();
+#ifdef CONFIG_VGA_HOSE
+	locate_and_init_vga(NULL);
+#endif
 }
 
 static void __init
@@ -655,7 +670,7 @@
 	.init_arch		= tsunami_init_arch,
 	.init_irq		= clipper_init_irq,
 	.init_rtc		= common_init_rtc,
-	.init_pci		= common_init_pci,
+	.init_pci		= clipper_init_pci,
 	.kill_arch		= tsunami_kill_arch,
 	.pci_map_irq		= clipper_map_irq,
 	.pci_swizzle		= common_swizzle,
drivers/video/console/vgacon.c +11 -6
diff -uNr source/drivers/video/console/vgacon.c source-es45/drivers/video/console/vgacon.c
@@ -52,6 +52,11 @@
 #include <video/vga.h>
 #include <asm/io.h>
 
+/* wait until after includes to test for this, to allow arch-specific mod. */
+#ifndef vga_request_resource
+# define vga_request_resource request_resource
+#endif
+
 static DEFINE_SPINLOCK(vga_lock);
 static int cursor_size_lastfrom;
 static int cursor_size_lastto;
@@ -393,7 +398,7 @@
 			vga_video_type = VIDEO_TYPE_EGAM;
 			vga_vram_size = 0x8000;
 			display_desc = "EGA+";
-			request_resource(&ioport_resource,
+			vga_request_resource(&ioport_resource,
 					 &ega_console_resource);
 		} else {
 			static struct resource mda1_console_resource =
@@ -403,9 +408,9 @@
 			vga_video_type = VIDEO_TYPE_MDA;
 			vga_vram_size = 0x2000;
 			display_desc = "*MDA";
-			request_resource(&ioport_resource,
+			vga_request_resource(&ioport_resource,
 					 &mda1_console_resource);
-			request_resource(&ioport_resource,
+			vga_request_resource(&ioport_resource,
 					 &mda2_console_resource);
 			vga_video_font_height = 14;
 		}
@@ -425,14 +430,14 @@
 				    = { .name = "ega", .start = 0x3C0, .end = 0x3DF };
 				vga_video_type = VIDEO_TYPE_EGAC;
 				display_desc = "EGA";
-				request_resource(&ioport_resource,
+				vga_request_resource(&ioport_resource,
 						 &ega_console_resource);
 			} else {
 				static struct resource vga_console_resource
 				    = { .name = "vga+", .start = 0x3C0, .end = 0x3DF };
 				vga_video_type = VIDEO_TYPE_VGAC;
 				display_desc = "VGA+";
-				request_resource(&ioport_resource,
+				vga_request_resource(&ioport_resource,
 						 &vga_console_resource);
 
 #ifdef VGA_CAN_DO_64KB
@@ -477,7 +482,7 @@
 			vga_video_type = VIDEO_TYPE_CGA;
 			vga_vram_size = 0x2000;
 			display_desc = "*CGA";
-			request_resource(&ioport_resource,
+			vga_request_resource(&ioport_resource,
 					 &cga_console_resource);
 			vga_video_font_height = 8;
 		}
include/asm-alpha/core_titan.h +2 -0
diff -uNr source/include/asm-alpha/core_titan.h source-es45/include/asm-alpha/core_titan.h
@@ -3,6 +3,7 @@
 
 #include <linux/types.h>
 #include <linux/pci.h>
+#include <asm/pci.h>
 #include <asm/compiler.h>
 
 /*
@@ -383,6 +384,7 @@
 
 __EXTERN_INLINE void __iomem *titan_ioportmap(unsigned long addr)
 {
+	FIXUP_IOADDR_VGA(addr);
 	return (void __iomem *)(addr + TITAN_IO_BIAS);
 }
 
include/asm-alpha/core_tsunami.h +4 -0
diff -uNr source/include/asm-alpha/core_tsunami.h source-es45/include/asm-alpha/core_tsunami.h
@@ -2,6 +2,8 @@
 #define __ALPHA_TSUNAMI__H__
 
 #include <linux/types.h>
+#include <linux/pci.h>
+#include <asm/pci.h>
 #include <asm/compiler.h>
 
 /*
@@ -305,12 +307,14 @@
 
 __EXTERN_INLINE void __iomem *tsunami_ioportmap(unsigned long addr)
 {
+	FIXUP_IOADDR_VGA(addr);
 	return (void __iomem *)(addr + TSUNAMI_IO_BIAS);
 }
 
 __EXTERN_INLINE void __iomem *tsunami_ioremap(unsigned long addr, 
 					      unsigned long size)
 {
+	FIXUP_MEMADDR_VGA(addr);
 	return (void __iomem *)(addr + TSUNAMI_MEM_BIAS);
 }
 
include/asm-alpha/io.h +24 -0
diff -uNr source/include/asm-alpha/io.h source-es45/include/asm-alpha/io.h
@@ -126,6 +126,30 @@
 	return (long)address <= 0 ? NULL : virt;
 }
 
+#ifdef CONFIG_VGA_HOSE
+extern struct pci_controller *pci_vga_hose;
+
+# define __is_port_vga(a)       \
+	(((a) >= 0x3b0) && ((a) < 0x3e0) && \
+	 ((a) != 0x3b3) && ((a) != 0x3d3))
+
+# define __is_mem_vga(a) \
+	(((a) >= 0xa0000) && ((a) <= 0xc0000))
+
+# define FIXUP_IOADDR_VGA(a) do {                       \
+	if (pci_vga_hose && __is_port_vga(a))     \
+		a += pci_vga_hose->io_space->start;     \
+ } while(0)
+
+# define FIXUP_MEMADDR_VGA(a) do {                       \
+	if (pci_vga_hose && __is_mem_vga(a))     \
+		a += pci_vga_hose->io_space->start;     \
+ } while(0)
+
+#else /* CONFIG_VGA_HOSE */
+# define FIXUP_IOADDR_VGA(a)
+#endif /* CONFIG_VGA_HOSE */
+
 /*
  * There are different chipsets to interface the Alpha CPUs to the world.
  */
include/asm-alpha/vga.h +22 -0
diff -uNr source/include/asm-alpha/vga.h source-es45/include/asm-alpha/vga.h
@@ -48,4 +48,26 @@
 
 #define VGA_MAP_MEM(x,s)	((unsigned long) ioremap(x, s))
 
+#ifdef CONFIG_VGA_HOSE
+#include <linux/ioport.h>
+#include <linux/pci.h>
+
+extern struct pci_controller *pci_vga_hose;
+ 
+#define vga_request_resource alpha_vga_request_resource
+
+static int __inline__
+alpha_vga_request_resource(struct resource *root, struct resource *new)
+{
+	/* First, fixup the VGA resource bounds WRT the hose it is on. */
+	if (pci_vga_hose) {
+		new->start += pci_vga_hose->io_space->start;
+		new->end += pci_vga_hose->io_space->start;
+	}
+
+	/* Finally, do a normal request_resource(). */
+	return request_resource(root, new);
+}
+#endif /* CONFIG_VGA_HOSE */
+
 #endif
Signature · 3 lines
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
[email protected]                                   http://www.debian.org/
#1 lore raw
Quoted 8 lines · On Thu, 2 Nov 2006 00:37:20 -0800 Steve Langasek <[email protected]> wrote:

From: Jay Estabrook <[email protected]>

Add working support for VGA hoses on Alpha, which is required in order to use a VGA console on TITAN- and TSUNAMI-class Alpha systems. This also generalizes support for non-standard VGA offsets on Alpha to cover the Marvel class of alphas without special-casing. Includes recognizing an additional model of TITAN-class Alpha.

Quoted 4 lines

Tested successfully on an ES45 and a DS25 with a vanilla 2.6.18 kernel, also tested on an LX164 with the Debian 2.6.18 kernel with no regressions. Included in Alpha Core distribution for some time.

It would be appropriate for both yourself and Jay to provide signoffs for this work, as per section 11 of Documentation/SubmittingPatches, please.

What is a "hose"?

Some trivia:

arch/alpha/kernel/console.c line 53

Quoted 1 line
arch/alpha/kernel/console.c +1 -0
+	if (!hose || (conswitchp == &vga_con && pci_vga_hose == hose)) return;

This is missing a newline.

Quoted 1 line

+static int titan_pchip1_present = 0;

Unneeded (and undesirable) initialisation.

arch/alpha/kernel/proto.h line 112

Quoted 9 lines

+++ source-es45/arch/alpha/kernel/proto.h 2006-09-30 03:14:44.000000000 -0700

arch/alpha/kernel/proto.h +4 -0
@@ -106,6 +106,11 @@
 extern unsigned long wildfire_node_mem_start(int);
 extern unsigned long wildfire_node_mem_size(int);
 
+/* console.c */
+#ifdef CONFIG_VGA_HOSE
+  extern void locate_and_init_vga(void *(*)(void *, void *));
+#endif

The ifdef isn't really needed - we usually leave it out.

Quoted 20 lines

diff -uNr source/arch/alpha/kernel/sys_dp264.c source-es45/arch/alpha/kernel/sys_dp264.c

arch/alpha/kernel/sys_dp264.c +6 -0
@@ -543,6 +543,9 @@
 {
 	common_init_pci();
 	SMC669_Init(0);
+#ifdef CONFIG_VGA_HOSE
+	locate_and_init_vga(NULL);
+#endif
 }
 
 static void __init
@@ -551,6 +554,18 @@
 	common_init_pci();
 	SMC669_Init(1);
 	es1888_init();
+#ifdef CONFIG_VGA_HOSE
+	locate_and_init_vga(NULL);
+#endif

arch/alpha/kernel/sys_dp264.c line 569

Quoted 10 lines
arch/alpha/kernel/sys_dp264.c +9 -0
+}
+
+static void __init
+clipper_init_pci(void)
+{
+	common_init_pci();
+#ifdef CONFIG_VGA_HOSE
+	locate_and_init_vga(NULL);
+#endif
 }

We normally do:

#ifdef CONFIG_VGA_HOSE
extern void locate_and_init_vga(void *(*handler)(void *, void *)); #else
static inline void locate_and_init_vga(void *(*handler)(void *, void *)) {
}
#endif

so that all those ifdefs go away and so that the new code gets compile-checked regardless of config settings.

arch/alpha/kernel/sys_dp264.c

Quoted 6 lines
arch/alpha/kernel/sys_dp264.c +5 -0
+/* wait until after includes to test for this, to allow arch-specific mod. */
+#ifndef vga_request_resource
+# define vga_request_resource request_resource
+#endif
+

erk.

Quoted 5 lines
arch/alpha/kernel/sys_dp264.c +4 -0
+#define vga_request_resource alpha_vga_request_resource
+
+static int __inline__
+alpha_vga_request_resource(struct resource *root, struct resource *new)

arch/alpha/kernel/sys_dp264.c

Quoted 10 lines
arch/alpha/kernel/sys_dp264.c +10 -0
+{
+	/* First, fixup the VGA resource bounds WRT the hose it is on. */
+	if (pci_vga_hose) {
+		new->start += pci_vga_hose->io_space->start;
+		new->end += pci_vga_hose->io_space->start;
+	}
+
+	/* Finally, do a normal request_resource(). */
+	return request_resource(root, new);
+}

So if the resource is being requested by vga we adjust the caller's resource before actually requesting it.

Isn't this a bit hacky? How come vgacon ended up requesting the wrong addresses in the first place?

(And please don't use __inline__ or __inline - plain old `inline' works fine)

Quoted 29 lines

static DEFINE_SPINLOCK(vga_lock);
static int cursor_size_lastfrom;
static int cursor_size_lastto;

arch/alpha/kernel/sys_dp264.c +1 -1
@@ -393,7 +398,7 @@
 			vga_video_type = VIDEO_TYPE_EGAM;
 			vga_vram_size = 0x8000;
 			display_desc = "EGA+";
-			request_resource(&ioport_resource,
+			vga_request_resource(&ioport_resource,
 					 &ega_console_resource);
 
..

diff -uNr source/include/asm-alpha/core_titan.h source-es45/include/asm-alpha/core_titan.h

include/asm-alpha/core_titan.h +1 -0
@@ -3,6 +3,7 @@
 
 #include <linux/types.h>
 #include <linux/pci.h>
+#include <asm/pci.h>
 #include <asm/compiler.h>
 
...

diff -uNr source/include/asm-alpha/core_tsunami.h source-es45/include/asm-alpha/core_tsunami.h

include/asm-alpha/core_tsunami.h line 7

Quoted 6 lines
include/asm-alpha/core_tsunami.h +2 -0
@@ -2,6 +2,8 @@
 #define __ALPHA_TSUNAMI__H__
 
 #include <linux/types.h>
+#include <linux/pci.h>
+#include <asm/pci.h>
 #include <asm/compiler.h>

So we actually need to include asm/pci.h in these files? linux/pci.h already did that?

#2 lore raw
Quoted 1 line · Andrew Morton

What is a "hose"?

A real name of "pci domain". ;-)

Quoted 8 lines

include/asm-alpha/vga.h line 69

Quoted 8 lines
include/asm-alpha/vga.h +8 -0
+	/* First, fixup the VGA resource bounds WRT the hose it is on. */
+	if (pci_vga_hose) {
+		new->start += pci_vga_hose->io_space->start;
+		new->end += pci_vga_hose->io_space->start;
+	}
+
+	/* Finally, do a normal request_resource(). */
+	return request_resource(root, new);

This will always fail. Should be

	return request_resource(pci_vga_hose->io_space, new);
Quoted 8 lines
Quoted 2 lines

+}

So if the resource is being requested by vga we adjust the caller's resource before actually requesting it.

Isn't this a bit hacky? How come vgacon ended up requesting the wrong addresses in the first place?

vgacon requests the correct _bus_ address, but it doesn't work with multiple buses. So a fixup similar to pcibios_fixup_resource() or pcibios_bus_to_resource() is needed.

Ivan.

#3 lore raw
In reply to Andrew Morton

Hi Andrew,

Thanks for the feedback. I'll incorporate your comments and Ivan's into an updated patch and re-test. What's the procedure afterwards -- should I re-submit as a follow-up to this thread or start a new thread?

Quoted 8 lines · Andrew Morton
Quoted 7 lines

From: Jay Estabrook <[email protected]>

Add working support for VGA hoses on Alpha, which is required in order to use a VGA console on TITAN- and TSUNAMI-class Alpha systems. This also generalizes support for non-standard VGA offsets on Alpha to cover the Marvel class of alphas without special-casing. Includes recognizing an additional model of TITAN-class Alpha.

Quoted 6 lines
Quoted 3 lines

Tested successfully on an ES45 and a DS25 with a vanilla 2.6.18 kernel, also tested on an LX164 with the Debian 2.6.18 kernel with no regressions. Included in Alpha Core distribution for some time.

It would be appropriate for both yourself and Jay to provide signoffs for this work, as per section 11 of Documentation/SubmittingPatches, please.

Ok, will ask Jay for this.

Quoted 1 line

What is a "hose"?

Ivan's comment, that this is effectively a PCI domain, is consistent with my (limited) understanding.

Quoted 7 lines

drivers/video/console/vgacon.c line 59

Quoted 5 lines
drivers/video/console/vgacon.c +5 -0
+/* wait until after includes to test for this, to allow arch-specific mod. */
+#ifndef vga_request_resource
+# define vga_request_resource request_resource
+#endif
+

erk.

Yeah. :/ Suggestions welcome.

Quoted 1 line

So we actually need to include asm/pci.h in these files?

Uhm, appears not. Thanks for noticing.

Signature · 3 lines
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
[email protected]                                   http://www.debian.org/
#4 lore raw

Greetings,

Just wanted to let you know I tested this patch
http://people.debian.org/~vorlon/alpha-titan-video.patch on 2.6.18.2 sources and got the following errors during the compile. The same 2.6.18.2 sources compile ok so I think this has something to do with the alpha-titan-video patch. I hope this information is useful. I do not know too much about debugging yet or I would have tried to provide more.

In file included from include/asm/io.h:250,

                 from include/linux/dmapool.h:14,
                 from include/linux/pci.h:564,
                 from arch/alpha/kernel/alpha_ksyms.c:16:

include/asm/core_titan.h: In function 'titan_ioportmap':
include/asm/core_titan.h:386: error: dereferencing pointer to incomplete type make[1]: *** [arch/alpha/kernel/alpha_ksyms.o] Error 1
make: *** [arch/alpha/kernel] Error 2

Regards,
Jason Harrison

#5 lore raw

Hi Jason,

Quoted 7 lines · Jason Harrison

Just wanted to let you know I tested this patch
http://people.debian.org/~vorlon/alpha-titan-video.patch on 2.6.18.2 sources and got the following errors during the compile. The same 2.6.18.2 sources compile ok so I think this has something to do with the alpha-titan-video patch. I hope this information is useful. I do not know too much about debugging yet or I would have tried to provide more.

Quoted 8 lines

In file included from include/asm/io.h:250,

                 from include/linux/dmapool.h:14,
                 from include/linux/pci.h:564,
                 from arch/alpha/kernel/alpha_ksyms.c:16:

include/asm/core_titan.h: In function 'titan_ioportmap':
include/asm/core_titan.h:386: error: dereferencing pointer to incomplete type make[1]: *** [arch/alpha/kernel/alpha_ksyms.o] Error 1
make: *** [arch/alpha/kernel] Error 2

Ok; evidently, the reference to asm/pci.h really *was* required, because otherwise the definition of FIXUP_IOADDR_VGA() is used well before struct pci_controller is defined when building with CONFIG_ALPHA_TITAN. I've re-added this to the test patch, please feel free to re-download and test.

Signature · 3 lines
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
[email protected]                                   http://www.debian.org/
#6 lore raw

Greetings,

I re-downloaded the patch and attempted to build patched 2.6.18.2 kernel sources. The compile failed with some errors however. The errors are below.

cc1: warnings being treated as errors
In file included from include/asm/core_titan.h:6,

                 from include/asm/io.h:250,
                 from include/linux/dmapool.h:14,
                 from include/linux/pci.h:564,
                 from arch/alpha/kernel/alpha_ksyms.c:16:

include/asm/pci.h:229: warning: 'enum pci_dma_burst_strategy' declared inside parameter list
include/asm/pci.h:229: warning: its scope is only this definition or declaration, which is probably not what you want include/asm/pci.h: In function 'pci_dma_burst_advice':
include/asm/pci.h:240: error: dereferencing pointer to incomplete type include/asm/pci.h:240: error: 'PCI_DMA_BURST_BOUNDARY' undeclared (first use in this function)
include/asm/pci.h:240: error: (Each undeclared identifier is reported only once
include/asm/pci.h:240: error: for each function it appears in.) make[1]: *** [arch/alpha/kernel/alpha_ksyms.o] Error 1
make: *** [arch/alpha/kernel] Error 2

Hope this helps.

Regards,
Jason

#7 lore raw
In reply to Steve Langasek

Greetings,

I patched the kernel with the extra systype patch located at this link.

http://www.vipu.org/~eki/alpha-titan-systype.patch

Now the kernel seems to compile fine. By the way I am compiling a kernel specifically for titan type systems. Not a generic alpha kernel. I know eki had given me links to 2 patches before. For some reason I thought they were both incorporated into the alpha-titan-video.patch you were working on. I hope this information helps. Not sure why the second patch is needed. Good to know though.

Regards,
Jason