From 8e4bff4cab0ddac6060645b0715210484d02ff40 Mon Sep 17 00:00:00 2001 From: Yuval Adam <_@yuv.al> Date: Wed, 30 Aug 2017 08:25:59 +0000 Subject: Initial file dump from open source release --- drivers/platform/sprd/io-sc8830.c | 67 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 drivers/platform/sprd/io-sc8830.c (limited to 'drivers/platform/sprd/io-sc8830.c') 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 + * 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 +#include +#include + +#include +#include +#include + +#include +#include + +#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)); +} + -- cgit v1.3.1