/[gxemul]/trunk/src/devices/dev_turbochannel.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_turbochannel.c

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

revision 10 by dpavlin, Mon Oct 8 16:18:27 2007 UTC revision 22 by dpavlin, Mon Oct 8 16:19:37 2007 UTC
# Line 1  Line 1 
1  /*  /*
2   *  Copyright (C) 2003-2005  Anders Gavare.  All rights reserved.   *  Copyright (C) 2003-2006  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_turbochannel.c,v 1.42 2005/06/26 11:43:48 debug Exp $   *  $Id: dev_turbochannel.c,v 1.46 2006/01/01 13:17:17 debug Exp $
29   *     *  
30   *  Generic framework for TURBOchannel devices, used in DECstation machines.   *  Generic framework for TURBOchannel devices, used in DECstation machines.
31   */   */
# Line 66  struct turbochannel_data { Line 66  struct turbochannel_data {
66  /*  /*
67   *  dev_turbochannel_access():   *  dev_turbochannel_access():
68   */   */
69  int dev_turbochannel_access(struct cpu *cpu, struct memory *mem,  DEVICE_ACCESS(turbochannel)
         uint64_t relative_addr, unsigned char *data, size_t len,  
         int writeflag, void *extra)  
70  {  {
71          struct turbochannel_data *d = extra;          struct turbochannel_data *d = extra;
72          uint64_t idata = 0, odata = 0;          uint64_t idata = 0, odata = 0;
73    
74          idata = memory_readmax64(cpu, data, len);          if (writeflag == MEM_WRITE)
75                    idata = memory_readmax64(cpu, data, len);
76    
77          relative_addr += d->rom_skip;          relative_addr += d->rom_skip;
78    
# Line 249  void dev_turbochannel_init(struct machin Line 248  void dev_turbochannel_init(struct machin
248          } else if (strcmp(device_name, "PMAG-AA")==0) {          } else if (strcmp(device_name, "PMAG-AA")==0) {
249                  /*  mfb in NetBSD  */                  /*  mfb in NetBSD  */
250                  fb = dev_fb_init(machine, mem, baseaddr + VFB_MFB_VRAM,                  fb = dev_fb_init(machine, mem, baseaddr + VFB_MFB_VRAM,
251                      VFB_GENERIC, 1280, 1024, 2048, 1024, 8, device_name, 1);                      VFB_GENERIC, 1280, 1024, 2048, 1024, 8, device_name);
252                  /*  bt455 = palette, bt431 = cursor  */                  /*  bt455 = palette, bt431 = cursor  */
253                  dev_bt455_init(mem, baseaddr + VFB_MFB_BT455, fb);                  dev_bt455_init(mem, baseaddr + VFB_MFB_BT455, fb);
254                  dev_bt431_init(mem, baseaddr + VFB_MFB_BT431, fb, 8);                  dev_bt431_init(mem, baseaddr + VFB_MFB_BT431, fb, 8);
# Line 257  void dev_turbochannel_init(struct machin Line 256  void dev_turbochannel_init(struct machin
256          } else if (strcmp(device_name, "PMAG-BA")==0) {          } else if (strcmp(device_name, "PMAG-BA")==0) {
257                  /*  cfb in NetBSD  */                  /*  cfb in NetBSD  */
258                  fb = dev_fb_init(machine, mem, baseaddr, VFB_GENERIC,                  fb = dev_fb_init(machine, mem, baseaddr, VFB_GENERIC,
259                      1024,864, 1024,1024,8, device_name, 1);                      1024,864, 1024,1024,8, device_name);
260                  dev_bt459_init(machine, mem, baseaddr + VFB_CFB_BT459,                  dev_bt459_init(machine, mem, baseaddr + VFB_CFB_BT459,
261                      baseaddr + 0x300000, fb, 8, irq, BT459_BA);                      baseaddr + 0x300000, fb, 8, irq, BT459_BA);
262                  /*  ROM at both 0x380000 and 0x3c0000?  */                  /*  ROM at both 0x380000 and 0x3c0000?  */
# Line 267  void dev_turbochannel_init(struct machin Line 266  void dev_turbochannel_init(struct machin
266                  /*  sfb in NetBSD  */                  /*  sfb in NetBSD  */
267                  /*  TODO: This is not working with Ultrix yet.  */                  /*  TODO: This is not working with Ultrix yet.  */
268                  fb = dev_fb_init(machine, mem, baseaddr + SFB_OFFSET_VRAM,                  fb = dev_fb_init(machine, mem, baseaddr + SFB_OFFSET_VRAM,
269                      VFB_GENERIC, 1280,1024, 1280,1024,8, device_name, 1);                      VFB_GENERIC, 1280,1024, 1280,1024,8, device_name);
270                  dev_sfb_init(machine, mem, baseaddr + SFB_ASIC_OFFSET, fb);                  dev_sfb_init(machine, mem, baseaddr + SFB_ASIC_OFFSET, fb);
271                  /*  TODO: the CLEAR doesn't get through, as the address                  /*  TODO: the CLEAR doesn't get through, as the address
272                          range is already in use by the asic  */                          range is already in use by the asic  */
# Line 295  void dev_turbochannel_init(struct machin Line 294  void dev_turbochannel_init(struct machin
294          } else if (strcmp(device_name, "PMAG-DV")==0) {          } else if (strcmp(device_name, "PMAG-DV")==0) {
295                  /*  xcfb in NetBSD: TODO  */                  /*  xcfb in NetBSD: TODO  */
296                  fb = dev_fb_init(machine, mem, baseaddr + 0x2000000,                  fb = dev_fb_init(machine, mem, baseaddr + 0x2000000,
297                      VFB_DEC_MAXINE, 0, 0, 0, 0, 0, "PMAG-DV", 1);                      VFB_DEC_MAXINE, 0, 0, 0, 0, 0, "PMAG-DV");
298                  /*  TODO:  not yet usable, needs a IMS332 vdac  */                  /*  TODO:  not yet usable, needs a IMS332 vdac  */
299                  rom_offset = 0x3c0000;                  rom_offset = 0x3c0000;
300          } else if (strcmp(device_name, "PMAG-JA")==0) {          } else if (strcmp(device_name, "PMAG-JA")==0) {
# Line 305  void dev_turbochannel_init(struct machin Line 304  void dev_turbochannel_init(struct machin
304          } else if (strcmp(device_name, "PMAG-RO")==0) {          } else if (strcmp(device_name, "PMAG-RO")==0) {
305                  /*  This works at least B/W in Ultrix, so far.  */                  /*  This works at least B/W in Ultrix, so far.  */
306                  fb = dev_fb_init(machine, mem, baseaddr + 0x200000,                  fb = dev_fb_init(machine, mem, baseaddr + 0x200000,
307                      VFB_GENERIC, 1280,1024, 1280,1024, 8, "PMAG-RO", 1);                      VFB_GENERIC, 1280,1024, 1280,1024, 8, "PMAG-RO");
308                  /*  TODO: bt463 at offset 0x040000, not bt459  */                  /*  TODO: bt463 at offset 0x040000, not bt459  */
309                  dev_bt459_init(machine, mem, baseaddr + 0x40000, 0,                  dev_bt459_init(machine, mem, baseaddr + 0x40000, 0,
310                      fb, 8, irq, 0);             /*  TODO: type  */                      fb, 8, irq, 0);             /*  TODO: type  */
# Line 335  void dev_turbochannel_init(struct machin Line 334  void dev_turbochannel_init(struct machin
334                  snprintf(name2, nlen, "turbochannel");                  snprintf(name2, nlen, "turbochannel");
335    
336          memory_device_register(mem, name2, baseaddr + rom_offset + rom_skip,          memory_device_register(mem, name2, baseaddr + rom_offset + rom_skip,
337              rom_length-rom_skip, dev_turbochannel_access, d, MEM_DEFAULT, NULL);              rom_length-rom_skip, dev_turbochannel_access, d, DM_DEFAULT, NULL);
338  }  }
339    

Legend:
Removed from v.10  
changed lines
  Added in v.22

  ViewVC Help
Powered by ViewVC 1.1.26