Added I/O port support to Tizen VPCI
authorStanislav Vorobiov <s.vorobiov@samsung.com>
Tue, 3 Jul 2012 12:21:20 +0000 (16:21 +0400)
committerEvgeny Voevodin <e.voevodin@samsung.com>
Fri, 14 Sep 2012 05:42:22 +0000 (09:42 +0400)
arch/arm/Kconfig
arch/arm/configs/tizen_defconfig
arch/arm/mach-exynos/common.c
arch/arm/mach-exynos/include/mach/io.h [new file with mode: 0644]
arch/arm/mach-exynos/tizen-vpci.c
arch/arm/mach-exynos/tizen-vpci.h

index ae53a038e39900bbed898f301c9be89ccb524dc2..86529240951c26937d02f86c5fd67fb84f588254 100644 (file)
@@ -890,6 +890,7 @@ config ARCH_EXYNOS
        select HAVE_S3C_RTC if RTC_CLASS
        select HAVE_S3C2410_I2C if I2C
        select HAVE_S3C2410_WATCHDOG if WATCHDOG
+       select NEED_MACH_IO_H
        select NEED_MACH_MEMORY_H
        help
          Support for SAMSUNG's EXYNOS SoCs (EXYNOS4/5)
index c87c98899fd68b848778ff323c86101bee3dc511..e9551caebb57a2d33840e83199c63286ab899ec4 100644 (file)
@@ -1,3 +1,7 @@
+#
+# Automatically generated file; DO NOT EDIT.
+# Linux/arm 3.4.0 Kernel Configuration
+#
 CONFIG_ARM=y
 CONFIG_MIGHT_HAVE_PCI=y
 CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -22,6 +26,7 @@ CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_NEED_DMA_MAP_STATE=y
 CONFIG_VECTORS_BASE=0xffff0000
 CONFIG_ARM_PATCH_PHYS_VIRT=y
+CONFIG_NEED_MACH_IO_H=y
 CONFIG_NEED_MACH_MEMORY_H=y
 CONFIG_GENERIC_BUG=y
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
@@ -74,7 +79,6 @@ CONFIG_TREE_PREEMPT_RCU=y
 CONFIG_PREEMPT_RCU=y
 CONFIG_RCU_FANOUT=32
 # CONFIG_RCU_FANOUT_EXACT is not set
-# CONFIG_RCU_FAST_NO_HZ is not set
 # CONFIG_TREE_RCU_TRACE is not set
 # CONFIG_RCU_BOOST is not set
 # CONFIG_IKCONFIG is not set
@@ -310,6 +314,7 @@ CONFIG_S3C_DEV_HSMMC1=y
 CONFIG_S3C_DEV_HSMMC2=y
 CONFIG_S3C_DEV_HSMMC3=y
 CONFIG_S3C_DEV_I2C1=y
+CONFIG_S3C_DEV_I2C3=y
 CONFIG_S3C_DEV_I2C5=y
 CONFIG_S3C_DEV_I2C6=y
 CONFIG_S3C_DEV_I2C7=y
@@ -369,7 +374,7 @@ CONFIG_ARCH_EXYNOS4=y
 CONFIG_CPU_EXYNOS4210=y
 CONFIG_SOC_EXYNOS4212=y
 CONFIG_SOC_EXYNOS4412=y
-# CONFIG_EXYNOS4_MCT is not set
+CONFIG_EXYNOS4_MCT=y
 CONFIG_TIZEN_PWM=y
 CONFIG_EXYNOS4_DEV_DMA=y
 CONFIG_EXYNOS4_DEV_AHCI=y
@@ -377,6 +382,7 @@ CONFIG_EXYNOS4_SETUP_FIMD0=y
 CONFIG_EXYNOS4_DEV_SYSMMU=y
 CONFIG_EXYNOS4_DEV_USB_OHCI=y
 CONFIG_EXYNOS4_SETUP_I2C1=y
+CONFIG_EXYNOS4_SETUP_I2C3=y
 CONFIG_EXYNOS4_SETUP_I2C5=y
 CONFIG_EXYNOS4_SETUP_I2C6=y
 CONFIG_EXYNOS4_SETUP_I2C7=y
@@ -493,7 +499,6 @@ CONFIG_TIZEN_VPCI=y
 #
 # Kernel Features
 #
-# CONFIG_TICK_ONESHOT is not set
 # CONFIG_NO_HZ is not set
 # CONFIG_HIGH_RES_TIMERS is not set
 CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
@@ -507,7 +512,7 @@ CONFIG_HAVE_ARM_SCU=y
 # CONFIG_VMSPLIT_3G is not set
 CONFIG_VMSPLIT_2G=y
 # CONFIG_VMSPLIT_1G is not set
-CONFIG_PAGE_OFFSET=0xC0000000
+CONFIG_PAGE_OFFSET=0x80000000
 CONFIG_NR_CPUS=2
 CONFIG_HOTPLUG_CPU=y
 # CONFIG_LOCAL_TIMERS is not set
@@ -1086,6 +1091,7 @@ CONFIG_NET_CORE=y
 # CONFIG_EQUALIZER is not set
 # CONFIG_NET_FC is not set
 CONFIG_MII=y
+# CONFIG_IFB is not set
 # CONFIG_NET_TEAM is not set
 # CONFIG_MACVLAN is not set
 # CONFIG_NETCONSOLE is not set
@@ -1264,6 +1270,7 @@ CONFIG_PHYLIB=y
 # CONFIG_USB_PEGASUS is not set
 # CONFIG_USB_RTL8150 is not set
 # CONFIG_USB_USBNET is not set
+# CONFIG_USB_CDC_PHONET is not set
 # CONFIG_USB_IPHETH is not set
 CONFIG_WLAN=y
 # CONFIG_ATMEL is not set
@@ -1811,6 +1818,7 @@ CONFIG_RADIO_ADAPTERS=y
 #
 # Graphics support
 #
+# CONFIG_VGA_ARB is not set
 CONFIG_DRM=y
 CONFIG_DRM_KMS_HELPER=y
 # CONFIG_DRM_LOAD_EDID_FIRMWARE is not set
@@ -1925,7 +1933,6 @@ CONFIG_SND_SEQUENCER=y
 # CONFIG_SND_MIXER_OSS is not set
 # CONFIG_SND_PCM_OSS is not set
 # CONFIG_SND_SEQUENCER_OSS is not set
-# CONFIG_SND_HRTIMER is not set
 # CONFIG_SND_DYNAMIC_MINORS is not set
 CONFIG_SND_SUPPORT_OLD_API=y
 CONFIG_SND_VERBOSE_PROCFS=y
index f6bc922fed31fc07c0497452596938496f2bcd27..ad64ecb7d007bfea6786c206d87ac314e593ce62 100644 (file)
@@ -309,6 +309,12 @@ void __init exynos_init_io(struct map_desc *mach_desc, int size)
 
 #ifdef CONFIG_TIZEN_VPCI
 static struct map_desc tizen_vpci_iodesc[] __initdata = {
+    {
+        .virtual    = (unsigned long)TIZEN_VPCI_IO_VIRT_BASE,
+        .pfn        = __phys_to_pfn(TIZEN_VPCI_IO_BASE),
+        .length     = TIZEN_VPCI_IO_BASE_SIZE,
+        .type       = MT_DEVICE,
+    },
     {
         .virtual    = (unsigned long)TIZEN_VPCI_CFG_VIRT_BASE,
         .pfn        = __phys_to_pfn(TIZEN_VPCI_CFG_BASE),
diff --git a/arch/arm/mach-exynos/include/mach/io.h b/arch/arm/mach-exynos/include/mach/io.h
new file mode 100644 (file)
index 0000000..38ba4b4
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+ * arch/arm/mach-exynos4/include/mach/io.h
+ */
+
+#ifndef __ASM_ARCH_IO_H
+#define __ASM_ARCH_IO_H
+
+#ifdef CONFIG_TIZEN_VPCI
+#define IO_SPACE_LIMIT 0xffffffff
+
+#define TIZEN_VPCI_IO_VIRT_BASE (void __iomem *)0xf4ff0000ul
+
+#define __io(a) ((void __iomem *)(TIZEN_VPCI_IO_VIRT_BASE + (a)))
+#else
+#define __io(a) __typesafe_io(a)
+#endif
+
+#endif
index 1aff9717f90005d8a206bdf3d3a68f17f8c72479..ea4eff02481cebd367d4d1dafb4ea7827ae6a29a 100644 (file)
@@ -139,8 +139,8 @@ static struct pci_ops tizen_vpci_ops = {
 
 static struct resource io_mem = {
     .name   = "PCI I/O space",
-    .start  = TIZEN_VPCI_MEM_BASE0,
-    .end    = TIZEN_VPCI_MEM_BASE0+TIZEN_VPCI_MEM_BASE0_SIZE-1,
+    .start  = TIZEN_VPCI_IO_OFFSET,
+    .end    = TIZEN_VPCI_IO_BASE_SIZE-1,
     .flags  = IORESOURCE_IO,
 };
 
@@ -162,7 +162,7 @@ static int __init tizen_vpci_setup_resources(struct pci_sys_data *sys)
 {
     int ret = 0;
 
-    ret = request_resource(&iomem_resource, &io_mem);
+    ret = request_resource(&ioport_resource, &io_mem);
     if (ret) {
         printk(KERN_ERR "PCI: unable to allocate I/O "
                "memory region (%d)\n", ret);
@@ -210,6 +210,7 @@ int __init tizen_vpci_setup(int nr, struct pci_sys_data *sys)
 
     if (nr == 0) {
         sys->mem_offset = 0;
+        sys->io_offset = 0;
         ret = tizen_vpci_setup_resources(sys);
         if (ret < 0) {
             printk("tizen_vpci_setup: resources... oops?\n");
@@ -272,8 +273,8 @@ struct pci_bus * __init tizen_vpci_scan_bus(int nr, struct pci_sys_data *sys)
 
 void __init tizen_vpci_preinit(void)
 {
-    pcibios_min_io = TIZEN_VPCI_MEM_BASE0_SIZE;
-    pcibios_min_mem = TIZEN_VPCI_MEM_BASE1_SIZE;
+    pcibios_min_io = TIZEN_VPCI_IO_OFFSET;
+    pcibios_min_mem = TIZEN_VPCI_MEM_BASE1;
 }
 
 static int __init tizen_vpci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
index 752716007325717d9675a3bd1bc004c4110e1f9e..4a8d6d491a5d73cef30f08b6ffe2e12d94c18583 100644 (file)
 
 /* PCI space */
 #define TIZEN_VPCI_CFG_BASE         0xC2000000
-#define TIZEN_VPCI_MEM_BASE0        0xC3000000
+#define TIZEN_VPCI_IO_BASE          0xC3000000
+#define TIZEN_VPCI_IO_OFFSET        0x00000100 /* 256b */
 #define TIZEN_VPCI_MEM_BASE1        0xD0000000
 #define TIZEN_VPCI_MEM_BASE2        0xE0000000
 /* Sizes of above maps */
 #define TIZEN_VPCI_CFG_BASE_SIZE    0x01000000
-#define TIZEN_VPCI_MEM_BASE0_SIZE   0x0C000000   /* 32Mb */
-#define TIZEN_VPCI_MEM_BASE1_SIZE   0x10000000   /* 256Mb */
-#define TIZEN_VPCI_MEM_BASE2_SIZE   0x10000000   /* 256Mb */
+#define TIZEN_VPCI_IO_BASE_SIZE     0x0000FFFF /* 64Kb */
+#define TIZEN_VPCI_MEM_BASE1_SIZE   0x10000000 /* 256Mb */
+#define TIZEN_VPCI_MEM_BASE2_SIZE   0x10000000 /* 256Mb */
 
 /* PCI interrupts */
 #define TIZEN_VPCI_IRQ0 IRQ_EINT(8)