Пример #1
0
void  __init prom_init(void)
{
	int argc = fw_arg0;
    u32 *argv = (u32 *)CKSEG0ADDR(fw_arg1);
    int i;
	char console_string[40];	
	print_board_type();
	
	kerSysEarlyFlashInit();	
	
	prom_init_cmdline();
	
	strcat(arcs_cmdline, " ");

    for (i = 1; i < argc; i++) {
        strcat(arcs_cmdline, (char *)CKSEG0ADDR(argv[i]));
        if (i < (argc - 1))
            strcat(arcs_cmdline, " ");
    }
	
	if(!strstr(arcs_cmdline, "console=ttyS"))
	{
		sprintf(console_string, " console=ttyS0,%d%c%c%c", 115200, 'n', '8', '\0');
		strcat(arcs_cmdline, console_string);
		prom_printf("Config serial console:%s\n", console_string);
	}
	
	retrieve_boot_loader_parameters();
}
void __init prom_init(void)
{
#if 0
    int argc = fw_arg0;
    u32 *argv = (u32 *)CKSEG0ADDR(fw_arg1);
    int i;

    kerSysEarlyFlashInit();

    // too early in bootup sequence to acquire spinlock, not needed anyways
    // only the kernel is running at this point
    kerSysNvRamGetBoardIdLocked(promBoardIdStr);
    printk( "%s prom init\n", promBoardIdStr );

#if defined(CONFIG_BCM_KF_DSP) && defined(CONFIG_BCM_BCMDSP_MODULE)
    main_tp_num = ((read_c0_diag3() & CP0_CMT_TPID) == CP0_CMT_TPID) ? 1 : 0;
    printk("Linux TP ID = %u \n", (unsigned int)main_tp_num);
#endif

    PERF->IrqControl[0].IrqMask=0;

    arcs_cmdline[0] = '\0';

    create_cmdline(arcs_cmdline);

    strcat(arcs_cmdline, " ");

    for (i = 1; i < argc; i++) {
        strcat(arcs_cmdline, (char *)CKSEG0ADDR(argv[i]));
        if (i < (argc - 1))
            strcat(arcs_cmdline, " ");
    }


    /* Count register increments every other clock */
    mips_hpt_frequency = calculateCpuSpeed() / 2;

    retrieve_boot_loader_parameters();
#endif
}