Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2763383pxk; Sun, 6 Sep 2020 12:32:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJynMMBA3kN3DgZfn0tPlGDitaYJ4ZwK/uv3Rey1yNSJIu8HUT/L/ol5PIzMAj66lPSpS27i X-Received: by 2002:a17:906:18a9:: with SMTP id c9mr17613075ejf.294.1599420757227; Sun, 06 Sep 2020 12:32:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599420757; cv=none; d=google.com; s=arc-20160816; b=BqvgObaDeO8uqIvj28psHrJaGsfETI8yfUEzakyR2WoNarU1ky88Gw6fP1tuhPXVtt 64MDxw7IH+qW1EstAmVZk7x4XYyQo7gGotPOkmKnPSDMiUImiU1kDjiuXITWmCnZ5ttK oa4+Y53yvo9qg+yZtNX4mRt6AkXrFyOG607LUhQ2puPXfaB21E7S/rEX6p9mhgHHgm+h iOgMlmpMGAt9uiT7KHxbSFyMb0MTuVyurZVSQc7YE+XmVws46NA6ZgP5z9MrzekqVVj5 DAgml6u5RpFZhwskuQ2Gbrj+5SMgdAD/UtC4IIgKN5fNuFDufgSqx7rVD5LB4oXOqf1d WKKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=8smfQBOSeAYUyN6ywO7oX394JF1Jab2dVsaM0oxRtpw=; b=vYbdr8pG2pabnEQRK9ttyLR1CjoyeazVhcRLhrtnTPhvcDdsXaEF+v2Hd4KquJu5U/ Adh20N2hO0Ylox0ukKksyKIXA7fWBbBBcq0b+ILRg0XZeYeL/V9VKwH2EAELpzRQC3VU tdLkCGH81TiPNHQVuv/MXbayZf1DyhnjAhSyjZBVxd9Ytow2kaAvVNL2fjIrVQTepb/W HsuqOHESN8sMdzMfOA5wNo9oI/j+BbH93D2bw28iUwnJmQFryydGJoEzJIIRn4++dmS4 L7T9UOxbb7T2w4UPzPZBixBNolwMWcMzCHrs0l2vG4oGYvehtkG50bbdnVKw+ViU4u2P 5HLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@crapouillou.net header.s=mail header.b=mDcI2KLx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dp16si11461232ejc.687.2020.09.06.12.32.14; Sun, 06 Sep 2020 12:32:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@crapouillou.net header.s=mail header.b=mDcI2KLx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726660AbgIFTbD (ORCPT + 99 others); Sun, 6 Sep 2020 15:31:03 -0400 Received: from crapouillou.net ([89.234.176.41]:35928 "EHLO crapouillou.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726623AbgIFTbB (ORCPT ); Sun, 6 Sep 2020 15:31:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1599420592; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8smfQBOSeAYUyN6ywO7oX394JF1Jab2dVsaM0oxRtpw=; b=mDcI2KLxSvvs9lkYkXKzSu/BS4gY+th0uQ2mityjgVFLQJ4nLejajAJtX/p9/Aq4ytSwgf DWBIUGWUHcI3fRp9ySao6E4LMOciM8KDYX/p2nUSIRMIla1GH5GNRpV5amfxzMqhs2imKb gwmMhHT911/x/v+YtZ5VL6/ABpzVwUQ= From: Paul Cercueil To: Thomas Bogendoerfer Cc: "Maciej W . Rozycki" , Paul Burton , Zhou Yanjie , od@zcrc.me, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, Paul Cercueil Subject: [PATCH v3 08/15] MIPS: generic: Support booting with built-in or appended DTB Date: Sun, 6 Sep 2020 21:29:28 +0200 Message-Id: <20200906192935.107086-9-paul@crapouillou.net> In-Reply-To: <20200906192935.107086-1-paul@crapouillou.net> References: <20200906192935.107086-1-paul@crapouillou.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The plat_get_fdt() checked that the kernel was booted using UHI before reading the 'fw_passed_dtb' variable. However, this variable is also set when the kernel has been appended, or when it has been built into the kernel. Support these usecases by removing the UHI check. Signed-off-by: Paul Cercueil --- Notes: v2-v3: No change arch/mips/generic/init.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/arch/mips/generic/init.c b/arch/mips/generic/init.c index 029f47ea390c..66a19337d2ab 100644 --- a/arch/mips/generic/init.c +++ b/arch/mips/generic/init.c @@ -39,12 +39,11 @@ void __init *plat_get_fdt(void) /* Already set up */ return (void *)fdt; - if ((fw_arg0 == -2) && !fdt_check_header((void *)fw_passed_dtb)) { + if (fw_passed_dtb && !fdt_check_header((void *)fw_passed_dtb)) { /* - * We booted using the UHI boot protocol, so we have been - * provided with the appropriate device tree for the board. - * Make use of it & search for any machine struct based upon - * the root compatible string. + * We have been provided with the appropriate device tree for + * the board. Make use of it & search for any machine struct + * based upon the root compatible string. */ fdt = (void *)fw_passed_dtb; -- 2.28.0