From patchwork Wed Jul 27 04:17:47 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: 653066 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rzhYW2grgz9t1f for ; Wed, 27 Jul 2016 14:18:07 +1000 (AEST) Received: from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3rzhYW1pRGzDqgf for ; Wed, 27 Jul 2016 14:18:07 +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 3rzhYQ66bczDqYr for ; Wed, 27 Jul 2016 14:18:02 +1000 (AEST) Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u6R4DeNB062875 for ; Wed, 27 Jul 2016 00:17:59 -0400 Received: from e28smtp09.in.ibm.com (e28smtp09.in.ibm.com [125.16.236.9]) by mx0a-001b2d01.pphosted.com with ESMTP id 24e1bt01py-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 27 Jul 2016 00:17:59 -0400 Received: from localhost by e28smtp09.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 27 Jul 2016 09:47:56 +0530 Received: from d28dlp02.in.ibm.com (9.184.220.127) by e28smtp09.in.ibm.com (192.168.1.139) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 27 Jul 2016 09:47:53 +0530 X-IBM-Helo: d28dlp02.in.ibm.com X-IBM-MailFrom: nikunj@linux.vnet.ibm.com X-IBM-RcptTo: slof@lists.ozlabs.org Received: from d28relay05.in.ibm.com (d28relay05.in.ibm.com [9.184.220.62]) by d28dlp02.in.ibm.com (Postfix) with ESMTP id 5B8BC3940065 for ; Wed, 27 Jul 2016 09:47:53 +0530 (IST) Received: from d28av02.in.ibm.com (d28av02.in.ibm.com [9.184.220.64]) by d28relay05.in.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u6R4GMNC21365080 for ; Wed, 27 Jul 2016 09:46:22 +0530 Received: from d28av02.in.ibm.com (localhost [127.0.0.1]) by d28av02.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u6R4HqgV009766 for ; Wed, 27 Jul 2016 09:47:52 +0530 Received: from abhimanyu.in.ibm.com ([9.79.202.145]) by d28av02.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u6R4HoY1009711; Wed, 27 Jul 2016 09:47:50 +0530 From: Nikunj A Dadhania To: slof@lists.ozlabs.org Date: Wed, 27 Jul 2016 09:47:47 +0530 X-Mailer: git-send-email 2.7.4 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16072704-0060-0000-0000-000000E432A4 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16072704-0061-0000-0000-00000E8D1E5A Message-Id: <1469593067-20872-1-git-send-email-nikunj@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-07-27_01:, , 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-1607270045 Subject: [SLOF] [PATCH] 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..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@0" open-dev encode-int s" memory" set-chosen 6e0 cp