From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.4.pengutronix.de ([92.198.50.35]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cWgss-00022D-4R for barebox@lists.infradead.org; Thu, 26 Jan 2017 10:02:28 +0000 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Thu, 26 Jan 2017 11:01:59 +0100 Message-Id: <20170126100159.6036-1-u.kleine-koenig@pengutronix.de> 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] ata: new driver to support the internal sata controller on Armada-XP To: barebox@lists.infradead.org U2lnbmVkLW9mZi1ieTogVXdlIEtsZWluZS1Lw7ZuaWcgPHUua2xlaW5lLWtvZW5pZ0BwZW5ndXRy b25peC5kZT4KLS0tCiBkcml2ZXJzL2F0YS9LY29uZmlnICAgfCAgIDUgKysKIGRyaXZlcnMvYXRh L01ha2VmaWxlICB8ICAgMSArCiBkcml2ZXJzL2F0YS9zYXRhX212LmMgfCAxMjYgKysrKysrKysr KysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysKIDMgZmlsZXMgY2hhbmdl ZCwgMTMyIGluc2VydGlvbnMoKykKIGNyZWF0ZSBtb2RlIDEwMDY0NCBkcml2ZXJzL2F0YS9zYXRh X212LmMKCmRpZmYgLS1naXQgYS9kcml2ZXJzL2F0YS9LY29uZmlnIGIvZHJpdmVycy9hdGEvS2Nv bmZpZwppbmRleCA3ODUwZTRhOWM5NjcuLjAyMzRjNjZjOGVjOCAxMDA2NDQKLS0tIGEvZHJpdmVy cy9hdGEvS2NvbmZpZworKysgYi9kcml2ZXJzL2F0YS9LY29uZmlnCkBAIC00Miw2ICs0MiwxMSBA QCBjb25maWcgRElTS19BSENJX0lN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