From patchwork Wed Apr 24 11:41:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Maxim Polyakov X-Patchwork-Id: 1090093 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44pz1m2r1qz9s4Y for ; Wed, 24 Apr 2019 21:42:04 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=yadro.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=yadro.com header.i=@yadro.com header.b="EeKwpe+e"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 44pz1m0ldvzDqTR for ; Wed, 24 Apr 2019 21:42:04 +1000 (AEST) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=yadro.com (client-ip=89.207.88.251; helo=mta-01.yadro.com; envelope-from=m.polyakov@yadro.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=yadro.com Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=yadro.com header.i=@yadro.com header.b="EeKwpe+e"; dkim-atps=neutral Received: from mta-01.yadro.com (mta-01.yadro.com [89.207.88.251]) (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 44pz1c6pJbzDqT9 for ; Wed, 24 Apr 2019 21:41:56 +1000 (AEST) Received: from localhost (unknown [127.0.0.1]) by mta-01.yadro.com (Postfix) with ESMTP id 5E88441A3E; Wed, 24 Apr 2019 11:41:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yadro.com; h= user-agent:content-transfer-encoding:content-disposition :content-type:content-type:mime-version:message-id:subject :subject:from:from:date:date:received:received:received; s= mta-01; t=1556106110; x=1557920511; bh=QSiP6WapC75wehy8LipsfxmRh hT8E9yBd22s6HUowKE=; b=EeKwpe+e0jquzPUUIWF672rlBD4LMKBSnnk3EKi8s Uv0bl0hI9YY1YvBQbyrP3oCKB/v4VhN3kmMGKGKZTNKeJN4tZ0V49fwWKdVLIJWL gL4fP6M+Qqu31NGPvCZRYD/SPMqgUUrVl7+Y6vgCVmavYkE2Daegl/fH5VrUc3k/ hY= X-Virus-Scanned: amavisd-new at yadro.com Received: from mta-01.yadro.com ([127.0.0.1]) by localhost (mta-01.yadro.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tcOJl8-xrjvZ; Wed, 24 Apr 2019 14:41:50 +0300 (MSK) Received: from T-EXCH-02.corp.yadro.com (t-exch-02.corp.yadro.com [172.17.10.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mta-01.yadro.com (Postfix) with ESMTPS id AF8EF41A62; Wed, 24 Apr 2019 14:41:50 +0300 (MSK) Received: from localhost (172.17.15.1) by T-EXCH-02.corp.yadro.com (172.17.10.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.32; Wed, 24 Apr 2019 14:41:50 +0300 Date: Wed, 24 Apr 2019 14:41:50 +0300 From: Maxim Polyakov To: Message-ID: <20190424114148.GA13164@gmail.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-Originating-IP: [172.17.15.1] X-ClientProxiedBy: T-EXCH-01.corp.yadro.com (172.17.10.101) To T-EXCH-02.corp.yadro.com (172.17.10.102) Subject: [Skiboot] [PATCH] core/opal: Fix reg format for flash@0 node in DT X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" The “reg” property for /ibm,opal/flash@0 node in device tree has invalid format. For this reason, the FWTS on the Linux host displays the following warning: /ibm,opal/flash@0:reg: property has invalid length (8 bytes) (#address-cells == 0, #size-cells == 0) This patch sets the #address-cells/#size-cells to 1 and fixes this problem. Resolve: https://github.com/open-power/skiboot/issues/47 Signed-off-by: Maxim Polyakov --- core/opal.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/core/opal.c b/core/opal.c index 624e2a2..cedff11 100644 --- a/core/opal.c +++ b/core/opal.c @@ -406,8 +406,25 @@ void add_opal_node(void) (uint64_t)(cpu_max_pir + 1) * STACK_SIZE) - SKIBOOT_BASE; opal_node = dt_new_check(dt_root, "ibm,opal"); - dt_add_property_cells(opal_node, "#address-cells", 0); - dt_add_property_cells(opal_node, "#size-cells", 0); + /* + * Since the "ibm,opal" node doesn`t refer to any "bus", + * the "#address-cells" and "#size-cells" being zero is correct. + * However, in this case, the “reg” property that determines the + * size of the flash memory in the child node “flash@0” has an + * invalid format. For this reason, the FWTS on the Linux host + * displays the following warning: + * + * /ibm,opal/flash@0:reg: property has invalid length (8 + * bytes) (#address-cells == 0, #size-cells == 0) + * + * The "#address-cells" and "#size-cells" are set to 1 to fix + * this problem temporarily. + * + * TODO: need to add some property that contains the size of + * the flash device instead of "reg" + */ + dt_add_property_cells(opal_node, "#address-cells", 1); + dt_add_property_cells(opal_node, "#size-cells", 1); if (proc_gen < proc_gen_p9) dt_add_property_strings(opal_node, "compatible", "ibm,opal-v2",