diff options
author | Thomas Huth <thuth@linux.vnet.ibm.com> | 2011-11-09 17:22:32 +0100 |
---|---|---|
committer | Thomas Huth <thuth@linux.vnet.ibm.com> | 2011-11-17 12:10:37 +0100 |
commit | 5feccc2057f712d0813af0c5d57994c72e5fee2d (patch) | |
tree | 0036be96b5272b22ae83c9894085df14ffdad1b1 | |
parent | 4321b74de652c82eeaa84797dff763e9e048ea75 (diff) | |
download | SLOF-5feccc2057f712d0813af0c5d57994c72e5fee2d.zip SLOF-5feccc2057f712d0813af0c5d57994c72e5fee2d.tar.gz SLOF-5feccc2057f712d0813af0c5d57994c72e5fee2d.tar.bz2 |
FCODE: Implemented missing tokens
While reviewing our FCODE table, some missing FCODE tokens have been discovered.
According to the IEEE 1275 specification, some of them are marked as obsolete
and optional, but some of them are also marked as required.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
-rw-r--r-- | slof/fs/fcode/1275.fs | 73 | ||||
-rw-r--r-- | slof/fs/fcode/tokens.fs | 30 |
2 files changed, 88 insertions, 15 deletions
diff --git a/slof/fs/fcode/1275.fs b/slof/fs/fcode/1275.fs index 2fa3cdc..f027398 100644 --- a/slof/fs/fcode/1275.fs +++ b/slof/fs/fcode/1275.fs @@ -399,3 +399,76 @@ THEN ['] c@ to fcode-rb@ ; + +\ Destroy virtual mapping (should maybe also update "address" property here?) +: free-virtual ( virt size -- ) + s" map-out" $call-parent +; + +\ Map the specified region, return virtual address +: map-low ( phys.lo ... size -- virt ) + my-space swap s" map-in" $call-parent +; + +\ Get MAC address +: mac-address ( -- mac-str mac-len ) + s" local-mac-address" get-my-property IF + 0 0 + THEN +; + +\ Output line and column number - not used yet +VARIABLE #line +0 #line ! +VARIABLE #out +0 #out ! + +\ Display device status +: display-status ( n -- ) + ." Device status: " . cr +; + +\ Obsolete variables: +VARIABLE group-code +0 group-code ! + +\ Obsolete: Allocate memory for DMA +: dma-alloc ( byte -- virtual ) + s" dma-alloc" $call-parent +; + +\ Obsolete: Get params property +: my-params ( -- addr len ) + s" params" get-my-property IF + 0 0 + THEN +; + +\ Obsolete: Convert SBus interrupt level to CPU interrupt level +: sbus-intr>cpu ( sbus-intr# -- cpu-intr# ) +; + +\ Obsolete: Set "intr" property +: intr ( interrupt# vector -- ) + >r sbus-intr>cpu encode-int r> encode-int+ s" intr" property +; + +\ Obsolete: Create the "name" property +: driver ( addr len -- ) + encode-string s" name" property +; + +\ Obsolete: Return type of CPU +: processor-type ( -- cpu-type ) + 0 +; + +\ Obsolete: Return firmware version +: firmware-version ( -- n ) + 10000 \ Just a dummy value +; + +\ Obsolete: Return fcode-version +: fcode-version ( -- n ) + fcode-revision +; diff --git a/slof/fs/fcode/tokens.fs b/slof/fs/fcode/tokens.fs index 6f3d4ae..f5d7672 100644 --- a/slof/fs/fcode/tokens.fs +++ b/slof/fs/fcode/tokens.fs @@ -182,8 +182,8 @@ reset-token-table ' type 0 90 set-token ' (cr 0 91 set-token ' cr 0 92 set-token -\ ' #out 0 93 set-token -\ ' #line 0 94 set-token +' #out 0 93 set-token +' #line 0 94 set-token ' hold 0 95 set-token ' <# 0 96 set-token ' u#> 0 97 set-token @@ -275,16 +275,16 @@ reset-token-table ' end1 0 FF set-token \ 0 100 set-token \ reserved -\ ' dma-alloc 0 101 set-token \ Obsolete +' dma-alloc 0 101 set-token \ Obsolete ' my-address 0 102 set-token ' my-space 0 103 set-token \ ' memmap 0 104 set-token \ Obsolete -\ ' free-virtual 0 105 set-token \ TODO +' free-virtual 0 105 set-token \ ' >physical 0 106 set-token \ Obsolete \ Tokens 0x107 to 0x10e are reserved -\ ' my-params 0 10f set-token \ Obsolete +' my-params 0 10f set-token \ Obsolete ' property 0 110 set-token ' encode-int 0 111 set-token ' encode+ 0 112 set-token @@ -292,8 +292,8 @@ reset-token-table ' encode-string 0 114 set-token ' encode-bytes 0 115 set-token ' reg 0 116 set-token -\ ' intr 0 117 set-token \ Obsolete -\ ' driver 0 118 set-token \ Obsolete +' intr 0 117 set-token \ Obsolete +' driver 0 118 set-token \ Obsolete ' model 0 119 set-token ' device-type 0 11A set-token ' parse-2int 0 11B set-token @@ -302,9 +302,9 @@ reset-token-table ' is-selftest 0 11E set-token ' new-device 0 11F set-token ' diagnostic-mode? 0 120 set-token -\ ' display-status 0 121 set-token \ TODO +' display-status 0 121 set-token \ Maybe obsolete ' memory-test-suite 0 122 set-token -\ ' group-code 0 123 set-token \ Obsolete +' group-code 0 123 set-token \ Obsolete ' mask 0 124 set-token ' get-msecs 0 125 set-token ' ms 0 126 set-token @@ -315,8 +315,8 @@ reset-token-table \ Tokens 0x12B to 0x12F are reserved -\ ' map-low 0 130 set-token \ TODO -\ ' sbus-intr>cpu 0 131 set-token \ TODO +' map-low 0 130 set-token +' sbus-intr>cpu 0 131 set-token \ Obsolete \ Tokens 0x132 to 0x14f are reserved @@ -377,7 +377,7 @@ reset-token-table \ ' xmit-packet 0 1A1 set-token \ Historical, not supported \ ' poll-packet 0 1A2 set-token \ Historical, not supported \ 0 1A3 set-token \ reserved -\ ' mac-address 0 1A4 set-token \ TODO +' mac-address 0 1A4 set-token \ Tokens 0x1A5 to 0x200 are reserved @@ -396,9 +396,9 @@ reset-token-table ' my-unit 0 20D set-token ' $call-method 0 20E set-token ' $open-package 0 20F set-token -\ ' processor-type 0 210 set-token \ Obsolete -\ ' firmware-version 0 211 set-token \ Obsolete -\ ' fcode-version 0 212 set-token \ Obsolete +' processor-type 0 210 set-token \ Obsolete +' firmware-version 0 211 set-token \ Obsolete +' fcode-version 0 212 set-token \ Obsolete \ ' alarm 0 213 set-token \ TODO ' (is-user-word) 0 214 set-token ' suspend-fcode 0 215 set-token |