diff target-utils/compalstage/compalstage.S @ 11:21eec7569eb8

loadtools support for C139/140 target: -c 1004 compalstage variant supercedes the previous -c 1003 version and supports the new C139 boot code version found in the wild that expects "1004" or greater in the signature bytes
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 25 Jul 2016 21:09:33 +0000
parents e7502631a0f9
children
line wrap: on
line diff
--- a/target-utils/compalstage/compalstage.S	Mon Jul 25 20:15:41 2016 +0000
+++ b/target-utils/compalstage/compalstage.S	Mon Jul 25 21:09:33 2016 +0000
@@ -22,6 +22,25 @@
 	.word	0xFFFFFB10
 
 #if PAD_TO_1003
+/*
+ * The older and most familiar versions of C139/140 boot code expect the
+ * signature bytes to be "1003" or greater, but a recently encountered
+ * newer version expects them to be "1004" or greater instead.  As the
+ * actual comparison check in all currently known boot code versions is
+ * an inequality (the signature bytes in the downloaded image need to be
+ * greater than or equal to the hard-coded reference values), always
+ * putting "1004" in our compalstage image instead of "1003" should satisfy
+ * all existing C1xx boot code versions, or at least all currently known
+ * ones.  However, having an image named compalstage-1003.bin with the
+ * corresponding -c 1003 loadtools option that is actually "1004" inside
+ * feels a little "wrong" in some sense, while getting rid of the -c 1003
+ * option would break old user instructions, hence let's go ahead and do the
+ * silly exercise of building both "1003" and "1004" versions.
+ */
 	.org	0x3be0
+#if MAGIC_1004
+	.ascii	"1004"
+#else
 	.ascii	"1003"
 #endif
+#endif