Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp509656imu; Wed, 23 Jan 2019 00:15:06 -0800 (PST) X-Google-Smtp-Source: ALg8bN5O1pAfj5RwY1wOiLE6oVt2LPPSKnp+7M78R35YrFzqjYaPcu6HtPfJpoSpZxRyKbq8uS83 X-Received: by 2002:a63:a91a:: with SMTP id u26mr1109917pge.349.1548231306043; Wed, 23 Jan 2019 00:15:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548231306; cv=none; d=google.com; s=arc-20160816; b=c2T8xdYIPRlK6ZbTCPu3x/tFmNUNvUF/E3s6Y3ueb7ERc46HwuDCr0zDXlDMMX3e+W wv5Ng/ysU5yg258ND0ts+H928SP541u1uX20Wfu2bvUsCYEGfpKmJPn0A4Cf6+BbKDZl 6quzCMxWnuuRYzzHEmULfPQyLDBhxZExqxnrytOOQQ/wlPbuku4IhSv40tRr4pNcu082 MnLv52rtcC8QG/9aUGVP9UAYbWVxCrGfAit7d5Rox8L3YK8SMCCgFiZ4MvDnxVq7LGmS BvMGoZ/gLfojTyUspXcbJ86+Cd0DXkpTup1My8JQgIaYsi7EQeLsGCDLttRXZbk59Yg1 h+iA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=sis5oM8WvvGrLh7XEzQSUGn5258EnuORlnaHq+0Hlro=; b=BnWNjJ8u7gg5NFMKsc04WnmowrNn33NxRJOQGSyI3CtVG1hDedGcq+zJhTw0PDxDd2 P+xz7oE9qrEfujFJVFIppYuh+N62wB6TBARP1DJXzYkKof18W3BmBWOVukvMZnxkpwe1 U+7D90Aseg+fc2uuuvPgJ6sbbRniIYnhEvlZw+mz1a2YIkChDHC5+9+8UC2N7vMuNmsZ swU84SlmDnBeFUN6baPu1otoLL7u9qRDsTKLxQMUQR5PfpKj0VLb9rtccM+e2SenFg5C KdCbxJVWWJLMKNfXMa6RM0/bzc9RzsZTW5ZTzWQWD1GbwnCP6th2/mkiLTqyBj/GRptk cslw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=efEQ68BC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m15si17795631pgc.381.2019.01.23.00.14.50; Wed, 23 Jan 2019 00:15:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=efEQ68BC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726326AbfAWINn (ORCPT + 99 others); Wed, 23 Jan 2019 03:13:43 -0500 Received: from mail.kernel.org ([198.145.29.99]:60622 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725973AbfAWINn (ORCPT ); Wed, 23 Jan 2019 03:13:43 -0500 Received: from mail-lj1-f171.google.com (mail-lj1-f171.google.com [209.85.208.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 35B0A21841; Wed, 23 Jan 2019 08:13:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548231221; bh=ZN6CWeqhwfuLgxbwWQSMDDCYVZ184BC+vZXvvy9Bvaw=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=efEQ68BCZrG1A5sjPocCMzI0lRuhsVIk2LrMyMCyVEHNzVfIx3CaHFnWZHdGoZNOE 0p1+kHO0NWmt+r0nnnj6MDX7u4DEzl06VHPHL89B9mI1mCU3Z/Sw/myUzaatkuH9p1 ZNpX11DvF5iqkUKSkDZb2Hgiiihs2o/wkM49X+CQ= Received: by mail-lj1-f171.google.com with SMTP id c19-v6so1101014lja.5; Wed, 23 Jan 2019 00:13:41 -0800 (PST) X-Gm-Message-State: AJcUukeKKeGTgvzkJ/c90a0+jthxQtJQ+JjB9QQEWorLSjwEdWbmkY+e 1GrC4NK2I0/kDJdSySrXnYRhVoY2rZSrxeAUTwc= X-Received: by 2002:a2e:9a16:: with SMTP id o22-v6mr1098991lji.112.1548231219295; Wed, 23 Jan 2019 00:13:39 -0800 (PST) MIME-Version: 1.0 References: <20190122152553.1537-1-k.konieczny@partner.samsung.com> <20190122152553.1537-4-k.konieczny@partner.samsung.com> In-Reply-To: <20190122152553.1537-4-k.konieczny@partner.samsung.com> From: Krzysztof Kozlowski Date: Wed, 23 Jan 2019 09:13:28 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v1 3/3] crypto: s5p: add AES support for Exynos5433 To: Kamil Konieczny Cc: Vladimir Zapolskiy , Herbert Xu , "David S. Miller" , linux-crypto@vger.kernel.org, "linux-samsung-soc@vger.kernel.org" , linux-kernel@vger.kernel.org, Bartlomiej Zolnierkiewicz , Marek Szyprowski Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 22 Jan 2019 at 16:26, Kamil Konieczny wrote: > > Add AES crypto HW acceleration for Exynos5433, with the help of SlimSSS IP. > > Signed-off-by: Kamil Konieczny > --- > drivers/crypto/s5p-sss.c | 50 ++++++++++++++++++++++++++++++++++++---- > 1 file changed, 46 insertions(+), 4 deletions(-) > > diff --git a/drivers/crypto/s5p-sss.c b/drivers/crypto/s5p-sss.c > index 0064be0e3941..1ae570ad4391 100644 > --- a/drivers/crypto/s5p-sss.c > +++ b/drivers/crypto/s5p-sss.c > @@ -232,6 +232,7 @@ > * struct samsung_aes_variant - platform specific SSS driver data > * @aes_offset: AES register offset from SSS module's base. > * @hash_offset: HASH register offset from SSS module's base. > + * @clk_names: names of clocks needed to run SSS IP > * > * Specifies platform specific configuration of SSS module. > * Note: A structure for driver specific platform data is used for future > @@ -240,6 +241,7 @@ > struct samsung_aes_variant { > unsigned int aes_offset; > unsigned int hash_offset; > + char *clk_names[]; > }; > > struct s5p_aes_reqctx { > @@ -296,6 +298,7 @@ struct s5p_aes_ctx { > struct s5p_aes_dev { > struct device *dev; > struct clk *clk; > + struct clk *pclk; > void __iomem *ioaddr; > void __iomem *aes_ioaddr; > int irq_fc; > @@ -384,11 +387,19 @@ struct s5p_hash_ctx { > static const struct samsung_aes_variant s5p_aes_data = { > .aes_offset = 0x4000, > .hash_offset = 0x6000, > + .clk_names = { "secss", } Put trailing comma so it can be extended without touching previous line (just like old code). > }; > > static const struct samsung_aes_variant exynos_aes_data = { > .aes_offset = 0x200, > .hash_offset = 0x400, > + .clk_names = { "secss", } Ditto. > +}; > + > +static const struct samsung_aes_variant exynos5433_slim_aes_data = { > + .aes_offset = 0x400, > + .hash_offset = 0x800, > + .clk_names = { "pclk", "aclk", } Ditto. > }; > > static const struct of_device_id s5p_sss_dt_match[] = { > @@ -400,6 +411,10 @@ static const struct of_device_id s5p_sss_dt_match[] = { > .compatible = "samsung,exynos4210-secss", > .data = &exynos_aes_data, > }, > + { > + .compatible = "samsung,exynos5433-slim-sss", > + .data = &exynos5433_slim_aes_data, > + }, > { }, > }; > MODULE_DEVICE_TABLE(of, s5p_sss_dt_match); > @@ -2208,18 +2223,40 @@ static int s5p_aes_probe(struct platform_device *pdev) > return PTR_ERR(pdata->ioaddr); > } > > - pdata->clk = devm_clk_get(dev, "secss"); > + pdata->clk = devm_clk_get(dev, variant->clk_names[0]); > if (IS_ERR(pdata->clk)) { > - dev_err(dev, "failed to find secss clock source\n"); > + dev_err(dev, "failed to find secss clock %s\n", > + variant->clk_names[0]); > return -ENOENT; > } > > err = clk_prepare_enable(pdata->clk); > if (err < 0) { > - dev_err(dev, "Enabling SSS clk failed, err %d\n", err); > + dev_err(dev, "Enabling clock %s failed, err %d\n", > + variant->clk_names[0], err); > return err; > } > > + if (variant->clk_names[1]) { > + pdata->pclk = devm_clk_get(dev, variant->clk_names[1]); > + if (IS_ERR(pdata->pclk)) { > + dev_err(dev, "failed to find clock %s\n", > + variant->clk_names[1]); > + clk_disable_unprepare(pdata->clk); > + return -ENOENT; goto err_irq (eventually rename the label)? > + } Indentation looks wrong here. > + > + err = clk_prepare_enable(pdata->pclk); > + if (err < 0) { > + dev_err(dev, "Enabling clock %s failed, err %d\n", > + variant->clk_names[0], err); > + clk_disable_unprepare(pdata->clk); > + return err; goto... Best regards, Krzysztof