* [PATCH] Fix vgacon oops on 64-bit
@ 2006-01-30 15:33 Matt Porter
2006-01-30 18:17 ` Ralf Baechle
0 siblings, 1 reply; 3+ messages in thread
From: Matt Porter @ 2006-01-30 15:33 UTC (permalink / raw)
To: linux-mips
Although I'm not running a VGA card, I noticed this building
a working malta 32-bit defconfig (vgacon enabled) for 64-bit.
Without it, the vgacon probe will access unmapped space when
looking to see if a vga card is present.
Signed-off-by: Matt Porter <mporter@kernel.crashing.org>
diff --git a/include/asm-mips/vga.h b/include/asm-mips/vga.h
index ca5cec9..1390ab6 100644
--- a/include/asm-mips/vga.h
+++ b/include/asm-mips/vga.h
@@ -13,7 +13,11 @@
* access the videoram directly without any black magic.
*/
+#ifdef CONFIG_64BIT
+#define VGA_MAP_MEM(x) (0xffffffffb0000000UL + (unsigned long)(x))
+#else
#define VGA_MAP_MEM(x) (0xb0000000L + (unsigned long)(x))
+#endif
#define vga_readb(x) (*(x))
#define vga_writeb(x,y) (*(y) = (x))
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Fix vgacon oops on 64-bit
2006-01-30 15:33 [PATCH] Fix vgacon oops on 64-bit Matt Porter
@ 2006-01-30 18:17 ` Ralf Baechle
2006-01-31 6:35 ` Matt Porter
0 siblings, 1 reply; 3+ messages in thread
From: Ralf Baechle @ 2006-01-30 18:17 UTC (permalink / raw)
To: Matt Porter; +Cc: linux-mips
On Mon, Jan 30, 2006 at 08:33:21AM -0700, Matt Porter wrote:
> Although I'm not running a VGA card, I noticed this building
> a working malta 32-bit defconfig (vgacon enabled) for 64-bit.
> Without it, the vgacon probe will access unmapped space when
> looking to see if a vga card is present.
>
> Signed-off-by: Matt Porter <mporter@kernel.crashing.org>
>
> diff --git a/include/asm-mips/vga.h b/include/asm-mips/vga.h
> index ca5cec9..1390ab6 100644
> --- a/include/asm-mips/vga.h
> +++ b/include/asm-mips/vga.h
> @@ -13,7 +13,11 @@
> * access the videoram directly without any black magic.
> */
>
> +#ifdef CONFIG_64BIT
> +#define VGA_MAP_MEM(x) (0xffffffffb0000000UL + (unsigned long)(x))
> +#else
> #define VGA_MAP_MEM(x) (0xb0000000L + (unsigned long)(x))
> +#endif
Looks like driving out the devil with beelzebub. The 0xb0000000 address
is totally platform specific and nobody ever noticed ...
Ralf
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Fix vgacon oops on 64-bit
2006-01-30 18:17 ` Ralf Baechle
@ 2006-01-31 6:35 ` Matt Porter
0 siblings, 0 replies; 3+ messages in thread
From: Matt Porter @ 2006-01-31 6:35 UTC (permalink / raw)
To: Ralf Baechle; +Cc: linux-mips
On Mon, Jan 30, 2006 at 06:17:54PM +0000, Ralf Baechle wrote:
> On Mon, Jan 30, 2006 at 08:33:21AM -0700, Matt Porter wrote:
> > +#ifdef CONFIG_64BIT
> > +#define VGA_MAP_MEM(x) (0xffffffffb0000000UL + (unsigned long)(x))
> > +#else
> > #define VGA_MAP_MEM(x) (0xb0000000L + (unsigned long)(x))
> > +#endif
>
> Looks like driving out the devil with beelzebub. The 0xb0000000 address
> is totally platform specific and nobody ever noticed ...
Ok, added a platform dependent hook that the setup code can
configure appropriately.
Signed-off-by: Matt Porter <mporter@kernel.crashing.org>
diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index d86affa..5e01f53 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -51,6 +51,10 @@ EXPORT_SYMBOL(cpu_data);
struct screen_info screen_info;
#endif
+#ifdef CONFIG_VGA_CONSOLE
+unsigned long vgacon_remap_base;
+#endif
+
/*
* Despite it's name this variable is even if we don't have PCI
*/
diff --git a/arch/mips/mips-boards/malta/malta_setup.c b/arch/mips/mips-boards/malta/malta_setup.c
index 2209e8a..b344095 100644
--- a/arch/mips/mips-boards/malta/malta_setup.c
+++ b/arch/mips/mips-boards/malta/malta_setup.c
@@ -42,6 +42,9 @@
#ifdef CONFIG_VT
#include <linux/console.h>
#endif
+#ifdef CONFIG_VGA_CONSOLE
+#include <asm/vga.h>
+#endif
extern void mips_reboot_setup(void);
extern void mips_time_init(void);
@@ -210,6 +213,12 @@ void __init plat_setup(void)
VIDEO_TYPE_VGAC, /* orig-video-isVGA */
16 /* orig-video-points */
};
+
+#ifdef CONFIG_64BIT
+ vgacon_remap_base = 0xffffffffb0000000;
+#else
+ vgacon_remap_base = 0xb0000000;
+#endif
#endif
#endif
diff --git a/include/asm-mips/vga.h b/include/asm-mips/vga.h
index ca5cec9..2bedca2 100644
--- a/include/asm-mips/vga.h
+++ b/include/asm-mips/vga.h
@@ -13,7 +13,9 @@
* access the videoram directly without any black magic.
*/
-#define VGA_MAP_MEM(x) (0xb0000000L + (unsigned long)(x))
+extern unsigned long vgacon_remap_base;
+
+#define VGA_MAP_MEM(x) (vgacon_remap_base + (unsigned long)(x))
#define vga_readb(x) (*(x))
#define vga_writeb(x,y) (*(y) = (x))
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-01-31 6:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-30 15:33 [PATCH] Fix vgacon oops on 64-bit Matt Porter
2006-01-30 18:17 ` Ralf Baechle
2006-01-31 6:35 ` Matt Porter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox