Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3475697pxb; Sun, 7 Feb 2021 10:43:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJySsiKq74hJp97EdyMJ9fRKLXxAUVoDgBghmC/2ciuEEmsx3deqQkNTwIh4mCW5LVKsDbm9 X-Received: by 2002:a17:907:7815:: with SMTP id la21mr13033736ejc.12.1612723389853; Sun, 07 Feb 2021 10:43:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612723389; cv=none; d=google.com; s=arc-20160816; b=cZvOtKnis0EOQjz2grbLQEgT6/scWmV6MiZw06v7RuxelK6LskzI/aajLDD9j3Wwww 8IXnKFGqQq8t1bLCepTxEoZirkPqVGtSuj7urUprprFC+sgaeH92hsjOfz63uV6qHPE5 xSj92O8a8ikju/J3VuQMhbjKTGcZWJgcvMu72MSBBEcWl6UtupzxG5YSf8kQbeJtaK2S CA/7yiR/5S5jW+4Xt/Gsim/9s5eRptpgaPFTdYADuFSXb10sNc6VY53FLqzhOX/hLECB G7pGP/EtXH/TfxeIgywAkYF8+C4FZERWJUgT4r1X2Vsatdt3Q0JiYTj2RRIwEndF3gvK lNgg== 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=yiE2ADaG2u4SWFtFQYQcMMzcQhr3YAXBFzh91k7yIkc=; b=ooUhAPk6jHSYAJbKGdqQtWrzmJT/zrtu0qKK7tzak1TPD+cFS87nPbiKawZfXjjCeN vjG3VwQb8Qe8FU4ZdnYus4/EsjaMWFbHMfuLv9w0/sQtYqLtDkSBLLzZHmAFcZmLDrx2 SnoPFMz/keA1I+em/eGNqUEbD0GT9Q76+ViWLw1m8Jg0+BNTalqolLO003jHxtRbtjxD KaptM70v8e27OIJbNJ63crn+Sqvb2876UL0psmLDleLmeapgwtDTP7+9WQdle/UxMJwM KoN7wJLKsrPXz6wRb11+3BHPwg16jtMGFgcRpPSfCJng7Lr9JF0t0ITDUPaZsm0QRstL tRLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=KpenzF3R; 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 l21si7038755ejg.481.2021.02.07.10.42.46; Sun, 07 Feb 2021 10:43:09 -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=KpenzF3R; 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 S229745AbhBGSlA (ORCPT + 99 others); Sun, 7 Feb 2021 13:41:00 -0500 Received: from mx0b-0016f401.pphosted.com ([67.231.156.173]:9983 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229626AbhBGSk5 (ORCPT ); Sun, 7 Feb 2021 13:40:57 -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 117ITVqg027003; Sun, 7 Feb 2021 10:40:07 -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=yiE2ADaG2u4SWFtFQYQcMMzcQhr3YAXBFzh91k7yIkc=; b=KpenzF3RFf8E462oUChh3R6TwV2sRxMgwwYbODGf2YEhHoNNnSo6epP/lKpM+1Y9RWdi gilNH9GHZCOY1D5NKmpKtsGmEd5bsvjn5cn3qb6rAjJq6rcc3zpCPUhQcRw2Oou8a97K 0pNj9DAU7cT/wCxdIJDs9KawuBWozhPY8gnKqJTQZjKmZ1dfTRZ1kQXGjn6QFzXwv7sq DvtKY/9aHGNLjMPNNUylyObLwAa3lmk0Yr8VKbkthorNq8hPigYKrEcrhyr8G28QHpUX q1bkCPXNM8tWVtPdwQ6C+0GKpEaFP8EnfYyB9jIaLp6kaktXtmWvBdsfOIdS6evjUCPY iQ== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com with ESMTP id 36hugq2etm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Sun, 07 Feb 2021 10:40:07 -0800 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sun, 7 Feb 2021 10:40:05 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Sun, 7 Feb 2021 10:40:05 -0800 Received: from stefan-pc.marvell.com (stefan-pc.marvell.com [10.5.25.21]) by maili.marvell.com (Postfix) with ESMTP id 115AE3F703F; Sun, 7 Feb 2021 10:40:00 -0800 (PST) From: To: CC: , , , , , , , , , , , , , , , , Subject: [PATCH v9 net-next 03/15] net: mvpp2: add CM3 SRAM memory map Date: Sun, 7 Feb 2021 20:38:45 +0200 Message-ID: <1612723137-18045-4-git-send-email-stefanc@marvell.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1612723137-18045-1-git-send-email-stefanc@marvell.com> References: <1612723137-18045-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-07_10:2021-02-05,2021-02-07 signatures=0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Stefan Chulski This patch adds CM3 memory map and CM3 read/write callbacks. Signed-off-by: Stefan Chulski --- 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