From patchwork Mon Oct 29 18:45:14 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Cochran X-Patchwork-Id: 1665231 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 773D3DFB7A for ; Mon, 29 Oct 2012 18:48:38 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TSuM5-0003ft-Tv; Mon, 29 Oct 2012 18:46:34 +0000 Received: from mail-ee0-f49.google.com ([74.125.83.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TSuLF-0003WD-JB for linux-arm-kernel@lists.infradead.org; Mon, 29 Oct 2012 18:45:42 +0000 Received: by mail-ee0-f49.google.com with SMTP id c1so2331769eek.36 for ; Mon, 29 Oct 2012 11:45:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :in-reply-to:references; bh=PO9KkWwRNtJ47KwqYG8zad/7YmB55enkiy7RbUmFHv4=; b=CUD3VkLP4bTQSsRTIws+EkL4FA/qpNUAZs9QFRz39mfVaXEQdpGwQMhXCHw2ZfgMBU VOBci8TyUyqILpPoAQ0zRmUZDSCGfA+3R2v99ti5hqX5yGDac7o9D+XmyLQ4JjJmFjuX 9HtlKqdQK5ZinDEdhMw2Y6IStAp7RRCU5Zw1DueJXUyytlFs82amhtNkuhVtoPMbj7j7 zws7bNiVloKn1F32XXvRSfzmQYy8qWGnTqpXnf+420BpVnWANAOsIlNKzxwSpmpMc/tm LTDyHSgPRo5/TX/X/F3rSHDjqkRw75vwixAEkBrT15LjlfyYi70l+usMvdR5Mf8VwtSL VSFA== Received: by 10.14.193.134 with SMTP id k6mr64191105een.15.1351536341283; Mon, 29 Oct 2012 11:45:41 -0700 (PDT) Received: from localhost.localdomain (089144206154.atnat0015.highway.a1.net. [89.144.206.154]) by mx.google.com with ESMTPS id o49sm24364915eep.5.2012.10.29.11.45.39 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 29 Oct 2012 11:45:40 -0700 (PDT) From: Richard Cochran To: Subject: [PATCH net-next V3 04/10] cpsw: remember the silicon version Date: Mon, 29 Oct 2012 19:45:14 +0100 Message-Id: <026d147c58c00f4fbe91f1bd8fc6c23b8b57b4ef.1351535539.git.richardcochran@gmail.com> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: References: In-Reply-To: References: X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.83.49 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (richardcochran[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Mugunthan V N , David Miller , linux-arm-kernel@lists.infradead.org, Cyril Chemparathy X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org This patch lets the CPSW driver remember the version number in order to support the two different variants already in the wild. Signed-off-by: Richard Cochran --- drivers/net/ethernet/ti/cpsw.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index b4ca370..5c427cf 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c @@ -76,6 +76,8 @@ do { \ #define CPSW_MINOR_VERSION(reg) (reg & 0xff) #define CPSW_RTL_VERSION(reg) ((reg >> 11) & 0x1f) +#define CPSW_VERSION_1 0x19010a +#define CPSW_VERSION_2 0x19010c #define CPDMA_RXTHRESH 0x0c0 #define CPDMA_RXFREE 0x0e0 #define CPDMA_TXHDP 0x00 @@ -216,6 +218,7 @@ struct cpsw_priv { struct cpsw_wr_regs __iomem *wr_regs; struct cpsw_host_regs __iomem *host_port_regs; u32 msg_enable; + u32 version; struct net_device_stats stats; int rx_packet_max; int host_port; @@ -540,6 +543,7 @@ static int cpsw_ndo_open(struct net_device *ndev) pm_runtime_get_sync(&priv->pdev->dev); reg = __raw_readl(&priv->regs->id_ver); + priv->version = reg; dev_info(priv->dev, "initializing cpsw version %d.%d (%d)\n", CPSW_MAJOR_VERSION(reg), CPSW_MINOR_VERSION(reg),