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.c | 11 +++++++++++ rbutil/mkimxboot/dualboot.h | 1 + rbutil/mkimxboot/dualboot/Makefile | 3 ++- rbutil/mkimxboot/dualboot/dualboot.c | 14 ++++++++++++++ rbutil/mkimxboot/mkimxboot.c | 6 +++++- 5 files changed, 33 insertions(+), 2 deletions(-) (limited to 'rbutil/mkimxboot') diff --git a/rbutil/mkimxboot/dualboot.c b/rbutil/mkimxboot/dualboot.c index e2bbdae8a9..b991fe3f6e 100644 --- a/rbutil/mkimxboot/dualboot.c +++ b/rbutil/mkimxboot/dualboot.c @@ -89,3 +89,14 @@ unsigned char dualboot_nwze360[416] = { 0x3d, 0x59, 0x85, 0xe2, 0x09, 0x5d, 0x85, 0xe2, 0x03, 0x80, 0xa0, 0xe1, 0xda, 0xff, 0xff, 0xea, 0x00, 0x40, 0x04, 0x80, 0x00, 0x00, 0x05, 0x80, 0x01, 0x00, 0xff, 0xff, 0x00, 0xc0, 0x01, 0x80 }; +unsigned char dualboot_zenxfistyle[136] = { + 0x10, 0x40, 0x2d, 0xe9, 0x00, 0x00, 0x00, 0xeb, 0x10, 0x80, 0xbd, 0xe8, 0x6c, 0x30, 0x9f, 0xe5, + 0xc0, 0x30, 0x93, 0xe5, 0x68, 0x30, 0x9f, 0xe5, 0x02, 0x21, 0xa0, 0xe3, 0x08, 0x20, 0x83, 0xe5, + 0x03, 0x21, 0x82, 0xe2, 0x08, 0x20, 0x83, 0xe5, 0xff, 0x24, 0x82, 0xe2, 0x78, 0x20, 0x83, 0xe5, + 0xc5, 0x24, 0x82, 0xe2, 0x24, 0x20, 0x83, 0xe5, 0x04, 0x20, 0xa0, 0xe3, 0x18, 0x20, 0x83, 0xe5, + 0x04, 0x20, 0x83, 0xe5, 0x03, 0x20, 0xa0, 0xe1, 0x10, 0x30, 0x92, 0xe5, 0x04, 0x00, 0x13, 0xe3, + 0xfc, 0xff, 0xff, 0x0a, 0x28, 0x30, 0x9f, 0xe5, 0x70, 0x30, 0x93, 0xe5, 0xff, 0x34, 0xc3, 0xe3, + 0x3f, 0x37, 0xc3, 0xe3, 0xcb, 0x3f, 0x43, 0xe2, 0x03, 0x30, 0x43, 0xe2, 0x63, 0x00, 0x53, 0xe3, + 0x00, 0x00, 0xa0, 0x93, 0x00, 0x00, 0x81, 0x85, 0x01, 0x00, 0xa0, 0x83, 0x1e, 0xff, 0x2f, 0xe1, + 0x00, 0x40, 0x04, 0x80, 0x00, 0x00, 0x05, 0x80 +}; diff --git a/rbutil/mkimxboot/dualboot.h b/rbutil/mkimxboot/dualboot.h index 17ee1979fb..65793811c7 100644 --- a/rbutil/mkimxboot/dualboot.h +++ b/rbutil/mkimxboot/dualboot.h @@ -5,3 +5,4 @@ extern unsigned char dualboot_zenxfi2[96]; extern unsigned char dualboot_zenxfi3[56]; extern unsigned char dualboot_nwze370[416]; extern unsigned char dualboot_nwze360[416]; +extern unsigned char dualboot_zenxfistyle[136]; 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) diff --git a/rbutil/mkimxboot/mkimxboot.c b/rbutil/mkimxboot/mkimxboot.c index 1761fc9cb2..3897216e16 100644 --- a/rbutil/mkimxboot/mkimxboot.c +++ b/rbutil/mkimxboot/mkimxboot.c @@ -199,7 +199,7 @@ static const struct imx_model_desc_t imx_models[] = 1, &zero_key, 0, 0x40000000 }, [MODEL_ZENXFI3] = {"Zen X-Fi3", dualboot_zenxfi3, sizeof(dualboot_zenxfi3), "zxf3", 83, 1, &zero_key, 0, 0x40000000 }, - [MODEL_ZENXFISTYLE] = {"Zen X-Fi Style", NULL, 0, "", -1, + [MODEL_ZENXFISTYLE] = {"Zen X-Fi Style", dualboot_zenxfistyle, sizeof(dualboot_zenxfistyle), "zxfs", 94, 1, &zero_key, 0, 0x40000000 }, [MODEL_ZENSTYLE] = {"Zen Style 100/300", NULL, 0, "", -1, 1, &zero_key, 0, 0x40000000 }, @@ -429,6 +429,10 @@ static enum imx_error_t patch_firmware(enum imx_model_t model, return IMX_DONT_KNOW_HOW_TO_PATCH; } break; + case MODEL_ZENXFISTYLE: + /* The ZEN X-Fi Style uses the standard ____, host, play sections, patch after first + * call in ____ section. */ + return patch_std_zero_host_play(1, model, type, sb_file, boot_fw); default: return IMX_DONT_KNOW_HOW_TO_PATCH; } -- cgit v1.2.3