From patchwork Mon Apr 14 07:17:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tarek Dakhran X-Patchwork-Id: 3976951 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E5D359F2CC for ; Mon, 14 Apr 2014 07:21:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E99BB201C8 for ; Mon, 14 Apr 2014 07:21:17 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8DD74201BC for ; Mon, 14 Apr 2014 07:21:06 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WZb9y-0004ay-OH; Mon, 14 Apr 2014 07:18:30 +0000 Received: from mailout3.w1.samsung.com ([210.118.77.13]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WZb9w-0004Tq-8b for linux-arm-kernel@lists.infradead.org; Mon, 14 Apr 2014 07:18:29 +0000 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N4000944EY1W670@mailout3.w1.samsung.com> for linux-arm-kernel@lists.infradead.org; Mon, 14 Apr 2014 08:18:02 +0100 (BST) X-AuditID: cbfec7f5-b7fc96d000004885-52-534b8ba97429 Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 1A.AD.18565.9AB8B435; Mon, 14 Apr 2014 08:18:01 +0100 (BST) Received: from foo.rnd.samsung.ru ([106.109.9.130]) by eusync3.samsung.com (Oracle Communications Messaging Server 7u4-23.01 (7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0N400036UEXI6L90@eusync3.samsung.com>; Mon, 14 Apr 2014 08:18:01 +0100 (BST) From: Tarek Dakhran To: linux-kernel@vger.kernel.org Subject: [PATCH v8 1/3] ARM: EXYNOS: Add support for EXYNOS5410 SoC Date: Mon, 14 Apr 2014 11:17:38 +0400 Message-id: <1397459860-21869-2-git-send-email-t.dakhran@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1397459860-21869-1-git-send-email-t.dakhran@samsung.com> References: <1397459860-21869-1-git-send-email-t.dakhran@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrELMWRmVeSWpSXmKPExsVy+t/xq7oru72DDX7d17WYtO4Ak8XD9TdZ LOYfOcdq0f9mIavF/0evWS3OvVrJaNG74CqbxdmmN+wWmx5fY7VY2LaExeLyrjlsFjPO72Oy uH2Z12Lp9YtMFk8nXGSzmDB9LYvFupfTWSxa9x5ht9jys4PR4nfPJ2aL9c9PMVqsn/GaxeLY jCWMFlNn/GB3kPBYM28No0dLcw+bx+W+XiaPv6teMHvsnHWX3WPl8i9sHptWdbJ5vFo9k9Xj zrU9bB6bl9R7vLrG4tG3ZRWjx/Zr85g9Pm+SC+CL4rJJSc3JLEst0rdL4Mq4uf0je8FRy4rT u08zNzBeMOhi5OSQEDCRmDZzPTuELSZx4d56ti5GLg4hgaWMEhvmX2KBcDqZJE5MXsPaxcjB wSagLbFlhxdIg4iAgsTm3mesIDXMAp/YJH6samICSQgLOEtcuHmBDaSeRUBV4vwyAxCTV8BV YuujTBBTAqh1ziQbkGJOATeJjd9WMIPYQkAV36btY5/AyLuAkWEVo2hqaXJBcVJ6rpFecWJu cWleul5yfu4mRkg8fd3BuPSY1SFGAQ5GJR5ejq2ewUKsiWXFlbmHGCU4mJVEeLdleAUL8aYk VlalFuXHF5XmpBYfYmTi4JRqYLxddo5X/1O5xaOCBXZrt/6c/cqvrJFTsEd61rVTiwqaOUpP cDedjtWZFrvsjGdb1H8vbd2D1Wej89Yv31U+O8oy+CdTzOyOnrK1SW8sNA2+hYd7maW2MFku Mp5u6Nko4cGfn2LYnXGPP3fVpGLJ5WFhv2znr5fmCU5YIXfVUijEf9/+pfu2KrEUZyQaajEX FScCAGXvaqqFAgAA X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140414_001828_470145_9C50746F X-CRM114-Status: GOOD ( 18.54 ) X-Spam-Score: -6.0 (------) Cc: Mark Rutland , Heiko Stuebner , linux-doc@vger.kernel.org, Tomasz Figa , Chander Kashyap , Romain Naour , Tarek Dakhran , Kukjin Kim , Russell King , Thomas Abraham , devicetree@vger.kernel.org, Pawel Moll , Ian Campbell , linux-samsung-soc@vger.kernel.org, Vyacheslav Tyrtov , Ben Dooks , Mike Turquette , linux-arm-kernel@lists.infradead.org, Kyungmin Park , Rob Herring , Rob Landley , Kumar Gala , Tarek Dakhran X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP EXYNOS5410 is SoC in Samsung's Exynos5 SoC series. Add initial support for this SoC. Signed-off-by: Tarek Dakhran Signed-off-by: Vyacheslav Tyrtov Reviewed-by: Tomasz Figa --- arch/arm/mach-exynos/Kconfig | 8 ++++++++ arch/arm/mach-exynos/exynos.c | 12 ++++++++++++ arch/arm/mach-exynos/hotplug.c | 4 ++-- arch/arm/mach-exynos/include/mach/map.h | 1 + arch/arm/mach-exynos/platsmp.c | 10 +++++++--- arch/arm/mach-exynos/regs-pmu.h | 4 ++-- arch/arm/plat-samsung/include/plat/cpu.h | 11 ++++++++++- 7 files changed, 42 insertions(+), 8 deletions(-) diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig index fc8bf18..92f2593 100644 --- a/arch/arm/mach-exynos/Kconfig +++ b/arch/arm/mach-exynos/Kconfig @@ -84,6 +84,14 @@ config SOC_EXYNOS5250 help Enable EXYNOS5250 SoC support +config SOC_EXYNOS5410 + bool "SAMSUNG EXYNOS5410" + default y + depends on ARCH_EXYNOS5 + select PM_GENERIC_DOMAINS if PM_RUNTIME + help + Enable EXYNOS5410 SoC support + config SOC_EXYNOS5420 bool "SAMSUNG EXYNOS5420" default y diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c index b32a907..fdb3fb5 100644 --- a/arch/arm/mach-exynos/exynos.c +++ b/arch/arm/mach-exynos/exynos.c @@ -159,6 +159,15 @@ static struct map_desc exynos5250_iodesc[] __initdata = { }, }; +static struct map_desc exynos5410_iodesc[] __initdata = { + { + .virtual = (unsigned long)S5P_VA_SYSRAM_NS, + .pfn = __phys_to_pfn(EXYNOS5410_PA_SYSRAM_NS), + .length = SZ_4K, + .type = MT_DEVICE, + }, +}; + static struct map_desc exynos5_iodesc[] __initdata = { { .virtual = (unsigned long)S3C_VA_SYS, @@ -294,6 +303,8 @@ static void __init exynos_map_io(void) iotable_init(exynos4x12_iodesc, ARRAY_SIZE(exynos4x12_iodesc)); if (soc_is_exynos5250()) iotable_init(exynos5250_iodesc, ARRAY_SIZE(exynos5250_iodesc)); + if (soc_is_exynos5410()) + iotable_init(exynos5410_iodesc, ARRAY_SIZE(exynos5410_iodesc)); } void __init exynos_init_io(void) @@ -376,6 +387,7 @@ static char const *exynos_dt_compat[] __initconst = { "samsung,exynos4412", "samsung,exynos5", "samsung,exynos5250", + "samsung,exynos5410", "samsung,exynos5420", "samsung,exynos5440", NULL diff --git a/arch/arm/mach-exynos/hotplug.c b/arch/arm/mach-exynos/hotplug.c index 5eead53..83ae5fb 100644 --- a/arch/arm/mach-exynos/hotplug.c +++ b/arch/arm/mach-exynos/hotplug.c @@ -95,8 +95,8 @@ static inline void platform_do_lowpower(unsigned int cpu, int *spurious) for (;;) { /* make cpu1 to be turned off at next WFI command */ - if (cpu == 1) - __raw_writel(0, S5P_ARM_CORE1_CONFIGURATION); + if (cpu > 0) + __raw_writel(0, S5P_ARM_CORE_CONFIGURATION(cpu)); /* * here's the WFI diff --git a/arch/arm/mach-exynos/include/mach/map.h b/arch/arm/mach-exynos/include/mach/map.h index 7b046b5..894f431 100644 --- a/arch/arm/mach-exynos/include/mach/map.h +++ b/arch/arm/mach-exynos/include/mach/map.h @@ -29,6 +29,7 @@ #define EXYNOS4210_PA_SYSRAM_NS 0x0203F000 #define EXYNOS4x12_PA_SYSRAM_NS 0x0204F000 #define EXYNOS5250_PA_SYSRAM_NS 0x0204F000 +#define EXYNOS5410_PA_SYSRAM_NS 0x02073000 #define EXYNOS_PA_CHIPID 0x10000000 diff --git a/arch/arm/mach-exynos/platsmp.c b/arch/arm/mach-exynos/platsmp.c index 03e5e9f..dce2841 100644 --- a/arch/arm/mach-exynos/platsmp.c +++ b/arch/arm/mach-exynos/platsmp.c @@ -37,6 +37,8 @@ static inline void __iomem *cpu_boot_reg_base(void) { if (soc_is_exynos4210() && samsung_rev() == EXYNOS4210_REV_1_1) return S5P_INFORM5; + if (soc_is_exynos5410()) + return S5P_VA_SYSRAM_NS; return S5P_VA_SYSRAM; } @@ -47,6 +49,8 @@ static inline void __iomem *cpu_boot_reg(int cpu) boot_reg = cpu_boot_reg_base(); if (soc_is_exynos4412()) boot_reg += 4*cpu; + else if (soc_is_exynos5410()) + boot_reg += (0x1c); else if (soc_is_exynos5420()) boot_reg += 4; return boot_reg; @@ -107,14 +111,14 @@ static int exynos_boot_secondary(unsigned int cpu, struct task_struct *idle) */ write_pen_release(phys_cpu); - if (!(__raw_readl(S5P_ARM_CORE1_STATUS) & S5P_CORE_LOCAL_PWR_EN)) { + if (!(__raw_readl(S5P_ARM_CORE_STATUS(cpu)) & S5P_CORE_LOCAL_PWR_EN)) { __raw_writel(S5P_CORE_LOCAL_PWR_EN, - S5P_ARM_CORE1_CONFIGURATION); + S5P_ARM_CORE_CONFIGURATION(cpu)); timeout = 10; /* wait max 10 ms until cpu1 is on */ - while ((__raw_readl(S5P_ARM_CORE1_STATUS) + while ((__raw_readl(S5P_ARM_CORE_STATUS(cpu)) & S5P_CORE_LOCAL_PWR_EN) != S5P_CORE_LOCAL_PWR_EN) { if (timeout-- == 0) break; diff --git a/arch/arm/mach-exynos/regs-pmu.h b/arch/arm/mach-exynos/regs-pmu.h index 4f6a256..14d62cb 100644 --- a/arch/arm/mach-exynos/regs-pmu.h +++ b/arch/arm/mach-exynos/regs-pmu.h @@ -105,8 +105,8 @@ #define S5P_GPS_LOWPWR S5P_PMUREG(0x139C) #define S5P_GPS_ALIVE_LOWPWR S5P_PMUREG(0x13A0) -#define S5P_ARM_CORE1_CONFIGURATION S5P_PMUREG(0x2080) -#define S5P_ARM_CORE1_STATUS S5P_PMUREG(0x2084) +#define S5P_ARM_CORE_CONFIGURATION(x) S5P_PMUREG(0x2000 + (x) * 0x80) +#define S5P_ARM_CORE_STATUS(x) S5P_PMUREG(0x2004 + (x) * 0x80) #define S5P_PAD_RET_MAUDIO_OPTION S5P_PMUREG(0x3028) #define S5P_PAD_RET_GPIO_OPTION S5P_PMUREG(0x3108) diff --git a/arch/arm/plat-samsung/include/plat/cpu.h b/arch/arm/plat-samsung/include/plat/cpu.h index 5992b8d..21db380 100644 --- a/arch/arm/plat-samsung/include/plat/cpu.h +++ b/arch/arm/plat-samsung/include/plat/cpu.h @@ -49,6 +49,7 @@ extern unsigned long samsung_cpu_id; #define EXYNOS4_CPU_MASK 0xFFFE0000 #define EXYNOS5250_SOC_ID 0x43520000 +#define EXYNOS5410_SOC_ID 0xE5410000 #define EXYNOS5420_SOC_ID 0xE5420000 #define EXYNOS5440_SOC_ID 0xE5440000 #define EXYNOS5_SOC_MASK 0xFFFFF000 @@ -72,6 +73,7 @@ IS_SAMSUNG_CPU(exynos4210, EXYNOS4210_CPU_ID, EXYNOS4_CPU_MASK) IS_SAMSUNG_CPU(exynos4212, EXYNOS4212_CPU_ID, EXYNOS4_CPU_MASK) IS_SAMSUNG_CPU(exynos4412, EXYNOS4412_CPU_ID, EXYNOS4_CPU_MASK) IS_SAMSUNG_CPU(exynos5250, EXYNOS5250_SOC_ID, EXYNOS5_SOC_MASK) +IS_SAMSUNG_CPU(exynos5410, EXYNOS5410_SOC_ID, EXYNOS5_SOC_MASK) IS_SAMSUNG_CPU(exynos5420, EXYNOS5420_SOC_ID, EXYNOS5_SOC_MASK) IS_SAMSUNG_CPU(exynos5440, EXYNOS5440_SOC_ID, EXYNOS5_SOC_MASK) @@ -154,6 +156,12 @@ IS_SAMSUNG_CPU(exynos5440, EXYNOS5440_SOC_ID, EXYNOS5_SOC_MASK) # define soc_is_exynos5250() 0 #endif +#if defined(CONFIG_SOC_EXYNOS5410) +# define soc_is_exynos5410() is_samsung_exynos5410() +#else +# define soc_is_exynos5410() 0 +#endif + #if defined(CONFIG_SOC_EXYNOS5420) # define soc_is_exynos5420() is_samsung_exynos5420() #else @@ -168,7 +176,8 @@ IS_SAMSUNG_CPU(exynos5440, EXYNOS5440_SOC_ID, EXYNOS5_SOC_MASK) #define soc_is_exynos4() (soc_is_exynos4210() || soc_is_exynos4212() || \ soc_is_exynos4412()) -#define soc_is_exynos5() (soc_is_exynos5250() || soc_is_exynos5420()) +#define soc_is_exynos5() (soc_is_exynos5250() || soc_is_exynos5410() || \ + soc_is_exynos5420()) #define IODESC_ENT(x) { (unsigned long)S3C24XX_VA_##x, __phys_to_pfn(S3C24XX_PA_##x), S3C24XX_SZ_##x, MT_DEVICE }