From patchwork Sun Jul 11 00:46:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masami Hiramatsu X-Patchwork-Id: 472714 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp1661876jao; Sat, 10 Jul 2021 17:46:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyiPVLezg5KMIeSBCPH/bkshIvaILEU52OG1NgvylBLpVP1tVEGmCHTMGedie2xi5ikioND X-Received: by 2002:a17:906:4fca:: with SMTP id i10mr46101685ejw.335.1625964377939; Sat, 10 Jul 2021 17:46:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625964377; cv=none; d=google.com; s=arc-20160816; b=dzJRFPXZk4I5nFXpzcul2qb88cLHQhYlI+js/k8A5oSCn6Ns39bfYKh7hqYHxYX0iM WGS4hAPv9Zjx1WHDoSSjw/X1eGMJzQlwgqU3gFYdk44puO20ck9MrZjmHq0jEpSHNnmB exdYfzmDf5l5tWJVOFBzKDj80holvoF5NxyOhZPT6HR2FE2aISlviGZjASsF0UWtK6iI XJ/atXwD7irf/4m/tOIrPRo9rClmsJ7ZMMwxMqEwbFgYSXGAIxlYl+r+oZPDD5ICOHkW E8qIn0RdcfMEBBU+4Y4RqVRLSe0HERf0Ona0ZY/ZVSZsFw9trEBn/0HUSazwKt6PzCqJ un/w== 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=cKl9IRQMLu726qLk4x1Eku0g9pHLbqKLUVM9R5d7iacdpldczcY9C0sPFByTb21MVl Xgk0mNQD6muOlaj5lmnfX6EpJ+29VfgJLC1B5FXsU3EdD7QGfOTv+JILtx+pIk8sFZfB S5TKWR6ew9krqn2JGXnK+ae7VcejcNigaQ6AoFPFBGHY0Yugr78Sxnz44zBYzcXI9ZgB 1UVXGHZkGSebT414Sfxob+JjqmQvDCnsjoc+/o/NOUlz9FWy+rcw5u0LNQ6Sn24VUNZY H7LbnoBGwGYNjfuSCQ1QXDAUQ80EaSTk1IgVe4FClmTvE5cm8FGx74SRHUhtQ9SX5H1v 69uQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SGeRMUpX; 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 hr24si13620673ejc.277.2021.07.10.17.46.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jul 2021 17:46:17 -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=SGeRMUpX; 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 E0952832D7; Sun, 11 Jul 2021 02:46:11 +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="SGeRMUpX"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B23D4832D7; Sun, 11 Jul 2021 02:46:10 +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-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) (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 68F75831C7 for ; Sun, 11 Jul 2021 02:46:07 +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-x634.google.com with SMTP id u3so1967067plf.5 for ; Sat, 10 Jul 2021 17:46:07 -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=SGeRMUpX28tM2lV6Cj71GB5NWr1qVXlO4EHs4YImEqsi5KxX5IHIzOJ3rwHAZR7jOj HaZjw/g6ppqTkTrGOvKxOFIsM9Cpnzbjgkt+3zd5UZGZf5Cukg0TGdv0SazqQJ1RzcyX WsLWc8ZByHf0jfjrQKVAMDouyLNBub6TVOn0PLQKw7dk0YhQCDpe0zlMy8E1WU8yZY4F AJ3nZT2K5jaoySgEcLKLWEM97Zyqt/0h9FvvNFwvRcJIA3xu9bG37+9tyozSFgDJ+xUi 2n+jhD0BppAvDNIo1gv3lBVvrct8IAnfEEVHnxLBlFXD5PF4wgrrLdsvpQtnCJd7yeRk ufJw== 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=YXtc1ShaDEBmjaxF6vfqTG6y1Em44kA00/Z2IF62spgu1gaLccU+msIh1aspUWtTft hE5nOFZzNcoB4IlZaZLr6EHwjucWRDAQ9AYeGeaKlHv1bO+2/3kMppTcKTWgTJOgTZ/V tBSfhv8eoZdldC/9S/k+GpmWC6LocL70j6UhjN2D4CtzPcs3uzpsRxnp5D8BuWClJEdb irfq1xyDbxYVdwZwNNJgd7TwMrfEGHa0CAilYP29FBqRKxvSHw2JbPyYgU/a5LwiyGa8 tBSnnkBPjGnEPq5dCmy89J2/NLlQFzoi3SvmJdRiOMoGRifB3gcR/IIEQrMElvn4mkDe gJeQ== X-Gm-Message-State: AOAM5330IFyEpvgyRkH4kRTjYNO0NgEUMeSJe1YSW2JTER83idRyktD6 tDJGRq6+crjUZcJkcyj14Gs7NQ== X-Received: by 2002:a17:902:8505:b029:129:c61e:e335 with SMTP id bj5-20020a1709028505b0290129c61ee335mr17752160plb.60.1625964365738; Sat, 10 Jul 2021 17:46:05 -0700 (PDT) Received: from localhost.localdomain (122x208x150x49.ap122.ftth.ucom.ne.jp. [122.208.150.49]) by smtp.gmail.com with ESMTPSA id x6sm13038909pgq.67.2021.07.10.17.46.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jul 2021 17:46:05 -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 v2 1/6] board: synquacer: Initialize SCBM SMMU at board_init() Date: Sun, 11 Jul 2021 09:46:01 +0900 Message-Id: <162596436114.156585.16044692546474285389.stgit@localhost> X-Mailer: git-send-email 2.25.1 In-Reply-To: <162596435163.156585.9583856356967436590.stgit@localhost> References: <162596435163.156585.9583856356967436590.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);