/[dynamips]/upstream/dynamips-0.2.5/dev_ap1011.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

Contents of /upstream/dynamips-0.2.5/dev_ap1011.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (show annotations)
Sat Oct 6 16:01:44 2007 UTC (12 years, 2 months ago) by dpavlin
File MIME type: text/plain
File size: 1321 byte(s)
import 0.2.5 from upstream

1 /*
2 * Cisco C7200 (Predator) Simulation Platform.
3 * Copyright (c) 2006 Christophe Fillot. All rights reserved.
4 *
5 * AP1011 - Sturgeon HyperTransport-PCI Bridge.
6 */
7
8 #include <stdio.h>
9 #include <stdlib.h>
10 #include <string.h>
11 #include <time.h>
12 #include <errno.h>
13
14 #include "mips64.h"
15 #include "dynamips.h"
16 #include "memory.h"
17 #include "device.h"
18
19 #define AP1011_PCI_VENDOR_ID 0x14D9
20 #define AP1011_PCI_PRODUCT_ID 0x0010
21
22 /*
23 * pci_ap1011_read()
24 *
25 * Read a PCI register.
26 */
27 static m_uint32_t pci_ap1011_read(cpu_mips_t *cpu,struct pci_device *dev,
28 int reg)
29 {
30 switch (reg) {
31 case 0x08:
32 return(0x06040000);
33 case 0x34:
34 return(0x00000040);
35 case 0x40:
36 return(0x00210008);
37 case 0x44:
38 return(0x00000020);
39 case 0x48:
40 return(0x000000C0);
41 default:
42 return(0);
43 }
44 }
45
46 /* Create an AP1011 Sturgeon HyperTransport-PCI Bridge */
47 int dev_ap1011_init(struct pci_bus *pci_bus,int pci_device,
48 struct pci_bus *sec_bus)
49 {
50 struct pci_device *dev;
51
52 dev = pci_bridge_create_dev(pci_bus,"ap1011",
53 AP1011_PCI_VENDOR_ID,AP1011_PCI_PRODUCT_ID,
54 pci_device,0,sec_bus,pci_ap1011_read,NULL);
55
56 return((dev != NULL) ? 0 : -1);
57 }

  ViewVC Help
Powered by ViewVC 1.1.26