From patchwork Mon Aug 3 17:01:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 11698481 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AFEC1138A for ; Mon, 3 Aug 2020 17:02:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9875F20792 for ; Mon, 3 Aug 2020 17:02:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=crapouillou.net header.i=@crapouillou.net header.b="ocSG34R5" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727885AbgHCRCk (ORCPT ); Mon, 3 Aug 2020 13:02:40 -0400 Received: from crapouillou.net ([89.234.176.41]:37938 "EHLO crapouillou.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726878AbgHCRCk (ORCPT ); Mon, 3 Aug 2020 13:02:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1596474109; 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=f1OMfRPUo8Q/TcXGxpBUAtyxSMnopsvdrRwQm/eAjGA=; b=ocSG34R5By/n3GIXKmnV2klqpFl8g8yZj6mikPRq+39Vf4MtIvWWU2Yjf8be6xZe1Ji2bS DVw5gyvMolbm+nfuLCEJhAws456FsyvoUpxFinMMNesDFP7CflWCLJDr4p5vlFozf1vkNJ LKIdyuqEGNuo5l1HJWd+nh7JKunGb/8= From: Paul Cercueil To: Thomas Bogendoerfer Cc: Paul Burton , Krzysztof Kozlowski , =?utf-8?b?5ZGo55Cw5p2w?= , od@zcrc.me, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, Paul Cercueil Subject: [PATCH 07/13] MIPS: generic: Support booting with built-in or appended DTB Date: Mon, 3 Aug 2020 19:01:18 +0200 Message-Id: <20200803170124.231110-8-paul@crapouillou.net> In-Reply-To: <20200803170124.231110-1-paul@crapouillou.net> References: <20200803170124.231110-1-paul@crapouillou.net> MIME-Version: 1.0 Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@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 --- 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 7d82b436939e..2465537672fa 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;