From patchwork Thu Feb 2 10:43:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Machon X-Patchwork-Id: 13125731 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 15B60C61DA4 for ; Thu, 2 Feb 2023 10:47:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=mL1CJnibHogOrD36lpa4s4BhPkmf+iFMbowB849P3U4=; b=n8dJe8A83YEO1O xEmuoSMqXcPP6TvuixAS3+GZONuLai92zb7t6e5cuLU2T6aVuFa5ZlBla5gQunuV75JHR1jOegn6S WeMS+hTg7SPMwq0UqzmEZ3MOUeLQCq81pwxMPhh07HAD+S93BIZ71zLnyPAEDD3JdynGp5Di96Dk0 PojMZjg2/XW5cl1/GnKhI7nilkFRkkgvT9y6wruyJHZ9UiHsUNpOdzE7CujKz1g7dZFkkLT/zDuPQ o6biR6fl1OcRz1lYttblrBkcv/URA2YOTNYR9F4bodW3KEyFpjDoqvnL3GeCcNm9R2NOHss8my/p6 RhbM6LqfZGIiFmz76TRw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pNX7B-00FQEg-QI; Thu, 02 Feb 2023 10:46:49 +0000 Received: from esa.microchip.iphmx.com ([68.232.154.123]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pNX5L-00FPFH-Af for linux-arm-kernel@lists.infradead.org; Thu, 02 Feb 2023 10:44:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1675334696; x=1706870696; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=yuSDnsL/0c9B2AFF93vKaa6xO4cq9uMgsAkrTKjlUng=; b=jYpLGNAZSU0JvH8i1Bte6Lci+Tywze7yKRqB0LEgKRCRd9OlXEtxgtGF PtgL2pnEiSUzV5ToA/1TkFeSo0i9BNRPxbdIJs1yG2AOstGaQfm5yP4r1 zJD2BigkcZ3psk2FGXIQaoPT/1L2+6PVB7z3bH5xXoXfehKLjdpvdLlap wWu3nUajQLipj8kQkmvFcT9MdWPYZWzf3zpjoYnF6tPzy2SyYIIuh9Pwg HVvzJE8vdJaxYwxPFYZCrgcB57pt96qE7zOCEXBbzTuyHASEo407qyUJc nmfHp3DWHVNFQMc9geaaXEoBvkdU0h2fMtVPQb73PPYh5Z/cjFuWLzwE9 Q==; X-IronPort-AV: E=Sophos;i="5.97,267,1669100400"; d="scan'208";a="195044163" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 02 Feb 2023 03:44:54 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Thu, 2 Feb 2023 03:44:53 -0700 Received: from DEN-LT-70577.microchip.com (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2507.16 via Frontend Transport; Thu, 2 Feb 2023 03:44:49 -0700 From: Daniel Machon To: CC: , , , , , , , , , , , , , , , , , Subject: [PATCH net-next 09/10] net: microchip: sparx5: initialize PSFP Date: Thu, 2 Feb 2023 11:43:54 +0100 Message-ID: <20230202104355.1612823-10-daniel.machon@microchip.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230202104355.1612823-1-daniel.machon@microchip.com> References: <20230202104355.1612823-1-daniel.machon@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230202_024455_455002_40CE600C X-CRM114-Status: GOOD ( 11.77 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Initialize the SDLB's, stream gates and stream filters. Signed-off-by: Daniel Machon Reviewed-by: Simon Horman --- .../ethernet/microchip/sparx5/sparx5_main.h | 3 +++ .../ethernet/microchip/sparx5/sparx5_psfp.c | 18 ++++++++++++++++++ .../net/ethernet/microchip/sparx5/sparx5_qos.c | 2 ++ 3 files changed, 23 insertions(+) diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_main.h b/drivers/net/ethernet/microchip/sparx5/sparx5_main.h index cffed893fb7b..72e7928912eb 100644 --- a/drivers/net/ethernet/microchip/sparx5/sparx5_main.h +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_main.h @@ -456,6 +456,7 @@ int sparx5_sdlb_group_del(struct sparx5 *sparx5, u32 group, u32 idx); void sparx5_sdlb_group_init(struct sparx5 *sparx5, u64 max_rate, u32 min_burst, u32 frame_size, u32 idx); + /* sparx5_police.c */ enum { /* More policer types will be added later */ @@ -530,6 +531,8 @@ u32 sparx5_psfp_isdx_get_fm(struct sparx5 *sparx5, u32 isdx); u32 sparx5_psfp_sf_get_sg(struct sparx5 *sparx5, u32 sfid); void sparx5_isdx_conf_set(struct sparx5 *sparx5, u32 isdx, u32 sfid, u32 fmid); +void sparx5_psfp_init(struct sparx5 *sparx5); + /* sparx5_qos.c */ void sparx5_new_base_time(struct sparx5 *sparx5, const u32 cycle_time, const ktime_t org_base_time, ktime_t *new_base_time); diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_psfp.c b/drivers/net/ethernet/microchip/sparx5/sparx5_psfp.c index b70601a5e4c5..8dee1ab1fa75 100644 --- a/drivers/net/ethernet/microchip/sparx5/sparx5_psfp.c +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_psfp.c @@ -312,3 +312,21 @@ int sparx5_psfp_fm_del(struct sparx5 *sparx5, u32 id) return sparx5_sdlb_conf_set(sparx5, &fm); } + +void sparx5_psfp_init(struct sparx5 *sparx5) +{ + const struct sparx5_sdlb_group *group; + int i; + + for (i = 0; i < SPX5_SDLB_GROUP_CNT; i++) { + group = &sdlb_groups[i]; + sparx5_sdlb_group_init(sparx5, group->max_rate, + group->min_burst, group->frame_size, i); + } + + spx5_wr(ANA_AC_SG_CYCLETIME_UPDATE_PERIOD_SG_CT_UPDATE_ENA_SET(1), + sparx5, ANA_AC_SG_CYCLETIME_UPDATE_PERIOD); + + spx5_rmw(ANA_L2_FWD_CFG_ISDX_LOOKUP_ENA_SET(1), + ANA_L2_FWD_CFG_ISDX_LOOKUP_ENA, sparx5, ANA_L2_FWD_CFG); +} diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_qos.c b/drivers/net/ethernet/microchip/sparx5/sparx5_qos.c index ebfdbbf0a1ce..5f34febaee6b 100644 --- a/drivers/net/ethernet/microchip/sparx5/sparx5_qos.c +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_qos.c @@ -450,6 +450,8 @@ int sparx5_qos_init(struct sparx5 *sparx5) if (ret < 0) return ret; + sparx5_psfp_init(sparx5); + return 0; }