Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2050188pxb; Thu, 11 Feb 2021 03:05:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJzA+rTNq9v6gqStFjVBSvUHq+KGbjRCR0b6XYkhkPyFn7uJdxB2jjlKwA/N42KLLOfrSeLl X-Received: by 2002:a05:6402:3589:: with SMTP id y9mr7929832edc.344.1613041539727; Thu, 11 Feb 2021 03:05:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613041539; cv=none; d=google.com; s=arc-20160816; b=UaXvtxm6QnTYa0zvyqItXqsiAly8IddUFYZX0bHaMy8TvMz9iX0ZCJBDZdt1N/bH6X LXDUqQu5X6iz8BeG3IVDHaB3qb+/FQv6NXqEE3NUbZiN+yI66oHVNonolio8W2qW/CoQ xKT0rGQgq/HVG/vgNTlim+NfrLVm7q7kesvnhexegBrF2GgsqZT434EYz007C5l+7JZ6 vZ/4Bfgf1W2h2ioKWcDXNjvCTNyDwbJLh1SQhCaBZcnlNKo9E/ZpF8JIbRpALgwttO6l WjUr3iIhWBuSQXuqfyYZoTCDBklu583V7EidBlgdxp0ktXjjPKahY9qkPp94Vg7J6PTN w7+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Lq1Smx+DEUnTfoNBQY/9X6EAfU0RZJZUvRTCbzNEoAk=; b=l6aNNO/ZUkKO9gGKnaYIrwnGMymSS2Hd1Kj+1+ko/vfWZkvYV8umfhf4f/VFQuB/AB 7t0ihE4kRLUCWmPivl6L9bw9fqYpMWHPQ1vr3CqHwvVlGbrIj2uuXC/wJUKMKTWkxw8o QRUMS6JTiLh4q+oRp5+vy7ntqL/IDSnIL2lVk7ReOVZHnEyZopjtbhzJRkahud1etFwd 4G9/e045AEjUv1TNNcUe9WT/kJq0WDb/rExJ9k7IhJgkJSE8yxSB39sD1Iy9e12rU/8+ DzVFobWByeY13yfW3Tw+p/zbSlRzNme+X57f6NZXFi9wklLk8rNwIcj5OH6yOq+ajElB NEyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=D5O86qR6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mp39si3324670ejc.596.2021.02.11.03.05.15; Thu, 11 Feb 2021 03:05:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=D5O86qR6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230213AbhBKLD4 (ORCPT + 99 others); Thu, 11 Feb 2021 06:03:56 -0500 Received: from mx0b-0016f401.pphosted.com ([67.231.156.173]:37252 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231136AbhBKKvL (ORCPT ); Thu, 11 Feb 2021 05:51:11 -0500 Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 11BAj63n008669; Thu, 11 Feb 2021 02:50:19 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=pfpt0220; bh=Lq1Smx+DEUnTfoNBQY/9X6EAfU0RZJZUvRTCbzNEoAk=; b=D5O86qR6aTyyM6ZLXWhUeiz97c/GImjkwhD29Bbh1ai6/PuFaWc9jWqNm4BnnsknhoPR 9lvLIX/+8E35vsJEGIwmhhUxZ+WkOAeeDhY4ffVQhQmWr00TbJSJAOQmKkAIC67Q0TyQ WeM0zyGhQ571qfanClu5Bi7EmQgXdwJLVaFogRclVm1JXLEkdenrGEhiwMLjYiug6uiS XZ8s79rq/2AEQxLzNkLWPD4PTq/twfsEzzvoJKWxYEEw1zoLixP+pGTqrhFT7j3t5NMp 4+FC0d22PUMlvGkNgF6tXzhOZ7tF6/NzhzBGcSMo11OpUmHpNgzvRrj41Vc6DvV3u1aP cQ== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com with ESMTP id 36hugqefav-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 11 Feb 2021 02:50:19 -0800 Received: from SC-EXCH04.marvell.com (10.93.176.84) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 11 Feb 2021 02:50:17 -0800 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 11 Feb 2021 02:50:16 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 11 Feb 2021 02:50:17 -0800 Received: from stefan-pc.marvell.com (stefan-pc.marvell.com [10.5.25.21]) by maili.marvell.com (Postfix) with ESMTP id 22CA83F703F; Thu, 11 Feb 2021 02:50:12 -0800 (PST) From: To: CC: , , , , , , , , , , , , , , , , Subject: [PATCH v13 net-next 03/15] net: mvpp2: add CM3 SRAM memory map Date: Thu, 11 Feb 2021 12:48:50 +0200 Message-ID: <1613040542-16500-4-git-send-email-stefanc@marvell.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1613040542-16500-1-git-send-email-stefanc@marvell.com> References: <1613040542-16500-1-git-send-email-stefanc@marvell.com> MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.369,18.0.737 definitions=2021-02-11_05:2021-02-10,2021-02-11 signatures=0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Stefan Chulski This patch adds CM3 memory map. Signed-off-by: Stefan Chulski Reviewed-by: Andrew Lunn Acked-by: Marcin Wojtas --- drivers/net/ethernet/marvell/mvpp2/mvpp2.h | 1 + drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 26 ++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2.h b/drivers/net/ethernet/marvell/mvpp2/mvpp2.h index 6bd7e40..56e90ab 100644 --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2.h +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2.h @@ -925,6 +925,7 @@ struct mvpp2 { /* Shared registers' base addresses */ void __iomem *lms_base; void __iomem *iface_base; + void __iomem *cm3_base; /* On PPv2.2, each "software thread" can access the base * register through a separate address space, each 64 KB apart diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c index a07cf60..eec3796 100644 --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c @@ -6846,6 +6846,27 @@ static int mvpp2_init(struct platform_device *pdev, struct mvpp2 *priv) return 0; } +static int mvpp2_get_sram(struct platform_device *pdev, + struct mvpp2 *priv) +{ + struct resource *res; + + res = platform_get_resource(pdev, IORESOURCE_MEM, 2); + if (!res) { + if (has_acpi_companion(&pdev->dev)) + dev_warn(&pdev->dev, "ACPI is too old, Flow control not supported\n"); + else + dev_warn(&pdev->dev, "DT is too old, Flow control not supported\n"); + return 0; + } + + priv->cm3_base = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(priv->cm3_base)) + return PTR_ERR(priv->cm3_base); + + return 0; +} + static int mvpp2_probe(struct platform_device *pdev) { const struct acpi_device_id *acpi_id; @@ -6902,6 +6923,11 @@ static int mvpp2_probe(struct platform_device *pdev) priv->iface_base = devm_ioremap_resource(&pdev->dev, res); if (IS_ERR(priv->iface_base)) return PTR_ERR(priv->iface_base); + + /* Map CM3 SRAM */ + err = mvpp2_get_sram(pdev, priv); + if (err) + dev_warn(&pdev->dev, "Fail to alloc CM3 SRAM\n"); } if (priv->hw_version == MVPP22 && dev_of_node(&pdev->dev)) { -- 1.9.1