Exemplo n.º 1
0
static inline int __init indy_sc_probe(void)
{
	unsigned int size = ip22_eeprom_read(&sgimc->eeprom, 17);
	if (size == 0)
		return 0;

	size <<= PAGE_SHIFT;
	printk(KERN_INFO "R4600/R5000 SCACHE size %dK, linesize 32 bytes.\n",
	       size >> 10);
	scache_size = size;

	return 1;
}
Exemplo n.º 2
0
/*
 * Read specified register from main NVRAM
 */
unsigned short ip22_nvram_read(int reg)
{
	if (ip22_is_fullhouse())
		/* IP22 (Indigo2 aka FullHouse) stores env variables into
		 * 93CS56 Microwire Bus EEPROM 2048 Bit (128x16) */
		return ip22_eeprom_read(&hpc3c0->eeprom, reg);
	else {
		unsigned short tmp;
		/* IP24 (Indy aka Guiness) uses DS1386 8K version */
		reg <<= 1;
		tmp = hpc3c0->bbram[reg++] & 0xff;
		return (tmp << 8) | (hpc3c0->bbram[reg] & 0xff);
	}
}
Exemplo n.º 3
0
unsigned short ip22_nvram_read(int reg)
{
	if (ip22_is_fullhouse())
		/*                                                       
                                                   */
		return ip22_eeprom_read(&hpc3c0->eeprom, reg);
	else {
		unsigned short tmp;
		/*                                                */
		reg <<= 1;
		tmp = hpc3c0->bbram[reg++] & 0xff;
		return (tmp << 8) | (hpc3c0->bbram[reg] & 0xff);
	}
}
Exemplo n.º 4
0
/*
 * Create a platform device for the GPI port that receives the
 * image data from the embedded camera.
 */
static int __init sgiseeq_devinit(void)
{
    unsigned int tmp;
    int res, i;

    eth0_pd.hpc = hpc3c0;
    eth0_pd.irq = SGI_ENET_IRQ;
#define EADDR_NVOFS     250
    for (i = 0; i < 3; i++) {
        unsigned short tmp = ip22_nvram_read(EADDR_NVOFS / 2 + i);

        eth0_pd.mac[2 * i]     = tmp >> 8;
        eth0_pd.mac[2 * i + 1] = tmp & 0xff;
    }

    res = platform_device_register(&eth0_device);
    if (res)
        return res;

    /* Second HPC is missing? */
    if (!ip22_is_fullhouse() ||
        get_dbe(tmp, (unsigned int *)&hpc3c1->pbdma[1]))
        return 0;

    sgimc->giopar |= SGIMC_GIOPAR_MASTEREXP1 | SGIMC_GIOPAR_EXP164 |
                     SGIMC_GIOPAR_HPC264;
    hpc3c1->pbus_piocfg[0][0] = 0x3ffff;
    /* interrupt/config register on Challenge S Mezz board */
    hpc3c1->pbus_extregs[0][0] = 0x30;

    eth1_pd.hpc = hpc3c1;
    eth1_pd.irq = SGI_GIO_0_IRQ;
#define EADDR_NVOFS     250
    for (i = 0; i < 3; i++) {
        unsigned short tmp = ip22_eeprom_read(&hpc3c1->eeprom,
                                              EADDR_NVOFS / 2 + i);

        eth1_pd.mac[2 * i]     = tmp >> 8;
        eth1_pd.mac[2 * i + 1] = tmp & 0xff;
    }

    return platform_device_register(&eth1_device);
}