From patchwork Wed Mar 19 10:25:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 26550 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qg0-f71.google.com (mail-qg0-f71.google.com [209.85.192.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B6BF7203C3 for ; Wed, 19 Mar 2014 10:31:42 +0000 (UTC) Received: by mail-qg0-f71.google.com with SMTP id j5sf19758640qga.2 for ; Wed, 19 Mar 2014 03:31:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=+pwKwzW6QR+WpgbCL5tsnCj7wat6Y7v+QKLCoWMJtfM=; b=ksGwYk+fGWhOmylmrr3G5s2D/Pna+MX03uKkyeGaBOWGs/VONEIi46jXenelq1Uvtf GyUiu7vuq1ViardW2n0nRD6M6+Zs8rUv0pjwkw8nwbQoFTcJ+osx5QZdrQ1VBrE69rkt xxJqM+cC6YqnualM26PY9bDxmf1rsbYTREQ0hBRq4x7fRx9sPUnDO0iJRfzUqCzShno+ 2G7uamK0YG9KIH7Kiq0IcEjENEIYBHuZus45E0BSSwiEGBQ1w8FgP2Fw0C5odHHzT8vB zT9xhkcuccgKS8t/Dw4qZKZnwz952NTZPJea8mIEkhu3+bitPoIFeze2x4Fua2Z1jLVF Q/Ng== X-Gm-Message-State: ALoCoQmRoLJa5bX0kNzTdMYB3tyi8ctBajWNAyZ/LO0ua2ZdQEHgc9PyUIsayMxMbFBbv74iRzKI X-Received: by 10.52.103.103 with SMTP id fv7mr12530788vdb.3.1395225102563; Wed, 19 Mar 2014 03:31:42 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.40.200 with SMTP id x66ls1345725qgx.46.gmail; Wed, 19 Mar 2014 03:31:42 -0700 (PDT) X-Received: by 10.220.103.141 with SMTP id k13mr1017114vco.25.1395225102363; Wed, 19 Mar 2014 03:31:42 -0700 (PDT) Received: from mail-ve0-f176.google.com (mail-ve0-f176.google.com [209.85.128.176]) by mx.google.com with ESMTPS id q1si4335685ves.171.2014.03.19.03.31.42 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Mar 2014 03:31:42 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.176; Received: by mail-ve0-f176.google.com with SMTP id cz12so8632714veb.35 for ; Wed, 19 Mar 2014 03:31:42 -0700 (PDT) X-Received: by 10.52.163.236 with SMTP id yl12mr818vdb.39.1395225102263; Wed, 19 Mar 2014 03:31:42 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.78.9 with SMTP id i9csp287178vck; Wed, 19 Mar 2014 03:31:41 -0700 (PDT) X-Received: by 10.66.248.227 with SMTP id yp3mr38261076pac.116.1395225100550; Wed, 19 Mar 2014 03:31:40 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id zm8si14628882pac.440.2014.03.19.03.31.39; Wed, 19 Mar 2014 03:31:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759014AbaCSKbf (ORCPT + 8 others); Wed, 19 Mar 2014 06:31:35 -0400 Received: from mail-pa0-f42.google.com ([209.85.220.42]:54393 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758259AbaCSKbe (ORCPT ); Wed, 19 Mar 2014 06:31:34 -0400 Received: by mail-pa0-f42.google.com with SMTP id fb1so8784107pad.29 for ; Wed, 19 Mar 2014 03:31:33 -0700 (PDT) X-Received: by 10.68.241.73 with SMTP id wg9mr40432991pbc.62.1395225093475; Wed, 19 Mar 2014 03:31:33 -0700 (PDT) Received: from linaro.sisodomain.com ([115.113.119.130]) by mx.google.com with ESMTPSA id kc9sm60944281pbc.25.2014.03.19.03.31.30 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Mar 2014 03:31:32 -0700 (PDT) From: Sachin Kamat To: linux-samsung-soc@vger.kernel.org Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kgene.kim@samsung.com, mark.rutland@arm.com, sachin.kamat@linaro.org Subject: [PATCH Resend 2/3] ARM: EXYNOS: Consolidate CPU init code Date: Wed, 19 Mar 2014 15:55:04 +0530 Message-Id: <1395224705-2935-2-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1395224705-2935-1-git-send-email-sachin.kamat@linaro.org> References: <1395224705-2935-1-git-send-email-sachin.kamat@linaro.org> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: sachin.kamat@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , cpu_table was used to distinguish between different Exynos4 and 5 SoCs and based on the type do the initialization and io mapping. exynos_init is dummy and no longer needed as we do a DT based booting. By having a common io mapping function we can get rid of the whole table and avoid populating it for every SoC. Tested on Exynos4210, 5250 and 5420 based boards. Signed-off-by: Sachin Kamat Tested-by: Tomasz Figa --- arch/arm/mach-exynos/common.c | 108 +++++++++-------------------------------- 1 file changed, 23 insertions(+), 85 deletions(-) diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c index e98ddadc5f74..10ed374c0744 100644 --- a/arch/arm/mach-exynos/common.c +++ b/arch/arm/mach-exynos/common.c @@ -48,56 +48,6 @@ #define L2_AUX_VAL 0x7C470001 #define L2_AUX_MASK 0xC200ffff -static const char name_exynos4210[] = "EXYNOS4210"; -static const char name_exynos4212[] = "EXYNOS4212"; -static const char name_exynos4412[] = "EXYNOS4412"; -static const char name_exynos5250[] = "EXYNOS5250"; -static const char name_exynos5420[] = "EXYNOS5420"; -static const char name_exynos5440[] = "EXYNOS5440"; - -static void exynos4_map_io(void); -static void exynos5_map_io(void); -static int exynos_init(void); - -static struct cpu_table cpu_ids[] __initdata = { - { - .idcode = EXYNOS4210_CPU_ID, - .idmask = EXYNOS4_CPU_MASK, - .map_io = exynos4_map_io, - .init = exynos_init, - .name = name_exynos4210, - }, { - .idcode = EXYNOS4212_CPU_ID, - .idmask = EXYNOS4_CPU_MASK, - .map_io = exynos4_map_io, - .init = exynos_init, - .name = name_exynos4212, - }, { - .idcode = EXYNOS4412_CPU_ID, - .idmask = EXYNOS4_CPU_MASK, - .map_io = exynos4_map_io, - .init = exynos_init, - .name = name_exynos4412, - }, { - .idcode = EXYNOS5250_SOC_ID, - .idmask = EXYNOS5_SOC_MASK, - .map_io = exynos5_map_io, - .init = exynos_init, - .name = name_exynos5250, - }, { - .idcode = EXYNOS5420_SOC_ID, - .idmask = EXYNOS5_SOC_MASK, - .map_io = exynos5_map_io, - .init = exynos_init, - .name = name_exynos5420, - }, { - .idcode = EXYNOS5440_SOC_ID, - .idmask = EXYNOS5_SOC_MASK, - .init = exynos_init, - .name = name_exynos5440, - }, -}; - /* Initial IO mappings */ static struct map_desc exynos4_iodesc[] __initdata = { @@ -346,6 +296,28 @@ static int __init exynos_fdt_map_chipid(unsigned long node, const char *uname, * * register the standard cpu IO areas */ +static void __init exynos_map_io(void) +{ + if (soc_is_exynos4210() || soc_is_exynos4212() || soc_is_exynos4412()) + iotable_init(exynos4_iodesc, ARRAY_SIZE(exynos4_iodesc)); + + if (soc_is_exynos5250() || soc_is_exynos5420()) + iotable_init(exynos5_iodesc, ARRAY_SIZE(exynos5_iodesc)); + + if (soc_is_exynos4210()) { + if (samsung_rev() == EXYNOS4210_REV_0) + iotable_init(exynos4_iodesc0, + ARRAY_SIZE(exynos4_iodesc0)); + else + iotable_init(exynos4_iodesc1, + ARRAY_SIZE(exynos4_iodesc1)); + iotable_init(exynos4210_iodesc, ARRAY_SIZE(exynos4210_iodesc)); + } + if (soc_is_exynos4212() || soc_is_exynos4412()) + iotable_init(exynos4x12_iodesc, ARRAY_SIZE(exynos4x12_iodesc)); + if (soc_is_exynos5250()) + iotable_init(exynos5250_iodesc, ARRAY_SIZE(exynos5250_iodesc)); +} void __init exynos_init_io(void) { @@ -356,30 +328,7 @@ void __init exynos_init_io(void) /* detect cpu id and rev. */ s5p_init_cpu(S5P_VA_CHIPID); - s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids)); -} - -static void __init exynos4_map_io(void) -{ - iotable_init(exynos4_iodesc, ARRAY_SIZE(exynos4_iodesc)); - - if (soc_is_exynos4210() && samsung_rev() == EXYNOS4210_REV_0) - iotable_init(exynos4_iodesc0, ARRAY_SIZE(exynos4_iodesc0)); - else - iotable_init(exynos4_iodesc1, ARRAY_SIZE(exynos4_iodesc1)); - - if (soc_is_exynos4210()) - iotable_init(exynos4210_iodesc, ARRAY_SIZE(exynos4210_iodesc)); - if (soc_is_exynos4212() || soc_is_exynos4412()) - iotable_init(exynos4x12_iodesc, ARRAY_SIZE(exynos4x12_iodesc)); -} - -static void __init exynos5_map_io(void) -{ - iotable_init(exynos5_iodesc, ARRAY_SIZE(exynos5_iodesc)); - - if (soc_is_exynos5250()) - iotable_init(exynos5250_iodesc, ARRAY_SIZE(exynos5250_iodesc)); + exynos_map_io(); } struct bus_type exynos_subsys = { @@ -387,10 +336,6 @@ struct bus_type exynos_subsys = { .dev_name = "exynos-core", }; -static struct device exynos4_dev = { - .bus = &exynos_subsys, -}; - static int __init exynos_core_init(void) { return subsys_system_register(&exynos_subsys, NULL); @@ -410,10 +355,3 @@ static int __init exynos4_l2x0_cache_init(void) return 0; } early_initcall(exynos4_l2x0_cache_init); - -static int __init exynos_init(void) -{ - printk(KERN_INFO "EXYNOS: Initializing architecture\n"); - - return device_register(&exynos4_dev); -}