summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-imx/boot.c
diff options
context:
space:
mode:
authorMarc Kleine-Budde <mkl@pengutronix.de>2013-03-14 18:38:44 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2013-03-26 10:20:17 +0100
commitc74fb45f6427256a530bbf6682b10908942a3644 (patch)
treef1c30a5c3df9e79c10e0a7d30d8a0d36311cceee /arch/arm/mach-imx/boot.c
parent39c350aa507984dfe363cbea994b41ce1440947b (diff)
downloadbarebox-c74fb45f6427256a530bbf6682b10908942a3644.tar.gz
barebox-c74fb45f6427256a530bbf6682b10908942a3644.tar.xz
ARM i.MX bootsource: add separate function for mx25 and mx35
This patch creates a seperate function for mx25 and mx35 to save it's bootsource. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-imx/boot.c')
-rw-r--r--arch/arm/mach-imx/boot.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/arch/arm/mach-imx/boot.c b/arch/arm/mach-imx/boot.c
index 473b9d19c0..95a76739e7 100644
--- a/arch/arm/mach-imx/boot.c
+++ b/arch/arm/mach-imx/boot.c
@@ -18,6 +18,8 @@
#include <io.h>
#include <mach/generic.h>
+#include <mach/imx25-regs.h>
+#include <mach/imx35-regs.h>
static const char *bootsource_str[] = {
[BOOTSOURCE_UNKNOWN] = "unknown",
@@ -94,7 +96,7 @@ static const enum imx_bootsource locations[4][4] = {
* Note also that I suspect that the boot source pins are only sampled at
* power up.
*/
-void imx_25_35_boot_save_loc(unsigned int ctrl, unsigned int type)
+static void imx25_35_boot_save_loc(unsigned int ctrl, unsigned int type)
{
enum imx_bootsource src;
@@ -103,6 +105,24 @@ void imx_25_35_boot_save_loc(unsigned int ctrl, unsigned int type)
imx_set_bootsource(src);
}
+void imx25_boot_save_loc(void __iomem *ccm_base)
+{
+ uint32_t val;
+
+ val = readl(ccm_base + MX25_CCM_RCSR);
+ imx25_35_boot_save_loc((val >> MX25_CCM_RCSR_MEM_CTRL_SHIFT) & 0x3,
+ (val >> MX25_CCM_RCSR_MEM_TYPE_SHIFT) & 0x3);
+}
+
+void imx35_boot_save_loc(void __iomem *ccm_base)
+{
+ uint32_t val;
+
+ val = readl(ccm_base + MX35_CCM_RCSR);
+ imx25_35_boot_save_loc((val >> MX35_CCM_RCSR_MEM_CTRL_SHIFT) & 0x3,
+ (val >> MX35_CCM_RCSR_MEM_TYPE_SHIFT) & 0x3);
+}
+
#define IMX27_SYSCTRL_GPCR 0x18
#define IMX27_GPCR_BOOT_SHIFT 16
#define IMX27_GPCR_BOOT_MASK (0xf << IMX27_GPCR_BOOT_SHIFT)