From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-wi0-x22d.google.com ([2a00:1450:400c:c05::22d]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XB3qT-0000bb-FK for barebox@lists.infradead.org; Sat, 26 Jul 2014 15:25:21 +0000 Received: by mail-wi0-f173.google.com with SMTP id f8so2383162wiw.12 for ; Sat, 26 Jul 2014 08:24:54 -0700 (PDT) From: Sebastian Hesselbarth Date: Sat, 26 Jul 2014 17:24:44 +0200 Message-Id: <1406388285-1666-7-git-send-email-sebastian.hesselbarth@gmail.com> In-Reply-To: <1406388285-1666-1-git-send-email-sebastian.hesselbarth@gmail.com> References: <1406388285-1666-1-git-send-email-sebastian.hesselbarth@gmail.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 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 v2 6/7] USB: host: add xHCI HCD, Hub, and platform driver To: Sebastian Hesselbarth , Sascha Hauer Cc: Thomas Petazzoni , barebox@lists.infradead.org VGhpcyBhZGRzIHN1cHBvcnQgZm9yIHhIQ0kgVVNCIDMuMCBob3N0IGNvbnRyb2xsZXJzIGZvdW5k IG9uIHZhcmlvdXMKU29DcyBhbmQgUENJIGRldmljZXMuIEN1cnJlbnRseSwgdGhlIGRyaXZlciBv bmx5IHN1cHBvcnRzIHRoZSB2aXJ0dWFsClVTQiAyLjAgcG9ydHMgb2YgdGhlIGhvc3QgY29udHJv bGxlciwgc28gaWYgeW91IHBsYW4gdG8gdXNlIFVTQiAzLjAKZGV2aWNlcywgcHV0IGEgVVNCIDIu MCBjYWJsZSBpbiBiZXR3ZWVuLgoKU2lnbmVkLW9mZi1ieTogU2ViYXN0aWFuIEhlc3NlbGJhcnRo IDxzZWJhc3RpYW4uaGVzc2VsYmFydGhAZ21haWwu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Ki8KKy8vI2RlZmluZSBERUJVRworI2luY2x1ZGUgPGFzbS9tbXUuaD4KKyNp bmNsdWRlIDxjbG9jay5oPgorI2luY2x1ZGUgPGNvbW1vbi5oPgorI2luY2x1ZGUgPGluaXQuaD4K KyNpbmNsdWRlIDxpby5oPgorI2luY2x1ZGUgPGxpbnV4L2Vyci5oPgorI2luY2x1ZGUgPHVzYi91 c2IuaD4KKyNpbmNsdWRlIDx1c2IveGhjaS5oPgorCisjaW5jbHVkZSAieGhjaS5oIgorCisvKgor ICogeEhDSSByaW5nIGhhbmRsaW5nCisgKi8KKworc3RhdGljIGludCB4aGNpX3JpbmdfaXNfbGFz dF90cmIoc3RydWN0IHhoY2lfcmluZyAqcmluZywgdW5pb24geGhjaV90cmIgKnRyYikKK3sKKyAg ICAgICAgaWYgKHJpbmctPnR5cGUgPT0gVFlQRV9FVkVOVCkKKyAgICAgICAgICAgICAgICByZXR1 cm4gdHJiID09ICZyaW5nLT50cmJzW05VTV9FVkVOVF9UUkJTXTsKKyAgICAgICAgZWxzZQorICAg ICAgICAgICAgICAgIHJldHVybiBUUkJfVFlQRV9MSU5LKGxlMzJfdG9fY3B1KHRyYi0+bGluay5j b250cm9sKSk7Cit9CisKK3N0YXRpYyBpbnQgeGhjaV9yaW5nX2luY3JlbWVudChzdHJ1Y3QgeGhj aV9yaW5nICpyaW5nLCBib29sIGVucXVldWUpCit7CisJdW5pb24geGhjaV90cmIgKipxdWV1ZSA9 IChlbnF1ZXVlKSA/ICZyaW5nLT5lbnF1ZXVlIDogJnJpbmctPmRlcXVldWU7CisKKwkoKnF1ZXVl KSsrOworCisgICAgICAgIGlmICgheGhjaV9yaW5nX2lzX2xhc3RfdHJiKHJpbmcsICpxdWV1ZSkp CisJCXJldHVybiAwOworCisJaWYgKHJpbmctPnR5cGUgPT0gVFlQRV9FVkVOVCkgeworCQkqcXVl dWUgPSAmcmluZy0+dHJic1swXTsKKwkJcmluZy0+Y3ljbGVfc3RhdGUgXj0gMTsKKwl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ik7CisJ eGhjaV9wcmludF90cmIoeGhjaSwgJnRyYiwgIlJlc3BvbnNlIFJlc2V0Iik7CisKKyAgICAgICAg LyoKKwkgKiBUaGUgUmVzZXQgRGV2aWNlIGNvbW1hbmQgY2FuJ3QgZmFpbCwgYWNjb3JkaW5nIHRv IHRoZSAwLjk1LzAuOTYgc3BlYywKKyAgICAgICAgICogdW5sZXNzIHdlIHRyaWVkIHRvIHJlc2V0 IGEgc2xvdCBJRCB0aGF0IHdhc24ndCBlbmFibGVkLAorICAgICAgICAgKiBvciB0aGUgZGV2aWNl IHdhc24ndCBpbiB0aGUgYWRkcmVzc2VkIG9yIGNvbmZpZ3VyZWQgc3RhdGUuCisgICAgICAgICAq LworICAgICAgICBzd2l0Y2ggKEdFVF9DT01QX0NPREUodHJiLmV2ZW50X2NtZC5zdGF0dXMpKSB7 CisgICAgICAgIGNhc2UgQ09NUF9DTURfQUJPUlQ6CisgICAgICAgIGNhc2UgQ09NUF9DTURfU1RP UDoKKyAgICAgICAgICAgICAgICBkZXZfd2Fybih4aGNpLT5kZXYsICJUaW1lb3V0IHdhaXRpbmcg Zm9yIHJlc2V0IGRldmljZSBjb21tYW5kXG4iKTsKKyAgICAgICAgICAgICAgICByZXQgPSAtRVRJ TUVET1VUOworCQlicmVhazsKKyAgICAgICAgY2FzZSBDT01QX0VCQURTTFQ6IC8qIDAuOTUgY29t cGxldGlvbiBjb2RlIGZvciBiYWQgc2xvdCBJRCAqLworICAgICAgICBjYXNlIENPTVBfQ1RYX1NU QVRFOiAvKiAwLjk2IGNvbXBsZXRpb24gY29kZSBmb3Igc2FtZSB0aGluZyAqLworICAgICAgICAg ICAgICAgIC8qIERvbid0IHRyZWF0IHRoaXMgYXMgYW4gZXJyb3IuICBNYXkgY2hhbmdlIG15IG1p bmQgbGF0ZXIuICovCisgICAgICAgICAgICAgICAgcmV0ID0gMDsKKyAgICAgICAgY2FzZSBDT01Q X1NVQ0NFU1M6CisgICAgICAgICAgICAgICAgYnJlYWs7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VQoMjEpCisv KiBwb3J0IGxpbmsgc3RhdHVzIGNoYW5nZSAtIHNldCBvbiBzb21lIHBvcnQgbGluayBzdGF0ZSB0 cmFuc2l0aW9uczoKKyAqICBUcmFuc2l0aW9uICAgICAgICAgICAgICAgICAgICAgICAgICBSZWFz b24KKyAqICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAqICAtIFUzIHRvIFJlc3VtZSAgICAgICAg ICAgICAgICAgICAgICBXYWtldXAgc2lnbmFsaW5nIGZyb20gYSBkZXZpY2UKKyAqICAtIFJlc3Vt ZSB0byBSZWNvdmVyeSB0byBVMCAgICAgICAgICBVU0IgMy4wIGRldmljZSByZXN1bWUKKyAqICAt IFJlc3VtZSB0byBVMCAgICAgICAgICAgICAgICAgICAgICBVU0IgMi4wIGRldmljZSByZXN1bWUK KyAqICAtIFUzIHRvIFJlY292ZXJ5IHRvIFUwICAgICAgICAgICAgICBTb2Z0d2FyZSByZXN1bWUg b2YgVVNCIDMuMCBkZXZpY2UgY29tcGxldGUKKyAqICAtIFUzIHRvIFUwICAgICAgICAgICAgICAg ICAgICAgICAgICBTb2Z0d2FyZSByZXN1bWUgb2YgVVNCIDIuMCBkZXZpY2UgY29tcGxldGUKKyAq ICAtIFUyIHRvIFUwICAgICAgICAgICAgICAgICAgICAgICAgICBMMSByZXN1bWUgb2YgVVNCIDIu MSBkZXZpY2UgY29tcGxldGUKKyAqICAtIFUwIHRvIFUwICg/Pz8pICAgICAgICAgICAgICAgICAg ICBMMSBlbnRyeSByZWplY3Rpb24gYnkgVVNCIDIuMSBkZXZpY2UKKyAqICAtIFUwIHRvIGRpc2Fi bGVkICAgICAgICAgICAgICAgICAgICBMMSBlbnRyeSBlcnJvciB3aXRoIFVTQiAyLjEgZGV2aWNl CisgKiAgLSBBbnkgc3RhdGUgdG8gaW5hY3RpdmUgICA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