Exemplo n.º 1
0
static void __init detect_leds(void)
{
	char *prid, *usb_prod;

	/* Default LEDs	*/
	ar7_led_data.num_leds = ARRAY_SIZE(default_leds);
	ar7_led_data.leds = default_leds;

	/* FIXME: the whole thing is unreliable */
	prid = prom_getenv("ProductID");
	usb_prod = prom_getenv("usb_prod");

	/* If we can't get the product id from PROM, use the default LEDs */
	if (!prid)
		return;

	if (strstr(prid, "Fritz_Box_FON")) {
		ar7_led_data.num_leds = ARRAY_SIZE(fb_fon_leds);
		ar7_led_data.leds = fb_fon_leds;
	} else if (strstr(prid, "Fritz_Box_")) {
		ar7_led_data.num_leds = ARRAY_SIZE(fb_sl_leds);
		ar7_led_data.leds = fb_sl_leds;
	} else if ((!strcmp(prid, "AR7RD") || !strcmp(prid, "AR7DB"))
		&& usb_prod != NULL && strstr(usb_prod, "DSL-502T")) {
		ar7_led_data.num_leds = ARRAY_SIZE(dsl502t_leds);
		ar7_led_data.leds = dsl502t_leds;
	} else if (strstr(prid, "DG834")) {
		ar7_led_data.num_leds = ARRAY_SIZE(dg834g_leds);
		ar7_led_data.leds = dg834g_leds;
	}
}
Exemplo n.º 2
0
static void __init sni_console_setup(void)
{
#ifndef CONFIG_ARC
	char *ctype;
	char *cdev;
	char *baud;
	int port;
	static char options[8] __initdata;

	cdev = prom_getenv("console_dev");
	if (strncmp(cdev, "tty", 3) == 0) {
		ctype = prom_getenv("console");
		switch (*ctype) {
		default:
		case 'l':
			port = 0;
			baud = prom_getenv("lbaud");
			break;
		case 'r':
			port = 1;
			baud = prom_getenv("rbaud");
			break;
		}
		if (baud)
			strcpy(options, baud);
		if (strncmp(cdev, "tty552", 6) == 0)
			add_preferred_console("ttyS", port,
					      baud ? options : NULL);
		else
			add_preferred_console("ttySC", port,
					      baud ? options : NULL);
	}
#endif
}
Exemplo n.º 3
0
void
main()
{
	u_int64_t entry;

	/* Init prom callback vector. */
	init_prom_calls();

	/* print a banner */
	printf("%s %s\n", bootprog_name, bootprog_rev);

	/* switch to OSF pal code. */
	OSFpal();

	prom_getenv(PROM_E_BOOTED_FILE, boot_file, sizeof(boot_file));
	prom_getenv(PROM_E_BOOTED_OSFLAGS, boot_flags, sizeof(boot_flags));

	if (boot_file[0] == '\0')
		bcopy("bsd", boot_file, sizeof "bsd");

	(void)printf("Boot: %s %s\n", boot_file, boot_flags);

	if (!loadfile(boot_file, &entry)) {
		(void)printf("Entering kernel at 0x%lx...\n", entry);
		(*(void (*)())entry)(ffp_save, ptbr_save, 0);
	}

	(void)printf("Boot failed!  Halting...\n");
	halt();
}
Exemplo n.º 4
0
int
main()
{
	char *name, **namep;
	u_int64_t entry;
	int win;

	/* Init prom callback vector. */
	init_prom_calls();

	/* print a banner */
	printf("%s\n", bootprog_name);

	/* switch to OSF pal code. */
	OSFpal();

	prom_getenv(PROM_E_BOOTED_FILE, boot_file, sizeof(boot_file));
	prom_getenv(PROM_E_BOOTED_OSFLAGS, boot_flags, sizeof(boot_flags));

	if (boot_file[0] != '\0') {
		(void)printf("Boot file: %s %s\n", boot_file, boot_flags);
		name = boot_file;
	} else
		name = "bsd";
	win = (loadfile(name, &entry) == 0);
	if (!win)
		goto fail;

	/*
	 * Fill in the bootinfo for the kernel.
	 */
	bzero(&bootinfo_v1, sizeof(bootinfo_v1));
	bootinfo_v1.ssym = ssym;
	bootinfo_v1.esym = esym;
	bcopy(name, bootinfo_v1.booted_kernel,
	    sizeof(bootinfo_v1.booted_kernel));
	bcopy(boot_flags, bootinfo_v1.boot_flags,
	    sizeof(bootinfo_v1.boot_flags));
	bootinfo_v1.hwrpb = (void *)HWRPB_ADDR;
	bootinfo_v1.hwrpbsize = ((struct rpb *)HWRPB_ADDR)->rpb_size;
	bootinfo_v1.cngetc = NULL;
	bootinfo_v1.cnputc = NULL;
	bootinfo_v1.cnpollc = NULL;

	(*(void (*)(u_int64_t, u_int64_t, u_int64_t, void *, u_int64_t,
	    u_int64_t))entry)(ffp_save, ptbr_save, BOOTINFO_MAGIC,
	    &bootinfo_v1, 1, 0);

fail:
	halt();
}
Exemplo n.º 5
0
void __init rtgalaxy_env_get_bootrev(void)
{
	char *envp;
	unsigned short v0, v1, v2;

	envp = prom_getenv("bootrev");
	if (envp) {
		strcpy(rtgalaxy_info.bootrev, envp);
		sscanf(envp, "%hx.%hx.%hx", &v0, &v1, &v2);

		rtgalaxy_info.company_id = v0;
		rtgalaxy_info.board_id = (v0 << 16) | v1;

		/* old bootrev format : aa.bb.ccc */
		/* new bootrev format : aaaa.bbbb.cccc */
		if (envp[2] == '.')
			rtgalaxy_info.cpu_id = (v1 & 0xf0) >> 4;
		else
			rtgalaxy_info.cpu_id = (v1 & 0xff00) >> 8;
#ifdef DEBUG
		printk
		    ("bootrev = '%s' => company_id = %04x, cpu_id = %02x, board_id = %08x\n",
		     rtgalaxy_info.bootrev,
		     rtgalaxy_info.company_id,
		     rtgalaxy_info.cpu_id, rtgalaxy_info.board_id);
#endif
	}
Exemplo n.º 6
0
static void __init console_config(void)
{
	char console_string[40];
	int baud = 0;
	char parity = '\0', bits = '\0', flow = '\0';
	char *s;

	if ((strstr(prom_getcmdline(), "console=")) == NULL) {
		s = prom_getenv("modetty0");
		if (s) {
			while (*s >= '0' && *s <= '9')
				baud = baud*10 + *s++ - '0';
			if (*s == ',') s++;
			if (*s) parity = *s++;
			if (*s == ',') s++;
			if (*s) bits = *s++;
			if (*s == ',') s++;
			if (*s == 'h') flow = 'r';
		}
		if (baud == 0)
			baud = 38400;
		if (parity != 'n' && parity != 'o' && parity != 'e')
			parity = 'n';
		if (bits != '7' && bits != '8')
			bits = '8';
		if (flow == '\0')
			flow = 'r';
		sprintf(console_string, " console=ttyS0,%d%c%c%c", baud, parity, bits, flow);
		strcat(prom_getcmdline(), console_string);
		pr_info("Config serial console:%s\n", console_string);
	}
}
Exemplo n.º 7
0
void __init prom_init(void)
{
	unsigned char *memsize_str;
	unsigned long memsize;

	prom_argc = fw_arg0;
	prom_argv = (char **) fw_arg1;
	prom_envp = (char **) fw_arg2;

	mips_machgroup = MACH_GROUP_ALCHEMY;

	/* Set the platform # */
#if	defined (CONFIG_MIPS_DB1550)
	mips_machtype = MACH_DB1550;
#elif	defined (CONFIG_MIPS_DB1500)
	mips_machtype = MACH_DB1500;
#elif	defined (CONFIG_MIPS_DB1100)
	mips_machtype = MACH_DB1100;
#else
	mips_machtype = MACH_DB1000;
#endif

	prom_init_cmdline();

	memsize_str = prom_getenv("memsize");
	if (!memsize_str)
		memsize = 0x04000000;
	else
		memsize = simple_strtol(memsize_str, NULL, 0);
	add_memory_region(0, memsize, BOOT_MEM_RAM);
}
Exemplo n.º 8
0
static int __init msp_usb_setup(void)
{
	char		*strp;
	char		envstr[32];
	struct platform_device *msp_devs[NUM_USB_DEVS];
	unsigned int val;

	/* construct environment name usbmode */
	/* set usbmode <host/device> as pmon environment var */
	/*
	 * Could this perhaps be integrated into the "features" env var?
	 * Use the features key "U", and follow with "H" for host-mode,
	 * "D" for device-mode.	 If it works for Ethernet, why not USB...
	 *  -- hammtrev, 2007/03/22
	 */
	snprintf((char *)&envstr[0], sizeof(envstr), "usbmode");

	/* set default host mode */
	val = 1;

	/* get environment string */
	strp = prom_getenv((char *)&envstr[0]);
	if (strp) {
		/* compare string */
		if (!strcmp(strp, "device"))
			val = 0;
	}

	if (val) {
#if defined(CONFIG_USB_EHCI_HCD)
		msp_devs[0] = &msp_usbhost0_device.dev;
		ppfinit("platform add USB HOST done %s.\n", msp_devs[0]->name);
#ifdef CONFIG_MSP_HAS_DUAL_USB
		msp_devs[1] = &msp_usbhost1_device.dev;
		ppfinit("platform add USB HOST done %s.\n", msp_devs[1]->name);
#endif
#else
		ppfinit("%s: echi_hcd not supported\n", __FILE__);
#endif	/* CONFIG_USB_EHCI_HCD */
	} else {
#if defined(CONFIG_USB_GADGET)
		/* get device mode structure */
		msp_devs[0] = &msp_usbdev0_device.dev;
		ppfinit("platform add USB DEVICE done %s.\n"
					, msp_devs[0]->name);
#ifdef CONFIG_MSP_HAS_DUAL_USB
		msp_devs[1] = &msp_usbdev1_device.dev;
		ppfinit("platform add USB DEVICE done %s.\n"
					, msp_devs[1]->name);
#endif
#else
		ppfinit("%s: usb_gadget not supported\n", __FILE__);
#endif	/* CONFIG_USB_GADGET */
	}
	/* add device */
	platform_add_devices(msp_devs, ARRAY_SIZE(msp_devs));

	return 0;
}
Exemplo n.º 9
0
struct prom_pmemblock * __init prom_getmdesc(void)
{
	char *env_str;
	unsigned int ramsize, rambase;

	env_str = prom_getenv("ramsize");
	if (!env_str) {
		ramsize = CONFIG_RALINK_RAM_SIZE * 1024 * 1024;
#ifdef DEBUG
		printk("ramsize = %d MBytes\n", CONFIG_RALINK_RAM_SIZE );
#endif
	} else {
#ifdef DEBUG
		printk("ramsize = %s\n", env_str);
#endif
		ramsize = simple_strtol(env_str, NULL, 0);
	}

	env_str = prom_getenv("rambase");
	if (!env_str) {
#if defined(CONFIG_RT2880_ASIC) || defined(CONFIG_RT2880_FPGA)
#ifdef DEBUG
		printk("rambase not set, set to default (0x08000000)\n");
#endif
		rambase = 0x08000000;
#else
#ifdef DEBUG
		printk("rambase not set, set to default (0x00000000)\n");
#endif
		rambase = 0x00000000;
#endif
	} else {
#ifdef DEBUG
		printk("rambase = %s\n", env_str);
#endif
		rambase = simple_strtol(env_str, NULL, 0);
	}

	memset(mdesc, 0, sizeof(mdesc));

	mdesc[0].type = surfboard_ram;
	mdesc[0].base = rambase;
	mdesc[0].size = ramsize;

	return &mdesc[0];
}
Exemplo n.º 10
0
static struct prom_pmemblock * __init prom_getmdesc(void)
{
	char *memsize_str;
	unsigned int memsize;
	char *ptr;
	static char cmdline[COMMAND_LINE_SIZE] __initdata;

	
	memsize_str = prom_getenv("memsize");
	if (!memsize_str) {
		printk(KERN_WARNING
		       "memsize not set in boot prom, set to default (32Mb)\n");
		physical_memsize = 0x02000000;
	} else {
#ifdef DEBUG
		pr_debug("prom_memsize = %s\n", memsize_str);
#endif
		physical_memsize = simple_strtol(memsize_str, NULL, 0);
	}

#ifdef CONFIG_CPU_BIG_ENDIAN
	physical_memsize -= PAGE_SIZE;
#endif

	strcpy(cmdline, arcs_cmdline);
	ptr = strstr(cmdline, "memsize=");
	if (ptr && (ptr != cmdline) && (*(ptr - 1) != ' '))
		ptr = strstr(ptr, " memsize=");

	if (ptr)
		memsize = memparse(ptr + 8, &ptr);
	else
		memsize = physical_memsize;

	memset(mdesc, 0, sizeof(mdesc));

	mdesc[0].type = yamon_dontuse;
	mdesc[0].base = 0x00000000;
	mdesc[0].size = 0x00001000;

	mdesc[1].type = yamon_prom;
	mdesc[1].base = 0x00001000;
	mdesc[1].size = 0x000ef000;

	mdesc[2].type = yamon_dontuse;
	mdesc[2].base = 0x000f0000;
	mdesc[2].size = 0x00010000;

	mdesc[3].type = yamon_dontuse;
	mdesc[3].base = 0x00100000;
	mdesc[3].size = CPHYSADDR(PFN_ALIGN((unsigned long)&_end)) - mdesc[3].base;

	mdesc[4].type = yamon_free;
	mdesc[4].base = CPHYSADDR(PFN_ALIGN(&_end));
	mdesc[4].size = memsize - mdesc[4].base;

	return &mdesc[0];
}
Exemplo n.º 11
0
static int
elf_exec(struct loaded_module *mp)
{
    static struct bootinfo_v1	bootinfo_v1;
    struct module_metadata	*md;
    Elf_Ehdr			*hdr;
    int				err;
    int				flen;

    if ((md = mod_findmetadata(mp, MODINFOMD_ELFHDR)) == NULL)
	return(EFTYPE);			/* XXX actually EFUCKUP */
    hdr = (Elf_Ehdr *)&(md->md_data);

    /* XXX ffp_save does not appear to be used in the kernel.. */
    bzero(&bootinfo_v1, sizeof(bootinfo_v1));
    err = bi_load(&bootinfo_v1, &ffp_save, mp);
    if (err)
	return(err);

    /*
     * Fill in the bootinfo for the kernel.
     */
    strncpy(bootinfo_v1.booted_kernel, mp->m_name,
	    sizeof(bootinfo_v1.booted_kernel));
    flen = prom_getenv(PROM_E_BOOTED_OSFLAGS, bootinfo_v1.boot_flags,
		sizeof(bootinfo_v1.boot_flags));
    bootinfo_v1.hwrpb = (void *)HWRPB_ADDR;
    bootinfo_v1.hwrpbsize = ((struct rpb *)HWRPB_ADDR)->rpb_size;
    bootinfo_v1.cngetc = NULL;
    bootinfo_v1.cnputc = NULL;
    bootinfo_v1.cnpollc = NULL;

    /*
     * Append the boot command flags.
     */
    if (mp->m_args != NULL && *mp->m_args != '\0') {
	const char *p = mp->m_args;

	do {
	    if (*p == '-') {
		while (*++p != ' ' && *p != '\0')
		    if (flen < sizeof(bootinfo_v1.boot_flags) - 1)
			bootinfo_v1.boot_flags[flen++] = *p;
	    } else
		while (*p != ' ' && *p != '\0')
		    p++;
	    while (*p == ' ')
		p++;
	} while (*p != '\0');
	bootinfo_v1.boot_flags[flen] = '\0';
    }

    printf("Entering %s at 0x%lx...\n", mp->m_name, hdr->e_entry);
    closeall();
    alpha_pal_imb();
    (*(void (*)())hdr->e_entry)(ffp_save, ptbr_save,
			       BOOTINFO_MAGIC, &bootinfo_v1, 1, 0);
}
Exemplo n.º 12
0
Arquivo: boot.c Projeto: MarginC/kame
int
main()
{
	char *name, **namep;
	u_int64_t entry;
	int win;

	/* Init prom callback vector. */
	init_prom_calls();

	/* print a banner */
	printf("\n");
	printf("%s, Revision %s\n", bootprog_name, bootprog_rev);
	printf("(%s, %s)\n", bootprog_maker, bootprog_date);
	printf("\n");

	/* switch to OSF pal code. */
	OSFpal();

	printf("\n");

	prom_getenv(PROM_E_BOOTED_FILE, boot_file, sizeof(boot_file));
	prom_getenv(PROM_E_BOOTED_OSFLAGS, boot_flags, sizeof(boot_flags));

	if (boot_file[0] != 0)
		(void)printf("Boot file: %s\n", boot_file);
	(void)printf("Boot flags: %s\n", boot_flags);

	if (boot_file[0] != '\0')
		win = (loadfile(name = boot_file, &entry) == 0);
	else
		for (namep = kernelnames, win = 0; *namep != NULL && !win;
		    namep++)
			win = (loadfile(name = *namep, &entry) == 0);

	printf("\n");
	if (win) {
		(void)printf("Entering %s at 0x%lx...\n", name, entry);
		(*(void (*)())entry)(ffp_save, ptbr_save, esym);
	}

	(void)printf("Boot failed!  Halting...\n");
	halt();
}
Exemplo n.º 13
0
void __init plat_time_init(void)
{
	char    *endp, *s;
	unsigned long cpu_rate = 0;

	if (cpu_rate == 0) {
		s = prom_getenv("clkfreqhz");
		cpu_rate = simple_strtoul(s, &endp, 10);
		if (endp != NULL && *endp != 0) {
			printk(KERN_ERR
				"Clock rate in Hz parse error: %s\n", s);
			cpu_rate = 0;
		}
	}

	if (cpu_rate == 0) {
		s = prom_getenv("clkfreq");
		cpu_rate = 1000 * simple_strtoul(s, &endp, 10);
		if (endp != NULL && *endp != 0) {
			printk(KERN_ERR
				"Clock rate in MHz parse error: %s\n", s);
			cpu_rate = 0;
		}
	}

	if (cpu_rate == 0) {
#if defined(CONFIG_PMC_MSP7120_EVAL) \
 || defined(CONFIG_PMC_MSP7120_GW)
		cpu_rate = 400000000;
#elif defined(CONFIG_PMC_MSP7120_FPGA)
		cpu_rate = 25000000;
#else
		cpu_rate = 150000000;
#endif
		printk(KERN_ERR
			"Failed to determine CPU clock rate, "
			"assuming %ld hz ...\n", cpu_rate);
	}

	printk(KERN_WARNING "Clock rate set to %ld\n", cpu_rate);

	/* timer frequency is 1/2 clock rate */
	mips_hpt_frequency = cpu_rate/2;
}
Exemplo n.º 14
0
static void __init cpmac_get_mac(int instance, unsigned char *dev_addr)
{
	char name[5], *mac;

	sprintf(name, "mac%c", 'a' + instance);
	mac = prom_getenv(name);
	if (!mac && instance) {
		sprintf(name, "mac%c", 'a');
		mac = prom_getenv(name);
	}

	if (mac) {
		if (!mac_pton(mac, dev_addr)) {
			pr_warn("cannot parse mac address, using random address\n");
			eth_random_addr(dev_addr);
		}
	} else
		eth_random_addr(dev_addr);
}
Exemplo n.º 15
0
static void cpmac_get_mac(int instance, unsigned char *dev_addr)
{
	int i;
	char name[5], default_mac[ETH_ALEN], *mac;

	mac = NULL;
	sprintf(name, "mac%c", 'a' + instance);
	mac = prom_getenv(name);
	if (!mac) {
		sprintf(name, "mac%c", 'a');
		mac = prom_getenv(name);
	}
	if (!mac) {
		random_ether_addr(default_mac);
		mac = default_mac;
	}
	for (i = 0; i < 6; i++)
		dev_addr[i] = (char2hex(mac[i * 3]) << 4) +
			char2hex(mac[i * 3 + 1]);
}
Exemplo n.º 16
0
int get_ethernet_addr(char *ethernet_addr)
{
        char *ethaddr_str;

        ethaddr_str = prom_getenv("ethaddr");
	if (!ethaddr_str) {
	        printk("ethaddr not set in boot prom\n");
		return -1;
	}
	str2eaddr(ethernet_addr, ethaddr_str);
	return 0;
}
Exemplo n.º 17
0
struct prom_pmemblock * __init prom_getmdesc(void)
{
	char *memsize_str;
	unsigned int memsize;

	memsize_str = prom_getenv("memsize");
	if (!memsize_str) {
		prom_printf("memsize not set in boot prom, set to default (32Mb)\n");
		memsize = 0x02000000;
	} else {
#ifdef DEBUG
		prom_printf("prom_memsize = %s\n", memsize_str);
#endif
		memsize = simple_strtol(memsize_str, NULL, 0);
	}

	memset(mdesc, 0, sizeof(mdesc));

	mdesc[0].type = yamon_dontuse;
	mdesc[0].base = 0x00000000;
	mdesc[0].size = 0x00001000;

	mdesc[1].type = yamon_prom;
	mdesc[1].base = 0x00001000;
	mdesc[1].size = 0x000ef000;

#if (CONFIG_MIPS_MALTA)
	/* 
	 * The area 0x000f0000-0x000fffff is allocated for BIOS memory by the
	 * south bridge and PCI access always forwarded to the ISA Bus and 
	 * BIOSCS# is always generated.
	 * This mean that this area can't be used as DMA memory for PCI 
	 * devices.
	 */
	mdesc[2].type = yamon_dontuse;
	mdesc[2].base = 0x000f0000;
	mdesc[2].size = 0x00010000;
#else
	mdesc[2].type = yamon_prom;
	mdesc[2].base = 0x000f0000;
	mdesc[2].size = 0x00010000;
#endif

	mdesc[3].type = yamon_dontuse;
	mdesc[3].base = 0x00100000;
	mdesc[3].size = CPHYSADDR(PFN_ALIGN(&_end)) - mdesc[3].base;

	mdesc[4].type = yamon_free;
	mdesc[4].base = CPHYSADDR(PFN_ALIGN(&_end));
	mdesc[4].size = memsize - mdesc[4].base;

	return &mdesc[0];
}
Exemplo n.º 18
0
void
init_bootstrap_console(void)
{
	char buf[4];

	init_prom_interface(hwrpb);

	prom_getenv(PROM_E_TTY_DEV, buf, 4);
	alpha_console = buf[0] - '0';

	/* XXX fake out the console routines, for now */
	cn_tab = &promcons;
}
Exemplo n.º 19
0
static void __init cpmac_get_mac(int instance, unsigned char *dev_addr)
{
	char name[5], *mac;

	sprintf(name, "mac%c", 'a' + instance);
	mac = prom_getenv(name);
	if (!mac && instance) {
		sprintf(name, "mac%c", 'a');
		mac = prom_getenv(name);
	}

	if (mac) {
		if (sscanf(mac, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx",
					&dev_addr[0], &dev_addr[1],
					&dev_addr[2], &dev_addr[3],
					&dev_addr[4], &dev_addr[5]) != 6) {
			pr_warning("cannot parse mac address, "
					"using random address\n");
			eth_random_addr(dev_addr);
		}
	} else
		eth_random_addr(dev_addr);
}
Exemplo n.º 20
0
static int __init msp_usb_setup(void)
{
#if defined(CONFIG_USB_EHCI_HCD) || defined(CONFIG_USB_GADGET)
	char *strp;
	char envstr[32];
	unsigned int val = 0;
	int result = 0;

	/*
	 * construct environment name usbmode
	 * set usbmode <host/device> as pmon environment var
	 */
	snprintf((char *)&envstr[0], sizeof(envstr), "usbmode");

#if defined(CONFIG_USB_EHCI_HCD)
	/* default to host mode */
	val = 1;
#endif

	/* get environment string */
	strp = prom_getenv((char *)&envstr[0]);
	if (strp) {
		if (!strcmp(strp, "device"))
			val = 0;
	}

	if (val) {
#if defined(CONFIG_USB_EHCI_HCD)
		/* get host mode device */
		msp_devs[0] = &msp_usbhost_device;
		ppfinit("platform add USB HOST done %s.\n",
			    msp_devs[0]->name);

		result = platform_add_devices(msp_devs, ARRAY_SIZE (msp_devs));
#endif /* CONFIG_USB_EHCI_HCD */
	}
#if defined(CONFIG_USB_GADGET)
	else {
		/* get device mode structure */
		msp_devs[0] = &msp_usbdev_device;
		ppfinit("platform add USB DEVICE done %s.\n",
			    msp_devs[0]->name);

		result = platform_add_devices(msp_devs, ARRAY_SIZE (msp_devs));
	}
#endif /* CONFIG_USB_GADGET */
#endif /* CONFIG_USB_EHCI_HCD || CONFIG_USB_GADGET */

	return result;
}
Exemplo n.º 21
0
static void __init detect_leds(void)
{
	char *prid, *usb_prod;

	
	ar7_led_data.num_leds = ARRAY_SIZE(default_leds);
	ar7_led_data.leds = default_leds;

	
	prid = prom_getenv("ProductID");
	usb_prod = prom_getenv("usb_prod");

	
	if (!prid)
		return;

	if (strstr(prid, "Fritz_Box_FON")) {
		ar7_led_data.num_leds = ARRAY_SIZE(fb_fon_leds);
		ar7_led_data.leds = fb_fon_leds;
	} else if (strstr(prid, "Fritz_Box_")) {
		ar7_led_data.num_leds = ARRAY_SIZE(fb_sl_leds);
		ar7_led_data.leds = fb_sl_leds;
	} else if ((!strcmp(prid, "AR7RD") || !strcmp(prid, "AR7DB"))
		&& usb_prod != NULL && strstr(usb_prod, "DSL-502T")) {
		ar7_led_data.num_leds = ARRAY_SIZE(dsl502t_leds);
		ar7_led_data.leds = dsl502t_leds;
	} else if (strstr(prid, "DG834")) {
		ar7_led_data.num_leds = ARRAY_SIZE(dg834g_leds);
		ar7_led_data.leds = dg834g_leds;
	} else if (strstr(prid, "CYWM") || strstr(prid, "CYWL")) {
		ar7_led_data.num_leds = ARRAY_SIZE(titan_leds);
		ar7_led_data.leds = titan_leds;
	} else if (strstr(prid, "GT701")) {
		ar7_led_data.num_leds = ARRAY_SIZE(gt701_leds);
		ar7_led_data.leds = gt701_leds;
	}
}
Exemplo n.º 22
0
/*    
 * Quiz SRM for disk devices, save a little info about them.
 */
static int
bd_init(void) 
{
    prom_return_t ret;
    char devname[64];

    bdinfo[0].bd_unit = 0;	/* XXX */
    bdinfo[0].bd_flags = 0;	/* XXX */
    ret.bits = prom_getenv(PROM_E_BOOTED_DEV,
			   bdinfo[0].bd_name, sizeof(bdinfo[0].bd_name));
    bdinfo[0].bd_namelen = ret.u.retval;
    nbdinfo++;

    return (0);
}
Exemplo n.º 23
0
void __init prom_init(void)
{
	unsigned char *memsize_str;
	unsigned long memsize;

	prom_argc = (int)fw_arg0;
	prom_argv = (char **)fw_arg1;
	prom_envp = (char **)fw_arg2;

	prom_init_cmdline();
	memsize_str = prom_getenv("memsize");
	if (!memsize_str || strict_strtoul(memsize_str, 0, &memsize))
		memsize = ALCHEMY_BOARD_DEFAULT_MEMSIZE;

	add_memory_region(0, memsize, BOOT_MEM_RAM);
}
Exemplo n.º 24
0
void __init prom_init(void)
{
	unsigned char *memsize_str;
	unsigned long memsize;

	prom_argc = fw_arg0;
	prom_argv = (char **)fw_arg1;
	prom_envp = (char **)fw_arg2;

	prom_init_cmdline();

	memsize_str = prom_getenv("memsize");
	if (!memsize_str || kstrtoul(memsize_str, 0, &memsize))
		memsize = 0x04000000;
	add_memory_region(0, memsize, BOOT_MEM_RAM);
}
Exemplo n.º 25
0
void __init prom_init(void)
{
	unsigned char *memsize_str;
	unsigned long memsize;

	prom_argc = (int)fw_arg0;
	prom_argv = (char **)fw_arg1;
	prom_envp = (char **)fw_arg2;

	prom_init_cmdline();
	memsize_str = prom_getenv("memsize");
	if (!memsize_str || kstrtoul(memsize_str, 0, &memsize))
		memsize = 64 << 20; /* all devboards have at least 64MB RAM */

	add_memory_region(0, memsize, BOOT_MEM_RAM);
}
Exemplo n.º 26
0
void __init prom_init(void)
{
	unsigned char *memsize_str;
	unsigned long memsize;

	prom_argc = (int)fw_arg0;
	prom_argv = (char **)fw_arg1;
	prom_envp = (char **)fw_arg2;

	prom_init_cmdline();
	memsize_str = prom_getenv("memsize");
	if (!memsize_str)
		memsize = 0x08000000;
	else
		memsize = strict_strtol(memsize_str, 0, NULL);
	add_memory_region(0, memsize, BOOT_MEM_RAM);
}
Exemplo n.º 27
0
Arquivo: prom.c Projeto: MarginC/kame
void
init_prom_interface()
{
	struct crb *c;
	char buf[4];

	c = (struct crb*)((char*)hwrpb + hwrpb->rpb_crb_off);

        prom_dispatch_v.routine_arg = c->crb_v_dispatch;
        prom_dispatch_v.routine = c->crb_v_dispatch->entry_va;

	prom_getenv(PROM_E_TTY_DEV, buf, 4);
	alpha_console = buf[0] - '0';

	/* XXX fake out the console routines, for now */
	cn_tab = &promcons;
}
Exemplo n.º 28
0
void __init prom_init(void)
{
	unsigned char *memsize_str;
	unsigned long memsize;

	prom_argc = (int) fw_arg0;
	prom_argv = (char **) fw_arg1;
	prom_envp = (char **) fw_arg2;

	prom_init_cmdline();
	memsize_str = prom_getenv("memsize");
	if (!memsize_str) {
		memsize = 0x04000000;
	} else {
		memsize = simple_strtol(memsize_str, NULL, 0);
	}
	add_memory_region(0, memsize, BOOT_MEM_RAM);
}
Exemplo n.º 29
0
int __init prom_get_ethernet_addr(char *ethernet_addr)
{
	char *ethaddr_str;

	/* Check the environment variables first */
	ethaddr_str = prom_getenv("ethaddr");
	if (!ethaddr_str) {
		/* Check command line */
		ethaddr_str = strstr(arcs_cmdline, "ethaddr=");
		if (!ethaddr_str)
			return -1;

		ethaddr_str += strlen("ethaddr=");
	}

	str2eaddr(ethernet_addr, ethaddr_str);

	return 0;
}
Exemplo n.º 30
0
void __init prom_init(void)
{
	unsigned char *memsize_str;
	unsigned long memsize;

	prom_argc = (int) fw_arg0;
	prom_argv = (char **) fw_arg1;
	prom_envp = (char **) fw_arg2;

	mips_machtype = MACH_INGENIC_JZ4740;

	prom_init_cmdline();
	memsize_str = prom_getenv("memsize");
	if (!memsize_str) {
		memsize = MEMSIZE;
	} else {
		memsize = simple_strtol(memsize_str, NULL, 0);
	}
	add_memory_region(0, memsize, BOOT_MEM_RAM);
}