From patchwork Tue May 12 22:49:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: dinguyen@opensource.altera.com X-Patchwork-Id: 6392531 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E566ABEEE1 for ; Tue, 12 May 2015 22:57:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C3D0D203DC for ; Tue, 12 May 2015 22:57:53 +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 C5532203DB for ; Tue, 12 May 2015 22:57:52 +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 1YsJ53-0005uN-EN; Tue, 12 May 2015 22:55:17 +0000 Received: from mail-bn1on0063.outbound.protection.outlook.com ([157.56.110.63] helo=na01-bn1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YsJ4i-0004f7-CM for linux-arm-kernel@lists.infradead.org; Tue, 12 May 2015 22:54:57 +0000 Received: from CH1PR03CA007.namprd03.prod.outlook.com (10.255.156.152) by BY2PR03MB044.namprd03.prod.outlook.com (10.255.241.148) with Microsoft SMTP Server (TLS) id 15.1.154.19; Tue, 12 May 2015 22:54:33 +0000 Received: from BN1BFFO11FD039.protection.gbl (10.255.156.132) by CH1PR03CA007.outlook.office365.com (10.255.156.152) with Microsoft SMTP Server (TLS) id 15.1.154.19 via Frontend Transport; Tue, 12 May 2015 22:54:33 +0000 Authentication-Results: spf=fail (sender IP is 66.35.236.236) smtp.mailfrom=opensource.altera.com; arndb.de; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of opensource.altera.com does not designate 66.35.236.236 as permitted sender) receiver=protection.outlook.com; client-ip=66.35.236.236; helo=sj-itexedge04.altera.priv.altera.com; Received: from sj-itexedge04.altera.priv.altera.com (66.35.236.236) by BN1BFFO11FD039.mail.protection.outlook.com (10.58.144.102) with Microsoft SMTP Server (TLS) id 15.1.160.8 via Frontend Transport; Tue, 12 May 2015 22:54:32 +0000 Received: from na01-bn1-obe.outbound.protection.outlook.com (207.46.163.139) by webmail.altera.com (66.35.236.236) with Microsoft SMTP Server (TLS) id 14.3.174.1; Tue, 12 May 2015 15:53:23 -0700 Authentication-Results: arndb.de; dkim=none (message not signed) header.d=none; Received: from linux-builds1.altera.com (64.129.157.38) by BN3PR03MB1366.namprd03.prod.outlook.com (10.163.34.152) with Microsoft SMTP Server (TLS) id 15.1.160.19; Tue, 12 May 2015 22:54:28 +0000 From: To: Subject: [PATCH 2/2] ARM: socfpga: use of_iomap to map the SCU Date: Tue, 12 May 2015 17:49:10 -0500 Message-ID: <1431470950-29492-2-git-send-email-dinguyen@opensource.altera.com> X-Mailer: git-send-email 2.2.1 In-Reply-To: <1431470950-29492-1-git-send-email-dinguyen@opensource.altera.com> References: <1431470950-29492-1-git-send-email-dinguyen@opensource.altera.com> MIME-Version: 1.0 X-Originating-IP: [64.129.157.38] X-ClientProxiedBy: BLUPR05CA0053.namprd05.prod.outlook.com (10.141.20.23) To BN3PR03MB1366.namprd03.prod.outlook.com (25.163.34.152) X-Microsoft-Exchange-Diagnostics-untrusted: 1; BN3PR03MB1366; 2:XLJ7HyIcBpMAeG6+54xWxIsJaHeue92MBzyg1FDVH7GVw0TdSaEOzLUgWj+CbhJb; 2:k6haSYaTj4DGULt23pOYSntFqqlwO7zqGOgeRAoAiCJ9/LeGLwklMQCIeNhp1v7s7gvi90BItrO6AKw6Y8L6KjklUjrDVVKZRHs0ahj3VHmqdEKW0FdvoNGWE3EqNgMoICdA1qs35bA+vG+PqUC1QA==; 6:oUwwzPQFlNqo4AbX1ZGmUqn/Ms4xjh1EitFHynOwc5x6ZNBRAKdEkQoruA6d6ZU8vBjeBcywY9KfC3w92Szvlg+AOr/t7wCwN5tlrb0lVem9q3HpJ11mJpwpxmwzd47Exewh4L+DvNJJHJKUelIT0Q==; 3:tv5CoEY24Yop+NG2bYVmmgfSaqyDi0uE7zW9Kg8emjtLW6H98I1YsXO2vpDanJcAlM6bCWMg9aH3cIMvFWnMmeEXKB2lsMqPpsmxJtGNzJUQd0TyA2928/J77eC/fE3kDrQxP0MpNKKIecONZwtMQ/oOAqwBwitXmxE9P7+mzw7vNEBg75rAX7LRvMy1++JjXAHaR1RYUZAmXT9On6So7kCaTGDbygtHxOz9IkqVKd9+mooOP50bW0hcSrE4OzTNrah+ita6C5mG5tkOnbPanojnb2VuyJAMEN+zb/4AQk8= X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:; SRVR:BN3PR03MB1366; UriScan:; BCL:0; PCL:0; RULEID:; SRVR:BY2PR03MB044; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:;UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:BN3PR03MB1366; BCL:0; PCL:0; RULEID:; SRVR:BN3PR03MB1366; BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:BY2PR03MB044; BCL:0; PCL:0; RULEID:; SRVR:BY2PR03MB044; X-Forefront-PRVS: 0574D4712B X-Forefront-Antispam-Report-Untrusted: SFV:NSPM; SFS:(10009020)(6009001)(122386002)(2950100001)(77156002)(62966003)(50466002)(48376002)(77096005)(40100003)(107886002)(5001960100002)(110136002)(19580395003)(19580405001)(92566002)(189998001)(76176999)(50986999)(87976001)(86152002)(2351001)(229853001)(575784001)(86362001)(42186005)(46102003)(53416004)(33646002)(66066001)(47776003)(50226001)(4001430100001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR03MB1366; H:linux-builds1.altera.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics-untrusted: 1; BN3PR03MB1366; 9:KmAK1aVLzEn359wqCzuZgc3iWVfH4x51ACONPvvCHqOsW8UuyHmMayuemRD6BLuaqjEmE9zzTJfvnLnUipkHdpROGEBpMedjiEGTGxY+1bm2124HUpYBZQ7Tg1+d1c21+yGeQ0Lb2aoCJAYr1siSO+mUEkq26Bj3oA/bDKxR8RA1GMG6N/wKCoIKqQEjI34o+odskz4jAQl9cyIlbf/ua2N4BQalJ5JzJ5r27VUIUllosugSLaQ5voYN8xOxc0frM/DF/z5OaIaxtHopHlEWO+710bmvyMZcz03cpmg6xaQ/P5jfyNI6AfPfrCb4ZK1FCBo2Nc0e235rNyOXi9VZnViGlz/mrnoKDjXwDRjBhjXYQGGYNnvhbkD6ixRw7gjhOVpBVxrfdFBdce1vxGtBQ5A+O0YYILSP5yOjyBhuG/R0WABjZo0dT9GiPesUkYFa4lsQNgQxMaUqrTctmzf/k7EZUI1h9Mv+LQjxZJh+khNFwUgkzpuZjG9JYVbe9zSNM19Kz81h0V3H4XOHvzIzbH1KpolRtcpy9UEqXwVZ+sDD4ctH+1IOiBymdwa3XOkFtjxRLKdmq+lMhaTgURwegBKhyiD7bEJQkz7g/4lumdNfAY3vzttSKovCYjpJWjjH7kocs9y5AJAXIvlOrQIxR2w+R/OlX3BgRc9SKNGbc8A0h9T+ko+CJY6MnspzFDpC0/XoxIb3FxKN2ycy7Z3C483aeW7WeGlWLuoL4HdUBYPi4nPYMIzvC22ni1R9Eufhwrrs5BOE0HJiRp8Fp1pWe+TwxFUmkozeSPcLh+v3htlh9Mmvoowgc3aLXbz2cleHqic/Smk7mD9ZvL1jZ/SayxqCWmUCgoJIDcEfFReMj0N10vTxDgy5Bk27xoaZ+yk8 X-Microsoft-Exchange-Diagnostics-untrusted: 1; BN3PR03MB1366; 3:C/IzWjqXgAaAAsYG+dmYL4Wk9ODi6Um7+1WErSZbz1493/TQDz3ukRCAsgWd/ZbhUhsLp0efFKKv4rF8KoTkxnHhxRJNrS4Xi02iqR42o283eFLdfDpF8kTkCaXi+nYJoJyFnOL9y69fS3NXgOh/fg==; 10:+PswNiuMniofmBi6zvaSOsmo7pxB5rD+oi98fZDYk7nOuVvS3QeHc12mjsH5V9YIToEPTQzK2aV7tKWlM9BLaCMNvFTEgyz7oUoDkcDZMZ4=; 6:OF8b9Zn1LPLmxOV7swQxmdMw5Ez09hfw3IHp/sp/Cx6is20uFFJisPT0+/DceBZKrMQx4uPhA+s4fx4mkmKU5RhI7JLX2E6ei1xwj5vzIEkSHsvXYZl1QeLYphHVdXlbulXt5i00KwVX1KEC1pi9Zg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR03MB1366 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: BN1BFFO11FD039.protection.gbl X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD039; 1:XCkXrF5gxaVNqBV2xyldtpL6SOmI9nw6WPDVFg6LR1/Fl5VyA2isqbQfoJ5+Q7jz7QBZRzkf1xCIHn8zpQkyYMt5Ev96uAje/QUvKcz0inbhHlTWY9FHlc7K1x/3DUuQaHdSxVBLWmFhsWrRDA/lgtHOSCD/XPq/5M6KYgUv3tI1nMFQdrUXJSZIxrrYlxaZAteC0xhYA7tjeIzN3ib1Jpcuhg5KEmMT9Sa4/Le0LnvfTovqDdC7JKfUsSCGRA3V/eytGqCvKrt2nm0uMettCw== X-Forefront-Antispam-Report: CIP:66.35.236.236; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(339900001)(189002)(199003)(16796002)(122386002)(2950100001)(77156002)(62966003)(50466002)(85426001)(48376002)(77096005)(40100003)(6806004)(81156007)(107886002)(5001960100002)(110136002)(19580395003)(19580405001)(92566002)(189998001)(76176999)(50986999)(87936001)(86152002)(2351001)(229853001)(575784001)(86362001)(105606002)(106466001)(46102003)(53416004)(33646002)(66066001)(47776003)(50226001)(7099028)(4001430100001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR03MB044; H:sj-itexedge04.altera.priv.altera.com; FPR:; SPF:Fail; MLV:ovrnspm; MX:1; A:0; PTR:InfoDomainNonexistent; LANG:en; X-Forefront-PRVS: 0574D4712B X-OriginatorOrg: opensource.altera.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2015 22:54:32.7644 (UTC) X-MS-Exchange-CrossTenant-Id: fbd72e03-d4a5-4110-adce-614d51f2077a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fbd72e03-d4a5-4110-adce-614d51f2077a; Ip=[66.35.236.236]; Helo=[sj-itexedge04.altera.priv.altera.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR03MB044 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150512_155456_556080_3C7970B0 X-CRM114-Status: GOOD ( 14.78 ) X-Spam-Score: -0.0 (/) Cc: mark.rutland@arm.com, dinh.linux@gmail.com, pawel.moll@arm.com, ijc+devicetree@hellion.org.uk, robh+dt@kernel.org, galak@codeaurora.org, Dinh Nguyen , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_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 From: Dinh Nguyen Use of_iomap to map the "arm,cortex-a9-scu". By doing this, we can remove map_io in socfpga.c. Also, we can remove socfpga_smp_init_cpus, as arm_dt_init_cpu_maps is already doing the CPU mapping. Signed-off-by: Dinh Nguyen --- arch/arm/mach-socfpga/core.h | 1 - arch/arm/mach-socfpga/platsmp.c | 33 ++++++++++----------------------- arch/arm/mach-socfpga/socfpga.c | 25 ------------------------- 3 files changed, 10 insertions(+), 49 deletions(-) diff --git a/arch/arm/mach-socfpga/core.h b/arch/arm/mach-socfpga/core.h index a0f3b1c..5913bbb 100644 --- a/arch/arm/mach-socfpga/core.h +++ b/arch/arm/mach-socfpga/core.h @@ -32,7 +32,6 @@ #define RSTMGR_MPUMODRST_CPU1 0x2 /* CPU1 Reset */ extern void socfpga_secondary_startup(void); -extern void __iomem *socfpga_scu_base_addr; extern void socfpga_init_clocks(void); extern void socfpga_sysmgr_init(void); diff --git a/arch/arm/mach-socfpga/platsmp.c b/arch/arm/mach-socfpga/platsmp.c index c64d89b..7886eae 100644 --- a/arch/arm/mach-socfpga/platsmp.c +++ b/arch/arm/mach-socfpga/platsmp.c @@ -54,32 +54,20 @@ static int socfpga_boot_secondary(unsigned int cpu, struct task_struct *idle) return 0; } -/* - * Initialise the CPU possible map early - this describes the CPUs - * which may be present or become present in the system. - */ -static void __init socfpga_smp_init_cpus(void) +static void __init socfpga_smp_prepare_cpus(unsigned int max_cpus) { - unsigned int i, ncores; - - ncores = scu_get_core_count(socfpga_scu_base_addr); - - for (i = 0; i < ncores; i++) - set_cpu_possible(i, true); + struct device_node *np; + void __iomem *socfpga_scu_base_addr; - /* sanity check */ - if (ncores > num_possible_cpus()) { - pr_warn("socfpga: no. of cores (%d) greater than configured" - "maximum of %d - clipping\n", ncores, num_possible_cpus()); - ncores = num_possible_cpus(); + np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-scu"); + if (!np) { + pr_err("%s: missing scu\n", __func__); + return; } - for (i = 0; i < ncores; i++) - set_cpu_possible(i, true); -} - -static void __init socfpga_smp_prepare_cpus(unsigned int max_cpus) -{ + socfpga_scu_base_addr = of_iomap(np, 0); + if (!socfpga_scu_base_addr) + return; scu_enable(socfpga_scu_base_addr); } @@ -96,7 +84,6 @@ static void socfpga_cpu_die(unsigned int cpu) } struct smp_operations socfpga_smp_ops __initdata = { - .smp_init_cpus = socfpga_smp_init_cpus, .smp_prepare_cpus = socfpga_smp_prepare_cpus, .smp_boot_secondary = socfpga_boot_secondary, #ifdef CONFIG_HOTPLUG_CPU diff --git a/arch/arm/mach-socfpga/socfpga.c b/arch/arm/mach-socfpga/socfpga.c index 358f2c7..b63dec6 100644 --- a/arch/arm/mach-socfpga/socfpga.c +++ b/arch/arm/mach-socfpga/socfpga.c @@ -27,34 +27,10 @@ #include "core.h" -void __iomem *socfpga_scu_base_addr = ((void __iomem *)(SOCFPGA_SCU_VIRT_BASE)); void __iomem *sys_manager_base_addr; void __iomem *rst_manager_base_addr; unsigned long socfpga_cpu1start_addr; -static struct map_desc scu_io_desc __initdata = { - .virtual = SOCFPGA_SCU_VIRT_BASE, - .pfn = 0, /* run-time */ - .length = SZ_8K, - .type = MT_DEVICE, -}; - -static void __init socfpga_scu_map_io(void) -{ - unsigned long base; - - /* Get SCU base */ - asm("mrc p15, 4, %0, c15, c0, 0" : "=r" (base)); - - scu_io_desc.pfn = __phys_to_pfn(base); - iotable_init(&scu_io_desc, 1); -} - -static void __init socfpga_map_io(void) -{ - socfpga_scu_map_io(); -} - void __init socfpga_sysmgr_init(void) { struct device_node *np; @@ -103,7 +79,6 @@ DT_MACHINE_START(SOCFPGA, "Altera SOCFPGA") .l2c_aux_val = 0, .l2c_aux_mask = ~0, .smp = smp_ops(socfpga_smp_ops), - .map_io = socfpga_map_io, .init_irq = socfpga_init_irq, .restart = socfpga_cyclone5_restart, .dt_compat = altera_dt_match,