Commit b64ef8af authored by Edgar Hucek's avatar Edgar Hucek Committed by Greg Kroah-Hartman

[PATCH] add imacfb documentation and detection

Add basic Machine detection to imacfb and some Ducumentation bits for
imacfb.
Signed-off-by: default avatarEdgar Hucek <hostmaster@ed-soft.at>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent e9fa4f7b
What is imacfb?
===============
This is a generic EFI platform driver for Intel based Apple computers.
Imacfb is only for EFI booted Intel Macs.
Supported Hardware
==================
iMac 17"/20"
Macbook
Macbook Pro 15"/17"
MacMini
How to use it?
==============
Imacfb does not have any kind of autodetection of your machine.
You have to add the fillowing kernel parameters in your elilo.conf:
Macbook :
video=imacfb:macbook
MacMini :
video=imacfb:mini
Macbook Pro 15", iMac 17" :
video=imacfb:i17
Macbook Pro 17", iMac 20" :
video=imacfb:i20
--
Edgar Hucek <gimli@dark-green.com>
...@@ -554,7 +554,7 @@ config FB_VESA ...@@ -554,7 +554,7 @@ config FB_VESA
config FB_IMAC config FB_IMAC
bool "Intel-based Macintosh Framebuffer Support" bool "Intel-based Macintosh Framebuffer Support"
depends on (FB = y) && X86 depends on (FB = y) && X86 && EFI
select FB_CFB_FILLRECT select FB_CFB_FILLRECT
select FB_CFB_COPYAREA select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT select FB_CFB_IMAGEBLIT
......
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
#include <linux/screen_info.h> #include <linux/screen_info.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/dmi.h>
#include <linux/efi.h>
#include <asm/io.h> #include <asm/io.h>
...@@ -28,7 +30,7 @@ typedef enum _MAC_TYPE { ...@@ -28,7 +30,7 @@ typedef enum _MAC_TYPE {
M_I20, M_I20,
M_MINI, M_MINI,
M_MACBOOK, M_MACBOOK,
M_NEW M_UNKNOWN
} MAC_TYPE; } MAC_TYPE;
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
...@@ -52,10 +54,36 @@ static struct fb_fix_screeninfo imacfb_fix __initdata = { ...@@ -52,10 +54,36 @@ static struct fb_fix_screeninfo imacfb_fix __initdata = {
}; };
static int inverse; static int inverse;
static int model = M_NEW; static int model = M_UNKNOWN;
static int manual_height; static int manual_height;
static int manual_width; static int manual_width;
static int set_system(struct dmi_system_id *id)
{
printk(KERN_INFO "imacfb: %s detected - set system to %ld\n",
id->ident, (long)id->driver_data);
model = (long)id->driver_data;
return 0;
}
static struct dmi_system_id __initdata dmi_system_table[] = {
{ set_system, "iMac4,1", {
DMI_MATCH(DMI_BIOS_VENDOR,"Apple Computer, Inc."),
DMI_MATCH(DMI_BIOS_VERSION,"iMac4,1") }, (void*)M_I17},
{ set_system, "MacBookPro1,1", {
DMI_MATCH(DMI_BIOS_VENDOR,"Apple Computer, Inc."),
DMI_MATCH(DMI_BIOS_VERSION,"MacBookPro1,1") }, (void*)M_I17},
{ set_system, "MacBook1,1", {
DMI_MATCH(DMI_BIOS_VENDOR,"Apple Computer, Inc."),
DMI_MATCH(DMI_PRODUCT_NAME,"MacBook1,1")}, (void *)M_MACBOOK},
{ set_system, "Macmini1,1", {
DMI_MATCH(DMI_BIOS_VENDOR,"Apple Computer, Inc."),
DMI_MATCH(DMI_PRODUCT_NAME,"Macmini1,1")}, (void *)M_MINI},
{},
};
#define DEFAULT_FB_MEM 1024*1024*16 #define DEFAULT_FB_MEM 1024*1024*16
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
...@@ -149,7 +177,6 @@ static int __init imacfb_probe(struct platform_device *dev) ...@@ -149,7 +177,6 @@ static int __init imacfb_probe(struct platform_device *dev)
screen_info.lfb_linelength = 1472 * 4; screen_info.lfb_linelength = 1472 * 4;
screen_info.lfb_base = 0x80010000; screen_info.lfb_base = 0x80010000;
break; break;
case M_NEW:
case M_I20: case M_I20:
screen_info.lfb_width = 1680; screen_info.lfb_width = 1680;
screen_info.lfb_height = 1050; screen_info.lfb_height = 1050;
...@@ -207,6 +234,10 @@ static int __init imacfb_probe(struct platform_device *dev) ...@@ -207,6 +234,10 @@ static int __init imacfb_probe(struct platform_device *dev)
size_remap = size_total; size_remap = size_total;
imacfb_fix.smem_len = size_remap; imacfb_fix.smem_len = size_remap;
#ifndef __i386__
screen_info.imacpm_seg = 0;
#endif
if (!request_mem_region(imacfb_fix.smem_start, size_total, "imacfb")) { if (!request_mem_region(imacfb_fix.smem_start, size_total, "imacfb")) {
printk(KERN_WARNING printk(KERN_WARNING
"imacfb: cannot reserve video memory at 0x%lx\n", "imacfb: cannot reserve video memory at 0x%lx\n",
...@@ -324,8 +355,16 @@ static int __init imacfb_init(void) ...@@ -324,8 +355,16 @@ static int __init imacfb_init(void)
int ret; int ret;
char *option = NULL; char *option = NULL;
/* ignore error return of fb_get_options */ if (!efi_enabled)
fb_get_options("imacfb", &option); return -ENODEV;
if (!dmi_check_system(dmi_system_table))
return -ENODEV;
if (model == M_UNKNOWN)
return -ENODEV;
if (fb_get_options("imacfb", &option))
return -ENODEV;
imacfb_setup(option); imacfb_setup(option);
ret = platform_driver_register(&imacfb_driver); ret = platform_driver_register(&imacfb_driver);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment