From patchwork Fri Feb 26 10:48:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Brugger X-Patchwork-Id: 1444899 X-Patchwork-Delegate: matthias.bgg@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=am6p0eGF; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Dn5wf6b6Pz9s1l for ; Fri, 26 Feb 2021 21:48:18 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 69EC28201A; Fri, 26 Feb 2021 11:48:13 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.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; unprotected) header.d=kernel.org header.i=@kernel.org header.b="am6p0eGF"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B59E4819F3; Fri, 26 Feb 2021 11:48:11 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D9E49819F3 for ; Fri, 26 Feb 2021 11:48:08 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=matthias.bgg@kernel.org Received: by mail.kernel.org (Postfix) with ESMTPSA id 1403464ED2; Fri, 26 Feb 2021 10:48:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1614336487; bh=006CEVdvTHztEnLv4c7i8wXsoSt2P3WPV4KcjGHC0N8=; h=From:To:Cc:Subject:Date:From; b=am6p0eGFj56nISNbJF4D8Cf6iIvvkqcsPWTnaCPnJFvXAq14764LmcHYatNGS9Zb/ 0XyGeIwsqR/eSKwgX8XidQuPbz8AkoDKOcrBsnZ6mR0G7j14FHS8PfeF5tdiKaZPBW X5OEImTq4n7i+vZPmZstAogH3m6rI8cWcY2J7JlOFBlsDXNGiIyp4lBMRcFoXv8UPL ytVxSAdkrTAf1vf6ni/L/80Z7G+EmHX5ga0s61jsi1MRJvUwkQWHfuuje+Gf99sNFj qw+xtA0RYgOpaVzSgSqtx4OfQqODXbIQlY21HigdFsp2kseYuidspO1RubmyJbQQwl n1RUQA2kJgwkA== From: matthias.bgg@kernel.org To: sughosh.ganu@linaro.org, xypron.glpk@gmx.de Cc: u-boot@lists.denx.de, Matthias Brugger Subject: [PATCH 1/2] rng: iproc_rng200: Enable support for RPi4 armv7 Date: Fri, 26 Feb 2021 11:48:00 +0100 Message-Id: <20210226104801.3362-1-matthias.bgg@kernel.org> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.102.4 at phobos.denx.de X-Virus-Status: Clean From: Matthias Brugger On the RPi4 armv7 build we have the situationt that we use physical addresses of 64 bit, while the virtual addresses are 32 bit. Remap the base address in this scenario via map_physmem(). Signed-off-by: Matthias Brugger --- drivers/rng/iproc_rng200.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/rng/iproc_rng200.c b/drivers/rng/iproc_rng200.c index 1126bbd797..85ac15bf9c 100644 --- a/drivers/rng/iproc_rng200.c +++ b/drivers/rng/iproc_rng200.c @@ -34,12 +34,12 @@ #define RNG_FIFO_COUNT_RNG_FIFO_COUNT_MASK 0x000000FF struct iproc_rng200_plat { - fdt_addr_t base; + void __iomem *base; }; static void iproc_rng200_enable(struct iproc_rng200_plat *pdata, bool enable) { - fdt_addr_t rng_base = pdata->base; + void __iomem *rng_base = pdata->base; u32 val; val = readl(rng_base + RNG_CTRL_OFFSET); @@ -54,7 +54,7 @@ static void iproc_rng200_enable(struct iproc_rng200_plat *pdata, bool enable) static void iproc_rng200_restart(struct iproc_rng200_plat *pdata) { - fdt_addr_t rng_base = pdata->base; + void __iomem *rng_base = pdata->base; u32 val; iproc_rng200_enable(pdata, false); @@ -156,7 +156,7 @@ static int iproc_rng200_of_to_plat(struct udevice *dev) { struct iproc_rng200_plat *pdata = dev_get_plat(dev); - pdata->base = dev_read_addr(dev); + pdata->base = devfdt_map_physmem(dev, sizeof(void *)); if (!pdata->base) return -ENODEV; From patchwork Fri Feb 26 10:48:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Brugger X-Patchwork-Id: 1444900 X-Patchwork-Delegate: matthias.bgg@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=t0BzmHxm; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Dn5wr2HBmz9s1l for ; Fri, 26 Feb 2021 21:48:28 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2F0238206F; Fri, 26 Feb 2021 11:48:19 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.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; unprotected) header.d=kernel.org header.i=@kernel.org header.b="t0BzmHxm"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2227782038; Fri, 26 Feb 2021 11:48:13 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 57E538201A for ; Fri, 26 Feb 2021 11:48:10 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=matthias.bgg@kernel.org Received: by mail.kernel.org (Postfix) with ESMTPSA id C74D964EAF; Fri, 26 Feb 2021 10:48:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1614336489; bh=nY21QaGZXa4AUY3lNgrMTqko8jxitT1fJt3o6QLyyPM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t0BzmHxmL4P+rd4WjYvaIRokS72YGcCzrbojTfZZEtDZnHyu1nLey1FBBRfar9GMS nvZxBShoVmoxWmmEj4l4dWyCU5j1eflGfJ06Q7U9wbPHVemi0b85kwPhg7HtDrEANr b1b6D0of0/PvbNe+HFnpwptAC1ajT/AgUcn94exr4nJ7INLvLkNoqkQ4ZGXOlpkYcn 7N/ZMR7bvpRigkao/poKZgybEk5AmXDgd3LX4hFNuEJHKwVZiyfzmEdb8DbK2Xbtxj zMqUjILkLa4MoSbl0O2LulBav77a3GZcsG2hpcptGo3795vNgZc8pe8NFv/kaXvg25 JKahsqwYa/ADQ== From: matthias.bgg@kernel.org To: sughosh.ganu@linaro.org, xypron.glpk@gmx.de Cc: u-boot@lists.denx.de, Matthias Brugger Subject: [PATCH 2/2] configs: rpi4_32: Enable iProc RNG200 Date: Fri, 26 Feb 2021 11:48:01 +0100 Message-Id: <20210226104801.3362-2-matthias.bgg@kernel.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210226104801.3362-1-matthias.bgg@kernel.org> References: <20210226104801.3362-1-matthias.bgg@kernel.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.102.4 at phobos.denx.de X-Virus-Status: Clean From: Matthias Brugger Enable the RNG driver for RPi4 with 32 bit. Signed-off-by: Matthias Brugger --- configs/rpi_4_32b_defconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configs/rpi_4_32b_defconfig b/configs/rpi_4_32b_defconfig index 0a5d3ff8cd..91eeb3cd32 100644 --- a/configs/rpi_4_32b_defconfig +++ b/configs/rpi_4_32b_defconfig @@ -37,6 +37,8 @@ CONFIG_PCI_BRCMSTB=y CONFIG_PINCTRL=y # CONFIG_PINCTRL_GENERIC is not set CONFIG_DM_RESET=y +CONFIG_DM_RNG=y +CONFIG_RNG_IPROC200=y # CONFIG_REQUIRE_SERIAL_CONSOLE is not set CONFIG_USB=y CONFIG_DM_USB=y