From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-la0-x236.google.com ([2a00:1450:4010:c03::236]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UFRXG-0003bf-Vr for barebox@lists.infradead.org; Tue, 12 Mar 2013 15:54:43 +0000 Received: by mail-la0-f54.google.com with SMTP id gw10so5429293lab.27 for ; Tue, 12 Mar 2013 08:54:40 -0700 (PDT) MIME-Version: 1.0 From: "Renaud C." Date: Tue, 12 Mar 2013 16:54:00 +0100 Message-ID: Content-Type: multipart/mixed; boundary=001a11c366b2a9ef8004d7bc4eb6 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 3/7] AT91 UDC startup fix To: barebox@lists.infradead.org --001a11c366b2a9ef8004d7bc4eb6 Content-Type: multipart/alternative; boundary=001a11c366b2a9ef7c04d7bc4eb4 --001a11c366b2a9ef7c04d7bc4eb4 Content-Type: text/plain; charset=ISO-8859-1 I noticed that depending on boot timings, the USB gadget weren't detected at all by hosts. After few hours of debugging and using the at91clk output, I found that the UDP clock wasn't enabled from time to time. This patch fix the startup of UDC by adding a check into the at91_update_vbus(). --001a11c366b2a9ef7c04d7bc4eb4 Content-Type: text/html; charset=ISO-8859-1
I noticed that depending on boot timings, the USB gadget weren't detected at all by hosts. After few hours of debugging and using the at91clk output, I found that the UDP clock wasn't enabled from time to time.

This patch fix the startup of UDC by adding a check into the at91_update_vbus().


--001a11c366b2a9ef7c04d7bc4eb4-- --001a11c366b2a9ef8004d7bc4eb6 Content-Type: application/octet-stream; name="at91udc-initial-vbus-detection.patch" Content-Disposition: attachment; filename="at91udc-initial-vbus-detection.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_he78hv7p0 RnJvbSAwY2Q3NDVkNDUxMTA5NTIyODkxMTk0Yjk1NDk4MjcxMGM2YmQ3MzZkIE1vbiBT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JvYmUoc3RydWN0IGRldmljZV9k ICpkZXYpCiAJCSAqIEdldCB0aGUgaW5pdGlhbCBzdGF0ZSBvZiBWQlVTIC0gd2UgY2Fubm90IGV4 cGVjdAogCQkgKiBhIHBlbmRpbmcgaW50ZXJydXB0LgogCQkgKi8KLQkJdWRjLT52YnVzID0gZ3Bp b19nZXRfdmFsdWUodWRjLT5ib2FyZC52YnVzX3Bpbik7CisJCXVkYy0+dmJ1cyA9IGdwaW9fZ2V0 X3ZhbHVlKHVkYy0+Ym9hcmQudmJ1c19waW4pIF4gdWRjLT5ib2FyZC52YnVzX2FjdGl2ZV9sb3c7 CiAJCURCRyh1ZGMsICJWQlVTIGRldGVjdGlvbjogaG9zdDolcyBcbiIsCiAJCQl1ZGMtPnZidXMg PyAicHJlc2VudCI6ImFic2VudCIpOwogCX0gZWxzZSB7CkBAIC0xNTE3LDcgKzE1MjMsNyBAQCBz dGF0aWMgaW50IF9faW5pdCBhdDkxdWRjX3Byb2JlKHN0cnVjdCBkZXZpY2VfZCAqZGV2KQogCX0K IAogCWRldl9hZGRfcGFyYW0oZGV2LCAidmJ1cyIsIE5VTEwsIE5VTEwsIDApOwotCWRldl9zZXRf cGFyYW0oZGV2LCAidmJ1cyIsICIwIik7CisJZGV2X3NldF9wYXJhbShkZXYsICJ2YnVzIiwgdWRj LT52YnVzID8gIjEiIDogIjAiKTsKIAogCXBvbGxlcl9yZWdpc3RlcigmcG9sbGVyKTsKIAotLSAK MS43LjIuNQoK --001a11c366b2a9ef8004d7bc4eb6 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox --001a11c366b2a9ef8004d7bc4eb6--