From: Nicolas Royer Subject: [PATCH 4/4 v2] crypto: Atmel SHA driver: add support for latest release of the IP (0x410) Date: Wed, 20 Feb 2013 17:10:26 +0100 Message-ID: <1361376626-28987-4-git-send-email-nicolas@eukrea.com> References: <1361376626-28987-1-git-send-email-nicolas@eukrea.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Cc: herbert@gondor.apana.org.au, nicolas.ferre@atmel.com, linux-crypto@vger.kernel.org, eric@eukrea.com, plagnioj@jcrosoft.com, davem@davemloft.net, linux-arm-kernel@lists.infradead.org, Nicolas Royer To: linux-kernel@vger.kernel.org Return-path: In-Reply-To: <1361376626-28987-1-git-send-email-nicolas@eukrea.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org List-Id: linux-crypto.vger.kernel.org VXBkYXRlcyBmcm9tIElQIHJlbGVhc2UgMHgzMjAgdG8gMHg0MDA6CiAtIGFkZCBETUEgc3VwcG9y dCAocHJldmlvdXMgSVAgcmV2aXNpb24gdXNlIFBEQykKIC0gYWRkIERNQSBkb3VibGUgaW5wdXQg YnVmZmVyIHN1cHBvcnQKIC0gYWRkIFNIQTIyNCBzdXBwb3J0CgpVcGRhdGUgZnJvbSBJUCByZWxl YXNlIDB4NDAwIHRvIDB4NDEwOgogLSBhZGQgU0hBMzg0IGFuZCBTSEE1MTIgc3VwcG9ydAoKU2ln bmVkLW9mZi1ieTogTmljb2xhcyBSb3llciA8bmljb2xhc0BldWtyZWEuY29tPgpBY2tlZC1ieTog Tmljb2xhcyBGZXJyZSA8bmljb2xhcy5mZXJyZUBhdG1lbC5jb20+CkFja2VkLWJ5OiBFcmljIELD qW5hcmQgPGVyaWNAZXVrcmVhLmNvbT4KVGVzdGVkLWJ5OiBFcmljIELDqW5hcmQgPGVyaWNAZXVr cmVhLmNvbT4KLS0tCnYy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