summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorHao Zhang <hzhang@ti.com>2014-07-09 19:48:43 +0300
committerTom Rini <trini@ti.com>2014-07-25 16:26:10 -0400
commit4984bce41fe78da160ccdad573b09b40e277ec7a (patch)
tree3da5d2729d1eb33a439557982d3b864a0e4cfb3d /arch
parent35c547c2bc59dd63cdf76f81abe26f68e9eaf7fb (diff)
downloadu-boot-imx-4984bce41fe78da160ccdad573b09b40e277ec7a.zip
u-boot-imx-4984bce41fe78da160ccdad573b09b40e277ec7a.tar.gz
u-boot-imx-4984bce41fe78da160ccdad573b09b40e277ec7a.tar.bz2
keystone2: move cpu_to_bus() to keystone.c
The SoC related common functions in board.c should be placed to a common keystone.c arch file. Acked-by: Murali Karicheri <m-maricheri2@ti.com> Signed-off-by: Hao Zhang <hzhang@ti.com> Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/cpu/armv7/keystone/Makefile1
-rw-r--r--arch/arm/cpu/armv7/keystone/keystone.c28
2 files changed, 29 insertions, 0 deletions
diff --git a/arch/arm/cpu/armv7/keystone/Makefile b/arch/arm/cpu/armv7/keystone/Makefile
index 02ecf7e..64e42a6 100644
--- a/arch/arm/cpu/armv7/keystone/Makefile
+++ b/arch/arm/cpu/armv7/keystone/Makefile
@@ -14,3 +14,4 @@ obj-$(CONFIG_DRIVER_TI_KEYSTONE_NET) += keystone_nav.o
obj-y += msmc.o
obj-$(CONFIG_SPL_BUILD) += spl.o
obj-y += ddr3.o
+obj-y += keystone.o
diff --git a/arch/arm/cpu/armv7/keystone/keystone.c b/arch/arm/cpu/armv7/keystone/keystone.c
new file mode 100644
index 0000000..48c8690
--- /dev/null
+++ b/arch/arm/cpu/armv7/keystone/keystone.c
@@ -0,0 +1,28 @@
+/*
+ * Keystone EVM : Board initialization
+ *
+ * (C) Copyright 2014
+ * Texas Instruments Incorporated, <www.ti.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <asm/arch/hardware.h>
+
+/**
+ * cpu_to_bus - swap bytes of the 32-bit data if the device is BE
+ * @ptr - array of data
+ * @length - lenght of data array
+ */
+int cpu_to_bus(u32 *ptr, u32 length)
+{
+ u32 i;
+
+ if (!(readl(K2HK_DEVSTAT) & 0x1))
+ for (i = 0; i < length; i++, ptr++)
+ *ptr = cpu_to_be32(*ptr);
+
+ return 0;
+}