From patchwork Mon Nov 16 23:37:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 324532 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:5ce:0:0:0:0 with SMTP id l14csp3728283ils; Mon, 16 Nov 2020 15:40:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJyDsyMaDdeuVVSmNbTr9YH8WEvs6C2wKeHb0lLKMXppvQMoVophhcgnTrvH0XbvxRAeIG2o X-Received: by 2002:a17:906:a891:: with SMTP id ha17mr16884693ejb.116.1605570043052; Mon, 16 Nov 2020 15:40:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605570043; cv=none; d=google.com; s=arc-20160816; b=pM+Qd2nSeJdJZglc3nCnxLQtocJDLUBsd0+w+JCu9CuNmccD/3ZtKxgYC3fq1GoygG 2XZ7bDJHA3Q9E4owI8JoGh8BBB7sZkC9lkoFhARroankggn+aU5AXGERpWhzOS4Bgh4o 1OJTBy6BVguCuh/JLglr2mFPg25+7MadhskL0awJQ57Nh2HxTAoSqJqEHJn17FNf8xqE pFCCHPFcmAE+OLxsZFYCR+INwVuxH6DtB0r2lqhIeuGs/9Aj7BKTVpvs7aLqt9hZVcwQ eMIM/SbgnCtvroCgS/tMAMe5nXN8AzFuFS6rKUkl3jOWK/f95gsnVIabXEkBH7Ts+kip HpbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=R/KH1Zx6pvvwlPcex+1v/rVIsHRzuMbIHzVWH/5s1mU=; b=sbblhbBdiMa2gp+Vp1rpfTZv89WQzZf5atPnbT3Y6qZ0pyPskgKbwVbwnAdMTUDcZ5 +207I9Wf8rCyqYggz3n6JcvEe8u6yJUZDY7zPnSTrR5sLkrDG1kU4H3KPDb3NIAhbE1Q ibCdvlkD7mnShGSyuRysQ5m5+I3dQ6mQzqcSkVVa445ieK2dULpgbrFfoXvJBtwPFcEB txpHrwplbzyukRb3j/etQF2AxrVUxOx2FMPNA5jIdYMAFm1oeNz0kNB9EWb1dF2uPEGm +7rx0v0qnacyjEwcOjB1eXnaH8YBjC0WvPh0Qr1KdUHT7p6xsud2qxdB6JbEghy9//H7 NUQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KwtbHymU; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cc8si14104639edb.163.2020.11.16.15.40.42; Mon, 16 Nov 2020 15:40:43 -0800 (PST) Received-SPF: pass (google.com: domain of netdev-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=@linaro.org header.s=google header.b=KwtbHymU; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730908AbgKPXiS (ORCPT + 8 others); Mon, 16 Nov 2020 18:38:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730834AbgKPXiS (ORCPT ); Mon, 16 Nov 2020 18:38:18 -0500 Received: from mail-il1-x142.google.com (mail-il1-x142.google.com [IPv6:2607:f8b0:4864:20::142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F675C0613CF for ; Mon, 16 Nov 2020 15:38:18 -0800 (PST) Received: by mail-il1-x142.google.com with SMTP id l12so16936575ilo.1 for ; Mon, 16 Nov 2020 15:38:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=R/KH1Zx6pvvwlPcex+1v/rVIsHRzuMbIHzVWH/5s1mU=; b=KwtbHymUWZJcv5S8ebV7GWJ7G+cmnf42lsHn05KJt94fUMwFY8pCs+gtLPwiF9NDhc oe2HZKo/Q55q8QTdehuuL2fPhfPaus6kcYJtwj26rdBq/8Ic9IjAWmhJAuhhZ2K8KBxy j81EZgxYGxIEnfVnSlfvqQEHwhTVVxR5KmASeIqJXJG7S4nSb4Dz0w83fmRJG+M9o6H0 xEHEsWQG3JoEFjwmJnFZeJbB8nktaWeSZ5hEm6n62bDuhD0yVS21/Vgi2GXsbPwu+5CC QpANg6iyl3ox2X4PrynKq1wTMIxRUQ2P7dWx4eDM1NcNGfmWHaWu1PhvVwYvFFGm5hT9 phJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=R/KH1Zx6pvvwlPcex+1v/rVIsHRzuMbIHzVWH/5s1mU=; b=AcsEVdNm1qvP4dRtiSXeK43nuclyawuJakrJMJNdVZtBJrU0evW3d3waAeueloYE/E my5thKpiT4/EwhBUW8wp4zWBnWjCEmHPCZAY+8pxYt30uWlmgmW53qmsFLk49/RaF/yT DiFG9WnUKHaK7hkJSqCp1E/WxBSv1Zw7rLsZ2ECTV89Bepkf2nHlNgy+XtBgLhPW8+3w 1OMa3hSGp6JeEXmEroBIZ4c+6UmBVDxTWQ/u6WmlBqcZ8wHzNGbEDenqd6eaLgX/hKnV /ypecgcQ4BAiGulG9x42scodW/TL7zPXmCw8rdzg9PgH3rtIPOOdTiqF7lwJS67ZVwmV eBKg== X-Gm-Message-State: AOAM532uCckggZzCZ4cFRFp0oHZUT00nbbbi5xSrC+3b+spZK1uDNxLP ijPjjnrV2dlPmGcQ2HnlpXd8gA== X-Received: by 2002:a05:6e02:eaa:: with SMTP id u10mr9218286ilj.96.1605569897401; Mon, 16 Nov 2020 15:38:17 -0800 (PST) Received: from beast.localdomain (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.gmail.com with ESMTPSA id f18sm10180099ill.22.2020.11.16.15.38.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Nov 2020 15:38:16 -0800 (PST) From: Alex Elder To: davem@davemloft.net, kuba@kernel.org Cc: evgreen@chromium.org, subashab@codeaurora.org, cpratapa@codeaurora.org, bjorn.andersson@linaro.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 02/11] net: ipa: make filter/routing hash enable register variable Date: Mon, 16 Nov 2020 17:37:56 -0600 Message-Id: <20201116233805.13775-3-elder@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201116233805.13775-1-elder@linaro.org> References: <20201116233805.13775-1-elder@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org For IPA v3.5.1, the IPA filter/routing hash enable register actually does exist, but it is at offset 0x8c into the IPA register space. For newer versions of IPA it is at offset 0x148. Define a new inline function ipa_reg_filt_rout_hash_en_offset() to return the appropriate value for a given version of IPA hardware. Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_main.c | 9 ++++++--- drivers/net/ipa/ipa_reg.h | 9 +++++++-- 2 files changed, 13 insertions(+), 5 deletions(-) -- 2.20.1 diff --git a/drivers/net/ipa/ipa_main.c b/drivers/net/ipa/ipa_main.c index bfe95a46acaf1..a9d8597f970aa 100644 --- a/drivers/net/ipa/ipa_main.c +++ b/drivers/net/ipa/ipa_main.c @@ -339,9 +339,12 @@ static void ipa_hardware_config(struct ipa *ipa) val = u32_encode_bits(granularity, AGGR_GRANULARITY); iowrite32(val, ipa->reg_virt + IPA_REG_COUNTER_CFG_OFFSET); - /* Disable hashed IPv4 and IPv6 routing and filtering for IPA v4.2 */ - if (ipa->version == IPA_VERSION_4_2) - iowrite32(0, ipa->reg_virt + IPA_REG_FILT_ROUT_HASH_EN_OFFSET); + /* IPA v4.2 does not support hashed tables, so disable them */ + if (ipa->version == IPA_VERSION_4_2) { + u32 offset = ipa_reg_filt_rout_hash_en_offset(ipa->version); + + iowrite32(0, ipa->reg_virt + offset); + } /* Enable dynamic clock division */ ipa_hardware_dcd_config(ipa); diff --git a/drivers/net/ipa/ipa_reg.h b/drivers/net/ipa/ipa_reg.h index 001961cd526bc..b46e60744f57f 100644 --- a/drivers/net/ipa/ipa_reg.h +++ b/drivers/net/ipa/ipa_reg.h @@ -151,8 +151,13 @@ static inline u32 ipa_reg_state_aggr_active_offset(enum ipa_version version) } /* ipa->available defines the valid bits in the STATE_AGGR_ACTIVE register */ -/* The next register is present for IPA v4.2 and above */ -#define IPA_REG_FILT_ROUT_HASH_EN_OFFSET 0x00000148 +static inline u32 ipa_reg_filt_rout_hash_en_offset(enum ipa_version version) +{ + if (version == IPA_VERSION_3_5_1) + return 0x000008c; + + return 0x0000148; +} static inline u32 ipa_reg_filt_rout_hash_flush_offset(enum ipa_version version) {