MDMA is a good time (#591)

* MDMA is a good time

* fast

* cleanup
This commit is contained in:
Adeeb Shihadeh
2026-05-05 11:33:06 -07:00
committed by GitHub
parent 69f3f02add
commit e200b92d88
4 changed files with 15 additions and 2 deletions
+5 -2
View File
@@ -4,10 +4,13 @@ set -e
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
cd $DIR
scripts/mdma.py reboot-qdl --missing-ok
for part in aop abl xbl xbl_config devcfg; do
tools/qdl flash ${part}_a $DIR/firmware/$part.img
tools/qdl flash ${part}_b $DIR/firmware/$part.img
done
./flash_kernel.sh
./flash_system.sh
tools/qdl flash boot $DIR/output/boot.img
tools/qdl flash system $DIR/output/system.img
tools/qdl reset
+1
View File
@@ -4,4 +4,5 @@ set -e
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
cd $DIR
scripts/mdma.py reboot-qdl --missing-ok
tools/qdl flash boot $DIR/output/boot.img
+1
View File
@@ -4,5 +4,6 @@ set -e
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
cd $DIR
scripts/mdma.py reboot-qdl --missing-ok
tools/qdl flash system $DIR/output/system.img
tools/qdl reset
+8
View File
@@ -51,6 +51,9 @@ class Mdma:
raise SystemExit(f"could not find hub {vid:04x}:{pid:04x}")
return hub
def available(self):
return os.path.exists(SERIAL_DEV)
def reg(self, addr, value=None, size=4):
dev = usb.core.find(idVendor=Pins.HFC_VID, idProduct=Pins.HFC_PID)
if value is None:
@@ -157,6 +160,7 @@ if __name__ == "__main__":
}
parser = argparse.ArgumentParser()
parser.add_argument("--missing-ok", action="store_true", help="continue successfully when no MDMA is connected")
subparsers = parser.add_subparsers(dest="command", required=True)
for cmd, (_, hlp) in cmds.items():
subparsers.add_parser(cmd, help=hlp)
@@ -165,4 +169,8 @@ if __name__ == "__main__":
raise SystemExit(0)
args = parser.parse_args()
if not Mdma().available():
print("MDMA not found.")
raise SystemExit(0 if args.missing_ok else 1)
cmds[args.command][0]()