From patchwork Tue Jun 13 14:55:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Cooper X-Patchwork-Id: 9784209 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AEE9E60212 for ; Tue, 13 Jun 2017 14:58:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8F9FF27D4A for ; Tue, 13 Jun 2017 14:58:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 833EA283ED; Tue, 13 Jun 2017 14:58:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1BD9327D4A for ; Tue, 13 Jun 2017 14:58:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=FOQMJJCxv4yTtVY7rkl1yI2asDSJNXnp+LBjgnAoiMA=; b=ZzzcWXqcy6FWpU+Z3MQU6MxCe2 AYpsgUgavQvzxzv1x6UmpIItA3ACcmLMxfJF/kkXUsQnu3UJrUEYMtXgEBopgR2OnasQ+n5ebH4HC jvZPxUybLHJ3hHz2KeS9JbS040e0NagNloqMSgzDNbkLQB5gVSHAGHxpPn/E/CML76dbzs27ksRgr G9lL0OWCLUvoEM7NnGvLYkJgXL/FQoiZeO+TXT48XOn9ZsK5mUa4eq56FXkY8obcX8tzEg+FhxAUW eI49Ei92JRyHOHI1CCd7ikvimYoDptKNcNqTMSmfXJ2Z2Qt5V/TZ9jezRhkD+WBPTBN1ZCYnGjmdH f4KpdkDw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dKnGx-0005GV-Ap; Tue, 13 Jun 2017 14:58:23 +0000 Received: from lpdvrndsmtp01.broadcom.com ([192.19.229.170] helo=rnd-relay.smtp.broadcom.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dKnGj-0004rm-LV for linux-arm-kernel@lists.infradead.org; Tue, 13 Jun 2017 14:58:11 +0000 Received: from mail-irv-17.broadcom.com (mail-irv-17.lvn.broadcom.net [10.75.224.233]) by rnd-relay.smtp.broadcom.com (Postfix) with ESMTP id ACE3F30C023; Tue, 13 Jun 2017 07:57:48 -0700 (PDT) Received: from stbsrv-and-3.and.broadcom.com (stbsrv-and-3.and.broadcom.com [10.28.16.21]) by mail-irv-17.broadcom.com (Postfix) with ESMTP id 2661681EA6; Tue, 13 Jun 2017 07:57:47 -0700 (PDT) From: Al Cooper To: linux-kernel@vger.kernel.org Subject: [PATCH v2 1/4] soc: brcmstb: Add Product ID and Family ID helper functions Date: Tue, 13 Jun 2017 10:55:18 -0400 Message-Id: <1497365721-31188-2-git-send-email-al.cooper@broadcom.com> X-Mailer: git-send-email 1.9.0.138.g2de3478 In-Reply-To: <1497365721-31188-1-git-send-email-al.cooper@broadcom.com> References: <1497365721-31188-1-git-send-email-al.cooper@broadcom.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170613_075809_767660_318B472F X-CRM114-Status: UNSURE ( 7.43 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, Florian Fainelli , Greg Kroah-Hartman , Al Cooper , Kishon Vijay Abraham I , Rob Herring , bcm-kernel-feedback-list@broadcom.com, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Al Cooper Signed-off-by: Al Cooper --- drivers/soc/bcm/brcmstb/common.c | 12 ++++++++++++ include/linux/soc/brcmstb/brcmstb.h | 10 ++++++++++ 2 files changed, 22 insertions(+) diff --git a/drivers/soc/bcm/brcmstb/common.c b/drivers/soc/bcm/brcmstb/common.c index b6195fd..184dbf5 100644 --- a/drivers/soc/bcm/brcmstb/common.c +++ b/drivers/soc/bcm/brcmstb/common.c @@ -40,6 +40,18 @@ bool soc_is_brcmstb(void) return of_match_node(brcmstb_machine_match, root) != NULL; } +u32 brcmstb_get_family_id(void) +{ + return family_id; +} +EXPORT_SYMBOL(brcmstb_get_family_id); + +u32 brcmstb_get_product_id(void) +{ + return product_id; +} +EXPORT_SYMBOL(brcmstb_get_product_id); + static const struct of_device_id sun_top_ctrl_match[] = { { .compatible = "brcm,bcm7125-sun-top-ctrl", }, { .compatible = "brcm,bcm7346-sun-top-ctrl", }, diff --git a/include/linux/soc/brcmstb/brcmstb.h b/include/linux/soc/brcmstb/brcmstb.h index 337ce41..23e4dc9 100644 --- a/include/linux/soc/brcmstb/brcmstb.h +++ b/include/linux/soc/brcmstb/brcmstb.h @@ -1,10 +1,20 @@ #ifndef __BRCMSTB_SOC_H #define __BRCMSTB_SOC_H +#define BRCM_ID(reg) ((u32)reg >> 28 ? (u32)reg >> 16 : (u32)reg >> 8) +#define BRCM_REV(reg) ((u32)reg & 0xff) + /* * Bus Interface Unit control register setup, must happen early during boot, * before SMP is brought up, called by machine entry point. */ void brcmstb_biuctrl_init(void); +/* + * Helper functions for getting family or product id from the + * SoC driver. + */ +u32 brcmstb_get_family_id(void); +u32 brcmstb_get_product_id(void); + #endif /* __BRCMSTB_SOC_H */