summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlejandro Soto <alejandro@34project.org>2022-11-16 18:08:01 -0600
committerAlejandro Soto <alejandro@34project.org>2022-11-16 18:08:08 -0600
commit7611b374321f826c94afac2d2b42cf02a9fca732 (patch)
treedb789fc2279f6045761525e04ba917777c0b9770
parent306cd98eba45d333d6b17716efbbe8f4a4c13685 (diff)
Add bin2mw for flashing small programs directly from U-Boot console
Diffstat (limited to '')
-rwxr-xr-xapp/bin2mw.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/bin2mw.py b/app/bin2mw.py
new file mode 100755
index 0000000..8bce375
--- /dev/null
+++ b/app/bin2mw.py
@@ -0,0 +1,10 @@
+#!/usr/bin/env python3
+
+import sys
+
+with open(sys.argv[1], 'rb') as f:
+ addr = 0x2000_0000
+ while word := f.read(4):
+ word = int.from_bytes(word, 'little')
+ print(f'mw.l {addr:08x} {word:08x}')
+ addr += 4