Skip to contentSkip to conversation

Some puzzles on dram_size()

U-Boot-Users SAM SONG 1 participant 1 message Jan 4, 2004

lore
Share & tools
lore

SAM SONG

author
#0 lore raw

Hi,

for (cnt = maxsize/sizeof(long); cnt > 0; cnt >>= 1) {
addr = base + cnt; /* pointer arith! */

	        save[i++] = *addr;
	        *addr = ~cnt;
	}

	** write 0 to base address **
	addr = base;
	save[i] = *addr;
	*addr = 0;

	** check at base address **
	if ((val = *addr) != 0) {
		*addr = save[i];
		return (0);
	}

	for (cnt = 1; cnt <= maxsize/sizeof(long); cnt <<= 1)
{
		addr = base + cnt;	** pointer arith! **

		val = *addr;
		*addr = save[--i];

	if (val != (~cnt)) {
		return (cnt * sizeof(long));
	}
	} 

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com