From 69d0dae55bf3da2f356dbd03dba299c708133902 Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Sun, 5 Jan 2014 15:20:41 +0100 Subject: Initial commit for the ZEN X-Fi Style Change-Id: Ib25a357a7bafd2ef25f273cadff70fafbd8d4661 --- rbutil/mkimxboot/dualboot/dualboot.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'rbutil/mkimxboot/dualboot/dualboot.c') diff --git a/rbutil/mkimxboot/dualboot/dualboot.c b/rbutil/mkimxboot/dualboot/dualboot.c index 3cca59bb8a..e841b12d74 100644 --- a/rbutil/mkimxboot/dualboot/dualboot.c +++ b/rbutil/mkimxboot/dualboot/dualboot.c @@ -184,6 +184,20 @@ static int boot_decision(int context) } return decision; } +#elif defined(CREATIVE_ZENXFISTYLE) +static int boot_decision(int context) +{ + setup_lradc(2); // setup LRADC channel 2 to read keys + /* make a decision */ + int val = read_lradc(2); + /* boot to OF if left is hold + * NOTE: VDDIO is set to 3.1V initially and the resistor ladder is wired to + * VDDIO so these values are not the same as in the main binary which is + * calibrated for VDDIO=3.3V */ + if(val >= 815 && val < 915) + return BOOT_OF; + return BOOT_ROCK; +} #else #warning You should define a target specific boot decision function static int boot_decision(int context) -- cgit v1.2.3