From: "Álvaro Fernández Rojas" <noltari@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/4] dm: ram: bmips: add BCM6318 support
Date: Sat, 20 Jan 2018 14:17:23 +0100 [thread overview]
Message-ID: <20180120131725.4451-3-noltari@gmail.com> (raw)
In-Reply-To: <20180120131725.4451-1-noltari@gmail.com>
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
---
drivers/ram/bmips_ram.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/drivers/ram/bmips_ram.c b/drivers/ram/bmips_ram.c
index 3f9d9a8566..7a5dfac4ab 100644
--- a/drivers/ram/bmips_ram.c
+++ b/drivers/ram/bmips_ram.c
@@ -23,6 +23,8 @@
#define SDRAM_CFG_32B_MASK (1 << SDRAM_CFG_32B_SHIFT)
#define SDRAM_CFG_BANK_SHIFT 13
#define SDRAM_CFG_BANK_MASK (1 << SDRAM_CFG_BANK_SHIFT)
+#define SDRAM_6318_SPACE_SHIFT 4
+#define SDRAM_6318_SPACE_MASK (0xf << SDRAM_6318_SPACE_SHIFT)
#define MEMC_CFG_REG 0x4
#define MEMC_CFG_32B_SHIFT 1
@@ -45,6 +47,16 @@ struct bmips_ram_priv {
const struct bmips_ram_hw *hw;
};
+static ulong bcm6318_get_ram_size(struct bmips_ram_priv *priv)
+{
+ u32 val;
+
+ val = readl_be(priv->regs + SDRAM_CFG_REG);
+ val = (val & SDRAM_6318_SPACE_MASK) >> SDRAM_6318_SPACE_SHIFT;
+
+ return (1 << (val + 20));
+}
+
static ulong bcm6328_get_ram_size(struct bmips_ram_priv *priv)
{
return readl_be(priv->regs + DDR_CSEND_REG) << 24;
@@ -102,6 +114,10 @@ static const struct ram_ops bmips_ram_ops = {
.get_info = bmips_ram_get_info,
};
+static const struct bmips_ram_hw bmips_ram_bcm6318 = {
+ .get_ram_size = bcm6318_get_ram_size,
+};
+
static const struct bmips_ram_hw bmips_ram_bcm6328 = {
.get_ram_size = bcm6328_get_ram_size,
};
@@ -116,6 +132,9 @@ static const struct bmips_ram_hw bmips_ram_bcm6358 = {
static const struct udevice_id bmips_ram_ids[] = {
{
+ .compatible = "brcm,bcm6318-mc",
+ .data = (ulong)&bmips_ram_bcm6318,
+ }, {
.compatible = "brcm,bcm6328-mc",
.data = (ulong)&bmips_ram_bcm6328,
}, {
--
2.11.0
next prev parent reply other threads:[~2018-01-20 13:17 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-20 13:17 [U-Boot] [PATCH 0/4] mips: bmips: add BCM6318 SoC support Álvaro Fernández Rojas
2018-01-20 13:17 ` [U-Boot] [PATCH 1/4] dm: cpu: bmips: add BCM6318 support Álvaro Fernández Rojas
2018-01-20 13:17 ` Álvaro Fernández Rojas [this message]
2018-01-20 13:17 ` [U-Boot] [PATCH 3/4] MIPS: add support for Broadcom MIPS BCM6318 SoC family Álvaro Fernández Rojas
2018-01-20 13:17 ` [U-Boot] [PATCH 4/4] MIPS: add BMIPS Comtrend AR-5315u board Álvaro Fernández Rojas
2018-01-20 18:16 ` [U-Boot] [PATCH v2 0/4] mips: bmips: add BCM6318 SoC support Álvaro Fernández Rojas
2018-01-20 18:16 ` [U-Boot] [PATCH v2 1/4] dm: cpu: bmips: add BCM6318 support Álvaro Fernández Rojas
2018-01-21 16:47 ` Daniel Schwierzeck
2018-01-21 17:04 ` Daniel Schwierzeck
2018-01-20 18:16 ` [U-Boot] [PATCH v2 2/4] dm: ram: " Álvaro Fernández Rojas
2018-01-21 16:47 ` Daniel Schwierzeck
2018-01-21 17:03 ` Daniel Schwierzeck
2018-01-20 18:16 ` [U-Boot] [PATCH v2 3/4] MIPS: add support for Broadcom MIPS BCM6318 SoC family Álvaro Fernández Rojas
2018-01-21 16:47 ` Daniel Schwierzeck
2018-01-20 18:16 ` [U-Boot] [PATCH v2 4/4] MIPS: add BMIPS Comtrend AR-5315u board Álvaro Fernández Rojas
2018-01-21 16:48 ` Daniel Schwierzeck
2018-01-26 12:17 ` [U-Boot] [PATCH 0/4] mips: bmips: add BCM6318 SoC support Daniel Schwierzeck
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=20180120131725.4451-3-noltari@gmail.com \
--to=noltari@gmail.com \
--cc=u-boot@lists.denx.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.