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

David Gibson david at gibson.dropbear.id.au
Wed Jul 27 14:47:30 AEST 2016


On Wed, Jul 27, 2016 at 09:47:47AM +0530, 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>

There are problems within qemu for removing cpu 0 at the moment, and
they probably won't be fixed for a while, but we might as well fix
SLOF in the meantime.

> ---
>  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..5912c1c 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= IF ABORT" start-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= IF ABORT" start-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

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/slof/attachments/20160727/095eaa6b/attachment.sig>


More information about the SLOF mailing list