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 X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E5360C07E99 for ; Fri, 9 Jul 2021 10:50:24 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 48EC1613C2 for ; Fri, 9 Jul 2021 10:50:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 48EC1613C2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de 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) 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-Google-Smtp-Source: ABdhPJy3LJucdp+14j5YD+ta9NbEWyBPAUKVJkuB+WR8TzfZuKXAoaIilmx9OAOw1AoWtoaI7Z262g== 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=20Beh=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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit 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);