static int __init offb_init(void) { struct device_node *dp = NULL, *boot_disp = NULL; if (fb_get_options("offb", NULL)) return -ENODEV; /* Check if we have a MacOS display without a node spec */ if (of_get_property(of_chosen, "linux,bootx-noscreen", NULL) != NULL) { /* The old code tried to work out which node was the MacOS * display based on the address. I'm dropping that since the * lack of a node spec only happens with old BootX versions * (users can update) and with this code, they'll still get * a display (just not the palette hacks). */ offb_init_nodriver(of_chosen, 1); } for (dp = NULL; (dp = of_find_node_by_type(dp, "display"));) { if (of_get_property(dp, "linux,opened", NULL) && of_get_property(dp, "linux,boot-display", NULL)) { boot_disp = dp; offb_init_nodriver(dp, 0); } } for (dp = NULL; (dp = of_find_node_by_type(dp, "display"));) { if (of_get_property(dp, "linux,opened", NULL) && dp != boot_disp) offb_init_nodriver(dp, 0); } return 0; }
static int __init offb_init(void) { struct device_node *dp = NULL, *boot_disp = NULL; if (fb_get_options("offb", NULL)) return -ENODEV; if (of_get_property(of_chosen, "linux,bootx-noscreen", NULL) != NULL) { offb_init_nodriver(of_chosen, 1); } for (dp = NULL; (dp = of_find_node_by_type(dp, "display"));) { if (of_get_property(dp, "linux,opened", NULL) && of_get_property(dp, "linux,boot-display", NULL)) { boot_disp = dp; offb_init_nodriver(dp, 0); } } for (dp = NULL; (dp = of_find_node_by_type(dp, "display"));) { if (of_get_property(dp, "linux,opened", NULL) && dp != boot_disp) offb_init_nodriver(dp, 0); } return 0; }
int __init offb_init(void) { struct device_node *dp = NULL, *boot_disp = NULL; #if defined(CONFIG_BOOTX_TEXT) && defined(CONFIG_PPC32) struct device_node *macos_display = NULL; #endif if (fb_get_options("offb", NULL)) return -ENODEV; #if defined(CONFIG_BOOTX_TEXT) && defined(CONFIG_PPC32) /* If we're booted from BootX... */ if (boot_infos != 0) { unsigned long addr = (unsigned long) boot_infos->dispDeviceBase; /* find the device node corresponding to the macos display */ while ((dp = of_find_node_by_type(dp, "display"))) { int i; /* * Grrr... It looks like the MacOS ATI driver * munges the assigned-addresses property (but * the AAPL,address value is OK). */ if (strncmp(dp->name, "ATY,", 4) == 0 && dp->n_addrs == 1) { unsigned int *ap = (unsigned int *) get_property(dp, "AAPL,address", NULL); if (ap != NULL) { dp->addrs[0].address = *ap; dp->addrs[0].size = 0x01000000; } } /* * The LTPro on the Lombard powerbook has no addresses * on the display nodes, they are on their parent. */ if (dp->n_addrs == 0 && device_is_compatible(dp, "ATY,264LTPro")) { int na; unsigned int *ap = (unsigned int *) get_property(dp, "AAPL,address", &na); if (ap != 0) for (na /= sizeof(unsigned int); na > 0; --na, ++ap) if (*ap <= addr && addr < *ap + 0x1000000) goto foundit; } /* * See if the display address is in one of the address * ranges for this display. */ for (i = 0; i < dp->n_addrs; ++i) { if (dp->addrs[i].address <= addr && addr < dp->addrs[i].address + dp->addrs[i].size) break; } if (i < dp->n_addrs) { foundit: printk(KERN_INFO "MacOS display is %s\n", dp->full_name); macos_display = dp; break; } } /* initialize it */ offb_init_fb(macos_display ? macos_display-> name : "MacOS display", macos_display ? macos_display-> full_name : "MacOS display", boot_infos->dispDeviceRect[2], boot_infos->dispDeviceRect[3], boot_infos->dispDeviceDepth, boot_infos->dispDeviceRowBytes, addr, NULL); } #endif /* defined(CONFIG_BOOTX_TEXT) && defined(CONFIG_PPC32) */ for (dp = NULL; (dp = of_find_node_by_type(dp, "display"));) { if (get_property(dp, "linux,opened", NULL) && get_property(dp, "linux,boot-display", NULL)) { boot_disp = dp; offb_init_nodriver(dp); } } for (dp = NULL; (dp = of_find_node_by_type(dp, "display"));) { if (get_property(dp, "linux,opened", NULL) && dp != boot_disp) offb_init_nodriver(dp); } return 0; }