All of lore.kernel.org
 help / color / mirror / Atom feed
From: kostap at marvell.com <kostap@marvell.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 2/5] arm64: mvebu: a8k: Add support for NAND clock get
Date: Wed, 5 Apr 2017 18:22:31 +0300	[thread overview]
Message-ID: <1491405753-10451-1-git-send-email-kostap@marvell.com> (raw)

From: Konstantin Porotchkin <kostap@marvell.com>

Implement mvebu_get_nand_clock call for A8K family.
This function is used by PXA3XX NAND driver.

Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
Cc: Stefan Roese <sr@denx.de>
Cc: Igal Liberman <igall@marvell.com>
Cc: Nadav Haklai <nadavh@marvell.com>
---
Changes from v1:
- Add TODO notice for moving the functionality to a future clock driver

 arch/arm/mach-mvebu/armada8k/cpu.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/arch/arm/mach-mvebu/armada8k/cpu.c b/arch/arm/mach-mvebu/armada8k/cpu.c
index 2325e9a..38e7d33 100644
--- a/arch/arm/mach-mvebu/armada8k/cpu.c
+++ b/arch/arm/mach-mvebu/armada8k/cpu.c
@@ -110,3 +110,21 @@ void reset_cpu(ulong ignored)
 	reg &= ~(1 << RFU_SW_RESET_OFFSET);
 	writel(reg, RFU_GLOBAL_SW_RST);
 }
+
+/*
+ * TODO - implement this functionality using platform
+ *        clock driver once it gets available
+ * Return NAND clock in Hz
+ */
+u32 mvebu_get_nand_clock(void)
+{
+	unsigned long NAND_FLASH_CLK_CTRL = 0xF2440700UL;
+	unsigned long NF_CLOCK_SEL_MASK = 0x1;
+	u32 reg;
+
+	reg = readl(NAND_FLASH_CLK_CTRL);
+	if (reg & NF_CLOCK_SEL_MASK)
+		return 400 * 1000000;
+	else
+		return 250 * 1000000;
+}
-- 
2.7.4

             reply	other threads:[~2017-04-05 15:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-05 15:22 kostap at marvell.com [this message]
2017-04-05 15:22 ` [U-Boot] [PATCH v2 4/5] arm64: a8k: dts: Add support for NAND devices on A8K platform kostap at marvell.com
2017-05-08  9:59   ` Stefan Roese
2017-05-09 14:40   ` Stefan Roese
2017-04-05 15:22 ` [U-Boot] [PATCH v2 5/5] arm64: mvebu: a8k: Add NAND configuration parameters kostap at marvell.com
2017-05-08 10:00   ` Stefan Roese
2017-05-09 14:40   ` Stefan Roese
2017-05-08  9:59 ` [U-Boot] [PATCH v2 2/5] arm64: mvebu: a8k: Add support for NAND clock get Stefan Roese
2017-05-09 14:39 ` Stefan Roese

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=1491405753-10451-1-git-send-email-kostap@marvell.com \
    --to=kostap@marvell.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.