summaryrefslogtreecommitdiff
path: root/rbutil/mkimxboot/dualboot
diff options
context:
space:
mode:
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 -
10# 1) add x to the list in TARGETS 10# 1) add x to the list in TARGETS
11# 2) create a variable named OPT_x of the form: 11# 2) create a variable named OPT_x of the form:
12# OPT_x=target specific defines 12# OPT_x=target specific defines
13TARGETS=fuzeplus zenxfi2 zenxfi3 nwze370 nwze360 13TARGETS=fuzeplus zenxfi2 zenxfi3 nwze370 nwze360 zenxfistyle
14OPT_fuzeplus=-DSANSA_FUZEPLUS -DIMX233_SUBTARGET=3780 14OPT_fuzeplus=-DSANSA_FUZEPLUS -DIMX233_SUBTARGET=3780
15OPT_zenxfi2=-DCREATIVE_ZENXFI2 -DIMX233_SUBTARGET=3780 15OPT_zenxfi2=-DCREATIVE_ZENXFI2 -DIMX233_SUBTARGET=3780
16OPT_zenxfi3=-DCREATIVE_ZENXFI3 -DIMX233_SUBTARGET=3780 16OPT_zenxfi3=-DCREATIVE_ZENXFI3 -DIMX233_SUBTARGET=3780
17OPT_nwze370=-DSONY_NWZE370 -DIMX233_SUBTARGET=3780 17OPT_nwze370=-DSONY_NWZE370 -DIMX233_SUBTARGET=3780
18OPT_nwze360=-DSONY_NWZE360 -DIMX233_SUBTARGET=3780 18OPT_nwze360=-DSONY_NWZE360 -DIMX233_SUBTARGET=3780
19OPT_zenxfistyle=-DCREATIVE_ZENXFISTYLE -DIMX233_SUBTARGET=3780
19 20
20BOOTOBJS=$(patsubst %, dualboot_%.o, $(TARGETS)) 21BOOTOBJS=$(patsubst %, dualboot_%.o, $(TARGETS))
21BOOTBINS=$(patsubst %, dualboot_%.arm-bin, $(TARGETS)) 22BOOTBINS=$(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)
184 } 184 }
185 return decision; 185 return decision;
186} 186}
187#elif defined(CREATIVE_ZENXFISTYLE)
188static int boot_decision(int context)
189{
190 setup_lradc(2); // setup LRADC channel 2 to read keys
191 /* make a decision */
192 int val = read_lradc(2);
193 /* boot to OF if left is hold
194 * NOTE: VDDIO is set to 3.1V initially and the resistor ladder is wired to
195 * VDDIO so these values are not the same as in the main binary which is
196 * calibrated for VDDIO=3.3V */
197 if(val >= 815 && val < 915)
198 return BOOT_OF;
199 return BOOT_ROCK;
200}
187#else 201#else
188#warning You should define a target specific boot decision function 202#warning You should define a target specific boot decision function
189static int boot_decision(int context) 203static int boot_decision(int context)