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

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

revision 21 by dpavlin, Mon Oct 8 16:19:23 2007 UTC revision 22 by dpavlin, Mon Oct 8 16:19:37 2007 UTC
# Line 1  Line 1 
1  /*  /*
2   *  Copyright (C) 2004-2005  Anders Gavare.  All rights reserved.   *  Copyright (C) 2004-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_au1x00.c,v 1.14 2005/11/13 00:14:08 debug Exp $   *  $Id: dev_au1x00.c,v 1.16 2006/01/01 13:17:16 debug Exp $
29   *     *  
30   *  Au1x00 (eg Au1500) pseudo device. See aureg.h for bitfield details.   *  Au1x00 (eg Au1500) pseudo device. See aureg.h for bitfield details.
31   *   *
# Line 52  struct au1x00_uart_data { Line 52  struct au1x00_uart_data {
52          int             console_handle;          int             console_handle;
53          int             uart_nr;          int             uart_nr;
54          int             irq_nr;          int             irq_nr;
55            int             in_use;
56          uint32_t        int_enable;          uint32_t        int_enable;
57          uint32_t        modem_control;          uint32_t        modem_control;
58  };  };
# Line 68  struct au1x00_pc_data { Line 69  struct au1x00_pc_data {
69   *   *
70   *  Interrupt Controller.   *  Interrupt Controller.
71   */   */
72  int dev_au1x00_ic_access(struct cpu *cpu, struct memory *mem,  DEVICE_ACCESS(au1x00_ic)
         uint64_t relative_addr, unsigned char *data, size_t len,  
         int writeflag, void *extra)  
73  {  {
74          struct au1x00_ic_data *d = extra;          struct au1x00_ic_data *d = extra;
75          uint64_t idata = 0, odata = 0;          uint64_t idata = 0, odata = 0;
# Line 190  int dev_au1x00_ic_access(struct cpu *cpu Line 189  int dev_au1x00_ic_access(struct cpu *cpu
189   *   *
190   *  UART (Serial controllers).   *  UART (Serial controllers).
191   */   */
192  int dev_au1x00_uart_access(struct cpu *cpu, struct memory *mem,  DEVICE_ACCESS(au1x00_uart)
         uint64_t relative_addr, unsigned char *data, size_t len,  
         int writeflag, void *extra)  
193  {  {
194          struct au1x00_uart_data *d = extra;          struct au1x00_uart_data *d = extra;
195          uint64_t idata = 0, odata = 0;          uint64_t idata = 0, odata = 0;
# Line 264  void dev_au1x00_pc_tick(struct cpu *cpu, Line 261  void dev_au1x00_pc_tick(struct cpu *cpu,
261   *   *
262   *  Programmable Counters.   *  Programmable Counters.
263   */   */
264  int dev_au1x00_pc_access(struct cpu *cpu, struct memory *mem,  DEVICE_ACCESS(au1x00_pc)
         uint64_t relative_addr, unsigned char *data, size_t len,  
         int writeflag, void *extra)  
265  {  {
266          struct au1x00_pc_data *d = extra;          struct au1x00_pc_data *d = extra;
267          uint64_t idata = 0, odata = 0;          uint64_t idata = 0, odata = 0;
# Line 341  struct au1x00_ic_data *dev_au1x00_init(s Line 336  struct au1x00_ic_data *dev_au1x00_init(s
336          d2->uart_nr = 2; d2->irq_nr = 2;          d2->uart_nr = 2; d2->irq_nr = 2;
337          d3->uart_nr = 3; d3->irq_nr = 3;          d3->uart_nr = 3; d3->irq_nr = 3;
338    
339          d0->console_handle = console_start_slave(machine, "AU1x00 port 0");          /*  Only allow input on the first UART, by default:  */
340          d1->console_handle = console_start_slave(machine, "AU1x00 port 1");          d0->console_handle = console_start_slave(machine, "AU1x00 port 0", 1);
341          d2->console_handle = console_start_slave(machine, "AU1x00 port 2");          d1->console_handle = console_start_slave(machine, "AU1x00 port 1", 0);
342          d3->console_handle = console_start_slave(machine, "AU1x00 port 3");          d2->console_handle = console_start_slave(machine, "AU1x00 port 2", 0);
343            d3->console_handle = console_start_slave(machine, "AU1x00 port 3", 0);
344            d0->in_use = 1;
345            d1->in_use = 0;
346            d2->in_use = 0;
347            d3->in_use = 0;
348    
349          d_pc->irq_nr = 14;          d_pc->irq_nr = 14;
350    

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

  ViewVC Help
Powered by ViewVC 1.1.26