Skip to contentSkip to conversation

ARM: S5P: Add support for system mmu

PATCH New Sangbeom Kim 1 participant 2 messages Jan 3, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ARM: S5P: Add support for system mmu

From: Donguk Ryu <[email protected]>

This patch implements system mmu driver.
system mmu support address transition from virtual address to physical address. IP connected system mmu can use directly vitrual address
when IP access physical memory not using physical address

---
 arch/arm/mach-s5pv310/include/mach/irqs.h        |   18 ++
 arch/arm/mach-s5pv310/include/mach/map.h         |   19 ++
 arch/arm/mach-s5pv310/include/mach/regs-sysmmu.h |   33 +++
 arch/arm/mach-s5pv310/include/mach/sysmmu.h      |  119 ++++++++
 arch/arm/plat-s5p/Kconfig                        |   16 +
 arch/arm/plat-s5p/Makefile                       |    1 +
 arch/arm/plat-s5p/include/plat/sysmmu.h          |   23 ++
 arch/arm/plat-s5p/sysmmu.c                       |  331 ++++++++++++++++++++++
 8 files changed, 560 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-s5pv310/include/mach/regs-sysmmu.h
 create mode 100644 arch/arm/mach-s5pv310/include/mach/sysmmu.h
 create mode 100644 arch/arm/plat-s5p/include/plat/sysmmu.h
 create mode 100644 arch/arm/plat-s5p/sysmmu.c
arch/arm/mach-s5pv310/include/mach/irqs.h +18 -0
index 1dd130a..536b0b5 100644
@@ -55,6 +55,24 @@
 #define COMBINER_GROUP(x)	((x) * MAX_IRQ_IN_COMBINER + IRQ_SPI(64))
 #define COMBINER_IRQ(x, y)	(COMBINER_GROUP(x) + y)
 
+#define IRQ_SYSMMU_MDMA0_0	COMBINER_IRQ(4, 0)
+#define IRQ_SYSMMU_SSS_0	COMBINER_IRQ(4, 1)
+#define IRQ_SYSMMU_FIMC0_0	COMBINER_IRQ(4, 2)
+#define IRQ_SYSMMU_FIMC1_0	COMBINER_IRQ(4, 3)
+#define IRQ_SYSMMU_FIMC2_0	COMBINER_IRQ(4, 4)
+#define IRQ_SYSMMU_FIMC3_0	COMBINER_IRQ(4, 5)
+#define IRQ_SYSMMU_JPEG_0	COMBINER_IRQ(4, 6)
+#define IRQ_SYSMMU_2D_0		COMBINER_IRQ(4, 7)
+
+#define IRQ_SYSMMU_ROTATOR_0	COMBINER_IRQ(5, 0)
+#define IRQ_SYSMMU_MDMA1_0	COMBINER_IRQ(5, 1)
+#define IRQ_SYSMMU_LCD0_M0_0	COMBINER_IRQ(5, 2)
+#define IRQ_SYSMMU_LCD1_M1_0	COMBINER_IRQ(5, 3)
+#define IRQ_SYSMMU_TV_M0_0	COMBINER_IRQ(5, 4)
+#define IRQ_SYSMMU_MFC_M0_0	COMBINER_IRQ(5, 5)
+#define IRQ_SYSMMU_MFC_M1_0	COMBINER_IRQ(5, 6)
+#define IRQ_SYSMMU_PCIE_0	COMBINER_IRQ(5, 7)
+
 #define IRQ_PDMA0		COMBINER_IRQ(21, 0)
 #define IRQ_PDMA1		COMBINER_IRQ(21, 1)
 
arch/arm/mach-s5pv310/include/mach/map.h +19 -0
index 44af3e8..71de19f 100644
@@ -106,6 +106,25 @@
 #define S5PV310_PA_SDRAM		(0x40000000)
 #define S5P_PA_SDRAM			S5PV310_PA_SDRAM
 
+#define S5PV310_PA_SYSMMU_MDMA		0x10A40000
+#define S5PV310_PA_SYSMMU_SSS		0x10A50000
+#define S5PV310_PA_SYSMMU_FIMC0		0x11A20000
+#define S5PV310_PA_SYSMMU_FIMC1		0x11A30000
+#define S5PV310_PA_SYSMMU_FIMC2		0x11A40000
+#define S5PV310_PA_SYSMMU_FIMC3		0x11A50000
+#define S5PV310_PA_SYSMMU_JPEG		0x11A60000
+#define S5PV310_PA_SYSMMU_FIMD0		0x11E20000
+#define S5PV310_PA_SYSMMU_FIMD1		0x12220000
+#define S5PV310_PA_SYSMMU_PCIe		0x12620000
+#define S5PV310_PA_SYSMMU_G2D		0x12A20000
+#define S5PV310_PA_SYSMMU_ROTATOR	0x12A30000
+#define S5PV310_PA_SYSMMU_MDMA2		0x12A40000
+#define S5PV310_PA_SYSMMU_TV		0x12E20000
+#define S5PV310_PA_SYSMMU_MFC_L		0x13620000
+#define S5PV310_PA_SYSMMU_MFC_R		0x13630000
+#define S5PV310_SYSMMU_TOTAL_IPNUM	16
+#define S5P_SYSMMU_TOTAL_IPNUM		S5PV310_SYSMMU_TOTAL_IPNUM
+
 /* compatibiltiy defines. */
 #define S3C_PA_UART			S5PV310_PA_UART
 #define S3C_PA_HSMMC0			S5PV310_PA_HSMMC(0)
arch/arm/mach-s5pv310/include/mach/regs-sysmmu.h new file +33 -0
new file mode 100644
index 0000000..e5acfc3
@@ -0,0 +1,33 @@
+/* linux/arch/arm/mach-s5pv310/include/mach/regs-sysmmu.h
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ *		http://www.samsung.com
+ *
+ * S5PV310 - System MMU register
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+#ifndef __ASM_ARCH_REGS_SYSMMU_H
+#define __ASM_ARCH_REGS_SYSMMU_H __FILE__
+
+#define S5P_MMU_CTRL			0x000
+#define S5P_MMU_CFG			0x004
+#define S5P_MMU_STATUS			0x008
+#define S5P_MMU_FLUSH			0x00C
+#define S5P_MMU_FLUSH_ENTRY		0x010
+#define S5P_PT_BASE_ADDR		0x014
+#define S5P_INT_STATUS			0x018
+#define S5P_INT_CLEAR			0x01C
+#define S5P_INT_MASK			0x020
+#define S5P_PAGE_FAULT_ADDR		0x024
+#define S5P_AW_FAULT_ADDR		0x028
+#define S5P_AR_FAULT_ADDR		0x02C
+#define S5P_DEFAULT_SLAVE_ADDR		0x030
+#define S5P_MMU_VERSION			0x034
+#define S5P_TLB_READ			0x038
+#define S5P_TLB_DATA			0x03C
+
+#endif /* __ASM_ARCH_REGS_SYSMMU_H */
arch/arm/mach-s5pv310/include/mach/sysmmu.h new file +119 -0

119 lines not on this page · raw message

arch/arm/plat-s5p/Kconfig +16 -0
index 6a161f3..deb3995 100644
@@ -66,3 +66,19 @@ config S5P_DEV_CSIS1
 	bool
 	help
 	  Compile in platform device definitions for MIPI-CSIS channel 1
+
+menuconfig S5P_SYSMMU
+	bool "SYSMMU support"
+	depends on ARCH_S5PV310
+	help
+	  This is a System MMU driver for Samsung ARM based Soc.
+
+if S5P_SYSMMU
+
+config S5P_SYSMMU_DEBUG
+	bool "Enables debug messages"
+	depends on S5P_SYSMMU
+	help
+	  This enables SYSMMU driver debug massages.
+
+endif
arch/arm/plat-s5p/Makefile +1 -0
index 2b73173..92efe1a 100644
@@ -30,3 +30,4 @@ obj-$(CONFIG_S5P_DEV_FIMC2)	+= dev-fimc2.o
 obj-$(CONFIG_S5P_DEV_ONENAND)	+= dev-onenand.o
 obj-$(CONFIG_S5P_DEV_CSIS0)	+= dev-csis0.o
 obj-$(CONFIG_S5P_DEV_CSIS1)	+= dev-csis1.o
+obj-$(CONFIG_S5P_SYSMMU)	+= sysmmu.o
arch/arm/plat-s5p/include/plat/sysmmu.h new file +23 -0
new file mode 100644
index 0000000..f6d8625
@@ -0,0 +1,23 @@
+/* linux/arch/arm/plat-s5p/include/plat/sysmmu.h
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ *		http://www.samsung.com/
+ *
+ * Samsung sysmmu driver
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+#ifndef __ASM_PLAT_S5P_SYSMMU_H
+#define __ASM_PLAT_S5P_SYSMMU_H __FILE__
+
+/* debug macro */
+#ifdef CONFIG_S5P_SYSMMU_DEBUG
+#define sysmmu_debug(fmt, arg...)	printk(KERN_INFO "[%s] " fmt, __func__, ## arg)
+#else
+#define sysmmu_debug(fmt, arg...)	do { } while (0)
+#endif
+
+#endif /* __ASM_PLAT_S5P_SYSMMU_H */
arch/arm/plat-s5p/sysmmu.c new file +331 -0

331 lines not on this page · raw message

Signature · 1 line
1.6.3.3
#1 lore raw

PATCH 2/2 ARM: S5PV310: Add support system mmu

From: Donguk Ryu <[email protected]>

This patch adds support system mmu for S5PV310 and S5PC210

Signed-off-by Donguk Ryu <du.ryu at samsung.com>
---
 arch/arm/mach-s5pv310/Kconfig             |    6 +
 arch/arm/mach-s5pv310/Makefile            |    1 +
 arch/arm/mach-s5pv310/dev-sysmmu.c        |  187 +++++++++++++++++++++++++++++
 arch/arm/mach-s5pv310/mach-smdkc210.c     |    1 +
 arch/arm/mach-s5pv310/mach-smdkv310.c     |    1 +
 arch/arm/plat-samsung/include/plat/devs.h |    2 +
 6 files changed, 198 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-s5pv310/dev-sysmmu.c
arch/arm/mach-s5pv310/Kconfig +6 -0
index b7aa3cd..3363327 100644
@@ -66,6 +66,11 @@ config S5PV310_SETUP_SDHCI_GPIO
 	help
 	  Common setup code for SDHCI gpio.
 
+config S5PV310_SETUP_SYSMMU
+	bool
+	help
+	  Common setup code for SYSTEM MMU in S5PV310
+
 # machine support
 
 menu "S5PC210 Machines"
@@ -83,6 +88,7 @@ config MACH_SMDKC210
 	select S5PV310_DEV_PD
 	select S5PV310_SETUP_I2C1
 	select S5PV310_SETUP_SDHCI
+	select S5PV310_SETUP_SYSMMU
 	help
 	  Machine support for Samsung SMDKC210
 	  S5PC210(MCP) is one of package option of S5PV310
arch/arm/mach-s5pv310/Makefile +1 -0
index e01a4d0..0a9e7e2 100644
@@ -29,6 +29,7 @@ obj-$(CONFIG_MACH_UNIVERSAL_C210)	+= mach-universal_c210.o
 
 obj-y					+= dev-audio.o
 obj-$(CONFIG_S5PV310_DEV_PD)		+= dev-pd.o
+obj-$(CONFIG_S5PV310_SETUP_SYSMMU)	+= dev-sysmmu.o
 
 obj-$(CONFIG_S5PV310_SETUP_I2C1)	+= setup-i2c1.o
 obj-$(CONFIG_S5PV310_SETUP_I2C2)	+= setup-i2c2.o
arch/arm/mach-s5pv310/dev-sysmmu.c new file +187 -0

187 lines not on this page · raw message

arch/arm/mach-s5pv310/mach-smdkc210.c +1 -0
index 9262966..2d49273 100644
@@ -164,6 +164,7 @@ static struct platform_device *smdkc210_devices[] __initdata = {
 	&s5pv310_device_pd[PD_TV],
 	&s5pv310_device_pd[PD_GPS],
 	&smdkc210_smsc911x,
+	&s5pv310_device_sysmmu,
 };
 
 static void __init smdkc210_smsc911x_init(void)
arch/arm/mach-s5pv310/mach-smdkv310.c +1 -0
index 3eb029c..28680cf 100644
@@ -164,6 +164,7 @@ static struct platform_device *smdkv310_devices[] __initdata = {
 	&s5pv310_device_pd[PD_TV],
 	&s5pv310_device_pd[PD_GPS],
 	&smdkv310_smsc911x,
+	&s5pv310_device_sysmmu,
 };
 
 static void __init smdkv310_smsc911x_init(void)
arch/arm/plat-samsung/include/plat/devs.h +2 -0
index 165fa84..1be1922 100644
@@ -137,6 +137,8 @@ extern struct platform_device s5p_device_fimc2;
 extern struct platform_device s5p_device_mipi_csis0;
 extern struct platform_device s5p_device_mipi_csis1;
 
+extern struct platform_device s5pv310_device_sysmmu;
+
 /* s3c2440 specific devices */
 
 #ifdef CONFIG_CPU_S3C2440
Signature · 1 line
1.6.3.3