aboutsummaryrefslogtreecommitdiff
path: root/board-js2x/slof/tree.fs
diff options
context:
space:
mode:
Diffstat (limited to 'board-js2x/slof/tree.fs')
-rw-r--r--board-js2x/slof/tree.fs194
1 files changed, 150 insertions, 44 deletions
diff --git a/board-js2x/slof/tree.fs b/board-js2x/slof/tree.fs
index 6063637..6f8c1b1 100644
--- a/board-js2x/slof/tree.fs
+++ b/board-js2x/slof/tree.fs
@@ -1,21 +1,39 @@
-\ =============================================================================
-\ * Copyright (c) 2004, 2005 IBM Corporation
-\ * All rights reserved.
-\ * This program and the accompanying materials
-\ * are made available under the terms of the BSD License
-\ * which accompanies this distribution, and is available at
-\ * http://www.opensource.org/licenses/bsd-license.php
-\ *
-\ * Contributors:
-\ * IBM Corporation - initial implementation
-\ =============================================================================
+\ *****************************************************************************
+\ * Copyright (c) 2004, 2007 IBM Corporation
+\ * All rights reserved.
+\ * This program and the accompanying materials
+\ * are made available under the terms of the BSD License
+\ * which accompanies this distribution, and is available at
+\ * http://www.opensource.org/licenses/bsd-license.php
+\ *
+\ * Contributors:
+\ * IBM Corporation - initial implementation
+\ ****************************************************************************/
+400 cp
-\ The root of the device tree and some of its kids.
+0 value puid
+
+: >conf-rtas ( config-addr -- config-addr )
+ puid f2000000 >= IF dup ffff > IF 1000000 + THEN THEN puid + ;
+
+: rtas-config-b@ ( config-addr -- value ) >conf-rtas rb@ ;
+: rtas-config-b! ( value config-addr -- ) >conf-rtas rb! ;
+: rtas-config-w@ ( config-addr -- value ) >conf-rtas rw@-le ;
+: rtas-config-w! ( value config-addr -- ) >conf-rtas rw!-le ;
+: rtas-config-l@ ( config-addr -- value ) >conf-rtas rl@-le ;
+: rtas-config-l! ( value config-addr -- ) >conf-rtas rl!-le ;
+
+440 cp
-new-device s" /" full-name
+#include "pci-scan.fs"
+
+480 cp
+
+\ The root of the device tree and some of its kids.
-s" /" device-name
+s" /" find-device
+vpd-read-model encode-string s" model" property
2 encode-int s" #address-cells" property
2 encode-int s" #size-cells" property
@@ -24,63 +42,151 @@ s" /" device-name
0 encode-int+ f8050000 encode-int+ s" platform-open-pic" property
\ Yaboot is stupid. Without this, it can't/won't find /etc/yaboot.conf.
-s" chrp we are not, but smart yaboot is not" device-type
+s" chrp SLOF based 970 blade" device-type
\ To get linux-2.6.10 and later to work out-of-the-box.
s" Momentum,Maple" compatible
+\ See 3.6.5, and the PowerPC OF binding document.
+new-device
+s" mmu" 2dup device-name device-type
+0 0 s" translations" property
+
: open true ;
: close ;
-\ See 3.5.
-new-device s" /openprom" full-name
-s" openprom" device-name
-s" SlimLine Open Firmware (SLOF) version 0.0" encode-string s" model" property
-0 0 s" relative-addressing" property
finish-device
-\ See 3.5.
-new-device s" /chosen" full-name
-s" chosen" device-name
+new-device flash-addr set-unit-64
+ s" flash" 2dup device-name device-type
+ 0 encode-int flash-addr encode-int+
+ 0 encode-int+ get-flash-size encode-int+ s" reg" property
+ get-flash-size encode-int s" #bytes" property
+ 0 0 s" used-by-rtas" property
+ : open true ;
+ : close ;
finish-device
-\ See 3.6.5, and the PowerPC OF binding document.
-new-device s" /mmu" full-name
-s" mmu" 2dup device-name device-type
-0 0 s" translations" property
+4a0 cp
+
+new-device nvram-base set-unit-64
+ s" nvram" 2dup device-name device-type
+ nvram-size encode-int s" #bytes" property
+ 0 encode-int nvram-base encode-int+
+ 0 encode-int+ nvram-size encode-int+ s" reg" property
+ get-node node>path s" nvram" 2swap set-alias
+ : open true ;
+ : close ;
finish-device
-INCLUDE hw/memory.fs
-INCLUDE hw/mpic.fs
-INCLUDE hw/dart.fs
-INCLUDE hw/ht.fs
+4c0 cp
+
+#include "memory.fs"
+
+500 cp
+
+#include "mpic.fs"
+
+580 cp
+
+#include "dart.fs"
+
+5a0 cp
+
+#include "i2c.fs"
+
+600 cp
+get-node device-end
+620 cp
+\ if it is js21/bimini the fbuffer code is included
+u4? ?include fbuffer.fs
+640 cp
+set-node
+
+690 cp
+
+#include "ht.fs"
+
+6a0 cp
+get-node device-end
+6a8 cp
+\ at this point the SAS controller has been detected and we know
+\ if it is bimini or js21
+\ if it is bimini the fcode evaluator is included
+bimini? ?include evaluator.fs
+6b0 cp
+set-node
+6b8 cp
+
+u4? ?include attu.fs
+6c0 cp
\ See the PowerPC OF binding document.
-new-device s" /cpus" full-name
+new-device
s" cpus" device-name
+
1 encode-int s" #address-cells" property
0 encode-int s" #size-cells" property
-INCLUDE hw/cpu.fs
-: create-cpu-nodes
- master-cpu create-cpu-node
- slave? IF master-cpu 1 xor create-cpu-node THEN ;
-create-cpu-nodes
+: decode-unit 1 hex-decode-unit ;
+: encode-unit 1 hex-encode-unit ;
+
+cpu-mask @ 40 0 DO dup 1 and IF
+i s" cpu.fs" INCLUDED THEN u2/ LOOP drop
+
+: open true ;
+: close ;
finish-device
+master-cpu s" /cpus/@" rot (u.) $cat open-dev encode-int s" cpu" set-chosen
+s" /memory" open-dev encode-int s" memory" set-chosen
+
+6e0 cp
+
+new-device
+ s" rtas" device-name
+
+ rtas-size encode-int s" rtas-size" property
+ 00000001 encode-int s" ibm,flash-block-version" property
+ 00000001 encode-int s" rtas-event-scan-rate" property
+ rtas-create-token-properties
+ 00000001 encode-int s" rtas-version" property
+
+: open true ;
+: close ;
+
+: instantiate-rtas instantiate-rtas ;
+
finish-device
+700 cp
+device-end
-: set-chosen ( prop len name len -- )
- s" /chosen" find-package drop set-property ;
+\ Hack for AIX.
+s" /options" find-device
+ \ s" 33554432" encode-string s" load-base" property
+ s" 16384" encode-string s" load-base" property
+device-end
+
+\ See 3.5.
+s" /openprom" find-device
+ s" SLOF," slof-build-id $cat encode-string s" model" property
+ 0 0 s" relative-addressing" property
+device-end
+
+s" /aliases" find-device
+ : open true ;
+ : close ;
+device-end
-master-cpu s" /cpus/cpu@" rot (u.) $cat open-dev encode-int s" cpu" set-chosen
-s" /memory" open-dev encode-int s" memory" set-chosen
s" /mmu" open-dev encode-int s" mmu" set-chosen
-: io open-dev dup encode-int s" stdout" set-chosen
- encode-int s" stdin" set-chosen ;
+#include "available.fs"
+
+#include <term-io.fs>
+
+u3? IF s" /ht/isa/serial@3f8" io
+ ELSE s" /ht/isa/serial@2f8" io THEN
-s" /ht/isa@4/serial" io