summaryrefslogtreecommitdiff
path: root/drivers/platform/sprd/io-sc8830.c
diff options
context:
space:
mode:
authorYuval Adam <_@yuv.al>2017-08-30 08:25:59 +0000
committerYuval Adam <_@yuv.al>2017-08-30 08:25:59 +0000
commit8e4bff4cab0ddac6060645b0715210484d02ff40 (patch)
tree3a5c3024371a04692a3a6d9974d001cdff8ebf84 /drivers/platform/sprd/io-sc8830.c
Initial file dump from open source releaseHEADmaster
Diffstat (limited to 'drivers/platform/sprd/io-sc8830.c')
-rw-r--r--drivers/platform/sprd/io-sc8830.c67
1 files changed, 67 insertions, 0 deletions
diff --git a/drivers/platform/sprd/io-sc8830.c b/drivers/platform/sprd/io-sc8830.c
new file mode 100644
index 00000000..a512c892
--- /dev/null
+++ b/drivers/platform/sprd/io-sc8830.c
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2012 Spreadtrum Communications Inc.
+ * Author: steve.zhan <steve.zhan@spreadtrum.com>
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/bug.h>
+
+#include <asm/io.h>
+#include <asm/page.h>
+#include <asm/mach/map.h>
+
+#include <soc/sprd/hardware.h>
+#include <soc/sprd/arch_misc.h>
+
+#define SPRD_DEVICE(name) { \
+ .virtual = SPRD_##name##_BASE, \
+ .pfn = __phys_to_pfn(SPRD_##name##_PHYS),\
+ .length = SPRD_##name##_SIZE, \
+ .type = MT_DEVICE_NONSHARED, \
+ }
+#define SPRD_IRAM(name) { \
+ .virtual = SPRD_##name##_BASE, \
+ .pfn = __phys_to_pfn(SPRD_##name##_PHYS),\
+ .length = SPRD_##name##_SIZE, \
+ .type = MT_MEMORY, \
+ }
+
+static struct map_desc sprd_io_desc[] __initdata = {
+ SPRD_DEVICE(UART0),
+ SPRD_DEVICE(UART1),
+ SPRD_DEVICE(UART2),
+ SPRD_DEVICE(UART3),
+ SPRD_DEVICE(UART4),
+#ifdef CONFIG_ARCH_SCX20L
+ SPRD_DEVICE(ARM7AHBRF),
+#endif
+
+ SPRD_IRAM(IRAM0),
+ SPRD_IRAM(IRAM0H),
+#if defined(CONFIG_ARCH_SCX30G)
+ SPRD_IRAM(IRAM1),
+ SPRD_DEVICE(LPDDR2_PHY),
+#else
+ SPRD_DEVICE(IRAM1),
+#endif
+#ifndef CONFIG_ARCH_SCX35L
+ SPRD_DEVICE(IRAM2),
+#endif
+ SPRD_DEVICE(PWM),
+ SPRD_DEVICE(LPDDR2),
+};
+
+void __init sci_map_io(void)
+{
+ iotable_init(sprd_io_desc, ARRAY_SIZE(sprd_io_desc));
+}
+