From patchwork Thu May 10 08:14:08 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Westin X-Patchwork-Id: 8515 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id A71D223E49 for ; Thu, 10 May 2012 08:14:45 +0000 (UTC) Received: from mail-gg0-f180.google.com (mail-gg0-f180.google.com [209.85.161.180]) by fiordland.canonical.com (Postfix) with ESMTP id 766EBA1825A for ; Thu, 10 May 2012 08:14:45 +0000 (UTC) Received: by mail-gg0-f180.google.com with SMTP id f1so333498ggn.11 for ; Thu, 10 May 2012 01:14:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :mime-version:content-type:x-gm-message-state; bh=YZ61tDknn6bQV9zzFZS64pMKH3xEjAXIZRtmV0WMTW8=; b=Kpm+SwiteorV+ij1CxB0LyGroSypaomQ7pWRDaV5P39CxhcFx1Uj1+SKxzLpXkPC4Z R8npuf7kRy5d+tpL1u8Cf3hb9Ab0y9pZJ705EvIBUuEc9KRxrHTasDnfIz8TmMeUzc2r ZMiwuZYDH6ckR2J2342mrqf5JcHu7Pj6slJMcrgyYXbZyLmMjWcbNzHU5UvJbtV3xA7I +6cZ5ej6/ImLAvG651OvGQ9VxSzQE2tlV8fPaaFezzMrYC8NiTZ5/9zd277cDfEtELl4 lBZKhJlp1gQMAAacfRyuIObNsnllVA3/XS1GP466JsGcE0WUi5JPUpIVi8W2W9+WXM+Y vrFg== Received: by 10.50.57.129 with SMTP id i1mr1742682igq.33.1336637685102; Thu, 10 May 2012 01:14:45 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.73.147 with SMTP id q19csp75761ibj; Thu, 10 May 2012 01:14:44 -0700 (PDT) Received: by 10.14.39.133 with SMTP id d5mr652195eeb.27.1336637683850; Thu, 10 May 2012 01:14:43 -0700 (PDT) Received: from eu1sys200aog101.obsmtp.com (eu1sys200aog101.obsmtp.com. [207.126.144.111]) by mx.google.com with SMTP id d3si1542445eec.13.2012.05.10.01.14.39 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 10 May 2012 01:14:43 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.111 is neither permitted nor denied by best guess record for domain of andreas.westin@stericsson.com) client-ip=207.126.144.111; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.111 is neither permitted nor denied by best guess record for domain of andreas.westin@stericsson.com) smtp.mail=andreas.westin@stericsson.com Received: from beta.dmz-us.st.com ([167.4.1.35]) (using TLSv1) by eu1sys200aob101.postini.com ([207.126.147.11]) with SMTP ID DSNKT6t45tn73ED2KwWHSJFX8hO/BEKjpKxI@postini.com; Thu, 10 May 2012 08:14:43 UTC Received: from zeta.dmz-us.st.com (ns4.st.com [167.4.16.71]) by beta.dmz-us.st.com (STMicroelectronics) with ESMTP id 2886C58; Thu, 10 May 2012 08:13:59 +0000 (GMT) Received: from relay2.stm.gmessaging.net (unknown [10.230.100.18]) by zeta.dmz-us.st.com (STMicroelectronics) with ESMTP id 6C04365; Thu, 10 May 2012 05:51:47 +0000 (GMT) Received: from exdcvycastm004.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm004", Issuer "exdcvycastm004" (not verified)) by relay2.stm.gmessaging.net (Postfix) with ESMTPS id 3207AA807B; Thu, 10 May 2012 10:14:12 +0200 (CEST) Received: from steludxu4049.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.2) with Microsoft SMTP Server (TLS) id 8.3.83.0; Thu, 10 May 2012 10:14:15 +0200 From: Andreas Westin To: Herbert Xu , "David S. Miller" Cc: , , , , , Andreas Westin Subject: [PATCH v2 3/3] crypto: ux500: Cleanup hardware identification Date: Thu, 10 May 2012 10:14:08 +0200 Message-ID: <1336637648-10064-4-git-send-email-andreas.westin@stericsson.com> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1336637648-10064-1-git-send-email-andreas.westin@stericsson.com> References: <1336637648-10064-1-git-send-email-andreas.westin@stericsson.com> MIME-Version: 1.0 X-Gm-Message-State: ALoCoQmq4RlHb7YjlfcQFgyIlhdjKBP4YJsshG3/ZkxBa0oKNM9e/N89N2GbHJcr4OB3aMJD7shc Don't use SOC specific functions to identify which crypto hardware we are talking to and use the ID provided in the module instead. Acked-by: Linus Walleij Signed-off-by: Andreas Westin --- drivers/crypto/ux500/cryp/cryp.c | 10 ++++------ drivers/crypto/ux500/cryp/cryp_p.h | 1 - drivers/crypto/ux500/hash/hash_core.c | 10 ---------- 3 files changed, 4 insertions(+), 17 deletions(-) diff --git a/drivers/crypto/ux500/cryp/cryp.c b/drivers/crypto/ux500/cryp/cryp.c index bd206ff..e208cea 100644 --- a/drivers/crypto/ux500/cryp/cryp.c +++ b/drivers/crypto/ux500/cryp/cryp.c @@ -37,18 +37,16 @@ int cryp_check(struct cryp_device_data *device_data) if (NULL == device_data) return -EINVAL; - if (cpu_is_u8500()) - peripheralid2 = CRYP_PERIPHERAL_ID2_DB8500; - else if (cpu_is_u5500()) - peripheralid2 = CRYP_PERIPHERAL_ID2_DB5500; + peripheralid2 = readl_relaxed(&device_data->base->periphId2); + + if (peripheralid2 != CRYP_PERIPHERAL_ID2_DB8500) + return -EPERM; /* Check Peripheral and Pcell Id Register for CRYP */ if ((CRYP_PERIPHERAL_ID0 == readl_relaxed(&device_data->base->periphId0)) && (CRYP_PERIPHERAL_ID1 == readl_relaxed(&device_data->base->periphId1)) - && (peripheralid2 == - readl_relaxed(&device_data->base->periphId2)) && (CRYP_PERIPHERAL_ID3 == readl_relaxed(&device_data->base->periphId3)) && (CRYP_PCELL_ID0 == diff --git a/drivers/crypto/ux500/cryp/cryp_p.h b/drivers/crypto/ux500/cryp/cryp_p.h index 0e07082..6dcffe1 100644 --- a/drivers/crypto/ux500/cryp/cryp_p.h +++ b/drivers/crypto/ux500/cryp/cryp_p.h @@ -41,7 +41,6 @@ #define CRYP_PERIPHERAL_ID1 0x05 #define CRYP_PERIPHERAL_ID2_DB8500 0x28 -#define CRYP_PERIPHERAL_ID2_DB5500 0x29 #define CRYP_PERIPHERAL_ID3 0x00 #define CRYP_PCELL_ID0 0x0D diff --git a/drivers/crypto/ux500/hash/hash_core.c b/drivers/crypto/ux500/hash/hash_core.c index 77f7508..6dbb9ec 100644 --- a/drivers/crypto/ux500/hash/hash_core.c +++ b/drivers/crypto/ux500/hash/hash_core.c @@ -574,15 +574,6 @@ static int hash_init(struct ahash_request *req) memset(&req_ctx->state, 0, sizeof(struct hash_state)); req_ctx->updated = 0; if (hash_mode == HASH_MODE_DMA) { - if ((ctx->config.oper_mode == HASH_OPER_MODE_HMAC) && - cpu_is_u5500()) { - pr_debug(DEV_DBG_NAME " [%s] HMAC and DMA not working " - "on u5500, directing to CPU mode.", - __func__); - req_ctx->dma_mode = false; /* Don't use DMA */ - goto out; - } - if (req->nbytes < HASH_DMA_ALIGN_SIZE) { req_ctx->dma_mode = false; /* Don't use DMA */ @@ -604,7 +595,6 @@ static int hash_init(struct ahash_request *req) } } } -out: return 0; }