From patchwork Mon Feb 11 11:09:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 1039743 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-tegra-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="A5EGKxLL"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 43yjjJ2v3rz9s5c for ; Mon, 11 Feb 2019 22:09:24 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726263AbfBKLJX (ORCPT ); Mon, 11 Feb 2019 06:09:23 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:40603 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726140AbfBKLJX (ORCPT ); Mon, 11 Feb 2019 06:09:23 -0500 Received: by mail-wm1-f68.google.com with SMTP id q21so16558850wmc.5 for ; Mon, 11 Feb 2019 03:09:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=QxR4ydY2asPONlOFGBW5etgVpUXzE8d1exJ++uN0wXU=; b=A5EGKxLL5iykMofqRqHSqdwj18iG04+j1nHO1A0xiC6tEoTT134GF5GKz//7NW8MLL 3R6EvIHAFkk/85wXZKr+KLeFrR8cs+W2yPejJleSa7HL+u5/q/QxmfFNVWyjqjSEJu8u ivxxWiWvyINTotAyCfjpMVRN2kPaI7J9Cyzhw5e6LoUVS0ExhvJDiTljpzt8zYr2Ih5w aorBWFcIY37ugPv8f1dsWVhQNgQt6n+Go7tYRDijzAvPwVTZqZTkf6gzK5T8J4FKKnmI QKwUKWJHLTZIcc3/Sbjrw+1QFOJ1Zq1zMlh/KDknwPNx27HlWxK+LkVtSf2XnYXfCzFu zSzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=QxR4ydY2asPONlOFGBW5etgVpUXzE8d1exJ++uN0wXU=; b=PiDVObXpG8Yfowl3njGJXf5Y37aVgw/efIifXXwIdPcV6izMbp/TXGwNfU401UnAjq 1sQjjiB+aFwRroVPxSZZkap07fqOYn0yAN1OYQ919hcccSHtJbw2cX8g/cBblOxHcwKH Z38THa87FsQXnJpKDrbEkwd8EvVN6VgYC+E47BbFPH/OxSZ6zW9cyGQXq9R5lyxmISqt oRbOQNPE4bHHlyzyoZyoyJb5PEmUjoZbyjtgIrvPMUoaqlFzvaVj8Mb+qgAEF6+Oh5mL 1714T97ofgV47u2NMtIx25Yt/2yl6XFqy3hBxKRR+rbTKo0X5eGqHDDdk9/I5b+n+Xqa 4jGw== X-Gm-Message-State: AHQUAuaK6RheDTdgmzE/18XmczMxtm7uMQlJ4mK8TcRGpRGd1IqEhRqS 7WOlBASccevd2Zw7Ow97S2Q= X-Google-Smtp-Source: AHgI3IaL6iEgQxU2vX5daEdKUZBJAD/TfVShSwkTr/6wXRI9emFGjA0+bKrjGMjv3YMRuRavh0S4GA== X-Received: by 2002:adf:f28d:: with SMTP id k13mr28092250wro.78.1549883360690; Mon, 11 Feb 2019 03:09:20 -0800 (PST) Received: from localhost (pD9E51040.dip0.t-ipconnect.de. [217.229.16.64]) by smtp.gmail.com with ESMTPSA id y145sm9976625wmd.30.2019.02.11.03.09.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 11 Feb 2019 03:09:20 -0800 (PST) From: Thierry Reding To: Thierry Reding Cc: Tristan Bastian , Jon Hunter , linux-tegra@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2] ARM: tegra: Restore DT ABI on Tegra124 Chromebooks Date: Mon, 11 Feb 2019 12:09:19 +0100 Message-Id: <20190211110919.10388-1-thierry.reding@gmail.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org From: Thierry Reding Commit 482997699ef0 ("ARM: tegra: Fix unit_address_vs_reg DTC warnings for /memory") inadventently broke device tree ABI by adding a unit- address to the "/memory" node because the device tree compiler flagged the missing unit-address as a warning. Tegra124 Chromebooks (a.k.a. Nyan) use a bootloader that relies on the full name of the memory node in device tree being exactly "/memory". It can be argued whether this was a good decision or not, and some other bootloaders (such as U-Boot) do accept a unit-address in the name of the node, but the device tree is an ABI and we can't break existing setups just because the device tree compiler considers it bad practice to omit the unit-address nowadays. This partially reverts the offending commit and restores device tree ABI compatibility. Fixes: 482997699ef0 ("ARM: tegra: Fix unit_address_vs_reg DTC warnings for /memory") Reported-by: Tristan Bastian Signed-off-by: Thierry Reding Tested-by: Tristan Bastian --- Changes in v2: - remove memory@80000000 node pulled in from tegra124.dtsi - add device_type = "memory" property arch/arm/boot/dts/tegra124-nyan.dtsi | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/tegra124-nyan.dtsi b/arch/arm/boot/dts/tegra124-nyan.dtsi index d5f11d6d987e..bc85b6a166c7 100644 --- a/arch/arm/boot/dts/tegra124-nyan.dtsi +++ b/arch/arm/boot/dts/tegra124-nyan.dtsi @@ -13,10 +13,25 @@ stdout-path = "serial0:115200n8"; }; - memory@80000000 { + /* + * Note that recent version of the device tree compiler (starting with + * version 1.4.2) warn about this node containing a reg property, but + * missing a unit-address. However, the bootloader on these Chromebook + * devices relies on the full name of this node to be exactly /memory. + * Adding the unit-address causes the bootloader to create a /memory + * node and write the memory bank configuration to that node, which in + * turn leads the kernel to believe that the device has 2 GiB of + * memory instead of the amount detected by the bootloader. + * + * The name of this node is effectively ABI and must not be changed. + */ + memory { + device_type = "memory"; reg = <0x0 0x80000000 0x0 0x80000000>; }; + /delete-node/ memory@80000000; + host1x@50000000 { hdmi@54280000 { status = "okay";