From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cRLJS-0004cf-2h for barebox@lists.infradead.org; Wed, 11 Jan 2017 15:59:48 +0000 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Wed, 11 Jan 2017 16:59:19 +0100 Message-Id: <20170111155920.13179-7-u.kleine-koenig@pengutronix.de> In-Reply-To: <20170111155920.13179-1-u.kleine-koenig@pengutronix.de> References: <20170111155920.13179-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 v1 6/7] net/phy: marvell: improve config_aneg for 88E1121R and 88E1318S To: barebox@lists.infradead.org VGhpcyBpcyB0YWtlbiBmcm9tIHRoZSBMaW51eCBkcml2ZXIKClNpZ25lZC1vZmYtYnk6IFV3ZSBL bGVpbmUtS8O2bmlnIDx1LmtsZWluZS1rb2VuaWdAcGVuZ3V0cm9uaXguZGU+Ci0tLQogZHJpdmVy cy9uZXQvcGh5L21hcnZlbGwuYyB8IDc4ICsrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysr KysrKysrKysrKysrKy0tCiAxIGZpbGUgY2hhbmdlZCwgNzYgaW5zZXJ0aW9ucygrKSwgMiBkZWxl dGlvbnMoLSkKCmRpZmYgLS1naXQgYS9kcml2ZXJzL25ldC9waHkvbWFydmVsbC5jIGIvZHJpdmVy cy9uZXQvcGh5L21hcnZlbGwuYwppbmRleCBkNTA0Y2Y4NWExZGEuLjZiYjUwYTNhMWY0YyAxMDA2 NDQKLS0tIGEvZHJpdmVycy9uZXQvcGh5L21hcnZlbGwuYworKysgYi9kcml2ZX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