|
|
1.1 ! root 1: \ ***************************************************************************** ! 2: \ * Copyright (c) 2004, 2011 IBM Corporation ! 3: \ * All rights reserved. ! 4: \ * This program and the accompanying materials ! 5: \ * are made available under the terms of the BSD License ! 6: \ * which accompanies this distribution, and is available at ! 7: \ * http://www.opensource.org/licenses/bsd-license.php ! 8: \ * ! 9: \ * Contributors: ! 10: \ * IBM Corporation - initial implementation ! 11: \ ****************************************************************************/ ! 12: ! 13: : strequal ( str1 len1 str2 len2 -- flag ) ! 14: rot dup rot = IF comp 0= ELSE 2drop drop 0 THEN ; ! 15: ! 16: 400 cp ! 17: ! 18: 0 value puid ! 19: ! 20: 440 cp ! 21: ! 22: 480 cp ! 23: ! 24: \ The root of the device tree and some of its kids. ! 25: " /" find-device ! 26: ! 27: " QEMU" encode-string s" model" property ! 28: ! 29: 2 encode-int s" #address-cells" property ! 30: 2 encode-int s" #size-cells" property ! 31: ! 32: \ Yaboot is stupid. Without this, it can't/won't find /etc/yaboot.conf. ! 33: s" chrp" device-type ! 34: ! 35: \ See 3.6.5, and the PowerPC OF binding document. ! 36: new-device ! 37: s" mmu" 2dup device-name device-type ! 38: 0 0 s" translations" property ! 39: ! 40: : open true ; ! 41: : close ; ! 42: ! 43: finish-device ! 44: device-end ! 45: ! 46: 4c0 cp ! 47: ! 48: \ Fixup timebase frequency from device-tree ! 49: : fixup-tbfreq ! 50: " /cpus/@0" find-device ! 51: " timebase-frequency" get-node get-package-property IF ! 52: 2drop ! 53: ELSE ! 54: decode-int to tb-frequency 2drop ! 55: THEN ! 56: device-end ! 57: ; ! 58: fixup-tbfreq ! 59: ! 60: 4d0 cp ! 61: ! 62: \ Grab rtas from qemu ! 63: #include "rtas.fs" ! 64: ! 65: 500 cp ! 66: ! 67: : populate-vios ( -- ) ! 68: \ Populate the /vdevice children with their methods ! 69: \ WARNING: Quite a few SLOFisms here like get-node, set-node, ... ! 70: ! 71: ." Populating /vdevice methods" cr ! 72: " /vdevice" find-device get-node child ! 73: BEGIN ! 74: dup 0 <> ! 75: WHILE ! 76: dup set-node ! 77: dup " compatible" rot get-package-property 0 = IF ! 78: drop dup from-cstring ! 79: 2dup " hvterm1" strequal IF ! 80: " vio-hvterm.fs" included ! 81: THEN ! 82: 2dup " IBM,v-scsi" strequal IF ! 83: " vio-vscsi.fs" included ! 84: THEN ! 85: 2dup " IBM,l-lan" strequal IF ! 86: " vio-veth.fs" included ! 87: THEN ! 88: 2drop ! 89: THEN ! 90: peer ! 91: REPEAT drop ! 92: ! 93: device-end ! 94: ; ! 95: ! 96: \ Now do it ! 97: populate-vios ! 98: ! 99: 580 cp ! 100: ! 101: 5a0 cp ! 102: ! 103: 600 cp ! 104: ! 105: \ Add rtas cleanup last ! 106: ' rtas-quiesce add-quiesce-xt ! 107: ! 108: 640 cp ! 109: ! 110: 690 cp ! 111: ! 112: 6a0 cp ! 113: ! 114: 6a8 cp ! 115: ! 116: 6b0 cp ! 117: ! 118: 6b8 cp ! 119: ! 120: 6c0 cp ! 121: ! 122: s" /cpus/@0" open-dev encode-int s" cpu" set-chosen ! 123: s" /memory" open-dev encode-int s" memory" set-chosen ! 124: ! 125: 6e0 cp ! 126: ! 127: 700 cp ! 128: ! 129: \ See 3.5. ! 130: s" /openprom" find-device ! 131: s" SLOF," slof-build-id here swap rmove here slof-build-id nip $cat encode-string s" model" property ! 132: 0 0 s" relative-addressing" property ! 133: device-end ! 134: ! 135: s" /aliases" find-device ! 136: : open true ; ! 137: : close ; ! 138: device-end ! 139: ! 140: s" /mmu" open-dev encode-int s" mmu" set-chosen ! 141: ! 142: #include "available.fs" ! 143: ! 144: \ Setup terminal IO ! 145: ! 146: #include <term-io.fs> ! 147: ! 148: " hvterm" find-alias IF drop ! 149: " hvterm" io ! 150: THEN
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.