[SLOF] [PATCH slof v5 3/6] fdt: Pass the resulting device tree to QEMU

Alexey Kardashevskiy aik at ozlabs.ru
Mon Oct 16 19:35:11 AEDT 2017


On 16/10/17 19:02, Segher Boessenkool wrote:
> On Mon, Oct 16, 2017 at 06:32:17PM +1100, Alexey Kardashevskiy wrote:
>> +: fdt-boot-cpu ( -- bootcpu )
>> +    s" cpu" s" /chosen" find-node get-property 0<> IF 0 EXIT THEN
>> +    decode-int
>> +    nip nip ihandle>phandle
>> +    s" reg" rot get-property 0<> IF 0 EXIT THEN
>> +    decode-int
>> +    nip nip
>> +;
> 
> 0<> IF   is exactly the same as just   IF   :-)

Right, it was 0= before I ended up with this variant :)


> 
> There is   get-chosen   to make this easier.  The first line then
> becomes:
> 
>    s" cpu" get-chosen 0= IF 0 EXIT THEN
> 
> Is there no variable you can get the boot CPU from directly though?

It does not seem so:

board-qemu/slof/tree.fs

\ Do not assume that cpu0 is available
: set-chosen-cpu
    " /cpus" find-device
    get-node child dup 0= ABORT" CPU not found"
    node>path open-dev encode-int s" cpu" set-chosen
;
set-chosen-cpu



-- 
Alexey


More information about the SLOF mailing list