summaryrefslogtreecommitdiffstats
path: root/vortex86ex/array.php
diff options
context:
space:
mode:
Diffstat (limited to 'vortex86ex/array.php')
-rw-r--r--vortex86ex/array.php594
1 files changed, 594 insertions, 0 deletions
diff --git a/vortex86ex/array.php b/vortex86ex/array.php
new file mode 100644
index 0000000..90bf210
--- /dev/null
+++ b/vortex86ex/array.php
@@ -0,0 +1,594 @@
+<?php
+/*
+# Copyright (C) 2014 Francis Rowe <info@gluglug.org.uk>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+# The data from the $blob variable (see below) is taken
+# from src/cpu/dmp/vortex86ex/dmp_kbd_fw_part1.inc in coreboot* and
+# has different copyright terms. Check inside that file for details.
+# *http://coreboot.org/
+*/
+
+// steps below based on:
+// https://en.wikipedia.org/wiki/Intel_HEX#Format
+// Trying to disassemble http://libreboot.org/dmp_kbd_fw_part1.inc.txt
+// which is from coreboot (src/cpu/dmp/vortex86ex/dmp_kbd_fw_part1.inc).
+// The dissassemblers need intel hex format, so this script provides that.
+// 8051 disassembler used: dis51
+// 8052 disassembler used: d52
+// see results on http://libreboot.org/vortex86ex/
+
+$blob = array(
+"0204a3020afbef75",
+"f003a4ffae071fee",
+"70fa22020ad51209",
+"5e7f301205fb90e0",
+"007416f0120ddac2",
+"92c293c290d291d2",
+"b8d2bad288d2a8d2",
+"8ad2aa7d44e4ff12",
+"0e3a7d4d0f120e3a",
+"7d260f120e3a7d50",
+"0f120e3a120e59d2",
+"af7fb1120ef5900f",
+"fee493ffb4550aa3",
+"e493b4aa04d20880",
+"10efb4120c900fff",
+"e493b43404c208c2",
+"1212036c120da612",
+"010830012730121f",
+"20001c301119120d",
+"251209c4300805c2",
+"1a120a26120d92d2",
+"00120d3b1207c212",
+"0ddac20112036c12",
+"072e3012c43000c1",
+"90d000e030e0bac2",
+"af120e07500e120e",
+"b6120ebcd21a120a",
+"26120d3bd2af80a1",
+"ae03ab05531aef90",
+"d000e51af0ad078e",
+"337f20120d51431a",
+"1090d000e51af022",
+"da7e100914120da6",
+"90e000e0ff20e103",
+"0202c8c2a8c2aa20",
+"0403300705d2a8d2",
+"aa22efa2e3921c90",
+"f000e0f52c120e2f",
+"d2a8d2aa301c0302",
+"01eec21dc21e2017",
+"030201d4e51824e1",
+"603b245470030201",
+"d024fa601414601e",
+"14601f1460232474",
+"706caf2c1205fb80",
+"67e52c30e104d290",
+"805ec290805ac21f",
+"8002d21f852c2f80",
+"46d21e804be52c70",
+"1a120ced1208f285",
+"3812853913853a14",
+"850915850a16850b",
+"17802de52cc39401",
+"4013e52cd3940650",
+"0cc21f7411252cf8",
+"e6f52f800ae52cb4",
+"070ec21f853b2fd2",
+"20120db88002d21d",
+"c2178002d21d301d",
+"07af2c12052f8008",
+"301e05af2c120597",
+"120e850202c2c21d",
+"e52c120b2102b71f",
+"02352002b7600256",
+"a7025da80264a902",
+"48aa0264ab026dad",
+"0274ae0241c002b7",
+"cb027bd002b7d102",
+"b7d202b7d302b7d4",
+"0298dd028ddf02a8",
+"fe000002b5120a83",
+"8f2dc21f852d2f80",
+"28c21f752fff8021",
+"7f301205fbc21f75",
+"2f55c220804b120e",
+"8dd21d805a120ee6",
+"d21d8053c21fe4f5",
+"2fd2208034120e94",
+"d21d8043120ef0d2",
+"1d803c752e013090",
+"03432e02c21f852e",
+"2fd2208014d290c2",
+"1f850f2fd2208009",
+"c290c21f850f2fd2",
+"20120db8d21d800f",
+"c2917f05120006d2",
+"91d21d8002d21d30",
+"1d03120e85d21785",
+"2c18200103120dda",
+"22444d265000ff43",
+"413f3d3b3c586444",
+"42403e0f29596538",
+"2a701d10025a6671",
+"2c1f1e11035b672e",
+"2d201205045c6839",
+"2f211413065d6931",
+"30232215075e6a72",
+"32241608095f6b33",
+"2517180b0a606c34",
+"352627190c616d73",
+"28741a0d626e3a36",
+"1c1b752b63765556",
+"7778797a0e7b7c4f",
+"7d4b477e7f6f5253",
+"504c4d480145574e",
+"514a374946540000",
+"0041540001010201",
+"0202030102020302",
+"0303041423143a14",
+"4d423223200c0302",
+"0408c21ac21be510",
+"30e757e511ae1078",
+"06cec313ce13d8f9",
+"f526ff120dca8f27",
+"e510c413135403ff",
+"e5275401b50705e4",
+"7f0180027f00ef30",
+"e004d21b80242013",
+"1faf26120779af26",
+"1209f68e288f29e5",
+"29f47003e528f460",
+"09852926d21a8002",
+"d21a301a1bc2277f",
+"07120b6cc2277f06",
+"120b6ca213922585",
+"26311208bbc20c22",
+"301b10a213922175",
+"30ffd222c223d224",
+"0206eec20c120e7d",
+"22e4f526f5277528",
+"0f7529ffe5272529",
+"ffe5263528c313f5",
+"2aef13f52bffae2a",
+"120e15bfff0ee52b",
+"24fff529e52a34ff",
+"f5288047ef700de5",
+"2b2401f527e4352a",
+"f5268037752cffe4",
+"f52de52cc313f52c",
+"b5071ce52bae2a78",
+"03c333ce33ced8f9",
+"7c00252dffec3ecf",
+"2401cf3400fe2205",
+"2de52db407d47eff",
+"7fff22d3e5279529",
+"e5286480f8e52664",
+"80984080e527ae26",
+"7803c333ce33ced8",
+"f9ff22787fe4f6d8",
+"fd75813b0204ea02",
+"0016e493a3f8e493",
+"a34003f68001f208",
+"dff48029e493a3f8",
+"5407240cc8c333c4",
+"540f4420c8834004",
+"f456800146f6dfe4",
+"800b010204081020",
+"4080900880e47e01",
+"9360bca3ff543f30",
+"e509541ffee493a3",
+"60010ecf54c025e0",
+"60a840b8e493a3fa",
+"e493a3f8e493a3c8",
+"c582c8cac583caf0",
+"a3c8c582c8cac583",
+"cadfe9dee780bed2",
+"0dc296d20ed210c2",
+"948f08120dcaef13",
+"b39214d216e4f50c",
+"7f28120006c297d2",
+"03c20a7fe87efd12",
+"0c79c20dd2963016",
+"16120e6250f8c2af",
+"d297c2211206e5c2",
+"16e4f50cd2af227f",
+"e87efd120c792004",
+"12200a0f120e6250",
+"f5c2afc2211206e5",
+"d2af2212072e22d2",
+"10c294d20ad20dc2",
+"968f08120dcaef13",
+"b39214d216e4f50e",
+"7f28120006c295d2",
+"05c20e7fe87efd12",
+"0c79c210d2943016",
+"14120e6250f8c2af",
+"d2951206e3c216e4",
+"f50ed2af227fe87e",
+"fd120c7920071020",
+"0e0d120e6250f5c2",
+"af1206e3d2af2212",
+"072e22ad07ed30e6",
+"04d20f8002c20fed",
+"30e505120e8d8003",
+"120ee6ed30e40512",
+"0e948003120ef0ed",
+"30e204d2278002c2",
+"277f02120b6ced30",
+"e105120f14800312",
+"0f11ed30e00b120f",
+"1a201108d211d201",
+"22120f17227f0212",
+"0006209442a29592",
+"18050ee50eb40112",
+"20180ad207d20ad2",
+"0dc2968019e4f50e",
+"8014e50eb40b0fd2",
+"0ed210c294d213d2",
+"0ce4f50ec207e510",
+"c313f510e51113f5",
+"1130180343108022",
+"7f02120006209642",
+"a2979219050ce50c",
+"b4011220190ad204",
+"d20ed210c2948019",
+"e4f50c8014e50cb4",
+"0b0fd20ad20dc296",
+"c213d20ce4f50cc2",
+"04e510c313f510e5",
+"1113f51130190343",
+"108022d2217530fe",
+"d222d223c224d20a",
+"d20dc296d20ed210",
+"c294a22392277f06",
+"120b6ca22492277f",
+"07120b6c30220ca2",
+"2192258530311208",
+"bb8010a221922685",
+"3032120bf9c292c2",
+"93d209c20c222004",
+"033007447fe87efd",
+"120c792004033007",
+"37120e6250f5c2af",
+"2004033007263004",
+"04c21f8002d21fe4",
+"f50cc204f50ec207",
+"120eeb120e80d2af",
+"a21f92217530ff12",
+"06e880c7d2af80c3",
+"22e5196003b40209",
+"e50d900363936f60",
+"0be5196401702def",
+"64f070280519e519",
+"d394024024e4f519",
+"050de50d94094019",
+"752a05e4ff120c3b",
+"7f07120c3bd52af3",
+"e4f50d22e4f50df5",
+"1922e53b64157041",
+"120cede53a30e005",
+"7526808003e4f526",
+"e53ac313f53ae539",
+"30e003433a80e539",
+"c313f539e53830e0",
+"03433980c2b690d0",
+"01e4f0a3e526f0a3",
+"e53af0a3e539f0d2",
+"b622209437050ee5",
+"0ed394085012e508",
+"30e004d2958002c2",
+"95e508c313f50822",
+"e50eb40905a21492",
+"9522e50eb40a03d2",
+"9522e50eb40b05c2",
+"16e4f50e22209637",
+"050ce50cd3940850",
+"12e50830e004d297",
+"8002c297e508c313",
+"f50822e50cb40905",
+"a214929722e50cb4",
+"0a03d29722e50cb4",
+"0b05c216e4f50c22",
+"010c00c104c10ac1",
+"83c10cc109c102c1",
+"16c108010e00c107",
+"c10ec185c18bc186",
+"c18fc112c100c111",
+"c101c117010d0001",
+"1900011a00013403",
+"c12900a225922685",
+"3132120bf9c292c2",
+"9320250320060630",
+"251d300b1a7f697e",
+"00120c79120e6250",
+"fb120eb050092025",
+"04d2928002d293d2",
+"0922900ffce493fe",
+"740193ffc3953af5",
+"0bee9539f50a900f",
+"fbe493c39538f509",
+"c3ef953aee953950",
+"021509e50930e707",
+"e4f509f50af50b22",
+"0535af35ae07ee14",
+"131313541ffdee54",
+"07ff7006f526f527",
+"801574ff7e00a807",
+"088006cea2e713ce",
+"13d8f8f5278e26af",
+"05ad27020c5ae4ff",
+"7e01efc394085027",
+"ef601d64016019ef",
+"64036014ee440254",
+"fe90e000f054f4fd",
+"ee54f46d6002d322",
+"0fee25e0fe80d3c3",
+"22ad07ac06ed24ff",
+"ffec34fffeef7803",
+"cec313ce13d8f9ff",
+"ed5407fd7004f526",
+"800d74ffa8050880",
+"02c313d8fcf526ad",
+"26020aadc2282029",
+"0f120f0d8f3be53b",
+"b4150375341fd229",
+"120a568f35e53530",
+"e00c120d7d120928",
+"e4f536f537221204",
+"098e368f3722200f",
+"037e0022bff007d2",
+"157eff7fff22efc3",
+"948540037e0022ef",
+"9002ce93fe7002fe",
+"22301503430680c2",
+"15af067e0022a21a",
+"92280537e5377002",
+"0536c3e536948050",
+"07af37ae36020991",
+"e535c39410500e12",
+"0928120d7d120928",
+"e4f536f53722e4ff",
+"120e237effe4f526",
+"e526b408077f0112",
+"0e237effeeb50703",
+"af2622eec313fe05",
+"26e526d3941040e0",
+"7fff22e4ff300f02",
+"7f40200503430720",
+"20030343071090e0",
+"00e030e203430704",
+"300b034307023006",
+"03430701228e278f",
+"288d29120e74e527",
+"24d0f52ae528f52b",
+"120ea285292fab2b",
+"ad2aaf34120b4712",
+"0ea9020deac0e0c0",
+"f0c0d075d000c006",
+"c00720100b301605",
+"12080a800312064d",
+"d007d006d0d0d0f0",
+"d0e032c0e0c0f0c0",
+"d075d000c006c007",
+"200d0b3016051208",
+"458003120698d007",
+"d006d0d0d0f0d0e0",
+"32d083d082f8e493",
+"7012740193700da3",
+"a393f8740193f582",
+"8883e47374029368",
+"60efa3a3a380dfae",
+"03ab05531aef90d0",
+"00e51af0ad078e33",
+"7f02120d51af2f12",
+"0cd0431a1090d000",
+"e51af0227401a807",
+"088002c333d8fcff",
+"90e000e04402feef",
+"30270442068003f4",
+"520690e000eef022",
+"120e074005120105",
+"80f6120ec8120ed4",
+"c21f752feea20692",
+"20120db890d000e0",
+"30e1f922ae03ab05",
+"531aef90d000e51a",
+"f0ad078e337f0312",
+"0d51120bd7431a10",
+"90d000e51af022e5",
+"1a549ffd4420fe7c",
+"08ef25e0ff90d000",
+"edf0e030e4034307",
+"0190d000eef0dce9",
+"2290f000e532f0f5",
+"0fa22692277f0512",
+"0b6c90e000e04402",
+"54fefef04401f0ee",
+"f022531aef90d000",
+"e51af07f9f120cd0",
+"120bd7120bd7120b",
+"d7431a1090d000e5",
+"1af0228f2b7fed12",
+"052faf2b12052f75",
+"2c0a7fe87efd120c",
+"79120e6250fbd52c",
+"f1228f288d29120e",
+"74120ea2e52824fe",
+"fb85292f7defaf34",
+"120b47120ea9020d",
+"eaad07ac06c28ced",
+"f4ffecf4feef2401",
+"fde43ef58caf058f",
+"8ac28dd28c22ad07",
+"ac06c2caedf4ffec",
+"f4feef2401fde43e",
+"f5cdaf058fccc2cf",
+"d2ca22531aef90d0",
+"00e51af07f05120c",
+"d0120bd7431a1090",
+"d000e51af0ef1322",
+"e51a549ffe4440fd",
+"7c0890d000ef33ff",
+"5003ed8001eef044",
+"20f0dcf122120f04",
+"8e398f3a120f1d8f",
+"38e53830e1034339",
+"80e5381313543ff5",
+"3822531aef90d000",
+"e51af07f05120cd0",
+"120bd7431a1090d0",
+"00e51af022120ec8",
+"120ed490d000e020",
+"e10812036c120105",
+"80f122120ced1208",
+"f2e509700be50a70",
+"07e50b7003120eda",
+"228d318b32120cd0",
+"af31120cd0af3212",
+"0cd0af33020cd053",
+"1aef90d000e51af0",
+"120cd0431a1090d0",
+"00e51af022120e74",
+"120ea2e4fb7dd0af",
+"341200e0120ea902",
+"0dea531afb90d000",
+"e51af0531afde51a",
+"f07f3c0200063009",
+"0e120eb04009c292",
+"c293c209120e7d22",
+"a21f9221852f30a2",
+"209222c223c22402",
+"06eeefc4540f9003",
+"5393feef540f932e",
+"ff2290e000e04402",
+"54fefef054fdf0ee",
+"f022120ea2120cb3",
+"921b120ea9201bf2",
+"22300509200e0620",
+"0203d38001c32230",
+"0309200a06200203",
+"d38001c322aa06ea",
+"24d0fdeffbaf3412",
+"0bb422ef24fefb7d",
+"efaf34120bb422d2",
+"02d20dc296d210c2",
+"9422ef9002c9936d",
+"600280fe22120df9",
+"5004c210d2942212",
+"0e075004c20dd296",
+"22e58954f04401f5",
+"8922308d04c28cd3",
+"22c32230cf04c2ca",
+"d322c322120ea212",
+"0efa020ea9120eeb",
+"c20e020e45c20212",
+"0e4f020e45c205d2",
+"10c29422c203d20d",
+"c2962290d000e51a",
+"f022302803120b90",
+"22302803120d9222",
+"90e000e01322531a",
+"fe020e9b431a0102",
+"0e9b531afd020e9b",
+"431a02020e9b531a",
+"fb020e9b431a0402",
+"0e9b531a7f020e9b",
+"431a80020e9bd205",
+"020e45c20a020e4f",
+"d203020e4f8f1a02",
+"0e9b7f06020d677f",
+"04020d67ae36af37",
+"22e4f5c822120c1a",
+"22c20b22d20b22c2",
+"0622d20622af3522",
+"ffffffffffffffff",
+"ffffffffffffffff",
+"ffffffffffffffff",
+"ffffffffffffffff",
+"ffffffffffffffff",
+"ffffffffffffffff",
+"ffffffffffffffff",
+"ffffffffffffffff",
+"ffffffffffffffff",
+"ffffffffffffffff",
+"ffffffffffffffff",
+"ffffffffffffffff",
+"ffffffffffffffff",
+"ffffffffffffffff",
+"ffffffffffffffff",
+"ffffffffffffffff",
+"ffffffffffffffff",
+"ffffffffffffffff",
+"ffffffffffffffff",
+"ffffffffffffffff",
+"ffffffffffffffff",
+"ffffffffffffffff",
+"ffffffffffffffff",
+"ffffffffffffffff",
+"ffffffffffffffff",
+"ffffffffffffffff",
+"ffffffffffffffff",
+"ffffffffffffffff"
+);
+?>
+
+<span style="font-family:mono; font-size:0.85em;">
+<?php
+$shl = 3;
+
+$datalen = pow(2, $shl);
+$datalenhex = dechex($datalen);
+while (strlen($datalenhex)<2) $datalenhex="0".$datalenhex;
+
+$recordtype = 0x00;
+$recordtypehex = dechex($recordtype);
+while (strlen($recordtypehex)<2) $recordtypehex="0".$recordtypehex;
+
+for ($i=0; $i<count($blob); $i++) {
+
+ $addr = ($i << $shl);
+
+ // --------------------
+ // checksum calculation
+ // --------------------
+
+ $chksum = $datalen + ($addr >> 8) + ($addr & 0xff) + $recordtype;
+
+ for ($j=0; $j<strlen($blob[$i]); $j+=2)
+ $chksum += hexdec(substr($blob[$i],$j,2));
+
+ $chksum ^= 0xffffffff;
+ ++$chksum;
+ $chksum &= 0xff;
+
+ // ---------------
+ // Display results
+ // ---------------
+
+ $addrhex = dechex($addr);
+ while (strlen($addrhex)<4) $addrhex="0".$addrhex;
+
+ $chksumhex = dechex($chksum);
+ while (strlen($chksumhex)<2) $chksumhex="0".$chksumhex;
+
+ echo ":".$datalenhex.$addrhex.$recordtypehex.$blob[$i].$chksumhex."<br/>";
+}
+
+// end of file
+echo ":00000001FF";
+?>
+</span>