From 2bc9b067028eac40780ab6b8138aea4ec23f9eb6 Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Fri, 19 Mar 2010 23:39:00 +0000 Subject: Reset USB bridge properly when selecting bus powered mode. The bridge might have been set to self powered by the cowon loader, and switching the mode requires a reset. Makes USB work on X5s which were set to 'hub mode' in the OF for some reason. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25252 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/coldfire/iaudio/usb-iaudio.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/firmware/target/coldfire/iaudio/usb-iaudio.c b/firmware/target/coldfire/iaudio/usb-iaudio.c index 036cd77828..f03942667d 100644 --- a/firmware/target/coldfire/iaudio/usb-iaudio.c +++ b/firmware/target/coldfire/iaudio/usb-iaudio.c @@ -26,9 +26,12 @@ void usb_init_device(void) { - or_l(0x00800010, &GPIO_OUT); /* RESET deasserted, VBUS powered */ + and_l(~0x00800000, &GPIO_OUT); /* RESET asserted */ + or_l(0x00000010, &GPIO_OUT); /* bus powered */ or_l(0x00800010, &GPIO_ENABLE); or_l(0x00800010, &GPIO_FUNCTION); + sleep(1); + or_l(0x00800000, &GPIO_OUT); /* RESET deasserted */ or_l(0x00800000, &GPIO1_FUNCTION); /* USB detect */ } -- cgit v1.2.3