From 7d4fed53cc1e8b0e5aa250ebea3a1b53fc3a50b2 Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Mon, 5 Sep 2011 11:29:32 +0000 Subject: imx233:fuze+: major memory and usb rework - now identity map dram uncached and have a cached and buffered virtual alias - rework dma to handle virtual to physical pointers conversion - fix lcd frame pointer - implement usb detection properly - implement bootloader usb properly - allow the bootloader to disable MMC windowing (useful for recovery) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30432 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/imx233/usb-imx233.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'firmware/target/arm/imx233/usb-imx233.c') diff --git a/firmware/target/arm/imx233/usb-imx233.c b/firmware/target/arm/imx233/usb-imx233.c index e3b540fd1e..8e05da0a95 100644 --- a/firmware/target/arm/imx233/usb-imx233.c +++ b/firmware/target/arm/imx233/usb-imx233.c @@ -29,10 +29,20 @@ #include "system.h" #include "system-target.h" -int usb_status = USB_EXTRACTED; + +void usb_insert_int(void) +{ + usb_status_event(USB_POWERED); +} + +void usb_remove_int(void) +{ + usb_status_event(USB_UNPOWERED); +} void usb_drv_usb_detect_event() { + printf("usb_drv_usb_detect_event"); usb_status_event(USB_INSERTED); } @@ -58,16 +68,17 @@ void usb_init_device(void) int usb_detect(void) { - return usb_status; + return usb_plugged() ? USB_INSERTED : USB_EXTRACTED; } bool usb_plugged(void) { - return true; + return !!(HW_POWER_STS & HW_POWER_STS__VBUSVALID); } void usb_enable(bool on) { + /* FIXME: power up/down usb phy and pll usb */ if(on) usb_core_init(); else -- cgit v1.2.3