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

Alexey Kardashevskiy aik at ozlabs.ru
Wed Aug 3 17:02:34 AEST 2016


On 03/08/16 15:24, 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>

This is better, applied :)


> ---
>  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..46f7e8f 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"
> +    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"
> +    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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.ozlabs.org/pipermail/slof/attachments/20160803/adc898a4/attachment.sig>


More information about the SLOF mailing list