Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6306AEB64DB for ; Wed, 14 Jun 2023 13:55:49 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1B5738618E; Wed, 14 Jun 2023 15:55:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=mailbox.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; secure) header.d=mailbox.org header.i=@mailbox.org header.b="lHaIfqwU"; dkim=pass (2048-bit key) header.d=mailbox.org header.i=@mailbox.org header.b="WDCBQyHz"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C997C860FE; Wed, 14 Jun 2023 15:55:15 +0200 (CEST) Received: from mout-p-201.mailbox.org (mout-p-201.mailbox.org [IPv6:2001:67c:2050:0:465::201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C5EF186146 for ; Wed, 14 Jun 2023 15:55:11 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=mailbox.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=marek.vasut@mailbox.org Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:b231:465::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4Qh6PW4WsCz9sVy; Wed, 14 Jun 2023 15:55:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1686750911; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pxb47A0FCtyJeMAA4ZbtDZtIbXFB1Q6YpHvyk+iHw5A=; b=lHaIfqwUU6gd2Kw9BwBZ9V1gRdqgWsBXbA+V+bbuRCuLosuEdrko4SVP+F4PazmEzAjVis KkdFz8E3RR6JO7JUbrw4kF1DmJa+WiCzIE0PXBOd+mAl6S8ovJ63DKh1h7sG5oT+wPFChF Uc3SxQOcRjq1nURntjEAanaosD5JxV/uLGLmWGsA2OKR3DixD9227lXo7gZyaa55Qyv9mE +HBLiLWHpyK9paaJtRqUExFeonJPLS+qsL8kmKUFQD6WspRosBtUEyTz2aTb/cIZs9wUan hGniJUyrgzdRqqemcmq2KRHIH7g3FXKAPBftP5PZzfok5RjZS1EkD9dJ3Hbi8g== Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1686750909; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pxb47A0FCtyJeMAA4ZbtDZtIbXFB1Q6YpHvyk+iHw5A=; b=WDCBQyHzj3JEz4qonZh9OflEBE/kuCVREoqCfv+mvdWEkVgqc5lWGk4dPO9p4K5ljiZYod /1vAxiD4EOOpqOLsZ4d0MxOZW7W7+eF8vVRmU2maCnIpEMeSVK9F1h++D7TVQUf0KK0P3D a5YtC5n6KHoZybwFd5zA8t48aZ0bAlXgnyZ+BJotw/QLrvnK5vZxYc+3ceyIlD5RzeLLSX k4AnHRdQvUHnTOqyJQWbGlZc1HJObcdSPKJgd9R31ChwsllswLIjoBP62RRo8cCejQdEfE fBdfimqH0KIioVJimmoBgD6/96NEbNMkNvsrnAAQMAO6FoQFpW87j+hAqg1Wuw== Date: Wed, 14 Jun 2023 15:53:14 +0200 MIME-Version: 1.0 Subject: Re: [PATCH v2 3/3] renesas: rcar3: Load the correct device tree Content-Language: en-US To: Detlev Casanova , u-boot@lists.denx.de Cc: Marek Vasut , Hai Pham , Tam Nguyen References: <20230612195107.171748-1-detlev.casanova@collabora.com> <20230612195107.171748-4-detlev.casanova@collabora.com> From: Marek Vasut In-Reply-To: <20230612195107.171748-4-detlev.casanova@collabora.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-MBO-RS-META: 57uxh3jbawcwihgdixpop48gtyer3yot X-MBO-RS-ID: a6717538e89dcbc723c X-Rspamd-Queue-Id: 4Qh6PW4WsCz9sVy X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean On 6/12/23 21:51, Detlev Casanova wrote: > The Renesas R-Car Gen3 boards use different device trees than > the default one. > > This commit uses the sysinfo's board id and revision > to determine which linux device tree to load: > * H3 (Starter Kit Premier v2.0): renesas/r8a77951-ulcb.dtb > * H3e (Starter Kit Premier v2.1): renesas/r8a779m1-ulcb.dtb This is not about loading DTs (as the subject would suggest), this is about setting the correct default DT name in environment. > Signed-off-by: Detlev Casanova > --- > board/renesas/ulcb/ulcb.c | 59 ++++++++++++++++++++++++++++++++++++ > configs/rcar3_ulcb_defconfig | 1 + > 2 files changed, 60 insertions(+) > > diff --git a/board/renesas/ulcb/ulcb.c b/board/renesas/ulcb/ulcb.c > index 1477750f921..cc78e0952b6 100644 > --- a/board/renesas/ulcb/ulcb.c > +++ b/board/renesas/ulcb/ulcb.c > @@ -27,6 +27,7 @@ > #include > #include > #include > +#include > > DECLARE_GLOBAL_DATA_PTR; > > @@ -65,6 +66,64 @@ int board_init(void) > return 0; > } > > +int misc_init_r(void) > +{ > + struct udevice *dev; > + int board_id; > + int rev_major, rev_minor; > + int ret = sysinfo_get(&dev); > + > + if (ret) { > + debug("Cannot get sysinfo: %d\n", ret); > + return 0; Why do we ignore errors here ? > + } > + > + ret = sysinfo_detect(dev); > + if (ret) { > + debug("Cannot detect sysinfo: %d\n", ret); > + return 0; > + } Looking at all this, I really have to wonder, wouldn't it be nicer to introduce a 'sysinfo' command which provides interface to obtain the different properties (like board name, id, revision ...) from U-Boot command line, and then script the DT selection in U-Boot shell ?