* Re: vga16fb broke [not found] <20040514145559.55202998.akpm@osdl.org> @ 2004-05-18 22:36 ` James Simmons 2004-05-19 0:16 ` Andrew Morton 0 siblings, 1 reply; 5+ messages in thread From: James Simmons @ 2004-05-18 22:36 UTC (permalink / raw) To: Andrew Morton Cc: VANDROVE, Vincent Sanders, Linux Fbdev development list, Linux Kernel Mailing List > Guys, can you help with http://bugme.osdl.org/show_bug.cgi?id=2711 ? > > The recent change broke it on x86 becuase we're now doing ioremap() > of a kernel-virtual address, but the oriiginal version doesn't work on ARM. > > Should it just be: > > vga16fb.screen_base = VGA_MAP_MEM(VGA_FB_PHYS); I went looking at the various platforms to see what exactly was going on. We have: Useage ./drivers/video/console/mdacon.c: mda_vram_base = VGA_MAP_MEM(0xb0000); ./drivers/video/console/vgacon.c: vga_vram_base = VGA_MAP_MEM(vga_vram_base); ./drivers/video/console/vgacon.c: vga_vram_end = VGA_MAP_MEM(vga_vram_end); ./drivers/video/console/vgacon.c: charmap = (char *) VGA_MAP_MEM(colourmap); ./drivers/video/console/vgacon.c: charmap = (char *) VGA_MAP_MEM(blackwmap); ./drivers/video/hgafb.c: hga_fix.smem_start = VGA_MAP_MEM(hga_vram_base); ./drivers/video/vga16fb.c: vga16fb.screen_base = ioremap(VGA_MAP_MEM(VGA_FB_PHYS), VGA_FB_PHYS_LEN); ./drivers/video/vga16fb.c: vga16fb.fix.smem_start = VGA_MAP_MEM(vga16fb.fix.smem_start); ioremap happy ./include/asm-alpha/vga.h:#define VGA_MAP_MEM(x) ((unsigned long) ioremap((x), 0)) ./include/asm-ia64/vga.h:#define VGA_MAP_MEM(x) ((unsigned long) ioremap((x), 0)) ./include/asm-ppc64/vga.h:#define VGA_MAP_MEM(x) ((unsigned long) ioremap((x), 0)) can be ioremap happy because ioremap in io.h matches below definetions. ./include/asm-i386/vga.h:#define VGA_MAP_MEM(x) (unsigned long)phys_to_virt(x) ./include/asm-sparc64/vga.h:#define VGA_MAP_MEM(x) (x) ./include/asm-x86_64/vga.h:#define VGA_MAP_MEM(x) (unsigned long)phys_to_virt(x) Not happy. ./include/asm-arm/vga.h:#define VGA_MAP_MEM(x) (PCIMEM_BASE + (x)) ./include/asm-mips/vga.h:#define VGA_MAP_MEM(x) (0xb0000000L + (unsigned long)(x)) ./include/asm-ppc/vga.h:#define VGA_MAP_MEM(x) (x + vgacon_remap_base) So you can see that VGA_MAP_MEM is already ioremapping which is causing the problem. Personally I like to see the lose ends fixed on ARM, MIPS, and PPC so we can use just ioremap. ------------------------------------------------------- This SF.Net email is sponsored by: SourceForge.net Broadband Sign-up now for SourceForge Broadband and get the fastest 6.0/768 connection for only $19.95/mo for the first 3 months! http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: vga16fb broke 2004-05-18 22:36 ` vga16fb broke James Simmons @ 2004-05-19 0:16 ` Andrew Morton 2004-05-19 0:18 ` James Simmons 0 siblings, 1 reply; 5+ messages in thread From: Andrew Morton @ 2004-05-19 0:16 UTC (permalink / raw) To: James Simmons; +Cc: VANDROVE, vince, linux-fbdev-devel, linux-kernel James Simmons <jsimmons@infradead.org> wrote: > > > > Guys, can you help with http://bugme.osdl.org/show_bug.cgi?id=2711 ? > > > > The recent change broke it on x86 becuase we're now doing ioremap() > > of a kernel-virtual address, but the oriiginal version doesn't work on ARM. > > > > Should it just be: > > > > vga16fb.screen_base = VGA_MAP_MEM(VGA_FB_PHYS); > > I went looking at the various platforms to see what exactly was going on. > We have: > > Useage > > ./drivers/video/console/mdacon.c: mda_vram_base = VGA_MAP_MEM(0xb0000); > ./drivers/video/console/vgacon.c: vga_vram_base = VGA_MAP_MEM(vga_vram_base); > ./drivers/video/console/vgacon.c: vga_vram_end = VGA_MAP_MEM(vga_vram_end); > ./drivers/video/console/vgacon.c: charmap = (char *) VGA_MAP_MEM(colourmap); > ./drivers/video/console/vgacon.c: charmap = (char *) VGA_MAP_MEM(blackwmap); > ./drivers/video/hgafb.c: hga_fix.smem_start = VGA_MAP_MEM(hga_vram_base); > ./drivers/video/vga16fb.c: vga16fb.screen_base = ioremap(VGA_MAP_MEM(VGA_FB_PHYS), VGA_FB_PHYS_LEN); > ./drivers/video/vga16fb.c: vga16fb.fix.smem_start = VGA_MAP_MEM(vga16fb.fix.smem_start); > > ioremap happy > > ./include/asm-alpha/vga.h:#define VGA_MAP_MEM(x) ((unsigned long) ioremap((x), 0)) > ./include/asm-ia64/vga.h:#define VGA_MAP_MEM(x) ((unsigned long) ioremap((x), 0)) > ./include/asm-ppc64/vga.h:#define VGA_MAP_MEM(x) ((unsigned long) ioremap((x), 0)) > > can be ioremap happy because ioremap in io.h matches below definetions. > > ./include/asm-i386/vga.h:#define VGA_MAP_MEM(x) (unsigned long)phys_to_virt(x) > ./include/asm-sparc64/vga.h:#define VGA_MAP_MEM(x) (x) > ./include/asm-x86_64/vga.h:#define VGA_MAP_MEM(x) (unsigned long)phys_to_virt(x) > > Not happy. > > ./include/asm-arm/vga.h:#define VGA_MAP_MEM(x) (PCIMEM_BASE + (x)) > ./include/asm-mips/vga.h:#define VGA_MAP_MEM(x) (0xb0000000L + (unsigned long)(x)) > ./include/asm-ppc/vga.h:#define VGA_MAP_MEM(x) (x + vgacon_remap_base) > > > So you can see that VGA_MAP_MEM is already ioremapping which is causing > the problem. Personally I like to see the lose ends fixed on ARM, MIPS, > and PPC so we can use just ioremap. I have pondered your email at length and have failed to understand it. I _think_ you're saying that we need to do this, which will fix x86: --- 25/drivers/video/vga16fb.c~vga16fb-fix Tue May 18 17:10:14 2004 +++ 25-akpm/drivers/video/vga16fb.c Tue May 18 17:10:39 2004 @@ -1347,7 +1347,7 @@ int __init vga16fb_init(void) /* XXX share VGA_FB_PHYS and I/O region with vgacon and others */ - vga16fb.screen_base = ioremap(VGA_MAP_MEM(VGA_FB_PHYS), VGA_FB_PHYS_LEN); + vga16fb.screen_base = VGA_MAP_MEM(VGA_FB_PHYS); if (!vga16fb.screen_base) { printk(KERN_ERR "vga16fb: unable to map device\n"); ret = -ENOMEM; _ and that ARM and others need to teach their VGA_MAP_MEM() to do an internal ioremap(). Or do you mean something else? Please be more clear? ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: vga16fb broke 2004-05-19 0:16 ` Andrew Morton @ 2004-05-19 0:18 ` James Simmons 2004-05-19 0:38 ` Andrew Morton 0 siblings, 1 reply; 5+ messages in thread From: James Simmons @ 2004-05-19 0:18 UTC (permalink / raw) To: Andrew Morton; +Cc: VANDROVE, vince, linux-fbdev-devel, linux-kernel > I have pondered your email at length and have failed to understand it. > > I _think_ you're saying that we need to do this, which will fix x86: > > --- 25/drivers/video/vga16fb.c~vga16fb-fix Tue May 18 17:10:14 2004 > +++ 25-akpm/drivers/video/vga16fb.c Tue May 18 17:10:39 2004 > @@ -1347,7 +1347,7 @@ int __init vga16fb_init(void) > > /* XXX share VGA_FB_PHYS and I/O region with vgacon and others */ > > - vga16fb.screen_base = ioremap(VGA_MAP_MEM(VGA_FB_PHYS), VGA_FB_PHYS_LEN); > + vga16fb.screen_base = VGA_MAP_MEM(VGA_FB_PHYS); > if (!vga16fb.screen_base) { > printk(KERN_ERR "vga16fb: unable to map device\n"); > ret = -ENOMEM; This will make the driver on all platforms. _ > > and that ARM and others need to teach their VGA_MAP_MEM() to do an internal > ioremap(). > > Or do you mean something else? Please be more clear? I like to see the VGA_MAP_MEM hack go away and be replaced with ioremap. ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: vga16fb broke 2004-05-19 0:18 ` James Simmons @ 2004-05-19 0:38 ` Andrew Morton 2004-05-19 22:09 ` James Simmons 0 siblings, 1 reply; 5+ messages in thread From: Andrew Morton @ 2004-05-19 0:38 UTC (permalink / raw) To: James Simmons; +Cc: VANDROVE, vince, linux-fbdev-devel, linux-kernel James Simmons <jsimmons@infradead.org> wrote: > > > > I have pondered your email at length and have failed to understand it. > > > > I _think_ you're saying that we need to do this, which will fix x86: > > > > --- 25/drivers/video/vga16fb.c~vga16fb-fix Tue May 18 17:10:14 2004 > > +++ 25-akpm/drivers/video/vga16fb.c Tue May 18 17:10:39 2004 > > @@ -1347,7 +1347,7 @@ int __init vga16fb_init(void) > > > > /* XXX share VGA_FB_PHYS and I/O region with vgacon and others */ > > > > - vga16fb.screen_base = ioremap(VGA_MAP_MEM(VGA_FB_PHYS), VGA_FB_PHYS_LEN); > > + vga16fb.screen_base = VGA_MAP_MEM(VGA_FB_PHYS); > > if (!vga16fb.screen_base) { > > printk(KERN_ERR "vga16fb: unable to map device\n"); > > ret = -ENOMEM; > > This will make the driver on all platforms. There's a missing word in that sentence. Was it "work" or "crash"? This matters ;) > _ > > > > and that ARM and others need to teach their VGA_MAP_MEM() to do an internal > > ioremap(). > > > > Or do you mean something else? Please be more clear? > > I like to see the VGA_MAP_MEM hack go away and be replaced with ioremap. If you can cut a patch we can ask arch maintainers to review and test it. ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: vga16fb broke 2004-05-19 0:38 ` Andrew Morton @ 2004-05-19 22:09 ` James Simmons 0 siblings, 0 replies; 5+ messages in thread From: James Simmons @ 2004-05-19 22:09 UTC (permalink / raw) To: Andrew Morton; +Cc: VANDROVE, vince, linux-fbdev-devel, linux-kernel > > > /* XXX share VGA_FB_PHYS and I/O region with vgacon and others */ > > > > > > - vga16fb.screen_base = ioremap(VGA_MAP_MEM(VGA_FB_PHYS), VGA_FB_PHYS_LEN); > > > + vga16fb.screen_base = VGA_MAP_MEM(VGA_FB_PHYS); > > > if (!vga16fb.screen_base) { > > > printk(KERN_ERR "vga16fb: unable to map device\n"); > > > ret = -ENOMEM; > > > > This will make the driver on all platforms. > > There's a missing word in that sentence. Was it "work" or "crash"? This > matters ;) works :-) > > > and that ARM and others need to teach their VGA_MAP_MEM() to do an internal > > > ioremap(). > > > > > > Or do you mean something else? Please be more clear? > > > > I like to see the VGA_MAP_MEM hack go away and be replaced with ioremap. > > If you can cut a patch we can ask arch maintainers to review and test it. I could but that would take some time. For now apply your fix. Actually Ihave a newer vga16 driver for you I can push you. ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2004-05-19 22:09 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20040514145559.55202998.akpm@osdl.org>
2004-05-18 22:36 ` vga16fb broke James Simmons
2004-05-19 0:16 ` Andrew Morton
2004-05-19 0:18 ` James Simmons
2004-05-19 0:38 ` Andrew Morton
2004-05-19 22:09 ` James Simmons
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).