From patchwork Tue Oct 22 09:24:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Maxim Polyakov X-Patchwork-Id: 1181171 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 46y7Pf59Mlz9sPh for ; Tue, 22 Oct 2019 20:24:38 +1100 (AEDT) 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="JzqDA2b/"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46y7Pd54sVzDqLq for ; Tue, 22 Oct 2019 20:24:37 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=yadro.com (client-ip=89.207.88.252; 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="JzqDA2b/"; dkim-atps=neutral Received: from mta-01.yadro.com (mta-02.yadro.com [89.207.88.252]) (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 46y7PV6RhczDqL9 for ; Tue, 22 Oct 2019 20:24:30 +1100 (AEDT) Received: from localhost (unknown [127.0.0.1]) by mta-01.yadro.com (Postfix) with ESMTP id E35F742A6D; Tue, 22 Oct 2019 09:24:27 +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=1571736266; x=1573550667; bh=9ZFM5j+brIBdqBELqgFLpbeF4 a9mZZEW3u+uXwhEpL0=; b=JzqDA2b/iWRh+eKe6Np9uHSp/6weKP4CrukwWyXgl 60zF8/YDi8SnFQbtgrwp8ZQdl4JZ+V438YvfJabdua0PuwPaa5BQXC1ME5Qdn6qt /nxhUpKCBvOkHf4XG8Y9npKUNjV0onEXIKHHLES0XE/U+Xm5JEf3dUZ1V1+StBR3 24= 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 ajzNwiK8Hcfq; Tue, 22 Oct 2019 12:24:26 +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 8B810411F8; Tue, 22 Oct 2019 12:24:26 +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; Tue, 22 Oct 2019 12:24:26 +0300 Date: Tue, 22 Oct 2019 12:24:26 +0300 From: Maxim Polyakov To: Oliver O'Halloran , Jeremy Kerr , , Maxim Polyakov Message-ID: <20191022092424.GA17836@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 v2] 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" 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. However, in the future, need to add some property that contains the size of the flash device instead of "reg". 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 da746e8..35b876a 100644 --- a/core/opal.c +++ b/core/opal.c @@ -392,8 +392,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",