From 8f6fa5f53d1698c094cdf5f4a973555878f7b691 Mon Sep 17 00:00:00 2001 From: bunnie Date: Fri, 22 Jul 2022 03:46:31 +0800 Subject: [PATCH] add a first draft of precursor_updater.py this should be an "all in one" updater. --- tools/updater/LICENSE | 202 +++++++++ tools/updater/README.md | 8 + .../precursor_updater-0.0.1-py3-none-any.whl | Bin 0 -> 13285 bytes .../dist/precursor_updater-0.0.1.tar.gz | Bin 0 -> 12446 bytes .../precursor_updater.egg-info/PKG-INFO | 4 + .../precursor_updater.egg-info/SOURCES.txt | 11 + .../dependency_links.txt | 1 + .../precursor_updater.egg-info/requires.txt | 8 + .../precursor_updater.egg-info/top_level.txt | 1 + tools/updater/precursor_updater/__init__.py | 0 .../__pycache__/__init__.cpython-38.pyc | Bin 0 -> 175 bytes .../__pycache__/precursorusb.cpython-38.pyc | Bin 0 -> 10082 bytes .../__pycache__/precursorusb.cpython-39.pyc | Bin 0 -> 10074 bytes .../precursor_updater/precursor_updater.py | 333 ++++++++++++++ .../updater/precursor_updater/precursorusb.py | 407 ++++++++++++++++++ tools/updater/pyproject.toml | 15 + 16 files changed, 990 insertions(+) create mode 100644 tools/updater/LICENSE create mode 100644 tools/updater/README.md create mode 100644 tools/updater/dist/precursor_updater-0.0.1-py3-none-any.whl create mode 100644 tools/updater/dist/precursor_updater-0.0.1.tar.gz create mode 100644 tools/updater/precursor_updater.egg-info/PKG-INFO create mode 100644 tools/updater/precursor_updater.egg-info/SOURCES.txt create mode 100644 tools/updater/precursor_updater.egg-info/dependency_links.txt create mode 100644 tools/updater/precursor_updater.egg-info/requires.txt create mode 100644 tools/updater/precursor_updater.egg-info/top_level.txt create mode 100644 tools/updater/precursor_updater/__init__.py create mode 100644 tools/updater/precursor_updater/__pycache__/__init__.cpython-38.pyc create mode 100644 tools/updater/precursor_updater/__pycache__/precursorusb.cpython-38.pyc create mode 100644 tools/updater/precursor_updater/__pycache__/precursorusb.cpython-39.pyc create mode 100755 tools/updater/precursor_updater/precursor_updater.py create mode 100644 tools/updater/precursor_updater/precursorusb.py create mode 100644 tools/updater/pyproject.toml diff --git a/tools/updater/LICENSE b/tools/updater/LICENSE new file mode 100644 index 000000000..d64569567 --- /dev/null +++ b/tools/updater/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/tools/updater/README.md b/tools/updater/README.md new file mode 100644 index 000000000..2e7125da5 --- /dev/null +++ b/tools/updater/README.md @@ -0,0 +1,8 @@ +# Precursor Updater + +This script can automatically update a Precursor device. Please run with `--help` to see +the available options. + +When the script is finished running, you will need to reset the device by pressing on the +switch inside the hole in the lower right hand side of the case. See https://ci.betrusted.io/i/reset.jpg +for an example of how to do this. diff --git a/tools/updater/dist/precursor_updater-0.0.1-py3-none-any.whl b/tools/updater/dist/precursor_updater-0.0.1-py3-none-any.whl new file mode 100644 index 0000000000000000000000000000000000000000..5bd2c7750614cd896bed8f58b56c0be013db10af GIT binary patch literal 13285 zcma)@18`>D*5{wtwryKaY}>YN+eXLgsAJnn$LZMWbZon$>36>RzI*4rcV_N6wU4US zZ|{9})xT=3y_S+J7&tlr0DuNC#N4a>c>sX^b@_7;{Ao@u=BDm0u8uB-?oMXLZssmb zhKAM-)^3J|j85KQ0Hyyi=E-?bb1oBwAVvlN)&&3n%71J8FStLH3%m`Njgf~u!v8~{! z-4=47&80l6v5sfNWqx~Huf;sSf{8WXoS)PT@s5rn1JR-%^Yy)=%wJcZ)2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4FA!alwkOwNLG$-pc+#Sg6#i>yAVL6;{|A8rb%y`| literal 0 HcmV?d00001 diff --git a/tools/updater/precursor_updater.egg-info/PKG-INFO b/tools/updater/precursor_updater.egg-info/PKG-INFO new file mode 100644 index 000000000..2c41aa35d --- /dev/null +++ b/tools/updater/precursor_updater.egg-info/PKG-INFO @@ -0,0 +1,4 @@ +Metadata-Version: 2.1 +Name: precursor-updater +Version: 0.0.1 +License-File: LICENSE diff --git a/tools/updater/precursor_updater.egg-info/SOURCES.txt b/tools/updater/precursor_updater.egg-info/SOURCES.txt new file mode 100644 index 000000000..5b1eee84a --- /dev/null +++ b/tools/updater/precursor_updater.egg-info/SOURCES.txt @@ -0,0 +1,11 @@ +LICENSE +README.md +pyproject.toml +precursor_updater/__init__.py +precursor_updater/precursor_updater.py +precursor_updater/precursorusb.py +precursor_updater.egg-info/PKG-INFO +precursor_updater.egg-info/SOURCES.txt +precursor_updater.egg-info/dependency_links.txt +precursor_updater.egg-info/requires.txt +precursor_updater.egg-info/top_level.txt \ No newline at end of file diff --git a/tools/updater/precursor_updater.egg-info/dependency_links.txt b/tools/updater/precursor_updater.egg-info/dependency_links.txt new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/tools/updater/precursor_updater.egg-info/dependency_links.txt @@ -0,0 +1 @@ + diff --git a/tools/updater/precursor_updater.egg-info/requires.txt b/tools/updater/precursor_updater.egg-info/requires.txt new file mode 100644 index 000000000..17318a9b2 --- /dev/null +++ b/tools/updater/precursor_updater.egg-info/requires.txt @@ -0,0 +1,8 @@ +requests +pyusb +progressbar2 +csv +hashlib + +[:python_version < "3.8"] +importlib-metadata diff --git a/tools/updater/precursor_updater.egg-info/top_level.txt b/tools/updater/precursor_updater.egg-info/top_level.txt new file mode 100644 index 000000000..e8c465200 --- /dev/null +++ b/tools/updater/precursor_updater.egg-info/top_level.txt @@ -0,0 +1 @@ +precursor_updater diff --git a/tools/updater/precursor_updater/__init__.py b/tools/updater/precursor_updater/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tools/updater/precursor_updater/__pycache__/__init__.cpython-38.pyc b/tools/updater/precursor_updater/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b5a5acd5daeb8ce7b0b39dfac5fb7ea3f523206e GIT binary patch literal 175 zcmWIL<>g`kg5?%Bl0fuh5P=LBfgA@QE@lA|DGb33nv8xc8Hzx{2;x_Wer{fgewuzx zVo`c(d45s0eo<+0iEepjo_=zEN~(TEerd68a(+>&eo20QPO*MzK}uptYLR|HQEGB& mQE`4zJWM1$J~J<~BtBlRpz;=nO>TZlX-=vg$hOZw%m4tQye literal 0 HcmV?d00001 diff --git a/tools/updater/precursor_updater/__pycache__/precursorusb.cpython-38.pyc b/tools/updater/precursor_updater/__pycache__/precursorusb.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a709551b457314fb12f9471428cacba94af956b3 GIT binary patch literal 10082 zcmcIqOOPAKd7c*rgINIkAh>+!1xl0@*y1iNOOYZm63xd-bd)tkQjehGKmdAncXsjG zo&k3k8aS#@sZu3o%(%*l<2;OwQ!Z17R4Rv*4?3ij98#$qb4aFgN_5$(OyXxhfscyHJ)@ zsvP~8xH*rX_tzkfLfxZlRcP-kMLp`YXoxQhQzYM4(e+cp5-F5SVT&p7Bt=?eaJ58M zOyimoXT+?S1BWe+h#YFB#8EMiYg!x=$8pVw6XGPUS@D2)5Z7t(ka!r^8S#k7<2ox& ziAQmr6AR+BcpN<)5l@IGQIivkq9DG6nxo<|Oz~`(zABw+TY63ThF7U-m_q+UW%^yj z&wC9dPy?ler3A(7KsBL*V%b0qkpN8y6BIKAO$rOtauv`NQ(L4^o)QY)Y%lL6(C6Nl ziTscVt>d0Se>UzE-y)a3|X2T23Ro9o!&4Lyho>Nuykf;h`&1_d9hysif73CQP`hV|8!rHXpY zQg<7^oaeGUflFvK%5{h58<7X7((11iae9mcbz&raj-@KSy8lU{Ky%`u)KCy=4|=t$ zc6DFvselLol2dlIE?}~*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4;H~tbaCH#qAIB4<$8dHg z=tJT$cz`9_63Gr^`>Fk&kYE8l=QDpJ<#T?S*YX zl5k)vGQ)eM|5C6OIQK;iftBEV4Elj?ucN1HsD~a?93f_+H{i(!nCEP~eo?FV?RfSP zT1=0Qu0Jw*h93WFICJ@NkVFiE^@PQs@+_}`F6Ma6c`d{dq*G};8ln)*pA)%NRUC=e z6wi(;Ipvm$86fuRrbpKM=y1J*^kA(u`JWiy=vt?-*7F+%`u|Na-_0~)-T?L840!Lk z(rB@EN87xE-x~Oi;FlA}u%poeL{vehpOj^k9mR^Lfx-;$fAAC|2G_{A7I-bvv=-=* z?)s~7{Lq!wtov7Ehy(`v+vZ+2(FgLn_~1!dlU45ot_AX=9n;T;b^KW3w+ z5oeTS4yJ{U*-taC2HxKR?}IcRjG4+0vGjHEFxpSYCy25BH7q=Tgr0LLKROHcFsGJ_ z7V=Y^O^IST%4l>RdyCW26z$}3Ae?Wmf==(M!o0?7_X@uOM;WjL+RV*=R(4uh4n& zsw3&xnD{BCtKhsOkBa|s; z{Uim9>>cF~sC1vcQT{10ze?mfkw=L5M6MCJ0#cY8x=lVh2u)t=onk+A$NxSlrlQmw zoooF$wfzesKP1v4vP8|IUHxf<>~{MJK}uj;ZVsXKRDuiO}Od4^Cd?->U=4bMqkF9 z`Y>9~bK5zzO|#=B&WF*K+EB0LzS(K(HlEW_8{Og94c|F@Z3O3$!>1NDj@T@%b8;+D zADdP|T`FixOGqlto?dGmqRyVS`okZ`&mqgBds0lx_B)c;{G V4y|+1BD_S4#_0``2o68B{|D9XB*y>% literal 0 HcmV?d00001 diff --git a/tools/updater/precursor_updater/__pycache__/precursorusb.cpython-39.pyc b/tools/updater/precursor_updater/__pycache__/precursorusb.cpython-39.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6e752687584c17aff7009acf1a1fa0f531f64e77 GIT binary patch literal 10074 zcmcIqTaX)9TJF1AJ(A{Pd3?!DPMnK&?TM3hNN_^p_%c}s@2uB$5>R!E1p$Y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CDp0DXZe&Ti3Jm^bZ``y5#erlh0S{qFJGGBA?%A z7Anyb`7rgwBBn$}l(}O$v+Nl%oTBD%ii0SI7Kd0IP7OmW#>nqcFFQm&A~MYOa*6(U zBPmLa;paUCf;CA&Hc97EJ7XWW4JU5L_-om{uk)mRn%iLB&r|ztBEJn1PWNN9VnHt8 c7lEDn-|xkt{Ytb5uhOD%%7Y|=gHY}N0ZDx&QUCw| literal 0 HcmV?d00001 diff --git a/tools/updater/precursor_updater/precursor_updater.py b/tools/updater/precursor_updater/precursor_updater.py new file mode 100755 index 000000000..14ddc6ed6 --- /dev/null +++ b/tools/updater/precursor_updater/precursor_updater.py @@ -0,0 +1,333 @@ +#! /usr/bin/env python3 + +import argparse +import usb.core +import usb.util +from datetime import datetime +import requests + +from precursorusb import PrecursorUsb +from progressbar.bar import ProgressBar + +QR_CODE = """ + + ██████████████ ██ ████ ██████ ██ ██████████████ + ██ ██ ██████ ██ ████ ██ ██ ██ + ██ ██████ ██ ████████████ ██ ████ ██ ██████ ██ + ██ ██████ ██ ████ ██ ██ ██ ██ ██████ ██ + ██ ██████ ██ ████ ████ ██ ██ ██████ ██ + ██ ██ ██████ ████ ██████ ██ ██ + ██████████████ ██ ██ ██ ██ ██ ██ ██ ██████████████ + ██ ██ ████ ██████ + ██ ██ ████ ██████████ ████ ██ ██ ██ ██ + ██████ ██ ██ ████ ██████ ██ ████ ████ + ██ ██ ██████ ██ ████████████████ ████ ████ ██ + ████ ██ ██ ██ ██ ██ ████ ██ + ████ ████ ██████ ██████████ ██████ ████ ██ + ██ ██ ██ ██ ████████████ ██████████ ████ + ████████ ██ ████ ████ ████ ██ ████ ██ + ██████ ████ ████ ██████ ██ ██ ██ ████ + ████████████████████ ████ ██ ████ ████ ██ + ██ ████ ████ ██████████ ██████ + ████ ██ ██ ██ ██ ████████ ██████████ ████ ██ + ██ ██ ██ ██████ ██ ██ ██ + ████ ████ ████████ ████████ ██ ██████████████ ██ + ██ ██████ ████ ██████ ██ + ██████████████ ████████ ██████ ██ ██ ██ ██ + ██ ██ ██ ██ ██ ██ ██████ ██ ████ + ██ ██████ ██ ████ ██ ██ ██████████████ ████ + ██ ██████ ██ ████ ████████ ██████ ██ + ██ ██████ ██ ████████ ██████ ██████ ██ ████ + ██ ██ ████ ██ ██ ████████ ██████ + ██████████████ ████ ██ ████████ ██ ████████ ██ + +""" + +def get_with_progress(url, name='Downloading'): + r = requests.get(url, stream=True) + total_length = int(r.headers.get('content-length')) + ret = bytearray() + progress = ProgressBar(min_value=0, max_value=total_length, prefix=name + ' ').start() + for chunk in r.iter_content(chunk_size=65536): + if chunk: + ret += bytearray(chunk) + progress.update(len(ret)) + progress.finish() + return ret + +def get_usb_interface(config=False, peek=None, override_csr=None, force=False): + dev = usb.core.find(idProduct=0x5bf0, idVendor=0x1209) + + if dev is None: + raise ValueError('Precursor device not found') + + dev.set_configuration() + if config: + cfg = dev.get_active_configuration() + print(cfg) + + pc_usb = PrecursorUsb(dev) + + if peek: + pc_usb.peek(peek, display=True) + exit(0) + + pc_usb.load_csrs(override_csr) # prime the CSR values + if "v0.8" in pc_usb.gitrev: + locs = { + "LOC_SOC" : [0x0000_0000, "soc_csr.bin"], + "LOC_STAGING": [0x0028_0000, "pass"], + "LOC_LOADER" : [0x0050_0000, "loader.bin"], + "LOC_KERNEL" : [0x0098_0000, "xous.img"], + "LOC_WF200" : [0x07F8_0000, "pass"], + "LOC_EC" : [0x07FC_E000, "pass"], + "LOC_AUDIO" : [0x0634_0000, "short_8khz.wav"], + "LEN_AUDIO" : [0x01C4_0000, "pass"], + "LOC_PDDB" : [0x0100_0000, "pass"], + } + elif "v0.9" in pc_usb.gitrev: + locs = { + "LOC_SOC" : [0x0000_0000, "soc_csr.bin"], + "LOC_STAGING": [0x0028_0000, "pass"], + "LOC_LOADER" : [0x0050_0000, "loader.bin"], + "LOC_KERNEL" : [0x0098_0000, "xous.img"], + "LOC_WF200" : [0x07F8_0000, "pass"], + "LOC_EC" : [0x07FC_E000, "pass"], + "LOC_AUDIO" : [0x0634_0000, "short_8khz.wav"], + "LEN_AUDIO" : [0x01C4_0000, "pass"], + "LOC_PDDB" : [0x01D8_0000, "pass"], + } + elif force == True: + # try the v0.9 offsets + locs = { + "LOC_SOC" : [0x00000000, "soc_csr.bin"], + "LOC_STAGING": [0x00280000, "pass"], + "LOC_LOADER" : [0x00500000, "loader.bin"], + "LOC_KERNEL" : [0x00980000, "xous.img"], + "LOC_WF200" : [0x07F80000, "pass"], + "LOC_EC" : [0x07FCE000, "pass"], + "LOC_AUDIO" : [0x06340000, "short_8khz.wav"], + "LEN_AUDIO" : [0x01C40000, "pass"], + "LOC_PDDB" : [0x01D80000, "pass"], + } + else: + print("SoC is from an unknow rev '{}', use --force to continue anyways with v0.9 firmware offsets".format(pc_usb.load_csrs())) + exit(1) + + return (locs, pc_usb) + +def main(): + parser = argparse.ArgumentParser(description="Precursor USB Updater v2") + parser.add_argument( + "-b", "--bleeding-edge", required=False, help="Update to bleeding-edge CI build", action='store_true' + ) + parser.add_argument( + "-l", "--language", help="Select Xous language [en|ja|zh|en-tts]", required=False, type=str, default="en" + ) + parser.add_argument( + "--factory-reset", required=False, help="Delete passwords and do a factory reset", action='store_true' + ) + parser.add_argument( + "--paranoid", required=False, help="Do a full-wipe of the PDDB after the factory reset", action='store_true' + ) + parser.add_argument( + "--config", required=False, help="Print the Precursor USB descriptor", action='store_true' + ) + parser.add_argument( + "--override-csr", required=False, help="CSR file to use instead of CSR values stored with the image. Used to recover in case of a partially corrupted gateware", type=str, + ) + parser.add_argument( + "--peek", required=False, help="Inspect an address, then quit. Useful for sanity testing your config.", type=auto_int, metavar=('ADDR') + ) + parser.add_argument( + "--force", required=False, help="Ignore gitrev version on SoC and try to burn an image anyways", action="store_true" + ) + parser.add_argument( + "--dry-run", required=False, help="Don't actually burn anything, but print what would happen if we did", action="store_true" + ) + + args = parser.parse_args() + + VALID_LANGUAGES = { + "en", + "en-tts", + "ja", + "zh", + } + language = args.language.lower() + if language not in VALID_LANGUAGES: + print("Language selection '{}' is not valid. Please select one of {}".format(language, VALID_LANGUAGES)) + exit(1) + + # initial check to see if the Precursor device is there + try: + (locs, pc_usb) = get_usb_interface(args.config, args.peek, args.override_csr, args.force) + except ValueError: + print("Precursor device not found. Please check the USB cable and ensure that `usb debug` was run in Shellchat") + exit(1) + + # now try to download all the artifacts and check their versions + # this list should visit kernels in order from newest to oldest. + URL_BLEEDING = 'https://ci.betrusted.io/releases/latest/' + URL_STABLE = 'https://ci.betrusted.io/latest-ci/' + print("Phase 1: Download the update") + if args.bleeding_edge: + print("Bleeding edge CI build selected") + url = URL_BLEEDING + else: + print("Latest stable build selected") + url = URL_STABLE + + try: + while True: + # first try the stable branch and see if it meets the version requirement + kernel = get_with_progress(url + 'xous-' + language + '.img', 'Kernel') + if int.from_bytes(kernel[:4], 'little') != 1: + print("Downloaded kernel image has unexpected signature version. Aborting.") + exit(1) + kern_len = int.from_bytes(kernel[4:8], 'little') + 0x1000 + if len(kernel) != kern_len: + print("Downloaded kernel has the wrong length. Aborting.") + attempt += 1 + exit(1) + curver_loc = kern_len - 4 - 4 - 16 + curver = SemVer(kernel[curver_loc:curver_loc + 16]) + + loader = get_with_progress(url + 'loader.bin', 'Loader') + soc_csr = get_with_progress(url + 'soc_csr.bin', 'Gateware') + ec_fw = get_with_progress(url + 'ec_fw.bin', 'Embedded Controller') + wf200 = get_with_progress(url + 'wf200_fw.bin', 'WF200') + + print("Downloaded Xous version {}".format(curver.as_str())) + break + except Exception as e: + if False == single_yes_or_no_question("Error: '{}' encountered downloading the update. Retry? ".format(e)): + print("Abort by user request.") + exit(0) + + if args.factory_reset: + if False == single_yes_or_no_question("This will permanently erase user data on the device. Proceed? "): + print("Abort by user request.") + exit(0) + worklist = [ + ['erase', "Disabling boot by erasing loader...", locs['LOC_LOADER'][0], 1024 * 256], + ['prog', "Uploading kernel", locs['LOC_KERNEL'][0], kernel], + ['prog', "Uploading EC", locs['LOC_EC'][0], ec_fw], + ['prog', "Uploading wf200", locs['LOC_WF200'][0], wf200], + ['prog', "Overwriting gateware", locs['LOC_SOC'][0], soc_csr], + ] + if args.paranoid: + # erase the entire area -- about 10-15 minutes + worklist += [['erase', "Full erase of PDDB", locs['LOC_PDDB'][0], 0x620_0000]] + worklist += [['prog', "Restoring loader", locs['LOC_LOADER'][0], loader]] + else: + # just deletes the page table -- about 10 seconds + worklist += [['erase', "Shallow-delete of PDDB", locs['LOC_PDDB'][0], 1024 * 512]] + worklist += [['prog', "Restoring loader", locs['LOC_LOADER'][0], loader]] + else: + worklist = [ + ['erase', "Disabling boot by erasing loader...", locs['LOC_LOADER'][0], 1024 * 256], + ['prog', "Uploading kernel", locs['LOC_KERNEL'][0], kernel], + ['prog', "Uploading EC", locs['LOC_EC'][0], ec_fw], + ['prog', "Uploading wf200", locs['LOC_WF200'][0], wf200], + ['prog', "Staging gateware", locs['LOC_STAGING'][0], soc_csr], + ['prog', "Restoring loader", locs['LOC_LOADER'][0], loader], + ] + + print("\nPhase 2: Apply the update") + print("Halting CPU for update.") + vexdbg_addr = int(pc_usb.regions['vexriscv_debug'][0], 0) + pc_usb.ping_wdt() + pc_usb.poke(vexdbg_addr, 0x00020000) + for work in worklist: + + retry_usb = False + while True: + if retry_usb: + print("Trying to re-aquire Precursor device...") + try: + (locs, pc_usb) = get_usb_interface(args.config, args.peek, args.override_csr, args.force) + except Exception as e: + if False == single_yes_or_no_question("Failed to find Precursor device. Try again? "): + print("Abort by user request!\n\nSystem may not be bootable, but you can retry an update as long as you do not power-off or hard-reset the device.") + exit(0) + + vexdbg_addr = int(pc_usb.regions['vexriscv_debug'][0], 0) + pc_usb.ping_wdt() + pc_usb.poke(vexdbg_addr, 0x00020000) + retry_usb = False + + try: + print(work[1]) + if work[0] == 'erase': + if args.dry_run: + print("DRYRUN: would erase at 0x{:x}, len 0x{:x}".format(work[2], work[3])) + else: + pc_usb.erase_region(work[2], work[3]) + break + else: + if args.dry_run: + print("DRYRUN: Would write at 0x{:x}".format(work[2])) + else: + pc_usb.flash_program(work[2], work[3], verify=False) + break + except Exception as e: + print("Error encountered while {}: '{}'".format(work[1], e)) + print("Try reseating the USB connection.") + if False == single_yes_or_no_question("Try again? "): + print("Abort by user request!\n\nSystem may not be bootable, but you can retry an update as long as you do not power-off or hard-reset the device.") + exit(0) + retry_usb = True + + print("Resuming CPU.") + pc_usb.poke(vexdbg_addr, 0x02000000) + + print("Resetting SOC...") + try: + pc_usb.poke(pc_usb.register('reboot_soc_reset'), 0xac, display=False) + except usb.core.USBError: + pass # we expect an error because we reset the SOC and that includes the USB core + + + print("\nUpdate finished!\n") + print("{}\nVisit the QR code above to help locate the hole, or go to https://ci.betrusted.io/i/reset.jpg.".format(QR_CODE)) + print("Reboot by inserting a paperclip in the hole in the lower right hand side, then follow the on-device instructions.") + + +def auto_int(x): + return int(x, 0) + +class SemVer: + def __init__(self, b): + self.maj = int.from_bytes(b[0:2], 'little') + self.min = int.from_bytes(b[2:4], 'little') + self.rev = int.from_bytes(b[4:6], 'little') + self.extra = int.from_bytes(b[6:8], 'little') + self.has_commit = int.from_bytes(b[12:16], 'little') + # note: very old kernel will return a version of 0.0.0 + if self.has_commit != 0: + self.commit = int.from_bytes(b[8:12], 'little') + + def ord(self): # returns a number that you can use to compare if versions are bigger or smaller than each other + return self.maj << 48 | self.min << 32 | self.rev << 16 | self.extra + + def as_str(self): + if self.has_commit == 0: + return "v{}.{}.{}-{}".format(self.maj, self.min, self.rev, self.extra) + else: + return "v{}.{}.{}-{}-g{:x}".format(self.maj, self.min, self.rev, self.extra, self.commit) + +def single_yes_or_no_question(question, default_no=False): + choices = ' [y/N]: ' if default_no else ' [Y/n]: ' + default_answer = 'n' if default_no else 'y' + reply = str(input(question + choices)).lower().strip() or default_answer + if reply[0] == 'y': + return True + if reply[0] == 'n': + return False + else: + return False if default_no else True + +if __name__ == "__main__": + main() + exit(0) diff --git a/tools/updater/precursor_updater/precursorusb.py b/tools/updater/precursor_updater/precursorusb.py new file mode 100644 index 000000000..2058c84cf --- /dev/null +++ b/tools/updater/precursor_updater/precursorusb.py @@ -0,0 +1,407 @@ +import array +import hashlib +import csv + +from progressbar.bar import ProgressBar + +class PrecursorUsb: + def __init__(self, dev): + self.dev = dev + self.RDSR = 0x05 + self.RDSCUR = 0x2B + self.RDID = 0x9F + self.WREN = 0x06 + self.WRDI = 0x04 + self.SE4B = 0x21 + self.BE4B = 0xDC + self.PP4B = 0x12 + self.registers = {} + self.regions = {} + self.gitrev = '' + + def register(self, name): + return int(self.registers[name], 0) + + def peek(self, addr, display=False): + _dummy_s = '\x00'.encode('utf-8') + data = array.array('B', _dummy_s * 4) + + numread = self.dev.ctrl_transfer(bmRequestType=(0x80 | 0x43), bRequest=0, + wValue=(addr & 0xffff), wIndex=((addr >> 16) & 0xffff), + data_or_wLength=data, timeout=500) + + read_data = int.from_bytes(data.tobytes(), byteorder='little', signed=False) + if display == True: + print("0x{:08x}".format(read_data)) + return read_data + + def poke(self, addr, wdata, check=False, display=False): + if check == True: + _dummy_s = '\x00'.encode('utf-8') + data = array.array('B', _dummy_s * 4) + + numread = self.dev.ctrl_transfer(bmRequestType=(0x80 | 0x43), bRequest=0, + wValue=(addr & 0xffff), wIndex=((addr >> 16) & 0xffff), + data_or_wLength=data, timeout=500) + + read_data = int.from_bytes(data.tobytes(), byteorder='little', signed=False) + print("before poke: 0x{:08x}".format(read_data)) + + data = array.array('B', wdata.to_bytes(4, 'little')) + numwritten = self.dev.ctrl_transfer(bmRequestType=(0x00 | 0x43), bRequest=0, + wValue=(addr & 0xffff), wIndex=((addr >> 16) & 0xffff), + data_or_wLength=data, timeout=500) + + if check == True: + _dummy_s = '\x00'.encode('utf-8') + data = array.array('B', _dummy_s * 4) + + numread = self.dev.ctrl_transfer(bmRequestType=(0x80 | 0x43), bRequest=0, + wValue=(addr & 0xffff), wIndex=((addr >> 16) & 0xffff), + data_or_wLength=data, timeout=500) + + read_data = int.from_bytes(data.tobytes(), byteorder='little', signed=False) + print("after poke: 0x{:08x}".format(read_data)) + if display == True: + print("wrote 0x{:08x} to 0x{:08x}".format(wdata, addr)) + + def burst_read(self, addr, len): + _dummy_s = '\x00'.encode('utf-8') + maxlen = 4096 + + ret = bytearray() + packet_count = len // maxlen + if (len % maxlen) != 0: + packet_count += 1 + + for pkt_num in range(packet_count): + cur_addr = addr + pkt_num * maxlen + if pkt_num == packet_count - 1: + if len % maxlen != 0: + bufsize = len % maxlen + else: + bufsize = maxlen + else: + bufsize = maxlen + + data = array.array('B', _dummy_s * bufsize) + numread = self.dev.ctrl_transfer(bmRequestType=(0x80 | 0x43), bRequest=0, + wValue=(cur_addr & 0xffff), wIndex=((cur_addr >> 16) & 0xffff), + data_or_wLength=data, timeout=500) + + if numread != bufsize: + print("Burst read error: {} bytes requested, {} bytes read at 0x{:08x}".format(bufsize, numread, cur_addr)) + exit(1) + + ret = ret + data + + return ret + + def burst_write(self, addr, data): + if len(data) == 0: + return + + # the actual "addr" doesn't matter for a burst_write, because it's specified + # as an argument to the flash_pp4b command. We lock out access to the base of + # SPINOR because it's part of the gateware, so, we pick a "safe" address to + # write to instead. The page write responder will aggregate any write data + # to anywhere in the SPINOR address range. + writebuf_addr = 0x2098_0000 # the current start address of the kernel, for example + + maxlen = 4096 + packet_count = len(data) // maxlen + if (len(data) % maxlen) != 0: + packet_count += 1 + + for pkt_num in range(packet_count): + cur_addr = addr + pkt_num * maxlen + if pkt_num == packet_count - 1: + if len(data) % maxlen != 0: + bufsize = len(data) % maxlen + else: + bufsize = maxlen + else: + bufsize = maxlen + + wdata = array.array('B', data[(pkt_num * maxlen):(pkt_num * maxlen) + bufsize]) + numwritten = self.dev.ctrl_transfer(bmRequestType=(0x00 | 0x43), bRequest=0, + # note use of writebuf_addr instead of cur_addr -> see comment above about the quirk of write addressing + wValue=(writebuf_addr & 0xffff), wIndex=((writebuf_addr >> 16) & 0xffff), + data_or_wLength=wdata, timeout=500) + + if numwritten != bufsize: + print("Burst write error: {} bytes requested, {} bytes written at 0x{:08x}".format(bufsize, numwritten, cur_addr)) + exit(1) + + def ping_wdt(self): + self.poke(self.register('wdt_watchdog'), 1, display=False) + self.poke(self.register('wdt_watchdog'), 1, display=False) + + def spinor_command_value(self, exec=0, lock_reads=0, cmd_code=0, dummy_cycles=0, data_words=0, has_arg=0): + return ((exec & 1) << 1 | + (lock_reads & 1) << 24 | + (cmd_code & 0xff) << 2 | + (dummy_cycles & 0x1f) << 11 | + (data_words & 0xff) << 16 | + (has_arg & 1) << 10 + ) + + def flash_rdsr(self, lock_reads): + self.poke(self.register('spinor_cmd_arg'), 0) + self.poke(self.register('spinor_command'), + self.spinor_command_value(exec=1, lock_reads=lock_reads, cmd_code=self.RDSR, dummy_cycles=4, data_words=1, has_arg=1) + ) + return self.peek(self.register('spinor_cmd_rbk_data'), display=False) + + def flash_rdscur(self): + self.poke(self.register('spinor_cmd_arg'), 0) + self.poke(self.register('spinor_command'), + self.spinor_command_value(exec=1, lock_reads=1, cmd_code=self.RDSCUR, dummy_cycles=4, data_words=1, has_arg=1) + ) + return self.peek(self.register('spinor_cmd_rbk_data'), display=False) + + def flash_rdid(self, offset): + self.poke(self.register('spinor_cmd_arg'), 0) + self.poke(self.register('spinor_command'), + self.spinor_command_value(exec=1, cmd_code=self.RDID, dummy_cycles=4, data_words=offset, has_arg=1) + ) + return self.peek(self.register('spinor_cmd_rbk_data'), display=False) + + def flash_wren(self): + self.poke(self.register('spinor_cmd_arg'), 0) + self.poke(self.register('spinor_command'), + self.spinor_command_value(exec=1, lock_reads=1, cmd_code=self.WREN) + ) + + def flash_wrdi(self): + self.poke(self.register('spinor_cmd_arg'), 0) + self.poke(self.register('spinor_command'), + self.spinor_command_value(exec=1, lock_reads=1, cmd_code=self.WRDI) + ) + + def flash_se4b(self, sector_address): + self.poke(self.register('spinor_cmd_arg'), sector_address) + self.poke(self.register('spinor_command'), + self.spinor_command_value(exec=1, lock_reads=1, cmd_code=self.SE4B, has_arg=1) + ) + + def flash_be4b(self, block_address): + self.poke(self.register('spinor_cmd_arg'), block_address) + self.poke(self.register('spinor_command'), + self.spinor_command_value(exec=1, lock_reads=1, cmd_code=self.BE4B, has_arg=1) + ) + + def flash_pp4b(self, address, data_bytes): + self.poke(self.register('spinor_cmd_arg'), address) + self.poke(self.register('spinor_command'), + self.spinor_command_value(exec=1, lock_reads=1, cmd_code=self.PP4B, has_arg=1, data_words=(data_bytes//2)) + ) + + def load_csrs(self, fname=None): + LOC_CSRCSV = 0x20277000 # this address shouldn't change because it's how we figure out our version number + # CSR extraction: + # dd if=soc_csr.bin of=csr_data_0.9.6.bin skip=2524 count=32 bs=1024 + if fname == None: + csr_data = self.burst_read(LOC_CSRCSV, 0x8000) + else: + with open(fname, "rb") as f: + csr_data = f.read(0x8000) + + hasher = hashlib.sha512() + hasher.update(csr_data[:0x7FC0]) + digest = hasher.digest() + if digest != csr_data[0x7fc0:]: + print("Could not find a valid csr.csv descriptor on the device, aborting!") + exit(1) + + csr_len = int.from_bytes(csr_data[:4], 'little') + csr_extracted = csr_data[4:4+csr_len] + decoded = csr_extracted.decode('utf-8') + # strip comments + stripped = [] + for line in decoded.split('\n'): + if line.startswith('#') == False: + stripped.append(line) + # create database + csr_db = csv.reader(stripped) + for row in csr_db: + if len(row) > 1: + if 'csr_register' in row[0]: + self.registers[row[1]] = row[2] + if 'memory_region' in row[0]: + self.regions[row[1]] = [row[2], row[3]] + if 'git_rev' in row[0]: + self.gitrev = row[1] + print("Using SoC {} registers".format(self.gitrev)) + + def erase_region(self, addr, length): + # ID code check + code = self.flash_rdid(1) + print("ID code bytes 1-2: 0x{:08x}".format(code)) + if code != 0x8080c2c2: + print("ID code mismatch") + exit(1) + code = self.flash_rdid(2) + print("ID code bytes 2-3: 0x{:08x}".format(code)) + if code != 0x3b3b8080: + print("ID code mismatch") + exit(1) + + # block erase + progress = ProgressBar(min_value=0, max_value=length, prefix='Erasing ').start() + erased = 0 + while erased < length: + self.ping_wdt() + if (length - erased >= 65536) and ((addr & 0xFFFF) == 0): + blocksize = 65536 + else: + blocksize = 4096 + + while True: + self.flash_wren() + status = self.flash_rdsr(1) + if status & 0x02 != 0: + break + + if blocksize == 4096: + self.flash_se4b(addr + erased) + else: + self.flash_be4b(addr + erased) + erased += blocksize + + while (self.flash_rdsr(1) & 0x01) != 0: + pass + + result = self.flash_rdscur() + if result & 0x60 != 0: + print("E_FAIL/P_FAIL set on erase, programming may fail, but trying anyways...") + + if self.flash_rdsr(1) & 0x02 != 0: + self.flash_wrdi() + while (self.flash_rdsr(1) & 0x02) != 0: + pass + if erased < length: + progress.update(erased) + progress.finish() + print("Erase finished") + + # addr is relative to the base of FLASH (not absolute) + def flash_program(self, addr, data, verify=True): + flash_region = int(self.regions['spiflash'][0], 0) + flash_len = int(self.regions['spiflash'][1], 0) + + if (addr + len(data) > flash_len): + print("Write data out of bounds! Aborting.") + exit(1) + + # ID code check + code = self.flash_rdid(1) + print("ID code bytes 1-2: 0x{:08x}".format(code)) + if code != 0x8080c2c2: + print("ID code mismatch") + exit(1) + code = self.flash_rdid(2) + print("ID code bytes 2-3: 0x{:08x}".format(code)) + if code != 0x3b3b8080: + print("ID code mismatch") + exit(1) + + # block erase + progress = ProgressBar(min_value=0, max_value=len(data), prefix='Erasing ').start() + erased = 0 + while erased < len(data): + self.ping_wdt() + if (len(data) - erased >= 65536) and ((addr & 0xFFFF) == 0): + blocksize = 65536 + else: + blocksize = 4096 + + while True: + self.flash_wren() + status = self.flash_rdsr(1) + if status & 0x02 != 0: + break + + if blocksize == 4096: + self.flash_se4b(addr + erased) + else: + self.flash_be4b(addr + erased) + erased += blocksize + + while (self.flash_rdsr(1) & 0x01) != 0: + pass + + result = self.flash_rdscur() + if result & 0x60 != 0: + print("E_FAIL/P_FAIL set on erase, programming may fail, but trying anyways...") + + if self.flash_rdsr(1) & 0x02 != 0: + self.flash_wrdi() + while (self.flash_rdsr(1) & 0x02) != 0: + pass + if erased < len(data): + progress.update(erased) + progress.finish() + print("Erase finished") + + # program + # pad out to the nearest word length + if len(data) % 4 != 0: + data += bytearray([0xff] * (4 - (len(data) % 4))) + written = 0 + progress = ProgressBar(min_value=0, max_value=len(data), prefix='Writing ').start() + while written < len(data): + self.ping_wdt() + if len(data) - written > 256: + chunklen = 256 + else: + chunklen = len(data) - written + + while True: + self.flash_wren() + status = self.flash_rdsr(1) + if status & 0x02 != 0: + break + + self.burst_write(self.register('spinor_wdata'), data[written:(written+chunklen)]) + self.flash_pp4b(addr + written, chunklen) + + written += chunklen + if written < len(data): + progress.update(written) + progress.finish() + print("Write finished") + + if self.flash_rdsr(1) & 0x02 != 0: + self.flash_wrdi() + while (self.flash_rdsr(1) & 0x02) != 0: + pass + + # dummy reads to clear the "read lock" bit + self.flash_rdsr(0) + + # verify + self.ping_wdt() + if verify: + print("Performing readback for verification...") + self.ping_wdt() + rbk_data = self.burst_read(addr + flash_region, len(data)) + if rbk_data != data: + errs = 0 + err_thresh = 64 + for i in range(0, len(rbk_data)): + if rbk_data[i] != data[i]: + if errs < err_thresh: + print("Error at 0x{:x}: {:x}->{:x}".format(i, data[i], rbk_data[i])) + errs += 1 + if errs == err_thresh: + print("Too many errors, stopping print...") + print("Errors were found in verification, programming failed") + print("Total byte errors: {}".format(errs)) + exit(1) + else: + print("Verification passed.") + else: + print("Skipped verification at user request") + + self.ping_wdt() diff --git a/tools/updater/pyproject.toml b/tools/updater/pyproject.toml new file mode 100644 index 000000000..917964435 --- /dev/null +++ b/tools/updater/pyproject.toml @@ -0,0 +1,15 @@ +[build-system] +requires = ["setuptools>=61.0"] +build-backend = "setuptools.build_meta" + +[project] +name = "precursor_updater" +version = "0.0.1" +dependencies = [ + "requests", + "pyusb", + "progressbar2", + "csv", + "hashlib", + 'importlib-metadata; python_version<"3.8"', +] \ No newline at end of file