From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from smtp.megiteam.pl ([31.186.83.105]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fwnep-00058H-Sg for barebox@lists.infradead.org; Mon, 03 Sep 2018 12:08:41 +0000 From: Marcin Niestroj Date: Mon, 3 Sep 2018 13:24:08 +0200 Message-Id: <20180903112408.2086-19-m.niestroj@grinn-global.com> In-Reply-To: <20180903112408.2086-1-m.niestroj@grinn-global.com> References: <20180903112408.2086-1-m.niestroj@grinn-global.com> MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 18/18] crypto: caam - allow retrieving 'era' from register To: barebox@lists.infradead.org Cc: Marcin Niestroj UGljayBjb21taXQgNjU0ZjJiOTM3YjM4OTI5NTU4MWJjYjRhYTI2MDExYTYzZGI3YmM4ZiBmcm9t IExpbnV4CnVwc3RyZWFtLgoKICAgIGNyeXB0bzogY2FhbSAtIGFsbG93IHJldHJpZXZpbmcgJ2Vy YScgZnJvbSByZWdpc3RlcgoKICAgIFRoZSAnZXJhJyBpbmZvcm1hdGlvbiBjYW4gYmUgcmV0cmll dmVkIGZyb20gQ0FBTSByZWdpc3RlcnMsIHNvCiAgICBpbnRyb2R1Y2UgYSBjYWFtX2dldF9lcmFf ZnJvbV9odygpIGZ1bmN0aW9uIHRoYXQgZ2V0cyBpdCB2aWEgcmVnaXN0ZXIKICAgIHJlYWRzIGlu IGNhc2UgdGhlICdmc2wsc2VjLWVyYScgcHJvcGVydHkgaXMgbm90IHBhc3NlZCBpbiB0aGUgZGV2 aWNlCiAgICB0cmVlLgoKICAgIFRoaXMgZnVuY3Rpb24gaXMgYmFzZWQgb24gdGhlIFUtQm9vdCBp bXBsZW1lbnRhdGlvbiBmcm9tCi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