mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-16 15:34:48 +08:00
95360fd636
Misc board updates: - Greg added a handful of boards to KS8695 (since he has stepped up to maintain it). - Qualcomm has added DT-only board support for a couple of their newer SoCs. - misc other updates for Samsung and Freescale boards. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQIcBAABAgAGBQJQaO5+AAoJEIwa5zzehBx34OAP/00W1eziYwliv08FeQ4M6Rum OSFI1qBXubCZwyzczyM7r6ArnhdmJz0e2p1WEbS1hIQRjYR+pTwzBOSRsU460WsM Hy3CYV7SQb551rEC3yPoVst24TgBoDJah3UORfEmi0hIMoWDPqEV/erpI2+sSLzz KbQpI6C8V4MvLELSM1YxljorT50cRmoD+J1bdO6jI68bAwIMWBVPhezqg4/k8Gkh TqfP2zoc/O9jlc6zgMJc1T+M/CLyFYJeV63dNQ4ER54NFdUs+NdHItNHjJlGAOSQ 2e4NDUKKklxLUno+kyTiTkWkFEgxu9W8XLZi6CLNGCO4gsiM8ljVAdW0xuWeXFkX 1OucFrBYEMonKEEWURvtNpYyEu9/Wz5WCInmqM5u92w/+GIzBYzr6sbircCOAXBv UlVmvIltrhpTPkAuLkG/hL6KVV2UiNcr2hgALlhhnQ68hTzGGZrvUWuNCB6zjrHF okl1bmo6kjtj9A09YmXFEPL8l8q9hRWirWTnyLWAjoeDY1juy+SdVx+8CJy/2ua5 QllqN3SGOX2WVMuBo6C24lwRa21cQ7Ax8GCavuKKB0eyIrWer1pVhO6xZCwii1gG iZgpaOZpeOe4lms1oD2RqjV8GlW6DQAaLINlqHzj3G/BcRTMN4S/QD2S47yMgCPc Kf1zsyukeBhfVWTUULEE =fe76 -----END PGP SIGNATURE----- Merge tag 'boards' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc Pull ARM soc board specific updates from Olof Johansson: "Misc board updates: - Greg added a handful of boards to KS8695 (since he has stepped up to maintain it). - Qualcomm has added DT-only board support for a couple of their newer SoCs. - misc other updates for Samsung and Freescale boards." Fix up trivial conflict in arch/arm/mach-shmobile/board-armadillo800eva.c due to gpio device data being added next to hdmi device data that got moved. * tag 'boards' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: ARM: msm: Allow 8960 and 8660 to compile together ARM: msm: Allow msm_iomap-8x60 and msm_iomap-8960 to coexist ARM: EXYNOS: Add generic PWM lookup support for SMDKV310 ARM: EXYNOS: Add generic PWM lookup support for SMDK4X12 ARM: EXYNOS: Use generic pwm driver in Origen board ARM: shmobile: armadillo800eva: Add support RTC ARM: ks8695: add board support for the OpenGear boards based on the KS8695 ARM: ks8695: add board support for the SnapGear boards based on the KS8695 ARM: dts: Add heartbeat gpio-leds support to Origen ARM: dts: Use active low flag for gpio-keys on Origen ARM: shmobile: marzen: enable thermal sensor ARM: shmobile: marzen: fixup regulator id for smsc911x ARM: shmobile: marzen: add SDHI0 support ARM: mmp: enable debug uart port in defconfig ARM: mmp: implement DEBUG_LL port choice ARM: S3C64XX: Register audio platform devices for Bells on Cragganmore ARM: S3C64XX: Update configuration for WM5102 module on Cragganmore ARM: mx27pdk: Add audio support ARM: ttc_dkb: add nand support
189 lines
5.2 KiB
C
189 lines
5.2 KiB
C
/* arch/arm/mach-msm/io.c
|
|
*
|
|
* MSM7K, QSD io support
|
|
*
|
|
* Copyright (C) 2007 Google, Inc.
|
|
* Copyright (c) 2008-2011, Code Aurora Forum. All rights reserved.
|
|
* Author: Brian Swetland <swetland@google.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/io.h>
|
|
#include <linux/export.h>
|
|
|
|
#include <mach/hardware.h>
|
|
#include <asm/page.h>
|
|
#include <mach/msm_iomap.h>
|
|
#include <asm/mach/map.h>
|
|
|
|
#include <mach/board.h>
|
|
|
|
#include "common.h"
|
|
|
|
#define MSM_CHIP_DEVICE_TYPE(name, chip, mem_type) { \
|
|
.virtual = (unsigned long) MSM_##name##_BASE, \
|
|
.pfn = __phys_to_pfn(chip##_##name##_PHYS), \
|
|
.length = chip##_##name##_SIZE, \
|
|
.type = mem_type, \
|
|
}
|
|
|
|
#define MSM_DEVICE_TYPE(name, mem_type) \
|
|
MSM_CHIP_DEVICE_TYPE(name, MSM, mem_type)
|
|
#define MSM_CHIP_DEVICE(name, chip) \
|
|
MSM_CHIP_DEVICE_TYPE(name, chip, MT_DEVICE)
|
|
#define MSM_DEVICE(name) MSM_CHIP_DEVICE(name, MSM)
|
|
|
|
#if defined(CONFIG_ARCH_MSM7X00A)
|
|
static struct map_desc msm_io_desc[] __initdata = {
|
|
MSM_DEVICE_TYPE(VIC, MT_DEVICE_NONSHARED),
|
|
MSM_CHIP_DEVICE_TYPE(CSR, MSM7X00, MT_DEVICE_NONSHARED),
|
|
MSM_DEVICE_TYPE(DMOV, MT_DEVICE_NONSHARED),
|
|
MSM_CHIP_DEVICE_TYPE(GPIO1, MSM7X00, MT_DEVICE_NONSHARED),
|
|
MSM_CHIP_DEVICE_TYPE(GPIO2, MSM7X00, MT_DEVICE_NONSHARED),
|
|
MSM_DEVICE_TYPE(CLK_CTL, MT_DEVICE_NONSHARED),
|
|
#if defined(CONFIG_DEBUG_MSM_UART1) || defined(CONFIG_DEBUG_MSM_UART2) || \
|
|
defined(CONFIG_DEBUG_MSM_UART3)
|
|
MSM_DEVICE_TYPE(DEBUG_UART, MT_DEVICE_NONSHARED),
|
|
#endif
|
|
{
|
|
.virtual = (unsigned long) MSM_SHARED_RAM_BASE,
|
|
.pfn = __phys_to_pfn(MSM_SHARED_RAM_PHYS),
|
|
.length = MSM_SHARED_RAM_SIZE,
|
|
.type = MT_DEVICE,
|
|
},
|
|
};
|
|
|
|
void __init msm_map_common_io(void)
|
|
{
|
|
/* Make sure the peripheral register window is closed, since
|
|
* we will use PTE flags (TEX[1]=1,B=0,C=1) to determine which
|
|
* pages are peripheral interface or not.
|
|
*/
|
|
asm("mcr p15, 0, %0, c15, c2, 4" : : "r" (0));
|
|
iotable_init(msm_io_desc, ARRAY_SIZE(msm_io_desc));
|
|
}
|
|
#endif
|
|
|
|
#ifdef CONFIG_ARCH_QSD8X50
|
|
static struct map_desc qsd8x50_io_desc[] __initdata = {
|
|
MSM_DEVICE(VIC),
|
|
MSM_CHIP_DEVICE(CSR, QSD8X50),
|
|
MSM_DEVICE(DMOV),
|
|
MSM_CHIP_DEVICE(GPIO1, QSD8X50),
|
|
MSM_CHIP_DEVICE(GPIO2, QSD8X50),
|
|
MSM_DEVICE(CLK_CTL),
|
|
MSM_DEVICE(SIRC),
|
|
MSM_DEVICE(SCPLL),
|
|
MSM_DEVICE(AD5),
|
|
MSM_DEVICE(MDC),
|
|
#if defined(CONFIG_DEBUG_MSM_UART1) || defined(CONFIG_DEBUG_MSM_UART2) || \
|
|
defined(CONFIG_DEBUG_MSM_UART3)
|
|
MSM_DEVICE(DEBUG_UART),
|
|
#endif
|
|
{
|
|
.virtual = (unsigned long) MSM_SHARED_RAM_BASE,
|
|
.pfn = __phys_to_pfn(MSM_SHARED_RAM_PHYS),
|
|
.length = MSM_SHARED_RAM_SIZE,
|
|
.type = MT_DEVICE,
|
|
},
|
|
};
|
|
|
|
void __init msm_map_qsd8x50_io(void)
|
|
{
|
|
iotable_init(qsd8x50_io_desc, ARRAY_SIZE(qsd8x50_io_desc));
|
|
}
|
|
#endif /* CONFIG_ARCH_QSD8X50 */
|
|
|
|
#ifdef CONFIG_ARCH_MSM8X60
|
|
static struct map_desc msm8x60_io_desc[] __initdata = {
|
|
MSM_CHIP_DEVICE(QGIC_DIST, MSM8X60),
|
|
MSM_CHIP_DEVICE(QGIC_CPU, MSM8X60),
|
|
MSM_CHIP_DEVICE(TMR, MSM8X60),
|
|
MSM_CHIP_DEVICE(TMR0, MSM8X60),
|
|
#ifdef CONFIG_DEBUG_MSM8660_UART
|
|
MSM_DEVICE(DEBUG_UART),
|
|
#endif
|
|
};
|
|
|
|
void __init msm_map_msm8x60_io(void)
|
|
{
|
|
iotable_init(msm8x60_io_desc, ARRAY_SIZE(msm8x60_io_desc));
|
|
}
|
|
#endif /* CONFIG_ARCH_MSM8X60 */
|
|
|
|
#ifdef CONFIG_ARCH_MSM8960
|
|
static struct map_desc msm8960_io_desc[] __initdata = {
|
|
MSM_CHIP_DEVICE(QGIC_DIST, MSM8960),
|
|
MSM_CHIP_DEVICE(QGIC_CPU, MSM8960),
|
|
MSM_CHIP_DEVICE(TMR, MSM8960),
|
|
MSM_CHIP_DEVICE(TMR0, MSM8960),
|
|
#ifdef CONFIG_DEBUG_MSM8960_UART
|
|
MSM_DEVICE(DEBUG_UART),
|
|
#endif
|
|
};
|
|
|
|
void __init msm_map_msm8960_io(void)
|
|
{
|
|
iotable_init(msm8960_io_desc, ARRAY_SIZE(msm8960_io_desc));
|
|
}
|
|
#endif /* CONFIG_ARCH_MSM8960 */
|
|
|
|
#ifdef CONFIG_ARCH_MSM7X30
|
|
static struct map_desc msm7x30_io_desc[] __initdata = {
|
|
MSM_DEVICE(VIC),
|
|
MSM_CHIP_DEVICE(CSR, MSM7X30),
|
|
MSM_DEVICE(DMOV),
|
|
MSM_CHIP_DEVICE(GPIO1, MSM7X30),
|
|
MSM_CHIP_DEVICE(GPIO2, MSM7X30),
|
|
MSM_DEVICE(CLK_CTL),
|
|
MSM_DEVICE(CLK_CTL_SH2),
|
|
MSM_DEVICE(AD5),
|
|
MSM_DEVICE(MDC),
|
|
MSM_DEVICE(ACC),
|
|
MSM_DEVICE(SAW),
|
|
MSM_DEVICE(GCC),
|
|
MSM_DEVICE(TCSR),
|
|
#if defined(CONFIG_DEBUG_MSM_UART1) || defined(CONFIG_DEBUG_MSM_UART2) || \
|
|
defined(CONFIG_DEBUG_MSM_UART3)
|
|
MSM_DEVICE(DEBUG_UART),
|
|
#endif
|
|
{
|
|
.virtual = (unsigned long) MSM_SHARED_RAM_BASE,
|
|
.pfn = __phys_to_pfn(MSM_SHARED_RAM_PHYS),
|
|
.length = MSM_SHARED_RAM_SIZE,
|
|
.type = MT_DEVICE,
|
|
},
|
|
};
|
|
|
|
void __init msm_map_msm7x30_io(void)
|
|
{
|
|
iotable_init(msm7x30_io_desc, ARRAY_SIZE(msm7x30_io_desc));
|
|
}
|
|
#endif /* CONFIG_ARCH_MSM7X30 */
|
|
|
|
void __iomem *__msm_ioremap_caller(unsigned long phys_addr, size_t size,
|
|
unsigned int mtype, void *caller)
|
|
{
|
|
if (mtype == MT_DEVICE) {
|
|
/* The peripherals in the 88000000 - D0000000 range
|
|
* are only accessible by type MT_DEVICE_NONSHARED.
|
|
* Adjust mtype as necessary to make this "just work."
|
|
*/
|
|
if ((phys_addr >= 0x88000000) && (phys_addr < 0xD0000000))
|
|
mtype = MT_DEVICE_NONSHARED;
|
|
}
|
|
|
|
return __arm_ioremap_caller(phys_addr, size, mtype, caller);
|
|
}
|