On Mon, 15 Jul 2019, Segher Boessenkool wrote:
0 > " /pci/ATY" select-dev ok
It's called open-dev since ages, fwiw.
https://github.com/openbios/openbios/blob/master/forth/admin/devices.fs#L49
\ Open selected device node and make it the current instance \ section H.8 errata: pre OpenFirmware, but Sun OBP compatible : select-dev ( -- ) open-dev dup 0= abort" failed opening parent." dup to my-self ihandle>phandle active-package! ;
(actually definition of this word seems wrong, it says ( -- ) but really takes the same values as open-dev ( dev-str dev-len -- )? The following just hangs:
dev /pci/ATY select-dev
But I get same results with open-dev:
0 > " /pci/ATY" open-dev to my-self ok 0 > my-space ok 1 > . 0 ok 0 > my-address ok 2 > . 0 ok 1 > . 0 ok 0 > my-unit ok 3 > . 7800 ok 2 > . 0 ok 1 > . 0 ok 0 >
0 > my-self . 1fc5abfc ok 0 > my-space ok 1 > . 0 ok
This one should be 7800
0 > my-address ok 2 > . 0 ok 1 > . 0 ok 0 > my-unit ok 3 > . 7800 ok 2 > . 0 ok 1 > . 0 ok
Those all look fine.
I think these my-* values should have some numbers instead of 0. What's the problem here? Looks like it returns first value from reg but shouldn't it return something from assigned-addresses instead?
my-address is two zeroes for configuration space addresses. But my-space shouldn't be zero, it's 7800 here. my-unit should be exactly identical to my-address my-space , but it isn't for you?
These words are defined here:
https://github.com/openbios/openbios/blob/master/forth/device/package.fs#L17...
but I don't understand how these work and why they don't return correct values.
Regards, BALATON Zoltan