示例#1
0
static int sysctl_lasat_eeprom_value(ctl_table *table, int *name, int nlen,
                                     void *oldval, size_t *oldlenp,
                                     void *newval, size_t newlen)
{
    int r;

    mutex_lock(&lasat_info_mutex);
    r = sysctl_intvec(table, name, nlen, oldval, oldlenp, newval, newlen);
    if (r < 0) {
        mutex_unlock(&lasat_info_mutex);
        return r;
    }

    if (newval && newlen)
    {
        if (name && *name == LASAT_PRID)
            lasat_board_info.li_eeprom_info.prid = *(int*)newval;

        lasat_write_eeprom_info();
        lasat_init_board_info();
    }
    mutex_unlock(&lasat_info_mutex);

    return 0;
}
void __init prom_init(int argc, char **argv, char **envp, int *prom_vec)
{
    setup_prom_vectors();

    if (current_cpu_data.cputype == CPU_R5000) {
        mips_machtype = MACH_LASAT_200;
        lasat_ndelay_divider = 8;
    } else {
        mips_machtype = MACH_LASAT_100;
        lasat_ndelay_divider = 20;
    }

    at93c = &at93c_defs[mips_machtype];

    lasat_init_board_info();		/* Read info from EEPROM */

    mips_machgroup = MACH_GROUP_LASAT;

    /* Get the command line */
    if (argc>0) {
        strncpy(arcs_cmdline, argv[0], CL_SIZE-1);
        arcs_cmdline[CL_SIZE-1] = '\0';
    }

    /* Set the I/O base address */
    set_io_port_base(KSEG1);

    /* Set memory regions */
    ioport_resource.start = 0;		/* Should be KSEGx ???	*/
    ioport_resource.end = 0xffffffff;	/* Should be ???	*/

    add_memory_region(0, lasat_board_info.li_memsize, BOOT_MEM_RAM);
}
示例#3
0
void __init prom_init(void)
{
	int argc = fw_arg0;
	char **argv = (char **) fw_arg1;

	setup_prom_vectors();

	if (IS_LASAT_200()) {
		printk(KERN_INFO "LASAT 200 board\n");
		lasat_ndelay_divider = LASAT_200_DIVIDER;
		at93c = &at93c_defs[1];
	} else {
		printk(KERN_INFO "LASAT 100 board\n");
		lasat_ndelay_divider = LASAT_100_DIVIDER;
		at93c = &at93c_defs[0];
	}

	lasat_init_board_info();		/*                       */

	/*                      */
	if (argc > 0) {
		strncpy(arcs_cmdline, argv[0], COMMAND_LINE_SIZE-1);
		arcs_cmdline[COMMAND_LINE_SIZE-1] = '\0';
	}

	/*                          */
	set_io_port_base(KSEG1);

	/*                    */
	ioport_resource.start = 0;
	ioport_resource.end = 0xffffffff;	/*                */

	add_memory_region(0, lasat_board_info.li_memsize, BOOT_MEM_RAM);
}
示例#4
0
int proc_lasat_prid(ctl_table *table, int write,
		       void *buffer, size_t *lenp, loff_t *ppos)
{
	int r;

	r = proc_dointvec(table, write, buffer, lenp, ppos);
	if (r < 0)
		return r;
	if (write) {
		lasat_board_info.li_eeprom_info.prid =
			lasat_board_info.li_prid;
		lasat_write_eeprom_info();
		lasat_init_board_info();
	}
	return 0;
}
示例#5
0
文件: sysctl.c 项目: 274914765/C
static int sysctl_lasat_prid(ctl_table *table, int *name, int nlen,
                     void *oldval, size_t *oldlenp,
                     void *newval, size_t newlen)
{
    int r;

    r = sysctl_intvec(table, name, nlen, oldval, oldlenp, newval, newlen);
    if (r < 0)
        return r;
    if (newval && newlen) {
        lasat_board_info.li_eeprom_info.prid = *(int *)newval;
        lasat_write_eeprom_info();
        lasat_init_board_info();
    }
    return 0;
}
示例#6
0
文件: prom.c 项目: ForayJones/iods
void __init prom_init(void)
{
	int argc = fw_arg0;
	char **argv = (char **) fw_arg1;

	setup_prom_vectors();

	if (current_cpu_data.cputype == CPU_R5000) {
		printk(KERN_INFO "LASAT 200 board\n");
		mips_machtype = MACH_LASAT_200;
		lasat_ndelay_divider = LASAT_200_DIVIDER;
	} else {
		printk(KERN_INFO "LASAT 100 board\n");
		mips_machtype = MACH_LASAT_100;
		lasat_ndelay_divider = LASAT_100_DIVIDER;
	}

	at93c = &at93c_defs[mips_machtype];

	lasat_init_board_info();		/* Read info from EEPROM */

	/* Get the command line */
	if (argc > 0) {
		strncpy(arcs_cmdline, argv[0], CL_SIZE-1);
		arcs_cmdline[CL_SIZE-1] = '\0';
	}

	/* Set the I/O base address */
	set_io_port_base(KSEG1);

	/* Set memory regions */
	ioport_resource.start = 0;
	ioport_resource.end = 0xffffffff;	/* Wrong, fixme.  */

	add_memory_region(0, lasat_board_info.li_memsize, BOOT_MEM_RAM);
}