From patchwork Mon Aug 5 12:00:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mugunthan V N X-Patchwork-Id: 2838647 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E7C49BF535 for ; Mon, 5 Aug 2013 12:00:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AE7F920165 for ; Mon, 5 Aug 2013 12:00:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7DE2C20164 for ; Mon, 5 Aug 2013 12:00:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751216Ab3HEMAM (ORCPT ); Mon, 5 Aug 2013 08:00:12 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:39270 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751055Ab3HEMAL (ORCPT ); Mon, 5 Aug 2013 08:00:11 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id r75C0A7c016291; Mon, 5 Aug 2013 07:00:10 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id r75C0AYY007379; Mon, 5 Aug 2013 07:00:10 -0500 Received: from dlelxv22.itg.ti.com (172.17.1.197) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.2.342.3; Mon, 5 Aug 2013 07:00:10 -0500 Received: from mugunthan-lt.india.ti.com ([172.24.190.79]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id r75C071X027143; Mon, 5 Aug 2013 07:00:08 -0500 From: Mugunthan V N To: CC: , , , Mugunthan V N Subject: [net-next PATCH v2 1/1] drivers: net: cpsw: Add support for new CPSW IP version Date: Mon, 5 Aug 2013 17:30:05 +0530 Message-ID: <1375704005-3856-1-git-send-email-mugunthanvnm@ti.com> X-Mailer: git-send-email 1.8.4.rc0.11.g35f5eaa MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The new IP version has a minor changes and the offsets are same as the previous version, so adding new IP version support in the driver. Signed-off-by: Mugunthan V N Reviewed-by: Felipe Balbi --- Changes from intial version * changed the implementation to introduce new version intead of falling to latest version when it is unknown version. --- drivers/net/ethernet/ti/cpsw.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index db6933e..cd95671 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c @@ -82,6 +82,7 @@ do { \ #define CPSW_VERSION_1 0x19010a #define CPSW_VERSION_2 0x19010c +#define CPSW_VERSION_3 0x19010f #define HOST_PORT_NUM 0 #define SLIVER_SIZE 0x40 @@ -991,6 +992,7 @@ static void cpsw_slave_open(struct cpsw_slave *slave, struct cpsw_priv *priv) slave_write(slave, TX_PRIORITY_MAPPING, CPSW1_TX_PRI_MAP); break; case CPSW_VERSION_2: + case CPSW_VERSION_3: slave_write(slave, TX_PRIORITY_MAPPING, CPSW2_TX_PRI_MAP); break; } @@ -2015,6 +2017,7 @@ static int cpsw_probe(struct platform_device *pdev) dma_params.desc_mem_phys = 0; break; case CPSW_VERSION_2: + case CPSW_VERSION_3: priv->host_port_regs = ss_regs + CPSW2_HOST_PORT_OFFSET; priv->cpts->reg = ss_regs + CPSW2_CPTS_OFFSET; priv->hw_stats = ss_regs + CPSW2_HW_STATS;