Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp584025pxb; Tue, 9 Feb 2021 07:43:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJwIonDRtko7wYBlj1o42WM+TtE4VPPTM7qnDtNUT9eo54A4n5lMGqBWw2NVV4idhROrV8Kq X-Received: by 2002:a17:906:4c90:: with SMTP id q16mr23500274eju.49.1612885389679; Tue, 09 Feb 2021 07:43:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612885389; cv=none; d=google.com; s=arc-20160816; b=dujFYr6LInhI36ErHlD++EmLRO5IJlGIK2wfkyqRD6OPMMyM0as63ZAKkpNHXav0gS Ra1Hnt8e/0+6QWMeqrieBmbRQQqGG9aErmP1iQIZgv/HlVoh2IUn5c/tPjGIA+DgLr+a 1OIHucxkqLfF/fwAS5v9Z9/5QCjrXI27MF7f+itNociA0LAbV/mC9QBqBVfTo5CI7ePL ISheWRsrripLHkkhHOAhw5EW/iuUr+AEymlhzzXt8W27vO/ms8LpL3Q+JVJDoQiYD6aO qp2E9v7IreT00eoKvno6Pf7JtaAydx4XNWG3VsDZLNeuBnFIP2Z5VnuGMiBbjJNUi9nc HyVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=E0Auq1gHycPQaE1Zph8QBsBIIbPoY2DsLqBUyqBJ2vE=; b=070sdI4fmVpN1ZlUGspM7CHwlSfKKBDD6+CJLvhD9qwNbyHsLxWxHc1sPXrECFMqtT g9QxuZgdYIHLC4xHEbgQY+OFflzSk/9rvrmSLudR0d/H67Mc9bKqC8NkY9qubm+lqQA7 /0iO6JHhBggBQyGSLgiwjuRnhIIKvtbNujs0vCprXC45X0EfKJq285bRbLw+kH7/mYs+ sINEFPqM4/4aMX/GjwSQ7rsjQVupXbT9d3T5tL+J2oSlrXnaJfxIQY5cXGFFNN50EVwL /n/CxDgL3ixqMgSW4OJLuA4IuMTCY++NEH35NMe9TNzK74UD173UNTSWWxhL6/N3vW9n bi5A== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z19si5920208edr.437.2021.02.09.07.42.46; Tue, 09 Feb 2021 07:43:09 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232476AbhBIPjs (ORCPT + 99 others); Tue, 9 Feb 2021 10:39:48 -0500 Received: from elvis.franken.de ([193.175.24.41]:36832 "EHLO elvis.franken.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231995AbhBIPjm (ORCPT ); Tue, 9 Feb 2021 10:39:42 -0500 Received: from uucp (helo=alpha) by elvis.franken.de with local-bsmtp (Exim 3.36 #1) id 1l9V6R-0005On-00; Tue, 09 Feb 2021 16:38:59 +0100 Received: by alpha.franken.de (Postfix, from userid 1000) id B9967C0DF1; Tue, 9 Feb 2021 16:38:43 +0100 (CET) Date: Tue, 9 Feb 2021 16:38:43 +0100 From: Thomas Bogendoerfer To: Qing Zhang Cc: Rob Herring , Thomas Gleixner , Marc Zyngier , Huacai Chen , devicetree@vger.kernel.org, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Jiaxun Yang , Xingxing Su Subject: Re: [PATCH 2/6] MIPS: Loongson64: Distinguish firmware dependencies DTB/LEFI. Message-ID: <20210209153843.GA14595@alpha.franken.de> References: <20210209093224.7085-1-zhangqing@loongson.cn> <20210209093224.7085-3-zhangqing@loongson.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210209093224.7085-3-zhangqing@loongson.cn> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 09, 2021 at 05:32:20PM +0800, Qing Zhang wrote: > Add DTB boot support, only support LS2K1000 processor for now, > determine whether to use the built-in DTB or the DTB from the > firmware by checking the range of CKSEG0 and XKPHYS. > > Signed-off-by: Jiaxun Yang > Signed-off-by: Qing Zhang > Signed-off-by: Xingxing Su > --- > .../include/asm/mach-loongson64/boot_param.h | 6 ++++++ > arch/mips/include/asm/mach-loongson64/loongson.h | 3 ++- > arch/mips/loongson64/env.c | 13 ++++++++++++- > arch/mips/loongson64/init.c | 16 ++++++++++++++-- > 4 files changed, 34 insertions(+), 4 deletions(-) > > diff --git a/arch/mips/include/asm/mach-loongson64/boot_param.h b/arch/mips/include/asm/mach-loongson64/boot_param.h > index 4592841b6b0c..53c29a305ff0 100644 > --- a/arch/mips/include/asm/mach-loongson64/boot_param.h > +++ b/arch/mips/include/asm/mach-loongson64/boot_param.h > @@ -198,7 +198,13 @@ enum loongson_bridge_type { > VIRTUAL = 3 > }; > > +enum loongson_fw_interface { > + LOONGSON_LEFI = 0, > + LOONGSON_DTB = 1, > +}; > + > struct loongson_system_configuration { > + enum loongson_fw_interface fw_interface; do you need this for future use ? Right now this information is only needed in init.c and doesn't need to be exported... > + if (fw_arg2 == 0 || (be32_to_cpup((__be32 *)fw_arg2) == OF_DT_HEADER)) { what about using fdt_magic(fw_arg2) == FDT_MAGIC ? Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]