summaryrefslogtreecommitdiff
path: root/firmware/target/coldfire
diff options
context:
space:
mode:
authorMarcin Bukat <marcin.bukat@gmail.com>2010-12-16 22:07:07 +0000
committerMarcin Bukat <marcin.bukat@gmail.com>2010-12-16 22:07:07 +0000
commit21955350b47ef2609eb2d58cc17144ea53bec7de (patch)
tree63cc2d2138554be01480b598c225e8a76e5b902b /firmware/target/coldfire
parent22d790bd1289aa0ecfca9b34260f9ec8808ab83b (diff)
HD300 - hacky workaround which makes USB bridge work in rockbox
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28845 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/coldfire')
-rw-r--r--firmware/target/coldfire/mpio/ata-mpio.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/firmware/target/coldfire/mpio/ata-mpio.c b/firmware/target/coldfire/mpio/ata-mpio.c
index f993dd9178..9ffa57a3f7 100644
--- a/firmware/target/coldfire/mpio/ata-mpio.c
+++ b/firmware/target/coldfire/mpio/ata-mpio.c
@@ -39,12 +39,38 @@ void ata_reset(void)
void ata_enable(bool on)
{
+ static bool init = true;
+
+ /* Ide power toggling is a nasty hack to allow USB bridge operation
+ * in rockbox. For some reason GL811E bridge doesn't like the state
+ * in which rockbox leaves drive (and vice versa). The only way
+ * I found out to recover is to do disk power cycle (I tried toggling
+ * reset line of the disk but it doesn't work).
+ */
+
/* GPO36 /reset line of GL811E */
if (on)
+ {
and_l(~(1<<4), &GPIO1_OUT);
+#ifndef BOOTLADER
+ if ( !init )
+ {
+ ide_power_enable(false);
+ sleep(1);
+ ide_power_enable(true);
+ }
+#endif
+ init = false;
+ }
else
+ {
+#ifndef BOOTLOADER
+ ide_power_enable(false);
+ sleep(1);
+ ide_power_enable(true);
+#endif
or_l((1<<4), &GPIO1_OUT);
-
+ }
or_l((1<<4), &GPIO1_ENABLE);
or_l((1<<4), &GPIO1_FUNCTION);
}