From patchwork Wed Apr 8 09:35:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Brugger X-Patchwork-Id: 1267830 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=default header.b=0YsWP7XS; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (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 48xzfh45zxz9sRN for ; Wed, 8 Apr 2020 19:35:52 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5E6C481834; Wed, 8 Apr 2020 11:35:42 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="0YsWP7XS"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5B77A81901; Wed, 8 Apr 2020 11:35:40 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id B060281577 for ; Wed, 8 Apr 2020 11:35:37 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=matthias.bgg@kernel.org Received: from ziggy.de (unknown [213.195.113.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 006372051A; Wed, 8 Apr 2020 09:35:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1586338535; bh=pYZM+fs7CeTmVETULZzofTBFr/wyM9xOIfYM+qHnWWg=; h=From:To:Cc:Subject:Date:From; b=0YsWP7XSn4o1jIxW+jy02cC7mX6ojpjs0M5BbEJXCA00IiL+e1iS53fHcAeFRnwzE W6KUtD+bMyPUzksvYiOaiUmdtYRrO8JaM8K/xjTKpVoPBnypVUvPncNR2QKB7sTGYJ tlv9L+9Cg+cdjEV/JV1z4M9pAiQtvdJe7rQoJOkI= From: matthias.bgg@kernel.org To: matthias.bgg@kernel.org, Simon Glass , u-boot@lists.denx.de, Robin.Randhawa@ARM.com Cc: giulio.benetti@benettiengineering.com, treding@nvidia.com, Matthias Brugger Subject: [PATCH 0/2] Reading size-cells and address-cells from a node should walk up the Date: Wed, 8 Apr 2020 11:35:26 +0200 Message-Id: <20200408093528.24276-1-matthias.bgg@kernel.org> X-Mailer: git-send-email 2.26.0 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean From: Matthias Brugger parent stack to find the property. This is reflected through comments in the code, but actually not implemented. This leads to the fact that some DTBs worked by accident. Fix this by walking the tree when reading this properties. After fixing the default size-cells returned when the property is not present this problem was made visible. When adding flash devices in qemu for arm64, the size-cells was wrongly inpterpreted and broke access to the second flash bank. Matthias Brugger (2): libfdt: Make fdt_cells function accessible dm: core: Walk the tree to find address- and size-cells properties drivers/core/ofnode.c | 8 +++---- include/dm/ofnode.h | 36 ++++++++++++++++++++++++++++++ include/dm/read.h | 6 ++--- scripts/dtc/libfdt/fdt_addresses.c | 2 +- scripts/dtc/libfdt/libfdt.h | 2 ++ 5 files changed, 45 insertions(+), 9 deletions(-)