/* sys_env_device_id_get DESCRIPTION: Returns enum (0..7) index of the device model (ID)  */
u32 sys_env_device_id_get(void)
/* sys_env_device_id_get DESCRIPTION: Returns enum (0..7) index of the device model (ID)  */
u32 sys_env_device_id_get(void)
{
	char *device_id_str[7] = {
		"6810", "6820", "6811", "6828", "NONE", "6920", "6928"
	};
	if (g_dev_id != -1)
		return g_dev_id;
	g_dev_id = reg_read(DEVICE_SAMPLE_AT_RESET1_REG);
	g_dev_id = g_dev_id >> SAR_DEV_ID_OFFS & SAR_DEV_ID_MASK;
	printf("Detected Device ID %s\n", device_id_str[g_dev_id]);
	return g_dev_id;
}