Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp66229ybl; Fri, 9 Aug 2019 02:34:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqyj3bwGCmcYqF5FOSo/SAcqDsjrdEpo8/p7AGFaj1l0qf5tRVje49l8WuqxwNxVFIu6p0iH X-Received: by 2002:a65:68c9:: with SMTP id k9mr16372807pgt.17.1565343294320; Fri, 09 Aug 2019 02:34:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565343294; cv=none; d=google.com; s=arc-20160816; b=KcfZF0Bu7c1G/D+jKRS9+RShH+tqAAHOl3tlk6sFCUXSHWS/Kev1P51h/DVlmFRKbo rfwQ87b86mnKbMTb9ewKFuBarYRvlJkGLP4fFXL1tRZGIbNJDjDO7xYQnf4TeZvwqSCo l8FoodCoT3oxrMm5umsjk/7LXoP68Z9gnUp1yMFeMQWJKusAupTcQHOysu76CafPqNVA 7+XN6h7MLJVWCS8xj43A32hi6q9/CTQ5mdsHhya/36m908fxQmh7oKR3R82LwnQGOwj/ lr3H0x+nit9Xnpbe72XvL40BQjpIX/WOwPdDfhmPbSApryEwV7TXD29nt9PFtcsMAwaY W63Q== 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=9VRn/NgJe0rp5kUZSDKDqC/0l1xyNfu0qHQnIYQnNSc=; b=vXDcCE9K7fqLI7+RREkCzOWD8atVrNTQRSsXjYq3JkANtLI6CDHcA9dFoYuGGsDy5+ rkrbsNL9MkmaZ86gNhSm+IYT4GIBTOCqkiIzFm9ly0WH0dxjh5Wz8LGaCIBfUEnr4wMs IfIyAYk49uPo57k0BYY5mbx8tTA5KyUILnJ1bN/P2D/6YWwsbMWEeCLNEVISyWqvo3zd 3LX7YhuStoNH/djNgEU9gbBA0OCOPhMnXcEL8UA+gLLLc92s/HJWI6AO9InKEUKWg9qj 9mto0RLQ1fgTp2vb42EZMhKjgGdegRYBrGBIsBNEZVQG0cQXNU36HCbfKG8lRw4IZ7wQ gjdg== 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 i11si20515005pgk.309.2019.08.09.02.34.38; Fri, 09 Aug 2019 02:34:54 -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 S2406367AbfHIJdf (ORCPT + 99 others); Fri, 9 Aug 2019 05:33:35 -0400 Received: from shell.v3.sk ([90.176.6.54]:52013 "EHLO shell.v3.sk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406346AbfHIJdb (ORCPT ); Fri, 9 Aug 2019 05:33:31 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.v3.sk (Postfix) with ESMTP id 711D8D63C6; Fri, 9 Aug 2019 11:33:29 +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 K1gVfscxpXnp; Fri, 9 Aug 2019 11:33:06 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zimbra.v3.sk (Postfix) with ESMTP id 5EA2FD63DC; Fri, 9 Aug 2019 11:32:34 +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 WFlokgtFpukp; Fri, 9 Aug 2019 11:32:29 +0200 (CEST) Received: from furthur.local (ip-37-188-137-236.eurotel.cz [37.188.137.236]) by zimbra.v3.sk (Postfix) with ESMTPSA id DBE76D63C2; Fri, 9 Aug 2019 11:32:21 +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 15/19] ARM: mmp: add SMP support Date: Fri, 9 Aug 2019 11:31:54 +0200 Message-Id: <20190809093158.7969-16-lkundrak@v3.sk> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190809093158.7969-1-lkundrak@v3.sk> References: <20190809093158.7969-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 --- arch/arm/mach-mmp/Makefile | 3 +++ arch/arm/mach-mmp/platsmp.c | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 35 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..255df640b5bc1 --- /dev/null +++ b/arch/arm/mach-mmp/platsmp.c @@ -0,0 +1,32 @@ +// 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), 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