From patchwork Mon Jul 12 10:35:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masami Hiramatsu X-Patchwork-Id: 473073 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp2805242jao; Mon, 12 Jul 2021 03:35:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxQDar06XQTHV2LpOOKsdtx+ckC2WUfX70+QRQB+VZpAESXxC/yDFP30krAFsHOYTo1L4Vk X-Received: by 2002:a17:907:72ce:: with SMTP id du14mr52132991ejc.529.1626086156873; Mon, 12 Jul 2021 03:35:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626086156; cv=none; d=google.com; s=arc-20160816; b=auMnQ7zG9+WhOCjzJDF/Ik3G13MWKXKvski5oJkhJM3ZGarHpWTKbM3CizgjXbsXo/ IrSSQywCdNieLHKRZxd9wBleccQJ5ceRjeOy/2fh+YDljwStjCrzT3C5YrGptBjB8kUm pYML3jheFA2l0K6N6u3r2NUpFNu9au/x8biiCa+PQNEqPsBBZnf+FaF8b9uDKpMvgCsA 7oz63kbMfRANf974Z4Xl/Bo3hoozh6979ODIZsgG6JyBm6iIy93soMUtt5gB7vs3NCz2 xF3nheAXTEp5vXiBz8O2WhhERWZ32cKCi4W1n7cbETeAYiuiniX6nabj/7UjB64t+hwg 4XlQ== 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=p4ZJM+Aem+CN5BIUwnWEZua4z9hILMLwxpKXNIJQfcXvgz3HgBhjkqk4HbeY8DEMKr oJzOvURYgpneGGiPJ8GK8D6u1LmX59eqcrg9g+Qd/cebLW+nAg0F/IbsfZ6K4Z7v9TYO GlCjNMvQClYuvA6riHBIHZahKlKHsPCvo5xFHOoAafmcGdrlbHHPVMB6sBju4xwDBRY3 amsDCKz/ehQOlrV1yrG9M9UvKGDP2fhPPelUQuQRkUOuFABWMW5btVD5x8rXQ/ILtiFw D7gD8egtjAwKg5Q80P4RzgKOdyGCYtxSueFe7pPFtWAW9ON8FEVcq73Vs++D3zoJiXSb JZ5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SqxmHRZ1; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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. [85.214.62.61]) by mx.google.com with ESMTPS id w19si16609530edv.129.2021.07.12.03.35.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jul 2021 03:35:56 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SqxmHRZ1; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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 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) 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-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-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_Beh=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 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);