summaryrefslogtreecommitdiffstats
path: root/rbutil/mkimxboot/dualboot
diff options
context:
space:
mode:
Diffstat (limited to 'rbutil/mkimxboot/dualboot')
-rw-r--r--rbutil/mkimxboot/dualboot/Makefile10
-rw-r--r--rbutil/mkimxboot/dualboot/dualboot.S20
2 files changed, 28 insertions, 2 deletions
diff --git a/rbutil/mkimxboot/dualboot/Makefile b/rbutil/mkimxboot/dualboot/Makefile
index fa5f341b6d..6386b7c622 100644
--- a/rbutil/mkimxboot/dualboot/Makefile
+++ b/rbutil/mkimxboot/dualboot/Makefile
@@ -4,8 +4,8 @@ CROSS_PREFIX=arm-elf-eabi
# adding a new target. mkimxboot.c also needs to be edited to refer to these
# new images.
-BOOTOBJS = dualboot_fuzeplus.o
-BOOTBINS = dualboot_fuzeplus.arm-bin
+BOOTOBJS = dualboot_fuzeplus.o dualboot_zenxfi2.o dualboot_zenxfi3.o
+BOOTBINS = dualboot_fuzeplus.arm-bin dualboot_zenxfi2.arm-bin dualboot_zenxfi3.arm-bin
all: ../dualboot.h ../dualboot.c
@@ -14,6 +14,12 @@ all: ../dualboot.h ../dualboot.c
dualboot_fuzeplus.o: dualboot.S
$(CROSS_PREFIX)-$(CC) -mcpu=arm926ej-s -DSANSA_FUZEPLUS -c -o dualboot_fuzeplus.o dualboot.S
+dualboot_zenxfi2.o: dualboot.S
+ $(CROSS_PREFIX)-$(CC) -mcpu=arm926ej-s -DCREATIVE_ZENXFI2 -c -o dualboot_zenxfi2.o dualboot.S
+
+dualboot_zenxfi3.o: dualboot.S
+ $(CROSS_PREFIX)-$(CC) -mcpu=arm926ej-s -DCREATIVE_ZENXFI3 -c -o dualboot_zenxfi3.o dualboot.S
+
# Rules for the ARM code embedded in mkamsboot - assemble, link, then extract
# the binary code and finally convert to .h for building in mkamsboot
diff --git a/rbutil/mkimxboot/dualboot/dualboot.S b/rbutil/mkimxboot/dualboot/dualboot.S
index 4002167929..ed91012199 100644
--- a/rbutil/mkimxboot/dualboot/dualboot.S
+++ b/rbutil/mkimxboot/dualboot/dualboot.S
@@ -65,6 +65,26 @@ power_down:
ldr r1, =0x3E770001 @ unlock key + power down
str r1, [r0]
b power_down
+#elif defined(CREATIVE_ZENXFI2)
+ /* If select key is hold, return so that the OF can boot */
+ ldr r2, =0x80018600 @ HW_PINCTRL_DIN0
+ ldr r2, [r2]
+ tst r2, #0x4000 @ bit 14, active low
+ moveq r0, #0 @ return 0, continue boot
+ bxeq lr
+ str r0, [r1]
+ mov r0, #1
+ bx lr
+#elif defined(CREATIVE_ZENXFI3)
+ /* If volume down key is hold, return so that the OF can boot */
+ ldr r2, =0x80018620 @ HW_PINCTRL_DIN2
+ ldr r2, [r2]
+ tst r2, #0x80 @ bit 7, active low
+ moveq r0, #0 @ return 0, continue boot
+ bxeq lr
+ str r0, [r1]
+ mov r0, #1
+ bx lr
#else
#error No target defined !
#endif