Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp62338pxa; Tue, 11 Aug 2020 17:22:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzr1xvprRdcqXvuVOyX0Wk2c8DfcvMY3TaWufCc366BogmBSEZpfYiDdicijco/y84ybrjn X-Received: by 2002:a17:906:301b:: with SMTP id 27mr13673965ejz.197.1597191776809; Tue, 11 Aug 2020 17:22:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597191776; cv=none; d=google.com; s=arc-20160816; b=Lam13nI7WPHr6iR3wecoykBL12pibJuWfOwP+PvFy3Y2iPwl2q3Joq8uiFJNmwyas8 0RUruCt1a2ETzv9N2Wl6bKe2NQgq8n98q2aE09U/D8JyfLugVM4gb7iq30hrZXTNml55 TmCSk0j5sQordrcHML+yl6llQbwsfKejkFamd2shuQtUoAukX7Cpx1vbKL/G18mULdYx GdjiMZqY4aa63l7hd11aAhW7NZSMkR4IQ7P7FyBUTJnQyT3vUnQIb5ZZzeMh+8f/e6LA hols5NI9jj6cYtk03NC+0VEggclAaeQFmdIhhRszBiTxoNdrFccBhtFBPWmE9xXK9D7P Rqcg== 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=71OiJrNBXGHHy4STriFS2lDH1vte0sayDqTyahqWSNE=; b=toW5zOeCWhU6xIA/h4JotFpusDSVFwQ3imnL9My+GOaVfkd0V7vm4snZqAf4JjlnZG chRrRSzXGdemTgO+g6fFj3VaKst+7aKwm4tkzXIuccZZwqbubeRTJqi4NkKKFYVIPXoQ r/vc4H8iIODGsv3pLh6UB9kjg4wkTJKJyrVE6ozLrc9A6vYktiCU5zP7LteeG3cAOB5Y lPrrxESIo1nzZZZnHe1UA1vs5IbCMNFWu0vm8ZeQ2QRT49W6ayNmRfODFW/2jifh83IQ FqsLDIe4vzvt/4ACM9kiQilvaBDPQw3A/DcJLtuosCyDiOIVvlviqdfH07Ze5swRxn3K gvcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@crapouillou.net header.s=mail header.b=X8fmMRlB; 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 h24si124717ejt.451.2020.08.11.17.22.33; Tue, 11 Aug 2020 17:22:56 -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=X8fmMRlB; 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 S1726707AbgHLAQL (ORCPT + 99 others); Tue, 11 Aug 2020 20:16:11 -0400 Received: from crapouillou.net ([89.234.176.41]:52166 "EHLO crapouillou.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726143AbgHLAQK (ORCPT ); Tue, 11 Aug 2020 20:16:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1597191325; 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=71OiJrNBXGHHy4STriFS2lDH1vte0sayDqTyahqWSNE=; b=X8fmMRlBrspsdg9MCLmbZcyq48GcvTbLbyLdqDSHt402ofr79FlWzb0/Vv1leGU5idjwVb LCXSpz+igAk8y/BQ5kHsgGyOlMEUa+XueYCqSW5FA/4OClR//lKTEAZ5q8hNJeGvtASVVC c0OA8DmOmMMR3jE+eti23IEJMnBCoJw= From: Paul Cercueil To: Thomas Bogendoerfer Cc: Paul Burton , Krzysztof Kozlowski , =?UTF-8?q?=E5=91=A8=E7=90=B0=E6=9D=B0?= , od@zcrc.me, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, Paul Cercueil Subject: [PATCH v2 07/13] MIPS: generic: Support booting with built-in or appended DTB Date: Wed, 12 Aug 2020 02:15:04 +0200 Message-Id: <20200812001510.460382-8-paul@crapouillou.net> In-Reply-To: <20200812001510.460382-1-paul@crapouillou.net> References: <20200812001510.460382-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: 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