Exemplo n.º 1
0
void __init prom_init(void)
{
    int argc = fw_arg0;
    char **arg = (char **) fw_arg1;
    char **env = (char **) fw_arg2;
    struct callvectors *cv = (struct callvectors *) fw_arg3;
    int i;

#ifdef CONFIG_64BIT
    char *ptr;
    printk("prom_init - MIPS64\n");

    /* save the PROM vectors for debugging use */
    debug_vectors = (struct callvectors *)signext((unsigned long)cv);

    /* arg[0] is "g", the rest is boot parameters */
    arcs_cmdline[0] = '\0';

    for (i = 1; i < argc; i++) {
        ptr = (char *)arg64((unsigned long)arg, i);
        if ((strlen(arcs_cmdline) + strlen(ptr) + 1) >=
                sizeof(arcs_cmdline))
            break;
        strcat(arcs_cmdline, ptr);
        strcat(arcs_cmdline, " ");
    }
    i = 0;

    while (1) {
        ptr = (char *)arg64((unsigned long)env, i);
        if (! ptr)
            break;

        if (strncmp("gtbase", ptr, strlen("gtbase")) == 0) {
            marvell_base = simple_strtol(ptr + strlen("gtbase="),
                                         NULL, 16);

            if ((marvell_base & 0xffffffff00000000) == 0)
                marvell_base |= 0xffffffff00000000;

            printk("marvell_base set to 0x%016lx\n", marvell_base);
        }
        if (strncmp("cpuclock", ptr, strlen("cpuclock")) == 0) {
            cpu_clock = simple_strtol(ptr + strlen("cpuclock="),
                                      NULL, 10);
            printk("cpu_clock set to %d\n", cpu_clock);
        }
        i++;
    }
    printk("arcs_cmdline: %s\n", arcs_cmdline);

#else   /* CONFIG_64BIT */

    /* save the PROM vectors for debugging use */
    debug_vectors = cv;

    /* arg[0] is "g", the rest is boot parameters */
    arcs_cmdline[0] = '\0';
    for (i = 1; i < argc; i++) {
        if (strlen(arcs_cmdline) + strlen(arg[i] + 1)
                >= sizeof(arcs_cmdline))
            break;
        strcat(arcs_cmdline, arg[i]);
        strcat(arcs_cmdline, " ");
    }

    while (*env) {
        if (strncmp("gtbase", *env, strlen("gtbase")) == 0) {
            marvell_base = simple_strtol(*env + strlen("gtbase="),
                                         NULL, 16);
        }
        if (strncmp("cpuclock", *env, strlen("cpuclock")) == 0) {
            cpu_clock = simple_strtol(*env + strlen("cpuclock="),
                                      NULL, 10);
        }
        env++;
    }
#endif /* CONFIG_64BIT */

    mips_machgroup = MACH_GROUP_MOMENCO;
    mips_machtype = MACH_MOMENCO_OCELOT_3;

#ifndef CONFIG_64BIT
    debug_vectors->printf("Booting Linux kernel...\n");
#endif
}
Exemplo n.º 2
0
/* PMON passes arguments in C main() style */
void __init prom_init(void)
{
	int argc = fw_arg0;
	char **arg = (char **) fw_arg1;
	char **env = (char **) fw_arg2;
	struct callvectors *cv = (struct callvectors *) fw_arg3;
	int i;

#ifdef CONFIG_SERIAL_8250_CONSOLE
//	ja_setup_console();	/* The very first thing.  */
#endif

#ifdef CONFIG_64BIT
	char *ptr;

	printk("Mips64 Jaguar-ATX\n");
	/* save the PROM vectors for debugging use */
	debug_vectors = (struct callvectors *)signext((unsigned long)cv);

	/* arg[0] is "g", the rest is boot parameters */
	arcs_cmdline[0] = '\0';

	for (i = 1; i < argc; i++) {
		ptr = (char *)arg64((unsigned long)arg, i);
		if ((strlen(arcs_cmdline) + strlen(ptr) + 1) >=
		    sizeof(arcs_cmdline))
			break;
		strcat(arcs_cmdline, ptr);
		strcat(arcs_cmdline, " ");
	}

	i = 0;
	while (1) {
		ptr = (char *)arg64((unsigned long)env, i);
		if (! ptr)
			break;

		if (strncmp("gtbase", ptr, strlen("gtbase")) == 0) {
			marvell_base = simple_strtol(ptr + strlen("gtbase="),
							NULL, 16);

			if ((marvell_base & 0xffffffff00000000) == 0)
				marvell_base |= 0xffffffff00000000;

			printk("marvell_base set to 0x%016lx\n", marvell_base);
		}
		if (strncmp("cpuclock", ptr, strlen("cpuclock")) == 0) {
			cpu_clock = simple_strtol(ptr + strlen("cpuclock="),
							NULL, 10);
			printk("cpu_clock set to %d\n", cpu_clock);
		}
		i++;
	}
	printk("arcs_cmdline: %s\n", arcs_cmdline);

#else   /* CONFIG_64BIT */
	/* save the PROM vectors for debugging use */
	debug_vectors = cv;

	/* arg[0] is "g", the rest is boot parameters */
	arcs_cmdline[0] = '\0';
	for (i = 1; i < argc; i++) {
		if (strlen(arcs_cmdline) + strlen(arg[i] + 1)
		    >= sizeof(arcs_cmdline))
			break;
		strcat(arcs_cmdline, arg[i]);
		strcat(arcs_cmdline, " ");
	}

	while (*env) {
		if (strncmp("gtbase", *env, strlen("gtbase")) == 0) {
			marvell_base = simple_strtol(*env + strlen("gtbase="),
							NULL, 16);
		}
		if (strncmp("cpuclock", *env, strlen("cpuclock")) == 0) {
			cpu_clock = simple_strtol(*env + strlen("cpuclock="),
							NULL, 10);
		}
		env++;
	}
#endif /* CONFIG_64BIT */
	mips_machgroup = MACH_GROUP_MOMENCO;
	mips_machtype = MACH_MOMENCO_JAGUAR_ATX;

#ifdef CONFIG_MV643XX_ETH
	/* get the base MAC address for on-board ethernet ports */
	get_mac(prom_mac_addr_base);
#endif
}
Exemplo n.º 3
0
/* PMON passes arguments in C main() style */
void __init prom_init(int argc, char **arg, char **env, struct callvectors *cv)
{
	int i;
#ifdef CONFIG_MIPS64
	char *ptr;

	printk("Mips64 Jaguar-ATX\n");
	/* save the PROM vectors for debugging use */
	debug_vectors = (struct callvectors *)signext((unsigned long)cv);

	/* arg[0] is "g", the rest is boot parameters */
	arcs_cmdline[0] = '\0';

	for (i = 1; i < argc; i++) {
		ptr = (char *)arg64((unsigned long)arg, i);
		if ((strlen(arcs_cmdline) + strlen(ptr) + 1) >=
		    sizeof(arcs_cmdline))
			break;
		strcat(arcs_cmdline, ptr);
		strcat(arcs_cmdline, " ");
	}

	i = 0;
	while (1) {
		ptr = (char *)arg64((unsigned long)env, i);
		if (! ptr)
			break;

		if (strncmp("gtbase", ptr, strlen("gtbase")) == 0) {
			mv64340_base = simple_strtol(ptr + strlen("gtbase="),
							NULL, 16);

			if ((mv64340_base & 0xffffffff00000000) == 0)
				mv64340_base |= 0xffffffff00000000;

			printk("mv64340_base set to 0x%016lx\n", mv64340_base);
		}
		if (strncmp("cpuclock", ptr, strlen("cpuclock")) == 0) {
			cpu_clock = simple_strtol(ptr + strlen("cpuclock="),
							NULL, 10);
			printk("cpu_clock set to %d\n", cpu_clock);
		}
		i++;
	}
	printk("arcs_cmdline: %s\n", arcs_cmdline);

#else   /* CONFIG_MIPS64 */
	/* save the PROM vectors for debugging use */
	debug_vectors = cv;

	/* arg[0] is "g", the rest is boot parameters */
	arcs_cmdline[0] = '\0';
	for (i = 1; i < argc; i++) {
		if (strlen(arcs_cmdline) + strlen(arg[i] + 1)
		    >= sizeof(arcs_cmdline))
			break;
		strcat(arcs_cmdline, arg[i]);
		strcat(arcs_cmdline, " ");
	}

	while (*env) {
		if (strncmp("gtbase", *env, strlen("gtbase")) == 0) {
			mv64340_base = simple_strtol(*env + strlen("gtbase="),
							NULL, 16);
		}
		if (strncmp("cpuclock", *env, strlen("cpuclock")) == 0) {
			cpu_clock = simple_strtol(*env + strlen("cpuclock="),
							NULL, 10);
		}
		env++;
	}
#endif /* CONFIG_MIPS64 */
	mips_machgroup = MACH_GROUP_MOMENCO;
	mips_machtype = MACH_MOMENCO_JAGUAR_ATX;

#ifdef CONFIG_MV64340_ETH
	/* get the base MAC address for on-board ethernet ports */
	get_mac(prom_mac_addr_base);
#endif

#ifndef CONFIG_MIPS64
	debug_vectors->printf("Booting Linux kernel...\n");
#endif
}