71#define OHCI_WRITECSR(softc,x,y) \
72 *((volatile uint32_t *) ((softc)->ohci_regs + ((x)/sizeof(uint32_t)))) = (y)
73#define OHCI_READCSR(softc,x) \
74 *((volatile uint32_t *) ((softc)->ohci_regs + ((x)/sizeof(uint32_t))))
138#define PLAY_AREA_ADDR (255*1024*1024)
139#define PLAY_AREA_SIZE (1024*1024)
143#define DEVICE_AREA_ADDR 0xd9100000
144#define DEVICE_AREA_SIZE 4096
175 if (v == 0)
return 0;
199 if (p == 0)
return 0;
224 ts.tv_nsec = x * 1000000;
246 va_start(marker,tmplt);
247 vsprintf(buffer,tmplt,marker);
249 printf(
"%s\n",buffer);
286 PROT_READ|PROT_WRITE,MAP_SHARED,
294 if (
play_area[idx] != 0x55) printf(
"Offset %x doesn't work\n",idx);
296 if (
play_area[idx] != 0xaa) printf(
"Offset %x doesn't work\n",idx);
298 if (
play_area[idx] != 0x0) printf(
"Offset %x doesn't work\n",idx);
312 PROT_READ|PROT_WRITE,MAP_SHARED,
317 printf(
"Device area mapped ok at address %p\n",
device_area);
381 signal(SIGINT,SIG_DFL);
382 printf(
"Interrupted, controller reset\n");
433 for (res = 1; res < argc; res++) {
434 if (strcmp(argv[res],
"-o") == 0)
ohcidebug++;
435 if (strcmp(argv[res],
"-u") == 0)
usb_noisy++;
443 printf(
"Could not map USB controller\n");
464 printf(
"-------------------------------------------\n\n");
486 printf(
"Could not init hardware\n");
506 for (res = 0; res < 1000; res++) {
510 printf(
"----- finished reading all sectors ----\n");
523 if (res < 0) printf(
"Warning: heap is not consistent\n");
524 else printf(
"Heap is ok\n");
#define console_log(fmt, x...)
#define KMEMINIT(buffer, length)
#define KMALLOC(size, align)
int open(const char *file, int flags, int mode)
#define V_OHCI_CONTROL_HCFS(x)
#define K_OHCI_HCFS_RESET
volatile uint32_t * ohci_regs
void usb_daemon(usbbus_t *bus)
void usb_poll(usbbus_t *bus)
void usb_initroot(usbbus_t *bus)
#define UBCREATE(driver, addr)
int main(int argc, char *argv[])
int usbmass_read_sector(usbdev_t *dev, uint32_t sectornum, uint32_t seccnt, uint8_t *buffer)
void uninit_devaccess(void)
#define OHCI_WRITECSR(softc, x, y)