mdev: add missing file
authorMichael-Luke Jones <mlj28@cam.ac.uk>
Mon, 25 Sep 2006 18:46:53 +0000 (18:46 +0000)
committerMichael-Luke Jones <mlj28@cam.ac.uk>
Mon, 25 Sep 2006 18:46:53 +0000 (18:46 +0000)
packages/mdev/mdev-1.2.1/slugos/loadmicrocode.sh [new file with mode: 0644]

diff --git a/packages/mdev/mdev-1.2.1/slugos/loadmicrocode.sh b/packages/mdev/mdev-1.2.1/slugos/loadmicrocode.sh
new file mode 100644 (file)
index 0000000..ad1a9e7
--- /dev/null
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+# Manual firmware loading with firmware_class
+# Reason: Because I can (or because mdev doesn't support firmware loading)
+# Trigger: Creation of the /dev/ixp4xx_ucode device (this is hacky too, unfortunately)
+
+sleep 1
+
+# Cancel NPE-A microcode upload
+echo -1 > /sys/class/firmware/ixp4xx_npe.0/loading
+
+sleep 1
+
+# Test for NPE-B presence
+
+if test -f /lib/firmware/NPE-B; then
+    # Upload NPE-B microcode
+    echo 1 > /sys/class/firmware/ixp4xx_npe.1/loading
+    cat /lib/firmware/NPE-B > /sys/class/firmware/ixp4xx_npe.1/data
+    echo 0 > /sys/class/firmware/ixp4xx_npe.1/loading
+else
+    # Cancel NPE-B microcode upload
+    echo -1 > /sys/class/firmware/ixp4xx_npe.1/loading
+fi
+
+sleep 1
+
+# Cancel NPE-C microcode upload
+echo -1 > /sys/class/firmware/ixp4xx_npe.2/loading