From patchwork Wed Jul 27 09:16:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikunj A Dadhania X-Patchwork-Id: 653216 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rzq9g5Tfhz9t27 for ; Wed, 27 Jul 2016 19:16:23 +1000 (AEST) Received: from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3rzq9g4bvtzDqyR for ; Wed, 27 Jul 2016 19:16:23 +1000 (AEST) X-Original-To: slof@lists.ozlabs.org Delivered-To: slof@lists.ozlabs.org Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3rzq9c0YjPzDqTR for ; Wed, 27 Jul 2016 19:16:19 +1000 (AEST) Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u6R9Ebr3059389 for ; Wed, 27 Jul 2016 05:16:16 -0400 Received: from e23smtp07.au.ibm.com (e23smtp07.au.ibm.com [202.81.31.140]) by mx0b-001b2d01.pphosted.com with ESMTP id 24dnc7f4su-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 27 Jul 2016 05:16:16 -0400 Received: from localhost by e23smtp07.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 27 Jul 2016 19:16:13 +1000 Received: from d23dlp01.au.ibm.com (202.81.31.203) by e23smtp07.au.ibm.com (202.81.31.204) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 27 Jul 2016 19:16:10 +1000 X-IBM-Helo: d23dlp01.au.ibm.com X-IBM-MailFrom: nikunj@linux.vnet.ibm.com X-IBM-RcptTo: slof@lists.ozlabs.org Received: from d23relay08.au.ibm.com (d23relay08.au.ibm.com [9.185.71.33]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id A5F8A2CE805A for ; Wed, 27 Jul 2016 19:16:09 +1000 (EST) Received: from d23av06.au.ibm.com (d23av06.au.ibm.com [9.190.235.151]) by d23relay08.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u6R9G9bX30015740 for ; Wed, 27 Jul 2016 19:16:09 +1000 Received: from d23av06.au.ibm.com (localhost [127.0.0.1]) by d23av06.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u6R9G7jm003919 for ; Wed, 27 Jul 2016 19:16:08 +1000 Received: from abhimanyu.in.ibm.com ([9.79.202.145]) by d23av06.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u6R9G5St003818; Wed, 27 Jul 2016 19:16:06 +1000 From: Nikunj A Dadhania To: slof@lists.ozlabs.org Date: Wed, 27 Jul 2016 14:46:02 +0530 X-Mailer: git-send-email 2.7.4 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16072709-0044-0000-0000-000001C6B85F X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16072709-0045-0000-0000-00000533C1C0 Message-Id: <1469610962-13335-1-git-send-email-nikunj@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-07-27_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1607270096 Subject: [SLOF] [PATCH v1] Remove dependency on cpu/@0 for booting X-BeenThere: slof@lists.ozlabs.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Patches for https://github.com/aik/SLOF" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: thuth@redhat.com, bharata@linux.vnet.ibm.com MIME-Version: 1.0 Errors-To: slof-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "SLOF" With the addition of cpu hotplug in QEMU, cpu@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 Signed-off-by: Nikunj A Dadhania --- 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@0" open-dev encode-int s" memory" set-chosen 6e0 cp