/* EHCI glue. A bit hacky for the moment. needs cleaning.. Copyright (C) 2008 kwiirk. 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 program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "tiny_ehci_glue.h" #define static #define inline extern int verbose=0; void BUG(void) { dbgprintf("bug\n"); while(1); } #define BUG_ON(a) if(a)BUG() void msleep(int msec) { udelay(msec*1000); } extern u32 __exe_start_virt__; extern u32 __ram_start_virt__; extern u32 ios_thread_stack; void print_hex_dump_bytes(char *header,int prefix,u8 *buf,int len) { int i; if (len>0x100)len=0x100; dbgprintf("%s %08X\n",header,(u32)buf); for (i=0;icaps = (void*)0x0D040000; ehci->regs = (void*)(0x0D040000 + HC_LENGTH(ehci_readl(&ehci->caps->hc_capbase))); ehci->num_port = 4; /* cache this readonly data; minimize chip reads */ ehci->hcs_params = ehci_readl( &ehci->caps->hcs_params ); /* data structure init */ retval = ehci_init(); if (retval) return retval; ehci_release_ports(); //quickly release none usb2 port return 0; }