Ejemplo n.º 1
0
/**
 * PE_init_platform
 *
 * Initialize the platform expert for ARM.
 */
void PE_init_platform(boolean_t vm_initialized, void * _args)
{
    boot_args *args = (boot_args *)_args;

    if (PE_state.initialized == FALSE) {
        PE_early_puts("PE_init_platform: My name is Macintosh.\n");
        PE_early_puts("PE_init_platform: Initializing for the first time.\n");

        PE_state.initialized            = TRUE;
        PE_state.bootArgs               = _args;
        PE_state.deviceTreeHead         = args->deviceTreeP;

        PE_state.video.v_baseAddr       = args->Video.v_baseAddr;
        PE_state.video.v_rowBytes       = args->Video.v_rowBytes;
        PE_state.video.v_width          = args->Video.v_width;
        PE_state.video.v_height         = args->Video.v_height;
        PE_state.video.v_depth          = args->Video.v_depth;
        PE_state.video.v_display        = args->Video.v_display;

        strcpy(PE_state.video.v_pixelFormat, "PPPPPPPP");
    }

    if (!vm_initialized)
    {
        /* Initialize the device tree crap. */
        PE_early_puts("PE_init_platform: Initializing device tree\n");
        DTInit(PE_state.deviceTreeHead);

        PE_early_puts("PE_init_platform: Calling pe_identify_machine\n");
        pe_identify_machine(NULL);
    }
    else
    {
        kprintf("PE_init_platform: It sure is great to get out of that bag.\n");

        PE_init_SocSupport();

        pe_arm_init_interrupts(NULL);
    }
}
Ejemplo n.º 2
0
/**
 * PE_init_platform
 *
 * Initialize the platform expert for ARM.
 */
void PE_init_platform(boolean_t vm_initialized, void * _args)
{
    boot_args *args = (boot_args *)_args;
    
    if (PE_state.initialized == FALSE) {
        PE_early_puts("PE_init_platform: My name is Macintosh.\n");
        PE_early_puts("PE_init_platform: Initializing for the first time.\n");
        
        PE_state.initialized            = TRUE;
        PE_state.bootArgs               = _args;
        PE_state.deviceTreeHead         = args->deviceTreeP;

        PE_state.video.v_baseAddr       = args->Video.v_baseAddr;
        PE_state.video.v_rowBytes       = args->Video.v_rowBytes;
        PE_state.video.v_width          = args->Video.v_width;
        PE_state.video.v_height         = args->Video.v_height;
        PE_state.video.v_depth          = args->Video.v_depth;
        PE_state.video.v_display        = args->Video.v_display;
        
        strcpy(PE_state.video.v_pixelFormat, "PPPPPPPP");
    }
    
    if (!vm_initialized)
	{
        /* Initialize the device tree crap. */
        PE_early_puts("PE_init_platform: Initializing device tree\n");
        DTInit(PE_state.deviceTreeHead);
        
        PE_early_puts("PE_init_platform: Calling pe_identify_machine\n");
        pe_identify_machine(NULL);
	}
	else
	{
        DTEntry             entry;
        char*               fversion, map;
        unsigned int        size;

        pe_initialized = 1;

        kprintf("PE_init_platform: It sure is great to get out of that bag.\n");
        PE_init_SocSupport();

        /* Reset kputc. */
        PE_kputc = gPESocDispatch.uart_putc;

        /* XXX: Real iOS kernel does iBoot/debug-enabled init after the DTInit call. */
        if( kSuccess == DTLookupEntry(NULL, "/chosen", &entry)) {
            /* What's the iBoot version on this bad boy? */
            if( kSuccess == DTGetProperty(entry, "firmware-version", (void **) &fversion, &size)) {
                if(fversion && (strlen(fversion) <= 32)) {
                    ovbcopy((void*)fversion, (void*)firmware_version, strlen(fversion));
                }
            }
            /* Is the SoC debug-enabled? */
            if( kSuccess == DTGetProperty(entry, "debug-enabled", (void **) &map, &size)) {
                debug_enabled = 1;
            }            
        }

        pe_arm_init_interrupts(NULL);
	}
}