summaryrefslogtreecommitdiffstats
path: root/rbutil/mkimxboot
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2013-09-25 14:30:35 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2013-09-25 14:31:39 +0200
commit6ac481e8bcb72066594e64ec70edd2b869c254eb (patch)
tree0c7725c5a655355aaf0b2f0890092bd6fc7976a3 /rbutil/mkimxboot
parent9392d036c4ee29c251dd1e89cf8ced653972b6fd (diff)
downloadrockbox-6ac481e8bcb72066594e64ec70edd2b869c254eb.tar.gz
rockbox-6ac481e8bcb72066594e64ec70edd2b869c254eb.tar.bz2
rockbox-6ac481e8bcb72066594e64ec70edd2b869c254eb.zip
Add support for the sony NWZ-E360/E370 to mkimxboot
Change-Id: Ied73591326339d22b4f21d311da9e6b1b9c223ed
Diffstat (limited to 'rbutil/mkimxboot')
-rw-r--r--rbutil/mkimxboot/dualboot.c12
-rw-r--r--rbutil/mkimxboot/dualboot.h2
-rw-r--r--rbutil/mkimxboot/dualboot/Makefile4
-rw-r--r--rbutil/mkimxboot/dualboot/dualboot.c7
-rw-r--r--rbutil/mkimxboot/mkimxboot.c21
-rw-r--r--rbutil/mkimxboot/mkimxboot.h10
6 files changed, 51 insertions, 5 deletions
diff --git a/rbutil/mkimxboot/dualboot.c b/rbutil/mkimxboot/dualboot.c
index 6f8f5c423d..8b5ca5b2b6 100644
--- a/rbutil/mkimxboot/dualboot.c
+++ b/rbutil/mkimxboot/dualboot.c
@@ -33,3 +33,15 @@ unsigned char dualboot_zenxfi3[56] = {
0x00, 0x00, 0xa0, 0x03, 0x00, 0x00, 0x81, 0x15, 0x01, 0x00, 0xa0, 0x13, 0x1e, 0xff, 0x2f, 0xe1,
0x00, 0x40, 0x04, 0x80, 0x00, 0x80, 0x01, 0x80
};
+unsigned char dualboot_nwze370[52] = {
+ 0x10, 0x40, 0x2d, 0xe9, 0x00, 0x00, 0x00, 0xeb, 0x10, 0x80, 0xbd, 0xe8, 0x1c, 0x30, 0x9f, 0xe5,
+ 0xc0, 0x20, 0x93, 0xe5, 0xc0, 0x30, 0x93, 0xe5, 0x03, 0x36, 0x03, 0xe2, 0x01, 0x06, 0x53, 0xe3,
+ 0x00, 0x00, 0xa0, 0x03, 0x00, 0x00, 0x81, 0x15, 0x01, 0x00, 0xa0, 0x13, 0x1e, 0xff, 0x2f, 0xe1,
+ 0x00, 0x40, 0x04, 0x80
+};
+unsigned char dualboot_nwze360[52] = {
+ 0x10, 0x40, 0x2d, 0xe9, 0x00, 0x00, 0x00, 0xeb, 0x10, 0x80, 0xbd, 0xe8, 0x1c, 0x30, 0x9f, 0xe5,
+ 0xc0, 0x20, 0x93, 0xe5, 0xc0, 0x30, 0x93, 0xe5, 0x03, 0x36, 0x03, 0xe2, 0x01, 0x06, 0x53, 0xe3,
+ 0x00, 0x00, 0xa0, 0x03, 0x00, 0x00, 0x81, 0x15, 0x01, 0x00, 0xa0, 0x13, 0x1e, 0xff, 0x2f, 0xe1,
+ 0x00, 0x40, 0x04, 0x80
+};
diff --git a/rbutil/mkimxboot/dualboot.h b/rbutil/mkimxboot/dualboot.h
index 8ebde559f5..9bf271299a 100644
--- a/rbutil/mkimxboot/dualboot.h
+++ b/rbutil/mkimxboot/dualboot.h
@@ -3,3 +3,5 @@
extern unsigned char dualboot_fuzeplus[228];
extern unsigned char dualboot_zenxfi2[96];
extern unsigned char dualboot_zenxfi3[56];
+extern unsigned char dualboot_nwze370[52];
+extern unsigned char dualboot_nwze360[52];
diff --git a/rbutil/mkimxboot/dualboot/Makefile b/rbutil/mkimxboot/dualboot/Makefile
index 4bad3a4a12..b799636405 100644
--- a/rbutil/mkimxboot/dualboot/Makefile
+++ b/rbutil/mkimxboot/dualboot/Makefile
@@ -10,10 +10,12 @@ 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
+TARGETS=fuzeplus zenxfi2 zenxfi3 nwze370 nwze360
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
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 301eca87ad..f75673efbe 100644
--- a/rbutil/mkimxboot/dualboot/dualboot.c
+++ b/rbutil/mkimxboot/dualboot/dualboot.c
@@ -119,6 +119,13 @@ static int boot_decision(int context)
/* if volume down is hold, boot to OF */
return !read_gpio(2, 7) ? BOOT_OF : BOOT_ROCK;
}
+#elif defined(SONY_NWZE360) || defined(SONY_NWZE370)
+static int boot_decision(int context)
+{
+ /* Power button set PSWITCH to 3, all other buttons to 1. So any
+ * button press will boot OF */
+ return read_pswitch() == 1 ? BOOT_OF : 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 12b029ec9d..efa8907df4 100644
--- a/rbutil/mkimxboot/mkimxboot.c
+++ b/rbutil/mkimxboot/mkimxboot.c
@@ -160,6 +160,18 @@ static const struct imx_md5sum_t imx_sums[] =
[VARIANT_ZENSTYLE_RECOVERY] = {610272, 148576},
}
},
+ /** Sony NWZ-E370 */
+ {
+ /* Version 1.00.00 */
+ MODEL_NWZE370, "a615fdb70b3e1bfb0355a5bc2bf237ab", "1.00.00",
+ { [VARIANT_DEFAULT] = {0, 16056320 } }
+ },
+ /** Sony NWZ-E360 */
+ {
+ /* Version 1.00.00 */
+ MODEL_NWZE360, "d0047f8a87d456a0032297b3c802a1ff", "1.00.00",
+ { [VARIANT_DEFAULT] = {0, 20652032 } }
+ }
};
static struct crypto_key_t zero_key =
@@ -180,6 +192,10 @@ static const struct imx_model_desc_t imx_models[] =
1, &zero_key, 0, 0x40000000 },
[MODEL_ZENSTYLE] = {"Zen Style 100/300", NULL, 0, "", -1,
1, &zero_key, 0, 0x40000000 },
+ [MODEL_NWZE370] = {"NWZ-E370", dualboot_nwze370, sizeof(dualboot_nwze370), "e370", 88,
+ 1, &zero_key, 0, 0x40000000 },
+ [MODEL_NWZE360] = {"NWZ-E360", dualboot_nwze360, sizeof(dualboot_nwze360), "e360", 89,
+ 1, &zero_key, 0, 0x40000000 },
};
#define NR_IMX_SUMS (sizeof(imx_sums) / sizeof(imx_sums[0]))
@@ -384,6 +400,11 @@ static enum imx_error_t patch_firmware(enum imx_model_t model,
/* The ZEN X-Fi3 uses the standard ____, hSst, pSay sections, patch after third
* call in ____ section. Although sections names use the S variant, they are standard. */
return patch_std_zero_host_play(3, model, type, sb_file, boot_fw);
+ case MODEL_NWZE360:
+ case MODEL_NWZE370:
+ /* The NWZ-E360/E370 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);
case MODEL_ZENXFI2:
/* The ZEN X-Fi2 has two types of firmware: recovery and normal.
* Normal uses the standard ___, host, play sections and recovery only ____ */
diff --git a/rbutil/mkimxboot/mkimxboot.h b/rbutil/mkimxboot/mkimxboot.h
index 4440f200ec..87d4f09c97 100644
--- a/rbutil/mkimxboot/mkimxboot.h
+++ b/rbutil/mkimxboot/mkimxboot.h
@@ -57,10 +57,12 @@ enum imx_model_t
{
MODEL_UNKNOWN = -1,
MODEL_FUZEPLUS = 0,
- MODEL_ZENXFI2 = 1,
- MODEL_ZENXFI3 = 2,
- MODEL_ZENXFISTYLE = 3,
- MODEL_ZENSTYLE = 4, /* Style 100 and Style 300 */
+ MODEL_ZENXFI2,
+ MODEL_ZENXFI3,
+ MODEL_ZENXFISTYLE,
+ MODEL_ZENSTYLE, /* Style 100 and Style 300 */
+ MODEL_NWZE370,
+ MODEL_NWZE360,
/* new models go here */
NUM_MODELS