Seems I could add config-1@ as a colon definition, however I’m not sure how too deal with r1@?
: rl@-le rl@ lbflip ; : >config f1000000 + ; : config-l@ >config cr ." config-l@ " dup . rl@-le space dup . ;
Just can’t figure how r1@ is implemented in SLOF?
grep -rnw /Users/jam/Downloads/SLOF-master -e 'rl@' /Users/jam/Downloads/SLOF-master/board-js2x/slof/OF.fs:24:f8000000 rl@ CONSTANT uni-n-version /Users/jam/Downloads/SLOF-master/board-js2x/slof/OF.fs:145:u4? IF f8002100 rl@ 0= ELSE false THEN ?INCLUDE u4-mem.fs /Users/jam/Downloads/SLOF-master/board-js2x/slof/OF.fs:182:f8000050 rl@ CONSTANT master-cpu /Users/jam/Downloads/SLOF-master/board-js2x/slof/OF.fs:271: f8000000 rl@ 4 rshift s" (" type 1 0.r s" ." type /Users/jam/Downloads/SLOF-master/board-js2x/slof/OF.fs:272: f8000000 rl@ f and 1 0.r s" )" type cr /Users/jam/Downloads/SLOF-master/board-js2x/slof/pci-bridge_1022_7460.fs:75:: hpet@ >hpet rl@-le ; /Users/jam/Downloads/SLOF-master/board-js2x/slof/pci-bridge_1022_7460.fs:117: dup 30 + rl@ 1 and 1 = IF /Users/jam/Downloads/SLOF-master/board-js2x/slof/pci-bridge_1022_7460.fs:118: dup 30 + rl@ 1 or /Users/jam/Downloads/SLOF-master/board-js2x/slof/pci-bridge_1022_7460.fs:126: BEGIN dup 34 + rl@ 1000 and 0= 2 ms UNTIL /Users/jam/Downloads/SLOF-master/board-js2x/slof/pci-bridge_1022_7460.fs:135: BEGIN dup 30 + rl@ 2 and 0= 2 ms UNTIL drop /Users/jam/Downloads/SLOF-master/board-js2x/slof/citrine.fs:28:: ioa@ >ioa rl@-le ; /Users/jam/Downloads/SLOF-master/board-js2x/slof/ht.fs:46:\ : config-l@ >config cr ." config-l@ " dup . rl@-le space dup . ; /Users/jam/Downloads/SLOF-master/board-js2x/slof/ht.fs:53:: config-l@ >config rl@-le ; /Users/jam/Downloads/SLOF-master/board-js2x/slof/ht.fs:83:f8070200 rl@ fffffff0 and f8070200 rl! /Users/jam/Downloads/SLOF-master/board-js2x/slof/ht.fs:106:: ldtstop f8000840 rl@ 40000 or f8000840 rl! ; /Users/jam/Downloads/SLOF-master/board-js2x/slof/ht.fs:108:: wait-for-done BEGIN f8070110 rl@ 30 and UNTIL /Users/jam/Downloads/SLOF-master/board-js2x/slof/ht.fs:110:: ldtstop1 f8000840 rl@ dup 20000 or f8000840 rl! delay /Users/jam/Downloads/SLOF-master/board-js2x/slof/ht.fs:114:: dumpht cr f8070110 rl@ 8 0.r space 8b4 config-l@ 8 0.r /Users/jam/Downloads/SLOF-master/board-js2x/slof/ht.fs:117:: clearht f8070110 dup rl@ swap rl! /Users/jam/Downloads/SLOF-master/board-js2x/slof/ht.fs:118: f8070120 dup rl@ swap rl! /Users/jam/Downloads/SLOF-master/board-js2x/slof/i2c.fs:23:: i2c@ >i2c rl@ ; /Users/jam/Downloads/SLOF-master/board-js2x/slof/pci-device_1002_515e.fs:35:: reg-rl@ regs-addr + rl@-le ; /Users/jam/Downloads/SLOF-master/board-js2x/slof/pci-device_1002_515e.fs:206: 2 pick dup reg-rl@ /Users/jam/Downloads/SLOF-master/board-js2x/slof/pci-device_1002_515e.fs:254:: CLK-CNTL-INDEX@ 8 ( CLK_CNTL_INDEX ) reg-rl@ ; /Users/jam/Downloads/SLOF-master/board-js2x/slof/pci-device_1002_515e.fs:262:: CLKDATA@ h# 0c ( CLK_CNTL_DATA ) reg-rl@ ; /Users/jam/Downloads/SLOF-master/board-js2x/slof/pci-device_1002_515e.fs:330: h# 158 ( MEM_SDRAM_MODE_REG ) reg-rl@ ; /Users/jam/Downloads/SLOF-master/board-js2x/slof/pci-device_1002_515e.fs:336: H# 150 reg-rl@ ; /Users/jam/Downloads/SLOF-master/board-js2x/slof/pci-device_1002_515e.fs:404: h# 50 reg-rl@ H# FEFFFFFF AND h# 02000200 or \ Clear 24 set 25 and 8-11 to 2 /Users/jam/Downloads/SLOF-master/board-js2x/slof/pci-device_1002_515e.fs:410: h# 50 reg-rl@ H# F8FFFFFF AND h# 03000000 or h# 50 reg-rl! /Users/jam/Downloads/SLOF-master/board-js2x/slof/tree.fs:31:: rtas-config-l@ ( config-addr -- value ) >conf-rtas rl@-le ; /Users/jam/Downloads/SLOF-master/board-js2x/slof/attu.fs:24:f8070200 rl@ fffffff0 and f8070200 rl! /Users/jam/Downloads/SLOF-master/board-js2x/slof/attu.fs:42:: config-l@ >config rl@-le ; /Users/jam/Downloads/SLOF-master/board-js2x/slof/u4-mem.fs:22:: i2c@ >i2c rl@ ; /Users/jam/Downloads/SLOF-master/board-js2x/slof/u4-mem.fs:175:f8000860 rl@ 80000000 or f8000860 rl! 10000 0 DO LOOP /Users/jam/Downloads/SLOF-master/board-js2x/slof/u4-mem.fs:178:: mc@ f8002000 + rl@ ; /Users/jam/Downloads/SLOF-master/board-js2x/slof/ioapic.fs:18:: ioapic@ ( offset -- x ) ioapic rb! ioapic 10 + rl@-le ; /Users/jam/Downloads/SLOF-master/board-js2x/slof/memory.fs:22: 4 lshift f8002200 + rl@ dup 1 and 0= IF drop 0 EXIT THEN /Users/jam/Downloads/SLOF-master/board-js2x/slof/memory.fs:27:: mem-speed-u4 f8000800 rl@ 12 rshift 7 and 4 + d# 200 * 3 / ; /Users/jam/Downloads/SLOF-master/board-js2x/slof/memory.fs:28:: mem-speed-u3 f8000f60 rl@ c rshift f and d# 100 * 3 / ; /Users/jam/Downloads/SLOF-master/slof/fs/little-endian.fs:30:: rl@-le rl@ lbflip ; /Users/jam/Downloads/SLOF-master/slof/fs/little-endian.fs:42:: rl@-be rl@ ; /Users/jam/Downloads/SLOF-master/slof/fs/little-endian.fs:60:: rl@-le rl@ ; /Users/jam/Downloads/SLOF-master/slof/fs/little-endian.fs:72:: rl@-be rl@ lbflip ; /Users/jam/Downloads/SLOF-master/slof/fs/ide.fs:276: rl@-le \ read 32-bit as little endian value /Users/jam/Downloads/SLOF-master/slof/fs/fcode/1275.fs:379:: fc-l@ ( addr -- long ) dup MIN-RAM-SIZE > IF rl@ ELSE l@ THEN ; /Users/jam/Downloads/SLOF-master/slof/fs/fcode/tokens.fs:27: ['] rl@-le 0 234 set-token /Users/jam/Downloads/SLOF-master/slof/fs/fcode/tokens.fs:37: ['] rl@ 0 234 set-token /Users/jam/Downloads/SLOF-master/slof/fs/fcode/tokens.fs:433:fc-set-normal-mmio-tokens \ Set rw@, rw!, rl@, rl!, rx@ and rx! Jamess-Mac-Pro:~ jam$
On May 11, 2018, at 2:38 AM, Jd Lyons via OpenBIOS openbios@openbios.org wrote:
Hmmm…. I think you are on to something there, as I did note that they are words for the device in SLOF, before I execute the FCode.
Seems I need to figure out how to add the config* words to Openbios as that must be what 0xa08 is tripping over.
0 > dev /pci/@1 ok 0 > .properties assigned-addresses 82000830 00000000 83000000 00000000 00010000 82000810 00000000 81000000 00000000 01000000 c3000814 00002100 00000000 00000000 10000000 8200081c 00000000 82000000 00000000 01000000
name vga 76676100 ibm,req#msi 00000001 vendor-id 000010de device-id 00000141 revision-id 000000a2 class-code 00030000 interrupts 00000001 min-grant 00000000 max-latency 00000000 subsystem-id 00000050 subsystem-vendor-id 000010de cache-line-size 00000000 devsel-speed 00000000 ibm,loc-code vfio_vfio-pci:0000:00:01.0 7666696f 5f766669 6f2d7063 693a3030 30303a30 303a3031 2e3000 ibm,my-drc-index 40000008 #address-cells 00000003 #size-cells 00000002 reg 00000800 00000000 00000000 00000000 00000000 02000810 00000000 00000000 00000000 01000000 03000814 00000000 00000000 00000000 10000000 0300081c 00000000 00000000 00000000 01000000 02000830 00000000 00000000 00000000 00010000 ibm,pci-config-space-type 00000001 ok 0 > words setup classfile devicefile dma-map-out dma-map-in dma-free dma-alloc close open config-dump config-l! config-w! config-b! config-l@ config-w@ config-b@ my-puid my-phandle encode-unit decode-unit ok 0 >
On May 10, 2018, at 3:13 PM, Mark Cave-Ayland mark.cave-ayland@ilande.co.uk wrote:
On 10/05/18 11:33, Jd Lyons via OpenBIOS wrote:
On 5/9/18, 11:45 AM, "OpenBIOS on behalf of Mark Cave-Ayland" <openbios-bounces@openbios.org on behalf of mark.cave-ayland@ilande.co.uk> wrote:
I suspect that it's something within that branch failing which is only visible at the final b(>resolve) once the condition is evaluated, so with indentation:
...
Most of that looks fairly normal, so I'd start by looking at the 0x9bd and 0xa08 FCodes which will have been generated further up in your output file.
new-token 0xa08 b(:) b(") ( len=9 ) " config-l@" $call-parent b(;)
new-token 0x9bd b(constant) b(lit) 0x42000014
Okay so there's your first issue in 0xa08 - the PCI config words config-*@ and config-*! aren't (yet) implemented in Forth in OpenBIOS so you'll need to wrap the existing pci_config_read/pci_config_write() functions using something similar to the approach here:
https://github.com/openbios/openbios/commit/74ee111f1ff64415835c4c43b66b1528...
Here you can see that the C function bind_func() to used to call a C function from Forth by binding it to the named Forth word in the dictionary.
ATB,
Mark.
-- OpenBIOS http://openbios.org/ Mailinglist: http://lists.openbios.org/mailman/listinfo Free your System - May the Forth be with you
-- OpenBIOS http://openbios.org/ Mailinglist: http://lists.openbios.org/mailman/listinfo Free your System - May the Forth be with you