summaryrefslogtreecommitdiffstats
path: root/rbutil/mkimxboot/dualboot
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2014-01-05 15:20:41 +0100
committerAmaury Pouly <amaury.pouly@gmail.com>2014-01-21 18:52:28 +0100
commit69d0dae55bf3da2f356dbd03dba299c708133902 (patch)
treeff60084c40831c6f8f7b8806d54fe570c2d8955b /rbutil/mkimxboot/dualboot
parentb3abcb807b7f6202158a47668af7f2505b6dd25e (diff)
downloadrockbox-69d0dae55bf3da2f356dbd03dba299c708133902.tar.gz
rockbox-69d0dae55bf3da2f356dbd03dba299c708133902.zip
Initial commit for the ZEN X-Fi Style
Change-Id: Ib25a357a7bafd2ef25f273cadff70fafbd8d4661
Diffstat (limited to 'rbutil/mkimxboot/dualboot')
-rw-r--r--rbutil/mkimxboot/dualboot/Makefile3
-rw-r--r--rbutil/mkimxboot/dualboot/dualboot.c14
2 files changed, 16 insertions, 1 deletions
diff --git a/rbutil/mkimxboot/dualboot/Makefile b/rbutil/mkimxboot/dualboot/Makefile
index 500263c4bf..28e9643a3a 100644
--- a/rbutil/mkimxboot/dualboot/Makefile
+++ b/rbutil/mkimxboot/dualboot/Makefile
@@ -10,12 +10,13 @@ CFLAGS=-mcpu=arm926ej-s -std=gnu99 -I. -I$(REGS_PATH) -nostdlib -ffreestanding -
# 1) add x to the list in TARGETS
# 2) create a variable named OPT_x of the form:
# OPT_x=target specific defines
-TARGETS=fuzeplus zenxfi2 zenxfi3 nwze370 nwze360
+TARGETS=fuzeplus zenxfi2 zenxfi3 nwze370 nwze360 zenxfistyle
OPT_fuzeplus=-DSANSA_FUZEPLUS -DIMX233_SUBTARGET=3780
OPT_zenxfi2=-DCREATIVE_ZENXFI2 -DIMX233_SUBTARGET=3780
OPT_zenxfi3=-DCREATIVE_ZENXFI3 -DIMX233_SUBTARGET=3780
OPT_nwze370=-DSONY_NWZE370 -DIMX233_SUBTARGET=3780
OPT_nwze360=-DSONY_NWZE360 -DIMX233_SUBTARGET=3780
+OPT_zenxfistyle=-DCREATIVE_ZENXFISTYLE -DIMX233_SUBTARGET=3780
BOOTOBJS=$(patsubst %, dualboot_%.o, $(TARGETS))
BOOTBINS=$(patsubst %, dualboot_%.arm-bin, $(TARGETS))
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)