From patchwork Fri Jul 9 10:50:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masami Hiramatsu X-Patchwork-Id: 471809 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp162562jao; Fri, 9 Jul 2021 03:50:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyPS4BCD8INUSL1MMBBEI0iVx6pYpkpPfj6aO3C128wKU6LVxbbdIZkMZpvH+dbVk7YUYLd X-Received: by 2002:a17:906:8158:: with SMTP id z24mr13290304ejw.359.1625827823270; Fri, 09 Jul 2021 03:50:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625827823; cv=none; d=google.com; s=arc-20160816; b=ooxL8uidlL63E2raRPskyC9KkQfkMFJlZFvEOG1qAxNrIS3+SG3LkNwKYjN7r0x7tu kzbvDgtVLL0T2WWjZufntXxl9+to7C1GnpIv8Dv+LALdvUtRyejCUTQ9jLDBYb1pXD9y TDWZhJ7D0mn+o49Bor6gGQUTq8fSejHOQAjSpLld3x1xolobLPvb6IRsmosrFIKCQpEe ox/wwHWiN6tVk7ZXDY2UFmk4KqB+/gYh/myiHwKwMWAMAleRc5mLEfezfItzVNzvlytn py+JDPm8LwRv9Fu3yXxFH1WbakAZ3vm59PMBBc5QbbVjkhjV2OHddX2Yx/aHv3/kHTEe dlZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:user-agent:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=ihGhsZ/OGiIYh+YiH4AhDiuRYA0GuHubZu/tTVVcq+4=; b=etxZ1QSiKAWL0Fs9ZRU1jLp9IvDQ1eUhUJOdkazKXdRQ/bmgJu2Xs6xlY4sGA/WkvL WzyjHg4Upb+ShX+4wa8z2vf/kvuz2Z3m8axS1T0jhyw8f71deCRXZAcbik6H6LRwp27Z TLQcDlp/jmeZgVWrFjmz3OViSys+zXHFrZylamHAIn4xsiOA9tWbJOwjm/FtNtj+u90E PFdteG9v0hTOh2MhPFvRpo9HCzGpEPYGg7eHAC7DdSJe0G22deMLzQWo6GhIbqUb6g9N Ur9iHVV1H2yuFUMquBS+uZYFudD161DsdZk7Hoayje5TJED2znRAx1wo0Q1/oSbjDALz qnVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=u0H4CkCo; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id et23si2188278ejc.91.2021.07.09.03.50.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Jul 2021 03:50:23 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=u0H4CkCo; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0A8DD8327B; Fri, 9 Jul 2021 12:50:19 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.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=linaro.org header.i=@linaro.org header.b="u0H4CkCo"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3C79A83272; Fri, 9 Jul 2021 12:50:17 +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,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) (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 258D08325F for ; Fri, 9 Jul 2021 12:50:14 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=masami.hiramatsu@linaro.org Received: by mail-pl1-x629.google.com with SMTP id x16so3927144plg.3 for ; Fri, 09 Jul 2021 03:50:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=ihGhsZ/OGiIYh+YiH4AhDiuRYA0GuHubZu/tTVVcq+4=; b=u0H4CkCo7VKJZmA6+w2dxCgk4PodGQ3Tv7Svz1gVTr/HB6M7F38SDJXswUGGPE7eBV zLK8CDFdzcpxs17ZtGWsqUhuemE9hAufFAsT+wrDktCg3GmLvo86bH7xmsI+sRVKmcQ1 LRPcAdEe1UTyZGmv6zyDrEX425PbkyBacnNKhOd1EchyIvWLmu+yhGVatq22xKK0CbJ8 AIku4raEF4TszNfMXV+GQvQXN36yWwSbA4fHYhKORtKW3GPn+NPC8J3wwLscoIkZXokP 8Vqioyqf23bOroxn0EyhOIKdZNT7UiM+gw8TbZDGJiPoattry5EqVnK7pDZZK1YGI6Uk h5kw== 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:user-agent:mime-version:content-transfer-encoding; bh=ihGhsZ/OGiIYh+YiH4AhDiuRYA0GuHubZu/tTVVcq+4=; b=aRgdzU9rwDfdQQHZrP7isgOawM89GPCwg8CMYM/hLpEMsi2IEvEtjJhtuhZG1FwNb2 WWCGidp4/ezPAP9xeYlhHcb4DKAFRaMwrdyxwxBUp/nsQg1t+n21pVFd3vo5Bdmh0snl ygG1J8Id3YOWmXk2JtwtA2HRLPQRJdyDma5Pv3MbmfUlVVsfzP3WwKyteWZEEnt3loTM t+TMp7O6FVqDZZMY5WXcUf4rdXSQr4zRA+DiReCkBceSxlZ53wV3N2332MsfaaFArj5d X3R3IAVAf95J2Lak/tdYLQ1BOwsenizGz99XDidnqmUM/mgR6vjQU+8IVzSdPSQyr6ce Hh9A== X-Gm-Message-State: AOAM532B/WJ5xvM7SoXd5lnfrBgxNHyTrHslr9qA7R64aJNZmA8s6bYY qUfUnQrR2ks9l9w1s4gQ3cSPSg== X-Received: by 2002:a17:90a:454b:: with SMTP id r11mr35701713pjm.60.1625827812348; Fri, 09 Jul 2021 03:50:12 -0700 (PDT) Received: from localhost.localdomain (122x208x150x49.ap122.ftth.ucom.ne.jp. [122.208.150.49]) by smtp.gmail.com with ESMTPSA id p3sm6893306pgi.20.2021.07.09.03.50.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Jul 2021 03:50:11 -0700 (PDT) From: Masami Hiramatsu To: Simon Glass , Tom Rini , Heinrich Schuchardt , =?utf-8?q?Marek_Beh=C3=BAn?= Cc: Masami Hiramatsu , Jassi Brar , Ilias Apalodimas , Masahisa Kojima , Takahiro Akashi , u-boot@lists.denx.de Subject: [PATCH 1/6] board: synquacer: Initialize SCBM SMMU at board_init() Date: Fri, 9 Jul 2021 19:50:07 +0900 Message-Id: <162582780755.112250.17538050933760262180.stgit@localhost> X-Mailer: git-send-email 2.25.1 In-Reply-To: <162582779750.112250.1804638357524349747.stgit@localhost> References: <162582779750.112250.1804638357524349747.stgit@localhost> User-Agent: StGit/0.19 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.103.2 at phobos.denx.de X-Virus-Status: Clean Since the SCBM SMMU is not only connected to the NETSEC but also shared with the F_SDH30 (eMMC controller), that should be initialized at board level instead of NETSEC. Move the SMMU initialization code into board support and call it from board_init(). Without this fix, if the NETSEC is disabled, the Linux eMMC ADMA cause an error because SMMU is not initialized. Signed-off-by: Masami Hiramatsu --- board/socionext/developerbox/developerbox.c | 15 +++++++++++++++ drivers/net/sni_netsec.c | 7 ------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/board/socionext/developerbox/developerbox.c b/board/socionext/developerbox/developerbox.c index 34335baec3..9552bfcdc3 100644 --- a/board/socionext/developerbox/developerbox.c +++ b/board/socionext/developerbox/developerbox.c @@ -62,6 +62,19 @@ DECLARE_GLOBAL_DATA_PTR; #define LOAD_OFFSET 0x100 +/* SCBM System MMU is used for eMMC and NETSEC */ +#define SCBM_SMMU_ADDR (0x52e00000UL) +#define SMMU_SCR0_OFFS (0x0) +#define SMMU_SCR0_SHCFG_INNER (0x2 << 22) +#define SMMU_SCR0_MTCFG (0x1 << 20) +#define SMMU_SCR0_MEMATTR_INNER_OUTER_WB (0xf << 16) + +static void synquacer_setup_scbm_smmu(void) +{ + writel(SMMU_SCR0_SHCFG_INNER | SMMU_SCR0_MTCFG | SMMU_SCR0_MEMATTR_INNER_OUTER_WB, + SCBM_SMMU_ADDR + SMMU_SCR0_OFFS); +} + /* * Miscellaneous platform dependent initialisations */ @@ -71,6 +84,8 @@ int board_init(void) gd->env_addr = (ulong)&default_environment[0]; + synquacer_setup_scbm_smmu(); + return 0; } diff --git a/drivers/net/sni_netsec.c b/drivers/net/sni_netsec.c index a9ebf6af9c..4901321d0c 100644 --- a/drivers/net/sni_netsec.c +++ b/drivers/net/sni_netsec.c @@ -1059,18 +1059,11 @@ static int netsec_of_to_plat(struct udevice *dev) return 0; } -#define SMMU_SCR0_SHCFG_INNER (0x2 << 22) -#define SMMU_SCR0_MTCFG (0x1 << 20) -#define SMMU_SCR0_MEMATTR_INNER_OUTER_WB (0xf << 16) - static int netsec_probe(struct udevice *dev) { struct netsec_priv *priv = dev_get_priv(dev); int ret; - writel(SMMU_SCR0_SHCFG_INNER | SMMU_SCR0_MTCFG | SMMU_SCR0_MEMATTR_INNER_OUTER_WB, - (phys_addr_t)0x52E00000); - netsec_reset_hardware(priv, true); ret = netsec_mdiobus_init(priv, dev->name);