/* Identify module we are running on, set gd->board_type to the index in hw_id_list corresponding to the module identifed, or to CM5200_UNKNOWN_MODULE if we can't identify the module.  */
static void identify_module(hw_id_t hw_id)
/* Identify module we are running on, set gd->board_type to the index in hw_id_list corresponding to the module identifed, or to CM5200_UNKNOWN_MODULE if we can't identify the module.  */
static void identify_module(hw_id_t hw_id)
{
	int i, j, element;
	char match;
	gd->board_type = CM5200_UNKNOWN_MODULE;
	for (i = 0; i < sizeof (hw_id_list) / sizeof (char **); ++i) {
		match = 1;
		for (j = 0; j < sizeof (hw_id_identify) / sizeof (int); ++j) {
			element = hw_id_identify[j];
			if (strncmp(hw_id_list[i][element],
					&hw_id[element][0],
					hw_id_format[element].length) != 0) {
				match = 0;
				break;
			}
		}
		if (match) {
			gd->board_type = i;
			break;
		}
	}
}