[SLOF] [PATCH v1] Remove dependency on cpu/@0 for booting

Alexey Kardashevskiy aik at ozlabs.ru
Wed Aug 3 13:47:28 AEST 2016


On 03/08/16 13:18, Alexey Kardashevskiy wrote:
> On 27/07/16 19:16, Nikunj A Dadhania wrote:
>> With the addition of cpu hotplug in QEMU, cpu at 0 can be removed as well.
>> SLOF should not depend on it. Find the first child in the "/cpus" node
>> and get the timer base frequency and set it as the chosen cpu as well
>>
>> Reported-by: Bharata B Rao <bharata at linux.vnet.ibm.com>
>> Signed-off-by: Nikunj A Dadhania <nikunj at linux.vnet.ibm.com>
> 
> 
> 
> Thanks, applied.

Oops. No, not applied.

/home/aik/qemu-system-ppc64 -enable-kvm -m 4G \
-trace events=qemu_trace_events -nodefaults \
-chardev stdio,id=STDIO0,signal=off,mux=on \
-device spapr-vty,id=svty0,chardev=STDIO0,reg=0x71000100 \
-mon id=MON0,chardev=STDIO0,mode=readline -nographic -vga none \
-machine pseries -smp 16,threads=8 -L /home/aik/t/qemu-ppc64-bios/ \
-bios ./slof.bin \
-chardev socket,id=SOCKET0,server,nowait,host=localhost,port=30000 \
-mon chardev=SOCKET0,mode=readline

produces SLOF prompt with:

-2 >



> 
> 
> 
>> ---
>>  board-qemu/slof/tree.fs | 13 +++++++++++--
>>  1 file changed, 11 insertions(+), 2 deletions(-)
>>
>> diff --git a/board-qemu/slof/tree.fs b/board-qemu/slof/tree.fs
>> index 78dafab..76a9ecc 100644
>> --- a/board-qemu/slof/tree.fs
>> +++ b/board-qemu/slof/tree.fs
>> @@ -45,7 +45,9 @@ device-end
>>  
>>  \ Fixup timebase frequency from device-tree
>>  : fixup-tbfreq
>> -    " /cpus/@0" find-device
>> +    " /cpus" find-device
>> +    get-node child dup 0= ABORT" CPU not found" THEN
>> +    set-node
>>      " timebase-frequency" get-node get-package-property IF
>>          2drop
>>      ELSE
>> @@ -167,7 +169,14 @@ populate-pci-busses
>>  
>>  6c0 cp
>>  
>> -s" /cpus/@0" open-dev encode-int s" cpu" set-chosen
>> +\ Do not assume that cpu0 is available
>> +: set-chosen-cpu
>> +    " /cpus" find-device
>> +    get-node child dup 0= ABORT" CPU not found" THEN
>> +    node>path open-dev encode-int s" cpu" set-chosen
>> +;
>> +set-chosen-cpu
>> +
>>  s" /memory at 0" open-dev encode-int s" memory" set-chosen
>>  
>>  6e0 cp
>>
> 
> 


-- 
Alexey


More information about the SLOF mailing list