From mboxrd@z Thu Jan 1 00:00:00 1970 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 4CA02C7EE2F for ; Mon, 12 Jun 2023 15:04:42 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5ABF282A2C; Mon, 12 Jun 2023 17:04:38 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=collabora.com 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; unprotected) header.d=collabora.com header.i=@collabora.com header.b="UaQFBSZ3"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3DF6D82A2C; Mon, 12 Jun 2023 17:04:36 +0200 (CEST) Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) (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 A339E85CB5 for ; Mon, 12 Jun 2023 17:04:32 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=detlev.casanova@collabora.com Received: from arisu.localnet (mtl.collabora.ca [66.171.169.34]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: detlev) by madras.collabora.co.uk (Postfix) with ESMTPSA id AFE136606E9D; Mon, 12 Jun 2023 16:04:31 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1686582272; bh=P7eRa+hcB7T+8x06fXpXnN4/Iu/igc+UTqTzKMvipjA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UaQFBSZ3MsBOwTspLl03yrCnuj6NwwLoRkXzdezVtt0JM5DSyLrQOxXqd/3ILORCv q3g7QJs5DAZtd3SUFARYA1ZgDwrbrdwyym7BOmKOKvdw+nUvIOTZUVieLQ+DxkjgV4 5irBSJNI6PT9+mauzLdoGXsUB/RA5z4KfiaqTUPE1dxIrKAu/5Eh42lOyWN0TY9nXw e4ZNKXnf3N5DAm2b3UXtNRQG5ZMcu/n33Woag8uZkVEbZtq1w/QPv/a96ErtA6MqzG z77PqVIH6PvK5LnNPh8soX6UV1qQGBo/+REN9aGXqB+wSu9prc8aT4H3OYirWjNf4s p0vSjZFdhvO5g== From: Detlev Casanova To: u-boot@lists.denx.de, Marek Vasut Cc: Marek Vasut , Hai Pham , Tam Nguyen Subject: Re: [PATCH 2/2] renesas: rcar3: Load the correct device tree Date: Mon, 12 Jun 2023 11:04:36 -0400 Message-ID: <2183617.irdbgypaU6@arisu> In-Reply-To: References: <20230609160016.128417-1-detlev.casanova@collabora.com> <20230609160016.128417-3-detlev.casanova@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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 Saturday, June 10, 2023 7:58:35 A.M. EDT Marek Vasut wrote: > On 6/9/23 18:00, Detlev Casanova wrote: > > The Renesas R-Car Gen3 H3e (Starter Kit Premier) uses a different > > device tree than the default one. > > > > This uses the sysinfo's board id to determine if the board needs a > > specific device tree. > > > > Signed-off-by: Detlev Casanova > > --- > > > > board/renesas/ulcb/ulcb.c | 34 ++++++++++++++++++++++++++++++++++ > > configs/rcar3_ulcb_defconfig | 1 + > > 2 files changed, 35 insertions(+) > > > > diff --git a/board/renesas/ulcb/ulcb.c b/board/renesas/ulcb/ulcb.c > > index 1477750f921..3e2fe3a3ca9 100644 > > --- a/board/renesas/ulcb/ulcb.c > > +++ b/board/renesas/ulcb/ulcb.c > > @@ -28,6 +28,8 @@ > > > > #include > > #include > > > > +#include "../../../drivers/sysinfo/rcar3.h" > > + > > > > DECLARE_GLOBAL_DATA_PTR; > > > > #define DVFS_MSTP926 BIT(26) > > > > @@ -65,6 +67,38 @@ int board_init(void) > > > > return 0; > > > > } > > > > +int misc_init_r(void) > > +{ > > + struct udevice *dev; > > + int board_id; > > + int ret = sysinfo_get(&dev); > > + if (ret) { > > + debug("Cannot get sysinfo: %d\n", ret); > > + return 0; > > + } > > + > > + ret = sysinfo_detect(dev); > > + if (ret) { > > + debug("Cannot detect sysinfo: %d\n", ret); > > + return 0; > > + } > > + > > + ret = sysinfo_get_int(dev, > > + SYSINFO_ID_BOARD_MODEL, > > + &board_id); > > + > > + if (ret) { > > + debug("Cannot get sysinfo int: %d\n", ret); > > + return 0; > > + } > > + > > + if (board_id == BOARD_STARTER_KIT_PRE) { > > + env_set("fdtfile", "renesas/r8a779m1-ulcb.dtb"); > > About this, BOARD_STARTER_KIT_PRE is just H3 ULCB . I suspect the ID is > the same on H3e ULCB ? I think we need some other method to discern the > two board variants. Here is the sysinfo EEPROM from H3 ULCB: > > CPU: Renesas Electronics R8A7795 rev 2.0 > Model: Renesas Starter Kit Premier board rev 2.0 > DRAM: 896 MiB (effective 3.9 GiB) > ... > => i2c dev 7 ; i2c md 0x50 0 0x80 > Setting bus to 7 > 0000: 8e 17 52 5d e6 e6 b1 35 e4 e4 e4 e4 35 20 20 0a ..R]...5....5 . > 0010: f4 f4 44 44 f4 f4 44 44 44 44 f4 f4 f4 4f 01 52 ..DD..DDDD...O.R > 0020: 52 52 52 53 51 4f 4d 01 52 53 60 00 00 00 00 00 RRRSQOM.RS`..... > 0030: 00 00 11 00 01 2d ff ff ff ff ff ff ff ff ff ff .....-.......... > 0040: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................ > 0050: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................ > 0060: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................ > 0070: 5a ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff Z............... > > Can you dump and share the H3e ULCB EEPROM content ? Indeed, The board id will be the same for both H3 and H3e. The `val` changed from `5a` to `5b` at offset 0x70. So I can probably also expose the rev_major and rev_minor through `sysinfo_get_int` to select the H3e specific device tree when rev_major == 3. For reference: CPU: Renesas Electronics R8A7795 rev 3.0 Model: Renesas Starter Kit Premier board rev 2.1 DRAM: 896 MiB (effective 3.9 GiB) [...] => i2c dev 7 ; i2c md 0x50 0 0x80 Setting bus to 7 0000: 8e 17 52 5d e6 e6 b1 35 e4 e4 e4 e4 35 20 20 0a ..R]...5....5 . 0010: f4 f4 44 44 f4 f4 44 44 44 44 f4 f4 f4 4f 01 52 ..DD..DDDD...O.R 0020: 52 52 52 53 51 4f 4d 01 52 53 60 00 00 00 00 00 RRRSQOM.RS`..... 0030: 00 00 11 00 01 2d ff ff ff ff ff ff ff ff ff ff .....-.......... 0040: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................ 0050: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................ 0060: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................ 0070: 5b ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [............... Detlev.