From patchwork Wed Nov 18 15:12:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Gonzalez X-Patchwork-Id: 7650531 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 27BF39F1C2 for ; Wed, 18 Nov 2015 15:16:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 210712053E for ; Wed, 18 Nov 2015 15:16:01 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2F01E20603 for ; Wed, 18 Nov 2015 15:16:00 +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 1Zz4Qi-0006I2-84; Wed, 18 Nov 2015 15:13:52 +0000 Received: from mail1.bemta8.messagelabs.com ([216.82.243.194]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zz4Q5-0005Xi-4b for linux-arm-kernel@lists.infradead.org; Wed, 18 Nov 2015 15:13:17 +0000 Received: from [216.82.242.36] by server-2.bemta-8.messagelabs.com id 11/B0-20102-3759C465; Wed, 18 Nov 2015 15:12:51 +0000 X-Env-Sender: Marc_Gonzalez@sigmadesigns.com X-Msg-Ref: server-5.tower-94.messagelabs.com!1447859570!6292356!1 X-Originating-IP: [195.215.56.170] X-StarScan-Received: X-StarScan-Version: 7.19.2; banners=-,-,- X-VirusChecked: Checked Received: (qmail 44379 invoked from network); 18 Nov 2015 15:12:51 -0000 Received: from 195-215-56-170-static.dk.customer.tdc.net (HELO CPH-EX1.SDESIGNS.COM) (195.215.56.170) by server-5.tower-94.messagelabs.com with AES128-SHA encrypted SMTP; 18 Nov 2015 15:12:51 -0000 Received: from [172.27.0.114] (172.27.0.114) by CPH-EX1.sdesigns.com (192.168.10.36) with Microsoft SMTP Server (TLS) id 14.1.339.1; Wed, 18 Nov 2015 16:12:50 +0100 Subject: [PATCH v9 2/2] arm-soc: Add support for tango4 platforms To: References: <564C94A5.4060301@sigmadesigns.com> From: Marc Gonzalez Message-ID: <564C9558.4020100@sigmadesigns.com> Date: Wed, 18 Nov 2015 16:12:24 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:41.0) Gecko/20100101 Firefox/41.0 SeaMonkey/2.38 MIME-Version: 1.0 In-Reply-To: <564C94A5.4060301@sigmadesigns.com> X-Originating-IP: [172.27.0.114] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151118_071313_662784_100846D2 X-CRM114-Status: GOOD ( 17.09 ) X-Spam-Score: -1.9 (-) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sebastian Frias , Thibaud Cornic , Mans Rullgard , Linux ARM 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.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 Add support for Sigma Designs ARM-based Tango4 "Secure Media Processor" platforms (i.e. smp8734, smp8756, smp8758, smp8759) built around the Cortex-A9 MPCore r3p0 (all dual-core, except the 8756). Support for older MIPS-based platforms can be found elsewhere: https://github.com/mansr/linux-tangox Signed-off-by: Marc Gonzalez --- arch/arm/Kconfig | 2 ++ arch/arm/Makefile | 1 + arch/arm/mach-tangox/Kconfig | 12 ++++++++++++ arch/arm/mach-tangox/Makefile | 2 ++ arch/arm/mach-tangox/setup.c | 32 ++++++++++++++++++++++++++++++++ arch/arm/mach-tangox/smc.S | 9 +++++++++ arch/arm/mach-tangox/smc.h | 5 +++++ 7 files changed, 63 insertions(+) create mode 100644 arch/arm/mach-tangox/Kconfig create mode 100644 arch/arm/mach-tangox/Makefile create mode 100644 arch/arm/mach-tangox/setup.c create mode 100644 arch/arm/mach-tangox/smc.S create mode 100644 arch/arm/mach-tangox/smc.h diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 774dc59650c5..d8f0c31f521f 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -934,6 +934,8 @@ source "arch/arm/mach-sunxi/Kconfig" source "arch/arm/mach-prima2/Kconfig" +source "arch/arm/mach-tangox/Kconfig" + source "arch/arm/mach-tegra/Kconfig" source "arch/arm/mach-u300/Kconfig" diff --git a/arch/arm/Makefile b/arch/arm/Makefile index 7451b447cc2d..7fcb4c63cdf7 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -203,6 +203,7 @@ machine-$(CONFIG_ARCH_SOCFPGA) += socfpga machine-$(CONFIG_ARCH_STI) += sti machine-$(CONFIG_ARCH_STM32) += stm32 machine-$(CONFIG_ARCH_SUNXI) += sunxi +machine-$(CONFIG_ARCH_TANGOX) += tangox machine-$(CONFIG_ARCH_TEGRA) += tegra machine-$(CONFIG_ARCH_U300) += u300 machine-$(CONFIG_ARCH_U8500) += ux500 diff --git a/arch/arm/mach-tangox/Kconfig b/arch/arm/mach-tangox/Kconfig new file mode 100644 index 000000000000..cf814d7336f3 --- /dev/null +++ b/arch/arm/mach-tangox/Kconfig @@ -0,0 +1,12 @@ +config ARCH_TANGOX + bool "Sigma Designs Tango4 (SMP87xx)" if ARCH_MULTI_V7 + # Cortex-A9 MPCore r3p0, PL310 r3p2 + select ARCH_HAS_HOLES_MEMORYMODEL + select ARM_ERRATA_754322 + select ARM_ERRATA_764369 if SMP + select ARM_ERRATA_775420 + select ARM_GIC + select CLKSRC_TANGO_XTAL + select GENERIC_IRQ_CHIP + select HAVE_ARM_SCU + select HAVE_ARM_TWD diff --git a/arch/arm/mach-tangox/Makefile b/arch/arm/mach-tangox/Makefile new file mode 100644 index 000000000000..0d7e2b5976e3 --- /dev/null +++ b/arch/arm/mach-tangox/Makefile @@ -0,0 +1,2 @@ +asflags-y += -mcpu=cortex-a9 +obj-y += setup.o smc.o diff --git a/arch/arm/mach-tangox/setup.c b/arch/arm/mach-tangox/setup.c new file mode 100644 index 000000000000..09b7540df14b --- /dev/null +++ b/arch/arm/mach-tangox/setup.c @@ -0,0 +1,32 @@ +#include +#include +#include +#include "smc.h" + +static int tango4_boot_secondary(unsigned int cpu, struct task_struct *idle) +{ + tango_set_aux_boot_addr(virt_to_phys(secondary_startup)); + tango_start_aux_core(cpu); + return 0; +} + +static struct smp_operations tango4_smp_ops __initdata = { + .smp_boot_secondary = tango4_boot_secondary, +}; + +CPU_METHOD_OF_DECLARE(tango4_smp, "sigma,tango4-smp", &tango4_smp_ops); + +static void tango_l2c_write(unsigned long val, unsigned int reg) +{ + pr_debug("%s: reg=0x%x val=0x%lx\n", __func__, reg, val); + if (reg == L2X0_CTRL) + tango_set_l2_control(val); +} + +static const char *tango_dt_compat[] = { "sigma,tango4", NULL }; + +DT_MACHINE_START(TANGO_DT, "Sigma Tango DT") + .dt_compat = tango_dt_compat, + .l2c_aux_mask = ~0, + .l2c_write_sec = tango_l2c_write, +MACHINE_END diff --git a/arch/arm/mach-tangox/smc.S b/arch/arm/mach-tangox/smc.S new file mode 100644 index 000000000000..5d932ce3c1bd --- /dev/null +++ b/arch/arm/mach-tangox/smc.S @@ -0,0 +1,9 @@ +#include + +ENTRY(tango_smc) + push {lr} + mov ip, r1 + dsb /* This barrier is probably unnecessary */ + smc #0 + pop {pc} +ENDPROC(tango_smc) diff --git a/arch/arm/mach-tangox/smc.h b/arch/arm/mach-tangox/smc.h new file mode 100644 index 000000000000..7a4af35cc390 --- /dev/null +++ b/arch/arm/mach-tangox/smc.h @@ -0,0 +1,5 @@ +extern int tango_smc(unsigned int val, unsigned int service); + +#define tango_set_l2_control(val) tango_smc(val, 0x102) +#define tango_start_aux_core(val) tango_smc(val, 0x104) +#define tango_set_aux_boot_addr(val) tango_smc((unsigned int)val, 0x105)