@@ -38,7 +38,8 @@ obj-y += dev-audio.o
obj-$(CONFIG_EXYNOS4_DEV_AHCI) += dev-ahci.o
obj-$(CONFIG_EXYNOS4_DEV_PD) += dev-pd.o
obj-$(CONFIG_EXYNOS4_DEV_SYSMMU) += dev-sysmmu.o
-obj-$(CONFIG_EXYNOS4_DEV_DWMCI) += dev-dwmci.o
+obj-$(CONFIG_EXYNOS4_DEV_DWMCI) += dev-dwmci.o
+obj-$(CONFIG_EXYNOS4_THERMAL) += dev-tmu.o
obj-$(CONFIG_EXYNOS4_SETUP_FIMC) += setup-fimc.o
obj-$(CONFIG_EXYNOS4_SETUP_FIMD0) += setup-fimd0.o
new file mode 100644
@@ -0,0 +1,71 @@
+/* linux/arch/arm/plat-exynos4/dev-tmu.c
+ *
+ * Copyright 2011 by SAMSUNG
+ *
+ * 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.
+ */
+
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/platform_device.h>
+#include <linux/slab.h>
+#include <asm/irq.h>
+
+#include <mach/irqs.h>
+#include <mach/map.h>
+#include <plat/devs.h>
+#include <mach/exynos4-tmu.h>
+
+static struct resource exynos4_tmu_resource[] = {
+ [0] = {
+ .start = EXYNOS4_PA_TMU,
+ .end = EXYNOS4_PA_TMU + 0xFFFF - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ [1] = {
+ .start = IRQ_TMU_TRIG0,
+ .end = IRQ_TMU_TRIG0,
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+struct platform_device exynos4_device_tmu = {
+ .name = "exynos4-tmu",
+ .id = -1,
+ .num_resources = ARRAY_SIZE(exynos4_tmu_resource),
+ .resource = exynos4_tmu_resource,
+};
+EXPORT_SYMBOL(exynos4_device_tmu);
+
+static struct tmu_data default_tmu_data __initdata = {
+ .te1 = 0, /* cooling stop temp */
+ .te2 = 0, /* cooling stop temp */
+ .cooling = 84, /*Cooling temp*/
+ .mode = 0, /* 0: 1-point compensation, 1: 2-point compensation */
+};
+
+int exynos4_tmu_get_irqno(int num)
+{
+ return platform_get_irq(&exynos4_device_tmu, num);
+}
+
+struct tmu_platform_device *exynos4_tmu_get_platdata(void)
+{
+ return platform_get_drvdata(&exynos4_device_tmu);
+}
+
+void __init exynos4_tmu_set_platdata(struct tmu_data *pd)
+{
+ struct tmu_platform_device *npd;
+ npd = kmalloc(sizeof(struct tmu_platform_device), GFP_KERNEL);
+ if (!npd)
+ printk(KERN_ERR "%s: no memory for platform data\n", __func__);
+ if (!pd)
+ memcpy(&npd->data, &default_tmu_data, sizeof(struct tmu_data));
+ else
+ memcpy(&npd->data, pd, sizeof(struct tmu_data));
+
+ platform_set_drvdata(&exynos4_device_tmu, npd);
+}
@@ -119,6 +119,9 @@
#define COMBINER_GROUP(x) ((x) * MAX_IRQ_IN_COMBINER + IRQ_SPI(128))
#define COMBINER_IRQ(x, y) (COMBINER_GROUP(x) + y)
+#define IRQ_TMU_TRIG0 COMBINER_IRQ(2, 4)
+#define IRQ_TMU_TRIG1 COMBINER_IRQ(3, 4)
+
#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)
@@ -66,6 +66,7 @@
#define EXYNOS4_PA_COREPERI 0x10500000
#define EXYNOS4_PA_TWD 0x10500600
#define EXYNOS4_PA_L2CC 0x10502000
+#define EXYNOS4_PA_TMU 0x100C0000
#define EXYNOS4_PA_MDMA 0x10810000
#define EXYNOS4_PA_PDMA0 0x12680000
new file mode 100644
@@ -0,0 +1,58 @@
+/* linux/arch/arm/mach-exynos4/include/mach/regs-tmu.h
+
+* Copyright (c) 2011 Samsung Electronics Co., Ltd.
+* http://www.samsung.com/
+*
+* EXYNOS4 - Clock register definitions
+*
+* 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_THERMAL_H
+#define __ASM_ARCH_REGS_THERMAL_H __FILE__
+
+/*Register definations*/
+#define TRIMINFO (0x0)
+#define TRIMINFO_CONFIG (0x10)
+#define TRIMINFO_CONTROL (0x14)
+#define TMU_CON0 (0x20)
+#define TMU_CON1 (0x24)
+#define TMU_STATUS (0x28)
+#define SAMPLING_INTERNAL (0x2C)
+#define CNT_VALUE0 (0x30)
+#define CNT_VALUE1 (0x34)
+#define CURRENT_TEMP (0x40)
+#define THRESHOLD_TEMP (0x44)
+#define TRG_LEV0 (0x50)
+#define TRG_LEV1 (0x54)
+#define TRG_LEV2 (0x58)
+#define TRG_LEV3 (0x5C)
+#define PAST_TMEP0 (0x60)
+#define PAST_TMEP1 (0x64)
+#define PAST_TMEP2 (0x68)
+#define PAST_TMEP3 (0x6C)
+#define INTEN (0x70)
+#define INTSTAT (0x74)
+#define INTCLEAR (0x78)
+
+/*Register control bits*/
+#define INTEN0 (1)
+#define INTEN1 (1<<4)
+#define INTEN2 (1<<8)
+#define INTEN3 (1<<12)
+
+#define TRIM_TEMP_MASK (0xFF)
+
+#define INTCLEAR0 (1)
+#define INTCLEAR1 (1<<4)
+#define INTCLEAR2 (1<<8)
+#define INTCLEAR3 (1<<12)
+
+#define INTSTAT0 (1)
+#define INTSTAT1 (1<<4)
+#define INTSTAT2 (1<<8)
+#define INTSTAT3 (1<<12)
+
+#endif
@@ -149,6 +149,8 @@ extern struct platform_device s5p_device_ehci;
extern struct platform_device exynos4_device_sysmmu;
+extern struct platform_device exynos4_device_tmu;
+
/* s3c2440 specific devices */
#ifdef CONFIG_CPU_S3C2440