Index: apps/debug_menu.c
===================================================================
--- apps/debug_menu.c (revision 21521)
+++ apps/debug_menu.c (working copy)
@@ -119,6 +119,8 @@
#endif
#endif

+#include "ohci.h"
+
/*---------------------------------------------------*/
/* SPECIAL DEBUG STUFF */
/*---------------------------------------------------*/
@@ -1037,6 +1039,72 @@

#endif /* key definitions */

+bool dbg_ohci(void)
+{
+ char buf[32];
+
+ lcd_setfont(FONT_SYSFIXED);
+ lcd_clear_display();
+
+ while(1)
+ {
+ int line=0;
+ snprintf(buf,32,"REVISION : %8.8x",OHCI_REVISION);
+ lcd_puts(0, line++, buf);
+ /*
+ snprintf(buf,32,"CONTROL : %8.8x",OHCI_CONTROL);
+ lcd_puts(0, line++, buf);
+ snprintf(buf,32,"COMMAND_STATUS : %8.8x",OHCI_COMMAND_STATUS);
+ lcd_puts(0, line++, buf);
+ snprintf(buf,32,"INTERRUPT_STATUS : %8.8x",OHCI_INTERRUPT_STATUS);
+ lcd_puts(0, line++, buf);
+ snprintf(buf,32,"INTERRUPT_ENABLE : %8.8x",OHCI_INTERRUPT_ENABLE);
+ lcd_puts(0, line++, buf);
+ snprintf(buf,32,"INTERRUPT_DISABLE : %8.8x",OHCI_INTERRUPT_DISABLE);
+ lcd_puts(0, line++, buf);
+ snprintf(buf,32,"HCCA : %8.8x",OHCI_HCCA);
+ lcd_puts(0, line++, buf);
+ snprintf(buf,32,"PERIOD_CURRENT_ED : %8.8x",OHCI_PERIOD_CURRENT_ED);
+ lcd_puts(0, line++, buf);
+ snprintf(buf,32,"CONTROL_HEAD_ED : %8.8x",OHCI_CONTROL_HEAD_ED);
+ lcd_puts(0, line++, buf);
+ snprintf(buf,32,"CONTROL_CURRENT_ED : %8.8x",OHCI_CONTROL_CURRENT_ED);
+ lcd_puts(0, line++, buf);
+ snprintf(buf,32,"BULK_HEAD_ED : %8.8x",OHCI_BULK_HEAD_ED);
+ lcd_puts(0, line++, buf);
+ snprintf(buf,32,"BULK_CURRENT_ED : %8.8x",OHCI_BULK_CURRENT_ED);
+ lcd_puts(0, line++, buf);
+ snprintf(buf,32,"DONE_HEAD : %8.8x",OHCI_DONE_HEAD);
+ lcd_puts(0, line++, buf);
+ snprintf(buf,32,"FM_INTERVAL : %8.8x",OHCI_FM_INTERVAL);
+ lcd_puts(0, line++, buf);
+ snprintf(buf,32,"FM_REMAINING : %8.8x",OHCI_FM_REMAINING);
+ lcd_puts(0, line++, buf);
+ snprintf(buf,32,"FM_NUMBER : %8.8x",OHCI_FM_NUMBER);
+ lcd_puts(0, line++, buf);
+ snprintf(buf,32,"PERIODIC_START : %8.8x",OHCI_PERIODIC_START);
+ lcd_puts(0, line++, buf);
+ snprintf(buf,32,"LS_THRESHOLD : %8.8x",OHCI_LS_THRESHOLD);
+ lcd_puts(0, line++, buf);
+ snprintf(buf,32,"RH_DESCRIPTOR_A : %8.8x",OHCI_RH_DESCRIPTOR_A);
+ lcd_puts(0, line++, buf);
+ snprintf(buf,32,"RH_DESCRIPTOR_B : %8.8x",OHCI_RH_DESCRIPTOR_B);
+ lcd_puts(0, line++, buf);
+ snprintf(buf,32,"RH_STATUS : %8.8x",OHCI_RH_STATUS);
+ lcd_puts(0, line++, buf);
+ snprintf(buf,32,"RH_PORT_STATUS_1 : %8.8x",OHCI_RH_PORT_STATUS_1);
+ lcd_puts(0, line++, buf);
+ snprintf(buf,32,"RH_PORT_STATUS_2 : %8.8x",OHCI_RH_PORT_STATUS_2);
+ lcd_puts(0, line++, buf);
+ */
+ lcd_update();
+ if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL))
+ {
+ lcd_setfont(FONT_UI);
+ return false;
+ }
+ }
+}
/* Test code!!! */
bool dbg_ports(void)
{
@@ -2720,6 +2788,7 @@
|| CONFIG_CPU == DM320
{ "View I/O ports", dbg_ports },
#endif
+ { "View OHCI state", dbg_ohci},
#if (CONFIG_RTC == RTC_PCF50605) && !defined(SIMULATOR)
{ "View PCF registers", dbg_pcf },
#endif
Index: firmware/export/ohci.h
===================================================================
--- firmware/export/ohci.h (revision 0)
+++ firmware/export/ohci.h (revision 0)
@@ -0,0 +1,49 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id: $
+ *
+ * OHCI data structures and registers
+ *
+ * Copyright (C) 2009 by Frank Gevaerts
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
+
+#define OHCI_BASE 0x49000000
+
+#define OHCI_REVISION (*(volatile unsigned int *)(OHCI_BASE+0x00))
+#define OHCI_CONTROL (*(volatile unsigned int *)(OHCI_BASE+0x04))
+#define OHCI_COMMAND_STATUS (*(volatile unsigned int *)(OHCI_BASE+0x08))
+#define OHCI_INTERRUPT_STATUS (*(volatile unsigned int *)(OHCI_BASE+0x0C))
+#define OHCI_INTERRUPT_ENABLE (*(volatile unsigned int *)(OHCI_BASE+0x10))
+#define OHCI_INTERRUPT_DISABLE (*(volatile unsigned int *)(OHCI_BASE+0x14))
+#define OHCI_HCCA (*(volatile unsigned int *)(OHCI_BASE+0x18))
+#define OHCI_PERIOD_CURRENT_ED (*(volatile unsigned int *)(OHCI_BASE+0x1C))
+#define OHCI_CONTROL_HEAD_ED (*(volatile unsigned int *)(OHCI_BASE+0x20))
+#define OHCI_CONTROL_CURRENT_ED (*(volatile unsigned int *)(OHCI_BASE+0x24))
+#define OHCI_BULK_HEAD_ED (*(volatile unsigned int *)(OHCI_BASE+0x28))
+#define OHCI_BULK_CURRENT_ED (*(volatile unsigned int *)(OHCI_BASE+0x2C))
+#define OHCI_DONE_HEAD (*(volatile unsigned int *)(OHCI_BASE+0x30))
+#define OHCI_FM_INTERVAL (*(volatile unsigned int *)(OHCI_BASE+0x34))
+#define OHCI_FM_REMAINING (*(volatile unsigned int *)(OHCI_BASE+0x38))
+#define OHCI_FM_NUMBER (*(volatile unsigned int *)(OHCI_BASE+0x3C))
+#define OHCI_PERIODIC_START (*(volatile unsigned int *)(OHCI_BASE+0x40))
+#define OHCI_LS_THRESHOLD (*(volatile unsigned int *)(OHCI_BASE+0x44))
+#define OHCI_RH_DESCRIPTOR_A (*(volatile unsigned int *)(OHCI_BASE+0x48))
+#define OHCI_RH_DESCRIPTOR_B (*(volatile unsigned int *)(OHCI_BASE+0x4C))
+#define OHCI_RH_STATUS (*(volatile unsigned int *)(OHCI_BASE+0x50))
+#define OHCI_RH_PORT_STATUS_1 (*(volatile unsigned int *)(OHCI_BASE+0x54))
+#define OHCI_RH_PORT_STATUS_2 (*(volatile unsigned int *)(OHCI_BASE+0x54))
+
Index: firmware/target/arm/s3c2440/gigabeat-fx/system-meg-fx.c
===================================================================
--- firmware/target/arm/s3c2440/gigabeat-fx/system-meg-fx.c (revision 21521)
+++ firmware/target/arm/s3c2440/gigabeat-fx/system-meg-fx.c (working copy)
@@ -206,6 +206,7 @@
* IDLE, Sleep, LCDC, PWM timer, GPIO, RTC, and ADC are untouched (on)
*/
CLKCON &= ~0xFF1ED0;
+ CLKCON |= 0x000040;

CLKSLOW |= 0x80;
}