/[gxemul]/trunk/src/devices/dev_ohci.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/src/devices/dev_ohci.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 20 by dpavlin, Mon Oct 8 16:19:23 2007 UTC revision 34 by dpavlin, Mon Oct 8 16:21:17 2007 UTC
# Line 1  Line 1 
1  /*  /*
2   *  Copyright (C) 2004-2005  Anders Gavare.  All rights reserved.   *  Copyright (C) 2004-2007  Anders Gavare.  All rights reserved.
3   *   *
4   *  Redistribution and use in source and binary forms, with or without   *  Redistribution and use in source and binary forms, with or without
5   *  modification, are permitted provided that the following conditions are met:   *  modification, are permitted provided that the following conditions are met:
# Line 25  Line 25 
25   *  SUCH DAMAGE.   *  SUCH DAMAGE.
26   *     *  
27   *   *
28   *  $Id: dev_ohci.c,v 1.6 2005/11/13 00:14:09 debug Exp $   *  $Id: dev_ohci.c,v 1.10 2007/01/28 00:41:17 debug Exp $
29   *     *  
30   *  USB OHCI (Open Host Controller Interface).   *  USB OHCI (Open Host Controller Interface).
31   *   *
# Line 38  Line 38 
38    
39  #include "cpu.h"  #include "cpu.h"
40  #include "device.h"  #include "device.h"
41    #include "interrupt.h"
42  #include "machine.h"  #include "machine.h"
43  #include "memory.h"  #include "memory.h"
44  #include "misc.h"  #include "misc.h"
# Line 53  Line 54 
54    
55    
56  struct ohci_data {  struct ohci_data {
57          int     irq_nr;          struct interrupt        irq;
58    
59          int     port1reset;          int                     port1reset;
60  };  };
61    
62    
63  /*  /*
64   *  dev_ohci_access():   *  dev_ohci_access():
65   */   */
66  int dev_ohci_access(struct cpu *cpu, struct memory *mem,  DEVICE_ACCESS(ohci)
         uint64_t relative_addr, unsigned char *data, size_t len,  
         int writeflag, void *extra)  
67  {  {
68          struct ohci_data *d = extra;          struct ohci_data *d = extra;
69          uint64_t idata = 0, odata = 0;          uint64_t idata = 0, odata = 0;
# Line 84  int dev_ohci_access(struct cpu *cpu, str Line 83  int dev_ohci_access(struct cpu *cpu, str
83                  name = "COMMAND_STATUS";                  name = "COMMAND_STATUS";
84                  if (idata == 0x2) {                  if (idata == 0x2) {
85  fatal("URK\n");  fatal("URK\n");
86                          cpu_interrupt(cpu, d->irq_nr);                          INTERRUPT_ASSERT(d->irq);
87                  }                  }
88                  break;                  break;
89          case OHCI_INTERRUPT_STATUS:          case OHCI_INTERRUPT_STATUS:
# Line 151  fatal("URK\n"); Line 150  fatal("URK\n");
150  }  }
151    
152    
153  /*  DEVINIT(ohci)
  *  devinit_ohci():  
  */  
 int devinit_ohci(struct devinit *devinit)  
154  {  {
155          struct ohci_data *d;          struct ohci_data *d;
156    
# Line 164  int devinit_ohci(struct devinit *devinit Line 160  int devinit_ohci(struct devinit *devinit
160                  exit(1);                  exit(1);
161          }          }
162          memset(d, 0, sizeof(struct ohci_data));          memset(d, 0, sizeof(struct ohci_data));
163          d->irq_nr = devinit->irq_nr;  
164            INTERRUPT_CONNECT(devinit->interrupt_path, d->irq);
165    
166          memory_device_register(devinit->machine->memory,          memory_device_register(devinit->machine->memory,
167              devinit->name, devinit->addr,              devinit->name, devinit->addr,

Legend:
Removed from v.20  
changed lines
  Added in v.34

  ViewVC Help
Powered by ViewVC 1.1.26