Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp954837rdb; Tue, 23 Jan 2024 23:31:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IFduumpqaNPEKLpn9ESswvAUUnRg8qE9bMiPJQzUdk/w/AbsuRol4EnV8yGlxw0lSttvSxB X-Received: by 2002:a05:6402:31b4:b0:55a:5308:7415 with SMTP id dj20-20020a05640231b400b0055a53087415mr1476169edb.63.1706081460725; Tue, 23 Jan 2024 23:31:00 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706081460; cv=pass; d=google.com; s=arc-20160816; b=d0LF/W2dTotVmOOzBRl2mu4FR5njIm+4Us1czTqXtmihCPV0muOda/jzbYbRYsSVda Yg6o1w3MB0CXD96IqUy8RQT4SIQ/+VlTnaCgYbLhPsMnx6HrqxC9GReWDArPqCf0CLe1 Qd5B2aTBLRiyR2roe5a0bzKp3S1LwVNzYR+GBH4n5BNK7F1PIDZxEJdNB67KMFrSjv9c pVO02NwVlT8kbYRWGKICrDzXP+SUQvUH+aRgfEmzZ6fHUNKldZo7NbYHNHfMJiFtFPLl qMdUY7jDwlTV4aeQLoRrdW3BxY3LnNl2SwSV3lzRKKael7HNsi5t/uphv45rCQTi4zeJ XS8Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=3q1o6aAekTHAGtHaTxP4kjBlXWWUej4AyBNrNnh309M=; fh=j6ksh2rtYP6bOz2jTeYgd2kL/TgwE9f5vbnxCAPXDSc=; b=Up69y8FRsR9azN2/5CYhp6BjlB4o1MhhAhJqmrbBdjS9o7DGYZQdjAlY32Itqf4l97 lwzooeBPp4oUpKtN90tq7hFQJnwg9eTiLgTlPd3BGNWwEWKdI6RC/0IF+IUnfT4gMg5F KDBt/d5hepcrUkPD3GbFqGReFuizRagVY5BxA963ucYGbl2lObStTU/PBWOEoOQHUgTp 6jjnJjTdnmnOEKm6N7SZcVHLosVhl7g324iGuEZ8+m4WFxNCQcNsjp5euK06QAWs0djG EBqTr9M3ehwIGzg/1v/xSbMm2w6KEdMFwr4RPylrNBl11cpxkYNTHofEK3fkRZ/Bh7Z9 hkmA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Hg+uUpCP; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-crypto+bounces-1583-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-crypto+bounces-1583-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id p8-20020a056402500800b0055c6b9df873si2051007eda.90.2024.01.23.23.31.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 23:31:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto+bounces-1583-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Hg+uUpCP; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-crypto+bounces-1583-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-crypto+bounces-1583-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 4883E1F234E0 for ; Wed, 24 Jan 2024 07:31:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DF326168AF; Wed, 24 Jan 2024 07:30:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Hg+uUpCP" X-Original-To: linux-crypto@vger.kernel.org Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 25CBF16429; Wed, 24 Jan 2024 07:30:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706081453; cv=none; b=IRxKkPTGY15lrPOQxIzrHCOFwPOhmbo9qyWecY9ItDVx4ffsdIviA+DG+EoZC7A+MxHaVZDmHRSrRlXjFh9MuKABmalIM053TAY/XEtzImlPnJb76Gx8E5qbyHAuz+U2lQb2evja2jU1DiJe9lX3jj8V90iuVb+tk8XdpHo7qUk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706081453; c=relaxed/simple; bh=zcuTBnSpR8a5t/QEYSRtGuCgQG6oo8zB7awoq0F0Efg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=leE8y0X0X3wr2tF1wk31WsvKa10oR4i4VJg1whtgrpNMmdVf4lbx2o7HH74ULF8tnh6TwSxsagrh6nQMFZPkb1Ff5WzY4AH+1wOjcgikZ9NsF7n52nYBnOdHtoccutLDkz+u+oY1WCkcTQNZ1GSD18fK8aeoakHo5bTizjJyGtc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Hg+uUpCP; arc=none smtp.client-ip=209.85.128.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-40e80046264so64802155e9.0; Tue, 23 Jan 2024 23:30:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706081450; x=1706686250; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=3q1o6aAekTHAGtHaTxP4kjBlXWWUej4AyBNrNnh309M=; b=Hg+uUpCPOF+2+QtvsauJnKFCxRX56WPMIrLJX4oo7wUbRJemdGUrSJqK/ReDAUZGjI QsFEQaY+WkP8zVW35MuTxlPeEqs9efzy3SsEjJsW0FDNp9AQbneRF5pAeP8V1TQ0hyNo CxVhvszF4JkzwGUWa0uDZeegx1f/rErq/2mCvuQWvdN509IdP1+MhQXtcN6KKQQybRJY aJu/Gkgo2h8dK7p6M21DiDF5dUY7GrBSXKIG/r6YRIpFtWXq6pNQUoiuvDwKA6knkaS8 CSvkKQHJ9SpdkenYuVwC/khNMCvw4sHJRKUHEkPNn3PYm5huDhHHjO8G9YMGu4ytDlCx St3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706081450; x=1706686250; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=3q1o6aAekTHAGtHaTxP4kjBlXWWUej4AyBNrNnh309M=; b=BuA1girzLuB6rIvBPmhNqgGVxf2KnWs6Eni2udCYNuoQGJ9NkF8o6ZCl9nLWtXkkhC X2VDKb+0OFgHCBYxZ8mwJ1Zec2PgY5L0H3qTNIOP08oaOlhT4bE8OgRXD6dRTVAbH7GR mijskF/Gnip0/jpMvqOKj4GulCCbquoEa63zwopIFtMoKdilBrkjDyzfwYhVrFWAAY9n 4iv9o7vB/ZJClP/VVhHLwHCKs4+hOXJToV4UoF7LuZNuogz15dqNv+w9ZN43XpPMUpFI l4g71fsADbYR1pAx55EF5EAu6wzLZKSTO5+QyWDe8fnBWocRO7B36XTQDt7eCzhppxba 32wQ== X-Gm-Message-State: AOJu0YyfAwSZbgR7EbBOCw4WJbJwxxAOEaS4znfkw5kUg9Az7jNV+VX+ pbYohlcbOJgDwdVZ9oe1csCZfyuhrD28K9nasneA2PEUUPkU9IGk X-Received: by 2002:a05:600c:4514:b0:40e:4a58:2a85 with SMTP id t20-20020a05600c451400b0040e4a582a85mr853492wmo.99.1706081450216; Tue, 23 Jan 2024 23:30:50 -0800 (PST) Received: from Red ([2a01:cb1d:3d5:a100:4a02:2aff:fe07:1efc]) by smtp.googlemail.com with ESMTPSA id ek15-20020a05600c3ecf00b0040e8e358f82sm21572528wmb.19.2024.01.23.23.30.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 23:30:50 -0800 (PST) Date: Wed, 24 Jan 2024 08:30:48 +0100 From: Corentin Labbe To: Alexey Romanov Cc: neil.armstrong@linaro.org, clabbe@baylibre.com, herbert@gondor.apana.org.au, davem@davemloft.net, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, khilman@baylibre.com, jbrunet@baylibre.com, martin.blumenstingl@googlemail.com, linux-crypto@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@salutedevices.com Subject: Re: [PATCH v2 03/20] drviers: crypto: meson: add platform data Message-ID: References: <20240123165831.970023-1-avromanov@salutedevices.com> <20240123165831.970023-4-avromanov@salutedevices.com> Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240123165831.970023-4-avromanov@salutedevices.com> Le Tue, Jan 23, 2024 at 07:58:14PM +0300, Alexey Romanov a ?crit : > To support other Amlogic SoC's we have to > use platform data: descriptors and status registers > offsets are individual for each SoC series. > > Signed-off-by: Alexey Romanov > --- > drivers/crypto/amlogic/amlogic-gxl-cipher.c | 2 +- > drivers/crypto/amlogic/amlogic-gxl-core.c | 31 +++++++++++++++------ > drivers/crypto/amlogic/amlogic-gxl.h | 11 ++++++++ > 3 files changed, 35 insertions(+), 9 deletions(-) > > diff --git a/drivers/crypto/amlogic/amlogic-gxl-cipher.c b/drivers/crypto/amlogic/amlogic-gxl-cipher.c > index b19032f92415..7eff3ae7356f 100644 > --- a/drivers/crypto/amlogic/amlogic-gxl-cipher.c > +++ b/drivers/crypto/amlogic/amlogic-gxl-cipher.c > @@ -225,7 +225,7 @@ static int meson_cipher(struct skcipher_request *areq) > > reinit_completion(&mc->chanlist[flow].complete); > mc->chanlist[flow].status = 0; > - writel(mc->chanlist[flow].t_phy | 2, mc->base + (flow << 2)); > + writel(mc->chanlist[flow].t_phy | 2, mc->base + ((mc->pdata->descs_reg + flow) << 2)); > wait_for_completion_interruptible_timeout(&mc->chanlist[flow].complete, > msecs_to_jiffies(500)); > if (mc->chanlist[flow].status == 0) { > diff --git a/drivers/crypto/amlogic/amlogic-gxl-core.c b/drivers/crypto/amlogic/amlogic-gxl-core.c > index a58644be76e9..2be381e157c4 100644 > --- a/drivers/crypto/amlogic/amlogic-gxl-core.c > +++ b/drivers/crypto/amlogic/amlogic-gxl-core.c > @@ -18,6 +18,7 @@ > #include > #include > #include > +#include > #include > > #include "amlogic-gxl.h" > @@ -30,9 +31,10 @@ static irqreturn_t meson_irq_handler(int irq, void *data) > > for (flow = 0; flow < mc->flow_cnt; flow++) { > if (mc->chanlist[flow].irq == irq) { > - p = readl(mc->base + ((0x04 + flow) << 2)); > + p = readl(mc->base + ((mc->pdata->status_reg + flow) << 2)); > if (p) { > - writel_relaxed(0xF, mc->base + ((0x4 + flow) << 2)); > + writel_relaxed(0xF, mc->base + > + ((mc->pdata->status_reg + flow) << 2)); > mc->chanlist[flow].status = 1; > complete(&mc->chanlist[flow].complete); > return IRQ_HANDLED; > @@ -245,15 +247,34 @@ static void meson_unregister_algs(struct meson_dev *mc) > } > } > > +static const struct meson_pdata meson_gxl_pdata = { > + .descs_reg = 0x0, > + .status_reg = 0x4, > +}; > + > +static const struct of_device_id meson_crypto_of_match_table[] = { > + { > + .compatible = "amlogic,gxl-crypto", > + .data = &meson_gxl_pdata, > + }, > + {}, > +}; > + > static int meson_crypto_probe(struct platform_device *pdev) > { > + const struct of_device_id *match; > struct meson_dev *mc; > int err; > > + match = of_match_device(meson_crypto_of_match_table, &pdev->dev); > + if (!match) > + return -EINVAL; > + > mc = devm_kzalloc(&pdev->dev, sizeof(*mc), GFP_KERNEL); > if (!mc) > return -ENOMEM; > > + mc->pdata = match->data; > mc->dev = &pdev->dev; > platform_set_drvdata(pdev, mc); > > @@ -312,12 +333,6 @@ static void meson_crypto_remove(struct platform_device *pdev) > clk_disable_unprepare(mc->busclk); > } > > -static const struct of_device_id meson_crypto_of_match_table[] = { > - { .compatible = "amlogic,gxl-crypto", }, > - {} > -}; > -MODULE_DEVICE_TABLE(of, meson_crypto_of_match_table); Hello This patch breaks bisection, since it removes MODULE_DEVICE_TABLE. After applying patchs 1,2,3 the driver does not load anymore on lepotato board. Regards