From patchwork Tue Jul 2 09:28:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 2811561 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C1F66BF4A1 for ; Tue, 2 Jul 2013 10:06:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 499C32013D for ; Tue, 2 Jul 2013 10:06:08 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E1E202011B for ; Tue, 2 Jul 2013 10:06:06 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UtwvR-00037O-Se; Tue, 02 Jul 2013 09:31:15 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UtwtF-0002lp-Ar; Tue, 02 Jul 2013 09:28:49 +0000 Received: from mail-pa0-x229.google.com ([2607:f8b0:400e:c03::229]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UtwtC-0002jh-KV for linux-arm-kernel@lists.infradead.org; Tue, 02 Jul 2013 09:28:47 +0000 Received: by mail-pa0-f41.google.com with SMTP id bj3so6089664pad.14 for ; Tue, 02 Jul 2013 02:28:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:date:message-id:in-reply-to:references:subject; bh=8g+CBKitA2vy7RGMZXF2aXyUJJQsm7Sz2mwOB2CwrVg=; b=bpbuWZjYVehf1w/DSUeX+bEM8/oDiRUW5U34/zdKhSl9ZJ1Bp4+ODYIrRsExZ4suxH z6N9gdgXKKEaQRF04vJW2kCaWrbbD3Mt5UQ5JAI36Kn3xyflazo/zLx8WauBDWZirpHw m6phFBkK4SXISRmb/RiYMiPmRjE+gGScOa1nUIJcHsnPZpQGFvBAmHbqb6ONEyzB/kfa mluYfrk1VJYkPrYnuCknVxFywRe+fVKYu1fUrpzjhhGTyybzMzA7guVt/t8BqKfe4RO7 iIZmZV0sw6KPMmTsxpZeLLRvAeyW56xWhPJijplCoQ/4eUnML4RFjgmA7beUCWB7vl6a tFhw== X-Received: by 10.66.216.164 with SMTP id or4mr13541431pac.95.1372757305609; Tue, 02 Jul 2013 02:28:25 -0700 (PDT) Received: from [127.0.0.1] (ac230065.ppp.asahi-net.or.jp. [183.77.230.65]) by mx.google.com with ESMTPSA id sb3sm28444128pac.14.2013.07.02.02.28.23 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 02 Jul 2013 02:28:25 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Date: Tue, 02 Jul 2013 18:28:30 +0900 Message-Id: <20130702092830.32066.8431.sendpatchset@w520> In-Reply-To: <20130702092725.32066.54861.sendpatchset@w520> References: <20130702092725.32066.54861.sendpatchset@w520> Subject: [PATCH 08/08] ARM: shmobile: Disconnect EMEV2 SMP code from clocks X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130702_052846_804166_6D44F19F X-CRM114-Status: GOOD ( 14.41 ) X-Spam-Score: -2.0 (--) Cc: arnd@arndb.de, Magnus Damm , horms@verge.net.au, olof@lixom.net, shinya.kuribayashi.px@renesas.com, linux-arm-kernel@lists.infradead.org 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=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, 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: Magnus Damm Update the EMEV2 SMP code to access the SMU directly instead of relying on help from the legacy clock code. This change moves us one step closer to common clocks. Signed-off-by: Magnus Damm --- arch/arm/mach-shmobile/clock-emev2.c | 18 ------------------ arch/arm/mach-shmobile/include/mach/emev2.h | 1 - arch/arm/mach-shmobile/smp-emev2.c | 11 +++++++++-- 3 files changed, 9 insertions(+), 21 deletions(-) --- 0001/arch/arm/mach-shmobile/clock-emev2.c +++ work/arch/arm/mach-shmobile/clock-emev2.c 2013-07-02 15:31:52.000000000 +0900 @@ -40,7 +40,6 @@ #define USIB2SCLKDIV 0x65c #define USIB3SCLKDIV 0x660 #define STI_CLKSEL 0x688 -#define SMU_GENERAL_REG0 0x7c0 /* not pretty, but hey */ static void __iomem *smu_base; @@ -51,11 +50,6 @@ static void emev2_smu_write(unsigned lon iowrite32(value, smu_base + offs); } -void emev2_set_boot_vector(unsigned long value) -{ - emev2_smu_write(value, SMU_GENERAL_REG0); -} - static struct clk_mapping smu_mapping = { .phys = EMEV2_SMU_BASE, .len = PAGE_SIZE, @@ -205,18 +199,6 @@ static struct clk_lookup lookups[] = { void __init emev2_clock_init(void) { int k, ret = 0; - static int is_setup; - - /* yuck, this is ugly as hell, but the non-smp case of clocks - * code is now designed to rely on ioremap() instead of static - * entity maps. in the case of smp we need access to the SMU - * register earlier than ioremap() is actually working without - * any static maps. to enable SMP in ugly but with dynamic - * mappings we have to call emev2_clock_init() from different - * places depending on UP and SMP... - */ - if (is_setup++) - return; smu_base = ioremap(EMEV2_SMU_BASE, PAGE_SIZE); BUG_ON(!smu_base); --- 0004/arch/arm/mach-shmobile/include/mach/emev2.h +++ work/arch/arm/mach-shmobile/include/mach/emev2.h 2013-07-02 15:32:05.000000000 +0900 @@ -5,7 +5,6 @@ extern void emev2_map_io(void); extern void emev2_init_delay(void); extern void emev2_add_standard_devices(void); extern void emev2_clock_init(void); -extern void emev2_set_boot_vector(unsigned long value); #define EMEV2_GPIO_BASE 200 #define EMEV2_GPIO_IRQ(n) (EMEV2_GPIO_BASE + (n)) --- 0005/arch/arm/mach-shmobile/smp-emev2.c +++ work/arch/arm/mach-shmobile/smp-emev2.c 2013-07-02 15:31:01.000000000 +0900 @@ -29,6 +29,8 @@ #include #define EMEV2_SCU_BASE 0x1e000000 +#define EMEV2_SMU_BASE 0xe0110000 +#define SMU_GENERAL_REG0 0x7c0 static int __cpuinit emev2_boot_secondary(unsigned int cpu, struct task_struct *idle) { @@ -38,13 +40,18 @@ static int __cpuinit emev2_boot_secondar static void __init emev2_smp_prepare_cpus(unsigned int max_cpus) { + void __iomem *smu; + /* setup EMEV2 specific SCU base, enable */ shmobile_scu_base = ioremap(EMEV2_SCU_BASE, PAGE_SIZE); scu_enable(shmobile_scu_base); /* Tell ROM loader about our vector (in headsmp-scu.S, headsmp.S) */ - emev2_clock_init(); /* need ioremapped SMU */ - emev2_set_boot_vector(__pa(shmobile_boot_vector)); + smu = ioremap(EMEV2_SMU_BASE, PAGE_SIZE); + if (smu) { + iowrite32(__pa(shmobile_boot_vector), smu + SMU_GENERAL_REG0); + iounmap(smu); + } shmobile_boot_fn = virt_to_phys(shmobile_boot_scu); shmobile_boot_arg = (unsigned long)shmobile_scu_base;