From patchwork Thu Mar 6 09:18:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Mayer X-Patchwork-Id: 25793 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f198.google.com (mail-pd0-f198.google.com [209.85.192.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8DA7C203C3 for ; Thu, 6 Mar 2014 09:27:07 +0000 (UTC) Received: by mail-pd0-f198.google.com with SMTP id fp1sf5367892pdb.9 for ; Thu, 06 Mar 2014 01:27:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=OMUrrsgHHle86MMxsRCPmRihTEP459yNDe7RG91jc9E=; b=VhICASJr8FZ6a2c6PFcMxCEdQuzkyjp91ZXr8aEf1mAqMvMn91mNf4FOQyl+hRow2e sMLUCua7UZjmNp5lM0815T3Pxm9IgxH1d2Y6Vd1uLZ8VuTVxrMBwZWGBHfAKljzS728P m2OuAbX9fdSohtlQurbtw53an7aaUEAxtgZX0a8FjeYAFklJXURUdXXca0AlDBHh92KY CtvwXw135VO8UpMwu2nZnDSV4GUsyT3/dNCYHLqwHq9vV/brr+1HLOX5nOV0idsFqBgC u+NDsQsH3N9MIUgF0U0iuMbyT3F1VMNZbw4jlmijrQXkZDiXgG3jp3D6rTiwlo0cOV7L Kwrw== X-Gm-Message-State: ALoCoQmGUzJ49mqeSBFmb2AguluQNlkaLyPjYGQC81A9OgnMXLC9SbCd5rkBEHFDpa8N1eqN34nh X-Received: by 10.66.142.131 with SMTP id rw3mr4903111pab.18.1394098026794; Thu, 06 Mar 2014 01:27:06 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.82.39 with SMTP id g36ls700495qgd.25.gmail; Thu, 06 Mar 2014 01:27:06 -0800 (PST) X-Received: by 10.59.9.38 with SMTP id dp6mr1659328ved.24.1394098026624; Thu, 06 Mar 2014 01:27:06 -0800 (PST) Received: from mail-ve0-f173.google.com (mail-ve0-f173.google.com [209.85.128.173]) by mx.google.com with ESMTPS id qt5si942143vcb.98.2014.03.06.01.27.06 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 06 Mar 2014 01:27:06 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.173; Received: by mail-ve0-f173.google.com with SMTP id oy12so2347752veb.32 for ; Thu, 06 Mar 2014 01:27:06 -0800 (PST) X-Received: by 10.220.88.204 with SMTP id b12mr4104684vcm.3.1394098026529; Thu, 06 Mar 2014 01:27:06 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.78.9 with SMTP id i9csp25437vck; Thu, 6 Mar 2014 01:27:05 -0800 (PST) X-Received: by 10.68.138.165 with SMTP id qr5mr13013968pbb.123.1394098025558; Thu, 06 Mar 2014 01:27:05 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id mu18si1297870pab.258.2014.03.06.01.27.04; Thu, 06 Mar 2014 01:27:04 -0800 (PST) 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; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753196AbaCFJ04 (ORCPT + 26 others); Thu, 6 Mar 2014 04:26:56 -0500 Received: from smtp1.macau.ctm.net ([202.175.3.59]:47703 "EHLO smtp1.macau.ctm.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752327AbaCFJSm (ORCPT ); Thu, 6 Mar 2014 04:18:42 -0500 Received: from smtp1.macau.ctm.net (localhost.localdomain [127.0.0.1]) by localhost.macau.ctm.net (Postfix) with ESMTP id 61B801080AA; Thu, 6 Mar 2014 17:18:40 +0800 (HKT) Received: from mmayer-lnx.ric.broadcom.com (z88l218.static.ctm.net [202.175.88.218]) by smtp1.macau.ctm.net (Postfix) with ESMTP id 439BD108062; Thu, 6 Mar 2014 17:18:40 +0800 (HKT) From: Markus Mayer To: Matt Porter , Christian Daudt Cc: Device Tree List , Linux Kernel Mailing List , Broadcom Kernel Feedback Subject: [PATCH v2 2/3] ARM: bcm21664: Add board support. Date: Thu, 6 Mar 2014 17:18:13 +0800 Message-Id: <1394097494-29899-3-git-send-email-markus.mayer@linaro.org> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1394097494-29899-1-git-send-email-markus.mayer@linaro.org> References: <1394097494-29899-1-git-send-email-markus.mayer@linaro.org> X-TM-AS-MML: No X-TM-AS-Product-Ver: IMSS-7.1.0.1392-7.5.0.1017-20548.005 X-TM-AS-Result: No--17.900-7.0-31-10 X-imss-scan-details: No--17.900-7.0-31-10;No--17.900-7.0-31-10 X-TMASE-MatchedRID: 9nkzMtsPLI44Yc1OODXsU37siEtWY367f2g6KJZtxl0BOMBsCslSyJkC erFMaabiCM3xCXbfIgLzbylrK86ZaulVfYNOXGqmHOx1Vder/0uWWNQZZplrArt4BAaULwAVeR3 t+BJt1Fk6FnBjnFmaspaZO/nIoe7vBrU1duOq6zSiI3xhOar5y+gVdBvdmCRRRi9INZ1ZpGHCe/ czMaGEHuXj/YyU9oG67qEZpoAUsFSB3AuymGAHROKXavbHY/C1JD5ItWH4fSJ+YesuCgkiXI35b htr3DJimt59lr1z+lCkJtuPrq1VVUsKIxV/Fggw3fn7n/ZHGqb4uJ1REX4MHRcYcP1TU65HpQps xy6nnn4NWdlmVcmSLYAy6p60ZV62fJ5/bZ6npdiQZS2ujCtcuA== Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: markus.mayer@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Add support for the Broadcom BCM21664 mobile SoC. It has two Cortex-A9 cores like the BCM281xx family of chips. BCM21664 and BCM281xx share many IP blocks in addition to the ARM cores. Signed-off-by: Markus Mayer --- arch/arm/mach-bcm/Makefile | 6 ++- arch/arm/mach-bcm/board_bcm21664.c | 78 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+), 2 deletions(-) create mode 100644 arch/arm/mach-bcm/board_bcm21664.c diff --git a/arch/arm/mach-bcm/Makefile b/arch/arm/mach-bcm/Makefile index c2ccd5a..0e2e52e 100644 --- a/arch/arm/mach-bcm/Makefile +++ b/arch/arm/mach-bcm/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2012-2013 Broadcom Corporation +# Copyright (C) 2012-2014 Broadcom Corporation # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as @@ -10,6 +10,8 @@ # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -obj-$(CONFIG_ARCH_BCM_MOBILE) := board_bcm281xx.o bcm_kona_smc.o bcm_kona_smc_asm.o kona.o +obj-$(CONFIG_ARCH_BCM_MOBILE) := board_bcm281xx.o board_bcm21664.o \ + bcm_kona_smc.o bcm_kona_smc_asm.o kona.o + plus_sec := $(call as-instr,.arch_extension sec,+sec) AFLAGS_bcm_kona_smc_asm.o :=-Wa,-march=armv7-a$(plus_sec) diff --git a/arch/arm/mach-bcm/board_bcm21664.c b/arch/arm/mach-bcm/board_bcm21664.c new file mode 100644 index 0000000..acc1573 --- /dev/null +++ b/arch/arm/mach-bcm/board_bcm21664.c @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2014 Broadcom Corporation + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation version 2. + * + * This program is distributed "as is" WITHOUT ANY WARRANTY of any + * kind, whether express or implied; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include +#include +#include + +#include + +#include "bcm_kona_smc.h" +#include "kona.h" + +#define RSTMGR_DT_STRING "brcm,bcm21664-resetmgr" + +#define RSTMGR_REG_WR_ACCESS_OFFSET 0 +#define RSTMGR_REG_CHIP_SOFT_RST_OFFSET 4 + +#define RSTMGR_WR_PASSWORD 0xa5a5 +#define RSTMGR_WR_PASSWORD_SHIFT 8 +#define RSTMGR_WR_ACCESS_ENABLE 1 + +static void bcm21664_restart(enum reboot_mode mode, const char *cmd) +{ + void __iomem *base; + struct device_node *resetmgr; + + resetmgr = of_find_compatible_node(NULL, NULL, RSTMGR_DT_STRING); + if (!resetmgr) { + pr_emerg("Couldn't find " RSTMGR_DT_STRING "\n"); + return; + } + base = of_iomap(resetmgr, 0); + if (!base) { + pr_emerg("Couldn't map " RSTMGR_DT_STRING "\n"); + return; + } + + /* + * A soft reset is triggered by writing a 0 to bit 0 of the soft reset + * register. To write to that register we must first write the password + * and the enable bit in the write access enable register. + */ + writel((RSTMGR_WR_PASSWORD << RSTMGR_WR_PASSWORD_SHIFT) | + RSTMGR_WR_ACCESS_ENABLE, + base + RSTMGR_REG_WR_ACCESS_OFFSET); + writel(0, base + RSTMGR_REG_CHIP_SOFT_RST_OFFSET); + + /* Wait for reset */ + while (1); +} + +static void __init bcm21664_init(void) +{ + of_platform_populate(NULL, of_default_bus_match_table, NULL, + &platform_bus); + kona_l2_cache_init(); +} + +static const char * const bcm21664_dt_compat[] = { + "brcm,bcm21664", + NULL, +}; + +DT_MACHINE_START(BCM21664_DT, "BCM21664 Broadcom Application Processor") + .init_machine = bcm21664_init, + .restart = bcm21664_restart, + .dt_compat = bcm21664_dt_compat, +MACHINE_END