From patchwork Wed Jan 22 11:49:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 23510 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ig0-f200.google.com (mail-ig0-f200.google.com [209.85.213.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DB629203C6 for ; Wed, 22 Jan 2014 11:53:47 +0000 (UTC) Received: by mail-ig0-f200.google.com with SMTP id k19sf2145254igc.3 for ; Wed, 22 Jan 2014 03:53:47 -0800 (PST) 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:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=RvCzF6UHmMxZBeIk2pDEiYiIDNhvI3MbG0LJxmT7T9k=; b=TUhUGRlR0EjwZ/go7EccuS8yOlsdPojSQKbArzHz7RqnH8zkHcncm79fRzBCkmn9o7 OxSBri/JhIRM6Ld/5CcHUsHQFOriCHSFkdqCukWXmAHpzts0IUpMNaVwZXkIP0MmtP5s ZzTnhhPCfvdi8YwUgEH1RPlnMRHs5c+JQQ3ErcOlf6ILwqpYEfYsN+lvAFCIKX0pgEiY UVgCm9y8dObXKhKn7IAIQv33efuYY8csjT/Lx0lhkj15X4sGgNgJVPuA3ugc576xv+P6 bQbOP0W3lLnE21xvu5al9Fg5hJxjEVyA9C8LU3WUxfVGCsz1aU9fvxJ0lPmpxjIZQrFV FtaQ== X-Gm-Message-State: ALoCoQkZaCZ7WmKZcBad1yeQUrlJWsvd/cRPUuvgPGsK9228S9wfrmMwst36QVJGYqbHrIJRknWk X-Received: by 10.183.3.36 with SMTP id bt4mr377229obd.29.1390391627130; Wed, 22 Jan 2014 03:53:47 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.51.44 with SMTP id t41ls49085qga.86.gmail; Wed, 22 Jan 2014 03:53:47 -0800 (PST) X-Received: by 10.58.100.100 with SMTP id ex4mr619231veb.2.1390391627019; Wed, 22 Jan 2014 03:53:47 -0800 (PST) Received: from mail-ve0-f181.google.com (mail-ve0-f181.google.com [209.85.128.181]) by mx.google.com with ESMTPS id eh16si4401840vcb.18.2014.01.22.03.53.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 22 Jan 2014 03:53:47 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.181 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.181; Received: by mail-ve0-f181.google.com with SMTP id cz12so155901veb.12 for ; Wed, 22 Jan 2014 03:53:46 -0800 (PST) X-Received: by 10.58.50.71 with SMTP id a7mr581462veo.32.1390391626946; Wed, 22 Jan 2014 03:53:46 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp179325vcz; Wed, 22 Jan 2014 03:53:46 -0800 (PST) X-Received: by 10.68.137.195 with SMTP id qk3mr1139899pbb.9.1390391625819; Wed, 22 Jan 2014 03:53:45 -0800 (PST) Received: from mail-pa0-f47.google.com (mail-pa0-f47.google.com [209.85.220.47]) by mx.google.com with ESMTPS id m8si9524341pbq.329.2014.01.22.03.53.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 22 Jan 2014 03:53:45 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.47 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.220.47; Received: by mail-pa0-f47.google.com with SMTP id kp14so286227pab.20 for ; Wed, 22 Jan 2014 03:53:45 -0800 (PST) X-Received: by 10.66.191.42 with SMTP id gv10mr1038119pac.125.1390391625419; Wed, 22 Jan 2014 03:53:45 -0800 (PST) Received: from linaro.sisodomain.com ([115.113.119.130]) by mx.google.com with ESMTPSA id y9sm46258446pas.10.2014.01.22.03.53.42 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 22 Jan 2014 03:53:44 -0800 (PST) From: Sachin Kamat To: linux-samsung-soc@vger.kernel.org Cc: kgene.kim@samsung.com, sachin.kamat@linaro.org, patches@linaro.org Subject: [PATCH 1/1] ARM: EXYNOS: Consolidate CPU init code Date: Wed, 22 Jan 2014 17:19:02 +0530 Message-Id: <1390391342-4344-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.9.5 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.181 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 Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: 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 assign the the initialization and io mapping pointers based on type. 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 --- arch/arm/mach-exynos/common.c | 93 ++++++++--------------------------------- 1 file changed, 17 insertions(+), 76 deletions(-) diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c index f18be40e5b21..02d0aaa7af59 100644 --- a/arch/arm/mach-exynos/common.c +++ b/arch/arm/mach-exynos/common.c @@ -48,55 +48,7 @@ #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, - }, -}; +static void exynos_map_io(void); /* Initial IO mappings */ @@ -355,28 +307,28 @@ 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)); + exynos_map_io(); } -static void __init exynos4_map_io(void) +static void __init exynos_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()) + 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)); -} - -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)); } @@ -386,10 +338,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); @@ -409,10 +357,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); -}