printk("ROM checksum = 0x%x (computed)\n", csum); 
printk(KERN_DEBUG "ROM checksum = 0x%x (computed)\n", csum); 
static void __devinit snd_interwave_detect_memory(snd_gus_card_t * gus){	static unsigned int lmc[13] =	{		0x00000001, 0x00000101, 0x01010101, 0x00000401,		0x04040401, 0x00040101, 0x04040101, 0x00000004,		0x00000404, 0x04040404, 0x00000010, 0x00001010,		0x10101010	};	int bank_pos, pages;	unsigned int i, lmct;	int psizes[4];	unsigned char iwave[8];	unsigned char csum;	snd_interwave_reset(gus);	snd_gf1_write8(gus, SNDRV_GF1_GB_GLOBAL_MODE, snd_gf1_read8(gus, SNDRV_GF1_GB_GLOBAL_MODE) | 0x01);		/* enhanced mode */	snd_gf1_write8(gus, SNDRV_GF1_GB_MEMORY_CONTROL, 0x01);	/* DRAM I/O cycles selected */	snd_gf1_write16(gus, SNDRV_GF1_GW_MEMORY_CONFIG, (snd_gf1_look16(gus, SNDRV_GF1_GW_MEMORY_CONFIG) & 0xff10) | 0x004c);	/* ok.. simple test of memory size */	pages = 0;	snd_gf1_poke(gus, 0, 0x55);	snd_gf1_poke(gus, 1, 0xaa);#if 1	if (snd_gf1_peek(gus, 0) == 0x55 && snd_gf1_peek(gus, 1) == 0xaa)#else	if (0)			/* ok.. for testing of 0k RAM */#endif	{		snd_interwave_bank_sizes(gus, psizes);		lmct = (psizes[3] << 24) | (psizes[2] << 16) |		    (psizes[1] << 8) | psizes[0];#if 0		printk("lmct = 0x%08x\n", lmct);#endif		for (i = 0; i < ARRAY_SIZE(lmc); i++)			if (lmct == lmc[i]) {#if 0				printk("found !!! %i\n", i);#endif				snd_gf1_write16(gus, SNDRV_GF1_GW_MEMORY_CONFIG, (snd_gf1_look16(gus, SNDRV_GF1_GW_MEMORY_CONFIG) & 0xfff0) | i);				snd_interwave_bank_sizes(gus, psizes);				break;			}		if (i >= ARRAY_SIZE(lmc) && !gus->gf1.enh_mode)			 snd_gf1_write16(gus, SNDRV_GF1_GW_MEMORY_CONFIG, (snd_gf1_look16(gus, SNDRV_GF1_GW_MEMORY_CONFIG) & 0xfff0) | 2);		for (i = 0; i < 4; i++) {			gus->gf1.mem_alloc.banks_8[i].address =			    gus->gf1.mem_alloc.banks_16[i].address = i << 22;			gus->gf1.mem_alloc.banks_8[i].size =			    gus->gf1.mem_alloc.banks_16[i].size = psizes[i] << 18;			pages += psizes[i];		}	}	pages <<= 18;	gus->gf1.memory = pages;	snd_gf1_write8(gus, SNDRV_GF1_GB_MEMORY_CONTROL, 0x03);	/* select ROM */	snd_gf1_write16(gus, SNDRV_GF1_GW_MEMORY_CONFIG, (snd_gf1_look16(gus, SNDRV_GF1_GW_MEMORY_CONFIG) & 0xff1f) | (4 << 5));	gus->gf1.rom_banks = 0;	gus->gf1.rom_memory = 0;	for (bank_pos = 0; bank_pos < 16L * 1024L * 1024L; bank_pos += 4L * 1024L * 1024L) {		for (i = 0; i < 8; ++i)			iwave[i] = snd_gf1_peek(gus, bank_pos + i);#ifdef CONFIG_SND_DEBUG_ROM		printk("ROM at 0x%06x = %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n", bank_pos,		       iwave[0], iwave[1], iwave[2], iwave[3],		       iwave[4], iwave[5], iwave[6], iwave[7]);#endif		if (strncmp(iwave, "INTRWAVE", 8))			continue;	/* first check */		csum = 0;		for (i = 0; i < sizeof(struct rom_hdr); i++)			csum += snd_gf1_peek(gus, bank_pos + i);#ifdef CONFIG_SND_DEBUG_ROM		printk("ROM checksum = 0x%x (computed)\n", csum);#endif		if (csum != 0)			continue;	/* not valid rom */		gus->gf1.rom_banks++;		gus->gf1.rom_present |= 1 << (bank_pos >> 22);		gus->gf1.rom_memory = snd_gf1_peek(gus, bank_pos + 40) |				     (snd_gf1_peek(gus, bank_pos + 41) << 8) |				     (snd_gf1_peek(gus, bank_pos + 42) << 16) |				     (snd_gf1_peek(gus, bank_pos + 43) << 24);	}#if 0	if (gus->gf1.rom_memory > 0) {		if (gus->gf1.rom_banks == 1 && gus->gf1.rom_present == 8)			gus->card->type = SNDRV_CARD_TYPE_IW_DYNASONIC;	}#endif	snd_gf1_write8(gus, SNDRV_GF1_GB_MEMORY_CONTROL, 0x00);	/* select RAM */	if (!gus->gf1.enh_mode)		snd_interwave_reset(gus);}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/99b359ba10a582148c6725f428a33ba5356dd993/interwave.c/clean/sound/isa/gus/interwave.c