Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp883016ybl; Thu, 22 Aug 2019 06:23:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqx7mmqmnJeQT7iQxNnbUZzTgcUKQhAUPJStSHqwAXoEd8XThXh+KNySElSJwfv/ZOT1ud3F X-Received: by 2002:a17:90a:ec12:: with SMTP id l18mr5315576pjy.6.1566480183342; Thu, 22 Aug 2019 06:23:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566480183; cv=none; d=google.com; s=arc-20160816; b=ZMBdjrc2RAsSIiyRoPB3phQEg/VYtGrnERdc8D4L26uzCGMJYGiazFwBTQBDLnrYkV M5A2zRtOTLuM51OYESLXFhOyM72ongrXRRlejyVA7nRa5/S3pcTlejNZRBQ7JkYpthU/ 2ZBqKTNgCi2oZ3IenhuY2w95J3s9PHplis1fHNqL8JBlkW5gCRVsHNcXqU3SUeVRfoiA hrlkdhnBKw9eV5dzSqZRzgtNZp2s96JRs3dGNIb7Todubk9oPI4dcj52PEKQgvB1Mcv1 SI2nD52cn3x8MhzWbqdwBUugvzWjd3+UYh9xGOQHQgXrSbS/tgqqgIyGjBRQlo2Hx2WE vf9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=4ceafJgqDlogqXelJSDnxyQkh2hm9PUn3LyQ11pNG28=; b=aiAGvDV8jGiOsOnqqkA13fslDPJUQ3WF9Deo7fQlqPwfKq3lgA8jANy28bx6cnvG+4 LMw+uW7M0ZTJ59UuxZhz9V93q5sjQIySmk2OD0ax4HJ7KryVHxzvJJEMl5r7OviJNrOs qqW9I02cncmPcPb54jUE2Zm2zub5DL8gEFNDY29DsszTHKOMBzIPq41uS2KYiK+97SRn ofxP3BW8kmAozDMO9H4KcSIzwh0BxsY4R5uQGuv51VxMU8Hu6MgRKD1WcyiXyMCiFfUQ 6fhO9BOSmH+njQQTvOVkpvGiMxNNRU7j6IRzSlafmaZX4z5XupBChFOc5Ooujrn7vDnu IHxA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z2si16566268pgv.417.2019.08.22.06.22.47; Thu, 22 Aug 2019 06:23:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387459AbfHVJeb (ORCPT + 99 others); Thu, 22 Aug 2019 05:34:31 -0400 Received: from shell.v3.sk ([90.176.6.54]:35953 "EHLO shell.v3.sk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731541AbfHVJe2 (ORCPT ); Thu, 22 Aug 2019 05:34:28 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.v3.sk (Postfix) with ESMTP id BF9C0D7563; Thu, 22 Aug 2019 11:34:24 +0200 (CEST) Received: from shell.v3.sk ([127.0.0.1]) by localhost (zimbra.v3.sk [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id ye-Fov3VnB4j; Thu, 22 Aug 2019 11:33:49 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zimbra.v3.sk (Postfix) with ESMTP id B3DE3D7556; Thu, 22 Aug 2019 11:33:05 +0200 (CEST) X-Virus-Scanned: amavisd-new at zimbra.v3.sk Received: from shell.v3.sk ([127.0.0.1]) by localhost (zimbra.v3.sk [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id miP-xL8D7hA4; Thu, 22 Aug 2019 11:32:58 +0200 (CEST) Received: from belphegor.brq.redhat.com (nat-pool-brq-t.redhat.com [213.175.37.10]) by zimbra.v3.sk (Postfix) with ESMTPSA id 9B051D756A; Thu, 22 Aug 2019 11:26:51 +0200 (CEST) From: Lubomir Rintel To: Olof Johansson Cc: Rob Herring , Mark Rutland , Thomas Gleixner , Jason Cooper , Marc Zyngier , Kishon Vijay Abraham I , Russell King , Michael Turquette , Stephen Boyd , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, Lubomir Rintel Subject: [PATCH v2 16/20] ARM: mmp: add SMP support Date: Thu, 22 Aug 2019 11:26:39 +0200 Message-Id: <20190822092643.593488-17-lkundrak@v3.sk> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190822092643.593488-1-lkundrak@v3.sk> References: <20190822092643.593488-1-lkundrak@v3.sk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Used to bring up the second core on MMP3. Signed-off-by: Lubomir Rintel --- Changes since v1: - Wrap SW_BRANCH_VIRT_ADDR with __pa_symbol() arch/arm/mach-mmp/Makefile | 3 +++ arch/arm/mach-mmp/platsmp.c | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 arch/arm/mach-mmp/platsmp.c diff --git a/arch/arm/mach-mmp/Makefile b/arch/arm/mach-mmp/Makefile index 322c1c97dc900..7b3a7f979eece 100644 --- a/arch/arm/mach-mmp/Makefile +++ b/arch/arm/mach-mmp/Makefile @@ -22,6 +22,9 @@ ifeq ($(CONFIG_PM),y) obj-$(CONFIG_CPU_PXA910) +=3D pm-pxa910.o obj-$(CONFIG_CPU_MMP2) +=3D pm-mmp2.o endif +ifeq ($(CONFIG_SMP),y) +obj-$(CONFIG_MACH_MMP3_DT) +=3D platsmp.o +endif =20 # board support obj-$(CONFIG_MACH_ASPENITE) +=3D aspenite.o diff --git a/arch/arm/mach-mmp/platsmp.c b/arch/arm/mach-mmp/platsmp.c new file mode 100644 index 0000000000000..98d5ef23623cb --- /dev/null +++ b/arch/arm/mach-mmp/platsmp.c @@ -0,0 +1,33 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (C) 2019 Lubomir Rintel + */ +#include +#include +#include +#include "addr-map.h" + +#define SW_BRANCH_VIRT_ADDR CIU_REG(0x24) + +static int mmp3_boot_secondary(unsigned int cpu, struct task_struct *idl= e) +{ + /* + * Apparently, the boot ROM on the second core spins on this + * register becoming non-zero and then jumps to the address written + * there. No IPIs involved. + */ + __raw_writel(virt_to_phys(secondary_startup), + __pa_symbol(SW_BRANCH_VIRT_ADDR)); + return 0; +} + +static void mmp3_smp_prepare_cpus(unsigned int max_cpus) +{ + scu_enable(SCU_VIRT_BASE); +} + +static const struct smp_operations mmp3_smp_ops __initconst =3D { + .smp_prepare_cpus =3D mmp3_smp_prepare_cpus, + .smp_boot_secondary =3D mmp3_boot_secondary, +}; +CPU_METHOD_OF_DECLARE(mmp3_smp, "marvell,mmp3-smp", &mmp3_smp_ops); --=20 2.21.0