From patchwork Fri Jun 2 18:01:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Cooper X-Patchwork-Id: 9763157 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 0CECF602BF for ; Fri, 2 Jun 2017 18:08:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0341F28593 for ; Fri, 2 Jun 2017 18:08:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EAC8F285A8; Fri, 2 Jun 2017 18:08:54 +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_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM 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 9853028593 for ; Fri, 2 Jun 2017 18:08:54 +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=KY+I/46jkHPGQl2gO/+3XhVMYnbe5EBdyVsMcumtKwk=; b=qoyT85iWeZI1StksLHx/u6BZjg 5cagrsGnEobQDL03ewgZkdiw0+kCQ16YKW66pjdUb/asNAuGTbz+6XAdzFG+ZZ0oFYHWmWNzk8b++ KkTOoaB/AU1DFZFxT+/vWwDZnKs55rwXj+K2HE2FxND0+aEcY5DQ2LLTL4EqBPb/+1nLCM0ZV2/us NM6TS3CcvRxNCQ7eDeLvzL9let0MHpNllHw+ltOwU3ZaU7AlJ3owhd69tnKG84UuZTsa2qyBc8T0F Ssn2mi/qcKb4mKO2aCp2fdV/Eq3vmav2uA7qxVO/ZY1G5S3agp5bipdwhs6h4UeevwZev5WEo2If8 yimF+YZg==; 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 1dGr0H-0002kU-3i; Fri, 02 Jun 2017 18:08:53 +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 1dGr06-0002Vq-M0 for linux-arm-kernel@lists.infradead.org; Fri, 02 Jun 2017 18:08:44 +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 2770930C024; Fri, 2 Jun 2017 11:08:23 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 rnd-relay.smtp.broadcom.com 2770930C024 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1496426903; bh=M1KR70AKsssYqwWENy5ShedtmPHUk6yq55CpKSIGDvc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B1SOeLd2hUWB5p4kXNd2N3buWAh3AeLureYtwHAtehDztuVJHbDnH6vRBrTSCXfRT tOMcTb2lzI1i1hZJ8IBZ948dRUVasGB8UVoIBt2LYjX1pVJS2OvB+X7udhxCladqd6 evADoBuPog6j8H3zbb4GQPZ0SEa1dS/8zWTi/uAc= 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 A842081EE7; Fri, 2 Jun 2017 11:08:21 -0700 (PDT) From: Al Cooper To: linux-kernel@vger.kernel.org Subject: [PATCH 1/3] soc: brcmstb: Add Product ID and Family ID helper functions Date: Fri, 2 Jun 2017 14:01:50 -0400 Message-Id: <1496426512-10590-2-git-send-email-alcooperx@gmail.com> X-Mailer: git-send-email 1.9.0.138.g2de3478 In-Reply-To: <1496426512-10590-1-git-send-email-alcooperx@gmail.com> References: <1496426512-10590-1-git-send-email-alcooperx@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170602_110842_864566_97D708E7 X-CRM114-Status: UNSURE ( 7.41 ) 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 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 */