From patchwork Tue Sep 15 08:05:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1364157 X-Patchwork-Delegate: uboot@andestech.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; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=KzBbsw1t; 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 4BrG4Z1flHz9sVB for ; Tue, 15 Sep 2020 18:05:33 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5EEC382304; Tue, 15 Sep 2020 10:05:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.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=gmail.com header.i=@gmail.com header.b="KzBbsw1t"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2F85A822DB; Tue, 15 Sep 2020 10:05:23 +0200 (CEST) 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,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id A247C8158B for ; Tue, 15 Sep 2020 10:05:19 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bmeng.cn@gmail.com Received: by mail-pj1-x1041.google.com with SMTP id q4so1353581pjh.5 for ; Tue, 15 Sep 2020 01:05:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=xshZYK7alo34EEOIVlDJcF2orR1Cjr1lnw9GJtW+jCE=; b=KzBbsw1tESRxts45+UhP3Bv4l7onzWg1mhQLxifj6tiln6SUWeksxVst/I+AP6J3gn f968+T1x3jElxMevVdmqKd2KU7fTuIoqXdpQJhWiqaCEqWy4kYFh87bjPD2IDwYqHO9g 93C2qKye7VAB+nQnoY4pZNO1dg8PV3XNt9U+7vD+gMaPrMt73DXKmX714dIE3liq3vkO iT1jUk35upxrveOoFa3FmNhWzwsjRIv7TVpChpWRDFgRu6P6xadnJt15oHPFJHMNqFli tlkQWXLvO+6MVxECe3pbSsCMt2B9eoejfLrd5VThGqUEJNfvCDW1kqC37/NJ1YF3oaCF pyfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=xshZYK7alo34EEOIVlDJcF2orR1Cjr1lnw9GJtW+jCE=; b=qvQ2liwIrGeHbwN/INcDJ3Ab5rqurrVgEUWSXQHaP7vLDo4tnpEaJZrzPXcZk/R22o RcHkTefa742/AZhFLQd2OFKAciwJYOFIGa/SXd1+rNXOyNhk+o5ejouwV9yV/ZjwYBYt f7fEoyEyfh2fSdqJRewGWxvP5lAnh/1pqvGibB4b4YQWc1cA1H9Z4mQ2UaUVKvlUuc82 K5t9QepIBKmtEm+GKDnUH4B32tGCWASO28Ujw1lr3P8xFdsI0LIfmxp3+1EvajOLPC1/ 1woqOFlvKa8OIbkV5CUpbOaUnbTd1lSx19Dn9VIAXKSvItymGQvIl4QG6Z+T2Gvz5Wqu ZJ5w== X-Gm-Message-State: AOAM530TDvZoKcG/3bCCnhA0XcTn3olWTv9JwTsGmjI7Rdf3JEvCqCXd KiPKXvXiTb8upHggbmOaSSA= X-Google-Smtp-Source: ABdhPJxD8A+dqndT5kFPfuKib1vkgjqRVa7CurAVx4h7h1ilo/uWbDWjJPydkn1lfKuD8YE7YrjLLg== X-Received: by 2002:a17:902:309:b029:d1:e5e7:ca3f with SMTP id 9-20020a1709020309b02900d1e5e7ca3fmr684296pld.43.1600157118104; Tue, 15 Sep 2020 01:05:18 -0700 (PDT) Received: from pek-vx-bsp2.wrs.com (unknown-146-144.windriver.com. [147.11.146.144]) by smtp.gmail.com with ESMTPSA id mh8sm10897737pjb.32.2020.09.15.01.05.15 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Sep 2020 01:05:17 -0700 (PDT) From: Bin Meng To: Rick Chen , Pragnesh Patel , U-Boot Mailing List Cc: Bin Meng Subject: [PATCH 2/2] ram: sifive: Remove regmap dependency Date: Tue, 15 Sep 2020 16:05:07 +0800 Message-Id: <1600157107-57175-2-git-send-email-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1600157107-57175-1-git-send-email-bmeng.cn@gmail.com> References: <1600157107-57175-1-git-send-email-bmeng.cn@gmail.com> 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.3 at phobos.denx.de X-Virus-Status: Clean From: Bin Meng The usage of regmap API in the SiFive RAM driver is not correct. The reg address should be obtained via dev_read_addr_index() API. Signed-off-by: Bin Meng --- drivers/ram/sifive/fu540_ddr.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/ram/sifive/fu540_ddr.c b/drivers/ram/sifive/fu540_ddr.c index f5b2873..60d4945 100644 --- a/drivers/ram/sifive/fu540_ddr.c +++ b/drivers/ram/sifive/fu540_ddr.c @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include @@ -339,17 +338,12 @@ static int fu540_ddr_probe(struct udevice *dev) priv->info.size = gd->ram_size; #if defined(CONFIG_SPL_BUILD) - struct regmap *map; int ret; u32 clock = 0; debug("FU540 DDR probe\n"); priv->dev = dev; - ret = regmap_init_mem(dev_ofnode(dev), &map); - if (ret) - return ret; - ret = clk_get_by_index(dev, 0, &priv->ddr_clk); if (ret) { debug("clk get failed %d\n", ret); @@ -374,9 +368,9 @@ static int fu540_ddr_probe(struct udevice *dev) return ret; } - priv->ctl = regmap_get_range(map, 0); - priv->phy = regmap_get_range(map, 1); - priv->physical_filter_ctrl = regmap_get_range(map, 2); + priv->ctl = (struct fu540_ddrctl *)dev_read_addr_index(dev, 0); + priv->phy = (struct fu540_ddrphy *)dev_read_addr_index(dev, 1); + priv->physical_filter_ctrl = (u32 *)dev_read_addr_index(dev, 2); return fu540_ddr_setup(dev); #endif