public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Vasanth Ananthan <vasanthananthan@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 1/4] Exynos5: Add clock support for SATA
Date: Fri, 23 Nov 2012 17:38:55 +0530	[thread overview]
Message-ID: <1353672538-15610-2-git-send-email-vasanthananthan@gmail.com> (raw)
In-Reply-To: <1353672538-15610-1-git-send-email-vasanthananthan@gmail.com>

This patch adds clock support for SATA

Signed-off-by: Vasanth Ananthan <vasanth.a@samsung.com>
---
 arch/arm/cpu/armv7/exynos/clock.c      |   22 ++++++++++++++++++++++
 arch/arm/include/asm/arch-exynos/clk.h |    1 +
 2 files changed, 23 insertions(+)

diff --git a/arch/arm/cpu/armv7/exynos/clock.c b/arch/arm/cpu/armv7/exynos/clock.c
index fe61f88..22b327b 100644
--- a/arch/arm/cpu/armv7/exynos/clock.c
+++ b/arch/arm/cpu/armv7/exynos/clock.c
@@ -26,6 +26,7 @@
 #include <asm/arch/clock.h>
 #include <asm/arch/clk.h>
 #include <asm/arch/periph.h>
+#include <asm/errno.h>
 
 /* Epll Clock division values to achive different frequency output */
 static struct set_epll_con_val exynos5_epll_div[] = {
@@ -326,6 +327,19 @@ static unsigned long exynos4_get_uart_clk(int dev_index)
 	return uclk;
 }
 
+static unsigned long exynos5_get_sata_clk(void)
+{
+	struct exynos5_clock *clk =
+		(struct exynos5_clock *)samsung_get_base_clock();
+
+	/*
+	* This clock is used as a input for 1ms timer, so return
+	* the clock equivalent to 1 MHz
+	*/
+
+	return CONFIG_SYS_CLK_FREQ / 10;
+}
+
 /* exynos5: return uart clock frequency */
 static unsigned long exynos5_get_uart_clk(int dev_index)
 {
@@ -963,6 +977,14 @@ unsigned long get_uart_clk(int dev_index)
 		return exynos4_get_uart_clk(dev_index);
 }
 
+unsigned long get_sata_clock(void)
+{
+	if (cpu_is_exynos5())
+		return exynos5_get_sata_clk();
+
+	return -ENOSYS;
+}
+
 void set_mmc_clk(int dev_index, unsigned int div)
 {
 	if (cpu_is_exynos5())
diff --git a/arch/arm/include/asm/arch-exynos/clk.h b/arch/arm/include/asm/arch-exynos/clk.h
index cd12323..182ed95 100644
--- a/arch/arm/include/asm/arch-exynos/clk.h
+++ b/arch/arm/include/asm/arch-exynos/clk.h
@@ -42,5 +42,6 @@ void set_i2s_clk_source(void);
 int set_i2s_clk_prescaler(unsigned int src_frq, unsigned int dst_frq);
 int set_epll_clk(unsigned long rate);
 int set_spi_clk(int periph_id, unsigned int rate);
+unsigned long get_sata_clk(void);
 
 #endif
-- 
1.7.9.5

  reply	other threads:[~2012-11-23 12:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-23 12:08 [U-Boot] [PATCH v2 0/4] Support for SATA on EXYNOS5 Vasanth Ananthan
2012-11-23 12:08 ` Vasanth Ananthan [this message]
2012-11-23 12:08 ` [U-Boot] [PATCH v2 2/4] Exynos5: Add base addresses for SATA Vasanth Ananthan
2012-11-23 12:08 ` [U-Boot] [PATCH v2 3/4] Drivers: block: Support for SATA in Exynos5 Vasanth Ananthan
2012-11-23 15:41   ` Luka Perkov
2012-11-23 12:08 ` [U-Boot] [PATCH v2 4/4] SMDK55250: Enable SATA Vasanth Ananthan

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=1353672538-15610-2-git-send-email-vasanthananthan@gmail.com \
    --to=vasanthananthan@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox