summaryrefslogtreecommitdiffstats
path: root/recipes-bsp/u-boot/u-boot-v2012.04.01/0003-MX53-add-function-to-set-SATA-clock-to-internal.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-bsp/u-boot/u-boot-v2012.04.01/0003-MX53-add-function-to-set-SATA-clock-to-internal.patch')
-rw-r--r--recipes-bsp/u-boot/u-boot-v2012.04.01/0003-MX53-add-function-to-set-SATA-clock-to-internal.patch77
1 files changed, 77 insertions, 0 deletions
diff --git a/recipes-bsp/u-boot/u-boot-v2012.04.01/0003-MX53-add-function-to-set-SATA-clock-to-internal.patch b/recipes-bsp/u-boot/u-boot-v2012.04.01/0003-MX53-add-function-to-set-SATA-clock-to-internal.patch
new file mode 100644
index 0000000..2a4eb94
--- /dev/null
+++ b/recipes-bsp/u-boot/u-boot-v2012.04.01/0003-MX53-add-function-to-set-SATA-clock-to-internal.patch
@@ -0,0 +1,77 @@
1From b22729b27625107061733c718cb49a394fd41a4a Mon Sep 17 00:00:00 2001
2From: Stefano Babic <sbabic@denx.de>
3Date: Wed, 22 Feb 2012 00:24:38 +0000
4Subject: [PATCH 03/56] MX53: add function to set SATA clock to internal
5
6The MX53 SATA interface can use an internal clock (USB PHY1)
7instead of an external clock. This is an undocumented feature, but used
8on most Freescale's evaluation boards, such as MX53-loco.
9
10As stated by Freescale's support:
11
12Fuses (but not pins) may be used to configure SATA clocks.
13Particularly the i.MX53 Fuse_Map contains the next information
14about configuring SATA clocks :
15 SATA_ALT_REF_CLK[1:0] (offset 0x180C)
16
17'00' - 100MHz (External)
18'01' - 50MHz (External)
19'10' - 120MHz, internal (USB PHY)
20'11' - Reserved
21
22Signed-off-by: Stefano Babic <sbabic@denx.de>
23CC: Fabio Estevam <fabio.estevam@freescale.com>
24---
25 arch/arm/cpu/armv7/mx5/clock.c | 24 ++++++++++++++++++++++++
26 arch/arm/include/asm/arch-mx5/clock.h | 1 +
27 2 files changed, 25 insertions(+)
28
29diff --git a/arch/arm/cpu/armv7/mx5/clock.c b/arch/arm/cpu/armv7/mx5/clock.c
30index 8f8d01c..d769a4d 100644
31--- a/arch/arm/cpu/armv7/mx5/clock.c
32+++ b/arch/arm/cpu/armv7/mx5/clock.c
33@@ -399,6 +399,30 @@ u32 imx_get_fecclk(void)
34 return mxc_get_clock(MXC_IPG_CLK);
35 }
36
37+#ifdef CONFIG_MX53
38+/*
39+ * The clock for the external interface can be set to use internal clock
40+ * if fuse bank 4, row 3, bit 2 is set.
41+ * This is an undocumented feature and it was confirmed by Freescale's support:
42+ * Fuses (but not pins) may be used to configure SATA clocks.
43+ * Particularly the i.MX53 Fuse_Map contains the next information
44+ * about configuring SATA clocks : SATA_ALT_REF_CLK[1:0] (offset 0x180C)
45+ * '00' - 100MHz (External)
46+ * '01' - 50MHz (External)
47+ * '10' - 120MHz, internal (USB PHY)
48+ * '11' - Reserved
49+*/
50+void mxc_set_sata_internal_clock(void)
51+{
52+ u32 *tmp_base =
53+ (u32 *)(IIM_BASE_ADDR + 0x180c);
54+
55+ set_usb_phy1_clk();
56+
57+ writel((readl(tmp_base) & (~0x7)) | 0x4, tmp_base);
58+}
59+#endif
60+
61 /*
62 * Dump some core clockes.
63 */
64diff --git a/arch/arm/include/asm/arch-mx5/clock.h b/arch/arm/include/asm/arch-mx5/clock.h
65index f9f82f3..e822809 100644
66--- a/arch/arm/include/asm/arch-mx5/clock.h
67+++ b/arch/arm/include/asm/arch-mx5/clock.h
68@@ -45,5 +45,6 @@ void set_usb_phy2_clk(void);
69 void enable_usb_phy2_clk(unsigned char enable);
70 void set_usboh3_clk(void);
71 void enable_usboh3_clk(unsigned char enable);
72+void mxc_set_sata_internal_clock(void);
73
74 #endif /* __ASM_ARCH_CLOCK_H */
75--
761.7.10
77