diff options
author | Amaury Pouly <amaury.pouly@gmail.com> | 2014-01-05 15:20:41 +0100 |
---|---|---|
committer | Amaury Pouly <amaury.pouly@gmail.com> | 2014-01-21 18:52:28 +0100 |
commit | 69d0dae55bf3da2f356dbd03dba299c708133902 (patch) | |
tree | ff60084c40831c6f8f7b8806d54fe570c2d8955b /rbutil/mkimxboot/dualboot | |
parent | b3abcb807b7f6202158a47668af7f2505b6dd25e (diff) | |
download | rockbox-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/Makefile | 3 | ||||
-rw-r--r-- | rbutil/mkimxboot/dualboot/dualboot.c | 14 |
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 |
13 | TARGETS=fuzeplus zenxfi2 zenxfi3 nwze370 nwze360 | 13 | TARGETS=fuzeplus zenxfi2 zenxfi3 nwze370 nwze360 zenxfistyle |
14 | OPT_fuzeplus=-DSANSA_FUZEPLUS -DIMX233_SUBTARGET=3780 | 14 | OPT_fuzeplus=-DSANSA_FUZEPLUS -DIMX233_SUBTARGET=3780 |
15 | OPT_zenxfi2=-DCREATIVE_ZENXFI2 -DIMX233_SUBTARGET=3780 | 15 | OPT_zenxfi2=-DCREATIVE_ZENXFI2 -DIMX233_SUBTARGET=3780 |
16 | OPT_zenxfi3=-DCREATIVE_ZENXFI3 -DIMX233_SUBTARGET=3780 | 16 | OPT_zenxfi3=-DCREATIVE_ZENXFI3 -DIMX233_SUBTARGET=3780 |
17 | OPT_nwze370=-DSONY_NWZE370 -DIMX233_SUBTARGET=3780 | 17 | OPT_nwze370=-DSONY_NWZE370 -DIMX233_SUBTARGET=3780 |
18 | OPT_nwze360=-DSONY_NWZE360 -DIMX233_SUBTARGET=3780 | 18 | OPT_nwze360=-DSONY_NWZE360 -DIMX233_SUBTARGET=3780 |
19 | OPT_zenxfistyle=-DCREATIVE_ZENXFISTYLE -DIMX233_SUBTARGET=3780 | ||
19 | 20 | ||
20 | BOOTOBJS=$(patsubst %, dualboot_%.o, $(TARGETS)) | 21 | BOOTOBJS=$(patsubst %, dualboot_%.o, $(TARGETS)) |
21 | BOOTBINS=$(patsubst %, dualboot_%.arm-bin, $(TARGETS)) | 22 | 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) | |||
184 | } | 184 | } |
185 | return decision; | 185 | return decision; |
186 | } | 186 | } |
187 | #elif defined(CREATIVE_ZENXFISTYLE) | ||
188 | static 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 |
189 | static int boot_decision(int context) | 203 | static int boot_decision(int context) |