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=-18.8 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,URIBL_BLOCKED, 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 7F1D3C07E99 for ; Mon, 12 Jul 2021 10:35:57 +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 C664F6100C for ; Mon, 12 Jul 2021 10:35:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C664F6100C 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 5BA3182DA9; Mon, 12 Jul 2021 12:35:54 +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="SqxmHRZ1"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5A12A82DB4; Mon, 12 Jul 2021 12:35:53 +0200 (CEST) Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) (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 1FDD382DA1 for ; Mon, 12 Jul 2021 12:35:50 +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-pf1-x430.google.com with SMTP id p22so3033258pfh.8 for ; Mon, 12 Jul 2021 03:35:50 -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=SqxmHRZ1R4rQu9zlbMOt4gL4hOKgIypNYLTFUHgHWf84/t39rjHIf1V/YtI+0ochDA EKJcNQSRnqtsSQQ5UofpxtDRt2LeP1k+FsIhjmWsjQAhpZ2YtV7fmkFDGX8ZKXtIMRnQ ez28hNElvFH8EuE1wVZQYLmmwEVqzvyn3rPQqxYI+725h9yuYYYYyBhbjZIJ/c9hSt3B fERYP5srHvrKLGv4XZx7kqd+r4DD6VYBbkm6TzkIEPxyG6Dxay2z5zfFqb9MSSJnzwLF J0aW2x2HJS6hk7UPuHyY/6OqcKIGACeLdh6M2qnVZQG8v1oBTdTgpFKy1DcuifPsKR9p 7XoA== 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=BzLB7zLAzUH4xmAgJlMDxmA23jzkGyK8NzwYly5eplTuhhcXeGtza/mMNADkGsefv9 2z1ZaYCvUHO121ZQt8V7drGLOqscB3P21sXSyD8r/zCk59JTR+jD7WXeMEH1ng7i7aBC ZsV5f3c9Zq356MrRmrEEYqqSzMtDyVfcIzruPxC+OVLp0Zuaq8fLImksFyELCJHcRR88 Kid0eZfK5UM9TtGhqx+sWfR5UfeLWKyaeaBmZP3Im9xERUCUGZQtRJlF1x0aiXqMVamK d4hB5rhnocB1IyHuBU4mQQM8yoTma8JIh+JKDNRAnrAS8F9y235PK/kyQs/dcjR250Rt eGOA== X-Gm-Message-State: AOAM531ehRR2SRgoQJcg6FFnXhbZ2TRyGycxYNFcncDgrI05D0DJQJ8P 9tuhVzYdFNldCKIfS4sGgAUeLA== X-Google-Smtp-Source: ABdhPJzExW8hq2Z9Kqb9zMVaRFVzGlP7yV5U/CcDJ9PrpkQdUpejTgE345/JnsGYAGsJpCns5OCr/g== X-Received: by 2002:a62:ea1a:0:b029:329:a95a:fab with SMTP id t26-20020a62ea1a0000b0290329a95a0fabmr13838418pfh.31.1626086148560; Mon, 12 Jul 2021 03:35:48 -0700 (PDT) Received: from localhost.localdomain (122x208x150x49.ap122.ftth.ucom.ne.jp. [122.208.150.49]) by smtp.gmail.com with ESMTPSA id k10sm15295871pfc.169.2021.07.12.03.35.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jul 2021 03:35:48 -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 v3 1/8] board: synquacer: Initialize SCBM SMMU at board_init() Date: Mon, 12 Jul 2021 19:35:44 +0900 Message-Id: <162608614422.206671.16863457236408720329.stgit@localhost> X-Mailer: git-send-email 2.25.1 In-Reply-To: <162608613498.206671.7144957749931134518.stgit@localhost> References: <162608613498.206671.7144957749931134518.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);