[U-Boot] U-boot hangs on boot time
John Smith
johnsmith520328 at yahoo.com
Mon Jan 5 12:39:23 CET 2009
Hey all,
my u-boot-1.1.1 hangs while booting, as follow is the message got from the serial:
------------------------------------------------------
U-Boot 1.1.6 (Jan 5 2009 - 18:37:55)
DRAM: 8MB
Flash: 2MB
------------------------------------------------------
after some tests by tracing the sequences of the funtions, I found that the u-boot hangs while comming to this funtion:
device_register (&dev), which is a subfuntion of drv_system_init ();
and I look into device_register(&dev):
int device_register (device_t * dev)
{
ListInsertItem (devlist, dev, LIST_END);
return 0;
}
as follow are two invoid funtions copy from the devices.c.
int ListInsertItem (list_t list, void *ptrToItem, int itemPosition)
{
return ListInsertItems (list, ptrToItem, itemPosition, 1);
}
int ListInsertItems (list_t list, void *ptrToItems, int firstItemPosition,
int numItemsToInsert)
{
int numItems = (*list)->numItems;
if (firstItemPosition == numItems + 1)
firstItemPosition = LIST_END;
else if (firstItemPosition > numItems)
return 0;
if ((*list)->numItems >= (*list)->listSize) {
if (!ExpandListSpace (list, -numItemsToInsert))
return 0;
}
if (firstItemPosition == LIST_START) {
if (numItems == 0) {
/* special case for empty list */
firstItemPosition = LIST_END;
} else {
firstItemPosition = 1;
}
}
if (firstItemPosition == LIST_END) { /* add at the end of the list */
if (ptrToItems)
memcpy (ITEMPTR (list, numItems), ptrToItems,
(*list)->itemSize * numItemsToInsert);
else
memset (ITEMPTR (list, numItems), 0,
(*list)->itemSize * numItemsToInsert);
(*list)->numItems += numItemsToInsert;
} else { /* move part of list up to make room for new item */
memmove (ITEMPTR (list, firstItemPosition - 1 + numItemsToInsert),
ITEMPTR (list, firstItemPosition - 1),
(numItems + 1 - firstItemPosition) * (*list)->itemSize);
if (ptrToItems)
memmove (ITEMPTR (list, firstItemPosition - 1), ptrToItems,
(*list)->itemSize * numItemsToInsert);
else
memset (ITEMPTR (list, firstItemPosition - 1), 0,
(*list)->itemSize * numItemsToInsert);
(*list)->numItems += numItemsToInsert;
}
return 1;
}
Most strange thing is sometimes it runs very well.
My board is S3C44B0...
Any help is appreciated.
John
More information about the U-Boot
mailing list