From: Masami Hiramatsu <masami.hiramatsu@linaro.org>
To: "Simon Glass" <sjg@chromium.org>, "Tom Rini" <trini@konsulko.com>,
"Heinrich Schuchardt" <xypron.glpk@gmx.de>,
"Marek Behún" <marek.behun@nic.cz>
Cc: Masami Hiramatsu <masami.hiramatsu@linaro.org>,
Jassi Brar <jaswinder.singh@linaro.org>,
Ilias Apalodimas <ilias.apalodimas@linaro.org>,
Masahisa Kojima <masahisa.kojima@linaro.org>,
Takahiro Akashi <takahiro.akashi@linaro.org>,
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 [thread overview]
Message-ID: <162582780755.112250.17538050933760262180.stgit@localhost> (raw)
In-Reply-To: <162582779750.112250.1804638357524349747.stgit@localhost>
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 <masami.hiramatsu@linaro.org>
---
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);
next prev parent reply other threads:[~2021-07-09 10:50 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-09 10:49 [PATCH 0/6] arm64: synquacer: DeveloperBox updates Masami Hiramatsu
2021-07-09 10:50 ` Masami Hiramatsu [this message]
2021-07-09 10:50 ` [PATCH 2/6] configs: synquacer: Make U-Boot binary position independent Masami Hiramatsu
2021-07-09 10:52 ` Marek Behún
2021-07-10 10:12 ` Masami Hiramatsu
2021-07-09 10:50 ` [PATCH 3/6] dts: synquacer: Add partition information to the spi-nor Masami Hiramatsu
2021-07-09 10:54 ` Marek Behún
2021-07-09 11:27 ` Masami Hiramatsu
2021-07-09 12:06 ` Marek Behún
2021-07-09 10:50 ` [PATCH 4/6] configs: synquacer: Remove mtdparts settings and update DFU setting Masami Hiramatsu
2021-07-09 10:50 ` [PATCH 5/6] configs: synquacer: Drop Ext2/4 support by default Masami Hiramatsu
2021-07-09 10:50 ` [PATCH 6/6] configs: synquacer: Enable UEFI secure boot Masami Hiramatsu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=162582780755.112250.17538050933760262180.stgit@localhost \
--to=masami.hiramatsu@linaro.org \
--cc=ilias.apalodimas@linaro.org \
--cc=jaswinder.singh@linaro.org \
--cc=marek.behun@nic.cz \
--cc=masahisa.kojima@linaro.org \
--cc=sjg@chromium.org \
--cc=takahiro.akashi@linaro.org \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
--cc=xypron.glpk@gmx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.