gd->bd->bi_arch_number = MACH_TYPE_UNIVERSAL_C210;
gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
- check_hw_revision();
- printf("HW Revision:\t0x%x\n", board_rev);
-
#if defined(CONFIG_PMIC)
pmic_init();
#endif
+ check_hw_revision();
+ printf("HW Revision:\t0x%x\n", board_rev);
+
return 0;
}
return ret;
}
+static int adc_power_control(int on)
+{
+ int ret;
+ struct pmic *p = get_pmic();
+
+ if (pmic_probe(p))
+ return -1;
+
+ ret = pmic_set_output(p,
+ MAX8998_REG_ONOFF1,
+ MAX8998_LDO4, !!on);
+
+ return ret;
+}
+
static unsigned int get_hw_revision(void)
{
int hwrev, mode0, mode1;
+ adc_power_control(1);
+
mode0 = get_adc_value(1); /* HWREV_MODE0 */
mode1 = get_adc_value(2); /* HWREV_MODE1 */
debug("mode0: %d, mode1: %d, hwrev 0x%x\n", mode0, mode1, hwrev);
+ adc_power_control(0);
+
return hwrev;
}
};
#define MAX8998_LDO3 (1 << 2)
+#define MAX8998_LDO4 (1 << 1)
#define MAX8998_LDO8 (1 << 5)
#define MAX8998_SAFEOUT1 (1 << 4)