From patchwork Wed Feb 15 19:53:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 13142123 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 04DB5C636D4 for ; Wed, 15 Feb 2023 19:54:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229629AbjBOTyQ (ORCPT ); Wed, 15 Feb 2023 14:54:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229841AbjBOTyM (ORCPT ); Wed, 15 Feb 2023 14:54:12 -0500 Received: from mail-io1-xd32.google.com (mail-io1-xd32.google.com [IPv6:2607:f8b0:4864:20::d32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C278E3E62F for ; Wed, 15 Feb 2023 11:54:02 -0800 (PST) Received: by mail-io1-xd32.google.com with SMTP id j4so7567123iog.8 for ; Wed, 15 Feb 2023 11:54:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=55iMl67tczsHAriI/5ivr6yqGDBI3afdu3qz4PSaV8E=; b=r95+Yi3ZQYV06bxV2XGdq+pI+dROE3kraQJxFy36hyF2kZf3qwVRNdeXalqw7npB7+ F9nVAN/YGf35TkVigA5agOCI2UcK7xgxJhx6DasaNKKv/QDb+nPHpE4KzTalA2fuK6cD haV/45wSAqBwZEe4FboXThoOwDC7Gw6M8j6tPxlS9CbB2K2RulBCHJAVEuHnscEXT7iY YxqWzSwguyWx/utxw6jCYraaVAwtKUbla/78RoYlKzVyz7pzfMB+BaKmdLVJyopkh+Hc yUCwY9mFhuWlEpeU+rxytxI6caoVaEU0dWdwjVdDagGclrg3dq6CoM+l+v5m39ORSst4 uRuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=55iMl67tczsHAriI/5ivr6yqGDBI3afdu3qz4PSaV8E=; b=Jt1tcTj8EgE4M4TkIgIuO3Z2qMWwRjXQ+QUsqEZe8wn3385RbJ+cGwfUnReBAZ9CMR ZoQazxFGg/B/YQnAr30jnjCVwOVp4e0NC3q39yRZkNRMFuTDdPUrXrEbgqlCxO4sZ1QC CYx34cjdSUeBeEUZXaGtoEKH4Iby7S3dnq8GGmUpaeDNrImOILVX8C3B8P8enVXc0Wk9 /jToiGKw+qE5ndERPa++Ifgmy1BQ0/Z73dufBBSvWceC5H4yofrnhAlRzceyXVsjVLMi qjp/3JGbzb3yZ70nSp3zHCXzi5YchKzegLSPj2RNrw93S789hHyA9mYaudLlW2xDuHgK 6zSg== X-Gm-Message-State: AO0yUKXQZaHsXThizhQJvJQY8bJJtQL7MVstojVZDTk7BDnkt/tSb0YQ D9l3XC95nB+K7AfjMkQ56t3CGg== X-Google-Smtp-Source: AK7set/yolWgnkr5CODPg7mXWkmCahG3Y8RDu89TwGLTMT9/2zUHTtDoF0UAhEUqjoCs+mIPKPyHfQ== X-Received: by 2002:a5e:8c14:0:b0:720:9057:a083 with SMTP id n20-20020a5e8c14000000b007209057a083mr2630676ioj.13.1676490842146; Wed, 15 Feb 2023 11:54:02 -0800 (PST) Received: from presto.localdomain ([98.61.227.136]) by smtp.gmail.com with ESMTPSA id n10-20020a5ed90a000000b0073a312aaae5sm6291847iop.36.2023.02.15.11.54.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Feb 2023 11:54:01 -0800 (PST) From: Alex Elder To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: caleb.connolly@linaro.org, mka@chromium.org, evgreen@chromium.org, andersson@kernel.org, quic_cpratapa@quicinc.com, quic_avuyyuru@quicinc.com, quic_jponduru@quicinc.com, quic_subashab@quicinc.com, elder@kernel.org, netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 5/6] net: ipa: support different event ring encoding Date: Wed, 15 Feb 2023 13:53:51 -0600 Message-Id: <20230215195352.755744-6-elder@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230215195352.755744-1-elder@linaro.org> References: <20230215195352.755744-1-elder@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Starting with IPA v5.0, a channel's event ring index is encoded in a field in the CH_C_CNTXT_1 GSI register rather than CH_C_CNTXT_0. Define a new field ID for the former register and encode the event ring in the appropriate register. Signed-off-by: Alex Elder --- drivers/net/ipa/gsi.c | 5 ++++- drivers/net/ipa/gsi_reg.h | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/ipa/gsi.c b/drivers/net/ipa/gsi.c index 88279956194a9..f128d5bd6956e 100644 --- a/drivers/net/ipa/gsi.c +++ b/drivers/net/ipa/gsi.c @@ -840,12 +840,15 @@ static void gsi_channel_program(struct gsi_channel *channel, bool doorbell) val = ch_c_cntxt_0_type_encode(gsi->version, reg, GSI_CHANNEL_TYPE_GPI); if (channel->toward_ipa) val |= reg_bit(reg, CHTYPE_DIR); - val |= reg_encode(reg, ERINDEX, channel->evt_ring_id); + if (gsi->version < IPA_VERSION_5_0) + val |= reg_encode(reg, ERINDEX, channel->evt_ring_id); val |= reg_encode(reg, ELEMENT_SIZE, GSI_RING_ELEMENT_SIZE); iowrite32(val, gsi->virt + reg_n_offset(reg, channel_id)); reg = gsi_reg(gsi, CH_C_CNTXT_1); val = reg_encode(reg, CH_R_LENGTH, size); + if (gsi->version >= IPA_VERSION_5_0) + val |= reg_encode(reg, CH_ERINDEX, channel->evt_ring_id); iowrite32(val, gsi->virt + reg_n_offset(reg, channel_id)); /* The context 2 and 3 registers store the low-order and diff --git a/drivers/net/ipa/gsi_reg.h b/drivers/net/ipa/gsi_reg.h index 52520cd44c3e1..2a19d9e34a10a 100644 --- a/drivers/net/ipa/gsi_reg.h +++ b/drivers/net/ipa/gsi_reg.h @@ -102,7 +102,7 @@ enum gsi_reg_ch_c_cntxt_0_field_id { CH_EE, CHID, CHTYPE_PROTOCOL_MSB, /* IPA v4.5-4.11 */ - ERINDEX, + ERINDEX, /* Not IPA v5.0+ */ CHSTATE, ELEMENT_SIZE, }; @@ -124,6 +124,7 @@ enum gsi_channel_type { /* CH_C_CNTXT_1 register */ enum gsi_reg_ch_c_cntxt_1_field_id { CH_R_LENGTH, + CH_ERINDEX, /* IPA v5.0+ */ }; /* CH_C_QOS register */