From patchwork Wed Jul 31 07:07:12 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 2836110 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 2886B9F4D4 for ; Wed, 31 Jul 2013 07:07:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4B9CD2015D for ; Wed, 31 Jul 2013 07:07:50 +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 2025E200EC for ; Wed, 31 Jul 2013 07:07:49 +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 1V4QVW-0006f9-Ib; Wed, 31 Jul 2013 07:07:38 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1V4QVP-0005FY-Kz; Wed, 31 Jul 2013 07:07:31 +0000 Received: from mail-pd0-x236.google.com ([2607:f8b0:400e:c02::236]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V4QVI-0005Dy-Fa for linux-arm-kernel@lists.infradead.org; Wed, 31 Jul 2013 07:07:25 +0000 Received: by mail-pd0-f182.google.com with SMTP id r10so409975pdi.27 for ; Wed, 31 Jul 2013 00:07:02 -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=vjrSozn16TUwuns+LmDc1zb5wtyryoVAFR/lx+0vSMA=; b=Ayhy8eX4a4x6/YKzYo3l7FXFoHt8CJb/syLc9nwCYeYbFz/zmgtS/vpPpmlneTqHJO 4gOmpfRPUgs3iAuwVkPsq2Q/Z3j/0Otv+8uMDYKZ2+uGbma2uvPmHPi5jzaFhaOyv2KD eITkpYwd3HKvQDrToUDFscnHwMOE/ZbMZ93AxuwPHqoh1Q/cEgcWz/gc00VoIpQZGMNV A8Dhmw8JVeAsAgwTcvrYGN+R8LlUSMMngw8OJdRyYYkEPeJVO3XanLVQM7iE0F+2Fo4d lFPwcvM0YxUnsMXhffJ2+FzV93SXcd5P8eYKhcUDIALkJj+2z2Ddl9Ur/fG9UdiqV4zk e49g== X-Received: by 10.66.240.2 with SMTP id vw2mr80506148pac.137.1375254422143; Wed, 31 Jul 2013 00:07:02 -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 kc8sm309704pbc.18.2013.07.31.00.06.59 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 31 Jul 2013 00:07:01 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Date: Wed, 31 Jul 2013 16:07:12 +0900 Message-Id: <20130731070712.14444.49956.sendpatchset@w520> In-Reply-To: <20130731070702.14444.64961.sendpatchset@w520> References: <20130731070702.14444.64961.sendpatchset@w520> Subject: [PATCH 01/07] ARM: shmobile: Introduce shared SCU SMP boot code X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130731_030724_714443_8BEFE157 X-CRM114-Status: GOOD ( 11.09 ) X-Spam-Score: -2.0 (--) Cc: arnd@arndb.de, Magnus Damm , horms@verge.net.au, ulrich.hecht@gmail.com, olof@lixom.net, 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=-5.6 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 Add SMP boot functions for SCU equipped mach-shmobile SoCs. At this point shmobile_smp_scu_prepare_cpus() controls the SCU and installs boot fn and arg, while shmobile_smp_scu_boot_secondary() currently does nothing. In the future the boot function and arg install code will be reworked, so the empty function is ground work for that. Signed-off-by: Magnus Damm --- arch/arm/mach-shmobile/include/mach/common.h | 3 ++ arch/arm/mach-shmobile/platsmp-scu.c | 31 ++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) --- 0001/arch/arm/mach-shmobile/include/mach/common.h +++ work/arch/arm/mach-shmobile/include/mach/common.h 2013-07-29 16:50:17.000000000 +0900 @@ -11,6 +11,9 @@ extern void shmobile_boot_vector(void); extern unsigned long shmobile_boot_fn; extern unsigned long shmobile_boot_arg; extern void shmobile_boot_scu(void); +extern void shmobile_smp_scu_prepare_cpus(unsigned int max_cpus); +extern int shmobile_smp_scu_boot_secondary(unsigned int cpu, + struct task_struct *idle); struct clk; extern int shmobile_clk_init(void); extern void shmobile_handle_irq_intc(struct pt_regs *); --- /dev/null +++ work/arch/arm/mach-shmobile/platsmp-scu.c 2013-07-29 21:39:30.000000000 +0900 @@ -0,0 +1,31 @@ +/* + * SMP support for SoCs with SCU covered by mach-shmobile + * + * Copyright (C) 2013 Magnus Damm + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ +#include +#include +#include +#include +#include +#include + +void __init shmobile_smp_scu_prepare_cpus(unsigned int max_cpus) +{ + shmobile_boot_fn = virt_to_phys(shmobile_boot_scu); + shmobile_boot_arg = (unsigned long)shmobile_scu_base; + + /* enable SCU and cache coherency on booting CPU */ + scu_enable(shmobile_scu_base); + scu_power_mode(shmobile_scu_base, SCU_PM_NORMAL); +} + +int shmobile_smp_scu_boot_secondary(unsigned int cpu, struct task_struct *idle) +{ + /* do nothing for now */ + return 0; +}