From patchwork Thu Feb 27 21:56:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Mayer X-Patchwork-Id: 25484 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f69.google.com (mail-qa0-f69.google.com [209.85.216.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5952620447 for ; Thu, 27 Feb 2014 21:56:48 +0000 (UTC) Received: by mail-qa0-f69.google.com with SMTP id w5sf6289698qac.0 for ; Thu, 27 Feb 2014 13:56:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=wJWh1ZBNBV5UZqegGtfU7NHEKPAOYmWy8BioojVK0dc=; b=kr34Ngp0mf9M+AbiISSPQz3kH5jmrliWo9iHBqJXM2SQPBkM/oV7SjqoqkGwY+6lhe 9WLz/svbhxyz47UnzwAxWOQRHZXVp9pVp6JqH6IXjfiNS6cikmVedmS49cSVl0LXNtzv /IhLYsmBhM7nJvjkq2YzDD5NrkRDl84GpVI1eIquhDy0SA8ciSVkql1y7U2frwEguEpy CvUIE68v8NfsxaAg8LY54Z/+GiTouv00Hdm6jWtPTs3fWRnJguTm/QxATtt5uWPdApRy OpygMA0CtLGuuLSUYaLyc69GxJckylT//ShhhPITFoxKerLMxYnDrMS/OxWXEyzFVdB7 hiug== X-Gm-Message-State: ALoCoQlNHenwMB/ZVfeTWT+YWT59s1dVITiUS5SGpMPRNAk1I8PrHwGjceq40BLYQEh+m5IBOoXk X-Received: by 10.58.39.202 with SMTP id r10mr7322170vek.12.1393538208057; Thu, 27 Feb 2014 13:56:48 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.41.85 with SMTP id y79ls775898qgy.92.gmail; Thu, 27 Feb 2014 13:56:47 -0800 (PST) X-Received: by 10.58.77.204 with SMTP id u12mr3266506vew.29.1393538207957; Thu, 27 Feb 2014 13:56:47 -0800 (PST) Received: from mail-ve0-f179.google.com (mail-ve0-f179.google.com [209.85.128.179]) by mx.google.com with ESMTPS id ov9si1775269vcb.121.2014.02.27.13.56.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 27 Feb 2014 13:56:47 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.179 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.179; Received: by mail-ve0-f179.google.com with SMTP id db12so594649veb.38 for ; Thu, 27 Feb 2014 13:56:47 -0800 (PST) X-Received: by 10.52.29.113 with SMTP id j17mr10647465vdh.22.1393538207851; Thu, 27 Feb 2014 13:56:47 -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.130.193 with SMTP id u1csp8055vcs; Thu, 27 Feb 2014 13:56:47 -0800 (PST) X-Received: by 10.67.5.233 with SMTP id cp9mr17308559pad.147.1393538206387; Thu, 27 Feb 2014 13:56:46 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id uc9si624666pac.94.2014.02.27.13.56.45; Thu, 27 Feb 2014 13:56:45 -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 S1752258AbaB0V4h (ORCPT + 26 others); Thu, 27 Feb 2014 16:56:37 -0500 Received: from mail-gw3-out.broadcom.com ([216.31.210.64]:32841 "EHLO mail-gw3-out.broadcom.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752005AbaB0V4e (ORCPT ); Thu, 27 Feb 2014 16:56:34 -0500 X-IronPort-AV: E=Sophos;i="4.97,557,1389772800"; d="scan'208";a="16754901" Received: from irvexchcas06.broadcom.com (HELO IRVEXCHCAS06.corp.ad.broadcom.com) ([10.9.208.53]) by mail-gw3-out.broadcom.com with ESMTP; 27 Feb 2014 14:08:14 -0800 Received: from IRVEXCHSMTP3.corp.ad.broadcom.com (10.9.207.53) by IRVEXCHCAS06.corp.ad.broadcom.com (10.9.208.53) with Microsoft SMTP Server (TLS) id 14.3.174.1; Thu, 27 Feb 2014 13:56:33 -0800 Received: from mail-irva-13.broadcom.com (10.10.10.20) by IRVEXCHSMTP3.corp.ad.broadcom.com (10.9.207.53) with Microsoft SMTP Server id 14.3.174.1; Thu, 27 Feb 2014 13:56:33 -0800 Received: from mail.broadcom.com (lbrmn-lnxub70.ric.broadcom.com [10.136.8.215]) by mail-irva-13.broadcom.com (Postfix) with ESMTP id B797DEEBB5; Thu, 27 Feb 2014 13:56:32 -0800 (PST) From: Markus Mayer To: Christian Daudt , Matt Porter CC: Device Tree List , ARM Kernel List , Linux Kernel Mailing List , Broadcom Kernel Feedback Subject: [PATCH 2/3] ARM: bcm21664: Add board support. Date: Thu, 27 Feb 2014 13:56:05 -0800 Message-ID: <1393538166-22868-3-git-send-email-markus.mayer@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1393538166-22868-1-git-send-email-markus.mayer@linaro.org> References: <1393538166-22868-1-git-send-email-markus.mayer@linaro.org> MIME-Version: 1.0 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.179 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..d3ef7e5 --- /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 bcm21644_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 bcm21644_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 = bcm21644_init, + .restart = bcm21644_restart, + .dt_compat = bcm21664_dt_compat, +MACHINE_END